@ebay/ui-core-react 3.5.0 → 3.6.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu-button.d.ts","sourceRoot":"","sources":["../../src/ebay-fake-menu-button/menu-button.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAgB,cAAc,EAAE,EAAE,EAA+B,MAAM,OAAO,CAAA;AAM5F,OAAO,EAAc,eAAe,EAAiE,MAAM,IAAI,CAAA;AAG/G,oBAAY,yBAAyB,GAAG,UAAU,GAAG,MAAM,GAAG,QAAQ,CAAA;AAEtE,oBAAY,uBAAuB,GAAG;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,yBAAyB,CAAC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,IAAI,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC;CAC/B,CAAA;AAED,aAAK,WAAW,GAAG,IAAI,CAAC,eAAe,EAAE,SAAS,CAAC,GAC/C,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,GACtC,cAAc,CAAC,GAAG,CAAC,CAAA;AACvB,aAAK,KAAK,GAAG,WAAW,GAAG,uBAAuB,CAAA;AAElD,QAAA,MAAM,cAAc,EAAE,EAAE,CAAC,KAAK,
|
|
1
|
+
{"version":3,"file":"menu-button.d.ts","sourceRoot":"","sources":["../../src/ebay-fake-menu-button/menu-button.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAgB,cAAc,EAAE,EAAE,EAA+B,MAAM,OAAO,CAAA;AAM5F,OAAO,EAAc,eAAe,EAAiE,MAAM,IAAI,CAAA;AAG/G,oBAAY,yBAAyB,GAAG,UAAU,GAAG,MAAM,GAAG,QAAQ,CAAA;AAEtE,oBAAY,uBAAuB,GAAG;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,yBAAyB,CAAC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,IAAI,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC;CAC/B,CAAA;AAED,aAAK,WAAW,GAAG,IAAI,CAAC,eAAe,EAAE,SAAS,CAAC,GAC/C,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,GACtC,cAAc,CAAC,GAAG,CAAC,CAAA;AACvB,aAAK,KAAK,GAAG,WAAW,GAAG,uBAAuB,CAAA;AAElD,QAAA,MAAM,cAAc,EAAE,EAAE,CAAC,KAAK,CAsG7B,CAAA;AAED,eAAe,cAAc,CAAA"}
|
|
@@ -103,7 +103,7 @@ var EbayMenuButton = function (_a) {
|
|
|
103
103
|
label),
|
|
104
104
|
expanded &&
|
|
105
105
|
react_1.default.createElement(__1.EbayFakeMenu, { className: menuClasses, id: menuId, tabIndex: -1, onKeyDown: handleMenuKeydown }, menuItems.map(function (item, i) {
|
|
106
|
-
return react_1.cloneElement(item, __assign(__assign({}, item.props), { key: i, autoFocus: i === 0 }));
|
|
106
|
+
return react_1.cloneElement(item, __assign(__assign({}, item.props), { className: classnames_1.default(item.props.className, 'fake-menu-button__item'), key: i, autoFocus: i === 0 }));
|
|
107
107
|
}))));
|
|
108
108
|
};
|
|
109
109
|
exports.default = EbayMenuButton;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComponentProps,
|
|
1
|
+
import React, { ComponentProps, RefObject } from 'react';
|
|
2
2
|
import { Icon } from '../ebay-icon';
|
|
3
3
|
export declare type EbayIconButtonProps = {
|
|
4
4
|
href?: string;
|
|
@@ -6,10 +6,11 @@ export declare type EbayIconButtonProps = {
|
|
|
6
6
|
badgeNumber?: number;
|
|
7
7
|
badgeAriaLabel?: string;
|
|
8
8
|
transparent?: boolean;
|
|
9
|
+
forwardedRef?: RefObject<HTMLAnchorElement & HTMLButtonElement>;
|
|
9
10
|
};
|
|
10
11
|
declare type HTMLButtonProps = ComponentProps<'button'>;
|
|
11
12
|
declare type HTMLAnchorProps = ComponentProps<'a'>;
|
|
12
13
|
declare type Props = EbayIconButtonProps & HTMLButtonProps & HTMLAnchorProps;
|
|
13
|
-
declare const
|
|
14
|
-
export default
|
|
14
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<Props, "form" | "slot" | "style" | "title" | "type" | "icon" | "download" | "key" | "name" | "className" | "forwardedRef" | "color" | "id" | "lang" | "media" | "target" | "role" | "tabIndex" | "href" | "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" | "children" | "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" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "transparent" | "disabled" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "value" | "hrefLang" | "ping" | "rel" | "referrerPolicy" | "badgeNumber" | "badgeAriaLabel"> & React.RefAttributes<React.FC<Props>>>;
|
|
15
|
+
export default _default;
|
|
15
16
|
//# sourceMappingURL=icon-button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon-button.d.ts","sourceRoot":"","sources":["../../src/ebay-icon-button/icon-button.tsx"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"icon-button.d.ts","sourceRoot":"","sources":["../../src/ebay-icon-button/icon-button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,cAAc,EAAM,SAAS,EAAE,MAAM,OAAO,CAAA;AAE5D,OAAO,EAAY,IAAI,EAAE,MAAM,cAAc,CAAA;AAI7C,oBAAY,mBAAmB,GAAG;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,IAAI,CAAC;IACX,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,SAAS,CAAC,iBAAiB,GAAG,iBAAiB,CAAC,CAAC;CACnE,CAAA;AAED,aAAK,eAAe,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAC;AAChD,aAAK,eAAe,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC;AAC3C,aAAK,KAAK,GAAG,mBAAmB,GAAG,eAAe,GAAG,eAAe,CAAC;;AAiDrE,wBAA6C"}
|
|
@@ -29,9 +29,10 @@ var react_1 = __importDefault(require("react"));
|
|
|
29
29
|
var classnames_1 = __importDefault(require("classnames"));
|
|
30
30
|
var ebay_icon_1 = require("../ebay-icon");
|
|
31
31
|
var ebay_badge_1 = require("../ebay-badge");
|
|
32
|
+
var component_utils_1 = require("../common/component-utils");
|
|
32
33
|
var EbayIconButton = function (_a) {
|
|
33
34
|
var _b;
|
|
34
|
-
var href = _a.href, icon = _a.icon, badgeNumber = _a.badgeNumber, badgeAriaLabel = _a.badgeAriaLabel, transparent = _a.transparent, extraClasses = _a.className, rest = __rest(_a, ["href", "icon", "badgeNumber", "badgeAriaLabel", "transparent", "className"]);
|
|
35
|
+
var href = _a.href, icon = _a.icon, badgeNumber = _a.badgeNumber, badgeAriaLabel = _a.badgeAriaLabel, transparent = _a.transparent, extraClasses = _a.className, forwardedRef = _a.forwardedRef, rest = __rest(_a, ["href", "icon", "badgeNumber", "badgeAriaLabel", "transparent", "className", "forwardedRef"]);
|
|
35
36
|
var classPrefix = href ? 'icon-link' : 'icon-btn';
|
|
36
37
|
var className = classnames_1.default(extraClasses, classPrefix, (_b = {},
|
|
37
38
|
_b[classPrefix + "--badged"] = badgeNumber,
|
|
@@ -40,6 +41,6 @@ var EbayIconButton = function (_a) {
|
|
|
40
41
|
var children = (react_1.default.createElement(react_1.default.Fragment, null,
|
|
41
42
|
react_1.default.createElement(ebay_icon_1.EbayIcon, { name: icon }),
|
|
42
43
|
badgeNumber && react_1.default.createElement(ebay_badge_1.EbayBadge, { type: "icon", number: badgeNumber, "aria-label": badgeAriaLabel })));
|
|
43
|
-
return href ? (react_1.default.createElement("a", __assign({ className: className, href: href }, rest), children)) : (react_1.default.createElement("button", __assign({ type: "button", className: className }, rest), children));
|
|
44
|
+
return href ? (react_1.default.createElement("a", __assign({ ref: forwardedRef, className: className, href: href }, rest), children)) : (react_1.default.createElement("button", __assign({ ref: forwardedRef, type: "button", className: className }, rest), children));
|
|
44
45
|
};
|
|
45
|
-
exports.default = EbayIconButton;
|
|
46
|
+
exports.default = component_utils_1.withForwardRef(EbayIconButton);
|