@norges-domstoler/dds-components 0.0.0-dev-20261109081525 → 0.0.0-dev-20261110081609

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
@@ -1679,50 +1679,205 @@ var Badge_module_default = {
1679
1679
  "neutral": "dds-Badge-module__neutral",
1680
1680
  "subtle": "dds-Badge-module__subtle"
1681
1681
  };
1682
- const Badge = ({ id, className, style, htmlProps, purpose = "notification", size = "medium", children, max = 9, showZero = false, ...rest }) => {
1683
- const hasChildren = !!children || showZero && children === 0;
1684
- const heightVariant = hasChildren ? "withChildren" : "noChildren";
1685
- const height = {
1686
- withChildren: {
1687
- xsmall: "18px",
1688
- small: "21px",
1689
- medium: "24px",
1690
- large: "27px"
1691
- },
1692
- noChildren: {
1693
- xsmall: "x0.5",
1694
- small: "x0.75",
1695
- medium: "x1",
1696
- large: "x1.5"
1697
- }
1698
- };
1699
- const color = {
1700
- notification: "text-on-notification",
1701
- action: "text-on-action",
1702
- neutral: "text-on-inverse",
1703
- subtle: "text-default"
1704
- };
1705
- const displayValue = hasChildren && max && children > max ? `${max}+` : children;
1706
- if (!(!showZero && children === 0 ? false : true)) return null;
1682
+ // src/components/Typography/Typography/TextOverflowEllipsis/TextOverflowEllipsis.module.css
1683
+ var TextOverflowEllipsis_module_default = {
1684
+ "wrapper": "dds-TextOverflowEllipsis-module__wrapper",
1685
+ "inner": "dds-TextOverflowEllipsis-module__inner"
1686
+ };
1687
+ // src/components/Typography/Typography/TextOverflowEllipsis/TextOverflowEllipsis.tsx
1688
+ function TextOverflowEllipsisWrapper({ className, ...rest }) {
1689
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1690
+ ...rest,
1691
+ className: cn(className, TextOverflowEllipsis_module_default.wrapper)
1692
+ });
1693
+ }
1694
+ function TextOverflowEllipsisInner({ className, ...rest }) {
1695
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1696
+ ...rest,
1697
+ className: cn(className, TextOverflowEllipsis_module_default.inner)
1698
+ });
1699
+ }
1700
+ // src/components/Typography/Typography/Typography.module.css
1701
+ var Typography_module_default = { "container": "dds-Typography-module__container" };
1702
+ // src/components/Typography/Typography/Typography.types.ts
1703
+ const TG_BODY_SHORT_TYPES = [
1704
+ "body-short-xsmall",
1705
+ "body-short-small",
1706
+ "body-short-medium",
1707
+ "body-short-large"
1708
+ ];
1709
+ const TG_BODY_LONG_TYPES = [
1710
+ "body-long-xsmall",
1711
+ "body-long-small",
1712
+ "body-long-medium",
1713
+ "body-long-large"
1714
+ ];
1715
+ const TG_BODY_TYPES = [...TG_BODY_SHORT_TYPES, ...TG_BODY_LONG_TYPES];
1716
+ const TG_LEAD_TYPES = ["lead-medium"];
1717
+ const TG_HEADING_TYPES = [
1718
+ "heading-xxsmall",
1719
+ "heading-xsmall",
1720
+ "heading-small",
1721
+ "heading-medium",
1722
+ "heading-large",
1723
+ "heading-xlarge",
1724
+ "heading-xxlarge"
1725
+ ];
1726
+ // src/components/Typography/Typography/Typography.utils.ts
1727
+ const getElementType = (element) => {
1728
+ switch (element) {
1729
+ case "a": return "a";
1730
+ case "heading-xxsmall": return "h6";
1731
+ case "heading-xsmall": return "h5";
1732
+ case "heading-small": return "h4";
1733
+ case "heading-medium": return "h3";
1734
+ case "heading-large": return "h2";
1735
+ case "heading-xlarge":
1736
+ case "heading-xxlarge": return "h1";
1737
+ case "label-medium": return "label";
1738
+ default: return "p";
1739
+ }
1740
+ };
1741
+ const isHeading = (type) => {
1742
+ return TG_HEADING_TYPES.includes(type);
1743
+ };
1744
+ const isLegend = (as) => {
1745
+ return as === "legend";
1746
+ };
1747
+ const isCaption = (as) => {
1748
+ return as === "caption";
1749
+ };
1750
+ const inlineElements = [
1751
+ "a",
1752
+ "abbr",
1753
+ "audio",
1754
+ "b",
1755
+ "bdi",
1756
+ "bdo",
1757
+ "big",
1758
+ "br",
1759
+ "button",
1760
+ "canvas",
1761
+ "cite",
1762
+ "code",
1763
+ "data",
1764
+ "datalist",
1765
+ "del",
1766
+ "dfn",
1767
+ "em",
1768
+ "embed",
1769
+ "i",
1770
+ "iframe",
1771
+ "img",
1772
+ "input",
1773
+ "ins",
1774
+ "kbd",
1775
+ "label",
1776
+ "map",
1777
+ "mark",
1778
+ "meter",
1779
+ "noscript",
1780
+ "object",
1781
+ "output",
1782
+ "picture",
1783
+ "progress",
1784
+ "q",
1785
+ "ruby",
1786
+ "s",
1787
+ "samp",
1788
+ "script",
1789
+ "select",
1790
+ "slot",
1791
+ "small",
1792
+ "span",
1793
+ "strong",
1794
+ "sub",
1795
+ "sup",
1796
+ "svg",
1797
+ "template",
1798
+ "textarea",
1799
+ "time",
1800
+ "u",
1801
+ "var",
1802
+ "video",
1803
+ "wbr"
1804
+ ];
1805
+ const isInlineElement = (as) => inlineElements.indexOf(as) !== -1;
1806
+ const getColorCn = (color) => {
1807
+ if (!isTextColor(color)) return null;
1808
+ const [prefix] = color.split("-", 1);
1809
+ return typographyStyles_module_default[`${prefix}-color--${color.slice(prefix.length + 1)}`] || null;
1810
+ };
1811
+ // src/components/helpers/styling/focus.module.css
1812
+ const _key1 = "dds-focus-module__focusable";
1813
+ var focus_module_default = {
1814
+ "focused": "dds-focus-module__focused",
1815
+ "focusable": "dds-focus-module__focusable",
1816
+ "focusable-focus": "dds-focus-module__focusable-focus",
1817
+ "focusable-within": "dds-focus-module__focusable-within",
1818
+ "has-focusable-input": "dds-focus-module__has-focusable-input",
1819
+ "focusable-sibling": "dds-focus-module__focusable-sibling",
1820
+ "focus-styled-sibling": "dds-focus-module__focus-styled-sibling",
1821
+ "focusable--inset": "dds-focus-module__focusable--inset"
1822
+ };
1823
+ // src/components/Typography/Typography/Typography.tsx
1824
+ const isAnchorProps = (props) => props.typographyType === "a";
1825
+ const Typography = (props) => {
1826
+ const { typographyType = "body-long-medium", as: propAs, children, bold, underline, italic, style, id, withMargins, color, className, htmlProps = {}, ...rest } = props;
1827
+ const as = propAs ? propAs : getElementType(typographyType);
1828
+ let relProp;
1829
+ if (isAnchorProps(props)) relProp = as === "a" ? "noopener noreferer" : void 0;
1707
1830
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Box, {
1708
- as: "span",
1709
- paddingInline: hasChildren ? "x0.25" : void 0,
1710
- minWidth: height[heightVariant][size],
1711
- maxWidth: "fit-content",
1712
- height: height[heightVariant][size],
1713
- display: "inline-flex",
1714
- alignItems: "center",
1715
- justifyContent: "center",
1716
- ...getBaseHTMLProps(id, cn(className, Badge_module_default.container, Badge_module_default[purpose], typographyStyles_module_default[`body-short-${size}`]), style, htmlProps, rest),
1717
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Typography, {
1718
- as: "span",
1719
- typographyType: `body-short-${size}`,
1720
- color: color[purpose],
1721
- children: displayValue
1722
- })
1831
+ ...getBaseHTMLProps(id, cn(className, getColorCn(color), Typography_module_default.container, typographyStyles_module_default[typographyType], withMargins && typographyStyles_module_default[`${typographyType}--margins`], isLegend(as) && typographyStyles_module_default.legend, isCaption(as) && typographyStyles_module_default.caption, isCaption(as) && withMargins && typographyStyles_module_default["caption--withMargins"], bold && typographyStyles_module_default.bold, underline && typographyStyles_module_default.underline, italic && typographyStyles_module_default.italic, as === "a" && "dds-focus-module__focusable"), {
1832
+ ...style,
1833
+ color: color && !isTextColor(color) ? getTextColor(color) : void 0
1834
+ }, htmlProps, rest),
1835
+ as,
1836
+ rel: relProp,
1837
+ children
1723
1838
  });
1724
1839
  };
1725
- Badge.displayName = "Badge";
1840
+ Typography.displayName = "Typography";
1841
+ // src/components/Typography/Caption/Caption.tsx
1842
+ const Caption = ({ typographyType = "heading-large", id, className, style, htmlProps, children, ...rest }) => {
1843
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Typography, {
1844
+ ...getBaseHTMLProps(id, className, style, htmlProps, rest),
1845
+ typographyType,
1846
+ as: "caption",
1847
+ children
1848
+ });
1849
+ };
1850
+ Caption.displayName = "Caption";
1851
+ // src/components/Typography/Heading/Heading.tsx
1852
+ const getHeadingElement = (level) => `h${level}`;
1853
+ const getDefaultTypographyType = (h) => {
1854
+ switch (h) {
1855
+ case "h1": return "heading-xlarge";
1856
+ case "h2": return "heading-large";
1857
+ case "h3": return "heading-medium";
1858
+ case "h4": return "heading-small";
1859
+ case "h5": return "heading-xsmall";
1860
+ case "h6": return "heading-xxsmall";
1861
+ default: return "heading-xlarge";
1862
+ }
1863
+ };
1864
+ const Heading = ({ id, className, style, htmlProps, children, typographyType, level, withMargins, withMarginsOverInput, ...rest }) => {
1865
+ const headingElement = getHeadingElement(level);
1866
+ const standardTypographyType = typographyType ?? getDefaultTypographyType(headingElement);
1867
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Typography, {
1868
+ ...getBaseHTMLProps(id, cn(className, withMarginsOverInput && typographyStyles_module_default["heading--margins-over-input"]), style, htmlProps, rest),
1869
+ typographyType: standardTypographyType,
1870
+ as: headingElement,
1871
+ withMargins: optAttr(withMargins || withMarginsOverInput),
1872
+ children
1873
+ });
1874
+ };
1875
+ Heading.displayName = "Heading";
1876
+ // src/components/Typography/Label/Label.module.css
1877
+ var Label_module_default = {
1878
+ "read-only": "dds-Label-module__read-only",
1879
+ "read-only__icon": "dds-Label-module__read-only__icon"
1880
+ };
1726
1881
  // src/components/Icon/Icon.tsx
1727
1882
  const getSize = (iconSize) => {
1728
1883
  switch (iconSize) {
@@ -1745,412 +1900,62 @@ function Icon(props) {
1745
1900
  });
1746
1901
  }
1747
1902
  Icon.displayName = "Icon";
1748
- // src/components/Spinner/Spinner.module.css
1749
- var Spinner_module_default = {
1750
- "svg": "dds-Spinner-module__svg",
1751
- "jordskifterett": "dds-Spinner-module__jordskifterett",
1752
- "lagmannsrett": "dds-Spinner-module__lagmannsrett",
1753
- "tingrett": "dds-Spinner-module__tingrett"
1754
- };
1755
- // src/i18n/LanguageProvider.tsx
1756
- const LanguageContext = (0, react.createContext)(void 0);
1757
- function LanguageProvider({ language, children }) {
1758
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LanguageContext, {
1759
- value: { language },
1760
- children
1761
- });
1762
- }
1763
- function useLanguage() {
1764
- const lang = (0, react.useContext)(LanguageContext)?.language;
1765
- if (!lang) throw new Error("useLangage must be used within DdsProvider.");
1766
- return lang;
1767
- }
1768
- // src/i18n/translation.tsx
1769
- function useTranslation() {
1770
- const lang = useLanguage();
1771
- const t = (text) => text[lang];
1772
- return {
1773
- t,
1774
- lang
1775
- };
1776
- }
1777
- function createTexts(texts) {
1778
- return texts;
1779
- }
1780
- // src/i18n/commonTexts.tsx
1781
- const commonTexts = createTexts({
1782
- clearSelect: {
1783
- no: "Tøm nedtrekksliste",
1784
- nb: "Tøm nedtrekksliste",
1785
- nn: "Tøm nedtrekksliste",
1786
- en: "Clear selection",
1787
- se: "Gidde válljemiid"
1788
- },
1789
- close: {
1790
- nb: "Lukk",
1791
- no: "Lukk",
1792
- nn: "Lukk",
1793
- en: "Close",
1794
- se: "Gidde"
1795
- },
1796
- closeMessage: {
1797
- nb: "Lukk melding",
1798
- no: "Lukk melding",
1799
- nn: "Lukk melding",
1800
- en: "Close message",
1801
- se: "Gidde dieđu"
1802
- },
1803
- loading: {
1804
- nb: "Innlastning pågår",
1805
- no: "Innlastning pågår",
1806
- nn: "Innlastning pågår",
1807
- en: "Loading",
1808
- se: "Viežžamin"
1809
- },
1810
- nextPage: {
1811
- nb: "Neste side",
1812
- no: "Neste side",
1813
- nn: "Neste side",
1814
- en: "Next page",
1815
- se: "Boahte siidu"
1816
- },
1817
- previousPage: {
1818
- nb: "Forrige side",
1819
- no: "Forrige side",
1820
- nn: "Førre side",
1821
- en: "Previous page",
1822
- se: "Ovddit siidu"
1823
- },
1824
- page: (page) => ({
1825
- nb: `Side ${page}`,
1826
- no: `Side ${page}`,
1827
- nn: `Side ${page}`,
1828
- en: `Page ${page}`,
1829
- se: `Siidu ${page}`
1830
- }),
1831
- currentPage: (page) => ({
1832
- nb: `Nåværende side (${page})`,
1833
- no: `Nåværende side (${page})`,
1834
- nn: `Noverande side (${page})`,
1835
- en: `Current page (${page})`,
1836
- se: `Dála siidu (${page})`
1837
- }),
1838
- pageOf: (current, max) => ({
1839
- nb: `Side ${current} av ${max}`,
1840
- no: `Side ${current} av ${max}`,
1841
- nn: `Side ${current} ${max}`,
1842
- en: `Page ${current} of ${max}`,
1843
- se: `Siidu ${current} ${max}`
1844
- })
1845
- });
1846
- // src/components/Spinner/Spinner.tsx
1847
- function Spinner(props) {
1848
- const { size = "var(--dds-size-6)", color = "icon-action-resting", tooltip, id, className, htmlProps, style, ...rest } = props;
1849
- const { t } = useTranslation();
1850
- const uniqueId = `${(0, react.useId)()}-spinnerTitle`;
1903
+ // src/components/Icon/Icon.module.css
1904
+ var Icon_module_default = { "svg": "dds-Icon-module__svg" };
1905
+ // src/components/Icon/utils/SvgWrapper.tsx
1906
+ const size = 24;
1907
+ const sizeCSS = "var(--dds-size-6)";
1908
+ function SvgWrapper({ height, width, fill = "currentColor", className, title, children, iconState: _iconState, style, ...props }) {
1851
1909
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
1852
- viewBox: "0 0 25 25",
1853
- role: "progressbar",
1854
- "aria-labelledby": uniqueId,
1855
- ...getBaseHTMLProps(id, cn(className, Spinner_module_default.svg), {
1910
+ ...props,
1911
+ fill: getIconColor(fill),
1912
+ xmlns: "http://www.w3.org/2000/svg",
1913
+ viewBox: `0 0 ${size} ${size}`,
1914
+ className: cn(className, Icon_module_default.svg),
1915
+ style: {
1856
1916
  ...style,
1857
- width: size,
1858
- height: size,
1859
- ["--dds-color-spinner"]: getTextColor(color)
1860
- }, htmlProps, rest),
1917
+ height: height ? height : sizeCSS,
1918
+ width: width ? width : sizeCSS
1919
+ },
1920
+ children: [title && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("title", { children: title }), children]
1921
+ });
1922
+ }
1923
+ // src/components/Icon/icons/addressShielded.tsx
1924
+ /** Access and people. Search terms: adresse, address, skjermet, shielded, beskyttet, protected. */
1925
+ function AddressShieldedIcon(props) {
1926
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(SvgWrapper, {
1927
+ ...props,
1861
1928
  children: [
1862
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("title", {
1863
- id: uniqueId,
1864
- children: tooltip ?? t(commonTexts.loading)
1865
- }),
1866
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("circle", {
1867
- cx: "12",
1868
- cy: "12.25",
1869
- r: "6",
1870
- className: Spinner_module_default.jordskifterett
1871
- }),
1872
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("rect", {
1873
- x: "4",
1874
- y: "10.25",
1875
- width: "16",
1876
- height: "4",
1877
- className: Spinner_module_default.lagmannsrett
1878
- }),
1879
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
1880
- d: "M12 16.6154C16.4183 16.6154 20 12.7581 20 8H4C4 12.7581 7.58172 16.6154 12 16.6154Z",
1881
- className: Spinner_module_default.tingrett
1882
- })
1929
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M16.75 17V15C16.75 14.6685 16.8818 14.3506 17.1162 14.1162C17.3506 13.8818 17.6685 13.75 18 13.75C18.3315 13.75 18.6494 13.8818 18.8838 14.1162C19.1182 14.3506 19.25 14.6685 19.25 15V17C19.25 17.4142 19.5858 17.75 20 17.75C20.4142 17.75 20.75 17.4142 20.75 17V15C20.75 14.2707 20.4601 13.5714 19.9443 13.0557C19.4286 12.5399 18.7293 12.25 18 12.25C17.2707 12.25 16.5714 12.5399 16.0557 13.0557C15.5399 13.5714 15.25 14.2707 15.25 15V17C15.25 17.4142 15.5858 17.75 16 17.75C16.4142 17.75 16.75 17.4142 16.75 17Z" }),
1930
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M14.75 18C14.75 17.8619 14.8619 17.75 15 17.75H21C21.1381 17.75 21.25 17.8619 21.25 18V21C21.25 21.1381 21.1381 21.25 21 21.25H15C14.8619 21.25 14.75 21.1381 14.75 21V18ZM13.25 21C13.25 21.9665 14.0335 22.75 15 22.75H21C21.9665 22.75 22.75 21.9665 22.75 21V18C22.75 17.0335 21.9665 16.25 21 16.25H15C14.0335 16.25 13.25 17.0335 13.25 18V21Z" }),
1931
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M2.25 18.9995V9.99951C2.25 9.59973 2.33759 9.20494 2.50586 8.84229C2.67423 8.47943 2.9191 8.15714 3.22461 7.89893L10.2207 1.90283L10.2246 1.89893C10.721 1.47943 11.3501 1.24951 12 1.24951C12.5686 1.24951 13.1213 1.42547 13.583 1.75049L13.7754 1.89893L13.7793 1.90283L20.7744 7.89893C21.0799 8.15715 21.3258 8.47941 21.4941 8.84229C21.6625 9.20514 21.7501 9.60048 21.75 10.0005C21.7497 10.4145 21.414 10.7495 21 10.7495C20.5858 10.7494 20.2499 10.4137 20.25 9.99951C20.25 9.81778 20.2103 9.63799 20.1338 9.47314C20.0573 9.3083 19.9455 9.16175 19.8066 9.04443L19.8027 9.0415L12.8027 3.0415C12.5778 2.85324 12.2934 2.74951 12 2.74951C11.7063 2.74951 11.4213 2.85196 11.1963 3.04053L4.19727 9.0415L4.19336 9.04443C4.05455 9.16175 3.94274 9.3083 3.86621 9.47314C3.78972 9.638 3.75 9.81778 3.75 9.99951V18.9995C3.75 19.331 3.88179 19.6499 4.11621 19.8843C4.35061 20.1185 4.6686 20.2495 5 20.2495L10 20.2505C10.4142 20.2505 10.75 20.5863 10.75 21.0005C10.7497 21.4145 10.4141 21.7495 10 21.7495H5C4.27077 21.7495 3.57136 21.4604 3.05566 20.9448C2.53994 20.4291 2.25 19.7289 2.25 18.9995Z" })
1883
1932
  ]
1884
1933
  });
1885
1934
  }
1886
- Spinner.displayName = "Spinner";
1887
- // src/components/helpers/styling/focus.module.css
1888
- const _key1 = "dds-focus-module__focusable";
1889
- var focus_module_default = {
1890
- "focused": "dds-focus-module__focused",
1891
- "focusable": "dds-focus-module__focusable",
1892
- "focusable-focus": "dds-focus-module__focusable-focus",
1893
- "focusable-within": "dds-focus-module__focusable-within",
1894
- "has-focusable-input": "dds-focus-module__has-focusable-input",
1895
- "focusable-sibling": "dds-focus-module__focusable-sibling",
1896
- "focus-styled-sibling": "dds-focus-module__focus-styled-sibling",
1897
- "focusable--inset": "dds-focus-module__focusable--inset"
1898
- };
1899
- // src/components/helpers/Dropdown/DropdownItem.tsx
1900
- const DropdownItem = ({ icon, className, children: propChildren, purpose = "default", loading, loadingTooltip, badgeProps, ...rest }) => {
1901
- const itemCns = [
1902
- DropdownItem_module_default.item,
1903
- DropdownItem_module_default[purpose],
1904
- typographyStyles_module_default["body-short-medium"]
1905
- ];
1906
- const interactiveItemCns = [
1907
- ...itemCns,
1908
- focus_module_default["focusable--inset"],
1909
- DropdownItem_module_default["item--interactive"]
1910
- ];
1911
- const children = loading ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1912
- className: cn(loading && utilStyles_module_default.invisible),
1913
- children: propChildren
1914
- }) : propChildren;
1915
- const cns = rest.as === "span" ? itemCns : interactiveItemCns;
1916
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Box, {
1917
- display: "flex",
1918
- alignItems: "center",
1919
- padding: "x0.75",
1920
- gap: "x0.25",
1921
- width: "100%",
1922
- className: cn(className, ...cns, loading && DropdownItem_module_default["item--loading"]),
1923
- "aria-disabled": loading ? true : void 0,
1924
- ...rest,
1935
+ // src/components/Icon/icons/agreement.tsx
1936
+ /** Services. Search terms: avtale, agreement, kontrakt, contract, dokument, document. */
1937
+ function AgreementIcon(props) {
1938
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(SvgWrapper, {
1939
+ ...props,
1925
1940
  children: [
1926
- loading && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1927
- className: cn(utilStyles_module_default["center-absolute"]),
1928
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Spinner, {
1929
- size: "var(--dds-size-icon-component)",
1930
- tooltip: loadingTooltip
1931
- })
1932
- }),
1933
- icon && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, {
1934
- iconSize: "inherit",
1935
- icon,
1936
- className: cn(loading && utilStyles_module_default.invisible)
1937
- }),
1938
- children,
1939
- badgeProps && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Box, {
1940
- as: Badge,
1941
- ...badgeProps,
1942
- size: "small",
1943
- marginInline: "x0.25 0"
1944
- })
1941
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M10.4697 16.4697C10.7626 16.1768 11.2374 16.1768 11.5303 16.4697L13.5303 18.4697C13.6576 18.597 13.8092 18.6976 13.9756 18.7665C14.1419 18.8354 14.32 18.871 14.5 18.871C14.68 18.871 14.8581 18.8354 15.0244 18.7665C15.1908 18.6976 15.3424 18.597 15.4697 18.4697C15.5971 18.3423 15.6977 18.1907 15.7666 18.0244C15.8355 17.858 15.8711 17.68 15.8711 17.4999C15.8711 17.3199 15.8355 17.1419 15.7666 16.9755C15.6977 16.8092 15.5971 16.6576 15.4697 16.5302C15.1768 16.2373 15.1768 15.7626 15.4697 15.4697C15.7626 15.1768 16.2374 15.1768 16.5303 15.4697C16.7969 15.7363 17.008 16.0529 17.1523 16.4013C17.2966 16.7497 17.3711 17.1229 17.3711 17.4999C17.3711 17.877 17.2966 18.2502 17.1523 18.5986C17.008 18.9469 16.7969 19.2636 16.5303 19.5302C16.2637 19.7968 15.947 20.008 15.5986 20.1523C15.2503 20.2966 14.8771 20.371 14.5 20.371C14.1229 20.371 13.7497 20.2966 13.4014 20.1523C13.053 20.008 12.7364 19.7968 12.4697 19.5302L10.4697 17.5302C10.1768 17.2373 10.1768 16.7626 10.4697 16.4697Z" }),
1942
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M13.4695 13.4692C13.7623 13.1765 14.2372 13.1767 14.53 13.4692L17.03 15.9692C17.2872 16.2263 17.6362 16.3715 17.9998 16.3715C18.3635 16.3715 18.7123 16.2263 18.9695 15.9692C19.2265 15.7121 19.3707 15.3639 19.3709 15.0004C19.3709 14.6368 19.2266 14.2879 18.9695 14.0307L15.0896 10.1498C14.6677 9.72854 14.096 9.49261 13.4998 9.49261C12.9036 9.49267 12.3317 9.72952 11.9099 10.1508L11.909 10.1498L11.03 11.0307C10.4916 11.569 9.76113 11.8715 8.99977 11.8715C8.23839 11.8715 7.50791 11.569 6.9695 11.0307C6.43113 10.4923 6.1288 9.76177 6.12868 9.00042C6.12868 8.2389 6.43102 7.50765 6.9695 6.96917L9.78004 4.1596C10.8105 3.13189 12.155 2.47627 13.5994 2.29828C15.0428 2.12051 16.5042 2.42939 17.7527 3.17523L18.2234 3.4555L18.2273 3.45746C18.4934 3.61807 18.81 3.67378 19.115 3.61371L20.8523 3.26507C21.2583 3.18348 21.6534 3.446 21.7351 3.85199C21.8168 4.25794 21.5541 4.65295 21.1482 4.7348L19.408 5.08538H19.405C18.7351 5.21734 18.0407 5.09471 17.4558 4.74261V4.74456L16.9861 4.46429L16.9851 4.46331C16.0226 3.88786 14.895 3.65037 13.782 3.78753C12.669 3.92477 11.6336 4.42922 10.8396 5.22113L8.03004 8.0307C7.77309 8.28784 7.62868 8.63689 7.62868 9.00042C7.6288 9.36378 7.77321 9.71215 8.03004 9.96917C8.28716 10.2263 8.63616 10.3715 8.99977 10.3715C9.36347 10.3715 9.71233 10.2263 9.9695 9.96917L10.8494 9.08929C11.5524 8.3872 12.5062 7.99267 13.4998 7.99261C14.4315 7.99261 15.3277 8.33932 16.0154 8.96136L16.1502 9.08929L20.03 12.9692C20.5685 13.5077 20.8709 14.2389 20.8709 15.0004C20.8707 15.7618 20.5684 16.4923 20.03 17.0307C19.4916 17.569 18.7611 17.8715 17.9998 17.8715C17.2384 17.8715 16.5079 17.569 15.9695 17.0307L13.4695 14.5307C13.1766 14.2378 13.1766 13.7621 13.4695 13.4692Z" }),
1943
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M20.9316 2.25288C21.344 2.2154 21.7094 2.51931 21.7471 2.93159L22.7471 13.9316C22.7661 14.1414 22.6958 14.3502 22.5537 14.5058C22.4116 14.6613 22.2107 14.75 22 14.75H20C19.5858 14.75 19.25 14.4142 19.25 14C19.25 13.5857 19.5858 13.25 20 13.25H21.1787L20.2529 3.06831C20.2154 2.65595 20.5194 2.2906 20.9316 2.25288Z" }),
1944
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M3.06835 2.25288C3.48064 2.2906 3.78455 2.65595 3.74707 3.06831L2.77832 13.7177L9.03027 19.9697C9.28744 20.2269 9.6363 20.371 10 20.371C10.3637 20.371 10.7125 20.2269 10.9697 19.9697C11.2269 19.7125 11.3711 19.3636 11.3711 19C11.3711 18.6363 11.2269 18.2874 10.9697 18.0302C10.6768 17.7373 10.6768 17.2626 10.9697 16.9697C11.2626 16.6768 11.7374 16.6768 12.0303 16.9697C12.5687 17.5082 12.8711 18.2384 12.8711 19C12.8711 19.7615 12.5687 20.4917 12.0303 21.0302C11.4918 21.5687 10.7615 21.871 10 21.871C9.23847 21.871 8.5082 21.5687 7.96972 21.0302L1.46972 14.5302C1.31233 14.3728 1.23277 14.1533 1.25292 13.9316L2.25293 2.93159C2.29065 2.51931 2.65599 2.2154 3.06835 2.25288Z" }),
1945
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M11 3.25C11.4142 3.25 11.75 3.58579 11.75 4C11.75 4.41421 11.4142 4.75 11 4.75H3C2.58579 4.75 2.25 4.41421 2.25 4C2.25 3.58579 2.58579 3.25 3 3.25H11Z" })
1945
1946
  ]
1946
1947
  });
1947
- };
1948
- // src/components/helpers/Dropdown/DropdownHeader.tsx
1949
- const DropdownHeader = ({ className, ...rest }) => {
1950
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Box, {
1951
- as: "h2",
1952
- padding: "x0.75 x0.75 0 x0.75",
1953
- ...rest,
1954
- className: cn(className, typographyStyles_module_default["heading-xsmall"])
1955
- });
1956
- };
1957
- // src/components/helpers/HiddenInput/HiddenInput.tsx
1958
- /**
1959
- * Usynlig `<input>` til bruk for skjermlesere, typisk for custom radioknapper o.l..
1960
- *
1961
- * @component
1962
- * @param {Object} props - Standard HTML-attributter for komponenten.
1963
- *
1964
- * @returns {JSX.Element} Et usynlig `<input>`-element.
1965
-
1966
- * @example
1967
- * ```tsx
1968
- * <label htmlFor="id">
1969
- * <HiddenInput id="id" />
1970
- * //visuell erstatning for input
1971
- * </label>
1972
- * });
1973
- * ```
1974
- */
1975
- const HiddenInput = ({ className, ...rest }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
1976
- className: cn(className, utilStyles_module_default["hide-input"]),
1977
- ...rest
1978
- });
1979
- // src/components/helpers/StylelessButton/StylelessButton.tsx
1980
- /**
1981
- * Normalisert `<button>` uten styling. Base for custom buttom styling.
1982
- *
1983
- * @component
1984
- * @template T ekstra props ved behov.
1985
- * @param {Object & T} props - Standard HTML-attributter for komponenten med mulig utvidelse.
1986
- *
1987
- * @returns {JSX.Element} `<button>`-element uten styling.
1988
-
1989
- * @example
1990
- * ```tsx
1991
- * <StylelessButton className="min-styling">
1992
- * Tekst
1993
- * </StylelessButton>
1994
- * ```
1995
- */
1996
- const StylelessButton = ({ className, ...rest }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
1997
- ...rest,
1998
- className: cn(className, utilStyles_module_default["remove-button-styling"], utilStyles_module_default["normalize-button"])
1999
- });
2000
- // src/components/helpers/StylelessList/StylelessList.tsx
2001
- /**
2002
- * Normalisert `<ul>` uten styling. Base for custom ul styling.
2003
- *
2004
- * @component
2005
- * @template T ekstra props ved behov.
2006
- * @param {Object & T} props - Standard HTML-attributter for komponenten med mulig utvidelse.
2007
- *
2008
- * @returns {JSX.Element} `<ul>`-element uten styling.
2009
-
2010
- * @example
2011
- * ```tsx
2012
- * <StylelessList className="min-styling">
2013
- * <li>item</li>
2014
- * <li>item</li>
2015
- * </StylelessList>
2016
- * ```
2017
- */
2018
- const StylelessList = ({ className, ...rest }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
2019
- ...rest,
2020
- className: cn(className, utilStyles_module_default["remove-list-styling"])
2021
- });
2022
- /**
2023
- * Normalisert `<ol>` uten styling. Base for custom ol styling.
2024
- *
2025
- * @component
2026
- * @template T ekstra props ved behov.
2027
- * @param {Object & T} props - Standard HTML-attributter for komponenten med mulig utvidelse.
2028
- *
2029
- * @returns {JSX.Element} `<ol>`-element uten styling.
2030
-
2031
- * @example
2032
- * ```tsx
2033
- * <StylelessOList className="min-styling">
2034
- * <li>item</li>
2035
- * <li>item</li>
2036
- * </StylelessOList>
2037
- * ```
2038
- */
2039
- const StylelessOList = ({ className, ...rest }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ol", {
2040
- ...rest,
2041
- className: cn(className, utilStyles_module_default["remove-list-styling"])
2042
- });
2043
- // src/components/helpers/styling/utils.ts
2044
- /**
2045
- * Styling utils i TS (CSS-in-JS)
2046
- */
2047
- /**
2048
- * DDS utils
2049
- */
2050
- const outlineOffset = "var(--dds-spacing-x0-125)";
2051
- const outlineInset = "calc(var(--dds-spacing-x0-125) * -1)";
2052
- const focusVisible = {
2053
- outline: "var(--dds-color-focus-outside) 2px solid",
2054
- outlineOffset,
2055
- boxShadow: "0 0 0 2px var(--dds-color-focus-inside)"
2056
- };
2057
- const focusVisibleTransitionValue = "outline-offset var(--dds-motion-micro-state)";
2058
- const focusVisibleInset = {
2059
- outline: "var(--dds-color-focus-outside) 2px solid",
2060
- outlineOffset: outlineInset
2061
- };
2062
- const scrollbarStyling = {
2063
- scrollbarColor: "var(--dds-color-surface-scrollbar) transparent",
2064
- scrollbarWidth: "thin"
2065
- };
2066
- /**
2067
- * Generelle utils
2068
- */
2069
- const hideInput = {
2070
- clip: "rect(0 0 0 0)",
2071
- position: "absolute",
2072
- height: "1px",
2073
- width: "1px",
2074
- margin: 0
2075
- };
2076
- const inheritLinkStyling = {
2077
- color: "inherit",
2078
- textDecoration: "inherit"
2079
- };
2080
- const removeButtonStyling = {
2081
- background: "none",
2082
- color: "inherit",
2083
- border: "none",
2084
- padding: 0,
2085
- font: "inherit",
2086
- cursor: "pointer",
2087
- outline: "inherit"
2088
- };
2089
- const removeListStyling = {
2090
- listStyle: "none",
2091
- padding: 0,
2092
- margin: 0
2093
- };
2094
- const normalizeButton = {
2095
- margin: 0,
2096
- textTransform: "none"
2097
- };
2098
- // src/components/Icon/Icon.module.css
2099
- var Icon_module_default = { "svg": "dds-Icon-module__svg" };
2100
- // src/components/Icon/utils/SvgWrapper.tsx
2101
- const size = 24;
2102
- const sizeCSS = "var(--dds-size-6)";
2103
- function SvgWrapper({ height, width, fill = "currentColor", className, title, children, iconState: _iconState, style, ...props }) {
2104
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
2105
- ...props,
2106
- fill: getIconColor(fill),
2107
- xmlns: "http://www.w3.org/2000/svg",
2108
- viewBox: `0 0 ${size} ${size}`,
2109
- className: cn(className, Icon_module_default.svg),
2110
- style: {
2111
- ...style,
2112
- height: height ? height : sizeCSS,
2113
- width: width ? width : sizeCSS
2114
- },
2115
- children: [title && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("title", { children: title }), children]
2116
- });
2117
- }
2118
- // src/components/Icon/icons/addressShielded.tsx
2119
- /** Access and people. Search terms: adresse, address, skjermet, shielded, beskyttet, protected. */
2120
- function AddressShieldedIcon(props) {
2121
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(SvgWrapper, {
2122
- ...props,
2123
- children: [
2124
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M16.75 17V15C16.75 14.6685 16.8818 14.3506 17.1162 14.1162C17.3506 13.8818 17.6685 13.75 18 13.75C18.3315 13.75 18.6494 13.8818 18.8838 14.1162C19.1182 14.3506 19.25 14.6685 19.25 15V17C19.25 17.4142 19.5858 17.75 20 17.75C20.4142 17.75 20.75 17.4142 20.75 17V15C20.75 14.2707 20.4601 13.5714 19.9443 13.0557C19.4286 12.5399 18.7293 12.25 18 12.25C17.2707 12.25 16.5714 12.5399 16.0557 13.0557C15.5399 13.5714 15.25 14.2707 15.25 15V17C15.25 17.4142 15.5858 17.75 16 17.75C16.4142 17.75 16.75 17.4142 16.75 17Z" }),
2125
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M14.75 18C14.75 17.8619 14.8619 17.75 15 17.75H21C21.1381 17.75 21.25 17.8619 21.25 18V21C21.25 21.1381 21.1381 21.25 21 21.25H15C14.8619 21.25 14.75 21.1381 14.75 21V18ZM13.25 21C13.25 21.9665 14.0335 22.75 15 22.75H21C21.9665 22.75 22.75 21.9665 22.75 21V18C22.75 17.0335 21.9665 16.25 21 16.25H15C14.0335 16.25 13.25 17.0335 13.25 18V21Z" }),
2126
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M2.25 18.9995V9.99951C2.25 9.59973 2.33759 9.20494 2.50586 8.84229C2.67423 8.47943 2.9191 8.15714 3.22461 7.89893L10.2207 1.90283L10.2246 1.89893C10.721 1.47943 11.3501 1.24951 12 1.24951C12.5686 1.24951 13.1213 1.42547 13.583 1.75049L13.7754 1.89893L13.7793 1.90283L20.7744 7.89893C21.0799 8.15715 21.3258 8.47941 21.4941 8.84229C21.6625 9.20514 21.7501 9.60048 21.75 10.0005C21.7497 10.4145 21.414 10.7495 21 10.7495C20.5858 10.7494 20.2499 10.4137 20.25 9.99951C20.25 9.81778 20.2103 9.63799 20.1338 9.47314C20.0573 9.3083 19.9455 9.16175 19.8066 9.04443L19.8027 9.0415L12.8027 3.0415C12.5778 2.85324 12.2934 2.74951 12 2.74951C11.7063 2.74951 11.4213 2.85196 11.1963 3.04053L4.19727 9.0415L4.19336 9.04443C4.05455 9.16175 3.94274 9.3083 3.86621 9.47314C3.78972 9.638 3.75 9.81778 3.75 9.99951V18.9995C3.75 19.331 3.88179 19.6499 4.11621 19.8843C4.35061 20.1185 4.6686 20.2495 5 20.2495L10 20.2505C10.4142 20.2505 10.75 20.5863 10.75 21.0005C10.7497 21.4145 10.4141 21.7495 10 21.7495H5C4.27077 21.7495 3.57136 21.4604 3.05566 20.9448C2.53994 20.4291 2.25 19.7289 2.25 18.9995Z" })
2127
- ]
2128
- });
2129
- }
2130
- // src/components/Icon/icons/agreement.tsx
2131
- /** Services. Search terms: avtale, agreement, kontrakt, contract, dokument, document. */
2132
- function AgreementIcon(props) {
2133
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(SvgWrapper, {
2134
- ...props,
2135
- children: [
2136
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M10.4697 16.4697C10.7626 16.1768 11.2374 16.1768 11.5303 16.4697L13.5303 18.4697C13.6576 18.597 13.8092 18.6976 13.9756 18.7665C14.1419 18.8354 14.32 18.871 14.5 18.871C14.68 18.871 14.8581 18.8354 15.0244 18.7665C15.1908 18.6976 15.3424 18.597 15.4697 18.4697C15.5971 18.3423 15.6977 18.1907 15.7666 18.0244C15.8355 17.858 15.8711 17.68 15.8711 17.4999C15.8711 17.3199 15.8355 17.1419 15.7666 16.9755C15.6977 16.8092 15.5971 16.6576 15.4697 16.5302C15.1768 16.2373 15.1768 15.7626 15.4697 15.4697C15.7626 15.1768 16.2374 15.1768 16.5303 15.4697C16.7969 15.7363 17.008 16.0529 17.1523 16.4013C17.2966 16.7497 17.3711 17.1229 17.3711 17.4999C17.3711 17.877 17.2966 18.2502 17.1523 18.5986C17.008 18.9469 16.7969 19.2636 16.5303 19.5302C16.2637 19.7968 15.947 20.008 15.5986 20.1523C15.2503 20.2966 14.8771 20.371 14.5 20.371C14.1229 20.371 13.7497 20.2966 13.4014 20.1523C13.053 20.008 12.7364 19.7968 12.4697 19.5302L10.4697 17.5302C10.1768 17.2373 10.1768 16.7626 10.4697 16.4697Z" }),
2137
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M13.4695 13.4692C13.7623 13.1765 14.2372 13.1767 14.53 13.4692L17.03 15.9692C17.2872 16.2263 17.6362 16.3715 17.9998 16.3715C18.3635 16.3715 18.7123 16.2263 18.9695 15.9692C19.2265 15.7121 19.3707 15.3639 19.3709 15.0004C19.3709 14.6368 19.2266 14.2879 18.9695 14.0307L15.0896 10.1498C14.6677 9.72854 14.096 9.49261 13.4998 9.49261C12.9036 9.49267 12.3317 9.72952 11.9099 10.1508L11.909 10.1498L11.03 11.0307C10.4916 11.569 9.76113 11.8715 8.99977 11.8715C8.23839 11.8715 7.50791 11.569 6.9695 11.0307C6.43113 10.4923 6.1288 9.76177 6.12868 9.00042C6.12868 8.2389 6.43102 7.50765 6.9695 6.96917L9.78004 4.1596C10.8105 3.13189 12.155 2.47627 13.5994 2.29828C15.0428 2.12051 16.5042 2.42939 17.7527 3.17523L18.2234 3.4555L18.2273 3.45746C18.4934 3.61807 18.81 3.67378 19.115 3.61371L20.8523 3.26507C21.2583 3.18348 21.6534 3.446 21.7351 3.85199C21.8168 4.25794 21.5541 4.65295 21.1482 4.7348L19.408 5.08538H19.405C18.7351 5.21734 18.0407 5.09471 17.4558 4.74261V4.74456L16.9861 4.46429L16.9851 4.46331C16.0226 3.88786 14.895 3.65037 13.782 3.78753C12.669 3.92477 11.6336 4.42922 10.8396 5.22113L8.03004 8.0307C7.77309 8.28784 7.62868 8.63689 7.62868 9.00042C7.6288 9.36378 7.77321 9.71215 8.03004 9.96917C8.28716 10.2263 8.63616 10.3715 8.99977 10.3715C9.36347 10.3715 9.71233 10.2263 9.9695 9.96917L10.8494 9.08929C11.5524 8.3872 12.5062 7.99267 13.4998 7.99261C14.4315 7.99261 15.3277 8.33932 16.0154 8.96136L16.1502 9.08929L20.03 12.9692C20.5685 13.5077 20.8709 14.2389 20.8709 15.0004C20.8707 15.7618 20.5684 16.4923 20.03 17.0307C19.4916 17.569 18.7611 17.8715 17.9998 17.8715C17.2384 17.8715 16.5079 17.569 15.9695 17.0307L13.4695 14.5307C13.1766 14.2378 13.1766 13.7621 13.4695 13.4692Z" }),
2138
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M20.9316 2.25288C21.344 2.2154 21.7094 2.51931 21.7471 2.93159L22.7471 13.9316C22.7661 14.1414 22.6958 14.3502 22.5537 14.5058C22.4116 14.6613 22.2107 14.75 22 14.75H20C19.5858 14.75 19.25 14.4142 19.25 14C19.25 13.5857 19.5858 13.25 20 13.25H21.1787L20.2529 3.06831C20.2154 2.65595 20.5194 2.2906 20.9316 2.25288Z" }),
2139
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M3.06835 2.25288C3.48064 2.2906 3.78455 2.65595 3.74707 3.06831L2.77832 13.7177L9.03027 19.9697C9.28744 20.2269 9.6363 20.371 10 20.371C10.3637 20.371 10.7125 20.2269 10.9697 19.9697C11.2269 19.7125 11.3711 19.3636 11.3711 19C11.3711 18.6363 11.2269 18.2874 10.9697 18.0302C10.6768 17.7373 10.6768 17.2626 10.9697 16.9697C11.2626 16.6768 11.7374 16.6768 12.0303 16.9697C12.5687 17.5082 12.8711 18.2384 12.8711 19C12.8711 19.7615 12.5687 20.4917 12.0303 21.0302C11.4918 21.5687 10.7615 21.871 10 21.871C9.23847 21.871 8.5082 21.5687 7.96972 21.0302L1.46972 14.5302C1.31233 14.3728 1.23277 14.1533 1.25292 13.9316L2.25293 2.93159C2.29065 2.51931 2.65599 2.2154 3.06835 2.25288Z" }),
2140
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M11 3.25C11.4142 3.25 11.75 3.58579 11.75 4C11.75 4.41421 11.4142 4.75 11 4.75H3C2.58579 4.75 2.25 4.41421 2.25 4C2.25 3.58579 2.58579 3.25 3 3.25H11Z" })
2141
- ]
2142
- });
2143
- }
2144
- // src/components/Icon/icons/apps.tsx
2145
- /** Navigation and menu. Search terms: apps, applikasjoner, grid, rutenett, meny, menu. */
2146
- function AppsIcon(props) {
2147
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SvgWrapper, {
2148
- ...props,
2149
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
2150
- fillRule: "evenodd",
2151
- clipRule: "evenodd",
2152
- d: "M4.25 5C4.25 4.58579 4.58579 4.25 5 4.25H6.5C6.91421 4.25 7.25 4.58579 7.25 5V6.5C7.25 6.91421 6.91421 7.25 6.5 7.25H5C4.58579 7.25 4.25 6.91421 4.25 6.5V5ZM4.25 11.25C4.25 10.8358 4.58579 10.5 5 10.5H6.5C6.91421 10.5 7.25 10.8358 7.25 11.25V12.75C7.25 13.1642 6.91421 13.5 6.5 13.5H5C4.58579 13.5 4.25 13.1642 4.25 12.75V11.25ZM5 16.75C4.58579 16.75 4.25 17.0858 4.25 17.5V19C4.25 19.4142 4.58579 19.75 5 19.75H6.5C6.91421 19.75 7.25 19.4142 7.25 19V17.5C7.25 17.0858 6.91421 16.75 6.5 16.75H5ZM10.5 5C10.5 4.58579 10.8358 4.25 11.25 4.25H12.75C13.1642 4.25 13.5 4.58579 13.5 5V6.5C13.5 6.91421 13.1642 7.25 12.75 7.25H11.25C10.8358 7.25 10.5 6.91421 10.5 6.5V5ZM11.25 10.5C10.8358 10.5 10.5 10.8358 10.5 11.25V12.75C10.5 13.1642 10.8358 13.5 11.25 13.5H12.75C13.1642 13.5 13.5 13.1642 13.5 12.75V11.25C13.5 10.8358 13.1642 10.5 12.75 10.5H11.25ZM10.5 17.5C10.5 17.0858 10.8358 16.75 11.25 16.75H12.75C13.1642 16.75 13.5 17.0858 13.5 17.5V19C13.5 19.4142 13.1642 19.75 12.75 19.75H11.25C10.8358 19.75 10.5 19.4142 10.5 19V17.5ZM17.5 4.25C17.0858 4.25 16.75 4.58579 16.75 5V6.5C16.75 6.91421 17.0858 7.25 17.5 7.25H19C19.4142 7.25 19.75 6.91421 19.75 6.5V5C19.75 4.58579 19.4142 4.25 19 4.25H17.5ZM16.75 11.25C16.75 10.8358 17.0858 10.5 17.5 10.5H19C19.4142 10.5 19.75 10.8358 19.75 11.25V12.75C19.75 13.1642 19.4142 13.5 19 13.5H17.5C17.0858 13.5 16.75 13.1642 16.75 12.75V11.25ZM17.5 16.75C17.0858 16.75 16.75 17.0858 16.75 17.5V19C16.75 19.4142 17.0858 19.75 17.5 19.75H19C19.4142 19.75 19.75 19.4142 19.75 19V17.5C19.75 17.0858 19.4142 16.75 19 16.75H17.5Z"
2153
- })
1948
+ }
1949
+ // src/components/Icon/icons/apps.tsx
1950
+ /** Navigation and menu. Search terms: apps, applikasjoner, grid, rutenett, meny, menu. */
1951
+ function AppsIcon(props) {
1952
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SvgWrapper, {
1953
+ ...props,
1954
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
1955
+ fillRule: "evenodd",
1956
+ clipRule: "evenodd",
1957
+ d: "M4.25 5C4.25 4.58579 4.58579 4.25 5 4.25H6.5C6.91421 4.25 7.25 4.58579 7.25 5V6.5C7.25 6.91421 6.91421 7.25 6.5 7.25H5C4.58579 7.25 4.25 6.91421 4.25 6.5V5ZM4.25 11.25C4.25 10.8358 4.58579 10.5 5 10.5H6.5C6.91421 10.5 7.25 10.8358 7.25 11.25V12.75C7.25 13.1642 6.91421 13.5 6.5 13.5H5C4.58579 13.5 4.25 13.1642 4.25 12.75V11.25ZM5 16.75C4.58579 16.75 4.25 17.0858 4.25 17.5V19C4.25 19.4142 4.58579 19.75 5 19.75H6.5C6.91421 19.75 7.25 19.4142 7.25 19V17.5C7.25 17.0858 6.91421 16.75 6.5 16.75H5ZM10.5 5C10.5 4.58579 10.8358 4.25 11.25 4.25H12.75C13.1642 4.25 13.5 4.58579 13.5 5V6.5C13.5 6.91421 13.1642 7.25 12.75 7.25H11.25C10.8358 7.25 10.5 6.91421 10.5 6.5V5ZM11.25 10.5C10.8358 10.5 10.5 10.8358 10.5 11.25V12.75C10.5 13.1642 10.8358 13.5 11.25 13.5H12.75C13.1642 13.5 13.5 13.1642 13.5 12.75V11.25C13.5 10.8358 13.1642 10.5 12.75 10.5H11.25ZM10.5 17.5C10.5 17.0858 10.8358 16.75 11.25 16.75H12.75C13.1642 16.75 13.5 17.0858 13.5 17.5V19C13.5 19.4142 13.1642 19.75 12.75 19.75H11.25C10.8358 19.75 10.5 19.4142 10.5 19V17.5ZM17.5 4.25C17.0858 4.25 16.75 4.58579 16.75 5V6.5C16.75 6.91421 17.0858 7.25 17.5 7.25H19C19.4142 7.25 19.75 6.91421 19.75 6.5V5C19.75 4.58579 19.4142 4.25 19 4.25H17.5ZM16.75 11.25C16.75 10.8358 17.0858 10.5 17.5 10.5H19C19.4142 10.5 19.75 10.8358 19.75 11.25V12.75C19.75 13.1642 19.4142 13.5 19 13.5H17.5C17.0858 13.5 16.75 13.1642 16.75 12.75V11.25ZM17.5 16.75C17.0858 16.75 16.75 17.0858 16.75 17.5V19C16.75 19.4142 17.0858 19.75 17.5 19.75H19C19.4142 19.75 19.75 19.4142 19.75 19V17.5C19.75 17.0858 19.4142 16.75 19 16.75H17.5Z"
1958
+ })
2154
1959
  });
2155
1960
  }
2156
1961
  // src/components/Icon/icons/archive.tsx
@@ -4123,403 +3928,598 @@ var icons_exports = /* @__PURE__ */ __exportAll({
4123
3928
  ZoomInIcon: () => ZoomInIcon,
4124
3929
  ZoomOutIcon: () => ZoomOutIcon
4125
3930
  });
4126
- // src/components/ThemeProvider/ThemeProvider.module.css
4127
- var ThemeProvider_module_default = {
4128
- "global-variables": "dds-ThemeProvider-module__global-variables",
4129
- "global-styles": "dds-ThemeProvider-module__global-styles"
4130
- };
4131
- // src/components/ThemeProvider/ThemeProvider.tsx
4132
- const defaultTheme = "core-light";
4133
- const ddsThemes = Object.keys(_norges_domstoler_dds_design_tokens.ddsTokens);
4134
- new Set(ddsThemes.map((theme) => theme.split("-")[0]));
4135
- new Set(ddsThemes.map((theme) => theme.split("-")[1]));
4136
- const ThemeContext = (0, react.createContext)(void 0);
4137
- function ThemeProvider({ theme = defaultTheme, children }) {
4138
- const themeRef = (0, react.useRef)(null);
4139
- const [element, setElement] = (0, react.useState)(null);
4140
- (0, react.useEffect)(() => {
4141
- setElement(themeRef.current);
4142
- }, []);
4143
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
4144
- ref: themeRef,
4145
- className: cn(`dds-${theme}`, ThemeProvider_module_default["global-variables"], ThemeProvider_module_default["global-styles"], "dds-themed"),
4146
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ThemeContext, {
4147
- value: {
4148
- theme,
4149
- el: element
4150
- },
4151
- children
4152
- })
4153
- });
4154
- }
4155
- /**
4156
- * Hook for å hente gjeldende tema og temanavn. Brukes inni ThemeProvider.
4157
- *
4158
- * @returns tema med JS-konstanter og navnet på temaet.
4159
- */
4160
- function useTheme() {
4161
- const themeName = (0, react.useContext)(ThemeContext)?.theme;
4162
- if (!themeName) throw new Error("useTheme must be used inside a ThemeProvider or DdsProvider");
4163
- return {
4164
- theme: _norges_domstoler_dds_design_tokens.ddsTokens[themeName],
4165
- themeName
4166
- };
4167
- }
4168
- // src/DdsProvider/DdsProvider.tsx
4169
- function DdsProvider({ language, theme, children }) {
4170
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LanguageProvider, {
4171
- language,
4172
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ThemeProvider, {
4173
- theme,
4174
- children
4175
- })
3931
+ // src/components/Typography/Label/Label.tsx
3932
+ const Label = ({ showRequiredStyling, readOnly, id, className, style, htmlProps, children, afterLabelContent, ...rest }) => {
3933
+ const content = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
3934
+ readOnly && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, {
3935
+ icon: LockFilledIcon,
3936
+ iconSize: "4",
3937
+ className: Label_module_default["read-only__icon"]
3938
+ }),
3939
+ children,
3940
+ showRequiredStyling && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RequiredMarker, {})
3941
+ ] });
3942
+ const labelProps = { ...getBaseHTMLProps(id, cn(className, readOnly && Label_module_default["read-only"]), style, htmlProps, rest) };
3943
+ return afterLabelContent ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Typography, {
3944
+ typographyType: "label-medium",
3945
+ as: "div",
3946
+ withMargins: rest.withMargins,
3947
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Typography, {
3948
+ ...labelProps,
3949
+ typographyType: "label-medium",
3950
+ withMargins: false,
3951
+ children: content
3952
+ }), afterLabelContent]
3953
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Typography, {
3954
+ ...labelProps,
3955
+ typographyType: "label-medium",
3956
+ children: content
4176
3957
  });
4177
- }
4178
- // src/components/Accordion/Accordion.module.css
4179
- var Accordion_module_default = {
4180
- "container": "dds-Accordion-module__container",
4181
- "header-button": "dds-Accordion-module__header-button",
4182
- "chevron": "dds-Accordion-module__chevron"
4183
3958
  };
4184
- // src/components/Accordion/Accordion.tsx
4185
- const Accordion = ({ isInitiallyExpanded = false, isExpanded, onChange, id, children, className, style, htmlProps, ...rest }) => {
4186
- const { id: accordionId, isExpanded: expanded, toggleExpanded, bodyContentRef, headerProps, bodyProps } = useAccordion({
4187
- isInitiallyExpanded,
4188
- isExpanded,
4189
- onChange,
4190
- id
4191
- });
4192
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
4193
- ...getBaseHTMLProps(accordionId, cn(className, Accordion_module_default.container), style, htmlProps, rest),
4194
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AccordionContextProvider, {
4195
- headerProps,
4196
- bodyProps,
4197
- isExpanded: expanded,
4198
- toggleExpanded,
4199
- bodyContentRef,
4200
- children
4201
- })
4202
- });
4203
- };
4204
- Accordion.displayName = "Accordion";
4205
- // src/components/Accordion/AccordionHeader.tsx
4206
- const AccordionHeader = ({ children, className, style, htmlProps, typographyType = "heading-medium", bold, ...rest }) => {
4207
- const { isExpanded, headerProps } = useAccordionContext();
4208
- const { id, ...restHeaderProps } = headerProps ?? {};
4209
- const iconState = isExpanded ? "up" : "down";
4210
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Box, {
4211
- as: StylelessButton,
4212
- padding: "x1 x1.5 x1 x1",
4213
- ...getBaseHTMLProps(id, cn(className, Accordion_module_default["header-button"], AccordionBase_module_default["header-button"], _key1), style, htmlProps, rest),
4214
- ...restHeaderProps,
4215
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
4216
- className: cn(AccordionBase_module_default.header__content, typographyStyles_module_default[typographyType], bold && typographyStyles_module_default.bold),
4217
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, {
4218
- icon: AnimatedChevronUpDownIcon,
4219
- iconSize: "component",
4220
- className: Accordion_module_default.chevron,
4221
- iconState
4222
- }), children]
4223
- })
4224
- });
4225
- };
4226
- AccordionHeader.displayName = "AccordionHeader";
4227
- // src/components/Accordion/AccordionBody.tsx
4228
- const AccordionBody = ({ children, className, style, htmlProps, ...rest }) => {
4229
- const { bodyContentRef, bodyProps } = useAccordionContext();
4230
- const { className: bodyContextCn, id, height, ...restBodyProps } = bodyProps ?? {};
4231
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Box, {
4232
- height: `${height}px`,
4233
- ...getBaseHTMLProps(id, cn(className, bodyContextCn), style, htmlProps, rest),
4234
- ...restBodyProps,
4235
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Box, {
4236
- ref: bodyContentRef,
4237
- padding: "x0.5 x1.5 x2 x1",
4238
- children
4239
- })
4240
- });
4241
- };
4242
- AccordionBody.displayName = "AccordionBody";
4243
- // src/components/BackLink/BackLink.module.css
4244
- var BackLink_module_default = { "icon": "dds-BackLink-module__icon" };
4245
- // src/components/BackLink/BackLink.tsx
4246
- const BackLink = ({ label, ref, as = "a", ...rest }) => {
4247
- const { t } = useTranslation();
4248
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("nav", {
4249
- ref,
4250
- "aria-label": t(texts$30.goBack),
4251
- className: typographyStyles_module_default["body-short-medium"],
4252
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(HStack, {
4253
- as,
4254
- className: cn(typographyStyles_module_default.a, _key1),
4255
- rel: "noopener noreferer",
4256
- ...rest,
4257
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, {
4258
- icon: ArrowLeftIcon,
4259
- iconSize: "component",
4260
- className: cn(BackLink_module_default.icon)
4261
- }), label]
4262
- })
4263
- });
4264
- };
4265
- BackLink.displayName = "BackLink";
4266
- const texts$30 = createTexts({ goBack: {
4267
- nb: "Gå tilbake",
4268
- no: "Gå tilbake",
4269
- nn: "Gå tilbake",
4270
- en: "Go back",
4271
- se: "Mana ruovttoluotta"
4272
- } });
4273
- // src/components/Typography/Typography/TextOverflowEllipsis/TextOverflowEllipsis.module.css
4274
- var TextOverflowEllipsis_module_default = {
4275
- "wrapper": "dds-TextOverflowEllipsis-module__wrapper",
4276
- "inner": "dds-TextOverflowEllipsis-module__inner"
4277
- };
4278
- // src/components/Typography/Typography/TextOverflowEllipsis/TextOverflowEllipsis.tsx
4279
- function TextOverflowEllipsisWrapper({ className, ...rest }) {
4280
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
4281
- ...rest,
4282
- className: cn(className, TextOverflowEllipsis_module_default.wrapper)
4283
- });
4284
- }
4285
- function TextOverflowEllipsisInner({ className, ...rest }) {
4286
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
4287
- ...rest,
4288
- className: cn(className, TextOverflowEllipsis_module_default.inner)
3959
+ Label.displayName = "Label";
3960
+ // src/components/Typography/Legend/Legend.tsx
3961
+ const Legend = ({ id, className, style, htmlProps, typographyType = "heading-large", withMarginsOverInput, withMargins, ...rest }) => {
3962
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Typography, {
3963
+ ...getBaseHTMLProps(id, cn(className, withMarginsOverInput && typographyStyles_module_default["legend--margins-over-input"]), style, htmlProps, rest),
3964
+ as: "legend",
3965
+ typographyType,
3966
+ withMargins: optAttr(withMargins || withMarginsOverInput)
4289
3967
  });
4290
- }
4291
- // src/components/Typography/Typography/Typography.module.css
4292
- var Typography_module_default = { "container": "dds-Typography-module__container" };
4293
- // src/components/Typography/Typography/Typography.types.ts
4294
- const TG_BODY_SHORT_TYPES = [
4295
- "body-short-xsmall",
4296
- "body-short-small",
4297
- "body-short-medium",
4298
- "body-short-large"
4299
- ];
4300
- const TG_BODY_LONG_TYPES = [
4301
- "body-long-xsmall",
4302
- "body-long-small",
4303
- "body-long-medium",
4304
- "body-long-large"
4305
- ];
4306
- const TG_BODY_TYPES = [...TG_BODY_SHORT_TYPES, ...TG_BODY_LONG_TYPES];
4307
- const TG_LEAD_TYPES = ["lead-medium"];
4308
- const TG_HEADING_TYPES = [
4309
- "heading-xxsmall",
4310
- "heading-xsmall",
4311
- "heading-small",
4312
- "heading-medium",
4313
- "heading-large",
4314
- "heading-xlarge",
4315
- "heading-xxlarge"
4316
- ];
4317
- // src/components/Typography/Typography/Typography.utils.ts
4318
- const getElementType = (element) => {
4319
- switch (element) {
4320
- case "a": return "a";
4321
- case "heading-xxsmall": return "h6";
4322
- case "heading-xsmall": return "h5";
4323
- case "heading-small": return "h4";
4324
- case "heading-medium": return "h3";
4325
- case "heading-large": return "h2";
4326
- case "heading-xlarge":
4327
- case "heading-xxlarge": return "h1";
4328
- case "label-medium": return "label";
4329
- default: return "p";
4330
- }
4331
- };
4332
- const isHeading = (type) => {
4333
- return TG_HEADING_TYPES.includes(type);
4334
- };
4335
- const isLegend = (as) => {
4336
- return as === "legend";
4337
- };
4338
- const isCaption = (as) => {
4339
- return as === "caption";
4340
- };
4341
- const inlineElements = [
4342
- "a",
4343
- "abbr",
4344
- "audio",
4345
- "b",
4346
- "bdi",
4347
- "bdo",
4348
- "big",
4349
- "br",
4350
- "button",
4351
- "canvas",
4352
- "cite",
4353
- "code",
4354
- "data",
4355
- "datalist",
4356
- "del",
4357
- "dfn",
4358
- "em",
4359
- "embed",
4360
- "i",
4361
- "iframe",
4362
- "img",
4363
- "input",
4364
- "ins",
4365
- "kbd",
4366
- "label",
4367
- "map",
4368
- "mark",
4369
- "meter",
4370
- "noscript",
4371
- "object",
4372
- "output",
4373
- "picture",
4374
- "progress",
4375
- "q",
4376
- "ruby",
4377
- "s",
4378
- "samp",
4379
- "script",
4380
- "select",
4381
- "slot",
4382
- "small",
4383
- "span",
4384
- "strong",
4385
- "sub",
4386
- "sup",
4387
- "svg",
4388
- "template",
4389
- "textarea",
4390
- "time",
4391
- "u",
4392
- "var",
4393
- "video",
4394
- "wbr"
4395
- ];
4396
- const isInlineElement = (as) => inlineElements.indexOf(as) !== -1;
4397
- const getColorCn = (color) => {
4398
- if (!isTextColor(color)) return null;
4399
- const [prefix] = color.split("-", 1);
4400
- return typographyStyles_module_default[`${prefix}-color--${color.slice(prefix.length + 1)}`] || null;
4401
3968
  };
4402
- // src/components/Typography/Typography/Typography.tsx
4403
- const isAnchorProps = (props) => props.typographyType === "a";
4404
- const Typography = (props) => {
4405
- const { typographyType = "body-long-medium", as: propAs, children, bold, underline, italic, style, id, withMargins, color, className, htmlProps = {}, ...rest } = props;
4406
- const as = propAs ? propAs : getElementType(typographyType);
4407
- let relProp;
4408
- if (isAnchorProps(props)) relProp = as === "a" ? "noopener noreferer" : void 0;
4409
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Box, {
4410
- ...getBaseHTMLProps(id, cn(className, getColorCn(color), Typography_module_default.container, typographyStyles_module_default[typographyType], withMargins && typographyStyles_module_default[`${typographyType}--margins`], isLegend(as) && typographyStyles_module_default.legend, isCaption(as) && typographyStyles_module_default.caption, isCaption(as) && withMargins && typographyStyles_module_default["caption--withMargins"], bold && typographyStyles_module_default.bold, underline && typographyStyles_module_default.underline, italic && typographyStyles_module_default.italic, as === "a" && "dds-focus-module__focusable"), {
3969
+ Legend.displayName = "Legend";
3970
+ // src/components/Typography/Link/Link.tsx
3971
+ const Link = ({ id, className, htmlProps, children, typographyType, withMargins, withVisited, style, color, as: propAs, isAnchor: propIsAnchor, withIconStyling, ...rest }) => {
3972
+ const as = propAs ? propAs : "a";
3973
+ const aProps = as === "a" || propIsAnchor ? { rel: "noopener noreferrer" } : {};
3974
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ElementAs, {
3975
+ as,
3976
+ ...getBaseHTMLProps(id, cn(className, typographyStyles_module_default.a, withIconStyling && typographyStyles_module_default["a--with-icon"], withVisited && typographyStyles_module_default["a--visited"], typographyType && typographyStyles_module_default[typographyType], typographyType && withMargins && typographyStyles_module_default[`${typographyType}--margins`], _key1, getColorCn(color)), {
4411
3977
  ...style,
4412
3978
  color: color && !isTextColor(color) ? getTextColor(color) : void 0
4413
3979
  }, htmlProps, rest),
4414
- as,
4415
- rel: relProp,
3980
+ ...aProps,
4416
3981
  children
4417
3982
  });
4418
3983
  };
4419
- Typography.displayName = "Typography";
4420
- // src/components/Typography/Caption/Caption.tsx
4421
- const Caption = ({ typographyType = "heading-large", id, className, style, htmlProps, children, ...rest }) => {
3984
+ Link.displayName = "Link";
3985
+ [...TG_BODY_TYPES, ...TG_LEAD_TYPES];
3986
+ const Paragraph = ({ id, className, style, htmlProps, children, typographyType = "body-long-medium", ...rest }) => {
4422
3987
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Typography, {
4423
3988
  ...getBaseHTMLProps(id, className, style, htmlProps, rest),
4424
3989
  typographyType,
4425
- as: "caption",
4426
3990
  children
4427
3991
  });
4428
3992
  };
4429
- Caption.displayName = "Caption";
4430
- // src/components/Typography/Heading/Heading.tsx
4431
- const getHeadingElement = (level) => `h${level}`;
4432
- const getDefaultTypographyType = (h) => {
4433
- switch (h) {
4434
- case "h1": return "heading-xlarge";
4435
- case "h2": return "heading-large";
4436
- case "h3": return "heading-medium";
4437
- case "h4": return "heading-small";
4438
- case "h5": return "heading-xsmall";
4439
- case "h6": return "heading-xxsmall";
4440
- default: return "heading-xlarge";
4441
- }
3993
+ Paragraph.displayName = "Paragraph";
3994
+ const Badge = ({ id, className, style, htmlProps, purpose = "notification", size = "medium", children, max = 9, showZero = false, ...rest }) => {
3995
+ const hasChildren = !!children || showZero && children === 0;
3996
+ const heightVariant = hasChildren ? "withChildren" : "noChildren";
3997
+ const height = {
3998
+ withChildren: {
3999
+ xsmall: "18px",
4000
+ small: "21px",
4001
+ medium: "24px",
4002
+ large: "27px"
4003
+ },
4004
+ noChildren: {
4005
+ xsmall: "x0.5",
4006
+ small: "x0.75",
4007
+ medium: "x1",
4008
+ large: "x1.5"
4009
+ }
4010
+ };
4011
+ const color = {
4012
+ notification: "text-on-notification",
4013
+ action: "text-on-action",
4014
+ neutral: "text-on-inverse",
4015
+ subtle: "text-default"
4016
+ };
4017
+ const displayValue = hasChildren && max && children > max ? `${max}+` : children;
4018
+ if (!(!showZero && children === 0 ? false : true)) return null;
4019
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Box, {
4020
+ as: "span",
4021
+ paddingInline: hasChildren ? "x0.25" : void 0,
4022
+ minWidth: height[heightVariant][size],
4023
+ maxWidth: "fit-content",
4024
+ height: height[heightVariant][size],
4025
+ display: "inline-flex",
4026
+ alignItems: "center",
4027
+ justifyContent: "center",
4028
+ ...getBaseHTMLProps(id, cn(className, Badge_module_default.container, Badge_module_default[purpose], typographyStyles_module_default[`body-short-${size}`]), style, htmlProps, rest),
4029
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Typography, {
4030
+ as: "span",
4031
+ typographyType: `body-short-${size}`,
4032
+ color: color[purpose],
4033
+ children: displayValue
4034
+ })
4035
+ });
4442
4036
  };
4443
- const Heading = ({ id, className, style, htmlProps, children, typographyType, level, withMargins, withMarginsOverInput, ...rest }) => {
4444
- const headingElement = getHeadingElement(level);
4445
- const standardTypographyType = typographyType ?? getDefaultTypographyType(headingElement);
4446
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Typography, {
4447
- ...getBaseHTMLProps(id, cn(className, withMarginsOverInput && typographyStyles_module_default["heading--margins-over-input"]), style, htmlProps, rest),
4448
- typographyType: standardTypographyType,
4449
- as: headingElement,
4450
- withMargins: optAttr(withMargins || withMarginsOverInput),
4037
+ Badge.displayName = "Badge";
4038
+ // src/components/Spinner/Spinner.module.css
4039
+ var Spinner_module_default = {
4040
+ "svg": "dds-Spinner-module__svg",
4041
+ "jordskifterett": "dds-Spinner-module__jordskifterett",
4042
+ "lagmannsrett": "dds-Spinner-module__lagmannsrett",
4043
+ "tingrett": "dds-Spinner-module__tingrett"
4044
+ };
4045
+ // src/i18n/LanguageProvider.tsx
4046
+ const LanguageContext = (0, react.createContext)(void 0);
4047
+ function LanguageProvider({ language, children }) {
4048
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LanguageContext, {
4049
+ value: { language },
4451
4050
  children
4452
4051
  });
4052
+ }
4053
+ function useLanguage() {
4054
+ const lang = (0, react.useContext)(LanguageContext)?.language;
4055
+ if (!lang) throw new Error("useLangage must be used within DdsProvider.");
4056
+ return lang;
4057
+ }
4058
+ // src/i18n/translation.tsx
4059
+ function useTranslation() {
4060
+ const lang = useLanguage();
4061
+ const t = (text) => text[lang];
4062
+ return {
4063
+ t,
4064
+ lang
4065
+ };
4066
+ }
4067
+ function createTexts(texts) {
4068
+ return texts;
4069
+ }
4070
+ // src/i18n/commonTexts.tsx
4071
+ const commonTexts = createTexts({
4072
+ clearSelect: {
4073
+ no: "Tøm nedtrekksliste",
4074
+ nb: "Tøm nedtrekksliste",
4075
+ nn: "Tøm nedtrekksliste",
4076
+ en: "Clear selection",
4077
+ se: "Gidde válljemiid"
4078
+ },
4079
+ close: {
4080
+ nb: "Lukk",
4081
+ no: "Lukk",
4082
+ nn: "Lukk",
4083
+ en: "Close",
4084
+ se: "Gidde"
4085
+ },
4086
+ closeMessage: {
4087
+ nb: "Lukk melding",
4088
+ no: "Lukk melding",
4089
+ nn: "Lukk melding",
4090
+ en: "Close message",
4091
+ se: "Gidde dieđu"
4092
+ },
4093
+ loading: {
4094
+ nb: "Innlastning pågår",
4095
+ no: "Innlastning pågår",
4096
+ nn: "Innlastning pågår",
4097
+ en: "Loading",
4098
+ se: "Viežžamin"
4099
+ },
4100
+ nextPage: {
4101
+ nb: "Neste side",
4102
+ no: "Neste side",
4103
+ nn: "Neste side",
4104
+ en: "Next page",
4105
+ se: "Boahte siidu"
4106
+ },
4107
+ previousPage: {
4108
+ nb: "Forrige side",
4109
+ no: "Forrige side",
4110
+ nn: "Førre side",
4111
+ en: "Previous page",
4112
+ se: "Ovddit siidu"
4113
+ },
4114
+ page: (page) => ({
4115
+ nb: `Side ${page}`,
4116
+ no: `Side ${page}`,
4117
+ nn: `Side ${page}`,
4118
+ en: `Page ${page}`,
4119
+ se: `Siidu ${page}`
4120
+ }),
4121
+ currentPage: (page) => ({
4122
+ nb: `Nåværende side (${page})`,
4123
+ no: `Nåværende side (${page})`,
4124
+ nn: `Noverande side (${page})`,
4125
+ en: `Current page (${page})`,
4126
+ se: `Dála siidu (${page})`
4127
+ }),
4128
+ pageOf: (current, max) => ({
4129
+ nb: `Side ${current} av ${max}`,
4130
+ no: `Side ${current} av ${max}`,
4131
+ nn: `Side ${current} ${max}`,
4132
+ en: `Page ${current} of ${max}`,
4133
+ se: `Siidu ${current} ${max}`
4134
+ })
4135
+ });
4136
+ // src/components/Spinner/Spinner.tsx
4137
+ function Spinner(props) {
4138
+ const { size = "var(--dds-size-6)", color = "icon-action-resting", tooltip, id, className, htmlProps, style, ...rest } = props;
4139
+ const { t } = useTranslation();
4140
+ const uniqueId = `${(0, react.useId)()}-spinnerTitle`;
4141
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
4142
+ viewBox: "0 0 25 25",
4143
+ role: "progressbar",
4144
+ "aria-labelledby": uniqueId,
4145
+ ...getBaseHTMLProps(id, cn(className, Spinner_module_default.svg), {
4146
+ ...style,
4147
+ width: size,
4148
+ height: size,
4149
+ ["--dds-color-spinner"]: getTextColor(color)
4150
+ }, htmlProps, rest),
4151
+ children: [
4152
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("title", {
4153
+ id: uniqueId,
4154
+ children: tooltip ?? t(commonTexts.loading)
4155
+ }),
4156
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("circle", {
4157
+ cx: "12",
4158
+ cy: "12.25",
4159
+ r: "6",
4160
+ className: Spinner_module_default.jordskifterett
4161
+ }),
4162
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("rect", {
4163
+ x: "4",
4164
+ y: "10.25",
4165
+ width: "16",
4166
+ height: "4",
4167
+ className: Spinner_module_default.lagmannsrett
4168
+ }),
4169
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
4170
+ d: "M12 16.6154C16.4183 16.6154 20 12.7581 20 8H4C4 12.7581 7.58172 16.6154 12 16.6154Z",
4171
+ className: Spinner_module_default.tingrett
4172
+ })
4173
+ ]
4174
+ });
4175
+ }
4176
+ Spinner.displayName = "Spinner";
4177
+ // src/components/helpers/Dropdown/DropdownItem.tsx
4178
+ const DropdownItem = ({ icon, className, children: propChildren, purpose = "default", loading, loadingTooltip, badgeProps, ...rest }) => {
4179
+ const itemCns = [
4180
+ DropdownItem_module_default.item,
4181
+ DropdownItem_module_default[purpose],
4182
+ typographyStyles_module_default["body-short-medium"]
4183
+ ];
4184
+ const interactiveItemCns = [
4185
+ ...itemCns,
4186
+ focus_module_default["focusable--inset"],
4187
+ DropdownItem_module_default["item--interactive"]
4188
+ ];
4189
+ const children = loading ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
4190
+ className: cn(loading && utilStyles_module_default.invisible),
4191
+ children: propChildren
4192
+ }) : propChildren;
4193
+ const cns = rest.as === "span" ? itemCns : interactiveItemCns;
4194
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Box, {
4195
+ display: "flex",
4196
+ alignItems: "center",
4197
+ padding: "x0.75",
4198
+ gap: "x0.25",
4199
+ width: "100%",
4200
+ className: cn(className, ...cns, loading && DropdownItem_module_default["item--loading"]),
4201
+ "aria-disabled": loading ? true : void 0,
4202
+ ...rest,
4203
+ children: [
4204
+ loading && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
4205
+ className: cn(utilStyles_module_default["center-absolute"]),
4206
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Spinner, {
4207
+ size: "var(--dds-size-icon-component)",
4208
+ tooltip: loadingTooltip
4209
+ })
4210
+ }),
4211
+ icon && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, {
4212
+ iconSize: "inherit",
4213
+ icon,
4214
+ className: cn(loading && utilStyles_module_default.invisible)
4215
+ }),
4216
+ children,
4217
+ badgeProps && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Box, {
4218
+ as: Badge,
4219
+ ...badgeProps,
4220
+ size: "small",
4221
+ marginInline: "x0.25 0"
4222
+ })
4223
+ ]
4224
+ });
4225
+ };
4226
+ // src/components/helpers/Dropdown/DropdownHeader.tsx
4227
+ const DropdownHeader = ({ className, ...rest }) => {
4228
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Box, {
4229
+ as: "h2",
4230
+ padding: "x0.75 x0.75 0 x0.75",
4231
+ ...rest,
4232
+ className: cn(className, typographyStyles_module_default["heading-xsmall"])
4233
+ });
4234
+ };
4235
+ // src/components/helpers/HiddenInput/HiddenInput.tsx
4236
+ /**
4237
+ * Usynlig `<input>` til bruk for skjermlesere, typisk for custom radioknapper o.l..
4238
+ *
4239
+ * @component
4240
+ * @param {Object} props - Standard HTML-attributter for komponenten.
4241
+ *
4242
+ * @returns {JSX.Element} Et usynlig `<input>`-element.
4243
+
4244
+ * @example
4245
+ * ```tsx
4246
+ * <label htmlFor="id">
4247
+ * <HiddenInput id="id" />
4248
+ * //visuell erstatning for input
4249
+ * </label>
4250
+ * });
4251
+ * ```
4252
+ */
4253
+ const HiddenInput = ({ className, ...rest }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
4254
+ className: cn(className, utilStyles_module_default["hide-input"]),
4255
+ ...rest
4256
+ });
4257
+ // src/components/helpers/StylelessButton/StylelessButton.tsx
4258
+ /**
4259
+ * Normalisert `<button>` uten styling. Base for custom buttom styling.
4260
+ *
4261
+ * @component
4262
+ * @template T ekstra props ved behov.
4263
+ * @param {Object & T} props - Standard HTML-attributter for komponenten med mulig utvidelse.
4264
+ *
4265
+ * @returns {JSX.Element} `<button>`-element uten styling.
4266
+
4267
+ * @example
4268
+ * ```tsx
4269
+ * <StylelessButton className="min-styling">
4270
+ * Tekst
4271
+ * </StylelessButton>
4272
+ * ```
4273
+ */
4274
+ const StylelessButton = ({ className, ...rest }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
4275
+ ...rest,
4276
+ className: cn(className, utilStyles_module_default["remove-button-styling"], utilStyles_module_default["normalize-button"])
4277
+ });
4278
+ // src/components/helpers/StylelessList/StylelessList.tsx
4279
+ /**
4280
+ * Normalisert `<ul>` uten styling. Base for custom ul styling.
4281
+ *
4282
+ * @component
4283
+ * @template T ekstra props ved behov.
4284
+ * @param {Object & T} props - Standard HTML-attributter for komponenten med mulig utvidelse.
4285
+ *
4286
+ * @returns {JSX.Element} `<ul>`-element uten styling.
4287
+
4288
+ * @example
4289
+ * ```tsx
4290
+ * <StylelessList className="min-styling">
4291
+ * <li>item</li>
4292
+ * <li>item</li>
4293
+ * </StylelessList>
4294
+ * ```
4295
+ */
4296
+ const StylelessList = ({ className, ...rest }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
4297
+ ...rest,
4298
+ className: cn(className, utilStyles_module_default["remove-list-styling"])
4299
+ });
4300
+ /**
4301
+ * Normalisert `<ol>` uten styling. Base for custom ol styling.
4302
+ *
4303
+ * @component
4304
+ * @template T ekstra props ved behov.
4305
+ * @param {Object & T} props - Standard HTML-attributter for komponenten med mulig utvidelse.
4306
+ *
4307
+ * @returns {JSX.Element} `<ol>`-element uten styling.
4308
+
4309
+ * @example
4310
+ * ```tsx
4311
+ * <StylelessOList className="min-styling">
4312
+ * <li>item</li>
4313
+ * <li>item</li>
4314
+ * </StylelessOList>
4315
+ * ```
4316
+ */
4317
+ const StylelessOList = ({ className, ...rest }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ol", {
4318
+ ...rest,
4319
+ className: cn(className, utilStyles_module_default["remove-list-styling"])
4320
+ });
4321
+ // src/components/helpers/styling/utils.ts
4322
+ /**
4323
+ * Styling utils i TS (CSS-in-JS)
4324
+ */
4325
+ /**
4326
+ * DDS utils
4327
+ */
4328
+ const outlineOffset = "var(--dds-spacing-x0-125)";
4329
+ const outlineInset = "calc(var(--dds-spacing-x0-125) * -1)";
4330
+ const focusVisible = {
4331
+ outline: "var(--dds-color-focus-outside) 2px solid",
4332
+ outlineOffset,
4333
+ boxShadow: "0 0 0 2px var(--dds-color-focus-inside)"
4334
+ };
4335
+ const focusVisibleTransitionValue = "outline-offset var(--dds-motion-micro-state)";
4336
+ const focusVisibleInset = {
4337
+ outline: "var(--dds-color-focus-outside) 2px solid",
4338
+ outlineOffset: outlineInset
4339
+ };
4340
+ const scrollbarStyling = {
4341
+ scrollbarColor: "var(--dds-color-surface-scrollbar) transparent",
4342
+ scrollbarWidth: "thin"
4343
+ };
4344
+ /**
4345
+ * Generelle utils
4346
+ */
4347
+ const hideInput = {
4348
+ clip: "rect(0 0 0 0)",
4349
+ position: "absolute",
4350
+ height: "1px",
4351
+ width: "1px",
4352
+ margin: 0
4353
+ };
4354
+ const inheritLinkStyling = {
4355
+ color: "inherit",
4356
+ textDecoration: "inherit"
4357
+ };
4358
+ const removeButtonStyling = {
4359
+ background: "none",
4360
+ color: "inherit",
4361
+ border: "none",
4362
+ padding: 0,
4363
+ font: "inherit",
4364
+ cursor: "pointer",
4365
+ outline: "inherit"
4366
+ };
4367
+ const removeListStyling = {
4368
+ listStyle: "none",
4369
+ padding: 0,
4370
+ margin: 0
4371
+ };
4372
+ const normalizeButton = {
4373
+ margin: 0,
4374
+ textTransform: "none"
4375
+ };
4376
+ // src/components/ThemeProvider/ThemeProvider.module.css
4377
+ var ThemeProvider_module_default = {
4378
+ "global-variables": "dds-ThemeProvider-module__global-variables",
4379
+ "global-styles": "dds-ThemeProvider-module__global-styles"
4380
+ };
4381
+ // src/components/ThemeProvider/ThemeProvider.tsx
4382
+ const defaultTheme = "core-light";
4383
+ const ddsThemes = Object.keys(_norges_domstoler_dds_design_tokens.ddsTokens);
4384
+ new Set(ddsThemes.map((theme) => theme.split("-")[0]));
4385
+ new Set(ddsThemes.map((theme) => theme.split("-")[1]));
4386
+ const ThemeContext = (0, react.createContext)(void 0);
4387
+ function ThemeProvider({ theme = defaultTheme, children }) {
4388
+ const themeRef = (0, react.useRef)(null);
4389
+ const [element, setElement] = (0, react.useState)(null);
4390
+ (0, react.useEffect)(() => {
4391
+ setElement(themeRef.current);
4392
+ }, []);
4393
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
4394
+ ref: themeRef,
4395
+ className: cn(`dds-${theme}`, ThemeProvider_module_default["global-variables"], ThemeProvider_module_default["global-styles"], "dds-themed"),
4396
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ThemeContext, {
4397
+ value: {
4398
+ theme,
4399
+ el: element
4400
+ },
4401
+ children
4402
+ })
4403
+ });
4404
+ }
4405
+ /**
4406
+ * Hook for å hente gjeldende tema og temanavn. Brukes inni ThemeProvider.
4407
+ *
4408
+ * @returns tema med JS-konstanter og navnet på temaet.
4409
+ */
4410
+ function useTheme() {
4411
+ const themeName = (0, react.useContext)(ThemeContext)?.theme;
4412
+ if (!themeName) throw new Error("useTheme must be used inside a ThemeProvider or DdsProvider");
4413
+ return {
4414
+ theme: _norges_domstoler_dds_design_tokens.ddsTokens[themeName],
4415
+ themeName
4416
+ };
4417
+ }
4418
+ // src/DdsProvider/DdsProvider.tsx
4419
+ function DdsProvider({ language, theme, children }) {
4420
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LanguageProvider, {
4421
+ language,
4422
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ThemeProvider, {
4423
+ theme,
4424
+ children
4425
+ })
4426
+ });
4427
+ }
4428
+ // src/components/Accordion/Accordion.module.css
4429
+ var Accordion_module_default = {
4430
+ "container": "dds-Accordion-module__container",
4431
+ "header-button": "dds-Accordion-module__header-button",
4432
+ "chevron": "dds-Accordion-module__chevron"
4453
4433
  };
4454
- Heading.displayName = "Heading";
4455
- // src/components/Typography/Label/Label.module.css
4456
- var Label_module_default = {
4457
- "read-only": "dds-Label-module__read-only",
4458
- "read-only__icon": "dds-Label-module__read-only__icon"
4459
- };
4460
- // src/components/Typography/Label/Label.tsx
4461
- const Label = ({ showRequiredStyling, readOnly, id, className, style, htmlProps, children, afterLabelContent, ...rest }) => {
4462
- const content = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
4463
- readOnly && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, {
4464
- icon: LockFilledIcon,
4465
- iconSize: "4",
4466
- className: Label_module_default["read-only__icon"]
4467
- }),
4468
- children,
4469
- showRequiredStyling && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RequiredMarker, {})
4470
- ] });
4471
- const labelProps = { ...getBaseHTMLProps(id, cn(className, readOnly && Label_module_default["read-only"]), style, htmlProps, rest) };
4472
- return afterLabelContent ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Typography, {
4473
- typographyType: "label-medium",
4474
- as: "div",
4475
- withMargins: rest.withMargins,
4476
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Typography, {
4477
- ...labelProps,
4478
- typographyType: "label-medium",
4479
- withMargins: false,
4480
- children: content
4481
- }), afterLabelContent]
4482
- }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Typography, {
4483
- ...labelProps,
4484
- typographyType: "label-medium",
4485
- children: content
4434
+ // src/components/Accordion/Accordion.tsx
4435
+ const Accordion = ({ isInitiallyExpanded = false, isExpanded, onChange, id, children, className, style, htmlProps, ...rest }) => {
4436
+ const { id: accordionId, isExpanded: expanded, toggleExpanded, bodyContentRef, headerProps, bodyProps } = useAccordion({
4437
+ isInitiallyExpanded,
4438
+ isExpanded,
4439
+ onChange,
4440
+ id
4441
+ });
4442
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
4443
+ ...getBaseHTMLProps(accordionId, cn(className, Accordion_module_default.container), style, htmlProps, rest),
4444
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AccordionContextProvider, {
4445
+ headerProps,
4446
+ bodyProps,
4447
+ isExpanded: expanded,
4448
+ toggleExpanded,
4449
+ bodyContentRef,
4450
+ children
4451
+ })
4486
4452
  });
4487
4453
  };
4488
- Label.displayName = "Label";
4489
- // src/components/Typography/Legend/Legend.tsx
4490
- const Legend = ({ id, className, style, htmlProps, typographyType = "heading-large", withMarginsOverInput, withMargins, ...rest }) => {
4491
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Typography, {
4492
- ...getBaseHTMLProps(id, cn(className, withMarginsOverInput && typographyStyles_module_default["legend--margins-over-input"]), style, htmlProps, rest),
4493
- as: "legend",
4494
- typographyType,
4495
- withMargins: optAttr(withMargins || withMarginsOverInput)
4454
+ Accordion.displayName = "Accordion";
4455
+ // src/components/Accordion/AccordionHeader.tsx
4456
+ const AccordionHeader = ({ children, className, style, htmlProps, typographyType = "heading-medium", bold, ...rest }) => {
4457
+ const { isExpanded, headerProps } = useAccordionContext();
4458
+ const { id, ...restHeaderProps } = headerProps ?? {};
4459
+ const iconState = isExpanded ? "up" : "down";
4460
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Box, {
4461
+ as: StylelessButton,
4462
+ padding: "x1 x1.5 x1 x1",
4463
+ ...getBaseHTMLProps(id, cn(className, Accordion_module_default["header-button"], AccordionBase_module_default["header-button"], _key1), style, htmlProps, rest),
4464
+ ...restHeaderProps,
4465
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
4466
+ className: cn(AccordionBase_module_default.header__content, typographyStyles_module_default[typographyType], bold && typographyStyles_module_default.bold),
4467
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, {
4468
+ icon: AnimatedChevronUpDownIcon,
4469
+ iconSize: "component",
4470
+ className: Accordion_module_default.chevron,
4471
+ iconState
4472
+ }), children]
4473
+ })
4496
4474
  });
4497
4475
  };
4498
- Legend.displayName = "Legend";
4499
- // src/components/Typography/Link/Link.tsx
4500
- const Link = ({ id, className, htmlProps, children, typographyType, withMargins, withVisited, style, color, as: propAs, isAnchor: propIsAnchor, withIconStyling, ...rest }) => {
4501
- const as = propAs ? propAs : "a";
4502
- const aProps = as === "a" || propIsAnchor ? { rel: "noopener noreferrer" } : {};
4503
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ElementAs, {
4504
- as,
4505
- ...getBaseHTMLProps(id, cn(className, typographyStyles_module_default.a, withIconStyling && typographyStyles_module_default["a--with-icon"], withVisited && typographyStyles_module_default["a--visited"], typographyType && typographyStyles_module_default[typographyType], typographyType && withMargins && typographyStyles_module_default[`${typographyType}--margins`], _key1, getColorCn(color)), {
4506
- ...style,
4507
- color: color && !isTextColor(color) ? getTextColor(color) : void 0
4508
- }, htmlProps, rest),
4509
- ...aProps,
4510
- children
4476
+ AccordionHeader.displayName = "AccordionHeader";
4477
+ // src/components/Accordion/AccordionBody.tsx
4478
+ const AccordionBody = ({ children, className, style, htmlProps, ...rest }) => {
4479
+ const { bodyContentRef, bodyProps } = useAccordionContext();
4480
+ const { className: bodyContextCn, id, height, ...restBodyProps } = bodyProps ?? {};
4481
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Box, {
4482
+ height: `${height}px`,
4483
+ ...getBaseHTMLProps(id, cn(className, bodyContextCn), style, htmlProps, rest),
4484
+ ...restBodyProps,
4485
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Box, {
4486
+ ref: bodyContentRef,
4487
+ padding: "x0.5 x1.5 x2 x1",
4488
+ children
4489
+ })
4511
4490
  });
4512
4491
  };
4513
- Link.displayName = "Link";
4514
- [...TG_BODY_TYPES, ...TG_LEAD_TYPES];
4515
- const Paragraph = ({ id, className, style, htmlProps, children, typographyType = "body-long-medium", ...rest }) => {
4516
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Typography, {
4517
- ...getBaseHTMLProps(id, className, style, htmlProps, rest),
4518
- typographyType,
4519
- children
4492
+ AccordionBody.displayName = "AccordionBody";
4493
+ // src/components/BackLink/BackLink.module.css
4494
+ var BackLink_module_default = { "icon": "dds-BackLink-module__icon" };
4495
+ // src/components/BackLink/BackLink.tsx
4496
+ const BackLink = ({ label, ref, as = "a", ...rest }) => {
4497
+ const { t } = useTranslation();
4498
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("nav", {
4499
+ ref,
4500
+ "aria-label": t(texts$30.goBack),
4501
+ className: typographyStyles_module_default["body-short-medium"],
4502
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(HStack, {
4503
+ as,
4504
+ className: cn(typographyStyles_module_default.a, _key1),
4505
+ rel: "noopener noreferer",
4506
+ ...rest,
4507
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, {
4508
+ icon: ArrowLeftIcon,
4509
+ iconSize: "component",
4510
+ className: cn(BackLink_module_default.icon)
4511
+ }), label]
4512
+ })
4520
4513
  });
4521
4514
  };
4522
- Paragraph.displayName = "Paragraph";
4515
+ BackLink.displayName = "BackLink";
4516
+ const texts$30 = createTexts({ goBack: {
4517
+ nb: "Gå tilbake",
4518
+ no: "Gå tilbake",
4519
+ nn: "Gå tilbake",
4520
+ en: "Go back",
4521
+ se: "Mana ruovttoluotta"
4522
+ } });
4523
4523
  // src/components/Breadcrumbs/Breadcrumb.tsx
4524
4524
  const isAnchorTypographyProps = (props) => {
4525
4525
  return props.href != void 0;
@@ -8386,50 +8386,6 @@ const texts$12 = createTexts({ noValue: {
8386
8386
  en: "Not filled out",
8387
8387
  se: "Ii leat devdon"
8388
8388
  } });
8389
- // src/components/GlobalMessage/GlobalMessage.module.css
8390
- var GlobalMessage_module_default = {
8391
- "container": "dds-GlobalMessage-module__container",
8392
- "container--info": "dds-GlobalMessage-module__container--info",
8393
- "icon": "dds-GlobalMessage-module__icon",
8394
- "container--danger": "dds-GlobalMessage-module__container--danger",
8395
- "container--warning": "dds-GlobalMessage-module__container--warning"
8396
- };
8397
- const icons$2 = {
8398
- info: InfoIcon,
8399
- danger: ErrorIcon,
8400
- warning: WarningIcon
8401
- };
8402
- const GlobalMessage = ({ purpose = "info", closable, onClose, children, id, className, style, htmlProps, ...rest }) => {
8403
- const { t } = useTranslation();
8404
- const [isClosed, setClosed] = (0, react.useState)(false);
8405
- return !isClosed ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(HStack, {
8406
- ...getBaseHTMLProps(id, cn(className, GlobalMessage_module_default.container, GlobalMessage_module_default[`container--${purpose}`], typographyStyles_module_default["body-short-medium"]), style, htmlProps, rest),
8407
- alignItems: "center",
8408
- justifyContent: "space-between",
8409
- width: "100%",
8410
- padding: "0 x1",
8411
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(HStack, {
8412
- alignItems: "center",
8413
- paddingBlock: "x0.75",
8414
- paddingInline: closable ? "x0 x0.75" : " x0 x1.5",
8415
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, {
8416
- icon: icons$2[purpose],
8417
- iconSize: "component",
8418
- className: GlobalMessage_module_default.icon
8419
- }), children]
8420
- }), closable && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
8421
- icon: CloseIcon,
8422
- purpose: "tertiary",
8423
- onClick: () => {
8424
- setClosed(true);
8425
- onClose?.();
8426
- },
8427
- size: "small",
8428
- "aria-label": t(commonTexts.closeMessage)
8429
- })]
8430
- }) : null;
8431
- };
8432
- GlobalMessage.displayName = "GlobalMessage";
8433
8389
  // src/components/InlineButton/InlineButton.module.css
8434
8390
  var InlineButton_module_default = { "button": "dds-InlineButton-module__button" };
8435
8391
  // src/components/InlineButton/InlineButton.tsx
@@ -8863,17 +8819,12 @@ const texts$10 = createTexts({
8863
8819
  se: "Siidu navigášuvdna"
8864
8820
  }
8865
8821
  });
8866
- // src/components/LocalMessage/LocalMessage.module.css
8867
- var LocalMessage_module_default = {
8868
- "container": "dds-LocalMessage-module__container",
8869
- "container--info": "dds-LocalMessage-module__container--info",
8870
- "container--warning": "dds-LocalMessage-module__container--warning",
8871
- "container--danger": "dds-LocalMessage-module__container--danger",
8872
- "container--success": "dds-LocalMessage-module__container--success",
8873
- "container--tips": "dds-LocalMessage-module__container--tips"
8874
- };
8875
- // src/components/LocalMessage/LocalMessage.tsx
8876
- const L_MESSAGE_PURPOSES = createPurposes("info", "success", "warning", "danger", "tips");
8822
+ // src/components/messages/GlobalMessage/GlobalMessage.module.css
8823
+ var GlobalMessage_module_default = { "container": "dds-GlobalMessage-module__container" };
8824
+ // src/components/messages/MessageBase/MessageBase.module.css
8825
+ var MessageBase_module_default = { "container": "dds-MessageBase-module__container" };
8826
+ // src/components/messages/MessageBase/MessageBase.tsx
8827
+ const MESSAGE_PURPOSES = createPurposes("info", "success", "warning", "danger", "tips");
8877
8828
  const icons$1 = {
8878
8829
  info: InfoIcon,
8879
8830
  danger: ErrorIcon,
@@ -8881,10 +8832,95 @@ const icons$1 = {
8881
8832
  success: CheckCircledIcon,
8882
8833
  tips: TipIcon
8883
8834
  };
8884
- const LocalMessage = ({ purpose = "info", closable, onClose, width, layout = "horisontal", children, id, className, style, htmlProps, ...rest }) => {
8835
+ const MessageBase = ({ children, id, className, style, htmlProps, purpose = "info", heading, closable, onClose, gridLayout, headingLevel = 2, containerGridTemplateStyles, ...rest }) => {
8885
8836
  const { t } = useTranslation();
8886
8837
  const [isOpen, setOpen] = (0, react.useState)(true);
8887
- const gridLayout = closable ? `${layout}-closable` : layout;
8838
+ const basePurpose = purpose === "tips" ? "info" : purpose;
8839
+ const purposeStyles = {
8840
+ "--dds-color-message-border": `var(--dds-color-border-${basePurpose})`,
8841
+ "--dds-color-message-background": `var(--dds-color-surface-${basePurpose}-default)`,
8842
+ "--dds-color-message-icon": `var(--dds-color-icon-on-${basePurpose}-default)`
8843
+ };
8844
+ return isOpen ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Grid, {
8845
+ ...getBaseHTMLProps(id, cn(className, typographyStyles_module_default["body-short-medium"], MessageBase_module_default.container), {
8846
+ ...style,
8847
+ ...purposeStyles
8848
+ }, htmlProps, rest),
8849
+ marginInline: "x0",
8850
+ ...containerGridTemplateStyles[gridLayout],
8851
+ children: [
8852
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(GridChild, {
8853
+ as: Icon,
8854
+ gridArea: "icon",
8855
+ icon: icons$1[purpose],
8856
+ iconSize: "component"
8857
+ }),
8858
+ heading && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(GridChild, {
8859
+ as: Heading,
8860
+ level: headingLevel,
8861
+ typographyType: "heading-small",
8862
+ gridArea: "heading",
8863
+ children: heading
8864
+ }),
8865
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(GridChild, {
8866
+ gridArea: "text",
8867
+ children
8868
+ }),
8869
+ closable && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(GridChild, {
8870
+ gridArea: "close-btn",
8871
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
8872
+ icon: CloseIcon,
8873
+ purpose: "tertiary",
8874
+ onClick: () => {
8875
+ setOpen(false);
8876
+ onClose?.();
8877
+ },
8878
+ size: "xsmall",
8879
+ "aria-label": t(commonTexts.closeMessage)
8880
+ })
8881
+ })
8882
+ ]
8883
+ }) : null;
8884
+ };
8885
+ MessageBase.displayName = "MessageBase";
8886
+ MESSAGE_PURPOSES.filter((purpose) => purpose !== "tips" && purpose !== "success");
8887
+ const GlobalMessage = (props) => {
8888
+ const gridLayout = `message${props.closable ? "-closable" : ""}${props.heading ? "-heading" : ""}`;
8889
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MessageBase, {
8890
+ gridLayout,
8891
+ containerGridTemplateStyles: {
8892
+ message: {
8893
+ gridTemplateAreas: `"icon text"`,
8894
+ gridTemplateColumns: "min-content 1fr"
8895
+ },
8896
+ "message-closable": {
8897
+ gridTemplateAreas: `"icon text close-btn"`,
8898
+ gridTemplateColumns: "min-content 1fr min-content"
8899
+ },
8900
+ "message-heading": {
8901
+ gridTemplateAreas: `"icon heading" ". text"`,
8902
+ gridTemplateColumns: "min-content 1fr"
8903
+ },
8904
+ "message-closable-heading": {
8905
+ gridTemplateAreas: `"icon heading close-btn" ". text text"`,
8906
+ gridTemplateColumns: "min-content 1fr min-content"
8907
+ }
8908
+ },
8909
+ className: GlobalMessage_module_default.container,
8910
+ rowGap: "x0.5",
8911
+ columnGap: "x0.75",
8912
+ padding: "x0.75",
8913
+ width: "100%",
8914
+ ...props
8915
+ });
8916
+ };
8917
+ GlobalMessage.displayName = "GlobalMessage";
8918
+ // src/components/messages/LocalMessage/LocalMessage.module.css
8919
+ var LocalMessage_module_default = { "container": "dds-LocalMessage-module__container" };
8920
+ // src/components/messages/LocalMessage/LocalMessage.tsx
8921
+ const L_MESSAGE_PURPOSES = MESSAGE_PURPOSES;
8922
+ const LocalMessage = ({ layout = "horisontal", ...rest }) => {
8923
+ const gridLayout = `${layout}${rest.closable ? "-closable" : ""}${rest.heading ? "-heading" : ""}`;
8888
8924
  const containerGridTemplateStyles = {
8889
8925
  horisontal: {
8890
8926
  gridTemplateAreas: `"icon text"`,
@@ -8894,6 +8930,14 @@ const LocalMessage = ({ purpose = "info", closable, onClose, width, layout = "ho
8894
8930
  gridTemplateAreas: `"icon text close-btn"`,
8895
8931
  gridTemplateColumns: "min-content 1fr min-content"
8896
8932
  },
8933
+ "horisontal-heading": {
8934
+ gridTemplateAreas: `"icon heading" ". text"`,
8935
+ gridTemplateColumns: "min-content 1fr"
8936
+ },
8937
+ "horisontal-closable-heading": {
8938
+ gridTemplateAreas: `"icon heading close-btn" ". text text"`,
8939
+ gridTemplateColumns: "min-content 1fr min-content"
8940
+ },
8897
8941
  vertical: {
8898
8942
  gridTemplateAreas: `"icon" "text"`,
8899
8943
  gridTemplateColumns: "1fr"
@@ -8901,42 +8945,26 @@ const LocalMessage = ({ purpose = "info", closable, onClose, width, layout = "ho
8901
8945
  "vertical-closable": {
8902
8946
  gridTemplateAreas: `"icon close-btn" "text text"`,
8903
8947
  gridTemplateColumns: "1fr min-content"
8948
+ },
8949
+ "vertical-heading": {
8950
+ gridTemplateAreas: `"icon" "heading" "text"`,
8951
+ gridTemplateColumns: "1fr"
8952
+ },
8953
+ "vertical-closable-heading": {
8954
+ gridTemplateAreas: `"icon close-btn" "heading heading" "text text"`,
8955
+ gridTemplateColumns: "1fr min-content"
8904
8956
  }
8905
8957
  };
8906
- return isOpen ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Grid, {
8907
- ...getBaseHTMLProps(id, cn(className, typographyStyles_module_default["body-short-medium"], LocalMessage_module_default.container, LocalMessage_module_default[`container--${purpose}`]), style, htmlProps, rest),
8908
- width,
8958
+ const hasDenseLayout = gridLayout === "vertical" || gridLayout === "vertical-closable";
8959
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MessageBase, {
8960
+ gridLayout,
8961
+ containerGridTemplateStyles,
8962
+ className: LocalMessage_module_default.container,
8909
8963
  padding: "x0.75 x0.75 x0.75 x0.5",
8910
- rowGap: "x0.5",
8964
+ rowGap: hasDenseLayout ? "x0.25" : "x0.5",
8911
8965
  columnGap: "x0.5",
8912
- marginInline: "x0",
8913
- ...containerGridTemplateStyles[gridLayout],
8914
- children: [
8915
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(GridChild, {
8916
- as: Icon,
8917
- gridArea: "icon",
8918
- iconSize: "component",
8919
- icon: icons$1[purpose],
8920
- color: `var(--dds-color-icon-on-${purpose === "tips" ? "info" : purpose}-default)`
8921
- }),
8922
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(GridChild, {
8923
- gridArea: "text",
8924
- children
8925
- }),
8926
- closable && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(GridChild, {
8927
- as: Button,
8928
- gridArea: "close-btn",
8929
- icon: CloseIcon,
8930
- purpose: "tertiary",
8931
- onClick: () => {
8932
- setOpen(false);
8933
- onClose?.();
8934
- },
8935
- size: "xsmall",
8936
- "aria-label": t(commonTexts.closeMessage)
8937
- })
8938
- ]
8939
- }) : null;
8966
+ ...rest
8967
+ });
8940
8968
  };
8941
8969
  LocalMessage.displayName = "LocalMessage";
8942
8970
  // src/components/Modal/Modal.module.css