@raspberrypifoundation/design-system-react 1.7.0 → 2.0.0-beta.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/CHANGELOG.md +8 -0
- package/README.md +64 -10
- package/dist/rpf-design-system-react.css +1 -0
- package/dist/rpf-design-system-react.js +2744 -0
- package/dist/rpf-design-system-react.umd.cjs +35 -0
- package/dist/scss/components/accordion.scss +94 -0
- package/dist/scss/components/alert.scss +131 -0
- package/dist/scss/components/burger-menu.scss +89 -0
- package/dist/scss/components/button.scss +321 -0
- package/dist/scss/components/forms/error-message.scss +20 -0
- package/dist/scss/components/forms/fieldset.scss +42 -0
- package/dist/scss/components/forms/input-checkbox.scss +62 -0
- package/dist/scss/components/forms/input-label.scss +36 -0
- package/dist/scss/components/forms/input-number.scss +61 -0
- package/dist/scss/components/forms/input-password.scss +109 -0
- package/dist/scss/components/forms/input-radio.scss +63 -0
- package/dist/scss/components/forms/input-search.scss +65 -0
- package/dist/scss/components/forms/input-select.scss +14 -0
- package/dist/scss/components/forms/input-text.scss +5 -0
- package/dist/scss/components/forms/input-textarea.scss +12 -0
- package/dist/scss/components/forms/inputs.scss +40 -0
- package/dist/scss/components/layout/decorative-section.scss +185 -0
- package/dist/scss/components/link.scss +51 -0
- package/dist/scss/components/menu-item.scss +66 -0
- package/dist/scss/components/menu-title.scss +25 -0
- package/dist/scss/components/menu.scss +31 -0
- package/dist/scss/components/progress-bar.scss +43 -0
- package/dist/scss/components/squiggle.scss +46 -0
- package/dist/scss/components/table/table-cell.scss +82 -0
- package/dist/scss/components/table/table.scss +32 -0
- package/dist/scss/components/tag.scss +50 -0
- package/dist/scss/design-system-core.scss +37 -0
- package/dist/scss/mixins/_inputs.scss +19 -0
- package/dist/scss/mixins/_typography.scss +75 -0
- package/dist/scss/properties/_border.scss +13 -0
- package/dist/scss/properties/_font-size.scss +14 -0
- package/dist/scss/properties/_font-weight.scss +4 -0
- package/dist/scss/properties/_line-height.scss +15 -0
- package/dist/scss/properties/_shadows.scss +7 -0
- package/dist/scss/properties/_sizing.scss +6 -0
- package/dist/scss/properties/_spacing.scss +16 -0
- package/dist/scss/properties/colors/_alert.scss +10 -0
- package/dist/scss/properties/colors/_brand.scss +14 -0
- package/dist/scss/properties/colors/_decorative.scss +58 -0
- package/dist/scss/properties/colors/_greys.scss +18 -0
- package/dist/scss/properties/colors/_inputs.scss +13 -0
- package/dist/scss/properties/colors/_text.scss +7 -0
- package/package.json +61 -83
- package/dist/cjs/bundle.js +0 -1821
- package/dist/esm/bundle.js +0 -1803
package/dist/esm/bundle.js
DELETED
|
@@ -1,1803 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Link } from 'react-router-dom';
|
|
3
|
-
|
|
4
|
-
function getDefaultExportFromCjs (x) {
|
|
5
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
var classnames = {exports: {}};
|
|
9
|
-
|
|
10
|
-
/*!
|
|
11
|
-
Copyright (c) 2018 Jed Watson.
|
|
12
|
-
Licensed under the MIT License (MIT), see
|
|
13
|
-
http://jedwatson.github.io/classnames
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
(function (module) {
|
|
17
|
-
/* global define */
|
|
18
|
-
|
|
19
|
-
(function () {
|
|
20
|
-
|
|
21
|
-
var hasOwn = {}.hasOwnProperty;
|
|
22
|
-
|
|
23
|
-
function classNames () {
|
|
24
|
-
var classes = '';
|
|
25
|
-
|
|
26
|
-
for (var i = 0; i < arguments.length; i++) {
|
|
27
|
-
var arg = arguments[i];
|
|
28
|
-
if (arg) {
|
|
29
|
-
classes = appendClass(classes, parseValue(arg));
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
return classes;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
function parseValue (arg) {
|
|
37
|
-
if (typeof arg === 'string' || typeof arg === 'number') {
|
|
38
|
-
return arg;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
if (typeof arg !== 'object') {
|
|
42
|
-
return '';
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
if (Array.isArray(arg)) {
|
|
46
|
-
return classNames.apply(null, arg);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
|
|
50
|
-
return arg.toString();
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
var classes = '';
|
|
54
|
-
|
|
55
|
-
for (var key in arg) {
|
|
56
|
-
if (hasOwn.call(arg, key) && arg[key]) {
|
|
57
|
-
classes = appendClass(classes, key);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
return classes;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
function appendClass (value, newClass) {
|
|
65
|
-
if (!newClass) {
|
|
66
|
-
return value;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
if (value) {
|
|
70
|
-
return value + ' ' + newClass;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
return value + newClass;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
if (module.exports) {
|
|
77
|
-
classNames.default = classNames;
|
|
78
|
-
module.exports = classNames;
|
|
79
|
-
} else {
|
|
80
|
-
window.classNames = classNames;
|
|
81
|
-
}
|
|
82
|
-
}());
|
|
83
|
-
} (classnames));
|
|
84
|
-
|
|
85
|
-
var classnamesExports = classnames.exports;
|
|
86
|
-
var classNames = /*@__PURE__*/getDefaultExportFromCjs(classnamesExports);
|
|
87
|
-
|
|
88
|
-
var propTypes = {exports: {}};
|
|
89
|
-
|
|
90
|
-
var reactIs = {exports: {}};
|
|
91
|
-
|
|
92
|
-
var reactIs_development = {};
|
|
93
|
-
|
|
94
|
-
/** @license React v16.13.1
|
|
95
|
-
* react-is.development.js
|
|
96
|
-
*
|
|
97
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
98
|
-
*
|
|
99
|
-
* This source code is licensed under the MIT license found in the
|
|
100
|
-
* LICENSE file in the root directory of this source tree.
|
|
101
|
-
*/
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
{
|
|
106
|
-
(function() {
|
|
107
|
-
|
|
108
|
-
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
|
|
109
|
-
// nor polyfill, then a plain number is used for performance.
|
|
110
|
-
var hasSymbol = typeof Symbol === 'function' && Symbol.for;
|
|
111
|
-
var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
|
|
112
|
-
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
|
|
113
|
-
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
|
|
114
|
-
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
|
|
115
|
-
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
|
|
116
|
-
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
|
|
117
|
-
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
|
|
118
|
-
// (unstable) APIs that have been removed. Can we remove the symbols?
|
|
119
|
-
|
|
120
|
-
var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
|
|
121
|
-
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
|
|
122
|
-
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
|
|
123
|
-
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
|
|
124
|
-
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
|
|
125
|
-
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
|
|
126
|
-
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
|
|
127
|
-
var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
|
|
128
|
-
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
|
|
129
|
-
var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
|
|
130
|
-
var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
|
|
131
|
-
|
|
132
|
-
function isValidElementType(type) {
|
|
133
|
-
return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
134
|
-
type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
function typeOf(object) {
|
|
138
|
-
if (typeof object === 'object' && object !== null) {
|
|
139
|
-
var $$typeof = object.$$typeof;
|
|
140
|
-
|
|
141
|
-
switch ($$typeof) {
|
|
142
|
-
case REACT_ELEMENT_TYPE:
|
|
143
|
-
var type = object.type;
|
|
144
|
-
|
|
145
|
-
switch (type) {
|
|
146
|
-
case REACT_ASYNC_MODE_TYPE:
|
|
147
|
-
case REACT_CONCURRENT_MODE_TYPE:
|
|
148
|
-
case REACT_FRAGMENT_TYPE:
|
|
149
|
-
case REACT_PROFILER_TYPE:
|
|
150
|
-
case REACT_STRICT_MODE_TYPE:
|
|
151
|
-
case REACT_SUSPENSE_TYPE:
|
|
152
|
-
return type;
|
|
153
|
-
|
|
154
|
-
default:
|
|
155
|
-
var $$typeofType = type && type.$$typeof;
|
|
156
|
-
|
|
157
|
-
switch ($$typeofType) {
|
|
158
|
-
case REACT_CONTEXT_TYPE:
|
|
159
|
-
case REACT_FORWARD_REF_TYPE:
|
|
160
|
-
case REACT_LAZY_TYPE:
|
|
161
|
-
case REACT_MEMO_TYPE:
|
|
162
|
-
case REACT_PROVIDER_TYPE:
|
|
163
|
-
return $$typeofType;
|
|
164
|
-
|
|
165
|
-
default:
|
|
166
|
-
return $$typeof;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
case REACT_PORTAL_TYPE:
|
|
172
|
-
return $$typeof;
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
return undefined;
|
|
177
|
-
} // AsyncMode is deprecated along with isAsyncMode
|
|
178
|
-
|
|
179
|
-
var AsyncMode = REACT_ASYNC_MODE_TYPE;
|
|
180
|
-
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
|
181
|
-
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
182
|
-
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
183
|
-
var Element = REACT_ELEMENT_TYPE;
|
|
184
|
-
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
185
|
-
var Fragment = REACT_FRAGMENT_TYPE;
|
|
186
|
-
var Lazy = REACT_LAZY_TYPE;
|
|
187
|
-
var Memo = REACT_MEMO_TYPE;
|
|
188
|
-
var Portal = REACT_PORTAL_TYPE;
|
|
189
|
-
var Profiler = REACT_PROFILER_TYPE;
|
|
190
|
-
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
191
|
-
var Suspense = REACT_SUSPENSE_TYPE;
|
|
192
|
-
var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
|
|
193
|
-
|
|
194
|
-
function isAsyncMode(object) {
|
|
195
|
-
{
|
|
196
|
-
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
197
|
-
hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
|
|
198
|
-
|
|
199
|
-
console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
|
|
204
|
-
}
|
|
205
|
-
function isConcurrentMode(object) {
|
|
206
|
-
return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
|
|
207
|
-
}
|
|
208
|
-
function isContextConsumer(object) {
|
|
209
|
-
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
210
|
-
}
|
|
211
|
-
function isContextProvider(object) {
|
|
212
|
-
return typeOf(object) === REACT_PROVIDER_TYPE;
|
|
213
|
-
}
|
|
214
|
-
function isElement(object) {
|
|
215
|
-
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
216
|
-
}
|
|
217
|
-
function isForwardRef(object) {
|
|
218
|
-
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
219
|
-
}
|
|
220
|
-
function isFragment(object) {
|
|
221
|
-
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
222
|
-
}
|
|
223
|
-
function isLazy(object) {
|
|
224
|
-
return typeOf(object) === REACT_LAZY_TYPE;
|
|
225
|
-
}
|
|
226
|
-
function isMemo(object) {
|
|
227
|
-
return typeOf(object) === REACT_MEMO_TYPE;
|
|
228
|
-
}
|
|
229
|
-
function isPortal(object) {
|
|
230
|
-
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
231
|
-
}
|
|
232
|
-
function isProfiler(object) {
|
|
233
|
-
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
234
|
-
}
|
|
235
|
-
function isStrictMode(object) {
|
|
236
|
-
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
237
|
-
}
|
|
238
|
-
function isSuspense(object) {
|
|
239
|
-
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
reactIs_development.AsyncMode = AsyncMode;
|
|
243
|
-
reactIs_development.ConcurrentMode = ConcurrentMode;
|
|
244
|
-
reactIs_development.ContextConsumer = ContextConsumer;
|
|
245
|
-
reactIs_development.ContextProvider = ContextProvider;
|
|
246
|
-
reactIs_development.Element = Element;
|
|
247
|
-
reactIs_development.ForwardRef = ForwardRef;
|
|
248
|
-
reactIs_development.Fragment = Fragment;
|
|
249
|
-
reactIs_development.Lazy = Lazy;
|
|
250
|
-
reactIs_development.Memo = Memo;
|
|
251
|
-
reactIs_development.Portal = Portal;
|
|
252
|
-
reactIs_development.Profiler = Profiler;
|
|
253
|
-
reactIs_development.StrictMode = StrictMode;
|
|
254
|
-
reactIs_development.Suspense = Suspense;
|
|
255
|
-
reactIs_development.isAsyncMode = isAsyncMode;
|
|
256
|
-
reactIs_development.isConcurrentMode = isConcurrentMode;
|
|
257
|
-
reactIs_development.isContextConsumer = isContextConsumer;
|
|
258
|
-
reactIs_development.isContextProvider = isContextProvider;
|
|
259
|
-
reactIs_development.isElement = isElement;
|
|
260
|
-
reactIs_development.isForwardRef = isForwardRef;
|
|
261
|
-
reactIs_development.isFragment = isFragment;
|
|
262
|
-
reactIs_development.isLazy = isLazy;
|
|
263
|
-
reactIs_development.isMemo = isMemo;
|
|
264
|
-
reactIs_development.isPortal = isPortal;
|
|
265
|
-
reactIs_development.isProfiler = isProfiler;
|
|
266
|
-
reactIs_development.isStrictMode = isStrictMode;
|
|
267
|
-
reactIs_development.isSuspense = isSuspense;
|
|
268
|
-
reactIs_development.isValidElementType = isValidElementType;
|
|
269
|
-
reactIs_development.typeOf = typeOf;
|
|
270
|
-
})();
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
{
|
|
274
|
-
reactIs.exports = reactIs_development;
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
var reactIsExports = reactIs.exports;
|
|
278
|
-
|
|
279
|
-
/*
|
|
280
|
-
object-assign
|
|
281
|
-
(c) Sindre Sorhus
|
|
282
|
-
@license MIT
|
|
283
|
-
*/
|
|
284
|
-
/* eslint-disable no-unused-vars */
|
|
285
|
-
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
286
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
287
|
-
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
|
288
|
-
|
|
289
|
-
function toObject(val) {
|
|
290
|
-
if (val === null || val === undefined) {
|
|
291
|
-
throw new TypeError('Object.assign cannot be called with null or undefined');
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
return Object(val);
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
function shouldUseNative() {
|
|
298
|
-
try {
|
|
299
|
-
if (!Object.assign) {
|
|
300
|
-
return false;
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
// Detect buggy property enumeration order in older V8 versions.
|
|
304
|
-
|
|
305
|
-
// https://bugs.chromium.org/p/v8/issues/detail?id=4118
|
|
306
|
-
var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
|
|
307
|
-
test1[5] = 'de';
|
|
308
|
-
if (Object.getOwnPropertyNames(test1)[0] === '5') {
|
|
309
|
-
return false;
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
|
|
313
|
-
var test2 = {};
|
|
314
|
-
for (var i = 0; i < 10; i++) {
|
|
315
|
-
test2['_' + String.fromCharCode(i)] = i;
|
|
316
|
-
}
|
|
317
|
-
var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
|
|
318
|
-
return test2[n];
|
|
319
|
-
});
|
|
320
|
-
if (order2.join('') !== '0123456789') {
|
|
321
|
-
return false;
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
|
|
325
|
-
var test3 = {};
|
|
326
|
-
'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
|
|
327
|
-
test3[letter] = letter;
|
|
328
|
-
});
|
|
329
|
-
if (Object.keys(Object.assign({}, test3)).join('') !==
|
|
330
|
-
'abcdefghijklmnopqrst') {
|
|
331
|
-
return false;
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
return true;
|
|
335
|
-
} catch (err) {
|
|
336
|
-
// We don't expect any of the above to throw, but better to be safe.
|
|
337
|
-
return false;
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
var objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
|
|
342
|
-
var from;
|
|
343
|
-
var to = toObject(target);
|
|
344
|
-
var symbols;
|
|
345
|
-
|
|
346
|
-
for (var s = 1; s < arguments.length; s++) {
|
|
347
|
-
from = Object(arguments[s]);
|
|
348
|
-
|
|
349
|
-
for (var key in from) {
|
|
350
|
-
if (hasOwnProperty.call(from, key)) {
|
|
351
|
-
to[key] = from[key];
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
if (getOwnPropertySymbols) {
|
|
356
|
-
symbols = getOwnPropertySymbols(from);
|
|
357
|
-
for (var i = 0; i < symbols.length; i++) {
|
|
358
|
-
if (propIsEnumerable.call(from, symbols[i])) {
|
|
359
|
-
to[symbols[i]] = from[symbols[i]];
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
return to;
|
|
366
|
-
};
|
|
367
|
-
|
|
368
|
-
/**
|
|
369
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
|
370
|
-
*
|
|
371
|
-
* This source code is licensed under the MIT license found in the
|
|
372
|
-
* LICENSE file in the root directory of this source tree.
|
|
373
|
-
*/
|
|
374
|
-
|
|
375
|
-
var ReactPropTypesSecret$2 = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
|
376
|
-
|
|
377
|
-
var ReactPropTypesSecret_1 = ReactPropTypesSecret$2;
|
|
378
|
-
|
|
379
|
-
var has$2 = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
380
|
-
|
|
381
|
-
/**
|
|
382
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
|
383
|
-
*
|
|
384
|
-
* This source code is licensed under the MIT license found in the
|
|
385
|
-
* LICENSE file in the root directory of this source tree.
|
|
386
|
-
*/
|
|
387
|
-
|
|
388
|
-
var printWarning$1 = function() {};
|
|
389
|
-
|
|
390
|
-
{
|
|
391
|
-
var ReactPropTypesSecret$1 = ReactPropTypesSecret_1;
|
|
392
|
-
var loggedTypeFailures = {};
|
|
393
|
-
var has$1 = has$2;
|
|
394
|
-
|
|
395
|
-
printWarning$1 = function(text) {
|
|
396
|
-
var message = 'Warning: ' + text;
|
|
397
|
-
if (typeof console !== 'undefined') {
|
|
398
|
-
console.error(message);
|
|
399
|
-
}
|
|
400
|
-
try {
|
|
401
|
-
// --- Welcome to debugging React ---
|
|
402
|
-
// This error was thrown as a convenience so that you can use this stack
|
|
403
|
-
// to find the callsite that caused this warning to fire.
|
|
404
|
-
throw new Error(message);
|
|
405
|
-
} catch (x) { /**/ }
|
|
406
|
-
};
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
/**
|
|
410
|
-
* Assert that the values match with the type specs.
|
|
411
|
-
* Error messages are memorized and will only be shown once.
|
|
412
|
-
*
|
|
413
|
-
* @param {object} typeSpecs Map of name to a ReactPropType
|
|
414
|
-
* @param {object} values Runtime values that need to be type-checked
|
|
415
|
-
* @param {string} location e.g. "prop", "context", "child context"
|
|
416
|
-
* @param {string} componentName Name of the component for error messages.
|
|
417
|
-
* @param {?Function} getStack Returns the component stack.
|
|
418
|
-
* @private
|
|
419
|
-
*/
|
|
420
|
-
function checkPropTypes$1(typeSpecs, values, location, componentName, getStack) {
|
|
421
|
-
{
|
|
422
|
-
for (var typeSpecName in typeSpecs) {
|
|
423
|
-
if (has$1(typeSpecs, typeSpecName)) {
|
|
424
|
-
var error;
|
|
425
|
-
// Prop type validation may throw. In case they do, we don't want to
|
|
426
|
-
// fail the render phase where it didn't fail before. So we log it.
|
|
427
|
-
// After these have been cleaned up, we'll let them throw.
|
|
428
|
-
try {
|
|
429
|
-
// This is intentionally an invariant that gets caught. It's the same
|
|
430
|
-
// behavior as without this statement except with a better message.
|
|
431
|
-
if (typeof typeSpecs[typeSpecName] !== 'function') {
|
|
432
|
-
var err = Error(
|
|
433
|
-
(componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
|
|
434
|
-
'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +
|
|
435
|
-
'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'
|
|
436
|
-
);
|
|
437
|
-
err.name = 'Invariant Violation';
|
|
438
|
-
throw err;
|
|
439
|
-
}
|
|
440
|
-
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret$1);
|
|
441
|
-
} catch (ex) {
|
|
442
|
-
error = ex;
|
|
443
|
-
}
|
|
444
|
-
if (error && !(error instanceof Error)) {
|
|
445
|
-
printWarning$1(
|
|
446
|
-
(componentName || 'React class') + ': type specification of ' +
|
|
447
|
-
location + ' `' + typeSpecName + '` is invalid; the type checker ' +
|
|
448
|
-
'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
|
|
449
|
-
'You may have forgotten to pass an argument to the type checker ' +
|
|
450
|
-
'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
|
|
451
|
-
'shape all require an argument).'
|
|
452
|
-
);
|
|
453
|
-
}
|
|
454
|
-
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
|
|
455
|
-
// Only monitor this failure once because there tends to be a lot of the
|
|
456
|
-
// same error.
|
|
457
|
-
loggedTypeFailures[error.message] = true;
|
|
458
|
-
|
|
459
|
-
var stack = getStack ? getStack() : '';
|
|
460
|
-
|
|
461
|
-
printWarning$1(
|
|
462
|
-
'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
|
|
463
|
-
);
|
|
464
|
-
}
|
|
465
|
-
}
|
|
466
|
-
}
|
|
467
|
-
}
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
/**
|
|
471
|
-
* Resets warning cache when testing.
|
|
472
|
-
*
|
|
473
|
-
* @private
|
|
474
|
-
*/
|
|
475
|
-
checkPropTypes$1.resetWarningCache = function() {
|
|
476
|
-
{
|
|
477
|
-
loggedTypeFailures = {};
|
|
478
|
-
}
|
|
479
|
-
};
|
|
480
|
-
|
|
481
|
-
var checkPropTypes_1 = checkPropTypes$1;
|
|
482
|
-
|
|
483
|
-
/**
|
|
484
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
|
485
|
-
*
|
|
486
|
-
* This source code is licensed under the MIT license found in the
|
|
487
|
-
* LICENSE file in the root directory of this source tree.
|
|
488
|
-
*/
|
|
489
|
-
|
|
490
|
-
var ReactIs$1 = reactIsExports;
|
|
491
|
-
var assign = objectAssign;
|
|
492
|
-
|
|
493
|
-
var ReactPropTypesSecret = ReactPropTypesSecret_1;
|
|
494
|
-
var has = has$2;
|
|
495
|
-
var checkPropTypes = checkPropTypes_1;
|
|
496
|
-
|
|
497
|
-
var printWarning = function() {};
|
|
498
|
-
|
|
499
|
-
{
|
|
500
|
-
printWarning = function(text) {
|
|
501
|
-
var message = 'Warning: ' + text;
|
|
502
|
-
if (typeof console !== 'undefined') {
|
|
503
|
-
console.error(message);
|
|
504
|
-
}
|
|
505
|
-
try {
|
|
506
|
-
// --- Welcome to debugging React ---
|
|
507
|
-
// This error was thrown as a convenience so that you can use this stack
|
|
508
|
-
// to find the callsite that caused this warning to fire.
|
|
509
|
-
throw new Error(message);
|
|
510
|
-
} catch (x) {}
|
|
511
|
-
};
|
|
512
|
-
}
|
|
513
|
-
|
|
514
|
-
function emptyFunctionThatReturnsNull() {
|
|
515
|
-
return null;
|
|
516
|
-
}
|
|
517
|
-
|
|
518
|
-
var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
519
|
-
/* global Symbol */
|
|
520
|
-
var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
|
521
|
-
var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
|
|
522
|
-
|
|
523
|
-
/**
|
|
524
|
-
* Returns the iterator method function contained on the iterable object.
|
|
525
|
-
*
|
|
526
|
-
* Be sure to invoke the function with the iterable as context:
|
|
527
|
-
*
|
|
528
|
-
* var iteratorFn = getIteratorFn(myIterable);
|
|
529
|
-
* if (iteratorFn) {
|
|
530
|
-
* var iterator = iteratorFn.call(myIterable);
|
|
531
|
-
* ...
|
|
532
|
-
* }
|
|
533
|
-
*
|
|
534
|
-
* @param {?object} maybeIterable
|
|
535
|
-
* @return {?function}
|
|
536
|
-
*/
|
|
537
|
-
function getIteratorFn(maybeIterable) {
|
|
538
|
-
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
|
|
539
|
-
if (typeof iteratorFn === 'function') {
|
|
540
|
-
return iteratorFn;
|
|
541
|
-
}
|
|
542
|
-
}
|
|
543
|
-
|
|
544
|
-
/**
|
|
545
|
-
* Collection of methods that allow declaration and validation of props that are
|
|
546
|
-
* supplied to React components. Example usage:
|
|
547
|
-
*
|
|
548
|
-
* var Props = require('ReactPropTypes');
|
|
549
|
-
* var MyArticle = React.createClass({
|
|
550
|
-
* propTypes: {
|
|
551
|
-
* // An optional string prop named "description".
|
|
552
|
-
* description: Props.string,
|
|
553
|
-
*
|
|
554
|
-
* // A required enum prop named "category".
|
|
555
|
-
* category: Props.oneOf(['News','Photos']).isRequired,
|
|
556
|
-
*
|
|
557
|
-
* // A prop named "dialog" that requires an instance of Dialog.
|
|
558
|
-
* dialog: Props.instanceOf(Dialog).isRequired
|
|
559
|
-
* },
|
|
560
|
-
* render: function() { ... }
|
|
561
|
-
* });
|
|
562
|
-
*
|
|
563
|
-
* A more formal specification of how these methods are used:
|
|
564
|
-
*
|
|
565
|
-
* type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
|
|
566
|
-
* decl := ReactPropTypes.{type}(.isRequired)?
|
|
567
|
-
*
|
|
568
|
-
* Each and every declaration produces a function with the same signature. This
|
|
569
|
-
* allows the creation of custom validation functions. For example:
|
|
570
|
-
*
|
|
571
|
-
* var MyLink = React.createClass({
|
|
572
|
-
* propTypes: {
|
|
573
|
-
* // An optional string or URI prop named "href".
|
|
574
|
-
* href: function(props, propName, componentName) {
|
|
575
|
-
* var propValue = props[propName];
|
|
576
|
-
* if (propValue != null && typeof propValue !== 'string' &&
|
|
577
|
-
* !(propValue instanceof URI)) {
|
|
578
|
-
* return new Error(
|
|
579
|
-
* 'Expected a string or an URI for ' + propName + ' in ' +
|
|
580
|
-
* componentName
|
|
581
|
-
* );
|
|
582
|
-
* }
|
|
583
|
-
* }
|
|
584
|
-
* },
|
|
585
|
-
* render: function() {...}
|
|
586
|
-
* });
|
|
587
|
-
*
|
|
588
|
-
* @internal
|
|
589
|
-
*/
|
|
590
|
-
|
|
591
|
-
var ANONYMOUS = '<<anonymous>>';
|
|
592
|
-
|
|
593
|
-
// Important!
|
|
594
|
-
// Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
|
|
595
|
-
var ReactPropTypes = {
|
|
596
|
-
array: createPrimitiveTypeChecker('array'),
|
|
597
|
-
bigint: createPrimitiveTypeChecker('bigint'),
|
|
598
|
-
bool: createPrimitiveTypeChecker('boolean'),
|
|
599
|
-
func: createPrimitiveTypeChecker('function'),
|
|
600
|
-
number: createPrimitiveTypeChecker('number'),
|
|
601
|
-
object: createPrimitiveTypeChecker('object'),
|
|
602
|
-
string: createPrimitiveTypeChecker('string'),
|
|
603
|
-
symbol: createPrimitiveTypeChecker('symbol'),
|
|
604
|
-
|
|
605
|
-
any: createAnyTypeChecker(),
|
|
606
|
-
arrayOf: createArrayOfTypeChecker,
|
|
607
|
-
element: createElementTypeChecker(),
|
|
608
|
-
elementType: createElementTypeTypeChecker(),
|
|
609
|
-
instanceOf: createInstanceTypeChecker,
|
|
610
|
-
node: createNodeChecker(),
|
|
611
|
-
objectOf: createObjectOfTypeChecker,
|
|
612
|
-
oneOf: createEnumTypeChecker,
|
|
613
|
-
oneOfType: createUnionTypeChecker,
|
|
614
|
-
shape: createShapeTypeChecker,
|
|
615
|
-
exact: createStrictShapeTypeChecker,
|
|
616
|
-
};
|
|
617
|
-
|
|
618
|
-
/**
|
|
619
|
-
* inlined Object.is polyfill to avoid requiring consumers ship their own
|
|
620
|
-
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
|
|
621
|
-
*/
|
|
622
|
-
/*eslint-disable no-self-compare*/
|
|
623
|
-
function is(x, y) {
|
|
624
|
-
// SameValue algorithm
|
|
625
|
-
if (x === y) {
|
|
626
|
-
// Steps 1-5, 7-10
|
|
627
|
-
// Steps 6.b-6.e: +0 != -0
|
|
628
|
-
return x !== 0 || 1 / x === 1 / y;
|
|
629
|
-
} else {
|
|
630
|
-
// Step 6.a: NaN == NaN
|
|
631
|
-
return x !== x && y !== y;
|
|
632
|
-
}
|
|
633
|
-
}
|
|
634
|
-
/*eslint-enable no-self-compare*/
|
|
635
|
-
|
|
636
|
-
/**
|
|
637
|
-
* We use an Error-like object for backward compatibility as people may call
|
|
638
|
-
* PropTypes directly and inspect their output. However, we don't use real
|
|
639
|
-
* Errors anymore. We don't inspect their stack anyway, and creating them
|
|
640
|
-
* is prohibitively expensive if they are created too often, such as what
|
|
641
|
-
* happens in oneOfType() for any type before the one that matched.
|
|
642
|
-
*/
|
|
643
|
-
function PropTypeError(message, data) {
|
|
644
|
-
this.message = message;
|
|
645
|
-
this.data = data && typeof data === 'object' ? data: {};
|
|
646
|
-
this.stack = '';
|
|
647
|
-
}
|
|
648
|
-
// Make `instanceof Error` still work for returned errors.
|
|
649
|
-
PropTypeError.prototype = Error.prototype;
|
|
650
|
-
|
|
651
|
-
function createChainableTypeChecker(validate) {
|
|
652
|
-
{
|
|
653
|
-
var manualPropTypeCallCache = {};
|
|
654
|
-
var manualPropTypeWarningCount = 0;
|
|
655
|
-
}
|
|
656
|
-
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
|
|
657
|
-
componentName = componentName || ANONYMOUS;
|
|
658
|
-
propFullName = propFullName || propName;
|
|
659
|
-
|
|
660
|
-
if (secret !== ReactPropTypesSecret) {
|
|
661
|
-
if (throwOnDirectAccess) {
|
|
662
|
-
// New behavior only for users of `prop-types` package
|
|
663
|
-
var err = new Error(
|
|
664
|
-
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
|
|
665
|
-
'Use `PropTypes.checkPropTypes()` to call them. ' +
|
|
666
|
-
'Read more at http://fb.me/use-check-prop-types'
|
|
667
|
-
);
|
|
668
|
-
err.name = 'Invariant Violation';
|
|
669
|
-
throw err;
|
|
670
|
-
} else if (typeof console !== 'undefined') {
|
|
671
|
-
// Old behavior for people using React.PropTypes
|
|
672
|
-
var cacheKey = componentName + ':' + propName;
|
|
673
|
-
if (
|
|
674
|
-
!manualPropTypeCallCache[cacheKey] &&
|
|
675
|
-
// Avoid spamming the console because they are often not actionable except for lib authors
|
|
676
|
-
manualPropTypeWarningCount < 3
|
|
677
|
-
) {
|
|
678
|
-
printWarning(
|
|
679
|
-
'You are manually calling a React.PropTypes validation ' +
|
|
680
|
-
'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
|
|
681
|
-
'and will throw in the standalone `prop-types` package. ' +
|
|
682
|
-
'You may be seeing this warning due to a third-party PropTypes ' +
|
|
683
|
-
'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
|
|
684
|
-
);
|
|
685
|
-
manualPropTypeCallCache[cacheKey] = true;
|
|
686
|
-
manualPropTypeWarningCount++;
|
|
687
|
-
}
|
|
688
|
-
}
|
|
689
|
-
}
|
|
690
|
-
if (props[propName] == null) {
|
|
691
|
-
if (isRequired) {
|
|
692
|
-
if (props[propName] === null) {
|
|
693
|
-
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
|
|
694
|
-
}
|
|
695
|
-
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
|
|
696
|
-
}
|
|
697
|
-
return null;
|
|
698
|
-
} else {
|
|
699
|
-
return validate(props, propName, componentName, location, propFullName);
|
|
700
|
-
}
|
|
701
|
-
}
|
|
702
|
-
|
|
703
|
-
var chainedCheckType = checkType.bind(null, false);
|
|
704
|
-
chainedCheckType.isRequired = checkType.bind(null, true);
|
|
705
|
-
|
|
706
|
-
return chainedCheckType;
|
|
707
|
-
}
|
|
708
|
-
|
|
709
|
-
function createPrimitiveTypeChecker(expectedType) {
|
|
710
|
-
function validate(props, propName, componentName, location, propFullName, secret) {
|
|
711
|
-
var propValue = props[propName];
|
|
712
|
-
var propType = getPropType(propValue);
|
|
713
|
-
if (propType !== expectedType) {
|
|
714
|
-
// `propValue` being instance of, say, date/regexp, pass the 'object'
|
|
715
|
-
// check, but we can offer a more precise error message here rather than
|
|
716
|
-
// 'of type `object`'.
|
|
717
|
-
var preciseType = getPreciseType(propValue);
|
|
718
|
-
|
|
719
|
-
return new PropTypeError(
|
|
720
|
-
'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'),
|
|
721
|
-
{expectedType: expectedType}
|
|
722
|
-
);
|
|
723
|
-
}
|
|
724
|
-
return null;
|
|
725
|
-
}
|
|
726
|
-
return createChainableTypeChecker(validate);
|
|
727
|
-
}
|
|
728
|
-
|
|
729
|
-
function createAnyTypeChecker() {
|
|
730
|
-
return createChainableTypeChecker(emptyFunctionThatReturnsNull);
|
|
731
|
-
}
|
|
732
|
-
|
|
733
|
-
function createArrayOfTypeChecker(typeChecker) {
|
|
734
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
735
|
-
if (typeof typeChecker !== 'function') {
|
|
736
|
-
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
|
|
737
|
-
}
|
|
738
|
-
var propValue = props[propName];
|
|
739
|
-
if (!Array.isArray(propValue)) {
|
|
740
|
-
var propType = getPropType(propValue);
|
|
741
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
|
|
742
|
-
}
|
|
743
|
-
for (var i = 0; i < propValue.length; i++) {
|
|
744
|
-
var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
|
|
745
|
-
if (error instanceof Error) {
|
|
746
|
-
return error;
|
|
747
|
-
}
|
|
748
|
-
}
|
|
749
|
-
return null;
|
|
750
|
-
}
|
|
751
|
-
return createChainableTypeChecker(validate);
|
|
752
|
-
}
|
|
753
|
-
|
|
754
|
-
function createElementTypeChecker() {
|
|
755
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
756
|
-
var propValue = props[propName];
|
|
757
|
-
if (!isValidElement(propValue)) {
|
|
758
|
-
var propType = getPropType(propValue);
|
|
759
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
|
|
760
|
-
}
|
|
761
|
-
return null;
|
|
762
|
-
}
|
|
763
|
-
return createChainableTypeChecker(validate);
|
|
764
|
-
}
|
|
765
|
-
|
|
766
|
-
function createElementTypeTypeChecker() {
|
|
767
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
768
|
-
var propValue = props[propName];
|
|
769
|
-
if (!ReactIs$1.isValidElementType(propValue)) {
|
|
770
|
-
var propType = getPropType(propValue);
|
|
771
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
|
|
772
|
-
}
|
|
773
|
-
return null;
|
|
774
|
-
}
|
|
775
|
-
return createChainableTypeChecker(validate);
|
|
776
|
-
}
|
|
777
|
-
|
|
778
|
-
function createInstanceTypeChecker(expectedClass) {
|
|
779
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
780
|
-
if (!(props[propName] instanceof expectedClass)) {
|
|
781
|
-
var expectedClassName = expectedClass.name || ANONYMOUS;
|
|
782
|
-
var actualClassName = getClassName(props[propName]);
|
|
783
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
|
|
784
|
-
}
|
|
785
|
-
return null;
|
|
786
|
-
}
|
|
787
|
-
return createChainableTypeChecker(validate);
|
|
788
|
-
}
|
|
789
|
-
|
|
790
|
-
function createEnumTypeChecker(expectedValues) {
|
|
791
|
-
if (!Array.isArray(expectedValues)) {
|
|
792
|
-
{
|
|
793
|
-
if (arguments.length > 1) {
|
|
794
|
-
printWarning(
|
|
795
|
-
'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +
|
|
796
|
-
'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'
|
|
797
|
-
);
|
|
798
|
-
} else {
|
|
799
|
-
printWarning('Invalid argument supplied to oneOf, expected an array.');
|
|
800
|
-
}
|
|
801
|
-
}
|
|
802
|
-
return emptyFunctionThatReturnsNull;
|
|
803
|
-
}
|
|
804
|
-
|
|
805
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
806
|
-
var propValue = props[propName];
|
|
807
|
-
for (var i = 0; i < expectedValues.length; i++) {
|
|
808
|
-
if (is(propValue, expectedValues[i])) {
|
|
809
|
-
return null;
|
|
810
|
-
}
|
|
811
|
-
}
|
|
812
|
-
|
|
813
|
-
var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
|
|
814
|
-
var type = getPreciseType(value);
|
|
815
|
-
if (type === 'symbol') {
|
|
816
|
-
return String(value);
|
|
817
|
-
}
|
|
818
|
-
return value;
|
|
819
|
-
});
|
|
820
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
|
|
821
|
-
}
|
|
822
|
-
return createChainableTypeChecker(validate);
|
|
823
|
-
}
|
|
824
|
-
|
|
825
|
-
function createObjectOfTypeChecker(typeChecker) {
|
|
826
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
827
|
-
if (typeof typeChecker !== 'function') {
|
|
828
|
-
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
|
|
829
|
-
}
|
|
830
|
-
var propValue = props[propName];
|
|
831
|
-
var propType = getPropType(propValue);
|
|
832
|
-
if (propType !== 'object') {
|
|
833
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
|
|
834
|
-
}
|
|
835
|
-
for (var key in propValue) {
|
|
836
|
-
if (has(propValue, key)) {
|
|
837
|
-
var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
|
|
838
|
-
if (error instanceof Error) {
|
|
839
|
-
return error;
|
|
840
|
-
}
|
|
841
|
-
}
|
|
842
|
-
}
|
|
843
|
-
return null;
|
|
844
|
-
}
|
|
845
|
-
return createChainableTypeChecker(validate);
|
|
846
|
-
}
|
|
847
|
-
|
|
848
|
-
function createUnionTypeChecker(arrayOfTypeCheckers) {
|
|
849
|
-
if (!Array.isArray(arrayOfTypeCheckers)) {
|
|
850
|
-
printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') ;
|
|
851
|
-
return emptyFunctionThatReturnsNull;
|
|
852
|
-
}
|
|
853
|
-
|
|
854
|
-
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
855
|
-
var checker = arrayOfTypeCheckers[i];
|
|
856
|
-
if (typeof checker !== 'function') {
|
|
857
|
-
printWarning(
|
|
858
|
-
'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
|
|
859
|
-
'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
|
|
860
|
-
);
|
|
861
|
-
return emptyFunctionThatReturnsNull;
|
|
862
|
-
}
|
|
863
|
-
}
|
|
864
|
-
|
|
865
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
866
|
-
var expectedTypes = [];
|
|
867
|
-
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
868
|
-
var checker = arrayOfTypeCheckers[i];
|
|
869
|
-
var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
|
|
870
|
-
if (checkerResult == null) {
|
|
871
|
-
return null;
|
|
872
|
-
}
|
|
873
|
-
if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
|
|
874
|
-
expectedTypes.push(checkerResult.data.expectedType);
|
|
875
|
-
}
|
|
876
|
-
}
|
|
877
|
-
var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': '';
|
|
878
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
|
|
879
|
-
}
|
|
880
|
-
return createChainableTypeChecker(validate);
|
|
881
|
-
}
|
|
882
|
-
|
|
883
|
-
function createNodeChecker() {
|
|
884
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
885
|
-
if (!isNode(props[propName])) {
|
|
886
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
|
|
887
|
-
}
|
|
888
|
-
return null;
|
|
889
|
-
}
|
|
890
|
-
return createChainableTypeChecker(validate);
|
|
891
|
-
}
|
|
892
|
-
|
|
893
|
-
function invalidValidatorError(componentName, location, propFullName, key, type) {
|
|
894
|
-
return new PropTypeError(
|
|
895
|
-
(componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' +
|
|
896
|
-
'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'
|
|
897
|
-
);
|
|
898
|
-
}
|
|
899
|
-
|
|
900
|
-
function createShapeTypeChecker(shapeTypes) {
|
|
901
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
902
|
-
var propValue = props[propName];
|
|
903
|
-
var propType = getPropType(propValue);
|
|
904
|
-
if (propType !== 'object') {
|
|
905
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
|
906
|
-
}
|
|
907
|
-
for (var key in shapeTypes) {
|
|
908
|
-
var checker = shapeTypes[key];
|
|
909
|
-
if (typeof checker !== 'function') {
|
|
910
|
-
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
911
|
-
}
|
|
912
|
-
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
|
|
913
|
-
if (error) {
|
|
914
|
-
return error;
|
|
915
|
-
}
|
|
916
|
-
}
|
|
917
|
-
return null;
|
|
918
|
-
}
|
|
919
|
-
return createChainableTypeChecker(validate);
|
|
920
|
-
}
|
|
921
|
-
|
|
922
|
-
function createStrictShapeTypeChecker(shapeTypes) {
|
|
923
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
924
|
-
var propValue = props[propName];
|
|
925
|
-
var propType = getPropType(propValue);
|
|
926
|
-
if (propType !== 'object') {
|
|
927
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
|
928
|
-
}
|
|
929
|
-
// We need to check all keys in case some are required but missing from props.
|
|
930
|
-
var allKeys = assign({}, props[propName], shapeTypes);
|
|
931
|
-
for (var key in allKeys) {
|
|
932
|
-
var checker = shapeTypes[key];
|
|
933
|
-
if (has(shapeTypes, key) && typeof checker !== 'function') {
|
|
934
|
-
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
935
|
-
}
|
|
936
|
-
if (!checker) {
|
|
937
|
-
return new PropTypeError(
|
|
938
|
-
'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
|
|
939
|
-
'\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
|
|
940
|
-
'\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
|
|
941
|
-
);
|
|
942
|
-
}
|
|
943
|
-
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
|
|
944
|
-
if (error) {
|
|
945
|
-
return error;
|
|
946
|
-
}
|
|
947
|
-
}
|
|
948
|
-
return null;
|
|
949
|
-
}
|
|
950
|
-
|
|
951
|
-
return createChainableTypeChecker(validate);
|
|
952
|
-
}
|
|
953
|
-
|
|
954
|
-
function isNode(propValue) {
|
|
955
|
-
switch (typeof propValue) {
|
|
956
|
-
case 'number':
|
|
957
|
-
case 'string':
|
|
958
|
-
case 'undefined':
|
|
959
|
-
return true;
|
|
960
|
-
case 'boolean':
|
|
961
|
-
return !propValue;
|
|
962
|
-
case 'object':
|
|
963
|
-
if (Array.isArray(propValue)) {
|
|
964
|
-
return propValue.every(isNode);
|
|
965
|
-
}
|
|
966
|
-
if (propValue === null || isValidElement(propValue)) {
|
|
967
|
-
return true;
|
|
968
|
-
}
|
|
969
|
-
|
|
970
|
-
var iteratorFn = getIteratorFn(propValue);
|
|
971
|
-
if (iteratorFn) {
|
|
972
|
-
var iterator = iteratorFn.call(propValue);
|
|
973
|
-
var step;
|
|
974
|
-
if (iteratorFn !== propValue.entries) {
|
|
975
|
-
while (!(step = iterator.next()).done) {
|
|
976
|
-
if (!isNode(step.value)) {
|
|
977
|
-
return false;
|
|
978
|
-
}
|
|
979
|
-
}
|
|
980
|
-
} else {
|
|
981
|
-
// Iterator will provide entry [k,v] tuples rather than values.
|
|
982
|
-
while (!(step = iterator.next()).done) {
|
|
983
|
-
var entry = step.value;
|
|
984
|
-
if (entry) {
|
|
985
|
-
if (!isNode(entry[1])) {
|
|
986
|
-
return false;
|
|
987
|
-
}
|
|
988
|
-
}
|
|
989
|
-
}
|
|
990
|
-
}
|
|
991
|
-
} else {
|
|
992
|
-
return false;
|
|
993
|
-
}
|
|
994
|
-
|
|
995
|
-
return true;
|
|
996
|
-
default:
|
|
997
|
-
return false;
|
|
998
|
-
}
|
|
999
|
-
}
|
|
1000
|
-
|
|
1001
|
-
function isSymbol(propType, propValue) {
|
|
1002
|
-
// Native Symbol.
|
|
1003
|
-
if (propType === 'symbol') {
|
|
1004
|
-
return true;
|
|
1005
|
-
}
|
|
1006
|
-
|
|
1007
|
-
// falsy value can't be a Symbol
|
|
1008
|
-
if (!propValue) {
|
|
1009
|
-
return false;
|
|
1010
|
-
}
|
|
1011
|
-
|
|
1012
|
-
// 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
|
|
1013
|
-
if (propValue['@@toStringTag'] === 'Symbol') {
|
|
1014
|
-
return true;
|
|
1015
|
-
}
|
|
1016
|
-
|
|
1017
|
-
// Fallback for non-spec compliant Symbols which are polyfilled.
|
|
1018
|
-
if (typeof Symbol === 'function' && propValue instanceof Symbol) {
|
|
1019
|
-
return true;
|
|
1020
|
-
}
|
|
1021
|
-
|
|
1022
|
-
return false;
|
|
1023
|
-
}
|
|
1024
|
-
|
|
1025
|
-
// Equivalent of `typeof` but with special handling for array and regexp.
|
|
1026
|
-
function getPropType(propValue) {
|
|
1027
|
-
var propType = typeof propValue;
|
|
1028
|
-
if (Array.isArray(propValue)) {
|
|
1029
|
-
return 'array';
|
|
1030
|
-
}
|
|
1031
|
-
if (propValue instanceof RegExp) {
|
|
1032
|
-
// Old webkits (at least until Android 4.0) return 'function' rather than
|
|
1033
|
-
// 'object' for typeof a RegExp. We'll normalize this here so that /bla/
|
|
1034
|
-
// passes PropTypes.object.
|
|
1035
|
-
return 'object';
|
|
1036
|
-
}
|
|
1037
|
-
if (isSymbol(propType, propValue)) {
|
|
1038
|
-
return 'symbol';
|
|
1039
|
-
}
|
|
1040
|
-
return propType;
|
|
1041
|
-
}
|
|
1042
|
-
|
|
1043
|
-
// This handles more types than `getPropType`. Only used for error messages.
|
|
1044
|
-
// See `createPrimitiveTypeChecker`.
|
|
1045
|
-
function getPreciseType(propValue) {
|
|
1046
|
-
if (typeof propValue === 'undefined' || propValue === null) {
|
|
1047
|
-
return '' + propValue;
|
|
1048
|
-
}
|
|
1049
|
-
var propType = getPropType(propValue);
|
|
1050
|
-
if (propType === 'object') {
|
|
1051
|
-
if (propValue instanceof Date) {
|
|
1052
|
-
return 'date';
|
|
1053
|
-
} else if (propValue instanceof RegExp) {
|
|
1054
|
-
return 'regexp';
|
|
1055
|
-
}
|
|
1056
|
-
}
|
|
1057
|
-
return propType;
|
|
1058
|
-
}
|
|
1059
|
-
|
|
1060
|
-
// Returns a string that is postfixed to a warning about an invalid type.
|
|
1061
|
-
// For example, "undefined" or "of type array"
|
|
1062
|
-
function getPostfixForTypeWarning(value) {
|
|
1063
|
-
var type = getPreciseType(value);
|
|
1064
|
-
switch (type) {
|
|
1065
|
-
case 'array':
|
|
1066
|
-
case 'object':
|
|
1067
|
-
return 'an ' + type;
|
|
1068
|
-
case 'boolean':
|
|
1069
|
-
case 'date':
|
|
1070
|
-
case 'regexp':
|
|
1071
|
-
return 'a ' + type;
|
|
1072
|
-
default:
|
|
1073
|
-
return type;
|
|
1074
|
-
}
|
|
1075
|
-
}
|
|
1076
|
-
|
|
1077
|
-
// Returns class name of the object, if any.
|
|
1078
|
-
function getClassName(propValue) {
|
|
1079
|
-
if (!propValue.constructor || !propValue.constructor.name) {
|
|
1080
|
-
return ANONYMOUS;
|
|
1081
|
-
}
|
|
1082
|
-
return propValue.constructor.name;
|
|
1083
|
-
}
|
|
1084
|
-
|
|
1085
|
-
ReactPropTypes.checkPropTypes = checkPropTypes;
|
|
1086
|
-
ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
|
|
1087
|
-
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
1088
|
-
|
|
1089
|
-
return ReactPropTypes;
|
|
1090
|
-
};
|
|
1091
|
-
|
|
1092
|
-
/**
|
|
1093
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
|
1094
|
-
*
|
|
1095
|
-
* This source code is licensed under the MIT license found in the
|
|
1096
|
-
* LICENSE file in the root directory of this source tree.
|
|
1097
|
-
*/
|
|
1098
|
-
|
|
1099
|
-
{
|
|
1100
|
-
var ReactIs = reactIsExports;
|
|
1101
|
-
|
|
1102
|
-
// By explicitly using `prop-types` you are opting into new development behavior.
|
|
1103
|
-
// http://fb.me/prop-types-in-prod
|
|
1104
|
-
var throwOnDirectAccess = true;
|
|
1105
|
-
propTypes.exports = factoryWithTypeCheckers(ReactIs.isElement, throwOnDirectAccess);
|
|
1106
|
-
}
|
|
1107
|
-
|
|
1108
|
-
var propTypesExports = propTypes.exports;
|
|
1109
|
-
var PropTypes = /*@__PURE__*/getDefaultExportFromCjs(propTypesExports);
|
|
1110
|
-
|
|
1111
|
-
function styleInject(css, ref) {
|
|
1112
|
-
if ( ref === void 0 ) ref = {};
|
|
1113
|
-
var insertAt = ref.insertAt;
|
|
1114
|
-
|
|
1115
|
-
if (!css || typeof document === 'undefined') { return; }
|
|
1116
|
-
|
|
1117
|
-
var head = document.head || document.getElementsByTagName('head')[0];
|
|
1118
|
-
var style = document.createElement('style');
|
|
1119
|
-
style.type = 'text/css';
|
|
1120
|
-
|
|
1121
|
-
if (insertAt === 'top') {
|
|
1122
|
-
if (head.firstChild) {
|
|
1123
|
-
head.insertBefore(style, head.firstChild);
|
|
1124
|
-
} else {
|
|
1125
|
-
head.appendChild(style);
|
|
1126
|
-
}
|
|
1127
|
-
} else {
|
|
1128
|
-
head.appendChild(style);
|
|
1129
|
-
}
|
|
1130
|
-
|
|
1131
|
-
if (style.styleSheet) {
|
|
1132
|
-
style.styleSheet.cssText = css;
|
|
1133
|
-
} else {
|
|
1134
|
-
style.appendChild(document.createTextNode(css));
|
|
1135
|
-
}
|
|
1136
|
-
}
|
|
1137
|
-
|
|
1138
|
-
var css_248z$f = "@font-face {\n font-family: \"Material Symbols Outlined\";\n font-style: normal;\n font-weight: 100 700;\n font-display: block;\n src: url(\"./material-symbols-outlined.woff2\") format(\"woff2\");\n}\n.material-symbols-outlined {\n font-family: \"Material Symbols Outlined\";\n font-weight: normal;\n font-style: normal;\n font-size: 24px;\n line-height: 1;\n letter-spacing: normal;\n text-transform: none;\n display: inline-block;\n white-space: nowrap;\n word-wrap: normal;\n direction: ltr;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n text-rendering: optimizeLegibility;\n font-feature-settings: \"liga\";\n}\n\n@font-face {\n font-family: \"Material Symbols Rounded\";\n font-style: normal;\n font-weight: 100 700;\n font-display: block;\n src: url(\"./material-symbols-rounded.woff2\") format(\"woff2\");\n}\n.material-symbols-rounded {\n font-family: \"Material Symbols Rounded\";\n font-weight: normal;\n font-style: normal;\n font-size: 24px;\n line-height: 1;\n letter-spacing: normal;\n text-transform: none;\n display: inline-block;\n white-space: nowrap;\n word-wrap: normal;\n direction: ltr;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n text-rendering: optimizeLegibility;\n font-feature-settings: \"liga\";\n}\n\n@font-face {\n font-family: \"Material Symbols Sharp\";\n font-style: normal;\n font-weight: 100 700;\n font-display: block;\n src: url(\"./material-symbols-sharp.woff2\") format(\"woff2\");\n}\n.material-symbols-sharp {\n font-family: \"Material Symbols Sharp\";\n font-weight: normal;\n font-style: normal;\n font-size: 24px;\n line-height: 1;\n letter-spacing: normal;\n text-transform: none;\n display: inline-block;\n white-space: nowrap;\n word-wrap: normal;\n direction: ltr;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n text-rendering: optimizeLegibility;\n font-feature-settings: \"liga\";\n}\n";
|
|
1139
|
-
styleInject(css_248z$f);
|
|
1140
|
-
|
|
1141
|
-
var css_248z$e = ":root, :host {\n --rpf-text-primary: hsla(0, 0%, 13%, 1);\n --rpf-text-primary-darkmode: var(--rpf-white);\n --rpf-text-secondary: hsla(200, 9%, 33%, 1);\n --rpf-text-secondary-darkmode: hsla(0, 0%, 80%, 1);\n --rpf-link-text: var(--rpf-navy-800);\n}\n\n:root, :host {\n --rpf-red-100: hsla(4, 89%, 96%, 1);\n --rpf-red-200: hsla(1, 87%, 91%, 1);\n --rpf-red-400: hsla(1, 87%, 82%, 1);\n --rpf-red-600: hsla(1, 87%, 72%, 1);\n --rpf-red-800: hsla(1, 87%, 63%, 1);\n --rpf-red-900: hsla(1, 52%, 50%, 1);\n --rpf-green-100: hsla(125, 41%, 95%, 1);\n --rpf-green-200: hsla(122, 39%, 87%, 1);\n --rpf-green-400: hsla(123, 40%, 74%, 1);\n --rpf-green-600: hsla(123, 40%, 61%, 1);\n --rpf-green-800: hsla(123, 43%, 48%, 1);\n --rpf-green-900: hsla(123, 43%, 34%, 1);\n --rpf-teal-100: hsla(176, 55%, 94%, 1);\n --rpf-teal-200: hsla(174, 55%, 85%, 1);\n --rpf-teal-400: hsla(174, 55%, 70%, 1);\n --rpf-teal-600: hsla(174, 56%, 56%, 1);\n --rpf-teal-800: hsla(174, 81%, 41%, 1);\n --rpf-teal-900: hsla(174, 81%, 27%, 1);\n --rpf-teal-950: hsla(174, 80%, 20%, 1);\n --rpf-orange-100: hsla(31, 100%, 95%, 1);\n --rpf-orange-200: hsla(32, 100%, 88%, 1);\n --rpf-orange-400: hsla(31, 100%, 77%, 1);\n --rpf-orange-600: hsla(31, 99%, 65%, 1);\n --rpf-orange-800: hsla(31, 99%, 54%, 1);\n --rpf-orange-900: hsla(31, 85%, 35%, 1);\n --rpf-yellow-100: hsla(51, 100%, 95%, 1);\n --rpf-yellow-200: hsla(52, 100%, 87%, 1);\n --rpf-yellow-400: hsla(51, 100%, 75%, 1);\n --rpf-yellow-600: hsla(52, 100%, 63%, 1);\n --rpf-yellow-800: hsla(52, 100%, 50%, 1);\n --rpf-yellow-900: hsla(52, 100%, 26%, 1);\n --rpf-purple-100: hsla(282, 36%, 95%, 1);\n --rpf-purple-200: hsla(279, 38%, 87%, 1);\n --rpf-purple-400: hsla(279, 38%, 73%, 1);\n --rpf-purple-600: hsla(279, 37%, 60%, 1);\n --rpf-purple-800: hsla(279, 43%, 47%, 1);\n --rpf-purple-900: hsla(280, 43%, 37%, 1);\n --rpf-navy-100: hsla(235, 38%, 94%, 1);\n --rpf-navy-200: hsla(234, 38%, 84%, 1);\n --rpf-navy-400: hsla(235, 38%, 69%, 1);\n --rpf-navy-600: hsla(235, 38%, 53%, 1);\n --rpf-navy-800: hsla(235, 63%, 37%, 1);\n --rpf-navy-900: hsla(234, 63%, 30%, 1);\n --rpf-blue-100: hsla(203, 86%, 95%, 1);\n --rpf-blue-200: hsla(204, 88%, 87%, 1);\n --rpf-blue-400: hsla(204, 88%, 74%, 1);\n --rpf-blue-600: hsla(204, 89%, 60%, 1);\n --rpf-blue-800: hsla(204, 100%, 47%, 1);\n --rpf-blue-900: hsla(204, 99%, 37%, 1);\n}\n\n:root, :host {\n --font-size-0-5: 0.5rem;\n --font-size-0-75: 0.75rem;\n --font-size-1: 1rem;\n --font-size-1-5: 1.25rem;\n --font-size-2: 1.5rem;\n --font-size-3: 2rem;\n --font-size-4: 2.5rem;\n --font-size-5: 3rem;\n --font-size-6: 3.5rem;\n --font-size-7: 4rem;\n --font-size-8: 4.5rem;\n --font-size-9: 5rem;\n}\n\n:root, :host {\n --font-weight-regular: 400;\n --font-weight-bold: 700;\n}\n\n:root, :host {\n --line-height-0-75: 0.75rem;\n --line-height-1: 1rem;\n --line-height-1-5: 1.5rem;\n --line-height-2: 2rem;\n --line-height-2-5: 2.5rem;\n --line-height-3: 3rem;\n --line-height-3-5: 3.5rem;\n --line-height-4: 4rem;\n --line-height-4-5: 4.5rem;\n --line-height-5: 5rem;\n --line-height-5-5: 5.5rem;\n --line-height-6: 6rem;\n --line-height-6-5: 6.5rem;\n}\n\n:root, :host {\n --border-radius: var(--space-1);\n --border-radius-sm: var(--space-0-5);\n --border-width-sm: 1px;\n --border-width-md: 2px;\n --border-width-lg: 3px;\n --alert-border-width: var(--border-width-md);\n --fieldset-border-width: var(--border-width-md);\n --input-border-width: var(--border-width-md);\n --table-border-width: var(--border-width-sm);\n}\n\n:root, :host {\n --rpf-brand-black: hsla(60, 4%, 11%, 1);\n --rpf-brand-leaf: hsla(123, 43%, 48%, 1);\n --rpf-brand-raspberry: hsla(342, 71%, 47%, 1);\n --rpf-raspberry-50: hsla(338, 57%, 97%, 1);\n --rpf-raspberry-100: hsla(342, 62%, 96%, 1);\n --rpf-raspberry-200: hsla(344, 73%, 93%, 1);\n --rpf-raspberry-400: hsla(341, 63%, 84%, 1);\n --rpf-raspberry-500: hsla(343, 62%, 68%, 1);\n --rpf-raspberry-600: hsla(343, 64%, 58%, 1);\n --rpf-raspberry-800: hsla(342, 71%, 47%, 1);\n --rpf-raspberry-900: hsla(340, 78%, 36%, 1);\n}\n\n:root, :host {\n --rpf-white: hsla(0, 0%, 100%, 1);\n --rpf-off-white: hsla(225, 25%, 97%, 1);\n --rpf-grey-50: hsla(210, 8%, 95%, 1);\n --rpf-grey-100: hsla(228, 10%, 90%, 1);\n --rpf-grey-150: hsla(223, 9%, 85%, 1);\n --rpf-grey-200: hsla(228, 10%, 80%, 1);\n --rpf-grey-300: hsla(229, 9%, 75%, 1);\n --rpf-grey-400: hsla(229, 8%, 61%, 1);\n --rpf-grey-500: hsla(229, 9%, 42%, 1);\n --rpf-grey-600: hsla(228, 9%, 32%, 1);\n --rpf-grey-700: hsla(228, 9%, 22%, 1);\n --rpf-grey-800: hsla(232, 9%, 18%, 1);\n --rpf-grey-850: hsla(228, 9%, 15%, 1);\n --rpf-grey-900: hsla(228, 9%, 10%, 1);\n --rpf-grey-950: hsla(228, 8%, 5%, 1);\n --rpf-black: hsla(0, 0%, 0%, 1);\n}\n\n:root, :host {\n --space-0-125: 0.0625rem;\n --space-0-25: 0.125rem;\n --space-0-5: 0.25rem;\n --space-1: 0.5rem;\n --space-1-5: 0.75rem;\n --space-2: 1rem;\n --space-3: 1.5rem;\n --space-4: 2rem;\n --space-5: 2.5rem;\n --space-6: 3rem;\n --space-7: 3.5rem;\n --space-8: 4rem;\n --space-9: 4.5rem;\n --space-10: 5rem;\n}\n\n.rpf-accordion {\n --background-color: var(--rpf-white);\n --border-color: var(--rpf-grey-50);\n --border-width: var(--border-width-sm);\n --text-color: var(--rpf-text-primary);\n --icon-color: var(--rpf-navy-800);\n background: var(--background-color);\n border-block-start: var(--border-width) solid var(--border-color);\n}\n.rpf-accordion:last-of-type {\n border-block-end: var(--border-width) solid var(--border-color);\n}\n.rpf-accordion__container {\n border-block-start: var(--border-width) solid var(--border-color);\n}\n.rpf-accordion__container:first-of-type {\n border-block-start: none;\n}\n.rpf-accordion__text {\n font-size: var(--font-size-1);\n font-weight: var(--font-weight-regular);\n line-height: var(--line-height-1-5);\n color: var(--text-color);\n margin: 0;\n padding-block-end: var(--space-2);\n padding-block-start: var(--space-1);\n padding-inline: var(--space-2);\n}\n.rpf-accordion__title {\n font-size: var(--font-size-1-5);\n font-weight: var(--font-weight-bold);\n line-height: var(--line-height-1-5);\n align-items: center;\n color: var(--text-color);\n cursor: pointer;\n display: flex;\n justify-content: space-between;\n list-style: none;\n padding-block: var(--space-2);\n padding-inline: var(--space-2);\n}\n.rpf-accordion__title::marker {\n display: none;\n}\n.rpf-accordion__title:focus-visible {\n outline: var(--border-width-lg) solid var(--rpf-brand-raspberry);\n}\n.rpf-accordion__icon {\n background: transparent;\n display: block;\n block-size: var(--space-0-25);\n margin-block-start: 0;\n margin-inline-start: var(--space-2);\n position: relative;\n inline-size: var(--space-2);\n}\n.rpf-accordion__icon::before, .rpf-accordion__icon::after {\n background: var(--icon-color);\n border-radius: var(--border-radius);\n content: \"\";\n block-size: var(--space-0-25);\n position: absolute;\n transition: all 0.3s;\n inline-size: var(--space-2);\n}\n.rpf-accordion__icon::before {\n transform: rotate(90deg);\n}\n.rpf-accordion[open] .rpf-accordion__icon::before, .rpf-accordion__container[open] .rpf-accordion__icon::before {\n transform: rotate(180deg);\n}\n";
|
|
1142
|
-
styleInject(css_248z$e);
|
|
1143
|
-
|
|
1144
|
-
const Accordion = ({
|
|
1145
|
-
content,
|
|
1146
|
-
title,
|
|
1147
|
-
className,
|
|
1148
|
-
id = "accordion"
|
|
1149
|
-
}) => {
|
|
1150
|
-
const classes = classNames("rpf-accordion", className);
|
|
1151
|
-
return /*#__PURE__*/React.createElement("details", {
|
|
1152
|
-
className: classes,
|
|
1153
|
-
id: `${id}`
|
|
1154
|
-
}, /*#__PURE__*/React.createElement("summary", {
|
|
1155
|
-
className: "rpf-accordion__title",
|
|
1156
|
-
role: "button"
|
|
1157
|
-
}, title, /*#__PURE__*/React.createElement("span", {
|
|
1158
|
-
className: "rpf-accordion__icon"
|
|
1159
|
-
})), /*#__PURE__*/React.createElement("p", {
|
|
1160
|
-
className: "rpf-accordion__text"
|
|
1161
|
-
}, content));
|
|
1162
|
-
};
|
|
1163
|
-
Accordion.propTypes = {
|
|
1164
|
-
content: PropTypes.string.isRequired,
|
|
1165
|
-
title: PropTypes.string.isRequired,
|
|
1166
|
-
id: PropTypes.string,
|
|
1167
|
-
className: PropTypes.string
|
|
1168
|
-
};
|
|
1169
|
-
|
|
1170
|
-
var css_248z$d = ":root, :host {\n --rpf-brand-black: hsla(60, 4%, 11%, 1);\n --rpf-brand-leaf: hsla(123, 43%, 48%, 1);\n --rpf-brand-raspberry: hsla(342, 71%, 47%, 1);\n --rpf-raspberry-50: hsla(338, 57%, 97%, 1);\n --rpf-raspberry-100: hsla(342, 62%, 96%, 1);\n --rpf-raspberry-200: hsla(344, 73%, 93%, 1);\n --rpf-raspberry-400: hsla(341, 63%, 84%, 1);\n --rpf-raspberry-500: hsla(343, 62%, 68%, 1);\n --rpf-raspberry-600: hsla(343, 64%, 58%, 1);\n --rpf-raspberry-800: hsla(342, 71%, 47%, 1);\n --rpf-raspberry-900: hsla(340, 78%, 36%, 1);\n}\n\n:root, :host {\n --rpf-red-100: hsla(4, 89%, 96%, 1);\n --rpf-red-200: hsla(1, 87%, 91%, 1);\n --rpf-red-400: hsla(1, 87%, 82%, 1);\n --rpf-red-600: hsla(1, 87%, 72%, 1);\n --rpf-red-800: hsla(1, 87%, 63%, 1);\n --rpf-red-900: hsla(1, 52%, 50%, 1);\n --rpf-green-100: hsla(125, 41%, 95%, 1);\n --rpf-green-200: hsla(122, 39%, 87%, 1);\n --rpf-green-400: hsla(123, 40%, 74%, 1);\n --rpf-green-600: hsla(123, 40%, 61%, 1);\n --rpf-green-800: hsla(123, 43%, 48%, 1);\n --rpf-green-900: hsla(123, 43%, 34%, 1);\n --rpf-teal-100: hsla(176, 55%, 94%, 1);\n --rpf-teal-200: hsla(174, 55%, 85%, 1);\n --rpf-teal-400: hsla(174, 55%, 70%, 1);\n --rpf-teal-600: hsla(174, 56%, 56%, 1);\n --rpf-teal-800: hsla(174, 81%, 41%, 1);\n --rpf-teal-900: hsla(174, 81%, 27%, 1);\n --rpf-teal-950: hsla(174, 80%, 20%, 1);\n --rpf-orange-100: hsla(31, 100%, 95%, 1);\n --rpf-orange-200: hsla(32, 100%, 88%, 1);\n --rpf-orange-400: hsla(31, 100%, 77%, 1);\n --rpf-orange-600: hsla(31, 99%, 65%, 1);\n --rpf-orange-800: hsla(31, 99%, 54%, 1);\n --rpf-orange-900: hsla(31, 85%, 35%, 1);\n --rpf-yellow-100: hsla(51, 100%, 95%, 1);\n --rpf-yellow-200: hsla(52, 100%, 87%, 1);\n --rpf-yellow-400: hsla(51, 100%, 75%, 1);\n --rpf-yellow-600: hsla(52, 100%, 63%, 1);\n --rpf-yellow-800: hsla(52, 100%, 50%, 1);\n --rpf-yellow-900: hsla(52, 100%, 26%, 1);\n --rpf-purple-100: hsla(282, 36%, 95%, 1);\n --rpf-purple-200: hsla(279, 38%, 87%, 1);\n --rpf-purple-400: hsla(279, 38%, 73%, 1);\n --rpf-purple-600: hsla(279, 37%, 60%, 1);\n --rpf-purple-800: hsla(279, 43%, 47%, 1);\n --rpf-purple-900: hsla(280, 43%, 37%, 1);\n --rpf-navy-100: hsla(235, 38%, 94%, 1);\n --rpf-navy-200: hsla(234, 38%, 84%, 1);\n --rpf-navy-400: hsla(235, 38%, 69%, 1);\n --rpf-navy-600: hsla(235, 38%, 53%, 1);\n --rpf-navy-800: hsla(235, 63%, 37%, 1);\n --rpf-navy-900: hsla(234, 63%, 30%, 1);\n --rpf-blue-100: hsla(203, 86%, 95%, 1);\n --rpf-blue-200: hsla(204, 88%, 87%, 1);\n --rpf-blue-400: hsla(204, 88%, 74%, 1);\n --rpf-blue-600: hsla(204, 89%, 60%, 1);\n --rpf-blue-800: hsla(204, 100%, 47%, 1);\n --rpf-blue-900: hsla(204, 99%, 37%, 1);\n}\n\n:root, :host {\n --rpf-white: hsla(0, 0%, 100%, 1);\n --rpf-off-white: hsla(225, 25%, 97%, 1);\n --rpf-grey-50: hsla(210, 8%, 95%, 1);\n --rpf-grey-100: hsla(228, 10%, 90%, 1);\n --rpf-grey-150: hsla(223, 9%, 85%, 1);\n --rpf-grey-200: hsla(228, 10%, 80%, 1);\n --rpf-grey-300: hsla(229, 9%, 75%, 1);\n --rpf-grey-400: hsla(229, 8%, 61%, 1);\n --rpf-grey-500: hsla(229, 9%, 42%, 1);\n --rpf-grey-600: hsla(228, 9%, 32%, 1);\n --rpf-grey-700: hsla(228, 9%, 22%, 1);\n --rpf-grey-800: hsla(232, 9%, 18%, 1);\n --rpf-grey-850: hsla(228, 9%, 15%, 1);\n --rpf-grey-900: hsla(228, 9%, 10%, 1);\n --rpf-grey-950: hsla(228, 8%, 5%, 1);\n --rpf-black: hsla(0, 0%, 0%, 1);\n}\n\n:root, :host {\n --rpf-alert-error-highlight: hsla(0, 88%, 99%, 1);\n --rpf-alert-error: hsla(0, 88%, 33%, 1);\n --rpf-alert-information-highlight: hsla(225, 64%, 99%, 1);\n --rpf-alert-information: hsla(225, 64%, 33%, 1);\n --rpf-alert-success-highlight: hsla(136, 90%, 99%, 1);\n --rpf-alert-success: hsla(136, 90%, 20%, 1);\n --rpf-alert-warning-highlight: hsla(26, 70%, 99%, 1);\n --rpf-alert-warning: hsla(26, 70%, 29%, 1);\n}\n\n:root, :host {\n --font-size-0-5: 0.5rem;\n --font-size-0-75: 0.75rem;\n --font-size-1: 1rem;\n --font-size-1-5: 1.25rem;\n --font-size-2: 1.5rem;\n --font-size-3: 2rem;\n --font-size-4: 2.5rem;\n --font-size-5: 3rem;\n --font-size-6: 3.5rem;\n --font-size-7: 4rem;\n --font-size-8: 4.5rem;\n --font-size-9: 5rem;\n}\n\n:root, :host {\n --font-weight-regular: 400;\n --font-weight-bold: 700;\n}\n\n:root, :host {\n --border-radius: var(--space-1);\n --border-radius-sm: var(--space-0-5);\n --border-width-sm: 1px;\n --border-width-md: 2px;\n --border-width-lg: 3px;\n --alert-border-width: var(--border-width-md);\n --fieldset-border-width: var(--border-width-md);\n --input-border-width: var(--border-width-md);\n --table-border-width: var(--border-width-sm);\n}\n\n:root, :host {\n --space-0-125: 0.0625rem;\n --space-0-25: 0.125rem;\n --space-0-5: 0.25rem;\n --space-1: 0.5rem;\n --space-1-5: 0.75rem;\n --space-2: 1rem;\n --space-3: 1.5rem;\n --space-4: 2rem;\n --space-5: 2.5rem;\n --space-6: 3rem;\n --space-7: 3.5rem;\n --space-8: 4rem;\n --space-9: 4.5rem;\n --space-10: 5rem;\n}\n\n:root, :host {\n /* 44px min-height to meet WCAG AAA target size requirements */\n --min-target-size: 44px;\n --sm-target-size: 32px;\n --lg-target-size: 48px;\n}\n\n.rpf-button {\n --rpf-button-background-color: var(--rpf-navy-800);\n --rpf-button-background-color-hover: var(--rpf-navy-900);\n --rpf-button-background-color-active: var(--rpf-navy-600);\n --rpf-button-background-color-disabled: var(--rpf-grey-600);\n --rpf-button-text-color: var(--rpf-white);\n --rpf-button-border-color: var(--rpf-button-background-color);\n --rpf-button-border-color-hover: var(--rpf-button-background-color-hover);\n --rpf-button-border-color-active: var(--rpf-button-background-color-active);\n --rpf-button-border-color-disabled: var(--rpf-button-background-color-disabled);\n --rpf-button-danger-background-color: var(--rpf-alert-error);\n --rpf-button-danger-background-color-hover: var(--rpf-alert-error);\n --rpf-button-danger-background-color-active: var(--rpf-red-900);\n --rpf-button-danger-background-color-disabled: var(--rpf-grey-600);\n --rpf-button-danger-text-color: var(--rpf-white);\n --rpf-button-danger-border-color: var(--rpf-button-danger-background-color);\n --rpf-button-danger-border-color-hover: var(--rpf-button-danger-background-color-hover);\n --rpf-button-danger-border-color-active: var(--rpf-button-danger-background-color-active);\n --rpf-button-danger-border-color-disabled: var(--rpf-button-danger-background-color-disabled);\n --rpf-button-border-radius: var(--border-radius);\n --rpf-button-border-width: var(--border-width-md);\n --rpf-button-lg-height: var(--lg-target-size);\n --rpf-button-sm-height: var(--sm-target-size);\n --rpf-button-min-target-size: var(--min-target-size);\n all: unset;\n align-items: center;\n box-sizing: border-box;\n color: var(--rpf-button-text-color);\n /*\n * We've decided to follow the masses on this and have a pointer on buttons.\n * Google, Facebook, Twitter, Mozilla, and Microsoft amongst many others have a pointer on buttons.\n */\n cursor: pointer;\n display: flex;\n font-size: var(--font-size-1-5);\n font-weight: var(--font-weight-bold);\n gap: var(--space-1);\n min-block-size: var(--rpf-button-lg-height);\n padding: var(--space-1) var(--space-2);\n position: relative;\n text-align: center;\n text-decoration: none;\n /* Fixes a rendering error that sometimes occurs due to negative z-index */\n transform: scale(1);\n inline-size: fit-content;\n /* A bit of a hack to allow for separate visual and target heights */\n}\n.rpf-button::before {\n background-color: var(--rpf-button-background-color);\n border-color: var(--rpf-button-border-color);\n border-radius: var(--rpf-button-border-radius);\n border-style: solid;\n border-width: var(--rpf-button-border-width);\n content: \"\";\n display: block;\n inset: 0;\n position: absolute;\n /* To ensure it renders under its siblings */\n z-index: -1;\n}\n.rpf-button:hover::before {\n background-color: var(--rpf-button-background-color-hover);\n border-color: var(--rpf-button-border-color-hover);\n}\n.rpf-button:active::before {\n background-color: var(--rpf-button-background-color-active);\n border-color: var(--rpf-button-border-color-active);\n}\n.rpf-button:focus-visible::before {\n outline: var(--border-width-md) solid var(--rpf-button-background-color);\n outline-offset: 3px;\n}\n.rpf-button:disabled, .rpf-button--disabled {\n cursor: default;\n}\n.rpf-button:disabled::before, .rpf-button:disabled:hover::before, .rpf-button--disabled::before, .rpf-button--disabled:hover::before {\n border-color: var(--rpf-button-border-color-disabled);\n background-color: var(--rpf-button-background-color-disabled);\n}\n.rpf-button--secondary {\n color: var(--rpf-button-background-color);\n}\n.rpf-button--secondary::before {\n background-color: var(--rpf-button-text-color);\n}\n.rpf-button--secondary:hover {\n color: var(--rpf-button-background-color-hover);\n}\n.rpf-button--secondary:hover::before {\n background-color: var(--rpf-button-text-color);\n border-color: var(--rpf-button-border-color-hover);\n}\n.rpf-button--secondary:active {\n color: var(--rpf-button-background-color-active);\n}\n.rpf-button--secondary:active::before {\n background-color: var(--rpf-button-text-color);\n border-color: var(--rpf-button-border-color-active);\n}\n.rpf-button--secondary:disabled, .rpf-button--secondary.rpf-button--disabled {\n color: var(--rpf-button-background-color-disabled);\n}\n.rpf-button--secondary:disabled:hover::before, .rpf-button--secondary:disabled:before, .rpf-button--secondary.rpf-button--disabled:hover::before, .rpf-button--secondary.rpf-button--disabled:before {\n background-color: var(--rpf-button-text-color);\n border-color: var(--rpf-button-border-color-disabled);\n}\n.rpf-button--secondary.rpf-button--danger {\n color: var(--rpf-button-danger-background-color);\n}\n.rpf-button--secondary.rpf-button--danger::before {\n background-color: var(--rpf-button-danger-text-color);\n}\n.rpf-button--secondary.rpf-button--danger:hover {\n color: var(--rpf-button-danger-background-color-hover);\n}\n.rpf-button--secondary.rpf-button--danger:hover::before {\n background-color: var(--rpf-button-danger-text-color);\n border-color: var(--rpf-button-danger-border-color-hover);\n}\n.rpf-button--secondary.rpf-button--danger:active {\n color: var(--rpf-button-danger-background-color-active);\n}\n.rpf-button--secondary.rpf-button--danger:active::before {\n background-color: var(--rpf-button-danger-text-color);\n border-color: var(--rpf-button-danger-border-color-active);\n}\n.rpf-button--secondary.rpf-button--danger:disabled, .rpf-button--secondary.rpf-button--danger.rpf-button--disabled {\n color: var(--rpf-button-danger-background-color-disabled);\n}\n.rpf-button--secondary.rpf-button--danger:disabled:hover::before, .rpf-button--secondary.rpf-button--danger:disabled:before, .rpf-button--secondary.rpf-button--danger.rpf-button--disabled:hover::before, .rpf-button--secondary.rpf-button--danger.rpf-button--disabled:before {\n background-color: var(--rpf-button-danger-text-color);\n border-color: var(--rpf-button-danger-border-color-disabled);\n}\n.rpf-button--tertiary {\n color: var(--rpf-button-background-color);\n}\n.rpf-button--tertiary::before {\n background-color: transparent;\n border-color: transparent;\n}\n.rpf-button--tertiary:hover {\n color: var(--rpf-button-background-color-hover);\n}\n.rpf-button--tertiary:hover::before {\n background-color: transparent;\n border-color: transparent;\n}\n.rpf-button--tertiary:active {\n color: var(--rpf-button-background-color-active);\n}\n.rpf-button--tertiary:active::before {\n background-color: transparent;\n}\n.rpf-button--tertiary:disabled, .rpf-button--tertiary.rpf-button--disabled {\n color: var(--rpf-button-background-color-disabled);\n}\n.rpf-button--tertiary:disabled::before, .rpf-button--tertiary:disabled:hover::before, .rpf-button--tertiary.rpf-button--disabled::before, .rpf-button--tertiary.rpf-button--disabled:hover::before {\n background-color: transparent;\n border-color: transparent;\n}\n.rpf-button--tertiary.rpf-button--danger {\n color: var(--rpf-button-danger-background-color);\n}\n.rpf-button--tertiary.rpf-button--danger::before {\n background-color: transparent;\n border-color: transparent;\n}\n.rpf-button--tertiary.rpf-button--danger:hover {\n color: var(--rpf-button-danger-background-color-hover);\n}\n.rpf-button--tertiary.rpf-button--danger:hover::before {\n background-color: transparent;\n border-color: transparent;\n}\n.rpf-button--tertiary.rpf-button--danger:active {\n color: var(--rpf-button-danger-background-color-active);\n}\n.rpf-button--tertiary.rpf-button--danger:active::before {\n background-color: transparent;\n}\n.rpf-button--tertiary.rpf-button--danger:disabled, .rpf-button--tertiary.rpf-button--danger.rpf-button--disabled {\n color: var(--rpf-button-danger-background-color-disabled);\n}\n.rpf-button--tertiary.rpf-button--danger:disabled::before, .rpf-button--tertiary.rpf-button--danger:disabled:hover::before, .rpf-button--tertiary.rpf-button--danger.rpf-button--disabled::before, .rpf-button--tertiary.rpf-button--danger.rpf-button--disabled:hover::before {\n background-color: transparent;\n border-color: transparent;\n}\n.rpf-button--danger {\n color: var(--rpf-button-danger-text-color);\n}\n.rpf-button--danger::before {\n background-color: var(--rpf-button-danger-background-color);\n border-color: var(--rpf-button-danger-border-color);\n}\n.rpf-button--danger:hover::before {\n background-color: var(--rpf-button-danger-background-color-hover);\n border-color: var(--rpf-button-danger-border-color-hover);\n}\n.rpf-button--danger:active::before {\n background-color: var(--rpf-button-danger-background-color-active);\n border-color: var(--rpf-button-danger-border-color-active);\n}\n.rpf-button--danger:focus-visible::before {\n outline: var(--border-width-md) solid var(--rpf-button-danger-background-color);\n}\n.rpf-button--icon-only {\n block-size: var(--rpf-button-lg-height);\n line-height: var(--rpf-button-lg-height);\n padding: 0;\n text-align: center;\n inline-size: var(--rpf-button-lg-height);\n}\n.rpf-button--icon-only .rpf-button__icon {\n margin: 0 auto;\n}\n.rpf-button--sm {\n font-size: var(--font-size-1);\n min-block-size: var(--rpf-button-min-target-size);\n padding: var(--space-1) var(--space-1);\n /* To account for 32px visual height and 44px target height */\n}\n.rpf-button--sm::before {\n inset: calc((var(--rpf-button-min-target-size) - var(--rpf-button-sm-height)) / 2) 0;\n}\n.rpf-button--sm.rpf-button--icon-only {\n block-size: var(--rpf-button-min-target-size);\n line-height: var(--rpf-button-min-target-size);\n padding: 0;\n inline-size: var(--rpf-button-min-target-size);\n}\n.rpf-button--sm.rpf-button--icon-only::before {\n inset: calc((var(--rpf-button-min-target-size) - var(--rpf-button-sm-height)) / 2);\n}\n.rpf-button--sm .material-symbols-sharp {\n font-size: 20px;\n font-variation-settings: \"OPSZ\" 20;\n}\n.rpf-button--full-width {\n justify-content: center;\n inline-size: 100%;\n}\n";
|
|
1171
|
-
styleInject(css_248z$d);
|
|
1172
|
-
|
|
1173
|
-
/* eslint-disable complexity */
|
|
1174
|
-
const Button = ({
|
|
1175
|
-
text,
|
|
1176
|
-
href,
|
|
1177
|
-
title,
|
|
1178
|
-
className,
|
|
1179
|
-
type = "primary",
|
|
1180
|
-
variant = "",
|
|
1181
|
-
size = "default",
|
|
1182
|
-
icon = "",
|
|
1183
|
-
iconOnly = false,
|
|
1184
|
-
iconPosition = "left",
|
|
1185
|
-
fullWidth = false,
|
|
1186
|
-
disabled = false,
|
|
1187
|
-
onClick = () => {},
|
|
1188
|
-
"aria-label": ariaLabel = ""
|
|
1189
|
-
}) => {
|
|
1190
|
-
const iconButton = icon && iconOnly;
|
|
1191
|
-
const classes = classNames(
|
|
1192
|
-
// Static classes
|
|
1193
|
-
"rpf-button",
|
|
1194
|
-
// Conditional classes
|
|
1195
|
-
{
|
|
1196
|
-
[`rpf-button--${type}`]: type,
|
|
1197
|
-
"rpf-button--danger": variant === "danger",
|
|
1198
|
-
"rpf-button--sm": size === "small",
|
|
1199
|
-
"rpf-button--icon-only": iconButton,
|
|
1200
|
-
"rpf-button--full-width": fullWidth,
|
|
1201
|
-
disabled
|
|
1202
|
-
}, className);
|
|
1203
|
-
let iconClasses = "rpf-button__icon";
|
|
1204
|
-
if (/*#__PURE__*/React.isValidElement(icon)) {
|
|
1205
|
-
iconClasses += " icon";
|
|
1206
|
-
console.warn("DEPRECATED: icons as React elements will not be supported in future releases");
|
|
1207
|
-
} else {
|
|
1208
|
-
iconClasses += " material-symbols-sharp";
|
|
1209
|
-
}
|
|
1210
|
-
const renderIcon = position => icon && iconPosition === position && /*#__PURE__*/React.createElement("span", {
|
|
1211
|
-
className: iconClasses
|
|
1212
|
-
}, icon);
|
|
1213
|
-
const renderText = () => text && !iconButton && /*#__PURE__*/React.createElement("span", {
|
|
1214
|
-
className: "text"
|
|
1215
|
-
}, text);
|
|
1216
|
-
const content = /*#__PURE__*/React.createElement(React.Fragment, null, renderIcon("left"), renderText(), renderIcon("right"));
|
|
1217
|
-
if (href) {
|
|
1218
|
-
return /*#__PURE__*/React.createElement(Link, {
|
|
1219
|
-
className: classes,
|
|
1220
|
-
to: href,
|
|
1221
|
-
onClick: onClick,
|
|
1222
|
-
"aria-label": ariaLabel
|
|
1223
|
-
}, content);
|
|
1224
|
-
}
|
|
1225
|
-
return /*#__PURE__*/React.createElement("button", {
|
|
1226
|
-
className: classes,
|
|
1227
|
-
title: title,
|
|
1228
|
-
onClick: onClick,
|
|
1229
|
-
disabled: disabled,
|
|
1230
|
-
"aria-label": ariaLabel
|
|
1231
|
-
}, content);
|
|
1232
|
-
};
|
|
1233
|
-
Button.propTypes = {
|
|
1234
|
-
type: PropTypes.string,
|
|
1235
|
-
className: PropTypes.string,
|
|
1236
|
-
disabled: PropTypes.bool,
|
|
1237
|
-
icon: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
|
|
1238
|
-
href: PropTypes.string,
|
|
1239
|
-
onClick: PropTypes.func,
|
|
1240
|
-
text: PropTypes.string,
|
|
1241
|
-
iconOnly: PropTypes.bool,
|
|
1242
|
-
title: PropTypes.string,
|
|
1243
|
-
iconPosition: PropTypes.oneOf(["left", "right"]),
|
|
1244
|
-
size: PropTypes.oneOf(["default", "small"]),
|
|
1245
|
-
// added size prop
|
|
1246
|
-
"aria-label": PropTypes.string
|
|
1247
|
-
};
|
|
1248
|
-
|
|
1249
|
-
var css_248z$c = ":root, :host {\n --font-size-0-5: 0.5rem;\n --font-size-0-75: 0.75rem;\n --font-size-1: 1rem;\n --font-size-1-5: 1.25rem;\n --font-size-2: 1.5rem;\n --font-size-3: 2rem;\n --font-size-4: 2.5rem;\n --font-size-5: 3rem;\n --font-size-6: 3.5rem;\n --font-size-7: 4rem;\n --font-size-8: 4.5rem;\n --font-size-9: 5rem;\n}\n\n:root, :host {\n --font-weight-regular: 400;\n --font-weight-bold: 700;\n}\n\n:root, :host {\n --line-height-0-75: 0.75rem;\n --line-height-1: 1rem;\n --line-height-1-5: 1.5rem;\n --line-height-2: 2rem;\n --line-height-2-5: 2.5rem;\n --line-height-3: 3rem;\n --line-height-3-5: 3.5rem;\n --line-height-4: 4rem;\n --line-height-4-5: 4.5rem;\n --line-height-5: 5rem;\n --line-height-5-5: 5.5rem;\n --line-height-6: 6rem;\n --line-height-6-5: 6.5rem;\n}\n\n:root, :host {\n --rpf-alert-error-highlight: hsla(0, 88%, 99%, 1);\n --rpf-alert-error: hsla(0, 88%, 33%, 1);\n --rpf-alert-information-highlight: hsla(225, 64%, 99%, 1);\n --rpf-alert-information: hsla(225, 64%, 33%, 1);\n --rpf-alert-success-highlight: hsla(136, 90%, 99%, 1);\n --rpf-alert-success: hsla(136, 90%, 20%, 1);\n --rpf-alert-warning-highlight: hsla(26, 70%, 99%, 1);\n --rpf-alert-warning: hsla(26, 70%, 29%, 1);\n}\n\n:root, :host {\n --rpf-white: hsla(0, 0%, 100%, 1);\n --rpf-off-white: hsla(225, 25%, 97%, 1);\n --rpf-grey-50: hsla(210, 8%, 95%, 1);\n --rpf-grey-100: hsla(228, 10%, 90%, 1);\n --rpf-grey-150: hsla(223, 9%, 85%, 1);\n --rpf-grey-200: hsla(228, 10%, 80%, 1);\n --rpf-grey-300: hsla(229, 9%, 75%, 1);\n --rpf-grey-400: hsla(229, 8%, 61%, 1);\n --rpf-grey-500: hsla(229, 9%, 42%, 1);\n --rpf-grey-600: hsla(228, 9%, 32%, 1);\n --rpf-grey-700: hsla(228, 9%, 22%, 1);\n --rpf-grey-800: hsla(232, 9%, 18%, 1);\n --rpf-grey-850: hsla(228, 9%, 15%, 1);\n --rpf-grey-900: hsla(228, 9%, 10%, 1);\n --rpf-grey-950: hsla(228, 8%, 5%, 1);\n --rpf-black: hsla(0, 0%, 0%, 1);\n}\n\n:root, :host {\n --rpf-text-primary: hsla(0, 0%, 13%, 1);\n --rpf-text-primary-darkmode: var(--rpf-white);\n --rpf-text-secondary: hsla(200, 9%, 33%, 1);\n --rpf-text-secondary-darkmode: hsla(0, 0%, 80%, 1);\n --rpf-link-text: var(--rpf-navy-800);\n}\n\n:root, :host {\n --border-radius: var(--space-1);\n --border-radius-sm: var(--space-0-5);\n --border-width-sm: 1px;\n --border-width-md: 2px;\n --border-width-lg: 3px;\n --alert-border-width: var(--border-width-md);\n --fieldset-border-width: var(--border-width-md);\n --input-border-width: var(--border-width-md);\n --table-border-width: var(--border-width-sm);\n}\n\n:root, :host {\n --space-0-125: 0.0625rem;\n --space-0-25: 0.125rem;\n --space-0-5: 0.25rem;\n --space-1: 0.5rem;\n --space-1-5: 0.75rem;\n --space-2: 1rem;\n --space-3: 1.5rem;\n --space-4: 2rem;\n --space-5: 2.5rem;\n --space-6: 3rem;\n --space-7: 3.5rem;\n --space-8: 4rem;\n --space-9: 4.5rem;\n --space-10: 5rem;\n}\n\n:root,\n:host {\n --rpf-alert-background-color: var(--rpf-alert-information-highlight);\n --rpf-alert-color: var(--rpf-alert-information);\n}\n\n.rpf-alert {\n align-items: center;\n background-color: var(--rpf-alert-background-color);\n border-color: var(--rpf-alert-color);\n border-radius: var(--border-radius);\n border-style: solid;\n border-width: var(--alert-border-width);\n color: var(--rpf-text-primary);\n display: flex;\n flex-direction: column;\n margin-block-end: var(--space-2);\n position: relative;\n text-align: center;\n}\n.rpf-alert__header {\n box-sizing: border-box;\n display: flex;\n flex-direction: row;\n gap: var(--space-1);\n align-items: center;\n justify-content: space-between;\n min-block-size: var(--space-6);\n inline-size: 100%;\n padding-inline: var(--space-2) var(--space-1);\n}\n.rpf-alert__icon {\n color: var(--rpf-alert-color);\n font-size: var(--font-size-2);\n}\n.rpf-alert__body {\n font-size: var(--font-size-1);\n font-weight: var(--font-weight-regular);\n line-height: var(--line-height-1-5);\n align-self: stretch;\n display: flex;\n flex-direction: column;\n gap: var(--space-2);\n padding-block-end: var(--space-2);\n padding-inline: var(--space-2);\n text-align: start;\n}\n.rpf-alert__body * {\n margin: 0;\n padding: 0;\n}\n.rpf-alert__title {\n font-size: var(--font-size-1);\n font-weight: var(--font-weight-bold);\n line-height: var(--line-height-1-5);\n inline-size: 100%;\n margin-block: var(--space-2);\n margin-inline: 0;\n text-align: start;\n}\n.rpf-alert__actions {\n display: flex;\n flex-direction: row;\n gap: var(--space-2);\n}\n.rpf-alert__close {\n background: none;\n border: none;\n color: inherit;\n cursor: pointer;\n font-size: var(--font-size-2);\n margin-inline-start: auto;\n inset-inline-end: var(--space-0-5);\n inset-block-start: var(--space-0-5);\n}\n.rpf-alert__close .rpf-button__icon {\n color: var(--rpf-text-primary);\n}\n.rpf-alert--hidden {\n display: none;\n}\n.rpf-alert--error {\n --rpf-alert-background-color: var(--rpf-alert-error-highlight);\n --rpf-alert-color: var(--rpf-alert-error);\n}\n.rpf-alert--error .rpf-alert__icon::after {\n content: \"error_outline\";\n}\n.rpf-alert--information .rpf-alert__icon::after {\n content: \"info\";\n}\n.rpf-alert--warning {\n --rpf-alert-background-color: var(--rpf-alert-warning-highlight);\n --rpf-alert-color: var(--rpf-alert-warning);\n}\n.rpf-alert--warning .rpf-alert__icon::after {\n content: \"warning_amber\";\n}\n.rpf-alert--success {\n --rpf-alert-background-color: var(--rpf-alert-success-highlight);\n --rpf-alert-color: var(--rpf-alert-success);\n}\n.rpf-alert--success .rpf-alert__icon::after {\n content: \"check_circle\";\n}\n\n:root, :host {\n --rpf-brand-black: hsla(60, 4%, 11%, 1);\n --rpf-brand-leaf: hsla(123, 43%, 48%, 1);\n --rpf-brand-raspberry: hsla(342, 71%, 47%, 1);\n --rpf-raspberry-50: hsla(338, 57%, 97%, 1);\n --rpf-raspberry-100: hsla(342, 62%, 96%, 1);\n --rpf-raspberry-200: hsla(344, 73%, 93%, 1);\n --rpf-raspberry-400: hsla(341, 63%, 84%, 1);\n --rpf-raspberry-500: hsla(343, 62%, 68%, 1);\n --rpf-raspberry-600: hsla(343, 64%, 58%, 1);\n --rpf-raspberry-800: hsla(342, 71%, 47%, 1);\n --rpf-raspberry-900: hsla(340, 78%, 36%, 1);\n}\n\n:root, :host {\n --rpf-red-100: hsla(4, 89%, 96%, 1);\n --rpf-red-200: hsla(1, 87%, 91%, 1);\n --rpf-red-400: hsla(1, 87%, 82%, 1);\n --rpf-red-600: hsla(1, 87%, 72%, 1);\n --rpf-red-800: hsla(1, 87%, 63%, 1);\n --rpf-red-900: hsla(1, 52%, 50%, 1);\n --rpf-green-100: hsla(125, 41%, 95%, 1);\n --rpf-green-200: hsla(122, 39%, 87%, 1);\n --rpf-green-400: hsla(123, 40%, 74%, 1);\n --rpf-green-600: hsla(123, 40%, 61%, 1);\n --rpf-green-800: hsla(123, 43%, 48%, 1);\n --rpf-green-900: hsla(123, 43%, 34%, 1);\n --rpf-teal-100: hsla(176, 55%, 94%, 1);\n --rpf-teal-200: hsla(174, 55%, 85%, 1);\n --rpf-teal-400: hsla(174, 55%, 70%, 1);\n --rpf-teal-600: hsla(174, 56%, 56%, 1);\n --rpf-teal-800: hsla(174, 81%, 41%, 1);\n --rpf-teal-900: hsla(174, 81%, 27%, 1);\n --rpf-teal-950: hsla(174, 80%, 20%, 1);\n --rpf-orange-100: hsla(31, 100%, 95%, 1);\n --rpf-orange-200: hsla(32, 100%, 88%, 1);\n --rpf-orange-400: hsla(31, 100%, 77%, 1);\n --rpf-orange-600: hsla(31, 99%, 65%, 1);\n --rpf-orange-800: hsla(31, 99%, 54%, 1);\n --rpf-orange-900: hsla(31, 85%, 35%, 1);\n --rpf-yellow-100: hsla(51, 100%, 95%, 1);\n --rpf-yellow-200: hsla(52, 100%, 87%, 1);\n --rpf-yellow-400: hsla(51, 100%, 75%, 1);\n --rpf-yellow-600: hsla(52, 100%, 63%, 1);\n --rpf-yellow-800: hsla(52, 100%, 50%, 1);\n --rpf-yellow-900: hsla(52, 100%, 26%, 1);\n --rpf-purple-100: hsla(282, 36%, 95%, 1);\n --rpf-purple-200: hsla(279, 38%, 87%, 1);\n --rpf-purple-400: hsla(279, 38%, 73%, 1);\n --rpf-purple-600: hsla(279, 37%, 60%, 1);\n --rpf-purple-800: hsla(279, 43%, 47%, 1);\n --rpf-purple-900: hsla(280, 43%, 37%, 1);\n --rpf-navy-100: hsla(235, 38%, 94%, 1);\n --rpf-navy-200: hsla(234, 38%, 84%, 1);\n --rpf-navy-400: hsla(235, 38%, 69%, 1);\n --rpf-navy-600: hsla(235, 38%, 53%, 1);\n --rpf-navy-800: hsla(235, 63%, 37%, 1);\n --rpf-navy-900: hsla(234, 63%, 30%, 1);\n --rpf-blue-100: hsla(203, 86%, 95%, 1);\n --rpf-blue-200: hsla(204, 88%, 87%, 1);\n --rpf-blue-400: hsla(204, 88%, 74%, 1);\n --rpf-blue-600: hsla(204, 89%, 60%, 1);\n --rpf-blue-800: hsla(204, 100%, 47%, 1);\n --rpf-blue-900: hsla(204, 99%, 37%, 1);\n}\n\n:root, :host {\n /* 44px min-height to meet WCAG AAA target size requirements */\n --min-target-size: 44px;\n --sm-target-size: 32px;\n --lg-target-size: 48px;\n}\n\n.rpf-button {\n --rpf-button-background-color: var(--rpf-navy-800);\n --rpf-button-background-color-hover: var(--rpf-navy-900);\n --rpf-button-background-color-active: var(--rpf-navy-600);\n --rpf-button-background-color-disabled: var(--rpf-grey-600);\n --rpf-button-text-color: var(--rpf-white);\n --rpf-button-border-color: var(--rpf-button-background-color);\n --rpf-button-border-color-hover: var(--rpf-button-background-color-hover);\n --rpf-button-border-color-active: var(--rpf-button-background-color-active);\n --rpf-button-border-color-disabled: var(--rpf-button-background-color-disabled);\n --rpf-button-danger-background-color: var(--rpf-alert-error);\n --rpf-button-danger-background-color-hover: var(--rpf-alert-error);\n --rpf-button-danger-background-color-active: var(--rpf-red-900);\n --rpf-button-danger-background-color-disabled: var(--rpf-grey-600);\n --rpf-button-danger-text-color: var(--rpf-white);\n --rpf-button-danger-border-color: var(--rpf-button-danger-background-color);\n --rpf-button-danger-border-color-hover: var(--rpf-button-danger-background-color-hover);\n --rpf-button-danger-border-color-active: var(--rpf-button-danger-background-color-active);\n --rpf-button-danger-border-color-disabled: var(--rpf-button-danger-background-color-disabled);\n --rpf-button-border-radius: var(--border-radius);\n --rpf-button-border-width: var(--border-width-md);\n --rpf-button-lg-height: var(--lg-target-size);\n --rpf-button-sm-height: var(--sm-target-size);\n --rpf-button-min-target-size: var(--min-target-size);\n all: unset;\n align-items: center;\n box-sizing: border-box;\n color: var(--rpf-button-text-color);\n /*\n * We've decided to follow the masses on this and have a pointer on buttons.\n * Google, Facebook, Twitter, Mozilla, and Microsoft amongst many others have a pointer on buttons.\n */\n cursor: pointer;\n display: flex;\n font-size: var(--font-size-1-5);\n font-weight: var(--font-weight-bold);\n gap: var(--space-1);\n min-block-size: var(--rpf-button-lg-height);\n padding: var(--space-1) var(--space-2);\n position: relative;\n text-align: center;\n text-decoration: none;\n /* Fixes a rendering error that sometimes occurs due to negative z-index */\n transform: scale(1);\n inline-size: fit-content;\n /* A bit of a hack to allow for separate visual and target heights */\n}\n.rpf-button::before {\n background-color: var(--rpf-button-background-color);\n border-color: var(--rpf-button-border-color);\n border-radius: var(--rpf-button-border-radius);\n border-style: solid;\n border-width: var(--rpf-button-border-width);\n content: \"\";\n display: block;\n inset: 0;\n position: absolute;\n /* To ensure it renders under its siblings */\n z-index: -1;\n}\n.rpf-button:hover::before {\n background-color: var(--rpf-button-background-color-hover);\n border-color: var(--rpf-button-border-color-hover);\n}\n.rpf-button:active::before {\n background-color: var(--rpf-button-background-color-active);\n border-color: var(--rpf-button-border-color-active);\n}\n.rpf-button:focus-visible::before {\n outline: var(--border-width-md) solid var(--rpf-button-background-color);\n outline-offset: 3px;\n}\n.rpf-button:disabled, .rpf-button--disabled {\n cursor: default;\n}\n.rpf-button:disabled::before, .rpf-button:disabled:hover::before, .rpf-button--disabled::before, .rpf-button--disabled:hover::before {\n border-color: var(--rpf-button-border-color-disabled);\n background-color: var(--rpf-button-background-color-disabled);\n}\n.rpf-button--secondary {\n color: var(--rpf-button-background-color);\n}\n.rpf-button--secondary::before {\n background-color: var(--rpf-button-text-color);\n}\n.rpf-button--secondary:hover {\n color: var(--rpf-button-background-color-hover);\n}\n.rpf-button--secondary:hover::before {\n background-color: var(--rpf-button-text-color);\n border-color: var(--rpf-button-border-color-hover);\n}\n.rpf-button--secondary:active {\n color: var(--rpf-button-background-color-active);\n}\n.rpf-button--secondary:active::before {\n background-color: var(--rpf-button-text-color);\n border-color: var(--rpf-button-border-color-active);\n}\n.rpf-button--secondary:disabled, .rpf-button--secondary.rpf-button--disabled {\n color: var(--rpf-button-background-color-disabled);\n}\n.rpf-button--secondary:disabled:hover::before, .rpf-button--secondary:disabled:before, .rpf-button--secondary.rpf-button--disabled:hover::before, .rpf-button--secondary.rpf-button--disabled:before {\n background-color: var(--rpf-button-text-color);\n border-color: var(--rpf-button-border-color-disabled);\n}\n.rpf-button--secondary.rpf-button--danger {\n color: var(--rpf-button-danger-background-color);\n}\n.rpf-button--secondary.rpf-button--danger::before {\n background-color: var(--rpf-button-danger-text-color);\n}\n.rpf-button--secondary.rpf-button--danger:hover {\n color: var(--rpf-button-danger-background-color-hover);\n}\n.rpf-button--secondary.rpf-button--danger:hover::before {\n background-color: var(--rpf-button-danger-text-color);\n border-color: var(--rpf-button-danger-border-color-hover);\n}\n.rpf-button--secondary.rpf-button--danger:active {\n color: var(--rpf-button-danger-background-color-active);\n}\n.rpf-button--secondary.rpf-button--danger:active::before {\n background-color: var(--rpf-button-danger-text-color);\n border-color: var(--rpf-button-danger-border-color-active);\n}\n.rpf-button--secondary.rpf-button--danger:disabled, .rpf-button--secondary.rpf-button--danger.rpf-button--disabled {\n color: var(--rpf-button-danger-background-color-disabled);\n}\n.rpf-button--secondary.rpf-button--danger:disabled:hover::before, .rpf-button--secondary.rpf-button--danger:disabled:before, .rpf-button--secondary.rpf-button--danger.rpf-button--disabled:hover::before, .rpf-button--secondary.rpf-button--danger.rpf-button--disabled:before {\n background-color: var(--rpf-button-danger-text-color);\n border-color: var(--rpf-button-danger-border-color-disabled);\n}\n.rpf-button--tertiary {\n color: var(--rpf-button-background-color);\n}\n.rpf-button--tertiary::before {\n background-color: transparent;\n border-color: transparent;\n}\n.rpf-button--tertiary:hover {\n color: var(--rpf-button-background-color-hover);\n}\n.rpf-button--tertiary:hover::before {\n background-color: transparent;\n border-color: transparent;\n}\n.rpf-button--tertiary:active {\n color: var(--rpf-button-background-color-active);\n}\n.rpf-button--tertiary:active::before {\n background-color: transparent;\n}\n.rpf-button--tertiary:disabled, .rpf-button--tertiary.rpf-button--disabled {\n color: var(--rpf-button-background-color-disabled);\n}\n.rpf-button--tertiary:disabled::before, .rpf-button--tertiary:disabled:hover::before, .rpf-button--tertiary.rpf-button--disabled::before, .rpf-button--tertiary.rpf-button--disabled:hover::before {\n background-color: transparent;\n border-color: transparent;\n}\n.rpf-button--tertiary.rpf-button--danger {\n color: var(--rpf-button-danger-background-color);\n}\n.rpf-button--tertiary.rpf-button--danger::before {\n background-color: transparent;\n border-color: transparent;\n}\n.rpf-button--tertiary.rpf-button--danger:hover {\n color: var(--rpf-button-danger-background-color-hover);\n}\n.rpf-button--tertiary.rpf-button--danger:hover::before {\n background-color: transparent;\n border-color: transparent;\n}\n.rpf-button--tertiary.rpf-button--danger:active {\n color: var(--rpf-button-danger-background-color-active);\n}\n.rpf-button--tertiary.rpf-button--danger:active::before {\n background-color: transparent;\n}\n.rpf-button--tertiary.rpf-button--danger:disabled, .rpf-button--tertiary.rpf-button--danger.rpf-button--disabled {\n color: var(--rpf-button-danger-background-color-disabled);\n}\n.rpf-button--tertiary.rpf-button--danger:disabled::before, .rpf-button--tertiary.rpf-button--danger:disabled:hover::before, .rpf-button--tertiary.rpf-button--danger.rpf-button--disabled::before, .rpf-button--tertiary.rpf-button--danger.rpf-button--disabled:hover::before {\n background-color: transparent;\n border-color: transparent;\n}\n.rpf-button--danger {\n color: var(--rpf-button-danger-text-color);\n}\n.rpf-button--danger::before {\n background-color: var(--rpf-button-danger-background-color);\n border-color: var(--rpf-button-danger-border-color);\n}\n.rpf-button--danger:hover::before {\n background-color: var(--rpf-button-danger-background-color-hover);\n border-color: var(--rpf-button-danger-border-color-hover);\n}\n.rpf-button--danger:active::before {\n background-color: var(--rpf-button-danger-background-color-active);\n border-color: var(--rpf-button-danger-border-color-active);\n}\n.rpf-button--danger:focus-visible::before {\n outline: var(--border-width-md) solid var(--rpf-button-danger-background-color);\n}\n.rpf-button--icon-only {\n block-size: var(--rpf-button-lg-height);\n line-height: var(--rpf-button-lg-height);\n padding: 0;\n text-align: center;\n inline-size: var(--rpf-button-lg-height);\n}\n.rpf-button--icon-only .rpf-button__icon {\n margin: 0 auto;\n}\n.rpf-button--sm {\n font-size: var(--font-size-1);\n min-block-size: var(--rpf-button-min-target-size);\n padding: var(--space-1) var(--space-1);\n /* To account for 32px visual height and 44px target height */\n}\n.rpf-button--sm::before {\n inset: calc((var(--rpf-button-min-target-size) - var(--rpf-button-sm-height)) / 2) 0;\n}\n.rpf-button--sm.rpf-button--icon-only {\n block-size: var(--rpf-button-min-target-size);\n line-height: var(--rpf-button-min-target-size);\n padding: 0;\n inline-size: var(--rpf-button-min-target-size);\n}\n.rpf-button--sm.rpf-button--icon-only::before {\n inset: calc((var(--rpf-button-min-target-size) - var(--rpf-button-sm-height)) / 2);\n}\n.rpf-button--sm .material-symbols-sharp {\n font-size: 20px;\n font-variation-settings: \"OPSZ\" 20;\n}\n.rpf-button--full-width {\n justify-content: center;\n inline-size: 100%;\n}\n";
|
|
1250
|
-
styleInject(css_248z$c);
|
|
1251
|
-
|
|
1252
|
-
/* eslint-disable complexity */
|
|
1253
|
-
const Alert = ({
|
|
1254
|
-
title,
|
|
1255
|
-
text,
|
|
1256
|
-
children,
|
|
1257
|
-
type,
|
|
1258
|
-
actions,
|
|
1259
|
-
onClose
|
|
1260
|
-
}) => /*#__PURE__*/React.createElement("div", {
|
|
1261
|
-
className: `rpf-alert rpf-alert--${type}`
|
|
1262
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
1263
|
-
className: "rpf-alert__header"
|
|
1264
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
1265
|
-
className: "rpf-alert__icon material-symbols-sharp"
|
|
1266
|
-
}), /*#__PURE__*/React.createElement("p", {
|
|
1267
|
-
className: "rpf-alert__title"
|
|
1268
|
-
}, title), !!onClose && /*#__PURE__*/React.createElement("div", {
|
|
1269
|
-
className: "rpf-alert__close"
|
|
1270
|
-
}, /*#__PURE__*/React.createElement(Button, {
|
|
1271
|
-
type: "tertiary",
|
|
1272
|
-
icon: "close",
|
|
1273
|
-
size: "small",
|
|
1274
|
-
iconOnly: true,
|
|
1275
|
-
onClick: onClose
|
|
1276
|
-
}))), (text || children || actions) && /*#__PURE__*/React.createElement("div", {
|
|
1277
|
-
className: "rpf-alert__body"
|
|
1278
|
-
}, !children && text && /*#__PURE__*/React.createElement("p", null, text), children && /*#__PURE__*/React.createElement("div", null, children), actions && actions.length > 0 && /*#__PURE__*/React.createElement("div", {
|
|
1279
|
-
className: "rpf-alert__actions"
|
|
1280
|
-
}, actions.map(action => /*#__PURE__*/React.createElement(Button, {
|
|
1281
|
-
key: action.key || action.label,
|
|
1282
|
-
text: action.label,
|
|
1283
|
-
size: "small",
|
|
1284
|
-
type: "tertiary",
|
|
1285
|
-
href: action.href,
|
|
1286
|
-
onClick: action.onClick
|
|
1287
|
-
})))));
|
|
1288
|
-
Alert.propTypes = {
|
|
1289
|
-
title: PropTypes.string,
|
|
1290
|
-
text: PropTypes.string,
|
|
1291
|
-
type: PropTypes.oneOf(["error", "warning", "information", "success"]),
|
|
1292
|
-
actions: PropTypes.arrayOf(PropTypes.shape({
|
|
1293
|
-
href: PropTypes.string,
|
|
1294
|
-
label: PropTypes.string,
|
|
1295
|
-
onClick: PropTypes.func
|
|
1296
|
-
})),
|
|
1297
|
-
children: PropTypes.node,
|
|
1298
|
-
onClose: PropTypes.func
|
|
1299
|
-
};
|
|
1300
|
-
|
|
1301
|
-
var css_248z$b = ":root, :host {\n --font-size-0-5: 0.5rem;\n --font-size-0-75: 0.75rem;\n --font-size-1: 1rem;\n --font-size-1-5: 1.25rem;\n --font-size-2: 1.5rem;\n --font-size-3: 2rem;\n --font-size-4: 2.5rem;\n --font-size-5: 3rem;\n --font-size-6: 3.5rem;\n --font-size-7: 4rem;\n --font-size-8: 4.5rem;\n --font-size-9: 5rem;\n}\n\n:root, :host {\n --font-weight-regular: 400;\n --font-weight-bold: 700;\n}\n\n:root, :host {\n --line-height-0-75: 0.75rem;\n --line-height-1: 1rem;\n --line-height-1-5: 1.5rem;\n --line-height-2: 2rem;\n --line-height-2-5: 2.5rem;\n --line-height-3: 3rem;\n --line-height-3-5: 3.5rem;\n --line-height-4: 4rem;\n --line-height-4-5: 4.5rem;\n --line-height-5: 5rem;\n --line-height-5-5: 5.5rem;\n --line-height-6: 6rem;\n --line-height-6-5: 6.5rem;\n}\n\n:root, :host {\n --space-0-125: 0.0625rem;\n --space-0-25: 0.125rem;\n --space-0-5: 0.25rem;\n --space-1: 0.5rem;\n --space-1-5: 0.75rem;\n --space-2: 1rem;\n --space-3: 1.5rem;\n --space-4: 2rem;\n --space-5: 2.5rem;\n --space-6: 3rem;\n --space-7: 3.5rem;\n --space-8: 4rem;\n --space-9: 4.5rem;\n --space-10: 5rem;\n}\n\n:root, :host {\n --rpf-white: hsla(0, 0%, 100%, 1);\n --rpf-off-white: hsla(225, 25%, 97%, 1);\n --rpf-grey-50: hsla(210, 8%, 95%, 1);\n --rpf-grey-100: hsla(228, 10%, 90%, 1);\n --rpf-grey-150: hsla(223, 9%, 85%, 1);\n --rpf-grey-200: hsla(228, 10%, 80%, 1);\n --rpf-grey-300: hsla(229, 9%, 75%, 1);\n --rpf-grey-400: hsla(229, 8%, 61%, 1);\n --rpf-grey-500: hsla(229, 9%, 42%, 1);\n --rpf-grey-600: hsla(228, 9%, 32%, 1);\n --rpf-grey-700: hsla(228, 9%, 22%, 1);\n --rpf-grey-800: hsla(232, 9%, 18%, 1);\n --rpf-grey-850: hsla(228, 9%, 15%, 1);\n --rpf-grey-900: hsla(228, 9%, 10%, 1);\n --rpf-grey-950: hsla(228, 8%, 5%, 1);\n --rpf-black: hsla(0, 0%, 0%, 1);\n}\n\n:root, :host {\n --rpf-red-100: hsla(4, 89%, 96%, 1);\n --rpf-red-200: hsla(1, 87%, 91%, 1);\n --rpf-red-400: hsla(1, 87%, 82%, 1);\n --rpf-red-600: hsla(1, 87%, 72%, 1);\n --rpf-red-800: hsla(1, 87%, 63%, 1);\n --rpf-red-900: hsla(1, 52%, 50%, 1);\n --rpf-green-100: hsla(125, 41%, 95%, 1);\n --rpf-green-200: hsla(122, 39%, 87%, 1);\n --rpf-green-400: hsla(123, 40%, 74%, 1);\n --rpf-green-600: hsla(123, 40%, 61%, 1);\n --rpf-green-800: hsla(123, 43%, 48%, 1);\n --rpf-green-900: hsla(123, 43%, 34%, 1);\n --rpf-teal-100: hsla(176, 55%, 94%, 1);\n --rpf-teal-200: hsla(174, 55%, 85%, 1);\n --rpf-teal-400: hsla(174, 55%, 70%, 1);\n --rpf-teal-600: hsla(174, 56%, 56%, 1);\n --rpf-teal-800: hsla(174, 81%, 41%, 1);\n --rpf-teal-900: hsla(174, 81%, 27%, 1);\n --rpf-teal-950: hsla(174, 80%, 20%, 1);\n --rpf-orange-100: hsla(31, 100%, 95%, 1);\n --rpf-orange-200: hsla(32, 100%, 88%, 1);\n --rpf-orange-400: hsla(31, 100%, 77%, 1);\n --rpf-orange-600: hsla(31, 99%, 65%, 1);\n --rpf-orange-800: hsla(31, 99%, 54%, 1);\n --rpf-orange-900: hsla(31, 85%, 35%, 1);\n --rpf-yellow-100: hsla(51, 100%, 95%, 1);\n --rpf-yellow-200: hsla(52, 100%, 87%, 1);\n --rpf-yellow-400: hsla(51, 100%, 75%, 1);\n --rpf-yellow-600: hsla(52, 100%, 63%, 1);\n --rpf-yellow-800: hsla(52, 100%, 50%, 1);\n --rpf-yellow-900: hsla(52, 100%, 26%, 1);\n --rpf-purple-100: hsla(282, 36%, 95%, 1);\n --rpf-purple-200: hsla(279, 38%, 87%, 1);\n --rpf-purple-400: hsla(279, 38%, 73%, 1);\n --rpf-purple-600: hsla(279, 37%, 60%, 1);\n --rpf-purple-800: hsla(279, 43%, 47%, 1);\n --rpf-purple-900: hsla(280, 43%, 37%, 1);\n --rpf-navy-100: hsla(235, 38%, 94%, 1);\n --rpf-navy-200: hsla(234, 38%, 84%, 1);\n --rpf-navy-400: hsla(235, 38%, 69%, 1);\n --rpf-navy-600: hsla(235, 38%, 53%, 1);\n --rpf-navy-800: hsla(235, 63%, 37%, 1);\n --rpf-navy-900: hsla(234, 63%, 30%, 1);\n --rpf-blue-100: hsla(203, 86%, 95%, 1);\n --rpf-blue-200: hsla(204, 88%, 87%, 1);\n --rpf-blue-400: hsla(204, 88%, 74%, 1);\n --rpf-blue-600: hsla(204, 89%, 60%, 1);\n --rpf-blue-800: hsla(204, 100%, 47%, 1);\n --rpf-blue-900: hsla(204, 99%, 37%, 1);\n}\n\n:root, :host {\n --color-progress-bar-complete: var(--rpf-navy-800);\n --color-progress-bar-incomplete: var(--rpf-grey-150);\n}\n\n.rpf-progress-bar__label {\n font-size: var(--font-size-1);\n font-weight: var(--font-weight-regular);\n line-height: var(--line-height-1-5);\n align-items: center;\n display: grid;\n grid-gap: var(--space-3);\n grid-template-columns: max-content 1fr;\n}\n.rpf-progress-bar__bar {\n background: var(--color-progress-bar-incomplete);\n block-size: 0.375rem;\n border-radius: 0.375rem;\n inline-size: 100%;\n}\n.rpf-progress-bar__bar::-webkit-progress-bar {\n background: var(--color-progress-bar-incomplete);\n border-radius: 0.375rem;\n}\n.rpf-progress-bar__bar::-webkit-progress-value {\n background: var(--color-progress-bar-complete);\n border-radius: 0.375rem;\n}\n.rpf-progress-bar__bar::-moz-progress-bar {\n background: var(--color-progress-bar-complete);\n border-radius: 0.375rem;\n}\n";
|
|
1302
|
-
styleInject(css_248z$b);
|
|
1303
|
-
|
|
1304
|
-
/* eslint-disable complexity */
|
|
1305
|
-
const ProgressBar = ({
|
|
1306
|
-
text = "",
|
|
1307
|
-
percent
|
|
1308
|
-
}) => /*#__PURE__*/React.createElement("div", {
|
|
1309
|
-
className: "rpf-progress-bar"
|
|
1310
|
-
}, /*#__PURE__*/React.createElement("label", {
|
|
1311
|
-
class: "rpf-progress-bar__label"
|
|
1312
|
-
}, /*#__PURE__*/React.createElement("span", null, text), /*#__PURE__*/React.createElement("progress", {
|
|
1313
|
-
class: "rpf-progress-bar__bar",
|
|
1314
|
-
value: percent,
|
|
1315
|
-
max: "100"
|
|
1316
|
-
}, `${percent}%`)));
|
|
1317
|
-
ProgressBar.propTypes = {
|
|
1318
|
-
text: PropTypes.string,
|
|
1319
|
-
percent: PropTypes.number.isRequired
|
|
1320
|
-
};
|
|
1321
|
-
|
|
1322
|
-
var css_248z$a = ":root, :host {\n --border-radius: var(--space-1);\n --border-radius-sm: var(--space-0-5);\n --border-width-sm: 1px;\n --border-width-md: 2px;\n --border-width-lg: 3px;\n --alert-border-width: var(--border-width-md);\n --fieldset-border-width: var(--border-width-md);\n --input-border-width: var(--border-width-md);\n --table-border-width: var(--border-width-sm);\n}\n\n:root, :host {\n --rpf-alert-error-highlight: hsla(0, 88%, 99%, 1);\n --rpf-alert-error: hsla(0, 88%, 33%, 1);\n --rpf-alert-information-highlight: hsla(225, 64%, 99%, 1);\n --rpf-alert-information: hsla(225, 64%, 33%, 1);\n --rpf-alert-success-highlight: hsla(136, 90%, 99%, 1);\n --rpf-alert-success: hsla(136, 90%, 20%, 1);\n --rpf-alert-warning-highlight: hsla(26, 70%, 99%, 1);\n --rpf-alert-warning: hsla(26, 70%, 29%, 1);\n}\n\n:root, :host {\n --rpf-white: hsla(0, 0%, 100%, 1);\n --rpf-off-white: hsla(225, 25%, 97%, 1);\n --rpf-grey-50: hsla(210, 8%, 95%, 1);\n --rpf-grey-100: hsla(228, 10%, 90%, 1);\n --rpf-grey-150: hsla(223, 9%, 85%, 1);\n --rpf-grey-200: hsla(228, 10%, 80%, 1);\n --rpf-grey-300: hsla(229, 9%, 75%, 1);\n --rpf-grey-400: hsla(229, 8%, 61%, 1);\n --rpf-grey-500: hsla(229, 9%, 42%, 1);\n --rpf-grey-600: hsla(228, 9%, 32%, 1);\n --rpf-grey-700: hsla(228, 9%, 22%, 1);\n --rpf-grey-800: hsla(232, 9%, 18%, 1);\n --rpf-grey-850: hsla(228, 9%, 15%, 1);\n --rpf-grey-900: hsla(228, 9%, 10%, 1);\n --rpf-grey-950: hsla(228, 8%, 5%, 1);\n --rpf-black: hsla(0, 0%, 0%, 1);\n}\n\n:root, :host {\n --rpf-red-100: hsla(4, 89%, 96%, 1);\n --rpf-red-200: hsla(1, 87%, 91%, 1);\n --rpf-red-400: hsla(1, 87%, 82%, 1);\n --rpf-red-600: hsla(1, 87%, 72%, 1);\n --rpf-red-800: hsla(1, 87%, 63%, 1);\n --rpf-red-900: hsla(1, 52%, 50%, 1);\n --rpf-green-100: hsla(125, 41%, 95%, 1);\n --rpf-green-200: hsla(122, 39%, 87%, 1);\n --rpf-green-400: hsla(123, 40%, 74%, 1);\n --rpf-green-600: hsla(123, 40%, 61%, 1);\n --rpf-green-800: hsla(123, 43%, 48%, 1);\n --rpf-green-900: hsla(123, 43%, 34%, 1);\n --rpf-teal-100: hsla(176, 55%, 94%, 1);\n --rpf-teal-200: hsla(174, 55%, 85%, 1);\n --rpf-teal-400: hsla(174, 55%, 70%, 1);\n --rpf-teal-600: hsla(174, 56%, 56%, 1);\n --rpf-teal-800: hsla(174, 81%, 41%, 1);\n --rpf-teal-900: hsla(174, 81%, 27%, 1);\n --rpf-teal-950: hsla(174, 80%, 20%, 1);\n --rpf-orange-100: hsla(31, 100%, 95%, 1);\n --rpf-orange-200: hsla(32, 100%, 88%, 1);\n --rpf-orange-400: hsla(31, 100%, 77%, 1);\n --rpf-orange-600: hsla(31, 99%, 65%, 1);\n --rpf-orange-800: hsla(31, 99%, 54%, 1);\n --rpf-orange-900: hsla(31, 85%, 35%, 1);\n --rpf-yellow-100: hsla(51, 100%, 95%, 1);\n --rpf-yellow-200: hsla(52, 100%, 87%, 1);\n --rpf-yellow-400: hsla(51, 100%, 75%, 1);\n --rpf-yellow-600: hsla(52, 100%, 63%, 1);\n --rpf-yellow-800: hsla(52, 100%, 50%, 1);\n --rpf-yellow-900: hsla(52, 100%, 26%, 1);\n --rpf-purple-100: hsla(282, 36%, 95%, 1);\n --rpf-purple-200: hsla(279, 38%, 87%, 1);\n --rpf-purple-400: hsla(279, 38%, 73%, 1);\n --rpf-purple-600: hsla(279, 37%, 60%, 1);\n --rpf-purple-800: hsla(279, 43%, 47%, 1);\n --rpf-purple-900: hsla(280, 43%, 37%, 1);\n --rpf-navy-100: hsla(235, 38%, 94%, 1);\n --rpf-navy-200: hsla(234, 38%, 84%, 1);\n --rpf-navy-400: hsla(235, 38%, 69%, 1);\n --rpf-navy-600: hsla(235, 38%, 53%, 1);\n --rpf-navy-800: hsla(235, 63%, 37%, 1);\n --rpf-navy-900: hsla(234, 63%, 30%, 1);\n --rpf-blue-100: hsla(203, 86%, 95%, 1);\n --rpf-blue-200: hsla(204, 88%, 87%, 1);\n --rpf-blue-400: hsla(204, 88%, 74%, 1);\n --rpf-blue-600: hsla(204, 89%, 60%, 1);\n --rpf-blue-800: hsla(204, 100%, 47%, 1);\n --rpf-blue-900: hsla(204, 99%, 37%, 1);\n}\n\n:root, :host {\n --rpf-text-primary: hsla(0, 0%, 13%, 1);\n --rpf-text-primary-darkmode: var(--rpf-white);\n --rpf-text-secondary: hsla(200, 9%, 33%, 1);\n --rpf-text-secondary-darkmode: hsla(0, 0%, 80%, 1);\n --rpf-link-text: var(--rpf-navy-800);\n}\n\n:root, :host {\n --rpf-input-background-color: var(--rpf-white);\n --rpf-input-background-color-disabled: var(--rpf-grey-50);\n --rpf-input-background-color-readonly: var(--rpf-grey-50);\n --rpf-input-color-error: var(--rpf-alert-error);\n --rpf-input-color: var(--rpf-text-primary);\n --rpf-input-outline-color: var(--rpf-blue-800);\n}\n\n:root, :host {\n --font-size-0-5: 0.5rem;\n --font-size-0-75: 0.75rem;\n --font-size-1: 1rem;\n --font-size-1-5: 1.25rem;\n --font-size-2: 1.5rem;\n --font-size-3: 2rem;\n --font-size-4: 2.5rem;\n --font-size-5: 3rem;\n --font-size-6: 3.5rem;\n --font-size-7: 4rem;\n --font-size-8: 4.5rem;\n --font-size-9: 5rem;\n}\n\n:root, :host {\n --space-0-125: 0.0625rem;\n --space-0-25: 0.125rem;\n --space-0-5: 0.25rem;\n --space-1: 0.5rem;\n --space-1-5: 0.75rem;\n --space-2: 1rem;\n --space-3: 1.5rem;\n --space-4: 2rem;\n --space-5: 2.5rem;\n --space-6: 3rem;\n --space-7: 3.5rem;\n --space-8: 4rem;\n --space-9: 4.5rem;\n --space-10: 5rem;\n}\n\n.rpf-input-field {\n margin-block-end: var(--space-3);\n}\n\n.rpf-input {\n all: unset;\n background-color: var(--rpf-input-background-color);\n border: var(--input-border-width) solid var(--rpf-input-color);\n border-radius: var(--border-radius);\n box-sizing: border-box;\n color: var(--rpf-input-color);\n display: flex;\n font-size: var(--font-size-1);\n line-height: var(--line-height-2);\n padding-block: calc(var(--space-1) - 2px);\n padding-inline: var(--space-1-5);\n max-width: 50ch;\n min-width: 240px;\n width: 100%;\n}\n.rpf-input:disabled, .rpf-input--disabled {\n border-color: var(--rpf-input-background-color-disabled);\n background-color: var(--rpf-input-background-color-disabled);\n}\n.rpf-input:focus-visible {\n outline: 3px solid var(--rpf-input-outline-color);\n}\n.rpf-input--error {\n border-color: var(--rpf-input-color-error);\n}\n.rpf-input--full-width {\n max-width: none;\n}\n\n:root, :host {\n --font-weight-regular: 400;\n --font-weight-bold: 700;\n}\n\n:root, :host {\n --line-height-0-75: 0.75rem;\n --line-height-1: 1rem;\n --line-height-1-5: 1.5rem;\n --line-height-2: 2rem;\n --line-height-2-5: 2.5rem;\n --line-height-3: 3rem;\n --line-height-3-5: 3.5rem;\n --line-height-4: 4rem;\n --line-height-4-5: 4.5rem;\n --line-height-5: 5rem;\n --line-height-5-5: 5.5rem;\n --line-height-6: 6rem;\n --line-height-6-5: 6.5rem;\n}\n\n:root, :host {\n --rpf-label-hint-color: var(--rpf-text-secondary);\n --rpf-label-text-color: var(--rpf-text-primary);\n --rpf-label-text-color-disabled: var(--rpf-grey-500);\n}\n\n.rpf-label {\n all: unset;\n color: var(--rpf-label-text-color);\n display: flex;\n flex-direction: column;\n font-weight: var(--font-weight-bold);\n padding-block-end: var(--space-1);\n font-size: var(--font-size-1);\n line-height: var(--line-height-1-5);\n}\n.rpf-label__hint {\n color: var(--rpf-label-hint-color);\n font-size: var(--font-size-1);\n font-weight: var(--font-weight-regular);\n}\n.rpf-label--disabled {\n color: var(--rpf-label-text-color-disabled);\n}\n.rpf-label--disabled .rpf-label__hint {\n color: var(--rpf-label-text-color-disabled);\n}\n\n:root, :host {\n /* 44px min-height to meet WCAG AAA target size requirements */\n --min-target-size: 44px;\n --sm-target-size: 32px;\n --lg-target-size: 48px;\n}\n\n.rpf-input-checkbox {\n --rpf-input-checkbox-hit-target: var(--min-target-size);\n --rpf-input-checkbox-size: var(--space-3);\n align-items: center;\n border-radius: var(--space-1);\n box-sizing: border-box;\n display: flex;\n gap: var(--space-1-5);\n margin-block-end: var(--space-1);\n max-width: 50ch;\n min-height: var(--rpf-input-checkbox-hit-target);\n min-width: 240px;\n padding-block: calc((var(--rpf-input-checkbox-hit-target) - var(--rpf-input-checkbox-size)) / 2);\n padding-inline: var(--space-1);\n width: 100%;\n}\n.rpf-input-checkbox input[type=checkbox] {\n align-self: flex-start;\n appearance: none;\n background: var(--rpf-white);\n border: var(--space-0-25) solid var(--rpf-grey-850);\n border-radius: var(--space-0-5);\n flex-shrink: 0;\n height: var(--rpf-input-checkbox-size);\n margin: 0;\n width: var(--rpf-input-checkbox-size);\n}\n.rpf-input-checkbox input[type=checkbox]:checked {\n background: var(--rpf-grey-850);\n background-image: url('data:image/svg+xml;utf8,<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M7.95834 15.0003L3.20834 10.2503L4.39584 9.06283L7.95834 12.6253L15.6042 4.97949L16.7917 6.16699L7.95834 15.0003Z\" fill=\"white\"/></svg>');\n}\n.rpf-input-checkbox input[type=checkbox]:disabled {\n border-color: var(--rpf-grey-600);\n}\n.rpf-input-checkbox input[type=checkbox]:disabled:checked {\n background-color: var(--rpf-grey-600);\n}\n.rpf-input-checkbox.rpf-input--full-width {\n max-width: none;\n}\n.rpf-input-checkbox:has(> input[type=checkbox]:disabled), .rpf-input-checkbox--disabled {\n background-color: var(--rpf-input-background-color-disabled);\n color: var(--rpf-grey-400);\n}\n.rpf-input-checkbox:has(> input[type=checkbox]:focus-visible) {\n outline: 3px solid var(--rpf-input-outline-color);\n}\n.rpf-input-checkbox:has(> input[type=checkbox]:focus-visible) > input[type=checkbox]:focus-visible {\n outline: none;\n}\n\n:root, :host {\n --rpf-message-text-color: var(--rpf-alert-error);\n}\n\n.rpf-error-message {\n all: unset;\n align-items: center;\n color: var(--rpf-message-text-color);\n display: flex;\n font-weight: var(--font-weight-bold);\n padding-block: var(--space-1);\n}\n.rpf-error-message__icon {\n margin-inline-end: var(--space-1);\n}\n";
|
|
1323
|
-
styleInject(css_248z$a);
|
|
1324
|
-
|
|
1325
|
-
const CheckboxInput = ({
|
|
1326
|
-
id,
|
|
1327
|
-
label,
|
|
1328
|
-
name,
|
|
1329
|
-
checked = false,
|
|
1330
|
-
disabled = false,
|
|
1331
|
-
error = "",
|
|
1332
|
-
onChange = () => {},
|
|
1333
|
-
value = ""
|
|
1334
|
-
}) => /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("label", {
|
|
1335
|
-
className: classNames("rpf-input-checkbox", {
|
|
1336
|
-
"rpf-input-checkbox--error": error
|
|
1337
|
-
})
|
|
1338
|
-
}, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("input", {
|
|
1339
|
-
checked: !!checked,
|
|
1340
|
-
disabled: disabled,
|
|
1341
|
-
id: id,
|
|
1342
|
-
name: name,
|
|
1343
|
-
onChange: onChange,
|
|
1344
|
-
type: "checkbox",
|
|
1345
|
-
value: value
|
|
1346
|
-
})), /*#__PURE__*/React.createElement("span", {
|
|
1347
|
-
className: "checkmark"
|
|
1348
|
-
}), label), error && /*#__PURE__*/React.createElement("div", {
|
|
1349
|
-
className: "rpf-error-message"
|
|
1350
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
1351
|
-
className: "rpf-error-message__icon material-symbols-sharp"
|
|
1352
|
-
}, "error"), error));
|
|
1353
|
-
CheckboxInput.propTypes = {
|
|
1354
|
-
checked: PropTypes.bool,
|
|
1355
|
-
disabled: PropTypes.bool,
|
|
1356
|
-
error: PropTypes.string,
|
|
1357
|
-
id: PropTypes.string.isRequired,
|
|
1358
|
-
label: PropTypes.oneOfType([PropTypes.string, PropTypes.object]).isRequired,
|
|
1359
|
-
name: PropTypes.string.isRequired,
|
|
1360
|
-
onChange: PropTypes.func,
|
|
1361
|
-
value: PropTypes.string
|
|
1362
|
-
};
|
|
1363
|
-
|
|
1364
|
-
var css_248z$9 = ":root, :host {\n --border-radius: var(--space-1);\n --border-radius-sm: var(--space-0-5);\n --border-width-sm: 1px;\n --border-width-md: 2px;\n --border-width-lg: 3px;\n --alert-border-width: var(--border-width-md);\n --fieldset-border-width: var(--border-width-md);\n --input-border-width: var(--border-width-md);\n --table-border-width: var(--border-width-sm);\n}\n\n:root, :host {\n --rpf-alert-error-highlight: hsla(0, 88%, 99%, 1);\n --rpf-alert-error: hsla(0, 88%, 33%, 1);\n --rpf-alert-information-highlight: hsla(225, 64%, 99%, 1);\n --rpf-alert-information: hsla(225, 64%, 33%, 1);\n --rpf-alert-success-highlight: hsla(136, 90%, 99%, 1);\n --rpf-alert-success: hsla(136, 90%, 20%, 1);\n --rpf-alert-warning-highlight: hsla(26, 70%, 99%, 1);\n --rpf-alert-warning: hsla(26, 70%, 29%, 1);\n}\n\n:root, :host {\n --rpf-white: hsla(0, 0%, 100%, 1);\n --rpf-off-white: hsla(225, 25%, 97%, 1);\n --rpf-grey-50: hsla(210, 8%, 95%, 1);\n --rpf-grey-100: hsla(228, 10%, 90%, 1);\n --rpf-grey-150: hsla(223, 9%, 85%, 1);\n --rpf-grey-200: hsla(228, 10%, 80%, 1);\n --rpf-grey-300: hsla(229, 9%, 75%, 1);\n --rpf-grey-400: hsla(229, 8%, 61%, 1);\n --rpf-grey-500: hsla(229, 9%, 42%, 1);\n --rpf-grey-600: hsla(228, 9%, 32%, 1);\n --rpf-grey-700: hsla(228, 9%, 22%, 1);\n --rpf-grey-800: hsla(232, 9%, 18%, 1);\n --rpf-grey-850: hsla(228, 9%, 15%, 1);\n --rpf-grey-900: hsla(228, 9%, 10%, 1);\n --rpf-grey-950: hsla(228, 8%, 5%, 1);\n --rpf-black: hsla(0, 0%, 0%, 1);\n}\n\n:root, :host {\n --rpf-red-100: hsla(4, 89%, 96%, 1);\n --rpf-red-200: hsla(1, 87%, 91%, 1);\n --rpf-red-400: hsla(1, 87%, 82%, 1);\n --rpf-red-600: hsla(1, 87%, 72%, 1);\n --rpf-red-800: hsla(1, 87%, 63%, 1);\n --rpf-red-900: hsla(1, 52%, 50%, 1);\n --rpf-green-100: hsla(125, 41%, 95%, 1);\n --rpf-green-200: hsla(122, 39%, 87%, 1);\n --rpf-green-400: hsla(123, 40%, 74%, 1);\n --rpf-green-600: hsla(123, 40%, 61%, 1);\n --rpf-green-800: hsla(123, 43%, 48%, 1);\n --rpf-green-900: hsla(123, 43%, 34%, 1);\n --rpf-teal-100: hsla(176, 55%, 94%, 1);\n --rpf-teal-200: hsla(174, 55%, 85%, 1);\n --rpf-teal-400: hsla(174, 55%, 70%, 1);\n --rpf-teal-600: hsla(174, 56%, 56%, 1);\n --rpf-teal-800: hsla(174, 81%, 41%, 1);\n --rpf-teal-900: hsla(174, 81%, 27%, 1);\n --rpf-teal-950: hsla(174, 80%, 20%, 1);\n --rpf-orange-100: hsla(31, 100%, 95%, 1);\n --rpf-orange-200: hsla(32, 100%, 88%, 1);\n --rpf-orange-400: hsla(31, 100%, 77%, 1);\n --rpf-orange-600: hsla(31, 99%, 65%, 1);\n --rpf-orange-800: hsla(31, 99%, 54%, 1);\n --rpf-orange-900: hsla(31, 85%, 35%, 1);\n --rpf-yellow-100: hsla(51, 100%, 95%, 1);\n --rpf-yellow-200: hsla(52, 100%, 87%, 1);\n --rpf-yellow-400: hsla(51, 100%, 75%, 1);\n --rpf-yellow-600: hsla(52, 100%, 63%, 1);\n --rpf-yellow-800: hsla(52, 100%, 50%, 1);\n --rpf-yellow-900: hsla(52, 100%, 26%, 1);\n --rpf-purple-100: hsla(282, 36%, 95%, 1);\n --rpf-purple-200: hsla(279, 38%, 87%, 1);\n --rpf-purple-400: hsla(279, 38%, 73%, 1);\n --rpf-purple-600: hsla(279, 37%, 60%, 1);\n --rpf-purple-800: hsla(279, 43%, 47%, 1);\n --rpf-purple-900: hsla(280, 43%, 37%, 1);\n --rpf-navy-100: hsla(235, 38%, 94%, 1);\n --rpf-navy-200: hsla(234, 38%, 84%, 1);\n --rpf-navy-400: hsla(235, 38%, 69%, 1);\n --rpf-navy-600: hsla(235, 38%, 53%, 1);\n --rpf-navy-800: hsla(235, 63%, 37%, 1);\n --rpf-navy-900: hsla(234, 63%, 30%, 1);\n --rpf-blue-100: hsla(203, 86%, 95%, 1);\n --rpf-blue-200: hsla(204, 88%, 87%, 1);\n --rpf-blue-400: hsla(204, 88%, 74%, 1);\n --rpf-blue-600: hsla(204, 89%, 60%, 1);\n --rpf-blue-800: hsla(204, 100%, 47%, 1);\n --rpf-blue-900: hsla(204, 99%, 37%, 1);\n}\n\n:root, :host {\n --rpf-text-primary: hsla(0, 0%, 13%, 1);\n --rpf-text-primary-darkmode: var(--rpf-white);\n --rpf-text-secondary: hsla(200, 9%, 33%, 1);\n --rpf-text-secondary-darkmode: hsla(0, 0%, 80%, 1);\n --rpf-link-text: var(--rpf-navy-800);\n}\n\n:root, :host {\n --rpf-input-background-color: var(--rpf-white);\n --rpf-input-background-color-disabled: var(--rpf-grey-50);\n --rpf-input-background-color-readonly: var(--rpf-grey-50);\n --rpf-input-color-error: var(--rpf-alert-error);\n --rpf-input-color: var(--rpf-text-primary);\n --rpf-input-outline-color: var(--rpf-blue-800);\n}\n\n.rpf-fieldset {\n all: unset;\n background-color: var(--rpf-input-background-color);\n box-sizing: border-box;\n display: block;\n color: var(--rpf-input-color);\n margin-block-end: var(--space-3);\n max-inline-size: fit-content;\n}\n.rpf-fieldset legend {\n background-color: var(--rpf-input-background-color);\n color: var(--rpf-input-color);\n inline-size: 100%;\n}\n.rpf-fieldset--full-width, .rpf-fieldset--full-width .rpf-fieldset__inputs * {\n max-inline-size: none;\n}\n.rpf-fieldset__inputs *:last-child {\n margin-block-end: 0;\n}\n.rpf-fieldset--error .rpf-fieldset__inputs {\n border-color: var(--rpf-input-color-error);\n border-radius: var(--border-radius);\n border-style: solid;\n border-width: var(--fieldset-border-width);\n}\n.rpf-fieldset--disabled .rpf-fieldset__inputs, .rpf-fieldset:disabled .rpf-fieldset__inputs {\n background-color: var(--rpf-input-background-color-disabled);\n border-radius: var(--border-radius);\n color: var(--rpf-input-color);\n}\n";
|
|
1365
|
-
styleInject(css_248z$9);
|
|
1366
|
-
|
|
1367
|
-
const Fieldset = ({
|
|
1368
|
-
disabled = false,
|
|
1369
|
-
errorText = "",
|
|
1370
|
-
fullWidth = false,
|
|
1371
|
-
legendText,
|
|
1372
|
-
legendHintText = "",
|
|
1373
|
-
children
|
|
1374
|
-
}) => {
|
|
1375
|
-
return /*#__PURE__*/React.createElement("fieldset", {
|
|
1376
|
-
className: classNames("rpf-fieldset", {
|
|
1377
|
-
"rpf-fieldset--disabled": disabled,
|
|
1378
|
-
"rpf-fieldset--full-width": fullWidth,
|
|
1379
|
-
"rpf-fieldset--error": errorText
|
|
1380
|
-
}),
|
|
1381
|
-
disabled: disabled
|
|
1382
|
-
}, /*#__PURE__*/React.createElement("legend", {
|
|
1383
|
-
className: "rpf-label"
|
|
1384
|
-
}, legendText, legendHintText.length > 0 ? /*#__PURE__*/React.createElement("small", {
|
|
1385
|
-
className: "rpf-label__hint"
|
|
1386
|
-
}, legendHintText) : null), /*#__PURE__*/React.createElement("div", {
|
|
1387
|
-
className: "rpf-fieldset__inputs"
|
|
1388
|
-
}, children), errorText.length > 0 ? /*#__PURE__*/React.createElement("div", {
|
|
1389
|
-
className: "rpf-error-message"
|
|
1390
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
1391
|
-
className: "rpf-error-message__icon material-symbols-sharp"
|
|
1392
|
-
}, "error"), errorText) : null);
|
|
1393
|
-
};
|
|
1394
|
-
Fieldset.propTypes = {
|
|
1395
|
-
disabled: PropTypes.bool,
|
|
1396
|
-
errorText: PropTypes.string,
|
|
1397
|
-
fullWidth: PropTypes.bool,
|
|
1398
|
-
legendText: PropTypes.string.isRequired,
|
|
1399
|
-
legendHintText: PropTypes.string
|
|
1400
|
-
};
|
|
1401
|
-
|
|
1402
|
-
const InputField = ({
|
|
1403
|
-
id,
|
|
1404
|
-
label,
|
|
1405
|
-
children,
|
|
1406
|
-
disabled = false,
|
|
1407
|
-
error = "",
|
|
1408
|
-
hint = ""
|
|
1409
|
-
}) => /*#__PURE__*/React.createElement("div", {
|
|
1410
|
-
className: "rpf-input-field"
|
|
1411
|
-
}, (label || hint) && /*#__PURE__*/React.createElement("label", {
|
|
1412
|
-
htmlFor: id,
|
|
1413
|
-
className: classNames("rpf-label", {
|
|
1414
|
-
"rpf-label--disabled": disabled
|
|
1415
|
-
})
|
|
1416
|
-
}, label, /*#__PURE__*/React.createElement("small", {
|
|
1417
|
-
className: "rpf-label__hint"
|
|
1418
|
-
}, hint)), children, error && /*#__PURE__*/React.createElement("div", {
|
|
1419
|
-
className: "rpf-error-message"
|
|
1420
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
1421
|
-
className: "rpf-error-message__icon material-symbols-sharp"
|
|
1422
|
-
}, "error"), error));
|
|
1423
|
-
InputField.propTypes = {
|
|
1424
|
-
disabled: PropTypes.bool,
|
|
1425
|
-
error: PropTypes.string,
|
|
1426
|
-
hint: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
|
|
1427
|
-
label: PropTypes.oneOfType([PropTypes.string, PropTypes.object]).isRequired,
|
|
1428
|
-
id: PropTypes.string.isRequired
|
|
1429
|
-
};
|
|
1430
|
-
|
|
1431
|
-
var css_248z$8 = ":root, :host {\n --rpf-alert-error-highlight: hsla(0, 88%, 99%, 1);\n --rpf-alert-error: hsla(0, 88%, 33%, 1);\n --rpf-alert-information-highlight: hsla(225, 64%, 99%, 1);\n --rpf-alert-information: hsla(225, 64%, 33%, 1);\n --rpf-alert-success-highlight: hsla(136, 90%, 99%, 1);\n --rpf-alert-success: hsla(136, 90%, 20%, 1);\n --rpf-alert-warning-highlight: hsla(26, 70%, 99%, 1);\n --rpf-alert-warning: hsla(26, 70%, 29%, 1);\n}\n\n:root, :host {\n --font-weight-regular: 400;\n --font-weight-bold: 700;\n}\n\n:root, :host {\n --space-0-125: 0.0625rem;\n --space-0-25: 0.125rem;\n --space-0-5: 0.25rem;\n --space-1: 0.5rem;\n --space-1-5: 0.75rem;\n --space-2: 1rem;\n --space-3: 1.5rem;\n --space-4: 2rem;\n --space-5: 2.5rem;\n --space-6: 3rem;\n --space-7: 3.5rem;\n --space-8: 4rem;\n --space-9: 4.5rem;\n --space-10: 5rem;\n}\n\n:root, :host {\n --rpf-message-text-color: var(--rpf-alert-error);\n}\n\n.rpf-error-message {\n all: unset;\n align-items: center;\n color: var(--rpf-message-text-color);\n display: flex;\n font-weight: var(--font-weight-bold);\n padding-block: var(--space-1);\n}\n.rpf-error-message__icon {\n margin-inline-end: var(--space-1);\n}\n\n:root, :host {\n --rpf-white: hsla(0, 0%, 100%, 1);\n --rpf-off-white: hsla(225, 25%, 97%, 1);\n --rpf-grey-50: hsla(210, 8%, 95%, 1);\n --rpf-grey-100: hsla(228, 10%, 90%, 1);\n --rpf-grey-150: hsla(223, 9%, 85%, 1);\n --rpf-grey-200: hsla(228, 10%, 80%, 1);\n --rpf-grey-300: hsla(229, 9%, 75%, 1);\n --rpf-grey-400: hsla(229, 8%, 61%, 1);\n --rpf-grey-500: hsla(229, 9%, 42%, 1);\n --rpf-grey-600: hsla(228, 9%, 32%, 1);\n --rpf-grey-700: hsla(228, 9%, 22%, 1);\n --rpf-grey-800: hsla(232, 9%, 18%, 1);\n --rpf-grey-850: hsla(228, 9%, 15%, 1);\n --rpf-grey-900: hsla(228, 9%, 10%, 1);\n --rpf-grey-950: hsla(228, 8%, 5%, 1);\n --rpf-black: hsla(0, 0%, 0%, 1);\n}\n\n:root, :host {\n --rpf-text-primary: hsla(0, 0%, 13%, 1);\n --rpf-text-primary-darkmode: var(--rpf-white);\n --rpf-text-secondary: hsla(200, 9%, 33%, 1);\n --rpf-text-secondary-darkmode: hsla(0, 0%, 80%, 1);\n --rpf-link-text: var(--rpf-navy-800);\n}\n\n:root, :host {\n --line-height-0-75: 0.75rem;\n --line-height-1: 1rem;\n --line-height-1-5: 1.5rem;\n --line-height-2: 2rem;\n --line-height-2-5: 2.5rem;\n --line-height-3: 3rem;\n --line-height-3-5: 3.5rem;\n --line-height-4: 4rem;\n --line-height-4-5: 4.5rem;\n --line-height-5: 5rem;\n --line-height-5-5: 5.5rem;\n --line-height-6: 6rem;\n --line-height-6-5: 6.5rem;\n}\n\n:root, :host {\n --rpf-label-hint-color: var(--rpf-text-secondary);\n --rpf-label-text-color: var(--rpf-text-primary);\n --rpf-label-text-color-disabled: var(--rpf-grey-500);\n}\n\n.rpf-label {\n all: unset;\n color: var(--rpf-label-text-color);\n display: flex;\n flex-direction: column;\n font-weight: var(--font-weight-bold);\n padding-block-end: var(--space-1);\n font-size: var(--font-size-1);\n line-height: var(--line-height-1-5);\n}\n.rpf-label__hint {\n color: var(--rpf-label-hint-color);\n font-size: var(--font-size-1);\n font-weight: var(--font-weight-regular);\n}\n.rpf-label--disabled {\n color: var(--rpf-label-text-color-disabled);\n}\n.rpf-label--disabled .rpf-label__hint {\n color: var(--rpf-label-text-color-disabled);\n}\n\n.rpf-input.rpf-input-select {\n background-image: url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'><path fill='%23212121' d='m12 15.375-6-6 1.4-1.4 4.6 4.6 4.6-4.6 1.4 1.4-6 6Z'/></svg>\");\n background-repeat: no-repeat;\n background-position: center right var(--space-1-5);\n}\nhtml[dir=rtl] .rpf-input.rpf-input-select {\n background-position: center left var(--space-1-5);\n}\n.rpf-input.rpf-input-select:disabled, .rpf-input.rpf-input-select--disabled {\n background-image: none;\n}\n\n:root, :host {\n --border-radius: var(--space-1);\n --border-radius-sm: var(--space-0-5);\n --border-width-sm: 1px;\n --border-width-md: 2px;\n --border-width-lg: 3px;\n --alert-border-width: var(--border-width-md);\n --fieldset-border-width: var(--border-width-md);\n --input-border-width: var(--border-width-md);\n --table-border-width: var(--border-width-sm);\n}\n\n:root, :host {\n --rpf-red-100: hsla(4, 89%, 96%, 1);\n --rpf-red-200: hsla(1, 87%, 91%, 1);\n --rpf-red-400: hsla(1, 87%, 82%, 1);\n --rpf-red-600: hsla(1, 87%, 72%, 1);\n --rpf-red-800: hsla(1, 87%, 63%, 1);\n --rpf-red-900: hsla(1, 52%, 50%, 1);\n --rpf-green-100: hsla(125, 41%, 95%, 1);\n --rpf-green-200: hsla(122, 39%, 87%, 1);\n --rpf-green-400: hsla(123, 40%, 74%, 1);\n --rpf-green-600: hsla(123, 40%, 61%, 1);\n --rpf-green-800: hsla(123, 43%, 48%, 1);\n --rpf-green-900: hsla(123, 43%, 34%, 1);\n --rpf-teal-100: hsla(176, 55%, 94%, 1);\n --rpf-teal-200: hsla(174, 55%, 85%, 1);\n --rpf-teal-400: hsla(174, 55%, 70%, 1);\n --rpf-teal-600: hsla(174, 56%, 56%, 1);\n --rpf-teal-800: hsla(174, 81%, 41%, 1);\n --rpf-teal-900: hsla(174, 81%, 27%, 1);\n --rpf-teal-950: hsla(174, 80%, 20%, 1);\n --rpf-orange-100: hsla(31, 100%, 95%, 1);\n --rpf-orange-200: hsla(32, 100%, 88%, 1);\n --rpf-orange-400: hsla(31, 100%, 77%, 1);\n --rpf-orange-600: hsla(31, 99%, 65%, 1);\n --rpf-orange-800: hsla(31, 99%, 54%, 1);\n --rpf-orange-900: hsla(31, 85%, 35%, 1);\n --rpf-yellow-100: hsla(51, 100%, 95%, 1);\n --rpf-yellow-200: hsla(52, 100%, 87%, 1);\n --rpf-yellow-400: hsla(51, 100%, 75%, 1);\n --rpf-yellow-600: hsla(52, 100%, 63%, 1);\n --rpf-yellow-800: hsla(52, 100%, 50%, 1);\n --rpf-yellow-900: hsla(52, 100%, 26%, 1);\n --rpf-purple-100: hsla(282, 36%, 95%, 1);\n --rpf-purple-200: hsla(279, 38%, 87%, 1);\n --rpf-purple-400: hsla(279, 38%, 73%, 1);\n --rpf-purple-600: hsla(279, 37%, 60%, 1);\n --rpf-purple-800: hsla(279, 43%, 47%, 1);\n --rpf-purple-900: hsla(280, 43%, 37%, 1);\n --rpf-navy-100: hsla(235, 38%, 94%, 1);\n --rpf-navy-200: hsla(234, 38%, 84%, 1);\n --rpf-navy-400: hsla(235, 38%, 69%, 1);\n --rpf-navy-600: hsla(235, 38%, 53%, 1);\n --rpf-navy-800: hsla(235, 63%, 37%, 1);\n --rpf-navy-900: hsla(234, 63%, 30%, 1);\n --rpf-blue-100: hsla(203, 86%, 95%, 1);\n --rpf-blue-200: hsla(204, 88%, 87%, 1);\n --rpf-blue-400: hsla(204, 88%, 74%, 1);\n --rpf-blue-600: hsla(204, 89%, 60%, 1);\n --rpf-blue-800: hsla(204, 100%, 47%, 1);\n --rpf-blue-900: hsla(204, 99%, 37%, 1);\n}\n\n:root, :host {\n --rpf-input-background-color: var(--rpf-white);\n --rpf-input-background-color-disabled: var(--rpf-grey-50);\n --rpf-input-background-color-readonly: var(--rpf-grey-50);\n --rpf-input-color-error: var(--rpf-alert-error);\n --rpf-input-color: var(--rpf-text-primary);\n --rpf-input-outline-color: var(--rpf-blue-800);\n}\n\n:root, :host {\n --font-size-0-5: 0.5rem;\n --font-size-0-75: 0.75rem;\n --font-size-1: 1rem;\n --font-size-1-5: 1.25rem;\n --font-size-2: 1.5rem;\n --font-size-3: 2rem;\n --font-size-4: 2.5rem;\n --font-size-5: 3rem;\n --font-size-6: 3.5rem;\n --font-size-7: 4rem;\n --font-size-8: 4.5rem;\n --font-size-9: 5rem;\n}\n\n.rpf-input-field {\n margin-block-end: var(--space-3);\n}\n\n.rpf-input {\n all: unset;\n background-color: var(--rpf-input-background-color);\n border: var(--input-border-width) solid var(--rpf-input-color);\n border-radius: var(--border-radius);\n box-sizing: border-box;\n color: var(--rpf-input-color);\n display: flex;\n font-size: var(--font-size-1);\n line-height: var(--line-height-2);\n padding-block: calc(var(--space-1) - 2px);\n padding-inline: var(--space-1-5);\n max-width: 50ch;\n min-width: 240px;\n width: 100%;\n}\n.rpf-input:disabled, .rpf-input--disabled {\n border-color: var(--rpf-input-background-color-disabled);\n background-color: var(--rpf-input-background-color-disabled);\n}\n.rpf-input:focus-visible {\n outline: 3px solid var(--rpf-input-outline-color);\n}\n.rpf-input--error {\n border-color: var(--rpf-input-color-error);\n}\n.rpf-input--full-width {\n max-width: none;\n}\n";
|
|
1432
|
-
styleInject(css_248z$8);
|
|
1433
|
-
|
|
1434
|
-
const SelectInput = ({
|
|
1435
|
-
id,
|
|
1436
|
-
label,
|
|
1437
|
-
name,
|
|
1438
|
-
options,
|
|
1439
|
-
disabled = false,
|
|
1440
|
-
error = "",
|
|
1441
|
-
fullWidth = false,
|
|
1442
|
-
hint = "",
|
|
1443
|
-
onChange = () => {},
|
|
1444
|
-
placeholder = "",
|
|
1445
|
-
value = ""
|
|
1446
|
-
}) => /*#__PURE__*/React.createElement(InputField, {
|
|
1447
|
-
id: id,
|
|
1448
|
-
disabled: disabled,
|
|
1449
|
-
error: error,
|
|
1450
|
-
hint: hint,
|
|
1451
|
-
label: label
|
|
1452
|
-
}, /*#__PURE__*/React.createElement("select", {
|
|
1453
|
-
className: classNames("rpf-input rpf-input-select", {
|
|
1454
|
-
"rpf-input--error": error,
|
|
1455
|
-
"rpf-input--full-width": fullWidth
|
|
1456
|
-
}),
|
|
1457
|
-
disabled: disabled,
|
|
1458
|
-
id: id,
|
|
1459
|
-
name: name,
|
|
1460
|
-
onChange: onChange,
|
|
1461
|
-
type: "text",
|
|
1462
|
-
value: value
|
|
1463
|
-
}, !value && !!placeholder && /*#__PURE__*/React.createElement("option", {
|
|
1464
|
-
value: "",
|
|
1465
|
-
disabled: true
|
|
1466
|
-
}, placeholder), options.map(option => /*#__PURE__*/React.createElement("option", {
|
|
1467
|
-
value: option.key,
|
|
1468
|
-
key: option.key
|
|
1469
|
-
}, option.value))));
|
|
1470
|
-
SelectInput.propTypes = {
|
|
1471
|
-
disabled: PropTypes.bool,
|
|
1472
|
-
error: PropTypes.string,
|
|
1473
|
-
fullWidth: PropTypes.bool,
|
|
1474
|
-
hint: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
|
|
1475
|
-
label: PropTypes.oneOfType([PropTypes.string, PropTypes.object]).isRequired,
|
|
1476
|
-
id: PropTypes.string.isRequired,
|
|
1477
|
-
name: PropTypes.string.isRequired,
|
|
1478
|
-
onChange: PropTypes.func,
|
|
1479
|
-
options: PropTypes.array.isRequired,
|
|
1480
|
-
placeholder: PropTypes.string,
|
|
1481
|
-
value: PropTypes.string
|
|
1482
|
-
};
|
|
1483
|
-
|
|
1484
|
-
var css_248z$7 = ":root, :host {\n --border-radius: var(--space-1);\n --border-radius-sm: var(--space-0-5);\n --border-width-sm: 1px;\n --border-width-md: 2px;\n --border-width-lg: 3px;\n --alert-border-width: var(--border-width-md);\n --fieldset-border-width: var(--border-width-md);\n --input-border-width: var(--border-width-md);\n --table-border-width: var(--border-width-sm);\n}\n\n:root, :host {\n --rpf-alert-error-highlight: hsla(0, 88%, 99%, 1);\n --rpf-alert-error: hsla(0, 88%, 33%, 1);\n --rpf-alert-information-highlight: hsla(225, 64%, 99%, 1);\n --rpf-alert-information: hsla(225, 64%, 33%, 1);\n --rpf-alert-success-highlight: hsla(136, 90%, 99%, 1);\n --rpf-alert-success: hsla(136, 90%, 20%, 1);\n --rpf-alert-warning-highlight: hsla(26, 70%, 99%, 1);\n --rpf-alert-warning: hsla(26, 70%, 29%, 1);\n}\n\n:root, :host {\n --rpf-white: hsla(0, 0%, 100%, 1);\n --rpf-off-white: hsla(225, 25%, 97%, 1);\n --rpf-grey-50: hsla(210, 8%, 95%, 1);\n --rpf-grey-100: hsla(228, 10%, 90%, 1);\n --rpf-grey-150: hsla(223, 9%, 85%, 1);\n --rpf-grey-200: hsla(228, 10%, 80%, 1);\n --rpf-grey-300: hsla(229, 9%, 75%, 1);\n --rpf-grey-400: hsla(229, 8%, 61%, 1);\n --rpf-grey-500: hsla(229, 9%, 42%, 1);\n --rpf-grey-600: hsla(228, 9%, 32%, 1);\n --rpf-grey-700: hsla(228, 9%, 22%, 1);\n --rpf-grey-800: hsla(232, 9%, 18%, 1);\n --rpf-grey-850: hsla(228, 9%, 15%, 1);\n --rpf-grey-900: hsla(228, 9%, 10%, 1);\n --rpf-grey-950: hsla(228, 8%, 5%, 1);\n --rpf-black: hsla(0, 0%, 0%, 1);\n}\n\n:root, :host {\n --rpf-red-100: hsla(4, 89%, 96%, 1);\n --rpf-red-200: hsla(1, 87%, 91%, 1);\n --rpf-red-400: hsla(1, 87%, 82%, 1);\n --rpf-red-600: hsla(1, 87%, 72%, 1);\n --rpf-red-800: hsla(1, 87%, 63%, 1);\n --rpf-red-900: hsla(1, 52%, 50%, 1);\n --rpf-green-100: hsla(125, 41%, 95%, 1);\n --rpf-green-200: hsla(122, 39%, 87%, 1);\n --rpf-green-400: hsla(123, 40%, 74%, 1);\n --rpf-green-600: hsla(123, 40%, 61%, 1);\n --rpf-green-800: hsla(123, 43%, 48%, 1);\n --rpf-green-900: hsla(123, 43%, 34%, 1);\n --rpf-teal-100: hsla(176, 55%, 94%, 1);\n --rpf-teal-200: hsla(174, 55%, 85%, 1);\n --rpf-teal-400: hsla(174, 55%, 70%, 1);\n --rpf-teal-600: hsla(174, 56%, 56%, 1);\n --rpf-teal-800: hsla(174, 81%, 41%, 1);\n --rpf-teal-900: hsla(174, 81%, 27%, 1);\n --rpf-teal-950: hsla(174, 80%, 20%, 1);\n --rpf-orange-100: hsla(31, 100%, 95%, 1);\n --rpf-orange-200: hsla(32, 100%, 88%, 1);\n --rpf-orange-400: hsla(31, 100%, 77%, 1);\n --rpf-orange-600: hsla(31, 99%, 65%, 1);\n --rpf-orange-800: hsla(31, 99%, 54%, 1);\n --rpf-orange-900: hsla(31, 85%, 35%, 1);\n --rpf-yellow-100: hsla(51, 100%, 95%, 1);\n --rpf-yellow-200: hsla(52, 100%, 87%, 1);\n --rpf-yellow-400: hsla(51, 100%, 75%, 1);\n --rpf-yellow-600: hsla(52, 100%, 63%, 1);\n --rpf-yellow-800: hsla(52, 100%, 50%, 1);\n --rpf-yellow-900: hsla(52, 100%, 26%, 1);\n --rpf-purple-100: hsla(282, 36%, 95%, 1);\n --rpf-purple-200: hsla(279, 38%, 87%, 1);\n --rpf-purple-400: hsla(279, 38%, 73%, 1);\n --rpf-purple-600: hsla(279, 37%, 60%, 1);\n --rpf-purple-800: hsla(279, 43%, 47%, 1);\n --rpf-purple-900: hsla(280, 43%, 37%, 1);\n --rpf-navy-100: hsla(235, 38%, 94%, 1);\n --rpf-navy-200: hsla(234, 38%, 84%, 1);\n --rpf-navy-400: hsla(235, 38%, 69%, 1);\n --rpf-navy-600: hsla(235, 38%, 53%, 1);\n --rpf-navy-800: hsla(235, 63%, 37%, 1);\n --rpf-navy-900: hsla(234, 63%, 30%, 1);\n --rpf-blue-100: hsla(203, 86%, 95%, 1);\n --rpf-blue-200: hsla(204, 88%, 87%, 1);\n --rpf-blue-400: hsla(204, 88%, 74%, 1);\n --rpf-blue-600: hsla(204, 89%, 60%, 1);\n --rpf-blue-800: hsla(204, 100%, 47%, 1);\n --rpf-blue-900: hsla(204, 99%, 37%, 1);\n}\n\n:root, :host {\n --rpf-text-primary: hsla(0, 0%, 13%, 1);\n --rpf-text-primary-darkmode: var(--rpf-white);\n --rpf-text-secondary: hsla(200, 9%, 33%, 1);\n --rpf-text-secondary-darkmode: hsla(0, 0%, 80%, 1);\n --rpf-link-text: var(--rpf-navy-800);\n}\n\n:root, :host {\n --rpf-input-background-color: var(--rpf-white);\n --rpf-input-background-color-disabled: var(--rpf-grey-50);\n --rpf-input-background-color-readonly: var(--rpf-grey-50);\n --rpf-input-color-error: var(--rpf-alert-error);\n --rpf-input-color: var(--rpf-text-primary);\n --rpf-input-outline-color: var(--rpf-blue-800);\n}\n\n:root, :host {\n --font-size-0-5: 0.5rem;\n --font-size-0-75: 0.75rem;\n --font-size-1: 1rem;\n --font-size-1-5: 1.25rem;\n --font-size-2: 1.5rem;\n --font-size-3: 2rem;\n --font-size-4: 2.5rem;\n --font-size-5: 3rem;\n --font-size-6: 3.5rem;\n --font-size-7: 4rem;\n --font-size-8: 4.5rem;\n --font-size-9: 5rem;\n}\n\n:root, :host {\n --space-0-125: 0.0625rem;\n --space-0-25: 0.125rem;\n --space-0-5: 0.25rem;\n --space-1: 0.5rem;\n --space-1-5: 0.75rem;\n --space-2: 1rem;\n --space-3: 1.5rem;\n --space-4: 2rem;\n --space-5: 2.5rem;\n --space-6: 3rem;\n --space-7: 3.5rem;\n --space-8: 4rem;\n --space-9: 4.5rem;\n --space-10: 5rem;\n}\n\n.rpf-input-field {\n margin-block-end: var(--space-3);\n}\n\n.rpf-input {\n all: unset;\n background-color: var(--rpf-input-background-color);\n border: var(--input-border-width) solid var(--rpf-input-color);\n border-radius: var(--border-radius);\n box-sizing: border-box;\n color: var(--rpf-input-color);\n display: flex;\n font-size: var(--font-size-1);\n line-height: var(--line-height-2);\n padding-block: calc(var(--space-1) - 2px);\n padding-inline: var(--space-1-5);\n max-width: 50ch;\n min-width: 240px;\n width: 100%;\n}\n.rpf-input:disabled, .rpf-input--disabled {\n border-color: var(--rpf-input-background-color-disabled);\n background-color: var(--rpf-input-background-color-disabled);\n}\n.rpf-input:focus-visible {\n outline: 3px solid var(--rpf-input-outline-color);\n}\n.rpf-input--error {\n border-color: var(--rpf-input-color-error);\n}\n.rpf-input--full-width {\n max-width: none;\n}\n\n:root, :host {\n --font-weight-regular: 400;\n --font-weight-bold: 700;\n}\n\n:root, :host {\n --line-height-0-75: 0.75rem;\n --line-height-1: 1rem;\n --line-height-1-5: 1.5rem;\n --line-height-2: 2rem;\n --line-height-2-5: 2.5rem;\n --line-height-3: 3rem;\n --line-height-3-5: 3.5rem;\n --line-height-4: 4rem;\n --line-height-4-5: 4.5rem;\n --line-height-5: 5rem;\n --line-height-5-5: 5.5rem;\n --line-height-6: 6rem;\n --line-height-6-5: 6.5rem;\n}\n\n:root, :host {\n --rpf-label-hint-color: var(--rpf-text-secondary);\n --rpf-label-text-color: var(--rpf-text-primary);\n --rpf-label-text-color-disabled: var(--rpf-grey-500);\n}\n\n.rpf-label {\n all: unset;\n color: var(--rpf-label-text-color);\n display: flex;\n flex-direction: column;\n font-weight: var(--font-weight-bold);\n padding-block-end: var(--space-1);\n font-size: var(--font-size-1);\n line-height: var(--line-height-1-5);\n}\n.rpf-label__hint {\n color: var(--rpf-label-hint-color);\n font-size: var(--font-size-1);\n font-weight: var(--font-weight-regular);\n}\n.rpf-label--disabled {\n color: var(--rpf-label-text-color-disabled);\n}\n.rpf-label--disabled .rpf-label__hint {\n color: var(--rpf-label-text-color-disabled);\n}\n\n:root, :host {\n --rpf-message-text-color: var(--rpf-alert-error);\n}\n\n.rpf-error-message {\n all: unset;\n align-items: center;\n color: var(--rpf-message-text-color);\n display: flex;\n font-weight: var(--font-weight-bold);\n padding-block: var(--space-1);\n}\n.rpf-error-message__icon {\n margin-inline-end: var(--space-1);\n}\n";
|
|
1485
|
-
styleInject(css_248z$7);
|
|
1486
|
-
|
|
1487
|
-
const TextInput = ({
|
|
1488
|
-
id,
|
|
1489
|
-
label,
|
|
1490
|
-
name,
|
|
1491
|
-
value,
|
|
1492
|
-
disabled = false,
|
|
1493
|
-
error = "",
|
|
1494
|
-
fullWidth = false,
|
|
1495
|
-
hint = "",
|
|
1496
|
-
onChange = () => {}
|
|
1497
|
-
}) => /*#__PURE__*/React.createElement(InputField, {
|
|
1498
|
-
id: id,
|
|
1499
|
-
disabled: disabled,
|
|
1500
|
-
error: error,
|
|
1501
|
-
hint: hint,
|
|
1502
|
-
label: label
|
|
1503
|
-
}, /*#__PURE__*/React.createElement("input", {
|
|
1504
|
-
className: classNames("rpf-input rpf-input-text", {
|
|
1505
|
-
"rpf-input--error": error,
|
|
1506
|
-
"rpf-input--full-width": fullWidth
|
|
1507
|
-
}),
|
|
1508
|
-
disabled: disabled,
|
|
1509
|
-
id: id,
|
|
1510
|
-
name: name,
|
|
1511
|
-
onChange: onChange,
|
|
1512
|
-
type: "text",
|
|
1513
|
-
value: value
|
|
1514
|
-
}));
|
|
1515
|
-
TextInput.propTypes = {
|
|
1516
|
-
disabled: PropTypes.bool,
|
|
1517
|
-
error: PropTypes.string,
|
|
1518
|
-
fullWidth: PropTypes.bool,
|
|
1519
|
-
hint: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
|
|
1520
|
-
label: PropTypes.oneOfType([PropTypes.string, PropTypes.object]).isRequired,
|
|
1521
|
-
id: PropTypes.string.isRequired,
|
|
1522
|
-
name: PropTypes.string.isRequired,
|
|
1523
|
-
onChange: PropTypes.func,
|
|
1524
|
-
value: PropTypes.string.isRequired
|
|
1525
|
-
};
|
|
1526
|
-
|
|
1527
|
-
const InputLabel = ({
|
|
1528
|
-
label,
|
|
1529
|
-
inputFieldId,
|
|
1530
|
-
disabled = false,
|
|
1531
|
-
hint = ""
|
|
1532
|
-
}) => /*#__PURE__*/React.createElement("div", {
|
|
1533
|
-
className: "rpf-label"
|
|
1534
|
-
}, /*#__PURE__*/React.createElement("label", {
|
|
1535
|
-
htmlFor: inputFieldId,
|
|
1536
|
-
className: classNames("rpf-label", {
|
|
1537
|
-
"rpf-label--disabled": disabled
|
|
1538
|
-
})
|
|
1539
|
-
}, label, hint && /*#__PURE__*/React.createElement("div", {
|
|
1540
|
-
className: "rpf-label__hint"
|
|
1541
|
-
}, hint)));
|
|
1542
|
-
InputLabel.propTypes = {
|
|
1543
|
-
disabled: PropTypes.bool,
|
|
1544
|
-
hint: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
|
|
1545
|
-
label: PropTypes.oneOfType([PropTypes.string, PropTypes.object]).isRequired,
|
|
1546
|
-
inputFieldId: PropTypes.string.isRequired
|
|
1547
|
-
};
|
|
1548
|
-
|
|
1549
|
-
var css_248z$6 = ":root, :host {\n --border-radius: var(--space-1);\n --border-radius-sm: var(--space-0-5);\n --border-width-sm: 1px;\n --border-width-md: 2px;\n --border-width-lg: 3px;\n --alert-border-width: var(--border-width-md);\n --fieldset-border-width: var(--border-width-md);\n --input-border-width: var(--border-width-md);\n --table-border-width: var(--border-width-sm);\n}\n\n:root, :host {\n --rpf-alert-error-highlight: hsla(0, 88%, 99%, 1);\n --rpf-alert-error: hsla(0, 88%, 33%, 1);\n --rpf-alert-information-highlight: hsla(225, 64%, 99%, 1);\n --rpf-alert-information: hsla(225, 64%, 33%, 1);\n --rpf-alert-success-highlight: hsla(136, 90%, 99%, 1);\n --rpf-alert-success: hsla(136, 90%, 20%, 1);\n --rpf-alert-warning-highlight: hsla(26, 70%, 99%, 1);\n --rpf-alert-warning: hsla(26, 70%, 29%, 1);\n}\n\n:root, :host {\n --rpf-white: hsla(0, 0%, 100%, 1);\n --rpf-off-white: hsla(225, 25%, 97%, 1);\n --rpf-grey-50: hsla(210, 8%, 95%, 1);\n --rpf-grey-100: hsla(228, 10%, 90%, 1);\n --rpf-grey-150: hsla(223, 9%, 85%, 1);\n --rpf-grey-200: hsla(228, 10%, 80%, 1);\n --rpf-grey-300: hsla(229, 9%, 75%, 1);\n --rpf-grey-400: hsla(229, 8%, 61%, 1);\n --rpf-grey-500: hsla(229, 9%, 42%, 1);\n --rpf-grey-600: hsla(228, 9%, 32%, 1);\n --rpf-grey-700: hsla(228, 9%, 22%, 1);\n --rpf-grey-800: hsla(232, 9%, 18%, 1);\n --rpf-grey-850: hsla(228, 9%, 15%, 1);\n --rpf-grey-900: hsla(228, 9%, 10%, 1);\n --rpf-grey-950: hsla(228, 8%, 5%, 1);\n --rpf-black: hsla(0, 0%, 0%, 1);\n}\n\n:root, :host {\n --rpf-red-100: hsla(4, 89%, 96%, 1);\n --rpf-red-200: hsla(1, 87%, 91%, 1);\n --rpf-red-400: hsla(1, 87%, 82%, 1);\n --rpf-red-600: hsla(1, 87%, 72%, 1);\n --rpf-red-800: hsla(1, 87%, 63%, 1);\n --rpf-red-900: hsla(1, 52%, 50%, 1);\n --rpf-green-100: hsla(125, 41%, 95%, 1);\n --rpf-green-200: hsla(122, 39%, 87%, 1);\n --rpf-green-400: hsla(123, 40%, 74%, 1);\n --rpf-green-600: hsla(123, 40%, 61%, 1);\n --rpf-green-800: hsla(123, 43%, 48%, 1);\n --rpf-green-900: hsla(123, 43%, 34%, 1);\n --rpf-teal-100: hsla(176, 55%, 94%, 1);\n --rpf-teal-200: hsla(174, 55%, 85%, 1);\n --rpf-teal-400: hsla(174, 55%, 70%, 1);\n --rpf-teal-600: hsla(174, 56%, 56%, 1);\n --rpf-teal-800: hsla(174, 81%, 41%, 1);\n --rpf-teal-900: hsla(174, 81%, 27%, 1);\n --rpf-teal-950: hsla(174, 80%, 20%, 1);\n --rpf-orange-100: hsla(31, 100%, 95%, 1);\n --rpf-orange-200: hsla(32, 100%, 88%, 1);\n --rpf-orange-400: hsla(31, 100%, 77%, 1);\n --rpf-orange-600: hsla(31, 99%, 65%, 1);\n --rpf-orange-800: hsla(31, 99%, 54%, 1);\n --rpf-orange-900: hsla(31, 85%, 35%, 1);\n --rpf-yellow-100: hsla(51, 100%, 95%, 1);\n --rpf-yellow-200: hsla(52, 100%, 87%, 1);\n --rpf-yellow-400: hsla(51, 100%, 75%, 1);\n --rpf-yellow-600: hsla(52, 100%, 63%, 1);\n --rpf-yellow-800: hsla(52, 100%, 50%, 1);\n --rpf-yellow-900: hsla(52, 100%, 26%, 1);\n --rpf-purple-100: hsla(282, 36%, 95%, 1);\n --rpf-purple-200: hsla(279, 38%, 87%, 1);\n --rpf-purple-400: hsla(279, 38%, 73%, 1);\n --rpf-purple-600: hsla(279, 37%, 60%, 1);\n --rpf-purple-800: hsla(279, 43%, 47%, 1);\n --rpf-purple-900: hsla(280, 43%, 37%, 1);\n --rpf-navy-100: hsla(235, 38%, 94%, 1);\n --rpf-navy-200: hsla(234, 38%, 84%, 1);\n --rpf-navy-400: hsla(235, 38%, 69%, 1);\n --rpf-navy-600: hsla(235, 38%, 53%, 1);\n --rpf-navy-800: hsla(235, 63%, 37%, 1);\n --rpf-navy-900: hsla(234, 63%, 30%, 1);\n --rpf-blue-100: hsla(203, 86%, 95%, 1);\n --rpf-blue-200: hsla(204, 88%, 87%, 1);\n --rpf-blue-400: hsla(204, 88%, 74%, 1);\n --rpf-blue-600: hsla(204, 89%, 60%, 1);\n --rpf-blue-800: hsla(204, 100%, 47%, 1);\n --rpf-blue-900: hsla(204, 99%, 37%, 1);\n}\n\n:root, :host {\n --rpf-text-primary: hsla(0, 0%, 13%, 1);\n --rpf-text-primary-darkmode: var(--rpf-white);\n --rpf-text-secondary: hsla(200, 9%, 33%, 1);\n --rpf-text-secondary-darkmode: hsla(0, 0%, 80%, 1);\n --rpf-link-text: var(--rpf-navy-800);\n}\n\n:root, :host {\n --rpf-input-background-color: var(--rpf-white);\n --rpf-input-background-color-disabled: var(--rpf-grey-50);\n --rpf-input-background-color-readonly: var(--rpf-grey-50);\n --rpf-input-color-error: var(--rpf-alert-error);\n --rpf-input-color: var(--rpf-text-primary);\n --rpf-input-outline-color: var(--rpf-blue-800);\n}\n\n:root, :host {\n --font-size-0-5: 0.5rem;\n --font-size-0-75: 0.75rem;\n --font-size-1: 1rem;\n --font-size-1-5: 1.25rem;\n --font-size-2: 1.5rem;\n --font-size-3: 2rem;\n --font-size-4: 2.5rem;\n --font-size-5: 3rem;\n --font-size-6: 3.5rem;\n --font-size-7: 4rem;\n --font-size-8: 4.5rem;\n --font-size-9: 5rem;\n}\n\n:root, :host {\n --space-0-125: 0.0625rem;\n --space-0-25: 0.125rem;\n --space-0-5: 0.25rem;\n --space-1: 0.5rem;\n --space-1-5: 0.75rem;\n --space-2: 1rem;\n --space-3: 1.5rem;\n --space-4: 2rem;\n --space-5: 2.5rem;\n --space-6: 3rem;\n --space-7: 3.5rem;\n --space-8: 4rem;\n --space-9: 4.5rem;\n --space-10: 5rem;\n}\n\n.rpf-input-field {\n margin-block-end: var(--space-3);\n}\n\n.rpf-input {\n all: unset;\n background-color: var(--rpf-input-background-color);\n border: var(--input-border-width) solid var(--rpf-input-color);\n border-radius: var(--border-radius);\n box-sizing: border-box;\n color: var(--rpf-input-color);\n display: flex;\n font-size: var(--font-size-1);\n line-height: var(--line-height-2);\n padding-block: calc(var(--space-1) - 2px);\n padding-inline: var(--space-1-5);\n max-width: 50ch;\n min-width: 240px;\n width: 100%;\n}\n.rpf-input:disabled, .rpf-input--disabled {\n border-color: var(--rpf-input-background-color-disabled);\n background-color: var(--rpf-input-background-color-disabled);\n}\n.rpf-input:focus-visible {\n outline: 3px solid var(--rpf-input-outline-color);\n}\n.rpf-input--error {\n border-color: var(--rpf-input-color-error);\n}\n.rpf-input--full-width {\n max-width: none;\n}\n\n:root, :host {\n --font-weight-regular: 400;\n --font-weight-bold: 700;\n}\n\n:root, :host {\n --line-height-0-75: 0.75rem;\n --line-height-1: 1rem;\n --line-height-1-5: 1.5rem;\n --line-height-2: 2rem;\n --line-height-2-5: 2.5rem;\n --line-height-3: 3rem;\n --line-height-3-5: 3.5rem;\n --line-height-4: 4rem;\n --line-height-4-5: 4.5rem;\n --line-height-5: 5rem;\n --line-height-5-5: 5.5rem;\n --line-height-6: 6rem;\n --line-height-6-5: 6.5rem;\n}\n\n:root, :host {\n --rpf-label-hint-color: var(--rpf-text-secondary);\n --rpf-label-text-color: var(--rpf-text-primary);\n --rpf-label-text-color-disabled: var(--rpf-grey-500);\n}\n\n.rpf-label {\n all: unset;\n color: var(--rpf-label-text-color);\n display: flex;\n flex-direction: column;\n font-weight: var(--font-weight-bold);\n padding-block-end: var(--space-1);\n font-size: var(--font-size-1);\n line-height: var(--line-height-1-5);\n}\n.rpf-label__hint {\n color: var(--rpf-label-hint-color);\n font-size: var(--font-size-1);\n font-weight: var(--font-weight-regular);\n}\n.rpf-label--disabled {\n color: var(--rpf-label-text-color-disabled);\n}\n.rpf-label--disabled .rpf-label__hint {\n color: var(--rpf-label-text-color-disabled);\n}\n\n:root, :host {\n /* 44px min-height to meet WCAG AAA target size requirements */\n --min-target-size: 44px;\n --sm-target-size: 32px;\n --lg-target-size: 48px;\n}\n\n.rpf-input-radio {\n --rpf-input-radio-hit-target: var(--min-target-size);\n --rpf-input-radio-size: var(--space-3);\n align-items: center;\n border-radius: var(--space-1);\n box-sizing: border-box;\n display: flex;\n gap: var(--space-1-5);\n margin-block-end: var(--space-1);\n max-width: 50ch;\n min-height: var(--rpf-input-radio-hit-target);\n min-width: 240px;\n padding-block: calc((var(--rpf-input-radio-hit-target) - var(--rpf-input-radio-size)) / 2);\n padding-inline: var(--space-1);\n width: 100%;\n}\n.rpf-input-radio input[type=radio] {\n align-self: flex-start;\n appearance: none;\n background: var(--rpf-white);\n border: var(--space-0-25) solid var(--rpf-grey-850);\n border-radius: var(--rpf-input-radio-size);\n flex-shrink: 0;\n height: var(--rpf-input-radio-size);\n margin: 0;\n width: var(--rpf-input-radio-size);\n}\n.rpf-input-radio input[type=radio]:checked {\n background-image: url('data:image/svg+xml;utf8,<svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><rect width=\"12\" height=\"12\" rx=\"6\" fill=\"hsla(228, 9%, 15%, 1)\"/></svg>');\n background-position: center center;\n background-repeat: no-repeat;\n}\n.rpf-input-radio input[type=radio]:disabled {\n border-color: var(--rpf-grey-400);\n}\n.rpf-input-radio input[type=radio]:disabled:checked {\n background-image: url('data:image/svg+xml;utf8,<svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><rect width=\"12\" height=\"12\" rx=\"6\" fill=\"hsla(229, 8%, 61%, 1)\"/></svg>');\n}\n.rpf-input-radio.rpf-input--full-width {\n max-width: none;\n}\n.rpf-input-radio:has(> input[type=radio]:disabled), .rpf-input-radio--disabled {\n background-color: var(--rpf-input-background-color-disabled);\n color: var(--rpf-grey-400);\n}\n.rpf-input-radio:has(> input[type=radio]:focus-visible) {\n outline: 3px solid var(--rpf-input-outline-color);\n}\n.rpf-input-radio:has(> input[type=radio]:focus-visible) > input[type=radio]:focus-visible {\n outline: none;\n}\n";
|
|
1550
|
-
styleInject(css_248z$6);
|
|
1551
|
-
|
|
1552
|
-
const RadioInput = ({
|
|
1553
|
-
id,
|
|
1554
|
-
label,
|
|
1555
|
-
name,
|
|
1556
|
-
checked = false,
|
|
1557
|
-
disabled = false,
|
|
1558
|
-
fullWidth = false,
|
|
1559
|
-
onChange = () => {},
|
|
1560
|
-
value = ""
|
|
1561
|
-
}) => /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("label", {
|
|
1562
|
-
className: classNames("rpf-input-radio", {
|
|
1563
|
-
"rpf-input-radio--disabled": disabled,
|
|
1564
|
-
"rpf-input--full-width": fullWidth
|
|
1565
|
-
})
|
|
1566
|
-
}, /*#__PURE__*/React.createElement("input", {
|
|
1567
|
-
checked: !!checked,
|
|
1568
|
-
disabled: disabled,
|
|
1569
|
-
id: id,
|
|
1570
|
-
name: name,
|
|
1571
|
-
onChange: onChange,
|
|
1572
|
-
type: "radio",
|
|
1573
|
-
value: value
|
|
1574
|
-
}), label));
|
|
1575
|
-
RadioInput.propTypes = {
|
|
1576
|
-
checked: PropTypes.bool,
|
|
1577
|
-
disabled: PropTypes.bool,
|
|
1578
|
-
fullWidth: PropTypes.bool,
|
|
1579
|
-
id: PropTypes.string.isRequired,
|
|
1580
|
-
label: PropTypes.oneOfType([PropTypes.string, PropTypes.object]).isRequired,
|
|
1581
|
-
name: PropTypes.string.isRequired,
|
|
1582
|
-
onChange: PropTypes.func,
|
|
1583
|
-
value: PropTypes.string
|
|
1584
|
-
};
|
|
1585
|
-
|
|
1586
|
-
var css_248z$5 = ":root, :host {\n --border-radius: var(--space-1);\n --border-radius-sm: var(--space-0-5);\n --border-width-sm: 1px;\n --border-width-md: 2px;\n --border-width-lg: 3px;\n --alert-border-width: var(--border-width-md);\n --fieldset-border-width: var(--border-width-md);\n --input-border-width: var(--border-width-md);\n --table-border-width: var(--border-width-sm);\n}\n\n:root, :host {\n --rpf-alert-error-highlight: hsla(0, 88%, 99%, 1);\n --rpf-alert-error: hsla(0, 88%, 33%, 1);\n --rpf-alert-information-highlight: hsla(225, 64%, 99%, 1);\n --rpf-alert-information: hsla(225, 64%, 33%, 1);\n --rpf-alert-success-highlight: hsla(136, 90%, 99%, 1);\n --rpf-alert-success: hsla(136, 90%, 20%, 1);\n --rpf-alert-warning-highlight: hsla(26, 70%, 99%, 1);\n --rpf-alert-warning: hsla(26, 70%, 29%, 1);\n}\n\n:root, :host {\n --rpf-white: hsla(0, 0%, 100%, 1);\n --rpf-off-white: hsla(225, 25%, 97%, 1);\n --rpf-grey-50: hsla(210, 8%, 95%, 1);\n --rpf-grey-100: hsla(228, 10%, 90%, 1);\n --rpf-grey-150: hsla(223, 9%, 85%, 1);\n --rpf-grey-200: hsla(228, 10%, 80%, 1);\n --rpf-grey-300: hsla(229, 9%, 75%, 1);\n --rpf-grey-400: hsla(229, 8%, 61%, 1);\n --rpf-grey-500: hsla(229, 9%, 42%, 1);\n --rpf-grey-600: hsla(228, 9%, 32%, 1);\n --rpf-grey-700: hsla(228, 9%, 22%, 1);\n --rpf-grey-800: hsla(232, 9%, 18%, 1);\n --rpf-grey-850: hsla(228, 9%, 15%, 1);\n --rpf-grey-900: hsla(228, 9%, 10%, 1);\n --rpf-grey-950: hsla(228, 8%, 5%, 1);\n --rpf-black: hsla(0, 0%, 0%, 1);\n}\n\n:root, :host {\n --rpf-red-100: hsla(4, 89%, 96%, 1);\n --rpf-red-200: hsla(1, 87%, 91%, 1);\n --rpf-red-400: hsla(1, 87%, 82%, 1);\n --rpf-red-600: hsla(1, 87%, 72%, 1);\n --rpf-red-800: hsla(1, 87%, 63%, 1);\n --rpf-red-900: hsla(1, 52%, 50%, 1);\n --rpf-green-100: hsla(125, 41%, 95%, 1);\n --rpf-green-200: hsla(122, 39%, 87%, 1);\n --rpf-green-400: hsla(123, 40%, 74%, 1);\n --rpf-green-600: hsla(123, 40%, 61%, 1);\n --rpf-green-800: hsla(123, 43%, 48%, 1);\n --rpf-green-900: hsla(123, 43%, 34%, 1);\n --rpf-teal-100: hsla(176, 55%, 94%, 1);\n --rpf-teal-200: hsla(174, 55%, 85%, 1);\n --rpf-teal-400: hsla(174, 55%, 70%, 1);\n --rpf-teal-600: hsla(174, 56%, 56%, 1);\n --rpf-teal-800: hsla(174, 81%, 41%, 1);\n --rpf-teal-900: hsla(174, 81%, 27%, 1);\n --rpf-teal-950: hsla(174, 80%, 20%, 1);\n --rpf-orange-100: hsla(31, 100%, 95%, 1);\n --rpf-orange-200: hsla(32, 100%, 88%, 1);\n --rpf-orange-400: hsla(31, 100%, 77%, 1);\n --rpf-orange-600: hsla(31, 99%, 65%, 1);\n --rpf-orange-800: hsla(31, 99%, 54%, 1);\n --rpf-orange-900: hsla(31, 85%, 35%, 1);\n --rpf-yellow-100: hsla(51, 100%, 95%, 1);\n --rpf-yellow-200: hsla(52, 100%, 87%, 1);\n --rpf-yellow-400: hsla(51, 100%, 75%, 1);\n --rpf-yellow-600: hsla(52, 100%, 63%, 1);\n --rpf-yellow-800: hsla(52, 100%, 50%, 1);\n --rpf-yellow-900: hsla(52, 100%, 26%, 1);\n --rpf-purple-100: hsla(282, 36%, 95%, 1);\n --rpf-purple-200: hsla(279, 38%, 87%, 1);\n --rpf-purple-400: hsla(279, 38%, 73%, 1);\n --rpf-purple-600: hsla(279, 37%, 60%, 1);\n --rpf-purple-800: hsla(279, 43%, 47%, 1);\n --rpf-purple-900: hsla(280, 43%, 37%, 1);\n --rpf-navy-100: hsla(235, 38%, 94%, 1);\n --rpf-navy-200: hsla(234, 38%, 84%, 1);\n --rpf-navy-400: hsla(235, 38%, 69%, 1);\n --rpf-navy-600: hsla(235, 38%, 53%, 1);\n --rpf-navy-800: hsla(235, 63%, 37%, 1);\n --rpf-navy-900: hsla(234, 63%, 30%, 1);\n --rpf-blue-100: hsla(203, 86%, 95%, 1);\n --rpf-blue-200: hsla(204, 88%, 87%, 1);\n --rpf-blue-400: hsla(204, 88%, 74%, 1);\n --rpf-blue-600: hsla(204, 89%, 60%, 1);\n --rpf-blue-800: hsla(204, 100%, 47%, 1);\n --rpf-blue-900: hsla(204, 99%, 37%, 1);\n}\n\n:root, :host {\n --rpf-text-primary: hsla(0, 0%, 13%, 1);\n --rpf-text-primary-darkmode: var(--rpf-white);\n --rpf-text-secondary: hsla(200, 9%, 33%, 1);\n --rpf-text-secondary-darkmode: hsla(0, 0%, 80%, 1);\n --rpf-link-text: var(--rpf-navy-800);\n}\n\n:root, :host {\n --rpf-input-background-color: var(--rpf-white);\n --rpf-input-background-color-disabled: var(--rpf-grey-50);\n --rpf-input-background-color-readonly: var(--rpf-grey-50);\n --rpf-input-color-error: var(--rpf-alert-error);\n --rpf-input-color: var(--rpf-text-primary);\n --rpf-input-outline-color: var(--rpf-blue-800);\n}\n\n:root, :host {\n --font-size-0-5: 0.5rem;\n --font-size-0-75: 0.75rem;\n --font-size-1: 1rem;\n --font-size-1-5: 1.25rem;\n --font-size-2: 1.5rem;\n --font-size-3: 2rem;\n --font-size-4: 2.5rem;\n --font-size-5: 3rem;\n --font-size-6: 3.5rem;\n --font-size-7: 4rem;\n --font-size-8: 4.5rem;\n --font-size-9: 5rem;\n}\n\n:root, :host {\n --space-0-125: 0.0625rem;\n --space-0-25: 0.125rem;\n --space-0-5: 0.25rem;\n --space-1: 0.5rem;\n --space-1-5: 0.75rem;\n --space-2: 1rem;\n --space-3: 1.5rem;\n --space-4: 2rem;\n --space-5: 2.5rem;\n --space-6: 3rem;\n --space-7: 3.5rem;\n --space-8: 4rem;\n --space-9: 4.5rem;\n --space-10: 5rem;\n}\n\n.rpf-input-field {\n margin-block-end: var(--space-3);\n}\n\n.rpf-input {\n all: unset;\n background-color: var(--rpf-input-background-color);\n border: var(--input-border-width) solid var(--rpf-input-color);\n border-radius: var(--border-radius);\n box-sizing: border-box;\n color: var(--rpf-input-color);\n display: flex;\n font-size: var(--font-size-1);\n line-height: var(--line-height-2);\n padding-block: calc(var(--space-1) - 2px);\n padding-inline: var(--space-1-5);\n max-width: 50ch;\n min-width: 240px;\n width: 100%;\n}\n.rpf-input:disabled, .rpf-input--disabled {\n border-color: var(--rpf-input-background-color-disabled);\n background-color: var(--rpf-input-background-color-disabled);\n}\n.rpf-input:focus-visible {\n outline: 3px solid var(--rpf-input-outline-color);\n}\n.rpf-input--error {\n border-color: var(--rpf-input-color-error);\n}\n.rpf-input--full-width {\n max-width: none;\n}\n\n:root, :host {\n --font-weight-regular: 400;\n --font-weight-bold: 700;\n}\n\n:root, :host {\n --line-height-0-75: 0.75rem;\n --line-height-1: 1rem;\n --line-height-1-5: 1.5rem;\n --line-height-2: 2rem;\n --line-height-2-5: 2.5rem;\n --line-height-3: 3rem;\n --line-height-3-5: 3.5rem;\n --line-height-4: 4rem;\n --line-height-4-5: 4.5rem;\n --line-height-5: 5rem;\n --line-height-5-5: 5.5rem;\n --line-height-6: 6rem;\n --line-height-6-5: 6.5rem;\n}\n\n:root, :host {\n --rpf-label-hint-color: var(--rpf-text-secondary);\n --rpf-label-text-color: var(--rpf-text-primary);\n --rpf-label-text-color-disabled: var(--rpf-grey-500);\n}\n\n.rpf-label {\n all: unset;\n color: var(--rpf-label-text-color);\n display: flex;\n flex-direction: column;\n font-weight: var(--font-weight-bold);\n padding-block-end: var(--space-1);\n font-size: var(--font-size-1);\n line-height: var(--line-height-1-5);\n}\n.rpf-label__hint {\n color: var(--rpf-label-hint-color);\n font-size: var(--font-size-1);\n font-weight: var(--font-weight-regular);\n}\n.rpf-label--disabled {\n color: var(--rpf-label-text-color-disabled);\n}\n.rpf-label--disabled .rpf-label__hint {\n color: var(--rpf-label-text-color-disabled);\n}\n\n.rpf-input.rpf-input-textarea {\n resize: vertical;\n min-height: 120px;\n height: auto;\n max-height: 240px;\n overflow: auto;\n white-space: pre-wrap;\n}\n.rpf-input.rpf-input-textarea:read-only, .rpf-input.rpf-input-textarea--read-only, .rpf-input.rpf-input-textarea--readonly {\n border-color: var(--rpf-input-background-color-readonly);\n background-color: var(--rpf-input-background-color-readonly);\n}\n\n:root, :host {\n --rpf-message-text-color: var(--rpf-alert-error);\n}\n\n.rpf-error-message {\n all: unset;\n align-items: center;\n color: var(--rpf-message-text-color);\n display: flex;\n font-weight: var(--font-weight-bold);\n padding-block: var(--space-1);\n}\n.rpf-error-message__icon {\n margin-inline-end: var(--space-1);\n}\n";
|
|
1587
|
-
styleInject(css_248z$5);
|
|
1588
|
-
|
|
1589
|
-
const TextareaInput = ({
|
|
1590
|
-
id,
|
|
1591
|
-
label,
|
|
1592
|
-
name,
|
|
1593
|
-
value,
|
|
1594
|
-
disabled = false,
|
|
1595
|
-
readOnly = false,
|
|
1596
|
-
error = "",
|
|
1597
|
-
fullWidth = false,
|
|
1598
|
-
hint = "",
|
|
1599
|
-
onChange = () => {}
|
|
1600
|
-
}) => /*#__PURE__*/React.createElement(InputField, {
|
|
1601
|
-
id: id,
|
|
1602
|
-
disabled: disabled,
|
|
1603
|
-
error: error,
|
|
1604
|
-
hint: hint,
|
|
1605
|
-
label: label
|
|
1606
|
-
}, /*#__PURE__*/React.createElement("textarea", {
|
|
1607
|
-
className: classNames("rpf-input rpf-input-textarea", {
|
|
1608
|
-
"rpf-input--error": error,
|
|
1609
|
-
"rpf-input--full-width": fullWidth,
|
|
1610
|
-
"rpf-input--disabled": disabled
|
|
1611
|
-
}),
|
|
1612
|
-
disabled: disabled,
|
|
1613
|
-
readOnly: readOnly,
|
|
1614
|
-
id: id,
|
|
1615
|
-
name: name,
|
|
1616
|
-
onChange: onChange,
|
|
1617
|
-
type: "text",
|
|
1618
|
-
value: value
|
|
1619
|
-
}));
|
|
1620
|
-
TextareaInput.propTypes = {
|
|
1621
|
-
disabled: PropTypes.bool,
|
|
1622
|
-
readOnly: PropTypes.bool,
|
|
1623
|
-
error: PropTypes.string,
|
|
1624
|
-
fullWidth: PropTypes.bool,
|
|
1625
|
-
hint: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
|
|
1626
|
-
label: PropTypes.oneOfType([PropTypes.string, PropTypes.object]).isRequired,
|
|
1627
|
-
id: PropTypes.string.isRequired,
|
|
1628
|
-
name: PropTypes.string.isRequired,
|
|
1629
|
-
onChange: PropTypes.func,
|
|
1630
|
-
value: PropTypes.string.isRequired
|
|
1631
|
-
};
|
|
1632
|
-
|
|
1633
|
-
var css_248z$4 = ":root, :host {\n --rpf-brand-black: hsla(60, 4%, 11%, 1);\n --rpf-brand-leaf: hsla(123, 43%, 48%, 1);\n --rpf-brand-raspberry: hsla(342, 71%, 47%, 1);\n --rpf-raspberry-50: hsla(338, 57%, 97%, 1);\n --rpf-raspberry-100: hsla(342, 62%, 96%, 1);\n --rpf-raspberry-200: hsla(344, 73%, 93%, 1);\n --rpf-raspberry-400: hsla(341, 63%, 84%, 1);\n --rpf-raspberry-500: hsla(343, 62%, 68%, 1);\n --rpf-raspberry-600: hsla(343, 64%, 58%, 1);\n --rpf-raspberry-800: hsla(342, 71%, 47%, 1);\n --rpf-raspberry-900: hsla(340, 78%, 36%, 1);\n}\n\n:root, :host {\n --rpf-red-100: hsla(4, 89%, 96%, 1);\n --rpf-red-200: hsla(1, 87%, 91%, 1);\n --rpf-red-400: hsla(1, 87%, 82%, 1);\n --rpf-red-600: hsla(1, 87%, 72%, 1);\n --rpf-red-800: hsla(1, 87%, 63%, 1);\n --rpf-red-900: hsla(1, 52%, 50%, 1);\n --rpf-green-100: hsla(125, 41%, 95%, 1);\n --rpf-green-200: hsla(122, 39%, 87%, 1);\n --rpf-green-400: hsla(123, 40%, 74%, 1);\n --rpf-green-600: hsla(123, 40%, 61%, 1);\n --rpf-green-800: hsla(123, 43%, 48%, 1);\n --rpf-green-900: hsla(123, 43%, 34%, 1);\n --rpf-teal-100: hsla(176, 55%, 94%, 1);\n --rpf-teal-200: hsla(174, 55%, 85%, 1);\n --rpf-teal-400: hsla(174, 55%, 70%, 1);\n --rpf-teal-600: hsla(174, 56%, 56%, 1);\n --rpf-teal-800: hsla(174, 81%, 41%, 1);\n --rpf-teal-900: hsla(174, 81%, 27%, 1);\n --rpf-teal-950: hsla(174, 80%, 20%, 1);\n --rpf-orange-100: hsla(31, 100%, 95%, 1);\n --rpf-orange-200: hsla(32, 100%, 88%, 1);\n --rpf-orange-400: hsla(31, 100%, 77%, 1);\n --rpf-orange-600: hsla(31, 99%, 65%, 1);\n --rpf-orange-800: hsla(31, 99%, 54%, 1);\n --rpf-orange-900: hsla(31, 85%, 35%, 1);\n --rpf-yellow-100: hsla(51, 100%, 95%, 1);\n --rpf-yellow-200: hsla(52, 100%, 87%, 1);\n --rpf-yellow-400: hsla(51, 100%, 75%, 1);\n --rpf-yellow-600: hsla(52, 100%, 63%, 1);\n --rpf-yellow-800: hsla(52, 100%, 50%, 1);\n --rpf-yellow-900: hsla(52, 100%, 26%, 1);\n --rpf-purple-100: hsla(282, 36%, 95%, 1);\n --rpf-purple-200: hsla(279, 38%, 87%, 1);\n --rpf-purple-400: hsla(279, 38%, 73%, 1);\n --rpf-purple-600: hsla(279, 37%, 60%, 1);\n --rpf-purple-800: hsla(279, 43%, 47%, 1);\n --rpf-purple-900: hsla(280, 43%, 37%, 1);\n --rpf-navy-100: hsla(235, 38%, 94%, 1);\n --rpf-navy-200: hsla(234, 38%, 84%, 1);\n --rpf-navy-400: hsla(235, 38%, 69%, 1);\n --rpf-navy-600: hsla(235, 38%, 53%, 1);\n --rpf-navy-800: hsla(235, 63%, 37%, 1);\n --rpf-navy-900: hsla(234, 63%, 30%, 1);\n --rpf-blue-100: hsla(203, 86%, 95%, 1);\n --rpf-blue-200: hsla(204, 88%, 87%, 1);\n --rpf-blue-400: hsla(204, 88%, 74%, 1);\n --rpf-blue-600: hsla(204, 89%, 60%, 1);\n --rpf-blue-800: hsla(204, 100%, 47%, 1);\n --rpf-blue-900: hsla(204, 99%, 37%, 1);\n}\n\n:root, :host {\n --rpf-white: hsla(0, 0%, 100%, 1);\n --rpf-off-white: hsla(225, 25%, 97%, 1);\n --rpf-grey-50: hsla(210, 8%, 95%, 1);\n --rpf-grey-100: hsla(228, 10%, 90%, 1);\n --rpf-grey-150: hsla(223, 9%, 85%, 1);\n --rpf-grey-200: hsla(228, 10%, 80%, 1);\n --rpf-grey-300: hsla(229, 9%, 75%, 1);\n --rpf-grey-400: hsla(229, 8%, 61%, 1);\n --rpf-grey-500: hsla(229, 9%, 42%, 1);\n --rpf-grey-600: hsla(228, 9%, 32%, 1);\n --rpf-grey-700: hsla(228, 9%, 22%, 1);\n --rpf-grey-800: hsla(232, 9%, 18%, 1);\n --rpf-grey-850: hsla(228, 9%, 15%, 1);\n --rpf-grey-900: hsla(228, 9%, 10%, 1);\n --rpf-grey-950: hsla(228, 8%, 5%, 1);\n --rpf-black: hsla(0, 0%, 0%, 1);\n}\n\n:root, :host {\n --rpf-alert-error-highlight: hsla(0, 88%, 99%, 1);\n --rpf-alert-error: hsla(0, 88%, 33%, 1);\n --rpf-alert-information-highlight: hsla(225, 64%, 99%, 1);\n --rpf-alert-information: hsla(225, 64%, 33%, 1);\n --rpf-alert-success-highlight: hsla(136, 90%, 99%, 1);\n --rpf-alert-success: hsla(136, 90%, 20%, 1);\n --rpf-alert-warning-highlight: hsla(26, 70%, 99%, 1);\n --rpf-alert-warning: hsla(26, 70%, 29%, 1);\n}\n\n:root, :host {\n --font-size-0-5: 0.5rem;\n --font-size-0-75: 0.75rem;\n --font-size-1: 1rem;\n --font-size-1-5: 1.25rem;\n --font-size-2: 1.5rem;\n --font-size-3: 2rem;\n --font-size-4: 2.5rem;\n --font-size-5: 3rem;\n --font-size-6: 3.5rem;\n --font-size-7: 4rem;\n --font-size-8: 4.5rem;\n --font-size-9: 5rem;\n}\n\n:root, :host {\n --font-weight-regular: 400;\n --font-weight-bold: 700;\n}\n\n:root, :host {\n --border-radius: var(--space-1);\n --border-radius-sm: var(--space-0-5);\n --border-width-sm: 1px;\n --border-width-md: 2px;\n --border-width-lg: 3px;\n --alert-border-width: var(--border-width-md);\n --fieldset-border-width: var(--border-width-md);\n --input-border-width: var(--border-width-md);\n --table-border-width: var(--border-width-sm);\n}\n\n:root, :host {\n --space-0-125: 0.0625rem;\n --space-0-25: 0.125rem;\n --space-0-5: 0.25rem;\n --space-1: 0.5rem;\n --space-1-5: 0.75rem;\n --space-2: 1rem;\n --space-3: 1.5rem;\n --space-4: 2rem;\n --space-5: 2.5rem;\n --space-6: 3rem;\n --space-7: 3.5rem;\n --space-8: 4rem;\n --space-9: 4.5rem;\n --space-10: 5rem;\n}\n\n:root, :host {\n /* 44px min-height to meet WCAG AAA target size requirements */\n --min-target-size: 44px;\n --sm-target-size: 32px;\n --lg-target-size: 48px;\n}\n\n.rpf-button {\n --rpf-button-background-color: var(--rpf-navy-800);\n --rpf-button-background-color-hover: var(--rpf-navy-900);\n --rpf-button-background-color-active: var(--rpf-navy-600);\n --rpf-button-background-color-disabled: var(--rpf-grey-600);\n --rpf-button-text-color: var(--rpf-white);\n --rpf-button-border-color: var(--rpf-button-background-color);\n --rpf-button-border-color-hover: var(--rpf-button-background-color-hover);\n --rpf-button-border-color-active: var(--rpf-button-background-color-active);\n --rpf-button-border-color-disabled: var(--rpf-button-background-color-disabled);\n --rpf-button-danger-background-color: var(--rpf-alert-error);\n --rpf-button-danger-background-color-hover: var(--rpf-alert-error);\n --rpf-button-danger-background-color-active: var(--rpf-red-900);\n --rpf-button-danger-background-color-disabled: var(--rpf-grey-600);\n --rpf-button-danger-text-color: var(--rpf-white);\n --rpf-button-danger-border-color: var(--rpf-button-danger-background-color);\n --rpf-button-danger-border-color-hover: var(--rpf-button-danger-background-color-hover);\n --rpf-button-danger-border-color-active: var(--rpf-button-danger-background-color-active);\n --rpf-button-danger-border-color-disabled: var(--rpf-button-danger-background-color-disabled);\n --rpf-button-border-radius: var(--border-radius);\n --rpf-button-border-width: var(--border-width-md);\n --rpf-button-lg-height: var(--lg-target-size);\n --rpf-button-sm-height: var(--sm-target-size);\n --rpf-button-min-target-size: var(--min-target-size);\n all: unset;\n align-items: center;\n box-sizing: border-box;\n color: var(--rpf-button-text-color);\n /*\n * We've decided to follow the masses on this and have a pointer on buttons.\n * Google, Facebook, Twitter, Mozilla, and Microsoft amongst many others have a pointer on buttons.\n */\n cursor: pointer;\n display: flex;\n font-size: var(--font-size-1-5);\n font-weight: var(--font-weight-bold);\n gap: var(--space-1);\n min-block-size: var(--rpf-button-lg-height);\n padding: var(--space-1) var(--space-2);\n position: relative;\n text-align: center;\n text-decoration: none;\n /* Fixes a rendering error that sometimes occurs due to negative z-index */\n transform: scale(1);\n inline-size: fit-content;\n /* A bit of a hack to allow for separate visual and target heights */\n}\n.rpf-button::before {\n background-color: var(--rpf-button-background-color);\n border-color: var(--rpf-button-border-color);\n border-radius: var(--rpf-button-border-radius);\n border-style: solid;\n border-width: var(--rpf-button-border-width);\n content: \"\";\n display: block;\n inset: 0;\n position: absolute;\n /* To ensure it renders under its siblings */\n z-index: -1;\n}\n.rpf-button:hover::before {\n background-color: var(--rpf-button-background-color-hover);\n border-color: var(--rpf-button-border-color-hover);\n}\n.rpf-button:active::before {\n background-color: var(--rpf-button-background-color-active);\n border-color: var(--rpf-button-border-color-active);\n}\n.rpf-button:focus-visible::before {\n outline: var(--border-width-md) solid var(--rpf-button-background-color);\n outline-offset: 3px;\n}\n.rpf-button:disabled, .rpf-button--disabled {\n cursor: default;\n}\n.rpf-button:disabled::before, .rpf-button:disabled:hover::before, .rpf-button--disabled::before, .rpf-button--disabled:hover::before {\n border-color: var(--rpf-button-border-color-disabled);\n background-color: var(--rpf-button-background-color-disabled);\n}\n.rpf-button--secondary {\n color: var(--rpf-button-background-color);\n}\n.rpf-button--secondary::before {\n background-color: var(--rpf-button-text-color);\n}\n.rpf-button--secondary:hover {\n color: var(--rpf-button-background-color-hover);\n}\n.rpf-button--secondary:hover::before {\n background-color: var(--rpf-button-text-color);\n border-color: var(--rpf-button-border-color-hover);\n}\n.rpf-button--secondary:active {\n color: var(--rpf-button-background-color-active);\n}\n.rpf-button--secondary:active::before {\n background-color: var(--rpf-button-text-color);\n border-color: var(--rpf-button-border-color-active);\n}\n.rpf-button--secondary:disabled, .rpf-button--secondary.rpf-button--disabled {\n color: var(--rpf-button-background-color-disabled);\n}\n.rpf-button--secondary:disabled:hover::before, .rpf-button--secondary:disabled:before, .rpf-button--secondary.rpf-button--disabled:hover::before, .rpf-button--secondary.rpf-button--disabled:before {\n background-color: var(--rpf-button-text-color);\n border-color: var(--rpf-button-border-color-disabled);\n}\n.rpf-button--secondary.rpf-button--danger {\n color: var(--rpf-button-danger-background-color);\n}\n.rpf-button--secondary.rpf-button--danger::before {\n background-color: var(--rpf-button-danger-text-color);\n}\n.rpf-button--secondary.rpf-button--danger:hover {\n color: var(--rpf-button-danger-background-color-hover);\n}\n.rpf-button--secondary.rpf-button--danger:hover::before {\n background-color: var(--rpf-button-danger-text-color);\n border-color: var(--rpf-button-danger-border-color-hover);\n}\n.rpf-button--secondary.rpf-button--danger:active {\n color: var(--rpf-button-danger-background-color-active);\n}\n.rpf-button--secondary.rpf-button--danger:active::before {\n background-color: var(--rpf-button-danger-text-color);\n border-color: var(--rpf-button-danger-border-color-active);\n}\n.rpf-button--secondary.rpf-button--danger:disabled, .rpf-button--secondary.rpf-button--danger.rpf-button--disabled {\n color: var(--rpf-button-danger-background-color-disabled);\n}\n.rpf-button--secondary.rpf-button--danger:disabled:hover::before, .rpf-button--secondary.rpf-button--danger:disabled:before, .rpf-button--secondary.rpf-button--danger.rpf-button--disabled:hover::before, .rpf-button--secondary.rpf-button--danger.rpf-button--disabled:before {\n background-color: var(--rpf-button-danger-text-color);\n border-color: var(--rpf-button-danger-border-color-disabled);\n}\n.rpf-button--tertiary {\n color: var(--rpf-button-background-color);\n}\n.rpf-button--tertiary::before {\n background-color: transparent;\n border-color: transparent;\n}\n.rpf-button--tertiary:hover {\n color: var(--rpf-button-background-color-hover);\n}\n.rpf-button--tertiary:hover::before {\n background-color: transparent;\n border-color: transparent;\n}\n.rpf-button--tertiary:active {\n color: var(--rpf-button-background-color-active);\n}\n.rpf-button--tertiary:active::before {\n background-color: transparent;\n}\n.rpf-button--tertiary:disabled, .rpf-button--tertiary.rpf-button--disabled {\n color: var(--rpf-button-background-color-disabled);\n}\n.rpf-button--tertiary:disabled::before, .rpf-button--tertiary:disabled:hover::before, .rpf-button--tertiary.rpf-button--disabled::before, .rpf-button--tertiary.rpf-button--disabled:hover::before {\n background-color: transparent;\n border-color: transparent;\n}\n.rpf-button--tertiary.rpf-button--danger {\n color: var(--rpf-button-danger-background-color);\n}\n.rpf-button--tertiary.rpf-button--danger::before {\n background-color: transparent;\n border-color: transparent;\n}\n.rpf-button--tertiary.rpf-button--danger:hover {\n color: var(--rpf-button-danger-background-color-hover);\n}\n.rpf-button--tertiary.rpf-button--danger:hover::before {\n background-color: transparent;\n border-color: transparent;\n}\n.rpf-button--tertiary.rpf-button--danger:active {\n color: var(--rpf-button-danger-background-color-active);\n}\n.rpf-button--tertiary.rpf-button--danger:active::before {\n background-color: transparent;\n}\n.rpf-button--tertiary.rpf-button--danger:disabled, .rpf-button--tertiary.rpf-button--danger.rpf-button--disabled {\n color: var(--rpf-button-danger-background-color-disabled);\n}\n.rpf-button--tertiary.rpf-button--danger:disabled::before, .rpf-button--tertiary.rpf-button--danger:disabled:hover::before, .rpf-button--tertiary.rpf-button--danger.rpf-button--disabled::before, .rpf-button--tertiary.rpf-button--danger.rpf-button--disabled:hover::before {\n background-color: transparent;\n border-color: transparent;\n}\n.rpf-button--danger {\n color: var(--rpf-button-danger-text-color);\n}\n.rpf-button--danger::before {\n background-color: var(--rpf-button-danger-background-color);\n border-color: var(--rpf-button-danger-border-color);\n}\n.rpf-button--danger:hover::before {\n background-color: var(--rpf-button-danger-background-color-hover);\n border-color: var(--rpf-button-danger-border-color-hover);\n}\n.rpf-button--danger:active::before {\n background-color: var(--rpf-button-danger-background-color-active);\n border-color: var(--rpf-button-danger-border-color-active);\n}\n.rpf-button--danger:focus-visible::before {\n outline: var(--border-width-md) solid var(--rpf-button-danger-background-color);\n}\n.rpf-button--icon-only {\n block-size: var(--rpf-button-lg-height);\n line-height: var(--rpf-button-lg-height);\n padding: 0;\n text-align: center;\n inline-size: var(--rpf-button-lg-height);\n}\n.rpf-button--icon-only .rpf-button__icon {\n margin: 0 auto;\n}\n.rpf-button--sm {\n font-size: var(--font-size-1);\n min-block-size: var(--rpf-button-min-target-size);\n padding: var(--space-1) var(--space-1);\n /* To account for 32px visual height and 44px target height */\n}\n.rpf-button--sm::before {\n inset: calc((var(--rpf-button-min-target-size) - var(--rpf-button-sm-height)) / 2) 0;\n}\n.rpf-button--sm.rpf-button--icon-only {\n block-size: var(--rpf-button-min-target-size);\n line-height: var(--rpf-button-min-target-size);\n padding: 0;\n inline-size: var(--rpf-button-min-target-size);\n}\n.rpf-button--sm.rpf-button--icon-only::before {\n inset: calc((var(--rpf-button-min-target-size) - var(--rpf-button-sm-height)) / 2);\n}\n.rpf-button--sm .material-symbols-sharp {\n font-size: 20px;\n font-variation-settings: \"OPSZ\" 20;\n}\n.rpf-button--full-width {\n justify-content: center;\n inline-size: 100%;\n}\n\n:root, :host {\n --rpf-text-primary: hsla(0, 0%, 13%, 1);\n --rpf-text-primary-darkmode: var(--rpf-white);\n --rpf-text-secondary: hsla(200, 9%, 33%, 1);\n --rpf-text-secondary-darkmode: hsla(0, 0%, 80%, 1);\n --rpf-link-text: var(--rpf-navy-800);\n}\n\n:root, :host {\n --rpf-input-background-color: var(--rpf-white);\n --rpf-input-background-color-disabled: var(--rpf-grey-50);\n --rpf-input-background-color-readonly: var(--rpf-grey-50);\n --rpf-input-color-error: var(--rpf-alert-error);\n --rpf-input-color: var(--rpf-text-primary);\n --rpf-input-outline-color: var(--rpf-blue-800);\n}\n\n.rpf-input-search-container {\n display: flex;\n max-width: 50ch;\n min-width: 240px;\n width: 100%;\n}\n.rpf-input-search-container input[type=search]::-webkit-search-decoration,\n.rpf-input-search-container input[type=search]::-webkit-search-cancel-button {\n appearance: none;\n}\n.rpf-input-search-container .rpf-input-search {\n border-end-end-radius: 0;\n border-inline-end: 0;\n border-start-end-radius: 0;\n}\n.rpf-input-search-container .rpf-button {\n flex-shrink: 0;\n border-radius: 0 var(--border-radius) var(--border-radius) 0;\n box-sizing: border-box;\n justify-content: center;\n max-width: var(--space-6);\n}\n.rpf-input-search-container .rpf-button::before {\n border: var(--input-border-width) solid var(--rpf-input-color);\n border-radius: 0 var(--border-radius) var(--border-radius) 0;\n}\n.rpf-input-search-container .rpf-button:disabled .rpf-button__icon, .rpf-input-search-container .rpf-button--disabled .rpf-button__icon {\n color: var(--rpf-input-color);\n}\n.rpf-input-search-container .rpf-button:disabled::before, .rpf-input-search-container .rpf-button--disabled::before {\n background-color: var(--rpf-input-background-color-disabled);\n border-color: var(--rpf-input-background-color-disabled);\n}\n.rpf-input-search-container .rpf-button--error::before {\n border-color: var(--rpf-alert-error);\n}\n.rpf-input-search-container .rpf-input-search:focus-visible,\n.rpf-input-search-container .rpf-button:focus-visible {\n outline: 3px solid var(--rpf-input-outline-color);\n z-index: 1;\n}\n.rpf-input-search-container .rpf-input-search:focus-visible::before,\n.rpf-input-search-container .rpf-button:focus-visible::before {\n outline: 0;\n}\n";
|
|
1634
|
-
styleInject(css_248z$4);
|
|
1635
|
-
|
|
1636
|
-
const SearchInput = ({
|
|
1637
|
-
label,
|
|
1638
|
-
inputFieldId,
|
|
1639
|
-
disabled = false,
|
|
1640
|
-
error = "",
|
|
1641
|
-
hint = "",
|
|
1642
|
-
placeholder = "",
|
|
1643
|
-
defaultValue = "",
|
|
1644
|
-
onClick = () => {},
|
|
1645
|
-
onChange = event => {}
|
|
1646
|
-
}) => /*#__PURE__*/React.createElement("div", {
|
|
1647
|
-
className: "rpf-input-field"
|
|
1648
|
-
}, /*#__PURE__*/React.createElement("label", {
|
|
1649
|
-
htmlFor: inputFieldId,
|
|
1650
|
-
className: classNames("rpf-label", {
|
|
1651
|
-
"rpf-label--disabled": disabled
|
|
1652
|
-
})
|
|
1653
|
-
}, label, hint && /*#__PURE__*/React.createElement("small", {
|
|
1654
|
-
className: "rpf-label__hint"
|
|
1655
|
-
}, hint)), /*#__PURE__*/React.createElement("div", {
|
|
1656
|
-
className: "rpf-input-search-container"
|
|
1657
|
-
}, /*#__PURE__*/React.createElement("input", {
|
|
1658
|
-
className: classNames("rpf-input rpf-input-search", {
|
|
1659
|
-
"rpf-input--disabled": disabled,
|
|
1660
|
-
"rpf-input--error": error
|
|
1661
|
-
}),
|
|
1662
|
-
disabled: disabled,
|
|
1663
|
-
id: inputFieldId,
|
|
1664
|
-
name: "search",
|
|
1665
|
-
type: "search",
|
|
1666
|
-
"area-label": "Search",
|
|
1667
|
-
defaultValue: defaultValue,
|
|
1668
|
-
placeholder: placeholder,
|
|
1669
|
-
onChange: onChange
|
|
1670
|
-
}), /*#__PURE__*/React.createElement("button", {
|
|
1671
|
-
type: "button",
|
|
1672
|
-
className: classNames("rpf-button rpf-button-search", {
|
|
1673
|
-
"rpf-button--disabled": disabled,
|
|
1674
|
-
"rpf-button--error": error
|
|
1675
|
-
}),
|
|
1676
|
-
disabled: disabled,
|
|
1677
|
-
onClick: onClick
|
|
1678
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
1679
|
-
className: "rpf-button__icon material-symbols-sharp"
|
|
1680
|
-
}, "search"))), error && /*#__PURE__*/React.createElement("div", {
|
|
1681
|
-
className: "rpf-error-message"
|
|
1682
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
1683
|
-
className: "rpf-error-message__icon material-symbols-sharp"
|
|
1684
|
-
}, "info"), error));
|
|
1685
|
-
SearchInput.propTypes = {
|
|
1686
|
-
disabled: PropTypes.bool,
|
|
1687
|
-
error: PropTypes.string,
|
|
1688
|
-
hint: PropTypes.string,
|
|
1689
|
-
inputFieldId: PropTypes.string.isRequired,
|
|
1690
|
-
label: PropTypes.string.isRequired,
|
|
1691
|
-
onClick: PropTypes.func,
|
|
1692
|
-
onChange: PropTypes.func,
|
|
1693
|
-
placeholder: PropTypes.string,
|
|
1694
|
-
defaultValue: PropTypes.string
|
|
1695
|
-
};
|
|
1696
|
-
|
|
1697
|
-
var css_248z$3 = ".rpf-table {\n border: 1px solid var(--rpf-grey-100);\n border-radius: var(--border-radius);\n overflow: auto;\n top: 0;\n width: fit-content;\n}\n.rpf-table--full-width {\n width: 100%;\n}\n.rpf-table__table {\n border-collapse: collapse;\n width: max-content;\n}\n.rpf-table__table--full-width {\n width: 100%;\n}\n.rpf-table__table thead th,\n.rpf-table__table thead td {\n position: sticky;\n top: 0;\n z-index: 1;\n}\n";
|
|
1698
|
-
styleInject(css_248z$3);
|
|
1699
|
-
|
|
1700
|
-
const Table = ({
|
|
1701
|
-
headerRow,
|
|
1702
|
-
bodyRows,
|
|
1703
|
-
fullWidth
|
|
1704
|
-
}) => /*#__PURE__*/React.createElement("div", {
|
|
1705
|
-
"data-testid": "table-container",
|
|
1706
|
-
className: classNames("rpf-table", {
|
|
1707
|
-
"rpf-table--full-width": fullWidth
|
|
1708
|
-
})
|
|
1709
|
-
}, /*#__PURE__*/React.createElement("table", {
|
|
1710
|
-
className: classNames("rpf-table__table", {
|
|
1711
|
-
"rpf-table__table--full-width": fullWidth
|
|
1712
|
-
})
|
|
1713
|
-
}, /*#__PURE__*/React.createElement("thead", null, /*#__PURE__*/React.createElement("tr", {
|
|
1714
|
-
className: "rpf-table-row"
|
|
1715
|
-
}, headerRow)), /*#__PURE__*/React.createElement("tbody", null, bodyRows.map((bodyRow, index) => /*#__PURE__*/React.createElement("tr", {
|
|
1716
|
-
className: "rpf-table-row",
|
|
1717
|
-
key: index
|
|
1718
|
-
}, bodyRow)))));
|
|
1719
|
-
PropTypes.Table = {
|
|
1720
|
-
headerRow: PropTypes.node.isRequired,
|
|
1721
|
-
bodyRows: PropTypes.arrayOf(PropTypes.node).isRequired,
|
|
1722
|
-
children: PropTypes.node.isRequired,
|
|
1723
|
-
fullWidth: PropTypes.bool
|
|
1724
|
-
};
|
|
1725
|
-
|
|
1726
|
-
var css_248z$2 = ".rpf-table-cell {\n border-bottom: var(--table-border-width) solid var(--rpf-grey-100);\n}\n.rpf-table-cell > * {\n align-items: center;\n box-sizing: border-box;\n display: flex;\n gap: var(--space-1);\n line-height: var(--line-height-1-5);\n padding-block: var(--space-1);\n padding-inline: var(--space-2);\n}\n.rpf-table-cell--header, .rpf-table-cell--sortable-header {\n background-color: var(--rpf-grey-50);\n}\n.rpf-table-cell--header > *, .rpf-table-cell--sortable-header > * {\n min-height: var(--space-7);\n min-width: var(--space-7);\n}\n.rpf-table-cell--sortable-header .rpf-table-cell__sort-header {\n display: flex;\n width: 100%;\n gap: var(--space-1);\n min-height: var(--min-target-size);\n align-items: center;\n border-radius: var(--border-radius);\n}\n.rpf-table-cell--sortable-header .rpf-table-cell__sort-header:focus-visible {\n outline: 2px solid var(--rpf-raspberry-800);\n outline-offset: 3px;\n}\n.rpf-table-cell--sortable-header button {\n all: unset;\n cursor: pointer;\n}\n.rpf-table-cell--sortable-header a {\n color: inherit;\n text-decoration: none;\n}\n.rpf-table-cell--body {\n background-color: var(--rpf-white);\n}\n.rpf-table-cell--body .rpf-table-cell__content {\n min-height: var(--space-8);\n min-width: var(--space-8);\n}\n.rpf-table-cell--body .rpf-table-cell__content > * {\n margin-block: auto;\n}\n.rpf-table-cell--body .rpf-table-cell__content a {\n color: var(--rpf-brand-500);\n font-weight: var(--font-weight-bold);\n}\n.rpf-table-cell--body .rpf-table-cell__content:has(> .rpf-button) {\n justify-content: end;\n padding: var(--space-1);\n}\n.rpf-table-cell--body .rpf-table-cell__content--truncated {\n display: inline-block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n";
|
|
1727
|
-
styleInject(css_248z$2);
|
|
1728
|
-
|
|
1729
|
-
const BodyCell = ({
|
|
1730
|
-
children
|
|
1731
|
-
}) => /*#__PURE__*/React.createElement("td", {
|
|
1732
|
-
className: "rpf-table-cell rpf-table-cell--body"
|
|
1733
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
1734
|
-
className: "rpf-table-cell__content"
|
|
1735
|
-
}, children));
|
|
1736
|
-
|
|
1737
|
-
var css_248z$1 = ".rpf-table-cell {\n border-bottom: var(--table-border-width) solid var(--rpf-grey-100);\n}\n.rpf-table-cell > * {\n align-items: center;\n box-sizing: border-box;\n display: flex;\n gap: var(--space-1);\n line-height: var(--line-height-1-5);\n padding-block: var(--space-1);\n padding-inline: var(--space-2);\n}\n.rpf-table-cell--header, .rpf-table-cell--sortable-header {\n background-color: var(--rpf-grey-50);\n}\n.rpf-table-cell--header > *, .rpf-table-cell--sortable-header > * {\n min-height: var(--space-7);\n min-width: var(--space-7);\n}\n.rpf-table-cell--sortable-header .rpf-table-cell__sort-header {\n display: flex;\n width: 100%;\n gap: var(--space-1);\n min-height: var(--min-target-size);\n align-items: center;\n border-radius: var(--border-radius);\n}\n.rpf-table-cell--sortable-header .rpf-table-cell__sort-header:focus-visible {\n outline: 2px solid var(--rpf-raspberry-800);\n outline-offset: 3px;\n}\n.rpf-table-cell--sortable-header button {\n all: unset;\n cursor: pointer;\n}\n.rpf-table-cell--sortable-header a {\n color: inherit;\n text-decoration: none;\n}\n.rpf-table-cell--body {\n background-color: var(--rpf-white);\n}\n.rpf-table-cell--body .rpf-table-cell__content {\n min-height: var(--space-8);\n min-width: var(--space-8);\n}\n.rpf-table-cell--body .rpf-table-cell__content > * {\n margin-block: auto;\n}\n.rpf-table-cell--body .rpf-table-cell__content a {\n color: var(--rpf-brand-500);\n font-weight: var(--font-weight-bold);\n}\n.rpf-table-cell--body .rpf-table-cell__content:has(> .rpf-button) {\n justify-content: end;\n padding: var(--space-1);\n}\n.rpf-table-cell--body .rpf-table-cell__content--truncated {\n display: inline-block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n";
|
|
1738
|
-
styleInject(css_248z$1);
|
|
1739
|
-
|
|
1740
|
-
const HeaderCell = ({
|
|
1741
|
-
sortDirection,
|
|
1742
|
-
children
|
|
1743
|
-
}) => {
|
|
1744
|
-
if (sortDirection !== undefined) {
|
|
1745
|
-
const symbol = sortDirection === "up" ? "arrow_drop_up" : "arrow_drop_down";
|
|
1746
|
-
children = /*#__PURE__*/React.createElement("div", {
|
|
1747
|
-
class: "rpf-table-cell__sort-header"
|
|
1748
|
-
}, children, /*#__PURE__*/React.createElement("span", {
|
|
1749
|
-
class: "material-symbols-sharp"
|
|
1750
|
-
}, symbol));
|
|
1751
|
-
}
|
|
1752
|
-
const headerClass = sortDirection !== undefined ? "rpf-table-cell--sortable-header" : "rpf-table-cell--header";
|
|
1753
|
-
return /*#__PURE__*/React.createElement("th", {
|
|
1754
|
-
className: `rpf-table-cell ${headerClass}`
|
|
1755
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
1756
|
-
className: "rpf-table-cell__content"
|
|
1757
|
-
}, children));
|
|
1758
|
-
};
|
|
1759
|
-
PropTypes.HeaderCell = {
|
|
1760
|
-
sortDirection: PropTypes.oneOf(["up", "down"]),
|
|
1761
|
-
children: PropTypes.node
|
|
1762
|
-
};
|
|
1763
|
-
|
|
1764
|
-
var css_248z = ":root, :host {\n --font-weight-regular: 400;\n --font-weight-bold: 700;\n}\n\n:root, :host {\n --space-0-125: 0.0625rem;\n --space-0-25: 0.125rem;\n --space-0-5: 0.25rem;\n --space-1: 0.5rem;\n --space-1-5: 0.75rem;\n --space-2: 1rem;\n --space-3: 1.5rem;\n --space-4: 2rem;\n --space-5: 2.5rem;\n --space-6: 3rem;\n --space-7: 3.5rem;\n --space-8: 4rem;\n --space-9: 4.5rem;\n --space-10: 5rem;\n}\n\n.rpf-tag {\n --tag-color: var(--rpf-text-primary);\n --tag-color-secondary: color-mix(in srgb, var(--tag-color), white 95%);\n --tag-text-color: var(--rpf-white);\n --tag-text-color-secondary: var(--tag-color);\n align-items: center;\n border: solid 1px var(--tag-color);\n background-color: var(--tag-color);\n border-radius: 2rem;\n color: var(--tag-text-color);\n display: flex;\n font-weight: var(--font-weight-bold);\n gap: var(--space-0-5);\n line-height: 1.5rem;\n padding: var(--space-0-5) var(--space-1);\n inline-size: max-content;\n}\n.rpf-tag--information {\n background-color: var(--rpf-alert-information);\n border-color: var(--rpf-alert-information);\n}\n.rpf-tag--success {\n background-color: var(--rpf-alert-success);\n border-color: var(--rpf-alert-success);\n}\n.rpf-tag--warning {\n background-color: var(--rpf-alert-warning);\n border-color: var(--rpf-alert-warning);\n}\n.rpf-tag--error {\n background-color: var(--rpf-alert-error);\n border-color: var(--rpf-alert-error);\n}\n.rpf-tag--secondary {\n background-color: var(--tag-color-secondary);\n color: var(--tag-text-color-secondary);\n}\n.rpf-tag--secondary.rpf-tag--information {\n border-color: var(--rpf-alert-information);\n color: var(--rpf-alert-information);\n}\n.rpf-tag--secondary.rpf-tag--success {\n border-color: var(--rpf-alert-success);\n color: var(--rpf-alert-success);\n}\n.rpf-tag--secondary.rpf-tag--warning {\n border-color: var(--rpf-alert-warning);\n color: var(--rpf-alert-warning);\n}\n.rpf-tag--secondary.rpf-tag--error {\n border-color: var(--rpf-alert-error);\n color: var(--rpf-alert-error);\n}\n";
|
|
1765
|
-
styleInject(css_248z);
|
|
1766
|
-
|
|
1767
|
-
const Tag = ({
|
|
1768
|
-
text,
|
|
1769
|
-
variant,
|
|
1770
|
-
secondary,
|
|
1771
|
-
icon,
|
|
1772
|
-
iconPosition
|
|
1773
|
-
}) => {
|
|
1774
|
-
if (icon) {
|
|
1775
|
-
icon = /*#__PURE__*/React.createElement("span", {
|
|
1776
|
-
className: "rpf-tag__icon material-symbols-sharp"
|
|
1777
|
-
}, icon);
|
|
1778
|
-
}
|
|
1779
|
-
if (icon && !iconPosition) {
|
|
1780
|
-
// default to left if icon is present and no position is specified
|
|
1781
|
-
iconPosition = "left";
|
|
1782
|
-
}
|
|
1783
|
-
if (variant && variant !== "default") {
|
|
1784
|
-
variant = `rpf-tag--${variant}`;
|
|
1785
|
-
} else {
|
|
1786
|
-
// no class for default variant
|
|
1787
|
-
variant = null;
|
|
1788
|
-
}
|
|
1789
|
-
return /*#__PURE__*/React.createElement("span", {
|
|
1790
|
-
className: classNames("rpf-tag", variant, {
|
|
1791
|
-
"rpf-tag--secondary": secondary
|
|
1792
|
-
})
|
|
1793
|
-
}, iconPosition === "left" && icon, text, iconPosition === "right" && icon);
|
|
1794
|
-
};
|
|
1795
|
-
Tag.propTypes = {
|
|
1796
|
-
text: PropTypes.string.isRequired,
|
|
1797
|
-
variant: PropTypes.oneOf(["default", "information", "success", "warning", "error"]),
|
|
1798
|
-
secondary: PropTypes.bool,
|
|
1799
|
-
icon: PropTypes.string,
|
|
1800
|
-
iconPosition: PropTypes.oneOf(["left", "right"])
|
|
1801
|
-
};
|
|
1802
|
-
|
|
1803
|
-
export { Accordion, Alert, Button, CheckboxInput, Fieldset, InputField, InputLabel, ProgressBar, RadioInput, SearchInput, SelectInput, Table, BodyCell as TableBodyCell, HeaderCell as TableHeaderCell, Tag, TextInput, TextareaInput };
|