@dep-dio/dio-designsystem 0.5.0 → 0.6.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.
@@ -0,0 +1,2 @@
1
+ import React from "react";
2
+ export declare const Divider: React.FC;
@@ -0,0 +1,16 @@
1
+ import { type FileUploadProps as DsFileUploadProps } from "@digdir/designsystemet-react";
2
+ export interface FileUploadProps extends DsFileUploadProps {
3
+ controlClassName?: string;
4
+ label?: string;
5
+ description?: string;
6
+ errorMessage?: string;
7
+ isValid?: boolean;
8
+ isValidationVisible?: boolean;
9
+ isRequired?: boolean;
10
+ controlDescription1?: string;
11
+ controlDescription2?: string;
12
+ buttonText?: string;
13
+ requiredMessage?: string;
14
+ value?: string;
15
+ }
16
+ export declare function FileUpload({ className, controlClassName, label, description, controlDescription1, controlDescription2, buttonText, id, isValid, errorMessage, isValidationVisible, isRequired, requiredMessage, value, onChange, ...props }: FileUploadProps): import("react").JSX.Element;
package/dist/react.d.ts CHANGED
@@ -8,12 +8,14 @@ export { Checkbox, type CheckboxProps } from "./components/Checkbox/Checkbox";
8
8
  export { CheckboxFieldset, type CheckboxFieldsetProps, } from "./components/Checkbox/CheckboxFieldset";
9
9
  export { ControlGroup, type ControlGroupProps } from "./components/ControlGroup/ControlGroup";
10
10
  export { Details, type DetailsProps } from "./components/Details/Details";
11
+ export { Divider } from "./components/Divider/Divider";
11
12
  export { Dialog, type DialogProps } from "./components/Dialog/Dialog";
12
13
  export { Dropdown, type DropdownProps } from "./components/Dropdown/Dropdown";
13
14
  export { ErrorSummary, type ErrorSummaryItem, type ErrorSummaryProps, } from "./components/ErrorSummary/ErrorSummary";
14
15
  export { FeedbackBanner, type FeedbackBannerProps, } from "./components/FeedbackBanner/FeedbackBanner";
16
+ export { FileUpload, type FileUploadProps } from "./components/FileUpload/FileUpload";
15
17
  export { Form, type FormProps } from "./components/Form/Form";
16
- export { DEFAULT_REQUIRED_MESSAGE, Label, type LabelProps, } from "./components/Label/Label";
18
+ export { DEFAULT_REQUIRED_MESSAGE, Label, type LabelProps } from "./components/Label/Label";
17
19
  export { LinkList, type LinkListItem, type LinkListProps } from "./components/LinkList/LinkList";
18
20
  export { NavigationalLink, type NavigationalLinkProps, } from "./components/NavigationalLink/NavigationalLink";
19
21
  export { Pagination, type PaginationProps } from "./components/Pagination/Pagination";
package/dist/react.js CHANGED
@@ -5946,7 +5946,7 @@ var observeOffset = (instance, cb, readOffset) => {
5946
5946
  let offset4 = 0;
5947
5947
  const fallback = registerScrollendEvent ? null : debounce(
5948
5948
  targetWindow,
5949
- () => cb(offset4, false),
5949
+ () => cb(readOffset(element), false),
5950
5950
  instance.options.isScrollingResetDelay
5951
5951
  );
5952
5952
  const createHandler = (isScrolling) => () => {
@@ -6270,7 +6270,7 @@ var Virtualizer = class {
6270
6270
  };
6271
6271
  };
6272
6272
  this._willUpdate = () => {
6273
- var _a;
6273
+ var _a, _b;
6274
6274
  const scrollElement = this.options.enabled ? this.options.getScrollElement() : null;
6275
6275
  if (this.scrollElement !== scrollElement) {
6276
6276
  this.cleanup();
@@ -6372,7 +6372,11 @@ var Virtualizer = class {
6372
6372
  if (anchorDelta !== 0) {
6373
6373
  this._iosDeferredAdjustment += anchorDelta;
6374
6374
  }
6375
- } else {
6375
+ } else if (((_b = this.scrollState) == null ? void 0 : _b.behavior) === "smooth" && !approxEqual(
6376
+ this.getScrollOffset() - anchorDelta,
6377
+ this.scrollState.lastTargetOffset
6378
+ )) ;
6379
+ else {
6376
6380
  this._scrollToOffset(this.getScrollOffset(), {
6377
6381
  adjustments: void 0,
6378
6382
  behavior: void 0
@@ -7209,6 +7213,7 @@ function useVirtualizerBase({
7209
7213
  });
7210
7214
  directRef.current.enabled = directDomUpdates;
7211
7215
  directRef.current.mode = directDomUpdatesMode;
7216
+ const measuringFromRef = React5.useRef(false);
7212
7217
  const applyContainerSize = (instance2) => {
7213
7218
  const state = directRef.current;
7214
7219
  if (!state.enabled || !state.container) return;
@@ -7261,7 +7266,7 @@ function useVirtualizerBase({
7261
7266
  }
7262
7267
  }
7263
7268
  if (shouldRerender) {
7264
- if (useFlushSync && sync) {
7269
+ if (useFlushSync && sync && !measuringFromRef.current) {
7265
7270
  flushSync4(rerender);
7266
7271
  } else {
7267
7272
  rerender();
@@ -7272,6 +7277,15 @@ function useVirtualizerBase({
7272
7277
  };
7273
7278
  const [instance] = React5.useState(() => {
7274
7279
  const v = new Virtualizer(resolvedOptions);
7280
+ const measureElement2 = v.measureElement;
7281
+ v.measureElement = (node) => {
7282
+ measuringFromRef.current = true;
7283
+ try {
7284
+ measureElement2(node);
7285
+ } finally {
7286
+ measuringFromRef.current = false;
7287
+ }
7288
+ };
7275
7289
  return Object.assign(v, {
7276
7290
  containerRef: (node) => {
7277
7291
  const state = directRef.current;
@@ -8245,6 +8259,9 @@ var FileUpload = forwardRef61(function FileUpload2({ className, ...rest }, ref)
8245
8259
  });
8246
8260
  });
8247
8261
 
8262
+ // ../../node_modules/@digdir/designsystemet-react/dist/esm/components/file-upload/index.js
8263
+ var EXPERIMENTAL_FileUpload = FileUpload;
8264
+
8248
8265
  // ../../node_modules/@digdir/designsystemet-react/dist/esm/components/pagination/pagination-button.js
8249
8266
  import { forwardRef as forwardRef62 } from "react";
8250
8267
  import { jsx as jsx70 } from "react/jsx-runtime";
@@ -9112,7 +9129,7 @@ function SvgIcon({ name, width = 24, height = 24, className, label, style }) {
9112
9129
  }
9113
9130
 
9114
9131
  // src/components/Button/Button.tsx
9115
- import { jsx as jsx112, jsxs as jsxs17 } from "react/jsx-runtime";
9132
+ import { Fragment as Fragment5, jsx as jsx112, jsxs as jsxs17 } from "react/jsx-runtime";
9116
9133
  function Button3({
9117
9134
  className,
9118
9135
  color,
@@ -9125,7 +9142,9 @@ function Button3({
9125
9142
  size: size4,
9126
9143
  ...props
9127
9144
  }) {
9128
- return /* @__PURE__ */ jsxs17(
9145
+ const showIconLeft = iconLeft && !isLoading;
9146
+ const showIconRight = iconRight;
9147
+ return /* @__PURE__ */ jsx112(
9129
9148
  Button,
9130
9149
  {
9131
9150
  className,
@@ -9135,11 +9154,11 @@ function Button3({
9135
9154
  "aria-label": ariaLabel,
9136
9155
  "data-size": size4,
9137
9156
  ...props,
9138
- children: [
9139
- iconLeft && !isLoading && /* @__PURE__ */ jsx112(SvgIcon, { name: iconLeft }),
9157
+ children: showIconLeft || showIconRight ? /* @__PURE__ */ jsxs17(Fragment5, { children: [
9158
+ showIconLeft && /* @__PURE__ */ jsx112(SvgIcon, { name: iconLeft }),
9140
9159
  children,
9141
- iconRight && !isLoading && /* @__PURE__ */ jsx112(SvgIcon, { name: iconRight })
9142
- ]
9160
+ showIconRight && /* @__PURE__ */ jsx112(SvgIcon, { name: iconRight })
9161
+ ] }) : children
9143
9162
  }
9144
9163
  );
9145
9164
  }
@@ -9375,9 +9394,14 @@ function Details3({
9375
9394
  Details3.Summary = DetailsComponent.Summary;
9376
9395
  Details3.Content = DetailsComponent.Content;
9377
9396
 
9397
+ // src/components/Divider/Divider.tsx
9398
+ import "react";
9399
+ import { jsx as jsx123 } from "react/jsx-runtime";
9400
+ var Divider3 = () => /* @__PURE__ */ jsx123("hr", { "aria-hidden": "true", className: "dio-divider ds-divider" });
9401
+
9378
9402
  // src/components/Dialog/Dialog.tsx
9379
9403
  import { useEffect as useEffect18, useRef as useRef20 } from "react";
9380
- import { jsx as jsx123, jsxs as jsxs24 } from "react/jsx-runtime";
9404
+ import { jsx as jsx124, jsxs as jsxs24 } from "react/jsx-runtime";
9381
9405
  function Dialog3({
9382
9406
  children,
9383
9407
  className,
@@ -9408,7 +9432,7 @@ function Dialog3({
9408
9432
  onClose,
9409
9433
  ...props,
9410
9434
  children: [
9411
- title && /* @__PURE__ */ jsx123("h2", { className: "dio-text-heading-2", style: { marginBottom: "var(--ds-size-2)" }, children: title }),
9435
+ title && /* @__PURE__ */ jsx124("h2", { className: "dio-text-heading-2", style: { marginBottom: "var(--ds-size-2)" }, children: title }),
9412
9436
  children
9413
9437
  ]
9414
9438
  }
@@ -9419,9 +9443,9 @@ Dialog3.Trigger = DialogComponent.Trigger;
9419
9443
  Dialog3.TriggerContext = DialogComponent.TriggerContext;
9420
9444
 
9421
9445
  // src/components/Dropdown/Dropdown.tsx
9422
- import { jsx as jsx124 } from "react/jsx-runtime";
9446
+ import { jsx as jsx125 } from "react/jsx-runtime";
9423
9447
  function DropdownRoot({ className, children, ...props }) {
9424
- return /* @__PURE__ */ jsx124(DropdownComponent, { className, ...props, children });
9448
+ return /* @__PURE__ */ jsx125(DropdownComponent, { className, ...props, children });
9425
9449
  }
9426
9450
  var Dropdown2 = Object.assign(DropdownRoot, {
9427
9451
  TriggerContext: DropdownComponent.TriggerContext,
@@ -9433,14 +9457,14 @@ var Dropdown2 = Object.assign(DropdownRoot, {
9433
9457
  });
9434
9458
 
9435
9459
  // src/components/ErrorSummary/ErrorSummary.tsx
9436
- import { jsx as jsx125, jsxs as jsxs25 } from "react/jsx-runtime";
9460
+ import { jsx as jsx126, jsxs as jsxs25 } from "react/jsx-runtime";
9437
9461
  function ErrorSummary3({ title, errors, className, children, ...props }) {
9438
9462
  if (children) {
9439
- return /* @__PURE__ */ jsx125(ErrorSummaryComponent, { className, ...props, children });
9463
+ return /* @__PURE__ */ jsx126(ErrorSummaryComponent, { className, ...props, children });
9440
9464
  }
9441
9465
  return /* @__PURE__ */ jsxs25(ErrorSummaryComponent, { className, ...props, children: [
9442
- title && /* @__PURE__ */ jsx125(ErrorSummaryComponent.Heading, { children: title }),
9443
- errors && errors.length > 0 && /* @__PURE__ */ jsx125(ErrorSummaryComponent.List, { children: errors.map((error2) => /* @__PURE__ */ jsx125(ErrorSummaryComponent.Item, { children: /* @__PURE__ */ jsx125(ErrorSummaryComponent.Link, { href: error2.href, children: error2.label }) }, error2.label)) })
9466
+ title && /* @__PURE__ */ jsx126(ErrorSummaryComponent.Heading, { children: title }),
9467
+ errors && errors.length > 0 && /* @__PURE__ */ jsx126(ErrorSummaryComponent.List, { children: errors.map((error2) => /* @__PURE__ */ jsx126(ErrorSummaryComponent.Item, { children: /* @__PURE__ */ jsx126(ErrorSummaryComponent.Link, { href: error2.href, children: error2.label }) }, error2.label)) })
9444
9468
  ] });
9445
9469
  }
9446
9470
  ErrorSummary3.Heading = ErrorSummaryComponent.Heading;
@@ -9450,16 +9474,16 @@ ErrorSummary3.Link = ErrorSummaryComponent.Link;
9450
9474
 
9451
9475
  // src/components/FeedbackBanner/FeedbackBanner.tsx
9452
9476
  import classNames5 from "classnames";
9453
- import { jsx as jsx126, jsxs as jsxs26 } from "react/jsx-runtime";
9477
+ import { jsx as jsx127, jsxs as jsxs26 } from "react/jsx-runtime";
9454
9478
  function FeedbackBanner({
9455
9479
  color,
9456
9480
  className,
9457
9481
  children,
9458
9482
  closeLabel = "Lukk"
9459
9483
  }) {
9460
- return /* @__PURE__ */ jsx126("dio-feedback-banner", { className: classNames5("dio-feedback-banner", className), children: /* @__PURE__ */ jsxs26(Alert, { "data-color": color, children: [
9484
+ return /* @__PURE__ */ jsx127("dio-feedback-banner", { className: classNames5("dio-feedback-banner", className), children: /* @__PURE__ */ jsxs26(Alert, { "data-color": color, children: [
9461
9485
  children,
9462
- /* @__PURE__ */ jsx126(
9486
+ /* @__PURE__ */ jsx127(
9463
9487
  ButtonClose,
9464
9488
  {
9465
9489
  className: "dio-feedback-banner__close-button",
@@ -9470,18 +9494,70 @@ function FeedbackBanner({
9470
9494
  ] }) });
9471
9495
  }
9472
9496
 
9497
+ // src/components/FileUpload/FileUpload.tsx
9498
+ import { jsx as jsx128, jsxs as jsxs27 } from "react/jsx-runtime";
9499
+ function FileUpload3({
9500
+ className,
9501
+ controlClassName,
9502
+ label = "Last opp vedlegg",
9503
+ description = "Filer m\xE5 v\xE6re i PDF-format. Maksimal filst\xF8rrelse 10 MB",
9504
+ controlDescription1 = "Slipp filer her",
9505
+ controlDescription2,
9506
+ buttonText = "Last opp filer",
9507
+ id,
9508
+ isValid,
9509
+ errorMessage,
9510
+ isValidationVisible,
9511
+ isRequired,
9512
+ requiredMessage = DEFAULT_REQUIRED_MESSAGE,
9513
+ value,
9514
+ onChange,
9515
+ ...props
9516
+ }) {
9517
+ const isInvalid = !!(!isValid && isValidationVisible && errorMessage);
9518
+ return /* @__PURE__ */ jsxs27(FieldComponent, { className, children: [
9519
+ /* @__PURE__ */ jsx128(Label, { htmlFor: id, children: /* @__PURE__ */ jsx128(
9520
+ Label3,
9521
+ {
9522
+ isRequired,
9523
+ isInvalid,
9524
+ requiredMessage,
9525
+ children: label
9526
+ }
9527
+ ) }),
9528
+ /* @__PURE__ */ jsx128(FieldComponent.Description, { children: description }),
9529
+ /* @__PURE__ */ jsxs27(EXPERIMENTAL_FileUpload, { className: controlClassName, children: [
9530
+ controlDescription1 && /* @__PURE__ */ jsx128(FieldComponent.Description, { children: controlDescription1 }),
9531
+ controlDescription2 && /* @__PURE__ */ jsx128(FieldComponent.Description, { children: controlDescription2 }),
9532
+ /* @__PURE__ */ jsx128(Button3, { asChild: true, variant: "secondary", children: /* @__PURE__ */ jsx128("span", { children: buttonText }) }),
9533
+ /* @__PURE__ */ jsx128(
9534
+ "input",
9535
+ {
9536
+ type: "file",
9537
+ id,
9538
+ value,
9539
+ onChange,
9540
+ required: isRequired,
9541
+ ...props
9542
+ }
9543
+ )
9544
+ ] }),
9545
+ isInvalid && /* @__PURE__ */ jsx128(ValidationMessage3, { children: errorMessage })
9546
+ ] });
9547
+ }
9548
+
9473
9549
  // src/components/Form/Form.tsx
9474
9550
  import classNames6 from "classnames";
9475
- import { jsx as jsx127 } from "react/jsx-runtime";
9551
+ import { jsx as jsx129 } from "react/jsx-runtime";
9476
9552
  function Form({ className, children }) {
9477
- return /* @__PURE__ */ jsx127("div", { className: classNames6("dio-form dio-prose", className), children });
9553
+ return /* @__PURE__ */ jsx129("div", { className: classNames6("dio-form dio-prose", className), children });
9478
9554
  }
9479
9555
 
9480
9556
  // src/components/LinkList/LinkList.tsx
9481
9557
  import classNames7 from "classnames";
9482
- import { jsx as jsx128, jsxs as jsxs27 } from "react/jsx-runtime";
9558
+ import { jsx as jsx130, jsxs as jsxs28 } from "react/jsx-runtime";
9483
9559
  function LinkList({ links = [], className }) {
9484
- return /* @__PURE__ */ jsx128("ul", { className: classNames7("dio-link-list", className), children: links.map((link) => /* @__PURE__ */ jsx128("li", { className: "dio-link-list__item", children: /* @__PURE__ */ jsxs27(
9560
+ return /* @__PURE__ */ jsx130("ul", { className: classNames7("dio-link-list", className), children: links.map((link) => /* @__PURE__ */ jsx130("li", { className: "dio-link-list__item", children: /* @__PURE__ */ jsxs28(
9485
9561
  Link,
9486
9562
  {
9487
9563
  className: "dio-link-list__link",
@@ -9489,8 +9565,8 @@ function LinkList({ links = [], className }) {
9489
9565
  ...link.target ? { target: link.target } : {},
9490
9566
  ...link.rel ? { rel: link.rel } : {},
9491
9567
  children: [
9492
- /* @__PURE__ */ jsx128(SvgIcon, { name: "dio-chevron-right" }),
9493
- /* @__PURE__ */ jsx128("span", { children: link.label })
9568
+ /* @__PURE__ */ jsx130(SvgIcon, { name: "dio-chevron-right" }),
9569
+ /* @__PURE__ */ jsx130("span", { children: link.label })
9494
9570
  ]
9495
9571
  }
9496
9572
  ) }, link.href)) });
@@ -9498,7 +9574,7 @@ function LinkList({ links = [], className }) {
9498
9574
 
9499
9575
  // src/components/NavigationalLink/NavigationalLink.tsx
9500
9576
  import classNames8 from "classnames";
9501
- import { jsx as jsx129, jsxs as jsxs28 } from "react/jsx-runtime";
9577
+ import { jsx as jsx131, jsxs as jsxs29 } from "react/jsx-runtime";
9502
9578
  function NavigationalLink({
9503
9579
  children,
9504
9580
  className,
@@ -9506,25 +9582,25 @@ function NavigationalLink({
9506
9582
  iconRight = "dio-chevron-right",
9507
9583
  ...props
9508
9584
  }) {
9509
- return /* @__PURE__ */ jsxs28(
9585
+ return /* @__PURE__ */ jsxs29(
9510
9586
  Link,
9511
9587
  {
9512
9588
  className: classNames8("dio-navigational-link", className),
9513
9589
  "data-testid": "navigational-link",
9514
9590
  ...props,
9515
9591
  children: [
9516
- iconLeft && /* @__PURE__ */ jsx129(SvgIcon, { name: iconLeft }),
9517
- /* @__PURE__ */ jsx129("span", { children }),
9518
- iconRight && /* @__PURE__ */ jsx129(SvgIcon, { name: iconRight })
9592
+ iconLeft && /* @__PURE__ */ jsx131(SvgIcon, { name: iconLeft }),
9593
+ /* @__PURE__ */ jsx131("span", { children }),
9594
+ iconRight && /* @__PURE__ */ jsx131(SvgIcon, { name: iconRight })
9519
9595
  ]
9520
9596
  }
9521
9597
  );
9522
9598
  }
9523
9599
 
9524
9600
  // src/components/Pagination/Pagination.tsx
9525
- import { jsx as jsx130 } from "react/jsx-runtime";
9601
+ import { jsx as jsx132 } from "react/jsx-runtime";
9526
9602
  function PaginationRoot({ className, children, ...props }) {
9527
- return /* @__PURE__ */ jsx130(PaginationComponent, { className, ...props, children });
9603
+ return /* @__PURE__ */ jsx132(PaginationComponent, { className, ...props, children });
9528
9604
  }
9529
9605
  var Pagination3 = Object.assign(PaginationRoot, {
9530
9606
  List: PaginationComponent.List,
@@ -9533,7 +9609,7 @@ var Pagination3 = Object.assign(PaginationRoot, {
9533
9609
  });
9534
9610
 
9535
9611
  // src/components/Radio/Radio.tsx
9536
- import { jsx as jsx131 } from "react/jsx-runtime";
9612
+ import { jsx as jsx133 } from "react/jsx-runtime";
9537
9613
  function Radio3({
9538
9614
  className,
9539
9615
  isDisabled: isDisabled2,
@@ -9542,7 +9618,7 @@ function Radio3({
9542
9618
  onChange,
9543
9619
  ...props
9544
9620
  }) {
9545
- return /* @__PURE__ */ jsx131(
9621
+ return /* @__PURE__ */ jsx133(
9546
9622
  Radio,
9547
9623
  {
9548
9624
  ...{
@@ -9558,7 +9634,7 @@ function Radio3({
9558
9634
  }
9559
9635
 
9560
9636
  // src/components/Radio/RadioFieldset.tsx
9561
- import { jsx as jsx132, jsxs as jsxs29 } from "react/jsx-runtime";
9637
+ import { jsx as jsx134, jsxs as jsxs30 } from "react/jsx-runtime";
9562
9638
  function RadioFieldset({
9563
9639
  legend,
9564
9640
  description,
@@ -9568,15 +9644,15 @@ function RadioFieldset({
9568
9644
  className,
9569
9645
  ...props
9570
9646
  }) {
9571
- return /* @__PURE__ */ jsxs29(FieldsetComponent, { className, style, ...props, children: [
9572
- /* @__PURE__ */ jsx132(FieldsetComponent.Legend, { children: legend }),
9573
- description && /* @__PURE__ */ jsx132(FieldsetComponent.Description, { children: description }),
9574
- direction === "horizontal" ? /* @__PURE__ */ jsx132(ControlGroup, { children }) : children
9647
+ return /* @__PURE__ */ jsxs30(FieldsetComponent, { className, style, ...props, children: [
9648
+ /* @__PURE__ */ jsx134(FieldsetComponent.Legend, { children: legend }),
9649
+ description && /* @__PURE__ */ jsx134(FieldsetComponent.Description, { children: description }),
9650
+ direction === "horizontal" ? /* @__PURE__ */ jsx134(ControlGroup, { children }) : children
9575
9651
  ] });
9576
9652
  }
9577
9653
 
9578
9654
  // src/components/Select/Select.tsx
9579
- import { jsx as jsx133, jsxs as jsxs30 } from "react/jsx-runtime";
9655
+ import { jsx as jsx135, jsxs as jsxs31 } from "react/jsx-runtime";
9580
9656
  function SelectRoot({
9581
9657
  className,
9582
9658
  controlClassName,
@@ -9596,8 +9672,8 @@ function SelectRoot({
9596
9672
  ...props
9597
9673
  }) {
9598
9674
  const isInvalid = !!(!isValid && isValidationVisible && errorMessage);
9599
- return /* @__PURE__ */ jsxs30(FieldComponent, { className, children: [
9600
- label && /* @__PURE__ */ jsx133(Label, { htmlFor: id, children: /* @__PURE__ */ jsx133(
9675
+ return /* @__PURE__ */ jsxs31(FieldComponent, { className, children: [
9676
+ label && /* @__PURE__ */ jsx135(Label, { htmlFor: id, children: /* @__PURE__ */ jsx135(
9601
9677
  Label3,
9602
9678
  {
9603
9679
  isRequired,
@@ -9606,8 +9682,8 @@ function SelectRoot({
9606
9682
  children: label
9607
9683
  }
9608
9684
  ) }),
9609
- description && /* @__PURE__ */ jsx133(FieldComponent.Description, { children: description }),
9610
- /* @__PURE__ */ jsx133(
9685
+ description && /* @__PURE__ */ jsx135(FieldComponent.Description, { children: description }),
9686
+ /* @__PURE__ */ jsx135(
9611
9687
  SelectComponent,
9612
9688
  {
9613
9689
  className: controlClassName,
@@ -9621,7 +9697,7 @@ function SelectRoot({
9621
9697
  children
9622
9698
  }
9623
9699
  ),
9624
- isInvalid && /* @__PURE__ */ jsx133(ValidationMessage3, { children: errorMessage })
9700
+ isInvalid && /* @__PURE__ */ jsx135(ValidationMessage3, { children: errorMessage })
9625
9701
  ] });
9626
9702
  }
9627
9703
  var Select3 = Object.assign(SelectRoot, {
@@ -9631,7 +9707,7 @@ var Select3 = Object.assign(SelectRoot, {
9631
9707
 
9632
9708
  // src/components/Spinner/Spinner.tsx
9633
9709
  import classNames9 from "classnames";
9634
- import { jsx as jsx134, jsxs as jsxs31 } from "react/jsx-runtime";
9710
+ import { jsx as jsx136, jsxs as jsxs32 } from "react/jsx-runtime";
9635
9711
  function Spinner3({
9636
9712
  size: size4 = "md",
9637
9713
  textBefore,
@@ -9643,7 +9719,7 @@ function Spinner3({
9643
9719
  const label = ariaLabel ?? textAfter ?? textBefore ?? "Laster...";
9644
9720
  const dataSize = size4 === "2xl" ? "xl" : size4;
9645
9721
  const hasText = !!(textBefore || textAfter);
9646
- const icon = /* @__PURE__ */ jsx134(
9722
+ const icon = /* @__PURE__ */ jsx136(
9647
9723
  Spinner,
9648
9724
  {
9649
9725
  className: hasText ? "spinner__icon" : className,
@@ -9655,15 +9731,15 @@ function Spinner3({
9655
9731
  if (!hasText) {
9656
9732
  return icon;
9657
9733
  }
9658
- return /* @__PURE__ */ jsxs31("div", { className: classNames9("spinner", className), "data-testid": "spinner", children: [
9659
- textBefore && /* @__PURE__ */ jsx134("p", { className: "dio-text-large spinner__text", children: textBefore }),
9734
+ return /* @__PURE__ */ jsxs32("div", { className: classNames9("spinner", className), "data-testid": "spinner", children: [
9735
+ textBefore && /* @__PURE__ */ jsx136("p", { className: "dio-text-large spinner__text", children: textBefore }),
9660
9736
  icon,
9661
- textAfter && /* @__PURE__ */ jsx134("p", { className: "dio-text-large spinner__text", children: textAfter })
9737
+ textAfter && /* @__PURE__ */ jsx136("p", { className: "dio-text-large spinner__text", children: textAfter })
9662
9738
  ] });
9663
9739
  }
9664
9740
 
9665
9741
  // src/components/Switch/Switch.tsx
9666
- import { jsx as jsx135 } from "react/jsx-runtime";
9742
+ import { jsx as jsx137 } from "react/jsx-runtime";
9667
9743
  function Switch3({
9668
9744
  className,
9669
9745
  isDisabled: isDisabled2,
@@ -9672,7 +9748,7 @@ function Switch3({
9672
9748
  onChange,
9673
9749
  ...props
9674
9750
  }) {
9675
- return /* @__PURE__ */ jsx135(
9751
+ return /* @__PURE__ */ jsx137(
9676
9752
  Switch,
9677
9753
  {
9678
9754
  ...{
@@ -9688,9 +9764,9 @@ function Switch3({
9688
9764
  }
9689
9765
 
9690
9766
  // src/components/Tabs/Tabs.tsx
9691
- import { jsx as jsx136 } from "react/jsx-runtime";
9767
+ import { jsx as jsx138 } from "react/jsx-runtime";
9692
9768
  function TabsRoot({ className, children, ...props }) {
9693
- return /* @__PURE__ */ jsx136(TabsComponent, { className, ...props, children });
9769
+ return /* @__PURE__ */ jsx138(TabsComponent, { className, ...props, children });
9694
9770
  }
9695
9771
  var Tabs3 = Object.assign(TabsRoot, {
9696
9772
  List: TabsComponent.List,
@@ -9699,7 +9775,7 @@ var Tabs3 = Object.assign(TabsRoot, {
9699
9775
  });
9700
9776
 
9701
9777
  // src/components/Textarea/Textarea.tsx
9702
- import { jsx as jsx137, jsxs as jsxs32 } from "react/jsx-runtime";
9778
+ import { jsx as jsx139, jsxs as jsxs33 } from "react/jsx-runtime";
9703
9779
  function Textarea3({
9704
9780
  className,
9705
9781
  controlClassName,
@@ -9717,8 +9793,8 @@ function Textarea3({
9717
9793
  ...props
9718
9794
  }) {
9719
9795
  const isInvalid = !!(!isValid && isValidationVisible && errorMessage);
9720
- return /* @__PURE__ */ jsxs32(FieldComponent, { className, children: [
9721
- label && /* @__PURE__ */ jsx137(Label, { htmlFor: id, children: /* @__PURE__ */ jsx137(
9796
+ return /* @__PURE__ */ jsxs33(FieldComponent, { className, children: [
9797
+ label && /* @__PURE__ */ jsx139(Label, { htmlFor: id, children: /* @__PURE__ */ jsx139(
9722
9798
  Label3,
9723
9799
  {
9724
9800
  isRequired,
@@ -9727,8 +9803,8 @@ function Textarea3({
9727
9803
  children: label
9728
9804
  }
9729
9805
  ) }),
9730
- description && /* @__PURE__ */ jsx137(FieldComponent.Description, { children: description }),
9731
- /* @__PURE__ */ jsx137(
9806
+ description && /* @__PURE__ */ jsx139(FieldComponent.Description, { children: description }),
9807
+ /* @__PURE__ */ jsx139(
9732
9808
  Textarea,
9733
9809
  {
9734
9810
  id,
@@ -9741,12 +9817,12 @@ function Textarea3({
9741
9817
  ...props
9742
9818
  }
9743
9819
  ),
9744
- isInvalid && /* @__PURE__ */ jsx137(ValidationMessage3, { children: errorMessage })
9820
+ isInvalid && /* @__PURE__ */ jsx139(ValidationMessage3, { children: errorMessage })
9745
9821
  ] });
9746
9822
  }
9747
9823
 
9748
9824
  // src/components/Textfield/Textfield.tsx
9749
- import { jsx as jsx138 } from "react/jsx-runtime";
9825
+ import { jsx as jsx140 } from "react/jsx-runtime";
9750
9826
  function Textfield3({
9751
9827
  className,
9752
9828
  isValid,
@@ -9761,12 +9837,12 @@ function Textfield3({
9761
9837
  ...props
9762
9838
  }) {
9763
9839
  const isInvalid = !!(!isValid && isValidationVisible && errorMessage);
9764
- return /* @__PURE__ */ jsx138(
9840
+ return /* @__PURE__ */ jsx140(
9765
9841
  Textfield,
9766
9842
  {
9767
9843
  ...{
9768
9844
  className,
9769
- label: label ? /* @__PURE__ */ jsx138(
9845
+ label: label ? /* @__PURE__ */ jsx140(
9770
9846
  Label3,
9771
9847
  {
9772
9848
  isRequired,
@@ -9788,12 +9864,7 @@ function Textfield3({
9788
9864
 
9789
9865
  // src/theme-colors.ts
9790
9866
  var themeColors = ["primary", "accent1", "regjeringsbla", "neutral"];
9791
- var severityColors = Object.keys({
9792
- info: true,
9793
- success: true,
9794
- warning: true,
9795
- danger: true
9796
- });
9867
+ var severityColors = ["info", "success", "warning", "danger"];
9797
9868
  var colors = [...themeColors, ...severityColors];
9798
9869
  export {
9799
9870
  Alert3 as Alert,
@@ -9808,9 +9879,11 @@ export {
9808
9879
  DEFAULT_REQUIRED_MESSAGE,
9809
9880
  Details3 as Details,
9810
9881
  Dialog3 as Dialog,
9882
+ Divider3 as Divider,
9811
9883
  Dropdown2 as Dropdown,
9812
9884
  ErrorSummary3 as ErrorSummary,
9813
9885
  FeedbackBanner,
9886
+ FileUpload3 as FileUpload,
9814
9887
  Form,
9815
9888
  Label3 as Label,
9816
9889
  LinkList,