@norges-domstoler/dds-components 0.0.0-dev-20261109105927 → 0.0.0-dev-20261110082000
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 +443 -443
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +321 -321
- package/dist/index.d.cts +51 -51
- package/dist/index.d.mts +51 -51
- package/dist/index.mjs +443 -443
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
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,22 +1663,6 @@ const Backdrop = ({ isMounted, zIndex, ...props }) => {
|
|
|
1663
1663
|
});
|
|
1664
1664
|
};
|
|
1665
1665
|
Backdrop.displayName = "Backdrop";
|
|
1666
|
-
// src/components/helpers/Dropdown/DropdownItem.module.css
|
|
1667
|
-
var DropdownItem_module_default = {
|
|
1668
|
-
"item": "dds-DropdownItem-module__item",
|
|
1669
|
-
"default": "dds-DropdownItem-module__default",
|
|
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"
|
|
1681
|
-
};
|
|
1682
1666
|
// src/components/Typography/Typography/TextOverflowEllipsis/TextOverflowEllipsis.module.css
|
|
1683
1667
|
var TextOverflowEllipsis_module_default = {
|
|
1684
1668
|
"wrapper": "dds-TextOverflowEllipsis-module__wrapper",
|
|
@@ -1697,6 +1681,18 @@ function TextOverflowEllipsisInner({ className, ...rest }) {
|
|
|
1697
1681
|
className: cn(className, TextOverflowEllipsis_module_default.inner)
|
|
1698
1682
|
});
|
|
1699
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"
|
|
1695
|
+
};
|
|
1700
1696
|
// src/components/Typography/Typography/Typography.module.css
|
|
1701
1697
|
var Typography_module_default = { "container": "dds-Typography-module__container" };
|
|
1702
1698
|
// src/components/Typography/Typography/Typography.types.ts
|
|
@@ -1808,18 +1804,6 @@ const getColorCn = (color) => {
|
|
|
1808
1804
|
const [prefix] = color.split("-", 1);
|
|
1809
1805
|
return typographyStyles_module_default[`${prefix}-color--${color.slice(prefix.length + 1)}`] || null;
|
|
1810
1806
|
};
|
|
1811
|
-
// src/components/helpers/styling/focus.module.css
|
|
1812
|
-
const _key1 = "dds-focus-module__focusable";
|
|
1813
|
-
var focus_module_default = {
|
|
1814
|
-
"focused": "dds-focus-module__focused",
|
|
1815
|
-
"focusable": "dds-focus-module__focusable",
|
|
1816
|
-
"focusable-focus": "dds-focus-module__focusable-focus",
|
|
1817
|
-
"focusable-within": "dds-focus-module__focusable-within",
|
|
1818
|
-
"has-focusable-input": "dds-focus-module__has-focusable-input",
|
|
1819
|
-
"focusable-sibling": "dds-focus-module__focusable-sibling",
|
|
1820
|
-
"focus-styled-sibling": "dds-focus-module__focus-styled-sibling",
|
|
1821
|
-
"focusable--inset": "dds-focus-module__focusable--inset"
|
|
1822
|
-
};
|
|
1823
1807
|
// src/components/Typography/Typography/Typography.tsx
|
|
1824
1808
|
const isAnchorProps = (props) => props.typographyType === "a";
|
|
1825
1809
|
const Typography = (props) => {
|
|
@@ -1873,11 +1857,6 @@ const Heading = ({ id, className, style, htmlProps, children, typographyType, le
|
|
|
1873
1857
|
});
|
|
1874
1858
|
};
|
|
1875
1859
|
Heading.displayName = "Heading";
|
|
1876
|
-
// src/components/Typography/Label/Label.module.css
|
|
1877
|
-
var Label_module_default = {
|
|
1878
|
-
"read-only": "dds-Label-module__read-only",
|
|
1879
|
-
"read-only__icon": "dds-Label-module__read-only__icon"
|
|
1880
|
-
};
|
|
1881
1860
|
// src/components/Icon/Icon.tsx
|
|
1882
1861
|
const getSize = (iconSize) => {
|
|
1883
1862
|
switch (iconSize) {
|
|
@@ -3928,6 +3907,11 @@ var icons_exports = /* @__PURE__ */ __exportAll({
|
|
|
3928
3907
|
ZoomInIcon: () => ZoomInIcon,
|
|
3929
3908
|
ZoomOutIcon: () => ZoomOutIcon
|
|
3930
3909
|
});
|
|
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"
|
|
3914
|
+
};
|
|
3931
3915
|
// src/components/Typography/Label/Label.tsx
|
|
3932
3916
|
const Label = ({ showRequiredStyling, readOnly, id, className, style, htmlProps, children, afterLabelContent, ...rest }) => {
|
|
3933
3917
|
const content = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
@@ -3991,6 +3975,14 @@ const Paragraph = ({ id, className, style, htmlProps, children, typographyType =
|
|
|
3991
3975
|
});
|
|
3992
3976
|
};
|
|
3993
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
|
+
};
|
|
3994
3986
|
const Badge = ({ id, className, style, htmlProps, purpose = "notification", size = "medium", children, max = 9, showZero = false, ...rest }) => {
|
|
3995
3987
|
const hasChildren = !!children || showZero && children === 0;
|
|
3996
3988
|
const heightVariant = hasChildren ? "withChildren" : "noChildren";
|
|
@@ -4035,13 +4027,6 @@ const Badge = ({ id, className, style, htmlProps, purpose = "notification", size
|
|
|
4035
4027
|
});
|
|
4036
4028
|
};
|
|
4037
4029
|
Badge.displayName = "Badge";
|
|
4038
|
-
// src/components/Spinner/Spinner.module.css
|
|
4039
|
-
var Spinner_module_default = {
|
|
4040
|
-
"svg": "dds-Spinner-module__svg",
|
|
4041
|
-
"jordskifterett": "dds-Spinner-module__jordskifterett",
|
|
4042
|
-
"lagmannsrett": "dds-Spinner-module__lagmannsrett",
|
|
4043
|
-
"tingrett": "dds-Spinner-module__tingrett"
|
|
4044
|
-
};
|
|
4045
4030
|
// src/i18n/LanguageProvider.tsx
|
|
4046
4031
|
const LanguageContext = (0, react.createContext)(void 0);
|
|
4047
4032
|
function LanguageProvider({ language, children }) {
|
|
@@ -4133,6 +4118,13 @@ const commonTexts = createTexts({
|
|
|
4133
4118
|
se: `Siidu ${current} ${max}`
|
|
4134
4119
|
})
|
|
4135
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
|
+
};
|
|
4136
4128
|
// src/components/Spinner/Spinner.tsx
|
|
4137
4129
|
function Spinner(props) {
|
|
4138
4130
|
const { size = "var(--dds-size-6)", color = "icon-action-resting", tooltip, id, className, htmlProps, style, ...rest } = props;
|
|
@@ -4174,6 +4166,14 @@ function Spinner(props) {
|
|
|
4174
4166
|
});
|
|
4175
4167
|
}
|
|
4176
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
4177
|
// src/components/helpers/Dropdown/DropdownItem.tsx
|
|
4178
4178
|
const DropdownItem = ({ icon, className, children: propChildren, purpose = "default", loading, loadingTooltip, badgeProps, ...rest }) => {
|
|
4179
4179
|
const itemCns = [
|
|
@@ -4538,8 +4538,14 @@ const Breadcrumb = ({ children, ref, ...rest }) => {
|
|
|
4538
4538
|
});
|
|
4539
4539
|
};
|
|
4540
4540
|
Breadcrumb.displayName = "Breadcrumb";
|
|
4541
|
-
// src/components/
|
|
4542
|
-
|
|
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
|
+
};
|
|
4543
4549
|
// src/components/Button/Button.module.css
|
|
4544
4550
|
var Button_module_default = {
|
|
4545
4551
|
"button": "dds-Button-module__button",
|
|
@@ -4564,14 +4570,6 @@ var Button_module_default = {
|
|
|
4564
4570
|
"button--primary-danger": "dds-Button-module__button--primary-danger",
|
|
4565
4571
|
"button--secondary-danger": "dds-Button-module__button--secondary-danger"
|
|
4566
4572
|
};
|
|
4567
|
-
// src/components/ButtonGroup/ButtonGroup.context.tsx
|
|
4568
|
-
const ButtonGroupContext = (0, react.createContext)({});
|
|
4569
|
-
const useButtonGroupContext = () => (0, react.useContext)(ButtonGroupContext);
|
|
4570
|
-
// src/components/helpers/styling/common.module.css
|
|
4571
|
-
var common_module_default = {
|
|
4572
|
-
"badge--on-corner": "dds-common-module__badge--on-corner",
|
|
4573
|
-
"button": "dds-common-module__button"
|
|
4574
|
-
};
|
|
4575
4573
|
// src/components/Button/Button.tsx
|
|
4576
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 }) => {
|
|
4577
4575
|
const { purpose: groupPurpose, size: groupSize } = useButtonGroupContext();
|
|
@@ -4761,6 +4759,14 @@ const OverflowMenuLink = ({ onClick, ref, ...rest }) => {
|
|
|
4761
4759
|
}) });
|
|
4762
4760
|
};
|
|
4763
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";
|
|
4764
4770
|
// src/components/Toggle/Toggle.module.css
|
|
4765
4771
|
var Toggle_module_default = {
|
|
4766
4772
|
"label": "dds-Toggle-module__label",
|
|
@@ -4776,14 +4782,6 @@ var Toggle_module_default = {
|
|
|
4776
4782
|
"label--disabled": "dds-Toggle-module__label--disabled",
|
|
4777
4783
|
"label--read-only": "dds-Toggle-module__label--read-only"
|
|
4778
4784
|
};
|
|
4779
|
-
// src/components/VisuallyHidden/VisuallyHidden.tsx
|
|
4780
|
-
const VisuallyHidden = ({ id, as: asProp, className, style, htmlProps, ...rest }) => {
|
|
4781
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ElementAs, {
|
|
4782
|
-
as: asProp ?? "span",
|
|
4783
|
-
...getBaseHTMLProps(id, cn(className, utilStyles_module_default["visually-hidden"]), style, htmlProps, rest)
|
|
4784
|
-
});
|
|
4785
|
-
};
|
|
4786
|
-
VisuallyHidden.displayName = "VisuallyHidden";
|
|
4787
4785
|
const Toggle = ({ id, children, size = "medium", checked: checkedProp, defaultChecked, onChange, disabled, readOnly, isLoading, className, style, htmlProps = {}, ...rest }) => {
|
|
4788
4786
|
const { t } = useTranslation();
|
|
4789
4787
|
const generatedId = (0, react.useId)();
|
|
@@ -4959,6 +4957,8 @@ const OverflowMenuGroup = ({ children, onClose, onOpen, setIsOpen: propSetIsOpen
|
|
|
4959
4957
|
});
|
|
4960
4958
|
};
|
|
4961
4959
|
OverflowMenuGroup.displayName = "OverflowMenuGroup";
|
|
4960
|
+
// src/components/Breadcrumbs/Breadcrumbs.module.css
|
|
4961
|
+
var Breadcrumbs_module_default = { "icon": "dds-Breadcrumbs-module__icon" };
|
|
4962
4962
|
// src/components/Breadcrumbs/Breadcrumbs.tsx
|
|
4963
4963
|
const Breadcrumbs = ({ children, smallScreenBreakpoint, id, className, style, htmlProps, ...rest }) => {
|
|
4964
4964
|
const chevronIcon = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, {
|
|
@@ -5174,14 +5174,6 @@ const CardExpandableBody = ({ children, className, style, htmlProps, padding, ..
|
|
|
5174
5174
|
});
|
|
5175
5175
|
};
|
|
5176
5176
|
CardExpandableBody.displayName = "CardExpandableBody";
|
|
5177
|
-
// src/components/Card/CardSelectionControl/CardSelectable.context.tsx
|
|
5178
|
-
const CardSelectableContext = (0, react.createContext)({});
|
|
5179
|
-
const useCardSelectableContext = () => (0, react.useContext)(CardSelectableContext);
|
|
5180
|
-
// src/components/SelectionControl/Checkbox/CheckboxGroupContext.tsx
|
|
5181
|
-
const CheckboxGroupContext = (0, react.createContext)(null);
|
|
5182
|
-
const useCheckboxGroup = () => {
|
|
5183
|
-
return (0, react.useContext)(CheckboxGroupContext);
|
|
5184
|
-
};
|
|
5185
5177
|
// src/components/SelectionControl/SelectionControl.module.css
|
|
5186
5178
|
var SelectionControl_module_default = {
|
|
5187
5179
|
"container": "dds-SelectionControl-module__container",
|
|
@@ -5239,6 +5231,11 @@ const renderGroupLabel = ({ id, showRequiredStyling, readOnly, label }) => {
|
|
|
5239
5231
|
});
|
|
5240
5232
|
else return null;
|
|
5241
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
|
+
};
|
|
5242
5239
|
// src/components/SelectionControl/Checkbox/Checkbox.tsx
|
|
5243
5240
|
const Checkbox = ({ id, name, label, error = false, disabled, readOnly, indeterminate, "aria-describedby": ariaDescribedby, className, htmlProps = {}, style, children, size, ...rest }) => {
|
|
5244
5241
|
const generatedId = (0, react.useId)();
|
|
@@ -5523,6 +5520,9 @@ const RadioButtonGroup = ({ name, label, groupId, errorMessage, tip, disabled =
|
|
|
5523
5520
|
});
|
|
5524
5521
|
};
|
|
5525
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);
|
|
5526
5526
|
// src/components/Card/CardSelectionControl/CardSelectable.tsx
|
|
5527
5527
|
const CardSelectable = (props) => {
|
|
5528
5528
|
const { appearance = "filled", cardType: cardTypeProp, id, padding, controlPlacementProps = {}, "aria-describedby": ariaDescribedby, className, htmlProps, style, ...rest } = props;
|
|
@@ -5618,14 +5618,6 @@ const CardSelectableGroup = ({ name, cardType, errorMessage, disabled, readOnly,
|
|
|
5618
5618
|
})] }) : mainContent;
|
|
5619
5619
|
};
|
|
5620
5620
|
CardSelectableGroup.displayName = "CardSelectableGroup";
|
|
5621
|
-
// src/components/Chip/Chip.module.css
|
|
5622
|
-
var Chip_module_default = {
|
|
5623
|
-
"container": "dds-Chip-module__container",
|
|
5624
|
-
"selection-control": "dds-Chip-module__selection-control",
|
|
5625
|
-
"removable": "dds-Chip-module__removable",
|
|
5626
|
-
"selection-control-spacing": "dds-Chip-module__selection-control-spacing",
|
|
5627
|
-
"selection-control--no-indicator": "dds-Chip-module__selection-control--no-indicator"
|
|
5628
|
-
};
|
|
5629
5621
|
// src/components/helpers/Input/Input.module.css
|
|
5630
5622
|
var Input_module_default = {
|
|
5631
5623
|
"container": "dds-Input-module__container",
|
|
@@ -5676,6 +5668,25 @@ var Input_module_default = {
|
|
|
5676
5668
|
"input-group__absolute-el--small": "dds-Input-module__input-group__absolute-el--small",
|
|
5677
5669
|
"input-group__absolute-el--xsmall": "dds-Input-module__input-group__absolute-el--xsmall"
|
|
5678
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
|
+
};
|
|
5679
5690
|
const ChipBase = ({ htmlProps, size = "medium", id, className, style, children, icon, ...rest }) => {
|
|
5680
5691
|
const hasIcon = !!icon;
|
|
5681
5692
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Paper, {
|
|
@@ -5932,128 +5943,40 @@ var DateInput_module_default = {
|
|
|
5932
5943
|
"calendar__cell-button--selected": "dds-DateInput-module__calendar__cell-button--selected",
|
|
5933
5944
|
"calendar__cell-button--unavailable--today": "dds-DateInput-module__calendar__cell-button--unavailable--today"
|
|
5934
5945
|
};
|
|
5935
|
-
// src/components/date-inputs/DatePicker/
|
|
5936
|
-
|
|
5937
|
-
|
|
5938
|
-
|
|
5939
|
-
|
|
5940
|
-
|
|
5946
|
+
// src/components/date-inputs/DatePicker/CalendarPopover.tsx
|
|
5947
|
+
const CalendarPopoverContext = (0, react.createContext)({
|
|
5948
|
+
anchorRef: null,
|
|
5949
|
+
closeButtonRef: null,
|
|
5950
|
+
isOpen: false,
|
|
5951
|
+
onClose: () => null,
|
|
5952
|
+
showWeekNumbers: true,
|
|
5953
|
+
closeOtherCalendars: () => null
|
|
5954
|
+
});
|
|
5955
|
+
const CalendarPopover = ({ children, onClose, ...props }) => {
|
|
5956
|
+
const anchorRef = (0, react.useRef)(null);
|
|
5957
|
+
const closeButtonRef = (0, react.useRef)(null);
|
|
5958
|
+
useOnKeyDown("Escape", onClose);
|
|
5959
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CalendarPopoverContext, {
|
|
5960
|
+
value: {
|
|
5961
|
+
anchorRef,
|
|
5962
|
+
closeButtonRef,
|
|
5963
|
+
onClose,
|
|
5964
|
+
...props
|
|
5965
|
+
},
|
|
5966
|
+
children
|
|
5941
5967
|
});
|
|
5942
|
-
}
|
|
5943
|
-
CalendarCell.displayName = "CalendarCell";
|
|
5944
|
-
// src/components/date-inputs/DatePicker/constants.ts
|
|
5945
|
-
const LOCALE = {
|
|
5946
|
-
nb: "nb-NO",
|
|
5947
|
-
no: "no-NO",
|
|
5948
|
-
nn: "nn-NO",
|
|
5949
|
-
en: "en-GB",
|
|
5950
|
-
se: "se-NO"
|
|
5951
5968
|
};
|
|
5952
|
-
|
|
5953
|
-
|
|
5954
|
-
|
|
5955
|
-
|
|
5956
|
-
|
|
5957
|
-
|
|
5958
|
-
|
|
5959
|
-
|
|
5960
|
-
|
|
5961
|
-
|
|
5962
|
-
|
|
5963
|
-
...cellProps,
|
|
5964
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Box, {
|
|
5965
|
-
...buttonProps,
|
|
5966
|
-
as: "button",
|
|
5967
|
-
type: "button",
|
|
5968
|
-
ref,
|
|
5969
|
-
onKeyDown: closeOnKeyboardBlurForward,
|
|
5970
|
-
height: "100%",
|
|
5971
|
-
width: "100%",
|
|
5972
|
-
display: "flex",
|
|
5973
|
-
alignItems: "center",
|
|
5974
|
-
justifyContent: "center",
|
|
5975
|
-
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),
|
|
5976
|
-
children: formattedDate
|
|
5977
|
-
})
|
|
5978
|
-
});
|
|
5979
|
-
}
|
|
5980
|
-
CalendarDate$1.displayName = "CalendarDate";
|
|
5981
|
-
// src/components/date-inputs/utils/getWeekNumber.ts
|
|
5982
|
-
/**
|
|
5983
|
-
* Calculates the week number following the ISO-8601 format.
|
|
5984
|
-
* @returns week number, 1 indexed
|
|
5985
|
-
*/
|
|
5986
|
-
function getWeekNumber(date) {
|
|
5987
|
-
const dayOfWeek = getDayOfWeek(date);
|
|
5988
|
-
const dayOfYear = getDayOfYear(date);
|
|
5989
|
-
const jan1DayOfWeek = getDayOfWeek((0, _internationalized_date.startOfYear)(date));
|
|
5990
|
-
if (dayOfYear <= 8 - jan1DayOfWeek && jan1DayOfWeek > 4) {
|
|
5991
|
-
if (jan1DayOfWeek === 5 || jan1DayOfWeek === 6 && isLeapYear(date.subtract({ years: 1 }))) return 53;
|
|
5992
|
-
return 52;
|
|
5993
|
-
}
|
|
5994
|
-
if (getDayOfYear((0, _internationalized_date.endOfYear)(date)) - dayOfYear < 4 - dayOfWeek) return 1;
|
|
5995
|
-
const weekNum = (dayOfYear + (7 - dayOfWeek) + (jan1DayOfWeek - 1)) / 7;
|
|
5996
|
-
if (jan1DayOfWeek > 4) return weekNum - 1;
|
|
5997
|
-
return weekNum;
|
|
5998
|
-
}
|
|
5999
|
-
/**
|
|
6000
|
-
* Mon = 1
|
|
6001
|
-
* Tue = 2
|
|
6002
|
-
* Wed = 3
|
|
6003
|
-
* Thu = 4
|
|
6004
|
-
* Fri = 5
|
|
6005
|
-
* Sat = 6
|
|
6006
|
-
* Sun = 7
|
|
6007
|
-
* @returns day of week, 1 indexed
|
|
6008
|
-
*/
|
|
6009
|
-
function getDayOfWeek(date) {
|
|
6010
|
-
const weekStart = (0, _internationalized_date.startOfWeek)(date, "no-NO");
|
|
6011
|
-
return date.calendar.toJulianDay(date) - weekStart.calendar.toJulianDay(weekStart) + 1;
|
|
6012
|
-
}
|
|
6013
|
-
/**
|
|
6014
|
-
* @returns day of year, 1 indexed
|
|
6015
|
-
*/
|
|
6016
|
-
function getDayOfYear(date) {
|
|
6017
|
-
const yearStart = (0, _internationalized_date.startOfYear)(date);
|
|
6018
|
-
return date.calendar.toJulianDay(date) - yearStart.calendar.toJulianDay(yearStart) + 1;
|
|
6019
|
-
}
|
|
6020
|
-
function isLeapYear(date) {
|
|
6021
|
-
return date.year % 4 === 0 && date.year % 100 !== 0 || date.year % 400 === 0;
|
|
6022
|
-
}
|
|
6023
|
-
// src/components/date-inputs/DatePicker/CalendarPopover.tsx
|
|
6024
|
-
const CalendarPopoverContext = (0, react.createContext)({
|
|
6025
|
-
anchorRef: null,
|
|
6026
|
-
closeButtonRef: null,
|
|
6027
|
-
isOpen: false,
|
|
6028
|
-
onClose: () => null,
|
|
6029
|
-
showWeekNumbers: true,
|
|
6030
|
-
closeOtherCalendars: () => null
|
|
6031
|
-
});
|
|
6032
|
-
const CalendarPopover = ({ children, onClose, ...props }) => {
|
|
6033
|
-
const anchorRef = (0, react.useRef)(null);
|
|
6034
|
-
const closeButtonRef = (0, react.useRef)(null);
|
|
6035
|
-
useOnKeyDown("Escape", onClose);
|
|
6036
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CalendarPopoverContext, {
|
|
6037
|
-
value: {
|
|
6038
|
-
anchorRef,
|
|
6039
|
-
closeButtonRef,
|
|
6040
|
-
onClose,
|
|
6041
|
-
...props
|
|
6042
|
-
},
|
|
6043
|
-
children
|
|
6044
|
-
});
|
|
6045
|
-
};
|
|
6046
|
-
const CalendarPopoverAnchor = ({ children }) => {
|
|
6047
|
-
const { anchorRef, closeOtherCalendars } = (0, react.useContext)(CalendarPopoverContext);
|
|
6048
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
6049
|
-
ref: anchorRef ?? void 0,
|
|
6050
|
-
onFocusCapture: closeOtherCalendars,
|
|
6051
|
-
onMouseDown: closeOtherCalendars,
|
|
6052
|
-
onPointerDown: closeOtherCalendars,
|
|
6053
|
-
children
|
|
6054
|
-
});
|
|
6055
|
-
};
|
|
6056
|
-
const CalendarPopoverContent = ({ children, className, smallScreenBreakpoint }) => {
|
|
5969
|
+
const CalendarPopoverAnchor = ({ children }) => {
|
|
5970
|
+
const { anchorRef, closeOtherCalendars } = (0, react.useContext)(CalendarPopoverContext);
|
|
5971
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
5972
|
+
ref: anchorRef ?? void 0,
|
|
5973
|
+
onFocusCapture: closeOtherCalendars,
|
|
5974
|
+
onMouseDown: closeOtherCalendars,
|
|
5975
|
+
onPointerDown: closeOtherCalendars,
|
|
5976
|
+
children
|
|
5977
|
+
});
|
|
5978
|
+
};
|
|
5979
|
+
const CalendarPopoverContent = ({ children, className, smallScreenBreakpoint }) => {
|
|
6057
5980
|
const ref = (0, react.useRef)(null);
|
|
6058
5981
|
const modalRef = (0, react.useRef)(null);
|
|
6059
5982
|
const { refs, styles: floatingStyles } = useFloatPosition(null, { placement: "bottom-start" });
|
|
@@ -6120,6 +6043,94 @@ const CalendarPopoverContent = ({ children, className, smallScreenBreakpoint })
|
|
|
6120
6043
|
children
|
|
6121
6044
|
})] });
|
|
6122
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";
|
|
6123
6134
|
// src/components/date-inputs/DatePicker/Calendar/CalendarGrid.tsx
|
|
6124
6135
|
function CalendarGrid({ state, ...props }) {
|
|
6125
6136
|
const { t } = useTranslation();
|
|
@@ -6383,99 +6394,22 @@ const texts$24 = createTexts({
|
|
|
6383
6394
|
se: "Ovddit mánu"
|
|
6384
6395
|
}
|
|
6385
6396
|
});
|
|
6386
|
-
// src/components/date-inputs/
|
|
6387
|
-
function
|
|
6388
|
-
const
|
|
6389
|
-
|
|
6390
|
-
|
|
6391
|
-
|
|
6392
|
-
|
|
6393
|
-
|
|
6394
|
-
|
|
6395
|
-
|
|
6396
|
-
size: componentSize,
|
|
6397
|
-
purpose: "tertiary",
|
|
6398
|
-
disabled: props.isDisabled
|
|
6399
|
-
});
|
|
6400
|
-
}
|
|
6401
|
-
// src/components/date-inputs/DatePicker/DateField/DateField.utils.tsx
|
|
6402
|
-
function formatDateFieldSegments(segments) {
|
|
6403
|
-
const { t } = useTranslation();
|
|
6404
|
-
const daySegment = segments.find((segment) => segment.type === "day");
|
|
6405
|
-
const monthSegment = segments.find((segment) => segment.type === "month");
|
|
6406
|
-
const yearSegment = segments.find((segment) => segment.type === "year");
|
|
6407
|
-
const separatorSegment = segments.find((segment) => segment.type === "literal");
|
|
6408
|
-
if (!daySegment || !monthSegment || !yearSegment || !separatorSegment) throw new Error("Invalid date field segments");
|
|
6409
|
-
const formattedDaySegment = {
|
|
6410
|
-
...daySegment,
|
|
6411
|
-
text: daySegment.text.padStart(2, "0"),
|
|
6412
|
-
placeholder: t(texts$23.dayPlaceholder)
|
|
6413
|
-
};
|
|
6414
|
-
const formattedMonthSegment = {
|
|
6415
|
-
...monthSegment,
|
|
6416
|
-
text: monthSegment.text.padStart(2, "0"),
|
|
6417
|
-
placeholder: t(texts$23.monthPlaceholder)
|
|
6418
|
-
};
|
|
6419
|
-
const formattedYearSegment = {
|
|
6420
|
-
...yearSegment,
|
|
6421
|
-
placeholder: t(texts$23.yearPlaceholder)
|
|
6422
|
-
};
|
|
6423
|
-
const formattedSeparatorSegment = {
|
|
6424
|
-
...separatorSegment,
|
|
6425
|
-
text: "."
|
|
6426
|
-
};
|
|
6427
|
-
return [
|
|
6428
|
-
formattedDaySegment,
|
|
6429
|
-
formattedSeparatorSegment,
|
|
6430
|
-
formattedMonthSegment,
|
|
6431
|
-
formattedSeparatorSegment,
|
|
6432
|
-
formattedYearSegment
|
|
6433
|
-
];
|
|
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;
|
|
6434
6407
|
}
|
|
6435
|
-
|
|
6436
|
-
|
|
6437
|
-
|
|
6438
|
-
|
|
6439
|
-
nn: "dd",
|
|
6440
|
-
en: "dd",
|
|
6441
|
-
se: "jj"
|
|
6442
|
-
},
|
|
6443
|
-
monthPlaceholder: {
|
|
6444
|
-
nb: "mm",
|
|
6445
|
-
no: "mm",
|
|
6446
|
-
nn: "mm",
|
|
6447
|
-
en: "mm",
|
|
6448
|
-
se: "mm"
|
|
6449
|
-
},
|
|
6450
|
-
yearPlaceholder: {
|
|
6451
|
-
nb: "åååå",
|
|
6452
|
-
no: "åååå",
|
|
6453
|
-
nn: "åååå",
|
|
6454
|
-
en: "yyyy",
|
|
6455
|
-
se: "jjjj"
|
|
6456
|
-
}
|
|
6457
|
-
});
|
|
6458
|
-
// src/components/date-inputs/DatePicker/DateField/DateSegment.tsx
|
|
6459
|
-
function DateSegment({ segment, state, componentSize, errorMessageId, tipId }) {
|
|
6460
|
-
const ref = (0, react.useRef)(null);
|
|
6461
|
-
const { segmentProps } = (0, _react_aria_datepicker.useDateSegment)(segment, state, ref);
|
|
6462
|
-
const isSeparator = segment.type === "literal";
|
|
6463
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Box, {
|
|
6464
|
-
...segmentProps,
|
|
6465
|
-
marginBlock: "auto",
|
|
6466
|
-
marginInline: isSeparator ? "-0.15ch" : void 0,
|
|
6467
|
-
"aria-describedby": spaceSeparatedIdListGenerator([errorMessageId ? errorMessageId : void 0, tipId ? tipId : void 0]),
|
|
6468
|
-
ref,
|
|
6469
|
-
className: cn(segmentProps.className, DateInput_module_default.segment, typographyStyles_module_default[`body-short-${componentSize}`]),
|
|
6470
|
-
style: { ...segmentProps.style },
|
|
6471
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
6472
|
-
"aria-hidden": "true",
|
|
6473
|
-
className: cn(DateInput_module_default.segment__placeholder, !segment.isPlaceholder && DateInput_module_default["segment__placeholder--invisible"]),
|
|
6474
|
-
children: segment.placeholder
|
|
6475
|
-
}), segment.isPlaceholder ? "" : segment.text]
|
|
6476
|
-
});
|
|
6408
|
+
function createDOMRef(ref) {
|
|
6409
|
+
return { UNSAFE_getDOMNode() {
|
|
6410
|
+
return ref.current;
|
|
6411
|
+
} };
|
|
6477
6412
|
}
|
|
6478
|
-
DateSegment.displayName = "DateSegment";
|
|
6479
6413
|
// src/components/helpers/ClearButton/ClearButton.tsx
|
|
6480
6414
|
const ClearButton = ({ className, absolute = true, hasIconToRight, size = "medium", ...rest }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Box, {
|
|
6481
6415
|
as: Button,
|
|
@@ -6564,7 +6498,100 @@ function DateInput({ errorMessage, tip, componentSize = "medium", style, classNa
|
|
|
6564
6498
|
]
|
|
6565
6499
|
});
|
|
6566
6500
|
}
|
|
6567
|
-
DateInput.displayName = "DateInput";
|
|
6501
|
+
DateInput.displayName = "DateInput";
|
|
6502
|
+
// src/components/date-inputs/DatePicker/DateField/CalendarButton.tsx
|
|
6503
|
+
function CalendarButton({ componentSize = "medium", isReadOnly, ...props }) {
|
|
6504
|
+
const ref = (0, react.useRef)(null);
|
|
6505
|
+
const { buttonProps } = (0, _react_aria_button.useButton)(props, ref);
|
|
6506
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
|
|
6507
|
+
...buttonProps,
|
|
6508
|
+
ref,
|
|
6509
|
+
type: "button",
|
|
6510
|
+
className: cn(buttonProps.className, DateInput_module_default["popover-button"], isReadOnly && DateInput_module_default["popover-button--readonly"], !props.isDisabled && "dds-focus-module__focusable", Input_module_default["input-group__absolute-el"], Button_module_default.clear),
|
|
6511
|
+
icon: CalendarIcon,
|
|
6512
|
+
size: componentSize,
|
|
6513
|
+
purpose: "tertiary",
|
|
6514
|
+
disabled: props.isDisabled
|
|
6515
|
+
});
|
|
6516
|
+
}
|
|
6517
|
+
// src/components/date-inputs/DatePicker/DateField/DateField.utils.tsx
|
|
6518
|
+
function formatDateFieldSegments(segments) {
|
|
6519
|
+
const { t } = useTranslation();
|
|
6520
|
+
const daySegment = segments.find((segment) => segment.type === "day");
|
|
6521
|
+
const monthSegment = segments.find((segment) => segment.type === "month");
|
|
6522
|
+
const yearSegment = segments.find((segment) => segment.type === "year");
|
|
6523
|
+
const separatorSegment = segments.find((segment) => segment.type === "literal");
|
|
6524
|
+
if (!daySegment || !monthSegment || !yearSegment || !separatorSegment) throw new Error("Invalid date field segments");
|
|
6525
|
+
const formattedDaySegment = {
|
|
6526
|
+
...daySegment,
|
|
6527
|
+
text: daySegment.text.padStart(2, "0"),
|
|
6528
|
+
placeholder: t(texts$23.dayPlaceholder)
|
|
6529
|
+
};
|
|
6530
|
+
const formattedMonthSegment = {
|
|
6531
|
+
...monthSegment,
|
|
6532
|
+
text: monthSegment.text.padStart(2, "0"),
|
|
6533
|
+
placeholder: t(texts$23.monthPlaceholder)
|
|
6534
|
+
};
|
|
6535
|
+
const formattedYearSegment = {
|
|
6536
|
+
...yearSegment,
|
|
6537
|
+
placeholder: t(texts$23.yearPlaceholder)
|
|
6538
|
+
};
|
|
6539
|
+
const formattedSeparatorSegment = {
|
|
6540
|
+
...separatorSegment,
|
|
6541
|
+
text: "."
|
|
6542
|
+
};
|
|
6543
|
+
return [
|
|
6544
|
+
formattedDaySegment,
|
|
6545
|
+
formattedSeparatorSegment,
|
|
6546
|
+
formattedMonthSegment,
|
|
6547
|
+
formattedSeparatorSegment,
|
|
6548
|
+
formattedYearSegment
|
|
6549
|
+
];
|
|
6550
|
+
}
|
|
6551
|
+
const texts$23 = createTexts({
|
|
6552
|
+
dayPlaceholder: {
|
|
6553
|
+
nb: "dd",
|
|
6554
|
+
no: "dd",
|
|
6555
|
+
nn: "dd",
|
|
6556
|
+
en: "dd",
|
|
6557
|
+
se: "jj"
|
|
6558
|
+
},
|
|
6559
|
+
monthPlaceholder: {
|
|
6560
|
+
nb: "mm",
|
|
6561
|
+
no: "mm",
|
|
6562
|
+
nn: "mm",
|
|
6563
|
+
en: "mm",
|
|
6564
|
+
se: "mm"
|
|
6565
|
+
},
|
|
6566
|
+
yearPlaceholder: {
|
|
6567
|
+
nb: "åååå",
|
|
6568
|
+
no: "åååå",
|
|
6569
|
+
nn: "åååå",
|
|
6570
|
+
en: "yyyy",
|
|
6571
|
+
se: "jjjj"
|
|
6572
|
+
}
|
|
6573
|
+
});
|
|
6574
|
+
// src/components/date-inputs/DatePicker/DateField/DateSegment.tsx
|
|
6575
|
+
function DateSegment({ segment, state, componentSize, errorMessageId, tipId }) {
|
|
6576
|
+
const ref = (0, react.useRef)(null);
|
|
6577
|
+
const { segmentProps } = (0, _react_aria_datepicker.useDateSegment)(segment, state, ref);
|
|
6578
|
+
const isSeparator = segment.type === "literal";
|
|
6579
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Box, {
|
|
6580
|
+
...segmentProps,
|
|
6581
|
+
marginBlock: "auto",
|
|
6582
|
+
marginInline: isSeparator ? "-0.15ch" : void 0,
|
|
6583
|
+
"aria-describedby": spaceSeparatedIdListGenerator([errorMessageId ? errorMessageId : void 0, tipId ? tipId : void 0]),
|
|
6584
|
+
ref,
|
|
6585
|
+
className: cn(segmentProps.className, DateInput_module_default.segment, typographyStyles_module_default[`body-short-${componentSize}`]),
|
|
6586
|
+
style: { ...segmentProps.style },
|
|
6587
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
6588
|
+
"aria-hidden": "true",
|
|
6589
|
+
className: cn(DateInput_module_default.segment__placeholder, !segment.isPlaceholder && DateInput_module_default["segment__placeholder--invisible"]),
|
|
6590
|
+
children: segment.placeholder
|
|
6591
|
+
}), segment.isPlaceholder ? "" : segment.text]
|
|
6592
|
+
});
|
|
6593
|
+
}
|
|
6594
|
+
DateSegment.displayName = "DateSegment";
|
|
6568
6595
|
// src/components/date-inputs/DatePicker/DateField/DateField.tsx
|
|
6569
6596
|
function DateField({ componentSize = "medium", buttonProps, groupProps, ref, clearable, errorMessageId, tipId, ...props }) {
|
|
6570
6597
|
const { locale } = (0, _react_aria_i18n.useLocale)();
|
|
@@ -6631,22 +6658,6 @@ const texts$22 = createTexts({ clearDate: {
|
|
|
6631
6658
|
nn: "Tøm dato",
|
|
6632
6659
|
se: "Gurre dáhtona"
|
|
6633
6660
|
} });
|
|
6634
|
-
// src/components/date-inputs/utils/useFocusManagerRef.ts
|
|
6635
|
-
function useFocusManagerRef(ref) {
|
|
6636
|
-
const domRef = (0, react.useRef)(null);
|
|
6637
|
-
(0, react.useImperativeHandle)(ref, () => ({
|
|
6638
|
-
...createDOMRef(domRef),
|
|
6639
|
-
focus() {
|
|
6640
|
-
(0, _react_aria_focus.createFocusManager)(domRef).focusFirst({ tabbable: true });
|
|
6641
|
-
}
|
|
6642
|
-
}));
|
|
6643
|
-
return domRef;
|
|
6644
|
-
}
|
|
6645
|
-
function createDOMRef(ref) {
|
|
6646
|
-
return { UNSAFE_getDOMNode() {
|
|
6647
|
-
return ref.current;
|
|
6648
|
-
} };
|
|
6649
|
-
}
|
|
6650
6661
|
// src/components/date-inputs/DatePicker/DatePicker.tsx
|
|
6651
6662
|
const refIsFocusable = (ref) => {
|
|
6652
6663
|
return typeof ref === "object" && ref !== null && "focus" in ref;
|
|
@@ -6857,21 +6868,6 @@ const DescriptionListGroup = ({ children, margin, minWidth, maxWidth, id, classN
|
|
|
6857
6868
|
children
|
|
6858
6869
|
});
|
|
6859
6870
|
DescriptionListGroup.displayName = "DescriptionListGroup";
|
|
6860
|
-
// src/components/DetailList/DetailList.context.tsx
|
|
6861
|
-
const DetailListContext = (0, react.createContext)({});
|
|
6862
|
-
const useDetailListContext = () => (0, react.useContext)(DetailListContext);
|
|
6863
|
-
// src/components/DetailList/DetailList.module.css
|
|
6864
|
-
var DetailList_module_default = {
|
|
6865
|
-
"list": "dds-DetailList-module__list",
|
|
6866
|
-
"list--striped-with-bp": "dds-DetailList-module__list--striped-with-bp",
|
|
6867
|
-
"row": "dds-DetailList-module__row",
|
|
6868
|
-
"list--small": "dds-DetailList-module__list--small",
|
|
6869
|
-
"list--medium": "dds-DetailList-module__list--medium",
|
|
6870
|
-
"list--large": "dds-DetailList-module__list--large",
|
|
6871
|
-
"column": "dds-DetailList-module__column",
|
|
6872
|
-
"cell": "dds-DetailList-module__cell",
|
|
6873
|
-
"term": "dds-DetailList-module__term"
|
|
6874
|
-
};
|
|
6875
6871
|
// src/components/Table/Table.module.css
|
|
6876
6872
|
var Table_module_default = {
|
|
6877
6873
|
"wrapper": "dds-Table-module__wrapper",
|
|
@@ -6898,6 +6894,21 @@ var Table_module_default = {
|
|
|
6898
6894
|
"sort-button": "dds-Table-module__sort-button",
|
|
6899
6895
|
"filter-cell": "dds-Table-module__filter-cell"
|
|
6900
6896
|
};
|
|
6897
|
+
// src/components/DetailList/DetailList.context.tsx
|
|
6898
|
+
const DetailListContext = (0, react.createContext)({});
|
|
6899
|
+
const useDetailListContext = () => (0, react.useContext)(DetailListContext);
|
|
6900
|
+
// src/components/DetailList/DetailList.module.css
|
|
6901
|
+
var DetailList_module_default = {
|
|
6902
|
+
"list": "dds-DetailList-module__list",
|
|
6903
|
+
"list--striped-with-bp": "dds-DetailList-module__list--striped-with-bp",
|
|
6904
|
+
"row": "dds-DetailList-module__row",
|
|
6905
|
+
"list--small": "dds-DetailList-module__list--small",
|
|
6906
|
+
"list--medium": "dds-DetailList-module__list--medium",
|
|
6907
|
+
"list--large": "dds-DetailList-module__list--large",
|
|
6908
|
+
"column": "dds-DetailList-module__column",
|
|
6909
|
+
"cell": "dds-DetailList-module__cell",
|
|
6910
|
+
"term": "dds-DetailList-module__term"
|
|
6911
|
+
};
|
|
6901
6912
|
// src/components/DetailList/DetailList.tsx
|
|
6902
6913
|
const DETAIL_LIST_SIZES = createSizes("small", "medium", "large");
|
|
6903
6914
|
const DetailList = ({ id, className, style, htmlProps, withDividers = true, striped = true, size = "medium", smallScreenBreakpoint, ...rest }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DetailListContext, {
|
|
@@ -6936,6 +6947,9 @@ const DetailListTerm = ({ className, ...rest }) => /* @__PURE__ */ (0, react_jsx
|
|
|
6936
6947
|
...rest
|
|
6937
6948
|
});
|
|
6938
6949
|
DetailListTerm.displayName = "DetailListTerm";
|
|
6950
|
+
// src/components/Drawer/Drawer.context.tsx
|
|
6951
|
+
const DrawerContext = (0, react.createContext)({});
|
|
6952
|
+
const useDrawerContext = () => (0, react.useContext)(DrawerContext);
|
|
6939
6953
|
// src/components/Drawer/Drawer.module.css
|
|
6940
6954
|
var Drawer_module_default = {
|
|
6941
6955
|
"container": "dds-Drawer-module__container",
|
|
@@ -6949,9 +6963,6 @@ var Drawer_module_default = {
|
|
|
6949
6963
|
"drawer-header": "dds-Drawer-module__drawer-header",
|
|
6950
6964
|
"button--close": "dds-Drawer-module__button--close"
|
|
6951
6965
|
};
|
|
6952
|
-
// src/components/Drawer/Drawer.context.tsx
|
|
6953
|
-
const DrawerContext = (0, react.createContext)({});
|
|
6954
|
-
const useDrawerContext = () => (0, react.useContext)(DrawerContext);
|
|
6955
6966
|
const Drawer = ({ children, header, placement = "right", parentElement, size = "small", className, style, htmlProps, maxWidth, minWidth = "300px", width, withBackdrop, ref, ...rest }) => {
|
|
6956
6967
|
const themeContext = (0, react.useContext)(ThemeContext);
|
|
6957
6968
|
if (!themeContext) throw new Error("Drawer must be used within a DdsProvider");
|
|
@@ -7120,8 +7131,6 @@ function EmptyContent({ headerText, children, headerHeadingLevel = 2, ...rest })
|
|
|
7120
7131
|
});
|
|
7121
7132
|
}
|
|
7122
7133
|
EmptyContent.displayName = "EmptyContent";
|
|
7123
|
-
// src/components/ErrorSummary/ErrorSummary.module.css
|
|
7124
|
-
var ErrorSummary_module_default = { "container": "dds-ErrorSummary-module__container" };
|
|
7125
7134
|
// src/components/List/List.module.css
|
|
7126
7135
|
var List_module_default = {
|
|
7127
7136
|
"list": "dds-List-module__list",
|
|
@@ -7145,6 +7154,8 @@ const ListItem = ({ className, ...rest }) => /* @__PURE__ */ (0, react_jsx_runti
|
|
|
7145
7154
|
className: cn(className, List_module_default.li)
|
|
7146
7155
|
});
|
|
7147
7156
|
ListItem.displayName = "ListItem";
|
|
7157
|
+
// src/components/ErrorSummary/ErrorSummary.module.css
|
|
7158
|
+
var ErrorSummary_module_default = { "container": "dds-ErrorSummary-module__container" };
|
|
7148
7159
|
// src/components/ErrorSummary/ErrorSummary.tsx
|
|
7149
7160
|
const ErrorSummary = ({ heading: pHeading, className, style, children, id, htmlProps, ...props }) => {
|
|
7150
7161
|
const { t } = useTranslation();
|
|
@@ -7232,16 +7243,6 @@ const texts$20 = createTexts({ favourite: {
|
|
|
7232
7243
|
en: "Mark as favourite",
|
|
7233
7244
|
se: "Merke favorihta"
|
|
7234
7245
|
} });
|
|
7235
|
-
// src/components/Feedback/Feedback.module.css
|
|
7236
|
-
var Feedback_module_default = {
|
|
7237
|
-
"rating-container": "dds-Feedback-module__rating-container",
|
|
7238
|
-
"rating-container--horizontal": "dds-Feedback-module__rating-container--horizontal",
|
|
7239
|
-
"rating-container--vertical": "dds-Feedback-module__rating-container--vertical",
|
|
7240
|
-
"rating-submitted-title": "dds-Feedback-module__rating-submitted-title",
|
|
7241
|
-
"button": "dds-Feedback-module__button"
|
|
7242
|
-
};
|
|
7243
|
-
// src/components/TextArea/TextArea.module.css
|
|
7244
|
-
var TextArea_module_default = { "textarea": "dds-TextArea-module__textarea" };
|
|
7245
7246
|
// src/components/helpers/CharCounter/CharCounter.module.css
|
|
7246
7247
|
var CharCounter_module_default = { "container": "dds-CharCounter-module__container" };
|
|
7247
7248
|
// src/components/helpers/CharCounter/CharCounter.tsx
|
|
@@ -7280,6 +7281,8 @@ const texts$19 = createTexts({ charsWritten: (current, max, remain) => ({
|
|
|
7280
7281
|
en: `${current} of ${max} characters used. ${remain} remaining.`,
|
|
7281
7282
|
se: `${current} ${max} mearkabustáva leat ${max} čállon ${remain}.`
|
|
7282
7283
|
}) });
|
|
7284
|
+
// src/components/TextArea/TextArea.module.css
|
|
7285
|
+
var TextArea_module_default = { "textarea": "dds-TextArea-module__textarea" };
|
|
7283
7286
|
// src/components/TextArea/TextArea.tsx
|
|
7284
7287
|
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 }) => {
|
|
7285
7288
|
const generatedId = (0, react.useId)();
|
|
@@ -7352,6 +7355,14 @@ const TextArea = ({ id, value, defaultValue, onChange, errorMessage, required =
|
|
|
7352
7355
|
});
|
|
7353
7356
|
};
|
|
7354
7357
|
TextArea.displayName = "TextArea";
|
|
7358
|
+
// src/components/Feedback/Feedback.module.css
|
|
7359
|
+
var Feedback_module_default = {
|
|
7360
|
+
"rating-container": "dds-Feedback-module__rating-container",
|
|
7361
|
+
"rating-container--horizontal": "dds-Feedback-module__rating-container--horizontal",
|
|
7362
|
+
"rating-container--vertical": "dds-Feedback-module__rating-container--vertical",
|
|
7363
|
+
"rating-submitted-title": "dds-Feedback-module__rating-submitted-title",
|
|
7364
|
+
"button": "dds-Feedback-module__button"
|
|
7365
|
+
};
|
|
7355
7366
|
// src/components/Feedback/CommentComponent.tsx
|
|
7356
7367
|
const CommentComponent = ({ rating, feedbackText, positiveFeedbackLabel, negativeFeedbackLabel, ratingSubmittedTitle, textAreaTip, loading, handleSubmit, handleFeedbackTextChange }) => {
|
|
7357
7368
|
const { t } = useTranslation();
|
|
@@ -7385,8 +7396,6 @@ const texts$18 = createTexts({ send: {
|
|
|
7385
7396
|
en: "Send",
|
|
7386
7397
|
se: "Sádde"
|
|
7387
7398
|
} });
|
|
7388
|
-
// src/components/Feedback/utils.tsx
|
|
7389
|
-
const getButtonSize = (layout) => layout === "vertical" ? "medium" : "small";
|
|
7390
7399
|
// src/components/Tooltip/Tooltip.tsx
|
|
7391
7400
|
const Tooltip = ({ text, placement = "bottom", children, tooltipId, delay = 100, style, onMouseLeave, onMouseOver, keepMounted = true, id, ref, className, htmlProps, ...rest }) => {
|
|
7392
7401
|
const generatedId = (0, react.useId)();
|
|
@@ -7478,6 +7487,8 @@ const Tooltip = ({ text, placement = "bottom", children, tooltipId, delay = 100,
|
|
|
7478
7487
|
});
|
|
7479
7488
|
};
|
|
7480
7489
|
Tooltip.displayName = "Tooltip";
|
|
7490
|
+
// src/components/Feedback/utils.tsx
|
|
7491
|
+
const getButtonSize = (layout) => layout === "vertical" ? "medium" : "small";
|
|
7481
7492
|
// src/components/Feedback/RatingComponent.tsx
|
|
7482
7493
|
const RatingComponent = ({ layout, ratingLabel, loading, thumbUpTooltip, thumbDownTooltip, handleRatingChange }) => {
|
|
7483
7494
|
const { t } = useTranslation();
|
|
@@ -8386,17 +8397,6 @@ const texts$12 = createTexts({ noValue: {
|
|
|
8386
8397
|
en: "Not filled out",
|
|
8387
8398
|
se: "Ii leat devdon"
|
|
8388
8399
|
} });
|
|
8389
|
-
// src/components/InlineButton/InlineButton.module.css
|
|
8390
|
-
var InlineButton_module_default = { "button": "dds-InlineButton-module__button" };
|
|
8391
|
-
// src/components/InlineButton/InlineButton.tsx
|
|
8392
|
-
const InlineButton = ({ className, color, icon, children, ...rest }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StylelessButton, {
|
|
8393
|
-
className: cn(className, focus_module_default.focusable, typographyStyles_module_default.a, InlineButton_module_default.button, getColorCn(color)),
|
|
8394
|
-
...rest,
|
|
8395
|
-
children: icon ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, {
|
|
8396
|
-
icon,
|
|
8397
|
-
iconSize: "component"
|
|
8398
|
-
}) : children
|
|
8399
|
-
});
|
|
8400
8400
|
// src/components/InlineEdit/InlineEdit.context.tsx
|
|
8401
8401
|
const InlineEditContext = (0, react.createContext)({});
|
|
8402
8402
|
const useInlineEditContext = () => (0, react.useContext)(InlineEditContext);
|
|
@@ -8440,6 +8440,37 @@ const InlineEditContextProvider = (props) => {
|
|
|
8440
8440
|
});
|
|
8441
8441
|
};
|
|
8442
8442
|
InlineEditContextProvider.displayName = "InlineEditContextProvider";
|
|
8443
|
+
// src/utils/createClearChangeEvent.tsx
|
|
8444
|
+
/**
|
|
8445
|
+
* Lager en change-event som kan resette verdien i et input-felt.
|
|
8446
|
+
* Dette vil resultere i en event som har: event.target.value = ''.
|
|
8447
|
+
*
|
|
8448
|
+
* @param elementId Id'en til et gitt input-felt
|
|
8449
|
+
* @returns En change-event som har en tom streng som target value
|
|
8450
|
+
*/
|
|
8451
|
+
function createClearChangeEvent(elementId) {
|
|
8452
|
+
const element = document.getElementById(elementId);
|
|
8453
|
+
if (!element) throw new Error(`Element by id '${elementId}' not found.`);
|
|
8454
|
+
if (element instanceof HTMLInputElement) element.value = "";
|
|
8455
|
+
else if (element instanceof HTMLSelectElement) element.selectedIndex = 0;
|
|
8456
|
+
return {
|
|
8457
|
+
target: element,
|
|
8458
|
+
currentTarget: element,
|
|
8459
|
+
bubbles: true,
|
|
8460
|
+
cancelable: false,
|
|
8461
|
+
defaultPrevented: false,
|
|
8462
|
+
eventPhase: 0,
|
|
8463
|
+
isTrusted: false,
|
|
8464
|
+
preventDefault: () => null,
|
|
8465
|
+
stopPropagation: () => null,
|
|
8466
|
+
nativeEvent: new Event("input"),
|
|
8467
|
+
persist: () => null,
|
|
8468
|
+
type: "change",
|
|
8469
|
+
timeStamp: Date.now(),
|
|
8470
|
+
isDefaultPrevented: () => false,
|
|
8471
|
+
isPropagationStopped: () => false
|
|
8472
|
+
};
|
|
8473
|
+
}
|
|
8443
8474
|
// src/components/InlineEdit/InlineEdit.module.css
|
|
8444
8475
|
var InlineEdit_module_default = {
|
|
8445
8476
|
"inline-input": "dds-InlineEdit-module__inline-input",
|
|
@@ -8502,37 +8533,6 @@ const inlineSelectCns = (hasErrorState, showEditingIcon, hasValue) => [
|
|
|
8502
8533
|
hasValue && Input_module_default["input-with-icon-and-button-right--small"],
|
|
8503
8534
|
InlineEdit_module_default["inline-select"]
|
|
8504
8535
|
];
|
|
8505
|
-
// src/utils/createClearChangeEvent.tsx
|
|
8506
|
-
/**
|
|
8507
|
-
* Lager en change-event som kan resette verdien i et input-felt.
|
|
8508
|
-
* Dette vil resultere i en event som har: event.target.value = ''.
|
|
8509
|
-
*
|
|
8510
|
-
* @param elementId Id'en til et gitt input-felt
|
|
8511
|
-
* @returns En change-event som har en tom streng som target value
|
|
8512
|
-
*/
|
|
8513
|
-
function createClearChangeEvent(elementId) {
|
|
8514
|
-
const element = document.getElementById(elementId);
|
|
8515
|
-
if (!element) throw new Error(`Element by id '${elementId}' not found.`);
|
|
8516
|
-
if (element instanceof HTMLInputElement) element.value = "";
|
|
8517
|
-
else if (element instanceof HTMLSelectElement) element.selectedIndex = 0;
|
|
8518
|
-
return {
|
|
8519
|
-
target: element,
|
|
8520
|
-
currentTarget: element,
|
|
8521
|
-
bubbles: true,
|
|
8522
|
-
cancelable: false,
|
|
8523
|
-
defaultPrevented: false,
|
|
8524
|
-
eventPhase: 0,
|
|
8525
|
-
isTrusted: false,
|
|
8526
|
-
preventDefault: () => null,
|
|
8527
|
-
stopPropagation: () => null,
|
|
8528
|
-
nativeEvent: new Event("input"),
|
|
8529
|
-
persist: () => null,
|
|
8530
|
-
type: "change",
|
|
8531
|
-
timeStamp: Date.now(),
|
|
8532
|
-
isDefaultPrevented: () => false,
|
|
8533
|
-
isPropagationStopped: () => false
|
|
8534
|
-
};
|
|
8535
|
-
}
|
|
8536
8536
|
// src/components/InlineEdit/InlineField.tsx
|
|
8537
8537
|
function InlineField(props) {
|
|
8538
8538
|
const { elementType, id, error, errorMessage, width = "140px", hideIcon, ref, className, "aria-describedby": ariaDescribedby, ...rest } = props;
|
|
@@ -8819,8 +8819,6 @@ const texts$10 = createTexts({
|
|
|
8819
8819
|
se: "Siidu navigášuvdna"
|
|
8820
8820
|
}
|
|
8821
8821
|
});
|
|
8822
|
-
// src/components/messages/GlobalMessage/GlobalMessage.module.css
|
|
8823
|
-
var GlobalMessage_module_default = { "container": "dds-GlobalMessage-module__container" };
|
|
8824
8822
|
// src/components/messages/MessageBase/MessageBase.module.css
|
|
8825
8823
|
var MessageBase_module_default = { "container": "dds-MessageBase-module__container" };
|
|
8826
8824
|
// src/components/messages/MessageBase/MessageBase.tsx
|
|
@@ -8883,6 +8881,8 @@ const MessageBase = ({ children, id, className, style, htmlProps, purpose = "inf
|
|
|
8883
8881
|
}) : null;
|
|
8884
8882
|
};
|
|
8885
8883
|
MessageBase.displayName = "MessageBase";
|
|
8884
|
+
// src/components/messages/GlobalMessage/GlobalMessage.module.css
|
|
8885
|
+
var GlobalMessage_module_default = { "container": "dds-GlobalMessage-module__container" };
|
|
8886
8886
|
MESSAGE_PURPOSES.filter((purpose) => purpose !== "tips" && purpose !== "success");
|
|
8887
8887
|
const GlobalMessage = (props) => {
|
|
8888
8888
|
const gridLayout = `message${props.closable ? "-closable" : ""}${props.heading ? "-heading" : ""}`;
|
|
@@ -9217,47 +9217,6 @@ const NewsPopover = ({ id, className, style, htmlProps, header, news, defaultAct
|
|
|
9217
9217
|
}) : null;
|
|
9218
9218
|
};
|
|
9219
9219
|
NewsPopover.displayName = "NewsPopover";
|
|
9220
|
-
// src/components/Pagination/Pagination.module.css
|
|
9221
|
-
var Pagination_module_default = { "truncation-icon": "dds-Pagination-module__truncation-icon" };
|
|
9222
|
-
// src/components/Pagination/paginationGenerator.tsx
|
|
9223
|
-
const arrayRange = (start, end) => {
|
|
9224
|
-
const length = end - start + 1;
|
|
9225
|
-
return Array.from({ length }, (_, idx) => idx + start);
|
|
9226
|
-
};
|
|
9227
|
-
function PaginationGenerator(pagesAmount, activePage) {
|
|
9228
|
-
const siblingsCount = 1;
|
|
9229
|
-
const maxPagesShown = 7;
|
|
9230
|
-
const pagesBeforeTruncator = 5;
|
|
9231
|
-
const truncator = "truncator";
|
|
9232
|
-
let pageRange;
|
|
9233
|
-
if (pagesAmount > 4) {
|
|
9234
|
-
const middleStartPage = Math.max(1, activePage < pagesBeforeTruncator || pagesAmount <= maxPagesShown ? 1 : activePage + siblingsCount + 1 >= pagesAmount ? pagesAmount - 4 : activePage > 4 && pagesAmount > maxPagesShown ? activePage - siblingsCount : 1);
|
|
9235
|
-
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;
|
|
9236
|
-
const middleEndPage = Math.min(pagesAmount, middleEndOffset);
|
|
9237
|
-
pageRange = arrayRange(middleStartPage, middleEndPage);
|
|
9238
|
-
const truncatedLeft = middleStartPage > 2 && pagesAmount > maxPagesShown;
|
|
9239
|
-
const truncatedRight = pagesAmount - middleEndPage > 1 && pagesAmount > maxPagesShown;
|
|
9240
|
-
if (truncatedLeft && truncatedRight) pageRange = [
|
|
9241
|
-
1,
|
|
9242
|
-
truncator,
|
|
9243
|
-
...pageRange,
|
|
9244
|
-
truncator,
|
|
9245
|
-
pagesAmount
|
|
9246
|
-
];
|
|
9247
|
-
else if (truncatedLeft && !truncatedRight) pageRange = [
|
|
9248
|
-
1,
|
|
9249
|
-
truncator,
|
|
9250
|
-
...pageRange
|
|
9251
|
-
];
|
|
9252
|
-
else if (!truncatedLeft && truncatedRight) pageRange = [
|
|
9253
|
-
...pageRange,
|
|
9254
|
-
truncator,
|
|
9255
|
-
pagesAmount
|
|
9256
|
-
];
|
|
9257
|
-
return [...pageRange];
|
|
9258
|
-
}
|
|
9259
|
-
return arrayRange(1, pagesAmount);
|
|
9260
|
-
}
|
|
9261
9220
|
// src/components/Select/Select.module.css
|
|
9262
9221
|
var Select_module_default = {
|
|
9263
9222
|
"container--disabled": "dds-Select-module__container--disabled",
|
|
@@ -9800,6 +9759,47 @@ const createSelectOptions = (...args) => args.map((v) => ({
|
|
|
9800
9759
|
label: v,
|
|
9801
9760
|
value: v
|
|
9802
9761
|
}));
|
|
9762
|
+
// src/components/Pagination/Pagination.module.css
|
|
9763
|
+
var Pagination_module_default = { "truncation-icon": "dds-Pagination-module__truncation-icon" };
|
|
9764
|
+
// src/components/Pagination/paginationGenerator.tsx
|
|
9765
|
+
const arrayRange = (start, end) => {
|
|
9766
|
+
const length = end - start + 1;
|
|
9767
|
+
return Array.from({ length }, (_, idx) => idx + start);
|
|
9768
|
+
};
|
|
9769
|
+
function PaginationGenerator(pagesAmount, activePage) {
|
|
9770
|
+
const siblingsCount = 1;
|
|
9771
|
+
const maxPagesShown = 7;
|
|
9772
|
+
const pagesBeforeTruncator = 5;
|
|
9773
|
+
const truncator = "truncator";
|
|
9774
|
+
let pageRange;
|
|
9775
|
+
if (pagesAmount > 4) {
|
|
9776
|
+
const middleStartPage = Math.max(1, activePage < pagesBeforeTruncator || pagesAmount <= maxPagesShown ? 1 : activePage + siblingsCount + 1 >= pagesAmount ? pagesAmount - 4 : activePage > 4 && pagesAmount > maxPagesShown ? activePage - siblingsCount : 1);
|
|
9777
|
+
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;
|
|
9778
|
+
const middleEndPage = Math.min(pagesAmount, middleEndOffset);
|
|
9779
|
+
pageRange = arrayRange(middleStartPage, middleEndPage);
|
|
9780
|
+
const truncatedLeft = middleStartPage > 2 && pagesAmount > maxPagesShown;
|
|
9781
|
+
const truncatedRight = pagesAmount - middleEndPage > 1 && pagesAmount > maxPagesShown;
|
|
9782
|
+
if (truncatedLeft && truncatedRight) pageRange = [
|
|
9783
|
+
1,
|
|
9784
|
+
truncator,
|
|
9785
|
+
...pageRange,
|
|
9786
|
+
truncator,
|
|
9787
|
+
pagesAmount
|
|
9788
|
+
];
|
|
9789
|
+
else if (truncatedLeft && !truncatedRight) pageRange = [
|
|
9790
|
+
1,
|
|
9791
|
+
truncator,
|
|
9792
|
+
...pageRange
|
|
9793
|
+
];
|
|
9794
|
+
else if (!truncatedLeft && truncatedRight) pageRange = [
|
|
9795
|
+
...pageRange,
|
|
9796
|
+
truncator,
|
|
9797
|
+
pagesAmount
|
|
9798
|
+
];
|
|
9799
|
+
return [...pageRange];
|
|
9800
|
+
}
|
|
9801
|
+
return arrayRange(1, pagesAmount);
|
|
9802
|
+
}
|
|
9803
9803
|
// src/components/Pagination/Pagination.tsx
|
|
9804
9804
|
const Pagination = ({ itemsAmount, defaultItemsPerPage = 10, defaultActivePage = 1, activePage: activePageProp, withPagination = true, withCounter, withSelect, selectOptions, smallScreenBreakpoint, onChange, onSelectOptionChange, id, className, style, htmlProps, ref, ...rest }) => {
|
|
9805
9805
|
const { t } = useTranslation();
|