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.
Files changed (71) hide show
  1. package/esm/__internal__/focus-trap/focus-trap-utils.d.ts +4 -3
  2. package/esm/__internal__/focus-trap/focus-trap-utils.js +3 -12
  3. package/esm/__internal__/focus-trap/focus-trap.component.d.ts +19 -0
  4. package/esm/__internal__/focus-trap/focus-trap.component.js +61 -45
  5. package/esm/__internal__/focus-trap/index.d.ts +2 -0
  6. package/esm/__internal__/utils/helpers/tags/tags-specs/tags-specs.d.ts +1 -1
  7. package/esm/components/definition-list/__internal__/dl.context.d.ts +6 -0
  8. package/esm/components/definition-list/dd.component.d.ts +8 -0
  9. package/esm/components/definition-list/dd.component.js +310 -5
  10. package/esm/components/definition-list/definition-list.style.d.ts +22 -0
  11. package/esm/components/definition-list/definition-list.style.js +3 -4
  12. package/esm/components/definition-list/dl.component.d.ts +9 -0
  13. package/esm/components/definition-list/dl.component.js +323 -27
  14. package/esm/components/definition-list/dt.component.d.ts +8 -0
  15. package/esm/components/definition-list/dt.component.js +310 -5
  16. package/esm/components/definition-list/index.d.ts +6 -3
  17. package/esm/components/definition-list/index.js +2 -2
  18. package/esm/components/dialog/dialog.component.js +3 -3
  19. package/esm/components/dialog-full-screen/dialog-full-screen.component.js +2 -2
  20. package/esm/components/dialog-full-screen/dialog-full-screen.style.js +4 -0
  21. package/esm/components/flat-table/flat-table-row/flat-table-row.style.js +30 -2
  22. package/esm/components/modal/modal.component.d.ts +1 -20
  23. package/esm/components/modal/modal.component.js +8 -21
  24. package/esm/components/profile/index.d.ts +2 -1
  25. package/esm/components/profile/profile.component.d.ts +18 -0
  26. package/esm/components/profile/profile.component.js +8 -21
  27. package/esm/components/profile/profile.config.d.ts +55 -0
  28. package/esm/components/profile/profile.style.d.ts +16 -0
  29. package/esm/components/profile/profile.style.js +5 -14
  30. package/esm/components/sidebar/sidebar.component.js +1 -1
  31. package/esm/components/sidebar/sidebar.style.js +5 -0
  32. package/lib/__internal__/focus-trap/focus-trap-utils.d.ts +4 -3
  33. package/lib/__internal__/focus-trap/focus-trap-utils.js +5 -13
  34. package/lib/__internal__/focus-trap/focus-trap.component.d.ts +19 -0
  35. package/lib/__internal__/focus-trap/focus-trap.component.js +59 -43
  36. package/lib/__internal__/focus-trap/index.d.ts +2 -0
  37. package/lib/__internal__/utils/helpers/tags/tags-specs/tags-specs.d.ts +1 -1
  38. package/lib/components/definition-list/__internal__/dl.context.d.ts +6 -0
  39. package/lib/components/definition-list/dd.component.d.ts +8 -0
  40. package/lib/components/definition-list/dd.component.js +311 -7
  41. package/lib/components/definition-list/definition-list.style.d.ts +22 -0
  42. package/lib/components/definition-list/definition-list.style.js +3 -4
  43. package/lib/components/definition-list/dl.component.d.ts +9 -0
  44. package/lib/components/definition-list/dl.component.js +326 -28
  45. package/lib/components/definition-list/dt.component.d.ts +8 -0
  46. package/lib/components/definition-list/dt.component.js +311 -7
  47. package/lib/components/definition-list/index.d.ts +6 -3
  48. package/lib/components/definition-list/index.js +8 -8
  49. package/lib/components/dialog/dialog.component.js +3 -3
  50. package/lib/components/dialog-full-screen/dialog-full-screen.component.js +2 -2
  51. package/lib/components/dialog-full-screen/dialog-full-screen.style.js +4 -0
  52. package/lib/components/flat-table/flat-table-row/flat-table-row.style.js +30 -2
  53. package/lib/components/modal/modal.component.d.ts +1 -20
  54. package/lib/components/modal/modal.component.js +8 -20
  55. package/lib/components/profile/index.d.ts +2 -1
  56. package/lib/components/profile/profile.component.d.ts +18 -0
  57. package/lib/components/profile/profile.component.js +9 -24
  58. package/lib/components/profile/profile.config.d.ts +55 -0
  59. package/lib/components/profile/profile.style.d.ts +16 -0
  60. package/lib/components/profile/profile.style.js +5 -14
  61. package/lib/components/sidebar/sidebar.component.js +1 -1
  62. package/lib/components/sidebar/sidebar.style.js +5 -0
  63. package/package.json +1 -1
  64. package/esm/components/definition-list/dd.d.ts +0 -11
  65. package/esm/components/definition-list/dl.d.ts +0 -19
  66. package/esm/components/definition-list/dt.d.ts +0 -10
  67. package/esm/components/profile/profile.d.ts +0 -18
  68. package/lib/components/definition-list/dd.d.ts +0 -11
  69. package/lib/components/definition-list/dl.d.ts +0 -19
  70. package/lib/components/definition-list/dt.d.ts +0 -10
  71. 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,6 +1,6 @@
1
1
  {
2
2
  "name": "carbon-react",
3
- "version": "110.0.1",
3
+ "version": "110.0.4",
4
4
  "description": "A library of reusable React components for easily building user interfaces.",
5
5
  "engineStrict": true,
6
6
  "engines": {
@@ -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,10 +0,0 @@
1
- import { SpaceProps } from "styled-system";
2
-
3
- export interface DtProps extends SpaceProps {
4
- /** prop for dt text */
5
- children: string;
6
- }
7
-
8
- declare function DtComponent(props: DtProps): JSX.Element;
9
-
10
- export default DtComponent;
@@ -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,10 +0,0 @@
1
- import { SpaceProps } from "styled-system";
2
-
3
- export interface DtProps extends SpaceProps {
4
- /** prop for dt text */
5
- children: string;
6
- }
7
-
8
- declare function DtComponent(props: DtProps): JSX.Element;
9
-
10
- export default DtComponent;
@@ -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;