@helsenorge/designsystem-react 14.10.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/BabyMobileMedium.js +1 -1
- package/lib/CHANGELOG.md +16 -0
- package/lib/Checkbox.js +25 -48
- package/lib/Checkbox.js.map +1 -1
- package/lib/CheckboxMarker.js +60 -0
- package/lib/CheckboxMarker.js.map +1 -0
- package/lib/ChildMedium.js +1 -1
- package/lib/EyeContactMedium.js +79 -0
- package/lib/EyeContactMedium.js.map +1 -0
- package/lib/FacialRecognitionFingerprintMedium.js +1 -1
- package/lib/Filter.js +12 -12
- package/lib/Filter.js.map +1 -1
- package/lib/FormGroup.js +5 -5
- package/lib/FormGroup.js.map +1 -1
- package/lib/GiveBabyFoodMedium.js +1 -1
- package/lib/Illustration.js +1 -1
- package/lib/IllustrationNames.js +4 -0
- package/lib/IllustrationNames.js.map +1 -1
- package/lib/LazyIllustration.js +5 -1
- package/lib/LazyIllustration.js.map +1 -1
- package/lib/Radio.js +73 -0
- package/lib/Radio.js.map +1 -0
- package/lib/RadioButton.js +81 -3
- package/lib/RadioButton.js.map +1 -1
- package/lib/RadioButton2.js +3 -73
- package/lib/RadioButton2.js.map +1 -1
- package/lib/RadioMarker.js +31 -0
- package/lib/RadioMarker.js.map +1 -0
- package/lib/ReadLettersMedium.js +1 -1
- package/lib/Search.js +4 -4
- package/lib/Search.js.map +1 -1
- package/lib/SkinToSkinMedium.js +106 -0
- package/lib/SkinToSkinMedium.js.map +1 -0
- package/lib/StorkMedium.js +1 -1
- package/lib/StrollerMedium.js +1 -1
- package/lib/Support2Medium.js +1 -1
- package/lib/TableBody.js +1 -1
- package/lib/TableHead.js +1 -1
- package/lib/TableRow.js +1 -1
- package/lib/ThinkingMedium.js +1 -1
- package/lib/VisualCheckbox.js +77 -0
- package/lib/VisualCheckbox.js.map +1 -0
- package/lib/VisualRadio.js +62 -0
- package/lib/VisualRadio.js.map +1 -0
- package/lib/__mocks__/matchMedia.js +3 -2
- package/lib/__mocks__/matchMedia.js.map +1 -1
- package/lib/components/Checkbox/CheckboxMarker/CheckboxMarker.d.ts +20 -0
- package/lib/components/Checkbox/CheckboxMarker/styles.module.scss +309 -0
- package/lib/components/Checkbox/CheckboxMarker/styles.module.scss.d.ts +25 -0
- package/lib/components/Checkbox/styles.module.scss +9 -269
- package/lib/components/Checkbox/styles.module.scss.d.ts +1 -17
- package/lib/components/Icons/Sort.js +12 -12
- package/lib/components/Icons/Sort.js.map +1 -1
- package/lib/components/Illustration/index.js +1 -1
- package/lib/components/Illustrations/BabyMobile.js +1 -1
- package/lib/components/Illustrations/Child.js +1 -1
- package/lib/components/Illustrations/Doctor.js +1 -1
- package/lib/components/Illustrations/EyeContact.d.ts +8 -0
- package/lib/components/Illustrations/EyeContact.js +16 -0
- package/lib/components/Illustrations/EyeContact.js.map +1 -0
- package/lib/components/Illustrations/EyeContactMedium.d.ts +3 -0
- package/lib/components/Illustrations/EyeContactMedium.js +2 -0
- package/lib/components/Illustrations/FacialRecognitionFingerprint.js +1 -1
- package/lib/components/Illustrations/GiveBabyFood.js +1 -1
- package/lib/components/Illustrations/HealthcarePersonnel.js +1 -1
- package/lib/components/Illustrations/IllustrationNames.d.ts +1 -1
- package/lib/components/Illustrations/ReadLetters.js +1 -1
- package/lib/components/Illustrations/SkinToSkin.d.ts +8 -0
- package/lib/components/Illustrations/SkinToSkin.js +16 -0
- package/lib/components/Illustrations/SkinToSkin.js.map +1 -0
- package/lib/components/Illustrations/SkinToSkinMedium.d.ts +3 -0
- package/lib/components/Illustrations/SkinToSkinMedium.js +2 -0
- package/lib/components/Illustrations/Stork.js +1 -1
- package/lib/components/Illustrations/Stroller.js +1 -1
- package/lib/components/Illustrations/Support2.js +1 -1
- package/lib/components/Illustrations/Thinking.js +1 -1
- package/lib/components/Panel/index.js +1 -1
- package/lib/components/PanelList/index.js +1 -1
- package/lib/components/RadioButton/RadioMarker/RadioMarker.d.ts +20 -0
- package/lib/components/RadioButton/RadioMarker/styles.module.scss +288 -0
- package/lib/components/RadioButton/RadioMarker/styles.module.scss.d.ts +20 -0
- package/lib/components/RadioButton/index.d.ts +0 -1
- package/lib/components/RadioButton/index.js +3 -3
- package/lib/components/RadioButton/styles.module.scss +13 -275
- package/lib/components/RadioButton/styles.module.scss.d.ts +2 -12
- package/lib/components/Table/index.js +1 -1
- package/lib/components/Validation/index.js +1 -1
- package/lib/components/VisualCheckboxCloud/Checkbox/styles.module.scss +5 -128
- package/lib/components/VisualCheckboxCloud/styles.module.scss +2 -9
- package/lib/components/VisualCheckboxGroup/VisualCheckbox/VisualCheckbox.d.ts +26 -0
- package/lib/components/VisualCheckboxGroup/VisualCheckbox/VisualContent.d.ts +10 -0
- package/lib/components/VisualCheckboxGroup/VisualCheckbox/index.d.ts +3 -0
- package/lib/components/VisualCheckboxGroup/VisualCheckbox/index.js +5 -0
- package/lib/components/VisualCheckboxGroup/VisualCheckbox/index.js.map +1 -0
- package/lib/components/VisualCheckboxGroup/VisualCheckbox/styles.module.scss +7 -0
- package/lib/components/VisualCheckboxGroup/VisualCheckbox/styles.module.scss.d.ts +18 -0
- package/lib/components/VisualCheckboxGroup/VisualCheckboxGroup.d.ts +33 -0
- package/lib/components/VisualCheckboxGroup/index.d.ts +3 -0
- package/lib/components/VisualCheckboxGroup/index.js +43 -0
- package/lib/components/VisualCheckboxGroup/index.js.map +1 -0
- package/lib/components/VisualCheckboxGroup/styles.module.scss +6 -0
- package/lib/components/VisualCheckboxGroup/styles.module.scss.d.ts +10 -0
- package/lib/components/{VisualRadioButtonCloud/RadioButton/RadioButton.d.ts → VisualRadioCloud/Radio/Radio.d.ts} +3 -3
- package/lib/components/VisualRadioCloud/Radio/index.d.ts +3 -0
- package/lib/components/VisualRadioCloud/Radio/index.js +5 -0
- package/lib/components/VisualRadioCloud/Radio/index.js.map +1 -0
- package/lib/components/VisualRadioCloud/Radio/styles.module.scss +7 -0
- package/lib/components/VisualRadioCloud/Radio/styles.module.scss.d.ts +15 -0
- package/lib/components/{VisualRadioButtonCloud/VisualRadioButtonCloud.d.ts → VisualRadioCloud/VisualRadioCloud.d.ts} +8 -8
- package/lib/components/VisualRadioCloud/index.d.ts +3 -0
- package/lib/components/{VisualRadioButtonCloud → VisualRadioCloud}/index.js +7 -7
- package/lib/components/VisualRadioCloud/index.js.map +1 -0
- package/lib/components/VisualRadioCloud/styles.module.scss +6 -0
- package/lib/components/{VisualRadioButtonCloud → VisualRadioCloud}/styles.module.scss.d.ts +1 -1
- package/lib/components/VisualRadioGroup/VisualRadio/VisualContent.d.ts +10 -0
- package/lib/components/VisualRadioGroup/VisualRadio/VisualRadio.d.ts +26 -0
- package/lib/components/VisualRadioGroup/VisualRadio/index.d.ts +3 -0
- package/lib/components/VisualRadioGroup/VisualRadio/index.js +5 -0
- package/lib/components/VisualRadioGroup/VisualRadio/index.js.map +1 -0
- package/lib/components/VisualRadioGroup/VisualRadio/styles.module.scss +7 -0
- package/lib/components/VisualRadioGroup/VisualRadio/styles.module.scss.d.ts +18 -0
- package/lib/components/VisualRadioGroup/VisualRadioGroup.d.ts +39 -0
- package/lib/components/VisualRadioGroup/index.d.ts +3 -0
- package/lib/components/VisualRadioGroup/index.js +63 -0
- package/lib/components/VisualRadioGroup/index.js.map +1 -0
- package/lib/components/VisualRadioGroup/styles.module.scss +6 -0
- package/lib/components/VisualRadioGroup/styles.module.scss.d.ts +10 -0
- 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 +357 -0
- package/lib/utils3.js +10 -98
- package/lib/utils3.js.map +1 -1
- package/lib/utils4.js +28 -11
- package/lib/utils4.js.map +1 -1
- package/lib/utils5.js +58 -28
- package/lib/utils5.js.map +1 -1
- package/package.json +115 -1
- package/scss/_visual-form.scss +357 -0
- package/lib/components/RadioButton/utils.d.ts +0 -2
- package/lib/components/VisualRadioButtonCloud/RadioButton/index.d.ts +0 -3
- package/lib/components/VisualRadioButtonCloud/RadioButton/index.js +0 -5
- package/lib/components/VisualRadioButtonCloud/RadioButton/index.js.map +0 -1
- package/lib/components/VisualRadioButtonCloud/RadioButton/styles.module.scss +0 -133
- package/lib/components/VisualRadioButtonCloud/RadioButton/styles.module.scss.d.ts +0 -15
- package/lib/components/VisualRadioButtonCloud/index.d.ts +0 -3
- package/lib/components/VisualRadioButtonCloud/index.js.map +0 -1
- package/lib/components/VisualRadioButtonCloud/styles.module.scss +0 -13
- package/lib/utils6.js +0 -60
- package/lib/utils6.js.map +0 -1
package/lib/FormGroup.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormGroup.js","names":["FormGroup: React.FC<FormGroupProps>"],"sources":["../src/components/FormGroup/FormGroup.tsx"],"sourcesContent":["import React, { useId, useState } from 'react';\n\nimport classNames from 'classnames';\n\nimport type { CheckboxProps } from '../Checkbox/Checkbox';\nimport type { FormFieldTagProps } from '../FormFieldTag';\nimport type { FormLayoutProps } from '../FormLayout';\nimport type { InputProps } from '../Input/Input';\nimport type { RadioButtonProps } from '../RadioButton/RadioButton';\nimport type { SelectProps } from '../Select';\nimport type { SliderProps } from '../Slider';\nimport type { TextareaProps } from '../Textarea';\n\nimport { AnalyticsId, FormOnColor, FormSize } from '../../constants';\nimport { useIdWithFallback } from '../../hooks/useIdWithFallback';\nimport { isComponent } from '../../utils/component';\nimport Checkbox from '../Checkbox/Checkbox';\nimport ErrorWrapper from '../ErrorWrapper';\nimport FormFieldTag from '../FormFieldTag';\nimport FormLayout from '../FormLayout';\nimport Input from '../Input/Input';\nimport RadioButton from '../RadioButton/RadioButton';\nimport { getRadioLabelClasses } from '../RadioButton/utils';\nimport Select from '../Select';\nimport Slider from '../Slider';\nimport Textarea from '../Textarea';\nimport Title, { type TitleTags } from '../Title';\n\nimport formGroupStyles from './styles.module.scss';\n\nexport type FormGroupTags = 'fieldset' | 'div';\n\nexport interface FormGroupProps {\n /** Can be used as a replacement text for legend in cases where the group title already exists externally */\n ariaLabelledBy?: string;\n /** title for the the fieldset */\n title?: string;\n /** text placed in the legend tag of the fieldset */\n legend?: string;\n /** id for the legend tag */\n legendId?: string;\n /** Items in the FormGroup component */\n children?: React.ReactNode;\n /** Adds custom classes to the element. */\n className?: string;\n /** Adds custom classes to the errorWrapper. */\n errorWrapperClassName?: string;\n /** Adds custom classes to the fieldset element. */\n fieldsetClassName?: string;\n /** Sets a tag that describes whether the form group is required or optional */\n formFieldTag?: React.ReactNode;\n /** Adds custom classes to the legend element. */\n legendClassName?: string;\n /** Changes the visuals of the formgroup */\n onColor?: keyof typeof FormOnColor;\n /** Changes the visuals of the formgroup */\n size?: keyof typeof FormSize;\n /** Error message */\n error?: string;\n /** Error text id */\n errorTextId?: string;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Sets the data-testid attribute for the error-wrapper. */\n errorWrapperTestId?: string;\n /** Unique name for the child input element */\n name?: string;\n /** Unique name for the fieldset */\n fieldsetName?: string;\n /** Sets div instead of fieldset tag */\n htmlMarkup?: FormGroupTags;\n /** Markup for legend if formgroup htmlMarkup is div*/\n legendHtmlMarkup?: TitleTags;\n /** Markup for title */\n titleHtmlMarkup?: TitleTags;\n /** Renders the error component (Default: true) */\n renderError?: boolean;\n /** Ref passed to the error message element */\n errorMessageRef?: React.Ref<HTMLDivElement | null>;\n}\n\nexport const FormGroup: React.FC<FormGroupProps> = (props: FormGroupProps) => {\n const {\n ariaLabelledBy,\n className,\n errorTextId: errorTextIdProp,\n fieldsetClassName,\n formFieldTag,\n legendClassName,\n legendId,\n onColor = FormOnColor.onwhite,\n size = FormSize.medium,\n error,\n name,\n htmlMarkup = 'fieldset',\n renderError = true,\n errorWrapperClassName,\n errorWrapperTestId,\n errorMessageRef,\n legendHtmlMarkup = 'h5',\n titleHtmlMarkup = 'h4',\n } = props;\n const [checkedRadioId, setCheckedRadioId] = useState<string>();\n const radioGroupId = useId();\n const errorTextId = useIdWithFallback(errorTextIdProp);\n const onDark = onColor === FormOnColor.ondark;\n const isLarge = size === FormSize.large;\n const formGroupWrapperClasses = classNames(formGroupStyles['form-group-wrapper'], className);\n const titleClasses = classNames({\n [formGroupStyles['form-group-wrapper__title--on-dark']]: onDark && !error,\n });\n\n const CustomTagForLegend = legendHtmlMarkup;\n\n const legendClasses = classNames(\n formGroupStyles['field-set__legend'],\n {\n [formGroupStyles['field-set__legend--on-dark']]: onDark && !error,\n },\n legendClassName\n );\n\n const fieldsetClasses = classNames(formGroupStyles['field-set'], fieldsetClassName);\n\n const mapFormComponent = (child: React.ReactNode, index: number): React.ReactNode => {\n if (isComponent<FormLayoutProps>(child, FormLayout)) {\n return React.cloneElement(child, {\n size,\n mapHelper: mapFormComponent,\n });\n } else if (isComponent<FormGroupProps>(child, FormGroup)) {\n return React.cloneElement(child, {\n onColor,\n size,\n error,\n renderError: false,\n errorTextId: errorTextId,\n });\n } else if (isComponent<CheckboxProps>(child, Checkbox)) {\n return React.cloneElement(child, {\n name: name ?? child.props.name,\n onColor,\n size,\n error: !!error,\n errorTextId: errorTextId,\n });\n } else if (isComponent<RadioButtonProps>(child, RadioButton)) {\n const radioId = typeof child.props.inputId === 'undefined' ? radioGroupId + index : child.props.inputId;\n return React.cloneElement(child, {\n inputId: radioId,\n name: name ?? child.props.name,\n onColor,\n size,\n onChange: (event: React.ChangeEvent<HTMLInputElement>) => {\n setCheckedRadioId(event.target.id);\n if (child.props.onChange) child.props.onChange(event);\n },\n error: !!error,\n errorTextId: errorTextId,\n labelClassNames: getRadioLabelClasses(radioId, onColor as FormOnColor, isLarge, checkedRadioId),\n });\n } else if (isComponent<InputProps>(child, Input)) {\n return React.cloneElement(child, {\n name: name ?? child.props.name,\n onColor,\n size,\n error: !!error,\n errorTextId: errorTextId,\n });\n } else if (isComponent<TextareaProps>(child, Textarea)) {\n return React.cloneElement(child, {\n name: name ?? child.props.name,\n onColor,\n error: !!error,\n errorTextId: errorTextId,\n });\n } else if (isComponent<SelectProps>(child, Select)) {\n return React.cloneElement(child, {\n name: name ?? child.props.name,\n onColor,\n error: !!error,\n errorTextId: errorTextId,\n });\n } else if (isComponent<SliderProps>(child, Slider)) {\n return React.cloneElement(child, {\n name: name ?? child.props.name,\n error: !!error,\n errorTextId: errorTextId,\n });\n }\n return child;\n };\n\n const formGroupContent = (): React.ReactNode => {\n return (\n <div>\n {htmlMarkup === 'div' && (\n <div className={fieldsetClasses}>\n {props.legend && (\n <>\n <CustomTagForLegend id={legendId} className={legendClasses}>\n {props.legend}\n {formFieldTag && isComponent<FormFieldTagProps>(formFieldTag, FormFieldTag) && React.cloneElement(formFieldTag)}\n </CustomTagForLegend>\n </>\n )}\n {React.Children.map(props.children, mapFormComponent)}\n </div>\n )}\n {htmlMarkup === 'fieldset' && (\n <fieldset aria-labelledby={ariaLabelledBy} name={props.fieldsetName} className={fieldsetClasses}>\n {props.legend && (\n <>\n <legend id={legendId} className={legendClasses}>\n {props.legend}\n {formFieldTag && isComponent<FormFieldTagProps>(formFieldTag, FormFieldTag) && React.cloneElement(formFieldTag)}\n </legend>\n </>\n )}\n {React.Children.map(props.children, mapFormComponent)}\n </fieldset>\n )}\n </div>\n );\n };\n\n return (\n <div data-testid={props.testId} data-analyticsid={AnalyticsId.FormGroup} className={formGroupWrapperClasses}>\n {props.title && (\n <Title\n className={titleClasses}\n htmlMarkup={titleHtmlMarkup}\n appearance={'title4'}\n margin={{ marginTop: 0, marginBottom: error ? 1 : 2 }}\n >\n {props.title}\n </Title>\n )}\n <ErrorWrapper\n className={errorWrapperClassName}\n errorText={error}\n testId={errorWrapperTestId}\n errorTextId={errorTextId}\n errorMessageRef={errorMessageRef}\n renderError={renderError}\n >\n {formGroupContent()}\n </ErrorWrapper>\n </div>\n );\n};\n\nFormGroup.displayName = 'FormGroup';\n\nexport default FormGroup;\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"FormGroup.js","names":["FormGroup: React.FC<FormGroupProps>"],"sources":["../src/components/FormGroup/FormGroup.tsx"],"sourcesContent":["import React, { useId, useState } from 'react';\n\nimport classNames from 'classnames';\n\nimport type { CheckboxProps } from '../Checkbox/Checkbox';\nimport type { FormFieldTagProps } from '../FormFieldTag';\nimport type { FormLayoutProps } from '../FormLayout';\nimport type { InputProps } from '../Input/Input';\nimport type { RadioButtonProps } from '../RadioButton/RadioButton';\nimport type { SelectProps } from '../Select';\nimport type { SliderProps } from '../Slider';\nimport type { TextareaProps } from '../Textarea';\n\nimport { AnalyticsId, FormOnColor, FormSize } from '../../constants';\nimport { useIdWithFallback } from '../../hooks/useIdWithFallback';\nimport { isComponent } from '../../utils/component';\nimport Checkbox from '../Checkbox/Checkbox';\nimport ErrorWrapper from '../ErrorWrapper';\nimport FormFieldTag from '../FormFieldTag';\nimport FormLayout from '../FormLayout';\nimport Input from '../Input/Input';\nimport RadioButton from '../RadioButton/RadioButton';\nimport Select from '../Select';\nimport Slider from '../Slider';\nimport Textarea from '../Textarea';\nimport Title, { type TitleTags } from '../Title';\n\nimport formGroupStyles from './styles.module.scss';\n\nexport type FormGroupTags = 'fieldset' | 'div';\n\nexport interface FormGroupProps {\n /** Can be used as a replacement text for legend in cases where the group title already exists externally */\n ariaLabelledBy?: string;\n /** title for the the fieldset */\n title?: string;\n /** text placed in the legend tag of the fieldset */\n legend?: string;\n /** id for the legend tag */\n legendId?: string;\n /** Items in the FormGroup component */\n children?: React.ReactNode;\n /** Adds custom classes to the element. */\n className?: string;\n /** Adds custom classes to the errorWrapper. */\n errorWrapperClassName?: string;\n /** Adds custom classes to the fieldset element. */\n fieldsetClassName?: string;\n /** Sets a tag that describes whether the form group is required or optional */\n formFieldTag?: React.ReactNode;\n /** Adds custom classes to the legend element. */\n legendClassName?: string;\n /** Changes the visuals of the formgroup */\n onColor?: keyof typeof FormOnColor;\n /** Changes the visuals of the formgroup */\n size?: keyof typeof FormSize;\n /** Error message */\n error?: string;\n /** Error text id */\n errorTextId?: string;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Sets the data-testid attribute for the error-wrapper. */\n errorWrapperTestId?: string;\n /** Unique name for the child input element */\n name?: string;\n /** Unique name for the fieldset */\n fieldsetName?: string;\n /** Sets div instead of fieldset tag */\n htmlMarkup?: FormGroupTags;\n /** Markup for legend if formgroup htmlMarkup is div*/\n legendHtmlMarkup?: TitleTags;\n /** Markup for title */\n titleHtmlMarkup?: TitleTags;\n /** Renders the error component (Default: true) */\n renderError?: boolean;\n /** Ref passed to the error message element */\n errorMessageRef?: React.Ref<HTMLDivElement | null>;\n}\n\nexport const FormGroup: React.FC<FormGroupProps> = (props: FormGroupProps) => {\n const {\n ariaLabelledBy,\n className,\n errorTextId: errorTextIdProp,\n fieldsetClassName,\n formFieldTag,\n legendClassName,\n legendId,\n onColor = FormOnColor.onwhite,\n size = FormSize.medium,\n error,\n name,\n htmlMarkup = 'fieldset',\n renderError = true,\n errorWrapperClassName,\n errorWrapperTestId,\n errorMessageRef,\n legendHtmlMarkup = 'h5',\n titleHtmlMarkup = 'h4',\n } = props;\n const radioGroupId = useId();\n const [checkedRadioId, setCheckedRadioId] = useState<string>();\n const errorTextId = useIdWithFallback(errorTextIdProp);\n const onDark = onColor === FormOnColor.ondark;\n const formGroupWrapperClasses = classNames(formGroupStyles['form-group-wrapper'], className);\n const titleClasses = classNames({\n [formGroupStyles['form-group-wrapper__title--on-dark']]: onDark && !error,\n });\n\n const CustomTagForLegend = legendHtmlMarkup;\n\n const legendClasses = classNames(\n formGroupStyles['field-set__legend'],\n {\n [formGroupStyles['field-set__legend--on-dark']]: onDark && !error,\n },\n legendClassName\n );\n\n const fieldsetClasses = classNames(formGroupStyles['field-set'], fieldsetClassName);\n\n const mapFormComponent = (child: React.ReactNode, index: number): React.ReactNode => {\n if (isComponent<FormLayoutProps>(child, FormLayout)) {\n return React.cloneElement(child, {\n size,\n mapHelper: mapFormComponent,\n });\n } else if (isComponent<FormGroupProps>(child, FormGroup)) {\n return React.cloneElement(child, {\n onColor,\n size,\n error,\n renderError: false,\n errorTextId: errorTextId,\n });\n } else if (isComponent<CheckboxProps>(child, Checkbox)) {\n return React.cloneElement(child, {\n name: name ?? child.props.name,\n onColor,\n size,\n error: !!error,\n errorTextId: errorTextId,\n });\n } else if (isComponent<RadioButtonProps>(child, RadioButton)) {\n const radioId = typeof child.props.inputId === 'undefined' ? radioGroupId + index : child.props.inputId;\n const groupChecked =\n child.props.checked !== undefined ? child.props.checked : checkedRadioId !== undefined ? checkedRadioId === radioId : undefined;\n return React.cloneElement(child, {\n inputId: radioId,\n name: name ?? child.props.name,\n onColor,\n size,\n checked: groupChecked,\n onChange: (event: React.ChangeEvent<HTMLInputElement>) => {\n setCheckedRadioId(event.target.id);\n if (child.props.onChange) child.props.onChange(event);\n },\n error: !!error,\n errorTextId: errorTextId,\n });\n } else if (isComponent<InputProps>(child, Input)) {\n return React.cloneElement(child, {\n name: name ?? child.props.name,\n onColor,\n size,\n error: !!error,\n errorTextId: errorTextId,\n });\n } else if (isComponent<TextareaProps>(child, Textarea)) {\n return React.cloneElement(child, {\n name: name ?? child.props.name,\n onColor,\n error: !!error,\n errorTextId: errorTextId,\n });\n } else if (isComponent<SelectProps>(child, Select)) {\n return React.cloneElement(child, {\n name: name ?? child.props.name,\n onColor,\n error: !!error,\n errorTextId: errorTextId,\n });\n } else if (isComponent<SliderProps>(child, Slider)) {\n return React.cloneElement(child, {\n name: name ?? child.props.name,\n error: !!error,\n errorTextId: errorTextId,\n });\n }\n return child;\n };\n\n const formGroupContent = (): React.ReactNode => {\n return (\n <div>\n {htmlMarkup === 'div' && (\n <div className={fieldsetClasses}>\n {props.legend && (\n <>\n <CustomTagForLegend id={legendId} className={legendClasses}>\n {props.legend}\n {formFieldTag && isComponent<FormFieldTagProps>(formFieldTag, FormFieldTag) && React.cloneElement(formFieldTag)}\n </CustomTagForLegend>\n </>\n )}\n {React.Children.map(props.children, mapFormComponent)}\n </div>\n )}\n {htmlMarkup === 'fieldset' && (\n <fieldset aria-labelledby={ariaLabelledBy} name={props.fieldsetName} className={fieldsetClasses}>\n {props.legend && (\n <>\n <legend id={legendId} className={legendClasses}>\n {props.legend}\n {formFieldTag && isComponent<FormFieldTagProps>(formFieldTag, FormFieldTag) && React.cloneElement(formFieldTag)}\n </legend>\n </>\n )}\n {React.Children.map(props.children, mapFormComponent)}\n </fieldset>\n )}\n </div>\n );\n };\n\n return (\n <div data-testid={props.testId} data-analyticsid={AnalyticsId.FormGroup} className={formGroupWrapperClasses}>\n {props.title && (\n <Title\n className={titleClasses}\n htmlMarkup={titleHtmlMarkup}\n appearance={'title4'}\n margin={{ marginTop: 0, marginBottom: error ? 1 : 2 }}\n >\n {props.title}\n </Title>\n )}\n <ErrorWrapper\n className={errorWrapperClassName}\n errorText={error}\n testId={errorWrapperTestId}\n errorTextId={errorTextId}\n errorMessageRef={errorMessageRef}\n renderError={renderError}\n >\n {formGroupContent()}\n </ErrorWrapper>\n </div>\n );\n};\n\nFormGroup.displayName = 'FormGroup';\n\nexport default FormGroup;\n"],"mappings":"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"}
|
package/lib/Illustration.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as AnalyticsId } from "./constants2.js";
|
|
2
|
-
import { n as getIllustration, t as ViewBoxSize } from "./
|
|
2
|
+
import { n as getIllustration, t as ViewBoxSize } from "./utils3.js";
|
|
3
3
|
import React, { useId } from "react";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
const Illustration = (props) => {
|
package/lib/IllustrationNames.js
CHANGED
|
@@ -2,10 +2,12 @@ const IllustrationList = [
|
|
|
2
2
|
"BabyMobile",
|
|
3
3
|
"Child",
|
|
4
4
|
"Doctor",
|
|
5
|
+
"EyeContact",
|
|
5
6
|
"FacialRecognitionFingerprint",
|
|
6
7
|
"GiveBabyFood",
|
|
7
8
|
"HealthcarePersonnel",
|
|
8
9
|
"ReadLetters",
|
|
10
|
+
"SkinToSkin",
|
|
9
11
|
"Stork",
|
|
10
12
|
"Stroller",
|
|
11
13
|
"Support2",
|
|
@@ -18,6 +20,7 @@ const IllustrationSizeList = {
|
|
|
18
20
|
small: "DoctorSmall",
|
|
19
21
|
medium: "DoctorMedium"
|
|
20
22
|
},
|
|
23
|
+
EyeContact: { medium: "EyeContactMedium" },
|
|
21
24
|
FacialRecognitionFingerprint: { medium: "FacialRecognitionFingerprintMedium" },
|
|
22
25
|
GiveBabyFood: { medium: "GiveBabyFoodMedium" },
|
|
23
26
|
HealthcarePersonnel: {
|
|
@@ -25,6 +28,7 @@ const IllustrationSizeList = {
|
|
|
25
28
|
medium: "HealthcarePersonnelMedium"
|
|
26
29
|
},
|
|
27
30
|
ReadLetters: { medium: "ReadLettersMedium" },
|
|
31
|
+
SkinToSkin: { medium: "SkinToSkinMedium" },
|
|
28
32
|
Stork: { medium: "StorkMedium" },
|
|
29
33
|
Stroller: { medium: "StrollerMedium" },
|
|
30
34
|
Support2: { medium: "Support2Medium" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IllustrationNames.js","names":["IllustrationSizeList: Record<IllustrationName, IllustrationSize>"],"sources":["../src/components/Illustrations/IllustrationNames.ts"],"sourcesContent":["/** AUTO-GENERATED - DO NOT CHANGE MANUALLY **/\n\nexport const IllustrationList = [\n 'BabyMobile',\n 'Child',\n 'Doctor',\n 'FacialRecognitionFingerprint',\n 'GiveBabyFood',\n 'HealthcarePersonnel',\n 'ReadLetters',\n 'Stork',\n 'Stroller',\n 'Support2',\n 'Thinking',\n] as const;\n\nexport interface IllustrationSize {\n small?: string;\n medium?: string;\n large?: string;\n}\n\nexport const IllustrationSizeList: Record<IllustrationName, IllustrationSize> = {\n BabyMobile: { medium: 'BabyMobileMedium' },\n Child: { medium: 'ChildMedium' },\n Doctor: { small: 'DoctorSmall', medium: 'DoctorMedium' },\n FacialRecognitionFingerprint: { medium: 'FacialRecognitionFingerprintMedium' },\n GiveBabyFood: { medium: 'GiveBabyFoodMedium' },\n HealthcarePersonnel: { small: 'HealthcarePersonnelSmall', medium: 'HealthcarePersonnelMedium' },\n ReadLetters: { medium: 'ReadLettersMedium' },\n Stork: { medium: 'StorkMedium' },\n Stroller: { medium: 'StrollerMedium' },\n Support2: { medium: 'Support2Medium' },\n Thinking: { medium: 'ThinkingMedium' },\n};\n\nexport type IllustrationName = (typeof IllustrationList)[number];\n"],"mappings":"AAEA,MAAa,mBAAmB;CAC9B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;AAQD,MAAaA,uBAAmE;CAC9E,YAAY,EAAE,QAAQ,oBAAoB;CAC1C,OAAO,EAAE,QAAQ,eAAe;CAChC,QAAQ;EAAE,OAAO;EAAe,QAAQ;EAAgB;CACxD,8BAA8B,EAAE,QAAQ,sCAAsC;CAC9E,cAAc,EAAE,QAAQ,sBAAsB;CAC9C,qBAAqB;EAAE,OAAO;EAA4B,QAAQ;EAA6B;CAC/F,aAAa,EAAE,QAAQ,qBAAqB;CAC5C,OAAO,EAAE,QAAQ,eAAe;CAChC,UAAU,EAAE,QAAQ,kBAAkB;CACtC,UAAU,EAAE,QAAQ,kBAAkB;CACtC,UAAU,EAAE,QAAQ,kBAAkB;CACvC"}
|
|
1
|
+
{"version":3,"file":"IllustrationNames.js","names":["IllustrationSizeList: Record<IllustrationName, IllustrationSize>"],"sources":["../src/components/Illustrations/IllustrationNames.ts"],"sourcesContent":["/** AUTO-GENERATED - DO NOT CHANGE MANUALLY **/\n\nexport const IllustrationList = [\n 'BabyMobile',\n 'Child',\n 'Doctor',\n 'EyeContact',\n 'FacialRecognitionFingerprint',\n 'GiveBabyFood',\n 'HealthcarePersonnel',\n 'ReadLetters',\n 'SkinToSkin',\n 'Stork',\n 'Stroller',\n 'Support2',\n 'Thinking',\n] as const;\n\nexport interface IllustrationSize {\n small?: string;\n medium?: string;\n large?: string;\n}\n\nexport const IllustrationSizeList: Record<IllustrationName, IllustrationSize> = {\n BabyMobile: { medium: 'BabyMobileMedium' },\n Child: { medium: 'ChildMedium' },\n Doctor: { small: 'DoctorSmall', medium: 'DoctorMedium' },\n EyeContact: { medium: 'EyeContactMedium' },\n FacialRecognitionFingerprint: { medium: 'FacialRecognitionFingerprintMedium' },\n GiveBabyFood: { medium: 'GiveBabyFoodMedium' },\n HealthcarePersonnel: { small: 'HealthcarePersonnelSmall', medium: 'HealthcarePersonnelMedium' },\n ReadLetters: { medium: 'ReadLettersMedium' },\n SkinToSkin: { medium: 'SkinToSkinMedium' },\n Stork: { medium: 'StorkMedium' },\n Stroller: { medium: 'StrollerMedium' },\n Support2: { medium: 'Support2Medium' },\n Thinking: { medium: 'ThinkingMedium' },\n};\n\nexport type IllustrationName = (typeof IllustrationList)[number];\n"],"mappings":"AAEA,MAAa,mBAAmB;CAC9B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;AAQD,MAAaA,uBAAmE;CAC9E,YAAY,EAAE,QAAQ,oBAAoB;CAC1C,OAAO,EAAE,QAAQ,eAAe;CAChC,QAAQ;EAAE,OAAO;EAAe,QAAQ;EAAgB;CACxD,YAAY,EAAE,QAAQ,oBAAoB;CAC1C,8BAA8B,EAAE,QAAQ,sCAAsC;CAC9E,cAAc,EAAE,QAAQ,sBAAsB;CAC9C,qBAAqB;EAAE,OAAO;EAA4B,QAAQ;EAA6B;CAC/F,aAAa,EAAE,QAAQ,qBAAqB;CAC5C,YAAY,EAAE,QAAQ,oBAAoB;CAC1C,OAAO,EAAE,QAAQ,eAAe;CAChC,UAAU,EAAE,QAAQ,kBAAkB;CACtC,UAAU,EAAE,QAAQ,kBAAkB;CACtC,UAAU,EAAE,QAAQ,kBAAkB;CACvC"}
|
package/lib/LazyIllustration.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as ErrorBoundary_default, t as __rolldown_dynamic_import_helper_default } from "./_rolldown_dynamic_import_helper.js";
|
|
2
2
|
import { t as useIsServerSide } from "./useIsServerSide.js";
|
|
3
|
-
import { n as getIllustration } from "./
|
|
3
|
+
import { n as getIllustration } from "./utils3.js";
|
|
4
4
|
import { t as Illustration_default } from "./Illustration.js";
|
|
5
5
|
import { n as IllustrationSizeList } from "./IllustrationNames.js";
|
|
6
6
|
import { Suspense, lazy, useMemo } from "react";
|
|
@@ -20,6 +20,8 @@ const LazyIllustration = ({ illustrationName, size = 512, ...rest }) => {
|
|
|
20
20
|
"../Illustrations/Doctor.tsx": () => import("./components/Illustrations/Doctor.js"),
|
|
21
21
|
"../Illustrations/DoctorMedium.tsx": () => import("./components/Illustrations/DoctorMedium.js"),
|
|
22
22
|
"../Illustrations/DoctorSmall.tsx": () => import("./components/Illustrations/DoctorSmall.js"),
|
|
23
|
+
"../Illustrations/EyeContact.tsx": () => import("./components/Illustrations/EyeContact.js"),
|
|
24
|
+
"../Illustrations/EyeContactMedium.tsx": () => import("./components/Illustrations/EyeContactMedium.js"),
|
|
23
25
|
"../Illustrations/FacialRecognitionFingerprint.tsx": () => import("./components/Illustrations/FacialRecognitionFingerprint.js"),
|
|
24
26
|
"../Illustrations/FacialRecognitionFingerprintMedium.tsx": () => import("./components/Illustrations/FacialRecognitionFingerprintMedium.js"),
|
|
25
27
|
"../Illustrations/GiveBabyFood.tsx": () => import("./components/Illustrations/GiveBabyFood.js"),
|
|
@@ -29,6 +31,8 @@ const LazyIllustration = ({ illustrationName, size = 512, ...rest }) => {
|
|
|
29
31
|
"../Illustrations/HealthcarePersonnelSmall.tsx": () => import("./components/Illustrations/HealthcarePersonnelSmall.js"),
|
|
30
32
|
"../Illustrations/ReadLetters.tsx": () => import("./components/Illustrations/ReadLetters.js"),
|
|
31
33
|
"../Illustrations/ReadLettersMedium.tsx": () => import("./components/Illustrations/ReadLettersMedium.js"),
|
|
34
|
+
"../Illustrations/SkinToSkin.tsx": () => import("./components/Illustrations/SkinToSkin.js"),
|
|
35
|
+
"../Illustrations/SkinToSkinMedium.tsx": () => import("./components/Illustrations/SkinToSkinMedium.js"),
|
|
32
36
|
"../Illustrations/Stork.tsx": () => import("./components/Illustrations/Stork.js"),
|
|
33
37
|
"../Illustrations/StorkMedium.tsx": () => import("./components/Illustrations/StorkMedium.js"),
|
|
34
38
|
"../Illustrations/Stroller.tsx": () => import("./components/Illustrations/Stroller.js"),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LazyIllustration.js","names":["LazyIllustration: React.FC<LazyIllustrationProps>"],"sources":["../src/components/LazyIllustration/LazyIllustration.tsx","../src/components/LazyIllustration/index.ts"],"sourcesContent":["import { lazy, Suspense, useMemo } from 'react';\n\nimport type { BaseIllustrationProps, SvgIllustration } from '../Illustration';\nimport type { IllustrationName } from '../Illustrations/IllustrationNames';\n\nimport { useIsServerSide } from '../../hooks/useIsServerSide';\nimport Illustration from '../Illustration';\nimport { getIllustration } from '../Illustration/utils';\nimport { IllustrationSizeList } from '../Illustrations/IllustrationNames';\nimport ErrorBoundary from '../LazyIcon/ErrorBoundary';\n\nexport interface LazyIllustrationProps extends BaseIllustrationProps {\n // Navnet på illustrasjonen som skal vises. Tilsvarer filnavnet til illustrasjonen i Icons-mappen\n illustrationName: IllustrationName;\n}\n\nexport const LazyIllustration: React.FC<LazyIllustrationProps> = ({ illustrationName, size = 512, ...rest }) => {\n const lazyLoadIllustration = (illustrationName: IllustrationName, size: number): React.LazyExoticComponent<SvgIllustration> => {\n const sizes = IllustrationSizeList[illustrationName];\n const illustrationFileName = getIllustration({ size, ...sizes });\n\n return lazy<SvgIllustration>(() => import(`../Illustrations/${illustrationFileName}.tsx`));\n };\n\n const illustration = useMemo(() => lazyLoadIllustration(illustrationName, size), [illustrationName, size]);\n const isServerSide = useIsServerSide();\n\n if (isServerSide) {\n return null;\n }\n\n const fallback = (\n <svg\n data-testid={'fallback'}\n role={'presentation'}\n focusable={false}\n aria-hidden={true}\n viewBox=\"0 0 512 512\"\n style={{ minWidth: size, minHeight: size }}\n width={size}\n height={size}\n />\n );\n\n return (\n <ErrorBoundary fallback={fallback} reset={illustrationName}>\n <Suspense fallback={fallback}>\n <Illustration illustration={illustration} size={size} {...rest} />\n </Suspense>\n </ErrorBoundary>\n );\n};\n\nexport default LazyIllustration;\n","import LazyIllustration from './LazyIllustration';\nexport * from './LazyIllustration';\nexport default LazyIllustration;\n"],"mappings":";;;;;;;AAgBA,MAAaA,oBAAqD,EAAE,kBAAkB,OAAO,KAAK,GAAG,WAAW;CAC9G,MAAM,wBAAwB,oBAAoC,WAA6D;EAC7H,MAAM,QAAQ,qBAAqB;EACnC,MAAM,uBAAuB,gBAAgB;GAAE,MAAA;GAAM,GAAG;GAAO,CAAC;AAEhE,SAAO,WAAA,yCAAA
|
|
1
|
+
{"version":3,"file":"LazyIllustration.js","names":["LazyIllustration: React.FC<LazyIllustrationProps>"],"sources":["../src/components/LazyIllustration/LazyIllustration.tsx","../src/components/LazyIllustration/index.ts"],"sourcesContent":["import { lazy, Suspense, useMemo } from 'react';\n\nimport type { BaseIllustrationProps, SvgIllustration } from '../Illustration';\nimport type { IllustrationName } from '../Illustrations/IllustrationNames';\n\nimport { useIsServerSide } from '../../hooks/useIsServerSide';\nimport Illustration from '../Illustration';\nimport { getIllustration } from '../Illustration/utils';\nimport { IllustrationSizeList } from '../Illustrations/IllustrationNames';\nimport ErrorBoundary from '../LazyIcon/ErrorBoundary';\n\nexport interface LazyIllustrationProps extends BaseIllustrationProps {\n // Navnet på illustrasjonen som skal vises. Tilsvarer filnavnet til illustrasjonen i Icons-mappen\n illustrationName: IllustrationName;\n}\n\nexport const LazyIllustration: React.FC<LazyIllustrationProps> = ({ illustrationName, size = 512, ...rest }) => {\n const lazyLoadIllustration = (illustrationName: IllustrationName, size: number): React.LazyExoticComponent<SvgIllustration> => {\n const sizes = IllustrationSizeList[illustrationName];\n const illustrationFileName = getIllustration({ size, ...sizes });\n\n return lazy<SvgIllustration>(() => import(`../Illustrations/${illustrationFileName}.tsx`));\n };\n\n const illustration = useMemo(() => lazyLoadIllustration(illustrationName, size), [illustrationName, size]);\n const isServerSide = useIsServerSide();\n\n if (isServerSide) {\n return null;\n }\n\n const fallback = (\n <svg\n data-testid={'fallback'}\n role={'presentation'}\n focusable={false}\n aria-hidden={true}\n viewBox=\"0 0 512 512\"\n style={{ minWidth: size, minHeight: size }}\n width={size}\n height={size}\n />\n );\n\n return (\n <ErrorBoundary fallback={fallback} reset={illustrationName}>\n <Suspense fallback={fallback}>\n <Illustration illustration={illustration} size={size} {...rest} />\n </Suspense>\n </ErrorBoundary>\n );\n};\n\nexport default LazyIllustration;\n","import LazyIllustration from './LazyIllustration';\nexport * from './LazyIllustration';\nexport default LazyIllustration;\n"],"mappings":";;;;;;;AAgBA,MAAaA,oBAAqD,EAAE,kBAAkB,OAAO,KAAK,GAAG,WAAW;CAC9G,MAAM,wBAAwB,oBAAoC,WAA6D;EAC7H,MAAM,QAAQ,qBAAqB;EACnC,MAAM,uBAAuB,gBAAgB;GAAE,MAAA;GAAM,GAAG;GAAO,CAAC;AAEhE,SAAO,WAAA,yCAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAAmC,oBAAoB,qBAAqB,OAAA,EAAA,CAAO;;CAG5F,MAAM,eAAe,cAAc,qBAAqB,kBAAkB,KAAK,EAAE,CAAC,kBAAkB,KAAK,CAAC;AAG1G,KAFqB,iBAAiB,CAGpC,QAAO;CAGT,MAAM,WACJ,oBAAC,OAAA;EACC,eAAa;EACb,MAAM;EACN,WAAW;EACX,eAAa;EACb,SAAQ;EACR,OAAO;GAAE,UAAU;GAAM,WAAW;GAAM;EAC1C,OAAO;EACP,QAAQ;GACR;AAGJ,QACE,oBAAC,uBAAA;EAAwB;EAAU,OAAO;YACxC,oBAAC,UAAA;GAAmB;aAClB,oBAAC,sBAAA;IAA2B;IAAoB;IAAM,GAAI;KAAQ;IACzD;GACG;;AC/CpB,IAAA,6BDmDe"}
|
package/lib/Radio.js
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { t as useIsMobileBreakpoint } from "./useIsMobileBreakpoint.js";
|
|
2
|
+
import { t as useIdWithFallback } from "./useIdWithFallback.js";
|
|
3
|
+
import { t as getAriaDescribedBy } from "./accessibility.js";
|
|
4
|
+
import { t as ErrorWrapper_default } from "./ErrorWrapper.js";
|
|
5
|
+
import classNames from "classnames";
|
|
6
|
+
import { useState } from "react";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import styles from "./components/VisualRadioCloud/Radio/styles.module.scss";
|
|
9
|
+
var Radio = (props) => {
|
|
10
|
+
const { className, checked, defaultChecked, children, inputId: inputIdProp, errorText, error = !!errorText, errorTextId: errorTextIdProp, errorWrapperClassName, testId, onChange, ref, ...rest } = props;
|
|
11
|
+
const inputId = useIdWithFallback(inputIdProp);
|
|
12
|
+
const errorTextId = useIdWithFallback(errorTextIdProp);
|
|
13
|
+
const isMobile = useIsMobileBreakpoint();
|
|
14
|
+
const [isChecked, setIsChecked] = useState(!!(checked ?? defaultChecked));
|
|
15
|
+
const [prevChecked, setPrevChecked] = useState(checked);
|
|
16
|
+
if (prevChecked !== checked) {
|
|
17
|
+
setPrevChecked(checked);
|
|
18
|
+
if (checked !== void 0 && checked !== isChecked) setIsChecked(checked);
|
|
19
|
+
}
|
|
20
|
+
const handleChange = (e) => {
|
|
21
|
+
setIsChecked(e.target.checked);
|
|
22
|
+
onChange?.(e);
|
|
23
|
+
};
|
|
24
|
+
return /* @__PURE__ */ jsx(ErrorWrapper_default, {
|
|
25
|
+
className: errorWrapperClassName,
|
|
26
|
+
errorText,
|
|
27
|
+
errorTextId,
|
|
28
|
+
children: /* @__PURE__ */ jsxs("label", {
|
|
29
|
+
className: classNames(styles["visual-radio"], {
|
|
30
|
+
[styles["visual-radio--checked"]]: isChecked,
|
|
31
|
+
[styles["visual-radio--invalid"]]: error
|
|
32
|
+
}, className),
|
|
33
|
+
htmlFor: inputId,
|
|
34
|
+
"data-testid": testId,
|
|
35
|
+
children: [/* @__PURE__ */ jsx("input", {
|
|
36
|
+
...rest,
|
|
37
|
+
id: inputId,
|
|
38
|
+
ref,
|
|
39
|
+
className: styles["visual-radio__input"],
|
|
40
|
+
type: "radio",
|
|
41
|
+
checked: isChecked,
|
|
42
|
+
"aria-describedby": getAriaDescribedBy(props, errorTextId),
|
|
43
|
+
onChange: handleChange
|
|
44
|
+
}), /* @__PURE__ */ jsxs("span", {
|
|
45
|
+
className: styles["visual-radio__pill"],
|
|
46
|
+
children: [isChecked && /* @__PURE__ */ jsx("span", {
|
|
47
|
+
className: styles["visual-radio__icon"],
|
|
48
|
+
"aria-hidden": "true",
|
|
49
|
+
children: isMobile ? /* @__PURE__ */ jsx("svg", {
|
|
50
|
+
width: "8",
|
|
51
|
+
height: "8",
|
|
52
|
+
fill: "none",
|
|
53
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
54
|
+
children: /* @__PURE__ */ jsx("path", { d: "M4 8a4 4 0 1 0 0-8 4 4 0 0 0 0 8Z" })
|
|
55
|
+
}) : /* @__PURE__ */ jsx("svg", {
|
|
56
|
+
width: "12",
|
|
57
|
+
height: "12",
|
|
58
|
+
fill: "none",
|
|
59
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
60
|
+
children: /* @__PURE__ */ jsx("path", { d: "M6 12A6 6 0 1 0 6 0a6 6 0 0 0 0 12Z" })
|
|
61
|
+
})
|
|
62
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
63
|
+
className: styles["visual-radio__label"],
|
|
64
|
+
children
|
|
65
|
+
})]
|
|
66
|
+
})]
|
|
67
|
+
})
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
var Radio_default = Radio;
|
|
71
|
+
export { Radio_default as t };
|
|
72
|
+
|
|
73
|
+
//# sourceMappingURL=Radio.js.map
|
package/lib/Radio.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Radio.js","names":["Radio: React.FC<RadioProps>"],"sources":["../src/components/VisualRadioCloud/Radio/Radio.tsx"],"sourcesContent":["import { useState } from 'react';\n\nimport classNames from 'classnames';\n\nimport type { ErrorWrapperClassNameProps } from '../../ErrorWrapper';\n\nimport { useIdWithFallback } from '../../../hooks/useIdWithFallback';\nimport { useIsMobileBreakpoint } from '../../../hooks/useIsMobileBreakpoint';\nimport { getAriaDescribedBy } from '../../../utils/accessibility';\nimport ErrorWrapper from '../../ErrorWrapper';\n\nimport styles from './styles.module.scss';\n\nexport interface RadioProps\n extends\n ErrorWrapperClassNameProps,\n Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type' | 'id' | 'className' | 'children' | 'size' | 'value'> {\n /** Adds custom classes to the root element. */\n className?: string;\n /** Label text shown inside the pill. */\n children: React.ReactNode;\n /** Value identifying this radio inside its group. Required. */\n value: string;\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 cloud). */\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 Radio: React.FC<RadioProps> = props => {\n const {\n className,\n checked,\n defaultChecked,\n children,\n inputId: inputIdProp,\n errorText,\n error = !!errorText,\n errorTextId: errorTextIdProp,\n errorWrapperClassName,\n testId,\n onChange,\n ref,\n ...rest\n } = props;\n\n const inputId = useIdWithFallback(inputIdProp);\n const errorTextId = useIdWithFallback(errorTextIdProp);\n const isMobile = useIsMobileBreakpoint();\n const [isChecked, setIsChecked] = useState<boolean>(!!(checked ?? defaultChecked));\n const [prevChecked, setPrevChecked] = useState<boolean | undefined>(checked);\n if (prevChecked !== checked) {\n setPrevChecked(checked);\n if (checked !== undefined && checked !== isChecked) {\n setIsChecked(checked);\n }\n }\n\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>): void => {\n setIsChecked(e.target.checked);\n onChange?.(e);\n };\n\n return (\n <ErrorWrapper className={errorWrapperClassName} errorText={errorText} errorTextId={errorTextId}>\n <label\n className={classNames(\n styles['visual-radio'],\n {\n [styles['visual-radio--checked']]: isChecked,\n [styles['visual-radio--invalid']]: error,\n },\n className\n )}\n htmlFor={inputId}\n data-testid={testId}\n >\n <input\n {...rest}\n id={inputId}\n ref={ref}\n className={styles['visual-radio__input']}\n type=\"radio\"\n checked={isChecked}\n aria-describedby={getAriaDescribedBy(props, errorTextId)}\n onChange={handleChange}\n />\n <span className={styles['visual-radio__pill']}>\n {isChecked && (\n <span className={styles['visual-radio__icon']} aria-hidden=\"true\">\n {isMobile ? (\n <svg width=\"8\" height=\"8\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M4 8a4 4 0 1 0 0-8 4 4 0 0 0 0 8Z\" />\n </svg>\n ) : (\n <svg width=\"12\" height=\"12\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M6 12A6 6 0 1 0 6 0a6 6 0 0 0 0 12Z\" />\n </svg>\n )}\n </span>\n )}\n <span className={styles['visual-radio__label']}>{children}</span>\n </span>\n </label>\n </ErrorWrapper>\n );\n};\n\nexport default Radio;\n"],"mappings":";;;;;;;;AAqCA,IAAMA,SAA8B,UAAS;CAC3C,MAAM,EACJ,WACA,SACA,gBACA,UACA,SAAS,aACT,WACA,QAAQ,CAAC,CAAC,WACV,aAAa,iBACb,uBACA,QACA,UACA,KACA,GAAG,SACD;CAEJ,MAAM,UAAU,kBAAkB,YAAY;CAC9C,MAAM,cAAc,kBAAkB,gBAAgB;CACtD,MAAM,WAAW,uBAAuB;CACxC,MAAM,CAAC,WAAW,gBAAgB,SAAkB,CAAC,EAAE,WAAW,gBAAgB;CAClF,MAAM,CAAC,aAAa,kBAAkB,SAA8B,QAAQ;AAC5E,KAAI,gBAAgB,SAAS;AAC3B,iBAAe,QAAQ;AACvB,MAAI,YAAY,KAAA,KAAa,YAAY,UACvC,cAAa,QAAQ;;CAIzB,MAAM,gBAAgB,MAAiD;AACrE,eAAa,EAAE,OAAO,QAAQ;AAC9B,aAAW,EAAE;;AAGf,QACE,oBAAC,sBAAA;EAAa,WAAW;EAAkC;EAAwB;YACjF,qBAAC,SAAA;GACC,WAAW,WACT,OAAO,iBACP;KACG,OAAO,2BAA2B;KAClC,OAAO,2BAA2B;IACpC,EACD,UACD;GACD,SAAS;GACT,eAAa;cAEb,oBAAC,SAAA;IACC,GAAI;IACJ,IAAI;IACC;IACL,WAAW,OAAO;IAClB,MAAK;IACL,SAAS;IACT,oBAAkB,mBAAmB,OAAO,YAAY;IACxD,UAAU;KACV,EACF,qBAAC,QAAA;IAAK,WAAW,OAAO;eACrB,aACC,oBAAC,QAAA;KAAK,WAAW,OAAO;KAAuB,eAAY;eACxD,WACC,oBAAC,OAAA;MAAI,OAAM;MAAI,QAAO;MAAI,MAAK;MAAO,OAAM;gBAC1C,oBAAC,QAAA,EAAK,GAAE,qCAAA,CAAsC;OAC1C,GAEN,oBAAC,OAAA;MAAI,OAAM;MAAK,QAAO;MAAK,MAAK;MAAO,OAAM;gBAC5C,oBAAC,QAAA,EAAK,GAAE,uCAAA,CAAwC;OAC5C;MAEH,EAET,oBAAC,QAAA;KAAK,WAAW,OAAO;KAAyB;MAAgB,CAAA;KAC5D,CAAA;IACD;GACK;;AAInB,IAAA,gBAAe"}
|
package/lib/RadioButton.js
CHANGED
|
@@ -1,5 +1,83 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { t as uuid } from "./uuid.js";
|
|
2
|
+
import { i as FormSize, n as AnalyticsId, r as FormOnColor } from "./constants2.js";
|
|
3
|
+
import { t as useIdWithFallback } from "./useIdWithFallback.js";
|
|
4
|
+
import { t as getAriaDescribedBy } from "./accessibility.js";
|
|
5
|
+
import { t as ErrorWrapper_default } from "./ErrorWrapper.js";
|
|
6
|
+
import { r as renderLabelAsParent, t as getLabelText } from "./utils2.js";
|
|
7
|
+
import { t as RadioMarker_default } from "./RadioMarker.js";
|
|
8
|
+
import classNames from "classnames";
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
import radioButtonStyles from "./components/RadioButton/styles.module.scss";
|
|
11
|
+
const RadioButton = (props) => {
|
|
12
|
+
const { className, defaultChecked, onChange, disabled, label, inputId = uuid(), onColor = FormOnColor.onwhite, name = inputId, size, errorText, errorTextId: errorTextIdProp, error = !!errorText, errorWrapperClassName, value = getLabelText(label), testId, required, labelClassNames, ref, ...rest } = props;
|
|
13
|
+
const invalid = error || onColor === FormOnColor.oninvalid;
|
|
14
|
+
const onDark = onColor === FormOnColor.ondark;
|
|
15
|
+
const onGrey = onColor === FormOnColor.ongrey;
|
|
16
|
+
const onBlueberry = onColor === FormOnColor.onblueberry;
|
|
17
|
+
const onCherry = onColor === FormOnColor.oninvalid;
|
|
18
|
+
const isLarge = size === FormSize.large;
|
|
19
|
+
const errorTextId = useIdWithFallback(errorTextIdProp);
|
|
20
|
+
const radioButtonWrapperClasses = classNames(radioButtonStyles["radio-button-wrapper"], {
|
|
21
|
+
[radioButtonStyles["radio-button-wrapper__large"]]: isLarge,
|
|
22
|
+
[radioButtonStyles["radio-button-wrapper__large--invalid"]]: isLarge && onCherry,
|
|
23
|
+
[radioButtonStyles["radio-button-wrapper__large--on-blueberry"]]: isLarge && onBlueberry
|
|
24
|
+
});
|
|
25
|
+
const radioButtonLabelClasses = classNames(radioButtonStyles["radio-button-label"], {
|
|
26
|
+
[radioButtonStyles["radio-button-label--disabled"]]: disabled,
|
|
27
|
+
[radioButtonStyles["radio-button-label--on-dark"]]: onDark,
|
|
28
|
+
[radioButtonStyles["radio-button-label--invalid"]]: invalid,
|
|
29
|
+
[radioButtonStyles["radio-button-label__large"]]: isLarge,
|
|
30
|
+
[radioButtonStyles["radio-button-label__large--disabled"]]: isLarge && disabled,
|
|
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
|
|
34
|
+
}, labelClassNames);
|
|
35
|
+
const radioButtonClasses = classNames(radioButtonStyles["radio-button"], className);
|
|
36
|
+
const getLabelContent = () => /* @__PURE__ */ jsxs("span", {
|
|
37
|
+
className: radioButtonStyles["radio-button__marker-wrapper"],
|
|
38
|
+
children: [/* @__PURE__ */ jsx("input", {
|
|
39
|
+
...rest,
|
|
40
|
+
id: inputId,
|
|
41
|
+
name,
|
|
42
|
+
className: radioButtonClasses,
|
|
43
|
+
type: "radio",
|
|
44
|
+
disabled,
|
|
45
|
+
value,
|
|
46
|
+
ref,
|
|
47
|
+
defaultChecked,
|
|
48
|
+
"aria-describedby": getAriaDescribedBy(props, errorTextId),
|
|
49
|
+
required,
|
|
50
|
+
onChange
|
|
51
|
+
}), /* @__PURE__ */ jsx(RadioMarker_default, {
|
|
52
|
+
disabled,
|
|
53
|
+
error: invalid,
|
|
54
|
+
onColor,
|
|
55
|
+
size
|
|
56
|
+
})]
|
|
57
|
+
});
|
|
58
|
+
return /* @__PURE__ */ jsx(ErrorWrapper_default, {
|
|
59
|
+
className: errorWrapperClassName,
|
|
60
|
+
errorText,
|
|
61
|
+
errorTextId,
|
|
62
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
63
|
+
"data-testid": testId,
|
|
64
|
+
"data-analyticsid": AnalyticsId.RadioButton,
|
|
65
|
+
className: radioButtonWrapperClasses,
|
|
66
|
+
children: renderLabelAsParent({
|
|
67
|
+
label,
|
|
68
|
+
children: getLabelContent(),
|
|
69
|
+
inputId,
|
|
70
|
+
onColor,
|
|
71
|
+
labelClassName: radioButtonLabelClasses,
|
|
72
|
+
sublabelWrapperClassName: radioButtonStyles["radiobutton-sublabel-wrapper"],
|
|
73
|
+
large: isLarge,
|
|
74
|
+
afterLabelChildrenClassName: radioButtonStyles["radiobutton-afterlabelchildren-wrapper"]
|
|
75
|
+
})
|
|
76
|
+
})
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
RadioButton.displayName = "RadioButton";
|
|
80
|
+
var RadioButton_default = RadioButton;
|
|
81
|
+
export { RadioButton_default as n, RadioButton as t };
|
|
4
82
|
|
|
5
83
|
//# sourceMappingURL=RadioButton.js.map
|
package/lib/RadioButton.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioButton.js","names":[],"sources":["../src/components/RadioButton/
|
|
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/RadioButton2.js
CHANGED
|
@@ -1,75 +1,5 @@
|
|
|
1
|
-
import { n as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import { t as getAriaDescribedBy } from "./accessibility.js";
|
|
5
|
-
import { t as ErrorWrapper_default } from "./ErrorWrapper.js";
|
|
6
|
-
import classNames from "classnames";
|
|
7
|
-
import { useState } from "react";
|
|
8
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
-
import styles from "./components/VisualRadioButtonCloud/RadioButton/styles.module.scss";
|
|
10
|
-
var RadioButton = (props) => {
|
|
11
|
-
const { className, checked, defaultChecked, children, inputId: inputIdProp, errorText, error = !!errorText, errorTextId: errorTextIdProp, errorWrapperClassName, testId, onChange, ref, ...rest } = props;
|
|
12
|
-
const inputId = useIdWithFallback(inputIdProp);
|
|
13
|
-
const errorTextId = useIdWithFallback(errorTextIdProp);
|
|
14
|
-
const isMobile = useIsMobileBreakpoint();
|
|
15
|
-
const [isChecked, setIsChecked] = useState(!!(checked ?? defaultChecked));
|
|
16
|
-
const [prevChecked, setPrevChecked] = useState(checked);
|
|
17
|
-
if (prevChecked !== checked) {
|
|
18
|
-
setPrevChecked(checked);
|
|
19
|
-
if (checked !== void 0 && checked !== isChecked) setIsChecked(checked);
|
|
20
|
-
}
|
|
21
|
-
const handleChange = (e) => {
|
|
22
|
-
setIsChecked(e.target.checked);
|
|
23
|
-
onChange?.(e);
|
|
24
|
-
};
|
|
25
|
-
return /* @__PURE__ */ jsx(ErrorWrapper_default, {
|
|
26
|
-
className: errorWrapperClassName,
|
|
27
|
-
errorText,
|
|
28
|
-
errorTextId,
|
|
29
|
-
children: /* @__PURE__ */ jsxs("label", {
|
|
30
|
-
className: classNames(styles["visual-radio-button"], {
|
|
31
|
-
[styles["visual-radio-button--checked"]]: isChecked,
|
|
32
|
-
[styles["visual-radio-button--invalid"]]: error
|
|
33
|
-
}, className),
|
|
34
|
-
htmlFor: inputId,
|
|
35
|
-
"data-testid": testId,
|
|
36
|
-
"data-analyticsid": AnalyticsId.RadioButton,
|
|
37
|
-
children: [/* @__PURE__ */ jsx("input", {
|
|
38
|
-
...rest,
|
|
39
|
-
id: inputId,
|
|
40
|
-
ref,
|
|
41
|
-
className: styles["visual-radio-button__input"],
|
|
42
|
-
type: "radio",
|
|
43
|
-
checked: isChecked,
|
|
44
|
-
"aria-describedby": getAriaDescribedBy(props, errorTextId),
|
|
45
|
-
onChange: handleChange
|
|
46
|
-
}), /* @__PURE__ */ jsxs("span", {
|
|
47
|
-
className: styles["visual-radio-button__pill"],
|
|
48
|
-
children: [isChecked && /* @__PURE__ */ jsx("span", {
|
|
49
|
-
className: styles["visual-radio-button__icon"],
|
|
50
|
-
"aria-hidden": "true",
|
|
51
|
-
children: isMobile ? /* @__PURE__ */ jsx("svg", {
|
|
52
|
-
width: "8",
|
|
53
|
-
height: "8",
|
|
54
|
-
fill: "none",
|
|
55
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
56
|
-
children: /* @__PURE__ */ jsx("path", { d: "M4 8a4 4 0 1 0 0-8 4 4 0 0 0 0 8Z" })
|
|
57
|
-
}) : /* @__PURE__ */ jsx("svg", {
|
|
58
|
-
width: "12",
|
|
59
|
-
height: "12",
|
|
60
|
-
fill: "none",
|
|
61
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
62
|
-
children: /* @__PURE__ */ jsx("path", { d: "M6 12A6 6 0 1 0 6 0a6 6 0 0 0 0 12Z" })
|
|
63
|
-
})
|
|
64
|
-
}), /* @__PURE__ */ jsx("span", {
|
|
65
|
-
className: styles["visual-radio-button__label"],
|
|
66
|
-
children
|
|
67
|
-
})]
|
|
68
|
-
})]
|
|
69
|
-
})
|
|
70
|
-
});
|
|
71
|
-
};
|
|
72
|
-
var RadioButton_default = RadioButton;
|
|
73
|
-
export { RadioButton_default as t };
|
|
1
|
+
import { n as RadioButton_default } from "./RadioButton.js";
|
|
2
|
+
var RadioButton_default$1 = RadioButton_default;
|
|
3
|
+
export { RadioButton_default$1 as t };
|
|
74
4
|
|
|
75
5
|
//# sourceMappingURL=RadioButton2.js.map
|
package/lib/RadioButton2.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioButton2.js","names":[
|
|
1
|
+
{"version":3,"file":"RadioButton2.js","names":[],"sources":["../src/components/RadioButton/index.ts"],"sourcesContent":["import RadioButton from './RadioButton';\nexport * from './RadioButton';\nexport default RadioButton;\n"],"mappings":";AAEA,IAAA,wBAAe"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { i as FormSize, r as FormOnColor } from "./constants2.js";
|
|
2
|
+
import classNames from "classnames";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import styles from "./components/RadioButton/RadioMarker/styles.module.scss";
|
|
5
|
+
const RadioMarker = (props) => {
|
|
6
|
+
const { checked = false, disabled = false, error = false, onColor = FormOnColor.onwhite, size, className } = props;
|
|
7
|
+
const onWhite = onColor === FormOnColor.onwhite;
|
|
8
|
+
const onGrey = onColor === FormOnColor.ongrey;
|
|
9
|
+
const onBlueberry = onColor === FormOnColor.onblueberry;
|
|
10
|
+
const onInvalid = error || onColor === FormOnColor.oninvalid;
|
|
11
|
+
const onDark = onColor === FormOnColor.ondark;
|
|
12
|
+
const large = size === FormSize.large;
|
|
13
|
+
return /* @__PURE__ */ jsx("span", {
|
|
14
|
+
className: classNames(styles["radio__marker"], large ? styles["radio__marker__large"] : styles["radio__marker__regular"], {
|
|
15
|
+
[styles["radio__marker--on-white"]]: onWhite,
|
|
16
|
+
[styles["radio__marker--on-grey"]]: onGrey,
|
|
17
|
+
[styles["radio__marker--on-blueberry"]]: onBlueberry,
|
|
18
|
+
[styles["radio__marker--on-dark"]]: onDark,
|
|
19
|
+
[styles["radio__marker--on-invalid"]]: onInvalid,
|
|
20
|
+
[styles["radio__marker--invalid"]]: onInvalid,
|
|
21
|
+
[styles["radio__marker--disabled"]]: disabled,
|
|
22
|
+
[styles["radio__marker--checked"]]: checked
|
|
23
|
+
}, className),
|
|
24
|
+
"aria-hidden": "true",
|
|
25
|
+
children: /* @__PURE__ */ jsx("span", { className: styles["radio__marker-dot"] })
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
var RadioMarker_default = RadioMarker;
|
|
29
|
+
export { RadioMarker_default as t };
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=RadioMarker.js.map
|
|
@@ -0,0 +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 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/ReadLettersMedium.js
CHANGED
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"}
|