@vygruppen/spor-react 12.18.0 → 12.19.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/.turbo/turbo-build.log +12 -12
- package/.turbo/turbo-postinstall.log +4 -3
- package/CHANGELOG.md +12 -0
- package/dist/index.cjs +59 -85
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -53
- package/dist/index.d.ts +1 -53
- package/dist/index.mjs +54 -80
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/button/FloatingActionButton.tsx +6 -17
- package/src/input/CountryCodeSelect.tsx +16 -9
- package/src/input/Popover.tsx +1 -0
- package/src/linjetag/LineIcon.tsx +17 -18
- package/src/linjetag/TravelTag.tsx +36 -26
- package/src/linjetag/icons.tsx +9 -3
- package/src/loader/ColorInlineLoader.tsx +7 -2
- package/src/loader/ColorSpinner.tsx +7 -2
- package/src/loader/ContentLoader.tsx +1 -2
- package/src/loader/DarkFullScreenLoader.tsx +7 -2
- package/src/loader/DarkInlineLoader.tsx +7 -2
- package/src/loader/DarkSpinner.tsx +8 -2
- package/src/loader/LightFullScreenLoader.tsx +7 -2
- package/src/loader/LightInlineLoader.tsx +7 -2
- package/src/loader/LightSpinner.tsx +7 -2
- package/src/nudge/Nudge.tsx +1 -0
- package/tsconfig.json +1 -1
- package/src/loader/ClientOnly.tsx +0 -31
- package/src/loader/useHydrated.tsx +0 -35
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @vygruppen/spor-react@12.
|
|
2
|
+
> @vygruppen/spor-react@12.19.0 build /home/runner/work/spor/spor/packages/spor-react
|
|
3
3
|
> tsup
|
|
4
4
|
|
|
5
5
|
CLI Building entry: src/index.tsx, src/icons/index.tsx
|
|
@@ -11,18 +11,18 @@ CLI Cleaning output folder
|
|
|
11
11
|
ESM Build start
|
|
12
12
|
CJS Build start
|
|
13
13
|
DTS Build start
|
|
14
|
-
|
|
15
|
-
ESM dist/icons/index.mjs 110.00 B
|
|
16
|
-
ESM dist/icons/index.mjs.map 157.00 B
|
|
17
|
-
ESM dist/index.mjs.map 640.46 KB
|
|
18
|
-
ESM ⚡️ Build success in 2295ms
|
|
19
|
-
CJS dist/index.cjs 321.35 KB
|
|
14
|
+
CJS dist/index.cjs 321.03 KB
|
|
20
15
|
CJS dist/icons/index.cjs 381.00 B
|
|
21
|
-
CJS dist/index.cjs.map 640.46 KB
|
|
22
16
|
CJS dist/icons/index.cjs.map 157.00 B
|
|
23
|
-
CJS
|
|
24
|
-
|
|
17
|
+
CJS dist/index.cjs.map 638.43 KB
|
|
18
|
+
CJS ⚡️ Build success in 2666ms
|
|
19
|
+
ESM dist/index.mjs 299.20 KB
|
|
20
|
+
ESM dist/icons/index.mjs 110.00 B
|
|
21
|
+
ESM dist/icons/index.mjs.map 157.00 B
|
|
22
|
+
ESM dist/index.mjs.map 638.43 KB
|
|
23
|
+
ESM ⚡️ Build success in 2673ms
|
|
24
|
+
DTS ⚡️ Build success in 20756ms
|
|
25
25
|
DTS dist/icons/index.d.ts 44.00 B
|
|
26
|
-
DTS dist/index.d.ts
|
|
26
|
+
DTS dist/index.d.ts 155.63 KB
|
|
27
27
|
DTS dist/icons/index.d.cts 44.00 B
|
|
28
|
-
DTS dist/index.d.cts
|
|
28
|
+
DTS dist/index.d.cts 155.63 KB
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
|
|
2
|
-
> @vygruppen/spor-react@12.
|
|
2
|
+
> @vygruppen/spor-react@12.19.0 postinstall /home/runner/work/spor/spor/packages/spor-react
|
|
3
3
|
> chakra typegen src/theme/index.ts
|
|
4
4
|
|
|
5
|
-
[dotenv@17.2.2] injecting env (0) from .env -- tip:
|
|
5
|
+
[dotenv@17.2.2] injecting env (0) from .env -- tip: 🔐 prevent committing .env to code: https://dotenvx.com/precommit
|
|
6
6
|
[90m┌[39m Chakra CLI ⚡️
|
|
7
7
|
[?25l[90m│[39m
|
|
8
|
-
[
|
|
8
|
+
[35m◒[39m Generating conditions types...
|
|
9
|
+
[999D[J[32m◇[39m ✅ Generated conditions typings
|
|
9
10
|
[?25h[?25l[90m│[39m
|
|
10
11
|
[35m◒[39m Generating recipe types...
|
|
11
12
|
[999D[J[32m◇[39m ✅ Generated recipe typings
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @vygruppen/spor-react
|
|
2
2
|
|
|
3
|
+
## 12.19.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- fbf18ea: Update all eslint config dependencies to their latest versions.
|
|
8
|
+
This may introduce breaking changes due to major version upgrades.
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- @vygruppen/spor-design-tokens@4.2.0
|
|
13
|
+
- @vygruppen/spor-icon-react@4.3.0
|
|
14
|
+
|
|
3
15
|
## 12.18.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
package/dist/index.cjs
CHANGED
|
@@ -190,23 +190,6 @@ function useTranslation() {
|
|
|
190
190
|
function createTexts(texts26) {
|
|
191
191
|
return texts26;
|
|
192
192
|
}
|
|
193
|
-
var hydrating = true;
|
|
194
|
-
function useHydrated() {
|
|
195
|
-
const [hydrated, setHydrated] = React28.useState(() => !hydrating);
|
|
196
|
-
React28.useEffect(function hydrate() {
|
|
197
|
-
hydrating = false;
|
|
198
|
-
setHydrated(true);
|
|
199
|
-
}, []);
|
|
200
|
-
return hydrated;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
// src/loader/ClientOnly.tsx
|
|
204
|
-
var ClientOnly = ({ children, fallback = null }) => {
|
|
205
|
-
const isHydrated = useHydrated();
|
|
206
|
-
if (!isHydrated)
|
|
207
|
-
return fallback;
|
|
208
|
-
return children;
|
|
209
|
-
};
|
|
210
193
|
function Lottie({ animationData }) {
|
|
211
194
|
return /* @__PURE__ */ jsxRuntime.jsx(ReactLottie__default.default, { animationData });
|
|
212
195
|
}
|
|
@@ -216,7 +199,7 @@ var ColorInlineLoader = ({
|
|
|
216
199
|
...props
|
|
217
200
|
}) => {
|
|
218
201
|
return /* @__PURE__ */ jsxRuntime.jsxs(react.Center, { role: "status", "aria-live": "polite", ...props, children: [
|
|
219
|
-
/* @__PURE__ */ jsxRuntime.jsx(react.Box, { width, maxWidth, children: /* @__PURE__ */ jsxRuntime.jsx(ClientOnly, { children: /* @__PURE__ */ jsxRuntime.jsx(Lottie, { animationData: sporLoader.inlineLoaderColorData }) }) }),
|
|
202
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Box, { width, maxWidth, children: /* @__PURE__ */ jsxRuntime.jsx(react.ClientOnly, { children: /* @__PURE__ */ jsxRuntime.jsx(Lottie, { animationData: sporLoader.inlineLoaderColorData }) }) }),
|
|
220
203
|
/* @__PURE__ */ jsxRuntime.jsx(react.VisuallyHidden, { children: "Loading..." })
|
|
221
204
|
] });
|
|
222
205
|
};
|
|
@@ -227,14 +210,14 @@ var ColorSpinner = ({
|
|
|
227
210
|
...props
|
|
228
211
|
}) => {
|
|
229
212
|
return /* @__PURE__ */ jsxRuntime.jsxs(react.Center, { flexDirection: "column", role: "status", "aria-live": "polite", ...props, children: [
|
|
230
|
-
/* @__PURE__ */ jsxRuntime.jsx(react.Box, { width, maxWidth, children: /* @__PURE__ */ jsxRuntime.jsx(ClientOnly, { children: /* @__PURE__ */ jsxRuntime.jsx(Lottie, { animationData: sporLoader.spinnerColorData }) }) }),
|
|
213
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Box, { width, maxWidth, children: /* @__PURE__ */ jsxRuntime.jsx(react.ClientOnly, { children: /* @__PURE__ */ jsxRuntime.jsx(Lottie, { animationData: sporLoader.spinnerColorData }) }) }),
|
|
231
214
|
/* @__PURE__ */ jsxRuntime.jsx(react.VisuallyHidden, { children: "Loading..." }),
|
|
232
215
|
children && /* @__PURE__ */ jsxRuntime.jsx(react.Box, { marginTop: 3, fontWeight: "bold", children })
|
|
233
216
|
] });
|
|
234
217
|
};
|
|
235
218
|
var ContentLoader = ({ children, ...props }) => {
|
|
236
219
|
return /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { role: "status", "aria-live": "polite", ...props, children: [
|
|
237
|
-
/* @__PURE__ */ jsxRuntime.jsx(react.Box, { maxWidth: "140px", marginX: "auto", children: /* @__PURE__ */ jsxRuntime.jsx(ClientOnly, { children: /* @__PURE__ */ jsxRuntime.jsx(Lottie, { animationData: sporLoader.contentLoaderData }) }) }),
|
|
220
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Box, { maxWidth: "140px", marginX: "auto", children: /* @__PURE__ */ jsxRuntime.jsx(react.ClientOnly, { children: /* @__PURE__ */ jsxRuntime.jsx(Lottie, { animationData: sporLoader.contentLoaderData }) }) }),
|
|
238
221
|
/* @__PURE__ */ jsxRuntime.jsx(react.VisuallyHidden, { children: "Loading..." }),
|
|
239
222
|
children && /* @__PURE__ */ jsxRuntime.jsx(react.Box, { textAlign: "center", fontWeight: "bold", children })
|
|
240
223
|
] });
|
|
@@ -254,7 +237,7 @@ var DarkFullScreenLoader = ({
|
|
|
254
237
|
"aria-live": "polite",
|
|
255
238
|
...props,
|
|
256
239
|
children: [
|
|
257
|
-
/* @__PURE__ */ jsxRuntime.jsx(react.Box, { width, maxWidth, children: /* @__PURE__ */ jsxRuntime.jsx(ClientOnly, { children: /* @__PURE__ */ jsxRuntime.jsx(Lottie, { animationData: sporLoader.fullScreenLoaderWhiteData }) }) }),
|
|
240
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Box, { width, maxWidth, children: /* @__PURE__ */ jsxRuntime.jsx(react.ClientOnly, { children: /* @__PURE__ */ jsxRuntime.jsx(Lottie, { animationData: sporLoader.fullScreenLoaderWhiteData }) }) }),
|
|
258
241
|
/* @__PURE__ */ jsxRuntime.jsx(react.VisuallyHidden, { children: "Loading..." })
|
|
259
242
|
]
|
|
260
243
|
}
|
|
@@ -266,7 +249,7 @@ var DarkInlineLoader = ({
|
|
|
266
249
|
...props
|
|
267
250
|
}) => {
|
|
268
251
|
return /* @__PURE__ */ jsxRuntime.jsxs(react.Center, { role: "status", "aria-live": "polite", ...props, children: [
|
|
269
|
-
/* @__PURE__ */ jsxRuntime.jsx(react.Box, { width, maxWidth, children: /* @__PURE__ */ jsxRuntime.jsx(ClientOnly, { children: /* @__PURE__ */ jsxRuntime.jsx(Lottie, { animationData: sporLoader.inlineLoaderDarkData }) }) }),
|
|
252
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Box, { width, maxWidth, children: /* @__PURE__ */ jsxRuntime.jsx(react.ClientOnly, { children: /* @__PURE__ */ jsxRuntime.jsx(Lottie, { animationData: sporLoader.inlineLoaderDarkData }) }) }),
|
|
270
253
|
/* @__PURE__ */ jsxRuntime.jsx(react.VisuallyHidden, { children: "Loading..." })
|
|
271
254
|
] });
|
|
272
255
|
};
|
|
@@ -279,7 +262,7 @@ var DarkSpinner = ({
|
|
|
279
262
|
const { colorMode } = useColorMode();
|
|
280
263
|
const spinnerData = colorMode === "dark" ? sporLoader.spinnerLightData : sporLoader.spinnerDarkData;
|
|
281
264
|
return /* @__PURE__ */ jsxRuntime.jsxs(react.Center, { flexDirection: "column", role: "status", "aria-live": "polite", ...props, children: [
|
|
282
|
-
/* @__PURE__ */ jsxRuntime.jsx(react.Box, { width, maxWidth, children: /* @__PURE__ */ jsxRuntime.jsx(ClientOnly, { children: /* @__PURE__ */ jsxRuntime.jsx(Lottie, { animationData: spinnerData }) }) }),
|
|
265
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Box, { width, maxWidth, children: /* @__PURE__ */ jsxRuntime.jsx(react.ClientOnly, { children: /* @__PURE__ */ jsxRuntime.jsx(Lottie, { animationData: spinnerData }) }) }),
|
|
283
266
|
/* @__PURE__ */ jsxRuntime.jsx(react.VisuallyHidden, { children: "Loading..." }),
|
|
284
267
|
children && /* @__PURE__ */ jsxRuntime.jsx(react.Box, { marginTop: 3, fontWeight: "bold", children })
|
|
285
268
|
] });
|
|
@@ -290,7 +273,7 @@ var LightFullScreenLoader = ({
|
|
|
290
273
|
...props
|
|
291
274
|
}) => {
|
|
292
275
|
return /* @__PURE__ */ jsxRuntime.jsxs(react.Center, { height: "100%", role: "status", "aria-live": "polite", ...props, children: [
|
|
293
|
-
/* @__PURE__ */ jsxRuntime.jsx(react.Box, { width, maxWidth, children: /* @__PURE__ */ jsxRuntime.jsx(ClientOnly, { children: /* @__PURE__ */ jsxRuntime.jsx(Lottie, { animationData: sporLoader.fullScreenLoaderBlackData }) }) }),
|
|
276
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Box, { width, maxWidth, children: /* @__PURE__ */ jsxRuntime.jsx(react.ClientOnly, { children: /* @__PURE__ */ jsxRuntime.jsx(Lottie, { animationData: sporLoader.fullScreenLoaderBlackData }) }) }),
|
|
294
277
|
/* @__PURE__ */ jsxRuntime.jsx(react.VisuallyHidden, { children: "Loading..." })
|
|
295
278
|
] });
|
|
296
279
|
};
|
|
@@ -300,7 +283,7 @@ var LightInlineLoader = ({
|
|
|
300
283
|
...props
|
|
301
284
|
}) => {
|
|
302
285
|
return /* @__PURE__ */ jsxRuntime.jsxs(react.Center, { height: "100%", role: "status", "aria-live": "polite", ...props, children: [
|
|
303
|
-
/* @__PURE__ */ jsxRuntime.jsx(react.Box, { width, maxWidth, children: /* @__PURE__ */ jsxRuntime.jsx(ClientOnly, { children: /* @__PURE__ */ jsxRuntime.jsx(Lottie, { animationData: sporLoader.inlineLoaderLightData }) }) }),
|
|
286
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Box, { width, maxWidth, children: /* @__PURE__ */ jsxRuntime.jsx(react.ClientOnly, { children: /* @__PURE__ */ jsxRuntime.jsx(Lottie, { animationData: sporLoader.inlineLoaderLightData }) }) }),
|
|
304
287
|
/* @__PURE__ */ jsxRuntime.jsx(react.VisuallyHidden, { children: "Loading..." })
|
|
305
288
|
] });
|
|
306
289
|
};
|
|
@@ -311,7 +294,7 @@ var LightSpinner = ({
|
|
|
311
294
|
...props
|
|
312
295
|
}) => {
|
|
313
296
|
return /* @__PURE__ */ jsxRuntime.jsxs(react.Center, { flexDirection: "column", role: "status", "aria-live": "polite", ...props, children: [
|
|
314
|
-
/* @__PURE__ */ jsxRuntime.jsx(react.Box, { width, maxWidth, children: /* @__PURE__ */ jsxRuntime.jsx(ClientOnly, { children: /* @__PURE__ */ jsxRuntime.jsx(Lottie, { animationData: sporLoader.spinnerLightData }) }) }),
|
|
297
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Box, { width, maxWidth, children: /* @__PURE__ */ jsxRuntime.jsx(react.ClientOnly, { children: /* @__PURE__ */ jsxRuntime.jsx(Lottie, { animationData: sporLoader.spinnerLightData }) }) }),
|
|
315
298
|
/* @__PURE__ */ jsxRuntime.jsx(react.VisuallyHidden, { children: "Loading..." }),
|
|
316
299
|
children && /* @__PURE__ */ jsxRuntime.jsx(react.Box, { marginTop: 3, fontWeight: "bold", children })
|
|
317
300
|
] });
|
|
@@ -900,23 +883,8 @@ var FloatingActionButton = React28.forwardRef(
|
|
|
900
883
|
placement = "bottom right",
|
|
901
884
|
...props
|
|
902
885
|
}, ref) => {
|
|
903
|
-
const [isTextVisible, setIsTextVisible] = React28__namespace.default.useState(
|
|
904
|
-
externalIsTextVisible === void 0 ? false : externalIsTextVisible
|
|
905
|
-
);
|
|
906
886
|
const scrollDirection = useScrollDirection();
|
|
907
|
-
|
|
908
|
-
if (externalIsTextVisible !== void 0) {
|
|
909
|
-
return;
|
|
910
|
-
}
|
|
911
|
-
const id = globalThis.setTimeout(
|
|
912
|
-
() => setIsTextVisible(scrollDirection !== "down"),
|
|
913
|
-
1e3
|
|
914
|
-
);
|
|
915
|
-
return () => globalThis.clearTimeout(id);
|
|
916
|
-
}, [scrollDirection, externalIsTextVisible]);
|
|
917
|
-
React28.useEffect(() => {
|
|
918
|
-
setIsTextVisible(!!externalIsTextVisible);
|
|
919
|
-
}, [externalIsTextVisible]);
|
|
887
|
+
const isTextVisible = externalIsTextVisible === void 0 ? scrollDirection !== "down" : !!externalIsTextVisible;
|
|
920
888
|
const recipe = react.useSlotRecipe({ key: "floatingActionButton" });
|
|
921
889
|
const style = recipe({
|
|
922
890
|
variant,
|
|
@@ -3452,36 +3420,39 @@ var prioritizedCountryCodes = [
|
|
|
3452
3420
|
{ label: "+46", value: "+46" },
|
|
3453
3421
|
{ label: "+45", value: "+45" }
|
|
3454
3422
|
];
|
|
3455
|
-
var sortedCallingCodes = awesomePhonenumber.getSupportedCallingCodes().
|
|
3423
|
+
var sortedCallingCodes = awesomePhonenumber.getSupportedCallingCodes().toSorted((a, b) => Number(a) - Number(b)).map((code) => ({
|
|
3456
3424
|
label: `+${code}`,
|
|
3457
3425
|
value: `+${code}`
|
|
3458
3426
|
})).filter(
|
|
3459
3427
|
(code) => !prioritizedCountryCodes.some((pCode) => pCode.label === code.label)
|
|
3460
3428
|
);
|
|
3461
|
-
var
|
|
3429
|
+
var allCallingCodes = react.createListCollection({
|
|
3462
3430
|
items: [...prioritizedCountryCodes, ...sortedCallingCodes]
|
|
3463
3431
|
});
|
|
3464
3432
|
var CountryCodeSelect = React28.forwardRef((props, ref) => {
|
|
3465
3433
|
const { t } = useTranslation();
|
|
3466
|
-
|
|
3467
|
-
|
|
3434
|
+
const filteredCallingCodes = React28.useMemo(() => {
|
|
3435
|
+
if (!props.allowedCountryCodes)
|
|
3436
|
+
return allCallingCodes;
|
|
3437
|
+
const filteredItems = allCallingCodes.items.filter(
|
|
3468
3438
|
(callingCode) => {
|
|
3469
3439
|
var _a5;
|
|
3470
|
-
return (_a5 = props.allowedCountryCodes) == null ? void 0 : _a5.
|
|
3440
|
+
return (_a5 = props.allowedCountryCodes) == null ? void 0 : _a5.includes(callingCode.label);
|
|
3471
3441
|
}
|
|
3472
3442
|
);
|
|
3473
|
-
|
|
3443
|
+
return react.createListCollection({ items: filteredItems });
|
|
3444
|
+
}, [props.allowedCountryCodes]);
|
|
3474
3445
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3475
3446
|
Select,
|
|
3476
3447
|
{
|
|
3477
3448
|
...props,
|
|
3478
3449
|
ref,
|
|
3479
3450
|
positioning: { placement: "bottom", flip: false },
|
|
3480
|
-
collection:
|
|
3451
|
+
collection: filteredCallingCodes,
|
|
3481
3452
|
lazyMount: true,
|
|
3482
3453
|
"aria-label": t(texts15.countryCode),
|
|
3483
3454
|
sideRadiusVariant: "rightSideSquare",
|
|
3484
|
-
children:
|
|
3455
|
+
children: filteredCallingCodes.items.map((code) => /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { item: code, children: code.label }, code.label))
|
|
3485
3456
|
}
|
|
3486
3457
|
);
|
|
3487
3458
|
});
|
|
@@ -4019,9 +3990,10 @@ var icons = {
|
|
|
4019
3990
|
},
|
|
4020
3991
|
walk: { sm: sporIconReact.WalkFill18Icon, md: sporIconReact.WalkFill24Icon, lg: sporIconReact.WalkFill30Icon }
|
|
4021
3992
|
};
|
|
4022
|
-
var
|
|
3993
|
+
var LinjeTagIcon = ({ variant, size, css }) => {
|
|
4023
3994
|
var _a5;
|
|
4024
|
-
|
|
3995
|
+
const IconComponent2 = ((_a5 = icons[variant]) == null ? void 0 : _a5[size]) ?? react.Box;
|
|
3996
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.Box, { css, asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(IconComponent2, {}) });
|
|
4025
3997
|
};
|
|
4026
3998
|
var LineIcon = React28.forwardRef(
|
|
4027
3999
|
function LineIcon2({
|
|
@@ -4042,19 +4014,18 @@ var LineIcon = React28.forwardRef(
|
|
|
4042
4014
|
const borderContainer = () => {
|
|
4043
4015
|
return variant === "walk" && target === "travelTag" ? 0 : "1px";
|
|
4044
4016
|
};
|
|
4045
|
-
const Icon2 = getCorrectIcon({
|
|
4046
|
-
variant: (
|
|
4047
|
-
// eslint-disable-next-line no-nested-ternary
|
|
4048
|
-
variant === "custom" && "customIconVariant" in rest ? rest.customIconVariant : variant === "custom" ? "local-train" : variant
|
|
4049
|
-
),
|
|
4050
|
-
size
|
|
4051
|
-
});
|
|
4052
|
-
if (!Icon2) {
|
|
4053
|
-
return null;
|
|
4054
|
-
}
|
|
4055
4017
|
if (foregroundColor) {
|
|
4056
4018
|
styles.iconContainer.backgroundColor = disabled ? "surface.disabled" : foregroundColor;
|
|
4057
4019
|
}
|
|
4020
|
+
function getIconVariant() {
|
|
4021
|
+
if (variant === "custom") {
|
|
4022
|
+
if ("customIconVariant" in rest) {
|
|
4023
|
+
return rest.customIconVariant;
|
|
4024
|
+
}
|
|
4025
|
+
return "local-train";
|
|
4026
|
+
}
|
|
4027
|
+
return variant;
|
|
4028
|
+
}
|
|
4058
4029
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4059
4030
|
react.Box,
|
|
4060
4031
|
{
|
|
@@ -4065,7 +4036,14 @@ var LineIcon = React28.forwardRef(
|
|
|
4065
4036
|
"aria-label": label,
|
|
4066
4037
|
ref,
|
|
4067
4038
|
className: clsx_default("light", rest.className),
|
|
4068
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4039
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4040
|
+
LinjeTagIcon,
|
|
4041
|
+
{
|
|
4042
|
+
size,
|
|
4043
|
+
css: styles.icon,
|
|
4044
|
+
variant: getIconVariant()
|
|
4045
|
+
}
|
|
4046
|
+
)
|
|
4069
4047
|
}
|
|
4070
4048
|
);
|
|
4071
4049
|
}
|
|
@@ -4099,6 +4077,23 @@ var InfoTag = ({
|
|
|
4099
4077
|
] })
|
|
4100
4078
|
] });
|
|
4101
4079
|
};
|
|
4080
|
+
function renderDeviationLevelIcon(deviationLevel, size, css) {
|
|
4081
|
+
switch (deviationLevel) {
|
|
4082
|
+
case "critical": {
|
|
4083
|
+
return size === "lg" ? /* @__PURE__ */ jsxRuntime.jsx(sporIconReact.ErrorFill24Icon, { css }) : /* @__PURE__ */ jsxRuntime.jsx(sporIconReact.ErrorFill18Icon, { css });
|
|
4084
|
+
}
|
|
4085
|
+
case "major":
|
|
4086
|
+
case "minor": {
|
|
4087
|
+
return size === "lg" ? /* @__PURE__ */ jsxRuntime.jsx(sporIconReact.WarningFill24Icon, { css }) : /* @__PURE__ */ jsxRuntime.jsx(sporIconReact.WarningFill18Icon, { css });
|
|
4088
|
+
}
|
|
4089
|
+
case "info": {
|
|
4090
|
+
return size === "lg" ? /* @__PURE__ */ jsxRuntime.jsx(sporIconReact.InformationFill24Icon, { css }) : /* @__PURE__ */ jsxRuntime.jsx(sporIconReact.InformationFill18Icon, { css });
|
|
4091
|
+
}
|
|
4092
|
+
default: {
|
|
4093
|
+
return null;
|
|
4094
|
+
}
|
|
4095
|
+
}
|
|
4096
|
+
}
|
|
4102
4097
|
var TravelTag = React28.forwardRef(
|
|
4103
4098
|
function TravelTag2({
|
|
4104
4099
|
variant,
|
|
@@ -4118,7 +4113,6 @@ var TravelTag = React28.forwardRef(
|
|
|
4118
4113
|
size,
|
|
4119
4114
|
deviationLevel
|
|
4120
4115
|
});
|
|
4121
|
-
const DeviationLevelIcon = getDeviationLevelIcon({ deviationLevel, size });
|
|
4122
4116
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4123
4117
|
react.Box,
|
|
4124
4118
|
{
|
|
@@ -4147,32 +4141,12 @@ var TravelTag = React28.forwardRef(
|
|
|
4147
4141
|
title && description && " ",
|
|
4148
4142
|
description && /* @__PURE__ */ jsxRuntime.jsx(react.Box, { as: "span", css: styles.description, children: description })
|
|
4149
4143
|
] }),
|
|
4150
|
-
|
|
4144
|
+
renderDeviationLevelIcon(deviationLevel, size, styles.deviationIcon)
|
|
4151
4145
|
]
|
|
4152
4146
|
}
|
|
4153
4147
|
);
|
|
4154
4148
|
}
|
|
4155
4149
|
);
|
|
4156
|
-
var getDeviationLevelIcon = ({
|
|
4157
|
-
deviationLevel,
|
|
4158
|
-
size
|
|
4159
|
-
}) => {
|
|
4160
|
-
switch (deviationLevel) {
|
|
4161
|
-
case "critical": {
|
|
4162
|
-
return size === "lg" ? sporIconReact.ErrorFill24Icon : sporIconReact.ErrorFill18Icon;
|
|
4163
|
-
}
|
|
4164
|
-
case "major":
|
|
4165
|
-
case "minor": {
|
|
4166
|
-
return size === "lg" ? sporIconReact.WarningFill24Icon : sporIconReact.WarningFill18Icon;
|
|
4167
|
-
}
|
|
4168
|
-
case "info": {
|
|
4169
|
-
return size === "lg" ? sporIconReact.InformationFill24Icon : sporIconReact.InformationFill18Icon;
|
|
4170
|
-
}
|
|
4171
|
-
default: {
|
|
4172
|
-
return null;
|
|
4173
|
-
}
|
|
4174
|
-
}
|
|
4175
|
-
};
|
|
4176
4150
|
var ExternalIcon = ({
|
|
4177
4151
|
label,
|
|
4178
4152
|
size
|