carbon-react 109.7.0 → 109.7.1
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__/checkable-input/checkable-input-svg-wrapper.style.d.ts +2 -0
- package/esm/__internal__/checkable-input/checkable-input.style.d.ts +2 -0
- package/esm/__internal__/checkable-input/hidden-checkable-input.style.d.ts +2 -0
- package/esm/components/checkbox/checkbox.style.d.ts +3 -0
- package/esm/components/dismissible-box/dismissible-box.component.d.ts +1 -1
- package/esm/components/dismissible-box/dismissible-box.component.js +1 -0
- package/esm/components/fieldset/fieldset.component.d.ts +11 -0
- package/esm/components/fieldset/fieldset.component.js +158 -17
- package/esm/components/fieldset/fieldset.style.d.ts +8 -0
- package/esm/components/fieldset/index.d.ts +2 -1
- package/esm/components/grid/grid-container/grid-container.component.js +4 -23
- package/lib/__internal__/checkable-input/checkable-input-svg-wrapper.style.d.ts +2 -0
- package/lib/__internal__/checkable-input/checkable-input.style.d.ts +2 -0
- package/lib/__internal__/checkable-input/hidden-checkable-input.style.d.ts +2 -0
- package/lib/components/checkbox/checkbox.style.d.ts +3 -0
- package/lib/components/dismissible-box/dismissible-box.component.d.ts +1 -1
- package/lib/components/dismissible-box/dismissible-box.component.js +2 -1
- package/lib/components/fieldset/fieldset.component.d.ts +11 -0
- package/lib/components/fieldset/fieldset.component.js +158 -19
- package/lib/components/fieldset/fieldset.style.d.ts +8 -0
- package/lib/components/fieldset/index.d.ts +2 -1
- package/lib/components/grid/grid-container/grid-container.component.js +4 -30
- package/package.json +1 -1
- package/esm/components/fieldset/fieldset.d.ts +0 -15
- package/lib/components/fieldset/fieldset.d.ts +0 -15
|
@@ -13,5 +13,5 @@ export interface DismissibleBoxProps extends SpaceProps, StyledDismissibleBoxPro
|
|
|
13
13
|
* Please note this component has a minWidth of 600px */
|
|
14
14
|
width?: number | string;
|
|
15
15
|
}
|
|
16
|
-
declare const DismissibleBox: ({ children, onClose, ...rest }: DismissibleBoxProps) => JSX.Element;
|
|
16
|
+
export declare const DismissibleBox: ({ children, onClose, ...rest }: DismissibleBoxProps) => JSX.Element;
|
|
17
17
|
export default DismissibleBox;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { MarginProps } from "styled-system";
|
|
3
|
+
import { StyledFieldsetProps } from "./fieldset.style";
|
|
4
|
+
export interface FieldsetProps extends StyledFieldsetProps, MarginProps {
|
|
5
|
+
/** Child elements */
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
/** The text for the fieldsets legend element. */
|
|
8
|
+
legend?: string;
|
|
9
|
+
}
|
|
10
|
+
declare const Fieldset: ({ children, inline, legend, ...rest }: FieldsetProps) => JSX.Element;
|
|
11
|
+
export default Fieldset;
|
|
@@ -2,16 +2,14 @@ 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 { filterStyledSystemMarginProps } from "../../style/utils";
|
|
8
7
|
import { FieldsetStyle, LegendContainerStyle, FieldsetContentStyle } from "./fieldset.style";
|
|
9
8
|
import { NewValidationContext } from "../carbon-provider/carbon-provider.component";
|
|
10
|
-
const marginPropTypes = filterStyledSystemMarginProps(styledSystemPropTypes.space);
|
|
11
9
|
|
|
12
10
|
const Fieldset = ({
|
|
13
11
|
children,
|
|
14
|
-
inline,
|
|
12
|
+
inline = false,
|
|
15
13
|
legend,
|
|
16
14
|
...rest
|
|
17
15
|
}) => {
|
|
@@ -38,19 +36,162 @@ const Fieldset = ({
|
|
|
38
36
|
};
|
|
39
37
|
|
|
40
38
|
Fieldset.propTypes = {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
39
|
+
"children": PropTypes.node,
|
|
40
|
+
"inline": PropTypes.bool,
|
|
41
|
+
"legend": PropTypes.string,
|
|
42
|
+
"m": 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
|
+
"margin": 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
|
+
"marginBottom": 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
|
+
"marginLeft": 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
|
+
"marginRight": 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
|
+
"marginTop": 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
|
+
"marginX": 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
|
+
"marginY": 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
|
+
"mb": 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
|
+
"ml": 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
|
+
"mr": 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
|
+
"mt": 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
|
+
"mx": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
175
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
176
|
+
"description": PropTypes.string,
|
|
177
|
+
"toString": PropTypes.func.isRequired,
|
|
178
|
+
"valueOf": PropTypes.func.isRequired
|
|
179
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
180
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
181
|
+
"description": PropTypes.string,
|
|
182
|
+
"toString": PropTypes.func.isRequired,
|
|
183
|
+
"valueOf": PropTypes.func.isRequired
|
|
184
|
+
}), PropTypes.string]),
|
|
185
|
+
"my": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
186
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
187
|
+
"description": PropTypes.string,
|
|
188
|
+
"toString": PropTypes.func.isRequired,
|
|
189
|
+
"valueOf": PropTypes.func.isRequired
|
|
190
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
191
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
192
|
+
"description": PropTypes.string,
|
|
193
|
+
"toString": PropTypes.func.isRequired,
|
|
194
|
+
"valueOf": PropTypes.func.isRequired
|
|
195
|
+
}), PropTypes.string])
|
|
55
196
|
};
|
|
56
197
|
export default Fieldset;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface StyledFieldsetProps {
|
|
2
|
+
/** When true, legend is placed in line with the children */
|
|
3
|
+
inline?: boolean;
|
|
4
|
+
}
|
|
5
|
+
declare const FieldsetStyle: import("styled-components").StyledComponent<"fieldset", any, {}, never>;
|
|
6
|
+
declare const LegendContainerStyle: import("styled-components").StyledComponent<"div", any, StyledFieldsetProps, never>;
|
|
7
|
+
declare const FieldsetContentStyle: import("styled-components").StyledComponent<"div", any, StyledFieldsetProps, never>;
|
|
8
|
+
export { FieldsetStyle, LegendContainerStyle, FieldsetContentStyle };
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { default } from "./fieldset";
|
|
1
|
+
export { default } from "./fieldset.component";
|
|
2
|
+
export type { FieldsetProps } from "./fieldset.component";
|
|
@@ -1,31 +1,12 @@
|
|
|
1
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
2
|
|
|
3
|
-
import React
|
|
3
|
+
import React from "react";
|
|
4
4
|
import PropTypes from "prop-types";
|
|
5
|
-
import invariant from "invariant";
|
|
6
5
|
import StyledGridContainer from "./grid-container.style";
|
|
7
|
-
import GridItem from "../grid-item";
|
|
8
6
|
|
|
9
|
-
const GridContainer = props => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
...rest
|
|
13
|
-
} = props;
|
|
14
|
-
const hasProperChildren = useMemo(() => {
|
|
15
|
-
const incorrectChild = React.Children.toArray(children).find(child => {
|
|
16
|
-
if (! /*#__PURE__*/React.isValidElement(child)) {
|
|
17
|
-
return true;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
return child.type.displayName !== GridItem.displayName;
|
|
21
|
-
});
|
|
22
|
-
return !incorrectChild;
|
|
23
|
-
}, [children]);
|
|
24
|
-
!hasProperChildren ? process.env.NODE_ENV !== "production" ? invariant(false, `GridContainer only accepts children of type ${GridItem.displayName}.`) : invariant(false) : void 0;
|
|
25
|
-
return /*#__PURE__*/React.createElement(StyledGridContainer, _extends({
|
|
26
|
-
"data-component": "grid"
|
|
27
|
-
}, rest), children);
|
|
28
|
-
};
|
|
7
|
+
const GridContainer = props => /*#__PURE__*/React.createElement(StyledGridContainer, _extends({
|
|
8
|
+
"data-component": "grid"
|
|
9
|
+
}, props));
|
|
29
10
|
|
|
30
11
|
GridContainer.propTypes = {
|
|
31
12
|
"about": PropTypes.string,
|
|
@@ -13,5 +13,5 @@ export interface DismissibleBoxProps extends SpaceProps, StyledDismissibleBoxPro
|
|
|
13
13
|
* Please note this component has a minWidth of 600px */
|
|
14
14
|
width?: number | string;
|
|
15
15
|
}
|
|
16
|
-
declare const DismissibleBox: ({ children, onClose, ...rest }: DismissibleBoxProps) => JSX.Element;
|
|
16
|
+
export declare const DismissibleBox: ({ children, onClose, ...rest }: DismissibleBoxProps) => JSX.Element;
|
|
17
17
|
export default DismissibleBox;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default = void 0;
|
|
6
|
+
exports.default = exports.DismissibleBox = void 0;
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
@@ -37,6 +37,7 @@ const DismissibleBox = ({
|
|
|
37
37
|
color: "--colorsActionMinor500"
|
|
38
38
|
}))));
|
|
39
39
|
|
|
40
|
+
exports.DismissibleBox = DismissibleBox;
|
|
40
41
|
DismissibleBox.propTypes = {
|
|
41
42
|
"alignContent": _propTypes.default.oneOfType([_propTypes.default.oneOf(["-moz-initial", "baseline", "center", "end", "flex-end", "flex-start", "inherit", "initial", "normal", "revert", "space-around", "space-between", "space-evenly", "start", "stretch", "unset"]), _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf(["-moz-initial", "baseline", "center", "end", "flex-end", "flex-start", "inherit", "initial", "normal", "revert", "space-around", "space-between", "space-evenly", "start", "stretch", "unset", null]), _propTypes.default.shape({
|
|
42
43
|
"__@iterator": _propTypes.default.func.isRequired,
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { MarginProps } from "styled-system";
|
|
3
|
+
import { StyledFieldsetProps } from "./fieldset.style";
|
|
4
|
+
export interface FieldsetProps extends StyledFieldsetProps, MarginProps {
|
|
5
|
+
/** Child elements */
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
/** The text for the fieldsets legend element. */
|
|
8
|
+
legend?: string;
|
|
9
|
+
}
|
|
10
|
+
declare const Fieldset: ({ children, inline, legend, ...rest }: FieldsetProps) => JSX.Element;
|
|
11
|
+
export default Fieldset;
|
|
@@ -9,8 +9,6 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
|
|
12
|
-
var _propTypes2 = _interopRequireDefault(require("@styled-system/prop-types"));
|
|
13
|
-
|
|
14
12
|
var _tags = _interopRequireDefault(require("../../__internal__/utils/helpers/tags/tags"));
|
|
15
13
|
|
|
16
14
|
var _utils = require("../../style/utils");
|
|
@@ -23,11 +21,9 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
23
21
|
|
|
24
22
|
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); }
|
|
25
23
|
|
|
26
|
-
const marginPropTypes = (0, _utils.filterStyledSystemMarginProps)(_propTypes2.default.space);
|
|
27
|
-
|
|
28
24
|
const Fieldset = ({
|
|
29
25
|
children,
|
|
30
|
-
inline,
|
|
26
|
+
inline = false,
|
|
31
27
|
legend,
|
|
32
28
|
...rest
|
|
33
29
|
}) => {
|
|
@@ -54,20 +50,163 @@ const Fieldset = ({
|
|
|
54
50
|
};
|
|
55
51
|
|
|
56
52
|
Fieldset.propTypes = {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
53
|
+
"children": _propTypes.default.node,
|
|
54
|
+
"inline": _propTypes.default.bool,
|
|
55
|
+
"legend": _propTypes.default.string,
|
|
56
|
+
"m": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
57
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
58
|
+
"description": _propTypes.default.string,
|
|
59
|
+
"toString": _propTypes.default.func.isRequired,
|
|
60
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
61
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
62
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
63
|
+
"description": _propTypes.default.string,
|
|
64
|
+
"toString": _propTypes.default.func.isRequired,
|
|
65
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
66
|
+
}), _propTypes.default.string]),
|
|
67
|
+
"margin": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
68
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
69
|
+
"description": _propTypes.default.string,
|
|
70
|
+
"toString": _propTypes.default.func.isRequired,
|
|
71
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
72
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
73
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
74
|
+
"description": _propTypes.default.string,
|
|
75
|
+
"toString": _propTypes.default.func.isRequired,
|
|
76
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
77
|
+
}), _propTypes.default.string]),
|
|
78
|
+
"marginBottom": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
79
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
80
|
+
"description": _propTypes.default.string,
|
|
81
|
+
"toString": _propTypes.default.func.isRequired,
|
|
82
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
83
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
84
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
85
|
+
"description": _propTypes.default.string,
|
|
86
|
+
"toString": _propTypes.default.func.isRequired,
|
|
87
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
88
|
+
}), _propTypes.default.string]),
|
|
89
|
+
"marginLeft": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
90
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
91
|
+
"description": _propTypes.default.string,
|
|
92
|
+
"toString": _propTypes.default.func.isRequired,
|
|
93
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
94
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
95
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
96
|
+
"description": _propTypes.default.string,
|
|
97
|
+
"toString": _propTypes.default.func.isRequired,
|
|
98
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
99
|
+
}), _propTypes.default.string]),
|
|
100
|
+
"marginRight": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
101
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
102
|
+
"description": _propTypes.default.string,
|
|
103
|
+
"toString": _propTypes.default.func.isRequired,
|
|
104
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
105
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
106
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
107
|
+
"description": _propTypes.default.string,
|
|
108
|
+
"toString": _propTypes.default.func.isRequired,
|
|
109
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
110
|
+
}), _propTypes.default.string]),
|
|
111
|
+
"marginTop": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
112
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
113
|
+
"description": _propTypes.default.string,
|
|
114
|
+
"toString": _propTypes.default.func.isRequired,
|
|
115
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
116
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
117
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
118
|
+
"description": _propTypes.default.string,
|
|
119
|
+
"toString": _propTypes.default.func.isRequired,
|
|
120
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
121
|
+
}), _propTypes.default.string]),
|
|
122
|
+
"marginX": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
123
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
124
|
+
"description": _propTypes.default.string,
|
|
125
|
+
"toString": _propTypes.default.func.isRequired,
|
|
126
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
127
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
128
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
129
|
+
"description": _propTypes.default.string,
|
|
130
|
+
"toString": _propTypes.default.func.isRequired,
|
|
131
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
132
|
+
}), _propTypes.default.string]),
|
|
133
|
+
"marginY": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
134
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
135
|
+
"description": _propTypes.default.string,
|
|
136
|
+
"toString": _propTypes.default.func.isRequired,
|
|
137
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
138
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
139
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
140
|
+
"description": _propTypes.default.string,
|
|
141
|
+
"toString": _propTypes.default.func.isRequired,
|
|
142
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
143
|
+
}), _propTypes.default.string]),
|
|
144
|
+
"mb": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
145
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
146
|
+
"description": _propTypes.default.string,
|
|
147
|
+
"toString": _propTypes.default.func.isRequired,
|
|
148
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
149
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
150
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
151
|
+
"description": _propTypes.default.string,
|
|
152
|
+
"toString": _propTypes.default.func.isRequired,
|
|
153
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
154
|
+
}), _propTypes.default.string]),
|
|
155
|
+
"ml": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
156
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
157
|
+
"description": _propTypes.default.string,
|
|
158
|
+
"toString": _propTypes.default.func.isRequired,
|
|
159
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
160
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
161
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
162
|
+
"description": _propTypes.default.string,
|
|
163
|
+
"toString": _propTypes.default.func.isRequired,
|
|
164
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
165
|
+
}), _propTypes.default.string]),
|
|
166
|
+
"mr": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
167
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
168
|
+
"description": _propTypes.default.string,
|
|
169
|
+
"toString": _propTypes.default.func.isRequired,
|
|
170
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
171
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
172
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
173
|
+
"description": _propTypes.default.string,
|
|
174
|
+
"toString": _propTypes.default.func.isRequired,
|
|
175
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
176
|
+
}), _propTypes.default.string]),
|
|
177
|
+
"mt": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
178
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
179
|
+
"description": _propTypes.default.string,
|
|
180
|
+
"toString": _propTypes.default.func.isRequired,
|
|
181
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
182
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
183
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
184
|
+
"description": _propTypes.default.string,
|
|
185
|
+
"toString": _propTypes.default.func.isRequired,
|
|
186
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
187
|
+
}), _propTypes.default.string]),
|
|
188
|
+
"mx": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
189
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
190
|
+
"description": _propTypes.default.string,
|
|
191
|
+
"toString": _propTypes.default.func.isRequired,
|
|
192
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
193
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
194
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
195
|
+
"description": _propTypes.default.string,
|
|
196
|
+
"toString": _propTypes.default.func.isRequired,
|
|
197
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
198
|
+
}), _propTypes.default.string]),
|
|
199
|
+
"my": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
200
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
201
|
+
"description": _propTypes.default.string,
|
|
202
|
+
"toString": _propTypes.default.func.isRequired,
|
|
203
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
204
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
205
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
206
|
+
"description": _propTypes.default.string,
|
|
207
|
+
"toString": _propTypes.default.func.isRequired,
|
|
208
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
209
|
+
}), _propTypes.default.string])
|
|
71
210
|
};
|
|
72
211
|
var _default = Fieldset;
|
|
73
212
|
exports.default = _default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface StyledFieldsetProps {
|
|
2
|
+
/** When true, legend is placed in line with the children */
|
|
3
|
+
inline?: boolean;
|
|
4
|
+
}
|
|
5
|
+
declare const FieldsetStyle: import("styled-components").StyledComponent<"fieldset", any, {}, never>;
|
|
6
|
+
declare const LegendContainerStyle: import("styled-components").StyledComponent<"div", any, StyledFieldsetProps, never>;
|
|
7
|
+
declare const FieldsetContentStyle: import("styled-components").StyledComponent<"div", any, StyledFieldsetProps, never>;
|
|
8
|
+
export { FieldsetStyle, LegendContainerStyle, FieldsetContentStyle };
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { default } from "./fieldset";
|
|
1
|
+
export { default } from "./fieldset.component";
|
|
2
|
+
export type { FieldsetProps } from "./fieldset.component";
|
|
@@ -5,45 +5,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = exports.GridContainer = void 0;
|
|
7
7
|
|
|
8
|
-
var _react =
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
|
|
12
|
-
var _invariant = _interopRequireDefault(require("invariant"));
|
|
13
|
-
|
|
14
12
|
var _gridContainer = _interopRequireDefault(require("./grid-container.style"));
|
|
15
13
|
|
|
16
|
-
var _gridItem = _interopRequireDefault(require("../grid-item"));
|
|
17
|
-
|
|
18
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
15
|
|
|
20
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
|
21
|
-
|
|
22
|
-
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; }
|
|
23
|
-
|
|
24
16
|
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); }
|
|
25
17
|
|
|
26
|
-
const GridContainer = props => {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
...rest
|
|
30
|
-
} = props;
|
|
31
|
-
const hasProperChildren = (0, _react.useMemo)(() => {
|
|
32
|
-
const incorrectChild = _react.default.Children.toArray(children).find(child => {
|
|
33
|
-
if (! /*#__PURE__*/_react.default.isValidElement(child)) {
|
|
34
|
-
return true;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
return child.type.displayName !== _gridItem.default.displayName;
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
return !incorrectChild;
|
|
41
|
-
}, [children]);
|
|
42
|
-
!hasProperChildren ? process.env.NODE_ENV !== "production" ? (0, _invariant.default)(false, `GridContainer only accepts children of type ${_gridItem.default.displayName}.`) : (0, _invariant.default)(false) : void 0;
|
|
43
|
-
return /*#__PURE__*/_react.default.createElement(_gridContainer.default, _extends({
|
|
44
|
-
"data-component": "grid"
|
|
45
|
-
}, rest), children);
|
|
46
|
-
};
|
|
18
|
+
const GridContainer = props => /*#__PURE__*/_react.default.createElement(_gridContainer.default, _extends({
|
|
19
|
+
"data-component": "grid"
|
|
20
|
+
}, props));
|
|
47
21
|
|
|
48
22
|
exports.GridContainer = GridContainer;
|
|
49
23
|
GridContainer.propTypes = {
|
package/package.json
CHANGED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { MarginProps } from "styled-system";
|
|
3
|
-
|
|
4
|
-
export interface FieldsetProps extends MarginProps {
|
|
5
|
-
/** Child elements */
|
|
6
|
-
children?: React.ReactNode;
|
|
7
|
-
/** The text for the fieldsets legend element. */
|
|
8
|
-
legend?: string;
|
|
9
|
-
/** When true, legend is placed in line with the children */
|
|
10
|
-
inline?: boolean;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
declare function Fieldset(props: FieldsetProps): JSX.Element;
|
|
14
|
-
|
|
15
|
-
export default Fieldset;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { MarginProps } from "styled-system";
|
|
3
|
-
|
|
4
|
-
export interface FieldsetProps extends MarginProps {
|
|
5
|
-
/** Child elements */
|
|
6
|
-
children?: React.ReactNode;
|
|
7
|
-
/** The text for the fieldsets legend element. */
|
|
8
|
-
legend?: string;
|
|
9
|
-
/** When true, legend is placed in line with the children */
|
|
10
|
-
inline?: boolean;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
declare function Fieldset(props: FieldsetProps): JSX.Element;
|
|
14
|
-
|
|
15
|
-
export default Fieldset;
|