@norges-domstoler/dds-components 25.0.1 → 25.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1302 -1258
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +364 -394
- package/dist/index.d.cts +82 -78
- package/dist/index.d.mts +82 -78
- package/dist/index.mjs +1302 -1259
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -42,8 +42,8 @@ let _react_aria_i18n = require("@react-aria/i18n");
|
|
|
42
42
|
let _react_stately_calendar = require("@react-stately/calendar");
|
|
43
43
|
let _react_aria_datepicker = require("@react-aria/datepicker");
|
|
44
44
|
let _react_stately_datepicker = require("@react-stately/datepicker");
|
|
45
|
-
let _react_aria_button = require("@react-aria/button");
|
|
46
45
|
let _react_aria_focus = require("@react-aria/focus");
|
|
46
|
+
let _react_aria_button = require("@react-aria/button");
|
|
47
47
|
let file_selector = require("file-selector");
|
|
48
48
|
let react_select = require("react-select");
|
|
49
49
|
react_select = __toESM(react_select);
|
|
@@ -162,14 +162,6 @@ var utilStyles_module_default = {
|
|
|
162
162
|
"center-absolute-y": "dds-utilStyles-module__center-absolute-y",
|
|
163
163
|
"center-absolute-x": "dds-utilStyles-module__center-absolute-x"
|
|
164
164
|
};
|
|
165
|
-
// src/components/helpers/AccordionBase/AccordionBase.module.css
|
|
166
|
-
var AccordionBase_module_default = {
|
|
167
|
-
"header-button": "dds-AccordionBase-module__header-button",
|
|
168
|
-
"header__content": "dds-AccordionBase-module__header__content",
|
|
169
|
-
"body": "dds-AccordionBase-module__body",
|
|
170
|
-
"body--animated": "dds-AccordionBase-module__body--animated",
|
|
171
|
-
"body--hidden": "dds-AccordionBase-module__body--hidden"
|
|
172
|
-
};
|
|
173
165
|
// src/hooks/useCallbackRef/useCallbackRef.ts
|
|
174
166
|
/**
|
|
175
167
|
* Hook som returnerer en callback-funksjon som refererer til den nyeste versjonen av den opprinnelige funksjonen.
|
|
@@ -988,6 +980,14 @@ const useWindowResize = (handler) => {
|
|
|
988
980
|
return () => window.removeEventListener("resize", handler);
|
|
989
981
|
}, [handler]);
|
|
990
982
|
};
|
|
983
|
+
// src/components/helpers/AccordionBase/AccordionBase.module.css
|
|
984
|
+
var AccordionBase_module_default = {
|
|
985
|
+
"header-button": "dds-AccordionBase-module__header-button",
|
|
986
|
+
"header__content": "dds-AccordionBase-module__header__content",
|
|
987
|
+
"body": "dds-AccordionBase-module__body",
|
|
988
|
+
"body--animated": "dds-AccordionBase-module__body--animated",
|
|
989
|
+
"body--hidden": "dds-AccordionBase-module__body--hidden"
|
|
990
|
+
};
|
|
991
991
|
// src/components/helpers/AccordionBase/useAccordion.tsx
|
|
992
992
|
/**
|
|
993
993
|
* Implementerer trekkspill-mønsteret; header som utvider og trekker sammen et panel. Håndterer oppførsel, UU og visuelle effekter.
|
|
@@ -1095,12 +1095,6 @@ function handleElementWithBackdropUnmount(container) {
|
|
|
1095
1095
|
if (isNaN(scrollY)) return;
|
|
1096
1096
|
window.scrollTo(0, scrollY * -1);
|
|
1097
1097
|
}
|
|
1098
|
-
// src/components/helpers/Backdrop/Backdrop.module.css
|
|
1099
|
-
var Backdrop_module_default = {
|
|
1100
|
-
"backdrop": "dds-Backdrop-module__backdrop",
|
|
1101
|
-
"backdrop--visible": "dds-Backdrop-module__backdrop--visible",
|
|
1102
|
-
"backdrop--hidden": "dds-Backdrop-module__backdrop--hidden"
|
|
1103
|
-
};
|
|
1104
1098
|
// src/types/BaseComponentProps.ts
|
|
1105
1099
|
function pruneUndefined(obj) {
|
|
1106
1100
|
return Object.fromEntries(Object.entries(obj).filter(([, v]) => v !== void 0));
|
|
@@ -1577,15 +1571,6 @@ const GridChild = ({ id, className, htmlProps, style, gridRow, gridArea, justify
|
|
|
1577
1571
|
}, htmlProps, rest) });
|
|
1578
1572
|
};
|
|
1579
1573
|
GridChild.displayName = "GridChild";
|
|
1580
|
-
// src/components/layout/Paper/Paper.module.css
|
|
1581
|
-
var Paper_module_default = {
|
|
1582
|
-
"background": "dds-Paper-module__background",
|
|
1583
|
-
"border": "dds-Paper-module__border",
|
|
1584
|
-
"container": "dds-Paper-module__container",
|
|
1585
|
-
"shadow--small": "dds-Paper-module__shadow--small",
|
|
1586
|
-
"shadow--medium": "dds-Paper-module__shadow--medium",
|
|
1587
|
-
"shadow--large": "dds-Paper-module__shadow--large"
|
|
1588
|
-
};
|
|
1589
1574
|
// src/components/layout/common/surface.module.css
|
|
1590
1575
|
var surface_module_default = {
|
|
1591
1576
|
"border-radius--button": "dds-surface-module__border-radius--button",
|
|
@@ -1595,6 +1580,15 @@ var surface_module_default = {
|
|
|
1595
1580
|
"border-radius--rounded": "dds-surface-module__border-radius--rounded",
|
|
1596
1581
|
"border-radius--0": "dds-surface-module__border-radius--0"
|
|
1597
1582
|
};
|
|
1583
|
+
// src/components/layout/Paper/Paper.module.css
|
|
1584
|
+
var Paper_module_default = {
|
|
1585
|
+
"background": "dds-Paper-module__background",
|
|
1586
|
+
"border": "dds-Paper-module__border",
|
|
1587
|
+
"container": "dds-Paper-module__container",
|
|
1588
|
+
"shadow--small": "dds-Paper-module__shadow--small",
|
|
1589
|
+
"shadow--medium": "dds-Paper-module__shadow--medium",
|
|
1590
|
+
"shadow--large": "dds-Paper-module__shadow--large"
|
|
1591
|
+
};
|
|
1598
1592
|
// src/components/layout/Paper/Paper.tsx
|
|
1599
1593
|
const Paper = ({ id, elevation, border, borderRadius = "surface", background = "surface-paper-default", className, htmlProps, style, ...rest }) => {
|
|
1600
1594
|
const styleVariables = {
|
|
@@ -1624,6 +1618,12 @@ const HStack = ({ id, className, style, htmlProps, ...rest }) => {
|
|
|
1624
1618
|
});
|
|
1625
1619
|
};
|
|
1626
1620
|
HStack.displayName = "HStack";
|
|
1621
|
+
// src/components/helpers/Backdrop/Backdrop.module.css
|
|
1622
|
+
var Backdrop_module_default = {
|
|
1623
|
+
"backdrop": "dds-Backdrop-module__backdrop",
|
|
1624
|
+
"backdrop--visible": "dds-Backdrop-module__backdrop--visible",
|
|
1625
|
+
"backdrop--hidden": "dds-Backdrop-module__backdrop--hidden"
|
|
1626
|
+
};
|
|
1627
1627
|
// src/components/helpers/Backdrop/Backdrop.tsx
|
|
1628
1628
|
/**
|
|
1629
1629
|
* Backdrop-komponent, viser et bakgrunnslag for et element som skal låse applikasjonen i bakgrunnen (Modal el.l.).
|
|
@@ -1663,438 +1663,222 @@ const Backdrop = ({ isMounted, zIndex, ...props }) => {
|
|
|
1663
1663
|
});
|
|
1664
1664
|
};
|
|
1665
1665
|
Backdrop.displayName = "Backdrop";
|
|
1666
|
-
// src/components/
|
|
1667
|
-
var
|
|
1668
|
-
"
|
|
1669
|
-
"
|
|
1670
|
-
"danger": "dds-DropdownItem-module__danger",
|
|
1671
|
-
"item--interactive": "dds-DropdownItem-module__item--interactive",
|
|
1672
|
-
"item--loading": "dds-DropdownItem-module__item--loading"
|
|
1673
|
-
};
|
|
1674
|
-
// src/components/Badge/Badge.module.css
|
|
1675
|
-
var Badge_module_default = {
|
|
1676
|
-
"container": "dds-Badge-module__container",
|
|
1677
|
-
"notification": "dds-Badge-module__notification",
|
|
1678
|
-
"action": "dds-Badge-module__action",
|
|
1679
|
-
"neutral": "dds-Badge-module__neutral",
|
|
1680
|
-
"subtle": "dds-Badge-module__subtle"
|
|
1666
|
+
// src/components/Typography/Typography/TextOverflowEllipsis/TextOverflowEllipsis.module.css
|
|
1667
|
+
var TextOverflowEllipsis_module_default = {
|
|
1668
|
+
"wrapper": "dds-TextOverflowEllipsis-module__wrapper",
|
|
1669
|
+
"inner": "dds-TextOverflowEllipsis-module__inner"
|
|
1681
1670
|
};
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
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;
|
|
1707
|
-
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
|
-
})
|
|
1671
|
+
// src/components/Typography/Typography/TextOverflowEllipsis/TextOverflowEllipsis.tsx
|
|
1672
|
+
function TextOverflowEllipsisWrapper({ className, ...rest }) {
|
|
1673
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1674
|
+
...rest,
|
|
1675
|
+
className: cn(className, TextOverflowEllipsis_module_default.wrapper)
|
|
1676
|
+
});
|
|
1677
|
+
}
|
|
1678
|
+
function TextOverflowEllipsisInner({ className, ...rest }) {
|
|
1679
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1680
|
+
...rest,
|
|
1681
|
+
className: cn(className, TextOverflowEllipsis_module_default.inner)
|
|
1723
1682
|
});
|
|
1683
|
+
}
|
|
1684
|
+
// src/components/helpers/styling/focus.module.css
|
|
1685
|
+
const _key1 = "dds-focus-module__focusable";
|
|
1686
|
+
var focus_module_default = {
|
|
1687
|
+
"focused": "dds-focus-module__focused",
|
|
1688
|
+
"focusable": "dds-focus-module__focusable",
|
|
1689
|
+
"focusable-focus": "dds-focus-module__focusable-focus",
|
|
1690
|
+
"focusable-within": "dds-focus-module__focusable-within",
|
|
1691
|
+
"has-focusable-input": "dds-focus-module__has-focusable-input",
|
|
1692
|
+
"focusable-sibling": "dds-focus-module__focusable-sibling",
|
|
1693
|
+
"focus-styled-sibling": "dds-focus-module__focus-styled-sibling",
|
|
1694
|
+
"focusable--inset": "dds-focus-module__focusable--inset"
|
|
1724
1695
|
};
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1696
|
+
// src/components/Typography/Typography/Typography.module.css
|
|
1697
|
+
var Typography_module_default = { "container": "dds-Typography-module__container" };
|
|
1698
|
+
// src/components/Typography/Typography/Typography.types.ts
|
|
1699
|
+
const TG_BODY_SHORT_TYPES = [
|
|
1700
|
+
"body-short-xsmall",
|
|
1701
|
+
"body-short-small",
|
|
1702
|
+
"body-short-medium",
|
|
1703
|
+
"body-short-large"
|
|
1704
|
+
];
|
|
1705
|
+
const TG_BODY_LONG_TYPES = [
|
|
1706
|
+
"body-long-xsmall",
|
|
1707
|
+
"body-long-small",
|
|
1708
|
+
"body-long-medium",
|
|
1709
|
+
"body-long-large"
|
|
1710
|
+
];
|
|
1711
|
+
const TG_BODY_TYPES = [...TG_BODY_SHORT_TYPES, ...TG_BODY_LONG_TYPES];
|
|
1712
|
+
const TG_LEAD_TYPES = ["lead-medium"];
|
|
1713
|
+
const TG_HEADING_TYPES = [
|
|
1714
|
+
"heading-xxsmall",
|
|
1715
|
+
"heading-xsmall",
|
|
1716
|
+
"heading-small",
|
|
1717
|
+
"heading-medium",
|
|
1718
|
+
"heading-large",
|
|
1719
|
+
"heading-xlarge",
|
|
1720
|
+
"heading-xxlarge"
|
|
1721
|
+
];
|
|
1722
|
+
// src/components/Typography/Typography/Typography.utils.ts
|
|
1723
|
+
const getElementType = (element) => {
|
|
1724
|
+
switch (element) {
|
|
1725
|
+
case "a": return "a";
|
|
1726
|
+
case "heading-xxsmall": return "h6";
|
|
1727
|
+
case "heading-xsmall": return "h5";
|
|
1728
|
+
case "heading-small": return "h4";
|
|
1729
|
+
case "heading-medium": return "h3";
|
|
1730
|
+
case "heading-large": return "h2";
|
|
1731
|
+
case "heading-xlarge":
|
|
1732
|
+
case "heading-xxlarge": return "h1";
|
|
1733
|
+
case "label-medium": return "label";
|
|
1734
|
+
default: return "p";
|
|
1732
1735
|
}
|
|
1733
1736
|
};
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
const { id, iconSize = "6", color = "currentcolor", icon, className, style, htmlProps, iconState, ...rest } = props;
|
|
1737
|
-
const size = getSize(iconSize);
|
|
1738
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(icon, {
|
|
1739
|
-
...getBaseHTMLProps(id, className, style, htmlProps, rest),
|
|
1740
|
-
height: size,
|
|
1741
|
-
width: size,
|
|
1742
|
-
fill: color,
|
|
1743
|
-
"aria-hidden": htmlProps?.["aria-hidden"] ?? true,
|
|
1744
|
-
...iconState ? { iconState } : {}
|
|
1745
|
-
});
|
|
1746
|
-
}
|
|
1747
|
-
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"
|
|
1737
|
+
const isHeading = (type) => {
|
|
1738
|
+
return TG_HEADING_TYPES.includes(type);
|
|
1754
1739
|
};
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
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`;
|
|
1851
|
-
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), {
|
|
1740
|
+
const isLegend = (as) => {
|
|
1741
|
+
return as === "legend";
|
|
1742
|
+
};
|
|
1743
|
+
const isCaption = (as) => {
|
|
1744
|
+
return as === "caption";
|
|
1745
|
+
};
|
|
1746
|
+
const inlineElements = [
|
|
1747
|
+
"a",
|
|
1748
|
+
"abbr",
|
|
1749
|
+
"audio",
|
|
1750
|
+
"b",
|
|
1751
|
+
"bdi",
|
|
1752
|
+
"bdo",
|
|
1753
|
+
"big",
|
|
1754
|
+
"br",
|
|
1755
|
+
"button",
|
|
1756
|
+
"canvas",
|
|
1757
|
+
"cite",
|
|
1758
|
+
"code",
|
|
1759
|
+
"data",
|
|
1760
|
+
"datalist",
|
|
1761
|
+
"del",
|
|
1762
|
+
"dfn",
|
|
1763
|
+
"em",
|
|
1764
|
+
"embed",
|
|
1765
|
+
"i",
|
|
1766
|
+
"iframe",
|
|
1767
|
+
"img",
|
|
1768
|
+
"input",
|
|
1769
|
+
"ins",
|
|
1770
|
+
"kbd",
|
|
1771
|
+
"label",
|
|
1772
|
+
"map",
|
|
1773
|
+
"mark",
|
|
1774
|
+
"meter",
|
|
1775
|
+
"noscript",
|
|
1776
|
+
"object",
|
|
1777
|
+
"output",
|
|
1778
|
+
"picture",
|
|
1779
|
+
"progress",
|
|
1780
|
+
"q",
|
|
1781
|
+
"ruby",
|
|
1782
|
+
"s",
|
|
1783
|
+
"samp",
|
|
1784
|
+
"script",
|
|
1785
|
+
"select",
|
|
1786
|
+
"slot",
|
|
1787
|
+
"small",
|
|
1788
|
+
"span",
|
|
1789
|
+
"strong",
|
|
1790
|
+
"sub",
|
|
1791
|
+
"sup",
|
|
1792
|
+
"svg",
|
|
1793
|
+
"template",
|
|
1794
|
+
"textarea",
|
|
1795
|
+
"time",
|
|
1796
|
+
"u",
|
|
1797
|
+
"var",
|
|
1798
|
+
"video",
|
|
1799
|
+
"wbr"
|
|
1800
|
+
];
|
|
1801
|
+
const isInlineElement = (as) => inlineElements.indexOf(as) !== -1;
|
|
1802
|
+
const getColorCn = (color) => {
|
|
1803
|
+
if (!isTextColor(color)) return null;
|
|
1804
|
+
const [prefix] = color.split("-", 1);
|
|
1805
|
+
return typographyStyles_module_default[`${prefix}-color--${color.slice(prefix.length + 1)}`] || null;
|
|
1806
|
+
};
|
|
1807
|
+
// src/components/Typography/Typography/Typography.tsx
|
|
1808
|
+
const isAnchorProps = (props) => props.typographyType === "a";
|
|
1809
|
+
const Typography = (props) => {
|
|
1810
|
+
const { typographyType = "body-long-medium", as: propAs, children, bold, underline, italic, style, id, withMargins, color, className, htmlProps = {}, ...rest } = props;
|
|
1811
|
+
const as = propAs ? propAs : getElementType(typographyType);
|
|
1812
|
+
let relProp;
|
|
1813
|
+
if (isAnchorProps(props)) relProp = as === "a" ? "noopener noreferer" : void 0;
|
|
1814
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Box, {
|
|
1815
|
+
...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"), {
|
|
1856
1816
|
...style,
|
|
1857
|
-
|
|
1858
|
-
height: size,
|
|
1859
|
-
["--dds-color-spinner"]: getTextColor(color)
|
|
1817
|
+
color: color && !isTextColor(color) ? getTextColor(color) : void 0
|
|
1860
1818
|
}, htmlProps, rest),
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
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
|
-
})
|
|
1883
|
-
]
|
|
1819
|
+
as,
|
|
1820
|
+
rel: relProp,
|
|
1821
|
+
children
|
|
1884
1822
|
});
|
|
1885
|
-
}
|
|
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
1823
|
};
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
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,
|
|
1925
|
-
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
|
-
})
|
|
1945
|
-
]
|
|
1824
|
+
Typography.displayName = "Typography";
|
|
1825
|
+
// src/components/Typography/Caption/Caption.tsx
|
|
1826
|
+
const Caption = ({ typographyType = "heading-large", id, className, style, htmlProps, children, ...rest }) => {
|
|
1827
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Typography, {
|
|
1828
|
+
...getBaseHTMLProps(id, className, style, htmlProps, rest),
|
|
1829
|
+
typographyType,
|
|
1830
|
+
as: "caption",
|
|
1831
|
+
children
|
|
1946
1832
|
});
|
|
1947
1833
|
};
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1834
|
+
Caption.displayName = "Caption";
|
|
1835
|
+
// src/components/Typography/Heading/Heading.tsx
|
|
1836
|
+
const getHeadingElement = (level) => `h${level}`;
|
|
1837
|
+
const getDefaultTypographyType = (h) => {
|
|
1838
|
+
switch (h) {
|
|
1839
|
+
case "h1": return "heading-xlarge";
|
|
1840
|
+
case "h2": return "heading-large";
|
|
1841
|
+
case "h3": return "heading-medium";
|
|
1842
|
+
case "h4": return "heading-small";
|
|
1843
|
+
case "h5": return "heading-xsmall";
|
|
1844
|
+
case "h6": return "heading-xxsmall";
|
|
1845
|
+
default: return "heading-xlarge";
|
|
1846
|
+
}
|
|
1847
|
+
};
|
|
1848
|
+
const Heading = ({ id, className, style, htmlProps, children, typographyType, level, withMargins, withMarginsOverInput, ...rest }) => {
|
|
1849
|
+
const headingElement = getHeadingElement(level);
|
|
1850
|
+
const standardTypographyType = typographyType ?? getDefaultTypographyType(headingElement);
|
|
1851
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Typography, {
|
|
1852
|
+
...getBaseHTMLProps(id, cn(className, withMarginsOverInput && typographyStyles_module_default["heading--margins-over-input"]), style, htmlProps, rest),
|
|
1853
|
+
typographyType: standardTypographyType,
|
|
1854
|
+
as: headingElement,
|
|
1855
|
+
withMargins: optAttr(withMargins || withMarginsOverInput),
|
|
1856
|
+
children
|
|
1955
1857
|
});
|
|
1956
1858
|
};
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
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"
|
|
1859
|
+
Heading.displayName = "Heading";
|
|
1860
|
+
// src/components/Icon/Icon.tsx
|
|
1861
|
+
const getSize = (iconSize) => {
|
|
1862
|
+
switch (iconSize) {
|
|
1863
|
+
case "component": return "var(--dds-size-icon-component)";
|
|
1864
|
+
case "inherit": return "1em";
|
|
1865
|
+
default: return `var(--dds-size-${iconSize})`;
|
|
1866
|
+
}
|
|
2097
1867
|
};
|
|
1868
|
+
[...SIZE_SCALE];
|
|
1869
|
+
function Icon(props) {
|
|
1870
|
+
const { id, iconSize = "6", color = "currentcolor", icon, className, style, htmlProps, iconState, ...rest } = props;
|
|
1871
|
+
const size = getSize(iconSize);
|
|
1872
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(icon, {
|
|
1873
|
+
...getBaseHTMLProps(id, className, style, htmlProps, rest),
|
|
1874
|
+
height: size,
|
|
1875
|
+
width: size,
|
|
1876
|
+
fill: color,
|
|
1877
|
+
"aria-hidden": htmlProps?.["aria-hidden"] ?? true,
|
|
1878
|
+
...iconState ? { iconState } : {}
|
|
1879
|
+
});
|
|
1880
|
+
}
|
|
1881
|
+
Icon.displayName = "Icon";
|
|
2098
1882
|
// src/components/Icon/Icon.module.css
|
|
2099
1883
|
var Icon_module_default = { "svg": "dds-Icon-module__svg" };
|
|
2100
1884
|
// src/components/Icon/utils/SvgWrapper.tsx
|
|
@@ -3430,6 +3214,18 @@ function ReceiptIcon(props) {
|
|
|
3430
3214
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M16.667 20.2454C17.058 20.2454 17.441 20.3571 17.7705 20.5676L17.7725 20.5696L18.7002 21.1653L18.7686 21.2024C18.8398 21.2342 18.9175 21.2507 18.9961 21.2502H19C19.0662 21.2502 19.1299 21.2238 19.1768 21.177C19.2236 21.1302 19.2499 21.0664 19.25 21.0002V3.00024C19.25 2.93402 19.2235 2.87035 19.1768 2.82349C19.1299 2.7766 19.0663 2.75024 19 2.75024H18.9961C18.8915 2.74967 18.7887 2.77859 18.7002 2.83423L17.7725 3.43091L17.7705 3.43188C17.4409 3.64243 17.0581 3.75415 16.667 3.75415C16.2759 3.75415 15.8931 3.64243 15.5635 3.43188L15.5615 3.43091L14.6289 2.8313C14.5406 2.77497 14.4378 2.74536 14.333 2.74536C14.2281 2.74536 14.1255 2.77577 14.0371 2.83228L14.0361 2.8313L13.1055 3.43091L13.1035 3.43188C12.8152 3.61606 12.4862 3.72493 12.1465 3.74927L12 3.75415C11.6089 3.75415 11.2261 3.64243 10.8965 3.43188L10.8945 3.43091L9.96289 2.8313C9.87456 2.77498 9.77176 2.74536 9.66699 2.74536C9.56204 2.74536 9.45953 2.77577 9.37109 2.83228L9.37012 2.8313L8.43848 3.43091L8.43652 3.43188C8.10694 3.64243 7.72411 3.75415 7.33301 3.75415C6.94191 3.75415 6.55908 3.64243 6.22949 3.43188L6.22754 3.43091L5.2998 2.83423C5.21127 2.77859 5.10848 2.74967 5.00391 2.75024H5C4.9337 2.75024 4.87013 2.7766 4.82324 2.82349C4.77646 2.87035 4.75 2.93402 4.75 3.00024V21.0002C4.75009 21.0664 4.77644 21.1302 4.82324 21.177C4.87011 21.2238 4.93377 21.2502 5 21.2502H5.00391C5.10854 21.2508 5.21123 21.221 5.2998 21.1653L6.22754 20.5696L6.22949 20.5676C6.55904 20.3571 6.94197 20.2454 7.33301 20.2454C7.72405 20.2454 8.10697 20.3571 8.43652 20.5676L8.43848 20.5686L9.37012 21.1682H9.37109C9.45946 21.2246 9.56216 21.2541 9.66699 21.2542C9.77182 21.2542 9.87452 21.2246 9.96289 21.1682L10.8945 20.5696L10.8965 20.5676C11.226 20.3571 11.609 20.2454 12 20.2454C12.391 20.2454 12.774 20.3571 13.1035 20.5676L13.1055 20.5696L14.0371 21.1682L14.1055 21.2053C14.1766 21.2377 14.2542 21.2542 14.333 21.2542C14.4118 21.2541 14.4894 21.2377 14.5605 21.2053L14.6289 21.1682L15.5615 20.5686L15.5635 20.5676C15.893 20.3571 16.2759 20.2454 16.667 20.2454ZM13 15.2502C13.4142 15.2502 13.75 15.586 13.75 16.0002C13.7498 16.4143 13.4141 16.7502 13 16.7502H8C7.5859 16.7502 7.25018 16.4143 7.25 16.0002C7.25 15.586 7.58579 15.2502 8 15.2502H13ZM16 11.2502C16.4142 11.2502 16.75 11.586 16.75 12.0002C16.7498 12.4143 16.4141 12.7502 16 12.7502H8C7.5859 12.7502 7.25018 12.4143 7.25 12.0002C7.25 11.586 7.58579 11.2502 8 11.2502H16ZM14 7.25024C14.4142 7.25024 14.75 7.58603 14.75 8.00024C14.7498 8.41431 14.4141 8.75024 14 8.75024H8C7.5859 8.75024 7.25018 8.41431 7.25 8.00024C7.25 7.58603 7.58579 7.25024 8 7.25024H14ZM20.75 21.0002C20.7499 21.4643 20.5654 21.9094 20.2373 22.2375C19.9098 22.5649 19.4659 22.7485 19.0029 22.7493L19.0039 22.7502L19.001 22.7493L19 22.7502V22.7493C18.611 22.7506 18.2296 22.6421 17.9004 22.4348L17.8945 22.4309L16.9629 21.8313C16.8746 21.775 16.7718 21.7454 16.667 21.7454C16.562 21.7454 16.4595 21.7758 16.3711 21.8323L16.3701 21.8313L15.4385 22.4309L15.4365 22.4319C15.1069 22.6424 14.7241 22.7542 14.333 22.7542C13.9419 22.7542 13.5591 22.6424 13.2295 22.4319L13.2275 22.4309L12.2959 21.8313C12.2076 21.775 12.1048 21.7454 12 21.7454C11.8951 21.7454 11.7925 21.7758 11.7041 21.8323L11.7031 21.8313L10.7725 22.4309L10.7705 22.4319C10.4409 22.6424 10.0581 22.7542 9.66699 22.7542C9.27589 22.7541 8.89306 22.6424 8.56348 22.4319L8.56152 22.4309L7.62891 21.8313C7.54057 21.775 7.43778 21.7454 7.33301 21.7454C7.22806 21.7454 7.12554 21.7758 7.03711 21.8323L7.03613 21.8313L6.10547 22.4309L6.09961 22.4348C5.77042 22.6421 5.38897 22.7506 5 22.7493H4.99805L4.99609 22.7502V22.7493C4.53345 22.7482 4.08995 22.5647 3.7627 22.2375C3.43458 21.9094 3.25009 21.4643 3.25 21.0002V3.00024C3.25 2.53619 3.43461 2.09111 3.7627 1.76294C4.08996 1.43567 4.53338 1.25225 4.99609 1.25122V1.25024L4.99805 1.25122L5 1.25024V1.25122C5.38905 1.24986 5.77037 1.35829 6.09961 1.56567L6.10547 1.5686V1.56958L7.03711 2.16821L7.10547 2.20532C7.17664 2.23766 7.25424 2.25415 7.33301 2.25415C7.41178 2.25415 7.48937 2.23766 7.56055 2.20532L7.62891 2.16821L8.56152 1.5686L8.56348 1.56763C8.89303 1.35714 9.27595 1.24536 9.66699 1.24536C10.0092 1.24536 10.3451 1.33098 10.6445 1.49341L10.7705 1.56763L10.7725 1.56958L11.7041 2.16821L11.7725 2.20532C11.8436 2.23766 11.9212 2.25415 12 2.25415L12.0781 2.24927C12.1553 2.23819 12.2296 2.21049 12.2959 2.16821L13.2275 1.56958L13.2295 1.56763C13.559 1.35714 13.942 1.24536 14.333 1.24536C14.6752 1.24536 15.0111 1.33097 15.3105 1.49341L15.4365 1.56763L15.4385 1.5686L16.3701 2.16821H16.3711C16.4595 2.2246 16.5622 2.25415 16.667 2.25415C16.7718 2.25415 16.8745 2.2246 16.9629 2.16821L17.8945 1.56958L17.9004 1.56567C18.2296 1.35829 18.611 1.24986 19 1.25122V1.25024L19.001 1.25122L19.0039 1.25024L19.0029 1.25122C19.466 1.252 19.9098 1.43544 20.2373 1.76294C20.5654 2.09111 20.75 2.53619 20.75 3.00024V21.0002Z" })
|
|
3431
3215
|
});
|
|
3432
3216
|
}
|
|
3217
|
+
// src/components/Icon/icons/recorder.tsx
|
|
3218
|
+
/** Settings and tools. Search terms: opptak, recording, utstyr, equipment. */
|
|
3219
|
+
function RecorderIcon(props) {
|
|
3220
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(SvgWrapper, {
|
|
3221
|
+
...props,
|
|
3222
|
+
children: [
|
|
3223
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M17 20.25C17.4142 20.25 17.75 20.5858 17.75 21C17.75 21.4142 17.4142 21.75 17 21.75H7C6.58579 21.75 6.25 21.4142 6.25 21C6.25 20.5858 6.58579 20.25 7 20.25H17Z" }),
|
|
3224
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M21.25 6C21.25 5.30964 20.6904 4.75 20 4.75H4C3.30964 4.75 2.75 5.30964 2.75 6V15C2.75 15.6904 3.30964 16.25 4 16.25H20C20.6904 16.25 21.25 15.6904 21.25 15V6ZM22.75 15C22.75 16.5188 21.5188 17.75 20 17.75H4C2.48122 17.75 1.25 16.5188 1.25 15V6C1.25 4.48122 2.48122 3.25 4 3.25H20C21.5188 3.25 22.75 4.48122 22.75 6V15Z" }),
|
|
3225
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M15.2845 10.1422C15.5793 10.2896 15.5793 10.7104 15.2845 10.8578L9.57889 13.7106C9.31292 13.8435 9 13.6501 9 13.3528L9 7.64721C9 7.34986 9.31292 7.15646 9.57889 7.28944L15.2845 10.1422Z" })
|
|
3226
|
+
]
|
|
3227
|
+
});
|
|
3228
|
+
}
|
|
3433
3229
|
// src/components/Icon/icons/redo.tsx
|
|
3434
3230
|
/** Edit. Search terms: gjenta, redo, frem, forward, pil, arrow. */
|
|
3435
3231
|
function RedoIcon(props) {
|
|
@@ -4071,6 +3867,7 @@ var icons_exports = /* @__PURE__ */ __exportAll({
|
|
|
4071
3867
|
PublishIcon: () => PublishIcon,
|
|
4072
3868
|
QuestionAnswerIcon: () => QuestionAnswerIcon,
|
|
4073
3869
|
ReceiptIcon: () => ReceiptIcon,
|
|
3870
|
+
RecorderIcon: () => RecorderIcon,
|
|
4074
3871
|
RedoIcon: () => RedoIcon,
|
|
4075
3872
|
RefreshIcon: () => RefreshIcon,
|
|
4076
3873
|
ReplayIcon: () => ReplayIcon,
|
|
@@ -4110,403 +3907,619 @@ var icons_exports = /* @__PURE__ */ __exportAll({
|
|
|
4110
3907
|
ZoomInIcon: () => ZoomInIcon,
|
|
4111
3908
|
ZoomOutIcon: () => ZoomOutIcon
|
|
4112
3909
|
});
|
|
4113
|
-
// src/components/
|
|
4114
|
-
var
|
|
4115
|
-
"
|
|
4116
|
-
"
|
|
3910
|
+
// src/components/Typography/Label/Label.module.css
|
|
3911
|
+
var Label_module_default = {
|
|
3912
|
+
"read-only": "dds-Label-module__read-only",
|
|
3913
|
+
"read-only__icon": "dds-Label-module__read-only__icon"
|
|
4117
3914
|
};
|
|
4118
|
-
// src/components/
|
|
4119
|
-
const
|
|
4120
|
-
const
|
|
4121
|
-
|
|
4122
|
-
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
|
|
4128
|
-
|
|
4129
|
-
|
|
4130
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.
|
|
4131
|
-
|
|
4132
|
-
|
|
4133
|
-
|
|
4134
|
-
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
|
|
4138
|
-
children
|
|
4139
|
-
})
|
|
3915
|
+
// src/components/Typography/Label/Label.tsx
|
|
3916
|
+
const Label = ({ showRequiredStyling, readOnly, id, className, style, htmlProps, children, afterLabelContent, ...rest }) => {
|
|
3917
|
+
const content = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
3918
|
+
readOnly && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, {
|
|
3919
|
+
icon: LockFilledIcon,
|
|
3920
|
+
iconSize: "4",
|
|
3921
|
+
className: Label_module_default["read-only__icon"]
|
|
3922
|
+
}),
|
|
3923
|
+
children,
|
|
3924
|
+
showRequiredStyling && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RequiredMarker, {})
|
|
3925
|
+
] });
|
|
3926
|
+
const labelProps = { ...getBaseHTMLProps(id, cn(className, readOnly && Label_module_default["read-only"]), style, htmlProps, rest) };
|
|
3927
|
+
return afterLabelContent ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Typography, {
|
|
3928
|
+
typographyType: "label-medium",
|
|
3929
|
+
as: "div",
|
|
3930
|
+
withMargins: rest.withMargins,
|
|
3931
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Typography, {
|
|
3932
|
+
...labelProps,
|
|
3933
|
+
typographyType: "label-medium",
|
|
3934
|
+
withMargins: false,
|
|
3935
|
+
children: content
|
|
3936
|
+
}), afterLabelContent]
|
|
3937
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Typography, {
|
|
3938
|
+
...labelProps,
|
|
3939
|
+
typographyType: "label-medium",
|
|
3940
|
+
children: content
|
|
4140
3941
|
});
|
|
4141
|
-
}
|
|
4142
|
-
|
|
4143
|
-
|
|
4144
|
-
|
|
4145
|
-
|
|
4146
|
-
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
|
|
4150
|
-
return {
|
|
4151
|
-
theme: _norges_domstoler_dds_design_tokens.ddsTokens[themeName],
|
|
4152
|
-
themeName
|
|
4153
|
-
};
|
|
4154
|
-
}
|
|
4155
|
-
// src/DdsProvider/DdsProvider.tsx
|
|
4156
|
-
function DdsProvider({ language, theme, children }) {
|
|
4157
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LanguageProvider, {
|
|
4158
|
-
language,
|
|
4159
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ThemeProvider, {
|
|
4160
|
-
theme,
|
|
4161
|
-
children
|
|
4162
|
-
})
|
|
3942
|
+
};
|
|
3943
|
+
Label.displayName = "Label";
|
|
3944
|
+
// src/components/Typography/Legend/Legend.tsx
|
|
3945
|
+
const Legend = ({ id, className, style, htmlProps, typographyType = "heading-large", withMarginsOverInput, withMargins, ...rest }) => {
|
|
3946
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Typography, {
|
|
3947
|
+
...getBaseHTMLProps(id, cn(className, withMarginsOverInput && typographyStyles_module_default["legend--margins-over-input"]), style, htmlProps, rest),
|
|
3948
|
+
as: "legend",
|
|
3949
|
+
typographyType,
|
|
3950
|
+
withMargins: optAttr(withMargins || withMarginsOverInput)
|
|
4163
3951
|
});
|
|
4164
|
-
}
|
|
4165
|
-
// src/components/Accordion/Accordion.module.css
|
|
4166
|
-
var Accordion_module_default = {
|
|
4167
|
-
"container": "dds-Accordion-module__container",
|
|
4168
|
-
"header-button": "dds-Accordion-module__header-button",
|
|
4169
|
-
"chevron": "dds-Accordion-module__chevron"
|
|
4170
3952
|
};
|
|
4171
|
-
|
|
4172
|
-
|
|
4173
|
-
|
|
4174
|
-
|
|
4175
|
-
|
|
4176
|
-
|
|
4177
|
-
|
|
3953
|
+
Legend.displayName = "Legend";
|
|
3954
|
+
// src/components/Typography/Link/Link.tsx
|
|
3955
|
+
const Link = ({ id, className, htmlProps, children, typographyType, withMargins, withVisited, style, color, as: propAs, isAnchor: propIsAnchor, withIconStyling, ...rest }) => {
|
|
3956
|
+
const as = propAs ? propAs : "a";
|
|
3957
|
+
const aProps = as === "a" || propIsAnchor ? { rel: "noopener noreferrer" } : {};
|
|
3958
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ElementAs, {
|
|
3959
|
+
as,
|
|
3960
|
+
...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)), {
|
|
3961
|
+
...style,
|
|
3962
|
+
color: color && !isTextColor(color) ? getTextColor(color) : void 0
|
|
3963
|
+
}, htmlProps, rest),
|
|
3964
|
+
...aProps,
|
|
3965
|
+
children
|
|
4178
3966
|
});
|
|
4179
|
-
|
|
4180
|
-
|
|
4181
|
-
|
|
4182
|
-
|
|
4183
|
-
|
|
4184
|
-
|
|
4185
|
-
|
|
4186
|
-
|
|
4187
|
-
children
|
|
4188
|
-
})
|
|
3967
|
+
};
|
|
3968
|
+
Link.displayName = "Link";
|
|
3969
|
+
[...TG_BODY_TYPES, ...TG_LEAD_TYPES];
|
|
3970
|
+
const Paragraph = ({ id, className, style, htmlProps, children, typographyType = "body-long-medium", ...rest }) => {
|
|
3971
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Typography, {
|
|
3972
|
+
...getBaseHTMLProps(id, className, style, htmlProps, rest),
|
|
3973
|
+
typographyType,
|
|
3974
|
+
children
|
|
4189
3975
|
});
|
|
4190
3976
|
};
|
|
4191
|
-
|
|
4192
|
-
// src/components/
|
|
4193
|
-
|
|
4194
|
-
|
|
4195
|
-
|
|
4196
|
-
|
|
3977
|
+
Paragraph.displayName = "Paragraph";
|
|
3978
|
+
// src/components/Badge/Badge.module.css
|
|
3979
|
+
var Badge_module_default = {
|
|
3980
|
+
"container": "dds-Badge-module__container",
|
|
3981
|
+
"notification": "dds-Badge-module__notification",
|
|
3982
|
+
"action": "dds-Badge-module__action",
|
|
3983
|
+
"neutral": "dds-Badge-module__neutral",
|
|
3984
|
+
"subtle": "dds-Badge-module__subtle"
|
|
3985
|
+
};
|
|
3986
|
+
const Badge = ({ id, className, style, htmlProps, purpose = "notification", size = "medium", children, max = 9, showZero = false, ...rest }) => {
|
|
3987
|
+
const hasChildren = !!children || showZero && children === 0;
|
|
3988
|
+
const heightVariant = hasChildren ? "withChildren" : "noChildren";
|
|
3989
|
+
const height = {
|
|
3990
|
+
withChildren: {
|
|
3991
|
+
xsmall: "18px",
|
|
3992
|
+
small: "21px",
|
|
3993
|
+
medium: "24px",
|
|
3994
|
+
large: "27px"
|
|
3995
|
+
},
|
|
3996
|
+
noChildren: {
|
|
3997
|
+
xsmall: "x0.5",
|
|
3998
|
+
small: "x0.75",
|
|
3999
|
+
medium: "x1",
|
|
4000
|
+
large: "x1.5"
|
|
4001
|
+
}
|
|
4002
|
+
};
|
|
4003
|
+
const color = {
|
|
4004
|
+
notification: "text-on-notification",
|
|
4005
|
+
action: "text-on-action",
|
|
4006
|
+
neutral: "text-on-inverse",
|
|
4007
|
+
subtle: "text-default"
|
|
4008
|
+
};
|
|
4009
|
+
const displayValue = hasChildren && max && children > max ? `${max}+` : children;
|
|
4010
|
+
if (!(!showZero && children === 0 ? false : true)) return null;
|
|
4197
4011
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Box, {
|
|
4198
|
-
as:
|
|
4199
|
-
|
|
4200
|
-
|
|
4201
|
-
|
|
4202
|
-
|
|
4203
|
-
|
|
4204
|
-
|
|
4205
|
-
|
|
4206
|
-
|
|
4207
|
-
|
|
4208
|
-
|
|
4209
|
-
}
|
|
4012
|
+
as: "span",
|
|
4013
|
+
paddingInline: hasChildren ? "x0.25" : void 0,
|
|
4014
|
+
minWidth: height[heightVariant][size],
|
|
4015
|
+
maxWidth: "fit-content",
|
|
4016
|
+
height: height[heightVariant][size],
|
|
4017
|
+
display: "inline-flex",
|
|
4018
|
+
alignItems: "center",
|
|
4019
|
+
justifyContent: "center",
|
|
4020
|
+
...getBaseHTMLProps(id, cn(className, Badge_module_default.container, Badge_module_default[purpose], typographyStyles_module_default[`body-short-${size}`]), style, htmlProps, rest),
|
|
4021
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Typography, {
|
|
4022
|
+
as: "span",
|
|
4023
|
+
typographyType: `body-short-${size}`,
|
|
4024
|
+
color: color[purpose],
|
|
4025
|
+
children: displayValue
|
|
4210
4026
|
})
|
|
4211
4027
|
});
|
|
4212
4028
|
};
|
|
4213
|
-
|
|
4214
|
-
// src/
|
|
4215
|
-
const
|
|
4216
|
-
|
|
4217
|
-
|
|
4218
|
-
|
|
4219
|
-
|
|
4220
|
-
|
|
4221
|
-
|
|
4222
|
-
|
|
4223
|
-
|
|
4224
|
-
|
|
4225
|
-
|
|
4226
|
-
|
|
4227
|
-
|
|
4029
|
+
Badge.displayName = "Badge";
|
|
4030
|
+
// src/i18n/LanguageProvider.tsx
|
|
4031
|
+
const LanguageContext = (0, react.createContext)(void 0);
|
|
4032
|
+
function LanguageProvider({ language, children }) {
|
|
4033
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LanguageContext, {
|
|
4034
|
+
value: { language },
|
|
4035
|
+
children
|
|
4036
|
+
});
|
|
4037
|
+
}
|
|
4038
|
+
function useLanguage() {
|
|
4039
|
+
const lang = (0, react.useContext)(LanguageContext)?.language;
|
|
4040
|
+
if (!lang) throw new Error("useLangage must be used within DdsProvider.");
|
|
4041
|
+
return lang;
|
|
4042
|
+
}
|
|
4043
|
+
// src/i18n/translation.tsx
|
|
4044
|
+
function useTranslation() {
|
|
4045
|
+
const lang = useLanguage();
|
|
4046
|
+
const t = (text) => text[lang];
|
|
4047
|
+
return {
|
|
4048
|
+
t,
|
|
4049
|
+
lang
|
|
4050
|
+
};
|
|
4051
|
+
}
|
|
4052
|
+
function createTexts(texts) {
|
|
4053
|
+
return texts;
|
|
4054
|
+
}
|
|
4055
|
+
// src/i18n/commonTexts.tsx
|
|
4056
|
+
const commonTexts = createTexts({
|
|
4057
|
+
clearSelect: {
|
|
4058
|
+
no: "Tøm nedtrekksliste",
|
|
4059
|
+
nb: "Tøm nedtrekksliste",
|
|
4060
|
+
nn: "Tøm nedtrekksliste",
|
|
4061
|
+
en: "Clear selection",
|
|
4062
|
+
se: "Gidde válljemiid"
|
|
4063
|
+
},
|
|
4064
|
+
close: {
|
|
4065
|
+
nb: "Lukk",
|
|
4066
|
+
no: "Lukk",
|
|
4067
|
+
nn: "Lukk",
|
|
4068
|
+
en: "Close",
|
|
4069
|
+
se: "Gidde"
|
|
4070
|
+
},
|
|
4071
|
+
closeMessage: {
|
|
4072
|
+
nb: "Lukk melding",
|
|
4073
|
+
no: "Lukk melding",
|
|
4074
|
+
nn: "Lukk melding",
|
|
4075
|
+
en: "Close message",
|
|
4076
|
+
se: "Gidde dieđu"
|
|
4077
|
+
},
|
|
4078
|
+
loading: {
|
|
4079
|
+
nb: "Innlastning pågår",
|
|
4080
|
+
no: "Innlastning pågår",
|
|
4081
|
+
nn: "Innlastning pågår",
|
|
4082
|
+
en: "Loading",
|
|
4083
|
+
se: "Viežžamin"
|
|
4084
|
+
},
|
|
4085
|
+
nextPage: {
|
|
4086
|
+
nb: "Neste side",
|
|
4087
|
+
no: "Neste side",
|
|
4088
|
+
nn: "Neste side",
|
|
4089
|
+
en: "Next page",
|
|
4090
|
+
se: "Boahte siidu"
|
|
4091
|
+
},
|
|
4092
|
+
previousPage: {
|
|
4093
|
+
nb: "Forrige side",
|
|
4094
|
+
no: "Forrige side",
|
|
4095
|
+
nn: "Førre side",
|
|
4096
|
+
en: "Previous page",
|
|
4097
|
+
se: "Ovddit siidu"
|
|
4098
|
+
},
|
|
4099
|
+
page: (page) => ({
|
|
4100
|
+
nb: `Side ${page}`,
|
|
4101
|
+
no: `Side ${page}`,
|
|
4102
|
+
nn: `Side ${page}`,
|
|
4103
|
+
en: `Page ${page}`,
|
|
4104
|
+
se: `Siidu ${page}`
|
|
4105
|
+
}),
|
|
4106
|
+
currentPage: (page) => ({
|
|
4107
|
+
nb: `Nåværende side (${page})`,
|
|
4108
|
+
no: `Nåværende side (${page})`,
|
|
4109
|
+
nn: `Noverande side (${page})`,
|
|
4110
|
+
en: `Current page (${page})`,
|
|
4111
|
+
se: `Dála siidu (${page})`
|
|
4112
|
+
}),
|
|
4113
|
+
pageOf: (current, max) => ({
|
|
4114
|
+
nb: `Side ${current} av ${max}`,
|
|
4115
|
+
no: `Side ${current} av ${max}`,
|
|
4116
|
+
nn: `Side ${current} ${max}`,
|
|
4117
|
+
en: `Page ${current} of ${max}`,
|
|
4118
|
+
se: `Siidu ${current} ${max}`
|
|
4119
|
+
})
|
|
4120
|
+
});
|
|
4121
|
+
// src/components/Spinner/Spinner.module.css
|
|
4122
|
+
var Spinner_module_default = {
|
|
4123
|
+
"svg": "dds-Spinner-module__svg",
|
|
4124
|
+
"jordskifterett": "dds-Spinner-module__jordskifterett",
|
|
4125
|
+
"lagmannsrett": "dds-Spinner-module__lagmannsrett",
|
|
4126
|
+
"tingrett": "dds-Spinner-module__tingrett"
|
|
4127
|
+
};
|
|
4128
|
+
// src/components/Spinner/Spinner.tsx
|
|
4129
|
+
function Spinner(props) {
|
|
4130
|
+
const { size = "var(--dds-size-6)", color = "icon-action-resting", tooltip, id, className, htmlProps, style, ...rest } = props;
|
|
4131
|
+
const { t } = useTranslation();
|
|
4132
|
+
const uniqueId = `${(0, react.useId)()}-spinnerTitle`;
|
|
4133
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
|
|
4134
|
+
viewBox: "0 0 25 25",
|
|
4135
|
+
role: "progressbar",
|
|
4136
|
+
"aria-labelledby": uniqueId,
|
|
4137
|
+
...getBaseHTMLProps(id, cn(className, Spinner_module_default.svg), {
|
|
4138
|
+
...style,
|
|
4139
|
+
width: size,
|
|
4140
|
+
height: size,
|
|
4141
|
+
["--dds-color-spinner"]: getTextColor(color)
|
|
4142
|
+
}, htmlProps, rest),
|
|
4143
|
+
children: [
|
|
4144
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("title", {
|
|
4145
|
+
id: uniqueId,
|
|
4146
|
+
children: tooltip ?? t(commonTexts.loading)
|
|
4147
|
+
}),
|
|
4148
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("circle", {
|
|
4149
|
+
cx: "12",
|
|
4150
|
+
cy: "12.25",
|
|
4151
|
+
r: "6",
|
|
4152
|
+
className: Spinner_module_default.jordskifterett
|
|
4153
|
+
}),
|
|
4154
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("rect", {
|
|
4155
|
+
x: "4",
|
|
4156
|
+
y: "10.25",
|
|
4157
|
+
width: "16",
|
|
4158
|
+
height: "4",
|
|
4159
|
+
className: Spinner_module_default.lagmannsrett
|
|
4160
|
+
}),
|
|
4161
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
4162
|
+
d: "M12 16.6154C16.4183 16.6154 20 12.7581 20 8H4C4 12.7581 7.58172 16.6154 12 16.6154Z",
|
|
4163
|
+
className: Spinner_module_default.tingrett
|
|
4164
|
+
})
|
|
4165
|
+
]
|
|
4166
|
+
});
|
|
4167
|
+
}
|
|
4168
|
+
Spinner.displayName = "Spinner";
|
|
4169
|
+
// src/components/helpers/Dropdown/DropdownItem.module.css
|
|
4170
|
+
var DropdownItem_module_default = {
|
|
4171
|
+
"item": "dds-DropdownItem-module__item",
|
|
4172
|
+
"default": "dds-DropdownItem-module__default",
|
|
4173
|
+
"danger": "dds-DropdownItem-module__danger",
|
|
4174
|
+
"item--interactive": "dds-DropdownItem-module__item--interactive",
|
|
4175
|
+
"item--loading": "dds-DropdownItem-module__item--loading"
|
|
4176
|
+
};
|
|
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
|
|
4228
4339
|
};
|
|
4229
|
-
|
|
4230
|
-
|
|
4231
|
-
|
|
4232
|
-
// src/components/BackLink/BackLink.tsx
|
|
4233
|
-
const BackLink = ({ label, ref, as = "a", ...rest }) => {
|
|
4234
|
-
const { t } = useTranslation();
|
|
4235
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("nav", {
|
|
4236
|
-
ref,
|
|
4237
|
-
"aria-label": t(texts$30.goBack),
|
|
4238
|
-
className: typographyStyles_module_default["body-short-medium"],
|
|
4239
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(HStack, {
|
|
4240
|
-
as,
|
|
4241
|
-
className: cn(typographyStyles_module_default.a, _key1),
|
|
4242
|
-
rel: "noopener noreferer",
|
|
4243
|
-
...rest,
|
|
4244
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, {
|
|
4245
|
-
icon: ArrowLeftIcon,
|
|
4246
|
-
iconSize: "component",
|
|
4247
|
-
className: cn(BackLink_module_default.icon)
|
|
4248
|
-
}), label]
|
|
4249
|
-
})
|
|
4250
|
-
});
|
|
4340
|
+
const scrollbarStyling = {
|
|
4341
|
+
scrollbarColor: "var(--dds-color-surface-scrollbar) transparent",
|
|
4342
|
+
scrollbarWidth: "thin"
|
|
4251
4343
|
};
|
|
4252
|
-
|
|
4253
|
-
|
|
4254
|
-
|
|
4255
|
-
|
|
4256
|
-
|
|
4257
|
-
|
|
4258
|
-
|
|
4259
|
-
|
|
4260
|
-
|
|
4261
|
-
var TextOverflowEllipsis_module_default = {
|
|
4262
|
-
"wrapper": "dds-TextOverflowEllipsis-module__wrapper",
|
|
4263
|
-
"inner": "dds-TextOverflowEllipsis-module__inner"
|
|
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
|
|
4264
4353
|
};
|
|
4265
|
-
|
|
4266
|
-
|
|
4267
|
-
|
|
4268
|
-
...rest,
|
|
4269
|
-
className: cn(className, TextOverflowEllipsis_module_default.wrapper)
|
|
4270
|
-
});
|
|
4271
|
-
}
|
|
4272
|
-
function TextOverflowEllipsisInner({ className, ...rest }) {
|
|
4273
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4274
|
-
...rest,
|
|
4275
|
-
className: cn(className, TextOverflowEllipsis_module_default.inner)
|
|
4276
|
-
});
|
|
4277
|
-
}
|
|
4278
|
-
// src/components/Typography/Typography/Typography.module.css
|
|
4279
|
-
var Typography_module_default = { "container": "dds-Typography-module__container" };
|
|
4280
|
-
// src/components/Typography/Typography/Typography.types.ts
|
|
4281
|
-
const TG_BODY_SHORT_TYPES = [
|
|
4282
|
-
"body-short-xsmall",
|
|
4283
|
-
"body-short-small",
|
|
4284
|
-
"body-short-medium",
|
|
4285
|
-
"body-short-large"
|
|
4286
|
-
];
|
|
4287
|
-
const TG_BODY_LONG_TYPES = [
|
|
4288
|
-
"body-long-xsmall",
|
|
4289
|
-
"body-long-small",
|
|
4290
|
-
"body-long-medium",
|
|
4291
|
-
"body-long-large"
|
|
4292
|
-
];
|
|
4293
|
-
const TG_BODY_TYPES = [...TG_BODY_SHORT_TYPES, ...TG_BODY_LONG_TYPES];
|
|
4294
|
-
const TG_LEAD_TYPES = ["lead-medium"];
|
|
4295
|
-
const TG_HEADING_TYPES = [
|
|
4296
|
-
"heading-xxsmall",
|
|
4297
|
-
"heading-xsmall",
|
|
4298
|
-
"heading-small",
|
|
4299
|
-
"heading-medium",
|
|
4300
|
-
"heading-large",
|
|
4301
|
-
"heading-xlarge",
|
|
4302
|
-
"heading-xxlarge"
|
|
4303
|
-
];
|
|
4304
|
-
// src/components/Typography/Typography/Typography.utils.ts
|
|
4305
|
-
const getElementType = (element) => {
|
|
4306
|
-
switch (element) {
|
|
4307
|
-
case "a": return "a";
|
|
4308
|
-
case "heading-xxsmall": return "h6";
|
|
4309
|
-
case "heading-xsmall": return "h5";
|
|
4310
|
-
case "heading-small": return "h4";
|
|
4311
|
-
case "heading-medium": return "h3";
|
|
4312
|
-
case "heading-large": return "h2";
|
|
4313
|
-
case "heading-xlarge":
|
|
4314
|
-
case "heading-xxlarge": return "h1";
|
|
4315
|
-
case "label-medium": return "label";
|
|
4316
|
-
default: return "p";
|
|
4317
|
-
}
|
|
4354
|
+
const inheritLinkStyling = {
|
|
4355
|
+
color: "inherit",
|
|
4356
|
+
textDecoration: "inherit"
|
|
4318
4357
|
};
|
|
4319
|
-
const
|
|
4320
|
-
|
|
4358
|
+
const removeButtonStyling = {
|
|
4359
|
+
background: "none",
|
|
4360
|
+
color: "inherit",
|
|
4361
|
+
border: "none",
|
|
4362
|
+
padding: 0,
|
|
4363
|
+
font: "inherit",
|
|
4364
|
+
cursor: "pointer",
|
|
4365
|
+
outline: "inherit"
|
|
4321
4366
|
};
|
|
4322
|
-
const
|
|
4323
|
-
|
|
4367
|
+
const removeListStyling = {
|
|
4368
|
+
listStyle: "none",
|
|
4369
|
+
padding: 0,
|
|
4370
|
+
margin: 0
|
|
4324
4371
|
};
|
|
4325
|
-
const
|
|
4326
|
-
|
|
4372
|
+
const normalizeButton = {
|
|
4373
|
+
margin: 0,
|
|
4374
|
+
textTransform: "none"
|
|
4327
4375
|
};
|
|
4328
|
-
|
|
4329
|
-
|
|
4330
|
-
"
|
|
4331
|
-
"
|
|
4332
|
-
"b",
|
|
4333
|
-
"bdi",
|
|
4334
|
-
"bdo",
|
|
4335
|
-
"big",
|
|
4336
|
-
"br",
|
|
4337
|
-
"button",
|
|
4338
|
-
"canvas",
|
|
4339
|
-
"cite",
|
|
4340
|
-
"code",
|
|
4341
|
-
"data",
|
|
4342
|
-
"datalist",
|
|
4343
|
-
"del",
|
|
4344
|
-
"dfn",
|
|
4345
|
-
"em",
|
|
4346
|
-
"embed",
|
|
4347
|
-
"i",
|
|
4348
|
-
"iframe",
|
|
4349
|
-
"img",
|
|
4350
|
-
"input",
|
|
4351
|
-
"ins",
|
|
4352
|
-
"kbd",
|
|
4353
|
-
"label",
|
|
4354
|
-
"map",
|
|
4355
|
-
"mark",
|
|
4356
|
-
"meter",
|
|
4357
|
-
"noscript",
|
|
4358
|
-
"object",
|
|
4359
|
-
"output",
|
|
4360
|
-
"picture",
|
|
4361
|
-
"progress",
|
|
4362
|
-
"q",
|
|
4363
|
-
"ruby",
|
|
4364
|
-
"s",
|
|
4365
|
-
"samp",
|
|
4366
|
-
"script",
|
|
4367
|
-
"select",
|
|
4368
|
-
"slot",
|
|
4369
|
-
"small",
|
|
4370
|
-
"span",
|
|
4371
|
-
"strong",
|
|
4372
|
-
"sub",
|
|
4373
|
-
"sup",
|
|
4374
|
-
"svg",
|
|
4375
|
-
"template",
|
|
4376
|
-
"textarea",
|
|
4377
|
-
"time",
|
|
4378
|
-
"u",
|
|
4379
|
-
"var",
|
|
4380
|
-
"video",
|
|
4381
|
-
"wbr"
|
|
4382
|
-
];
|
|
4383
|
-
const isInlineElement = (as) => inlineElements.indexOf(as) !== -1;
|
|
4384
|
-
const getColorCn = (color) => {
|
|
4385
|
-
if (!isTextColor(color)) return null;
|
|
4386
|
-
const [prefix] = color.split("-", 1);
|
|
4387
|
-
return typographyStyles_module_default[`${prefix}-color--${color.slice(prefix.length + 1)}`] || null;
|
|
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"
|
|
4388
4380
|
};
|
|
4389
|
-
// src/components/
|
|
4390
|
-
const
|
|
4391
|
-
const
|
|
4392
|
-
|
|
4393
|
-
|
|
4394
|
-
|
|
4395
|
-
|
|
4396
|
-
|
|
4397
|
-
|
|
4398
|
-
|
|
4399
|
-
|
|
4400
|
-
|
|
4401
|
-
|
|
4402
|
-
|
|
4403
|
-
|
|
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
|
+
})
|
|
4404
4403
|
});
|
|
4405
|
-
}
|
|
4406
|
-
|
|
4407
|
-
|
|
4408
|
-
|
|
4409
|
-
|
|
4410
|
-
|
|
4411
|
-
|
|
4412
|
-
|
|
4413
|
-
|
|
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
|
+
})
|
|
4414
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"
|
|
4415
4433
|
};
|
|
4416
|
-
|
|
4417
|
-
|
|
4418
|
-
const
|
|
4419
|
-
|
|
4420
|
-
|
|
4421
|
-
|
|
4422
|
-
|
|
4423
|
-
case "h3": return "heading-medium";
|
|
4424
|
-
case "h4": return "heading-small";
|
|
4425
|
-
case "h5": return "heading-xsmall";
|
|
4426
|
-
case "h6": return "heading-xxsmall";
|
|
4427
|
-
default: return "heading-xlarge";
|
|
4428
|
-
}
|
|
4429
|
-
};
|
|
4430
|
-
const Heading = ({ id, className, style, htmlProps, children, typographyType, level, withMargins, withMarginsOverInput, ...rest }) => {
|
|
4431
|
-
const headingElement = getHeadingElement(level);
|
|
4432
|
-
const standardTypographyType = typographyType ?? getDefaultTypographyType(headingElement);
|
|
4433
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Typography, {
|
|
4434
|
-
...getBaseHTMLProps(id, cn(className, withMarginsOverInput && typographyStyles_module_default["heading--margins-over-input"]), style, htmlProps, rest),
|
|
4435
|
-
typographyType: standardTypographyType,
|
|
4436
|
-
as: headingElement,
|
|
4437
|
-
withMargins: optAttr(withMargins || withMarginsOverInput),
|
|
4438
|
-
children
|
|
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
|
|
4439
4441
|
});
|
|
4440
|
-
|
|
4441
|
-
|
|
4442
|
-
|
|
4443
|
-
|
|
4444
|
-
|
|
4445
|
-
|
|
4446
|
-
|
|
4447
|
-
|
|
4448
|
-
|
|
4449
|
-
|
|
4450
|
-
readOnly && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, {
|
|
4451
|
-
icon: LockFilledIcon,
|
|
4452
|
-
iconSize: "4",
|
|
4453
|
-
className: Label_module_default["read-only__icon"]
|
|
4454
|
-
}),
|
|
4455
|
-
children,
|
|
4456
|
-
showRequiredStyling && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RequiredMarker, {})
|
|
4457
|
-
] });
|
|
4458
|
-
const labelProps = { ...getBaseHTMLProps(id, cn(className, readOnly && Label_module_default["read-only"]), style, htmlProps, rest) };
|
|
4459
|
-
return afterLabelContent ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Typography, {
|
|
4460
|
-
typographyType: "label-medium",
|
|
4461
|
-
as: "div",
|
|
4462
|
-
withMargins: rest.withMargins,
|
|
4463
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Typography, {
|
|
4464
|
-
...labelProps,
|
|
4465
|
-
typographyType: "label-medium",
|
|
4466
|
-
withMargins: false,
|
|
4467
|
-
children: content
|
|
4468
|
-
}), afterLabelContent]
|
|
4469
|
-
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Typography, {
|
|
4470
|
-
...labelProps,
|
|
4471
|
-
typographyType: "label-medium",
|
|
4472
|
-
children: content
|
|
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
|
+
})
|
|
4473
4452
|
});
|
|
4474
4453
|
};
|
|
4475
|
-
|
|
4476
|
-
// src/components/
|
|
4477
|
-
const
|
|
4478
|
-
|
|
4479
|
-
|
|
4480
|
-
|
|
4481
|
-
|
|
4482
|
-
|
|
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
|
+
})
|
|
4483
4474
|
});
|
|
4484
4475
|
};
|
|
4485
|
-
|
|
4486
|
-
// src/components/
|
|
4487
|
-
const
|
|
4488
|
-
const
|
|
4489
|
-
const
|
|
4490
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
4491
|
-
|
|
4492
|
-
...getBaseHTMLProps(id, cn(className,
|
|
4493
|
-
|
|
4494
|
-
|
|
4495
|
-
|
|
4496
|
-
|
|
4497
|
-
|
|
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
|
+
})
|
|
4498
4490
|
});
|
|
4499
4491
|
};
|
|
4500
|
-
|
|
4501
|
-
|
|
4502
|
-
|
|
4503
|
-
|
|
4504
|
-
|
|
4505
|
-
|
|
4506
|
-
|
|
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
|
+
})
|
|
4507
4513
|
});
|
|
4508
4514
|
};
|
|
4509
|
-
|
|
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
|
+
} });
|
|
4510
4523
|
// src/components/Breadcrumbs/Breadcrumb.tsx
|
|
4511
4524
|
const isAnchorTypographyProps = (props) => {
|
|
4512
4525
|
return props.href != void 0;
|
|
@@ -4525,8 +4538,14 @@ const Breadcrumb = ({ children, ref, ...rest }) => {
|
|
|
4525
4538
|
});
|
|
4526
4539
|
};
|
|
4527
4540
|
Breadcrumb.displayName = "Breadcrumb";
|
|
4528
|
-
// src/components/
|
|
4529
|
-
|
|
4541
|
+
// src/components/ButtonGroup/ButtonGroup.context.tsx
|
|
4542
|
+
const ButtonGroupContext = (0, react.createContext)({});
|
|
4543
|
+
const useButtonGroupContext = () => (0, react.useContext)(ButtonGroupContext);
|
|
4544
|
+
// src/components/helpers/styling/common.module.css
|
|
4545
|
+
var common_module_default = {
|
|
4546
|
+
"badge--on-corner": "dds-common-module__badge--on-corner",
|
|
4547
|
+
"button": "dds-common-module__button"
|
|
4548
|
+
};
|
|
4530
4549
|
// src/components/Button/Button.module.css
|
|
4531
4550
|
var Button_module_default = {
|
|
4532
4551
|
"button": "dds-Button-module__button",
|
|
@@ -4551,14 +4570,6 @@ var Button_module_default = {
|
|
|
4551
4570
|
"button--primary-danger": "dds-Button-module__button--primary-danger",
|
|
4552
4571
|
"button--secondary-danger": "dds-Button-module__button--secondary-danger"
|
|
4553
4572
|
};
|
|
4554
|
-
// src/components/ButtonGroup/ButtonGroup.context.tsx
|
|
4555
|
-
const ButtonGroupContext = (0, react.createContext)({});
|
|
4556
|
-
const useButtonGroupContext = () => (0, react.useContext)(ButtonGroupContext);
|
|
4557
|
-
// src/components/helpers/styling/common.module.css
|
|
4558
|
-
var common_module_default = {
|
|
4559
|
-
"badge--on-corner": "dds-common-module__badge--on-corner",
|
|
4560
|
-
"button": "dds-common-module__button"
|
|
4561
|
-
};
|
|
4562
4573
|
// src/components/Button/Button.tsx
|
|
4563
4574
|
const Button = ({ as: propAs, children, purpose = "primary", size: propSize = "medium", iconPosition = "left", loading, loadingTooltip, fullWidth = false, icon, iconState, onClick, onFocus, onBlur, badgeProps, id, ref, className, style, htmlProps, ...props }) => {
|
|
4564
4575
|
const { purpose: groupPurpose, size: groupSize } = useButtonGroupContext();
|
|
@@ -4748,6 +4759,14 @@ const OverflowMenuLink = ({ onClick, ref, ...rest }) => {
|
|
|
4748
4759
|
}) });
|
|
4749
4760
|
};
|
|
4750
4761
|
OverflowMenuLink.displayName = "OverflowMenuLink";
|
|
4762
|
+
// src/components/VisuallyHidden/VisuallyHidden.tsx
|
|
4763
|
+
const VisuallyHidden = ({ id, as: asProp, className, style, htmlProps, ...rest }) => {
|
|
4764
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ElementAs, {
|
|
4765
|
+
as: asProp ?? "span",
|
|
4766
|
+
...getBaseHTMLProps(id, cn(className, utilStyles_module_default["visually-hidden"]), style, htmlProps, rest)
|
|
4767
|
+
});
|
|
4768
|
+
};
|
|
4769
|
+
VisuallyHidden.displayName = "VisuallyHidden";
|
|
4751
4770
|
// src/components/Toggle/Toggle.module.css
|
|
4752
4771
|
var Toggle_module_default = {
|
|
4753
4772
|
"label": "dds-Toggle-module__label",
|
|
@@ -4763,14 +4782,6 @@ var Toggle_module_default = {
|
|
|
4763
4782
|
"label--disabled": "dds-Toggle-module__label--disabled",
|
|
4764
4783
|
"label--read-only": "dds-Toggle-module__label--read-only"
|
|
4765
4784
|
};
|
|
4766
|
-
// src/components/VisuallyHidden/VisuallyHidden.tsx
|
|
4767
|
-
const VisuallyHidden = ({ id, as: asProp, className, style, htmlProps, ...rest }) => {
|
|
4768
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ElementAs, {
|
|
4769
|
-
as: asProp ?? "span",
|
|
4770
|
-
...getBaseHTMLProps(id, cn(className, utilStyles_module_default["visually-hidden"]), style, htmlProps, rest)
|
|
4771
|
-
});
|
|
4772
|
-
};
|
|
4773
|
-
VisuallyHidden.displayName = "VisuallyHidden";
|
|
4774
4785
|
const Toggle = ({ id, children, size = "medium", checked: checkedProp, defaultChecked, onChange, disabled, readOnly, isLoading, className, style, htmlProps = {}, ...rest }) => {
|
|
4775
4786
|
const { t } = useTranslation();
|
|
4776
4787
|
const generatedId = (0, react.useId)();
|
|
@@ -4946,6 +4957,8 @@ const OverflowMenuGroup = ({ children, onClose, onOpen, setIsOpen: propSetIsOpen
|
|
|
4946
4957
|
});
|
|
4947
4958
|
};
|
|
4948
4959
|
OverflowMenuGroup.displayName = "OverflowMenuGroup";
|
|
4960
|
+
// src/components/Breadcrumbs/Breadcrumbs.module.css
|
|
4961
|
+
var Breadcrumbs_module_default = { "icon": "dds-Breadcrumbs-module__icon" };
|
|
4949
4962
|
// src/components/Breadcrumbs/Breadcrumbs.tsx
|
|
4950
4963
|
const Breadcrumbs = ({ children, smallScreenBreakpoint, id, className, style, htmlProps, ...rest }) => {
|
|
4951
4964
|
const chevronIcon = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, {
|
|
@@ -5161,14 +5174,6 @@ const CardExpandableBody = ({ children, className, style, htmlProps, padding, ..
|
|
|
5161
5174
|
});
|
|
5162
5175
|
};
|
|
5163
5176
|
CardExpandableBody.displayName = "CardExpandableBody";
|
|
5164
|
-
// src/components/Card/CardSelectionControl/CardSelectable.context.tsx
|
|
5165
|
-
const CardSelectableContext = (0, react.createContext)({});
|
|
5166
|
-
const useCardSelectableContext = () => (0, react.useContext)(CardSelectableContext);
|
|
5167
|
-
// src/components/SelectionControl/Checkbox/CheckboxGroupContext.tsx
|
|
5168
|
-
const CheckboxGroupContext = (0, react.createContext)(null);
|
|
5169
|
-
const useCheckboxGroup = () => {
|
|
5170
|
-
return (0, react.useContext)(CheckboxGroupContext);
|
|
5171
|
-
};
|
|
5172
5177
|
// src/components/SelectionControl/SelectionControl.module.css
|
|
5173
5178
|
var SelectionControl_module_default = {
|
|
5174
5179
|
"container": "dds-SelectionControl-module__container",
|
|
@@ -5226,6 +5231,11 @@ const renderGroupLabel = ({ id, showRequiredStyling, readOnly, label }) => {
|
|
|
5226
5231
|
});
|
|
5227
5232
|
else return null;
|
|
5228
5233
|
};
|
|
5234
|
+
// src/components/SelectionControl/Checkbox/CheckboxGroupContext.tsx
|
|
5235
|
+
const CheckboxGroupContext = (0, react.createContext)(null);
|
|
5236
|
+
const useCheckboxGroup = () => {
|
|
5237
|
+
return (0, react.useContext)(CheckboxGroupContext);
|
|
5238
|
+
};
|
|
5229
5239
|
// src/components/SelectionControl/Checkbox/Checkbox.tsx
|
|
5230
5240
|
const Checkbox = ({ id, name, label, error = false, disabled, readOnly, indeterminate, "aria-describedby": ariaDescribedby, className, htmlProps = {}, style, children, size, ...rest }) => {
|
|
5231
5241
|
const generatedId = (0, react.useId)();
|
|
@@ -5510,6 +5520,9 @@ const RadioButtonGroup = ({ name, label, groupId, errorMessage, tip, disabled =
|
|
|
5510
5520
|
});
|
|
5511
5521
|
};
|
|
5512
5522
|
RadioButtonGroup.displayName = "RadioButtonGroup";
|
|
5523
|
+
// src/components/Card/CardSelectionControl/CardSelectable.context.tsx
|
|
5524
|
+
const CardSelectableContext = (0, react.createContext)({});
|
|
5525
|
+
const useCardSelectableContext = () => (0, react.useContext)(CardSelectableContext);
|
|
5513
5526
|
// src/components/Card/CardSelectionControl/CardSelectable.tsx
|
|
5514
5527
|
const CardSelectable = (props) => {
|
|
5515
5528
|
const { appearance = "filled", cardType: cardTypeProp, id, padding, controlPlacementProps = {}, "aria-describedby": ariaDescribedby, className, htmlProps, style, ...rest } = props;
|
|
@@ -5605,14 +5618,6 @@ const CardSelectableGroup = ({ name, cardType, errorMessage, disabled, readOnly,
|
|
|
5605
5618
|
})] }) : mainContent;
|
|
5606
5619
|
};
|
|
5607
5620
|
CardSelectableGroup.displayName = "CardSelectableGroup";
|
|
5608
|
-
// src/components/Chip/Chip.module.css
|
|
5609
|
-
var Chip_module_default = {
|
|
5610
|
-
"container": "dds-Chip-module__container",
|
|
5611
|
-
"selection-control": "dds-Chip-module__selection-control",
|
|
5612
|
-
"removable": "dds-Chip-module__removable",
|
|
5613
|
-
"selection-control-spacing": "dds-Chip-module__selection-control-spacing",
|
|
5614
|
-
"selection-control--no-indicator": "dds-Chip-module__selection-control--no-indicator"
|
|
5615
|
-
};
|
|
5616
5621
|
// src/components/helpers/Input/Input.module.css
|
|
5617
5622
|
var Input_module_default = {
|
|
5618
5623
|
"container": "dds-Input-module__container",
|
|
@@ -5663,6 +5668,25 @@ var Input_module_default = {
|
|
|
5663
5668
|
"input-group__absolute-el--small": "dds-Input-module__input-group__absolute-el--small",
|
|
5664
5669
|
"input-group__absolute-el--xsmall": "dds-Input-module__input-group__absolute-el--xsmall"
|
|
5665
5670
|
};
|
|
5671
|
+
// src/components/InlineButton/InlineButton.module.css
|
|
5672
|
+
var InlineButton_module_default = { "button": "dds-InlineButton-module__button" };
|
|
5673
|
+
// src/components/InlineButton/InlineButton.tsx
|
|
5674
|
+
const InlineButton = ({ className, color, icon, children, ...rest }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StylelessButton, {
|
|
5675
|
+
className: cn(className, focus_module_default.focusable, typographyStyles_module_default.a, InlineButton_module_default.button, getColorCn(color)),
|
|
5676
|
+
...rest,
|
|
5677
|
+
children: icon ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, {
|
|
5678
|
+
icon,
|
|
5679
|
+
iconSize: "component"
|
|
5680
|
+
}) : children
|
|
5681
|
+
});
|
|
5682
|
+
// src/components/Chip/Chip.module.css
|
|
5683
|
+
var Chip_module_default = {
|
|
5684
|
+
"container": "dds-Chip-module__container",
|
|
5685
|
+
"selection-control": "dds-Chip-module__selection-control",
|
|
5686
|
+
"removable": "dds-Chip-module__removable",
|
|
5687
|
+
"selection-control-spacing": "dds-Chip-module__selection-control-spacing",
|
|
5688
|
+
"selection-control--no-indicator": "dds-Chip-module__selection-control--no-indicator"
|
|
5689
|
+
};
|
|
5666
5690
|
const ChipBase = ({ htmlProps, size = "medium", id, className, style, children, icon, ...rest }) => {
|
|
5667
5691
|
const hasIcon = !!icon;
|
|
5668
5692
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Paper, {
|
|
@@ -5919,94 +5943,6 @@ var DateInput_module_default = {
|
|
|
5919
5943
|
"calendar__cell-button--selected": "dds-DateInput-module__calendar__cell-button--selected",
|
|
5920
5944
|
"calendar__cell-button--unavailable--today": "dds-DateInput-module__calendar__cell-button--unavailable--today"
|
|
5921
5945
|
};
|
|
5922
|
-
// src/components/date-inputs/DatePicker/Calendar/CalendarCell.tsx
|
|
5923
|
-
function CalendarCell({ ...props }) {
|
|
5924
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Box, {
|
|
5925
|
-
textAlign: "center",
|
|
5926
|
-
className: cn(typographyStyles_module_default["text-color--subtle"], DateInput_module_default.calendar__th),
|
|
5927
|
-
...props
|
|
5928
|
-
});
|
|
5929
|
-
}
|
|
5930
|
-
CalendarCell.displayName = "CalendarCell";
|
|
5931
|
-
// src/components/date-inputs/DatePicker/constants.ts
|
|
5932
|
-
const LOCALE = {
|
|
5933
|
-
nb: "nb-NO",
|
|
5934
|
-
no: "no-NO",
|
|
5935
|
-
nn: "nn-NO",
|
|
5936
|
-
en: "en-GB",
|
|
5937
|
-
se: "se-NO"
|
|
5938
|
-
};
|
|
5939
|
-
// src/components/date-inputs/DatePicker/Calendar/CalendarDate.tsx
|
|
5940
|
-
function CalendarDate$1({ date, state, onClose }) {
|
|
5941
|
-
const ref = (0, react.useRef)(null);
|
|
5942
|
-
const { buttonProps, cellProps, isOutsideVisibleRange, formattedDate, isSelected, isDisabled, isUnavailable } = (0, _react_aria_calendar.useCalendarCell)({ date }, state, ref);
|
|
5943
|
-
if (isOutsideVisibleRange) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", { ...cellProps });
|
|
5944
|
-
const closeOnKeyboardBlurForward = (event) => {
|
|
5945
|
-
if (event.key === "Tab" && event.shiftKey === false) onClose();
|
|
5946
|
-
};
|
|
5947
|
-
const isEffectivelyUnavailable = isUnavailable || isDisabled;
|
|
5948
|
-
const isUnavailableToday = isEffectivelyUnavailable && (0, _internationalized_date.isToday)(date, "Europe/Oslo");
|
|
5949
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", {
|
|
5950
|
-
...cellProps,
|
|
5951
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Box, {
|
|
5952
|
-
...buttonProps,
|
|
5953
|
-
as: "button",
|
|
5954
|
-
type: "button",
|
|
5955
|
-
ref,
|
|
5956
|
-
onKeyDown: closeOnKeyboardBlurForward,
|
|
5957
|
-
height: "100%",
|
|
5958
|
-
width: "100%",
|
|
5959
|
-
display: "flex",
|
|
5960
|
-
alignItems: "center",
|
|
5961
|
-
justifyContent: "center",
|
|
5962
|
-
className: cn(DateInput_module_default["calendar__cell-button"], (0, _internationalized_date.isToday)(date, "Europe/Oslo") && DateInput_module_default["calendar__cell-button--today"], DateInput_module_default[`calendar__cell-button--default`], isSelected && DateInput_module_default[`calendar__cell-button--selected`], isEffectivelyUnavailable && DateInput_module_default[`calendar__cell-button--unavailable`], isUnavailableToday && DateInput_module_default["calendar__cell-button--unavailable--today"], typographyStyles_module_default["body-short-small"], _key1),
|
|
5963
|
-
children: formattedDate
|
|
5964
|
-
})
|
|
5965
|
-
});
|
|
5966
|
-
}
|
|
5967
|
-
CalendarDate$1.displayName = "CalendarDate";
|
|
5968
|
-
// src/components/date-inputs/utils/getWeekNumber.ts
|
|
5969
|
-
/**
|
|
5970
|
-
* Calculates the week number following the ISO-8601 format.
|
|
5971
|
-
* @returns week number, 1 indexed
|
|
5972
|
-
*/
|
|
5973
|
-
function getWeekNumber(date) {
|
|
5974
|
-
const dayOfWeek = getDayOfWeek(date);
|
|
5975
|
-
const dayOfYear = getDayOfYear(date);
|
|
5976
|
-
const jan1DayOfWeek = getDayOfWeek((0, _internationalized_date.startOfYear)(date));
|
|
5977
|
-
if (dayOfYear <= 8 - jan1DayOfWeek && jan1DayOfWeek > 4) {
|
|
5978
|
-
if (jan1DayOfWeek === 5 || jan1DayOfWeek === 6 && isLeapYear(date.subtract({ years: 1 }))) return 53;
|
|
5979
|
-
return 52;
|
|
5980
|
-
}
|
|
5981
|
-
if (getDayOfYear((0, _internationalized_date.endOfYear)(date)) - dayOfYear < 4 - dayOfWeek) return 1;
|
|
5982
|
-
const weekNum = (dayOfYear + (7 - dayOfWeek) + (jan1DayOfWeek - 1)) / 7;
|
|
5983
|
-
if (jan1DayOfWeek > 4) return weekNum - 1;
|
|
5984
|
-
return weekNum;
|
|
5985
|
-
}
|
|
5986
|
-
/**
|
|
5987
|
-
* Mon = 1
|
|
5988
|
-
* Tue = 2
|
|
5989
|
-
* Wed = 3
|
|
5990
|
-
* Thu = 4
|
|
5991
|
-
* Fri = 5
|
|
5992
|
-
* Sat = 6
|
|
5993
|
-
* Sun = 7
|
|
5994
|
-
* @returns day of week, 1 indexed
|
|
5995
|
-
*/
|
|
5996
|
-
function getDayOfWeek(date) {
|
|
5997
|
-
const weekStart = (0, _internationalized_date.startOfWeek)(date, "no-NO");
|
|
5998
|
-
return date.calendar.toJulianDay(date) - weekStart.calendar.toJulianDay(weekStart) + 1;
|
|
5999
|
-
}
|
|
6000
|
-
/**
|
|
6001
|
-
* @returns day of year, 1 indexed
|
|
6002
|
-
*/
|
|
6003
|
-
function getDayOfYear(date) {
|
|
6004
|
-
const yearStart = (0, _internationalized_date.startOfYear)(date);
|
|
6005
|
-
return date.calendar.toJulianDay(date) - yearStart.calendar.toJulianDay(yearStart) + 1;
|
|
6006
|
-
}
|
|
6007
|
-
function isLeapYear(date) {
|
|
6008
|
-
return date.year % 4 === 0 && date.year % 100 !== 0 || date.year % 400 === 0;
|
|
6009
|
-
}
|
|
6010
5946
|
// src/components/date-inputs/DatePicker/CalendarPopover.tsx
|
|
6011
5947
|
const CalendarPopoverContext = (0, react.createContext)({
|
|
6012
5948
|
anchorRef: null,
|
|
@@ -6107,6 +6043,94 @@ const CalendarPopoverContent = ({ children, className, smallScreenBreakpoint })
|
|
|
6107
6043
|
children
|
|
6108
6044
|
})] });
|
|
6109
6045
|
};
|
|
6046
|
+
// src/components/date-inputs/utils/getWeekNumber.ts
|
|
6047
|
+
/**
|
|
6048
|
+
* Calculates the week number following the ISO-8601 format.
|
|
6049
|
+
* @returns week number, 1 indexed
|
|
6050
|
+
*/
|
|
6051
|
+
function getWeekNumber(date) {
|
|
6052
|
+
const dayOfWeek = getDayOfWeek(date);
|
|
6053
|
+
const dayOfYear = getDayOfYear(date);
|
|
6054
|
+
const jan1DayOfWeek = getDayOfWeek((0, _internationalized_date.startOfYear)(date));
|
|
6055
|
+
if (dayOfYear <= 8 - jan1DayOfWeek && jan1DayOfWeek > 4) {
|
|
6056
|
+
if (jan1DayOfWeek === 5 || jan1DayOfWeek === 6 && isLeapYear(date.subtract({ years: 1 }))) return 53;
|
|
6057
|
+
return 52;
|
|
6058
|
+
}
|
|
6059
|
+
if (getDayOfYear((0, _internationalized_date.endOfYear)(date)) - dayOfYear < 4 - dayOfWeek) return 1;
|
|
6060
|
+
const weekNum = (dayOfYear + (7 - dayOfWeek) + (jan1DayOfWeek - 1)) / 7;
|
|
6061
|
+
if (jan1DayOfWeek > 4) return weekNum - 1;
|
|
6062
|
+
return weekNum;
|
|
6063
|
+
}
|
|
6064
|
+
/**
|
|
6065
|
+
* Mon = 1
|
|
6066
|
+
* Tue = 2
|
|
6067
|
+
* Wed = 3
|
|
6068
|
+
* Thu = 4
|
|
6069
|
+
* Fri = 5
|
|
6070
|
+
* Sat = 6
|
|
6071
|
+
* Sun = 7
|
|
6072
|
+
* @returns day of week, 1 indexed
|
|
6073
|
+
*/
|
|
6074
|
+
function getDayOfWeek(date) {
|
|
6075
|
+
const weekStart = (0, _internationalized_date.startOfWeek)(date, "no-NO");
|
|
6076
|
+
return date.calendar.toJulianDay(date) - weekStart.calendar.toJulianDay(weekStart) + 1;
|
|
6077
|
+
}
|
|
6078
|
+
/**
|
|
6079
|
+
* @returns day of year, 1 indexed
|
|
6080
|
+
*/
|
|
6081
|
+
function getDayOfYear(date) {
|
|
6082
|
+
const yearStart = (0, _internationalized_date.startOfYear)(date);
|
|
6083
|
+
return date.calendar.toJulianDay(date) - yearStart.calendar.toJulianDay(yearStart) + 1;
|
|
6084
|
+
}
|
|
6085
|
+
function isLeapYear(date) {
|
|
6086
|
+
return date.year % 4 === 0 && date.year % 100 !== 0 || date.year % 400 === 0;
|
|
6087
|
+
}
|
|
6088
|
+
// src/components/date-inputs/DatePicker/Calendar/CalendarCell.tsx
|
|
6089
|
+
function CalendarCell({ ...props }) {
|
|
6090
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Box, {
|
|
6091
|
+
textAlign: "center",
|
|
6092
|
+
className: cn(typographyStyles_module_default["text-color--subtle"], DateInput_module_default.calendar__th),
|
|
6093
|
+
...props
|
|
6094
|
+
});
|
|
6095
|
+
}
|
|
6096
|
+
CalendarCell.displayName = "CalendarCell";
|
|
6097
|
+
// src/components/date-inputs/DatePicker/constants.ts
|
|
6098
|
+
const LOCALE = {
|
|
6099
|
+
nb: "nb-NO",
|
|
6100
|
+
no: "no-NO",
|
|
6101
|
+
nn: "nn-NO",
|
|
6102
|
+
en: "en-GB",
|
|
6103
|
+
se: "se-NO"
|
|
6104
|
+
};
|
|
6105
|
+
// src/components/date-inputs/DatePicker/Calendar/CalendarDate.tsx
|
|
6106
|
+
function CalendarDate$1({ date, state, onClose }) {
|
|
6107
|
+
const ref = (0, react.useRef)(null);
|
|
6108
|
+
const { buttonProps, cellProps, isOutsideVisibleRange, formattedDate, isSelected, isDisabled, isUnavailable } = (0, _react_aria_calendar.useCalendarCell)({ date }, state, ref);
|
|
6109
|
+
if (isOutsideVisibleRange) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", { ...cellProps });
|
|
6110
|
+
const closeOnKeyboardBlurForward = (event) => {
|
|
6111
|
+
if (event.key === "Tab" && event.shiftKey === false) onClose();
|
|
6112
|
+
};
|
|
6113
|
+
const isEffectivelyUnavailable = isUnavailable || isDisabled;
|
|
6114
|
+
const isUnavailableToday = isEffectivelyUnavailable && (0, _internationalized_date.isToday)(date, "Europe/Oslo");
|
|
6115
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", {
|
|
6116
|
+
...cellProps,
|
|
6117
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Box, {
|
|
6118
|
+
...buttonProps,
|
|
6119
|
+
as: "button",
|
|
6120
|
+
type: "button",
|
|
6121
|
+
ref,
|
|
6122
|
+
onKeyDown: closeOnKeyboardBlurForward,
|
|
6123
|
+
height: "100%",
|
|
6124
|
+
width: "100%",
|
|
6125
|
+
display: "flex",
|
|
6126
|
+
alignItems: "center",
|
|
6127
|
+
justifyContent: "center",
|
|
6128
|
+
className: cn(DateInput_module_default["calendar__cell-button"], (0, _internationalized_date.isToday)(date, "Europe/Oslo") && DateInput_module_default["calendar__cell-button--today"], DateInput_module_default[`calendar__cell-button--default`], isSelected && DateInput_module_default[`calendar__cell-button--selected`], isEffectivelyUnavailable && DateInput_module_default[`calendar__cell-button--unavailable`], isUnavailableToday && DateInput_module_default["calendar__cell-button--unavailable--today"], typographyStyles_module_default["body-short-small"], _key1),
|
|
6129
|
+
children: formattedDate
|
|
6130
|
+
})
|
|
6131
|
+
});
|
|
6132
|
+
}
|
|
6133
|
+
CalendarDate$1.displayName = "CalendarDate";
|
|
6110
6134
|
// src/components/date-inputs/DatePicker/Calendar/CalendarGrid.tsx
|
|
6111
6135
|
function CalendarGrid({ state, ...props }) {
|
|
6112
6136
|
const { t } = useTranslation();
|
|
@@ -6353,23 +6377,128 @@ function Calendar(props) {
|
|
|
6353
6377
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CalendarGrid, { state })]
|
|
6354
6378
|
});
|
|
6355
6379
|
}
|
|
6356
|
-
Calendar.displayName = "Calendar";
|
|
6357
|
-
const texts$24 = createTexts({
|
|
6358
|
-
nextMonth: {
|
|
6359
|
-
nb: "Neste måned",
|
|
6360
|
-
no: "Neste måned",
|
|
6361
|
-
nn: "Neste månad",
|
|
6362
|
-
en: "Next month",
|
|
6363
|
-
se: "Boahte mánu"
|
|
6364
|
-
},
|
|
6365
|
-
previousMonth: {
|
|
6366
|
-
nb: "Forrige måned",
|
|
6367
|
-
no: "Forrige måned",
|
|
6368
|
-
nn: "Førre månad",
|
|
6369
|
-
en: "Previous month",
|
|
6370
|
-
se: "Ovddit mánu"
|
|
6371
|
-
}
|
|
6372
|
-
});
|
|
6380
|
+
Calendar.displayName = "Calendar";
|
|
6381
|
+
const texts$24 = createTexts({
|
|
6382
|
+
nextMonth: {
|
|
6383
|
+
nb: "Neste måned",
|
|
6384
|
+
no: "Neste måned",
|
|
6385
|
+
nn: "Neste månad",
|
|
6386
|
+
en: "Next month",
|
|
6387
|
+
se: "Boahte mánu"
|
|
6388
|
+
},
|
|
6389
|
+
previousMonth: {
|
|
6390
|
+
nb: "Forrige måned",
|
|
6391
|
+
no: "Forrige måned",
|
|
6392
|
+
nn: "Førre månad",
|
|
6393
|
+
en: "Previous month",
|
|
6394
|
+
se: "Ovddit mánu"
|
|
6395
|
+
}
|
|
6396
|
+
});
|
|
6397
|
+
// src/components/date-inputs/utils/useFocusManagerRef.ts
|
|
6398
|
+
function useFocusManagerRef(ref) {
|
|
6399
|
+
const domRef = (0, react.useRef)(null);
|
|
6400
|
+
(0, react.useImperativeHandle)(ref, () => ({
|
|
6401
|
+
...createDOMRef(domRef),
|
|
6402
|
+
focus() {
|
|
6403
|
+
(0, _react_aria_focus.createFocusManager)(domRef).focusFirst({ tabbable: true });
|
|
6404
|
+
}
|
|
6405
|
+
}));
|
|
6406
|
+
return domRef;
|
|
6407
|
+
}
|
|
6408
|
+
function createDOMRef(ref) {
|
|
6409
|
+
return { UNSAFE_getDOMNode() {
|
|
6410
|
+
return ref.current;
|
|
6411
|
+
} };
|
|
6412
|
+
}
|
|
6413
|
+
// src/components/helpers/ClearButton/ClearButton.tsx
|
|
6414
|
+
const ClearButton = ({ className, absolute = true, hasIconToRight, size = "medium", ...rest }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Box, {
|
|
6415
|
+
as: Button,
|
|
6416
|
+
className: cn(className, Button_module_default.clear, absolute && utilStyles_module_default["center-absolute-y"], absolute && !hasIconToRight && Input_module_default[`input-group__btn-right`], absolute && hasIconToRight && Input_module_default[`input-group__btn-right-with-right-icon--${size}`]),
|
|
6417
|
+
icon: CloseSmallIcon,
|
|
6418
|
+
purpose: "tertiary",
|
|
6419
|
+
type: "button",
|
|
6420
|
+
size,
|
|
6421
|
+
...rest
|
|
6422
|
+
});
|
|
6423
|
+
ClearButton.displayName = "ClearButton";
|
|
6424
|
+
// src/components/helpers/Input/Input.tsx
|
|
6425
|
+
const Input$1 = ({ className, ...rest }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
6426
|
+
className: cn(className, Input_module_default.input, _key1),
|
|
6427
|
+
...rest
|
|
6428
|
+
});
|
|
6429
|
+
Input$1.displayName = "Input";
|
|
6430
|
+
const StatefulInput = ({ className, componentSize = "medium", hasErrorMessage, ...rest }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Input$1, {
|
|
6431
|
+
className: cn(className, Input_module_default["input--stateful"], Input_module_default[`input--${componentSize}`], typographyStyles_module_default[`body-short-${componentSize}`], hasErrorMessage && Input_module_default["input--stateful-danger"]),
|
|
6432
|
+
...rest
|
|
6433
|
+
});
|
|
6434
|
+
StatefulInput.displayName = "StatefulInput";
|
|
6435
|
+
// src/components/helpers/Input/Input.utils.tsx
|
|
6436
|
+
function getDefaultText(value, defaultValue) {
|
|
6437
|
+
if (typeof value === "string") return value;
|
|
6438
|
+
if (typeof defaultValue === "string") return defaultValue;
|
|
6439
|
+
return "";
|
|
6440
|
+
}
|
|
6441
|
+
function getInputWidth(width, defaultW) {
|
|
6442
|
+
const fallback = defaultW ? defaultW : "var(--dds-input-default-width)";
|
|
6443
|
+
if (isBreakpointObject(width)) return BREAKPOINTS.reduce((acc, bp) => {
|
|
6444
|
+
return {
|
|
6445
|
+
...acc,
|
|
6446
|
+
[bp]: bp in width ? width[bp] : fallback
|
|
6447
|
+
};
|
|
6448
|
+
}, {});
|
|
6449
|
+
return width ?? fallback;
|
|
6450
|
+
}
|
|
6451
|
+
// src/components/Typography/Label/Label.utils.tsx
|
|
6452
|
+
function renderLabel(props) {
|
|
6453
|
+
const { label, ...rest } = props;
|
|
6454
|
+
if (!!label) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Label, {
|
|
6455
|
+
...rest,
|
|
6456
|
+
withMargins: true,
|
|
6457
|
+
children: label
|
|
6458
|
+
});
|
|
6459
|
+
return null;
|
|
6460
|
+
}
|
|
6461
|
+
// src/components/date-inputs/common/DateInput.tsx
|
|
6462
|
+
function DateInput({ errorMessage, tip, componentSize = "medium", style, className, disabled, active, internalRef, readOnly, required, children, prefix: button, suffix: suffixEl, labelProps, fieldProps, groupProps, width, clearable, ref, afterLabelContent, tipId, errorMessageId, ...props }) {
|
|
6463
|
+
const hasErrorMessage = !!errorMessage;
|
|
6464
|
+
const { isOpen } = (0, react.useContext)(CalendarPopoverContext);
|
|
6465
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
6466
|
+
...groupProps,
|
|
6467
|
+
className: cn(className, Input_module_default.container, DateInput_module_default["date-group"]),
|
|
6468
|
+
ref,
|
|
6469
|
+
children: [
|
|
6470
|
+
renderLabel({
|
|
6471
|
+
...labelProps,
|
|
6472
|
+
label: props.label,
|
|
6473
|
+
showRequiredStyling: required,
|
|
6474
|
+
readOnly,
|
|
6475
|
+
afterLabelContent
|
|
6476
|
+
}),
|
|
6477
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Box, {
|
|
6478
|
+
style,
|
|
6479
|
+
width: getInputWidth(width, "fit-content"),
|
|
6480
|
+
className: cn(Input_module_default["input-group"], typographyStyles_module_default[`body-short-${componentSize}`], DateInput_module_default["input-group"]),
|
|
6481
|
+
children: [
|
|
6482
|
+
button,
|
|
6483
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(HStack, {
|
|
6484
|
+
...fieldProps,
|
|
6485
|
+
ref: internalRef,
|
|
6486
|
+
className: cn(Input_module_default.input, Input_module_default[`input--${componentSize}`], Input_module_default["input--stateful"], Input_module_default["input--hover"], hasErrorMessage && Input_module_default["input--stateful-danger"], clearable && Input_module_default[`input-with-btn-right--${componentSize}`], DateInput_module_default["date-segment-container"], Input_module_default[`input-with-icon--${componentSize}`], isOpen && focus_module_default.focused, disabled && "disabled", disabled && Input_module_default.disabled, active && "active", readOnly && "read-only", readOnly && Input_module_default["read-only"], focus_module_default["focusable-within"]),
|
|
6487
|
+
children
|
|
6488
|
+
}),
|
|
6489
|
+
suffixEl
|
|
6490
|
+
]
|
|
6491
|
+
}),
|
|
6492
|
+
renderInputMessage({
|
|
6493
|
+
tip,
|
|
6494
|
+
errorMessage,
|
|
6495
|
+
tipId,
|
|
6496
|
+
errorMessageId
|
|
6497
|
+
})
|
|
6498
|
+
]
|
|
6499
|
+
});
|
|
6500
|
+
}
|
|
6501
|
+
DateInput.displayName = "DateInput";
|
|
6373
6502
|
// src/components/date-inputs/DatePicker/DateField/CalendarButton.tsx
|
|
6374
6503
|
function CalendarButton({ componentSize = "medium", isReadOnly, ...props }) {
|
|
6375
6504
|
const ref = (0, react.useRef)(null);
|
|
@@ -6463,95 +6592,6 @@ function DateSegment({ segment, state, componentSize, errorMessageId, tipId }) {
|
|
|
6463
6592
|
});
|
|
6464
6593
|
}
|
|
6465
6594
|
DateSegment.displayName = "DateSegment";
|
|
6466
|
-
// src/components/helpers/ClearButton/ClearButton.tsx
|
|
6467
|
-
const ClearButton = ({ className, absolute = true, hasIconToRight, size = "medium", ...rest }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Box, {
|
|
6468
|
-
as: Button,
|
|
6469
|
-
className: cn(className, Button_module_default.clear, absolute && utilStyles_module_default["center-absolute-y"], absolute && !hasIconToRight && Input_module_default[`input-group__btn-right`], absolute && hasIconToRight && Input_module_default[`input-group__btn-right-with-right-icon--${size}`]),
|
|
6470
|
-
icon: CloseSmallIcon,
|
|
6471
|
-
purpose: "tertiary",
|
|
6472
|
-
type: "button",
|
|
6473
|
-
size,
|
|
6474
|
-
...rest
|
|
6475
|
-
});
|
|
6476
|
-
ClearButton.displayName = "ClearButton";
|
|
6477
|
-
// src/components/helpers/Input/Input.tsx
|
|
6478
|
-
const Input$1 = ({ className, ...rest }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
6479
|
-
className: cn(className, Input_module_default.input, _key1),
|
|
6480
|
-
...rest
|
|
6481
|
-
});
|
|
6482
|
-
Input$1.displayName = "Input";
|
|
6483
|
-
const StatefulInput = ({ className, componentSize = "medium", hasErrorMessage, ...rest }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Input$1, {
|
|
6484
|
-
className: cn(className, Input_module_default["input--stateful"], Input_module_default[`input--${componentSize}`], typographyStyles_module_default[`body-short-${componentSize}`], hasErrorMessage && Input_module_default["input--stateful-danger"]),
|
|
6485
|
-
...rest
|
|
6486
|
-
});
|
|
6487
|
-
StatefulInput.displayName = "StatefulInput";
|
|
6488
|
-
// src/components/helpers/Input/Input.utils.tsx
|
|
6489
|
-
function getDefaultText(value, defaultValue) {
|
|
6490
|
-
if (typeof value === "string") return value;
|
|
6491
|
-
if (typeof defaultValue === "string") return defaultValue;
|
|
6492
|
-
return "";
|
|
6493
|
-
}
|
|
6494
|
-
function getInputWidth(width, defaultW) {
|
|
6495
|
-
const fallback = defaultW ? defaultW : "var(--dds-input-default-width)";
|
|
6496
|
-
if (isBreakpointObject(width)) return BREAKPOINTS.reduce((acc, bp) => {
|
|
6497
|
-
return {
|
|
6498
|
-
...acc,
|
|
6499
|
-
[bp]: bp in width ? width[bp] : fallback
|
|
6500
|
-
};
|
|
6501
|
-
}, {});
|
|
6502
|
-
return width ?? fallback;
|
|
6503
|
-
}
|
|
6504
|
-
// src/components/Typography/Label/Label.utils.tsx
|
|
6505
|
-
function renderLabel(props) {
|
|
6506
|
-
const { label, ...rest } = props;
|
|
6507
|
-
if (!!label) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Label, {
|
|
6508
|
-
...rest,
|
|
6509
|
-
withMargins: true,
|
|
6510
|
-
children: label
|
|
6511
|
-
});
|
|
6512
|
-
return null;
|
|
6513
|
-
}
|
|
6514
|
-
// src/components/date-inputs/common/DateInput.tsx
|
|
6515
|
-
function DateInput({ errorMessage, tip, componentSize = "medium", style, className, disabled, active, internalRef, readOnly, required, children, prefix: button, suffix: suffixEl, labelProps, fieldProps, groupProps, width, clearable, ref, afterLabelContent, tipId, errorMessageId, ...props }) {
|
|
6516
|
-
const hasErrorMessage = !!errorMessage;
|
|
6517
|
-
const { isOpen } = (0, react.useContext)(CalendarPopoverContext);
|
|
6518
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
6519
|
-
...groupProps,
|
|
6520
|
-
className: cn(className, Input_module_default.container, DateInput_module_default["date-group"]),
|
|
6521
|
-
ref,
|
|
6522
|
-
children: [
|
|
6523
|
-
renderLabel({
|
|
6524
|
-
...labelProps,
|
|
6525
|
-
label: props.label,
|
|
6526
|
-
showRequiredStyling: required,
|
|
6527
|
-
readOnly,
|
|
6528
|
-
afterLabelContent
|
|
6529
|
-
}),
|
|
6530
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Box, {
|
|
6531
|
-
style,
|
|
6532
|
-
width: getInputWidth(width, "fit-content"),
|
|
6533
|
-
className: cn(Input_module_default["input-group"], typographyStyles_module_default[`body-short-${componentSize}`], DateInput_module_default["input-group"]),
|
|
6534
|
-
children: [
|
|
6535
|
-
button,
|
|
6536
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(HStack, {
|
|
6537
|
-
...fieldProps,
|
|
6538
|
-
ref: internalRef,
|
|
6539
|
-
className: cn(Input_module_default.input, Input_module_default[`input--${componentSize}`], Input_module_default["input--stateful"], Input_module_default["input--hover"], hasErrorMessage && Input_module_default["input--stateful-danger"], clearable && Input_module_default[`input-with-btn-right--${componentSize}`], DateInput_module_default["date-segment-container"], Input_module_default[`input-with-icon--${componentSize}`], isOpen && focus_module_default.focused, disabled && "disabled", disabled && Input_module_default.disabled, active && "active", readOnly && "read-only", readOnly && Input_module_default["read-only"], focus_module_default["focusable-within"]),
|
|
6540
|
-
children
|
|
6541
|
-
}),
|
|
6542
|
-
suffixEl
|
|
6543
|
-
]
|
|
6544
|
-
}),
|
|
6545
|
-
renderInputMessage({
|
|
6546
|
-
tip,
|
|
6547
|
-
errorMessage,
|
|
6548
|
-
tipId,
|
|
6549
|
-
errorMessageId
|
|
6550
|
-
})
|
|
6551
|
-
]
|
|
6552
|
-
});
|
|
6553
|
-
}
|
|
6554
|
-
DateInput.displayName = "DateInput";
|
|
6555
6595
|
// src/components/date-inputs/DatePicker/DateField/DateField.tsx
|
|
6556
6596
|
function DateField({ componentSize = "medium", buttonProps, groupProps, ref, clearable, errorMessageId, tipId, ...props }) {
|
|
6557
6597
|
const { locale } = (0, _react_aria_i18n.useLocale)();
|
|
@@ -6618,22 +6658,6 @@ const texts$22 = createTexts({ clearDate: {
|
|
|
6618
6658
|
nn: "Tøm dato",
|
|
6619
6659
|
se: "Gurre dáhtona"
|
|
6620
6660
|
} });
|
|
6621
|
-
// src/components/date-inputs/utils/useFocusManagerRef.ts
|
|
6622
|
-
function useFocusManagerRef(ref) {
|
|
6623
|
-
const domRef = (0, react.useRef)(null);
|
|
6624
|
-
(0, react.useImperativeHandle)(ref, () => ({
|
|
6625
|
-
...createDOMRef(domRef),
|
|
6626
|
-
focus() {
|
|
6627
|
-
(0, _react_aria_focus.createFocusManager)(domRef).focusFirst({ tabbable: true });
|
|
6628
|
-
}
|
|
6629
|
-
}));
|
|
6630
|
-
return domRef;
|
|
6631
|
-
}
|
|
6632
|
-
function createDOMRef(ref) {
|
|
6633
|
-
return { UNSAFE_getDOMNode() {
|
|
6634
|
-
return ref.current;
|
|
6635
|
-
} };
|
|
6636
|
-
}
|
|
6637
6661
|
// src/components/date-inputs/DatePicker/DatePicker.tsx
|
|
6638
6662
|
const refIsFocusable = (ref) => {
|
|
6639
6663
|
return typeof ref === "object" && ref !== null && "focus" in ref;
|
|
@@ -6844,21 +6868,6 @@ const DescriptionListGroup = ({ children, margin, minWidth, maxWidth, id, classN
|
|
|
6844
6868
|
children
|
|
6845
6869
|
});
|
|
6846
6870
|
DescriptionListGroup.displayName = "DescriptionListGroup";
|
|
6847
|
-
// src/components/DetailList/DetailList.context.tsx
|
|
6848
|
-
const DetailListContext = (0, react.createContext)({});
|
|
6849
|
-
const useDetailListContext = () => (0, react.useContext)(DetailListContext);
|
|
6850
|
-
// src/components/DetailList/DetailList.module.css
|
|
6851
|
-
var DetailList_module_default = {
|
|
6852
|
-
"list": "dds-DetailList-module__list",
|
|
6853
|
-
"list--striped-with-bp": "dds-DetailList-module__list--striped-with-bp",
|
|
6854
|
-
"row": "dds-DetailList-module__row",
|
|
6855
|
-
"list--small": "dds-DetailList-module__list--small",
|
|
6856
|
-
"list--medium": "dds-DetailList-module__list--medium",
|
|
6857
|
-
"list--large": "dds-DetailList-module__list--large",
|
|
6858
|
-
"column": "dds-DetailList-module__column",
|
|
6859
|
-
"cell": "dds-DetailList-module__cell",
|
|
6860
|
-
"term": "dds-DetailList-module__term"
|
|
6861
|
-
};
|
|
6862
6871
|
// src/components/Table/Table.module.css
|
|
6863
6872
|
var Table_module_default = {
|
|
6864
6873
|
"wrapper": "dds-Table-module__wrapper",
|
|
@@ -6871,6 +6880,8 @@ var Table_module_default = {
|
|
|
6871
6880
|
"table--striped": "dds-Table-module__table--striped",
|
|
6872
6881
|
"row--body": "dds-Table-module__row--body",
|
|
6873
6882
|
"table--collapsible--striped": "dds-Table-module__table--collapsible--striped",
|
|
6883
|
+
"standard-row": "dds-Table-module__standard-row",
|
|
6884
|
+
"dl-row": "dds-Table-module__dl-row",
|
|
6874
6885
|
"table--with-dividers": "dds-Table-module__table--with-dividers",
|
|
6875
6886
|
"row--collapsible-header--open": "dds-Table-module__row--collapsible-header--open",
|
|
6876
6887
|
"row": "dds-Table-module__row",
|
|
@@ -6885,6 +6896,21 @@ var Table_module_default = {
|
|
|
6885
6896
|
"sort-button": "dds-Table-module__sort-button",
|
|
6886
6897
|
"filter-cell": "dds-Table-module__filter-cell"
|
|
6887
6898
|
};
|
|
6899
|
+
// src/components/DetailList/DetailList.context.tsx
|
|
6900
|
+
const DetailListContext = (0, react.createContext)({});
|
|
6901
|
+
const useDetailListContext = () => (0, react.useContext)(DetailListContext);
|
|
6902
|
+
// src/components/DetailList/DetailList.module.css
|
|
6903
|
+
var DetailList_module_default = {
|
|
6904
|
+
"list": "dds-DetailList-module__list",
|
|
6905
|
+
"list--striped-with-bp": "dds-DetailList-module__list--striped-with-bp",
|
|
6906
|
+
"row": "dds-DetailList-module__row",
|
|
6907
|
+
"list--small": "dds-DetailList-module__list--small",
|
|
6908
|
+
"list--medium": "dds-DetailList-module__list--medium",
|
|
6909
|
+
"list--large": "dds-DetailList-module__list--large",
|
|
6910
|
+
"column": "dds-DetailList-module__column",
|
|
6911
|
+
"cell": "dds-DetailList-module__cell",
|
|
6912
|
+
"term": "dds-DetailList-module__term"
|
|
6913
|
+
};
|
|
6888
6914
|
// src/components/DetailList/DetailList.tsx
|
|
6889
6915
|
const DETAIL_LIST_SIZES = createSizes("small", "medium", "large");
|
|
6890
6916
|
const DetailList = ({ id, className, style, htmlProps, withDividers = true, striped = true, size = "medium", smallScreenBreakpoint, ...rest }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DetailListContext, {
|
|
@@ -6923,6 +6949,9 @@ const DetailListTerm = ({ className, ...rest }) => /* @__PURE__ */ (0, react_jsx
|
|
|
6923
6949
|
...rest
|
|
6924
6950
|
});
|
|
6925
6951
|
DetailListTerm.displayName = "DetailListTerm";
|
|
6952
|
+
// src/components/Drawer/Drawer.context.tsx
|
|
6953
|
+
const DrawerContext = (0, react.createContext)({});
|
|
6954
|
+
const useDrawerContext = () => (0, react.useContext)(DrawerContext);
|
|
6926
6955
|
// src/components/Drawer/Drawer.module.css
|
|
6927
6956
|
var Drawer_module_default = {
|
|
6928
6957
|
"container": "dds-Drawer-module__container",
|
|
@@ -6936,9 +6965,6 @@ var Drawer_module_default = {
|
|
|
6936
6965
|
"drawer-header": "dds-Drawer-module__drawer-header",
|
|
6937
6966
|
"button--close": "dds-Drawer-module__button--close"
|
|
6938
6967
|
};
|
|
6939
|
-
// src/components/Drawer/Drawer.context.tsx
|
|
6940
|
-
const DrawerContext = (0, react.createContext)({});
|
|
6941
|
-
const useDrawerContext = () => (0, react.useContext)(DrawerContext);
|
|
6942
6968
|
const Drawer = ({ children, header, placement = "right", parentElement, size = "small", className, style, htmlProps, maxWidth, minWidth = "300px", width, withBackdrop, ref, ...rest }) => {
|
|
6943
6969
|
const themeContext = (0, react.useContext)(ThemeContext);
|
|
6944
6970
|
if (!themeContext) throw new Error("Drawer must be used within a DdsProvider");
|
|
@@ -7107,8 +7133,6 @@ function EmptyContent({ headerText, children, headerHeadingLevel = 2, ...rest })
|
|
|
7107
7133
|
});
|
|
7108
7134
|
}
|
|
7109
7135
|
EmptyContent.displayName = "EmptyContent";
|
|
7110
|
-
// src/components/ErrorSummary/ErrorSummary.module.css
|
|
7111
|
-
var ErrorSummary_module_default = { "container": "dds-ErrorSummary-module__container" };
|
|
7112
7136
|
// src/components/List/List.module.css
|
|
7113
7137
|
var List_module_default = {
|
|
7114
7138
|
"list": "dds-List-module__list",
|
|
@@ -7132,6 +7156,8 @@ const ListItem = ({ className, ...rest }) => /* @__PURE__ */ (0, react_jsx_runti
|
|
|
7132
7156
|
className: cn(className, List_module_default.li)
|
|
7133
7157
|
});
|
|
7134
7158
|
ListItem.displayName = "ListItem";
|
|
7159
|
+
// src/components/ErrorSummary/ErrorSummary.module.css
|
|
7160
|
+
var ErrorSummary_module_default = { "container": "dds-ErrorSummary-module__container" };
|
|
7135
7161
|
// src/components/ErrorSummary/ErrorSummary.tsx
|
|
7136
7162
|
const ErrorSummary = ({ heading: pHeading, className, style, children, id, htmlProps, ...props }) => {
|
|
7137
7163
|
const { t } = useTranslation();
|
|
@@ -7219,16 +7245,6 @@ const texts$20 = createTexts({ favourite: {
|
|
|
7219
7245
|
en: "Mark as favourite",
|
|
7220
7246
|
se: "Merke favorihta"
|
|
7221
7247
|
} });
|
|
7222
|
-
// src/components/Feedback/Feedback.module.css
|
|
7223
|
-
var Feedback_module_default = {
|
|
7224
|
-
"rating-container": "dds-Feedback-module__rating-container",
|
|
7225
|
-
"rating-container--horizontal": "dds-Feedback-module__rating-container--horizontal",
|
|
7226
|
-
"rating-container--vertical": "dds-Feedback-module__rating-container--vertical",
|
|
7227
|
-
"rating-submitted-title": "dds-Feedback-module__rating-submitted-title",
|
|
7228
|
-
"button": "dds-Feedback-module__button"
|
|
7229
|
-
};
|
|
7230
|
-
// src/components/TextArea/TextArea.module.css
|
|
7231
|
-
var TextArea_module_default = { "textarea": "dds-TextArea-module__textarea" };
|
|
7232
7248
|
// src/components/helpers/CharCounter/CharCounter.module.css
|
|
7233
7249
|
var CharCounter_module_default = { "container": "dds-CharCounter-module__container" };
|
|
7234
7250
|
// src/components/helpers/CharCounter/CharCounter.tsx
|
|
@@ -7267,6 +7283,8 @@ const texts$19 = createTexts({ charsWritten: (current, max, remain) => ({
|
|
|
7267
7283
|
en: `${current} of ${max} characters used. ${remain} remaining.`,
|
|
7268
7284
|
se: `${current} ${max} mearkabustáva leat ${max} čállon ${remain}.`
|
|
7269
7285
|
}) });
|
|
7286
|
+
// src/components/TextArea/TextArea.module.css
|
|
7287
|
+
var TextArea_module_default = { "textarea": "dds-TextArea-module__textarea" };
|
|
7270
7288
|
// src/components/TextArea/TextArea.tsx
|
|
7271
7289
|
const TextArea = ({ id, value, defaultValue, onChange, errorMessage, required = false, tip, label, readOnly, "aria-required": ariaRequired = false, "aria-describedby": ariaDescribedby, maxLength, withCharacterCounter = true, className, style, width, ref, ...rest }) => {
|
|
7272
7290
|
const generatedId = (0, react.useId)();
|
|
@@ -7339,6 +7357,14 @@ const TextArea = ({ id, value, defaultValue, onChange, errorMessage, required =
|
|
|
7339
7357
|
});
|
|
7340
7358
|
};
|
|
7341
7359
|
TextArea.displayName = "TextArea";
|
|
7360
|
+
// src/components/Feedback/Feedback.module.css
|
|
7361
|
+
var Feedback_module_default = {
|
|
7362
|
+
"rating-container": "dds-Feedback-module__rating-container",
|
|
7363
|
+
"rating-container--horizontal": "dds-Feedback-module__rating-container--horizontal",
|
|
7364
|
+
"rating-container--vertical": "dds-Feedback-module__rating-container--vertical",
|
|
7365
|
+
"rating-submitted-title": "dds-Feedback-module__rating-submitted-title",
|
|
7366
|
+
"button": "dds-Feedback-module__button"
|
|
7367
|
+
};
|
|
7342
7368
|
// src/components/Feedback/CommentComponent.tsx
|
|
7343
7369
|
const CommentComponent = ({ rating, feedbackText, positiveFeedbackLabel, negativeFeedbackLabel, ratingSubmittedTitle, textAreaTip, loading, handleSubmit, handleFeedbackTextChange }) => {
|
|
7344
7370
|
const { t } = useTranslation();
|
|
@@ -7372,8 +7398,6 @@ const texts$18 = createTexts({ send: {
|
|
|
7372
7398
|
en: "Send",
|
|
7373
7399
|
se: "Sádde"
|
|
7374
7400
|
} });
|
|
7375
|
-
// src/components/Feedback/utils.tsx
|
|
7376
|
-
const getButtonSize = (layout) => layout === "vertical" ? "medium" : "small";
|
|
7377
7401
|
// src/components/Tooltip/Tooltip.tsx
|
|
7378
7402
|
const Tooltip = ({ text, placement = "bottom", children, tooltipId, delay = 100, style, onMouseLeave, onMouseOver, keepMounted = true, id, ref, className, htmlProps, ...rest }) => {
|
|
7379
7403
|
const generatedId = (0, react.useId)();
|
|
@@ -7465,6 +7489,8 @@ const Tooltip = ({ text, placement = "bottom", children, tooltipId, delay = 100,
|
|
|
7465
7489
|
});
|
|
7466
7490
|
};
|
|
7467
7491
|
Tooltip.displayName = "Tooltip";
|
|
7492
|
+
// src/components/Feedback/utils.tsx
|
|
7493
|
+
const getButtonSize = (layout) => layout === "vertical" ? "medium" : "small";
|
|
7468
7494
|
// src/components/Feedback/RatingComponent.tsx
|
|
7469
7495
|
const RatingComponent = ({ layout, ratingLabel, loading, thumbUpTooltip, thumbDownTooltip, handleRatingChange }) => {
|
|
7470
7496
|
const { t } = useTranslation();
|
|
@@ -8373,61 +8399,6 @@ const texts$12 = createTexts({ noValue: {
|
|
|
8373
8399
|
en: "Not filled out",
|
|
8374
8400
|
se: "Ii leat devdon"
|
|
8375
8401
|
} });
|
|
8376
|
-
// src/components/GlobalMessage/GlobalMessage.module.css
|
|
8377
|
-
var GlobalMessage_module_default = {
|
|
8378
|
-
"container": "dds-GlobalMessage-module__container",
|
|
8379
|
-
"container--info": "dds-GlobalMessage-module__container--info",
|
|
8380
|
-
"icon": "dds-GlobalMessage-module__icon",
|
|
8381
|
-
"container--danger": "dds-GlobalMessage-module__container--danger",
|
|
8382
|
-
"container--warning": "dds-GlobalMessage-module__container--warning"
|
|
8383
|
-
};
|
|
8384
|
-
const icons$2 = {
|
|
8385
|
-
info: InfoIcon,
|
|
8386
|
-
danger: ErrorIcon,
|
|
8387
|
-
warning: WarningIcon
|
|
8388
|
-
};
|
|
8389
|
-
const GlobalMessage = ({ purpose = "info", closable, onClose, children, id, className, style, htmlProps, ...rest }) => {
|
|
8390
|
-
const { t } = useTranslation();
|
|
8391
|
-
const [isClosed, setClosed] = (0, react.useState)(false);
|
|
8392
|
-
return !isClosed ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(HStack, {
|
|
8393
|
-
...getBaseHTMLProps(id, cn(className, GlobalMessage_module_default.container, GlobalMessage_module_default[`container--${purpose}`], typographyStyles_module_default["body-short-medium"]), style, htmlProps, rest),
|
|
8394
|
-
alignItems: "center",
|
|
8395
|
-
justifyContent: "space-between",
|
|
8396
|
-
width: "100%",
|
|
8397
|
-
padding: "0 x1",
|
|
8398
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(HStack, {
|
|
8399
|
-
alignItems: "center",
|
|
8400
|
-
paddingBlock: "x0.75",
|
|
8401
|
-
paddingInline: closable ? "x0 x0.75" : " x0 x1.5",
|
|
8402
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, {
|
|
8403
|
-
icon: icons$2[purpose],
|
|
8404
|
-
iconSize: "component",
|
|
8405
|
-
className: GlobalMessage_module_default.icon
|
|
8406
|
-
}), children]
|
|
8407
|
-
}), closable && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
|
|
8408
|
-
icon: CloseIcon,
|
|
8409
|
-
purpose: "tertiary",
|
|
8410
|
-
onClick: () => {
|
|
8411
|
-
setClosed(true);
|
|
8412
|
-
onClose?.();
|
|
8413
|
-
},
|
|
8414
|
-
size: "small",
|
|
8415
|
-
"aria-label": t(commonTexts.closeMessage)
|
|
8416
|
-
})]
|
|
8417
|
-
}) : null;
|
|
8418
|
-
};
|
|
8419
|
-
GlobalMessage.displayName = "GlobalMessage";
|
|
8420
|
-
// src/components/InlineButton/InlineButton.module.css
|
|
8421
|
-
var InlineButton_module_default = { "button": "dds-InlineButton-module__button" };
|
|
8422
|
-
// src/components/InlineButton/InlineButton.tsx
|
|
8423
|
-
const InlineButton = ({ className, color, icon, children, ...rest }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StylelessButton, {
|
|
8424
|
-
className: cn(className, focus_module_default.focusable, typographyStyles_module_default.a, InlineButton_module_default.button, getColorCn(color)),
|
|
8425
|
-
...rest,
|
|
8426
|
-
children: icon ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, {
|
|
8427
|
-
icon,
|
|
8428
|
-
iconSize: "component"
|
|
8429
|
-
}) : children
|
|
8430
|
-
});
|
|
8431
8402
|
// src/components/InlineEdit/InlineEdit.context.tsx
|
|
8432
8403
|
const InlineEditContext = (0, react.createContext)({});
|
|
8433
8404
|
const useInlineEditContext = () => (0, react.useContext)(InlineEditContext);
|
|
@@ -8471,6 +8442,37 @@ const InlineEditContextProvider = (props) => {
|
|
|
8471
8442
|
});
|
|
8472
8443
|
};
|
|
8473
8444
|
InlineEditContextProvider.displayName = "InlineEditContextProvider";
|
|
8445
|
+
// src/utils/createClearChangeEvent.tsx
|
|
8446
|
+
/**
|
|
8447
|
+
* Lager en change-event som kan resette verdien i et input-felt.
|
|
8448
|
+
* Dette vil resultere i en event som har: event.target.value = ''.
|
|
8449
|
+
*
|
|
8450
|
+
* @param elementId Id'en til et gitt input-felt
|
|
8451
|
+
* @returns En change-event som har en tom streng som target value
|
|
8452
|
+
*/
|
|
8453
|
+
function createClearChangeEvent(elementId) {
|
|
8454
|
+
const element = document.getElementById(elementId);
|
|
8455
|
+
if (!element) throw new Error(`Element by id '${elementId}' not found.`);
|
|
8456
|
+
if (element instanceof HTMLInputElement) element.value = "";
|
|
8457
|
+
else if (element instanceof HTMLSelectElement) element.selectedIndex = 0;
|
|
8458
|
+
return {
|
|
8459
|
+
target: element,
|
|
8460
|
+
currentTarget: element,
|
|
8461
|
+
bubbles: true,
|
|
8462
|
+
cancelable: false,
|
|
8463
|
+
defaultPrevented: false,
|
|
8464
|
+
eventPhase: 0,
|
|
8465
|
+
isTrusted: false,
|
|
8466
|
+
preventDefault: () => null,
|
|
8467
|
+
stopPropagation: () => null,
|
|
8468
|
+
nativeEvent: new Event("input"),
|
|
8469
|
+
persist: () => null,
|
|
8470
|
+
type: "change",
|
|
8471
|
+
timeStamp: Date.now(),
|
|
8472
|
+
isDefaultPrevented: () => false,
|
|
8473
|
+
isPropagationStopped: () => false
|
|
8474
|
+
};
|
|
8475
|
+
}
|
|
8474
8476
|
// src/components/InlineEdit/InlineEdit.module.css
|
|
8475
8477
|
var InlineEdit_module_default = {
|
|
8476
8478
|
"inline-input": "dds-InlineEdit-module__inline-input",
|
|
@@ -8533,37 +8535,6 @@ const inlineSelectCns = (hasErrorState, showEditingIcon, hasValue) => [
|
|
|
8533
8535
|
hasValue && Input_module_default["input-with-icon-and-button-right--small"],
|
|
8534
8536
|
InlineEdit_module_default["inline-select"]
|
|
8535
8537
|
];
|
|
8536
|
-
// src/utils/createClearChangeEvent.tsx
|
|
8537
|
-
/**
|
|
8538
|
-
* Lager en change-event som kan resette verdien i et input-felt.
|
|
8539
|
-
* Dette vil resultere i en event som har: event.target.value = ''.
|
|
8540
|
-
*
|
|
8541
|
-
* @param elementId Id'en til et gitt input-felt
|
|
8542
|
-
* @returns En change-event som har en tom streng som target value
|
|
8543
|
-
*/
|
|
8544
|
-
function createClearChangeEvent(elementId) {
|
|
8545
|
-
const element = document.getElementById(elementId);
|
|
8546
|
-
if (!element) throw new Error(`Element by id '${elementId}' not found.`);
|
|
8547
|
-
if (element instanceof HTMLInputElement) element.value = "";
|
|
8548
|
-
else if (element instanceof HTMLSelectElement) element.selectedIndex = 0;
|
|
8549
|
-
return {
|
|
8550
|
-
target: element,
|
|
8551
|
-
currentTarget: element,
|
|
8552
|
-
bubbles: true,
|
|
8553
|
-
cancelable: false,
|
|
8554
|
-
defaultPrevented: false,
|
|
8555
|
-
eventPhase: 0,
|
|
8556
|
-
isTrusted: false,
|
|
8557
|
-
preventDefault: () => null,
|
|
8558
|
-
stopPropagation: () => null,
|
|
8559
|
-
nativeEvent: new Event("input"),
|
|
8560
|
-
persist: () => null,
|
|
8561
|
-
type: "change",
|
|
8562
|
-
timeStamp: Date.now(),
|
|
8563
|
-
isDefaultPrevented: () => false,
|
|
8564
|
-
isPropagationStopped: () => false
|
|
8565
|
-
};
|
|
8566
|
-
}
|
|
8567
8538
|
// src/components/InlineEdit/InlineField.tsx
|
|
8568
8539
|
function InlineField(props) {
|
|
8569
8540
|
const { elementType, id, error, errorMessage, width = "140px", hideIcon, ref, className, "aria-describedby": ariaDescribedby, ...rest } = props;
|
|
@@ -8850,17 +8821,10 @@ const texts$10 = createTexts({
|
|
|
8850
8821
|
se: "Siidu navigášuvdna"
|
|
8851
8822
|
}
|
|
8852
8823
|
});
|
|
8853
|
-
// src/components/
|
|
8854
|
-
var
|
|
8855
|
-
|
|
8856
|
-
|
|
8857
|
-
"container--warning": "dds-LocalMessage-module__container--warning",
|
|
8858
|
-
"container--danger": "dds-LocalMessage-module__container--danger",
|
|
8859
|
-
"container--success": "dds-LocalMessage-module__container--success",
|
|
8860
|
-
"container--tips": "dds-LocalMessage-module__container--tips"
|
|
8861
|
-
};
|
|
8862
|
-
// src/components/LocalMessage/LocalMessage.tsx
|
|
8863
|
-
const L_MESSAGE_PURPOSES = createPurposes("info", "success", "warning", "danger", "tips");
|
|
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");
|
|
8864
8828
|
const icons$1 = {
|
|
8865
8829
|
info: InfoIcon,
|
|
8866
8830
|
danger: ErrorIcon,
|
|
@@ -8868,10 +8832,97 @@ const icons$1 = {
|
|
|
8868
8832
|
success: CheckCircledIcon,
|
|
8869
8833
|
tips: TipIcon
|
|
8870
8834
|
};
|
|
8871
|
-
const
|
|
8835
|
+
const MessageBase = ({ children, id, className, style, htmlProps, purpose = "info", heading, closable, onClose, gridLayout, headingLevel = 2, containerGridTemplateStyles, ...rest }) => {
|
|
8872
8836
|
const { t } = useTranslation();
|
|
8873
8837
|
const [isOpen, setOpen] = (0, react.useState)(true);
|
|
8874
|
-
const
|
|
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
|
+
// src/components/messages/GlobalMessage/GlobalMessage.module.css
|
|
8887
|
+
var GlobalMessage_module_default = { "container": "dds-GlobalMessage-module__container" };
|
|
8888
|
+
MESSAGE_PURPOSES.filter((purpose) => purpose !== "tips" && purpose !== "success");
|
|
8889
|
+
const GlobalMessage = (props) => {
|
|
8890
|
+
const gridLayout = `message${props.closable ? "-closable" : ""}${props.heading ? "-heading" : ""}`;
|
|
8891
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MessageBase, {
|
|
8892
|
+
gridLayout,
|
|
8893
|
+
containerGridTemplateStyles: {
|
|
8894
|
+
message: {
|
|
8895
|
+
gridTemplateAreas: `"icon text"`,
|
|
8896
|
+
gridTemplateColumns: "min-content 1fr"
|
|
8897
|
+
},
|
|
8898
|
+
"message-closable": {
|
|
8899
|
+
gridTemplateAreas: `"icon text close-btn"`,
|
|
8900
|
+
gridTemplateColumns: "min-content 1fr min-content"
|
|
8901
|
+
},
|
|
8902
|
+
"message-heading": {
|
|
8903
|
+
gridTemplateAreas: `"icon heading" ". text"`,
|
|
8904
|
+
gridTemplateColumns: "min-content 1fr"
|
|
8905
|
+
},
|
|
8906
|
+
"message-closable-heading": {
|
|
8907
|
+
gridTemplateAreas: `"icon heading close-btn" ". text text"`,
|
|
8908
|
+
gridTemplateColumns: "min-content 1fr min-content"
|
|
8909
|
+
}
|
|
8910
|
+
},
|
|
8911
|
+
className: GlobalMessage_module_default.container,
|
|
8912
|
+
rowGap: "x0.5",
|
|
8913
|
+
columnGap: "x0.75",
|
|
8914
|
+
padding: "x0.75",
|
|
8915
|
+
width: "100%",
|
|
8916
|
+
...props
|
|
8917
|
+
});
|
|
8918
|
+
};
|
|
8919
|
+
GlobalMessage.displayName = "GlobalMessage";
|
|
8920
|
+
// src/components/messages/LocalMessage/LocalMessage.module.css
|
|
8921
|
+
var LocalMessage_module_default = { "container": "dds-LocalMessage-module__container" };
|
|
8922
|
+
// src/components/messages/LocalMessage/LocalMessage.tsx
|
|
8923
|
+
const L_MESSAGE_PURPOSES = MESSAGE_PURPOSES;
|
|
8924
|
+
const LocalMessage = ({ layout = "horisontal", ...rest }) => {
|
|
8925
|
+
const gridLayout = `${layout}${rest.closable ? "-closable" : ""}${rest.heading ? "-heading" : ""}`;
|
|
8875
8926
|
const containerGridTemplateStyles = {
|
|
8876
8927
|
horisontal: {
|
|
8877
8928
|
gridTemplateAreas: `"icon text"`,
|
|
@@ -8881,6 +8932,14 @@ const LocalMessage = ({ purpose = "info", closable, onClose, width, layout = "ho
|
|
|
8881
8932
|
gridTemplateAreas: `"icon text close-btn"`,
|
|
8882
8933
|
gridTemplateColumns: "min-content 1fr min-content"
|
|
8883
8934
|
},
|
|
8935
|
+
"horisontal-heading": {
|
|
8936
|
+
gridTemplateAreas: `"icon heading" ". text"`,
|
|
8937
|
+
gridTemplateColumns: "min-content 1fr"
|
|
8938
|
+
},
|
|
8939
|
+
"horisontal-closable-heading": {
|
|
8940
|
+
gridTemplateAreas: `"icon heading close-btn" ". text text"`,
|
|
8941
|
+
gridTemplateColumns: "min-content 1fr min-content"
|
|
8942
|
+
},
|
|
8884
8943
|
vertical: {
|
|
8885
8944
|
gridTemplateAreas: `"icon" "text"`,
|
|
8886
8945
|
gridTemplateColumns: "1fr"
|
|
@@ -8888,42 +8947,26 @@ const LocalMessage = ({ purpose = "info", closable, onClose, width, layout = "ho
|
|
|
8888
8947
|
"vertical-closable": {
|
|
8889
8948
|
gridTemplateAreas: `"icon close-btn" "text text"`,
|
|
8890
8949
|
gridTemplateColumns: "1fr min-content"
|
|
8950
|
+
},
|
|
8951
|
+
"vertical-heading": {
|
|
8952
|
+
gridTemplateAreas: `"icon" "heading" "text"`,
|
|
8953
|
+
gridTemplateColumns: "1fr"
|
|
8954
|
+
},
|
|
8955
|
+
"vertical-closable-heading": {
|
|
8956
|
+
gridTemplateAreas: `"icon close-btn" "heading heading" "text text"`,
|
|
8957
|
+
gridTemplateColumns: "1fr min-content"
|
|
8891
8958
|
}
|
|
8892
8959
|
};
|
|
8893
|
-
|
|
8894
|
-
|
|
8895
|
-
|
|
8960
|
+
const hasDenseLayout = gridLayout === "vertical" || gridLayout === "vertical-closable";
|
|
8961
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MessageBase, {
|
|
8962
|
+
gridLayout,
|
|
8963
|
+
containerGridTemplateStyles,
|
|
8964
|
+
className: LocalMessage_module_default.container,
|
|
8896
8965
|
padding: "x0.75 x0.75 x0.75 x0.5",
|
|
8897
|
-
rowGap: "x0.5",
|
|
8966
|
+
rowGap: hasDenseLayout ? "x0.25" : "x0.5",
|
|
8898
8967
|
columnGap: "x0.5",
|
|
8899
|
-
|
|
8900
|
-
|
|
8901
|
-
children: [
|
|
8902
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(GridChild, {
|
|
8903
|
-
as: Icon,
|
|
8904
|
-
gridArea: "icon",
|
|
8905
|
-
iconSize: "component",
|
|
8906
|
-
icon: icons$1[purpose],
|
|
8907
|
-
color: `var(--dds-color-icon-on-${purpose === "tips" ? "info" : purpose}-default)`
|
|
8908
|
-
}),
|
|
8909
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(GridChild, {
|
|
8910
|
-
gridArea: "text",
|
|
8911
|
-
children
|
|
8912
|
-
}),
|
|
8913
|
-
closable && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(GridChild, {
|
|
8914
|
-
as: Button,
|
|
8915
|
-
gridArea: "close-btn",
|
|
8916
|
-
icon: CloseIcon,
|
|
8917
|
-
purpose: "tertiary",
|
|
8918
|
-
onClick: () => {
|
|
8919
|
-
setOpen(false);
|
|
8920
|
-
onClose?.();
|
|
8921
|
-
},
|
|
8922
|
-
size: "xsmall",
|
|
8923
|
-
"aria-label": t(commonTexts.closeMessage)
|
|
8924
|
-
})
|
|
8925
|
-
]
|
|
8926
|
-
}) : null;
|
|
8968
|
+
...rest
|
|
8969
|
+
});
|
|
8927
8970
|
};
|
|
8928
8971
|
LocalMessage.displayName = "LocalMessage";
|
|
8929
8972
|
// src/components/Modal/Modal.module.css
|
|
@@ -9176,47 +9219,6 @@ const NewsPopover = ({ id, className, style, htmlProps, header, news, defaultAct
|
|
|
9176
9219
|
}) : null;
|
|
9177
9220
|
};
|
|
9178
9221
|
NewsPopover.displayName = "NewsPopover";
|
|
9179
|
-
// src/components/Pagination/Pagination.module.css
|
|
9180
|
-
var Pagination_module_default = { "truncation-icon": "dds-Pagination-module__truncation-icon" };
|
|
9181
|
-
// src/components/Pagination/paginationGenerator.tsx
|
|
9182
|
-
const arrayRange = (start, end) => {
|
|
9183
|
-
const length = end - start + 1;
|
|
9184
|
-
return Array.from({ length }, (_, idx) => idx + start);
|
|
9185
|
-
};
|
|
9186
|
-
function PaginationGenerator(pagesAmount, activePage) {
|
|
9187
|
-
const siblingsCount = 1;
|
|
9188
|
-
const maxPagesShown = 7;
|
|
9189
|
-
const pagesBeforeTruncator = 5;
|
|
9190
|
-
const truncator = "truncator";
|
|
9191
|
-
let pageRange;
|
|
9192
|
-
if (pagesAmount > 4) {
|
|
9193
|
-
const middleStartPage = Math.max(1, activePage < pagesBeforeTruncator || pagesAmount <= maxPagesShown ? 1 : activePage + siblingsCount + 1 >= pagesAmount ? pagesAmount - 4 : activePage > 4 && pagesAmount > maxPagesShown ? activePage - siblingsCount : 1);
|
|
9194
|
-
const middleEndOffset = activePage < pagesBeforeTruncator && pagesAmount > maxPagesShown ? pagesBeforeTruncator : activePage < pagesBeforeTruncator && pagesAmount <= maxPagesShown ? pagesAmount : activePage + siblingsCount + 1 < pagesAmount - 1 ? activePage + siblingsCount : activePage + siblingsCount + 1 === pagesAmount - 1 ? pagesAmount : pagesAmount;
|
|
9195
|
-
const middleEndPage = Math.min(pagesAmount, middleEndOffset);
|
|
9196
|
-
pageRange = arrayRange(middleStartPage, middleEndPage);
|
|
9197
|
-
const truncatedLeft = middleStartPage > 2 && pagesAmount > maxPagesShown;
|
|
9198
|
-
const truncatedRight = pagesAmount - middleEndPage > 1 && pagesAmount > maxPagesShown;
|
|
9199
|
-
if (truncatedLeft && truncatedRight) pageRange = [
|
|
9200
|
-
1,
|
|
9201
|
-
truncator,
|
|
9202
|
-
...pageRange,
|
|
9203
|
-
truncator,
|
|
9204
|
-
pagesAmount
|
|
9205
|
-
];
|
|
9206
|
-
else if (truncatedLeft && !truncatedRight) pageRange = [
|
|
9207
|
-
1,
|
|
9208
|
-
truncator,
|
|
9209
|
-
...pageRange
|
|
9210
|
-
];
|
|
9211
|
-
else if (!truncatedLeft && truncatedRight) pageRange = [
|
|
9212
|
-
...pageRange,
|
|
9213
|
-
truncator,
|
|
9214
|
-
pagesAmount
|
|
9215
|
-
];
|
|
9216
|
-
return [...pageRange];
|
|
9217
|
-
}
|
|
9218
|
-
return arrayRange(1, pagesAmount);
|
|
9219
|
-
}
|
|
9220
9222
|
// src/components/Select/Select.module.css
|
|
9221
9223
|
var Select_module_default = {
|
|
9222
9224
|
"container--disabled": "dds-Select-module__container--disabled",
|
|
@@ -9759,6 +9761,47 @@ const createSelectOptions = (...args) => args.map((v) => ({
|
|
|
9759
9761
|
label: v,
|
|
9760
9762
|
value: v
|
|
9761
9763
|
}));
|
|
9764
|
+
// src/components/Pagination/Pagination.module.css
|
|
9765
|
+
var Pagination_module_default = { "truncation-icon": "dds-Pagination-module__truncation-icon" };
|
|
9766
|
+
// src/components/Pagination/paginationGenerator.tsx
|
|
9767
|
+
const arrayRange = (start, end) => {
|
|
9768
|
+
const length = end - start + 1;
|
|
9769
|
+
return Array.from({ length }, (_, idx) => idx + start);
|
|
9770
|
+
};
|
|
9771
|
+
function PaginationGenerator(pagesAmount, activePage) {
|
|
9772
|
+
const siblingsCount = 1;
|
|
9773
|
+
const maxPagesShown = 7;
|
|
9774
|
+
const pagesBeforeTruncator = 5;
|
|
9775
|
+
const truncator = "truncator";
|
|
9776
|
+
let pageRange;
|
|
9777
|
+
if (pagesAmount > 4) {
|
|
9778
|
+
const middleStartPage = Math.max(1, activePage < pagesBeforeTruncator || pagesAmount <= maxPagesShown ? 1 : activePage + siblingsCount + 1 >= pagesAmount ? pagesAmount - 4 : activePage > 4 && pagesAmount > maxPagesShown ? activePage - siblingsCount : 1);
|
|
9779
|
+
const middleEndOffset = activePage < pagesBeforeTruncator && pagesAmount > maxPagesShown ? pagesBeforeTruncator : activePage < pagesBeforeTruncator && pagesAmount <= maxPagesShown ? pagesAmount : activePage + siblingsCount + 1 < pagesAmount - 1 ? activePage + siblingsCount : activePage + siblingsCount + 1 === pagesAmount - 1 ? pagesAmount : pagesAmount;
|
|
9780
|
+
const middleEndPage = Math.min(pagesAmount, middleEndOffset);
|
|
9781
|
+
pageRange = arrayRange(middleStartPage, middleEndPage);
|
|
9782
|
+
const truncatedLeft = middleStartPage > 2 && pagesAmount > maxPagesShown;
|
|
9783
|
+
const truncatedRight = pagesAmount - middleEndPage > 1 && pagesAmount > maxPagesShown;
|
|
9784
|
+
if (truncatedLeft && truncatedRight) pageRange = [
|
|
9785
|
+
1,
|
|
9786
|
+
truncator,
|
|
9787
|
+
...pageRange,
|
|
9788
|
+
truncator,
|
|
9789
|
+
pagesAmount
|
|
9790
|
+
];
|
|
9791
|
+
else if (truncatedLeft && !truncatedRight) pageRange = [
|
|
9792
|
+
1,
|
|
9793
|
+
truncator,
|
|
9794
|
+
...pageRange
|
|
9795
|
+
];
|
|
9796
|
+
else if (!truncatedLeft && truncatedRight) pageRange = [
|
|
9797
|
+
...pageRange,
|
|
9798
|
+
truncator,
|
|
9799
|
+
pagesAmount
|
|
9800
|
+
];
|
|
9801
|
+
return [...pageRange];
|
|
9802
|
+
}
|
|
9803
|
+
return arrayRange(1, pagesAmount);
|
|
9804
|
+
}
|
|
9762
9805
|
// src/components/Pagination/Pagination.tsx
|
|
9763
9806
|
const Pagination = ({ itemsAmount, defaultItemsPerPage = 10, defaultActivePage = 1, activePage: activePageProp, withPagination = true, withCounter, withSelect, selectOptions, smallScreenBreakpoint, onChange, onSelectOptionChange, id, className, style, htmlProps, ref, ...rest }) => {
|
|
9764
9807
|
const { t } = useTranslation();
|
|
@@ -12372,11 +12415,11 @@ const Row = ({ type: _type, className, mode = "normal", children, ref, ...rest }
|
|
|
12372
12415
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
12373
12416
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(PlainRow, {
|
|
12374
12417
|
ref,
|
|
12375
|
-
...sharedRowProps(hideBelowCn),
|
|
12418
|
+
...sharedRowProps(cn(hideBelowCn, Table_module_default["standard-row"])),
|
|
12376
12419
|
children
|
|
12377
12420
|
}),
|
|
12378
12421
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(PlainRow, {
|
|
12379
|
-
...sharedRowProps(cn(hideAboveCn, !childrenCollapsed && Table_module_default["row--collapsible-header--open"])),
|
|
12422
|
+
...sharedRowProps(cn(hideAboveCn, Table_module_default["standard-row"], !childrenCollapsed && Table_module_default["row--collapsible-header--open"])),
|
|
12380
12423
|
children: [definingCells, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", {
|
|
12381
12424
|
className: Table_module_default["cell--right"],
|
|
12382
12425
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
|
|
@@ -12390,7 +12433,7 @@ const Row = ({ type: _type, className, mode = "normal", children, ref, ...rest }
|
|
|
12390
12433
|
})]
|
|
12391
12434
|
}),
|
|
12392
12435
|
!childrenCollapsed && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PlainRow, {
|
|
12393
|
-
...sharedRowProps(hideAboveCn),
|
|
12436
|
+
...sharedRowProps(cn(hideAboveCn, Table_module_default["dl-row"])),
|
|
12394
12437
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", {
|
|
12395
12438
|
colSpan: definingCells.length + 1,
|
|
12396
12439
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DescriptionList, { children: descriptionListItems })
|
|
@@ -13357,6 +13400,7 @@ exports.QuestionAnswerIcon = QuestionAnswerIcon;
|
|
|
13357
13400
|
exports.RadioButton = RadioButton;
|
|
13358
13401
|
exports.RadioButtonGroup = RadioButtonGroup;
|
|
13359
13402
|
exports.ReceiptIcon = ReceiptIcon;
|
|
13403
|
+
exports.RecorderIcon = RecorderIcon;
|
|
13360
13404
|
exports.RedoIcon = RedoIcon;
|
|
13361
13405
|
exports.RefreshIcon = RefreshIcon;
|
|
13362
13406
|
exports.ReplayIcon = ReplayIcon;
|