@raspberrypifoundation/design-system-react 1.1.9 → 1.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/bundle.js +38 -1391
- package/dist/esm/bundle.js +74 -1409
- package/package.json +1 -1
package/dist/esm/bundle.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import 'react-dom';
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Link } from 'react-router-dom';
|
|
4
3
|
|
|
5
4
|
function getDefaultExportFromCjs (x) {
|
|
6
5
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
@@ -1149,15 +1148,15 @@ const Accordion = ({
|
|
|
1149
1148
|
id
|
|
1150
1149
|
}) => {
|
|
1151
1150
|
const classes = classNames("rpf-accordion", className);
|
|
1152
|
-
return /*#__PURE__*/
|
|
1151
|
+
return /*#__PURE__*/React.createElement("details", {
|
|
1153
1152
|
className: classes,
|
|
1154
1153
|
id: `${id}`
|
|
1155
|
-
}, /*#__PURE__*/
|
|
1154
|
+
}, /*#__PURE__*/React.createElement("summary", {
|
|
1156
1155
|
className: "rpf-accordion__title",
|
|
1157
1156
|
role: "button"
|
|
1158
|
-
}, title, /*#__PURE__*/
|
|
1157
|
+
}, title, /*#__PURE__*/React.createElement("span", {
|
|
1159
1158
|
className: "rpf-accordion__icon"
|
|
1160
|
-
})), /*#__PURE__*/
|
|
1159
|
+
})), /*#__PURE__*/React.createElement("p", {
|
|
1161
1160
|
className: "rpf-accordion__text"
|
|
1162
1161
|
}, content));
|
|
1163
1162
|
};
|
|
@@ -1171,1316 +1170,25 @@ Accordion.defaultProps = {
|
|
|
1171
1170
|
id: "accordion"
|
|
1172
1171
|
};
|
|
1173
1172
|
|
|
1174
|
-
/**
|
|
1175
|
-
* @remix-run/router v1.16.1
|
|
1176
|
-
*
|
|
1177
|
-
* Copyright (c) Remix Software Inc.
|
|
1178
|
-
*
|
|
1179
|
-
* This source code is licensed under the MIT license found in the
|
|
1180
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
1181
|
-
*
|
|
1182
|
-
* @license MIT
|
|
1183
|
-
*/
|
|
1184
|
-
function _extends$2() {
|
|
1185
|
-
_extends$2 = Object.assign ? Object.assign.bind() : function (target) {
|
|
1186
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
1187
|
-
var source = arguments[i];
|
|
1188
|
-
for (var key in source) {
|
|
1189
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
1190
|
-
target[key] = source[key];
|
|
1191
|
-
}
|
|
1192
|
-
}
|
|
1193
|
-
}
|
|
1194
|
-
return target;
|
|
1195
|
-
};
|
|
1196
|
-
return _extends$2.apply(this, arguments);
|
|
1197
|
-
}
|
|
1198
|
-
|
|
1199
|
-
////////////////////////////////////////////////////////////////////////////////
|
|
1200
|
-
//#region Types and Constants
|
|
1201
|
-
////////////////////////////////////////////////////////////////////////////////
|
|
1202
|
-
/**
|
|
1203
|
-
* Actions represent the type of change to a location value.
|
|
1204
|
-
*/
|
|
1205
|
-
var Action;
|
|
1206
|
-
(function (Action) {
|
|
1207
|
-
/**
|
|
1208
|
-
* A POP indicates a change to an arbitrary index in the history stack, such
|
|
1209
|
-
* as a back or forward navigation. It does not describe the direction of the
|
|
1210
|
-
* navigation, only that the current index changed.
|
|
1211
|
-
*
|
|
1212
|
-
* Note: This is the default action for newly created history objects.
|
|
1213
|
-
*/
|
|
1214
|
-
Action["Pop"] = "POP";
|
|
1215
|
-
/**
|
|
1216
|
-
* A PUSH indicates a new entry being added to the history stack, such as when
|
|
1217
|
-
* a link is clicked and a new page loads. When this happens, all subsequent
|
|
1218
|
-
* entries in the stack are lost.
|
|
1219
|
-
*/
|
|
1220
|
-
Action["Push"] = "PUSH";
|
|
1221
|
-
/**
|
|
1222
|
-
* A REPLACE indicates the entry at the current index in the history stack
|
|
1223
|
-
* being replaced by a new one.
|
|
1224
|
-
*/
|
|
1225
|
-
Action["Replace"] = "REPLACE";
|
|
1226
|
-
})(Action || (Action = {}));
|
|
1227
|
-
function invariant(value, message) {
|
|
1228
|
-
if (value === false || value === null || typeof value === "undefined") {
|
|
1229
|
-
throw new Error(message);
|
|
1230
|
-
}
|
|
1231
|
-
}
|
|
1232
|
-
function warning(cond, message) {
|
|
1233
|
-
if (!cond) {
|
|
1234
|
-
// eslint-disable-next-line no-console
|
|
1235
|
-
if (typeof console !== "undefined") console.warn(message);
|
|
1236
|
-
try {
|
|
1237
|
-
// Welcome to debugging history!
|
|
1238
|
-
//
|
|
1239
|
-
// This error is thrown as a convenience, so you can more easily
|
|
1240
|
-
// find the source for a warning that appears in the console by
|
|
1241
|
-
// enabling "pause on exceptions" in your JavaScript debugger.
|
|
1242
|
-
throw new Error(message);
|
|
1243
|
-
// eslint-disable-next-line no-empty
|
|
1244
|
-
} catch (e) {}
|
|
1245
|
-
}
|
|
1246
|
-
}
|
|
1247
|
-
/**
|
|
1248
|
-
* Creates a string URL path from the given pathname, search, and hash components.
|
|
1249
|
-
*/
|
|
1250
|
-
function createPath(_ref) {
|
|
1251
|
-
let {
|
|
1252
|
-
pathname = "/",
|
|
1253
|
-
search = "",
|
|
1254
|
-
hash = ""
|
|
1255
|
-
} = _ref;
|
|
1256
|
-
if (search && search !== "?") pathname += search.charAt(0) === "?" ? search : "?" + search;
|
|
1257
|
-
if (hash && hash !== "#") pathname += hash.charAt(0) === "#" ? hash : "#" + hash;
|
|
1258
|
-
return pathname;
|
|
1259
|
-
}
|
|
1260
|
-
/**
|
|
1261
|
-
* Parses a string URL path into its separate pathname, search, and hash components.
|
|
1262
|
-
*/
|
|
1263
|
-
function parsePath(path) {
|
|
1264
|
-
let parsedPath = {};
|
|
1265
|
-
if (path) {
|
|
1266
|
-
let hashIndex = path.indexOf("#");
|
|
1267
|
-
if (hashIndex >= 0) {
|
|
1268
|
-
parsedPath.hash = path.substr(hashIndex);
|
|
1269
|
-
path = path.substr(0, hashIndex);
|
|
1270
|
-
}
|
|
1271
|
-
let searchIndex = path.indexOf("?");
|
|
1272
|
-
if (searchIndex >= 0) {
|
|
1273
|
-
parsedPath.search = path.substr(searchIndex);
|
|
1274
|
-
path = path.substr(0, searchIndex);
|
|
1275
|
-
}
|
|
1276
|
-
if (path) {
|
|
1277
|
-
parsedPath.pathname = path;
|
|
1278
|
-
}
|
|
1279
|
-
}
|
|
1280
|
-
return parsedPath;
|
|
1281
|
-
}
|
|
1282
|
-
//#endregion
|
|
1283
|
-
|
|
1284
|
-
var ResultType;
|
|
1285
|
-
(function (ResultType) {
|
|
1286
|
-
ResultType["data"] = "data";
|
|
1287
|
-
ResultType["deferred"] = "deferred";
|
|
1288
|
-
ResultType["redirect"] = "redirect";
|
|
1289
|
-
ResultType["error"] = "error";
|
|
1290
|
-
})(ResultType || (ResultType = {}));
|
|
1291
|
-
/**
|
|
1292
|
-
* Performs pattern matching on a URL pathname and returns information about
|
|
1293
|
-
* the match.
|
|
1294
|
-
*
|
|
1295
|
-
* @see https://reactrouter.com/utils/match-path
|
|
1296
|
-
*/
|
|
1297
|
-
function matchPath(pattern, pathname) {
|
|
1298
|
-
if (typeof pattern === "string") {
|
|
1299
|
-
pattern = {
|
|
1300
|
-
path: pattern,
|
|
1301
|
-
caseSensitive: false,
|
|
1302
|
-
end: true
|
|
1303
|
-
};
|
|
1304
|
-
}
|
|
1305
|
-
let [matcher, compiledParams] = compilePath(pattern.path, pattern.caseSensitive, pattern.end);
|
|
1306
|
-
let match = pathname.match(matcher);
|
|
1307
|
-
if (!match) return null;
|
|
1308
|
-
let matchedPathname = match[0];
|
|
1309
|
-
let pathnameBase = matchedPathname.replace(/(.)\/+$/, "$1");
|
|
1310
|
-
let captureGroups = match.slice(1);
|
|
1311
|
-
let params = compiledParams.reduce((memo, _ref, index) => {
|
|
1312
|
-
let {
|
|
1313
|
-
paramName,
|
|
1314
|
-
isOptional
|
|
1315
|
-
} = _ref;
|
|
1316
|
-
// We need to compute the pathnameBase here using the raw splat value
|
|
1317
|
-
// instead of using params["*"] later because it will be decoded then
|
|
1318
|
-
if (paramName === "*") {
|
|
1319
|
-
let splatValue = captureGroups[index] || "";
|
|
1320
|
-
pathnameBase = matchedPathname.slice(0, matchedPathname.length - splatValue.length).replace(/(.)\/+$/, "$1");
|
|
1321
|
-
}
|
|
1322
|
-
const value = captureGroups[index];
|
|
1323
|
-
if (isOptional && !value) {
|
|
1324
|
-
memo[paramName] = undefined;
|
|
1325
|
-
} else {
|
|
1326
|
-
memo[paramName] = (value || "").replace(/%2F/g, "/");
|
|
1327
|
-
}
|
|
1328
|
-
return memo;
|
|
1329
|
-
}, {});
|
|
1330
|
-
return {
|
|
1331
|
-
params,
|
|
1332
|
-
pathname: matchedPathname,
|
|
1333
|
-
pathnameBase,
|
|
1334
|
-
pattern
|
|
1335
|
-
};
|
|
1336
|
-
}
|
|
1337
|
-
function compilePath(path, caseSensitive, end) {
|
|
1338
|
-
if (caseSensitive === void 0) {
|
|
1339
|
-
caseSensitive = false;
|
|
1340
|
-
}
|
|
1341
|
-
if (end === void 0) {
|
|
1342
|
-
end = true;
|
|
1343
|
-
}
|
|
1344
|
-
warning(path === "*" || !path.endsWith("*") || path.endsWith("/*"), "Route path \"" + path + "\" will be treated as if it were " + ("\"" + path.replace(/\*$/, "/*") + "\" because the `*` character must ") + "always follow a `/` in the pattern. To get rid of this warning, " + ("please change the route path to \"" + path.replace(/\*$/, "/*") + "\"."));
|
|
1345
|
-
let params = [];
|
|
1346
|
-
let regexpSource = "^" + path.replace(/\/*\*?$/, "") // Ignore trailing / and /*, we'll handle it below
|
|
1347
|
-
.replace(/^\/*/, "/") // Make sure it has a leading /
|
|
1348
|
-
.replace(/[\\.*+^${}|()[\]]/g, "\\$&") // Escape special regex chars
|
|
1349
|
-
.replace(/\/:([\w-]+)(\?)?/g, (_, paramName, isOptional) => {
|
|
1350
|
-
params.push({
|
|
1351
|
-
paramName,
|
|
1352
|
-
isOptional: isOptional != null
|
|
1353
|
-
});
|
|
1354
|
-
return isOptional ? "/?([^\\/]+)?" : "/([^\\/]+)";
|
|
1355
|
-
});
|
|
1356
|
-
if (path.endsWith("*")) {
|
|
1357
|
-
params.push({
|
|
1358
|
-
paramName: "*"
|
|
1359
|
-
});
|
|
1360
|
-
regexpSource += path === "*" || path === "/*" ? "(.*)$" // Already matched the initial /, just match the rest
|
|
1361
|
-
: "(?:\\/(.+)|\\/*)$"; // Don't include the / in params["*"]
|
|
1362
|
-
} else if (end) {
|
|
1363
|
-
// When matching to the end, ignore trailing slashes
|
|
1364
|
-
regexpSource += "\\/*$";
|
|
1365
|
-
} else if (path !== "" && path !== "/") {
|
|
1366
|
-
// If our path is non-empty and contains anything beyond an initial slash,
|
|
1367
|
-
// then we have _some_ form of path in our regex, so we should expect to
|
|
1368
|
-
// match only if we find the end of this path segment. Look for an optional
|
|
1369
|
-
// non-captured trailing slash (to match a portion of the URL) or the end
|
|
1370
|
-
// of the path (if we've matched to the end). We used to do this with a
|
|
1371
|
-
// word boundary but that gives false positives on routes like
|
|
1372
|
-
// /user-preferences since `-` counts as a word boundary.
|
|
1373
|
-
regexpSource += "(?:(?=\\/|$))";
|
|
1374
|
-
} else ;
|
|
1375
|
-
let matcher = new RegExp(regexpSource, caseSensitive ? undefined : "i");
|
|
1376
|
-
return [matcher, params];
|
|
1377
|
-
}
|
|
1378
|
-
/**
|
|
1379
|
-
* @private
|
|
1380
|
-
*/
|
|
1381
|
-
function stripBasename(pathname, basename) {
|
|
1382
|
-
if (basename === "/") return pathname;
|
|
1383
|
-
if (!pathname.toLowerCase().startsWith(basename.toLowerCase())) {
|
|
1384
|
-
return null;
|
|
1385
|
-
}
|
|
1386
|
-
// We want to leave trailing slash behavior in the user's control, so if they
|
|
1387
|
-
// specify a basename with a trailing slash, we should support it
|
|
1388
|
-
let startIndex = basename.endsWith("/") ? basename.length - 1 : basename.length;
|
|
1389
|
-
let nextChar = pathname.charAt(startIndex);
|
|
1390
|
-
if (nextChar && nextChar !== "/") {
|
|
1391
|
-
// pathname does not start with basename/
|
|
1392
|
-
return null;
|
|
1393
|
-
}
|
|
1394
|
-
return pathname.slice(startIndex) || "/";
|
|
1395
|
-
}
|
|
1396
|
-
/**
|
|
1397
|
-
* Returns a resolved path object relative to the given pathname.
|
|
1398
|
-
*
|
|
1399
|
-
* @see https://reactrouter.com/utils/resolve-path
|
|
1400
|
-
*/
|
|
1401
|
-
function resolvePath(to, fromPathname) {
|
|
1402
|
-
if (fromPathname === void 0) {
|
|
1403
|
-
fromPathname = "/";
|
|
1404
|
-
}
|
|
1405
|
-
let {
|
|
1406
|
-
pathname: toPathname,
|
|
1407
|
-
search = "",
|
|
1408
|
-
hash = ""
|
|
1409
|
-
} = typeof to === "string" ? parsePath(to) : to;
|
|
1410
|
-
let pathname = toPathname ? toPathname.startsWith("/") ? toPathname : resolvePathname(toPathname, fromPathname) : fromPathname;
|
|
1411
|
-
return {
|
|
1412
|
-
pathname,
|
|
1413
|
-
search: normalizeSearch(search),
|
|
1414
|
-
hash: normalizeHash(hash)
|
|
1415
|
-
};
|
|
1416
|
-
}
|
|
1417
|
-
function resolvePathname(relativePath, fromPathname) {
|
|
1418
|
-
let segments = fromPathname.replace(/\/+$/, "").split("/");
|
|
1419
|
-
let relativeSegments = relativePath.split("/");
|
|
1420
|
-
relativeSegments.forEach(segment => {
|
|
1421
|
-
if (segment === "..") {
|
|
1422
|
-
// Keep the root "" segment so the pathname starts at /
|
|
1423
|
-
if (segments.length > 1) segments.pop();
|
|
1424
|
-
} else if (segment !== ".") {
|
|
1425
|
-
segments.push(segment);
|
|
1426
|
-
}
|
|
1427
|
-
});
|
|
1428
|
-
return segments.length > 1 ? segments.join("/") : "/";
|
|
1429
|
-
}
|
|
1430
|
-
function getInvalidPathError(char, field, dest, path) {
|
|
1431
|
-
return "Cannot include a '" + char + "' character in a manually specified " + ("`to." + field + "` field [" + JSON.stringify(path) + "]. Please separate it out to the ") + ("`to." + dest + "` field. Alternatively you may provide the full path as ") + "a string in <Link to=\"...\"> and the router will parse it for you.";
|
|
1432
|
-
}
|
|
1433
|
-
/**
|
|
1434
|
-
* @private
|
|
1435
|
-
*
|
|
1436
|
-
* When processing relative navigation we want to ignore ancestor routes that
|
|
1437
|
-
* do not contribute to the path, such that index/pathless layout routes don't
|
|
1438
|
-
* interfere.
|
|
1439
|
-
*
|
|
1440
|
-
* For example, when moving a route element into an index route and/or a
|
|
1441
|
-
* pathless layout route, relative link behavior contained within should stay
|
|
1442
|
-
* the same. Both of the following examples should link back to the root:
|
|
1443
|
-
*
|
|
1444
|
-
* <Route path="/">
|
|
1445
|
-
* <Route path="accounts" element={<Link to=".."}>
|
|
1446
|
-
* </Route>
|
|
1447
|
-
*
|
|
1448
|
-
* <Route path="/">
|
|
1449
|
-
* <Route path="accounts">
|
|
1450
|
-
* <Route element={<AccountsLayout />}> // <-- Does not contribute
|
|
1451
|
-
* <Route index element={<Link to=".."} /> // <-- Does not contribute
|
|
1452
|
-
* </Route
|
|
1453
|
-
* </Route>
|
|
1454
|
-
* </Route>
|
|
1455
|
-
*/
|
|
1456
|
-
function getPathContributingMatches(matches) {
|
|
1457
|
-
return matches.filter((match, index) => index === 0 || match.route.path && match.route.path.length > 0);
|
|
1458
|
-
}
|
|
1459
|
-
// Return the array of pathnames for the current route matches - used to
|
|
1460
|
-
// generate the routePathnames input for resolveTo()
|
|
1461
|
-
function getResolveToMatches(matches, v7_relativeSplatPath) {
|
|
1462
|
-
let pathMatches = getPathContributingMatches(matches);
|
|
1463
|
-
// When v7_relativeSplatPath is enabled, use the full pathname for the leaf
|
|
1464
|
-
// match so we include splat values for "." links. See:
|
|
1465
|
-
// https://github.com/remix-run/react-router/issues/11052#issuecomment-1836589329
|
|
1466
|
-
if (v7_relativeSplatPath) {
|
|
1467
|
-
return pathMatches.map((match, idx) => idx === matches.length - 1 ? match.pathname : match.pathnameBase);
|
|
1468
|
-
}
|
|
1469
|
-
return pathMatches.map(match => match.pathnameBase);
|
|
1470
|
-
}
|
|
1471
|
-
/**
|
|
1472
|
-
* @private
|
|
1473
|
-
*/
|
|
1474
|
-
function resolveTo(toArg, routePathnames, locationPathname, isPathRelative) {
|
|
1475
|
-
if (isPathRelative === void 0) {
|
|
1476
|
-
isPathRelative = false;
|
|
1477
|
-
}
|
|
1478
|
-
let to;
|
|
1479
|
-
if (typeof toArg === "string") {
|
|
1480
|
-
to = parsePath(toArg);
|
|
1481
|
-
} else {
|
|
1482
|
-
to = _extends$2({}, toArg);
|
|
1483
|
-
invariant(!to.pathname || !to.pathname.includes("?"), getInvalidPathError("?", "pathname", "search", to));
|
|
1484
|
-
invariant(!to.pathname || !to.pathname.includes("#"), getInvalidPathError("#", "pathname", "hash", to));
|
|
1485
|
-
invariant(!to.search || !to.search.includes("#"), getInvalidPathError("#", "search", "hash", to));
|
|
1486
|
-
}
|
|
1487
|
-
let isEmptyPath = toArg === "" || to.pathname === "";
|
|
1488
|
-
let toPathname = isEmptyPath ? "/" : to.pathname;
|
|
1489
|
-
let from;
|
|
1490
|
-
// Routing is relative to the current pathname if explicitly requested.
|
|
1491
|
-
//
|
|
1492
|
-
// If a pathname is explicitly provided in `to`, it should be relative to the
|
|
1493
|
-
// route context. This is explained in `Note on `<Link to>` values` in our
|
|
1494
|
-
// migration guide from v5 as a means of disambiguation between `to` values
|
|
1495
|
-
// that begin with `/` and those that do not. However, this is problematic for
|
|
1496
|
-
// `to` values that do not provide a pathname. `to` can simply be a search or
|
|
1497
|
-
// hash string, in which case we should assume that the navigation is relative
|
|
1498
|
-
// to the current location's pathname and *not* the route pathname.
|
|
1499
|
-
if (toPathname == null) {
|
|
1500
|
-
from = locationPathname;
|
|
1501
|
-
} else {
|
|
1502
|
-
let routePathnameIndex = routePathnames.length - 1;
|
|
1503
|
-
// With relative="route" (the default), each leading .. segment means
|
|
1504
|
-
// "go up one route" instead of "go up one URL segment". This is a key
|
|
1505
|
-
// difference from how <a href> works and a major reason we call this a
|
|
1506
|
-
// "to" value instead of a "href".
|
|
1507
|
-
if (!isPathRelative && toPathname.startsWith("..")) {
|
|
1508
|
-
let toSegments = toPathname.split("/");
|
|
1509
|
-
while (toSegments[0] === "..") {
|
|
1510
|
-
toSegments.shift();
|
|
1511
|
-
routePathnameIndex -= 1;
|
|
1512
|
-
}
|
|
1513
|
-
to.pathname = toSegments.join("/");
|
|
1514
|
-
}
|
|
1515
|
-
from = routePathnameIndex >= 0 ? routePathnames[routePathnameIndex] : "/";
|
|
1516
|
-
}
|
|
1517
|
-
let path = resolvePath(to, from);
|
|
1518
|
-
// Ensure the pathname has a trailing slash if the original "to" had one
|
|
1519
|
-
let hasExplicitTrailingSlash = toPathname && toPathname !== "/" && toPathname.endsWith("/");
|
|
1520
|
-
// Or if this was a link to the current path which has a trailing slash
|
|
1521
|
-
let hasCurrentTrailingSlash = (isEmptyPath || toPathname === ".") && locationPathname.endsWith("/");
|
|
1522
|
-
if (!path.pathname.endsWith("/") && (hasExplicitTrailingSlash || hasCurrentTrailingSlash)) {
|
|
1523
|
-
path.pathname += "/";
|
|
1524
|
-
}
|
|
1525
|
-
return path;
|
|
1526
|
-
}
|
|
1527
|
-
/**
|
|
1528
|
-
* @private
|
|
1529
|
-
*/
|
|
1530
|
-
const joinPaths = paths => paths.join("/").replace(/\/\/+/g, "/");
|
|
1531
|
-
/**
|
|
1532
|
-
* @private
|
|
1533
|
-
*/
|
|
1534
|
-
const normalizeSearch = search => !search || search === "?" ? "" : search.startsWith("?") ? search : "?" + search;
|
|
1535
|
-
/**
|
|
1536
|
-
* @private
|
|
1537
|
-
*/
|
|
1538
|
-
const normalizeHash = hash => !hash || hash === "#" ? "" : hash.startsWith("#") ? hash : "#" + hash;
|
|
1539
|
-
|
|
1540
|
-
const validMutationMethodsArr = ["post", "put", "patch", "delete"];
|
|
1541
|
-
new Set(validMutationMethodsArr);
|
|
1542
|
-
const validRequestMethodsArr = ["get", ...validMutationMethodsArr];
|
|
1543
|
-
new Set(validRequestMethodsArr);
|
|
1544
|
-
|
|
1545
|
-
/**
|
|
1546
|
-
* React Router v6.23.1
|
|
1547
|
-
*
|
|
1548
|
-
* Copyright (c) Remix Software Inc.
|
|
1549
|
-
*
|
|
1550
|
-
* This source code is licensed under the MIT license found in the
|
|
1551
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
1552
|
-
*
|
|
1553
|
-
* @license MIT
|
|
1554
|
-
*/
|
|
1555
|
-
|
|
1556
|
-
function _extends$1() {
|
|
1557
|
-
_extends$1 = Object.assign ? Object.assign.bind() : function (target) {
|
|
1558
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
1559
|
-
var source = arguments[i];
|
|
1560
|
-
for (var key in source) {
|
|
1561
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
1562
|
-
target[key] = source[key];
|
|
1563
|
-
}
|
|
1564
|
-
}
|
|
1565
|
-
}
|
|
1566
|
-
return target;
|
|
1567
|
-
};
|
|
1568
|
-
return _extends$1.apply(this, arguments);
|
|
1569
|
-
}
|
|
1570
|
-
|
|
1571
|
-
// Create react-specific types from the agnostic types in @remix-run/router to
|
|
1572
|
-
// export from react-router
|
|
1573
|
-
const DataRouterContext = /*#__PURE__*/React.createContext(null);
|
|
1574
|
-
{
|
|
1575
|
-
DataRouterContext.displayName = "DataRouter";
|
|
1576
|
-
}
|
|
1577
|
-
const DataRouterStateContext = /*#__PURE__*/React.createContext(null);
|
|
1578
|
-
{
|
|
1579
|
-
DataRouterStateContext.displayName = "DataRouterState";
|
|
1580
|
-
}
|
|
1581
|
-
const AwaitContext = /*#__PURE__*/React.createContext(null);
|
|
1582
|
-
{
|
|
1583
|
-
AwaitContext.displayName = "Await";
|
|
1584
|
-
}
|
|
1585
|
-
|
|
1586
|
-
/**
|
|
1587
|
-
* A Navigator is a "location changer"; it's how you get to different locations.
|
|
1588
|
-
*
|
|
1589
|
-
* Every history instance conforms to the Navigator interface, but the
|
|
1590
|
-
* distinction is useful primarily when it comes to the low-level `<Router>` API
|
|
1591
|
-
* where both the location and a navigator must be provided separately in order
|
|
1592
|
-
* to avoid "tearing" that may occur in a suspense-enabled app if the action
|
|
1593
|
-
* and/or location were to be read directly from the history instance.
|
|
1594
|
-
*/
|
|
1595
|
-
|
|
1596
|
-
const NavigationContext = /*#__PURE__*/React.createContext(null);
|
|
1597
|
-
{
|
|
1598
|
-
NavigationContext.displayName = "Navigation";
|
|
1599
|
-
}
|
|
1600
|
-
const LocationContext = /*#__PURE__*/React.createContext(null);
|
|
1601
|
-
{
|
|
1602
|
-
LocationContext.displayName = "Location";
|
|
1603
|
-
}
|
|
1604
|
-
const RouteContext = /*#__PURE__*/React.createContext({
|
|
1605
|
-
outlet: null,
|
|
1606
|
-
matches: [],
|
|
1607
|
-
isDataRoute: false
|
|
1608
|
-
});
|
|
1609
|
-
{
|
|
1610
|
-
RouteContext.displayName = "Route";
|
|
1611
|
-
}
|
|
1612
|
-
const RouteErrorContext = /*#__PURE__*/React.createContext(null);
|
|
1613
|
-
{
|
|
1614
|
-
RouteErrorContext.displayName = "RouteError";
|
|
1615
|
-
}
|
|
1616
|
-
|
|
1617
|
-
/**
|
|
1618
|
-
* Returns the full href for the given "to" value. This is useful for building
|
|
1619
|
-
* custom links that are also accessible and preserve right-click behavior.
|
|
1620
|
-
*
|
|
1621
|
-
* @see https://reactrouter.com/hooks/use-href
|
|
1622
|
-
*/
|
|
1623
|
-
function useHref(to, _temp) {
|
|
1624
|
-
let {
|
|
1625
|
-
relative
|
|
1626
|
-
} = _temp === void 0 ? {} : _temp;
|
|
1627
|
-
!useInRouterContext() ? invariant(false, // TODO: This error is probably because they somehow have 2 versions of the
|
|
1628
|
-
// router loaded. We can help them understand how to avoid that.
|
|
1629
|
-
"useHref() may be used only in the context of a <Router> component.") : void 0;
|
|
1630
|
-
let {
|
|
1631
|
-
basename,
|
|
1632
|
-
navigator
|
|
1633
|
-
} = React.useContext(NavigationContext);
|
|
1634
|
-
let {
|
|
1635
|
-
hash,
|
|
1636
|
-
pathname,
|
|
1637
|
-
search
|
|
1638
|
-
} = useResolvedPath(to, {
|
|
1639
|
-
relative
|
|
1640
|
-
});
|
|
1641
|
-
let joinedPathname = pathname;
|
|
1642
|
-
|
|
1643
|
-
// If we're operating within a basename, prepend it to the pathname prior
|
|
1644
|
-
// to creating the href. If this is a root navigation, then just use the raw
|
|
1645
|
-
// basename which allows the basename to have full control over the presence
|
|
1646
|
-
// of a trailing slash on root links
|
|
1647
|
-
if (basename !== "/") {
|
|
1648
|
-
joinedPathname = pathname === "/" ? basename : joinPaths([basename, pathname]);
|
|
1649
|
-
}
|
|
1650
|
-
return navigator.createHref({
|
|
1651
|
-
pathname: joinedPathname,
|
|
1652
|
-
search,
|
|
1653
|
-
hash
|
|
1654
|
-
});
|
|
1655
|
-
}
|
|
1656
|
-
|
|
1657
|
-
/**
|
|
1658
|
-
* Returns true if this component is a descendant of a `<Router>`.
|
|
1659
|
-
*
|
|
1660
|
-
* @see https://reactrouter.com/hooks/use-in-router-context
|
|
1661
|
-
*/
|
|
1662
|
-
function useInRouterContext() {
|
|
1663
|
-
return React.useContext(LocationContext) != null;
|
|
1664
|
-
}
|
|
1665
|
-
|
|
1666
|
-
/**
|
|
1667
|
-
* Returns the current location object, which represents the current URL in web
|
|
1668
|
-
* browsers.
|
|
1669
|
-
*
|
|
1670
|
-
* Note: If you're using this it may mean you're doing some of your own
|
|
1671
|
-
* "routing" in your app, and we'd like to know what your use case is. We may
|
|
1672
|
-
* be able to provide something higher-level to better suit your needs.
|
|
1673
|
-
*
|
|
1674
|
-
* @see https://reactrouter.com/hooks/use-location
|
|
1675
|
-
*/
|
|
1676
|
-
function useLocation() {
|
|
1677
|
-
!useInRouterContext() ? invariant(false, // TODO: This error is probably because they somehow have 2 versions of the
|
|
1678
|
-
// router loaded. We can help them understand how to avoid that.
|
|
1679
|
-
"useLocation() may be used only in the context of a <Router> component.") : void 0;
|
|
1680
|
-
return React.useContext(LocationContext).location;
|
|
1681
|
-
}
|
|
1682
|
-
|
|
1683
|
-
/**
|
|
1684
|
-
* The interface for the navigate() function returned from useNavigate().
|
|
1685
|
-
*/
|
|
1686
|
-
|
|
1687
|
-
const navigateEffectWarning = "You should call navigate() in a React.useEffect(), not when " + "your component is first rendered.";
|
|
1688
|
-
|
|
1689
|
-
// Mute warnings for calls to useNavigate in SSR environments
|
|
1690
|
-
function useIsomorphicLayoutEffect(cb) {
|
|
1691
|
-
let isStatic = React.useContext(NavigationContext).static;
|
|
1692
|
-
if (!isStatic) {
|
|
1693
|
-
// We should be able to get rid of this once react 18.3 is released
|
|
1694
|
-
// See: https://github.com/facebook/react/pull/26395
|
|
1695
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
1696
|
-
React.useLayoutEffect(cb);
|
|
1697
|
-
}
|
|
1698
|
-
}
|
|
1699
|
-
|
|
1700
|
-
/**
|
|
1701
|
-
* Returns an imperative method for changing the location. Used by `<Link>`s, but
|
|
1702
|
-
* may also be used by other elements to change the location.
|
|
1703
|
-
*
|
|
1704
|
-
* @see https://reactrouter.com/hooks/use-navigate
|
|
1705
|
-
*/
|
|
1706
|
-
function useNavigate() {
|
|
1707
|
-
let {
|
|
1708
|
-
isDataRoute
|
|
1709
|
-
} = React.useContext(RouteContext);
|
|
1710
|
-
// Conditional usage is OK here because the usage of a data router is static
|
|
1711
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
1712
|
-
return isDataRoute ? useNavigateStable() : useNavigateUnstable();
|
|
1713
|
-
}
|
|
1714
|
-
function useNavigateUnstable() {
|
|
1715
|
-
!useInRouterContext() ? invariant(false, // TODO: This error is probably because they somehow have 2 versions of the
|
|
1716
|
-
// router loaded. We can help them understand how to avoid that.
|
|
1717
|
-
"useNavigate() may be used only in the context of a <Router> component.") : void 0;
|
|
1718
|
-
let dataRouterContext = React.useContext(DataRouterContext);
|
|
1719
|
-
let {
|
|
1720
|
-
basename,
|
|
1721
|
-
future,
|
|
1722
|
-
navigator
|
|
1723
|
-
} = React.useContext(NavigationContext);
|
|
1724
|
-
let {
|
|
1725
|
-
matches
|
|
1726
|
-
} = React.useContext(RouteContext);
|
|
1727
|
-
let {
|
|
1728
|
-
pathname: locationPathname
|
|
1729
|
-
} = useLocation();
|
|
1730
|
-
let routePathnamesJson = JSON.stringify(getResolveToMatches(matches, future.v7_relativeSplatPath));
|
|
1731
|
-
let activeRef = React.useRef(false);
|
|
1732
|
-
useIsomorphicLayoutEffect(() => {
|
|
1733
|
-
activeRef.current = true;
|
|
1734
|
-
});
|
|
1735
|
-
let navigate = React.useCallback(function (to, options) {
|
|
1736
|
-
if (options === void 0) {
|
|
1737
|
-
options = {};
|
|
1738
|
-
}
|
|
1739
|
-
warning(activeRef.current, navigateEffectWarning) ;
|
|
1740
|
-
|
|
1741
|
-
// Short circuit here since if this happens on first render the navigate
|
|
1742
|
-
// is useless because we haven't wired up our history listener yet
|
|
1743
|
-
if (!activeRef.current) return;
|
|
1744
|
-
if (typeof to === "number") {
|
|
1745
|
-
navigator.go(to);
|
|
1746
|
-
return;
|
|
1747
|
-
}
|
|
1748
|
-
let path = resolveTo(to, JSON.parse(routePathnamesJson), locationPathname, options.relative === "path");
|
|
1749
|
-
|
|
1750
|
-
// If we're operating within a basename, prepend it to the pathname prior
|
|
1751
|
-
// to handing off to history (but only if we're not in a data router,
|
|
1752
|
-
// otherwise it'll prepend the basename inside of the router).
|
|
1753
|
-
// If this is a root navigation, then we navigate to the raw basename
|
|
1754
|
-
// which allows the basename to have full control over the presence of a
|
|
1755
|
-
// trailing slash on root links
|
|
1756
|
-
if (dataRouterContext == null && basename !== "/") {
|
|
1757
|
-
path.pathname = path.pathname === "/" ? basename : joinPaths([basename, path.pathname]);
|
|
1758
|
-
}
|
|
1759
|
-
(!!options.replace ? navigator.replace : navigator.push)(path, options.state, options);
|
|
1760
|
-
}, [basename, navigator, routePathnamesJson, locationPathname, dataRouterContext]);
|
|
1761
|
-
return navigate;
|
|
1762
|
-
}
|
|
1763
|
-
|
|
1764
|
-
/**
|
|
1765
|
-
* Resolves the pathname of the given `to` value against the current location.
|
|
1766
|
-
*
|
|
1767
|
-
* @see https://reactrouter.com/hooks/use-resolved-path
|
|
1768
|
-
*/
|
|
1769
|
-
function useResolvedPath(to, _temp2) {
|
|
1770
|
-
let {
|
|
1771
|
-
relative
|
|
1772
|
-
} = _temp2 === void 0 ? {} : _temp2;
|
|
1773
|
-
let {
|
|
1774
|
-
future
|
|
1775
|
-
} = React.useContext(NavigationContext);
|
|
1776
|
-
let {
|
|
1777
|
-
matches
|
|
1778
|
-
} = React.useContext(RouteContext);
|
|
1779
|
-
let {
|
|
1780
|
-
pathname: locationPathname
|
|
1781
|
-
} = useLocation();
|
|
1782
|
-
let routePathnamesJson = JSON.stringify(getResolveToMatches(matches, future.v7_relativeSplatPath));
|
|
1783
|
-
return React.useMemo(() => resolveTo(to, JSON.parse(routePathnamesJson), locationPathname, relative === "path"), [to, routePathnamesJson, locationPathname, relative]);
|
|
1784
|
-
}
|
|
1785
|
-
var DataRouterHook$1 = /*#__PURE__*/function (DataRouterHook) {
|
|
1786
|
-
DataRouterHook["UseBlocker"] = "useBlocker";
|
|
1787
|
-
DataRouterHook["UseRevalidator"] = "useRevalidator";
|
|
1788
|
-
DataRouterHook["UseNavigateStable"] = "useNavigate";
|
|
1789
|
-
return DataRouterHook;
|
|
1790
|
-
}(DataRouterHook$1 || {});
|
|
1791
|
-
var DataRouterStateHook$1 = /*#__PURE__*/function (DataRouterStateHook) {
|
|
1792
|
-
DataRouterStateHook["UseBlocker"] = "useBlocker";
|
|
1793
|
-
DataRouterStateHook["UseLoaderData"] = "useLoaderData";
|
|
1794
|
-
DataRouterStateHook["UseActionData"] = "useActionData";
|
|
1795
|
-
DataRouterStateHook["UseRouteError"] = "useRouteError";
|
|
1796
|
-
DataRouterStateHook["UseNavigation"] = "useNavigation";
|
|
1797
|
-
DataRouterStateHook["UseRouteLoaderData"] = "useRouteLoaderData";
|
|
1798
|
-
DataRouterStateHook["UseMatches"] = "useMatches";
|
|
1799
|
-
DataRouterStateHook["UseRevalidator"] = "useRevalidator";
|
|
1800
|
-
DataRouterStateHook["UseNavigateStable"] = "useNavigate";
|
|
1801
|
-
DataRouterStateHook["UseRouteId"] = "useRouteId";
|
|
1802
|
-
return DataRouterStateHook;
|
|
1803
|
-
}(DataRouterStateHook$1 || {});
|
|
1804
|
-
function getDataRouterConsoleError$1(hookName) {
|
|
1805
|
-
return hookName + " must be used within a data router. See https://reactrouter.com/routers/picking-a-router.";
|
|
1806
|
-
}
|
|
1807
|
-
function useDataRouterContext$1(hookName) {
|
|
1808
|
-
let ctx = React.useContext(DataRouterContext);
|
|
1809
|
-
!ctx ? invariant(false, getDataRouterConsoleError$1(hookName)) : void 0;
|
|
1810
|
-
return ctx;
|
|
1811
|
-
}
|
|
1812
|
-
function useRouteContext(hookName) {
|
|
1813
|
-
let route = React.useContext(RouteContext);
|
|
1814
|
-
!route ? invariant(false, getDataRouterConsoleError$1(hookName)) : void 0;
|
|
1815
|
-
return route;
|
|
1816
|
-
}
|
|
1817
|
-
|
|
1818
|
-
// Internal version with hookName-aware debugging
|
|
1819
|
-
function useCurrentRouteId(hookName) {
|
|
1820
|
-
let route = useRouteContext(hookName);
|
|
1821
|
-
let thisRoute = route.matches[route.matches.length - 1];
|
|
1822
|
-
!thisRoute.route.id ? invariant(false, hookName + " can only be used on routes that contain a unique \"id\"") : void 0;
|
|
1823
|
-
return thisRoute.route.id;
|
|
1824
|
-
}
|
|
1825
|
-
|
|
1826
|
-
/**
|
|
1827
|
-
* Returns the ID for the nearest contextual route
|
|
1828
|
-
*/
|
|
1829
|
-
function useRouteId() {
|
|
1830
|
-
return useCurrentRouteId(DataRouterStateHook$1.UseRouteId);
|
|
1831
|
-
}
|
|
1832
|
-
|
|
1833
|
-
/**
|
|
1834
|
-
* Stable version of useNavigate that is used when we are in the context of
|
|
1835
|
-
* a RouterProvider.
|
|
1836
|
-
*/
|
|
1837
|
-
function useNavigateStable() {
|
|
1838
|
-
let {
|
|
1839
|
-
router
|
|
1840
|
-
} = useDataRouterContext$1(DataRouterHook$1.UseNavigateStable);
|
|
1841
|
-
let id = useCurrentRouteId(DataRouterStateHook$1.UseNavigateStable);
|
|
1842
|
-
let activeRef = React.useRef(false);
|
|
1843
|
-
useIsomorphicLayoutEffect(() => {
|
|
1844
|
-
activeRef.current = true;
|
|
1845
|
-
});
|
|
1846
|
-
let navigate = React.useCallback(function (to, options) {
|
|
1847
|
-
if (options === void 0) {
|
|
1848
|
-
options = {};
|
|
1849
|
-
}
|
|
1850
|
-
warning(activeRef.current, navigateEffectWarning) ;
|
|
1851
|
-
|
|
1852
|
-
// Short circuit here since if this happens on first render the navigate
|
|
1853
|
-
// is useless because we haven't wired up our router subscriber yet
|
|
1854
|
-
if (!activeRef.current) return;
|
|
1855
|
-
if (typeof to === "number") {
|
|
1856
|
-
router.navigate(to);
|
|
1857
|
-
} else {
|
|
1858
|
-
router.navigate(to, _extends$1({
|
|
1859
|
-
fromRouteId: id
|
|
1860
|
-
}, options));
|
|
1861
|
-
}
|
|
1862
|
-
}, [router, id]);
|
|
1863
|
-
return navigate;
|
|
1864
|
-
}
|
|
1865
|
-
new Promise(() => {});
|
|
1866
|
-
|
|
1867
|
-
/**
|
|
1868
|
-
* React Router DOM v6.23.1
|
|
1869
|
-
*
|
|
1870
|
-
* Copyright (c) Remix Software Inc.
|
|
1871
|
-
*
|
|
1872
|
-
* This source code is licensed under the MIT license found in the
|
|
1873
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
1874
|
-
*
|
|
1875
|
-
* @license MIT
|
|
1876
|
-
*/
|
|
1877
|
-
|
|
1878
|
-
function _extends() {
|
|
1879
|
-
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
1880
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
1881
|
-
var source = arguments[i];
|
|
1882
|
-
for (var key in source) {
|
|
1883
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
1884
|
-
target[key] = source[key];
|
|
1885
|
-
}
|
|
1886
|
-
}
|
|
1887
|
-
}
|
|
1888
|
-
return target;
|
|
1889
|
-
};
|
|
1890
|
-
return _extends.apply(this, arguments);
|
|
1891
|
-
}
|
|
1892
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
1893
|
-
if (source == null) return {};
|
|
1894
|
-
var target = {};
|
|
1895
|
-
var sourceKeys = Object.keys(source);
|
|
1896
|
-
var key, i;
|
|
1897
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
1898
|
-
key = sourceKeys[i];
|
|
1899
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
1900
|
-
target[key] = source[key];
|
|
1901
|
-
}
|
|
1902
|
-
return target;
|
|
1903
|
-
}
|
|
1904
|
-
|
|
1905
|
-
const defaultMethod = "get";
|
|
1906
|
-
const defaultEncType = "application/x-www-form-urlencoded";
|
|
1907
|
-
function isHtmlElement(object) {
|
|
1908
|
-
return object != null && typeof object.tagName === "string";
|
|
1909
|
-
}
|
|
1910
|
-
function isButtonElement(object) {
|
|
1911
|
-
return isHtmlElement(object) && object.tagName.toLowerCase() === "button";
|
|
1912
|
-
}
|
|
1913
|
-
function isFormElement(object) {
|
|
1914
|
-
return isHtmlElement(object) && object.tagName.toLowerCase() === "form";
|
|
1915
|
-
}
|
|
1916
|
-
function isInputElement(object) {
|
|
1917
|
-
return isHtmlElement(object) && object.tagName.toLowerCase() === "input";
|
|
1918
|
-
}
|
|
1919
|
-
function isModifiedEvent(event) {
|
|
1920
|
-
return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);
|
|
1921
|
-
}
|
|
1922
|
-
function shouldProcessLinkClick(event, target) {
|
|
1923
|
-
return event.button === 0 && (
|
|
1924
|
-
// Ignore everything but left clicks
|
|
1925
|
-
!target || target === "_self") &&
|
|
1926
|
-
// Let browser handle "target=_blank" etc.
|
|
1927
|
-
!isModifiedEvent(event) // Ignore clicks with modifier keys
|
|
1928
|
-
;
|
|
1929
|
-
}
|
|
1930
|
-
// One-time check for submitter support
|
|
1931
|
-
let _formDataSupportsSubmitter = null;
|
|
1932
|
-
function isFormDataSubmitterSupported() {
|
|
1933
|
-
if (_formDataSupportsSubmitter === null) {
|
|
1934
|
-
try {
|
|
1935
|
-
new FormData(document.createElement("form"),
|
|
1936
|
-
// @ts-expect-error if FormData supports the submitter parameter, this will throw
|
|
1937
|
-
0);
|
|
1938
|
-
_formDataSupportsSubmitter = false;
|
|
1939
|
-
} catch (e) {
|
|
1940
|
-
_formDataSupportsSubmitter = true;
|
|
1941
|
-
}
|
|
1942
|
-
}
|
|
1943
|
-
return _formDataSupportsSubmitter;
|
|
1944
|
-
}
|
|
1945
|
-
const supportedFormEncTypes = new Set(["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"]);
|
|
1946
|
-
function getFormEncType(encType) {
|
|
1947
|
-
if (encType != null && !supportedFormEncTypes.has(encType)) {
|
|
1948
|
-
warning(false, "\"" + encType + "\" is not a valid `encType` for `<Form>`/`<fetcher.Form>` " + ("and will default to \"" + defaultEncType + "\"")) ;
|
|
1949
|
-
return null;
|
|
1950
|
-
}
|
|
1951
|
-
return encType;
|
|
1952
|
-
}
|
|
1953
|
-
function getFormSubmissionInfo(target, basename) {
|
|
1954
|
-
let method;
|
|
1955
|
-
let action;
|
|
1956
|
-
let encType;
|
|
1957
|
-
let formData;
|
|
1958
|
-
let body;
|
|
1959
|
-
if (isFormElement(target)) {
|
|
1960
|
-
// When grabbing the action from the element, it will have had the basename
|
|
1961
|
-
// prefixed to ensure non-JS scenarios work, so strip it since we'll
|
|
1962
|
-
// re-prefix in the router
|
|
1963
|
-
let attr = target.getAttribute("action");
|
|
1964
|
-
action = attr ? stripBasename(attr, basename) : null;
|
|
1965
|
-
method = target.getAttribute("method") || defaultMethod;
|
|
1966
|
-
encType = getFormEncType(target.getAttribute("enctype")) || defaultEncType;
|
|
1967
|
-
formData = new FormData(target);
|
|
1968
|
-
} else if (isButtonElement(target) || isInputElement(target) && (target.type === "submit" || target.type === "image")) {
|
|
1969
|
-
let form = target.form;
|
|
1970
|
-
if (form == null) {
|
|
1971
|
-
throw new Error("Cannot submit a <button> or <input type=\"submit\"> without a <form>");
|
|
1972
|
-
}
|
|
1973
|
-
// <button>/<input type="submit"> may override attributes of <form>
|
|
1974
|
-
// When grabbing the action from the element, it will have had the basename
|
|
1975
|
-
// prefixed to ensure non-JS scenarios work, so strip it since we'll
|
|
1976
|
-
// re-prefix in the router
|
|
1977
|
-
let attr = target.getAttribute("formaction") || form.getAttribute("action");
|
|
1978
|
-
action = attr ? stripBasename(attr, basename) : null;
|
|
1979
|
-
method = target.getAttribute("formmethod") || form.getAttribute("method") || defaultMethod;
|
|
1980
|
-
encType = getFormEncType(target.getAttribute("formenctype")) || getFormEncType(form.getAttribute("enctype")) || defaultEncType;
|
|
1981
|
-
// Build a FormData object populated from a form and submitter
|
|
1982
|
-
formData = new FormData(form, target);
|
|
1983
|
-
// If this browser doesn't support the `FormData(el, submitter)` format,
|
|
1984
|
-
// then tack on the submitter value at the end. This is a lightweight
|
|
1985
|
-
// solution that is not 100% spec compliant. For complete support in older
|
|
1986
|
-
// browsers, consider using the `formdata-submitter-polyfill` package
|
|
1987
|
-
if (!isFormDataSubmitterSupported()) {
|
|
1988
|
-
let {
|
|
1989
|
-
name,
|
|
1990
|
-
type,
|
|
1991
|
-
value
|
|
1992
|
-
} = target;
|
|
1993
|
-
if (type === "image") {
|
|
1994
|
-
let prefix = name ? name + "." : "";
|
|
1995
|
-
formData.append(prefix + "x", "0");
|
|
1996
|
-
formData.append(prefix + "y", "0");
|
|
1997
|
-
} else if (name) {
|
|
1998
|
-
formData.append(name, value);
|
|
1999
|
-
}
|
|
2000
|
-
}
|
|
2001
|
-
} else if (isHtmlElement(target)) {
|
|
2002
|
-
throw new Error("Cannot submit element that is not <form>, <button>, or " + "<input type=\"submit|image\">");
|
|
2003
|
-
} else {
|
|
2004
|
-
method = defaultMethod;
|
|
2005
|
-
action = null;
|
|
2006
|
-
encType = defaultEncType;
|
|
2007
|
-
body = target;
|
|
2008
|
-
}
|
|
2009
|
-
// Send body for <Form encType="text/plain" so we encode it into text
|
|
2010
|
-
if (formData && encType === "text/plain") {
|
|
2011
|
-
body = formData;
|
|
2012
|
-
formData = undefined;
|
|
2013
|
-
}
|
|
2014
|
-
return {
|
|
2015
|
-
action,
|
|
2016
|
-
method: method.toLowerCase(),
|
|
2017
|
-
encType,
|
|
2018
|
-
formData,
|
|
2019
|
-
body
|
|
2020
|
-
};
|
|
2021
|
-
}
|
|
2022
|
-
|
|
2023
|
-
const _excluded = ["onClick", "relative", "reloadDocument", "replace", "state", "target", "to", "preventScrollReset", "unstable_viewTransition"],
|
|
2024
|
-
_excluded2 = ["aria-current", "caseSensitive", "className", "end", "style", "to", "unstable_viewTransition", "children"],
|
|
2025
|
-
_excluded3 = ["fetcherKey", "navigate", "reloadDocument", "replace", "state", "method", "action", "onSubmit", "relative", "preventScrollReset", "unstable_viewTransition"];
|
|
2026
|
-
// HEY YOU! DON'T TOUCH THIS VARIABLE!
|
|
2027
|
-
//
|
|
2028
|
-
// It is replaced with the proper version at build time via a babel plugin in
|
|
2029
|
-
// the rollup config.
|
|
2030
|
-
//
|
|
2031
|
-
// Export a global property onto the window for React Router detection by the
|
|
2032
|
-
// Core Web Vitals Technology Report. This way they can configure the `wappalyzer`
|
|
2033
|
-
// to detect and properly classify live websites as being built with React Router:
|
|
2034
|
-
// https://github.com/HTTPArchive/wappalyzer/blob/main/src/technologies/r.json
|
|
2035
|
-
const REACT_ROUTER_VERSION = "6";
|
|
2036
|
-
try {
|
|
2037
|
-
window.__reactRouterVersion = REACT_ROUTER_VERSION;
|
|
2038
|
-
} catch (e) {
|
|
2039
|
-
// no-op
|
|
2040
|
-
}
|
|
2041
|
-
const ViewTransitionContext = /*#__PURE__*/React.createContext({
|
|
2042
|
-
isTransitioning: false
|
|
2043
|
-
});
|
|
2044
|
-
{
|
|
2045
|
-
ViewTransitionContext.displayName = "ViewTransition";
|
|
2046
|
-
}
|
|
2047
|
-
const FetchersContext = /*#__PURE__*/React.createContext(new Map());
|
|
2048
|
-
{
|
|
2049
|
-
FetchersContext.displayName = "Fetchers";
|
|
2050
|
-
}
|
|
2051
|
-
const isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
|
|
2052
|
-
const ABSOLUTE_URL_REGEX = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
|
|
2053
|
-
/**
|
|
2054
|
-
* The public API for rendering a history-aware `<a>`.
|
|
2055
|
-
*/
|
|
2056
|
-
const Link = /*#__PURE__*/React.forwardRef(function LinkWithRef(_ref7, ref) {
|
|
2057
|
-
let {
|
|
2058
|
-
onClick,
|
|
2059
|
-
relative,
|
|
2060
|
-
reloadDocument,
|
|
2061
|
-
replace,
|
|
2062
|
-
state,
|
|
2063
|
-
target,
|
|
2064
|
-
to,
|
|
2065
|
-
preventScrollReset,
|
|
2066
|
-
unstable_viewTransition
|
|
2067
|
-
} = _ref7,
|
|
2068
|
-
rest = _objectWithoutPropertiesLoose(_ref7, _excluded);
|
|
2069
|
-
let {
|
|
2070
|
-
basename
|
|
2071
|
-
} = React.useContext(NavigationContext);
|
|
2072
|
-
// Rendered into <a href> for absolute URLs
|
|
2073
|
-
let absoluteHref;
|
|
2074
|
-
let isExternal = false;
|
|
2075
|
-
if (typeof to === "string" && ABSOLUTE_URL_REGEX.test(to)) {
|
|
2076
|
-
// Render the absolute href server- and client-side
|
|
2077
|
-
absoluteHref = to;
|
|
2078
|
-
// Only check for external origins client-side
|
|
2079
|
-
if (isBrowser) {
|
|
2080
|
-
try {
|
|
2081
|
-
let currentUrl = new URL(window.location.href);
|
|
2082
|
-
let targetUrl = to.startsWith("//") ? new URL(currentUrl.protocol + to) : new URL(to);
|
|
2083
|
-
let path = stripBasename(targetUrl.pathname, basename);
|
|
2084
|
-
if (targetUrl.origin === currentUrl.origin && path != null) {
|
|
2085
|
-
// Strip the protocol/origin/basename for same-origin absolute URLs
|
|
2086
|
-
to = path + targetUrl.search + targetUrl.hash;
|
|
2087
|
-
} else {
|
|
2088
|
-
isExternal = true;
|
|
2089
|
-
}
|
|
2090
|
-
} catch (e) {
|
|
2091
|
-
// We can't do external URL detection without a valid URL
|
|
2092
|
-
warning(false, "<Link to=\"" + to + "\"> contains an invalid URL which will probably break " + "when clicked - please update to a valid URL path.") ;
|
|
2093
|
-
}
|
|
2094
|
-
}
|
|
2095
|
-
}
|
|
2096
|
-
// Rendered into <a href> for relative URLs
|
|
2097
|
-
let href = useHref(to, {
|
|
2098
|
-
relative
|
|
2099
|
-
});
|
|
2100
|
-
let internalOnClick = useLinkClickHandler(to, {
|
|
2101
|
-
replace,
|
|
2102
|
-
state,
|
|
2103
|
-
target,
|
|
2104
|
-
preventScrollReset,
|
|
2105
|
-
relative,
|
|
2106
|
-
unstable_viewTransition
|
|
2107
|
-
});
|
|
2108
|
-
function handleClick(event) {
|
|
2109
|
-
if (onClick) onClick(event);
|
|
2110
|
-
if (!event.defaultPrevented) {
|
|
2111
|
-
internalOnClick(event);
|
|
2112
|
-
}
|
|
2113
|
-
}
|
|
2114
|
-
return (
|
|
2115
|
-
/*#__PURE__*/
|
|
2116
|
-
// eslint-disable-next-line jsx-a11y/anchor-has-content
|
|
2117
|
-
React.createElement("a", _extends({}, rest, {
|
|
2118
|
-
href: absoluteHref || href,
|
|
2119
|
-
onClick: isExternal || reloadDocument ? onClick : handleClick,
|
|
2120
|
-
ref: ref,
|
|
2121
|
-
target: target
|
|
2122
|
-
}))
|
|
2123
|
-
);
|
|
2124
|
-
});
|
|
2125
|
-
{
|
|
2126
|
-
Link.displayName = "Link";
|
|
2127
|
-
}
|
|
2128
|
-
/**
|
|
2129
|
-
* A `<Link>` wrapper that knows if it's "active" or not.
|
|
2130
|
-
*/
|
|
2131
|
-
const NavLink = /*#__PURE__*/React.forwardRef(function NavLinkWithRef(_ref8, ref) {
|
|
2132
|
-
let {
|
|
2133
|
-
"aria-current": ariaCurrentProp = "page",
|
|
2134
|
-
caseSensitive = false,
|
|
2135
|
-
className: classNameProp = "",
|
|
2136
|
-
end = false,
|
|
2137
|
-
style: styleProp,
|
|
2138
|
-
to,
|
|
2139
|
-
unstable_viewTransition,
|
|
2140
|
-
children
|
|
2141
|
-
} = _ref8,
|
|
2142
|
-
rest = _objectWithoutPropertiesLoose(_ref8, _excluded2);
|
|
2143
|
-
let path = useResolvedPath(to, {
|
|
2144
|
-
relative: rest.relative
|
|
2145
|
-
});
|
|
2146
|
-
let location = useLocation();
|
|
2147
|
-
let routerState = React.useContext(DataRouterStateContext);
|
|
2148
|
-
let {
|
|
2149
|
-
navigator,
|
|
2150
|
-
basename
|
|
2151
|
-
} = React.useContext(NavigationContext);
|
|
2152
|
-
let isTransitioning = routerState != null &&
|
|
2153
|
-
// Conditional usage is OK here because the usage of a data router is static
|
|
2154
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
2155
|
-
useViewTransitionState(path) && unstable_viewTransition === true;
|
|
2156
|
-
let toPathname = navigator.encodeLocation ? navigator.encodeLocation(path).pathname : path.pathname;
|
|
2157
|
-
let locationPathname = location.pathname;
|
|
2158
|
-
let nextLocationPathname = routerState && routerState.navigation && routerState.navigation.location ? routerState.navigation.location.pathname : null;
|
|
2159
|
-
if (!caseSensitive) {
|
|
2160
|
-
locationPathname = locationPathname.toLowerCase();
|
|
2161
|
-
nextLocationPathname = nextLocationPathname ? nextLocationPathname.toLowerCase() : null;
|
|
2162
|
-
toPathname = toPathname.toLowerCase();
|
|
2163
|
-
}
|
|
2164
|
-
if (nextLocationPathname && basename) {
|
|
2165
|
-
nextLocationPathname = stripBasename(nextLocationPathname, basename) || nextLocationPathname;
|
|
2166
|
-
}
|
|
2167
|
-
// If the `to` has a trailing slash, look at that exact spot. Otherwise,
|
|
2168
|
-
// we're looking for a slash _after_ what's in `to`. For example:
|
|
2169
|
-
//
|
|
2170
|
-
// <NavLink to="/users"> and <NavLink to="/users/">
|
|
2171
|
-
// both want to look for a / at index 6 to match URL `/users/matt`
|
|
2172
|
-
const endSlashPosition = toPathname !== "/" && toPathname.endsWith("/") ? toPathname.length - 1 : toPathname.length;
|
|
2173
|
-
let isActive = locationPathname === toPathname || !end && locationPathname.startsWith(toPathname) && locationPathname.charAt(endSlashPosition) === "/";
|
|
2174
|
-
let isPending = nextLocationPathname != null && (nextLocationPathname === toPathname || !end && nextLocationPathname.startsWith(toPathname) && nextLocationPathname.charAt(toPathname.length) === "/");
|
|
2175
|
-
let renderProps = {
|
|
2176
|
-
isActive,
|
|
2177
|
-
isPending,
|
|
2178
|
-
isTransitioning
|
|
2179
|
-
};
|
|
2180
|
-
let ariaCurrent = isActive ? ariaCurrentProp : undefined;
|
|
2181
|
-
let className;
|
|
2182
|
-
if (typeof classNameProp === "function") {
|
|
2183
|
-
className = classNameProp(renderProps);
|
|
2184
|
-
} else {
|
|
2185
|
-
// If the className prop is not a function, we use a default `active`
|
|
2186
|
-
// class for <NavLink />s that are active. In v5 `active` was the default
|
|
2187
|
-
// value for `activeClassName`, but we are removing that API and can still
|
|
2188
|
-
// use the old default behavior for a cleaner upgrade path and keep the
|
|
2189
|
-
// simple styling rules working as they currently do.
|
|
2190
|
-
className = [classNameProp, isActive ? "active" : null, isPending ? "pending" : null, isTransitioning ? "transitioning" : null].filter(Boolean).join(" ");
|
|
2191
|
-
}
|
|
2192
|
-
let style = typeof styleProp === "function" ? styleProp(renderProps) : styleProp;
|
|
2193
|
-
return /*#__PURE__*/React.createElement(Link, _extends({}, rest, {
|
|
2194
|
-
"aria-current": ariaCurrent,
|
|
2195
|
-
className: className,
|
|
2196
|
-
ref: ref,
|
|
2197
|
-
style: style,
|
|
2198
|
-
to: to,
|
|
2199
|
-
unstable_viewTransition: unstable_viewTransition
|
|
2200
|
-
}), typeof children === "function" ? children(renderProps) : children);
|
|
2201
|
-
});
|
|
2202
|
-
{
|
|
2203
|
-
NavLink.displayName = "NavLink";
|
|
2204
|
-
}
|
|
2205
|
-
/**
|
|
2206
|
-
* A `@remix-run/router`-aware `<form>`. It behaves like a normal form except
|
|
2207
|
-
* that the interaction with the server is with `fetch` instead of new document
|
|
2208
|
-
* requests, allowing components to add nicer UX to the page as the form is
|
|
2209
|
-
* submitted and returns with data.
|
|
2210
|
-
*/
|
|
2211
|
-
const Form = /*#__PURE__*/React.forwardRef((_ref9, forwardedRef) => {
|
|
2212
|
-
let {
|
|
2213
|
-
fetcherKey,
|
|
2214
|
-
navigate,
|
|
2215
|
-
reloadDocument,
|
|
2216
|
-
replace,
|
|
2217
|
-
state,
|
|
2218
|
-
method = defaultMethod,
|
|
2219
|
-
action,
|
|
2220
|
-
onSubmit,
|
|
2221
|
-
relative,
|
|
2222
|
-
preventScrollReset,
|
|
2223
|
-
unstable_viewTransition
|
|
2224
|
-
} = _ref9,
|
|
2225
|
-
props = _objectWithoutPropertiesLoose(_ref9, _excluded3);
|
|
2226
|
-
let submit = useSubmit();
|
|
2227
|
-
let formAction = useFormAction(action, {
|
|
2228
|
-
relative
|
|
2229
|
-
});
|
|
2230
|
-
let formMethod = method.toLowerCase() === "get" ? "get" : "post";
|
|
2231
|
-
let submitHandler = event => {
|
|
2232
|
-
onSubmit && onSubmit(event);
|
|
2233
|
-
if (event.defaultPrevented) return;
|
|
2234
|
-
event.preventDefault();
|
|
2235
|
-
let submitter = event.nativeEvent.submitter;
|
|
2236
|
-
let submitMethod = (submitter == null ? void 0 : submitter.getAttribute("formmethod")) || method;
|
|
2237
|
-
submit(submitter || event.currentTarget, {
|
|
2238
|
-
fetcherKey,
|
|
2239
|
-
method: submitMethod,
|
|
2240
|
-
navigate,
|
|
2241
|
-
replace,
|
|
2242
|
-
state,
|
|
2243
|
-
relative,
|
|
2244
|
-
preventScrollReset,
|
|
2245
|
-
unstable_viewTransition
|
|
2246
|
-
});
|
|
2247
|
-
};
|
|
2248
|
-
return /*#__PURE__*/React.createElement("form", _extends({
|
|
2249
|
-
ref: forwardedRef,
|
|
2250
|
-
method: formMethod,
|
|
2251
|
-
action: formAction,
|
|
2252
|
-
onSubmit: reloadDocument ? onSubmit : submitHandler
|
|
2253
|
-
}, props));
|
|
2254
|
-
});
|
|
2255
|
-
{
|
|
2256
|
-
Form.displayName = "Form";
|
|
2257
|
-
}
|
|
2258
|
-
//#endregion
|
|
2259
|
-
////////////////////////////////////////////////////////////////////////////////
|
|
2260
|
-
//#region Hooks
|
|
2261
|
-
////////////////////////////////////////////////////////////////////////////////
|
|
2262
|
-
var DataRouterHook;
|
|
2263
|
-
(function (DataRouterHook) {
|
|
2264
|
-
DataRouterHook["UseScrollRestoration"] = "useScrollRestoration";
|
|
2265
|
-
DataRouterHook["UseSubmit"] = "useSubmit";
|
|
2266
|
-
DataRouterHook["UseSubmitFetcher"] = "useSubmitFetcher";
|
|
2267
|
-
DataRouterHook["UseFetcher"] = "useFetcher";
|
|
2268
|
-
DataRouterHook["useViewTransitionState"] = "useViewTransitionState";
|
|
2269
|
-
})(DataRouterHook || (DataRouterHook = {}));
|
|
2270
|
-
var DataRouterStateHook;
|
|
2271
|
-
(function (DataRouterStateHook) {
|
|
2272
|
-
DataRouterStateHook["UseFetcher"] = "useFetcher";
|
|
2273
|
-
DataRouterStateHook["UseFetchers"] = "useFetchers";
|
|
2274
|
-
DataRouterStateHook["UseScrollRestoration"] = "useScrollRestoration";
|
|
2275
|
-
})(DataRouterStateHook || (DataRouterStateHook = {}));
|
|
2276
|
-
// Internal hooks
|
|
2277
|
-
function getDataRouterConsoleError(hookName) {
|
|
2278
|
-
return hookName + " must be used within a data router. See https://reactrouter.com/routers/picking-a-router.";
|
|
2279
|
-
}
|
|
2280
|
-
function useDataRouterContext(hookName) {
|
|
2281
|
-
let ctx = React.useContext(DataRouterContext);
|
|
2282
|
-
!ctx ? invariant(false, getDataRouterConsoleError(hookName)) : void 0;
|
|
2283
|
-
return ctx;
|
|
2284
|
-
}
|
|
2285
|
-
// External hooks
|
|
2286
|
-
/**
|
|
2287
|
-
* Handles the click behavior for router `<Link>` components. This is useful if
|
|
2288
|
-
* you need to create custom `<Link>` components with the same click behavior we
|
|
2289
|
-
* use in our exported `<Link>`.
|
|
2290
|
-
*/
|
|
2291
|
-
function useLinkClickHandler(to, _temp) {
|
|
2292
|
-
let {
|
|
2293
|
-
target,
|
|
2294
|
-
replace: replaceProp,
|
|
2295
|
-
state,
|
|
2296
|
-
preventScrollReset,
|
|
2297
|
-
relative,
|
|
2298
|
-
unstable_viewTransition
|
|
2299
|
-
} = _temp === void 0 ? {} : _temp;
|
|
2300
|
-
let navigate = useNavigate();
|
|
2301
|
-
let location = useLocation();
|
|
2302
|
-
let path = useResolvedPath(to, {
|
|
2303
|
-
relative
|
|
2304
|
-
});
|
|
2305
|
-
return React.useCallback(event => {
|
|
2306
|
-
if (shouldProcessLinkClick(event, target)) {
|
|
2307
|
-
event.preventDefault();
|
|
2308
|
-
// If the URL hasn't changed, a regular <a> will do a replace instead of
|
|
2309
|
-
// a push, so do the same here unless the replace prop is explicitly set
|
|
2310
|
-
let replace = replaceProp !== undefined ? replaceProp : createPath(location) === createPath(path);
|
|
2311
|
-
navigate(to, {
|
|
2312
|
-
replace,
|
|
2313
|
-
state,
|
|
2314
|
-
preventScrollReset,
|
|
2315
|
-
relative,
|
|
2316
|
-
unstable_viewTransition
|
|
2317
|
-
});
|
|
2318
|
-
}
|
|
2319
|
-
}, [location, navigate, path, replaceProp, state, target, to, preventScrollReset, relative, unstable_viewTransition]);
|
|
2320
|
-
}
|
|
2321
|
-
function validateClientSideSubmission() {
|
|
2322
|
-
if (typeof document === "undefined") {
|
|
2323
|
-
throw new Error("You are calling submit during the server render. " + "Try calling submit within a `useEffect` or callback instead.");
|
|
2324
|
-
}
|
|
2325
|
-
}
|
|
2326
|
-
let fetcherId = 0;
|
|
2327
|
-
let getUniqueFetcherId = () => "__" + String(++fetcherId) + "__";
|
|
2328
|
-
/**
|
|
2329
|
-
* Returns a function that may be used to programmatically submit a form (or
|
|
2330
|
-
* some arbitrary data) to the server.
|
|
2331
|
-
*/
|
|
2332
|
-
function useSubmit() {
|
|
2333
|
-
let {
|
|
2334
|
-
router
|
|
2335
|
-
} = useDataRouterContext(DataRouterHook.UseSubmit);
|
|
2336
|
-
let {
|
|
2337
|
-
basename
|
|
2338
|
-
} = React.useContext(NavigationContext);
|
|
2339
|
-
let currentRouteId = useRouteId();
|
|
2340
|
-
return React.useCallback(function (target, options) {
|
|
2341
|
-
if (options === void 0) {
|
|
2342
|
-
options = {};
|
|
2343
|
-
}
|
|
2344
|
-
validateClientSideSubmission();
|
|
2345
|
-
let {
|
|
2346
|
-
action,
|
|
2347
|
-
method,
|
|
2348
|
-
encType,
|
|
2349
|
-
formData,
|
|
2350
|
-
body
|
|
2351
|
-
} = getFormSubmissionInfo(target, basename);
|
|
2352
|
-
if (options.navigate === false) {
|
|
2353
|
-
let key = options.fetcherKey || getUniqueFetcherId();
|
|
2354
|
-
router.fetch(key, currentRouteId, options.action || action, {
|
|
2355
|
-
preventScrollReset: options.preventScrollReset,
|
|
2356
|
-
formData,
|
|
2357
|
-
body,
|
|
2358
|
-
formMethod: options.method || method,
|
|
2359
|
-
formEncType: options.encType || encType,
|
|
2360
|
-
unstable_flushSync: options.unstable_flushSync
|
|
2361
|
-
});
|
|
2362
|
-
} else {
|
|
2363
|
-
router.navigate(options.action || action, {
|
|
2364
|
-
preventScrollReset: options.preventScrollReset,
|
|
2365
|
-
formData,
|
|
2366
|
-
body,
|
|
2367
|
-
formMethod: options.method || method,
|
|
2368
|
-
formEncType: options.encType || encType,
|
|
2369
|
-
replace: options.replace,
|
|
2370
|
-
state: options.state,
|
|
2371
|
-
fromRouteId: currentRouteId,
|
|
2372
|
-
unstable_flushSync: options.unstable_flushSync,
|
|
2373
|
-
unstable_viewTransition: options.unstable_viewTransition
|
|
2374
|
-
});
|
|
2375
|
-
}
|
|
2376
|
-
}, [router, basename, currentRouteId]);
|
|
2377
|
-
}
|
|
2378
|
-
// v7: Eventually we should deprecate this entirely in favor of using the
|
|
2379
|
-
// router method directly?
|
|
2380
|
-
function useFormAction(action, _temp2) {
|
|
2381
|
-
let {
|
|
2382
|
-
relative
|
|
2383
|
-
} = _temp2 === void 0 ? {} : _temp2;
|
|
2384
|
-
let {
|
|
2385
|
-
basename
|
|
2386
|
-
} = React.useContext(NavigationContext);
|
|
2387
|
-
let routeContext = React.useContext(RouteContext);
|
|
2388
|
-
!routeContext ? invariant(false, "useFormAction must be used inside a RouteContext") : void 0;
|
|
2389
|
-
let [match] = routeContext.matches.slice(-1);
|
|
2390
|
-
// Shallow clone path so we can modify it below, otherwise we modify the
|
|
2391
|
-
// object referenced by useMemo inside useResolvedPath
|
|
2392
|
-
let path = _extends({}, useResolvedPath(action ? action : ".", {
|
|
2393
|
-
relative
|
|
2394
|
-
}));
|
|
2395
|
-
// If no action was specified, browsers will persist current search params
|
|
2396
|
-
// when determining the path, so match that behavior
|
|
2397
|
-
// https://github.com/remix-run/remix/issues/927
|
|
2398
|
-
let location = useLocation();
|
|
2399
|
-
if (action == null) {
|
|
2400
|
-
// Safe to write to this directly here since if action was undefined, we
|
|
2401
|
-
// would have called useResolvedPath(".") which will never include a search
|
|
2402
|
-
path.search = location.search;
|
|
2403
|
-
// When grabbing search params from the URL, remove any included ?index param
|
|
2404
|
-
// since it might not apply to our contextual route. We add it back based
|
|
2405
|
-
// on match.route.index below
|
|
2406
|
-
let params = new URLSearchParams(path.search);
|
|
2407
|
-
if (params.has("index") && params.get("index") === "") {
|
|
2408
|
-
params.delete("index");
|
|
2409
|
-
path.search = params.toString() ? "?" + params.toString() : "";
|
|
2410
|
-
}
|
|
2411
|
-
}
|
|
2412
|
-
if ((!action || action === ".") && match.route.index) {
|
|
2413
|
-
path.search = path.search ? path.search.replace(/^\?/, "?index&") : "?index";
|
|
2414
|
-
}
|
|
2415
|
-
// If we're operating within a basename, prepend it to the pathname prior
|
|
2416
|
-
// to creating the form action. If this is a root navigation, then just use
|
|
2417
|
-
// the raw basename which allows the basename to have full control over the
|
|
2418
|
-
// presence of a trailing slash on root actions
|
|
2419
|
-
if (basename !== "/") {
|
|
2420
|
-
path.pathname = path.pathname === "/" ? basename : joinPaths([basename, path.pathname]);
|
|
2421
|
-
}
|
|
2422
|
-
return createPath(path);
|
|
2423
|
-
}
|
|
2424
|
-
/**
|
|
2425
|
-
* Return a boolean indicating if there is an active view transition to the
|
|
2426
|
-
* given href. You can use this value to render CSS classes or viewTransitionName
|
|
2427
|
-
* styles onto your elements
|
|
2428
|
-
*
|
|
2429
|
-
* @param href The destination href
|
|
2430
|
-
* @param [opts.relative] Relative routing type ("route" | "path")
|
|
2431
|
-
*/
|
|
2432
|
-
function useViewTransitionState(to, opts) {
|
|
2433
|
-
if (opts === void 0) {
|
|
2434
|
-
opts = {};
|
|
2435
|
-
}
|
|
2436
|
-
let vtContext = React.useContext(ViewTransitionContext);
|
|
2437
|
-
!(vtContext != null) ? invariant(false, "`unstable_useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. " + "Did you accidentally import `RouterProvider` from `react-router`?") : void 0;
|
|
2438
|
-
let {
|
|
2439
|
-
basename
|
|
2440
|
-
} = useDataRouterContext(DataRouterHook.useViewTransitionState);
|
|
2441
|
-
let path = useResolvedPath(to, {
|
|
2442
|
-
relative: opts.relative
|
|
2443
|
-
});
|
|
2444
|
-
if (!vtContext.isTransitioning) {
|
|
2445
|
-
return false;
|
|
2446
|
-
}
|
|
2447
|
-
let currentPath = stripBasename(vtContext.currentLocation.pathname, basename) || vtContext.currentLocation.pathname;
|
|
2448
|
-
let nextPath = stripBasename(vtContext.nextLocation.pathname, basename) || vtContext.nextLocation.pathname;
|
|
2449
|
-
// Transition is active if we're going to or coming from the indicated
|
|
2450
|
-
// destination. This ensures that other PUSH navigations that reverse
|
|
2451
|
-
// an indicated transition apply. I.e., on the list view you have:
|
|
2452
|
-
//
|
|
2453
|
-
// <NavLink to="/details/1" unstable_viewTransition>
|
|
2454
|
-
//
|
|
2455
|
-
// If you click the breadcrumb back to the list view:
|
|
2456
|
-
//
|
|
2457
|
-
// <NavLink to="/list" unstable_viewTransition>
|
|
2458
|
-
//
|
|
2459
|
-
// We should apply the transition because it's indicated as active going
|
|
2460
|
-
// from /list -> /details/1 and therefore should be active on the reverse
|
|
2461
|
-
// (even though this isn't strictly a POP reverse)
|
|
2462
|
-
return matchPath(path.pathname, nextPath) != null || matchPath(path.pathname, currentPath) != null;
|
|
2463
|
-
}
|
|
2464
|
-
|
|
2465
1173
|
var css_248z$5 = ":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-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-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}\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-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-radius: var(--border-radius);\n --rpf-button-lg-height: 48px;\n --rpf-button-sm-height: 32px;\n /* 44px min-height to meet WCAG AAA target size requirements */\n --rpf-button-min-target-size: 44px;\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-background-color);\n border-radius: var(--rpf-button-border-radius);\n border-style: solid;\n border-width: 2px;\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-background-color-hover);\n}\n.rpf-button:active::before {\n background-color: var(--rpf-button-background-color-active);\n border-color: var(--rpf-button-background-color-active);\n}\n.rpf-button:focus-visible::before {\n outline: 2px 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-background-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-background-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-background-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-background-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--danger {\n --rpf-button-background-color: var(--rpf-alert-error);\n --rpf-button-background-color-hover: var(--rpf-alert-error);\n --rpf-button-background-color-active: var(--rpf-red-900);\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";
|
|
2466
1174
|
styleInject(css_248z$5);
|
|
2467
1175
|
|
|
2468
1176
|
/* eslint-disable complexity */
|
|
2469
1177
|
const Button = ({
|
|
2470
1178
|
text,
|
|
2471
|
-
type,
|
|
2472
|
-
variant,
|
|
2473
|
-
size,
|
|
2474
|
-
icon,
|
|
2475
|
-
iconOnly,
|
|
2476
|
-
iconPosition,
|
|
2477
|
-
fullWidth,
|
|
2478
|
-
disabled,
|
|
2479
1179
|
href,
|
|
2480
1180
|
title,
|
|
2481
1181
|
className,
|
|
2482
|
-
|
|
2483
|
-
"
|
|
1182
|
+
ariaLabel = "",
|
|
1183
|
+
type = "primary",
|
|
1184
|
+
variant = "",
|
|
1185
|
+
size = "default",
|
|
1186
|
+
icon = "",
|
|
1187
|
+
iconOnly = false,
|
|
1188
|
+
iconPosition = "left",
|
|
1189
|
+
fullWidth = false,
|
|
1190
|
+
disabled = false,
|
|
1191
|
+
onClick = () => {}
|
|
2484
1192
|
}) => {
|
|
2485
1193
|
const iconButton = icon && iconOnly;
|
|
2486
1194
|
const classes = classNames(
|
|
@@ -2496,28 +1204,28 @@ const Button = ({
|
|
|
2496
1204
|
disabled
|
|
2497
1205
|
}, className);
|
|
2498
1206
|
let iconClasses = "rpf-button__icon";
|
|
2499
|
-
if ( /*#__PURE__*/
|
|
1207
|
+
if ( /*#__PURE__*/React.isValidElement(icon)) {
|
|
2500
1208
|
iconClasses += " icon";
|
|
2501
1209
|
console.warn("DEPRECATED: icons as React elements will not be supported in future releases");
|
|
2502
1210
|
} else {
|
|
2503
1211
|
iconClasses += " material-symbols-sharp";
|
|
2504
1212
|
}
|
|
2505
|
-
const renderIcon = position => icon && iconPosition === position && /*#__PURE__*/
|
|
1213
|
+
const renderIcon = position => icon && iconPosition === position && /*#__PURE__*/React.createElement("span", {
|
|
2506
1214
|
className: iconClasses
|
|
2507
1215
|
}, icon);
|
|
2508
|
-
const renderText = () => text && !iconButton && /*#__PURE__*/
|
|
1216
|
+
const renderText = () => text && !iconButton && /*#__PURE__*/React.createElement("span", {
|
|
2509
1217
|
className: "text"
|
|
2510
1218
|
}, text);
|
|
2511
|
-
const content = /*#__PURE__*/
|
|
1219
|
+
const content = /*#__PURE__*/React.createElement(React.Fragment, null, renderIcon("left"), renderText(), renderIcon("right"));
|
|
2512
1220
|
if (href) {
|
|
2513
|
-
return /*#__PURE__*/
|
|
1221
|
+
return /*#__PURE__*/React.createElement(Link, {
|
|
2514
1222
|
className: classes,
|
|
2515
1223
|
"aria-label": ariaLabel,
|
|
2516
1224
|
to: href,
|
|
2517
1225
|
onClick: onClick
|
|
2518
1226
|
}, content);
|
|
2519
1227
|
}
|
|
2520
|
-
return /*#__PURE__*/
|
|
1228
|
+
return /*#__PURE__*/React.createElement("button", {
|
|
2521
1229
|
className: classes,
|
|
2522
1230
|
title: title,
|
|
2523
1231
|
"aria-label": ariaLabel,
|
|
@@ -2534,25 +1242,13 @@ Button.propTypes = {
|
|
|
2534
1242
|
onClick: PropTypes.func,
|
|
2535
1243
|
text: PropTypes.string,
|
|
2536
1244
|
iconOnly: PropTypes.bool,
|
|
2537
|
-
|
|
1245
|
+
ariaLabel: PropTypes.string,
|
|
2538
1246
|
title: PropTypes.string,
|
|
2539
1247
|
iconPosition: PropTypes.oneOf(["left", "right"]),
|
|
2540
1248
|
size: PropTypes.oneOf(["default", "small"]) // added size prop
|
|
2541
1249
|
};
|
|
2542
|
-
Button.defaultProps = {
|
|
2543
|
-
type: "primary",
|
|
2544
|
-
variant: "",
|
|
2545
|
-
size: "default",
|
|
2546
|
-
icon: "",
|
|
2547
|
-
iconOnly: false,
|
|
2548
|
-
iconPosition: "left",
|
|
2549
|
-
fullWidth: false,
|
|
2550
|
-
disabled: false,
|
|
2551
|
-
onClick: () => {},
|
|
2552
|
-
"aria-label": ""
|
|
2553
|
-
};
|
|
2554
1250
|
|
|
2555
|
-
var css_248z$4 = ":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}\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-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}\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 --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 {\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 gap: var(--space-2);\n margin-block-end: var(--space-2);\n padding-block: var(--space-2);\n padding-inline: var(--space-2);\n text-align: center;\n}\n.rpf-alert__icon {\n align-self: flex-start;\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 display: flex;\n flex-direction: column;\n text-align: start;\n}\n.rpf-alert__title {\n font-weight: var(--font-weight-bold);\n margin: 0;\n}\n.rpf-alert__actions {\n display: flex;\n flex-direction: row;\n gap: var(--space-2);\n}\n.rpf-alert__close {\n align-self: flex-start;\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}\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-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.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-radius: var(--border-radius);\n --rpf-button-lg-height: 48px;\n --rpf-button-sm-height: 32px;\n /* 44px min-height to meet WCAG AAA target size requirements */\n --rpf-button-min-target-size: 44px;\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-background-color);\n border-radius: var(--rpf-button-border-radius);\n border-style: solid;\n border-width: 2px;\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-background-color-hover);\n}\n.rpf-button:active::before {\n background-color: var(--rpf-button-background-color-active);\n border-color: var(--rpf-button-background-color-active);\n}\n.rpf-button:focus-visible::before {\n outline: 2px 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-background-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-background-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-background-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-background-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--danger {\n --rpf-button-background-color: var(--rpf-alert-error);\n --rpf-button-background-color-hover: var(--rpf-alert-error);\n --rpf-button-background-color-active: var(--rpf-red-900);\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";
|
|
1251
|
+
var css_248z$4 = ":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}\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-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}\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 --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 {\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 gap: var(--space-2);\n margin-block-end: var(--space-2);\n padding-block: var(--space-2);\n padding-inline: var(--space-2);\n text-align: center;\n}\n.rpf-alert__icon {\n align-self: flex-start;\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 display: flex;\n flex-direction: column;\n text-align: start;\n}\n.rpf-alert__title {\n font-weight: var(--font-weight-bold);\n margin: 0;\n}\n.rpf-alert__actions {\n display: flex;\n flex-direction: row;\n gap: var(--space-2);\n}\n.rpf-alert__close {\n align-self: flex-start;\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}\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-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.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-radius: var(--border-radius);\n --rpf-button-lg-height: 48px;\n --rpf-button-sm-height: 32px;\n /* 44px min-height to meet WCAG AAA target size requirements */\n --rpf-button-min-target-size: 44px;\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-background-color);\n border-radius: var(--rpf-button-border-radius);\n border-style: solid;\n border-width: 2px;\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-background-color-hover);\n}\n.rpf-button:active::before {\n background-color: var(--rpf-button-background-color-active);\n border-color: var(--rpf-button-background-color-active);\n}\n.rpf-button:focus-visible::before {\n outline: 2px 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-background-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-background-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-background-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-background-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--danger {\n --rpf-button-background-color: var(--rpf-alert-error);\n --rpf-button-background-color-hover: var(--rpf-alert-error);\n --rpf-button-background-color-active: var(--rpf-red-900);\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\np {\n margin-block-end: 0;\n}\n\n.rpf-alert__actions .rpf-button {\n padding-inline-start: 0;\n padding-block-end: 0;\n}\n";
|
|
2556
1252
|
styleInject(css_248z$4);
|
|
2557
1253
|
|
|
2558
1254
|
/* eslint-disable complexity */
|
|
@@ -2561,18 +1257,18 @@ const Alert = ({
|
|
|
2561
1257
|
text,
|
|
2562
1258
|
type,
|
|
2563
1259
|
actions
|
|
2564
|
-
}) => /*#__PURE__*/
|
|
1260
|
+
}) => /*#__PURE__*/React.createElement("div", {
|
|
2565
1261
|
className: `rpf-alert rpf-alert--${type}`
|
|
2566
|
-
}, /*#__PURE__*/
|
|
1262
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
2567
1263
|
className: "rpf-alert__icon material-symbols-sharp"
|
|
2568
|
-
}), /*#__PURE__*/
|
|
1264
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
2569
1265
|
className: "rpf-alert__body"
|
|
2570
|
-
}, /*#__PURE__*/
|
|
1266
|
+
}, /*#__PURE__*/React.createElement("p", {
|
|
2571
1267
|
className: "rpf-alert__title"
|
|
2572
|
-
}, title), /*#__PURE__*/
|
|
1268
|
+
}, title), /*#__PURE__*/React.createElement("p", null, text), actions && actions.length > 0 && /*#__PURE__*/React.createElement("div", {
|
|
2573
1269
|
className: "rpf-alert__actions"
|
|
2574
|
-
}, actions.map(action => /*#__PURE__*/
|
|
2575
|
-
key: action.label,
|
|
1270
|
+
}, actions.map(action => /*#__PURE__*/React.createElement(Button, {
|
|
1271
|
+
key: action.key || action.label,
|
|
2576
1272
|
text: action.label,
|
|
2577
1273
|
size: "small",
|
|
2578
1274
|
type: "tertiary",
|
|
@@ -2594,15 +1290,15 @@ styleInject(css_248z$3);
|
|
|
2594
1290
|
|
|
2595
1291
|
/* eslint-disable complexity */
|
|
2596
1292
|
const ProgressBar = ({
|
|
2597
|
-
text,
|
|
1293
|
+
text = "",
|
|
2598
1294
|
percent
|
|
2599
|
-
}) => /*#__PURE__*/
|
|
1295
|
+
}) => /*#__PURE__*/React.createElement("div", {
|
|
2600
1296
|
className: "rpf-progress-bar"
|
|
2601
|
-
}, text && /*#__PURE__*/
|
|
1297
|
+
}, text && /*#__PURE__*/React.createElement("div", {
|
|
2602
1298
|
className: "rpf-progress-bar__step"
|
|
2603
|
-
}, text), /*#__PURE__*/
|
|
1299
|
+
}, text), /*#__PURE__*/React.createElement("div", {
|
|
2604
1300
|
className: "rpf-progress-bar__bar"
|
|
2605
|
-
}, /*#__PURE__*/
|
|
1301
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
2606
1302
|
className: "rpf-progress-bar__progress",
|
|
2607
1303
|
style: {
|
|
2608
1304
|
width: `${percent}%`
|
|
@@ -2612,27 +1308,24 @@ ProgressBar.propTypes = {
|
|
|
2612
1308
|
text: PropTypes.string,
|
|
2613
1309
|
percent: PropTypes.number.isRequired
|
|
2614
1310
|
};
|
|
2615
|
-
ProgressBar.defaultProps = {
|
|
2616
|
-
text: ""
|
|
2617
|
-
};
|
|
2618
1311
|
|
|
2619
1312
|
var css_248z$2 = ":root, :host {\n --border-radius: var(--space-1);\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}\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-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}\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:focus-visible {\n outline: 3px solid var(--rpf-input-outline-color);\n}\n.rpf-input:disabled, .rpf-input--disabled {\n background-color: var(--rpf-input-background-color-disabled);\n border-color: var(--rpf-input-background-color-disabled);\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 {\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-checkbox {\n --rpf-input-checkbox-hit-target: 44px;\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 {\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-end: var(--space-1);\n}\n.rpf-error-message__icon {\n margin-inline-end: var(--space-1);\n padding-block: var(--space-1);\n}\n";
|
|
2620
1313
|
styleInject(css_248z$2);
|
|
2621
1314
|
|
|
2622
1315
|
const CheckboxInput = ({
|
|
2623
|
-
checked,
|
|
2624
|
-
disabled,
|
|
2625
|
-
error,
|
|
2626
1316
|
id,
|
|
2627
1317
|
label,
|
|
2628
1318
|
name,
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
1319
|
+
checked = false,
|
|
1320
|
+
disabled = false,
|
|
1321
|
+
error = "",
|
|
1322
|
+
onChange = () => {},
|
|
1323
|
+
value = ""
|
|
1324
|
+
}) => /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("label", {
|
|
2632
1325
|
className: classNames("rpf-input-checkbox", {
|
|
2633
1326
|
"rpf-input-checkbox--error": error
|
|
2634
1327
|
})
|
|
2635
|
-
}, /*#__PURE__*/
|
|
1328
|
+
}, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("input", {
|
|
2636
1329
|
checked: !!checked,
|
|
2637
1330
|
disabled: disabled,
|
|
2638
1331
|
id: id,
|
|
@@ -2640,11 +1333,11 @@ const CheckboxInput = ({
|
|
|
2640
1333
|
onChange: onChange,
|
|
2641
1334
|
type: "checkbox",
|
|
2642
1335
|
value: value
|
|
2643
|
-
})), /*#__PURE__*/
|
|
1336
|
+
})), /*#__PURE__*/React.createElement("span", {
|
|
2644
1337
|
className: "checkmark"
|
|
2645
|
-
}), label), error && /*#__PURE__*/
|
|
1338
|
+
}), label), error && /*#__PURE__*/React.createElement("div", {
|
|
2646
1339
|
className: "rpf-error-message"
|
|
2647
|
-
}, /*#__PURE__*/
|
|
1340
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
2648
1341
|
className: "rpf-error-message__icon material-symbols-sharp"
|
|
2649
1342
|
}, "error"), error));
|
|
2650
1343
|
CheckboxInput.propTypes = {
|
|
@@ -2657,33 +1350,26 @@ CheckboxInput.propTypes = {
|
|
|
2657
1350
|
onChange: PropTypes.func,
|
|
2658
1351
|
value: PropTypes.string
|
|
2659
1352
|
};
|
|
2660
|
-
CheckboxInput.defaultProps = {
|
|
2661
|
-
checked: true,
|
|
2662
|
-
disabled: false,
|
|
2663
|
-
error: "",
|
|
2664
|
-
onChange: () => {},
|
|
2665
|
-
value: "on"
|
|
2666
|
-
};
|
|
2667
1353
|
|
|
2668
1354
|
const InputField = ({
|
|
2669
|
-
disabled,
|
|
2670
|
-
error,
|
|
2671
|
-
hint,
|
|
2672
1355
|
label,
|
|
2673
1356
|
name,
|
|
2674
|
-
children
|
|
2675
|
-
|
|
1357
|
+
children,
|
|
1358
|
+
disabled = false,
|
|
1359
|
+
error = "",
|
|
1360
|
+
hint = ""
|
|
1361
|
+
}) => /*#__PURE__*/React.createElement("div", {
|
|
2676
1362
|
className: "rpf-input-field"
|
|
2677
|
-
}, (label || hint) && /*#__PURE__*/
|
|
1363
|
+
}, (label || hint) && /*#__PURE__*/React.createElement("label", {
|
|
2678
1364
|
htmlFor: name,
|
|
2679
1365
|
className: classNames("rpf-label", {
|
|
2680
1366
|
"rpf-label--disabled": disabled
|
|
2681
1367
|
})
|
|
2682
|
-
}, label, /*#__PURE__*/
|
|
1368
|
+
}, label, /*#__PURE__*/React.createElement("small", {
|
|
2683
1369
|
className: "rpf-label__hint"
|
|
2684
|
-
}, hint)), children, error && /*#__PURE__*/
|
|
1370
|
+
}, hint)), children, error && /*#__PURE__*/React.createElement("div", {
|
|
2685
1371
|
className: "rpf-error-message"
|
|
2686
|
-
}, /*#__PURE__*/
|
|
1372
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
2687
1373
|
className: "rpf-error-message__icon material-symbols-sharp"
|
|
2688
1374
|
}, "error"), error));
|
|
2689
1375
|
InputField.propTypes = {
|
|
@@ -2693,34 +1379,29 @@ InputField.propTypes = {
|
|
|
2693
1379
|
label: PropTypes.oneOfType([PropTypes.string, PropTypes.object]).isRequired,
|
|
2694
1380
|
name: PropTypes.string.isRequired
|
|
2695
1381
|
};
|
|
2696
|
-
InputField.defaultProps = {
|
|
2697
|
-
disabled: false,
|
|
2698
|
-
error: "",
|
|
2699
|
-
hint: ""
|
|
2700
|
-
};
|
|
2701
1382
|
|
|
2702
1383
|
var css_248z$1 = ":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 {\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-end: var(--space-1);\n}\n.rpf-error-message__icon {\n margin-inline-end: var(--space-1);\n padding-block: 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}\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 {\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-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}\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-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:focus-visible {\n outline: 3px solid var(--rpf-input-outline-color);\n}\n.rpf-input:disabled, .rpf-input--disabled {\n background-color: var(--rpf-input-background-color-disabled);\n border-color: var(--rpf-input-background-color-disabled);\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";
|
|
2703
1384
|
styleInject(css_248z$1);
|
|
2704
1385
|
|
|
2705
1386
|
const SelectInput = ({
|
|
2706
|
-
disabled,
|
|
2707
|
-
error,
|
|
2708
|
-
fullWidth,
|
|
2709
|
-
hint,
|
|
2710
1387
|
id,
|
|
2711
1388
|
label,
|
|
2712
1389
|
name,
|
|
2713
|
-
onChange,
|
|
2714
1390
|
options,
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
1391
|
+
disabled = false,
|
|
1392
|
+
error = "",
|
|
1393
|
+
fullWidth = false,
|
|
1394
|
+
hint = "",
|
|
1395
|
+
onChange = () => {},
|
|
1396
|
+
placeholder = "",
|
|
1397
|
+
value = ""
|
|
1398
|
+
}) => /*#__PURE__*/React.createElement(InputField, {
|
|
2718
1399
|
disabled: disabled,
|
|
2719
1400
|
error: error,
|
|
2720
1401
|
hint: hint,
|
|
2721
1402
|
label: label,
|
|
2722
1403
|
name: name
|
|
2723
|
-
}, /*#__PURE__*/
|
|
1404
|
+
}, /*#__PURE__*/React.createElement("select", {
|
|
2724
1405
|
className: classNames("rpf-input rpf-input-select", {
|
|
2725
1406
|
"rpf-input--error": error,
|
|
2726
1407
|
"rpf-input--full-width": fullWidth
|
|
@@ -2731,10 +1412,10 @@ const SelectInput = ({
|
|
|
2731
1412
|
onChange: onChange,
|
|
2732
1413
|
type: "text",
|
|
2733
1414
|
value: value
|
|
2734
|
-
}, !value && !!placeholder && /*#__PURE__*/
|
|
1415
|
+
}, !value && !!placeholder && /*#__PURE__*/React.createElement("option", {
|
|
2735
1416
|
value: "",
|
|
2736
1417
|
disabled: true
|
|
2737
|
-
}, placeholder), options.map(option => /*#__PURE__*/
|
|
1418
|
+
}, placeholder), options.map(option => /*#__PURE__*/React.createElement("option", {
|
|
2738
1419
|
value: option.key,
|
|
2739
1420
|
key: option.key
|
|
2740
1421
|
}, option.value))));
|
|
@@ -2751,36 +1432,27 @@ SelectInput.propTypes = {
|
|
|
2751
1432
|
placeholder: PropTypes.string,
|
|
2752
1433
|
value: PropTypes.string
|
|
2753
1434
|
};
|
|
2754
|
-
SelectInput.defaultProps = {
|
|
2755
|
-
disabled: false,
|
|
2756
|
-
error: "",
|
|
2757
|
-
fullWidth: false,
|
|
2758
|
-
hint: "",
|
|
2759
|
-
onChange: () => {},
|
|
2760
|
-
placeholder: "",
|
|
2761
|
-
value: ""
|
|
2762
|
-
};
|
|
2763
1435
|
|
|
2764
1436
|
var css_248z = ":root, :host {\n --border-radius: var(--space-1);\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}\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-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}\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:focus-visible {\n outline: 3px solid var(--rpf-input-outline-color);\n}\n.rpf-input:disabled, .rpf-input--disabled {\n background-color: var(--rpf-input-background-color-disabled);\n border-color: var(--rpf-input-background-color-disabled);\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 {\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 {\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-end: var(--space-1);\n}\n.rpf-error-message__icon {\n margin-inline-end: var(--space-1);\n padding-block: var(--space-1);\n}\n";
|
|
2765
1437
|
styleInject(css_248z);
|
|
2766
1438
|
|
|
2767
1439
|
const TextInput = ({
|
|
2768
|
-
disabled,
|
|
2769
|
-
error,
|
|
2770
|
-
fullWidth,
|
|
2771
|
-
hint,
|
|
2772
1440
|
id,
|
|
2773
1441
|
label,
|
|
2774
1442
|
name,
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
1443
|
+
value,
|
|
1444
|
+
disabled = false,
|
|
1445
|
+
error = "",
|
|
1446
|
+
fullWidth = false,
|
|
1447
|
+
hint = "",
|
|
1448
|
+
onChange = () => {}
|
|
1449
|
+
}) => /*#__PURE__*/React.createElement(InputField, {
|
|
2778
1450
|
disabled: disabled,
|
|
2779
1451
|
error: error,
|
|
2780
1452
|
hint: hint,
|
|
2781
1453
|
label: label,
|
|
2782
1454
|
name: name
|
|
2783
|
-
}, /*#__PURE__*/
|
|
1455
|
+
}, /*#__PURE__*/React.createElement("input", {
|
|
2784
1456
|
className: classNames("rpf-input rpf-input-text", {
|
|
2785
1457
|
"rpf-input--error": error,
|
|
2786
1458
|
"rpf-input--full-width": fullWidth
|
|
@@ -2803,12 +1475,5 @@ TextInput.propTypes = {
|
|
|
2803
1475
|
onChange: PropTypes.func,
|
|
2804
1476
|
value: PropTypes.string.isRequired
|
|
2805
1477
|
};
|
|
2806
|
-
TextInput.defaultProps = {
|
|
2807
|
-
disabled: false,
|
|
2808
|
-
error: "",
|
|
2809
|
-
fullWidth: false,
|
|
2810
|
-
hint: "",
|
|
2811
|
-
onChange: () => {}
|
|
2812
|
-
};
|
|
2813
1478
|
|
|
2814
1479
|
export { Accordion, Alert, Button, CheckboxInput, InputField, ProgressBar, SelectInput, TextInput };
|