@lumx/react 3.4.0 → 3.5.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/index.d.ts +2 -0
- package/index.js +8 -7
- package/index.js.map +1 -1
- package/package.json +3 -3
- package/src/components/tabs/Tab.test.tsx +5 -0
- package/src/components/tabs/Tab.tsx +4 -1
- package/src/components/thumbnail/Thumbnail.stories.tsx +12 -0
- package/src/components/thumbnail/useFocusPointStyle.tsx +2 -2
- package/src/components/thumbnail/useImageLoad.ts +2 -2
- package/src/stories/controls/image.ts +7 -1
package/index.d.ts
CHANGED
|
@@ -2614,6 +2614,8 @@ interface TabProps extends GenericProps {
|
|
|
2614
2614
|
children?: never;
|
|
2615
2615
|
/** Icon (SVG path). */
|
|
2616
2616
|
icon?: IconProps['icon'];
|
|
2617
|
+
/** Icon component properties. */
|
|
2618
|
+
iconProps?: Omit<IconProps, 'icon'>;
|
|
2617
2619
|
/** Native id property. */
|
|
2618
2620
|
id?: string;
|
|
2619
2621
|
/** Whether the tab is active or not. */
|
package/index.js
CHANGED
|
@@ -11789,7 +11789,7 @@ TabList.displayName = COMPONENT_NAME$1d;
|
|
|
11789
11789
|
TabList.className = CLASSNAME$1a;
|
|
11790
11790
|
TabList.defaultProps = DEFAULT_PROPS$X;
|
|
11791
11791
|
|
|
11792
|
-
const _excluded$1j = ["className", "disabled", "icon", "id", "isActive", "isDisabled", "label", "onFocus", "onKeyPress", "tabIndex"];
|
|
11792
|
+
const _excluded$1j = ["className", "disabled", "icon", "iconProps", "id", "isActive", "isDisabled", "label", "onFocus", "onKeyPress", "tabIndex"];
|
|
11793
11793
|
|
|
11794
11794
|
/**
|
|
11795
11795
|
* Defines the props of the component.
|
|
@@ -11824,6 +11824,7 @@ const Tab = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
11824
11824
|
className,
|
|
11825
11825
|
disabled,
|
|
11826
11826
|
icon,
|
|
11827
|
+
iconProps = {},
|
|
11827
11828
|
id,
|
|
11828
11829
|
isActive: propIsActive,
|
|
11829
11830
|
isDisabled = disabled,
|
|
@@ -11872,10 +11873,10 @@ const Tab = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
11872
11873
|
"aria-disabled": isDisabled,
|
|
11873
11874
|
"aria-selected": isActive,
|
|
11874
11875
|
"aria-controls": state === null || state === void 0 ? void 0 : state.tabPanelId
|
|
11875
|
-
}), icon && /*#__PURE__*/React.createElement(Icon, {
|
|
11876
|
+
}), icon && /*#__PURE__*/React.createElement(Icon, _extends({
|
|
11876
11877
|
icon: icon,
|
|
11877
11878
|
size: Size.xs
|
|
11878
|
-
}), label && /*#__PURE__*/React.createElement("span", null, label));
|
|
11879
|
+
}, iconProps)), label && /*#__PURE__*/React.createElement("span", null, label));
|
|
11879
11880
|
});
|
|
11880
11881
|
Tab.displayName = COMPONENT_NAME$1e;
|
|
11881
11882
|
Tab.className = CLASSNAME$1b;
|
|
@@ -12264,8 +12265,8 @@ TextField.className = CLASSNAME$1d;
|
|
|
12264
12265
|
TextField.defaultProps = DEFAULT_PROPS$_;
|
|
12265
12266
|
|
|
12266
12267
|
function getState(img, event) {
|
|
12267
|
-
// Error event occurred
|
|
12268
|
-
if ((event === null || event === void 0 ? void 0 : event.type) === 'error'
|
|
12268
|
+
// Error event occurred.
|
|
12269
|
+
if ((event === null || event === void 0 ? void 0 : event.type) === 'error') {
|
|
12269
12270
|
return 'hasError';
|
|
12270
12271
|
}
|
|
12271
12272
|
// Image is undefined or incomplete.
|
|
@@ -12370,8 +12371,8 @@ const useFocusPointStyle = (_ref2, element, isLoaded) => {
|
|
|
12370
12371
|
});
|
|
12371
12372
|
return;
|
|
12372
12373
|
}
|
|
12373
|
-
if (!containerSize) {
|
|
12374
|
-
// Missing container size abort focus point compute.
|
|
12374
|
+
if (!containerSize || !imageSize.height || !imageSize.width) {
|
|
12375
|
+
// Missing container or image size abort focus point compute.
|
|
12375
12376
|
setStyle({});
|
|
12376
12377
|
return;
|
|
12377
12378
|
}
|