@ebay/ui-core-react 7.4.0 → 8.0.1-alpha.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 +0 -3
- package/button-6S4U-4HH.js +1 -0
- package/{calendar-lAu6VfAb.js → calendar-hBaLhOjI.js} +1 -1
- 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/dialog-previous-button-tKOPYyjk.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 -1
- package/ebay-breadcrumbs/index.js +1 -1
- package/ebay-button/README.md +1 -1
- package/ebay-button/button.d.ts.map +1 -1
- package/ebay-button/index.js +1 -1
- package/ebay-button/types.d.ts +1 -1
- package/ebay-button/types.d.ts.map +1 -1
- package/ebay-calendar/index.js +1 -1
- package/ebay-carousel/index.js +1 -1
- package/ebay-checkbox/index.js +1 -1
- package/ebay-confirm-dialog/index.js +1 -1
- package/ebay-cta-button/index.js +1 -1
- package/ebay-date-textbox/date-textbox.d.ts.map +1 -1
- package/ebay-date-textbox/index.js +1 -1
- 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 -1
- 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 -1
- package/ebay-fake-menu/index.js +1 -1
- 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 -1
- package/ebay-fake-menu-button/menu-button.d.ts.map +1 -1
- package/ebay-fake-tabs/index.js +1 -1
- 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 -1
- package/ebay-icon/types.d.ts +1 -1
- package/ebay-icon/types.d.ts.map +1 -1
- package/ebay-icon-button/index.js +1 -1
- 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 -1
- package/ebay-inline-notice/index.js +1 -1
- package/ebay-lightbox-dialog/README.md +2 -0
- package/ebay-lightbox-dialog/index.js +1 -1
- 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 +100 -0
- package/ebay-listbox/index.d.ts +4 -0
- package/ebay-listbox/index.d.ts.map +1 -0
- package/ebay-listbox/index.js +1 -0
- package/ebay-listbox/listbox-option-description.d.ts +4 -0
- package/ebay-listbox/listbox-option-description.d.ts.map +1 -0
- package/ebay-listbox/listbox-option.d.ts +10 -0
- package/ebay-listbox/listbox-option.d.ts.map +1 -0
- package/ebay-listbox/listbox.d.ts +21 -0
- package/ebay-listbox/listbox.d.ts.map +1 -0
- package/ebay-listbox-button/index.js +2 -2
- package/ebay-listbox-button/listbox-button.d.ts.map +1 -1
- package/ebay-menu/index.js +1 -1
- 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 -1
- package/ebay-menu-button/menu-button.d.ts.map +1 -1
- package/ebay-page-notice/index.js +1 -1
- package/ebay-pagination/index.js +1 -1
- package/ebay-panel-dialog/index.js +1 -1
- package/ebay-progress-spinner/index.js +1 -1
- package/ebay-progress-stepper/index.js +1 -1
- package/ebay-radio/index.js +1 -1
- package/ebay-section-notice/index.js +1 -1
- package/ebay-section-title/index.js +1 -1
- package/ebay-segmented-buttons/index.js +1 -1
- package/ebay-select/index.js +1 -1
- package/ebay-snackbar-dialog/index.js +1 -1
- package/ebay-split-button/README.md +1 -1
- package/ebay-split-button/index.js +1 -1
- package/ebay-star-rating/index.js +1 -1
- package/ebay-star-rating-select/index.js +1 -1
- package/ebay-svg/index.js +1 -1
- package/ebay-svg/symbols.d.ts.map +1 -1
- package/ebay-tabs/README.md +1 -3
- package/ebay-tabs/index.js +1 -1
- 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 -1
- package/ebay-toast-dialog/README.md +3 -3
- package/ebay-toast-dialog/index.js +1 -1
- package/ebay-toggle-button/index.js +1 -1
- package/ebay-toggle-button-group/index.js +1 -1
- package/ebay-tooltip/index.js +1 -1
- package/ebay-tourtip/index.js +1 -1
- package/ebay-video/index.js +1 -1
- package/events/index.js +1 -1
- 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/lightbox-dialog-CH2_V8b5.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-cta-FAd6zCdx.js +1 -0
- package/package.json +18 -79
- package/{progress-spinner-U2qOANON.js → progress-spinner-CF3qoWE3.js} +1 -1
- package/scroll-OgAngNzq.js +1 -0
- package/textbox-DZRVQetR.js +1 -0
- package/{toggle-button-D8l0YB43.js → toggle-button-CFPnYlex.js} +1 -1
- 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 -1
- package/utils/scroll.d.ts +2 -0
- package/utils/scroll.d.ts.map +1 -0
- package/utils-C9NL3q0j.js +1 -0
- package/button-DGuEBUDJ.js +0 -1
- package/common/component-utils/forwardRef/index.js +0 -1
- package/common/component-utils/index.js +0 -1
- package/common/component-utils/utils/index.js +0 -1
- package/common/event-utils/index.js +0 -1
- package/common/floating-label-utils/hooks/index.js +0 -1
- package/common/notice-utils/notice-cta/index.js +0 -1
- package/common/random-id/index.js +0 -1
- package/common/tooltip-utils/constants/index.js +0 -1
- package/common/tooltip-utils/index.js +0 -1
- package/dialog-previous-button-CpuFLkQp.js +0 -1
- package/drawer-rqXAEeqd.js +0 -1
- package/ebay-dialog-base/components/animation/index.js +0 -1
- package/ebay-dialog-base/components/dialog-footer/index.js +0 -1
- package/ebay-dialog-base/components/dialog-header/index.js +0 -1
- 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 -1
- package/ebay-fake-menu/menu-item/index.js +0 -1
- package/ebay-fake-menu-button/menu-button/index.js +0 -1
- 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 -1
- package/ebay-radio/radio/index.js +0 -1
- package/icon-TuxfQndO.js +0 -1
- package/icon-button-Cwaj-eT9.js +0 -1
- package/menu-CV-INYLM.js +0 -1
- package/menu-_LzP6yje.js +0 -1
- package/menu-button-BZ66jxvI.js +0 -1
- package/notice-footer-Cw1DMzoB.js +0 -1
- package/textbox-dUhinDwj.js +0 -1
- package/use-tooltip-CL3_zAeg.js +0 -1
package/README.md
CHANGED
|
@@ -33,10 +33,8 @@ eBayUI React components
|
|
|
33
33
|
* [x] [ebay-date-textbox](src/ebay-date-textbox)
|
|
34
34
|
* [ ] `ebay-details`
|
|
35
35
|
* [ ] `ebay-donut-chart`
|
|
36
|
-
* [x] [ebay-drawer-dialog](src/ebay-drawer-dialog)
|
|
37
36
|
* [ ] `ebay-education-notice`
|
|
38
37
|
* [x] [ebay-eek](src/ebay-eek)
|
|
39
|
-
* [x] [ebay-fullscreen-dialog](src/ebay-fullscreen-dialog)
|
|
40
38
|
* [ ] `ebay-fake-link`
|
|
41
39
|
* [x] [ebay-fake-menu](src/ebay-fake-menu)
|
|
42
40
|
* [x] [ebay-fake-menu-button](src/ebay-fake-menu-button)
|
|
@@ -46,7 +44,6 @@ eBayUI React components
|
|
|
46
44
|
* [ ] `ebay-filter-menu`
|
|
47
45
|
* [ ] `ebay-filter-menu-button`
|
|
48
46
|
* [ ] `ebay-flag`
|
|
49
|
-
* [x] [ebay-fullscreen-dialog](src/ebay-fullscreen-dialog)
|
|
50
47
|
* [x] [ebay-icon-button](src/ebay-icon-button)
|
|
51
48
|
* [x] [ebay-icon](src/ebay-icon)
|
|
52
49
|
* [ ] `ebay-image-placeholder`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("react"),k=require("classnames"),P=require("./forwardRef-fPwzYd82.js");require("./array.polyfill.flat-5BAolFdk.js");const u=require("./icon-D4RDqpD4.js"),R=require("./progress-spinner-CF3qoWE3.js"),O={cta:"cta-",fake:"fake-",expand:"expand-",default:""},y=({type:n="default",children:a,...r})=>t.createElement("span",{className:`${O[n]}btn__cell`,...r},t.createElement(t.Fragment,null,a)),T=()=>t.createElement(y,null,t.createElement(R.EbayProgressSpinner,null)),j=({className:n,children:a})=>t.createElement("span",{className:k(n,"btn__text")},a),G=({children:n})=>n?t.createElement(y,null,t.createElement(j,null,n),t.createElement(u.EbayIcon,{name:"chevronDown12"})):t.createElement(u.EbayIcon,{name:"chevronDown12"}),H=({priority:n="secondary",variant:a="standard",size:r,bodyState:m,split:q,transparent:D=!1,fluid:N=!1,disabled:E,partiallyDisabled:C,children:o,onKeyDown:S=()=>{},onEscape:I=()=>{},truncate:_=!1,href:c,className:h,forwardedRef:d,borderless:p,fixedHeight:$,...f})=>{const e=c?"fake-btn":"btn",F={primary:`${e}--primary`,secondary:`${e}--secondary`,tertiary:`${e}--tertiary`,none:""},l={large:`${e}--large`,small:`${e}--small`},L={start:`${e}--split-start`,end:`${e}--split-end`},A=a==="destructive",i=a==="form",b=m==="loading",g=m==="expand",K=i&&(M(o)||g&&!o),B=k(e,h,F[i||p?"none":n],l[r],L[q],A&&`${e}--destructive`,i&&`${e}--form`,K&&`${e}--slim`,D&&`${e}--transparent`,N&&`${e}--fluid`,_&&`${e}--truncated`,p&&`${e}--borderless`,$&&(l[r]?`${l[r]}-${$}`:`${e}--fixed-height`)),v=s=>{S(s),(s.key==="Escape"||s.key==="Esc")&&I(s)},w=J(o,{isLoading:b,isExpand:g}),x=b?"polite":null;return c?t.createElement("a",{className:B,href:E?void 0:c,ref:d,onKeyDown:v,"aria-live":x,...f},w):t.createElement("button",{disabled:E,"aria-disabled":C,"aria-live":x,className:B,ref:d,onKeyDown:v,...f},w)};function J(n,{isLoading:a,isExpand:r}){switch(!0){case a:return t.createElement(T,null);case r:return t.createElement(G,null,n);default:return n}}function M(n){const a=t.Children.toArray(n);return a.length===1&&a[0].type===u.EbayIcon}const Q=P.withForwardRef(H);exports.EbayButton=Q;exports.EbayButtonCell=y;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const a=require("react"),ue=require("./icon-button-
|
|
1
|
+
"use strict";const a=require("react"),ue=require("./icon-button-Bjjvld0a.js"),de=require("classnames");function Ue(n){const o=new Intl.Locale(n);return o.weekInfo?o.weekInfo.firstDay:0}function ve(n){const o=Ue(n),i=new Intl.DateTimeFormat(n,{weekday:"short"}),d=new Date(2022,9,2+o),A=[...Array(7)].map(()=>{const k=i.format(d);return d.setDate(d.getDate()+1),k});return{firstDayOfWeek:o,weekdayLabels:A}}function Ae(n){if(n)return/^\d\d\d\d-\d\d-\d\d$/g.test(n)?n:u(new Date(n))}function u(n){if(!isNaN(n.getTime()))return n.toISOString().slice(0,10)}function v(n){return new Date(n)}function H(n,o){const i=v(n);return i.setUTCDate(i.getUTCDate()+o),u(i)}function fe(n){return n||navigator.language}const Fe={ArrowRight:1,ArrowLeft:-1,ArrowDown:7,ArrowUp:-7},Re=({selected:n,numMonths:o=1,navigable:i,interactive:d,range:A,locale:k,disableBefore:g,disableAfter:I,disableWeekdays:B,disableList:G,a11ySelectedText:me="selected",a11yRangeStartText:ye="start of range",a11yInRangeText:ge="in range",a11yRangeEndText:Ie="end of range",a11ySeparator:J="-",a11yTodayText:De="today",a11yDisabledText:Se="inactive",getA11yShowMonthText:Q=T=>`Show ${T}`,linkBuilder:X,onMonthChange:Z=()=>{},onFocus:we=()=>{},onSelect:Ee=()=>{}})=>{const T=u(new Date),{firstDayOfWeek:Oe,weekdayLabels:Te}=ve(fe(k)),ee=a.useRef(null),[m,F]=a.useState(0),[te,ne]=a.useState(null),[D,h]=a.useState(T),R=a.useRef(T),S=e=>{const t=v(R.current);return new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth()+e))},w=()=>u(S(m)),E=()=>{const e=v(R.current);return u(new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth()+m+(o||1),0)))};a.useEffect(()=>{if(n){const e=Array.isArray(n)?n:[n],t=w(),r=E();e.find(f=>f>=t&&f<=r)===void 0&&(R.current=e[0],F(0))}},[n]);const be=()=>{if(n&&A){let e,t;if(Array.isArray(n)?[e,t]=n:te&&(e=n,t=te),e&&t){const[r,s]=[e,t].sort();return{rangeStart:r,rangeEnd:s}}}return{rangeStart:null,rangeEnd:null}},p=e=>new Intl.DateTimeFormat(fe(k),{month:"long",year:"numeric"}).format(new Date(e.getUTCFullYear(),e.getUTCMonth())),_=e=>g&&e<g||I&&e>I||B&&B.includes(v(e).getUTCDay())||G&&G.includes(e),ae=()=>{let e=w();const t=E();for(;e<=t&&_(e);)e=H(e,1);return e>t?null:e},re=()=>{let e=E();const t=w();for(;e>=t&&_(e);)e=H(e,-1);return e<t?null:e},b=e=>{h(e),setTimeout(()=>{var r;const t=(r=ee.current)==null?void 0:r.querySelector(`[data-iso="${e}"]`);t==null||t.focus()})},N=e=>{if(g&&w()<=g)return!1;F(s=>s-1);let t=D;const r=re();return r&&r<D&&(t=r,h(r)),e&&b(t),Z({iso:u(S(m))}),!0},L=e=>{if(I&&E()>=I)return!1;F(s=>s+1);let t=D;const r=ae();r&&r>D&&(t=r,h(r)),e&&b(t),Z({iso:u(S(m+(o||1)))})},ke=e=>{const t=Fe[e.key];if(t){e.preventDefault();let r=7,s=D;do s=H(s,t);while(r-- >0&&_(s));if(r>0){const f=w(),O=E();s<f?i?N():s=f:s>O&&(i?L():s=O),b(s)}}else switch(e.key){case"PageUp":N(!0);break;case"PageDown":L(!0);break;case"Home":b(ae());break;case"End":b(re());break}},he=(e,t)=>{Ee(e,{iso:t})},se=(e,t)=>{ne(t),h(t),we(e,{iso:t})},ce=()=>{ne(null)},{rangeStart:V,rangeEnd:x}=be(),pe=e=>!(!V||!x||e<V||e>x),oe=[...Array(o)].map((e,t)=>S(m+t));return a.createElement("div",{className:"calendar",ref:ee},i&&a.createElement("div",{className:"calendar__header"},a.createElement("div",{className:"calendar__header--inner"},a.createElement(ue.EbayIconButton,{transparent:!0,size:"small",icon:"chevronLeft24",disabled:g&&w()<=g,"aria-label":Q(p(S(m-1))),onClick:()=>N()}),oe.map((e,t)=>a.createElement("h3",{key:t},p(e))),a.createElement(ue.EbayIconButton,{transparent:!0,size:"small",icon:"chevronRight24",disabled:I&&E()>=I,"aria-label":Q(p(S(m+o))),onClick:()=>L()}))),a.createElement("div",{className:"calendar__body"},oe.map((e,t)=>{const r=(e.getUTCDay()-Oe+7)%7,s=e.getUTCFullYear(),f=e.getUTCMonth(),O=new Date(s,f+1,0).getDate(),_e=[...Array(Math.ceil((r+O)/7))];return a.createElement("div",{key:t,className:"calendar__month"},a.createElement("table",{onKeyDown:ke},a.createElement("caption",null,p(e)),a.createElement("thead",null,a.createElement("tr",null,Te.map(M=>a.createElement("th",{key:M,scope:"col"},M)))),a.createElement("tbody",null,_e.map((M,Y)=>{let $=Y*7-r+1,q=$+6;const P=[];Y===0&&r!==0?($=1,P.push(a.createElement("td",{key:"pre-column",colSpan:r}))):q>O&&(q=O);for(let y=$;y<=q;y++){const c=u(new Date(Date.UTC(s,f,y))),W=c===T,j=Array.isArray(n)?n.some(l=>l===c):n===c,z=c===V,le=pe(c),K=c===x,C=_(c),U=["",j&&me,z&&ye,!z&&!K&&le&&ge,K&&Ie,!d&&W&&De,!d&&C&&Se].filter(l=>typeof l!="boolean"||l!==!1),ie=!d&&!C&&X&&X(c),Ce=ie?"a":"span";P.push(a.createElement("td",{key:y,className:de({"calendar__cell--selected":j,"calendar__range--start":z,calendar__range:le,"calendar__range--end":K})},d?a.createElement("button",{disabled:C,"aria-label":U.length>1?`${y}${U.join(J)}`:void 0,tabIndex:D!==c?-1:void 0,"aria-current":W?"date":void 0,"aria-pressed":j?"true":void 0,onClick:l=>he(l,c),onFocus:l=>se(l,c),onMouseOver:l=>se(l,c),onMouseOut:l=>ce(),onBlur:()=>ce(),"data-iso":c},y):a.createElement(Ce,{className:de({"calendar__cell--disabled":C,"calendar__cell--current":W}),href:ie},y,U.length>1&&a.createElement("span",{className:"clipped"},U.join(J)))))}return a.createElement("tr",{key:Y},P)}))))})))};exports.EbayCalendar=Re;exports.dateArgToISO=Ae;exports.toISO=u;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { useFloating } from '@floating-ui/react';
|
|
2
|
+
export type FloatingDropdownHookReturn = {
|
|
3
|
+
overlayStyles: ReturnType<typeof useFloating>['floatingStyles'];
|
|
4
|
+
refs: {
|
|
5
|
+
host: ReturnType<typeof useFloating>['refs']['reference'];
|
|
6
|
+
overlay: ReturnType<typeof useFloating>['refs']['floating'];
|
|
7
|
+
setHost: ReturnType<typeof useFloating>['refs']['setReference'];
|
|
8
|
+
setOverlay: ReturnType<typeof useFloating>['refs']['setFloating'];
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export type FloatingDropdownHookArgs = {
|
|
12
|
+
open?: boolean;
|
|
13
|
+
options?: FloatingDropdownHookOptions;
|
|
14
|
+
};
|
|
15
|
+
export type FloatingDropdownHookOptions = {
|
|
16
|
+
offset?: number;
|
|
17
|
+
reverse?: boolean;
|
|
18
|
+
};
|
|
19
|
+
export declare function useFloatingDropdown({ open, options }: FloatingDropdownHookArgs): FloatingDropdownHookReturn;
|
|
20
|
+
//# sourceMappingURL=dropdown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dropdown.d.ts","sourceRoot":"","sources":["../../src/common/dropdown.ts"],"names":[],"mappings":"AAAA,OAAO,EAKH,WAAW,EACd,MAAM,oBAAoB,CAAA;AAE3B,MAAM,MAAM,0BAA0B,GAAG;IACrC,aAAa,EAAE,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC,gBAAgB,CAAC,CAAA;IAC/D,IAAI,EAAE;QACF,IAAI,EAAE,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,CAAA;QACzD,OAAO,EAAE,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC,UAAU,CAAC,CAAA;QAC3D,OAAO,EAAE,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC,cAAc,CAAC,CAAA;QAC/D,UAAU,EAAE,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC,CAAA;KACpE,CAAA;CACJ,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG;IACnC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,2BAA2B,CAAA;CACxC,CAAA;AAED,MAAM,MAAM,2BAA2B,GAAG;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB,CAAA;AAED,wBAAgB,mBAAmB,CAAC,EAChC,IAAI,EACJ,OAAO,EACV,EAAE,wBAAwB,GAAG,0BAA0B,CAiBvD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../src/common/floating-label-utils/hooks.tsx"],"names":[],"mappings":"AAAA,OAAc,EAA+B,EAAE,EAAE,SAAS,EAAe,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAGjH,KAAK,QAAQ,GAAG,SAAS,CAAC,iBAAiB,GAAG,mBAAmB,GAAG,gBAAgB,CAAC,GAAG,GAAG,CAAA;AAC3F,KAAK,sBAAsB,GAAG;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,QAAQ,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IAChC,UAAU,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB,CAAA;AAED,KAAK,uBAAuB,GAAG;IAC3B,KAAK,EAAE,SAAS,CAAC;IACjB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,EAAE,EAAE,CAAC;QAAE,QAAQ,CAAC,EAAE,SAAS,CAAA;KAAE,CAAC,CAAC;IACxC,GAAG,EAAE,QAAQ,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;CACvB,CAAA;
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../src/common/floating-label-utils/hooks.tsx"],"names":[],"mappings":"AAAA,OAAc,EAA+B,EAAE,EAAE,SAAS,EAAe,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAGjH,KAAK,QAAQ,GAAG,SAAS,CAAC,iBAAiB,GAAG,mBAAmB,GAAG,gBAAgB,CAAC,GAAG,GAAG,CAAA;AAC3F,KAAK,sBAAsB,GAAG;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,QAAQ,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IAChC,UAAU,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB,CAAA;AAED,KAAK,uBAAuB,GAAG;IAC3B,KAAK,EAAE,SAAS,CAAC;IACjB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,EAAE,EAAE,CAAC;QAAE,QAAQ,CAAC,EAAE,SAAS,CAAA;KAAE,CAAC,CAAC;IACxC,GAAG,EAAE,QAAQ,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;CACvB,CAAA;AA2CD,wBAAgB,gBAAgB,CAAC,EAC7B,GAAG,EACH,OAAO,EACP,SAAS,EACT,QAAQ,EACR,KAAK,EACL,SAAS,EACT,UAAU,EACV,WAAW,EACX,OAAO,EACP,WAAW,EACX,IAAI,EACJ,OAAkB,EACrB,EAAG,sBAAsB,GAAG,uBAAuB,CA8EnD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const n=require("react"),oe=require("react-remove-scroll"),L=require("classnames"),w=require("makeup-screenreader-trap"),b=require("makeup-keyboard-trap"),ie=require("./icon-D4RDqpD4.js"),ce=require("./forwardRef-fPwzYd82.js"),le=require("./icon-button-Bjjvld0a.js"),p=({children:t,...e})=>n.createElement("h2",{...e},t),R=({children:t})=>n.createElement(n.Fragment,null,t),N=({children:t})=>n.createElement(n.Fragment,null,t);function U({open:t,classPrefix:e,transitionElement:a,dialogRef:i,dialogWindowRef:d,enabled:u,onTransitionEnd:o}){const c=n.useRef(t);n.useLayoutEffect(()=>{if(!u)return;let l=[d,i];a==="window"?l=[d]:a==="root"&&(l=[i]);let s;return t?s=se({dialog:i,waitFor:l,classPrefix:e,onTransitionEnd:o}):c.current!==t&&(s=ue({dialog:i,waitFor:l,classPrefix:e,onTransitionEnd:o})),c.current=t,()=>{s&&s()}},[t,u])}function se({dialog:t,waitFor:e,classPrefix:a,onTransitionEnd:i}){return X(t,e,`${a}--show`,i)}function ue({dialog:t,waitFor:e,classPrefix:a,onTransitionEnd:i}){return X(t,e,`${a}--hide`,i)}function X(t,e,a,i){if(!t.current||!a)return;let d=0;const u=e?e.length:0,o=`${a}-init`;return t.current.classList.add(o),de(()=>{t.current&&(t.current.classList.add(a),t.current.classList.remove(o),e.forEach(c=>{const l=()=>{var s,f;++d===u&&((s=t.current)==null||s.classList.remove(a),i(),(f=c.current)==null||f.removeEventListener("transitionend",l))};c.current.addEventListener("transitionend",l,{once:!0})}))})}function de(t){let e,a;return window.requestAnimationFrame?(e=window.requestAnimationFrame(()=>{e=window.requestAnimationFrame(t)}),a=window.cancelAnimationFrame):(e=window.setTimeout(t,26),a=window.clearTimeout),()=>{e&&(a(e),e=void 0)}}var J;const $=(J=w==null?void 0:w.default)!=null&&J.__esModule?w.default:w;var Q;const q=(Q=b==null?void 0:b.default)!=null&&Q.__esModule?b.default:b,me=({baseEl:t="div",classPrefix:e="drawer-dialog",windowClass:a,windowType:i,mainId:d,top:u,header:o,buttonPosition:c="right",children:l,ariaLabelledby:s,a11yCloseText:f,onCloseBtnClick:h=()=>{},footer:D,actions:g,onScroll:k,open:r=!1,onOpen:A=()=>{},onBackgroundClick:S=()=>{},ignoreEscape:Y,closeButton:Z,previousButton:j,isModal:B,role:x="dialog",focus:I,transitionElement:P,animated:H,closeButtonClass:ee,...O})=>{var G;const W=n.useRef(null),E=n.useRef(null),K=n.useRef(null),[te,ne]=n.useState("");n.useEffect(()=>{ne(ce.randomId())},[]),n.useEffect(()=>{let m;const y=v=>{E.current&&!E.current.contains(v.target)&&S(v)};return r&&c!=="hidden"&&(m=window.setTimeout(()=>{document.addEventListener("click",y,!1)})),()=>{clearTimeout(m),document.removeEventListener("click",y,!1)}},[S,r]),n.useEffect(()=>(r&&B?($.trap(E.current),q.trap(E.current)):($.untrap(),q.untrap()),()=>{$.untrap(),q.untrap()}),[r,B]),U({open:r,classPrefix:e,transitionElement:P,dialogRef:W,dialogWindowRef:E,enabled:H,onTransitionEnd:()=>M(r)});const F=m=>{!Y&&m.key==="Escape"&&(m.stopPropagation(),h(m))};n.useEffect(()=>{H||M(r),r&&A()},[r]);function M(m){var y,v;if(m)return I?(y=I.current)==null||y.focus():B&&((v=K.current)==null||v.focus()),document.addEventListener("keydown",F,!1),()=>document.removeEventListener("keydown",F,!1)}const V=c!=="hidden"&&n.createElement("button",{ref:K,className:L("icon-btn",ee,`${e}__close`,{"icon-btn--transparent":e==="toast-dialog"}),type:"button","aria-label":f,onClick:h},Z||n.createElement(ie.EbayIcon,{name:"close16"})),re=i?`${e}__${i}-window`:`${e}__window`,z=((G=o==null?void 0:o.props)==null?void 0:G.id)||`dialog-title-${te}`,ae=s||z,_=o?n.cloneElement(o,{...o.props,id:z}):null;return n.createElement(t,{...O,"aria-labelledby":ae,"aria-modal":"true",role:x,hidden:!r,className:L(e,O.className),"aria-live":B?void 0:"polite",ref:W,onKeyDown:F},n.createElement("div",{className:L(re,a),ref:E},u,_&&n.createElement("div",{className:`${e}__header`},j,c==="right"&&_,c!=="bottom"&&V,(c==="left"||c==="hidden")&&_),n.createElement("div",{id:d,className:`${e}__main`,onScroll:k},l),g?n.createElement("div",{className:`${e}__actions`},g):null,D||c==="bottom"?n.createElement("div",{className:`${e}__footer`},D,c==="bottom"&&V):null))},fe=({isModal:t,open:e,children:a,animated:i=!0,...d})=>{const u=t!==!1,o=n.Children.toArray(a),c=o.find(r=>r.type===p),l=o.find(r=>r.type===R),s=o.find(r=>r.type===C),f=o.find(r=>r.type===N),h=o.find(r=>r.type===T),D=o.filter(r=>![p,R,N,C,T].some(A=>A===r.type)),g=n.createElement(me,{...d,open:e,isModal:u,header:c,footer:l,actions:s,closeButton:f,previousButton:h,animated:i},D);return i||e?u?n.createElement(oe.RemoveScroll,{enabled:e},g):g:null},C=({children:t})=>n.createElement(n.Fragment,null,t),T=({className:t,icon:e,...a})=>n.createElement(le.EbayIconButton,{...a,icon:e||"chevronLeft16",className:L(t,"lightbox-dialog__prev")});exports.DialogBaseWithState=fe;exports.EbayDialogActions=C;exports.EbayDialogCloseButton=N;exports.EbayDialogFooter=R;exports.EbayDialogHeader=p;exports.EbayDialogPreviousButton=T;exports.useDialogAnimation=U;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("@floating-ui/react");function s({open:l,options:e}){const{floatingStyles:a,refs:r}=t.useFloating({placement:e!=null&&e.reverse?"bottom-end":"bottom-start",open:l,middleware:[t.offset((e==null?void 0:e.offset)??4),t.flip(),t.shift()],whileElementsMounted:t.autoUpdate});return{overlayStyles:a,refs:{host:r.reference,overlay:r.floating,setHost:r.setReference,setOverlay:r.setFloating}}}exports.useFloatingDropdown=s;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# EbayAccordion
|
|
2
|
+
|
|
3
|
+
## Demo
|
|
4
|
+
|
|
5
|
+
[Storybook](https://opensource.ebay.com/ebayui-core-react/main/?path=/story/navigation-disclosure-ebay-accordion--default)
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
### Import JS
|
|
10
|
+
|
|
11
|
+
```jsx harmony
|
|
12
|
+
import { EbayAccordion, EbayDetails } from "@ebay/ui-core-react/ebay-accordion";
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
### Import following styles from SKIN
|
|
16
|
+
|
|
17
|
+
```jsx harmony
|
|
18
|
+
import "@ebay/skin/accordion";
|
|
19
|
+
import "@ebay/skin/details";
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### If tokens haven't been added to the project at a higher level, make sure to import
|
|
23
|
+
|
|
24
|
+
```jsx harmony
|
|
25
|
+
import "@ebay/skin/tokens";
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Or import styles using SCSS/CSS
|
|
29
|
+
|
|
30
|
+
```jsx harmony
|
|
31
|
+
import "@ebay/skin/accordion.css";
|
|
32
|
+
import "@ebay/skin/details.css";
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
```jsx harmony
|
|
36
|
+
<EbayAccordion>
|
|
37
|
+
<EbayDetails text="Details summary">
|
|
38
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore
|
|
39
|
+
magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
|
|
40
|
+
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
|
|
41
|
+
pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est
|
|
42
|
+
laborum.
|
|
43
|
+
</EbayDetails>
|
|
44
|
+
|
|
45
|
+
<EbayDetails text="Second summary">
|
|
46
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore
|
|
47
|
+
magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
|
|
48
|
+
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
|
|
49
|
+
pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est
|
|
50
|
+
laborum.
|
|
51
|
+
</EbayDetails>
|
|
52
|
+
</EbayAccordion>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Attributes
|
|
56
|
+
|
|
57
|
+
| Name | Type | Required | Description | Data |
|
|
58
|
+
| -------------- | -------- | -------- | ----------------------------------------------------------------------- | --------------------------------- |
|
|
59
|
+
| `size` | String | No | Size of the details, `regular` or `large` | |
|
|
60
|
+
| `autoCollapse` | Boolean | No | Whether accordion panels should be autocollapsed when another is opened | |
|
|
61
|
+
| `onToggle` | Function | No | Triggered on toggle | `(event: Event, { open, index })` |
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ComponentProps, FC, ReactElement } from 'react';
|
|
2
|
+
import { EbayDetailsProps } from '../ebay-details';
|
|
3
|
+
import { EbayEventHandler } from '../events';
|
|
4
|
+
type ToggleProps = {
|
|
5
|
+
open: boolean;
|
|
6
|
+
index: number;
|
|
7
|
+
};
|
|
8
|
+
export type EbayAccordionProps = ComponentProps<'ul'> & {
|
|
9
|
+
size?: 'regular' | 'large';
|
|
10
|
+
autoCollapse?: boolean;
|
|
11
|
+
children: ReactElement<EbayDetailsProps> | ReactElement<EbayDetailsProps>[];
|
|
12
|
+
onToggle?: EbayEventHandler<HTMLDetailsElement, ToggleProps>;
|
|
13
|
+
};
|
|
14
|
+
declare const EbayAccordion: FC<EbayAccordionProps>;
|
|
15
|
+
export default EbayAccordion;
|
|
16
|
+
//# sourceMappingURL=accordion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accordion.d.ts","sourceRoot":"","sources":["../../src/ebay-accordion/accordion.tsx"],"names":[],"mappings":"AACA,OAAc,EAAE,cAAc,EAAE,EAAE,EAAE,YAAY,EAAU,MAAM,OAAO,CAAA;AACvE,OAAO,EAAe,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAE/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AAE5C,KAAK,WAAW,GAAG;IACf,IAAI,EAAE,OAAO,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG,cAAc,CAAC,IAAI,CAAC,GAAG;IACpD,IAAI,CAAC,EAAE,SAAS,GAAG,OAAO,CAAA;IAC1B,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,QAAQ,EAAE,YAAY,CAAC,gBAAgB,CAAC,GAAG,YAAY,CAAC,gBAAgB,CAAC,EAAE,CAAA;IAC3E,QAAQ,CAAC,EAAE,gBAAgB,CAAC,kBAAkB,EAAE,WAAW,CAAC,CAAA;CAC/D,CAAA;AAED,QAAA,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,CAsDzC,CAAA;AAED,eAAe,aAAa,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ebay-accordion/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAC/E,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("classnames"),r=require("react"),d=require("../ebay-details-q_d7qlcN.js"),R=require("../utils-C9NL3q0j.js"),S=({size:f,autoCollapse:E,className:b,children:h,onToggle:c,"aria-roledescription":p="accordion",...m})=>{const o=r.useRef(null),i=R.filterByType(h,d.EbayDetails);if(!i.length)throw new Error(`EbayAccordion: Please use a
|
|
2
|
+
EbayDetails that defines the sections of the accordion`);const q=i.map((e,s)=>r.cloneElement(e,{onToggle:(l,{open:a})=>{var n,u,y;if(E&&a){const t=(n=o.current)==null?void 0:n.querySelectorAll("details");t==null||t.forEach((A,D)=>{D!==s&&(A.open=!1)})}(y=(u=e.props).onToggle)==null||y.call(u,l,{open:a}),c==null||c(l,{open:a,index:s})},layout:"accordion"}));return r.createElement("ul",{...m,ref:o,className:P("accordion",b,{"accordion--large":f==="large"}),"aria-roledescription":p},q.map(e=>r.createElement("li",{key:e.key},e)))};exports.EbayDetails=d.EbayDetails;exports.EbayAccordion=S;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),d=require("classnames"),r=require("../dialog-previous-button-tKOPYyjk.js");require("../icon-button-Bjjvld0a.js");const u=require("../button-6S4U-4HH.js"),a="alert-dialog",g=({a11yCloseText:l="Close Dialog",confirmText:n,onConfirm:s=()=>{},...o})=>{const t=e.useRef(null),c="alert-dialog-confirm",i="alert-dialog-main";return e.createElement(r.DialogBaseWithState,{focus:t,...o,a11yCloseText:l,role:"alertdialog",classPrefix:a,ignoreEscape:!0,mainId:i,buttonPosition:"hidden",className:d(o.className,`${a}--mask-fade`),windowClass:`${a}__window ${a}__window--fade`},o.children,e.createElement(r.EbayDialogFooter,null,e.createElement(u.EbayButton,{priority:"primary","aria-describedby":i,onClick:s,ref:t,id:c,className:"alert-dialog__acknowledge"},n)))};exports.EbayAlertDialog=g;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),v=require("classnames"),f=require("../icon-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),v=require("classnames"),f=require("../icon-D4RDqpD4.js"),k=({a11yHeadingText:t="Page navigation",a11yHeadingTag:r="h2",id:i="ebay-breadcrumb",children:n=[],className:l,onSelect:s=()=>{},...a})=>{const c=`${i}-breadcrumbs-heading`,d=e.Children.count(n)-1,u=r,m=e.Children.toArray(n).some(o=>o.props.href)?"a":"button";return e.createElement("nav",{...a,"aria-labelledby":c,className:v("breadcrumbs",l),role:"navigation"},e.createElement(u,{id:c,className:"clipped"},t),e.createElement("ul",null,e.Children.map(n,(o,b)=>{const h=b===d,{href:g,children:y}=o.props,E={tag:m,isLastItem:h,href:g,children:y,onClick:p=>s(p)};return e.cloneElement(o,E)})))},C=({tag:t="button",isLastItem:r=!1,href:i,children:n,onClick:l,...s})=>{const a=t==="a",c={...s,...r?{"aria-current":"location"}:{},href:a?i:void 0,onClick:a?void 0:l};return e.createElement("li",null,e.createElement(t,{...c},n),!r&&e.createElement(f.EbayIcon,{name:"chevronRight12"}))};exports.EbayBreadcrumbItem=C;exports.EbayBreadcrumbs=k;
|
package/ebay-button/README.md
CHANGED
|
@@ -50,7 +50,7 @@ Name | Type | Stateful | Required | Description | Data
|
|
|
50
50
|
--- | --- | --- | --- | --- | ---
|
|
51
51
|
`priority` | String | No | No | `primary`, `secondary` (default), `tertiary`, `none`
|
|
52
52
|
`variant` | String | Yes | No | `standard` (default), `destructive`, `form`
|
|
53
|
-
`size` | String | No | No | `
|
|
53
|
+
`size` | String | No | No | `small` or `large`
|
|
54
54
|
`bodyState` | String | No | No | `loading`, `expand`
|
|
55
55
|
`href` | String | No | No | for link that looks like a button
|
|
56
56
|
`fluid` | Boolean | No | No | takes the whole width of the parent element
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/ebay-button/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAEV,cAAc,EAEd,aAAa,EACb,UAAU,EAGV,SAAS,EACZ,MAAM,OAAO,CAAA;AAGd,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAKnE,MAAM,MAAM,eAAe,GAAG;IAC1B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;IAClC,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,aAAa,CAAC,iBAAiB,GAAG,iBAAiB,CAAC,KAAK,IAAI,CAAC;IAC7E,YAAY,CAAC,EAAE,SAAS,CAAC,iBAAiB,GAAG,iBAAiB,CAAC,CAAC;IAChE,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;CACzB,CAAA;AAED,KAAK,KAAK,GAAG,cAAc,CAAC,QAAQ,CAAC,GAAG,cAAc,CAAC,GAAG,CAAC,GAAG,eAAe,CAAC;;
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/ebay-button/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAEV,cAAc,EAEd,aAAa,EACb,UAAU,EAGV,SAAS,EACZ,MAAM,OAAO,CAAA;AAGd,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAKnE,MAAM,MAAM,eAAe,GAAG;IAC1B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;IAClC,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,aAAa,CAAC,iBAAiB,GAAG,iBAAiB,CAAC,KAAK,IAAI,CAAC;IAC7E,YAAY,CAAC,EAAE,SAAS,CAAC,iBAAiB,GAAG,iBAAiB,CAAC,CAAC;IAChE,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;CACzB,CAAA;AAED,KAAK,KAAK,GAAG,cAAc,CAAC,QAAQ,CAAC,GAAG,cAAc,CAAC,GAAG,CAAC,GAAG,eAAe,CAAC;;AAoH9E,wBAAyC"}
|
package/ebay-button/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../button-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../button-6S4U-4HH.js");exports.EbayButton=t.EbayButton;exports.EbayButtonCell=t.EbayButtonCell;
|
package/ebay-button/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type Priority = 'primary' | 'secondary' | 'tertiary' | 'none';
|
|
2
2
|
export type Variant = 'standard' | 'destructive' | 'form';
|
|
3
|
-
export type Size = '
|
|
3
|
+
export type Size = 'small' | 'large';
|
|
4
4
|
export type BodyState = 'loading' | 'expand' | 'reset' | 'none';
|
|
5
5
|
export type Split = 'start' | 'end';
|
|
6
6
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/ebay-button/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,MAAM,CAAA;AAEpE,MAAM,MAAM,OAAO,GAAG,UAAU,GAAG,aAAa,GAAG,MAAM,CAAA;AAEzD,MAAM,MAAM,IAAI,GAAG,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/ebay-button/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,MAAM,CAAA;AAEpE,MAAM,MAAM,OAAO,GAAG,UAAU,GAAG,aAAa,GAAG,MAAM,CAAA;AAEzD,MAAM,MAAM,IAAI,GAAG,OAAO,GAAG,OAAO,CAAA;AAEpC,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAA;AAE/D,MAAM,MAAM,KAAK,GAAG,OAAO,GAAG,KAAK,CAAC"}
|
package/ebay-calendar/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../calendar-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../calendar-hBaLhOjI.js");exports.EbayCalendar=e.EbayCalendar;
|
package/ebay-carousel/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react"),S=require("classnames"),z=require("../icon-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react"),S=require("classnames"),z=require("../icon-D4RDqpD4.js"),x=require("../debounce-BQsYxxOL.js"),A=require("../forwardRef-fPwzYd82.js");require("../array.polyfill.flat-5BAolFdk.js");const D={prev:"chevronLeft16",next:"chevronRight16"},V={prev:"LEFT",next:"RIGHT"},q=({type:e,label:t,hidden:n,disabled:r,onClick:l})=>{const c=s=>{l(s,{direction:V[e]})};return o.createElement("button",{className:S("carousel__control",`carousel__control--${e}`),"aria-label":t,"aria-disabled":r,disabled:r,onClick:c},o.createElement(z.EbayIcon,{className:S("icon",`icon--carousel-${e}`),focusable:!1,name:D[e],"aria-hidden":n}))};function H(e){const t=e.parentElement,n=t?t.firstElementChild.getBoundingClientRect().left:0,{left:r,right:l}=e.getBoundingClientRect();return{left:r-n,right:l-n}}const W=e=>getComputedStyle(e).overflowX!=="visible",y=(e,t)=>{if(!e.length)return 0;const n=e[e.length-1];return Math.max(n.right-t,0)||0},j=(e,t,n)=>e.length&&Math.min(e[t].left,y(e,n))||0,G=(e,t,n,r,l,c)=>o.Children.map(e,(s,a)=>{const{style:i={}}=s.props;let d;if(n){const u=n+n%1;d=`calc(${100/u}% - ${(u-1)*c/u}px)`}const f=n?a%n===0:!0;return o.cloneElement(s,{...s.props,slideWidth:r,offset:l,ref:u=>{t.current[a]=u},className:f?"carousel__snap-point":s.props.className,style:{...i,width:d||i.width,marginRight:c&&a!==o.Children.count(e)-1?`${c}px`:i.marginRight}})}),O=(e,t,n)=>{if(e>0){let r=e;return r%=t.length||1,r-=r%(n||1),r=Math.abs(r),r}return 0},X=(e,t,n=e)=>{if(t)return Math.ceil(n/t)},J=e=>e==="LEFT"?-1:1,K=(e,t,n,r,l)=>{let c=t,s;if(e==="LEFT"&&c===0)c=n.length-1;else{do{const a=J(e);s=n[c+=a]}while(s&&s.fullyVisible);if(e==="LEFT"&&!l){const a=s.right-r;do s=n[--c];while(s&&s.left>=a);c+=1}}return O(c,n,l)},Q=(e,t,n,r=1,l)=>{let c;if(e>=y(t,n)-l)c=t.length-1;else{const s=t.length;let a=0,i=Math.ceil(s/r)-1;for(;i-a>1;){const u=Math.floor((a+i)/2);e>t[u*r].left?a=u:i=u}const d=Math.abs(e-t[a*r].left),f=Math.abs(e-t[i*r].left);c=O((d>f?i:a)*r,t,r)}return c},U=(e,t)=>{let n,r,l;return function c(){const{scrollLeft:s}=e;if(l!==s){l=s,n=setTimeout(()=>{r=requestAnimationFrame(c)},90);return}t(l)}(),()=>{clearTimeout(n),cancelAnimationFrame(r)}},Y=typeof window<"u"&&"scrollBehavior"in document.body.style;function B(e,t,n){if(Y)return e.scrollTo({left:t}),U(e,n);let r,l,c=requestAnimationFrame(u=>{const{scrollLeft:g}=e,L=t-g,h=450;(function T(C){const m=C-u;if(m>h)return e.scrollLeft=t,s(),n();e.scrollLeft=Z(m/h)*L+g,c=requestAnimationFrame(T)})(u)});return e.addEventListener("touchstart",a),s;function s(){cancelAnimationFrame(c),r===void 0?d():(l&&l(),f())}function a(){s(),r=e.scrollLeft,e.addEventListener("touchend",i)}function i(){f(),r===e.scrollLeft&&(l=B(e,t,n))}function d(){e.removeEventListener("touchstart",a)}function f(){e.removeEventListener("touchend",i)}}function Z(e){return e<.5?2*e*e:-1+(4-2*e)*e}const P=({gap:e=16,itemsPerSlide:t,slideWidth:n,offset:r,activeIndex:l,nextControlDisabled:c,className:s,itemsRef:a,children:i,onSetActiveIndex:d,onScroll:f})=>{const[u,g]=o.useState(0),[L,h]=o.useState(!1),[T,C]=o.useState(!1),m=o.useRef(null),E=o.useRef(null);o.useEffect(()=>{if(!o.Children.count(i)||!m.current)return;if(L){h(!1);return}const b=m.current;W(b)?(C(!0),B(b,r,()=>C(!1))):g(r)},[r]);const p=o.useCallback(()=>{const v=m.current.scrollLeft,b=Q(v,a.current,n,t,e);b!==l&&(h(!0),d(b),f({index:b}))},[m.current,a.current,n,l,d]),R=()=>{E.current&&clearTimeout(E.current),E.current=setTimeout(()=>{T||p()},640)};return o.createElement("div",{className:S("carousel__viewport",{"carousel__viewport--mask":!c},s)},o.createElement("ul",{className:"carousel__list",ref:m,onScroll:R,style:{transform:`translate3d(${-u}px, 0, 0)`}},G(i,a,t,n,r,e)))},ee=({gap:e=16,index:t=0,itemsPerSlide:n,a11yPreviousText:r,a11yNextText:l,onScroll:c=()=>{},onNext:s=()=>{},onPrevious:a=()=>{},onSlide:i=()=>{},className:d,children:f,...u})=>{const[g,L]=o.useState(t),[h,T]=o.useState(0),[C,m]=o.useState(0),E=o.useRef(null),p=o.useRef([]),R=o.Children.count(f),v=Math.floor(n)||void 0,b=R<=v,I=b||C===0,_=b||C===y(p.current,h),N=()=>{if(!E.current)return;const{width:w}=E.current.getBoundingClientRect();T(w)};o.useEffect(()=>(window.addEventListener("resize",x.debounce(N,16)),()=>{window.removeEventListener("resize",x.debounce(N,16))}),[]),o.useEffect(()=>{m(j(p.current,g,h))},[g,h]),o.useEffect(()=>{t>=0&&t<=R-1&&L(t)},[t]),o.useEffect(()=>{p.current=p.current.splice(0,R)},[f]),o.useEffect(()=>{const{width:w}=E.current.getBoundingClientRect();T(w)},[E.current]);const F=(w,{direction:M})=>{const k=K(M,g,p.current,h,v),$=X(g,v,k);L(k),M==="LEFT"?a(w):s(w),i({slide:$})};return o.createElement("div",{className:S("carousel",d,{"carousel--slides":v,"carousel--peek":v%1===0}),...u},o.createElement("div",{ref:E,className:"carousel__container"},o.createElement(q,{label:r,type:"prev",disabled:I,onClick:F}),o.createElement(P,{itemsRef:p,offset:C,gap:e,itemsPerSlide:v,nextControlDisabled:_,activeIndex:g,onScroll:c,onSetActiveIndex:L,slideWidth:h},f),o.createElement(q,{type:"next",label:l,disabled:_,onClick:F})))},te=({slideWidth:e,offset:t,forwardedRef:n,children:r,...l})=>{const c=o.useRef(),[s,a]=o.useState(!1);return o.useImperativeHandle(n,()=>{if(!c.current)return;const{left:i,right:d}=H(c.current),f=i===void 0||i-t>=-.01&&d-t<=e+.01;return a(f),{left:i,right:d,fullyVisible:f}},[e,t]),o.createElement("li",{ref:c,"aria-hidden":!s,...l},r)},ne=A.withForwardRef(te);exports.EbayCarousel=ee;exports.EbayCarouselItem=ne;
|
package/ebay-checkbox/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react"),q=require("classnames"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react"),q=require("classnames"),o=require("../icon-D4RDqpD4.js"),I=require("../label-CnrpYJ-g.js"),F=require("../utils-C9NL3q0j.js"),B=a=>typeof a<"u",S=({id:a,size:t="default",className:k,style:d,checked:s,defaultChecked:b=!1,onChange:m=()=>{},onFocus:u=()=>{},onKeyDown:i=()=>{},children:h,inputRef:x,...E})=>{const[g,y]=c.useState(b),C=n=>{const e=n.target;m(n,{value:e==null?void 0:e.value,checked:!!(e!=null&&e.checked)}),y(e==null?void 0:e.checked)},_=n=>{var e,r;return u(n,{value:(e=n.target)==null?void 0:e.value,checked:!!((r=n.target)!=null&&r.checked)})},N=n=>{const e=n.target;i(n,{value:e.value,checked:!!e.checked})},f=q("checkbox",k,{"checkbox--large":t==="large"}),v=t==="large"?c.createElement(o.EbayIcon,{name:"checkboxChecked24",className:"checkbox__checked"}):c.createElement(o.EbayIcon,{name:"checkboxChecked18",className:"checkbox__checked"}),p=t==="large"?c.createElement(o.EbayIcon,{name:"checkboxUnchecked24",className:"checkbox__unchecked"}):c.createElement(o.EbayIcon,{name:"checkboxUnchecked18",className:"checkbox__unchecked"}),l=F.findComponent(h,I.Label);return c.createElement(c.Fragment,null,c.createElement("span",{className:f,style:{...d,alignItems:"center"}},c.createElement("input",{...E,id:a,className:"checkbox__control",type:"checkbox",checked:B(s)?s:g,onChange:C,onFocus:_,onKeyDown:N,ref:x}),c.createElement("span",{className:"checkbox__icon",hidden:!0},v,p)),l?c.cloneElement(l,{...l.props,position:"end",htmlFor:a}):h)};exports.EbayCheckbox=S;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),u=require("classnames"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),u=require("classnames"),t=require("../dialog-previous-button-tKOPYyjk.js");require("../icon-button-Bjjvld0a.js");const c=require("../button-6S4U-4HH.js"),o="confirm-dialog",g=({a11yCloseText:l="Close Dialog",confirmText:s,rejectText:m,onReject:a=()=>{},onConfirm:d=()=>{},...i})=>{const n=e.useRef(null),f="confirm-dialog-confirm",r="confirm-dialog-main";return e.createElement(t.DialogBaseWithState,{focus:n,...i,a11yCloseText:l,role:"dialog",mainId:r,classPrefix:o,className:u(i.className,`${o}--mask-fade`),windowClass:`${o}__window ${o}__window--fade`,buttonPosition:"hidden",onCloseBtnClick:a},i.children,e.createElement(t.EbayDialogFooter,null,e.createElement(c.EbayButton,{onClick:a,className:"confirm-dialog__reject"},m),e.createElement(c.EbayButton,{ref:n,priority:"primary",onClick:d,id:f,"aria-describedby":r,className:"confirm-dialog__confirm"},s)))};exports.EbayConfirmDialog=g;
|
package/ebay-cta-button/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),u=require("classnames"),i=require("../
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),u=require("classnames"),i=require("../forwardRef-fPwzYd82.js"),b=require("../icon-D4RDqpD4.js"),m=require("../button-6S4U-4HH.js"),E=({size:e,children:a,fluid:n,truncate:r,forwardedRef:c,className:o,...s})=>{const l=u(o,"cta-btn",{"cta-btn--large":e==="large"},{"cta-btn--fluid":n},{"cta-btn--truncated":r});return t.createElement("a",{...s,className:l,ref:c},t.createElement(m.EbayButtonCell,{type:"cta"},t.createElement("span",null,a),t.createElement(b.EbayIcon,{name:"arrowRight24"})))},y=i.withForwardRef(E);exports.EbayCtaButton=y;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-textbox.d.ts","sourceRoot":"","sources":["../../src/ebay-date-textbox/date-textbox.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAe,EAAE,EAAuD,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"date-textbox.d.ts","sourceRoot":"","sources":["../../src/ebay-date-textbox/date-textbox.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAe,EAAE,EAAuD,MAAM,OAAO,CAAA;AAGnG,OAAqB,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAG3E,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAA;AAIlH,KAAK,SAAS,GAAG;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,iBAAiB,EAAE,aAAa,GAAG,WAAW,GAAG,WAAW,GAAG,UAAU,CAAC,GAAG;IACjH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,oBAAoB,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACzC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,EAAE,sBAAsB,CAAC,gBAAgB,EAAE,SAAS,CAAC,GACxD,qBAAqB,CAAC,gBAAgB,EAAE,SAAS,CAAC,GAClD,qBAAqB,CAAC,gBAAgB,EAAE,SAAS,CAAC,CAAC;IACzD,aAAa,CAAC,EAAE,sBAAsB,CAAC,gBAAgB,CAAC,CAAC;IACzD,qBAAqB,CAAC,EAAE,sBAAsB,CAAC,gBAAgB,CAAC,CAAC;CACpE,CAAA;AAID,QAAA,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CAyM7C,CAAA;AAED,eAAe,eAAe,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react"),c=require("makeup-expander"),G=require("classnames"),x=require("../calendar-hBaLhOjI.js"),i=require("../textbox-DZRVQetR.js");require("../icon-D4RDqpD4.js");const J=require("../dropdown-pp-aluo7.js");var w;const{default:K=c}=(w=c==null?void 0:c.default)!=null&&w.__esModule?c.default:c,Q=600,X=({className:M,inputPlaceholderText:E="YYYY-MM-DD",a11yOpenPopoverText:q="open calendar",range:o,value:y,rangeEnd:h,defaultValue:P,defaultRangeEnd:R,collapseOnSelect:A,onChange:p=()=>{},onInputChange:C=()=>{},onInputRangeEndChange:L=()=>{},..._})=>{const m=a.useRef(),[Y,d]=a.useState(P||""),[B,u]=a.useState(R||""),v=i.isControlled(y)?y:Y,I=i.isControlled(h)?h:B,[s,S]=a.useState(()=>x.dateArgToISO(v)),[l,b]=a.useState(()=>x.dateArgToISO(I)),[N,O]=a.useState(!1),[F,z]=a.useState(1),{overlayStyles:H,refs:g}=J.useFloatingDropdown({open:N}),f=g.host,W=()=>{O(!0)},k=()=>{O(!1)};a.useEffect(()=>{if(!f.current)return;m.current=new K(f.current,{hostSelector:".ebay-date-textbox--main > .icon-btn",contentSelector:".date-textbox__popover",expandOnClick:!0,autoCollapse:!0}),f.current.addEventListener("expander-expand",W),f.current.addEventListener("expander-collapse",k);const e=()=>{z(document.documentElement.clientWidth<Q?1:2)};return e(),window.addEventListener("resize",e),()=>{var t;(t=m.current)==null||t.destroy(),window.removeEventListener("resize",e)}},[]);const D=(e,t)=>{const r=new Date(e.target.value),n=isNaN(r.getTime())?null:x.toISO(r);t===0?(S(n),d(n||"")):(b(n),u(n||"")),o?p(e,{rangeStart:t===0?n:s,rangeEnd:t===1?n:l}):p(e,{selected:n})},U=(e,{iso:t})=>{if(S(t),d(t),o){const r=s||l,n={rangeStart:t,rangeEnd:r};s&&l?(u(""),b(null),n.rangeEnd=null):r&&(r<t?(S(r),d(r),u(t),b(t),n.rangeStart=r,n.rangeEnd=t):(S(t),d(t),u(r),b(r),n.rangeStart=t,n.rangeEnd=r)),p(e,n)}else p(e,{selected:t});A&&(m.current.expanded=!1)},T=(e,t)=>{t===0?(d(e.target.value),C(e)):(u(e.target.value),L(e))},[V,j]=Array.isArray(E)?E:[E,E];return a.createElement("span",{className:G("date-textbox",M),ref:g.setHost},o&&a.createElement(i.EbayTextbox,{value:v,placeholder:V,onInputChange:e=>T(e,0),onBlur:e=>D(e,0)}),a.createElement(i.EbayTextbox,{className:"ebay-date-textbox--main",placeholder:j,value:o?I:v,onInputChange:e=>T(e,o?1:0),onBlur:e=>D(e,o?1:0)},a.createElement(i.EbayTextboxPostfixIcon,{name:"calendar24",buttonAriaLabel:q})),a.createElement("div",{hidden:!N,ref:g.setOverlay,style:H,className:"date-textbox__popover"},a.createElement(x.EbayCalendar,{..._,range:o,interactive:!0,navigable:!0,numMonths:F,selected:s&&l?[s,l]:s||l||void 0,onSelect:U})))};exports.EbayDateTextbox=X;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# EbayDetails
|
|
2
|
+
|
|
3
|
+
## Demo
|
|
4
|
+
|
|
5
|
+
[Storybook](https://opensource.ebay.com/ebayui-core-react/main/?path=/story/navigation-disclosure-ebay-details--default)
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
### Import JS
|
|
10
|
+
|
|
11
|
+
```jsx harmony
|
|
12
|
+
import { EbayDetails } from "@ebay/ui-core-react/ebay-details";
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
### Import following styles from SKIN
|
|
16
|
+
|
|
17
|
+
```jsx harmony
|
|
18
|
+
import "@ebay/skin/details";
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### If tokens haven't been added to the project at a higher level, make sure to import
|
|
22
|
+
|
|
23
|
+
```jsx harmony
|
|
24
|
+
import "@ebay/skin/tokens";
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Or import styles using SCSS/CSS
|
|
28
|
+
|
|
29
|
+
```jsx harmony
|
|
30
|
+
import "@ebay/skin/details.css";
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
```jsx harmony
|
|
34
|
+
<EbayDetails text="details">
|
|
35
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna
|
|
36
|
+
aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
|
|
37
|
+
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur
|
|
38
|
+
sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
|
39
|
+
</EbayDetails>
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Attributes
|
|
43
|
+
|
|
44
|
+
| Name | Type | Required | Description | Data |
|
|
45
|
+
| ----------- | ----------------- | -------- | -------------------------------------------------- | -------------------------- |
|
|
46
|
+
| `alignment` | String | No | The position of the details, `regular` or `center` | |
|
|
47
|
+
| `size` | String | No | Size of the details, `regular` or `small` | |
|
|
48
|
+
| `open` | String | No | Whether details is open | |
|
|
49
|
+
| `text` | String | Yes | Text for the summary | |
|
|
50
|
+
| `as` | React.ElementType | No | Element type for the summary, default is `div` | |
|
|
51
|
+
| `onToggle` | Function | No | Triggered on toggle | `(event: Event, { open })` |
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ComponentProps, ElementType, FC } from 'react';
|
|
2
|
+
import { EbayEventHandler } from '../events';
|
|
3
|
+
type ToggleProps = {
|
|
4
|
+
open: boolean;
|
|
5
|
+
};
|
|
6
|
+
export type EbayDetailsProps = Omit<ComponentProps<'details'>, 'onToggle'> & {
|
|
7
|
+
text: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
size?: 'regular' | 'small';
|
|
10
|
+
alignment?: 'regular' | 'center';
|
|
11
|
+
layout?: 'regular' | 'accordion';
|
|
12
|
+
as?: ElementType;
|
|
13
|
+
onToggle?: EbayEventHandler<HTMLDetailsElement, ToggleProps>;
|
|
14
|
+
};
|
|
15
|
+
declare const EbayDetails: FC<EbayDetailsProps>;
|
|
16
|
+
export default EbayDetails;
|
|
17
|
+
//# sourceMappingURL=ebay-details.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ebay-details.d.ts","sourceRoot":"","sources":["../../src/ebay-details/ebay-details.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,cAAc,EAAE,WAAW,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAE9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AAG5C,KAAK,WAAW,GAAG;IACf,IAAI,EAAE,OAAO,CAAC;CACjB,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,GAAG;IACzE,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,CAAC,EAAE,SAAS,GAAG,OAAO,CAAA;IAC1B,SAAS,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAA;IAChC,MAAM,CAAC,EAAE,SAAS,GAAG,WAAW,CAAA;IAChC,EAAE,CAAC,EAAE,WAAW,CAAA;IAChB,QAAQ,CAAC,EAAE,gBAAgB,CAAC,kBAAkB,EAAE,WAAW,CAAC,CAAA;CAC/D,CAAA;AAED,QAAA,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CA4CrC,CAAA;AAED,eAAe,WAAW,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ebay-details/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../ebay-details-q_d7qlcN.js");exports.EbayDetails=e.EbayDetails;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("react"),a=require("classnames"),s=require("./icon-D4RDqpD4.js"),y=({size:c,alignment:r,layout:t,text:m,as:i="div",className:o,open:d,onToggle:l,children:_,...E})=>{const u=l&&(n=>{l(n,{open:n.currentTarget.open})});return e.createElement("details",{open:d,onToggle:u,className:a("details",o),...E},e.createElement("summary",{className:a("details__summary",{"details__summary--small":c==="small","details__summary--center":r==="center"})},e.createElement("span",{className:"details__label"},m),e.createElement("span",{className:"details__icon",hidden:!0},t==="accordion"?e.createElement(e.Fragment,null,e.createElement(s.EbayIcon,{className:"details__expand",name:"add16"}),e.createElement(s.EbayIcon,{className:"details__collapse",name:"remove16"})):e.createElement(s.EbayIcon,{name:"chevronDown16"}))),e.createElement(i,{className:a({details__content:t==="accordion"})},_))};exports.EbayDetails=y;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../dialog-previous-button-tKOPYyjk.js");exports.DialogBaseWithState=o.DialogBaseWithState;exports.EbayDialogActions=o.EbayDialogActions;exports.EbayDialogCloseButton=o.EbayDialogCloseButton;exports.EbayDialogFooter=o.EbayDialogFooter;exports.EbayDialogHeader=o.EbayDialogHeader;exports.EbayDialogPreviousButton=o.EbayDialogPreviousButton;exports.useDialogAnimation=o.useDialogAnimation;
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
#
|
|
1
|
+
# EbayDrawerDialogDeprecated
|
|
2
|
+
|
|
3
|
+
**Deprecated will be removed next major** (Use `EbayLightboxDialog` instead)
|
|
2
4
|
|
|
3
5
|
## Demo
|
|
4
|
-
[Storybook](https://opensource.ebay.com/ebayui-core-react/main/?path=/story/
|
|
6
|
+
[Storybook](https://opensource.ebay.com/ebayui-core-react/main/?path=/story/deprecated-ebay-drawer-dialog-deprecated--default)
|
|
5
7
|
|
|
6
8
|
## Usage
|
|
7
9
|
|
|
8
10
|
### Import JS
|
|
9
11
|
```jsx harmony
|
|
10
|
-
import {
|
|
12
|
+
import { EbayDrawerDialogDeprecated } from '@ebay/ui-core-react/ebay-drawer-dialog-deprecated'
|
|
11
13
|
```
|
|
12
14
|
### Import following styles from SKIN
|
|
13
15
|
```jsx harmony
|
|
@@ -19,9 +21,9 @@ import '@ebay/skin/drawer-dialog.css'
|
|
|
19
21
|
```
|
|
20
22
|
### Simple opened dialog
|
|
21
23
|
```jsx
|
|
22
|
-
<
|
|
24
|
+
<EbayDrawerDialogDeprecated open a11yClosetext="Close Drawer">
|
|
23
25
|
Hello World
|
|
24
|
-
</
|
|
26
|
+
</EbayDrawerDialogDeprecated>
|
|
25
27
|
```
|
|
26
28
|
|
|
27
29
|
## Props
|
|
@@ -41,7 +43,6 @@ import '@ebay/skin/drawer-dialog.css'
|
|
|
41
43
|
|
|
42
44
|
| Event | Data | Description |
|
|
43
45
|
|---------------|------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
44
|
-
| `onShow` | `(event: Event)` | Deprecated, use `onOpen` instead. drawer opened |
|
|
45
46
|
| `onOpen` | `(event: Event)` | drawer opened |
|
|
46
47
|
| `onClose` | `(event: Event)` | drawer closed. Triggered also when user drags down on handle (touch only) when dialog is not expanded |
|
|
47
48
|
| `onExpanded` | `(event: Event)` | drawer expanded to full page height. Event is triggered on drag up of handle (touch only), clicks, or when user scrolls in content when dialog is not expanded |
|
|
@@ -56,9 +57,9 @@ Will render a header content for the dialog. Will always render the header eleme
|
|
|
56
57
|
Will render the footer content for the dialog. If not present then will not have any footer.
|
|
57
58
|
|
|
58
59
|
```jsx
|
|
59
|
-
<
|
|
60
|
+
<EbayDrawerDialogDeprecated>
|
|
60
61
|
<EbayDialogHeader>Title</EbayDialogHeader>
|
|
61
62
|
Some text
|
|
62
63
|
<EbayDialogFooter>(c)2021 eBay Inc.</EbayDialogFooter>
|
|
63
|
-
</
|
|
64
|
+
</EbayDrawerDialogDeprecated>
|
|
64
65
|
```
|
|
@@ -7,14 +7,10 @@ export interface EbayDrawerProps<T> extends DialogBaseProps<T> {
|
|
|
7
7
|
focus?: RefObject<HTMLAnchorElement & HTMLButtonElement>;
|
|
8
8
|
a11yMinimizeText?: string;
|
|
9
9
|
a11yMaximizeText?: string;
|
|
10
|
-
/**
|
|
11
|
-
* @deprecated Use onOpen instead
|
|
12
|
-
*/
|
|
13
|
-
onShow?: () => void;
|
|
14
10
|
onClose?: () => void;
|
|
15
11
|
onExpanded?: () => void;
|
|
16
12
|
onCollapsed?: () => void;
|
|
17
13
|
}
|
|
18
|
-
declare const
|
|
19
|
-
export default
|
|
14
|
+
declare const EbayDrawerDialogDeprecated: FC<EbayDrawerProps<any>>;
|
|
15
|
+
export default EbayDrawerDialogDeprecated;
|
|
20
16
|
//# sourceMappingURL=drawer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drawer.d.ts","sourceRoot":"","sources":["../../../src/ebay-drawer-dialog-deprecated/components/drawer.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAY,EAAE,EAAgB,SAAS,EAA0C,MAAM,OAAO,CAAA;AAE5G,OAAO,EAAE,eAAe,EAAyC,MAAM,wBAAwB,CAAA;AAK/F,MAAM,WAAW,eAAe,CAAC,CAAC,CAAE,SAAQ,eAAe,CAAC,CAAC,CAAC;IAC1D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC,iBAAiB,GAAG,iBAAiB,CAAC,CAAC;IACzD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;CAC5B;AAED,QAAA,MAAM,0BAA0B,EAAE,EAAE,CAAC,eAAe,CAAC,GAAG,CAAC,CA8FxD,CAAA;AAED,eAAe,0BAA0B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ebay-drawer-dialog-deprecated/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,0BAA0B,EAAE,MAAM,qBAAqB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react"),E=require("classnames"),i=require("../dialog-previous-button-tKOPYyjk.js");require("../icon-button-Bjjvld0a.js");const y=30,n="drawer-dialog",q=({expanded:l=!1,noHandle:T,onClose:d=()=>{},onCollapsed:p=()=>{},onExpanded:D=()=>{},a11yMaximizeText:b,a11yMinimizeText:S,children:_,...u})=>{let a=[];const[c,g]=o.useState(l);o.useEffect(()=>{g(l)},[l]);const s=e=>{g(e),e?D():p()},H=e=>{a=Array.from(e.changedTouches).map(({identifier:r,pageY:t})=>({identifier:r,pageY:t}))},f=e=>{Array.from(e.changedTouches).forEach(({identifier:r})=>{const t=a.findIndex(h=>h.identifier===r);t>-1&&a.splice(t,1)})},x=e=>{a.length&&Array.from(e.changedTouches).forEach(({identifier:r,pageY:t})=>{const h=a.findIndex($=>$.identifier===r),m=t-a[h].pageY;m>y?(c?s(!1):d(),f(e)):m<-y&&(s(!0),f(e))})},C=T?null:o.createElement("button",{"aria-label":c?S:b,className:`${n}__handle`,onClick:()=>s(!c),onScroll:()=>s(!0),onTouchStart:H,onTouchMove:x,onTouchEnd:f,type:"button"}),w=o.Children.toArray(_),k=w.find(({type:e})=>e===i.EbayDialogHeader),A=w.filter(({type:e})=>e!==i.EbayDialogHeader);return o.createElement(i.DialogBaseWithState,{...u,classPrefix:n,onCloseBtnClick:d,className:E(u.className,`${n}--mask-fade-slow`),windowClass:E(u.windowClass,`${n}__window`,`${n}__window--slide`,{[`${n}__window--expanded`]:c}),onBackgroundClick:d,top:C},k||o.createElement(i.EbayDialogHeader,null),A)};exports.EbayDrawerDialogDeprecated=q;
|
package/ebay-eek/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react"),u=require("classnames"),i=require("../icon-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react"),u=require("classnames"),i=require("../icon-D4RDqpD4.js"),d={"A+++":["D","E","G"],"A++":["E","G"],"A+":["F","G"],A:["G"]},E=r=>{const{max:t,min:n,rating:s}=r,l=d[t];if(!(l&&l.indexOf(n)>-1))return null;let e=t,c=1;for(;e!==s;){if(c++,n===e)return null;e.length>1?e=e.slice(0,e.length-1):e=String.fromCharCode(e.charCodeAt(0)+1)}return c>7?7:c},m=({min:r="",max:t="",rating:n,a11yText:s,className:l})=>{const e=E({rating:n,min:r,max:t}),c=u(l,"eek",{[`eek--rating-${e}`]:!!e}),o=`Energy Rating: ${n}. Range: ${t} - ${r}.`;return a.createElement("div",{className:c,role:"figure","aria-label":s||o},a.createElement("div",{className:"eek__container","aria-hidden":!0},a.createElement("span",{className:"eek__rating-range"},a.createElement("span",{"aria-hidden":"true"},t),a.createElement(i.EbayIcon,{name:"eekRangeArrow"}),a.createElement("span",{"aria-hidden":"true"},r)),a.createElement("span",{className:"eek__rating","aria-hidden":"true"},n)),a.createElement(i.EbayIcon,{name:"eekArrow"}))};exports.EbayEek=m;
|
package/ebay-fake-menu/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../menu-item-Cf-tQ72X.js"),t=require("react"),n=require("classnames"),u=({className:a,...r})=>t.createElement("hr",{...r,className:n(a,"fake-menu__separator"),role:"separator"});exports.EbayFakeMenu=e.EbayFakeMenu;exports.EbayFakeMenuItem=e.EbayMenuItem;exports.EbayFakeMenuSeparator=u;
|
package/ebay-fake-menu/menu.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComponentProps,
|
|
1
|
+
import React, { ComponentProps, RefObject } from 'react';
|
|
2
2
|
import { EbayKeyboardEventHandler, EbayMouseEventHandler } from '../common/event-utils/types';
|
|
3
3
|
type SpanProps = Omit<ComponentProps<'div'>, 'onKeyDown' | 'onSelect'>;
|
|
4
4
|
type Props = SpanProps & {
|
|
@@ -9,7 +9,8 @@ type Props = SpanProps & {
|
|
|
9
9
|
onSelect?: EbayMouseEventHandler<HTMLAnchorElement, {
|
|
10
10
|
index: number;
|
|
11
11
|
}>;
|
|
12
|
+
forwardedRef?: RefObject<HTMLDivElement>;
|
|
12
13
|
};
|
|
13
|
-
declare const
|
|
14
|
-
export default
|
|
14
|
+
declare const _default: React.ForwardRefExoticComponent<Omit<Props, "ref"> & React.RefAttributes<React.FC<Props>>>;
|
|
15
|
+
export default _default;
|
|
15
16
|
//# sourceMappingURL=menu.d.ts.map
|