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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (383) hide show
  1. package/dist/cjs/components/accordion/index.cjs +1 -1
  2. package/dist/cjs/components/accordion/index.cjs.map +1 -1
  3. package/dist/cjs/components/alert/container.cjs +1 -1
  4. package/dist/cjs/components/alert/container.cjs.map +1 -1
  5. package/dist/cjs/components/avatar/index.cjs +1 -1
  6. package/dist/cjs/components/avatar/index.cjs.map +1 -1
  7. package/dist/cjs/components/button-stateful/check-props.cjs +2 -0
  8. package/dist/cjs/components/button-stateful/check-props.cjs.map +1 -0
  9. package/dist/cjs/components/button-stateful/component.cjs +2 -0
  10. package/dist/cjs/components/button-stateful/component.cjs.map +1 -0
  11. package/dist/cjs/components/button-stateful/index.cjs +1 -1
  12. package/dist/cjs/components/button-stateful/index.cjs.map +1 -1
  13. package/dist/cjs/components/carousel/index.cjs +1 -1
  14. package/dist/cjs/components/carousel/index.cjs.map +1 -1
  15. package/dist/cjs/components/checkbox/check-props.cjs +1 -1
  16. package/dist/cjs/components/checkbox/check-props.cjs.map +1 -1
  17. package/dist/cjs/components/checkbox/index.cjs +1 -1
  18. package/dist/cjs/components/checkbox/index.cjs.map +1 -1
  19. package/dist/cjs/components/color-picker/check-props.cjs +1 -1
  20. package/dist/cjs/components/color-picker/check-props.cjs.map +1 -1
  21. package/dist/cjs/components/color-picker/color-picker.cjs +1 -1
  22. package/dist/cjs/components/color-picker/color-picker.cjs.map +1 -1
  23. package/dist/cjs/components/color-picker/private/color-picker-tabs.cjs +2 -0
  24. package/dist/cjs/components/color-picker/private/color-picker-tabs.cjs.map +1 -0
  25. package/dist/cjs/components/color-picker/private/hsv-color.cjs +1 -1
  26. package/dist/cjs/components/color-picker/private/hsv-color.cjs.map +1 -1
  27. package/dist/cjs/components/combobox/check-props.cjs +1 -1
  28. package/dist/cjs/components/combobox/check-props.cjs.map +1 -1
  29. package/dist/cjs/components/combobox/combobox.cjs +1 -1
  30. package/dist/cjs/components/combobox/combobox.cjs.map +1 -1
  31. package/dist/cjs/components/combobox/index.cjs +1 -1
  32. package/dist/cjs/components/date-picker/check-props.cjs +1 -1
  33. package/dist/cjs/components/date-picker/check-props.cjs.map +1 -1
  34. package/dist/cjs/components/date-picker/date-picker.cjs +1 -1
  35. package/dist/cjs/components/date-picker/date-picker.cjs.map +1 -1
  36. package/dist/cjs/components/date-picker/index.cjs.map +1 -1
  37. package/dist/cjs/components/date-picker/private/calendar-wrapper.cjs.map +1 -1
  38. package/dist/cjs/components/expandable-section/index.cjs +1 -1
  39. package/dist/cjs/components/expandable-section/index.cjs.map +1 -1
  40. package/dist/cjs/components/icon/input-icon/index.cjs +1 -1
  41. package/dist/cjs/components/icon/input-icon/index.cjs.map +1 -1
  42. package/dist/cjs/components/index.cjs +1 -1
  43. package/dist/cjs/components/input/check-props.cjs +1 -1
  44. package/dist/cjs/components/input/check-props.cjs.map +1 -1
  45. package/dist/cjs/components/input/index.cjs +1 -1
  46. package/dist/cjs/components/input/index.cjs.map +1 -1
  47. package/dist/cjs/components/input/private/inner-input.cjs +1 -1
  48. package/dist/cjs/components/input/private/inner-input.cjs.map +1 -1
  49. package/dist/cjs/components/menu-dropdown/button-trigger.cjs +1 -1
  50. package/dist/cjs/components/menu-dropdown/button-trigger.cjs.map +1 -1
  51. package/dist/cjs/components/menu-dropdown/index.cjs.map +1 -1
  52. package/dist/cjs/components/menu-dropdown/menu-dropdown.cjs +1 -1
  53. package/dist/cjs/components/menu-dropdown/menu-dropdown.cjs.map +1 -1
  54. package/dist/cjs/components/modal/index.cjs +1 -1
  55. package/dist/cjs/components/modal/index.cjs.map +1 -1
  56. package/dist/cjs/components/popover/index.cjs.map +1 -1
  57. package/dist/cjs/components/popover/popover.cjs +1 -1
  58. package/dist/cjs/components/popover/popover.cjs.map +1 -1
  59. package/dist/cjs/components/radio/check-props.cjs +1 -1
  60. package/dist/cjs/components/radio/check-props.cjs.map +1 -1
  61. package/dist/cjs/components/radio/index.cjs +1 -1
  62. package/dist/cjs/components/radio/index.cjs.map +1 -1
  63. package/dist/cjs/components/radio-button-group/index.cjs.map +1 -1
  64. package/dist/cjs/components/radio-button-group/radio.cjs.map +1 -1
  65. package/dist/cjs/components/radio-group/check-props.cjs +2 -0
  66. package/dist/cjs/components/radio-group/check-props.cjs.map +1 -0
  67. package/dist/cjs/components/radio-group/component.cjs +2 -0
  68. package/dist/cjs/components/radio-group/component.cjs.map +1 -0
  69. package/dist/cjs/components/radio-group/index.cjs +1 -1
  70. package/dist/cjs/components/radio-group/index.cjs.map +1 -1
  71. package/dist/cjs/components/setup-assistant/step.cjs +1 -1
  72. package/dist/cjs/components/setup-assistant/step.cjs.map +1 -1
  73. package/dist/cjs/components/simple-data-table/check-props.cjs +1 -1
  74. package/dist/cjs/components/simple-data-table/check-props.cjs.map +1 -1
  75. package/dist/cjs/components/simple-data-table/column.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/private/head.cjs +1 -1
  79. package/dist/cjs/components/simple-data-table/private/head.cjs.map +1 -1
  80. package/dist/cjs/components/simple-data-table/private/header-cell.cjs +1 -1
  81. package/dist/cjs/components/simple-data-table/private/header-cell.cjs.map +1 -1
  82. package/dist/cjs/components/simple-data-table/private/row.cjs +1 -1
  83. package/dist/cjs/components/simple-data-table/private/row.cjs.map +1 -1
  84. package/dist/cjs/components/slider/check-props.cjs +1 -1
  85. package/dist/cjs/components/slider/check-props.cjs.map +1 -1
  86. package/dist/cjs/components/slider/index.cjs +1 -1
  87. package/dist/cjs/components/slider/index.cjs.map +1 -1
  88. package/dist/cjs/components/split-view/index.cjs +1 -1
  89. package/dist/cjs/components/split-view/index.cjs.map +1 -1
  90. package/dist/cjs/components/split-view/listbox-check-props.cjs +1 -1
  91. package/dist/cjs/components/split-view/listbox-check-props.cjs.map +1 -1
  92. package/dist/cjs/components/split-view/listbox.cjs +1 -1
  93. package/dist/cjs/components/split-view/listbox.cjs.map +1 -1
  94. package/dist/cjs/components/tabs/check-props.cjs +2 -0
  95. package/dist/cjs/components/tabs/check-props.cjs.map +1 -0
  96. package/dist/cjs/components/tabs/component.cjs +2 -0
  97. package/dist/cjs/components/tabs/component.cjs.map +1 -0
  98. package/dist/cjs/components/tabs/index.cjs +1 -1
  99. package/dist/cjs/components/tabs/index.cjs.map +1 -1
  100. package/dist/cjs/components/tabs/panel.cjs.map +1 -1
  101. package/dist/cjs/components/textarea/check-props.cjs +1 -1
  102. package/dist/cjs/components/textarea/check-props.cjs.map +1 -1
  103. package/dist/cjs/components/textarea/index.cjs +1 -1
  104. package/dist/cjs/components/textarea/index.cjs.map +1 -1
  105. package/dist/cjs/components/toast/container.cjs +1 -1
  106. package/dist/cjs/components/toast/container.cjs.map +1 -1
  107. package/dist/cjs/components/tooltip/index.cjs +2 -2
  108. package/dist/cjs/components/tooltip/index.cjs.map +1 -1
  109. package/dist/cjs/components/tree/check-props.cjs +1 -1
  110. package/dist/cjs/components/tree/check-props.cjs.map +1 -1
  111. package/dist/cjs/components/tree/private/branch.cjs +1 -1
  112. package/dist/cjs/components/tree/private/branch.cjs.map +1 -1
  113. package/dist/cjs/components/tree/private/item.cjs +1 -1
  114. package/dist/cjs/components/tree/private/item.cjs.map +1 -1
  115. package/dist/cjs/components/tree/private/render-branch.cjs +1 -1
  116. package/dist/cjs/components/tree/private/render-branch.cjs.map +1 -1
  117. package/dist/cjs/components/tree/tree.cjs +1 -1
  118. package/dist/cjs/components/tree/tree.cjs.map +1 -1
  119. package/dist/cjs/components/vertical-navigation/check-props.cjs +2 -0
  120. package/dist/cjs/components/vertical-navigation/check-props.cjs.map +1 -0
  121. package/dist/cjs/components/vertical-navigation/component.cjs +2 -0
  122. package/dist/cjs/components/vertical-navigation/component.cjs.map +1 -0
  123. package/dist/cjs/components/vertical-navigation/index.cjs +1 -1
  124. package/dist/cjs/components/vertical-navigation/index.cjs.map +1 -1
  125. package/dist/cjs/components/welcome-mat/info-badge.cjs +1 -1
  126. package/dist/cjs/components/welcome-mat/info-badge.cjs.map +1 -1
  127. package/dist/cjs/utilities/hooks/index.cjs +1 -1
  128. package/dist/cjs/utilities/hooks/use-controllable-state.cjs +2 -0
  129. package/dist/cjs/utilities/hooks/use-controllable-state.cjs.map +1 -0
  130. package/dist/cjs/utilities/warning/required-property.cjs +2 -0
  131. package/dist/cjs/utilities/warning/required-property.cjs.map +1 -0
  132. package/dist/es/components/accordion/index.js +10 -8
  133. package/dist/es/components/accordion/index.js.map +1 -1
  134. package/dist/es/components/alert/container.js +1 -1
  135. package/dist/es/components/alert/container.js.map +1 -1
  136. package/dist/es/components/avatar/index.js +2 -1
  137. package/dist/es/components/avatar/index.js.map +1 -1
  138. package/dist/es/components/button-stateful/check-props.js +14 -0
  139. package/dist/es/components/button-stateful/check-props.js.map +1 -0
  140. package/dist/es/components/button-stateful/component.js +20 -0
  141. package/dist/es/components/button-stateful/component.js.map +1 -0
  142. package/dist/es/components/button-stateful/index.js +102 -94
  143. package/dist/es/components/button-stateful/index.js.map +1 -1
  144. package/dist/es/components/carousel/index.js +112 -130
  145. package/dist/es/components/carousel/index.js.map +1 -1
  146. package/dist/es/components/checkbox/check-props.js +14 -8
  147. package/dist/es/components/checkbox/check-props.js.map +1 -1
  148. package/dist/es/components/checkbox/index.js +40 -33
  149. package/dist/es/components/checkbox/index.js.map +1 -1
  150. package/dist/es/components/color-picker/check-props.js +16 -11
  151. package/dist/es/components/color-picker/check-props.js.map +1 -1
  152. package/dist/es/components/color-picker/color-picker.js +185 -169
  153. package/dist/es/components/color-picker/color-picker.js.map +1 -1
  154. package/dist/es/components/color-picker/private/color-picker-tabs.js +17 -0
  155. package/dist/es/components/color-picker/private/color-picker-tabs.js.map +1 -0
  156. package/dist/es/components/color-picker/private/hsv-color.js +1 -0
  157. package/dist/es/components/color-picker/private/hsv-color.js.map +1 -1
  158. package/dist/es/components/combobox/check-props.js +15 -14
  159. package/dist/es/components/combobox/check-props.js.map +1 -1
  160. package/dist/es/components/combobox/combobox.js +399 -399
  161. package/dist/es/components/combobox/combobox.js.map +1 -1
  162. package/dist/es/components/combobox/index.js +4 -4
  163. package/dist/es/components/date-picker/check-props.js +15 -9
  164. package/dist/es/components/date-picker/check-props.js.map +1 -1
  165. package/dist/es/components/date-picker/date-picker.js +144 -138
  166. package/dist/es/components/date-picker/date-picker.js.map +1 -1
  167. package/dist/es/components/date-picker/index.js.map +1 -1
  168. package/dist/es/components/date-picker/private/calendar-wrapper.js.map +1 -1
  169. package/dist/es/components/expandable-section/index.js +32 -26
  170. package/dist/es/components/expandable-section/index.js.map +1 -1
  171. package/dist/es/components/icon/input-icon/index.js +7 -2
  172. package/dist/es/components/icon/input-icon/index.js.map +1 -1
  173. package/dist/es/components/index.js +3 -3
  174. package/dist/es/components/input/check-props.js +19 -17
  175. package/dist/es/components/input/check-props.js.map +1 -1
  176. package/dist/es/components/input/index.js +153 -156
  177. package/dist/es/components/input/index.js.map +1 -1
  178. package/dist/es/components/input/private/inner-input.js +18 -18
  179. package/dist/es/components/input/private/inner-input.js.map +1 -1
  180. package/dist/es/components/menu-dropdown/button-trigger.js +7 -1
  181. package/dist/es/components/menu-dropdown/button-trigger.js.map +1 -1
  182. package/dist/es/components/menu-dropdown/index.js.map +1 -1
  183. package/dist/es/components/menu-dropdown/menu-dropdown.js +294 -269
  184. package/dist/es/components/menu-dropdown/menu-dropdown.js.map +1 -1
  185. package/dist/es/components/modal/index.js +1 -1
  186. package/dist/es/components/modal/index.js.map +1 -1
  187. package/dist/es/components/popover/index.js.map +1 -1
  188. package/dist/es/components/popover/popover.js +209 -205
  189. package/dist/es/components/popover/popover.js.map +1 -1
  190. package/dist/es/components/radio/check-props.js +8 -8
  191. package/dist/es/components/radio/check-props.js.map +1 -1
  192. package/dist/es/components/radio/index.js +15 -13
  193. package/dist/es/components/radio/index.js.map +1 -1
  194. package/dist/es/components/radio-button-group/index.js.map +1 -1
  195. package/dist/es/components/radio-button-group/radio.js.map +1 -1
  196. package/dist/es/components/radio-group/check-props.js +14 -0
  197. package/dist/es/components/radio-group/check-props.js.map +1 -0
  198. package/dist/es/components/radio-group/component.js +21 -0
  199. package/dist/es/components/radio-group/component.js.map +1 -0
  200. package/dist/es/components/radio-group/index.js +62 -38
  201. package/dist/es/components/radio-group/index.js.map +1 -1
  202. package/dist/es/components/setup-assistant/step.js +5 -4
  203. package/dist/es/components/setup-assistant/step.js.map +1 -1
  204. package/dist/es/components/simple-data-table/check-props.js +7 -6
  205. package/dist/es/components/simple-data-table/check-props.js.map +1 -1
  206. package/dist/es/components/simple-data-table/column.js.map +1 -1
  207. package/dist/es/components/simple-data-table/index.js +67 -49
  208. package/dist/es/components/simple-data-table/index.js.map +1 -1
  209. package/dist/es/components/simple-data-table/private/head.js +1 -1
  210. package/dist/es/components/simple-data-table/private/head.js.map +1 -1
  211. package/dist/es/components/simple-data-table/private/header-cell.js +50 -52
  212. package/dist/es/components/simple-data-table/private/header-cell.js.map +1 -1
  213. package/dist/es/components/simple-data-table/private/row.js +43 -57
  214. package/dist/es/components/simple-data-table/private/row.js.map +1 -1
  215. package/dist/es/components/slider/check-props.js +14 -12
  216. package/dist/es/components/slider/check-props.js.map +1 -1
  217. package/dist/es/components/slider/index.js +54 -48
  218. package/dist/es/components/slider/index.js.map +1 -1
  219. package/dist/es/components/split-view/index.js +23 -22
  220. package/dist/es/components/split-view/index.js.map +1 -1
  221. package/dist/es/components/split-view/listbox-check-props.js +10 -2
  222. package/dist/es/components/split-view/listbox-check-props.js.map +1 -1
  223. package/dist/es/components/split-view/listbox.js +67 -50
  224. package/dist/es/components/split-view/listbox.js.map +1 -1
  225. package/dist/es/components/tabs/check-props.js +15 -0
  226. package/dist/es/components/tabs/check-props.js.map +1 -0
  227. package/dist/es/components/tabs/component.js +28 -0
  228. package/dist/es/components/tabs/component.js.map +1 -0
  229. package/dist/es/components/tabs/index.js +84 -69
  230. package/dist/es/components/tabs/index.js.map +1 -1
  231. package/dist/es/components/tabs/panel.js.map +1 -1
  232. package/dist/es/components/textarea/check-props.js +1 -1
  233. package/dist/es/components/textarea/check-props.js.map +1 -1
  234. package/dist/es/components/textarea/index.js +3 -2
  235. package/dist/es/components/textarea/index.js.map +1 -1
  236. package/dist/es/components/toast/container.js +1 -1
  237. package/dist/es/components/toast/container.js.map +1 -1
  238. package/dist/es/components/tooltip/index.js +120 -109
  239. package/dist/es/components/tooltip/index.js.map +1 -1
  240. package/dist/es/components/tree/check-props.js +14 -9
  241. package/dist/es/components/tree/check-props.js.map +1 -1
  242. package/dist/es/components/tree/private/branch.js +38 -35
  243. package/dist/es/components/tree/private/branch.js.map +1 -1
  244. package/dist/es/components/tree/private/item.js +6 -8
  245. package/dist/es/components/tree/private/item.js.map +1 -1
  246. package/dist/es/components/tree/private/render-branch.js +9 -10
  247. package/dist/es/components/tree/private/render-branch.js.map +1 -1
  248. package/dist/es/components/tree/tree.js +126 -97
  249. package/dist/es/components/tree/tree.js.map +1 -1
  250. package/dist/es/components/vertical-navigation/check-props.js +13 -0
  251. package/dist/es/components/vertical-navigation/check-props.js.map +1 -0
  252. package/dist/es/components/vertical-navigation/component.js +27 -0
  253. package/dist/es/components/vertical-navigation/component.js.map +1 -0
  254. package/dist/es/components/vertical-navigation/index.js +27 -26
  255. package/dist/es/components/vertical-navigation/index.js.map +1 -1
  256. package/dist/es/components/welcome-mat/info-badge.js +14 -4
  257. package/dist/es/components/welcome-mat/info-badge.js.map +1 -1
  258. package/dist/es/utilities/hooks/index.js +2 -1
  259. package/dist/es/utilities/hooks/use-controllable-state.js +20 -0
  260. package/dist/es/utilities/hooks/use-controllable-state.js.map +1 -0
  261. package/dist/es/utilities/warning/required-property.js +15 -0
  262. package/dist/es/utilities/warning/required-property.js.map +1 -0
  263. package/dist/types/components/accordion/index.d.ts.map +1 -1
  264. package/dist/types/components/avatar/index.d.ts.map +1 -1
  265. package/dist/types/components/button-stateful/check-props.d.ts +3 -0
  266. package/dist/types/components/button-stateful/check-props.d.ts.map +1 -0
  267. package/dist/types/components/button-stateful/index.d.ts +34 -6
  268. package/dist/types/components/button-stateful/index.d.ts.map +1 -1
  269. package/dist/types/components/carousel/index.d.ts +26 -7
  270. package/dist/types/components/carousel/index.d.ts.map +1 -1
  271. package/dist/types/components/checkbox/check-props.d.ts +1 -0
  272. package/dist/types/components/checkbox/check-props.d.ts.map +1 -1
  273. package/dist/types/components/checkbox/index.d.ts +38 -9
  274. package/dist/types/components/checkbox/index.d.ts.map +1 -1
  275. package/dist/types/components/color-picker/check-props.d.ts.map +1 -1
  276. package/dist/types/components/color-picker/color-picker.d.ts +50 -11
  277. package/dist/types/components/color-picker/color-picker.d.ts.map +1 -1
  278. package/dist/types/components/color-picker/index.d.ts +2 -2
  279. package/dist/types/components/color-picker/index.d.ts.map +1 -1
  280. package/dist/types/components/color-picker/private/color-picker-tabs.d.ts +14 -0
  281. package/dist/types/components/color-picker/private/color-picker-tabs.d.ts.map +1 -0
  282. package/dist/types/components/color-picker/private/hsv-color.d.ts.map +1 -1
  283. package/dist/types/components/color-picker/types.d.ts +9 -5
  284. package/dist/types/components/color-picker/types.d.ts.map +1 -1
  285. package/dist/types/components/combobox/check-props.d.ts.map +1 -1
  286. package/dist/types/components/combobox/combobox.d.ts +41 -6
  287. package/dist/types/components/combobox/combobox.d.ts.map +1 -1
  288. package/dist/types/components/date-picker/check-props.d.ts.map +1 -1
  289. package/dist/types/components/date-picker/date-picker.d.ts +52 -17
  290. package/dist/types/components/date-picker/date-picker.d.ts.map +1 -1
  291. package/dist/types/components/date-picker/index.d.ts +1 -1
  292. package/dist/types/components/date-picker/index.d.ts.map +1 -1
  293. package/dist/types/components/date-picker/private/calendar-wrapper.d.ts +3 -1
  294. package/dist/types/components/date-picker/private/calendar-wrapper.d.ts.map +1 -1
  295. package/dist/types/components/expandable-section/index.d.ts +15 -3
  296. package/dist/types/components/expandable-section/index.d.ts.map +1 -1
  297. package/dist/types/components/icon/input-icon/index.d.ts.map +1 -1
  298. package/dist/types/components/input/check-props.d.ts.map +1 -1
  299. package/dist/types/components/input/index.d.ts +10 -4
  300. package/dist/types/components/input/index.d.ts.map +1 -1
  301. package/dist/types/components/input/private/inner-input.d.ts +2 -4
  302. package/dist/types/components/input/private/inner-input.d.ts.map +1 -1
  303. package/dist/types/components/menu-dropdown/button-trigger.d.ts.map +1 -1
  304. package/dist/types/components/menu-dropdown/index.d.ts +1 -1
  305. package/dist/types/components/menu-dropdown/index.d.ts.map +1 -1
  306. package/dist/types/components/menu-dropdown/menu-dropdown.d.ts +78 -15
  307. package/dist/types/components/menu-dropdown/menu-dropdown.d.ts.map +1 -1
  308. package/dist/types/components/popover/index.d.ts +1 -1
  309. package/dist/types/components/popover/index.d.ts.map +1 -1
  310. package/dist/types/components/popover/popover.d.ts +30 -3
  311. package/dist/types/components/popover/popover.d.ts.map +1 -1
  312. package/dist/types/components/radio/check-props.d.ts.map +1 -1
  313. package/dist/types/components/radio/index.d.ts +42 -9
  314. package/dist/types/components/radio/index.d.ts.map +1 -1
  315. package/dist/types/components/radio-button-group/index.d.ts +20 -10
  316. package/dist/types/components/radio-button-group/index.d.ts.map +1 -1
  317. package/dist/types/components/radio-button-group/radio.d.ts +7 -2
  318. package/dist/types/components/radio-button-group/radio.d.ts.map +1 -1
  319. package/dist/types/components/radio-group/check-props.d.ts +3 -0
  320. package/dist/types/components/radio-group/check-props.d.ts.map +1 -0
  321. package/dist/types/components/radio-group/index.d.ts +51 -8
  322. package/dist/types/components/radio-group/index.d.ts.map +1 -1
  323. package/dist/types/components/radio-group/radio.d.ts +7 -2
  324. package/dist/types/components/radio-group/radio.d.ts.map +1 -1
  325. package/dist/types/components/setup-assistant/step.d.ts +10 -2
  326. package/dist/types/components/setup-assistant/step.d.ts.map +1 -1
  327. package/dist/types/components/simple-data-table/check-props.d.ts.map +1 -1
  328. package/dist/types/components/simple-data-table/column.d.ts +4 -1
  329. package/dist/types/components/simple-data-table/column.d.ts.map +1 -1
  330. package/dist/types/components/simple-data-table/index.d.ts +10 -2
  331. package/dist/types/components/simple-data-table/index.d.ts.map +1 -1
  332. package/dist/types/components/simple-data-table/private/header-cell.d.ts.map +1 -1
  333. package/dist/types/components/simple-data-table/private/row.d.ts +4 -2
  334. package/dist/types/components/simple-data-table/private/row.d.ts.map +1 -1
  335. package/dist/types/components/simple-data-table/types.d.ts +40 -13
  336. package/dist/types/components/simple-data-table/types.d.ts.map +1 -1
  337. package/dist/types/components/slider/check-props.d.ts.map +1 -1
  338. package/dist/types/components/slider/index.d.ts +23 -10
  339. package/dist/types/components/slider/index.d.ts.map +1 -1
  340. package/dist/types/components/split-view/index.d.ts +12 -3
  341. package/dist/types/components/split-view/index.d.ts.map +1 -1
  342. package/dist/types/components/split-view/listbox-check-props.d.ts +1 -0
  343. package/dist/types/components/split-view/listbox-check-props.d.ts.map +1 -1
  344. package/dist/types/components/split-view/listbox.d.ts +41 -10
  345. package/dist/types/components/split-view/listbox.d.ts.map +1 -1
  346. package/dist/types/components/tabs/check-props.d.ts +3 -0
  347. package/dist/types/components/tabs/check-props.d.ts.map +1 -0
  348. package/dist/types/components/tabs/index.d.ts +46 -12
  349. package/dist/types/components/tabs/index.d.ts.map +1 -1
  350. package/dist/types/components/tabs/panel.d.ts +4 -0
  351. package/dist/types/components/tabs/panel.d.ts.map +1 -1
  352. package/dist/types/components/textarea/check-props.d.ts.map +1 -1
  353. package/dist/types/components/textarea/index.d.ts +14 -6
  354. package/dist/types/components/textarea/index.d.ts.map +1 -1
  355. package/dist/types/components/toast/container.d.ts +1 -1
  356. package/dist/types/components/tooltip/index.d.ts +49 -3
  357. package/dist/types/components/tooltip/index.d.ts.map +1 -1
  358. package/dist/types/components/tree/check-props.d.ts +1 -0
  359. package/dist/types/components/tree/check-props.d.ts.map +1 -1
  360. package/dist/types/components/tree/private/branch.d.ts +6 -1
  361. package/dist/types/components/tree/private/branch.d.ts.map +1 -1
  362. package/dist/types/components/tree/private/item.d.ts +3 -1
  363. package/dist/types/components/tree/private/item.d.ts.map +1 -1
  364. package/dist/types/components/tree/private/render-branch.d.ts +3 -1
  365. package/dist/types/components/tree/private/render-branch.d.ts.map +1 -1
  366. package/dist/types/components/tree/tree.d.ts +33 -6
  367. package/dist/types/components/tree/tree.d.ts.map +1 -1
  368. package/dist/types/components/tree/types.d.ts +23 -4
  369. package/dist/types/components/tree/types.d.ts.map +1 -1
  370. package/dist/types/components/vertical-navigation/check-props.d.ts +1 -0
  371. package/dist/types/components/vertical-navigation/check-props.d.ts.map +1 -1
  372. package/dist/types/components/vertical-navigation/index.d.ts +9 -4
  373. package/dist/types/components/vertical-navigation/index.d.ts.map +1 -1
  374. package/dist/types/components/welcome-mat/info-badge.d.ts.map +1 -1
  375. package/dist/types/types/components.d.ts +0 -2
  376. package/dist/types/types/components.d.ts.map +1 -1
  377. package/dist/types/utilities/hooks/index.d.ts +1 -0
  378. package/dist/types/utilities/hooks/index.d.ts.map +1 -1
  379. package/dist/types/utilities/hooks/use-controllable-state.d.ts +23 -0
  380. package/dist/types/utilities/hooks/use-controllable-state.d.ts.map +1 -0
  381. package/dist/types/utilities/warning/required-property.d.ts +3 -0
  382. package/dist/types/utilities/warning/required-property.d.ts.map +1 -0
  383. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"check-props.cjs","names":[],"sources":["../../../../components/color-picker/check-props.js"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n/* eslint-disable import/no-mutable-exports */\n\nimport onlyOneOfProperties from '../../utilities/warning/only-one-of-properties';\nimport getComponentDocFn from '../../utilities/get-component-doc';\n\nlet checkProps = function checkPropsFunction() {};\n\nif (process.env.NODE_ENV !== 'production') {\n\tcheckProps = function checkPropsFunction(COMPONENT, props, jsonDoc) {\n\t\tconst createDocUrl = getComponentDocFn(jsonDoc);\n\n\t\tonlyOneOfProperties(\n\t\t\tCOMPONENT,\n\t\t\t{\n\t\t\t\t'assistiveText.label': props.assistiveText && props.assistiveText.label,\n\t\t\t\tlabel: props.labels && props.labels.label,\n\t\t\t},\n\t\t\tcreateDocUrl('assistiveText')\n\t\t);\n\t};\n}\n\nexport default checkProps;\n"],"mappings":"yHAOA,IAAI,EAAa,UAA8B,CAAC,EAEhD,QAAA,IAAA,WAA6B,eAC5B,EAAa,SAA4B,EAAW,EAAO,EAAS,CACnE,IAAM,EAAe,EAAA,QAAkB,CAAO,EAE9C,EAAA,QACC,EACA,CACC,sBAAuB,EAAM,eAAiB,EAAM,cAAc,MAClE,MAAO,EAAM,QAAU,EAAM,OAAO,KACrC,EACA,EAAa,eAAe,CAC7B,CACD,GAGD,IAAA,EAAe"}
1
+ {"version":3,"file":"check-props.cjs","names":[],"sources":["../../../../components/color-picker/check-props.js"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n/* eslint-disable import/no-mutable-exports */\n\nimport warning from 'warning';\n\nimport onlyOneOfProperties from '../../utilities/warning/only-one-of-properties';\nimport requiredProperty from '../../utilities/warning/required-property';\nimport getComponentDocFn from '../../utilities/get-component-doc';\n\nlet checkProps = function checkPropsFunction() {};\n\nif (process.env.NODE_ENV !== 'production') {\n\tlet hasWarnedMissingValue = false;\n\n\tcheckProps = function checkPropsFunction(COMPONENT, props, jsonDoc) {\n\t\tconst createDocUrl = getComponentDocFn(jsonDoc);\n\n\t\tonlyOneOfProperties(\n\t\t\tCOMPONENT,\n\t\t\t{\n\t\t\t\t'assistiveText.label': props.assistiveText && props.assistiveText.label,\n\t\t\t\tlabel: props.labels && props.labels.label,\n\t\t\t},\n\t\t\tcreateDocUrl('assistiveText')\n\t\t);\n\n\t\tif (!hasWarnedMissingValue) {\n\t\t\twarning(\n\t\t\t\tprops.value !== undefined,\n\t\t\t\t`[Design System React] \\`value\\` is required by ${COMPONENT}. ColorPicker is controlled: pass \\`value\\` (\\`''\\` for no color) and update it in \\`events.onChange\\`.`\n\t\t\t);\n\t\t\thasWarnedMissingValue = props.value === undefined;\n\t\t}\n\n\t\trequiredProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.events?.onChange !== undefined || !!props.disabled,\n\t\t\t'events.onChange',\n\t\t\t`ColorPicker is controlled: without \\`events.onChange\\`, choosing a color does nothing. Update \\`value\\` from \\`data.color\\` in \\`events.onChange\\`, or set \\`disabled\\`. ${createDocUrl(\n\t\t\t\t'events'\n\t\t\t)}`\n\t\t);\n\t};\n}\n\nexport default checkProps;\n"],"mappings":"gRAUA,IAAI,EAAa,UAA8B,CAAC,EAEhD,GAAA,QAAA,IAAA,WAA6B,aAAc,CAC1C,IAAI,EAAwB,GAE5B,EAAa,SAA4B,EAAW,EAAO,EAAS,CACnE,IAAM,EAAe,EAAA,QAAkB,CAAO,EAE9C,EAAA,QACC,EACA,CACC,sBAAuB,EAAM,eAAiB,EAAM,cAAc,MAClE,MAAO,EAAM,QAAU,EAAM,OAAO,KACrC,EACA,EAAa,eAAe,CAC7B,EAEA,AAKC,MAJA,EAAA,EAAA,QAAA,CACC,EAAM,QAAU,IAAA,GAChB,kDAAkD,EAAU,wGAC7D,EACwB,EAAM,QAAU,IAAA,IAGzC,EAAA,QACC,EACA,EAAM,QAAQ,WAAa,IAAA,IAAa,CAAC,CAAC,EAAM,SAChD,kBACA,4KAA4K,EAC3K,QACD,GACD,CACD,CACD,CAEA,IAAA,EAAe"}
@@ -1,2 +1,2 @@
1
- const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../utilities/constants.cjs"),n=require("../../utilities/generate-id.cjs"),r=require("../button/index.cjs"),i=require("../input/index.cjs"),a=require("./check-props.cjs"),ee=require("./private/swatch.cjs"),o=require("../../utilities/color.cjs"),s=require("./private/custom-color.cjs"),te=require("./private/swatch-picker.cjs"),c=require("../tabs/index.cjs"),l=require("../tabs/panel.cjs"),u=require("../popover/index.cjs");let d=require("react");d=e.__toESM(d,1);let f=require("classnames");f=e.__toESM(f,1);let p=require("react/jsx-runtime");var m={blueAbbreviated:`B`,cancelButton:`Cancel`,customTab:`Custom`,customTabActiveWorkingColorSwatch:`Working Color`,customTabTransparentSwatch:`Transparent Swatch`,greenAbbreviated:`G`,hexLabel:`Hex`,invalidColor:`The color entered is invalid`,invalidComponent:`The value needs to be an integer from 0-255`,redAbbreviated:`R`,submitButton:`Done`,swatchTab:`Default`,swatchTabTransparentSwatch:`Transparent Swatch`},h={saturationValueGrid:`Use arrow keys to select a saturation and brightness, on an x and y axis.`,hueSlider:`Select Hue`},g=`#e3abec.#c2dbf7.#9fd6ff.#9de7da.#9df0c0.#fff099.#fed49a.#d073e0.#86baf3.#5ebbff.#44d8be.#3be282.#ffe654.#ffb758.#bd35bd.#5779c1.#5679c0.#00aea9.#3cba4c.#f5bc25.#f99221.#580d8c.#001970.#0a2399.#0b7477.#0b6b50.#b67e11.#b85d0d.`.split(`.`),_=({assistiveText:e,className:_,classNameMenu:v,id:y,disabled:b=!1,errorText:x,errorTextWorkingColor:S,events:C={},hasStaticAlignment:w,hideInput:T=!1,isOpen:E,labels:D,menuPosition:O=`absolute`,swatchColors:k=g,defaultSelectedTab:A=`swatches`,variant:j=`base`,value:M,valueWorking:N,onClose:ne,onOpen:re,onRequestClose:P,onRequestOpen:F})=>{let I=(0,d.useMemo)(()=>({...m,...D}),[D]),L=(0,d.useMemo)(()=>({...h,...e}),[e]),ie=(0,d.useRef)(y||n.default()),R=y||ie.current,ae=(0,d.useRef)(null),z=(0,d.useCallback)(()=>o.default.getNewColor({hex:N||M},C.onValidateWorkingColor),[N,M,C.onValidateWorkingColor]),[B,V]=(0,d.useState)(M??``),[H,U]=(0,d.useState)(E||!1),[W,G]=(0,d.useState)(z),[K,q]=(0,d.useState)(z),[J,Y]=(0,d.useState)(x||``);(0,d.useEffect)(()=>{a.default(t.COLOR_PICKER,{assistiveText:e,className:_,classNameMenu:v,id:y,disabled:b,errorText:x,errorTextWorkingColor:S,events:C,hasStaticAlignment:w,hideInput:T,isOpen:E,labels:D,menuPosition:O,swatchColors:k,defaultSelectedTab:A,variant:j,value:M,valueWorking:N},{})},[]),(0,d.useEffect)(()=>{M!==void 0&&V(M)},[M]),(0,d.useEffect)(()=>{N!==void 0&&G(o.default.getNewColor({hex:N},C.onValidateWorkingColor))},[N,C.onValidateWorkingColor]),(0,d.useEffect)(()=>{E!==void 0&&U(E)},[E]);let X=(0,d.useCallback)((e,t)=>{let n=o.default.getNewColor(t,C.onValidateWorkingColor,W);q(W),G(n),C.onWorkingColorChange&&C.onWorkingColorChange(e,{color:n})},[C,W]),oe=(0,d.useCallback)(e=>{X(e,{hex:e.target.value})},[X]),Z=(0,d.useCallback)(()=>{let e=o.default.getNewColor({hex:B},C.onValidateWorkingColor);U(!1),G(e),q(e)},[B,C.onValidateWorkingColor]),se=(0,d.useCallback)((e,t)=>{(t.trigger===`clickOutside`||t.trigger===`cancel`)&&Z(),P&&P(e,t)},[Z,P]),ce=(0,d.useCallback)(e=>{Z(),P&&P(e,{trigger:`cancel`})},[Z,P]),Q=(0,d.useCallback)(e=>(t,n)=>{let r={};r[e]=n.value,X(t,r)},[X]),le=(0,d.useCallback)(e=>{X(e,{hue:e.target.value})},[X]),ue=(0,d.useCallback)((e,t)=>{let n=t.value,r=o.default.getHexFromNamedColor(n),i=!1;i=C.onValidateColor?C.onValidateColor(n):r?!0:o.default.isValidHex(n),V(n),G(o.default.getNewColor({hex:r||n,name:r?n.toLowerCase():null},C.onValidateWorkingColor)),Y(i?``:I.invalidColor||``),C.onChange&&C.onChange(e,{color:n,isValid:i})},[C,I.invalidColor]),$=(0,d.useCallback)(e=>(t,n)=>{let r={};r[e]=n.delta;let i=o.default.getDeltaColor(r,C.onValidateWorkingColor,W);q(W),G(i),C.onWorkingColorChange&&C.onWorkingColorChange(t,{color:i})},[C,W]),de=(0,d.useCallback)((e,t)=>{X(e,{saturation:t.saturation,value:t.value})},[X]),fe=(0,d.useCallback)(e=>{U(!1),V(W.hex),Y(``),C.onChange&&C.onChange(e,{color:W.hex,isValid:!0})},[C,W.hex]),pe=(0,d.useCallback)(()=>{let e=o.default.getNewColor({hex:W.hex},C.onValidateWorkingColor);U(e=>!e),G(e),F&&F()},[C.onValidateWorkingColor,F,W.hex]),me=(0,d.useCallback)((e,t)=>{X(e,{hex:t.hex})},[X]),he=()=>T?null:(0,p.jsx)(i.default,{"aria-describedby":!H&&J?`color-picker-summary-error-${R}`:void 0,className:(0,f.default)(`slds-color-picker__summary-input`,`slds-align-top`,{"slds-has-error":!!J}),disabled:b,id:`color-picker-summary-input-${R}`,onChange:ue,value:B}),ge=(0,p.jsxs)(c.default,{id:`color-picker-tabs-${R}`,defaultSelectedIndex:+(A===`custom`),children:[j!==`base`&&j!==`swatches`?null:(0,p.jsx)(l.default,{label:I.swatchTab??``,children:(0,p.jsx)(te.default,{color:W,labels:I,onSelect:me,swatchColors:k})}),j!==`base`&&j!==`custom`?null:(0,p.jsx)(l.default,{label:I.customTab??``,children:(0,p.jsx)(s.default,{assistiveText:L,id:R,color:W,errorTextWorkingColor:S,previousColor:K,labels:I,onBlueChange:Q(`blue`),onGreenChange:Q(`green`),onHexChange:Q(`hex`),onHueChange:le,onRedChange:Q(`red`),onSwatchChange:oe,onSaturationValueChange:de,onSaturationNavigate:$(`saturation`),onValueNavigate:$(`value`)})})]}),_e=(0,p.jsxs)(`div`,{className:`slds-color-picker__selector-footer`,children:[(0,p.jsx)(r.default,{className:`slds-color-picker__selector-cancel`,id:`color-picker-footer-cancel-${R}`,label:I.cancelButton,onClick:ce,variant:`neutral`}),(0,p.jsx)(r.default,{className:`slds-color-picker__selector-submit`,disabled:Object.keys(W.errors||{}).length>0,id:`color-picker-footer-submit-${R}`,label:I.submitButton,onClick:fe,variant:`brand`})]});return(0,p.jsx)(`div`,{className:(0,f.default)(`slds-color-picker`,_),ref:ae,children:(0,p.jsxs)(`div`,{className:`slds-color-picker__summary`,children:[(0,p.jsx)(`label`,{className:(0,f.default)(`slds-color-picker__summary-label`,L.label?`slds-assistive-text`:``),htmlFor:T?void 0:`color-picker-summary-input-${R}`,id:`color-picker-label-${R}`,children:L.label?L.label:I.label}),(0,p.jsx)(u.default,{ariaLabelledby:`color-picker-label-${R}`,align:`bottom left`,body:ge,classNameDialog:(0,f.default)(`slds-color-picker__selector`,v),footer:_e,hasNoCloseButton:!0,hasNoNubbin:!0,hasStaticAlignment:w,id:`slds-color-picker__selector-${R}`,isOpen:H,onClose:ne,onOpen:re,onRequestClose:se,position:O,children:(0,p.jsx)(r.default,{className:`slds-color-picker__summary-button`,disabled:b,iconClassName:`slds-m-left_xx-small`,iconPosition:`right`,iconVariant:`more`,id:`slds-color-picker__summary-button-${R}`,label:(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`span`,{className:`slds-assistive-text`,children:L.label?L.label:I.label}),(0,p.jsx)(ee.default,{color:B,labels:I})]}),onClick:pe,variant:`icon`})}),he(),!H&&J&&(0,p.jsx)(`p`,{className:`slds-form-error`,id:`color-picker-summary-error-${R}`,children:J})]})})};_.displayName=t.COLOR_PICKER,exports.default=_;
1
+ const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../utilities/constants.cjs"),n=require("../../utilities/hooks/use-controllable-state.cjs"),r=require("../../utilities/generate-id.cjs"),i=require("../button/index.cjs"),ee=require("../input/index.cjs"),te=require("./check-props.cjs"),ne=require("./private/swatch.cjs"),a=require("../../utilities/color.cjs"),re=require("./private/custom-color.cjs"),ie=require("./private/swatch-picker.cjs"),o=require("../tabs/panel.cjs"),ae=require("./private/color-picker-tabs.cjs"),oe=require("../popover/index.cjs");let s=require("react");s=e.__toESM(s,1);let c=require("classnames");c=e.__toESM(c,1);let l=require("react/jsx-runtime");var u={blueAbbreviated:`B`,cancelButton:`Cancel`,customTab:`Custom`,customTabActiveWorkingColorSwatch:`Working Color`,customTabTransparentSwatch:`Transparent Swatch`,greenAbbreviated:`G`,hexLabel:`Hex`,invalidColor:`The color entered is invalid`,invalidComponent:`The value needs to be an integer from 0-255`,redAbbreviated:`R`,submitButton:`Done`,swatchTab:`Default`,swatchTabTransparentSwatch:`Transparent Swatch`},d={saturationValueGrid:`Use arrow keys to select a saturation and brightness, on an x and y axis.`,hueSlider:`Select Hue`},f=`#e3abec.#c2dbf7.#9fd6ff.#9de7da.#9df0c0.#fff099.#fed49a.#d073e0.#86baf3.#5ebbff.#44d8be.#3be282.#ffe654.#ffb758.#bd35bd.#5779c1.#5679c0.#00aea9.#3cba4c.#f5bc25.#f99221.#580d8c.#001970.#0a2399.#0b7477.#0b6b50.#b67e11.#b85d0d.`.split(`.`),p=(e,t)=>{let n=a.default.getHexFromNamedColor(e);return a.default.getNewColor({hex:n||e,name:n?e.toLowerCase():null},t)},m=(e,t)=>t?!!t(e):a.default.getHexFromNamedColor(e)?!0:a.default.isValidHex(e),h=({assistiveText:e,className:h,classNameMenu:g,id:_,defaultIsOpen:se=!1,disabled:v=!1,errorText:y,errorTextWorkingColor:b,events:x={},hasStaticAlignment:S,hideInput:C=!1,isOpen:w,labels:T,menuPosition:E=`absolute`,swatchColors:D=f,defaultSelectedTab:O=`swatches`,variant:k=`base`,value:A,valueWorking:j,onClose:M,onOpen:ce,onRequestClose:N,onRequestOpen:P})=>{let F=(0,s.useMemo)(()=>({...u,...T}),[T]),I=(0,s.useMemo)(()=>({...d,...e}),[e]),le=(0,s.useRef)(_||r.default()),L=_||le.current,ue=(0,s.useRef)(null),R=A??``,z=x.onValidateWorkingColor,[B,V]=n.useControllableState(w,se),[H,U]=(0,s.useState)(()=>p(R,z)),[de,W]=(0,s.useState)(H),[G,fe]=(0,s.useState)({value:R,isOpen:B});if((G.value!==R||G.isOpen!==B)&&(fe({value:R,isOpen:B}),G.value!==R||B)){let e=p(R,z);U(e),W(e)}let K=(0,s.useMemo)(()=>j!==void 0&&H.hex!==j?a.default.getNewColor({hex:j},z):H,[j,H,z]),pe=(0,s.useMemo)(()=>m(R,x.onValidateColor),[R,x.onValidateColor]),q=y||(pe?``:F.invalidColor||``);(0,s.useEffect)(()=>{te.default(t.COLOR_PICKER,{assistiveText:e,className:h,classNameMenu:g,id:_,disabled:v,errorText:y,errorTextWorkingColor:b,events:x,hasStaticAlignment:S,hideInput:C,isOpen:w,labels:T,menuPosition:E,swatchColors:D,defaultSelectedTab:O,variant:k,value:A,valueWorking:j},{})},[]);let J=(0,s.useCallback)((e,t)=>{W(K),U(t),x.onWorkingColorChange&&x.onWorkingColorChange(e,{color:t})},[x,K]),Y=(0,s.useCallback)((e,t)=>{J(e,a.default.getNewColor(t,z,K))},[J,z,K]),me=(0,s.useCallback)(e=>{Y(e,{hex:e.target.value})},[Y]),X=(0,s.useCallback)((e,t)=>{V(!1),N&&N(e,t)},[V,N]),he=(0,s.useCallback)(e=>{X(e,{trigger:`cancel`})},[X]),Z=(0,s.useCallback)(e=>(t,n)=>{let r={};r[e]=n.value,Y(t,r)},[Y]),ge=(0,s.useCallback)(e=>{Y(e,{hue:e.target.value})},[Y]),Q=(0,s.useCallback)((e,t)=>{let n=m(t.value,x.onValidateColor);x.onChange&&x.onChange(e,{color:t.value,isValid:n})},[x]),$=(0,s.useCallback)(e=>(t,n)=>{let r={};r[e]=n.delta,J(t,a.default.getDeltaColor(r,z,K))},[J,z,K]),_e=(0,s.useCallback)((e,t)=>{Y(e,{saturation:t.saturation,value:t.value})},[Y]),ve=(0,s.useCallback)(e=>{x.onChange&&x.onChange(e,{color:K.hex,isValid:!0}),X(e,{trigger:`submit`})},[x,X,K.hex]),ye=(0,s.useCallback)(()=>{B||(V(!0),P&&P())},[B,V,P]),be=(0,s.useCallback)((e,t)=>{Y(e,{hex:t.hex})},[Y]),xe=()=>C?null:(0,l.jsx)(ee.default,{"aria-describedby":!B&&q?`color-picker-summary-error-${L}`:void 0,className:(0,c.default)(`slds-color-picker__summary-input`,`slds-align-top`,{"slds-has-error":!!q}),disabled:v,id:`color-picker-summary-input-${L}`,onChange:Q,value:R}),Se=(0,l.jsxs)(ae.default,{id:`color-picker-tabs-${L}`,defaultValue:O===`custom`?`1`:`0`,children:[k!==`base`&&k!==`swatches`?null:(0,l.jsx)(o.default,{label:F.swatchTab??``,children:(0,l.jsx)(ie.default,{color:K,labels:F,onSelect:be,swatchColors:D})}),k!==`base`&&k!==`custom`?null:(0,l.jsx)(o.default,{label:F.customTab??``,children:(0,l.jsx)(re.default,{assistiveText:I,id:L,color:K,errorTextWorkingColor:b,previousColor:de,labels:F,onBlueChange:Z(`blue`),onGreenChange:Z(`green`),onHexChange:Z(`hex`),onHueChange:ge,onRedChange:Z(`red`),onSwatchChange:me,onSaturationValueChange:_e,onSaturationNavigate:$(`saturation`),onValueNavigate:$(`value`)})})]}),Ce=(0,l.jsxs)(`div`,{className:`slds-color-picker__selector-footer`,children:[(0,l.jsx)(i.default,{className:`slds-color-picker__selector-cancel`,id:`color-picker-footer-cancel-${L}`,label:F.cancelButton,onClick:he,variant:`neutral`}),(0,l.jsx)(i.default,{className:`slds-color-picker__selector-submit`,disabled:Object.keys(K.errors||{}).length>0,id:`color-picker-footer-submit-${L}`,label:F.submitButton,onClick:ve,variant:`brand`})]});return(0,l.jsx)(`div`,{className:(0,c.default)(`slds-color-picker`,h),ref:ue,children:(0,l.jsxs)(`div`,{className:`slds-color-picker__summary`,children:[(0,l.jsx)(`label`,{className:(0,c.default)(`slds-color-picker__summary-label`,I.label?`slds-assistive-text`:``),htmlFor:C?void 0:`color-picker-summary-input-${L}`,id:`color-picker-label-${L}`,children:I.label?I.label:F.label}),(0,l.jsx)(oe.default,{ariaLabelledby:`color-picker-label-${L}`,align:`bottom left`,body:Se,classNameDialog:(0,c.default)(`slds-color-picker__selector`,g),footer:Ce,hasNoCloseButton:!0,hasNoNubbin:!0,hasStaticAlignment:S,id:`slds-color-picker__selector-${L}`,isOpen:B,onClose:M,onOpen:ce,onRequestClose:X,position:E,children:(0,l.jsx)(i.default,{className:`slds-color-picker__summary-button`,disabled:v,iconClassName:`slds-m-left_xx-small`,iconPosition:`right`,iconVariant:`more`,id:`slds-color-picker__summary-button-${L}`,label:(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`span`,{className:`slds-assistive-text`,children:I.label?I.label:F.label}),(0,l.jsx)(ne.default,{color:R,labels:F})]}),onClick:ye,variant:`icon`})}),xe(),!B&&q&&(0,l.jsx)(`p`,{className:`slds-form-error`,id:`color-picker-summary-error-${L}`,children:q})]})})};h.displayName=t.COLOR_PICKER,exports.default=h;
2
2
  //# sourceMappingURL=color-picker.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"color-picker.cjs","names":[],"sources":["../../../../components/color-picker/color-picker.tsx"],"sourcesContent":["/* eslint-disable max-lines */\nimport React, {\n\tuseState,\n\tuseCallback,\n\tuseRef,\n\tuseEffect,\n\tuseMemo,\n} from 'react';\nimport classNames from 'classnames';\n\nimport checkProps from './check-props';\n\nimport CustomColor from './private/custom-color';\nimport Swatch from './private/swatch';\nimport SwatchPicker from './private/swatch-picker';\n\nimport Button from '../button';\nimport Input, { type InputChangeData } from '../input';\nimport Tabs from '../tabs';\nimport TabsPanel from '../tabs/panel';\nimport Popover from '../popover';\n\nimport ColorUtils from '../../utilities/color';\nimport { COLOR_PICKER } from '../../utilities/constants';\nimport generateId from '../../utilities/generate-id';\n\nimport {\n\tWorkingColor,\n\tColorPickerAssistiveText,\n\tColorPickerLabels,\n\tColorPickerEvents,\n} from './types';\n\ninterface ColorPickerBaseProps {\n\t/** Assistive text for accessibility */\n\tassistiveText?: ColorPickerAssistiveText;\n\t/** CSS classes for the color-picker container */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** CSS classes for the popover menu */\n\tclassNameMenu?: string | string[] | Record<string, boolean>;\n\t/** Unique ID for the component */\n\tid?: string;\n\t/** Disables the input and button */\n\tdisabled?: boolean;\n\t/** Error message for the outer input */\n\terrorText?: string;\n\t/** Error message for the custom tab working color input */\n\terrorTextWorkingColor?: string;\n\t/** Event callbacks */\n\tevents?: ColorPickerEvents;\n\t/** Disable flip behavior for popover alignment */\n\thasStaticAlignment?: boolean;\n\t/** Hides the text input */\n\thideInput?: boolean;\n\t/** Controlled popover open state */\n\tisOpen?: boolean;\n\t/** Text labels for internationalization */\n\tlabels?: ColorPickerLabels;\n\t/** Popover position strategy */\n\tmenuPosition?: 'absolute' | 'overflowBoundaryElement' | 'relative';\n\t/** Current color in hexadecimal string */\n\tvalue?: string;\n\t/** Current working color in hexadecimal string */\n\tvalueWorking?: string;\n\t/** Callback when popover closes */\n\tonClose?: (\n\t\tevent: React.SyntheticEvent,\n\t\tdata: { trigger?: string; componentWillUnmount?: boolean }\n\t) => void;\n\t/** Callback when popover opens */\n\tonOpen?: (\n\t\tevent: React.SyntheticEvent,\n\t\tdata: { portal?: HTMLElement }\n\t) => void;\n\t/** Callback when user requests close */\n\tonRequestClose?: (\n\t\tevent: React.SyntheticEvent,\n\t\tdata: { trigger: string }\n\t) => void;\n\t/** Callback when popover requests to open */\n\tonRequestOpen?: () => void;\n}\n\n/**\n * `variant` sets which tabs are present. `swatchColors` needs the swatch tab\n * and `defaultSelectedTab` only applies when both tabs are present.\n */\nexport type ColorPickerVariantProps =\n\t| {\n\t\t\t/** Both the swatch and custom tabs */\n\t\t\tvariant?: 'base';\n\t\t\t/** Array of hex color values for swatch options */\n\t\t\tswatchColors?: string[];\n\t\t\t/** Which tab is visible when dialog opens */\n\t\t\tdefaultSelectedTab?: 'swatches' | 'custom';\n\t }\n\t| {\n\t\t\t/** Only the swatch tab */\n\t\t\tvariant: 'swatches';\n\t\t\t/** Array of hex color values for swatch options */\n\t\t\tswatchColors?: string[];\n\t\t\tdefaultSelectedTab?: never;\n\t }\n\t| {\n\t\t\t/** Only the custom tab */\n\t\t\tvariant: 'custom';\n\t\t\tswatchColors?: never;\n\t\t\tdefaultSelectedTab?: never;\n\t };\n\nexport type ColorPickerProps = ColorPickerBaseProps & ColorPickerVariantProps;\n\nconst defaultLabels: ColorPickerLabels = {\n\tblueAbbreviated: 'B',\n\tcancelButton: 'Cancel',\n\tcustomTab: 'Custom',\n\tcustomTabActiveWorkingColorSwatch: 'Working Color',\n\tcustomTabTransparentSwatch: 'Transparent Swatch',\n\tgreenAbbreviated: 'G',\n\thexLabel: 'Hex',\n\tinvalidColor: 'The color entered is invalid',\n\tinvalidComponent: 'The value needs to be an integer from 0-255',\n\tredAbbreviated: 'R',\n\tsubmitButton: 'Done',\n\tswatchTab: 'Default',\n\tswatchTabTransparentSwatch: 'Transparent Swatch',\n};\n\nconst defaultAssistiveText: ColorPickerAssistiveText = {\n\tsaturationValueGrid:\n\t\t'Use arrow keys to select a saturation and brightness, on an x and y axis.',\n\thueSlider: 'Select Hue',\n};\n\nconst defaultSwatchColors = [\n\t'#e3abec',\n\t'#c2dbf7',\n\t'#9fd6ff',\n\t'#9de7da',\n\t'#9df0c0',\n\t'#fff099',\n\t'#fed49a',\n\t'#d073e0',\n\t'#86baf3',\n\t'#5ebbff',\n\t'#44d8be',\n\t'#3be282',\n\t'#ffe654',\n\t'#ffb758',\n\t'#bd35bd',\n\t'#5779c1',\n\t'#5679c0',\n\t'#00aea9',\n\t'#3cba4c',\n\t'#f5bc25',\n\t'#f99221',\n\t'#580d8c',\n\t'#001970',\n\t'#0a2399',\n\t'#0b7477',\n\t'#0b6b50',\n\t'#b67e11',\n\t'#b85d0d',\n\t'',\n];\n\n/**\n * The Unified Color Picker component allows for a fully accessible and\n * configurable color picker, allowing the user to pick from a set of\n * predefined colors (swatches), or to pick a custom color using a HSB\n * selection interface.\n */\nconst ColorPicker: React.FC<ColorPickerProps> = ({\n\tassistiveText: assistiveTextProp,\n\tclassName,\n\tclassNameMenu,\n\tid: idProp,\n\tdisabled = false,\n\terrorText: errorTextProp,\n\terrorTextWorkingColor,\n\tevents = {},\n\thasStaticAlignment,\n\thideInput = false,\n\tisOpen: isOpenProp,\n\tlabels: labelsProp,\n\tmenuPosition = 'absolute',\n\tswatchColors = defaultSwatchColors,\n\tdefaultSelectedTab = 'swatches',\n\tvariant = 'base',\n\tvalue: valueProp,\n\tvalueWorking: valueWorkingProp,\n\tonClose,\n\tonOpen,\n\tonRequestClose,\n\tonRequestOpen,\n}) => {\n\t// Merge labels and assistive text with defaults\n\tconst labels = useMemo(\n\t\t() => ({ ...defaultLabels, ...labelsProp }),\n\t\t[labelsProp]\n\t);\n\tconst assistiveText = useMemo(\n\t\t() => ({ ...defaultAssistiveText, ...assistiveTextProp }),\n\t\t[assistiveTextProp]\n\t);\n\n\t// Generate stable ID\n\tconst generatedId = useRef(idProp || generateId());\n\tconst componentId = idProp || generatedId.current;\n\n\t// Refs\n\tconst wrapperRef = useRef<HTMLDivElement>(null);\n\n\t// Initialize working color from props\n\tconst getInitialWorkingColor = useCallback((): WorkingColor => {\n\t\treturn ColorUtils.getNewColor(\n\t\t\t{ hex: valueWorkingProp || valueProp },\n\t\t\tevents.onValidateWorkingColor\n\t\t) as WorkingColor;\n\t}, [valueWorkingProp, valueProp, events.onValidateWorkingColor]);\n\n\t// State\n\tconst [currentColor, setCurrentColor] = useState<string>(\n\t\tvalueProp != null ? valueProp : ''\n\t);\n\tconst [isOpen, setIsOpen] = useState<boolean>(isOpenProp || false);\n\tconst [workingColor, setWorkingColor] = useState<WorkingColor>(\n\t\tgetInitialWorkingColor\n\t);\n\tconst [previousWorkingColor, setPreviousWorkingColor] =\n\t\tuseState<WorkingColor>(getInitialWorkingColor);\n\tconst [colorErrorMessage, setColorErrorMessage] = useState<string>(\n\t\terrorTextProp || ''\n\t);\n\n\t// Check props on mount (development only)\n\tuseEffect(() => {\n\t\t// checkProps is a no-op in production\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t(checkProps as any)(\n\t\t\tCOLOR_PICKER,\n\t\t\t{\n\t\t\t\tassistiveText: assistiveTextProp,\n\t\t\t\tclassName,\n\t\t\t\tclassNameMenu,\n\t\t\t\tid: idProp,\n\t\t\t\tdisabled,\n\t\t\t\terrorText: errorTextProp,\n\t\t\t\terrorTextWorkingColor,\n\t\t\t\tevents,\n\t\t\t\thasStaticAlignment,\n\t\t\t\thideInput,\n\t\t\t\tisOpen: isOpenProp,\n\t\t\t\tlabels: labelsProp,\n\t\t\t\tmenuPosition,\n\t\t\t\tswatchColors,\n\t\t\t\tdefaultSelectedTab,\n\t\t\t\tvariant,\n\t\t\t\tvalue: valueProp,\n\t\t\t\tvalueWorking: valueWorkingProp,\n\t\t\t},\n\t\t\t{}\n\t\t);\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, []);\n\n\t// Sync props to state when they change externally\n\tuseEffect(() => {\n\t\tif (valueProp !== undefined) {\n\t\t\tsetCurrentColor(valueProp);\n\t\t}\n\t}, [valueProp]);\n\n\tuseEffect(() => {\n\t\tif (valueWorkingProp !== undefined) {\n\t\t\tsetWorkingColor(\n\t\t\t\tColorUtils.getNewColor(\n\t\t\t\t\t{ hex: valueWorkingProp },\n\t\t\t\t\tevents.onValidateWorkingColor\n\t\t\t\t) as WorkingColor\n\t\t\t);\n\t\t}\n\t}, [valueWorkingProp, events.onValidateWorkingColor]);\n\n\tuseEffect(() => {\n\t\tif (isOpenProp !== undefined) {\n\t\t\tsetIsOpen(isOpenProp);\n\t\t}\n\t}, [isOpenProp]);\n\n\t// Helper to update working color\n\tconst updateWorkingColor = useCallback(\n\t\t(\n\t\t\tevent: React.SyntheticEvent,\n\t\t\tcolorOptions: {\n\t\t\t\thex?: string;\n\t\t\t\tred?: string | number;\n\t\t\t\tgreen?: string | number;\n\t\t\t\tblue?: string | number;\n\t\t\t\thue?: number | string;\n\t\t\t\tsaturation?: number;\n\t\t\t\tvalue?: number;\n\t\t\t}\n\t\t) => {\n\t\t\tconst newColor = ColorUtils.getNewColor(\n\t\t\t\tcolorOptions,\n\t\t\t\tevents.onValidateWorkingColor,\n\t\t\t\tworkingColor\n\t\t\t) as WorkingColor;\n\t\t\tsetPreviousWorkingColor(workingColor);\n\t\t\tsetWorkingColor(newColor);\n\n\t\t\tif (events.onWorkingColorChange) {\n\t\t\t\tevents.onWorkingColorChange(event, { color: newColor });\n\t\t\t}\n\t\t},\n\t\t[events, workingColor]\n\t);\n\n\t// Event handlers\n\tconst handleSwatchChange = useCallback(\n\t\t(event: React.ChangeEvent<HTMLInputElement>) => {\n\t\t\tupdateWorkingColor(event, { hex: event.target.value });\n\t\t},\n\t\t[updateWorkingColor]\n\t);\n\n\tconst handleCancelState = useCallback(() => {\n\t\tconst resetColor = ColorUtils.getNewColor(\n\t\t\t{ hex: currentColor },\n\t\t\tevents.onValidateWorkingColor\n\t\t) as WorkingColor;\n\t\tsetIsOpen(false);\n\t\tsetWorkingColor(resetColor);\n\t\tsetPreviousWorkingColor(resetColor);\n\t}, [currentColor, events.onValidateWorkingColor]);\n\n\tconst handleOnRequestClose = useCallback(\n\t\t(event: React.SyntheticEvent, data: { trigger: string }) => {\n\t\t\tif (data.trigger === 'clickOutside' || data.trigger === 'cancel') {\n\t\t\t\thandleCancelState();\n\t\t\t}\n\n\t\t\tif (onRequestClose) {\n\t\t\t\tonRequestClose(event, data);\n\t\t\t}\n\t\t},\n\t\t[handleCancelState, onRequestClose]\n\t);\n\n\tconst handleCancel = useCallback(\n\t\t(event: React.MouseEvent) => {\n\t\t\thandleCancelState();\n\n\t\t\tif (onRequestClose) {\n\t\t\t\tonRequestClose(event, { trigger: 'cancel' });\n\t\t\t}\n\t\t},\n\t\t[handleCancelState, onRequestClose]\n\t);\n\n\tconst handleColorChange = useCallback(\n\t\t(property: 'hex' | 'red' | 'green' | 'blue') =>\n\t\t\t(event: React.SyntheticEvent, data: InputChangeData) => {\n\t\t\t\tconst colorProperties: Record<string, string | number> = {};\n\t\t\t\tcolorProperties[property] = data.value;\n\t\t\t\tupdateWorkingColor(event, colorProperties);\n\t\t\t},\n\t\t[updateWorkingColor]\n\t);\n\n\tconst handleHueChange = useCallback(\n\t\t(event: React.ChangeEvent<HTMLInputElement>) => {\n\t\t\tupdateWorkingColor(event, { hue: event.target.value });\n\t\t},\n\t\t[updateWorkingColor]\n\t);\n\n\tconst handleHexInputChange = useCallback(\n\t\t(event: React.SyntheticEvent, data: InputChangeData) => {\n\t\t\tconst newCurrentColor = data.value;\n\t\t\tconst namedColorHex = ColorUtils.getHexFromNamedColor(newCurrentColor);\n\t\t\tlet isValid = false;\n\n\t\t\tif (events.onValidateColor) {\n\t\t\t\tisValid = events.onValidateColor(newCurrentColor);\n\t\t\t} else {\n\t\t\t\tisValid = namedColorHex ? true : ColorUtils.isValidHex(newCurrentColor);\n\t\t\t}\n\n\t\t\tsetCurrentColor(newCurrentColor);\n\t\t\tsetWorkingColor(\n\t\t\t\tColorUtils.getNewColor(\n\t\t\t\t\t{\n\t\t\t\t\t\thex: namedColorHex || newCurrentColor,\n\t\t\t\t\t\tname: namedColorHex ? newCurrentColor.toLowerCase() : null,\n\t\t\t\t\t} as { hex: string; name?: string | null },\n\t\t\t\t\tevents.onValidateWorkingColor\n\t\t\t\t) as WorkingColor\n\t\t\t);\n\t\t\tsetColorErrorMessage(isValid ? '' : labels.invalidColor || '');\n\n\t\t\tif (events.onChange) {\n\t\t\t\tevents.onChange(event, {\n\t\t\t\t\tcolor: newCurrentColor,\n\t\t\t\t\tisValid,\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\t[events, labels.invalidColor]\n\t);\n\n\tconst handleNavigate = useCallback(\n\t\t(property: 'saturation' | 'value') =>\n\t\t\t(event: React.KeyboardEvent, data: { delta: number }) => {\n\t\t\t\tconst colorProperties: Record<string, number> = {};\n\t\t\t\tcolorProperties[property] = data.delta;\n\t\t\t\tconst newColor = ColorUtils.getDeltaColor(\n\t\t\t\t\tcolorProperties,\n\t\t\t\t\tevents.onValidateWorkingColor,\n\t\t\t\t\tworkingColor\n\t\t\t\t) as WorkingColor;\n\t\t\t\tsetPreviousWorkingColor(workingColor);\n\t\t\t\tsetWorkingColor(newColor);\n\n\t\t\t\tif (events.onWorkingColorChange) {\n\t\t\t\t\tevents.onWorkingColorChange(event, { color: newColor });\n\t\t\t\t}\n\t\t\t},\n\t\t[events, workingColor]\n\t);\n\n\tconst handleSaturationValueChange = useCallback(\n\t\t(\n\t\t\tevent: React.MouseEvent | React.KeyboardEvent,\n\t\t\tdata: { saturation: number; value: number }\n\t\t) => {\n\t\t\tupdateWorkingColor(event, {\n\t\t\t\tsaturation: data.saturation,\n\t\t\t\tvalue: data.value,\n\t\t\t});\n\t\t},\n\t\t[updateWorkingColor]\n\t);\n\n\tconst handleSubmitButtonClick = useCallback(\n\t\t(event: React.MouseEvent) => {\n\t\t\tsetIsOpen(false);\n\t\t\tsetCurrentColor(workingColor.hex);\n\t\t\tsetColorErrorMessage('');\n\n\t\t\tif (events.onChange) {\n\t\t\t\tevents.onChange(event, {\n\t\t\t\t\tcolor: workingColor.hex,\n\t\t\t\t\tisValid: true,\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\t[events, workingColor.hex]\n\t);\n\n\tconst handleSwatchButtonClick = useCallback(() => {\n\t\tconst newWorkingColor = ColorUtils.getNewColor(\n\t\t\t{ hex: workingColor.hex },\n\t\t\tevents.onValidateWorkingColor\n\t\t) as WorkingColor;\n\t\tsetIsOpen((prev) => !prev);\n\t\tsetWorkingColor(newWorkingColor);\n\n\t\tif (onRequestOpen) {\n\t\t\tonRequestOpen();\n\t\t}\n\t}, [events.onValidateWorkingColor, onRequestOpen, workingColor.hex]);\n\n\tconst handleSwatchSelect = useCallback(\n\t\t(event: React.MouseEvent | React.KeyboardEvent, data: { hex: string }) => {\n\t\t\tupdateWorkingColor(event, { hex: data.hex });\n\t\t},\n\t\t[updateWorkingColor]\n\t);\n\n\t// Render helpers\n\tconst renderInput = () => {\n\t\tif (hideInput) return null;\n\n\t\treturn (\n\t\t\t<Input\n\t\t\t\taria-describedby={\n\t\t\t\t\t!isOpen && colorErrorMessage\n\t\t\t\t\t\t? `color-picker-summary-error-${componentId}`\n\t\t\t\t\t\t: undefined\n\t\t\t\t}\n\t\t\t\tclassName={classNames(\n\t\t\t\t\t'slds-color-picker__summary-input',\n\t\t\t\t\t'slds-align-top',\n\t\t\t\t\t{\n\t\t\t\t\t\t'slds-has-error': !!colorErrorMessage,\n\t\t\t\t\t}\n\t\t\t\t)}\n\t\t\t\tdisabled={disabled}\n\t\t\t\tid={`color-picker-summary-input-${componentId}`}\n\t\t\t\tonChange={handleHexInputChange}\n\t\t\t\tvalue={currentColor}\n\t\t\t/>\n\t\t);\n\t};\n\n\tconst renderDefaultTab = () => {\n\t\tif (variant !== 'base' && variant !== 'swatches') return null;\n\n\t\treturn (\n\t\t\t<TabsPanel label={labels.swatchTab ?? ''}>\n\t\t\t\t<SwatchPicker\n\t\t\t\t\tcolor={workingColor}\n\t\t\t\t\tlabels={labels}\n\t\t\t\t\tonSelect={handleSwatchSelect}\n\t\t\t\t\tswatchColors={swatchColors}\n\t\t\t\t/>\n\t\t\t</TabsPanel>\n\t\t);\n\t};\n\n\tconst renderCustomTab = () => {\n\t\tif (variant !== 'base' && variant !== 'custom') return null;\n\n\t\treturn (\n\t\t\t<TabsPanel label={labels.customTab ?? ''}>\n\t\t\t\t<CustomColor\n\t\t\t\t\tassistiveText={assistiveText}\n\t\t\t\t\tid={componentId}\n\t\t\t\t\tcolor={workingColor}\n\t\t\t\t\terrorTextWorkingColor={errorTextWorkingColor}\n\t\t\t\t\tpreviousColor={previousWorkingColor}\n\t\t\t\t\tlabels={labels}\n\t\t\t\t\tonBlueChange={handleColorChange('blue')}\n\t\t\t\t\tonGreenChange={handleColorChange('green')}\n\t\t\t\t\tonHexChange={handleColorChange('hex')}\n\t\t\t\t\tonHueChange={handleHueChange}\n\t\t\t\t\tonRedChange={handleColorChange('red')}\n\t\t\t\t\tonSwatchChange={handleSwatchChange}\n\t\t\t\t\tonSaturationValueChange={handleSaturationValueChange}\n\t\t\t\t\tonSaturationNavigate={handleNavigate('saturation')}\n\t\t\t\t\tonValueNavigate={handleNavigate('value')}\n\t\t\t\t/>\n\t\t\t</TabsPanel>\n\t\t);\n\t};\n\n\tconst popoverBody = (\n\t\t<Tabs\n\t\t\tid={`color-picker-tabs-${componentId}`}\n\t\t\tdefaultSelectedIndex={defaultSelectedTab === 'custom' ? 1 : 0}\n\t\t>\n\t\t\t{renderDefaultTab()}\n\t\t\t{renderCustomTab()}\n\t\t</Tabs>\n\t);\n\n\tconst popoverFooter = (\n\t\t<div className=\"slds-color-picker__selector-footer\">\n\t\t\t<Button\n\t\t\t\tclassName=\"slds-color-picker__selector-cancel\"\n\t\t\t\tid={`color-picker-footer-cancel-${componentId}`}\n\t\t\t\tlabel={labels.cancelButton}\n\t\t\t\tonClick={handleCancel}\n\t\t\t\tvariant=\"neutral\"\n\t\t\t/>\n\t\t\t<Button\n\t\t\t\tclassName=\"slds-color-picker__selector-submit\"\n\t\t\t\tdisabled={Object.keys(workingColor.errors || {}).length > 0}\n\t\t\t\tid={`color-picker-footer-submit-${componentId}`}\n\t\t\t\tlabel={labels.submitButton}\n\t\t\t\tonClick={handleSubmitButtonClick}\n\t\t\t\tvariant=\"brand\"\n\t\t\t/>\n\t\t</div>\n\t);\n\n\treturn (\n\t\t<div\n\t\t\tclassName={classNames('slds-color-picker', className)}\n\t\t\tref={wrapperRef}\n\t\t>\n\t\t\t<div className=\"slds-color-picker__summary\">\n\t\t\t\t<label\n\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t'slds-color-picker__summary-label',\n\t\t\t\t\t\tassistiveText.label ? 'slds-assistive-text' : ''\n\t\t\t\t\t)}\n\t\t\t\t\thtmlFor={\n\t\t\t\t\t\t!hideInput ? `color-picker-summary-input-${componentId}` : undefined\n\t\t\t\t\t}\n\t\t\t\t\tid={`color-picker-label-${componentId}`}\n\t\t\t\t>\n\t\t\t\t\t{assistiveText.label ? assistiveText.label : labels.label}\n\t\t\t\t</label>\n\t\t\t\t<Popover\n\t\t\t\t\tariaLabelledby={`color-picker-label-${componentId}`}\n\t\t\t\t\talign=\"bottom left\"\n\t\t\t\t\tbody={popoverBody}\n\t\t\t\t\tclassNameDialog={classNames(\n\t\t\t\t\t\t'slds-color-picker__selector',\n\t\t\t\t\t\tclassNameMenu\n\t\t\t\t\t)}\n\t\t\t\t\tfooter={popoverFooter}\n\t\t\t\t\thasNoCloseButton\n\t\t\t\t\thasNoNubbin\n\t\t\t\t\thasStaticAlignment={hasStaticAlignment}\n\t\t\t\t\tid={`slds-color-picker__selector-${componentId}`}\n\t\t\t\t\tisOpen={isOpen}\n\t\t\t\t\tonClose={\n\t\t\t\t\t\tonClose as unknown as\n\t\t\t\t\t\t\t| ((\n\t\t\t\t\t\t\t\t\tevent?: unknown,\n\t\t\t\t\t\t\t\t\tdata?: { componentWillUnmount?: boolean }\n\t\t\t\t\t\t\t ) => void)\n\t\t\t\t\t\t\t| undefined\n\t\t\t\t\t}\n\t\t\t\t\tonOpen={\n\t\t\t\t\t\tonOpen as unknown as\n\t\t\t\t\t\t\t| ((event?: unknown, data?: { portal?: HTMLElement }) => void)\n\t\t\t\t\t\t\t| undefined\n\t\t\t\t\t}\n\t\t\t\t\tonRequestClose={\n\t\t\t\t\t\thandleOnRequestClose as unknown as\n\t\t\t\t\t\t\t| ((event?: unknown, data?: { trigger?: string }) => void)\n\t\t\t\t\t\t\t| undefined\n\t\t\t\t\t}\n\t\t\t\t\tposition={menuPosition}\n\t\t\t\t>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tclassName=\"slds-color-picker__summary-button\"\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\ticonClassName=\"slds-m-left_xx-small\"\n\t\t\t\t\t\ticonPosition=\"right\"\n\t\t\t\t\t\ticonVariant=\"more\"\n\t\t\t\t\t\tid={`slds-color-picker__summary-button-${componentId}`}\n\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t<span className=\"slds-assistive-text\">\n\t\t\t\t\t\t\t\t\t{assistiveText.label ? assistiveText.label : labels.label}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t<Swatch color={currentColor} labels={labels} />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonClick={handleSwatchButtonClick}\n\t\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t\t/>\n\t\t\t\t</Popover>\n\t\t\t\t{renderInput()}\n\t\t\t\t{!isOpen && colorErrorMessage && (\n\t\t\t\t\t<p\n\t\t\t\t\t\tclassName=\"slds-form-error\"\n\t\t\t\t\t\tid={`color-picker-summary-error-${componentId}`}\n\t\t\t\t\t>\n\t\t\t\t\t\t{colorErrorMessage}\n\t\t\t\t\t</p>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nColorPicker.displayName = COLOR_PICKER;\n\nexport default ColorPicker;\n"],"mappings":"omBAgHA,IAAM,EAAmC,CACxC,gBAAiB,IACjB,aAAc,SACd,UAAW,SACX,kCAAmC,gBACnC,2BAA4B,qBAC5B,iBAAkB,IAClB,SAAU,MACV,aAAc,+BACd,iBAAkB,8CAClB,eAAgB,IAChB,aAAc,OACd,UAAW,UACX,2BAA4B,oBAC7B,EAEM,EAAiD,CACtD,oBACC,4EACD,UAAW,YACZ,EAEM,EAAsB,4OA8B5B,EAQM,GAA2C,CAChD,cAAe,EACf,YACA,gBACA,GAAI,EACJ,WAAW,GACX,UAAW,EACX,wBACA,SAAS,CAAC,EACV,qBACA,YAAY,GACZ,OAAQ,EACR,OAAQ,EACR,eAAe,WACf,eAAe,EACf,qBAAqB,WACrB,UAAU,OACV,MAAO,EACP,aAAc,EACd,WACA,UACA,iBACA,mBACK,CAEL,IAAM,GAAA,EAAS,EAAA,QAAA,MACP,CAAE,GAAG,EAAe,GAAG,CAAW,GACzC,CAAC,CAAU,CACZ,EACM,GAAA,EAAgB,EAAA,QAAA,MACd,CAAE,GAAG,EAAsB,GAAG,CAAkB,GACvD,CAAC,CAAiB,CACnB,EAGM,IAAA,EAAc,EAAA,OAAA,CAAO,GAAU,EAAA,QAAW,CAAC,EAC3C,EAAc,GAAU,GAAY,QAGpC,IAAA,EAAa,EAAA,OAAA,CAAuB,IAAI,EAGxC,GAAA,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AEN,QAAS,GACT,QAAQ,MACR,CAAA,CACO,CAAA,EACR,GAAY,EACZ,CAAC,GAAU,IACX,EAAA,EAAA,IAAA,CAAC,IAAD,CACC,UAAU,kBACV,GAAI,8BAA8B,IAEjC,SAAA,CACC,CAAA,CAEA,GACD,CAAA,CAEP,EAEA,EAAY,YAAc,EAAA"}
1
+ {"version":3,"file":"color-picker.cjs","names":[],"sources":["../../../../components/color-picker/color-picker.tsx"],"sourcesContent":["/* eslint-disable max-lines */\nimport React, {\n\tuseState,\n\tuseCallback,\n\tuseRef,\n\tuseEffect,\n\tuseMemo,\n} from 'react';\nimport classNames from 'classnames';\n\nimport checkProps from './check-props';\n\nimport CustomColor from './private/custom-color';\nimport Swatch from './private/swatch';\nimport SwatchPicker from './private/swatch-picker';\n\nimport Button from '../button';\nimport Input, { type InputChangeData } from '../input';\nimport TabsPanel from '../tabs/panel';\nimport ColorPickerTabs from './private/color-picker-tabs';\nimport Popover from '../popover';\n\nimport ColorUtils from '../../utilities/color';\nimport { COLOR_PICKER } from '../../utilities/constants';\nimport generateId from '../../utilities/generate-id';\nimport { useControllableState } from '../../utilities/hooks';\n\nimport {\n\tWorkingColor,\n\tColorPickerAssistiveText,\n\tColorPickerLabels,\n\tColorPickerChangeHandler,\n\tColorPickerEvents,\n} from './types';\n\ninterface ColorPickerBaseProps {\n\t/** Assistive text for accessibility */\n\tassistiveText?: ColorPickerAssistiveText;\n\t/** CSS classes for the color-picker container */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** CSS classes for the popover menu */\n\tclassNameMenu?: string | string[] | Record<string, boolean>;\n\t/** Unique ID for the component */\n\tid?: string;\n\t/** Disables the input and button */\n\tdisabled?: boolean;\n\t/**\n\t * Error message for the outer input. When empty, the message is derived from `value`:\n\t * `labels.invalidColor` is shown while `value` fails validation (`events.onValidateColor`,\n\t * or the built-in hex/named-color check).\n\t */\n\terrorText?: string;\n\t/** Error message for the custom tab working color input */\n\terrorTextWorkingColor?: string;\n\t/** Disable flip behavior for popover alignment */\n\thasStaticAlignment?: boolean;\n\t/** Hides the text input */\n\thideInput?: boolean;\n\t/**\n\t * Initial open state of the popover when `isOpen` is not set (uncontrolled). Defaults to `false`.\n\t */\n\tdefaultIsOpen?: boolean;\n\t/**\n\t * Whether the popover is open. When set, the popover is controlled: it only opens or closes\n\t * when this prop changes, so update it from `onRequestOpen` and `onRequestClose`. When\n\t * `undefined`, the popover manages its own open state (see `defaultIsOpen`).\n\t */\n\tisOpen?: boolean;\n\t/** Text labels for internationalization */\n\tlabels?: ColorPickerLabels;\n\t/** Popover position strategy */\n\tmenuPosition?: 'absolute' | 'overflowBoundaryElement' | 'relative';\n\t/**\n\t * Current color as a hexadecimal string (or a CSS color name); `''` for no color. Required and\n\t * controlled: the summary input and swatch always render this value. Update it from\n\t * `events.onChange`, which fires when the user types in the input (`isValid` says whether the\n\t * text is a valid color) and when Done is clicked.\n\t */\n\tvalue: string;\n\t/**\n\t * Working color (the in-popover draft) as a hexadecimal string. When set, the working color\n\t * is controlled: update it from `events.onWorkingColorChange`. When `undefined`, the working\n\t * color is internal and is reset from `value` each time the popover opens.\n\t */\n\tvalueWorking?: string;\n\t/** Callback when popover closes */\n\tonClose?: (\n\t\tevent: React.SyntheticEvent,\n\t\tdata: { trigger?: string; componentWillUnmount?: boolean }\n\t) => void;\n\t/** Callback when popover opens */\n\tonOpen?: (\n\t\tevent: React.SyntheticEvent,\n\t\tdata: { portal?: HTMLElement }\n\t) => void;\n\t/**\n\t * Called when the popover requests to close. `data.trigger` says why: `cancel` (Cancel button\n\t * or Escape), `submit` (Done button), `clickOutside`, `triggerClick`, or `newPopover`. When\n\t * `isOpen` is controlled, set it to `false` here.\n\t */\n\tonRequestClose?: (\n\t\tevent: React.SyntheticEvent,\n\t\tdata: { trigger: string }\n\t) => void;\n\t/**\n\t * Called when the swatch button is clicked while the popover is closed. When `isOpen` is\n\t * controlled, set it to `true` here.\n\t */\n\tonRequestOpen?: () => void;\n}\n\n/**\n * `variant` sets which tabs are present. `swatchColors` needs the swatch tab\n * and `defaultSelectedTab` only applies when both tabs are present.\n */\nexport type ColorPickerVariantProps =\n\t| {\n\t\t\t/** Both the swatch and custom tabs */\n\t\t\tvariant?: 'base';\n\t\t\t/** Array of hex color values for swatch options */\n\t\t\tswatchColors?: string[];\n\t\t\t/** Which tab is visible when dialog opens */\n\t\t\tdefaultSelectedTab?: 'swatches' | 'custom';\n\t }\n\t| {\n\t\t\t/** Only the swatch tab */\n\t\t\tvariant: 'swatches';\n\t\t\t/** Array of hex color values for swatch options */\n\t\t\tswatchColors?: string[];\n\t\t\tdefaultSelectedTab?: never;\n\t }\n\t| {\n\t\t\t/** Only the custom tab */\n\t\t\tvariant: 'custom';\n\t\t\tswatchColors?: never;\n\t\t\tdefaultSelectedTab?: never;\n\t };\n\n/**\n * `events.onChange` is required unless the color picker is `disabled`:\n * ColorPicker is controlled, so without it choosing a color does nothing.\n */\nexport type ColorPickerEventsProps =\n\t| {\n\t\t\t/** Event callbacks. `events.onChange` is required unless `disabled` is set. */\n\t\t\tevents: ColorPickerEvents & { onChange: ColorPickerChangeHandler };\n\t }\n\t| { disabled: true; events?: ColorPickerEvents };\n\nexport type ColorPickerProps = ColorPickerBaseProps &\n\tColorPickerVariantProps &\n\tColorPickerEventsProps;\n\nconst defaultLabels: ColorPickerLabels = {\n\tblueAbbreviated: 'B',\n\tcancelButton: 'Cancel',\n\tcustomTab: 'Custom',\n\tcustomTabActiveWorkingColorSwatch: 'Working Color',\n\tcustomTabTransparentSwatch: 'Transparent Swatch',\n\tgreenAbbreviated: 'G',\n\thexLabel: 'Hex',\n\tinvalidColor: 'The color entered is invalid',\n\tinvalidComponent: 'The value needs to be an integer from 0-255',\n\tredAbbreviated: 'R',\n\tsubmitButton: 'Done',\n\tswatchTab: 'Default',\n\tswatchTabTransparentSwatch: 'Transparent Swatch',\n};\n\nconst defaultAssistiveText: ColorPickerAssistiveText = {\n\tsaturationValueGrid:\n\t\t'Use arrow keys to select a saturation and brightness, on an x and y axis.',\n\thueSlider: 'Select Hue',\n};\n\nconst defaultSwatchColors = [\n\t'#e3abec',\n\t'#c2dbf7',\n\t'#9fd6ff',\n\t'#9de7da',\n\t'#9df0c0',\n\t'#fff099',\n\t'#fed49a',\n\t'#d073e0',\n\t'#86baf3',\n\t'#5ebbff',\n\t'#44d8be',\n\t'#3be282',\n\t'#ffe654',\n\t'#ffb758',\n\t'#bd35bd',\n\t'#5779c1',\n\t'#5679c0',\n\t'#00aea9',\n\t'#3cba4c',\n\t'#f5bc25',\n\t'#f99221',\n\t'#580d8c',\n\t'#001970',\n\t'#0a2399',\n\t'#0b7477',\n\t'#0b6b50',\n\t'#b67e11',\n\t'#b85d0d',\n\t'',\n];\n\ntype HexValidator = ((hex: string) => boolean) | undefined;\n\n/** Builds a working color from a color value, resolving CSS color names to hex. */\nconst getWorkingColorFromValue = (\n\tcolor: string,\n\tvalidator: HexValidator\n): WorkingColor => {\n\tconst namedColorHex = ColorUtils.getHexFromNamedColor(color);\n\treturn ColorUtils.getNewColor(\n\t\t{\n\t\t\thex: namedColorHex || color,\n\t\t\tname: namedColorHex ? color.toLowerCase() : null,\n\t\t} as { hex: string; name?: string | null },\n\t\tvalidator\n\t) as WorkingColor;\n};\n\n/** Whether `color` is valid for the summary input. */\nconst isValidColor = (color: string, validator: HexValidator): boolean => {\n\tif (validator) {\n\t\treturn !!validator(color);\n\t}\n\treturn ColorUtils.getHexFromNamedColor(color)\n\t\t? true\n\t\t: ColorUtils.isValidHex(color);\n};\n\n/**\n * The Unified Color Picker component allows for a fully accessible and\n * configurable color picker, allowing the user to pick from a set of\n * predefined colors (swatches), or to pick a custom color using a HSB\n * selection interface.\n */\nconst ColorPicker: React.FC<ColorPickerProps> = ({\n\tassistiveText: assistiveTextProp,\n\tclassName,\n\tclassNameMenu,\n\tid: idProp,\n\tdefaultIsOpen = false,\n\tdisabled = false,\n\terrorText: errorTextProp,\n\terrorTextWorkingColor,\n\tevents = {},\n\thasStaticAlignment,\n\thideInput = false,\n\tisOpen: isOpenProp,\n\tlabels: labelsProp,\n\tmenuPosition = 'absolute',\n\tswatchColors = defaultSwatchColors,\n\tdefaultSelectedTab = 'swatches',\n\tvariant = 'base',\n\tvalue: valueProp,\n\tvalueWorking: valueWorkingProp,\n\tonClose,\n\tonOpen,\n\tonRequestClose,\n\tonRequestOpen,\n}) => {\n\t// Merge labels and assistive text with defaults\n\tconst labels = useMemo(\n\t\t() => ({ ...defaultLabels, ...labelsProp }),\n\t\t[labelsProp]\n\t);\n\tconst assistiveText = useMemo(\n\t\t() => ({ ...defaultAssistiveText, ...assistiveTextProp }),\n\t\t[assistiveTextProp]\n\t);\n\n\t// Generate stable ID\n\tconst generatedId = useRef(idProp || generateId());\n\tconst componentId = idProp || generatedId.current;\n\n\t// Refs\n\tconst wrapperRef = useRef<HTMLDivElement>(null);\n\n\t// `value` is controlled data. A missing `value` (warned in `checkProps`) renders as no color.\n\tconst value = valueProp ?? '';\n\tconst validateWorkingColor = events.onValidateWorkingColor;\n\n\t// Popover open state is ephemeral UI: controlled when `isOpen` is set, internal otherwise\n\tconst [isOpen, setIsOpen] = useControllableState(isOpenProp, defaultIsOpen);\n\n\t// The in-popover working color is a draft of `value`. It is reset from `value` when the\n\t// popover opens and when `value` changes.\n\tconst [draftColor, setDraftColor] = useState<WorkingColor>(() =>\n\t\tgetWorkingColorFromValue(value, validateWorkingColor)\n\t);\n\tconst [previousWorkingColor, setPreviousWorkingColor] =\n\t\tuseState<WorkingColor>(draftColor);\n\tconst [syncedFrom, setSyncedFrom] = useState({ value, isOpen });\n\tif (syncedFrom.value !== value || syncedFrom.isOpen !== isOpen) {\n\t\t// Adjusting state while rendering, so the popover never shows a stale draft\n\t\tsetSyncedFrom({ value, isOpen });\n\t\tif (syncedFrom.value !== value || isOpen) {\n\t\t\tconst resetColor = getWorkingColorFromValue(value, validateWorkingColor);\n\t\t\tsetDraftColor(resetColor);\n\t\t\tsetPreviousWorkingColor(resetColor);\n\t\t}\n\t}\n\n\t// A controlled `valueWorking` always wins. The draft is only used for it while it describes\n\t// the same hex, so partial RGB input and hue are kept while the parent accepts each change.\n\tconst workingColor = useMemo(\n\t\t() =>\n\t\t\tvalueWorkingProp !== undefined && draftColor.hex !== valueWorkingProp\n\t\t\t\t? (ColorUtils.getNewColor(\n\t\t\t\t\t\t{ hex: valueWorkingProp },\n\t\t\t\t\t\tvalidateWorkingColor\n\t\t\t\t\t) as WorkingColor)\n\t\t\t\t: draftColor,\n\t\t[valueWorkingProp, draftColor, validateWorkingColor]\n\t);\n\n\t// Derived from `value` on every render rather than seeded once\n\tconst isValueValid = useMemo(\n\t\t() => isValidColor(value, events.onValidateColor),\n\t\t[value, events.onValidateColor]\n\t);\n\tconst colorErrorMessage =\n\t\terrorTextProp || (isValueValid ? '' : labels.invalidColor || '');\n\n\t// Check props on mount (development only)\n\tuseEffect(() => {\n\t\t// checkProps is a no-op in production\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t(checkProps as any)(\n\t\t\tCOLOR_PICKER,\n\t\t\t{\n\t\t\t\tassistiveText: assistiveTextProp,\n\t\t\t\tclassName,\n\t\t\t\tclassNameMenu,\n\t\t\t\tid: idProp,\n\t\t\t\tdisabled,\n\t\t\t\terrorText: errorTextProp,\n\t\t\t\terrorTextWorkingColor,\n\t\t\t\tevents,\n\t\t\t\thasStaticAlignment,\n\t\t\t\thideInput,\n\t\t\t\tisOpen: isOpenProp,\n\t\t\t\tlabels: labelsProp,\n\t\t\t\tmenuPosition,\n\t\t\t\tswatchColors,\n\t\t\t\tdefaultSelectedTab,\n\t\t\t\tvariant,\n\t\t\t\tvalue: valueProp,\n\t\t\t\tvalueWorking: valueWorkingProp,\n\t\t\t},\n\t\t\t{}\n\t\t);\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, []);\n\n\t// Report a new working color. The draft updates, but a controlled `valueWorking` still wins.\n\tconst setNextWorkingColor = useCallback(\n\t\t(event: React.SyntheticEvent, newColor: WorkingColor) => {\n\t\t\tsetPreviousWorkingColor(workingColor);\n\t\t\tsetDraftColor(newColor);\n\n\t\t\tif (events.onWorkingColorChange) {\n\t\t\t\tevents.onWorkingColorChange(event, { color: newColor });\n\t\t\t}\n\t\t},\n\t\t[events, workingColor]\n\t);\n\n\t// Helper to update working color\n\tconst updateWorkingColor = useCallback(\n\t\t(\n\t\t\tevent: React.SyntheticEvent,\n\t\t\tcolorOptions: {\n\t\t\t\thex?: string;\n\t\t\t\tred?: string | number;\n\t\t\t\tgreen?: string | number;\n\t\t\t\tblue?: string | number;\n\t\t\t\thue?: number | string;\n\t\t\t\tsaturation?: number;\n\t\t\t\tvalue?: number;\n\t\t\t}\n\t\t) => {\n\t\t\tsetNextWorkingColor(\n\t\t\t\tevent,\n\t\t\t\tColorUtils.getNewColor(\n\t\t\t\t\tcolorOptions,\n\t\t\t\t\tvalidateWorkingColor,\n\t\t\t\t\tworkingColor\n\t\t\t\t) as WorkingColor\n\t\t\t);\n\t\t},\n\t\t[setNextWorkingColor, validateWorkingColor, workingColor]\n\t);\n\n\t// Event handlers\n\tconst handleSwatchChange = useCallback(\n\t\t(event: React.ChangeEvent<HTMLInputElement>) => {\n\t\t\tupdateWorkingColor(event, { hex: event.target.value });\n\t\t},\n\t\t[updateWorkingColor]\n\t);\n\n\t// Request a close. Uncontrolled, the popover closes itself; controlled, the parent decides.\n\tconst requestClose = useCallback(\n\t\t(event: React.SyntheticEvent, data: { trigger: string }) => {\n\t\t\tsetIsOpen(false);\n\n\t\t\tif (onRequestClose) {\n\t\t\t\tonRequestClose(event, data);\n\t\t\t}\n\t\t},\n\t\t[setIsOpen, onRequestClose]\n\t);\n\n\tconst handleCancel = useCallback(\n\t\t(event: React.MouseEvent) => {\n\t\t\trequestClose(event, { trigger: 'cancel' });\n\t\t},\n\t\t[requestClose]\n\t);\n\n\tconst handleColorChange = useCallback(\n\t\t(property: 'hex' | 'red' | 'green' | 'blue') =>\n\t\t\t(event: React.SyntheticEvent, data: InputChangeData) => {\n\t\t\t\tconst colorProperties: Record<string, string | number> = {};\n\t\t\t\tcolorProperties[property] = data.value;\n\t\t\t\tupdateWorkingColor(event, colorProperties);\n\t\t\t},\n\t\t[updateWorkingColor]\n\t);\n\n\tconst handleHueChange = useCallback(\n\t\t(event: React.ChangeEvent<HTMLInputElement>) => {\n\t\t\tupdateWorkingColor(event, { hue: event.target.value });\n\t\t},\n\t\t[updateWorkingColor]\n\t);\n\n\t// The summary input is controlled by `value`: report the typed text and let the parent decide\n\tconst handleHexInputChange = useCallback(\n\t\t(event: React.SyntheticEvent, data: InputChangeData) => {\n\t\t\tconst isValid = isValidColor(data.value, events.onValidateColor);\n\n\t\t\tif (events.onChange) {\n\t\t\t\tevents.onChange(event, { color: data.value, isValid });\n\t\t\t}\n\t\t},\n\t\t[events]\n\t);\n\n\tconst handleNavigate = useCallback(\n\t\t(property: 'saturation' | 'value') =>\n\t\t\t(event: React.KeyboardEvent, data: { delta: number }) => {\n\t\t\t\tconst colorProperties: Record<string, number> = {};\n\t\t\t\tcolorProperties[property] = data.delta;\n\t\t\t\tsetNextWorkingColor(\n\t\t\t\t\tevent,\n\t\t\t\t\tColorUtils.getDeltaColor(\n\t\t\t\t\t\tcolorProperties,\n\t\t\t\t\t\tvalidateWorkingColor,\n\t\t\t\t\t\tworkingColor\n\t\t\t\t\t) as WorkingColor\n\t\t\t\t);\n\t\t\t},\n\t\t[setNextWorkingColor, validateWorkingColor, workingColor]\n\t);\n\n\tconst handleSaturationValueChange = useCallback(\n\t\t(\n\t\t\tevent: React.MouseEvent | React.KeyboardEvent,\n\t\t\tdata: { saturation: number; value: number }\n\t\t) => {\n\t\t\tupdateWorkingColor(event, {\n\t\t\t\tsaturation: data.saturation,\n\t\t\t\tvalue: data.value,\n\t\t\t});\n\t\t},\n\t\t[updateWorkingColor]\n\t);\n\n\tconst handleSubmitButtonClick = useCallback(\n\t\t(event: React.MouseEvent) => {\n\t\t\tif (events.onChange) {\n\t\t\t\tevents.onChange(event, {\n\t\t\t\t\tcolor: workingColor.hex,\n\t\t\t\t\tisValid: true,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\trequestClose(event, { trigger: 'submit' });\n\t\t},\n\t\t[events, requestClose, workingColor.hex]\n\t);\n\n\t// While open, Popover has already requested a close (`triggerClick`) for this click\n\tconst handleSwatchButtonClick = useCallback(() => {\n\t\tif (!isOpen) {\n\t\t\tsetIsOpen(true);\n\n\t\t\tif (onRequestOpen) {\n\t\t\t\tonRequestOpen();\n\t\t\t}\n\t\t}\n\t}, [isOpen, setIsOpen, onRequestOpen]);\n\n\tconst handleSwatchSelect = useCallback(\n\t\t(event: React.MouseEvent | React.KeyboardEvent, data: { hex: string }) => {\n\t\t\tupdateWorkingColor(event, { hex: data.hex });\n\t\t},\n\t\t[updateWorkingColor]\n\t);\n\n\t// Render helpers\n\tconst renderInput = () => {\n\t\tif (hideInput) return null;\n\n\t\treturn (\n\t\t\t<Input\n\t\t\t\taria-describedby={\n\t\t\t\t\t!isOpen && colorErrorMessage\n\t\t\t\t\t\t? `color-picker-summary-error-${componentId}`\n\t\t\t\t\t\t: undefined\n\t\t\t\t}\n\t\t\t\tclassName={classNames(\n\t\t\t\t\t'slds-color-picker__summary-input',\n\t\t\t\t\t'slds-align-top',\n\t\t\t\t\t{\n\t\t\t\t\t\t'slds-has-error': !!colorErrorMessage,\n\t\t\t\t\t}\n\t\t\t\t)}\n\t\t\t\tdisabled={disabled}\n\t\t\t\tid={`color-picker-summary-input-${componentId}`}\n\t\t\t\tonChange={handleHexInputChange}\n\t\t\t\tvalue={value}\n\t\t\t/>\n\t\t);\n\t};\n\n\tconst renderDefaultTab = () => {\n\t\tif (variant !== 'base' && variant !== 'swatches') return null;\n\n\t\treturn (\n\t\t\t<TabsPanel label={labels.swatchTab ?? ''}>\n\t\t\t\t<SwatchPicker\n\t\t\t\t\tcolor={workingColor}\n\t\t\t\t\tlabels={labels}\n\t\t\t\t\tonSelect={handleSwatchSelect}\n\t\t\t\t\tswatchColors={swatchColors}\n\t\t\t\t/>\n\t\t\t</TabsPanel>\n\t\t);\n\t};\n\n\tconst renderCustomTab = () => {\n\t\tif (variant !== 'base' && variant !== 'custom') return null;\n\n\t\treturn (\n\t\t\t<TabsPanel label={labels.customTab ?? ''}>\n\t\t\t\t<CustomColor\n\t\t\t\t\tassistiveText={assistiveText}\n\t\t\t\t\tid={componentId}\n\t\t\t\t\tcolor={workingColor}\n\t\t\t\t\terrorTextWorkingColor={errorTextWorkingColor}\n\t\t\t\t\tpreviousColor={previousWorkingColor}\n\t\t\t\t\tlabels={labels}\n\t\t\t\t\tonBlueChange={handleColorChange('blue')}\n\t\t\t\t\tonGreenChange={handleColorChange('green')}\n\t\t\t\t\tonHexChange={handleColorChange('hex')}\n\t\t\t\t\tonHueChange={handleHueChange}\n\t\t\t\t\tonRedChange={handleColorChange('red')}\n\t\t\t\t\tonSwatchChange={handleSwatchChange}\n\t\t\t\t\tonSaturationValueChange={handleSaturationValueChange}\n\t\t\t\t\tonSaturationNavigate={handleNavigate('saturation')}\n\t\t\t\t\tonValueNavigate={handleNavigate('value')}\n\t\t\t\t/>\n\t\t\t</TabsPanel>\n\t\t);\n\t};\n\n\tconst popoverBody = (\n\t\t<ColorPickerTabs\n\t\t\tid={`color-picker-tabs-${componentId}`}\n\t\t\tdefaultValue={defaultSelectedTab === 'custom' ? '1' : '0'}\n\t\t>\n\t\t\t{renderDefaultTab()}\n\t\t\t{renderCustomTab()}\n\t\t</ColorPickerTabs>\n\t);\n\n\tconst popoverFooter = (\n\t\t<div className=\"slds-color-picker__selector-footer\">\n\t\t\t<Button\n\t\t\t\tclassName=\"slds-color-picker__selector-cancel\"\n\t\t\t\tid={`color-picker-footer-cancel-${componentId}`}\n\t\t\t\tlabel={labels.cancelButton}\n\t\t\t\tonClick={handleCancel}\n\t\t\t\tvariant=\"neutral\"\n\t\t\t/>\n\t\t\t<Button\n\t\t\t\tclassName=\"slds-color-picker__selector-submit\"\n\t\t\t\tdisabled={Object.keys(workingColor.errors || {}).length > 0}\n\t\t\t\tid={`color-picker-footer-submit-${componentId}`}\n\t\t\t\tlabel={labels.submitButton}\n\t\t\t\tonClick={handleSubmitButtonClick}\n\t\t\t\tvariant=\"brand\"\n\t\t\t/>\n\t\t</div>\n\t);\n\n\treturn (\n\t\t<div\n\t\t\tclassName={classNames('slds-color-picker', className)}\n\t\t\tref={wrapperRef}\n\t\t>\n\t\t\t<div className=\"slds-color-picker__summary\">\n\t\t\t\t<label\n\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t'slds-color-picker__summary-label',\n\t\t\t\t\t\tassistiveText.label ? 'slds-assistive-text' : ''\n\t\t\t\t\t)}\n\t\t\t\t\thtmlFor={\n\t\t\t\t\t\t!hideInput ? `color-picker-summary-input-${componentId}` : undefined\n\t\t\t\t\t}\n\t\t\t\t\tid={`color-picker-label-${componentId}`}\n\t\t\t\t>\n\t\t\t\t\t{assistiveText.label ? assistiveText.label : labels.label}\n\t\t\t\t</label>\n\t\t\t\t<Popover\n\t\t\t\t\tariaLabelledby={`color-picker-label-${componentId}`}\n\t\t\t\t\talign=\"bottom left\"\n\t\t\t\t\tbody={popoverBody}\n\t\t\t\t\tclassNameDialog={classNames(\n\t\t\t\t\t\t'slds-color-picker__selector',\n\t\t\t\t\t\tclassNameMenu\n\t\t\t\t\t)}\n\t\t\t\t\tfooter={popoverFooter}\n\t\t\t\t\thasNoCloseButton\n\t\t\t\t\thasNoNubbin\n\t\t\t\t\thasStaticAlignment={hasStaticAlignment}\n\t\t\t\t\tid={`slds-color-picker__selector-${componentId}`}\n\t\t\t\t\tisOpen={isOpen}\n\t\t\t\t\tonClose={\n\t\t\t\t\t\tonClose as unknown as\n\t\t\t\t\t\t\t| ((\n\t\t\t\t\t\t\t\t\tevent?: unknown,\n\t\t\t\t\t\t\t\t\tdata?: { componentWillUnmount?: boolean }\n\t\t\t\t\t\t\t ) => void)\n\t\t\t\t\t\t\t| undefined\n\t\t\t\t\t}\n\t\t\t\t\tonOpen={\n\t\t\t\t\t\tonOpen as unknown as\n\t\t\t\t\t\t\t| ((event?: unknown, data?: { portal?: HTMLElement }) => void)\n\t\t\t\t\t\t\t| undefined\n\t\t\t\t\t}\n\t\t\t\t\tonRequestClose={\n\t\t\t\t\t\trequestClose as unknown as\n\t\t\t\t\t\t\t| ((event?: unknown, data?: { trigger?: string }) => void)\n\t\t\t\t\t\t\t| undefined\n\t\t\t\t\t}\n\t\t\t\t\tposition={menuPosition}\n\t\t\t\t>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tclassName=\"slds-color-picker__summary-button\"\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\ticonClassName=\"slds-m-left_xx-small\"\n\t\t\t\t\t\ticonPosition=\"right\"\n\t\t\t\t\t\ticonVariant=\"more\"\n\t\t\t\t\t\tid={`slds-color-picker__summary-button-${componentId}`}\n\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t<span className=\"slds-assistive-text\">\n\t\t\t\t\t\t\t\t\t{assistiveText.label ? assistiveText.label : labels.label}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t<Swatch color={value} labels={labels} />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonClick={handleSwatchButtonClick}\n\t\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t\t/>\n\t\t\t\t</Popover>\n\t\t\t\t{renderInput()}\n\t\t\t\t{!isOpen && colorErrorMessage && (\n\t\t\t\t\t<p\n\t\t\t\t\t\tclassName=\"slds-form-error\"\n\t\t\t\t\t\tid={`color-picker-summary-error-${componentId}`}\n\t\t\t\t\t>\n\t\t\t\t\t\t{colorErrorMessage}\n\t\t\t\t\t</p>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nColorPicker.displayName = COLOR_PICKER;\n\nexport default ColorPicker;\n"],"mappings":"qrBAyJA,IAAM,EAAmC,CACxC,gBAAiB,IACjB,aAAc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EV,UAAA,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CACC,UAAU,oCACA,WACV,cAAc,uBACd,aAAa,QACb,YAAY,OACZ,GAAI,qCAAqC,IACzC,OACC,EAAA,EAAA,KAAA,CAAC,MAAD,CAAA,SAAA,EACC,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,sBACd,SAAA,EAAc,MAAQ,EAAc,MAAQ,EAAO,KAC/C,CAAA,GACN,EAAA,EAAA,IAAA,CAAC,GAAA,QAAD,CAAQ,MAAO,EAAe,QAAS,CAAA,CACnC,CAAA,CAAA,EAEN,QAAS,GACT,QAAQ,MACR,CAAA,CACO,CAAA,EACR,GAAY,EACZ,CAAC,GAAU,IACX,EAAA,EAAA,IAAA,CAAC,IAAD,CACC,UAAU,kBACV,GAAI,8BAA8B,IAEjC,SAAA,CACC,CAAA,CAEA,GACD,CAAA,CAEP,EAEA,EAAY,YAAc,EAAA"}
@@ -0,0 +1,2 @@
1
+ const e=require("../../tabs/index.cjs");let t=require("react"),n=require("react/jsx-runtime");var r=({children:r,defaultValue:i,id:a})=>{let[o,s]=(0,t.useState)(i);return(0,n.jsx)(e.default,{id:a,onSelect:(e,t)=>s(t.value),value:o,children:r})};exports.default=r;
2
+ //# sourceMappingURL=color-picker-tabs.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"color-picker-tabs.cjs","names":[],"sources":["../../../../../components/color-picker/private/color-picker-tabs.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 { useState, type ReactNode } from 'react';\n\nimport Tabs from '../../tabs';\n\ninterface ColorPickerTabsProps {\n\tchildren: ReactNode;\n\t/** `value` of the tab shown when the popover opens */\n\tdefaultValue: string;\n\tid: string;\n}\n\n/**\n * `Tabs` is controlled, so the selected tab lives here. The popover body\n * remounts on every open, so each open starts at `defaultValue`.\n */\nconst ColorPickerTabs = ({\n\tchildren,\n\tdefaultValue,\n\tid,\n}: ColorPickerTabsProps) => {\n\tconst [value, setValue] = useState(defaultValue);\n\treturn (\n\t\t<Tabs\n\t\t\tid={id}\n\t\t\tonSelect={(event, data) => setValue(data.value)}\n\t\t\tvalue={value}\n\t\t>\n\t\t\t{children}\n\t\t</Tabs>\n\t);\n};\n\nexport default ColorPickerTabs;\n"],"mappings":"8FAkBA,IAAM,GAAmB,CACxB,WACA,eACA,QAC2B,CAC3B,GAAM,CAAC,EAAO,IAAA,EAAY,EAAA,SAAA,CAAS,CAAY,EAC/C,OACC,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CACK,KACJ,UAAW,EAAO,IAAS,EAAS,EAAK,KAAK,EACvC,QAEN,UACI,CAAA,CAER"}
@@ -1,2 +1,2 @@
1
- const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../utilities/key-code.cjs"),n=require("../../radio-button-group/index.cjs"),r=require("../../radio-button-group/radio.cjs"),i=require("../../../utilities/color.cjs");let a=require("react");a=e.__toESM(a,1);let o=require("react/jsx-runtime");var s={border:`1px solid #9e9e9e`,boxShadow:`rgb(117, 112, 112) 1px 1px 1px`,marginRight:`2px`},c={border:`1px solid #9e9e9e`,marginRight:`2px`},l=({assistiveText:e,color:l,id:u,labels:d,onHueChange:f,onSaturationValueChange:p,onSaturationNavigate:m,onValueNavigate:h,onSwatchChange:g,previousColor:_})=>{let v=(0,a.useRef)(null),y=(0,a.useCallback)(()=>l.hex===``,[l.hex]),b=(0,a.useCallback)(e=>{let t=e.currentTarget.getBoundingClientRect();v.current?.focus(),p(e,{saturation:Math.round((e.clientX-t.left)/t.width*100),value:Math.round((t.bottom-e.clientY)/t.height*100)})},[p]),x=(0,a.useCallback)(e=>{let n={[t.default.LEFT]:t=>{m(e,{delta:t*-1})},[t.default.RIGHT]:t=>{m(e,{delta:t})},[t.default.UP]:t=>{h(e,{delta:t})},[t.default.DOWN]:t=>{h(e,{delta:t*-1})}};n[e.keyCode]&&(e.preventDefault(),n[e.keyCode](e.shiftKey?10:1))},[m,h]),S=(0,a.useCallback)(e=>{g(e)},[g]),C=_.hex?_:i.default.getNewColor({hex:`#000000`}),w=y()?C:l,T={border:`none`,borderRadius:`unset`},E=y()?{...c}:{...s},D=y()?{...s}:{...c};return(0,o.jsxs)(`div`,{children:[(0,o.jsx)(`p`,{className:`slds-assistive-text`,id:`color-picker-instructions-${u}`,children:e.saturationValueGrid}),(0,o.jsx)(`div`,{className:`slds-color-picker__custom-range`,style:{background:`hsl(${w.hsv.hue}, 100%, 50%)`},onClick:b,role:`presentation`,children:(0,o.jsx)(`a`,{"aria-atomic":`true`,"aria-describedby":`color-picker-instructions-${u}`,"aria-live":`assertive`,className:`slds-color-picker__range-indicator`,onKeyDown:x,ref:v,role:`button`,style:{bottom:`${w.hsv.value}%`,left:`${w.hsv.saturation}%`},tabIndex:0,children:(0,o.jsx)(`span`,{className:`slds-assistive-text`,children:`Saturation ${w.hsv.saturation}% Brightness: ${w.hsv.value}%`})})}),(0,o.jsxs)(`div`,{className:`slds-color-picker__hue-and-preview`,children:[(0,o.jsx)(`label`,{className:`slds-assistive-text`,htmlFor:`color-picker-input-range-${u}`,children:e.hueSlider}),(0,o.jsx)(`input`,{type:`range`,min:`0`,max:`360`,className:`slds-color-picker__hue-slider`,id:`color-picker-input-range-${u}`,value:w.hsv.hue,onChange:f}),(0,o.jsxs)(n.default,{name:`${u}-color-picker-swatch-toggle-button-group`,assistiveText:{label:`Toggle Transparency`},style:T,onChange:S,children:[(0,o.jsx)(r.default,{checked:!y(),id:`color-picker-active-working-color-swatch-${u}`,labels:{label:d.customTabActiveWorkingColorSwatch},style:E,value:w.hex,variant:`swatch`},`working-color`),(0,o.jsx)(r.default,{checked:y(),id:`color-picker-transparent-swatch-${u}`,labels:{label:d.customTabTransparentSwatch},style:D,value:``,variant:`swatch`},`transparent`)]})]})]})};l.displayName=`SLDSHsvColor`,exports.default=l;
1
+ const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../utilities/key-code.cjs"),n=require("../../radio-button-group/index.cjs"),r=require("../../radio-button-group/radio.cjs"),i=require("../../../utilities/color.cjs");let a=require("react");a=e.__toESM(a,1);let o=require("react/jsx-runtime");var s={border:`1px solid #9e9e9e`,boxShadow:`rgb(117, 112, 112) 1px 1px 1px`,marginRight:`2px`},c={border:`1px solid #9e9e9e`,marginRight:`2px`},l=({assistiveText:e,color:l,id:u,labels:d,onHueChange:f,onSaturationValueChange:p,onSaturationNavigate:m,onValueNavigate:h,onSwatchChange:g,previousColor:_})=>{let v=(0,a.useRef)(null),y=(0,a.useCallback)(()=>l.hex===``,[l.hex]),b=(0,a.useCallback)(e=>{let t=e.currentTarget.getBoundingClientRect();v.current?.focus(),p(e,{saturation:Math.round((e.clientX-t.left)/t.width*100),value:Math.round((t.bottom-e.clientY)/t.height*100)})},[p]),x=(0,a.useCallback)(e=>{let n={[t.default.LEFT]:t=>{m(e,{delta:t*-1})},[t.default.RIGHT]:t=>{m(e,{delta:t})},[t.default.UP]:t=>{h(e,{delta:t})},[t.default.DOWN]:t=>{h(e,{delta:t*-1})}};n[e.keyCode]&&(e.preventDefault(),n[e.keyCode](e.shiftKey?10:1))},[m,h]),S=(0,a.useCallback)(e=>{g(e)},[g]),C=_.hex?_:i.default.getNewColor({hex:`#000000`}),w=y()?C:l,T={border:`none`,borderRadius:`unset`},E=y()?{...c}:{...s},D=y()?{...s}:{...c};return(0,o.jsxs)(`div`,{children:[(0,o.jsx)(`p`,{className:`slds-assistive-text`,id:`color-picker-instructions-${u}`,children:e.saturationValueGrid}),(0,o.jsx)(`div`,{className:`slds-color-picker__custom-range`,style:{background:`hsl(${w.hsv.hue}, 100%, 50%)`},onClick:b,role:`presentation`,children:(0,o.jsx)(`a`,{"aria-atomic":`true`,"aria-describedby":`color-picker-instructions-${u}`,"aria-live":`assertive`,className:`slds-color-picker__range-indicator`,onKeyDown:x,ref:v,role:`button`,style:{bottom:`${w.hsv.value}%`,left:`${w.hsv.saturation}%`},tabIndex:0,children:(0,o.jsx)(`span`,{className:`slds-assistive-text`,children:`Saturation ${w.hsv.saturation}% Brightness: ${w.hsv.value}%`})})}),(0,o.jsxs)(`div`,{className:`slds-color-picker__hue-and-preview`,children:[(0,o.jsx)(`label`,{className:`slds-assistive-text`,htmlFor:`color-picker-input-range-${u}`,children:e.hueSlider}),(0,o.jsx)(`input`,{type:`range`,min:`0`,max:`360`,className:`slds-color-picker__hue-slider`,id:`color-picker-input-range-${u}`,value:w.hsv.hue,onChange:f}),(0,o.jsxs)(n.default,{name:`${u}-color-picker-swatch-toggle-button-group`,assistiveText:{label:`Toggle Transparency`},style:T,onChange:S,value:y()?``:w.hex,children:[(0,o.jsx)(r.default,{checked:!y(),id:`color-picker-active-working-color-swatch-${u}`,labels:{label:d.customTabActiveWorkingColorSwatch},style:E,value:w.hex,variant:`swatch`},`working-color`),(0,o.jsx)(r.default,{checked:y(),id:`color-picker-transparent-swatch-${u}`,labels:{label:d.customTabTransparentSwatch},style:D,value:``,variant:`swatch`},`transparent`)]})]})]})};l.displayName=`SLDSHsvColor`,exports.default=l;
2
2
  //# sourceMappingURL=hsv-color.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"hsv-color.cjs","names":[],"sources":["../../../../../components/color-picker/private/hsv-color.tsx"],"sourcesContent":["import React, { useRef, useCallback } from 'react';\n\nimport KEYS from '../../../utilities/key-code';\nimport RadioButtonGroup from '../../../components/radio-button-group';\nimport Radio from '../../../components/radio-button-group/radio';\nimport ColorUtils from '../../../utilities/color';\nimport { WorkingColor, ColorPickerAssistiveText, ColorPickerLabels } from '../types';\n\nexport interface HsvColorProps {\n\t/** Assistive text for accessibility */\n\tassistiveText: ColorPickerAssistiveText;\n\t/** Current working color object */\n\tcolor: WorkingColor;\n\t/** Unique ID for the component */\n\tid: string;\n\t/** Labels for internationalization */\n\tlabels: ColorPickerLabels;\n\t/** Callback for hue slider change */\n\tonHueChange: (event: React.ChangeEvent<HTMLInputElement>) => void;\n\t/** Callback for saturation/value change from grid click */\n\tonSaturationValueChange: (\n\t\tevent: React.MouseEvent | React.KeyboardEvent,\n\t\tdata: { saturation: number; value: number }\n\t) => void;\n\t/** Callback for saturation navigation via keyboard */\n\tonSaturationNavigate: (\n\t\tevent: React.KeyboardEvent,\n\t\tdata: { delta: number }\n\t) => void;\n\t/** Callback for value navigation via keyboard */\n\tonValueNavigate: (\n\t\tevent: React.KeyboardEvent,\n\t\tdata: { delta: number }\n\t) => void;\n\t/** Callback for swatch toggle (working color vs transparent) */\n\tonSwatchChange: (event: React.ChangeEvent<HTMLInputElement>) => void;\n\t/** Previous working color (fallback when transparent) */\n\tpreviousColor: WorkingColor;\n}\n\nconst selectedStyle = {\n\tborder: '1px solid #9e9e9e',\n\tboxShadow: 'rgb(117, 112, 112) 1px 1px 1px',\n\tmarginRight: '2px',\n};\n\nconst unselectedStyle = {\n\tborder: '1px solid #9e9e9e',\n\tmarginRight: '2px',\n};\n\n/**\n * HSV color selection component with saturation/value grid and hue slider.\n */\nconst HsvColor: React.FC<HsvColorProps> = ({\n\tassistiveText,\n\tcolor,\n\tid,\n\tlabels,\n\tonHueChange,\n\tonSaturationValueChange,\n\tonSaturationNavigate,\n\tonValueNavigate,\n\tonSwatchChange,\n\tpreviousColor,\n}) => {\n\tconst rangeIndicatorRef = useRef<HTMLAnchorElement>(null);\n\n\tconst isTransparent = useCallback(() => color.hex === '', [color.hex]);\n\n\tconst handleClick = useCallback(\n\t\t(event: React.MouseEvent<HTMLDivElement>) => {\n\t\t\tconst rect = event.currentTarget.getBoundingClientRect();\n\t\t\trangeIndicatorRef.current?.focus();\n\t\t\tonSaturationValueChange(event, {\n\t\t\t\tsaturation: Math.round(((event.clientX - rect.left) / rect.width) * 100),\n\t\t\t\tvalue: Math.round(((rect.bottom - event.clientY) / rect.height) * 100),\n\t\t\t});\n\t\t},\n\t\t[onSaturationValueChange]\n\t);\n\n\tconst handleKeyDown = useCallback(\n\t\t(event: React.KeyboardEvent) => {\n\t\t\tconst keyDownCallbacks: Record<number, (multiplier: number) => void> = {\n\t\t\t\t[KEYS.LEFT]: (multiplier) => {\n\t\t\t\t\tonSaturationNavigate(event, { delta: multiplier * -1 });\n\t\t\t\t},\n\t\t\t\t[KEYS.RIGHT]: (multiplier) => {\n\t\t\t\t\tonSaturationNavigate(event, { delta: multiplier });\n\t\t\t\t},\n\t\t\t\t[KEYS.UP]: (multiplier) => {\n\t\t\t\t\tonValueNavigate(event, { delta: multiplier });\n\t\t\t\t},\n\t\t\t\t[KEYS.DOWN]: (multiplier) => {\n\t\t\t\t\tonValueNavigate(event, { delta: multiplier * -1 });\n\t\t\t\t},\n\t\t\t};\n\n\t\t\tif (keyDownCallbacks[event.keyCode]) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tkeyDownCallbacks[event.keyCode](event.shiftKey ? 10 : 1);\n\t\t\t}\n\t\t},\n\t\t[onSaturationNavigate, onValueNavigate]\n\t);\n\n\tconst handleSwatchChange = useCallback(\n\t\t(event: React.ChangeEvent<HTMLInputElement>) => {\n\t\t\tonSwatchChange(event);\n\t\t},\n\t\t[onSwatchChange]\n\t);\n\n\t// When working color is transparent: either use the previous color or default to black\n\tconst fallbackWorkingColor = previousColor.hex\n\t\t? previousColor\n\t\t: (ColorUtils.getNewColor({ hex: '#000000' }) as WorkingColor);\n\tconst workingColor = isTransparent() ? fallbackWorkingColor : color;\n\n\tconst style = { border: 'none', borderRadius: 'unset' };\n\tconst swatchStyle = isTransparent() ? { ...unselectedStyle } : { ...selectedStyle };\n\tconst transparentSwatchStyle = isTransparent()\n\t\t? { ...selectedStyle }\n\t\t: { ...unselectedStyle };\n\n\treturn (\n\t\t<div>\n\t\t\t<p\n\t\t\t\tclassName=\"slds-assistive-text\"\n\t\t\t\tid={`color-picker-instructions-${id}`}\n\t\t\t>\n\t\t\t\t{assistiveText.saturationValueGrid}\n\t\t\t</p>\n\t\t\t<div\n\t\t\t\tclassName=\"slds-color-picker__custom-range\"\n\t\t\t\tstyle={{\n\t\t\t\t\tbackground: `hsl(${workingColor.hsv.hue}, 100%, 50%)`,\n\t\t\t\t}}\n\t\t\t\tonClick={handleClick}\n\t\t\t\trole=\"presentation\"\n\t\t\t>\n\t\t\t\t{/* eslint-disable jsx-a11y/anchor-has-content */}\n\t\t\t\t<a\n\t\t\t\t\taria-atomic=\"true\"\n\t\t\t\t\taria-describedby={`color-picker-instructions-${id}`}\n\t\t\t\t\taria-live=\"assertive\"\n\t\t\t\t\tclassName=\"slds-color-picker__range-indicator\"\n\t\t\t\t\tonKeyDown={handleKeyDown}\n\t\t\t\t\tref={rangeIndicatorRef}\n\t\t\t\t\trole=\"button\"\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\tbottom: `${workingColor.hsv.value}%`,\n\t\t\t\t\t\tleft: `${workingColor.hsv.saturation}%`,\n\t\t\t\t\t}}\n\t\t\t\t\ttabIndex={0}\n\t\t\t\t>\n\t\t\t\t\t<span className=\"slds-assistive-text\">\n\t\t\t\t\t\t{`Saturation ${workingColor.hsv.saturation}% Brightness: ${workingColor.hsv.value}%`}\n\t\t\t\t\t</span>\n\t\t\t\t</a>\n\t\t\t</div>\n\t\t\t<div className=\"slds-color-picker__hue-and-preview\">\n\t\t\t\t<label\n\t\t\t\t\tclassName=\"slds-assistive-text\"\n\t\t\t\t\thtmlFor={`color-picker-input-range-${id}`}\n\t\t\t\t>\n\t\t\t\t\t{assistiveText.hueSlider}\n\t\t\t\t</label>\n\t\t\t\t<input\n\t\t\t\t\ttype=\"range\"\n\t\t\t\t\tmin=\"0\"\n\t\t\t\t\tmax=\"360\"\n\t\t\t\t\tclassName=\"slds-color-picker__hue-slider\"\n\t\t\t\t\tid={`color-picker-input-range-${id}`}\n\t\t\t\t\tvalue={workingColor.hsv.hue}\n\t\t\t\t\tonChange={onHueChange}\n\t\t\t\t/>\n\t\t\t\t<RadioButtonGroup\n\t\t\t\t\tname={`${id}-color-picker-swatch-toggle-button-group`}\n\t\t\t\t\tassistiveText={{ label: 'Toggle Transparency' }}\n\t\t\t\t\tstyle={style}\n\t\t\t\t\tonChange={handleSwatchChange}\n\t\t\t\t>\n\t\t\t\t\t<Radio\n\t\t\t\t\t\tchecked={!isTransparent()}\n\t\t\t\t\t\tid={`color-picker-active-working-color-swatch-${id}`}\n\t\t\t\t\t\tkey=\"working-color\"\n\t\t\t\t\t\tlabels={{\n\t\t\t\t\t\t\tlabel: labels.customTabActiveWorkingColorSwatch,\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tstyle={swatchStyle}\n\t\t\t\t\t\tvalue={workingColor.hex}\n\t\t\t\t\t\tvariant=\"swatch\"\n\t\t\t\t\t/>\n\t\t\t\t\t<Radio\n\t\t\t\t\t\tchecked={isTransparent()}\n\t\t\t\t\t\tid={`color-picker-transparent-swatch-${id}`}\n\t\t\t\t\t\tkey=\"transparent\"\n\t\t\t\t\t\tlabels={{ label: labels.customTabTransparentSwatch }}\n\t\t\t\t\t\tstyle={transparentSwatchStyle}\n\t\t\t\t\t\tvalue=\"\" // transparent\n\t\t\t\t\t\tvariant=\"swatch\"\n\t\t\t\t\t/>\n\t\t\t\t</RadioButtonGroup>\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nHsvColor.displayName = 'SLDSHsvColor';\n\nexport default HsvColor;\n\n"],"mappings":"6TAwCA,IAAM,EAAgB,CACrB,OAAQ,oBACR,UAAW,iCACX,YAAa,KACd,EAEM,EAAkB,CACvB,OAAQ,oBACR,YAAa,KACd,EAKM,GAAqC,CAC1C,gBACA,QACA,KACA,SACA,cACA,0BACA,uBACA,kBACA,iBACA,mBACK,CACL,IAAM,GAAA,EAAoB,EAAA,OAAA,CAA0B,IAAI,EAElD,GAAA,EAAgB,EAAA,YAAA,KAAkB,EAAM,MAAQ,GAAI,CAAC,EAAM,GAAG,CAAC,EAE/D,GAAA,EAAc,EAAA,YAAA,CAClB,GAA4C,CAC5C,IAAM,EAAO,EAAM,cAAc,sBAAsB,EACvD,EAAkB,SAAS,MAAM,EACjC,EAAwB,EAAO,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MAAO,EAAO,0BAA2B,EACnD,MAAO,EACP,MAAM,GACN,QAAQ,QACR,EALI,aAKJ,CACgB,GACd,GACD,CAAA,CAAA,CAEP,EAEA,EAAS,YAAc"}
1
+ {"version":3,"file":"hsv-color.cjs","names":[],"sources":["../../../../../components/color-picker/private/hsv-color.tsx"],"sourcesContent":["import React, { useRef, useCallback } from 'react';\n\nimport KEYS from '../../../utilities/key-code';\nimport RadioButtonGroup from '../../../components/radio-button-group';\nimport Radio from '../../../components/radio-button-group/radio';\nimport ColorUtils from '../../../utilities/color';\nimport { WorkingColor, ColorPickerAssistiveText, ColorPickerLabels } from '../types';\n\nexport interface HsvColorProps {\n\t/** Assistive text for accessibility */\n\tassistiveText: ColorPickerAssistiveText;\n\t/** Current working color object */\n\tcolor: WorkingColor;\n\t/** Unique ID for the component */\n\tid: string;\n\t/** Labels for internationalization */\n\tlabels: ColorPickerLabels;\n\t/** Callback for hue slider change */\n\tonHueChange: (event: React.ChangeEvent<HTMLInputElement>) => void;\n\t/** Callback for saturation/value change from grid click */\n\tonSaturationValueChange: (\n\t\tevent: React.MouseEvent | React.KeyboardEvent,\n\t\tdata: { saturation: number; value: number }\n\t) => void;\n\t/** Callback for saturation navigation via keyboard */\n\tonSaturationNavigate: (\n\t\tevent: React.KeyboardEvent,\n\t\tdata: { delta: number }\n\t) => void;\n\t/** Callback for value navigation via keyboard */\n\tonValueNavigate: (\n\t\tevent: React.KeyboardEvent,\n\t\tdata: { delta: number }\n\t) => void;\n\t/** Callback for swatch toggle (working color vs transparent) */\n\tonSwatchChange: (event: React.ChangeEvent<HTMLInputElement>) => void;\n\t/** Previous working color (fallback when transparent) */\n\tpreviousColor: WorkingColor;\n}\n\nconst selectedStyle = {\n\tborder: '1px solid #9e9e9e',\n\tboxShadow: 'rgb(117, 112, 112) 1px 1px 1px',\n\tmarginRight: '2px',\n};\n\nconst unselectedStyle = {\n\tborder: '1px solid #9e9e9e',\n\tmarginRight: '2px',\n};\n\n/**\n * HSV color selection component with saturation/value grid and hue slider.\n */\nconst HsvColor: React.FC<HsvColorProps> = ({\n\tassistiveText,\n\tcolor,\n\tid,\n\tlabels,\n\tonHueChange,\n\tonSaturationValueChange,\n\tonSaturationNavigate,\n\tonValueNavigate,\n\tonSwatchChange,\n\tpreviousColor,\n}) => {\n\tconst rangeIndicatorRef = useRef<HTMLAnchorElement>(null);\n\n\tconst isTransparent = useCallback(() => color.hex === '', [color.hex]);\n\n\tconst handleClick = useCallback(\n\t\t(event: React.MouseEvent<HTMLDivElement>) => {\n\t\t\tconst rect = event.currentTarget.getBoundingClientRect();\n\t\t\trangeIndicatorRef.current?.focus();\n\t\t\tonSaturationValueChange(event, {\n\t\t\t\tsaturation: Math.round(((event.clientX - rect.left) / rect.width) * 100),\n\t\t\t\tvalue: Math.round(((rect.bottom - event.clientY) / rect.height) * 100),\n\t\t\t});\n\t\t},\n\t\t[onSaturationValueChange]\n\t);\n\n\tconst handleKeyDown = useCallback(\n\t\t(event: React.KeyboardEvent) => {\n\t\t\tconst keyDownCallbacks: Record<number, (multiplier: number) => void> = {\n\t\t\t\t[KEYS.LEFT]: (multiplier) => {\n\t\t\t\t\tonSaturationNavigate(event, { delta: multiplier * -1 });\n\t\t\t\t},\n\t\t\t\t[KEYS.RIGHT]: (multiplier) => {\n\t\t\t\t\tonSaturationNavigate(event, { delta: multiplier });\n\t\t\t\t},\n\t\t\t\t[KEYS.UP]: (multiplier) => {\n\t\t\t\t\tonValueNavigate(event, { delta: multiplier });\n\t\t\t\t},\n\t\t\t\t[KEYS.DOWN]: (multiplier) => {\n\t\t\t\t\tonValueNavigate(event, { delta: multiplier * -1 });\n\t\t\t\t},\n\t\t\t};\n\n\t\t\tif (keyDownCallbacks[event.keyCode]) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tkeyDownCallbacks[event.keyCode](event.shiftKey ? 10 : 1);\n\t\t\t}\n\t\t},\n\t\t[onSaturationNavigate, onValueNavigate]\n\t);\n\n\tconst handleSwatchChange = useCallback(\n\t\t(event: React.ChangeEvent<HTMLInputElement>) => {\n\t\t\tonSwatchChange(event);\n\t\t},\n\t\t[onSwatchChange]\n\t);\n\n\t// When working color is transparent: either use the previous color or default to black\n\tconst fallbackWorkingColor = previousColor.hex\n\t\t? previousColor\n\t\t: (ColorUtils.getNewColor({ hex: '#000000' }) as WorkingColor);\n\tconst workingColor = isTransparent() ? fallbackWorkingColor : color;\n\n\tconst style = { border: 'none', borderRadius: 'unset' };\n\tconst swatchStyle = isTransparent() ? { ...unselectedStyle } : { ...selectedStyle };\n\tconst transparentSwatchStyle = isTransparent()\n\t\t? { ...selectedStyle }\n\t\t: { ...unselectedStyle };\n\n\treturn (\n\t\t<div>\n\t\t\t<p\n\t\t\t\tclassName=\"slds-assistive-text\"\n\t\t\t\tid={`color-picker-instructions-${id}`}\n\t\t\t>\n\t\t\t\t{assistiveText.saturationValueGrid}\n\t\t\t</p>\n\t\t\t<div\n\t\t\t\tclassName=\"slds-color-picker__custom-range\"\n\t\t\t\tstyle={{\n\t\t\t\t\tbackground: `hsl(${workingColor.hsv.hue}, 100%, 50%)`,\n\t\t\t\t}}\n\t\t\t\tonClick={handleClick}\n\t\t\t\trole=\"presentation\"\n\t\t\t>\n\t\t\t\t{/* eslint-disable jsx-a11y/anchor-has-content */}\n\t\t\t\t<a\n\t\t\t\t\taria-atomic=\"true\"\n\t\t\t\t\taria-describedby={`color-picker-instructions-${id}`}\n\t\t\t\t\taria-live=\"assertive\"\n\t\t\t\t\tclassName=\"slds-color-picker__range-indicator\"\n\t\t\t\t\tonKeyDown={handleKeyDown}\n\t\t\t\t\tref={rangeIndicatorRef}\n\t\t\t\t\trole=\"button\"\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\tbottom: `${workingColor.hsv.value}%`,\n\t\t\t\t\t\tleft: `${workingColor.hsv.saturation}%`,\n\t\t\t\t\t}}\n\t\t\t\t\ttabIndex={0}\n\t\t\t\t>\n\t\t\t\t\t<span className=\"slds-assistive-text\">\n\t\t\t\t\t\t{`Saturation ${workingColor.hsv.saturation}% Brightness: ${workingColor.hsv.value}%`}\n\t\t\t\t\t</span>\n\t\t\t\t</a>\n\t\t\t</div>\n\t\t\t<div className=\"slds-color-picker__hue-and-preview\">\n\t\t\t\t<label\n\t\t\t\t\tclassName=\"slds-assistive-text\"\n\t\t\t\t\thtmlFor={`color-picker-input-range-${id}`}\n\t\t\t\t>\n\t\t\t\t\t{assistiveText.hueSlider}\n\t\t\t\t</label>\n\t\t\t\t<input\n\t\t\t\t\ttype=\"range\"\n\t\t\t\t\tmin=\"0\"\n\t\t\t\t\tmax=\"360\"\n\t\t\t\t\tclassName=\"slds-color-picker__hue-slider\"\n\t\t\t\t\tid={`color-picker-input-range-${id}`}\n\t\t\t\t\tvalue={workingColor.hsv.hue}\n\t\t\t\t\tonChange={onHueChange}\n\t\t\t\t/>\n\t\t\t\t<RadioButtonGroup\n\t\t\t\t\tname={`${id}-color-picker-swatch-toggle-button-group`}\n\t\t\t\t\tassistiveText={{ label: 'Toggle Transparency' }}\n\t\t\t\t\tstyle={style}\n\t\t\t\t\tonChange={handleSwatchChange}\n\t\t\t\t\tvalue={isTransparent() ? '' : workingColor.hex}\n\t\t\t\t>\n\t\t\t\t\t<Radio\n\t\t\t\t\t\tchecked={!isTransparent()}\n\t\t\t\t\t\tid={`color-picker-active-working-color-swatch-${id}`}\n\t\t\t\t\t\tkey=\"working-color\"\n\t\t\t\t\t\tlabels={{\n\t\t\t\t\t\t\tlabel: labels.customTabActiveWorkingColorSwatch,\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tstyle={swatchStyle}\n\t\t\t\t\t\tvalue={workingColor.hex}\n\t\t\t\t\t\tvariant=\"swatch\"\n\t\t\t\t\t/>\n\t\t\t\t\t<Radio\n\t\t\t\t\t\tchecked={isTransparent()}\n\t\t\t\t\t\tid={`color-picker-transparent-swatch-${id}`}\n\t\t\t\t\t\tkey=\"transparent\"\n\t\t\t\t\t\tlabels={{ label: labels.customTabTransparentSwatch }}\n\t\t\t\t\t\tstyle={transparentSwatchStyle}\n\t\t\t\t\t\tvalue=\"\" // transparent\n\t\t\t\t\t\tvariant=\"swatch\"\n\t\t\t\t\t/>\n\t\t\t\t</RadioButtonGroup>\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nHsvColor.displayName = 'SLDSHsvColor';\n\nexport default HsvColor;\n\n"],"mappings":"6TAwCA,IAAM,EAAgB,CACrB,OAAQ,oBACR,UAAW,iCACX,YAAa,KACd,EAEM,EAAkB,CACvB,OAAQ,oBACR,YAAa,KACd,EAKM,GAAqC,CAC1C,gBACA,QACA,KACA,SACA,cACA,0BACA,uBACA,kBACA,iBACA,mBACK,CACL,IAAM,GAAA,EAAoB,EAAA,OAAA,CAA0B,IAAI,EAElD,GAAA,EAAgB,EAAA,YAAA,KAAkB,EAAM,MAAQ,GAAI,CAAC,EAAM,GAAG,CAAC,EAE/D,GAAA,EAAc,EAAA,YAAA,CAClB,GAA4C,CAC5C,IAAM,EAAO,EAAM,cAAc,sBAAsB,EACvD,EAAkB,SAAS,MAAM,EACjC,EAAwB,EAAO,CAC9B,WAAY,KAAK,OAAQ,EAAM,QAAU,EAAK,MAAQ,EAAK,MAAS,GAAG,EACvE,MAAO,KAAK,OAAQ,EAAK,OAAS,EAAM,SAAW,EAAK,OAAU,GAAG,CACtE,CAAC,CACF,EACA,CAAC,CAAuB,CACzB,EAEM,GAAA,EAAgB,EAAA,YAAA,CACpB,GAA+B,CAC/B,IAAM,EAAiE,EACrE,EAAA,QAAK,MAAQ,GAAe,CAC5B,EAAqB,EAAO,CAAE,MAAO,EAAa,EAAG,CAAC,CACvD,GACC,EAAA,QAAK,OAAS,GAAe,CAC7B,EAAqB,EAAO,CAAE,MAAO,CAAW,CAAC,CAClD,GACC,EAAA,QAAK,IAAM,GAAe,CAC1B,EAAgB,EAAO,CAAE,MAAO,CAAW,CAAC,CAC7C,GACC,EAAA,QAAK,MAAQ,GAAe,CAC5B,EAAgB,EAAO,CAAE,MAAO,EAAa,E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,UAAU,qCAAf,SAAA,EACC,EAAA,EAAA,IAAA,CAAC,QAAD,CACC,UAAU,sBACV,QAAS,4BAA4B,IAEpC,SAAA,EAAc,SACT,CAAA,GACP,EAAA,EAAA,IAAA,CAAC,QAAD,CACC,KAAK,QACL,IAAI,IACJ,IAAI,MACJ,UAAU,gCACV,GAAI,4BAA4B,IAChC,MAAO,EAAa,IAAI,IACxB,SAAU,CACV,CAAA,GACD,EAAA,EAAA,KAAA,CAAC,EAAA,QAAD,CACC,KAAM,GAAG,EAAG,0CACZ,cAAe,CAAE,MAAO,qBAAsB,EACvC,QACP,SAAU,EACV,MAAO,EAAc,EAAI,GAAK,EAAa,IAL5C,SAAA,EAOC,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CACC,QAAS,CAAC,EAAc,EACxB,GAAI,4CAA4C,IAEhD,OAAQ,CACP,MAAO,EAAO,iCACf,EACA,MAAO,EACP,MAAO,EAAa,IACpB,QAAQ,QACR,EAPI,eAOJ,GACD,EAAA,EAAA,IAAA,CAAC,EAAA,QAAD,CACC,QAAS,EAAc,EACvB,GAAI,mCAAmC,IAEvC,OAAQ,CAAE,MAAO,EAAO,0BAA2B,EACnD,MAAO,EACP,MAAM,GACN,QAAQ,QACR,EALI,aAKJ,CACgB,GACd,GACD,CAAA,CAAA,CAEP,EAEA,EAAS,YAAc"}
@@ -1,2 +1,2 @@
1
- const e=require("../../utilities/get-component-doc.cjs"),t=require("../../utilities/warning/one-of-required-property.cjs"),n=require("../../utilities/warning/deprecated-property.cjs");var r=function(){};process.env.NODE_ENV!==`production`&&(r=function(r,i,a){let o=e.default(a);n.default(r,i.isInline,`isInline`,`menuPosition="relative"`,o(`menuPosition`)),n.default(r,i.menuItem,`menuItem`,`renderMenuItem`,o(`renderMenuItem`)),n.default(r,i.onRenderMenuItem,`onRenderMenuItem`,`renderMenuItem`,`\`renderMenuItem\` is a function called with \`{ assistiveText, isSelected, option }\`, not a component. ${o(`renderMenuItem`)}`),n.default(r,i.readOnlyMenuItemVisibleLength,`readOnlyMenuItemVisibleLength`,`menuItemVisibleLength`,o(`menuItemVisibleLength`)),[`optionsSearchEntity`,`optionsAddItem`].forEach(e=>{let t=(i[e]||[]).find(e=>e&&e.onClick);n.default(r,t&&t.onClick,`${e}[].onClick`,`events.onSelectActionItem`,`Until then, if both are set, both are called. ${o(`events`)}`)});let s=[`separator`,`header`,`footer`,`deselect`],c=(i.options||[]).find(e=>e?.type&&!s.includes(e.type));n.default(r,c?.type,`options[].type`,`options[].category`,`\`type\` only accepts ${s.map(e=>`'${e}'`).join(`, `)}. ${o(`options`)}`),i.variant===`popover`?t.default(r,{"assistiveText['popoverLabel']":i.assistiveText.popoverLabel},o(`assistiveText`)):t.default(r,{options:i.options},o(`options`))});var i=r;exports.default=i;
1
+ const e=require("../../utilities/warning/sunset-property.cjs"),t=require("../../utilities/get-component-doc.cjs"),n=require("../../utilities/warning/one-of-required-property.cjs"),r=require("../../utilities/warning/deprecated-property.cjs");var i=function(){};process.env.NODE_ENV!==`production`&&(i=function(i,a,o){let s=t.default(o);e.default(i,a.defaultValue!==void 0,`defaultValue`,"Combobox is controlled: pass `value` and update it in `events.onChange`."),r.default(i,a.isInline,`isInline`,`menuPosition="relative"`,s(`menuPosition`)),r.default(i,a.menuItem,`menuItem`,`renderMenuItem`,s(`renderMenuItem`)),r.default(i,a.onRenderMenuItem,`onRenderMenuItem`,`renderMenuItem`,`\`renderMenuItem\` is a function called with \`{ assistiveText, isSelected, option }\`, not a component. ${s(`renderMenuItem`)}`),r.default(i,a.readOnlyMenuItemVisibleLength,`readOnlyMenuItemVisibleLength`,`menuItemVisibleLength`,s(`menuItemVisibleLength`)),[`optionsSearchEntity`,`optionsAddItem`].forEach(e=>{let t=(a[e]||[]).find(e=>e&&e.onClick);r.default(i,t&&t.onClick,`${e}[].onClick`,`events.onSelectActionItem`,`Until then, if both are set, both are called. ${s(`events`)}`)});let c=[`separator`,`header`,`footer`,`deselect`],l=(a.options||[]).find(e=>e?.type&&!c.includes(e.type));r.default(i,l?.type,`options[].type`,`options[].category`,`\`type\` only accepts ${c.map(e=>`'${e}'`).join(`, `)}. ${s(`options`)}`),a.variant===`popover`?n.default(i,{"assistiveText['popoverLabel']":a.assistiveText.popoverLabel},s(`assistiveText`)):n.default(i,{options:a.options},s(`options`))});var a=i;exports.default=a;
2
2
  //# sourceMappingURL=check-props.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"check-props.cjs","names":[],"sources":["../../../../components/combobox/check-props.js"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n/* eslint-disable import/no-mutable-exports */\n\nimport deprecatedProperty from '../../utilities/warning/deprecated-property';\nimport oneOfRequiredProperty from '../../utilities/warning/one-of-required-property';\nimport getComponentDocFn from '../../utilities/get-component-doc';\n\nlet checkProps = function checkPropsFunction() {};\n\nif (process.env.NODE_ENV !== 'production') {\n\tcheckProps = function checkPropsFunction(COMPONENT, props, jsonDoc) {\n\t\tconst createDocUrl = getComponentDocFn(jsonDoc);\n\t\t/* eslint-disable max-len */\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.isInline,\n\t\t\t'isInline',\n\t\t\t'menuPosition=\"relative\"',\n\t\t\tcreateDocUrl('menuPosition')\n\t\t);\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.menuItem,\n\t\t\t'menuItem',\n\t\t\t'renderMenuItem',\n\t\t\tcreateDocUrl('renderMenuItem')\n\t\t);\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.onRenderMenuItem,\n\t\t\t'onRenderMenuItem',\n\t\t\t'renderMenuItem',\n\t\t\t`\\`renderMenuItem\\` is a function called with \\`{ assistiveText, isSelected, option }\\`, not a component. ${createDocUrl('renderMenuItem')}`\n\t\t);\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.readOnlyMenuItemVisibleLength,\n\t\t\t'readOnlyMenuItemVisibleLength',\n\t\t\t'menuItemVisibleLength',\n\t\t\tcreateDocUrl('menuItemVisibleLength')\n\t\t);\n\t\t['optionsSearchEntity', 'optionsAddItem'].forEach((propName) => {\n\t\t\tconst itemWithOnClick = (props[propName] || []).find(\n\t\t\t\t(item) => item && item.onClick\n\t\t\t);\n\t\t\tdeprecatedProperty(\n\t\t\t\tCOMPONENT,\n\t\t\t\titemWithOnClick && itemWithOnClick.onClick,\n\t\t\t\t`${propName}[].onClick`,\n\t\t\t\t'events.onSelectActionItem',\n\t\t\t\t`Until then, if both are set, both are called. ${createDocUrl('events')}`\n\t\t\t);\n\t\t});\n\t\t/* eslint-enable max-len */\n\n\t\t// `type` is reserved for structural rows. Item options used it to\n\t\t// group under `comboboxAddSubheadings`, which now reads `category`.\n\t\tconst structuralTypes = ['separator', 'header', 'footer', 'deselect'];\n\t\tconst itemWithType = (props.options || []).find(\n\t\t\t(option) => option?.type && !structuralTypes.includes(option.type)\n\t\t);\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\titemWithType?.type,\n\t\t\t'options[].type',\n\t\t\t'options[].category',\n\t\t\t`\\`type\\` only accepts ${structuralTypes.map((type) => `'${type}'`).join(', ')}. ${createDocUrl('options')}`\n\t\t);\n\n\t\tif (props.variant !== 'popover') {\n\t\t\toneOfRequiredProperty(\n\t\t\t\tCOMPONENT,\n\t\t\t\t{\n\t\t\t\t\toptions: props.options,\n\t\t\t\t},\n\t\t\t\tcreateDocUrl('options')\n\t\t\t);\n\t\t} else {\n\t\t\toneOfRequiredProperty(\n\t\t\t\tCOMPONENT,\n\t\t\t\t{\n\t\t\t\t\t\"assistiveText['popoverLabel']\": props.assistiveText.popoverLabel,\n\t\t\t\t},\n\t\t\t\tcreateDocUrl('assistiveText')\n\t\t\t);\n\t\t}\n\t};\n}\n\nexport default checkProps;\n"],"mappings":"wLAQA,IAAI,EAAa,UAA8B,CAAC,EAEhD,QAAA,IAAA,WAA6B,eAC5B,EAAa,SAA4B,EAAW,EAAO,EAAS,CACnE,IAAM,EAAe,EAAA,QAAkB,CAAO,EAE9C,EAAA,QACC,EACA,EAAM,SACN,WACA,0BACA,EAAa,cAAc,CAC5B,EACA,EAAA,QACC,EACA,EAAM,SACN,WACA,iBACA,EAAa,gBAAgB,CAC9B,EACA,EAAA,QACC,EACA,EAAM,iBACN,mBACA,iBACA,4GAA4G,EAAa,gBAAgB,GAC1I,EACA,EAAA,QACC,EACA,EAAM,8BACN,gCACA,wBACA,EAAa,uBAAuB,CACrC,EACA,CAAC,sBAAuB,gBAAgB,CAAC,CAAC,QAAS,GAAa,CAC/D,IAAM,GAAmB,EAAM,IAAa,CAAC,EAAA,CAAG,KAC9C,GAAS,GAAQ,EAAK,OACxB,EACA,EAAA,QACC,EACA,GAAmB,EAAgB,QACnC,GAAG,EAAS,YACZ,4BACA,iDAAiD,EAAa,QAAQ,GACvE,CACD,CAAC,EAKD,IAAM,EAAkB,CAAC,YAAa,SAAU,SAAU,UAAU,EAC9D,GAAgB,EAAM,SAAW,CAAC,EAAA,CAAG,KACzC,GAAW,GAAQ,MAAQ,CAAC,EAAgB,SAAS,EAAO,IAAI,CAClE,EACA,EAAA,QACC,EACA,GAAc,KACd,iBACA,qBACA,yBAAyB,EAAgB,IAAK,GAAS,IAAI,EAAK,EAAE,CAAC,CAAC,KAAK,IAAI,EAAE,IAAI,EAAa,SAAS,GAC1G,EAEI,EAAM,UAAY,UASrB,EAAA,QACC,EACA,CACC,gCAAiC,EAAM,cAAc,YACtD,EACA,EAAa,eAAe,CAC7B,EAdA,EAAA,QACC,EACA,CACC,QAAS,EAAM,OAChB,EACA,EAAa,SAAS,CACvB,CAUF,GAGD,IAAA,EAAe"}
1
+ {"version":3,"file":"check-props.cjs","names":[],"sources":["../../../../components/combobox/check-props.js"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n/* eslint-disable import/no-mutable-exports */\n\nimport deprecatedProperty from '../../utilities/warning/deprecated-property';\nimport oneOfRequiredProperty from '../../utilities/warning/one-of-required-property';\nimport getComponentDocFn from '../../utilities/get-component-doc';\nimport sunsetProperty from '../../utilities/warning/sunset-property';\n\nlet checkProps = function checkPropsFunction() {};\n\nif (process.env.NODE_ENV !== 'production') {\n\tcheckProps = function checkPropsFunction(COMPONENT, props, jsonDoc) {\n\t\tconst createDocUrl = getComponentDocFn(jsonDoc);\n\t\t/* eslint-disable max-len */\n\t\tsunsetProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.defaultValue !== undefined,\n\t\t\t'defaultValue',\n\t\t\t'Combobox is controlled: pass `value` and update it in `events.onChange`.'\n\t\t);\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.isInline,\n\t\t\t'isInline',\n\t\t\t'menuPosition=\"relative\"',\n\t\t\tcreateDocUrl('menuPosition')\n\t\t);\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.menuItem,\n\t\t\t'menuItem',\n\t\t\t'renderMenuItem',\n\t\t\tcreateDocUrl('renderMenuItem')\n\t\t);\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.onRenderMenuItem,\n\t\t\t'onRenderMenuItem',\n\t\t\t'renderMenuItem',\n\t\t\t`\\`renderMenuItem\\` is a function called with \\`{ assistiveText, isSelected, option }\\`, not a component. ${createDocUrl('renderMenuItem')}`\n\t\t);\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.readOnlyMenuItemVisibleLength,\n\t\t\t'readOnlyMenuItemVisibleLength',\n\t\t\t'menuItemVisibleLength',\n\t\t\tcreateDocUrl('menuItemVisibleLength')\n\t\t);\n\t\t['optionsSearchEntity', 'optionsAddItem'].forEach((propName) => {\n\t\t\tconst itemWithOnClick = (props[propName] || []).find(\n\t\t\t\t(item) => item && item.onClick\n\t\t\t);\n\t\t\tdeprecatedProperty(\n\t\t\t\tCOMPONENT,\n\t\t\t\titemWithOnClick && itemWithOnClick.onClick,\n\t\t\t\t`${propName}[].onClick`,\n\t\t\t\t'events.onSelectActionItem',\n\t\t\t\t`Until then, if both are set, both are called. ${createDocUrl('events')}`\n\t\t\t);\n\t\t});\n\t\t/* eslint-enable max-len */\n\n\t\t// `type` is reserved for structural rows. Item options used it to\n\t\t// group under `comboboxAddSubheadings`, which now reads `category`.\n\t\tconst structuralTypes = ['separator', 'header', 'footer', 'deselect'];\n\t\tconst itemWithType = (props.options || []).find(\n\t\t\t(option) => option?.type && !structuralTypes.includes(option.type)\n\t\t);\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\titemWithType?.type,\n\t\t\t'options[].type',\n\t\t\t'options[].category',\n\t\t\t`\\`type\\` only accepts ${structuralTypes.map((type) => `'${type}'`).join(', ')}. ${createDocUrl('options')}`\n\t\t);\n\n\t\tif (props.variant !== 'popover') {\n\t\t\toneOfRequiredProperty(\n\t\t\t\tCOMPONENT,\n\t\t\t\t{\n\t\t\t\t\toptions: props.options,\n\t\t\t\t},\n\t\t\t\tcreateDocUrl('options')\n\t\t\t);\n\t\t} else {\n\t\t\toneOfRequiredProperty(\n\t\t\t\tCOMPONENT,\n\t\t\t\t{\n\t\t\t\t\t\"assistiveText['popoverLabel']\": props.assistiveText.popoverLabel,\n\t\t\t\t},\n\t\t\t\tcreateDocUrl('assistiveText')\n\t\t\t);\n\t\t}\n\t};\n}\n\nexport default checkProps;\n"],"mappings":"iPASA,IAAI,EAAa,UAA8B,CAAC,EAEhD,QAAA,IAAA,WAA6B,eAC5B,EAAa,SAA4B,EAAW,EAAO,EAAS,CACnE,IAAM,EAAe,EAAA,QAAkB,CAAO,EAE9C,EAAA,QACC,EACA,EAAM,eAAiB,IAAA,GACvB,eACA,0EACD,EACA,EAAA,QACC,EACA,EAAM,SACN,WACA,0BACA,EAAa,cAAc,CAC5B,EACA,EAAA,QACC,EACA,EAAM,SACN,WACA,iBACA,EAAa,gBAAgB,CAC9B,EACA,EAAA,QACC,EACA,EAAM,iBACN,mBACA,iBACA,4GAA4G,EAAa,gBAAgB,GAC1I,EACA,EAAA,QACC,EACA,EAAM,8BACN,gCACA,wBACA,EAAa,uBAAuB,CACrC,EACA,CAAC,sBAAuB,gBAAgB,CAAC,CAAC,QAAS,GAAa,CAC/D,IAAM,GAAmB,EAAM,IAAa,CAAC,EAAA,CAAG,KAC9C,GAAS,GAAQ,EAAK,OACxB,EACA,EAAA,QACC,EACA,GAAmB,EAAgB,QACnC,GAAG,EAAS,YACZ,4BACA,iDAAiD,EAAa,QAAQ,GACvE,CACD,CAAC,EAKD,IAAM,EAAkB,CAAC,YAAa,SAAU,SAAU,UAAU,EAC9D,GAAgB,EAAM,SAAW,CAAC,EAAA,CAAG,KACzC,GAAW,GAAQ,MAAQ,CAAC,EAAgB,SAAS,EAAO,IAAI,CAClE,EACA,EAAA,QACC,EACA,GAAc,KACd,iBACA,qBACA,yBAAyB,EAAgB,IAAK,GAAS,IAAI,EAAK,EAAE,CAAC,CAAC,KAAK,IAAI,EAAE,IAAI,EAAa,SAAS,GAC1G,EAEI,EAAM,UAAY,UASrB,EAAA,QACC,EACA,CACC,gCAAiC,EAAM,cAAc,YACtD,EACA,EAAa,eAAe,CAC7B,EAdA,EAAA,QACC,EACA,CACC,QAAS,EAAM,OAChB,EACA,EAAa,SAAS,CACvB,CAUF,GAGD,IAAA,EAAe"}
@@ -1,2 +1,2 @@
1
- const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../utilities/constants.cjs"),n=require("../icon-settings/index.cjs"),r=require("../../utilities/generate-id.cjs"),i=require("../../utilities/key-code.cjs"),a=require("../utilities/dialog/index.cjs"),ee=require("../button/index.cjs"),te=require("../../utilities/key-buffer.cjs"),o=require("../input/private/inner-input.cjs"),ne=require("../tooltip/private/field-level-help-tooltip.cjs"),s=require("../icon/input-icon/index.cjs"),re=require("../popover/index.cjs"),ie=require("./private/menu.cjs"),ae=require("../forms/private/label.cjs"),oe=require("../../utilities/key-callbacks.cjs"),se=require("../pill-container/private/selected-listbox.cjs"),ce=require("../../utilities/key-letter-menu-item-select.cjs"),le=require("../../utilities/menu-item-select-scroll.cjs"),ue=require("./check-props.cjs"),de=require("./component.cjs");let c=require("react");c=e.__toESM(c,1);let l=require("classnames");l=e.__toESM(l,1);let u=require("react/jsx-runtime"),fe=require("dequal"),pe=require("lodash.isfunction");pe=e.__toESM(pe,1);let d=require("lodash.assign");d=e.__toESM(d,1);let me=require("lodash.findindex");me=e.__toESM(me,1);let he=require("lodash.find");he=e.__toESM(he,1);let ge=require("lodash.reject");ge=e.__toESM(ge,1);var f,_e=typeof document<`u`,ve=Symbol(`actionItem`),ye=e=>ve in e,be=(e,t)=>({id:e.id||``,icon:e.icon,label:e.label,disabled:e.disabled,type:t,[ve]:e}),xe={label:``,loadingMenuItems:`Loading`,optionSelectedInMenu:`Current Selection:`,popoverLabel:``,removeSingleSelectedOption:`Remove selected option`,removePill:`, Press delete or backspace to remove`,selectedListboxLabel:`Selected Options:`},Se={deselectOption:`None`,label:``,cancelButton:`Cancel`,doneButton:`Done`,multipleOptionsSelected:``,noOptionsFound:`No matches found.`,placeholder:``,placeholderReadOnly:`Select an Option`,removePillTitle:`Remove`,optionDisabledTooltipLabel:`This option is disabled.`,inputIconTitle:``},Ce={},we=e=>{let{assistiveText:we={},"aria-describedby":Te,className:p,classNameContainer:Ee,classNameMenu:De,classNameMenuSubHeader:Oe,defaultValue:m,disabled:ke,entityCombobox:Ae,errorText:h,events:je={},fieldLevelHelpTooltip:Me,hasDeselect:Ne,hasInputSpinner:Pe,hasMenuSpinner:Fe,hasStaticAlignment:Ie,id:Le,inheritWidthOf:Re=`target`,input:ze,inputRef:Be,isOpen:g,labels:Ve={},menuItemVisibleLength:He,menuMaxWidth:Ue,menuPosition:We=`absolute`,multiple:_,onRenderMenuItem:Ge,options:v=[],optionsAddItem:Ke=[],optionsSearchEntity:qe=[],popover:y,predefinedOptionsOnly:b,required:x=!1,selection:S=[],selectedListboxRef:Je,singleInputDisabled:Ye=!1,tooltipMenuItemDisabled:Xe,value:C,variant:w=`base`,renderMenuItem:Ze,menuItem:Qe}=e,T=(0,d.default)({},xe,we),E=(0,d.default)({},Se,Ve),D=(0,d.default)({},Ce,je),$e=(0,c.useContext)(n.IconSettingsContext),O=(0,c.useRef)(null),k=(0,c.useRef)(null),et=(0,c.useRef)(null),tt=(0,c.useRef)(null),nt=(0,c.useRef)(null),rt=(0,c.useRef)(new te.default),it=(0,c.useRef)(r.default()),at=(0,c.useRef)(r.default()),A=(0,c.useCallback)(()=>Le||it.current,[Le]),ot=`${A()}-deselect`,[j,M]=(0,c.useState)(void 0),[N,P]=(0,c.useState)(-1),[F,I]=(0,c.useState)(S?.[0]),[L,R]=(0,c.useState)(0),[z,B]=(0,c.useState)(!1),[V,st]=(0,c.useState)(typeof g==`boolean`&&g),[ct,lt]=(0,c.useState)(!1);(0,c.useEffect)(()=>{ue.default(t.COMBOBOX,e,de.default)},[]);let H=(0,c.useCallback)(()=>!!(typeof g==`boolean`?g:V),[g,V]),ut=(0,c.useCallback)(()=>j&&N!==-1,[j,N]),U=(0,c.useCallback)(()=>Te||h&&at.current,[Te,h]),W=(0,c.useCallback)(()=>{let e={id:ot,label:E.deselectOption,value:``,type:`deselect`},t=qe.map(e=>be(e,`header`)),n=Ke.map(e=>be(e,`footer`));return[...t.length>0?t:[],...Ne?[e]:[],...v&&v.length>0?v:[],...n.length>0?n:[]]},[ot,E.deselectOption,qe,Ke,Ne,v]),dt=(0,c.useCallback)(({selection:e,option:t})=>!!(0,he.default)(e,t),[]),ft=(0,c.useCallback)(({activeOptionIndex:e,offset:t,options:n})=>{let r=e+t,i=n.length>r&&r>=0&&n[r].type===`separator`?r+t:r;return n.length>r&&r>=0?i:e},[]),G=(0,c.useCallback)((e,{trigger:t}={})=>{if(H()){if(f&&f.handleClose===G&&(f=void 0),M(void 0),P(-1),st(!1),w===`popover`&&t===`cancel`){let n=y?.props;n?.onClose&&n.onClose(e,{trigger:t})}D.onClose&&D.onClose(e,{})}},[H,w,y,D]),pt=(0,c.useCallback)((e,t)=>{if(!H())f&&(0,pe.default)(f.handleClose)&&f.handleClose();else if(f={handleClose:G},st(!0),D.onOpen&&D.onOpen(e,t||{}),w===`readonly`){let e=W(),t=(0,me.default)(e,e=>(0,fe.dequal)(e,S[0]));P(t),M(S[0]),k.current!==null&&le.default({container:k.current,focusedIndex:t})}},[H,G,D,w,W,S]),mt=(0,c.useCallback)((e,t)=>{D.onRequestClose&&D.onRequestClose(e,t),H()&&G(e,{trigger:`cancel`})},[D,H,G]),K=(0,c.useCallback)(()=>{D.onRequestOpen?D.onRequestOpen():st(!0)},[D]),ht=(0,c.useCallback)(()=>{(!_&&S.length===0&&w===`inline-listbox`||_||w===`readonly`)&&K()},[_,S.length,w,K]);(0,c.useCallback)(e=>{mt(e,{})},[mt]);let gt=(0,c.useCallback)((e,{selection:t,option:n})=>{if(ye(n)){let t=n[ve],r=e;t.onClick?.(r,{option:t}),D.onSelectActionItem?.(r,{option:t,value:O.current?.value??``}),G();return}let r,i=dt({selection:t,option:n}),a=!_&&!i,ee=_&&!i;r=n.id===ot?[]:a?[n]:ee?[...S,n]:(0,ge.default)(S,n),D.onSelect&&D.onSelect(e,{selection:r}),G()},[dt,_,ot,S,D,G]),q=(0,c.useCallback)(e=>{setTimeout(()=>{let t=_e?document.activeElement:null;t&&t.tagName===`DIV`&&t.id===`${A()}-listbox`?O.current&&O.current.focus():y||G(e)},200),D.onBlur&&D.onBlur(e)},[A,y,G,D]),J=(0,c.useCallback)(e=>{ht(),D.onChange&&D.onChange(e,{value:e.target.value})},[ht,D]),Y=(0,c.useCallback)(e=>{D.onFocus&&D.onFocus(e,{})},[D]),_t=(0,c.useCallback)(e=>{if(j===void 0&&N===-1&&(V?mt(e,{}):e.shiftKey||K()),!j?.disabled){if(j&&!ye(j)&&(j.type===`header`||j.type===`footer`)){j.onClick?.(e);return}ut()?gt(e,{option:j,selection:S}):!b&&e.target.value!==``&&D.onSubmit&&D.onSubmit(e,{value:e.target.value})}},[j,N,V,K,mt,ut,gt,S,b,D]),vt=(0,c.useCallback)((e,{direction:t})=>{let n={next:1,previous:-1},r=W(),i=ft({activeOptionIndex:N,offset:n[t],options:r});H()&&k.current&&le.default({container:k.current,focusedIndex:i}),M(r[i]),P(i)},[W,ft,N,H]),X=(0,c.useCallback)((e,{direction:t})=>{let n={next:1,previous:-1},r=L+1===S.length&&t===`next`,i=L===0&&t===`previous`;if(r)I(S[0]),R(0),B(!0);else if(i)I(S[S.length-1]),R(S.length-1),B(!0);else{let e=ft({activeOptionIndex:L,offset:n[t],options:S});I(S[e]),R(e),B(!0)}},[L,S,ft]),yt=(0,c.useCallback)(e=>{e.shiftKey||K(),w!==`popover`&&vt(e,{direction:`next`})},[K,w,vt]),bt=(0,c.useCallback)(e=>{!e.shiftKey&&H()&&vt(e,{direction:`previous`})},[H,vt]),xt=(0,c.useCallback)(()=>{et.current&&B(!0)},[]),St=(0,c.useCallback)(e=>{let t=W(),n=ce.default({key:e.key,keyBuffer:rt.current,keyCode:e.keyCode,options:t});n!==void 0&&(H()&&k.current&&le.default({container:k.current,focusedIndex:n}),M(t[n]),P(n))},[W,H]),Z=(0,c.useCallback)(e=>{let t={[i.default.DOWN]:{callback:yt},[i.default.ENTER]:{callback:_t},[i.default.ESCAPE]:{callback:G},[i.default.UP]:{callback:bt}};w===`readonly`&&(S.length>2?t[i.default.TAB]={callback:xt}:t[i.default.TAB]=void 0,t.other={callback:St,stopPropagation:!1});let n=H();oe.default(e,{callbacks:t,stopPropagation:n})},[yt,_t,G,bt,w,S.length,xt,St,H]),Ct=(0,c.useCallback)(()=>{B(!1)},[]),wt=(0,c.useCallback)((e,{option:t,index:n})=>{z||(I(t),R(n),B(!0))},[z]),Tt=(0,c.useCallback)((e,{option:t,index:n})=>{e.preventDefault();let r=S.length===1,i=S.length===2&&w===`readonly`&&_,a=n!==void 0&&n+1===S.length;(r||i)&&O.current?O.current.focus():a&&n!==void 0?(I(S[n-1]),R(n-1),B(!0)):n!==void 0&&(I(S[n+1]),R(n),B(!0)),D.onRequestRemoveSelectedOption&&D.onRequestRemoveSelectedOption(e,{selection:(0,ge.default)(S,t)})},[S,w,_,D]),Et=(0,c.useCallback)((e,{ref:t})=>{t&&(tt.current=t,tt.current.focus())},[]),Q=(0,c.useCallback)(e=>{O.current=e,ct||lt(!0),Be&&Be(e)},[ct,Be]),Dt=(0,c.useCallback)(e=>{et.current=e,Je&&Je(e)},[Je]),Ot=(0,c.useCallback)(e=>{k.current=e},[]),kt=(0,c.useCallback)(()=>O.current,[]);(0,c.useEffect)(()=>{typeof g==`boolean`&&(st(g),g||(M(void 0),P(-1)))},[g]),(0,c.useEffect)(()=>{let e=W();if(j){let t=(0,me.default)(e,e=>(0,fe.dequal)(e,j));t===-1?(M(void 0),P(-1)):P(t)}},[v,W,j]),(0,c.useEffect)(()=>{if(S.length===0){F!==void 0&&(I(void 0),R(0));return}if(!F||!S[L]){let e=L>=S.length?S.length-1:L;I(S[e]),R(e)}},[S,F,L]),(0,c.useEffect)(()=>()=>{f&&f.handleClose===G&&(f=void 0)},[G]);let At=(0,c.useCallback)(e=>{let t=(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`div`,{className:`slds-assistive-text`,id:`${A()}-label`,children:T.popoverLabel}),e]}),n=(0,u.jsxs)(`div`,{children:[(0,u.jsx)(ee.default,{label:E.cancelButton,onClick:e=>{G(e,{trigger:`cancel`})}}),(0,u.jsx)(ee.default,{label:E.doneButton,variant:`brand`,onClick:G})]}),r={ariaLabelledby:`${A()}-label`,align:`bottom`,body:t,classNameDialog:`slds-popover_full-width`,footer:n,classNameFooter:`slds-popover__footer_form`,hasNoNubbin:!0,id:A(),isOpen:V,hasNoTriggerStyles:!0,onOpen:pt,onClose:G,onRequestClose:G},i=y?.props,a=(0,d.default)(r,i||{});return a.body=t,delete a.children,a},[A,T.popoverLabel,E.cancelButton,E.doneButton,G,V,pt,y]),jt=(0,c.useCallback)(({menuRenderer:e})=>{let t=We;if(!ke&&H()){let n={align:`bottom left`,context:$e,hasStaticAlignment:Ie,inheritWidthOf:Re,onClose:G,onMouseDown:e=>{e.preventDefault()},onOpen:pt,onRequestTargetElement:kt,position:t,containerProps:{id:`${A()}-listbox`,role:`listbox`}};return(0,u.jsx)(a.default,{...n,children:e})}return null},[We,ke,H,$e,Ie,Re,G,pt,kt,A]),Mt=Ge||Qe,Nt;Ze?Nt=e=>Ze({...e,assistiveText:T}):Mt&&(Nt=({isSelected:e,option:t})=>(0,u.jsx)(Mt,{assistiveText:T,selected:e,option:t}));let $=(0,c.useCallback)(()=>{let e={base:`icon-title-subtitle`,"inline-listbox":`icon-title-subtitle`,readonly:`checkbox`},t=w===`readonly`?5:null;return(0,u.jsx)(ie.default,{assistiveText:T,activeOption:j,activeOptionIndex:N,classNameMenu:De,classNameMenuSubHeader:Oe,inheritWidthOf:Re,inputId:A(),inputValue:C,isSelected:dt,itemVisibleLength:He||t,labels:{noOptionsFound:E.noOptionsFound||``},hasMenuSpinner:Fe,menuPosition:We,menuRef:Ot,maxWidth:Ue,options:W(),onSelect:gt,renderMenuItem:Nt,selection:S,tooltipMenuItemDisabled:Xe,variant:e[w]})},[w,T,j,N,De,Oe,Re,A,C,dt,He,E.noOptionsFound,Fe,We,Ot,Ue,W,gt,Nt,S,Xe]),Pt=ze?.props||{},Ft=()=>(0,u.jsxs)(`div`,{className:`slds-form-element__control`,children:[(0,u.jsx)(`div`,{className:`slds-combobox_container`,children:(0,u.jsxs)(`div`,{className:(0,l.default)(`slds-combobox`,`slds-dropdown-trigger`,`slds-dropdown-trigger_click`,`ignore-react-onclickoutside`,{"slds-is-open":H(),"slds-has-error":h},p),role:`combobox`,"aria-expanded":H(),"aria-haspopup":`listbox`,"aria-owns":H()?`${A()}-listbox`:void 0,children:[(0,u.jsx)(o.default,{"aria-autocomplete":`list`,"aria-controls":H()?`${A()}-listbox`:void 0,"aria-activedescendant":j?`${A()}-listbox-option-${j.id}`:void 0,"aria-describedby":U(),autoComplete:`off`,className:`slds-combobox__input`,containerProps:{className:`slds-combobox__form-element`,role:`none`},hasSpinner:Pe,iconRight:(0,u.jsx)(s.default,{category:`utility`,name:`search`,title:E.inputIconTitle}),id:A(),onFocus:Y,onBlur:q,onKeyDown:Z,inputRef:Q,onClick:()=>K(),onChange:J,placeholder:E.placeholder,defaultValue:m,readOnly:!!(b&&j),required:x,role:`textbox`,value:b&&j?.label||C,...Pt}),jt({menuRenderer:$()})]})}),(0,u.jsx)(se.default,{activeOption:F,activeOptionIndex:L,assistiveText:T,events:{onBlurPill:Ct,onPillFocus:wt,onRequestFocus:Et,onRequestFocusOnNextPill:X,onRequestFocusOnPreviousPill:X,onRequestRemove:Tt},id:`${A()}-selected-listbox`,labels:E,selectedListboxRef:Dt,selection:S,listboxHasFocus:z,multiselectable:_}),h&&(0,u.jsx)(`div`,{className:`slds-has-error`,children:(0,u.jsx)(`div`,{id:U(),className:`slds-form-element__help slds-has-error`,children:h})})]}),It=()=>(0,u.jsx)(`div`,{className:`slds-form-element__control`,children:(0,u.jsxs)(`div`,{className:(0,l.default)(`slds-combobox_container`,{"slds-has-inline-listbox":S.length}),children:[S.length?(0,u.jsx)(se.default,{activeOption:F,activeOptionIndex:L,assistiveText:T,containerRole:`listbox`,containerAriaOrientation:`horizontal`,listboxRole:`group`,listboxAriaOrientation:null,events:{onBlurPill:Ct,onPillFocus:wt,onRequestFocus:Et,onRequestFocusOnNextPill:X,onRequestFocusOnPreviousPill:X,onRequestRemove:Tt},id:`${A()}-selected-listbox`,labels:E,selectedListboxRef:Dt,selection:S,listboxHasFocus:z,multiselectable:_}):null,(0,u.jsxs)(`div`,{className:(0,l.default)(`slds-combobox`,`slds-dropdown-trigger`,`slds-dropdown-trigger_click`,`ignore-react-onclickoutside`,{"slds-is-open":H(),"slds-has-error":h},p),role:`combobox`,"aria-expanded":H(),"aria-haspopup":`listbox`,children:[(0,u.jsx)(o.default,{"aria-autocomplete":`list`,"aria-controls":H()?`${A()}-listbox`:void 0,"aria-activedescendant":j?`${A()}-listbox-option-${j.id}`:void 0,"aria-describedby":U(),defaultValue:m,autoComplete:`off`,className:`slds-combobox__input`,containerProps:{className:`slds-combobox__form-element`,role:`none`},hasSpinner:Pe,iconRight:(0,u.jsx)(s.default,{category:`utility`,name:`search`,title:E.inputIconTitle}),id:A(),onFocus:Y,onBlur:q,onKeyDown:Z,inputRef:Q,onClick:()=>K(),onChange:J,placeholder:E.placeholder,readOnly:!!(b&&j),required:x,role:`textbox`,value:b&&j?.label||C,...Pt}),jt({menuRenderer:$()}),h&&(0,u.jsx)(`div`,{id:U(),className:`slds-form-element__help`,children:h})]})]})}),Lt=()=>{let e=S[0]?.icon,t=e&&c.default.isValidElement(e)?c.default.cloneElement(e,{containerClassName:`slds-combobox__input-entity-icon`}):null,n=S[0]?.label?S[0].label:C;return(0,u.jsxs)(`div`,{className:`slds-form-element__control`,children:[(0,u.jsx)(`div`,{className:(0,l.default)(`slds-combobox_container`,{"slds-has-inline-listbox":S.length}),children:(0,u.jsxs)(`div`,{className:(0,l.default)(`slds-combobox`,`slds-dropdown-trigger`,`slds-dropdown-trigger_click`,`ignore-react-onclickoutside`,{"slds-is-open":H(),"slds-has-error":h},p),role:`combobox`,"aria-expanded":H(),"aria-haspopup":`listbox`,children:[(0,u.jsx)(o.default,{defaultValue:m,"aria-autocomplete":`list`,"aria-controls":H()?`${A()}-listbox`:void 0,"aria-activedescendant":j?`${A()}-listbox-option-${j.id}`:void 0,"aria-describedby":U(),autoComplete:`off`,className:`slds-combobox__input`,containerProps:{className:`slds-combobox__form-element`,role:`none`},disabled:Ye,hasSpinner:Pe,iconRight:S.length?(0,u.jsx)(s.default,{assistiveText:{icon:T.removeSingleSelectedOption},buttonRef:e=>{nt.current=e},category:`utility`,iconPosition:`right`,name:`close`,onClick:e=>{Tt(e,{option:S[0]})}}):(0,u.jsx)(s.default,{category:`utility`,name:`search`}),iconLeft:t,id:A(),onFocus:Y,onBlur:q,onKeyDown:Z,inputRef:Q,onClick:()=>ht(),onChange:e=>{S.length||J(e)},placeholder:E.placeholder,readOnly:!!(b&&j)||!!S.length,required:x,role:`textbox`,value:b?j?.label||C:n,...Pt}),jt({menuRenderer:$()})]})}),h&&(0,u.jsx)(`div`,{className:`slds-has-error`,children:(0,u.jsx)(`div`,{id:U(),className:`slds-form-element__help`,children:h})})]})},Rt=()=>{let e=y?.props,t=At(e?.body);return(0,u.jsxs)(`div`,{className:`slds-form-element__control`,children:[(0,u.jsx)(`div`,{className:`slds-combobox_container`,children:(0,u.jsx)(`div`,{className:(0,l.default)(`slds-combobox`,`slds-dropdown-trigger`,`slds-dropdown-trigger_click`,`ignore-react-onclickoutside`,{"slds-is-open":H(),"slds-has-error":h},p),role:`combobox`,"aria-expanded":H(),"aria-haspopup":`dialog`,children:(0,u.jsx)(re.default,{...t,children:(0,u.jsx)(o.default,{"aria-autocomplete":`none`,"aria-controls":H()?`${A()}-popover`:void 0,"aria-describedby":U(),autoComplete:`off`,className:`slds-combobox__input`,containerProps:{className:`slds-combobox__form-element`,role:`none`},iconRight:(0,u.jsx)(s.default,{category:`utility`,name:`down`,variant:`combobox`}),id:A(),onFocus:Y,onBlur:q,onKeyDown:Z,inputRef:Q,onClick:()=>K(),onChange:J,placeholder:E.placeholder,readOnly:!0,required:x,role:`textbox`,value:C})})})}),h&&(0,u.jsx)(`div`,{className:`slds-has-error`,children:(0,u.jsx)(`div`,{id:U(),className:`slds-form-element__help slds-has-error`,children:h})})]})},zt=()=>{let e=S.length>1?E.multipleOptionsSelected||`${S.length} options selected`:S[0]?.label||``;return(0,u.jsxs)(`div`,{className:`slds-form-element__control`,children:[(0,u.jsx)(`div`,{className:`slds-combobox_container`,children:(0,u.jsxs)(`div`,{className:(0,l.default)(`slds-combobox`,`slds-dropdown-trigger`,`slds-dropdown-trigger_click`,`ignore-react-onclickoutside`,{"slds-is-open":H(),"slds-has-error":h},p),role:`combobox`,"aria-expanded":H(),"aria-haspopup":`listbox`,children:[(0,u.jsx)(o.default,{defaultValue:m,"aria-autocomplete":`list`,"aria-controls":H()?`${A()}-listbox`:void 0,"aria-activedescendant":j?`${A()}-listbox-option-${j.id}`:void 0,"aria-describedby":U(),autoComplete:`off`,className:`slds-combobox__input`,containerProps:{className:`slds-combobox__form-element`,role:`none`},iconRight:(0,u.jsx)(s.default,{category:`utility`,name:`down`,variant:`combobox`}),id:A(),onFocus:Y,onBlur:q,onKeyDown:Z,inputRef:Q,onClick:()=>ht(),onChange:e=>{S.length||J(e)},placeholder:E.placeholderReadOnly,readOnly:!0,required:x,role:`textbox`,value:e,...Pt}),jt({menuRenderer:$()})]})}),(0,u.jsx)(se.default,{activeOption:F,activeOptionIndex:L,assistiveText:T,events:{onBlurPill:Ct,onPillFocus:wt,onRequestFocus:Et,onRequestFocusOnNextPill:X,onRequestFocusOnPreviousPill:X,onRequestRemove:Tt},id:`${A()}-selected-listbox`,labels:E,selectedListboxRef:Dt,selection:S,listboxHasFocus:z,variant:w,renderAtSelectionLength:2,multiselectable:_}),h&&(0,u.jsx)(`div`,{className:`slds-has-error`,children:(0,u.jsx)(`div`,{id:U(),className:`slds-form-element__help slds-has-error`,children:h})})]})},Bt=()=>{let e=j?.label,t=S[0]?.label,n=e||t||``;return S[0]?.value===``&&(n=``),(0,u.jsx)(`div`,{className:`slds-form-element__control`,children:(0,u.jsx)(`div`,{className:`slds-combobox_container`,children:(0,u.jsxs)(`div`,{className:(0,l.default)(`slds-combobox`,`slds-dropdown-trigger`,`slds-dropdown-trigger_click`,`ignore-react-onclickoutside`,{"slds-is-open":H(),"slds-has-error":h},p),role:`combobox`,"aria-expanded":H(),"aria-haspopup":`listbox`,children:[(0,u.jsx)(o.default,{defaultValue:m,"aria-autocomplete":`list`,"aria-controls":H()?`${A()}-listbox`:void 0,"aria-activedescendant":j?`${A()}-listbox-option-${j.id}`:void 0,"aria-describedby":U(),autoComplete:`off`,className:`slds-combobox__input`,containerProps:{className:`slds-combobox__form-element`,role:`none`},disabled:Ye,iconRight:(0,u.jsx)(s.default,{category:`utility`,name:`down`,variant:`combobox`}),id:A(),onFocus:Y,onBlur:q,onKeyDown:Z,inputRef:Q,onClick:()=>ht(),onChange:e=>{S.length||J(e)},placeholder:E.placeholderReadOnly,readOnly:!0,required:x,role:`textbox`,value:n,...Pt}),jt({menuRenderer:$()}),h&&(0,u.jsx)(`div`,{id:U(),className:`slds-form-element__help`,children:h})]})})})},Vt=E.label||T?.label,Ht={base:{multiple:Ft,single:Ft},"inline-listbox":{multiple:It,single:Lt},popover:{multiple:Rt,single:Rt},readonly:{multiple:zt,single:Bt}},Ut=_?`multiple`:`single`,Wt=Ht[w]?.[Ut],Gt=(0,u.jsxs)(`div`,{className:(0,l.default)(`slds-form-element`,Ee),children:[Ae?null:(0,u.jsx)(ae.default,{assistiveText:T,htmlFor:A(),label:E.label,required:x}),Me&&Vt?(0,u.jsx)(ne.default,{fieldLevelHelpTooltip:Me}):null,Wt?Wt():Ht.base.multiple()]});return Ae?(0,u.jsxs)(`div`,{className:`slds-form-element`,children:[(0,u.jsx)(ae.default,{assistiveText:T,htmlFor:A(),label:E.label,required:x}),(0,u.jsx)(`div`,{className:`slds-form-element__control`,children:(0,u.jsxs)(`div`,{className:`slds-combobox-group`,children:[(0,u.jsx)(`div`,{className:`slds-combobox_object-switcher slds-combobox-addon_start`,children:Ae}),(0,u.jsx)(`div`,{className:`slds-combobox_container slds-combobox-addon_end`,children:Gt})]})})]}):Gt};we.displayName=t.COMBOBOX,exports.default=we;
1
+ const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../utilities/constants.cjs"),n=require("../icon-settings/index.cjs"),r=require("../../utilities/hooks/use-controllable-state.cjs"),i=require("../../utilities/generate-id.cjs"),a=require("../../utilities/key-code.cjs"),ee=require("../utilities/dialog/index.cjs"),te=require("../button/index.cjs"),ne=require("../../utilities/key-buffer.cjs"),o=require("../input/private/inner-input.cjs"),re=require("../tooltip/private/field-level-help-tooltip.cjs"),s=require("../icon/input-icon/index.cjs"),ie=require("../popover/index.cjs"),ae=require("./private/menu.cjs"),oe=require("../forms/private/label.cjs"),se=require("../../utilities/key-callbacks.cjs"),ce=require("../pill-container/private/selected-listbox.cjs"),le=require("../../utilities/key-letter-menu-item-select.cjs"),ue=require("../../utilities/menu-item-select-scroll.cjs"),de=require("./check-props.cjs"),fe=require("./component.cjs");let c=require("react");c=e.__toESM(c,1);let l=require("classnames");l=e.__toESM(l,1);let u=require("react/jsx-runtime"),pe=require("dequal"),d=require("lodash.assign");d=e.__toESM(d,1);let me=require("lodash.findindex");me=e.__toESM(me,1);let he=require("lodash.find");he=e.__toESM(he,1);let ge=require("lodash.reject");ge=e.__toESM(ge,1);var f,_e=typeof document<`u`,ve=Symbol(`actionItem`),ye=e=>ve in e,be=(e,t)=>({id:e.id||``,icon:e.icon,label:e.label,disabled:e.disabled,type:t,[ve]:e}),xe={label:``,loadingMenuItems:`Loading`,optionSelectedInMenu:`Current Selection:`,popoverLabel:``,removeSingleSelectedOption:`Remove selected option`,removePill:`, Press delete or backspace to remove`,selectedListboxLabel:`Selected Options:`},Se={deselectOption:`None`,label:``,cancelButton:`Cancel`,doneButton:`Done`,multipleOptionsSelected:``,noOptionsFound:`No matches found.`,placeholder:``,placeholderReadOnly:`Select an Option`,removePillTitle:`Remove`,optionDisabledTooltipLabel:`This option is disabled.`,inputIconTitle:``},Ce={},we=e=>{let{assistiveText:we={},"aria-describedby":Te,className:p,classNameContainer:Ee,classNameMenu:De,classNameMenuSubHeader:Oe,defaultIsOpen:ke,disabled:Ae,entityCombobox:je,errorText:m,events:Me={},fieldLevelHelpTooltip:Ne,hasDeselect:Pe,hasInputSpinner:Fe,hasMenuSpinner:Ie,hasStaticAlignment:Le,id:Re,inheritWidthOf:ze=`target`,input:Be,inputRef:Ve,isOpen:He,labels:Ue={},menuItemVisibleLength:We,menuMaxWidth:Ge,menuPosition:Ke=`absolute`,multiple:h,onRenderMenuItem:qe,options:g=[],optionsAddItem:Je=[],optionsSearchEntity:Ye=[],popover:_,predefinedOptionsOnly:v,required:y=!1,selection:b=[],selectedListboxRef:Xe,singleInputDisabled:Ze=!1,tooltipMenuItemDisabled:Qe,value:x,variant:S=`base`,renderMenuItem:$e,menuItem:et}=e,C=(0,d.default)({},xe,we),w=(0,d.default)({},Se,Ue),T=(0,d.default)({},Ce,Me),tt=(0,c.useContext)(n.IconSettingsContext),E=(0,c.useRef)(null),D=(0,c.useRef)(null),nt=(0,c.useRef)(null),rt=(0,c.useRef)(null),it=(0,c.useRef)(null),at=(0,c.useRef)(new ne.default),ot=(0,c.useRef)(i.default()),st=(0,c.useRef)(i.default()),O=(0,c.useCallback)(()=>Re||ot.current,[Re]),ct=`${O()}-deselect`,[k,A]=(0,c.useState)(void 0),[j,M]=(0,c.useState)(-1),[N,P]=(0,c.useState)(b?.[0]),[F,I]=(0,c.useState)(0),[L,R]=(0,c.useState)(!1),[z,lt,ut]=r.useControllableState(He,ke??!1),dt=(0,c.useRef)(z);(0,c.useEffect)(()=>{dt.current=z},[z]);let ft=(0,c.useRef)(void 0),[pt,mt]=(0,c.useState)(z);pt!==z&&(mt(z),z||(A(void 0),M(-1)));let[ht,gt]=(0,c.useState)(!1);(0,c.useEffect)(()=>{de.default(t.COMBOBOX,e,fe.default)},[]);let B=(0,c.useCallback)(()=>!!z,[z]),_t=(0,c.useCallback)(()=>k&&j!==-1,[k,j]),V=(0,c.useCallback)(()=>Te||m&&st.current,[Te,m]),H=(0,c.useCallback)(()=>{let e={id:ct,label:w.deselectOption,value:``,type:`deselect`},t=Ye.map(e=>be(e,`header`)),n=Je.map(e=>be(e,`footer`));return[...t.length>0?t:[],...Pe?[e]:[],...g&&g.length>0?g:[],...n.length>0?n:[]]},[ct,w.deselectOption,Ye,Je,Pe,g]),vt=(0,c.useCallback)(({selection:e,option:t})=>!!(0,he.default)(e,t),[]),yt=(0,c.useCallback)(({activeOptionIndex:e,offset:t,options:n})=>{let r=e+t,i=n.length>r&&r>=0&&n[r].type===`separator`?r+t:r;return n.length>r&&r>=0?i:e},[]),U=(0,c.useCallback)((e,{trigger:t}={})=>{if(dt.current){if(ut||(dt.current=!1),ft.current=e,S===`popover`&&t===`cancel`){let n=_?.props;n?.onClose&&n.onClose(e,{trigger:t})}T.onRequestClose&&T.onRequestClose(e,{}),lt(!1)}},[ut,S,_,T,lt]),bt=(0,c.useCallback)((e,t)=>{if(f={handleClose:U},T.onOpen&&T.onOpen(e,t||{}),S===`readonly`){let e=H(),t=(0,me.default)(e,e=>(0,pe.dequal)(e,b[0]));M(t),A(b[0]),D.current!==null&&ue.default({container:D.current,focusedIndex:t})}},[U,T,S,H,b]),W=(0,c.useCallback)(e=>{z||(T.onRequestOpen&&T.onRequestOpen(e,{}),lt(!0))},[z,T,lt]),G=(0,c.useCallback)(e=>{(!h&&b.length===0&&S===`inline-listbox`||h||S===`readonly`)&&W(e)},[h,b.length,S,W]);(0,c.useCallback)(e=>{U(e,{trigger:`cancel`})},[U]);let xt=(0,c.useCallback)((e,{selection:t,option:n})=>{if(ye(n)){let t=n[ve],r=e;t.onClick?.(r,{option:t}),T.onSelectActionItem?.(r,{option:t,value:x??``}),U(e);return}let r,i=vt({selection:t,option:n}),a=!h&&!i,ee=h&&!i;r=n.id===ct?[]:a?[n]:ee?[...b,n]:(0,ge.default)(b,n),T.onSelect&&T.onSelect(e,{selection:r}),U(e)},[vt,h,ct,b,T,U,x]),K=(0,c.useCallback)(e=>{setTimeout(()=>{let t=_e?document.activeElement:null;t&&t.tagName===`DIV`&&t.id===`${O()}-listbox`?E.current&&E.current.focus():_||U(e)},200),T.onBlur&&T.onBlur(e)},[O,_,U,T]),q=(0,c.useCallback)(e=>{G(e),T.onChange&&T.onChange(e,{value:e.target.value})},[G,T]),J=(0,c.useCallback)(e=>{T.onFocus&&T.onFocus(e,{})},[T]),St=(0,c.useCallback)(e=>{if(k===void 0&&j===-1&&(z?U(e,{trigger:`cancel`}):e.shiftKey||W(e)),!k?.disabled){if(k&&!ye(k)&&(k.type===`header`||k.type===`footer`)){k.onClick?.(e);return}_t()?xt(e,{option:k,selection:b}):!v&&e.target.value!==``&&T.onSubmit&&T.onSubmit(e,{value:e.target.value})}},[k,j,z,W,U,_t,xt,b,v,T]),Ct=(0,c.useCallback)((e,{direction:t})=>{let n={next:1,previous:-1},r=H(),i=yt({activeOptionIndex:j,offset:n[t],options:r});B()&&D.current&&ue.default({container:D.current,focusedIndex:i}),A(r[i]),M(i)},[H,yt,j,B]),Y=(0,c.useCallback)((e,{direction:t})=>{let n={next:1,previous:-1},r=F+1===b.length&&t===`next`,i=F===0&&t===`previous`;if(r)P(b[0]),I(0),R(!0);else if(i)P(b[b.length-1]),I(b.length-1),R(!0);else{let e=yt({activeOptionIndex:F,offset:n[t],options:b});P(b[e]),I(e),R(!0)}},[F,b,yt]),wt=(0,c.useCallback)(e=>{e.shiftKey||W(e),S!==`popover`&&Ct(e,{direction:`next`})},[W,S,Ct]),Tt=(0,c.useCallback)(e=>{!e.shiftKey&&B()&&Ct(e,{direction:`previous`})},[B,Ct]),Et=(0,c.useCallback)(()=>{nt.current&&R(!0)},[]),Dt=(0,c.useCallback)(e=>{let t=H(),n=le.default({key:e.key,keyBuffer:at.current,keyCode:e.keyCode,options:t});n!==void 0&&(B()&&D.current&&ue.default({container:D.current,focusedIndex:n}),A(t[n]),M(n))},[H,B]),X=(0,c.useCallback)(e=>{let t={[a.default.DOWN]:{callback:wt},[a.default.ENTER]:{callback:St},[a.default.ESCAPE]:{callback:U},[a.default.UP]:{callback:Tt}};S===`readonly`&&(b.length>2?t[a.default.TAB]={callback:Et}:t[a.default.TAB]=void 0,t.other={callback:Dt,stopPropagation:!1});let n=B();se.default(e,{callbacks:t,stopPropagation:n})},[wt,St,U,Tt,S,b.length,Et,Dt,B]),Ot=(0,c.useCallback)(()=>{R(!1)},[]),kt=(0,c.useCallback)((e,{option:t,index:n})=>{L||(P(t),I(n),R(!0))},[L]),At=(0,c.useCallback)((e,{option:t,index:n})=>{e.preventDefault();let r=b.length===1,i=b.length===2&&S===`readonly`&&h,a=n!==void 0&&n+1===b.length;(r||i)&&E.current?E.current.focus():a&&n!==void 0?(P(b[n-1]),I(n-1),R(!0)):n!==void 0&&(P(b[n+1]),I(n),R(!0)),T.onRequestRemoveSelectedOption&&T.onRequestRemoveSelectedOption(e,{selection:(0,ge.default)(b,t)})},[b,S,h,T]),jt=(0,c.useCallback)((e,{ref:t})=>{t&&(rt.current=t,rt.current.focus())},[]),Z=(0,c.useCallback)(e=>{E.current=e,ht||gt(!0),Ve&&Ve(e)},[ht,Ve]),Mt=(0,c.useCallback)(e=>{nt.current=e,Xe&&Xe(e)},[Xe]),Nt=(0,c.useCallback)(e=>{D.current=e},[]),Pt=(0,c.useCallback)(()=>E.current,[]),Ft=(0,c.useRef)(z);(0,c.useEffect)(()=>{Ft.current!==z&&(Ft.current=z,z||(f&&f.handleClose===U&&(f=void 0),T.onClose&&T.onClose(ft.current,{}))),ft.current=void 0}),(0,c.useEffect)(()=>{let e=H();if(k){let t=(0,me.default)(e,e=>(0,pe.dequal)(e,k));t===-1?(A(void 0),M(-1)):M(t)}},[g,H,k]),(0,c.useEffect)(()=>{if(b.length===0){N!==void 0&&(P(void 0),I(0));return}if(!N||!b[F]){let e=F>=b.length?b.length-1:F;P(b[e]),I(e)}},[b,N,F]),(0,c.useEffect)(()=>()=>{f&&f.handleClose===U&&(f=void 0)},[U]);let It=(0,c.useCallback)(e=>{let t=(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`div`,{className:`slds-assistive-text`,id:`${O()}-label`,children:C.popoverLabel}),e]}),n=(0,u.jsxs)(`div`,{children:[(0,u.jsx)(te.default,{label:w.cancelButton,onClick:e=>{U(e,{trigger:`cancel`})}}),(0,u.jsx)(te.default,{label:w.doneButton,variant:`brand`,onClick:e=>{U(e)}})]}),r={ariaLabelledby:`${O()}-label`,align:`bottom`,body:t,classNameDialog:`slds-popover_full-width`,footer:n,classNameFooter:`slds-popover__footer_form`,hasNoNubbin:!0,id:O(),isOpen:z,hasNoTriggerStyles:!0,onOpen:bt,onRequestClose:(e,t)=>{U(e,{trigger:t?.trigger})}},i=_?.props,a=(0,d.default)(r,i||{});return a.body=t,delete a.children,a},[O,C.popoverLabel,w.cancelButton,w.doneButton,U,z,bt,_]),Q=(0,c.useCallback)(({menuRenderer:e})=>{let t=Ke;if(!Ae&&B()){let n={align:`bottom left`,context:tt,hasStaticAlignment:Le,inheritWidthOf:ze,onMouseDown:e=>{e.preventDefault()},onOpen:bt,onRequestTargetElement:Pt,position:t,containerProps:{id:`${O()}-listbox`,role:`listbox`}};return(0,u.jsx)(ee.default,{...n,children:e})}return null},[Ke,Ae,B,tt,Le,ze,bt,Pt,O]),Lt=qe||et,Rt;$e?Rt=e=>$e({...e,assistiveText:C}):Lt&&(Rt=({isSelected:e,option:t})=>(0,u.jsx)(Lt,{assistiveText:C,selected:e,option:t}));let $=(0,c.useCallback)(()=>{let e={base:`icon-title-subtitle`,"inline-listbox":`icon-title-subtitle`,readonly:`checkbox`},t=S===`readonly`?5:null;return(0,u.jsx)(ae.default,{assistiveText:C,activeOption:k,activeOptionIndex:j,classNameMenu:De,classNameMenuSubHeader:Oe,inheritWidthOf:ze,inputId:O(),inputValue:x,isSelected:vt,itemVisibleLength:We||t,labels:{noOptionsFound:w.noOptionsFound||``},hasMenuSpinner:Ie,menuPosition:Ke,menuRef:Nt,maxWidth:Ge,options:H(),onSelect:xt,renderMenuItem:Rt,selection:b,tooltipMenuItemDisabled:Qe,variant:e[S]})},[S,C,k,j,De,Oe,ze,O,x,vt,We,w.noOptionsFound,Ie,Ke,Nt,Ge,H,xt,Rt,b,Qe]),zt=Be?.props||{},Bt=()=>(0,u.jsxs)(`div`,{className:`slds-form-element__control`,children:[(0,u.jsx)(`div`,{className:`slds-combobox_container`,children:(0,u.jsxs)(`div`,{className:(0,l.default)(`slds-combobox`,`slds-dropdown-trigger`,`slds-dropdown-trigger_click`,`ignore-react-onclickoutside`,{"slds-is-open":B(),"slds-has-error":m},p),role:`combobox`,"aria-expanded":B(),"aria-haspopup":`listbox`,"aria-owns":B()?`${O()}-listbox`:void 0,children:[(0,u.jsx)(o.default,{"aria-autocomplete":`list`,"aria-controls":B()?`${O()}-listbox`:void 0,"aria-activedescendant":k?`${O()}-listbox-option-${k.id}`:void 0,"aria-describedby":V(),autoComplete:`off`,className:`slds-combobox__input`,containerProps:{className:`slds-combobox__form-element`,role:`none`},hasSpinner:Fe,iconRight:(0,u.jsx)(s.default,{category:`utility`,name:`search`,title:w.inputIconTitle}),id:O(),onFocus:J,onBlur:K,onKeyDown:X,inputRef:Z,onClick:e=>W(e),onChange:q,placeholder:w.placeholder,readOnly:!!(v&&k),required:y,role:`textbox`,value:v&&k?.label||x,...zt}),Q({menuRenderer:$()})]})}),(0,u.jsx)(ce.default,{activeOption:N,activeOptionIndex:F,assistiveText:C,events:{onBlurPill:Ot,onPillFocus:kt,onRequestFocus:jt,onRequestFocusOnNextPill:Y,onRequestFocusOnPreviousPill:Y,onRequestRemove:At},id:`${O()}-selected-listbox`,labels:w,selectedListboxRef:Mt,selection:b,listboxHasFocus:L,multiselectable:h}),m&&(0,u.jsx)(`div`,{className:`slds-has-error`,children:(0,u.jsx)(`div`,{id:V(),className:`slds-form-element__help slds-has-error`,children:m})})]}),Vt=()=>(0,u.jsx)(`div`,{className:`slds-form-element__control`,children:(0,u.jsxs)(`div`,{className:(0,l.default)(`slds-combobox_container`,{"slds-has-inline-listbox":b.length}),children:[b.length?(0,u.jsx)(ce.default,{activeOption:N,activeOptionIndex:F,assistiveText:C,containerRole:`listbox`,containerAriaOrientation:`horizontal`,listboxRole:`group`,listboxAriaOrientation:null,events:{onBlurPill:Ot,onPillFocus:kt,onRequestFocus:jt,onRequestFocusOnNextPill:Y,onRequestFocusOnPreviousPill:Y,onRequestRemove:At},id:`${O()}-selected-listbox`,labels:w,selectedListboxRef:Mt,selection:b,listboxHasFocus:L,multiselectable:h}):null,(0,u.jsxs)(`div`,{className:(0,l.default)(`slds-combobox`,`slds-dropdown-trigger`,`slds-dropdown-trigger_click`,`ignore-react-onclickoutside`,{"slds-is-open":B(),"slds-has-error":m},p),role:`combobox`,"aria-expanded":B(),"aria-haspopup":`listbox`,children:[(0,u.jsx)(o.default,{"aria-autocomplete":`list`,"aria-controls":B()?`${O()}-listbox`:void 0,"aria-activedescendant":k?`${O()}-listbox-option-${k.id}`:void 0,"aria-describedby":V(),autoComplete:`off`,className:`slds-combobox__input`,containerProps:{className:`slds-combobox__form-element`,role:`none`},hasSpinner:Fe,iconRight:(0,u.jsx)(s.default,{category:`utility`,name:`search`,title:w.inputIconTitle}),id:O(),onFocus:J,onBlur:K,onKeyDown:X,inputRef:Z,onClick:e=>W(e),onChange:q,placeholder:w.placeholder,readOnly:!!(v&&k),required:y,role:`textbox`,value:v&&k?.label||x,...zt}),Q({menuRenderer:$()}),m&&(0,u.jsx)(`div`,{id:V(),className:`slds-form-element__help`,children:m})]})]})}),Ht=()=>{let e=b[0]?.icon,t=e&&c.default.isValidElement(e)?c.default.cloneElement(e,{containerClassName:`slds-combobox__input-entity-icon`}):null,n=b[0]?.label?b[0].label:x;return(0,u.jsxs)(`div`,{className:`slds-form-element__control`,children:[(0,u.jsx)(`div`,{className:(0,l.default)(`slds-combobox_container`,{"slds-has-inline-listbox":b.length}),children:(0,u.jsxs)(`div`,{className:(0,l.default)(`slds-combobox`,`slds-dropdown-trigger`,`slds-dropdown-trigger_click`,`ignore-react-onclickoutside`,{"slds-is-open":B(),"slds-has-error":m},p),role:`combobox`,"aria-expanded":B(),"aria-haspopup":`listbox`,children:[(0,u.jsx)(o.default,{"aria-autocomplete":`list`,"aria-controls":B()?`${O()}-listbox`:void 0,"aria-activedescendant":k?`${O()}-listbox-option-${k.id}`:void 0,"aria-describedby":V(),autoComplete:`off`,className:`slds-combobox__input`,containerProps:{className:`slds-combobox__form-element`,role:`none`},disabled:Ze,hasSpinner:Fe,iconRight:b.length?(0,u.jsx)(s.default,{assistiveText:{icon:C.removeSingleSelectedOption},buttonRef:e=>{it.current=e},category:`utility`,iconPosition:`right`,name:`close`,onClick:e=>{At(e,{option:b[0]})}}):(0,u.jsx)(s.default,{category:`utility`,name:`search`}),iconLeft:t,id:O(),onFocus:J,onBlur:K,onKeyDown:X,inputRef:Z,onClick:e=>G(e),onChange:e=>{b.length||q(e)},placeholder:w.placeholder,readOnly:!!(v&&k)||!!b.length,required:y,role:`textbox`,value:v?k?.label||x:n,...zt}),Q({menuRenderer:$()})]})}),m&&(0,u.jsx)(`div`,{className:`slds-has-error`,children:(0,u.jsx)(`div`,{id:V(),className:`slds-form-element__help`,children:m})})]})},Ut=()=>{let e=_?.props,t=It(e?.body);return(0,u.jsxs)(`div`,{className:`slds-form-element__control`,children:[(0,u.jsx)(`div`,{className:`slds-combobox_container`,children:(0,u.jsx)(`div`,{className:(0,l.default)(`slds-combobox`,`slds-dropdown-trigger`,`slds-dropdown-trigger_click`,`ignore-react-onclickoutside`,{"slds-is-open":B(),"slds-has-error":m},p),role:`combobox`,"aria-expanded":B(),"aria-haspopup":`dialog`,children:(0,u.jsx)(ie.default,{...t,children:(0,u.jsx)(o.default,{"aria-autocomplete":`none`,"aria-controls":B()?`${O()}-popover`:void 0,"aria-describedby":V(),autoComplete:`off`,className:`slds-combobox__input`,containerProps:{className:`slds-combobox__form-element`,role:`none`},iconRight:(0,u.jsx)(s.default,{category:`utility`,name:`down`,variant:`combobox`}),id:O(),onFocus:J,onBlur:K,onKeyDown:X,inputRef:Z,onClick:e=>W(e),onChange:q,placeholder:w.placeholder,readOnly:!0,required:y,role:`textbox`,value:x})})})}),m&&(0,u.jsx)(`div`,{className:`slds-has-error`,children:(0,u.jsx)(`div`,{id:V(),className:`slds-form-element__help slds-has-error`,children:m})})]})},Wt=()=>{let e=b.length>1?w.multipleOptionsSelected||`${b.length} options selected`:b[0]?.label||``;return(0,u.jsxs)(`div`,{className:`slds-form-element__control`,children:[(0,u.jsx)(`div`,{className:`slds-combobox_container`,children:(0,u.jsxs)(`div`,{className:(0,l.default)(`slds-combobox`,`slds-dropdown-trigger`,`slds-dropdown-trigger_click`,`ignore-react-onclickoutside`,{"slds-is-open":B(),"slds-has-error":m},p),role:`combobox`,"aria-expanded":B(),"aria-haspopup":`listbox`,children:[(0,u.jsx)(o.default,{"aria-autocomplete":`list`,"aria-controls":B()?`${O()}-listbox`:void 0,"aria-activedescendant":k?`${O()}-listbox-option-${k.id}`:void 0,"aria-describedby":V(),autoComplete:`off`,className:`slds-combobox__input`,containerProps:{className:`slds-combobox__form-element`,role:`none`},iconRight:(0,u.jsx)(s.default,{category:`utility`,name:`down`,variant:`combobox`}),id:O(),onFocus:J,onBlur:K,onKeyDown:X,inputRef:Z,onClick:e=>G(e),onChange:e=>{b.length||q(e)},placeholder:w.placeholderReadOnly,readOnly:!0,required:y,role:`textbox`,value:e,...zt}),Q({menuRenderer:$()})]})}),(0,u.jsx)(ce.default,{activeOption:N,activeOptionIndex:F,assistiveText:C,events:{onBlurPill:Ot,onPillFocus:kt,onRequestFocus:jt,onRequestFocusOnNextPill:Y,onRequestFocusOnPreviousPill:Y,onRequestRemove:At},id:`${O()}-selected-listbox`,labels:w,selectedListboxRef:Mt,selection:b,listboxHasFocus:L,variant:S,renderAtSelectionLength:2,multiselectable:h}),m&&(0,u.jsx)(`div`,{className:`slds-has-error`,children:(0,u.jsx)(`div`,{id:V(),className:`slds-form-element__help slds-has-error`,children:m})})]})},Gt=()=>{let e=k?.label,t=b[0]?.label,n=e||t||``;return b[0]?.value===``&&(n=``),(0,u.jsx)(`div`,{className:`slds-form-element__control`,children:(0,u.jsx)(`div`,{className:`slds-combobox_container`,children:(0,u.jsxs)(`div`,{className:(0,l.default)(`slds-combobox`,`slds-dropdown-trigger`,`slds-dropdown-trigger_click`,`ignore-react-onclickoutside`,{"slds-is-open":B(),"slds-has-error":m},p),role:`combobox`,"aria-expanded":B(),"aria-haspopup":`listbox`,children:[(0,u.jsx)(o.default,{"aria-autocomplete":`list`,"aria-controls":B()?`${O()}-listbox`:void 0,"aria-activedescendant":k?`${O()}-listbox-option-${k.id}`:void 0,"aria-describedby":V(),autoComplete:`off`,className:`slds-combobox__input`,containerProps:{className:`slds-combobox__form-element`,role:`none`},disabled:Ze,iconRight:(0,u.jsx)(s.default,{category:`utility`,name:`down`,variant:`combobox`}),id:O(),onFocus:J,onBlur:K,onKeyDown:X,inputRef:Z,onClick:e=>G(e),onChange:e=>{b.length||q(e)},placeholder:w.placeholderReadOnly,readOnly:!0,required:y,role:`textbox`,value:n,...zt}),Q({menuRenderer:$()}),m&&(0,u.jsx)(`div`,{id:V(),className:`slds-form-element__help`,children:m})]})})})},Kt=w.label||C?.label,qt={base:{multiple:Bt,single:Bt},"inline-listbox":{multiple:Vt,single:Ht},popover:{multiple:Ut,single:Ut},readonly:{multiple:Wt,single:Gt}},Jt=h?`multiple`:`single`,Yt=qt[S]?.[Jt],Xt=(0,u.jsxs)(`div`,{className:(0,l.default)(`slds-form-element`,Ee),children:[je?null:(0,u.jsx)(oe.default,{assistiveText:C,htmlFor:O(),label:w.label,required:y}),Ne&&Kt?(0,u.jsx)(re.default,{fieldLevelHelpTooltip:Ne}):null,Yt?Yt():qt.base.multiple()]});return je?(0,u.jsxs)(`div`,{className:`slds-form-element`,children:[(0,u.jsx)(oe.default,{assistiveText:C,htmlFor:O(),label:w.label,required:y}),(0,u.jsx)(`div`,{className:`slds-form-element__control`,children:(0,u.jsxs)(`div`,{className:`slds-combobox-group`,children:[(0,u.jsx)(`div`,{className:`slds-combobox_object-switcher slds-combobox-addon_start`,children:je}),(0,u.jsx)(`div`,{className:`slds-combobox_container slds-combobox-addon_end`,children:Xt})]})})]}):Xt};we.displayName=t.COMBOBOX,exports.default=we;
2
2
  //# sourceMappingURL=combobox.cjs.map