@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
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import v, { useState as A, useEffect as C, Children as L, useRef as H, cloneElement as S } from "react";
|
|
2
|
+
import V from "classnames";
|
|
3
|
+
import { i as T } from "./index-B5oC9Rl1.mjs";
|
|
4
|
+
import { E as $, w as j } from "./icon-B_a65KUD.mjs";
|
|
5
|
+
import "./array.polyfill.flat-Bj5UhY_-.mjs";
|
|
6
|
+
import { E as q } from "./badge-BX5HuO-3.mjs";
|
|
7
|
+
const z = () => {
|
|
8
|
+
const [u, s] = A(!1), [p, o] = A(!1), d = ({ key: a }) => {
|
|
9
|
+
const c = {
|
|
10
|
+
ArrowUp: s,
|
|
11
|
+
ArrowDown: o
|
|
12
|
+
}[a];
|
|
13
|
+
c && c(!1);
|
|
14
|
+
}, l = ({ key: a }) => {
|
|
15
|
+
const c = {
|
|
16
|
+
ArrowUp: s,
|
|
17
|
+
ArrowDown: o
|
|
18
|
+
}[a];
|
|
19
|
+
c && c(!0);
|
|
20
|
+
};
|
|
21
|
+
return C(() => (window.addEventListener("keydown", l), window.addEventListener("keyup", d), () => {
|
|
22
|
+
window.removeEventListener("keydown", l), window.removeEventListener("keyup", d);
|
|
23
|
+
}), []), [u, p];
|
|
24
|
+
}, G = (u, s, p) => {
|
|
25
|
+
const [o, d] = A(p), [l, a] = z(), c = L.toArray(u).reduce((t, I, h) => I.type === s ? [...t, h] : t, []), m = c.indexOf(o), E = () => {
|
|
26
|
+
if (m === -1)
|
|
27
|
+
return o;
|
|
28
|
+
const t = c[m - 1];
|
|
29
|
+
return t === void 0 ? o : t;
|
|
30
|
+
}, f = () => {
|
|
31
|
+
if (m === -1)
|
|
32
|
+
return o;
|
|
33
|
+
const t = c[m + 1];
|
|
34
|
+
return t === void 0 ? o : t;
|
|
35
|
+
};
|
|
36
|
+
return C(() => {
|
|
37
|
+
l && d(E()), a && d(f());
|
|
38
|
+
}, [l, a]), [o, d];
|
|
39
|
+
}, J = ({ className: u, checked: s, type: p, focused: o = !1, tabIndex: d, disabled: l, badgeNumber: a, badgeAriaLabel: c, children: m, ...E }) => {
|
|
40
|
+
const f = H(null), t = a !== void 0;
|
|
41
|
+
C(() => {
|
|
42
|
+
f.current && o && f.current.focus();
|
|
43
|
+
}, [f, o]);
|
|
44
|
+
const I = ["radio", "checkbox"];
|
|
45
|
+
return v.createElement(
|
|
46
|
+
"div",
|
|
47
|
+
{ "aria-label": c, ...E, ref: f, className: V(u, "menu__item", t && "menu__item--badged"), role: Q(p), "aria-checked": I.includes(p) ? s : void 0, "aria-disabled": l, tabIndex: o ? 0 : d },
|
|
48
|
+
v.createElement(
|
|
49
|
+
"span",
|
|
50
|
+
{ "aria-hidden": t },
|
|
51
|
+
m,
|
|
52
|
+
t && v.createElement(q, { type: "menu", number: a })
|
|
53
|
+
),
|
|
54
|
+
v.createElement($, { name: "tick16" })
|
|
55
|
+
);
|
|
56
|
+
};
|
|
57
|
+
function Q(u) {
|
|
58
|
+
return {
|
|
59
|
+
radio: "menuitemradio",
|
|
60
|
+
checkbox: "menuitemcheckbox"
|
|
61
|
+
}[u] || "menuitem";
|
|
62
|
+
}
|
|
63
|
+
const W = ({ baseEl: u = "span", type: s, priority: p = "secondary", checked: o, className: d, autofocus: l, onClick: a = () => {
|
|
64
|
+
}, onKeyDown: c = () => {
|
|
65
|
+
}, onChange: m = () => {
|
|
66
|
+
}, onSelect: E = () => {
|
|
67
|
+
}, forwardedRef: f, children: t, ...I }) => {
|
|
68
|
+
const h = L.toArray(t), [P, D] = G(t, J, l === !0 ? 0 : void 0), [k, F] = A(h.map(() => !1)), B = (n) => h.reduce((e, r, w) => n[w] ? [...e, r.props.value] : e, []), R = (n) => n.reduce((e, r, w) => r ? [...e, w] : e, []), g = (n, e) => ({
|
|
69
|
+
index: n,
|
|
70
|
+
checked: R(e)
|
|
71
|
+
}), _ = (n, e) => ({
|
|
72
|
+
...g(n, e),
|
|
73
|
+
indexes: R(e),
|
|
74
|
+
checkedValues: B(e)
|
|
75
|
+
}), K = (n, e, r = !1) => {
|
|
76
|
+
let w = !1;
|
|
77
|
+
const y = k.map((b, i) => {
|
|
78
|
+
const O = r ? !1 : b;
|
|
79
|
+
return n === i ? (b !== e && (w = !0), e) : O;
|
|
80
|
+
});
|
|
81
|
+
if (w)
|
|
82
|
+
return F(y), y;
|
|
83
|
+
}, x = (n) => {
|
|
84
|
+
switch (s) {
|
|
85
|
+
case "radio":
|
|
86
|
+
return K(n, !0, !0);
|
|
87
|
+
case "checkbox":
|
|
88
|
+
return K(n, !k[n], !1);
|
|
89
|
+
default:
|
|
90
|
+
return k.map((e, r) => r === n);
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
C(() => {
|
|
94
|
+
if (s === "radio")
|
|
95
|
+
if (o === void 0) {
|
|
96
|
+
const n = h.findIndex((e) => e.props.checked);
|
|
97
|
+
n > -1 && x(n);
|
|
98
|
+
} else
|
|
99
|
+
x(o);
|
|
100
|
+
else s === "checkbox" && F(h.map((n) => !!n.props.checked));
|
|
101
|
+
}, []);
|
|
102
|
+
const U = (n, e, r) => {
|
|
103
|
+
switch (s) {
|
|
104
|
+
case "radio":
|
|
105
|
+
case "checkbox":
|
|
106
|
+
return m(n, _(e, r));
|
|
107
|
+
default:
|
|
108
|
+
return E(n, g(e, r));
|
|
109
|
+
}
|
|
110
|
+
}, M = (n, e) => {
|
|
111
|
+
let r;
|
|
112
|
+
switch (T(n.key) && (r = x(e), r && U(n, e, r)), s) {
|
|
113
|
+
case "radio":
|
|
114
|
+
case "checkbox":
|
|
115
|
+
return c(n, _(e, r || k));
|
|
116
|
+
default:
|
|
117
|
+
return c(n, g(e, r || k));
|
|
118
|
+
}
|
|
119
|
+
}, N = (n, e) => {
|
|
120
|
+
D(e);
|
|
121
|
+
const r = x(e);
|
|
122
|
+
r && U(n, e, r);
|
|
123
|
+
};
|
|
124
|
+
return v.createElement(
|
|
125
|
+
u,
|
|
126
|
+
{ ...I, className: V(d, "menu") },
|
|
127
|
+
v.createElement("div", { className: "menu__items", role: "menu", ref: f }, h.map((n, e) => {
|
|
128
|
+
const { onClick: r = () => {
|
|
129
|
+
}, onFocus: w = () => {
|
|
130
|
+
}, onKeyDown: y = () => {
|
|
131
|
+
}, ...b } = n.props;
|
|
132
|
+
return S(n, {
|
|
133
|
+
...b,
|
|
134
|
+
type: s,
|
|
135
|
+
focused: e === P,
|
|
136
|
+
tabIndex: P === void 0 ? 0 : -1,
|
|
137
|
+
checked: k[e],
|
|
138
|
+
onFocus: (i) => {
|
|
139
|
+
D(e), w(i);
|
|
140
|
+
},
|
|
141
|
+
onClick: (i) => {
|
|
142
|
+
N(i, e), r(i), a(i);
|
|
143
|
+
},
|
|
144
|
+
onKeyDown: (i) => {
|
|
145
|
+
M(i, e), y(i);
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
}))
|
|
149
|
+
);
|
|
150
|
+
}, oe = j(W);
|
|
151
|
+
export {
|
|
152
|
+
oe as E,
|
|
153
|
+
J as a
|
|
154
|
+
};
|
package/menu-DZU8jEPV.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("react"),q=require("classnames"),B=require("./index-DbjwTbDP.js"),K=require("./icon-DK6eEQD8.js");require("./array.polyfill.flat-5BAolFdk.js");const N=require("./badge-CoHKfiPt.js"),O=()=>{const[l,c]=t.useState(!1),[k,o]=t.useState(!1),d=({key:u})=>{const a={ArrowUp:c,ArrowDown:o}[u];a&&a(!1)},f=({key:u})=>{const a={ArrowUp:c,ArrowDown:o}[u];a&&a(!0)};return t.useEffect(()=>(window.addEventListener("keydown",f),window.addEventListener("keyup",d),()=>{window.removeEventListener("keydown",f),window.removeEventListener("keyup",d)}),[]),[l,k]},H=(l,c,k)=>{const[o,d]=t.useState(k),[f,u]=O(),a=t.Children.toArray(l).reduce((s,I,p)=>I.type===c?[...s,p]:s,[]),m=a.indexOf(o),E=()=>{if(m===-1)return o;const s=a[m-1];return s===void 0?o:s},w=()=>{if(m===-1)return o;const s=a[m+1];return s===void 0?o:s};return t.useEffect(()=>{f&&d(E()),u&&d(w())},[f,u]),[o,d]},M=({className:l,checked:c,type:k,focused:o=!1,tabIndex:d,disabled:f,badgeNumber:u,badgeAriaLabel:a,children:m,...E})=>{const w=t.useRef(null),s=u!==void 0;t.useEffect(()=>{w.current&&o&&w.current.focus()},[w,o]);const I=["radio","checkbox"];return t.createElement("div",{"aria-label":a,...E,ref:w,className:q(l,"menu__item",s&&"menu__item--badged"),role:T(k),"aria-checked":I.includes(k)?c:void 0,"aria-disabled":f,tabIndex:o?0:d},t.createElement("span",{"aria-hidden":s},m,s&&t.createElement(N.EbayBadge,{type:"menu",number:u})),t.createElement(K.EbayIcon,{name:"tick16"}))};function T(l){return{radio:"menuitemradio",checkbox:"menuitemcheckbox"}[l]||"menuitem"}const j=({baseEl:l="span",type:c,priority:k="secondary",checked:o,className:d,autofocus:f,onClick:u=()=>{},onKeyDown:a=()=>{},onChange:m=()=>{},onSelect:E=()=>{},forwardedRef:w,children:s,...I})=>{const p=t.Children.toArray(s),[g,A]=H(s,M,f===!0?0:void 0),[v,P]=t.useState(p.map(()=>!1)),U=n=>p.reduce((e,r,h)=>n[h]?[...e,r.props.value]:e,[]),D=n=>n.reduce((e,r,h)=>r?[...e,h]:e,[]),C=(n,e)=>({index:n,checked:D(e)}),F=(n,e)=>({...C(n,e),indexes:D(e),checkedValues:U(e)}),R=(n,e,r=!1)=>{let h=!1;const y=v.map((x,i)=>{const V=r?!1:x;return n===i?(x!==e&&(h=!0),e):V});if(h)return P(y),y},b=n=>{switch(c){case"radio":return R(n,!0,!0);case"checkbox":return R(n,!v[n],!1);default:return v.map((e,r)=>r===n)}};t.useEffect(()=>{if(c==="radio")if(o===void 0){const n=p.findIndex(e=>e.props.checked);n>-1&&b(n)}else b(o);else c==="checkbox"&&P(p.map(n=>!!n.props.checked))},[]);const _=(n,e,r)=>{switch(c){case"radio":case"checkbox":return m(n,F(e,r));default:return E(n,C(e,r))}},L=(n,e)=>{let r;switch(B.isActionKey(n.key)&&(r=b(e),r&&_(n,e,r)),c){case"radio":case"checkbox":return a(n,F(e,r||v));default:return a(n,C(e,r||v))}},S=(n,e)=>{A(e);const r=b(e);r&&_(n,e,r)};return t.createElement(l,{...I,className:q(d,"menu")},t.createElement("div",{className:"menu__items",role:"menu",ref:w},p.map((n,e)=>{const{onClick:r=()=>{},onFocus:h=()=>{},onKeyDown:y=()=>{},...x}=n.props;return t.cloneElement(n,{...x,type:c,focused:e===g,tabIndex:g===void 0?0:-1,checked:v[e],onFocus:i=>{A(e),h(i)},onClick:i=>{S(i,e),r(i),u(i)},onKeyDown:i=>{L(i,e),y(i)}})})))},z=K.withForwardRef(j);exports.EbayMenu=z;exports.EbayMenuItem=M;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("react"),s=require("classnames"),m=require("./utils-C9NL3q0j.js"),D=require("./index-DbjwTbDP.js"),p=require("./icon-DK6eEQD8.js"),R=require("./button-o4ao46WM.js"),z=require("./icon-button-BB6GFLm7.js"),y=require("./menu-item-DBi1NcrM.js"),H=({a11yText:o,noToggleIcon:r,fixWidth:_,reverse:I,variant:i,expanded:q=!1,className:v,onCollapse:x=()=>{},onExpand:w=()=>{},onMouseDown:F=()=>{},onSelect:N=()=>{},text:d="",children:c,...C})=>{const[a,l]=e.useState(q),[b,S]=e.useState(),u=e.useRef(),f=m.findComponent(c,p.EbayIcon),h=m.findComponent(c,M)||(f?e.createElement("span",null,d):d),L=m.filterByType(c,[k,B]);e.useEffect(()=>{const n=t=>{u.current&&!u.current.contains(t.currentTarget)&&l(!1)};return a?(w(),setTimeout(()=>{document.addEventListener("click",n,!1)})):a===!1&&x(),()=>document.removeEventListener("click",n,!1)},[a]),e.useEffect(()=>{S(p.randomId())},[]);const g=n=>{D.handleEscapeKeydown(n,()=>{var t;l(!1),(t=u.current)==null||t.focus()})},K=s("fake-menu-button__menu",{"menu-button__menu--fix-width":_,"menu-button__menu--reverse":I}),E={ref:u,className:"fake-menu-button__button","aria-expanded":!!a,"aria-haspopup":!0,"aria-label":o,"aria-controls":b,onClick:()=>l(!a),...C};return e.createElement("span",{className:s("fake-menu-button",v)},i==="overflow"?e.createElement(z.EbayIconButton,{icon:"overflowHorizontal24",...E}):e.createElement(R.EbayButton,{variant:i==="form"?"form":void 0,bodyState:r?void 0:"expand",...E},f,h),a&&e.createElement(y.EbayFakeMenu,{className:K,id:b,tabIndex:-1,onKeyDown:g,onSelect:N},L.map((n,t)=>e.cloneElement(n,{...n.props,onMouseDown:T=>{F(T,{index:t})},className:s(n.props.className,"fake-menu-button__item"),key:t,autoFocus:t===0}))))},k=y.EbayMenuItem,B=({className:o,...r})=>e.createElement("hr",{...r,className:s(o,"menu-button__separator"),role:"separator"}),M=({children:o})=>e.createElement(e.Fragment,null,o);exports.EbayFakeMenuButtonItem=k;exports.EbayFakeMenuButtonLabel=M;exports.EbayMenuButton=H;exports.EbayMenuButtonSeparator=B;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import t, { useState as E, useRef as S, useEffect as b, cloneElement as T } from "react";
|
|
2
|
+
import r from "classnames";
|
|
3
|
+
import { f as y, b as D } from "./utils-BipBqkOS.mjs";
|
|
4
|
+
import { b as R } from "./index-B5oC9Rl1.mjs";
|
|
5
|
+
import { r as z, E as H } from "./icon-B_a65KUD.mjs";
|
|
6
|
+
import { E as P } from "./button-B06HeRsZ.mjs";
|
|
7
|
+
import { E as j } from "./icon-button-Dy8rjzH7.mjs";
|
|
8
|
+
import { E as q, a as A } from "./menu-item-jlKZ3uT4.mjs";
|
|
9
|
+
const ee = ({ a11yText: o, noToggleIcon: u, fixWidth: k, reverse: _, variant: l, expanded: I = !1, className: M, onCollapse: v = () => {
|
|
10
|
+
}, onExpand: x = () => {
|
|
11
|
+
}, onMouseDown: B = () => {
|
|
12
|
+
}, onSelect: w = () => {
|
|
13
|
+
}, text: f = "", children: m, ...N }) => {
|
|
14
|
+
const [a, c] = E(I), [p, F] = E(), s = S(), d = y(m, H), h = y(m, O) || (d ? t.createElement("span", null, f) : f), C = D(m, [G, J]);
|
|
15
|
+
b(() => {
|
|
16
|
+
const e = (n) => {
|
|
17
|
+
s.current && !s.current.contains(n.currentTarget) && c(!1);
|
|
18
|
+
};
|
|
19
|
+
return a ? (x(), setTimeout(() => {
|
|
20
|
+
document.addEventListener("click", e, !1);
|
|
21
|
+
})) : a === !1 && v(), () => document.removeEventListener("click", e, !1);
|
|
22
|
+
}, [a]), b(() => {
|
|
23
|
+
F(z());
|
|
24
|
+
}, []);
|
|
25
|
+
const g = (e) => {
|
|
26
|
+
R(e, () => {
|
|
27
|
+
var n;
|
|
28
|
+
c(!1), (n = s.current) == null || n.focus();
|
|
29
|
+
});
|
|
30
|
+
}, K = r("fake-menu-button__menu", {
|
|
31
|
+
"menu-button__menu--fix-width": k,
|
|
32
|
+
"menu-button__menu--reverse": _
|
|
33
|
+
}), i = {
|
|
34
|
+
ref: s,
|
|
35
|
+
className: "fake-menu-button__button",
|
|
36
|
+
"aria-expanded": !!a,
|
|
37
|
+
"aria-haspopup": !0,
|
|
38
|
+
"aria-label": o,
|
|
39
|
+
"aria-controls": p,
|
|
40
|
+
onClick: () => c(!a),
|
|
41
|
+
...N
|
|
42
|
+
};
|
|
43
|
+
return t.createElement(
|
|
44
|
+
"span",
|
|
45
|
+
{ className: r("fake-menu-button", M) },
|
|
46
|
+
l === "overflow" ? t.createElement(j, { icon: "overflowHorizontal24", ...i }) : t.createElement(
|
|
47
|
+
P,
|
|
48
|
+
{ variant: l === "form" ? "form" : void 0, bodyState: u ? void 0 : "expand", ...i },
|
|
49
|
+
d,
|
|
50
|
+
h
|
|
51
|
+
),
|
|
52
|
+
a && t.createElement(q, { className: K, id: p, tabIndex: -1, onKeyDown: g, onSelect: w }, C.map((e, n) => T(e, {
|
|
53
|
+
...e.props,
|
|
54
|
+
onMouseDown: (L) => {
|
|
55
|
+
B(L, { index: n });
|
|
56
|
+
},
|
|
57
|
+
className: r(e.props.className, "fake-menu-button__item"),
|
|
58
|
+
key: n,
|
|
59
|
+
autoFocus: n === 0
|
|
60
|
+
})))
|
|
61
|
+
);
|
|
62
|
+
}, G = A, J = ({ className: o, ...u }) => t.createElement("hr", { ...u, className: r(o, "menu-button__separator"), role: "separator" }), O = ({ children: o }) => t.createElement(t.Fragment, null, o);
|
|
63
|
+
export {
|
|
64
|
+
ee as E,
|
|
65
|
+
G as a,
|
|
66
|
+
J as b,
|
|
67
|
+
O as c
|
|
68
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("react"),g=require("classnames"),p=require("./icon-DK6eEQD8.js"),k=require("./badge-CoHKfiPt.js"),v=({className:m,itemMatchesUrl:d=!0,onKeyDown:a=()=>{},onSelect:l=()=>{},children:E,...r})=>{const b=e.Children.toArray(E),c=d===!1?"true":"page";return e.createElement("div",{...r,className:g(m,"fake-menu")},e.createElement("ul",{className:"fake-menu__items",tabIndex:-1},b.map((s,t)=>{const{current:u,onClick:o=()=>{},...i}=s.props;return e.createElement("li",{key:t},e.cloneElement(s,{...i,"aria-current":u?c:void 0,onClick:n=>{l(n,{index:t}),o(n)},onKeyDown:n=>{a(n,{index:t})}}))})))},_=({className:m,current:d,disabled:a,autoFocus:l,type:E,badgeNumber:r,badgeAriaLabel:b,children:c,...s})=>{const t=e.useRef(),u=r!==void 0;e.useEffect(()=>{var f;l&&((f=t.current)==null||f.focus())});const o={...s,ref:t,className:g(m,"fake-menu__item",u&&"menu__item--badged"),"aria-label":b},i=e.createElement(p.EbayIcon,{name:"tick16"}),n={marginLeft:"var(--spacing-100)",marginRight:"var(--spacing-100)"},y=u&&e.createElement(k.EbayBadge,{type:"menu",number:r,style:n});return E==="button"?e.createElement("button",{...o,type:"button",disabled:a},e.createElement("span",null,c,y),i):e.createElement("a",{...o,"aria-disabled":a?"true":void 0},e.createElement("span",null,c,y),i)};exports.EbayFakeMenu=v;exports.EbayMenuItem=_;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import e, { Children as g, cloneElement as k, useRef as v, useEffect as _ } from "react";
|
|
2
|
+
import b from "classnames";
|
|
3
|
+
import { E as x } from "./icon-B_a65KUD.mjs";
|
|
4
|
+
import { E as C } from "./badge-BX5HuO-3.mjs";
|
|
5
|
+
const h = ({ className: l, itemMatchesUrl: p = !0, onKeyDown: n = () => {
|
|
6
|
+
}, onSelect: u = () => {
|
|
7
|
+
}, children: E, ...r }) => {
|
|
8
|
+
const f = g.toArray(E), c = p === !1 ? "true" : "page";
|
|
9
|
+
return e.createElement(
|
|
10
|
+
"div",
|
|
11
|
+
{ ...r, className: b(l, "fake-menu") },
|
|
12
|
+
e.createElement("ul", { className: "fake-menu__items", tabIndex: -1 }, f.map((s, t) => {
|
|
13
|
+
const { current: m, onClick: o = () => {
|
|
14
|
+
}, ...i } = s.props;
|
|
15
|
+
return e.createElement("li", { key: t }, k(s, {
|
|
16
|
+
...i,
|
|
17
|
+
"aria-current": m ? c : void 0,
|
|
18
|
+
onClick: (a) => {
|
|
19
|
+
u(a, { index: t }), o(a);
|
|
20
|
+
},
|
|
21
|
+
onKeyDown: (a) => {
|
|
22
|
+
n(a, { index: t });
|
|
23
|
+
}
|
|
24
|
+
}));
|
|
25
|
+
}))
|
|
26
|
+
);
|
|
27
|
+
}, B = ({ className: l, current: p, disabled: n, autoFocus: u, type: E, badgeNumber: r, badgeAriaLabel: f, children: c, ...s }) => {
|
|
28
|
+
const t = v(), m = r !== void 0;
|
|
29
|
+
_(() => {
|
|
30
|
+
var y;
|
|
31
|
+
u && ((y = t.current) == null || y.focus());
|
|
32
|
+
});
|
|
33
|
+
const o = {
|
|
34
|
+
...s,
|
|
35
|
+
ref: t,
|
|
36
|
+
className: b(l, "fake-menu__item", m && "menu__item--badged"),
|
|
37
|
+
"aria-label": f
|
|
38
|
+
}, i = e.createElement(x, { name: "tick16" }), a = {
|
|
39
|
+
marginLeft: "var(--spacing-100)",
|
|
40
|
+
marginRight: "var(--spacing-100)"
|
|
41
|
+
}, d = m && e.createElement(C, { type: "menu", number: r, style: a });
|
|
42
|
+
return E === "button" ? e.createElement(
|
|
43
|
+
"button",
|
|
44
|
+
{ ...o, type: "button", disabled: n },
|
|
45
|
+
e.createElement(
|
|
46
|
+
"span",
|
|
47
|
+
null,
|
|
48
|
+
c,
|
|
49
|
+
d
|
|
50
|
+
),
|
|
51
|
+
i
|
|
52
|
+
) : e.createElement(
|
|
53
|
+
"a",
|
|
54
|
+
{ ...o, "aria-disabled": n ? "true" : void 0 },
|
|
55
|
+
e.createElement(
|
|
56
|
+
"span",
|
|
57
|
+
null,
|
|
58
|
+
c,
|
|
59
|
+
d
|
|
60
|
+
),
|
|
61
|
+
i
|
|
62
|
+
);
|
|
63
|
+
};
|
|
64
|
+
export {
|
|
65
|
+
h as E,
|
|
66
|
+
B as a
|
|
67
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const s=require("react"),i=require("classnames"),o=({className:t,type:e,children:n})=>{const c=e==="inline"?"span":"div";return s.createElement(c,{className:i(t,`${e}-notice__main`)},n)};exports.NoticeContent=o;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=()=>null;exports.EbayNoticeContent=t;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import c from "react";
|
|
2
|
+
import s from "classnames";
|
|
3
|
+
const l = ({ className: e, type: t, as: o, children: a, ...r }) => {
|
|
4
|
+
const i = o || "h2";
|
|
5
|
+
return c.createElement(i, { className: s(e, `${t}-notice__title`), ...r }, a);
|
|
6
|
+
}, N = ({ className: e, type: t, children: o, ...a }) => c.createElement("div", { className: s(e, `${t}-notice__footer`), ...a }, o);
|
|
7
|
+
export {
|
|
8
|
+
l as N,
|
|
9
|
+
N as a
|
|
10
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const i=require("react"),s=require("classnames"),n=({className:e,type:t,as:c,children:o,...r})=>{const a=c||"h2";return i.createElement(a,{className:s(e,`${t}-notice__title`),...r},o)},l=({className:e,type:t,children:c,...o})=>i.createElement("div",{className:s(e,`${t}-notice__footer`),...o},c);exports.NoticeFooter=l;exports.NoticeTitle=n;
|
package/package.json
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ebay/ui-core-react",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.1.0-alpha.2",
|
|
4
4
|
"description": "Skin components build off React",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
7
7
|
},
|
|
8
|
+
"exports": {
|
|
9
|
+
"./package.json": "./package.json",
|
|
10
|
+
"./*": {
|
|
11
|
+
"types": "./*/index.d.ts",
|
|
12
|
+
"import": "./*.mjs",
|
|
13
|
+
"default": "./*.js"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
8
16
|
"scripts": {
|
|
9
17
|
"clean": "node scripts/clean",
|
|
10
18
|
"lint": "eslint . --ext ts,tsx",
|
|
@@ -18,13 +26,13 @@
|
|
|
18
26
|
"build-storybook": "storybook build",
|
|
19
27
|
"storybook:publish": "NODE_OPTIONS=--openssl-legacy-provider yarn build-storybook --output-dir storybook-static/$(git branch --show-current) && gh-pages --add --message=\"Deploying to gh-pages from @ eBay/ebayui-core-react@$(git rev-parse --short HEAD) 🚀\" -d storybook-static",
|
|
20
28
|
"test": "yarn jest",
|
|
21
|
-
"build": "yarn
|
|
22
|
-
"
|
|
29
|
+
"build": "yarn type:check && vite build",
|
|
30
|
+
"type:check": "tsc --noEmit",
|
|
23
31
|
"update-icons": "node ./scripts/update-icons",
|
|
24
|
-
"copy": "copyfiles package.json README.md
|
|
25
|
-
"copy:rest": "yarn copyfiles -u 1 'src/**/*.md'
|
|
26
|
-
"
|
|
27
|
-
"
|
|
32
|
+
"copy": "copyfiles package.json README.md dist; yarn copy:rest",
|
|
33
|
+
"copy:rest": "yarn copyfiles -u 1 'src/**/*.md' dist",
|
|
34
|
+
"release": "yarn clean && yarn build && yarn copy && CI=1 npm publish dist/ --access public",
|
|
35
|
+
"release:rc": "yarn clean && yarn build && yarn copy && CI=1 npm publish --tag rc dist/",
|
|
28
36
|
"prepare": "node scripts/husky-install || node ../scripts/husky-install"
|
|
29
37
|
},
|
|
30
38
|
"lint-staged": {
|
|
@@ -63,6 +71,7 @@
|
|
|
63
71
|
"@babel/register": "^7.0.0",
|
|
64
72
|
"@ebay/skin": "^18.0.0",
|
|
65
73
|
"@microsoft/eslint-formatter-sarif": "^3.0.0",
|
|
74
|
+
"@rollup/plugin-typescript": "^11.1.6",
|
|
66
75
|
"@storybook/addon-a11y": "^7.6.12",
|
|
67
76
|
"@storybook/addon-essentials": "^7.4.6",
|
|
68
77
|
"@storybook/addon-storysource": "^7.6.12",
|
|
@@ -101,13 +110,15 @@
|
|
|
101
110
|
"react": "^18",
|
|
102
111
|
"react-docgen-typescript-loader": "^3.7.2",
|
|
103
112
|
"react-dom": "^18",
|
|
113
|
+
"rollup-plugin-node-externals": "^7.1.3",
|
|
104
114
|
"shaka-player": "^4.3.2",
|
|
105
115
|
"storybook": "^7.5.1",
|
|
106
116
|
"style-loader": "^2.0.0",
|
|
107
117
|
"svgson": "^4.0.0",
|
|
108
118
|
"ts-jest": "^29.1.1",
|
|
109
119
|
"ts-loader": "^8.0.7",
|
|
110
|
-
"typescript": "4"
|
|
120
|
+
"typescript": "4",
|
|
121
|
+
"vite": "^5.4.7"
|
|
111
122
|
},
|
|
112
123
|
"resolutions": {
|
|
113
124
|
"@storybook/addon-actions": "~7.5.3",
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import s from "react";
|
|
2
|
+
import l from "classnames";
|
|
3
|
+
import { E as o } from "./icon-B_a65KUD.mjs";
|
|
4
|
+
const m = {
|
|
5
|
+
default: "",
|
|
6
|
+
small: "progress-spinner--small",
|
|
7
|
+
large: "progress-spinner--large"
|
|
8
|
+
}, p = {
|
|
9
|
+
default: "spinner24",
|
|
10
|
+
small: "spinner20",
|
|
11
|
+
large: "spinner30"
|
|
12
|
+
}, g = ({ size: e = "default", "aria-label": a = "Busy", className: r, ...n }) => s.createElement(
|
|
13
|
+
"span",
|
|
14
|
+
{ ...n, className: l("progress-spinner", m[e], r), "aria-label": a, role: "img" },
|
|
15
|
+
s.createElement(o, { name: p[e] })
|
|
16
|
+
);
|
|
17
|
+
export {
|
|
18
|
+
g as E
|
|
19
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const s=require("react"),l=require("classnames"),i=require("./icon-DK6eEQD8.js"),t={default:"",small:"progress-spinner--small",large:"progress-spinner--large"},c={default:"spinner24",small:"spinner20",large:"spinner30"},o=({size:e="default","aria-label":r="Busy",className:a,...n})=>s.createElement("span",{...n,className:l("progress-spinner",t[e],a),"aria-label":r,role:"img"},s.createElement(i.EbayIcon,{name:c[e]}));exports.EbayProgressSpinner=o;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const l=(a,c,r=1)=>Array(Math.ceil((c+1-a)/r)).fill(a).map((e,i)=>e+i*r);exports.range=l;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import n, { useState as C, useEffect as ca, cloneElement as ra } from "react";
|
|
2
|
+
import ia from "classnames";
|
|
3
|
+
import { E as B, w as ua } from "./icon-B_a65KUD.mjs";
|
|
4
|
+
import { f as m } from "./utils-BipBqkOS.mjs";
|
|
5
|
+
import { E as pa } from "./icon-button-Dy8rjzH7.mjs";
|
|
6
|
+
import { u as da } from "./hooks-r29zhPsY.mjs";
|
|
7
|
+
const ba = ({ name: o, buttonAriaLabel: t, onClick: c = () => {
|
|
8
|
+
}, ...r }) => t ? n.createElement(pa, { "aria-label": t, icon: o, transparent: !0, onClick: c, ...r }) : n.createElement(B, { name: o, ...r }), ma = (o) => n.createElement("span", { ...o }), xa = ({ name: o, ...t }) => n.createElement(B, { name: o, ...t }), fa = (o) => n.createElement("span", { ...o }), w = (o) => typeof o < "u", Ea = ({ type: o = "text", invalid: t, fluid: c, multiline: r, onChange: F = () => {
|
|
9
|
+
}, onInputChange: N = () => {
|
|
10
|
+
}, onFocus: P = () => {
|
|
11
|
+
}, onBlur: K = () => {
|
|
12
|
+
}, onKeyPress: T = () => {
|
|
13
|
+
}, onKeyUp: k = () => {
|
|
14
|
+
}, onKeyDown: L = () => {
|
|
15
|
+
}, onInvalid: D = () => {
|
|
16
|
+
}, onFloatingLabelInit: R = () => {
|
|
17
|
+
}, onButtonClick: U = () => {
|
|
18
|
+
}, autoFocus: f, defaultValue: x = "", value: i, forwardedRef: _, inputSize: E = "default", floatingLabel: j, children: u, placeholder: M, opaqueLabel: O, ...s }) => {
|
|
19
|
+
var h, v;
|
|
20
|
+
const [y, V] = C(x), [g, W] = C(x), { label: $, Container: q, onBlur: G, onFocus: H, ref: J, placeholder: Q } = da({
|
|
21
|
+
ref: _,
|
|
22
|
+
inputId: s.id,
|
|
23
|
+
className: s.className,
|
|
24
|
+
disabled: s.disabled,
|
|
25
|
+
label: j,
|
|
26
|
+
inputSize: E,
|
|
27
|
+
inputValue: i || g,
|
|
28
|
+
placeholder: M,
|
|
29
|
+
invalid: t,
|
|
30
|
+
type: o,
|
|
31
|
+
opaqueLabel: O,
|
|
32
|
+
onMount: R
|
|
33
|
+
}), I = (a) => {
|
|
34
|
+
var e;
|
|
35
|
+
P(a, { value: ((e = a == null ? void 0 : a.target) == null ? void 0 : e.value) || x }), H();
|
|
36
|
+
}, S = (a) => {
|
|
37
|
+
var l;
|
|
38
|
+
const e = (l = a.target) == null ? void 0 : l.value;
|
|
39
|
+
K(a, { value: e }), e !== y && (F(a, { value: e }), V(e)), G();
|
|
40
|
+
}, X = (a) => {
|
|
41
|
+
const e = a.target;
|
|
42
|
+
T(a, { value: e == null ? void 0 : e.value });
|
|
43
|
+
}, Y = (a) => {
|
|
44
|
+
const e = a.target;
|
|
45
|
+
k(a, { value: e == null ? void 0 : e.value });
|
|
46
|
+
}, Z = (a) => {
|
|
47
|
+
const e = a.target;
|
|
48
|
+
L(a, { value: e == null ? void 0 : e.value });
|
|
49
|
+
}, z = (a) => {
|
|
50
|
+
const e = a.target;
|
|
51
|
+
D(a, { value: e == null ? void 0 : e.value });
|
|
52
|
+
}, A = (a) => {
|
|
53
|
+
U(a, { value: y });
|
|
54
|
+
};
|
|
55
|
+
ca(() => {
|
|
56
|
+
f && I();
|
|
57
|
+
}, []);
|
|
58
|
+
const aa = (a) => {
|
|
59
|
+
var l;
|
|
60
|
+
const e = (l = a.target) == null ? void 0 : l.value;
|
|
61
|
+
w(i) || W(e), N(a, { value: e });
|
|
62
|
+
}, ea = r ? "textarea" : "input", oa = c ? "div" : "span", ta = m(u, xa), p = m(u, fa), na = (h = p == null ? void 0 : p.props) == null ? void 0 : h.id, d = m(u, ba), b = m(u, ma), sa = (v = b == null ? void 0 : b.props) == null ? void 0 : v.id, la = ia("textbox", s.className, {
|
|
63
|
+
"textbox--fluid": c,
|
|
64
|
+
"textbox--large": E === "large",
|
|
65
|
+
/** start remove after `:has` support */
|
|
66
|
+
"textbox--disabled": s.disabled,
|
|
67
|
+
"textbox--invalid": t,
|
|
68
|
+
"textbox--readonly": s.readOnly
|
|
69
|
+
/** end remove after `:has` support */
|
|
70
|
+
});
|
|
71
|
+
return n.createElement(
|
|
72
|
+
q,
|
|
73
|
+
null,
|
|
74
|
+
$,
|
|
75
|
+
n.createElement(
|
|
76
|
+
oa,
|
|
77
|
+
{ className: la },
|
|
78
|
+
ta,
|
|
79
|
+
p,
|
|
80
|
+
n.createElement(ea, { "aria-describedby": [na, sa].filter(Boolean).join(" ") || void 0, ...s, className: "textbox__control", type: o, "aria-invalid": t, value: w(i) ? i : g, onChange: aa, onBlur: S, onFocus: I, onKeyPress: X, onKeyUp: Y, onKeyDown: Z, onInvalid: z, autoFocus: f, ref: J, placeholder: Q }),
|
|
81
|
+
b,
|
|
82
|
+
d && ra(d, {
|
|
83
|
+
...d.props,
|
|
84
|
+
onClick: (a) => {
|
|
85
|
+
const { onClick: e = () => {
|
|
86
|
+
} } = d.props;
|
|
87
|
+
e(a), A(a);
|
|
88
|
+
}
|
|
89
|
+
})
|
|
90
|
+
)
|
|
91
|
+
);
|
|
92
|
+
}, wa = ua(Ea);
|
|
93
|
+
export {
|
|
94
|
+
wa as E,
|
|
95
|
+
xa as a,
|
|
96
|
+
fa as b,
|
|
97
|
+
ba as c,
|
|
98
|
+
ma as d,
|
|
99
|
+
w as i
|
|
100
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("react"),ue=require("classnames"),y=require("./icon-DK6eEQD8.js"),p=require("./utils-C9NL3q0j.js"),xe=require("./icon-button-BB6GFLm7.js"),be=require("./hooks-Ctier7Yv.js"),P=({name:n,buttonAriaLabel:a,onClick:c=()=>{},...r})=>a?t.createElement(xe.EbayIconButton,{"aria-label":a,icon:n,transparent:!0,onClick:c,...r}):t.createElement(y.EbayIcon,{name:n,...r}),B=n=>t.createElement("span",{...n}),w=({name:n,...a})=>t.createElement(y.EbayIcon,{name:n,...a}),F=n=>t.createElement("span",{...n}),E=n=>typeof n<"u",de=({type:n="text",invalid:a,fluid:c,multiline:r,onChange:N=()=>{},onInputChange:q=()=>{},onFocus:K=()=>{},onBlur:k=()=>{},onKeyPress:L=()=>{},onKeyUp:D=()=>{},onKeyDown:R=()=>{},onInvalid:U=()=>{},onFloatingLabelInit:_=()=>{},onButtonClick:j=()=>{},autoFocus:m,defaultValue:f="",value:i,forwardedRef:M,inputSize:I="default",floatingLabel:O,children:u,placeholder:S,opaqueLabel:V,...s})=>{var h,v;const[g,W]=t.useState(f),[C,$]=t.useState(f),{label:G,Container:H,onBlur:J,onFocus:Q,ref:X,placeholder:Y}=be.useFloatingLabel({ref:M,inputId:s.id,className:s.className,disabled:s.disabled,label:O,inputSize:I,inputValue:i||C,placeholder:S,invalid:a,type:n,opaqueLabel:V,onMount:_}),T=e=>{var o;K(e,{value:((o=e==null?void 0:e.target)==null?void 0:o.value)||f}),Q()},Z=e=>{var l;const o=(l=e.target)==null?void 0:l.value;k(e,{value:o}),o!==g&&(N(e,{value:o}),W(o)),J()},z=e=>{const o=e.target;L(e,{value:o==null?void 0:o.value})},A=e=>{const o=e.target;D(e,{value:o==null?void 0:o.value})},ee=e=>{const o=e.target;R(e,{value:o==null?void 0:o.value})},oe=e=>{const o=e.target;U(e,{value:o==null?void 0:o.value})},ne=e=>{j(e,{value:g})};t.useEffect(()=>{m&&T()},[]);const te=e=>{var l;const o=(l=e.target)==null?void 0:l.value;E(i)||$(o),q(e,{value:o})},ae=r?"textarea":"input",se=c?"div":"span",le=p.findComponent(u,w),x=p.findComponent(u,F),ce=(h=x==null?void 0:x.props)==null?void 0:h.id,b=p.findComponent(u,P),d=p.findComponent(u,B),re=(v=d==null?void 0:d.props)==null?void 0:v.id,ie=ue("textbox",s.className,{"textbox--fluid":c,"textbox--large":I==="large","textbox--disabled":s.disabled,"textbox--invalid":a,"textbox--readonly":s.readOnly});return t.createElement(H,null,G,t.createElement(se,{className:ie},le,x,t.createElement(ae,{"aria-describedby":[ce,re].filter(Boolean).join(" ")||void 0,...s,className:"textbox__control",type:n,"aria-invalid":a,value:E(i)?i:C,onChange:te,onBlur:Z,onFocus:T,onKeyPress:z,onKeyUp:A,onKeyDown:ee,onInvalid:oe,autoFocus:m,ref:X,placeholder:Y}),d,b&&t.cloneElement(b,{...b.props,onClick:e=>{const{onClick:o=()=>{}}=b.props;o(e),ne(e)}})))},pe=y.withForwardRef(de);exports.EbayTextbox=pe;exports.EbayTextboxPostfixIcon=P;exports.EbayTextboxPostfixText=B;exports.EbayTextboxPrefixIcon=w;exports.EbayTextboxPrefixText=F;exports.isControlled=E;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("react"),d=require("classnames"),b=require("./icon-DK6eEQD8.js"),i=require("./utils-C9NL3q0j.js"),u=({children:o,className:e,forwardedRef:s,...a})=>(t.Children.only(o),t.cloneElement(o,{ref:s,...a,className:d(e,o.props.className)})),T=({className:o,type:e,isExpanded:s,children:a,forwardedRef:l,...c})=>{var m;const p=i.findComponent(a,u),r=i.excludeComponent(a,u)[0];if(!p)throw new Error("Tooltip: Please use a TooltipHost that defines the host of the tooltip");const n=t.cloneElement(p,{className:`${e}__host`,"aria-expanded":s,"aria-describedby":(m=r==null?void 0:r.props)==null?void 0:m.id,...p.props});return t.createElement("span",{...c,ref:l,className:d(o,e,{[`${e}--expanded`]:s})},n,r)},_=b.withForwardRef(T),E="bottom",g={tooltip:"tooltip",tourtip:"region",infotip:""},h={left:{transform:"translateX(16px) translateY(-50%) scale3d(1,1,1)",left:"100%",right:"auto",top:"-6px",bottom:"auto"},"left-top":{transform:"translateX(16px) scale3d(1,1,1)",left:"100%",right:"auto",top:"-100%",bottom:"auto"},"left-bottom":{transform:"translateX(16px) scale3d(1,1,1)",left:"100%",right:"auto",top:"auto",bottom:"-10px"},right:{transform:"translateX(-16px) translateY(-50%) scale3d(1,1,1)",left:"auto",right:"100%",top:"-6px",bottom:"auto"},"right-top":{transform:"translateX(-16px) scale3d(1,1,1)",left:"auto",right:"100%",top:"-100%",bottom:"auto"},"right-bottom":{transform:"translateX(-16px) scale3d(1,1,1)",left:"auto",right:"100%",top:"auto",bottom:"-50%"},top:{transform:"translateX(-50%) scale3d(1,1,1)",left:"50%",right:"auto",top:"calc(100% + 2px)",bottom:"auto"},"top-left":{transform:"scale3d(1,1,1)",left:"-10px",right:"auto",top:"calc(100% + 2px)",bottom:"auto"},"top-right":{transform:"scale3d(1,1,1)",left:"auto",right:"-10px",top:"calc(100% + 2px)",bottom:"auto"},"bottom-right":{transform:"scale3d(1,1,1)",left:"auto",right:"-10px",top:"auto",bottom:"calc(100% + 12px)"},"bottom-left":{transform:"scale3d(1,1,1)",left:"-10px",right:"auto",top:"auto",bottom:"calc(100% + 12px)"},bottom:{transform:"translateX(-50%) scale3d(1,1,1)",left:"50%",right:"auto",top:"auto",bottom:"calc(100% + 12px)"}},N=()=>null,f=({children:o,className:e,type:s="tourtip"})=>t.createElement("div",{className:d(`${s}__footer`,e)},o),C=({id:o,style:e,pointer:s=E,children:a,type:l="tooltip",showCloseButton:c,a11yCloseText:p,onClose:r})=>{const n=i.findComponent(a,N),m=i.findComponent(a,f),x=i.excludeComponent(a,f);return t.createElement("span",{className:`${l}__overlay`,id:o,role:g[l]||null,style:{...h[s],...e}},t.createElement("span",{className:`${l}__pointer ${l}__pointer--${s}`}),t.createElement("span",{className:`${l}__mask`},t.createElement("span",{className:`${l}__cell`},t.createElement("span",{className:`${l}__content`},x),c?t.createElement("button",{...n==null?void 0:n.props,className:`icon-btn icon-btn--transparent ${l}__close`,type:"button","aria-label":p,onClick:r},t.createElement(b.EbayIcon,{name:"close16"})):null,m)))},$=({onExpand:o,onCollapse:e,initialExpanded:s=!1,hostRef:a})=>{const[l,c]=t.useState(s);return{isExpanded:l,expandTooltip:()=>{c(!0),o&&o()},collapseTooltip:()=>{var n;c(!1),e&&e(),(n=a==null?void 0:a.current)==null||n.focus()}}};exports.Tooltip=_;exports.TooltipContent=C;exports.TooltipFooter=f;exports.TooltipHost=u;exports.useTooltip=$;
|