@norges-domstoler/dds-components 0.0.0-dev-20260902110237 → 0.0.0-dev-20260909072655
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 +9 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +9 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -9094,10 +9094,12 @@ var NewsPopover_module_default = {
|
|
|
9094
9094
|
//#region src/components/NewsPopover/NewsPopover.tsx
|
|
9095
9095
|
const NewsPopover = ({ id, className, style, htmlProps, header, news, defaultActiveSlide = 0, activeSlide: activeSlideProp, setActiveSlide: setActiveSlideProp, isOpen: isOpenProp, isInitiallyOpen = true, setIsOpen: setIsOpenProp, smallScreenBreakpoint = "xs", closeOnClickOutside = true, ref, ...rest }) => {
|
|
9096
9096
|
if (news.length === 0) throw new Error("NewsPopover must have at least one item in \"news\" prop");
|
|
9097
|
-
|
|
9097
|
+
const maxHeaderLength = 45;
|
|
9098
|
+
const maxTextLength = 150;
|
|
9099
|
+
if (header.length > maxHeaderLength) console.warn(`[NewsPopover] header exceeds recommended length (about ${maxHeaderLength} characters). This may cause wrapping or layout issues depending on theme.`);
|
|
9098
9100
|
news.forEach((n, i) => {
|
|
9099
|
-
if (n.heading.length >
|
|
9100
|
-
if (n.text.length >
|
|
9101
|
+
if (n.heading.length > maxHeaderLength) console.warn(`[NewsPopover] news[${i}].heading exceeds recommended length (about ${maxHeaderLength} characters). This may cause wrapping or layout issues depending on theme.`);
|
|
9102
|
+
if (n.text.length > maxTextLength) console.warn(`[NewsPopover] news[${i}].text exceeds recommended length (about ${maxTextLength} characters). This may cause wrapping or layout issues depending on theme.`);
|
|
9101
9103
|
});
|
|
9102
9104
|
const { t } = useTranslation();
|
|
9103
9105
|
const [activeSlide, setActiveSlide] = useControllableState({
|
|
@@ -9136,7 +9138,8 @@ const NewsPopover = ({ id, className, style, htmlProps, header, news, defaultAct
|
|
|
9136
9138
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(VStack, {
|
|
9137
9139
|
gap: "x0.75",
|
|
9138
9140
|
alignItems: "center",
|
|
9139
|
-
margin: "x0.75 x0.75
|
|
9141
|
+
margin: "x0.75 x0.75 0 x0.75",
|
|
9142
|
+
height: styleUpToBreakpoint("100%", smallScreenBreakpoint, "130px"),
|
|
9140
9143
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Heading, {
|
|
9141
9144
|
level: 3,
|
|
9142
9145
|
children: el.heading
|
|
@@ -9176,8 +9179,7 @@ const NewsPopover = ({ id, className, style, htmlProps, header, news, defaultAct
|
|
|
9176
9179
|
border: "border-subtle",
|
|
9177
9180
|
role: "dialog",
|
|
9178
9181
|
"aria-labelledby": headerId,
|
|
9179
|
-
|
|
9180
|
-
width: styleUpToBreakpoint("100%", smallScreenBreakpoint, "405px"),
|
|
9182
|
+
width: styleUpToBreakpoint("100%", smallScreenBreakpoint, "500px"),
|
|
9181
9183
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(HStack, {
|
|
9182
9184
|
margin: "x0.75 x3 x0.75 x0.75",
|
|
9183
9185
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Heading, {
|
|
@@ -9188,14 +9190,13 @@ const NewsPopover = ({ id, className, style, htmlProps, header, news, defaultAct
|
|
|
9188
9190
|
})
|
|
9189
9191
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(VStack, {
|
|
9190
9192
|
alignItems: "center",
|
|
9191
|
-
height: isList ? "299px" : void 0,
|
|
9192
9193
|
"aria-live": "polite",
|
|
9194
|
+
marginBlock: "0 x1.5",
|
|
9193
9195
|
children: [
|
|
9194
9196
|
content,
|
|
9195
9197
|
isList && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(HStack, {
|
|
9196
9198
|
alignItems: "center",
|
|
9197
9199
|
gap: "x1",
|
|
9198
|
-
marginBlock: "auto 0",
|
|
9199
9200
|
children: [
|
|
9200
9201
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
|
|
9201
9202
|
"aria-label": t(commonTexts.previousPage),
|