carbon-react 111.5.3 → 111.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.
- package/esm/components/image/image.component.js +1 -0
- package/esm/components/image/image.style.d.ts +6 -3
- package/esm/components/image/image.style.js +4 -2
- package/esm/global.d.ts +1 -0
- package/lib/components/image/image.component.js +1 -0
- package/lib/components/image/image.style.d.ts +6 -3
- package/lib/components/image/image.style.js +4 -2
- package/lib/global.d.ts +1 -0
- package/package.json +1 -1
|
@@ -729,6 +729,7 @@ Image.propTypes = {
|
|
|
729
729
|
"trimStart": PropTypes.func.isRequired,
|
|
730
730
|
"valueOf": PropTypes.func.isRequired
|
|
731
731
|
}), PropTypes.string]),
|
|
732
|
+
"hidden": PropTypes.bool,
|
|
732
733
|
"m": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
733
734
|
"__@toStringTag": PropTypes.string.isRequired,
|
|
734
735
|
"description": PropTypes.string,
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { MarginProps, BackgroundProps, LayoutProps } from "styled-system";
|
|
3
3
|
export interface StyledImageProps extends MarginProps, BackgroundProps, LayoutProps {
|
|
4
|
-
/** alt property to display when an img fails to load */
|
|
4
|
+
/** HTML alt property to display when an img fails to load */
|
|
5
5
|
alt?: string;
|
|
6
|
-
/**
|
|
6
|
+
/** Any valid file path, passing this will render the component as an img element */
|
|
7
7
|
src?: string;
|
|
8
|
+
/** HTML hidden property to indicate whether to remain hidden visually and from screen readers */
|
|
9
|
+
hidden?: boolean;
|
|
8
10
|
/** Children elements, will only render if component is a div element */
|
|
9
11
|
children?: React.ReactNode;
|
|
10
12
|
}
|
|
11
13
|
declare const StyledImage: import("styled-components").StyledComponent<"div", any, {
|
|
12
14
|
children: import("react").ReactNode;
|
|
13
15
|
src: string | undefined;
|
|
16
|
+
hidden: boolean;
|
|
14
17
|
as?: string | undefined;
|
|
15
|
-
} & StyledImageProps, "children" | "as" | "src">;
|
|
18
|
+
} & StyledImageProps, "hidden" | "children" | "as" | "src">;
|
|
16
19
|
export { StyledImage };
|
|
@@ -3,12 +3,14 @@ import { margin, layout, background } from "styled-system";
|
|
|
3
3
|
import { baseTheme } from "../../style/themes";
|
|
4
4
|
const StyledImage = styled.div.attrs(({
|
|
5
5
|
src,
|
|
6
|
-
children
|
|
6
|
+
children,
|
|
7
|
+
hidden = false
|
|
7
8
|
}) => ({ ...(src && {
|
|
8
9
|
as: "img"
|
|
9
10
|
}),
|
|
10
11
|
children: src ? undefined : children,
|
|
11
|
-
src
|
|
12
|
+
src,
|
|
13
|
+
hidden
|
|
12
14
|
}))`
|
|
13
15
|
${margin}
|
|
14
16
|
${layout}
|
package/esm/global.d.ts
CHANGED
|
@@ -742,6 +742,7 @@ Image.propTypes = {
|
|
|
742
742
|
"trimStart": _propTypes.default.func.isRequired,
|
|
743
743
|
"valueOf": _propTypes.default.func.isRequired
|
|
744
744
|
}), _propTypes.default.string]),
|
|
745
|
+
"hidden": _propTypes.default.bool,
|
|
745
746
|
"m": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
746
747
|
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
747
748
|
"description": _propTypes.default.string,
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { MarginProps, BackgroundProps, LayoutProps } from "styled-system";
|
|
3
3
|
export interface StyledImageProps extends MarginProps, BackgroundProps, LayoutProps {
|
|
4
|
-
/** alt property to display when an img fails to load */
|
|
4
|
+
/** HTML alt property to display when an img fails to load */
|
|
5
5
|
alt?: string;
|
|
6
|
-
/**
|
|
6
|
+
/** Any valid file path, passing this will render the component as an img element */
|
|
7
7
|
src?: string;
|
|
8
|
+
/** HTML hidden property to indicate whether to remain hidden visually and from screen readers */
|
|
9
|
+
hidden?: boolean;
|
|
8
10
|
/** Children elements, will only render if component is a div element */
|
|
9
11
|
children?: React.ReactNode;
|
|
10
12
|
}
|
|
11
13
|
declare const StyledImage: import("styled-components").StyledComponent<"div", any, {
|
|
12
14
|
children: import("react").ReactNode;
|
|
13
15
|
src: string | undefined;
|
|
16
|
+
hidden: boolean;
|
|
14
17
|
as?: string | undefined;
|
|
15
|
-
} & StyledImageProps, "children" | "as" | "src">;
|
|
18
|
+
} & StyledImageProps, "hidden" | "children" | "as" | "src">;
|
|
16
19
|
export { StyledImage };
|
|
@@ -17,12 +17,14 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj;
|
|
|
17
17
|
|
|
18
18
|
const StyledImage = _styledComponents.default.div.attrs(({
|
|
19
19
|
src,
|
|
20
|
-
children
|
|
20
|
+
children,
|
|
21
|
+
hidden = false
|
|
21
22
|
}) => ({ ...(src && {
|
|
22
23
|
as: "img"
|
|
23
24
|
}),
|
|
24
25
|
children: src ? undefined : children,
|
|
25
|
-
src
|
|
26
|
+
src,
|
|
27
|
+
hidden
|
|
26
28
|
}))`
|
|
27
29
|
${_styledSystem.margin}
|
|
28
30
|
${_styledSystem.layout}
|
package/lib/global.d.ts
CHANGED