@ebay/ui-core-react 7.4.0-alpha.7 → 7.4.0-alpha.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/array.polyfill.flat-DyxysTxZ.js +21 -0
- package/badge-CR5t7-2L.js +8 -0
- package/button-B4bZIgwB.js +83 -0
- package/calendar-D-DWjrMU.js +333 -0
- package/common/component-utils/forwardRef/index.js +10 -1
- package/common/component-utils/index.js +9 -1
- package/common/component-utils/utils/index.js +25 -1
- package/common/event-utils/index.js +113 -1
- package/common/floating-label-utils/hooks/index.js +106 -1
- package/common/notice-utils/notice-cta/index.js +5 -1
- package/common/random-id/index.js +13 -1
- package/common/tooltip-utils/constants/index.js +97 -1
- package/common/tooltip-utils/index.js +11 -1
- package/debounce-v8bWAUnY.js +9 -0
- package/dialog-previous-button-EC_Y6KaT.js +370 -0
- package/drawer-DBDktEBZ.js +69 -0
- package/ebay-alert-dialog/index.js +26 -1
- package/ebay-badge/index.js +4 -1
- package/ebay-breadcrumbs/index.js +47 -1
- package/ebay-button/index.js +5 -1
- package/ebay-calendar/index.js +4 -1
- package/ebay-carousel/index.js +345 -1
- package/ebay-checkbox/index.js +52 -1
- package/ebay-confirm-dialog/index.js +28 -1
- package/ebay-cta-button/index.js +22 -1
- package/ebay-date-textbox/index.js +140 -1
- package/ebay-dialog-base/components/animation/index.js +92 -1
- package/ebay-dialog-base/components/dialog-footer/index.js +4 -1
- package/ebay-dialog-base/components/dialog-header/index.js +4 -1
- package/ebay-dialog-base/index.js +13 -1
- package/ebay-drawer-dialog/index.js +4 -1
- package/ebay-eek/index.js +54 -1
- package/ebay-fake-menu/index.js +10 -1
- package/ebay-fake-menu/menu-item/index.js +49 -1
- package/ebay-fake-menu-button/index.js +7 -1
- package/ebay-fake-menu-button/menu-button/index.js +12 -1
- package/ebay-fake-tabs/index.js +30 -1
- package/ebay-field/index.js +21 -1
- package/ebay-fullscreen-dialog/index.js +10 -1
- package/ebay-icon/index.js +4 -1
- package/ebay-icon-button/index.js +4 -1
- package/ebay-infotip/index.js +76 -1
- package/ebay-inline-notice/index.js +36 -1
- package/ebay-lightbox-dialog/index.js +12 -1
- package/ebay-listbox/index.js +6 -1
- package/ebay-listbox/listbox.d.ts +1 -0
- package/ebay-listbox/listbox.d.ts.map +1 -1
- package/ebay-listbox-button/index.js +151 -1
- package/ebay-listbox-button/listbox-button.d.ts.map +1 -1
- package/ebay-menu/index.js +9 -1
- package/ebay-menu-button/index.js +113 -1
- package/ebay-notice-base/index.js +7 -1
- package/ebay-page-notice/index.js +50 -1
- package/ebay-pagination/index.js +244 -1
- package/ebay-panel-dialog/index.js +12 -1
- package/ebay-progress-bar/index.js +6 -1
- package/ebay-progress-spinner/index.js +4 -1
- package/ebay-progress-stepper/index.js +72 -1
- package/ebay-radio/index.js +4 -1
- package/ebay-radio/radio/index.js +48 -1
- package/ebay-section-notice/index.js +69 -1
- package/ebay-section-title/index.js +38 -1
- package/ebay-segmented-buttons/index.js +46 -1
- package/ebay-select/index.js +98 -1
- package/ebay-signal/index.js +9 -1
- package/ebay-snackbar-dialog/index.js +81 -1
- package/ebay-split-button/index.js +22 -1
- package/ebay-star-rating/index.js +9 -1
- package/ebay-star-rating-select/index.js +55 -1
- package/ebay-svg/index.js +5189 -1
- package/ebay-switch/index.js +27 -1
- package/ebay-tabs/index.js +88 -1
- package/ebay-textbox/index.js +10 -1
- package/ebay-toast-dialog/index.js +9 -1
- package/ebay-tooltip/index.js +64 -1
- package/ebay-tourtip/index.js +54 -1
- package/ebay-video/index.js +229 -1
- package/events/index.js +18 -1
- package/icon-B17Di3YL.js +56 -0
- package/icon-button-BQWoMgX1.js +31 -0
- package/index-BXizW4ue.js +89 -0
- package/index-DcH7Tjjd.js +272 -0
- package/label-C0AS4fnO.js +19 -0
- package/listbox-DfOw_fJc.js +662 -0
- package/menu-Bsy48CE1.js +163 -0
- package/menu-button-CKGsgg6G.js +89 -0
- package/menu-fCOy6wBS.js +29 -0
- package/notice-content-BTXVxttv.js +8 -0
- package/notice-content-BhUeK1pd.js +3 -0
- package/notice-footer-CIQ8SM6N.js +10 -0
- package/package.json +1 -1
- package/progress-spinner-DOFKRtuu.js +20 -0
- package/range-C5qzyhg4.js +3 -0
- package/textbox-J291yCpJ.js +136 -0
- package/use-roving-index-CEM_UsCH.js +58 -0
- package/use-tooltip-7JxcZHJn.js +92 -0
- package/utils/index.js +13 -1
- package/array.polyfill.flat-5BAolFdk.js +0 -1
- package/badge-CoHKfiPt.js +0 -1
- package/button-DGuEBUDJ.js +0 -1
- package/calendar-lAu6VfAb.js +0 -1
- package/debounce-BQsYxxOL.js +0 -1
- package/dialog-previous-button-5cTKpmJ-.js +0 -1
- package/drawer-xTtCoO3F.js +0 -1
- package/icon-TuxfQndO.js +0 -1
- package/icon-button-Cwaj-eT9.js +0 -1
- package/index-D3xZmuzJ.js +0 -1
- package/index-Dkz0UnlJ.js +0 -1
- package/label-CnrpYJ-g.js +0 -1
- package/listbox-Br0AMj3v.js +0 -1
- package/menu-CV-INYLM.js +0 -1
- package/menu-_LzP6yje.js +0 -1
- package/menu-button-BZ66jxvI.js +0 -1
- package/notice-content-9iF4T8uB.js +0 -1
- package/notice-content-C0ZStfuX.js +0 -1
- package/notice-footer-Cw1DMzoB.js +0 -1
- package/progress-spinner-U2qOANON.js +0 -1
- package/range-DOsPN0h5.js +0 -1
- package/textbox-dUhinDwj.js +0 -1
- package/use-roving-index-DoAVBgsp.js +0 -1
- package/use-tooltip-CL3_zAeg.js +0 -1
|
@@ -1 +1,140 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const React = require("react");
|
|
4
|
+
const index = require("../index-DcH7Tjjd.js");
|
|
5
|
+
const calendar = require("../calendar-D-DWjrMU.js");
|
|
6
|
+
const textbox = require("../textbox-J291yCpJ.js");
|
|
7
|
+
require("../icon-B17Di3YL.js");
|
|
8
|
+
const classNames = require("classnames");
|
|
9
|
+
const MIN_WIDTH_FOR_DOUBLE_PANE = 600;
|
|
10
|
+
const EbayDateTextbox = ({ className, inputPlaceholderText = "YYYY-MM-DD", a11yOpenPopoverText = "open calendar", range, value: controlledValue, rangeEnd: controlledRangeEnd, defaultValue, defaultRangeEnd, collapseOnSelect, onChange = () => {
|
|
11
|
+
}, onInputChange = () => {
|
|
12
|
+
}, onInputRangeEndChange = () => {
|
|
13
|
+
}, ...rest }) => {
|
|
14
|
+
const expander = React.useRef();
|
|
15
|
+
const containerRef = React.useRef(null);
|
|
16
|
+
const [internalValue, setInternalValue] = React.useState(defaultValue || "");
|
|
17
|
+
const [internalRangeEnd, setInternalRangeEnd] = React.useState(defaultRangeEnd || "");
|
|
18
|
+
const valueToRender = textbox.isControlled(controlledValue) ? controlledValue : internalValue;
|
|
19
|
+
const rangeEndToRender = textbox.isControlled(controlledRangeEnd) ? controlledRangeEnd : internalRangeEnd;
|
|
20
|
+
const [firstSelected, setFirstSelected] = React.useState(() => calendar.dateArgToISO(valueToRender));
|
|
21
|
+
const [secondSelected, setSecondSelected] = React.useState(() => calendar.dateArgToISO(rangeEndToRender));
|
|
22
|
+
const [isPopoverOpen, setIsPopoverOpen] = React.useState(false);
|
|
23
|
+
const [numMonths, setNumMonths] = React.useState(1);
|
|
24
|
+
const openPopover = () => {
|
|
25
|
+
setIsPopoverOpen(true);
|
|
26
|
+
};
|
|
27
|
+
const closePopover = () => {
|
|
28
|
+
setIsPopoverOpen(false);
|
|
29
|
+
};
|
|
30
|
+
React.useEffect(() => {
|
|
31
|
+
if (!containerRef.current) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
expander.current = new index.src_default(containerRef.current, {
|
|
35
|
+
hostSelector: ".ebay-date-textbox--main > .icon-btn",
|
|
36
|
+
contentSelector: ".date-textbox__popover",
|
|
37
|
+
expandOnClick: true,
|
|
38
|
+
autoCollapse: true
|
|
39
|
+
});
|
|
40
|
+
containerRef.current.addEventListener("expander-expand", openPopover);
|
|
41
|
+
containerRef.current.addEventListener("expander-collapse", closePopover);
|
|
42
|
+
const calculateNumMonths = () => {
|
|
43
|
+
setNumMonths(document.documentElement.clientWidth < MIN_WIDTH_FOR_DOUBLE_PANE ? 1 : 2);
|
|
44
|
+
};
|
|
45
|
+
calculateNumMonths();
|
|
46
|
+
window.addEventListener("resize", calculateNumMonths);
|
|
47
|
+
return () => {
|
|
48
|
+
var _a;
|
|
49
|
+
(_a = expander.current) == null ? void 0 : _a.destroy();
|
|
50
|
+
window.removeEventListener("resize", calculateNumMonths);
|
|
51
|
+
};
|
|
52
|
+
}, []);
|
|
53
|
+
const handleInputChange = (event, index2) => {
|
|
54
|
+
const date = new Date(event.target.value);
|
|
55
|
+
const iso = isNaN(date.getTime()) ? null : calendar.toISO(date);
|
|
56
|
+
if (index2 === 0) {
|
|
57
|
+
setFirstSelected(iso);
|
|
58
|
+
setInternalValue(iso || "");
|
|
59
|
+
} else {
|
|
60
|
+
setSecondSelected(iso);
|
|
61
|
+
setInternalRangeEnd(iso || "");
|
|
62
|
+
}
|
|
63
|
+
if (range) {
|
|
64
|
+
onChange(event, {
|
|
65
|
+
rangeStart: index2 === 0 ? iso : firstSelected,
|
|
66
|
+
rangeEnd: index2 === 1 ? iso : secondSelected
|
|
67
|
+
});
|
|
68
|
+
} else {
|
|
69
|
+
onChange(event, {
|
|
70
|
+
selected: iso
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
const handlePopoverSelect = (event, { iso }) => {
|
|
75
|
+
setFirstSelected(iso);
|
|
76
|
+
setInternalValue(iso);
|
|
77
|
+
if (range) {
|
|
78
|
+
const selected = firstSelected || secondSelected;
|
|
79
|
+
const eventData = {
|
|
80
|
+
rangeStart: iso,
|
|
81
|
+
rangeEnd: selected
|
|
82
|
+
};
|
|
83
|
+
if (firstSelected && secondSelected) {
|
|
84
|
+
setInternalRangeEnd("");
|
|
85
|
+
setSecondSelected(null);
|
|
86
|
+
eventData.rangeEnd = null;
|
|
87
|
+
} else if (selected) {
|
|
88
|
+
if (selected < iso) {
|
|
89
|
+
setFirstSelected(selected);
|
|
90
|
+
setInternalValue(selected);
|
|
91
|
+
setInternalRangeEnd(iso);
|
|
92
|
+
setSecondSelected(iso);
|
|
93
|
+
eventData.rangeStart = selected;
|
|
94
|
+
eventData.rangeEnd = iso;
|
|
95
|
+
} else {
|
|
96
|
+
setFirstSelected(iso);
|
|
97
|
+
setInternalValue(iso);
|
|
98
|
+
setInternalRangeEnd(selected);
|
|
99
|
+
setSecondSelected(selected);
|
|
100
|
+
eventData.rangeStart = iso;
|
|
101
|
+
eventData.rangeEnd = selected;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
onChange(event, eventData);
|
|
105
|
+
} else {
|
|
106
|
+
onChange(event, {
|
|
107
|
+
selected: iso
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
if (collapseOnSelect) {
|
|
111
|
+
expander.current.expanded = false;
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
const handleInternalChange = (event, index2) => {
|
|
115
|
+
if (index2 === 0) {
|
|
116
|
+
setInternalValue(event.target.value);
|
|
117
|
+
onInputChange(event);
|
|
118
|
+
} else {
|
|
119
|
+
setInternalRangeEnd(event.target.value);
|
|
120
|
+
onInputRangeEndChange(event);
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
const [rangeStartPlaceholder, mainPlaceholder] = Array.isArray(inputPlaceholderText) ? inputPlaceholderText : [inputPlaceholderText, inputPlaceholderText];
|
|
124
|
+
return React.createElement(
|
|
125
|
+
"span",
|
|
126
|
+
{ className: classNames("date-textbox", className), ref: containerRef },
|
|
127
|
+
range && React.createElement(textbox.EbayTextbox, { value: valueToRender, placeholder: rangeStartPlaceholder, onInputChange: (event) => handleInternalChange(event, 0), onBlur: (event) => handleInputChange(event, 0) }),
|
|
128
|
+
React.createElement(
|
|
129
|
+
textbox.EbayTextbox,
|
|
130
|
+
{ className: "ebay-date-textbox--main", placeholder: mainPlaceholder, value: range ? rangeEndToRender : valueToRender, onInputChange: (event) => handleInternalChange(event, range ? 1 : 0), onBlur: (event) => handleInputChange(event, range ? 1 : 0) },
|
|
131
|
+
React.createElement(textbox.EbayTextboxPostfixIcon, { name: "calendar24", buttonAriaLabel: a11yOpenPopoverText })
|
|
132
|
+
),
|
|
133
|
+
React.createElement(
|
|
134
|
+
"div",
|
|
135
|
+
{ hidden: !isPopoverOpen, className: "date-textbox__popover" },
|
|
136
|
+
React.createElement(calendar.EbayCalendar, { ...rest, range, interactive: true, navigable: true, numMonths, selected: firstSelected && secondSelected ? [firstSelected, secondSelected] : firstSelected || secondSelected || void 0, onSelect: handlePopoverSelect })
|
|
137
|
+
)
|
|
138
|
+
);
|
|
139
|
+
};
|
|
140
|
+
exports.EbayDateTextbox = EbayDateTextbox;
|
|
@@ -1 +1,92 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const React = require("react");
|
|
4
|
+
function useDialogAnimation({ open, classPrefix, transitionElement, dialogRef, dialogWindowRef, enabled, onTransitionEnd }) {
|
|
5
|
+
const previousOpenValue = React.useRef(open);
|
|
6
|
+
React.useLayoutEffect(() => {
|
|
7
|
+
if (!enabled) {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
let transitionElements = [dialogWindowRef, dialogRef];
|
|
11
|
+
if (transitionElement === "window") {
|
|
12
|
+
transitionElements = [dialogWindowRef];
|
|
13
|
+
} else if (transitionElement === "root") {
|
|
14
|
+
transitionElements = [dialogRef];
|
|
15
|
+
}
|
|
16
|
+
let cancelCurrentAnimation;
|
|
17
|
+
if (open) {
|
|
18
|
+
cancelCurrentAnimation = showAnimation({
|
|
19
|
+
dialog: dialogRef,
|
|
20
|
+
waitFor: transitionElements,
|
|
21
|
+
classPrefix,
|
|
22
|
+
onTransitionEnd
|
|
23
|
+
});
|
|
24
|
+
} else if (previousOpenValue.current !== open) {
|
|
25
|
+
cancelCurrentAnimation = hideAnimation({
|
|
26
|
+
dialog: dialogRef,
|
|
27
|
+
waitFor: transitionElements,
|
|
28
|
+
classPrefix,
|
|
29
|
+
onTransitionEnd
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
previousOpenValue.current = open;
|
|
33
|
+
return () => {
|
|
34
|
+
if (cancelCurrentAnimation) {
|
|
35
|
+
cancelCurrentAnimation();
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
}, [open, enabled]);
|
|
39
|
+
}
|
|
40
|
+
function showAnimation({ dialog, waitFor, classPrefix, onTransitionEnd }) {
|
|
41
|
+
return transition(dialog, waitFor, `${classPrefix}--show`, onTransitionEnd);
|
|
42
|
+
}
|
|
43
|
+
function hideAnimation({ dialog, waitFor, classPrefix, onTransitionEnd }) {
|
|
44
|
+
return transition(dialog, waitFor, `${classPrefix}--hide`, onTransitionEnd);
|
|
45
|
+
}
|
|
46
|
+
function transition(element, waitFor, className, onTransitionEnd) {
|
|
47
|
+
if (!element.current || !className) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
let ran = 0;
|
|
51
|
+
const pending = waitFor ? waitFor.length : 0;
|
|
52
|
+
const initClass = `${className}-init`;
|
|
53
|
+
element.current.classList.add(initClass);
|
|
54
|
+
return nextFrame(() => {
|
|
55
|
+
if (!element.current) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
element.current.classList.add(className);
|
|
59
|
+
element.current.classList.remove(initClass);
|
|
60
|
+
waitFor.forEach((ref) => {
|
|
61
|
+
const listener = () => {
|
|
62
|
+
var _a, _b;
|
|
63
|
+
if (++ran === pending) {
|
|
64
|
+
(_a = element.current) == null ? void 0 : _a.classList.remove(className);
|
|
65
|
+
onTransitionEnd();
|
|
66
|
+
(_b = ref.current) == null ? void 0 : _b.removeEventListener("transitionend", listener);
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
ref.current.addEventListener("transitionend", listener, { once: true });
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
function nextFrame(callback) {
|
|
74
|
+
let frame;
|
|
75
|
+
let cancelFrame;
|
|
76
|
+
if (window.requestAnimationFrame) {
|
|
77
|
+
frame = window.requestAnimationFrame(() => {
|
|
78
|
+
frame = window.requestAnimationFrame(callback);
|
|
79
|
+
});
|
|
80
|
+
cancelFrame = window.cancelAnimationFrame;
|
|
81
|
+
} else {
|
|
82
|
+
frame = window.setTimeout(callback, 26);
|
|
83
|
+
cancelFrame = window.clearTimeout;
|
|
84
|
+
}
|
|
85
|
+
return () => {
|
|
86
|
+
if (frame) {
|
|
87
|
+
cancelFrame(frame);
|
|
88
|
+
frame = void 0;
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
exports.useDialogAnimation = useDialogAnimation;
|
|
@@ -1 +1,4 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
const React = require("react");
|
|
3
|
+
const EbayDialogFooter = ({ children }) => React.createElement(React.Fragment, null, children);
|
|
4
|
+
module.exports = EbayDialogFooter;
|
|
@@ -1 +1,4 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
const React = require("react");
|
|
3
|
+
const EbayDialogHeader = ({ children, ...rest }) => React.createElement("h2", { ...rest }, children);
|
|
4
|
+
module.exports = EbayDialogHeader;
|
|
@@ -1 +1,13 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const ebayDialogBase_components_dialogHeader = require("./components/dialog-header/index.js");
|
|
4
|
+
const ebayDialogBase_components_dialogFooter = require("./components/dialog-footer/index.js");
|
|
5
|
+
const dialogPreviousButton = require("../dialog-previous-button-EC_Y6KaT.js");
|
|
6
|
+
const ebayDialogBase_components_animation = require("./components/animation/index.js");
|
|
7
|
+
exports.EbayDialogHeader = ebayDialogBase_components_dialogHeader;
|
|
8
|
+
exports.EbayDialogFooter = ebayDialogBase_components_dialogFooter;
|
|
9
|
+
exports.DialogBaseWithState = dialogPreviousButton.DialogBaseWithState;
|
|
10
|
+
exports.EbayDialogActions = dialogPreviousButton.EbayDialogActions;
|
|
11
|
+
exports.EbayDialogCloseButton = dialogPreviousButton.EbayDialogCloseButton;
|
|
12
|
+
exports.EbayDialogPreviousButton = dialogPreviousButton.EbayDialogPreviousButton;
|
|
13
|
+
exports.useDialogAnimation = ebayDialogBase_components_animation.useDialogAnimation;
|
|
@@ -1 +1,4 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const drawer = require("../drawer-DBDktEBZ.js");
|
|
4
|
+
exports.EbayDrawerDialog = drawer.EbayDrawerDialog;
|
package/ebay-eek/index.js
CHANGED
|
@@ -1 +1,54 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const React = require("react");
|
|
4
|
+
const classNames = require("classnames");
|
|
5
|
+
const icon = require("../icon-B17Di3YL.js");
|
|
6
|
+
const validRanges = {
|
|
7
|
+
"A+++": ["D", "E", "G"],
|
|
8
|
+
"A++": ["E", "G"],
|
|
9
|
+
"A+": ["F", "G"],
|
|
10
|
+
A: ["G"]
|
|
11
|
+
};
|
|
12
|
+
const eekUtil = (input) => {
|
|
13
|
+
const { max, min, rating } = input;
|
|
14
|
+
const validMax = validRanges[max];
|
|
15
|
+
if (!(validMax && validMax.indexOf(min) > -1)) {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
let current = max;
|
|
19
|
+
let i = 1;
|
|
20
|
+
while (current !== rating) {
|
|
21
|
+
i++;
|
|
22
|
+
if (min === current) {
|
|
23
|
+
return null;
|
|
24
|
+
} else if (current.length > 1) {
|
|
25
|
+
current = current.slice(0, current.length - 1);
|
|
26
|
+
} else {
|
|
27
|
+
current = String.fromCharCode(current.charCodeAt(0) + 1);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return i > 7 ? 7 : i;
|
|
31
|
+
};
|
|
32
|
+
const EbayEek = ({ min = "", max = "", rating, a11yText, className: extraClasses }) => {
|
|
33
|
+
const parsedRating = eekUtil({ rating, min, max });
|
|
34
|
+
const className = classNames(extraClasses, "eek", { [`eek--rating-${parsedRating}`]: !!parsedRating });
|
|
35
|
+
const backupA11yText = `Energy Rating: ${rating}. Range: ${max} - ${min}.`;
|
|
36
|
+
return React.createElement(
|
|
37
|
+
"div",
|
|
38
|
+
{ className, role: "figure", "aria-label": a11yText || backupA11yText },
|
|
39
|
+
React.createElement(
|
|
40
|
+
"div",
|
|
41
|
+
{ className: "eek__container", "aria-hidden": true },
|
|
42
|
+
React.createElement(
|
|
43
|
+
"span",
|
|
44
|
+
{ className: "eek__rating-range" },
|
|
45
|
+
React.createElement("span", { "aria-hidden": "true" }, max),
|
|
46
|
+
React.createElement(icon.EbayIcon, { name: "eekRangeArrow" }),
|
|
47
|
+
React.createElement("span", { "aria-hidden": "true" }, min)
|
|
48
|
+
),
|
|
49
|
+
React.createElement("span", { className: "eek__rating", "aria-hidden": "true" }, rating)
|
|
50
|
+
),
|
|
51
|
+
React.createElement(icon.EbayIcon, { name: "eekArrow" })
|
|
52
|
+
);
|
|
53
|
+
};
|
|
54
|
+
exports.EbayEek = EbayEek;
|
package/ebay-fake-menu/index.js
CHANGED
|
@@ -1 +1,10 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const menu = require("../menu-fCOy6wBS.js");
|
|
4
|
+
const ebayFakeMenu_menuItem = require("./menu-item/index.js");
|
|
5
|
+
const React = require("react");
|
|
6
|
+
const classNames = require("classnames");
|
|
7
|
+
const EbayMenuItemSeparator = ({ className, ...rest }) => React.createElement("hr", { ...rest, className: classNames(className, "fake-menu__separator"), role: "separator" });
|
|
8
|
+
exports.EbayFakeMenu = menu.EbayFakeMenu;
|
|
9
|
+
exports.EbayFakeMenuItem = ebayFakeMenu_menuItem;
|
|
10
|
+
exports.EbayFakeMenuSeparator = EbayMenuItemSeparator;
|
|
@@ -1 +1,49 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
const React = require("react");
|
|
3
|
+
const classNames = require("classnames");
|
|
4
|
+
const icon = require("../../icon-B17Di3YL.js");
|
|
5
|
+
const badge = require("../../badge-CR5t7-2L.js");
|
|
6
|
+
const EbayMenuItem = ({ className, current, disabled, autoFocus, type, badgeNumber, badgeAriaLabel, children, ...rest }) => {
|
|
7
|
+
const ref = React.useRef();
|
|
8
|
+
const hasBadge = badgeNumber !== void 0;
|
|
9
|
+
React.useEffect(() => {
|
|
10
|
+
var _a;
|
|
11
|
+
if (autoFocus) {
|
|
12
|
+
(_a = ref.current) == null ? void 0 : _a.focus();
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
const itemProps = {
|
|
16
|
+
...rest,
|
|
17
|
+
ref,
|
|
18
|
+
className: classNames(className, "fake-menu__item", hasBadge && "menu__item--badged"),
|
|
19
|
+
"aria-label": badgeAriaLabel
|
|
20
|
+
};
|
|
21
|
+
const tick = React.createElement(icon.EbayIcon, { name: "tick16" });
|
|
22
|
+
const badgeStyleFix = {
|
|
23
|
+
marginLeft: "var(--spacing-100)",
|
|
24
|
+
marginRight: "var(--spacing-100)"
|
|
25
|
+
};
|
|
26
|
+
const badge$1 = hasBadge && React.createElement(badge.EbayBadge, { type: "menu", number: badgeNumber, style: badgeStyleFix });
|
|
27
|
+
return type === "button" ? React.createElement(
|
|
28
|
+
"button",
|
|
29
|
+
{ ...itemProps, type: "button", disabled },
|
|
30
|
+
React.createElement(
|
|
31
|
+
"span",
|
|
32
|
+
null,
|
|
33
|
+
children,
|
|
34
|
+
badge$1
|
|
35
|
+
),
|
|
36
|
+
tick
|
|
37
|
+
) : React.createElement(
|
|
38
|
+
"a",
|
|
39
|
+
{ ...itemProps, "aria-disabled": disabled ? "true" : void 0 },
|
|
40
|
+
React.createElement(
|
|
41
|
+
"span",
|
|
42
|
+
null,
|
|
43
|
+
children,
|
|
44
|
+
badge$1
|
|
45
|
+
),
|
|
46
|
+
tick
|
|
47
|
+
);
|
|
48
|
+
};
|
|
49
|
+
module.exports = EbayMenuItem;
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const ebayFakeMenuButton_menuButton = require("../menu-button-CKGsgg6G.js");
|
|
4
|
+
exports.EbayFakeMenuButton = ebayFakeMenuButton_menuButton.EbayMenuButton;
|
|
5
|
+
exports.EbayFakeMenuButtonItem = ebayFakeMenuButton_menuButton.EbayFakeMenuButtonItem;
|
|
6
|
+
exports.EbayFakeMenuButtonLabel = ebayFakeMenuButton_menuButton.EbayFakeMenuButtonLabel;
|
|
7
|
+
exports.EbayFakeMenuButtonSeparator = ebayFakeMenuButton_menuButton.EbayMenuButtonSeparator;
|
|
@@ -1 +1,12 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
require("react");
|
|
3
|
+
require("classnames");
|
|
4
|
+
require("../../common/component-utils/utils/index.js");
|
|
5
|
+
require("../../common/event-utils/index.js");
|
|
6
|
+
require("../../common/random-id/index.js");
|
|
7
|
+
require("../../button-B4bZIgwB.js");
|
|
8
|
+
require("../../icon-B17Di3YL.js");
|
|
9
|
+
require("../../icon-button-BQWoMgX1.js");
|
|
10
|
+
require("../../menu-fCOy6wBS.js");
|
|
11
|
+
const ebayFakeMenuButton_menuButton = require("../../menu-button-CKGsgg6G.js");
|
|
12
|
+
module.exports = ebayFakeMenuButton_menuButton.EbayMenuButton;
|
package/ebay-fake-tabs/index.js
CHANGED
|
@@ -1 +1,30 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const React = require("react");
|
|
4
|
+
const classNames = require("classnames");
|
|
5
|
+
const common_componentUtils_utils = require("../common/component-utils/utils/index.js");
|
|
6
|
+
const Tab = ({ children, href, ariaCurrent, className, ...rest }) => React.createElement(
|
|
7
|
+
"li",
|
|
8
|
+
{ ...rest, className: classNames(className, "fake-tabs__item") },
|
|
9
|
+
React.createElement("a", { href, "aria-current": ariaCurrent }, children)
|
|
10
|
+
);
|
|
11
|
+
const EbayFakeTabs = ({ selectedIndex = 0, tabMatchesCurrentUrl, className, children, ...rest }) => {
|
|
12
|
+
const ariaCurrent = tabMatchesCurrentUrl === false ? "true" : "page";
|
|
13
|
+
const tabHeadings = common_componentUtils_utils.filterByType(children, Tab).map((item, i) => React.cloneElement(item, {
|
|
14
|
+
...item.props,
|
|
15
|
+
ariaCurrent: selectedIndex === i ? ariaCurrent : null
|
|
16
|
+
}));
|
|
17
|
+
const tabContent = common_componentUtils_utils.excludeComponent(children, Tab);
|
|
18
|
+
return React.createElement(
|
|
19
|
+
"div",
|
|
20
|
+
{ ...rest, className: classNames(className, "fake-tabs") },
|
|
21
|
+
React.createElement("ul", { className: "fake-tabs__items" }, tabHeadings),
|
|
22
|
+
React.createElement(
|
|
23
|
+
"div",
|
|
24
|
+
{ className: "fake-tabs__content" },
|
|
25
|
+
React.createElement("div", { className: "fake-tabs__cell" }, tabContent)
|
|
26
|
+
)
|
|
27
|
+
);
|
|
28
|
+
};
|
|
29
|
+
exports.EbayFakeTab = Tab;
|
|
30
|
+
exports.EbayFakeTabs = EbayFakeTabs;
|
package/ebay-field/index.js
CHANGED
|
@@ -1 +1,21 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const React = require("react");
|
|
4
|
+
const classNames = require("classnames");
|
|
5
|
+
const label = require("../label-C0AS4fnO.js");
|
|
6
|
+
const Field = ({ className, layout = "inline", children }) => {
|
|
7
|
+
const WrapperElement = layout === "block" ? "div" : "span";
|
|
8
|
+
return React.createElement(WrapperElement, { className: classNames("field", className) }, children);
|
|
9
|
+
};
|
|
10
|
+
const Description = ({ type, position = "below", className, children, ...rest }) => {
|
|
11
|
+
const wrapperClassName = classNames(className, "field__description", { [`field__description--${type}`]: type });
|
|
12
|
+
const WrapperElement = position === "below" ? `div` : `span`;
|
|
13
|
+
return React.createElement(
|
|
14
|
+
WrapperElement,
|
|
15
|
+
{ ...rest, className: wrapperClassName },
|
|
16
|
+
React.createElement("span", null, children)
|
|
17
|
+
);
|
|
18
|
+
};
|
|
19
|
+
exports.EbayLabel = label.Label;
|
|
20
|
+
exports.EbayField = Field;
|
|
21
|
+
exports.EbayFieldDescription = Description;
|
|
@@ -1 +1,10 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const React = require("react");
|
|
4
|
+
const classNames = require("classnames");
|
|
5
|
+
const dialogPreviousButton = require("../dialog-previous-button-EC_Y6KaT.js");
|
|
6
|
+
require("../icon-button-BQWoMgX1.js");
|
|
7
|
+
const classPrefix = "fullscreen-dialog";
|
|
8
|
+
const EbayFullscreenDialog = ({ open, onClose = () => {
|
|
9
|
+
}, className, animated, ...rest }) => React.createElement(dialogPreviousButton.DialogBaseWithState, { ...rest, classPrefix, buttonPosition: "right", onCloseBtnClick: onClose, transitionElement: "window", animated, className: classNames(className, `${classPrefix}--mask-fade-slow`), windowClass: classNames(`${classPrefix}__window`, `${classPrefix}__window--slide`), open });
|
|
10
|
+
exports.EbayFullscreenDialog = EbayFullscreenDialog;
|
package/ebay-icon/index.js
CHANGED
|
@@ -1 +1,4 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const icon = require("../icon-B17Di3YL.js");
|
|
4
|
+
exports.EbayIcon = icon.EbayIcon;
|
|
@@ -1 +1,4 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const iconButton = require("../icon-button-BQWoMgX1.js");
|
|
4
|
+
exports.EbayIconButton = iconButton.EbayIconButton;
|
package/ebay-infotip/index.js
CHANGED
|
@@ -1 +1,76 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const React = require("react");
|
|
4
|
+
const classNames$1 = require("classnames");
|
|
5
|
+
const common_componentUtils_utils = require("../common/component-utils/utils/index.js");
|
|
6
|
+
const useTooltip = require("../use-tooltip-7JxcZHJn.js");
|
|
7
|
+
const drawer = require("../drawer-DBDktEBZ.js");
|
|
8
|
+
const ebayDialogBase_components_dialogHeader = require("../ebay-dialog-base/components/dialog-header/index.js");
|
|
9
|
+
require("react-remove-scroll");
|
|
10
|
+
const icon = require("../icon-B17Di3YL.js");
|
|
11
|
+
require("../icon-button-BQWoMgX1.js");
|
|
12
|
+
const classNames = require("classnames/dedupe");
|
|
13
|
+
const common_componentUtils_forwardRef = require("../common/component-utils/forwardRef/index.js");
|
|
14
|
+
const EbayInfotipHost = ({ icon: icon$1, className, children, forwardedRef, variant, ...rest }) => {
|
|
15
|
+
const classPrefix = variant === "modal" ? "dialog--mini" : "infotip";
|
|
16
|
+
const buttonIcon = React.createElement(icon.EbayIcon, { name: icon$1 });
|
|
17
|
+
const buttonContent = children instanceof Function ? children({ icon: buttonIcon }) : children;
|
|
18
|
+
return React.createElement("button", { ...rest, className: classNames("icon-btn icon-btn--transparent", className, `${classPrefix}__host`), type: "button", ref: forwardedRef }, buttonContent || buttonIcon);
|
|
19
|
+
};
|
|
20
|
+
const EbayInfotipHost$1 = common_componentUtils_forwardRef.withForwardRef(EbayInfotipHost);
|
|
21
|
+
const EbayInfotip = ({ variant = "default", pointer, overlayStyle, disabled, onExpand, onCollapse, children, initialExpanded, icon: icon2 = "information16", a11yCloseText, "aria-label": ariaLabel, className, a11yMaximizeText, a11yMinimizeText }) => {
|
|
22
|
+
const buttonRef = React.useRef();
|
|
23
|
+
const { isExpanded, expandTooltip, collapseTooltip } = useTooltip.useTooltip({ onCollapse, onExpand, initialExpanded, hostRef: buttonRef });
|
|
24
|
+
const isModal = variant === "modal";
|
|
25
|
+
const containerRef = React.useRef();
|
|
26
|
+
const heading = common_componentUtils_utils.findComponent(children, EbayTooltipHeading);
|
|
27
|
+
const content = common_componentUtils_utils.findComponent(children, EbayInfotipContent);
|
|
28
|
+
const button = common_componentUtils_utils.findComponent(children, EbayInfotipHost$1) || React.createElement(EbayInfotipHost$1);
|
|
29
|
+
const toggleTooltip = () => {
|
|
30
|
+
if (isExpanded) {
|
|
31
|
+
collapseTooltip();
|
|
32
|
+
} else {
|
|
33
|
+
expandTooltip();
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
if (!content) {
|
|
37
|
+
throw new Error(`EbayInfotip: Please use a EbayInfotipContent that defines the content of the infotip`);
|
|
38
|
+
}
|
|
39
|
+
const { children: contentChildren, ...contentProps } = content.props;
|
|
40
|
+
return React.createElement(
|
|
41
|
+
React.Fragment,
|
|
42
|
+
null,
|
|
43
|
+
React.createElement(
|
|
44
|
+
useTooltip.Tooltip,
|
|
45
|
+
{ type: "infotip", isExpanded, className: classNames$1(className, { "dialog--mini": isModal }), ref: containerRef },
|
|
46
|
+
React.createElement(useTooltip.TooltipHost, null, React.cloneElement(button, {
|
|
47
|
+
ref: buttonRef,
|
|
48
|
+
onClick: toggleTooltip,
|
|
49
|
+
disabled,
|
|
50
|
+
variant,
|
|
51
|
+
"aria-label": ariaLabel,
|
|
52
|
+
"aria-expanded": isExpanded,
|
|
53
|
+
icon: icon2,
|
|
54
|
+
...button.props
|
|
55
|
+
})),
|
|
56
|
+
!isModal && React.createElement(
|
|
57
|
+
useTooltip.TooltipContent,
|
|
58
|
+
{ ...contentProps, type: "infotip", style: overlayStyle, pointer, showCloseButton: true, a11yCloseText, onClose: collapseTooltip },
|
|
59
|
+
heading,
|
|
60
|
+
contentChildren
|
|
61
|
+
)
|
|
62
|
+
),
|
|
63
|
+
isModal && React.createElement(
|
|
64
|
+
drawer.EbayDrawerDialog,
|
|
65
|
+
{ ...contentProps, open: isExpanded, onClose: collapseTooltip, a11yCloseText, className: "dialog--mini__overlay", a11yMaximizeText, a11yMinimizeText },
|
|
66
|
+
React.createElement(ebayDialogBase_components_dialogHeader, null, heading),
|
|
67
|
+
contentChildren
|
|
68
|
+
)
|
|
69
|
+
);
|
|
70
|
+
};
|
|
71
|
+
const EbayTooltipHeading = ({ className, ...props }) => React.createElement("span", { ...props, className: classNames$1("infotip__heading", className) });
|
|
72
|
+
const EbayInfotipContent = ({ children }) => React.createElement(React.Fragment, null, children);
|
|
73
|
+
exports.EbayInfotip = EbayInfotip;
|
|
74
|
+
exports.EbayInfotipContent = EbayInfotipContent;
|
|
75
|
+
exports.EbayInfotipHeading = EbayTooltipHeading;
|
|
76
|
+
exports.EbayInfotipHost = EbayInfotipHost$1;
|
|
@@ -1 +1,36 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const React = require("react");
|
|
4
|
+
const classNames = require("classnames");
|
|
5
|
+
const noticeContent = require("../notice-content-BhUeK1pd.js");
|
|
6
|
+
const noticeContent$1 = require("../notice-content-BTXVxttv.js");
|
|
7
|
+
const common_componentUtils_utils = require("../common/component-utils/utils/index.js");
|
|
8
|
+
const icon = require("../icon-B17Di3YL.js");
|
|
9
|
+
const EbayInlineNotice = ({ className, status = "general", children, hidden = false, "aria-label": ariaLabel, onNoticeShow = () => {
|
|
10
|
+
}, ...rest }) => {
|
|
11
|
+
React.useEffect(() => {
|
|
12
|
+
if (!hidden) {
|
|
13
|
+
onNoticeShow();
|
|
14
|
+
}
|
|
15
|
+
}, [hidden]);
|
|
16
|
+
if (hidden) {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
const content = common_componentUtils_utils.findComponent(children, noticeContent.EbayNoticeContent);
|
|
20
|
+
if (!content) {
|
|
21
|
+
throw new Error(`EbayInlineNotice: Please use a EbayNoticeContent that defines the content of the notice`);
|
|
22
|
+
}
|
|
23
|
+
const isGeneral = status === `general`;
|
|
24
|
+
return React.createElement(
|
|
25
|
+
"div",
|
|
26
|
+
{ ...rest, className: classNames(className, "inline-notice", { [`inline-notice--${status}`]: !isGeneral }) },
|
|
27
|
+
!isGeneral ? React.createElement(
|
|
28
|
+
"span",
|
|
29
|
+
{ className: "inline-notice__header" },
|
|
30
|
+
React.createElement(icon.EbayIcon, { name: `${status}Filled16`, a11yText: ariaLabel, a11yVariant: "label" })
|
|
31
|
+
) : null,
|
|
32
|
+
React.createElement(noticeContent$1.NoticeContent, { ...content.props, type: "inline" })
|
|
33
|
+
);
|
|
34
|
+
};
|
|
35
|
+
exports.EbayNoticeContent = noticeContent.EbayNoticeContent;
|
|
36
|
+
exports.EbayInlineNotice = EbayInlineNotice;
|