@ebay/ui-core-react 8.0.3 → 8.1.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/checkbox-Bb3s3Jof.js +1 -0
- package/common/dropdown.d.ts +61 -0
- package/common/dropdown.d.ts.map +1 -1
- package/common/floating-label-utils/hooks.d.ts +10 -21
- package/common/floating-label-utils/hooks.d.ts.map +1 -1
- package/dropdown-BLiIyhWy.js +1 -0
- package/ebay-avatar/README.md +44 -0
- package/ebay-avatar/avatar-image.d.ts +5 -0
- package/ebay-avatar/avatar-image.d.ts.map +1 -0
- package/ebay-avatar/avatar.d.ts +11 -0
- package/ebay-avatar/avatar.d.ts.map +1 -0
- package/ebay-avatar/index.d.ts +4 -0
- package/ebay-avatar/index.d.ts.map +1 -0
- package/ebay-avatar/index.js +1 -0
- package/ebay-avatar/types.d.ts +3 -0
- package/ebay-avatar/types.d.ts.map +1 -0
- package/ebay-avatar/utils.d.ts +3 -0
- package/ebay-avatar/utils.d.ts.map +1 -0
- package/ebay-carousel/README.md +5 -0
- package/ebay-carousel/carousel-item.d.ts.map +1 -1
- package/ebay-carousel/carousel-list.d.ts +1 -0
- package/ebay-carousel/carousel-list.d.ts.map +1 -1
- package/ebay-carousel/carousel.d.ts +3 -0
- package/ebay-carousel/carousel.d.ts.map +1 -1
- package/ebay-carousel/helpers.d.ts +14 -0
- package/ebay-carousel/helpers.d.ts.map +1 -1
- package/ebay-carousel/index.js +1 -1
- package/ebay-carousel/types.d.ts +2 -0
- package/ebay-carousel/types.d.ts.map +1 -1
- package/ebay-checkbox/README.md +20 -8
- package/ebay-checkbox/checkbox.d.ts +6 -17
- package/ebay-checkbox/checkbox.d.ts.map +1 -1
- package/ebay-checkbox/index.d.ts +2 -1
- package/ebay-checkbox/index.d.ts.map +1 -1
- package/ebay-checkbox/index.js +1 -1
- package/ebay-checkbox/types.d.ts +10 -0
- package/ebay-checkbox/types.d.ts.map +1 -0
- package/ebay-combobox/README.md +61 -0
- package/ebay-combobox/combobox-button.d.ts +5 -0
- package/ebay-combobox/combobox-button.d.ts.map +1 -0
- package/ebay-combobox/combobox-option.d.ts +9 -0
- package/ebay-combobox/combobox-option.d.ts.map +1 -0
- package/ebay-combobox/combobox.d.ts +25 -0
- package/ebay-combobox/combobox.d.ts.map +1 -0
- package/ebay-combobox/index.d.ts +5 -0
- package/ebay-combobox/index.d.ts.map +1 -0
- package/ebay-combobox/index.js +1 -0
- package/ebay-combobox/types.d.ts +18 -0
- package/ebay-combobox/types.d.ts.map +1 -0
- package/ebay-date-textbox/index.js +1 -1
- package/ebay-fake-menu-button/index.js +1 -1
- package/ebay-field/README.md +2 -2
- package/ebay-infotip/index.js +1 -1
- package/ebay-lightbox-dialog/index.js +1 -1
- package/ebay-listbox-button/index.js +1 -1
- package/ebay-menu-button/index.js +1 -1
- package/ebay-pagination/index.js +1 -1
- package/ebay-select/ebay-select.d.ts.map +1 -1
- package/ebay-select/index.js +1 -1
- package/ebay-skeleton/README.md +108 -0
- package/ebay-skeleton/ebay-skeleton-avatar.d.ts +6 -0
- package/ebay-skeleton/ebay-skeleton-avatar.d.ts.map +1 -0
- package/ebay-skeleton/ebay-skeleton-button.d.ts +8 -0
- package/ebay-skeleton/ebay-skeleton-button.d.ts.map +1 -0
- package/ebay-skeleton/ebay-skeleton-image.d.ts +6 -0
- package/ebay-skeleton/ebay-skeleton-image.d.ts.map +1 -0
- package/ebay-skeleton/ebay-skeleton-text.d.ts +9 -0
- package/ebay-skeleton/ebay-skeleton-text.d.ts.map +1 -0
- package/ebay-skeleton/ebay-skeleton-textbox.d.ts +6 -0
- package/ebay-skeleton/ebay-skeleton-textbox.d.ts.map +1 -0
- package/ebay-skeleton/ebay-skeleton.d.ts +7 -0
- package/ebay-skeleton/ebay-skeleton.d.ts.map +1 -0
- package/ebay-skeleton/index.d.ts +7 -0
- package/ebay-skeleton/index.d.ts.map +1 -0
- package/ebay-skeleton/index.js +1 -0
- package/ebay-skeleton/types.d.ts +5 -0
- package/ebay-skeleton/types.d.ts.map +1 -0
- package/ebay-split-button/index.js +1 -1
- package/ebay-table/README.md +125 -0
- package/ebay-table/index.d.ts +6 -0
- package/ebay-table/index.d.ts.map +1 -0
- package/ebay-table/index.js +1 -0
- package/ebay-table/table-cell.d.ts +9 -0
- package/ebay-table/table-cell.d.ts.map +1 -0
- package/ebay-table/table-header.d.ts +13 -0
- package/ebay-table/table-header.d.ts.map +1 -0
- package/ebay-table/table-row.d.ts +19 -0
- package/ebay-table/table-row.d.ts.map +1 -0
- package/ebay-table/table.d.ts +15 -0
- package/ebay-table/table.d.ts.map +1 -0
- package/ebay-table/types.d.ts +23 -0
- package/ebay-table/types.d.ts.map +1 -0
- package/ebay-textbox/index.d.ts +0 -1
- package/ebay-textbox/index.d.ts.map +1 -1
- package/ebay-textbox/index.js +1 -1
- package/ebay-textbox/textbox.d.ts.map +1 -1
- package/ebay-tri-state-checkbox/Readme.md +72 -0
- package/ebay-tri-state-checkbox/index.d.ts +3 -0
- package/ebay-tri-state-checkbox/index.d.ts.map +1 -0
- package/ebay-tri-state-checkbox/index.js +1 -0
- package/ebay-tri-state-checkbox/tri-state-checkbox.d.ts +15 -0
- package/ebay-tri-state-checkbox/tri-state-checkbox.d.ts.map +1 -0
- package/ebay-tri-state-checkbox/types.d.ts +11 -0
- package/ebay-tri-state-checkbox/types.d.ts.map +1 -0
- package/hooks-S6mbahSV.js +1 -0
- package/lightbox-dialog-D_Uf6lg5.js +1 -0
- package/{menu-button-label-Cu3rEUWv.js → menu-button-label-C_SUnCJn.js} +1 -1
- package/{menu-button-label-Bjy8tyX5.js → menu-button-label-Ck5QyJG2.js} +1 -1
- package/package.json +2 -1
- package/textbox-90ZPJmqa.js +1 -0
- package/tri-state-checkbox-BX-snR_a.js +1 -0
- package/dropdown-JMZDOaC2.js +0 -1
- package/hooks-BJqqLO4L.js +0 -1
- package/lightbox-dialog-CM0kRPbb.js +0 -1
- package/textbox-CSLyIuKO.js +0 -1
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as EbayTable } from './table';
|
|
2
|
+
export { default as EbayTableHeader } from './table-header';
|
|
3
|
+
export { default as EbayTableRow } from './table-row';
|
|
4
|
+
export { default as EbayTableCell } from './table-cell';
|
|
5
|
+
export * from './types';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ebay-table/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,SAAS,CAAA;AAC9C,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAC3D,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,aAAa,CAAA;AACrD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,cAAc,CAAA;AACvD,cAAc,SAAS,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("../tslib.es6-C4EgNkz1.js"),l=require("react"),H=require("classnames"),B=require("../tri-state-checkbox-BX-snR_a.js"),O=require("../utils-C9NL3q0j.js"),M=require("../icon-CeLPlCml.js"),I=require("../checkbox-Bb3s3Jof.js"),g=a=>{var{rowHeader:E,columnType:c,className:o,children:i}=a,p=f.__rest(a,["rowHeader","columnType","className","children"]);const b=E?"th":"td",s=c==="layout"?"div":l.Fragment;return l.createElement(b,Object.assign({className:H("table-cell",o,{[`table-cell--${c}`]:c})},p),l.createElement(s,Object.assign({},c==="layout"?{className:"table-cell__layout"}:{}),i))},_=a=>{var{columnType:E,name:c,sort:o,href:i,children:p,onSort:b}=a,s=f.__rest(a,["columnType","name","sort","href","children","onSort"]);const m={asc:"ascending",desc:"descending",none:"none"},T={asc:"sortDown12",desc:"sortUp12",none:"sort12"},y=o?l.createElement(l.Fragment,null," ",l.createElement(M.EbayIcon,{name:T[o]})):null;let u=p;return i?u=l.createElement("a",{href:i,onClick:b},p,y):o&&(u=l.createElement("button",{type:"button",onClick:b},p,y)),l.createElement(g,Object.assign({},s,{rowHeader:!0,columnType:E,"aria-sort":o?m[o]:void 0}),u)},N=a=>{var{name:E,className:c,selected:o,mode:i,a11ySelectRowText:p,children:b,onSelect:s,__headers:m}=a,T=f.__rest(a,["name","className","selected","mode","a11ySelectRowText","children","onSelect","__headers"]);const y=O.filterByType(b,g),u=(r,{checked:S})=>{s(r,{name:E,selected:S})};return l.createElement("tr",Object.assign({className:c},T),i==="selection"&&l.createElement(g,{rowHeader:!0,key:"selection-cell"},l.createElement(I.EbayCheckbox,{checked:o,"aria-label":p||"Select row",onChange:u})),m==null?void 0:m.map((r,S)=>l.cloneElement(y[S],{rowHeader:typeof r.props.rowHeader=="boolean"?r.props.rowHeader:y[S].props.rowHeader,columnType:typeof r.props.columnType=="string"?r.props.columnType:y[S].props.columnType})))},z=a=>{var{className:E,mode:c,allSelected:o,density:i,a11ySelectAllText:p,a11ySelectRowText:b,onSelect:s,onSort:m,children:T}=a,y=f.__rest(a,["className","mode","allSelected","density","a11ySelectAllText","a11ySelectRowText","onSelect","onSort","children"]);const u=O.filterByType(T,_),r=O.filterByType(T,N),[S,$]=l.useState(()=>u.reduce((e,t,n)=>(t.props.sort&&(e[t.props.name||`${n}`]=t.props.sort),e),{})),[v,x]=l.useState(()=>r.reduce((e,t,n)=>(e[t.props.name||`${n}`]=typeof t.props.selected=="boolean"?t.props.selected:!1,e),{}));function w(e){const t=Object.values(e).filter(Boolean).length,n=Object.values(e).length-t;return t===0?"false":n===0?"true":"mixed"}const j=typeof o<"u"?o:w(v),k=e=>{const t=r.reduce((n,d,h)=>(n[d.props.name||`${h}`]=j==="false"||j==="mixed",n),{});x(t),s==null||s(e,{selected:t,allSelected:w(t)})},R=(e,{name:t,selected:n})=>{const d=Object.assign(Object.assign({},v),{[t||""]:n});x(d),s==null||s(e,{selected:d,allSelected:w(d)})},q=(e,t)=>{const n={none:"asc",asc:"desc",desc:"none"},d=Object.entries(S).reduce((h,[C,A])=>(C===t?h[C]=n[A]:h[C]="none",h),{});$(d),m==null||m(e,{sorted:{[t]:d[t]}})};return l.createElement("div",Object.assign({},y,{className:H("table",E,{"table--mode-selection":c==="selection",[`table--density-${i}`]:i}),role:"group",tabIndex:0}),l.createElement("table",null,l.createElement("thead",null,l.createElement("tr",null,c==="selection"&&l.createElement(_,{key:"selection-all-cell"},l.createElement(B.EbayTriStateCheckbox,{"aria-label":p||"Select all rows",checked:j,onChange:k})),u.map((e,t)=>l.cloneElement(e,{sort:S[e.props.name||`${t}`],onSort:n=>q(n,e.props.name||`${t}`)})))),l.createElement("tbody",null,r.map((e,t)=>l.cloneElement(e,{mode:c,name:e.props.name||`${t}`,a11ySelectRowText:e.props.a11ySelectRowText||b,onSelect:(n,d)=>R(n,Object.assign(Object.assign({},d),{name:e.props.name||`${t}`})),selected:typeof e.props.selected=="boolean"?e.props.selected:v[e.props.name||`${t}`],__headers:u})))))};exports.EbayTable=z;exports.EbayTableCell=g;exports.EbayTableHeader=_;exports.EbayTableRow=N;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ComponentProps, FC } from 'react';
|
|
2
|
+
import type { ColumnType } from './types';
|
|
3
|
+
export type EbayTableCellProps = ComponentProps<'td' | 'th'> & {
|
|
4
|
+
rowHeader?: boolean;
|
|
5
|
+
columnType?: ColumnType;
|
|
6
|
+
};
|
|
7
|
+
declare const EbayTableCell: FC<EbayTableCellProps>;
|
|
8
|
+
export default EbayTableCell;
|
|
9
|
+
//# sourceMappingURL=table-cell.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-cell.d.ts","sourceRoot":"","sources":["../../src/ebay-table/table-cell.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,cAAc,EAAE,EAAE,EAAY,MAAM,OAAO,CAAA;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAGzC,MAAM,MAAM,kBAAkB,GAAG,cAAc,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG;IAC3D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,UAAU,CAAC;CAC3B,CAAA;AAED,QAAA,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,CAqBzC,CAAA;AAED,eAAe,aAAa,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ComponentProps, FC } from 'react';
|
|
2
|
+
import type { ColumnType, TableHeaderSortHandler, TableSort } from './types';
|
|
3
|
+
export type EbayTableHeaderProps = ComponentProps<'th'> & {
|
|
4
|
+
columnType?: ColumnType;
|
|
5
|
+
name?: string;
|
|
6
|
+
sort?: TableSort;
|
|
7
|
+
href?: string;
|
|
8
|
+
rowHeader?: boolean;
|
|
9
|
+
onSort?: TableHeaderSortHandler;
|
|
10
|
+
};
|
|
11
|
+
export declare const EbayTableHeader: FC<EbayTableHeaderProps>;
|
|
12
|
+
export default EbayTableHeader;
|
|
13
|
+
//# sourceMappingURL=table-header.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-header.d.ts","sourceRoot":"","sources":["../../src/ebay-table/table-header.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,cAAc,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,sBAAsB,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAI5E,MAAM,MAAM,oBAAoB,GAAG,cAAc,CAAC,IAAI,CAAC,GAAG;IACtD,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IAGd,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,sBAAsB,CAAA;CAClC,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CAsDpD,CAAA;AAED,eAAe,eAAe,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Component, ComponentProps, FC } from 'react';
|
|
2
|
+
import type { EbayTableHeaderProps } from './table-header';
|
|
3
|
+
import { TableRowSelectHandler, TableMode } from './types';
|
|
4
|
+
export type EbayTableRowProps = Omit<ComponentProps<'tr'>, 'onSelect'> & {
|
|
5
|
+
name?: string;
|
|
6
|
+
selected?: boolean;
|
|
7
|
+
mode?: TableMode;
|
|
8
|
+
a11ySelectRowText?: string;
|
|
9
|
+
onSelect?: TableRowSelectHandler;
|
|
10
|
+
/**
|
|
11
|
+
* This property is used by EbayTable to make sure that headers match up with the correct cells
|
|
12
|
+
* NOTE: The flag "@deprecated" is only to not show this property in the autocomplete list on the top
|
|
13
|
+
* @deprecated
|
|
14
|
+
*/
|
|
15
|
+
__headers?: Component<EbayTableHeaderProps>[];
|
|
16
|
+
};
|
|
17
|
+
declare const EbayTableRow: FC<EbayTableRowProps>;
|
|
18
|
+
export default EbayTableRow;
|
|
19
|
+
//# sourceMappingURL=table-row.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-row.d.ts","sourceRoot":"","sources":["../../src/ebay-table/table-row.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAAE,cAAc,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAC5D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AAG1D,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAG1D,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC,GAAG;IACrE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,qBAAqB,CAAC;IAEjC;;;;OAIG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC,oBAAoB,CAAC,EAAE,CAAC;CACjD,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CAqCvC,CAAA;AAED,eAAe,YAAY,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ComponentProps, FC } from 'react';
|
|
2
|
+
import { CheckboxState } from '../ebay-tri-state-checkbox';
|
|
3
|
+
import type { TableSelectHandler, TableSortHandler, TableDensity, TableMode } from './types';
|
|
4
|
+
export type EbayTableProps = Omit<ComponentProps<'div'>, 'onSelect'> & {
|
|
5
|
+
mode?: TableMode;
|
|
6
|
+
allSelected?: CheckboxState;
|
|
7
|
+
density?: TableDensity;
|
|
8
|
+
a11ySelectAllText?: string;
|
|
9
|
+
a11ySelectRowText?: string;
|
|
10
|
+
onSelect?: TableSelectHandler;
|
|
11
|
+
onSort?: TableSortHandler;
|
|
12
|
+
};
|
|
13
|
+
declare const EbayTable: FC<EbayTableProps>;
|
|
14
|
+
export default EbayTable;
|
|
15
|
+
//# sourceMappingURL=table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../src/ebay-table/table.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,cAAc,EAAE,EAAE,EAAwB,MAAM,OAAO,CAAA;AAEvE,OAAO,EAAwB,aAAa,EAAiC,MAAM,4BAA4B,CAAA;AAC/G,OAAO,KAAK,EACR,kBAAkB,EAClB,gBAAgB,EAChB,YAAY,EACZ,SAAS,EAGZ,MAAM,SAAS,CAAA;AAKhB,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,GAAG;IACnE,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,WAAW,CAAC,EAAE,aAAa,CAAC;IAC5B,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAC9B,MAAM,CAAC,EAAE,gBAAgB,CAAC;CAC7B,CAAA;AAED,QAAA,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,CA8IjC,CAAA;AACD,eAAe,SAAS,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { MouseEvent } from 'react';
|
|
2
|
+
import type { CheckboxState } from '../ebay-tri-state-checkbox/types';
|
|
3
|
+
import type { EbayChangeEventHandler, EbayMouseEventHandler } from '../events';
|
|
4
|
+
export type ColumnType = 'normal' | 'numeric' | 'layout' | 'icon-action';
|
|
5
|
+
export type TableDensity = 'compact' | 'relaxed';
|
|
6
|
+
export type TableMode = 'none' | 'selection';
|
|
7
|
+
export type TableSort = 'none' | 'asc' | 'desc';
|
|
8
|
+
export type TableSelectEventData = {
|
|
9
|
+
selected?: Record<string, boolean>;
|
|
10
|
+
allSelected?: CheckboxState;
|
|
11
|
+
};
|
|
12
|
+
export type TableSelectHandler = EbayChangeEventHandler<HTMLInputElement, TableSelectEventData>;
|
|
13
|
+
export type TableRowSelectEventData = {
|
|
14
|
+
name?: string;
|
|
15
|
+
selected: boolean;
|
|
16
|
+
};
|
|
17
|
+
export type TableRowSelectHandler = EbayChangeEventHandler<HTMLInputElement, TableRowSelectEventData>;
|
|
18
|
+
export type TableSortEventData = {
|
|
19
|
+
sorted: Record<string, TableSort>;
|
|
20
|
+
};
|
|
21
|
+
export type TableSortHandler = (event: MouseEvent<HTMLButtonElement>, data: TableSortEventData) => void;
|
|
22
|
+
export type TableHeaderSortHandler = EbayMouseEventHandler<HTMLButtonElement> & EbayMouseEventHandler<HTMLAnchorElement>;
|
|
23
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/ebay-table/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAClC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAA;AACrE,OAAO,KAAK,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAA;AAE9E,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,aAAa,CAAC;AACzE,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,SAAS,CAAC;AACjD,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,WAAW,CAAC;AAC7C,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,CAAC;AAEhD,MAAM,MAAM,oBAAoB,GAAG;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,WAAW,CAAC,EAAE,aAAa,CAAC;CAC/B,CAAA;AACD,MAAM,MAAM,kBAAkB,GAAG,sBAAsB,CAAC,gBAAgB,EAAE,oBAAoB,CAAC,CAAA;AAE/F,MAAM,MAAM,uBAAuB,GAAG;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;CACrB,CAAA;AACD,MAAM,MAAM,qBAAqB,GAAG,sBAAsB,CAAC,gBAAgB,EAAE,uBAAuB,CAAC,CAAA;AAErG,MAAM,MAAM,kBAAkB,GAAG;IAC7B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;CACpC,CAAA;AACD,MAAM,MAAM,gBAAgB,GAAG,CAAC,KAAK,EAAE,UAAU,CAAC,iBAAiB,CAAC,EAAE,IAAI,EAAE,kBAAkB,KAAK,IAAI,CAAA;AAEvG,MAAM,MAAM,sBAAsB,GAAG,qBAAqB,CAAC,iBAAiB,CAAC,GACzE,qBAAqB,CAAC,iBAAiB,CAAC,CAAA"}
|
package/ebay-textbox/index.d.ts
CHANGED
|
@@ -3,6 +3,5 @@ export { default as EbayTextboxPrefixIcon } from './prefix-icon';
|
|
|
3
3
|
export { default as EbayTextboxPrefixText } from './prefix-text';
|
|
4
4
|
export { default as EbayTextboxPostfixIcon } from './postfix-icon';
|
|
5
5
|
export { default as EbayTextboxPostfixText } from './postfix-text';
|
|
6
|
-
export { useFloatingLabel } from '../common/floating-label-utils/hooks';
|
|
7
6
|
export type { Size } from './types';
|
|
8
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ebay-textbox/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,WAAW,CAAA;AACzE,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,eAAe,CAAA;AAChE,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,eAAe,CAAA;AAChE,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,gBAAgB,CAAA;AAClE,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,gBAAgB,CAAA;AAClE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ebay-textbox/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,WAAW,CAAA;AACzE,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,eAAe,CAAA;AAChE,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,eAAe,CAAA;AAChE,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,gBAAgB,CAAA;AAClE,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,gBAAgB,CAAA;AAClE,YAAY,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA"}
|
package/ebay-textbox/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 x=require("../textbox-90ZPJmqa.js");exports.EbayTextbox=x.EbayTextbox;exports.EbayTextboxPostfixIcon=x.EbayTextboxPostfixIcon;exports.EbayTextboxPostfixText=x.EbayTextboxPostfixText;exports.EbayTextboxPrefixIcon=x.EbayTextboxPrefixIcon;exports.EbayTextboxPrefixText=x.EbayTextboxPrefixText;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textbox.d.ts","sourceRoot":"","sources":["../../src/ebay-textbox/textbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EACI,cAAc,EAAM,GAAG,EAGxC,MAAM,OAAO,CAAA;AAQd,OAAO,EACH,sBAAsB,EACtB,gBAAgB,EAChB,qBAAqB,EACrB,wBAAwB,EAAE,qBAAqB,EAClD,MAAM,6BAA6B,CAAA;AACpC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAEnC,eAAO,MAAM,YAAY,WAAY,OAAO,KAAG,OAAuC,CAAA;AAEtF,KAAK,cAAc,GAAG,cAAc,CAAC,OAAO,CAAC,GAAG,cAAc,CAAC,UAAU,CAAC,CAAA;AAE1E,MAAM,MAAM,iBAAiB,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAA;AACjD,MAAM,MAAM,gBAAgB,GAAG;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,sBAAsB,CAAC,mBAAmB,GAAG,gBAAgB,EAAE,iBAAiB,CAAC,CAAC;IAC7F,aAAa,CAAC,EAAE,sBAAsB,CAAC,mBAAmB,GAAG,gBAAgB,EAAE,iBAAiB,CAAC,CAAC;IAClG,OAAO,CAAC,EAAE,qBAAqB,CAAC,mBAAmB,GAAG,gBAAgB,EAAE,iBAAiB,CAAC,CAAC;IAC3F,MAAM,CAAC,EAAE,qBAAqB,CAAC,mBAAmB,GAAG,gBAAgB,EAAE,iBAAiB,CAAC,CAAC;IAC1F,UAAU,CAAC,EAAE,wBAAwB,CAAC,mBAAmB,GAAG,gBAAgB,EAAE,iBAAiB,CAAC,CAAC;IACjG,OAAO,CAAC,EAAE,wBAAwB,CAAC,mBAAmB,GAAG,gBAAgB,EAAE,iBAAiB,CAAC,CAAC;IAC9F,SAAS,CAAC,EAAE,wBAAwB,CAAC,mBAAmB,GAAG,gBAAgB,EAAE,iBAAiB,CAAC,CAAC;IAChG,SAAS,CAAC,EAAE,gBAAgB,CAAC,mBAAmB,GAAG,gBAAgB,EAAE,iBAAiB,CAAC,CAAC;IACxF,mBAAmB,CAAC,EAAE,MAAM,IAAI,CAAC;IACjC,aAAa,CAAC,EAAE,wBAAwB,CAAC,gBAAgB,EAAE,iBAAiB,CAAC,GACzE,qBAAqB,CAAC,gBAAgB,EAAE,iBAAiB,CAAC,CAAC;IAC/D,YAAY,CAAC,EAAE,GAAG,CAAC,mBAAmB,GAAG,gBAAgB,CAAC,CAAC;IAC3D,WAAW,CAAC,EAAE,OAAO,CAAC;CACzB,GAAG,IAAI,CAAC,cAAc,EAAE,SAAS,GAAG,QAAQ,GAAG,UAAU,GAAG,YAAY,GAAG,SAAS,GAAG,WAAW,GAAG,WAAW,CAAC,CAAC;;
|
|
1
|
+
{"version":3,"file":"textbox.d.ts","sourceRoot":"","sources":["../../src/ebay-textbox/textbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EACI,cAAc,EAAM,GAAG,EAGxC,MAAM,OAAO,CAAA;AAQd,OAAO,EACH,sBAAsB,EACtB,gBAAgB,EAChB,qBAAqB,EACrB,wBAAwB,EAAE,qBAAqB,EAClD,MAAM,6BAA6B,CAAA;AACpC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAEnC,eAAO,MAAM,YAAY,WAAY,OAAO,KAAG,OAAuC,CAAA;AAEtF,KAAK,cAAc,GAAG,cAAc,CAAC,OAAO,CAAC,GAAG,cAAc,CAAC,UAAU,CAAC,CAAA;AAE1E,MAAM,MAAM,iBAAiB,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAA;AACjD,MAAM,MAAM,gBAAgB,GAAG;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,sBAAsB,CAAC,mBAAmB,GAAG,gBAAgB,EAAE,iBAAiB,CAAC,CAAC;IAC7F,aAAa,CAAC,EAAE,sBAAsB,CAAC,mBAAmB,GAAG,gBAAgB,EAAE,iBAAiB,CAAC,CAAC;IAClG,OAAO,CAAC,EAAE,qBAAqB,CAAC,mBAAmB,GAAG,gBAAgB,EAAE,iBAAiB,CAAC,CAAC;IAC3F,MAAM,CAAC,EAAE,qBAAqB,CAAC,mBAAmB,GAAG,gBAAgB,EAAE,iBAAiB,CAAC,CAAC;IAC1F,UAAU,CAAC,EAAE,wBAAwB,CAAC,mBAAmB,GAAG,gBAAgB,EAAE,iBAAiB,CAAC,CAAC;IACjG,OAAO,CAAC,EAAE,wBAAwB,CAAC,mBAAmB,GAAG,gBAAgB,EAAE,iBAAiB,CAAC,CAAC;IAC9F,SAAS,CAAC,EAAE,wBAAwB,CAAC,mBAAmB,GAAG,gBAAgB,EAAE,iBAAiB,CAAC,CAAC;IAChG,SAAS,CAAC,EAAE,gBAAgB,CAAC,mBAAmB,GAAG,gBAAgB,EAAE,iBAAiB,CAAC,CAAC;IACxF,mBAAmB,CAAC,EAAE,MAAM,IAAI,CAAC;IACjC,aAAa,CAAC,EAAE,wBAAwB,CAAC,gBAAgB,EAAE,iBAAiB,CAAC,GACzE,qBAAqB,CAAC,gBAAgB,EAAE,iBAAiB,CAAC,CAAC;IAC/D,YAAY,CAAC,EAAE,GAAG,CAAC,mBAAmB,GAAG,gBAAgB,CAAC,CAAC;IAC3D,WAAW,CAAC,EAAE,OAAO,CAAC;CACzB,GAAG,IAAI,CAAC,cAAc,EAAE,SAAS,GAAG,QAAQ,GAAG,UAAU,GAAG,YAAY,GAAG,SAAS,GAAG,WAAW,GAAG,WAAW,CAAC,CAAC;;AAqJnH,wBAA4D"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# EbayTriStateCheckbox
|
|
2
|
+
|
|
3
|
+
## Demo
|
|
4
|
+
|
|
5
|
+
[Storybook](https://opensource.ebay.com/ebayui-core-react/main/?path=/story/form-input-ebay-tri-state-checkbox--default)
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
```
|
|
9
|
+
yarn add @ebay/ui-core-react
|
|
10
|
+
```
|
|
11
|
+
### Import JS
|
|
12
|
+
```jsx harmony
|
|
13
|
+
import {
|
|
14
|
+
EbayTriStateCheckbox,
|
|
15
|
+
type TriStateCheckboxChangeHandler,
|
|
16
|
+
type TriStateCheckboxFocusHandler,
|
|
17
|
+
type TriStateCheckboxKeyDownHandler
|
|
18
|
+
} from '@ebay/ui-core-react/ebay-tri-state-checkbox'
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Import following styles from Skin
|
|
22
|
+
```jsx harmony
|
|
23
|
+
import '@ebay/skin/checkbox'
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## ...or using SCSS/CSS
|
|
27
|
+
```jsx harmony
|
|
28
|
+
import '@ebay/skin/checkbox.css'
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Import icons
|
|
32
|
+
|
|
33
|
+
Add the below icons to the `EbaySvg` component.
|
|
34
|
+
|
|
35
|
+
Note: Make sure that `EbaySvg` is only rendered on the server so it does not affect the client bundle size.
|
|
36
|
+
|
|
37
|
+
```tsx
|
|
38
|
+
<EbaySvg
|
|
39
|
+
icons={[
|
|
40
|
+
"checkboxChecked18",
|
|
41
|
+
"checkboxUnchecked18",
|
|
42
|
+
"checkboxMixed18",
|
|
43
|
+
|
|
44
|
+
// If using large checkboxes
|
|
45
|
+
"checkboxChecked24",
|
|
46
|
+
"checkboxUnchecked24",
|
|
47
|
+
"checkboxMixed24",
|
|
48
|
+
]}
|
|
49
|
+
/>
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
```jsx
|
|
54
|
+
import { EbayLabel } from '@ebay/ui-core-react/ebay-field';
|
|
55
|
+
|
|
56
|
+
<EbayTriStateCheckbox id="checkbox-1" size="large">
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Attributes
|
|
60
|
+
|
|
61
|
+
| Name | Type | Stateful | Description | Data |
|
|
62
|
+
|------------------|----------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------|
|
|
63
|
+
| `size` | String | No | Either `large` or `regular` (default). Sets the checkbox icon size. For mweb this should be set to `large`. (Note: The dimensions of the radio will not change, but only the icon) |
|
|
64
|
+
| `disabled` | Boolean | No | |
|
|
65
|
+
| `checked` | CheckboxState | No | indicates the checked value of the input element, which can be either "true", "false" or "mixed" | |
|
|
66
|
+
| `onChange` | Function | - | Callback fired on change | `(event: ChangeEvent, { value: string, checked: CheckboxState })` | |
|
|
67
|
+
| `onFocus` | Function | - | Callback fired when button is focused | `(event: FocusEvent, { value: string, checked: CheckboxState })` | |
|
|
68
|
+
| `onKeyDown` | Function | - | Callback fired when key is pressed | `(event: KeyboardEvent, { value: string, checked: CheckboxState })` | |
|
|
69
|
+
|
|
70
|
+
It supports all the events supported by an input element (e.g. `onClick`)
|
|
71
|
+
Note: For this component, `className`/`style` are applied to the root tag, while all other HTML attributes are applied to the `input` tag.
|
|
72
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ebay-tri-state-checkbox/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AACtE,cAAc,SAAS,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../tri-state-checkbox-BX-snR_a.js");exports.EbayTriStateCheckbox=e.EbayTriStateCheckbox;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React, { ComponentProps, FC } from 'react';
|
|
2
|
+
import { CheckboxState, TriStateCheckboxChangeHandler, TriStateCheckboxFocusHandler, TriStateCheckboxKeyDownHandler, Size } from './types';
|
|
3
|
+
export type EbayTriStateCheckboxProps = Omit<ComponentProps<'input'>, 'size' | 'onChange' | 'onFocus' | 'onKeyDown' | 'checked' | 'defaultChecked' | 'ref'> & {
|
|
4
|
+
checked?: CheckboxState;
|
|
5
|
+
defaultChecked?: CheckboxState;
|
|
6
|
+
skipMixed?: boolean;
|
|
7
|
+
size?: Size;
|
|
8
|
+
onChange?: TriStateCheckboxChangeHandler;
|
|
9
|
+
onFocus?: TriStateCheckboxFocusHandler;
|
|
10
|
+
onKeyDown?: TriStateCheckboxKeyDownHandler;
|
|
11
|
+
inputRef?: React.LegacyRef<HTMLInputElement>;
|
|
12
|
+
};
|
|
13
|
+
declare const EbayTriStateCheckbox: FC<EbayTriStateCheckboxProps>;
|
|
14
|
+
export default EbayTriStateCheckbox;
|
|
15
|
+
//# sourceMappingURL=tri-state-checkbox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tri-state-checkbox.d.ts","sourceRoot":"","sources":["../../src/ebay-tri-state-checkbox/tri-state-checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAe,cAAc,EAAE,EAAE,EAAuC,MAAM,OAAO,CAAA;AAGnG,OAAO,EACH,aAAa,EACb,6BAA6B,EAC7B,4BAA4B,EAC5B,8BAA8B,EAC9B,IAAI,EACP,MAAM,SAAS,CAAA;AAEhB,MAAM,MAAM,yBAAyB,GACjC,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,gBAAgB,GAAG,KAAK,CAAC,GACjH;IACE,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,cAAc,CAAC,EAAE,aAAa,CAAC;IAC/B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,QAAQ,CAAC,EAAE,6BAA6B,CAAC;IACzC,OAAO,CAAC,EAAE,4BAA4B,CAAC;IACvC,SAAS,CAAC,EAAE,8BAA8B,CAAC;IAC3C,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;CAChD,CAAA;AAIL,QAAA,MAAM,oBAAoB,EAAE,EAAE,CAAC,yBAAyB,CA4EvD,CAAA;AAED,eAAe,oBAAoB,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { EbayChangeEventHandler, EbayFocusEventHandler, EbayKeyboardEventHandler } from 'src/events';
|
|
2
|
+
export type Size = 'default' | 'large';
|
|
3
|
+
export type CheckboxState = 'true' | 'false' | 'mixed';
|
|
4
|
+
export type TriStateCheckboxEventData = {
|
|
5
|
+
value: string | number;
|
|
6
|
+
checked: CheckboxState;
|
|
7
|
+
};
|
|
8
|
+
export type TriStateCheckboxChangeHandler = EbayChangeEventHandler<HTMLInputElement, TriStateCheckboxEventData>;
|
|
9
|
+
export type TriStateCheckboxFocusHandler = EbayFocusEventHandler<HTMLInputElement, TriStateCheckboxEventData>;
|
|
10
|
+
export type TriStateCheckboxKeyDownHandler = EbayKeyboardEventHandler<HTMLInputElement, TriStateCheckboxEventData>;
|
|
11
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/ebay-tri-state-checkbox/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAA;AAEpG,MAAM,MAAM,IAAI,GAAG,SAAS,GAAG,OAAO,CAAA;AACtC,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAA;AAEtD,MAAM,MAAM,yBAAyB,GAAG;IACpC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,OAAO,EAAE,aAAa,CAAA;CACzB,CAAA;AAED,MAAM,MAAM,6BAA6B,GAAG,sBAAsB,CAAC,gBAAgB,EAAE,yBAAyB,CAAC,CAAA;AAC/G,MAAM,MAAM,4BAA4B,GAAG,qBAAqB,CAAC,gBAAgB,EAAE,yBAAyB,CAAC,CAAA;AAC7G,MAAM,MAAM,8BAA8B,GAAG,wBAAwB,CAAC,gBAAgB,EAAE,yBAAyB,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const f=require("./tslib.es6-C4EgNkz1.js"),a=require("react"),t=require("classnames"),E=require("makeup-floating-label");function k({text:n,disabled:g,invalid:m,size:_,type:r,opaqueLabel:N,containerTagName:C="span",onMount:L=()=>{}}){const s=a.useRef(null),i=a.useRef();a.useLayoutEffect(()=>{var e;(e=i.current)===null||e===void 0||e.refresh()}),a.useLayoutEffect(()=>{if(!(!n||r==="date"))return s.current&&(i.current=new E(s.current),L()),()=>{var e;(e=i.current)===null||e===void 0||e.destroy()}},[n,r]);const u=t("floating-label",{"floating-label--large":_==="large","floating-label--opaque":N}),v=a.useCallback(({children:e})=>a.createElement(a.Fragment,null,e),[]),F=a.useCallback(a.forwardRef((e,l)=>{var{className:c}=e,q=f.__rest(e,["className"]);return a.createElement(C,Object.assign({},q,{ref:o=>{s.current=o,typeof l=="function"?l(o):l&&(l.current=o)},className:t(c,u)}))}),[u]),b=t("floating-label__label",{"floating-label__label--disabled":g,"floating-label__label--inline":r!=="date","floating-label__label--invalid":m}),d=a.useCallback(e=>{var{className:l}=e,c=f.__rest(e,["className"]);return a.createElement("label",Object.assign({},c,{className:t(l,b)}),n)},[b,n]);return n?{Label:d,Container:F}:{Label:()=>null,Container:v}}exports.useFloatingLabel=k;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const b=require("./tslib.es6-C4EgNkz1.js"),a=require("react"),n=require("classnames"),d=require("./dialog-previous-button-vXOjDN7l.js");require("./icon-button-CZtp0khK.js");const m=i=>{var{open:l,mode:r,size:t,bannerImgSrc:o,bannerImgPosition:g,onClose:s=()=>{}}=i,e=b.__rest(i,["open","mode","size","bannerImgSrc","bannerImgPosition","onClose"]);const c=o?a.createElement("div",{className:"lightbox-dialog__image",style:{backgroundImage:`url(${o})`,backgroundPosition:g}}):e.top;return a.createElement(d.DialogBaseWithState,Object.assign({buttonPosition:"right"},e,{classPrefix:"lightbox-dialog",onCloseBtnClick:s,onBackgroundClick:s,className:n(e.className,"lightbox-dialog--mask-fade",{[`lightbox-dialog--${t}`]:t,"lightbox-dialog--expressive":o}),windowClass:n("lightbox-dialog__window--fade",{"lightbox-dialog__window--mini":r==="mini"}),top:c,open:l}))};exports.EbayLightboxDialog=m;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const N=require("./tslib.es6-C4EgNkz1.js"),e=require("react"),d=require("classnames"),h=require("./utils-C9NL3q0j.js"),B=require("./menu-D2zjriWy.js"),ne=require("./button-DpMwH1cr.js"),te=require("./icon-button-CZtp0khK.js"),w=require("./icon-CeLPlCml.js"),ae=require("./forwardRef-irqyO_PF.js"),oe=require("./index-Bsb1LHpi.js"),se=require("./dropdown-
|
|
1
|
+
"use strict";const N=require("./tslib.es6-C4EgNkz1.js"),e=require("react"),d=require("classnames"),h=require("./utils-C9NL3q0j.js"),B=require("./menu-D2zjriWy.js"),ne=require("./button-DpMwH1cr.js"),te=require("./icon-button-CZtp0khK.js"),w=require("./icon-CeLPlCml.js"),ae=require("./forwardRef-irqyO_PF.js"),oe=require("./index-Bsb1LHpi.js"),se=require("./dropdown-BLiIyhWy.js"),ce=a=>{var{type:o,variant:s="button",className:m,text:b="",fixWidth:p,reverse:r,expanded:g,noToggleIcon:l,checked:f,collapseOnSelect:M,a11yText:S,prefixId:k,prefixLabel:j,onClick:L=()=>{},onExpand:T=()=>{},onCollapse:R=()=>{},onChange:A=()=>{},onSelect:D=()=>{},children:E}=a,F=N.__rest(a,["type","variant","className","text","fixWidth","reverse","expanded","noToggleIcon","checked","collapseOnSelect","a11yText","prefixId","prefixLabel","onClick","onExpand","onCollapse","onChange","onSelect","children"]);const[c,x]=e.useState(g),[v,K]=e.useState(),{overlayStyles:W,refs:u}=se.useFloatingDropdown({open:c,options:{reverse:r}}),H=u.host,P=u.overlay,I=h.filterByType(E,[B.EbayMenuItem,O]),V=I.map(n=>!!n.props.checked),[y,$]=e.useState(V),z=h.findComponent(E,q),G=h.findComponent(E,w.EbayIcon),J=re({text:b,prefixId:k,prefixLabel:j,menuButtonLabel:z,icon:G}),Q=d("menu-button",m),U=d("menu-button__menu",{"menu-button__menu--fix-width":p,"menu-button__menu--reverse":r});e.useEffect(()=>{const n=t=>{const i=P.current,_=i&&i.contains(t.target);(M||!_)&&x(!1)};return c?(T(),setTimeout(()=>{document.addEventListener("click",n,!1)})):c===!1&&R(),()=>document.removeEventListener("click",n,!1)},[c]),e.useEffect(()=>{K(ae.randomId())},[]);const X=n=>{oe.handleEscapeKeydown(n,()=>{var t;x(!1),(t=H.current)===null||t===void 0||t.focus()})},C=Object.assign({ref:u.setHost,className:"menu-button__button","aria-expanded":!!c,"aria-haspopup":!0,"aria-label":S,"aria-controls":v,"aria-labelledby":k,onClick:n=>{x(!c),L(n)}},F),Y=(n,t)=>{if(o==="radio"||o==="checkbox"){const i=y.map((_,ee)=>t.indexes.includes(ee));$(i)}A(n,t)},Z=()=>{const n=y.findIndex(Boolean);return n>-1?n:f};return e.createElement("span",{className:Q},s==="overflow"?e.createElement(te.EbayIconButton,Object.assign({icon:"overflowVertical16"},C)):e.createElement(ne.EbayButton,Object.assign({variant:s==="form"?"form":void 0},C),J,l?null:e.createElement(w.EbayIcon,{name:"chevronDown12"})),c&&e.createElement(B.EbayMenu,{baseEl:"div",ref:u.setOverlay,type:o,className:U,tabIndex:-1,id:v,autofocus:!0,checked:Z(),onKeyDown:X,onChange:Y,onSelect:D,style:W},I.map((n,t)=>e.cloneElement(n,Object.assign(Object.assign({},n.props),{className:d(n.props.className,"menu-button__item"),key:t,checked:y[t]})))))};function re({text:a,prefixId:o,prefixLabel:s,menuButtonLabel:m,icon:b}){const p=a.length?e.createElement("span",null,a):null,r=!o&&s&&e.createElement(e.Fragment,null,e.createElement("span",{className:"menu-button-prefix-label",key:"prefix-label"},s)," ");return[b,r,m||p].filter(Boolean).map((l,f)=>e.cloneElement(l,Object.assign(Object.assign({},l.props),{key:f})))}const O=a=>{var{className:o}=a,s=N.__rest(a,["className"]);return e.createElement("hr",Object.assign({},s,{className:d(o,"menu-button__separator"),role:"separator"}))},q=({children:a})=>e.createElement(e.Fragment,null,a);exports.EbayMenuButton=ce;exports.EbayMenuButtonLabel=q;exports.EbayMenuButtonSeparator=O;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const x=require("./tslib.es6-C4EgNkz1.js"),e=require("react"),s=require("classnames"),m=require("./utils-C9NL3q0j.js"),R=require("./index-Bsb1LHpi.js"),H=require("./forwardRef-irqyO_PF.js"),W=require("./button-DpMwH1cr.js"),z=require("./icon-CeLPlCml.js"),P=require("./icon-button-CZtp0khK.js"),_=require("./menu-item-C3XRMJzc.js"),$=require("./dropdown-
|
|
1
|
+
"use strict";const x=require("./tslib.es6-C4EgNkz1.js"),e=require("react"),s=require("classnames"),m=require("./utils-C9NL3q0j.js"),R=require("./index-Bsb1LHpi.js"),H=require("./forwardRef-irqyO_PF.js"),W=require("./button-DpMwH1cr.js"),z=require("./icon-CeLPlCml.js"),P=require("./icon-button-CZtp0khK.js"),_=require("./menu-item-C3XRMJzc.js"),$=require("./dropdown-BLiIyhWy.js"),A=o=>{var{a11yText:r,noToggleIcon:u,fixWidth:B,reverse:b,variant:f,expanded:I=!1,className:w,onCollapse:h=()=>{},onExpand:q=()=>{},onMouseDown:N=()=>{},onSelect:F=()=>{},text:p="",children:c}=o,S=x.__rest(o,["a11yText","noToggleIcon","fixWidth","reverse","variant","expanded","className","onCollapse","onExpand","onMouseDown","onSelect","text","children"]);const[a,l]=e.useState(I),[E,C]=e.useState(),y=m.findComponent(c,z.EbayIcon),O=m.findComponent(c,g)||(y?e.createElement("span",null,p):p),T=m.filterByType(c,[k,M]),{overlayStyles:j,refs:i}=$.useFloatingDropdown({open:a,options:{reverse:b}}),d=i.host;e.useEffect(()=>{const t=n=>{d.current&&!d.current.contains(n.currentTarget)&&l(!1)};return a?(q(),setTimeout(()=>{document.addEventListener("click",t,!1)})):a===!1&&h(),()=>document.removeEventListener("click",t,!1)},[a]),e.useEffect(()=>{C(H.randomId())},[]);const D=t=>{R.handleEscapeKeydown(t,()=>{var n;l(!1),(n=d.current)===null||n===void 0||n.focus()})},L=s("fake-menu-button__menu",{"menu-button__menu--fix-width":B,"menu-button__menu--reverse":b}),v=Object.assign({ref:i.setHost,className:"fake-menu-button__button","aria-expanded":!!a,"aria-haspopup":!0,"aria-label":r,"aria-controls":E,onClick:()=>l(!a)},S);return e.createElement("span",{className:s("fake-menu-button",w)},f==="overflow"?e.createElement(P.EbayIconButton,Object.assign({icon:"overflowHorizontal24"},v)):e.createElement(W.EbayButton,Object.assign({variant:f==="form"?"form":void 0,bodyState:u?void 0:"expand"},v),y,O),a&&e.createElement(_.EbayFakeMenu,{ref:i.setOverlay,className:L,id:E,tabIndex:-1,onKeyDown:D,onSelect:F,style:j},T.map((t,n)=>e.cloneElement(t,Object.assign(Object.assign({},t.props),{onMouseDown:K=>{N(K,{index:n})},className:s(t.props.className,"fake-menu-button__item"),key:n,autoFocus:n===0})))))},k=_.EbayMenuItem,M=o=>{var{className:r}=o,u=x.__rest(o,["className"]);return e.createElement("hr",Object.assign({},u,{className:s(r,"menu-button__separator"),role:"separator"}))},g=({children:o})=>e.createElement(e.Fragment,null,o);exports.EbayFakeMenuButtonItem=k;exports.EbayFakeMenuButtonLabel=g;exports.EbayMenuButton=A;exports.EbayMenuButtonSeparator=M;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ebay/ui-core-react",
|
|
3
|
-
"version": "8.0
|
|
3
|
+
"version": "8.1.0",
|
|
4
4
|
"description": "Skin components build off React",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org",
|
|
@@ -65,6 +65,7 @@
|
|
|
65
65
|
"classnames": "^2.2.6",
|
|
66
66
|
"makeup-active-descendant": "^0.7.4",
|
|
67
67
|
"makeup-expander": "^0.10.1",
|
|
68
|
+
"makeup-floating-label": "^0.4.5",
|
|
68
69
|
"makeup-keyboard-trap": "^0.4.1",
|
|
69
70
|
"makeup-screenreader-trap": "^0.4.1",
|
|
70
71
|
"makeup-typeahead": "^0.3.3",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const g=require("./tslib.es6-C4EgNkz1.js"),n=require("react"),se=require("classnames"),re=require("./forwardRef-irqyO_PF.js"),v=require("./utils-C9NL3q0j.js"),w=require("./icon-CeLPlCml.js"),ce=require("./icon-button-CZtp0khK.js"),ue=require("./hooks-S6mbahSV.js"),K=t=>{var{name:a,buttonAriaLabel:l,onClick:c=()=>{}}=t,s=g.__rest(t,["name","buttonAriaLabel","onClick"]);return l?n.createElement(ce.EbayIconButton,Object.assign({"aria-label":l,icon:a,transparent:!0,onClick:c},s)):n.createElement(w.EbayIcon,Object.assign({name:a},s))},L=t=>n.createElement("span",Object.assign({},t)),P=t=>{var{name:a}=t,l=g.__rest(t,["name"]);return n.createElement(w.EbayIcon,Object.assign({name:a},l))},F=t=>n.createElement("span",Object.assign({},t)),y=t=>typeof t<"u",de=t=>{var a,l,{type:c="text",invalid:s,fluid:m,multiline:_,onChange:q=()=>{},onInputChange:B=()=>{},onFocus:j=()=>{},onBlur:k=()=>{},onKeyPress:O=()=>{},onKeyUp:V=()=>{},onKeyDown:N=()=>{},onInvalid:R=()=>{},onFloatingLabelInit:D=()=>{},onButtonClick:S=()=>{},autoFocus:E,defaultValue:p="",value:f,forwardedRef:U,inputSize:C="default",floatingLabel:z,children:u,placeholder:A,opaqueLabel:M}=t,r=g.__rest(t,["type","invalid","fluid","multiline","onChange","onInputChange","onFocus","onBlur","onKeyPress","onKeyUp","onKeyDown","onInvalid","onFloatingLabelInit","onButtonClick","autoFocus","defaultValue","value","forwardedRef","inputSize","floatingLabel","children","placeholder","opaqueLabel"]);const[I,W]=n.useState(p),[$,G]=n.useState(p),h=ue.useFloatingLabel({text:z,disabled:r.disabled,size:C,invalid:s,type:c,opaqueLabel:M,onMount:D}),T=o=>{var e;j(o,{value:((e=o==null?void 0:o.target)===null||e===void 0?void 0:e.value)||p})},H=o=>{var e;const i=(e=o.target)===null||e===void 0?void 0:e.value;k(o,{value:i}),i!==I&&(q(o,{value:i}),W(i))},J=o=>{const e=o.target;O(o,{value:e==null?void 0:e.value})},Q=o=>{const e=o.target;V(o,{value:e==null?void 0:e.value})},X=o=>{const e=o.target;N(o,{value:e==null?void 0:e.value})},Y=o=>{const e=o.target;R(o,{value:e==null?void 0:e.value})},Z=o=>{S(o,{value:I})};n.useEffect(()=>{E&&T()},[]);const ee=o=>{var e;const i=(e=o.target)===null||e===void 0?void 0:e.value;y(f)||G(i),B(o,{value:i})},oe=_?"textarea":"input",te=m?"div":"span",ne=v.findComponent(u,P),d=v.findComponent(u,F),ae=(a=d==null?void 0:d.props)===null||a===void 0?void 0:a.id,x=v.findComponent(u,K),b=v.findComponent(u,L),le=(l=b==null?void 0:b.props)===null||l===void 0?void 0:l.id,ie=se("textbox",r.className,{"textbox--fluid":m,"textbox--large":C==="large","textbox--disabled":r.disabled,"textbox--invalid":s,"textbox--readonly":r.readOnly});return n.createElement(h.Container,null,n.createElement(h.Label,{htmlFor:r.id}),n.createElement(te,{className:ie},ne,d,n.createElement(oe,Object.assign({"aria-describedby":[ae,le].filter(Boolean).join(" ")||void 0},r,{className:"textbox__control",type:c,"aria-invalid":s,value:y(f)?f:$,onChange:ee,onBlur:H,onFocus:T,onKeyPress:J,onKeyUp:Q,onKeyDown:X,onInvalid:Y,autoFocus:E,ref:U,placeholder:A})),b,x&&n.cloneElement(x,Object.assign(Object.assign({},x.props),{onClick:o=>{const{onClick:e=()=>{}}=x.props;e(o),Z(o)}}))))},xe=re.withForwardRef(de);exports.EbayTextbox=xe;exports.EbayTextboxPostfixIcon=K;exports.EbayTextboxPostfixText=L;exports.EbayTextboxPrefixIcon=P;exports.EbayTextboxPrefixText=F;exports.isControlled=y;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const M=require("./tslib.es6-C4EgNkz1.js"),e=require("react"),q=require("classnames"),a=require("./icon-CeLPlCml.js"),D=s=>s!==void 0,F=s=>{var{id:u,size:l="default",className:b,style:x,checked:r,defaultChecked:m="false",skipMixed:C=!1,onChange:E=()=>{},onFocus:y=()=>{},onKeyDown:f=()=>{},children:K,inputRef:_}=s,v=M.__rest(s,["id","size","className","style","checked","defaultChecked","skipMixed","onChange","onFocus","onKeyDown","children","inputRef"]);const[h,g]=e.useState(m),n=D(r)?r:h,p=t=>{const c=t.target;let o=h;n==="true"?o="false":n==="false"&&!C?o="mixed":o="true",E(t,{value:c==null?void 0:c.value,checked:o}),g(o)},N=t=>{var c;return y(t,{value:(c=t.target)===null||c===void 0?void 0:c.value,checked:n})},I=t=>{const c=t.target;f(t,{value:c.value,checked:n})},S=q("checkbox",b,{"checkbox--large":l==="large"});let i=e.createElement(a.EbayIcon,{name:"checkboxChecked18",className:"checkbox__checked"}),d=e.createElement(a.EbayIcon,{name:"checkboxUnchecked18",className:"checkbox__unchecked"}),k=e.createElement(a.EbayIcon,{name:"checkboxMixed18"});l==="large"&&(i=e.createElement(a.EbayIcon,{name:"checkboxChecked24",className:"checkbox__checked"}),d=e.createElement(a.EbayIcon,{name:"checkboxUnchecked24",className:"checkbox__unchecked"}),k=e.createElement(a.EbayIcon,{name:"checkboxMixed24"}));const w=()=>n==="true"?i:n==="mixed"?k:d;return e.createElement("span",{className:S,style:Object.assign({},x)},e.createElement("input",Object.assign({},v,{"aria-checked":n,id:u,className:"checkbox__control",type:"checkbox",checked:n==="true",onChange:p,onFocus:N,onKeyDown:I,ref:_})),e.createElement("span",{className:"checkbox__icon",hidden:!0},w()))};exports.EbayTriStateCheckbox=F;
|
package/dropdown-JMZDOaC2.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const t=require("@floating-ui/react");function a({open:o,options:e}){var r;const{floatingStyles:s,refs:l}=t.useFloating({placement:e!=null&&e.reverse?"bottom-end":"bottom-start",open:o,middleware:[t.offset((r=e==null?void 0:e.offset)!==null&&r!==void 0?r:4),t.flip(),t.shift()],whileElementsMounted:t.autoUpdate});return{overlayStyles:s,refs:{host:l.reference,overlay:l.floating,setHost:l.setReference,setOverlay:l.setFloating}}}exports.useFloatingDropdown=a;
|
package/hooks-BJqqLO4L.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const o=require("react"),m=require("classnames"),r="floating-label__label",w=["rgb(247, 247, 247)"],T=e=>e&&!w.includes(getComputedStyle(e).backgroundColor),v=e=>{var n;return((n=e==null?void 0:e.value)===null||n===void 0?void 0:n.length)>0},S=e=>(e==null?void 0:e.tagName)==="SELECT",f=(e,n)=>{if(S(e)&&!v(e.querySelector("option"))){e.style["min-width"]="";const s=e.offsetWidth;e.querySelector("option").text=n,!n&&s>e.offsetWidth&&(e.style["min-width"]=`${s}px`)}},G=e=>S(e)?e.querySelector("option").text:e==null?void 0:e.placeholder;function I({ref:e,inputId:n,className:s,disabled:p,label:i,inputSize:x,inputValue:b,placeholder:g,invalid:N,opaqueLabel:q,type:y,onMount:R=()=>{}}){const $=o.useRef(null),l=()=>e||$,[F,u]=o.useState(!!b),[B,h]=o.useState(!1),[c,C]=o.useState(!1),_=o.useRef(""),L=()=>{var t;h(!0),u(v((t=l())===null||t===void 0?void 0:t.current)),C(!1),f(l().current,"")},k=()=>{var t;h(!0),u(!0),C(!0),f((t=l())===null||t===void 0?void 0:t.current,_.current)};o.useEffect(()=>{var t,a;i&&(_.current=G((t=l())===null||t===void 0?void 0:t.current),f((a=l())===null||a===void 0?void 0:a.current,""),R())},[]),o.useEffect(()=>{var t,a,d;i&&u(c||v((t=l())===null||t===void 0?void 0:t.current)||T((d=(a=l())===null||a===void 0?void 0:a.current)===null||d===void 0?void 0:d.parentNode))},[c,b]);const A=m(s,r,{[`${r}--disabled`]:p,[`${r}--animate`]:B,[`${r}--inline`]:!F&&y!=="date",[`${r}--focus`]:c,[`${r}--invalid`]:N}),E=m("floating-label",{"floating-label--large":x==="large","floating-label--opaque":q}),P=o.useCallback(({children:t})=>o.createElement(o.Fragment,null,t),[]),W=o.useCallback(({children:t})=>o.createElement("span",{className:E},t),[E]);return i?{label:o.createElement("label",{htmlFor:n,className:A},i),Container:W,onBlur:L,onFocus:k,ref:l(),placeholder:F?g:null}:{label:null,Container:P,onBlur:()=>{},onFocus:()=>{},ref:l(),placeholder:g}}exports.useFloatingLabel=I;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const b=require("./tslib.es6-C4EgNkz1.js"),a=require("react"),n=require("classnames"),d=require("./dialog-previous-button-vXOjDN7l.js");require("./icon-button-CZtp0khK.js");const m=e=>{var{open:l,mode:r,size:i,bannerImgSrc:o,bannerImgPosition:g,onClose:s=()=>{}}=e,t=b.__rest(e,["open","mode","size","bannerImgSrc","bannerImgPosition","onClose"]);const c=o?a.createElement("div",{className:"lightbox-dialog__image",style:{backgroundImage:`url(${o})`,backgroundPosition:g}}):null;return a.createElement(d.DialogBaseWithState,Object.assign({buttonPosition:"right"},t,{classPrefix:"lightbox-dialog",onCloseBtnClick:s,onBackgroundClick:s,className:n(t.className,"lightbox-dialog--mask-fade",{[`lightbox-dialog--${i}`]:i,"lightbox-dialog--expressive":o}),windowClass:n("lightbox-dialog__window--fade",{"lightbox-dialog__window--mini":r==="mini"}),top:c,open:l}))};exports.EbayLightboxDialog=m;
|
package/textbox-CSLyIuKO.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const g=require("./tslib.es6-C4EgNkz1.js"),t=require("react"),be=require("classnames"),xe=require("./forwardRef-irqyO_PF.js"),p=require("./utils-C9NL3q0j.js"),F=require("./icon-CeLPlCml.js"),ve=require("./icon-button-CZtp0khK.js"),pe=require("./hooks-BJqqLO4L.js"),P=n=>{var{name:a,buttonAriaLabel:l,onClick:c=()=>{}}=n,r=g.__rest(n,["name","buttonAriaLabel","onClick"]);return l?t.createElement(ve.EbayIconButton,Object.assign({"aria-label":l,icon:a,transparent:!0,onClick:c},r)):t.createElement(F.EbayIcon,Object.assign({name:a},r))},w=n=>t.createElement("span",Object.assign({},n)),B=n=>{var{name:a}=n,l=g.__rest(n,["name"]);return t.createElement(F.EbayIcon,Object.assign({name:a},l))},K=n=>t.createElement("span",Object.assign({},n)),y=n=>typeof n<"u",fe=n=>{var a,l,{type:c="text",invalid:r,fluid:m,multiline:L,onChange:_=()=>{},onInputChange:q=()=>{},onFocus:j=()=>{},onBlur:k=()=>{},onKeyPress:O=()=>{},onKeyUp:V=()=>{},onKeyDown:N=()=>{},onInvalid:R=()=>{},onFloatingLabelInit:D=()=>{},onButtonClick:S=()=>{},autoFocus:E,defaultValue:f="",value:u,forwardedRef:U,inputSize:h="default",floatingLabel:z,children:d,placeholder:A,opaqueLabel:M}=n,i=g.__rest(n,["type","invalid","fluid","multiline","onChange","onInputChange","onFocus","onBlur","onKeyPress","onKeyUp","onKeyDown","onInvalid","onFloatingLabelInit","onButtonClick","autoFocus","defaultValue","value","forwardedRef","inputSize","floatingLabel","children","placeholder","opaqueLabel"]);const[I,W]=t.useState(f),[C,$]=t.useState(f),{label:G,Container:H,onBlur:J,onFocus:Q,ref:X,placeholder:Y}=pe.useFloatingLabel({ref:U,inputId:i.id,className:i.className,disabled:i.disabled,label:z,inputSize:h,inputValue:u||C,placeholder:A,invalid:r,type:c,opaqueLabel:M,onMount:D}),T=o=>{var e;j(o,{value:((e=o==null?void 0:o.target)===null||e===void 0?void 0:e.value)||f}),Q()},Z=o=>{var e;const s=(e=o.target)===null||e===void 0?void 0:e.value;k(o,{value:s}),s!==I&&(_(o,{value:s}),W(s)),J()},ee=o=>{const e=o.target;O(o,{value:e==null?void 0:e.value})},oe=o=>{const e=o.target;V(o,{value:e==null?void 0:e.value})},ne=o=>{const e=o.target;N(o,{value:e==null?void 0:e.value})},te=o=>{const e=o.target;R(o,{value:e==null?void 0:e.value})},ae=o=>{S(o,{value:I})};t.useEffect(()=>{E&&T()},[]);const le=o=>{var e;const s=(e=o.target)===null||e===void 0?void 0:e.value;y(u)||$(s),q(o,{value:s})},ie=L?"textarea":"input",se=m?"div":"span",re=p.findComponent(d,B),b=p.findComponent(d,K),ce=(a=b==null?void 0:b.props)===null||a===void 0?void 0:a.id,x=p.findComponent(d,P),v=p.findComponent(d,w),ue=(l=v==null?void 0:v.props)===null||l===void 0?void 0:l.id,de=be("textbox",i.className,{"textbox--fluid":m,"textbox--large":h==="large","textbox--disabled":i.disabled,"textbox--invalid":r,"textbox--readonly":i.readOnly});return t.createElement(H,null,G,t.createElement(se,{className:de},re,b,t.createElement(ie,Object.assign({"aria-describedby":[ce,ue].filter(Boolean).join(" ")||void 0},i,{className:"textbox__control",type:c,"aria-invalid":r,value:y(u)?u:C,onChange:le,onBlur:Z,onFocus:T,onKeyPress:ee,onKeyUp:oe,onKeyDown:ne,onInvalid:te,autoFocus:E,ref:X,placeholder:Y})),v,x&&t.cloneElement(x,Object.assign(Object.assign({},x.props),{onClick:o=>{const{onClick:e=()=>{}}=x.props;e(o),ae(o)}}))))},ye=xe.withForwardRef(fe);exports.EbayTextbox=ye;exports.EbayTextboxPostfixIcon=P;exports.EbayTextboxPostfixText=w;exports.EbayTextboxPrefixIcon=B;exports.EbayTextboxPrefixText=K;exports.isControlled=y;
|