carbon-react 109.7.1 → 110.0.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/__internal__/utils/helpers/tags/tags-specs/tags-specs.d.ts +1 -1
- package/esm/components/date/date.component.js +17 -15
- 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/flat-table/flat-table-row/flat-table-row.style.js +30 -2
- package/esm/components/link/link.component.d.ts +0 -2
- package/esm/components/link/link.component.js +0 -4
- package/esm/components/menu/__internal__/submenu/submenu.component.js +6 -8
- package/esm/components/multi-action-button/multi-action-button.component.js +2 -1
- package/esm/components/popover-container/popover-container.component.js +2 -3
- 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/split-button/split-button.component.js +2 -1
- package/esm/components/text-editor/__internal__/editor-link/editor-link.component.js +3 -4
- package/esm/hooks/__internal__/useClickAwayListener/useClickAwayListener.d.ts +1 -2
- package/esm/hooks/__internal__/useClickAwayListener/useClickAwayListener.js +20 -18
- package/lib/__internal__/utils/helpers/tags/tags-specs/tags-specs.d.ts +1 -1
- package/lib/components/date/date.component.js +17 -15
- 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/flat-table/flat-table-row/flat-table-row.style.js +30 -2
- package/lib/components/link/link.component.d.ts +0 -2
- package/lib/components/link/link.component.js +0 -4
- package/lib/components/menu/__internal__/submenu/submenu.component.js +6 -8
- package/lib/components/multi-action-button/multi-action-button.component.js +2 -1
- package/lib/components/popover-container/popover-container.component.js +2 -3
- 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/split-button/split-button.component.js +2 -1
- package/lib/components/text-editor/__internal__/editor-link/editor-link.component.js +3 -4
- package/lib/hooks/__internal__/useClickAwayListener/useClickAwayListener.d.ts +1 -2
- package/lib/hooks/__internal__/useClickAwayListener/useClickAwayListener.js +20 -18
- 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
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ReactWrapper, ShallowWrapper } from "enzyme";
|
|
2
|
-
declare const elementsTagTest: (wrapper: ReactWrapper, elements: string[]) => void;
|
|
2
|
+
declare const elementsTagTest: (wrapper: ReactWrapper | ShallowWrapper, elements: string[]) => void;
|
|
3
3
|
declare const rootTagTest: (rootNode: ReactWrapper | ShallowWrapper, comp: string, elem?: string | undefined, role?: string | undefined) => void;
|
|
4
4
|
export { elementsTagTest, rootTagTest };
|
|
@@ -43,7 +43,6 @@ const DateInput = ({
|
|
|
43
43
|
const wrapperRef = useRef();
|
|
44
44
|
const parentRef = useRef();
|
|
45
45
|
const inputRef = useRef();
|
|
46
|
-
const pickerRef = useRef();
|
|
47
46
|
const alreadyFocused = useRef(false);
|
|
48
47
|
const isBlurBlocked = useRef(false);
|
|
49
48
|
const focusedViaPicker = useRef(false);
|
|
@@ -88,6 +87,19 @@ const DateInput = ({
|
|
|
88
87
|
return ev;
|
|
89
88
|
};
|
|
90
89
|
|
|
90
|
+
const handleClickAway = () => {
|
|
91
|
+
if (open) {
|
|
92
|
+
alreadyFocused.current = true;
|
|
93
|
+
inputRef.current.focus();
|
|
94
|
+
isBlurBlocked.current = false;
|
|
95
|
+
inputRef.current.blur();
|
|
96
|
+
setOpen(false);
|
|
97
|
+
alreadyFocused.current = false;
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
const handleClickInside = useClickAwayListener(handleClickAway, "mousedown");
|
|
102
|
+
|
|
91
103
|
const handleChange = ev => {
|
|
92
104
|
isInitialValue.current = false;
|
|
93
105
|
onChange(buildCustomEvent(ev));
|
|
@@ -194,6 +206,8 @@ const DateInput = ({
|
|
|
194
206
|
};
|
|
195
207
|
|
|
196
208
|
const handleMouseDown = ev => {
|
|
209
|
+
handleClickInside(ev);
|
|
210
|
+
|
|
197
211
|
if (disabled || readOnly) {
|
|
198
212
|
return;
|
|
199
213
|
}
|
|
@@ -215,8 +229,9 @@ const DateInput = ({
|
|
|
215
229
|
handleMouseDown(e);
|
|
216
230
|
};
|
|
217
231
|
|
|
218
|
-
const handlePickerMouseDown =
|
|
232
|
+
const handlePickerMouseDown = ev => {
|
|
219
233
|
isBlurBlocked.current = true;
|
|
234
|
+
handleClickInside(ev);
|
|
220
235
|
};
|
|
221
236
|
|
|
222
237
|
const assignInput = input => {
|
|
@@ -266,18 +281,6 @@ const DateInput = ({
|
|
|
266
281
|
return value;
|
|
267
282
|
};
|
|
268
283
|
|
|
269
|
-
const handleClickAway = () => {
|
|
270
|
-
if (open) {
|
|
271
|
-
alreadyFocused.current = true;
|
|
272
|
-
inputRef.current.focus();
|
|
273
|
-
isBlurBlocked.current = false;
|
|
274
|
-
inputRef.current.blur();
|
|
275
|
-
setOpen(false);
|
|
276
|
-
alreadyFocused.current = false;
|
|
277
|
-
}
|
|
278
|
-
};
|
|
279
|
-
|
|
280
|
-
useClickAwayListener([parentRef, pickerRef], handleClickAway, "mousedown");
|
|
281
284
|
return /*#__PURE__*/React.createElement(StyledDateInput, _extends({
|
|
282
285
|
ref: wrapperRef,
|
|
283
286
|
role: "presentation",
|
|
@@ -315,7 +318,6 @@ const DateInput = ({
|
|
|
315
318
|
onDayClick: handleDayClick,
|
|
316
319
|
minDate: minDate,
|
|
317
320
|
maxDate: maxDate,
|
|
318
|
-
ref: pickerRef,
|
|
319
321
|
pickerMouseDown: handlePickerMouseDown,
|
|
320
322
|
open: open
|
|
321
323
|
}));
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { SpaceProps } from "styled-system";
|
|
3
|
+
export interface DdProps extends SpaceProps {
|
|
4
|
+
/** Prop for what will render in the `<Dd></Dd>` tags */
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
declare const Dd: ({ children, ...rest }: DdProps) => JSX.Element;
|
|
8
|
+
export default Dd;
|
|
@@ -1,7 +1,6 @@
|
|
|
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
3
|
import React from "react";
|
|
4
|
-
import propTypes from "@styled-system/prop-types";
|
|
5
4
|
import PropTypes from "prop-types";
|
|
6
5
|
import { StyledDd } from "./definition-list.style";
|
|
7
6
|
|
|
@@ -17,9 +16,315 @@ const Dd = ({
|
|
|
17
16
|
}, rest), children);
|
|
18
17
|
};
|
|
19
18
|
|
|
20
|
-
Dd.propTypes = {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
Dd.propTypes = {
|
|
20
|
+
"children": PropTypes.node,
|
|
21
|
+
"m": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
22
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
23
|
+
"description": PropTypes.string,
|
|
24
|
+
"toString": PropTypes.func.isRequired,
|
|
25
|
+
"valueOf": PropTypes.func.isRequired
|
|
26
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
27
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
28
|
+
"description": PropTypes.string,
|
|
29
|
+
"toString": PropTypes.func.isRequired,
|
|
30
|
+
"valueOf": PropTypes.func.isRequired
|
|
31
|
+
}), PropTypes.string]),
|
|
32
|
+
"margin": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
33
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
34
|
+
"description": PropTypes.string,
|
|
35
|
+
"toString": PropTypes.func.isRequired,
|
|
36
|
+
"valueOf": PropTypes.func.isRequired
|
|
37
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
38
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
39
|
+
"description": PropTypes.string,
|
|
40
|
+
"toString": PropTypes.func.isRequired,
|
|
41
|
+
"valueOf": PropTypes.func.isRequired
|
|
42
|
+
}), PropTypes.string]),
|
|
43
|
+
"marginBottom": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
44
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
45
|
+
"description": PropTypes.string,
|
|
46
|
+
"toString": PropTypes.func.isRequired,
|
|
47
|
+
"valueOf": PropTypes.func.isRequired
|
|
48
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
49
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
50
|
+
"description": PropTypes.string,
|
|
51
|
+
"toString": PropTypes.func.isRequired,
|
|
52
|
+
"valueOf": PropTypes.func.isRequired
|
|
53
|
+
}), PropTypes.string]),
|
|
54
|
+
"marginLeft": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
55
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
56
|
+
"description": PropTypes.string,
|
|
57
|
+
"toString": PropTypes.func.isRequired,
|
|
58
|
+
"valueOf": PropTypes.func.isRequired
|
|
59
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
60
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
61
|
+
"description": PropTypes.string,
|
|
62
|
+
"toString": PropTypes.func.isRequired,
|
|
63
|
+
"valueOf": PropTypes.func.isRequired
|
|
64
|
+
}), PropTypes.string]),
|
|
65
|
+
"marginRight": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
66
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
67
|
+
"description": PropTypes.string,
|
|
68
|
+
"toString": PropTypes.func.isRequired,
|
|
69
|
+
"valueOf": PropTypes.func.isRequired
|
|
70
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
71
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
72
|
+
"description": PropTypes.string,
|
|
73
|
+
"toString": PropTypes.func.isRequired,
|
|
74
|
+
"valueOf": PropTypes.func.isRequired
|
|
75
|
+
}), PropTypes.string]),
|
|
76
|
+
"marginTop": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
77
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
78
|
+
"description": PropTypes.string,
|
|
79
|
+
"toString": PropTypes.func.isRequired,
|
|
80
|
+
"valueOf": PropTypes.func.isRequired
|
|
81
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
82
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
83
|
+
"description": PropTypes.string,
|
|
84
|
+
"toString": PropTypes.func.isRequired,
|
|
85
|
+
"valueOf": PropTypes.func.isRequired
|
|
86
|
+
}), PropTypes.string]),
|
|
87
|
+
"marginX": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
88
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
89
|
+
"description": PropTypes.string,
|
|
90
|
+
"toString": PropTypes.func.isRequired,
|
|
91
|
+
"valueOf": PropTypes.func.isRequired
|
|
92
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
93
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
94
|
+
"description": PropTypes.string,
|
|
95
|
+
"toString": PropTypes.func.isRequired,
|
|
96
|
+
"valueOf": PropTypes.func.isRequired
|
|
97
|
+
}), PropTypes.string]),
|
|
98
|
+
"marginY": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
99
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
100
|
+
"description": PropTypes.string,
|
|
101
|
+
"toString": PropTypes.func.isRequired,
|
|
102
|
+
"valueOf": PropTypes.func.isRequired
|
|
103
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
104
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
105
|
+
"description": PropTypes.string,
|
|
106
|
+
"toString": PropTypes.func.isRequired,
|
|
107
|
+
"valueOf": PropTypes.func.isRequired
|
|
108
|
+
}), PropTypes.string]),
|
|
109
|
+
"mb": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
110
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
111
|
+
"description": PropTypes.string,
|
|
112
|
+
"toString": PropTypes.func.isRequired,
|
|
113
|
+
"valueOf": PropTypes.func.isRequired
|
|
114
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
115
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
116
|
+
"description": PropTypes.string,
|
|
117
|
+
"toString": PropTypes.func.isRequired,
|
|
118
|
+
"valueOf": PropTypes.func.isRequired
|
|
119
|
+
}), PropTypes.string]),
|
|
120
|
+
"ml": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
121
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
122
|
+
"description": PropTypes.string,
|
|
123
|
+
"toString": PropTypes.func.isRequired,
|
|
124
|
+
"valueOf": PropTypes.func.isRequired
|
|
125
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
126
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
127
|
+
"description": PropTypes.string,
|
|
128
|
+
"toString": PropTypes.func.isRequired,
|
|
129
|
+
"valueOf": PropTypes.func.isRequired
|
|
130
|
+
}), PropTypes.string]),
|
|
131
|
+
"mr": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
132
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
133
|
+
"description": PropTypes.string,
|
|
134
|
+
"toString": PropTypes.func.isRequired,
|
|
135
|
+
"valueOf": PropTypes.func.isRequired
|
|
136
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
137
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
138
|
+
"description": PropTypes.string,
|
|
139
|
+
"toString": PropTypes.func.isRequired,
|
|
140
|
+
"valueOf": PropTypes.func.isRequired
|
|
141
|
+
}), PropTypes.string]),
|
|
142
|
+
"mt": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
143
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
144
|
+
"description": PropTypes.string,
|
|
145
|
+
"toString": PropTypes.func.isRequired,
|
|
146
|
+
"valueOf": PropTypes.func.isRequired
|
|
147
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
148
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
149
|
+
"description": PropTypes.string,
|
|
150
|
+
"toString": PropTypes.func.isRequired,
|
|
151
|
+
"valueOf": PropTypes.func.isRequired
|
|
152
|
+
}), PropTypes.string]),
|
|
153
|
+
"mx": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
154
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
155
|
+
"description": PropTypes.string,
|
|
156
|
+
"toString": PropTypes.func.isRequired,
|
|
157
|
+
"valueOf": PropTypes.func.isRequired
|
|
158
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
159
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
160
|
+
"description": PropTypes.string,
|
|
161
|
+
"toString": PropTypes.func.isRequired,
|
|
162
|
+
"valueOf": PropTypes.func.isRequired
|
|
163
|
+
}), PropTypes.string]),
|
|
164
|
+
"my": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
165
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
166
|
+
"description": PropTypes.string,
|
|
167
|
+
"toString": PropTypes.func.isRequired,
|
|
168
|
+
"valueOf": PropTypes.func.isRequired
|
|
169
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
170
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
171
|
+
"description": PropTypes.string,
|
|
172
|
+
"toString": PropTypes.func.isRequired,
|
|
173
|
+
"valueOf": PropTypes.func.isRequired
|
|
174
|
+
}), PropTypes.string]),
|
|
175
|
+
"p": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
176
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
177
|
+
"description": PropTypes.string,
|
|
178
|
+
"toString": PropTypes.func.isRequired,
|
|
179
|
+
"valueOf": PropTypes.func.isRequired
|
|
180
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
181
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
182
|
+
"description": PropTypes.string,
|
|
183
|
+
"toString": PropTypes.func.isRequired,
|
|
184
|
+
"valueOf": PropTypes.func.isRequired
|
|
185
|
+
}), PropTypes.string]),
|
|
186
|
+
"padding": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
187
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
188
|
+
"description": PropTypes.string,
|
|
189
|
+
"toString": PropTypes.func.isRequired,
|
|
190
|
+
"valueOf": PropTypes.func.isRequired
|
|
191
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
192
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
193
|
+
"description": PropTypes.string,
|
|
194
|
+
"toString": PropTypes.func.isRequired,
|
|
195
|
+
"valueOf": PropTypes.func.isRequired
|
|
196
|
+
}), PropTypes.string]),
|
|
197
|
+
"paddingBottom": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
198
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
199
|
+
"description": PropTypes.string,
|
|
200
|
+
"toString": PropTypes.func.isRequired,
|
|
201
|
+
"valueOf": PropTypes.func.isRequired
|
|
202
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
203
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
204
|
+
"description": PropTypes.string,
|
|
205
|
+
"toString": PropTypes.func.isRequired,
|
|
206
|
+
"valueOf": PropTypes.func.isRequired
|
|
207
|
+
}), PropTypes.string]),
|
|
208
|
+
"paddingLeft": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
209
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
210
|
+
"description": PropTypes.string,
|
|
211
|
+
"toString": PropTypes.func.isRequired,
|
|
212
|
+
"valueOf": PropTypes.func.isRequired
|
|
213
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
214
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
215
|
+
"description": PropTypes.string,
|
|
216
|
+
"toString": PropTypes.func.isRequired,
|
|
217
|
+
"valueOf": PropTypes.func.isRequired
|
|
218
|
+
}), PropTypes.string]),
|
|
219
|
+
"paddingRight": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
220
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
221
|
+
"description": PropTypes.string,
|
|
222
|
+
"toString": PropTypes.func.isRequired,
|
|
223
|
+
"valueOf": PropTypes.func.isRequired
|
|
224
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
225
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
226
|
+
"description": PropTypes.string,
|
|
227
|
+
"toString": PropTypes.func.isRequired,
|
|
228
|
+
"valueOf": PropTypes.func.isRequired
|
|
229
|
+
}), PropTypes.string]),
|
|
230
|
+
"paddingTop": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
231
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
232
|
+
"description": PropTypes.string,
|
|
233
|
+
"toString": PropTypes.func.isRequired,
|
|
234
|
+
"valueOf": PropTypes.func.isRequired
|
|
235
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
236
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
237
|
+
"description": PropTypes.string,
|
|
238
|
+
"toString": PropTypes.func.isRequired,
|
|
239
|
+
"valueOf": PropTypes.func.isRequired
|
|
240
|
+
}), PropTypes.string]),
|
|
241
|
+
"paddingX": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
242
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
243
|
+
"description": PropTypes.string,
|
|
244
|
+
"toString": PropTypes.func.isRequired,
|
|
245
|
+
"valueOf": PropTypes.func.isRequired
|
|
246
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
247
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
248
|
+
"description": PropTypes.string,
|
|
249
|
+
"toString": PropTypes.func.isRequired,
|
|
250
|
+
"valueOf": PropTypes.func.isRequired
|
|
251
|
+
}), PropTypes.string]),
|
|
252
|
+
"paddingY": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
253
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
254
|
+
"description": PropTypes.string,
|
|
255
|
+
"toString": PropTypes.func.isRequired,
|
|
256
|
+
"valueOf": PropTypes.func.isRequired
|
|
257
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
258
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
259
|
+
"description": PropTypes.string,
|
|
260
|
+
"toString": PropTypes.func.isRequired,
|
|
261
|
+
"valueOf": PropTypes.func.isRequired
|
|
262
|
+
}), PropTypes.string]),
|
|
263
|
+
"pb": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
264
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
265
|
+
"description": PropTypes.string,
|
|
266
|
+
"toString": PropTypes.func.isRequired,
|
|
267
|
+
"valueOf": PropTypes.func.isRequired
|
|
268
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
269
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
270
|
+
"description": PropTypes.string,
|
|
271
|
+
"toString": PropTypes.func.isRequired,
|
|
272
|
+
"valueOf": PropTypes.func.isRequired
|
|
273
|
+
}), PropTypes.string]),
|
|
274
|
+
"pl": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
275
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
276
|
+
"description": PropTypes.string,
|
|
277
|
+
"toString": PropTypes.func.isRequired,
|
|
278
|
+
"valueOf": PropTypes.func.isRequired
|
|
279
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
280
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
281
|
+
"description": PropTypes.string,
|
|
282
|
+
"toString": PropTypes.func.isRequired,
|
|
283
|
+
"valueOf": PropTypes.func.isRequired
|
|
284
|
+
}), PropTypes.string]),
|
|
285
|
+
"pr": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
286
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
287
|
+
"description": PropTypes.string,
|
|
288
|
+
"toString": PropTypes.func.isRequired,
|
|
289
|
+
"valueOf": PropTypes.func.isRequired
|
|
290
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
291
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
292
|
+
"description": PropTypes.string,
|
|
293
|
+
"toString": PropTypes.func.isRequired,
|
|
294
|
+
"valueOf": PropTypes.func.isRequired
|
|
295
|
+
}), PropTypes.string]),
|
|
296
|
+
"pt": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
297
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
298
|
+
"description": PropTypes.string,
|
|
299
|
+
"toString": PropTypes.func.isRequired,
|
|
300
|
+
"valueOf": PropTypes.func.isRequired
|
|
301
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
302
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
303
|
+
"description": PropTypes.string,
|
|
304
|
+
"toString": PropTypes.func.isRequired,
|
|
305
|
+
"valueOf": PropTypes.func.isRequired
|
|
306
|
+
}), PropTypes.string]),
|
|
307
|
+
"px": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
308
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
309
|
+
"description": PropTypes.string,
|
|
310
|
+
"toString": PropTypes.func.isRequired,
|
|
311
|
+
"valueOf": PropTypes.func.isRequired
|
|
312
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
313
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
314
|
+
"description": PropTypes.string,
|
|
315
|
+
"toString": PropTypes.func.isRequired,
|
|
316
|
+
"valueOf": PropTypes.func.isRequired
|
|
317
|
+
}), PropTypes.string]),
|
|
318
|
+
"py": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
319
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
320
|
+
"description": PropTypes.string,
|
|
321
|
+
"toString": PropTypes.func.isRequired,
|
|
322
|
+
"valueOf": PropTypes.func.isRequired
|
|
323
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
324
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
325
|
+
"description": PropTypes.string,
|
|
326
|
+
"toString": PropTypes.func.isRequired,
|
|
327
|
+
"valueOf": PropTypes.func.isRequired
|
|
328
|
+
}), PropTypes.string])
|
|
24
329
|
};
|
|
25
330
|
export default Dd;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface StyledDlProps {
|
|
2
|
+
/** Render the DefinitionList as a single column */
|
|
3
|
+
asSingleColumn?: boolean;
|
|
4
|
+
/** This value will specify the width of the `StyledDtDiv` as a percentage. The remaining space will be taken up
|
|
5
|
+
by the `StyledDdDiv`. This prop has no effect when `asSingleColumn` is set.
|
|
6
|
+
*/
|
|
7
|
+
w?: number;
|
|
8
|
+
}
|
|
9
|
+
export declare type ElementAlignment = "left" | "center" | "right";
|
|
10
|
+
export declare const StyledDl: import("styled-components").StyledComponent<"dl", any, StyledDlProps, never>;
|
|
11
|
+
export interface StyledDtDivProps {
|
|
12
|
+
/** This string will specify the text align styling of the `<dt></dt>`. */
|
|
13
|
+
dtTextAlign?: ElementAlignment;
|
|
14
|
+
}
|
|
15
|
+
export declare const StyledDtDiv: import("styled-components").StyledComponent<"div", any, StyledDtDivProps, never>;
|
|
16
|
+
export interface StyledDdDivProps {
|
|
17
|
+
/** This string will specify the text align styling of the `<dd></dd>`. */
|
|
18
|
+
ddTextAlign?: ElementAlignment;
|
|
19
|
+
}
|
|
20
|
+
export declare const StyledDdDiv: import("styled-components").StyledComponent<"div", any, StyledDdDivProps, never>;
|
|
21
|
+
export declare const StyledDt: import("styled-components").StyledComponent<"dt", any, {}, never>;
|
|
22
|
+
export declare const StyledDd: import("styled-components").StyledComponent<"dd", any, {}, never>;
|
|
@@ -7,14 +7,13 @@ export const StyledDl = styled.dl`
|
|
|
7
7
|
${space}
|
|
8
8
|
|
|
9
9
|
${({
|
|
10
|
-
asSingleColumn
|
|
10
|
+
asSingleColumn,
|
|
11
|
+
w
|
|
11
12
|
}) => css`
|
|
12
13
|
${!asSingleColumn && css`
|
|
13
14
|
display: grid;
|
|
14
15
|
grid-template-rows: auto;
|
|
15
|
-
grid-template-columns: ${
|
|
16
|
-
w
|
|
17
|
-
}) => `${w}% auto;`};
|
|
16
|
+
grid-template-columns: ${w}% auto;
|
|
18
17
|
`}
|
|
19
18
|
${asSingleColumn && css`
|
|
20
19
|
line-height: 21px;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { SpaceProps } from "styled-system";
|
|
3
|
+
import { StyledDtDivProps, StyledDdDivProps, StyledDlProps } from "./definition-list.style";
|
|
4
|
+
export interface DlProps extends SpaceProps, StyledDlProps, StyledDtDivProps, StyledDdDivProps {
|
|
5
|
+
/** prop to render children. */
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
declare const Dl: ({ children, w, dtTextAlign, ddTextAlign, asSingleColumn, ...rest }: DlProps) => JSX.Element;
|
|
9
|
+
export default Dl;
|