@ebay/ui-core-react 7.0.0 → 7.1.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/array.polyfill.flat-5BAolFdk.js +1 -0
- package/array.polyfill.flat-Bj5UhY_-.mjs +10 -0
- package/badge-BX5HuO-3.mjs +9 -0
- package/badge-CoHKfiPt.js +1 -0
- package/button-B06HeRsZ.mjs +63 -0
- package/button-o4ao46WM.js +1 -0
- package/calendar-CPKqwJVQ.js +1 -0
- package/calendar-Dq0eM9VC.mjs +216 -0
- package/debounce-BQsYxxOL.js +1 -0
- package/debounce-u81vJ6wg.mjs +9 -0
- package/dialog-previous-button-7ePoYWyj.js +1 -0
- package/dialog-previous-button-gmkm4c8J.mjs +146 -0
- package/drawer-BxxlJwkZ.js +1 -0
- package/drawer-Dcg135Bb.mjs +40 -0
- package/ebay-alert-dialog.js +1 -0
- package/ebay-alert-dialog.mjs +22 -0
- package/ebay-badge.js +1 -0
- package/ebay-badge.mjs +4 -0
- package/ebay-breadcrumbs.js +1 -0
- package/ebay-breadcrumbs.mjs +39 -0
- package/ebay-button.js +1 -0
- package/ebay-button.mjs +5 -0
- package/ebay-calendar.js +1 -0
- package/ebay-calendar.mjs +4 -0
- package/ebay-carousel.js +1 -0
- package/ebay-carousel.mjs +229 -0
- package/ebay-checkbox/README.md +12 -0
- package/ebay-checkbox.js +1 -0
- package/ebay-checkbox.mjs +43 -0
- package/ebay-confirm-dialog.js +1 -0
- package/ebay-confirm-dialog.mjs +24 -0
- package/ebay-cta-button.js +1 -0
- package/ebay-cta-button.mjs +20 -0
- package/ebay-date-textbox.js +1 -0
- package/ebay-date-textbox.mjs +74 -0
- package/ebay-dialog-base.js +1 -0
- package/ebay-dialog-base.mjs +9 -0
- package/ebay-drawer-dialog.js +1 -0
- package/ebay-drawer-dialog.mjs +4 -0
- package/ebay-eek.js +1 -0
- package/ebay-eek.mjs +42 -0
- package/ebay-fake-menu-button.js +1 -0
- package/ebay-fake-menu-button.mjs +7 -0
- package/ebay-fake-menu.js +1 -0
- package/ebay-fake-menu.mjs +9 -0
- package/ebay-fake-tabs.js +1 -0
- package/ebay-fake-tabs.mjs +27 -0
- package/ebay-field.js +1 -0
- package/ebay-field.mjs +19 -0
- package/ebay-fullscreen-dialog.js +1 -0
- package/ebay-fullscreen-dialog.mjs +9 -0
- package/ebay-icon/icon.d.ts.map +1 -1
- package/ebay-icon-button/README.md +2 -0
- package/ebay-icon-button.js +1 -0
- package/ebay-icon-button.mjs +4 -0
- package/ebay-icon.js +1 -0
- package/ebay-icon.mjs +4 -0
- package/ebay-infotip.js +1 -0
- package/ebay-infotip.mjs +59 -0
- package/ebay-inline-notice.js +1 -0
- package/ebay-inline-notice.mjs +31 -0
- package/ebay-lightbox-dialog.js +1 -0
- package/ebay-lightbox-dialog.mjs +11 -0
- package/ebay-listbox-button.js +2 -0
- package/ebay-listbox-button.mjs +170 -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-button.mjs +82 -0
- package/ebay-menu.js +1 -0
- package/ebay-menu.mjs +9 -0
- package/ebay-notice-base.js +1 -0
- package/ebay-notice-base.mjs +7 -0
- package/ebay-page-notice.js +1 -0
- package/ebay-page-notice.mjs +42 -0
- package/ebay-pagination.js +1 -0
- package/ebay-pagination.mjs +159 -0
- package/ebay-panel-dialog.js +1 -0
- package/ebay-panel-dialog.mjs +11 -0
- package/ebay-progress-bar.js +1 -0
- package/ebay-progress-bar.mjs +6 -0
- package/ebay-progress-spinner/progress-spinner.d.ts.map +1 -1
- package/ebay-progress-spinner.js +1 -0
- package/ebay-progress-spinner.mjs +4 -0
- package/ebay-progress-stepper.js +1 -0
- package/ebay-progress-stepper.mjs +63 -0
- package/ebay-radio.js +1 -0
- package/ebay-radio.mjs +42 -0
- package/ebay-section-notice.js +1 -0
- package/ebay-section-notice.mjs +46 -0
- package/ebay-section-title/index.d.ts.map +1 -1
- package/ebay-section-title.js +1 -0
- package/ebay-section-title.mjs +24 -0
- package/ebay-select.js +1 -0
- package/ebay-select.mjs +69 -0
- package/ebay-signal.js +1 -0
- package/ebay-signal.mjs +9 -0
- package/ebay-snackbar-dialog.js +1 -0
- package/ebay-snackbar-dialog.mjs +46 -0
- package/ebay-split-button.js +1 -0
- package/ebay-split-button.mjs +20 -0
- package/ebay-star-rating-select.js +1 -0
- package/ebay-star-rating-select.mjs +36 -0
- package/ebay-star-rating.js +1 -0
- package/ebay-star-rating.mjs +8 -0
- package/ebay-svg.js +1 -0
- package/ebay-svg.mjs +4753 -0
- package/ebay-switch.js +1 -0
- package/ebay-switch.mjs +25 -0
- package/ebay-tabs.js +1 -0
- package/ebay-tabs.mjs +66 -0
- package/ebay-textbox.js +1 -0
- package/ebay-textbox.mjs +8 -0
- package/ebay-toast-dialog.js +1 -0
- package/ebay-toast-dialog.mjs +9 -0
- package/ebay-tooltip.js +1 -0
- package/ebay-tooltip.mjs +39 -0
- package/ebay-tourtip.js +1 -0
- package/ebay-tourtip.mjs +43 -0
- package/ebay-video.js +1 -0
- package/ebay-video.mjs +173 -0
- package/hooks-Ctier7Yv.js +1 -0
- package/hooks-r29zhPsY.mjs +63 -0
- package/icon-B_a65KUD.mjs +42 -0
- package/icon-DK6eEQD8.js +1 -0
- package/icon-button-BB6GFLm7.js +1 -0
- package/icon-button-Dy8rjzH7.mjs +24 -0
- package/index-B5oC9Rl1.mjs +22 -0
- package/index-DbjwTbDP.js +1 -0
- package/label-CnrpYJ-g.js +1 -0
- package/label-DgOo6Mql.mjs +19 -0
- package/menu-CR1Dxl2m.mjs +154 -0
- package/menu-DZU8jEPV.js +1 -0
- package/menu-button-label-BcgasGA4.js +1 -0
- package/menu-button-label-vVnRKJRU.mjs +68 -0
- package/menu-item-DBi1NcrM.js +1 -0
- package/menu-item-jlKZ3uT4.mjs +67 -0
- package/notice-content-9iF4T8uB.js +1 -0
- package/notice-content-BVZMfcMH.mjs +4 -0
- package/notice-content-C0ZStfuX.js +1 -0
- package/notice-content-CdXVjKzD.mjs +9 -0
- package/notice-footer-BFa2IeY9.mjs +10 -0
- package/notice-footer-Cw1DMzoB.js +1 -0
- package/package.json +19 -8
- package/progress-spinner-BugUcF5c.mjs +19 -0
- package/progress-spinner-CDgxI8R_.js +1 -0
- package/range-DC7seOVT.mjs +4 -0
- package/range-DOsPN0h5.js +1 -0
- package/textbox-BxYjEAZK.mjs +100 -0
- package/textbox-WnB-9F4y.js +1 -0
- package/use-tooltip-BavqG36Z.js +1 -0
- package/use-tooltip-Bibsm2rU.mjs +158 -0
- package/utils-BipBqkOS.mjs +21 -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 -89
- 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 -30
- 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,61 +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 isControlled = checked => typeof checked !== 'undefined';
|
|
43
|
-
const EbaySwitch = (_a) => {
|
|
44
|
-
var { id, value, name, className, checked, defaultChecked = false, onChange = () => { } } = _a, rest = __rest(_a, ["id", "value", "name", "className", "checked", "defaultChecked", "onChange"]);
|
|
45
|
-
const [isChecked, setChecked] = (0, react_1.useState)(defaultChecked);
|
|
46
|
-
(0, react_1.useEffect)(() => {
|
|
47
|
-
setChecked(!!checked);
|
|
48
|
-
}, [checked]);
|
|
49
|
-
const handleChange = (e) => {
|
|
50
|
-
const { value: inputValue = '', checked: inputChecked = false } = e.target || {};
|
|
51
|
-
onChange(e, {
|
|
52
|
-
value: inputValue,
|
|
53
|
-
checked: inputChecked
|
|
54
|
-
});
|
|
55
|
-
setChecked(inputChecked);
|
|
56
|
-
};
|
|
57
|
-
return (react_1.default.createElement("span", { className: "switch" },
|
|
58
|
-
react_1.default.createElement("input", Object.assign({}, rest, { className: (0, classnames_1.default)('switch__control', className), id: id, role: "switch", type: "checkbox", value: value, "aria-checked": isControlled(checked) ? checked : isChecked, checked: isControlled(checked) ? checked : isChecked, name: name, onChange: handleChange })),
|
|
59
|
-
react_1.default.createElement("span", { className: "switch__button" })));
|
|
60
|
-
};
|
|
61
|
-
exports.default = EbaySwitch;
|
package/ebay-switch/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.EbaySwitch = void 0;
|
|
7
|
-
var ebay_switch_1 = require("./ebay-switch");
|
|
8
|
-
Object.defineProperty(exports, "EbaySwitch", { enumerable: true, get: function () { return __importDefault(ebay_switch_1).default; } });
|
package/ebay-tabs/index.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.EbayTabPanel = exports.EbayTab = exports.EbayTabs = void 0;
|
|
7
|
-
var tabs_1 = require("./tabs");
|
|
8
|
-
Object.defineProperty(exports, "EbayTabs", { enumerable: true, get: function () { return __importDefault(tabs_1).default; } });
|
|
9
|
-
var tab_1 = require("./tab");
|
|
10
|
-
Object.defineProperty(exports, "EbayTab", { enumerable: true, get: function () { return __importDefault(tab_1).default; } });
|
|
11
|
-
var tab_panel_1 = require("./tab-panel");
|
|
12
|
-
Object.defineProperty(exports, "EbayTabPanel", { enumerable: true, get: function () { return __importDefault(tab_panel_1).default; } });
|
package/ebay-tabs/tab-panel.js
DELETED
|
@@ -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 TabPanel = (_a) => {
|
|
20
|
-
var { children, index, parentId, selected, className } = _a, rest = __rest(_a, ["children", "index", "parentId", "selected", "className"]);
|
|
21
|
-
return (react_1.default.createElement("div", Object.assign({}, rest, { "aria-labelledby": `default-tab-${index}`, className: (0, classnames_1.default)(className, 'tabs__panel'), id: `${parentId || 'default'}-tabpanel-${index}`, role: "tabpanel", hidden: !selected }),
|
|
22
|
-
react_1.default.createElement("div", { className: "tabs__cell" }, children)));
|
|
23
|
-
};
|
|
24
|
-
exports.default = TabPanel;
|
package/ebay-tabs/tab.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
-
var t = {};
|
|
4
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
-
t[p] = s[p];
|
|
6
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
-
t[p[i]] = s[p[i]];
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
const react_1 = __importDefault(require("react"));
|
|
18
|
-
const classnames_1 = __importDefault(require("classnames"));
|
|
19
|
-
const Tab = (_a) => {
|
|
20
|
-
var { children, 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 }),
|
|
22
|
-
react_1.default.createElement("span", null, children)));
|
|
23
|
-
};
|
|
24
|
-
exports.default = Tab;
|
package/ebay-tabs/tabs.js
DELETED
|
@@ -1,90 +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
|
-
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) => {
|
|
40
|
-
onSelect({ selectedIndex: i });
|
|
41
|
-
onTabSelect(i);
|
|
42
|
-
setSelectedIndex(i);
|
|
43
|
-
};
|
|
44
|
-
/**
|
|
45
|
-
* Handle a11y for heading
|
|
46
|
-
* https://ebay.gitbooks.io/mindpatterns/content/disclosure/tabs.html
|
|
47
|
-
*/
|
|
48
|
-
const onKeyDown = (ev, i) => {
|
|
49
|
-
(0, event_utils_1.handleActionKeydown)(ev, () => {
|
|
50
|
-
ev.preventDefault();
|
|
51
|
-
if (activation === 'manual') {
|
|
52
|
-
handleSelect(i);
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
(0, event_utils_1.handleLeftRightArrowsKeydown)(ev, () => {
|
|
56
|
-
var _a;
|
|
57
|
-
ev.preventDefault();
|
|
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;
|
|
62
|
-
setFocusedIndex(nextIndex);
|
|
63
|
-
(_a = headings[nextIndex]) === null || _a === void 0 ? void 0 : _a.focus();
|
|
64
|
-
if (activation !== 'manual') {
|
|
65
|
-
handleSelect(nextIndex);
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
};
|
|
69
|
-
(0, react_1.useEffect)(() => {
|
|
70
|
-
handleSelect(index);
|
|
71
|
-
}, [index]);
|
|
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 = {
|
|
79
|
-
index: i,
|
|
80
|
-
parentId: id,
|
|
81
|
-
selected: selectedIndex === i,
|
|
82
|
-
children: item.props.children
|
|
83
|
-
};
|
|
84
|
-
return (0, react_1.cloneElement)(item, itemProps);
|
|
85
|
-
});
|
|
86
|
-
return (react_1.default.createElement("div", { id: id, className: (0, classnames_1.default)(className, 'tabs') },
|
|
87
|
-
react_1.default.createElement("div", { className: (0, classnames_1.default)('tabs__items', { 'tabs__items--large': isLarge }), role: "tablist" }, tabHeadings),
|
|
88
|
-
react_1.default.createElement("div", { className: "tabs__content" }, tabPanels)));
|
|
89
|
-
};
|
|
90
|
-
exports.default = Tabs;
|
package/ebay-tabs/types.js
DELETED
package/ebay-textbox/index.js
DELETED
|
@@ -1,16 +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.EbayTextboxPostfixText = exports.EbayTextboxPostfixIcon = exports.EbayTextboxPrefixText = exports.EbayTextboxPrefixIcon = exports.EbayTextbox = void 0;
|
|
7
|
-
var textbox_1 = require("./textbox");
|
|
8
|
-
Object.defineProperty(exports, "EbayTextbox", { enumerable: true, get: function () { return __importDefault(textbox_1).default; } });
|
|
9
|
-
var prefix_icon_1 = require("./prefix-icon");
|
|
10
|
-
Object.defineProperty(exports, "EbayTextboxPrefixIcon", { enumerable: true, get: function () { return __importDefault(prefix_icon_1).default; } });
|
|
11
|
-
var prefix_text_1 = require("./prefix-text");
|
|
12
|
-
Object.defineProperty(exports, "EbayTextboxPrefixText", { enumerable: true, get: function () { return __importDefault(prefix_text_1).default; } });
|
|
13
|
-
var postfix_icon_1 = require("./postfix-icon");
|
|
14
|
-
Object.defineProperty(exports, "EbayTextboxPostfixIcon", { enumerable: true, get: function () { return __importDefault(postfix_icon_1).default; } });
|
|
15
|
-
var postfix_text_1 = require("./postfix-text");
|
|
16
|
-
Object.defineProperty(exports, "EbayTextboxPostfixText", { enumerable: true, get: function () { return __importDefault(postfix_text_1).default; } });
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
-
var t = {};
|
|
4
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
-
t[p] = s[p];
|
|
6
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
-
t[p[i]] = s[p[i]];
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
const react_1 = __importDefault(require("react"));
|
|
18
|
-
const 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"]);
|
|
22
|
-
return buttonAriaLabel ?
|
|
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));
|
|
25
|
-
};
|
|
26
|
-
exports.default = EbayTextboxPostfixIcon;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const react_1 = __importDefault(require("react"));
|
|
7
|
-
const EbayTextboxPostfixText = (props) => (react_1.default.createElement("span", Object.assign({}, props)));
|
|
8
|
-
exports.default = EbayTextboxPostfixText;
|
|
@@ -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 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)));
|
|
22
|
-
};
|
|
23
|
-
exports.default = EbayTextboxPrefixIcon;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const react_1 = __importDefault(require("react"));
|
|
7
|
-
const EbayTextboxPrefixText = (props) => (react_1.default.createElement("span", Object.assign({}, props)));
|
|
8
|
-
exports.default = EbayTextboxPrefixText;
|
package/ebay-textbox/textbox.js
DELETED
|
@@ -1,147 +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
|
-
exports.isControlled = void 0;
|
|
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 postfix_icon_1 = __importDefault(require("./postfix-icon"));
|
|
45
|
-
const postfix_text_1 = __importDefault(require("./postfix-text"));
|
|
46
|
-
const prefix_icon_1 = __importDefault(require("./prefix-icon"));
|
|
47
|
-
const prefix_text_1 = __importDefault(require("./prefix-text"));
|
|
48
|
-
const hooks_1 = require("../common/floating-label-utils/hooks");
|
|
49
|
-
const isControlled = (value) => typeof value !== 'undefined';
|
|
50
|
-
exports.isControlled = isControlled;
|
|
51
|
-
const EbayTextbox = (_a) => {
|
|
52
|
-
var _b, _c;
|
|
53
|
-
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"]);
|
|
54
|
-
const [value, setValue] = (0, react_1.useState)(defaultValue);
|
|
55
|
-
const [inputValue, setInputValue] = (0, react_1.useState)(defaultValue);
|
|
56
|
-
const { label, Container, onBlur: onFloatingLabelBlur, onFocus: onFloatingLabelFocus, ref, placeholder: floatingLabelPlaceholder } = (0, hooks_1.useFloatingLabel)({
|
|
57
|
-
ref: forwardedRef,
|
|
58
|
-
inputId: rest.id,
|
|
59
|
-
className: rest.className,
|
|
60
|
-
disabled: rest.disabled,
|
|
61
|
-
label: floatingLabel,
|
|
62
|
-
inputSize,
|
|
63
|
-
inputValue: controlledValue || inputValue,
|
|
64
|
-
placeholder,
|
|
65
|
-
invalid,
|
|
66
|
-
type,
|
|
67
|
-
opaqueLabel,
|
|
68
|
-
onMount: onFloatingLabelInit
|
|
69
|
-
});
|
|
70
|
-
const handleFocus = (event) => {
|
|
71
|
-
var _a;
|
|
72
|
-
onFocus(event, { value: ((_a = event === null || event === void 0 ? void 0 : event.target) === null || _a === void 0 ? void 0 : _a.value) || defaultValue });
|
|
73
|
-
onFloatingLabelFocus();
|
|
74
|
-
};
|
|
75
|
-
const handleBlur = (event) => {
|
|
76
|
-
var _a;
|
|
77
|
-
const newValue = (_a = event.target) === null || _a === void 0 ? void 0 : _a.value;
|
|
78
|
-
onBlur(event, { value: newValue });
|
|
79
|
-
if (newValue !== value) {
|
|
80
|
-
onChange(event, { value: newValue });
|
|
81
|
-
setValue(newValue);
|
|
82
|
-
}
|
|
83
|
-
onFloatingLabelBlur();
|
|
84
|
-
};
|
|
85
|
-
const handleKeyPress = (event) => {
|
|
86
|
-
const textbox = event.target;
|
|
87
|
-
onKeyPress(event, { value: textbox === null || textbox === void 0 ? void 0 : textbox.value });
|
|
88
|
-
};
|
|
89
|
-
const handleKeyUp = (event) => {
|
|
90
|
-
const textbox = event.target;
|
|
91
|
-
onKeyUp(event, { value: textbox === null || textbox === void 0 ? void 0 : textbox.value });
|
|
92
|
-
};
|
|
93
|
-
const handleKeyDown = (event) => {
|
|
94
|
-
const textbox = event.target;
|
|
95
|
-
onKeyDown(event, { value: textbox === null || textbox === void 0 ? void 0 : textbox.value });
|
|
96
|
-
};
|
|
97
|
-
const handleInvalid = (event) => {
|
|
98
|
-
const textbox = event.target;
|
|
99
|
-
onInvalid(event, { value: textbox === null || textbox === void 0 ? void 0 : textbox.value });
|
|
100
|
-
};
|
|
101
|
-
const handleButtonClick = (event) => {
|
|
102
|
-
onButtonClick(event, { value });
|
|
103
|
-
};
|
|
104
|
-
(0, react_1.useEffect)(() => {
|
|
105
|
-
if (autoFocus) {
|
|
106
|
-
handleFocus();
|
|
107
|
-
}
|
|
108
|
-
}, []);
|
|
109
|
-
const handleInputChange = (e) => {
|
|
110
|
-
var _a;
|
|
111
|
-
const newValue = (_a = e.target) === null || _a === void 0 ? void 0 : _a.value;
|
|
112
|
-
if (!(0, exports.isControlled)(controlledValue)) {
|
|
113
|
-
setInputValue(newValue);
|
|
114
|
-
}
|
|
115
|
-
onInputChange(e, { value: newValue });
|
|
116
|
-
};
|
|
117
|
-
const Input = multiline ? 'textarea' : 'input';
|
|
118
|
-
const Wrapper = fluid ? 'div' : 'span';
|
|
119
|
-
const prefixIcon = (0, component_utils_1.findComponent)(children, prefix_icon_1.default);
|
|
120
|
-
const prefixText = (0, component_utils_1.findComponent)(children, prefix_text_1.default);
|
|
121
|
-
const prefixId = (_b = prefixText === null || prefixText === void 0 ? void 0 : prefixText.props) === null || _b === void 0 ? void 0 : _b.id;
|
|
122
|
-
const postfixIcon = (0, component_utils_1.findComponent)(children, postfix_icon_1.default);
|
|
123
|
-
const postfixText = (0, component_utils_1.findComponent)(children, postfix_text_1.default);
|
|
124
|
-
const postfixId = (_c = postfixText === null || postfixText === void 0 ? void 0 : postfixText.props) === null || _c === void 0 ? void 0 : _c.id;
|
|
125
|
-
const wrapperClassName = (0, classnames_1.default)('textbox', rest.className, {
|
|
126
|
-
'textbox--fluid': fluid,
|
|
127
|
-
'textbox--large': inputSize === 'large',
|
|
128
|
-
/** start remove after `:has` support */
|
|
129
|
-
'textbox--disabled': rest.disabled,
|
|
130
|
-
'textbox--invalid': invalid,
|
|
131
|
-
'textbox--readonly': rest.readOnly
|
|
132
|
-
/** end remove after `:has` support */
|
|
133
|
-
});
|
|
134
|
-
return (react_1.default.createElement(Container, null,
|
|
135
|
-
label,
|
|
136
|
-
react_1.default.createElement(Wrapper, { className: wrapperClassName },
|
|
137
|
-
prefixIcon,
|
|
138
|
-
prefixText,
|
|
139
|
-
react_1.default.createElement(Input, Object.assign({ "aria-describedby": [prefixId, postfixId].filter(Boolean).join(' ') || undefined }, rest, { className: "textbox__control", 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
|
-
postfixText,
|
|
141
|
-
postfixIcon && (0, react_1.cloneElement)(postfixIcon, Object.assign(Object.assign({}, postfixIcon.props), { onClick: (e) => {
|
|
142
|
-
const { onClick: iconClick = () => { } } = postfixIcon.props;
|
|
143
|
-
iconClick(e);
|
|
144
|
-
handleButtonClick(e);
|
|
145
|
-
} })))));
|
|
146
|
-
};
|
|
147
|
-
exports.default = (0, component_utils_1.withForwardRef)(EbayTextbox);
|
package/ebay-textbox/types.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
-
var t = {};
|
|
4
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
-
t[p] = s[p];
|
|
6
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
-
t[p[i]] = s[p[i]];
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.EbayToast = void 0;
|
|
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 })));
|
|
24
|
-
};
|
|
25
|
-
exports.EbayToast = EbayToast;
|
|
26
|
-
exports.default = exports.EbayToast;
|
|
@@ -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.EbayToast = void 0;
|
|
7
|
-
var toast_1 = require("./components/toast");
|
|
8
|
-
Object.defineProperty(exports, "EbayToast", { enumerable: true, get: function () { return __importDefault(toast_1).default; } });
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
/**
|
|
4
|
-
* This Component is used only for finding it as a child of EbayTooltip
|
|
5
|
-
* and pass the properties to TooltipContent
|
|
6
|
-
*/
|
|
7
|
-
const EbayTooltipContent = () => null;
|
|
8
|
-
exports.default = EbayTooltipContent;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
/**
|
|
4
|
-
* This Component is used only for finding it as a child of EbayTooltip
|
|
5
|
-
* and pass the properties to TooltipHost
|
|
6
|
-
*/
|
|
7
|
-
const EbayTooltipHost = () => null;
|
|
8
|
-
exports.default = EbayTooltipHost;
|
|
@@ -1,85 +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 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) => {
|
|
50
|
-
onMouseEnter(event);
|
|
51
|
-
if (!noHover) {
|
|
52
|
-
clearTimeout(timeoutRef.current);
|
|
53
|
-
expandTooltip();
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
const handleOnMouseLeave = (event) => {
|
|
57
|
-
onMouseLeave(event);
|
|
58
|
-
if (!noHover) {
|
|
59
|
-
clearTimeout(timeoutRef.current);
|
|
60
|
-
timeoutRef.current = setTimeout(() => {
|
|
61
|
-
collapseTooltip();
|
|
62
|
-
}, 300);
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
const handleOnFocus = (event) => {
|
|
66
|
-
onFocus(event);
|
|
67
|
-
expandTooltip();
|
|
68
|
-
};
|
|
69
|
-
const handleOnBlur = (event) => {
|
|
70
|
-
onBlur(event);
|
|
71
|
-
collapseTooltip();
|
|
72
|
-
};
|
|
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);
|
|
75
|
-
if (!host) {
|
|
76
|
-
throw new Error(`EbayTooltip: Please use a EbayTooltipHost that defines the host of the tooltip`);
|
|
77
|
-
}
|
|
78
|
-
if (!content) {
|
|
79
|
-
throw new Error(`EbayTooltip: Please use a EbayTooltipContent that defines the content of the tooltip`);
|
|
80
|
-
}
|
|
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 }))));
|
|
84
|
-
};
|
|
85
|
-
exports.default = EbayTooltip;
|
package/ebay-tooltip/index.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.Tooltip = exports.EbayTooltipHost = exports.EbayTooltipContent = exports.EbayTooltip = void 0;
|
|
7
|
-
var ebay_tooltip_1 = require("./ebay-tooltip");
|
|
8
|
-
Object.defineProperty(exports, "EbayTooltip", { enumerable: true, get: function () { return __importDefault(ebay_tooltip_1).default; } });
|
|
9
|
-
var ebay_tooltip_content_1 = require("./ebay-tooltip-content");
|
|
10
|
-
Object.defineProperty(exports, "EbayTooltipContent", { enumerable: true, get: function () { return __importDefault(ebay_tooltip_content_1).default; } });
|
|
11
|
-
var ebay_tooltip_host_1 = require("./ebay-tooltip-host");
|
|
12
|
-
Object.defineProperty(exports, "EbayTooltipHost", { enumerable: true, get: function () { return __importDefault(ebay_tooltip_host_1).default; } });
|
|
13
|
-
var tooltip_utils_1 = require("../common/tooltip-utils");
|
|
14
|
-
Object.defineProperty(exports, "Tooltip", { enumerable: true, get: function () { return tooltip_utils_1.Tooltip; } });
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
/**
|
|
4
|
-
* This Component is used only for finding it as a child of EbayTooltip
|
|
5
|
-
* and pass the properties to TourtipContent
|
|
6
|
-
*/
|
|
7
|
-
const EbayTourtipContent = () => null;
|
|
8
|
-
exports.default = EbayTourtipContent;
|