@helsenorge/designsystem-react 1.0.0-beta94 → 1.0.0-beta98
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/Button-f6698126.js +2 -0
- package/Button-f6698126.js.map +1 -0
- package/Checkbox-d9b564fd.js +2 -0
- package/Checkbox-d9b564fd.js.map +1 -0
- package/ChevronUp-4b6797ef.js +2 -0
- package/ChevronUp-4b6797ef.js.map +1 -0
- package/Close-007fca15.js +2 -0
- package/Close-007fca15.js.map +1 -0
- package/FormGroup-9ff588a2.js +2 -0
- package/FormGroup-9ff588a2.js.map +1 -0
- package/Icon-89da8de4.js +2 -0
- package/Icon-89da8de4.js.map +1 -0
- package/Input-f331efd2.js +2 -0
- package/Input-f331efd2.js.map +1 -0
- package/Loader-e5b166ea.js +2 -0
- package/Loader-e5b166ea.js.map +1 -0
- package/Modal-08f3c55b.js +2 -0
- package/Modal-08f3c55b.js.map +1 -0
- package/RadioButton-e41b1319.js +2 -0
- package/RadioButton-e41b1319.js.map +1 -0
- package/Textarea-74f821a2.js +2 -0
- package/Textarea-74f821a2.js.map +1 -0
- package/Title-fab4097d.js +2 -0
- package/Title-fab4097d.js.map +1 -0
- package/Validation-c41fc494.js +2 -0
- package/Validation-c41fc494.js.map +1 -0
- package/components/AnchorLink/AnchorLink.d.ts.map +1 -1
- package/components/AnchorLink/index.js +1 -1
- package/components/Avatar/Avatar.d.ts.map +1 -1
- package/components/Avatar/index.js +1 -1
- package/components/Badge/Badge.d.ts.map +1 -1
- package/components/Badge/index.js +1 -1
- package/components/Button/Button.d.ts.map +1 -1
- package/components/Button/index.js +1 -1
- package/components/Button/styles.module.scss +2 -0
- package/components/ButtonWithModal/componentdata.json +19 -0
- package/components/ButtonWithModal/index.js +1 -1
- package/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/components/Checkbox/componentdata.json +9 -9
- package/components/Checkbox/index.js +1 -1
- package/components/Checkbox/styles.module.scss +2 -1
- package/components/Close/Close.d.ts.map +1 -1
- package/components/Close/index.js +1 -1
- package/components/Expander/Expander.d.ts +33 -0
- package/components/Expander/Expander.d.ts.map +1 -0
- package/components/Expander/componentdata.json +237 -0
- package/components/Expander/index.d.ts +4 -0
- package/components/Expander/index.d.ts.map +1 -0
- package/components/Expander/index.js +2 -0
- package/components/Expander/index.js.map +1 -0
- package/components/Expander/styles.module.scss +165 -0
- package/components/Expander/styles.module.scss.d.ts +42 -0
- package/components/ExpanderList/ExpanderList.d.ts.map +1 -1
- package/components/ExpanderList/index.js +1 -1
- package/components/FormExample/FormExample.d.ts +2 -1
- package/components/FormExample/FormExample.d.ts.map +1 -1
- package/components/FormExample/componentdata.json +6 -3
- package/components/FormExample/index.js +1 -1
- package/components/FormExample/index.js.map +1 -1
- package/components/FormGroup/FormGroup.d.ts.map +1 -1
- package/components/FormGroup/componentdata.json +9 -9
- package/components/FormGroup/index.js +1 -1
- package/components/FormGroup/styles.module.scss +2 -2
- package/components/HighlightBox/HighlightBox.d.ts.map +1 -1
- package/components/HighlightBox/index.js +1 -1
- package/components/Icons/AcupunctureBack.js +1 -1
- package/components/Icons/Icon.d.ts.map +1 -1
- package/components/Icons/Icon.js +1 -1
- package/components/Icons/NoEye.js +1 -1
- package/components/Icons/SectionSign.js +1 -1
- package/components/Icons/SpeechBubble.js +1 -1
- package/components/Icons/SupportingPerson.js +1 -1
- package/components/Icons/Syringe.js +1 -1
- package/components/Icons/index.js +1 -1
- package/components/Input/Input.d.ts +55 -0
- package/components/Input/Input.d.ts.map +1 -0
- package/components/Input/componentdata.json +425 -0
- package/components/Input/index.d.ts +4 -0
- package/components/Input/index.d.ts.map +1 -0
- package/components/Input/index.js +2 -0
- package/components/Input/index.js.map +1 -0
- package/components/Input/styles.module.scss +55 -0
- package/components/Input/styles.module.scss.d.ts +23 -0
- package/components/LinkList/LinkList.d.ts.map +1 -1
- package/components/LinkList/index.js +1 -1
- package/components/List/List.d.ts.map +1 -1
- package/components/List/index.js +1 -1
- package/components/Loader/Loader.d.ts.map +1 -1
- package/components/Loader/index.js +1 -1
- package/components/Loader/styles.module.scss +3 -2
- package/components/Logo/Logo.d.ts.map +1 -1
- package/components/Logo/index.js +1 -1
- package/components/Modal/Modal.d.ts +2 -0
- package/components/Modal/Modal.d.ts.map +1 -1
- package/components/Modal/componentdata.json +19 -0
- package/components/Modal/index.js +1 -1
- package/components/NotificationPanel/NotificationPanel.d.ts.map +1 -1
- package/components/NotificationPanel/index.js +1 -1
- package/components/Portal/index.d.ts.map +1 -1
- package/components/Portal/index.js +1 -1
- package/components/RadioButton/RadioButton.d.ts.map +1 -1
- package/components/RadioButton/componentdata.json +9 -9
- package/components/RadioButton/index.js +1 -1
- package/components/RadioButton/styles.module.scss +2 -2
- package/components/Slider/Slider.d.ts.map +1 -1
- package/components/Slider/index.js +1 -1
- package/components/Spacer/Spacer.d.ts.map +1 -1
- package/components/Spacer/index.js +1 -1
- package/components/Textarea/Textarea.d.ts +4 -0
- package/components/Textarea/Textarea.d.ts.map +1 -1
- package/components/Textarea/componentdata.json +44 -6
- package/components/Textarea/index.js +1 -1
- package/components/Textarea/styles.module.scss +13 -110
- package/components/Textarea/styles.module.scss.d.ts +13 -8
- package/components/Tile/Tile.d.ts.map +1 -1
- package/components/Tile/index.js +1 -1
- package/components/Title/Title.d.ts.map +1 -1
- package/components/Title/index.js +1 -1
- package/components/Validation/Validation.d.ts.map +1 -1
- package/components/Validation/componentdata.json +3 -3
- package/components/Validation/index.js +1 -1
- package/constants-ad6c82db.js +2 -0
- package/constants-ad6c82db.js.map +1 -0
- package/constants.d.ts +38 -8
- package/constants.d.ts.map +1 -1
- package/hooks/useFocusToggle.d.ts +14 -0
- package/hooks/useFocusToggle.d.ts.map +1 -0
- package/hooks/useIcons.d.ts +4 -0
- package/hooks/useIcons.d.ts.map +1 -0
- package/hooks/useIntersectionObserver.d.ts +11 -0
- package/hooks/useIntersectionObserver.d.ts.map +1 -0
- package/hooks/useIsVisible.d.ts +10 -0
- package/hooks/useIsVisible.d.ts.map +1 -0
- package/hooks/useLayoutEvent.d.ts +9 -0
- package/hooks/useLayoutEvent.d.ts.map +1 -0
- package/hooks/useSticky.d.ts +21 -0
- package/hooks/useSticky.d.ts.map +1 -0
- package/index.js +1 -1
- package/package.json +1 -1
- package/scss/_input.scss +174 -0
- package/utils/debounce.d.ts +8 -0
- package/utils/debounce.d.ts.map +1 -0
- package/Button-72f96290.js +0 -2
- package/Button-72f96290.js.map +0 -1
- package/Checkbox-0ba01292.js +0 -2
- package/Checkbox-0ba01292.js.map +0 -1
- package/Close-80751ae6.js +0 -2
- package/Close-80751ae6.js.map +0 -1
- package/FormGroup-68288be3.js +0 -2
- package/FormGroup-68288be3.js.map +0 -1
- package/Icon-9b4a8a2d.js +0 -2
- package/Icon-9b4a8a2d.js.map +0 -1
- package/Loader-b3fd59f4.js +0 -2
- package/Loader-b3fd59f4.js.map +0 -1
- package/Modal-6b4a2c9c.js +0 -2
- package/Modal-6b4a2c9c.js.map +0 -1
- package/RadioButton-84ca988e.js +0 -2
- package/RadioButton-84ca988e.js.map +0 -1
- package/Textarea-9c91191a.js +0 -2
- package/Textarea-9c91191a.js.map +0 -1
- package/Title-90910763.js +0 -2
- package/Title-90910763.js.map +0 -1
- package/Validation-ef9ee0ae.js +0 -2
- package/Validation-ef9ee0ae.js.map +0 -1
- package/constants-a4b0b501.js +0 -2
- package/constants-a4b0b501.js.map +0 -1
- package/hooks/useVisibility.d.ts +0 -3
- package/hooks/useVisibility.d.ts.map +0 -1
package/constants.d.ts
CHANGED
|
@@ -6,7 +6,8 @@ export declare enum IconSize {
|
|
|
6
6
|
XLarge = 130
|
|
7
7
|
}
|
|
8
8
|
export declare enum ZIndex {
|
|
9
|
-
Modal = 1300000
|
|
9
|
+
Modal = 1300000,
|
|
10
|
+
ExpanderTrigger = 10000
|
|
10
11
|
}
|
|
11
12
|
export interface HTMLButtonProps {
|
|
12
13
|
autoFocus?: boolean;
|
|
@@ -48,14 +49,43 @@ export interface HTMLAnchorProps {
|
|
|
48
49
|
}
|
|
49
50
|
export declare type ButtonVariant = 'secondary' | 'tertiary' | string | undefined | null;
|
|
50
51
|
export declare enum FormMode {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
onwhite = "onwhite",
|
|
53
|
+
ongrey = "ongrey",
|
|
54
|
+
onblueberry = "onblueberry",
|
|
55
|
+
ondark = "ondark",
|
|
56
|
+
oninvalid = "oninvalid"
|
|
56
57
|
}
|
|
57
58
|
export declare enum FormVariant {
|
|
58
|
-
|
|
59
|
-
|
|
59
|
+
normal = "normal",
|
|
60
|
+
bigform = "bigform"
|
|
61
|
+
}
|
|
62
|
+
export declare enum AnalyticsId {
|
|
63
|
+
AnchorLink = "anchor-link",
|
|
64
|
+
Avatar = "avatar",
|
|
65
|
+
Badge = "badge",
|
|
66
|
+
Button = "button",
|
|
67
|
+
Checkbox = "checkbox",
|
|
68
|
+
Close = "close",
|
|
69
|
+
Expander = "expander",
|
|
70
|
+
ExpanderList = "expander-list",
|
|
71
|
+
FormGroup = "form-group",
|
|
72
|
+
HighlightBox = "highlight-box",
|
|
73
|
+
Icon = "icon",
|
|
74
|
+
Input = "input",
|
|
75
|
+
Link = "link",
|
|
76
|
+
LinkList = "link-list",
|
|
77
|
+
List = "list",
|
|
78
|
+
Loader = "loader",
|
|
79
|
+
Logo = "logo",
|
|
80
|
+
Modal = "modal",
|
|
81
|
+
NotificationPanel = "notification-panel",
|
|
82
|
+
Portal = "portal",
|
|
83
|
+
RadioButton = "radio-button",
|
|
84
|
+
Slider = "slider",
|
|
85
|
+
Spacer = "spacer",
|
|
86
|
+
Textarea = "textarea",
|
|
87
|
+
Tile = "tile",
|
|
88
|
+
Title = "title",
|
|
89
|
+
Validation = "validation"
|
|
60
90
|
}
|
|
61
91
|
//# sourceMappingURL=constants.d.ts.map
|
package/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,oBAAY,QAAQ;IAClB,MAAM,KAAK;IACX,KAAK,KAAK;IACV,MAAM,KAAK;IACX,KAAK,KAAK;IACV,MAAM,MAAM;CACb;AAED,oBAAY,MAAM;IAChB,KAAK,UAAU;
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,oBAAY,QAAQ;IAClB,MAAM,KAAK;IACX,KAAK,KAAK;IACV,MAAM,KAAK;IACX,KAAK,KAAK;IACV,MAAM,MAAM;CACb;AAED,oBAAY,MAAM;IAChB,KAAK,UAAU;IACf,eAAe,QAAQ;CACxB;AAED,MAAM,WAAW,eAAe;IAC9B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC9C,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC;CACpC;AAED,MAAM,WAAW,iBAAiB;IAChC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;IAC1C,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EACX,EAAE,GACF,aAAa,GACb,aAAa,GACb,4BAA4B,GAC5B,QAAQ,GACR,0BAA0B,GAC1B,eAAe,GACf,iCAAiC,GACjC,YAAY,CAAC;CAClB;AAED,oBAAY,aAAa,GAAG,WAAW,GAAG,UAAU,GAAG,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;AAEjF,oBAAY,QAAQ;IAClB,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,WAAW,gBAAgB;IAC3B,MAAM,WAAW;IACjB,SAAS,cAAc;CACxB;AAED,oBAAY,WAAW;IACrB,MAAM,WAAW;IACjB,OAAO,YAAY;CACpB;AAED,oBAAY,WAAW;IACrB,UAAU,gBAAgB;IAC1B,MAAM,WAAW;IACjB,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,KAAK,UAAU;IACf,QAAQ,aAAa;IACrB,YAAY,kBAAkB;IAC9B,SAAS,eAAe;IACxB,YAAY,kBAAkB;IAC9B,IAAI,SAAS;IACb,KAAK,UAAU;IACf,IAAI,SAAS;IACb,QAAQ,cAAc;IACtB,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,KAAK,UAAU;IACf,iBAAiB,uBAAuB;IACxC,MAAM,WAAW;IACjB,WAAW,iBAAiB;IAC5B,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,IAAI,SAAS;IACb,KAAK,UAAU;IACf,UAAU,eAAe;CAC1B"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const FOCUSABLE_SELECTORS: string;
|
|
3
|
+
/**
|
|
4
|
+
* Skru av og på fokus på fokuserbare elementer slik at de kan være en del av DOMen, men samtidig
|
|
5
|
+
* ikke kunne fokuseres/tabbes til med tastaturet.
|
|
6
|
+
*
|
|
7
|
+
* Bruker MutationObserver slik at eventuelle nye elementer som legges til også vil miste/få fokus.
|
|
8
|
+
*
|
|
9
|
+
* @param ref Alle barn av dette elementet vil sjekkes for om de er fokuserbare
|
|
10
|
+
* @param allowFocus Om elementene skal være fokuserbare eller ikke
|
|
11
|
+
* @returns Liste med potensielt fokuserbare elementer
|
|
12
|
+
*/
|
|
13
|
+
export declare const useFocusToggle: (ref: React.RefObject<HTMLElement>, allowFocus?: boolean | undefined) => NodeListOf<HTMLElement> | undefined;
|
|
14
|
+
//# sourceMappingURL=useFocusToggle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFocusToggle.d.ts","sourceRoot":"","sources":["../../src/hooks/useFocusToggle.ts"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAGnD,eAAO,MAAM,mBAAmB,QAarB,CAAC;AAEZ;;;;;;;;;GASG;AACH,eAAO,MAAM,cAAc,8GAgD1B,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { IconProps } from '../components/Icons';
|
|
3
|
+
export declare const useIcons: (children: import("react").ReactNode[]) => (string | number | boolean | {} | import("react").ReactElement<any, string | ((props: any) => import("react").ReactElement<any, any> | null) | (new (props: any) => import("react").Component<any, any, any>)> | import("react").ReactNodeArray | import("react").ReactPortal | import("react").ReactElement<IconProps, string | ((props: any) => import("react").ReactElement<any, any> | null) | (new (props: any) => import("react").Component<any, any, any>)> | null | undefined)[];
|
|
4
|
+
//# sourceMappingURL=useIcons.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useIcons.d.ts","sourceRoot":"","sources":["../../src/hooks/useIcons.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,eAAO,MAAM,QAAQ,qgBAapB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
/**
|
|
3
|
+
* Lytt på endringer i synligheten (intersection) til et HTML-element. F.eks. kan du bruke denne til å kalle en callback
|
|
4
|
+
* når elementet er i ferd med å forsvinne ut av vinduet.
|
|
5
|
+
*
|
|
6
|
+
* @param ref Element som skal observeres
|
|
7
|
+
* @param callback Kalles når en endring i intersection er observert
|
|
8
|
+
* @param options Objekt med options for IntersectionObserver, f.eks. threshold for å bestemme når callbacken skal fyres
|
|
9
|
+
*/
|
|
10
|
+
export declare const useIntersectionObserver: (ref: import("react").RefObject<HTMLElement>, callback: IntersectionObserverCallback, options?: IntersectionObserverInit | undefined) => void;
|
|
11
|
+
//# sourceMappingURL=useIntersectionObserver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useIntersectionObserver.d.ts","sourceRoot":"","sources":["../../src/hooks/useIntersectionObserver.ts"],"names":[],"mappings":";AAEA;;;;;;;GAOG;AAEH,eAAO,MAAM,uBAAuB,+IAkBnC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
/**
|
|
3
|
+
* Sjekk om et HTML-element er synlig i vinduet, eller ikke.
|
|
4
|
+
*
|
|
5
|
+
* @param ref Element som skal observeres
|
|
6
|
+
* @param threshold Hvor synlig må elementet være? Default = 1 (helt synlig)
|
|
7
|
+
* @returns true hvis objektet er synlig lik threshold eller mer, false hvis ikke
|
|
8
|
+
*/
|
|
9
|
+
export declare const useIsVisible: (ref: import("react").RefObject<HTMLElement>, threshold?: number) => boolean;
|
|
10
|
+
//# sourceMappingURL=useIsVisible.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useIsVisible.d.ts","sourceRoot":"","sources":["../../src/hooks/useIsVisible.ts"],"names":[],"mappings":";AAGA;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,8EAUxB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lytt på ulike layout-events som har betydning for rendring og størrelse på elementer.
|
|
3
|
+
*
|
|
4
|
+
* @param callback Kalles for hver event
|
|
5
|
+
* @param events Liste med events som skal lyttes på
|
|
6
|
+
* @param debounceMs Begrens kall til callback til x antall ms
|
|
7
|
+
*/
|
|
8
|
+
export declare const useLayoutEvent: (callback: () => void, events?: string[], debounceMs?: number) => void;
|
|
9
|
+
//# sourceMappingURL=useLayoutEvent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLayoutEvent.d.ts","sourceRoot":"","sources":["../../src/hooks/useLayoutEvent.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,wEAY1B,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface UseStickReturnValues {
|
|
3
|
+
/** Toppen av elementet er utenfor vinduet */
|
|
4
|
+
isOutsideWindow: boolean;
|
|
5
|
+
/** Innholdet er på vei helt ut av vinduet */
|
|
6
|
+
isLeavingWindow: boolean;
|
|
7
|
+
/** Høyde på det sticky elementet i pixler */
|
|
8
|
+
offsetHeight: number | undefined;
|
|
9
|
+
/** Bredden til innholdet i pixler */
|
|
10
|
+
contentWidth: number | undefined;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Sett et element til sticky hvis et annet element er delvis utenfor vinduet
|
|
14
|
+
*
|
|
15
|
+
* @param contentRef Element som sjekkes om det er utenfor eller innenfor vinduet
|
|
16
|
+
* @param stickyRef Element som skal bli sticky
|
|
17
|
+
* @returns Properties som kan brukes til å sette elementet sticky eller absolute
|
|
18
|
+
*/
|
|
19
|
+
export declare const useSticky: (contentRef: React.RefObject<HTMLElement>, stickyRef: React.RefObject<HTMLElement>) => UseStickReturnValues;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=useSticky.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSticky.d.ts","sourceRoot":"","sources":["../../src/hooks/useSticky.ts"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAGxC,UAAU,oBAAoB;IAC5B,6CAA6C;IAC7C,eAAe,EAAE,OAAO,CAAC;IACzB,+CAA+C;IAC/C,eAAe,EAAE,OAAO,CAAC;IACzB,6CAA6C;IAC7C,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,qCAAqC;IACrC,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;CAClC;AACD;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,6GAmBrB,CAAC"}
|
package/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{t as theme}from"./index-19b48c51.js";export{u as useHover}from"./useHover-037be19d.js";export{F as FormMode,a as FormVariant,I as IconSize,Z as ZIndex}from"./constants-
|
|
1
|
+
export{t as theme}from"./index-19b48c51.js";export{u as useHover}from"./useHover-037be19d.js";export{A as AnalyticsId,F as FormMode,a as FormVariant,I as IconSize,Z as ZIndex}from"./constants-ad6c82db.js";import"./palette-f206f488.js";import"./grid-11a70eb7.js";import"./_rollupPluginBabelHelpers-d0752906.js";import"react";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
package/scss/_input.scss
ADDED
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
@mixin input-wrapper {
|
|
2
|
+
width: 100%;
|
|
3
|
+
line-height: 0;
|
|
4
|
+
|
|
5
|
+
&__label-wrapper {
|
|
6
|
+
display: inline-flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
line-height: getSpacer(m);
|
|
9
|
+
font-size: $font-size-sm;
|
|
10
|
+
font-weight: 600;
|
|
11
|
+
padding-bottom: getSpacer(xs);
|
|
12
|
+
|
|
13
|
+
@media (min-width: map-get($grid-breakpoints, md)) {
|
|
14
|
+
line-height: getSpacer(l);
|
|
15
|
+
font-size: $font-size-md;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
&--on-dark {
|
|
19
|
+
color: $white;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&__after-label-children {
|
|
24
|
+
padding-left: 0.75rem;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@mixin content-wrapper {
|
|
29
|
+
font-size: $font-size-sm;
|
|
30
|
+
width: 100%;
|
|
31
|
+
border: $neutral700 2px solid;
|
|
32
|
+
outline: none;
|
|
33
|
+
background: $white;
|
|
34
|
+
|
|
35
|
+
svg:first-child {
|
|
36
|
+
padding-left: 0.375rem;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
svg:last-child {
|
|
40
|
+
padding-right: 0.375rem;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&--bigform {
|
|
44
|
+
padding: getSpacer(xs) 0;
|
|
45
|
+
|
|
46
|
+
svg:first-child {
|
|
47
|
+
padding-left: getSpacer(xs);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
svg:last-child {
|
|
51
|
+
padding-right: getSpacer(xs);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
&:hover {
|
|
56
|
+
background: $neutral50;
|
|
57
|
+
border-color: $neutral700;
|
|
58
|
+
box-shadow: 0px 0px 0px 1px $neutral700;
|
|
59
|
+
|
|
60
|
+
&:focus-within {
|
|
61
|
+
border-color: $black;
|
|
62
|
+
box-shadow: 0px 0px 0px 2px $black;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
&:focus-within {
|
|
66
|
+
background: $white;
|
|
67
|
+
border-color: $neutral900;
|
|
68
|
+
box-shadow: 0px 0px 0px 2px $neutral900;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
&--on-blueberry {
|
|
72
|
+
border-color: $blueberry500;
|
|
73
|
+
|
|
74
|
+
&:hover {
|
|
75
|
+
background: $blueberry50;
|
|
76
|
+
box-shadow: 0px 0px 0px 1px $blueberry500;
|
|
77
|
+
border-color: $blueberry500;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
&:focus-within {
|
|
81
|
+
background: $white;
|
|
82
|
+
border-color: $neutral900;
|
|
83
|
+
box-shadow: 0px 0px 0px 2px $neutral900;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
&--on-dark {
|
|
87
|
+
border-color: $blueberry900;
|
|
88
|
+
&:hover {
|
|
89
|
+
background: $blueberry50;
|
|
90
|
+
border-color: $blueberry900;
|
|
91
|
+
box-shadow: 0px 0px 0px 1px $blueberry900;
|
|
92
|
+
}
|
|
93
|
+
&:focus-within {
|
|
94
|
+
background: $white;
|
|
95
|
+
border-color: $neutral900;
|
|
96
|
+
box-shadow: 0px 0px 0px 2px $neutral900;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
&--invalid {
|
|
100
|
+
border-color: $cherry500;
|
|
101
|
+
|
|
102
|
+
&:hover {
|
|
103
|
+
background: $cherry100;
|
|
104
|
+
border-color: $cherry500;
|
|
105
|
+
box-shadow: 0px 0px 0px 2px $cherry500;
|
|
106
|
+
}
|
|
107
|
+
&:focus-within {
|
|
108
|
+
background: $white;
|
|
109
|
+
border-color: $neutral900;
|
|
110
|
+
box-shadow: 0px 0px 0px 2px $neutral900;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
&--transparent {
|
|
114
|
+
background: transparent;
|
|
115
|
+
|
|
116
|
+
&:hover {
|
|
117
|
+
background: $neutral100;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
&:focus-within {
|
|
121
|
+
background: $white;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
&--transparent#{&}--on-blueberry {
|
|
125
|
+
&:hover {
|
|
126
|
+
background: $blueberry100;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
&:focus-within {
|
|
130
|
+
background: $white;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
&--disabled {
|
|
135
|
+
background: $neutral50;
|
|
136
|
+
border-color: $neutral500;
|
|
137
|
+
color: $neutral500;
|
|
138
|
+
|
|
139
|
+
&:hover {
|
|
140
|
+
border-color: $neutral500;
|
|
141
|
+
box-shadow: none;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
&__input {
|
|
146
|
+
line-height: 1.625rem;
|
|
147
|
+
font-size: $font-size-sm;
|
|
148
|
+
padding: 0 getSpacer(xs);
|
|
149
|
+
border: none;
|
|
150
|
+
outline: none;
|
|
151
|
+
background-color: transparent;
|
|
152
|
+
width: 100%;
|
|
153
|
+
|
|
154
|
+
@media (min-width: map-get($grid-breakpoints, md)) {
|
|
155
|
+
font-size: $font-size-md;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
&::placeholder {
|
|
159
|
+
color: $neutral500;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
&--disabled {
|
|
163
|
+
color: $neutral500;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
&:first-child {
|
|
167
|
+
padding-left: getSpacer(s);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
&:last-child {
|
|
171
|
+
padding-right: getSpacer(s);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* debounce limits time a function can be executed
|
|
3
|
+
* @param func function to debounce
|
|
4
|
+
* @param wait wait for x time
|
|
5
|
+
* @param immediate run now
|
|
6
|
+
*/
|
|
7
|
+
export declare function debounce(func: Function, wait: number, immediate?: boolean): () => void;
|
|
8
|
+
//# sourceMappingURL=debounce.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debounce.d.ts","sourceRoot":"","sources":["../../src/utils/debounce.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,IAAI,CAoBtF"}
|
package/Button-72f96290.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{_ as t,a as e}from"./_rollupPluginBabelHelpers-d0752906.js";import{_ as n}from"./_tslib-51c8a283.js";import o from"react";import{g as r}from"./color-acb834c6.js";import"./Icon-9b4a8a2d.js";import{I as l}from"./constants-a4b0b501.js";import{L as i}from"./Loader-b3fd59f4.js";import{u as a}from"./useHover-037be19d.js";import{u as s}from"./useWindowSize-73b47451.js";import{b as u}from"./grid-11a70eb7.js";import{c as d}from"./index-9b84fabc.js";import c from"./components/Button/styles.module.scss";var m={primary:"blueberry",warning:"banana",danger:"cherry"};var b=function(t,e){return e&&e<u.md&&t?l.Small:t?l.Medium:l.XSmall},f=o.forwardRef((function(u,f){var p,v,_,g=u.children,h=u.className,j=void 0===h?"":h,w=u.fluid,E=void 0!==w&&w,k=u.intent,y=void 0===k?"primary":k,N=u.inverted,I=void 0!==N&&N,C=u.htmlMarkup,H=void 0===C?"button":C,O=u.onClick,S=u.large,z=void 0!==S&&S,B=u.loading,F=void 0!==B&&B,M=u.variant,x=void 0===M?"fill":M,L=u.disabled,R=void 0!==L&&L,X=u.ellipsis,A=void 0!==X&&X,P=u.testId,W=u.href,q=u.target,D=n(u,["children","className","fluid","intent","inverted","htmlMarkup","onClick","large","loading","variant","disabled","ellipsis","testId","href","target"]),G=function(t){var e,n,o,r,l=null,i=null;void 0!==(null===(n=null===(e=t[0])||void 0===e?void 0:e.props)||void 0===n?void 0:n.svgIcon)&&(l=t.shift()),void 0!==(null===(r=null===(o=t[t.length-1])||void 0===o?void 0:o.props)||void 0===r?void 0:r.svgIcon)&&(i=t.pop());var a=t.filter((function(t){return t}));return[l,i,a.length>0?a:null]}(o.Children.toArray(g)),J=t(G,3),K=J[0],Q=J[1],T=J[2],U=a(f),V=U.hoverRef,Y=U.isHovered,Z=function(t,e,n,o,l){return e?r("neutral",600):t&&!o||!t&&o?"white":r(m[n],l?700:600)}("fill"===x,R,y,I,Y),$=s(),tt="fill"===x,et="outline"===x,nt="borderless"===x,ot="warning"===y,rt="danger"===y,lt=!(!K&&!Q||F),it=Object.assign({},D),at=d(c.button,(e(p={},c["button--fluid"],E),e(p,c["button--large"],z),e(p,c["button--warning"],ot),e(p,c["button--danger"],rt),e(p,c["button--inverted"],I),e(p,c["button--fill"],tt),e(p,c["button--outline"],et),e(p,c["button--borderless"],nt),e(p,c["button--with-icon"],lt),e(p,c["button--ellipsis"],A),p),j),st=d(c.button__content,(e(v={},c["button__content--warning"],ot),e(v,c["button__content--danger"],rt),e(v,c["button__content--fill"],tt),e(v,c["button__content--borderless"],nt),e(v,c["button__content--with-icon"],lt),e(v,c["button__content--large"],z),e(v,c["button__content--ellipsis"],A),e(v,c["button__content--inverted"],I),e(v,c["button__content--fluid"],E),v)),ut=d(c["button__left-fluid-content"],(e(_={},c["button__left-fluid-content--with-icon"],lt),e(_,c["button__left-fluid-content--large"],z),_));function dt(t,e,n,r){var l=t&&t.props&&t.props.color?t.props.color:n;return t&&Object.keys(t).length>0?o.cloneElement(t,{size:e,color:l,isHovered:r}):null}var ct=function(){return T?o.createElement("span",{className:st},T):null},mt=function(){return o.createElement("span",{className:c["content-wrapper"]},F?o.createElement("div",{className:c["button__left-fluid-content"]},o.createElement(i,{testId:"test-id-loader",color:"fill"!==x||I?m[y]:"white",size:"tiny"})):o.createElement(o.Fragment,null,E?o.createElement("div",{className:ut},dt(K,b(z,$.width),Z,Y),ct()):o.createElement(o.Fragment,null,dt(K,b(z,$.width),Z,Y),ct()),dt(Q,l.XSmall,Z,Y)))};return o.createElement(o.Fragment,null,"button"===H&&o.createElement("button",Object.assign({onClick:O,disabled:R,"data-testid":P,className:at,ref:V},it),mt()),"a"===H&&o.createElement("a",Object.assign({onClick:O,"data-testid":P,className:at,href:W,target:q,rel:"_blank"===q?"noopener noreferrer":u.rel,ref:V},D),mt()))}));export{f as B,m as i};
|
|
2
|
-
//# sourceMappingURL=Button-72f96290.js.map
|
package/Button-72f96290.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Button-72f96290.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/Checkbox-0ba01292.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{_ as e,a as r}from"./_rollupPluginBabelHelpers-d0752906.js";import a,{useState as c,useEffect as o}from"react";import{c as b}from"./index-9b84fabc.js";import{u as l}from"./uuid-8870ab4b.js";import{C as i}from"./Check-6291ad09.js";import{I as s}from"./Icon-9b4a8a2d.js";import{F as n,a as t}from"./constants-a4b0b501.js";import{g as m}from"./color-acb834c6.js";import p from"./components/Checkbox/styles.module.scss";var d=a.forwardRef((function(d,h){var k,x,u,f=d.className,_=d.checked,v=void 0!==_&&_,w=d.disabled,g=d.label,y=d.inputid,j=void 0===y?l():y,E=d.mode,N=d.name,C=void 0===N?j:N,I=d.variant,B=d.errorText,F=d.error,O=void 0===F?!!B:F,z=d.value,D=void 0===z?g:z,H=c(v),P=e(H,2),R=P[0],T=P[1],q=O||E===n.OnError,A=E===n.OnDark,G=E===n.OnBlueberry,J=I===t.BigForm,K=b(p["checkbox-wrapper"],(r(k={},p["checkbox-wrapper--with-error"],B),r(k,p["checkbox-wrapper--bigform"],J),k)),L=b(p["checkbox-label"],(r(x={},p["checkbox-label--disabled"],w),r(x,p["checkbox-label--on-dark"],A),r(x,p["checkbox-label--on-blueberry"],G),r(x,p["checkbox-label--invalid"],q),r(x,p["checkbox-label--bigform"],J),x)),M=b(p.checkbox,f),Q=b(p["checkbox__icon-wrapper"],(r(u={},p["checkbox__icon-wrapper--checked"],R),r(u,p["checkbox__icon-wrapper--disabled"],w),r(u,p["checkbox__icon-wrapper--on-dark"],A),r(u,p["checkbox__icon-wrapper--on-blueberry"],G),r(u,p["checkbox__icon-wrapper--invalid"],q),u)),S=b(p["checkbox-errors"],r({},p["checkbox-errors--bigform"],J)),U=m("blueberry",500);return w&&(U=m("neutral",400)),A&&(U=m("blueberry",200)),q&&(U=m("cherry",500)),o((function(){T(v)}),[v]),a.createElement("div",{"data-testid":d.testId,className:K},B&&a.createElement("p",{className:S},B),a.createElement("label",{htmlFor:j,className:L},a.createElement("input",{id:j,name:C,className:M,type:"checkbox",checked:R,disabled:w,onChange:function(){T(!R)},value:D,ref:h,"aria-invalid":O}),a.createElement("span",{className:Q},R&&a.createElement(s,{color:U,className:p.checkbox__icon,svgIcon:i,size:38})),g))}));export{d as C};
|
|
2
|
-
//# sourceMappingURL=Checkbox-0ba01292.js.map
|
package/Checkbox-0ba01292.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox-0ba01292.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/Close-80751ae6.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import e from"react";import{p as t}from"./palette-f206f488.js";import{I as a}from"./Icon-9b4a8a2d.js";import"./constants-a4b0b501.js";import l from"./components/Close/styles.module.scss";import{u as r,B as o}from"./useBreakpoint-324a9b14.js";var s=function(t){var a=t.isExtraSmall,l=t.isHovered,r=e.createElement("path",{d:"M25.403 24l10.259-10.259-1.403-1.403L24 22.597l-10.259-10.26-1.403 1.403L22.597 24 12.338 34.26l1.403 1.403L24 25.403l10.259 10.259 1.403-1.403z"}),o=e.createElement("path",{d:"M24 22.597L12.327 10.924l-1.403 1.402L22.597 24 10.923 35.674l1.403 1.402L24 25.403l11.674 11.673 1.403-1.402L25.403 24l11.673-11.674-1.403-1.402z"}),s=e.createElement("path",{d:"M25.773 24l10.432-10.432-1.772-1.773-10.432 10.433-10.433-10.433-1.773 1.772L22.229 24 11.795 34.433l1.773 1.772 10.433-10.433 10.432 10.433 1.772-1.773z"});return a?l?e.createElement("path",{d:"M24 22.227L11.781 10.008l-1.772 1.772 12.219 12.219-12.22 12.22 1.772 1.772L24 25.771l12.22 12.22 1.772-1.772-12.22-12.22L37.991 11.78l-1.772-1.772z"}):s:l?o:r},n=function(n){var m=r()===o.Xs?38:48;return e.createElement("button",{"data-testid":n.testId,className:l.close,"aria-label":n.ariaLabel||"Lukk",onClick:n.onClick,role:"button"},e.createElement(a,{svgIcon:s,color:t.blueberry600,size:m}))};export{n as C};
|
|
2
|
-
//# sourceMappingURL=Close-80751ae6.js.map
|
package/Close-80751ae6.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Close-80751ae6.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/FormGroup-68288be3.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./_rollupPluginBabelHelpers-d0752906.js";import r from"react";import{c as a}from"./index-9b84fabc.js";import o from"./components/FormGroup/styles.module.scss";import{C as t}from"./Checkbox-0ba01292.js";import{F as m,a as l}from"./constants-a4b0b501.js";import{T as n}from"./Title-90910763.js";import{R as i}from"./RadioButton-84ca988e.js";var p=r.forwardRef((function(p,s){var f,d,c,u=p.className,g=p.mode,_=void 0===g?m.OnWhite:g,v=p.variant,b=void 0===v?l.Normal:v,w=p.error,E=p.name,N=_===m.OnDark,h=b===l.BigForm,j=a(o["form-group-wrapper"],(e(f={},o["form-group-wrapper--on-dark"],N),e(f,o["form-group-wrapper--invalid"],w),f),u),k=a(o["form-group-wrapper__title"],(e(d={},o["form-group-wrapper__title--on-dark"],N&&!w),e(d,o["form-group-wrapper__title--bigform"],h),d)),y=a(o["form-group"],e({},o["form-group--invalid"],w)),B=a(o["form-group-wrapper__errors"],e({},o["form-group-wrapper__errors--bigform"],h)),F=a(o["field-set__legend"],(e(c={},o["field-set__legend--on-dark"],N&&!w),e(c,o["field-set__legend--bigform"],h),c));return r.createElement("div",{"data-testid":p.testId,className:j},p.title&&r.createElement(n,{className:k,htmlMarkup:"h4",appearance:"title4",margin:{marginTop:0,marginBottom:2}},p.title),r.createElement("div",{className:y},w&&r.createElement("p",{className:B},w),r.createElement("fieldset",{name:p.title,className:o["field-set"]},p.legend&&r.createElement("legend",{className:F},p.legend),r.Children.map(p.children,(function(e){if(e.type===t){var a=e.type===t;return r.cloneElement(e,{name:null!=E?E:a.valueOf.name,mode:_,variant:b,error:!!w})}if(e.type===i){var o=e.type===i;return r.cloneElement(e,{name:null!=E?E:o.valueOf.name,mode:_,variant:b,error:!!w})}return e})))))}));export{p as F};
|
|
2
|
-
//# sourceMappingURL=FormGroup-68288be3.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormGroup-68288be3.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/Icon-9b4a8a2d.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{_ as e}from"./_tslib-51c8a283.js";import a from"react";import{I as i}from"./constants-a4b0b501.js";var t=function(e,a,i,t,o,r){return e&&o&&r?a?r:o:a?t:i},o=a.forwardRef((function(t,o){var r=t.svgIcon,l=t.ariaLabel,s=t.id,d=t.className,c=void 0===d?"":d,n=t.size,m=void 0===n?i.Small:n,v=t.color,b=void 0===v?"black":v,f=t.hoverColor,h=void 0===f?b||"black":f,g=t.isHovered,I=void 0!==g&&g,p=t.testId,u=e(t,["svgIcon","ariaLabel","id","className","size","color","hoverColor","isHovered","testId"]),y=a.createElement(r,{isExtraSmall:m<=i.XSmall,isHovered:I}),E=s&&l?"title-".concat(s):void 0;return a.createElement("svg",Object.assign({id:s,"data-testid":p,ref:o,className:"hnds-style-icon ".concat(c),role:"img","aria-label":!s&&l?l:void 0,"aria-labelledby":E,"aria-hidden":"true",viewBox:"0 0 48 48",style:{minWidth:m,minHeight:m},width:m,height:m,fill:I?h:b},u),E&&a.createElement("title",{id:E},l),y)}));o.displayName="Icon";export{o as I,t as r};
|
|
2
|
-
//# sourceMappingURL=Icon-9b4a8a2d.js.map
|
package/Icon-9b4a8a2d.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Icon-9b4a8a2d.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/Loader-b3fd59f4.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{_ as e,a}from"./_rollupPluginBabelHelpers-d0752906.js";import r,{useState as l,useRef as t,useEffect as o}from"react";import{c as d}from"./index-9b84fabc.js";import{u as n}from"./uuid-8870ab4b.js";import i from"./components/Loader/styles.module.scss";var s;!function(e){e.screen="screen",e.parent="parent"}(s||(s={}));var m=r.forwardRef((function(m,c){var p,u,v,_=m.overlay,b=m.color,y=void 0===b?_?"black":"neutral":b,f=m.size,w=void 0===f?"small":f,E=m.className,N=void 0===E?"":E,g=m.testId,h=m.center,k=m.inline,L=m.ariaLabelledById,x=m.ariaLabel,j=void 0===x?"Laster inn":x,B=l(_!==s.parent&&!k),I=e(B,2),z=I[0],H=I[1],O="small"===w,P="medium"===w,R="large"===w,q=d(i["loader-wrapper"],(a(p={},i["loader-wrapper--center"],h),a(p,i["loader-wrapper--overlay"],_),a(p,i["loader-wrapper--overlay-screen"],_===s.screen),a(p,i["loader-wrapper--overlay-parent"],_===s.parent&&z),a(p,i["loader-wrapper--inline"],k&&z),p)),A=d(i.loader,(a(u={},i["loader--small"],O),a(u,i["loader--medium"],P),a(u,i["loader--large"],R),u),N),C=d(i.loader__dot,(a(v={},i["loader__dot--small"],O),a(v,i["loader__dot--medium"],P),a(v,i["loader__dot--large"],R),a(v,i["loader__dot--banana"],"banana"===y),a(v,i["loader__dot--cherry"],"cherry"===y),a(v,i["loader__dot--kiwi"],"kiwi"===y),a(v,i["loader__dot--neutral"],"neutral"===y),a(v,i["loader__dot--plum"],"plum"===y),a(v,i["loader__dot--black"],"black"===y),a(v,i["loader__dot--white"],"white"===y),v)),D="loader".concat(n()),F=t(null);return o((function(){var e,a,r,l;_===s.parent&&(null===(a=null===(e=F.current)||void 0===e?void 0:e.parentElement)||void 0===a?void 0:a.style)&&(F.current.parentElement.style.position="relative",H(!0)),k&&(null===(l=null===(r=F.current)||void 0===r?void 0:r.parentElement)||void 0===l?void 0:l.style)&&(F.current.parentElement.style.display="flex",H(!0))}),[]),r.createElement("div",{role:"progressbar",className:q,ref:F},z&&r.createElement("div",{"data-testid":g,"aria-labelledby":L||D,className:A},r.createElement("div",{className:C}),r.createElement("div",{className:C}),r.createElement("div",{className:C}),r.createElement("div",{className:C}),!L&&r.createElement("span",{id:D,className:i["loader__hidden-text"]},j)))}));export{m as L,s as O};
|
|
2
|
-
//# sourceMappingURL=Loader-b3fd59f4.js.map
|
package/Loader-b3fd59f4.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Loader-b3fd59f4.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/Modal-6b4a2c9c.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{_ as e,a as t}from"./_rollupPluginBabelHelpers-d0752906.js";import a,{useRef as r,useEffect as n,useState as l}from"react";import{c as o}from"./index-9b84fabc.js";import{p as i}from"./palette-f206f488.js";import{B as c}from"./Button-72f96290.js";import{I as s}from"./Icon-9b4a8a2d.js";import{Z as d,I as m}from"./constants-a4b0b501.js";import u from"./components/Modal/styles.module.scss";import{A as v,a as p}from"./AlertSignFill-e607ff43.js";import{T as f}from"./Title-90910763.js";import{u as _}from"./uuid-8870ab4b.js";import{C as E}from"./Close-80751ae6.js";import{createPortal as h}from"react-dom";function b(){var e=r(null);function t(t){var a=e.current,r="Tab"===t.key;if(a&&r){var n=function(e){try{return("string"==typeof e?document.querySelector(e):e).getRootNode().activeElement}catch(t){return console.error("Feil ved å ta tak i active element basert på angitt node: ",e,t),null}}(a),l=null==a?void 0:a.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),o=l[0],i=1===l.length?o:l[l.length-1];t.shiftKey?n===o&&(i.focus(),t.preventDefault()):n===i&&(o.focus(),t.preventDefault())}}function a(t){var a=e.current;if(a){var r=a.querySelectorAll('a[href], button, textarea, input[type="text"], input[type="radio"], input[type="checkbox"], select');1===r.length&&(r[0].focus(),t.preventDefault())}}return n((function(){var r=e.current;return r.addEventListener("keydown",t),r.addEventListener("click",a),function(){r.removeEventListener("keydown",t),r.removeEventListener("click",a)}}),[]),e}var y,g,N=function(t){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=l(!1),o=e(r,2),i=o[0],c=o[1];return n((function(){var e=new IntersectionObserver((function(e){c(e[0].intersectionRatio>=a)}),{threshold:a});return(null==t?void 0:t.current)&&e.observe(t.current),function(){(null==t?void 0:t.current)&&e.unobserve(t.current)}}),[t]),i},x=function(e){e.isExtraSmall;var t=e.isHovered,r=a.createElement("path",{d:"m9.16 23.421 2.883-2.773 8.262 8.584L35.958 12.97l2.882 2.774-18.536 19.257-11.143-11.58zm26.744-13.279-15.6 16.206-8.206-8.529-5.766 5.547 13.973 14.518 21.362-22.193-5.764-5.549z","fill-rule":"evenodd"});return t?a.createElement("path",{d:"m11.128 25.394 2.88-2.771 6.291 6.613 17.071-17.68 2.882 2.775-19.944 20.668-9.18-9.605zM37.318 8.73 20.31 26.345l-6.239-6.558-5.766 5.548 11.996 12.552 22.781-23.609-5.764-5.548z","fill-rule":"evenodd"}):r};function w(e){var t=e.children,r=e.parent,n=e.className,l=e.testId,o=a.useMemo((function(){return document.createElement("div")}),[]);return l&&o.setAttribute("data-testid",l),a.useEffect((function(){var e=r&&r.appendChild?r:document.body,t=["portal-container"];return n&&n.split(" ").forEach((function(e){return t.push(e)})),t.forEach((function(e){return o.classList.add(e)})),e.appendChild(o),function(){e.removeChild(o)}}),[o,r,n]),h(t,o)}!function(e){e.normal="normal",e.warning="warning",e.error="error",e.success="success",e.image="image"}(y||(y={})),function(e){e.large="large",e.medium="medium"}(g||(g={}));var C={variant:y.normal,primaryButtonText:"OK",large:!1,className:"",size:g.large,zIndex:d.Modal},k=function(e,t){var r=function(e){return e===y.error?a.createElement(s,{size:m.Small,svgIcon:v,color:i.cherry500}):e===y.warning?a.createElement(s,{size:m.Small,svgIcon:p,color:i.black}):e===y.success?a.createElement(s,{size:m.Small,svgIcon:x,color:i.kiwi900}):null}(e);return r?a.createElement("div",{className:u.modal__iconWrapper},r):t?a.createElement("div",{className:u.modal__iconWrapper},a.cloneElement(t,{size:m.Small})):null},L=function(r){var l,i,s,d,m=a.useState(0),v=e(m,2),p=v[0],h=v[1],g=a.useState(_()),x=e(g,1)[0],C=a.useRef(null),L=a.useRef(null),B=a.useRef(null),z=N(L),I=a.useRef(null),S=N(I),T=B.current&&B.current.scrollHeight>B.current.clientHeight;function W(e){"Escape"===e.key&&r.onClose&&(e.stopPropagation(),r.onClose())}function j(e){e.target&&A.current===e.target&&r.onClose&&(e.stopPropagation(),r.onClose())}var R=r.variant===y.image,M=null!==(i=r.titleId)&&void 0!==i?i:x,A=a.useRef(null),P=r.secondaryButtonText&&(null===(s=r.secondaryButtonText)||void 0===s?void 0:s.length)>0||r.onSuccess,D=r.ariaLabelledBy?void 0:r.ariaLabel,H=r.ariaLabelledBy?r.ariaLabelledBy:r.ariaLabel?void 0:M;n((function(){var e,t=A.current;return null===(e=C.current)||void 0===e||e.focus(),document.body.style.overflow="hidden",t&&!P&&(t.addEventListener("keydown",W),t.addEventListener("click",j)),function(){document.body.style.removeProperty("overflow"),t&&!P&&(t.removeEventListener("keydown",W),t.removeEventListener("click",j))}}),[]);var q=o((t(l={},u["modal__title--error"],r.variant===y.error),t(l,u["modal__title--success"],r.variant===y.success),l)),F=a.createElement("div",{"data-testid":"dialog-container"},a.createElement("div",{ref:A,className:u["modal-overlay"],"data-testid":r.testId,style:{zIndex:r.zIndex}},a.createElement("div",{className:u.align,ref:b()},a.createElement("div",{className:o(r.className,u.modal,u["modal--".concat(r.variant)],u["modal--".concat(r.size)]),role:"dialog","aria-label":D,"aria-labelledby":H},a.createElement("div",{tabIndex:p,ref:C,onBlur:function(){return h(-1)}}),a.createElement("div",{className:o(u.modal__shadow,u["modal__shadow--top"],t({},u["modal__shadow--show"],!z&&T))}),a.createElement("div",{className:o(u.modal__contentWrapper,t({},u["modal__contentWrapper--image"],R)),ref:B},!r.noCloseButton&&a.createElement("div",{className:u.modal__closeWrapper},a.createElement("div",{className:o(u.modal__closeWrapper__close)},a.createElement(E,{onClick:r.onClose,ariaLabel:r.ariaLabelCloseBtn}))),a.createElement("div",{className:o(u["modal__contentWrapper__scroll--".concat(r.size)],t({},u["modal__contentWrapper__scroll--image"],R))},a.createElement("div",{ref:L}),a.createElement("div",{className:u.modal__contentWrapper__title},k(r.variant,r.icon),a.createElement(f,{id:M,htmlMarkup:"h3",appearance:"title3",className:q},r.title),r.afterTitleChildren&&a.createElement("div",{className:u.modal__afterTitleChildren},r.afterTitleChildren)),R&&a.createElement("div",null,a.createElement("div",{className:u.modal__contentWrapper__imageWrapper},r.children),a.createElement("span",{className:u.modal__contentWrapper__imageDescription},r.description)),!R&&r.children&&a.createElement("div",null,r.children),!R&&!r.children&&a.createElement("p",{className:u.modal__description},r.description),a.createElement("div",{ref:I}))),a.createElement("div",{className:o(u.modal__shadow,u["modal__shadow--bottom"],t({},u["modal__shadow--show"],!S&&T))}),P&&a.createElement("div",{className:o(u["modal__call-to-action"],u["modal__call-to-action--".concat(r.size)])},r.onSuccess&&a.createElement(c,{onClick:r.onSuccess},r.primaryButtonText),r.secondaryButtonText&&(null===(d=r.secondaryButtonText)||void 0===d?void 0:d.length)>0&&a.createElement(c,{variant:"borderless",onClick:r.onClose},r.secondaryButtonText))))));if(r.printable){return a.createElement(w,{className:"print-modal",testId:"print-modal"},a.createElement("style",{media:"print"},"body > *:not(.".concat("print-modal",") {display: none;}")),F)}return F};L.defaultProps=C;export{L as M,y as a,g as b};
|
|
2
|
-
//# sourceMappingURL=Modal-6b4a2c9c.js.map
|
package/Modal-6b4a2c9c.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Modal-6b4a2c9c.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/RadioButton-84ca988e.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as r}from"./_rollupPluginBabelHelpers-d0752906.js";import a from"react";import{c as o}from"./index-9b84fabc.js";import{u as e}from"./uuid-8870ab4b.js";import t from"./components/RadioButton/styles.module.scss";import{F as i,a as d}from"./constants-a4b0b501.js";var l=a.forwardRef((function(l,n){var b,s,u,m=l.className,p=l.defaultChecked,c=void 0!==p&&p,f=l.disabled,v=l.label,g=l.inputid,k=void 0===g?e():g,w=l.mode,y=l.name,E=void 0===y?k:y,N=l.variant,h=l.errorText,j=l.error,B=void 0===j?!!h:j,x=l.value,F=void 0===x?v:x,O=B||w===i.OnError,R=w===i.OnDark,C=w===i.OnBlueberry,D=N===d.BigForm,H=o(t["radio-button-wrapper"],(r(b={},t["radio-button-wrapper--with-error"],h),r(b,t["radio-button-wrapper--bigform"],D),b)),I=o(t["radio-button-label"],(r(s={},t["radio-button-label--disabled"],f),r(s,t["radio-button-label--on-dark"],R),r(s,t["radio-button-label--on-blueberry"],C),r(s,t["radio-button-label--invalid"],O),r(s,t["radio-button-label--bigform"],D),s)),P=o(t["radio-button"],(r(u={},t["radio-button--on-dark"],R),r(u,t["radio-button--disabled"],f),r(u,t["radio-button--on-blueberry"],C),r(u,t["radio-button--invalid"],O),u),m),T=o(t["radio-button-errors"],r({},t["radio-button-errors--bigform"],D));return a.createElement("div",{"data-testid":l.testId,className:H},h&&a.createElement("p",{className:T},h),a.createElement("label",{htmlFor:k,className:I},a.createElement("input",{id:k,name:E,className:P,type:"radio",disabled:f,value:F,ref:n,"aria-invalid":B,defaultChecked:c}),v))}));export{l as R};
|
|
2
|
-
//# sourceMappingURL=RadioButton-84ca988e.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RadioButton-84ca988e.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/Textarea-9c91191a.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{_ as e,a}from"./_rollupPluginBabelHelpers-d0752906.js";import{_ as t}from"./_tslib-51c8a283.js";import r,{useState as n,useRef as o,useEffect as l}from"react";import{c as i}from"./index-9b84fabc.js";import s from"./components/Textarea/styles.module.scss";import{F as c}from"./constants-a4b0b501.js";import{u as m}from"./uuid-8870ab4b.js";var u=r.forwardRef((function(u,d){var p,x,v,_=u.maxCharacters,f=u.maxText,b=u.testId,g=u.defaultValue,w=u.marginBottom,h=u.transparent,E=u.mode,O=u.label,T=u.minRows,j=void 0===T?3:T,B=u.maxRows,R=void 0===B?10:B,k=u.grow,D=u.errorText,N=t(u,["maxCharacters","maxText","testId","defaultValue","marginBottom","transparent","mode","label","minRows","maxRows","grow","errorText"]),y=n(j),C=e(y,2),H=C[0],V=C[1],F=n(g||""),I=e(F,2),M=I[0],P=I[1],q=o(null),z=function(e){var a=e.rows;e.rows=j;var t=Math.floor((e.scrollHeight-16)/28);t===a&&(e.rows=t),t>=R&&(e.rows=R,e.scrollTop=e.scrollHeight),V(t<R?t:R)},A=E===c.OnDark,G=E===c.OnBlueberry,J=_&&M.length>_,K=E===c.OnError||D||J,L=i(s.textarea,(a(p={},s["textarea--gutterBottom"],w),a(p,s["textarea--invalid"],D),p)),Q=i(s.textarea__input,(a(x={},s["textarea__input--transparent"],h),a(x,s["textarea__input--".concat(c.OnBlueberry)],G),a(x,s["textarea__input--".concat(c.OnDark)],A),a(x,s["textarea__input--invalid"],K),x)),S=i(s["textarea__counter-wrapper"],(a(v={},s["textarea__counter-wrapper--".concat(c.OnDark)],A),a(v,s["textarea__counter-wrapper--invalid"],K),v)),U=i(s.textarea__label,a({},s["textarea__label--".concat(c.OnDark)],A)),W=O?m():void 0;return l((function(){var e,a,t;if(k&&(null===(e=q.current)||void 0===e?void 0:e.children)&&(null===(a=q.current)||void 0===a?void 0:a.children[0])){var r=null===(t=q.current)||void 0===t?void 0:t.children[0];z(r)}}),[]),r.createElement("div",{"data-testid":b,className:L},O&&r.createElement("div",{className:U},r.createElement("label",{htmlFor:W},O)),r.createElement("div",{ref:q},r.createElement("textarea",Object.assign({rows:H,defaultValue:g,id:W,className:Q,ref:d,onChange:function(e){k&&z(e.target),P(e.target.value)},"aria-invalid":!!K},N)),_&&r.createElement("div",{className:S},r.createElement("p",null,"".concat(M.length,"/").concat(_," ").concat(f||"tegn")))))}));export{u as T};
|
|
2
|
-
//# sourceMappingURL=Textarea-9c91191a.js.map
|
package/Textarea-9c91191a.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Textarea-9c91191a.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/Title-90910763.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as t}from"./_rollupPluginBabelHelpers-d0752906.js";import e from"react";import{c as r}from"./index-9b84fabc.js";import i from"./components/Title/styles.module.scss";var a=function(t){return Object.prototype.hasOwnProperty.call(t,"marginTop")&&Object.prototype.hasOwnProperty.call(t,"marginBottom")},o=e.forwardRef((function(o,l){var m,n=o.id,c=o.children,s=o.className,p=o.htmlMarkup,d=void 0===p?"h1":p,f=o.appearance,g=void 0===f?"title1":f,u=o.margin,y=void 0===u?0:u,T=o.testId,b=r(i.title,(t(m={},i["title--feature"],"titleFeature"===g),t(m,i["title--title1"],"title1"===g),t(m,i["title--title2"],"title2"===g),t(m,i["title--title3"],"title3"===g),t(m,i["title--title4"],"title4"===g),t(m,i["title--title5"],"title5"===g),m),s),h=d,v=a(y)?{marginTop:"".concat(y.marginTop,"rem"),marginBottom:"".concat(y.marginBottom,"rem")}:{marginTop:"".concat(y,"rem"),marginBottom:"".concat(y,"rem")};return e.createElement(h,{id:n,className:b,style:v,ref:l,"data-testid":T},c)}));export{o as T,a as i};
|
|
2
|
-
//# sourceMappingURL=Title-90910763.js.map
|
package/Title-90910763.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Title-90910763.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/Validation-ef9ee0ae.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import r from"react";import{c as e}from"./index-9b84fabc.js";import{F as a}from"./FormGroup-68288be3.js";import t from"./components/Validation/styles.module.scss";var o=r.forwardRef((function(o,m){var s=o.errorSummary,n=o.className,i=e(t.validation,n);return r.createElement(r.Fragment,null,r.createElement("div",{"data-testid":o.testId,className:i},r.Children.map(o.children,(function(e){return e.type===a?r.cloneElement(e,{className:s?t["form-group-wrapper--error-sibling"]:""}):e}))),s&&r.createElement("p",{className:t.validation__errors},s))}));export{o as V};
|
|
2
|
-
//# sourceMappingURL=Validation-ef9ee0ae.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Validation-ef9ee0ae.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/constants-a4b0b501.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var r,a,n,e;!function(r){r[r.XSmall=38]="XSmall",r[r.Small=48]="Small",r[r.Medium=64]="Medium",r[r.Large=80]="Large",r[r.XLarge=130]="XLarge"}(r||(r={})),function(r){r[r.Modal=13e5]="Modal"}(a||(a={})),function(r){r.OnWhite="OnWhite",r.OnGrey="OnGrey",r.OnBlueberry="OnBlueberry",r.OnDark="OnDark",r.OnError="OnError"}(n||(n={})),function(r){r.Normal="Normal",r.BigForm="BigForm"}(e||(e={}));export{n as F,r as I,a as Z,e as a};
|
|
2
|
-
//# sourceMappingURL=constants-a4b0b501.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants-a4b0b501.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/hooks/useVisibility.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useVisibility.d.ts","sourceRoot":"","sources":["../../src/hooks/useVisibility.ts"],"names":[],"mappings":";AAEA,eAAO,MAAM,YAAY,8EAwBxB,CAAC"}
|