@navikt/ds-react 7.33.5 → 7.34.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/cjs/alert/Alert.js +2 -4
- package/cjs/alert/Alert.js.map +1 -1
- package/cjs/alert/base-alert/close-button/BaseAlertCloseButton.d.ts +17 -0
- package/cjs/alert/base-alert/close-button/BaseAlertCloseButton.js +72 -0
- package/cjs/alert/base-alert/close-button/BaseAlertCloseButton.js.map +1 -0
- package/cjs/alert/base-alert/content/BaseAlertContent.d.ts +20 -0
- package/cjs/alert/base-alert/content/BaseAlertContent.js +70 -0
- package/cjs/alert/base-alert/content/BaseAlertContent.js.map +1 -0
- package/cjs/alert/base-alert/header/BaseAlertHeader.d.ts +22 -0
- package/cjs/alert/base-alert/header/BaseAlertHeader.js +77 -0
- package/cjs/alert/base-alert/header/BaseAlertHeader.js.map +1 -0
- package/cjs/alert/base-alert/index.d.ts +1 -0
- package/cjs/alert/base-alert/index.js +39 -0
- package/cjs/alert/base-alert/index.js.map +1 -0
- package/cjs/alert/base-alert/namespace.d.ts +10 -0
- package/cjs/alert/base-alert/namespace.js +14 -0
- package/cjs/alert/base-alert/namespace.js.map +1 -0
- package/cjs/alert/base-alert/root/BaseAlertRoot.context.d.ts +12 -0
- package/cjs/alert/base-alert/root/BaseAlertRoot.context.js +11 -0
- package/cjs/alert/base-alert/root/BaseAlertRoot.context.js.map +1 -0
- package/cjs/alert/base-alert/root/BaseAlertRoot.d.ts +43 -0
- package/cjs/alert/base-alert/root/BaseAlertRoot.js +65 -0
- package/cjs/alert/base-alert/root/BaseAlertRoot.js.map +1 -0
- package/cjs/alert/base-alert/root/BaseAlertRoot.utils.d.ts +9 -0
- package/cjs/alert/base-alert/root/BaseAlertRoot.utils.js +48 -0
- package/cjs/alert/base-alert/root/BaseAlertRoot.utils.js.map +1 -0
- package/cjs/alert/base-alert/title/BaseAlertTitle.d.ts +24 -0
- package/cjs/alert/base-alert/title/BaseAlertTitle.js +77 -0
- package/cjs/alert/base-alert/title/BaseAlertTitle.js.map +1 -0
- package/cjs/alert/global-alert/close-button/GlobalAlertCloseButton.d.ts +17 -0
- package/cjs/alert/global-alert/close-button/GlobalAlertCloseButton.js +19 -0
- package/cjs/alert/global-alert/close-button/GlobalAlertCloseButton.js.map +1 -0
- package/cjs/alert/global-alert/content/GlobalAlertContent.d.ts +18 -0
- package/cjs/alert/global-alert/content/GlobalAlertContent.js +20 -0
- package/cjs/alert/global-alert/content/GlobalAlertContent.js.map +1 -0
- package/cjs/alert/global-alert/header/GlobalAlertHeader.d.ts +17 -0
- package/cjs/alert/global-alert/header/GlobalAlertHeader.js +54 -0
- package/cjs/alert/global-alert/header/GlobalAlertHeader.js.map +1 -0
- package/cjs/alert/global-alert/index.d.ts +2 -0
- package/cjs/alert/global-alert/index.js +11 -0
- package/cjs/alert/global-alert/index.js.map +1 -0
- package/cjs/alert/global-alert/root/GlobalAlertRoot.d.ts +81 -0
- package/cjs/alert/global-alert/root/GlobalAlertRoot.js +69 -0
- package/cjs/alert/global-alert/root/GlobalAlertRoot.js.map +1 -0
- package/cjs/alert/global-alert/title/GlobalAlertTitle.d.ts +17 -0
- package/cjs/alert/global-alert/title/GlobalAlertTitle.js +19 -0
- package/cjs/alert/global-alert/title/GlobalAlertTitle.js.map +1 -0
- package/cjs/alert/info-card/content/InfoCardContent.d.ts +18 -0
- package/cjs/alert/info-card/content/InfoCardContent.js +20 -0
- package/cjs/alert/info-card/content/InfoCardContent.js.map +1 -0
- package/cjs/alert/info-card/header/InfoCardHeader.d.ts +16 -0
- package/cjs/alert/info-card/header/InfoCardHeader.js +18 -0
- package/cjs/alert/info-card/header/InfoCardHeader.js.map +1 -0
- package/cjs/alert/info-card/index.d.ts +2 -0
- package/cjs/alert/info-card/index.js +10 -0
- package/cjs/alert/info-card/index.js.map +1 -0
- package/cjs/alert/info-card/root/InfoCardRoot.d.ts +76 -0
- package/cjs/alert/info-card/root/InfoCardRoot.js +78 -0
- package/cjs/alert/info-card/root/InfoCardRoot.js.map +1 -0
- package/cjs/alert/info-card/title/InfoCardTitle.d.ts +17 -0
- package/cjs/alert/info-card/title/InfoCardTitle.js +19 -0
- package/cjs/alert/info-card/title/InfoCardTitle.js.map +1 -0
- package/cjs/alert/local-alert/close-button/LocalAlertCloseButton.d.ts +17 -0
- package/cjs/alert/local-alert/close-button/LocalAlertCloseButton.js +19 -0
- package/cjs/alert/local-alert/close-button/LocalAlertCloseButton.js.map +1 -0
- package/cjs/alert/local-alert/content/LocalAlertContent.d.ts +18 -0
- package/cjs/alert/local-alert/content/LocalAlertContent.js +20 -0
- package/cjs/alert/local-alert/content/LocalAlertContent.js.map +1 -0
- package/cjs/alert/local-alert/header/LocalAlertHeader.d.ts +17 -0
- package/cjs/alert/local-alert/header/LocalAlertHeader.js +54 -0
- package/cjs/alert/local-alert/header/LocalAlertHeader.js.map +1 -0
- package/cjs/alert/local-alert/index.d.ts +2 -0
- package/cjs/alert/local-alert/index.js +11 -0
- package/cjs/alert/local-alert/index.js.map +1 -0
- package/cjs/alert/local-alert/root/LocalAlertRoot.d.ts +81 -0
- package/cjs/alert/local-alert/root/LocalAlertRoot.js +81 -0
- package/cjs/alert/local-alert/root/LocalAlertRoot.js.map +1 -0
- package/cjs/alert/local-alert/title/LocalAlertTitle.d.ts +17 -0
- package/cjs/alert/local-alert/title/LocalAlertTitle.js +19 -0
- package/cjs/alert/local-alert/title/LocalAlertTitle.js.map +1 -0
- package/cjs/date/Date.locale.d.ts +5 -0
- package/cjs/index.d.ts +4 -0
- package/cjs/index.js +9 -1
- package/cjs/index.js.map +1 -1
- package/cjs/inline-message/icon/InlineMessageIcon.d.ts +5 -0
- package/cjs/inline-message/icon/InlineMessageIcon.js +24 -0
- package/cjs/inline-message/icon/InlineMessageIcon.js.map +1 -0
- package/cjs/inline-message/index.d.ts +2 -0
- package/cjs/inline-message/index.js +7 -0
- package/cjs/inline-message/index.js.map +1 -0
- package/cjs/inline-message/root/InlineMessage.d.ts +36 -0
- package/cjs/inline-message/root/InlineMessage.js +91 -0
- package/cjs/inline-message/root/InlineMessage.js.map +1 -0
- package/cjs/timeline/period/ClickablePeriod.js +3 -15
- package/cjs/timeline/period/ClickablePeriod.js.map +1 -1
- package/cjs/timeline/pin/PinInternal.js +3 -15
- package/cjs/timeline/pin/PinInternal.js.map +1 -1
- package/cjs/util/i18n/locales/en.d.ts +1 -4
- package/cjs/util/i18n/locales/en.js +1 -4
- package/cjs/util/i18n/locales/en.js.map +1 -1
- package/cjs/util/i18n/locales/nb.d.ts +2 -6
- package/cjs/util/i18n/locales/nb.js +2 -6
- package/cjs/util/i18n/locales/nb.js.map +1 -1
- package/cjs/util/i18n/locales/nn.d.ts +1 -4
- package/cjs/util/i18n/locales/nn.js +1 -4
- package/cjs/util/i18n/locales/nn.js.map +1 -1
- package/esm/alert/Alert.js +2 -4
- package/esm/alert/Alert.js.map +1 -1
- package/esm/alert/base-alert/close-button/BaseAlertCloseButton.d.ts +17 -0
- package/esm/alert/base-alert/close-button/BaseAlertCloseButton.js +36 -0
- package/esm/alert/base-alert/close-button/BaseAlertCloseButton.js.map +1 -0
- package/esm/alert/base-alert/content/BaseAlertContent.d.ts +20 -0
- package/esm/alert/base-alert/content/BaseAlertContent.js +34 -0
- package/esm/alert/base-alert/content/BaseAlertContent.js.map +1 -0
- package/esm/alert/base-alert/header/BaseAlertHeader.d.ts +22 -0
- package/esm/alert/base-alert/header/BaseAlertHeader.js +41 -0
- package/esm/alert/base-alert/header/BaseAlertHeader.js.map +1 -0
- package/esm/alert/base-alert/index.d.ts +1 -0
- package/esm/alert/base-alert/index.js +3 -0
- package/esm/alert/base-alert/index.js.map +1 -0
- package/esm/alert/base-alert/namespace.d.ts +10 -0
- package/esm/alert/base-alert/namespace.js +6 -0
- package/esm/alert/base-alert/namespace.js.map +1 -0
- package/esm/alert/base-alert/root/BaseAlertRoot.context.d.ts +12 -0
- package/esm/alert/base-alert/root/BaseAlertRoot.context.js +7 -0
- package/esm/alert/base-alert/root/BaseAlertRoot.context.js.map +1 -0
- package/esm/alert/base-alert/root/BaseAlertRoot.d.ts +43 -0
- package/esm/alert/base-alert/root/BaseAlertRoot.js +29 -0
- package/esm/alert/base-alert/root/BaseAlertRoot.js.map +1 -0
- package/esm/alert/base-alert/root/BaseAlertRoot.utils.d.ts +9 -0
- package/esm/alert/base-alert/root/BaseAlertRoot.utils.js +42 -0
- package/esm/alert/base-alert/root/BaseAlertRoot.utils.js.map +1 -0
- package/esm/alert/base-alert/title/BaseAlertTitle.d.ts +24 -0
- package/esm/alert/base-alert/title/BaseAlertTitle.js +38 -0
- package/esm/alert/base-alert/title/BaseAlertTitle.js.map +1 -0
- package/esm/alert/global-alert/close-button/GlobalAlertCloseButton.d.ts +17 -0
- package/esm/alert/global-alert/close-button/GlobalAlertCloseButton.js +16 -0
- package/esm/alert/global-alert/close-button/GlobalAlertCloseButton.js.map +1 -0
- package/esm/alert/global-alert/content/GlobalAlertContent.d.ts +18 -0
- package/esm/alert/global-alert/content/GlobalAlertContent.js +17 -0
- package/esm/alert/global-alert/content/GlobalAlertContent.js.map +1 -0
- package/esm/alert/global-alert/header/GlobalAlertHeader.d.ts +17 -0
- package/esm/alert/global-alert/header/GlobalAlertHeader.js +18 -0
- package/esm/alert/global-alert/header/GlobalAlertHeader.js.map +1 -0
- package/esm/alert/global-alert/index.d.ts +2 -0
- package/esm/alert/global-alert/index.js +3 -0
- package/esm/alert/global-alert/index.js.map +1 -0
- package/esm/alert/global-alert/root/GlobalAlertRoot.d.ts +81 -0
- package/esm/alert/global-alert/root/GlobalAlertRoot.js +30 -0
- package/esm/alert/global-alert/root/GlobalAlertRoot.js.map +1 -0
- package/esm/alert/global-alert/title/GlobalAlertTitle.d.ts +17 -0
- package/esm/alert/global-alert/title/GlobalAlertTitle.js +16 -0
- package/esm/alert/global-alert/title/GlobalAlertTitle.js.map +1 -0
- package/esm/alert/info-card/content/InfoCardContent.d.ts +18 -0
- package/esm/alert/info-card/content/InfoCardContent.js +17 -0
- package/esm/alert/info-card/content/InfoCardContent.js.map +1 -0
- package/esm/alert/info-card/header/InfoCardHeader.d.ts +16 -0
- package/esm/alert/info-card/header/InfoCardHeader.js +15 -0
- package/esm/alert/info-card/header/InfoCardHeader.js.map +1 -0
- package/esm/alert/info-card/index.d.ts +2 -0
- package/esm/alert/info-card/index.js +3 -0
- package/esm/alert/info-card/index.js.map +1 -0
- package/esm/alert/info-card/root/InfoCardRoot.d.ts +76 -0
- package/esm/alert/info-card/root/InfoCardRoot.js +40 -0
- package/esm/alert/info-card/root/InfoCardRoot.js.map +1 -0
- package/esm/alert/info-card/title/InfoCardTitle.d.ts +17 -0
- package/esm/alert/info-card/title/InfoCardTitle.js +16 -0
- package/esm/alert/info-card/title/InfoCardTitle.js.map +1 -0
- package/esm/alert/local-alert/close-button/LocalAlertCloseButton.d.ts +17 -0
- package/esm/alert/local-alert/close-button/LocalAlertCloseButton.js +16 -0
- package/esm/alert/local-alert/close-button/LocalAlertCloseButton.js.map +1 -0
- package/esm/alert/local-alert/content/LocalAlertContent.d.ts +18 -0
- package/esm/alert/local-alert/content/LocalAlertContent.js +17 -0
- package/esm/alert/local-alert/content/LocalAlertContent.js.map +1 -0
- package/esm/alert/local-alert/header/LocalAlertHeader.d.ts +17 -0
- package/esm/alert/local-alert/header/LocalAlertHeader.js +18 -0
- package/esm/alert/local-alert/header/LocalAlertHeader.js.map +1 -0
- package/esm/alert/local-alert/index.d.ts +2 -0
- package/esm/alert/local-alert/index.js +3 -0
- package/esm/alert/local-alert/index.js.map +1 -0
- package/esm/alert/local-alert/root/LocalAlertRoot.d.ts +81 -0
- package/esm/alert/local-alert/root/LocalAlertRoot.js +42 -0
- package/esm/alert/local-alert/root/LocalAlertRoot.js.map +1 -0
- package/esm/alert/local-alert/title/LocalAlertTitle.d.ts +17 -0
- package/esm/alert/local-alert/title/LocalAlertTitle.js +16 -0
- package/esm/alert/local-alert/title/LocalAlertTitle.js.map +1 -0
- package/esm/date/Date.locale.d.ts +5 -0
- package/esm/index.d.ts +4 -0
- package/esm/index.js +4 -0
- package/esm/index.js.map +1 -1
- package/esm/inline-message/icon/InlineMessageIcon.d.ts +5 -0
- package/esm/inline-message/icon/InlineMessageIcon.js +19 -0
- package/esm/inline-message/icon/InlineMessageIcon.js.map +1 -0
- package/esm/inline-message/index.d.ts +2 -0
- package/esm/inline-message/index.js +3 -0
- package/esm/inline-message/index.js.map +1 -0
- package/esm/inline-message/root/InlineMessage.d.ts +36 -0
- package/esm/inline-message/root/InlineMessage.js +52 -0
- package/esm/inline-message/root/InlineMessage.js.map +1 -0
- package/esm/timeline/period/ClickablePeriod.js +6 -18
- package/esm/timeline/period/ClickablePeriod.js.map +1 -1
- package/esm/timeline/pin/PinInternal.js +6 -18
- package/esm/timeline/pin/PinInternal.js.map +1 -1
- package/esm/util/i18n/locales/en.d.ts +1 -4
- package/esm/util/i18n/locales/en.js +1 -4
- package/esm/util/i18n/locales/en.js.map +1 -1
- package/esm/util/i18n/locales/nb.d.ts +2 -6
- package/esm/util/i18n/locales/nb.js +2 -6
- package/esm/util/i18n/locales/nb.js.map +1 -1
- package/esm/util/i18n/locales/nn.d.ts +1 -4
- package/esm/util/i18n/locales/nn.js +1 -4
- package/esm/util/i18n/locales/nn.js.map +1 -1
- package/package.json +45 -4
- package/src/alert/Alert.tsx +2 -10
- package/src/alert/base-alert/close-button/BaseAlertCloseButton.tsx +44 -0
- package/src/alert/base-alert/content/BaseAlertContent.tsx +43 -0
- package/src/alert/base-alert/header/BaseAlertHeader.tsx +61 -0
- package/src/alert/base-alert/index.ts +2 -0
- package/src/alert/base-alert/namespace.ts +11 -0
- package/src/alert/base-alert/root/BaseAlertRoot.context.tsx +17 -0
- package/src/alert/base-alert/root/BaseAlertRoot.tsx +102 -0
- package/src/alert/base-alert/root/BaseAlertRoot.utils.tsx +67 -0
- package/src/alert/base-alert/title/BaseAlertTitle.tsx +63 -0
- package/src/alert/global-alert/close-button/GlobalAlertCloseButton.tsx +20 -0
- package/src/alert/global-alert/content/GlobalAlertContent.tsx +21 -0
- package/src/alert/global-alert/header/GlobalAlertHeader.tsx +24 -0
- package/src/alert/global-alert/index.ts +16 -0
- package/src/alert/global-alert/root/GlobalAlertRoot.tsx +132 -0
- package/src/alert/global-alert/title/GlobalAlertTitle.tsx +20 -0
- package/src/alert/info-card/content/InfoCardContent.tsx +21 -0
- package/src/alert/info-card/header/InfoCardHeader.tsx +19 -0
- package/src/alert/info-card/index.ts +14 -0
- package/src/alert/info-card/root/InfoCardRoot.tsx +120 -0
- package/src/alert/info-card/title/InfoCardTitle.tsx +20 -0
- package/src/alert/local-alert/close-button/LocalAlertCloseButton.tsx +20 -0
- package/src/alert/local-alert/content/LocalAlertContent.tsx +21 -0
- package/src/alert/local-alert/header/LocalAlertHeader.tsx +24 -0
- package/src/alert/local-alert/index.ts +16 -0
- package/src/alert/local-alert/root/LocalAlertRoot.tsx +133 -0
- package/src/alert/local-alert/title/LocalAlertTitle.tsx +20 -0
- package/src/index.ts +24 -0
- package/src/inline-message/icon/InlineMessageIcon.tsx +33 -0
- package/src/inline-message/index.ts +3 -0
- package/src/inline-message/root/InlineMessage.tsx +92 -0
- package/src/timeline/period/ClickablePeriod.tsx +5 -34
- package/src/timeline/pin/PinInternal.tsx +5 -28
- package/src/util/i18n/locales/en.ts +1 -5
- package/src/util/i18n/locales/nb.ts +1 -5
- package/src/util/i18n/locales/nn.ts +1 -5
- package/cjs/util/renderStoriesForChromatic.d.ts +0 -5
- package/cjs/util/renderStoriesForChromatic.js +0 -21
- package/cjs/util/renderStoriesForChromatic.js.map +0 -1
- package/esm/util/renderStoriesForChromatic.d.ts +0 -5
- package/esm/util/renderStoriesForChromatic.js +0 -15
- package/esm/util/renderStoriesForChromatic.js.map +0 -1
- package/src/util/renderStoriesForChromatic.tsx +0 -26
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
FloatingFocusManager,
|
|
3
3
|
autoUpdate,
|
|
4
|
-
arrow as flArrow,
|
|
5
4
|
flip,
|
|
6
5
|
offset,
|
|
7
6
|
safePolygon,
|
|
@@ -13,8 +12,8 @@ import {
|
|
|
13
12
|
useInteractions,
|
|
14
13
|
} from "@floating-ui/react";
|
|
15
14
|
import { format } from "date-fns";
|
|
16
|
-
import React, { forwardRef,
|
|
17
|
-
import { useRenameCSS
|
|
15
|
+
import React, { forwardRef, useState } from "react";
|
|
16
|
+
import { useRenameCSS } from "../../theme/Theme";
|
|
18
17
|
import { useMergeRefs } from "../../util/hooks/useMergeRefs";
|
|
19
18
|
import { useI18n } from "../../util/i18n/i18n.hooks";
|
|
20
19
|
import { useTimelineContext } from "../hooks/useTimelineContext";
|
|
@@ -37,16 +36,13 @@ export const PinInternal = forwardRef<HTMLButtonElement, TimelinePinProps>(
|
|
|
37
36
|
const { cn } = useRenameCSS();
|
|
38
37
|
const { startDate, endDate, direction } = useTimelineContext();
|
|
39
38
|
const [open, setOpen] = useState(false);
|
|
40
|
-
const arrowRef = useRef<HTMLDivElement | null>(null);
|
|
41
|
-
const translate = useI18n("Timeline");
|
|
42
39
|
|
|
43
|
-
const
|
|
44
|
-
const showArrow = !themeContext?.isDarkside;
|
|
40
|
+
const translate = useI18n("Timeline");
|
|
45
41
|
|
|
46
42
|
const {
|
|
47
43
|
context,
|
|
48
44
|
placement,
|
|
49
|
-
|
|
45
|
+
|
|
50
46
|
refs,
|
|
51
47
|
floatingStyles,
|
|
52
48
|
} = useFloating({
|
|
@@ -55,10 +51,9 @@ export const PinInternal = forwardRef<HTMLButtonElement, TimelinePinProps>(
|
|
|
55
51
|
onOpenChange: (_open) => setOpen(_open),
|
|
56
52
|
whileElementsMounted: autoUpdate,
|
|
57
53
|
middleware: [
|
|
58
|
-
offset(
|
|
54
|
+
offset(8),
|
|
59
55
|
shift(),
|
|
60
56
|
flip({ padding: 5, fallbackPlacements: ["bottom", "top"] }),
|
|
61
|
-
flArrow({ element: arrowRef, padding: 5 }),
|
|
62
57
|
],
|
|
63
58
|
});
|
|
64
59
|
|
|
@@ -79,13 +74,6 @@ export const PinInternal = forwardRef<HTMLButtonElement, TimelinePinProps>(
|
|
|
79
74
|
|
|
80
75
|
const mergedRef = useMergeRefs(refs.setReference, ref);
|
|
81
76
|
|
|
82
|
-
const staticSide = {
|
|
83
|
-
top: "bottom",
|
|
84
|
-
right: "left",
|
|
85
|
-
bottom: "top",
|
|
86
|
-
left: "right",
|
|
87
|
-
}[placement.split("-")[0]];
|
|
88
|
-
|
|
89
77
|
const label = translate("Pin.pin", {
|
|
90
78
|
date: format(date, translate("dateFormat")),
|
|
91
79
|
});
|
|
@@ -132,17 +120,6 @@ export const PinInternal = forwardRef<HTMLButtonElement, TimelinePinProps>(
|
|
|
132
120
|
style={floatingStyles}
|
|
133
121
|
>
|
|
134
122
|
{children}
|
|
135
|
-
{showArrow && (
|
|
136
|
-
<div
|
|
137
|
-
ref={arrowRef}
|
|
138
|
-
style={{
|
|
139
|
-
...(arrowX != null ? { left: arrowX } : {}),
|
|
140
|
-
...(arrowY != null ? { top: arrowY } : {}),
|
|
141
|
-
...(staticSide ? { [staticSide]: "-0.5rem" } : {}),
|
|
142
|
-
}}
|
|
143
|
-
className={cn("navds-timeline__popover-arrow")}
|
|
144
|
-
/>
|
|
145
|
-
)}
|
|
146
123
|
</div>
|
|
147
124
|
</FloatingFocusManager>
|
|
148
125
|
)}
|
|
@@ -8,15 +8,11 @@ export default {
|
|
|
8
8
|
showLess: "Show less",
|
|
9
9
|
readOnly: "Read-only",
|
|
10
10
|
close: "Close",
|
|
11
|
-
},
|
|
12
|
-
|
|
13
|
-
Alert: {
|
|
14
|
-
closeAlert: "Close alert",
|
|
15
|
-
closeMessage: "Close message",
|
|
16
11
|
error: "Error",
|
|
17
12
|
info: "Information",
|
|
18
13
|
success: "Success",
|
|
19
14
|
warning: "Warning",
|
|
15
|
+
announcement: "Announcement",
|
|
20
16
|
},
|
|
21
17
|
Chips: {
|
|
22
18
|
Removable: {
|
|
@@ -11,15 +11,11 @@ export default {
|
|
|
11
11
|
showLess: "Vis mindre",
|
|
12
12
|
readOnly: "Skrivebeskyttet",
|
|
13
13
|
close: "Lukk",
|
|
14
|
-
},
|
|
15
|
-
|
|
16
|
-
Alert: {
|
|
17
|
-
closeAlert: "Lukk varsel",
|
|
18
|
-
closeMessage: "Lukk melding",
|
|
19
14
|
error: "Feil",
|
|
20
15
|
info: "Informasjon",
|
|
21
16
|
success: "Suksess",
|
|
22
17
|
warning: "Advarsel",
|
|
18
|
+
announcement: "Kunngjøring",
|
|
23
19
|
},
|
|
24
20
|
Chips: {
|
|
25
21
|
Removable: {
|
|
@@ -8,15 +8,11 @@ export default {
|
|
|
8
8
|
showLess: "Vis mindre",
|
|
9
9
|
readOnly: "Skrivebeskytta",
|
|
10
10
|
close: "Lukk",
|
|
11
|
-
},
|
|
12
|
-
|
|
13
|
-
Alert: {
|
|
14
|
-
closeAlert: "Lukk varsel",
|
|
15
|
-
closeMessage: "Lukk melding",
|
|
16
11
|
error: "Feil",
|
|
17
12
|
info: "Informasjon",
|
|
18
13
|
success: "Suksess",
|
|
19
14
|
warning: "Åtvaring",
|
|
15
|
+
announcement: "Kunngjering",
|
|
20
16
|
},
|
|
21
17
|
Chips: {
|
|
22
18
|
Removable: {
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.renderStoriesForChromatic = renderStoriesForChromatic;
|
|
7
|
-
const react_1 = __importDefault(require("react"));
|
|
8
|
-
function renderStoriesForChromatic(stories) {
|
|
9
|
-
return {
|
|
10
|
-
render: (...args) => (react_1.default.createElement(react_1.default.Fragment, null, Object.entries(stories).map(([storyName, Story]) => {
|
|
11
|
-
var _a;
|
|
12
|
-
return (react_1.default.createElement("div", { key: storyName },
|
|
13
|
-
react_1.default.createElement("h2", { className: "storyheading" }, storyName),
|
|
14
|
-
typeof Story === "function" ? react_1.default.createElement(Story, null) : (_a = Story.render) === null || _a === void 0 ? void 0 : _a.call(Story, ...args)));
|
|
15
|
-
}))),
|
|
16
|
-
parameters: {
|
|
17
|
-
chromatic: { disable: false },
|
|
18
|
-
},
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=renderStoriesForChromatic.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"renderStoriesForChromatic.js","sourceRoot":"","sources":["../../src/util/renderStoriesForChromatic.tsx"],"names":[],"mappings":";;;;;AAIA,8DAqBC;AAxBD,kDAA0B;AAG1B,SAAgB,yBAAyB,CACvC,OAGC;IAED,OAAO;QACL,MAAM,EAAE,CAAC,GAAG,IAA0C,EAAE,EAAE,CAAC,CACzD,8DACG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,EAAE,KAAK,CAAC,EAAE,EAAE;;YAAC,OAAA,CACnD,uCAAK,GAAG,EAAE,SAAS;gBACjB,sCAAI,SAAS,EAAC,cAAc,IAAE,SAAS,CAAM;gBAC5C,OAAO,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC,8BAAC,KAAK,OAAG,CAAC,CAAC,CAAC,MAAA,KAAK,CAAC,MAAM,sDAAG,GAAG,IAAI,CAAC,CAC9D,CACP,CAAA;SAAA,CAAC,CACD,CACJ;QACD,UAAU,EAAE;YACV,SAAS,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE;SAC9B;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
export function renderStoriesForChromatic(stories) {
|
|
3
|
-
return {
|
|
4
|
-
render: (...args) => (React.createElement(React.Fragment, null, Object.entries(stories).map(([storyName, Story]) => {
|
|
5
|
-
var _a;
|
|
6
|
-
return (React.createElement("div", { key: storyName },
|
|
7
|
-
React.createElement("h2", { className: "storyheading" }, storyName),
|
|
8
|
-
typeof Story === "function" ? React.createElement(Story, null) : (_a = Story.render) === null || _a === void 0 ? void 0 : _a.call(Story, ...args)));
|
|
9
|
-
}))),
|
|
10
|
-
parameters: {
|
|
11
|
-
chromatic: { disable: false },
|
|
12
|
-
},
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=renderStoriesForChromatic.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"renderStoriesForChromatic.js","sourceRoot":"","sources":["../../src/util/renderStoriesForChromatic.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,UAAU,yBAAyB,CACvC,OAGC;IAED,OAAO;QACL,MAAM,EAAE,CAAC,GAAG,IAA0C,EAAE,EAAE,CAAC,CACzD,0CACG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,EAAE,KAAK,CAAC,EAAE,EAAE;;YAAC,OAAA,CACnD,6BAAK,GAAG,EAAE,SAAS;gBACjB,4BAAI,SAAS,EAAC,cAAc,IAAE,SAAS,CAAM;gBAC5C,OAAO,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC,oBAAC,KAAK,OAAG,CAAC,CAAC,CAAC,MAAA,KAAK,CAAC,MAAM,sDAAG,GAAG,IAAI,CAAC,CAC9D,CACP,CAAA;SAAA,CAAC,CACD,CACJ;QACD,UAAU,EAAE;YACV,SAAS,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE;SAC9B;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { Args, StoryObj } from "@storybook/react-vite";
|
|
2
|
-
import React from "react";
|
|
3
|
-
import { Renderer, StoryContext } from "storybook/internal/types";
|
|
4
|
-
|
|
5
|
-
export function renderStoriesForChromatic(
|
|
6
|
-
stories: Record<
|
|
7
|
-
string,
|
|
8
|
-
{ render?: (...args: any[]) => React.ReactNode } | React.FunctionComponent
|
|
9
|
-
>,
|
|
10
|
-
): StoryObj {
|
|
11
|
-
return {
|
|
12
|
-
render: (...args: [Args, StoryContext<Renderer, Args>]) => (
|
|
13
|
-
<>
|
|
14
|
-
{Object.entries(stories).map(([storyName, Story]) => (
|
|
15
|
-
<div key={storyName}>
|
|
16
|
-
<h2 className="storyheading">{storyName}</h2>
|
|
17
|
-
{typeof Story === "function" ? <Story /> : Story.render?.(...args)}
|
|
18
|
-
</div>
|
|
19
|
-
))}
|
|
20
|
-
</>
|
|
21
|
-
),
|
|
22
|
-
parameters: {
|
|
23
|
-
chromatic: { disable: false },
|
|
24
|
-
},
|
|
25
|
-
};
|
|
26
|
-
}
|