@ebay/ui-core-react 1.2.0 → 1.3.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/common/tooltip-utils/use-tooltip.d.ts +3 -1
- package/common/tooltip-utils/use-tooltip.d.ts.map +1 -1
- package/common/tooltip-utils/use-tooltip.js +3 -1
- package/ebay-icon/README.md +1 -0
- package/ebay-icon/icon.d.ts +1 -0
- package/ebay-icon/icon.d.ts.map +1 -1
- package/ebay-icon/icon.js +12 -4
- package/ebay-infotip/ebay-infotip-host.d.ts +1 -1
- package/ebay-infotip/ebay-infotip.d.ts.map +1 -1
- package/ebay-infotip/ebay-infotip.js +3 -2
- package/ebay-tabs/tab-panel.d.ts +1 -0
- package/ebay-tabs/tab-panel.d.ts.map +1 -1
- package/ebay-tabs/tab-panel.js +2 -2
- package/ebay-tabs/tab.d.ts +1 -0
- package/ebay-tabs/tab.d.ts.map +1 -1
- package/ebay-tabs/tab.js +2 -2
- package/ebay-tabs/tabs.d.ts.map +1 -1
- package/ebay-tabs/tabs.js +5 -3
- package/package.json +1 -1
|
@@ -1,13 +1,15 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
1
2
|
declare type UseTooltipArgs = {
|
|
2
3
|
onExpand: () => void;
|
|
3
4
|
onCollapse: () => void;
|
|
4
5
|
initialExpanded?: boolean;
|
|
6
|
+
hostRef?: RefObject<HTMLElement>;
|
|
5
7
|
};
|
|
6
8
|
declare type UseTooltip = {
|
|
7
9
|
isExpanded: boolean;
|
|
8
10
|
expandTooltip: () => void;
|
|
9
11
|
collapseTooltip: () => void;
|
|
10
12
|
};
|
|
11
|
-
export declare const useTooltip: ({ onExpand, onCollapse, initialExpanded }: UseTooltipArgs) => UseTooltip;
|
|
13
|
+
export declare const useTooltip: ({ onExpand, onCollapse, initialExpanded, hostRef }: UseTooltipArgs) => UseTooltip;
|
|
12
14
|
export {};
|
|
13
15
|
//# sourceMappingURL=use-tooltip.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-tooltip.d.ts","sourceRoot":"","sources":["../../../src/common/tooltip-utils/use-tooltip.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-tooltip.d.ts","sourceRoot":"","sources":["../../../src/common/tooltip-utils/use-tooltip.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,SAAS,EAAE,MAAM,OAAO,CAAA;AAE3C,aAAK,cAAc,GAAG;IAClB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,OAAO,CAAC,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC;CACpC,CAAC;AAEF,aAAK,UAAU,GAAG;IACd,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,eAAe,EAAE,MAAM,IAAI,CAAC;CAC/B,CAAC;AAEF,eAAO,MAAM,UAAU,uDAAgE,cAAc,KAAG,UAuBvG,CAAA"}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.useTooltip = void 0;
|
|
4
4
|
var react_1 = require("react");
|
|
5
5
|
exports.useTooltip = function (_a) {
|
|
6
|
-
var onExpand = _a.onExpand, onCollapse = _a.onCollapse, _b = _a.initialExpanded, initialExpanded = _b === void 0 ? false : _b;
|
|
6
|
+
var onExpand = _a.onExpand, onCollapse = _a.onCollapse, _b = _a.initialExpanded, initialExpanded = _b === void 0 ? false : _b, hostRef = _a.hostRef;
|
|
7
7
|
var _c = react_1.useState(initialExpanded), isExpanded = _c[0], setIsExpanded = _c[1];
|
|
8
8
|
var expandTooltip = function () {
|
|
9
9
|
setIsExpanded(true);
|
|
@@ -12,10 +12,12 @@ exports.useTooltip = function (_a) {
|
|
|
12
12
|
}
|
|
13
13
|
};
|
|
14
14
|
var collapseTooltip = function () {
|
|
15
|
+
var _a;
|
|
15
16
|
setIsExpanded(false);
|
|
16
17
|
if (onCollapse) {
|
|
17
18
|
onCollapse();
|
|
18
19
|
}
|
|
20
|
+
(_a = hostRef === null || hostRef === void 0 ? void 0 : hostRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
19
21
|
};
|
|
20
22
|
return {
|
|
21
23
|
isExpanded: isExpanded,
|
package/ebay-icon/README.md
CHANGED
|
@@ -19,3 +19,4 @@ Name | Type | Stateful | Required | Description
|
|
|
19
19
|
`name` | String | No | Yes | name of the icon from [Skin](./icon.tsx), transparent versions of colored icons has `-transparent` suffix
|
|
20
20
|
`noSkinClasses` | Boolean | No | No | Used for special cases where `icon` classes from Skin should not be applied
|
|
21
21
|
`a11yText` | String | No | Yes | text for non-decorative inline icon; icon is assumed to be decorative if this is not passed
|
|
22
|
+
`type` | String | No | no | 'icon' or 'program-badge' default 'icon'
|
package/ebay-icon/icon.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { Icon } from './types';
|
|
|
3
3
|
export declare type A11yVariant = 'label';
|
|
4
4
|
export declare type EbayIconProps = SVGProps<SVGSVGElement> & {
|
|
5
5
|
className?: string;
|
|
6
|
+
type?: 'icon' | 'program-badge' | string;
|
|
6
7
|
name: Icon;
|
|
7
8
|
noSkinClasses?: boolean;
|
|
8
9
|
a11yText?: string;
|
package/ebay-icon/icon.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../src/ebay-icon/icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAM,GAAG,EAAE,QAAQ,EAAuB,MAAM,OAAO,CAAA;AAIrE,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAM9B,oBAAY,WAAW,GAAG,OAAO,CAAC;AAElC,oBAAY,aAAa,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG;IAClD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,IAAI,CAAC;IACX,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,YAAY,CAAC,EAAE,GAAG,CAAC,aAAa,CAAC,CAAC;CACrC,CAAC;;
|
|
1
|
+
{"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../src/ebay-icon/icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAM,GAAG,EAAE,QAAQ,EAAuB,MAAM,OAAO,CAAA;AAIrE,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAM9B,oBAAY,WAAW,GAAG,OAAO,CAAC;AAElC,oBAAY,aAAa,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG;IAClD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,GAAE,eAAe,GAAG,MAAM,CAAA;IACvC,IAAI,EAAE,IAAI,CAAC;IACX,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,YAAY,CAAC,EAAE,GAAG,CAAC,aAAa,CAAC,CAAC;CACrC,CAAC;;AAqEF,wBAAuC"}
|
package/ebay-icon/icon.js
CHANGED
|
@@ -53,8 +53,8 @@ var LARGE_ICON_SIZE = 64;
|
|
|
53
53
|
var DEFAULT_ICON_SIZE = 24;
|
|
54
54
|
var EbayIcon = function (_a) {
|
|
55
55
|
var _b;
|
|
56
|
-
var name = _a.name, extraClass = _a.className,
|
|
57
|
-
var
|
|
56
|
+
var name = _a.name, _c = _a.type, type = _c === void 0 ? 'icon' : _c, extraClass = _a.className, _d = _a.noSkinClasses, noSkinClasses = _d === void 0 ? false : _d, a11yText = _a.a11yText, a11yVariant = _a.a11yVariant, forwardedRef = _a.forwardedRef, rest = __rest(_a, ["name", "type", "className", "noSkinClasses", "a11yText", "a11yVariant", "forwardedRef"]);
|
|
57
|
+
var _e = react_1.useState(''), rId = _e[0], setRandomId = _e[1];
|
|
58
58
|
react_1.useEffect(function () {
|
|
59
59
|
setRandomId(random_id_1.randomId());
|
|
60
60
|
}, []);
|
|
@@ -68,11 +68,12 @@ var EbayIcon = function (_a) {
|
|
|
68
68
|
'aria-hidden': true
|
|
69
69
|
};
|
|
70
70
|
var iconSize = getIconSize(name) + "px";
|
|
71
|
+
var prefixSvg = type === 'icon' ? 'icon-' : '';
|
|
71
72
|
var kebabName = kebabCased(name);
|
|
72
|
-
var className = classnames_1.default(extraClass,
|
|
73
|
+
var className = classnames_1.default(extraClass, (_b = {}, _b[getIconClass(type, kebabName)] = !noSkinClasses, _b));
|
|
73
74
|
return (react_1.default.createElement("svg", __assign({ height: iconSize, width: iconSize }, rest, { className: className, xmlns: "http://www.w3.org/2000/svg", focusable: false, ref: forwardedRef }, a11yProps),
|
|
74
75
|
a11yText && !noTitle && react_1.default.createElement("title", { id: a11yTextId }, a11yText),
|
|
75
|
-
react_1.default.createElement("use", { xlinkHref: "#
|
|
76
|
+
react_1.default.createElement("use", { xlinkHref: "#" + prefixSvg + kebabName })));
|
|
76
77
|
};
|
|
77
78
|
function getIconSize(iconName) {
|
|
78
79
|
var sizeCandidate = iconName.split('-').slice(-1)[0];
|
|
@@ -84,4 +85,11 @@ function getIconSize(iconName) {
|
|
|
84
85
|
function kebabCased(str) {
|
|
85
86
|
return str.replace(/([A-Z])/g, function (s, c) { return "-" + c.toLowerCase(); });
|
|
86
87
|
}
|
|
88
|
+
function getIconClass(type, name) {
|
|
89
|
+
if (type === 'icon') {
|
|
90
|
+
return "icon icon--" + name;
|
|
91
|
+
}
|
|
92
|
+
var dashedName = name.replace(type, type + "-");
|
|
93
|
+
return type + " " + dashedName;
|
|
94
|
+
}
|
|
87
95
|
exports.default = component_utils_1.withForwardRef(EbayIcon);
|
|
@@ -9,6 +9,6 @@ declare type InfotipHostProps = ComponentProps<'button'> & {
|
|
|
9
9
|
icon: any;
|
|
10
10
|
}) => ReactNode | ReactNode;
|
|
11
11
|
};
|
|
12
|
-
declare const _default: React.ForwardRefExoticComponent<Pick<InfotipHostProps, "form" | "slot" | "style" | "title" | "type" | "key" | "name" | "className" | "forwardedRef" | "color" | "id" | "lang" | "role" | "tabIndex" | "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" | "variant" | "disabled" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "value"
|
|
12
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<InfotipHostProps, "form" | "slot" | "style" | "title" | "type" | "icon" | "key" | "name" | "className" | "forwardedRef" | "color" | "id" | "lang" | "role" | "tabIndex" | "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" | "variant" | "disabled" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "value"> & React.RefAttributes<React.FC<InfotipHostProps>>>;
|
|
13
13
|
export default _default;
|
|
14
14
|
//# sourceMappingURL=ebay-infotip-host.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ebay-infotip.d.ts","sourceRoot":"","sources":["../../src/ebay-infotip/ebay-infotip.tsx"],"names":[],"mappings":"AAAA,OAAc,EAA+B,aAAa,EAAE,EAAE,EAAU,SAAS,EAAE,MAAM,OAAO,CAAA;AAGhG,OAAO,EAAwC,gBAAgB,EAAc,MAAM,yBAAyB,CAAA;AAI5G,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAGjC,aAAK,YAAY,GAAG;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACxB,CAAC;AAEF,QAAA,MAAM,WAAW,EAAE,EAAE,CAAC,YAAY,
|
|
1
|
+
{"version":3,"file":"ebay-infotip.d.ts","sourceRoot":"","sources":["../../src/ebay-infotip/ebay-infotip.tsx"],"names":[],"mappings":"AAAA,OAAc,EAA+B,aAAa,EAAE,EAAE,EAAU,SAAS,EAAE,MAAM,OAAO,CAAA;AAGhG,OAAO,EAAwC,gBAAgB,EAAc,MAAM,yBAAyB,CAAA;AAI5G,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAGjC,aAAK,YAAY,GAAG;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACxB,CAAC;AAEF,QAAA,MAAM,WAAW,EAAE,EAAE,CAAC,YAAY,CAuFjC,CAAA;AAED,eAAe,WAAW,CAAA"}
|
|
@@ -54,7 +54,8 @@ var ebay_infotip_host_1 = __importDefault(require("./ebay-infotip-host"));
|
|
|
54
54
|
var index_1 = require("./index");
|
|
55
55
|
var EbayInfotip = function (_a) {
|
|
56
56
|
var _b = _a.variant, variant = _b === void 0 ? 'default' : _b, pointer = _a.pointer, overlayStyle = _a.overlayStyle, disabled = _a.disabled, onExpand = _a.onExpand, onCollapse = _a.onCollapse, children = _a.children, initialExpanded = _a.initialExpanded, _c = _a.icon, icon = _c === void 0 ? 'informationSmall' : _c, a11yCloseText = _a.a11yCloseText, ariaLabel = _a["aria-label"], className = _a.className;
|
|
57
|
-
var
|
|
57
|
+
var buttonRef = react_1.useRef();
|
|
58
|
+
var _d = tooltip_utils_1.useTooltip({ onCollapse: onCollapse, onExpand: onExpand, initialExpanded: initialExpanded, hostRef: buttonRef }), isExpanded = _d.isExpanded, expandTooltip = _d.expandTooltip, collapseTooltip = _d.collapseTooltip;
|
|
58
59
|
var isModal = variant === 'modal';
|
|
59
60
|
var containerRef = react_1.useRef();
|
|
60
61
|
var heading = component_utils_1.findComponent(children, index_1.EbayInfotipHeading);
|
|
@@ -73,7 +74,7 @@ var EbayInfotip = function (_a) {
|
|
|
73
74
|
}
|
|
74
75
|
var _e = content.props, contentChildren = _e.children, contentProps = __rest(_e, ["children"]);
|
|
75
76
|
return (react_1.default.createElement(tooltip_utils_1.Tooltip, { type: "infotip", isExpanded: isExpanded, className: classnames_1.default(className, { 'dialog--mini': isModal }), ref: containerRef },
|
|
76
|
-
react_1.default.createElement(tooltip_utils_1.TooltipHost, null, react_1.cloneElement(button, __assign({ onClick: toggleTooltip, disabled: disabled,
|
|
77
|
+
react_1.default.createElement(tooltip_utils_1.TooltipHost, null, react_1.cloneElement(button, __assign({ ref: buttonRef, onClick: toggleTooltip, disabled: disabled,
|
|
77
78
|
variant: variant, 'aria-label': ariaLabel, 'aria-expanded': isExpanded, icon: icon }, button.props))),
|
|
78
79
|
isModal ? (react_1.default.createElement(ebay_lightbox_dialog_1.EbayLightboxDialog, __assign({}, contentProps, { open: isExpanded, onClose: collapseTooltip, mode: "mini", a11yCloseText: a11yCloseText, className: "dialog--mini__overlay" }),
|
|
79
80
|
react_1.default.createElement(ebay_dialog_base_1.EbayDialogHeader, null),
|
package/ebay-tabs/tab-panel.d.ts
CHANGED
|
@@ -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,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,OAAO,CAAC;CAClB,CAAA;AAED,QAAA,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,
|
|
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"}
|
package/ebay-tabs/tab-panel.js
CHANGED
|
@@ -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, selected = _a.selected, fake = _a.fake, className = _a.className, rest = __rest(_a, ["children", "index", "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: "
|
|
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 }),
|
|
33
33
|
react_1.default.createElement("div", { className: "tabs__cell" }, children)));
|
|
34
34
|
};
|
|
35
35
|
exports.default = TabPanel;
|
package/ebay-tabs/tab.d.ts
CHANGED
package/ebay-tabs/tab.d.ts.map
CHANGED
|
@@ -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,MAAM,OAAO,CAAA;AAGjD,aAAK,QAAQ,GAAG,cAAc,CAAC,IAAI,CAAC,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG;IAC3D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;CAC5B,CAAA;AAED,QAAA,MAAM,GAAG,EAAE,EAAE,CAAC,QAAQ,
|
|
1
|
+
{"version":3,"file":"tab.d.ts","sourceRoot":"","sources":["../../src/ebay-tabs/tab.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,cAAc,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAGjD,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,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;CAC5B,CAAA;AAED,QAAA,MAAM,GAAG,EAAE,EAAE,CAAC,QAAQ,CAmCjB,CAAA;AAEL,eAAe,GAAG,CAAA"}
|
package/ebay-tabs/tab.js
CHANGED
|
@@ -28,9 +28,9 @@ 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, selected = _a.selected, 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", "selected", "href", "className", "refCallback", "onClick", "onKeyDown"]);
|
|
31
|
+
var children = _a.children, index = _a.index, parentId = _a.parentId, selected = _a.selected, 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", "href", "className", "refCallback", "onClick", "onKeyDown"]);
|
|
32
32
|
return href ? (react_1.default.createElement("li", __assign({}, rest, { className: classnames_1.default(className, 'fake-tabs__item', { 'fake-tabs__item--current': selected }) }),
|
|
33
|
-
react_1.default.createElement("a", { href: href, "aria-current": selected ? "page" : null }, children))) : (react_1.default.createElement("div", __assign({}, rest, { ref: refCallback, "aria-controls": "
|
|
33
|
+
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: selected ? 0 : -1, onClick: onClick, onKeyDown: onKeyDown }),
|
|
34
34
|
react_1.default.createElement("span", null, children)));
|
|
35
35
|
};
|
|
36
36
|
exports.default = Tab;
|
package/ebay-tabs/tabs.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../src/ebay-tabs/tabs.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAItE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAI1C,aAAK,SAAS,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8DAA8D;IAE9D,IAAI,CAAC,EAAE,OAAO,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,aAAK,KAAK,GAAG;IACT,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;CACxB,CAAA;AAGD,cAAM,IAAK,SAAQ,SAAS,CAAC,SAAS,EAAE,KAAK,CAAC;IAC1C,QAAQ,EAAE,WAAW,EAAE,CAAC;gBAEZ,KAAK,EAAE,SAAS;IAc5B,kBAAkB,CAAC,SAAS,EAAE,SAAS,GAAG,IAAI;IAO9C,WAAW,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI;IAU5B;;;OAGG;IACH,YAAY,CAAC,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAyBpD,MAAM,IAAI,YAAY;
|
|
1
|
+
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../src/ebay-tabs/tabs.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAItE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAI1C,aAAK,SAAS,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8DAA8D;IAE9D,IAAI,CAAC,EAAE,OAAO,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,aAAK,KAAK,GAAG;IACT,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;CACxB,CAAA;AAGD,cAAM,IAAK,SAAQ,SAAS,CAAC,SAAS,EAAE,KAAK,CAAC;IAC1C,QAAQ,EAAE,WAAW,EAAE,CAAC;gBAEZ,KAAK,EAAE,SAAS;IAc5B,kBAAkB,CAAC,SAAS,EAAE,SAAS,GAAG,IAAI;IAO9C,WAAW,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI;IAU5B;;;OAGG;IACH,YAAY,CAAC,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAyBpD,MAAM,IAAI,YAAY;CA2DzB;AAED,eAAe,IAAI,CAAA"}
|
package/ebay-tabs/tabs.js
CHANGED
|
@@ -97,7 +97,7 @@ var Tabs = /** @class */ (function (_super) {
|
|
|
97
97
|
};
|
|
98
98
|
Tabs.prototype.render = function () {
|
|
99
99
|
var _this = this;
|
|
100
|
-
var _a = this.props, className = _a.className, _b = _a.size, size = _b === void 0 ? 'medium' : _b, children = _a.children;
|
|
100
|
+
var _a = this.props, id = _a.id, className = _a.className, _b = _a.size, size = _b === void 0 ? 'medium' : _b, children = _a.children;
|
|
101
101
|
var fake = component_utils_1.filterBy(children, function (_a) {
|
|
102
102
|
var type = _a.type, props = _a.props;
|
|
103
103
|
return type === tab_1.default && props.href;
|
|
@@ -108,6 +108,7 @@ var Tabs = /** @class */ (function (_super) {
|
|
|
108
108
|
var itemProps = {
|
|
109
109
|
refCallback: function (ref) { _this.headings[i] = ref; },
|
|
110
110
|
index: i,
|
|
111
|
+
parentId: id,
|
|
111
112
|
selected: _this.state.selectedIndex === i,
|
|
112
113
|
href: href,
|
|
113
114
|
children: content,
|
|
@@ -120,15 +121,16 @@ var Tabs = /** @class */ (function (_super) {
|
|
|
120
121
|
var content = item.props.children;
|
|
121
122
|
var itemProps = {
|
|
122
123
|
index: i,
|
|
124
|
+
parentId: id,
|
|
123
125
|
selected: _this.state.selectedIndex === i,
|
|
124
126
|
fake: fake,
|
|
125
127
|
children: content
|
|
126
128
|
};
|
|
127
129
|
return react_1.default.cloneElement(item, itemProps);
|
|
128
130
|
});
|
|
129
|
-
return fake ? (react_1.default.createElement("div", { className: classnames_1.default(className, 'fake-tabs') },
|
|
131
|
+
return fake ? (react_1.default.createElement("div", { id: id, className: classnames_1.default(className, 'fake-tabs') },
|
|
130
132
|
react_1.default.createElement("ul", { className: classnames_1.default('fake-tabs__items', { 'fake-tabs__items--large': large }) }, tabHeadings),
|
|
131
|
-
react_1.default.createElement("div", { className: "fake-tabs__content" }, tabPanels))) : (react_1.default.createElement("div", { className: classnames_1.default(className, 'tabs') },
|
|
133
|
+
react_1.default.createElement("div", { className: "fake-tabs__content" }, tabPanels))) : (react_1.default.createElement("div", { id: id, className: classnames_1.default(className, 'tabs') },
|
|
132
134
|
react_1.default.createElement("div", { className: classnames_1.default('tabs__items', { 'tabs__items--large': large }), role: "tablist" }, tabHeadings),
|
|
133
135
|
react_1.default.createElement("div", { className: "tabs__content" }, tabPanels)));
|
|
134
136
|
};
|