@ebay/ui-core-react 7.0.2 → 7.1.0-alpha.3

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 (289) hide show
  1. package/array.polyfill.flat-5BAolFdk.js +1 -0
  2. package/badge-CoHKfiPt.js +1 -0
  3. package/button-o4ao46WM.js +1 -0
  4. package/calendar-CPKqwJVQ.js +1 -0
  5. package/debounce-BQsYxxOL.js +1 -0
  6. package/dialog-previous-button-7ePoYWyj.js +1 -0
  7. package/drawer-BxxlJwkZ.js +1 -0
  8. package/ebay-alert-dialog.js +1 -0
  9. package/ebay-badge.js +1 -0
  10. package/ebay-breadcrumbs.js +1 -0
  11. package/ebay-button.js +1 -0
  12. package/ebay-calendar.js +1 -0
  13. package/ebay-carousel.js +1 -0
  14. package/ebay-checkbox.js +1 -0
  15. package/ebay-confirm-dialog.js +1 -0
  16. package/ebay-cta-button.js +1 -0
  17. package/ebay-date-textbox.js +1 -0
  18. package/ebay-dialog-base.js +1 -0
  19. package/ebay-drawer-dialog.js +1 -0
  20. package/ebay-eek.js +1 -0
  21. package/ebay-fake-menu-button.js +1 -0
  22. package/ebay-fake-menu.js +1 -0
  23. package/ebay-fake-tabs.js +1 -0
  24. package/ebay-field.js +1 -0
  25. package/ebay-fullscreen-dialog.js +1 -0
  26. package/ebay-icon-button.js +1 -0
  27. package/ebay-icon.js +1 -0
  28. package/ebay-infotip.js +1 -0
  29. package/ebay-inline-notice.js +1 -0
  30. package/ebay-lightbox-dialog.js +1 -0
  31. package/ebay-listbox-button.js +2 -0
  32. package/ebay-menu/menu.d.ts +1 -1
  33. package/ebay-menu/menu.d.ts.map +1 -1
  34. package/ebay-menu-button.js +1 -0
  35. package/ebay-menu.js +1 -0
  36. package/ebay-notice-base.js +1 -0
  37. package/ebay-page-notice.js +1 -0
  38. package/ebay-pagination.js +1 -0
  39. package/ebay-panel-dialog.js +1 -0
  40. package/ebay-progress-bar.js +1 -0
  41. package/ebay-progress-spinner.js +1 -0
  42. package/ebay-progress-stepper.js +1 -0
  43. package/ebay-radio.js +1 -0
  44. package/ebay-section-notice.js +1 -0
  45. package/ebay-section-title/index.d.ts.map +1 -1
  46. package/ebay-section-title.js +1 -0
  47. package/ebay-select.js +1 -0
  48. package/ebay-signal.js +1 -0
  49. package/ebay-snackbar-dialog.js +1 -0
  50. package/ebay-split-button.js +1 -0
  51. package/ebay-star-rating-select.js +1 -0
  52. package/ebay-star-rating.js +1 -0
  53. package/ebay-svg.js +1 -0
  54. package/ebay-switch.js +1 -0
  55. package/ebay-tabs.js +1 -0
  56. package/ebay-textbox.js +1 -0
  57. package/ebay-toast-dialog.js +1 -0
  58. package/ebay-tooltip.js +1 -0
  59. package/ebay-tourtip.js +1 -0
  60. package/ebay-video.js +1 -0
  61. package/hooks-Ctier7Yv.js +1 -0
  62. package/icon-DK6eEQD8.js +1 -0
  63. package/icon-button-BB6GFLm7.js +1 -0
  64. package/index-DbjwTbDP.js +1 -0
  65. package/label-CnrpYJ-g.js +1 -0
  66. package/menu-DZU8jEPV.js +1 -0
  67. package/menu-button-label-BcgasGA4.js +1 -0
  68. package/menu-item-DBi1NcrM.js +1 -0
  69. package/notice-content-9iF4T8uB.js +1 -0
  70. package/notice-content-C0ZStfuX.js +1 -0
  71. package/notice-footer-Cw1DMzoB.js +1 -0
  72. package/package.json +19 -8
  73. package/progress-spinner-CDgxI8R_.js +1 -0
  74. package/range-DOsPN0h5.js +1 -0
  75. package/textbox-WnB-9F4y.js +1 -0
  76. package/use-tooltip-BavqG36Z.js +1 -0
  77. package/utils-C9NL3q0j.js +1 -0
  78. package/common/component-utils/array.polyfill.flat.js +0 -32
  79. package/common/component-utils/forwardRef.js +0 -37
  80. package/common/component-utils/index.js +0 -18
  81. package/common/component-utils/usePrevious.js +0 -12
  82. package/common/component-utils/utils.js +0 -26
  83. package/common/debounce.js +0 -11
  84. package/common/event-utils/index.js +0 -123
  85. package/common/event-utils/types.js +0 -14
  86. package/common/event-utils/use-key-press.js +0 -33
  87. package/common/event-utils/use-roving-index.js +0 -35
  88. package/common/floating-label-utils/hooks.js +0 -133
  89. package/common/notice-utils/notice-content.js +0 -12
  90. package/common/notice-utils/notice-cta.js +0 -23
  91. package/common/notice-utils/notice-footer.js +0 -23
  92. package/common/notice-utils/notice-title.js +0 -24
  93. package/common/random-id.js +0 -5
  94. package/common/range.js +0 -5
  95. package/common/tooltip-utils/constants.js +0 -95
  96. package/common/tooltip-utils/index.js +0 -19
  97. package/common/tooltip-utils/tooltip-close-button.js +0 -8
  98. package/common/tooltip-utils/tooltip-content.js +0 -25
  99. package/common/tooltip-utils/tooltip-footer.js +0 -9
  100. package/common/tooltip-utils/tooltip-host.js +0 -24
  101. package/common/tooltip-utils/tooltip.js +0 -60
  102. package/common/tooltip-utils/types.js +0 -2
  103. package/common/tooltip-utils/use-tooltip.js +0 -27
  104. package/ebay-alert-dialog/alert-dialog.js +0 -55
  105. package/ebay-alert-dialog/index.js +0 -8
  106. package/ebay-badge/badge.js +0 -25
  107. package/ebay-badge/index.js +0 -8
  108. package/ebay-breadcrumbs/breadcrumb-item.js +0 -27
  109. package/ebay-breadcrumbs/breadcrumbs.js +0 -64
  110. package/ebay-breadcrumbs/index.js +0 -10
  111. package/ebay-button/button-cell.js +0 -29
  112. package/ebay-button/button-expand.js +0 -13
  113. package/ebay-button/button-loading.js +0 -11
  114. package/ebay-button/button-text.js +0 -9
  115. package/ebay-button/button.js +0 -95
  116. package/ebay-button/index.js +0 -10
  117. package/ebay-button/types.js +0 -2
  118. package/ebay-calendar/calendar.js +0 -306
  119. package/ebay-calendar/date-utils.js +0 -58
  120. package/ebay-calendar/index.js +0 -8
  121. package/ebay-carousel/carousel-control-button.js +0 -24
  122. package/ebay-carousel/carousel-item.js +0 -59
  123. package/ebay-carousel/carousel-list.js +0 -81
  124. package/ebay-carousel/carousel.js +0 -109
  125. package/ebay-carousel/helpers.js +0 -123
  126. package/ebay-carousel/index.js +0 -10
  127. package/ebay-carousel/scroll-to-transition.js +0 -102
  128. package/ebay-carousel/types.js +0 -2
  129. package/ebay-checkbox/checkbox.js +0 -77
  130. package/ebay-checkbox/index.js +0 -8
  131. package/ebay-confirm-dialog/confirm-dialog.js +0 -56
  132. package/ebay-confirm-dialog/index.js +0 -8
  133. package/ebay-cta-button/cta-button.js +0 -30
  134. package/ebay-cta-button/index.js +0 -8
  135. package/ebay-date-textbox/date-textbox.js +0 -179
  136. package/ebay-date-textbox/index.js +0 -8
  137. package/ebay-dialog-base/components/animation.js +0 -96
  138. package/ebay-dialog-base/components/dialog-actions.js +0 -8
  139. package/ebay-dialog-base/components/dialog-close-button.js +0 -8
  140. package/ebay-dialog-base/components/dialog-footer.js +0 -8
  141. package/ebay-dialog-base/components/dialog-header.js +0 -22
  142. package/ebay-dialog-base/components/dialog-previous-button.js +0 -24
  143. package/ebay-dialog-base/components/dialogBase.js +0 -152
  144. package/ebay-dialog-base/dialog-base-with-state.js +0 -63
  145. package/ebay-dialog-base/index.js +0 -18
  146. package/ebay-drawer-dialog/components/drawer.js +0 -104
  147. package/ebay-drawer-dialog/index.js +0 -8
  148. package/ebay-eek/eek-rating.js +0 -23
  149. package/ebay-eek/eek-util.js +0 -34
  150. package/ebay-eek/index.js +0 -8
  151. package/ebay-fake-menu/index.js +0 -12
  152. package/ebay-fake-menu/menu-item-separator.js +0 -23
  153. package/ebay-fake-menu/menu-item.js +0 -72
  154. package/ebay-fake-menu/menu.js +0 -57
  155. package/ebay-fake-menu-button/index.js +0 -14
  156. package/ebay-fake-menu-button/menu-button-item.js +0 -5
  157. package/ebay-fake-menu-button/menu-button-label.js +0 -8
  158. package/ebay-fake-menu-button/menu-button-separator.js +0 -23
  159. package/ebay-fake-menu-button/menu-button.js +0 -105
  160. package/ebay-fake-tabs/fake-tabs.js +0 -54
  161. package/ebay-fake-tabs/index.js +0 -10
  162. package/ebay-fake-tabs/tab.js +0 -24
  163. package/ebay-field/description.js +0 -26
  164. package/ebay-field/field.js +0 -12
  165. package/ebay-field/index.js +0 -12
  166. package/ebay-field/label.js +0 -29
  167. package/ebay-field/types.js +0 -2
  168. package/ebay-fullscreen-dialog/fullscreen-dialog.js +0 -25
  169. package/ebay-fullscreen-dialog/index.js +0 -8
  170. package/ebay-icon/icon.js +0 -98
  171. package/ebay-icon/index.js +0 -8
  172. package/ebay-icon/types.js +0 -3
  173. package/ebay-icon-button/icon-button.js +0 -40
  174. package/ebay-icon-button/index.js +0 -8
  175. package/ebay-infotip/ebay-infotip-content.js +0 -12
  176. package/ebay-infotip/ebay-infotip-heading.js +0 -23
  177. package/ebay-infotip/ebay-infotip-host.js +0 -28
  178. package/ebay-infotip/ebay-infotip.js +0 -79
  179. package/ebay-infotip/index.js +0 -14
  180. package/ebay-infotip/types.js +0 -2
  181. package/ebay-inline-notice/index.js +0 -10
  182. package/ebay-inline-notice/inline-notice.js +0 -66
  183. package/ebay-inline-notice/types.js +0 -2
  184. package/ebay-lightbox-dialog/index.js +0 -8
  185. package/ebay-lightbox-dialog/lightbox-dialog.js +0 -27
  186. package/ebay-listbox-button/index.js +0 -10
  187. package/ebay-listbox-button/listbox-button-option.js +0 -27
  188. package/ebay-listbox-button/listbox-button.js +0 -252
  189. package/ebay-menu/index.js +0 -27
  190. package/ebay-menu/menu-item-separator.js +0 -23
  191. package/ebay-menu/menu-item.js +0 -67
  192. package/ebay-menu/menu.js +0 -149
  193. package/ebay-menu/types.js +0 -2
  194. package/ebay-menu-button/index.js +0 -29
  195. package/ebay-menu-button/menu-button-item.js +0 -5
  196. package/ebay-menu-button/menu-button-label.js +0 -8
  197. package/ebay-menu-button/menu-button-separator.js +0 -23
  198. package/ebay-menu-button/menu-button.js +0 -132
  199. package/ebay-menu-button/types.js +0 -2
  200. package/ebay-notice-base/components/ebay-notice-content/index.js +0 -8
  201. package/ebay-notice-base/components/ebay-notice-content/notice-content.js +0 -4
  202. package/ebay-notice-base/components/ebay-notice-title/index.js +0 -8
  203. package/ebay-notice-base/components/ebay-notice-title/notice-title.js +0 -8
  204. package/ebay-notice-base/index.js +0 -7
  205. package/ebay-page-notice/index.js +0 -16
  206. package/ebay-page-notice/page-notice-cta.js +0 -9
  207. package/ebay-page-notice/page-notice-footer.js +0 -9
  208. package/ebay-page-notice/page-notice-title.js +0 -23
  209. package/ebay-page-notice/page-notice.js +0 -66
  210. package/ebay-pagination/const.js +0 -8
  211. package/ebay-pagination/helpers.js +0 -92
  212. package/ebay-pagination/index.js +0 -10
  213. package/ebay-pagination/pagination-item.js +0 -55
  214. package/ebay-pagination/pagination.js +0 -146
  215. package/ebay-pagination/types.js +0 -2
  216. package/ebay-panel-dialog/index.js +0 -8
  217. package/ebay-panel-dialog/panel-dialog.js +0 -27
  218. package/ebay-progress-bar/index.js +0 -8
  219. package/ebay-progress-bar/progress-bar.js +0 -23
  220. package/ebay-progress-spinner/index.js +0 -8
  221. package/ebay-progress-spinner/progress-spinner.js +0 -35
  222. package/ebay-progress-stepper/ebay-progress-step.js +0 -64
  223. package/ebay-progress-stepper/ebay-progress-stepper.js +0 -70
  224. package/ebay-progress-stepper/ebay-progress-title.js +0 -5
  225. package/ebay-progress-stepper/index.js +0 -12
  226. package/ebay-progress-stepper/types.js +0 -2
  227. package/ebay-radio/index.js +0 -8
  228. package/ebay-radio/radio.js +0 -71
  229. package/ebay-section-notice/index.js +0 -14
  230. package/ebay-section-notice/section-notice-footer.js +0 -9
  231. package/ebay-section-notice/section-notice-title.js +0 -23
  232. package/ebay-section-notice/section-notice.js +0 -82
  233. package/ebay-section-title/cta.js +0 -26
  234. package/ebay-section-title/index.js +0 -16
  235. package/ebay-section-title/info.js +0 -23
  236. package/ebay-section-title/overflow.js +0 -23
  237. package/ebay-section-title/section-title.js +0 -35
  238. package/ebay-section-title/subtitle.js +0 -23
  239. package/ebay-section-title/title.js +0 -23
  240. package/ebay-select/ebay-select-option.js +0 -22
  241. package/ebay-select/ebay-select.js +0 -129
  242. package/ebay-select/index.js +0 -10
  243. package/ebay-signal/index.js +0 -8
  244. package/ebay-signal/signal.js +0 -24
  245. package/ebay-snackbar-dialog/components/ebay-snackbar-dialog-action.js +0 -24
  246. package/ebay-snackbar-dialog/components/ebay-snackbar-dialog.js +0 -122
  247. package/ebay-snackbar-dialog/index.js +0 -7
  248. package/ebay-split-button/index.js +0 -23
  249. package/ebay-split-button/split-button.js +0 -30
  250. package/ebay-split-button/types.js +0 -2
  251. package/ebay-star-rating/index.js +0 -23
  252. package/ebay-star-rating/star-rating.js +0 -26
  253. package/ebay-star-rating-select/index.js +0 -23
  254. package/ebay-star-rating-select/star-rating-select.js +0 -82
  255. package/ebay-svg/index.js +0 -8
  256. package/ebay-svg/svg.js +0 -2548
  257. package/ebay-switch/ebay-switch.js +0 -61
  258. package/ebay-switch/index.js +0 -8
  259. package/ebay-tabs/index.js +0 -12
  260. package/ebay-tabs/tab-panel.js +0 -24
  261. package/ebay-tabs/tab.js +0 -24
  262. package/ebay-tabs/tabs.js +0 -90
  263. package/ebay-tabs/types.js +0 -2
  264. package/ebay-textbox/index.js +0 -16
  265. package/ebay-textbox/postfix-icon.js +0 -26
  266. package/ebay-textbox/postfix-text.js +0 -8
  267. package/ebay-textbox/prefix-icon.js +0 -23
  268. package/ebay-textbox/prefix-text.js +0 -8
  269. package/ebay-textbox/textbox.js +0 -147
  270. package/ebay-textbox/types.js +0 -2
  271. package/ebay-toast-dialog/components/toast.js +0 -26
  272. package/ebay-toast-dialog/index.js +0 -8
  273. package/ebay-tooltip/ebay-tooltip-content.js +0 -8
  274. package/ebay-tooltip/ebay-tooltip-host.js +0 -8
  275. package/ebay-tooltip/ebay-tooltip.js +0 -85
  276. package/ebay-tooltip/index.js +0 -14
  277. package/ebay-tourtip/ebay-tourtip-content.js +0 -8
  278. package/ebay-tourtip/ebay-tourtip-footer.js +0 -10
  279. package/ebay-tourtip/ebay-tourtip-heading.js +0 -24
  280. package/ebay-tourtip/ebay-tourtip-host.js +0 -8
  281. package/ebay-tourtip/ebay-tourtip.js +0 -70
  282. package/ebay-tourtip/index.js +0 -18
  283. package/ebay-video/const.js +0 -19
  284. package/ebay-video/controls.js +0 -40
  285. package/ebay-video/index.js +0 -25
  286. package/ebay-video/reportButton.js +0 -12
  287. package/ebay-video/source.js +0 -22
  288. package/ebay-video/types.js +0 -2
  289. package/ebay-video/video.js +0 -210
@@ -1,104 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __rest = (this && this.__rest) || function (s, e) {
26
- var t = {};
27
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
28
- t[p] = s[p];
29
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
30
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
31
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
32
- t[p[i]] = s[p[i]];
33
- }
34
- return t;
35
- };
36
- var __importDefault = (this && this.__importDefault) || function (mod) {
37
- return (mod && mod.__esModule) ? mod : { "default": mod };
38
- };
39
- Object.defineProperty(exports, "__esModule", { value: true });
40
- const react_1 = __importStar(require("react"));
41
- const classnames_1 = __importDefault(require("classnames"));
42
- const ebay_dialog_base_1 = require("../../ebay-dialog-base");
43
- const THRESHOLD_TOUCH = 30;
44
- const classPrefix = 'drawer-dialog';
45
- const EbayDrawerDialog = (_a) => {
46
- var { expanded: controlledExpanded = false, noHandle, onClose = () => { }, onCollapsed = () => { }, onExpanded = () => { }, a11yMaximizeText, a11yMinimizeText, children } = _a, rest = __rest(_a, ["expanded", "noHandle", "onClose", "onCollapsed", "onExpanded", "a11yMaximizeText", "a11yMinimizeText", "children"]);
47
- let touches = [];
48
- const [expanded, setExpanded] = (0, react_1.useState)(controlledExpanded);
49
- (0, react_1.useEffect)(() => {
50
- setExpanded(controlledExpanded);
51
- }, [controlledExpanded]);
52
- const setExpandedState = (expand) => {
53
- setExpanded(expand);
54
- if (expand) {
55
- onExpanded();
56
- }
57
- else {
58
- onCollapsed();
59
- }
60
- };
61
- const handleTouchStart = (e) => {
62
- touches = Array.from(e.changedTouches).map(({ identifier, pageY }) => ({ identifier, pageY }));
63
- };
64
- const handleTouchEnd = (e) => {
65
- Array.from(e.changedTouches).forEach(({ identifier }) => {
66
- const idx = touches.findIndex((touch) => touch.identifier === identifier);
67
- if (idx > -1) {
68
- touches.splice(idx, 1);
69
- }
70
- });
71
- };
72
- const handleTouchMove = (e) => {
73
- if (touches.length) {
74
- Array.from(e.changedTouches).forEach(({ identifier, pageY }) => {
75
- const compare = touches.findIndex(touch => touch.identifier === identifier);
76
- const diff = pageY - touches[compare].pageY;
77
- if (diff > THRESHOLD_TOUCH) {
78
- // Drag down, collpase
79
- if (expanded) {
80
- setExpandedState(false);
81
- }
82
- else {
83
- onClose();
84
- }
85
- handleTouchEnd(e);
86
- }
87
- else if (diff < -THRESHOLD_TOUCH) {
88
- setExpandedState(true);
89
- handleTouchEnd(e);
90
- }
91
- });
92
- }
93
- };
94
- const handle = noHandle ? null : (react_1.default.createElement("button", { "aria-label": expanded ? a11yMinimizeText : a11yMaximizeText, className: `${classPrefix}__handle`, onClick: () => setExpandedState(!expanded), onScroll: () => setExpandedState(true), onTouchStart: handleTouchStart, onTouchMove: handleTouchMove, onTouchEnd: handleTouchEnd, type: "button" }));
95
- const childrenArray = react_1.Children.toArray(children);
96
- const header = childrenArray.find(({ type }) => type === ebay_dialog_base_1.EbayDialogHeader);
97
- const withoutHeader = childrenArray.filter(({ type }) => type !== ebay_dialog_base_1.EbayDialogHeader);
98
- return (react_1.default.createElement(ebay_dialog_base_1.DialogBaseWithState, Object.assign({}, rest, { classPrefix: classPrefix, onCloseBtnClick: onClose, className: (0, classnames_1.default)(rest.className, `${classPrefix}--mask-fade-slow`), windowClass: (0, classnames_1.default)(rest.windowClass, `${classPrefix}__window`, `${classPrefix}__window--slide`, {
99
- [`${classPrefix}__window--expanded`]: expanded
100
- }), onBackgroundClick: onClose, top: handle }),
101
- header || react_1.default.createElement(ebay_dialog_base_1.EbayDialogHeader, null),
102
- withoutHeader));
103
- };
104
- exports.default = EbayDrawerDialog;
@@ -1,8 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.EbayDrawerDialog = void 0;
7
- var drawer_1 = require("./components/drawer");
8
- Object.defineProperty(exports, "EbayDrawerDialog", { enumerable: true, get: function () { return __importDefault(drawer_1).default; } });
@@ -1,23 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const react_1 = __importDefault(require("react"));
7
- const classnames_1 = __importDefault(require("classnames"));
8
- const eek_util_1 = __importDefault(require("./eek-util"));
9
- const ebay_icon_1 = require("../ebay-icon");
10
- const EbayEek = ({ min = '', max = '', rating, a11yText, className: extraClasses }) => {
11
- const parsedRating = (0, eek_util_1.default)({ rating, min, max });
12
- const className = (0, classnames_1.default)(extraClasses, 'eek', { [`eek--rating-${parsedRating}`]: !!parsedRating });
13
- const backupA11yText = `Energy Rating: ${rating}. Range: ${max} - ${min}.`;
14
- return (react_1.default.createElement("div", { className: className, role: "figure", "aria-label": a11yText || backupA11yText },
15
- react_1.default.createElement("div", { className: "eek__container", "aria-hidden": true },
16
- react_1.default.createElement("span", { className: "eek__rating-range" },
17
- react_1.default.createElement("span", { "aria-hidden": "true" }, max),
18
- react_1.default.createElement(ebay_icon_1.EbayIcon, { name: "eekRangeArrow" }),
19
- react_1.default.createElement("span", { "aria-hidden": "true" }, min)),
20
- react_1.default.createElement("span", { className: "eek__rating", "aria-hidden": "true" }, rating)),
21
- react_1.default.createElement(ebay_icon_1.EbayIcon, { name: "eekArrow" })));
22
- };
23
- exports.default = EbayEek;
@@ -1,34 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const validRanges = {
4
- 'A+++': ['D', 'E', 'G'],
5
- 'A++': ['E', 'G'],
6
- 'A+': ['F', 'G'],
7
- A: ['G']
8
- };
9
- exports.default = (input) => {
10
- const { max, min, rating } = input;
11
- const validMax = validRanges[max];
12
- if (!(validMax && validMax.indexOf(min) > -1)) {
13
- return null;
14
- }
15
- // Count from max until you reach rating
16
- let current = max;
17
- let i = 1;
18
- while (current !== rating) {
19
- i++;
20
- if (min === current) {
21
- // It's at end, didn't match rating
22
- return null;
23
- }
24
- else if (current.length > 1) {
25
- // Has + in string, remove one plus
26
- current = current.slice(0, current.length - 1);
27
- }
28
- else {
29
- // No pluses get next character code
30
- current = String.fromCharCode(current.charCodeAt(0) + 1);
31
- }
32
- }
33
- return i > 7 ? 7 : i;
34
- };
package/ebay-eek/index.js DELETED
@@ -1,8 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.EbayEek = void 0;
7
- var eek_rating_1 = require("./eek-rating");
8
- Object.defineProperty(exports, "EbayEek", { enumerable: true, get: function () { return __importDefault(eek_rating_1).default; } });
@@ -1,12 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.EbayFakeMenuSeparator = exports.EbayFakeMenuItem = exports.EbayFakeMenu = void 0;
7
- var menu_1 = require("./menu");
8
- Object.defineProperty(exports, "EbayFakeMenu", { enumerable: true, get: function () { return __importDefault(menu_1).default; } });
9
- var menu_item_1 = require("./menu-item");
10
- Object.defineProperty(exports, "EbayFakeMenuItem", { enumerable: true, get: function () { return __importDefault(menu_item_1).default; } });
11
- var menu_item_separator_1 = require("./menu-item-separator");
12
- Object.defineProperty(exports, "EbayFakeMenuSeparator", { enumerable: true, get: function () { return __importDefault(menu_item_separator_1).default; } });
@@ -1,23 +0,0 @@
1
- "use strict";
2
- var __rest = (this && this.__rest) || function (s, e) {
3
- var t = {};
4
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
- t[p] = s[p];
6
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
- t[p[i]] = s[p[i]];
10
- }
11
- return t;
12
- };
13
- var __importDefault = (this && this.__importDefault) || function (mod) {
14
- return (mod && mod.__esModule) ? mod : { "default": mod };
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- const react_1 = __importDefault(require("react"));
18
- const classnames_1 = __importDefault(require("classnames"));
19
- const EbayMenuItemSeparator = (_a) => {
20
- var { className } = _a, rest = __rest(_a, ["className"]);
21
- return (react_1.default.createElement("hr", Object.assign({}, rest, { className: (0, classnames_1.default)(className, 'fake-menu__separator'), role: "separator" })));
22
- };
23
- exports.default = EbayMenuItemSeparator;
@@ -1,72 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __rest = (this && this.__rest) || function (s, e) {
26
- var t = {};
27
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
28
- t[p] = s[p];
29
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
30
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
31
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
32
- t[p[i]] = s[p[i]];
33
- }
34
- return t;
35
- };
36
- var __importDefault = (this && this.__importDefault) || function (mod) {
37
- return (mod && mod.__esModule) ? mod : { "default": mod };
38
- };
39
- Object.defineProperty(exports, "__esModule", { value: true });
40
- const react_1 = __importStar(require("react"));
41
- const classnames_1 = __importDefault(require("classnames"));
42
- const ebay_icon_1 = require("../ebay-icon");
43
- const ebay_badge_1 = require("../ebay-badge");
44
- const EbayMenuItem = (_a) => {
45
- var { className, current, disabled, autoFocus, type, badgeNumber, badgeAriaLabel, children } = _a, rest = __rest(_a, ["className", "current", "disabled", "autoFocus", "type", "badgeNumber", "badgeAriaLabel", "children"]);
46
- const ref = (0, react_1.useRef)();
47
- const hasBadge = badgeNumber !== undefined;
48
- (0, react_1.useEffect)(() => {
49
- var _a;
50
- if (autoFocus) {
51
- (_a = ref.current) === null || _a === void 0 ? void 0 : _a.focus();
52
- }
53
- });
54
- const itemProps = Object.assign(Object.assign({}, rest), { ref, className: (0, classnames_1.default)(className, 'fake-menu__item', hasBadge && 'menu__item--badged'), 'aria-label': badgeAriaLabel });
55
- const tick = react_1.default.createElement(ebay_icon_1.EbayIcon, { name: "tick16" });
56
- // todo: remove this workaround when Skin team fixes https://github.com/eBay/skin/issues/2208
57
- const badgeStyleFix = {
58
- marginLeft: 'var(--spacing-100)',
59
- marginRight: 'var(--spacing-100)'
60
- };
61
- const badge = hasBadge && react_1.default.createElement(ebay_badge_1.EbayBadge, { type: "menu", number: badgeNumber, style: badgeStyleFix });
62
- return type === 'button' ? (react_1.default.createElement("button", Object.assign({}, itemProps, { type: "button", disabled: disabled }),
63
- react_1.default.createElement("span", null,
64
- children,
65
- badge),
66
- tick)) : (react_1.default.createElement("a", Object.assign({}, itemProps, { "aria-disabled": disabled ? 'true' : undefined }),
67
- react_1.default.createElement("span", null,
68
- children,
69
- badge),
70
- tick));
71
- };
72
- exports.default = EbayMenuItem;
@@ -1,57 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __rest = (this && this.__rest) || function (s, e) {
26
- var t = {};
27
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
28
- t[p] = s[p];
29
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
30
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
31
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
32
- t[p[i]] = s[p[i]];
33
- }
34
- return t;
35
- };
36
- var __importDefault = (this && this.__importDefault) || function (mod) {
37
- return (mod && mod.__esModule) ? mod : { "default": mod };
38
- };
39
- Object.defineProperty(exports, "__esModule", { value: true });
40
- const react_1 = __importStar(require("react"));
41
- const classnames_1 = __importDefault(require("classnames"));
42
- const EbayFakeMenu = (_a) => {
43
- var { className, itemMatchesUrl = true, onKeyDown = () => { }, onSelect = () => { }, children } = _a, rest = __rest(_a, ["className", "itemMatchesUrl", "onKeyDown", "onSelect", "children"]);
44
- const childrenArray = react_1.Children.toArray(children);
45
- const defaultAriaCurrent = itemMatchesUrl === false ? 'true' : 'page';
46
- return (react_1.default.createElement("div", Object.assign({}, rest, { className: (0, classnames_1.default)(className, 'fake-menu') }),
47
- react_1.default.createElement("ul", { className: "fake-menu__items", tabIndex: -1 }, childrenArray.map((child, i) => {
48
- const _a = child.props, { current, onClick = () => { } } = _a, itemRest = __rest(_a, ["current", "onClick"]);
49
- return (react_1.default.createElement("li", { key: i }, (0, react_1.cloneElement)(child, Object.assign(Object.assign({}, itemRest), { 'aria-current': current ? defaultAriaCurrent : undefined, onClick: e => {
50
- onSelect(e, { index: i });
51
- onClick(e);
52
- }, onKeyDown: e => {
53
- onKeyDown(e, { index: i });
54
- } }))));
55
- }))));
56
- };
57
- exports.default = EbayFakeMenu;
@@ -1,14 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.EbayFakeMenuButtonLabel = exports.EbayFakeMenuButtonSeparator = exports.EbayFakeMenuButtonItem = exports.EbayFakeMenuButton = void 0;
7
- var menu_button_1 = require("./menu-button");
8
- Object.defineProperty(exports, "EbayFakeMenuButton", { enumerable: true, get: function () { return __importDefault(menu_button_1).default; } });
9
- var menu_button_item_1 = require("./menu-button-item");
10
- Object.defineProperty(exports, "EbayFakeMenuButtonItem", { enumerable: true, get: function () { return __importDefault(menu_button_item_1).default; } });
11
- var menu_button_separator_1 = require("./menu-button-separator");
12
- Object.defineProperty(exports, "EbayFakeMenuButtonSeparator", { enumerable: true, get: function () { return __importDefault(menu_button_separator_1).default; } });
13
- var menu_button_label_1 = require("./menu-button-label");
14
- Object.defineProperty(exports, "EbayFakeMenuButtonLabel", { enumerable: true, get: function () { return __importDefault(menu_button_label_1).default; } });
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const ebay_fake_menu_1 = require("../ebay-fake-menu");
4
- const EbayFakeMenuButtonItem = ebay_fake_menu_1.EbayFakeMenuItem;
5
- exports.default = EbayFakeMenuButtonItem;
@@ -1,8 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const react_1 = __importDefault(require("react"));
7
- const EbayFakeMenuButtonLabel = ({ children }) => (react_1.default.createElement(react_1.default.Fragment, null, children));
8
- exports.default = EbayFakeMenuButtonLabel;
@@ -1,23 +0,0 @@
1
- "use strict";
2
- var __rest = (this && this.__rest) || function (s, e) {
3
- var t = {};
4
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
- t[p] = s[p];
6
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
- t[p[i]] = s[p[i]];
10
- }
11
- return t;
12
- };
13
- var __importDefault = (this && this.__importDefault) || function (mod) {
14
- return (mod && mod.__esModule) ? mod : { "default": mod };
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- const react_1 = __importDefault(require("react"));
18
- const classnames_1 = __importDefault(require("classnames"));
19
- const EbayMenuButtonSeparator = (_a) => {
20
- var { className } = _a, rest = __rest(_a, ["className"]);
21
- return (react_1.default.createElement("hr", Object.assign({}, rest, { className: (0, classnames_1.default)(className, 'menu-button__separator'), role: "separator" })));
22
- };
23
- exports.default = EbayMenuButtonSeparator;
@@ -1,105 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __rest = (this && this.__rest) || function (s, e) {
26
- var t = {};
27
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
28
- t[p] = s[p];
29
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
30
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
31
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
32
- t[p[i]] = s[p[i]];
33
- }
34
- return t;
35
- };
36
- var __importDefault = (this && this.__importDefault) || function (mod) {
37
- return (mod && mod.__esModule) ? mod : { "default": mod };
38
- };
39
- Object.defineProperty(exports, "__esModule", { value: true });
40
- const react_1 = __importStar(require("react"));
41
- const classnames_1 = __importDefault(require("classnames"));
42
- const component_utils_1 = require("../common/component-utils");
43
- const event_utils_1 = require("../common/event-utils");
44
- const random_id_1 = require("../common/random-id");
45
- const ebay_button_1 = require("../ebay-button");
46
- const ebay_icon_1 = require("../ebay-icon");
47
- const ebay_icon_button_1 = require("../ebay-icon-button");
48
- const ebay_fake_menu_1 = require("../ebay-fake-menu");
49
- const _1 = require(".");
50
- const EbayMenuButton = (_a) => {
51
- var { a11yText, noToggleIcon, fixWidth, reverse, variant, expanded: defaultExpanded = false, className, onCollapse = () => { }, onExpand = () => { }, onMouseDown = () => { }, onSelect = () => { }, text = '', children } = _a, rest = __rest(_a, ["a11yText", "noToggleIcon", "fixWidth", "reverse", "variant", "expanded", "className", "onCollapse", "onExpand", "onMouseDown", "onSelect", "text", "children"]);
52
- const [expanded, setExpanded] = (0, react_1.useState)(defaultExpanded);
53
- const [menuId, setMenuId] = (0, react_1.useState)();
54
- const ref = (0, react_1.useRef)();
55
- const icon = (0, component_utils_1.findComponent)(children, ebay_icon_1.EbayIcon);
56
- const label = (0, component_utils_1.findComponent)(children, _1.EbayFakeMenuButtonLabel) || (icon ? react_1.default.createElement("span", null, text) : text);
57
- const menuItems = (0, component_utils_1.filterByType)(children, [_1.EbayFakeMenuButtonItem, _1.EbayFakeMenuButtonSeparator]);
58
- (0, react_1.useEffect)(() => {
59
- const handleBackgroundClick = (e) => {
60
- if (ref.current && !ref.current.contains(e.currentTarget)) {
61
- setExpanded(false);
62
- }
63
- };
64
- if (expanded) {
65
- onExpand();
66
- // On React 18 useEffect hooks runs synchronous instead of asynchronous as React 17 or prior
67
- // causing the event listener to be attached to the document at the same time that the dialog
68
- // opens. Adding a timeout so the event is attached after the click event that opened the modal
69
- // is finished.
70
- setTimeout(() => {
71
- document.addEventListener('click', handleBackgroundClick, false);
72
- });
73
- }
74
- else if (expanded === false) {
75
- onCollapse();
76
- }
77
- return () => document.removeEventListener('click', handleBackgroundClick, false);
78
- }, [expanded]);
79
- (0, react_1.useEffect)(() => {
80
- setMenuId((0, random_id_1.randomId)());
81
- }, []);
82
- const handleMenuKeydown = e => {
83
- (0, event_utils_1.handleEscapeKeydown)(e, () => {
84
- var _a;
85
- setExpanded(false);
86
- (_a = ref.current) === null || _a === void 0 ? void 0 : _a.focus();
87
- });
88
- };
89
- const menuClasses = (0, classnames_1.default)('fake-menu-button__menu', {
90
- 'menu-button__menu--fix-width': fixWidth,
91
- 'menu-button__menu--reverse': reverse
92
- });
93
- const buttonProps = Object.assign({ ref: ref, className: 'fake-menu-button__button', 'aria-expanded': !!expanded, 'aria-haspopup': true, 'aria-label': a11yText, 'aria-controls': menuId, onClick: () => setExpanded(!expanded) }, rest);
94
- return (react_1.default.createElement("span", { className: (0, classnames_1.default)('fake-menu-button', className) },
95
- variant === 'overflow' ?
96
- react_1.default.createElement(ebay_icon_button_1.EbayIconButton, Object.assign({ icon: "overflowHorizontal24" }, buttonProps)) :
97
- react_1.default.createElement(ebay_button_1.EbayButton, Object.assign({ variant: variant === 'form' ? 'form' : undefined, bodyState: noToggleIcon ? undefined : 'expand' }, buttonProps),
98
- icon,
99
- label),
100
- expanded &&
101
- react_1.default.createElement(ebay_fake_menu_1.EbayFakeMenu, { className: menuClasses, id: menuId, tabIndex: -1, onKeyDown: handleMenuKeydown, onSelect: onSelect }, menuItems.map((item, i) => (0, react_1.cloneElement)(item, Object.assign(Object.assign({}, item.props), { onMouseDown: (e) => {
102
- onMouseDown(e, { index: i });
103
- }, className: (0, classnames_1.default)(item.props.className, 'fake-menu-button__item'), key: i, autoFocus: i === 0 }))))));
104
- };
105
- exports.default = EbayMenuButton;
@@ -1,54 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __rest = (this && this.__rest) || function (s, e) {
26
- var t = {};
27
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
28
- t[p] = s[p];
29
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
30
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
31
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
32
- t[p[i]] = s[p[i]];
33
- }
34
- return t;
35
- };
36
- var __importDefault = (this && this.__importDefault) || function (mod) {
37
- return (mod && mod.__esModule) ? mod : { "default": mod };
38
- };
39
- Object.defineProperty(exports, "__esModule", { value: true });
40
- const react_1 = __importStar(require("react"));
41
- const classnames_1 = __importDefault(require("classnames"));
42
- const component_utils_1 = require("../common/component-utils");
43
- const tab_1 = __importDefault(require("./tab"));
44
- const EbayFakeTabs = (_a) => {
45
- var { selectedIndex = 0, tabMatchesCurrentUrl, className, children } = _a, rest = __rest(_a, ["selectedIndex", "tabMatchesCurrentUrl", "className", "children"]);
46
- const ariaCurrent = tabMatchesCurrentUrl === false ? 'true' : 'page';
47
- const tabHeadings = (0, component_utils_1.filterByType)(children, tab_1.default).map((item, i) => (0, react_1.cloneElement)(item, Object.assign(Object.assign({}, item.props), { ariaCurrent: selectedIndex === i ? ariaCurrent : null })));
48
- const tabContent = (0, component_utils_1.excludeComponent)(children, tab_1.default);
49
- return (react_1.default.createElement("div", Object.assign({}, rest, { className: (0, classnames_1.default)(className, 'fake-tabs') }),
50
- react_1.default.createElement("ul", { className: "fake-tabs__items" }, tabHeadings),
51
- react_1.default.createElement("div", { className: "fake-tabs__content" },
52
- react_1.default.createElement("div", { className: "fake-tabs__cell" }, tabContent))));
53
- };
54
- exports.default = EbayFakeTabs;
@@ -1,10 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.EbayFakeTab = exports.EbayFakeTabs = void 0;
7
- var fake_tabs_1 = require("./fake-tabs");
8
- Object.defineProperty(exports, "EbayFakeTabs", { enumerable: true, get: function () { return __importDefault(fake_tabs_1).default; } });
9
- var tab_1 = require("./tab");
10
- Object.defineProperty(exports, "EbayFakeTab", { enumerable: true, get: function () { return __importDefault(tab_1).default; } });
@@ -1,24 +0,0 @@
1
- "use strict";
2
- var __rest = (this && this.__rest) || function (s, e) {
3
- var t = {};
4
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
- t[p] = s[p];
6
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
- t[p[i]] = s[p[i]];
10
- }
11
- return t;
12
- };
13
- var __importDefault = (this && this.__importDefault) || function (mod) {
14
- return (mod && mod.__esModule) ? mod : { "default": mod };
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- const react_1 = __importDefault(require("react"));
18
- const classnames_1 = __importDefault(require("classnames"));
19
- const Tab = (_a) => {
20
- var { children, href, ariaCurrent, className } = _a, rest = __rest(_a, ["children", "href", "ariaCurrent", "className"]);
21
- return (react_1.default.createElement("li", Object.assign({}, rest, { className: (0, classnames_1.default)(className, 'fake-tabs__item') }),
22
- react_1.default.createElement("a", { href: href, "aria-current": ariaCurrent }, children)));
23
- };
24
- exports.default = Tab;
@@ -1,26 +0,0 @@
1
- "use strict";
2
- var __rest = (this && this.__rest) || function (s, e) {
3
- var t = {};
4
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
- t[p] = s[p];
6
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
- t[p[i]] = s[p[i]];
10
- }
11
- return t;
12
- };
13
- var __importDefault = (this && this.__importDefault) || function (mod) {
14
- return (mod && mod.__esModule) ? mod : { "default": mod };
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- const react_1 = __importDefault(require("react"));
18
- const classnames_1 = __importDefault(require("classnames"));
19
- const Description = (_a) => {
20
- var { type, position = 'below', className, children } = _a, rest = __rest(_a, ["type", "position", "className", "children"]);
21
- const wrapperClassName = (0, classnames_1.default)(className, 'field__description', { [`field__description--${type}`]: type });
22
- const WrapperElement = position === 'below' ? `div` : `span`;
23
- return (react_1.default.createElement(WrapperElement, Object.assign({}, rest, { className: wrapperClassName }),
24
- react_1.default.createElement("span", null, children)));
25
- };
26
- exports.default = Description;