@arbeidstilsynet/design-react 0.4.1 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +229 -115
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +236 -122
- package/dist/index.js.map +1 -1
- package/dist/src/components/filepicker/filepickerContext.d.ts +1 -1
- package/dist/src/components/header/headerTitle.d.ts +2 -1
- package/dist/src/components/header/headerTitleDropdown.d.ts +2 -1
- package/dist/src/components/header/headerTitleLinks.d.ts +3 -2
- package/dist/src/components/header/index.d.ts +19 -0
- package/dist/src/components/hooks/useIsomorphicLayoutEffect.d.ts +2 -0
- package/dist/src/components/hooks/useMediaQuery.d.ts +6 -0
- package/package.json +19 -19
package/dist/index.cjs
CHANGED
|
@@ -5,6 +5,7 @@ const require$$0 = require("react");
|
|
|
5
5
|
const akselIcons = require("@navikt/aksel-icons");
|
|
6
6
|
const reactDropzone = require("react-dropzone");
|
|
7
7
|
const designsystemetReact = require("@digdir/designsystemet-react");
|
|
8
|
+
const reactSlot = require("@radix-ui/react-slot");
|
|
8
9
|
var jsxRuntime = { exports: {} };
|
|
9
10
|
var reactJsxRuntime_production = {};
|
|
10
11
|
var hasRequiredReactJsxRuntime_production;
|
|
@@ -40,7 +41,7 @@ var hasRequiredReactJsxRuntime_development;
|
|
|
40
41
|
function requireReactJsxRuntime_development() {
|
|
41
42
|
if (hasRequiredReactJsxRuntime_development) return reactJsxRuntime_development;
|
|
42
43
|
hasRequiredReactJsxRuntime_development = 1;
|
|
43
|
-
"production" !== process.env.NODE_ENV && function() {
|
|
44
|
+
"production" !== process.env.NODE_ENV && (function() {
|
|
44
45
|
function getComponentNameFromType(type) {
|
|
45
46
|
if (null == type) return null;
|
|
46
47
|
if ("function" === typeof type)
|
|
@@ -289,7 +290,7 @@ function requireReactJsxRuntime_development() {
|
|
|
289
290
|
trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
|
|
290
291
|
);
|
|
291
292
|
};
|
|
292
|
-
}();
|
|
293
|
+
})();
|
|
293
294
|
return reactJsxRuntime_development;
|
|
294
295
|
}
|
|
295
296
|
var hasRequiredJsxRuntime;
|
|
@@ -321,7 +322,7 @@ var hasRequiredReactCompilerRuntime_development;
|
|
|
321
322
|
function requireReactCompilerRuntime_development() {
|
|
322
323
|
if (hasRequiredReactCompilerRuntime_development) return reactCompilerRuntime_development;
|
|
323
324
|
hasRequiredReactCompilerRuntime_development = 1;
|
|
324
|
-
"production" !== process.env.NODE_ENV && function() {
|
|
325
|
+
"production" !== process.env.NODE_ENV && (function() {
|
|
325
326
|
var ReactSharedInternals = require$$0.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
|
|
326
327
|
reactCompilerRuntime_development.c = function(size) {
|
|
327
328
|
var dispatcher = ReactSharedInternals.H;
|
|
@@ -330,7 +331,7 @@ function requireReactCompilerRuntime_development() {
|
|
|
330
331
|
);
|
|
331
332
|
return dispatcher.useMemoCache(size);
|
|
332
333
|
};
|
|
333
|
-
}();
|
|
334
|
+
})();
|
|
334
335
|
return reactCompilerRuntime_development;
|
|
335
336
|
}
|
|
336
337
|
var hasRequiredCompilerRuntime;
|
|
@@ -856,13 +857,10 @@ function FilePickerFiles(t0) {
|
|
|
856
857
|
} = t122;
|
|
857
858
|
const size = formatFileSize(file.size);
|
|
858
859
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(designsystemetReact.Table.Row, { "data-error": hasError, children: [
|
|
859
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(designsystemetReact.Table.Cell, { title: file.name, className: "at-filepicker-files-file__name",
|
|
860
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(akselIcons.FileTextIcon, { "aria-hidden": "true", fontSize: "1.5em" }),
|
|
861
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "at-filepicker-files-file__text", children: file.name })
|
|
862
|
-
] }) }),
|
|
860
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(designsystemetReact.Table.Cell, { title: file.name, className: "at-filepicker-files-file__name", children: /* @__PURE__ */ jsxRuntimeExports.jsx(designsystemetReact.Link, { href: disabled ? void 0 : URL.createObjectURL(file), target: "_blank", rel: "noreferrer", "aria-disabled": disabled, children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "at-filepicker-files-file__text", children: file.name }) }) }),
|
|
863
861
|
/* @__PURE__ */ jsxRuntimeExports.jsx(designsystemetReact.Table.Cell, { title: size, children: size }),
|
|
864
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(designsystemetReact.Table.Cell, { "data-color": "danger", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(designsystemetReact.Button, { variant: "tertiary",
|
|
865
|
-
|
|
862
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(designsystemetReact.Table.Cell, { "data-color": "danger", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(designsystemetReact.Button, { variant: "tertiary", disabled, "aria-label": `Remove ${file.name}`, onClick: () => onRemove(id), className: "at-filepicker-files-file__button", children: [
|
|
863
|
+
removeButtonLabel,
|
|
866
864
|
/* @__PURE__ */ jsxRuntimeExports.jsx(akselIcons.TrashIcon, { "aria-hidden": true })
|
|
867
865
|
] }) })
|
|
868
866
|
] }, id);
|
|
@@ -893,7 +891,7 @@ function FilePickerFiles(t0) {
|
|
|
893
891
|
}
|
|
894
892
|
let t12;
|
|
895
893
|
if ($[33] !== rest || $[34] !== t11 || $[35] !== t4 || $[36] !== t9) {
|
|
896
|
-
t12 = /* @__PURE__ */ jsxRuntimeExports.jsxs(designsystemetReact.Table, { className: t4, ...rest, children: [
|
|
894
|
+
t12 = /* @__PURE__ */ jsxRuntimeExports.jsxs(designsystemetReact.Table, { "data-color": "neutral", className: t4, ...rest, children: [
|
|
897
895
|
t9,
|
|
898
896
|
t11
|
|
899
897
|
] });
|
|
@@ -1080,8 +1078,105 @@ function HeaderDefaultLogo(t0) {
|
|
|
1080
1078
|
}
|
|
1081
1079
|
return t23;
|
|
1082
1080
|
}
|
|
1081
|
+
const useIsomorphicLayoutEffect = typeof window !== "undefined" ? require$$0.useLayoutEffect : require$$0.useEffect;
|
|
1082
|
+
const IS_SERVER = typeof window === "undefined";
|
|
1083
|
+
function useMediaQuery(query, t0) {
|
|
1084
|
+
const $ = compilerRuntimeExports.c(17);
|
|
1085
|
+
let t1;
|
|
1086
|
+
if ($[0] !== t0) {
|
|
1087
|
+
t1 = {};
|
|
1088
|
+
$[0] = t0;
|
|
1089
|
+
$[1] = t1;
|
|
1090
|
+
} else {
|
|
1091
|
+
t1 = $[1];
|
|
1092
|
+
}
|
|
1093
|
+
const {
|
|
1094
|
+
defaultValue: t2,
|
|
1095
|
+
initializeWithValue: t3
|
|
1096
|
+
} = t1;
|
|
1097
|
+
const defaultValue = t2 === void 0 ? false : t2;
|
|
1098
|
+
const initializeWithValue = t3 === void 0 ? true : t3;
|
|
1099
|
+
let t4;
|
|
1100
|
+
if ($[2] !== defaultValue) {
|
|
1101
|
+
t4 = (query_0) => {
|
|
1102
|
+
if (IS_SERVER) {
|
|
1103
|
+
return defaultValue;
|
|
1104
|
+
}
|
|
1105
|
+
return window.matchMedia(query_0).matches;
|
|
1106
|
+
};
|
|
1107
|
+
$[2] = defaultValue;
|
|
1108
|
+
$[3] = t4;
|
|
1109
|
+
} else {
|
|
1110
|
+
t4 = $[3];
|
|
1111
|
+
}
|
|
1112
|
+
const getMatches = t4;
|
|
1113
|
+
let t5;
|
|
1114
|
+
if ($[4] !== defaultValue || $[5] !== getMatches || $[6] !== initializeWithValue || $[7] !== query) {
|
|
1115
|
+
t5 = () => {
|
|
1116
|
+
if (initializeWithValue) {
|
|
1117
|
+
return getMatches(query);
|
|
1118
|
+
}
|
|
1119
|
+
return defaultValue;
|
|
1120
|
+
};
|
|
1121
|
+
$[4] = defaultValue;
|
|
1122
|
+
$[5] = getMatches;
|
|
1123
|
+
$[6] = initializeWithValue;
|
|
1124
|
+
$[7] = query;
|
|
1125
|
+
$[8] = t5;
|
|
1126
|
+
} else {
|
|
1127
|
+
t5 = $[8];
|
|
1128
|
+
}
|
|
1129
|
+
const [matches, setMatches] = require$$0.useState(t5);
|
|
1130
|
+
let t6;
|
|
1131
|
+
if ($[9] !== getMatches || $[10] !== query) {
|
|
1132
|
+
t6 = function handleChange2() {
|
|
1133
|
+
setMatches(getMatches(query));
|
|
1134
|
+
};
|
|
1135
|
+
$[9] = getMatches;
|
|
1136
|
+
$[10] = query;
|
|
1137
|
+
$[11] = t6;
|
|
1138
|
+
} else {
|
|
1139
|
+
t6 = $[11];
|
|
1140
|
+
}
|
|
1141
|
+
const handleChange = t6;
|
|
1142
|
+
let t7;
|
|
1143
|
+
if ($[12] !== handleChange || $[13] !== query) {
|
|
1144
|
+
t7 = () => {
|
|
1145
|
+
const matchMedia = window.matchMedia(query);
|
|
1146
|
+
handleChange();
|
|
1147
|
+
if (matchMedia.addListener) {
|
|
1148
|
+
matchMedia.addListener(handleChange);
|
|
1149
|
+
} else {
|
|
1150
|
+
matchMedia.addEventListener("change", handleChange);
|
|
1151
|
+
}
|
|
1152
|
+
return () => {
|
|
1153
|
+
if (matchMedia.removeListener) {
|
|
1154
|
+
matchMedia.removeListener(handleChange);
|
|
1155
|
+
} else {
|
|
1156
|
+
matchMedia.removeEventListener("change", handleChange);
|
|
1157
|
+
}
|
|
1158
|
+
};
|
|
1159
|
+
};
|
|
1160
|
+
$[12] = handleChange;
|
|
1161
|
+
$[13] = query;
|
|
1162
|
+
$[14] = t7;
|
|
1163
|
+
} else {
|
|
1164
|
+
t7 = $[14];
|
|
1165
|
+
}
|
|
1166
|
+
let t8;
|
|
1167
|
+
if ($[15] !== query) {
|
|
1168
|
+
t8 = [query];
|
|
1169
|
+
$[15] = query;
|
|
1170
|
+
$[16] = t8;
|
|
1171
|
+
} else {
|
|
1172
|
+
t8 = $[16];
|
|
1173
|
+
}
|
|
1174
|
+
useIsomorphicLayoutEffect(t7, t8);
|
|
1175
|
+
return matches;
|
|
1176
|
+
}
|
|
1083
1177
|
function HeaderTitleDropdown(t0) {
|
|
1084
|
-
const $ = compilerRuntimeExports.c(
|
|
1178
|
+
const $ = compilerRuntimeExports.c(44);
|
|
1179
|
+
let children;
|
|
1085
1180
|
let className;
|
|
1086
1181
|
let controls;
|
|
1087
1182
|
let links;
|
|
@@ -1093,43 +1188,46 @@ function HeaderTitleDropdown(t0) {
|
|
|
1093
1188
|
controls,
|
|
1094
1189
|
links,
|
|
1095
1190
|
userName,
|
|
1191
|
+
children,
|
|
1096
1192
|
...rest
|
|
1097
1193
|
} = t0);
|
|
1098
1194
|
$[0] = t0;
|
|
1099
|
-
$[1] =
|
|
1100
|
-
$[2] =
|
|
1101
|
-
$[3] =
|
|
1102
|
-
$[4] =
|
|
1103
|
-
$[5] =
|
|
1195
|
+
$[1] = children;
|
|
1196
|
+
$[2] = className;
|
|
1197
|
+
$[3] = controls;
|
|
1198
|
+
$[4] = links;
|
|
1199
|
+
$[5] = rest;
|
|
1200
|
+
$[6] = userName;
|
|
1104
1201
|
} else {
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1202
|
+
children = $[1];
|
|
1203
|
+
className = $[2];
|
|
1204
|
+
controls = $[3];
|
|
1205
|
+
links = $[4];
|
|
1206
|
+
rest = $[5];
|
|
1207
|
+
userName = $[6];
|
|
1110
1208
|
}
|
|
1111
1209
|
const [open, setOpen] = require$$0.useState(false);
|
|
1112
1210
|
const id = require$$0.useId();
|
|
1113
|
-
const isMobile =
|
|
1211
|
+
const isMobile = useMediaQuery("(max-width: 768px)");
|
|
1114
1212
|
let t1;
|
|
1115
|
-
if ($[
|
|
1213
|
+
if ($[7] !== className) {
|
|
1116
1214
|
t1 = clsx(className);
|
|
1117
|
-
$[
|
|
1118
|
-
$[
|
|
1215
|
+
$[7] = className;
|
|
1216
|
+
$[8] = t1;
|
|
1119
1217
|
} else {
|
|
1120
|
-
t1 = $[
|
|
1218
|
+
t1 = $[8];
|
|
1121
1219
|
}
|
|
1122
1220
|
let t2;
|
|
1123
|
-
if ($[
|
|
1221
|
+
if ($[9] !== open) {
|
|
1124
1222
|
t2 = () => setOpen(!open);
|
|
1125
|
-
$[
|
|
1126
|
-
$[
|
|
1223
|
+
$[9] = open;
|
|
1224
|
+
$[10] = t2;
|
|
1127
1225
|
} else {
|
|
1128
|
-
t2 = $[
|
|
1226
|
+
t2 = $[10];
|
|
1129
1227
|
}
|
|
1130
1228
|
const t3 = isMobile ? "primary" : "tertiary";
|
|
1131
1229
|
let t4;
|
|
1132
|
-
if ($[
|
|
1230
|
+
if ($[11] !== isMobile || $[12] !== open || $[13] !== userName) {
|
|
1133
1231
|
t4 = isMobile ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
1134
1232
|
open ? /* @__PURE__ */ jsxRuntimeExports.jsx(akselIcons.XMarkIcon, { "aria-hidden": true }) : /* @__PURE__ */ jsxRuntimeExports.jsx(akselIcons.MenuHamburgerIcon, { "aria-hidden": true }),
|
|
1135
1233
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "at-header__title-dropdown-text", children: "Meny" })
|
|
@@ -1137,130 +1235,135 @@ function HeaderTitleDropdown(t0) {
|
|
|
1137
1235
|
userName,
|
|
1138
1236
|
open ? /* @__PURE__ */ jsxRuntimeExports.jsx(akselIcons.ChevronUpIcon, { "aria-hidden": true }) : /* @__PURE__ */ jsxRuntimeExports.jsx(akselIcons.ChevronDownIcon, { "aria-hidden": true })
|
|
1139
1237
|
] });
|
|
1140
|
-
$[
|
|
1141
|
-
$[
|
|
1142
|
-
$[
|
|
1143
|
-
$[
|
|
1238
|
+
$[11] = isMobile;
|
|
1239
|
+
$[12] = open;
|
|
1240
|
+
$[13] = userName;
|
|
1241
|
+
$[14] = t4;
|
|
1144
1242
|
} else {
|
|
1145
|
-
t4 = $[
|
|
1243
|
+
t4 = $[14];
|
|
1146
1244
|
}
|
|
1147
1245
|
let t5;
|
|
1148
|
-
if ($[
|
|
1246
|
+
if ($[15] !== t2 || $[16] !== t3 || $[17] !== t4) {
|
|
1149
1247
|
t5 = /* @__PURE__ */ jsxRuntimeExports.jsx(designsystemetReact.Dropdown.Trigger, { onClick: t2, "data-size": "sm", variant: t3, className: "at-header__title-dropdown-trigger", children: t4 });
|
|
1150
|
-
$[
|
|
1151
|
-
$[
|
|
1152
|
-
$[
|
|
1153
|
-
$[
|
|
1248
|
+
$[15] = t2;
|
|
1249
|
+
$[16] = t3;
|
|
1250
|
+
$[17] = t4;
|
|
1251
|
+
$[18] = t5;
|
|
1154
1252
|
} else {
|
|
1155
|
-
t5 = $[
|
|
1253
|
+
t5 = $[18];
|
|
1156
1254
|
}
|
|
1157
1255
|
let t6;
|
|
1158
|
-
if ($[
|
|
1256
|
+
if ($[19] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1159
1257
|
t6 = () => setOpen(false);
|
|
1160
|
-
$[
|
|
1258
|
+
$[19] = t6;
|
|
1161
1259
|
} else {
|
|
1162
|
-
t6 = $[
|
|
1260
|
+
t6 = $[19];
|
|
1163
1261
|
}
|
|
1164
1262
|
let t7;
|
|
1165
|
-
if ($[
|
|
1166
|
-
t7 = links?.map(
|
|
1167
|
-
$[
|
|
1168
|
-
$[
|
|
1263
|
+
if ($[20] !== children || $[21] !== links) {
|
|
1264
|
+
t7 = children ? require$$0.Children.map(children, _temp$1) : links?.map(_temp2$1);
|
|
1265
|
+
$[20] = children;
|
|
1266
|
+
$[21] = links;
|
|
1267
|
+
$[22] = t7;
|
|
1169
1268
|
} else {
|
|
1170
|
-
t7 = $[
|
|
1269
|
+
t7 = $[22];
|
|
1171
1270
|
}
|
|
1172
1271
|
let t8;
|
|
1173
|
-
if ($[
|
|
1272
|
+
if ($[23] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1174
1273
|
t8 = /* @__PURE__ */ jsxRuntimeExports.jsx(designsystemetReact.Dropdown.Item, { children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("at-header__title-dropdown-item-mobile at-header__title-dropdown-controls"), children: /* @__PURE__ */ jsxRuntimeExports.jsx(designsystemetReact.Divider, {}) }) });
|
|
1175
|
-
$[
|
|
1274
|
+
$[23] = t8;
|
|
1176
1275
|
} else {
|
|
1177
|
-
t8 = $[
|
|
1276
|
+
t8 = $[23];
|
|
1178
1277
|
}
|
|
1179
1278
|
let t9;
|
|
1180
|
-
if ($[
|
|
1181
|
-
t9 = controls?.map((control,
|
|
1182
|
-
$[
|
|
1183
|
-
$[
|
|
1184
|
-
$[
|
|
1279
|
+
if ($[24] !== controls || $[25] !== id) {
|
|
1280
|
+
t9 = controls?.map((control, index_0) => /* @__PURE__ */ jsxRuntimeExports.jsx(designsystemetReact.Dropdown.Item, { children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "at-header__title-dropdown-controls", children: control }) }, id + "-control-" + index_0));
|
|
1281
|
+
$[24] = controls;
|
|
1282
|
+
$[25] = id;
|
|
1283
|
+
$[26] = t9;
|
|
1185
1284
|
} else {
|
|
1186
|
-
t9 = $[
|
|
1285
|
+
t9 = $[26];
|
|
1187
1286
|
}
|
|
1188
1287
|
let t10;
|
|
1189
|
-
if ($[
|
|
1288
|
+
if ($[27] !== t7 || $[28] !== t9) {
|
|
1190
1289
|
t10 = /* @__PURE__ */ jsxRuntimeExports.jsxs(designsystemetReact.Dropdown.List, { children: [
|
|
1191
1290
|
t7,
|
|
1192
1291
|
t8,
|
|
1193
1292
|
t9
|
|
1194
1293
|
] });
|
|
1195
|
-
$[
|
|
1196
|
-
$[
|
|
1197
|
-
$[
|
|
1294
|
+
$[27] = t7;
|
|
1295
|
+
$[28] = t9;
|
|
1296
|
+
$[29] = t10;
|
|
1198
1297
|
} else {
|
|
1199
|
-
t10 = $[
|
|
1298
|
+
t10 = $[29];
|
|
1200
1299
|
}
|
|
1201
1300
|
let t11;
|
|
1202
|
-
if ($[
|
|
1301
|
+
if ($[30] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1203
1302
|
t11 = /* @__PURE__ */ jsxRuntimeExports.jsx(designsystemetReact.Dropdown.Item, { children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "at-header__title-dropdown-close-mobile", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(designsystemetReact.Button, { type: "button", variant: "secondary", onClick: () => setOpen(false), children: [
|
|
1204
1303
|
/* @__PURE__ */ jsxRuntimeExports.jsx(akselIcons.XMarkIcon, { "aria-hidden": true }),
|
|
1205
1304
|
"Lukk"
|
|
1206
1305
|
] }) }) });
|
|
1207
|
-
$[
|
|
1306
|
+
$[30] = t11;
|
|
1208
1307
|
} else {
|
|
1209
|
-
t11 = $[
|
|
1308
|
+
t11 = $[30];
|
|
1210
1309
|
}
|
|
1211
1310
|
let t12;
|
|
1212
|
-
if ($[
|
|
1311
|
+
if ($[31] !== open || $[32] !== t10) {
|
|
1213
1312
|
t12 = /* @__PURE__ */ jsxRuntimeExports.jsxs(designsystemetReact.Dropdown, { open, onClose: t6, placement: "bottom", className: "at-header__title-dropdown-content", children: [
|
|
1214
1313
|
t10,
|
|
1215
1314
|
t11
|
|
1216
1315
|
] });
|
|
1217
|
-
$[
|
|
1218
|
-
$[
|
|
1219
|
-
$[
|
|
1316
|
+
$[31] = open;
|
|
1317
|
+
$[32] = t10;
|
|
1318
|
+
$[33] = t12;
|
|
1220
1319
|
} else {
|
|
1221
|
-
t12 = $[
|
|
1320
|
+
t12 = $[33];
|
|
1222
1321
|
}
|
|
1223
1322
|
let t13;
|
|
1224
|
-
if ($[
|
|
1323
|
+
if ($[34] !== t12 || $[35] !== t5) {
|
|
1225
1324
|
t13 = /* @__PURE__ */ jsxRuntimeExports.jsxs(designsystemetReact.Dropdown.TriggerContext, { children: [
|
|
1226
1325
|
t5,
|
|
1227
1326
|
t12
|
|
1228
1327
|
] });
|
|
1229
|
-
$[
|
|
1230
|
-
$[
|
|
1231
|
-
$[
|
|
1328
|
+
$[34] = t12;
|
|
1329
|
+
$[35] = t5;
|
|
1330
|
+
$[36] = t13;
|
|
1232
1331
|
} else {
|
|
1233
|
-
t13 = $[
|
|
1332
|
+
t13 = $[36];
|
|
1234
1333
|
}
|
|
1235
1334
|
let t14;
|
|
1236
|
-
if ($[
|
|
1335
|
+
if ($[37] !== open) {
|
|
1237
1336
|
t14 = open ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { "aria-hidden": true, className: "at-header__title-dropdown-backdrop" }) : null;
|
|
1238
|
-
$[
|
|
1239
|
-
$[
|
|
1337
|
+
$[37] = open;
|
|
1338
|
+
$[38] = t14;
|
|
1240
1339
|
} else {
|
|
1241
|
-
t14 = $[
|
|
1340
|
+
t14 = $[38];
|
|
1242
1341
|
}
|
|
1243
1342
|
let t15;
|
|
1244
|
-
if ($[
|
|
1343
|
+
if ($[39] !== rest || $[40] !== t1 || $[41] !== t13 || $[42] !== t14) {
|
|
1245
1344
|
t15 = /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: t1, ...rest, children: [
|
|
1246
1345
|
t13,
|
|
1247
1346
|
t14
|
|
1248
1347
|
] });
|
|
1249
|
-
$[
|
|
1250
|
-
$[
|
|
1251
|
-
$[
|
|
1252
|
-
$[
|
|
1253
|
-
$[
|
|
1348
|
+
$[39] = rest;
|
|
1349
|
+
$[40] = t1;
|
|
1350
|
+
$[41] = t13;
|
|
1351
|
+
$[42] = t14;
|
|
1352
|
+
$[43] = t15;
|
|
1254
1353
|
} else {
|
|
1255
|
-
t15 = $[
|
|
1354
|
+
t15 = $[43];
|
|
1256
1355
|
}
|
|
1257
1356
|
return t15;
|
|
1258
1357
|
}
|
|
1259
|
-
function
|
|
1358
|
+
function _temp2$1(link) {
|
|
1260
1359
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(designsystemetReact.Dropdown.Item, { children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("at-header__title-dropdown-controls", "at-header__title-dropdown-item-mobile"), children: /* @__PURE__ */ jsxRuntimeExports.jsx(designsystemetReact.Link, { href: link.href, className: clsx("at-header__title-link"), children: link.label }) }) }, "nav-" + link.href);
|
|
1261
1360
|
}
|
|
1361
|
+
function _temp$1(child, index) {
|
|
1362
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(designsystemetReact.Dropdown.Item, { children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("at-header__title-dropdown-controls", "at-header__title-dropdown-item-mobile"), children: require$$0.isValidElement(child) ? /* @__PURE__ */ jsxRuntimeExports.jsx(reactSlot.Slot, { className: clsx("at-header__title-link", "ds-link"), children: child }) : child }) }, "nav-" + index);
|
|
1363
|
+
}
|
|
1262
1364
|
function HeaderTitleLinks(t0) {
|
|
1263
|
-
const $ = compilerRuntimeExports.c(
|
|
1365
|
+
const $ = compilerRuntimeExports.c(14);
|
|
1366
|
+
let children;
|
|
1264
1367
|
let className;
|
|
1265
1368
|
let links;
|
|
1266
1369
|
let rest;
|
|
@@ -1268,48 +1371,58 @@ function HeaderTitleLinks(t0) {
|
|
|
1268
1371
|
({
|
|
1269
1372
|
className,
|
|
1270
1373
|
links,
|
|
1374
|
+
children,
|
|
1271
1375
|
...rest
|
|
1272
1376
|
} = t0);
|
|
1273
1377
|
$[0] = t0;
|
|
1274
|
-
$[1] =
|
|
1275
|
-
$[2] =
|
|
1276
|
-
$[3] =
|
|
1378
|
+
$[1] = children;
|
|
1379
|
+
$[2] = className;
|
|
1380
|
+
$[3] = links;
|
|
1381
|
+
$[4] = rest;
|
|
1277
1382
|
} else {
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1383
|
+
children = $[1];
|
|
1384
|
+
className = $[2];
|
|
1385
|
+
links = $[3];
|
|
1386
|
+
rest = $[4];
|
|
1281
1387
|
}
|
|
1282
1388
|
let t1;
|
|
1283
|
-
if ($[
|
|
1389
|
+
if ($[5] !== className) {
|
|
1284
1390
|
t1 = clsx(className);
|
|
1285
|
-
$[
|
|
1286
|
-
$[
|
|
1391
|
+
$[5] = className;
|
|
1392
|
+
$[6] = t1;
|
|
1287
1393
|
} else {
|
|
1288
|
-
t1 = $[
|
|
1394
|
+
t1 = $[6];
|
|
1289
1395
|
}
|
|
1290
1396
|
let t2;
|
|
1291
|
-
if ($[
|
|
1292
|
-
t2 = links?.map(
|
|
1293
|
-
$[
|
|
1294
|
-
$[
|
|
1397
|
+
if ($[7] !== children || $[8] !== links) {
|
|
1398
|
+
t2 = children ? require$$0.Children.map(children, _temp) : links?.map(_temp2);
|
|
1399
|
+
$[7] = children;
|
|
1400
|
+
$[8] = links;
|
|
1401
|
+
$[9] = t2;
|
|
1295
1402
|
} else {
|
|
1296
|
-
t2 = $[
|
|
1403
|
+
t2 = $[9];
|
|
1297
1404
|
}
|
|
1298
1405
|
let t3;
|
|
1299
|
-
if ($[
|
|
1406
|
+
if ($[10] !== rest || $[11] !== t1 || $[12] !== t2) {
|
|
1300
1407
|
t3 = /* @__PURE__ */ jsxRuntimeExports.jsx("nav", { className: t1, ...rest, children: t2 });
|
|
1301
|
-
$[
|
|
1302
|
-
$[
|
|
1303
|
-
$[
|
|
1304
|
-
$[
|
|
1408
|
+
$[10] = rest;
|
|
1409
|
+
$[11] = t1;
|
|
1410
|
+
$[12] = t2;
|
|
1411
|
+
$[13] = t3;
|
|
1305
1412
|
} else {
|
|
1306
|
-
t3 = $[
|
|
1413
|
+
t3 = $[13];
|
|
1307
1414
|
}
|
|
1308
1415
|
return t3;
|
|
1309
1416
|
}
|
|
1310
|
-
function
|
|
1417
|
+
function _temp2(link) {
|
|
1311
1418
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(designsystemetReact.Link, { href: link.href, className: clsx("at-header__title-link"), children: link.label }, link.href);
|
|
1312
1419
|
}
|
|
1420
|
+
function _temp(child) {
|
|
1421
|
+
if (require$$0.isValidElement(child)) {
|
|
1422
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(reactSlot.Slot, { className: clsx("at-header__title-link", "ds-link"), children: child });
|
|
1423
|
+
}
|
|
1424
|
+
return child;
|
|
1425
|
+
}
|
|
1313
1426
|
function HeaderTitleLogo(t0) {
|
|
1314
1427
|
const $ = compilerRuntimeExports.c(17);
|
|
1315
1428
|
let appName;
|
|
@@ -1388,12 +1501,13 @@ function HeaderTitle({
|
|
|
1388
1501
|
userName,
|
|
1389
1502
|
links = [],
|
|
1390
1503
|
controls = [],
|
|
1504
|
+
children,
|
|
1391
1505
|
...rest
|
|
1392
1506
|
}) {
|
|
1393
1507
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("at-header__title-background", className), ...rest, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx("at-header__title"), children: [
|
|
1394
1508
|
/* @__PURE__ */ jsxRuntimeExports.jsx(HeaderTitleLogo, { className: clsx("at-header__title-left"), logo, appName }),
|
|
1395
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(HeaderTitleLinks, { className: clsx("at-header__title-center"), links }),
|
|
1396
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(HeaderTitleDropdown, { className: clsx("at-header__title-right"), links, userName, controls })
|
|
1509
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(HeaderTitleLinks, { className: clsx("at-header__title-center"), links, children }),
|
|
1510
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(HeaderTitleDropdown, { className: clsx("at-header__title-right"), links, userName, controls, children })
|
|
1397
1511
|
] }) });
|
|
1398
1512
|
}
|
|
1399
1513
|
const Header = Object.assign(Header$1, {
|