@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
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`
|
|
@@ -82,8 +79,8 @@ eBayUI React components
|
|
|
82
79
|
* [x] [ebay-tabs](src/ebay-tabs)
|
|
83
80
|
* [x] [ebay-textbox](src/ebay-textbox)
|
|
84
81
|
* [x] [ebay-toast-dialog](src/ebay-toast-dialog)
|
|
85
|
-
* [
|
|
86
|
-
* [
|
|
82
|
+
* [x] [ebay-toggle-button](src/ebay-toast-dialog)
|
|
83
|
+
* [x] [ebay-toggle-button-group](src/ebay-toast-dialog)
|
|
87
84
|
* [x] [ebay-tooltip](src/ebay-tooltip)
|
|
88
85
|
* [x] [ebay-tourtip](src/ebay-tourtip)
|
|
89
86
|
* [ ] `ebay-tri-state-checkbox`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Array.prototype.flat||Object.defineProperty(Array.prototype,"flat",{configurable:!0,writable:!0,value:function(e){const a=typeof e>"u"?1:Number(e)||0,r=[],c=r.forEach,o=(n,f)=>c.call(n,t=>{f>0&&Array.isArray(t)?o(t,f-1):r.push(t)});return o(this,a),r}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("react"),i=require("classnames"),c=({number:r,type:a="img",className:s,...n})=>{const e=Math.round(parseInt(String(r),10));return e<=0?null:t.createElement("span",{...n,className:i("badge",s),role:a==="img"?"img":void 0,"aria-hidden":a!=="img"},e>99?"99+":e)};exports.EbayBadge=c;
|
|
@@ -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;
|
|
@@ -0,0 +1 @@
|
|
|
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,OA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AW,EACX,IAAI,EACJ,OAAkB,EACrB,EAAG,sBAAsB,GAAG,uBAAuB,CA8EnD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function i(t,u){let e;return(...c)=>{clearTimeout(e),e=setTimeout(()=>t(...c),u)}}exports.debounce=i;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const n=require("react"),ne=require("react-remove-scroll"),p=require("classnames"),re=require("makeup-screenreader-trap"),ae=require("makeup-keyboard-trap"),oe=require("./icon-D4RDqpD4.js"),ie=require("./forwardRef-fPwzYd82.js"),ce=require("./icon-button-Bjjvld0a.js");function V(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,o.get?o:{enumerable:!0,get:()=>t[r]})}}return e.default=t,Object.freeze(e)}const L=V(re),A=V(ae),F=({children:t,...e})=>n.createElement("h2",{...e},t),$=({children:t})=>n.createElement(n.Fragment,null,t),q=({children:t})=>n.createElement(n.Fragment,null,t);function G({open:t,classPrefix:e,transitionElement:r,dialogRef:o,dialogWindowRef:d,enabled:u,onTransitionEnd:i}){const c=n.useRef(t);n.useLayoutEffect(()=>{if(!u)return;let s=[d,o];r==="window"?s=[d]:r==="root"&&(s=[o]);let l;return t?l=se({dialog:o,waitFor:s,classPrefix:e,onTransitionEnd:i}):c.current!==t&&(l=le({dialog:o,waitFor:s,classPrefix:e,onTransitionEnd:i})),c.current=t,()=>{l&&l()}},[t,u])}function se({dialog:t,waitFor:e,classPrefix:r,onTransitionEnd:o}){return J(t,e,`${r}--show`,o)}function le({dialog:t,waitFor:e,classPrefix:r,onTransitionEnd:o}){return J(t,e,`${r}--hide`,o)}function J(t,e,r,o){if(!t.current||!r)return;let d=0;const u=e?e.length:0,i=`${r}-init`;return t.current.classList.add(i),ue(()=>{t.current&&(t.current.classList.add(r),t.current.classList.remove(i),e.forEach(c=>{const s=()=>{var l,f;++d===u&&((l=t.current)==null||l.classList.remove(r),o(),(f=c.current)==null||f.removeEventListener("transitionend",s))};c.current.addEventListener("transitionend",s,{once:!0})}))})}function ue(t){let e,r;return window.requestAnimationFrame?(e=window.requestAnimationFrame(()=>{e=window.requestAnimationFrame(t)}),r=window.cancelAnimationFrame):(e=window.setTimeout(t,26),r=window.clearTimeout),()=>{e&&(r(e),e=void 0)}}const de=({baseEl:t="div",classPrefix:e="drawer-dialog",windowClass:r,windowType:o,mainId:d,top:u,header:i,buttonPosition:c="right",children:s,ariaLabelledby:l,a11yCloseText:f,onCloseBtnClick:w=()=>{},footer:b,actions:g,onScroll:T,open:a=!1,onOpen:D=()=>{},onBackgroundClick:O=()=>{},ignoreEscape:M,closeButton:Q,previousButton:U,isModal:_,role:X="dialog",focus:k,transitionElement:Y,animated:S,closeButtonClass:Z,...C})=>{var K;const I=n.useRef(null),E=n.useRef(null),j=n.useRef(null),[x,P]=n.useState("");n.useEffect(()=>{P(ie.randomId())},[]),n.useEffect(()=>{let m;const y=v=>{E.current&&!E.current.contains(v.target)&&O(v)};return a&&c!=="hidden"&&(m=window.setTimeout(()=>{document.addEventListener("click",y,!1)})),()=>{clearTimeout(m),document.removeEventListener("click",y,!1)}},[O,a]),n.useEffect(()=>(a&&_?(L.trap(E.current),A.trap(E.current)):(L.untrap(),A.untrap()),()=>{L.untrap(),A.untrap()}),[a,_]),G({open:a,classPrefix:e,transitionElement:Y,dialogRef:I,dialogWindowRef:E,enabled:S,onTransitionEnd:()=>H(a)});const h=m=>{!M&&m.key==="Escape"&&(m.stopPropagation(),w(m))};n.useEffect(()=>{S||H(a),a&&D()},[a]);function H(m){var y,v;if(m)return k?(y=k.current)==null||y.focus():_&&((v=j.current)==null||v.focus()),document.addEventListener("keydown",h,!1),()=>document.removeEventListener("keydown",h,!1)}const W=c!=="hidden"&&n.createElement("button",{ref:j,className:p("icon-btn",Z,`${e}__close`,{"icon-btn--transparent":e==="toast-dialog"}),type:"button","aria-label":f,onClick:w},Q||n.createElement(oe.EbayIcon,{name:"close16"})),ee=o?`${e}__${o}-window`:`${e}__window`,z=((K=i==null?void 0:i.props)==null?void 0:K.id)||`dialog-title-${x}`,te=l||z,B=i?n.cloneElement(i,{...i.props,id:z}):null;return n.createElement(t,{...C,"aria-labelledby":te,"aria-modal":"true",role:X,hidden:!a,className:p(e,C.className),"aria-live":_?void 0:"polite",ref:I,onKeyDown:h},n.createElement("div",{className:p(ee,r),ref:E},u,B&&n.createElement("div",{className:`${e}__header`},U,c==="right"&&B,c!=="bottom"&&W,(c==="left"||c==="hidden")&&B),n.createElement("div",{id:d,className:`${e}__main`,onScroll:T},s),g?n.createElement("div",{className:`${e}__actions`},g):null,b||c==="bottom"?n.createElement("div",{className:`${e}__footer`},b,c==="bottom"&&W):null))},me=({isModal:t,open:e,children:r,animated:o=!0,...d})=>{const u=t!==!1,i=n.Children.toArray(r),c=i.find(a=>a.type===F),s=i.find(a=>a.type===$),l=i.find(a=>a.type===N),f=i.find(a=>a.type===q),w=i.find(a=>a.type===R),b=i.filter(a=>![F,$,q,N,R].some(D=>D===a.type)),g=n.createElement(de,{...d,open:e,isModal:u,header:c,footer:s,actions:l,closeButton:f,previousButton:w,animated:o},b);return o||e?u?n.createElement(ne.RemoveScroll,{enabled:e},g):g:null},N=({children:t})=>n.createElement(n.Fragment,null,t),R=({className:t,icon:e,...r})=>n.createElement(ce.EbayIconButton,{...r,icon:e||"chevronLeft16",className:p(t,"lightbox-dialog__prev")});exports.DialogBaseWithState=me;exports.EbayDialogActions=N;exports.EbayDialogCloseButton=q;exports.EbayDialogFooter=$;exports.EbayDialogHeader=F;exports.EbayDialogPreviousButton=R;exports.useDialogAnimation=G;
|
|
@@ -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,26 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const React = require("react");
|
|
4
|
-
const classNames = require("classnames");
|
|
5
|
-
const ebayDialogBase_components_dialogFooter = require("../ebay-dialog-base/components/dialog-footer/index.js");
|
|
6
|
-
const dialogPreviousButton = require("../dialog-previous-button-EC_Y6KaT.js");
|
|
7
|
-
require("../icon-button-BQWoMgX1.js");
|
|
8
|
-
const button = require("../button-B4bZIgwB.js");
|
|
9
|
-
const classPrefix = "alert-dialog";
|
|
10
|
-
const EbayAlertDialog = ({ a11yCloseText = "Close Dialog", confirmText, onConfirm = () => {
|
|
11
|
-
}, ...rest }) => {
|
|
12
|
-
const confirmBtnRef = React.useRef(null);
|
|
13
|
-
const confirmId = "alert-dialog-confirm";
|
|
14
|
-
const mainId = "alert-dialog-main";
|
|
15
|
-
return React.createElement(
|
|
16
|
-
dialogPreviousButton.DialogBaseWithState,
|
|
17
|
-
{ focus: confirmBtnRef, ...rest, a11yCloseText, role: "alertdialog", classPrefix, ignoreEscape: true, mainId, buttonPosition: "hidden", className: classNames(rest.className, `${classPrefix}--mask-fade`), windowClass: `${classPrefix}__window ${classPrefix}__window--fade` },
|
|
18
|
-
rest.children,
|
|
19
|
-
React.createElement(
|
|
20
|
-
ebayDialogBase_components_dialogFooter,
|
|
21
|
-
null,
|
|
22
|
-
React.createElement(button.EbayButton, { priority: "primary", "aria-describedby": mainId, onClick: onConfirm, ref: confirmBtnRef, id: confirmId, className: "alert-dialog__acknowledge" }, confirmText)
|
|
23
|
-
)
|
|
24
|
-
);
|
|
25
|
-
};
|
|
26
|
-
exports.EbayAlertDialog = EbayAlertDialog;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),d=require("classnames"),r=require("../dialog-previous-button-B-fysL3O.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;
|
package/ebay-badge/index.js
CHANGED
|
@@ -1,4 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const badge = require("../badge-CR5t7-2L.js");
|
|
4
|
-
exports.EbayBadge = badge.EbayBadge;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../badge-CoHKfiPt.js");exports.EbayBadge=e.EbayBadge;
|
|
@@ -1,47 +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 Breadcrumbs = ({ a11yHeadingText = "Page navigation", a11yHeadingTag = "h2", id = "ebay-breadcrumb", children: breadcrumbItems = [], className, onSelect = () => {
|
|
7
|
-
}, ...rest }) => {
|
|
8
|
-
const headingId = `${id}-breadcrumbs-heading`;
|
|
9
|
-
const lastItemIndex = React.Children.count(breadcrumbItems) - 1;
|
|
10
|
-
const A11yHeadingTag = a11yHeadingTag;
|
|
11
|
-
const anyLink = React.Children.toArray(breadcrumbItems).some((item) => item.props.href);
|
|
12
|
-
const tag = anyLink ? "a" : "button";
|
|
13
|
-
return React.createElement(
|
|
14
|
-
"nav",
|
|
15
|
-
{ ...rest, "aria-labelledby": headingId, className: classNames("breadcrumbs", className), role: "navigation" },
|
|
16
|
-
React.createElement(A11yHeadingTag, { id: headingId, className: "clipped" }, a11yHeadingText),
|
|
17
|
-
React.createElement("ul", null, React.Children.map(breadcrumbItems, (item, index) => {
|
|
18
|
-
const isLastItem = index === lastItemIndex;
|
|
19
|
-
const { href, children } = item.props;
|
|
20
|
-
const itemProps = {
|
|
21
|
-
tag,
|
|
22
|
-
isLastItem,
|
|
23
|
-
href,
|
|
24
|
-
children,
|
|
25
|
-
onClick: (event) => onSelect(event)
|
|
26
|
-
};
|
|
27
|
-
return React.cloneElement(item, itemProps);
|
|
28
|
-
}))
|
|
29
|
-
);
|
|
30
|
-
};
|
|
31
|
-
const BreadcrumbItem = ({ tag: Item = "button", isLastItem = false, href, children, onClick, ...rest }) => {
|
|
32
|
-
const isLink = Item === "a";
|
|
33
|
-
const itemAttr = {
|
|
34
|
-
...rest,
|
|
35
|
-
...isLastItem ? { "aria-current": "location" } : {},
|
|
36
|
-
href: isLink ? href : void 0,
|
|
37
|
-
onClick: isLink ? void 0 : onClick
|
|
38
|
-
};
|
|
39
|
-
return React.createElement(
|
|
40
|
-
"li",
|
|
41
|
-
null,
|
|
42
|
-
React.createElement(Item, { ...itemAttr }, children),
|
|
43
|
-
!isLastItem && React.createElement(icon.EbayIcon, { name: "chevronRight12" })
|
|
44
|
-
);
|
|
45
|
-
};
|
|
46
|
-
exports.EbayBreadcrumbItem = BreadcrumbItem;
|
|
47
|
-
exports.EbayBreadcrumbs = Breadcrumbs;
|
|
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,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
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const button = require("../button-B4bZIgwB.js");
|
|
4
|
-
exports.EbayButton = button.EbayButton;
|
|
5
|
-
exports.EbayButtonCell = button.EbayButtonCell;
|
|
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,4 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const calendar = require("../calendar-D-DWjrMU.js");
|
|
4
|
-
exports.EbayCalendar = calendar.EbayCalendar;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../calendar-hBaLhOjI.js");exports.EbayCalendar=e.EbayCalendar;
|