@helsenorge/designsystem-react 14.11.0 → 14.11.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/lib/CHANGELOG.md +6 -0
- package/lib/Filter.js +12 -12
- package/lib/Filter.js.map +1 -1
- package/lib/RadioButton.js +4 -18
- package/lib/RadioButton.js.map +1 -1
- package/lib/RadioMarker.js +3 -9
- package/lib/RadioMarker.js.map +1 -1
- package/lib/Search.js +4 -4
- package/lib/Search.js.map +1 -1
- package/lib/VisualRadio.js +4 -19
- package/lib/VisualRadio.js.map +1 -1
- package/lib/__mocks__/matchMedia.js +3 -2
- package/lib/__mocks__/matchMedia.js.map +1 -1
- package/lib/components/Icons/Sort.js +12 -12
- package/lib/components/Icons/Sort.js.map +1 -1
- package/lib/components/RadioButton/RadioMarker/styles.module.scss +75 -46
- package/lib/components/RadioButton/RadioMarker/styles.module.scss.d.ts +3 -7
- package/lib/components/RadioButton/styles.module.scss +3 -3
- package/lib/components/RadioButton/styles.module.scss.d.ts +1 -3
- package/lib/resourceHelper.js +10 -6
- package/lib/resourceHelper.js.map +1 -1
- package/lib/resources/HN.Designsystem.Filter.en-GB.json.d.ts +5 -3
- package/lib/resources/HN.Designsystem.Filter.nb-NO.json.d.ts +5 -3
- package/lib/resources/Resources.d.ts +10 -2
- package/lib/scss/_visual-form.scss +24 -12
- package/package.json +1 -1
- package/scss/_visual-form.scss +24 -12
package/lib/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
|
|
2
|
+
## [14.11.1](https://github.com/helsenorge/designsystem/compare/v14.11.0...v14.11.1) (2026-05-29)
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **radiobutton:** dot forsvant ikke uten formgroup med name ([8da51a3](https://github.com/helsenorge/designsystem/commit/8da51a390f5a54aeca6ce697ed6c7818b2564515)), closes [#379249](https://github.com/helsenorge/designsystem/issues/379249)
|
|
7
|
+
|
|
2
8
|
## [14.11.0](https://github.com/helsenorge/designsystem/compare/v14.10.0...v14.11.0) (2026-05-26)
|
|
3
9
|
|
|
4
10
|
### Features
|
package/lib/Filter.js
CHANGED
|
@@ -5,35 +5,35 @@ var Filter = ({ size, isHovered }) => {
|
|
|
5
5
|
size,
|
|
6
6
|
isHovered,
|
|
7
7
|
normal: /* @__PURE__ */ jsx("path", {
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
fillRule: "evenodd",
|
|
9
|
+
clipRule: "evenodd",
|
|
10
10
|
d: "M21.034 30.338a4 4 0 0 1 3.926 3.234H41v1.3H24.998a4 4 0 0 1-7.94-.1H7v-1.2h10.108a4 4 0 0 1 3.926-3.234Zm0 1.3a2.7 2.7 0 1 0 .001 5.4 2.7 2.7 0 0 0 0-5.4ZM32.697 20a4 4 0 0 1 3.936 3.286H41v1.3h-4.346a4 4 0 0 1-7.914 0H7v-1.3h21.762A4 4 0 0 1 32.697 20Zm0 1.3a2.7 2.7 0 1 0 0 5.4 2.7 2.7 0 0 0 0-5.4ZM16.571 9.726A4 4 0 0 1 20.505 13H41v1.3H20.53a4 4 0 0 1-7.917 0H7V13h5.638a4 4 0 0 1 3.933-3.274Zm0 1.3a2.7 2.7 0 1 0 0 5.4 2.7 2.7 0 0 0 0-5.4Z"
|
|
11
11
|
}),
|
|
12
12
|
normalHover: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
13
13
|
/* @__PURE__ */ jsx("path", {
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
fillRule: "evenodd",
|
|
15
|
+
clipRule: "evenodd",
|
|
16
16
|
d: "M17.0332 30.3389C18.9803 30.3389 20.6015 31.7297 20.959 33.5723H40.999V34.8721H20.9971C20.7361 36.8288 19.0613 38.3389 17.0332 38.3389C15.0051 38.3389 13.3303 36.8288 13.0693 34.8721H6.99902V33.5723H13.1074C13.4649 31.7297 15.0861 30.3389 17.0332 30.3389ZM17.0332 31.6387C15.542 31.6387 14.333 32.8477 14.333 34.3389C14.3333 35.8298 15.5422 37.0391 17.0332 37.0391C18.5242 37.0391 19.7331 35.8298 19.7334 34.3389C19.7334 32.8477 18.5244 31.6387 17.0332 31.6387Z"
|
|
17
17
|
}),
|
|
18
18
|
/* @__PURE__ */ jsx("path", {
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
fillRule: "evenodd",
|
|
20
|
+
clipRule: "evenodd",
|
|
21
21
|
d: "M32.6963 20C34.6617 20 36.2952 21.4177 36.6318 23.2861H40.999V24.5859H36.6533C36.3698 26.5173 34.7064 28 32.6963 28C30.6862 28 29.0228 26.5173 28.7393 24.5859H6.99902V23.2861H28.7607C29.0974 21.4177 30.7309 20 32.6963 20ZM32.6963 21.2998C31.2051 21.2998 29.9961 22.5088 29.9961 24C29.9961 25.4912 31.2051 26.7002 32.6963 26.7002C34.1875 26.7002 35.3965 25.4912 35.3965 24C35.3965 22.5088 34.1875 21.2998 32.6963 21.2998Z"
|
|
22
22
|
}),
|
|
23
23
|
/* @__PURE__ */ jsx("path", {
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
fillRule: "evenodd",
|
|
25
|
+
clipRule: "evenodd",
|
|
26
26
|
d: "M19.5703 9.72461C21.5318 9.72461 23.1627 11.1371 23.5039 13H40.999V14.2998H23.5283C23.2496 16.2366 21.5843 17.7256 19.5703 17.7256C17.5564 17.7256 15.891 16.2366 15.6123 14.2998H6.99902V13H15.6367C15.9779 11.1371 17.6088 9.72461 19.5703 9.72461ZM19.5703 11.0254C18.0791 11.0254 16.8701 12.2344 16.8701 13.7256C16.8704 15.2165 18.0793 16.4258 19.5703 16.4258C21.0613 16.4258 22.2702 15.2165 22.2705 13.7256C22.2705 12.2344 21.0615 11.0254 19.5703 11.0254Z"
|
|
27
27
|
})
|
|
28
28
|
] }),
|
|
29
29
|
xSmall: /* @__PURE__ */ jsx("path", {
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
fillRule: "evenodd",
|
|
31
|
+
clipRule: "evenodd",
|
|
32
32
|
d: "M22.111 27.892a2.974 2.974 0 0 1 2.905 2.342h11.935v1.264H25.015a2.973 2.973 0 0 1-2.904 2.34l-.303-.015a2.973 2.973 0 0 1-2.6-2.325H11.68v-1.264h7.529a2.973 2.973 0 0 1 2.903-2.342Zm0 1.263a1.71 1.71 0 1 0 .001 3.42 1.71 1.71 0 0 0 0-3.42Zm8.669-8.229a2.974 2.974 0 0 1 2.904 2.343h3.267v1.263h-3.268a2.973 2.973 0 0 1-2.904 2.341l-.303-.016a2.973 2.973 0 0 1-2.599-2.325H11.679v-1.263h16.197a2.973 2.973 0 0 1 2.903-2.343Zm0 1.263a1.71 1.71 0 1 0 0 3.421 1.71 1.71 0 0 0 0-3.42Zm-11.987-8.295a2.974 2.974 0 0 1 2.905 2.34h15.253v1.264H21.697a2.973 2.973 0 0 1-2.904 2.342l-.303-.015a2.973 2.973 0 0 1-2.6-2.327h-4.21v-1.263h4.21a2.973 2.973 0 0 1 2.903-2.341Zm0 1.263a1.71 1.71 0 1 0 .001 3.42 1.71 1.71 0 0 0 0-3.42Z"
|
|
33
33
|
}),
|
|
34
34
|
xSmallHover: /* @__PURE__ */ jsx("path", {
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
fillRule: "evenodd",
|
|
36
|
+
clipRule: "evenodd",
|
|
37
37
|
d: "M19.585 27.892a2.975 2.975 0 0 1 2.906 2.342h14.46v1.264H22.489a2.973 2.973 0 0 1-2.904 2.34l-.303-.015a2.974 2.974 0 0 1-2.6-2.327h-5.003v-1.263h5.001a2.974 2.974 0 0 1 2.905-2.341Zm0 1.263a1.71 1.71 0 1 0 0 3.42 1.71 1.71 0 0 0 0-3.42Zm11.195-8.229a2.974 2.974 0 0 1 2.904 2.343h3.267v1.263h-3.268a2.973 2.973 0 0 1-2.904 2.341l-.303-.016a2.973 2.973 0 0 1-2.599-2.325H11.679v-1.263h16.197a2.973 2.973 0 0 1 2.903-2.343Zm0 1.263a1.71 1.71 0 1 0 0 3.421 1.71 1.71 0 0 0 0-3.42Zm-9.46-8.295a2.974 2.974 0 0 1 2.904 2.34h12.727v1.264H24.223a2.973 2.973 0 0 1-2.904 2.342l-.303-.015a2.973 2.973 0 0 1-2.6-2.327H11.68v-1.263h6.737a2.973 2.973 0 0 1 2.903-2.341Zm0 1.263a1.71 1.71 0 1 0 0 3.42 1.71 1.71 0 0 0 0-3.42Z"
|
|
38
38
|
})
|
|
39
39
|
});
|
package/lib/Filter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Filter.js","names":["Filter: React.FC<SvgPathProps>"],"sources":["../src/components/Icons/Filter.tsx"],"sourcesContent":["import type { SvgPathProps } from '../Icon';\n\nimport { getIcon } from '../Icon/utils';\n\nconst Filter: React.FC<SvgPathProps> = ({ size, isHovered }: SvgPathProps): React.ReactElement => {\n const normal = (\n <path\n
|
|
1
|
+
{"version":3,"file":"Filter.js","names":["Filter: React.FC<SvgPathProps>"],"sources":["../src/components/Icons/Filter.tsx"],"sourcesContent":["import type { SvgPathProps } from '../Icon';\n\nimport { getIcon } from '../Icon/utils';\n\nconst Filter: React.FC<SvgPathProps> = ({ size, isHovered }: SvgPathProps): React.ReactElement => {\n const normal = (\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M21.034 30.338a4 4 0 0 1 3.926 3.234H41v1.3H24.998a4 4 0 0 1-7.94-.1H7v-1.2h10.108a4 4 0 0 1 3.926-3.234Zm0 1.3a2.7 2.7 0 1 0 .001 5.4 2.7 2.7 0 0 0 0-5.4ZM32.697 20a4 4 0 0 1 3.936 3.286H41v1.3h-4.346a4 4 0 0 1-7.914 0H7v-1.3h21.762A4 4 0 0 1 32.697 20Zm0 1.3a2.7 2.7 0 1 0 0 5.4 2.7 2.7 0 0 0 0-5.4ZM16.571 9.726A4 4 0 0 1 20.505 13H41v1.3H20.53a4 4 0 0 1-7.917 0H7V13h5.638a4 4 0 0 1 3.933-3.274Zm0 1.3a2.7 2.7 0 1 0 0 5.4 2.7 2.7 0 0 0 0-5.4Z\"\n />\n );\n\n const normalHover = (\n <>\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M17.0332 30.3389C18.9803 30.3389 20.6015 31.7297 20.959 33.5723H40.999V34.8721H20.9971C20.7361 36.8288 19.0613 38.3389 17.0332 38.3389C15.0051 38.3389 13.3303 36.8288 13.0693 34.8721H6.99902V33.5723H13.1074C13.4649 31.7297 15.0861 30.3389 17.0332 30.3389ZM17.0332 31.6387C15.542 31.6387 14.333 32.8477 14.333 34.3389C14.3333 35.8298 15.5422 37.0391 17.0332 37.0391C18.5242 37.0391 19.7331 35.8298 19.7334 34.3389C19.7334 32.8477 18.5244 31.6387 17.0332 31.6387Z\"\n />\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M32.6963 20C34.6617 20 36.2952 21.4177 36.6318 23.2861H40.999V24.5859H36.6533C36.3698 26.5173 34.7064 28 32.6963 28C30.6862 28 29.0228 26.5173 28.7393 24.5859H6.99902V23.2861H28.7607C29.0974 21.4177 30.7309 20 32.6963 20ZM32.6963 21.2998C31.2051 21.2998 29.9961 22.5088 29.9961 24C29.9961 25.4912 31.2051 26.7002 32.6963 26.7002C34.1875 26.7002 35.3965 25.4912 35.3965 24C35.3965 22.5088 34.1875 21.2998 32.6963 21.2998Z\"\n />\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M19.5703 9.72461C21.5318 9.72461 23.1627 11.1371 23.5039 13H40.999V14.2998H23.5283C23.2496 16.2366 21.5843 17.7256 19.5703 17.7256C17.5564 17.7256 15.891 16.2366 15.6123 14.2998H6.99902V13H15.6367C15.9779 11.1371 17.6088 9.72461 19.5703 9.72461ZM19.5703 11.0254C18.0791 11.0254 16.8701 12.2344 16.8701 13.7256C16.8704 15.2165 18.0793 16.4258 19.5703 16.4258C21.0613 16.4258 22.2702 15.2165 22.2705 13.7256C22.2705 12.2344 21.0615 11.0254 19.5703 11.0254Z\"\n />\n </>\n );\n\n const xSmall = (\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M22.111 27.892a2.974 2.974 0 0 1 2.905 2.342h11.935v1.264H25.015a2.973 2.973 0 0 1-2.904 2.34l-.303-.015a2.973 2.973 0 0 1-2.6-2.325H11.68v-1.264h7.529a2.973 2.973 0 0 1 2.903-2.342Zm0 1.263a1.71 1.71 0 1 0 .001 3.42 1.71 1.71 0 0 0 0-3.42Zm8.669-8.229a2.974 2.974 0 0 1 2.904 2.343h3.267v1.263h-3.268a2.973 2.973 0 0 1-2.904 2.341l-.303-.016a2.973 2.973 0 0 1-2.599-2.325H11.679v-1.263h16.197a2.973 2.973 0 0 1 2.903-2.343Zm0 1.263a1.71 1.71 0 1 0 0 3.421 1.71 1.71 0 0 0 0-3.42Zm-11.987-8.295a2.974 2.974 0 0 1 2.905 2.34h15.253v1.264H21.697a2.973 2.973 0 0 1-2.904 2.342l-.303-.015a2.973 2.973 0 0 1-2.6-2.327h-4.21v-1.263h4.21a2.973 2.973 0 0 1 2.903-2.341Zm0 1.263a1.71 1.71 0 1 0 .001 3.42 1.71 1.71 0 0 0 0-3.42Z\"\n />\n );\n\n const xSmallHover = (\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M19.585 27.892a2.975 2.975 0 0 1 2.906 2.342h14.46v1.264H22.489a2.973 2.973 0 0 1-2.904 2.34l-.303-.015a2.974 2.974 0 0 1-2.6-2.327h-5.003v-1.263h5.001a2.974 2.974 0 0 1 2.905-2.341Zm0 1.263a1.71 1.71 0 1 0 0 3.42 1.71 1.71 0 0 0 0-3.42Zm11.195-8.229a2.974 2.974 0 0 1 2.904 2.343h3.267v1.263h-3.268a2.973 2.973 0 0 1-2.904 2.341l-.303-.016a2.973 2.973 0 0 1-2.599-2.325H11.679v-1.263h16.197a2.973 2.973 0 0 1 2.903-2.343Zm0 1.263a1.71 1.71 0 1 0 0 3.421 1.71 1.71 0 0 0 0-3.42Zm-9.46-8.295a2.974 2.974 0 0 1 2.904 2.34h12.727v1.264H24.223a2.973 2.973 0 0 1-2.904 2.342l-.303-.015a2.973 2.973 0 0 1-2.6-2.327H11.68v-1.263h6.737a2.973 2.973 0 0 1 2.903-2.341Zm0 1.263a1.71 1.71 0 1 0 0 3.42 1.71 1.71 0 0 0 0-3.42Z\"\n />\n );\n\n return getIcon({ size, isHovered, normal, normalHover, xSmall, xSmallHover });\n};\n\nexport default Filter;\n"],"mappings":";;AAIA,IAAMA,UAAkC,EAAE,MAAM,gBAAkD;AA6ChG,QAAO,QAAQ;EAAE;EAAM;EAAW,QA3ChC,oBAAC,QAAA;GACC,UAAS;GACT,UAAS;GACT,GAAE;IACF;EAuCsC,aAnCxC,qBAAA,UAAA,EAAA,UAAA;GACE,oBAAC,QAAA;IACC,UAAS;IACT,UAAS;IACT,GAAE;KACF;GACF,oBAAC,QAAA;IACC,UAAS;IACT,UAAS;IACT,GAAE;KACF;GACF,oBAAC,QAAA;IACC,UAAS;IACT,UAAS;IACT,GAAE;KACF;MACD;EAmBkD,QAfrD,oBAAC,QAAA;GACC,UAAS;GACT,UAAS;GACT,GAAE;IACF;EAW2D,aAP7D,oBAAC,QAAA;GACC,UAAS;GACT,UAAS;GACT,GAAE;IACF;EAGwE,CAAC;;AAG/E,IAAA,iBAAe"}
|
package/lib/RadioButton.js
CHANGED
|
@@ -6,7 +6,6 @@ import { t as ErrorWrapper_default } from "./ErrorWrapper.js";
|
|
|
6
6
|
import { r as renderLabelAsParent, t as getLabelText } from "./utils2.js";
|
|
7
7
|
import { t as RadioMarker_default } from "./RadioMarker.js";
|
|
8
8
|
import classNames from "classnames";
|
|
9
|
-
import { useState } from "react";
|
|
10
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
10
|
import radioButtonStyles from "./components/RadioButton/styles.module.scss";
|
|
12
11
|
const RadioButton = (props) => {
|
|
@@ -17,16 +16,9 @@ const RadioButton = (props) => {
|
|
|
17
16
|
const onBlueberry = onColor === FormOnColor.onblueberry;
|
|
18
17
|
const onCherry = onColor === FormOnColor.oninvalid;
|
|
19
18
|
const isLarge = size === FormSize.large;
|
|
20
|
-
const [isChecked, setIsChecked] = useState(!!(props.checked ?? defaultChecked));
|
|
21
|
-
const [prevChecked, setPrevChecked] = useState(props.checked);
|
|
22
|
-
if (prevChecked !== props.checked) {
|
|
23
|
-
setPrevChecked(props.checked);
|
|
24
|
-
if (props.checked !== void 0 && props.checked !== isChecked) setIsChecked(props.checked);
|
|
25
|
-
}
|
|
26
19
|
const errorTextId = useIdWithFallback(errorTextIdProp);
|
|
27
20
|
const radioButtonWrapperClasses = classNames(radioButtonStyles["radio-button-wrapper"], {
|
|
28
21
|
[radioButtonStyles["radio-button-wrapper__large"]]: isLarge,
|
|
29
|
-
[radioButtonStyles["radio-button-wrapper__large--selected"]]: isLarge && isChecked,
|
|
30
22
|
[radioButtonStyles["radio-button-wrapper__large--invalid"]]: isLarge && onCherry,
|
|
31
23
|
[radioButtonStyles["radio-button-wrapper__large--on-blueberry"]]: isLarge && onBlueberry
|
|
32
24
|
});
|
|
@@ -36,16 +28,11 @@ const RadioButton = (props) => {
|
|
|
36
28
|
[radioButtonStyles["radio-button-label--invalid"]]: invalid,
|
|
37
29
|
[radioButtonStyles["radio-button-label__large"]]: isLarge,
|
|
38
30
|
[radioButtonStyles["radio-button-label__large--disabled"]]: isLarge && disabled,
|
|
39
|
-
[radioButtonStyles["radio-button-label__large--on-grey"]]: isLarge && onGrey
|
|
40
|
-
[radioButtonStyles["radio-button-label__large--on-blueberry"]]: isLarge && onBlueberry
|
|
41
|
-
[radioButtonStyles["radio-button-label__large--
|
|
42
|
-
[radioButtonStyles["radio-button-label__large--selected-invalid"]]: isLarge && isChecked && onCherry
|
|
31
|
+
[radioButtonStyles["radio-button-label__large--on-grey"]]: isLarge && onGrey,
|
|
32
|
+
[radioButtonStyles["radio-button-label__large--on-blueberry"]]: isLarge && onBlueberry,
|
|
33
|
+
[radioButtonStyles["radio-button-label__large--invalid"]]: isLarge && onCherry
|
|
43
34
|
}, labelClassNames);
|
|
44
35
|
const radioButtonClasses = classNames(radioButtonStyles["radio-button"], className);
|
|
45
|
-
const change = (e) => {
|
|
46
|
-
setIsChecked(e.target.checked);
|
|
47
|
-
if (onChange) onChange(e);
|
|
48
|
-
};
|
|
49
36
|
const getLabelContent = () => /* @__PURE__ */ jsxs("span", {
|
|
50
37
|
className: radioButtonStyles["radio-button__marker-wrapper"],
|
|
51
38
|
children: [/* @__PURE__ */ jsx("input", {
|
|
@@ -60,9 +47,8 @@ const RadioButton = (props) => {
|
|
|
60
47
|
defaultChecked,
|
|
61
48
|
"aria-describedby": getAriaDescribedBy(props, errorTextId),
|
|
62
49
|
required,
|
|
63
|
-
onChange
|
|
50
|
+
onChange
|
|
64
51
|
}), /* @__PURE__ */ jsx(RadioMarker_default, {
|
|
65
|
-
checked: isChecked,
|
|
66
52
|
disabled,
|
|
67
53
|
error: invalid,
|
|
68
54
|
onColor,
|
package/lib/RadioButton.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioButton.js","names":["RadioButton: React.FC<RadioButtonProps>"],"sources":["../src/components/RadioButton/RadioButton.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"RadioButton.js","names":["RadioButton: React.FC<RadioButtonProps>"],"sources":["../src/components/RadioButton/RadioButton.tsx"],"sourcesContent":["import classNames from 'classnames';\n\nimport type { ErrorWrapperClassNameProps } from '../ErrorWrapper';\n\nimport RadioMarker from './RadioMarker/RadioMarker';\nimport { AnalyticsId, FormOnColor, FormSize } from '../../constants';\nimport { useIdWithFallback } from '../../hooks/useIdWithFallback';\nimport { getAriaDescribedBy } from '../../utils/accessibility';\nimport { uuid } from '../../utils/uuid';\nimport ErrorWrapper from '../ErrorWrapper';\nimport { getLabelText, renderLabelAsParent } from '../Label/utils';\n\nimport radioButtonStyles from './styles.module.scss';\n\nexport interface RadioButtonProps\n extends\n ErrorWrapperClassNameProps,\n Pick<\n React.InputHTMLAttributes<HTMLInputElement>,\n 'aria-describedby' | 'name' | 'value' | 'disabled' | 'checked' | 'defaultChecked' | 'required' | 'onChange'\n > {\n /** Adds custom classes to the element. */\n className?: string;\n /** The <Label/> next to the radioButton - sublabels kan ikke kombineres med large variant */\n label: React.ReactNode;\n /** Adds custom classes to the label element. */\n labelClassNames?: string;\n /** input id of the radioButton */\n inputId?: string;\n /** Changes the visuals of the radioButton */\n onColor?: keyof typeof FormOnColor;\n /** Changes the visuals of the radioButton. Large version only works when used inside a FormGroup wrapper. */\n size?: keyof typeof FormSize;\n /** Activates Error style for the radioButton - This is can be true while errorText is empty, when in a FormGroup */\n error?: boolean;\n /** Error text to show above the component */\n errorText?: string;\n /** Error text id */\n errorTextId?: string;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Ref passed to the input element */\n ref?: React.Ref<HTMLInputElement | null>;\n}\n\nexport const RadioButton: React.FC<RadioButtonProps> = props => {\n const {\n className,\n defaultChecked,\n onChange,\n disabled,\n label,\n inputId = uuid(),\n onColor = FormOnColor.onwhite,\n name = inputId,\n size,\n errorText,\n errorTextId: errorTextIdProp,\n error = !!errorText,\n errorWrapperClassName,\n value = getLabelText(label),\n testId,\n required,\n labelClassNames,\n ref,\n ...rest\n } = props;\n const invalid = error || onColor === FormOnColor.oninvalid;\n const onDark = onColor === FormOnColor.ondark;\n const onGrey = onColor === FormOnColor.ongrey;\n const onBlueberry = onColor === FormOnColor.onblueberry;\n const onCherry = onColor === FormOnColor.oninvalid;\n const isLarge = size === FormSize.large;\n\n const errorTextId = useIdWithFallback(errorTextIdProp);\n\n const radioButtonWrapperClasses = classNames(radioButtonStyles['radio-button-wrapper'], {\n [radioButtonStyles['radio-button-wrapper__large']]: isLarge,\n [radioButtonStyles['radio-button-wrapper__large--invalid']]: isLarge && onCherry,\n [radioButtonStyles['radio-button-wrapper__large--on-blueberry']]: isLarge && onBlueberry,\n });\n const radioButtonLabelClasses = classNames(\n radioButtonStyles['radio-button-label'],\n {\n [radioButtonStyles['radio-button-label--disabled']]: disabled,\n [radioButtonStyles['radio-button-label--on-dark']]: onDark,\n [radioButtonStyles['radio-button-label--invalid']]: invalid,\n [radioButtonStyles['radio-button-label__large']]: isLarge,\n [radioButtonStyles['radio-button-label__large--disabled']]: isLarge && disabled,\n [radioButtonStyles['radio-button-label__large--on-grey']]: isLarge && onGrey,\n [radioButtonStyles['radio-button-label__large--on-blueberry']]: isLarge && onBlueberry,\n [radioButtonStyles['radio-button-label__large--invalid']]: isLarge && onCherry,\n },\n labelClassNames\n );\n const radioButtonClasses = classNames(radioButtonStyles['radio-button'], className);\n\n const getLabelContent = (): React.ReactNode => (\n <span className={radioButtonStyles['radio-button__marker-wrapper']}>\n <input\n {...rest}\n id={inputId}\n name={name}\n className={radioButtonClasses}\n type=\"radio\"\n disabled={disabled}\n value={value}\n ref={ref}\n defaultChecked={defaultChecked}\n aria-describedby={getAriaDescribedBy(props, errorTextId)}\n required={required}\n onChange={onChange}\n />\n <RadioMarker disabled={disabled} error={invalid} onColor={onColor} size={size} />\n </span>\n );\n\n return (\n <ErrorWrapper className={errorWrapperClassName} errorText={errorText} errorTextId={errorTextId}>\n <div data-testid={testId} data-analyticsid={AnalyticsId.RadioButton} className={radioButtonWrapperClasses}>\n {renderLabelAsParent({\n label: label,\n children: getLabelContent(),\n inputId: inputId,\n onColor: onColor as FormOnColor,\n labelClassName: radioButtonLabelClasses,\n sublabelWrapperClassName: radioButtonStyles['radiobutton-sublabel-wrapper'],\n large: isLarge,\n afterLabelChildrenClassName: radioButtonStyles['radiobutton-afterlabelchildren-wrapper'],\n })}\n </div>\n </ErrorWrapper>\n );\n};\n\nRadioButton.displayName = 'RadioButton';\n\nexport default RadioButton;\n"],"mappings":";;;;;;;;;;AA6CA,MAAaA,eAA0C,UAAS;CAC9D,MAAM,EACJ,WACA,gBACA,UACA,UACA,OACA,UAAU,MAAM,EAChB,UAAU,YAAY,SACtB,OAAO,SACP,MACA,WACA,aAAa,iBACb,QAAQ,CAAC,CAAC,WACV,uBACA,QAAQ,aAAa,MAAM,EAC3B,QACA,UACA,iBACA,KACA,GAAG,SACD;CACJ,MAAM,UAAU,SAAS,YAAY,YAAY;CACjD,MAAM,SAAS,YAAY,YAAY;CACvC,MAAM,SAAS,YAAY,YAAY;CACvC,MAAM,cAAc,YAAY,YAAY;CAC5C,MAAM,WAAW,YAAY,YAAY;CACzC,MAAM,UAAU,SAAS,SAAS;CAElC,MAAM,cAAc,kBAAkB,gBAAgB;CAEtD,MAAM,4BAA4B,WAAW,kBAAkB,yBAAyB;GACrF,kBAAkB,iCAAiC;GACnD,kBAAkB,0CAA0C,WAAW;GACvE,kBAAkB,+CAA+C,WAAW;EAC9E,CAAC;CACF,MAAM,0BAA0B,WAC9B,kBAAkB,uBAClB;GACG,kBAAkB,kCAAkC;GACpD,kBAAkB,iCAAiC;GACnD,kBAAkB,iCAAiC;GACnD,kBAAkB,+BAA+B;GACjD,kBAAkB,yCAAyC,WAAW;GACtE,kBAAkB,wCAAwC,WAAW;GACrE,kBAAkB,6CAA6C,WAAW;GAC1E,kBAAkB,wCAAwC,WAAW;EACvE,EACD,gBACD;CACD,MAAM,qBAAqB,WAAW,kBAAkB,iBAAiB,UAAU;CAEnF,MAAM,wBACJ,qBAAC,QAAA;EAAK,WAAW,kBAAkB;aACjC,oBAAC,SAAA;GACC,GAAI;GACJ,IAAI;GACE;GACN,WAAW;GACX,MAAK;GACK;GACH;GACF;GACW;GAChB,oBAAkB,mBAAmB,OAAO,YAAY;GAC9C;GACA;IACV,EACF,oBAAC,qBAAA;GAAsB;GAAU,OAAO;GAAkB;GAAe;IAAQ,CAAA;GAC5E;AAGT,QACE,oBAAC,sBAAA;EAAa,WAAW;EAAkC;EAAwB;YACjF,oBAAC,OAAA;GAAI,eAAa;GAAQ,oBAAkB,YAAY;GAAa,WAAW;aAC7E,oBAAoB;IACZ;IACP,UAAU,iBAAiB;IAClB;IACA;IACT,gBAAgB;IAChB,0BAA0B,kBAAkB;IAC5C,OAAO;IACP,6BAA6B,kBAAkB;IAChD,CAAC;IACE;GACO;;AAInB,YAAY,cAAc;AAE1B,IAAA,sBAAe"}
|
package/lib/RadioMarker.js
CHANGED
|
@@ -11,7 +11,7 @@ const RadioMarker = (props) => {
|
|
|
11
11
|
const onDark = onColor === FormOnColor.ondark;
|
|
12
12
|
const large = size === FormSize.large;
|
|
13
13
|
return /* @__PURE__ */ jsx("span", {
|
|
14
|
-
className: classNames(styles["radio__marker"], {
|
|
14
|
+
className: classNames(styles["radio__marker"], large ? styles["radio__marker__large"] : styles["radio__marker__regular"], {
|
|
15
15
|
[styles["radio__marker--on-white"]]: onWhite,
|
|
16
16
|
[styles["radio__marker--on-grey"]]: onGrey,
|
|
17
17
|
[styles["radio__marker--on-blueberry"]]: onBlueberry,
|
|
@@ -19,16 +19,10 @@ const RadioMarker = (props) => {
|
|
|
19
19
|
[styles["radio__marker--on-invalid"]]: onInvalid,
|
|
20
20
|
[styles["radio__marker--invalid"]]: onInvalid,
|
|
21
21
|
[styles["radio__marker--disabled"]]: disabled,
|
|
22
|
-
[styles["
|
|
23
|
-
[styles["radio__marker__regular--checked--invalid"]]: !large && checked && onInvalid,
|
|
24
|
-
[styles["radio__marker__regular--checked--on-dark"]]: !large && checked && onDark,
|
|
25
|
-
[styles["radio__marker__regular--checked--disabled"]]: !large && checked && disabled,
|
|
26
|
-
[styles["radio__marker__large--checked"]]: large && checked,
|
|
27
|
-
[styles["radio__marker__large--checked--invalid"]]: large && checked && onInvalid,
|
|
28
|
-
[styles["radio__marker__large--checked--disabled"]]: large && checked && disabled
|
|
22
|
+
[styles["radio__marker--checked"]]: checked
|
|
29
23
|
}, className),
|
|
30
24
|
"aria-hidden": "true",
|
|
31
|
-
children:
|
|
25
|
+
children: /* @__PURE__ */ jsx("span", { className: styles["radio__marker-dot"] })
|
|
32
26
|
});
|
|
33
27
|
};
|
|
34
28
|
var RadioMarker_default = RadioMarker;
|
package/lib/RadioMarker.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioMarker.js","names":["RadioMarker: React.FC<RadioMarkerProps>"],"sources":["../src/components/RadioButton/RadioMarker/RadioMarker.tsx"],"sourcesContent":["import classNames from 'classnames';\n\nimport { FormOnColor, FormSize } from '../../../constants';\n\nimport styles from './styles.module.scss';\n\nexport interface RadioMarkerProps {\n /** Whether the radio is checked. Controls the inner dot visibility. */\n checked?: boolean;\n /** Disables the visual state of the marker. */\n disabled?: boolean;\n /** Activates error styling. */\n error?: boolean;\n /** Background context the marker is rendered on. */\n onColor?: keyof typeof FormOnColor;\n /** Size variant of the marker. */\n size?: keyof typeof FormSize;\n /** Adds custom classes to the marker wrapper. */\n className?: string;\n}\n\n/**\n * Does not render an <input>; consumers render this on their end.\n */\nexport const RadioMarker: React.FC<RadioMarkerProps> = props => {\n const { checked = false, disabled = false, error = false, onColor = FormOnColor.onwhite, size, className } = props;\n\n const onWhite = onColor === FormOnColor.onwhite;\n const onGrey = onColor === FormOnColor.ongrey;\n const onBlueberry = onColor === FormOnColor.onblueberry;\n const onInvalid = error || onColor === FormOnColor.oninvalid;\n const onDark = onColor === FormOnColor.ondark;\n const large = size === FormSize.large;\n\n const markerClasses = classNames(\n styles['radio__marker'],\n {\n [styles['radio__marker--on-white']]: onWhite,\n [styles['radio__marker--on-grey']]: onGrey,\n [styles['radio__marker--on-blueberry']]: onBlueberry,\n [styles['radio__marker--on-dark']]: onDark,\n [styles['radio__marker--on-invalid']]: onInvalid,\n [styles['radio__marker--invalid']]: onInvalid,\n [styles['radio__marker--disabled']]: disabled,\n [styles['
|
|
1
|
+
{"version":3,"file":"RadioMarker.js","names":["RadioMarker: React.FC<RadioMarkerProps>"],"sources":["../src/components/RadioButton/RadioMarker/RadioMarker.tsx"],"sourcesContent":["import classNames from 'classnames';\n\nimport { FormOnColor, FormSize } from '../../../constants';\n\nimport styles from './styles.module.scss';\n\nexport interface RadioMarkerProps {\n /** Whether the radio is checked. Controls the inner dot visibility. */\n checked?: boolean;\n /** Disables the visual state of the marker. */\n disabled?: boolean;\n /** Activates error styling. */\n error?: boolean;\n /** Background context the marker is rendered on. */\n onColor?: keyof typeof FormOnColor;\n /** Size variant of the marker. */\n size?: keyof typeof FormSize;\n /** Adds custom classes to the marker wrapper. */\n className?: string;\n}\n\n/**\n * Does not render an <input>; consumers render this on their end.\n */\nexport const RadioMarker: React.FC<RadioMarkerProps> = props => {\n const { checked = false, disabled = false, error = false, onColor = FormOnColor.onwhite, size, className } = props;\n\n const onWhite = onColor === FormOnColor.onwhite;\n const onGrey = onColor === FormOnColor.ongrey;\n const onBlueberry = onColor === FormOnColor.onblueberry;\n const onInvalid = error || onColor === FormOnColor.oninvalid;\n const onDark = onColor === FormOnColor.ondark;\n const large = size === FormSize.large;\n\n const markerClasses = classNames(\n styles['radio__marker'],\n large ? styles['radio__marker__large'] : styles['radio__marker__regular'],\n {\n [styles['radio__marker--on-white']]: onWhite,\n [styles['radio__marker--on-grey']]: onGrey,\n [styles['radio__marker--on-blueberry']]: onBlueberry,\n [styles['radio__marker--on-dark']]: onDark,\n [styles['radio__marker--on-invalid']]: onInvalid,\n [styles['radio__marker--invalid']]: onInvalid,\n [styles['radio__marker--disabled']]: disabled,\n [styles['radio__marker--checked']]: checked,\n },\n className\n );\n\n return (\n <span className={markerClasses} aria-hidden=\"true\">\n <span className={styles['radio__marker-dot']} />\n </span>\n );\n};\n\nexport default RadioMarker;\n"],"mappings":";;;;AAwBA,MAAaA,eAA0C,UAAS;CAC9D,MAAM,EAAE,UAAU,OAAO,WAAW,OAAO,QAAQ,OAAO,UAAU,YAAY,SAAS,MAAM,cAAc;CAE7G,MAAM,UAAU,YAAY,YAAY;CACxC,MAAM,SAAS,YAAY,YAAY;CACvC,MAAM,cAAc,YAAY,YAAY;CAC5C,MAAM,YAAY,SAAS,YAAY,YAAY;CACnD,MAAM,SAAS,YAAY,YAAY;CACvC,MAAM,QAAQ,SAAS,SAAS;AAkBhC,QACE,oBAAC,QAAA;EAAK,WAjBc,WACpB,OAAO,kBACP,QAAQ,OAAO,0BAA0B,OAAO,2BAChD;IACG,OAAO,6BAA6B;IACpC,OAAO,4BAA4B;IACnC,OAAO,iCAAiC;IACxC,OAAO,4BAA4B;IACnC,OAAO,+BAA+B;IACtC,OAAO,4BAA4B;IACnC,OAAO,6BAA6B;IACpC,OAAO,4BAA4B;GACrC,EACD,UACD;EAGiC,eAAY;YAC1C,oBAAC,QAAA,EAAK,WAAW,OAAO,sBAAA,CAAwB;GAC3C;;AAIX,IAAA,sBAAe"}
|
package/lib/Search.js
CHANGED
|
@@ -9,13 +9,13 @@ var Search = ({ size, isHovered }) => {
|
|
|
9
9
|
xSmall: /* @__PURE__ */ jsx("path", { d: "M34.476 34.206c-.486.487-1.333.487-1.82 0l-4.402-4.403a10.426 10.426 0 001.78-1.857l4.442 4.44c.243.243.376.567.376.91 0 .345-.133.668-.376.91M21.742 30.07c-4.592 0-8.327-3.737-8.327-8.327 0-4.592 3.735-8.327 8.327-8.327 4.591 0 8.327 3.735 8.327 8.327 0 4.59-3.736 8.327-8.327 8.327m14.181.871l-4.8-4.8c.63-1.338.991-2.825.991-4.398 0-5.72-4.653-10.374-10.372-10.374-5.72 0-10.374 4.653-10.374 10.374 0 5.72 4.653 10.372 10.374 10.372 1.717 0 3.333-.426 4.76-1.168l4.708 4.708a3.312 3.312 0 002.357.976c.89 0 1.727-.348 2.356-.976a3.339 3.339 0 000-4.714" }),
|
|
10
10
|
xSmallHover: /* @__PURE__ */ jsx("path", { d: "M34.7 34.43c-.486.485-1.338.487-1.823 0l-3.388-3.39c.663-.55 1.255-1.18 1.785-1.859l3.426 3.424c.244.242.377.567.377.911 0 .346-.133.669-.377.914m-12.76-2.994c-5.238 0-9.5-4.26-9.5-9.499 0-5.238 4.262-9.499 9.5-9.499 5.237 0 9.498 4.261 9.498 9.5 0 5.237-4.26 9.498-9.499 9.498m14.21-.28l-3.734-3.736a11.744 11.744 0 001.356-5.483c0-6.524-5.31-11.832-11.832-11.832-6.524 0-11.834 5.308-11.834 11.832 0 6.525 5.31 11.834 11.834 11.834 2.12 0 4.108-.57 5.831-1.55l3.656 3.658c.633.63 1.47.979 2.362.979.893 0 1.732-.348 2.36-.98.632-.63.98-1.467.98-2.362 0-.89-.348-1.73-.98-2.36" }),
|
|
11
11
|
xxSmall: /* @__PURE__ */ jsx("path", {
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
fillRule: "evenodd",
|
|
13
|
+
clipRule: "evenodd",
|
|
14
14
|
d: "M20.1738 6.88672C27.4533 6.88672 33.3765 12.8075 33.377 20.0879C33.377 22.0407 32.934 23.8871 32.1699 25.5547L38.0918 31.4785C39.7973 33.1852 39.7973 35.9613 38.0918 37.668C37.2652 38.4933 36.1671 38.9509 34.998 38.9512C33.8287 38.9512 32.7281 38.4937 31.9023 37.668L26.1016 31.8672C24.3175 32.7694 22.3071 33.291 20.1738 33.291C12.8934 33.2906 6.97266 27.3673 6.97266 20.0879C6.97311 12.8077 12.8937 6.88717 20.1738 6.88672ZM33.9766 35.8223C34.0595 35.8891 34.1486 35.9464 34.2422 35.9941L34.1055 35.9141C34.0613 35.8856 34.0179 35.8555 33.9766 35.8223ZM30.5879 28.166C30.0088 28.9128 29.3558 29.5973 28.6309 30.2051L34 35.5742C34.5316 36.105 35.4668 36.1054 35.998 35.5742C36.2647 35.3076 36.4102 34.9522 36.4102 34.5742C36.4099 34.1967 36.264 33.8424 35.998 33.5762L30.5879 28.166ZM12.3984 30.5039C12.4725 30.5593 12.5498 30.6102 12.625 30.6641C12.3803 30.4889 12.1399 30.3085 11.9082 30.1172L12.3984 30.5039ZM20.1758 9.85156C14.5314 9.85197 9.93993 14.4435 9.93945 20.0879C9.93945 25.7316 14.5311 30.3258 20.1758 30.3262C25.8208 30.3262 30.4141 25.7318 30.4141 20.0879C30.4136 14.4432 25.8205 9.85156 20.1758 9.85156ZM24.2363 29.7051C24.392 29.6391 24.5456 29.5693 24.6973 29.4961C24.3933 29.6428 24.0811 29.7753 23.7617 29.8926L24.2363 29.7051ZM30.4199 18.0801C30.5472 18.7301 30.6152 19.4012 30.6152 20.0879L30.6016 19.5527C30.5761 19.0518 30.5139 18.5601 30.4199 18.0801ZM30.5898 12.3145C30.6024 12.3312 30.6145 12.3484 30.627 12.3652C30.4902 12.1806 30.3492 11.9993 30.2031 11.8223L30.5898 12.3145ZM23.2754 10.1211C24.0922 10.3756 24.8663 10.7276 25.584 11.1641L25.1484 10.9121C24.5564 10.59 23.9293 10.3248 23.2754 10.1211Z"
|
|
15
15
|
}),
|
|
16
16
|
xxSmallHover: /* @__PURE__ */ jsx("path", {
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
fillRule: "evenodd",
|
|
18
|
+
clipRule: "evenodd",
|
|
19
19
|
d: "M20.0664 5.13281C28.324 5.13306 35.0464 11.8511 35.0469 20.1113C35.0469 22.5634 34.442 24.8729 33.3926 26.918L37.957 31.4863C38.7823 32.3116 39.2383 33.4111 39.2383 34.5762C39.2382 35.7464 38.7821 36.8427 37.957 37.668C37.1342 38.4934 36.0347 38.9492 34.8672 38.9492C33.6999 38.9491 32.6029 38.4943 31.7754 37.6699L27.3105 33.2031C25.1607 34.3979 22.6954 35.0956 20.0664 35.0957C11.806 35.0954 5.08398 28.3719 5.08398 20.1113C5.08443 11.8511 11.8063 5.13314 20.0664 5.13281ZM31.7402 29.459C31.1525 30.1928 30.5023 30.8761 29.7871 31.4902L33.8711 35.5762C34.3983 36.1051 35.3349 36.1032 35.8633 35.5762C36.1311 35.3083 36.2772 34.9554 36.2773 34.5762C36.2773 34.1993 36.132 33.8448 35.8652 33.5801L31.7402 29.459ZM26.5273 33.3926C25.4214 33.9344 24.2397 34.3442 23.002 34.5977C23.3028 34.5361 23.6006 34.4664 23.8945 34.3867C25.1149 34.0558 26.2734 33.5714 27.3496 32.959C27.0807 33.112 26.8062 33.256 26.5273 33.3926ZM38.0957 31.9355C38.3575 32.2543 38.5693 32.6057 38.7246 32.9805C38.5174 32.4804 38.2105 32.0211 37.8164 31.627L38.0957 31.9355ZM20.0664 8.44531C13.6343 8.44564 8.40039 13.6791 8.40039 20.1113C8.40058 26.5434 13.6344 31.777 20.0664 31.7773C26.4984 31.777 31.7322 26.5434 31.7324 20.1113C31.7324 13.6791 26.4985 8.44568 20.0664 8.44531ZM17.6777 8.48633C16.327 8.76346 15.0598 9.27215 13.918 9.9668C14.7339 9.47055 15.6142 9.07065 16.543 8.78125C16.9139 8.66566 17.2923 8.56542 17.6777 8.48633ZM22.4551 8.48828C22.6482 8.52791 22.8397 8.57217 23.0293 8.62109C22.6501 8.52325 22.2639 8.443 21.8711 8.38281L22.4551 8.48828ZM20.0664 8.24609C19.6577 8.24609 19.2537 8.2661 18.8555 8.30664L19.457 8.26172C19.6589 8.25145 19.862 8.2461 20.0664 8.24609Z"
|
|
20
20
|
})
|
|
21
21
|
});
|
package/lib/Search.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Search.js","names":["Search: React.FC<SvgPathProps>"],"sources":["../src/components/Icons/Search.tsx"],"sourcesContent":["import type { SvgPathProps } from '../Icon';\n\nimport { getIcon } from '../Icon/utils';\n\nconst Search: React.FC<SvgPathProps> = ({ size, isHovered }: SvgPathProps): React.ReactElement => {\n const normal = (\n <path d=\"M21.277 7.738c7.27 0 13.165 5.895 13.165 13.166 0 2.222-.55 4.316-1.523 6.153l6.268 6.268a3.929 3.929 0 01-5.41 5.695l-.146-.139-6.289-6.289a13.11 13.11 0 01-6.065 1.478c-7.272 0-13.166-5.895-13.166-13.166 0-7.271 5.894-13.166 13.166-13.166zM32 28.542a13.24 13.24 0 01-3.164 3.142l5.996 5.995a2.229 2.229 0 003.26-3.036l-.108-.116zM21.277 9.438c-6.333 0-11.466 5.133-11.466 11.466 0 6.332 5.133 11.466 11.466 11.466 2.258 0 4.365-.654 6.14-1.781l.163-.163.034.035a11.529 11.529 0 003.165-3.14l-.047-.048.228-.226a11.412 11.412 0 001.782-6.143c0-6.333-5.133-11.466-11.465-11.466z\" />\n );\n\n const normalHover = (\n <path d=\"M21.527 6.932c7.932 0 14.363 6.43 14.363 14.362 0 2.556-.668 4.956-1.838 7.035l5.386 5.386a3.929 3.929 0 01-5.41 5.696l-.146-.14-5.406-5.404a14.298 14.298 0 01-6.949 1.79c-7.932 0-14.362-6.43-14.362-14.363 0-7.932 6.43-14.362 14.362-14.362zM33.11 29.79a14.445 14.445 0 01-3.162 3.141l5.137 5.138a2.229 2.229 0 003.26-3.035l-.108-.117zM21.527 8.632c-6.993 0-12.662 5.669-12.662 12.662 0 6.993 5.669 12.663 12.662 12.663 6.993 0 12.663-5.67 12.663-12.663S28.52 8.632 21.527 8.632z\" />\n );\n\n const xSmall = (\n <path d=\"M34.476 34.206c-.486.487-1.333.487-1.82 0l-4.402-4.403a10.426 10.426 0 001.78-1.857l4.442 4.44c.243.243.376.567.376.91 0 .345-.133.668-.376.91M21.742 30.07c-4.592 0-8.327-3.737-8.327-8.327 0-4.592 3.735-8.327 8.327-8.327 4.591 0 8.327 3.735 8.327 8.327 0 4.59-3.736 8.327-8.327 8.327m14.181.871l-4.8-4.8c.63-1.338.991-2.825.991-4.398 0-5.72-4.653-10.374-10.372-10.374-5.72 0-10.374 4.653-10.374 10.374 0 5.72 4.653 10.372 10.374 10.372 1.717 0 3.333-.426 4.76-1.168l4.708 4.708a3.312 3.312 0 002.357.976c.89 0 1.727-.348 2.356-.976a3.339 3.339 0 000-4.714\" />\n );\n\n const xSmallHover = (\n <path d=\"M34.7 34.43c-.486.485-1.338.487-1.823 0l-3.388-3.39c.663-.55 1.255-1.18 1.785-1.859l3.426 3.424c.244.242.377.567.377.911 0 .346-.133.669-.377.914m-12.76-2.994c-5.238 0-9.5-4.26-9.5-9.499 0-5.238 4.262-9.499 9.5-9.499 5.237 0 9.498 4.261 9.498 9.5 0 5.237-4.26 9.498-9.499 9.498m14.21-.28l-3.734-3.736a11.744 11.744 0 001.356-5.483c0-6.524-5.31-11.832-11.832-11.832-6.524 0-11.834 5.308-11.834 11.832 0 6.525 5.31 11.834 11.834 11.834 2.12 0 4.108-.57 5.831-1.55l3.656 3.658c.633.63 1.47.979 2.362.979.893 0 1.732-.348 2.36-.98.632-.63.98-1.467.98-2.362 0-.89-.348-1.73-.98-2.36\" />\n );\n\n const xxSmall = (\n <path\n
|
|
1
|
+
{"version":3,"file":"Search.js","names":["Search: React.FC<SvgPathProps>"],"sources":["../src/components/Icons/Search.tsx"],"sourcesContent":["import type { SvgPathProps } from '../Icon';\n\nimport { getIcon } from '../Icon/utils';\n\nconst Search: React.FC<SvgPathProps> = ({ size, isHovered }: SvgPathProps): React.ReactElement => {\n const normal = (\n <path d=\"M21.277 7.738c7.27 0 13.165 5.895 13.165 13.166 0 2.222-.55 4.316-1.523 6.153l6.268 6.268a3.929 3.929 0 01-5.41 5.695l-.146-.139-6.289-6.289a13.11 13.11 0 01-6.065 1.478c-7.272 0-13.166-5.895-13.166-13.166 0-7.271 5.894-13.166 13.166-13.166zM32 28.542a13.24 13.24 0 01-3.164 3.142l5.996 5.995a2.229 2.229 0 003.26-3.036l-.108-.116zM21.277 9.438c-6.333 0-11.466 5.133-11.466 11.466 0 6.332 5.133 11.466 11.466 11.466 2.258 0 4.365-.654 6.14-1.781l.163-.163.034.035a11.529 11.529 0 003.165-3.14l-.047-.048.228-.226a11.412 11.412 0 001.782-6.143c0-6.333-5.133-11.466-11.465-11.466z\" />\n );\n\n const normalHover = (\n <path d=\"M21.527 6.932c7.932 0 14.363 6.43 14.363 14.362 0 2.556-.668 4.956-1.838 7.035l5.386 5.386a3.929 3.929 0 01-5.41 5.696l-.146-.14-5.406-5.404a14.298 14.298 0 01-6.949 1.79c-7.932 0-14.362-6.43-14.362-14.363 0-7.932 6.43-14.362 14.362-14.362zM33.11 29.79a14.445 14.445 0 01-3.162 3.141l5.137 5.138a2.229 2.229 0 003.26-3.035l-.108-.117zM21.527 8.632c-6.993 0-12.662 5.669-12.662 12.662 0 6.993 5.669 12.663 12.662 12.663 6.993 0 12.663-5.67 12.663-12.663S28.52 8.632 21.527 8.632z\" />\n );\n\n const xSmall = (\n <path d=\"M34.476 34.206c-.486.487-1.333.487-1.82 0l-4.402-4.403a10.426 10.426 0 001.78-1.857l4.442 4.44c.243.243.376.567.376.91 0 .345-.133.668-.376.91M21.742 30.07c-4.592 0-8.327-3.737-8.327-8.327 0-4.592 3.735-8.327 8.327-8.327 4.591 0 8.327 3.735 8.327 8.327 0 4.59-3.736 8.327-8.327 8.327m14.181.871l-4.8-4.8c.63-1.338.991-2.825.991-4.398 0-5.72-4.653-10.374-10.372-10.374-5.72 0-10.374 4.653-10.374 10.374 0 5.72 4.653 10.372 10.374 10.372 1.717 0 3.333-.426 4.76-1.168l4.708 4.708a3.312 3.312 0 002.357.976c.89 0 1.727-.348 2.356-.976a3.339 3.339 0 000-4.714\" />\n );\n\n const xSmallHover = (\n <path d=\"M34.7 34.43c-.486.485-1.338.487-1.823 0l-3.388-3.39c.663-.55 1.255-1.18 1.785-1.859l3.426 3.424c.244.242.377.567.377.911 0 .346-.133.669-.377.914m-12.76-2.994c-5.238 0-9.5-4.26-9.5-9.499 0-5.238 4.262-9.499 9.5-9.499 5.237 0 9.498 4.261 9.498 9.5 0 5.237-4.26 9.498-9.499 9.498m14.21-.28l-3.734-3.736a11.744 11.744 0 001.356-5.483c0-6.524-5.31-11.832-11.832-11.832-6.524 0-11.834 5.308-11.834 11.832 0 6.525 5.31 11.834 11.834 11.834 2.12 0 4.108-.57 5.831-1.55l3.656 3.658c.633.63 1.47.979 2.362.979.893 0 1.732-.348 2.36-.98.632-.63.98-1.467.98-2.362 0-.89-.348-1.73-.98-2.36\" />\n );\n\n const xxSmall = (\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M20.1738 6.88672C27.4533 6.88672 33.3765 12.8075 33.377 20.0879C33.377 22.0407 32.934 23.8871 32.1699 25.5547L38.0918 31.4785C39.7973 33.1852 39.7973 35.9613 38.0918 37.668C37.2652 38.4933 36.1671 38.9509 34.998 38.9512C33.8287 38.9512 32.7281 38.4937 31.9023 37.668L26.1016 31.8672C24.3175 32.7694 22.3071 33.291 20.1738 33.291C12.8934 33.2906 6.97266 27.3673 6.97266 20.0879C6.97311 12.8077 12.8937 6.88717 20.1738 6.88672ZM33.9766 35.8223C34.0595 35.8891 34.1486 35.9464 34.2422 35.9941L34.1055 35.9141C34.0613 35.8856 34.0179 35.8555 33.9766 35.8223ZM30.5879 28.166C30.0088 28.9128 29.3558 29.5973 28.6309 30.2051L34 35.5742C34.5316 36.105 35.4668 36.1054 35.998 35.5742C36.2647 35.3076 36.4102 34.9522 36.4102 34.5742C36.4099 34.1967 36.264 33.8424 35.998 33.5762L30.5879 28.166ZM12.3984 30.5039C12.4725 30.5593 12.5498 30.6102 12.625 30.6641C12.3803 30.4889 12.1399 30.3085 11.9082 30.1172L12.3984 30.5039ZM20.1758 9.85156C14.5314 9.85197 9.93993 14.4435 9.93945 20.0879C9.93945 25.7316 14.5311 30.3258 20.1758 30.3262C25.8208 30.3262 30.4141 25.7318 30.4141 20.0879C30.4136 14.4432 25.8205 9.85156 20.1758 9.85156ZM24.2363 29.7051C24.392 29.6391 24.5456 29.5693 24.6973 29.4961C24.3933 29.6428 24.0811 29.7753 23.7617 29.8926L24.2363 29.7051ZM30.4199 18.0801C30.5472 18.7301 30.6152 19.4012 30.6152 20.0879L30.6016 19.5527C30.5761 19.0518 30.5139 18.5601 30.4199 18.0801ZM30.5898 12.3145C30.6024 12.3312 30.6145 12.3484 30.627 12.3652C30.4902 12.1806 30.3492 11.9993 30.2031 11.8223L30.5898 12.3145ZM23.2754 10.1211C24.0922 10.3756 24.8663 10.7276 25.584 11.1641L25.1484 10.9121C24.5564 10.59 23.9293 10.3248 23.2754 10.1211Z\"\n />\n );\n\n const xxSmallHover = (\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M20.0664 5.13281C28.324 5.13306 35.0464 11.8511 35.0469 20.1113C35.0469 22.5634 34.442 24.8729 33.3926 26.918L37.957 31.4863C38.7823 32.3116 39.2383 33.4111 39.2383 34.5762C39.2382 35.7464 38.7821 36.8427 37.957 37.668C37.1342 38.4934 36.0347 38.9492 34.8672 38.9492C33.6999 38.9491 32.6029 38.4943 31.7754 37.6699L27.3105 33.2031C25.1607 34.3979 22.6954 35.0956 20.0664 35.0957C11.806 35.0954 5.08398 28.3719 5.08398 20.1113C5.08443 11.8511 11.8063 5.13314 20.0664 5.13281ZM31.7402 29.459C31.1525 30.1928 30.5023 30.8761 29.7871 31.4902L33.8711 35.5762C34.3983 36.1051 35.3349 36.1032 35.8633 35.5762C36.1311 35.3083 36.2772 34.9554 36.2773 34.5762C36.2773 34.1993 36.132 33.8448 35.8652 33.5801L31.7402 29.459ZM26.5273 33.3926C25.4214 33.9344 24.2397 34.3442 23.002 34.5977C23.3028 34.5361 23.6006 34.4664 23.8945 34.3867C25.1149 34.0558 26.2734 33.5714 27.3496 32.959C27.0807 33.112 26.8062 33.256 26.5273 33.3926ZM38.0957 31.9355C38.3575 32.2543 38.5693 32.6057 38.7246 32.9805C38.5174 32.4804 38.2105 32.0211 37.8164 31.627L38.0957 31.9355ZM20.0664 8.44531C13.6343 8.44564 8.40039 13.6791 8.40039 20.1113C8.40058 26.5434 13.6344 31.777 20.0664 31.7773C26.4984 31.777 31.7322 26.5434 31.7324 20.1113C31.7324 13.6791 26.4985 8.44568 20.0664 8.44531ZM17.6777 8.48633C16.327 8.76346 15.0598 9.27215 13.918 9.9668C14.7339 9.47055 15.6142 9.07065 16.543 8.78125C16.9139 8.66566 17.2923 8.56542 17.6777 8.48633ZM22.4551 8.48828C22.6482 8.52791 22.8397 8.57217 23.0293 8.62109C22.6501 8.52325 22.2639 8.443 21.8711 8.38281L22.4551 8.48828ZM20.0664 8.24609C19.6577 8.24609 19.2537 8.2661 18.8555 8.30664L19.457 8.26172C19.6589 8.25145 19.862 8.2461 20.0664 8.24609Z\"\n />\n );\n\n return getIcon({ size, isHovered, normal, normalHover, xSmall, xSmallHover, xxSmall, xxSmallHover });\n};\n\nexport default Search;\n"],"mappings":";;AAIA,IAAMA,UAAkC,EAAE,MAAM,gBAAkD;AAiChG,QAAO,QAAQ;EAAE;EAAM;EAAW,QA/BhC,oBAAC,QAAA,EAAK,GAAE,skBAAA,CAAukB;EA+BviB,aA3BxC,oBAAC,QAAA,EAAK,GAAE,keAAA,CAAme;EA2Btb,QAvBrD,oBAAC,QAAA,EAAK,GAAE,+iBAAA,CAAgjB;EAuB3f,aAnB7D,oBAAC,QAAA,EAAK,GAAE,qkBAAA,CAAskB;EAmBpgB,SAf1E,oBAAC,QAAA;GACC,UAAS;GACT,UAAS;GACT,GAAE;IACF;EAWiF,cAPnF,oBAAC,QAAA;GACC,UAAS;GACT,UAAS;GACT,GAAE;IACF;EAG+F,CAAC;;AAGtG,IAAA,iBAAe"}
|
package/lib/VisualRadio.js
CHANGED
|
@@ -4,7 +4,6 @@ import { t as getAriaDescribedBy } from "./accessibility.js";
|
|
|
4
4
|
import { t as ErrorWrapper_default } from "./ErrorWrapper.js";
|
|
5
5
|
import { t as RadioMarker_default } from "./RadioMarker.js";
|
|
6
6
|
import classNames from "classnames";
|
|
7
|
-
import { useState } from "react";
|
|
8
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
8
|
import styles from "./components/VisualRadioGroup/VisualRadio/styles.module.scss";
|
|
10
9
|
const VisualContent = (props) => {
|
|
@@ -18,28 +17,15 @@ const VisualContent = (props) => {
|
|
|
18
17
|
};
|
|
19
18
|
var VisualContent_default = VisualContent;
|
|
20
19
|
var VisualRadio = (props) => {
|
|
21
|
-
const { className,
|
|
20
|
+
const { className, children, visualContent, variant = "line", inputId: inputIdProp, errorText, error = !!errorText, errorTextId: errorTextIdProp, errorWrapperClassName, testId, ref, ...rest } = props;
|
|
22
21
|
const inputId = useIdWithFallback(inputIdProp);
|
|
23
22
|
const errorTextId = useIdWithFallback(errorTextIdProp);
|
|
24
|
-
const [isChecked, setIsChecked] = useState(!!(checked ?? defaultChecked));
|
|
25
|
-
const [prevChecked, setPrevChecked] = useState(checked);
|
|
26
|
-
if (prevChecked !== checked) {
|
|
27
|
-
setPrevChecked(checked);
|
|
28
|
-
if (checked !== void 0 && checked !== isChecked) setIsChecked(checked);
|
|
29
|
-
}
|
|
30
|
-
const handleChange = (e) => {
|
|
31
|
-
setIsChecked(e.target.checked);
|
|
32
|
-
onChange?.(e);
|
|
33
|
-
};
|
|
34
23
|
return /* @__PURE__ */ jsx(ErrorWrapper_default, {
|
|
35
24
|
className: errorWrapperClassName,
|
|
36
25
|
errorText,
|
|
37
26
|
errorTextId,
|
|
38
27
|
children: /* @__PURE__ */ jsxs("label", {
|
|
39
|
-
className: classNames(styles["visual-radio"], styles[`visual-radio--variant-${variant}`], {
|
|
40
|
-
[styles["visual-radio--checked"]]: isChecked,
|
|
41
|
-
[styles["visual-radio--invalid"]]: error
|
|
42
|
-
}, className),
|
|
28
|
+
className: classNames(styles["visual-radio"], styles[`visual-radio--variant-${variant}`], { [styles["visual-radio--invalid"]]: error }, className),
|
|
43
29
|
htmlFor: inputId,
|
|
44
30
|
"data-testid": testId,
|
|
45
31
|
"data-analyticsid": AnalyticsId.RadioButton,
|
|
@@ -51,10 +37,10 @@ var VisualRadio = (props) => {
|
|
|
51
37
|
ref,
|
|
52
38
|
className: styles["visual-radio__input"],
|
|
53
39
|
type: "radio",
|
|
54
|
-
checked:
|
|
40
|
+
checked: rest.checked,
|
|
55
41
|
"aria-invalid": error,
|
|
56
42
|
"aria-describedby": getAriaDescribedBy(props, errorTextId),
|
|
57
|
-
onChange:
|
|
43
|
+
onChange: rest.onChange
|
|
58
44
|
}),
|
|
59
45
|
/* @__PURE__ */ jsxs("span", {
|
|
60
46
|
className: styles["visual-radio__frame"],
|
|
@@ -62,7 +48,6 @@ var VisualRadio = (props) => {
|
|
|
62
48
|
className: styles["visual-radio__label"],
|
|
63
49
|
children
|
|
64
50
|
}), /* @__PURE__ */ jsx(RadioMarker_default, {
|
|
65
|
-
checked: isChecked,
|
|
66
51
|
error,
|
|
67
52
|
size: "large"
|
|
68
53
|
})]
|
package/lib/VisualRadio.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VisualRadio.js","names":["VisualContent: React.FC<VisualContentProps>","VisualRadio: React.FC<VisualRadioProps>"],"sources":["../src/components/VisualRadioGroup/VisualRadio/VisualContent.tsx","../src/components/VisualRadioGroup/VisualRadio/VisualRadio.tsx"],"sourcesContent":["import classNames from 'classnames';\n\nimport styles from './styles.module.scss';\n\nexport interface VisualContentProps {\n /** Content rendered inside the circular area – typically an <img> or illustration component. */\n children: React.ReactNode;\n /** Adds custom classes to the root element. */\n className?: string;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\nexport const VisualContent: React.FC<VisualContentProps> = props => {\n const { children, className, testId } = props;\n\n return (\n <span className={classNames(styles['visual-radio__visual-content'], className)} data-testid={testId} aria-hidden=\"true\">\n {children}\n </span>\n );\n};\n\nexport default VisualContent;\n","import
|
|
1
|
+
{"version":3,"file":"VisualRadio.js","names":["VisualContent: React.FC<VisualContentProps>","VisualRadio: React.FC<VisualRadioProps>"],"sources":["../src/components/VisualRadioGroup/VisualRadio/VisualContent.tsx","../src/components/VisualRadioGroup/VisualRadio/VisualRadio.tsx"],"sourcesContent":["import classNames from 'classnames';\n\nimport styles from './styles.module.scss';\n\nexport interface VisualContentProps {\n /** Content rendered inside the circular area – typically an <img> or illustration component. */\n children: React.ReactNode;\n /** Adds custom classes to the root element. */\n className?: string;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\nexport const VisualContent: React.FC<VisualContentProps> = props => {\n const { children, className, testId } = props;\n\n return (\n <span className={classNames(styles['visual-radio__visual-content'], className)} data-testid={testId} aria-hidden=\"true\">\n {children}\n </span>\n );\n};\n\nexport default VisualContent;\n","import classNames from 'classnames';\n\nimport type { ErrorWrapperClassNameProps } from '../../ErrorWrapper';\n\nimport VisualContent from './VisualContent';\nimport { AnalyticsId } from '../../../constants';\nimport { useIdWithFallback } from '../../../hooks/useIdWithFallback';\nimport { getAriaDescribedBy } from '../../../utils/accessibility';\nimport ErrorWrapper from '../../ErrorWrapper';\nimport RadioMarker from '../../RadioButton/RadioMarker/RadioMarker';\n\nimport styles from './styles.module.scss';\n\nexport type VisualRadioVariant = 'line' | 'rectangle';\n\nexport interface VisualRadioProps\n extends ErrorWrapperClassNameProps, Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type' | 'id' | 'className' | 'children' | 'size'> {\n /** Adds custom classes to the root element. */\n className?: string;\n /** Label rendered inside the radio frame. */\n children: string;\n /** Content rendered inside the circular visual slot. */\n visualContent?: React.ReactNode;\n /** Layout variant. `line` is a thin horizontal pill, `rectangle` is a vertical card. */\n variant?: VisualRadioVariant;\n /** input id of the underlying radio */\n inputId?: string;\n /** Activates error styling. Can be true while errorText is empty (e.g. when used in a FormGroup). */\n error?: boolean;\n /** Error text to show above the component. */\n errorText?: string;\n /** Error text id */\n errorTextId?: string;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Ref forwarded to the underlying input element. */\n ref?: React.Ref<HTMLInputElement | null>;\n}\n\nconst VisualRadio: React.FC<VisualRadioProps> = props => {\n const {\n className,\n children,\n visualContent,\n variant = 'line',\n inputId: inputIdProp,\n errorText,\n error = !!errorText,\n errorTextId: errorTextIdProp,\n errorWrapperClassName,\n testId,\n ref,\n ...rest\n } = props;\n\n const inputId = useIdWithFallback(inputIdProp);\n const errorTextId = useIdWithFallback(errorTextIdProp);\n\n return (\n <ErrorWrapper className={errorWrapperClassName} errorText={errorText} errorTextId={errorTextId}>\n <label\n className={classNames(\n styles['visual-radio'],\n styles[`visual-radio--variant-${variant}`],\n { [styles['visual-radio--invalid']]: error },\n className\n )}\n htmlFor={inputId}\n data-testid={testId}\n data-analyticsid={AnalyticsId.RadioButton}\n >\n {visualContent !== undefined && <VisualContent>{visualContent}</VisualContent>}\n {/* eslint-disable-next-line jsx-a11y/role-supports-aria-props -- aria-invalid is a global ARIA state, valid on radio inputs */}\n <input\n {...rest}\n id={inputId}\n ref={ref}\n className={styles['visual-radio__input']}\n type=\"radio\"\n checked={rest.checked}\n aria-invalid={error}\n aria-describedby={getAriaDescribedBy(props, errorTextId)}\n onChange={rest.onChange}\n />\n <span className={styles['visual-radio__frame']}>\n <span className={styles['visual-radio__label']}>{children}</span>\n <RadioMarker error={error} size={'large'} />\n </span>\n </label>\n </ErrorWrapper>\n );\n};\n\nexport default VisualRadio;\n"],"mappings":";;;;;;;;AAaA,MAAaA,iBAA8C,UAAS;CAClE,MAAM,EAAE,UAAU,WAAW,WAAW;AAExC,QACE,oBAAC,QAAA;EAAK,WAAW,WAAW,OAAO,iCAAiC,UAAU;EAAE,eAAa;EAAQ,eAAY;EAC9G;GACI;;AAIX,IAAA,wBAAe;ACgBf,IAAMC,eAA0C,UAAS;CACvD,MAAM,EACJ,WACA,UACA,eACA,UAAU,QACV,SAAS,aACT,WACA,QAAQ,CAAC,CAAC,WACV,aAAa,iBACb,uBACA,QACA,KACA,GAAG,SACD;CAEJ,MAAM,UAAU,kBAAkB,YAAY;CAC9C,MAAM,cAAc,kBAAkB,gBAAgB;AAEtD,QACE,oBAAC,sBAAA;EAAa,WAAW;EAAkC;EAAwB;YACjF,qBAAC,SAAA;GACC,WAAW,WACT,OAAO,iBACP,OAAO,yBAAyB,YAChC,GAAG,OAAO,2BAA2B,OAAO,EAC5C,UACD;GACD,SAAS;GACT,eAAa;GACb,oBAAkB,YAAY;;IAE7B,kBAAkB,KAAA,KAAa,oBAAC,uBAAA,EAAA,UAAe,eAAA,CAA8B;IAE9E,oBAAC,SAAA;KACC,GAAI;KACJ,IAAI;KACC;KACL,WAAW,OAAO;KAClB,MAAK;KACL,SAAS,KAAK;KACd,gBAAc;KACd,oBAAkB,mBAAmB,OAAO,YAAY;KACxD,UAAU,KAAK;MACf;IACF,qBAAC,QAAA;KAAK,WAAW,OAAO;gBACtB,oBAAC,QAAA;MAAK,WAAW,OAAO;MAAyB;OAAgB,EACjE,oBAAC,qBAAA;MAAmB;MAAO,MAAM;OAAW,CAAA;MACvC;;IACD;GACK;;AAInB,IAAA,sBAAe"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { vi } from "vitest";
|
|
2
|
-
const mockWindowMatchMedia = vi.fn().mockImplementation(() => ({
|
|
3
|
-
matches:
|
|
2
|
+
const mockWindowMatchMedia = vi.fn().mockImplementation((query) => ({
|
|
3
|
+
matches: !/prefers-reduced-motion/.test(query),
|
|
4
|
+
media: query,
|
|
4
5
|
addEventListener: vi.fn(),
|
|
5
6
|
removeEventListener: vi.fn()
|
|
6
7
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"matchMedia.js","names":["mockWindowMatchMedia: Mock"],"sources":["../../src/__mocks__/matchMedia.ts"],"sourcesContent":["import { vi, type Mock } from 'vitest';\n\nexport const mockWindowMatchMedia: Mock = vi.fn().mockImplementation(() => ({\n matches:
|
|
1
|
+
{"version":3,"file":"matchMedia.js","names":["mockWindowMatchMedia: Mock"],"sources":["../../src/__mocks__/matchMedia.ts"],"sourcesContent":["import { vi, type Mock } from 'vitest';\n\nexport const mockWindowMatchMedia: Mock = vi.fn().mockImplementation((query: string) => ({\n matches: !/prefers-reduced-motion/.test(query),\n media: query,\n addEventListener: vi.fn(),\n removeEventListener: vi.fn(),\n}));\n\nObject.defineProperty(window, 'matchMedia', {\n writable: true,\n value: mockWindowMatchMedia,\n});\n"],"mappings":";AAEA,MAAaA,uBAA6B,GAAG,IAAI,CAAC,oBAAoB,WAAmB;CACvF,SAAS,CAAC,yBAAyB,KAAK,MAAM;CAC9C,OAAO;CACP,kBAAkB,GAAG,IAAI;CACzB,qBAAqB,GAAG,IAAI;CAC7B,EAAE;AAEH,OAAO,eAAe,QAAQ,cAAc;CAC1C,UAAU;CACV,OAAO;CACR,CAAC"}
|
|
@@ -8,35 +8,35 @@ var Sort = ({ size, isHovered }) => {
|
|
|
8
8
|
normalHover: /* @__PURE__ */ jsx("path", { d: "m41.592 14.255-1.237 1.237-6.172-6.172v24.703h-1.75V9.32l-6.172 6.172-1.238-1.237 8.285-8.285 8.284 8.285ZM15.679 38.572l6.003-6.003 1.237 1.238-8.114 8.115-.003-.003H14.8l-8.114-8.112 1.238-1.238 6.004 6.004V14.018h1.75v24.554Z" }),
|
|
9
9
|
xSmall: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
10
10
|
/* @__PURE__ */ jsx("path", {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
fillRule: "evenodd",
|
|
12
|
+
clipRule: "evenodd",
|
|
13
13
|
d: "M31.905 12.936h-1.894v20.013h1.895V12.936Zm-13.913 2.219h-1.895v19.793h1.895V15.155Z"
|
|
14
14
|
}),
|
|
15
15
|
/* @__PURE__ */ jsx("path", {
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
fillRule: "evenodd",
|
|
17
|
+
clipRule: "evenodd",
|
|
18
18
|
d: "m32.296 11.918-1.34-1.34-6.77 6.77 1.34 1.34 6.77-6.77ZM15.707 36.096l1.34 1.34 6.77-6.771-1.34-1.34-6.77 6.771Z"
|
|
19
19
|
}),
|
|
20
20
|
/* @__PURE__ */ jsx("path", {
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
fillRule: "evenodd",
|
|
22
|
+
clipRule: "evenodd",
|
|
23
23
|
d: "m36.39 18.686 1.34-1.34-6.77-6.769-1.34 1.34 6.77 6.77ZM11.611 29.324l-1.34 1.34 6.771 6.77 1.34-1.34-6.77-6.77Z"
|
|
24
24
|
})
|
|
25
25
|
] }),
|
|
26
26
|
xSmallHover: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
27
27
|
/* @__PURE__ */ jsx("path", {
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
fillRule: "evenodd",
|
|
29
|
+
clipRule: "evenodd",
|
|
30
30
|
d: "M31.905 11.673h-1.894v20.013h1.895V11.673Zm-13.913 4.744h-1.895v19.794h1.895V16.417Z"
|
|
31
31
|
}),
|
|
32
32
|
/* @__PURE__ */ jsx("path", {
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
fillRule: "evenodd",
|
|
34
|
+
clipRule: "evenodd",
|
|
35
35
|
d: "m32.296 10.654-1.34-1.34-6.77 6.77 1.34 1.34 6.77-6.77ZM15.707 37.36l1.34 1.34 6.77-6.771-1.34-1.34-6.77 6.77Z"
|
|
36
36
|
}),
|
|
37
37
|
/* @__PURE__ */ jsx("path", {
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
fillRule: "evenodd",
|
|
39
|
+
clipRule: "evenodd",
|
|
40
40
|
d: "m36.39 17.424 1.34-1.34-6.77-6.77-1.34 1.34 6.77 6.77ZM11.611 30.588l-1.34 1.34 6.771 6.77 1.34-1.34-6.77-6.77Z"
|
|
41
41
|
})
|
|
42
42
|
] })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sort.js","names":["Sort: React.FC<SvgPathProps>"],"sources":["../../../src/components/Icons/Sort.tsx"],"sourcesContent":["import type { SvgPathProps } from '../Icon';\n\nimport { getIcon } from '../Icon/utils';\n\nconst Sort: React.FC<SvgPathProps> = ({ size, isHovered }: SvgPathProps): React.ReactElement => {\n const normal = (\n <path d=\"m15.679 36.574 6.002-6.003 1.238 1.238-8.114 8.115-.003-.003H14.8L6.687 31.81l1.238-1.238 6.004 6.004V12.02h1.75v24.555Zm25.913-20.317-1.238 1.237-6.172-6.172v24.703h-1.75V11.322l-6.171 6.172-1.238-1.237 8.284-8.285 8.285 8.285Z\" />\n );\n\n const normalHover = (\n <path d=\"m41.592 14.255-1.237 1.237-6.172-6.172v24.703h-1.75V9.32l-6.172 6.172-1.238-1.237 8.285-8.285 8.284 8.285ZM15.679 38.572l6.003-6.003 1.237 1.238-8.114 8.115-.003-.003H14.8l-8.114-8.112 1.238-1.238 6.004 6.004V14.018h1.75v24.554Z\" />\n );\n\n const xSmall = (\n <>\n <path\n
|
|
1
|
+
{"version":3,"file":"Sort.js","names":["Sort: React.FC<SvgPathProps>"],"sources":["../../../src/components/Icons/Sort.tsx"],"sourcesContent":["import type { SvgPathProps } from '../Icon';\n\nimport { getIcon } from '../Icon/utils';\n\nconst Sort: React.FC<SvgPathProps> = ({ size, isHovered }: SvgPathProps): React.ReactElement => {\n const normal = (\n <path d=\"m15.679 36.574 6.002-6.003 1.238 1.238-8.114 8.115-.003-.003H14.8L6.687 31.81l1.238-1.238 6.004 6.004V12.02h1.75v24.555Zm25.913-20.317-1.238 1.237-6.172-6.172v24.703h-1.75V11.322l-6.171 6.172-1.238-1.237 8.284-8.285 8.285 8.285Z\" />\n );\n\n const normalHover = (\n <path d=\"m41.592 14.255-1.237 1.237-6.172-6.172v24.703h-1.75V9.32l-6.172 6.172-1.238-1.237 8.285-8.285 8.284 8.285ZM15.679 38.572l6.003-6.003 1.237 1.238-8.114 8.115-.003-.003H14.8l-8.114-8.112 1.238-1.238 6.004 6.004V14.018h1.75v24.554Z\" />\n );\n\n const xSmall = (\n <>\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M31.905 12.936h-1.894v20.013h1.895V12.936Zm-13.913 2.219h-1.895v19.793h1.895V15.155Z\"\n />\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"m32.296 11.918-1.34-1.34-6.77 6.77 1.34 1.34 6.77-6.77ZM15.707 36.096l1.34 1.34 6.77-6.771-1.34-1.34-6.77 6.771Z\"\n />\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"m36.39 18.686 1.34-1.34-6.77-6.769-1.34 1.34 6.77 6.77ZM11.611 29.324l-1.34 1.34 6.771 6.77 1.34-1.34-6.77-6.77Z\"\n />\n </>\n );\n\n const xSmallHover = (\n <>\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M31.905 11.673h-1.894v20.013h1.895V11.673Zm-13.913 4.744h-1.895v19.794h1.895V16.417Z\"\n />\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"m32.296 10.654-1.34-1.34-6.77 6.77 1.34 1.34 6.77-6.77ZM15.707 37.36l1.34 1.34 6.77-6.771-1.34-1.34-6.77 6.77Z\"\n />\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"m36.39 17.424 1.34-1.34-6.77-6.77-1.34 1.34 6.77 6.77ZM11.611 30.588l-1.34 1.34 6.771 6.77 1.34-1.34-6.77-6.77Z\"\n />\n </>\n );\n\n return getIcon({ size, isHovered, normal, normalHover, xSmall, xSmallHover });\n};\n\nexport default Sort;\n"],"mappings":";;AAIA,IAAMA,QAAgC,EAAE,MAAM,gBAAkD;AAiD9F,QAAO,QAAQ;EAAE;EAAM;EAAW,QA/ChC,oBAAC,QAAA,EAAK,GAAE,wOAAA,CAAyO;EA+CzM,aA3CxC,oBAAC,QAAA,EAAK,GAAE,wOAAA,CAAyO;EA2C5L,QAvCrD,qBAAA,UAAA,EAAA,UAAA;GACE,oBAAC,QAAA;IACC,UAAS;IACT,UAAS;IACT,GAAE;KACF;GACF,oBAAC,QAAA;IACC,UAAS;IACT,UAAS;IACT,GAAE;KACF;GACF,oBAAC,QAAA;IACC,UAAS;IACT,UAAS;IACT,GAAE;KACF;MACD;EAuB0D,aAnB7D,qBAAA,UAAA,EAAA,UAAA;GACE,oBAAC,QAAA;IACC,UAAS;IACT,UAAS;IACT,GAAE;KACF;GACF,oBAAC,QAAA;IACC,UAAS;IACT,UAAS;IACT,GAAE;KACF;GACF,oBAAC,QAAA;IACC,UAAS;IACT,UAAS;IACT,GAAE;KACF;MACD;EAGuE,CAAC;;AAG/E,IAAA,eAAe"}
|
|
@@ -63,36 +63,44 @@
|
|
|
63
63
|
color: palette.$cherry600;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
&__regular
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
66
|
+
&__regular#{&}--checked,
|
|
67
|
+
label:has(input:checked) &__regular {
|
|
68
|
+
color: palette.$blueberry500;
|
|
69
|
+
}
|
|
70
70
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
&__regular#{&}--checked#{&}--invalid,
|
|
72
|
+
label:has(input:checked) &__regular#{&}--invalid {
|
|
73
|
+
color: palette.$cherry600;
|
|
74
|
+
}
|
|
74
75
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
&__regular#{&}--checked#{&}--on-dark,
|
|
77
|
+
label:has(input:checked) &__regular#{&}--on-dark {
|
|
78
|
+
color: palette.$blueberry200;
|
|
79
|
+
}
|
|
78
80
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
81
|
+
&__regular#{&}--checked#{&}--disabled,
|
|
82
|
+
label:has(input:checked) &__regular#{&}--disabled {
|
|
83
|
+
color: palette.$neutral600;
|
|
82
84
|
}
|
|
83
85
|
|
|
84
86
|
&__large {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
87
|
+
// empty stub — checked-state rules live at the &__marker level below
|
|
88
|
+
}
|
|
88
89
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
// Large size — checked appearance.
|
|
91
|
+
&__large#{&}--checked,
|
|
92
|
+
label:has(input:checked) &__large {
|
|
93
|
+
color: palette.$blueberry100;
|
|
94
|
+
}
|
|
92
95
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
+
&__large#{&}--checked#{&}--invalid,
|
|
97
|
+
label:has(input:checked) &__large#{&}--invalid {
|
|
98
|
+
color: palette.$cherry500;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
&__large#{&}--checked#{&}--disabled,
|
|
102
|
+
label:has(input:checked) &__large#{&}--disabled {
|
|
103
|
+
color: palette.$neutral600;
|
|
96
104
|
}
|
|
97
105
|
|
|
98
106
|
&--disabled,
|
|
@@ -111,22 +119,26 @@
|
|
|
111
119
|
&--on-dark {
|
|
112
120
|
color: palette.$white;
|
|
113
121
|
}
|
|
122
|
+
}
|
|
114
123
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
124
|
+
label:has(:focus-visible) &__regular#{&}--checked,
|
|
125
|
+
label:has(input:checked:focus-visible) &__regular {
|
|
126
|
+
color: palette.$black;
|
|
127
|
+
}
|
|
118
128
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
129
|
+
label:has(:focus-visible) &__regular#{&}--checked#{&}--on-dark,
|
|
130
|
+
label:has(input:checked:focus-visible) &__regular#{&}--on-dark {
|
|
131
|
+
color: palette.$white;
|
|
132
|
+
}
|
|
122
133
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
134
|
+
label:has(:focus-visible) &__large#{&}--checked,
|
|
135
|
+
label:has(input:checked:focus-visible) &__large {
|
|
136
|
+
color: palette.$white;
|
|
137
|
+
}
|
|
126
138
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
139
|
+
label:has(:focus-visible) &__large#{&}--checked#{&}--invalid,
|
|
140
|
+
label:has(input:checked:focus-visible) &__large#{&}--invalid {
|
|
141
|
+
color: palette.$black;
|
|
130
142
|
}
|
|
131
143
|
|
|
132
144
|
// Hover styles via wrapping label
|
|
@@ -165,31 +177,38 @@
|
|
|
165
177
|
background-color: palette.$inverted-hover-old;
|
|
166
178
|
}
|
|
167
179
|
|
|
168
|
-
label:hover &__regular--checked
|
|
180
|
+
label:hover &__regular#{&}--checked,
|
|
181
|
+
label:has(input:checked):hover &__regular {
|
|
169
182
|
background-color: palette.$blueberry50;
|
|
170
183
|
}
|
|
171
184
|
|
|
172
|
-
label:active &__regular--checked
|
|
185
|
+
label:active &__regular#{&}--checked,
|
|
186
|
+
label:has(input:checked):active &__regular {
|
|
173
187
|
background-color: palette.$blueberry100;
|
|
174
188
|
}
|
|
175
189
|
|
|
176
|
-
label:hover &__regular--checked--invalid
|
|
190
|
+
label:hover &__regular#{&}--checked#{&}--invalid,
|
|
191
|
+
label:has(input:checked):hover &__regular#{&}--invalid {
|
|
177
192
|
background-color: palette.$cherry100;
|
|
178
193
|
}
|
|
179
194
|
|
|
180
|
-
label:active &__regular--checked--invalid
|
|
195
|
+
label:active &__regular#{&}--checked#{&}--invalid,
|
|
196
|
+
label:has(input:checked):active &__regular#{&}--invalid {
|
|
181
197
|
background-color: palette.$cherry200;
|
|
182
198
|
}
|
|
183
199
|
|
|
184
|
-
label:hover &__regular--checked--on-dark
|
|
200
|
+
label:hover &__regular#{&}--checked#{&}--on-dark,
|
|
201
|
+
label:has(input:checked):hover &__regular#{&}--on-dark {
|
|
185
202
|
background-color: palette.$inverted-hover-old;
|
|
186
203
|
}
|
|
187
204
|
|
|
188
|
-
label:hover &__large--checked
|
|
205
|
+
label:hover &__large#{&}--checked,
|
|
206
|
+
label:has(input:checked):hover &__large {
|
|
189
207
|
background-color: unset;
|
|
190
208
|
}
|
|
191
209
|
|
|
192
|
-
label:hover &__large--checked--invalid
|
|
210
|
+
label:hover &__large#{&}--checked#{&}--invalid,
|
|
211
|
+
label:has(input:checked):hover &__large#{&}--invalid {
|
|
193
212
|
background-color: transparent;
|
|
194
213
|
}
|
|
195
214
|
|
|
@@ -202,7 +221,7 @@
|
|
|
202
221
|
}
|
|
203
222
|
|
|
204
223
|
&__marker-dot {
|
|
205
|
-
display:
|
|
224
|
+
display: none;
|
|
206
225
|
background-color: palette.$blueberry500;
|
|
207
226
|
width: 0.875rem;
|
|
208
227
|
height: 0.875rem;
|
|
@@ -215,6 +234,12 @@
|
|
|
215
234
|
}
|
|
216
235
|
}
|
|
217
236
|
|
|
237
|
+
// Show the dot visually
|
|
238
|
+
&__marker#{&}__marker--checked &__marker-dot,
|
|
239
|
+
label:has(input:checked) &__marker &__marker-dot {
|
|
240
|
+
display: block;
|
|
241
|
+
}
|
|
242
|
+
|
|
218
243
|
// Dot color follows the marker state (so the focus ring can turn black
|
|
219
244
|
// without recoloring the dot).
|
|
220
245
|
&__marker--on-dark &__marker-dot {
|
|
@@ -229,11 +254,13 @@
|
|
|
229
254
|
background-color: palette.$neutral600;
|
|
230
255
|
}
|
|
231
256
|
|
|
232
|
-
&__marker__large--checked &__marker-dot
|
|
257
|
+
&__marker__large#{&}__marker--checked &__marker-dot,
|
|
258
|
+
label:has(input:checked) &__marker__large &__marker-dot {
|
|
233
259
|
background-color: palette.$blueberry100;
|
|
234
260
|
}
|
|
235
261
|
|
|
236
|
-
&__marker__large--checked--invalid &__marker-dot
|
|
262
|
+
&__marker__large#{&}__marker--checked#{&}__marker--invalid &__marker-dot,
|
|
263
|
+
label:has(input:checked) &__marker__large#{&}__marker--invalid &__marker-dot {
|
|
237
264
|
background-color: palette.$cherry500;
|
|
238
265
|
}
|
|
239
266
|
|
|
@@ -249,11 +276,13 @@
|
|
|
249
276
|
background-color: palette.$cherry800;
|
|
250
277
|
}
|
|
251
278
|
|
|
252
|
-
label:active &__marker__large--checked &__marker-dot
|
|
279
|
+
label:active &__marker__large#{&}__marker--checked &__marker-dot,
|
|
280
|
+
label:has(input:checked):active &__marker__large &__marker-dot {
|
|
253
281
|
background-color: palette.$blueberry200;
|
|
254
282
|
}
|
|
255
283
|
|
|
256
|
-
label:active &__marker__large--checked--invalid &__marker-dot
|
|
284
|
+
label:active &__marker__large#{&}__marker--checked#{&}__marker--invalid &__marker-dot,
|
|
285
|
+
label:has(input:checked):active &__marker__large#{&}__marker--invalid &__marker-dot {
|
|
257
286
|
background-color: palette.$cherry700;
|
|
258
287
|
}
|
|
259
288
|
}
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
export type Styles = {
|
|
2
2
|
radio__marker: string;
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
'
|
|
6
|
-
'radio__marker__regular--checked': string;
|
|
7
|
-
'radio__marker__regular--checked--disabled': string;
|
|
8
|
-
'radio__marker__regular--checked--invalid': string;
|
|
9
|
-
'radio__marker__regular--checked--on-dark': string;
|
|
3
|
+
radio__marker__large: string;
|
|
4
|
+
radio__marker__regular: string;
|
|
5
|
+
'radio__marker--checked': string;
|
|
10
6
|
'radio__marker--disabled': string;
|
|
11
7
|
'radio__marker--invalid': string;
|
|
12
8
|
'radio__marker--on-blueberry': string;
|
|
@@ -30,7 +30,7 @@ $padding-clickable-area-left: 8px;
|
|
|
30
30
|
color: palette.$blueberry500;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
&:has(input:checked):has(input:focus-visible) {
|
|
34
34
|
color: palette.$blueberry900;
|
|
35
35
|
}
|
|
36
36
|
|
|
@@ -111,7 +111,7 @@ $padding-clickable-area-left: 8px;
|
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
-
&__large#{&}__large--
|
|
114
|
+
&__large#{&}__large--invalid:has(input:checked) {
|
|
115
115
|
background-color: palette.$cherry100;
|
|
116
116
|
color: palette.$black;
|
|
117
117
|
|
|
@@ -144,7 +144,7 @@ $padding-clickable-area-left: 8px;
|
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
146
|
|
|
147
|
-
&__large
|
|
147
|
+
&__large:has(input:checked) {
|
|
148
148
|
background-color: palette.$blueberry500;
|
|
149
149
|
color: palette.$white;
|
|
150
150
|
|
|
@@ -5,10 +5,9 @@ export type Styles = {
|
|
|
5
5
|
'radio-button-label': string;
|
|
6
6
|
'radio-button-label__large': string;
|
|
7
7
|
'radio-button-label__large--disabled': string;
|
|
8
|
+
'radio-button-label__large--invalid': string;
|
|
8
9
|
'radio-button-label__large--on-blueberry': string;
|
|
9
10
|
'radio-button-label__large--on-grey': string;
|
|
10
|
-
'radio-button-label__large--selected': string;
|
|
11
|
-
'radio-button-label__large--selected-invalid': string;
|
|
12
11
|
'radio-button-label--disabled': string;
|
|
13
12
|
'radio-button-label--invalid': string;
|
|
14
13
|
'radio-button-label--on-dark': string;
|
|
@@ -16,7 +15,6 @@ export type Styles = {
|
|
|
16
15
|
'radio-button-wrapper__large': string;
|
|
17
16
|
'radio-button-wrapper__large--invalid': string;
|
|
18
17
|
'radio-button-wrapper__large--on-blueberry': string;
|
|
19
|
-
'radio-button-wrapper__large--selected': string;
|
|
20
18
|
'radiobutton-afterlabelchildren-wrapper': string;
|
|
21
19
|
'radiobutton-sublabel-wrapper': string;
|
|
22
20
|
};
|
package/lib/resourceHelper.js
CHANGED
|
@@ -1,23 +1,27 @@
|
|
|
1
1
|
import { s as LanguageLocales } from "./constants2.js";
|
|
2
2
|
var HN_Designsystem_Filter_en_GB_default = {
|
|
3
|
-
filterButtonText: "Find...",
|
|
3
|
+
filterButtonText: "Find ...",
|
|
4
4
|
sortLabel: "Sorting",
|
|
5
5
|
resetButtonText: "Reset",
|
|
6
6
|
showButtonText: "Show {0} results",
|
|
7
|
-
filterOverviewTitle: "Find...",
|
|
7
|
+
filterOverviewTitle: "Find ...",
|
|
8
8
|
searchPlaceholder: "Search the list",
|
|
9
9
|
searchClearButtonAriaLabel: "Reset",
|
|
10
|
-
searchButtonAriaLabel: "Search"
|
|
10
|
+
searchButtonAriaLabel: "Search",
|
|
11
|
+
loadingText: "Loading results",
|
|
12
|
+
resultsText: "{0} results"
|
|
11
13
|
};
|
|
12
14
|
var HN_Designsystem_Filter_nb_NO_default = {
|
|
13
|
-
filterButtonText: "Finn...",
|
|
15
|
+
filterButtonText: "Finn ...",
|
|
14
16
|
sortLabel: "Sortering",
|
|
15
17
|
resetButtonText: "Nullstill",
|
|
16
18
|
showButtonText: "Vis {0} treff",
|
|
17
|
-
filterOverviewTitle: "Finn...",
|
|
19
|
+
filterOverviewTitle: "Finn ...",
|
|
18
20
|
searchPlaceholder: "Søk i listen",
|
|
19
21
|
searchClearButtonAriaLabel: "Nullstill",
|
|
20
|
-
searchButtonAriaLabel: "Søk"
|
|
22
|
+
searchButtonAriaLabel: "Søk",
|
|
23
|
+
loadingText: "Henter treff",
|
|
24
|
+
resultsText: "{0} treff"
|
|
21
25
|
};
|
|
22
26
|
const getResources = (language) => {
|
|
23
27
|
switch (language) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resourceHelper.js","names":[],"sources":["../src/resources/HN.Designsystem.Filter.en-GB.json","../src/resources/HN.Designsystem.Filter.nb-NO.json","../src/components/Filter/resourceHelper.ts"],"sourcesContent":["{\n \"filterButtonText\": \"Find...\",\n \"sortLabel\": \"Sorting\",\n \"resetButtonText\": \"Reset\",\n \"showButtonText\": \"Show {0} results\",\n \"filterOverviewTitle\": \"Find...\",\n \"searchPlaceholder\": \"Search the list\",\n \"searchClearButtonAriaLabel\": \"Reset\",\n \"searchButtonAriaLabel\": \"Search\"\n}\n","{\n \"filterButtonText\": \"Finn...\",\n \"sortLabel\": \"Sortering\",\n \"resetButtonText\": \"Nullstill\",\n \"showButtonText\": \"Vis {0} treff\",\n \"filterOverviewTitle\": \"Finn...\",\n \"searchPlaceholder\": \"Søk i listen\",\n \"searchClearButtonAriaLabel\": \"Nullstill\",\n \"searchButtonAriaLabel\": \"Søk\"\n}\n","import type { HNDesignsystemFilter } from '../../resources/Resources';\n\nimport { LanguageLocales } from '../../constants';\nimport enGB from '../../resources/HN.Designsystem.Filter.en-GB.json';\nimport nbNO from '../../resources/HN.Designsystem.Filter.nb-NO.json';\n\nexport const getResources = (language: LanguageLocales): HNDesignsystemFilter => {\n switch (language) {\n case LanguageLocales.ENGLISH:\n return enGB;\n case LanguageLocales.NORWEGIAN:\n default:\n return nbNO;\n }\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"resourceHelper.js","names":[],"sources":["../src/resources/HN.Designsystem.Filter.en-GB.json","../src/resources/HN.Designsystem.Filter.nb-NO.json","../src/components/Filter/resourceHelper.ts"],"sourcesContent":["{\n \"filterButtonText\": \"Find ...\",\n \"sortLabel\": \"Sorting\",\n \"resetButtonText\": \"Reset\",\n \"showButtonText\": \"Show {0} results\",\n \"filterOverviewTitle\": \"Find ...\",\n \"searchPlaceholder\": \"Search the list\",\n \"searchClearButtonAriaLabel\": \"Reset\",\n \"searchButtonAriaLabel\": \"Search\",\n \"loadingText\": \"Loading results\",\n \"resultsText\": \"{0} results\"\n}\n","{\n \"filterButtonText\": \"Finn ...\",\n \"sortLabel\": \"Sortering\",\n \"resetButtonText\": \"Nullstill\",\n \"showButtonText\": \"Vis {0} treff\",\n \"filterOverviewTitle\": \"Finn ...\",\n \"searchPlaceholder\": \"Søk i listen\",\n \"searchClearButtonAriaLabel\": \"Nullstill\",\n \"searchButtonAriaLabel\": \"Søk\",\n \"loadingText\": \"Henter treff\",\n \"resultsText\": \"{0} treff\"\n}\n","import type { HNDesignsystemFilter } from '../../resources/Resources';\n\nimport { LanguageLocales } from '../../constants';\nimport enGB from '../../resources/HN.Designsystem.Filter.en-GB.json';\nimport nbNO from '../../resources/HN.Designsystem.Filter.nb-NO.json';\n\nexport const getResources = (language: LanguageLocales): HNDesignsystemFilter => {\n switch (language) {\n case LanguageLocales.ENGLISH:\n return enGB;\n case LanguageLocales.NORWEGIAN:\n default:\n return nbNO;\n }\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AEMA,MAAa,gBAAgB,aAAoD;AAC/E,SAAQ,UAAR;EACE,KAAK,gBAAgB,QACnB,QAAO;EACT,KAAK,gBAAgB;EACrB,QACE,QAAO"}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
|
-
"filterButtonText": "Find...",
|
|
2
|
+
"filterButtonText": "Find ...",
|
|
3
3
|
"sortLabel": "Sorting",
|
|
4
4
|
"resetButtonText": "Reset",
|
|
5
5
|
"showButtonText": "Show {0} results",
|
|
6
|
-
"filterOverviewTitle": "Find...",
|
|
6
|
+
"filterOverviewTitle": "Find ...",
|
|
7
7
|
"searchPlaceholder": "Search the list",
|
|
8
8
|
"searchClearButtonAriaLabel": "Reset",
|
|
9
|
-
"searchButtonAriaLabel": "Search"
|
|
9
|
+
"searchButtonAriaLabel": "Search",
|
|
10
|
+
"loadingText": "Loading results",
|
|
11
|
+
"resultsText": "{0} results"
|
|
10
12
|
}
|
|
11
13
|
;
|
|
12
14
|
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
|
-
"filterButtonText": "Finn...",
|
|
2
|
+
"filterButtonText": "Finn ...",
|
|
3
3
|
"sortLabel": "Sortering",
|
|
4
4
|
"resetButtonText": "Nullstill",
|
|
5
5
|
"showButtonText": "Vis {0} treff",
|
|
6
|
-
"filterOverviewTitle": "Finn...",
|
|
6
|
+
"filterOverviewTitle": "Finn ...",
|
|
7
7
|
"searchPlaceholder": "Søk i listen",
|
|
8
8
|
"searchClearButtonAriaLabel": "Nullstill",
|
|
9
|
-
"searchButtonAriaLabel": "Søk"
|
|
9
|
+
"searchButtonAriaLabel": "Søk",
|
|
10
|
+
"loadingText": "Henter treff",
|
|
11
|
+
"resultsText": "{0} treff"
|
|
10
12
|
}
|
|
11
13
|
;
|
|
12
14
|
|
|
@@ -148,7 +148,7 @@ export type HNDesignsystemInput = {
|
|
|
148
148
|
|
|
149
149
|
export type HNDesignsystemFilter = {
|
|
150
150
|
/**
|
|
151
|
-
* Finn...
|
|
151
|
+
* Finn ...
|
|
152
152
|
*/
|
|
153
153
|
filterButtonText: string;
|
|
154
154
|
/**
|
|
@@ -164,7 +164,7 @@ export type HNDesignsystemFilter = {
|
|
|
164
164
|
*/
|
|
165
165
|
showButtonText: string;
|
|
166
166
|
/**
|
|
167
|
-
* Finn...
|
|
167
|
+
* Finn ...
|
|
168
168
|
*/
|
|
169
169
|
filterOverviewTitle: string;
|
|
170
170
|
/**
|
|
@@ -179,6 +179,14 @@ export type HNDesignsystemFilter = {
|
|
|
179
179
|
* Søk
|
|
180
180
|
*/
|
|
181
181
|
searchButtonAriaLabel: string;
|
|
182
|
+
/**
|
|
183
|
+
* Henter treff
|
|
184
|
+
*/
|
|
185
|
+
loadingText: string;
|
|
186
|
+
/**
|
|
187
|
+
* {0} treff
|
|
188
|
+
*/
|
|
189
|
+
resultsText: string;
|
|
182
190
|
};
|
|
183
191
|
|
|
184
192
|
export type HNDesignsystemChip = {
|
|
@@ -73,7 +73,8 @@
|
|
|
73
73
|
border-color: var(--color-action-border-onlight-hover);
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
&--checked &__pill
|
|
76
|
+
&--checked &__pill,
|
|
77
|
+
&:has(input:checked) &__pill {
|
|
77
78
|
background-color: var(--color-action-background-onlight);
|
|
78
79
|
color: var(--color-action-text-ondark);
|
|
79
80
|
border-color: var(--color-action-background-onlight);
|
|
@@ -84,12 +85,14 @@
|
|
|
84
85
|
}
|
|
85
86
|
}
|
|
86
87
|
|
|
87
|
-
&--checked:hover &__pill
|
|
88
|
+
&--checked:hover &__pill,
|
|
89
|
+
&:has(input:checked):hover &__pill {
|
|
88
90
|
background-color: var(--color-action-graphics-onlight-hover);
|
|
89
91
|
border-color: var(--color-action-graphics-onlight-hover);
|
|
90
92
|
}
|
|
91
93
|
|
|
92
|
-
&--checked:active &__pill
|
|
94
|
+
&--checked:active &__pill,
|
|
95
|
+
&:has(input:checked):active &__pill {
|
|
93
96
|
background-color: var(--color-action-background-onlight-active);
|
|
94
97
|
border-color: var(--color-action-background-onlight-active);
|
|
95
98
|
}
|
|
@@ -109,17 +112,20 @@
|
|
|
109
112
|
border-color: var(--color-destructive-border-normal);
|
|
110
113
|
}
|
|
111
114
|
|
|
112
|
-
&--invalid#{&}--checked &__pill
|
|
115
|
+
&--invalid#{&}--checked &__pill,
|
|
116
|
+
&--invalid:has(input:checked) &__pill {
|
|
113
117
|
background-color: var(--color-destructive-graphics-normal);
|
|
114
118
|
border-color: var(--color-destructive-graphics-normal);
|
|
115
119
|
}
|
|
116
120
|
|
|
117
|
-
&--invalid#{&}--checked:hover &__pill
|
|
121
|
+
&--invalid#{&}--checked:hover &__pill,
|
|
122
|
+
&--invalid:has(input:checked):hover &__pill {
|
|
118
123
|
background-color: var(--color-destructive-graphics-hover);
|
|
119
124
|
border-color: var(--color-destructive-graphics-hover);
|
|
120
125
|
}
|
|
121
126
|
|
|
122
|
-
&--invalid#{&}--checked:active &__pill
|
|
127
|
+
&--invalid#{&}--checked:active &__pill,
|
|
128
|
+
&--invalid:has(input:checked):active &__pill {
|
|
123
129
|
background-color: var(--color-destructive-graphics-emphasized-onlight);
|
|
124
130
|
border-color: var(--color-destructive-graphics-emphasized-onlight);
|
|
125
131
|
}
|
|
@@ -264,7 +270,8 @@
|
|
|
264
270
|
max-width: 13rem;
|
|
265
271
|
}
|
|
266
272
|
|
|
267
|
-
&--checked &__frame
|
|
273
|
+
&--checked &__frame,
|
|
274
|
+
&:has(input:checked) &__frame {
|
|
268
275
|
background: var(--color-action-background-onlight);
|
|
269
276
|
color: var(--color-action-text-ondark);
|
|
270
277
|
border-color: var(--color-action-background-onlight);
|
|
@@ -285,11 +292,13 @@
|
|
|
285
292
|
border-color: var(--color-action-border-onlight-hover);
|
|
286
293
|
}
|
|
287
294
|
|
|
288
|
-
&--checked:hover &__frame
|
|
295
|
+
&--checked:hover &__frame,
|
|
296
|
+
&:has(input:checked):hover &__frame {
|
|
289
297
|
background: var(--color-action-background-onlight-hover);
|
|
290
298
|
}
|
|
291
299
|
|
|
292
|
-
&--checked:active &__frame
|
|
300
|
+
&--checked:active &__frame,
|
|
301
|
+
&:has(input:checked):active &__frame {
|
|
293
302
|
background: var(--color-action-background-onlight-active);
|
|
294
303
|
border-color: var(--color-action-background-onlight-active);
|
|
295
304
|
}
|
|
@@ -304,18 +313,21 @@
|
|
|
304
313
|
border-color: var(--core-color-cherry-500);
|
|
305
314
|
}
|
|
306
315
|
|
|
307
|
-
&--invalid#{&}--checked &__frame
|
|
316
|
+
&--invalid#{&}--checked &__frame,
|
|
317
|
+
&--invalid:has(input:checked) &__frame {
|
|
308
318
|
background: var(--core-color-cherry-50);
|
|
309
319
|
color: var(--color-base-text-onlight);
|
|
310
320
|
border-color: var(--core-color-cherry-500);
|
|
311
321
|
}
|
|
312
322
|
|
|
313
|
-
&--invalid#{&}--checked:hover &__frame
|
|
323
|
+
&--invalid#{&}--checked:hover &__frame,
|
|
324
|
+
&--invalid:has(input:checked):hover &__frame {
|
|
314
325
|
background: var(--core-color-cherry-100);
|
|
315
326
|
border-color: var(--core-color-cherry-500);
|
|
316
327
|
}
|
|
317
328
|
|
|
318
|
-
&--invalid#{&}--checked:active &__frame
|
|
329
|
+
&--invalid#{&}--checked:active &__frame,
|
|
330
|
+
&--invalid:has(input:checked):active &__frame {
|
|
319
331
|
background: var(--core-color-cherry-200);
|
|
320
332
|
border-color: var(--core-color-cherry-500);
|
|
321
333
|
}
|
package/package.json
CHANGED
package/scss/_visual-form.scss
CHANGED
|
@@ -73,7 +73,8 @@
|
|
|
73
73
|
border-color: var(--color-action-border-onlight-hover);
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
&--checked &__pill
|
|
76
|
+
&--checked &__pill,
|
|
77
|
+
&:has(input:checked) &__pill {
|
|
77
78
|
background-color: var(--color-action-background-onlight);
|
|
78
79
|
color: var(--color-action-text-ondark);
|
|
79
80
|
border-color: var(--color-action-background-onlight);
|
|
@@ -84,12 +85,14 @@
|
|
|
84
85
|
}
|
|
85
86
|
}
|
|
86
87
|
|
|
87
|
-
&--checked:hover &__pill
|
|
88
|
+
&--checked:hover &__pill,
|
|
89
|
+
&:has(input:checked):hover &__pill {
|
|
88
90
|
background-color: var(--color-action-graphics-onlight-hover);
|
|
89
91
|
border-color: var(--color-action-graphics-onlight-hover);
|
|
90
92
|
}
|
|
91
93
|
|
|
92
|
-
&--checked:active &__pill
|
|
94
|
+
&--checked:active &__pill,
|
|
95
|
+
&:has(input:checked):active &__pill {
|
|
93
96
|
background-color: var(--color-action-background-onlight-active);
|
|
94
97
|
border-color: var(--color-action-background-onlight-active);
|
|
95
98
|
}
|
|
@@ -109,17 +112,20 @@
|
|
|
109
112
|
border-color: var(--color-destructive-border-normal);
|
|
110
113
|
}
|
|
111
114
|
|
|
112
|
-
&--invalid#{&}--checked &__pill
|
|
115
|
+
&--invalid#{&}--checked &__pill,
|
|
116
|
+
&--invalid:has(input:checked) &__pill {
|
|
113
117
|
background-color: var(--color-destructive-graphics-normal);
|
|
114
118
|
border-color: var(--color-destructive-graphics-normal);
|
|
115
119
|
}
|
|
116
120
|
|
|
117
|
-
&--invalid#{&}--checked:hover &__pill
|
|
121
|
+
&--invalid#{&}--checked:hover &__pill,
|
|
122
|
+
&--invalid:has(input:checked):hover &__pill {
|
|
118
123
|
background-color: var(--color-destructive-graphics-hover);
|
|
119
124
|
border-color: var(--color-destructive-graphics-hover);
|
|
120
125
|
}
|
|
121
126
|
|
|
122
|
-
&--invalid#{&}--checked:active &__pill
|
|
127
|
+
&--invalid#{&}--checked:active &__pill,
|
|
128
|
+
&--invalid:has(input:checked):active &__pill {
|
|
123
129
|
background-color: var(--color-destructive-graphics-emphasized-onlight);
|
|
124
130
|
border-color: var(--color-destructive-graphics-emphasized-onlight);
|
|
125
131
|
}
|
|
@@ -264,7 +270,8 @@
|
|
|
264
270
|
max-width: 13rem;
|
|
265
271
|
}
|
|
266
272
|
|
|
267
|
-
&--checked &__frame
|
|
273
|
+
&--checked &__frame,
|
|
274
|
+
&:has(input:checked) &__frame {
|
|
268
275
|
background: var(--color-action-background-onlight);
|
|
269
276
|
color: var(--color-action-text-ondark);
|
|
270
277
|
border-color: var(--color-action-background-onlight);
|
|
@@ -285,11 +292,13 @@
|
|
|
285
292
|
border-color: var(--color-action-border-onlight-hover);
|
|
286
293
|
}
|
|
287
294
|
|
|
288
|
-
&--checked:hover &__frame
|
|
295
|
+
&--checked:hover &__frame,
|
|
296
|
+
&:has(input:checked):hover &__frame {
|
|
289
297
|
background: var(--color-action-background-onlight-hover);
|
|
290
298
|
}
|
|
291
299
|
|
|
292
|
-
&--checked:active &__frame
|
|
300
|
+
&--checked:active &__frame,
|
|
301
|
+
&:has(input:checked):active &__frame {
|
|
293
302
|
background: var(--color-action-background-onlight-active);
|
|
294
303
|
border-color: var(--color-action-background-onlight-active);
|
|
295
304
|
}
|
|
@@ -304,18 +313,21 @@
|
|
|
304
313
|
border-color: var(--core-color-cherry-500);
|
|
305
314
|
}
|
|
306
315
|
|
|
307
|
-
&--invalid#{&}--checked &__frame
|
|
316
|
+
&--invalid#{&}--checked &__frame,
|
|
317
|
+
&--invalid:has(input:checked) &__frame {
|
|
308
318
|
background: var(--core-color-cherry-50);
|
|
309
319
|
color: var(--color-base-text-onlight);
|
|
310
320
|
border-color: var(--core-color-cherry-500);
|
|
311
321
|
}
|
|
312
322
|
|
|
313
|
-
&--invalid#{&}--checked:hover &__frame
|
|
323
|
+
&--invalid#{&}--checked:hover &__frame,
|
|
324
|
+
&--invalid:has(input:checked):hover &__frame {
|
|
314
325
|
background: var(--core-color-cherry-100);
|
|
315
326
|
border-color: var(--core-color-cherry-500);
|
|
316
327
|
}
|
|
317
328
|
|
|
318
|
-
&--invalid#{&}--checked:active &__frame
|
|
329
|
+
&--invalid#{&}--checked:active &__frame,
|
|
330
|
+
&--invalid:has(input:checked):active &__frame {
|
|
319
331
|
background: var(--core-color-cherry-200);
|
|
320
332
|
border-color: var(--core-color-cherry-500);
|
|
321
333
|
}
|