@ebay/ui-core-react 6.2.1 → 6.3.0

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 (171) hide show
  1. package/common/component-utils/array.polyfill.flat.js +11 -13
  2. package/common/component-utils/forwardRef.js +4 -17
  3. package/common/component-utils/usePrevious.js +3 -3
  4. package/common/component-utils/utils.js +13 -26
  5. package/common/debounce.js +3 -7
  6. package/common/event-utils/index.js +8 -11
  7. package/common/event-utils/use-key-press.js +10 -12
  8. package/common/event-utils/use-roving-index.js +13 -24
  9. package/common/floating-label-utils/hooks.js +43 -53
  10. package/common/notice-utils/notice-content.js +5 -6
  11. package/common/notice-utils/notice-cta.js +5 -16
  12. package/common/notice-utils/notice-footer.js +5 -16
  13. package/common/notice-utils/notice-title.js +6 -17
  14. package/common/random-id.js +1 -1
  15. package/common/range.js +1 -4
  16. package/common/tooltip-utils/tooltip-close-button.js +1 -1
  17. package/common/tooltip-utils/tooltip-content.js +16 -28
  18. package/common/tooltip-utils/tooltip-footer.js +3 -6
  19. package/common/tooltip-utils/tooltip-host.js +5 -16
  20. package/common/tooltip-utils/tooltip.d.ts +1 -1
  21. package/common/tooltip-utils/tooltip.js +14 -26
  22. package/common/tooltip-utils/use-tooltip.js +8 -9
  23. package/ebay-alert-dialog/alert-dialog.js +11 -22
  24. package/ebay-badge/badge.js +6 -17
  25. package/ebay-breadcrumbs/breadcrumb-item.js +7 -18
  26. package/ebay-breadcrumbs/breadcrumbs.js +19 -30
  27. package/ebay-button/button-cell.js +5 -16
  28. package/ebay-button/button-expand.d.ts +4 -2
  29. package/ebay-button/button-expand.d.ts.map +1 -1
  30. package/ebay-button/button-expand.js +7 -10
  31. package/ebay-button/button-loading.js +5 -5
  32. package/ebay-button/button-text.js +3 -6
  33. package/ebay-button/button.d.ts +1 -1
  34. package/ebay-button/button.js +31 -43
  35. package/ebay-calendar/calendar.js +94 -111
  36. package/ebay-calendar/date-utils.js +9 -18
  37. package/ebay-carousel/carousel-control-button.js +9 -10
  38. package/ebay-carousel/carousel-item.d.ts +1 -1
  39. package/ebay-carousel/carousel-item.js +14 -25
  40. package/ebay-carousel/carousel-list.js +21 -22
  41. package/ebay-carousel/carousel.js +32 -44
  42. package/ebay-carousel/helpers.js +35 -47
  43. package/ebay-carousel/scroll-to-transition.js +15 -15
  44. package/ebay-checkbox/checkbox.js +21 -32
  45. package/ebay-confirm-dialog/confirm-dialog.js +11 -22
  46. package/ebay-cta-button/cta-button.d.ts +1 -1
  47. package/ebay-cta-button/cta-button.js +9 -20
  48. package/ebay-date-textbox/date-textbox.js +37 -53
  49. package/ebay-dialog-base/components/animation.d.ts +0 -1
  50. package/ebay-dialog-base/components/animation.d.ts.map +1 -1
  51. package/ebay-dialog-base/components/animation.js +25 -28
  52. package/ebay-dialog-base/components/dialog-actions.js +2 -5
  53. package/ebay-dialog-base/components/dialog-close-button.d.ts +5 -2
  54. package/ebay-dialog-base/components/dialog-close-button.d.ts.map +1 -1
  55. package/ebay-dialog-base/components/dialog-close-button.js +2 -5
  56. package/ebay-dialog-base/components/dialog-footer.js +2 -5
  57. package/ebay-dialog-base/components/dialog-header.js +4 -15
  58. package/ebay-dialog-base/components/dialog-previous-button.js +6 -17
  59. package/ebay-dialog-base/components/dialogBase.js +40 -51
  60. package/ebay-dialog-base/dialog-base-with-state.js +22 -35
  61. package/ebay-drawer-dialog/components/drawer.js +27 -50
  62. package/ebay-eek/eek-rating.js +8 -10
  63. package/ebay-eek/eek-util.d.ts +1 -1
  64. package/ebay-eek/eek-util.d.ts.map +1 -1
  65. package/ebay-eek/eek-util.js +7 -6
  66. package/ebay-fake-menu/menu-item-separator.js +5 -16
  67. package/ebay-fake-menu/menu-item.js +15 -26
  68. package/ebay-fake-menu/menu.js +11 -22
  69. package/ebay-fake-menu-button/menu-button-item.js +2 -2
  70. package/ebay-fake-menu-button/menu-button-label.d.ts +4 -2
  71. package/ebay-fake-menu-button/menu-button-label.d.ts.map +1 -1
  72. package/ebay-fake-menu-button/menu-button-label.js +2 -5
  73. package/ebay-fake-menu-button/menu-button-separator.js +5 -16
  74. package/ebay-fake-menu-button/menu-button.js +32 -45
  75. package/ebay-fake-tabs/fake-tabs.js +10 -23
  76. package/ebay-fake-tabs/tab.js +5 -16
  77. package/ebay-field/description.js +7 -19
  78. package/ebay-field/field.js +4 -5
  79. package/ebay-field/label.js +7 -18
  80. package/ebay-fullscreen-dialog/fullscreen-dialog.js +7 -18
  81. package/ebay-icon/icon.d.ts +1 -1
  82. package/ebay-icon/icon.js +17 -29
  83. package/ebay-icon-button/icon-button.d.ts +1 -1
  84. package/ebay-icon-button/icon-button.js +15 -27
  85. package/ebay-infotip/ebay-infotip-content.js +2 -5
  86. package/ebay-infotip/ebay-infotip-heading.js +5 -16
  87. package/ebay-infotip/ebay-infotip-host.d.ts +2 -2
  88. package/ebay-infotip/ebay-infotip-host.d.ts.map +1 -1
  89. package/ebay-infotip/ebay-infotip-host.js +10 -24
  90. package/ebay-infotip/ebay-infotip.d.ts.map +1 -1
  91. package/ebay-infotip/ebay-infotip.js +23 -34
  92. package/ebay-inline-notice/inline-notice.js +15 -27
  93. package/ebay-lightbox-dialog/lightbox-dialog.js +9 -21
  94. package/ebay-listbox-button/listbox-button-option.js +7 -18
  95. package/ebay-listbox-button/listbox-button.d.ts.map +1 -1
  96. package/ebay-listbox-button/listbox-button.js +79 -100
  97. package/ebay-menu/menu-item-separator.js +5 -16
  98. package/ebay-menu/menu-item.js +12 -23
  99. package/ebay-menu/menu.d.ts +1 -1
  100. package/ebay-menu/menu.js +37 -64
  101. package/ebay-menu-button/README.md +1 -1
  102. package/ebay-menu-button/menu-button-item.js +1 -1
  103. package/ebay-menu-button/menu-button-label.d.ts +4 -2
  104. package/ebay-menu-button/menu-button-label.d.ts.map +1 -1
  105. package/ebay-menu-button/menu-button-label.js +2 -5
  106. package/ebay-menu-button/menu-button-separator.js +5 -16
  107. package/ebay-menu-button/menu-button.js +46 -60
  108. package/ebay-notice-base/components/ebay-notice-content/notice-content.js +1 -1
  109. package/ebay-notice-base/components/ebay-notice-title/notice-title.d.ts +5 -2
  110. package/ebay-notice-base/components/ebay-notice-title/notice-title.d.ts.map +1 -1
  111. package/ebay-notice-base/components/ebay-notice-title/notice-title.js +2 -5
  112. package/ebay-page-notice/page-notice-cta.js +3 -6
  113. package/ebay-page-notice/page-notice-footer.js +3 -6
  114. package/ebay-page-notice/page-notice-title.js +5 -16
  115. package/ebay-page-notice/page-notice.js +16 -27
  116. package/ebay-pagination/helpers.js +21 -24
  117. package/ebay-pagination/pagination-item.d.ts +1 -1
  118. package/ebay-pagination/pagination-item.js +16 -27
  119. package/ebay-pagination/pagination.js +52 -81
  120. package/ebay-panel-dialog/panel-dialog.js +9 -21
  121. package/ebay-progress-bar/progress-bar.js +5 -16
  122. package/ebay-progress-spinner/progress-spinner.js +7 -18
  123. package/ebay-progress-stepper/ebay-progress-step.js +14 -25
  124. package/ebay-progress-stepper/ebay-progress-stepper.js +10 -21
  125. package/ebay-progress-stepper/ebay-progress-title.js +2 -5
  126. package/ebay-radio/radio.js +18 -29
  127. package/ebay-section-notice/section-notice-footer.js +3 -6
  128. package/ebay-section-notice/section-notice-title.js +5 -16
  129. package/ebay-section-notice/section-notice.js +24 -39
  130. package/ebay-section-title/cta.js +5 -16
  131. package/ebay-section-title/info.js +5 -16
  132. package/ebay-section-title/overflow.js +5 -16
  133. package/ebay-section-title/section-title.js +13 -24
  134. package/ebay-section-title/subtitle.js +5 -16
  135. package/ebay-section-title/title.js +5 -16
  136. package/ebay-select/ebay-select-option.js +4 -15
  137. package/ebay-select/ebay-select.d.ts +1 -1
  138. package/ebay-select/ebay-select.js +34 -45
  139. package/ebay-signal/signal.js +6 -17
  140. package/ebay-snackbar-dialog/components/ebay-snackbar-dialog-action.js +5 -16
  141. package/ebay-snackbar-dialog/components/ebay-snackbar-dialog.js +27 -38
  142. package/ebay-split-button/split-button.js +10 -21
  143. package/ebay-star-rating/star-rating.js +8 -19
  144. package/ebay-star-rating-select/star-rating-select.js +20 -31
  145. package/ebay-svg/svg.js +3 -3
  146. package/ebay-switch/ebay-switch.js +10 -21
  147. package/ebay-tabs/tab-panel.js +5 -16
  148. package/ebay-tabs/tab.js +5 -16
  149. package/ebay-tabs/tabs.js +26 -40
  150. package/ebay-textbox/postfix-icon.js +7 -18
  151. package/ebay-textbox/prefix-icon.js +5 -16
  152. package/ebay-textbox/textbox.d.ts +1 -1
  153. package/ebay-textbox/textbox.js +42 -53
  154. package/ebay-toast-dialog/components/toast.js +6 -17
  155. package/ebay-tooltip/ebay-tooltip-content.js +1 -1
  156. package/ebay-tooltip/ebay-tooltip-host.js +1 -1
  157. package/ebay-tooltip/ebay-tooltip.js +21 -32
  158. package/ebay-tourtip/ebay-tourtip-content.js +1 -1
  159. package/ebay-tourtip/ebay-tourtip-footer.js +4 -7
  160. package/ebay-tourtip/ebay-tourtip-heading.js +6 -17
  161. package/ebay-tourtip/ebay-tourtip-host.js +1 -1
  162. package/ebay-tourtip/ebay-tourtip.js +22 -33
  163. package/ebay-video/controls.d.ts.map +1 -1
  164. package/ebay-video/controls.js +23 -46
  165. package/ebay-video/reportButton.d.ts +7 -2
  166. package/ebay-video/reportButton.d.ts.map +1 -1
  167. package/ebay-video/reportButton.js +5 -8
  168. package/ebay-video/source.js +3 -14
  169. package/ebay-video/video.d.ts.map +1 -1
  170. package/ebay-video/video.js +54 -80
  171. package/package.json +23 -18
package/ebay-tabs/tab.js CHANGED
@@ -1,15 +1,4 @@
1
1
  "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
2
  var __rest = (this && this.__rest) || function (s, e) {
14
3
  var t = {};
15
4
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -25,11 +14,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
25
14
  return (mod && mod.__esModule) ? mod : { "default": mod };
26
15
  };
27
16
  Object.defineProperty(exports, "__esModule", { value: true });
28
- var react_1 = __importDefault(require("react"));
29
- var classnames_1 = __importDefault(require("classnames"));
30
- var Tab = function (_a) {
31
- var children = _a.children, index = _a.index, parentId = _a.parentId, selected = _a.selected, focused = _a.focused, className = _a.className, refCallback = _a.refCallback, rest = __rest(_a, ["children", "index", "parentId", "selected", "focused", "className", "refCallback"]);
32
- return (react_1.default.createElement("div", __assign({}, rest, { ref: refCallback, "aria-controls": "".concat(parentId || 'default', "-tabpanel-").concat(index), "aria-selected": selected, className: (0, classnames_1.default)(className, 'tabs__item'), id: "".concat(parentId || 'default', "-tab-").concat(index), role: "tab", tabIndex: focused ? 0 : -1 }),
17
+ const react_1 = __importDefault(require("react"));
18
+ const classnames_1 = __importDefault(require("classnames"));
19
+ const Tab = (_a) => {
20
+ var { children, index, parentId, selected, focused, className, refCallback } = _a, rest = __rest(_a, ["children", "index", "parentId", "selected", "focused", "className", "refCallback"]);
21
+ return (react_1.default.createElement("div", Object.assign({}, rest, { ref: refCallback, "aria-controls": `${parentId || 'default'}-tabpanel-${index}`, "aria-selected": selected, className: (0, classnames_1.default)(className, 'tabs__item'), id: `${parentId || 'default'}-tab-${index}`, role: "tab", tabIndex: focused ? 0 : -1 }),
33
22
  react_1.default.createElement("span", null, children)));
34
23
  };
35
24
  exports.default = Tab;
package/ebay-tabs/tabs.js CHANGED
@@ -1,15 +1,4 @@
1
1
  "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
3
  if (k2 === undefined) k2 = k;
15
4
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -37,18 +26,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
37
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
38
27
  };
39
28
  Object.defineProperty(exports, "__esModule", { value: true });
40
- var react_1 = __importStar(require("react"));
41
- var classnames_1 = __importDefault(require("classnames"));
42
- var event_utils_1 = require("../common/event-utils");
43
- var component_utils_1 = require("../common/component-utils");
44
- var tab_1 = __importDefault(require("./tab"));
45
- var tab_panel_1 = __importDefault(require("./tab-panel"));
46
- var Tabs = function (_a) {
47
- var id = _a.id, className = _a.className, _b = _a.index, index = _b === void 0 ? 0 : _b, _c = _a.size, size = _c === void 0 ? 'medium' : _c, _d = _a.activation, activation = _d === void 0 ? 'auto' : _d, _e = _a.onSelect, onSelect = _e === void 0 ? function () { } : _e, _f = _a.onTabSelect, onTabSelect = _f === void 0 ? function () { } : _f, children = _a.children;
48
- var headings = [];
49
- var _g = (0, react_1.useState)(index), selectedIndex = _g[0], setSelectedIndex = _g[1];
50
- var _h = (0, react_1.useState)(index), focusedIndex = _h[0], setFocusedIndex = _h[1];
51
- var handleSelect = function (i) {
29
+ const react_1 = __importStar(require("react"));
30
+ const classnames_1 = __importDefault(require("classnames"));
31
+ const event_utils_1 = require("../common/event-utils");
32
+ const component_utils_1 = require("../common/component-utils");
33
+ const tab_1 = __importDefault(require("./tab"));
34
+ const tab_panel_1 = __importDefault(require("./tab-panel"));
35
+ const Tabs = ({ id, className, index = 0, size = 'medium', activation = 'auto', onSelect = () => { }, onTabSelect = () => { }, children }) => {
36
+ const headings = [];
37
+ const [selectedIndex, setSelectedIndex] = (0, react_1.useState)(index);
38
+ const [focusedIndex, setFocusedIndex] = (0, react_1.useState)(index);
39
+ const handleSelect = (i) => {
52
40
  onSelect({ selectedIndex: i });
53
41
  onTabSelect(i);
54
42
  setSelectedIndex(i);
@@ -57,20 +45,20 @@ var Tabs = function (_a) {
57
45
  * Handle a11y for heading
58
46
  * https://ebay.gitbooks.io/mindpatterns/content/disclosure/tabs.html
59
47
  */
60
- var onKeyDown = function (ev, i) {
61
- (0, event_utils_1.handleActionKeydown)(ev, function () {
48
+ const onKeyDown = (ev, i) => {
49
+ (0, event_utils_1.handleActionKeydown)(ev, () => {
62
50
  ev.preventDefault();
63
51
  if (activation === 'manual') {
64
52
  handleSelect(i);
65
53
  }
66
54
  });
67
- (0, event_utils_1.handleLeftRightArrowsKeydown)(ev, function () {
55
+ (0, event_utils_1.handleLeftRightArrowsKeydown)(ev, () => {
68
56
  var _a;
69
57
  ev.preventDefault();
70
- var len = (0, component_utils_1.filterByType)(children, tab_1.default).length;
71
- var direction = ['Left', 'ArrowLeft'].includes(ev.key) ? -1 : 1;
72
- var currentIndex = focusedIndex === undefined ? selectedIndex : focusedIndex;
73
- var nextIndex = (currentIndex + len + direction) % len;
58
+ const len = (0, component_utils_1.filterByType)(children, tab_1.default).length;
59
+ const direction = ['Left', 'ArrowLeft'].includes(ev.key) ? -1 : 1;
60
+ const currentIndex = focusedIndex === undefined ? selectedIndex : focusedIndex;
61
+ const nextIndex = (currentIndex + len + direction) % len;
74
62
  setFocusedIndex(nextIndex);
75
63
  (_a = headings[nextIndex]) === null || _a === void 0 ? void 0 : _a.focus();
76
64
  if (activation !== 'manual') {
@@ -78,18 +66,16 @@ var Tabs = function (_a) {
78
66
  }
79
67
  });
80
68
  };
81
- (0, react_1.useEffect)(function () {
69
+ (0, react_1.useEffect)(() => {
82
70
  handleSelect(index);
83
71
  }, [index]);
84
- var isLarge = size === 'large';
85
- var tabHeadings = (0, component_utils_1.filterByType)(children, tab_1.default).map(function (item, i) {
86
- return (0, react_1.cloneElement)(item, __assign(__assign({}, item.props), { refCallback: function (ref) { headings[i] = ref; }, index: i, parentId: id, selected: selectedIndex === i, focused: focusedIndex === i, onClick: function () {
87
- handleSelect(i);
88
- setFocusedIndex(i);
89
- }, onKeyDown: function (e) { onKeyDown(e, i); } }));
90
- });
91
- var tabPanels = (0, component_utils_1.filterByType)(children, tab_panel_1.default).map(function (item, i) {
92
- var itemProps = {
72
+ const isLarge = size === 'large';
73
+ 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), { refCallback: ref => { headings[i] = ref; }, index: i, parentId: id, selected: selectedIndex === i, focused: focusedIndex === i, onClick: () => {
74
+ handleSelect(i);
75
+ setFocusedIndex(i);
76
+ }, onKeyDown: e => { onKeyDown(e, i); } })));
77
+ const tabPanels = (0, component_utils_1.filterByType)(children, tab_panel_1.default).map((item, i) => {
78
+ const itemProps = {
93
79
  index: i,
94
80
  parentId: id,
95
81
  selected: selectedIndex === i,
@@ -1,15 +1,4 @@
1
1
  "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
2
  var __rest = (this && this.__rest) || function (s, e) {
14
3
  var t = {};
15
4
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -25,13 +14,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
25
14
  return (mod && mod.__esModule) ? mod : { "default": mod };
26
15
  };
27
16
  Object.defineProperty(exports, "__esModule", { value: true });
28
- var react_1 = __importDefault(require("react"));
29
- var ebay_icon_1 = require("../ebay-icon");
30
- var ebay_icon_button_1 = require("../ebay-icon-button");
31
- var EbayTextboxPostfixIcon = function (_a) {
32
- var name = _a.name, buttonAriaLabel = _a.buttonAriaLabel, _b = _a.onClick, onClick = _b === void 0 ? function () { } : _b, rest = __rest(_a, ["name", "buttonAriaLabel", "onClick"]);
17
+ const react_1 = __importDefault(require("react"));
18
+ const ebay_icon_1 = require("../ebay-icon");
19
+ const ebay_icon_button_1 = require("../ebay-icon-button");
20
+ const EbayTextboxPostfixIcon = (_a) => {
21
+ var { name, buttonAriaLabel, onClick = () => { } } = _a, rest = __rest(_a, ["name", "buttonAriaLabel", "onClick"]);
33
22
  return buttonAriaLabel ?
34
- react_1.default.createElement(ebay_icon_button_1.EbayIconButton, __assign({ "aria-label": buttonAriaLabel, icon: name, transparent: true, onClick: onClick }, rest)) :
35
- react_1.default.createElement(ebay_icon_1.EbayIcon, __assign({ name: name }, rest));
23
+ react_1.default.createElement(ebay_icon_button_1.EbayIconButton, Object.assign({ "aria-label": buttonAriaLabel, icon: name, transparent: true, onClick: onClick }, rest)) :
24
+ react_1.default.createElement(ebay_icon_1.EbayIcon, Object.assign({ name: name }, rest));
36
25
  };
37
26
  exports.default = EbayTextboxPostfixIcon;
@@ -1,15 +1,4 @@
1
1
  "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
2
  var __rest = (this && this.__rest) || function (s, e) {
14
3
  var t = {};
15
4
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -25,10 +14,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
25
14
  return (mod && mod.__esModule) ? mod : { "default": mod };
26
15
  };
27
16
  Object.defineProperty(exports, "__esModule", { value: true });
28
- var react_1 = __importDefault(require("react"));
29
- var ebay_icon_1 = require("../ebay-icon");
30
- var EbayTextboxPrefixIcon = function (_a) {
31
- var name = _a.name, rest = __rest(_a, ["name"]);
32
- return (react_1.default.createElement(ebay_icon_1.EbayIcon, __assign({ name: name }, rest)));
17
+ const react_1 = __importDefault(require("react"));
18
+ const ebay_icon_1 = require("../ebay-icon");
19
+ const EbayTextboxPrefixIcon = (_a) => {
20
+ var { name } = _a, rest = __rest(_a, ["name"]);
21
+ return (react_1.default.createElement(ebay_icon_1.EbayIcon, Object.assign({ name: name }, rest)));
33
22
  };
34
23
  exports.default = EbayTextboxPrefixIcon;
@@ -26,6 +26,6 @@ export type EbayTextboxProps = {
26
26
  forwardedRef?: Ref<HTMLTextAreaElement | HTMLInputElement>;
27
27
  opaqueLabel?: boolean;
28
28
  } & Omit<TextInputProps, 'onFocus' | 'onBlur' | 'onChange' | 'onKeyPress' | 'onKeyUp' | 'onKeyDown' | 'onInvalid'>;
29
- declare const _default: React.ForwardRefExoticComponent<Pick<EbayTextboxProps, "form" | "slot" | "style" | "title" | "pattern" | "forwardedRef" | "type" | "invalid" | "key" | "value" | "className" | "disabled" | "inputSize" | "placeholder" | "opaqueLabel" | "children" | "multiple" | "name" | "required" | "size" | "list" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "accept" | "alt" | "autoComplete" | "autoFocus" | "capture" | "checked" | "cols" | "crossOrigin" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "height" | "max" | "maxLength" | "min" | "minLength" | "readOnly" | "rows" | "src" | "step" | "width" | "wrap" | "fluid" | "dirName" | "multiline" | "onInputChange" | "onFloatingLabelInit" | "onButtonClick" | "floatingLabel"> & React.RefAttributes<React.FC<EbayTextboxProps>>>;
29
+ declare const _default: React.ForwardRefExoticComponent<Omit<EbayTextboxProps, "ref"> & React.RefAttributes<React.FC<EbayTextboxProps>>>;
30
30
  export default _default;
31
31
  //# sourceMappingURL=textbox.d.ts.map
@@ -1,15 +1,4 @@
1
1
  "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
3
  if (k2 === undefined) k2 = k;
15
4
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -49,39 +38,39 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
49
38
  };
50
39
  Object.defineProperty(exports, "__esModule", { value: true });
51
40
  exports.isControlled = void 0;
52
- var react_1 = __importStar(require("react"));
53
- var classnames_1 = __importDefault(require("classnames"));
54
- var component_utils_1 = require("../common/component-utils");
55
- var index_1 = require("./index");
56
- var hooks_1 = require("../common/floating-label-utils/hooks");
57
- var isControlled = function (value) { return typeof value !== 'undefined'; };
41
+ const react_1 = __importStar(require("react"));
42
+ const classnames_1 = __importDefault(require("classnames"));
43
+ const component_utils_1 = require("../common/component-utils");
44
+ const index_1 = require("./index");
45
+ const hooks_1 = require("../common/floating-label-utils/hooks");
46
+ const isControlled = (value) => typeof value !== 'undefined';
58
47
  exports.isControlled = isControlled;
59
- var EbayTextbox = function (_a) {
60
- var _b = _a.type, type = _b === void 0 ? 'text' : _b, invalid = _a.invalid, fluid = _a.fluid, multiline = _a.multiline, _c = _a.onChange, onChange = _c === void 0 ? function () { } : _c, _d = _a.onInputChange, onInputChange = _d === void 0 ? function () { } : _d, _e = _a.onFocus, onFocus = _e === void 0 ? function () { } : _e, _f = _a.onBlur, onBlur = _f === void 0 ? function () { } : _f, _g = _a.onKeyPress, onKeyPress = _g === void 0 ? function () { } : _g, _h = _a.onKeyUp, onKeyUp = _h === void 0 ? function () { } : _h, _j = _a.onKeyDown, onKeyDown = _j === void 0 ? function () { } : _j, _k = _a.onInvalid, onInvalid = _k === void 0 ? function () { } : _k, _l = _a.onFloatingLabelInit, onFloatingLabelInit = _l === void 0 ? function () { } : _l, _m = _a.onButtonClick, onButtonClick = _m === void 0 ? function () { } : _m, autoFocus = _a.autoFocus, _o = _a.defaultValue, defaultValue = _o === void 0 ? '' : _o, controlledValue = _a.value, forwardedRef = _a.forwardedRef, _p = _a.inputSize, inputSize = _p === void 0 ? 'default' : _p, floatingLabel = _a.floatingLabel, children = _a.children, placeholder = _a.placeholder, opaqueLabel = _a.opaqueLabel, rest = __rest(_a, ["type", "invalid", "fluid", "multiline", "onChange", "onInputChange", "onFocus", "onBlur", "onKeyPress", "onKeyUp", "onKeyDown", "onInvalid", "onFloatingLabelInit", "onButtonClick", "autoFocus", "defaultValue", "value", "forwardedRef", "inputSize", "floatingLabel", "children", "placeholder", "opaqueLabel"]);
61
- var _q = (0, react_1.useState)(defaultValue), value = _q[0], setValue = _q[1];
62
- var _r = (0, react_1.useState)(defaultValue), inputValue = _r[0], setInputValue = _r[1];
63
- var _s = (0, hooks_1.useFloatingLabel)({
48
+ const EbayTextbox = (_a) => {
49
+ var { type = 'text', invalid, fluid, multiline, onChange = () => { }, onInputChange = () => { }, onFocus = () => { }, onBlur = () => { }, onKeyPress = () => { }, onKeyUp = () => { }, onKeyDown = () => { }, onInvalid = () => { }, onFloatingLabelInit = () => { }, onButtonClick = () => { }, autoFocus, defaultValue = '', value: controlledValue, forwardedRef, inputSize = 'default', floatingLabel, children, placeholder, opaqueLabel } = _a, rest = __rest(_a, ["type", "invalid", "fluid", "multiline", "onChange", "onInputChange", "onFocus", "onBlur", "onKeyPress", "onKeyUp", "onKeyDown", "onInvalid", "onFloatingLabelInit", "onButtonClick", "autoFocus", "defaultValue", "value", "forwardedRef", "inputSize", "floatingLabel", "children", "placeholder", "opaqueLabel"]);
50
+ const [value, setValue] = (0, react_1.useState)(defaultValue);
51
+ const [inputValue, setInputValue] = (0, react_1.useState)(defaultValue);
52
+ const { label, Container, onBlur: onFloatingLabelBlur, onFocus: onFloatingLabelFocus, ref, placeholder: floatingLabelPlaceholder } = (0, hooks_1.useFloatingLabel)({
64
53
  ref: forwardedRef,
65
54
  inputId: rest.id,
66
55
  className: rest.className,
67
56
  disabled: rest.disabled,
68
57
  label: floatingLabel,
69
- inputSize: inputSize,
58
+ inputSize,
70
59
  inputValue: controlledValue || inputValue,
71
- placeholder: placeholder,
72
- invalid: invalid,
73
- type: type,
74
- opaqueLabel: opaqueLabel,
60
+ placeholder,
61
+ invalid,
62
+ type,
63
+ opaqueLabel,
75
64
  onMount: onFloatingLabelInit
76
- }), label = _s.label, Container = _s.Container, onFloatingLabelBlur = _s.onBlur, onFloatingLabelFocus = _s.onFocus, ref = _s.ref, floatingLabelPlaceholder = _s.placeholder;
77
- var handleFocus = function (event) {
65
+ });
66
+ const handleFocus = (event) => {
78
67
  var _a;
79
68
  onFocus(event, { value: ((_a = event === null || event === void 0 ? void 0 : event.target) === null || _a === void 0 ? void 0 : _a.value) || defaultValue });
80
69
  onFloatingLabelFocus();
81
70
  };
82
- var handleBlur = function (event) {
71
+ const handleBlur = (event) => {
83
72
  var _a;
84
- var newValue = (_a = event.target) === null || _a === void 0 ? void 0 : _a.value;
73
+ const newValue = (_a = event.target) === null || _a === void 0 ? void 0 : _a.value;
85
74
  onBlur(event, { value: newValue });
86
75
  if (newValue !== value) {
87
76
  onChange(event, { value: newValue });
@@ -89,56 +78,56 @@ var EbayTextbox = function (_a) {
89
78
  }
90
79
  onFloatingLabelBlur();
91
80
  };
92
- var handleKeyPress = function (event) {
93
- var textbox = event.target;
81
+ const handleKeyPress = (event) => {
82
+ const textbox = event.target;
94
83
  onKeyPress(event, { value: textbox === null || textbox === void 0 ? void 0 : textbox.value });
95
84
  };
96
- var handleKeyUp = function (event) {
97
- var textbox = event.target;
85
+ const handleKeyUp = (event) => {
86
+ const textbox = event.target;
98
87
  onKeyUp(event, { value: textbox === null || textbox === void 0 ? void 0 : textbox.value });
99
88
  };
100
- var handleKeyDown = function (event) {
101
- var textbox = event.target;
89
+ const handleKeyDown = (event) => {
90
+ const textbox = event.target;
102
91
  onKeyDown(event, { value: textbox === null || textbox === void 0 ? void 0 : textbox.value });
103
92
  };
104
- var handleInvalid = function (event) {
105
- var textbox = event.target;
93
+ const handleInvalid = (event) => {
94
+ const textbox = event.target;
106
95
  onInvalid(event, { value: textbox === null || textbox === void 0 ? void 0 : textbox.value });
107
96
  };
108
- var handleButtonClick = function (event) {
109
- onButtonClick(event, { value: value });
97
+ const handleButtonClick = (event) => {
98
+ onButtonClick(event, { value });
110
99
  };
111
- (0, react_1.useEffect)(function () {
100
+ (0, react_1.useEffect)(() => {
112
101
  if (autoFocus) {
113
102
  handleFocus();
114
103
  }
115
104
  }, []);
116
- var handleInputChange = function (e) {
105
+ const handleInputChange = (e) => {
117
106
  var _a;
118
- var newValue = (_a = e.target) === null || _a === void 0 ? void 0 : _a.value;
107
+ const newValue = (_a = e.target) === null || _a === void 0 ? void 0 : _a.value;
119
108
  if (!(0, exports.isControlled)(controlledValue)) {
120
109
  setInputValue(newValue);
121
110
  }
122
111
  onInputChange(e, { value: newValue });
123
112
  };
124
- var Input = multiline ? 'textarea' : 'input';
125
- var Wrapper = fluid ? 'div' : 'span';
126
- var prefixIcon = (0, component_utils_1.findComponent)(children, index_1.EbayTextboxPrefixIcon);
127
- var postfixIcon = (0, component_utils_1.findComponent)(children, index_1.EbayTextboxPostfixIcon);
128
- var inputClassName = (0, classnames_1.default)('textbox__control', {
113
+ const Input = multiline ? 'textarea' : 'input';
114
+ const Wrapper = fluid ? 'div' : 'span';
115
+ const prefixIcon = (0, component_utils_1.findComponent)(children, index_1.EbayTextboxPrefixIcon);
116
+ const postfixIcon = (0, component_utils_1.findComponent)(children, index_1.EbayTextboxPostfixIcon);
117
+ const inputClassName = (0, classnames_1.default)('textbox__control', {
129
118
  'textbox__control--fluid': fluid,
130
119
  'textbox__control--large': inputSize === 'large'
131
120
  });
132
- var wrapperClassName = (0, classnames_1.default)('textbox', rest.className, {
121
+ const wrapperClassName = (0, classnames_1.default)('textbox', rest.className, {
133
122
  'textbox--icon-end': postfixIcon
134
123
  });
135
124
  return (react_1.default.createElement(Container, null,
136
125
  label,
137
126
  react_1.default.createElement(Wrapper, { className: wrapperClassName },
138
127
  prefixIcon,
139
- react_1.default.createElement(Input, __assign({}, rest, { className: inputClassName, type: type, "aria-invalid": invalid, value: (0, exports.isControlled)(controlledValue) ? controlledValue : inputValue, onChange: handleInputChange, onBlur: handleBlur, onFocus: handleFocus, onKeyPress: handleKeyPress, onKeyUp: handleKeyUp, onKeyDown: handleKeyDown, onInvalid: handleInvalid, autoFocus: autoFocus, ref: ref, placeholder: floatingLabelPlaceholder })),
140
- postfixIcon && (0, react_1.cloneElement)(postfixIcon, __assign(__assign({}, postfixIcon.props), { onClick: function (e) {
141
- var _a = postfixIcon.props.onClick, iconClick = _a === void 0 ? function () { } : _a;
128
+ react_1.default.createElement(Input, Object.assign({}, rest, { className: inputClassName, type: type, "aria-invalid": invalid, value: (0, exports.isControlled)(controlledValue) ? controlledValue : inputValue, onChange: handleInputChange, onBlur: handleBlur, onFocus: handleFocus, onKeyPress: handleKeyPress, onKeyUp: handleKeyUp, onKeyDown: handleKeyDown, onInvalid: handleInvalid, autoFocus: autoFocus, ref: ref, placeholder: floatingLabelPlaceholder })),
129
+ postfixIcon && (0, react_1.cloneElement)(postfixIcon, Object.assign(Object.assign({}, postfixIcon.props), { onClick: (e) => {
130
+ const { onClick: iconClick = () => { } } = postfixIcon.props;
142
131
  iconClick(e);
143
132
  handleButtonClick(e);
144
133
  } })))));
@@ -1,15 +1,4 @@
1
1
  "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
2
  var __rest = (this && this.__rest) || function (s, e) {
14
3
  var t = {};
15
4
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -26,12 +15,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
26
15
  };
27
16
  Object.defineProperty(exports, "__esModule", { value: true });
28
17
  exports.EbayToast = void 0;
29
- var react_1 = __importDefault(require("react"));
30
- var classnames_1 = __importDefault(require("classnames"));
31
- var ebay_dialog_base_1 = require("../../ebay-dialog-base");
32
- var EbayToast = function (_a) {
33
- var className = _a.className, _b = _a.onClose, onClose = _b === void 0 ? function () { } : _b, rest = __rest(_a, ["className", "onClose"]);
34
- return (react_1.default.createElement(ebay_dialog_base_1.DialogBaseWithState, __assign({}, rest, { isModal: false, baseEl: "aside", classPrefix: "toast-dialog", buttonPosition: "right", transitionElement: "root", className: (0, classnames_1.default)(className, 'toast-dialog--transition'), onCloseBtnClick: onClose })));
18
+ const react_1 = __importDefault(require("react"));
19
+ const classnames_1 = __importDefault(require("classnames"));
20
+ const ebay_dialog_base_1 = require("../../ebay-dialog-base");
21
+ const EbayToast = (_a) => {
22
+ var { className, onClose = () => { } } = _a, rest = __rest(_a, ["className", "onClose"]);
23
+ return (react_1.default.createElement(ebay_dialog_base_1.DialogBaseWithState, Object.assign({}, rest, { isModal: false, baseEl: "aside", classPrefix: "toast-dialog", buttonPosition: "right", transitionElement: "root", className: (0, classnames_1.default)(className, 'toast-dialog--transition'), onCloseBtnClick: onClose })));
35
24
  };
36
25
  exports.EbayToast = EbayToast;
37
26
  exports.default = exports.EbayToast;
@@ -4,5 +4,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  * This Component is used only for finding it as a child of EbayTooltip
5
5
  * and pass the properties to TooltipContent
6
6
  */
7
- var EbayTooltipContent = function () { return null; };
7
+ const EbayTooltipContent = () => null;
8
8
  exports.default = EbayTooltipContent;
@@ -4,5 +4,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  * This Component is used only for finding it as a child of EbayTooltip
5
5
  * and pass the properties to TooltipHost
6
6
  */
7
- var EbayTooltipHost = function () { return null; };
7
+ const EbayTooltipHost = () => null;
8
8
  exports.default = EbayTooltipHost;
@@ -1,15 +1,4 @@
1
1
  "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
3
  if (k2 === undefined) k2 = k;
15
4
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -48,49 +37,49 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
48
37
  return (mod && mod.__esModule) ? mod : { "default": mod };
49
38
  };
50
39
  Object.defineProperty(exports, "__esModule", { value: true });
51
- var react_1 = __importStar(require("react"));
52
- var component_utils_1 = require("../common/component-utils");
53
- var tooltip_utils_1 = require("../common/tooltip-utils");
54
- var ebay_tooltip_content_1 = __importDefault(require("./ebay-tooltip-content"));
55
- var ebay_tooltip_host_1 = __importDefault(require("./ebay-tooltip-host"));
56
- var EbayTooltip = function (_a) {
57
- var className = _a.className, pointer = _a.pointer, overlayStyle = _a.overlayStyle, noHover = _a.noHover, _b = _a.onFocus, onFocus = _b === void 0 ? function () { } : _b, _c = _a.onBlur, onBlur = _c === void 0 ? function () { } : _c, _d = _a.onMouseEnter, onMouseEnter = _d === void 0 ? function () { } : _d, _e = _a.onMouseLeave, onMouseLeave = _e === void 0 ? function () { } : _e, onExpand = _a.onExpand, onCollapse = _a.onCollapse, children = _a.children, rest = __rest(_a, ["className", "pointer", "overlayStyle", "noHover", "onFocus", "onBlur", "onMouseEnter", "onMouseLeave", "onExpand", "onCollapse", "children"]);
58
- var _f = (0, tooltip_utils_1.useTooltip)({ onCollapse: onCollapse, onExpand: onExpand }), isExpanded = _f.isExpanded, expandTooltip = _f.expandTooltip, collapseTooltip = _f.collapseTooltip;
59
- var timeoutRef = (0, react_1.useRef)();
60
- var handleOnMouseEnter = function (event) {
40
+ const react_1 = __importStar(require("react"));
41
+ const component_utils_1 = require("../common/component-utils");
42
+ const tooltip_utils_1 = require("../common/tooltip-utils");
43
+ const ebay_tooltip_content_1 = __importDefault(require("./ebay-tooltip-content"));
44
+ const ebay_tooltip_host_1 = __importDefault(require("./ebay-tooltip-host"));
45
+ const EbayTooltip = (_a) => {
46
+ var { className, pointer, overlayStyle, noHover, onFocus = () => { }, onBlur = () => { }, onMouseEnter = () => { }, onMouseLeave = () => { }, onExpand, onCollapse, children } = _a, rest = __rest(_a, ["className", "pointer", "overlayStyle", "noHover", "onFocus", "onBlur", "onMouseEnter", "onMouseLeave", "onExpand", "onCollapse", "children"]);
47
+ const { isExpanded, expandTooltip, collapseTooltip } = (0, tooltip_utils_1.useTooltip)({ onCollapse, onExpand });
48
+ const timeoutRef = (0, react_1.useRef)();
49
+ const handleOnMouseEnter = (event) => {
61
50
  onMouseEnter(event);
62
51
  if (!noHover) {
63
52
  clearTimeout(timeoutRef.current);
64
53
  expandTooltip();
65
54
  }
66
55
  };
67
- var handleOnMouseLeave = function (event) {
56
+ const handleOnMouseLeave = (event) => {
68
57
  onMouseLeave(event);
69
58
  if (!noHover) {
70
59
  clearTimeout(timeoutRef.current);
71
- timeoutRef.current = setTimeout(function () {
60
+ timeoutRef.current = setTimeout(() => {
72
61
  collapseTooltip();
73
62
  }, 300);
74
63
  }
75
64
  };
76
- var handleOnFocus = function (event) {
65
+ const handleOnFocus = (event) => {
77
66
  onFocus(event);
78
67
  expandTooltip();
79
68
  };
80
- var handleOnBlur = function (event) {
69
+ const handleOnBlur = (event) => {
81
70
  onBlur(event);
82
71
  collapseTooltip();
83
72
  };
84
- var content = (0, component_utils_1.findComponent)(children, ebay_tooltip_content_1.default);
85
- var host = (0, component_utils_1.findComponent)(children, ebay_tooltip_host_1.default);
73
+ const content = (0, component_utils_1.findComponent)(children, ebay_tooltip_content_1.default);
74
+ const host = (0, component_utils_1.findComponent)(children, ebay_tooltip_host_1.default);
86
75
  if (!host) {
87
- throw new Error("EbayTooltip: Please use a EbayTooltipHost that defines the host of the tooltip");
76
+ throw new Error(`EbayTooltip: Please use a EbayTooltipHost that defines the host of the tooltip`);
88
77
  }
89
78
  if (!content) {
90
- throw new Error("EbayTooltip: Please use a EbayTooltipContent that defines the content of the tooltip");
79
+ throw new Error(`EbayTooltip: Please use a EbayTooltipContent that defines the content of the tooltip`);
91
80
  }
92
- return (react_1.default.createElement(tooltip_utils_1.Tooltip, __assign({}, rest, { className: className, type: "tooltip", isExpanded: isExpanded, onFocus: handleOnFocus, onBlur: handleOnBlur, onMouseEnter: handleOnMouseEnter, onMouseLeave: handleOnMouseLeave }),
93
- react_1.default.createElement(tooltip_utils_1.TooltipHost, __assign({}, host.props)),
94
- react_1.default.createElement(tooltip_utils_1.TooltipContent, __assign({}, content.props, { type: "tooltip", style: overlayStyle, pointer: pointer }))));
81
+ return (react_1.default.createElement(tooltip_utils_1.Tooltip, Object.assign({}, rest, { className: className, type: "tooltip", isExpanded: isExpanded, onFocus: handleOnFocus, onBlur: handleOnBlur, onMouseEnter: handleOnMouseEnter, onMouseLeave: handleOnMouseLeave }),
82
+ react_1.default.createElement(tooltip_utils_1.TooltipHost, Object.assign({}, host.props)),
83
+ react_1.default.createElement(tooltip_utils_1.TooltipContent, Object.assign({}, content.props, { type: "tooltip", style: overlayStyle, pointer: pointer }))));
95
84
  };
96
85
  exports.default = EbayTooltip;
@@ -4,5 +4,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  * This Component is used only for finding it as a child of EbayTooltip
5
5
  * and pass the properties to TourtipContent
6
6
  */
7
- var EbayTourtipContent = function () { return null; };
7
+ const EbayTourtipContent = () => null;
8
8
  exports.default = EbayTourtipContent;
@@ -3,11 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- var react_1 = __importDefault(require("react"));
7
- var EbayTourtipFooter = function (_a) {
8
- var index = _a.index, children = _a.children;
9
- return (react_1.default.createElement(react_1.default.Fragment, null,
10
- index !== undefined && (react_1.default.createElement("span", { className: "tourtip__index" }, index)),
11
- children));
12
- };
6
+ const react_1 = __importDefault(require("react"));
7
+ const EbayTourtipFooter = ({ index, children }) => (react_1.default.createElement(react_1.default.Fragment, null,
8
+ index !== undefined && (react_1.default.createElement("span", { className: "tourtip__index" }, index)),
9
+ children));
13
10
  exports.default = EbayTourtipFooter;
@@ -1,15 +1,4 @@
1
1
  "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
2
  var __rest = (this && this.__rest) || function (s, e) {
14
3
  var t = {};
15
4
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -25,11 +14,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
25
14
  return (mod && mod.__esModule) ? mod : { "default": mod };
26
15
  };
27
16
  Object.defineProperty(exports, "__esModule", { value: true });
28
- var react_1 = __importDefault(require("react"));
29
- var classnames_1 = __importDefault(require("classnames"));
30
- var EbayTourtipHeading = function (_a) {
31
- var as = _a.as, children = _a.children, className = _a.className, props = __rest(_a, ["as", "children", "className"]);
32
- var HeadingTag = as || 'h2';
33
- return (react_1.default.createElement(HeadingTag, __assign({}, props, { className: (0, classnames_1.default)("tourtip__heading", className) }), children));
17
+ const react_1 = __importDefault(require("react"));
18
+ const classnames_1 = __importDefault(require("classnames"));
19
+ const EbayTourtipHeading = (_a) => {
20
+ var { as, children, className } = _a, props = __rest(_a, ["as", "children", "className"]);
21
+ const HeadingTag = as || 'h2';
22
+ return (react_1.default.createElement(HeadingTag, Object.assign({}, props, { className: (0, classnames_1.default)(`tourtip__heading`, className) }), children));
34
23
  };
35
24
  exports.default = EbayTourtipHeading;
@@ -4,5 +4,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  * This Component is used only for finding it as a child of EbayTooltip
5
5
  * and pass the properties to TourtipHost
6
6
  */
7
- var EbayTourtipHost = function () { return null; };
7
+ const EbayTourtipHost = () => null;
8
8
  exports.default = EbayTourtipHost;