@norges-domstoler/dds-components 24.2.1 → 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 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 = ({ layout, rating, feedbackText, positiveFeedbackLabel, negativeFeedbackLabel, ratingSubmittedTitle, textAreaTip, loading, handleSubmit, handleFeedbackTextChange }) => {
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.jsxs)("span", {
7358
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
7362
7359
  className: Feedback_module_default["rating-submitted-title"],
7363
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, {
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 button = (rating, layout, tooltip) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(InlineIconButton, {
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: "x1",
7491
+ gap: "x0.75",
7502
7492
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Tooltip, {
7503
7493
  text: thumbUpTooltip,
7504
- children: button("positive", layout, thumbUpTooltip)
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: button("negative", layout, thumbDownTooltip)
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,