@helsenorge/designsystem-react 3.0.0 → 3.0.1
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/CHANGELOG.md +380 -668
- package/HelpBubble.js +1 -1
- package/HelpBubble.js.map +1 -1
- package/HorizontalScroll.js.map +1 -1
- package/Input.js +1 -1
- package/Input.js.map +1 -1
- package/ListHeader.js +1 -1
- package/ListHeader.js.map +1 -1
- package/Modal.js.map +1 -1
- package/PopOver.js +1 -1
- package/PopOver.js.map +1 -1
- package/RadioButton.js +1 -1
- package/RadioButton.js.map +1 -1
- package/Textarea.js +1 -1
- package/Textarea.js.map +1 -1
- package/Title.js.map +1 -1
- package/Tooltip.js.map +1 -1
- package/TooltipWord.js +1 -1
- package/TooltipWord.js.map +1 -1
- package/components/AnchorLink/styles.module.scss +11 -6
- package/components/Avatar/styles.module.scss +2 -2
- package/components/Badge/styles.module.scss +7 -1
- package/components/Button/styles.module.scss +35 -21
- package/components/Checkbox/styles.module.scss +12 -12
- package/components/Close/styles.module.scss +15 -7
- package/components/Dropdown/index.js +1 -1
- package/components/Dropdown/index.js.map +1 -1
- package/components/Dropdown/styles.module.scss +31 -10
- package/components/Duolist/styles.module.scss +5 -3
- package/components/ErrorWrapper/styles.module.scss +8 -6
- package/components/Expander/styles.module.scss +46 -15
- package/components/ExpanderHierarchy/expander.module.scss +13 -8
- package/components/ExpanderHierarchy/expander.module.scss.d.ts +1 -1
- package/components/ExpanderHierarchy/styles.module.scss +3 -3
- package/components/ExpanderList/index.js.map +1 -1
- package/components/ExpanderList/styles.module.scss +17 -6
- package/components/FormExample/FormExample.d.ts.map +1 -1
- package/components/FormExample/index.js.map +1 -1
- package/components/FormExample/styles.module.scss +6 -6
- package/components/FormGroup/styles.module.scss +5 -4
- package/components/FormLayout/styles.module.scss +5 -2
- package/components/HelpBubble/HelpBubble.d.ts +2 -2
- package/components/HelpBubble/HelpBubble.d.ts.map +1 -1
- package/components/HelpBubble/index.js +1 -1
- package/components/HelpBubble/styles.module.scss +10 -10
- package/components/HelpBubble/styles.module.scss.d.ts +0 -1
- package/components/HelpBubbleExample/index.js +1 -1
- package/components/HighlightBox/index.js.map +1 -1
- package/components/HighlightBox/styles.module.scss +38 -29
- package/components/HorizontalScroll/HorizontalScroll.d.ts.map +1 -1
- package/components/HorizontalScroll/styles.module.scss +10 -3
- package/components/Icons/SortUp.js +1 -1
- package/components/Icons/SortUp.js.map +1 -1
- package/components/Input/Input.d.ts.map +1 -1
- package/components/Input/styles.module.scss +8 -7
- package/components/LinkList/styles.module.scss +23 -5
- package/components/List/styles.module.scss +4 -0
- package/components/ListHeader/ListHeader.d.ts +9 -7
- package/components/ListHeader/ListHeader.d.ts.map +1 -1
- package/components/ListHeader/styles.module.scss +36 -11
- package/components/Loader/styles.module.scss +40 -18
- package/components/Logo/index.js.map +1 -1
- package/components/MaxCharacters/styles.module.scss +7 -5
- package/components/Modal/styles.module.scss +39 -23
- package/components/NotificationPanel/DetailButton/styles.module.scss +9 -5
- package/components/NotificationPanel/index.js.map +1 -1
- package/components/NotificationPanel/styles.module.scss +45 -12
- package/components/Panel/styles.module.scss +53 -29
- package/components/PanelList/styles.module.scss +6 -5
- package/components/PopMenu/PopMenu.d.ts.map +1 -1
- package/components/PopMenu/styles.module.scss +28 -7
- package/components/PopOver/PopOver.d.ts +5 -3
- package/components/PopOver/PopOver.d.ts.map +1 -1
- package/components/PopOver/componentdata.json +1 -1
- package/components/PopOver/styles.module.scss +16 -13
- package/components/RadioButton/RadioButton.d.ts.map +1 -1
- package/components/RadioButton/styles.module.scss +12 -14
- package/components/Select/styles.module.scss +14 -8
- package/components/Slider/Slider.d.ts.map +1 -1
- package/components/Slider/index.js +1 -1
- package/components/Slider/index.js.map +1 -1
- package/components/Slider/styles.module.scss +1 -1
- package/components/Spacer/styles.module.scss +13 -1
- package/components/StatusDot/styles.module.scss +2 -2
- package/components/Stepper/styles.module.scss +28 -20
- package/components/Table/Table.d.ts.map +1 -1
- package/components/Table/index.js +1 -1
- package/components/Table/index.js.map +1 -1
- package/components/Table/styles.module.scss +32 -20
- package/components/Tag/styles.module.scss +39 -27
- package/components/TagList/styles.module.scss +3 -3
- package/components/Textarea/Textarea.d.ts.map +1 -1
- package/components/Textarea/styles.module.scss +6 -5
- package/components/Tile/styles.module.scss +11 -6
- package/components/Title/Title.d.ts +1 -1
- package/components/Title/Title.d.ts.map +1 -1
- package/components/Title/styles.module.scss +5 -0
- package/components/Tooltip/TooltipWord/TooltipWord.d.ts +1 -1
- package/components/Tooltip/TooltipWord/TooltipWord.d.ts.map +1 -1
- package/components/Tooltip/TooltipWord/styles.module.scss +3 -3
- package/components/Tooltip/index.js +1 -1
- package/components/TooltipExample/index.js +1 -1
- package/components/Validation/styles.module.scss +3 -3
- package/hoc/withBreakpoint/withBreakpoint.d.ts +1 -1
- package/hoc/withBreakpoint/withBreakpoint.d.ts.map +1 -1
- package/hoc/withBreakpoint/withBreakpoint.js.map +1 -1
- package/hooks/useFocusTrap.d.ts.map +1 -1
- package/hooks/useFocusTrap.js.map +1 -1
- package/hooks/useSize.js.map +1 -1
- package/package.json +1 -1
- package/scss/_body.scss +3 -1
- package/scss/_breakpoints.scss +5 -8
- package/scss/_figma-tokens.scss +2 -2
- package/scss/_fonts.scss +36 -21
- package/scss/_grid.scss +5 -4
- package/scss/_input.scss +20 -11
- package/scss/_palette.scss +3 -11
- package/scss/_print.scss +58 -18
- package/scss/_screen-reader.scss +0 -2
- package/scss/_spacers.scss +17 -15
- package/scss/_title.scss +11 -5
- package/scss/helsenorge.scss +1 -1
- package/scss/typography.module.scss +20 -13
- package/utils/component.d.ts +1 -0
- package/utils/component.d.ts.map +1 -1
- package/utils/component.js +1 -1
- package/utils/component.js.map +1 -1
- package/utils/debounce.d.ts +1 -2
- package/utils/debounce.d.ts.map +1 -1
- package/utils/debounce.js +1 -1
- package/utils/debounce.js.map +1 -1
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
@
|
|
2
|
-
@import '../../scss/
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@import '../../scss/palette';
|
|
3
|
+
@import '../../scss/breakpoints';
|
|
4
|
+
|
|
3
5
|
.pop-menu-button {
|
|
4
6
|
padding: 0;
|
|
5
7
|
border: 0;
|
|
@@ -16,15 +18,17 @@
|
|
|
16
18
|
box-shadow: none;
|
|
17
19
|
outline: none;
|
|
18
20
|
}
|
|
21
|
+
|
|
19
22
|
:focus > .pop-menu-button {
|
|
20
23
|
box-shadow: none;
|
|
21
24
|
}
|
|
22
25
|
}
|
|
23
26
|
|
|
24
|
-
//overrides
|
|
27
|
+
// overrides
|
|
25
28
|
:focus > .pop-menu-button:hover {
|
|
26
29
|
box-shadow: none;
|
|
27
30
|
}
|
|
31
|
+
|
|
28
32
|
html :focus > .pop-menu-button {
|
|
29
33
|
box-shadow: none;
|
|
30
34
|
border: solid;
|
|
@@ -34,66 +38,81 @@ html :focus > .pop-menu-button {
|
|
|
34
38
|
&:focus {
|
|
35
39
|
background-color: transparent;
|
|
36
40
|
}
|
|
41
|
+
|
|
37
42
|
&:active {
|
|
38
43
|
background-color: $neutral50;
|
|
39
44
|
border: none;
|
|
40
45
|
}
|
|
46
|
+
|
|
41
47
|
&:hover {
|
|
42
48
|
background-color: $neutral50;
|
|
43
49
|
}
|
|
50
|
+
|
|
44
51
|
&:active:hover {
|
|
45
52
|
background-color: transparent;
|
|
46
53
|
}
|
|
54
|
+
|
|
47
55
|
&:active:focus {
|
|
48
56
|
background-color: $neutral50;
|
|
49
57
|
border: 0.1875rem solid $black;
|
|
50
58
|
}
|
|
51
59
|
}
|
|
60
|
+
|
|
52
61
|
.pop-menu-button--on-gray {
|
|
53
62
|
&:focus {
|
|
54
63
|
background-color: transparent;
|
|
55
64
|
}
|
|
65
|
+
|
|
56
66
|
&:active {
|
|
57
67
|
background-color: $neutral100;
|
|
58
68
|
border: none;
|
|
59
69
|
}
|
|
70
|
+
|
|
60
71
|
&:hover {
|
|
61
72
|
background-color: $neutral100;
|
|
62
73
|
}
|
|
74
|
+
|
|
63
75
|
&:active:hover {
|
|
64
76
|
background-color: transparent;
|
|
65
77
|
}
|
|
78
|
+
|
|
66
79
|
&:active:focus {
|
|
67
80
|
background-color: $neutral100;
|
|
68
81
|
border: 0.1875rem solid $black;
|
|
69
82
|
}
|
|
70
83
|
}
|
|
84
|
+
|
|
71
85
|
.pop-menu-button--on-blueberry {
|
|
72
86
|
&:focus {
|
|
73
87
|
background-color: transparent;
|
|
74
88
|
}
|
|
89
|
+
|
|
75
90
|
&:active {
|
|
76
91
|
background-color: $blueberry100;
|
|
77
92
|
border: none;
|
|
78
93
|
}
|
|
94
|
+
|
|
79
95
|
&:hover {
|
|
80
96
|
background-color: $blueberry100;
|
|
81
97
|
}
|
|
98
|
+
|
|
82
99
|
&:active:hover {
|
|
83
100
|
background-color: transparent;
|
|
84
101
|
}
|
|
102
|
+
|
|
85
103
|
&:active:focus {
|
|
86
104
|
background-color: $blueberry100;
|
|
87
105
|
border: 0.1875rem solid $black;
|
|
88
106
|
}
|
|
89
107
|
}
|
|
108
|
+
|
|
90
109
|
.pop-menu__pop-over {
|
|
91
110
|
width: 20.875rem;
|
|
92
111
|
width: 26.125rem;
|
|
93
|
-
border: 0.125rem solid rgb(24
|
|
94
|
-
box-shadow:
|
|
112
|
+
border: 0.125rem solid rgb(24 128 151);
|
|
113
|
+
box-shadow: 0 0 0.3125rem 0 rgb(0 0 0 / 50%);
|
|
95
114
|
|
|
96
|
-
@media (min-width: map
|
|
115
|
+
@media (min-width: map.get($grid-breakpoints, md)) {
|
|
97
116
|
width: 26.125rem;
|
|
98
117
|
}
|
|
99
118
|
|
|
@@ -104,6 +123,7 @@ html :focus > .pop-menu-button {
|
|
|
104
123
|
border-top-right-radius: 0.5625rem;
|
|
105
124
|
}
|
|
106
125
|
}
|
|
126
|
+
|
|
107
127
|
li:last-of-type {
|
|
108
128
|
a:hover,
|
|
109
129
|
a:focus {
|
|
@@ -112,6 +132,7 @@ html :focus > .pop-menu-button {
|
|
|
112
132
|
}
|
|
113
133
|
}
|
|
114
134
|
}
|
|
135
|
+
|
|
115
136
|
.pop-menu__pop-over-arrow {
|
|
116
|
-
filter: drop-shadow(
|
|
137
|
+
filter: drop-shadow(0 -0.185rem 0 rgb(24 128 151));
|
|
117
138
|
}
|
|
@@ -14,18 +14,20 @@ export interface PopOverProps {
|
|
|
14
14
|
controllerRef: React.RefObject<HTMLElement | SVGSVGElement>;
|
|
15
15
|
/** Ref for the element the PopOver is placed upon */
|
|
16
16
|
popOverRef?: React.RefObject<HTMLDivElement>;
|
|
17
|
+
/** Show the popover. Only applies when role=tooltip. Default: false. */
|
|
18
|
+
show?: boolean;
|
|
17
19
|
/** Adds custom classes to the element. */
|
|
18
20
|
className?: string;
|
|
19
21
|
/** Adds custom classes to the arrow element. */
|
|
20
22
|
arrowClassName?: string;
|
|
21
23
|
/** Determines the placement of the popover. Default: automatic positioning. */
|
|
22
24
|
variant?: keyof typeof PopOverVariant;
|
|
23
|
-
/** Sets role of the PopOver element
|
|
25
|
+
/** Sets role of the PopOver element */
|
|
24
26
|
role?: PopOverRole;
|
|
27
|
+
/** Closes popover on click outside the bubble. */
|
|
28
|
+
closeOnClickOutside?: boolean;
|
|
25
29
|
/** Sets the data-testid attribute. */
|
|
26
30
|
testId?: string;
|
|
27
|
-
/** Closes bubble on click outside the bubble. */
|
|
28
|
-
closeOnClickOutside?: boolean;
|
|
29
31
|
}
|
|
30
32
|
declare const PopOver: React.ForwardRefExoticComponent<PopOverProps & React.RefAttributes<HTMLDivElement | SVGSVGElement>>;
|
|
31
33
|
export default PopOver;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PopOver.d.ts","sourceRoot":"","sources":["../../../src/components/PopOver/PopOver.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAc3D,oBAAY,cAAc;IACxB,iBAAiB,sBAAsB;IACvC,aAAa,kBAAkB;IAC/B,aAAa,kBAAkB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,MAAM,CAAC;IACxB,+EAA+E;IAC/E,OAAO,CAAC,EAAE,MAAM,OAAO,cAAc,CAAC;IACtC,uCAAuC;IACvC,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,kDAAkD;IAClD,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,sCAAsC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,QAAA,MAAM,OAAO,qGA2DX,CAAC;AAIH,eAAe,OAAO,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"props":{"id":{"defaultValue":null,"description":"Id of the PopOver","name":"id","parent":{"fileName":"src/components/PopOver/PopOver.tsx","name":"PopOverProps"},"declarations":[{"fileName":"src/components/PopOver/PopOver.tsx","name":"PopOverProps"}],"required":false,"type":{"name":"string"}},"children":{"defaultValue":null,"description":"Content shown inside PopOver. Note that if role=\"tooltip\", you must not include interactive/focusable elements.","name":"children","parent":{"fileName":"src/components/PopOver/PopOver.tsx","name":"PopOverProps"},"declarations":[{"fileName":"src/components/PopOver/PopOver.tsx","name":"PopOverProps"}],"required":true,"type":{"name":"ReactNode"}},"controllerRef":{"defaultValue":null,"description":"Ref for the element the PopOver is placed upon","name":"controllerRef","parent":{"fileName":"src/components/PopOver/PopOver.tsx","name":"PopOverProps"},"declarations":[{"fileName":"src/components/PopOver/PopOver.tsx","name":"PopOverProps"}],"required":true,"type":{"name":"RefObject<HTMLElement | SVGSVGElement>"}},"popOverRef":{"defaultValue":null,"description":"Ref for the element the PopOver is placed upon","name":"popOverRef","parent":{"fileName":"src/components/PopOver/PopOver.tsx","name":"PopOverProps"},"declarations":[{"fileName":"src/components/PopOver/PopOver.tsx","name":"PopOverProps"}],"required":false,"type":{"name":"RefObject<HTMLDivElement>"}},"className":{"defaultValue":null,"description":"Adds custom classes to the element.","name":"className","parent":{"fileName":"src/components/PopOver/PopOver.tsx","name":"PopOverProps"},"declarations":[{"fileName":"src/components/PopOver/PopOver.tsx","name":"PopOverProps"}],"required":false,"type":{"name":"string"}},"arrowClassName":{"defaultValue":null,"description":"Adds custom classes to the arrow element.","name":"arrowClassName","parent":{"fileName":"src/components/PopOver/PopOver.tsx","name":"PopOverProps"},"declarations":[{"fileName":"src/components/PopOver/PopOver.tsx","name":"PopOverProps"}],"required":false,"type":{"name":"string"}},"variant":{"defaultValue":null,"description":"Determines the placement of the popover. Default: automatic positioning.","name":"variant","parent":{"fileName":"src/components/PopOver/PopOver.tsx","name":"PopOverProps"},"declarations":[{"fileName":"src/components/PopOver/PopOver.tsx","name":"PopOverProps"}],"required":false,"type":{"name":"enum","raw":"\"positionautomatic\" | \"positionbelow\" | \"positionabove\"","value":[{"value":"\"positionautomatic\""},{"value":"\"positionbelow\""},{"value":"\"positionabove\""}]}},"role":{"defaultValue":null,"description":"Sets role of the PopOver element
|
|
1
|
+
{"props":{"id":{"defaultValue":null,"description":"Id of the PopOver","name":"id","parent":{"fileName":"src/components/PopOver/PopOver.tsx","name":"PopOverProps"},"declarations":[{"fileName":"src/components/PopOver/PopOver.tsx","name":"PopOverProps"}],"required":false,"type":{"name":"string"}},"children":{"defaultValue":null,"description":"Content shown inside PopOver. Note that if role=\"tooltip\", you must not include interactive/focusable elements.","name":"children","parent":{"fileName":"src/components/PopOver/PopOver.tsx","name":"PopOverProps"},"declarations":[{"fileName":"src/components/PopOver/PopOver.tsx","name":"PopOverProps"}],"required":true,"type":{"name":"ReactNode"}},"controllerRef":{"defaultValue":null,"description":"Ref for the element the PopOver is placed upon","name":"controllerRef","parent":{"fileName":"src/components/PopOver/PopOver.tsx","name":"PopOverProps"},"declarations":[{"fileName":"src/components/PopOver/PopOver.tsx","name":"PopOverProps"}],"required":true,"type":{"name":"RefObject<HTMLElement | SVGSVGElement>"}},"popOverRef":{"defaultValue":null,"description":"Ref for the element the PopOver is placed upon","name":"popOverRef","parent":{"fileName":"src/components/PopOver/PopOver.tsx","name":"PopOverProps"},"declarations":[{"fileName":"src/components/PopOver/PopOver.tsx","name":"PopOverProps"}],"required":false,"type":{"name":"RefObject<HTMLDivElement>"}},"show":{"defaultValue":null,"description":"Show the popover. Only applies when role=tooltip. Default: false.","name":"show","parent":{"fileName":"src/components/PopOver/PopOver.tsx","name":"PopOverProps"},"declarations":[{"fileName":"src/components/PopOver/PopOver.tsx","name":"PopOverProps"}],"required":false,"type":{"name":"boolean"}},"className":{"defaultValue":null,"description":"Adds custom classes to the element.","name":"className","parent":{"fileName":"src/components/PopOver/PopOver.tsx","name":"PopOverProps"},"declarations":[{"fileName":"src/components/PopOver/PopOver.tsx","name":"PopOverProps"}],"required":false,"type":{"name":"string"}},"arrowClassName":{"defaultValue":null,"description":"Adds custom classes to the arrow element.","name":"arrowClassName","parent":{"fileName":"src/components/PopOver/PopOver.tsx","name":"PopOverProps"},"declarations":[{"fileName":"src/components/PopOver/PopOver.tsx","name":"PopOverProps"}],"required":false,"type":{"name":"string"}},"variant":{"defaultValue":null,"description":"Determines the placement of the popover. Default: automatic positioning.","name":"variant","parent":{"fileName":"src/components/PopOver/PopOver.tsx","name":"PopOverProps"},"declarations":[{"fileName":"src/components/PopOver/PopOver.tsx","name":"PopOverProps"}],"required":false,"type":{"name":"enum","raw":"\"positionautomatic\" | \"positionbelow\" | \"positionabove\"","value":[{"value":"\"positionautomatic\""},{"value":"\"positionbelow\""},{"value":"\"positionabove\""}]}},"role":{"defaultValue":null,"description":"Sets role of the PopOver element","name":"role","parent":{"fileName":"src/components/PopOver/PopOver.tsx","name":"PopOverProps"},"declarations":[{"fileName":"src/components/PopOver/PopOver.tsx","name":"PopOverProps"}],"required":false,"type":{"name":"enum","raw":"\"tooltip\"","value":[{"value":"\"tooltip\""}]}},"closeOnClickOutside":{"defaultValue":null,"description":"Closes popover on click outside the bubble.","name":"closeOnClickOutside","parent":{"fileName":"src/components/PopOver/PopOver.tsx","name":"PopOverProps"},"declarations":[{"fileName":"src/components/PopOver/PopOver.tsx","name":"PopOverProps"}],"required":false,"type":{"name":"boolean"}},"testId":{"defaultValue":null,"description":"Sets the data-testid attribute.","name":"testId","parent":{"fileName":"src/components/PopOver/PopOver.tsx","name":"PopOverProps"},"declarations":[{"fileName":"src/components/PopOver/PopOver.tsx","name":"PopOverProps"}],"required":false,"type":{"name":"string"}}}}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
@
|
|
2
|
-
@import '../../scss/
|
|
3
|
-
@import '../../scss/
|
|
4
|
-
@import '../../scss/
|
|
5
|
-
@import '
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@import '../../scss/spacers';
|
|
3
|
+
@import '../../scss/breakpoints';
|
|
4
|
+
@import '../../scss/palette';
|
|
5
|
+
@import '../../scss/font-settings';
|
|
6
|
+
@import '../AnchorLink/styles.module';
|
|
6
7
|
|
|
7
8
|
.popover {
|
|
8
9
|
$popover: &;
|
|
10
|
+
|
|
9
11
|
display: flex;
|
|
10
12
|
position: fixed;
|
|
11
13
|
align-items: flex-start !important;
|
|
@@ -32,9 +34,9 @@
|
|
|
32
34
|
|
|
33
35
|
border: getSpacer(4xs) solid $plum600;
|
|
34
36
|
border-radius: 0.5625rem;
|
|
35
|
-
box-shadow: 0 0.125rem 1.125rem 0
|
|
37
|
+
box-shadow: 0 0.125rem 1.125rem 0 rgb(0 0 0 / 15%);
|
|
36
38
|
|
|
37
|
-
@media (min-width: map
|
|
39
|
+
@media (min-width: map.get($grid-breakpoints, lg)) {
|
|
38
40
|
font-size: $font-size-md;
|
|
39
41
|
line-height: $lineheight-size-md;
|
|
40
42
|
}
|
|
@@ -48,16 +50,17 @@
|
|
|
48
50
|
z-index: 3;
|
|
49
51
|
|
|
50
52
|
&--over {
|
|
51
|
-
border-width: 0.625rem
|
|
53
|
+
border-width: 0.625rem;
|
|
52
54
|
border-bottom-color: $white;
|
|
53
|
-
|
|
54
|
-
filter: drop-shadow(
|
|
55
|
+
filter: drop-shadow($plum600 0 0.125rem 0.375rem 0.125rem);
|
|
56
|
+
filter: drop-shadow(0 -0.185rem 0 $plum600);
|
|
55
57
|
}
|
|
58
|
+
|
|
56
59
|
&--under {
|
|
57
|
-
border-width: 0.625rem
|
|
60
|
+
border-width: 0.625rem;
|
|
58
61
|
border-top-color: $white;
|
|
59
|
-
|
|
60
|
-
filter: drop-shadow(
|
|
62
|
+
filter: drop-shadow($plum600 0 0.125rem 0.375rem 0.125rem);
|
|
63
|
+
filter: drop-shadow(0 0.2rem 0 $plum600);
|
|
61
64
|
}
|
|
62
65
|
}
|
|
63
66
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioButton.d.ts","sourceRoot":"","sources":["../../../src/components/RadioButton/RadioButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAe,QAAQ,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAKrE,MAAM,WAAW,gBACf,SAAQ,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,gBAAgB,GAAG,UAAU,CAAC;IACxH,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6CAA6C;IAC7C,KAAK,EAAE,MAAM,CAAC;IACd,kCAAkC;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,6CAA6C;IAC7C,IAAI,CAAC,EAAE,MAAM,OAAO,QAAQ,CAAC;IAC7B,6CAA6C;IAC7C,OAAO,CAAC,EAAE,MAAM,OAAO,WAAW,CAAC;IACnC,oHAAoH;IACpH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,6CAA6C;IAC7C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sCAAsC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"RadioButton.d.ts","sourceRoot":"","sources":["../../../src/components/RadioButton/RadioButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAe,QAAQ,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAKrE,MAAM,WAAW,gBACf,SAAQ,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,gBAAgB,GAAG,UAAU,CAAC;IACxH,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6CAA6C;IAC7C,KAAK,EAAE,MAAM,CAAC;IACd,kCAAkC;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,6CAA6C;IAC7C,IAAI,CAAC,EAAE,MAAM,OAAO,QAAQ,CAAC;IAC7B,6CAA6C;IAC7C,OAAO,CAAC,EAAE,MAAM,OAAO,WAAW,CAAC;IACnC,oHAAoH;IACpH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,6CAA6C;IAC7C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sCAAsC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,WAAW,2FAmEtB,CAAC;AAIH,eAAe,WAAW,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
@
|
|
2
|
-
@import '../../scss/
|
|
3
|
-
@import '../../scss/
|
|
4
|
-
@import '../../scss/
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@import '../../scss/spacers';
|
|
3
|
+
@import '../../scss/breakpoints';
|
|
4
|
+
@import '../../scss/palette';
|
|
5
|
+
@import '../../scss/font-settings';
|
|
5
6
|
|
|
6
7
|
.radio-button-errors {
|
|
7
8
|
font-size: $font-size-sm;
|
|
@@ -20,7 +21,7 @@
|
|
|
20
21
|
margin-left: -0.75rem;
|
|
21
22
|
border-left: 0.25rem solid $cherry600;
|
|
22
23
|
|
|
23
|
-
@media (min-width: map
|
|
24
|
+
@media (min-width: map.get($grid-breakpoints, md)) {
|
|
24
25
|
padding: getSpacer(s) getSpacer(m) getSpacer(l);
|
|
25
26
|
}
|
|
26
27
|
}
|
|
@@ -49,7 +50,7 @@
|
|
|
49
50
|
font-size: $font-size-sm;
|
|
50
51
|
line-height: $lineheight-size-sm;
|
|
51
52
|
|
|
52
|
-
@media (min-width: map
|
|
53
|
+
@media (min-width: map.get($grid-breakpoints, md)) {
|
|
53
54
|
font-size: $font-size-md;
|
|
54
55
|
}
|
|
55
56
|
|
|
@@ -83,7 +84,7 @@
|
|
|
83
84
|
background-color: $white;
|
|
84
85
|
}
|
|
85
86
|
|
|
86
|
-
@media (min-width: map
|
|
87
|
+
@media (min-width: map.get($grid-breakpoints, md)) {
|
|
87
88
|
&--bigform {
|
|
88
89
|
padding: 1.68rem getSpacer(l);
|
|
89
90
|
}
|
|
@@ -91,10 +92,7 @@
|
|
|
91
92
|
}
|
|
92
93
|
|
|
93
94
|
.radio-button {
|
|
94
|
-
|
|
95
|
-
-webkit-appearance: none;
|
|
96
|
-
-o-appearance: none;
|
|
97
|
-
|
|
95
|
+
appearance: none;
|
|
98
96
|
cursor: pointer;
|
|
99
97
|
display: flex;
|
|
100
98
|
justify-content: center;
|
|
@@ -191,8 +189,8 @@
|
|
|
191
189
|
|
|
192
190
|
&--disabled {
|
|
193
191
|
cursor: default;
|
|
194
|
-
|
|
195
192
|
color: $neutral400;
|
|
193
|
+
|
|
196
194
|
&:checked {
|
|
197
195
|
color: $neutral400;
|
|
198
196
|
|
|
@@ -201,6 +199,7 @@
|
|
|
201
199
|
background-color: transparent;
|
|
202
200
|
}
|
|
203
201
|
}
|
|
202
|
+
|
|
204
203
|
&:hover {
|
|
205
204
|
box-shadow: 0 0 0 getSpacer(4xs);
|
|
206
205
|
background-color: transparent;
|
|
@@ -235,6 +234,7 @@
|
|
|
235
234
|
background-color: $cherry600;
|
|
236
235
|
}
|
|
237
236
|
}
|
|
237
|
+
|
|
238
238
|
/******** RESET *********/
|
|
239
239
|
@mixin reset-radio-button() {
|
|
240
240
|
border: 0;
|
|
@@ -253,8 +253,6 @@
|
|
|
253
253
|
font-weight: 400;
|
|
254
254
|
margin: 0;
|
|
255
255
|
word-break: break-word;
|
|
256
|
-
-webkit-hyphens: auto;
|
|
257
|
-
-ms-hyphens: auto;
|
|
258
256
|
hyphens: auto;
|
|
259
257
|
}
|
|
260
258
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
@
|
|
2
|
-
@import '../../scss/
|
|
3
|
-
@import '../../scss/
|
|
4
|
-
@import '../../scss/
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@import '../../scss/spacers';
|
|
3
|
+
@import '../../scss/breakpoints';
|
|
4
|
+
@import '../../scss/palette';
|
|
5
|
+
@import '../../scss/font-settings';
|
|
5
6
|
|
|
6
7
|
.select-wrapper {
|
|
7
8
|
display: flex;
|
|
@@ -15,7 +16,7 @@
|
|
|
15
16
|
font-weight: 600;
|
|
16
17
|
padding-bottom: getSpacer(xs);
|
|
17
18
|
|
|
18
|
-
@media (min-width: map
|
|
19
|
+
@media (min-width: map.get($grid-breakpoints, md)) {
|
|
19
20
|
line-height: getSpacer(l);
|
|
20
21
|
font-size: $font-size-md;
|
|
21
22
|
}
|
|
@@ -35,6 +36,7 @@
|
|
|
35
36
|
display: inline-grid;
|
|
36
37
|
background-color: $white;
|
|
37
38
|
align-items: center;
|
|
39
|
+
|
|
38
40
|
// Andre kolonne her styrer plassering av select ikonet
|
|
39
41
|
grid-template-columns: 1fr 2.8rem;
|
|
40
42
|
|
|
@@ -45,16 +47,19 @@
|
|
|
45
47
|
&:hover {
|
|
46
48
|
background: $neutral50;
|
|
47
49
|
}
|
|
50
|
+
|
|
48
51
|
&--on-blueberry {
|
|
49
52
|
&:hover {
|
|
50
53
|
background-color: $blueberry50;
|
|
51
54
|
}
|
|
52
55
|
}
|
|
56
|
+
|
|
53
57
|
&--invalid {
|
|
54
58
|
&:hover {
|
|
55
59
|
background-color: $cherry50;
|
|
56
60
|
}
|
|
57
61
|
}
|
|
62
|
+
|
|
58
63
|
&--disabled {
|
|
59
64
|
background: $neutral50;
|
|
60
65
|
|
|
@@ -67,7 +72,6 @@
|
|
|
67
72
|
.select {
|
|
68
73
|
/* Pil fjernes for browsere utenom IE */
|
|
69
74
|
appearance: none;
|
|
70
|
-
|
|
71
75
|
height: 2.5rem;
|
|
72
76
|
align-items: center;
|
|
73
77
|
background-color: transparent;
|
|
@@ -82,7 +86,7 @@
|
|
|
82
86
|
line-height: $lineheight-size-sm;
|
|
83
87
|
border-radius: 0;
|
|
84
88
|
|
|
85
|
-
@media (min-width: map
|
|
89
|
+
@media (min-width: map.get($grid-breakpoints, md)) {
|
|
86
90
|
height: 3.125rem;
|
|
87
91
|
font-size: $font-size-md;
|
|
88
92
|
}
|
|
@@ -90,6 +94,7 @@
|
|
|
90
94
|
&--on-blueberry {
|
|
91
95
|
outline-color: $blueberry500;
|
|
92
96
|
}
|
|
97
|
+
|
|
93
98
|
&--invalid {
|
|
94
99
|
outline-color: $cherry600;
|
|
95
100
|
}
|
|
@@ -98,6 +103,7 @@
|
|
|
98
103
|
outline-width: 3px;
|
|
99
104
|
outline-offset: -1px;
|
|
100
105
|
}
|
|
106
|
+
|
|
101
107
|
&:focus {
|
|
102
108
|
outline: $black solid 4px;
|
|
103
109
|
outline-offset: -2px;
|
|
@@ -113,7 +119,7 @@
|
|
|
113
119
|
font-family: inherit;
|
|
114
120
|
font-size: $font-size-sm;
|
|
115
121
|
|
|
116
|
-
@media (min-width: map
|
|
122
|
+
@media (min-width: map.get($grid-breakpoints, md)) {
|
|
117
123
|
font-size: $font-size-md;
|
|
118
124
|
}
|
|
119
125
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Slider.d.ts","sourceRoot":"","sources":["../../../src/components/Slider/Slider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AA4B3D,UAAU,WAAW;IACnB,oCAAoC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+CAA+C;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gDAAgD;IAChD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qCAAqC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mCAAmC;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,sCAAsC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAOD,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"Slider.d.ts","sourceRoot":"","sources":["../../../src/components/Slider/Slider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AA4B3D,UAAU,WAAW;IACnB,oCAAoC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+CAA+C;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gDAAgD;IAChD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qCAAqC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mCAAmC;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,sCAAsC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAOD,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CA8KxC,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import s,{useState as b,useRef as D,useEffect as h}from"react";import P from"classnames";import{AnalyticsId as j}from"../../constants.js";import{useSize as M}from"../../hooks/useSize.js";import{useUuid as g}from"../../hooks/useUuid.js";import{getAriaLabelAttributes as C}from"../../utils/accessibility.js";import{T as K}from"../../Title.js";import i from"./styles.module.scss";import"../../utils/debounce.js";import"../../uuid.js";import"../../utils/environment.js";import"../Title/styles.module.scss";const W=(
|
|
1
|
+
import s,{useState as b,useRef as D,useEffect as h}from"react";import P from"classnames";import{AnalyticsId as j}from"../../constants.js";import{useSize as M}from"../../hooks/useSize.js";import{useUuid as g}from"../../hooks/useUuid.js";import{getAriaLabelAttributes as C}from"../../utils/accessibility.js";import{T as K}from"../../Title.js";import i from"./styles.module.scss";import"../../utils/debounce.js";import"../../uuid.js";import"../../utils/environment.js";import"../Title/styles.module.scss";const W=(n,k,c)=>{const[u,r]=b(n);return[u,f=>{f>c?r(c):f<k?r(k):r(f)}]},m=100,d=0,N=1,V=10,$=({title:n,ariaLabel:k,labelLeft:c,labelRight:u,disabled:r=!1,onChange:E,testId:f})=>{const[L,S]=b(!1),[a,o]=W((m-d)/2,d,m),p=g(),w=g(),_=g(),A=D(null),v=D(null),{width:y}=M(A)||{width:0},{width:U}=M(v)||{width:0};h(()=>{const e=()=>{S(!1)};return document.addEventListener("pointerup",e),()=>{document.removeEventListener("pointerup",e)}},[]);const I=e=>{var l;const t=((l=A.current)==null?void 0:l.getBoundingClientRect().x)??0;return Math.round((e-t)/y*(m-d))};h(()=>{const e=t=>{if(!r&&L){const l=I(t.clientX);o(l)}};return document.addEventListener("pointermove",e),()=>{document.removeEventListener("pointermove",e)}},[L]),h(()=>{!r&&E&&E(a)},[a]);const R=e=>{if(r)return;let t=!1;switch(e.key){case"ArrowLeft":case"ArrowDown":o(a-N),t=!0;break;case"PageDown":o(a-V),t=!0;break;case"ArrowRight":case"ArrowUp":o(a+N),t=!0;break;case"PageUp":o(a+V),t=!0;break;case"Home":o(d),t=!0;break;case"End":o(m),t=!0;break}t&&(e.preventDefault(),e.stopPropagation())},T=e=>{var l;if(r)return;const t=I(e.clientX);o(t),(l=v.current)==null||l.focus()},x=e=>{var t;r||(S(!0),e.preventDefault(),e.stopPropagation(),(t=v.current)==null||t.focus())},B=(y-U)/(m-d)*a,X=C({label:k,id:(()=>{if(n&&c&&u)return[p,w,_].join(" ");if(n&&c)return[p,w].join(" ");if(n&&u)return[p,_].join(" ");if(n)return p})(),prefer:"label"});return s.createElement("div",{className:i.slider,"data-testid":f,"data-analyticsid":j.Slider},n&&s.createElement(K,{htmlMarkup:"h3",margin:1.5,appearance:"title3",id:p},n),s.createElement("div",{ref:A,className:P(i["slider__track-wrapper"],r&&i["slider__track-wrapper--disabled"]),onClick:T,onPointerDown:x},s.createElement("div",{className:P(i.slider__track,r&&i["slider__track--disabled"])}),s.createElement("div",{role:r?void 0:"slider",ref:v,className:P(i.slider__marker,r&&i["slider__marker--disabled"]),style:{left:`${B}px`},onKeyDown:R,"aria-valuenow":a,"aria-valuemin":d,"aria-valuemax":m,tabIndex:r?void 0:0,"aria-disabled":r,...X})),(c||u)&&s.createElement("span",{className:i.slider__options},s.createElement("span",{id:w},c),s.createElement("span",{id:_},u)))},ne=$;export{$ as Slider,ne as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/Slider/Slider.tsx"],"sourcesContent":["import React, { useEffect, useState, useRef } from 'react';\n\nimport classNames from 'classnames';\n\nimport { AnalyticsId } from '../../constants';\nimport { useSize } from '../../hooks/useSize';\nimport { useUuid } from '../../hooks/useUuid';\nimport { getAriaLabelAttributes } from '../../utils/accessibility';\nimport Title from '../Title';\n\nimport styles from './styles.module.scss';\n\nconst useSafeNumberValue = (initial: number, min: number, max: number): [number, (value: number) => void] => {\n const [value, setValue] = useState(initial);\n\n const setSafeValue = (newValue: number): void => {\n if (newValue > max) {\n setValue(max);\n } else if (newValue < min) {\n setValue(min);\n } else {\n setValue(newValue);\n }\n };\n\n return [value, setSafeValue];\n};\n\ninterface SliderProps {\n /**\tSets the title of the slider. */\n title?: string;\n /** Adds the left hand label to the element. */\n labelLeft?: string;\n /** Adds the right hand label to the element. */\n labelRight?: string;\n /**\tSets aria-label of the slider. */\n ariaLabel?: string;\n /** Disables the slider element. */\n disabled?: boolean;\n /** Function to be called when the value state has changed. */\n onChange?: (value: number) => void;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\nconst MAX_VALUE = 100;\nconst MIN_VALUE = 0;\nconst STEP = 1;\nconst LARGE_STEP = 10;\n\nexport const Slider: React.FC<SliderProps> = ({ title, ariaLabel, labelLeft, labelRight, disabled = false, onChange, testId }) => {\n const [isMoving, setIsMoving] = useState(false);\n const [value, setValue] = useSafeNumberValue((MAX_VALUE - MIN_VALUE) / 2, MIN_VALUE, MAX_VALUE);\n const titleId = useUuid();\n const labelLeftId = useUuid();\n const labelRightId = useUuid();\n const trackRef = useRef<HTMLDivElement>(null);\n const markerRef = useRef<HTMLDivElement>(null);\n const { width: trackWidth } = useSize(trackRef) || { width: 0 };\n const { width: markerWidth } = useSize(markerRef) || { width: 0 };\n\n useEffect(() => {\n const handlePointerUp = (): void => {\n setIsMoving(false);\n };\n\n document.addEventListener('pointerup', handlePointerUp);\n\n return () => {\n document.removeEventListener('pointerup', handlePointerUp);\n };\n }, []);\n\n const getValueBasedOnMarkerPosition = (markerPosition: number): number => {\n const trackPosition = trackRef.current?.getBoundingClientRect().x ?? 0;\n\n return Math.round(((markerPosition - trackPosition) / trackWidth) * (MAX_VALUE - MIN_VALUE));\n };\n\n useEffect(() => {\n const handlePointerMove = (e: PointerEvent): void => {\n if (!disabled && isMoving) {\n const newValue = getValueBasedOnMarkerPosition(e.clientX);\n setValue(newValue);\n }\n };\n\n document.addEventListener('pointermove', handlePointerMove);\n\n return () => {\n document.removeEventListener('pointermove', handlePointerMove);\n };\n }, [isMoving]);\n\n useEffect(() => {\n if (!disabled && onChange) {\n onChange(value);\n }\n }, [value]);\n\n const handleKeyDown: React.KeyboardEventHandler<HTMLDivElement> = e => {\n if (disabled) return;\n\n let flag = false;\n\n switch (e.key) {\n case 'ArrowLeft':\n case 'ArrowDown':\n setValue(value - STEP);\n flag = true;\n break;\n case 'PageDown':\n setValue(value - LARGE_STEP);\n flag = true;\n break;\n case 'ArrowRight':\n case 'ArrowUp':\n setValue(value + STEP);\n flag = true;\n break;\n case 'PageUp':\n setValue(value + LARGE_STEP);\n flag = true;\n break;\n case 'Home':\n setValue(MIN_VALUE);\n flag = true;\n break;\n case 'End':\n setValue(MAX_VALUE);\n flag = true;\n break;\n default:\n break;\n }\n\n if (flag) {\n e.preventDefault();\n e.stopPropagation();\n }\n };\n\n const handleTrackClick: React.MouseEventHandler<HTMLDivElement> = e => {\n if (disabled) return;\n\n const newValue = getValueBasedOnMarkerPosition(e.clientX);\n setValue(newValue);\n markerRef.current?.focus();\n };\n\n const handlePointerDown: React.PointerEventHandler<HTMLDivElement> = e => {\n if (disabled) return;\n\n setIsMoving(true);\n\n e.preventDefault();\n e.stopPropagation();\n\n markerRef.current?.focus();\n };\n\n const markerXPos = ((trackWidth - markerWidth) / (MAX_VALUE - MIN_VALUE)) * value;\n\n const getAriaLabeledById = (): string | undefined => {\n if (title && labelLeft && labelRight) {\n return [titleId, labelLeftId, labelRightId].join(' ');\n }\n if (title && labelLeft) {\n return [titleId, labelLeftId].join(' ');\n }\n if (title && labelRight) {\n return [titleId, labelRightId].join(' ');\n }\n if (title) {\n return titleId;\n }\n };\n\n const ariaLabelAttributes = getAriaLabelAttributes({\n label: ariaLabel,\n id: getAriaLabeledById(),\n prefer: 'label',\n });\n\n return (\n <div className={styles.slider} data-testid={testId} data-analyticsid={AnalyticsId.Slider}>\n {title && (\n <Title htmlMarkup={'h3'} margin={1.5} appearance={'title3'} id={titleId}>\n {title}\n </Title>\n )}\n <div\n ref={trackRef}\n className={classNames(styles['slider__track-wrapper'], disabled && styles['slider__track-wrapper--disabled'])}\n onClick={handleTrackClick}\n onPointerDown={handlePointerDown}\n >\n <div className={classNames(styles.slider__track, disabled && styles['slider__track--disabled'])} />\n <div\n role={'slider'}\n ref={markerRef}\n className={classNames(styles.slider__marker, disabled && styles['slider__marker--disabled'])}\n style={{\n left: `${markerXPos}px`,\n }}\n onKeyDown={handleKeyDown}\n aria-valuenow={value}\n aria-valuemin={MIN_VALUE}\n aria-valuemax={MAX_VALUE}\n tabIndex={disabled ? undefined : 0}\n aria-disabled={disabled}\n {...ariaLabelAttributes}\n />\n </div>\n {(labelLeft || labelRight) && (\n <span className={styles.slider__options}>\n <span id={labelLeftId}>{labelLeft}</span>\n <span id={labelRightId}>{labelRight}</span>\n </span>\n )}\n </div>\n );\n};\n\nexport default Slider;\n"],"names":["useSafeNumberValue","initial","min","max","value","setValue","useState","newValue","MAX_VALUE","MIN_VALUE","STEP","LARGE_STEP","Slider","title","ariaLabel","labelLeft","labelRight","disabled","onChange","testId","isMoving","setIsMoving","titleId","useUuid","labelLeftId","labelRightId","trackRef","useRef","markerRef","trackWidth","useSize","markerWidth","useEffect","handlePointerUp","getValueBasedOnMarkerPosition","markerPosition","trackPosition","_a","handlePointerMove","e","handleKeyDown","flag","handleTrackClick","handlePointerDown","markerXPos","ariaLabelAttributes","getAriaLabelAttributes","React","styles","AnalyticsId","Title","classNames","Slider$1"],"mappings":"sfAYA,MAAMA,EAAqB,CAACC,EAAiBC,EAAaC,IAAmD,CAC3G,KAAM,CAACC,EAAOC,CAAQ,EAAIC,EAASL,CAAO,EAYnC,MAAA,CAACG,EAVcG,GAA2B,CAC3CA,EAAWJ,EACbE,EAASF,CAAG,EACHI,EAAWL,EACpBG,EAASH,CAAG,EAEZG,EAASE,CAAQ,CACnB,CAGyB,CAC7B,EAmBMC,EAAY,IACZC,EAAY,EACZC,EAAO,EACPC,EAAa,GAENC,EAAgC,CAAC,CAAE,MAAAC,EAAO,UAAAC,EAAW,UAAAC,EAAW,WAAAC,EAAY,SAAAC,EAAW,GAAO,SAAAC,EAAU,OAAAC,KAAa,CAChI,KAAM,CAACC,EAAUC,CAAW,EAAIf,EAAS,EAAK,EACxC,CAACF,EAAOC,CAAQ,EAAIL,GAAoBQ,EAAYC,GAAa,EAAGA,EAAWD,CAAS,EACxFc,EAAUC,IACVC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e/B,GAAY+B,EAAO,yBAAyB,CAAC,CAAG,CAAA,EACjGD,EAAA,cAAC,MAAA,CACC,KAAM,SACN,IAAKnB,EACL,UAAWuB,EAAWH,EAAO,eAAgB/B,GAAY+B,EAAO,0BAA0B,CAAC,EAC3F,MAAO,CACL,KAAM,GAAGJ,KACX,EACA,UAAWJ,EACX,gBAAepC,EACf,gBAAeK,EACf,gBAAeD,EACf,SAAUS,EAAW,OAAY,EACjC,gBAAeA,EACd,GAAG4B,CAAA,CACN,CACF,GACE9B,GAAaC,IACb+B,EAAA,cAAC,QAAK,UAAWC,EAAO,iBACrBD,EAAA,cAAA,OAAA,CAAK,GAAIvB,CAAc,EAAAT,CAAU,EACjCgC,EAAA,cAAA,OAAA,CAAK,GAAItB,CAAe,EAAAT,CAAW,CACtC,CAEJ,CAEJ,EAEAoC,GAAexC"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/Slider/Slider.tsx"],"sourcesContent":["import React, { useEffect, useState, useRef } from 'react';\n\nimport classNames from 'classnames';\n\nimport { AnalyticsId } from '../../constants';\nimport { useSize } from '../../hooks/useSize';\nimport { useUuid } from '../../hooks/useUuid';\nimport { getAriaLabelAttributes } from '../../utils/accessibility';\nimport Title from '../Title';\n\nimport styles from './styles.module.scss';\n\nconst useSafeNumberValue = (initial: number, min: number, max: number): [number, (value: number) => void] => {\n const [value, setValue] = useState(initial);\n\n const setSafeValue = (newValue: number): void => {\n if (newValue > max) {\n setValue(max);\n } else if (newValue < min) {\n setValue(min);\n } else {\n setValue(newValue);\n }\n };\n\n return [value, setSafeValue];\n};\n\ninterface SliderProps {\n /**\tSets the title of the slider. */\n title?: string;\n /** Adds the left hand label to the element. */\n labelLeft?: string;\n /** Adds the right hand label to the element. */\n labelRight?: string;\n /**\tSets aria-label of the slider. */\n ariaLabel?: string;\n /** Disables the slider element. */\n disabled?: boolean;\n /** Function to be called when the value state has changed. */\n onChange?: (value: number) => void;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\nconst MAX_VALUE = 100;\nconst MIN_VALUE = 0;\nconst STEP = 1;\nconst LARGE_STEP = 10;\n\nexport const Slider: React.FC<SliderProps> = ({ title, ariaLabel, labelLeft, labelRight, disabled = false, onChange, testId }) => {\n const [isMoving, setIsMoving] = useState(false);\n const [value, setValue] = useSafeNumberValue((MAX_VALUE - MIN_VALUE) / 2, MIN_VALUE, MAX_VALUE);\n const titleId = useUuid();\n const labelLeftId = useUuid();\n const labelRightId = useUuid();\n const trackRef = useRef<HTMLDivElement>(null);\n const markerRef = useRef<HTMLDivElement>(null);\n const { width: trackWidth } = useSize(trackRef) || { width: 0 };\n const { width: markerWidth } = useSize(markerRef) || { width: 0 };\n\n useEffect(() => {\n const handlePointerUp = (): void => {\n setIsMoving(false);\n };\n\n document.addEventListener('pointerup', handlePointerUp);\n\n return () => {\n document.removeEventListener('pointerup', handlePointerUp);\n };\n }, []);\n\n const getValueBasedOnMarkerPosition = (markerPosition: number): number => {\n const trackPosition = trackRef.current?.getBoundingClientRect().x ?? 0;\n\n return Math.round(((markerPosition - trackPosition) / trackWidth) * (MAX_VALUE - MIN_VALUE));\n };\n\n useEffect(() => {\n const handlePointerMove = (e: PointerEvent): void => {\n if (!disabled && isMoving) {\n const newValue = getValueBasedOnMarkerPosition(e.clientX);\n setValue(newValue);\n }\n };\n\n document.addEventListener('pointermove', handlePointerMove);\n\n return () => {\n document.removeEventListener('pointermove', handlePointerMove);\n };\n }, [isMoving]);\n\n useEffect(() => {\n if (!disabled && onChange) {\n onChange(value);\n }\n }, [value]);\n\n const handleKeyDown: React.KeyboardEventHandler<HTMLDivElement> = e => {\n if (disabled) return;\n\n let flag = false;\n\n switch (e.key) {\n case 'ArrowLeft':\n case 'ArrowDown':\n setValue(value - STEP);\n flag = true;\n break;\n case 'PageDown':\n setValue(value - LARGE_STEP);\n flag = true;\n break;\n case 'ArrowRight':\n case 'ArrowUp':\n setValue(value + STEP);\n flag = true;\n break;\n case 'PageUp':\n setValue(value + LARGE_STEP);\n flag = true;\n break;\n case 'Home':\n setValue(MIN_VALUE);\n flag = true;\n break;\n case 'End':\n setValue(MAX_VALUE);\n flag = true;\n break;\n default:\n break;\n }\n\n if (flag) {\n e.preventDefault();\n e.stopPropagation();\n }\n };\n\n const handleTrackClick: React.MouseEventHandler<HTMLDivElement> = e => {\n if (disabled) return;\n\n const newValue = getValueBasedOnMarkerPosition(e.clientX);\n setValue(newValue);\n markerRef.current?.focus();\n };\n\n const handlePointerDown: React.PointerEventHandler<HTMLDivElement> = e => {\n if (disabled) return;\n\n setIsMoving(true);\n\n e.preventDefault();\n e.stopPropagation();\n\n markerRef.current?.focus();\n };\n\n const markerXPos = ((trackWidth - markerWidth) / (MAX_VALUE - MIN_VALUE)) * value;\n\n const getAriaLabeledById = (): string | undefined => {\n if (title && labelLeft && labelRight) {\n return [titleId, labelLeftId, labelRightId].join(' ');\n }\n if (title && labelLeft) {\n return [titleId, labelLeftId].join(' ');\n }\n if (title && labelRight) {\n return [titleId, labelRightId].join(' ');\n }\n if (title) {\n return titleId;\n }\n };\n\n const ariaLabelAttributes = getAriaLabelAttributes({\n label: ariaLabel,\n id: getAriaLabeledById(),\n prefer: 'label',\n });\n\n return (\n <div className={styles.slider} data-testid={testId} data-analyticsid={AnalyticsId.Slider}>\n {title && (\n <Title htmlMarkup={'h3'} margin={1.5} appearance={'title3'} id={titleId}>\n {title}\n </Title>\n )}\n {/* Komponenten er tilgjengelig for mus/keyboard gjennom bruk av slideren */}\n {/* eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */}\n <div\n ref={trackRef}\n className={classNames(styles['slider__track-wrapper'], disabled && styles['slider__track-wrapper--disabled'])}\n onClick={handleTrackClick}\n onPointerDown={handlePointerDown}\n >\n <div className={classNames(styles.slider__track, disabled && styles['slider__track--disabled'])} />\n <div\n role={disabled ? undefined : 'slider'}\n ref={markerRef}\n className={classNames(styles.slider__marker, disabled && styles['slider__marker--disabled'])}\n style={{\n left: `${markerXPos}px`,\n }}\n onKeyDown={handleKeyDown}\n aria-valuenow={value}\n aria-valuemin={MIN_VALUE}\n aria-valuemax={MAX_VALUE}\n tabIndex={disabled ? undefined : 0}\n aria-disabled={disabled}\n {...ariaLabelAttributes}\n />\n </div>\n {(labelLeft || labelRight) && (\n <span className={styles.slider__options}>\n <span id={labelLeftId}>{labelLeft}</span>\n <span id={labelRightId}>{labelRight}</span>\n </span>\n )}\n </div>\n );\n};\n\nexport default Slider;\n"],"names":["useSafeNumberValue","initial","min","max","value","setValue","useState","newValue","MAX_VALUE","MIN_VALUE","STEP","LARGE_STEP","Slider","title","ariaLabel","labelLeft","labelRight","disabled","onChange","testId","isMoving","setIsMoving","titleId","useUuid","labelLeftId","labelRightId","trackRef","useRef","markerRef","trackWidth","useSize","markerWidth","useEffect","handlePointerUp","getValueBasedOnMarkerPosition","markerPosition","trackPosition","_a","handlePointerMove","e","handleKeyDown","flag","handleTrackClick","handlePointerDown","markerXPos","ariaLabelAttributes","getAriaLabelAttributes","React","styles","AnalyticsId","Title","classNames","Slider$1"],"mappings":"sfAYA,MAAMA,EAAqB,CAACC,EAAiBC,EAAaC,IAAmD,CAC3G,KAAM,CAACC,EAAOC,CAAQ,EAAIC,EAASL,CAAO,EAYnC,MAAA,CAACG,EAVcG,GAA2B,CAC3CA,EAAWJ,EACbE,EAASF,CAAG,EACHI,EAAWL,EACpBG,EAASH,CAAG,EAEZG,EAASE,CAAQ,CACnB,CAGyB,CAC7B,EAmBMC,EAAY,IACZC,EAAY,EACZC,EAAO,EACPC,EAAa,GAENC,EAAgC,CAAC,CAAE,MAAAC,EAAO,UAAAC,EAAW,UAAAC,EAAW,WAAAC,EAAY,SAAAC,EAAW,GAAO,SAAAC,EAAU,OAAAC,KAAa,CAChI,KAAM,CAACC,EAAUC,CAAW,EAAIf,EAAS,EAAK,EACxC,CAACF,EAAOC,CAAQ,EAAIL,GAAoBQ,EAAYC,GAAa,EAAGA,EAAWD,CAAS,EACxFc,EAAUC,IACVC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AAY+B,EAAO,yBAAyB,CAAC,CAAG,CAAA,EACjGD,EAAA,cAAC,MAAA,CACC,KAAM9B,EAAW,OAAY,SAC7B,IAAKW,EACL,UAAWuB,EAAWH,EAAO,eAAgB/B,GAAY+B,EAAO,0BAA0B,CAAC,EAC3F,MAAO,CACL,KAAM,GAAGJ,KACX,EACA,UAAWJ,EACX,gBAAepC,EACf,gBAAeK,EACf,gBAAeD,EACf,SAAUS,EAAW,OAAY,EACjC,gBAAeA,EACd,GAAG4B,CAAA,CACN,CACF,GACE9B,GAAaC,IACb+B,EAAA,cAAC,QAAK,UAAWC,EAAO,iBACrBD,EAAA,cAAA,OAAA,CAAK,GAAIvB,CAAc,EAAAT,CAAU,EACjCgC,EAAA,cAAA,OAAA,CAAK,GAAItB,CAAe,EAAAT,CAAW,CACtC,CAEJ,CAEJ,EAEAoC,GAAexC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@import '../../scss/spacers
|
|
1
|
+
@import '../../scss/spacers';
|
|
2
2
|
|
|
3
3
|
.spacer {
|
|
4
4
|
display: block;
|
|
@@ -8,39 +8,51 @@
|
|
|
8
8
|
&--4xs {
|
|
9
9
|
height: getSpacer(4xs);
|
|
10
10
|
}
|
|
11
|
+
|
|
11
12
|
&--3xs {
|
|
12
13
|
height: getSpacer(3xs);
|
|
13
14
|
}
|
|
15
|
+
|
|
14
16
|
&--2xs {
|
|
15
17
|
height: getSpacer(2xs);
|
|
16
18
|
}
|
|
19
|
+
|
|
17
20
|
&--xs {
|
|
18
21
|
height: getSpacer(xs);
|
|
19
22
|
}
|
|
23
|
+
|
|
20
24
|
&--s {
|
|
21
25
|
height: getSpacer(s);
|
|
22
26
|
}
|
|
27
|
+
|
|
23
28
|
&--m {
|
|
24
29
|
height: getSpacer(m);
|
|
25
30
|
}
|
|
31
|
+
|
|
26
32
|
&--l {
|
|
27
33
|
height: getSpacer(l);
|
|
28
34
|
}
|
|
35
|
+
|
|
29
36
|
&--xl {
|
|
30
37
|
height: getSpacer(xl);
|
|
31
38
|
}
|
|
39
|
+
|
|
32
40
|
&--2xl {
|
|
33
41
|
height: getSpacer(2xl);
|
|
34
42
|
}
|
|
43
|
+
|
|
35
44
|
&--3xl {
|
|
36
45
|
height: getSpacer(3xl);
|
|
37
46
|
}
|
|
47
|
+
|
|
38
48
|
&--4xl {
|
|
39
49
|
height: getSpacer(4xl);
|
|
40
50
|
}
|
|
51
|
+
|
|
41
52
|
&--5xl {
|
|
42
53
|
height: getSpacer(5xl);
|
|
43
54
|
}
|
|
55
|
+
|
|
44
56
|
&--6xl {
|
|
45
57
|
height: getSpacer(6xl);
|
|
46
58
|
}
|