@helsenorge/designsystem-react 6.0.1 → 6.1.2
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 +26 -0
- package/README.md +2 -1
- package/components/Button/Button.d.ts.map +1 -1
- package/components/Button/Button.js +54 -57
- package/components/Button/Button.js.map +1 -1
- package/components/Dropdown/Dropdown.js +20 -20
- package/components/Dropdown/Dropdown.js.map +1 -1
- package/components/Dropdown/styles.module.scss +5 -2
- package/components/Icons/IconNames.d.ts +1 -0
- package/components/Icons/IconNames.d.ts.map +1 -1
- package/components/Icons/IconNames.js.map +1 -1
- package/components/Illustration/Illustration.d.ts +20 -3
- package/components/Illustration/Illustration.d.ts.map +1 -1
- package/components/Illustration/Illustration.js +38 -0
- package/components/Illustration/Illustration.js.map +1 -0
- package/components/Illustration/index.d.ts +2 -0
- package/components/Illustration/index.d.ts.map +1 -1
- package/components/Illustration/index.js +6 -1
- package/components/Illustration/index.js.map +1 -1
- package/components/Illustration/utils.d.ts +9 -0
- package/components/Illustration/utils.d.ts.map +1 -0
- package/components/Illustration/utils.js +5 -0
- package/components/Illustration/utils.js.map +1 -0
- package/components/Illustrations/Doctor.d.ts +9 -0
- package/components/Illustrations/Doctor.d.ts.map +1 -0
- package/components/Illustrations/Doctor.js +9 -0
- package/components/Illustrations/Doctor.js.map +1 -0
- package/components/Illustrations/DoctorMedium.d.ts +5 -0
- package/components/Illustrations/DoctorMedium.d.ts.map +1 -0
- package/components/Illustrations/DoctorMedium.js +64 -0
- package/components/Illustrations/DoctorMedium.js.map +1 -0
- package/components/Illustrations/DoctorSmall.d.ts +5 -0
- package/components/Illustrations/DoctorSmall.d.ts.map +1 -0
- package/components/Illustrations/DoctorSmall.js +60 -0
- package/components/Illustrations/DoctorSmall.js.map +1 -0
- package/components/Illustrations/HealthcarePersonnel.d.ts +5 -0
- package/components/Illustrations/HealthcarePersonnel.d.ts.map +1 -0
- package/components/Illustrations/HealthcarePersonnel.js +9 -0
- package/components/Illustrations/HealthcarePersonnel.js.map +1 -0
- package/components/Illustrations/HealthcarePersonnelMedium.d.ts +5 -0
- package/components/Illustrations/HealthcarePersonnelMedium.d.ts.map +1 -0
- package/components/Illustrations/HealthcarePersonnelMedium.js +198 -0
- package/components/Illustrations/HealthcarePersonnelMedium.js.map +1 -0
- package/components/Illustrations/HealthcarePersonnelSmall.d.ts +5 -0
- package/components/Illustrations/HealthcarePersonnelSmall.d.ts.map +1 -0
- package/components/Illustrations/HealthcarePersonnelSmall.js +187 -0
- package/components/Illustrations/HealthcarePersonnelSmall.js.map +1 -0
- package/components/Illustrations/IllustrationNames.d.ts +10 -0
- package/components/Illustrations/IllustrationNames.d.ts.map +1 -0
- package/components/Illustrations/IllustrationNames.js +9 -0
- package/components/Illustrations/IllustrationNames.js.map +1 -0
- package/components/Input/Input.js +1 -1
- package/components/Input/Input.js.map +1 -1
- package/components/Input/styles.module.scss +8 -0
- package/components/LazyIcon/LazyIcon.d.ts.map +1 -1
- package/components/LazyIcon/LazyIcon.js +11 -10
- package/components/LazyIcon/LazyIcon.js.map +1 -1
- package/components/LazyIcon/utils.d.ts +2 -0
- package/components/LazyIcon/utils.d.ts.map +1 -0
- package/components/LazyIcon/utils.js +5 -0
- package/components/LazyIcon/utils.js.map +1 -0
- package/components/LazyIllustration/LazyIllustration.d.ts +10 -0
- package/components/LazyIllustration/LazyIllustration.d.ts.map +1 -0
- package/components/LazyIllustration/LazyIllustration.js +35 -0
- package/components/LazyIllustration/LazyIllustration.js.map +1 -0
- package/components/LazyIllustration/index.d.ts +4 -0
- package/components/LazyIllustration/index.d.ts.map +1 -0
- package/components/LazyIllustration/index.js +8 -0
- package/components/LazyIllustration/index.js.map +1 -0
- package/components/PromoPanel/PromoPanel.d.ts +1 -2
- package/components/PromoPanel/PromoPanel.d.ts.map +1 -1
- package/components/PromoPanel/PromoPanel.js +30 -21
- package/components/PromoPanel/PromoPanel.js.map +1 -1
- package/components/PromoPanel/styles.module.scss +0 -11
- package/components/Select/styles.module.scss +4 -3
- package/constants.d.ts +1 -0
- package/constants.d.ts.map +1 -1
- package/constants.js +1 -1
- package/constants.js.map +1 -1
- package/package.json +1 -1
- package/scss/_input.scss +8 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,29 @@
|
|
|
1
|
+
## [6.1.1](https://github.com/helsenorge/designsystem/branchCompare?baseVersion=GTv6.1.0&targetVersion=GTv6.1.1) (2024-02-06)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
- datepicker dependencies tatt tilbake
|
|
6
|
+
([3a7a1e0](https://github.com/helsenorge/designsystem/commit/3a7a1e0b3f44f4c5456941ad5902000a0985da51)), closes
|
|
7
|
+
[#318830](https://github.com/helsenorge/designsystem/issues/318830)
|
|
8
|
+
|
|
9
|
+
## [6.1.0](https://github.com/helsenorge/designsystem/branchCompare?baseVersion=GTv6.0.1&targetVersion=GTv6.1.0) (2024-02-06)
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
- illustration- og lazyillustration-komponenter
|
|
14
|
+
([c2a5662](https://github.com/helsenorge/designsystem/commit/c2a5662bd5c76f55484870d131cef6bc26f1d1b4))
|
|
15
|
+
- promopanel støtter illustrasjoner ([ccb2cb7](https://github.com/helsenorge/designsystem/commit/ccb2cb7c35993adb1be0537906216501a6947ec7))
|
|
16
|
+
|
|
17
|
+
## [6.0.1](https://github.com/helsenorge/designsystem/branchCompare?baseVersion=GTv6.0.0&targetVersion=GTv6.0.1) (2024-02-01)
|
|
18
|
+
|
|
19
|
+
### Bug Fixes
|
|
20
|
+
|
|
21
|
+
- lazyicon blinker ikke ved hover ([b61887c](https://github.com/helsenorge/designsystem/commit/b61887c40f4f59764a349331290709f9af0ba8c4)),
|
|
22
|
+
closes [#318240](https://github.com/helsenorge/designsystem/issues/318240)
|
|
23
|
+
- rydder opp i datepicker dependencies
|
|
24
|
+
([1d871e1](https://github.com/helsenorge/designsystem/commit/1d871e1071e659f2c11754e9719710a8c0a269f7)), closes
|
|
25
|
+
[#309420](https://github.com/helsenorge/designsystem/issues/309420)
|
|
26
|
+
|
|
1
27
|
## [6.0.0](https://github.com/helsenorge/designsystem/branchCompare?baseVersion=GTv5.13.0&targetVersion=GTv6.0.0) (2024-01-26)
|
|
2
28
|
|
|
3
29
|
## 6.0.0-beta.14 (2024-01-24)
|
package/README.md
CHANGED
|
@@ -16,4 +16,5 @@ GitHub.
|
|
|
16
16
|
|
|
17
17
|
## Documentation
|
|
18
18
|
|
|
19
|
-
To view all the available components in isolation, please view our storybook page here:
|
|
19
|
+
To view all the available components in isolation, please view our storybook page here:
|
|
20
|
+
https://frankensteinstorybook.z1.web.core.windows.net/master/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,cAAc,EAAqB,MAAM,OAAO,CAAC;AAKjE,OAAO,EAAE,eAAe,EAAE,eAAe,EAAe,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,cAAc,EAAqB,MAAM,OAAO,CAAC;AAKjE,OAAO,EAAE,eAAe,EAAE,eAAe,EAAe,MAAM,iBAAiB,CAAC;AAWhF,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,aAAa,CAAC;AACrD,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,SAAS,GAAG,YAAY,CAAC;AAC9D,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,OAAO,CAAC;AAC5C,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,QAAQ,CAAC;AAC9C,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,GAAG,CAAC;AAExC,MAAM,WAAW,WAAY,SAAQ,eAAe,EAA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;AAEH,eAAe,MAAM,CAAC"}
|
|
@@ -1,119 +1,116 @@
|
|
|
1
1
|
import o, { useRef as at, useEffect as lt } from "react";
|
|
2
2
|
import m from "classnames";
|
|
3
|
-
import { Icon as
|
|
4
|
-
import { AnalyticsId as
|
|
5
|
-
import { useBreakpoint as
|
|
6
|
-
import { useHover as
|
|
3
|
+
import { Icon as ct } from "../Icon/Icon.js";
|
|
4
|
+
import { AnalyticsId as V, IconSize as y } from "../../constants.js";
|
|
5
|
+
import { useBreakpoint as it } from "../../hooks/useBreakpoint.js";
|
|
6
|
+
import { useHover as W } from "../../hooks/useHover.js";
|
|
7
7
|
import { useIcons as ut } from "../../hooks/useIcons.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
import ft from "../Icons/ArrowRight.js";
|
|
8
|
+
import { getColor as c } from "../../theme/currys/color.js";
|
|
9
|
+
import { breakpoints as mt } from "../../theme/grid.js";
|
|
10
|
+
import { isTest as bt, isProd as pt } from "../../utils/environment.js";
|
|
11
|
+
import dt from "../Icons/ArrowRight.js";
|
|
13
12
|
import t from "./styles.module.scss";
|
|
14
|
-
const
|
|
13
|
+
const ft = (e, r, n, b, s, g) => g && n ? !s || e ? c("neutral", r ? 500 : 700) : c("white") : n ? !s || e ? c("neutral", 500) : `${c("white")}b3` : e && !s || !e && s ? "white" : b === "normal" ? c("blueberry", 600) : c("cherry", 500), k = (e, r) => r && e ? y.Small : e ? y.Medium : y.XSmall, ht = (e, r, n) => {
|
|
15
14
|
if (n && e && (r === void 0 || r === ""))
|
|
16
15
|
throw new Error("Fyll inn ariaLabel prop på Button uten tekst for å opprettholde UU krav");
|
|
17
|
-
},
|
|
16
|
+
}, gt = o.forwardRef(function(r, n) {
|
|
18
17
|
const {
|
|
19
18
|
ariaLabel: b,
|
|
20
19
|
id: s,
|
|
21
20
|
children: g,
|
|
22
|
-
wrapperClassName:
|
|
23
|
-
className:
|
|
21
|
+
wrapperClassName: $,
|
|
22
|
+
className: D,
|
|
24
23
|
arrow: v = !1,
|
|
25
24
|
concept: N = "normal",
|
|
26
25
|
disabled: p = !1,
|
|
27
26
|
ellipsis: B = !1,
|
|
28
|
-
fluid:
|
|
27
|
+
fluid: O = !1,
|
|
29
28
|
htmlMarkup: _ = "button",
|
|
30
|
-
mode:
|
|
29
|
+
mode: X = "onlight",
|
|
31
30
|
onBlur: R,
|
|
32
|
-
onClick:
|
|
33
|
-
size:
|
|
31
|
+
onClick: x,
|
|
32
|
+
size: j = "medium",
|
|
34
33
|
variant: w = "fill",
|
|
35
|
-
href:
|
|
36
|
-
tabIndex:
|
|
37
|
-
testId:
|
|
38
|
-
target:
|
|
39
|
-
type:
|
|
40
|
-
...
|
|
41
|
-
} = r, [d, f, F] = ut(o.Children.toArray(g)), { hoverRef: H, isHovered:
|
|
42
|
-
mt(L);
|
|
43
|
-
const a = !!(d || f) && !F, M = d && (f || v) && !a, I = j === "ondark", h = ct() < bt.md, P = N === "destructive" && !p, Q = w === "outline", c = w === "borderless", Y = ht(w === "fill", c, p, N, I, h), T = v && !c, u = q === "large" && !P && !c, Z = { ...E }, U = m(
|
|
34
|
+
href: q,
|
|
35
|
+
tabIndex: A,
|
|
36
|
+
testId: E,
|
|
37
|
+
target: S,
|
|
38
|
+
type: G = "button",
|
|
39
|
+
...z
|
|
40
|
+
} = r, [d, f, F] = ut(o.Children.toArray(g)), { hoverRef: H, isHovered: J } = _ === "button" ? W(n) : W(n), K = at(null), a = !!(d || f) && !F, L = d && (f || v) && !a, I = X === "ondark", h = it() < mt.md, M = N === "destructive" && !p, Q = w === "outline", i = w === "borderless", Y = ft(w === "fill", i, p, N, I, h), P = v && !i, u = j === "large" && !M && !i, Z = { ...z }, T = m(
|
|
44
41
|
t["button-wrapper"],
|
|
45
|
-
{ [t["button-wrapper--fluid"]]:
|
|
46
|
-
|
|
42
|
+
{ [t["button-wrapper--fluid"]]: O || B },
|
|
43
|
+
$
|
|
47
44
|
), tt = m(
|
|
48
45
|
t.button,
|
|
49
46
|
{
|
|
50
|
-
[t["button--destructive"]]:
|
|
47
|
+
[t["button--destructive"]]: M,
|
|
51
48
|
[t["button--normal"]]: !u,
|
|
52
49
|
[t["button--large"]]: u,
|
|
53
50
|
[t["button--outline"]]: Q,
|
|
54
|
-
[t["button--borderless"]]:
|
|
51
|
+
[t["button--borderless"]]: i,
|
|
55
52
|
[t["button--left-icon"]]: d && !a,
|
|
56
53
|
[t["button--right-icon"]]: f && !a,
|
|
57
|
-
[t["button--both-icons"]]:
|
|
54
|
+
[t["button--both-icons"]]: L,
|
|
58
55
|
[t["button--only-icon"]]: a,
|
|
59
|
-
[t["button--arrow"]]:
|
|
56
|
+
[t["button--arrow"]]: P,
|
|
60
57
|
[t["button--on-dark"]]: I
|
|
61
58
|
},
|
|
62
|
-
|
|
59
|
+
D
|
|
63
60
|
), ot = m(t.button__text, {
|
|
64
61
|
[t["button__text--ellipsis"]]: B
|
|
65
62
|
}), et = m(t.diagonal, {
|
|
66
63
|
[t["diagonal--on-dark"]]: I
|
|
67
64
|
});
|
|
68
65
|
lt(() => {
|
|
69
|
-
|
|
66
|
+
ht(a, b, !bt() && !pt());
|
|
70
67
|
}, []);
|
|
71
68
|
const C = (l, nt, st) => l ? o.cloneElement(l, {
|
|
72
69
|
size: nt,
|
|
73
70
|
color: l != null && l.props.color ? l.props.color : Y,
|
|
74
|
-
isHovered:
|
|
71
|
+
isHovered: J,
|
|
75
72
|
className: st
|
|
76
|
-
}) : null, rt = () => /* @__PURE__ */ o.createElement("span", { className: ot, ref:
|
|
77
|
-
/* @__PURE__ */ o.createElement(
|
|
73
|
+
}) : null, rt = () => /* @__PURE__ */ o.createElement("span", { className: ot, ref: K }, p && i && /* @__PURE__ */ o.createElement("span", { className: et }, /* @__PURE__ */ o.createElement("span", { className: t.diagonal__line })), /* @__PURE__ */ o.createElement("span", null, a ? b : F)), U = () => /* @__PURE__ */ o.createElement("span", { className: tt }, C(d, k(u, h), a ? void 0 : t["button__left-icon"]), rt(), P ? C(
|
|
74
|
+
/* @__PURE__ */ o.createElement(ct, { svgIcon: dt }),
|
|
78
75
|
k(u, h),
|
|
79
|
-
m(t.button__arrow, { [t["button__arrow--both-icons"]]:
|
|
76
|
+
m(t.button__arrow, { [t["button__arrow--both-icons"]]: L })
|
|
80
77
|
) : C(f, k(u, h), t["button__right-icon"]));
|
|
81
78
|
return /* @__PURE__ */ o.createElement(o.Fragment, null, _ === "button" && /* @__PURE__ */ o.createElement(
|
|
82
79
|
"button",
|
|
83
80
|
{
|
|
84
81
|
id: s,
|
|
85
82
|
onBlur: R,
|
|
86
|
-
onClick:
|
|
83
|
+
onClick: x,
|
|
87
84
|
disabled: p,
|
|
88
|
-
"data-testid":
|
|
89
|
-
"data-analyticsid":
|
|
90
|
-
className:
|
|
85
|
+
"data-testid": E,
|
|
86
|
+
"data-analyticsid": V.Button,
|
|
87
|
+
className: T,
|
|
91
88
|
ref: H,
|
|
92
|
-
tabIndex:
|
|
93
|
-
type:
|
|
89
|
+
tabIndex: A,
|
|
90
|
+
type: G,
|
|
94
91
|
...Z
|
|
95
92
|
},
|
|
96
|
-
|
|
93
|
+
U()
|
|
97
94
|
), _ === "a" && /* @__PURE__ */ o.createElement(
|
|
98
95
|
"a",
|
|
99
96
|
{
|
|
100
97
|
id: s,
|
|
101
98
|
onBlur: R,
|
|
102
|
-
onClick:
|
|
103
|
-
"data-testid":
|
|
104
|
-
"data-analyticsid":
|
|
105
|
-
className:
|
|
106
|
-
href:
|
|
107
|
-
target:
|
|
108
|
-
rel:
|
|
99
|
+
onClick: x,
|
|
100
|
+
"data-testid": E,
|
|
101
|
+
"data-analyticsid": V.Button,
|
|
102
|
+
className: T,
|
|
103
|
+
href: q,
|
|
104
|
+
target: S,
|
|
105
|
+
rel: S === "_blank" ? "noopener noreferrer" : r.rel,
|
|
109
106
|
ref: H,
|
|
110
|
-
tabIndex:
|
|
111
|
-
...
|
|
107
|
+
tabIndex: A,
|
|
108
|
+
...z
|
|
112
109
|
},
|
|
113
|
-
|
|
110
|
+
U()
|
|
114
111
|
));
|
|
115
|
-
}),
|
|
112
|
+
}), St = gt;
|
|
116
113
|
export {
|
|
117
|
-
|
|
114
|
+
St as default
|
|
118
115
|
};
|
|
119
116
|
//# sourceMappingURL=Button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sources":["../../../src/components/Button/Button.tsx"],"sourcesContent":["import React, { AriaAttributes, useEffect, useRef } from 'react';\n\nimport classNames from 'classnames';\n\nimport Icon, { IconSize } from './../Icon';\nimport { HTMLButtonProps, HTMLAnchorProps, AnalyticsId } from '../../constants';\nimport { useBreakpoint } from '../../hooks/useBreakpoint';\nimport { useHover } from '../../hooks/useHover';\nimport { BaseIconElement, useIcons } from '../../hooks/useIcons';\nimport { useSize } from '../../hooks/useSize';\nimport { getColor } from '../../theme/currys/color';\nimport { breakpoints } from '../../theme/grid';\nimport { isTest, isProd } from '../../utils/environment';\nimport ArrowRight from '../Icons/ArrowRight';\n\nimport buttonStyles from './styles.module.scss';\n\nexport type ButtonConcept = 'normal' | 'destructive';\nexport type ButtonVariant = 'fill' | 'outline' | 'borderless';\nexport type ButtonSize = 'medium' | 'large';\nexport type ButtonMode = 'onlight' | 'ondark';\nexport type ButtonTags = 'button' | 'a';\n\nexport interface ButtonProps extends HTMLButtonProps, HTMLAnchorProps, AriaAttributes {\n /** Sets the aria-label of the button, use when the button only includes an icon */\n ariaLabel?: string;\n /** Gives a unique id to the button */\n id?: string;\n /** Sets the content of the button. */\n children: React.ReactNode;\n /** Adds custom classes to the wrapper element. */\n wrapperClassName?: string;\n /** Adds custom classes to the element. */\n className?: string;\n /** Enables an arrow icon to the right inside the button (Not available in borderless variant) */\n arrow?: boolean;\n /** Changes the intent of the button. Mostly changes the color profile. */\n concept?: ButtonConcept;\n /** Disables text wrapping and enables ellipsis. */\n ellipsis?: boolean;\n /** Makes the button scale to full width of its parent element. */\n fluid?: boolean;\n /** Changes the underlying element of the button. */\n htmlMarkup?: ButtonTags;\n /** Changes the button colors for different backgrounds. */\n mode?: ButtonMode;\n /** Function that is called when the Button loses focus */\n onBlur?: () => void;\n /** Function that is called when clicked */\n onClick?: (e?: React.MouseEvent<HTMLElement, MouseEvent> | React.FormEvent<{}> | React.KeyboardEvent<HTMLUListElement> | null) => void;\n /** Changes the button colors for different backgrounds. (Large not available in borderless variant) */\n size?: ButtonSize;\n /** Changes the visual representation of the button. */\n variant?: ButtonVariant;\n /** Specifies the focus order relative to the other buttons or controls on the page */\n tabIndex?: number;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Button type. Default: button */\n type?: React.ButtonHTMLAttributes<HTMLButtonElement>['type'];\n}\n\nconst getIconColor = (\n fill: boolean,\n borderless: boolean,\n disabled: boolean,\n concept: ButtonConcept,\n ondark: boolean,\n mobile: boolean\n): string => {\n if (mobile && disabled) {\n return !ondark || fill ? getColor('neutral', !borderless ? 700 : 500) : getColor('white');\n }\n if (disabled) {\n return !ondark || fill ? getColor('neutral', 500) : `${getColor('white')}b3`;\n }\n if ((fill && !ondark) || (!fill && ondark)) {\n return 'white';\n }\n\n return concept === 'normal' ? getColor('blueberry', 600) : getColor('cherry', 500);\n};\nconst getLargeIconSize = (large: boolean, mobile: boolean): IconSize => {\n if (mobile && large) return IconSize.Small;\n if (large) return IconSize.Medium;\n return IconSize.XSmall;\n};\n\nconst checkOnlyIconAria = (onlyIcon: boolean, ariaLabel: string | undefined, devEnv: boolean) => {\n if (devEnv && onlyIcon && (ariaLabel === undefined || ariaLabel === '')) {\n throw new Error('Fyll inn ariaLabel prop på Button uten tekst for å opprettholde UU krav');\n }\n};\n\nconst Button = React.forwardRef(function ButtonForwardedRef(\n props: ButtonProps,\n ref: React.ForwardedRef<HTMLButtonElement | HTMLAnchorElement>\n) {\n const {\n ariaLabel,\n id,\n children,\n wrapperClassName,\n className,\n arrow = false,\n concept = 'normal',\n disabled = false,\n ellipsis = false,\n fluid = false,\n htmlMarkup = 'button',\n mode = 'onlight',\n onBlur,\n onClick,\n size = 'medium',\n variant = 'fill',\n href,\n tabIndex,\n testId,\n target,\n type = 'button',\n ...restProps\n } = props;\n\n const [leftIcon, rightIcon, restChildren] = useIcons(React.Children.toArray(children));\n const { hoverRef, isHovered } =\n htmlMarkup === 'button'\n ? useHover<HTMLButtonElement>(ref as React.RefObject<HTMLButtonElement>)\n : useHover<HTMLAnchorElement>(ref as React.RefObject<HTMLAnchorElement>);\n const buttonContentRef = useRef<HTMLDivElement>(null);\n const buttonContentSize = useSize(buttonContentRef);\n const onlyIcon = !!(leftIcon || rightIcon) && !restChildren;\n const bothIcons = leftIcon && (rightIcon || arrow) && !onlyIcon;\n const onDark = mode === 'ondark';\n const breakpoint = useBreakpoint();\n const mobile = breakpoint < breakpoints.md;\n const destructive = concept === 'destructive' && !disabled;\n const outlineVariant = variant === 'outline';\n const borderlessVariant = variant === 'borderless';\n const iconColor = getIconColor(variant === 'fill', borderlessVariant, disabled, concept, onDark, mobile);\n const hasArrow = arrow && !borderlessVariant;\n const large = size === 'large' && !destructive && !borderlessVariant;\n const rest = { ...restProps };\n\n const buttonWrapperClasses = classNames(\n buttonStyles['button-wrapper'],\n { [buttonStyles['button-wrapper--fluid']]: fluid || ellipsis },\n wrapperClassName\n );\n const buttonClasses = classNames(\n buttonStyles.button,\n {\n [buttonStyles['button--destructive']]: destructive,\n [buttonStyles['button--normal']]: !large,\n [buttonStyles['button--large']]: large,\n [buttonStyles['button--outline']]: outlineVariant,\n [buttonStyles['button--borderless']]: borderlessVariant,\n [buttonStyles['button--left-icon']]: leftIcon && !onlyIcon,\n [buttonStyles['button--right-icon']]: rightIcon && !onlyIcon,\n [buttonStyles['button--both-icons']]: bothIcons,\n [buttonStyles['button--only-icon']]: onlyIcon,\n [buttonStyles['button--arrow']]: hasArrow,\n [buttonStyles['button--on-dark']]: onDark,\n },\n className\n );\n const buttonTextClasses = classNames(buttonStyles['button__text'], {\n [buttonStyles['button__text--ellipsis']]: ellipsis,\n });\n const diagonalClasses = classNames(buttonStyles['diagonal'], {\n [buttonStyles['diagonal--on-dark']]: onDark,\n });\n\n useEffect(() => {\n checkOnlyIconAria(onlyIcon, ariaLabel, !isTest() && !isProd());\n }, []);\n\n const renderIcon = (iconElement: BaseIconElement | null, iconSize: number, iconClassName?: string): BaseIconElement | null => {\n return iconElement\n ? React.cloneElement(iconElement, {\n size: iconSize,\n color: iconElement?.props.color ? iconElement.props.color : iconColor,\n isHovered,\n className: iconClassName,\n })\n : null;\n };\n\n const renderButtonContent = (): JSX.Element => {\n return (\n <span className={buttonTextClasses} ref={buttonContentRef}>\n {disabled && borderlessVariant && (\n <span className={diagonalClasses}>\n <span className={buttonStyles['diagonal__line']} />\n </span>\n )}\n <span>{onlyIcon ? ariaLabel : restChildren}</span>\n </span>\n );\n };\n\n const renderbuttonContentWrapper = (): JSX.Element => (\n <span className={buttonClasses}>\n {renderIcon(leftIcon, getLargeIconSize(large, mobile), !onlyIcon ? buttonStyles['button__left-icon'] : undefined)}\n {renderButtonContent()}\n {hasArrow\n ? renderIcon(\n <Icon svgIcon={ArrowRight} />,\n getLargeIconSize(large, mobile),\n classNames(buttonStyles['button__arrow'], { [buttonStyles['button__arrow--both-icons']]: bothIcons })\n )\n : renderIcon(rightIcon, getLargeIconSize(large, mobile), buttonStyles['button__right-icon'])}\n </span>\n );\n\n return (\n <>\n {htmlMarkup === 'button' && (\n <button\n id={id}\n onBlur={onBlur}\n onClick={onClick}\n disabled={disabled}\n data-testid={testId}\n data-analyticsid={AnalyticsId.Button}\n className={buttonWrapperClasses}\n ref={hoverRef as React.ForwardedRef<HTMLButtonElement>}\n tabIndex={tabIndex}\n type={type}\n {...rest}\n >\n {renderbuttonContentWrapper()}\n </button>\n )}\n {htmlMarkup === 'a' && (\n <a\n id={id}\n onBlur={onBlur}\n onClick={onClick}\n data-testid={testId}\n data-analyticsid={AnalyticsId.Button}\n className={buttonWrapperClasses}\n href={href}\n target={target}\n rel={target === '_blank' ? 'noopener noreferrer' : props.rel}\n ref={hoverRef as React.ForwardedRef<HTMLAnchorElement>}\n tabIndex={tabIndex}\n {...restProps}\n >\n {renderbuttonContentWrapper()}\n </a>\n )}\n </>\n );\n});\n\nexport default Button;\n"],"names":["getIconColor","fill","borderless","disabled","concept","ondark","mobile","getColor","getLargeIconSize","large","IconSize","checkOnlyIconAria","onlyIcon","ariaLabel","devEnv","Button","React","props","ref","id","children","wrapperClassName","className","arrow","ellipsis","fluid","htmlMarkup","mode","onBlur","onClick","size","variant","href","tabIndex","testId","target","type","restProps","leftIcon","rightIcon","restChildren","useIcons","hoverRef","isHovered","useHover","buttonContentRef","useRef","useSize","bothIcons","onDark","useBreakpoint","breakpoints","destructive","outlineVariant","borderlessVariant","iconColor","hasArrow","rest","buttonWrapperClasses","classNames","buttonStyles","buttonClasses","buttonTextClasses","diagonalClasses","useEffect","isTest","isProd","renderIcon","iconElement","iconSize","iconClassName","renderButtonContent","renderbuttonContentWrapper","Icon","ArrowRight","AnalyticsId","Button$1"],"mappings":";;;;;;;;;;;;;AA8DA,MAAMA,KAAe,CACnBC,GACAC,GACAC,GACAC,GACAC,GACAC,MAEIA,KAAUH,IACL,CAACE,KAAUJ,IAAOM,EAAS,WAAYL,IAAmB,MAAN,GAAS,IAAIK,EAAS,OAAO,IAEtFJ,IACK,CAACE,KAAUJ,IAAOM,EAAS,WAAW,GAAG,IAAI,GAAGA,EAAS,OAAO,CAAC,OAErEN,KAAQ,CAACI,KAAY,CAACJ,KAAQI,IAC1B,UAGFD,MAAY,WAAWG,EAAS,aAAa,GAAG,IAAIA,EAAS,UAAU,GAAG,GAE7EC,IAAmB,CAACC,GAAgBH,MACpCA,KAAUG,IAAcC,EAAS,QACjCD,IAAcC,EAAS,SACpBA,EAAS,QAGZC,KAAoB,CAACC,GAAmBC,GAA+BC,MAAoB;AAC/F,MAAIA,KAAUF,MAAaC,MAAc,UAAaA,MAAc;AAC5D,UAAA,IAAI,MAAM,yEAAyE;AAE7F,GAEME,KAASC,EAAM,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A,MACA,SAAAC;AAAA,MACA,eAAaK;AAAA,MACb,oBAAkByC,EAAY;AAAA,MAC9B,WAAWjB;AAAA,MACX,MAAA1B;AAAA,MACA,QAAAG;AAAA,MACA,KAAKA,MAAW,WAAW,wBAAwBlB,EAAM;AAAA,MACzD,KAAKyB;AAAA,MACL,UAAAT;AAAA,MACC,GAAGI;AAAA,IAAA;AAAA,IAEHmC,EAA2B;AAAA,EAAA,CAGlC;AAEJ,CAAC,GAEDI,KAAe7D;"}
|
|
1
|
+
{"version":3,"file":"Button.js","sources":["../../../src/components/Button/Button.tsx"],"sourcesContent":["import React, { AriaAttributes, useEffect, useRef } from 'react';\n\nimport classNames from 'classnames';\n\nimport Icon, { IconSize } from './../Icon';\nimport { HTMLButtonProps, HTMLAnchorProps, AnalyticsId } from '../../constants';\nimport { useBreakpoint } from '../../hooks/useBreakpoint';\nimport { useHover } from '../../hooks/useHover';\nimport { BaseIconElement, useIcons } from '../../hooks/useIcons';\nimport { getColor } from '../../theme/currys/color';\nimport { breakpoints } from '../../theme/grid';\nimport { isTest, isProd } from '../../utils/environment';\nimport ArrowRight from '../Icons/ArrowRight';\n\nimport buttonStyles from './styles.module.scss';\n\nexport type ButtonConcept = 'normal' | 'destructive';\nexport type ButtonVariant = 'fill' | 'outline' | 'borderless';\nexport type ButtonSize = 'medium' | 'large';\nexport type ButtonMode = 'onlight' | 'ondark';\nexport type ButtonTags = 'button' | 'a';\n\nexport interface ButtonProps extends HTMLButtonProps, HTMLAnchorProps, AriaAttributes {\n /** Sets the aria-label of the button, use when the button only includes an icon */\n ariaLabel?: string;\n /** Gives a unique id to the button */\n id?: string;\n /** Sets the content of the button. */\n children: React.ReactNode;\n /** Adds custom classes to the wrapper element. */\n wrapperClassName?: string;\n /** Adds custom classes to the element. */\n className?: string;\n /** Enables an arrow icon to the right inside the button (Not available in borderless variant) */\n arrow?: boolean;\n /** Changes the intent of the button. Mostly changes the color profile. */\n concept?: ButtonConcept;\n /** Disables text wrapping and enables ellipsis. */\n ellipsis?: boolean;\n /** Makes the button scale to full width of its parent element. */\n fluid?: boolean;\n /** Changes the underlying element of the button. */\n htmlMarkup?: ButtonTags;\n /** Changes the button colors for different backgrounds. */\n mode?: ButtonMode;\n /** Function that is called when the Button loses focus */\n onBlur?: () => void;\n /** Function that is called when clicked */\n onClick?: (e?: React.MouseEvent<HTMLElement, MouseEvent> | React.FormEvent<{}> | React.KeyboardEvent<HTMLUListElement> | null) => void;\n /** Changes the button colors for different backgrounds. (Large not available in borderless variant) */\n size?: ButtonSize;\n /** Changes the visual representation of the button. */\n variant?: ButtonVariant;\n /** Specifies the focus order relative to the other buttons or controls on the page */\n tabIndex?: number;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Button type. Default: button */\n type?: React.ButtonHTMLAttributes<HTMLButtonElement>['type'];\n}\n\nconst getIconColor = (\n fill: boolean,\n borderless: boolean,\n disabled: boolean,\n concept: ButtonConcept,\n ondark: boolean,\n mobile: boolean\n): string => {\n if (mobile && disabled) {\n return !ondark || fill ? getColor('neutral', !borderless ? 700 : 500) : getColor('white');\n }\n if (disabled) {\n return !ondark || fill ? getColor('neutral', 500) : `${getColor('white')}b3`;\n }\n if ((fill && !ondark) || (!fill && ondark)) {\n return 'white';\n }\n\n return concept === 'normal' ? getColor('blueberry', 600) : getColor('cherry', 500);\n};\nconst getLargeIconSize = (large: boolean, mobile: boolean): IconSize => {\n if (mobile && large) return IconSize.Small;\n if (large) return IconSize.Medium;\n return IconSize.XSmall;\n};\n\nconst checkOnlyIconAria = (onlyIcon: boolean, ariaLabel: string | undefined, devEnv: boolean) => {\n if (devEnv && onlyIcon && (ariaLabel === undefined || ariaLabel === '')) {\n throw new Error('Fyll inn ariaLabel prop på Button uten tekst for å opprettholde UU krav');\n }\n};\n\nconst Button = React.forwardRef(function ButtonForwardedRef(\n props: ButtonProps,\n ref: React.ForwardedRef<HTMLButtonElement | HTMLAnchorElement>\n) {\n const {\n ariaLabel,\n id,\n children,\n wrapperClassName,\n className,\n arrow = false,\n concept = 'normal',\n disabled = false,\n ellipsis = false,\n fluid = false,\n htmlMarkup = 'button',\n mode = 'onlight',\n onBlur,\n onClick,\n size = 'medium',\n variant = 'fill',\n href,\n tabIndex,\n testId,\n target,\n type = 'button',\n ...restProps\n } = props;\n\n const [leftIcon, rightIcon, restChildren] = useIcons(React.Children.toArray(children));\n const { hoverRef, isHovered } =\n htmlMarkup === 'button'\n ? useHover<HTMLButtonElement>(ref as React.RefObject<HTMLButtonElement>)\n : useHover<HTMLAnchorElement>(ref as React.RefObject<HTMLAnchorElement>);\n const buttonContentRef = useRef<HTMLDivElement>(null);\n const onlyIcon = !!(leftIcon || rightIcon) && !restChildren;\n const bothIcons = leftIcon && (rightIcon || arrow) && !onlyIcon;\n const onDark = mode === 'ondark';\n const breakpoint = useBreakpoint();\n const mobile = breakpoint < breakpoints.md;\n const destructive = concept === 'destructive' && !disabled;\n const outlineVariant = variant === 'outline';\n const borderlessVariant = variant === 'borderless';\n const iconColor = getIconColor(variant === 'fill', borderlessVariant, disabled, concept, onDark, mobile);\n const hasArrow = arrow && !borderlessVariant;\n const large = size === 'large' && !destructive && !borderlessVariant;\n const rest = { ...restProps };\n\n const buttonWrapperClasses = classNames(\n buttonStyles['button-wrapper'],\n { [buttonStyles['button-wrapper--fluid']]: fluid || ellipsis },\n wrapperClassName\n );\n const buttonClasses = classNames(\n buttonStyles.button,\n {\n [buttonStyles['button--destructive']]: destructive,\n [buttonStyles['button--normal']]: !large,\n [buttonStyles['button--large']]: large,\n [buttonStyles['button--outline']]: outlineVariant,\n [buttonStyles['button--borderless']]: borderlessVariant,\n [buttonStyles['button--left-icon']]: leftIcon && !onlyIcon,\n [buttonStyles['button--right-icon']]: rightIcon && !onlyIcon,\n [buttonStyles['button--both-icons']]: bothIcons,\n [buttonStyles['button--only-icon']]: onlyIcon,\n [buttonStyles['button--arrow']]: hasArrow,\n [buttonStyles['button--on-dark']]: onDark,\n },\n className\n );\n const buttonTextClasses = classNames(buttonStyles['button__text'], {\n [buttonStyles['button__text--ellipsis']]: ellipsis,\n });\n const diagonalClasses = classNames(buttonStyles['diagonal'], {\n [buttonStyles['diagonal--on-dark']]: onDark,\n });\n\n useEffect(() => {\n checkOnlyIconAria(onlyIcon, ariaLabel, !isTest() && !isProd());\n }, []);\n\n const renderIcon = (iconElement: BaseIconElement | null, iconSize: number, iconClassName?: string): BaseIconElement | null => {\n return iconElement\n ? React.cloneElement(iconElement, {\n size: iconSize,\n color: iconElement?.props.color ? iconElement.props.color : iconColor,\n isHovered,\n className: iconClassName,\n })\n : null;\n };\n\n const renderButtonContent = (): JSX.Element => {\n return (\n <span className={buttonTextClasses} ref={buttonContentRef}>\n {disabled && borderlessVariant && (\n <span className={diagonalClasses}>\n <span className={buttonStyles['diagonal__line']} />\n </span>\n )}\n <span>{onlyIcon ? ariaLabel : restChildren}</span>\n </span>\n );\n };\n\n const renderbuttonContentWrapper = (): JSX.Element => (\n <span className={buttonClasses}>\n {renderIcon(leftIcon, getLargeIconSize(large, mobile), !onlyIcon ? buttonStyles['button__left-icon'] : undefined)}\n {renderButtonContent()}\n {hasArrow\n ? renderIcon(\n <Icon svgIcon={ArrowRight} />,\n getLargeIconSize(large, mobile),\n classNames(buttonStyles['button__arrow'], { [buttonStyles['button__arrow--both-icons']]: bothIcons })\n )\n : renderIcon(rightIcon, getLargeIconSize(large, mobile), buttonStyles['button__right-icon'])}\n </span>\n );\n\n return (\n <>\n {htmlMarkup === 'button' && (\n <button\n id={id}\n onBlur={onBlur}\n onClick={onClick}\n disabled={disabled}\n data-testid={testId}\n data-analyticsid={AnalyticsId.Button}\n className={buttonWrapperClasses}\n ref={hoverRef as React.ForwardedRef<HTMLButtonElement>}\n tabIndex={tabIndex}\n type={type}\n {...rest}\n >\n {renderbuttonContentWrapper()}\n </button>\n )}\n {htmlMarkup === 'a' && (\n <a\n id={id}\n onBlur={onBlur}\n onClick={onClick}\n data-testid={testId}\n data-analyticsid={AnalyticsId.Button}\n className={buttonWrapperClasses}\n href={href}\n target={target}\n rel={target === '_blank' ? 'noopener noreferrer' : props.rel}\n ref={hoverRef as React.ForwardedRef<HTMLAnchorElement>}\n tabIndex={tabIndex}\n {...restProps}\n >\n {renderbuttonContentWrapper()}\n </a>\n )}\n </>\n );\n});\n\nexport default Button;\n"],"names":["getIconColor","fill","borderless","disabled","concept","ondark","mobile","getColor","getLargeIconSize","large","IconSize","checkOnlyIconAria","onlyIcon","ariaLabel","devEnv","Button","React","props","ref","id","children","wrapperClassName","className","arrow","ellipsis","fluid","htmlMarkup","mode","onBlur","onClick","size","variant","href","tabIndex","testId","target","type","restProps","leftIcon","rightIcon","restChildren","useIcons","hoverRef","isHovered","useHover","buttonContentRef","useRef","bothIcons","onDark","useBreakpoint","breakpoints","destructive","outlineVariant","borderlessVariant","iconColor","hasArrow","rest","buttonWrapperClasses","classNames","buttonStyles","buttonClasses","buttonTextClasses","diagonalClasses","useEffect","isTest","isProd","renderIcon","iconElement","iconSize","iconClassName","renderButtonContent","renderbuttonContentWrapper","Icon","ArrowRight","AnalyticsId","Button$1"],"mappings":";;;;;;;;;;;;AA6DA,MAAMA,KAAe,CACnBC,GACAC,GACAC,GACAC,GACAC,GACAC,MAEIA,KAAUH,IACL,CAACE,KAAUJ,IAAOM,EAAS,WAAYL,IAAmB,MAAN,GAAS,IAAIK,EAAS,OAAO,IAEtFJ,IACK,CAACE,KAAUJ,IAAOM,EAAS,WAAW,GAAG,IAAI,GAAGA,EAAS,OAAO,CAAC,OAErEN,KAAQ,CAACI,KAAY,CAACJ,KAAQI,IAC1B,UAGFD,MAAY,WAAWG,EAAS,aAAa,GAAG,IAAIA,EAAS,UAAU,GAAG,GAE7EC,IAAmB,CAACC,GAAgBH,MACpCA,KAAUG,IAAcC,EAAS,QACjCD,IAAcC,EAAS,SACpBA,EAAS,QAGZC,KAAoB,CAACC,GAAmBC,GAA+BC,MAAoB;AAC/F,MAAIA,KAAUF,MAAaC,MAAc,UAAaA,MAAc;AAC5D,UAAA,IAAI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AS;AAAA,MACA,SAAAC;AAAA,MACA,eAAaK;AAAA,MACb,oBAAkBwC,EAAY;AAAA,MAC9B,WAAWjB;AAAA,MACX,MAAAzB;AAAA,MACA,QAAAG;AAAA,MACA,KAAKA,MAAW,WAAW,wBAAwBlB,EAAM;AAAA,MACzD,KAAKyB;AAAA,MACL,UAAAT;AAAA,MACC,GAAGI;AAAA,IAAA;AAAA,IAEHkC,EAA2B;AAAA,EAAA,CAGlC;AAEJ,CAAC,GAEDI,KAAe5D;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import t, { useRef as g, useState as V } from "react";
|
|
2
|
-
import
|
|
2
|
+
import k from "classnames";
|
|
3
3
|
import { theme as C } from "../../theme/index.js";
|
|
4
4
|
import "../../hooks/useBreakpoint.js";
|
|
5
5
|
import { useHover as W } from "../../hooks/useHover.js";
|
|
@@ -19,16 +19,16 @@ const ee = (s) => {
|
|
|
19
19
|
label: R,
|
|
20
20
|
placeholder: $,
|
|
21
21
|
closeText: A = "Lukk",
|
|
22
|
-
noCloseButton:
|
|
23
|
-
onToggle:
|
|
24
|
-
open:
|
|
22
|
+
noCloseButton: H = !1,
|
|
23
|
+
onToggle: K,
|
|
24
|
+
open: S = !1,
|
|
25
25
|
children: y,
|
|
26
|
-
mode:
|
|
26
|
+
mode: c = "onwhite",
|
|
27
27
|
transparent: O = !1,
|
|
28
28
|
fluid: b = !1,
|
|
29
29
|
testId: z,
|
|
30
|
-
disabled:
|
|
31
|
-
} = s, p = g(null), w = g(null), { hoverRef: u, isHovered: D } = W(), { value: a, toggleValue: h } = j(!
|
|
30
|
+
disabled: i
|
|
31
|
+
} = s, p = g(null), w = g(null), { hoverRef: u, isHovered: D } = W(), { value: a, toggleValue: h } = j(!i && S, K), d = g(t.Children.map(y, () => t.createRef())), [m, L] = V(), { width: T } = X(u) || {}, E = _(), I = _(), x = _(), N = () => {
|
|
32
32
|
var o;
|
|
33
33
|
h(), (o = w.current) == null || o.focus();
|
|
34
34
|
}, f = () => {
|
|
@@ -36,7 +36,7 @@ const ee = (s) => {
|
|
|
36
36
|
h(), (o = u.current) == null || o.focus();
|
|
37
37
|
};
|
|
38
38
|
q(p, (o) => {
|
|
39
|
-
var
|
|
39
|
+
var v;
|
|
40
40
|
if (o.preventDefault(), !d.current)
|
|
41
41
|
return;
|
|
42
42
|
if (a) {
|
|
@@ -50,7 +50,7 @@ const ee = (s) => {
|
|
|
50
50
|
}
|
|
51
51
|
const n = d.current.findIndex((P) => P.current === o.target);
|
|
52
52
|
let l = n;
|
|
53
|
-
o.key === r.Home ? l = 0 : o.key === r.End ? l = d.current.length - 1 : o.key === r.ArrowDown && n < d.current.length - 1 ? l = n + 1 : o.key === r.ArrowUp && n > 0 ? l = n - 1 : o.key === r.Enter && n !== -1 && (l = n), l !== -1 && ((
|
|
53
|
+
o.key === r.Home ? l = 0 : o.key === r.End ? l = d.current.length - 1 : o.key === r.ArrowDown && n < d.current.length - 1 ? l = n + 1 : o.key === r.ArrowUp && n > 0 ? l = n - 1 : o.key === r.Enter && n !== -1 && (l = n), l !== -1 && ((v = d.current[l].current) == null || v.focus(), L(l));
|
|
54
54
|
}, [
|
|
55
55
|
r.ArrowDown,
|
|
56
56
|
r.ArrowUp,
|
|
@@ -59,18 +59,18 @@ const ee = (s) => {
|
|
|
59
59
|
r.Escape,
|
|
60
60
|
r.Home
|
|
61
61
|
]), F(p, () => a && f());
|
|
62
|
-
const U =
|
|
62
|
+
const U = k(
|
|
63
63
|
e.dropdown__toggle,
|
|
64
|
-
!
|
|
65
|
-
[e["dropdown__toggle--on-white"]]:
|
|
66
|
-
[e["dropdown__toggle--on-grey"]]:
|
|
67
|
-
[e["dropdown__toggle--on-blueberry"]]:
|
|
68
|
-
[e["dropdown__toggle--on-cherry"]]:
|
|
64
|
+
!i && {
|
|
65
|
+
[e["dropdown__toggle--on-white"]]: c === "onwhite",
|
|
66
|
+
[e["dropdown__toggle--on-grey"]]: c === "ongrey",
|
|
67
|
+
[e["dropdown__toggle--on-blueberry"]]: c === "onblueberry",
|
|
68
|
+
[e["dropdown__toggle--on-cherry"]]: c === "oncherry",
|
|
69
69
|
[e["dropdown__toggle--transparent"]]: O,
|
|
70
70
|
[e["dropdown__toggle--fluid"]]: b,
|
|
71
71
|
[e["dropdown__toggle--open"]]: a
|
|
72
72
|
}
|
|
73
|
-
), B =
|
|
73
|
+
), B = k(e.dropdown__content, a && e["dropdown__content--open"]);
|
|
74
74
|
return /* @__PURE__ */ t.createElement("div", { className: e.dropdown, ref: p }, /* @__PURE__ */ t.createElement("span", { id: E, className: e.dropdown__label }, R), /* @__PURE__ */ t.createElement(
|
|
75
75
|
"button",
|
|
76
76
|
{
|
|
@@ -80,7 +80,7 @@ const ee = (s) => {
|
|
|
80
80
|
ref: u,
|
|
81
81
|
"data-testid": z,
|
|
82
82
|
"data-analyticsid": G.Dropdown,
|
|
83
|
-
disabled:
|
|
83
|
+
disabled: i,
|
|
84
84
|
"aria-labelledby": I,
|
|
85
85
|
"aria-haspopup": "listbox",
|
|
86
86
|
"aria-expanded": a
|
|
@@ -89,10 +89,10 @@ const ee = (s) => {
|
|
|
89
89
|
/* @__PURE__ */ t.createElement(
|
|
90
90
|
Y,
|
|
91
91
|
{
|
|
92
|
-
color:
|
|
92
|
+
color: i ? C.palette.neutral700 : C.palette.blueberry600,
|
|
93
93
|
svgIcon: Z,
|
|
94
94
|
className: e.dropdown__icon,
|
|
95
|
-
isHovered: D,
|
|
95
|
+
isHovered: !i && D,
|
|
96
96
|
size: J.XSmall
|
|
97
97
|
}
|
|
98
98
|
)
|
|
@@ -110,7 +110,7 @@ const ee = (s) => {
|
|
|
110
110
|
var l;
|
|
111
111
|
return /* @__PURE__ */ t.createElement("li", { className: e.dropdown__input, role: "option", id: `${x}-${n}`, "aria-selected": n === m }, t.cloneElement(o, { ref: (l = d.current) == null ? void 0 : l[n] }));
|
|
112
112
|
})
|
|
113
|
-
), !
|
|
113
|
+
), !H && /* @__PURE__ */ t.createElement("div", { className: e.dropdown__close }, /* @__PURE__ */ t.createElement(Q, { onClick: f, fluid: !0, "aria-expanded": a }, A))));
|
|
114
114
|
}, ye = ee;
|
|
115
115
|
export {
|
|
116
116
|
M as DropdownMode,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dropdown.js","sources":["../../../src/components/Dropdown/Dropdown.tsx"],"sourcesContent":["import React, { useRef, useState } from 'react';\n\nimport classNames from 'classnames';\n\nimport {\n AnalyticsId,\n IconSize,\n KeyboardEventKey,\n theme,\n useHover,\n useKeyboardEvent,\n useOutsideEvent,\n useSize,\n useToggle,\n useUuid,\n} from '../..';\nimport Button from '../Button';\nimport Icon from '../Icon';\nimport PlusSmall from '../Icons/PlusSmall';\n\nimport styles from './styles.module.scss';\n\nexport enum DropdownMode {\n onwhite = 'onwhite',\n ongrey = 'ongrey',\n onblueberry = 'onblueberry',\n oncherry = 'oncherry',\n}\n\nexport interface DropdownProps {\n /** Label for dropdown. Synlig for skjermlesere. */\n label: string;\n /** Tekst på knappen som åpner dropdownen */\n placeholder: string;\n /** Sets the dropdown content */\n children: React.ReactNode;\n /** Close button text */\n closeText?: string;\n /** No close button */\n noCloseButton?: boolean;\n /** Called when dropdown is open/closed. */\n onToggle?: (isOpen: boolean) => void;\n /** Om dropdown er åpen */\n open?: boolean;\n /** Changes the visuals of the dropdown */\n mode?: keyof typeof DropdownMode;\n /** Makes the background transparent */\n transparent?: boolean;\n /** Makes the background transparent */\n fluid?: boolean;\n /** Makes the dropdown disabled */\n disabled?: boolean;\n /** Sets the data-testid attribute on the dropdown button. */\n testId?: string;\n}\n\nconst Dropdown: React.FC<DropdownProps> = props => {\n const {\n label,\n placeholder,\n closeText = 'Lukk',\n noCloseButton = false,\n onToggle,\n open = false,\n children,\n mode = DropdownMode.onwhite,\n transparent = false,\n fluid = false,\n testId,\n disabled,\n } = props;\n const dropdownRef = useRef<HTMLDivElement>(null);\n const optionsRef = useRef<HTMLUListElement>(null);\n const { hoverRef: buttonRef, isHovered } = useHover<HTMLButtonElement>();\n const { value: isOpen, toggleValue: toggleIsOpen } = useToggle(!disabled && open, onToggle);\n const inputRefList = useRef(React.Children.map(children, () => React.createRef<HTMLElement>()));\n const [currentIndex, setCurrentIndex] = useState<number>();\n const { width: buttonWidth } = useSize(buttonRef) || {};\n const labelId = useUuid();\n const toggleLabelId = useUuid();\n const optionIdPrefix = useUuid();\n\n const handleOpen = (): void => {\n toggleIsOpen();\n optionsRef.current?.focus();\n };\n\n const handleClose = (): void => {\n toggleIsOpen();\n buttonRef.current?.focus();\n };\n\n const handleKeyboardNavigation = (event: KeyboardEvent): void => {\n event.preventDefault();\n\n if (!inputRefList.current) {\n return;\n }\n\n if (!isOpen) {\n handleOpen();\n return;\n } else if (event.key === KeyboardEventKey.Escape && isOpen) {\n handleClose();\n return;\n }\n\n const index = inputRefList.current.findIndex(x => x.current === event.target);\n let nextIndex = index;\n\n if (event.key === KeyboardEventKey.Home) {\n nextIndex = 0;\n } else if (event.key === KeyboardEventKey.End) {\n nextIndex = inputRefList.current.length - 1;\n } else if (event.key === KeyboardEventKey.ArrowDown && index < inputRefList.current.length - 1) {\n nextIndex = index + 1;\n } else if (event.key === KeyboardEventKey.ArrowUp && index > 0) {\n nextIndex = index - 1;\n } else if (event.key === KeyboardEventKey.Enter && index !== -1) {\n nextIndex = index;\n }\n if (nextIndex !== -1) {\n inputRefList.current[nextIndex].current?.focus();\n setCurrentIndex(nextIndex);\n }\n };\n\n useKeyboardEvent(dropdownRef, handleKeyboardNavigation, [\n KeyboardEventKey.ArrowDown,\n KeyboardEventKey.ArrowUp,\n KeyboardEventKey.End,\n KeyboardEventKey.Enter,\n KeyboardEventKey.Escape,\n KeyboardEventKey.Home,\n ]);\n\n useOutsideEvent(dropdownRef, () => isOpen && handleClose());\n\n const toggleClasses = classNames(\n styles.dropdown__toggle,\n !disabled && {\n [styles['dropdown__toggle--on-white']]: mode === DropdownMode.onwhite,\n [styles['dropdown__toggle--on-grey']]: mode === DropdownMode.ongrey,\n [styles['dropdown__toggle--on-blueberry']]: mode === DropdownMode.onblueberry,\n [styles['dropdown__toggle--on-cherry']]: mode === DropdownMode.oncherry,\n [styles['dropdown__toggle--transparent']]: transparent,\n [styles['dropdown__toggle--fluid']]: fluid,\n [styles['dropdown__toggle--open']]: isOpen,\n }\n );\n\n const contentClasses = classNames(styles.dropdown__content, isOpen && styles['dropdown__content--open']);\n\n return (\n <div className={styles.dropdown} ref={dropdownRef}>\n <span id={labelId} className={styles.dropdown__label}>\n {label}\n </span>\n <button\n type=\"button\"\n onClick={() => !isOpen && handleOpen()}\n className={toggleClasses}\n ref={buttonRef}\n data-testid={testId}\n data-analyticsid={AnalyticsId.Dropdown}\n disabled={disabled}\n aria-labelledby={toggleLabelId}\n aria-haspopup=\"listbox\"\n aria-expanded={isOpen}\n >\n <span id={toggleLabelId} className={styles.dropdown__toggle__label}>\n {placeholder}\n </span>\n <Icon\n color={disabled ? theme.palette.neutral500 : theme.palette.blueberry600}\n svgIcon={PlusSmall}\n className={styles.dropdown__icon}\n isHovered={isHovered}\n size={IconSize.XSmall}\n />\n </button>\n <div className={contentClasses} style={{ width: fluid ? '100%' : `${buttonWidth}px` }}>\n <ul\n className={styles.dropdown__options}\n role=\"listbox\"\n aria-labelledby={labelId}\n tabIndex={-1}\n aria-activedescendant={typeof currentIndex !== 'undefined' ? `${optionIdPrefix}-${currentIndex}` : undefined}\n ref={optionsRef}\n >\n {React.Children.map(children, (child, index) => (\n <li className={styles.dropdown__input} role=\"option\" id={`${optionIdPrefix}-${index}`} aria-selected={index === currentIndex}>\n {React.cloneElement(child as React.ReactElement, { ref: inputRefList.current?.[index] })}\n </li>\n ))}\n </ul>\n {!noCloseButton && (\n <div className={styles.dropdown__close}>\n <Button onClick={handleClose} fluid aria-expanded={isOpen}>\n {closeText}\n </Button>\n </div>\n )}\n </div>\n </div>\n );\n};\n\nexport default Dropdown;\n"],"names":["DropdownMode","Dropdown","props","label","placeholder","closeText","noCloseButton","onToggle","open","children","mode","transparent","fluid","testId","disabled","dropdownRef","useRef","optionsRef","buttonRef","isHovered","useHover","isOpen","toggleIsOpen","useToggle","inputRefList","React","currentIndex","setCurrentIndex","useState","buttonWidth","useSize","labelId","useUuid","toggleLabelId","optionIdPrefix","handleOpen","_a","handleClose","useKeyboardEvent","event","KeyboardEventKey","index","x","nextIndex","useOutsideEvent","toggleClasses","classNames","styles","contentClasses","AnalyticsId","Icon","theme","PlusSmall","IconSize","child","Button","Dropdown$1"],"mappings":";;;;;;;;;;;;;;;AAsBY,IAAAA,sBAAAA,OACVA,EAAA,UAAU,WACVA,EAAA,SAAS,UACTA,EAAA,cAAc,eACdA,EAAA,WAAW,YAJDA,IAAAA,KAAA,CAAA,CAAA;AAkCZ,MAAMC,KAAoC,CAASC,MAAA;AAC3C,QAAA;AAAA,IACJ,OAAAC;AAAA,IACA,aAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,eAAAC,IAAgB;AAAA,IAChB,UAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,UAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,aAAAC,IAAc;AAAA,IACd,OAAAC,IAAQ;AAAA,IACR,QAAAC;AAAA,IACA,UAAAC;AAAA,EACE,IAAAZ,GACEa,IAAcC,EAAuB,IAAI,GACzCC,IAAaD,EAAyB,IAAI,GAC1C,EAAE,UAAUE,GAAW,WAAAC,MAAcC,EAA4B,GACjE,EAAE,OAAOC,GAAQ,aAAaC,EAAA,IAAiBC,EAAU,CAACT,KAAYN,GAAMD,CAAQ,GACpFiB,IAAeR,EAAOS,EAAM,SAAS,IAAIhB,GAAU,MAAMgB,EAAM,UAAwB,CAAA,CAAC,GACxF,CAACC,GAAcC,CAAe,IAAIC,EAAiB,GACnD,EAAE,OAAOC,EAAA,IAAgBC,EAAQZ,CAAS,KAAK,IAC/Ca,IAAUC,KACVC,IAAgBD,KAChBE,IAAiBF,KAEjBG,IAAa,MAAY;;AAChB,IAAAb,MACbc,IAAAnB,EAAW,Y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C7E,EAAA,GAAAJ,gBAAAA,EAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWsB,EAAO;AAAA,MAClB,MAAK;AAAA,MACL,mBAAiBhB;AAAA,MACjB,UAAU;AAAA,MACV,yBAAuB,OAAOL,IAAiB,MAAc,GAAGQ,CAAc,IAAIR,CAAY,KAAK;AAAA,MACnG,KAAKT;AAAA,IAAA;AAAA,IAEJQ,EAAM,SAAS,IAAIhB,GAAU,CAAC6C,GAAOb;;AACnChB,6BAAAA,EAAA,cAAA,MAAA,EAAG,WAAWsB,EAAO,iBAAiB,MAAK,UAAS,IAAI,GAAGb,CAAc,IAAIO,CAAK,IAAI,iBAAeA,MAAUf,EAAA,GAC7GD,EAAM,aAAa6B,GAA6B,EAAE,MAAKlB,IAAAZ,EAAa,YAAb,gBAAAY,EAAuBK,GAAQ,CAAA,CACzF;AAAA,KACD;AAAA,EAAA,GAEF,CAACnC,qCACC,OAAI,EAAA,WAAWyC,EAAO,gBACrB,GAAAtB,gBAAAA,EAAA,cAAC8B,KAAO,SAASlB,GAAa,OAAK,IAAC,iBAAehB,KAChDhB,CACH,CACF,CAEJ,CACF;AAEJ,GAEAmD,KAAevD;"}
|
|
1
|
+
{"version":3,"file":"Dropdown.js","sources":["../../../src/components/Dropdown/Dropdown.tsx"],"sourcesContent":["import React, { useRef, useState } from 'react';\n\nimport classNames from 'classnames';\n\nimport {\n AnalyticsId,\n IconSize,\n KeyboardEventKey,\n theme,\n useHover,\n useKeyboardEvent,\n useOutsideEvent,\n useSize,\n useToggle,\n useUuid,\n} from '../..';\nimport Button from '../Button';\nimport Icon from '../Icon';\nimport PlusSmall from '../Icons/PlusSmall';\n\nimport styles from './styles.module.scss';\n\nexport enum DropdownMode {\n onwhite = 'onwhite',\n ongrey = 'ongrey',\n onblueberry = 'onblueberry',\n oncherry = 'oncherry',\n}\n\nexport interface DropdownProps {\n /** Label for dropdown. Synlig for skjermlesere. */\n label: string;\n /** Tekst på knappen som åpner dropdownen */\n placeholder: string;\n /** Sets the dropdown content */\n children: React.ReactNode;\n /** Close button text */\n closeText?: string;\n /** No close button */\n noCloseButton?: boolean;\n /** Called when dropdown is open/closed. */\n onToggle?: (isOpen: boolean) => void;\n /** Om dropdown er åpen */\n open?: boolean;\n /** Changes the visuals of the dropdown */\n mode?: keyof typeof DropdownMode;\n /** Makes the background transparent */\n transparent?: boolean;\n /** Makes the background transparent */\n fluid?: boolean;\n /** Makes the dropdown disabled */\n disabled?: boolean;\n /** Sets the data-testid attribute on the dropdown button. */\n testId?: string;\n}\n\nconst Dropdown: React.FC<DropdownProps> = props => {\n const {\n label,\n placeholder,\n closeText = 'Lukk',\n noCloseButton = false,\n onToggle,\n open = false,\n children,\n mode = DropdownMode.onwhite,\n transparent = false,\n fluid = false,\n testId,\n disabled,\n } = props;\n const dropdownRef = useRef<HTMLDivElement>(null);\n const optionsRef = useRef<HTMLUListElement>(null);\n const { hoverRef: buttonRef, isHovered } = useHover<HTMLButtonElement>();\n const { value: isOpen, toggleValue: toggleIsOpen } = useToggle(!disabled && open, onToggle);\n const inputRefList = useRef(React.Children.map(children, () => React.createRef<HTMLElement>()));\n const [currentIndex, setCurrentIndex] = useState<number>();\n const { width: buttonWidth } = useSize(buttonRef) || {};\n const labelId = useUuid();\n const toggleLabelId = useUuid();\n const optionIdPrefix = useUuid();\n\n const handleOpen = (): void => {\n toggleIsOpen();\n optionsRef.current?.focus();\n };\n\n const handleClose = (): void => {\n toggleIsOpen();\n buttonRef.current?.focus();\n };\n\n const handleKeyboardNavigation = (event: KeyboardEvent): void => {\n event.preventDefault();\n\n if (!inputRefList.current) {\n return;\n }\n\n if (!isOpen) {\n handleOpen();\n return;\n } else if (event.key === KeyboardEventKey.Escape && isOpen) {\n handleClose();\n return;\n }\n\n const index = inputRefList.current.findIndex(x => x.current === event.target);\n let nextIndex = index;\n\n if (event.key === KeyboardEventKey.Home) {\n nextIndex = 0;\n } else if (event.key === KeyboardEventKey.End) {\n nextIndex = inputRefList.current.length - 1;\n } else if (event.key === KeyboardEventKey.ArrowDown && index < inputRefList.current.length - 1) {\n nextIndex = index + 1;\n } else if (event.key === KeyboardEventKey.ArrowUp && index > 0) {\n nextIndex = index - 1;\n } else if (event.key === KeyboardEventKey.Enter && index !== -1) {\n nextIndex = index;\n }\n if (nextIndex !== -1) {\n inputRefList.current[nextIndex].current?.focus();\n setCurrentIndex(nextIndex);\n }\n };\n\n useKeyboardEvent(dropdownRef, handleKeyboardNavigation, [\n KeyboardEventKey.ArrowDown,\n KeyboardEventKey.ArrowUp,\n KeyboardEventKey.End,\n KeyboardEventKey.Enter,\n KeyboardEventKey.Escape,\n KeyboardEventKey.Home,\n ]);\n\n useOutsideEvent(dropdownRef, () => isOpen && handleClose());\n\n const toggleClasses = classNames(\n styles.dropdown__toggle,\n !disabled && {\n [styles['dropdown__toggle--on-white']]: mode === DropdownMode.onwhite,\n [styles['dropdown__toggle--on-grey']]: mode === DropdownMode.ongrey,\n [styles['dropdown__toggle--on-blueberry']]: mode === DropdownMode.onblueberry,\n [styles['dropdown__toggle--on-cherry']]: mode === DropdownMode.oncherry,\n [styles['dropdown__toggle--transparent']]: transparent,\n [styles['dropdown__toggle--fluid']]: fluid,\n [styles['dropdown__toggle--open']]: isOpen,\n }\n );\n\n const contentClasses = classNames(styles.dropdown__content, isOpen && styles['dropdown__content--open']);\n\n return (\n <div className={styles.dropdown} ref={dropdownRef}>\n <span id={labelId} className={styles.dropdown__label}>\n {label}\n </span>\n <button\n type=\"button\"\n onClick={() => !isOpen && handleOpen()}\n className={toggleClasses}\n ref={buttonRef}\n data-testid={testId}\n data-analyticsid={AnalyticsId.Dropdown}\n disabled={disabled}\n aria-labelledby={toggleLabelId}\n aria-haspopup=\"listbox\"\n aria-expanded={isOpen}\n >\n <span id={toggleLabelId} className={styles.dropdown__toggle__label}>\n {placeholder}\n </span>\n <Icon\n color={disabled ? theme.palette.neutral700 : theme.palette.blueberry600}\n svgIcon={PlusSmall}\n className={styles.dropdown__icon}\n isHovered={!disabled && isHovered}\n size={IconSize.XSmall}\n />\n </button>\n <div className={contentClasses} style={{ width: fluid ? '100%' : `${buttonWidth}px` }}>\n <ul\n className={styles.dropdown__options}\n role=\"listbox\"\n aria-labelledby={labelId}\n tabIndex={-1}\n aria-activedescendant={typeof currentIndex !== 'undefined' ? `${optionIdPrefix}-${currentIndex}` : undefined}\n ref={optionsRef}\n >\n {React.Children.map(children, (child, index) => (\n <li className={styles.dropdown__input} role=\"option\" id={`${optionIdPrefix}-${index}`} aria-selected={index === currentIndex}>\n {React.cloneElement(child as React.ReactElement, { ref: inputRefList.current?.[index] })}\n </li>\n ))}\n </ul>\n {!noCloseButton && (\n <div className={styles.dropdown__close}>\n <Button onClick={handleClose} fluid aria-expanded={isOpen}>\n {closeText}\n </Button>\n </div>\n )}\n </div>\n </div>\n );\n};\n\nexport default Dropdown;\n"],"names":["DropdownMode","Dropdown","props","label","placeholder","closeText","noCloseButton","onToggle","open","children","mode","transparent","fluid","testId","disabled","dropdownRef","useRef","optionsRef","buttonRef","isHovered","useHover","isOpen","toggleIsOpen","useToggle","inputRefList","React","currentIndex","setCurrentIndex","useState","buttonWidth","useSize","labelId","useUuid","toggleLabelId","optionIdPrefix","handleOpen","_a","handleClose","useKeyboardEvent","event","KeyboardEventKey","index","x","nextIndex","useOutsideEvent","toggleClasses","classNames","styles","contentClasses","AnalyticsId","Icon","theme","PlusSmall","IconSize","child","Button","Dropdown$1"],"mappings":";;;;;;;;;;;;;;;AAsBY,IAAAA,sBAAAA,OACVA,EAAA,UAAU,WACVA,EAAA,SAAS,UACTA,EAAA,cAAc,eACdA,EAAA,WAAW,YAJDA,IAAAA,KAAA,CAAA,CAAA;AAkCZ,MAAMC,KAAoC,CAASC,MAAA;AAC3C,QAAA;AAAA,IACJ,OAAAC;AAAA,IACA,aAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,eAAAC,IAAgB;AAAA,IAChB,UAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP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AAtB,gBAAAA,EAAA,cAAC8B,KAAO,SAASlB,GAAa,OAAK,IAAC,iBAAehB,KAChDhB,CACH,CACF,CAEJ,CACF;AAEJ,GAEAmD,KAAevD;"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** AUTO-GENERATED - DO NOT CHANGE MANUALLY **/
|
|
1
2
|
export declare const IconList: readonly ["ActiveMonitoring", "AcupunctureBack", "AlarmClock", "AlertSignFill", "AlertSignStroke", "Amputation", "Anxiety", "Apple", "Archive", "ArmFlexing", "ArrowDown", "ArrowLeft", "ArrowRight", "ArrowUp", "ArrowUpRight", "Attachment", "Atv", "Avatar", "AwakePersonOnPillow", "Baby", "BandAid", "BeerAndPills", "Bell", "Bike", "BirthControl", "BirthdayCake", "Boat", "Body", "Braille", "Brain", "BreastReconstruction", "BreastRemoval", "Breasts", "BrokenHeart", "BrokenPuzzle", "Bus", "Calendar", "CalendarChange", "CalendarCheck", "CalendarEvent", "CalendarSave", "Cancer", "Candle", "Car", "Change", "Check", "CheckFill", "CheckOutline", "Chest", "ChevronDown", "ChevronLeft", "ChevronRight", "ChevronsDown", "ChevronsUp", "ChevronUp", "ChildPlaying", "Cigarette", "Coins", "Contacts", "Copy", "CoronaCertificate", "Coronavirus", "Cough", "CriticalHealthInfo", "Cross", "DataExchange", "DataReceived", "DataSent", "Depression", "DigestiveSystem", "Dizzy", "Documents", "Dog", "DonorCard", "Download", "Draft", "Ear", "EarDeaf", "EarHearingAid", "EarNoseThroat", "EarVolume", "EChat", "ElderlyPerson", "Embolization", "EmergencyCall", "EmoticonAnnoyed", "EmoticonDelighted", "EmoticonDisappointed", "EmoticonHappy", "EmoticonMeh", "EnterFullScreen", "Envelope", "Epilepsy", "Eraser", "ErrorSignFill", "ErrorSignStroke", "EuropeanHealthCard", "ExitFullScreen", "Eye", "Facebook", "FallingLeaf", "Female", "FemaleDoctor", "Ferry", "File", "Filter", "FingerBleed", "FirstAidKit", "FloppyDisk", "Football", "Form", "Forward", "Gallery", "Garden", "GasCan", "GenderIdentity", "Glasses", "Globe", "Graph", "Group", "GroupTwins", "HandsAndHeart", "HandWaving", "HandWithDisease", "HealthcarePerson", "HealthcarePersonell", "HealthClinic", "HealthWarning", "HearingProtection", "Heart", "HeartHands", "HelpingHand", "HelpSign", "Hemodialysis", "Hiker", "Hipprosthesis", "History", "HivAndAids", "Home", "Hormone", "Hospital", "Hourglass", "HTMLFile", "ImgFile", "Inbox", "InfoSignFill", "InfoSignStroke", "Instagram", "Intravenous", "JointPain", "Journal", "JpgFile", "Kidney", "KitchenScale", "Kjernejournal", "Laboratory", "LaptopBlog", "LawBook", "LegalDocument", "LightBulb", "List", "Location", "Lock", "Login", "Logout", "Lungs", "Makeup", "MaleDoctor", "MaleDoctorAndPerson", "MaleGenitalia", "Medicine", "MedicineWarning", "MentalHealthAdult", "MentalHealthChild", "Menu", "Microscope", "Minus", "Mirror", "MobilePhone", "MotherHoldingBaby", "MuscleBack", "MuscleLeg", "Mushroom", "Music", "MusselsAndSalt", "NoAccess", "NoEye", "NoFilter", "Notepad", "Osteotomy", "PaintRoller", "PaperPlane", "PatientAndPerson", "Pause", "PdfFile", "Pencil", "PeopleTalking", "Peritonealdialysis", "Person", "PersonalPlan", "PersonAndPatient", "PersonCancel", "PersonInXRayMachine", "PersonOverweight", "PersonRelaxing", "PersonWithBrain", "PersonWithBrokenArm", "PersonWithCrutches", "PersonWithJaw", "PersonWithMagnifyingGlass", "PersonWithSenses", "PersonWorking", "PizzaSlice", "Plane", "Plant", "Play", "PlusLarge", "PlusSmall", "PngFile", "Podcast", "PoisonInformation", "Pregnant", "Printer", "Psychosis", "Publication", "Puzzle", "QrCode", "Quarrel", "RadioactiveTreatment", "Radioiodine", "RadioTherapy", "Receipt", "Receptionist", "Recovery", "Referral", "Refresh", "Refund", "Reply", "Rocket", "RtfFile", "Save", "Scale", "ScreenReader", "Search", "SectionSign", "Settings", "Sexualorientation", "ShakingHand", "Share", "Shield", "ShuntOperation", "Skeleton", "Skin", "Snake", "Snapchat", "SortDown", "SortUp", "SpeechBubble", "Spray", "STDs", "Stopwatch", "Sun", "SupportingPerson", "Surgery", "Syringe", "Taxi", "TeddyBear", "Teenagers", "ThinkingAboutBaby", "Ticket", "TimePassing", "Tombstone", "Toolbox", "Tooth", "TotalKneeProsthesis", "Train", "Transplantation", "TrashCan", "TravelRoute", "TriangleX", "Twitter", "Undo", "UniProsthesis", "Upload", "UserOrganization", "Vaccine", "VerticalDots", "VideoCamera", "VideoChat", "Wallet", "Watch", "Website", "Wheelchair", "WheelchairActive", "Window", "WordDocument", "WorkSuitcase", "X", "XmlFile", "XOutline", "YouTube", "Zoom"];
|
|
2
3
|
export type IconName = (typeof IconList)[number];
|
|
3
4
|
//# sourceMappingURL=IconNames.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconNames.d.ts","sourceRoot":"","sources":["../../../src/components/Icons/IconNames.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,q/HA+SX,CAAC;AAEX,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"IconNames.d.ts","sourceRoot":"","sources":["../../../src/components/Icons/IconNames.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAE/C,eAAO,MAAM,QAAQ,q/HA+SX,CAAC;AAEX,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconNames.js","sources":["../../../src/components/Icons/IconNames.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"IconNames.js","sources":["../../../src/components/Icons/IconNames.ts"],"sourcesContent":["/** AUTO-GENERATED - DO NOT CHANGE MANUALLY **/\n\nexport const IconList = [\n 'ActiveMonitoring',\n 'AcupunctureBack',\n 'AlarmClock',\n 'AlertSignFill',\n 'AlertSignStroke',\n 'Amputation',\n 'Anxiety',\n 'Apple',\n 'Archive',\n 'ArmFlexing',\n 'ArrowDown',\n 'ArrowLeft',\n 'ArrowRight',\n 'ArrowUp',\n 'ArrowUpRight',\n 'Attachment',\n 'Atv',\n 'Avatar',\n 'AwakePersonOnPillow',\n 'Baby',\n 'BandAid',\n 'BeerAndPills',\n 'Bell',\n 'Bike',\n 'BirthControl',\n 'BirthdayCake',\n 'Boat',\n 'Body',\n 'Braille',\n 'Brain',\n 'BreastReconstruction',\n 'BreastRemoval',\n 'Breasts',\n 'BrokenHeart',\n 'BrokenPuzzle',\n 'Bus',\n 'Calendar',\n 'CalendarChange',\n 'CalendarCheck',\n 'CalendarEvent',\n 'CalendarSave',\n 'Cancer',\n 'Candle',\n 'Car',\n 'Change',\n 'Check',\n 'CheckFill',\n 'CheckOutline',\n 'Chest',\n 'ChevronDown',\n 'ChevronLeft',\n 'ChevronRight',\n 'ChevronsDown',\n 'ChevronsUp',\n 'ChevronUp',\n 'ChildPlaying',\n 'Cigarette',\n 'Coins',\n 'Contacts',\n 'Copy',\n 'CoronaCertificate',\n 'Coronavirus',\n 'Cough',\n 'CriticalHealthInfo',\n 'Cross',\n 'DataExchange',\n 'DataReceived',\n 'DataSent',\n 'Depression',\n 'DigestiveSystem',\n 'Dizzy',\n 'Documents',\n 'Dog',\n 'DonorCard',\n 'Download',\n 'Draft',\n 'Ear',\n 'EarDeaf',\n 'EarHearingAid',\n 'EarNoseThroat',\n 'EarVolume',\n 'EChat',\n 'ElderlyPerson',\n 'Embolization',\n 'EmergencyCall',\n 'EmoticonAnnoyed',\n 'EmoticonDelighted',\n 'EmoticonDisappointed',\n 'EmoticonHappy',\n 'EmoticonMeh',\n 'EnterFullScreen',\n 'Envelope',\n 'Epilepsy',\n 'Eraser',\n 'ErrorSignFill',\n 'ErrorSignStroke',\n 'EuropeanHealthCard',\n 'ExitFullScreen',\n 'Eye',\n 'Facebook',\n 'FallingLeaf',\n 'Female',\n 'FemaleDoctor',\n 'Ferry',\n 'File',\n 'Filter',\n 'FingerBleed',\n 'FirstAidKit',\n 'FloppyDisk',\n 'Football',\n 'Form',\n 'Forward',\n 'Gallery',\n 'Garden',\n 'GasCan',\n 'GenderIdentity',\n 'Glasses',\n 'Globe',\n 'Graph',\n 'Group',\n 'GroupTwins',\n 'HandsAndHeart',\n 'HandWaving',\n 'HandWithDisease',\n 'HealthcarePerson',\n 'HealthcarePersonell',\n 'HealthClinic',\n 'HealthWarning',\n 'HearingProtection',\n 'Heart',\n 'HeartHands',\n 'HelpingHand',\n 'HelpSign',\n 'Hemodialysis',\n 'Hiker',\n 'Hipprosthesis',\n 'History',\n 'HivAndAids',\n 'Home',\n 'Hormone',\n 'Hospital',\n 'Hourglass',\n 'HTMLFile',\n 'ImgFile',\n 'Inbox',\n 'InfoSignFill',\n 'InfoSignStroke',\n 'Instagram',\n 'Intravenous',\n 'JointPain',\n 'Journal',\n 'JpgFile',\n 'Kidney',\n 'KitchenScale',\n 'Kjernejournal',\n 'Laboratory',\n 'LaptopBlog',\n 'LawBook',\n 'LegalDocument',\n 'LightBulb',\n 'List',\n 'Location',\n 'Lock',\n 'Login',\n 'Logout',\n 'Lungs',\n 'Makeup',\n 'MaleDoctor',\n 'MaleDoctorAndPerson',\n 'MaleGenitalia',\n 'Medicine',\n 'MedicineWarning',\n 'MentalHealthAdult',\n 'MentalHealthChild',\n 'Menu',\n 'Microscope',\n 'Minus',\n 'Mirror',\n 'MobilePhone',\n 'MotherHoldingBaby',\n 'MuscleBack',\n 'MuscleLeg',\n 'Mushroom',\n 'Music',\n 'MusselsAndSalt',\n 'NoAccess',\n 'NoEye',\n 'NoFilter',\n 'Notepad',\n 'Osteotomy',\n 'PaintRoller',\n 'PaperPlane',\n 'PatientAndPerson',\n 'Pause',\n 'PdfFile',\n 'Pencil',\n 'PeopleTalking',\n 'Peritonealdialysis',\n 'Person',\n 'PersonalPlan',\n 'PersonAndPatient',\n 'PersonCancel',\n 'PersonInXRayMachine',\n 'PersonOverweight',\n 'PersonRelaxing',\n 'PersonWithBrain',\n 'PersonWithBrokenArm',\n 'PersonWithCrutches',\n 'PersonWithJaw',\n 'PersonWithMagnifyingGlass',\n 'PersonWithSenses',\n 'PersonWorking',\n 'PizzaSlice',\n 'Plane',\n 'Plant',\n 'Play',\n 'PlusLarge',\n 'PlusSmall',\n 'PngFile',\n 'Podcast',\n 'PoisonInformation',\n 'Pregnant',\n 'Printer',\n 'Psychosis',\n 'Publication',\n 'Puzzle',\n 'QrCode',\n 'Quarrel',\n 'RadioactiveTreatment',\n 'Radioiodine',\n 'RadioTherapy',\n 'Receipt',\n 'Receptionist',\n 'Recovery',\n 'Referral',\n 'Refresh',\n 'Refund',\n 'Reply',\n 'Rocket',\n 'RtfFile',\n 'Save',\n 'Scale',\n 'ScreenReader',\n 'Search',\n 'SectionSign',\n 'Settings',\n 'Sexualorientation',\n 'ShakingHand',\n 'Share',\n 'Shield',\n 'ShuntOperation',\n 'Skeleton',\n 'Skin',\n 'Snake',\n 'Snapchat',\n 'SortDown',\n 'SortUp',\n 'SpeechBubble',\n 'Spray',\n 'STDs',\n 'Stopwatch',\n 'Sun',\n 'SupportingPerson',\n 'Surgery',\n 'Syringe',\n 'Taxi',\n 'TeddyBear',\n 'Teenagers',\n 'ThinkingAboutBaby',\n 'Ticket',\n 'TimePassing',\n 'Tombstone',\n 'Toolbox',\n 'Tooth',\n 'TotalKneeProsthesis',\n 'Train',\n 'Transplantation',\n 'TrashCan',\n 'TravelRoute',\n 'TriangleX',\n 'Twitter',\n 'Undo',\n 'UniProsthesis',\n 'Upload',\n 'UserOrganization',\n 'Vaccine',\n 'VerticalDots',\n 'VideoCamera',\n 'VideoChat',\n 'Wallet',\n 'Watch',\n 'Website',\n 'Wheelchair',\n 'WheelchairActive',\n 'Window',\n 'WordDocument',\n 'WorkSuitcase',\n 'X',\n 'XmlFile',\n 'XOutline',\n 'YouTube',\n 'Zoom',\n] as const;\n\nexport type IconName = (typeof IconList)[number];\n"],"names":["IconList"],"mappings":"AAEO,MAAMA,IAAW;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;"}
|
|
@@ -1,6 +1,23 @@
|
|
|
1
|
-
import
|
|
2
|
-
export
|
|
3
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type IllustrationColor = 'neutral' | 'cherry' | 'blueberry';
|
|
3
|
+
export interface BaseSvgIllustrationProps {
|
|
4
|
+
color: IllustrationColor;
|
|
5
|
+
}
|
|
6
|
+
export interface SvgIllustrationProps extends BaseSvgIllustrationProps {
|
|
7
|
+
size: number;
|
|
8
|
+
}
|
|
9
|
+
export type SvgIllustration = React.ComponentType<SvgIllustrationProps>;
|
|
10
|
+
export interface BaseIllustrationProps {
|
|
11
|
+
ariaLabel?: string;
|
|
12
|
+
size?: number;
|
|
13
|
+
color?: IllustrationColor;
|
|
4
14
|
className?: string;
|
|
15
|
+
/** Sets the data-testid attribute. */
|
|
16
|
+
testId?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface IllustrationProps extends BaseIllustrationProps {
|
|
19
|
+
illustration: SvgIllustration;
|
|
5
20
|
}
|
|
21
|
+
export declare const Illustration: React.ForwardRefExoticComponent<IllustrationProps & React.RefAttributes<SVGSVGElement>>;
|
|
22
|
+
export default Illustration;
|
|
6
23
|
//# sourceMappingURL=Illustration.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Illustration.d.ts","sourceRoot":"","sources":["../../../src/components/Illustration/Illustration.
|
|
1
|
+
{"version":3,"file":"Illustration.d.ts","sourceRoot":"","sources":["../../../src/components/Illustration/Illustration.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,QAAQ,GAAG,WAAW,CAAC;AAEnE,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,iBAAiB,CAAC;CAC1B;AACD,MAAM,WAAW,oBAAqB,SAAQ,wBAAwB;IACpE,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,aAAa,CAAC,oBAAoB,CAAC,CAAC;AAExE,MAAM,WAAW,qBAAqB;IAEpC,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAE1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sCAAsC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,iBAAkB,SAAQ,qBAAqB;IAE9D,YAAY,EAAE,eAAe,CAAC;CAC/B;AAED,eAAO,MAAM,YAAY,yFAiCvB,CAAC;AAIH,eAAe,YAAY,CAAC"}
|