@ebay/ui-core-react 7.0.0 → 7.1.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (366) hide show
  1. package/array.polyfill.flat-5BAolFdk.js +1 -0
  2. package/array.polyfill.flat-Bj5UhY_-.mjs +10 -0
  3. package/badge-BX5HuO-3.mjs +9 -0
  4. package/badge-CoHKfiPt.js +1 -0
  5. package/button-B06HeRsZ.mjs +63 -0
  6. package/button-o4ao46WM.js +1 -0
  7. package/calendar-CPKqwJVQ.js +1 -0
  8. package/calendar-Dq0eM9VC.mjs +216 -0
  9. package/debounce-BQsYxxOL.js +1 -0
  10. package/debounce-u81vJ6wg.mjs +9 -0
  11. package/dialog-previous-button-7ePoYWyj.js +1 -0
  12. package/dialog-previous-button-gmkm4c8J.mjs +146 -0
  13. package/drawer-BxxlJwkZ.js +1 -0
  14. package/drawer-Dcg135Bb.mjs +40 -0
  15. package/ebay-alert-dialog.js +1 -0
  16. package/ebay-alert-dialog.mjs +22 -0
  17. package/ebay-badge.js +1 -0
  18. package/ebay-badge.mjs +4 -0
  19. package/ebay-breadcrumbs.js +1 -0
  20. package/ebay-breadcrumbs.mjs +39 -0
  21. package/ebay-button.js +1 -0
  22. package/ebay-button.mjs +5 -0
  23. package/ebay-calendar.js +1 -0
  24. package/ebay-calendar.mjs +4 -0
  25. package/ebay-carousel.js +1 -0
  26. package/ebay-carousel.mjs +229 -0
  27. package/ebay-checkbox/README.md +12 -0
  28. package/ebay-checkbox.js +1 -0
  29. package/ebay-checkbox.mjs +43 -0
  30. package/ebay-confirm-dialog.js +1 -0
  31. package/ebay-confirm-dialog.mjs +24 -0
  32. package/ebay-cta-button.js +1 -0
  33. package/ebay-cta-button.mjs +20 -0
  34. package/ebay-date-textbox.js +1 -0
  35. package/ebay-date-textbox.mjs +74 -0
  36. package/ebay-dialog-base.js +1 -0
  37. package/ebay-dialog-base.mjs +9 -0
  38. package/ebay-drawer-dialog.js +1 -0
  39. package/ebay-drawer-dialog.mjs +4 -0
  40. package/ebay-eek.js +1 -0
  41. package/ebay-eek.mjs +42 -0
  42. package/ebay-fake-menu-button.js +1 -0
  43. package/ebay-fake-menu-button.mjs +7 -0
  44. package/ebay-fake-menu.js +1 -0
  45. package/ebay-fake-menu.mjs +9 -0
  46. package/ebay-fake-tabs.js +1 -0
  47. package/ebay-fake-tabs.mjs +27 -0
  48. package/ebay-field.js +1 -0
  49. package/ebay-field.mjs +19 -0
  50. package/ebay-fullscreen-dialog.js +1 -0
  51. package/ebay-fullscreen-dialog.mjs +9 -0
  52. package/ebay-icon/icon.d.ts.map +1 -1
  53. package/ebay-icon-button/README.md +2 -0
  54. package/ebay-icon-button.js +1 -0
  55. package/ebay-icon-button.mjs +4 -0
  56. package/ebay-icon.js +1 -0
  57. package/ebay-icon.mjs +4 -0
  58. package/ebay-infotip.js +1 -0
  59. package/ebay-infotip.mjs +59 -0
  60. package/ebay-inline-notice.js +1 -0
  61. package/ebay-inline-notice.mjs +31 -0
  62. package/ebay-lightbox-dialog.js +1 -0
  63. package/ebay-lightbox-dialog.mjs +11 -0
  64. package/ebay-listbox-button.js +2 -0
  65. package/ebay-listbox-button.mjs +170 -0
  66. package/ebay-menu/menu.d.ts +1 -1
  67. package/ebay-menu/menu.d.ts.map +1 -1
  68. package/ebay-menu-button.js +1 -0
  69. package/ebay-menu-button.mjs +82 -0
  70. package/ebay-menu.js +1 -0
  71. package/ebay-menu.mjs +9 -0
  72. package/ebay-notice-base.js +1 -0
  73. package/ebay-notice-base.mjs +7 -0
  74. package/ebay-page-notice.js +1 -0
  75. package/ebay-page-notice.mjs +42 -0
  76. package/ebay-pagination.js +1 -0
  77. package/ebay-pagination.mjs +159 -0
  78. package/ebay-panel-dialog.js +1 -0
  79. package/ebay-panel-dialog.mjs +11 -0
  80. package/ebay-progress-bar.js +1 -0
  81. package/ebay-progress-bar.mjs +6 -0
  82. package/ebay-progress-spinner/progress-spinner.d.ts.map +1 -1
  83. package/ebay-progress-spinner.js +1 -0
  84. package/ebay-progress-spinner.mjs +4 -0
  85. package/ebay-progress-stepper.js +1 -0
  86. package/ebay-progress-stepper.mjs +63 -0
  87. package/ebay-radio.js +1 -0
  88. package/ebay-radio.mjs +42 -0
  89. package/ebay-section-notice.js +1 -0
  90. package/ebay-section-notice.mjs +46 -0
  91. package/ebay-section-title/index.d.ts.map +1 -1
  92. package/ebay-section-title.js +1 -0
  93. package/ebay-section-title.mjs +24 -0
  94. package/ebay-select.js +1 -0
  95. package/ebay-select.mjs +69 -0
  96. package/ebay-signal.js +1 -0
  97. package/ebay-signal.mjs +9 -0
  98. package/ebay-snackbar-dialog.js +1 -0
  99. package/ebay-snackbar-dialog.mjs +46 -0
  100. package/ebay-split-button.js +1 -0
  101. package/ebay-split-button.mjs +20 -0
  102. package/ebay-star-rating-select.js +1 -0
  103. package/ebay-star-rating-select.mjs +36 -0
  104. package/ebay-star-rating.js +1 -0
  105. package/ebay-star-rating.mjs +8 -0
  106. package/ebay-svg.js +1 -0
  107. package/ebay-svg.mjs +4753 -0
  108. package/ebay-switch.js +1 -0
  109. package/ebay-switch.mjs +25 -0
  110. package/ebay-tabs.js +1 -0
  111. package/ebay-tabs.mjs +66 -0
  112. package/ebay-textbox.js +1 -0
  113. package/ebay-textbox.mjs +8 -0
  114. package/ebay-toast-dialog.js +1 -0
  115. package/ebay-toast-dialog.mjs +9 -0
  116. package/ebay-tooltip.js +1 -0
  117. package/ebay-tooltip.mjs +39 -0
  118. package/ebay-tourtip.js +1 -0
  119. package/ebay-tourtip.mjs +43 -0
  120. package/ebay-video.js +1 -0
  121. package/ebay-video.mjs +173 -0
  122. package/hooks-Ctier7Yv.js +1 -0
  123. package/hooks-r29zhPsY.mjs +63 -0
  124. package/icon-B_a65KUD.mjs +42 -0
  125. package/icon-DK6eEQD8.js +1 -0
  126. package/icon-button-BB6GFLm7.js +1 -0
  127. package/icon-button-Dy8rjzH7.mjs +24 -0
  128. package/index-B5oC9Rl1.mjs +22 -0
  129. package/index-DbjwTbDP.js +1 -0
  130. package/label-CnrpYJ-g.js +1 -0
  131. package/label-DgOo6Mql.mjs +19 -0
  132. package/menu-CR1Dxl2m.mjs +154 -0
  133. package/menu-DZU8jEPV.js +1 -0
  134. package/menu-button-label-BcgasGA4.js +1 -0
  135. package/menu-button-label-vVnRKJRU.mjs +68 -0
  136. package/menu-item-DBi1NcrM.js +1 -0
  137. package/menu-item-jlKZ3uT4.mjs +67 -0
  138. package/notice-content-9iF4T8uB.js +1 -0
  139. package/notice-content-BVZMfcMH.mjs +4 -0
  140. package/notice-content-C0ZStfuX.js +1 -0
  141. package/notice-content-CdXVjKzD.mjs +9 -0
  142. package/notice-footer-BFa2IeY9.mjs +10 -0
  143. package/notice-footer-Cw1DMzoB.js +1 -0
  144. package/package.json +19 -8
  145. package/progress-spinner-BugUcF5c.mjs +19 -0
  146. package/progress-spinner-CDgxI8R_.js +1 -0
  147. package/range-DC7seOVT.mjs +4 -0
  148. package/range-DOsPN0h5.js +1 -0
  149. package/textbox-BxYjEAZK.mjs +100 -0
  150. package/textbox-WnB-9F4y.js +1 -0
  151. package/use-tooltip-BavqG36Z.js +1 -0
  152. package/use-tooltip-Bibsm2rU.mjs +158 -0
  153. package/utils-BipBqkOS.mjs +21 -0
  154. package/utils-C9NL3q0j.js +1 -0
  155. package/common/component-utils/array.polyfill.flat.js +0 -32
  156. package/common/component-utils/forwardRef.js +0 -37
  157. package/common/component-utils/index.js +0 -18
  158. package/common/component-utils/usePrevious.js +0 -12
  159. package/common/component-utils/utils.js +0 -26
  160. package/common/debounce.js +0 -11
  161. package/common/event-utils/index.js +0 -123
  162. package/common/event-utils/types.js +0 -14
  163. package/common/event-utils/use-key-press.js +0 -33
  164. package/common/event-utils/use-roving-index.js +0 -35
  165. package/common/floating-label-utils/hooks.js +0 -133
  166. package/common/notice-utils/notice-content.js +0 -12
  167. package/common/notice-utils/notice-cta.js +0 -23
  168. package/common/notice-utils/notice-footer.js +0 -23
  169. package/common/notice-utils/notice-title.js +0 -24
  170. package/common/random-id.js +0 -5
  171. package/common/range.js +0 -5
  172. package/common/tooltip-utils/constants.js +0 -95
  173. package/common/tooltip-utils/index.js +0 -19
  174. package/common/tooltip-utils/tooltip-close-button.js +0 -8
  175. package/common/tooltip-utils/tooltip-content.js +0 -25
  176. package/common/tooltip-utils/tooltip-footer.js +0 -9
  177. package/common/tooltip-utils/tooltip-host.js +0 -24
  178. package/common/tooltip-utils/tooltip.js +0 -60
  179. package/common/tooltip-utils/types.js +0 -2
  180. package/common/tooltip-utils/use-tooltip.js +0 -27
  181. package/ebay-alert-dialog/alert-dialog.js +0 -55
  182. package/ebay-alert-dialog/index.js +0 -8
  183. package/ebay-badge/badge.js +0 -25
  184. package/ebay-badge/index.js +0 -8
  185. package/ebay-breadcrumbs/breadcrumb-item.js +0 -27
  186. package/ebay-breadcrumbs/breadcrumbs.js +0 -64
  187. package/ebay-breadcrumbs/index.js +0 -10
  188. package/ebay-button/button-cell.js +0 -29
  189. package/ebay-button/button-expand.js +0 -13
  190. package/ebay-button/button-loading.js +0 -11
  191. package/ebay-button/button-text.js +0 -9
  192. package/ebay-button/button.js +0 -95
  193. package/ebay-button/index.js +0 -10
  194. package/ebay-button/types.js +0 -2
  195. package/ebay-calendar/calendar.js +0 -306
  196. package/ebay-calendar/date-utils.js +0 -58
  197. package/ebay-calendar/index.js +0 -8
  198. package/ebay-carousel/carousel-control-button.js +0 -24
  199. package/ebay-carousel/carousel-item.js +0 -59
  200. package/ebay-carousel/carousel-list.js +0 -81
  201. package/ebay-carousel/carousel.js +0 -109
  202. package/ebay-carousel/helpers.js +0 -123
  203. package/ebay-carousel/index.js +0 -10
  204. package/ebay-carousel/scroll-to-transition.js +0 -102
  205. package/ebay-carousel/types.js +0 -2
  206. package/ebay-checkbox/checkbox.js +0 -77
  207. package/ebay-checkbox/index.js +0 -8
  208. package/ebay-confirm-dialog/confirm-dialog.js +0 -56
  209. package/ebay-confirm-dialog/index.js +0 -8
  210. package/ebay-cta-button/cta-button.js +0 -30
  211. package/ebay-cta-button/index.js +0 -8
  212. package/ebay-date-textbox/date-textbox.js +0 -179
  213. package/ebay-date-textbox/index.js +0 -8
  214. package/ebay-dialog-base/components/animation.js +0 -96
  215. package/ebay-dialog-base/components/dialog-actions.js +0 -8
  216. package/ebay-dialog-base/components/dialog-close-button.js +0 -8
  217. package/ebay-dialog-base/components/dialog-footer.js +0 -8
  218. package/ebay-dialog-base/components/dialog-header.js +0 -22
  219. package/ebay-dialog-base/components/dialog-previous-button.js +0 -24
  220. package/ebay-dialog-base/components/dialogBase.js +0 -152
  221. package/ebay-dialog-base/dialog-base-with-state.js +0 -63
  222. package/ebay-dialog-base/index.js +0 -18
  223. package/ebay-drawer-dialog/components/drawer.js +0 -104
  224. package/ebay-drawer-dialog/index.js +0 -8
  225. package/ebay-eek/eek-rating.js +0 -23
  226. package/ebay-eek/eek-util.js +0 -34
  227. package/ebay-eek/index.js +0 -8
  228. package/ebay-fake-menu/index.js +0 -12
  229. package/ebay-fake-menu/menu-item-separator.js +0 -23
  230. package/ebay-fake-menu/menu-item.js +0 -72
  231. package/ebay-fake-menu/menu.js +0 -57
  232. package/ebay-fake-menu-button/index.js +0 -14
  233. package/ebay-fake-menu-button/menu-button-item.js +0 -5
  234. package/ebay-fake-menu-button/menu-button-label.js +0 -8
  235. package/ebay-fake-menu-button/menu-button-separator.js +0 -23
  236. package/ebay-fake-menu-button/menu-button.js +0 -105
  237. package/ebay-fake-tabs/fake-tabs.js +0 -54
  238. package/ebay-fake-tabs/index.js +0 -10
  239. package/ebay-fake-tabs/tab.js +0 -24
  240. package/ebay-field/description.js +0 -26
  241. package/ebay-field/field.js +0 -12
  242. package/ebay-field/index.js +0 -12
  243. package/ebay-field/label.js +0 -29
  244. package/ebay-field/types.js +0 -2
  245. package/ebay-fullscreen-dialog/fullscreen-dialog.js +0 -25
  246. package/ebay-fullscreen-dialog/index.js +0 -8
  247. package/ebay-icon/icon.js +0 -89
  248. package/ebay-icon/index.js +0 -8
  249. package/ebay-icon/types.js +0 -3
  250. package/ebay-icon-button/icon-button.js +0 -40
  251. package/ebay-icon-button/index.js +0 -8
  252. package/ebay-infotip/ebay-infotip-content.js +0 -12
  253. package/ebay-infotip/ebay-infotip-heading.js +0 -23
  254. package/ebay-infotip/ebay-infotip-host.js +0 -28
  255. package/ebay-infotip/ebay-infotip.js +0 -79
  256. package/ebay-infotip/index.js +0 -14
  257. package/ebay-infotip/types.js +0 -2
  258. package/ebay-inline-notice/index.js +0 -10
  259. package/ebay-inline-notice/inline-notice.js +0 -66
  260. package/ebay-inline-notice/types.js +0 -2
  261. package/ebay-lightbox-dialog/index.js +0 -8
  262. package/ebay-lightbox-dialog/lightbox-dialog.js +0 -27
  263. package/ebay-listbox-button/index.js +0 -10
  264. package/ebay-listbox-button/listbox-button-option.js +0 -27
  265. package/ebay-listbox-button/listbox-button.js +0 -252
  266. package/ebay-menu/index.js +0 -27
  267. package/ebay-menu/menu-item-separator.js +0 -23
  268. package/ebay-menu/menu-item.js +0 -67
  269. package/ebay-menu/menu.js +0 -149
  270. package/ebay-menu/types.js +0 -2
  271. package/ebay-menu-button/index.js +0 -29
  272. package/ebay-menu-button/menu-button-item.js +0 -5
  273. package/ebay-menu-button/menu-button-label.js +0 -8
  274. package/ebay-menu-button/menu-button-separator.js +0 -23
  275. package/ebay-menu-button/menu-button.js +0 -132
  276. package/ebay-menu-button/types.js +0 -2
  277. package/ebay-notice-base/components/ebay-notice-content/index.js +0 -8
  278. package/ebay-notice-base/components/ebay-notice-content/notice-content.js +0 -4
  279. package/ebay-notice-base/components/ebay-notice-title/index.js +0 -8
  280. package/ebay-notice-base/components/ebay-notice-title/notice-title.js +0 -8
  281. package/ebay-notice-base/index.js +0 -7
  282. package/ebay-page-notice/index.js +0 -16
  283. package/ebay-page-notice/page-notice-cta.js +0 -9
  284. package/ebay-page-notice/page-notice-footer.js +0 -9
  285. package/ebay-page-notice/page-notice-title.js +0 -23
  286. package/ebay-page-notice/page-notice.js +0 -66
  287. package/ebay-pagination/const.js +0 -8
  288. package/ebay-pagination/helpers.js +0 -92
  289. package/ebay-pagination/index.js +0 -10
  290. package/ebay-pagination/pagination-item.js +0 -55
  291. package/ebay-pagination/pagination.js +0 -146
  292. package/ebay-pagination/types.js +0 -2
  293. package/ebay-panel-dialog/index.js +0 -8
  294. package/ebay-panel-dialog/panel-dialog.js +0 -27
  295. package/ebay-progress-bar/index.js +0 -8
  296. package/ebay-progress-bar/progress-bar.js +0 -23
  297. package/ebay-progress-spinner/index.js +0 -8
  298. package/ebay-progress-spinner/progress-spinner.js +0 -30
  299. package/ebay-progress-stepper/ebay-progress-step.js +0 -64
  300. package/ebay-progress-stepper/ebay-progress-stepper.js +0 -70
  301. package/ebay-progress-stepper/ebay-progress-title.js +0 -5
  302. package/ebay-progress-stepper/index.js +0 -12
  303. package/ebay-progress-stepper/types.js +0 -2
  304. package/ebay-radio/index.js +0 -8
  305. package/ebay-radio/radio.js +0 -71
  306. package/ebay-section-notice/index.js +0 -14
  307. package/ebay-section-notice/section-notice-footer.js +0 -9
  308. package/ebay-section-notice/section-notice-title.js +0 -23
  309. package/ebay-section-notice/section-notice.js +0 -82
  310. package/ebay-section-title/cta.js +0 -26
  311. package/ebay-section-title/index.js +0 -16
  312. package/ebay-section-title/info.js +0 -23
  313. package/ebay-section-title/overflow.js +0 -23
  314. package/ebay-section-title/section-title.js +0 -35
  315. package/ebay-section-title/subtitle.js +0 -23
  316. package/ebay-section-title/title.js +0 -23
  317. package/ebay-select/ebay-select-option.js +0 -22
  318. package/ebay-select/ebay-select.js +0 -129
  319. package/ebay-select/index.js +0 -10
  320. package/ebay-signal/index.js +0 -8
  321. package/ebay-signal/signal.js +0 -24
  322. package/ebay-snackbar-dialog/components/ebay-snackbar-dialog-action.js +0 -24
  323. package/ebay-snackbar-dialog/components/ebay-snackbar-dialog.js +0 -122
  324. package/ebay-snackbar-dialog/index.js +0 -7
  325. package/ebay-split-button/index.js +0 -23
  326. package/ebay-split-button/split-button.js +0 -30
  327. package/ebay-split-button/types.js +0 -2
  328. package/ebay-star-rating/index.js +0 -23
  329. package/ebay-star-rating/star-rating.js +0 -26
  330. package/ebay-star-rating-select/index.js +0 -23
  331. package/ebay-star-rating-select/star-rating-select.js +0 -82
  332. package/ebay-svg/index.js +0 -8
  333. package/ebay-svg/svg.js +0 -2548
  334. package/ebay-switch/ebay-switch.js +0 -61
  335. package/ebay-switch/index.js +0 -8
  336. package/ebay-tabs/index.js +0 -12
  337. package/ebay-tabs/tab-panel.js +0 -24
  338. package/ebay-tabs/tab.js +0 -24
  339. package/ebay-tabs/tabs.js +0 -90
  340. package/ebay-tabs/types.js +0 -2
  341. package/ebay-textbox/index.js +0 -16
  342. package/ebay-textbox/postfix-icon.js +0 -26
  343. package/ebay-textbox/postfix-text.js +0 -8
  344. package/ebay-textbox/prefix-icon.js +0 -23
  345. package/ebay-textbox/prefix-text.js +0 -8
  346. package/ebay-textbox/textbox.js +0 -147
  347. package/ebay-textbox/types.js +0 -2
  348. package/ebay-toast-dialog/components/toast.js +0 -26
  349. package/ebay-toast-dialog/index.js +0 -8
  350. package/ebay-tooltip/ebay-tooltip-content.js +0 -8
  351. package/ebay-tooltip/ebay-tooltip-host.js +0 -8
  352. package/ebay-tooltip/ebay-tooltip.js +0 -85
  353. package/ebay-tooltip/index.js +0 -14
  354. package/ebay-tourtip/ebay-tourtip-content.js +0 -8
  355. package/ebay-tourtip/ebay-tourtip-footer.js +0 -10
  356. package/ebay-tourtip/ebay-tourtip-heading.js +0 -24
  357. package/ebay-tourtip/ebay-tourtip-host.js +0 -8
  358. package/ebay-tourtip/ebay-tourtip.js +0 -70
  359. package/ebay-tourtip/index.js +0 -18
  360. package/ebay-video/const.js +0 -19
  361. package/ebay-video/controls.js +0 -40
  362. package/ebay-video/index.js +0 -25
  363. package/ebay-video/reportButton.js +0 -12
  364. package/ebay-video/source.js +0 -22
  365. package/ebay-video/types.js +0 -2
  366. package/ebay-video/video.js +0 -210
@@ -0,0 +1,4 @@
1
+ import { E as a } from "./icon-button-Dy8rjzH7.mjs";
2
+ export {
3
+ a as EbayIconButton
4
+ };
package/ebay-icon.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./icon-DK6eEQD8.js");exports.EbayIcon=e.EbayIcon;
package/ebay-icon.mjs ADDED
@@ -0,0 +1,4 @@
1
+ import { E as r } from "./icon-B_a65KUD.mjs";
2
+ export {
3
+ r as EbayIcon
4
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),h=require("classnames"),E=require("./utils-C9NL3q0j.js"),r=require("./use-tooltip-BavqG36Z.js"),v=require("./drawer-BxxlJwkZ.js"),B=require("./dialog-previous-button-7ePoYWyj.js");require("react-remove-scroll");require("makeup-screenreader-trap");require("makeup-keyboard-trap");const w=require("./icon-DK6eEQD8.js");require("./icon-button-BB6GFLm7.js");const M=require("classnames/dedupe"),S=({icon:t,className:n,children:o,forwardedRef:l,variant:c,...p})=>{const i=c==="modal"?"dialog--mini":"infotip",a=e.createElement(w.EbayIcon,{name:t}),u=o instanceof Function?o({icon:a}):o;return e.createElement("button",{...p,className:M("icon-btn icon-btn--transparent",n,`${i}__host`),type:"button",ref:l},u||a)},b=w.withForwardRef(S),j=({variant:t="default",pointer:n,overlayStyle:o,disabled:l,onExpand:c,onCollapse:p,children:i,initialExpanded:a,icon:u="information16",a11yCloseText:d,"aria-label":N,className:_,a11yMaximizeText:P,a11yMinimizeText:F})=>{const y=e.useRef(),{isExpanded:s,expandTooltip:x,collapseTooltip:f}=r.useTooltip({onCollapse:p,onExpand:c,initialExpanded:a,hostRef:y}),m=t==="modal",D=e.useRef(),g=E.findComponent(i,H),q=E.findComponent(i,R),C=E.findComponent(i,b)||e.createElement(b),$=()=>{s?f():x()};if(!q)throw new Error("EbayInfotip: Please use a EbayInfotipContent that defines the content of the infotip");const{children:I,...T}=q.props;return e.createElement(e.Fragment,null,e.createElement(r.Tooltip,{type:"infotip",isExpanded:s,className:h(_,{"dialog--mini":m}),ref:D},e.createElement(r.TooltipHost,null,e.cloneElement(C,{ref:y,onClick:$,disabled:l,variant:t,"aria-label":N,"aria-expanded":s,icon:u,...C.props})),!m&&e.createElement(r.TooltipContent,{...T,type:"infotip",style:o,pointer:n,showCloseButton:!0,a11yCloseText:d,onClose:f},g,I)),m&&e.createElement(v.EbayDrawerDialog,{...T,open:s,onClose:f,a11yCloseText:d,className:"dialog--mini__overlay",a11yMaximizeText:P,a11yMinimizeText:F},e.createElement(B.EbayDialogHeader,null,g),I))},H=({className:t,...n})=>e.createElement("span",{...n,className:h("infotip__heading",t)}),R=({children:t})=>e.createElement(e.Fragment,null,t);exports.EbayInfotip=j;exports.EbayInfotipContent=R;exports.EbayInfotipHeading=H;exports.EbayInfotipHost=b;
@@ -0,0 +1,59 @@
1
+ import t, { useRef as h, createElement as P, cloneElement as $ } from "react";
2
+ import w from "classnames";
3
+ import { f as E } from "./utils-BipBqkOS.mjs";
4
+ import { u as k, T as B, a as M, b as j } from "./use-tooltip-Bibsm2rU.mjs";
5
+ import { E as q } from "./drawer-Dcg135Bb.mjs";
6
+ import { E as v } from "./dialog-previous-button-gmkm4c8J.mjs";
7
+ import "react-remove-scroll";
8
+ import "makeup-screenreader-trap";
9
+ import "makeup-keyboard-trap";
10
+ import { w as z, E as A } from "./icon-B_a65KUD.mjs";
11
+ import "./icon-button-Dy8rjzH7.mjs";
12
+ import G from "classnames/dedupe";
13
+ const J = ({ icon: o, className: e, children: n, forwardedRef: r, variant: l, ...p }) => {
14
+ const a = l === "modal" ? "dialog--mini" : "infotip", i = t.createElement(A, { name: o }), c = n instanceof Function ? n({ icon: i }) : n;
15
+ return t.createElement("button", { ...p, className: G("icon-btn icon-btn--transparent", e, `${a}__host`), type: "button", ref: r }, c || i);
16
+ }, T = z(J), nt = ({ variant: o = "default", pointer: e, overlayStyle: n, disabled: r, onExpand: l, onCollapse: p, children: a, initialExpanded: i, icon: c = "information16", a11yCloseText: b, "aria-label": H, className: N, a11yMaximizeText: R, a11yMinimizeText: _ }) => {
17
+ const u = h(), { isExpanded: s, expandTooltip: x, collapseTooltip: m } = k({ onCollapse: p, onExpand: l, initialExpanded: i, hostRef: u }), f = o === "modal", F = h(), d = E(a, K), y = E(a, L), g = E(a, T) || P(T), D = () => {
18
+ s ? m() : x();
19
+ };
20
+ if (!y)
21
+ throw new Error("EbayInfotip: Please use a EbayInfotipContent that defines the content of the infotip");
22
+ const { children: I, ...C } = y.props;
23
+ return t.createElement(
24
+ t.Fragment,
25
+ null,
26
+ t.createElement(
27
+ B,
28
+ { type: "infotip", isExpanded: s, className: w(N, { "dialog--mini": f }), ref: F },
29
+ t.createElement(M, null, $(g, {
30
+ ref: u,
31
+ onClick: D,
32
+ disabled: r,
33
+ variant: o,
34
+ "aria-label": H,
35
+ "aria-expanded": s,
36
+ icon: c,
37
+ ...g.props
38
+ })),
39
+ !f && t.createElement(
40
+ j,
41
+ { ...C, type: "infotip", style: n, pointer: e, showCloseButton: !0, a11yCloseText: b, onClose: m },
42
+ d,
43
+ I
44
+ )
45
+ ),
46
+ f && t.createElement(
47
+ q,
48
+ { ...C, open: s, onClose: m, a11yCloseText: b, className: "dialog--mini__overlay", a11yMaximizeText: R, a11yMinimizeText: _ },
49
+ t.createElement(v, null, d),
50
+ I
51
+ )
52
+ );
53
+ }, K = ({ className: o, ...e }) => t.createElement("span", { ...e, className: w("infotip__heading", o) }), L = ({ children: o }) => t.createElement(t.Fragment, null, o);
54
+ export {
55
+ nt as EbayInfotip,
56
+ L as EbayInfotipContent,
57
+ K as EbayInfotipHeading,
58
+ T as EbayInfotipHost
59
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),E=require("classnames"),c=require("./notice-content-C0ZStfuX.js"),y=require("./notice-content-9iF4T8uB.js"),b=require("./utils-C9NL3q0j.js"),N=require("./icon-DK6eEQD8.js"),f=({className:a,status:n="general",children:r,hidden:t=!1,"aria-label":l,onNoticeShow:s=()=>{},...u})=>{if(e.useEffect(()=>{t||s()},[t]),t)return null;const i=b.findComponent(r,c.EbayNoticeContent);if(!i)throw new Error("EbayInlineNotice: Please use a EbayNoticeContent that defines the content of the notice");const o=n==="general";return e.createElement("div",{...u,className:E(a,"inline-notice",{[`inline-notice--${n}`]:!o})},o?null:e.createElement("span",{className:"inline-notice__header"},e.createElement(N.EbayIcon,{name:`${n}Filled16`,a11yText:l,a11yVariant:"label"})),e.createElement(y.NoticeContent,{...i.props,type:"inline"}))};exports.EbayNoticeContent=c.EbayNoticeContent;exports.EbayInlineNotice=f;
@@ -0,0 +1,31 @@
1
+ import e, { useEffect as s } from "react";
2
+ import f from "classnames";
3
+ import { E } from "./notice-content-BVZMfcMH.mjs";
4
+ import { N as p } from "./notice-content-CdXVjKzD.mjs";
5
+ import { f as N } from "./utils-BipBqkOS.mjs";
6
+ import { E as y } from "./icon-B_a65KUD.mjs";
7
+ const w = ({ className: i, status: n = "general", children: r, hidden: t = !1, "aria-label": l, onNoticeShow: c = () => {
8
+ }, ...m }) => {
9
+ if (s(() => {
10
+ t || c();
11
+ }, [t]), t)
12
+ return null;
13
+ const o = N(r, E);
14
+ if (!o)
15
+ throw new Error("EbayInlineNotice: Please use a EbayNoticeContent that defines the content of the notice");
16
+ const a = n === "general";
17
+ return e.createElement(
18
+ "div",
19
+ { ...m, className: f(i, "inline-notice", { [`inline-notice--${n}`]: !a }) },
20
+ a ? null : e.createElement(
21
+ "span",
22
+ { className: "inline-notice__header" },
23
+ e.createElement(y, { name: `${n}Filled16`, a11yText: l, a11yVariant: "label" })
24
+ ),
25
+ e.createElement(p, { ...o.props, type: "inline" })
26
+ );
27
+ };
28
+ export {
29
+ w as EbayInlineNotice,
30
+ E as EbayNoticeContent
31
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react"),a=require("classnames"),c=require("./dialog-previous-button-7ePoYWyj.js");require("./icon-button-BB6GFLm7.js");const i="lightbox-dialog",r=({open:s,mode:l,size:o,onClose:e=()=>{},...t})=>n.createElement(c.DialogBaseWithState,{buttonPosition:"right",...t,classPrefix:i,onCloseBtnClick:e,onBackgroundClick:e,className:a(t.className,`${i}--mask-fade`,o&&`${i}--${o}`),windowClass:a("lightbox-dialog__window--fade",{[`${i}__window--mini`]:l==="mini"}),open:s});exports.EbayLightboxDialog=r;
@@ -0,0 +1,11 @@
1
+ import n from "react";
2
+ import s from "classnames";
3
+ import { D as e } from "./dialog-previous-button-gmkm4c8J.mjs";
4
+ import "./icon-button-Dy8rjzH7.mjs";
5
+ const o = "lightbox-dialog", f = ({ open: l, mode: m, size: i, onClose: a = () => {
6
+ }, ...t }) => n.createElement(e, { buttonPosition: "right", ...t, classPrefix: o, onCloseBtnClick: a, onBackgroundClick: a, className: s(t.className, `${o}--mask-fade`, i && `${o}--${i}`), windowClass: s("lightbox-dialog__window--fade", {
7
+ [`${o}__window--mini`]: m === "mini"
8
+ }), open: l });
9
+ export {
10
+ f as EbayLightboxDialog
11
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react"),w=require("classnames"),V=require("./icon-DK6eEQD8.js"),be=require("./utils-C9NL3q0j.js"),F=({value:b,children:y,selected:i,onClick:v,index:m,innerRef:g,className:k,id:h,...f})=>{const x=w("listbox-button__option",k,{"listbox-button__option--active":i});return o.createElement("div",{...f,className:x,role:"option",id:h||`listbox_btn_${b}_${m}`,"aria-selected":i,ref:g,onClick:u=>{v(u,b,m)}},o.createElement("span",{className:"listbox-button__value"},y),o.createElement(V.EbayIcon,{name:"tick16"}))},me=({children:b,name:y,value:i,selected:v,borderless:m,fluid:g,className:k,maxHeight:h,prefixId:f,prefixLabel:x,floatingLabel:u,unselectedText:j="-",onChange:O=()=>{},onCollapse:W=()=>{},onExpand:z=()=>{},...G})=>{const a=o.useRef(null),S=o.useRef(),B=o.useRef(new Map),E=o.useRef(),l=be.filterByType(b,F);if(!l.length)throw new Error(`EbayListboxButton: Please use a
2
+ EbayListboxButtonOption that defines the options of the listbox`);const J=()=>{const e=v!==void 0?v:l.findIndex(({props:s})=>i!==void 0&&s.value===i),t=e>-1||u?e:void 0;return{option:l[t],index:t}},{option:N,index:T}=J(),[c,d]=o.useState(N),[n,C]=o.useState(T),[_,D]=o.useState(),[Q,X]=o.useState(!1),[A,L]=o.useState();o.useEffect(()=>{d(N)},[i]);const r=o.Children.toArray(b),I=e=>r[e].props.value,Y=o.useCallback(e=>r.findIndex(({props:t})=>t.value===e),[r]),R=e=>B.current.get(e),H=e=>{const t=a.current;t==null||t.setAttribute("aria-activedescendant",R(e).id)},p=()=>{D(!1),W()},Z=()=>{D(!0),z()},ee=()=>{_?p():Z()},P=(e,t)=>{d(r[t]),C(t),p(),H(t),E.current.focus(),O(e,{index:t,selected:[I(t)],wasClicked:A}),L(!1)},te=()=>{p(),d(r[T])},oe=e=>{const t=a.current.children[e];t.setAttribute("aria-selected","true"),t.classList.add("listbox-button__option--active")},ne=e=>{const t=a.current.children[e];t.setAttribute("aria-selected","false"),t.classList.remove("listbox-button__option--active")},se=e=>{const t=S.current,s=R(e);if(t.scrollHeight>t.clientHeight){const pe=t.clientHeight+t.scrollTop,$=s.offsetTop+s.offsetHeight;$>pe?t.scrollTop=$-t.clientHeight:s.offsetTop<t.scrollTop&&(t.scrollTop=s.offsetTop)}},q=e=>{oe(n===void 0||e===-1?0:e),ne(n===void 0||n===-1?0:n),se(e),H(e),C(e),d(r[e])},K=e=>setTimeout(()=>{var t;return(t=a==null?void 0:a.current)==null?void 0:t.focus(e)},0),ce=()=>{ee(),X(!0),K({preventScroll:!0})},ae=e=>{switch(e.key){case"Escape":p();break;case"Enter":K();break}},le=e=>{switch(e.key){case" ":case"PageUp":case"PageDown":case"Home":case"End":e.preventDefault();break;case"Down":case"ArrowDown":e.preventDefault(),n!==l.length-1&&q(n<l.length-1?n+1:0);break;case"Up":case"ArrowUp":e.preventDefault(),n!==0&&q(n>0?n-1:l.length-1);break;case"Enter":p(),setTimeout(()=>d(r[n])),setTimeout(()=>E.current.focus(),0),O(e,{index:n,selected:[I(n)],wasClicked:A});break;case"Esc":case"Escape":te();break}},M=l.map((e,t)=>o.cloneElement(e,{index:t,key:t,selected:c&&e.props.value===c.props.value,onClick:s=>P(s,t),innerRef:s=>s?B.current.set(t,s):B.current.delete(t)})),re=w("listbox-button",k,{"listbox-button--fluid":g}),ie=w("btn",{"btn--form":!m,"btn--borderless":m,"btn--floating-label":u&&c}),U=f&&"expand-btn-text",ue=o.createElement(o.Fragment,null,u&&o.createElement("span",{className:"btn__floating-label"},u),x&&o.createElement("span",{className:"btn__label"},x),o.createElement("span",{className:"btn__text",id:U},(c==null?void 0:c.props.children)||j));return o.createElement("span",{className:re},o.createElement("button",{...G,type:"button",className:ie,"aria-expanded":!!_,"aria-haspopup":"listbox","aria-labelledby":f&&`${f} ${U}`,onClick:ce,onMouseDown:e=>e.preventDefault(),onKeyUp:ae,ref:E},o.createElement("span",{className:"btn__cell"},ue,o.createElement(V.EbayIcon,{name:"chevronDown12"}))),(_||Q)&&o.createElement("div",{className:"listbox-button__listbox",ref:S,style:{maxHeight:h}},o.createElement("div",{className:"listbox-button__options",role:"listbox",tabIndex:_?0:-1,ref:a,onKeyDown:e=>le(e),onMouseDown:e=>{e.preventDefault(),L(!0)},onBlur:()=>{p(),setTimeout(()=>E.current.focus(),0)}},M)),o.createElement("select",{hidden:!0,className:"listbox-button__native",name:y,onChange:e=>P(e,Y(e.target.value)),value:c?c==null?void 0:c.props.value:""},M.map((e,t)=>o.createElement("option",{value:e.props.value,key:t}))))};exports.EbayListboxButton=me;exports.EbayListboxButtonOption=F;
@@ -0,0 +1,170 @@
1
+ import o, { useRef as k, useState as x, useEffect as mt, Children as ft, useCallback as dt, cloneElement as xt } from "react";
2
+ import N from "classnames";
3
+ import { E as j } from "./icon-B_a65KUD.mjs";
4
+ import { b as vt } from "./utils-BipBqkOS.mjs";
5
+ const Et = ({ value: b, children: h, selected: i, onClick: v, index: m, innerRef: g, className: B, id: w, ...f }) => {
6
+ const E = N("listbox-button__option", B, { "listbox-button__option--active": i });
7
+ return o.createElement(
8
+ "div",
9
+ { ...f, className: E, role: "option", id: w || `listbox_btn_${b}_${m}`, "aria-selected": i, ref: g, onClick: (p) => {
10
+ v(p, b, m);
11
+ } },
12
+ o.createElement("span", { className: "listbox-button__value" }, h),
13
+ o.createElement(j, { name: "tick16" })
14
+ );
15
+ }, gt = ({ children: b, name: h, value: i, selected: v, borderless: m, fluid: g, className: B, maxHeight: w, prefixId: f, prefixLabel: E, floatingLabel: p, unselectedText: q = "-", onChange: T = () => {
16
+ }, onCollapse: z = () => {
17
+ }, onExpand: G = () => {
18
+ }, ...J }) => {
19
+ const c = k(null), C = k(), O = k(/* @__PURE__ */ new Map()), _ = k(), l = vt(b, Et);
20
+ if (!l.length)
21
+ throw new Error(`EbayListboxButton: Please use a
22
+ EbayListboxButtonOption that defines the options of the listbox`);
23
+ const Q = () => {
24
+ const t = v !== void 0 ? v : l.findIndex(({ props: s }) => i !== void 0 && s.value === i), e = t > -1 || p ? t : void 0;
25
+ return {
26
+ option: l[e],
27
+ index: e
28
+ };
29
+ }, { option: D, index: A } = Q(), [a, d] = x(D), [n, S] = x(A), [y, L] = x(), [X, Y] = x(!1), [I, H] = x();
30
+ mt(() => {
31
+ d(D);
32
+ }, [i]);
33
+ const r = ft.toArray(b), R = (t) => r[t].props.value, Z = dt((t) => r.findIndex(({ props: e }) => e.value === t), [r]), K = (t) => O.current.get(t), P = (t) => {
34
+ const e = c.current;
35
+ e == null || e.setAttribute("aria-activedescendant", K(t).id);
36
+ }, u = () => {
37
+ L(!1), z();
38
+ }, tt = () => {
39
+ L(!0), G();
40
+ }, et = () => {
41
+ y ? u() : tt();
42
+ }, U = (t, e) => {
43
+ d(r[e]), S(e), u(), P(e), _.current.focus(), T(t, { index: e, selected: [R(e)], wasClicked: I }), H(!1);
44
+ }, ot = () => {
45
+ u(), d(r[A]);
46
+ }, nt = (t) => {
47
+ const e = c.current.children[t];
48
+ e.setAttribute("aria-selected", "true"), e.classList.add("listbox-button__option--active");
49
+ }, st = (t) => {
50
+ const e = c.current.children[t];
51
+ e.setAttribute("aria-selected", "false"), e.classList.remove("listbox-button__option--active");
52
+ }, at = (t) => {
53
+ const e = C.current, s = K(t);
54
+ if (e.scrollHeight > e.clientHeight) {
55
+ const bt = e.clientHeight + e.scrollTop, W = s.offsetTop + s.offsetHeight;
56
+ W > bt ? e.scrollTop = W - e.clientHeight : s.offsetTop < e.scrollTop && (e.scrollTop = s.offsetTop);
57
+ }
58
+ }, $ = (t) => {
59
+ nt(n === void 0 || t === -1 ? 0 : t), st(n === void 0 || n === -1 ? 0 : n), at(t), P(t), S(t), d(r[t]);
60
+ }, M = (t) => setTimeout(() => {
61
+ var e;
62
+ return (e = c == null ? void 0 : c.current) == null ? void 0 : e.focus(t);
63
+ }, 0), ct = () => {
64
+ et(), Y(!0), M({ preventScroll: !0 });
65
+ }, lt = (t) => {
66
+ switch (t.key) {
67
+ case "Escape":
68
+ u();
69
+ break;
70
+ case "Enter":
71
+ M();
72
+ break;
73
+ }
74
+ }, rt = (t) => {
75
+ switch (t.key) {
76
+ case " ":
77
+ case "PageUp":
78
+ case "PageDown":
79
+ case "Home":
80
+ case "End":
81
+ t.preventDefault();
82
+ break;
83
+ case "Down":
84
+ case "ArrowDown":
85
+ t.preventDefault(), n !== l.length - 1 && $(n < l.length - 1 ? n + 1 : 0);
86
+ break;
87
+ case "Up":
88
+ case "ArrowUp":
89
+ t.preventDefault(), n !== 0 && $(n > 0 ? n - 1 : l.length - 1);
90
+ break;
91
+ case "Enter":
92
+ u(), setTimeout(() => d(r[n])), setTimeout(() => _.current.focus(), 0), T(t, {
93
+ index: n,
94
+ selected: [R(n)],
95
+ wasClicked: I
96
+ });
97
+ break;
98
+ case "Esc":
99
+ case "Escape":
100
+ ot();
101
+ break;
102
+ }
103
+ }, V = l.map((t, e) => xt(t, {
104
+ index: e,
105
+ key: e,
106
+ selected: a && t.props.value === a.props.value,
107
+ onClick: (s) => U(s, e),
108
+ innerRef: (s) => s ? O.current.set(e, s) : O.current.delete(e)
109
+ })), it = N("listbox-button", B, { "listbox-button--fluid": g }), pt = N("btn", {
110
+ "btn--form": !m,
111
+ "btn--borderless": m,
112
+ "btn--floating-label": p && a
113
+ }), F = f && "expand-btn-text", ut = o.createElement(
114
+ o.Fragment,
115
+ null,
116
+ p && o.createElement("span", { className: "btn__floating-label" }, p),
117
+ E && o.createElement("span", { className: "btn__label" }, E),
118
+ o.createElement("span", { className: "btn__text", id: F }, (a == null ? void 0 : a.props.children) || q)
119
+ );
120
+ return o.createElement(
121
+ "span",
122
+ { className: it },
123
+ o.createElement(
124
+ "button",
125
+ {
126
+ ...J,
127
+ type: "button",
128
+ className: pt,
129
+ "aria-expanded": !!y,
130
+ "aria-haspopup": "listbox",
131
+ "aria-labelledby": f && `${f} ${F}`,
132
+ onClick: ct,
133
+ // https://stackoverflow.com/questions/17769005/onclick-and-onblur-ordering-issue
134
+ onMouseDown: (t) => t.preventDefault(),
135
+ onKeyUp: lt,
136
+ ref: _
137
+ },
138
+ o.createElement(
139
+ "span",
140
+ { className: "btn__cell" },
141
+ ut,
142
+ o.createElement(j, { name: "chevronDown12" })
143
+ )
144
+ ),
145
+ (y || X) && o.createElement(
146
+ "div",
147
+ { className: "listbox-button__listbox", ref: C, style: { maxHeight: w } },
148
+ o.createElement("div", {
149
+ className: "listbox-button__options",
150
+ role: "listbox",
151
+ tabIndex: y ? 0 : -1,
152
+ ref: c,
153
+ onKeyDown: (t) => rt(t),
154
+ // adding onMouseDown preventDefault b/c on IE the onClick event is not being fired on each
155
+ // option https://stackoverflow.com/questions/17769005/onclick-and-onblur-ordering-issue
156
+ onMouseDown: (t) => {
157
+ t.preventDefault(), H(!0);
158
+ },
159
+ onBlur: () => {
160
+ u(), setTimeout(() => _.current.focus(), 0);
161
+ }
162
+ }, V)
163
+ ),
164
+ o.createElement("select", { hidden: !0, className: "listbox-button__native", name: h, onChange: (t) => U(t, Z(t.target.value)), value: a ? a == null ? void 0 : a.props.value : "" }, V.map((t, e) => o.createElement("option", { value: t.props.value, key: e })))
165
+ );
166
+ };
167
+ export {
168
+ gt as EbayListboxButton,
169
+ Et as EbayListboxButtonOption
170
+ };
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { EbayMenuProps } from './index';
2
+ import type { EbayMenuProps } from './types';
3
3
  declare const _default: React.ForwardRefExoticComponent<Omit<EbayMenuProps, "ref"> & React.RefAttributes<React.FC<EbayMenuProps>>>;
4
4
  export default _default;
5
5
  //# sourceMappingURL=menu.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"menu.d.ts","sourceRoot":"","sources":["../../src/ebay-menu/menu.tsx"],"names":[],"mappings":"AAAA,OAAO,KASN,MAAM,OAAO,CAAA;AAKd,OAAO,EAA+B,aAAa,EAAE,MAAM,SAAS,CAAA;;AA8JpE,wBAAuC"}
1
+ {"version":3,"file":"menu.d.ts","sourceRoot":"","sources":["../../src/ebay-menu/menu.tsx"],"names":[],"mappings":"AAAA,OAAO,KASN,MAAM,OAAO,CAAA;AAOd,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;;AA6J5C,wBAAuC"}
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),r=require("classnames"),y=require("./utils-C9NL3q0j.js"),x=require("./menu-DZU8jEPV.js"),X=require("./button-o4ao46WM.js"),Y=require("./icon-button-BB6GFLm7.js"),v=require("./icon-DK6eEQD8.js"),Z=require("./index-DbjwTbDP.js"),ee=({type:t,variant:a="button",className:c,text:m="",fixWidth:d,reverse:i,expanded:h,noToggleIcon:b,checked:u,collapseOnSelect:N,a11yText:S,prefixId:B,prefixLabel:L,onClick:R=()=>{},onExpand:K=()=>{},onCollapse:P=()=>{},onChange:T=()=>{},onSelect:A=()=>{},children:f,...F})=>{const[s,E]=e.useState(h),[I,O]=e.useState(),k=e.useRef(null),M=e.useRef(),_=y.filterByType(f,[x.EbayMenuItem,q]),W=_.map(n=>!!n.props.checked),[p,j]=e.useState(W),D=y.findComponent(f,w),V=y.findComponent(f,v.EbayIcon),$=ne({text:m,prefixId:B,prefixLabel:L,menuButtonLabel:D,icon:V}),z=r("menu-button",c),G=r("menu-button__menu",{"menu-button__menu--fix-width":d,"menu-button__menu--reverse":i});e.useEffect(()=>{const n=o=>{const l=M.current,g=l&&l.contains(o.target);(N||!g)&&E(!1)};return s?(K(),setTimeout(()=>{document.addEventListener("click",n,!1)})):s===!1&&P(),()=>document.removeEventListener("click",n,!1)},[s]),e.useEffect(()=>{O(v.randomId())},[]);const H=n=>{Z.handleEscapeKeydown(n,()=>{var o;E(!1),(o=k.current)==null||o.focus()})},C={ref:k,className:"menu-button__button","aria-expanded":!!s,"aria-haspopup":!0,"aria-label":S,"aria-controls":I,"aria-labelledby":B,onClick:n=>{E(!s),R(n)},...F},J=(n,o)=>{if(t==="radio"||t==="checkbox"){const l=p.map((g,U)=>o.indexes.includes(U));j(l)}T(n,o)},Q=()=>{const n=p.findIndex(Boolean);return n>-1?n:u};return e.createElement("span",{className:z},a==="overflow"?e.createElement(Y.EbayIconButton,{icon:"overflowVertical16",...C}):e.createElement(X.EbayButton,{variant:a==="form"?"form":void 0,bodyState:b?void 0:"expand",...C},$),s&&e.createElement(x.EbayMenu,{baseEl:"div",ref:M,type:t,className:G,tabIndex:-1,id:I,autofocus:!0,checked:Q(),onKeyDown:H,onChange:J,onSelect:A},_.map((n,o)=>e.cloneElement(n,{...n.props,className:r(n.props.className,"menu-button__item"),key:o,checked:p[o]}))))};function ne({text:t,prefixId:a,prefixLabel:c,menuButtonLabel:m,icon:d}){const i=t.length?e.createElement("span",null,t):null,b=[!a&&c&&[e.createElement("span",{className:"menu-button-prefix-label"},c),e.createElement(e.Fragment,null," ")],m||i],u=[d,b].flat().filter(Boolean);return u.length?u:null}const q=({className:t,...a})=>e.createElement("hr",{...a,className:r(t,"menu-button__separator"),role:"separator"}),w=({children:t})=>e.createElement(e.Fragment,null,t);exports.EbayMenuButtonItem=x.EbayMenuItem;exports.EbayMenuButton=ee;exports.EbayMenuButtonLabel=w;exports.EbayMenuButtonSeparator=q;
@@ -0,0 +1,82 @@
1
+ import n, { useState as x, useRef as v, useEffect as w, cloneElement as X } from "react";
2
+ import u from "classnames";
3
+ import { b as Y, f as M } from "./utils-BipBqkOS.mjs";
4
+ import { E as Z, a as $ } from "./menu-CR1Dxl2m.mjs";
5
+ import { E as ee } from "./button-B06HeRsZ.mjs";
6
+ import { E as ne } from "./icon-button-Dy8rjzH7.mjs";
7
+ import { r as te, E as ae } from "./icon-B_a65KUD.mjs";
8
+ import { b as oe } from "./index-B5oC9Rl1.mjs";
9
+ const Ee = ({ type: t, variant: o = "button", className: c, text: m = "", fixWidth: d, reverse: i, expanded: h, noToggleIcon: f, checked: l, collapseOnSelect: N, a11yText: L, prefixId: y, prefixLabel: R, onClick: K = () => {
10
+ }, onExpand: S = () => {
11
+ }, onCollapse: A = () => {
12
+ }, onChange: F = () => {
13
+ }, onSelect: P = () => {
14
+ }, children: b, ...T }) => {
15
+ const [s, p] = x(h), [k, W] = x(), I = v(null), _ = v(), B = Y(b, [$, ce]), D = B.map((e) => !!e.props.checked), [E, O] = x(D), V = M(b, le), j = M(b, ae), q = se({ text: m, prefixId: y, prefixLabel: R, menuButtonLabel: V, icon: j }), z = u("menu-button", c), G = u("menu-button__menu", {
16
+ "menu-button__menu--fix-width": d,
17
+ "menu-button__menu--reverse": i
18
+ });
19
+ w(() => {
20
+ const e = (a) => {
21
+ const r = _.current, g = r && r.contains(a.target);
22
+ (N || !g) && p(!1);
23
+ };
24
+ return s ? (S(), setTimeout(() => {
25
+ document.addEventListener("click", e, !1);
26
+ })) : s === !1 && A(), () => document.removeEventListener("click", e, !1);
27
+ }, [s]), w(() => {
28
+ W(te());
29
+ }, []);
30
+ const H = (e) => {
31
+ oe(e, () => {
32
+ var a;
33
+ p(!1), (a = I.current) == null || a.focus();
34
+ });
35
+ }, C = {
36
+ ref: I,
37
+ className: "menu-button__button",
38
+ "aria-expanded": !!s,
39
+ "aria-haspopup": !0,
40
+ "aria-label": L,
41
+ "aria-controls": k,
42
+ "aria-labelledby": y,
43
+ onClick: (e) => {
44
+ p(!s), K(e);
45
+ },
46
+ ...T
47
+ }, J = (e, a) => {
48
+ if (t === "radio" || t === "checkbox") {
49
+ const r = E.map((g, U) => a.indexes.includes(U));
50
+ O(r);
51
+ }
52
+ F(e, a);
53
+ }, Q = () => {
54
+ const e = E.findIndex(Boolean);
55
+ return e > -1 ? e : l;
56
+ };
57
+ return n.createElement(
58
+ "span",
59
+ { className: z },
60
+ o === "overflow" ? n.createElement(ne, { icon: "overflowVertical16", ...C }) : n.createElement(ee, { variant: o === "form" ? "form" : void 0, bodyState: f ? void 0 : "expand", ...C }, q),
61
+ s && n.createElement(Z, { baseEl: "div", ref: _, type: t, className: G, tabIndex: -1, id: k, autofocus: !0, checked: Q(), onKeyDown: H, onChange: J, onSelect: P }, B.map((e, a) => X(e, {
62
+ ...e.props,
63
+ className: u(e.props.className, "menu-button__item"),
64
+ key: a,
65
+ checked: E[a]
66
+ })))
67
+ );
68
+ };
69
+ function se({ text: t, prefixId: o, prefixLabel: c, menuButtonLabel: m, icon: d }) {
70
+ const i = t.length ? n.createElement("span", null, t) : null, f = [!o && c && [
71
+ n.createElement("span", { className: "menu-button-prefix-label" }, c),
72
+ n.createElement(n.Fragment, null, " ")
73
+ ], m || i], l = [d, f].flat().filter(Boolean);
74
+ return l.length ? l : null;
75
+ }
76
+ const ce = ({ className: t, ...o }) => n.createElement("hr", { ...o, className: u(t, "menu-button__separator"), role: "separator" }), le = ({ children: t }) => n.createElement(n.Fragment, null, t);
77
+ export {
78
+ Ee as EbayMenuButton,
79
+ $ as EbayMenuButtonItem,
80
+ le as EbayMenuButtonLabel,
81
+ ce as EbayMenuButtonSeparator
82
+ };
package/ebay-menu.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./menu-DZU8jEPV.js"),t=require("react"),n=require("classnames"),u=({className:a,...r})=>t.createElement("hr",{...r,className:n(a,"menu__separator"),role:"separator"});exports.EbayMenu=e.EbayMenu;exports.EbayMenuItem=e.EbayMenuItem;exports.EbayMenuSeparator=u;
package/ebay-menu.mjs ADDED
@@ -0,0 +1,9 @@
1
+ import { E, a as c } from "./menu-CR1Dxl2m.mjs";
2
+ import r from "react";
3
+ import t from "classnames";
4
+ const s = ({ className: a, ...e }) => r.createElement("hr", { ...e, className: t(a, "menu__separator"), role: "separator" });
5
+ export {
6
+ E as EbayMenu,
7
+ c as EbayMenuItem,
8
+ s as EbayMenuSeparator
9
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),o=require("./notice-content-C0ZStfuX.js"),n=({children:e})=>t.createElement("span",{className:"page-notice__title"},e);exports.EbayNoticeContent=o.EbayNoticeContent;exports.EbayNoticeTitle=n;
@@ -0,0 +1,7 @@
1
+ import t from "react";
2
+ import { E as n } from "./notice-content-BVZMfcMH.mjs";
3
+ const a = ({ children: e }) => t.createElement("span", { className: "page-notice__title" }, e);
4
+ export {
5
+ n as EbayNoticeContent,
6
+ a as EbayNoticeTitle
7
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),d=require("./notice-content-9iF4T8uB.js"),l=require("./notice-content-C0ZStfuX.js"),r=require("./icon-DK6eEQD8.js"),u=require("classnames"),s=require("./notice-footer-Cw1DMzoB.js"),C=({id:a,status:e="general",children:n,a11yDismissText:o,"aria-label":E,onDismiss:b=()=>{},...g})=>{const[m,N]=t.useState(!1),i=t.Children.toArray(n).find(c=>c.type===l.EbayNoticeContent);if(!i)throw new Error("EbayPageNotice: Please use a EbayNoticeContent that defines the content of the notice");const p=c=>{N(!0),b(c)};return m?null:t.createElement("section",{...g,"aria-labelledby":a||`${e}-status`,className:`page-notice ${e!=="general"?`page-notice--${e}`:""}`,role:"region"},e!=="general"?t.createElement("div",{className:"page-notice__header",id:a||`${e}-status`},t.createElement(r.EbayIcon,{name:`${e}Filled16`,a11yText:E,a11yVariant:"label"})):null,t.createElement(d.NoticeContent,{...i.props,type:"page"}),n,o&&t.createElement(y,null,t.createElement("button",{"aria-label":o,className:"fake-link page-notice__dismiss",onClick:p},t.createElement(r.EbayIcon,{name:"close16"}))))},P=({className:a,as:e,children:n,...o})=>t.createElement(s.NoticeTitle,{...o,className:a,as:e,type:"page"},n),y=({className:a,children:e})=>t.createElement(s.NoticeFooter,{className:a,type:"page"},e),h=({className:a,type:e,children:n,...o})=>t.createElement("p",{className:u(a,`${e}-notice__cta`),...o},n),f=({className:a,children:e})=>t.createElement(h,{className:a,type:"page"},e);exports.EbayNoticeContent=l.EbayNoticeContent;exports.EbayPageNotice=C;exports.EbayPageNoticeCTA=f;exports.EbayPageNoticeFooter=y;exports.EbayPageNoticeTitle=P;
@@ -0,0 +1,42 @@
1
+ import t, { useState as N } from "react";
2
+ import { N as g } from "./notice-content-CdXVjKzD.mjs";
3
+ import { E as b } from "./notice-content-BVZMfcMH.mjs";
4
+ import { E as l } from "./icon-B_a65KUD.mjs";
5
+ import d from "classnames";
6
+ import { N as f, a as h } from "./notice-footer-BFa2IeY9.mjs";
7
+ const w = ({ id: a, status: e = "general", children: o, a11yDismissText: n, "aria-label": i, onDismiss: s = () => {
8
+ }, ...m }) => {
9
+ const [p, E] = N(!1), c = t.Children.toArray(o).find((r) => r.type === b);
10
+ if (!c)
11
+ throw new Error("EbayPageNotice: Please use a EbayNoticeContent that defines the content of the notice");
12
+ const y = (r) => {
13
+ E(!0), s(r);
14
+ };
15
+ return p ? null : t.createElement(
16
+ "section",
17
+ { ...m, "aria-labelledby": a || `${e}-status`, className: `page-notice ${e !== "general" ? `page-notice--${e}` : ""}`, role: "region" },
18
+ e !== "general" ? t.createElement(
19
+ "div",
20
+ { className: "page-notice__header", id: a || `${e}-status` },
21
+ t.createElement(l, { name: `${e}Filled16`, a11yText: i, a11yVariant: "label" })
22
+ ) : null,
23
+ t.createElement(g, { ...c.props, type: "page" }),
24
+ o,
25
+ n && t.createElement(
26
+ C,
27
+ null,
28
+ t.createElement(
29
+ "button",
30
+ { "aria-label": n, className: "fake-link page-notice__dismiss", onClick: y },
31
+ t.createElement(l, { name: "close16" })
32
+ )
33
+ )
34
+ );
35
+ }, v = ({ className: a, as: e, children: o, ...n }) => t.createElement(f, { ...n, className: a, as: e, type: "page" }, o), C = ({ className: a, children: e }) => t.createElement(h, { className: a, type: "page" }, e), P = ({ className: a, type: e, children: o, ...n }) => t.createElement("p", { className: d(a, `${e}-notice__cta`), ...n }, o), x = ({ className: a, children: e }) => t.createElement(P, { className: a, type: "page" }, e);
36
+ export {
37
+ b as EbayNoticeContent,
38
+ w as EbayPageNotice,
39
+ x as EbayPageNoticeCTA,
40
+ C as EbayPageNoticeFooter,
41
+ v as EbayPageNoticeTitle
42
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),J=require("./menu-button-label-BcgasGA4.js"),$=require("classnames"),ee=require("./debounce-BQsYxxOL.js"),te=require("./utils-C9NL3q0j.js"),B=require("./icon-DK6eEQD8.js");require("./array.polyfill.flat-5BAolFdk.js");const ne=1,R=9,K=4,j=2,re=R-j;function ie(e,n,a=e,s=null){const h=s==="show-last"||s==="overflow"&&e>R,l=s==="overflow"&&e>R,c=Math.min(a,e),v=Math.max(0,n-Math.ceil((c-1)/2)),E=c<K?n:Math.max(0,n-Math.floor((c-1)/2)),d=(h?E:v)+c,m=d>=e,M=n<=K,I=(b,o)=>{const r=q(e,b,o);return c>2?(r[o-2]="dots",r[o-1]="hidden",r[e-1]="visible"):c>1&&(r[o-1]="dots"),r},g=(b,o)=>{if(M)return I(0,o);if(m){const w=q(e,e-re,e);return w[0]="visible",w[1]="dots",w}const r=q(e,n-j,n+j+1);return r[0]="visible",r[1]=M?"visible":"dots",r[e-2]="dots",r[e-1]="visible",r};return m&&e<=R?q(e,e-c):h?l?g(E,d):I(E,d):q(e,v,d)}function oe(e,n,a,s="show-range"){if(e===-1)return[];const h=s==="overflow"?R:ae(Math.min(a,n),ne,R);return ie(a,e-1,h,s)}function ae(e,n,a){return e<=n?n:e>=a?a:e}function q(e,n,a){return Array(e).fill("hidden").fill("visible",n,a)}function se(e){if(!e)return 0;e.style.width="100vw";const n=e.offsetWidth;return e.style.width=null,n}const ce=({id:e="ebay-pagination",className:n,a11yCurrentText:a="Pagination - Current Page",a11yPreviousText:s="Previous page",a11yNextText:h="Next page",variant:l="show-range",fluid:c=!1,onPrevious:v=()=>{},onNext:E=()=>{},onSelect:d=()=>{},children:m,...M})=>{const I=t.useRef(null),g=t.useRef([]);g.current=t.Children.map(m,t.createRef);const b=te.filterBy(m,({props:i})=>i.type===void 0||i.type==="page").length,o=t.useRef(0),r=t.useRef(0),w=()=>{var y,_,x,p;const i=r.current||((_=(y=g.current[0])==null?void 0:y.current)==null?void 0:_.offsetWidth);r.current=i;const f=o.current||((p=(x=g.current[1])==null?void 0:x.current)==null?void 0:p.offsetWidth);return o.current=f,f?Math.floor((se(I.current)-i*2)/f):0},[A,G]=t.useState([]),[N,L]=t.useState(0),S=i=>{const f=i||g.current.findIndex(x=>{var p;return((p=x.current)==null?void 0:p.getAttribute("aria-current"))==="page"}),y=w(),_=oe(f,y,b,l);L(f),G(["hidden",..._])};t.useEffect(()=>{const i=ee.debounce(S,16);return S(),window.addEventListener("resize",()=>i()),()=>{window.removeEventListener("resize",()=>i())}},[m]);const W=i=>{let f=0;const y=[],_=[],x=[],p=A.indexOf("dots"),P=A.lastIndexOf("dots");return t.Children.map(m,(V,D)=>{const{type:O="page",current:Q,disabled:Y,href:z,children:U}=V.props,k=A[D]==="dots",F=`${e}-item-${D}`,X=A[D]==="hidden",Z={current:Q,disabled:Y,href:z,type:k&&O==="page"?"separator":O,children:k?t.createElement(B.EbayIcon,{name:"overflowHorizontal24",focusable:!1}):U,pageIndex:O==="page"?f++:void 0,key:F,hide:X,onPrevious:v,onNext:E,onSelect:d,a11yPreviousText:s,a11yNextText:h,ref:g.current[D]};if((X||k)&&O==="page"){const C=t.createElement(J.EbayFakeMenuButtonItem,{key:F,href:z,onClick:H=>{z||H.preventDefault();const T=H.currentTarget;d(H,{value:(T==null?void 0:T.innerText)||"",index:f}),S(Number(T==null?void 0:T.innerText))}},U);p===P&&x.push(C),N-2>p&&D<N&&y.push(C),N+2<P&&D>N&&_.push(C)}if(i==="page"&&k&&l==="overflow"){let C=x;return p!==P&&(C=D===2?y:_),t.createElement("li",{key:F},t.createElement("span",{className:"pagination__item",role:"separator"},t.createElement(J.EbayMenuButton,{a11yText:"Menu",borderless:!0,variant:"overflow",noToggleIcon:!0},C)))}return i===O?t.cloneElement(V,Z):null})},u=`${e}-pagination-heading`;return t.createElement("nav",{...M,role:"navigation",className:$(n,"pagination",{"pagination--fluid":c}),"aria-labelledby":u,ref:I},t.createElement("span",{"aria-live":"polite",role:"status"},t.createElement("h2",{className:"clipped",id:u},a)),W("previous"),t.createElement("ol",{className:"pagination__items"},W("page")),W("next"))},ue=({pageIndex:e=0,key:n,current:a,disabled:s,type:h="page",href:l,hide:c,children:v,a11yPreviousText:E="Previous page",a11yNextText:d="Next page",onSelect:m,onNext:M,onPrevious:I,className:g,style:b,forwardedRef:o,...r})=>{const w=u=>{var i;m(u,{value:((i=u.currentTarget)==null?void 0:i.innerText)||"",index:e})},A=u=>{u.currentTarget.getAttribute("aria-disabled")||M(u)},G=u=>{u.currentTarget.getAttribute("aria-disabled")||I(u)},N=!!l,L=N?"a":"button",S=N?"icon-link":"icon-btn",W={...b,minWidth:"40px"};switch(h){case"previous":return t.createElement(L,{...r,ref:o,"aria-disabled":s?"true":void 0,"aria-label":E,href:s?void 0:l,className:$(S,"pagination__previous"),style:W,onClick:G},t.createElement(B.EbayIcon,{name:"arrowLeft16"}));case"next":return t.createElement(L,{...r,ref:o,"aria-disabled":s?"true":void 0,"aria-label":d,href:s?void 0:l,className:$(S,"pagination__next"),style:W,onClick:A},t.createElement(B.EbayIcon,{name:"arrowRight16"}));case"separator":return t.createElement("span",{key:n,style:b,className:"pagination__item",ref:o,role:"separator"},v);default:return t.createElement("li",{...r,hidden:c},t.createElement(L,{ref:o,"aria-current":a?"page":void 0,href:l,className:"pagination__item",style:b,key:n,onClick:w},v))}},le=B.withForwardRef(ue);exports.EbayPagination=ce;exports.EbayPaginationItem=le;