@ebay/ui-core-react 5.11.0 → 5.11.2

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.
@@ -10,7 +10,18 @@ import { EbayListboxButton, EbayListboxButtonOption } from '@ebay/ui-core-react/
10
10
  ## Import following styles from SKIN
11
11
  ```jsx harmony
12
12
  import '@ebay/skin/listbox-button';
13
+
14
+ // Add if you're using floating labels
15
+ import '@ebay/skin/floating-label';
13
16
  ```
17
+ ## Import styles using SCSS/CSS
18
+ ```jsx harmony
19
+ import '@ebay/skin/listbox-button.css'
20
+
21
+ // Add if you're using floating labels
22
+ import '@ebay/skin/floating-label.css';
23
+ ```
24
+
14
25
  ## Usage
15
26
  ```
16
27
  yarn add @ebay/ui-core-react
@@ -11,10 +11,16 @@ import { EbaySelect, EbaySelectOption } from '@ebay/ui-core-react/ebay-select'
11
11
  ## Import following styles from SKIN
12
12
  ```jsx harmony
13
13
  import '@ebay/skin/select';
14
+
15
+ // Add if you're using floating labels
16
+ import '@ebay/skin/floating-label';
14
17
  ```
15
18
  ## Import styles using SCSS/CSS
16
19
  ```jsx harmony
17
20
  import '@ebay/skin/select.css'
21
+
22
+ // Add if you're using floating labels
23
+ import '@ebay/skin/floating-label.css';
18
24
  ```
19
25
 
20
26
  ## Usage
@@ -1,4 +1,4 @@
1
- import { ComponentProps, FC } from 'react';
1
+ import React, { ComponentProps } from 'react';
2
2
  import { EbayChangeEventHandler } from '../common/event-utils/types';
3
3
  type SelectValue = string | ReadonlyArray<string> | number;
4
4
  export type ChangeEventProps = {
@@ -10,9 +10,10 @@ export type EbaySelectProps = Omit<ComponentProps<'select'>, 'onChange'> & {
10
10
  defaultValue?: SelectValue;
11
11
  onChange?: EbayChangeEventHandler<HTMLSelectElement, ChangeEventProps>;
12
12
  floatingLabel?: string;
13
+ forwardedRef?: React.Ref<HTMLSelectElement>;
13
14
  inputSize?: 'default' | 'large';
14
15
  invalid?: boolean;
15
16
  };
16
- declare const EbaySelect: FC<EbaySelectProps>;
17
- export default EbaySelect;
17
+ declare const _default: React.ForwardRefExoticComponent<Pick<EbaySelectProps, "form" | "slot" | "style" | "title" | "forwardedRef" | "invalid" | "key" | "value" | "className" | "disabled" | "inputSize" | "placeholder" | "children" | "multiple" | "name" | "required" | "size" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "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" | "autoComplete" | "autoFocus" | "borderless" | "floatingLabel"> & React.RefAttributes<React.FC<EbaySelectProps>>>;
18
+ export default _default;
18
19
  //# sourceMappingURL=ebay-select.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ebay-select.d.ts","sourceRoot":"","sources":["../../src/ebay-select/ebay-select.tsx"],"names":[],"mappings":"AAAA,OAAc,EAA6B,cAAc,EAAE,EAAE,EAAgC,MAAM,OAAO,CAAA;AAM1G,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AAIpE,KAAK,WAAW,GAAG,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;AAC3D,MAAM,MAAM,gBAAgB,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,CAAA;AACpE,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC,GAAG;IACvE,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,EAAE,sBAAsB,CAAC,iBAAiB,EAAE,gBAAgB,CAAC,CAAC;IACvE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IAChC,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,QAAA,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,CAiFnC,CAAA;AAED,eAAe,UAAU,CAAA"}
1
+ {"version":3,"file":"ebay-select.d.ts","sourceRoot":"","sources":["../../src/ebay-select/ebay-select.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAA6B,cAAc,EAA4B,MAAM,OAAO,CAAA;AAMlG,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AAIpE,KAAK,WAAW,GAAG,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;AAC3D,MAAM,MAAM,gBAAgB,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,CAAA;AACpE,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC,GAAG;IACvE,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,EAAE,sBAAsB,CAAC,iBAAiB,EAAE,gBAAgB,CAAC,CAAC;IACvE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IAC5C,SAAS,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IAChC,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;;AAqFF,wBAA0D"}
@@ -56,12 +56,11 @@ var component_utils_1 = require("../common/component-utils");
56
56
  var hooks_1 = require("../common/floating-label-utils/hooks");
57
57
  var isControlled = function (value) { return typeof value !== 'undefined'; };
58
58
  var EbaySelect = function (_a) {
59
- var controlledValue = _a.value, defaultValue = _a.defaultValue, className = _a.className, borderless = _a.borderless, name = _a.name, disabled = _a.disabled, _b = _a.onChange, onChange = _b === void 0 ? function () { } : _b, _c = _a.onBlur, onBlur = _c === void 0 ? function () { } : _c, _d = _a.onFocus, onFocus = _d === void 0 ? function () { } : _d, floatingLabel = _a.floatingLabel, children = _a.children, inputSize = _a.inputSize, invalid = _a.invalid, rest = __rest(_a, ["value", "defaultValue", "className", "borderless", "name", "disabled", "onChange", "onBlur", "onFocus", "floatingLabel", "children", "inputSize", "invalid"]);
59
+ var controlledValue = _a.value, defaultValue = _a.defaultValue, className = _a.className, borderless = _a.borderless, name = _a.name, disabled = _a.disabled, _b = _a.onChange, onChange = _b === void 0 ? function () { } : _b, _c = _a.onBlur, onBlur = _c === void 0 ? function () { } : _c, _d = _a.onFocus, onFocus = _d === void 0 ? function () { } : _d, floatingLabel = _a.floatingLabel, forwardedRef = _a.forwardedRef, children = _a.children, inputSize = _a.inputSize, invalid = _a.invalid, rest = __rest(_a, ["value", "defaultValue", "className", "borderless", "name", "disabled", "onChange", "onBlur", "onFocus", "floatingLabel", "forwardedRef", "children", "inputSize", "invalid"]);
60
60
  var isFieldInvalid = invalid || rest['aria-invalid'] === 'true';
61
61
  var _e = (0, react_1.useState)(defaultValue), value = _e[0], setValue = _e[1];
62
- var selectRef = (0, react_1.useRef)(null);
63
62
  var _f = (0, hooks_1.useFloatingLabel)({
64
- ref: selectRef,
63
+ ref: forwardedRef,
65
64
  inputId: rest.id,
66
65
  className: className,
67
66
  disabled: disabled,
@@ -95,7 +94,7 @@ var EbaySelect = function (_a) {
95
94
  react_1.default.createElement("select", __assign({}, rest, { name: name, value: isControlled(controlledValue) ? controlledValue : value, disabled: disabled, onChange: handleSelectChange, onBlur: handleBlur, onFocus: handleFocus, ref: ref }), options(children)),
96
95
  react_1.default.createElement(ebay_icon_1.EbayIcon, { name: "chevronDown12", height: "8", width: "8" }))));
97
96
  };
98
- exports.default = EbaySelect;
97
+ exports.default = (0, component_utils_1.withForwardRef)(EbaySelect);
99
98
  function optionGroups(data) {
100
99
  var optGroups = {};
101
100
  data.forEach(function (opt) {
@@ -18,10 +18,16 @@ import { EbayTextbox } from '@ebay/ui-core-react/ebay-textbox'
18
18
  ### Import following styles from SKIN
19
19
  ```jsx harmony
20
20
  import "@ebay/skin/textbox";
21
+
22
+ // Add if you're using floating labels
23
+ import "@ebay/skin/floating-label";
21
24
  ```
22
25
  ### or if using CSS/SCSS
23
26
  ```jsx
24
27
  import "@ebay/skin/textbox.css";
28
+
29
+ // Add if you're using floating labels
30
+ import "@ebay/skin/floating-label.css";
25
31
  ```
26
32
 
27
33
  ```jsx harmony
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ebay/ui-core-react",
3
- "version": "5.11.0",
3
+ "version": "5.11.2",
4
4
  "description": "Skin components build off React",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org"