@helsenorge/designsystem-react 12.11.1 → 12.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/FormFieldTag.js +16 -3
- package/FormFieldTag.js.map +1 -1
- package/RadioButton.js +1 -1
- package/RadioButton.js.map +1 -1
- package/components/Button/styles.module.scss +3 -3
- package/components/ExpanderList/styles.module.scss +82 -102
- package/components/FormFieldTag/FormFieldTag.d.ts +1 -1
- package/components/RadioButton/styles.module.scss +1 -0
- package/components/StatusDot/styles.module.scss +9 -9
- package/package.json +1 -1
- package/resources/HN.Designsystem.FormFieldTag.nb-NO.json.d.ts +5 -1
- package/resources/index.d.ts +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
## [12.12.0](https://github.com/helsenorge/designsystem/branchCompare?baseVersion=GTv12.11.1&targetVersion=GTv12.12.0) (2025-11-11)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
- **formfieldtag:** legg til flere muligheter
|
|
6
|
+
([fa2260f](https://github.com/helsenorge/designsystem/commit/fa2260fb79fd594015fe9a2217a60904d5f91dc2)), closes
|
|
7
|
+
[#363797](https://github.com/helsenorge/designsystem/issues/363797)
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
- unngå at ting flytter seg pga focus border
|
|
12
|
+
([ecb515f](https://github.com/helsenorge/designsystem/commit/ecb515fa4d32c0e38453201cc2817466a6170e1c))
|
|
13
|
+
- **radiobutton:** legg på manglende sjekk på størrelse
|
|
14
|
+
([b451032](https://github.com/helsenorge/designsystem/commit/b4510324a7d6a2e3722d55f82a4a8ee83ba0a297))
|
|
15
|
+
|
|
1
16
|
## [12.11.1](https://github.com/helsenorge/designsystem/branchCompare?baseVersion=GTv12.11.0&targetVersion=GTv12.11.1) (2025-11-04)
|
|
2
17
|
|
|
3
18
|
### Bug Fixes
|
package/FormFieldTag.js
CHANGED
|
@@ -6,10 +6,18 @@ import styles from "./components/FormFieldTag/styles.module.scss";
|
|
|
6
6
|
const allRequired = "Alle felt må fylles ut";
|
|
7
7
|
const requiredField = "Må fylles ut";
|
|
8
8
|
const optional = "Valgfritt";
|
|
9
|
+
const allOptional = "Alle felt er valgfrie";
|
|
10
|
+
const requiredRadiobuttonList = "Velg én";
|
|
11
|
+
const requiredCheckboxList = "Velg en eller flere";
|
|
12
|
+
const requiredSingleCheckbox = "Må velges";
|
|
9
13
|
const nbNO = {
|
|
10
14
|
allRequired,
|
|
11
15
|
requiredField,
|
|
12
|
-
optional
|
|
16
|
+
optional,
|
|
17
|
+
allOptional,
|
|
18
|
+
requiredRadiobuttonList,
|
|
19
|
+
requiredCheckboxList,
|
|
20
|
+
requiredSingleCheckbox
|
|
13
21
|
};
|
|
14
22
|
const getResources = (language) => {
|
|
15
23
|
switch (language) {
|
|
@@ -20,6 +28,7 @@ const getResources = (language) => {
|
|
|
20
28
|
};
|
|
21
29
|
const FormFieldTag = (props) => {
|
|
22
30
|
const { id, level, resources, testId } = props;
|
|
31
|
+
const isOptional = level === "optional" || level === "all-optional";
|
|
23
32
|
const { language } = useLanguage(LanguageLocales.NORWEGIAN);
|
|
24
33
|
const defaultResources = getResources(language);
|
|
25
34
|
const mergedResources = {
|
|
@@ -29,7 +38,11 @@ const FormFieldTag = (props) => {
|
|
|
29
38
|
const textMap = {
|
|
30
39
|
"all-required": mergedResources.allRequired,
|
|
31
40
|
"required-field": mergedResources.requiredField,
|
|
32
|
-
optional: mergedResources.optional
|
|
41
|
+
optional: mergedResources.optional,
|
|
42
|
+
"all-optional": mergedResources.allOptional,
|
|
43
|
+
"required-radiobutton-list": mergedResources.requiredRadiobuttonList,
|
|
44
|
+
"required-checkbox-list": mergedResources.requiredCheckboxList,
|
|
45
|
+
"required-single-checkbox": mergedResources.requiredSingleCheckbox
|
|
33
46
|
};
|
|
34
47
|
return /* @__PURE__ */ jsx(
|
|
35
48
|
"span",
|
|
@@ -37,7 +50,7 @@ const FormFieldTag = (props) => {
|
|
|
37
50
|
id,
|
|
38
51
|
"data-testid": testId,
|
|
39
52
|
"data-analyticsid": AnalyticsId.FormFieldTag,
|
|
40
|
-
className: classNames(styles["form-field-tag"], { [styles["form-field-tag--optional"]]:
|
|
53
|
+
className: classNames(styles["form-field-tag"], { [styles["form-field-tag--optional"]]: isOptional }),
|
|
41
54
|
children: textMap[level]
|
|
42
55
|
}
|
|
43
56
|
);
|
package/FormFieldTag.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormFieldTag.js","sources":["../src/components/FormFieldTag/resourceHelper.ts","../src/components/FormFieldTag/FormFieldTag.tsx"],"sourcesContent":["import { LanguageLocales } from '../../constants';\nimport nbNO from '../../resources/HN.Designsystem.FormFieldTag.nb-NO.json';\nimport { HNDesignsystemFormFieldTag } from '../../resources/Resources';\n\nexport const getResources = (language: LanguageLocales): HNDesignsystemFormFieldTag => {\n switch (language) {\n case LanguageLocales.NORWEGIAN:\n default:\n return nbNO;\n }\n};\n","import React from 'react';\n\nimport classNames from 'classnames';\n\nimport { getResources } from './resourceHelper';\nimport { AnalyticsId, LanguageLocales } from '../../constants';\nimport { HNDesignsystemFormFieldTag } from '../../resources/Resources';\nimport { useLanguage } from '../../utils/language';\n\nimport styles from './styles.module.scss';\n\nexport type FormFieldTagLevel
|
|
1
|
+
{"version":3,"file":"FormFieldTag.js","sources":["../src/components/FormFieldTag/resourceHelper.ts","../src/components/FormFieldTag/FormFieldTag.tsx"],"sourcesContent":["import { LanguageLocales } from '../../constants';\nimport nbNO from '../../resources/HN.Designsystem.FormFieldTag.nb-NO.json';\nimport { HNDesignsystemFormFieldTag } from '../../resources/Resources';\n\nexport const getResources = (language: LanguageLocales): HNDesignsystemFormFieldTag => {\n switch (language) {\n case LanguageLocales.NORWEGIAN:\n default:\n return nbNO;\n }\n};\n","import React from 'react';\n\nimport classNames from 'classnames';\n\nimport { getResources } from './resourceHelper';\nimport { AnalyticsId, LanguageLocales } from '../../constants';\nimport { HNDesignsystemFormFieldTag } from '../../resources/Resources';\nimport { useLanguage } from '../../utils/language';\n\nimport styles from './styles.module.scss';\n\nexport type FormFieldTagLevel =\n | 'all-required'\n | 'required-field'\n | 'optional'\n | 'all-optional'\n | 'required-radiobutton-list'\n | 'required-checkbox-list'\n | 'required-single-checkbox';\n\nexport interface FormFieldTagProps {\n /** Id that is placed on the component */\n id?: string;\n /** What level is the required tag, sets the styling and the text. */\n level: FormFieldTagLevel;\n /** Texts if overriding SOT */\n resources?: HNDesignsystemFormFieldTag;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\nconst FormFieldTag: React.FC<FormFieldTagProps> = props => {\n const { id, level, resources, testId } = props;\n const isOptional = level === 'optional' || level === 'all-optional';\n\n const { language } = useLanguage<LanguageLocales>(LanguageLocales.NORWEGIAN);\n const defaultResources = getResources(language);\n\n const mergedResources: HNDesignsystemFormFieldTag = {\n ...defaultResources,\n ...resources,\n };\n\n const textMap = {\n 'all-required': mergedResources.allRequired,\n 'required-field': mergedResources.requiredField,\n optional: mergedResources.optional,\n 'all-optional': mergedResources.allOptional,\n 'required-radiobutton-list': mergedResources.requiredRadiobuttonList,\n 'required-checkbox-list': mergedResources.requiredCheckboxList,\n 'required-single-checkbox': mergedResources.requiredSingleCheckbox,\n };\n\n return (\n <span\n id={id}\n data-testid={testId}\n data-analyticsid={AnalyticsId.FormFieldTag}\n className={classNames(styles['form-field-tag'], { [styles['form-field-tag--optional']]: isOptional })}\n >\n {textMap[level]}\n </span>\n );\n};\n\nexport default FormFieldTag;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAIO,MAAM,eAAe,CAAC,aAA0D;AACrF,UAAQ,UAAA;AAAA,IACN,KAAK,gBAAgB;AAAA,IACrB;AACE,aAAO;AAAA,EAAA;AAEb;ACqBA,MAAM,eAA4C,CAAA,UAAS;AACzD,QAAM,EAAE,IAAI,OAAO,WAAW,WAAW;AACzC,QAAM,aAAa,UAAU,cAAc,UAAU;AAErD,QAAM,EAAE,SAAA,IAAa,YAA6B,gBAAgB,SAAS;AAC3E,QAAM,mBAAmB,aAAa,QAAQ;AAE9C,QAAM,kBAA8C;AAAA,IAClD,GAAG;AAAA,IACH,GAAG;AAAA,EAAA;AAGL,QAAM,UAAU;AAAA,IACd,gBAAgB,gBAAgB;AAAA,IAChC,kBAAkB,gBAAgB;AAAA,IAClC,UAAU,gBAAgB;AAAA,IAC1B,gBAAgB,gBAAgB;AAAA,IAChC,6BAA6B,gBAAgB;AAAA,IAC7C,0BAA0B,gBAAgB;AAAA,IAC1C,4BAA4B,gBAAgB;AAAA,EAAA;AAG9C,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA,eAAa;AAAA,MACb,oBAAkB,YAAY;AAAA,MAC9B,WAAW,WAAW,OAAO,gBAAgB,GAAG,EAAE,CAAC,OAAO,0BAA0B,CAAC,GAAG,YAAY;AAAA,MAEnG,kBAAQ,KAAK;AAAA,IAAA;AAAA,EAAA;AAGpB;"}
|
package/RadioButton.js
CHANGED
|
@@ -64,7 +64,7 @@ const RadioButton = React__default.forwardRef((props, ref) => {
|
|
|
64
64
|
[radioButtonStyles["radio-button-label--on-dark"]]: onDark,
|
|
65
65
|
[radioButtonStyles["radio-button-label--invalid"]]: invalid,
|
|
66
66
|
[radioButtonStyles["radio-button-label__large"]]: isLarge,
|
|
67
|
-
[radioButtonStyles["radio-button-label__large--focused"]]: isFocused,
|
|
67
|
+
[radioButtonStyles["radio-button-label__large--focused"]]: isFocused && isLarge,
|
|
68
68
|
[radioButtonStyles["radio-button-label__large--disabled"]]: isLarge && disabled
|
|
69
69
|
},
|
|
70
70
|
labelClassNames
|
package/RadioButton.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioButton.js","sources":["../src/components/RadioButton/RadioButton.tsx"],"sourcesContent":["import React, { useState } from 'react';\n\nimport classNames from 'classnames';\n\nimport { AnalyticsId, FormOnColor, FormSize } from '../../constants';\nimport { usePseudoClasses } from '../../hooks/usePseudoClasses';\nimport { useUuid } from '../../hooks/useUuid';\nimport { getAriaDescribedBy } from '../../utils/accessibility';\nimport { isMutableRefObject, mergeRefs } from '../../utils/refs';\nimport { uuid } from '../../utils/uuid';\nimport ErrorWrapper, { ErrorWrapperClassNameProps } from '../ErrorWrapper';\nimport { getLabelText, renderLabelAsParent } from '../Label';\n\nimport radioButtonStyles from './styles.module.scss';\n\nexport interface RadioButtonProps\n extends 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}\n\nexport const getRadioLabelClasses = (\n radioId: string,\n onColor: FormOnColor,\n large: boolean,\n checkedRadioId?: string\n): string | undefined => {\n const onCherry = onColor === 'oninvalid';\n const checked = radioId === checkedRadioId;\n\n return classNames({\n [radioButtonStyles['radio-button-label__large--on-grey']]: large && onColor === 'ongrey' && !checked,\n [radioButtonStyles['radio-button-label__large--on-blueberry']]: onColor === 'onblueberry' && !checked && large,\n [radioButtonStyles['radio-button-label__large--selected']]: large && checked && !onCherry,\n [radioButtonStyles['radio-button-label__large--selected-invalid']]: large && checked && onCherry,\n });\n};\n\nexport const RadioButton = React.forwardRef((props: RadioButtonProps, ref: React.Ref<HTMLInputElement>) => {\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 error = !!errorText,\n errorTextId,\n errorWrapperClassName,\n value = getLabelText(label),\n testId,\n required,\n labelClassNames,\n ...rest\n } = props;\n const invalid = error || onColor === FormOnColor.oninvalid;\n const onDark = onColor === FormOnColor.ondark;\n const onBlueberry = onColor === FormOnColor.onblueberry;\n const onCherry = onColor === FormOnColor.oninvalid;\n const isLarge = size === FormSize.large;\n const [checked, changeChecked] = useState<boolean>();\n const { refObject, isFocused } = usePseudoClasses<HTMLInputElement>(isMutableRefObject(ref) ? ref : null);\n const mergedRefs = mergeRefs([ref, refObject]);\n const errorTextUuid = useUuid(errorTextId);\n\n const radioButtonWrapperClasses = classNames(radioButtonStyles['radio-button-wrapper'], {\n [radioButtonStyles['radio-button-wrapper__large']]: isLarge,\n [radioButtonStyles['radio-button-wrapper__large--focused']]: isLarge && isFocused,\n [radioButtonStyles['radio-button-wrapper__large--selected']]: isLarge && checked && isFocused,\n [radioButtonStyles['radio-button-wrapper__large--invalid']]: isLarge && onCherry && isFocused,\n [radioButtonStyles['radio-button-wrapper__large--on-blueberry']]: isLarge && onBlueberry && isFocused,\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--focused']]: isFocused,\n [radioButtonStyles['radio-button-label__large--disabled']]: isLarge && disabled,\n },\n labelClassNames\n );\n const radioButtonClasses = classNames(\n radioButtonStyles['radio-button'],\n {\n [radioButtonStyles['radio-button--on-dark']]: onDark,\n [radioButtonStyles['radio-button--disabled']]: disabled,\n [radioButtonStyles['radio-button--on-blueberry']]: onBlueberry,\n [radioButtonStyles['radio-button--invalid']]: invalid,\n [radioButtonStyles['radio-button__large']]: isLarge,\n [radioButtonStyles['radio-button__large--disabled']]: isLarge && disabled,\n [radioButtonStyles['radio-button__large--invalid']]: isLarge && invalid,\n },\n className\n );\n\n const change = (e: React.ChangeEvent<HTMLInputElement>): void => {\n changeChecked(e.target.checked);\n if (onChange) onChange(e);\n };\n\n const getLabelContent = (): React.ReactNode => (\n <input\n {...rest}\n id={inputId}\n name={name}\n className={radioButtonClasses}\n type=\"radio\"\n disabled={disabled}\n value={value}\n ref={mergedRefs}\n defaultChecked={defaultChecked}\n aria-describedby={getAriaDescribedBy(props, errorTextUuid)}\n required={required}\n onChange={(e): void => change(e)}\n />\n );\n\n return (\n <ErrorWrapper className={errorWrapperClassName} errorText={errorText} errorTextId={errorTextUuid}>\n <div data-testid={testId} data-analyticsid={AnalyticsId.RadioButton} className={radioButtonWrapperClasses}>\n {renderLabelAsParent(\n label,\n getLabelContent(),\n inputId,\n onColor as FormOnColor,\n radioButtonLabelClasses,\n undefined,\n radioButtonStyles['radiobutton-sublabel-wrapper'],\n isLarge\n )}\n </div>\n </ErrorWrapper>\n );\n});\n\nRadioButton.displayName = 'RadioButton';\n\nexport default RadioButton;\n"],"names":["React"],"mappings":";;;;;;;;;;;;AA2CO,MAAM,uBAAuB,CAClC,SACA,SACA,OACA,mBACuB;AACvB,QAAM,WAAW,YAAY;AAC7B,QAAM,UAAU,YAAY;AAE5B,SAAO,WAAW;AAAA,IAChB,CAAC,kBAAkB,oCAAoC,CAAC,GAAG,SAAS,YAAY,YAAY,CAAC;AAAA,IAC7F,CAAC,kBAAkB,yCAAyC,CAAC,GAAG,YAAY,iBAAiB,CAAC,WAAW;AAAA,IACzG,CAAC,kBAAkB,qCAAqC,CAAC,GAAG,SAAS,WAAW,CAAC;AAAA,IACjF,CAAC,kBAAkB,6CAA6C,CAAC,GAAG,SAAS,WAAW;AAAA,EAAA,CACzF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,kBAAkB,6BAA6B,CAAC,GAAG;AAAA,MACpD,CAAC,kBAAkB,2BAA2B,CAAC,GAAG;AAAA,MAClD,CAAC,kBAAkB,oCAAoC,CAAC,GAAG;AAAA,
|
|
1
|
+
{"version":3,"file":"RadioButton.js","sources":["../src/components/RadioButton/RadioButton.tsx"],"sourcesContent":["import React, { useState } from 'react';\n\nimport classNames from 'classnames';\n\nimport { AnalyticsId, FormOnColor, FormSize } from '../../constants';\nimport { usePseudoClasses } from '../../hooks/usePseudoClasses';\nimport { useUuid } from '../../hooks/useUuid';\nimport { getAriaDescribedBy } from '../../utils/accessibility';\nimport { isMutableRefObject, mergeRefs } from '../../utils/refs';\nimport { uuid } from '../../utils/uuid';\nimport ErrorWrapper, { ErrorWrapperClassNameProps } from '../ErrorWrapper';\nimport { getLabelText, renderLabelAsParent } from '../Label';\n\nimport radioButtonStyles from './styles.module.scss';\n\nexport interface RadioButtonProps\n extends 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}\n\nexport const getRadioLabelClasses = (\n radioId: string,\n onColor: FormOnColor,\n large: boolean,\n checkedRadioId?: string\n): string | undefined => {\n const onCherry = onColor === 'oninvalid';\n const checked = radioId === checkedRadioId;\n\n return classNames({\n [radioButtonStyles['radio-button-label__large--on-grey']]: large && onColor === 'ongrey' && !checked,\n [radioButtonStyles['radio-button-label__large--on-blueberry']]: onColor === 'onblueberry' && !checked && large,\n [radioButtonStyles['radio-button-label__large--selected']]: large && checked && !onCherry,\n [radioButtonStyles['radio-button-label__large--selected-invalid']]: large && checked && onCherry,\n });\n};\n\nexport const RadioButton = React.forwardRef((props: RadioButtonProps, ref: React.Ref<HTMLInputElement>) => {\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 error = !!errorText,\n errorTextId,\n errorWrapperClassName,\n value = getLabelText(label),\n testId,\n required,\n labelClassNames,\n ...rest\n } = props;\n const invalid = error || onColor === FormOnColor.oninvalid;\n const onDark = onColor === FormOnColor.ondark;\n const onBlueberry = onColor === FormOnColor.onblueberry;\n const onCherry = onColor === FormOnColor.oninvalid;\n const isLarge = size === FormSize.large;\n const [checked, changeChecked] = useState<boolean>();\n const { refObject, isFocused } = usePseudoClasses<HTMLInputElement>(isMutableRefObject(ref) ? ref : null);\n const mergedRefs = mergeRefs([ref, refObject]);\n const errorTextUuid = useUuid(errorTextId);\n\n const radioButtonWrapperClasses = classNames(radioButtonStyles['radio-button-wrapper'], {\n [radioButtonStyles['radio-button-wrapper__large']]: isLarge,\n [radioButtonStyles['radio-button-wrapper__large--focused']]: isLarge && isFocused,\n [radioButtonStyles['radio-button-wrapper__large--selected']]: isLarge && checked && isFocused,\n [radioButtonStyles['radio-button-wrapper__large--invalid']]: isLarge && onCherry && isFocused,\n [radioButtonStyles['radio-button-wrapper__large--on-blueberry']]: isLarge && onBlueberry && isFocused,\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--focused']]: isFocused && isLarge,\n [radioButtonStyles['radio-button-label__large--disabled']]: isLarge && disabled,\n },\n labelClassNames\n );\n const radioButtonClasses = classNames(\n radioButtonStyles['radio-button'],\n {\n [radioButtonStyles['radio-button--on-dark']]: onDark,\n [radioButtonStyles['radio-button--disabled']]: disabled,\n [radioButtonStyles['radio-button--on-blueberry']]: onBlueberry,\n [radioButtonStyles['radio-button--invalid']]: invalid,\n [radioButtonStyles['radio-button__large']]: isLarge,\n [radioButtonStyles['radio-button__large--disabled']]: isLarge && disabled,\n [radioButtonStyles['radio-button__large--invalid']]: isLarge && invalid,\n },\n className\n );\n\n const change = (e: React.ChangeEvent<HTMLInputElement>): void => {\n changeChecked(e.target.checked);\n if (onChange) onChange(e);\n };\n\n const getLabelContent = (): React.ReactNode => (\n <input\n {...rest}\n id={inputId}\n name={name}\n className={radioButtonClasses}\n type=\"radio\"\n disabled={disabled}\n value={value}\n ref={mergedRefs}\n defaultChecked={defaultChecked}\n aria-describedby={getAriaDescribedBy(props, errorTextUuid)}\n required={required}\n onChange={(e): void => change(e)}\n />\n );\n\n return (\n <ErrorWrapper className={errorWrapperClassName} errorText={errorText} errorTextId={errorTextUuid}>\n <div data-testid={testId} data-analyticsid={AnalyticsId.RadioButton} className={radioButtonWrapperClasses}>\n {renderLabelAsParent(\n label,\n getLabelContent(),\n inputId,\n onColor as FormOnColor,\n radioButtonLabelClasses,\n undefined,\n radioButtonStyles['radiobutton-sublabel-wrapper'],\n isLarge\n )}\n </div>\n </ErrorWrapper>\n );\n});\n\nRadioButton.displayName = 'RadioButton';\n\nexport default RadioButton;\n"],"names":["React"],"mappings":";;;;;;;;;;;;AA2CO,MAAM,uBAAuB,CAClC,SACA,SACA,OACA,mBACuB;AACvB,QAAM,WAAW,YAAY;AAC7B,QAAM,UAAU,YAAY;AAE5B,SAAO,WAAW;AAAA,IAChB,CAAC,kBAAkB,oCAAoC,CAAC,GAA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MACzD;AAAA,MACA,UAAU,CAAC,MAAY,OAAO,CAAC;AAAA,IAAA;AAAA,EAAA;AAInC,SACE,oBAAC,cAAA,EAAa,WAAW,uBAAuB,WAAsB,aAAa,eACjF,UAAA,oBAAC,OAAA,EAAI,eAAa,QAAQ,oBAAkB,YAAY,aAAa,WAAW,2BAC7E,UAAA;AAAA,IACC;AAAA,IACA,gBAAA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,kBAAkB,8BAA8B;AAAA,IAChD;AAAA,EAAA,GAEJ,EAAA,CACF;AAEJ,CAAC;AAED,YAAY,cAAc;"}
|
|
@@ -44,8 +44,6 @@ $with-icons: // icon-class, size-class, padding-left, padding-right, padding-lef
|
|
|
44
44
|
|
|
45
45
|
@if $with-uu-border {
|
|
46
46
|
border: 1px solid var(--color-action-border-ondark-focus);
|
|
47
|
-
} @else {
|
|
48
|
-
border: none;
|
|
49
47
|
}
|
|
50
48
|
}
|
|
51
49
|
|
|
@@ -230,7 +228,6 @@ $with-icons: // icon-class, size-class, padding-left, padding-right, padding-lef
|
|
|
230
228
|
min-height: 2.75rem;
|
|
231
229
|
box-sizing: border-box;
|
|
232
230
|
outline: none;
|
|
233
|
-
border: 0;
|
|
234
231
|
border-radius: 0.5rem;
|
|
235
232
|
letter-spacing: unset;
|
|
236
233
|
|
|
@@ -303,6 +300,9 @@ $with-icons: // icon-class, size-class, padding-left, padding-right, padding-lef
|
|
|
303
300
|
}
|
|
304
301
|
}
|
|
305
302
|
|
|
303
|
+
// Gives space to focus border
|
|
304
|
+
border: 1px solid transparent;
|
|
305
|
+
|
|
306
306
|
:focus > & {
|
|
307
307
|
@include focus-shadow;
|
|
308
308
|
|
|
@@ -13,20 +13,17 @@
|
|
|
13
13
|
margin: 0;
|
|
14
14
|
|
|
15
15
|
&--outline {
|
|
16
|
-
&--neutral
|
|
17
|
-
|
|
16
|
+
&--neutral,
|
|
17
|
+
&--white {
|
|
18
|
+
border: 1px solid var(--component-listelements-border-neutral-light);
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
&--blueberry {
|
|
21
|
-
border: 1px solid var(--
|
|
22
|
+
border: 1px solid var(--component-listelements-border-blueberry-light);
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
&--cherry {
|
|
25
|
-
border: 1px
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
&--white {
|
|
29
|
-
border: 1px solid var(--color-base-border-onlight);
|
|
26
|
+
border: 1px solidvar(--component-listelements-border-cherry-light);
|
|
30
27
|
}
|
|
31
28
|
}
|
|
32
29
|
|
|
@@ -52,25 +49,25 @@
|
|
|
52
49
|
}
|
|
53
50
|
|
|
54
51
|
&--line {
|
|
55
|
-
border-bottom: 1px solid var(--
|
|
52
|
+
border-bottom: 1px solid var(--component-listelements-border-neutral-normal);
|
|
56
53
|
|
|
57
54
|
&:first-of-type {
|
|
58
|
-
border-top: 1px solid var(--
|
|
55
|
+
border-top: 1px solid var(--component-listelements-border-neutral-normal);
|
|
59
56
|
}
|
|
60
57
|
|
|
61
58
|
&--blueberry,
|
|
62
59
|
.expander-list-link--line--blueberry {
|
|
63
|
-
background-color: var(--
|
|
60
|
+
background-color: var(--component-listelements-background-blueberry-light);
|
|
64
61
|
}
|
|
65
62
|
|
|
66
63
|
&--cherry,
|
|
67
64
|
.expander-list-link--line--cherry {
|
|
68
|
-
background-color: var(--
|
|
65
|
+
background-color: var(--component-listelements-background-cherry-light);
|
|
69
66
|
}
|
|
70
67
|
|
|
71
68
|
&--neutral,
|
|
72
69
|
.expander-list-link--line--neutral {
|
|
73
|
-
background-color: var(--
|
|
70
|
+
background-color: var(--component-listelements-background-neutral-light);
|
|
74
71
|
}
|
|
75
72
|
|
|
76
73
|
&--white,
|
|
@@ -82,43 +79,34 @@
|
|
|
82
79
|
&--outline {
|
|
83
80
|
background-color: var(--color-base-background-white);
|
|
84
81
|
|
|
85
|
-
&--white
|
|
86
|
-
|
|
87
|
-
border-
|
|
88
|
-
border-
|
|
82
|
+
&--white,
|
|
83
|
+
&--neutral {
|
|
84
|
+
border-top: spacers.getSpacer(2xs) var(--component-listelements-border-neutral-light) solid;
|
|
85
|
+
border-left: spacers.getSpacer(2xs) var(--component-listelements-border-neutral-light) solid;
|
|
86
|
+
border-right: spacers.getSpacer(2xs) var(--component-listelements-border-neutral-light) solid;
|
|
89
87
|
|
|
90
88
|
&:last-of-type {
|
|
91
|
-
border-bottom: spacers.getSpacer(2xs) var(--
|
|
89
|
+
border-bottom: spacers.getSpacer(2xs) var(--component-listelements-border-neutral-light) solid;
|
|
92
90
|
}
|
|
93
91
|
}
|
|
94
92
|
|
|
95
93
|
&--blueberry {
|
|
96
|
-
border-top: spacers.getSpacer(2xs) var(--
|
|
97
|
-
border-left: spacers.getSpacer(2xs) var(--
|
|
98
|
-
border-right: spacers.getSpacer(2xs) var(--
|
|
94
|
+
border-top: spacers.getSpacer(2xs) var(--component-listelements-border-blueberry-light) solid;
|
|
95
|
+
border-left: spacers.getSpacer(2xs) var(--component-listelements-border-blueberry-light) solid;
|
|
96
|
+
border-right: spacers.getSpacer(2xs) var(--component-listelements-border-blueberry-light) solid;
|
|
99
97
|
|
|
100
98
|
&:last-of-type {
|
|
101
|
-
border-bottom: spacers.getSpacer(2xs) var(--
|
|
99
|
+
border-bottom: spacers.getSpacer(2xs) var(--component-listelements-border-blueberry-light) solid;
|
|
102
100
|
}
|
|
103
101
|
}
|
|
104
102
|
|
|
105
103
|
&--cherry {
|
|
106
|
-
border-top: spacers.getSpacer(2xs) var(--
|
|
107
|
-
border-left: spacers.getSpacer(2xs) var(--
|
|
108
|
-
border-right: spacers.getSpacer(2xs) var(--
|
|
104
|
+
border-top: spacers.getSpacer(2xs) var(--component-listelements-border-cherry-light) solid;
|
|
105
|
+
border-left: spacers.getSpacer(2xs) var(--component-listelements-border-cherry-light) solid;
|
|
106
|
+
border-right: spacers.getSpacer(2xs) var(--component-listelements-border-cherry-light) solid;
|
|
109
107
|
|
|
110
108
|
&:last-of-type {
|
|
111
|
-
border-bottom: spacers.getSpacer(2xs) var(--
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
&--neutral {
|
|
116
|
-
border-top: spacers.getSpacer(2xs) var(--core-color-neutral-100) solid;
|
|
117
|
-
border-left: spacers.getSpacer(2xs) var(--core-color-neutral-100) solid;
|
|
118
|
-
border-right: spacers.getSpacer(2xs) var(--core-color-neutral-100) solid;
|
|
119
|
-
|
|
120
|
-
&:last-of-type {
|
|
121
|
-
border-bottom: spacers.getSpacer(2xs) var(--core-color-neutral-100) solid;
|
|
109
|
+
border-bottom: spacers.getSpacer(2xs) var(--component-listelements-border-cherry-light) solid;
|
|
122
110
|
}
|
|
123
111
|
}
|
|
124
112
|
}
|
|
@@ -126,17 +114,17 @@
|
|
|
126
114
|
&--fill {
|
|
127
115
|
&--blueberry,
|
|
128
116
|
.expander-list-link--fill--blueberry {
|
|
129
|
-
background-color: var(--
|
|
117
|
+
background-color: var(--component-listelements-background-blueberry-light);
|
|
130
118
|
}
|
|
131
119
|
|
|
132
120
|
&--cherry,
|
|
133
121
|
.expander-list-link--fill--cherry {
|
|
134
|
-
background-color: var(--
|
|
122
|
+
background-color: var(--component-listelements-background-cherry-light);
|
|
135
123
|
}
|
|
136
124
|
|
|
137
125
|
&--neutral,
|
|
138
126
|
.expander-list-link--fill--neutral {
|
|
139
|
-
background-color: var(--
|
|
127
|
+
background-color: var(--component-listelements-background-neutral-light);
|
|
140
128
|
}
|
|
141
129
|
|
|
142
130
|
&--white,
|
|
@@ -152,19 +140,16 @@
|
|
|
152
140
|
&--fill,
|
|
153
141
|
&--fill-negative {
|
|
154
142
|
&--blueberry {
|
|
155
|
-
border: 1px solid var(--
|
|
143
|
+
border: 1px solid var(--component-listelements-border-blueberry-normal);
|
|
156
144
|
}
|
|
157
145
|
|
|
158
146
|
&--cherry {
|
|
159
|
-
border: 1px solid var(--
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
&--neutral {
|
|
163
|
-
border: 1px solid var(--color-base-border-onlight);
|
|
147
|
+
border: 1px solid var(--component-listelements-border-cherry-normal);
|
|
164
148
|
}
|
|
165
149
|
|
|
150
|
+
&--neutral,
|
|
166
151
|
&--white {
|
|
167
|
-
border: 1px solid var(--
|
|
152
|
+
border: 1px solid var(--component-listelements-border-neutral-normal);
|
|
168
153
|
}
|
|
169
154
|
}
|
|
170
155
|
|
|
@@ -175,7 +160,7 @@
|
|
|
175
160
|
background-color: transparent;
|
|
176
161
|
|
|
177
162
|
&--new {
|
|
178
|
-
background-color: var(--
|
|
163
|
+
background-color: var(--color-notification-status-info);
|
|
179
164
|
}
|
|
180
165
|
}
|
|
181
166
|
}
|
|
@@ -228,23 +213,23 @@
|
|
|
228
213
|
&[aria-expanded='false'] {
|
|
229
214
|
// expander settes til div om man er i edit mode, og skal da ikke ha hover/active effekter
|
|
230
215
|
&:hover:not(div) {
|
|
231
|
-
background-color: var(--
|
|
216
|
+
background-color: var(--component-listelements-background-neutral-light);
|
|
232
217
|
}
|
|
233
218
|
|
|
234
219
|
&:active:not(div) {
|
|
235
|
-
background-color: var(--
|
|
220
|
+
background-color: var(--component-listelements-background-neutral-medium);
|
|
236
221
|
}
|
|
237
222
|
}
|
|
238
223
|
|
|
239
224
|
&[aria-expanded='true'] {
|
|
240
|
-
background-color: var(--
|
|
225
|
+
background-color: var(--component-listelements-background-neutral-light);
|
|
241
226
|
|
|
242
227
|
&:hover:not(div) {
|
|
243
|
-
background-color: var(--
|
|
228
|
+
background-color: var(--component-listelements-background-neutral-medium);
|
|
244
229
|
}
|
|
245
230
|
|
|
246
231
|
&:active:not(div) {
|
|
247
|
-
background-color: var(--
|
|
232
|
+
background-color: var(--component-listelements-background-neutral-dark);
|
|
248
233
|
}
|
|
249
234
|
}
|
|
250
235
|
}
|
|
@@ -252,23 +237,23 @@
|
|
|
252
237
|
&--blueberry:not(.expander-list-link--outline, .expander-list-link--fill-negative) {
|
|
253
238
|
&[aria-expanded='false'] {
|
|
254
239
|
&:hover:not(div) {
|
|
255
|
-
background-color: var(--
|
|
240
|
+
background-color: var(--component-listelements-background-blueberry-medium);
|
|
256
241
|
}
|
|
257
242
|
|
|
258
243
|
&:active:not(div) {
|
|
259
|
-
background-color: var(--
|
|
244
|
+
background-color: var(--component-listelements-background-blueberry-dark);
|
|
260
245
|
}
|
|
261
246
|
}
|
|
262
247
|
|
|
263
248
|
&[aria-expanded='true'] {
|
|
264
|
-
background-color: var(--
|
|
249
|
+
background-color: var(--component-listelements-background-blueberry-medium);
|
|
265
250
|
|
|
266
251
|
&:hover:not(div) {
|
|
267
|
-
background-color: var(--
|
|
252
|
+
background-color: var(--component-listelements-background-blueberry-dark);
|
|
268
253
|
}
|
|
269
254
|
|
|
270
255
|
&:active:not(div) {
|
|
271
|
-
background-color: var(--
|
|
256
|
+
background-color: var(--component-listelements-background-blueberry-verydark);
|
|
272
257
|
}
|
|
273
258
|
}
|
|
274
259
|
}
|
|
@@ -276,23 +261,23 @@
|
|
|
276
261
|
&--cherry:not(.expander-list-link--outline, .expander-list-link--fill-negative) {
|
|
277
262
|
&[aria-expanded='false'] {
|
|
278
263
|
&:hover:not(div) {
|
|
279
|
-
background-color: var(--
|
|
264
|
+
background-color: var(--component-listelements-background-cherry-medium);
|
|
280
265
|
}
|
|
281
266
|
|
|
282
267
|
&:active:not(div) {
|
|
283
|
-
background-color: var(--
|
|
268
|
+
background-color: var(--component-listelements-background-cherry-dark);
|
|
284
269
|
}
|
|
285
270
|
}
|
|
286
271
|
|
|
287
272
|
&[aria-expanded='true'] {
|
|
288
|
-
background-color: var(--
|
|
273
|
+
background-color: var(--component-listelements-background-cherry-medium);
|
|
289
274
|
|
|
290
275
|
&:hover:not(div) {
|
|
291
|
-
background-color: var(--
|
|
276
|
+
background-color: var(--component-listelements-background-cherry-dark);
|
|
292
277
|
}
|
|
293
278
|
|
|
294
279
|
&:active:not(div) {
|
|
295
|
-
background-color: var(--
|
|
280
|
+
background-color: var(--component-listelements-background-cherry-verydark);
|
|
296
281
|
}
|
|
297
282
|
}
|
|
298
283
|
}
|
|
@@ -300,23 +285,23 @@
|
|
|
300
285
|
&--neutral:not(.expander-list-link--outline, .expander-list-link--fill-negative) {
|
|
301
286
|
&[aria-expanded='false'] {
|
|
302
287
|
&:hover:not(div) {
|
|
303
|
-
background-color: var(--
|
|
288
|
+
background-color: var(--component-listelements-background-neutral-medium);
|
|
304
289
|
}
|
|
305
290
|
|
|
306
291
|
&:active:not(div) {
|
|
307
|
-
background-color: var(--
|
|
292
|
+
background-color: var(--component-listelements-background-neutral-dark);
|
|
308
293
|
}
|
|
309
294
|
}
|
|
310
295
|
|
|
311
296
|
&[aria-expanded='true'] {
|
|
312
|
-
background-color: var(--
|
|
297
|
+
background-color: var(--component-listelements-background-neutral-medium);
|
|
313
298
|
|
|
314
299
|
&:hover:not(div) {
|
|
315
|
-
background-color: var(--
|
|
300
|
+
background-color: var(--component-listelements-background-neutral-dark);
|
|
316
301
|
}
|
|
317
302
|
|
|
318
303
|
&:active:not(div) {
|
|
319
|
-
background-color: var(--
|
|
304
|
+
background-color: var(--component-listelements-background-neutral-verydark);
|
|
320
305
|
}
|
|
321
306
|
}
|
|
322
307
|
}
|
|
@@ -324,25 +309,25 @@
|
|
|
324
309
|
&--outline {
|
|
325
310
|
&--blueberry {
|
|
326
311
|
&[aria-expanded='false'] {
|
|
327
|
-
border-bottom: 1px solid var(--
|
|
312
|
+
border-bottom: 1px solid var(--component-listelements-border-blueberry-normal);
|
|
328
313
|
}
|
|
329
314
|
}
|
|
330
315
|
|
|
331
316
|
&--cherry {
|
|
332
317
|
&[aria-expanded='false'] {
|
|
333
|
-
border-bottom: 1px solid var(--
|
|
318
|
+
border-bottom: 1px solid var(--component-listelements-border-cherry-normal);
|
|
334
319
|
}
|
|
335
320
|
}
|
|
336
321
|
|
|
337
322
|
&--neutral {
|
|
338
323
|
&[aria-expanded='false'] {
|
|
339
|
-
border-bottom: 1px solid var(--
|
|
324
|
+
border-bottom: 1px solid var(--component-listelements-border-neutral-normal);
|
|
340
325
|
}
|
|
341
326
|
}
|
|
342
327
|
|
|
343
328
|
&--white {
|
|
344
329
|
&[aria-expanded='false'] {
|
|
345
|
-
border-bottom: 1px solid var(--
|
|
330
|
+
border-bottom: 1px solid var(--component-listelements-border-neutral-normal);
|
|
346
331
|
}
|
|
347
332
|
}
|
|
348
333
|
}
|
|
@@ -354,23 +339,23 @@
|
|
|
354
339
|
&--blueberry {
|
|
355
340
|
&[aria-expanded='false'] {
|
|
356
341
|
&:hover:not(div) {
|
|
357
|
-
background-color: var(--
|
|
342
|
+
background-color: var(--component-listelements-background-blueberry-light);
|
|
358
343
|
}
|
|
359
344
|
|
|
360
345
|
&:active:not(div) {
|
|
361
|
-
background-color: var(--
|
|
346
|
+
background-color: var(--component-listelements-background-blueberry-medium);
|
|
362
347
|
}
|
|
363
348
|
}
|
|
364
349
|
|
|
365
350
|
&[aria-expanded='true'] {
|
|
366
|
-
background-color: var(--
|
|
351
|
+
background-color: var(--component-listelements-background-blueberry-light);
|
|
367
352
|
|
|
368
353
|
&:hover:not(div) {
|
|
369
|
-
background-color: var(--
|
|
354
|
+
background-color: var(--component-listelements-background-blueberry-medium);
|
|
370
355
|
}
|
|
371
356
|
|
|
372
357
|
&:active:not(div) {
|
|
373
|
-
background-color: var(--
|
|
358
|
+
background-color: var(--component-listelements-background-blueberry-dark);
|
|
374
359
|
}
|
|
375
360
|
}
|
|
376
361
|
}
|
|
@@ -378,23 +363,23 @@
|
|
|
378
363
|
&--cherry {
|
|
379
364
|
&[aria-expanded='false'] {
|
|
380
365
|
&:hover:not(div) {
|
|
381
|
-
background-color: var(--
|
|
366
|
+
background-color: var(--component-listelements-background-cherry-light);
|
|
382
367
|
}
|
|
383
368
|
|
|
384
369
|
&:active:not(div) {
|
|
385
|
-
background-color: var(--
|
|
370
|
+
background-color: var(--component-listelements-background-cherry-medium);
|
|
386
371
|
}
|
|
387
372
|
}
|
|
388
373
|
|
|
389
374
|
&[aria-expanded='true'] {
|
|
390
|
-
background-color: var(--
|
|
375
|
+
background-color: var(--component-listelements-background-cherry-light);
|
|
391
376
|
|
|
392
377
|
&:hover:not(div) {
|
|
393
|
-
background-color: var(--
|
|
378
|
+
background-color: var(--component-listelements-background-cherry-medium);
|
|
394
379
|
}
|
|
395
380
|
|
|
396
381
|
&:active:not(div) {
|
|
397
|
-
background-color: var(--
|
|
382
|
+
background-color: var(--component-listelements-background-cherry-dark);
|
|
398
383
|
}
|
|
399
384
|
}
|
|
400
385
|
}
|
|
@@ -403,23 +388,23 @@
|
|
|
403
388
|
&--white {
|
|
404
389
|
&[aria-expanded='false'] {
|
|
405
390
|
&:hover:not(div) {
|
|
406
|
-
background-color: var(--
|
|
391
|
+
background-color: var(--component-listelements-background-neutral-light);
|
|
407
392
|
}
|
|
408
393
|
|
|
409
394
|
&:active:not(div) {
|
|
410
|
-
background-color: var(--
|
|
395
|
+
background-color: var(--component-listelements-background-neutral-medium);
|
|
411
396
|
}
|
|
412
397
|
}
|
|
413
398
|
|
|
414
399
|
&[aria-expanded='true'] {
|
|
415
|
-
background-color: var(--
|
|
400
|
+
background-color: var(--component-listelements-background-neutral-light);
|
|
416
401
|
|
|
417
402
|
&:hover:not(div) {
|
|
418
|
-
background-color: var(--
|
|
403
|
+
background-color: var(--component-listelements-background-neutral-medium);
|
|
419
404
|
}
|
|
420
405
|
|
|
421
406
|
&:active:not(div) {
|
|
422
|
-
background-color: var(--
|
|
407
|
+
background-color: var(--component-listelements-background-neutral-dark);
|
|
423
408
|
}
|
|
424
409
|
}
|
|
425
410
|
}
|
|
@@ -431,25 +416,25 @@
|
|
|
431
416
|
}
|
|
432
417
|
|
|
433
418
|
&--new {
|
|
434
|
-
background-color: var(--
|
|
419
|
+
background-color: var(--component-listelements-background-blueberry-light) !important;
|
|
435
420
|
|
|
436
421
|
&:hover:not(div) {
|
|
437
|
-
background-color: var(--
|
|
422
|
+
background-color: var(--component-listelements-background-blueberry-medium) !important;
|
|
438
423
|
}
|
|
439
424
|
|
|
440
425
|
&:active:not(div) {
|
|
441
|
-
background-color: var(--
|
|
426
|
+
background-color: var(--component-listelements-background-blueberry-dark) !important;
|
|
442
427
|
}
|
|
443
428
|
|
|
444
429
|
&[aria-expanded='true'] {
|
|
445
|
-
background-color: var(--
|
|
430
|
+
background-color: var(--component-listelements-background-blueberry-medium) !important;
|
|
446
431
|
|
|
447
432
|
&:hover:not(div) {
|
|
448
|
-
background-color: var(--
|
|
433
|
+
background-color: var(--component-listelements-background-blueberry-dark) !important;
|
|
449
434
|
}
|
|
450
435
|
|
|
451
436
|
&:active:not(div) {
|
|
452
|
-
background-color: var(--
|
|
437
|
+
background-color: var(--component-listelements-background-blueberry-verydark) !important;
|
|
453
438
|
}
|
|
454
439
|
}
|
|
455
440
|
}
|
|
@@ -482,7 +467,7 @@
|
|
|
482
467
|
}
|
|
483
468
|
|
|
484
469
|
&--new {
|
|
485
|
-
background-color: var(--
|
|
470
|
+
background-color: var(--component-listelements-background-blueberry-light);
|
|
486
471
|
}
|
|
487
472
|
|
|
488
473
|
&--padding {
|
|
@@ -492,25 +477,20 @@
|
|
|
492
477
|
&--outline {
|
|
493
478
|
&--blueberry {
|
|
494
479
|
&[aria-expanded='true'] {
|
|
495
|
-
border-bottom: 1px solid var(--
|
|
480
|
+
border-bottom: 1px solid var(--component-listelements-border-blueberry-normal);
|
|
496
481
|
}
|
|
497
482
|
}
|
|
498
483
|
|
|
499
484
|
&--cherry {
|
|
500
485
|
&[aria-expanded='true'] {
|
|
501
|
-
border-bottom: 1px solid var(--
|
|
502
|
-
}
|
|
503
|
-
}
|
|
504
|
-
|
|
505
|
-
&--neutral {
|
|
506
|
-
&[aria-expanded='true'] {
|
|
507
|
-
border-bottom: 1px solid var(--color-base-border-onlight);
|
|
486
|
+
border-bottom: 1px solid var(--component-listelements-border-cherry-normal);
|
|
508
487
|
}
|
|
509
488
|
}
|
|
510
489
|
|
|
490
|
+
&--neutral,
|
|
511
491
|
&--white {
|
|
512
492
|
&[aria-expanded='true'] {
|
|
513
|
-
border-bottom: 1px solid var(--
|
|
493
|
+
border-bottom: 1px solid var(--component-listelements-border-neutral-normal);
|
|
514
494
|
}
|
|
515
495
|
}
|
|
516
496
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { HNDesignsystemFormFieldTag } from '../../resources/Resources';
|
|
3
|
-
export type FormFieldTagLevel = 'all-required' | 'required-field' | 'optional';
|
|
3
|
+
export type FormFieldTagLevel = 'all-required' | 'required-field' | 'optional' | 'all-optional' | 'required-radiobutton-list' | 'required-checkbox-list' | 'required-single-checkbox';
|
|
4
4
|
export interface FormFieldTagProps {
|
|
5
5
|
/** Id that is placed on the component */
|
|
6
6
|
id?: string;
|
|
@@ -28,12 +28,12 @@ $status-dot-size: 1rem;
|
|
|
28
28
|
|
|
29
29
|
&--success,
|
|
30
30
|
&--active {
|
|
31
|
-
fill: var(--
|
|
31
|
+
fill: var(--component-statusdot-graphics-kiwi-onlight);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
&--success#{&}--on-dark,
|
|
35
35
|
&--active#{&}--on-dark {
|
|
36
|
-
fill: var(--
|
|
36
|
+
fill: var(--component-statusdot-graphics-kiwi-ondark);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
&--inprocess,
|
|
@@ -41,7 +41,7 @@ $status-dot-size: 1rem;
|
|
|
41
41
|
&--unknown,
|
|
42
42
|
&--inspected,
|
|
43
43
|
&--pending {
|
|
44
|
-
fill: var(--
|
|
44
|
+
fill: var(--component-statusdot-graphics-banana-onlight);
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
&--inprocess#{&}--on-dark,
|
|
@@ -49,27 +49,27 @@ $status-dot-size: 1rem;
|
|
|
49
49
|
&--unknown#{&}--on-dark,
|
|
50
50
|
&--inspected#{&}--on-dark,
|
|
51
51
|
&--pending#{&}--on-dark {
|
|
52
|
-
fill: var(--
|
|
52
|
+
fill: var(--component-statusdot-graphics-banana-ondark);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
&--cancelled,
|
|
56
56
|
&--alert,
|
|
57
57
|
&--inactive {
|
|
58
|
-
fill: var(--
|
|
58
|
+
fill: var(--component-statusdot-graphics-cherry-onlight);
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
&--cancelled#{&}--on-dark,
|
|
62
62
|
&--alert#{&}--on-dark,
|
|
63
63
|
&--inactive#{&}--on-dark {
|
|
64
|
-
fill: var(--
|
|
64
|
+
fill: var(--component-statusdot-graphics-cherry-ondark);
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
&--info {
|
|
68
|
-
fill: var(--
|
|
68
|
+
fill: var(--component-statusdot-graphics-blueberry-onlight);
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
&--info#{&}--on-dark {
|
|
72
|
-
fill: var(--
|
|
72
|
+
fill: var(--component-statusdot-graphics-blueberry-ondark);
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
&--transparent {
|
|
@@ -93,7 +93,7 @@ $status-dot-size: 1rem;
|
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
&__label {
|
|
96
|
-
color: var(--
|
|
96
|
+
color: var(--color-base-text-onlight-subdued);
|
|
97
97
|
|
|
98
98
|
@include fonts.sublabel-subdued;
|
|
99
99
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
2
|
"allRequired": "Alle felt må fylles ut",
|
|
3
3
|
"requiredField": "Må fylles ut",
|
|
4
|
-
"optional": "Valgfritt"
|
|
4
|
+
"optional": "Valgfritt",
|
|
5
|
+
"allOptional": "Alle felt er valgfrie",
|
|
6
|
+
"requiredRadiobuttonList": "Velg én",
|
|
7
|
+
"requiredCheckboxList": "Velg en eller flere",
|
|
8
|
+
"requiredSingleCheckbox": "Må velges"
|
|
5
9
|
}
|
|
6
10
|
;
|
|
7
11
|
|
|
File without changes
|