@salesforce/design-system-react 11.0.0-alpha.4 → 11.0.0-alpha.5

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 (257) hide show
  1. package/README.md +112 -70
  2. package/dist/cjs/components/accordion/index.cjs +1 -1
  3. package/dist/cjs/components/accordion/index.cjs.map +1 -1
  4. package/dist/cjs/components/alert/index.cjs +1 -1
  5. package/dist/cjs/components/alert/index.cjs.map +1 -1
  6. package/dist/cjs/components/avatar/index.cjs +1 -1
  7. package/dist/cjs/components/avatar/index.cjs.map +1 -1
  8. package/dist/cjs/components/badge/index.cjs +1 -1
  9. package/dist/cjs/components/badge/index.cjs.map +1 -1
  10. package/dist/cjs/components/breadcrumb/index.cjs +1 -1
  11. package/dist/cjs/components/breadcrumb/index.cjs.map +1 -1
  12. package/dist/cjs/components/builder-header/index.cjs +1 -1
  13. package/dist/cjs/components/builder-header/index.cjs.map +1 -1
  14. package/dist/cjs/components/button/index.cjs +1 -1
  15. package/dist/cjs/components/button/index.cjs.map +1 -1
  16. package/dist/cjs/components/button-group/index.cjs +1 -1
  17. package/dist/cjs/components/button-group/index.cjs.map +1 -1
  18. package/dist/cjs/components/button-stateful/index.cjs +1 -1
  19. package/dist/cjs/components/button-stateful/index.cjs.map +1 -1
  20. package/dist/cjs/components/card/index.cjs +1 -1
  21. package/dist/cjs/components/card/index.cjs.map +1 -1
  22. package/dist/cjs/components/carousel/index.cjs +1 -1
  23. package/dist/cjs/components/carousel/index.cjs.map +1 -1
  24. package/dist/cjs/components/checkbox/index.cjs +1 -1
  25. package/dist/cjs/components/checkbox/index.cjs.map +1 -1
  26. package/dist/cjs/components/color-picker/index.cjs +1 -0
  27. package/dist/cjs/components/color-picker.cjs +1 -0
  28. package/dist/cjs/components/combobox/index.cjs +1 -1
  29. package/dist/cjs/components/combobox/index.cjs.map +1 -1
  30. package/dist/cjs/components/date-picker/index.cjs +1 -1
  31. package/dist/cjs/components/date-picker/index.cjs.map +1 -1
  32. package/dist/cjs/components/docked-composer/index.cjs +1 -1
  33. package/dist/cjs/components/docked-composer/index.cjs.map +1 -1
  34. package/dist/cjs/components/dynamic-icon/index.cjs +1 -1
  35. package/dist/cjs/components/dynamic-icon/index.cjs.map +1 -1
  36. package/dist/cjs/components/expandable-section/index.cjs +1 -1
  37. package/dist/cjs/components/expandable-section/index.cjs.map +1 -1
  38. package/dist/cjs/components/files/index.cjs +1 -1
  39. package/dist/cjs/components/files/index.cjs.map +1 -1
  40. package/dist/cjs/components/filter/index.cjs +1 -0
  41. package/dist/cjs/components/filter.cjs +1 -0
  42. package/dist/cjs/components/grid/index.cjs +2 -0
  43. package/dist/cjs/components/grid/index.cjs.map +1 -0
  44. package/dist/cjs/components/grid.cjs +1 -0
  45. package/dist/cjs/components/icon/index.cjs +1 -1
  46. package/dist/cjs/components/icon/index.cjs.map +1 -1
  47. package/dist/cjs/components/icon-settings/index.cjs +1 -1
  48. package/dist/cjs/components/icon-settings/index.cjs.map +1 -1
  49. package/dist/cjs/components/illustration/index.cjs +1 -1
  50. package/dist/cjs/components/illustration/index.cjs.map +1 -1
  51. package/dist/cjs/components/input/index.cjs +1 -1
  52. package/dist/cjs/components/input/index.cjs.map +1 -1
  53. package/dist/cjs/components/media-object/index.cjs +1 -1
  54. package/dist/cjs/components/media-object/index.cjs.map +1 -1
  55. package/dist/cjs/components/menu-dropdown/index.cjs +1 -1
  56. package/dist/cjs/components/menu-dropdown/index.cjs.map +1 -1
  57. package/dist/cjs/components/menu-dropdown/menu-dropdown.cjs +1 -1
  58. package/dist/cjs/components/menu-dropdown/menu-dropdown.cjs.map +1 -1
  59. package/dist/cjs/components/modal/index.cjs +1 -1
  60. package/dist/cjs/components/modal/index.cjs.map +1 -1
  61. package/dist/cjs/components/page-header/index.cjs +1 -1
  62. package/dist/cjs/components/page-header/index.cjs.map +1 -1
  63. package/dist/cjs/components/panel/index.cjs +1 -1
  64. package/dist/cjs/components/panel/index.cjs.map +1 -1
  65. package/dist/cjs/components/pill/index.cjs +1 -1
  66. package/dist/cjs/components/pill/index.cjs.map +1 -1
  67. package/dist/cjs/components/pill-container/index.cjs +1 -1
  68. package/dist/cjs/components/pill-container/index.cjs.map +1 -1
  69. package/dist/cjs/components/popover/index.cjs +1 -1
  70. package/dist/cjs/components/popover/index.cjs.map +1 -1
  71. package/dist/cjs/components/popover/popover.cjs +1 -1
  72. package/dist/cjs/components/popover/popover.cjs.map +1 -1
  73. package/dist/cjs/components/portal-settings/index.cjs +1 -1
  74. package/dist/cjs/components/portal-settings/index.cjs.map +1 -1
  75. package/dist/cjs/components/progress-bar/index.cjs +1 -1
  76. package/dist/cjs/components/progress-bar/index.cjs.map +1 -1
  77. package/dist/cjs/components/progress-indicator/check-props.cjs +2 -0
  78. package/dist/cjs/components/progress-indicator/check-props.cjs.map +1 -0
  79. package/dist/cjs/components/progress-indicator/index.cjs +1 -1
  80. package/dist/cjs/components/progress-indicator/index.cjs.map +1 -1
  81. package/dist/cjs/components/progress-indicator/private/path.cjs +2 -0
  82. package/dist/cjs/components/progress-indicator/private/path.cjs.map +1 -0
  83. package/dist/cjs/components/progress-indicator/private/progress.cjs +1 -1
  84. package/dist/cjs/components/progress-indicator/private/progress.cjs.map +1 -1
  85. package/dist/cjs/components/progress-indicator/private/use-roving-tab-index.cjs +2 -0
  86. package/dist/cjs/components/progress-indicator/private/use-roving-tab-index.cjs.map +1 -0
  87. package/dist/cjs/components/progress-ring/index.cjs +1 -1
  88. package/dist/cjs/components/progress-ring/index.cjs.map +1 -1
  89. package/dist/cjs/components/radio/index.cjs +1 -1
  90. package/dist/cjs/components/radio/index.cjs.map +1 -1
  91. package/dist/cjs/components/radio-button-group/index.cjs +1 -1
  92. package/dist/cjs/components/radio-button-group/index.cjs.map +1 -1
  93. package/dist/cjs/components/radio-group/index.cjs +1 -1
  94. package/dist/cjs/components/radio-group/index.cjs.map +1 -1
  95. package/dist/cjs/components/scoped-notification/index.cjs +1 -1
  96. package/dist/cjs/components/scoped-notification/index.cjs.map +1 -1
  97. package/dist/cjs/components/setup-assistant/index.cjs +1 -1
  98. package/dist/cjs/components/setup-assistant/index.cjs.map +1 -1
  99. package/dist/cjs/components/simple-data-table/index.cjs +1 -1
  100. package/dist/cjs/components/simple-data-table/index.cjs.map +1 -1
  101. package/dist/cjs/components/slider/index.cjs +1 -1
  102. package/dist/cjs/components/slider/index.cjs.map +1 -1
  103. package/dist/cjs/components/spinner/index.cjs +1 -1
  104. package/dist/cjs/components/spinner/index.cjs.map +1 -1
  105. package/dist/cjs/components/split-view/index.cjs +1 -1
  106. package/dist/cjs/components/split-view/index.cjs.map +1 -1
  107. package/dist/cjs/components/tabs/index.cjs +1 -1
  108. package/dist/cjs/components/tabs/index.cjs.map +1 -1
  109. package/dist/cjs/components/textarea/index.cjs +1 -1
  110. package/dist/cjs/components/textarea/index.cjs.map +1 -1
  111. package/dist/cjs/components/toast/index.cjs +1 -1
  112. package/dist/cjs/components/toast/index.cjs.map +1 -1
  113. package/dist/cjs/components/tooltip/index.cjs +2 -2
  114. package/dist/cjs/components/tooltip/index.cjs.map +1 -1
  115. package/dist/cjs/components/tree/index.cjs +1 -0
  116. package/dist/cjs/components/tree.cjs +1 -0
  117. package/dist/cjs/components/trial-bar/index.cjs +1 -1
  118. package/dist/cjs/components/trial-bar/index.cjs.map +1 -1
  119. package/dist/cjs/components/vertical-navigation/index.cjs +1 -1
  120. package/dist/cjs/components/vertical-navigation/index.cjs.map +1 -1
  121. package/dist/cjs/components/visual-picker/index.cjs +1 -1
  122. package/dist/cjs/components/visual-picker/index.cjs.map +1 -1
  123. package/dist/cjs/components/welcome-mat/index.cjs +1 -1
  124. package/dist/cjs/components/welcome-mat/index.cjs.map +1 -1
  125. package/dist/cjs/utilities/constants.cjs +1 -1
  126. package/dist/cjs/utilities/constants.cjs.map +1 -1
  127. package/dist/cjs/utilities/hooks/index.cjs +1 -0
  128. package/dist/cjs/utilities/hooks.cjs +1 -0
  129. package/dist/cjs/utilities/warning/incompatible-props.cjs +2 -0
  130. package/dist/cjs/utilities/warning/incompatible-props.cjs.map +1 -0
  131. package/dist/es/components/accordion/index.js +28 -24
  132. package/dist/es/components/accordion/index.js.map +1 -1
  133. package/dist/es/components/alert/index.js +14 -14
  134. package/dist/es/components/alert/index.js.map +1 -1
  135. package/dist/es/components/badge/index.js +1 -0
  136. package/dist/es/components/badge/index.js.map +1 -1
  137. package/dist/es/components/button/index.js +1 -1
  138. package/dist/es/components/button/index.js.map +1 -1
  139. package/dist/es/components/button-stateful/index.js +3 -2
  140. package/dist/es/components/button-stateful/index.js.map +1 -1
  141. package/dist/es/components/color-picker/index.js +2 -0
  142. package/dist/es/components/color-picker.js +2 -0
  143. package/dist/es/components/filter/index.js +2 -0
  144. package/dist/es/components/filter.js +2 -0
  145. package/dist/es/components/grid/index.js +31 -0
  146. package/dist/es/components/grid/index.js.map +1 -0
  147. package/dist/es/components/grid.js +2 -0
  148. package/dist/es/components/menu-dropdown/index.js +5 -5
  149. package/dist/es/components/menu-dropdown/menu-dropdown.js +47 -40
  150. package/dist/es/components/menu-dropdown/menu-dropdown.js.map +1 -1
  151. package/dist/es/components/page-header/index.js +24 -24
  152. package/dist/es/components/popover/index.js +3 -3
  153. package/dist/es/components/popover/popover.js +10 -3
  154. package/dist/es/components/popover/popover.js.map +1 -1
  155. package/dist/es/components/progress-indicator/check-props.js +24 -0
  156. package/dist/es/components/progress-indicator/check-props.js.map +1 -0
  157. package/dist/es/components/progress-indicator/index.js +80 -38
  158. package/dist/es/components/progress-indicator/index.js.map +1 -1
  159. package/dist/es/components/progress-indicator/private/path.js +95 -0
  160. package/dist/es/components/progress-indicator/private/path.js.map +1 -0
  161. package/dist/es/components/progress-indicator/private/progress.js +1 -1
  162. package/dist/es/components/progress-indicator/private/progress.js.map +1 -1
  163. package/dist/es/components/progress-indicator/private/use-roving-tab-index.js +29 -0
  164. package/dist/es/components/progress-indicator/private/use-roving-tab-index.js.map +1 -0
  165. package/dist/es/components/progress-ring/index.js +8 -8
  166. package/dist/es/components/progress-ring/index.js.map +1 -1
  167. package/dist/es/components/simple-data-table/index.js +67 -69
  168. package/dist/es/components/simple-data-table/index.js.map +1 -1
  169. package/dist/es/components/tooltip/index.js +90 -84
  170. package/dist/es/components/tooltip/index.js.map +1 -1
  171. package/dist/es/components/tree/index.js +2 -0
  172. package/dist/es/components/tree.js +2 -0
  173. package/dist/es/utilities/constants.js +2 -2
  174. package/dist/es/utilities/constants.js.map +1 -1
  175. package/dist/es/utilities/hooks/index.js +2 -0
  176. package/dist/es/utilities/hooks.js +1 -0
  177. package/dist/es/utilities/warning/incompatible-props.js +19 -0
  178. package/dist/es/utilities/warning/incompatible-props.js.map +1 -0
  179. package/dist/types/components/accordion/index.d.ts.map +1 -1
  180. package/dist/types/components/alert/index.d.ts.map +1 -1
  181. package/dist/types/components/badge/index.d.ts +1 -1
  182. package/dist/types/components/badge/index.d.ts.map +1 -1
  183. package/dist/types/components/button/index.d.ts +5 -2
  184. package/dist/types/components/button/index.d.ts.map +1 -1
  185. package/dist/types/components/button-stateful/index.d.ts +2 -2
  186. package/dist/types/components/button-stateful/index.d.ts.map +1 -1
  187. package/dist/types/components/progress-indicator/check-props.d.ts +3 -0
  188. package/dist/types/components/progress-indicator/check-props.d.ts.map +1 -0
  189. package/dist/types/components/progress-indicator/index.d.ts +39 -8
  190. package/dist/types/components/progress-indicator/index.d.ts.map +1 -1
  191. package/dist/types/components/progress-indicator/private/path.d.ts +48 -0
  192. package/dist/types/components/progress-indicator/private/path.d.ts.map +1 -0
  193. package/dist/types/components/progress-indicator/private/progress.d.ts.map +1 -1
  194. package/dist/types/components/progress-indicator/private/use-roving-tab-index.d.ts +41 -0
  195. package/dist/types/components/progress-indicator/private/use-roving-tab-index.d.ts.map +1 -0
  196. package/dist/types/components/simple-data-table/index.d.ts.map +1 -1
  197. package/dist/types/components/tooltip/index.d.ts +10 -1
  198. package/dist/types/components/tooltip/index.d.ts.map +1 -1
  199. package/dist/types/utilities/constants.d.ts +1 -0
  200. package/dist/types/utilities/constants.d.ts.map +1 -1
  201. package/dist/types/utilities/hooks/index.d.ts +1 -1
  202. package/dist/types/utilities/hooks/index.d.ts.map +1 -1
  203. package/dist/types/utilities/hooks.d.ts +0 -1
  204. package/dist/types/utilities/sample-data/global-navigation-bar.d.ts +0 -1
  205. package/dist/types/utilities/sample-data/vertical-navigation.d.ts +0 -1
  206. package/dist/types/utilities/warning/incompatible-props.d.ts.map +1 -1
  207. package/package.json +4 -3
  208. package/dist/cjs/utilities/design-tokens/dist/palette-colors.common.cjs +0 -2
  209. package/dist/cjs/utilities/design-tokens/dist/palette-colors.common.cjs.map +0 -1
  210. package/dist/cjs/utilities/design-tokens/dist/salesforce-skin.common.cjs +0 -2
  211. package/dist/cjs/utilities/design-tokens/dist/salesforce-skin.common.cjs.map +0 -1
  212. package/dist/es/utilities/design-tokens/dist/palette-colors.common.js +0 -6
  213. package/dist/es/utilities/design-tokens/dist/palette-colors.common.js.map +0 -1
  214. package/dist/es/utilities/design-tokens/dist/salesforce-skin.common.js +0 -286
  215. package/dist/es/utilities/design-tokens/dist/salesforce-skin.common.js.map +0 -1
  216. package/dist/types/utilities/design-tokens/dist/analytics-cloud.common.d.ts +0 -81
  217. package/dist/types/utilities/design-tokens/dist/analytics-cloud.common.d.ts.map +0 -1
  218. package/dist/types/utilities/design-tokens/dist/bg-actions.common.d.ts +0 -201
  219. package/dist/types/utilities/design-tokens/dist/bg-actions.common.d.ts.map +0 -1
  220. package/dist/types/utilities/design-tokens/dist/bg-custom.common.d.ts +0 -117
  221. package/dist/types/utilities/design-tokens/dist/bg-custom.common.d.ts.map +0 -1
  222. package/dist/types/utilities/design-tokens/dist/bg-icons.common.d.ts +0 -5
  223. package/dist/types/utilities/design-tokens/dist/bg-icons.common.d.ts.map +0 -1
  224. package/dist/types/utilities/design-tokens/dist/bg-standard.common.d.ts +0 -204
  225. package/dist/types/utilities/design-tokens/dist/bg-standard.common.d.ts.map +0 -1
  226. package/dist/types/utilities/design-tokens/dist/color-palettes.common.d.ts +0 -3
  227. package/dist/types/utilities/design-tokens/dist/color-palettes.common.d.ts.map +0 -1
  228. package/dist/types/utilities/design-tokens/dist/components.common.d.ts +0 -249
  229. package/dist/types/utilities/design-tokens/dist/components.common.d.ts.map +0 -1
  230. package/dist/types/utilities/design-tokens/dist/console-base.common.d.ts +0 -9
  231. package/dist/types/utilities/design-tokens/dist/console-base.common.d.ts.map +0 -1
  232. package/dist/types/utilities/design-tokens/dist/force-base.common.d.ts +0 -647
  233. package/dist/types/utilities/design-tokens/dist/force-base.common.d.ts.map +0 -1
  234. package/dist/types/utilities/design-tokens/dist/force-font-commons.common.d.ts +0 -14
  235. package/dist/types/utilities/design-tokens/dist/force-font-commons.common.d.ts.map +0 -1
  236. package/dist/types/utilities/design-tokens/dist/force-mq-commons.common.d.ts +0 -10
  237. package/dist/types/utilities/design-tokens/dist/force-mq-commons.common.d.ts.map +0 -1
  238. package/dist/types/utilities/design-tokens/dist/icon-paths.common.d.ts +0 -9
  239. package/dist/types/utilities/design-tokens/dist/icon-paths.common.d.ts.map +0 -1
  240. package/dist/types/utilities/design-tokens/dist/illustrations.common.d.ts +0 -7
  241. package/dist/types/utilities/design-tokens/dist/illustrations.common.d.ts.map +0 -1
  242. package/dist/types/utilities/design-tokens/dist/image-paths.common.d.ts +0 -12
  243. package/dist/types/utilities/design-tokens/dist/image-paths.common.d.ts.map +0 -1
  244. package/dist/types/utilities/design-tokens/dist/marketing-cloud.common.d.ts +0 -35
  245. package/dist/types/utilities/design-tokens/dist/marketing-cloud.common.d.ts.map +0 -1
  246. package/dist/types/utilities/design-tokens/dist/palette-colors.common.d.ts +0 -98
  247. package/dist/types/utilities/design-tokens/dist/palette-colors.common.d.ts.map +0 -1
  248. package/dist/types/utilities/design-tokens/dist/s1-base-large.common.d.ts +0 -15
  249. package/dist/types/utilities/design-tokens/dist/s1-base-large.common.d.ts.map +0 -1
  250. package/dist/types/utilities/design-tokens/dist/s1-base-medium.common.d.ts +0 -5
  251. package/dist/types/utilities/design-tokens/dist/s1-base-medium.common.d.ts.map +0 -1
  252. package/dist/types/utilities/design-tokens/dist/s1-base-small.common.d.ts +0 -11
  253. package/dist/types/utilities/design-tokens/dist/s1-base-small.common.d.ts.map +0 -1
  254. package/dist/types/utilities/design-tokens/dist/s1-base.common.d.ts +0 -21
  255. package/dist/types/utilities/design-tokens/dist/s1-base.common.d.ts.map +0 -1
  256. package/dist/types/utilities/design-tokens/dist/salesforce-skin.common.d.ts +0 -283
  257. package/dist/types/utilities/design-tokens/dist/salesforce-skin.common.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"popover.js","names":[],"sources":["../../../../components/popover/popover.tsx"],"sourcesContent":["/* eslint-disable max-lines */\n/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, {\n\tuseState,\n\tuseEffect,\n\tuseRef,\n\tuseCallback,\n\tuseId,\n\tuseContext,\n\ttype ReactNode,\n\ttype ReactElement,\n\ttype MouseEvent,\n\ttype KeyboardEvent,\n\ttype FocusEvent,\n\ttype CSSProperties,\n} from 'react';\nimport classNames from 'classnames';\n\nimport Button from '../button';\nimport MediaObject from '../media-object';\nimport Icon from '../icon';\nimport Dialog from '../utilities/dialog';\nimport keyboardNavigableDialog from '../../utilities/keyboard-navigable-dialog';\nimport KEYS from '../../utilities/key-code';\nimport { POPOVER } from '../../utilities/constants';\nimport { IconSettingsContext } from '../icon-settings';\n\nconst documentDefined = typeof document !== 'undefined';\n\n// Shared overlay element for click-outside detection over iframes\nconst overlay = documentDefined\n\t? document.createElement('span')\n\t: ({ style: {} } as HTMLSpanElement);\nif (documentDefined) {\n\toverlay.style.top = '0';\n\toverlay.style.left = '0';\n\toverlay.style.width = '100%';\n\toverlay.style.height = '100%';\n\toverlay.style.position = 'absolute';\n}\n\n// Track currently open popover for single-popover-at-a-time behavior\nlet currentOpenPopover: {\n\thandleClose: (\n\t\tevent: MouseEvent | KeyboardEvent | undefined,\n\t\tdata: { trigger: string; id: string }\n\t) => void;\n\tgetId: () => string;\n} | null = null;\n\n/**\n * Popover alignment options\n */\nexport type PopoverAlign =\n\t| 'top'\n\t| 'top left'\n\t| 'top right'\n\t| 'right'\n\t| 'right top'\n\t| 'right bottom'\n\t| 'bottom'\n\t| 'bottom left'\n\t| 'bottom right'\n\t| 'left'\n\t| 'left top'\n\t| 'left bottom';\n\n/**\n * Popover position options\n */\nexport type PopoverPosition = 'absolute' | 'overflowBoundaryElement' | 'relative';\n\n/**\n * Popover variant options\n */\nexport type PopoverVariant =\n\t| 'base'\n\t| 'error'\n\t| 'feature'\n\t| 'walkthrough'\n\t| 'walkthrough-action'\n\t| 'warning';\n\n/**\n * Assistive text for Popover\n */\nexport interface PopoverAssistiveText {\n\tcloseButton?: string;\n}\n\n/**\n * Props for the Popover component\n */\nexport interface PopoverProps {\n\t/** Alignment relative to trigger */\n\talign?: PopoverAlign;\n\t/** Accessibility labels */\n\tassistiveText?: PopoverAssistiveText;\n\t/** HTML id of heading for aria-labelledby */\n\tariaLabelledby?: string;\n\t/** Trigger element (first child) and optional other children */\n\tchildren: ReactNode;\n\t/** Popover body content */\n\tbody: ReactNode;\n\t/** CSS classes for body */\n\tclassNameBody?: string | string[] | Record<string, boolean>;\n\t/** CSS classes for footer */\n\tclassNameFooter?: string | string[] | Record<string, boolean>;\n\t/** @deprecated Use classNameFooter */\n\tfooterClassName?: string | string[] | Record<string, boolean>;\n\t/** CSS classes for popover container */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** CSS classes for contents wrapper */\n\tcontentsClassName?: string | string[] | Record<string, boolean>;\n\t/** Disable the popover */\n\tdisabled?: boolean;\n\t/** Footer content */\n\tfooter?: ReactNode;\n\t/** Footer styles */\n\tfooterStyle?: CSSProperties;\n\t/** Walkthrough footer actions */\n\tfooterWalkthroughActions?: ReactNode | ReactNode[];\n\t/** Hide close button */\n\thasNoCloseButton?: boolean;\n\t/** Hide nubbin/arrow */\n\thasNoNubbin?: boolean;\n\t/** Prevent position flipping */\n\thasStaticAlignment?: boolean;\n\t/** Remove trigger inline-block style */\n\thasNoTriggerStyles?: boolean;\n\t/** Popover heading */\n\theading?: ReactNode;\n\t/** Icon for feature variant */\n\ticon?: ReactNode;\n\t/** HTML id */\n\tid?: string;\n\t/** Controlled open state */\n\tisOpen?: boolean;\n\t/** Offset from target */\n\toffset?: string;\n\t/** Click handler */\n\tonClick?: (event: MouseEvent) => void;\n\t/** Close callback */\n\tonClose?: (\n\t\tevent: MouseEvent | KeyboardEvent | undefined,\n\t\tdata: { componentWillUnmount?: boolean }\n\t) => void;\n\t/** Focus handler */\n\tonFocus?: (event: FocusEvent) => void;\n\t/** Key down handler */\n\tonKeyDown?: (event: KeyboardEvent) => void;\n\t/** Mouse down handler */\n\tonMouseDown?: (event: MouseEvent) => void;\n\t/** Mouse enter handler */\n\tonMouseEnter?: (event: MouseEvent) => void;\n\t/** Mouse leave handler */\n\tonMouseLeave?: (event: MouseEvent) => void;\n\t/** Open callback */\n\tonOpen?: (event?: unknown, data?: { portal?: HTMLElement }) => void;\n\t/** Close request callback */\n\tonRequestClose?: (\n\t\tevent: MouseEvent | KeyboardEvent | undefined,\n\t\tdata: { trigger?: string }\n\t) => void;\n\t/** Custom target element getter */\n\tonRequestTargetElement?: () => HTMLElement | null;\n\t/** Open trigger type */\n\topenOn?: 'click' | 'hover' | 'hybrid';\n\t/** Overlay for click-outside on iframes */\n\toverlay?: boolean | ((isOpen: boolean, overlayElement: HTMLElement) => void);\n\t/** Positioning strategy */\n\tposition?: PopoverPosition;\n\t/** Walkthrough step text */\n\tstepText?: string;\n\t/** Custom styles */\n\tstyle?: CSSProperties;\n\t/** CSS classes for trigger wrapper */\n\ttriggerClassName?: string | string[] | Record<string, boolean>;\n\t/** Popover variant */\n\tvariant?: PopoverVariant;\n\t/** Delay before closing on hover (ms) */\n\thoverCloseDelay?: number;\n\t/** @deprecated Use assistiveText.closeButton */\n\tcloseButtonAssistiveText?: string;\n}\n\n// Nubbin positions for export (legacy)\nexport const PopoverNubbinPositions = [\n\t'top left',\n\t'top',\n\t'top right',\n\t'bottom left',\n\t'bottom',\n\t'bottom right',\n];\n\nconst defaultAssistiveText: PopoverAssistiveText = {\n\tcloseButton: 'Close dialog',\n};\n\n/**\n * The Popover component is a non-modal dialog. It should be paired with a clickable\n * trigger such as a Button. It traps focus from the page and must be exited if focus\n * needs to be outside the Popover.\n */\nconst Popover = ({\n\talign = 'right',\n\tassistiveText: propAssistiveText,\n\tariaLabelledby,\n\tchildren,\n\tbody,\n\tclassNameBody,\n\tclassNameFooter,\n\tfooterClassName,\n\tclassName,\n\tcontentsClassName,\n\tdisabled = false,\n\tfooter,\n\tfooterStyle,\n\tfooterWalkthroughActions,\n\thasNoCloseButton = false,\n\thasNoNubbin = false,\n\thasStaticAlignment = false,\n\thasNoTriggerStyles = false,\n\theading,\n\ticon,\n\tid: propId,\n\tisOpen: controlledIsOpen,\n\toffset,\n\tonClick,\n\tonClose,\n\tonFocus,\n\tonKeyDown,\n\tonMouseDown,\n\tonMouseEnter,\n\tonMouseLeave,\n\tonOpen,\n\tonRequestClose,\n\tonRequestTargetElement,\n\topenOn = 'click',\n\toverlay: overlayProp,\n\tposition = 'absolute',\n\tstepText,\n\tstyle,\n\ttriggerClassName,\n\tvariant = 'base',\n\thoverCloseDelay = 300,\n\tcloseButtonAssistiveText,\n}: PopoverProps): ReactElement => {\n\tconst generatedId = useId();\n\tconst id = propId || generatedId;\n\tconst context = useContext(IconSettingsContext);\n\n\tconst assistiveText = { ...defaultAssistiveText, ...propAssistiveText };\n\tconst finalCloseButtonAssistiveText =\n\t\tcloseButtonAssistiveText || assistiveText.closeButton;\n\n\t// State\n\tconst [internalIsOpen, setInternalIsOpen] = useState(false);\n\tconst [inputRendered, setInputRendered] = useState(false);\n\n\t// Refs\n\tconst triggerRef = useRef<HTMLDivElement>(null);\n\tconst dialogRef = useRef<HTMLElement>(null);\n\tconst isHoverRef = useRef(false);\n\tconst isClosingRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\tconst overlayRef = useRef<HTMLSpanElement | null>(null);\n\tconst isUnmountingRef = useRef(false);\n\n\t// Derived state\n\tconst isOpen =\n\t\t!disabled &&\n\t\t(controlledIsOpen !== undefined ? controlledIsOpen : internalIsOpen);\n\n\t// Get target element for positioning\n\tconst getTargetElement = useCallback(() => {\n\t\tif (onRequestTargetElement) {\n\t\t\tconst target = onRequestTargetElement();\n\t\t\tif (target) return target;\n\t\t}\n\t\treturn triggerRef.current;\n\t}, [onRequestTargetElement]);\n\n\t// Handle dialog close (when unmounted)\n\tconst handleDialogClose = useCallback(\n\t\t(\n\t\t\tevent?: React.MouseEvent | React.KeyboardEvent | MouseEvent | KeyboardEvent,\n\t\t\tdata?: { componentWillUnmount?: boolean }\n\t\t) => {\n\t\t\tconst componentWillUnmount = data?.componentWillUnmount || false;\n\n\t\t\tif (currentOpenPopover?.getId() === id) {\n\t\t\t\tcurrentOpenPopover = null;\n\t\t\t}\n\n\t\t\tif (onClose) {\n\t\t\t\tonClose(event, { componentWillUnmount });\n\t\t\t}\n\t\t},\n\t\t[id, onClose]\n\t);\n\n\t// Handle close\n\tconst handleClose = useCallback(\n\t\t(\n\t\t\tevent?: MouseEvent | KeyboardEvent,\n\t\t\tdata?: { trigger?: string }\n\t\t) => {\n\t\t\tif (isOpen) {\n\t\t\t\tif (onRequestClose) {\n\t\t\t\t\tonRequestClose(event, data || {});\n\t\t\t\t}\n\n\t\t\t\tif (currentOpenPopover?.getId() === id) {\n\t\t\t\t\tcurrentOpenPopover = null;\n\t\t\t\t}\n\n\t\t\t\tsetInternalIsOpen(false);\n\t\t\t\tisHoverRef.current = false;\n\t\t\t}\n\t\t},\n\t\t[isOpen, id, onRequestClose]\n\t);\n\n\t// Handle open\n\tconst handleOpen = useCallback(() => {\n\t\tif (!isOpen) {\n\t\t\t// Close any other open popover\n\t\t\tif (currentOpenPopover && currentOpenPopover.getId() !== id) {\n\t\t\t\tcurrentOpenPopover.handleClose(undefined, {\n\t\t\t\t\ttrigger: 'newPopover',\n\t\t\t\t\tid: currentOpenPopover.getId(),\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tcurrentOpenPopover = {\n\t\t\t\thandleClose: (event, data) => handleClose(event as MouseEvent | KeyboardEvent, data),\n\t\t\t\tgetId: () => id,\n\t\t\t};\n\n\t\t\tsetInternalIsOpen(true);\n\t\t}\n\t}, [isOpen, id, handleClose]);\n\n\t// Handle cancel (close button or escape)\n\tconst handleCancel = useCallback(\n\t\t(event: MouseEvent | KeyboardEvent) => {\n\t\t\thandleClose(event, { trigger: 'cancel' });\n\t\t},\n\t\t[handleClose]\n\t);\n\n\t// Handle click outside\n\tconst handleClickOutside = useCallback(\n\t\t(event: MouseEvent) => {\n\t\t\thandleClose(event, { trigger: 'clickOutside' });\n\t\t},\n\t\t[handleClose]\n\t);\n\n\t// Handle mouse enter\n\tconst handleMouseEnter = useCallback(\n\t\t(event: MouseEvent) => {\n\t\t\tisHoverRef.current = true;\n\n\t\t\tif (!isOpen && openOn === 'hover') {\n\t\t\t\thandleOpen();\n\t\t\t} else {\n\t\t\t\tif (isClosingRef.current) {\n\t\t\t\t\tclearTimeout(isClosingRef.current);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (onMouseEnter) {\n\t\t\t\tonMouseEnter(event);\n\t\t\t}\n\t\t},\n\t\t[isOpen, openOn, handleOpen, onMouseEnter]\n\t);\n\n\t// Handle mouse leave\n\tconst handleMouseLeave = useCallback(\n\t\t(event: MouseEvent) => {\n\t\t\tif (isOpen) {\n\t\t\t\tisClosingRef.current = setTimeout(() => {\n\t\t\t\t\thandleClose();\n\t\t\t\t}, hoverCloseDelay);\n\t\t\t}\n\n\t\t\tif (onMouseLeave) {\n\t\t\t\tonMouseLeave(event);\n\t\t\t}\n\t\t},\n\t\t[isOpen, hoverCloseDelay, handleClose, onMouseLeave]\n\t);\n\n\t// Handle click\n\tconst handleClick = useCallback(\n\t\t(event: MouseEvent, triggerOnClickCallback?: (e: MouseEvent) => void) => {\n\t\t\tif (!isOpen) {\n\t\t\t\thandleOpen();\n\t\t\t} else {\n\t\t\t\thandleClose(event);\n\t\t\t}\n\n\t\t\tif (onClick) {\n\t\t\t\tonClick(event);\n\t\t\t}\n\n\t\t\tif (triggerOnClickCallback) {\n\t\t\t\ttriggerOnClickCallback(event);\n\t\t\t}\n\t\t},\n\t\t[isOpen, handleOpen, handleClose, onClick]\n\t);\n\n\t// Handle focus\n\tconst handleFocus = useCallback(\n\t\t(event: FocusEvent) => {\n\t\t\tif (!isOpen) {\n\t\t\t\thandleOpen();\n\t\t\t}\n\n\t\t\tif (onFocus) {\n\t\t\t\tonFocus(event);\n\t\t\t}\n\t\t},\n\t\t[isOpen, handleOpen, onFocus]\n\t);\n\n\t// Toggle from keyboard\n\tconst toggleOpenFromKeyboard = useCallback(\n\t\t(event: KeyboardEvent) => {\n\t\t\tif (isOpen) {\n\t\t\t\thandleCancel(event);\n\t\t\t} else {\n\t\t\t\thandleOpen();\n\t\t\t}\n\t\t},\n\t\t[isOpen, handleCancel, handleOpen]\n\t);\n\n\t// Handle key down\n\tconst handleKeyDown = useCallback(\n\t\t(event: KeyboardEvent) => {\n\t\t\tif (event.keyCode) {\n\t\t\t\tif (event.keyCode !== KEYS.TAB) {\n\t\t\t\t\tkeyboardNavigableDialog({\n\t\t\t\t\t\tevent,\n\t\t\t\t\t\tisOpen,\n\t\t\t\t\t\thandleClick: (e: MouseEvent) => handleClick(e),\n\t\t\t\t\t\tkeyCode: event.keyCode,\n\t\t\t\t\t\teventTarget: event.target,\n\t\t\t\t\t\ttoggleOpen: toggleOpenFromKeyboard,\n\t\t\t\t\t\ttrigger: triggerRef.current,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tif (onKeyDown) {\n\t\t\t\t\tonKeyDown(event);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t[isOpen, handleClick, toggleOpenFromKeyboard, onKeyDown]\n\t);\n\n\t// Render overlay for click-outside detection\n\tconst renderOverlay = useCallback(\n\t\t(shouldShow: boolean) => {\n\t\t\tif (typeof overlayProp === 'function' && documentDefined) {\n\t\t\t\toverlayProp(shouldShow, overlay);\n\t\t\t} else if (overlayProp && shouldShow && !overlayRef.current && documentDefined) {\n\t\t\t\toverlayRef.current = overlay;\n\t\t\t\tdocument.querySelector('body')?.appendChild(overlay);\n\t\t\t} else if (!shouldShow && overlayRef.current?.parentNode) {\n\t\t\t\toverlayRef.current.parentNode.removeChild(overlayRef.current);\n\t\t\t\toverlayRef.current = null;\n\t\t\t}\n\t\t},\n\t\t[overlayProp]\n\t);\n\n\t// Container ref callback\n\tconst setContainerRef = useCallback((component: HTMLDivElement | null) => {\n\t\t(triggerRef as React.MutableRefObject<HTMLDivElement | null>).current = component;\n\t\tif (component && !inputRendered) {\n\t\t\tsetInputRendered(true);\n\t\t}\n\t}, [inputRendered]);\n\n\t// Dialog ref callback\n\tconst setMenuRef = useCallback((component: HTMLElement | null) => {\n\t\t(dialogRef as React.MutableRefObject<HTMLElement | null>).current = component;\n\t}, []);\n\n\t// Cleanup on unmount\n\tuseEffect(() => {\n\t\treturn () => {\n\t\t\tisUnmountingRef.current = true;\n\t\t\tif (currentOpenPopover?.getId() === id) {\n\t\t\t\tcurrentOpenPopover = null;\n\t\t\t}\n\t\t\trenderOverlay(false);\n\t\t};\n\t}, [id, renderOverlay]);\n\n\t// Update overlay when isOpen changes\n\tuseEffect(() => {\n\t\trenderOverlay(isOpen);\n\t}, [isOpen, renderOverlay]);\n\n\t// Render header\n\tconst renderHeader = () => {\n\t\tconst hasThemedHeader = variant === 'error' || variant === 'warning';\n\t\tconst hasDefinedHeader = heading || hasThemedHeader;\n\n\t\tif (!hasDefinedHeader || variant === 'walkthrough-action' || variant === 'feature') {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst headerIcon = {\n\t\t\terror: <Icon category=\"utility\" name=\"error\" size=\"x-small\" inverse />,\n\t\t\twarning: <Icon category=\"utility\" name=\"warning\" size=\"x-small\" inverse />,\n\t\t};\n\n\t\tif (hasThemedHeader) {\n\t\t\treturn (\n\t\t\t\t<header className=\"slds-popover__header\">\n\t\t\t\t\t<MediaObject\n\t\t\t\t\t\tbody={\n\t\t\t\t\t\t\t<h2\n\t\t\t\t\t\t\t\tid={ariaLabelledby || `${id}-dialog-heading`}\n\t\t\t\t\t\t\t\tclassName=\"slds-truncate slds-text-heading_medium\"\n\t\t\t\t\t\t\t\ttitle={typeof heading === 'string' ? heading : undefined}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{heading}\n\t\t\t\t\t\t\t</h2>\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfigure={headerIcon[variant as 'error' | 'warning']}\n\t\t\t\t\t\tverticalCenter\n\t\t\t\t\t/>\n\t\t\t\t</header>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<header\n\t\t\t\tclassName={classNames('slds-popover__header', {\n\t\t\t\t\t'slds-p-vertical_medium': variant === 'walkthrough',\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t<h2\n\t\t\t\t\tid={ariaLabelledby || `${id}-dialog-heading`}\n\t\t\t\t\tclassName={classNames({\n\t\t\t\t\t\t'slds-text-heading_small': variant !== 'walkthrough',\n\t\t\t\t\t\t'slds-text-heading_medium': variant === 'walkthrough',\n\t\t\t\t\t})}\n\t\t\t\t>\n\t\t\t\t\t{heading}\n\t\t\t\t</h2>\n\t\t\t</header>\n\t\t);\n\t};\n\n\t// Render body\n\tconst renderBody = () => {\n\t\tif (variant === 'error' || variant === 'warning') {\n\t\t\treturn (\n\t\t\t\t<div\n\t\t\t\t\tid={`${id}-dialog-body`}\n\t\t\t\t\tclassName={classNames('slds-popover__body', classNameBody as string)}\n\t\t\t\t>\n\t\t\t\t\t{body}\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\n\t\tif (variant === 'walkthrough-action' || variant === 'feature') {\n\t\t\treturn (\n\t\t\t\t<div\n\t\t\t\t\tclassName={classNames('slds-popover__body', classNameBody as string)}\n\t\t\t\t\tid={`${id}-dialog-body`}\n\t\t\t\t>\n\t\t\t\t\t<div className=\"slds-media\">\n\t\t\t\t\t\t<div className=\"slds-media__figure\">\n\t\t\t\t\t\t\t{variant === 'walkthrough-action' ? (\n\t\t\t\t\t\t\t\t<Icon category=\"utility\" name=\"touch_action\" size=\"small\" inverse />\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\ticon\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div className=\"slds-media__body\">\n\t\t\t\t\t\t\t{heading && (\n\t\t\t\t\t\t\t\t<h2\n\t\t\t\t\t\t\t\t\tid={ariaLabelledby || `${id}-dialog-heading`}\n\t\t\t\t\t\t\t\t\tclassName=\"slds-text-heading_small\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{heading}\n\t\t\t\t\t\t\t\t</h2>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{body}\n\t\t\t\t\t\t\t{stepText && (\n\t\t\t\t\t\t\t\t<p className=\"slds-m-top_medium slds-text-title\">{stepText}</p>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tid={`${id}-dialog-body`}\n\t\t\t\tclassName={classNames('slds-popover__body', classNameBody as string)}\n\t\t\t>\n\t\t\t\t{body}\n\t\t\t</div>\n\t\t);\n\t};\n\n\t// Render footer\n\tconst renderFooter = () => {\n\t\tif (footer) {\n\t\t\treturn (\n\t\t\t\t<footer\n\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t'slds-popover__footer',\n\t\t\t\t\t\tclassNameFooter as string,\n\t\t\t\t\t\tfooterClassName as string\n\t\t\t\t\t)}\n\t\t\t\t\tstyle={footerStyle}\n\t\t\t\t>\n\t\t\t\t\t{footer}\n\t\t\t\t</footer>\n\t\t\t);\n\t\t}\n\n\t\tif (\n\t\t\tvariant !== 'walkthrough-action' &&\n\t\t\t(footerWalkthroughActions || stepText)\n\t\t) {\n\t\t\treturn (\n\t\t\t\t<footer className=\"slds-popover__footer\">\n\t\t\t\t\t<div className=\"slds-grid slds-grid_vertical-align-center\">\n\t\t\t\t\t\t{stepText && <span className=\"slds-text-title\">{stepText}</span>}\n\t\t\t\t\t\t{footerWalkthroughActions && (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tclassName=\"slds-col_bump-left\"\n\t\t\t\t\t\t\t\tstyle={{ display: 'inline-block' }}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{footerWalkthroughActions}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t</footer>\n\t\t\t);\n\t\t}\n\n\t\treturn null;\n\t};\n\n\t// Render dialog\n\tconst renderDialog = () => {\n\t\tif (!isOpen) return null;\n\n\t\tconst outsideClickIgnoreClass = `ignore-click-${id}`;\n\n\t\treturn (\n\t\t\t<Dialog\n\t\t\t\thasNubbin={!hasNoNubbin}\n\t\t\t\talign={align}\n\t\t\t\tcontentsClassName={classNames(\n\t\t\t\t\tcontentsClassName as string,\n\t\t\t\t\t'ignore-react-onclickoutside',\n\t\t\t\t\t'slds-popover',\n\t\t\t\t\t{ 'slds-popover_error': variant === 'error' },\n\t\t\t\t\t{\n\t\t\t\t\t\t'slds-popover_walkthrough':\n\t\t\t\t\t\t\tvariant === 'walkthrough' ||\n\t\t\t\t\t\t\tvariant === 'walkthrough-action' ||\n\t\t\t\t\t\t\tvariant === 'feature',\n\t\t\t\t\t},\n\t\t\t\t\t{ 'slds-popover_walkthrough-alt': variant === 'walkthrough-action' },\n\t\t\t\t\t{ 'slds-popover_feature': variant === 'feature' },\n\t\t\t\t\t{ 'slds-popover_warning': variant === 'warning' },\n\t\t\t\t\tclassName as string\n\t\t\t\t)}\n\t\t\t\tcontext={context}\n\t\t\t\thasStaticAlignment={hasStaticAlignment}\n\t\t\t\toffset={offset}\n\t\t\t\tonCancel={handleClose}\n\t\t\t\tonClose={handleDialogClose}\n\t\t\t\tonOpen={onOpen}\n\t\t\t\tonKeyDown={handleKeyDown}\n\t\t\t\tonMouseEnter={openOn === 'hover' ? handleMouseEnter : undefined}\n\t\t\t\tonMouseLeave={openOn === 'hover' ? handleMouseLeave : undefined}\n\t\t\t\toutsideClickIgnoreClass={outsideClickIgnoreClass}\n\t\t\t\tonRequestTargetElement={getTargetElement}\n\t\t\t\tposition={position}\n\t\t\t\tstyle={style}\n\t\t\t\tvariant=\"popover\"\n\t\t\t\tref={setMenuRef}\n\t\t\t\tcontainerProps={{\n\t\t\t\t\tid: `${id}-popover`,\n\t\t\t\t\t'aria-labelledby': ariaLabelledby || `${id}-dialog-heading`,\n\t\t\t\t\t'aria-describedby': `${id}-dialog-body`,\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t{!hasNoCloseButton && (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tassistiveText={{ icon: finalCloseButtonAssistiveText }}\n\t\t\t\t\t\ticonCategory=\"utility\"\n\t\t\t\t\t\ticonName=\"close\"\n\t\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t\t'slds-button slds-button_icon-small slds-float_right slds-popover__close slds-button_icon',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'slds-button_icon-inverse':\n\t\t\t\t\t\t\t\t\tvariant === 'walkthrough' ||\n\t\t\t\t\t\t\t\t\tvariant === 'walkthrough-action' ||\n\t\t\t\t\t\t\t\t\tvariant === 'feature',\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t)}\n\t\t\t\t\t\tonClick={handleCancel}\n\t\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t\t\tinverse={variant === 'error' || variant === 'warning'}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\t{renderHeader()}\n\t\t\t\t{renderBody()}\n\t\t\t\t{renderFooter()}\n\t\t\t</Dialog>\n\t\t);\n\t};\n\n\t// Clone trigger element\n\tconst otherChildren: ReactNode[] = [];\n\tlet clonedTrigger: ReactNode = null;\n\n\tReact.Children.forEach(children, (child, index) => {\n\t\tif (index === 0 && React.isValidElement(child)) {\n\t\t\tconst childProps = child.props as Record<string, unknown>;\n\t\t\tconst triggerProps: Record<string, unknown> = {\n\t\t\t\t'aria-haspopup': 'dialog',\n\t\t\t\tid,\n\t\t\t\tonClick:\n\t\t\t\t\topenOn === 'click' || openOn === 'hybrid'\n\t\t\t\t\t\t? (event: MouseEvent) => {\n\t\t\t\t\t\t\t\thandleClick(event, childProps.onClick as (e: MouseEvent) => void);\n\t\t\t\t\t\t }\n\t\t\t\t\t\t: childProps.onClick,\n\t\t\t\tonFocus: openOn === 'hover' ? handleFocus : undefined,\n\t\t\t\tonMouseDown,\n\t\t\t\tonMouseEnter:\n\t\t\t\t\topenOn === 'hover' || openOn === 'hybrid' ? handleMouseEnter : undefined,\n\t\t\t\tonMouseLeave:\n\t\t\t\t\topenOn === 'hover' || openOn === 'hybrid' ? handleMouseLeave : undefined,\n\t\t\t\ttabIndex: (childProps.tabIndex as number) || 0,\n\t\t\t};\n\t\t\tclonedTrigger = React.cloneElement(child, triggerProps);\n\t\t} else if (child) {\n\t\t\totherChildren.push(child);\n\t\t}\n\t});\n\n\tconst containerStyles: CSSProperties = {\n\t\tdisplay: hasNoTriggerStyles ? undefined : 'inline-block',\n\t};\n\n\treturn (\n\t\t<div\n\t\t\tclassName={triggerClassName as string}\n\t\t\tstyle={containerStyles}\n\t\t\tref={setContainerRef}\n\t\t>\n\t\t\t{clonedTrigger}\n\t\t\t{otherChildren.length > 0 ? otherChildren : null}\n\t\t\t{renderDialog()}\n\t\t</div>\n\t);\n};\n\nPopover.displayName = POPOVER;\n\nexport default Popover;\n\n"],"mappings":";;;;;;;;;;;;AA6BA,IAAM,IAAkB,OAAO,WAAa,KAGtC,IAAU,I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../../../components/popover/popover.tsx"],"sourcesContent":["/* eslint-disable max-lines */\n/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, {\n\tuseState,\n\tuseEffect,\n\tuseRef,\n\tuseCallback,\n\tuseId,\n\tuseContext,\n\ttype ReactNode,\n\ttype ReactElement,\n\ttype MouseEvent,\n\ttype KeyboardEvent,\n\ttype FocusEvent,\n\ttype CSSProperties,\n} from 'react';\nimport classNames from 'classnames';\n\nimport Button from '../button';\nimport MediaObject from '../media-object';\nimport Icon from '../icon';\nimport Dialog from '../utilities/dialog';\nimport keyboardNavigableDialog from '../../utilities/keyboard-navigable-dialog';\nimport KEYS from '../../utilities/key-code';\nimport { POPOVER } from '../../utilities/constants';\nimport { IconSettingsContext } from '../icon-settings';\n\nconst documentDefined = typeof document !== 'undefined';\n\n// Shared overlay element for click-outside detection over iframes\nconst overlay = documentDefined\n\t? document.createElement('span')\n\t: ({ style: {} } as HTMLSpanElement);\nif (documentDefined) {\n\toverlay.style.top = '0';\n\toverlay.style.left = '0';\n\toverlay.style.width = '100%';\n\toverlay.style.height = '100%';\n\toverlay.style.position = 'absolute';\n}\n\n// Track currently open popover for single-popover-at-a-time behavior\nlet currentOpenPopover: {\n\thandleClose: (\n\t\tevent: MouseEvent | KeyboardEvent | undefined,\n\t\tdata: { trigger: string; id: string }\n\t) => void;\n\tgetId: () => string;\n} | null = null;\n\n/**\n * Popover alignment options\n */\nexport type PopoverAlign =\n\t| 'top'\n\t| 'top left'\n\t| 'top right'\n\t| 'right'\n\t| 'right top'\n\t| 'right bottom'\n\t| 'bottom'\n\t| 'bottom left'\n\t| 'bottom right'\n\t| 'left'\n\t| 'left top'\n\t| 'left bottom';\n\n/**\n * Popover position options\n */\nexport type PopoverPosition = 'absolute' | 'overflowBoundaryElement' | 'relative';\n\n/**\n * Popover variant options\n */\nexport type PopoverVariant =\n\t| 'base'\n\t| 'error'\n\t| 'feature'\n\t| 'walkthrough'\n\t| 'walkthrough-action'\n\t| 'warning';\n\n/**\n * Assistive text for Popover\n */\nexport interface PopoverAssistiveText {\n\tcloseButton?: string;\n}\n\n/**\n * Props for the Popover component\n */\nexport interface PopoverProps {\n\t/** Alignment relative to trigger */\n\talign?: PopoverAlign;\n\t/** Accessibility labels */\n\tassistiveText?: PopoverAssistiveText;\n\t/** HTML id of heading for aria-labelledby */\n\tariaLabelledby?: string;\n\t/** Trigger element (first child) and optional other children */\n\tchildren: ReactNode;\n\t/** Popover body content */\n\tbody: ReactNode;\n\t/** CSS classes for body */\n\tclassNameBody?: string | string[] | Record<string, boolean>;\n\t/** CSS classes for footer */\n\tclassNameFooter?: string | string[] | Record<string, boolean>;\n\t/** @deprecated Use classNameFooter */\n\tfooterClassName?: string | string[] | Record<string, boolean>;\n\t/** CSS classes for popover container */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** CSS classes for contents wrapper */\n\tcontentsClassName?: string | string[] | Record<string, boolean>;\n\t/** Disable the popover */\n\tdisabled?: boolean;\n\t/** Footer content */\n\tfooter?: ReactNode;\n\t/** Footer styles */\n\tfooterStyle?: CSSProperties;\n\t/** Walkthrough footer actions */\n\tfooterWalkthroughActions?: ReactNode | ReactNode[];\n\t/** Hide close button */\n\thasNoCloseButton?: boolean;\n\t/** Hide nubbin/arrow */\n\thasNoNubbin?: boolean;\n\t/** Prevent position flipping */\n\thasStaticAlignment?: boolean;\n\t/** Remove trigger inline-block style */\n\thasNoTriggerStyles?: boolean;\n\t/** Popover heading */\n\theading?: ReactNode;\n\t/** Icon for feature variant */\n\ticon?: ReactNode;\n\t/** HTML id */\n\tid?: string;\n\t/** Controlled open state */\n\tisOpen?: boolean;\n\t/** Offset from target */\n\toffset?: string;\n\t/** Click handler */\n\tonClick?: (event: MouseEvent) => void;\n\t/** Close callback */\n\tonClose?: (\n\t\tevent: MouseEvent | KeyboardEvent | undefined,\n\t\tdata: { componentWillUnmount?: boolean }\n\t) => void;\n\t/** Focus handler */\n\tonFocus?: (event: FocusEvent) => void;\n\t/** Key down handler */\n\tonKeyDown?: (event: KeyboardEvent) => void;\n\t/** Mouse down handler */\n\tonMouseDown?: (event: MouseEvent) => void;\n\t/** Mouse enter handler */\n\tonMouseEnter?: (event: MouseEvent) => void;\n\t/** Mouse leave handler */\n\tonMouseLeave?: (event: MouseEvent) => void;\n\t/** Open callback */\n\tonOpen?: (event?: unknown, data?: { portal?: HTMLElement }) => void;\n\t/** Close request callback */\n\tonRequestClose?: (\n\t\tevent: MouseEvent | KeyboardEvent | undefined,\n\t\tdata: { trigger?: string }\n\t) => void;\n\t/** Custom target element getter */\n\tonRequestTargetElement?: () => HTMLElement | null;\n\t/** Open trigger type */\n\topenOn?: 'click' | 'hover' | 'hybrid';\n\t/** Overlay for click-outside on iframes */\n\toverlay?: boolean | ((isOpen: boolean, overlayElement: HTMLElement) => void);\n\t/** Positioning strategy */\n\tposition?: PopoverPosition;\n\t/** Walkthrough step text */\n\tstepText?: string;\n\t/** Custom styles */\n\tstyle?: CSSProperties;\n\t/** CSS classes for trigger wrapper */\n\ttriggerClassName?: string | string[] | Record<string, boolean>;\n\t/** Popover variant */\n\tvariant?: PopoverVariant;\n\t/** Delay before closing on hover (ms) */\n\thoverCloseDelay?: number;\n\t/** @deprecated Use assistiveText.closeButton */\n\tcloseButtonAssistiveText?: string;\n}\n\n// Nubbin positions for export (legacy)\nexport const PopoverNubbinPositions = [\n\t'top left',\n\t'top',\n\t'top right',\n\t'bottom left',\n\t'bottom',\n\t'bottom right',\n];\n\nconst defaultAssistiveText: PopoverAssistiveText = {\n\tcloseButton: 'Close dialog',\n};\n\n/**\n * The Popover component is a non-modal dialog. It should be paired with a clickable\n * trigger such as a Button. It traps focus from the page and must be exited if focus\n * needs to be outside the Popover.\n */\nconst Popover = ({\n\talign = 'right',\n\tassistiveText: propAssistiveText,\n\tariaLabelledby,\n\tchildren,\n\tbody,\n\tclassNameBody,\n\tclassNameFooter,\n\tfooterClassName,\n\tclassName,\n\tcontentsClassName,\n\tdisabled = false,\n\tfooter,\n\tfooterStyle,\n\tfooterWalkthroughActions,\n\thasNoCloseButton = false,\n\thasNoNubbin = false,\n\thasStaticAlignment = false,\n\thasNoTriggerStyles = false,\n\theading,\n\ticon,\n\tid: propId,\n\tisOpen: controlledIsOpen,\n\toffset,\n\tonClick,\n\tonClose,\n\tonFocus,\n\tonKeyDown,\n\tonMouseDown,\n\tonMouseEnter,\n\tonMouseLeave,\n\tonOpen,\n\tonRequestClose,\n\tonRequestTargetElement,\n\topenOn = 'click',\n\toverlay: overlayProp,\n\tposition = 'absolute',\n\tstepText,\n\tstyle,\n\ttriggerClassName,\n\tvariant = 'base',\n\thoverCloseDelay = 300,\n\tcloseButtonAssistiveText,\n}: PopoverProps): ReactElement => {\n\tconst generatedId = useId();\n\tconst id = propId || generatedId;\n\tconst context = useContext(IconSettingsContext);\n\n\tconst assistiveText = { ...defaultAssistiveText, ...propAssistiveText };\n\tconst finalCloseButtonAssistiveText =\n\t\tcloseButtonAssistiveText || assistiveText.closeButton;\n\n\t// State\n\tconst [internalIsOpen, setInternalIsOpen] = useState(false);\n\tconst [inputRendered, setInputRendered] = useState(false);\n\n\t// Refs\n\tconst triggerRef = useRef<HTMLDivElement>(null);\n\tconst dialogRef = useRef<HTMLElement>(null);\n\tconst isHoverRef = useRef(false);\n\tconst isClosingRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\tconst overlayRef = useRef<HTMLSpanElement | null>(null);\n\tconst isUnmountingRef = useRef(false);\n\n\t// Derived state\n\tconst isOpen =\n\t\t!disabled &&\n\t\t(controlledIsOpen !== undefined ? controlledIsOpen : internalIsOpen);\n\n\t// Get target element for positioning\n\tconst getTargetElement = useCallback(() => {\n\t\tif (onRequestTargetElement) {\n\t\t\tconst target = onRequestTargetElement();\n\t\t\tif (target) return target;\n\t\t}\n\t\treturn triggerRef.current;\n\t}, [onRequestTargetElement]);\n\n\t// Handle dialog close (when unmounted)\n\tconst handleDialogClose = useCallback(\n\t\t(\n\t\t\tevent?: React.MouseEvent | React.KeyboardEvent | MouseEvent | KeyboardEvent,\n\t\t\tdata?: { componentWillUnmount?: boolean }\n\t\t) => {\n\t\t\tconst componentWillUnmount = data?.componentWillUnmount || false;\n\n\t\t\tif (currentOpenPopover?.getId() === id) {\n\t\t\t\tcurrentOpenPopover = null;\n\t\t\t}\n\n\t\t\tif (onClose) {\n\t\t\t\tonClose(event, { componentWillUnmount });\n\t\t\t}\n\t\t},\n\t\t[id, onClose]\n\t);\n\n\t// Handle close\n\tconst handleClose = useCallback(\n\t\t(\n\t\t\tevent?: MouseEvent | KeyboardEvent,\n\t\t\tdata?: { trigger?: string }\n\t\t) => {\n\t\t\tif (isOpen) {\n\t\t\t\tif (onRequestClose) {\n\t\t\t\t\tonRequestClose(event, data || {});\n\t\t\t\t}\n\n\t\t\t\tif (currentOpenPopover?.getId() === id) {\n\t\t\t\t\tcurrentOpenPopover = null;\n\t\t\t\t}\n\n\t\t\t\tsetInternalIsOpen(false);\n\t\t\t\tisHoverRef.current = false;\n\t\t\t}\n\t\t},\n\t\t[isOpen, id, onRequestClose]\n\t);\n\n\t// Handle open\n\tconst handleOpen = useCallback(() => {\n\t\tif (!isOpen) {\n\t\t\t// Close any other open popover\n\t\t\tif (currentOpenPopover && currentOpenPopover.getId() !== id) {\n\t\t\t\tcurrentOpenPopover.handleClose(undefined, {\n\t\t\t\t\ttrigger: 'newPopover',\n\t\t\t\t\tid: currentOpenPopover.getId(),\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tcurrentOpenPopover = {\n\t\t\t\thandleClose: (event, data) => handleClose(event as MouseEvent | KeyboardEvent, data),\n\t\t\t\tgetId: () => id,\n\t\t\t};\n\n\t\t\tsetInternalIsOpen(true);\n\t\t}\n\t}, [isOpen, id, handleClose]);\n\n\t// Handle cancel (close button or escape)\n\tconst handleCancel = useCallback(\n\t\t(event: MouseEvent | KeyboardEvent) => {\n\t\t\thandleClose(event, { trigger: 'cancel' });\n\t\t},\n\t\t[handleClose]\n\t);\n\n\t// Handle click outside\n\tconst handleClickOutside = useCallback(\n\t\t(event: MouseEvent) => {\n\t\t\thandleClose(event, { trigger: 'clickOutside' });\n\t\t},\n\t\t[handleClose]\n\t);\n\n\t// Handle mouse enter\n\tconst handleMouseEnter = useCallback(\n\t\t(event: MouseEvent) => {\n\t\t\tisHoverRef.current = true;\n\n\t\t\tif (!isOpen && openOn === 'hover') {\n\t\t\t\thandleOpen();\n\t\t\t} else {\n\t\t\t\tif (isClosingRef.current) {\n\t\t\t\t\tclearTimeout(isClosingRef.current);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (onMouseEnter) {\n\t\t\t\tonMouseEnter(event);\n\t\t\t}\n\t\t},\n\t\t[isOpen, openOn, handleOpen, onMouseEnter]\n\t);\n\n\t// Handle mouse leave\n\tconst handleMouseLeave = useCallback(\n\t\t(event: MouseEvent) => {\n\t\t\tif (isOpen) {\n\t\t\t\tisClosingRef.current = setTimeout(() => {\n\t\t\t\t\thandleClose();\n\t\t\t\t}, hoverCloseDelay);\n\t\t\t}\n\n\t\t\tif (onMouseLeave) {\n\t\t\t\tonMouseLeave(event);\n\t\t\t}\n\t\t},\n\t\t[isOpen, hoverCloseDelay, handleClose, onMouseLeave]\n\t);\n\n\t// Handle click\n\tconst handleClick = useCallback(\n\t\t(event: MouseEvent, triggerOnClickCallback?: (e: MouseEvent) => void) => {\n\t\t\tif (!isOpen) {\n\t\t\t\thandleOpen();\n\t\t\t} else {\n\t\t\t\thandleClose(event);\n\t\t\t}\n\n\t\t\tif (onClick) {\n\t\t\t\tonClick(event);\n\t\t\t}\n\n\t\t\tif (triggerOnClickCallback) {\n\t\t\t\ttriggerOnClickCallback(event);\n\t\t\t}\n\t\t},\n\t\t[isOpen, handleOpen, handleClose, onClick]\n\t);\n\n\t// Handle focus\n\tconst handleFocus = useCallback(\n\t\t(event: FocusEvent) => {\n\t\t\tif (!isOpen) {\n\t\t\t\thandleOpen();\n\t\t\t}\n\n\t\t\tif (onFocus) {\n\t\t\t\tonFocus(event);\n\t\t\t}\n\t\t},\n\t\t[isOpen, handleOpen, onFocus]\n\t);\n\n\t// Toggle from keyboard\n\tconst toggleOpenFromKeyboard = useCallback(\n\t\t(event: KeyboardEvent) => {\n\t\t\tif (isOpen) {\n\t\t\t\thandleCancel(event);\n\t\t\t} else {\n\t\t\t\thandleOpen();\n\t\t\t}\n\t\t},\n\t\t[isOpen, handleCancel, handleOpen]\n\t);\n\n\t// Handle key down\n\tconst handleKeyDown = useCallback(\n\t\t(event: KeyboardEvent) => {\n\t\t\tif (event.keyCode) {\n\t\t\t\tif (event.keyCode !== KEYS.TAB) {\n\t\t\t\t\tkeyboardNavigableDialog({\n\t\t\t\t\t\tevent,\n\t\t\t\t\t\tisOpen,\n\t\t\t\t\t\thandleClick: (e: MouseEvent) => handleClick(e),\n\t\t\t\t\t\tkeyCode: event.keyCode,\n\t\t\t\t\t\teventTarget: event.target,\n\t\t\t\t\t\ttoggleOpen: toggleOpenFromKeyboard,\n\t\t\t\t\t\ttrigger: triggerRef.current,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tif (onKeyDown) {\n\t\t\t\t\tonKeyDown(event);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t[isOpen, handleClick, toggleOpenFromKeyboard, onKeyDown]\n\t);\n\n\t// Render overlay for click-outside detection\n\tconst renderOverlay = useCallback(\n\t\t(shouldShow: boolean) => {\n\t\t\tif (typeof overlayProp === 'function' && documentDefined) {\n\t\t\t\toverlayProp(shouldShow, overlay);\n\t\t\t} else if (overlayProp && shouldShow && !overlayRef.current && documentDefined) {\n\t\t\t\toverlayRef.current = overlay;\n\t\t\t\tdocument.querySelector('body')?.appendChild(overlay);\n\t\t\t} else if (!shouldShow && overlayRef.current?.parentNode) {\n\t\t\t\toverlayRef.current.parentNode.removeChild(overlayRef.current);\n\t\t\t\toverlayRef.current = null;\n\t\t\t}\n\t\t},\n\t\t[overlayProp]\n\t);\n\n\t// Container ref callback\n\tconst setContainerRef = useCallback((component: HTMLDivElement | null) => {\n\t\t(triggerRef as React.MutableRefObject<HTMLDivElement | null>).current = component;\n\t\tif (component && !inputRendered) {\n\t\t\tsetInputRendered(true);\n\t\t}\n\t}, [inputRendered]);\n\n\t// Dialog ref callback\n\tconst setMenuRef = useCallback((component: HTMLElement | null) => {\n\t\t(dialogRef as React.MutableRefObject<HTMLElement | null>).current = component;\n\t}, []);\n\n\t// Cleanup on unmount\n\tuseEffect(() => {\n\t\treturn () => {\n\t\t\tisUnmountingRef.current = true;\n\t\t\tif (currentOpenPopover?.getId() === id) {\n\t\t\t\tcurrentOpenPopover = null;\n\t\t\t}\n\t\t\trenderOverlay(false);\n\t\t};\n\t}, [id, renderOverlay]);\n\n\t// Update overlay when isOpen changes\n\tuseEffect(() => {\n\t\trenderOverlay(isOpen);\n\t}, [isOpen, renderOverlay]);\n\n\t// Render header\n\tconst renderHeader = () => {\n\t\tconst hasThemedHeader = variant === 'error' || variant === 'warning';\n\t\tconst hasDefinedHeader = heading || hasThemedHeader;\n\n\t\tif (!hasDefinedHeader || variant === 'walkthrough-action' || variant === 'feature') {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst headerIcon = {\n\t\t\terror: <Icon category=\"utility\" name=\"error\" size=\"x-small\" inverse />,\n\t\t\twarning: <Icon category=\"utility\" name=\"warning\" size=\"x-small\" inverse />,\n\t\t};\n\n\t\tif (hasThemedHeader) {\n\t\t\treturn (\n\t\t\t\t<header className=\"slds-popover__header\">\n\t\t\t\t\t<MediaObject\n\t\t\t\t\t\tbody={\n\t\t\t\t\t\t\t<h2\n\t\t\t\t\t\t\t\tid={ariaLabelledby || `${id}-dialog-heading`}\n\t\t\t\t\t\t\t\tclassName=\"slds-truncate slds-text-heading_medium\"\n\t\t\t\t\t\t\t\ttitle={typeof heading === 'string' ? heading : undefined}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{heading}\n\t\t\t\t\t\t\t</h2>\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfigure={headerIcon[variant as 'error' | 'warning']}\n\t\t\t\t\t\tverticalCenter\n\t\t\t\t\t/>\n\t\t\t\t</header>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<header\n\t\t\t\tclassName={classNames('slds-popover__header', {\n\t\t\t\t\t'slds-p-vertical_medium': variant === 'walkthrough',\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t<h2\n\t\t\t\t\tid={ariaLabelledby || `${id}-dialog-heading`}\n\t\t\t\t\tclassName={classNames({\n\t\t\t\t\t\t'slds-text-heading_small': variant !== 'walkthrough',\n\t\t\t\t\t\t'slds-text-heading_medium': variant === 'walkthrough',\n\t\t\t\t\t})}\n\t\t\t\t>\n\t\t\t\t\t{heading}\n\t\t\t\t</h2>\n\t\t\t</header>\n\t\t);\n\t};\n\n\t// Render body\n\tconst renderBody = () => {\n\t\tif (variant === 'error' || variant === 'warning') {\n\t\t\treturn (\n\t\t\t\t<div\n\t\t\t\t\tid={`${id}-dialog-body`}\n\t\t\t\t\tclassName={classNames('slds-popover__body', classNameBody as string)}\n\t\t\t\t>\n\t\t\t\t\t{body}\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\n\t\tif (variant === 'walkthrough-action' || variant === 'feature') {\n\t\t\treturn (\n\t\t\t\t<div\n\t\t\t\t\tclassName={classNames('slds-popover__body', classNameBody as string)}\n\t\t\t\t\tid={`${id}-dialog-body`}\n\t\t\t\t>\n\t\t\t\t\t<div className=\"slds-media\">\n\t\t\t\t\t\t<div className=\"slds-media__figure\">\n\t\t\t\t\t\t\t{variant === 'walkthrough-action' ? (\n\t\t\t\t\t\t\t\t<Icon category=\"utility\" name=\"touch_action\" size=\"small\" inverse />\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\ticon\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div className=\"slds-media__body\">\n\t\t\t\t\t\t\t{heading && (\n\t\t\t\t\t\t\t\t<h2\n\t\t\t\t\t\t\t\t\tid={ariaLabelledby || `${id}-dialog-heading`}\n\t\t\t\t\t\t\t\t\tclassName=\"slds-text-heading_small\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{heading}\n\t\t\t\t\t\t\t\t</h2>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{body}\n\t\t\t\t\t\t\t{stepText && (\n\t\t\t\t\t\t\t\t<p className=\"slds-m-top_medium slds-text-title\">{stepText}</p>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tid={`${id}-dialog-body`}\n\t\t\t\tclassName={classNames('slds-popover__body', classNameBody as string)}\n\t\t\t>\n\t\t\t\t{body}\n\t\t\t</div>\n\t\t);\n\t};\n\n\t// Render footer\n\tconst renderFooter = () => {\n\t\tif (footer) {\n\t\t\treturn (\n\t\t\t\t<footer\n\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t'slds-popover__footer',\n\t\t\t\t\t\tclassNameFooter as string,\n\t\t\t\t\t\tfooterClassName as string\n\t\t\t\t\t)}\n\t\t\t\t\tstyle={footerStyle}\n\t\t\t\t>\n\t\t\t\t\t{footer}\n\t\t\t\t</footer>\n\t\t\t);\n\t\t}\n\n\t\tif (\n\t\t\tvariant !== 'walkthrough-action' &&\n\t\t\t(footerWalkthroughActions || stepText)\n\t\t) {\n\t\t\treturn (\n\t\t\t\t<footer className=\"slds-popover__footer\">\n\t\t\t\t\t<div className=\"slds-grid slds-grid_vertical-align-center\">\n\t\t\t\t\t\t{stepText && <span className=\"slds-text-title\">{stepText}</span>}\n\t\t\t\t\t\t{footerWalkthroughActions && (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tclassName=\"slds-col_bump-left\"\n\t\t\t\t\t\t\t\tstyle={{ display: 'inline-block' }}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{footerWalkthroughActions}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t</footer>\n\t\t\t);\n\t\t}\n\n\t\treturn null;\n\t};\n\n\t// Render dialog\n\tconst renderDialog = () => {\n\t\tif (!isOpen) return null;\n\n\t\tconst outsideClickIgnoreClass = `ignore-click-${id}`;\n\n\t\treturn (\n\t\t\t<Dialog\n\t\t\t\thasNubbin={!hasNoNubbin}\n\t\t\t\talign={align}\n\t\t\t\tcontentsClassName={classNames(\n\t\t\t\t\tcontentsClassName as string,\n\t\t\t\t\t'ignore-react-onclickoutside',\n\t\t\t\t\t'slds-popover',\n\t\t\t\t\t{ 'slds-popover_error': variant === 'error' },\n\t\t\t\t\t{\n\t\t\t\t\t\t'slds-popover_walkthrough':\n\t\t\t\t\t\t\tvariant === 'walkthrough' ||\n\t\t\t\t\t\t\tvariant === 'walkthrough-action' ||\n\t\t\t\t\t\t\tvariant === 'feature',\n\t\t\t\t\t},\n\t\t\t\t\t{ 'slds-popover_walkthrough-alt': variant === 'walkthrough-action' },\n\t\t\t\t\t{ 'slds-popover_feature': variant === 'feature' },\n\t\t\t\t\t{ 'slds-popover_warning': variant === 'warning' },\n\t\t\t\t\tclassName as string\n\t\t\t\t)}\n\t\t\t\tcontext={context}\n\t\t\t\thasStaticAlignment={hasStaticAlignment}\n\t\t\t\toffset={offset}\n\t\t\t\tonCancel={handleClose}\n\t\t\t\tonClose={handleDialogClose}\n\t\t\t\tonOpen={onOpen}\n\t\t\t\tonKeyDown={handleKeyDown}\n\t\t\t\tonMouseEnter={openOn === 'hover' ? handleMouseEnter : undefined}\n\t\t\t\tonMouseLeave={openOn === 'hover' ? handleMouseLeave : undefined}\n\t\t\t\toutsideClickIgnoreClass={outsideClickIgnoreClass}\n\t\t\t\tonRequestTargetElement={getTargetElement}\n\t\t\t\tposition={position}\n\t\t\t\tstyle={style}\n\t\t\t\tvariant=\"popover\"\n\t\t\t\tref={setMenuRef}\n\t\t\t\tcontainerProps={{\n\t\t\t\t\tid: `${id}-popover`,\n\t\t\t\t\t'aria-labelledby': ariaLabelledby || `${id}-dialog-heading`,\n\t\t\t\t\t'aria-describedby': `${id}-dialog-body`,\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t{!hasNoCloseButton && (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tassistiveText={{ icon: finalCloseButtonAssistiveText }}\n\t\t\t\t\t\ticonCategory=\"utility\"\n\t\t\t\t\t\ticonName=\"close\"\n\t\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t\t'slds-button slds-button_icon-small slds-float_right slds-popover__close slds-button_icon',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'slds-button_icon-inverse':\n\t\t\t\t\t\t\t\t\tvariant === 'walkthrough' ||\n\t\t\t\t\t\t\t\t\tvariant === 'walkthrough-action' ||\n\t\t\t\t\t\t\t\t\tvariant === 'feature',\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t)}\n\t\t\t\t\t\tonClick={handleCancel}\n\t\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t\t\tinverse={variant === 'error' || variant === 'warning'}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\t{renderHeader()}\n\t\t\t\t{renderBody()}\n\t\t\t\t{renderFooter()}\n\t\t\t</Dialog>\n\t\t);\n\t};\n\n\t// Clone trigger element\n\tconst otherChildren: ReactNode[] = [];\n\tlet clonedTrigger: ReactNode = null;\n\n\tReact.Children.forEach(children, (child, index) => {\n\t\tif (index === 0 && React.isValidElement(child)) {\n\t\t\tconst childProps = child.props as Record<string, unknown>;\n\t\t\tconst triggerProps: Record<string, unknown> = {\n\t\t\t\t'aria-haspopup': 'dialog',\n\t\t\t\tid,\n\t\t\t\tonClick:\n\t\t\t\t\topenOn === 'click' || openOn === 'hybrid'\n\t\t\t\t\t\t? (event: MouseEvent) => {\n\t\t\t\t\t\t\t\thandleClick(event, childProps.onClick as (e: MouseEvent) => void);\n\t\t\t\t\t\t }\n\t\t\t\t\t\t: childProps.onClick,\n\t\t\t\tonFocus: openOn === 'hover' ? handleFocus : undefined,\n\t\t\t\tonMouseDown,\n\t\t\t\tonMouseEnter:\n\t\t\t\t\topenOn === 'hover' || openOn === 'hybrid' ? handleMouseEnter : undefined,\n\t\t\t\tonMouseLeave:\n\t\t\t\t\topenOn === 'hover' || openOn === 'hybrid' ? handleMouseLeave : undefined,\n\t\t\t\ttabIndex: (childProps.tabIndex as number) || 0,\n\t\t\t};\n\t\t\tclonedTrigger = React.cloneElement(child, triggerProps);\n\t\t} else if (child) {\n\t\t\totherChildren.push(child);\n\t\t}\n\t});\n\n\tconst containerStyles: CSSProperties = {\n\t\tdisplay: hasNoTriggerStyles ? undefined : 'inline-block',\n\t};\n\n\treturn (\n\t\t<div\n\t\t\tclassName={triggerClassName as string}\n\t\t\tstyle={containerStyles}\n\t\t\tref={setContainerRef}\n\t\t>\n\t\t\t{clonedTrigger}\n\t\t\t{otherChildren.length > 0 ? otherChildren : null}\n\t\t\t{renderDialog()}\n\t\t</div>\n\t);\n};\n\nPopover.displayName = POPOVER;\n\nexport default Popover;\n\n"],"mappings":";;;;;;;;;;;;AA6BA,IAAM,IAAkB,OAAO,WAAa,KAGtC,IAAU,IACb,SAAS,cAAc,MAAM,IAC5B,EAAE,OAAO,CAAC,EAAE;AACZ,MACH,EAAQ,MAAM,MAAM,KACpB,EAAQ,MAAM,OAAO,KACrB,EAAQ,MAAM,QAAQ,QACtB,EAAQ,MAAM,SAAS,QACvB,EAAQ,MAAM,WAAW;AAI1B,IAAI,IAMO,MA2IE,IAAyB;CACrC;CACA;CACA;CACA;CACA;CACA;AACD,GAEM,KAA6C,EAClD,aAAa,eACd,GAOM,KAAW,EAChB,WAAQ,SACR,eAAe,GACf,mBACA,cACA,SACA,kBACA,qBACA,qBACA,eACA,uBACA,eAAW,IACX,WACA,iBACA,6BACA,uBAAmB,IACnB,kBA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AS;KACT,SAAQ;KACR,SAAS,MAAY,WAAW,MAAY;IAC5C,CAAA;IAED,GAAa;IACb,GAAW;IACX,GAAa;GACP;;CAEV,GAGM,IAA6B,CAAC,GAChC,IAA2B;CAgC/B,OA9BA,EAAM,SAAS,QAAQ,KAAW,GAAO,MAAU;EAClD,IAAI,MAAU,KAAK,EAAM,eAAe,CAAK,GAAG;GAC/C,IAAM,IAAa,EAAM,OACnB,IAAwC;IAC7C,iBAAiB;IACjB;IACA,SACC,MAAW,WAAW,MAAW,YAC7B,MAAsB;KACvB,EAAY,GAAO,EAAW,OAAkC;IAChE,IACA,EAAW;IACf,SAAS,MAAW,UAAU,KAAc,KAAA;IAC5C;IACA,cACC,MAAW,WAAW,MAAW,WAAW,IAAmB,KAAA;IAChE,cACC,MAAW,WAAW,MAAW,WAAW,IAAmB,KAAA;IAChE,UAAW,EAAW,YAAuB;GAC9C;GACA,IAAgB,EAAM,aAAa,GAAO,CAAY;EACvD,OAAO,AAAI,KACV,EAAc,KAAK,CAAK;CAE1B,CAAC,GAOA,kBAAC,OAAD;EACC,WAAW;EACX,OAAO,EANR,SAAS,KAAqB,KAAA,IAAY,eAMlC;EACP,KAAK;EAHN,UAAA;GAKE;GACA,EAAc,SAAS,IAAI,IAAgB;GAC3C,GAAa;EACV;;AAEP;AAEA,EAAQ,cAAc"}
@@ -0,0 +1,24 @@
1
+ import e from "../../utilities/warning/incompatible-props.js";
2
+ //#region components/progress-indicator/check-props.js
3
+ var t = function() {};
4
+ process.env.NODE_ENV !== "production" && (t = function(t, n) {
5
+ [
6
+ ["disabledSteps", null],
7
+ ["errorSteps", null],
8
+ ["orientation", ["vertical"]],
9
+ ["tooltipIsOpenSteps", null],
10
+ ["tooltipPosition", null],
11
+ ["variant", [
12
+ "modal",
13
+ "setup-assistant",
14
+ "shade"
15
+ ]]
16
+ ].forEach(([r, i]) => {
17
+ e(t, n, "type", ["path"], r, i, "Only `type=\"base\"` supports this prop.");
18
+ });
19
+ });
20
+ var n = t;
21
+ //#endregion
22
+ export { n as default };
23
+
24
+ //# sourceMappingURL=check-props.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check-props.js","names":[],"sources":["../../../../components/progress-indicator/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 incompatibleProps from '../../utilities/warning/incompatible-props';\n\nlet checkProps = function checkPropsFunction() {};\n\nif (process.env.NODE_ENV !== 'production') {\n\tcheckProps = function checkPropsFunction(COMPONENT, props) {\n\t\tconst comment = 'Only `type=\"base\"` supports this prop.';\n\t\tconst baseOnlyProps = [\n\t\t\t['disabledSteps', null],\n\t\t\t['errorSteps', null],\n\t\t\t['orientation', ['vertical']],\n\t\t\t['tooltipIsOpenSteps', null],\n\t\t\t['tooltipPosition', null],\n\t\t\t['variant', ['modal', 'setup-assistant', 'shade']],\n\t\t];\n\n\t\tbaseOnlyProps.forEach(([propName, values]) => {\n\t\t\tincompatibleProps(\n\t\t\t\tCOMPONENT,\n\t\t\t\tprops,\n\t\t\t\t'type',\n\t\t\t\t['path'],\n\t\t\t\tpropName,\n\t\t\t\tvalues,\n\t\t\t\tcomment\n\t\t\t);\n\t\t});\n\t};\n}\n\nexport default checkProps;\n"],"mappings":";;AAMA,IAAI,IAAa,WAA8B,CAAC;AAEhD,QAAA,IAAA,aAA6B,iBAC5B,IAAa,SAA4B,GAAW,GAAO;CAW1D;EARC,CAAC,iBAAiB,IAAI;EACtB,CAAC,cAAc,IAAI;EACnB,CAAC,eAAe,CAAC,UAAU,CAAC;EAC5B,CAAC,sBAAsB,IAAI;EAC3B,CAAC,mBAAmB,IAAI;EACxB,CAAC,WAAW;GAAC;GAAS;GAAmB;EAAO,CAAC;CAGlD,CAAA,CAAc,SAAS,CAAC,GAAU,OAAY;EAC7C,EACC,GACA,GACA,QACA,CAAC,MAAM,GACP,GACA,GACA,0CACD;CACD,CAAC;AACF;AAGD,IAAA,IAAe"}
@@ -2,11 +2,13 @@ import { PROGRESS_INDICATOR as e } from "../../utilities/constants.js";
2
2
  import t from "./private/step.js";
3
3
  import n from "./private/progress.js";
4
4
  import r from "./private/step-vertical.js";
5
- import { useId as i, useMemo as a } from "react";
6
- import { jsx as o } from "react/jsx-runtime";
7
- import s from "lodash.find";
5
+ import i from "./private/path.js";
6
+ import a from "./check-props.js";
7
+ import { useEffect as o, useId as s, useMemo as c } from "react";
8
+ import { jsx as l } from "react/jsx-runtime";
9
+ import u from "lodash.find";
8
10
  //#region components/progress-indicator/index.tsx
9
- var c = [
11
+ var d = [
10
12
  {
11
13
  id: 0,
12
14
  label: "tooltip label #1"
@@ -27,56 +29,96 @@ var c = [
27
29
  id: 4,
28
30
  label: "tooltip label #5"
29
31
  }
30
- ], l = {
32
+ ], f = {
33
+ completedStage: "Stage Complete",
31
34
  completedStep: "Completed",
35
+ currentStage: "Current Stage:",
32
36
  disabledStep: "Disabled",
33
37
  errorStep: "Error",
34
38
  step: "Step"
35
- };
36
- function u(e) {
39
+ }, p = { stageNameBefore: "Stage: " };
40
+ function m(e) {
37
41
  return e ? Array.isArray(e) && e.every((e) => e.label !== void 0) : !1;
38
42
  }
39
- function d(e, t) {
40
- return !e || !t ? !1 : !!s(Array.isArray(t) ? t : [t], (t) => t === e ? !0 : t.id !== void 0 && e.id !== void 0 ? t.id === e.id : JSON.stringify(t) === JSON.stringify(e));
43
+ function h(e, t) {
44
+ return !e || !t ? !1 : !!u(Array.isArray(t) ? t : [t], (t) => t === e ? !0 : t.id !== void 0 && e.id !== void 0 ? t.id === e.id : JSON.stringify(t) === JSON.stringify(e));
41
45
  }
42
- var f = ({ assistiveText: e, className: s, completedSteps: f = [], disabledSteps: p = [], errorSteps: m = [], id: h, orientation: g = "horizontal", onStepClick: _ = () => {}, onStepFocus: v = () => {}, selectedStep: y, steps: b, tooltipIsOpenSteps: x, tooltipPosition: S, variant: C = "base" }) => {
43
- let w = i(), T = h || w, E = {
44
- ...l,
45
- ...e
46
- }, D = u(b) ? b : c, O = a(() => {
46
+ var g = ({ assistiveText: u, className: g, completedSteps: _ = [], disabledSteps: v, errorSteps: y, id: b, labels: x, orientation: S = "horizontal", onStepClick: C = () => {}, onStepFocus: w = () => {}, selectedStep: T, steps: E, tooltipIsOpenSteps: D, tooltipPosition: O, type: k = "base", variant: A = "base" }) => {
47
+ let j = s(), M = b || j, N = {
48
+ ...f,
49
+ ...u
50
+ }, P = m(E) ? E : d, F = !!v?.length, I = !!y?.length, L = !!D?.length;
51
+ o(() => {
52
+ a(e, {
53
+ disabledSteps: F,
54
+ errorSteps: I,
55
+ orientation: S,
56
+ tooltipIsOpenSteps: L,
57
+ tooltipPosition: O,
58
+ type: k,
59
+ variant: A
60
+ });
61
+ }, [
62
+ F,
63
+ I,
64
+ L,
65
+ S,
66
+ O,
67
+ k,
68
+ A
69
+ ]);
70
+ let R = c(() => {
47
71
  let e = 0;
48
- for (let t = 0; t < D.length; t += 1) if (d(D[t], y)) {
72
+ for (let t = 0; t < P.length; t += 1) if (h(P[t], T)) {
49
73
  e = t;
50
74
  break;
51
75
  }
52
76
  return e;
53
- }, [D, y]), k = O === 0 ? "0" : `${100 * (O / (D.length - 1))}`, A = C === "setup-assistant" ? "vertical" : g, j = S || (C === "modal" ? "absolute" : "overflowBoundaryElement"), M = A === "vertical" ? r : t;
54
- return /* @__PURE__ */ o(n, {
55
- assistiveText: E,
56
- id: T,
57
- orientation: A,
58
- value: k,
59
- variant: C,
60
- className: s,
61
- children: D.map((e, t) => /* @__PURE__ */ o(M, {
62
- assistiveText: E,
63
- id: T,
77
+ }, [P, T]);
78
+ if (k === "path") return /* @__PURE__ */ l(i, {
79
+ assistiveText: N,
80
+ className: g,
81
+ selectedIndex: R,
82
+ id: M,
83
+ labels: {
84
+ ...p,
85
+ ...x
86
+ },
87
+ onStepClick: C,
88
+ onStepFocus: w,
89
+ steps: P.map((e) => ({
90
+ isCompleted: h(e, _),
91
+ isSelected: h(e, T),
92
+ step: e
93
+ }))
94
+ });
95
+ let z = v ?? [], B = y ?? [], V = R === 0 ? "0" : `${100 * (R / (P.length - 1))}`, H = A === "setup-assistant" ? "vertical" : S, U = O || (A === "modal" ? "absolute" : "overflowBoundaryElement"), W = H === "vertical" ? r : t;
96
+ return /* @__PURE__ */ l(n, {
97
+ assistiveText: N,
98
+ id: M,
99
+ orientation: H,
100
+ value: V,
101
+ variant: A,
102
+ className: g,
103
+ children: P.map((e, t) => /* @__PURE__ */ l(W, {
104
+ assistiveText: N,
105
+ id: M,
64
106
  index: t,
65
- isSelected: d(e, y),
66
- isDisabled: d(e, p),
67
- isError: d(e, m),
68
- isCompleted: d(e, f),
69
- onClick: _,
70
- onFocus: v,
107
+ isSelected: h(e, T),
108
+ isDisabled: h(e, z),
109
+ isError: h(e, B),
110
+ isCompleted: h(e, _),
111
+ onClick: C,
112
+ onFocus: w,
71
113
  step: e,
72
- tooltipIsOpen: d(e, x),
73
- tooltipPosition: j,
74
- variant: C
75
- }, `${T}-${e.id}`))
114
+ tooltipIsOpen: h(e, D),
115
+ tooltipPosition: U,
116
+ variant: A
117
+ }, `${M}-${e.id}`))
76
118
  });
77
119
  };
78
- f.displayName = e;
120
+ g.displayName = e;
79
121
  //#endregion
80
- export { f as default };
122
+ export { g as default };
81
123
 
82
124
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../components/progress-indicator/index.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, { useId, useMemo } from 'react';\nimport find from 'lodash.find';\nimport { PROGRESS_INDICATOR } from '../../utilities/constants';\n\n// Child components\nimport Step from './private/step';\nimport Progress from './private/progress';\nimport StepVertical from './private/step-vertical';\n\n/**\n * Progress indicator orientation\n */\nexport type ProgressIndicatorOrientation = 'horizontal' | 'vertical';\n\n/**\n * Progress indicator variant\n */\nexport type ProgressIndicatorVariant = 'base' | 'modal' | 'setup-assistant';\n\n/**\n * Tooltip position\n */\nexport type TooltipPosition = 'absolute' | 'overflowBoundaryElement' | 'relative';\n\n/**\n * Step object structure\n */\nexport interface ProgressStep {\n\t/** Unique identifier */\n\tid: string | number;\n\t/** Tooltip label */\n\tlabel: string;\n\t/** Optional assistive text override */\n\tassistiveText?: string;\n}\n\n/**\n * Assistive text for ProgressIndicator\n */\nexport interface ProgressIndicatorAssistiveText {\n\t/** Label for completed steps */\n\tcompletedStep?: string;\n\t/** Label for disabled steps */\n\tdisabledStep?: string;\n\t/** Label for error steps */\n\terrorStep?: string;\n\t/** Label for progress percentage */\n\tpercentage?: string;\n\t/** Label prefix for steps */\n\tstep?: string;\n}\n\n/**\n * Step event data\n */\nexport interface StepEventData {\n\tisCompleted: boolean;\n\tisDisabled: boolean;\n\tisError: boolean;\n\tisSelected: boolean;\n\tstep: ProgressStep;\n}\n\n/**\n * Props for the ProgressIndicator component\n */\nexport interface ProgressIndicatorProps {\n\t/** Assistive text for accessibility */\n\tassistiveText?: ProgressIndicatorAssistiveText;\n\t/** CSS classes */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** Array of completed step objects */\n\tcompletedSteps?: ProgressStep[];\n\t/** Array of disabled step objects */\n\tdisabledSteps?: ProgressStep[];\n\t/** Array of error step objects */\n\terrorSteps?: ProgressStep[];\n\t/** HTML id attribute */\n\tid?: string;\n\t/** Orientation (horizontal or vertical) */\n\torientation?: ProgressIndicatorOrientation;\n\t/** Click handler for steps */\n\tonStepClick?: (event: React.MouseEvent | React.KeyboardEvent, data: StepEventData) => void;\n\t/** Focus handler for steps */\n\tonStepFocus?: (event: React.FocusEvent, data: StepEventData) => void;\n\t/** Currently selected step */\n\tselectedStep: ProgressStep;\n\t/** Array of all steps */\n\tsteps: ProgressStep[];\n\t/** Steps with open tooltips (for development) */\n\ttooltipIsOpenSteps?: ProgressStep[];\n\t/** Tooltip position strategy */\n\ttooltipPosition?: TooltipPosition;\n\t/** Component variant */\n\tvariant?: ProgressIndicatorVariant;\n}\n\nconst defaultSteps: ProgressStep[] = [\n\t{ id: 0, label: 'tooltip label #1' },\n\t{ id: 1, label: 'tooltip label #2' },\n\t{ id: 2, label: 'tooltip label #3' },\n\t{ id: 3, label: 'tooltip label #4' },\n\t{ id: 4, label: 'tooltip label #5' },\n];\n\nconst defaultAssistiveText: ProgressIndicatorAssistiveText = {\n\tcompletedStep: 'Completed',\n\tdisabledStep: 'Disabled',\n\terrorStep: 'Error',\n\tstep: 'Step',\n};\n\n/**\n * Check if steps prop is valid\n */\nfunction checkSteps(steps?: ProgressStep[]): boolean {\n\tif (!steps) return false;\n\treturn Array.isArray(steps) && steps.every((step) => step.label !== undefined);\n}\n\n/**\n * Check if an item exists in an array of items\n */\nfunction findStep(item: ProgressStep | undefined, items: ProgressStep | ProgressStep[] | undefined): boolean {\n\tif (!item || !items) return false;\n\n\tconst itemsArray = !Array.isArray(items) ? [items] : items;\n\n\treturn Boolean(find(itemsArray, (arrayItem) => {\n\t\tif (arrayItem === item) return true;\n\t\tif (arrayItem.id !== undefined && item.id !== undefined) {\n\t\t\treturn arrayItem.id === item.id;\n\t\t}\n\t\treturn JSON.stringify(arrayItem) === JSON.stringify(item);\n\t}));\n}\n\n/**\n * Progress Indicator communicates to the user the progress of a particular process.\n */\nconst ProgressIndicator = ({\n\tassistiveText: propAssistiveText,\n\tclassName,\n\tcompletedSteps = [],\n\tdisabledSteps = [],\n\terrorSteps = [],\n\tid: propId,\n\torientation: propOrientation = 'horizontal',\n\tonStepClick = () => {},\n\tonStepFocus = () => {},\n\tselectedStep,\n\tsteps: propSteps,\n\ttooltipIsOpenSteps,\n\ttooltipPosition: propTooltipPosition,\n\tvariant = 'base',\n}: ProgressIndicatorProps): React.ReactElement => {\n\tconst generatedId = useId();\n\tconst id = propId || generatedId;\n\n\tconst assistiveText = { ...defaultAssistiveText, ...propAssistiveText };\n\tconst allSteps = checkSteps(propSteps) ? propSteps : defaultSteps;\n\n\t// Find current step index\n\tconst currentStepIndex = useMemo(() => {\n\t\tlet index = 0;\n\t\tfor (let i = 0; i < allSteps.length; i += 1) {\n\t\t\tif (findStep(allSteps[i], selectedStep)) {\n\t\t\t\tindex = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn index;\n\t}, [allSteps, selectedStep]);\n\n\t// Calculate progress value\n\tconst progressValue = currentStepIndex === 0\n\t\t? '0'\n\t\t: `${100 * (currentStepIndex / (allSteps.length - 1))}`;\n\n\t// Determine orientation\n\tconst orientation = variant === 'setup-assistant' ? 'vertical' : propOrientation;\n\n\t// Determine tooltip position\n\tconst tooltipPosition = propTooltipPosition || (variant === 'modal' ? 'absolute' : 'overflowBoundaryElement');\n\n\t// Select step component based on orientation\n\tconst StepComponent = (\n\t\torientation === 'vertical' ? StepVertical : Step\n\t) as React.ComponentType<\n\t\tReact.ComponentProps<typeof Step> & React.ComponentProps<typeof StepVertical>\n\t>;\n\n\treturn (\n\t\t<Progress\n\t\t\tassistiveText={assistiveText}\n\t\t\tid={id}\n\t\t\torientation={orientation}\n\t\t\tvalue={progressValue}\n\t\t\tvariant={variant}\n\t\t\tclassName={className}\n\t\t>\n\t\t\t{allSteps.map((step, i) => (\n\t\t\t\t<StepComponent\n\t\t\t\t\tkey={`${id}-${step.id}`}\n\t\t\t\t\tassistiveText={assistiveText}\n\t\t\t\t\tid={id}\n\t\t\t\t\tindex={i}\n\t\t\t\t\tisSelected={findStep(step, selectedStep)}\n\t\t\t\t\tisDisabled={findStep(step, disabledSteps)}\n\t\t\t\t\tisError={findStep(step, errorSteps)}\n\t\t\t\t\tisCompleted={findStep(step, completedSteps)}\n\t\t\t\t\tonClick={onStepClick}\n\t\t\t\t\tonFocus={onStepFocus}\n\t\t\t\t\tstep={step}\n\t\t\t\t\ttooltipIsOpen={findStep(step, tooltipIsOpenSteps)}\n\t\t\t\t\ttooltipPosition={tooltipPosition}\n\t\t\t\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AAc;EACtC,IAAI,IAAQ;EACZ,KAAK,IAAI,IAAI,GAAG,IAAI,EAAS,QAAQ,KAAK,GACzC,IAAI,EAAS,EAAS,IAAI,CAAY,GAAG;GACxC,IAAQ;GACR;EACD;EAED,OAAO;CACR,GAAG,CAAC,GAAU,CAAY,CAAC,GAGrB,IAAgB,MAAqB,IACxC,MACA,GAAG,OAAO,KAAoB,EAAS,SAAS,OAG7C,IAAc,MAAY,oBAAoB,aAAa,GAG3D,IAAkB,MAAwB,MAAY,UAAU,aAAa,4BAG7E,IACL,MAAgB,aAAa,IAAe;CAK7C,OACC,kBAAC,GAAD;EACgB;EACX;EACS;EACb,OAAO;EACE;EACE;EAEV,UAAA,EAAS,KAAK,GAAM,MACpB,kBAAC,GAAD;GAEgB;GACX;GACJ,OAAO;GACP,YAAY,EAAS,GAAM,CAAY;GACvC,YAAY,EAAS,GAAM,CAAa;GACxC,SAAS,EAAS,GAAM,CAAU;GAClC,aAAa,EAAS,GAAM,CAAc;GAC1C,SAAS;GACT,SAAS;GACH;GACN,eAAe,EAAS,GAAM,CAAkB;GAC/B;GACR;EACT,GAdK,GAAG,EAAG,GAAG,EAAK,IAcnB,CACD;CACQ,CAAA;AAEZ;AAEA,EAAkB,cAAc"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../components/progress-indicator/index.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, { useEffect, useId, useMemo } from 'react';\nimport find from 'lodash.find';\nimport { PROGRESS_INDICATOR } from '../../utilities/constants';\n\n// Child components\nimport Step from './private/step';\nimport Progress from './private/progress';\nimport StepVertical from './private/step-vertical';\nimport Path from './private/path';\n\n// This component's `checkProps` which issues warnings to developers about properties when in development mode\nimport checkProps from './check-props';\n\n/**\n * Progress indicator orientation\n */\nexport type ProgressIndicatorOrientation = 'horizontal' | 'vertical';\n\n/**\n * Progress indicator type\n */\nexport type ProgressIndicatorType = 'base' | 'path';\n\n/**\n * Progress indicator variant\n */\nexport type ProgressIndicatorVariant =\n\t'base' | 'modal' | 'setup-assistant' | 'shade';\n\n/**\n * Tooltip position\n */\nexport type TooltipPosition =\n\t'absolute' | 'overflowBoundaryElement' | 'relative';\n\n/**\n * Step object structure\n */\nexport interface ProgressStep {\n\t/** Unique identifier */\n\tid: string | number;\n\t/** Tooltip label */\n\tlabel: string;\n\t/** Optional assistive text override */\n\tassistiveText?: string;\n}\n\n/**\n * Assistive text for ProgressIndicator\n */\nexport interface ProgressIndicatorAssistiveText {\n\t/** `type=\"path\"` only: read before a completed stage's name. Defaults to `Stage Complete` */\n\tcompletedStage?: string;\n\t/** Label for completed steps */\n\tcompletedStep?: string;\n\t/** `type=\"path\"` only: read before the current stage's name. Defaults to `Current Stage:` */\n\tcurrentStage?: string;\n\t/** Label for disabled steps */\n\tdisabledStep?: string;\n\t/** Label for error steps */\n\terrorStep?: string;\n\t/** Label for progress percentage */\n\tpercentage?: string;\n\t/** Label prefix for steps */\n\tstep?: string;\n}\n\n/**\n * Text labels for ProgressIndicator\n */\nexport interface ProgressIndicatorLabels {\n\t/** `type=\"path\"` only: text before the current stage's name, which shows when the path collapses on narrow screens. Include any spacing between it and the name. Defaults to `Stage: ` */\n\tstageNameBefore?: React.ReactNode;\n\t/** `type=\"path\"` only: text after the current stage's name. Include any spacing between it and the name. */\n\tstageNameAfter?: React.ReactNode;\n}\n\n/**\n * Step event data\n */\nexport interface StepEventData {\n\tisCompleted: boolean;\n\tisDisabled: boolean;\n\tisError: boolean;\n\tisSelected: boolean;\n\tstep: ProgressStep;\n}\n\n/**\n * Props for the ProgressIndicator component\n */\nexport interface ProgressIndicatorProps {\n\t/** Assistive text for accessibility */\n\tassistiveText?: ProgressIndicatorAssistiveText;\n\t/** CSS classes */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** Array of completed step objects */\n\tcompletedSteps?: ProgressStep[];\n\t/** Array of disabled step objects. `type=\"base\"` only. */\n\tdisabledSteps?: ProgressStep[];\n\t/** Array of error step objects. `type=\"base\"` only. */\n\terrorSteps?: ProgressStep[];\n\t/** HTML id attribute */\n\tid?: string;\n\t/** **Text labels for internationalization** */\n\tlabels?: ProgressIndicatorLabels;\n\t/** Orientation (horizontal or vertical). `type=\"base\"` only. */\n\torientation?: ProgressIndicatorOrientation;\n\t/** Click handler for steps */\n\tonStepClick?: (\n\t\tevent: React.MouseEvent | React.KeyboardEvent,\n\t\tdata: StepEventData\n\t) => void;\n\t/** Focus handler for steps */\n\tonStepFocus?: (event: React.FocusEvent, data: StepEventData) => void;\n\t/** Currently selected step */\n\tselectedStep: ProgressStep;\n\t/** Array of all steps */\n\tsteps: ProgressStep[];\n\t/** Steps with open tooltips (for development). `type=\"base\"` only. */\n\ttooltipIsOpenSteps?: ProgressStep[];\n\t/** Tooltip position strategy. `type=\"base\"` only. */\n\ttooltipPosition?: TooltipPosition;\n\t/**\n\t * Visual pattern, like `type` on `lightning-progress-indicator`:\n\t * * `base` - (default) Step markers on a progress bar, with each step's label in a tooltip.\n\t * * `path` - SLDS Path, with each step's label shown in its stage. Use the arrow keys to move between stages. Completion comes from `completedSteps`; error, disabled, and tooltip props aren't supported.\n\t */\n\ttype?: ProgressIndicatorType;\n\t/**\n\t * Component variant. `type=\"base\"` only.\n\t * * `base` - (default) For white backgrounds.\n\t * * `shade` - For shaded backgrounds. Adds a light gray border to the step markers, like `variant=\"shade\"` on `lightning-progress-indicator`.\n\t * * `modal` - The `shade` styling, with tooltips positioned for a modal footer.\n\t * * `setup-assistant` - Vertical steps with a bordered list, for Setup Assistant.\n\t */\n\tvariant?: ProgressIndicatorVariant;\n}\n\nconst defaultSteps: ProgressStep[] = [\n\t{ id: 0, label: 'tooltip label #1' },\n\t{ id: 1, label: 'tooltip label #2' },\n\t{ id: 2, label: 'tooltip label #3' },\n\t{ id: 3, label: 'tooltip label #4' },\n\t{ id: 4, label: 'tooltip label #5' },\n];\n\nconst defaultAssistiveText: ProgressIndicatorAssistiveText = {\n\tcompletedStage: 'Stage Complete',\n\tcompletedStep: 'Completed',\n\tcurrentStage: 'Current Stage:',\n\tdisabledStep: 'Disabled',\n\terrorStep: 'Error',\n\tstep: 'Step',\n};\n\nconst defaultLabels: ProgressIndicatorLabels = {\n\tstageNameBefore: 'Stage: ',\n};\n\n/**\n * Check if steps prop is valid\n */\nfunction checkSteps(steps?: ProgressStep[]): boolean {\n\tif (!steps) return false;\n\treturn (\n\t\tArray.isArray(steps) && steps.every((step) => step.label !== undefined)\n\t);\n}\n\n/**\n * Check if an item exists in an array of items\n */\nfunction findStep(\n\titem: ProgressStep | undefined,\n\titems: ProgressStep | ProgressStep[] | undefined\n): boolean {\n\tif (!item || !items) return false;\n\n\tconst itemsArray = !Array.isArray(items) ? [items] : items;\n\n\treturn Boolean(\n\t\tfind(itemsArray, (arrayItem) => {\n\t\t\tif (arrayItem === item) return true;\n\t\t\tif (arrayItem.id !== undefined && item.id !== undefined) {\n\t\t\t\treturn arrayItem.id === item.id;\n\t\t\t}\n\t\t\treturn JSON.stringify(arrayItem) === JSON.stringify(item);\n\t\t})\n\t);\n}\n\n/**\n * Progress Indicator communicates to the user the progress of a particular process.\n */\nconst ProgressIndicator = ({\n\tassistiveText: propAssistiveText,\n\tclassName,\n\tcompletedSteps = [],\n\tdisabledSteps: propDisabledSteps,\n\terrorSteps: propErrorSteps,\n\tid: propId,\n\tlabels: propLabels,\n\torientation: propOrientation = 'horizontal',\n\tonStepClick = () => {},\n\tonStepFocus = () => {},\n\tselectedStep,\n\tsteps: propSteps,\n\ttooltipIsOpenSteps,\n\ttooltipPosition: propTooltipPosition,\n\ttype = 'base',\n\tvariant = 'base',\n}: ProgressIndicatorProps): React.ReactElement => {\n\tconst generatedId = useId();\n\tconst id = propId || generatedId;\n\n\tconst assistiveText = { ...defaultAssistiveText, ...propAssistiveText };\n\tconst allSteps = checkSteps(propSteps) ? propSteps : defaultSteps;\n\n\t// Check props in development. Pass whether each step array has items, not the array itself, so that\n\t// an empty array doesn't count as passed and a new array on each render doesn't re-run the check.\n\tconst hasDisabledSteps = Boolean(propDisabledSteps?.length);\n\tconst hasErrorSteps = Boolean(propErrorSteps?.length);\n\tconst hasTooltipIsOpenSteps = Boolean(tooltipIsOpenSteps?.length);\n\tuseEffect(() => {\n\t\tcheckProps(PROGRESS_INDICATOR, {\n\t\t\tdisabledSteps: hasDisabledSteps,\n\t\t\terrorSteps: hasErrorSteps,\n\t\t\torientation: propOrientation,\n\t\t\ttooltipIsOpenSteps: hasTooltipIsOpenSteps,\n\t\t\ttooltipPosition: propTooltipPosition,\n\t\t\ttype,\n\t\t\tvariant,\n\t\t});\n\t}, [\n\t\thasDisabledSteps,\n\t\thasErrorSteps,\n\t\thasTooltipIsOpenSteps,\n\t\tpropOrientation,\n\t\tpropTooltipPosition,\n\t\ttype,\n\t\tvariant,\n\t]);\n\n\t// Find current step index\n\tconst currentStepIndex = useMemo(() => {\n\t\tlet index = 0;\n\t\tfor (let i = 0; i < allSteps.length; i += 1) {\n\t\t\tif (findStep(allSteps[i], selectedStep)) {\n\t\t\t\tindex = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn index;\n\t}, [allSteps, selectedStep]);\n\n\tif (type === 'path') {\n\t\treturn (\n\t\t\t<Path\n\t\t\t\tassistiveText={assistiveText}\n\t\t\t\tclassName={className}\n\t\t\t\tselectedIndex={currentStepIndex}\n\t\t\t\tid={id}\n\t\t\t\tlabels={{ ...defaultLabels, ...propLabels }}\n\t\t\t\tonStepClick={onStepClick}\n\t\t\t\tonStepFocus={onStepFocus}\n\t\t\t\tsteps={allSteps.map((step) => ({\n\t\t\t\t\tisCompleted: findStep(step, completedSteps),\n\t\t\t\t\tisSelected: findStep(step, selectedStep),\n\t\t\t\t\tstep,\n\t\t\t\t}))}\n\t\t\t/>\n\t\t);\n\t}\n\n\tconst disabledSteps = propDisabledSteps ?? [];\n\tconst errorSteps = propErrorSteps ?? [];\n\n\t// Calculate progress value\n\tconst progressValue =\n\t\tcurrentStepIndex === 0\n\t\t\t? '0'\n\t\t\t: `${100 * (currentStepIndex / (allSteps.length - 1))}`;\n\n\t// Determine orientation\n\tconst orientation =\n\t\tvariant === 'setup-assistant' ? 'vertical' : propOrientation;\n\n\t// Determine tooltip position\n\tconst tooltipPosition =\n\t\tpropTooltipPosition ||\n\t\t(variant === 'modal' ? 'absolute' : 'overflowBoundaryElement');\n\n\t// Select step component based on orientation\n\tconst StepComponent = (\n\t\torientation === 'vertical' ? StepVertical : Step\n\t) as React.ComponentType<\n\t\tReact.ComponentProps<typeof Step> &\n\t\t\tReact.ComponentProps<typeof StepVertical>\n\t>;\n\n\treturn (\n\t\t<Progress\n\t\t\tassistiveText={assistiveText}\n\t\t\tid={id}\n\t\t\torientation={orientation}\n\t\t\tvalue={progressValue}\n\t\t\tvariant={variant}\n\t\t\tclassName={className}\n\t\t>\n\t\t\t{allSteps.map((step, i) => (\n\t\t\t\t<StepComponent\n\t\t\t\t\tkey={`${id}-${step.id}`}\n\t\t\t\t\tassistiveText={assistiveText}\n\t\t\t\t\tid={id}\n\t\t\t\t\tindex={i}\n\t\t\t\t\tisSelected={findStep(step, selectedStep)}\n\t\t\t\t\tisDisabled={findStep(step, disabledSteps)}\n\t\t\t\t\tisError={findStep(step, errorSteps)}\n\t\t\t\t\tisCompleted={findStep(step, completedSteps)}\n\t\t\t\t\tonClick={onStepClick}\n\t\t\t\t\tonFocus={onStepFocus}\n\t\t\t\t\tstep={step}\n\t\t\t\t\ttooltipIsOpen={findStep(step, tooltipIsOpenSteps)}\n\t\t\t\t\ttooltipPosition={tooltipPosition}\n\t\t\t\t\tvariant={variant}\n\t\t\t\t/>\n\t\t\t))}\n\t\t</Progress>\n\t);\n};\n\nProgressIndicator.displayName = PROGRESS_INDICATOR;\n\nexport default ProgressIndicator;\n"],"mappings":";;;;;;;;;;AA8IA,IAAM,IAA+B;CACpC;EAAE,IAAI;EAAG,OAAO;CAAmB;CACnC;EAAE,I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AC;CACF,GAAG;EACF;EACA;EACA;EACA;EACA;EACA;EACA;CACD,CAAC;CAGD,IAAM,IAAmB,QAAc;EACtC,IAAI,IAAQ;EACZ,KAAK,IAAI,IAAI,GAAG,IAAI,EAAS,QAAQ,KAAK,GACzC,IAAI,EAAS,EAAS,IAAI,CAAY,GAAG;GACxC,IAAQ;GACR;EACD;EAED,OAAO;CACR,GAAG,CAAC,GAAU,CAAY,CAAC;CAE3B,IAAI,MAAS,QACZ,OACC,kBAAC,GAAD;EACgB;EACJ;EACX,eAAe;EACX;EACJ,QAAQ;GAAE,GAAG;GAAe,GAAG;EAAW;EAC7B;EACA;EACb,OAAO,EAAS,KAAK,OAAU;GAC9B,aAAa,EAAS,GAAM,CAAc;GAC1C,YAAY,EAAS,GAAM,CAAY;GACvC;EACD,EAAE;CACF,CAAA;CAIH,IAAM,IAAgB,KAAqB,CAAC,GACtC,IAAa,KAAkB,CAAC,GAGhC,IACL,MAAqB,IAClB,MACA,GAAG,OAAO,KAAoB,EAAS,SAAS,OAG9C,IACL,MAAY,oBAAoB,aAAa,GAGxC,IACL,MACC,MAAY,UAAU,aAAa,4BAG/B,IACL,MAAgB,aAAa,IAAe;CAM7C,OACC,kBAAC,GAAD;EACgB;EACX;EACS;EACb,OAAO;EACE;EACE;EAEV,UAAA,EAAS,KAAK,GAAM,MACpB,kBAAC,GAAD;GAEgB;GACX;GACJ,OAAO;GACP,YAAY,EAAS,GAAM,CAAY;GACvC,YAAY,EAAS,GAAM,CAAa;GACxC,SAAS,EAAS,GAAM,CAAU;GAClC,aAAa,EAAS,GAAM,CAAc;GAC1C,SAAS;GACT,SAAS;GACH;GACN,eAAe,EAAS,GAAM,CAAkB;GAC/B;GACR;EACT,GAdK,GAAG,EAAG,GAAG,EAAK,IAcnB,CACD;CACQ,CAAA;AAEZ;AAEA,EAAkB,cAAc"}
@@ -0,0 +1,95 @@
1
+ import { PROGRESS_INDICATOR_PATH as e } from "../../../utilities/constants.js";
2
+ import t from "../../utilities/utility-icon/index.js";
3
+ import { useRovingTabIndex as n } from "./use-roving-tab-index.js";
4
+ import "react";
5
+ import r from "classnames";
6
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
7
+ //#region components/progress-indicator/private/path.tsx
8
+ var o = ({ assistiveText: e, className: o, id: s, labels: c, onStepClick: l, onStepFocus: u, selectedIndex: d, steps: f }) => {
9
+ let { activeIndex: p, getItemProps: m } = n({
10
+ count: f.length,
11
+ selectedIndex: d
12
+ }), h = `${s}-stage-name`, g = f.find(({ isSelected: e }) => e)?.step;
13
+ return /* @__PURE__ */ i("div", {
14
+ id: s,
15
+ className: r("slds-path", o),
16
+ children: /* @__PURE__ */ a("div", {
17
+ className: "slds-grid slds-path__track",
18
+ children: [/* @__PURE__ */ i("div", {
19
+ className: "slds-grid slds-path__scroller-container",
20
+ children: /* @__PURE__ */ i("div", {
21
+ className: "slds-path__scroller",
22
+ children: /* @__PURE__ */ i("div", {
23
+ className: "slds-path__scroller_inner",
24
+ children: /* @__PURE__ */ i("ul", {
25
+ className: "slds-path__nav",
26
+ role: "listbox",
27
+ "aria-orientation": "horizontal",
28
+ "aria-labelledby": h,
29
+ children: f.map(({ isCompleted: n, isSelected: o, step: c }, d) => {
30
+ let f = n && !o, h = {
31
+ isCompleted: n,
32
+ isDisabled: !1,
33
+ isError: !1,
34
+ isSelected: o,
35
+ step: c
36
+ }, g = c.assistiveText;
37
+ return g === void 0 && (o ? g = e.currentStage : f && (g = e.completedStage)), /* @__PURE__ */ i("li", {
38
+ className: r("slds-path__item", {
39
+ "slds-is-complete": f,
40
+ "slds-is-current": o,
41
+ "slds-is-incomplete": !f && !o,
42
+ "slds-is-active": d === p
43
+ }),
44
+ role: "presentation",
45
+ children: /* @__PURE__ */ a("a", {
46
+ ...m(d, { onFocus: (e) => u?.(e, h) }),
47
+ "aria-selected": d === p,
48
+ className: "slds-path__link",
49
+ href: "#",
50
+ id: `${s}-path-${c.id}`,
51
+ onClick: (e) => {
52
+ e.preventDefault(), e.currentTarget.focus(), l?.(e, h);
53
+ },
54
+ role: "option",
55
+ children: [/* @__PURE__ */ a("span", {
56
+ className: "slds-path__stage",
57
+ children: [/* @__PURE__ */ i(t, {
58
+ "aria-hidden": "true",
59
+ category: "utility",
60
+ className: "slds-icon slds-icon_x-small",
61
+ name: "check"
62
+ }), g ? /* @__PURE__ */ i("span", {
63
+ className: "slds-assistive-text",
64
+ children: g
65
+ }) : null]
66
+ }), /* @__PURE__ */ i("span", {
67
+ className: "slds-path__title",
68
+ children: c.label
69
+ })]
70
+ })
71
+ }, `${s}-${c.id}`);
72
+ })
73
+ })
74
+ })
75
+ })
76
+ }), /* @__PURE__ */ i("div", {
77
+ className: "slds-grid slds-path__action",
78
+ children: /* @__PURE__ */ a("span", {
79
+ id: h,
80
+ className: "slds-path__stage-name",
81
+ children: [
82
+ c.stageNameBefore,
83
+ g?.label,
84
+ c.stageNameAfter
85
+ ]
86
+ })
87
+ })]
88
+ })
89
+ });
90
+ };
91
+ o.displayName = e;
92
+ //#endregion
93
+ export { o as default };
94
+
95
+ //# sourceMappingURL=path.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"path.js","names":[],"sources":["../../../../../components/progress-indicator/private/path.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React from 'react';\nimport classNames from 'classnames';\n\nimport UtilityIcon from '../../utilities/utility-icon';\nimport { PROGRESS_INDICATOR_PATH } from '../../../utilities/constants';\nimport { useRovingTabIndex } from './use-roving-tab-index';\nimport {\n\ttype ProgressIndicatorAssistiveText,\n\ttype ProgressIndicatorLabels,\n\ttype ProgressStep,\n\ttype StepEventData,\n} from '../index';\n\nexport interface PathStepState {\n\tisCompleted: boolean;\n\tisSelected: boolean;\n\tstep: ProgressStep;\n}\n\nexport interface PathProps {\n\t/**\n\t * Assistive text for each stage's status\n\t */\n\tassistiveText: ProgressIndicatorAssistiveText;\n\t/**\n\t * CSS class names to be added to the `slds-path` element.\n\t */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/**\n\t * HTML id for component.\n\t */\n\tid: string;\n\t/**\n\t * Visible text around the current stage's name\n\t */\n\tlabels: ProgressIndicatorLabels;\n\t/**\n\t * Triggered when a stage is clicked\n\t */\n\tonStepClick?: (\n\t\tevent: React.MouseEvent | React.KeyboardEvent,\n\t\tdata: StepEventData\n\t) => void;\n\t/**\n\t * Triggered when a stage receives focus\n\t */\n\tonStepFocus?: (event: React.FocusEvent, data: StepEventData) => void;\n\t/**\n\t * Index of the selected stage, which holds the tab stop until the user moves it\n\t */\n\tselectedIndex: number;\n\t/**\n\t * Each stage and its status\n\t */\n\tsteps: PathStepState[];\n}\n\n/**\n * Path renders the steps as SLDS Path stages, like `lightning-progress-indicator` with `type=\"path\"`.\n * The stages are a single tab stop; the arrow keys move between them.\n */\nconst Path = ({\n\tassistiveText,\n\tclassName,\n\tid,\n\tlabels,\n\tonStepClick,\n\tonStepFocus,\n\tselectedIndex,\n\tsteps,\n}: PathProps): React.ReactElement => {\n\tconst { activeIndex, getItemProps } = useRovingTabIndex<HTMLAnchorElement>({\n\t\tcount: steps.length,\n\t\tselectedIndex,\n\t});\n\tconst stageNameId = `${id}-stage-name`;\n\tconst currentStep = steps.find(({ isSelected }) => isSelected)?.step;\n\n\treturn (\n\t\t<div id={id} className={classNames('slds-path', className)}>\n\t\t\t<div className=\"slds-grid slds-path__track\">\n\t\t\t\t<div className=\"slds-grid slds-path__scroller-container\">\n\t\t\t\t\t<div className=\"slds-path__scroller\">\n\t\t\t\t\t\t<div className=\"slds-path__scroller_inner\">\n\t\t\t\t\t\t\t<ul\n\t\t\t\t\t\t\t\tclassName=\"slds-path__nav\"\n\t\t\t\t\t\t\t\trole=\"listbox\"\n\t\t\t\t\t\t\t\taria-orientation=\"horizontal\"\n\t\t\t\t\t\t\t\taria-labelledby={stageNameId}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{steps.map(({ isCompleted, isSelected, step }, index) => {\n\t\t\t\t\t\t\t\t\tconst isComplete = isCompleted && !isSelected;\n\t\t\t\t\t\t\t\t\tconst data: StepEventData = {\n\t\t\t\t\t\t\t\t\t\tisCompleted,\n\t\t\t\t\t\t\t\t\t\tisDisabled: false,\n\t\t\t\t\t\t\t\t\t\tisError: false,\n\t\t\t\t\t\t\t\t\t\tisSelected,\n\t\t\t\t\t\t\t\t\t\tstep,\n\t\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t\t\tlet stageAssistiveText = step.assistiveText;\n\t\t\t\t\t\t\t\t\tif (stageAssistiveText === undefined) {\n\t\t\t\t\t\t\t\t\t\tif (isSelected) {\n\t\t\t\t\t\t\t\t\t\t\tstageAssistiveText = assistiveText.currentStage;\n\t\t\t\t\t\t\t\t\t\t} else if (isComplete) {\n\t\t\t\t\t\t\t\t\t\t\tstageAssistiveText = assistiveText.completedStage;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t<li\n\t\t\t\t\t\t\t\t\t\t\tkey={`${id}-${step.id}`}\n\t\t\t\t\t\t\t\t\t\t\tclassName={classNames('slds-path__item', {\n\t\t\t\t\t\t\t\t\t\t\t\t'slds-is-complete': isComplete,\n\t\t\t\t\t\t\t\t\t\t\t\t'slds-is-current': isSelected,\n\t\t\t\t\t\t\t\t\t\t\t\t'slds-is-incomplete': !isComplete && !isSelected,\n\t\t\t\t\t\t\t\t\t\t\t\t'slds-is-active': index === activeIndex,\n\t\t\t\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t\t\t\t\trole=\"presentation\"\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{/* SLDS and lightning-progress-indicator render each stage as an `a[role=option]` */}\n\t\t\t\t\t\t\t\t\t\t\t{/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}\n\t\t\t\t\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\t\t\t\t\t{...getItemProps(index, {\n\t\t\t\t\t\t\t\t\t\t\t\t\tonFocus: (event) => onStepFocus?.(event, data),\n\t\t\t\t\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t\t\t\t\t\t// SLDS Path: `aria-selected` marks the stage the user has moved to, not the current stage\n\t\t\t\t\t\t\t\t\t\t\t\taria-selected={index === activeIndex}\n\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"slds-path__link\"\n\t\t\t\t\t\t\t\t\t\t\t\thref=\"#\"\n\t\t\t\t\t\t\t\t\t\t\t\tid={`${id}-path-${step.id}`}\n\t\t\t\t\t\t\t\t\t\t\t\tonClick={(event) => {\n\t\t\t\t\t\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\t\t\t\t\t\t// Safari doesn't focus links on click; focus the stage so it takes the tab stop\n\t\t\t\t\t\t\t\t\t\t\t\t\tevent.currentTarget.focus();\n\t\t\t\t\t\t\t\t\t\t\t\t\tonStepClick?.(event, data);\n\t\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\t\trole=\"option\"\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t<span className=\"slds-path__stage\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<UtilityIcon\n\t\t\t\t\t\t\t\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"slds-icon slds-icon_x-small\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tname=\"check\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{stageAssistiveText ? (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span className=\"slds-assistive-text\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{stageAssistiveText}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t\t\t<span className=\"slds-path__title\">{step.label}</span>\n\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div className=\"slds-grid slds-path__action\">\n\t\t\t\t\t<span id={stageNameId} className=\"slds-path__stage-name\">\n\t\t\t\t\t\t{labels.stageNameBefore}\n\t\t\t\t\t\t{currentStep?.label}\n\t\t\t\t\t\t{labels.stageNameAfter}\n\t\t\t\t\t</span>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nPath.displayName = PROGRESS_INDICATOR_PATH;\n\nexport default Path;\n"],"mappings":";;;;;;;AAgEA,IAAM,KAAQ,EACb,kBACA,cACA,OACA,WACA,gBACA,gBACA,kBACA,eACoC;CACpC,IAAM,EAAE,gBAAa,oBAAiB,EAAqC;EAC1E,OAAO,EAAM;EACb;CACD,CAAC,GACK,IAAc,GAAG,EAAG,cACpB,IAAc,EAAM,MAAM,EAAE,oBAAiB,CAAU,CAAC,EAAE;CAEhE,OACC,kBAAC,OAAD;EAAS;EAAI,WAAW,EAAW,aAAa,CAAS;EACxD,UAAA,kBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACC,kBAAC,OAAD;IAAK,WAAU;IACd,UAAA,kBAAC,OAAD;KAAK,WAAU;KACd,UAAA,kBAAC,OAAD;MAAK,WAAU;MACd,UAAA,kBAAC,MAAD;OACC,WAAU;OACV,MAAK;OACL,oBAAiB;OACjB,mBAAiB;OAEhB,UAAA,EAAM,KAAK,EAA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= class extends n.Component {
12
12
  render() {
13
13
  return /* @__PURE__ */ a("div", {
14
14
  id: this.getId(),
15
- className: r("slds-progress", { "slds-progress_shade": this.props.variant === "modal" }, { "slds-progress_vertical": this.props.orientation === "vertical" }, { "slds-progress_success": this.props.variant === "setup-assistant" }, this.props.className),
15
+ className: r("slds-progress", { "slds-progress_shade": this.props.variant === "modal" || this.props.variant === "shade" }, { "slds-progress_vertical": this.props.orientation === "vertical" }, { "slds-progress_success": this.props.variant === "setup-assistant" }, this.props.className),
16
16
  children: [/* @__PURE__ */ i("ol", {
17
17
  className: r("slds-progress__list", { "slds-progress__list-bordered": this.props.variant === "setup-assistant" }),
18
18
  children: this.props.children
@@ -1 +1 @@
1
- {"version":3,"file":"progress.js","names":[],"sources":["../../../../../components/progress-indicator/private/progress.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, { type ReactNode } from 'react';\n\n// ### classNames\n// [github.com/JedWatson/classnames](https://github.com/JedWatson/classnames)\n// This project uses `classnames`, 'a simple javascript utility for conditionally\n// joining classNames together.'\nimport classNames from 'classnames';\n\nimport ProgressBar from './progress-bar';\n\nimport { PROGRESS_INDICATOR_PROGRESS } from '../../../utilities/constants';\nimport {\n\ttype ProgressIndicatorAssistiveText,\n\ttype ProgressIndicatorOrientation,\n\ttype ProgressIndicatorVariant,\n} from '../index';\n\nexport interface ProgressProps {\n\t/**\n\t * Assistive text for percentage\n\t */\n\tassistiveText?: ProgressIndicatorAssistiveText;\n\t/**\n\t * Steps in the component\n\t */\n\tchildren?: ReactNode;\n\t/**\n\t * CSS class names to be added to the container element.\n\t */\n\tclassName?: unknown[] | Record<string, unknown> | string;\n\t/**\n\t * HTML id for component.\n\t */\n\tid: string;\n\t/**\n\t * Determines the orientation of the progress indicator\n\t */\n\torientation?: ProgressIndicatorOrientation;\n\t/**\n\t * Percentage of progress completion, ranging [0, 100]\n\t */\n\tvalue: string;\n\t/**\n\t * Determines component style\n\t */\n\tvariant?: ProgressIndicatorVariant;\n}\n\n/**\n * Progress renders all step buttons and a container wrapping these buttons and a progress bar\n */\nclass Progress extends React.Component<ProgressProps> {\n\tstatic displayName = PROGRESS_INDICATOR_PROGRESS;\n\n\t/**\n\t * Get the progress's HTML id. Generate a new one if no ID present.\n\t */\n\tgetId() {\n\t\treturn this.props.id;\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<div\n\t\t\t\tid={this.getId()}\n\t\t\t\tclassName={classNames(\n\t\t\t\t\t'slds-progress',\n\t\t\t\t\t{ 'slds-progress_shade': this.props.variant === 'modal' },\n\t\t\t\t\t{ 'slds-progress_vertical': this.props.orientation === 'vertical' },\n\t\t\t\t\t{ 'slds-progress_success': this.props.variant === 'setup-assistant' },\n\t\t\t\t\tthis.props.className as string\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t<ol\n\t\t\t\t\tclassName={classNames('slds-progress__list', {\n\t\t\t\t\t\t'slds-progress__list-bordered':\n\t\t\t\t\t\t\tthis.props.variant === 'setup-assistant',\n\t\t\t\t\t})}\n\t\t\t\t>\n\t\t\t\t\t{this.props.children}\n\t\t\t\t</ol>\n\t\t\t\t{this.props.orientation !== 'vertical' && (\n\t\t\t\t\t<ProgressBar\n\t\t\t\t\t\tvalue={this.props.value}\n\t\t\t\t\t\torientation={this.props.orientation}\n\t\t\t\t\t\tassistiveText={this.props.assistiveText}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t);\n\t}\n}\n\nexport default Progress;\n"],"mappings":";;;;;;AAsDA,IAAM,IAAN,cAAuB,EAAM,UAAyB;CACrD,OAAO,cAAc;CAKrB,QAAQ;EACP,OAAO,KAAK,MAAM;CACnB;CAEA,SAAS;EACR,OACC,kBAAC,OAAD;GACC,IAAI,KAAK,MAAM;GACf,WAAW,EACV,iBACA,EAAE,uBAAuB,KAAK,MAAM,YAAY,QAAQ,GACxD,EAAE,0BAA0B,KAAK,MAAM,gBAAgB,WAAW,GAClE,EAAE,yBAAyB,KAAK,MAAM,YAAY,kBAAkB,GACpE,KAAK,MAAM,SACZ;GARD,UAAA,CAUC,kBAAC,MAAD;IACC,WAAW,EAAW,uBAAuB,EAC5C,gCACC,KAAK,MAAM,YAAY,kBACzB,CAAC;IAEA,UAAA,KAAK,MAAM;GACT,CAAA,GACH,KAAK,MAAM,gBAAgB,cAC3B,kBAAC,GAAD;IACC,OAAO,KAAK,MAAM;IAClB,aAAa,KAAK,MAAM;IACxB,eAAe,KAAK,MAAM;GAC1B,CAAA,CAEE;;CAEP;AACD"}
1
+ {"version":3,"file":"progress.js","names":[],"sources":["../../../../../components/progress-indicator/private/progress.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, { type ReactNode } from 'react';\n\n// ### classNames\n// [github.com/JedWatson/classnames](https://github.com/JedWatson/classnames)\n// This project uses `classnames`, 'a simple javascript utility for conditionally\n// joining classNames together.'\nimport classNames from 'classnames';\n\nimport ProgressBar from './progress-bar';\n\nimport { PROGRESS_INDICATOR_PROGRESS } from '../../../utilities/constants';\nimport {\n\ttype ProgressIndicatorAssistiveText,\n\ttype ProgressIndicatorOrientation,\n\ttype ProgressIndicatorVariant,\n} from '../index';\n\nexport interface ProgressProps {\n\t/**\n\t * Assistive text for percentage\n\t */\n\tassistiveText?: ProgressIndicatorAssistiveText;\n\t/**\n\t * Steps in the component\n\t */\n\tchildren?: ReactNode;\n\t/**\n\t * CSS class names to be added to the container element.\n\t */\n\tclassName?: unknown[] | Record<string, unknown> | string;\n\t/**\n\t * HTML id for component.\n\t */\n\tid: string;\n\t/**\n\t * Determines the orientation of the progress indicator\n\t */\n\torientation?: ProgressIndicatorOrientation;\n\t/**\n\t * Percentage of progress completion, ranging [0, 100]\n\t */\n\tvalue: string;\n\t/**\n\t * Determines component style\n\t */\n\tvariant?: ProgressIndicatorVariant;\n}\n\n/**\n * Progress renders all step buttons and a container wrapping these buttons and a progress bar\n */\nclass Progress extends React.Component<ProgressProps> {\n\tstatic displayName = PROGRESS_INDICATOR_PROGRESS;\n\n\t/**\n\t * Get the progress's HTML id. Generate a new one if no ID present.\n\t */\n\tgetId() {\n\t\treturn this.props.id;\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<div\n\t\t\t\tid={this.getId()}\n\t\t\t\tclassName={classNames(\n\t\t\t\t\t'slds-progress',\n\t\t\t\t\t{\n\t\t\t\t\t\t'slds-progress_shade':\n\t\t\t\t\t\t\tthis.props.variant === 'modal' || this.props.variant === 'shade',\n\t\t\t\t\t},\n\t\t\t\t\t{ 'slds-progress_vertical': this.props.orientation === 'vertical' },\n\t\t\t\t\t{ 'slds-progress_success': this.props.variant === 'setup-assistant' },\n\t\t\t\t\tthis.props.className as string\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t<ol\n\t\t\t\t\tclassName={classNames('slds-progress__list', {\n\t\t\t\t\t\t'slds-progress__list-bordered':\n\t\t\t\t\t\t\tthis.props.variant === 'setup-assistant',\n\t\t\t\t\t})}\n\t\t\t\t>\n\t\t\t\t\t{this.props.children}\n\t\t\t\t</ol>\n\t\t\t\t{this.props.orientation !== 'vertical' && (\n\t\t\t\t\t<ProgressBar\n\t\t\t\t\t\tvalue={this.props.value}\n\t\t\t\t\t\torientation={this.props.orientation}\n\t\t\t\t\t\tassistiveText={this.props.assistiveText}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t);\n\t}\n}\n\nexport default Progress;\n"],"mappings":";;;;;;AAsDA,IAAM,IAAN,cAAuB,EAAM,UAAyB;CACrD,OAAO,cAAc;CAKrB,QAAQ;EACP,OAAO,KAAK,MAAM;CACnB;CAEA,SAAS;EACR,OACC,kBAAC,OAAD;GACC,IAAI,KAAK,MAAM;GACf,WAAW,EACV,iBACA,EACC,uBACC,KAAK,MAAM,YAAY,WAAW,KAAK,MAAM,YAAY,QAC3D,GACA,EAAE,0BAA0B,KAAK,MAAM,gBAAgB,WAAW,GAClE,EAAE,yBAAyB,KAAK,MAAM,YAAY,kBAAkB,GACpE,KAAK,MAAM,SACZ;GAXD,UAAA,CAaC,kBAAC,MAAD;IACC,WAAW,EAAW,uBAAuB,EAC5C,gCACC,KAAK,MAAM,YAAY,kBACzB,CAAC;IAEA,UAAA,KAAK,MAAM;GACT,CAAA,GACH,KAAK,MAAM,gBAAgB,cAC3B,kBAAC,GAAD;IACC,OAAO,KAAK,MAAM;IAClB,aAAa,KAAK,MAAM;IACxB,eAAe,KAAK,MAAM;GAC1B,CAAA,CAEE;;CAEP;AACD"}
@@ -0,0 +1,29 @@
1
+ import { useRef as e, useState as t } from "react";
2
+ //#region components/progress-indicator/private/use-roving-tab-index.ts
3
+ var n = ["ArrowLeft", "ArrowUp"], r = ["ArrowRight", "ArrowDown"];
4
+ function i({ count: i, selectedIndex: a }) {
5
+ let o = e([]), s = e([]), [c, l] = t(a), [u, d] = t(a);
6
+ a !== u && (d(a), l(a));
7
+ let f = Math.max(0, Math.min(c, i - 1)), p = (e) => (s.current[e] || (s.current[e] = (t) => {
8
+ o.current[e] = t;
9
+ }), s.current[e]), m = (e) => {
10
+ l(e), o.current[e]?.focus();
11
+ };
12
+ return {
13
+ activeIndex: f,
14
+ getItemProps: (e, t = {}) => ({
15
+ ref: p(e),
16
+ tabIndex: e === f ? 0 : -1,
17
+ onFocus: (n) => {
18
+ t.onFocus?.(n), l(e);
19
+ },
20
+ onKeyDown: (a) => {
21
+ t.onKeyDown?.(a), !a.defaultPrevented && (n.includes(a.key) ? (a.preventDefault(), e > 0 && m(e - 1)) : r.includes(a.key) && (a.preventDefault(), e < i - 1 && m(e + 1)));
22
+ }
23
+ })
24
+ };
25
+ }
26
+ //#endregion
27
+ export { i as useRovingTabIndex };
28
+
29
+ //# sourceMappingURL=use-roving-tab-index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-roving-tab-index.js","names":[],"sources":["../../../../../components/progress-indicator/private/use-roving-tab-index.ts"],"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 { useRef, useState, type FocusEvent, type KeyboardEvent } from 'react';\n\n/**\n * Options for useRovingTabIndex hook\n */\nexport interface UseRovingTabIndexOptions {\n\t/** Number of items in the group */\n\tcount: number;\n\t/** Index of the selected item. It holds the tab stop at first, and gets it back whenever this value changes. */\n\tselectedIndex: number;\n}\n\n/**\n * Handlers that the caller also needs on an item. The hook calls them before its own handlers.\n */\nexport interface RovingTabIndexItemHandlers<T extends HTMLElement> {\n\tonFocus?: (event: FocusEvent<T>) => void;\n\tonKeyDown?: (event: KeyboardEvent<T>) => void;\n}\n\n/**\n * Props to spread onto each item in the group\n */\nexport interface RovingTabIndexItemProps<T extends HTMLElement> {\n\tref: (node: T | null) => void;\n\ttabIndex: 0 | -1;\n\tonFocus: (event: FocusEvent<T>) => void;\n\tonKeyDown: (event: KeyboardEvent<T>) => void;\n}\n\nexport interface UseRovingTabIndexResult<T extends HTMLElement> {\n\t/** Index of the item that holds the tab stop */\n\tactiveIndex: number;\n\t/** Returns the props for the item at `index`, composed with the caller's handlers */\n\tgetItemProps: (\n\t\tindex: number,\n\t\thandlers?: RovingTabIndexItemHandlers<T>\n\t) => RovingTabIndexItemProps<T>;\n}\n\nconst PREVIOUS_KEYS = ['ArrowLeft', 'ArrowUp'];\nconst NEXT_KEYS = ['ArrowRight', 'ArrowDown'];\n\n/**\n * Keeps a single tab stop in a group of items and moves focus between them with the arrow keys\n * ([roving tabindex](https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#kbd_roving_tabindex)).\n * Left/Up moves to the previous item and Right/Down to the next. Focus stops at the first and last items rather than wrapping.\n *\n * Private to progress indicator until a second component needs it.\n */\nexport function useRovingTabIndex<T extends HTMLElement>({\n\tcount,\n\tselectedIndex,\n}: UseRovingTabIndexOptions): UseRovingTabIndexResult<T> {\n\tconst itemsRef = useRef<(T | null)[]>([]);\n\t// One ref callback per index, so React doesn't detach and re-attach every item on each render\n\tconst refCallbacksRef = useRef<((node: T | null) => void)[]>([]);\n\tconst [activeIndex, setActiveIndex] = useState(selectedIndex);\n\tconst [prevSelectedIndex, setPrevSelectedIndex] = useState(selectedIndex);\n\n\t// Move the tab stop back to the selected item when it changes (adjusting state during render instead of in an effect)\n\tif (selectedIndex !== prevSelectedIndex) {\n\t\tsetPrevSelectedIndex(selectedIndex);\n\t\tsetActiveIndex(selectedIndex);\n\t}\n\n\t// Keep the tab stop on an existing item if the group shrinks\n\tconst tabStopIndex = Math.max(0, Math.min(activeIndex, count - 1));\n\n\tconst getRef = (index: number) => {\n\t\tif (!refCallbacksRef.current[index]) {\n\t\t\trefCallbacksRef.current[index] = (node) => {\n\t\t\t\titemsRef.current[index] = node;\n\t\t\t};\n\t\t}\n\t\treturn refCallbacksRef.current[index];\n\t};\n\n\tconst focusItem = (index: number) => {\n\t\tsetActiveIndex(index);\n\t\titemsRef.current[index]?.focus();\n\t};\n\n\tconst getItemProps = (\n\t\tindex: number,\n\t\thandlers: RovingTabIndexItemHandlers<T> = {}\n\t): RovingTabIndexItemProps<T> => ({\n\t\tref: getRef(index),\n\t\ttabIndex: index === tabStopIndex ? 0 : -1,\n\t\tonFocus: (event) => {\n\t\t\thandlers.onFocus?.(event);\n\t\t\tsetActiveIndex(index);\n\t\t},\n\t\tonKeyDown: (event) => {\n\t\t\thandlers.onKeyDown?.(event);\n\t\t\tif (event.defaultPrevented) return;\n\n\t\t\tif (PREVIOUS_KEYS.includes(event.key)) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif (index > 0) focusItem(index - 1);\n\t\t\t} else if (NEXT_KEYS.includes(event.key)) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif (index < count - 1) focusItem(index + 1);\n\t\t\t}\n\t\t},\n\t});\n\n\treturn { activeIndex: tabStopIndex, getItemProps };\n}\n"],"mappings":";;AA2CA,IAAM,IAAgB,CAAC,aAAa,SAAS,GACvC,IAAY,CAAC,cAAc,WAAW;AAS5C,SAAgB,EAAyC,EACxD,UACA,oBACwD;CACxD,IAAM,IAAW,EAAqB,CAAC,CAAC,GAElC,IAAkB,EAAqC,CAAC,CAAC,GACzD,CAAC,GAAa,KAAkB,EAAS,CAAa,GACtD,CAAC,GAAmB,KAAwB,EAAS,CAAa;CAGxE,AAAI,MAAkB,MACrB,EAAqB,CAAa,GAClC,EAAe,CAAa;CAI7B,IAAM,IAAe,KAAK,IAAI,GAAG,KAAK,IAAI,GAAa,IAAQ,CAAC,CAAC,GAE3D,KAAU,OACV,EAAgB,QAAQ,OAC5B,EAAgB,QAAQ,MAAU,MAAS;EAC1C,EAAS,QAAQ,KAAS;CAC3B,IAEM,EAAgB,QAAQ,KAG1B,KAAa,MAAkB;EAEpC,AADA,EAAe,CAAK,GACpB,EAAS,QAAQ,EAAM,EAAE,MAAM;CAChC;CA0BA,OAAO;EAAE,aAAa;EAAc,eAvBnC,GACA,IAA0C,CAAC,OACV;GACjC,KAAK,EAAO,CAAK;GACjB,UAAU,MAAU,IAAe,IAAI;GACvC,UAAU,MAAU;IAEnB,AADA,EAAS,UAAU,CAAK,GACxB,EAAe,CAAK;GACrB;GACA,YAAY,MAAU;IACrB,EAAS,YAAY,CAAK,GACtB,GAAM,qBAEN,EAAc,SAAS,EAAM,GAAG,KACnC,EAAM,eAAe,GACjB,IAAQ,KAAG,EAAU,IAAQ,CAAC,KACxB,EAAU,SAAS,EAAM,GAAG,MACtC,EAAM,eAAe,GACjB,IAAQ,IAAQ,KAAG,EAAU,IAAQ,CAAC;GAE5C;EACD;CAEiD;AAClD"}