@ebay/ui-core-react 7.4.0-alpha.9 → 8.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -5
- package/array.polyfill.flat-5BAolFdk.js +1 -0
- package/badge-CoHKfiPt.js +1 -0
- package/button-6S4U-4HH.js +1 -0
- package/calendar-hBaLhOjI.js +1 -0
- package/common/dropdown.d.ts +20 -0
- package/common/dropdown.d.ts.map +1 -0
- package/common/floating-label-utils/hooks.d.ts.map +1 -1
- package/debounce-BQsYxxOL.js +1 -0
- package/dialog-previous-button-B-fysL3O.js +1 -0
- package/dropdown-pp-aluo7.js +1 -0
- package/ebay-accordion/README.md +61 -0
- package/ebay-accordion/accordion.d.ts +16 -0
- package/ebay-accordion/accordion.d.ts.map +1 -0
- package/ebay-accordion/index.d.ts +3 -0
- package/ebay-accordion/index.d.ts.map +1 -0
- package/ebay-accordion/index.js +2 -0
- package/ebay-alert-dialog/index.js +1 -26
- package/ebay-badge/index.js +1 -4
- package/ebay-breadcrumbs/index.js +1 -47
- package/ebay-button/README.md +1 -1
- package/ebay-button/button.d.ts.map +1 -1
- package/ebay-button/index.js +1 -5
- package/ebay-button/types.d.ts +1 -1
- package/ebay-button/types.d.ts.map +1 -1
- package/ebay-calendar/index.js +1 -4
- package/ebay-carousel/index.js +1 -345
- package/ebay-checkbox/index.js +1 -52
- package/ebay-confirm-dialog/index.js +1 -28
- package/ebay-cta-button/index.js +1 -22
- package/ebay-date-textbox/date-textbox.d.ts.map +1 -1
- package/ebay-date-textbox/index.js +1 -140
- package/ebay-details/README.md +51 -0
- package/ebay-details/ebay-details.d.ts +17 -0
- package/ebay-details/ebay-details.d.ts.map +1 -0
- package/ebay-details/index.d.ts +2 -0
- package/ebay-details/index.d.ts.map +1 -0
- package/ebay-details/index.js +1 -0
- package/ebay-details-q_d7qlcN.js +1 -0
- package/ebay-dialog-base/index.js +1 -13
- package/{ebay-drawer-dialog → ebay-drawer-dialog-deprecated}/README.md +9 -8
- package/{ebay-drawer-dialog → ebay-drawer-dialog-deprecated}/components/drawer.d.ts +2 -6
- package/ebay-drawer-dialog-deprecated/components/drawer.d.ts.map +1 -0
- package/ebay-drawer-dialog-deprecated/index.d.ts +2 -0
- package/ebay-drawer-dialog-deprecated/index.d.ts.map +1 -0
- package/ebay-drawer-dialog-deprecated/index.js +1 -0
- package/ebay-eek/index.js +1 -54
- package/ebay-fake-menu/index.js +1 -10
- package/ebay-fake-menu/menu.d.ts +4 -3
- package/ebay-fake-menu/menu.d.ts.map +1 -1
- package/ebay-fake-menu-button/README.md +1 -1
- package/ebay-fake-menu-button/index.js +1 -7
- package/ebay-fake-menu-button/menu-button.d.ts.map +1 -1
- package/ebay-fake-tabs/index.js +1 -30
- package/ebay-field/index.js +1 -21
- package/{ebay-fullscreen-dialog → ebay-fullscreen-dialog-deprecated}/README.md +6 -4
- package/{ebay-fullscreen-dialog → ebay-fullscreen-dialog-deprecated}/fullscreen-dialog.d.ts +2 -2
- package/ebay-fullscreen-dialog-deprecated/fullscreen-dialog.d.ts.map +1 -0
- package/ebay-fullscreen-dialog-deprecated/index.d.ts +2 -0
- package/ebay-fullscreen-dialog-deprecated/index.d.ts.map +1 -0
- package/ebay-fullscreen-dialog-deprecated/index.js +1 -0
- package/ebay-icon/README.md +1 -1
- package/ebay-icon/index.js +1 -4
- package/ebay-icon/types.d.ts +1 -1
- package/ebay-icon/types.d.ts.map +1 -1
- package/ebay-icon-button/index.js +1 -4
- package/ebay-infotip/README.md +0 -2
- package/ebay-infotip/ebay-infotip.d.ts +0 -2
- package/ebay-infotip/ebay-infotip.d.ts.map +1 -1
- package/ebay-infotip/index.js +1 -76
- package/ebay-inline-notice/index.js +1 -36
- package/ebay-lightbox-dialog/README.md +2 -0
- package/ebay-lightbox-dialog/index.js +1 -12
- package/ebay-lightbox-dialog/lightbox-dialog.d.ts +3 -1
- package/ebay-lightbox-dialog/lightbox-dialog.d.ts.map +1 -1
- package/ebay-listbox/README.md +1 -1
- package/ebay-listbox/index.js +1 -6
- package/ebay-listbox/listbox.d.ts +0 -1
- package/ebay-listbox/listbox.d.ts.map +1 -1
- package/ebay-listbox-button/index.d.ts +2 -1
- package/ebay-listbox-button/index.d.ts.map +1 -1
- package/ebay-listbox-button/index.js +2 -151
- package/ebay-listbox-button/listbox-button-option.d.ts +10 -0
- package/ebay-listbox-button/listbox-button-option.d.ts.map +1 -0
- package/ebay-listbox-button/listbox-button.d.ts +5 -15
- package/ebay-listbox-button/listbox-button.d.ts.map +1 -1
- package/ebay-menu/index.js +1 -9
- package/ebay-menu/menu.d.ts.map +1 -1
- package/ebay-menu/types.d.ts +2 -1
- package/ebay-menu/types.d.ts.map +1 -1
- package/ebay-menu-button/README.md +1 -1
- package/ebay-menu-button/index.js +1 -113
- package/ebay-menu-button/menu-button.d.ts.map +1 -1
- package/ebay-notice-base/index.js +1 -7
- package/ebay-page-notice/index.js +1 -50
- package/ebay-pagination/index.js +1 -244
- package/ebay-panel-dialog/index.js +1 -12
- package/ebay-progress-bar/index.js +1 -6
- package/ebay-progress-spinner/index.js +1 -4
- package/ebay-progress-stepper/index.js +1 -72
- package/ebay-radio/index.js +1 -4
- package/ebay-section-notice/index.js +1 -69
- package/ebay-section-title/index.js +1 -38
- package/ebay-segmented-buttons/index.js +1 -46
- package/ebay-select/index.js +1 -98
- package/ebay-signal/index.js +1 -9
- package/ebay-snackbar-dialog/index.js +1 -81
- package/ebay-split-button/README.md +1 -1
- package/ebay-split-button/index.js +1 -22
- package/ebay-star-rating/index.js +1 -9
- package/ebay-star-rating-select/index.js +1 -55
- package/ebay-svg/index.js +1 -5189
- package/ebay-svg/symbols.d.ts.map +1 -1
- package/ebay-switch/index.js +1 -27
- package/ebay-tabs/README.md +1 -3
- package/ebay-tabs/index.js +1 -88
- package/ebay-tabs/tabs.d.ts.map +1 -1
- package/ebay-tabs/types.d.ts +2 -6
- package/ebay-tabs/types.d.ts.map +1 -1
- package/ebay-textbox/index.js +1 -10
- package/ebay-toast-dialog/README.md +3 -3
- package/ebay-toast-dialog/index.js +1 -9
- package/ebay-toggle-button/README.md +39 -0
- package/ebay-toggle-button/index.d.ts +3 -0
- package/ebay-toggle-button/index.d.ts.map +1 -0
- package/ebay-toggle-button/index.js +1 -0
- package/ebay-toggle-button/toggle-button.d.ts +5 -0
- package/ebay-toggle-button/toggle-button.d.ts.map +1 -0
- package/ebay-toggle-button/types.d.ts +23 -0
- package/ebay-toggle-button/types.d.ts.map +1 -0
- package/ebay-toggle-button-group/README.md +56 -0
- package/ebay-toggle-button-group/index.d.ts +3 -0
- package/ebay-toggle-button-group/index.d.ts.map +1 -0
- package/ebay-toggle-button-group/index.js +1 -0
- package/ebay-toggle-button-group/toggle-button-group.d.ts +5 -0
- package/ebay-toggle-button-group/toggle-button-group.d.ts.map +1 -0
- package/ebay-toggle-button-group/types.d.ts +20 -0
- package/ebay-toggle-button-group/types.d.ts.map +1 -0
- package/ebay-tooltip/index.js +1 -64
- package/ebay-tourtip/index.js +1 -54
- package/ebay-video/index.js +1 -229
- package/events/index.js +1 -18
- package/forwardRef-fPwzYd82.js +1 -0
- package/hooks-5qES90Sx.js +1 -0
- package/icon-D4RDqpD4.js +1 -0
- package/icon-button-Bjjvld0a.js +1 -0
- package/index-Bsb1LHpi.js +1 -0
- package/label-CnrpYJ-g.js +1 -0
- package/lightbox-dialog-Il3dBNcR.js +1 -0
- package/menu-DAOhKkcI.js +1 -0
- package/menu-button-label-DJq794te.js +1 -0
- package/menu-button-label-D_04ZC3p.js +1 -0
- package/menu-item-Cf-tQ72X.js +1 -0
- package/notice-content-9iF4T8uB.js +1 -0
- package/notice-content-C0ZStfuX.js +1 -0
- package/notice-cta-FAd6zCdx.js +1 -0
- package/package.json +19 -84
- package/progress-spinner-CF3qoWE3.js +1 -0
- package/range-DOsPN0h5.js +1 -0
- package/scroll-OgAngNzq.js +1 -0
- package/textbox-DZRVQetR.js +1 -0
- package/toggle-button-CFPnYlex.js +1 -0
- package/use-roving-index-DoAVBgsp.js +1 -0
- package/use-tooltip-BEiQpMDa.js +1 -0
- package/utils/index.d.ts +1 -0
- package/utils/index.d.ts.map +1 -1
- package/utils/index.js +1 -13
- package/utils-C9NL3q0j.js +1 -0
- package/array.polyfill.flat-DyxysTxZ.js +0 -21
- package/badge-CR5t7-2L.js +0 -8
- package/button-B4bZIgwB.js +0 -83
- package/calendar-D-DWjrMU.js +0 -333
- package/common/component-utils/forwardRef/index.js +0 -10
- package/common/component-utils/index.js +0 -9
- package/common/component-utils/utils/index.js +0 -25
- package/common/event-utils/index.js +0 -113
- package/common/floating-label-utils/hooks/index.js +0 -106
- package/common/notice-utils/notice-cta/index.js +0 -5
- package/common/random-id/index.js +0 -13
- package/common/tooltip-utils/constants/index.js +0 -97
- package/common/tooltip-utils/index.js +0 -11
- package/debounce-v8bWAUnY.js +0 -9
- package/dialog-previous-button-EC_Y6KaT.js +0 -370
- package/drawer-DBDktEBZ.js +0 -69
- package/ebay-dialog-base/components/animation/index.js +0 -92
- package/ebay-dialog-base/components/dialog-footer/index.js +0 -4
- package/ebay-dialog-base/components/dialog-header/index.js +0 -4
- package/ebay-drawer-dialog/components/drawer.d.ts.map +0 -1
- package/ebay-drawer-dialog/index.d.ts +0 -2
- package/ebay-drawer-dialog/index.d.ts.map +0 -1
- package/ebay-drawer-dialog/index.js +0 -4
- package/ebay-fake-menu/menu-item/index.js +0 -49
- package/ebay-fake-menu-button/menu-button/index.js +0 -12
- package/ebay-fullscreen-dialog/fullscreen-dialog.d.ts.map +0 -1
- package/ebay-fullscreen-dialog/index.d.ts +0 -2
- package/ebay-fullscreen-dialog/index.d.ts.map +0 -1
- package/ebay-fullscreen-dialog/index.js +0 -10
- package/ebay-radio/radio/index.js +0 -48
- package/icon-B17Di3YL.js +0 -56
- package/icon-button-BQWoMgX1.js +0 -31
- package/index-BXizW4ue.js +0 -89
- package/index-DcH7Tjjd.js +0 -272
- package/label-C0AS4fnO.js +0 -19
- package/listbox-DfOw_fJc.js +0 -662
- package/menu-Bsy48CE1.js +0 -163
- package/menu-button-CKGsgg6G.js +0 -89
- package/menu-fCOy6wBS.js +0 -29
- package/notice-content-BTXVxttv.js +0 -8
- package/notice-content-BhUeK1pd.js +0 -3
- package/notice-footer-CIQ8SM6N.js +0 -10
- package/progress-spinner-DOFKRtuu.js +0 -20
- package/range-C5qzyhg4.js +0 -3
- package/textbox-J291yCpJ.js +0 -136
- package/use-roving-index-CEM_UsCH.js +0 -58
- package/use-tooltip-7JxcZHJn.js +0 -92
|
@@ -1,38 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const React = require("react");
|
|
4
|
-
const classNames = require("classnames");
|
|
5
|
-
const common_componentUtils_utils = require("../common/component-utils/utils/index.js");
|
|
6
|
-
const Cta = ({ ctaText, href, className, ...rest }) => {
|
|
7
|
-
if (!ctaText) {
|
|
8
|
-
return null;
|
|
9
|
-
}
|
|
10
|
-
return React.createElement("a", { ...rest, className: classNames("section-title__cta", className), href }, ctaText);
|
|
11
|
-
};
|
|
12
|
-
const EbaySectionTitle = ({ href, ctaText, className, children, ...rest }) => {
|
|
13
|
-
const sectionTitleClass = classNames(className, "section-title");
|
|
14
|
-
const title = common_componentUtils_utils.findComponent(children, Title);
|
|
15
|
-
const subtitle = common_componentUtils_utils.findComponent(children, Subtitle);
|
|
16
|
-
const info = common_componentUtils_utils.findComponent(children, Info);
|
|
17
|
-
const overflow = common_componentUtils_utils.findComponent(children, Overflow);
|
|
18
|
-
return React.createElement(
|
|
19
|
-
"div",
|
|
20
|
-
{ ...rest, className: sectionTitleClass },
|
|
21
|
-
React.createElement(
|
|
22
|
-
"div",
|
|
23
|
-
{ className: "section-title__title-container" },
|
|
24
|
-
title || React.createElement(Title, null, children),
|
|
25
|
-
subtitle
|
|
26
|
-
),
|
|
27
|
-
href && React.createElement(Cta, { href, ctaText }) || info || overflow
|
|
28
|
-
);
|
|
29
|
-
};
|
|
30
|
-
const Title = ({ children, className, ...rest }) => React.createElement("h2", { ...rest, className: classNames(className, "section-title__title") }, children);
|
|
31
|
-
const Subtitle = ({ children, className, ...rest }) => React.createElement("span", { ...rest, className: classNames(className, "section-title__subtitle") }, children);
|
|
32
|
-
const Info = ({ className, children, ...rest }) => React.createElement("div", { ...rest, className: classNames(className, "section-title__info") }, children);
|
|
33
|
-
const Overflow = ({ children, className, ...rest }) => React.createElement("div", { ...rest, className: classNames(className, "section-title__overflow") }, children);
|
|
34
|
-
exports.EbaySectionTitle = EbaySectionTitle;
|
|
35
|
-
exports.EbaySectionTitleInfo = Info;
|
|
36
|
-
exports.EbaySectionTitleOverflow = Overflow;
|
|
37
|
-
exports.EbaySectionTitleSubtitle = Subtitle;
|
|
38
|
-
exports.EbaySectionTitleTitle = Title;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react"),l=require("classnames"),s=require("../utils-C9NL3q0j.js"),v=({ctaText:e,href:t,className:n,...o})=>e?i.createElement("a",{...o,className:l("section-title__cta",n),href:t},e):null,T=({href:e,ctaText:t,className:n,children:o,...u})=>{const E=l(n,"section-title"),f=s.findComponent(o,c),b=s.findComponent(o,a),_=s.findComponent(o,r),S=s.findComponent(o,m);return i.createElement("div",{...u,className:E},i.createElement("div",{className:"section-title__title-container"},f||i.createElement(c,null,o),b),e&&i.createElement(v,{href:e,ctaText:t})||_||S)},c=({children:e,className:t,...n})=>i.createElement("h2",{...n,className:l(t,"section-title__title")},e),a=({children:e,className:t,...n})=>i.createElement("span",{...n,className:l(t,"section-title__subtitle")},e),r=({className:e,children:t,...n})=>i.createElement("div",{...n,className:l(e,"section-title__info")},t),m=({children:e,className:t,...n})=>i.createElement("div",{...n,className:l(t,"section-title__overflow")},e);exports.EbaySectionTitle=T;exports.EbaySectionTitleInfo=r;exports.EbaySectionTitleOverflow=m;exports.EbaySectionTitleSubtitle=a;exports.EbaySectionTitleTitle=c;
|
|
@@ -1,46 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const React = require("react");
|
|
4
|
-
const classNames = require("classnames");
|
|
5
|
-
const common_componentUtils_utils = require("../common/component-utils/utils/index.js");
|
|
6
|
-
const icon = require("../icon-B17Di3YL.js");
|
|
7
|
-
const SegmentedButton = ({ selected, children, className, ...rest }) => {
|
|
8
|
-
const icon$1 = common_componentUtils_utils.findComponent(children, icon.EbayIcon);
|
|
9
|
-
const iconWithText = () => {
|
|
10
|
-
const text = common_componentUtils_utils.excludeComponent(children, icon.EbayIcon);
|
|
11
|
-
return React.createElement(
|
|
12
|
-
"span",
|
|
13
|
-
{ className: "segmented-buttons__button-cell" },
|
|
14
|
-
icon$1,
|
|
15
|
-
React.createElement("span", null, text)
|
|
16
|
-
);
|
|
17
|
-
};
|
|
18
|
-
return React.createElement(
|
|
19
|
-
"li",
|
|
20
|
-
null,
|
|
21
|
-
React.createElement("button", { className: classNames("segmented-buttons__button", className), "aria-current": selected || void 0, ...rest }, icon$1 ? iconWithText() : children)
|
|
22
|
-
);
|
|
23
|
-
};
|
|
24
|
-
const EbaySegmentedButtons = ({ size, className, onChange = () => {
|
|
25
|
-
}, children, ...rest }) => {
|
|
26
|
-
const buttons = common_componentUtils_utils.filterByType(children, SegmentedButton);
|
|
27
|
-
const [selectedIndex, setSelectedIndex] = React.useState(buttons.findIndex((button) => button.props.selected) || 0);
|
|
28
|
-
const handleClick = (e, index, value) => {
|
|
29
|
-
setSelectedIndex(index);
|
|
30
|
-
onChange(e, { index, value });
|
|
31
|
-
};
|
|
32
|
-
return React.createElement(
|
|
33
|
-
"div",
|
|
34
|
-
{ className: classNames("segmented-buttons", size && `segmented-buttons--${size}`, className), ...rest },
|
|
35
|
-
React.createElement("ul", null, buttons.map((button, i) => {
|
|
36
|
-
const { value, ...buttonRest } = button.props;
|
|
37
|
-
return React.cloneElement(button, {
|
|
38
|
-
...buttonRest,
|
|
39
|
-
onClick: (e) => handleClick(e, i, value),
|
|
40
|
-
selected: i === selectedIndex
|
|
41
|
-
});
|
|
42
|
-
}))
|
|
43
|
-
);
|
|
44
|
-
};
|
|
45
|
-
exports.EbaySegmentedButton = SegmentedButton;
|
|
46
|
-
exports.EbaySegmentedButtons = EbaySegmentedButtons;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),b=require("classnames"),d=require("../utils-C9NL3q0j.js"),i=require("../icon-D4RDqpD4.js"),E=({selected:o,children:n,className:u,...a})=>{const c=d.findComponent(n,i.EbayIcon),l=()=>{const r=d.excludeComponent(n,i.EbayIcon);return e.createElement("span",{className:"segmented-buttons__button-cell"},c,e.createElement("span",null,r))};return e.createElement("li",null,e.createElement("button",{className:b("segmented-buttons__button",u),"aria-current":o||void 0,...a},c?l():n))},x=({size:o,className:n,onChange:u=()=>{},children:a,...c})=>{const l=d.filterByType(a,E),[r,p]=e.useState(l.findIndex(t=>t.props.selected)||0),g=(t,s,m)=>{p(s),u(t,{index:s,value:m})};return e.createElement("div",{className:b("segmented-buttons",o&&`segmented-buttons--${o}`,n),...c},e.createElement("ul",null,l.map((t,s)=>{const{value:m,...y}=t.props;return e.cloneElement(t,{...y,onClick:S=>g(S,s,m),selected:s===r})})))};exports.EbaySegmentedButton=E;exports.EbaySegmentedButtons=x;
|
package/ebay-select/index.js
CHANGED
|
@@ -1,98 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const React = require("react");
|
|
4
|
-
const classNames = require("classnames");
|
|
5
|
-
const icon = require("../icon-B17Di3YL.js");
|
|
6
|
-
const common_componentUtils_forwardRef = require("../common/component-utils/forwardRef/index.js");
|
|
7
|
-
const common_componentUtils_utils = require("../common/component-utils/utils/index.js");
|
|
8
|
-
const common_floatingLabelUtils_hooks = require("../common/floating-label-utils/hooks/index.js");
|
|
9
|
-
const EbaySelectOption = ({ children, ...rest }) => React.createElement("option", { ...rest }, children);
|
|
10
|
-
const isControlled = (value) => typeof value !== "undefined";
|
|
11
|
-
const EbaySelect = ({ value: controlledValue, defaultValue, className, borderless, name, disabled, onChange = () => {
|
|
12
|
-
}, onBlur = () => {
|
|
13
|
-
}, onFocus = () => {
|
|
14
|
-
}, floatingLabel, forwardedRef, children, inputSize, invalid, ...rest }) => {
|
|
15
|
-
const isFieldInvalid = invalid || rest["aria-invalid"] === "true";
|
|
16
|
-
const [value, setValue] = React.useState(defaultValue);
|
|
17
|
-
const { label, Container, onBlur: onFloatingLabelBlur, onFocus: onFloatingLabelFocus, ref } = common_floatingLabelUtils_hooks.useFloatingLabel({
|
|
18
|
-
ref: forwardedRef,
|
|
19
|
-
inputId: rest.id,
|
|
20
|
-
className,
|
|
21
|
-
disabled,
|
|
22
|
-
label: floatingLabel,
|
|
23
|
-
inputValue: controlledValue,
|
|
24
|
-
inputSize,
|
|
25
|
-
invalid: isFieldInvalid
|
|
26
|
-
});
|
|
27
|
-
const handleSelectChange = (e) => {
|
|
28
|
-
const { value: newValue, selectedIndex } = e.target;
|
|
29
|
-
if (!isControlled(controlledValue)) {
|
|
30
|
-
setValue(newValue);
|
|
31
|
-
}
|
|
32
|
-
onChange(e, { index: selectedIndex, selected: [newValue] });
|
|
33
|
-
};
|
|
34
|
-
const handleBlur = (event) => {
|
|
35
|
-
onBlur(event);
|
|
36
|
-
onFloatingLabelBlur();
|
|
37
|
-
};
|
|
38
|
-
const handleFocus = (event) => {
|
|
39
|
-
onFocus(event);
|
|
40
|
-
onFloatingLabelFocus();
|
|
41
|
-
};
|
|
42
|
-
const selectClassName = classNames("select", className, {
|
|
43
|
-
"select--borderless": borderless,
|
|
44
|
-
"select--large": inputSize === `large`
|
|
45
|
-
});
|
|
46
|
-
return React.createElement(
|
|
47
|
-
Container,
|
|
48
|
-
null,
|
|
49
|
-
label,
|
|
50
|
-
React.createElement(
|
|
51
|
-
"span",
|
|
52
|
-
{ className: selectClassName },
|
|
53
|
-
React.createElement("select", { ...rest, name, value: isControlled(controlledValue) ? controlledValue : value, disabled, onChange: handleSelectChange, onBlur: handleBlur, onFocus: handleFocus, ref }, options(children)),
|
|
54
|
-
React.createElement(icon.EbayIcon, { name: "chevronDown12", height: "8", width: "8" })
|
|
55
|
-
)
|
|
56
|
-
);
|
|
57
|
-
};
|
|
58
|
-
const ebaySelect = common_componentUtils_forwardRef.withForwardRef(EbaySelect);
|
|
59
|
-
function optionGroups(data) {
|
|
60
|
-
const optGroups = {};
|
|
61
|
-
data.forEach((opt) => {
|
|
62
|
-
const option = opt.props;
|
|
63
|
-
if (option.optgroup) {
|
|
64
|
-
if (!Object.prototype.hasOwnProperty.call(optGroups, option.optgroup)) {
|
|
65
|
-
optGroups[option.optgroup] = [];
|
|
66
|
-
}
|
|
67
|
-
optGroups[option.optgroup].push(option);
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
return optGroups;
|
|
71
|
-
}
|
|
72
|
-
function options(children) {
|
|
73
|
-
const renderedGroups = [];
|
|
74
|
-
const allOptions = [];
|
|
75
|
-
let optGroups = {};
|
|
76
|
-
let withinGroup = false;
|
|
77
|
-
const childrenOpts = common_componentUtils_utils.filterByType(children, EbaySelectOption).map((c) => React.cloneElement(c, {}));
|
|
78
|
-
if (childrenOpts) {
|
|
79
|
-
optGroups = optionGroups(childrenOpts);
|
|
80
|
-
let currentGroupName;
|
|
81
|
-
childrenOpts.forEach((option, idx) => {
|
|
82
|
-
const { value, optionClassName, children: optionChildren, optgroup } = option.props;
|
|
83
|
-
withinGroup = optgroup && renderedGroups.indexOf(optgroup) === -1;
|
|
84
|
-
if (withinGroup) {
|
|
85
|
-
currentGroupName = optgroup;
|
|
86
|
-
const currentGroupOptions = optGroups[currentGroupName];
|
|
87
|
-
const opts = currentGroupOptions.map((groupOption) => React.createElement(EbaySelectOption, { key: `opt-${groupOption.value}`, value: groupOption.value, className: groupOption.optionClassName }, groupOption.children));
|
|
88
|
-
allOptions.push(React.createElement("optgroup", { key: idx, label: optgroup }, opts));
|
|
89
|
-
renderedGroups.push(optgroup);
|
|
90
|
-
} else if (!optgroup) {
|
|
91
|
-
allOptions.push(React.createElement(EbaySelectOption, { key: idx, value, className: optionClassName }, optionChildren));
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
return allOptions;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
exports.EbaySelect = ebaySelect;
|
|
98
|
-
exports.EbaySelectOption = EbaySelectOption;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react"),R=require("classnames"),j=require("../icon-D4RDqpD4.js"),x=require("../forwardRef-fPwzYd82.js"),P=require("../utils-C9NL3q0j.js"),T=require("../hooks-5qES90Sx.js"),h=({children:e,...t})=>n.createElement("option",{...t},e),v=e=>typeof e<"u",D=({value:e,defaultValue:t,className:s,borderless:o,name:p,disabled:r,onChange:a=()=>{},onBlur:f=()=>{},onFocus:d=()=>{},floatingLabel:m,forwardedRef:y,children:E,inputSize:l,invalid:b,...i})=>{const c=b||i["aria-invalid"]==="true",[F,w]=n.useState(t),{label:C,Container:G,onBlur:S,onFocus:N,ref:O}=T.useFloatingLabel({ref:y,inputId:i.id,className:s,disabled:r,label:m,inputValue:e,inputSize:l,invalid:c}),q=u=>{const{value:g,selectedIndex:L}=u.target;v(e)||w(g),a(u,{index:L,selected:[g]})},B=u=>{f(u),S()},k=u=>{d(u),N()},I=R("select",s,{"select--borderless":o,"select--large":l==="large"});return n.createElement(G,null,C,n.createElement("span",{className:I},n.createElement("select",{...i,name:p,value:v(e)?e:F,disabled:r,onChange:q,onBlur:B,onFocus:k,ref:O},A(E)),n.createElement(j.EbayIcon,{name:"chevronDown12",height:"8",width:"8"})))},M=x.withForwardRef(D);function $(e){const t={};return e.forEach(s=>{const o=s.props;o.optgroup&&(Object.prototype.hasOwnProperty.call(t,o.optgroup)||(t[o.optgroup]=[]),t[o.optgroup].push(o))}),t}function A(e){const t=[],s=[];let o={},p=!1;const r=P.filterByType(e,h).map(a=>n.cloneElement(a,{}));if(r){o=$(r);let a;return r.forEach((f,d)=>{const{value:m,optionClassName:y,children:E,optgroup:l}=f.props;if(p=l&&t.indexOf(l)===-1,p){a=l;const i=o[a].map(c=>n.createElement(h,{key:`opt-${c.value}`,value:c.value,className:c.optionClassName},c.children));s.push(n.createElement("optgroup",{key:d,label:l},i)),t.push(l)}else l||s.push(n.createElement(h,{key:d,value:m,className:y},E))}),s}}exports.EbaySelect=M;exports.EbaySelectOption=h;
|
package/ebay-signal/index.js
CHANGED
|
@@ -1,9 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const React = require("react");
|
|
4
|
-
const classNames = require("classnames");
|
|
5
|
-
const EbaySignal = ({ status = "neutral", ...rest }) => {
|
|
6
|
-
const className = classNames(`signal signal--${status}`, rest.className);
|
|
7
|
-
return React.createElement("span", { ...rest, className });
|
|
8
|
-
};
|
|
9
|
-
exports.EbaySignal = EbaySignal;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react"),t=require("classnames"),l=({status:a="neutral",...e})=>{const s=t(`signal signal--${a}`,e.className);return n.createElement("span",{...e,className:s})};exports.EbaySignal=l;
|
|
@@ -1,81 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const classNames = require("classnames");
|
|
4
|
-
const React = require("react");
|
|
5
|
-
const dialogPreviousButton = require("../dialog-previous-button-EC_Y6KaT.js");
|
|
6
|
-
require("../icon-button-BQWoMgX1.js");
|
|
7
|
-
const EbaySnackbarDialogAction = ({ className, children, ...rest }) => React.createElement("button", { className: classNames(className, "fake-link"), ...rest }, children);
|
|
8
|
-
const DEFAULT_TIMEOUT_LENGTH = 6e3;
|
|
9
|
-
const EbaySnackbarDialog = ({ className, onOpen = () => {
|
|
10
|
-
}, onClose = () => {
|
|
11
|
-
}, layout, open, children, onAction, ...rest }) => {
|
|
12
|
-
const eventSet = React.useRef(/* @__PURE__ */ new Set());
|
|
13
|
-
const timeoutRef = React.useRef();
|
|
14
|
-
const [isOpen, setIsOpen] = React.useState(open);
|
|
15
|
-
const childrenArray = React.Children.toArray(children);
|
|
16
|
-
const action = childrenArray.find((child) => child.type === EbaySnackbarDialogAction);
|
|
17
|
-
const content = childrenArray.filter((child) => child.type !== EbaySnackbarDialogAction);
|
|
18
|
-
const cancelCurrentCloseRequest = () => {
|
|
19
|
-
clearTimeout(timeoutRef.current);
|
|
20
|
-
};
|
|
21
|
-
const closeDialog = () => {
|
|
22
|
-
setIsOpen(false);
|
|
23
|
-
onClose();
|
|
24
|
-
};
|
|
25
|
-
const requestToCloseDialog = () => {
|
|
26
|
-
if (eventSet.current.size === 0) {
|
|
27
|
-
cancelCurrentCloseRequest();
|
|
28
|
-
timeoutRef.current = setTimeout(() => {
|
|
29
|
-
closeDialog();
|
|
30
|
-
}, DEFAULT_TIMEOUT_LENGTH);
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
const openDialog = () => {
|
|
34
|
-
setIsOpen(true);
|
|
35
|
-
onOpen();
|
|
36
|
-
requestToCloseDialog();
|
|
37
|
-
};
|
|
38
|
-
const handleFocus = () => {
|
|
39
|
-
cancelCurrentCloseRequest();
|
|
40
|
-
eventSet.current.add("focus");
|
|
41
|
-
};
|
|
42
|
-
const handleBlur = () => {
|
|
43
|
-
eventSet.current.delete("focus");
|
|
44
|
-
requestToCloseDialog();
|
|
45
|
-
};
|
|
46
|
-
const handleMouseEnter = () => {
|
|
47
|
-
cancelCurrentCloseRequest();
|
|
48
|
-
eventSet.current.add("mouseEnter");
|
|
49
|
-
};
|
|
50
|
-
const handleMouseLeave = () => {
|
|
51
|
-
eventSet.current.delete("mouseEnter");
|
|
52
|
-
requestToCloseDialog();
|
|
53
|
-
};
|
|
54
|
-
const handleAction = (event) => {
|
|
55
|
-
var _a, _b;
|
|
56
|
-
cancelCurrentCloseRequest();
|
|
57
|
-
onAction == null ? void 0 : onAction(event);
|
|
58
|
-
(_b = (_a = action == null ? void 0 : action.props) == null ? void 0 : _a.onClick) == null ? void 0 : _b.call(_a, event);
|
|
59
|
-
closeDialog();
|
|
60
|
-
};
|
|
61
|
-
React.useEffect(() => () => {
|
|
62
|
-
cancelCurrentCloseRequest();
|
|
63
|
-
}, []);
|
|
64
|
-
React.useEffect(() => {
|
|
65
|
-
if (open) {
|
|
66
|
-
openDialog();
|
|
67
|
-
} else {
|
|
68
|
-
closeDialog();
|
|
69
|
-
}
|
|
70
|
-
}, [open]);
|
|
71
|
-
return React.createElement(
|
|
72
|
-
dialogPreviousButton.DialogBaseWithState,
|
|
73
|
-
{ ...rest, open: isOpen, isModal: false, baseEl: "aside", classPrefix: "snackbar-dialog", transitionElement: "root", a11yCloseText: "", buttonPosition: "hidden", className: classNames(className, "snackbar-dialog--transition"), windowClass: layout === "column" && "snackbar-dialog__window--column", onFocus: handleFocus, onBlur: handleBlur, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave },
|
|
74
|
-
content,
|
|
75
|
-
action ? React.createElement(dialogPreviousButton.EbayDialogActions, null, React.cloneElement(action, {
|
|
76
|
-
onClick: handleAction
|
|
77
|
-
})) : null
|
|
78
|
-
);
|
|
79
|
-
};
|
|
80
|
-
exports.EbaySnackbarDialog = EbaySnackbarDialog;
|
|
81
|
-
exports.EbaySnackbarDialogAction = EbaySnackbarDialogAction;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const D=require("classnames"),e=require("react"),k=require("../dialog-previous-button-B-fysL3O.js");require("../icon-button-Bjjvld0a.js");const f=({className:r,children:c,...l})=>e.createElement("button",{className:D(r,"fake-link"),...l},c),L=6e3,N=({className:r,onOpen:c=()=>{},onClose:l=()=>{},layout:S,open:i,children:h,onAction:u,...T})=>{const n=e.useRef(new Set),b=e.useRef(),[C,m]=e.useState(i),g=e.Children.toArray(h),o=g.find(t=>t.type===f),p=g.filter(t=>t.type!==f),s=()=>{clearTimeout(b.current)},d=()=>{m(!1),l()},E=()=>{n.current.size===0&&(s(),b.current=setTimeout(()=>{d()},L))},M=()=>{m(!0),c(),E()},q=()=>{s(),n.current.add("focus")},w=()=>{n.current.delete("focus"),E()},R=()=>{s(),n.current.add("mouseEnter")},v=()=>{n.current.delete("mouseEnter"),E()},B=t=>{var a,y;s(),u==null||u(t),(y=(a=o==null?void 0:o.props)==null?void 0:a.onClick)==null||y.call(a,t),d()};return e.useEffect(()=>()=>{s()},[]),e.useEffect(()=>{i?M():d()},[i]),e.createElement(k.DialogBaseWithState,{...T,open:C,isModal:!1,baseEl:"aside",classPrefix:"snackbar-dialog",transitionElement:"root",a11yCloseText:"",buttonPosition:"hidden",className:D(r,"snackbar-dialog--transition"),windowClass:S==="column"&&"snackbar-dialog__window--column",onFocus:q,onBlur:w,onMouseEnter:R,onMouseLeave:v},p,o?e.createElement(k.EbayDialogActions,null,e.cloneElement(o,{onClick:B})):null)};exports.EbaySnackbarDialog=N;exports.EbaySnackbarDialogAction=f;
|
|
@@ -34,7 +34,7 @@ Name | Type | Stateful | Required | Description | Data
|
|
|
34
34
|
--- |---------| -- | --- | --- | ---
|
|
35
35
|
`a11yMenuText` | String | No | Yes | aria label for menu button part
|
|
36
36
|
`href` | String | No | No | url for link behaviour (switches to anchor tag)
|
|
37
|
-
`size` | String | No | No | button size: `
|
|
37
|
+
`size` | String | No | No | button size: `small` or `large`
|
|
38
38
|
`priority` | String | No | No | `primary`, `secondary` (default), `tertiary`, `none`
|
|
39
39
|
`bodyState` | String | No | No | `loading` adds progress spinner, when user interacts with button, `reset` should be called to reset `aria-live` state, default is `none`
|
|
40
40
|
`a11yButtonLoadingText` | String | No | No | `aria-label` for button when `bodyState` is `loading`
|
|
@@ -1,22 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const React = require("react");
|
|
4
|
-
const common_componentUtils_utils = require("../common/component-utils/utils/index.js");
|
|
5
|
-
const button = require("../button-B4bZIgwB.js");
|
|
6
|
-
const ebayMenuButton = require("../ebay-menu-button/index.js");
|
|
7
|
-
const menu = require("../menu-Bsy48CE1.js");
|
|
8
|
-
require("classnames");
|
|
9
|
-
const EbaySplitButton = ({ a11yMenuText, children, type, bodyState, a11yButtonLoadingText, onCollapse, onExpand, onSelect = () => {
|
|
10
|
-
}, onChange = () => {
|
|
11
|
-
}, ref, ...rest }) => {
|
|
12
|
-
const menuItemComponents = [menu.EbayMenuItem, ebayMenuButton.EbayMenuButtonSeparator];
|
|
13
|
-
const buttonLabel = common_componentUtils_utils.filterBy(children, (el) => !menuItemComponents.includes(el.type));
|
|
14
|
-
const menuItems = common_componentUtils_utils.filterByType(children, menuItemComponents);
|
|
15
|
-
return React.createElement(
|
|
16
|
-
"span",
|
|
17
|
-
{ className: "split-button" },
|
|
18
|
-
React.createElement(button.EbayButton, { "aria-label": bodyState === "loading" ? a11yButtonLoadingText : void 0, ...rest, split: "start", bodyState: bodyState === "expand" ? void 0 : bodyState }, buttonLabel),
|
|
19
|
-
React.createElement(ebayMenuButton.EbayMenuButton, { priority: rest.priority, disabled: rest.disabled, transparent: rest.transparent, size: rest.size, type, split: "end", reverse: true, a11yText: a11yMenuText, onCollapse, onExpand, onSelect, onChange }, menuItems)
|
|
20
|
-
);
|
|
21
|
-
};
|
|
22
|
-
exports.EbaySplitButton = EbaySplitButton;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react"),i=require("../utils-C9NL3q0j.js"),B=require("../button-6S4U-4HH.js"),o=require("../menu-button-label-D_04ZC3p.js"),q=require("../menu-DAOhKkcI.js");require("classnames");const f=({a11yMenuText:u,children:r,type:s,bodyState:t,a11yButtonLoadingText:l,onCollapse:c,onExpand:p,onSelect:b=()=>{},onChange:y=()=>{},ref:v,...e})=>{const a=[q.EbayMenuItem,o.EbayMenuButtonSeparator],m=i.filterBy(r,E=>!a.includes(E.type)),d=i.filterByType(r,a);return n.createElement("span",{className:"split-button"},n.createElement(B.EbayButton,{"aria-label":t==="loading"?l:void 0,...e,split:"start",bodyState:t==="expand"?void 0:t},m),n.createElement(o.EbayMenuButton,{priority:e.priority,disabled:e.disabled,transparent:e.transparent,size:e.size,type:s,split:"end",reverse:!0,a11yText:u,onCollapse:c,onExpand:p,onSelect:b,onChange:y},d))};exports.EbaySplitButton=f;
|
|
@@ -1,9 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const React = require("react");
|
|
4
|
-
const classNames = require("classnames");
|
|
5
|
-
const icon = require("../icon-B17Di3YL.js");
|
|
6
|
-
const range = require("../range-C5qzyhg4.js");
|
|
7
|
-
const stars = range.range(1, 5);
|
|
8
|
-
const EbayStarRating = ({ value, a11yText, className, ...rest }) => React.createElement("div", { role: "img", "aria-label": a11yText, className: classNames("star-rating", className), "data-stars": value, ...rest }, stars.map((i) => React.createElement(icon.EbayIcon, { key: i, className: "star-rating__icon", name: "starDynamic" })));
|
|
9
|
-
exports.EbayStarRating = EbayStarRating;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react"),c=require("classnames"),i=require("../icon-D4RDqpD4.js"),o=require("../range-DOsPN0h5.js"),l=o.range(1,5),m=({value:e,a11yText:t,className:r,...s})=>a.createElement("div",{role:"img","aria-label":t,className:c("star-rating",r),"data-stars":e,...s},l.map(n=>a.createElement(i.EbayIcon,{key:n,className:"star-rating__icon",name:"starDynamic"})));exports.EbayStarRating=m;
|
|
@@ -1,55 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const React = require("react");
|
|
4
|
-
const classNames = require("classnames");
|
|
5
|
-
const icon = require("../icon-B17Di3YL.js");
|
|
6
|
-
const range = require("../range-C5qzyhg4.js");
|
|
7
|
-
const common_randomId = require("../common/random-id/index.js");
|
|
8
|
-
const stars = range.range(1, 5);
|
|
9
|
-
const getValue = (val) => {
|
|
10
|
-
let value = parseInt(val, 0) || 0;
|
|
11
|
-
if (value > 5) {
|
|
12
|
-
value = 0;
|
|
13
|
-
}
|
|
14
|
-
return value;
|
|
15
|
-
};
|
|
16
|
-
const EbayStarRatingSelect = ({ value = 0, a11yText, className, a11yStarText = [], disabled, onChange = () => {
|
|
17
|
-
}, onFocus = () => {
|
|
18
|
-
}, onKeyDown = () => {
|
|
19
|
-
}, name, ...rest }) => {
|
|
20
|
-
const rId = common_randomId.useRandomId();
|
|
21
|
-
const inputName = name || `star-rating-${rId}`;
|
|
22
|
-
const [checkedValue, setChecked] = React.useState(getValue(value));
|
|
23
|
-
React.useEffect(() => {
|
|
24
|
-
setChecked(getValue(value));
|
|
25
|
-
}, [value]);
|
|
26
|
-
const handleKeyDown = (i) => (e) => {
|
|
27
|
-
if (!disabled) {
|
|
28
|
-
setChecked(getValue(i));
|
|
29
|
-
onKeyDown(e, { value: i });
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
const handleClick = (i) => (e) => {
|
|
33
|
-
if (!disabled) {
|
|
34
|
-
setChecked(getValue(i));
|
|
35
|
-
onChange(e, { value: i });
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
const handleFocus = (i) => (e) => {
|
|
39
|
-
if (!disabled) {
|
|
40
|
-
setChecked(getValue(i));
|
|
41
|
-
onFocus(e, { value: i });
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
return React.createElement("div", { role: a11yText && "radiogroup", "aria-label": a11yText, className: classNames("star-rating-select", className), ...rest }, stars.map((i) => React.createElement(
|
|
45
|
-
"span",
|
|
46
|
-
{ className: "star-rating-select__radio", key: i },
|
|
47
|
-
React.createElement("input", { "aria-label": a11yStarText == null ? void 0 : a11yStarText[i - 1], className: classNames("star-rating-select__control", { "star-rating-select__control--filled": i <= checkedValue }), type: "radio", name: inputName, value: i, disabled, defaultChecked: checkedValue === i, onClick: handleClick(i), onFocus: handleFocus(i), onKeyDown: handleKeyDown(i) }),
|
|
48
|
-
React.createElement(
|
|
49
|
-
"span",
|
|
50
|
-
{ className: "star-rating-select__radio-icon" },
|
|
51
|
-
React.createElement(icon.EbayIcon, { className: "star-rating__icon", name: "starDynamic" })
|
|
52
|
-
)
|
|
53
|
-
)));
|
|
54
|
-
};
|
|
55
|
-
exports.EbayStarRatingSelect = EbayStarRatingSelect;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),u=require("classnames"),v=require("../icon-D4RDqpD4.js"),y=require("../range-DOsPN0h5.js"),R=require("../forwardRef-fPwzYd82.js"),b=y.range(1,5),c=n=>{let a=parseInt(n,0)||0;return a>5&&(a=0),a},C=({value:n=0,a11yText:a,className:m,a11yStarText:l=[],disabled:s,onChange:g=()=>{},onFocus:d=()=>{},onKeyDown:f=()=>{},name:_,...p})=>{const E=R.useRandomId(),N=_||`star-rating-${E}`,[i,o]=t.useState(c(n));t.useEffect(()=>{o(c(n))},[n]);const h=e=>r=>{s||(o(c(e)),f(r,{value:e}))},k=e=>r=>{s||(o(c(e)),g(r,{value:e}))},q=e=>r=>{s||(o(c(e)),d(r,{value:e}))};return t.createElement("div",{role:a&&"radiogroup","aria-label":a,className:u("star-rating-select",m),...p},b.map(e=>t.createElement("span",{className:"star-rating-select__radio",key:e},t.createElement("input",{"aria-label":l==null?void 0:l[e-1],className:u("star-rating-select__control",{"star-rating-select__control--filled":e<=i}),type:"radio",name:N,value:e,disabled:s,defaultChecked:i===e,onClick:k(e),onFocus:q(e),onKeyDown:h(e)}),t.createElement("span",{className:"star-rating-select__radio-icon"},t.createElement(v.EbayIcon,{className:"star-rating__icon",name:"starDynamic"})))))};exports.EbayStarRatingSelect=C;
|