@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.
- package/array.polyfill.flat-5BAolFdk.js +1 -0
- package/badge-CoHKfiPt.js +1 -0
- package/button-o4ao46WM.js +1 -0
- package/calendar-CPKqwJVQ.js +1 -0
- package/debounce-BQsYxxOL.js +1 -0
- package/dialog-previous-button-7ePoYWyj.js +1 -0
- package/drawer-BxxlJwkZ.js +1 -0
- package/ebay-alert-dialog.js +1 -0
- package/ebay-badge.js +1 -0
- package/ebay-breadcrumbs.js +1 -0
- package/ebay-button.js +1 -0
- package/ebay-calendar.js +1 -0
- package/ebay-carousel.js +1 -0
- package/ebay-checkbox.js +1 -0
- package/ebay-confirm-dialog.js +1 -0
- package/ebay-cta-button.js +1 -0
- package/ebay-date-textbox.js +1 -0
- package/ebay-dialog-base.js +1 -0
- package/ebay-drawer-dialog.js +1 -0
- package/ebay-eek.js +1 -0
- package/ebay-fake-menu-button.js +1 -0
- package/ebay-fake-menu.js +1 -0
- package/ebay-fake-tabs.js +1 -0
- package/ebay-field.js +1 -0
- package/ebay-fullscreen-dialog.js +1 -0
- package/ebay-icon-button.js +1 -0
- package/ebay-icon.js +1 -0
- package/ebay-infotip.js +1 -0
- package/ebay-inline-notice.js +1 -0
- package/ebay-lightbox-dialog.js +1 -0
- package/ebay-listbox-button.js +2 -0
- package/ebay-menu/menu.d.ts +1 -1
- package/ebay-menu/menu.d.ts.map +1 -1
- package/ebay-menu-button.js +1 -0
- package/ebay-menu.js +1 -0
- package/ebay-notice-base.js +1 -0
- package/ebay-page-notice.js +1 -0
- package/ebay-pagination.js +1 -0
- package/ebay-panel-dialog.js +1 -0
- package/ebay-progress-bar.js +1 -0
- package/ebay-progress-spinner.js +1 -0
- package/ebay-progress-stepper.js +1 -0
- package/ebay-radio.js +1 -0
- package/ebay-section-notice.js +1 -0
- package/ebay-section-title/index.d.ts.map +1 -1
- package/ebay-section-title.js +1 -0
- package/ebay-select.js +1 -0
- package/ebay-signal.js +1 -0
- package/ebay-snackbar-dialog.js +1 -0
- package/ebay-split-button.js +1 -0
- package/ebay-star-rating-select.js +1 -0
- package/ebay-star-rating.js +1 -0
- package/ebay-svg.js +1 -0
- package/ebay-switch.js +1 -0
- package/ebay-tabs.js +1 -0
- package/ebay-textbox.js +1 -0
- package/ebay-toast-dialog.js +1 -0
- package/ebay-tooltip.js +1 -0
- package/ebay-tourtip.js +1 -0
- package/ebay-video.js +1 -0
- package/hooks-Ctier7Yv.js +1 -0
- package/icon-DK6eEQD8.js +1 -0
- package/icon-button-BB6GFLm7.js +1 -0
- package/index-DbjwTbDP.js +1 -0
- package/label-CnrpYJ-g.js +1 -0
- package/menu-DZU8jEPV.js +1 -0
- package/menu-button-label-BcgasGA4.js +1 -0
- package/menu-item-DBi1NcrM.js +1 -0
- package/notice-content-9iF4T8uB.js +1 -0
- package/notice-content-C0ZStfuX.js +1 -0
- package/notice-footer-Cw1DMzoB.js +1 -0
- package/package.json +19 -8
- package/progress-spinner-CDgxI8R_.js +1 -0
- package/range-DOsPN0h5.js +1 -0
- package/textbox-WnB-9F4y.js +1 -0
- package/use-tooltip-BavqG36Z.js +1 -0
- package/utils-C9NL3q0j.js +1 -0
- package/common/component-utils/array.polyfill.flat.js +0 -32
- package/common/component-utils/forwardRef.js +0 -37
- package/common/component-utils/index.js +0 -18
- package/common/component-utils/usePrevious.js +0 -12
- package/common/component-utils/utils.js +0 -26
- package/common/debounce.js +0 -11
- package/common/event-utils/index.js +0 -123
- package/common/event-utils/types.js +0 -14
- package/common/event-utils/use-key-press.js +0 -33
- package/common/event-utils/use-roving-index.js +0 -35
- package/common/floating-label-utils/hooks.js +0 -133
- package/common/notice-utils/notice-content.js +0 -12
- package/common/notice-utils/notice-cta.js +0 -23
- package/common/notice-utils/notice-footer.js +0 -23
- package/common/notice-utils/notice-title.js +0 -24
- package/common/random-id.js +0 -5
- package/common/range.js +0 -5
- package/common/tooltip-utils/constants.js +0 -95
- package/common/tooltip-utils/index.js +0 -19
- package/common/tooltip-utils/tooltip-close-button.js +0 -8
- package/common/tooltip-utils/tooltip-content.js +0 -25
- package/common/tooltip-utils/tooltip-footer.js +0 -9
- package/common/tooltip-utils/tooltip-host.js +0 -24
- package/common/tooltip-utils/tooltip.js +0 -60
- package/common/tooltip-utils/types.js +0 -2
- package/common/tooltip-utils/use-tooltip.js +0 -27
- package/ebay-alert-dialog/alert-dialog.js +0 -55
- package/ebay-alert-dialog/index.js +0 -8
- package/ebay-badge/badge.js +0 -25
- package/ebay-badge/index.js +0 -8
- package/ebay-breadcrumbs/breadcrumb-item.js +0 -27
- package/ebay-breadcrumbs/breadcrumbs.js +0 -64
- package/ebay-breadcrumbs/index.js +0 -10
- package/ebay-button/button-cell.js +0 -29
- package/ebay-button/button-expand.js +0 -13
- package/ebay-button/button-loading.js +0 -11
- package/ebay-button/button-text.js +0 -9
- package/ebay-button/button.js +0 -95
- package/ebay-button/index.js +0 -10
- package/ebay-button/types.js +0 -2
- package/ebay-calendar/calendar.js +0 -306
- package/ebay-calendar/date-utils.js +0 -58
- package/ebay-calendar/index.js +0 -8
- package/ebay-carousel/carousel-control-button.js +0 -24
- package/ebay-carousel/carousel-item.js +0 -59
- package/ebay-carousel/carousel-list.js +0 -81
- package/ebay-carousel/carousel.js +0 -109
- package/ebay-carousel/helpers.js +0 -123
- package/ebay-carousel/index.js +0 -10
- package/ebay-carousel/scroll-to-transition.js +0 -102
- package/ebay-carousel/types.js +0 -2
- package/ebay-checkbox/checkbox.js +0 -77
- package/ebay-checkbox/index.js +0 -8
- package/ebay-confirm-dialog/confirm-dialog.js +0 -56
- package/ebay-confirm-dialog/index.js +0 -8
- package/ebay-cta-button/cta-button.js +0 -30
- package/ebay-cta-button/index.js +0 -8
- package/ebay-date-textbox/date-textbox.js +0 -179
- package/ebay-date-textbox/index.js +0 -8
- package/ebay-dialog-base/components/animation.js +0 -96
- package/ebay-dialog-base/components/dialog-actions.js +0 -8
- package/ebay-dialog-base/components/dialog-close-button.js +0 -8
- package/ebay-dialog-base/components/dialog-footer.js +0 -8
- package/ebay-dialog-base/components/dialog-header.js +0 -22
- package/ebay-dialog-base/components/dialog-previous-button.js +0 -24
- package/ebay-dialog-base/components/dialogBase.js +0 -152
- package/ebay-dialog-base/dialog-base-with-state.js +0 -63
- package/ebay-dialog-base/index.js +0 -18
- package/ebay-drawer-dialog/components/drawer.js +0 -104
- package/ebay-drawer-dialog/index.js +0 -8
- package/ebay-eek/eek-rating.js +0 -23
- package/ebay-eek/eek-util.js +0 -34
- package/ebay-eek/index.js +0 -8
- package/ebay-fake-menu/index.js +0 -12
- package/ebay-fake-menu/menu-item-separator.js +0 -23
- package/ebay-fake-menu/menu-item.js +0 -72
- package/ebay-fake-menu/menu.js +0 -57
- package/ebay-fake-menu-button/index.js +0 -14
- package/ebay-fake-menu-button/menu-button-item.js +0 -5
- package/ebay-fake-menu-button/menu-button-label.js +0 -8
- package/ebay-fake-menu-button/menu-button-separator.js +0 -23
- package/ebay-fake-menu-button/menu-button.js +0 -105
- package/ebay-fake-tabs/fake-tabs.js +0 -54
- package/ebay-fake-tabs/index.js +0 -10
- package/ebay-fake-tabs/tab.js +0 -24
- package/ebay-field/description.js +0 -26
- package/ebay-field/field.js +0 -12
- package/ebay-field/index.js +0 -12
- package/ebay-field/label.js +0 -29
- package/ebay-field/types.js +0 -2
- package/ebay-fullscreen-dialog/fullscreen-dialog.js +0 -25
- package/ebay-fullscreen-dialog/index.js +0 -8
- package/ebay-icon/icon.js +0 -98
- package/ebay-icon/index.js +0 -8
- package/ebay-icon/types.js +0 -3
- package/ebay-icon-button/icon-button.js +0 -40
- package/ebay-icon-button/index.js +0 -8
- package/ebay-infotip/ebay-infotip-content.js +0 -12
- package/ebay-infotip/ebay-infotip-heading.js +0 -23
- package/ebay-infotip/ebay-infotip-host.js +0 -28
- package/ebay-infotip/ebay-infotip.js +0 -79
- package/ebay-infotip/index.js +0 -14
- package/ebay-infotip/types.js +0 -2
- package/ebay-inline-notice/index.js +0 -10
- package/ebay-inline-notice/inline-notice.js +0 -66
- package/ebay-inline-notice/types.js +0 -2
- package/ebay-lightbox-dialog/index.js +0 -8
- package/ebay-lightbox-dialog/lightbox-dialog.js +0 -27
- package/ebay-listbox-button/index.js +0 -10
- package/ebay-listbox-button/listbox-button-option.js +0 -27
- package/ebay-listbox-button/listbox-button.js +0 -252
- package/ebay-menu/index.js +0 -27
- package/ebay-menu/menu-item-separator.js +0 -23
- package/ebay-menu/menu-item.js +0 -67
- package/ebay-menu/menu.js +0 -149
- package/ebay-menu/types.js +0 -2
- package/ebay-menu-button/index.js +0 -29
- package/ebay-menu-button/menu-button-item.js +0 -5
- package/ebay-menu-button/menu-button-label.js +0 -8
- package/ebay-menu-button/menu-button-separator.js +0 -23
- package/ebay-menu-button/menu-button.js +0 -132
- package/ebay-menu-button/types.js +0 -2
- package/ebay-notice-base/components/ebay-notice-content/index.js +0 -8
- package/ebay-notice-base/components/ebay-notice-content/notice-content.js +0 -4
- package/ebay-notice-base/components/ebay-notice-title/index.js +0 -8
- package/ebay-notice-base/components/ebay-notice-title/notice-title.js +0 -8
- package/ebay-notice-base/index.js +0 -7
- package/ebay-page-notice/index.js +0 -16
- package/ebay-page-notice/page-notice-cta.js +0 -9
- package/ebay-page-notice/page-notice-footer.js +0 -9
- package/ebay-page-notice/page-notice-title.js +0 -23
- package/ebay-page-notice/page-notice.js +0 -66
- package/ebay-pagination/const.js +0 -8
- package/ebay-pagination/helpers.js +0 -92
- package/ebay-pagination/index.js +0 -10
- package/ebay-pagination/pagination-item.js +0 -55
- package/ebay-pagination/pagination.js +0 -146
- package/ebay-pagination/types.js +0 -2
- package/ebay-panel-dialog/index.js +0 -8
- package/ebay-panel-dialog/panel-dialog.js +0 -27
- package/ebay-progress-bar/index.js +0 -8
- package/ebay-progress-bar/progress-bar.js +0 -23
- package/ebay-progress-spinner/index.js +0 -8
- package/ebay-progress-spinner/progress-spinner.js +0 -35
- package/ebay-progress-stepper/ebay-progress-step.js +0 -64
- package/ebay-progress-stepper/ebay-progress-stepper.js +0 -70
- package/ebay-progress-stepper/ebay-progress-title.js +0 -5
- package/ebay-progress-stepper/index.js +0 -12
- package/ebay-progress-stepper/types.js +0 -2
- package/ebay-radio/index.js +0 -8
- package/ebay-radio/radio.js +0 -71
- package/ebay-section-notice/index.js +0 -14
- package/ebay-section-notice/section-notice-footer.js +0 -9
- package/ebay-section-notice/section-notice-title.js +0 -23
- package/ebay-section-notice/section-notice.js +0 -82
- package/ebay-section-title/cta.js +0 -26
- package/ebay-section-title/index.js +0 -16
- package/ebay-section-title/info.js +0 -23
- package/ebay-section-title/overflow.js +0 -23
- package/ebay-section-title/section-title.js +0 -35
- package/ebay-section-title/subtitle.js +0 -23
- package/ebay-section-title/title.js +0 -23
- package/ebay-select/ebay-select-option.js +0 -22
- package/ebay-select/ebay-select.js +0 -129
- package/ebay-select/index.js +0 -10
- package/ebay-signal/index.js +0 -8
- package/ebay-signal/signal.js +0 -24
- package/ebay-snackbar-dialog/components/ebay-snackbar-dialog-action.js +0 -24
- package/ebay-snackbar-dialog/components/ebay-snackbar-dialog.js +0 -122
- package/ebay-snackbar-dialog/index.js +0 -7
- package/ebay-split-button/index.js +0 -23
- package/ebay-split-button/split-button.js +0 -30
- package/ebay-split-button/types.js +0 -2
- package/ebay-star-rating/index.js +0 -23
- package/ebay-star-rating/star-rating.js +0 -26
- package/ebay-star-rating-select/index.js +0 -23
- package/ebay-star-rating-select/star-rating-select.js +0 -82
- package/ebay-svg/index.js +0 -8
- package/ebay-svg/svg.js +0 -2548
- package/ebay-switch/ebay-switch.js +0 -61
- package/ebay-switch/index.js +0 -8
- package/ebay-tabs/index.js +0 -12
- package/ebay-tabs/tab-panel.js +0 -24
- package/ebay-tabs/tab.js +0 -24
- package/ebay-tabs/tabs.js +0 -90
- package/ebay-tabs/types.js +0 -2
- package/ebay-textbox/index.js +0 -16
- package/ebay-textbox/postfix-icon.js +0 -26
- package/ebay-textbox/postfix-text.js +0 -8
- package/ebay-textbox/prefix-icon.js +0 -23
- package/ebay-textbox/prefix-text.js +0 -8
- package/ebay-textbox/textbox.js +0 -147
- package/ebay-textbox/types.js +0 -2
- package/ebay-toast-dialog/components/toast.js +0 -26
- package/ebay-toast-dialog/index.js +0 -8
- package/ebay-tooltip/ebay-tooltip-content.js +0 -8
- package/ebay-tooltip/ebay-tooltip-host.js +0 -8
- package/ebay-tooltip/ebay-tooltip.js +0 -85
- package/ebay-tooltip/index.js +0 -14
- package/ebay-tourtip/ebay-tourtip-content.js +0 -8
- package/ebay-tourtip/ebay-tourtip-footer.js +0 -10
- package/ebay-tourtip/ebay-tourtip-heading.js +0 -24
- package/ebay-tourtip/ebay-tourtip-host.js +0 -8
- package/ebay-tourtip/ebay-tourtip.js +0 -70
- package/ebay-tourtip/index.js +0 -18
- package/ebay-video/const.js +0 -19
- package/ebay-video/controls.js +0 -40
- package/ebay-video/index.js +0 -25
- package/ebay-video/reportButton.js +0 -12
- package/ebay-video/source.js +0 -22
- package/ebay-video/types.js +0 -2
- package/ebay-video/video.js +0 -210
|
@@ -1,133 +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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.useFloatingLabel = void 0;
|
|
30
|
-
const react_1 = __importStar(require("react"));
|
|
31
|
-
const classnames_1 = __importDefault(require("classnames"));
|
|
32
|
-
const classPrefix = 'floating-label__label';
|
|
33
|
-
// input background in Skin 12, used for autofill detection
|
|
34
|
-
const textboxElementBackgroundRGB = [
|
|
35
|
-
'rgb(245, 245, 245)',
|
|
36
|
-
'rgb(247, 247, 247)' // From skin version 12.6.0
|
|
37
|
-
];
|
|
38
|
-
// check for computed background color because of Chrome autofill bug
|
|
39
|
-
// https://stackoverflow.com/questions/35049555/chrome-autofill-autocomplete-no-value-for-password/35783761#35783761
|
|
40
|
-
const isAutofilled = (input) => input && !textboxElementBackgroundRGB.includes(getComputedStyle(input).backgroundColor);
|
|
41
|
-
const hasValue = (input) => { var _a; return ((_a = input === null || input === void 0 ? void 0 : input.value) === null || _a === void 0 ? void 0 : _a.length) > 0; };
|
|
42
|
-
const isSelect = (element) => (element === null || element === void 0 ? void 0 : element.tagName) === `SELECT`;
|
|
43
|
-
const setPlaceholder = (element, value) => {
|
|
44
|
-
// For select elements we need to temporary remove the text of the first option
|
|
45
|
-
// when the element is not focused, so only the label is shown. We still need to
|
|
46
|
-
// maintain the width of the input so we manually change the "min-width"
|
|
47
|
-
// Inspired by the marko implementation: https://github.com/makeup/makeup-js/blob/master/packages/makeup-floating-label/src/index.js
|
|
48
|
-
if (isSelect(element) && !hasValue(element.querySelector(`option`))) {
|
|
49
|
-
element.style['min-width'] = '';
|
|
50
|
-
const beforeWidth = element.offsetWidth;
|
|
51
|
-
element.querySelector(`option`).text = value;
|
|
52
|
-
if (!value && beforeWidth > element.offsetWidth) {
|
|
53
|
-
element.style['min-width'] = `${beforeWidth}px`;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
const getPlaceholder = (element) => {
|
|
58
|
-
if (isSelect(element)) {
|
|
59
|
-
return element.querySelector(`option`).text;
|
|
60
|
-
}
|
|
61
|
-
return element === null || element === void 0 ? void 0 : element.placeholder;
|
|
62
|
-
};
|
|
63
|
-
function useFloatingLabel({ ref, inputId, className, disabled, label, inputSize, inputValue, placeholder, invalid, opaqueLabel, type, onMount = () => { } }) {
|
|
64
|
-
const _internalInputRef = (0, react_1.useRef)(null);
|
|
65
|
-
const inputRef = () => ref || _internalInputRef;
|
|
66
|
-
const [isFloating, setFloating] = (0, react_1.useState)(Boolean(inputValue));
|
|
67
|
-
const [shouldAnimate, setAnimate] = (0, react_1.useState)(false);
|
|
68
|
-
const [isFocused, setFocused] = (0, react_1.useState)(false);
|
|
69
|
-
const selectFirstOptionText = (0, react_1.useRef)(``);
|
|
70
|
-
const onBlur = () => {
|
|
71
|
-
var _a;
|
|
72
|
-
setAnimate(true);
|
|
73
|
-
setFloating(hasValue((_a = inputRef()) === null || _a === void 0 ? void 0 : _a.current));
|
|
74
|
-
setFocused(false);
|
|
75
|
-
setPlaceholder(inputRef().current, ``);
|
|
76
|
-
};
|
|
77
|
-
const onFocus = () => {
|
|
78
|
-
var _a;
|
|
79
|
-
setAnimate(true);
|
|
80
|
-
setFloating(true);
|
|
81
|
-
setFocused(true);
|
|
82
|
-
setPlaceholder((_a = inputRef()) === null || _a === void 0 ? void 0 : _a.current, selectFirstOptionText.current);
|
|
83
|
-
};
|
|
84
|
-
(0, react_1.useEffect)(() => {
|
|
85
|
-
var _a, _b;
|
|
86
|
-
if (!label) {
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
selectFirstOptionText.current = getPlaceholder((_a = inputRef()) === null || _a === void 0 ? void 0 : _a.current);
|
|
90
|
-
setPlaceholder((_b = inputRef()) === null || _b === void 0 ? void 0 : _b.current, ``);
|
|
91
|
-
onMount();
|
|
92
|
-
}, []);
|
|
93
|
-
(0, react_1.useEffect)(() => {
|
|
94
|
-
var _a, _b, _c;
|
|
95
|
-
if (!label) {
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
setFloating(isFocused || hasValue((_a = inputRef()) === null || _a === void 0 ? void 0 : _a.current) || isAutofilled((_c = (_b = inputRef()) === null || _b === void 0 ? void 0 : _b.current) === null || _c === void 0 ? void 0 : _c.parentNode));
|
|
99
|
-
}, [isFocused, inputValue]);
|
|
100
|
-
const labelClassName = (0, classnames_1.default)(className, classPrefix, {
|
|
101
|
-
[`${classPrefix}--disabled`]: disabled,
|
|
102
|
-
[`${classPrefix}--animate`]: shouldAnimate,
|
|
103
|
-
[`${classPrefix}--inline`]: !isFloating && type !== 'date',
|
|
104
|
-
[`${classPrefix}--focus`]: isFocused,
|
|
105
|
-
[`${classPrefix}--invalid`]: invalid
|
|
106
|
-
});
|
|
107
|
-
const floatingLabelClassName = (0, classnames_1.default)(`floating-label`, {
|
|
108
|
-
'floating-label--large': inputSize === `large`,
|
|
109
|
-
'floating-label--opaque': opaqueLabel
|
|
110
|
-
});
|
|
111
|
-
const FragmentContainer = (0, react_1.useCallback)(({ children }) => react_1.default.createElement(react_1.default.Fragment, null, children), []);
|
|
112
|
-
const FloatingLabelContainer = (0, react_1.useCallback)(({ children }) => react_1.default.createElement("span", { className: floatingLabelClassName }, children), [floatingLabelClassName]);
|
|
113
|
-
if (!label) {
|
|
114
|
-
return {
|
|
115
|
-
label: null,
|
|
116
|
-
Container: FragmentContainer,
|
|
117
|
-
onBlur: () => { },
|
|
118
|
-
onFocus: () => { },
|
|
119
|
-
ref: inputRef(),
|
|
120
|
-
placeholder
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
const labelElement = react_1.default.createElement("label", { htmlFor: inputId, className: labelClassName }, label);
|
|
124
|
-
return {
|
|
125
|
-
label: labelElement,
|
|
126
|
-
Container: FloatingLabelContainer,
|
|
127
|
-
onBlur,
|
|
128
|
-
onFocus,
|
|
129
|
-
ref: inputRef(),
|
|
130
|
-
placeholder: !isFloating ? null : placeholder
|
|
131
|
-
};
|
|
132
|
-
}
|
|
133
|
-
exports.useFloatingLabel = useFloatingLabel;
|
|
@@ -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
|
-
const react_1 = __importDefault(require("react"));
|
|
7
|
-
const classnames_1 = __importDefault(require("classnames"));
|
|
8
|
-
const NoticeContent = ({ className, type, children }) => {
|
|
9
|
-
const ContentTag = type === 'inline' ? 'span' : 'div';
|
|
10
|
-
return (react_1.default.createElement(ContentTag, { className: (0, classnames_1.default)(className, `${type}-notice__main`) }, children));
|
|
11
|
-
};
|
|
12
|
-
exports.default = NoticeContent;
|
|
@@ -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 NoticeCTA = (_a) => {
|
|
20
|
-
var { className, type, children } = _a, rest = __rest(_a, ["className", "type", "children"]);
|
|
21
|
-
return (react_1.default.createElement("p", Object.assign({ className: (0, classnames_1.default)(className, `${type}-notice__cta`) }, rest), children));
|
|
22
|
-
};
|
|
23
|
-
exports.default = NoticeCTA;
|
|
@@ -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 NoticeFooter = (_a) => {
|
|
20
|
-
var { className, type, children } = _a, rest = __rest(_a, ["className", "type", "children"]);
|
|
21
|
-
return (react_1.default.createElement("div", Object.assign({ className: (0, classnames_1.default)(className, `${type}-notice__footer`) }, rest), children));
|
|
22
|
-
};
|
|
23
|
-
exports.default = NoticeFooter;
|
|
@@ -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 NoticeTitle = (_a) => {
|
|
20
|
-
var { className, type, as, children } = _a, rest = __rest(_a, ["className", "type", "as", "children"]);
|
|
21
|
-
const HeadingTag = as || `h2`;
|
|
22
|
-
return (react_1.default.createElement(HeadingTag, Object.assign({ className: (0, classnames_1.default)(className, `${type}-notice__title`) }, rest), children));
|
|
23
|
-
};
|
|
24
|
-
exports.default = NoticeTitle;
|
package/common/random-id.js
DELETED
package/common/range.js
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.POINTER_STYLES = exports.TYPE_ROLES = exports.DEFAULT_POINTER_DIRECTION = void 0;
|
|
4
|
-
exports.DEFAULT_POINTER_DIRECTION = 'bottom';
|
|
5
|
-
exports.TYPE_ROLES = {
|
|
6
|
-
tooltip: 'tooltip',
|
|
7
|
-
tourtip: 'region',
|
|
8
|
-
infotip: ''
|
|
9
|
-
};
|
|
10
|
-
exports.POINTER_STYLES = {
|
|
11
|
-
left: {
|
|
12
|
-
transform: 'translateX(16px) translateY(-50%) scale3d(1,1,1)',
|
|
13
|
-
left: '100%',
|
|
14
|
-
right: 'auto',
|
|
15
|
-
top: '-6px',
|
|
16
|
-
bottom: 'auto'
|
|
17
|
-
},
|
|
18
|
-
'left-top': {
|
|
19
|
-
transform: 'translateX(16px) scale3d(1,1,1)',
|
|
20
|
-
left: '100%',
|
|
21
|
-
right: 'auto',
|
|
22
|
-
top: '-100%',
|
|
23
|
-
bottom: 'auto'
|
|
24
|
-
},
|
|
25
|
-
'left-bottom': {
|
|
26
|
-
transform: 'translateX(16px) scale3d(1,1,1)',
|
|
27
|
-
left: '100%',
|
|
28
|
-
right: 'auto',
|
|
29
|
-
top: 'auto',
|
|
30
|
-
bottom: '-10px'
|
|
31
|
-
},
|
|
32
|
-
right: {
|
|
33
|
-
transform: 'translateX(-16px) translateY(-50%) scale3d(1,1,1)',
|
|
34
|
-
left: 'auto',
|
|
35
|
-
right: '100%',
|
|
36
|
-
top: '-6px',
|
|
37
|
-
bottom: 'auto'
|
|
38
|
-
},
|
|
39
|
-
'right-top': {
|
|
40
|
-
transform: 'translateX(-16px) scale3d(1,1,1)',
|
|
41
|
-
left: 'auto',
|
|
42
|
-
right: '100%',
|
|
43
|
-
top: '-100%',
|
|
44
|
-
bottom: 'auto'
|
|
45
|
-
},
|
|
46
|
-
'right-bottom': {
|
|
47
|
-
transform: 'translateX(-16px) scale3d(1,1,1)',
|
|
48
|
-
left: 'auto',
|
|
49
|
-
right: '100%',
|
|
50
|
-
top: 'auto',
|
|
51
|
-
bottom: '-50%'
|
|
52
|
-
},
|
|
53
|
-
top: {
|
|
54
|
-
transform: 'translateX(-50%) scale3d(1,1,1)',
|
|
55
|
-
left: '50%',
|
|
56
|
-
right: 'auto',
|
|
57
|
-
top: 'calc(100% + 2px)',
|
|
58
|
-
bottom: 'auto'
|
|
59
|
-
},
|
|
60
|
-
'top-left': {
|
|
61
|
-
transform: 'scale3d(1,1,1)',
|
|
62
|
-
left: '-10px',
|
|
63
|
-
right: 'auto',
|
|
64
|
-
top: 'calc(100% + 2px)',
|
|
65
|
-
bottom: 'auto'
|
|
66
|
-
},
|
|
67
|
-
'top-right': {
|
|
68
|
-
transform: 'scale3d(1,1,1)',
|
|
69
|
-
left: 'auto',
|
|
70
|
-
right: '-10px',
|
|
71
|
-
top: 'calc(100% + 2px)',
|
|
72
|
-
bottom: 'auto'
|
|
73
|
-
},
|
|
74
|
-
'bottom-right': {
|
|
75
|
-
transform: 'scale3d(1,1,1)',
|
|
76
|
-
left: 'auto',
|
|
77
|
-
right: '-10px',
|
|
78
|
-
top: 'auto',
|
|
79
|
-
bottom: 'calc(100% + 12px)'
|
|
80
|
-
},
|
|
81
|
-
'bottom-left': {
|
|
82
|
-
transform: 'scale3d(1,1,1)',
|
|
83
|
-
left: '-10px',
|
|
84
|
-
right: 'auto',
|
|
85
|
-
top: 'auto',
|
|
86
|
-
bottom: 'calc(100% + 12px)'
|
|
87
|
-
},
|
|
88
|
-
bottom: {
|
|
89
|
-
transform: 'translateX(-50%) scale3d(1,1,1)',
|
|
90
|
-
left: '50%',
|
|
91
|
-
right: 'auto',
|
|
92
|
-
top: 'auto',
|
|
93
|
-
bottom: 'calc(100% + 12px)'
|
|
94
|
-
}
|
|
95
|
-
};
|
|
@@ -1,19 +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.POINTER_STYLES = exports.DEFAULT_POINTER_DIRECTION = exports.useTooltip = exports.TooltipFooter = exports.TooltipContent = exports.TooltipHost = exports.Tooltip = void 0;
|
|
7
|
-
var tooltip_1 = require("./tooltip");
|
|
8
|
-
Object.defineProperty(exports, "Tooltip", { enumerable: true, get: function () { return __importDefault(tooltip_1).default; } });
|
|
9
|
-
var tooltip_host_1 = require("./tooltip-host");
|
|
10
|
-
Object.defineProperty(exports, "TooltipHost", { enumerable: true, get: function () { return __importDefault(tooltip_host_1).default; } });
|
|
11
|
-
var tooltip_content_1 = require("./tooltip-content");
|
|
12
|
-
Object.defineProperty(exports, "TooltipContent", { enumerable: true, get: function () { return __importDefault(tooltip_content_1).default; } });
|
|
13
|
-
var tooltip_footer_1 = require("./tooltip-footer");
|
|
14
|
-
Object.defineProperty(exports, "TooltipFooter", { enumerable: true, get: function () { return __importDefault(tooltip_footer_1).default; } });
|
|
15
|
-
var use_tooltip_1 = require("./use-tooltip");
|
|
16
|
-
Object.defineProperty(exports, "useTooltip", { enumerable: true, get: function () { return use_tooltip_1.useTooltip; } });
|
|
17
|
-
var constants_1 = require("./constants");
|
|
18
|
-
Object.defineProperty(exports, "DEFAULT_POINTER_DIRECTION", { enumerable: true, get: function () { return constants_1.DEFAULT_POINTER_DIRECTION; } });
|
|
19
|
-
Object.defineProperty(exports, "POINTER_STYLES", { enumerable: true, get: function () { return constants_1.POINTER_STYLES; } });
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
/**
|
|
4
|
-
* This is an empty component just to get extra property
|
|
5
|
-
* for the button used in the EbayInfotipContent
|
|
6
|
-
*/
|
|
7
|
-
const TooltipCloseButton = () => null;
|
|
8
|
-
exports.default = TooltipCloseButton;
|
|
@@ -1,25 +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 ebay_icon_1 = require("../../ebay-icon");
|
|
8
|
-
const component_utils_1 = require("../component-utils");
|
|
9
|
-
const constants_1 = require("./constants");
|
|
10
|
-
const tooltip_close_button_1 = __importDefault(require("./tooltip-close-button"));
|
|
11
|
-
const tooltip_footer_1 = __importDefault(require("./tooltip-footer"));
|
|
12
|
-
const TooltipContent = ({ id, style, pointer = constants_1.DEFAULT_POINTER_DIRECTION, children, type = 'tooltip', showCloseButton, a11yCloseText, onClose }) => {
|
|
13
|
-
const closeButton = (0, component_utils_1.findComponent)(children, tooltip_close_button_1.default);
|
|
14
|
-
const footer = (0, component_utils_1.findComponent)(children, tooltip_footer_1.default);
|
|
15
|
-
const allChildrenExceptFooter = (0, component_utils_1.excludeComponent)(children, tooltip_footer_1.default);
|
|
16
|
-
return (react_1.default.createElement("span", { className: `${type}__overlay`, id: id, role: constants_1.TYPE_ROLES[type] || null, style: Object.assign(Object.assign({}, constants_1.POINTER_STYLES[pointer]), style) },
|
|
17
|
-
react_1.default.createElement("span", { className: `${type}__pointer ${type}__pointer--${pointer}` }),
|
|
18
|
-
react_1.default.createElement("span", { className: `${type}__mask` },
|
|
19
|
-
react_1.default.createElement("span", { className: `${type}__cell` },
|
|
20
|
-
react_1.default.createElement("span", { className: `${type}__content` }, allChildrenExceptFooter),
|
|
21
|
-
showCloseButton ? (react_1.default.createElement("button", Object.assign({}, closeButton === null || closeButton === void 0 ? void 0 : closeButton.props, { className: `icon-btn icon-btn--transparent ${type}__close`, type: "button", "aria-label": a11yCloseText, onClick: onClose }),
|
|
22
|
-
react_1.default.createElement(ebay_icon_1.EbayIcon, { name: "close16" }))) : null,
|
|
23
|
-
footer))));
|
|
24
|
-
};
|
|
25
|
-
exports.default = TooltipContent;
|
|
@@ -1,9 +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 TooltipFooter = ({ children, className, type = 'tourtip' }) => (react_1.default.createElement("div", { className: (0, classnames_1.default)(`${type}__footer`, className) }, children));
|
|
9
|
-
exports.default = TooltipFooter;
|
|
@@ -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 = require("react");
|
|
18
|
-
const classnames_1 = __importDefault(require("classnames"));
|
|
19
|
-
const TooltipHost = (_a) => {
|
|
20
|
-
var { children, className, forwardedRef } = _a, rest = __rest(_a, ["children", "className", "forwardedRef"]);
|
|
21
|
-
react_1.Children.only(children);
|
|
22
|
-
return (0, react_1.cloneElement)(children, Object.assign(Object.assign({ ref: forwardedRef }, rest), { className: (0, classnames_1.default)(className, children.props.className) }));
|
|
23
|
-
};
|
|
24
|
-
exports.default = TooltipHost;
|
|
@@ -1,60 +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 forwardRef_1 = require("../component-utils/forwardRef");
|
|
43
|
-
const component_utils_1 = require("../component-utils");
|
|
44
|
-
const tooltip_host_1 = __importDefault(require("./tooltip-host"));
|
|
45
|
-
const Tooltip = (_a) => {
|
|
46
|
-
var _b;
|
|
47
|
-
var { className, type, isExpanded, children, forwardedRef } = _a, rest = __rest(_a, ["className", "type", "isExpanded", "children", "forwardedRef"]);
|
|
48
|
-
const originalHostComponent = (0, component_utils_1.findComponent)(children, tooltip_host_1.default);
|
|
49
|
-
const content = (0, component_utils_1.excludeComponent)(children, tooltip_host_1.default)[0];
|
|
50
|
-
if (!originalHostComponent) {
|
|
51
|
-
throw new Error(`Tooltip: Please use a TooltipHost that defines the host of the tooltip`);
|
|
52
|
-
}
|
|
53
|
-
const host = (0, react_1.cloneElement)(originalHostComponent, Object.assign({ className: `${type}__host`, 'aria-expanded': isExpanded, 'aria-describedby': (_b = content === null || content === void 0 ? void 0 : content.props) === null || _b === void 0 ? void 0 : _b.id }, originalHostComponent.props));
|
|
54
|
-
return (react_1.default.createElement("span", Object.assign({}, rest, { ref: forwardedRef, className: (0, classnames_1.default)(className, type, {
|
|
55
|
-
[`${type}--expanded`]: isExpanded
|
|
56
|
-
}) }),
|
|
57
|
-
host,
|
|
58
|
-
content));
|
|
59
|
-
};
|
|
60
|
-
exports.default = (0, forwardRef_1.withForwardRef)(Tooltip);
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useTooltip = void 0;
|
|
4
|
-
const react_1 = require("react");
|
|
5
|
-
const useTooltip = ({ onExpand, onCollapse, initialExpanded = false, hostRef }) => {
|
|
6
|
-
const [isExpanded, setIsExpanded] = (0, react_1.useState)(initialExpanded);
|
|
7
|
-
const expandTooltip = () => {
|
|
8
|
-
setIsExpanded(true);
|
|
9
|
-
if (onExpand) {
|
|
10
|
-
onExpand();
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
const collapseTooltip = () => {
|
|
14
|
-
var _a;
|
|
15
|
-
setIsExpanded(false);
|
|
16
|
-
if (onCollapse) {
|
|
17
|
-
onCollapse();
|
|
18
|
-
}
|
|
19
|
-
(_a = hostRef === null || hostRef === void 0 ? void 0 : hostRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
20
|
-
};
|
|
21
|
-
return {
|
|
22
|
-
isExpanded,
|
|
23
|
-
expandTooltip,
|
|
24
|
-
collapseTooltip
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
exports.useTooltip = useTooltip;
|
|
@@ -1,55 +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 ebay_button_1 = require("../ebay-button");
|
|
44
|
-
const classPrefix = 'alert-dialog';
|
|
45
|
-
const EbayAlertDialog = (_a) => {
|
|
46
|
-
var { a11yCloseText = 'Close Dialog', confirmText, onConfirm = () => { } } = _a, rest = __rest(_a, ["a11yCloseText", "confirmText", "onConfirm"]);
|
|
47
|
-
const confirmBtnRef = (0, react_1.useRef)(null);
|
|
48
|
-
const confirmId = 'alert-dialog-confirm';
|
|
49
|
-
const mainId = 'alert-dialog-main';
|
|
50
|
-
return (react_1.default.createElement(ebay_dialog_base_1.DialogBaseWithState, Object.assign({ focus: confirmBtnRef }, rest, { a11yCloseText: a11yCloseText, role: "alertdialog", classPrefix: classPrefix, ignoreEscape: true, mainId: mainId, buttonPosition: "hidden", className: (0, classnames_1.default)(rest.className, `${classPrefix}--mask-fade`), windowClass: `${classPrefix}__window ${classPrefix}__window--fade` }),
|
|
51
|
-
rest.children,
|
|
52
|
-
react_1.default.createElement(ebay_dialog_base_1.EbayDialogFooter, null,
|
|
53
|
-
react_1.default.createElement(ebay_button_1.EbayButton, { priority: "primary", "aria-describedby": mainId, onClick: onConfirm, ref: confirmBtnRef, id: confirmId, className: "alert-dialog__acknowledge" }, confirmText))));
|
|
54
|
-
};
|
|
55
|
-
exports.default = EbayAlertDialog;
|
|
@@ -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.EbayAlertDialog = void 0;
|
|
7
|
-
var alert_dialog_1 = require("./alert-dialog");
|
|
8
|
-
Object.defineProperty(exports, "EbayAlertDialog", { enumerable: true, get: function () { return __importDefault(alert_dialog_1).default; } });
|
package/ebay-badge/badge.js
DELETED
|
@@ -1,25 +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 EbayBadge = (_a) => {
|
|
20
|
-
var { number, type = 'img', className } = _a, rest = __rest(_a, ["number", "type", "className"]);
|
|
21
|
-
// Parse in case user provided a string by mistake
|
|
22
|
-
const parsed = Math.round(parseInt(String(number), 10));
|
|
23
|
-
return parsed <= 0 ? null : (react_1.default.createElement("span", Object.assign({}, rest, { className: (0, classnames_1.default)('badge', className), role: type === 'img' ? 'img' : undefined, "aria-hidden": type !== 'img' }), parsed > 99 ? '99+' : parsed));
|
|
24
|
-
};
|
|
25
|
-
exports.default = EbayBadge;
|
package/ebay-badge/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.EbayBadge = void 0;
|
|
7
|
-
var badge_1 = require("./badge");
|
|
8
|
-
Object.defineProperty(exports, "EbayBadge", { enumerable: true, get: function () { return __importDefault(badge_1).default; } });
|
|
@@ -1,27 +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 ebay_icon_1 = require("../ebay-icon");
|
|
19
|
-
const BreadcrumbItem = (_a) => {
|
|
20
|
-
var { tag: Item = 'button', isLastItem = false, href, children, onClick } = _a, rest = __rest(_a, ["tag", "isLastItem", "href", "children", "onClick"]);
|
|
21
|
-
const isLink = Item === 'a';
|
|
22
|
-
const itemAttr = Object.assign(Object.assign(Object.assign({}, rest), isLastItem ? { 'aria-current': 'location' } : {}), { href: isLink ? href : undefined, onClick: isLink ? undefined : onClick });
|
|
23
|
-
return (react_1.default.createElement("li", null,
|
|
24
|
-
react_1.default.createElement(Item, Object.assign({}, itemAttr), children),
|
|
25
|
-
!isLastItem && react_1.default.createElement(ebay_icon_1.EbayIcon, { name: "chevronRight12" })));
|
|
26
|
-
};
|
|
27
|
-
exports.default = BreadcrumbItem;
|