@ultraviolet/ui 1.8.4 → 1.10.0
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/dist/index.d.ts +56 -73
- package/dist/src/components/Checkbox/index.js +266 -146
- package/dist/src/components/Modal/Dialog.js +151 -0
- package/dist/src/components/Modal/Disclosure.js +38 -0
- package/dist/src/components/Modal/Modal.js +110 -0
- package/dist/src/components/Modal/constants.js +50 -0
- package/dist/src/components/RadioGroup/index.js +131 -0
- package/dist/src/components/Toggle/index.js +70 -40
- package/dist/src/index.js +2 -1
- package/package.json +3 -3
- package/dist/src/components/Modal/index.js +0 -283
|
@@ -3,55 +3,54 @@ import { useTheme } from '@emotion/react';
|
|
|
3
3
|
import { Icon } from '@ultraviolet/icons';
|
|
4
4
|
import { forwardRef, useState, useId, useEffect, useCallback } from 'react';
|
|
5
5
|
import { Loader } from '../Loader/index.js';
|
|
6
|
+
import { Row } from '../Row/index.js';
|
|
7
|
+
import { Stack } from '../Stack/index.js';
|
|
6
8
|
import { Text } from '../Text/index.js';
|
|
7
|
-
import { jsxs,
|
|
9
|
+
import { jsxs, jsx } from '@emotion/react/jsx-runtime';
|
|
8
10
|
|
|
9
11
|
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
10
|
-
const
|
|
12
|
+
const ErrorText = /*#__PURE__*/_styled(Text, {
|
|
11
13
|
target: "eqr7bqq7"
|
|
12
|
-
})("
|
|
14
|
+
})("padding-top:", _ref => {
|
|
13
15
|
let {
|
|
14
16
|
theme
|
|
15
17
|
} = _ref;
|
|
16
|
-
return theme.
|
|
17
|
-
}, ";
|
|
18
|
+
return `${theme.space['0.5']}`;
|
|
19
|
+
}, ";");
|
|
20
|
+
const InnerCheckbox = /*#__PURE__*/_styled("rect", {
|
|
21
|
+
target: "eqr7bqq6"
|
|
22
|
+
})("fill:", _ref2 => {
|
|
18
23
|
let {
|
|
19
24
|
theme
|
|
20
25
|
} = _ref2;
|
|
21
|
-
return theme.colors.neutral.
|
|
26
|
+
return theme.colors.neutral.background;
|
|
27
|
+
}, ";stroke:", _ref3 => {
|
|
28
|
+
let {
|
|
29
|
+
theme
|
|
30
|
+
} = _ref3;
|
|
31
|
+
return theme.colors.neutral.border;
|
|
22
32
|
}, ";");
|
|
23
|
-
const CheckMark = /*#__PURE__*/_styled("rect", {
|
|
24
|
-
target: "eqr7bqq6"
|
|
25
|
-
})();
|
|
26
33
|
const CheckMixedMark = /*#__PURE__*/_styled("rect", {
|
|
27
34
|
target: "eqr7bqq5"
|
|
28
35
|
})();
|
|
29
|
-
const CheckboxIconContainer =
|
|
36
|
+
const CheckboxIconContainer = _ref4 => {
|
|
30
37
|
let {
|
|
31
38
|
children
|
|
32
|
-
} =
|
|
39
|
+
} = _ref4;
|
|
33
40
|
const theme = useTheme();
|
|
34
41
|
return jsxs("g", {
|
|
35
42
|
children: [jsx(InnerCheckbox, {
|
|
36
|
-
x: "
|
|
37
|
-
y: "
|
|
38
|
-
width: "
|
|
39
|
-
height: "
|
|
43
|
+
x: "2",
|
|
44
|
+
y: "2",
|
|
45
|
+
width: "20",
|
|
46
|
+
height: "20",
|
|
40
47
|
rx: theme.radii.small,
|
|
41
48
|
strokeWidth: "2"
|
|
42
49
|
}), children]
|
|
43
50
|
});
|
|
44
51
|
};
|
|
45
|
-
const PaddedText = /*#__PURE__*/_styled(Text, {
|
|
46
|
-
target: "eqr7bqq4"
|
|
47
|
-
})("padding:", _ref4 => {
|
|
48
|
-
let {
|
|
49
|
-
theme
|
|
50
|
-
} = _ref4;
|
|
51
|
-
return `0 ${theme.space['0.5']}`;
|
|
52
|
-
}, ";");
|
|
53
52
|
const StyledIcon = /*#__PURE__*/_styled('svg', {
|
|
54
|
-
target: "
|
|
53
|
+
target: "eqr7bqq4"
|
|
55
54
|
})("border-radius:", _ref5 => {
|
|
56
55
|
let {
|
|
57
56
|
theme
|
|
@@ -77,149 +76,257 @@ const StyledIcon = /*#__PURE__*/_styled('svg', {
|
|
|
77
76
|
size
|
|
78
77
|
} = _ref9;
|
|
79
78
|
return size;
|
|
80
|
-
}, "px
|
|
79
|
+
}, "px;& path{fill:", _ref10 => {
|
|
80
|
+
let {
|
|
81
|
+
theme
|
|
82
|
+
} = _ref10;
|
|
83
|
+
return theme.colors.neutral.background;
|
|
84
|
+
}, ";transform:translate(2px, 2px);transform:scale(0);}");
|
|
85
|
+
const StyledLabel = /*#__PURE__*/_styled('label', {
|
|
86
|
+
target: "eqr7bqq3"
|
|
87
|
+
})();
|
|
81
88
|
const CheckboxInput = /*#__PURE__*/_styled('input', {
|
|
82
89
|
shouldForwardProp: prop => !['size'].includes(prop),
|
|
83
90
|
target: "eqr7bqq2"
|
|
84
|
-
})("position:absolute;white-space:nowrap;height:",
|
|
85
|
-
let {
|
|
86
|
-
size
|
|
87
|
-
} = _ref10;
|
|
88
|
-
return size;
|
|
89
|
-
}, "px;width:", _ref11 => {
|
|
91
|
+
})("position:absolute;white-space:nowrap;height:", _ref11 => {
|
|
90
92
|
let {
|
|
91
93
|
size
|
|
92
94
|
} = _ref11;
|
|
93
95
|
return size;
|
|
94
|
-
}, "px;
|
|
96
|
+
}, "px;width:", _ref12 => {
|
|
95
97
|
let {
|
|
96
|
-
|
|
98
|
+
size
|
|
97
99
|
} = _ref12;
|
|
98
|
-
return
|
|
99
|
-
}, ";",
|
|
100
|
+
return size;
|
|
101
|
+
}, "px;opacity:0;border-width:0;&:not(:disabled){cursor:pointer;}&:disabled{cursor:not-allowed;}&:not(:disabled){&:checked+", StyledIcon, ",&[aria-checked='mixed']+", StyledIcon, "{fill:", _ref13 => {
|
|
100
102
|
let {
|
|
101
103
|
theme
|
|
102
104
|
} = _ref13;
|
|
103
105
|
return theme.colors.primary.backgroundStrong;
|
|
104
|
-
}, ";
|
|
106
|
+
}, ";", InnerCheckbox, "{stroke:", _ref14 => {
|
|
105
107
|
let {
|
|
106
108
|
theme
|
|
107
109
|
} = _ref14;
|
|
108
|
-
return theme.colors.
|
|
109
|
-
}, ";",
|
|
110
|
+
return theme.colors.primary.backgroundStrong;
|
|
111
|
+
}, ";}}&[aria-invalid='true']+", StyledIcon, ",&[aria-invalid='mixed']+", StyledIcon, "{fill:", _ref15 => {
|
|
110
112
|
let {
|
|
111
113
|
theme
|
|
112
114
|
} = _ref15;
|
|
113
|
-
return theme.colors.danger.
|
|
114
|
-
}, ";
|
|
115
|
+
return theme.colors.danger.background;
|
|
116
|
+
}, ";", InnerCheckbox, "{stroke:", _ref16 => {
|
|
115
117
|
let {
|
|
116
118
|
theme
|
|
117
119
|
} = _ref16;
|
|
118
|
-
return theme.colors.
|
|
119
|
-
}, ";
|
|
120
|
+
return theme.colors.danger.border;
|
|
121
|
+
}, ";}}}&:focus+", StyledIcon, "{background-color:", _ref17 => {
|
|
120
122
|
let {
|
|
121
123
|
theme
|
|
122
124
|
} = _ref17;
|
|
123
|
-
return theme.colors.primary.
|
|
124
|
-
}, ";
|
|
125
|
+
return theme.colors.primary.background;
|
|
126
|
+
}, ";fill:", _ref18 => {
|
|
125
127
|
let {
|
|
126
128
|
theme
|
|
127
129
|
} = _ref18;
|
|
128
|
-
return theme.colors.
|
|
129
|
-
}, ";
|
|
130
|
+
return theme.colors.danger.background;
|
|
131
|
+
}, ";outline:2px solid ", _ref19 => {
|
|
130
132
|
let {
|
|
131
133
|
theme
|
|
132
134
|
} = _ref19;
|
|
133
|
-
return theme.colors.primary.
|
|
134
|
-
}, ";
|
|
135
|
+
return theme.colors.primary.backgroundHover;
|
|
136
|
+
}, ";", InnerCheckbox, "{stroke:", _ref20 => {
|
|
135
137
|
let {
|
|
136
138
|
theme
|
|
137
139
|
} = _ref20;
|
|
138
|
-
return theme.colors.
|
|
140
|
+
return theme.colors.primary.borderHover;
|
|
139
141
|
}, ";fill:", _ref21 => {
|
|
140
142
|
let {
|
|
141
143
|
theme
|
|
142
144
|
} = _ref21;
|
|
143
|
-
return theme.colors.
|
|
144
|
-
}, ";",
|
|
145
|
+
return theme.colors.primary.backgroundHover;
|
|
146
|
+
}, ";}}&[aria-invalid='true']:focus+", StyledIcon, "{background-color:", _ref22 => {
|
|
145
147
|
let {
|
|
146
148
|
theme
|
|
147
149
|
} = _ref22;
|
|
148
|
-
return theme.colors.danger.
|
|
150
|
+
return theme.colors.danger.background;
|
|
149
151
|
}, ";fill:", _ref23 => {
|
|
150
152
|
let {
|
|
151
153
|
theme
|
|
152
154
|
} = _ref23;
|
|
153
155
|
return theme.colors.danger.background;
|
|
154
|
-
}, ";
|
|
155
|
-
const CheckboxContainer = /*#__PURE__*/_styled("div", {
|
|
156
|
-
target: "eqr7bqq1"
|
|
157
|
-
})("position:relative;display:inline-flex;align-items:center;gap:", _ref24 => {
|
|
156
|
+
}, ";outline:2px solid ", _ref24 => {
|
|
158
157
|
let {
|
|
159
158
|
theme
|
|
160
159
|
} = _ref24;
|
|
161
|
-
return theme.
|
|
162
|
-
}, "
|
|
160
|
+
return theme.colors.danger.backgroundHover;
|
|
161
|
+
}, ";", InnerCheckbox, "{stroke:", _ref25 => {
|
|
163
162
|
let {
|
|
164
163
|
theme
|
|
165
164
|
} = _ref25;
|
|
166
|
-
return theme.colors.
|
|
167
|
-
}, "
|
|
165
|
+
return theme.colors.danger.borderHover;
|
|
166
|
+
}, ";fill:", _ref26 => {
|
|
168
167
|
let {
|
|
169
168
|
theme
|
|
170
169
|
} = _ref26;
|
|
171
|
-
return theme.colors.
|
|
172
|
-
}, ";"
|
|
170
|
+
return theme.colors.danger.backgroundHover;
|
|
171
|
+
}, ";}}");
|
|
172
|
+
const CheckboxContainer = /*#__PURE__*/_styled("div", {
|
|
173
|
+
target: "eqr7bqq1"
|
|
174
|
+
})("position:relative;display:inline-flex;align-items:start;gap:", _ref27 => {
|
|
173
175
|
let {
|
|
174
176
|
theme
|
|
175
177
|
} = _ref27;
|
|
176
|
-
return theme.
|
|
177
|
-
}, ";
|
|
178
|
+
return theme.space['1'];
|
|
179
|
+
}, ";", StyledLabel, "{cursor:pointer;}&[aria-disabled='true']{cursor:not-allowed;color:", _ref28 => {
|
|
178
180
|
let {
|
|
179
181
|
theme
|
|
180
182
|
} = _ref28;
|
|
181
|
-
return theme.colors.neutral.
|
|
182
|
-
}, ";
|
|
183
|
+
return theme.colors.neutral.textDisabled;
|
|
184
|
+
}, ";", StyledLabel, "{cursor:not-allowed;}", StyledIcon, "{fill:", _ref29 => {
|
|
183
185
|
let {
|
|
184
186
|
theme
|
|
185
187
|
} = _ref29;
|
|
186
|
-
return theme.colors.
|
|
187
|
-
}, ";
|
|
188
|
+
return theme.colors.neutral.borderDisabled;
|
|
189
|
+
}, ";", InnerCheckbox, "{stroke:", _ref30 => {
|
|
188
190
|
let {
|
|
189
191
|
theme
|
|
190
192
|
} = _ref30;
|
|
191
|
-
return theme.colors.
|
|
192
|
-
}, ";
|
|
193
|
+
return theme.colors.neutral.borderDisabled;
|
|
194
|
+
}, ";fill:", _ref31 => {
|
|
193
195
|
let {
|
|
194
196
|
theme
|
|
195
197
|
} = _ref31;
|
|
196
|
-
return theme.colors.
|
|
197
|
-
}, ";fill:", _ref32 => {
|
|
198
|
+
return theme.colors.neutral.backgroundDisabled;
|
|
199
|
+
}, ";}}", CheckboxInput, "[aria-invalid=\"true\"]:checked+", StyledIcon, "{fill:", _ref32 => {
|
|
198
200
|
let {
|
|
199
201
|
theme
|
|
200
202
|
} = _ref32;
|
|
201
|
-
return theme.colors.
|
|
202
|
-
}, ";
|
|
203
|
+
return theme.colors.danger.borderDisabled;
|
|
204
|
+
}, ";", InnerCheckbox, "{stroke:", _ref33 => {
|
|
203
205
|
let {
|
|
204
206
|
theme
|
|
205
207
|
} = _ref33;
|
|
206
|
-
return theme.colors.danger.
|
|
208
|
+
return theme.colors.danger.borderDisabled;
|
|
207
209
|
}, ";fill:", _ref34 => {
|
|
208
210
|
let {
|
|
209
211
|
theme
|
|
210
212
|
} = _ref34;
|
|
211
|
-
return theme.colors.danger.
|
|
212
|
-
}, ";",
|
|
213
|
+
return theme.colors.danger.borderDisabled;
|
|
214
|
+
}, ";}}", CheckboxInput, "[aria-invalid=\"true\"]+", StyledIcon, "{fill:", _ref35 => {
|
|
213
215
|
let {
|
|
214
216
|
theme
|
|
215
217
|
} = _ref35;
|
|
216
|
-
return theme.colors.danger.
|
|
217
|
-
}, ";
|
|
218
|
+
return theme.colors.danger.background;
|
|
219
|
+
}, ";", InnerCheckbox, "{stroke:", _ref36 => {
|
|
218
220
|
let {
|
|
219
221
|
theme
|
|
220
222
|
} = _ref36;
|
|
223
|
+
return theme.colors.danger.borderDisabled;
|
|
224
|
+
}, ";fill:", _ref37 => {
|
|
225
|
+
let {
|
|
226
|
+
theme
|
|
227
|
+
} = _ref37;
|
|
221
228
|
return theme.colors.danger.background;
|
|
222
|
-
}, ";}}
|
|
229
|
+
}, ";}}", CheckboxInput, ":checked+", StyledIcon, "{fill:", _ref38 => {
|
|
230
|
+
let {
|
|
231
|
+
theme
|
|
232
|
+
} = _ref38;
|
|
233
|
+
return theme.colors.primary.borderDisabled;
|
|
234
|
+
}, ";", InnerCheckbox, "{stroke:", _ref39 => {
|
|
235
|
+
let {
|
|
236
|
+
theme
|
|
237
|
+
} = _ref39;
|
|
238
|
+
return theme.colors.primary.borderDisabled;
|
|
239
|
+
}, ";fill:", _ref40 => {
|
|
240
|
+
let {
|
|
241
|
+
theme
|
|
242
|
+
} = _ref40;
|
|
243
|
+
return theme.colors.primary.borderDisabled;
|
|
244
|
+
}, ";}}", CheckboxInput, "[aria-checked=\"mixed\"]+", StyledIcon, "{fill:", _ref41 => {
|
|
245
|
+
let {
|
|
246
|
+
theme
|
|
247
|
+
} = _ref41;
|
|
248
|
+
return theme.colors.primary.borderDisabled;
|
|
249
|
+
}, ";", InnerCheckbox, "{stroke:", _ref42 => {
|
|
250
|
+
let {
|
|
251
|
+
theme
|
|
252
|
+
} = _ref42;
|
|
253
|
+
return theme.colors.primary.borderDisabled;
|
|
254
|
+
}, ";fill:", _ref43 => {
|
|
255
|
+
let {
|
|
256
|
+
theme
|
|
257
|
+
} = _ref43;
|
|
258
|
+
return theme.colors.primary.borderDisabled;
|
|
259
|
+
}, ";}}}", CheckboxInput, ":checked+", StyledIcon, " path{transform-origin:center;transition:200ms transform ease-in-out;transform:scale(1);transform:translate(2px, 2px);}", CheckboxInput, ":checked+", StyledIcon, " ", InnerCheckbox, "{fill:", _ref44 => {
|
|
260
|
+
let {
|
|
261
|
+
theme
|
|
262
|
+
} = _ref44;
|
|
263
|
+
return theme.colors.primary.border;
|
|
264
|
+
}, ";stroke:", _ref45 => {
|
|
265
|
+
let {
|
|
266
|
+
theme
|
|
267
|
+
} = _ref45;
|
|
268
|
+
return theme.colors.primary.border;
|
|
269
|
+
}, ";}", CheckboxInput, "[aria-invalid=\"true\"]:checked+", StyledIcon, " ", InnerCheckbox, "{fill:", _ref46 => {
|
|
270
|
+
let {
|
|
271
|
+
theme
|
|
272
|
+
} = _ref46;
|
|
273
|
+
return theme.colors.danger.border;
|
|
274
|
+
}, ";stroke:", _ref47 => {
|
|
275
|
+
let {
|
|
276
|
+
theme
|
|
277
|
+
} = _ref47;
|
|
278
|
+
return theme.colors.danger.border;
|
|
279
|
+
}, ";}", CheckboxInput, "[aria-checked=\"mixed\"]+", StyledIcon, "{", CheckMixedMark, "{fill:", _ref48 => {
|
|
280
|
+
let {
|
|
281
|
+
theme
|
|
282
|
+
} = _ref48;
|
|
283
|
+
return theme.colors.neutral.iconStronger;
|
|
284
|
+
}, ";}", InnerCheckbox, "{fill:", _ref49 => {
|
|
285
|
+
let {
|
|
286
|
+
theme
|
|
287
|
+
} = _ref49;
|
|
288
|
+
return theme.colors.primary.border;
|
|
289
|
+
}, ";stroke:", _ref50 => {
|
|
290
|
+
let {
|
|
291
|
+
theme
|
|
292
|
+
} = _ref50;
|
|
293
|
+
return theme.colors.primary.border;
|
|
294
|
+
}, ";}}&:hover[aria-disabled='false']{", CheckboxInput, "[aria-invalid='false']{&[aria-checked='false']+", StyledIcon, " ", InnerCheckbox, "{stroke:", _ref51 => {
|
|
295
|
+
let {
|
|
296
|
+
theme
|
|
297
|
+
} = _ref51;
|
|
298
|
+
return theme.colors.primary.borderHover;
|
|
299
|
+
}, ";fill:", _ref52 => {
|
|
300
|
+
let {
|
|
301
|
+
theme
|
|
302
|
+
} = _ref52;
|
|
303
|
+
return theme.colors.primary.backgroundHover;
|
|
304
|
+
}, ";}}", CheckboxInput, "[aria-invalid='true']{&[aria-checked='false']+", StyledIcon, " ", InnerCheckbox, "{stroke:", _ref53 => {
|
|
305
|
+
let {
|
|
306
|
+
theme
|
|
307
|
+
} = _ref53;
|
|
308
|
+
return theme.colors.danger.borderHover;
|
|
309
|
+
}, ";fill:", _ref54 => {
|
|
310
|
+
let {
|
|
311
|
+
theme
|
|
312
|
+
} = _ref54;
|
|
313
|
+
return theme.colors.danger.backgroundHover;
|
|
314
|
+
}, ";}}}", CheckboxInput, "[aria-invalid=\"true\"]+", StyledIcon, "{fill:", _ref55 => {
|
|
315
|
+
let {
|
|
316
|
+
theme
|
|
317
|
+
} = _ref55;
|
|
318
|
+
return theme.colors.danger.backgroundStrong;
|
|
319
|
+
}, ";", InnerCheckbox, "{stroke:", _ref56 => {
|
|
320
|
+
let {
|
|
321
|
+
theme
|
|
322
|
+
} = _ref56;
|
|
323
|
+
return theme.colors.danger.backgroundStrong;
|
|
324
|
+
}, ";fill:", _ref57 => {
|
|
325
|
+
let {
|
|
326
|
+
theme
|
|
327
|
+
} = _ref57;
|
|
328
|
+
return theme.colors.danger.background;
|
|
329
|
+
}, ";}}");
|
|
223
330
|
const StyledActivityContainer = /*#__PURE__*/_styled("div", {
|
|
224
331
|
target: "eqr7bqq0"
|
|
225
332
|
})(process.env.NODE_ENV === "production" ? {
|
|
@@ -230,7 +337,7 @@ const StyledActivityContainer = /*#__PURE__*/_styled("div", {
|
|
|
230
337
|
styles: "display:flex",
|
|
231
338
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
232
339
|
});
|
|
233
|
-
const Checkbox = /*#__PURE__*/forwardRef((
|
|
340
|
+
const Checkbox = /*#__PURE__*/forwardRef((_ref58, ref) => {
|
|
234
341
|
let {
|
|
235
342
|
checked = false,
|
|
236
343
|
onChange,
|
|
@@ -238,6 +345,7 @@ const Checkbox = /*#__PURE__*/forwardRef((_ref37, ref) => {
|
|
|
238
345
|
onBlur,
|
|
239
346
|
error,
|
|
240
347
|
name,
|
|
348
|
+
helper,
|
|
241
349
|
value,
|
|
242
350
|
size = 24,
|
|
243
351
|
children,
|
|
@@ -249,7 +357,7 @@ const Checkbox = /*#__PURE__*/forwardRef((_ref37, ref) => {
|
|
|
249
357
|
'aria-label': ariaLabel,
|
|
250
358
|
required,
|
|
251
359
|
'data-testid': dataTestId
|
|
252
|
-
} =
|
|
360
|
+
} = _ref58;
|
|
253
361
|
const [state, setState] = useState(checked);
|
|
254
362
|
const id = useId();
|
|
255
363
|
const computedName = name ?? id;
|
|
@@ -266,72 +374,84 @@ const Checkbox = /*#__PURE__*/forwardRef((_ref37, ref) => {
|
|
|
266
374
|
setState(current => !current);
|
|
267
375
|
}
|
|
268
376
|
}, []);
|
|
269
|
-
return jsxs(
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
children:
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
children:
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
})]
|
|
318
|
-
})
|
|
319
|
-
}) : null, children ? jsx("label", {
|
|
320
|
-
htmlFor: computedName,
|
|
321
|
-
children: children
|
|
322
|
-
}) : null, required ? jsx("sup", {
|
|
323
|
-
children: jsx(Icon, {
|
|
324
|
-
name: "asterisk",
|
|
325
|
-
size: 10,
|
|
326
|
-
color: "danger"
|
|
377
|
+
return jsxs(CheckboxContainer, {
|
|
378
|
+
className: className,
|
|
379
|
+
"aria-disabled": disabled,
|
|
380
|
+
"data-visibility": dataVisibility,
|
|
381
|
+
"data-checked": state,
|
|
382
|
+
"data-error": !!error,
|
|
383
|
+
"data-testid": dataTestId,
|
|
384
|
+
children: [progress ? jsx(StyledActivityContainer, {
|
|
385
|
+
children: jsx(Loader, {
|
|
386
|
+
active: true,
|
|
387
|
+
size: size
|
|
388
|
+
})
|
|
389
|
+
}) : null, jsx(CheckboxInput, {
|
|
390
|
+
id: computedName,
|
|
391
|
+
type: "checkbox",
|
|
392
|
+
"aria-invalid": !!error,
|
|
393
|
+
"aria-describedby": error ? `${computedName}-hint` : undefined,
|
|
394
|
+
"aria-checked": state === 'indeterminate' ? 'mixed' : state,
|
|
395
|
+
"aria-label": ariaLabel,
|
|
396
|
+
checked: state === 'indeterminate' ? false : state,
|
|
397
|
+
size: size,
|
|
398
|
+
onChange: onLocalChange,
|
|
399
|
+
onKeyDown: onKeyDown,
|
|
400
|
+
onFocus: onFocus,
|
|
401
|
+
onBlur: onBlur,
|
|
402
|
+
disabled: disabled,
|
|
403
|
+
value: value,
|
|
404
|
+
name: computedName,
|
|
405
|
+
autoFocus: autoFocus,
|
|
406
|
+
ref: ref,
|
|
407
|
+
required: required
|
|
408
|
+
}), !progress ? jsx(StyledIcon, {
|
|
409
|
+
size: size,
|
|
410
|
+
viewBox: "0 0 24 24",
|
|
411
|
+
children: jsx(CheckboxIconContainer, {
|
|
412
|
+
children: state !== 'indeterminate' ? jsx("path", {
|
|
413
|
+
fillRule: "evenodd",
|
|
414
|
+
clipRule: "evenodd",
|
|
415
|
+
width: 14,
|
|
416
|
+
height: 14,
|
|
417
|
+
d: "M15.6678 5.26709C16.0849 5.6463 16.113 6.28907 15.7307 6.70276L9.29172 13.6705C9.10291 13.8748 8.83818 13.9937 8.55884 13.9998C8.2795 14.0058 8.0098 13.8984 7.81223 13.7024L4.30004 10.2185C3.89999 9.82169 3.89999 9.17831 4.30004 8.78149C4.70009 8.38467 5.34869 8.38467 5.74874 8.78149L8.50441 11.5149L14.2205 5.32951C14.6028 4.91583 15.2508 4.88788 15.6678 5.26709Z",
|
|
418
|
+
fill: "white"
|
|
419
|
+
}) : jsx(CheckMixedMark, {
|
|
420
|
+
x: "6",
|
|
421
|
+
y: "11",
|
|
422
|
+
rx: "1",
|
|
423
|
+
width: "12",
|
|
424
|
+
height: "2"
|
|
327
425
|
})
|
|
426
|
+
})
|
|
427
|
+
}) : null, jsxs(Stack, {
|
|
428
|
+
gap: 0.25,
|
|
429
|
+
children: [jsxs(Row, {
|
|
430
|
+
templateColumns: "11fr 1fr",
|
|
431
|
+
alignItems: "center",
|
|
432
|
+
children: [children ? jsx(StyledLabel, {
|
|
433
|
+
htmlFor: computedName,
|
|
434
|
+
children: children
|
|
435
|
+
}) : null, required ? jsx("sup", {
|
|
436
|
+
children: jsx(Icon, {
|
|
437
|
+
name: "asterisk",
|
|
438
|
+
size: 10,
|
|
439
|
+
color: "danger"
|
|
440
|
+
})
|
|
441
|
+
}) : null]
|
|
442
|
+
}), helper ? jsx(Text, {
|
|
443
|
+
variant: "bodySmall",
|
|
444
|
+
as: "p",
|
|
445
|
+
prominence: "weak",
|
|
446
|
+
color: "neutral",
|
|
447
|
+
children: helper
|
|
448
|
+
}) : null, error ? jsx(ErrorText, {
|
|
449
|
+
variant: "bodySmall",
|
|
450
|
+
as: "p",
|
|
451
|
+
color: "danger",
|
|
452
|
+
children: error
|
|
328
453
|
}) : null]
|
|
329
|
-
})
|
|
330
|
-
variant: "bodySmall",
|
|
331
|
-
as: "p",
|
|
332
|
-
color: "danger",
|
|
333
|
-
children: error
|
|
334
|
-
}) : null]
|
|
454
|
+
})]
|
|
335
455
|
});
|
|
336
456
|
});
|
|
337
457
|
|