@norges-domstoler/dds-components 24.2.0 → 24.2.2
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 +25 -25
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +25 -19
- package/dist/index.d.cts +20 -14
- package/dist/index.d.mts +20 -14
- package/dist/index.mjs +25 -25
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -6
package/dist/index.cjs
CHANGED
|
@@ -7349,22 +7349,15 @@ const TextArea = ({ id, value, defaultValue, onChange, errorMessage, required =
|
|
|
7349
7349
|
};
|
|
7350
7350
|
TextArea.displayName = "TextArea";
|
|
7351
7351
|
//#endregion
|
|
7352
|
-
//#region src/components/Feedback/utils.tsx
|
|
7353
|
-
const getIconSize = (layout) => layout === "vertical" ? "large" : "medium";
|
|
7354
|
-
//#endregion
|
|
7355
7352
|
//#region src/components/Feedback/CommentComponent.tsx
|
|
7356
|
-
const CommentComponent = ({
|
|
7353
|
+
const CommentComponent = ({ rating, feedbackText, positiveFeedbackLabel, negativeFeedbackLabel, ratingSubmittedTitle, textAreaTip, loading, handleSubmit, handleFeedbackTextChange }) => {
|
|
7357
7354
|
const { t } = useTranslation();
|
|
7358
7355
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(VStack, {
|
|
7359
7356
|
gap: "x1",
|
|
7360
7357
|
children: [
|
|
7361
|
-
/* @__PURE__ */ (0, react_jsx_runtime.
|
|
7358
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
7362
7359
|
className: Feedback_module_default["rating-submitted-title"],
|
|
7363
|
-
children:
|
|
7364
|
-
icon: rating === "positive" ? ThumbUpFilledIcon : ThumbDownFilledIcon,
|
|
7365
|
-
color: "icon-action-resting",
|
|
7366
|
-
iconSize: getIconSize(layout)
|
|
7367
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Paragraph, { children: [ratingSubmittedTitle, " "] })]
|
|
7360
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Paragraph, { children: [ratingSubmittedTitle, " "] })
|
|
7368
7361
|
}),
|
|
7369
7362
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(TextArea, {
|
|
7370
7363
|
value: feedbackText,
|
|
@@ -7390,6 +7383,9 @@ const texts$17 = createTexts({ send: {
|
|
|
7390
7383
|
se: "Sádde"
|
|
7391
7384
|
} });
|
|
7392
7385
|
//#endregion
|
|
7386
|
+
//#region src/components/Feedback/utils.tsx
|
|
7387
|
+
const getButtonSize = (layout) => layout === "vertical" ? "medium" : "small";
|
|
7388
|
+
//#endregion
|
|
7393
7389
|
//#region src/components/Tooltip/Tooltip.tsx
|
|
7394
7390
|
const Tooltip = ({ text, placement = "bottom", children, tooltipId, delay = 100, style, onMouseLeave, onMouseOver, keepMounted = true, id, ref, className, htmlProps, ...rest }) => {
|
|
7395
7391
|
const generatedId = (0, react.useId)();
|
|
@@ -7485,26 +7481,32 @@ Tooltip.displayName = "Tooltip";
|
|
|
7485
7481
|
//#region src/components/Feedback/RatingComponent.tsx
|
|
7486
7482
|
const RatingComponent = ({ layout, ratingLabel, loading, thumbUpTooltip, thumbDownTooltip, handleRatingChange }) => {
|
|
7487
7483
|
const { t } = useTranslation();
|
|
7488
|
-
const
|
|
7489
|
-
"aria-label": tooltip,
|
|
7490
|
-
onClick: () => handleRatingChange(rating),
|
|
7491
|
-
size: getIconSize(layout),
|
|
7492
|
-
icon: rating === "positive" ? ThumbUpIcon : ThumbDownIcon,
|
|
7493
|
-
color: "icon-medium"
|
|
7494
|
-
});
|
|
7484
|
+
const buttonSize = getButtonSize(layout);
|
|
7495
7485
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
7496
7486
|
className: cn(Feedback_module_default["rating-container"], Feedback_module_default[`rating-container--${layout}`]),
|
|
7497
7487
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h2", {
|
|
7498
7488
|
className: typographyStyles_module_default["label-medium"],
|
|
7499
7489
|
children: ratingLabel
|
|
7500
7490
|
}), loading ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Spinner, { tooltip: t(texts$16.uploadingFeedback) }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(HStack, {
|
|
7501
|
-
gap: "
|
|
7491
|
+
gap: "x0.75",
|
|
7502
7492
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Tooltip, {
|
|
7503
7493
|
text: thumbUpTooltip,
|
|
7504
|
-
children:
|
|
7494
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
|
|
7495
|
+
purpose: "secondary",
|
|
7496
|
+
"aria-label": thumbUpTooltip,
|
|
7497
|
+
onClick: () => handleRatingChange("positive"),
|
|
7498
|
+
size: buttonSize,
|
|
7499
|
+
icon: ThumbUpIcon
|
|
7500
|
+
})
|
|
7505
7501
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Tooltip, {
|
|
7506
7502
|
text: thumbDownTooltip,
|
|
7507
|
-
children:
|
|
7503
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
|
|
7504
|
+
purpose: "secondary",
|
|
7505
|
+
"aria-label": thumbDownTooltip,
|
|
7506
|
+
onClick: () => handleRatingChange("negative"),
|
|
7507
|
+
size: buttonSize,
|
|
7508
|
+
icon: ThumbDownIcon
|
|
7509
|
+
})
|
|
7508
7510
|
})]
|
|
7509
7511
|
})]
|
|
7510
7512
|
});
|
|
@@ -7562,7 +7564,6 @@ const Feedback = ({ layout = "vertical", ratingLabel, positiveFeedbackLabel, neg
|
|
|
7562
7564
|
handleRatingChange
|
|
7563
7565
|
});
|
|
7564
7566
|
if (!feedbackTextAreaExcluded && !isFeedbackSubmitted) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CommentComponent, {
|
|
7565
|
-
layout,
|
|
7566
7567
|
rating,
|
|
7567
7568
|
feedbackText,
|
|
7568
7569
|
positiveFeedbackLabel: tPositiveFeedbackLabel,
|
|
@@ -9138,7 +9139,8 @@ const NewsPopover = ({ id, className, style, htmlProps, header, news, defaultAct
|
|
|
9138
9139
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(VStack, {
|
|
9139
9140
|
gap: "x0.75",
|
|
9140
9141
|
alignItems: "center",
|
|
9141
|
-
margin: "x0.75 x0.75
|
|
9142
|
+
margin: "x0.75 x0.75 0 x0.75",
|
|
9143
|
+
height: styleUpToBreakpoint("100%", smallScreenBreakpoint, "130px"),
|
|
9142
9144
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Heading, {
|
|
9143
9145
|
level: 3,
|
|
9144
9146
|
children: el.heading
|
|
@@ -9178,7 +9180,6 @@ const NewsPopover = ({ id, className, style, htmlProps, header, news, defaultAct
|
|
|
9178
9180
|
border: "border-subtle",
|
|
9179
9181
|
role: "dialog",
|
|
9180
9182
|
"aria-labelledby": headerId,
|
|
9181
|
-
height: isList ? "368px" : "327px",
|
|
9182
9183
|
width: styleUpToBreakpoint("100%", smallScreenBreakpoint, "500px"),
|
|
9183
9184
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(HStack, {
|
|
9184
9185
|
margin: "x0.75 x3 x0.75 x0.75",
|
|
@@ -9190,14 +9191,13 @@ const NewsPopover = ({ id, className, style, htmlProps, header, news, defaultAct
|
|
|
9190
9191
|
})
|
|
9191
9192
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(VStack, {
|
|
9192
9193
|
alignItems: "center",
|
|
9193
|
-
height: isList ? "299px" : void 0,
|
|
9194
9194
|
"aria-live": "polite",
|
|
9195
|
+
marginBlock: "0 x1.5",
|
|
9195
9196
|
children: [
|
|
9196
9197
|
content,
|
|
9197
9198
|
isList && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(HStack, {
|
|
9198
9199
|
alignItems: "center",
|
|
9199
9200
|
gap: "x1",
|
|
9200
|
-
marginBlock: "auto 0",
|
|
9201
9201
|
children: [
|
|
9202
9202
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
|
|
9203
9203
|
"aria-label": t(commonTexts.previousPage),
|