carbon-react 110.0.4 → 110.1.2
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/__spec_helper__/mock-match-media.d.ts +3 -1
- package/esm/components/button-toggle/button-toggle-icon.component.d.ts +15 -0
- package/esm/components/button-toggle/button-toggle-icon.component.js +19 -16
- package/esm/components/button-toggle/button-toggle-input.component.d.ts +25 -0
- package/esm/components/button-toggle/button-toggle-input.component.js +13 -25
- package/esm/components/button-toggle/button-toggle.component.d.ts +24 -0
- package/esm/components/button-toggle/button-toggle.component.js +23 -59
- package/esm/components/button-toggle/button-toggle.style.d.ts +26 -0
- package/esm/components/button-toggle/button-toggle.style.js +3 -8
- package/esm/components/button-toggle/index.d.ts +2 -2
- package/esm/components/content/content.style.js +0 -1
- package/esm/components/date/__internal__/utils.js +1 -1
- package/esm/components/definition-list/definition-list.style.js +0 -9
- package/esm/components/loader/index.d.ts +2 -1
- package/esm/components/loader/loader-square.style.d.ts +9 -1
- package/esm/components/loader/loader-square.style.js +4 -11
- package/esm/components/loader/loader.component.d.ts +9 -0
- package/esm/components/loader/loader.component.js +162 -24
- package/esm/components/loader/loader.config.d.ts +1 -1
- package/esm/components/loader/loader.style.d.ts +2 -0
- package/esm/components/loader-bar/index.d.ts +2 -1
- package/esm/components/loader-bar/loader-bar.component.d.ts +7 -0
- package/esm/components/loader-bar/loader-bar.component.js +156 -7
- package/esm/components/loader-bar/loader-bar.config.d.ts +1 -0
- package/esm/components/loader-bar/loader-bar.style.d.ts +10 -0
- package/esm/components/loader-bar/loader-bar.style.js +14 -25
- package/esm/components/pod/pod.component.js +1 -0
- package/esm/components/pod/pod.style.js +8 -4
- package/esm/components/portrait/index.d.ts +2 -1
- package/esm/components/portrait/portrait-gravatar.component.d.ts +16 -0
- package/esm/components/portrait/portrait-gravatar.component.js +9 -24
- package/esm/components/portrait/portrait-initials.component.d.ts +16 -0
- package/esm/components/portrait/portrait-initials.component.js +22 -33
- package/esm/components/portrait/portrait.component.d.ts +50 -0
- package/esm/components/portrait/portrait.component.js +178 -72
- package/esm/components/portrait/portrait.config.d.ts +32 -0
- package/esm/components/portrait/portrait.style.d.ts +28 -0
- package/esm/components/portrait/portrait.style.js +7 -55
- package/esm/components/profile/profile.style.d.ts +2 -2
- package/esm/components/show-edit-pod/show-edit-pod.style.js +1 -8
- package/esm/components/sidebar/sidebar.component.js +20 -18
- package/esm/components/sidebar/sidebar.d.ts +2 -1
- package/esm/components/sidebar/sidebar.style.js +3 -3
- package/esm/style/fonts.css +19 -12
- package/lib/__spec_helper__/mock-match-media.d.ts +3 -1
- package/lib/components/button-toggle/button-toggle-icon.component.d.ts +15 -0
- package/lib/components/button-toggle/button-toggle-icon.component.js +19 -16
- package/lib/components/button-toggle/button-toggle-input.component.d.ts +25 -0
- package/lib/components/button-toggle/button-toggle-input.component.js +13 -25
- package/lib/components/button-toggle/button-toggle.component.d.ts +24 -0
- package/lib/components/button-toggle/button-toggle.component.js +24 -60
- package/lib/components/button-toggle/button-toggle.style.d.ts +26 -0
- package/lib/components/button-toggle/button-toggle.style.js +6 -12
- package/lib/components/button-toggle/index.d.ts +2 -2
- package/lib/components/content/content.style.js +0 -1
- package/lib/components/date/__internal__/utils.js +1 -1
- package/lib/components/definition-list/definition-list.style.js +0 -10
- package/lib/components/loader/index.d.ts +2 -1
- package/lib/components/loader/loader-square.style.d.ts +9 -1
- package/lib/components/loader/loader-square.style.js +4 -15
- package/lib/components/loader/loader.component.d.ts +9 -0
- package/lib/components/loader/loader.component.js +163 -28
- package/lib/components/loader/loader.config.d.ts +1 -1
- package/lib/components/loader/loader.style.d.ts +2 -0
- package/lib/components/loader-bar/index.d.ts +2 -1
- package/lib/components/loader-bar/loader-bar.component.d.ts +7 -0
- package/lib/components/loader-bar/loader-bar.component.js +156 -10
- package/lib/components/loader-bar/loader-bar.config.d.ts +1 -0
- package/lib/components/loader-bar/loader-bar.style.d.ts +10 -0
- package/lib/components/loader-bar/loader-bar.style.js +13 -27
- package/lib/components/pod/pod.component.js +1 -0
- package/lib/components/pod/pod.style.js +8 -4
- package/lib/components/portrait/index.d.ts +2 -1
- package/lib/components/portrait/portrait-gravatar.component.d.ts +16 -0
- package/lib/components/portrait/portrait-gravatar.component.js +9 -24
- package/lib/components/portrait/portrait-initials.component.d.ts +16 -0
- package/lib/components/portrait/portrait-initials.component.js +22 -33
- package/lib/components/portrait/portrait.component.d.ts +50 -0
- package/lib/components/portrait/portrait.component.js +179 -75
- package/lib/components/portrait/portrait.config.d.ts +32 -0
- package/lib/components/portrait/portrait.style.d.ts +28 -0
- package/lib/components/portrait/portrait.style.js +9 -59
- package/lib/components/profile/profile.style.d.ts +2 -2
- package/lib/components/show-edit-pod/show-edit-pod.style.js +1 -12
- package/lib/components/sidebar/sidebar.component.js +21 -17
- package/lib/components/sidebar/sidebar.d.ts +2 -1
- package/lib/components/sidebar/sidebar.style.js +3 -3
- package/lib/style/fonts.css +19 -12
- package/package.json +4 -3
- package/esm/components/button-toggle/button-toggle-types.d.ts +0 -1
- package/esm/components/button-toggle/button-toggle.d.ts +0 -45
- package/esm/components/loader/loader.d.ts +0 -16
- package/esm/components/loader-bar/loader-bar.d.ts +0 -10
- package/esm/components/portrait/portrait-gravatar.d.ts +0 -18
- package/esm/components/portrait/portrait-initials.d.ts +0 -18
- package/esm/components/portrait/portrait.d.ts +0 -54
- package/lib/components/button-toggle/button-toggle-types.d.ts +0 -1
- package/lib/components/button-toggle/button-toggle.d.ts +0 -45
- package/lib/components/loader/loader.d.ts +0 -16
- package/lib/components/loader-bar/loader-bar.d.ts +0 -10
- package/lib/components/portrait/portrait-gravatar.d.ts +0 -18
- package/lib/components/portrait/portrait-initials.d.ts +0 -18
- package/lib/components/portrait/portrait.d.ts +0 -54
|
@@ -2,18 +2,15 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
2
2
|
|
|
3
3
|
import React from "react";
|
|
4
4
|
import PropTypes from "prop-types";
|
|
5
|
-
import styledSystemPropTypes from "@styled-system/prop-types";
|
|
6
5
|
import tagComponent from "../../__internal__/utils/helpers/tags/tags";
|
|
7
6
|
import StyledLoader from "./loader.style";
|
|
8
7
|
import StyledLoaderSquare from "./loader-square.style";
|
|
9
|
-
import { filterStyledSystemMarginProps } from "../../style/utils";
|
|
10
|
-
const marginPropTypes = filterStyledSystemMarginProps(styledSystemPropTypes.space);
|
|
11
8
|
|
|
12
9
|
const Loader = ({
|
|
13
|
-
"aria-label": ariaLabel,
|
|
10
|
+
"aria-label": ariaLabel = "loader",
|
|
14
11
|
isInsideButton,
|
|
15
|
-
isActive,
|
|
16
|
-
size,
|
|
12
|
+
isActive = true,
|
|
13
|
+
size = "medium",
|
|
17
14
|
...rest
|
|
18
15
|
}) => {
|
|
19
16
|
return /*#__PURE__*/React.createElement(StyledLoader, _extends({
|
|
@@ -34,24 +31,165 @@ const Loader = ({
|
|
|
34
31
|
}));
|
|
35
32
|
};
|
|
36
33
|
|
|
37
|
-
Loader.
|
|
38
|
-
size: "medium",
|
|
39
|
-
isInsideButton: false,
|
|
40
|
-
isActive: true,
|
|
41
|
-
"aria-label": "loader"
|
|
42
|
-
};
|
|
43
|
-
Loader.propTypes = { ...marginPropTypes,
|
|
44
|
-
|
|
45
|
-
/** Specify an aria-label for the Loader component */
|
|
34
|
+
Loader.propTypes = {
|
|
46
35
|
"aria-label": PropTypes.string,
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
36
|
+
"isActive": PropTypes.bool,
|
|
37
|
+
"isInsideButton": PropTypes.bool,
|
|
38
|
+
"m": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
39
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
40
|
+
"description": PropTypes.string,
|
|
41
|
+
"toString": PropTypes.func.isRequired,
|
|
42
|
+
"valueOf": PropTypes.func.isRequired
|
|
43
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
44
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
45
|
+
"description": PropTypes.string,
|
|
46
|
+
"toString": PropTypes.func.isRequired,
|
|
47
|
+
"valueOf": PropTypes.func.isRequired
|
|
48
|
+
}), PropTypes.string]),
|
|
49
|
+
"margin": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
50
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
51
|
+
"description": PropTypes.string,
|
|
52
|
+
"toString": PropTypes.func.isRequired,
|
|
53
|
+
"valueOf": PropTypes.func.isRequired
|
|
54
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
55
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
56
|
+
"description": PropTypes.string,
|
|
57
|
+
"toString": PropTypes.func.isRequired,
|
|
58
|
+
"valueOf": PropTypes.func.isRequired
|
|
59
|
+
}), PropTypes.string]),
|
|
60
|
+
"marginBottom": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
61
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
62
|
+
"description": PropTypes.string,
|
|
63
|
+
"toString": PropTypes.func.isRequired,
|
|
64
|
+
"valueOf": PropTypes.func.isRequired
|
|
65
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
66
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
67
|
+
"description": PropTypes.string,
|
|
68
|
+
"toString": PropTypes.func.isRequired,
|
|
69
|
+
"valueOf": PropTypes.func.isRequired
|
|
70
|
+
}), PropTypes.string]),
|
|
71
|
+
"marginLeft": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
72
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
73
|
+
"description": PropTypes.string,
|
|
74
|
+
"toString": PropTypes.func.isRequired,
|
|
75
|
+
"valueOf": PropTypes.func.isRequired
|
|
76
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
77
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
78
|
+
"description": PropTypes.string,
|
|
79
|
+
"toString": PropTypes.func.isRequired,
|
|
80
|
+
"valueOf": PropTypes.func.isRequired
|
|
81
|
+
}), PropTypes.string]),
|
|
82
|
+
"marginRight": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
83
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
84
|
+
"description": PropTypes.string,
|
|
85
|
+
"toString": PropTypes.func.isRequired,
|
|
86
|
+
"valueOf": PropTypes.func.isRequired
|
|
87
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
88
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
89
|
+
"description": PropTypes.string,
|
|
90
|
+
"toString": PropTypes.func.isRequired,
|
|
91
|
+
"valueOf": PropTypes.func.isRequired
|
|
92
|
+
}), PropTypes.string]),
|
|
93
|
+
"marginTop": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
94
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
95
|
+
"description": PropTypes.string,
|
|
96
|
+
"toString": PropTypes.func.isRequired,
|
|
97
|
+
"valueOf": PropTypes.func.isRequired
|
|
98
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
99
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
100
|
+
"description": PropTypes.string,
|
|
101
|
+
"toString": PropTypes.func.isRequired,
|
|
102
|
+
"valueOf": PropTypes.func.isRequired
|
|
103
|
+
}), PropTypes.string]),
|
|
104
|
+
"marginX": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
105
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
106
|
+
"description": PropTypes.string,
|
|
107
|
+
"toString": PropTypes.func.isRequired,
|
|
108
|
+
"valueOf": PropTypes.func.isRequired
|
|
109
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
110
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
111
|
+
"description": PropTypes.string,
|
|
112
|
+
"toString": PropTypes.func.isRequired,
|
|
113
|
+
"valueOf": PropTypes.func.isRequired
|
|
114
|
+
}), PropTypes.string]),
|
|
115
|
+
"marginY": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
116
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
117
|
+
"description": PropTypes.string,
|
|
118
|
+
"toString": PropTypes.func.isRequired,
|
|
119
|
+
"valueOf": PropTypes.func.isRequired
|
|
120
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
121
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
122
|
+
"description": PropTypes.string,
|
|
123
|
+
"toString": PropTypes.func.isRequired,
|
|
124
|
+
"valueOf": PropTypes.func.isRequired
|
|
125
|
+
}), PropTypes.string]),
|
|
126
|
+
"mb": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
127
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
128
|
+
"description": PropTypes.string,
|
|
129
|
+
"toString": PropTypes.func.isRequired,
|
|
130
|
+
"valueOf": PropTypes.func.isRequired
|
|
131
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
132
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
133
|
+
"description": PropTypes.string,
|
|
134
|
+
"toString": PropTypes.func.isRequired,
|
|
135
|
+
"valueOf": PropTypes.func.isRequired
|
|
136
|
+
}), PropTypes.string]),
|
|
137
|
+
"ml": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
138
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
139
|
+
"description": PropTypes.string,
|
|
140
|
+
"toString": PropTypes.func.isRequired,
|
|
141
|
+
"valueOf": PropTypes.func.isRequired
|
|
142
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
143
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
144
|
+
"description": PropTypes.string,
|
|
145
|
+
"toString": PropTypes.func.isRequired,
|
|
146
|
+
"valueOf": PropTypes.func.isRequired
|
|
147
|
+
}), PropTypes.string]),
|
|
148
|
+
"mr": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
149
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
150
|
+
"description": PropTypes.string,
|
|
151
|
+
"toString": PropTypes.func.isRequired,
|
|
152
|
+
"valueOf": PropTypes.func.isRequired
|
|
153
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
154
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
155
|
+
"description": PropTypes.string,
|
|
156
|
+
"toString": PropTypes.func.isRequired,
|
|
157
|
+
"valueOf": PropTypes.func.isRequired
|
|
158
|
+
}), PropTypes.string]),
|
|
159
|
+
"mt": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
160
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
161
|
+
"description": PropTypes.string,
|
|
162
|
+
"toString": PropTypes.func.isRequired,
|
|
163
|
+
"valueOf": PropTypes.func.isRequired
|
|
164
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
165
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
166
|
+
"description": PropTypes.string,
|
|
167
|
+
"toString": PropTypes.func.isRequired,
|
|
168
|
+
"valueOf": PropTypes.func.isRequired
|
|
169
|
+
}), PropTypes.string]),
|
|
170
|
+
"mx": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
171
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
172
|
+
"description": PropTypes.string,
|
|
173
|
+
"toString": PropTypes.func.isRequired,
|
|
174
|
+
"valueOf": PropTypes.func.isRequired
|
|
175
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
176
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
177
|
+
"description": PropTypes.string,
|
|
178
|
+
"toString": PropTypes.func.isRequired,
|
|
179
|
+
"valueOf": PropTypes.func.isRequired
|
|
180
|
+
}), PropTypes.string]),
|
|
181
|
+
"my": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
182
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
183
|
+
"description": PropTypes.string,
|
|
184
|
+
"toString": PropTypes.func.isRequired,
|
|
185
|
+
"valueOf": PropTypes.func.isRequired
|
|
186
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
187
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
188
|
+
"description": PropTypes.string,
|
|
189
|
+
"toString": PropTypes.func.isRequired,
|
|
190
|
+
"valueOf": PropTypes.func.isRequired
|
|
191
|
+
}), PropTypes.string]),
|
|
192
|
+
"size": PropTypes.oneOf(["large", "medium", "small"])
|
|
56
193
|
};
|
|
194
|
+
export { Loader };
|
|
57
195
|
export default Loader;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const LOADER_SIZES: string[];
|
|
1
|
+
export declare const LOADER_SIZES: string[];
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { default } from "./loader-bar";
|
|
1
|
+
export { default } from "./loader-bar.component";
|
|
2
|
+
export type { LoaderBarProps } from "./loader-bar.component";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { MarginProps } from "styled-system";
|
|
3
|
+
import { StyledLoaderBarProps } from "./loader-bar.style";
|
|
4
|
+
export interface LoaderBarProps extends StyledLoaderBarProps, MarginProps {
|
|
5
|
+
}
|
|
6
|
+
declare const LoaderBar: ({ size, ...rest }: LoaderBarProps) => JSX.Element;
|
|
7
|
+
export default LoaderBar;
|
|
@@ -2,11 +2,8 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
2
2
|
|
|
3
3
|
import React from "react";
|
|
4
4
|
import PropTypes from "prop-types";
|
|
5
|
-
import styledSystemPropTypes from "@styled-system/prop-types";
|
|
6
5
|
import tagComponent from "../../__internal__/utils/helpers/tags/tags";
|
|
7
6
|
import StyledLoaderBar, { InnerBar, StyledLoader } from "./loader-bar.style";
|
|
8
|
-
import { filterStyledSystemMarginProps } from "../../style/utils";
|
|
9
|
-
const marginPropTypes = filterStyledSystemMarginProps(styledSystemPropTypes.space);
|
|
10
7
|
|
|
11
8
|
const LoaderBar = ({
|
|
12
9
|
size = "medium",
|
|
@@ -19,9 +16,161 @@ const LoaderBar = ({
|
|
|
19
16
|
})));
|
|
20
17
|
};
|
|
21
18
|
|
|
22
|
-
LoaderBar.propTypes = {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
LoaderBar.propTypes = {
|
|
20
|
+
"m": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
21
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
22
|
+
"description": PropTypes.string,
|
|
23
|
+
"toString": PropTypes.func.isRequired,
|
|
24
|
+
"valueOf": PropTypes.func.isRequired
|
|
25
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
26
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
27
|
+
"description": PropTypes.string,
|
|
28
|
+
"toString": PropTypes.func.isRequired,
|
|
29
|
+
"valueOf": PropTypes.func.isRequired
|
|
30
|
+
}), PropTypes.string]),
|
|
31
|
+
"margin": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
32
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
33
|
+
"description": PropTypes.string,
|
|
34
|
+
"toString": PropTypes.func.isRequired,
|
|
35
|
+
"valueOf": PropTypes.func.isRequired
|
|
36
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
37
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
38
|
+
"description": PropTypes.string,
|
|
39
|
+
"toString": PropTypes.func.isRequired,
|
|
40
|
+
"valueOf": PropTypes.func.isRequired
|
|
41
|
+
}), PropTypes.string]),
|
|
42
|
+
"marginBottom": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
43
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
44
|
+
"description": PropTypes.string,
|
|
45
|
+
"toString": PropTypes.func.isRequired,
|
|
46
|
+
"valueOf": PropTypes.func.isRequired
|
|
47
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
48
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
49
|
+
"description": PropTypes.string,
|
|
50
|
+
"toString": PropTypes.func.isRequired,
|
|
51
|
+
"valueOf": PropTypes.func.isRequired
|
|
52
|
+
}), PropTypes.string]),
|
|
53
|
+
"marginLeft": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
54
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
55
|
+
"description": PropTypes.string,
|
|
56
|
+
"toString": PropTypes.func.isRequired,
|
|
57
|
+
"valueOf": PropTypes.func.isRequired
|
|
58
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
59
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
60
|
+
"description": PropTypes.string,
|
|
61
|
+
"toString": PropTypes.func.isRequired,
|
|
62
|
+
"valueOf": PropTypes.func.isRequired
|
|
63
|
+
}), PropTypes.string]),
|
|
64
|
+
"marginRight": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
65
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
66
|
+
"description": PropTypes.string,
|
|
67
|
+
"toString": PropTypes.func.isRequired,
|
|
68
|
+
"valueOf": PropTypes.func.isRequired
|
|
69
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
70
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
71
|
+
"description": PropTypes.string,
|
|
72
|
+
"toString": PropTypes.func.isRequired,
|
|
73
|
+
"valueOf": PropTypes.func.isRequired
|
|
74
|
+
}), PropTypes.string]),
|
|
75
|
+
"marginTop": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
76
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
77
|
+
"description": PropTypes.string,
|
|
78
|
+
"toString": PropTypes.func.isRequired,
|
|
79
|
+
"valueOf": PropTypes.func.isRequired
|
|
80
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
81
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
82
|
+
"description": PropTypes.string,
|
|
83
|
+
"toString": PropTypes.func.isRequired,
|
|
84
|
+
"valueOf": PropTypes.func.isRequired
|
|
85
|
+
}), PropTypes.string]),
|
|
86
|
+
"marginX": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
87
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
88
|
+
"description": PropTypes.string,
|
|
89
|
+
"toString": PropTypes.func.isRequired,
|
|
90
|
+
"valueOf": PropTypes.func.isRequired
|
|
91
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
92
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
93
|
+
"description": PropTypes.string,
|
|
94
|
+
"toString": PropTypes.func.isRequired,
|
|
95
|
+
"valueOf": PropTypes.func.isRequired
|
|
96
|
+
}), PropTypes.string]),
|
|
97
|
+
"marginY": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
98
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
99
|
+
"description": PropTypes.string,
|
|
100
|
+
"toString": PropTypes.func.isRequired,
|
|
101
|
+
"valueOf": PropTypes.func.isRequired
|
|
102
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
103
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
104
|
+
"description": PropTypes.string,
|
|
105
|
+
"toString": PropTypes.func.isRequired,
|
|
106
|
+
"valueOf": PropTypes.func.isRequired
|
|
107
|
+
}), PropTypes.string]),
|
|
108
|
+
"mb": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
109
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
110
|
+
"description": PropTypes.string,
|
|
111
|
+
"toString": PropTypes.func.isRequired,
|
|
112
|
+
"valueOf": PropTypes.func.isRequired
|
|
113
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
114
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
115
|
+
"description": PropTypes.string,
|
|
116
|
+
"toString": PropTypes.func.isRequired,
|
|
117
|
+
"valueOf": PropTypes.func.isRequired
|
|
118
|
+
}), PropTypes.string]),
|
|
119
|
+
"ml": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
120
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
121
|
+
"description": PropTypes.string,
|
|
122
|
+
"toString": PropTypes.func.isRequired,
|
|
123
|
+
"valueOf": PropTypes.func.isRequired
|
|
124
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
125
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
126
|
+
"description": PropTypes.string,
|
|
127
|
+
"toString": PropTypes.func.isRequired,
|
|
128
|
+
"valueOf": PropTypes.func.isRequired
|
|
129
|
+
}), PropTypes.string]),
|
|
130
|
+
"mr": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
131
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
132
|
+
"description": PropTypes.string,
|
|
133
|
+
"toString": PropTypes.func.isRequired,
|
|
134
|
+
"valueOf": PropTypes.func.isRequired
|
|
135
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
136
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
137
|
+
"description": PropTypes.string,
|
|
138
|
+
"toString": PropTypes.func.isRequired,
|
|
139
|
+
"valueOf": PropTypes.func.isRequired
|
|
140
|
+
}), PropTypes.string]),
|
|
141
|
+
"mt": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
142
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
143
|
+
"description": PropTypes.string,
|
|
144
|
+
"toString": PropTypes.func.isRequired,
|
|
145
|
+
"valueOf": PropTypes.func.isRequired
|
|
146
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
147
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
148
|
+
"description": PropTypes.string,
|
|
149
|
+
"toString": PropTypes.func.isRequired,
|
|
150
|
+
"valueOf": PropTypes.func.isRequired
|
|
151
|
+
}), PropTypes.string]),
|
|
152
|
+
"mx": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
153
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
154
|
+
"description": PropTypes.string,
|
|
155
|
+
"toString": PropTypes.func.isRequired,
|
|
156
|
+
"valueOf": PropTypes.func.isRequired
|
|
157
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
158
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
159
|
+
"description": PropTypes.string,
|
|
160
|
+
"toString": PropTypes.func.isRequired,
|
|
161
|
+
"valueOf": PropTypes.func.isRequired
|
|
162
|
+
}), PropTypes.string]),
|
|
163
|
+
"my": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
164
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
165
|
+
"description": PropTypes.string,
|
|
166
|
+
"toString": PropTypes.func.isRequired,
|
|
167
|
+
"valueOf": PropTypes.func.isRequired
|
|
168
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
169
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
170
|
+
"description": PropTypes.string,
|
|
171
|
+
"toString": PropTypes.func.isRequired,
|
|
172
|
+
"valueOf": PropTypes.func.isRequired
|
|
173
|
+
}), PropTypes.string]),
|
|
174
|
+
"size": PropTypes.oneOf(["large", "medium", "small"])
|
|
26
175
|
};
|
|
27
176
|
export default LoaderBar;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const LOADER_BAR_SIZES: string[];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { MarginProps } from "styled-system";
|
|
2
|
+
export interface StyledLoaderBarProps {
|
|
3
|
+
/** Size of the loaderBar. */
|
|
4
|
+
size?: "small" | "medium" | "large";
|
|
5
|
+
}
|
|
6
|
+
declare const StyledLoader: import("styled-components").StyledComponent<"div", any, StyledLoaderBarProps & MarginProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>>, never>;
|
|
7
|
+
declare const StyledLoaderBar: import("styled-components").StyledComponent<"div", any, StyledLoaderBarProps, never>;
|
|
8
|
+
declare const InnerBar: import("styled-components").StyledComponent<"div", any, StyledLoaderBarProps, never>;
|
|
9
|
+
export { InnerBar, StyledLoader };
|
|
10
|
+
export default StyledLoaderBar;
|
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
import styled, { css, keyframes } from "styled-components";
|
|
2
|
-
import PropTypes from "prop-types";
|
|
3
2
|
import { margin } from "styled-system";
|
|
4
3
|
import baseTheme from "../../style/themes/base";
|
|
5
|
-
|
|
4
|
+
|
|
5
|
+
function getHeight(size) {
|
|
6
|
+
switch (size) {
|
|
7
|
+
case "small":
|
|
8
|
+
return "4px";
|
|
9
|
+
|
|
10
|
+
case "large":
|
|
11
|
+
return "16px";
|
|
12
|
+
|
|
13
|
+
default:
|
|
14
|
+
return "8px";
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
6
18
|
const INNER_BAR_LENGTH = "128px";
|
|
7
19
|
const StyledLoader = styled.div`
|
|
8
20
|
${margin}
|
|
@@ -42,31 +54,8 @@ const InnerBar = styled.div`
|
|
|
42
54
|
animation: 2s ${innerBarAnimation} linear 0s infinite normal none running;
|
|
43
55
|
`}
|
|
44
56
|
`;
|
|
45
|
-
|
|
46
|
-
function getHeight(size) {
|
|
47
|
-
switch (size) {
|
|
48
|
-
case "small":
|
|
49
|
-
return "4px";
|
|
50
|
-
|
|
51
|
-
case "large":
|
|
52
|
-
return "16px";
|
|
53
|
-
|
|
54
|
-
default:
|
|
55
|
-
return "8px";
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
57
|
StyledLoader.defaultProps = {
|
|
60
58
|
theme: baseTheme
|
|
61
59
|
};
|
|
62
|
-
StyledLoaderBar.defaultProps = {
|
|
63
|
-
size: "medium"
|
|
64
|
-
};
|
|
65
|
-
InnerBar.defaultProps = {
|
|
66
|
-
size: "medium"
|
|
67
|
-
};
|
|
68
|
-
StyledLoaderBar.propTypes = {
|
|
69
|
-
size: PropTypes.oneOf(LOADER_BAR_SIZES)
|
|
70
|
-
};
|
|
71
60
|
export { InnerBar, StyledLoader };
|
|
72
61
|
export default StyledLoaderBar;
|
|
@@ -192,6 +192,7 @@ const Pod = /*#__PURE__*/forwardRef(({
|
|
|
192
192
|
height: podHeight,
|
|
193
193
|
ref: ref
|
|
194
194
|
}), /*#__PURE__*/React.createElement(StyledBlock, _extends({
|
|
195
|
+
"data-element": "block",
|
|
195
196
|
contentTriggersEdit: shouldContentHaveEditEvents(),
|
|
196
197
|
hasButtons: onEdit || onDelete || onUndo,
|
|
197
198
|
fullWidth: editContentFullWidth,
|
|
@@ -28,7 +28,7 @@ const StyledPod = styled.div`
|
|
|
28
28
|
const blockBackgrounds = variant => ({
|
|
29
29
|
primary: "var(--colorsUtilityYang100)",
|
|
30
30
|
secondary: "var(--colorsUtilityMajor025)",
|
|
31
|
-
tertiary: "var(--
|
|
31
|
+
tertiary: "var(--colorsUtilityMajor040)",
|
|
32
32
|
transparent: "var(--colorsUtilityMajorTransparent)",
|
|
33
33
|
tile: "var(--colorsUtilityYang100)"
|
|
34
34
|
})[variant];
|
|
@@ -84,8 +84,12 @@ const StyledBlock = styled.div`
|
|
|
84
84
|
`};
|
|
85
85
|
|
|
86
86
|
${softDelete && css`
|
|
87
|
-
|
|
88
|
-
background-color: var(--
|
|
87
|
+
border: none;
|
|
88
|
+
background-color: var(--colorsActionDisabled500);
|
|
89
|
+
|
|
90
|
+
& > * {
|
|
91
|
+
color: var(--colorsUtilityYin065);
|
|
92
|
+
}
|
|
89
93
|
`};
|
|
90
94
|
`}
|
|
91
95
|
`;
|
|
@@ -122,7 +126,7 @@ const StyledFooter = styled.div`
|
|
|
122
126
|
padding: ${footerPaddings[size]};
|
|
123
127
|
|
|
124
128
|
${softDelete && css`
|
|
125
|
-
color: var(--
|
|
129
|
+
color: var(--colorsUtilityYin055);
|
|
126
130
|
`}
|
|
127
131
|
|
|
128
132
|
${variant === "tile" && css`
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { default } from "./portrait";
|
|
1
|
+
export { default } from "./portrait.component";
|
|
2
|
+
export type { PortraitProps } from "./portrait.component";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { PortraitSizes, PortraitShapes } from "./portrait.component";
|
|
3
|
+
export interface PortraitGravatarProps {
|
|
4
|
+
/** The user's email address for the Gravatar. */
|
|
5
|
+
gravatarEmail: string;
|
|
6
|
+
/** The size of the Gravatar. */
|
|
7
|
+
size: PortraitSizes;
|
|
8
|
+
/** The shape of the Gravatar. */
|
|
9
|
+
shape?: PortraitShapes;
|
|
10
|
+
/** The `alt` HTML string. */
|
|
11
|
+
alt?: string;
|
|
12
|
+
/** A callback to execute if the Gravatar image fails to load. */
|
|
13
|
+
errorCallback?: () => void;
|
|
14
|
+
}
|
|
15
|
+
declare const PortraitGravatar: ({ gravatarEmail, size, alt, shape, errorCallback, }: PortraitGravatarProps) => JSX.Element;
|
|
16
|
+
export default PortraitGravatar;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
|
|
3
1
|
import React from "react";
|
|
4
2
|
import PropTypes from "prop-types";
|
|
5
3
|
import MD5 from "crypto-js/md5";
|
|
@@ -10,9 +8,8 @@ const PortraitGravatar = ({
|
|
|
10
8
|
gravatarEmail,
|
|
11
9
|
size,
|
|
12
10
|
alt,
|
|
13
|
-
shape,
|
|
14
|
-
errorCallback
|
|
15
|
-
...rest
|
|
11
|
+
shape = "square",
|
|
12
|
+
errorCallback
|
|
16
13
|
}) => {
|
|
17
14
|
const gravatarSrc = () => {
|
|
18
15
|
const {
|
|
@@ -27,33 +24,21 @@ const PortraitGravatar = ({
|
|
|
27
24
|
return `${base}${hash}?s=${dimensions}&d=${fallbackOption}`;
|
|
28
25
|
};
|
|
29
26
|
|
|
30
|
-
return /*#__PURE__*/React.createElement(StyledPortraitGravatar,
|
|
27
|
+
return /*#__PURE__*/React.createElement(StyledPortraitGravatar, {
|
|
31
28
|
src: gravatarSrc(),
|
|
32
29
|
alt: alt,
|
|
33
30
|
size: size,
|
|
34
31
|
shape: shape,
|
|
35
32
|
onError: errorCallback,
|
|
36
33
|
"data-element": "user-image"
|
|
37
|
-
}
|
|
34
|
+
});
|
|
38
35
|
};
|
|
39
36
|
|
|
40
37
|
PortraitGravatar.propTypes = {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
size: PropTypes.oneOf(["
|
|
46
|
-
|
|
47
|
-
/** The shape of the Gravatar. */
|
|
48
|
-
shape: PropTypes.oneOf(["circle", "square"]),
|
|
49
|
-
|
|
50
|
-
/** The `alt` HTML string. */
|
|
51
|
-
alt: PropTypes.string,
|
|
52
|
-
|
|
53
|
-
/** A callback to execute if the Gravatar image fails to load. */
|
|
54
|
-
errorCallback: PropTypes.func
|
|
55
|
-
};
|
|
56
|
-
PortraitGravatar.defaultProps = {
|
|
57
|
-
shape: "square"
|
|
38
|
+
"alt": PropTypes.string,
|
|
39
|
+
"errorCallback": PropTypes.func,
|
|
40
|
+
"gravatarEmail": PropTypes.string.isRequired,
|
|
41
|
+
"shape": PropTypes.oneOf(["circle", "square"]),
|
|
42
|
+
"size": PropTypes.oneOf(["L", "M", "ML", "S", "XL", "XS", "XXL"]).isRequired
|
|
58
43
|
};
|
|
59
44
|
export default PortraitGravatar;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { PortraitSizes, PortraitShapes } from "./portrait.component";
|
|
3
|
+
export interface PortraitInitialsProps {
|
|
4
|
+
/** The user's initials to render. */
|
|
5
|
+
initials: string;
|
|
6
|
+
/** The size of the initials image. */
|
|
7
|
+
size: PortraitSizes;
|
|
8
|
+
/** Use a dark background. */
|
|
9
|
+
darkBackground?: boolean;
|
|
10
|
+
/** The shape of the Portrait. */
|
|
11
|
+
shape?: PortraitShapes;
|
|
12
|
+
/** The `alt` HTML string. */
|
|
13
|
+
alt?: string;
|
|
14
|
+
}
|
|
15
|
+
declare const PortraitInitials: ({ initials, size, shape, darkBackground, alt, }: PortraitInitialsProps) => JSX.Element;
|
|
16
|
+
export default PortraitInitials;
|