carbon-react 110.0.1 → 110.0.4
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/__internal__/focus-trap/focus-trap-utils.d.ts +4 -3
- package/esm/__internal__/focus-trap/focus-trap-utils.js +3 -12
- package/esm/__internal__/focus-trap/focus-trap.component.d.ts +19 -0
- package/esm/__internal__/focus-trap/focus-trap.component.js +61 -45
- package/esm/__internal__/focus-trap/index.d.ts +2 -0
- package/esm/__internal__/utils/helpers/tags/tags-specs/tags-specs.d.ts +1 -1
- package/esm/components/definition-list/__internal__/dl.context.d.ts +6 -0
- package/esm/components/definition-list/dd.component.d.ts +8 -0
- package/esm/components/definition-list/dd.component.js +310 -5
- package/esm/components/definition-list/definition-list.style.d.ts +22 -0
- package/esm/components/definition-list/definition-list.style.js +3 -4
- package/esm/components/definition-list/dl.component.d.ts +9 -0
- package/esm/components/definition-list/dl.component.js +323 -27
- package/esm/components/definition-list/dt.component.d.ts +8 -0
- package/esm/components/definition-list/dt.component.js +310 -5
- package/esm/components/definition-list/index.d.ts +6 -3
- package/esm/components/definition-list/index.js +2 -2
- package/esm/components/dialog/dialog.component.js +3 -3
- package/esm/components/dialog-full-screen/dialog-full-screen.component.js +2 -2
- package/esm/components/dialog-full-screen/dialog-full-screen.style.js +4 -0
- package/esm/components/flat-table/flat-table-row/flat-table-row.style.js +30 -2
- package/esm/components/modal/modal.component.d.ts +1 -20
- package/esm/components/modal/modal.component.js +8 -21
- package/esm/components/profile/index.d.ts +2 -1
- package/esm/components/profile/profile.component.d.ts +18 -0
- package/esm/components/profile/profile.component.js +8 -21
- package/esm/components/profile/profile.config.d.ts +55 -0
- package/esm/components/profile/profile.style.d.ts +16 -0
- package/esm/components/profile/profile.style.js +5 -14
- package/esm/components/sidebar/sidebar.component.js +1 -1
- package/esm/components/sidebar/sidebar.style.js +5 -0
- package/lib/__internal__/focus-trap/focus-trap-utils.d.ts +4 -3
- package/lib/__internal__/focus-trap/focus-trap-utils.js +5 -13
- package/lib/__internal__/focus-trap/focus-trap.component.d.ts +19 -0
- package/lib/__internal__/focus-trap/focus-trap.component.js +59 -43
- package/lib/__internal__/focus-trap/index.d.ts +2 -0
- package/lib/__internal__/utils/helpers/tags/tags-specs/tags-specs.d.ts +1 -1
- package/lib/components/definition-list/__internal__/dl.context.d.ts +6 -0
- package/lib/components/definition-list/dd.component.d.ts +8 -0
- package/lib/components/definition-list/dd.component.js +311 -7
- package/lib/components/definition-list/definition-list.style.d.ts +22 -0
- package/lib/components/definition-list/definition-list.style.js +3 -4
- package/lib/components/definition-list/dl.component.d.ts +9 -0
- package/lib/components/definition-list/dl.component.js +326 -28
- package/lib/components/definition-list/dt.component.d.ts +8 -0
- package/lib/components/definition-list/dt.component.js +311 -7
- package/lib/components/definition-list/index.d.ts +6 -3
- package/lib/components/definition-list/index.js +8 -8
- package/lib/components/dialog/dialog.component.js +3 -3
- package/lib/components/dialog-full-screen/dialog-full-screen.component.js +2 -2
- package/lib/components/dialog-full-screen/dialog-full-screen.style.js +4 -0
- package/lib/components/flat-table/flat-table-row/flat-table-row.style.js +30 -2
- package/lib/components/modal/modal.component.d.ts +1 -20
- package/lib/components/modal/modal.component.js +8 -20
- package/lib/components/profile/index.d.ts +2 -1
- package/lib/components/profile/profile.component.d.ts +18 -0
- package/lib/components/profile/profile.component.js +9 -24
- package/lib/components/profile/profile.config.d.ts +55 -0
- package/lib/components/profile/profile.style.d.ts +16 -0
- package/lib/components/profile/profile.style.js +5 -14
- package/lib/components/sidebar/sidebar.component.js +1 -1
- package/lib/components/sidebar/sidebar.style.js +5 -0
- package/package.json +1 -1
- package/esm/components/definition-list/dd.d.ts +0 -11
- package/esm/components/definition-list/dl.d.ts +0 -19
- package/esm/components/definition-list/dt.d.ts +0 -10
- package/esm/components/profile/profile.d.ts +0 -18
- package/lib/components/definition-list/dd.d.ts +0 -11
- package/lib/components/definition-list/dl.d.ts +0 -19
- package/lib/components/definition-list/dt.d.ts +0 -10
- package/lib/components/profile/profile.d.ts +0 -18
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export declare const PROFILE_SIZES: readonly ["XS", "S", "M", "ML", "L", "XL", "XXL"];
|
|
2
|
+
declare type AllProfileSizes = typeof PROFILE_SIZES;
|
|
3
|
+
export declare type ProfileSize = AllProfileSizes[number];
|
|
4
|
+
declare const _default: {
|
|
5
|
+
XS: {
|
|
6
|
+
nameSize: string;
|
|
7
|
+
emailSize: string;
|
|
8
|
+
lineHeight: string;
|
|
9
|
+
marginLeft: string;
|
|
10
|
+
marginTop: string;
|
|
11
|
+
};
|
|
12
|
+
S: {
|
|
13
|
+
nameSize: string;
|
|
14
|
+
emailSize: string;
|
|
15
|
+
lineHeight: string;
|
|
16
|
+
marginLeft: string;
|
|
17
|
+
marginTop: string;
|
|
18
|
+
};
|
|
19
|
+
M: {
|
|
20
|
+
nameSize: string;
|
|
21
|
+
emailSize: string;
|
|
22
|
+
lineHeight: string;
|
|
23
|
+
marginLeft: string;
|
|
24
|
+
marginTop: string;
|
|
25
|
+
};
|
|
26
|
+
ML: {
|
|
27
|
+
nameSize: string;
|
|
28
|
+
emailSize: string;
|
|
29
|
+
lineHeight: string;
|
|
30
|
+
marginLeft: string;
|
|
31
|
+
marginTop: string;
|
|
32
|
+
};
|
|
33
|
+
L: {
|
|
34
|
+
nameSize: string;
|
|
35
|
+
emailSize: string;
|
|
36
|
+
lineHeight: string;
|
|
37
|
+
marginLeft: string;
|
|
38
|
+
marginTop: string;
|
|
39
|
+
};
|
|
40
|
+
XL: {
|
|
41
|
+
nameSize: string;
|
|
42
|
+
emailSize: string;
|
|
43
|
+
lineHeight: string;
|
|
44
|
+
marginLeft: string;
|
|
45
|
+
marginTop: string;
|
|
46
|
+
};
|
|
47
|
+
XXL: {
|
|
48
|
+
nameSize: string;
|
|
49
|
+
emailSize: string;
|
|
50
|
+
lineHeight: string;
|
|
51
|
+
marginLeft: string;
|
|
52
|
+
marginTop: string;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
export default _default;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import Portrait from "../portrait";
|
|
2
|
+
import { ProfileSize } from "./profile.config";
|
|
3
|
+
interface ProfileSizeProps {
|
|
4
|
+
size?: ProfileSize;
|
|
5
|
+
}
|
|
6
|
+
interface ProfileHasSrcProps {
|
|
7
|
+
hasSrc: boolean;
|
|
8
|
+
}
|
|
9
|
+
interface ProfileDetailsStyleProps extends ProfileSizeProps, ProfileHasSrcProps {
|
|
10
|
+
}
|
|
11
|
+
declare const ProfileNameStyle: import("styled-components").StyledComponent<"span", any, ProfileSizeProps, never>;
|
|
12
|
+
declare const ProfileEmailStyle: import("styled-components").StyledComponent<"span", any, ProfileSizeProps, never>;
|
|
13
|
+
declare const ProfileStyle: import("styled-components").StyledComponent<"div", any, ProfileHasSrcProps, never>;
|
|
14
|
+
declare const ProfileDetailsStyle: import("styled-components").StyledComponent<"div", any, ProfileDetailsStyleProps, never>;
|
|
15
|
+
declare const ProfileAvatarStyle: import("styled-components").StyledComponent<typeof Portrait, any, {}, never>;
|
|
16
|
+
export { ProfileStyle, ProfileNameStyle, ProfileDetailsStyle, ProfileAvatarStyle, ProfileEmailStyle, };
|
|
@@ -21,13 +21,13 @@ const ProfileNameStyle = _styledComponents.default.span`
|
|
|
21
21
|
font-weight: bold;
|
|
22
22
|
display: block;
|
|
23
23
|
font-size: ${({
|
|
24
|
-
size
|
|
24
|
+
size = "M"
|
|
25
25
|
}) => _profile.default[size].nameSize};
|
|
26
26
|
`;
|
|
27
27
|
exports.ProfileNameStyle = ProfileNameStyle;
|
|
28
28
|
const ProfileEmailStyle = _styledComponents.default.span`
|
|
29
29
|
font-size: ${({
|
|
30
|
-
size
|
|
30
|
+
size = "M"
|
|
31
31
|
}) => _profile.default[size].emailSize};
|
|
32
32
|
`;
|
|
33
33
|
exports.ProfileEmailStyle = ProfileEmailStyle;
|
|
@@ -46,13 +46,13 @@ const ProfileDetailsStyle = _styledComponents.default.div`
|
|
|
46
46
|
display: inline-block;
|
|
47
47
|
margin-top: ${({
|
|
48
48
|
hasSrc,
|
|
49
|
-
size
|
|
49
|
+
size = "M"
|
|
50
50
|
}) => hasSrc ? _profile.default[size].marginTop : ""};
|
|
51
51
|
line-height: ${({
|
|
52
|
-
size
|
|
52
|
+
size = "M"
|
|
53
53
|
}) => _profile.default[size].lineHeight};
|
|
54
54
|
margin-left: ${({
|
|
55
|
-
size
|
|
55
|
+
size = "M"
|
|
56
56
|
}) => _profile.default[size].marginLeft};
|
|
57
57
|
`;
|
|
58
58
|
exports.ProfileDetailsStyle = ProfileDetailsStyle;
|
|
@@ -62,13 +62,4 @@ const ProfileAvatarStyle = (0, _styledComponents.default)(_portrait.default)`
|
|
|
62
62
|
exports.ProfileAvatarStyle = ProfileAvatarStyle;
|
|
63
63
|
ProfileStyle.defaultProps = {
|
|
64
64
|
theme: _base.default
|
|
65
|
-
};
|
|
66
|
-
ProfileNameStyle.defaultProps = {
|
|
67
|
-
size: "M"
|
|
68
|
-
};
|
|
69
|
-
ProfileEmailStyle.defaultProps = {
|
|
70
|
-
size: "M"
|
|
71
|
-
};
|
|
72
|
-
ProfileDetailsStyle.defaultProps = {
|
|
73
|
-
size: "M"
|
|
74
65
|
};
|
|
@@ -61,7 +61,7 @@ const Sidebar = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
61
61
|
const {
|
|
62
62
|
current: titleId
|
|
63
63
|
} = (0, _react.useRef)((0, _guid.default)());
|
|
64
|
-
let sidebarRef = (0, _react.useRef)();
|
|
64
|
+
let sidebarRef = (0, _react.useRef)(null);
|
|
65
65
|
if (ref) sidebarRef = ref;
|
|
66
66
|
|
|
67
67
|
const closeIcon = () => {
|
|
@@ -20,6 +20,11 @@ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return
|
|
|
20
20
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
21
|
|
|
22
22
|
const SidebarStyle = _styledComponents.default.div`
|
|
23
|
+
// prevents outline being added in safari
|
|
24
|
+
:focus {
|
|
25
|
+
outline: none;
|
|
26
|
+
}
|
|
27
|
+
|
|
23
28
|
${({
|
|
24
29
|
onCancel,
|
|
25
30
|
position,
|
package/package.json
CHANGED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { SpaceProps } from "styled-system";
|
|
3
|
-
|
|
4
|
-
export interface DdProps extends SpaceProps {
|
|
5
|
-
/** Prop for what will render in the `<Dd></Dd>` tags */
|
|
6
|
-
children: React.ReactNode;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
declare function DdComponent(props: DdProps): JSX.Element;
|
|
10
|
-
|
|
11
|
-
export default DdComponent;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { SpaceProps } from "styled-system";
|
|
3
|
-
|
|
4
|
-
export interface DlProps extends SpaceProps {
|
|
5
|
-
/** This string will specify the text align styling of the `<dt></dt>`. */
|
|
6
|
-
dtTextAlign?: "left" | "center" | "right";
|
|
7
|
-
/** This string will specify the text align styling of the `<dd></dd>`. */
|
|
8
|
-
ddTextAlign?: "left" | "center" | "right";
|
|
9
|
-
/** This value will specify the width of the `StyledDtDiv` as a percentage. */
|
|
10
|
-
w?: number;
|
|
11
|
-
/** prop to render children. */
|
|
12
|
-
children: React.ReactNode;
|
|
13
|
-
/** Render the DefinitionList as a single column */
|
|
14
|
-
asSingleColumn?: boolean;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
declare function DlComponent(props: DlProps): JSX.Element;
|
|
18
|
-
|
|
19
|
-
export default DlComponent;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export interface ProfileProps {
|
|
2
|
-
/** [Legacy] A custom class name for the component */
|
|
3
|
-
className?: string;
|
|
4
|
-
/** Custom source URL */
|
|
5
|
-
src?: string;
|
|
6
|
-
/** Define the name to display. */
|
|
7
|
-
name: string;
|
|
8
|
-
/** Define the email to use (will check Gravatar for image). */
|
|
9
|
-
email: string;
|
|
10
|
-
/** Define initials to display if there is no Gravatar image. */
|
|
11
|
-
initials?: string;
|
|
12
|
-
/** Allow to setup size for the component */
|
|
13
|
-
size?: "XS" | "S" | "M" | "ML" | "L" | "XL" | "XXL";
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
declare function Profile(props: ProfileProps): JSX.Element;
|
|
17
|
-
|
|
18
|
-
export default Profile;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { SpaceProps } from "styled-system";
|
|
3
|
-
|
|
4
|
-
export interface DdProps extends SpaceProps {
|
|
5
|
-
/** Prop for what will render in the `<Dd></Dd>` tags */
|
|
6
|
-
children: React.ReactNode;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
declare function DdComponent(props: DdProps): JSX.Element;
|
|
10
|
-
|
|
11
|
-
export default DdComponent;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { SpaceProps } from "styled-system";
|
|
3
|
-
|
|
4
|
-
export interface DlProps extends SpaceProps {
|
|
5
|
-
/** This string will specify the text align styling of the `<dt></dt>`. */
|
|
6
|
-
dtTextAlign?: "left" | "center" | "right";
|
|
7
|
-
/** This string will specify the text align styling of the `<dd></dd>`. */
|
|
8
|
-
ddTextAlign?: "left" | "center" | "right";
|
|
9
|
-
/** This value will specify the width of the `StyledDtDiv` as a percentage. */
|
|
10
|
-
w?: number;
|
|
11
|
-
/** prop to render children. */
|
|
12
|
-
children: React.ReactNode;
|
|
13
|
-
/** Render the DefinitionList as a single column */
|
|
14
|
-
asSingleColumn?: boolean;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
declare function DlComponent(props: DlProps): JSX.Element;
|
|
18
|
-
|
|
19
|
-
export default DlComponent;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export interface ProfileProps {
|
|
2
|
-
/** [Legacy] A custom class name for the component */
|
|
3
|
-
className?: string;
|
|
4
|
-
/** Custom source URL */
|
|
5
|
-
src?: string;
|
|
6
|
-
/** Define the name to display. */
|
|
7
|
-
name: string;
|
|
8
|
-
/** Define the email to use (will check Gravatar for image). */
|
|
9
|
-
email: string;
|
|
10
|
-
/** Define initials to display if there is no Gravatar image. */
|
|
11
|
-
initials?: string;
|
|
12
|
-
/** Allow to setup size for the component */
|
|
13
|
-
size?: "XS" | "S" | "M" | "ML" | "L" | "XL" | "XXL";
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
declare function Profile(props: ProfileProps): JSX.Element;
|
|
17
|
-
|
|
18
|
-
export default Profile;
|