@ebay/ui-core-react 4.2.6 → 5.0.1

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.
Files changed (148) hide show
  1. package/common/event-utils/index.d.ts +10 -7
  2. package/common/event-utils/index.d.ts.map +1 -1
  3. package/common/event-utils/index.js +11 -3
  4. package/common/event-utils/types.d.ts +7 -0
  5. package/common/event-utils/types.d.ts.map +1 -1
  6. package/common/event-utils/types.js +12 -0
  7. package/common/floating-label-utils/hooks.d.ts +2 -1
  8. package/common/floating-label-utils/hooks.d.ts.map +1 -1
  9. package/common/floating-label-utils/hooks.js +5 -4
  10. package/ebay-alert-dialog/README.md +3 -2
  11. package/ebay-alert-dialog/alert-dialog.d.ts +0 -1
  12. package/ebay-alert-dialog/alert-dialog.d.ts.map +1 -1
  13. package/ebay-alert-dialog/alert-dialog.js +1 -1
  14. package/ebay-breadcrumbs/README.md +1 -1
  15. package/ebay-breadcrumbs/breadcrumbs.d.ts +3 -2
  16. package/ebay-breadcrumbs/breadcrumbs.d.ts.map +1 -1
  17. package/ebay-breadcrumbs/breadcrumbs.js +1 -1
  18. package/ebay-button/README.md +4 -4
  19. package/ebay-carousel/carousel-control-button.js +2 -2
  20. package/ebay-carousel/carousel.js +1 -1
  21. package/ebay-checkbox/README.md +11 -10
  22. package/ebay-checkbox/checkbox.d.ts +15 -3
  23. package/ebay-checkbox/checkbox.d.ts.map +1 -1
  24. package/ebay-checkbox/checkbox.js +9 -4
  25. package/ebay-confirm-dialog/README.md +6 -6
  26. package/ebay-confirm-dialog/confirm-dialog.d.ts +0 -1
  27. package/ebay-confirm-dialog/confirm-dialog.d.ts.map +1 -1
  28. package/ebay-confirm-dialog/confirm-dialog.js +1 -1
  29. package/ebay-dialog-base/components/dialogBase.d.ts +3 -2
  30. package/ebay-dialog-base/components/dialogBase.d.ts.map +1 -1
  31. package/ebay-dialog-base/components/dialogBase.js +6 -3
  32. package/ebay-drawer-dialog/README.md +7 -6
  33. package/ebay-drawer-dialog/components/drawer.d.ts +3 -0
  34. package/ebay-drawer-dialog/components/drawer.d.ts.map +1 -1
  35. package/ebay-fake-menu/README.md +5 -5
  36. package/ebay-fake-menu/menu-item.d.ts +1 -1
  37. package/ebay-fake-menu/menu-item.d.ts.map +1 -1
  38. package/ebay-fake-menu/menu.d.ts +9 -5
  39. package/ebay-fake-menu/menu.d.ts.map +1 -1
  40. package/ebay-fake-menu/menu.js +2 -2
  41. package/ebay-fake-menu-button/README.md +9 -4
  42. package/ebay-fake-menu-button/menu-button.d.ts +9 -2
  43. package/ebay-fake-menu-button/menu-button.d.ts.map +1 -1
  44. package/ebay-fake-menu-button/menu-button.js +7 -5
  45. package/ebay-fullscreen-dialog/fullscreen-dialog.d.ts +0 -1
  46. package/ebay-fullscreen-dialog/fullscreen-dialog.d.ts.map +1 -1
  47. package/ebay-fullscreen-dialog/fullscreen-dialog.js +1 -1
  48. package/ebay-icon/types.d.ts +1 -1
  49. package/ebay-icon/types.d.ts.map +1 -1
  50. package/ebay-icon-button/README.md +9 -0
  51. package/ebay-icon-button/icon-button.d.ts +3 -1
  52. package/ebay-icon-button/icon-button.d.ts.map +1 -1
  53. package/ebay-icon-button/icon-button.js +8 -2
  54. package/ebay-lightbox-dialog/lightbox-dialog.d.ts +0 -1
  55. package/ebay-lightbox-dialog/lightbox-dialog.d.ts.map +1 -1
  56. package/ebay-lightbox-dialog/lightbox-dialog.js +1 -1
  57. package/ebay-listbox-button/README.md +8 -1
  58. package/ebay-listbox-button/listbox-button.d.ts +11 -3
  59. package/ebay-listbox-button/listbox-button.d.ts.map +1 -1
  60. package/ebay-listbox-button/listbox-button.js +41 -16
  61. package/ebay-menu/README.md +5 -4
  62. package/ebay-menu/menu-item.d.ts +1 -1
  63. package/ebay-menu/menu-item.d.ts.map +1 -1
  64. package/ebay-menu/menu.d.ts +4 -4
  65. package/ebay-menu/menu.d.ts.map +1 -1
  66. package/ebay-menu/menu.js +85 -42
  67. package/ebay-menu/types.d.ts +21 -12
  68. package/ebay-menu/types.d.ts.map +1 -1
  69. package/ebay-menu-button/README.md +2 -2
  70. package/ebay-menu-button/menu-button.d.ts +3 -3
  71. package/ebay-menu-button/menu-button.d.ts.map +1 -1
  72. package/ebay-menu-button/menu-button.js +18 -4
  73. package/ebay-page-notice/README.md +5 -1
  74. package/ebay-page-notice/index.d.ts +1 -1
  75. package/ebay-page-notice/index.d.ts.map +1 -1
  76. package/ebay-page-notice/page-notice.d.ts +5 -4
  77. package/ebay-page-notice/page-notice.d.ts.map +1 -1
  78. package/ebay-page-notice/page-notice.js +7 -8
  79. package/ebay-pagination/README.md +5 -5
  80. package/ebay-pagination/pagination-item.d.ts +8 -4
  81. package/ebay-pagination/pagination-item.d.ts.map +1 -1
  82. package/ebay-pagination/pagination-item.js +2 -1
  83. package/ebay-pagination/pagination.d.ts +8 -5
  84. package/ebay-pagination/pagination.d.ts.map +1 -1
  85. package/ebay-pagination/pagination.js +1 -1
  86. package/ebay-panel-dialog/panel-dialog.d.ts +0 -1
  87. package/ebay-panel-dialog/panel-dialog.d.ts.map +1 -1
  88. package/ebay-panel-dialog/panel-dialog.js +1 -1
  89. package/ebay-radio/README.md +7 -2
  90. package/ebay-radio/radio.d.ts +12 -3
  91. package/ebay-radio/radio.d.ts.map +1 -1
  92. package/ebay-radio/radio.js +7 -5
  93. package/ebay-section-notice/README.md +5 -0
  94. package/ebay-section-notice/index.d.ts +1 -1
  95. package/ebay-section-notice/index.d.ts.map +1 -1
  96. package/ebay-section-notice/section-notice.d.ts +6 -3
  97. package/ebay-section-notice/section-notice.d.ts.map +1 -1
  98. package/ebay-section-notice/section-notice.js +32 -4
  99. package/ebay-select/README.md +3 -1
  100. package/ebay-select/ebay-select.d.ts +7 -2
  101. package/ebay-select/ebay-select.d.ts.map +1 -1
  102. package/ebay-select/ebay-select.js +1 -1
  103. package/ebay-select/index.d.ts +1 -1
  104. package/ebay-select/index.d.ts.map +1 -1
  105. package/ebay-split-button/README.md +2 -2
  106. package/ebay-split-button/split-button.js +1 -1
  107. package/ebay-split-button/types.d.ts +2 -3
  108. package/ebay-split-button/types.d.ts.map +1 -1
  109. package/ebay-star-rating-select/README.md +8 -0
  110. package/ebay-star-rating-select/star-rating-select.d.ts +8 -4
  111. package/ebay-star-rating-select/star-rating-select.d.ts.map +1 -1
  112. package/ebay-star-rating-select/star-rating-select.js +8 -8
  113. package/ebay-svg/svg.d.ts.map +1 -1
  114. package/ebay-svg/svg.js +266 -28
  115. package/ebay-switch/README.md +5 -1
  116. package/ebay-switch/ebay-switch.d.ts +7 -3
  117. package/ebay-switch/ebay-switch.d.ts.map +1 -1
  118. package/ebay-switch/ebay-switch.js +6 -3
  119. package/ebay-tabs/README.md +6 -10
  120. package/ebay-tabs/tab-panel.d.ts +0 -1
  121. package/ebay-tabs/tab-panel.d.ts.map +1 -1
  122. package/ebay-tabs/tab-panel.js +2 -2
  123. package/ebay-tabs/tab.d.ts +1 -7
  124. package/ebay-tabs/tab.d.ts.map +1 -1
  125. package/ebay-tabs/tab.js +2 -7
  126. package/ebay-tabs/tabs.d.ts +7 -1
  127. package/ebay-tabs/tabs.d.ts.map +1 -1
  128. package/ebay-tabs/tabs.js +12 -19
  129. package/ebay-textbox/README.md +16 -9
  130. package/ebay-textbox/postfix-icon.d.ts.map +1 -1
  131. package/ebay-textbox/postfix-icon.js +25 -3
  132. package/ebay-textbox/prefix-icon.d.ts.map +1 -1
  133. package/ebay-textbox/prefix-icon.js +24 -2
  134. package/ebay-textbox/textbox.d.ts +17 -7
  135. package/ebay-textbox/textbox.d.ts.map +1 -1
  136. package/ebay-textbox/textbox.js +47 -14
  137. package/ebay-textbox/types.d.ts +2 -2
  138. package/ebay-textbox/types.d.ts.map +1 -1
  139. package/ebay-video/README.md +7 -5
  140. package/ebay-video/controls.d.ts.map +1 -1
  141. package/ebay-video/controls.js +10 -4
  142. package/ebay-video/reportButton.d.ts +1 -5
  143. package/ebay-video/reportButton.d.ts.map +1 -1
  144. package/ebay-video/reportButton.js +3 -3
  145. package/ebay-video/video.d.ts +13 -10
  146. package/ebay-video/video.d.ts.map +1 -1
  147. package/ebay-video/video.js +4 -1
  148. package/package.json +1 -1
@@ -27,7 +27,11 @@ yarn add @ebay/ui-core-react
27
27
  Name | Type | Stateful | Description
28
28
  --- | --- | --- | ---
29
29
  `disabled` | Boolean | No |
30
- `onChange` | `{ originalEvent, value, checked }` | selected value and checked status
30
+
31
+ ## Callbacks
32
+ Name | Data | Description
33
+ --- | --- | --- | ---
34
+ `onChange` | `(ChangeEvent, { value: string, checked: boolean }` | Triggered on change
31
35
 
32
36
  Note: For this component, `className`/`style` are applied to the root tag, while all other HTML attributes are applied to the `input` tag.
33
37
 
@@ -1,6 +1,10 @@
1
- import { FC, ChangeEvent, ComponentProps } from 'react';
2
- declare type Props = ComponentProps<'input'> & {
3
- onChange?: (e: ChangeEvent<HTMLInputElement>, value: string | number, checked: boolean) => void;
1
+ import { FC, ComponentProps } from 'react';
2
+ import { EbayChangeEventHandler } from '../common/event-utils/types';
3
+ declare type Props = Omit<ComponentProps<'input'>, 'onChange'> & {
4
+ onChange?: EbayChangeEventHandler<HTMLInputElement, {
5
+ value: string | number;
6
+ checked: boolean;
7
+ }>;
4
8
  };
5
9
  declare const EbaySwitch: FC<Props>;
6
10
  export default EbaySwitch;
@@ -1 +1 @@
1
- {"version":3,"file":"ebay-switch.d.ts","sourceRoot":"","sources":["../../src/ebay-switch/ebay-switch.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAuB,EAAE,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAGnF,aAAK,KAAK,GAAG,cAAc,CAAC,OAAO,CAAC,GAAG;IACnC,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,WAAW,CAAC,gBAAgB,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;CACnG,CAAA;AAED,QAAA,MAAM,UAAU,EAAE,EAAE,CAAC,KAAK,CAuCzB,CAAA;AAED,eAAe,UAAU,CAAA"}
1
+ {"version":3,"file":"ebay-switch.d.ts","sourceRoot":"","sources":["../../src/ebay-switch/ebay-switch.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAuB,EAAE,EAAe,cAAc,EAAE,MAAM,OAAO,CAAA;AAEnF,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AAEpE,aAAK,KAAK,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,UAAU,CAAC,GAAG;IACrD,QAAQ,CAAC,EAAE,sBAAsB,CAAC,gBAAgB,EAAE;QAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;CACrG,CAAA;AAED,QAAA,MAAM,UAAU,EAAE,EAAE,CAAC,KAAK,CA0CzB,CAAA;AAED,eAAe,UAAU,CAAA"}
@@ -53,9 +53,12 @@ var EbaySwitch = function (_a) {
53
53
  setChecked(!!checked);
54
54
  }, [checked]);
55
55
  var handleChange = function (e) {
56
- var input = e.target || {};
57
- onChange(e, input.value, input.checked);
58
- setChecked(input.checked);
56
+ var _a = e.target || {}, _b = _a.value, inputValue = _b === void 0 ? '' : _b, _c = _a.checked, inputChecked = _c === void 0 ? false : _c;
57
+ onChange(e, {
58
+ value: inputValue,
59
+ checked: inputChecked
60
+ });
61
+ setChecked(inputChecked);
59
62
  };
60
63
  return (react_1.default.createElement("span", { className: "switch" },
61
64
  react_1.default.createElement("input", __assign({}, rest, { className: classnames_1.default('switch__control', className), id: id, role: "switch", type: "checkbox", value: value, "aria-checked": isChecked, checked: isChecked, name: name, onChange: handleChange })),
@@ -28,15 +28,17 @@ import '@ebay/skin/tabs';
28
28
 
29
29
  Name | Type | Stateful | Description
30
30
  --- | --- | --- | ---
31
- `index` |Number | Yes | 0-based index of selected tab heading and panel
31
+ `index` |Number | Yes | Deprecated, use `selectedIndex` instead. 0-based index of selected tab heading and panel
32
+ `selectedIndex` |Number | Yes | 0-based index of selected tab heading and panel
32
33
  `activation` | Enum | Yes | whether to use automatic or manual activation when navigating by keyboard, can be `auto` (default) or `manual`
33
34
  `size` | Enum | No | Whether to opt into larger font-size for tab headings, can be `medium` (default) or `large`
34
35
 
35
36
  ## Callbacks
36
37
 
37
- Event | Data | Description
38
- --- | --- | ---
39
- `onTabSelect` | `{ index }` |
38
+ | Event | Data | Description |
39
+ |---------------|-------------------------------------------|---------------------------------------------------------------------------------------------------------|
40
+ | `onTabSelect` | `({ index: number })` | Triggered on tab selected. Deprecated, use onSelect instead. Will be removed in the next major release. |
41
+ | `onSelect` | `(ChangeEvent, { selectedIndex:number })` | Triggered on tab selected. |
40
42
 
41
43
  ## EbayTab
42
44
 
@@ -44,12 +46,6 @@ Event | Data | Description
44
46
  <EbayTab>Tab 1</EbayTab>
45
47
  ```
46
48
 
47
- ### EbayTab Props
48
-
49
- Name | Type | Stateful | Description
50
- --- | --- | --- | ---
51
- `href` | String | No | For use with `fake` tab component (links instead of real tabs)
52
-
53
49
  ## EbayTabPanel
54
50
  ```jsx harmony
55
51
  <EbayTabPanel>Panel 1</EbayTabPanel>
@@ -3,7 +3,6 @@ declare type TabPanelProps = ComponentProps<'div'> & {
3
3
  index?: number;
4
4
  parentId?: string;
5
5
  selected?: boolean;
6
- fake?: boolean;
7
6
  };
8
7
  declare const TabPanel: FC<TabPanelProps>;
9
8
  export default TabPanel;
@@ -1 +1 @@
1
- {"version":3,"file":"tab-panel.d.ts","sourceRoot":"","sources":["../../src/ebay-tabs/tab-panel.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,cAAc,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAGjD,aAAK,aAAa,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG;IACzC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,OAAO,CAAC;CAClB,CAAA;AAED,QAAA,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,CA0B3B,CAAA;AAEL,eAAe,QAAQ,CAAA"}
1
+ {"version":3,"file":"tab-panel.d.ts","sourceRoot":"","sources":["../../src/ebay-tabs/tab-panel.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,cAAc,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAGjD,aAAK,aAAa,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG;IACzC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB,CAAA;AAED,QAAA,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,CAoB/B,CAAA;AAED,eAAe,QAAQ,CAAA"}
@@ -28,8 +28,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
28
28
  var react_1 = __importDefault(require("react"));
29
29
  var classnames_1 = __importDefault(require("classnames"));
30
30
  var TabPanel = function (_a) {
31
- var children = _a.children, index = _a.index, parentId = _a.parentId, selected = _a.selected, fake = _a.fake, className = _a.className, rest = __rest(_a, ["children", "index", "parentId", "selected", "fake", "className"]);
32
- return fake ? (react_1.default.createElement("div", __assign({}, rest, { className: classnames_1.default(className, 'fake-tabs__cell') }), children)) : (react_1.default.createElement("div", __assign({}, rest, { "aria-labelledby": "default-tab-" + index, className: classnames_1.default(className, 'tabs__panel'), id: (parentId || 'default') + "-tabpanel-" + index, role: "tabpanel", hidden: !selected }),
31
+ var children = _a.children, index = _a.index, parentId = _a.parentId, selected = _a.selected, className = _a.className, rest = __rest(_a, ["children", "index", "parentId", "selected", "className"]);
32
+ return (react_1.default.createElement("div", __assign({}, rest, { "aria-labelledby": "default-tab-" + index, className: classnames_1.default(className, 'tabs__panel'), id: (parentId || 'default') + "-tabpanel-" + index, role: "tabpanel", hidden: !selected }),
33
33
  react_1.default.createElement("div", { className: "tabs__cell" }, children)));
34
34
  };
35
35
  exports.default = TabPanel;
@@ -1,15 +1,9 @@
1
1
  import { ComponentProps, FC, RefCallback } from 'react';
2
- declare type TabProps = ComponentProps<'li'> & ComponentProps<'div'> & {
2
+ declare type TabProps = ComponentProps<'div'> & {
3
3
  index?: number;
4
4
  parentId?: string;
5
5
  selected?: boolean;
6
6
  focused?: boolean;
7
- /**
8
- * @deprecated Use EbayFakeTabs instead
9
- */
10
- href?: string;
11
- onClick?: () => void;
12
- onKeyDown?: () => void;
13
7
  refCallback?: RefCallback<HTMLElement>;
14
8
  };
15
9
  declare const Tab: FC<TabProps>;
@@ -1 +1 @@
1
- {"version":3,"file":"tab.d.ts","sourceRoot":"","sources":["../../src/ebay-tabs/tab.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,cAAc,EAAE,EAAE,EAAE,WAAW,EAAE,MAAM,OAAO,CAAA;AAG9D,aAAK,QAAQ,GAAG,cAAc,CAAC,IAAI,CAAC,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG;IAC3D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,WAAW,CAAC,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;CAC1C,CAAA;AAED,QAAA,MAAM,GAAG,EAAE,EAAE,CAAC,QAAQ,CAuCjB,CAAA;AAEL,eAAe,GAAG,CAAA"}
1
+ {"version":3,"file":"tab.d.ts","sourceRoot":"","sources":["../../src/ebay-tabs/tab.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,cAAc,EAAE,EAAE,EAAE,WAAW,EAAE,MAAM,OAAO,CAAA;AAG9D,aAAK,QAAQ,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;CAC1C,CAAA;AAED,QAAA,MAAM,GAAG,EAAE,EAAE,CAAC,QAAQ,CAwBrB,CAAA;AAED,eAAe,GAAG,CAAA"}
package/ebay-tabs/tab.js CHANGED
@@ -28,13 +28,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
28
28
  var react_1 = __importDefault(require("react"));
29
29
  var classnames_1 = __importDefault(require("classnames"));
30
30
  var Tab = function (_a) {
31
- var children = _a.children, index = _a.index, parentId = _a.parentId, selected = _a.selected, focused = _a.focused,
32
- /**
33
- * @deprecated Use EbayFakeTabs instead
34
- */
35
- href = _a.href, className = _a.className, refCallback = _a.refCallback, _b = _a.onClick, onClick = _b === void 0 ? function () { } : _b, _c = _a.onKeyDown, onKeyDown = _c === void 0 ? function () { } : _c, rest = __rest(_a, ["children", "index", "parentId", "selected", "focused", "href", "className", "refCallback", "onClick", "onKeyDown"]);
36
- return href ? (react_1.default.createElement("li", __assign({}, rest, { className: classnames_1.default(className, 'fake-tabs__item', { 'fake-tabs__item--current': selected }) }),
37
- react_1.default.createElement("a", { href: href, "aria-current": selected ? "page" : null }, children))) : (react_1.default.createElement("div", __assign({}, rest, { ref: refCallback, "aria-controls": (parentId || 'default') + "-tabpanel-" + index, "aria-selected": selected, className: classnames_1.default(className, 'tabs__item'), id: (parentId || 'default') + "-tab-" + index, role: "tab", tabIndex: focused ? 0 : -1, onClick: onClick, onKeyDown: onKeyDown }),
31
+ var children = _a.children, index = _a.index, parentId = _a.parentId, selected = _a.selected, focused = _a.focused, className = _a.className, refCallback = _a.refCallback, rest = __rest(_a, ["children", "index", "parentId", "selected", "focused", "className", "refCallback"]);
32
+ return (react_1.default.createElement("div", __assign({}, rest, { ref: refCallback, "aria-controls": (parentId || 'default') + "-tabpanel-" + index, "aria-selected": selected, className: classnames_1.default(className, 'tabs__item'), id: (parentId || 'default') + "-tab-" + index, role: "tab", tabIndex: focused ? 0 : -1 }),
38
33
  react_1.default.createElement("span", null, children)));
39
34
  };
40
35
  exports.default = Tab;
@@ -1,9 +1,15 @@
1
1
  import { ComponentProps, FC } from 'react';
2
2
  import { Activation, Size } from './types';
3
- declare type TabsProps = ComponentProps<'div'> & {
3
+ export declare type TabsProps = ComponentProps<'div'> & {
4
4
  index?: number;
5
5
  size?: Size;
6
6
  activation?: Activation;
7
+ onSelect?: ({ selectedIndex: number }: {
8
+ selectedIndex: any;
9
+ }) => void;
10
+ /**
11
+ * @deprecated Use onSelect instead
12
+ */
7
13
  onTabSelect?: (index: number) => void;
8
14
  };
9
15
  declare const Tabs: FC<TabsProps>;
@@ -1 +1 @@
1
- {"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../src/ebay-tabs/tabs.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAgB,cAAc,EAAE,EAAE,EAAuB,MAAM,OAAO,CAAA;AAMpF,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAG1C,aAAK,SAAS,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC,CAAC;AAEF,QAAA,MAAM,IAAI,EAAE,EAAE,CAAC,SAAS,CAsGvB,CAAA;AAED,eAAe,IAAI,CAAA"}
1
+ {"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../src/ebay-tabs/tabs.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAgB,cAAc,EAAE,EAAE,EAAsC,MAAM,OAAO,CAAA;AAKnG,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAI1C,oBAAY,SAAS,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,QAAQ,CAAC,EAAE,CAAC,EAAE,aAAa,EAAE,MAAM,EAAE;;KAAA,KAAK,IAAI,CAAC;IAC/C;;OAEG;IACH,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC,CAAC;AAEF,QAAA,MAAM,IAAI,EAAE,EAAE,CAAC,SAAS,CA4FvB,CAAA;AAED,eAAe,IAAI,CAAA"}
package/ebay-tabs/tabs.js CHANGED
@@ -36,15 +36,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
36
36
  var react_1 = __importStar(require("react"));
37
37
  var classnames_1 = __importDefault(require("classnames"));
38
38
  var event_utils_1 = require("../common/event-utils");
39
+ var component_utils_1 = require("../common/component-utils");
39
40
  var tab_1 = __importDefault(require("./tab"));
40
41
  var tab_panel_1 = __importDefault(require("./tab-panel"));
41
- var component_utils_1 = require("../common/component-utils");
42
42
  var Tabs = function (_a) {
43
- var id = _a.id, className = _a.className, _b = _a.index, index = _b === void 0 ? 0 : _b, _c = _a.size, size = _c === void 0 ? 'medium' : _c, _d = _a.activation, activation = _d === void 0 ? 'auto' : _d, _e = _a.onTabSelect, onTabSelect = _e === void 0 ? function () { } : _e, children = _a.children;
43
+ var id = _a.id, className = _a.className, _b = _a.index, index = _b === void 0 ? 0 : _b, _c = _a.size, size = _c === void 0 ? 'medium' : _c, _d = _a.activation, activation = _d === void 0 ? 'auto' : _d, _e = _a.onSelect, onSelect = _e === void 0 ? function () { } : _e, _f = _a.onTabSelect, onTabSelect = _f === void 0 ? function () { } : _f, children = _a.children;
44
44
  var headings = [];
45
- var _f = react_1.useState(index), selectedIndex = _f[0], setSelectedIndex = _f[1];
46
- var _g = react_1.useState(index), focusedIndex = _g[0], setFocusedIndex = _g[1];
47
- var onSelect = function (i) {
45
+ var _g = react_1.useState(index), selectedIndex = _g[0], setSelectedIndex = _g[1];
46
+ var _h = react_1.useState(index), focusedIndex = _h[0], setFocusedIndex = _h[1];
47
+ var handleSelect = function (i) {
48
+ onSelect({ selectedIndex: i });
48
49
  onTabSelect(i);
49
50
  setSelectedIndex(i);
50
51
  };
@@ -56,7 +57,7 @@ var Tabs = function (_a) {
56
57
  event_utils_1.handleActionKeydown(ev, function () {
57
58
  ev.preventDefault();
58
59
  if (activation === 'manual') {
59
- onSelect(i);
60
+ handleSelect(i);
60
61
  }
61
62
  });
62
63
  event_utils_1.handleLeftRightArrowsKeydown(ev, function () {
@@ -69,38 +70,30 @@ var Tabs = function (_a) {
69
70
  setFocusedIndex(nextIndex);
70
71
  (_a = headings[nextIndex]) === null || _a === void 0 ? void 0 : _a.focus();
71
72
  if (activation !== 'manual') {
72
- onSelect(nextIndex);
73
+ handleSelect(nextIndex);
73
74
  }
74
75
  });
75
76
  };
76
77
  react_1.useEffect(function () {
77
- onSelect(index);
78
+ handleSelect(index);
78
79
  }, [index]);
79
- var isFake = component_utils_1.filterBy(children, function (_a) {
80
- var type = _a.type, props = _a.props;
81
- return type === tab_1.default && props.href;
82
- }).length > 0;
83
80
  var isLarge = size === 'large';
84
81
  var tabHeadings = component_utils_1.filterByType(children, tab_1.default).map(function (item, i) {
85
82
  return react_1.cloneElement(item, __assign(__assign({}, item.props), { refCallback: function (ref) { headings[i] = ref; }, index: i, parentId: id, selected: selectedIndex === i, focused: focusedIndex === i, onClick: function () {
86
- onSelect(i);
83
+ handleSelect(i);
87
84
  setFocusedIndex(i);
88
85
  }, onKeyDown: function (e) { onKeyDown(e, i); } }));
89
86
  });
90
87
  var tabPanels = component_utils_1.filterByType(children, tab_panel_1.default).map(function (item, i) {
91
- var content = item.props.children;
92
88
  var itemProps = {
93
89
  index: i,
94
90
  parentId: id,
95
91
  selected: selectedIndex === i,
96
- fake: isFake,
97
- children: content
92
+ children: item.props.children
98
93
  };
99
94
  return react_1.cloneElement(item, itemProps);
100
95
  });
101
- return isFake ? (react_1.default.createElement("div", { id: id, className: classnames_1.default(className, 'fake-tabs') },
102
- react_1.default.createElement("ul", { className: classnames_1.default('fake-tabs__items', { 'fake-tabs__items--large': isLarge }) }, tabHeadings),
103
- react_1.default.createElement("div", { className: "fake-tabs__content" }, tabPanels))) : (react_1.default.createElement("div", { id: id, className: classnames_1.default(className, 'tabs') },
96
+ return (react_1.default.createElement("div", { id: id, className: classnames_1.default(className, 'tabs') },
104
97
  react_1.default.createElement("div", { className: classnames_1.default('tabs__items', { 'tabs__items--large': isLarge }), role: "tablist" }, tabHeadings),
105
98
  react_1.default.createElement("div", { className: "tabs__content" }, tabPanels)));
106
99
  };
@@ -11,19 +11,15 @@ yarn add @ebay/ui-core-react
11
11
  ```
12
12
 
13
13
  ### Import JS
14
-
15
14
  ```jsx harmony
16
15
  import { EbayTextbox } from '@ebay/ui-core-react/ebay-textbox'
17
16
  ```
18
17
 
19
18
  ### Import following styles from SKIN
20
-
21
19
  ```jsx harmony
22
20
  import "@ebay/skin/textbox";
23
21
  ```
24
-
25
22
  ### or if using CSS/SCSS
26
-
27
23
  ```jsx
28
24
  import "@ebay/skin/textbox.css";
29
25
  ```
@@ -44,12 +40,23 @@ import "@ebay/skin/textbox.css";
44
40
  | `defaultValue` | String | No | No | Indicates the default input element value. Use when the component is not controlled. |
45
41
  | `inputSize` | String | No | No | `default` (default), `large` |
46
42
  | `floatingLabel` | String | No | No | Indicates that the input is a floating label type and renders it as a label |
47
- | `onFocus` | Function | No | No | Called when input gets focus, parameters passed: `originalEvent`, `value` |
48
- | `onBlur` | Function | No | No | Called when input loses focus, parameters passed: `originalEvent`, `value` |
49
- | `onChange` | Function | No | No | Called when input changes value, parameters passed: `originalEvent`, `value` |
50
- | `onButtonClick` | Function | No | No | Triggers when clicking on postfix-icon-button. Requires `buttonAriaLabel` to be present in order to attach correctly |
51
43
 
52
- It supports all the events supported by an input element (e.g. `onInput`, `onKeyDown`, `onKeyUp`)
44
+ ## Callbacks
45
+ | Name | Required | Description | Arguments |
46
+ |------|----------|-------------|-----------|
47
+
48
+ | `onChange` | No | Triggered when focus leaves and value is changed. | `(ChangeEvent, { value: string })` | |
49
+ | `onInputChange` | No | Triggered when the value of the input is changed. | `(ChangeEvent, { value: string })` | |
50
+ | `onFocus` | No | Called when input gets focus | `(FocusEvent, { value: string })` |
51
+ | `onBlur` | No | Called when input loses focus | `(FocusEvent, { value: string })` |
52
+ | `onKeyPress` | No | Called on key press | `(KeyboardEvent, { value: string })` |
53
+ | `onKeyUp` | No | Called on key up | `(KeyboardEvent, { value: string })` |
54
+ | `onKeyDown` | No | Called on key down | `(KeyboardEvent, { value: string })` |
55
+ | `onInvalid` | No | Triggered when value is invalid | `(ChangeEvent, { value: string })` |
56
+ | `onFloatingLabelInit` | No | Triggered when floating label is initialized | `()` |
57
+ | `onButtonClick` | No | Triggers when clicking on postfix-icon-button. Requires `buttonAriaLabel` to be present in order to attach correctly | `(MouseEvent, { value: string })` |
58
+
59
+ It supports all the events supported by an input element (e.g. `onInput`, `onPaste`)
53
60
 
54
61
  ## EbayTextboxPrefixIcon
55
62
  | Name | Type | Required | Description |
@@ -1 +1 @@
1
- {"version":3,"file":"postfix-icon.d.ts","sourceRoot":"","sources":["../../src/ebay-textbox/postfix-icon.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AACjC,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAI9C,QAAA,MAAM,sBAAsB,EAAE,EAAE,CAAC,oBAAoB,CAWzB,CAAA;AAE5B,eAAe,sBAAsB,CAAA"}
1
+ {"version":3,"file":"postfix-icon.d.ts","sourceRoot":"","sources":["../../src/ebay-textbox/postfix-icon.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AACjC,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAI9C,QAAA,MAAM,sBAAsB,EAAE,EAAE,CAAC,oBAAoB,CAaR,CAAA;AAE7C,eAAe,sBAAsB,CAAA"}
@@ -1,4 +1,26 @@
1
1
  "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __rest = (this && this.__rest) || function (s, e) {
14
+ var t = {};
15
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
16
+ t[p] = s[p];
17
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
18
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
19
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
20
+ t[p[i]] = s[p[i]];
21
+ }
22
+ return t;
23
+ };
2
24
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
25
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
26
  };
@@ -7,9 +29,9 @@ var react_1 = __importDefault(require("react"));
7
29
  var ebay_icon_1 = require("../ebay-icon");
8
30
  var ebay_icon_button_1 = require("../ebay-icon-button");
9
31
  var EbayTextboxPostfixIcon = function (_a) {
10
- var name = _a.name, buttonAriaLabel = _a.buttonAriaLabel, _b = _a.onClick, onClick = _b === void 0 ? function () { } : _b;
32
+ var name = _a.name, buttonAriaLabel = _a.buttonAriaLabel, _b = _a.onClick, onClick = _b === void 0 ? function () { } : _b, rest = __rest(_a, ["name", "buttonAriaLabel", "onClick"]);
11
33
  return buttonAriaLabel ?
12
- react_1.default.createElement(ebay_icon_button_1.EbayIconButton, { "aria-label": buttonAriaLabel, icon: name, transparent: true, onClick: onClick }) :
13
- react_1.default.createElement(ebay_icon_1.EbayIcon, { name: name });
34
+ react_1.default.createElement(ebay_icon_button_1.EbayIconButton, __assign({ "aria-label": buttonAriaLabel, icon: name, transparent: true, onClick: onClick }, rest)) :
35
+ react_1.default.createElement(ebay_icon_1.EbayIcon, __assign({ name: name }, rest));
14
36
  };
15
37
  exports.default = EbayTextboxPostfixIcon;
@@ -1 +1 @@
1
- {"version":3,"file":"prefix-icon.d.ts","sourceRoot":"","sources":["../../src/ebay-textbox/prefix-icon.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAEjC,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAE9C,QAAA,MAAM,qBAAqB,EAAE,EAAE,CAAC,oBAAoB,CAInD,CAAA;AAED,eAAe,qBAAqB,CAAA"}
1
+ {"version":3,"file":"prefix-icon.d.ts","sourceRoot":"","sources":["../../src/ebay-textbox/prefix-icon.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAEjC,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAE9C,QAAA,MAAM,qBAAqB,EAAE,EAAE,CAAC,oBAAoB,CAKnD,CAAA;AAED,eAAe,qBAAqB,CAAA"}
@@ -1,4 +1,26 @@
1
1
  "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __rest = (this && this.__rest) || function (s, e) {
14
+ var t = {};
15
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
16
+ t[p] = s[p];
17
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
18
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
19
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
20
+ t[p[i]] = s[p[i]];
21
+ }
22
+ return t;
23
+ };
2
24
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
25
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
26
  };
@@ -6,7 +28,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
28
  var react_1 = __importDefault(require("react"));
7
29
  var ebay_icon_1 = require("../ebay-icon");
8
30
  var EbayTextboxPrefixIcon = function (_a) {
9
- var name = _a.name;
10
- return (react_1.default.createElement(ebay_icon_1.EbayIcon, { name: name }));
31
+ var name = _a.name, rest = __rest(_a, ["name"]);
32
+ return (react_1.default.createElement(ebay_icon_1.EbayIcon, __assign({ name: name }, rest)));
11
33
  };
12
34
  exports.default = EbayTextboxPrefixIcon;
@@ -1,19 +1,29 @@
1
- import React, { ChangeEvent, ComponentProps, FocusEvent, Ref } from 'react';
1
+ import React, { ComponentProps, Ref } from 'react';
2
2
  import { Size } from './index';
3
+ import { EbayChangeEventHandler, EbayEventHandler, EbayFocusEventHandler, EbayKeyboardEventHandler, EbayMouseEventHandler } from '../common/event-utils/types';
3
4
  declare type TextInputProps = ComponentProps<'input'> & ComponentProps<'textarea'>;
5
+ export declare type TextboxEventProps = {
6
+ value: string;
7
+ };
4
8
  export declare type EbayTextboxProps = {
5
9
  fluid?: boolean;
6
10
  invalid?: boolean;
7
11
  multiline?: boolean;
8
12
  defaultValue?: string;
9
13
  inputSize?: Size;
10
- onFocus?: (e?: FocusEvent<HTMLTextAreaElement & HTMLInputElement>, value?: string) => void;
11
- onBlur?: (e?: FocusEvent<HTMLTextAreaElement & HTMLInputElement>, value?: string) => void;
12
- onChange?: (e: ChangeEvent<HTMLTextAreaElement & HTMLInputElement>, value: string) => void;
13
- onButtonClick?: (e: MouseEvent, value: string) => void;
14
14
  floatingLabel?: string;
15
+ onChange?: EbayChangeEventHandler<HTMLTextAreaElement & HTMLInputElement, TextboxEventProps>;
16
+ onInputChange?: EbayChangeEventHandler<HTMLTextAreaElement & HTMLInputElement, TextboxEventProps>;
17
+ onFocus?: EbayFocusEventHandler<HTMLTextAreaElement & HTMLInputElement, TextboxEventProps>;
18
+ onBlur?: EbayFocusEventHandler<HTMLTextAreaElement & HTMLInputElement, TextboxEventProps>;
19
+ onKeyPress?: EbayKeyboardEventHandler<HTMLTextAreaElement & HTMLInputElement, TextboxEventProps>;
20
+ onKeyUp?: EbayKeyboardEventHandler<HTMLTextAreaElement & HTMLInputElement, TextboxEventProps>;
21
+ onKeyDown?: EbayKeyboardEventHandler<HTMLTextAreaElement & HTMLInputElement, TextboxEventProps>;
22
+ onInvalid?: EbayEventHandler<HTMLTextAreaElement & HTMLInputElement, TextboxEventProps>;
23
+ onFloatingLabelInit?: () => void;
24
+ onButtonClick?: EbayKeyboardEventHandler<HTMLInputElement, TextboxEventProps> & EbayMouseEventHandler<HTMLInputElement, TextboxEventProps>;
15
25
  forwardedRef?: Ref<HTMLTextAreaElement | HTMLInputElement>;
16
- } & Omit<TextInputProps, 'onFocus' | 'onBlur'>;
17
- declare const _default: React.ForwardRefExoticComponent<Pick<EbayTextboxProps, "form" | "slot" | "style" | "title" | "pattern" | "type" | "invalid" | "key" | "value" | "className" | "disabled" | "inputSize" | "placeholder" | "children" | "dir" | "list" | "accept" | "alt" | "autoComplete" | "autoFocus" | "capture" | "checked" | "cols" | "crossOrigin" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "height" | "max" | "maxLength" | "min" | "minLength" | "multiple" | "name" | "readOnly" | "required" | "rows" | "size" | "src" | "step" | "width" | "wrap" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "draggable" | "hidden" | "id" | "lang" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "forwardedRef" | "fluid" | "floatingLabel" | "dirName" | "multiline" | "onButtonClick"> & React.RefAttributes<React.FC<EbayTextboxProps>>>;
26
+ } & Omit<TextInputProps, 'onFocus' | 'onBlur' | 'onChange' | 'onKeyPress' | 'onKeyUp' | 'onKeyDown' | 'onInvalid'>;
27
+ declare const _default: React.ForwardRefExoticComponent<Pick<EbayTextboxProps, "form" | "slot" | "style" | "title" | "pattern" | "type" | "invalid" | "key" | "value" | "className" | "disabled" | "inputSize" | "placeholder" | "children" | "dir" | "list" | "accept" | "alt" | "autoComplete" | "autoFocus" | "capture" | "checked" | "cols" | "crossOrigin" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "height" | "max" | "maxLength" | "min" | "minLength" | "multiple" | "name" | "readOnly" | "required" | "rows" | "size" | "src" | "step" | "width" | "wrap" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "draggable" | "hidden" | "id" | "lang" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "forwardedRef" | "fluid" | "floatingLabel" | "dirName" | "multiline" | "onInputChange" | "onFloatingLabelInit" | "onButtonClick"> & React.RefAttributes<React.FC<EbayTextboxProps>>>;
18
28
  export default _default;
19
29
  //# sourceMappingURL=textbox.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"textbox.d.ts","sourceRoot":"","sources":["../../src/ebay-textbox/textbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,WAAW,EAAgB,cAAc,EAAM,UAAU,EAAE,GAAG,EAAuB,MAAM,OAAO,CAAA;AAGlH,OAAO,EAAiD,IAAI,EAAE,MAAM,SAAS,CAAA;AAK7E,aAAK,cAAc,GAAG,cAAc,CAAC,OAAO,CAAC,GAAG,cAAc,CAAC,UAAU,CAAC,CAAA;AAE1E,oBAAY,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,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,mBAAmB,GAAG,gBAAgB,CAAC,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3F,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,mBAAmB,GAAG,gBAAgB,CAAC,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1F,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,WAAW,CAAC,mBAAmB,GAAG,gBAAgB,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3F,aAAa,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,GAAG,CAAC,mBAAmB,GAAG,gBAAgB,CAAC,CAAC;CAC9D,GAAG,IAAI,CAAC,cAAc,EAAE,SAAS,GAAG,QAAQ,CAAC,CAAC;;AA2G/C,wBAA4D"}
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;AAGd,OAAO,EAAiD,IAAI,EAAE,MAAM,SAAS,CAAA;AAE7E,OAAO,EACH,sBAAsB,EACtB,gBAAgB,EAChB,qBAAqB,EACrB,wBAAwB,EAAE,qBAAqB,EAClD,MAAM,6BAA6B,CAAA;AAIpC,aAAK,cAAc,GAAG,cAAc,CAAC,OAAO,CAAC,GAAG,cAAc,CAAC,UAAU,CAAC,CAAA;AAE1E,oBAAY,iBAAiB,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAA;AACjD,oBAAY,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;CAC9D,GAAG,IAAI,CAAC,cAAc,EAAE,SAAS,GAAG,QAAQ,GAAG,UAAU,GAAG,YAAY,GAAG,SAAS,GAAG,WAAW,GAAG,WAAW,CAAC,CAAC;;AAuJnH,wBAA4D"}
@@ -51,38 +51,67 @@ var index_1 = require("./index");
51
51
  var hooks_1 = require("../common/floating-label-utils/hooks");
52
52
  var isControlled = function (value) { return typeof value !== 'undefined'; };
53
53
  var EbayTextbox = function (_a) {
54
- var _b = _a.type, type = _b === void 0 ? 'text' : _b, invalid = _a.invalid, fluid = _a.fluid, multiline = _a.multiline, _c = _a.onChange, onChange = _c === void 0 ? function () { } : _c, _d = _a.onFocus, onFocus = _d === void 0 ? function () { } : _d, _e = _a.onBlur, onBlur = _e === void 0 ? function () { } : _e, _f = _a.onButtonClick, onButtonClick = _f === void 0 ? function () { } : _f, autoFocus = _a.autoFocus, _g = _a.defaultValue, defaultValue = _g === void 0 ? '' : _g, controlledValue = _a.value, forwardedRef = _a.forwardedRef, _h = _a.inputSize, inputSize = _h === void 0 ? 'default' : _h, floatingLabel = _a.floatingLabel, children = _a.children, placeholder = _a.placeholder, rest = __rest(_a, ["type", "invalid", "fluid", "multiline", "onChange", "onFocus", "onBlur", "onButtonClick", "autoFocus", "defaultValue", "value", "forwardedRef", "inputSize", "floatingLabel", "children", "placeholder"]);
55
- var _j = react_1.useState(defaultValue), value = _j[0], setValue = _j[1];
56
- var _k = hooks_1.useFloatingLabel({
54
+ var _b = _a.type, type = _b === void 0 ? 'text' : _b, invalid = _a.invalid, fluid = _a.fluid, multiline = _a.multiline, _c = _a.onChange, onChange = _c === void 0 ? function () { } : _c, _d = _a.onInputChange, onInputChange = _d === void 0 ? function () { } : _d, _e = _a.onFocus, onFocus = _e === void 0 ? function () { } : _e, _f = _a.onBlur, onBlur = _f === void 0 ? function () { } : _f, _g = _a.onKeyPress, onKeyPress = _g === void 0 ? function () { } : _g, _h = _a.onKeyUp, onKeyUp = _h === void 0 ? function () { } : _h, _j = _a.onKeyDown, onKeyDown = _j === void 0 ? function () { } : _j, _k = _a.onInvalid, onInvalid = _k === void 0 ? function () { } : _k, _l = _a.onFloatingLabelInit, onFloatingLabelInit = _l === void 0 ? function () { } : _l, _m = _a.onButtonClick, onButtonClick = _m === void 0 ? function () { } : _m, autoFocus = _a.autoFocus, _o = _a.defaultValue, defaultValue = _o === void 0 ? '' : _o, controlledValue = _a.value, forwardedRef = _a.forwardedRef, _p = _a.inputSize, inputSize = _p === void 0 ? 'default' : _p, floatingLabel = _a.floatingLabel, children = _a.children, placeholder = _a.placeholder, rest = __rest(_a, ["type", "invalid", "fluid", "multiline", "onChange", "onInputChange", "onFocus", "onBlur", "onKeyPress", "onKeyUp", "onKeyDown", "onInvalid", "onFloatingLabelInit", "onButtonClick", "autoFocus", "defaultValue", "value", "forwardedRef", "inputSize", "floatingLabel", "children", "placeholder"]);
55
+ var _q = react_1.useState(defaultValue), value = _q[0], setValue = _q[1];
56
+ var _r = react_1.useState(defaultValue), inputValue = _r[0], setInputValue = _r[1];
57
+ var _s = hooks_1.useFloatingLabel({
57
58
  ref: forwardedRef,
58
59
  inputId: rest.id,
59
60
  className: rest.className,
60
61
  disabled: rest.disabled,
61
62
  label: floatingLabel,
62
63
  inputSize: inputSize,
63
- inputValue: controlledValue || value,
64
+ inputValue: controlledValue || inputValue,
64
65
  placeholder: placeholder,
65
- invalid: invalid
66
- }), label = _k.label, Container = _k.Container, onFloatingLabelBlur = _k.onBlur, onFloatingLabelFocus = _k.onFocus, ref = _k.ref, floatingLabelPlaceholder = _k.placeholder;
66
+ invalid: invalid,
67
+ onMount: onFloatingLabelInit
68
+ }), label = _s.label, Container = _s.Container, onFloatingLabelBlur = _s.onBlur, onFloatingLabelFocus = _s.onFocus, ref = _s.ref, floatingLabelPlaceholder = _s.placeholder;
67
69
  var handleFocus = function (event) {
68
- onFocus(event);
70
+ var _a;
71
+ onFocus(event, { value: ((_a = event === null || event === void 0 ? void 0 : event.target) === null || _a === void 0 ? void 0 : _a.value) || defaultValue });
69
72
  onFloatingLabelFocus();
70
73
  };
71
74
  var handleBlur = function (event) {
72
- onBlur(event);
75
+ var _a;
76
+ var newValue = (_a = event.target) === null || _a === void 0 ? void 0 : _a.value;
77
+ onBlur(event, { value: newValue });
78
+ if (newValue !== value) {
79
+ onChange(event, { value: newValue });
80
+ setValue(newValue);
81
+ }
73
82
  onFloatingLabelBlur();
74
83
  };
84
+ var handleKeyPress = function (event) {
85
+ var textbox = event.target;
86
+ onKeyPress(event, { value: textbox === null || textbox === void 0 ? void 0 : textbox.value });
87
+ };
88
+ var handleKeyUp = function (event) {
89
+ var textbox = event.target;
90
+ onKeyUp(event, { value: textbox === null || textbox === void 0 ? void 0 : textbox.value });
91
+ };
92
+ var handleKeyDown = function (event) {
93
+ var textbox = event.target;
94
+ onKeyDown(event, { value: textbox === null || textbox === void 0 ? void 0 : textbox.value });
95
+ };
96
+ var handleInvalid = function (event) {
97
+ var textbox = event.target;
98
+ onInvalid(event, { value: textbox === null || textbox === void 0 ? void 0 : textbox.value });
99
+ };
100
+ var handleButtonClick = function (event) {
101
+ onButtonClick(event, { value: value });
102
+ };
75
103
  react_1.useEffect(function () {
76
104
  if (autoFocus) {
77
105
  handleFocus();
78
106
  }
79
107
  }, []);
80
- var onChangeHandler = function (e) {
81
- var newValue = e.target.value;
108
+ var handleInputChange = function (e) {
109
+ var _a;
110
+ var newValue = (_a = e.target) === null || _a === void 0 ? void 0 : _a.value;
82
111
  if (!isControlled(controlledValue)) {
83
- setValue(newValue);
112
+ setInputValue(newValue);
84
113
  }
85
- onChange(e, newValue);
114
+ onInputChange(e, { value: newValue });
86
115
  };
87
116
  var Input = multiline ? 'textarea' : 'input';
88
117
  var Wrapper = fluid ? 'div' : 'span';
@@ -99,7 +128,11 @@ var EbayTextbox = function (_a) {
99
128
  label,
100
129
  react_1.default.createElement(Wrapper, { className: wrapperClassName },
101
130
  prefixIcon,
102
- react_1.default.createElement(Input, __assign({}, rest, { className: inputClassName, type: type, "aria-invalid": invalid, value: isControlled(controlledValue) ? controlledValue : value, onChange: onChangeHandler, onBlur: handleBlur, onFocus: handleFocus, autoFocus: autoFocus, ref: ref, placeholder: floatingLabelPlaceholder })),
103
- postfixIcon && react_1.cloneElement(postfixIcon, __assign({ onClick: onButtonClick }, postfixIcon.props)))));
131
+ react_1.default.createElement(Input, __assign({}, rest, { className: inputClassName, type: type, "aria-invalid": invalid, value: isControlled(controlledValue) ? controlledValue : inputValue, onChange: handleInputChange, onBlur: handleBlur, onFocus: handleFocus, onKeyPress: handleKeyPress, onKeyUp: handleKeyUp, onKeyDown: handleKeyDown, onInvalid: handleInvalid, autoFocus: autoFocus, ref: ref, placeholder: floatingLabelPlaceholder })),
132
+ postfixIcon && react_1.cloneElement(postfixIcon, __assign(__assign({}, postfixIcon.props), { onClick: function (e) {
133
+ var _a = postfixIcon.props.onClick, iconClick = _a === void 0 ? function () { } : _a;
134
+ iconClick(e);
135
+ handleButtonClick(e);
136
+ } })))));
104
137
  };
105
138
  exports.default = component_utils_1.withForwardRef(EbayTextbox);
@@ -1,7 +1,7 @@
1
- import { KeyboardEvent, MouseEvent } from 'react';
1
+ import { ComponentProps, KeyboardEvent, MouseEvent } from 'react';
2
2
  import type { Icon } from '../ebay-icon';
3
3
  export declare type Size = 'default' | 'large';
4
- export declare type EbayTextboxIconProps = {
4
+ export declare type EbayTextboxIconProps = ComponentProps<'button'> & ComponentProps<'a'> & {
5
5
  name: Icon;
6
6
  buttonAriaLabel?: string;
7
7
  onClick?: (e: KeyboardEvent | MouseEvent) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/ebay-textbox/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACjD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAExC,oBAAY,IAAI,GAAG,SAAS,GAAG,OAAO,CAAA;AAEtC,oBAAY,oBAAoB,GAAG;IAC/B,IAAI,EAAE,IAAI,CAAA;IACV,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,aAAa,GAAG,UAAU,KAAK,IAAI,CAAA;CACpD,CAAA"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/ebay-textbox/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACjE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAExC,oBAAY,IAAI,GAAG,SAAS,GAAG,OAAO,CAAA;AAEtC,oBAAY,oBAAoB,GAAG,cAAc,CAAC,QAAQ,CAAC,GAAG,cAAc,CAAC,GAAG,CAAC,GAAG;IAChF,IAAI,EAAE,IAAI,CAAA;IACV,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,aAAa,GAAG,UAAU,KAAK,IAAI,CAAA;CACpD,CAAA"}