@norges-domstoler/dds-components 14.0.0 → 14.2.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.d.mts +15 -1
- package/dist/index.d.ts +15 -1
- package/dist/index.js +323 -254
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +252 -179
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -3160,8 +3160,7 @@ import {
|
|
|
3160
3160
|
import { jsx as jsx168 } from "react/jsx-runtime";
|
|
3161
3161
|
var AppShellContext = createContext({
|
|
3162
3162
|
isOpen: false,
|
|
3163
|
-
setOpen: () =>
|
|
3164
|
-
}
|
|
3163
|
+
setOpen: () => null
|
|
3165
3164
|
});
|
|
3166
3165
|
var AppShellContextProvider = ({
|
|
3167
3166
|
children
|
|
@@ -6987,13 +6986,10 @@ function createEmptyChangeEvent(inputElementId) {
|
|
|
6987
6986
|
defaultPrevented: false,
|
|
6988
6987
|
eventPhase: 0,
|
|
6989
6988
|
isTrusted: false,
|
|
6990
|
-
preventDefault: () =>
|
|
6991
|
-
|
|
6992
|
-
stopPropagation: () => {
|
|
6993
|
-
},
|
|
6989
|
+
preventDefault: () => null,
|
|
6990
|
+
stopPropagation: () => null,
|
|
6994
6991
|
nativeEvent: new Event("input"),
|
|
6995
|
-
persist: () =>
|
|
6996
|
-
},
|
|
6992
|
+
persist: () => null,
|
|
6997
6993
|
type: "change",
|
|
6998
6994
|
timeStamp: Date.now(),
|
|
6999
6995
|
isDefaultPrevented: () => false,
|
|
@@ -9540,8 +9536,7 @@ var Tooltip = forwardRef45(
|
|
|
9540
9536
|
}
|
|
9541
9537
|
return () => {
|
|
9542
9538
|
if (tooltipRef.current) {
|
|
9543
|
-
window.removeEventListener("scroll", () =>
|
|
9544
|
-
});
|
|
9539
|
+
window.removeEventListener("scroll", () => null);
|
|
9545
9540
|
}
|
|
9546
9541
|
};
|
|
9547
9542
|
}, []);
|
|
@@ -10720,6 +10715,7 @@ var DateInput = forwardRef50(
|
|
|
10720
10715
|
InputDiv,
|
|
10721
10716
|
{
|
|
10722
10717
|
...fieldProps,
|
|
10718
|
+
style,
|
|
10723
10719
|
disabled,
|
|
10724
10720
|
componentSize,
|
|
10725
10721
|
ref: internalRef,
|
|
@@ -10808,8 +10804,7 @@ var { popover: popoverTokens } = calendarTokens;
|
|
|
10808
10804
|
var CalendarPopoverContext = createContext5({
|
|
10809
10805
|
anchorRef: null,
|
|
10810
10806
|
isOpen: false,
|
|
10811
|
-
onClose: () =>
|
|
10812
|
-
}
|
|
10807
|
+
onClose: () => null
|
|
10813
10808
|
});
|
|
10814
10809
|
var CalendarPopover = ({
|
|
10815
10810
|
children,
|
|
@@ -10929,9 +10924,7 @@ DatePicker.displayName = "DatePicker";
|
|
|
10929
10924
|
|
|
10930
10925
|
// src/components/date-inputs/TimePicker/TimePicker.tsx
|
|
10931
10926
|
import { forwardRef as forwardRef53, useRef as useRef22 } from "react";
|
|
10932
|
-
import {
|
|
10933
|
-
useTimeField
|
|
10934
|
-
} from "@react-aria/datepicker";
|
|
10927
|
+
import { useTimeField } from "@react-aria/datepicker";
|
|
10935
10928
|
import { useTimeFieldState } from "@react-stately/datepicker";
|
|
10936
10929
|
import styled72 from "styled-components";
|
|
10937
10930
|
import { jsx as jsx236 } from "react/jsx-runtime";
|
|
@@ -10940,7 +10933,7 @@ var TimePickerIcon = styled72(Icon)`
|
|
|
10940
10933
|
width: ${({ $componentSize }) => datePickerTokens.calendarButton[$componentSize].size};
|
|
10941
10934
|
margin-left: -1px; // To align with TextInputs icons
|
|
10942
10935
|
`;
|
|
10943
|
-
function _TimePicker({ componentSize = "medium",
|
|
10936
|
+
function _TimePicker({ componentSize = "medium", ...props }, forwardedRef) {
|
|
10944
10937
|
const ref = useRef22(null);
|
|
10945
10938
|
const state = useTimeFieldState({
|
|
10946
10939
|
...props,
|
|
@@ -10988,13 +10981,37 @@ var TimePicker = forwardRef53(_TimePicker);
|
|
|
10988
10981
|
TimePicker.displayName = "TimePicker";
|
|
10989
10982
|
|
|
10990
10983
|
// src/components/date-inputs/utils/transform.ts
|
|
10991
|
-
import {
|
|
10984
|
+
import {
|
|
10985
|
+
CalendarDate as CalendarDate3,
|
|
10986
|
+
Time,
|
|
10987
|
+
fromDate
|
|
10988
|
+
} from "@internationalized/date";
|
|
10992
10989
|
function nativeDateToDateValue(date, timeZone = "Europe/Oslo") {
|
|
10993
10990
|
return fromDate(date, timeZone);
|
|
10994
10991
|
}
|
|
10995
10992
|
function dateValueToNativeDate(date, timeZone = "Europe/Oslo") {
|
|
10996
10993
|
return date.toDate(timeZone);
|
|
10997
10994
|
}
|
|
10995
|
+
function nativeDateToCalendarDate(date) {
|
|
10996
|
+
return new CalendarDate3(
|
|
10997
|
+
date.getFullYear(),
|
|
10998
|
+
date.getMonth() + 1,
|
|
10999
|
+
date.getDate()
|
|
11000
|
+
);
|
|
11001
|
+
}
|
|
11002
|
+
function nativeDateToTime(date) {
|
|
11003
|
+
return new Time(date.getHours(), date.getMinutes(), date.getSeconds());
|
|
11004
|
+
}
|
|
11005
|
+
function calendarDateToNativeDate(date, time = new Time(12, 0, 0, 0)) {
|
|
11006
|
+
return new Date(
|
|
11007
|
+
date.year,
|
|
11008
|
+
date.month - 1,
|
|
11009
|
+
date.day,
|
|
11010
|
+
time.hour,
|
|
11011
|
+
time.minute,
|
|
11012
|
+
time.second
|
|
11013
|
+
);
|
|
11014
|
+
}
|
|
10998
11015
|
|
|
10999
11016
|
// src/components/Popover/Popover.tsx
|
|
11000
11017
|
import { ddsBaseTokens as ddsBaseTokens45 } from "@norges-domstoler/dds-design-tokens";
|
|
@@ -11498,8 +11515,51 @@ var tabsTokens = {
|
|
|
11498
11515
|
panel
|
|
11499
11516
|
};
|
|
11500
11517
|
|
|
11518
|
+
// src/components/Tabs/TabWidthContext.tsx
|
|
11519
|
+
import {
|
|
11520
|
+
createContext as createContext7,
|
|
11521
|
+
useContext as useContext9,
|
|
11522
|
+
useLayoutEffect as useLayoutEffect3
|
|
11523
|
+
} from "react";
|
|
11524
|
+
import { jsx as jsx242 } from "react/jsx-runtime";
|
|
11525
|
+
var TabContext = createContext7(null);
|
|
11526
|
+
function TabWidthContextProvider({
|
|
11527
|
+
children,
|
|
11528
|
+
onChangeWidths
|
|
11529
|
+
}) {
|
|
11530
|
+
return /* @__PURE__ */ jsx242(
|
|
11531
|
+
TabContext.Provider,
|
|
11532
|
+
{
|
|
11533
|
+
value: {
|
|
11534
|
+
updateWidth: (index, newWidth) => {
|
|
11535
|
+
onChangeWidths((prev) => {
|
|
11536
|
+
const newValue = [...prev];
|
|
11537
|
+
newValue[index] = newWidth;
|
|
11538
|
+
return newValue;
|
|
11539
|
+
});
|
|
11540
|
+
},
|
|
11541
|
+
removeTab: (index) => {
|
|
11542
|
+
onChangeWidths((prev) => {
|
|
11543
|
+
const newValue = [...prev];
|
|
11544
|
+
newValue.splice(index, 1);
|
|
11545
|
+
return newValue;
|
|
11546
|
+
});
|
|
11547
|
+
}
|
|
11548
|
+
},
|
|
11549
|
+
children
|
|
11550
|
+
}
|
|
11551
|
+
);
|
|
11552
|
+
}
|
|
11553
|
+
function useSetTabWidth(index, width) {
|
|
11554
|
+
const context = useContext9(TabContext);
|
|
11555
|
+
useLayoutEffect3(() => {
|
|
11556
|
+
context == null ? void 0 : context.updateWidth(index, width);
|
|
11557
|
+
return () => context == null ? void 0 : context.removeTab(index);
|
|
11558
|
+
}, [index, width]);
|
|
11559
|
+
}
|
|
11560
|
+
|
|
11501
11561
|
// src/components/Tabs/Tab.tsx
|
|
11502
|
-
import { jsx as
|
|
11562
|
+
import { jsx as jsx243, jsxs as jsxs59 } from "react/jsx-runtime";
|
|
11503
11563
|
var { tab: tab2 } = tabsTokens;
|
|
11504
11564
|
var Button2 = styled77.button`
|
|
11505
11565
|
${normalizeButton}
|
|
@@ -11557,8 +11617,10 @@ var Tab = forwardRef57((props, ref) => {
|
|
|
11557
11617
|
id,
|
|
11558
11618
|
className,
|
|
11559
11619
|
htmlProps,
|
|
11620
|
+
width = "1fr",
|
|
11560
11621
|
...rest
|
|
11561
11622
|
} = props;
|
|
11623
|
+
useSetTabWidth(index, width);
|
|
11562
11624
|
const itemRef = useRef25(null);
|
|
11563
11625
|
const combinedRef = useCombinedRef(ref, itemRef);
|
|
11564
11626
|
const { tabPanelsRef, setHasTabFocus, tabContentDirection } = useTabsContext();
|
|
@@ -11600,8 +11662,8 @@ var Tab = forwardRef57((props, ref) => {
|
|
|
11600
11662
|
onKeyDown: handleOnKeyDown,
|
|
11601
11663
|
tabIndex: focus ? 0 : -1,
|
|
11602
11664
|
children: [
|
|
11603
|
-
icon12 && /* @__PURE__ */
|
|
11604
|
-
/* @__PURE__ */
|
|
11665
|
+
icon12 && /* @__PURE__ */ jsx243(Icon, { icon: icon12, iconSize: "inherit" }),
|
|
11666
|
+
/* @__PURE__ */ jsx243("span", { children })
|
|
11605
11667
|
]
|
|
11606
11668
|
}
|
|
11607
11669
|
);
|
|
@@ -11613,16 +11675,23 @@ import {
|
|
|
11613
11675
|
forwardRef as forwardRef58,
|
|
11614
11676
|
Children as Children4,
|
|
11615
11677
|
isValidElement as isValidElement6,
|
|
11616
|
-
cloneElement as cloneElement6
|
|
11678
|
+
cloneElement as cloneElement6,
|
|
11679
|
+
useState as useState24
|
|
11617
11680
|
} from "react";
|
|
11618
|
-
import styled78 from "styled-components";
|
|
11619
|
-
import { jsx as
|
|
11681
|
+
import styled78, { css as css39 } from "styled-components";
|
|
11682
|
+
import { jsx as jsx244 } from "react/jsx-runtime";
|
|
11620
11683
|
var { tabList: tabList2 } = tabsTokens;
|
|
11684
|
+
var autoFlow = css39`
|
|
11685
|
+
grid-auto-flow: column;
|
|
11686
|
+
grid-auto-columns: 1fr;
|
|
11687
|
+
`;
|
|
11688
|
+
var templateColumns = (templateColumns2) => css39`
|
|
11689
|
+
grid-template-columns: ${templateColumns2};
|
|
11690
|
+
`;
|
|
11621
11691
|
var TabRow = styled78.div`
|
|
11622
11692
|
border-bottom: ${tabList2.borderBottom};
|
|
11623
11693
|
display: grid;
|
|
11624
|
-
|
|
11625
|
-
grid-auto-columns: 1fr;
|
|
11694
|
+
${({ $gridTemplateColumns }) => $gridTemplateColumns === "" ? autoFlow : templateColumns($gridTemplateColumns)}
|
|
11626
11695
|
overflow-x: auto;
|
|
11627
11696
|
${scrollbarStyling.webkit}
|
|
11628
11697
|
${scrollbarStyling.firefox}
|
|
@@ -11664,6 +11733,7 @@ var TabList = forwardRef58(
|
|
|
11664
11733
|
onClick: () => handleTabChange(index)
|
|
11665
11734
|
});
|
|
11666
11735
|
});
|
|
11736
|
+
const [widths, setWidths] = useState24([]);
|
|
11667
11737
|
useOnKeyDown("Tab", () => {
|
|
11668
11738
|
var _a;
|
|
11669
11739
|
setHasTabFocus(false);
|
|
@@ -11685,15 +11755,15 @@ var TabList = forwardRef58(
|
|
|
11685
11755
|
tabIndex: 0,
|
|
11686
11756
|
onFocus: handleOnFocus
|
|
11687
11757
|
};
|
|
11688
|
-
return /* @__PURE__ */
|
|
11758
|
+
return /* @__PURE__ */ jsx244(TabWidthContextProvider, { onChangeWidths: setWidths, children: /* @__PURE__ */ jsx244(TabRow, { ...tabListProps, $gridTemplateColumns: widths.join(" "), children: tabListChildren }) });
|
|
11689
11759
|
}
|
|
11690
11760
|
);
|
|
11691
11761
|
TabList.displayName = "TabList";
|
|
11692
11762
|
|
|
11693
11763
|
// src/components/Tabs/TabPanel.tsx
|
|
11694
11764
|
import { forwardRef as forwardRef59 } from "react";
|
|
11695
|
-
import styled79, { css as
|
|
11696
|
-
import { jsx as
|
|
11765
|
+
import styled79, { css as css40 } from "styled-components";
|
|
11766
|
+
import { jsx as jsx245 } from "react/jsx-runtime";
|
|
11697
11767
|
var { panel: panel2 } = tabsTokens;
|
|
11698
11768
|
var Panel = styled79.div`
|
|
11699
11769
|
padding: ${panel2.padding};
|
|
@@ -11701,7 +11771,7 @@ var Panel = styled79.div`
|
|
|
11701
11771
|
transition: ${focusVisibleTransitionValue};
|
|
11702
11772
|
}
|
|
11703
11773
|
|
|
11704
|
-
${({ $active }) => !$active &&
|
|
11774
|
+
${({ $active }) => !$active && css40`
|
|
11705
11775
|
display: none;
|
|
11706
11776
|
`}
|
|
11707
11777
|
&:focus-visible {
|
|
@@ -11710,7 +11780,7 @@ var Panel = styled79.div`
|
|
|
11710
11780
|
`;
|
|
11711
11781
|
var TabPanel = forwardRef59(
|
|
11712
11782
|
({ active = false, children, id, className, htmlProps, ...rest }, ref) => {
|
|
11713
|
-
return /* @__PURE__ */
|
|
11783
|
+
return /* @__PURE__ */ jsx245(
|
|
11714
11784
|
Panel,
|
|
11715
11785
|
{
|
|
11716
11786
|
...getBaseHTMLProps(id, className, htmlProps, rest),
|
|
@@ -11732,7 +11802,7 @@ import {
|
|
|
11732
11802
|
cloneElement as cloneElement7,
|
|
11733
11803
|
isValidElement as isValidElement7
|
|
11734
11804
|
} from "react";
|
|
11735
|
-
import { jsx as
|
|
11805
|
+
import { jsx as jsx246 } from "react/jsx-runtime";
|
|
11736
11806
|
var TabPanels = forwardRef60(
|
|
11737
11807
|
({ children, ...rest }, ref) => {
|
|
11738
11808
|
const { activeTab, tabsId, tabPanelsRef } = useTabsContext();
|
|
@@ -11746,14 +11816,14 @@ var TabPanels = forwardRef60(
|
|
|
11746
11816
|
"aria-expanded": active
|
|
11747
11817
|
});
|
|
11748
11818
|
});
|
|
11749
|
-
return /* @__PURE__ */
|
|
11819
|
+
return /* @__PURE__ */ jsx246("div", { ref: combinedRef, ...rest, children: panelChildren });
|
|
11750
11820
|
}
|
|
11751
11821
|
);
|
|
11752
11822
|
TabPanels.displayName = "TabPanels";
|
|
11753
11823
|
|
|
11754
11824
|
// src/components/Tag/Tag.tsx
|
|
11755
11825
|
import { forwardRef as forwardRef61 } from "react";
|
|
11756
|
-
import styled80, { css as
|
|
11826
|
+
import styled80, { css as css41 } from "styled-components";
|
|
11757
11827
|
|
|
11758
11828
|
// src/components/Tag/Tag.tokens.tsx
|
|
11759
11829
|
import { ddsBaseTokens as ddsBaseTokens48 } from "@norges-domstoler/dds-design-tokens";
|
|
@@ -11779,7 +11849,7 @@ var tagTokens = {
|
|
|
11779
11849
|
};
|
|
11780
11850
|
|
|
11781
11851
|
// src/components/Tag/Tag.tsx
|
|
11782
|
-
import { jsx as
|
|
11852
|
+
import { jsx as jsx247 } from "react/jsx-runtime";
|
|
11783
11853
|
var { wrapper: wrapper8 } = tagTokens;
|
|
11784
11854
|
var Wrapper7 = styled80(TextOverflowEllipsisWrapper)`
|
|
11785
11855
|
display: inline-flex;
|
|
@@ -11788,7 +11858,7 @@ var Wrapper7 = styled80(TextOverflowEllipsisWrapper)`
|
|
|
11788
11858
|
border-radius: ${wrapper8.borderRadius};
|
|
11789
11859
|
padding: ${wrapper8.padding};
|
|
11790
11860
|
${getFontStyling(typographyType5)}
|
|
11791
|
-
${({ $purpose }) =>
|
|
11861
|
+
${({ $purpose }) => css41`
|
|
11792
11862
|
background-color: ${wrapper8.purpose[$purpose].backgroundColor};
|
|
11793
11863
|
border-color: ${wrapper8.purpose[$purpose].borderColor};
|
|
11794
11864
|
`}
|
|
@@ -11802,20 +11872,20 @@ var Tag = forwardRef61((props, ref) => {
|
|
|
11802
11872
|
htmlProps,
|
|
11803
11873
|
...rest
|
|
11804
11874
|
} = props;
|
|
11805
|
-
return /* @__PURE__ */
|
|
11875
|
+
return /* @__PURE__ */ jsx247(
|
|
11806
11876
|
Wrapper7,
|
|
11807
11877
|
{
|
|
11808
11878
|
...getBaseHTMLProps(id, className, htmlProps, rest),
|
|
11809
11879
|
ref,
|
|
11810
11880
|
$purpose: purpose,
|
|
11811
|
-
children: /* @__PURE__ */
|
|
11881
|
+
children: /* @__PURE__ */ jsx247(TextOverflowEllipsisInner, { children: text })
|
|
11812
11882
|
}
|
|
11813
11883
|
);
|
|
11814
11884
|
});
|
|
11815
11885
|
Tag.displayName = "Tag";
|
|
11816
11886
|
|
|
11817
11887
|
// src/components/Chip/Chip.tsx
|
|
11818
|
-
import { forwardRef as forwardRef62, useState as
|
|
11888
|
+
import { forwardRef as forwardRef62, useState as useState25 } from "react";
|
|
11819
11889
|
import styled81 from "styled-components";
|
|
11820
11890
|
|
|
11821
11891
|
// src/components/Chip/Chip.tokens.tsx
|
|
@@ -11838,7 +11908,7 @@ var chipTokens = {
|
|
|
11838
11908
|
};
|
|
11839
11909
|
|
|
11840
11910
|
// src/components/Chip/Chip.tsx
|
|
11841
|
-
import { jsx as
|
|
11911
|
+
import { jsx as jsx248, jsxs as jsxs60 } from "react/jsx-runtime";
|
|
11842
11912
|
var { container: container17 } = chipTokens;
|
|
11843
11913
|
var Container15 = styled81(TextOverflowEllipsisWrapper)`
|
|
11844
11914
|
display: flex;
|
|
@@ -11854,7 +11924,7 @@ var Container15 = styled81(TextOverflowEllipsisWrapper)`
|
|
|
11854
11924
|
var Chip = forwardRef62((props, ref) => {
|
|
11855
11925
|
const { text, onClose, id, className, htmlProps = {}, ...rest } = props;
|
|
11856
11926
|
const { "aria-label": ariaLabel, ...restHTMLprops } = htmlProps;
|
|
11857
|
-
const [isOpen, setIsOpen] =
|
|
11927
|
+
const [isOpen, setIsOpen] = useState25(true);
|
|
11858
11928
|
const onClick = () => {
|
|
11859
11929
|
setIsOpen(false);
|
|
11860
11930
|
onClose && onClose();
|
|
@@ -11866,8 +11936,8 @@ var Chip = forwardRef62((props, ref) => {
|
|
|
11866
11936
|
ref,
|
|
11867
11937
|
as: "div",
|
|
11868
11938
|
children: [
|
|
11869
|
-
/* @__PURE__ */
|
|
11870
|
-
/* @__PURE__ */
|
|
11939
|
+
/* @__PURE__ */ jsx248(TextOverflowEllipsisInner, { children: text }),
|
|
11940
|
+
/* @__PURE__ */ jsx248(
|
|
11871
11941
|
Button,
|
|
11872
11942
|
{
|
|
11873
11943
|
size: "tiny",
|
|
@@ -11887,7 +11957,7 @@ Chip.displayName = "Chip";
|
|
|
11887
11957
|
// src/components/Chip/ChipGroup.tsx
|
|
11888
11958
|
import { forwardRef as forwardRef63, Children as Children6 } from "react";
|
|
11889
11959
|
import styled82 from "styled-components";
|
|
11890
|
-
import { jsx as
|
|
11960
|
+
import { jsx as jsx249 } from "react/jsx-runtime";
|
|
11891
11961
|
var Group2 = styled82.ul`
|
|
11892
11962
|
${removeListStyling}
|
|
11893
11963
|
display: flex;
|
|
@@ -11896,22 +11966,22 @@ var Group2 = styled82.ul`
|
|
|
11896
11966
|
var ChipGroup = forwardRef63(
|
|
11897
11967
|
({ children, ...rest }, ref) => {
|
|
11898
11968
|
const childrenArray = Children6.toArray(children);
|
|
11899
|
-
const groupChildren = childrenArray.map((item, index) => /* @__PURE__ */
|
|
11900
|
-
return /* @__PURE__ */
|
|
11969
|
+
const groupChildren = childrenArray.map((item, index) => /* @__PURE__ */ jsx249("li", { children: item }, `chip-${index}`));
|
|
11970
|
+
return /* @__PURE__ */ jsx249(Group2, { ...rest, ref, children: groupChildren });
|
|
11901
11971
|
}
|
|
11902
11972
|
);
|
|
11903
11973
|
ChipGroup.displayName = "ChipGroup";
|
|
11904
11974
|
|
|
11905
11975
|
// src/components/ToggleBar/ToggleBar.tsx
|
|
11906
|
-
import { useState as
|
|
11907
|
-
import styled83, { css as
|
|
11976
|
+
import { useState as useState26, useId as useId21 } from "react";
|
|
11977
|
+
import styled83, { css as css42 } from "styled-components";
|
|
11908
11978
|
|
|
11909
11979
|
// src/components/ToggleBar/ToggleBar.context.tsx
|
|
11910
|
-
import { createContext as
|
|
11911
|
-
var ToggleBarContext =
|
|
11980
|
+
import { createContext as createContext8, useContext as useContext10 } from "react";
|
|
11981
|
+
var ToggleBarContext = createContext8({
|
|
11912
11982
|
size: "medium"
|
|
11913
11983
|
});
|
|
11914
|
-
var useToggleBarContext = () =>
|
|
11984
|
+
var useToggleBarContext = () => useContext10(ToggleBarContext);
|
|
11915
11985
|
|
|
11916
11986
|
// src/components/ToggleBar/ToggleBar.tokens.tsx
|
|
11917
11987
|
import { ddsBaseTokens as ddsBaseTokens50 } from "@norges-domstoler/dds-design-tokens";
|
|
@@ -12020,7 +12090,7 @@ var toggleBarTokens = {
|
|
|
12020
12090
|
};
|
|
12021
12091
|
|
|
12022
12092
|
// src/components/ToggleBar/ToggleBar.tsx
|
|
12023
|
-
import { jsx as
|
|
12093
|
+
import { jsx as jsx250, jsxs as jsxs61 } from "react/jsx-runtime";
|
|
12024
12094
|
var OuterContainer4 = styled83.div`
|
|
12025
12095
|
display: flex;
|
|
12026
12096
|
flex-direction: column;
|
|
@@ -12029,7 +12099,7 @@ var OuterContainer4 = styled83.div`
|
|
|
12029
12099
|
*::selection {
|
|
12030
12100
|
${selection}
|
|
12031
12101
|
}
|
|
12032
|
-
${({ $width }) => $width &&
|
|
12102
|
+
${({ $width }) => $width && css42`
|
|
12033
12103
|
width: ${$width};
|
|
12034
12104
|
`}
|
|
12035
12105
|
`;
|
|
@@ -12054,13 +12124,13 @@ var ToggleBar = (props) => {
|
|
|
12054
12124
|
} = props;
|
|
12055
12125
|
const generatedId = useId21();
|
|
12056
12126
|
const uniqueId = id != null ? id : `${generatedId}-ToggleBar`;
|
|
12057
|
-
const [groupValue, setGroupValue] =
|
|
12127
|
+
const [groupValue, setGroupValue] = useState26(value);
|
|
12058
12128
|
const handleChange = combineHandlers(
|
|
12059
12129
|
(e) => setGroupValue(e.target.value),
|
|
12060
12130
|
(e) => onChange && onChange(e, e.target.value)
|
|
12061
12131
|
);
|
|
12062
12132
|
const labelId = label3 && `${uniqueId}-label`;
|
|
12063
|
-
return /* @__PURE__ */
|
|
12133
|
+
return /* @__PURE__ */ jsx250(
|
|
12064
12134
|
ToggleBarContext.Provider,
|
|
12065
12135
|
{
|
|
12066
12136
|
value: {
|
|
@@ -12077,8 +12147,8 @@ var ToggleBar = (props) => {
|
|
|
12077
12147
|
"aria-labelledby": labelId != null ? labelId : htmlProps == null ? void 0 : htmlProps["aria-labelledby"],
|
|
12078
12148
|
$width: width,
|
|
12079
12149
|
children: [
|
|
12080
|
-
label3 && /* @__PURE__ */
|
|
12081
|
-
/* @__PURE__ */
|
|
12150
|
+
label3 && /* @__PURE__ */ jsx250(Typography, { typographyType: "supportingStyleLabel01", id: labelId, children: label3 }),
|
|
12151
|
+
/* @__PURE__ */ jsx250(Bar2, { children })
|
|
12082
12152
|
]
|
|
12083
12153
|
}
|
|
12084
12154
|
)
|
|
@@ -12091,7 +12161,7 @@ ToggleBar.displayName = "ToggleBar";
|
|
|
12091
12161
|
import { forwardRef as forwardRef64, useId as useId22 } from "react";
|
|
12092
12162
|
|
|
12093
12163
|
// src/components/ToggleBar/ToggleRadio.styles.tsx
|
|
12094
|
-
import styled84, { css as
|
|
12164
|
+
import styled84, { css as css43 } from "styled-components";
|
|
12095
12165
|
var { content: content6, label: label2 } = toggleBarTokens;
|
|
12096
12166
|
var Content3 = styled84.span`
|
|
12097
12167
|
display: flex;
|
|
@@ -12111,11 +12181,11 @@ var Content3 = styled84.span`
|
|
|
12111
12181
|
}
|
|
12112
12182
|
background-color: ${content6.base.backgroundColor};
|
|
12113
12183
|
|
|
12114
|
-
${({ $size, $justIcon }) =>
|
|
12115
|
-
${$justIcon ?
|
|
12184
|
+
${({ $size, $justIcon }) => css43`
|
|
12185
|
+
${$justIcon ? css43`
|
|
12116
12186
|
font-size: ${content6.size[$size].justIcon.fontSize};
|
|
12117
12187
|
padding: ${content6.size[$size].justIcon.padding};
|
|
12118
|
-
` :
|
|
12188
|
+
` : css43`
|
|
12119
12189
|
gap: ${content6.size[$size].withText.gap};
|
|
12120
12190
|
padding: ${content6.size[$size].withText.padding};
|
|
12121
12191
|
${getFontStyling(typographyTypes6[$size])}
|
|
@@ -12160,7 +12230,7 @@ var Label3 = styled84.label`
|
|
|
12160
12230
|
`;
|
|
12161
12231
|
|
|
12162
12232
|
// src/components/ToggleBar/ToggleRadio.tsx
|
|
12163
|
-
import { jsx as
|
|
12233
|
+
import { jsx as jsx251, jsxs as jsxs62 } from "react/jsx-runtime";
|
|
12164
12234
|
var calculateChecked = (value, group4, checked) => {
|
|
12165
12235
|
if (typeof checked !== "undefined")
|
|
12166
12236
|
return checked;
|
|
@@ -12194,7 +12264,7 @@ var ToggleRadio = forwardRef64(
|
|
|
12194
12264
|
(group4 == null ? void 0 : group4.onChange) && group4.onChange(event);
|
|
12195
12265
|
};
|
|
12196
12266
|
return /* @__PURE__ */ jsxs62(Label3, { size: group4.size, htmlFor: uniqueId, children: [
|
|
12197
|
-
/* @__PURE__ */
|
|
12267
|
+
/* @__PURE__ */ jsx251(
|
|
12198
12268
|
HiddenInput,
|
|
12199
12269
|
{
|
|
12200
12270
|
...getBaseHTMLProps(uniqueId, className, htmlProps, rest),
|
|
@@ -12207,8 +12277,8 @@ var ToggleRadio = forwardRef64(
|
|
|
12207
12277
|
}
|
|
12208
12278
|
),
|
|
12209
12279
|
/* @__PURE__ */ jsxs62(Content3, { $size: group4.size, $justIcon: !!icon12 && !label3, children: [
|
|
12210
|
-
icon12 && /* @__PURE__ */
|
|
12211
|
-
label3 && /* @__PURE__ */
|
|
12280
|
+
icon12 && /* @__PURE__ */ jsx251(Icon, { icon: icon12, iconSize: "inherit" }),
|
|
12281
|
+
label3 && /* @__PURE__ */ jsx251("span", { children: label3 })
|
|
12212
12282
|
] })
|
|
12213
12283
|
] });
|
|
12214
12284
|
}
|
|
@@ -12216,7 +12286,7 @@ var ToggleRadio = forwardRef64(
|
|
|
12216
12286
|
ToggleRadio.displayName = "ToggleRadio";
|
|
12217
12287
|
|
|
12218
12288
|
// src/components/Grid/Grid.tsx
|
|
12219
|
-
import styled85, { css as
|
|
12289
|
+
import styled85, { css as css44 } from "styled-components";
|
|
12220
12290
|
|
|
12221
12291
|
// src/components/Grid/Grid.tokens.tsx
|
|
12222
12292
|
import { ddsBaseTokens as ddsBaseTokens51 } from "@norges-domstoler/dds-design-tokens";
|
|
@@ -12313,16 +12383,16 @@ var gridTokens2 = {
|
|
|
12313
12383
|
};
|
|
12314
12384
|
|
|
12315
12385
|
// src/components/Grid/Grid.context.tsx
|
|
12316
|
-
import { useContext as
|
|
12317
|
-
var GridContext =
|
|
12386
|
+
import { useContext as useContext11, createContext as createContext9 } from "react";
|
|
12387
|
+
var GridContext = createContext9({
|
|
12318
12388
|
screenSize: 3 /* Large */
|
|
12319
12389
|
});
|
|
12320
12390
|
var useGridContext = () => {
|
|
12321
|
-
return
|
|
12391
|
+
return useContext11(GridContext);
|
|
12322
12392
|
};
|
|
12323
12393
|
|
|
12324
12394
|
// src/components/Grid/Grid.tsx
|
|
12325
|
-
import { jsx as
|
|
12395
|
+
import { jsx as jsx252 } from "react/jsx-runtime";
|
|
12326
12396
|
var getHooksGridStyling = (screenSize, maxWidth, rowGap) => {
|
|
12327
12397
|
const tokens3 = gridTokens2[screenSize].grid;
|
|
12328
12398
|
return {
|
|
@@ -12345,7 +12415,7 @@ var StyledGrid = styled85.div.withConfig({
|
|
|
12345
12415
|
}
|
|
12346
12416
|
})`
|
|
12347
12417
|
display: grid;
|
|
12348
|
-
${({ maxWidth }) =>
|
|
12418
|
+
${({ maxWidth }) => css44`
|
|
12349
12419
|
max-width: ${maxWidth};
|
|
12350
12420
|
`}
|
|
12351
12421
|
${({ screenSize, maxWidth, rowGap }) => getHooksGridStyling(screenSize, maxWidth, rowGap)}
|
|
@@ -12353,14 +12423,14 @@ var StyledGrid = styled85.div.withConfig({
|
|
|
12353
12423
|
var Grid = (props) => {
|
|
12354
12424
|
const { id, className, children, htmlProps, as, ...rest } = props;
|
|
12355
12425
|
const screenSize = useScreenSize();
|
|
12356
|
-
return /* @__PURE__ */
|
|
12426
|
+
return /* @__PURE__ */ jsx252(GridContext.Provider, { value: { screenSize }, children: as === "div" ? /* @__PURE__ */ jsx252(
|
|
12357
12427
|
StyledGrid,
|
|
12358
12428
|
{
|
|
12359
12429
|
...getBaseHTMLProps(id, className, htmlProps, rest),
|
|
12360
12430
|
screenSize,
|
|
12361
12431
|
children
|
|
12362
12432
|
}
|
|
12363
|
-
) : /* @__PURE__ */
|
|
12433
|
+
) : /* @__PURE__ */ jsx252(
|
|
12364
12434
|
StyledGrid,
|
|
12365
12435
|
{
|
|
12366
12436
|
...getBaseHTMLProps(id, className, htmlProps, rest),
|
|
@@ -12374,7 +12444,7 @@ Grid.displayName = "Grid";
|
|
|
12374
12444
|
|
|
12375
12445
|
// src/components/Grid/GridChild.tsx
|
|
12376
12446
|
import styled86 from "styled-components";
|
|
12377
|
-
import { jsx as
|
|
12447
|
+
import { jsx as jsx253 } from "react/jsx-runtime";
|
|
12378
12448
|
var isRelativeGridColumn = (type) => {
|
|
12379
12449
|
return type === "all" || type === "firstHalf" || type === "secondHalf";
|
|
12380
12450
|
};
|
|
@@ -12400,7 +12470,7 @@ var StyledGridChild = styled86.div.withConfig({
|
|
|
12400
12470
|
var GridChild = (props) => {
|
|
12401
12471
|
const { id, className, htmlProps, children, ...rest } = props;
|
|
12402
12472
|
const { screenSize } = useGridContext();
|
|
12403
|
-
return /* @__PURE__ */
|
|
12473
|
+
return /* @__PURE__ */ jsx253(
|
|
12404
12474
|
StyledGridChild,
|
|
12405
12475
|
{
|
|
12406
12476
|
...getBaseHTMLProps(id, className, htmlProps, rest),
|
|
@@ -12419,19 +12489,19 @@ import {
|
|
|
12419
12489
|
Fragment as Fragment11,
|
|
12420
12490
|
isValidElement as isValidElement8,
|
|
12421
12491
|
useEffect as useEffect24,
|
|
12422
|
-
useState as
|
|
12492
|
+
useState as useState27,
|
|
12423
12493
|
useMemo as useMemo2
|
|
12424
12494
|
} from "react";
|
|
12425
12495
|
import styled88 from "styled-components";
|
|
12426
12496
|
|
|
12427
12497
|
// src/components/ProgressTracker/ProgressTracker.context.tsx
|
|
12428
|
-
import { createContext as
|
|
12429
|
-
var ProgressTrackerContext =
|
|
12498
|
+
import { createContext as createContext10, useContext as useContext12 } from "react";
|
|
12499
|
+
var ProgressTrackerContext = createContext10(
|
|
12430
12500
|
{
|
|
12431
12501
|
activeStep: 0
|
|
12432
12502
|
}
|
|
12433
12503
|
);
|
|
12434
|
-
var useProgressTrackerContext = () =>
|
|
12504
|
+
var useProgressTrackerContext = () => useContext12(ProgressTrackerContext);
|
|
12435
12505
|
|
|
12436
12506
|
// src/components/ProgressTracker/ProgressTracker.tokens.tsx
|
|
12437
12507
|
import { ddsBaseTokens as ddsBaseTokens52 } from "@norges-domstoler/dds-design-tokens";
|
|
@@ -12514,8 +12584,8 @@ var progressTrackerTokens = {
|
|
|
12514
12584
|
|
|
12515
12585
|
// src/components/ProgressTracker/ProgressTrackerItem.tsx
|
|
12516
12586
|
import { useMemo } from "react";
|
|
12517
|
-
import styled87, { css as
|
|
12518
|
-
import { jsx as
|
|
12587
|
+
import styled87, { css as css45 } from "styled-components";
|
|
12588
|
+
import { jsx as jsx254, jsxs as jsxs63 } from "react/jsx-runtime";
|
|
12519
12589
|
var toItemState = (active, completed, disabled) => {
|
|
12520
12590
|
if (disabled) {
|
|
12521
12591
|
return "disabled";
|
|
@@ -12552,31 +12622,31 @@ var ItemNumber = styled87.div`
|
|
|
12552
12622
|
${({ $state: state }) => {
|
|
12553
12623
|
switch (state) {
|
|
12554
12624
|
case "activeIncomplete":
|
|
12555
|
-
return
|
|
12625
|
+
return css45`
|
|
12556
12626
|
border-color: ${itemNumber2.active.borderColor};
|
|
12557
12627
|
color: ${itemNumber2.active.color};
|
|
12558
12628
|
background-color: ${itemNumber2.active.backgroundColor};
|
|
12559
12629
|
`;
|
|
12560
12630
|
case "activeCompleted":
|
|
12561
|
-
return
|
|
12631
|
+
return css45`
|
|
12562
12632
|
border-color: ${itemNumber2.completed.borderColor};
|
|
12563
12633
|
color: ${itemNumber2.completed.color};
|
|
12564
12634
|
background-color: ${itemNumber2.completed.backgroundColor};
|
|
12565
12635
|
`;
|
|
12566
12636
|
case "inactiveCompleted":
|
|
12567
|
-
return
|
|
12637
|
+
return css45`
|
|
12568
12638
|
border-color: ${itemNumber2.completed.borderColor};
|
|
12569
12639
|
color: ${itemNumber2.completed.color};
|
|
12570
12640
|
background-color: ${itemNumber2.completed.backgroundColor};
|
|
12571
12641
|
`;
|
|
12572
12642
|
case "inactiveIncomplete":
|
|
12573
|
-
return
|
|
12643
|
+
return css45`
|
|
12574
12644
|
border-color: ${itemNumber2.inactive.borderColor};
|
|
12575
12645
|
color: ${itemNumber2.inactive.color};
|
|
12576
12646
|
background-color: ${itemNumber2.inactive.backgroundColor};
|
|
12577
12647
|
`;
|
|
12578
12648
|
case "disabled":
|
|
12579
|
-
return
|
|
12649
|
+
return css45`
|
|
12580
12650
|
border-color: ${itemNumber2.disabled.borderColor};
|
|
12581
12651
|
color: ${itemNumber2.disabled.color};
|
|
12582
12652
|
background-color: ${itemNumber2.disabled.backgroundColor};
|
|
@@ -12594,18 +12664,18 @@ var ItemText = styled87.div`
|
|
|
12594
12664
|
switch (state) {
|
|
12595
12665
|
case "activeCompleted":
|
|
12596
12666
|
case "activeIncomplete":
|
|
12597
|
-
return
|
|
12667
|
+
return css45`
|
|
12598
12668
|
color: ${itemText2.active.color};
|
|
12599
12669
|
text-decoration-color: ${itemText2.active.textDecorationColor};
|
|
12600
12670
|
`;
|
|
12601
12671
|
case "inactiveCompleted":
|
|
12602
12672
|
case "inactiveIncomplete":
|
|
12603
|
-
return
|
|
12673
|
+
return css45`
|
|
12604
12674
|
color: ${itemText2.inactive.color};
|
|
12605
12675
|
text-decoration-color: ${itemText2.inactive.textDecorationColor};
|
|
12606
12676
|
`;
|
|
12607
12677
|
case "disabled":
|
|
12608
|
-
return
|
|
12678
|
+
return css45`
|
|
12609
12679
|
color: ${itemText2.disabled.color};
|
|
12610
12680
|
text-decoration: ${itemText2.disabled.textDecoration};
|
|
12611
12681
|
`;
|
|
@@ -12629,7 +12699,7 @@ var ItemContentWrapper = styled87.button`
|
|
|
12629
12699
|
${focusVisible}
|
|
12630
12700
|
}
|
|
12631
12701
|
|
|
12632
|
-
${({ $state: state }) => state !== "disabled" &&
|
|
12702
|
+
${({ $state: state }) => state !== "disabled" && css45`
|
|
12633
12703
|
cursor: pointer;
|
|
12634
12704
|
`}
|
|
12635
12705
|
`;
|
|
@@ -12649,14 +12719,14 @@ var ProgressTrackerItem = (props) => {
|
|
|
12649
12719
|
};
|
|
12650
12720
|
const stepNumberContent = useMemo(() => {
|
|
12651
12721
|
if (completed) {
|
|
12652
|
-
return /* @__PURE__ */
|
|
12722
|
+
return /* @__PURE__ */ jsx254(Icon, { icon: CheckIcon, iconSize: itemNumber2.iconSize });
|
|
12653
12723
|
}
|
|
12654
12724
|
if (icon12 !== void 0) {
|
|
12655
|
-
return /* @__PURE__ */
|
|
12725
|
+
return /* @__PURE__ */ jsx254(Icon, { icon: icon12, iconSize: itemNumber2.iconSize });
|
|
12656
12726
|
}
|
|
12657
12727
|
return index + 1;
|
|
12658
12728
|
}, [completed, icon12, index]);
|
|
12659
|
-
return /* @__PURE__ */
|
|
12729
|
+
return /* @__PURE__ */ jsx254(ItemWrapper, { "aria-current": active ? "step" : void 0, children: /* @__PURE__ */ jsxs63(
|
|
12660
12730
|
ItemContentWrapper,
|
|
12661
12731
|
{
|
|
12662
12732
|
...styleProps,
|
|
@@ -12664,9 +12734,9 @@ var ProgressTrackerItem = (props) => {
|
|
|
12664
12734
|
onClick: !disabled && handleStepChange ? () => handleStepChange(index) : void 0,
|
|
12665
12735
|
disabled,
|
|
12666
12736
|
children: [
|
|
12667
|
-
/* @__PURE__ */
|
|
12737
|
+
/* @__PURE__ */ jsx254(ItemNumber, { ...styleProps, "aria-hidden": true, children: stepNumberContent }),
|
|
12668
12738
|
/* @__PURE__ */ jsxs63(ItemText, { ...styleProps, children: [
|
|
12669
|
-
/* @__PURE__ */
|
|
12739
|
+
/* @__PURE__ */ jsx254(VisuallyHidden, { as: "span", children: getVisuallyHiddenText(active, completed, index) }),
|
|
12670
12740
|
children
|
|
12671
12741
|
] })
|
|
12672
12742
|
]
|
|
@@ -12676,7 +12746,7 @@ var ProgressTrackerItem = (props) => {
|
|
|
12676
12746
|
ProgressTrackerItem.displayName = "ProgressTracker.Item";
|
|
12677
12747
|
|
|
12678
12748
|
// src/components/ProgressTracker/ProgressTracker.tsx
|
|
12679
|
-
import { jsx as
|
|
12749
|
+
import { jsx as jsx255, jsxs as jsxs64 } from "react/jsx-runtime";
|
|
12680
12750
|
var ItemsWrapper = styled88.ol`
|
|
12681
12751
|
display: flex;
|
|
12682
12752
|
flex-direction: column;
|
|
@@ -12705,7 +12775,7 @@ var ProgressTracker = (() => {
|
|
|
12705
12775
|
htmlProps,
|
|
12706
12776
|
...rest
|
|
12707
12777
|
} = props;
|
|
12708
|
-
const [thisActiveStep, setActiveStep] =
|
|
12778
|
+
const [thisActiveStep, setActiveStep] = useState27(activeStep);
|
|
12709
12779
|
const handleChange = (step) => {
|
|
12710
12780
|
setActiveStep(step);
|
|
12711
12781
|
onStepChange && onStepChange(step);
|
|
@@ -12725,14 +12795,14 @@ var ProgressTracker = (() => {
|
|
|
12725
12795
|
const itemsWithConnectorsBetween = intersperseItemsWithConnector(itemsWithIndex);
|
|
12726
12796
|
return itemsWithConnectorsBetween;
|
|
12727
12797
|
}, [children]);
|
|
12728
|
-
return /* @__PURE__ */
|
|
12798
|
+
return /* @__PURE__ */ jsx255(
|
|
12729
12799
|
ProgressTrackerContext.Provider,
|
|
12730
12800
|
{
|
|
12731
12801
|
value: {
|
|
12732
12802
|
activeStep: thisActiveStep,
|
|
12733
12803
|
handleStepChange: handleChange
|
|
12734
12804
|
},
|
|
12735
|
-
children: /* @__PURE__ */
|
|
12805
|
+
children: /* @__PURE__ */ jsx255("div", { role: "group", "aria-label": "progress", ...containerProps, children: /* @__PURE__ */ jsx255(ItemsWrapper, { children: steps }) })
|
|
12736
12806
|
}
|
|
12737
12807
|
);
|
|
12738
12808
|
});
|
|
@@ -12757,7 +12827,7 @@ var intersperseItemsWithConnector = (children) => Children7.map(children, (child
|
|
|
12757
12827
|
return child;
|
|
12758
12828
|
}
|
|
12759
12829
|
return /* @__PURE__ */ jsxs64(Fragment11, { children: [
|
|
12760
|
-
/* @__PURE__ */
|
|
12830
|
+
/* @__PURE__ */ jsx255(ProgressTrackerConnector, { "aria-hidden": true }),
|
|
12761
12831
|
child
|
|
12762
12832
|
] }, index);
|
|
12763
12833
|
});
|
|
@@ -12767,12 +12837,12 @@ import { forwardRef as forwardRef67, useRef as useRef27 } from "react";
|
|
|
12767
12837
|
|
|
12768
12838
|
// src/components/InlineEdit/InlineEdit.tsx
|
|
12769
12839
|
import {
|
|
12770
|
-
useState as
|
|
12840
|
+
useState as useState28,
|
|
12771
12841
|
Children as Children8,
|
|
12772
12842
|
cloneElement as cloneElement9,
|
|
12773
12843
|
isValidElement as isValidElement9
|
|
12774
12844
|
} from "react";
|
|
12775
|
-
import { Fragment as Fragment12, jsx as
|
|
12845
|
+
import { Fragment as Fragment12, jsx as jsx256 } from "react/jsx-runtime";
|
|
12776
12846
|
var InlineEdit = (props) => {
|
|
12777
12847
|
const {
|
|
12778
12848
|
emptiable,
|
|
@@ -12784,8 +12854,8 @@ var InlineEdit = (props) => {
|
|
|
12784
12854
|
inputRef,
|
|
12785
12855
|
children
|
|
12786
12856
|
} = props;
|
|
12787
|
-
const [editingValue, setEditingValue] =
|
|
12788
|
-
const [isEditing, setIsEditing] =
|
|
12857
|
+
const [editingValue, setEditingValue] = useState28(value != null ? value : "");
|
|
12858
|
+
const [isEditing, setIsEditing] = useState28(false);
|
|
12789
12859
|
const onChangeHandler = (e) => {
|
|
12790
12860
|
setEditingValue(e.target.value);
|
|
12791
12861
|
onChange && onChange();
|
|
@@ -12822,7 +12892,7 @@ var InlineEdit = (props) => {
|
|
|
12822
12892
|
emptiable
|
|
12823
12893
|
})
|
|
12824
12894
|
);
|
|
12825
|
-
return /* @__PURE__ */
|
|
12895
|
+
return /* @__PURE__ */ jsx256(Fragment12, { children: inputChild });
|
|
12826
12896
|
};
|
|
12827
12897
|
InlineEdit.displayName = "InlineEdit";
|
|
12828
12898
|
|
|
@@ -12830,7 +12900,7 @@ InlineEdit.displayName = "InlineEdit";
|
|
|
12830
12900
|
import { forwardRef as forwardRef66, useId as useId23, useRef as useRef26 } from "react";
|
|
12831
12901
|
|
|
12832
12902
|
// src/components/InlineEdit/InlineEdit.styles.tsx
|
|
12833
|
-
import styled89, { css as
|
|
12903
|
+
import styled89, { css as css46 } from "styled-components";
|
|
12834
12904
|
|
|
12835
12905
|
// src/components/InlineEdit/InlineEdit.tokens.ts
|
|
12836
12906
|
import { ddsBaseTokens as ddsBaseTokens53 } from "@norges-domstoler/dds-design-tokens";
|
|
@@ -12868,7 +12938,7 @@ var StyledInlineInput = styled89(StatefulInput).withConfig({
|
|
|
12868
12938
|
background-color: ${inlineEdit2.backgroundColor};
|
|
12869
12939
|
padding: ${inlineEdit2.padding};
|
|
12870
12940
|
${inlineEdit2.font};
|
|
12871
|
-
${({ isEditing, hideIcon }) => !isEditing && !hideIcon &&
|
|
12941
|
+
${({ isEditing, hideIcon }) => !isEditing && !hideIcon && css46`
|
|
12872
12942
|
padding-left: ${inlineEdit2.withIcon.paddingLeft};
|
|
12873
12943
|
`}
|
|
12874
12944
|
|
|
@@ -12907,7 +12977,7 @@ var inlineEditVisuallyHidden = (id, emptiable) => /* @__PURE__ */ jsxs65(Visuall
|
|
|
12907
12977
|
] });
|
|
12908
12978
|
|
|
12909
12979
|
// src/components/InlineEdit/InlineTextArea.tsx
|
|
12910
|
-
import { jsx as
|
|
12980
|
+
import { jsx as jsx257, jsxs as jsxs66 } from "react/jsx-runtime";
|
|
12911
12981
|
var InlineTextArea = forwardRef66((props, ref) => {
|
|
12912
12982
|
const {
|
|
12913
12983
|
id,
|
|
@@ -12929,17 +12999,17 @@ var InlineTextArea = forwardRef66((props, ref) => {
|
|
|
12929
12999
|
const combinedRef = useCombinedRef(ref, inputRef);
|
|
12930
13000
|
return /* @__PURE__ */ jsxs66(OuterInputContainer, { width, children: [
|
|
12931
13001
|
/* @__PURE__ */ jsxs66(InputContainer, { children: [
|
|
12932
|
-
!isEditing && !hideIcon && /* @__PURE__ */
|
|
13002
|
+
!isEditing && !hideIcon && /* @__PURE__ */ jsx257(
|
|
12933
13003
|
IconWrapper2,
|
|
12934
13004
|
{
|
|
12935
13005
|
onClick: () => {
|
|
12936
13006
|
var _a;
|
|
12937
13007
|
(_a = inputRef.current) == null ? void 0 : _a.focus();
|
|
12938
13008
|
},
|
|
12939
|
-
children: /* @__PURE__ */
|
|
13009
|
+
children: /* @__PURE__ */ jsx257(Icon, { icon: EditIcon, iconSize: "small" })
|
|
12940
13010
|
}
|
|
12941
13011
|
),
|
|
12942
|
-
/* @__PURE__ */
|
|
13012
|
+
/* @__PURE__ */ jsx257(
|
|
12943
13013
|
StyledInlineTextArea,
|
|
12944
13014
|
{
|
|
12945
13015
|
...rest,
|
|
@@ -12963,12 +13033,12 @@ var InlineTextArea = forwardRef66((props, ref) => {
|
|
|
12963
13033
|
InlineTextArea.displayName = "InlineTextArea";
|
|
12964
13034
|
|
|
12965
13035
|
// src/components/InlineEdit/InlineEditTextArea.tsx
|
|
12966
|
-
import { jsx as
|
|
13036
|
+
import { jsx as jsx258 } from "react/jsx-runtime";
|
|
12967
13037
|
var InlineEditTextArea = forwardRef67((props, ref) => {
|
|
12968
13038
|
const { onSetValue, emptiable, value, onFocus, onChange, onBlur, ...rest } = props;
|
|
12969
13039
|
const textareaRef = useRef27(null);
|
|
12970
13040
|
const combinedRef = useCombinedRef(ref, textareaRef);
|
|
12971
|
-
return /* @__PURE__ */
|
|
13041
|
+
return /* @__PURE__ */ jsx258(
|
|
12972
13042
|
InlineEdit,
|
|
12973
13043
|
{
|
|
12974
13044
|
onSetValue,
|
|
@@ -12978,7 +13048,7 @@ var InlineEditTextArea = forwardRef67((props, ref) => {
|
|
|
12978
13048
|
onFocus,
|
|
12979
13049
|
onChange,
|
|
12980
13050
|
onBlur,
|
|
12981
|
-
children: /* @__PURE__ */
|
|
13051
|
+
children: /* @__PURE__ */ jsx258(InlineTextArea, { ref: combinedRef, ...rest })
|
|
12982
13052
|
}
|
|
12983
13053
|
);
|
|
12984
13054
|
});
|
|
@@ -12988,7 +13058,7 @@ import { forwardRef as forwardRef69, useRef as useRef29 } from "react";
|
|
|
12988
13058
|
|
|
12989
13059
|
// src/components/InlineEdit/InlineInput.tsx
|
|
12990
13060
|
import { forwardRef as forwardRef68, useId as useId24, useRef as useRef28 } from "react";
|
|
12991
|
-
import { jsx as
|
|
13061
|
+
import { jsx as jsx259, jsxs as jsxs67 } from "react/jsx-runtime";
|
|
12992
13062
|
var InlineInput = forwardRef68(
|
|
12993
13063
|
(props, ref) => {
|
|
12994
13064
|
const {
|
|
@@ -13013,17 +13083,17 @@ var InlineInput = forwardRef68(
|
|
|
13013
13083
|
const combinedRef = useCombinedRef(ref, inputRef);
|
|
13014
13084
|
return /* @__PURE__ */ jsxs67(OuterInputContainer, { width, children: [
|
|
13015
13085
|
/* @__PURE__ */ jsxs67(InputContainer, { children: [
|
|
13016
|
-
!isEditing && !hideIcon && /* @__PURE__ */
|
|
13086
|
+
!isEditing && !hideIcon && /* @__PURE__ */ jsx259(
|
|
13017
13087
|
IconWrapper2,
|
|
13018
13088
|
{
|
|
13019
13089
|
onClick: () => {
|
|
13020
13090
|
var _a;
|
|
13021
13091
|
(_a = inputRef.current) == null ? void 0 : _a.focus();
|
|
13022
13092
|
},
|
|
13023
|
-
children: /* @__PURE__ */
|
|
13093
|
+
children: /* @__PURE__ */ jsx259(Icon, { icon: EditIcon, iconSize: "small" })
|
|
13024
13094
|
}
|
|
13025
13095
|
),
|
|
13026
|
-
/* @__PURE__ */
|
|
13096
|
+
/* @__PURE__ */ jsx259(
|
|
13027
13097
|
StyledInlineInput,
|
|
13028
13098
|
{
|
|
13029
13099
|
...rest,
|
|
@@ -13049,12 +13119,12 @@ var InlineInput = forwardRef68(
|
|
|
13049
13119
|
InlineInput.displayName = "InlineInput";
|
|
13050
13120
|
|
|
13051
13121
|
// src/components/InlineEdit/InlineEditInput.tsx
|
|
13052
|
-
import { jsx as
|
|
13122
|
+
import { jsx as jsx260 } from "react/jsx-runtime";
|
|
13053
13123
|
var InlineEditInput = forwardRef69((props, ref) => {
|
|
13054
13124
|
const { onSetValue, emptiable, value, onFocus, onChange, onBlur, ...rest } = props;
|
|
13055
13125
|
const inputRef = useRef29(null);
|
|
13056
13126
|
const combinedRef = useCombinedRef(ref, inputRef);
|
|
13057
|
-
return /* @__PURE__ */
|
|
13127
|
+
return /* @__PURE__ */ jsx260(
|
|
13058
13128
|
InlineEdit,
|
|
13059
13129
|
{
|
|
13060
13130
|
onSetValue,
|
|
@@ -13064,13 +13134,13 @@ var InlineEditInput = forwardRef69((props, ref) => {
|
|
|
13064
13134
|
onFocus,
|
|
13065
13135
|
onChange,
|
|
13066
13136
|
onBlur,
|
|
13067
|
-
children: /* @__PURE__ */
|
|
13137
|
+
children: /* @__PURE__ */ jsx260(InlineInput, { ...rest, ref: combinedRef })
|
|
13068
13138
|
}
|
|
13069
13139
|
);
|
|
13070
13140
|
});
|
|
13071
13141
|
|
|
13072
13142
|
// src/components/TextArea/TextArea.tsx
|
|
13073
|
-
import { forwardRef as forwardRef70, useEffect as useEffect25, useId as useId25, useRef as useRef30, useState as
|
|
13143
|
+
import { forwardRef as forwardRef70, useEffect as useEffect25, useId as useId25, useRef as useRef30, useState as useState29 } from "react";
|
|
13074
13144
|
import styled90 from "styled-components";
|
|
13075
13145
|
|
|
13076
13146
|
// src/components/TextArea/TextArea.tokens.tsx
|
|
@@ -13084,7 +13154,7 @@ var textAreaTokens = {
|
|
|
13084
13154
|
};
|
|
13085
13155
|
|
|
13086
13156
|
// src/components/TextArea/TextArea.tsx
|
|
13087
|
-
import { jsx as
|
|
13157
|
+
import { jsx as jsx261, jsxs as jsxs68 } from "react/jsx-runtime";
|
|
13088
13158
|
var defaultWidth5 = "320px";
|
|
13089
13159
|
var { textarea: textarea2 } = textAreaTokens;
|
|
13090
13160
|
var StyledTextArea = styled90(StatefulInput)`
|
|
@@ -13119,7 +13189,7 @@ var TextArea = forwardRef70(
|
|
|
13119
13189
|
const uniqueId = id != null ? id : `${generatedId}-textArea`;
|
|
13120
13190
|
const textAreaRef = useRef30(null);
|
|
13121
13191
|
const multiRef = useCombinedRef(ref, textAreaRef);
|
|
13122
|
-
const [text, setText] =
|
|
13192
|
+
const [text, setText] = useState29(
|
|
13123
13193
|
getDefaultText(value, defaultValue)
|
|
13124
13194
|
);
|
|
13125
13195
|
useEffect25(() => {
|
|
@@ -13162,8 +13232,8 @@ var TextArea = forwardRef70(
|
|
|
13162
13232
|
...rest
|
|
13163
13233
|
};
|
|
13164
13234
|
return /* @__PURE__ */ jsxs68(OuterInputContainer, { ...containerProps, children: [
|
|
13165
|
-
hasLabel && /* @__PURE__ */
|
|
13166
|
-
/* @__PURE__ */
|
|
13235
|
+
hasLabel && /* @__PURE__ */ jsx261(Label, { showRequiredStyling, htmlFor: uniqueId, children: label3 }),
|
|
13236
|
+
/* @__PURE__ */ jsx261(StyledTextArea, { ...textAreaProps, as: "textarea" }),
|
|
13167
13237
|
renderInputMessage(tip, tipId, errorMessage, errorMessageId)
|
|
13168
13238
|
] });
|
|
13169
13239
|
}
|
|
@@ -13171,7 +13241,7 @@ var TextArea = forwardRef70(
|
|
|
13171
13241
|
TextArea.displayName = "TextArea";
|
|
13172
13242
|
|
|
13173
13243
|
// src/components/SplitButton/SplitButton.tsx
|
|
13174
|
-
import { forwardRef as forwardRef71, useState as
|
|
13244
|
+
import { forwardRef as forwardRef71, useState as useState30 } from "react";
|
|
13175
13245
|
import styled91 from "styled-components";
|
|
13176
13246
|
|
|
13177
13247
|
// src/components/SplitButton/SplitButton.tokens.ts
|
|
@@ -13186,7 +13256,7 @@ var tokens2 = {
|
|
|
13186
13256
|
};
|
|
13187
13257
|
|
|
13188
13258
|
// src/components/SplitButton/SplitButton.tsx
|
|
13189
|
-
import { jsx as
|
|
13259
|
+
import { jsx as jsx262, jsxs as jsxs69 } from "react/jsx-runtime";
|
|
13190
13260
|
var Container16 = styled91.div`
|
|
13191
13261
|
display: flex;
|
|
13192
13262
|
`;
|
|
@@ -13225,14 +13295,14 @@ var SplitButton = forwardRef71(
|
|
|
13225
13295
|
secondaryActions,
|
|
13226
13296
|
purpose = "primary"
|
|
13227
13297
|
} = props;
|
|
13228
|
-
const [isOpen, setIsOpen] =
|
|
13298
|
+
const [isOpen, setIsOpen] = useState30(false);
|
|
13229
13299
|
const buttonStyleProps = {
|
|
13230
13300
|
appearance: "filled",
|
|
13231
13301
|
purpose,
|
|
13232
13302
|
size: size2
|
|
13233
13303
|
};
|
|
13234
13304
|
return /* @__PURE__ */ jsxs69(Container16, { ref, children: [
|
|
13235
|
-
/* @__PURE__ */
|
|
13305
|
+
/* @__PURE__ */ jsx262(
|
|
13236
13306
|
MainButton,
|
|
13237
13307
|
{
|
|
13238
13308
|
...buttonStyleProps,
|
|
@@ -13241,7 +13311,7 @@ var SplitButton = forwardRef71(
|
|
|
13241
13311
|
}
|
|
13242
13312
|
),
|
|
13243
13313
|
/* @__PURE__ */ jsxs69(OverflowMenuGroup, { onToggle: () => setIsOpen(!isOpen), children: [
|
|
13244
|
-
/* @__PURE__ */
|
|
13314
|
+
/* @__PURE__ */ jsx262(
|
|
13245
13315
|
OptionButton,
|
|
13246
13316
|
{
|
|
13247
13317
|
...buttonStyleProps,
|
|
@@ -13250,7 +13320,7 @@ var SplitButton = forwardRef71(
|
|
|
13250
13320
|
purpose
|
|
13251
13321
|
}
|
|
13252
13322
|
),
|
|
13253
|
-
/* @__PURE__ */
|
|
13323
|
+
/* @__PURE__ */ jsx262(OverflowMenu, { items: secondaryActions, placement: "bottom-end" })
|
|
13254
13324
|
] })
|
|
13255
13325
|
] });
|
|
13256
13326
|
}
|
|
@@ -13259,7 +13329,7 @@ SplitButton.displayName = "SplitButton";
|
|
|
13259
13329
|
|
|
13260
13330
|
// src/components/Stack/Stack.tsx
|
|
13261
13331
|
import { forwardRef as forwardRef72 } from "react";
|
|
13262
|
-
import styled92, { css as
|
|
13332
|
+
import styled92, { css as css47 } from "styled-components";
|
|
13263
13333
|
|
|
13264
13334
|
// src/components/Stack/Stack.tokens.tsx
|
|
13265
13335
|
import { ddsBaseTokens as ddsBaseTokens56 } from "@norges-domstoler/dds-design-tokens";
|
|
@@ -13283,7 +13353,7 @@ var stackTokens = {
|
|
|
13283
13353
|
};
|
|
13284
13354
|
|
|
13285
13355
|
// src/components/Stack/Stack.tsx
|
|
13286
|
-
import { jsx as
|
|
13356
|
+
import { jsx as jsx263 } from "react/jsx-runtime";
|
|
13287
13357
|
var Stack = styled92.div.withConfig({
|
|
13288
13358
|
shouldForwardProp: (prop) => {
|
|
13289
13359
|
const styleOnlyProps = [
|
|
@@ -13301,11 +13371,11 @@ var Stack = styled92.div.withConfig({
|
|
|
13301
13371
|
align-items: ${(props) => props.align};
|
|
13302
13372
|
justify-content: ${(props) => props.justify};
|
|
13303
13373
|
|
|
13304
|
-
${({ gap }) => gap !== void 0 &&
|
|
13374
|
+
${({ gap }) => gap !== void 0 && css47`
|
|
13305
13375
|
gap: ${gap === 0 ? "0" : stackTokens.spacing[gap]};
|
|
13306
13376
|
`}
|
|
13307
13377
|
|
|
13308
|
-
${({ padding }) => padding !== void 0 &&
|
|
13378
|
+
${({ padding }) => padding !== void 0 && css47`
|
|
13309
13379
|
padding: ${padding === 0 ? "0" : stackTokens.spacing[padding]};
|
|
13310
13380
|
`}
|
|
13311
13381
|
`;
|
|
@@ -13314,7 +13384,7 @@ Stack.defaultProps = {
|
|
|
13314
13384
|
justify: "flex-start"
|
|
13315
13385
|
};
|
|
13316
13386
|
var HStack = forwardRef72(
|
|
13317
|
-
({ id, className, htmlProps, ...rest }, ref) => /* @__PURE__ */
|
|
13387
|
+
({ id, className, htmlProps, ...rest }, ref) => /* @__PURE__ */ jsx263(
|
|
13318
13388
|
Stack,
|
|
13319
13389
|
{
|
|
13320
13390
|
direction: "horizontal",
|
|
@@ -13325,7 +13395,7 @@ var HStack = forwardRef72(
|
|
|
13325
13395
|
);
|
|
13326
13396
|
HStack.displayName = "HStack";
|
|
13327
13397
|
var VStack = forwardRef72(
|
|
13328
|
-
({ id, className, htmlProps, ...rest }, ref) => /* @__PURE__ */
|
|
13398
|
+
({ id, className, htmlProps, ...rest }, ref) => /* @__PURE__ */ jsx263(
|
|
13329
13399
|
Stack,
|
|
13330
13400
|
{
|
|
13331
13401
|
direction: "vertical",
|
|
@@ -13373,7 +13443,7 @@ var errorsTokens = {
|
|
|
13373
13443
|
};
|
|
13374
13444
|
|
|
13375
13445
|
// src/components/FileUploader/ErrorList.tsx
|
|
13376
|
-
import { jsx as
|
|
13446
|
+
import { jsx as jsx264 } from "react/jsx-runtime";
|
|
13377
13447
|
var MessageContainer2 = styled93.div`
|
|
13378
13448
|
display: flex;
|
|
13379
13449
|
flex-direction: column;
|
|
@@ -13384,8 +13454,8 @@ var ErrorList = (props) => {
|
|
|
13384
13454
|
if (errors.length < 1) {
|
|
13385
13455
|
return null;
|
|
13386
13456
|
}
|
|
13387
|
-
return /* @__PURE__ */
|
|
13388
|
-
return /* @__PURE__ */
|
|
13457
|
+
return /* @__PURE__ */ jsx264(MessageContainer2, { children: errors.map(({ id, message: message2 }) => {
|
|
13458
|
+
return /* @__PURE__ */ jsx264(
|
|
13389
13459
|
InputMessage,
|
|
13390
13460
|
{
|
|
13391
13461
|
id,
|
|
@@ -13399,7 +13469,7 @@ var ErrorList = (props) => {
|
|
|
13399
13469
|
|
|
13400
13470
|
// src/components/FileUploader/File.tsx
|
|
13401
13471
|
import styled94 from "styled-components";
|
|
13402
|
-
import { jsx as
|
|
13472
|
+
import { jsx as jsx265, jsxs as jsxs70 } from "react/jsx-runtime";
|
|
13403
13473
|
var FileWrapper = styled94.li``;
|
|
13404
13474
|
var FileNameWrapper = styled94.span`
|
|
13405
13475
|
word-break: break-all;
|
|
@@ -13427,8 +13497,8 @@ var File = (props) => {
|
|
|
13427
13497
|
}));
|
|
13428
13498
|
return /* @__PURE__ */ jsxs70(FileWrapper, { children: [
|
|
13429
13499
|
/* @__PURE__ */ jsxs70(FileElement, { ...props, children: [
|
|
13430
|
-
/* @__PURE__ */
|
|
13431
|
-
/* @__PURE__ */
|
|
13500
|
+
/* @__PURE__ */ jsx265(FileNameWrapper, { children: stateFile.file.name }),
|
|
13501
|
+
/* @__PURE__ */ jsx265(
|
|
13432
13502
|
RemoveFileButton,
|
|
13433
13503
|
{
|
|
13434
13504
|
size: "small",
|
|
@@ -13448,7 +13518,7 @@ var File = (props) => {
|
|
|
13448
13518
|
}
|
|
13449
13519
|
)
|
|
13450
13520
|
] }),
|
|
13451
|
-
/* @__PURE__ */
|
|
13521
|
+
/* @__PURE__ */ jsx265(ErrorList, { errors: errorsList })
|
|
13452
13522
|
] }, stateFile.file.name);
|
|
13453
13523
|
};
|
|
13454
13524
|
|
|
@@ -13727,7 +13797,7 @@ var useFileUploader = (props) => {
|
|
|
13727
13797
|
};
|
|
13728
13798
|
|
|
13729
13799
|
// src/components/FileUploader/FileUploader.tsx
|
|
13730
|
-
import { jsx as
|
|
13800
|
+
import { jsx as jsx266, jsxs as jsxs71 } from "react/jsx-runtime";
|
|
13731
13801
|
var defaultWidth6 = "320px";
|
|
13732
13802
|
var Wrapper8 = styled95.div`
|
|
13733
13803
|
width: ${({ width }) => width ? width : defaultWidth6};
|
|
@@ -13787,7 +13857,7 @@ var FileUploader = (props) => {
|
|
|
13787
13857
|
const hasRootErrors = rootErrors.length > 0;
|
|
13788
13858
|
const showRequiredMarker = required;
|
|
13789
13859
|
const tipId = derivativeIdGenerator(uniqueId, "tip");
|
|
13790
|
-
const fileListElements = stateFiles.map((stateFile, index) => /* @__PURE__ */
|
|
13860
|
+
const fileListElements = stateFiles.map((stateFile, index) => /* @__PURE__ */ jsx266(
|
|
13791
13861
|
File,
|
|
13792
13862
|
{
|
|
13793
13863
|
parentId: uniqueId,
|
|
@@ -13803,8 +13873,8 @@ var FileUploader = (props) => {
|
|
|
13803
13873
|
message: e
|
|
13804
13874
|
}));
|
|
13805
13875
|
return /* @__PURE__ */ jsxs71(Wrapper8, { width, children: [
|
|
13806
|
-
hasLabel && /* @__PURE__ */
|
|
13807
|
-
hasTip && /* @__PURE__ */
|
|
13876
|
+
hasLabel && /* @__PURE__ */ jsx266(Label, { showRequiredStyling: showRequiredMarker, htmlFor: uniqueId, children: label3 }),
|
|
13877
|
+
hasTip && /* @__PURE__ */ jsx266(InputMessage, { id: tipId, message: tip, messageType: "tip" }),
|
|
13808
13878
|
/* @__PURE__ */ jsxs71(
|
|
13809
13879
|
Root,
|
|
13810
13880
|
{
|
|
@@ -13812,11 +13882,11 @@ var FileUploader = (props) => {
|
|
|
13812
13882
|
$isDragActive: isDragActive,
|
|
13813
13883
|
$hasRootErrors: hasRootErrors,
|
|
13814
13884
|
children: [
|
|
13815
|
-
/* @__PURE__ */
|
|
13885
|
+
/* @__PURE__ */ jsx266(FileUploaderInput, { ...getInputProps() }),
|
|
13816
13886
|
"Dra og slipp filer her eller",
|
|
13817
13887
|
" ",
|
|
13818
|
-
/* @__PURE__ */
|
|
13819
|
-
/* @__PURE__ */
|
|
13888
|
+
/* @__PURE__ */ jsx266(VisuallyHidden, { as: "span", children: "velg fil med p\xE5f\xF8lgende knapp" }),
|
|
13889
|
+
/* @__PURE__ */ jsx266(
|
|
13820
13890
|
Button,
|
|
13821
13891
|
{
|
|
13822
13892
|
...getButtonProps(),
|
|
@@ -13839,8 +13909,8 @@ var FileUploader = (props) => {
|
|
|
13839
13909
|
]
|
|
13840
13910
|
}
|
|
13841
13911
|
),
|
|
13842
|
-
/* @__PURE__ */
|
|
13843
|
-
/* @__PURE__ */
|
|
13912
|
+
/* @__PURE__ */ jsx266(ErrorList, { errors: rootErrorsList }),
|
|
13913
|
+
/* @__PURE__ */ jsx266(FileListElement, { children: fileListElements })
|
|
13844
13914
|
] });
|
|
13845
13915
|
};
|
|
13846
13916
|
FileUploader.displayName = "FileUploader";
|
|
@@ -13848,7 +13918,7 @@ FileUploader.displayName = "FileUploader";
|
|
|
13848
13918
|
// src/components/EmptyContent/EmptyContent.tsx
|
|
13849
13919
|
import { ddsBaseTokens as ddsBaseTokens58 } from "@norges-domstoler/dds-design-tokens";
|
|
13850
13920
|
import styled96 from "styled-components";
|
|
13851
|
-
import { jsx as
|
|
13921
|
+
import { jsx as jsx267, jsxs as jsxs72 } from "react/jsx-runtime";
|
|
13852
13922
|
var { colors: colors35, spacing: spacing39 } = ddsBaseTokens58;
|
|
13853
13923
|
var StyledEmptyContent = styled96.div`
|
|
13854
13924
|
display: flex;
|
|
@@ -13868,9 +13938,9 @@ var StyledEmptyContentText = styled96.div`
|
|
|
13868
13938
|
gap: ${spacing39.SizesDdsSpacingX1};
|
|
13869
13939
|
`;
|
|
13870
13940
|
function EmptyContent({ title: title3, message: message2, ...rest }) {
|
|
13871
|
-
return /* @__PURE__ */
|
|
13872
|
-
title3 && /* @__PURE__ */
|
|
13873
|
-
/* @__PURE__ */
|
|
13941
|
+
return /* @__PURE__ */ jsx267(StyledEmptyContent, { ...rest, children: /* @__PURE__ */ jsxs72(StyledEmptyContentText, { children: [
|
|
13942
|
+
title3 && /* @__PURE__ */ jsx267(Typography, { typographyType: "headingSans02", children: title3 }),
|
|
13943
|
+
/* @__PURE__ */ jsx267(Typography, { typographyType: "bodySans02", children: message2 })
|
|
13874
13944
|
] }) });
|
|
13875
13945
|
}
|
|
13876
13946
|
EmptyContent.displayName = "EmptyContent";
|
|
@@ -13894,7 +13964,7 @@ var backLinkTokens = {
|
|
|
13894
13964
|
};
|
|
13895
13965
|
|
|
13896
13966
|
// src/components/BackLink/BackLink.tsx
|
|
13897
|
-
import { jsx as
|
|
13967
|
+
import { jsx as jsx268, jsxs as jsxs73 } from "react/jsx-runtime";
|
|
13898
13968
|
var Nav2 = styled97("nav")`
|
|
13899
13969
|
align-items: center;
|
|
13900
13970
|
display: flex;
|
|
@@ -13905,23 +13975,23 @@ var StyledIcon4 = styled97(Icon)`
|
|
|
13905
13975
|
`;
|
|
13906
13976
|
var BackLink = forwardRef73((props, ref) => {
|
|
13907
13977
|
return /* @__PURE__ */ jsxs73(Nav2, { ref, children: [
|
|
13908
|
-
/* @__PURE__ */
|
|
13909
|
-
/* @__PURE__ */
|
|
13978
|
+
/* @__PURE__ */ jsx268(StyledIcon4, { icon: icons_exports.ArrowLeftIcon, iconSize: "small" }),
|
|
13979
|
+
/* @__PURE__ */ jsx268(Typography, { typographyType: "a", href: props.href, children: props.label })
|
|
13910
13980
|
] });
|
|
13911
13981
|
});
|
|
13912
13982
|
BackLink.displayName = "BackLink";
|
|
13913
13983
|
|
|
13914
13984
|
// src/components/Feedback/Feedback.tsx
|
|
13915
|
-
import { useEffect as useEffect27, useState as
|
|
13985
|
+
import { useEffect as useEffect27, useState as useState31 } from "react";
|
|
13916
13986
|
|
|
13917
13987
|
// src/components/Feedback/RatingComponent.tsx
|
|
13918
|
-
import styled98, { css as
|
|
13988
|
+
import styled98, { css as css48 } from "styled-components";
|
|
13919
13989
|
import { ddsBaseTokens as ddsBaseTokens60 } from "@norges-domstoler/dds-design-tokens";
|
|
13920
|
-
import { jsx as
|
|
13990
|
+
import { jsx as jsx269, jsxs as jsxs74 } from "react/jsx-runtime";
|
|
13921
13991
|
var RatingContainer = styled98.div`
|
|
13922
13992
|
display: flex;
|
|
13923
13993
|
gap: ${ddsBaseTokens60.spacing.SizesDdsSpacingX1};
|
|
13924
|
-
${({ $layout }) =>
|
|
13994
|
+
${({ $layout }) => css48`
|
|
13925
13995
|
flex-direction: ${$layout === "horizontal" ? "row" : "column"};
|
|
13926
13996
|
align-items: ${$layout === "horizontal" ? "center" : "start"};
|
|
13927
13997
|
`}
|
|
@@ -13939,9 +14009,9 @@ var RatingComponent = ({
|
|
|
13939
14009
|
handleRatingChange
|
|
13940
14010
|
}) => {
|
|
13941
14011
|
return /* @__PURE__ */ jsxs74(RatingContainer, { $layout: layout, children: [
|
|
13942
|
-
/* @__PURE__ */
|
|
13943
|
-
loading ? /* @__PURE__ */
|
|
13944
|
-
/* @__PURE__ */
|
|
14012
|
+
/* @__PURE__ */ jsx269(Label, { children: ratingLabel }),
|
|
14013
|
+
loading ? /* @__PURE__ */ jsx269(Spinner, { tooltip: "Laster opp tilbakemelding ..." }) : /* @__PURE__ */ jsxs74(HStack, { gap: "x1", children: [
|
|
14014
|
+
/* @__PURE__ */ jsx269(Tooltip, { text: thumbUpTooltip, children: /* @__PURE__ */ jsx269(
|
|
13945
14015
|
RatingButton,
|
|
13946
14016
|
{
|
|
13947
14017
|
htmlProps: { "aria-label": thumbUpTooltip },
|
|
@@ -13951,7 +14021,7 @@ var RatingComponent = ({
|
|
|
13951
14021
|
size: "large"
|
|
13952
14022
|
}
|
|
13953
14023
|
) }),
|
|
13954
|
-
/* @__PURE__ */
|
|
14024
|
+
/* @__PURE__ */ jsx269(Tooltip, { text: thumbDownTooltip, children: /* @__PURE__ */ jsx269("div", { children: /* @__PURE__ */ jsx269(
|
|
13955
14025
|
RatingButton,
|
|
13956
14026
|
{
|
|
13957
14027
|
htmlProps: { "aria-label": thumbDownTooltip },
|
|
@@ -13968,7 +14038,7 @@ var RatingComponent = ({
|
|
|
13968
14038
|
// src/components/Feedback/CommentComponent.tsx
|
|
13969
14039
|
import styled99 from "styled-components";
|
|
13970
14040
|
import { ddsBaseTokens as ddsBaseTokens61 } from "@norges-domstoler/dds-design-tokens";
|
|
13971
|
-
import { jsx as
|
|
14041
|
+
import { jsx as jsx270, jsxs as jsxs75 } from "react/jsx-runtime";
|
|
13972
14042
|
var IconLabelSpan = styled99.span`
|
|
13973
14043
|
display: inline-flex;
|
|
13974
14044
|
align-items: center;
|
|
@@ -13986,7 +14056,7 @@ var CommentComponent = ({
|
|
|
13986
14056
|
}) => {
|
|
13987
14057
|
return /* @__PURE__ */ jsxs75(VStack, { gap: "x1", align: "flex-start", children: [
|
|
13988
14058
|
/* @__PURE__ */ jsxs75(IconLabelSpan, { children: [
|
|
13989
|
-
/* @__PURE__ */
|
|
14059
|
+
/* @__PURE__ */ jsx270(
|
|
13990
14060
|
Icon,
|
|
13991
14061
|
{
|
|
13992
14062
|
icon: rating === "positive" ? ThumbupFilled : ThumbdownFilled,
|
|
@@ -13998,7 +14068,7 @@ var CommentComponent = ({
|
|
|
13998
14068
|
" "
|
|
13999
14069
|
] })
|
|
14000
14070
|
] }),
|
|
14001
|
-
/* @__PURE__ */
|
|
14071
|
+
/* @__PURE__ */ jsx270(
|
|
14002
14072
|
TextArea,
|
|
14003
14073
|
{
|
|
14004
14074
|
value: feedbackText,
|
|
@@ -14007,7 +14077,7 @@ var CommentComponent = ({
|
|
|
14007
14077
|
tip: "Ikke send inn personopplysninger eller annen sensitiv informasjon"
|
|
14008
14078
|
}
|
|
14009
14079
|
),
|
|
14010
|
-
/* @__PURE__ */
|
|
14080
|
+
/* @__PURE__ */ jsx270(
|
|
14011
14081
|
Button,
|
|
14012
14082
|
{
|
|
14013
14083
|
purpose: "secondary",
|
|
@@ -14021,7 +14091,7 @@ var CommentComponent = ({
|
|
|
14021
14091
|
};
|
|
14022
14092
|
|
|
14023
14093
|
// src/components/Feedback/Feedback.tsx
|
|
14024
|
-
import { jsx as
|
|
14094
|
+
import { jsx as jsx271 } from "react/jsx-runtime";
|
|
14025
14095
|
var Feedback = ({
|
|
14026
14096
|
layout = "vertical",
|
|
14027
14097
|
ratingLabel = "Hva syns du om tjenesten?",
|
|
@@ -14040,9 +14110,9 @@ var Feedback = ({
|
|
|
14040
14110
|
onFeedbackTextChange,
|
|
14041
14111
|
onSubmit
|
|
14042
14112
|
}) => {
|
|
14043
|
-
const [rating, setRating] =
|
|
14044
|
-
const [feedbackText, setFeedbackText] =
|
|
14045
|
-
const [isFeedbackSubmitted, setIsFeedbackSubmitted] =
|
|
14113
|
+
const [rating, setRating] = useState31(null);
|
|
14114
|
+
const [feedbackText, setFeedbackText] = useState31();
|
|
14115
|
+
const [isFeedbackSubmitted, setIsFeedbackSubmitted] = useState31(false);
|
|
14046
14116
|
useEffect27(() => {
|
|
14047
14117
|
ratingProp !== void 0 && setRating(ratingProp);
|
|
14048
14118
|
}, [ratingProp]);
|
|
@@ -14066,7 +14136,7 @@ var Feedback = ({
|
|
|
14066
14136
|
isSubmittedProp === void 0 && setIsFeedbackSubmitted(true);
|
|
14067
14137
|
};
|
|
14068
14138
|
if (rating === null && !isFeedbackSubmitted) {
|
|
14069
|
-
return /* @__PURE__ */
|
|
14139
|
+
return /* @__PURE__ */ jsx271(
|
|
14070
14140
|
RatingComponent,
|
|
14071
14141
|
{
|
|
14072
14142
|
layout,
|
|
@@ -14079,7 +14149,7 @@ var Feedback = ({
|
|
|
14079
14149
|
);
|
|
14080
14150
|
}
|
|
14081
14151
|
if (!feedbackTextAreaExcluded && !isFeedbackSubmitted) {
|
|
14082
|
-
return /* @__PURE__ */
|
|
14152
|
+
return /* @__PURE__ */ jsx271(
|
|
14083
14153
|
CommentComponent,
|
|
14084
14154
|
{
|
|
14085
14155
|
rating,
|
|
@@ -14093,7 +14163,7 @@ var Feedback = ({
|
|
|
14093
14163
|
}
|
|
14094
14164
|
);
|
|
14095
14165
|
}
|
|
14096
|
-
return /* @__PURE__ */
|
|
14166
|
+
return /* @__PURE__ */ jsx271(Paragraph, { children: submittedTitle });
|
|
14097
14167
|
};
|
|
14098
14168
|
export {
|
|
14099
14169
|
AddressShieldedIcon,
|
|
@@ -14346,6 +14416,7 @@ export {
|
|
|
14346
14416
|
WarningIcon,
|
|
14347
14417
|
ZoomInIcon,
|
|
14348
14418
|
ZoomOutIcon,
|
|
14419
|
+
calendarDateToNativeDate,
|
|
14349
14420
|
cn,
|
|
14350
14421
|
createSelectOptions,
|
|
14351
14422
|
dangerInputfield,
|
|
@@ -14383,7 +14454,9 @@ export {
|
|
|
14383
14454
|
isInlineElement,
|
|
14384
14455
|
isKeyboardEvent,
|
|
14385
14456
|
isRelativeGridColumn,
|
|
14457
|
+
nativeDateToCalendarDate,
|
|
14386
14458
|
nativeDateToDateValue,
|
|
14459
|
+
nativeDateToTime,
|
|
14387
14460
|
normalizeButton,
|
|
14388
14461
|
outlineOffset,
|
|
14389
14462
|
removeButtonStyling,
|