@helsenorge/designsystem-react 12.2.0 → 12.4.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 +35 -0
- package/Checkbox.js +2 -4
- package/Checkbox.js.map +1 -1
- package/ElementHeader.js +5 -4
- package/ElementHeader.js.map +1 -1
- package/HighlightPanel.js +23 -3
- package/HighlightPanel.js.map +1 -1
- package/Input.js +2 -3
- package/Input.js.map +1 -1
- package/LazyIcon.js +1 -1
- package/LazyIcon.js.map +1 -1
- package/PanelOld.js.map +1 -1
- package/RadioButton.js +1 -1
- package/RadioButton.js.map +1 -1
- package/Select.js +1 -1
- package/Select.js.map +1 -1
- package/components/ElementHeader/styles.module.scss +7 -9
- package/components/ElementHeader/styles.module.scss.d.ts +2 -1
- package/components/FavoriteButton/FavoriteButton.d.ts +19 -0
- package/components/FavoriteButton/FavoriteButton.test.d.ts +1 -0
- package/components/FavoriteButton/StarIcon.d.ts +4 -0
- package/components/FavoriteButton/index.d.ts +3 -0
- package/components/FavoriteButton/index.js +204 -0
- package/components/FavoriteButton/index.js.map +1 -0
- package/components/FavoriteButton/resourceHelper.d.ts +3 -0
- package/components/FavoriteButton/stories.module.scss +22 -0
- package/components/FavoriteButton/stories.module.scss.d.ts +10 -0
- package/components/FavoriteButton/styles.module.scss +40 -0
- package/components/FavoriteButton/styles.module.scss.d.ts +9 -0
- package/components/HelpPanel/HelpPanel.d.ts +3 -0
- package/components/HelpPanel/index.js +12 -2
- package/components/HelpPanel/index.js.map +1 -1
- package/components/HelpTriggerIcon/styles.module.scss +21 -0
- package/components/HighlightPanel/HighlightPanel.d.ts +3 -0
- package/components/HighlightPanel/styles.module.scss +26 -4
- package/components/HighlightPanel/styles.module.scss.d.ts +4 -0
- package/components/Icons/AdditionalIconInformation.d.ts +8 -0
- package/components/Icons/AdditionalIconInformation.js +3 -1
- package/components/Icons/AdditionalIconInformation.js.map +1 -1
- package/components/Icons/Drag.d.ts +4 -0
- package/components/Icons/Drag.js +11 -0
- package/components/Icons/Drag.js.map +1 -0
- package/components/Icons/Edit.d.ts +4 -0
- package/components/Icons/Edit.js +31 -0
- package/components/Icons/Edit.js.map +1 -0
- package/components/Icons/IconNames.d.ts +1 -1
- package/components/Icons/IconNames.js +2 -0
- package/components/Icons/IconNames.js.map +1 -1
- package/components/StatusDot/styles.module.scss +6 -0
- package/components/Toggle/Toggle.d.ts +6 -0
- package/components/Toggle/index.js +52 -59
- package/components/Toggle/index.js.map +1 -1
- package/components/Toggle/styles.module.scss +47 -28
- package/components/Toggle/styles.module.scss.d.ts +6 -2
- package/constants.d.ts +1 -0
- package/constants.js +1 -0
- package/constants.js.map +1 -1
- package/package.json +1 -1
- package/resources/HN.Designsystem.FavoriteButton.nb-NO.json.d.ts +6 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,38 @@
|
|
|
1
|
+
## [12.4.0](https://github.com/helsenorge/designsystem/branchCompare?baseVersion=GTv12.3.0&targetVersion=GTv12.4.0) (2025-09-23)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
- **favoritebutton:** default aria-label hentes fra sot
|
|
6
|
+
([53b3596](https://github.com/helsenorge/designsystem/commit/53b359668307ed19279a2a4d87a80a81538698e0)), closes
|
|
7
|
+
[#357829](https://github.com/helsenorge/designsystem/issues/357829)
|
|
8
|
+
- **favoritebutton:** ny komponent ([3971d8c](https://github.com/helsenorge/designsystem/commit/3971d8cea9d0f6e87c622ffcc700d5aecfc5a1ca)),
|
|
9
|
+
closes [#357829](https://github.com/helsenorge/designsystem/issues/357829)
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
- når vertikaler brukte aria-describedby på skjemakomponenter så ble errorTextUuid overstyrt
|
|
14
|
+
([7de2697](https://github.com/helsenorge/designsystem/commit/7de26976ff449a10028deb734dbf6c5fe24fc029)), closes
|
|
15
|
+
[#359583](https://github.com/helsenorge/designsystem/issues/359583)
|
|
16
|
+
- statusdot og elementheader spacing fikses
|
|
17
|
+
([d88c71d](https://github.com/helsenorge/designsystem/commit/d88c71d6d73d73039a744cee76939114c06487e9)), closes
|
|
18
|
+
[#356675](https://github.com/helsenorge/designsystem/issues/356675)
|
|
19
|
+
- **elementheader:** ishovered sendes bare til ekte ikoner
|
|
20
|
+
([dcb0779](https://github.com/helsenorge/designsystem/commit/dcb0779a4a89894ad2262f9e88ef4438a41b09dc)), closes
|
|
21
|
+
[#360049](https://github.com/helsenorge/designsystem/issues/360049)
|
|
22
|
+
|
|
23
|
+
## [12.3.0](https://github.com/helsenorge/designsystem/branchCompare?baseVersion=GTv12.2.0&targetVersion=GTv12.3.0) (2025-09-18)
|
|
24
|
+
|
|
25
|
+
### Features
|
|
26
|
+
|
|
27
|
+
- **helppanel:** ny compact variant ([7528a48](https://github.com/helsenorge/designsystem/commit/7528a4841c6e7f9a4b2ea0b9d1e061e2cd37dae1)),
|
|
28
|
+
closes [#354473](https://github.com/helsenorge/designsystem/issues/354473)
|
|
29
|
+
- **icon:** nye ikoner drag og edit ([c43bac8](https://github.com/helsenorge/designsystem/commit/c43bac89f4d59f97e943859f7d21eb9bff6e61e8)),
|
|
30
|
+
closes [#357267](https://github.com/helsenorge/designsystem/issues/357267)
|
|
31
|
+
[#357711](https://github.com/helsenorge/designsystem/issues/357711)
|
|
32
|
+
- **toggle:** legg til mulighet for statustekst under toggle knapp
|
|
33
|
+
([db310bc](https://github.com/helsenorge/designsystem/commit/db310bcad67e67dcc2664834958c8fc70ece15c4)), closes
|
|
34
|
+
[#358389](https://github.com/helsenorge/designsystem/issues/358389)
|
|
35
|
+
|
|
1
36
|
## [12.2.0](https://github.com/helsenorge/designsystem/branchCompare?baseVersion=GTv12.1.0&targetVersion=GTv12.2.0) (2025-09-11)
|
|
2
37
|
|
|
3
38
|
### Features
|
package/Checkbox.js
CHANGED
|
@@ -30,8 +30,7 @@ const Checkbox = React__default.forwardRef((props, ref) => {
|
|
|
30
30
|
value = getLabelText(label),
|
|
31
31
|
testId,
|
|
32
32
|
required,
|
|
33
|
-
onChange
|
|
34
|
-
...rest
|
|
33
|
+
onChange
|
|
35
34
|
} = props;
|
|
36
35
|
const [isChecked, setIsChecked] = useState(checked);
|
|
37
36
|
const errorTextUuid = useUuid(errorTextId);
|
|
@@ -112,8 +111,7 @@ const Checkbox = React__default.forwardRef((props, ref) => {
|
|
|
112
111
|
"aria-describedby": getAriaDescribedBy(props, errorTextUuid),
|
|
113
112
|
"aria-invalid": error,
|
|
114
113
|
required,
|
|
115
|
-
onChange: onChangeHandler
|
|
116
|
-
...rest
|
|
114
|
+
onChange: onChangeHandler
|
|
117
115
|
}
|
|
118
116
|
),
|
|
119
117
|
/* @__PURE__ */ jsx("span", { className: checkboxIconWrapperClasses, children: isChecked && /* @__PURE__ */ jsx(Icon, { color: iconColor, className: checkboxStyles["checkbox__icon"], svgIcon: Check, size: IconSize.XSmall }) })
|
package/Checkbox.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.js","sources":["../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\n\nimport classNames from 'classnames';\n\nimport { AnalyticsId, FormOnColor, FormSize, IconSize } from '../../constants';\nimport { usePseudoClasses } from '../../hooks/usePseudoClasses';\nimport { useUuid } from '../../hooks/useUuid';\nimport { getColor } from '../../theme/currys/color';\nimport { getAriaDescribedBy } from '../../utils/accessibility';\nimport { isMutableRefObject, mergeRefs } from '../../utils/refs';\nimport { uuid } from '../../utils/uuid';\nimport ErrorWrapper, { ErrorWrapperClassNameProps } from '../ErrorWrapper';\nimport Icon from '../Icon';\nimport Check from '../Icons/Check';\nimport { getLabelText, renderLabelAsParent } from '../Label';\n\nimport checkboxStyles from './styles.module.scss';\n\nexport interface CheckboxProps\n extends ErrorWrapperClassNameProps,\n Pick<\n React.InputHTMLAttributes<HTMLInputElement>,\n 'aria-describedby' | 'name' | 'value' | 'disabled' | 'checked' | 'required' | 'onChange'\n > {\n /** Adds custom classes to the element. */\n className?: string;\n /** The <Label/> next to the checkbox - sublabels kan ikke kombineres med large variant */\n label: React.ReactNode;\n /** input id of the checkbox */\n inputId?: string;\n /** Changes the visuals of the checkbox */\n onColor?: keyof typeof FormOnColor;\n /** Changes the visuals of the checkbox */\n size?: keyof typeof FormSize;\n /** Activates Error style for the checkbox - 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 Checkbox = React.forwardRef((props: CheckboxProps, ref: React.Ref<HTMLInputElement>) => {\n const {\n className,\n checked = false,\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 onChange,\n ...rest\n } = props;\n const [isChecked, setIsChecked] = useState(checked);\n const errorTextUuid = useUuid(errorTextId);\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 const { refObject, isFocused } = usePseudoClasses<HTMLInputElement>(isMutableRefObject(ref) ? ref : null);\n const mergedRefs = mergeRefs([ref, refObject]);\n\n const checkboxWrapperClasses = classNames(checkboxStyles['checkbox-wrapper'], {\n [checkboxStyles['checkbox-wrapper--large']]: large,\n });\n const checkboxLabelClasses = classNames(checkboxStyles['checkbox-label'], {\n [checkboxStyles['checkbox-label--disabled']]: disabled,\n [checkboxStyles['checkbox-label--on-dark']]: onDark,\n [checkboxStyles['checkbox-label--large']]: large,\n [checkboxStyles['checkbox-label__large--checked']]: large && isChecked,\n [checkboxStyles['checkbox-label__large--focus']]: large && isFocused,\n [checkboxStyles['checkbox-label__large--on-white']]: large && onWhite,\n [checkboxStyles['checkbox-label__large--on-grey']]: large && onGrey,\n [checkboxStyles['checkbox-label__large--on-blueberry']]: large && onBlueberry,\n [checkboxStyles['checkbox-label__large--on-invalid']]: large && onInvalid,\n [checkboxStyles['checkbox-label__large--disabled']]: large && disabled,\n });\n const checkboxClasses = classNames(checkboxStyles.checkbox, className);\n const checkboxIconWrapperClasses = classNames(checkboxStyles['checkbox__icon-wrapper'], {\n [checkboxStyles['checkbox__icon-wrapper--on-white']]: onWhite,\n [checkboxStyles['checkbox__icon-wrapper--on-grey']]: onGrey,\n [checkboxStyles['checkbox__icon-wrapper--on-invalid']]: onInvalid,\n [checkboxStyles['checkbox__icon-wrapper--disabled']]: disabled,\n [checkboxStyles['checkbox__icon-wrapper__regular--checked']]: !large && isChecked,\n [checkboxStyles['checkbox__icon-wrapper__regular--invalid']]: !large && isChecked && onInvalid,\n [checkboxStyles['checkbox__icon-wrapper__regular--on-dark']]: !large && isChecked && onDark,\n [checkboxStyles['checkbox__icon-wrapper__large--checked']]: large && isChecked,\n [checkboxStyles['checkbox__icon-wrapper__large--invalid']]: large && onInvalid,\n [checkboxStyles['checkbox__icon-wrapper--on-dark']]: onDark,\n [checkboxStyles['checkbox__icon-wrapper--on-blueberry']]: onBlueberry,\n [checkboxStyles['checkbox__icon-wrapper--invalid']]: onInvalid,\n [checkboxStyles['checkbox__icon-wrapper__large--invalid']]: large && isChecked && onInvalid,\n [checkboxStyles['checkbox__icon-wrapper__large--disabled']]: disabled && large && isChecked,\n [checkboxStyles['checkbox__icon-wrapper__large--checked--invalid']]: large && isChecked && onInvalid,\n [checkboxStyles['checkbox__icon-wrapper__large--checked--disabled']]: disabled && large && isChecked,\n });\n const labelTextClasses = classNames(checkboxStyles['checkbox-label__text'], {\n [checkboxStyles['checkbox-label__text__large--checked']]: large && isChecked,\n [checkboxStyles['checkbox-label__text__large--invalid']]: large && isChecked && onInvalid,\n [checkboxStyles['checkbox-label__text--on-dark']]: onDark,\n [checkboxStyles['checkbox-label__text--disabled']]: disabled,\n });\n\n let iconColor = getColor('white');\n if (onDark || (large && isChecked)) iconColor = getColor('blueberry', 900);\n if (onInvalid && large && isChecked) iconColor = getColor('white');\n if (disabled) iconColor = getColor('neutral', 700);\n\n useEffect(() => {\n setIsChecked(checked);\n }, [checked]);\n\n const onChangeHandler = (e: React.ChangeEvent<HTMLInputElement>): void => {\n if (onChange) {\n onChange(e);\n }\n\n setIsChecked(!isChecked);\n };\n\n const getLabelContent = (): React.ReactNode => {\n return (\n <>\n <input\n id={inputId}\n name={name}\n className={checkboxClasses}\n type=\"checkbox\"\n checked={isChecked}\n disabled={disabled}\n value={value}\n ref={mergedRefs}\n aria-describedby={getAriaDescribedBy(props, errorTextUuid)}\n aria-invalid={error}\n required={required}\n onChange={onChangeHandler}\n {...rest}\n />\n <span className={checkboxIconWrapperClasses}>\n {isChecked && <Icon color={iconColor} className={checkboxStyles['checkbox__icon']} svgIcon={Check} size={IconSize.XSmall} />}\n </span>\n </>\n );\n };\n\n return (\n <ErrorWrapper className={errorWrapperClassName} errorText={errorText} errorTextId={errorTextUuid}>\n <div data-testid={testId} data-analyticsid={AnalyticsId.Checkbox} className={checkboxWrapperClasses}>\n {renderLabelAsParent(\n label,\n getLabelContent(),\n inputId,\n onColor as FormOnColor,\n checkboxLabelClasses,\n labelTextClasses,\n checkboxStyles['checkbox-sublabel-wrapper'],\n large\n )}\n </div>\n </ErrorWrapper>\n );\n});\n\nCheckbox.displayName = 'Checkbox';\n\nexport default Checkbox;\n"],"names":["React"],"mappings":";;;;;;;;;;;;;;;AA4CO,MAAM,WAAWA,eAAM,WAAW,CAAC,OAAsB,QAAqC;AACnG,QAAM;AAAA,IACJ;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA,UAAU,KAAA;AAAA,IACV,UAAU,YAAY;AAAA,IACtB,OAAO;AAAA,IACP;AAAA,IACA;AAAA,IACA,QAAQ,CAAC,CAAC;AAAA,IACV;AAA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SAAS,UAAW,aAAY,SAAS,OAAO;AACjE,MAAI,SAAU,aAAY,SAAS,WAAW,GAAG;AAEjD,YAAU,MAAM;AACd,iBAAa,OAAO;AAAA,EACtB,GAAG,CAAC,OAAO,CAAC;AAEZ,QAAM,kBAAkB,CAAC,MAAiD;AACxE,QAAI,UAAU;AACZ,eAAS,CAAC;AAAA,IACZ;AAEA,iBAAa,CAAC,SAAS;AAAA,EACzB;AAEA,QAAM,kBAAkB,MAAuB;AAC7C,WACE,qBAAA,UAAA,EACE,UAAA;AAAA,MAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,IAAI;AAAA,UACJ;AAAA,UACA,WAAW;AAAA,UACX,MAAK;AAAA,UACL,SAAS;AAAA,UACT;AAAA,UACA;AAAA,UACA,KAAK;AAAA,UACL,oBAAkB,mBAAmB,OAAO,aAAa;AAAA,UACzD,gBAAc;AAAA,UACd;AAAA,UACA,UAAU;AAAA,UACT,GAAG;AAAA,QAAA;AAAA,MAAA;AAAA,0BAEL,QAAA,EAAK,WAAW,4BACd,UAAA,aAAa,oBAAC,QAAK,OAAO,WAAW,WAAW,eAAe,gBAAgB,GAAG,SAAS,OAAO,MAAM,SAAS,QAAQ,EAAA,CAC5H;AAAA,IAAA,GACF;AAAA,EAEJ;AAEA,SACE,oBAAC,cAAA,EAAa,WAAW,uBAAuB,WAAsB,aAAa,eACjF,UAAA,oBAAC,OAAA,EAAI,eAAa,QAAQ,oBAAkB,YAAY,UAAU,WAAW,wBAC1E,UAAA;AAAA,IACC;AAAA,IACA,gBAAA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,eAAe,2BAA2B;AAAA,IAC1C;AAAA,EAAA,GAEJ,EAAA,CACF;AAEJ,CAAC;AAED,SAAS,cAAc;"}
|
|
1
|
+
{"version":3,"file":"Checkbox.js","sources":["../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\n\nimport classNames from 'classnames';\n\nimport { AnalyticsId, FormOnColor, FormSize, IconSize } from '../../constants';\nimport { usePseudoClasses } from '../../hooks/usePseudoClasses';\nimport { useUuid } from '../../hooks/useUuid';\nimport { getColor } from '../../theme/currys/color';\nimport { getAriaDescribedBy } from '../../utils/accessibility';\nimport { isMutableRefObject, mergeRefs } from '../../utils/refs';\nimport { uuid } from '../../utils/uuid';\nimport ErrorWrapper, { ErrorWrapperClassNameProps } from '../ErrorWrapper';\nimport Icon from '../Icon';\nimport Check from '../Icons/Check';\nimport { getLabelText, renderLabelAsParent } from '../Label';\n\nimport checkboxStyles from './styles.module.scss';\n\nexport interface CheckboxProps\n extends ErrorWrapperClassNameProps,\n Pick<\n React.InputHTMLAttributes<HTMLInputElement>,\n 'aria-describedby' | 'name' | 'value' | 'disabled' | 'checked' | 'required' | 'onChange'\n > {\n /** Adds custom classes to the element. */\n className?: string;\n /** The <Label/> next to the checkbox - sublabels kan ikke kombineres med large variant */\n label: React.ReactNode;\n /** input id of the checkbox */\n inputId?: string;\n /** Changes the visuals of the checkbox */\n onColor?: keyof typeof FormOnColor;\n /** Changes the visuals of the checkbox */\n size?: keyof typeof FormSize;\n /** Activates Error style for the checkbox - 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 Checkbox = React.forwardRef((props: CheckboxProps, ref: React.Ref<HTMLInputElement>) => {\n const {\n className,\n checked = false,\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 onChange,\n } = props;\n const [isChecked, setIsChecked] = useState(checked);\n const errorTextUuid = useUuid(errorTextId);\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 const { refObject, isFocused } = usePseudoClasses<HTMLInputElement>(isMutableRefObject(ref) ? ref : null);\n const mergedRefs = mergeRefs([ref, refObject]);\n\n const checkboxWrapperClasses = classNames(checkboxStyles['checkbox-wrapper'], {\n [checkboxStyles['checkbox-wrapper--large']]: large,\n });\n const checkboxLabelClasses = classNames(checkboxStyles['checkbox-label'], {\n [checkboxStyles['checkbox-label--disabled']]: disabled,\n [checkboxStyles['checkbox-label--on-dark']]: onDark,\n [checkboxStyles['checkbox-label--large']]: large,\n [checkboxStyles['checkbox-label__large--checked']]: large && isChecked,\n [checkboxStyles['checkbox-label__large--focus']]: large && isFocused,\n [checkboxStyles['checkbox-label__large--on-white']]: large && onWhite,\n [checkboxStyles['checkbox-label__large--on-grey']]: large && onGrey,\n [checkboxStyles['checkbox-label__large--on-blueberry']]: large && onBlueberry,\n [checkboxStyles['checkbox-label__large--on-invalid']]: large && onInvalid,\n [checkboxStyles['checkbox-label__large--disabled']]: large && disabled,\n });\n const checkboxClasses = classNames(checkboxStyles.checkbox, className);\n const checkboxIconWrapperClasses = classNames(checkboxStyles['checkbox__icon-wrapper'], {\n [checkboxStyles['checkbox__icon-wrapper--on-white']]: onWhite,\n [checkboxStyles['checkbox__icon-wrapper--on-grey']]: onGrey,\n [checkboxStyles['checkbox__icon-wrapper--on-invalid']]: onInvalid,\n [checkboxStyles['checkbox__icon-wrapper--disabled']]: disabled,\n [checkboxStyles['checkbox__icon-wrapper__regular--checked']]: !large && isChecked,\n [checkboxStyles['checkbox__icon-wrapper__regular--invalid']]: !large && isChecked && onInvalid,\n [checkboxStyles['checkbox__icon-wrapper__regular--on-dark']]: !large && isChecked && onDark,\n [checkboxStyles['checkbox__icon-wrapper__large--checked']]: large && isChecked,\n [checkboxStyles['checkbox__icon-wrapper__large--invalid']]: large && onInvalid,\n [checkboxStyles['checkbox__icon-wrapper--on-dark']]: onDark,\n [checkboxStyles['checkbox__icon-wrapper--on-blueberry']]: onBlueberry,\n [checkboxStyles['checkbox__icon-wrapper--invalid']]: onInvalid,\n [checkboxStyles['checkbox__icon-wrapper__large--invalid']]: large && isChecked && onInvalid,\n [checkboxStyles['checkbox__icon-wrapper__large--disabled']]: disabled && large && isChecked,\n [checkboxStyles['checkbox__icon-wrapper__large--checked--invalid']]: large && isChecked && onInvalid,\n [checkboxStyles['checkbox__icon-wrapper__large--checked--disabled']]: disabled && large && isChecked,\n });\n const labelTextClasses = classNames(checkboxStyles['checkbox-label__text'], {\n [checkboxStyles['checkbox-label__text__large--checked']]: large && isChecked,\n [checkboxStyles['checkbox-label__text__large--invalid']]: large && isChecked && onInvalid,\n [checkboxStyles['checkbox-label__text--on-dark']]: onDark,\n [checkboxStyles['checkbox-label__text--disabled']]: disabled,\n });\n\n let iconColor = getColor('white');\n if (onDark || (large && isChecked)) iconColor = getColor('blueberry', 900);\n if (onInvalid && large && isChecked) iconColor = getColor('white');\n if (disabled) iconColor = getColor('neutral', 700);\n\n useEffect(() => {\n setIsChecked(checked);\n }, [checked]);\n\n const onChangeHandler = (e: React.ChangeEvent<HTMLInputElement>): void => {\n if (onChange) {\n onChange(e);\n }\n\n setIsChecked(!isChecked);\n };\n\n const getLabelContent = (): React.ReactNode => {\n return (\n <>\n <input\n id={inputId}\n name={name}\n className={checkboxClasses}\n type=\"checkbox\"\n checked={isChecked}\n disabled={disabled}\n value={value}\n ref={mergedRefs}\n aria-describedby={getAriaDescribedBy(props, errorTextUuid)}\n aria-invalid={error}\n required={required}\n onChange={onChangeHandler}\n />\n <span className={checkboxIconWrapperClasses}>\n {isChecked && <Icon color={iconColor} className={checkboxStyles['checkbox__icon']} svgIcon={Check} size={IconSize.XSmall} />}\n </span>\n </>\n );\n };\n\n return (\n <ErrorWrapper className={errorWrapperClassName} errorText={errorText} errorTextId={errorTextUuid}>\n <div data-testid={testId} data-analyticsid={AnalyticsId.Checkbox} className={checkboxWrapperClasses}>\n {renderLabelAsParent(\n label,\n getLabelContent(),\n inputId,\n onColor as FormOnColor,\n checkboxLabelClasses,\n labelTextClasses,\n checkboxStyles['checkbox-sublabel-wrapper'],\n large\n )}\n </div>\n </ErrorWrapper>\n );\n});\n\nCheckbox.displayName = 'Checkbox';\n\nexport default Checkbox;\n"],"names":["React"],"mappings":";;;;;;;;;;;;;;;AA4CO,MAAM,WAAWA,eAAM,WAAW,CAAC,OAAsB,QAAqC;AACnG,QAAM;AAAA,IACJ;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA,UAAU,KAAA;AAAA,IACV,UAAU,YAAY;AAAA,IACtB,OAAO;AAAA,IACP;AAAA,IACA;AAAA,IACA,QAAQ,CAAC,CAAC;AAAA,IACV;AAAA,IACA;AAAA,IACA,QAAQ,aAAa,KAAK;AAAA,IAC1B;AAAA,IACA;AAAA,IACA;AAAA,EAAA,IACE;AACJ,QAAM,CAAC,WAAW,YAAY,IAAI,SAAS,OAAO;AAClD,QAAM,gBAAgB,QAAQ,WAAW;AACzC,QAAM,UAAU,YAAY,YAAY;AACxC,QAAM,SAAS,YAAY,YAAY;AACvC,QAAM,cAAc,YAAY,YAAY;AAC5C,QAAM,YAAY,SAAS,YAAY,YAAY;AACnD,QAAM,SAAS,YAAY,YAAY;AACvC,QAAM,QAAQ,SAAS,SAAS;AAChC,QAAM,EAAE,WAAW,cAAc,iBAAmC,mBAAmB,GAAG,IAAI,MAAM,IAAI;AACxG,QAAM,aAAa,UAAU,CAAC,KAAK,SAAS,CAAC;AAE7C,QAAM,yBAAyB,WAAW,eAAe,kBAAkB,GAAG;AAAA,IAC5E,CAAC,eAAe,yBAAyB,CAAC,GAAG;AAAA,EAAA,CAC9C;AACD,QAAM,uBAAuB,WAAW,eAAe,gBAAgB,GAAG;AAAA,IACxE,CAAC,eAAe,0BAA0B,CAAC,GAAG;AAAA,IAC9C,CAAC,eAAe,yBAAyB,CAAC,GAAG;AAAA,IAC7C,CAAC,eAAe,uBAAuB,CAAC,G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C,cAAA,EAAa,WAAW,uBAAuB,WAAsB,aAAa,eACjF,UAAA,oBAAC,OAAA,EAAI,eAAa,QAAQ,oBAAkB,YAAY,UAAU,WAAW,wBAC1E,UAAA;AAAA,IACC;AAAA,IACA,gBAAA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,eAAe,2BAA2B;AAAA,IAC1C;AAAA,EAAA,GAEJ,EAAA,CACF;AAEJ,CAAC;AAED,SAAS,cAAc;"}
|
package/ElementHeader.js
CHANGED
|
@@ -103,7 +103,7 @@ const ElementHeaderRoot = (props) => {
|
|
|
103
103
|
const contentIsString = typeof children === "string";
|
|
104
104
|
const mappedChildren = mapChildren(children);
|
|
105
105
|
const hasStatusDots = !!((_a = mappedChildren == null ? void 0 : mappedChildren.statusDotChildren) == null ? void 0 : _a.length) || !!(mappedChildren == null ? void 0 : mappedChildren.statusDotMCChild);
|
|
106
|
-
const listLabelClasses = classNames(styles["element-header"],
|
|
106
|
+
const listLabelClasses = classNames(styles["element-header"], className);
|
|
107
107
|
const badgeContainerClasses = classNames(styles["element-header__badge-container"]);
|
|
108
108
|
const badgeClasses = classNames(styles["element-header__badge"]);
|
|
109
109
|
const statusdotContainerClasses = classNames(styles["element-header__statusdot-container"]);
|
|
@@ -111,14 +111,15 @@ const ElementHeaderRoot = (props) => {
|
|
|
111
111
|
const contentClasses = classNames(styles["element-header__content"], {
|
|
112
112
|
[styles["element-header__content--element"]]: !contentIsString
|
|
113
113
|
});
|
|
114
|
-
const iconClasses = classNames(styles["element-header__icon"], {});
|
|
114
|
+
const iconClasses = classNames(styles["element-header__icon"], { [styles["element-header__icon--with-statusdot"]]: hasStatusDots });
|
|
115
115
|
const avatarClasses = classNames(styles["element-header__avatar"], {});
|
|
116
116
|
const CustomTag = titleHtmlMarkup;
|
|
117
|
+
const iconPropIsIconComponent = isComponent(icon, Icon);
|
|
117
118
|
return /* @__PURE__ */ jsxs("span", { "data-testid": testId, className: listLabelClasses, children: [
|
|
118
|
-
showIcon && icon && /* @__PURE__ */ jsx("span", { className: iconClasses, children: React__default.cloneElement(icon, {
|
|
119
|
+
showIcon && icon && /* @__PURE__ */ jsx("span", { className: iconClasses, children: iconPropIsIconComponent ? React__default.cloneElement(icon, {
|
|
119
120
|
size: breakpoint < Breakpoint.md ? IconSize.XSmall : IconSize.Small,
|
|
120
121
|
isHovered
|
|
121
|
-
}) }),
|
|
122
|
+
}) : icon }),
|
|
122
123
|
size !== "small" && (mappedChildren == null ? void 0 : mappedChildren.avatarChild) && /* @__PURE__ */ jsx("span", { className: avatarClasses, children: React__default.cloneElement(mappedChildren.avatarChild, { size: AvatarSize.xsmall }) }),
|
|
123
124
|
/* @__PURE__ */ jsxs("span", { className: contentClasses, "data-hasstatusdots": hasStatusDots, children: [
|
|
124
125
|
mappedChildren == null ? void 0 : mappedChildren.elementHeaderTextChildren,
|
package/ElementHeader.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ElementHeader.js","sources":["../src/components/ElementHeader/ElementHeader.tsx"],"sourcesContent":["import React from 'react';\n\nimport cn from 'classnames';\n\nimport ElementHeaderText, { ElementHeaderTextProps, ElementHeaderTextType } from './ElementHeaderText/ElementHeaderText';\nimport { Breakpoint, useBreakpoint } from '../../hooks/useBreakpoint';\nimport { isComponent, isComponentWithChildren } from '../../utils/component';\nimport Avatar, { AvatarProps, AvatarSize, AvatarType } from '../Avatar';\nimport Badge, { BadgeProps, BadgeType } from '../Badge';\nimport Icon, { IconSize, SvgIcon } from '../Icon';\nimport StatusDot, { StatusDotProps, StatusDotType } from '../StatusDot';\nimport { TitleTags } from '../Title';\nimport StatusDotList from './StatusDotList';\nimport Highlighter from '../Highlighter';\nimport { StatusDotListProps, StatusDotListType } from './StatusDotList/StatusDotList';\n\nimport styles from './styles.module.scss';\n\nexport type ElementHeaderSize = 'small' | 'medium' | 'large';\nexport type ParentType = 'linklist' | 'expanderlist';\n\nexport interface ElementHeaderType extends React.FC<ElementHeaderProps> {\n Avatar?: AvatarType;\n Badge?: BadgeType;\n ElementHeaderText?: ElementHeaderTextType;\n StatusDot?: StatusDotType;\n StatusDotList?: StatusDotListType;\n}\n\nexport const renderElementHeader = (\n element: React.ReactNode,\n options: Pick<ElementHeaderProps, 'titleHtmlMarkup' | 'isHovered' | 'size' | 'parentType' | 'chevronIcon' | 'icon' | 'highlightText'>\n): React.ReactElement | undefined => {\n const { titleHtmlMarkup, isHovered, size, parentType, chevronIcon, icon, highlightText } = options;\n\n if (isComponent<ElementHeaderProps>(element, ElementHeader)) {\n return React.cloneElement(element, {\n chevronIcon,\n icon,\n isHovered,\n size,\n parentType,\n highlightText,\n });\n }\n if (element) {\n return (\n <ElementHeader\n highlightText={highlightText}\n titleHtmlMarkup={titleHtmlMarkup}\n parentType={parentType}\n chevronIcon={chevronIcon}\n icon={icon}\n isHovered={isHovered}\n size={size}\n >\n {element}\n </ElementHeader>\n );\n }\n};\n\nexport interface ElementHeaderProps {\n /** Adds custom classes to the ElementHeader element. */\n className?: string;\n /** Chevron to render inside of the ElementHeader */\n chevronIcon?: SvgIcon;\n /** Children to be rendered inside of ElementHeader */\n children: React.ReactNode;\n /** Changes the underlying element of the title. Default: h2*/\n titleHtmlMarkup?: TitleTags;\n /** icon to be rendered inside of ElementHeader */\n icon?: React.ReactElement;\n /** whether or not the parent is hovered */\n isHovered?: boolean;\n /** Adjusts styling based on parent */\n parentType?: ParentType;\n /** Changes size of the ElementHeader. */\n size?: ElementHeaderSize;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Highlights text in title. Used for search results */\n highlightText?: string;\n}\n\ninterface ElementHeaderChildren {\n avatarChild?: React.ReactElement<AvatarProps>;\n elementHeaderTextChildren: React.ReactElement<ElementHeaderTextProps>[];\n badgeChildren?: React.ReactElement<BadgeProps>[];\n statusDotChildren?: React.ReactElement<StatusDotProps>[];\n statusDotMCChild?: React.ReactElement<StatusDotListProps>;\n elementChild?: React.ReactElement;\n stringChildren: string[];\n remainingChildren: React.ReactNode[];\n}\n\ntype ChildrenMapper = (children: React.ReactNode, isJsxChild?: boolean) => ElementHeaderChildren | undefined;\n\nexport const mapChildren: ChildrenMapper = (children, isJsxChild = false) => {\n let avatarChild: React.ReactElement<AvatarProps> | undefined;\n const badgeChildren: React.ReactElement<BadgeProps>[] = [];\n const statusDotChildren: React.ReactElement<StatusDotProps>[] = [];\n let statusDotMCChild: React.ReactElement<StatusDotListProps> | undefined;\n const elementHeaderTextChildren: React.ReactElement<ElementHeaderTextProps>[] = [];\n const stringChildren: string[] = [];\n const remainingChildren: React.ReactNode[] = [];\n\n React.Children.forEach(children, child => {\n if (child === null || typeof child === 'undefined') return;\n if (isComponent<AvatarProps>(child, Avatar)) {\n avatarChild = child;\n } else if (isComponent<ElementHeaderTextProps>(child, ElementHeaderText)) {\n elementHeaderTextChildren.push(child);\n } else if (isComponent<BadgeProps>(child, Badge)) {\n badgeChildren.push(child);\n } else if (isComponent<StatusDotListProps>(child, StatusDotList)) {\n statusDotMCChild = child;\n } else if (isComponent<StatusDotProps>(child, StatusDot)) {\n statusDotChildren.push(child);\n } else if (typeof child === 'string') {\n stringChildren.push(child);\n } else {\n remainingChildren.push(child);\n }\n });\n\n // Dette og recursive mapChildren under(gjøres en gang) er for å passe på at jsx children også sjekkes for Avatar og liknende innhold.\n // Slik opprettholder vi stylingen i tilfeller hvor vertikaler har wrappet elementer i en parent span eller div.\n const hasSpecialChildren =\n avatarChild !== undefined ||\n elementHeaderTextChildren.length > 0 ||\n statusDotChildren.length > 0 ||\n statusDotMCChild !== undefined ||\n (badgeChildren !== undefined && stringChildren.length > 0);\n const noRemainingRecursiveChildren =\n remainingChildren.length === 0 ||\n (isComponentWithChildren(remainingChildren[0]) && typeof remainingChildren[0]?.props?.children === 'undefined');\n\n if (isJsxChild || hasSpecialChildren || noRemainingRecursiveChildren) {\n return {\n avatarChild,\n elementHeaderTextChildren: elementHeaderTextChildren,\n badgeChildren,\n statusDotChildren,\n statusDotMCChild,\n stringChildren,\n remainingChildren,\n };\n }\n\n if (isComponentWithChildren(remainingChildren[0])) {\n return mapChildren(remainingChildren[0]?.props?.children, true);\n }\n};\n\nexport const ElementHeaderRoot: ElementHeaderType = props => {\n const {\n className = '',\n titleHtmlMarkup = 'h2',\n parentType = 'linklist',\n chevronIcon,\n children,\n icon,\n isHovered,\n size,\n testId,\n highlightText,\n } = props;\n const breakpoint = useBreakpoint();\n const showIcon = size !== 'small' && !!icon;\n const contentIsString = typeof children === 'string';\n const mappedChildren = mapChildren(children);\n const hasStatusDots = !!mappedChildren?.statusDotChildren?.length || !!mappedChildren?.statusDotMCChild;\n\n const listLabelClasses = cn(styles['element-header'], { [styles['element-header--with-statusdot']]: hasStatusDots }, className);\n const badgeContainerClasses = cn(styles['element-header__badge-container']);\n const badgeClasses = cn(styles['element-header__badge']);\n const statusdotContainerClasses = cn(styles['element-header__statusdot-container']);\n const chevronClasses = cn(styles['element-header__chevron']);\n const contentClasses = cn(styles['element-header__content'], {\n [styles['element-header__content--element']]: !contentIsString,\n });\n const iconClasses = cn(styles['element-header__icon'], {});\n const avatarClasses = cn(styles['element-header__avatar'], {});\n const CustomTag = titleHtmlMarkup;\n return (\n <span data-testid={testId} className={listLabelClasses}>\n {showIcon && icon && (\n <span className={iconClasses}>\n {React.cloneElement(icon, {\n size: breakpoint < Breakpoint.md ? IconSize.XSmall : IconSize.Small,\n isHovered,\n })}\n </span>\n )}\n {size !== 'small' && mappedChildren?.avatarChild && (\n <span className={avatarClasses}>{React.cloneElement(mappedChildren.avatarChild, { size: AvatarSize.xsmall })}</span>\n )}\n\n <span className={contentClasses} data-hasstatusdots={hasStatusDots}>\n {mappedChildren?.elementHeaderTextChildren}\n {!!mappedChildren?.stringChildren.length && (\n <CustomTag className={styles['element-header__title']}>\n <Highlighter searchText={highlightText}>{mappedChildren.stringChildren}</Highlighter>\n </CustomTag>\n )}\n <Highlighter searchText={highlightText}>{mappedChildren?.remainingChildren}</Highlighter>\n </span>\n\n {hasStatusDots && (\n <span className={statusdotContainerClasses}>\n {!!mappedChildren?.statusDotChildren && <StatusDotList>{mappedChildren.statusDotChildren}</StatusDotList>}\n {!!mappedChildren?.statusDotMCChild && mappedChildren?.statusDotMCChild}\n </span>\n )}\n\n <span className={badgeContainerClasses}>\n {mappedChildren?.badgeChildren &&\n mappedChildren.badgeChildren.map((badgeChild, index) => {\n return (\n <span key={index} className={badgeClasses} data-parenttype={parentType}>\n {badgeChild}\n </span>\n );\n })}\n </span>\n {chevronIcon && (\n <span className={chevronClasses} data-parenttype={parentType}>\n <Icon svgIcon={chevronIcon} isHovered={isHovered} size={IconSize.XSmall} />\n </span>\n )}\n </span>\n );\n};\n\ntype ElementHeaderComponent = typeof ElementHeaderRoot & {\n Text: React.FC<ElementHeaderTextProps>;\n StatusDotList: React.FC<StatusDotListProps>;\n};\nElementHeaderRoot.displayName = 'ElementHeader';\nconst ElementHeader = ElementHeaderRoot as ElementHeaderComponent;\nElementHeader.Text = ElementHeaderText;\nElementHeader.Text.displayName = 'ElementHeader.Text';\nElementHeader.StatusDotList = StatusDotList;\nElementHeader.StatusDotList.displayName = 'ElementHeader.StatusDotList';\n\nexport default ElementHeader;\n"],"names":["React","cn"],"mappings":";;;;;;;;;;;;;;AA6BO,MAAM,sBAAsB,CACjC,SACA,YACmC;AACnC,QAAM,EAAE,iBAAiB,WAAW,MAAM,YAAY,aAAa,MAAM,kBAAkB;AAE3F,MAAI,YAAgC,SAAS,aAAa,GAAG;AAC3D,WAAOA,eAAM,aAAa,SAAS;AAAA,MACjC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IAAA,CACD;AAAA,EACH;AACA,MAAI,SAAS;AACX,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QAEC,UAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AACF;AAsCO,MAAM,cAA8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Content":["import React from 'react';\n\nimport cn from 'classnames';\n\nimport ElementHeaderText, { ElementHeaderTextProps, ElementHeaderTextType } from './ElementHeaderText/ElementHeaderText';\nimport { Breakpoint, useBreakpoint } from '../../hooks/useBreakpoint';\nimport { isComponent, isComponentWithChildren } from '../../utils/component';\nimport Avatar, { AvatarProps, AvatarSize, AvatarType } from '../Avatar';\nimport Badge, { BadgeProps, BadgeType } from '../Badge';\nimport Icon, { IconProps, IconSize, SvgIcon } from '../Icon';\nimport StatusDot, { StatusDotProps, StatusDotType } from '../StatusDot';\nimport { TitleTags } from '../Title';\nimport StatusDotList from './StatusDotList';\nimport Highlighter from '../Highlighter';\nimport { StatusDotListProps, StatusDotListType } from './StatusDotList/StatusDotList';\n\nimport styles from './styles.module.scss';\n\nexport type ElementHeaderSize = 'small' | 'medium' | 'large';\nexport type ParentType = 'linklist' | 'expanderlist';\n\nexport interface ElementHeaderType extends React.FC<ElementHeaderProps> {\n Avatar?: AvatarType;\n Badge?: BadgeType;\n ElementHeaderText?: ElementHeaderTextType;\n StatusDot?: StatusDotType;\n StatusDotList?: StatusDotListType;\n}\n\nexport const renderElementHeader = (\n element: React.ReactNode,\n options: Pick<ElementHeaderProps, 'titleHtmlMarkup' | 'isHovered' | 'size' | 'parentType' | 'chevronIcon' | 'icon' | 'highlightText'>\n): React.ReactElement | undefined => {\n const { titleHtmlMarkup, isHovered, size, parentType, chevronIcon, icon, highlightText } = options;\n\n if (isComponent<ElementHeaderProps>(element, ElementHeader)) {\n return React.cloneElement(element, {\n chevronIcon,\n icon,\n isHovered,\n size,\n parentType,\n highlightText,\n });\n }\n if (element) {\n return (\n <ElementHeader\n highlightText={highlightText}\n titleHtmlMarkup={titleHtmlMarkup}\n parentType={parentType}\n chevronIcon={chevronIcon}\n icon={icon}\n isHovered={isHovered}\n size={size}\n >\n {element}\n </ElementHeader>\n );\n }\n};\n\nexport interface ElementHeaderProps {\n /** Adds custom classes to the ElementHeader element. */\n className?: string;\n /** Chevron to render inside of the ElementHeader */\n chevronIcon?: SvgIcon;\n /** Children to be rendered inside of ElementHeader */\n children: React.ReactNode;\n /** Changes the underlying element of the title. Default: h2*/\n titleHtmlMarkup?: TitleTags;\n /** icon to be rendered inside of ElementHeader */\n icon?: React.ReactElement;\n /** whether or not the parent is hovered */\n isHovered?: boolean;\n /** Adjusts styling based on parent */\n parentType?: ParentType;\n /** Changes size of the ElementHeader. */\n size?: ElementHeaderSize;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Highlights text in title. Used for search results */\n highlightText?: string;\n}\n\ninterface ElementHeaderChildren {\n avatarChild?: React.ReactElement<AvatarProps>;\n elementHeaderTextChildren: React.ReactElement<ElementHeaderTextProps>[];\n badgeChildren?: React.ReactElement<BadgeProps>[];\n statusDotChildren?: React.ReactElement<StatusDotProps>[];\n statusDotMCChild?: React.ReactElement<StatusDotListProps>;\n elementChild?: React.ReactElement;\n stringChildren: string[];\n remainingChildren: React.ReactNode[];\n}\n\ntype ChildrenMapper = (children: React.ReactNode, isJsxChild?: boolean) => ElementHeaderChildren | undefined;\n\nexport const mapChildren: ChildrenMapper = (children, isJsxChild = false) => {\n let avatarChild: React.ReactElement<AvatarProps> | undefined;\n const badgeChildren: React.ReactElement<BadgeProps>[] = [];\n const statusDotChildren: React.ReactElement<StatusDotProps>[] = [];\n let statusDotMCChild: React.ReactElement<StatusDotListProps> | undefined;\n const elementHeaderTextChildren: React.ReactElement<ElementHeaderTextProps>[] = [];\n const stringChildren: string[] = [];\n const remainingChildren: React.ReactNode[] = [];\n\n React.Children.forEach(children, child => {\n if (child === null || typeof child === 'undefined') return;\n if (isComponent<AvatarProps>(child, Avatar)) {\n avatarChild = child;\n } else if (isComponent<ElementHeaderTextProps>(child, ElementHeaderText)) {\n elementHeaderTextChildren.push(child);\n } else if (isComponent<BadgeProps>(child, Badge)) {\n badgeChildren.push(child);\n } else if (isComponent<StatusDotListProps>(child, StatusDotList)) {\n statusDotMCChild = child;\n } else if (isComponent<StatusDotProps>(child, StatusDot)) {\n statusDotChildren.push(child);\n } else if (typeof child === 'string') {\n stringChildren.push(child);\n } else {\n remainingChildren.push(child);\n }\n });\n\n // Dette og recursive mapChildren under(gjøres en gang) er for å passe på at jsx children også sjekkes for Avatar og liknende innhold.\n // Slik opprettholder vi stylingen i tilfeller hvor vertikaler har wrappet elementer i en parent span eller div.\n const hasSpecialChildren =\n avatarChild !== undefined ||\n elementHeaderTextChildren.length > 0 ||\n statusDotChildren.length > 0 ||\n statusDotMCChild !== undefined ||\n (badgeChildren !== undefined && stringChildren.length > 0);\n const noRemainingRecursiveChildren =\n remainingChildren.length === 0 ||\n (isComponentWithChildren(remainingChildren[0]) && typeof remainingChildren[0]?.props?.children === 'undefined');\n\n if (isJsxChild || hasSpecialChildren || noRemainingRecursiveChildren) {\n return {\n avatarChild,\n elementHeaderTextChildren: elementHeaderTextChildren,\n badgeChildren,\n statusDotChildren,\n statusDotMCChild,\n stringChildren,\n remainingChildren,\n };\n }\n\n if (isComponentWithChildren(remainingChildren[0])) {\n return mapChildren(remainingChildren[0]?.props?.children, true);\n }\n};\n\nexport const ElementHeaderRoot: ElementHeaderType = props => {\n const {\n className = '',\n titleHtmlMarkup = 'h2',\n parentType = 'linklist',\n chevronIcon,\n children,\n icon,\n isHovered,\n size,\n testId,\n highlightText,\n } = props;\n const breakpoint = useBreakpoint();\n const showIcon = size !== 'small' && !!icon;\n const contentIsString = typeof children === 'string';\n const mappedChildren = mapChildren(children);\n const hasStatusDots = !!mappedChildren?.statusDotChildren?.length || !!mappedChildren?.statusDotMCChild;\n\n const listLabelClasses = cn(styles['element-header'], className);\n const badgeContainerClasses = cn(styles['element-header__badge-container']);\n const badgeClasses = cn(styles['element-header__badge']);\n const statusdotContainerClasses = cn(styles['element-header__statusdot-container']);\n const chevronClasses = cn(styles['element-header__chevron']);\n const contentClasses = cn(styles['element-header__content'], {\n [styles['element-header__content--element']]: !contentIsString,\n });\n const iconClasses = cn(styles['element-header__icon'], { [styles['element-header__icon--with-statusdot']]: hasStatusDots });\n const avatarClasses = cn(styles['element-header__avatar'], {});\n const CustomTag = titleHtmlMarkup;\n const iconPropIsIconComponent = isComponent<IconProps>(icon, Icon);\n\n return (\n <span data-testid={testId} className={listLabelClasses}>\n {showIcon && icon && (\n <span className={iconClasses}>\n {iconPropIsIconComponent\n ? React.cloneElement(icon, {\n size: breakpoint < Breakpoint.md ? IconSize.XSmall : IconSize.Small,\n isHovered,\n })\n : icon}\n </span>\n )}\n {size !== 'small' && mappedChildren?.avatarChild && (\n <span className={avatarClasses}>{React.cloneElement(mappedChildren.avatarChild, { size: AvatarSize.xsmall })}</span>\n )}\n\n <span className={contentClasses} data-hasstatusdots={hasStatusDots}>\n {mappedChildren?.elementHeaderTextChildren}\n {!!mappedChildren?.stringChildren.length && (\n <CustomTag className={styles['element-header__title']}>\n <Highlighter searchText={highlightText}>{mappedChildren.stringChildren}</Highlighter>\n </CustomTag>\n )}\n <Highlighter searchText={highlightText}>{mappedChildren?.remainingChildren}</Highlighter>\n </span>\n\n {hasStatusDots && (\n <span className={statusdotContainerClasses}>\n {!!mappedChildren?.statusDotChildren && <StatusDotList>{mappedChildren.statusDotChildren}</StatusDotList>}\n {!!mappedChildren?.statusDotMCChild && mappedChildren?.statusDotMCChild}\n </span>\n )}\n\n <span className={badgeContainerClasses}>\n {mappedChildren?.badgeChildren &&\n mappedChildren.badgeChildren.map((badgeChild, index) => {\n return (\n <span key={index} className={badgeClasses} data-parenttype={parentType}>\n {badgeChild}\n </span>\n );\n })}\n </span>\n {chevronIcon && (\n <span className={chevronClasses} data-parenttype={parentType}>\n <Icon svgIcon={chevronIcon} isHovered={isHovered} size={IconSize.XSmall} />\n </span>\n )}\n </span>\n );\n};\n\ntype ElementHeaderComponent = typeof ElementHeaderRoot & {\n Text: React.FC<ElementHeaderTextProps>;\n StatusDotList: React.FC<StatusDotListProps>;\n};\nElementHeaderRoot.displayName = 'ElementHeader';\nconst ElementHeader = ElementHeaderRoot as ElementHeaderComponent;\nElementHeader.Text = ElementHeaderText;\nElementHeader.Text.displayName = 'ElementHeader.Text';\nElementHeader.StatusDotList = StatusDotList;\nElementHeader.StatusDotList.displayName = 'ElementHeader.StatusDotList';\n\nexport default ElementHeader;\n"],"names":["React","cn"],"mappings":";;;;;;;;;;;;;;AA6BO,MAAM,sBAAsB,CACjC,SACA,YACmC;AACnC,QAAM,EAAE,iBAAiB,WAAW,MAAM,YAAY,aAAa,MAAM,kBAAkB;AAE3F,MAAI,YAAgC,SAAS,aAAa,GAAG;AAC3D,WAAOA,eAAM,aAAa,SAAS;AAAA,MACjC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IAAA,CACD;AAAA,EACH;AACA,MAAI,SAAS;AACX,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QAEC,UAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AACF;AAsCO,MAAM,cAA8B,CAAC,UAAU,aAAa,UAAU;;AAC3E,MAAI;AACJ,QAAM,gBAAkD,CAAA;AACxD,QAAM,oBAA0D,CAAA;AAChE,MAAI;AACJ,QAAM,4BAA0E,CAAA;AAChF,QAAM,iBAA2B,CAAA;AACjC,QAAM,oBAAuC,CAAA;AAE7CA,iBAAM,SAAS,QAAQ,UAAU,CAAA,UAAS;AACxC,QAAI,UAAU,QAAQ,OAAO,UAAU,YAAa;AACpD,QAAI,YAAyB,OAAO,MAAM,GAAG;AAC3C,oBAAc;AAAA,IAChB,WAAW,YAAoC,OAAO,iBAAiB,GAAG;AACxE,gCAA0B,KAAK,KAAK;AAAA,IACtC,WAAW,YAAwB,OAAO,KAAK,GAAG;AAChD,oBAAc,KAAK,KAAK;AAAA,IAC1B,WAAW,YAAgC,OAAO,aAAa,GAAG;AAChE,yBAAmB;AAAA,IACrB,WAAW,YAA4B,OAAO,SAAS,GAAG;AACxD,wBAAkB,KA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BAAqB,oBAAC,eAAA,EAAe,yBAAe,mBAAkB;AAAA,MACxF,CAAC,EAAC,iDAAgB,sBAAoB,iDAAgB;AAAA,IAAA,GACzD;AAAA,IAGF,oBAAC,QAAA,EAAK,WAAW,uBACd,WAAA,iDAAgB,kBACf,eAAe,cAAc,IAAI,CAAC,YAAY,UAAU;AACtD,iCACG,QAAA,EAAiB,WAAW,cAAc,mBAAiB,YACzD,wBADQ,KAEX;AAAA,IAEJ,CAAC,EAAA,CACL;AAAA,IACC,eACC,oBAAC,QAAA,EAAK,WAAW,gBAAgB,mBAAiB,YAChD,UAAA,oBAAC,MAAA,EAAK,SAAS,aAAa,WAAsB,MAAM,SAAS,QAAQ,EAAA,CAC3E;AAAA,EAAA,GAEJ;AAEJ;AAMA,kBAAkB,cAAc;AAChC,MAAM,gBAAgB;AACtB,cAAc,OAAO;AACrB,cAAc,KAAK,cAAc;AACjC,cAAc,gBAAgB;AAC9B,cAAc,cAAc,cAAc;"}
|
package/HighlightPanel.js
CHANGED
|
@@ -9,18 +9,38 @@ import { L as LazyIcon } from "./LazyIcon.js";
|
|
|
9
9
|
import { T as Title } from "./Title.js";
|
|
10
10
|
import styles from "./components/HighlightPanel/styles.module.scss";
|
|
11
11
|
const HighlightPanel = (props) => {
|
|
12
|
-
const {
|
|
12
|
+
const {
|
|
13
|
+
children,
|
|
14
|
+
color = "white",
|
|
15
|
+
testId,
|
|
16
|
+
svgIcon,
|
|
17
|
+
htmlMarkup = "div",
|
|
18
|
+
className,
|
|
19
|
+
variant = "normal",
|
|
20
|
+
title,
|
|
21
|
+
titleHtmlMarkup = "h2"
|
|
22
|
+
} = props;
|
|
13
23
|
const breakpoint = useBreakpoint();
|
|
14
24
|
const containerClassName = classNames(
|
|
15
25
|
styles.highlightpanel,
|
|
16
26
|
styles[`highlightpanel--${color}`],
|
|
17
27
|
svgIcon && styles["highlightpanel--has-icon"],
|
|
18
|
-
className
|
|
28
|
+
className,
|
|
29
|
+
{ [styles["highlightpanel--compact"]]: variant === "compact" }
|
|
19
30
|
);
|
|
20
31
|
const renderContent = () => {
|
|
21
|
-
const titleElement = title && /* @__PURE__ */ jsx(Title, { testId: "titleId", htmlMarkup: titleHtmlMarkup, appearance: "title4", children: title });
|
|
32
|
+
const titleElement = title && /* @__PURE__ */ jsx(Title, { testId: "titleId", htmlMarkup: titleHtmlMarkup, appearance: variant === "compact" ? "title6" : "title4", children: title });
|
|
22
33
|
if (svgIcon) {
|
|
23
34
|
const iconSize = IconSize.Small;
|
|
35
|
+
if (variant === "compact") {
|
|
36
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
37
|
+
/* @__PURE__ */ jsx("div", { className: classNames(styles.highlightpanel__icon, styles["highlightpanel__icon--compact"]), children: typeof svgIcon === "string" ? /* @__PURE__ */ jsx(LazyIcon, { iconName: svgIcon, size: iconSize }) : /* @__PURE__ */ jsx(Icon, { svgIcon, size: iconSize }) }),
|
|
38
|
+
/* @__PURE__ */ jsxs("div", { className: (styles.highlightpanel__content, styles["highlightpanel__content--compact"]), children: [
|
|
39
|
+
title && /* @__PURE__ */ jsx("div", { className: styles["highlightpanel__title-wrapper"], children: titleElement }),
|
|
40
|
+
/* @__PURE__ */ jsx("div", { className: styles["highlightpanel__content__children--compact"], children })
|
|
41
|
+
] })
|
|
42
|
+
] });
|
|
43
|
+
}
|
|
24
44
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
25
45
|
/* @__PURE__ */ jsxs("div", { className: styles.highlightpanel__icon, children: [
|
|
26
46
|
typeof svgIcon === "string" ? /* @__PURE__ */ jsx(LazyIcon, { iconName: svgIcon, size: iconSize }) : /* @__PURE__ */ jsx(Icon, { svgIcon, size: iconSize }),
|
package/HighlightPanel.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HighlightPanel.js","sources":["../src/components/HighlightPanel/HighlightPanel.tsx"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport { useBreakpoint, Breakpoint } from '../..';\nimport { AnalyticsId } from '../../constants';\nimport { PaletteNames } from '../../theme/palette';\nimport Icon, { SvgIcon, IconSize } from '../Icon';\nimport { IconName } from '../Icons/IconNames';\nimport LazyIcon from '../LazyIcon';\nimport Title, { TitleTags } from '../Title';\n\nimport styles from './styles.module.scss';\n\nexport type HighlightPanelColors = Extract<PaletteNames, 'white' | 'neutral' | 'blueberry' | 'cherry'>;\n\nexport type HighlightPanelTags = Exclude<\n keyof HTMLElementTagNameMap,\n 'dir' | 'font' | 'frame' | 'frameset' | 'marquee' | 'applet' | 'basefont' | 'search'\n>;\n\nexport interface HighlightPanelProps {\n /** What's in the box? */\n children: React.ReactNode;\n /** Changes the background color. Default: white */\n color?: HighlightPanelColors;\n /** Adds an icon to the highlightpanel. */\n svgIcon?: SvgIcon | IconName;\n /** Changes the underlying element. Default: div */\n htmlMarkup?: HighlightPanelTags;\n /** Adds custom classes to the element. */\n className?: string;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Element that is set after the icon-element in the DOM, often a title-element */\n title?: string;\n /** Markup props for title */\n titleHtmlMarkup?: TitleTags;\n}\n\nconst HighlightPanel: React.FC<HighlightPanelProps> = props => {\n const {
|
|
1
|
+
{"version":3,"file":"HighlightPanel.js","sources":["../src/components/HighlightPanel/HighlightPanel.tsx"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport { useBreakpoint, Breakpoint } from '../..';\nimport { AnalyticsId } from '../../constants';\nimport { PaletteNames } from '../../theme/palette';\nimport Icon, { SvgIcon, IconSize } from '../Icon';\nimport { IconName } from '../Icons/IconNames';\nimport LazyIcon from '../LazyIcon';\nimport Title, { TitleTags } from '../Title';\n\nimport styles from './styles.module.scss';\n\nexport type HighlightPanelColors = Extract<PaletteNames, 'white' | 'neutral' | 'blueberry' | 'cherry'>;\n\nexport type HighlightPanelTags = Exclude<\n keyof HTMLElementTagNameMap,\n 'dir' | 'font' | 'frame' | 'frameset' | 'marquee' | 'applet' | 'basefont' | 'search'\n>;\n\nexport type HighlightPanelVariants = 'normal' | 'compact';\n\nexport interface HighlightPanelProps {\n /** What's in the box? */\n children: React.ReactNode;\n /** Changes the background color. Default: white */\n color?: HighlightPanelColors;\n /** Adds an icon to the highlightpanel. */\n svgIcon?: SvgIcon | IconName;\n /** Changes the underlying element. Default: div */\n htmlMarkup?: HighlightPanelTags;\n /** Adds custom classes to the element. */\n className?: string;\n /** Uses the compact styling if set to compact */\n variant?: HighlightPanelVariants;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Element that is set after the icon-element in the DOM, often a title-element */\n title?: string;\n /** Markup props for title */\n titleHtmlMarkup?: TitleTags;\n}\n\nconst HighlightPanel: React.FC<HighlightPanelProps> = props => {\n const {\n children,\n color = 'white',\n testId,\n svgIcon,\n htmlMarkup = 'div',\n className,\n variant = 'normal',\n title,\n titleHtmlMarkup = 'h2',\n } = props;\n const breakpoint = useBreakpoint();\n\n const containerClassName = classNames(\n styles.highlightpanel,\n styles[`highlightpanel--${color}`],\n svgIcon && styles['highlightpanel--has-icon'],\n className,\n { [styles['highlightpanel--compact']]: variant === 'compact' }\n );\n\n const renderContent = (): React.ReactNode => {\n const titleElement = title && (\n <Title testId=\"titleId\" htmlMarkup={titleHtmlMarkup} appearance={variant === 'compact' ? 'title6' : 'title4'}>\n {title}\n </Title>\n );\n\n if (svgIcon) {\n const iconSize = IconSize.Small;\n\n if (variant === 'compact') {\n return (\n <>\n <div className={classNames(styles.highlightpanel__icon, styles['highlightpanel__icon--compact'])}>\n {typeof svgIcon === 'string' ? <LazyIcon iconName={svgIcon} size={iconSize} /> : <Icon svgIcon={svgIcon} size={iconSize} />}\n </div>\n <div className={(styles.highlightpanel__content, styles['highlightpanel__content--compact'])}>\n {title && <div className={styles['highlightpanel__title-wrapper']}>{titleElement}</div>}\n <div className={styles['highlightpanel__content__children--compact']}>{children}</div>\n </div>\n </>\n );\n }\n\n return (\n <>\n <div className={styles.highlightpanel__icon}>\n {typeof svgIcon === 'string' ? <LazyIcon iconName={svgIcon} size={iconSize} /> : <Icon svgIcon={svgIcon} size={iconSize} />}\n {title && breakpoint < Breakpoint.md && <div className={styles['highlightpanel__title-wrapper']}>{titleElement}</div>}\n </div>\n <div className={styles.highlightpanel__content}>\n {title && breakpoint >= Breakpoint.md && <div className={styles['highlightpanel__title-wrapper']}>{titleElement}</div>}\n {children}\n </div>\n </>\n );\n }\n\n return (\n <>\n {title && (\n <div className={styles.highlightpanel__content}>\n <div>{titleElement}</div>\n </div>\n )}\n {children}\n </>\n );\n };\n\n const CustomTag = htmlMarkup;\n\n return (\n <CustomTag className={containerClassName} data-testid={testId} data-analyticsid={AnalyticsId.HighlightPanel}>\n {renderContent()}\n </CustomTag>\n );\n};\n\nexport default HighlightPanel;\n"],"names":[],"mappings":";;;;;;;;;;AA4CA,MAAM,iBAAgD,CAAA,UAAS;AAC7D,QAAM;AAAA,IACJ;AAAA,IACA,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,IACA,aAAa;AAAA,IACb;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA,kBAAkB;AAAA,EAAA,IAChB;AACJ,QAAM,aAAa,cAAA;AAEnB,QAAM,qBAAqB;AAAA,IACzB,OAAO;AAAA,IACP,OAAO,mBAAmB,KAAK,EAAE;AAAA,IACjC,WAAW,OAAO,0BAA0B;AAAA,IAC5C;AAAA,IACA,EAAE,CAAC,OAAO,yBAAyB,CAAC,GAAG,YAAY,UAAA;AAAA,EAAU;AAG/D,QAAM,gBAAgB,MAAuB;AAC3C,UAAM,eAAe,SACnB,oBAAC,OAAA,EAAM,QAAO,WAAU,YAAY,iBAAiB,YAAY,YAAY,YAAY,WAAW,UACjG,UAAA,OACH;AAGF,QAAI,SAAS;AACX,YAAM,WAAW,SAAS;AAE1B,UAAI,YAAY,WAAW;AACzB,eACE,qBAAA,UAAA,EACE,UAAA;AAAA,UAAA,oBAAC,OAAA,EAAI,WAAW,WAAW,OAAO,sBAAsB,OAAO,+BAA+B,CAAC,GAC5F,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package/Input.js
CHANGED
|
@@ -160,6 +160,7 @@ const Input = React__default.forwardRef((props, ref) => {
|
|
|
160
160
|
/* @__PURE__ */ jsx(
|
|
161
161
|
"input",
|
|
162
162
|
{
|
|
163
|
+
...rest,
|
|
163
164
|
onChange: handleChange,
|
|
164
165
|
onKeyDown: handleKeyDown,
|
|
165
166
|
onKeyUp: handleKeyUp,
|
|
@@ -169,7 +170,6 @@ const Input = React__default.forwardRef((props, ref) => {
|
|
|
169
170
|
id: inputIdState,
|
|
170
171
|
className: inputClass,
|
|
171
172
|
ref,
|
|
172
|
-
"aria-labelledby": props["aria-labelledby"] ?? void 0,
|
|
173
173
|
"aria-describedby": getAriaDescribedBy(props, errorTextUuid),
|
|
174
174
|
"aria-invalid": !!onError,
|
|
175
175
|
disabled,
|
|
@@ -177,8 +177,7 @@ const Input = React__default.forwardRef((props, ref) => {
|
|
|
177
177
|
readOnly,
|
|
178
178
|
autoComplete: autoComplete || "off",
|
|
179
179
|
required,
|
|
180
|
-
autoFocus
|
|
181
|
-
...rest
|
|
180
|
+
autoFocus
|
|
182
181
|
}
|
|
183
182
|
),
|
|
184
183
|
iconRight && renderIcon()
|
package/Input.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.js","sources":["../src/components/Input/Input.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from 'react';\n\nimport cn from 'classnames';\n\nimport { FormOnColor, FormSize, AnalyticsId, AVERAGE_CHARACTER_WIDTH_PX } from '../../constants';\nimport { Breakpoint, useBreakpoint } from '../../hooks/useBreakpoint';\nimport { useUuid } from '../../hooks/useUuid';\nimport { getColor } from '../../theme/currys';\nimport { getAriaDescribedBy } from '../../utils/accessibility';\nimport { mergeRefs } from '../../utils/refs';\nimport ErrorWrapper, { ErrorWrapperClassNameProps } from '../ErrorWrapper';\nimport Icon, { IconSize, SvgIcon } from '../Icon';\nimport { IconName } from '../Icons/IconNames';\nimport { renderLabel } from '../Label';\nimport LazyIcon from '../LazyIcon';\nimport MaxCharacters from '../MaxCharacters/MaxCharacters';\n\nimport styles from './styles.module.scss';\n\nexport interface InputProps\n extends ErrorWrapperClassNameProps,\n Pick<\n React.InputHTMLAttributes<HTMLInputElement>,\n | 'disabled'\n | 'readOnly'\n | 'autoComplete'\n | 'name'\n | 'placeholder'\n | 'defaultValue'\n | 'required'\n | 'value'\n | 'min'\n | 'max'\n | 'aria-describedby'\n | 'aria-labelledby'\n | 'onBlur'\n | 'onClick'\n | 'onChange'\n | 'onFocus'\n | 'onKeyDown'\n | 'autoFocus'\n | 'inputMode'\n > {\n /** The number at which the input field starts when you increment or decrement it */\n baseIncrementValue?: number;\n /** Adds custom classes to the element. */\n className?: string;\n /** HMTL Input type */\n type?: keyof typeof InputTypes;\n /** input id */\n inputId?: string;\n /** Width of input field in characters (approximate) */\n width?: number;\n /** If true, the component will be transparent. */\n transparent?: boolean;\n /** Icon to be displayed next to the input field */\n icon?: SvgIcon | IconName;\n /** Places the icon to the right */\n iconRight?: boolean;\n /** Ref that is placed on the inputContainerRef */\n inputContainerRef?: React.RefObject<HTMLDivElement>;\n /** Ref that is placed on the inputWrapper */\n inputWrapperRef?: React.RefObject<HTMLDivElement>;\n /** Changes the color profile of the input */\n onColor?: keyof typeof FormOnColor;\n /** Changes the visuals of the input */\n size?: keyof typeof FormSize;\n /** Label of the input */\n label?: React.ReactNode;\n /** Activates Error style for the input */\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 /** Component shown after input */\n afterInputChildren?: React.ReactNode;\n /** Component shown to the right of input */\n rightOfInput?: React.ReactNode;\n /** max character limit in input */\n maxCharacters?: number;\n /** The text is displayed in the end of the text-counter */\n maxText?: string;\n}\n\nexport enum InputTypes {\n text = 'text',\n number = 'number',\n email = 'email',\n password = 'password',\n search = 'search',\n tel = 'tel',\n url = 'url',\n date = 'date',\n time = 'time',\n}\n\nconst getInputMaxWidth = (characters: number, hasIcon: boolean, iconSize: number): string => {\n const paddingWidth = hasIcon ? '1.5rem' : '2rem';\n const iconWidth = hasIcon ? `${iconSize}px` : '0px';\n const borderWidth = '4px';\n\n return `calc(${characters * AVERAGE_CHARACTER_WIDTH_PX}px + ${paddingWidth} + ${iconWidth} + ${borderWidth})`;\n};\n\nconst Input = React.forwardRef((props: InputProps, ref: React.Ref<HTMLInputElement>) => {\n const {\n className,\n defaultValue,\n placeholder,\n type = InputTypes.text,\n name,\n transparent = false,\n icon,\n iconRight,\n inputId,\n inputWrapperRef,\n onColor = FormOnColor.onwhite,\n size,\n baseIncrementValue,\n label,\n error,\n errorText,\n errorTextId,\n errorWrapperClassName,\n testId,\n disabled,\n readOnly,\n autoComplete = 'off',\n afterInputChildren,\n rightOfInput,\n width,\n required,\n onChange,\n onKeyDown,\n autoFocus,\n maxCharacters,\n maxText,\n inputContainerRef,\n ...rest\n } = props;\n const breakpoint = useBreakpoint();\n const inputContainerRefLocal = useRef<HTMLDivElement>(null);\n const inputIdState = useUuid(inputId);\n const [input, setInput] = useState(defaultValue || '');\n const [prevValue, setPrevValue] = useState<string | number | undefined>(undefined);\n const numKeyPressed = useRef<boolean>(false);\n const errorTextUuid = useUuid(errorTextId);\n const numRegex = /^[0-9]$/;\n\n useEffect(() => {\n setInput(defaultValue || '');\n }, [defaultValue]);\n\n const onDark = onColor === FormOnColor.ondark;\n const onBlueberry = onColor === FormOnColor.onblueberry;\n const maxCharactersExceeded = !!maxCharacters && input.toString().length > maxCharacters;\n const onError = onColor === FormOnColor.oninvalid || !!errorText || !!error || maxCharactersExceeded;\n const isLarge = size === FormSize.large;\n const isTransparent = transparent && onColor !== FormOnColor.ondark && !onError;\n\n const inputWrapperClass = cn(styles['input-wrapper'], className);\n\n const inputContainer = cn(styles['input-container'], {\n [styles['input-container--transparent']]: isTransparent,\n [styles['input-container--on-blueberry']]: onBlueberry,\n [styles['input-container--on-dark']]: onDark,\n [styles['input-container--invalid']]: onError,\n [styles['input-container--large']]: isLarge,\n [styles['input-container--disabled']]: disabled,\n [styles['input-container--with-icon']]: icon,\n });\n\n const inputClass = cn(styles['input-container__input'], {\n [styles['input-container__input--large']]: isLarge,\n [styles['input-container__input--disabled']]: disabled,\n });\n\n const iconColor = disabled ? getColor('neutral', 700) : getColor('black');\n const iconSize = breakpoint === Breakpoint.xs || !isLarge ? IconSize.XSmall : IconSize.Small;\n\n const renderIcon = (): React.ReactNode => {\n if (!icon) {\n return;\n }\n\n if (typeof icon === 'string') {\n return <LazyIcon className={styles['input-container__input__icon']} color={iconColor} size={iconSize} iconName={icon} />;\n }\n\n return <Icon className={styles['input-container__input__icon']} color={iconColor} size={iconSize} svgIcon={icon} />;\n };\n\n // eslint-disable-next-line\n const handleClick = (e: React.MouseEvent<any>): void => {\n if (inputContainerRefLocal && inputContainerRefLocal.current && icon) {\n const selectedChild = iconRight ? 0 : 1;\n const input = inputContainerRefLocal.current.children[selectedChild] as HTMLInputElement;\n input.focus();\n\n if (props.onClick) props.onClick(e);\n }\n };\n\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>): void => {\n const newValue = getIncrementValue(e);\n\n if (onChange) {\n onChange(e);\n }\n\n setInput(newValue);\n setPrevValue(newValue);\n };\n\n // Hvis bruker endrer number value med 1 og det skal startes på en annen verdi enn 0\n const getIncrementValue = (e: React.ChangeEvent<HTMLInputElement>): string => {\n if (typeof baseIncrementValue === 'undefined' || type !== 'number') return e.target.value;\n\n const valueAsNumber = Number(e.target.value);\n\n if (!prevValue && !numKeyPressed.current && (valueAsNumber === 1 || valueAsNumber === -1)) {\n e.target.value = baseIncrementValue + '';\n }\n\n return e.target.value;\n };\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>): void => {\n if (numRegex.test(e.key)) {\n numKeyPressed.current = true;\n }\n if (onKeyDown) onKeyDown(e);\n };\n\n const handleKeyUp = (e: React.KeyboardEvent<HTMLInputElement>): void => {\n if (numRegex.test(e.key)) {\n numKeyPressed.current = false;\n }\n };\n\n const maxWidth = width ? getInputMaxWidth(width, !!icon, iconSize) : undefined;\n\n return (\n <ErrorWrapper className={errorWrapperClassName} errorText={errorText} errorTextId={errorTextUuid}>\n <div data-testid={testId} data-analyticsid={AnalyticsId.Input} className={inputWrapperClass} ref={inputWrapperRef}>\n {renderLabel(label, inputIdState, onColor as FormOnColor)}\n {/* input-elementet tillater keyboard-interaksjon */}\n <div className={styles['content-wrapper']}>\n {/* eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */}\n <div\n onClick={handleClick}\n ref={mergeRefs([inputContainerRefLocal, inputContainerRef])}\n className={inputContainer}\n style={{ maxWidth }}\n >\n {!iconRight && renderIcon()}\n <input\n onChange={handleChange}\n onKeyDown={handleKeyDown}\n onKeyUp={handleKeyUp}\n name={name}\n type={type}\n defaultValue={defaultValue}\n id={inputIdState}\n className={inputClass}\n ref={ref}\n aria-labelledby={props['aria-labelledby'] ?? undefined}\n aria-describedby={getAriaDescribedBy(props, errorTextUuid)}\n aria-invalid={!!onError}\n disabled={disabled}\n placeholder={placeholder}\n readOnly={readOnly}\n autoComplete={autoComplete || 'off'}\n required={required}\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={autoFocus}\n {...rest}\n />\n {iconRight && renderIcon()}\n </div>\n <div className={styles['content-wrapper__right-of-input']}>{rightOfInput}</div>\n </div>\n {maxCharacters && (\n <MaxCharacters\n maxCharacters={maxCharacters}\n length={input.toString().length}\n maxText={maxText}\n onColor={onColor}\n maxWidth={maxWidth}\n />\n )}\n {afterInputChildren}\n </div>\n </ErrorWrapper>\n );\n});\n\nInput.displayName = 'Input';\n\nexport default Input;\n"],"names":["InputTypes","React","cn","input"],"mappings":";;;;;;;;;;;;;;;AAuFO,IAAK,+BAAAA,gBAAL;AACLA,cAAA,MAAA,IAAO;AACPA,cAAA,QAAA,IAAS;AACTA,cAAA,OAAA,IAAQ;AACRA,cAAA,UAAA,IAAW;AACXA,cAAA,QAAA,IAAS;AACT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,UAAA;AAAA,IAAA,YAAY,OAAO,cAAc,OAAsB;AAAA,IAExD,qBAAC,OAAA,EAAI,WAAW,OAAO,iBAAiB,GAEtC,UAAA;AAAA,MAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,SAAS;AAAA,UACT,KAAK,UAAU,CAAC,wBAAwB,iBAAiB,CAAC;AAAA,UAC1D,WAAW;AAAA,UACX,OAAO,EAAE,SAAA;AAAA,UAER,UAAA;AAAA,YAAA,CAAC,aAAa,WAAA;AAAA,YACf;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,UAAU;AAAA,gBACV,WAAW;AAAA,gBACX,SAAS;AAAA,gBACT;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA,IAAI;AAAA,gBACJ,WAAW;AAAA,gBACX;AAAA,gBACA,mBAAiB,MAAM,iBAAiB,KAAK;AAAA,gBAC7C,oBAAkB,mBAAmB,OAAO,aAAa;AAAA,gBACzD,gBAAc,CAAC,CAAC;AAAA,gBAChB;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA,cAAc,gBAAgB;AAAA,gBAC9B;AAAA,gBAEA;AAAA,gBACC,GAAG;AAAA,cAAA;AAAA,YAAA;AAAA,YAEL,aAAa,WAAA;AAAA,UAAW;AAAA,QAAA;AAAA,MAAA;AAAA,0BAE1B,OAAA,EAAI,WAAW,OAAO,iCAAiC,GAAI,UAAA,aAAA,CAAa;AAAA,IAAA,GAC3E;AAAA,IACC,iBACC;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,QAAQ,MAAM,SAAA,EAAW;AAAA,QACzB;AAAA,QACA;AAAA,QACA;AAAA,MAAA;AAAA,IAAA;AAAA,IAGH;AAAA,EAAA,EAAA,CACH,EAAA,CACF;AAEJ,CAAC;AAED,MAAM,cAAc;"}
|
|
1
|
+
{"version":3,"file":"Input.js","sources":["../src/components/Input/Input.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from 'react';\n\nimport cn from 'classnames';\n\nimport { FormOnColor, FormSize, AnalyticsId, AVERAGE_CHARACTER_WIDTH_PX } from '../../constants';\nimport { Breakpoint, useBreakpoint } from '../../hooks/useBreakpoint';\nimport { useUuid } from '../../hooks/useUuid';\nimport { getColor } from '../../theme/currys';\nimport { getAriaDescribedBy } from '../../utils/accessibility';\nimport { mergeRefs } from '../../utils/refs';\nimport ErrorWrapper, { ErrorWrapperClassNameProps } from '../ErrorWrapper';\nimport Icon, { IconSize, SvgIcon } from '../Icon';\nimport { IconName } from '../Icons/IconNames';\nimport { renderLabel } from '../Label';\nimport LazyIcon from '../LazyIcon';\nimport MaxCharacters from '../MaxCharacters/MaxCharacters';\n\nimport styles from './styles.module.scss';\n\nexport interface InputProps\n extends ErrorWrapperClassNameProps,\n Pick<\n React.InputHTMLAttributes<HTMLInputElement>,\n | 'disabled'\n | 'readOnly'\n | 'autoComplete'\n | 'name'\n | 'placeholder'\n | 'defaultValue'\n | 'required'\n | 'value'\n | 'min'\n | 'max'\n | 'aria-describedby'\n | 'aria-labelledby'\n | 'onBlur'\n | 'onClick'\n | 'onChange'\n | 'onFocus'\n | 'onKeyDown'\n | 'autoFocus'\n | 'inputMode'\n > {\n /** The number at which the input field starts when you increment or decrement it */\n baseIncrementValue?: number;\n /** Adds custom classes to the element. */\n className?: string;\n /** HMTL Input type */\n type?: keyof typeof InputTypes;\n /** input id */\n inputId?: string;\n /** Width of input field in characters (approximate) */\n width?: number;\n /** If true, the component will be transparent. */\n transparent?: boolean;\n /** Icon to be displayed next to the input field */\n icon?: SvgIcon | IconName;\n /** Places the icon to the right */\n iconRight?: boolean;\n /** Ref that is placed on the inputContainerRef */\n inputContainerRef?: React.RefObject<HTMLDivElement>;\n /** Ref that is placed on the inputWrapper */\n inputWrapperRef?: React.RefObject<HTMLDivElement>;\n /** Changes the color profile of the input */\n onColor?: keyof typeof FormOnColor;\n /** Changes the visuals of the input */\n size?: keyof typeof FormSize;\n /** Label of the input */\n label?: React.ReactNode;\n /** Activates Error style for the input */\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 /** Component shown after input */\n afterInputChildren?: React.ReactNode;\n /** Component shown to the right of input */\n rightOfInput?: React.ReactNode;\n /** max character limit in input */\n maxCharacters?: number;\n /** The text is displayed in the end of the text-counter */\n maxText?: string;\n}\n\nexport enum InputTypes {\n text = 'text',\n number = 'number',\n email = 'email',\n password = 'password',\n search = 'search',\n tel = 'tel',\n url = 'url',\n date = 'date',\n time = 'time',\n}\n\nconst getInputMaxWidth = (characters: number, hasIcon: boolean, iconSize: number): string => {\n const paddingWidth = hasIcon ? '1.5rem' : '2rem';\n const iconWidth = hasIcon ? `${iconSize}px` : '0px';\n const borderWidth = '4px';\n\n return `calc(${characters * AVERAGE_CHARACTER_WIDTH_PX}px + ${paddingWidth} + ${iconWidth} + ${borderWidth})`;\n};\n\nconst Input = React.forwardRef((props: InputProps, ref: React.Ref<HTMLInputElement>) => {\n const {\n className,\n defaultValue,\n placeholder,\n type = InputTypes.text,\n name,\n transparent = false,\n icon,\n iconRight,\n inputId,\n inputWrapperRef,\n onColor = FormOnColor.onwhite,\n size,\n baseIncrementValue,\n label,\n error,\n errorText,\n errorTextId,\n errorWrapperClassName,\n testId,\n disabled,\n readOnly,\n autoComplete = 'off',\n afterInputChildren,\n rightOfInput,\n width,\n required,\n onChange,\n onKeyDown,\n autoFocus,\n maxCharacters,\n maxText,\n inputContainerRef,\n ...rest\n } = props;\n const breakpoint = useBreakpoint();\n const inputContainerRefLocal = useRef<HTMLDivElement>(null);\n const inputIdState = useUuid(inputId);\n const [input, setInput] = useState(defaultValue || '');\n const [prevValue, setPrevValue] = useState<string | number | undefined>(undefined);\n const numKeyPressed = useRef<boolean>(false);\n const errorTextUuid = useUuid(errorTextId);\n const numRegex = /^[0-9]$/;\n\n useEffect(() => {\n setInput(defaultValue || '');\n }, [defaultValue]);\n\n const onDark = onColor === FormOnColor.ondark;\n const onBlueberry = onColor === FormOnColor.onblueberry;\n const maxCharactersExceeded = !!maxCharacters && input.toString().length > maxCharacters;\n const onError = onColor === FormOnColor.oninvalid || !!errorText || !!error || maxCharactersExceeded;\n const isLarge = size === FormSize.large;\n const isTransparent = transparent && onColor !== FormOnColor.ondark && !onError;\n\n const inputWrapperClass = cn(styles['input-wrapper'], className);\n\n const inputContainer = cn(styles['input-container'], {\n [styles['input-container--transparent']]: isTransparent,\n [styles['input-container--on-blueberry']]: onBlueberry,\n [styles['input-container--on-dark']]: onDark,\n [styles['input-container--invalid']]: onError,\n [styles['input-container--large']]: isLarge,\n [styles['input-container--disabled']]: disabled,\n [styles['input-container--with-icon']]: icon,\n });\n\n const inputClass = cn(styles['input-container__input'], {\n [styles['input-container__input--large']]: isLarge,\n [styles['input-container__input--disabled']]: disabled,\n });\n\n const iconColor = disabled ? getColor('neutral', 700) : getColor('black');\n const iconSize = breakpoint === Breakpoint.xs || !isLarge ? IconSize.XSmall : IconSize.Small;\n\n const renderIcon = (): React.ReactNode => {\n if (!icon) {\n return;\n }\n\n if (typeof icon === 'string') {\n return <LazyIcon className={styles['input-container__input__icon']} color={iconColor} size={iconSize} iconName={icon} />;\n }\n\n return <Icon className={styles['input-container__input__icon']} color={iconColor} size={iconSize} svgIcon={icon} />;\n };\n\n // eslint-disable-next-line\n const handleClick = (e: React.MouseEvent<any>): void => {\n if (inputContainerRefLocal && inputContainerRefLocal.current && icon) {\n const selectedChild = iconRight ? 0 : 1;\n const input = inputContainerRefLocal.current.children[selectedChild] as HTMLInputElement;\n input.focus();\n\n if (props.onClick) props.onClick(e);\n }\n };\n\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>): void => {\n const newValue = getIncrementValue(e);\n\n if (onChange) {\n onChange(e);\n }\n\n setInput(newValue);\n setPrevValue(newValue);\n };\n\n // Hvis bruker endrer number value med 1 og det skal startes på en annen verdi enn 0\n const getIncrementValue = (e: React.ChangeEvent<HTMLInputElement>): string => {\n if (typeof baseIncrementValue === 'undefined' || type !== 'number') return e.target.value;\n\n const valueAsNumber = Number(e.target.value);\n\n if (!prevValue && !numKeyPressed.current && (valueAsNumber === 1 || valueAsNumber === -1)) {\n e.target.value = baseIncrementValue + '';\n }\n\n return e.target.value;\n };\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>): void => {\n if (numRegex.test(e.key)) {\n numKeyPressed.current = true;\n }\n if (onKeyDown) onKeyDown(e);\n };\n\n const handleKeyUp = (e: React.KeyboardEvent<HTMLInputElement>): void => {\n if (numRegex.test(e.key)) {\n numKeyPressed.current = false;\n }\n };\n\n const maxWidth = width ? getInputMaxWidth(width, !!icon, iconSize) : undefined;\n\n return (\n <ErrorWrapper className={errorWrapperClassName} errorText={errorText} errorTextId={errorTextUuid}>\n <div data-testid={testId} data-analyticsid={AnalyticsId.Input} className={inputWrapperClass} ref={inputWrapperRef}>\n {renderLabel(label, inputIdState, onColor as FormOnColor)}\n {/* input-elementet tillater keyboard-interaksjon */}\n <div className={styles['content-wrapper']}>\n {/* eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */}\n <div\n onClick={handleClick}\n ref={mergeRefs([inputContainerRefLocal, inputContainerRef])}\n className={inputContainer}\n style={{ maxWidth }}\n >\n {!iconRight && renderIcon()}\n <input\n {...rest}\n onChange={handleChange}\n onKeyDown={handleKeyDown}\n onKeyUp={handleKeyUp}\n name={name}\n type={type}\n defaultValue={defaultValue}\n id={inputIdState}\n className={inputClass}\n ref={ref}\n aria-describedby={getAriaDescribedBy(props, errorTextUuid)}\n aria-invalid={!!onError}\n disabled={disabled}\n placeholder={placeholder}\n readOnly={readOnly}\n autoComplete={autoComplete || 'off'}\n required={required}\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={autoFocus}\n />\n {iconRight && renderIcon()}\n </div>\n <div className={styles['content-wrapper__right-of-input']}>{rightOfInput}</div>\n </div>\n {maxCharacters && (\n <MaxCharacters\n maxCharacters={maxCharacters}\n length={input.toString().length}\n maxText={maxText}\n onColor={onColor}\n maxWidth={maxWidth}\n />\n )}\n {afterInputChildren}\n </div>\n </ErrorWrapper>\n );\n});\n\nInput.displayName = 'Input';\n\nexport default Input;\n"],"names":["InputTypes","React","cn","input"],"mappings":";;;;;;;;;;;;;;;AAuFO,IAAK,+BAAAA,gBAAL;AACLA,cAAA,MAAA,IAAO;AACPA,cAAA,QAAA,IAAS;AACTA,cAAA,OAAA,IAAQ;AACRA,cAAA,UAAA,IAAW;AACXA,cAAA,QAAA,IAAS;AACTA,cAAA,KAAA,IAAM;AACNA,cAAA,KAAA,IAAM;AACNA,cAAA,MAAA,IAAO;AACPA,cAAA,MAAA,IAAO;AATG,SAAAA;AAAA,GAAA,cAAA,CAAA,CAAA;AAYZ,MAAM,mBAAmB,CAAC,YAAoB,SAAkB,aAA6B;AAC3F,QAAM,eAAe,UAAU,WAAW;AAC1C,QAAM,YAAY,UAAU,GAAG,QAAQ,OAAO;AAC9C,QAAM,cAAc;AAEpB,SAAO,QAAQ,aAAa,0BAA0B,QAAQ,YAAY,MAAM,SAAS,MAAM,WAAW;AAC5G;AAEA,MAAM,QAAQC,eAAM,WAAW,CAAC,OAAmB,QAAqC;AACtF,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA,OAAO;AAAA,IACP;AAAA,IACA,cAAc;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU,YAAY;AAAA,IACtB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,eAAe;AAAA,IACf;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EAAA,IACD;AACJ,QAAM,aAAa,cAAA;AACnB,QAAM,yBAAyB,OAAuB,IAAI;AAC1D,QAAM,eAAe,QA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M,SAAA,EAAW;AAAA,QACzB;AAAA,QACA;AAAA,QACA;AAAA,MAAA;AAAA,IAAA;AAAA,IAGH;AAAA,EAAA,EAAA,CACH,EAAA,CACF;AAEJ,CAAC;AAED,MAAM,cAAc;"}
|
package/LazyIcon.js
CHANGED
|
@@ -4,7 +4,7 @@ import { lazy, useMemo, Suspense } from "react";
|
|
|
4
4
|
import { useIsServerSide } from "./hooks/useIsServerSide.js";
|
|
5
5
|
import { I as Icon } from "./Icon.js";
|
|
6
6
|
import { IconSize } from "./constants.js";
|
|
7
|
-
const lazyLoadIcon = (iconName) => lazy(() => __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "../Icons/ActiveMonitoring.tsx": () => import("./components/Icons/ActiveMonitoring.js"), "../Icons/AcupunctureBack.tsx": () => import("./components/Icons/AcupunctureBack.js"), "../Icons/AlarmClock.tsx": () => import("./components/Icons/AlarmClock.js"), "../Icons/AlertSignFill.tsx": () => import("./components/Icons/AlertSignFill.js"), "../Icons/AlertSignStroke.tsx": () => import("./components/Icons/AlertSignStroke.js"), "../Icons/Amputation.tsx": () => import("./components/Icons/Amputation.js"), "../Icons/Anxiety.tsx": () => import("./components/Icons/Anxiety.js"), "../Icons/Apple.tsx": () => import("./components/Icons/Apple.js"), "../Icons/Archive.tsx": () => import("./components/Icons/Archive.js"), "../Icons/ArmFlexing.tsx": () => import("./components/Icons/ArmFlexing.js"), "../Icons/ArrowDown.tsx": () => import("./components/Icons/ArrowDown.js"), "../Icons/ArrowLeft.tsx": () => import("./components/Icons/ArrowLeft.js"), "../Icons/ArrowRight.tsx": () => import("./components/Icons/ArrowRight.js"), "../Icons/ArrowUp.tsx": () => import("./components/Icons/ArrowUp.js"), "../Icons/ArrowUpRight.tsx": () => import("./components/Icons/ArrowUpRight.js"), "../Icons/Attachment.tsx": () => import("./components/Icons/Attachment.js"), "../Icons/Atv.tsx": () => import("./components/Icons/Atv.js"), "../Icons/Avatar.tsx": () => import("./components/Icons/Avatar.js"), "../Icons/AwakePersonOnPillow.tsx": () => import("./components/Icons/AwakePersonOnPillow.js"), "../Icons/Baby.tsx": () => import("./components/Icons/Baby.js"), "../Icons/BandAid.tsx": () => import("./components/Icons/BandAid.js"), "../Icons/BeerAndPills.tsx": () => import("./components/Icons/BeerAndPills.js"), "../Icons/Bell.tsx": () => import("./components/Icons/Bell.js"), "../Icons/Bike.tsx": () => import("./components/Icons/Bike.js"), "../Icons/BirthControl.tsx": () => import("./components/Icons/BirthControl.js"), "../Icons/BirthdayCake.tsx": () => import("./components/Icons/BirthdayCake.js"), "../Icons/Boat.tsx": () => import("./components/Icons/Boat.js"), "../Icons/Body.tsx": () => import("./components/Icons/Body.js"), "../Icons/Braille.tsx": () => import("./components/Icons/Braille.js"), "../Icons/Brain.tsx": () => import("./components/Icons/Brain.js"), "../Icons/BreastReconstruction.tsx": () => import("./components/Icons/BreastReconstruction.js"), "../Icons/BreastRemoval.tsx": () => import("./components/Icons/BreastRemoval.js"), "../Icons/Breasts.tsx": () => import("./components/Icons/Breasts.js"), "../Icons/BrokenHeart.tsx": () => import("./components/Icons/BrokenHeart.js"), "../Icons/BrokenPuzzle.tsx": () => import("./components/Icons/BrokenPuzzle.js"), "../Icons/Bus.tsx": () => import("./components/Icons/Bus.js"), "../Icons/Calendar.tsx": () => import("./components/Icons/Calendar.js"), "../Icons/CalendarChange.tsx": () => import("./components/Icons/CalendarChange.js"), "../Icons/CalendarCheck.tsx": () => import("./components/Icons/CalendarCheck.js"), "../Icons/CalendarEvent.tsx": () => import("./components/Icons/CalendarEvent.js"), "../Icons/CalendarSave.tsx": () => import("./components/Icons/CalendarSave.js"), "../Icons/Cancer.tsx": () => import("./components/Icons/Cancer.js"), "../Icons/Candle.tsx": () => import("./components/Icons/Candle.js"), "../Icons/Car.tsx": () => import("./components/Icons/Car.js"), "../Icons/Carton.tsx": () => import("./components/Icons/Carton.js"), "../Icons/Change.tsx": () => import("./components/Icons/Change.js"), "../Icons/Check.tsx": () => import("./components/Icons/Check.js"), "../Icons/CheckFill.tsx": () => import("./components/Icons/CheckFill.js"), "../Icons/CheckOutline.tsx": () => import("./components/Icons/CheckOutline.js"), "../Icons/Chest.tsx": () => import("./components/Icons/Chest.js"), "../Icons/ChevronDown.tsx": () => import("./components/Icons/ChevronDown.js"), "../Icons/ChevronLeft.tsx": () => import("./components/Icons/ChevronLeft.js"), "../Icons/ChevronRight.tsx": () => import("./components/Icons/ChevronRight.js"), "../Icons/ChevronUp.tsx": () => import("./components/Icons/ChevronUp.js"), "../Icons/ChevronsDown.tsx": () => import("./components/Icons/ChevronsDown.js"), "../Icons/ChevronsUp.tsx": () => import("./components/Icons/ChevronsUp.js"), "../Icons/ChildPlaying.tsx": () => import("./components/Icons/ChildPlaying.js"), "../Icons/Cigarette.tsx": () => import("./components/Icons/Cigarette.js"), "../Icons/Coins.tsx": () => import("./components/Icons/Coins.js"), "../Icons/Contacts.tsx": () => import("./components/Icons/Contacts.js"), "../Icons/Copy.tsx": () => import("./components/Icons/Copy.js"), "../Icons/CoronaCertificate.tsx": () => import("./components/Icons/CoronaCertificate.js"), "../Icons/Coronavirus.tsx": () => import("./components/Icons/Coronavirus.js"), "../Icons/Cough.tsx": () => import("./components/Icons/Cough.js"), "../Icons/CreditCard.tsx": () => import("./components/Icons/CreditCard.js"), "../Icons/CriticalHealthInfo.tsx": () => import("./components/Icons/CriticalHealthInfo.js"), "../Icons/Cross.tsx": () => import("./components/Icons/Cross.js"), "../Icons/DataExchange.tsx": () => import("./components/Icons/DataExchange.js"), "../Icons/DataReceived.tsx": () => import("./components/Icons/DataReceived.js"), "../Icons/DataSent.tsx": () => import("./components/Icons/DataSent.js"), "../Icons/Depression.tsx": () => import("./components/Icons/Depression.js"), "../Icons/DigestiveSystem.tsx": () => import("./components/Icons/DigestiveSystem.js"), "../Icons/Dizzy.tsx": () => import("./components/Icons/Dizzy.js"), "../Icons/Documents.tsx": () => import("./components/Icons/Documents.js"), "../Icons/Dog.tsx": () => import("./components/Icons/Dog.js"), "../Icons/DonorCard.tsx": () => import("./components/Icons/DonorCard.js"), "../Icons/DotActive.tsx": () => import("./components/Icons/DotActive.js"), "../Icons/DotAlert.tsx": () => import("./components/Icons/DotAlert.js"), "../Icons/DotCancelled.tsx": () => import("./components/Icons/DotCancelled.js"), "../Icons/DotHalfDisc.tsx": () => import("./components/Icons/DotHalfDisc.js"), "../Icons/DotInactive.tsx": () => import("./components/Icons/DotInactive.js"), "../Icons/DotInfo.tsx": () => import("./components/Icons/DotInfo.js"), "../Icons/DotLookingGlass.tsx": () => import("./components/Icons/DotLookingGlass.js"), "../Icons/DotPending.tsx": () => import("./components/Icons/DotPending.js"), "../Icons/DotQuestionMark.tsx": () => import("./components/Icons/DotQuestionMark.js"), "../Icons/DotSuccess.tsx": () => import("./components/Icons/DotSuccess.js"), "../Icons/DotTransparent.tsx": () => import("./components/Icons/DotTransparent.js"), "../Icons/DotWarningTriangle.tsx": () => import("./components/Icons/DotWarningTriangle.js"), "../Icons/Download.tsx": () => import("./components/Icons/Download.js"), "../Icons/Draft.tsx": () => import("./components/Icons/Draft.js"), "../Icons/EChat.tsx": () => import("./components/Icons/EChat.js"), "../Icons/Ear.tsx": () => import("./components/Icons/Ear.js"), "../Icons/EarDeaf.tsx": () => import("./components/Icons/EarDeaf.js"), "../Icons/EarHearingAid.tsx": () => import("./components/Icons/EarHearingAid.js"), "../Icons/EarNoseThroat.tsx": () => import("./components/Icons/EarNoseThroat.js"), "../Icons/EarVolume.tsx": () => import("./components/Icons/EarVolume.js"), "../Icons/ElderlyPerson.tsx": () => import("./components/Icons/ElderlyPerson.js"), "../Icons/Embolization.tsx": () => import("./components/Icons/Embolization.js"), "../Icons/EmergencyCall.tsx": () => import("./components/Icons/EmergencyCall.js"), "../Icons/EmoticonAnnoyed.tsx": () => import("./components/Icons/EmoticonAnnoyed.js"), "../Icons/EmoticonDelighted.tsx": () => import("./components/Icons/EmoticonDelighted.js"), "../Icons/EmoticonDisappointed.tsx": () => import("./components/Icons/EmoticonDisappointed.js"), "../Icons/EmoticonHappy.tsx": () => import("./components/Icons/EmoticonHappy.js"), "../Icons/EmoticonMeh.tsx": () => import("./components/Icons/EmoticonMeh.js"), "../Icons/EmptyBox.tsx": () => import("./components/Icons/EmptyBox.js"), "../Icons/EnterFullScreen.tsx": () => import("./components/Icons/EnterFullScreen.js"), "../Icons/Envelope.tsx": () => import("./components/Icons/Envelope.js"), "../Icons/Epilepsy.tsx": () => import("./components/Icons/Epilepsy.js"), "../Icons/Eraser.tsx": () => import("./components/Icons/Eraser.js"), "../Icons/ErrorSignFill.tsx": () => import("./components/Icons/ErrorSignFill.js"), "../Icons/ErrorSignStroke.tsx": () => import("./components/Icons/ErrorSignStroke.js"), "../Icons/EuropeanHealthCard.tsx": () => import("./components/Icons/EuropeanHealthCard.js"), "../Icons/ExitFullScreen.tsx": () => import("./components/Icons/ExitFullScreen.js"), "../Icons/Eye.tsx": () => import("./components/Icons/Eye.js"), "../Icons/Facebook.tsx": () => import("./components/Icons/Facebook.js"), "../Icons/FallingLeaf.tsx": () => import("./components/Icons/FallingLeaf.js"), "../Icons/Female.tsx": () => import("./components/Icons/Female.js"), "../Icons/FemaleDoctor.tsx": () => import("./components/Icons/FemaleDoctor.js"), "../Icons/Ferry.tsx": () => import("./components/Icons/Ferry.js"), "../Icons/File.tsx": () => import("./components/Icons/File.js"), "../Icons/Filter.tsx": () => import("./components/Icons/Filter.js"), "../Icons/FingerBleed.tsx": () => import("./components/Icons/FingerBleed.js"), "../Icons/FirstAidKit.tsx": () => import("./components/Icons/FirstAidKit.js"), "../Icons/Fish.tsx": () => import("./components/Icons/Fish.js"), "../Icons/FloppyDisk.tsx": () => import("./components/Icons/FloppyDisk.js"), "../Icons/Football.tsx": () => import("./components/Icons/Football.js"), "../Icons/Form.tsx": () => import("./components/Icons/Form.js"), "../Icons/Forward.tsx": () => import("./components/Icons/Forward.js"), "../Icons/Gallery.tsx": () => import("./components/Icons/Gallery.js"), "../Icons/Garden.tsx": () => import("./components/Icons/Garden.js"), "../Icons/GasCan.tsx": () => import("./components/Icons/GasCan.js"), "../Icons/GenderIdentity.tsx": () => import("./components/Icons/GenderIdentity.js"), "../Icons/GlassWater.tsx": () => import("./components/Icons/GlassWater.js"), "../Icons/Glasses.tsx": () => import("./components/Icons/Glasses.js"), "../Icons/Globe.tsx": () => import("./components/Icons/Globe.js"), "../Icons/Grain.tsx": () => import("./components/Icons/Grain.js"), "../Icons/Graph.tsx": () => import("./components/Icons/Graph.js"), "../Icons/Group.tsx": () => import("./components/Icons/Group.js"), "../Icons/GroupTwins.tsx": () => import("./components/Icons/GroupTwins.js"), "../Icons/HTMLFile.tsx": () => import("./components/Icons/HTMLFile.js"), "../Icons/HandWaving.tsx": () => import("./components/Icons/HandWaving.js"), "../Icons/HandWithDisease.tsx": () => import("./components/Icons/HandWithDisease.js"), "../Icons/HandsAndHeart.tsx": () => import("./components/Icons/HandsAndHeart.js"), "../Icons/HealthClinic.tsx": () => import("./components/Icons/HealthClinic.js"), "../Icons/HealthMeasurements.tsx": () => import("./components/Icons/HealthMeasurements.js"), "../Icons/HealthWarning.tsx": () => import("./components/Icons/HealthWarning.js"), "../Icons/HealthcarePerson.tsx": () => import("./components/Icons/HealthcarePerson.js"), "../Icons/HealthcarePersonell.tsx": () => import("./components/Icons/HealthcarePersonell.js"), "../Icons/HearingProtection.tsx": () => import("./components/Icons/HearingProtection.js"), "../Icons/Heart.tsx": () => import("./components/Icons/Heart.js"), "../Icons/HeartHands.tsx": () => import("./components/Icons/HeartHands.js"), "../Icons/HelpSign.tsx": () => import("./components/Icons/HelpSign.js"), "../Icons/HelpingHand.tsx": () => import("./components/Icons/HelpingHand.js"), "../Icons/Hemodialysis.tsx": () => import("./components/Icons/Hemodialysis.js"), "../Icons/Hiker.tsx": () => import("./components/Icons/Hiker.js"), "../Icons/Hipprosthesis.tsx": () => import("./components/Icons/Hipprosthesis.js"), "../Icons/History.tsx": () => import("./components/Icons/History.js"), "../Icons/HivAndAids.tsx": () => import("./components/Icons/HivAndAids.js"), "../Icons/Home.tsx": () => import("./components/Icons/Home.js"), "../Icons/HomeFill.tsx": () => import("./components/Icons/HomeFill.js"), "../Icons/Hormone.tsx": () => import("./components/Icons/Hormone.js"), "../Icons/Hospital.tsx": () => import("./components/Icons/Hospital.js"), "../Icons/Hourglass.tsx": () => import("./components/Icons/Hourglass.js"), "../Icons/ImgFile.tsx": () => import("./components/Icons/ImgFile.js"), "../Icons/Inbox.tsx": () => import("./components/Icons/Inbox.js"), "../Icons/InfoSignFill.tsx": () => import("./components/Icons/InfoSignFill.js"), "../Icons/InfoSignStroke.tsx": () => import("./components/Icons/InfoSignStroke.js"), "../Icons/Instagram.tsx": () => import("./components/Icons/Instagram.js"), "../Icons/Intravenous.tsx": () => import("./components/Icons/Intravenous.js"), "../Icons/JointPain.tsx": () => import("./components/Icons/JointPain.js"), "../Icons/Journal.tsx": () => import("./components/Icons/Journal.js"), "../Icons/JpgFile.tsx": () => import("./components/Icons/JpgFile.js"), "../Icons/Kidney.tsx": () => import("./components/Icons/Kidney.js"), "../Icons/KitchenScale.tsx": () => import("./components/Icons/KitchenScale.js"), "../Icons/Kjernejournal.tsx": () => import("./components/Icons/Kjernejournal.js"), "../Icons/Laboratory.tsx": () => import("./components/Icons/Laboratory.js"), "../Icons/LaptopBlog.tsx": () => import("./components/Icons/LaptopBlog.js"), "../Icons/LawBook.tsx": () => import("./components/Icons/LawBook.js"), "../Icons/LegalDocument.tsx": () => import("./components/Icons/LegalDocument.js"), "../Icons/LightBulb.tsx": () => import("./components/Icons/LightBulb.js"), "../Icons/List.tsx": () => import("./components/Icons/List.js"), "../Icons/Location.tsx": () => import("./components/Icons/Location.js"), "../Icons/LocationFill.tsx": () => import("./components/Icons/LocationFill.js"), "../Icons/Lock.tsx": () => import("./components/Icons/Lock.js"), "../Icons/Login.tsx": () => import("./components/Icons/Login.js"), "../Icons/Logout.tsx": () => import("./components/Icons/Logout.js"), "../Icons/Lungs.tsx": () => import("./components/Icons/Lungs.js"), "../Icons/Makeup.tsx": () => import("./components/Icons/Makeup.js"), "../Icons/MaleDoctor.tsx": () => import("./components/Icons/MaleDoctor.js"), "../Icons/MaleDoctorAndPerson.tsx": () => import("./components/Icons/MaleDoctorAndPerson.js"), "../Icons/MaleDoctorCompact.tsx": () => import("./components/Icons/MaleDoctorCompact.js"), "../Icons/MaleDoctorCompactFill.tsx": () => import("./components/Icons/MaleDoctorCompactFill.js"), "../Icons/MaleGenitalia.tsx": () => import("./components/Icons/MaleGenitalia.js"), "../Icons/Medicine.tsx": () => import("./components/Icons/Medicine.js"), "../Icons/MedicineWarning.tsx": () => import("./components/Icons/MedicineWarning.js"), "../Icons/MentalHealthAdult.tsx": () => import("./components/Icons/MentalHealthAdult.js"), "../Icons/MentalHealthChild.tsx": () => import("./components/Icons/MentalHealthChild.js"), "../Icons/Menu.tsx": () => import("./components/Icons/Menu.js"), "../Icons/Microscope.tsx": () => import("./components/Icons/Microscope.js"), "../Icons/Minus.tsx": () => import("./components/Icons/Minus.js"), "../Icons/Mirror.tsx": () => import("./components/Icons/Mirror.js"), "../Icons/MobilePhone.tsx": () => import("./components/Icons/MobilePhone.js"), "../Icons/MotherHoldingBaby.tsx": () => import("./components/Icons/MotherHoldingBaby.js"), "../Icons/MuscleBack.tsx": () => import("./components/Icons/MuscleBack.js"), "../Icons/MuscleLeg.tsx": () => import("./components/Icons/MuscleLeg.js"), "../Icons/Mushroom.tsx": () => import("./components/Icons/Mushroom.js"), "../Icons/Music.tsx": () => import("./components/Icons/Music.js"), "../Icons/MusselsAndSalt.tsx": () => import("./components/Icons/MusselsAndSalt.js"), "../Icons/NoAccess.tsx": () => import("./components/Icons/NoAccess.js"), "../Icons/NoEye.tsx": () => import("./components/Icons/NoEye.js"), "../Icons/NoFilter.tsx": () => import("./components/Icons/NoFilter.js"), "../Icons/Notepad.tsx": () => import("./components/Icons/Notepad.js"), "../Icons/Osteotomy.tsx": () => import("./components/Icons/Osteotomy.js"), "../Icons/PaintRoller.tsx": () => import("./components/Icons/PaintRoller.js"), "../Icons/PaperPlane.tsx": () => import("./components/Icons/PaperPlane.js"), "../Icons/PatientAndPerson.tsx": () => import("./components/Icons/PatientAndPerson.js"), "../Icons/Pause.tsx": () => import("./components/Icons/Pause.js"), "../Icons/PdfFile.tsx": () => import("./components/Icons/PdfFile.js"), "../Icons/Pencil.tsx": () => import("./components/Icons/Pencil.js"), "../Icons/PeopleTalking.tsx": () => import("./components/Icons/PeopleTalking.js"), "../Icons/Peritonealdialysis.tsx": () => import("./components/Icons/Peritonealdialysis.js"), "../Icons/Person.tsx": () => import("./components/Icons/Person.js"), "../Icons/PersonAndPatient.tsx": () => import("./components/Icons/PersonAndPatient.js"), "../Icons/PersonCancel.tsx": () => import("./components/Icons/PersonCancel.js"), "../Icons/PersonInXRayMachine.tsx": () => import("./components/Icons/PersonInXRayMachine.js"), "../Icons/PersonOverweight.tsx": () => import("./components/Icons/PersonOverweight.js"), "../Icons/PersonRelaxing.tsx": () => import("./components/Icons/PersonRelaxing.js"), "../Icons/PersonWithBrain.tsx": () => import("./components/Icons/PersonWithBrain.js"), "../Icons/PersonWithBrokenArm.tsx": () => import("./components/Icons/PersonWithBrokenArm.js"), "../Icons/PersonWithCrutches.tsx": () => import("./components/Icons/PersonWithCrutches.js"), "../Icons/PersonWithJaw.tsx": () => import("./components/Icons/PersonWithJaw.js"), "../Icons/PersonWithMagnifyingGlass.tsx": () => import("./components/Icons/PersonWithMagnifyingGlass.js"), "../Icons/PersonWithSenses.tsx": () => import("./components/Icons/PersonWithSenses.js"), "../Icons/PersonWorking.tsx": () => import("./components/Icons/PersonWorking.js"), "../Icons/PersonalPlan.tsx": () => import("./components/Icons/PersonalPlan.js"), "../Icons/PizzaSlice.tsx": () => import("./components/Icons/PizzaSlice.js"), "../Icons/Plane.tsx": () => import("./components/Icons/Plane.js"), "../Icons/Plant.tsx": () => import("./components/Icons/Plant.js"), "../Icons/PlateKnifeFork.tsx": () => import("./components/Icons/PlateKnifeFork.js"), "../Icons/Play.tsx": () => import("./components/Icons/Play.js"), "../Icons/PlusLarge.tsx": () => import("./components/Icons/PlusLarge.js"), "../Icons/PlusSmall.tsx": () => import("./components/Icons/PlusSmall.js"), "../Icons/PngFile.tsx": () => import("./components/Icons/PngFile.js"), "../Icons/Podcast.tsx": () => import("./components/Icons/Podcast.js"), "../Icons/PoisonInformation.tsx": () => import("./components/Icons/PoisonInformation.js"), "../Icons/Pregnant.tsx": () => import("./components/Icons/Pregnant.js"), "../Icons/Printer.tsx": () => import("./components/Icons/Printer.js"), "../Icons/Psychosis.tsx": () => import("./components/Icons/Psychosis.js"), "../Icons/Publication.tsx": () => import("./components/Icons/Publication.js"), "../Icons/Puzzle.tsx": () => import("./components/Icons/Puzzle.js"), "../Icons/QrCode.tsx": () => import("./components/Icons/QrCode.js"), "../Icons/Quarrel.tsx": () => import("./components/Icons/Quarrel.js"), "../Icons/RadioTherapy.tsx": () => import("./components/Icons/RadioTherapy.js"), "../Icons/RadioactiveTreatment.tsx": () => import("./components/Icons/RadioactiveTreatment.js"), "../Icons/Radioiodine.tsx": () => import("./components/Icons/Radioiodine.js"), "../Icons/Receipt.tsx": () => import("./components/Icons/Receipt.js"), "../Icons/Receptionist.tsx": () => import("./components/Icons/Receptionist.js"), "../Icons/Recovery.tsx": () => import("./components/Icons/Recovery.js"), "../Icons/Referral.tsx": () => import("./components/Icons/Referral.js"), "../Icons/Refresh.tsx": () => import("./components/Icons/Refresh.js"), "../Icons/Refund.tsx": () => import("./components/Icons/Refund.js"), "../Icons/Reminder.tsx": () => import("./components/Icons/Reminder.js"), "../Icons/Reply.tsx": () => import("./components/Icons/Reply.js"), "../Icons/Rocket.tsx": () => import("./components/Icons/Rocket.js"), "../Icons/RtfFile.tsx": () => import("./components/Icons/RtfFile.js"), "../Icons/STDs.tsx": () => import("./components/Icons/STDs.js"), "../Icons/Save.tsx": () => import("./components/Icons/Save.js"), "../Icons/Scale.tsx": () => import("./components/Icons/Scale.js"), "../Icons/ScreenReader.tsx": () => import("./components/Icons/ScreenReader.js"), "../Icons/Search.tsx": () => import("./components/Icons/Search.js"), "../Icons/SectionSign.tsx": () => import("./components/Icons/SectionSign.js"), "../Icons/Settings.tsx": () => import("./components/Icons/Settings.js"), "../Icons/SettingsFill.tsx": () => import("./components/Icons/SettingsFill.js"), "../Icons/Sexualorientation.tsx": () => import("./components/Icons/Sexualorientation.js"), "../Icons/ShakingHand.tsx": () => import("./components/Icons/ShakingHand.js"), "../Icons/Share.tsx": () => import("./components/Icons/Share.js"), "../Icons/SharedHealthData.tsx": () => import("./components/Icons/SharedHealthData.js"), "../Icons/SharedHealthMeasurements.tsx": () => import("./components/Icons/SharedHealthMeasurements.js"), "../Icons/Shield.tsx": () => import("./components/Icons/Shield.js"), "../Icons/ShuntOperation.tsx": () => import("./components/Icons/ShuntOperation.js"), "../Icons/Skeleton.tsx": () => import("./components/Icons/Skeleton.js"), "../Icons/Skin.tsx": () => import("./components/Icons/Skin.js"), "../Icons/Snake.tsx": () => import("./components/Icons/Snake.js"), "../Icons/Snapchat.tsx": () => import("./components/Icons/Snapchat.js"), "../Icons/SortDown.tsx": () => import("./components/Icons/SortDown.js"), "../Icons/SortUp.tsx": () => import("./components/Icons/SortUp.js"), "../Icons/SpeechBubble.tsx": () => import("./components/Icons/SpeechBubble.js"), "../Icons/Spray.tsx": () => import("./components/Icons/Spray.js"), "../Icons/StickyNote.tsx": () => import("./components/Icons/StickyNote.js"), "../Icons/StickyNotes.tsx": () => import("./components/Icons/StickyNotes.js"), "../Icons/Stopwatch.tsx": () => import("./components/Icons/Stopwatch.js"), "../Icons/Sun.tsx": () => import("./components/Icons/Sun.js"), "../Icons/SupportingPerson.tsx": () => import("./components/Icons/SupportingPerson.js"), "../Icons/Surgery.tsx": () => import("./components/Icons/Surgery.js"), "../Icons/Sweets.tsx": () => import("./components/Icons/Sweets.js"), "../Icons/Syringe.tsx": () => import("./components/Icons/Syringe.js"), "../Icons/Taxi.tsx": () => import("./components/Icons/Taxi.js"), "../Icons/TeddyBear.tsx": () => import("./components/Icons/TeddyBear.js"), "../Icons/Teenagers.tsx": () => import("./components/Icons/Teenagers.js"), "../Icons/ThinkingAboutBaby.tsx": () => import("./components/Icons/ThinkingAboutBaby.js"), "../Icons/Ticket.tsx": () => import("./components/Icons/Ticket.js"), "../Icons/TimePassing.tsx": () => import("./components/Icons/TimePassing.js"), "../Icons/Toddler.tsx": () => import("./components/Icons/Toddler.js"), "../Icons/Tombstone.tsx": () => import("./components/Icons/Tombstone.js"), "../Icons/Toolbox.tsx": () => import("./components/Icons/Toolbox.js"), "../Icons/Tooth.tsx": () => import("./components/Icons/Tooth.js"), "../Icons/TotalKneeProsthesis.tsx": () => import("./components/Icons/TotalKneeProsthesis.js"), "../Icons/Train.tsx": () => import("./components/Icons/Train.js"), "../Icons/Transplantation.tsx": () => import("./components/Icons/Transplantation.js"), "../Icons/TrashCan.tsx": () => import("./components/Icons/TrashCan.js"), "../Icons/TravelRoute.tsx": () => import("./components/Icons/TravelRoute.js"), "../Icons/TreatmentAids.tsx": () => import("./components/Icons/TreatmentAids.js"), "../Icons/TriangleX.tsx": () => import("./components/Icons/TriangleX.js"), "../Icons/Twitter.tsx": () => import("./components/Icons/Twitter.js"), "../Icons/Undo.tsx": () => import("./components/Icons/Undo.js"), "../Icons/UniProsthesis.tsx": () => import("./components/Icons/UniProsthesis.js"), "../Icons/Upload.tsx": () => import("./components/Icons/Upload.js"), "../Icons/UserOrganization.tsx": () => import("./components/Icons/UserOrganization.js"), "../Icons/Vaccine.tsx": () => import("./components/Icons/Vaccine.js"), "../Icons/VerticalDots.tsx": () => import("./components/Icons/VerticalDots.js"), "../Icons/VideoCamera.tsx": () => import("./components/Icons/VideoCamera.js"), "../Icons/VideoChat.tsx": () => import("./components/Icons/VideoChat.js"), "../Icons/Wallet.tsx": () => import("./components/Icons/Wallet.js"), "../Icons/Watch.tsx": () => import("./components/Icons/Watch.js"), "../Icons/Website.tsx": () => import("./components/Icons/Website.js"), "../Icons/Wheelchair.tsx": () => import("./components/Icons/Wheelchair.js"), "../Icons/WheelchairActive.tsx": () => import("./components/Icons/WheelchairActive.js"), "../Icons/Window.tsx": () => import("./components/Icons/Window.js"), "../Icons/WordDocument.tsx": () => import("./components/Icons/WordDocument.js"), "../Icons/WorkSuitcase.tsx": () => import("./components/Icons/WorkSuitcase.js"), "../Icons/X.tsx": () => import("./components/Icons/X.js"), "../Icons/XOutline.tsx": () => import("./components/Icons/XOutline.js"), "../Icons/XmlFile.tsx": () => import("./components/Icons/XmlFile.js"), "../Icons/YouTube.tsx": () => import("./components/Icons/YouTube.js"), "../Icons/Zoom.tsx": () => import("./components/Icons/Zoom.js") }), `../Icons/${iconName}.tsx`, 3));
|
|
7
|
+
const lazyLoadIcon = (iconName) => lazy(() => __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "../Icons/ActiveMonitoring.tsx": () => import("./components/Icons/ActiveMonitoring.js"), "../Icons/AcupunctureBack.tsx": () => import("./components/Icons/AcupunctureBack.js"), "../Icons/AlarmClock.tsx": () => import("./components/Icons/AlarmClock.js"), "../Icons/AlertSignFill.tsx": () => import("./components/Icons/AlertSignFill.js"), "../Icons/AlertSignStroke.tsx": () => import("./components/Icons/AlertSignStroke.js"), "../Icons/Amputation.tsx": () => import("./components/Icons/Amputation.js"), "../Icons/Anxiety.tsx": () => import("./components/Icons/Anxiety.js"), "../Icons/Apple.tsx": () => import("./components/Icons/Apple.js"), "../Icons/Archive.tsx": () => import("./components/Icons/Archive.js"), "../Icons/ArmFlexing.tsx": () => import("./components/Icons/ArmFlexing.js"), "../Icons/ArrowDown.tsx": () => import("./components/Icons/ArrowDown.js"), "../Icons/ArrowLeft.tsx": () => import("./components/Icons/ArrowLeft.js"), "../Icons/ArrowRight.tsx": () => import("./components/Icons/ArrowRight.js"), "../Icons/ArrowUp.tsx": () => import("./components/Icons/ArrowUp.js"), "../Icons/ArrowUpRight.tsx": () => import("./components/Icons/ArrowUpRight.js"), "../Icons/Attachment.tsx": () => import("./components/Icons/Attachment.js"), "../Icons/Atv.tsx": () => import("./components/Icons/Atv.js"), "../Icons/Avatar.tsx": () => import("./components/Icons/Avatar.js"), "../Icons/AwakePersonOnPillow.tsx": () => import("./components/Icons/AwakePersonOnPillow.js"), "../Icons/Baby.tsx": () => import("./components/Icons/Baby.js"), "../Icons/BandAid.tsx": () => import("./components/Icons/BandAid.js"), "../Icons/BeerAndPills.tsx": () => import("./components/Icons/BeerAndPills.js"), "../Icons/Bell.tsx": () => import("./components/Icons/Bell.js"), "../Icons/Bike.tsx": () => import("./components/Icons/Bike.js"), "../Icons/BirthControl.tsx": () => import("./components/Icons/BirthControl.js"), "../Icons/BirthdayCake.tsx": () => import("./components/Icons/BirthdayCake.js"), "../Icons/Boat.tsx": () => import("./components/Icons/Boat.js"), "../Icons/Body.tsx": () => import("./components/Icons/Body.js"), "../Icons/Braille.tsx": () => import("./components/Icons/Braille.js"), "../Icons/Brain.tsx": () => import("./components/Icons/Brain.js"), "../Icons/BreastReconstruction.tsx": () => import("./components/Icons/BreastReconstruction.js"), "../Icons/BreastRemoval.tsx": () => import("./components/Icons/BreastRemoval.js"), "../Icons/Breasts.tsx": () => import("./components/Icons/Breasts.js"), "../Icons/BrokenHeart.tsx": () => import("./components/Icons/BrokenHeart.js"), "../Icons/BrokenPuzzle.tsx": () => import("./components/Icons/BrokenPuzzle.js"), "../Icons/Bus.tsx": () => import("./components/Icons/Bus.js"), "../Icons/Calendar.tsx": () => import("./components/Icons/Calendar.js"), "../Icons/CalendarChange.tsx": () => import("./components/Icons/CalendarChange.js"), "../Icons/CalendarCheck.tsx": () => import("./components/Icons/CalendarCheck.js"), "../Icons/CalendarEvent.tsx": () => import("./components/Icons/CalendarEvent.js"), "../Icons/CalendarSave.tsx": () => import("./components/Icons/CalendarSave.js"), "../Icons/Cancer.tsx": () => import("./components/Icons/Cancer.js"), "../Icons/Candle.tsx": () => import("./components/Icons/Candle.js"), "../Icons/Car.tsx": () => import("./components/Icons/Car.js"), "../Icons/Carton.tsx": () => import("./components/Icons/Carton.js"), "../Icons/Change.tsx": () => import("./components/Icons/Change.js"), "../Icons/Check.tsx": () => import("./components/Icons/Check.js"), "../Icons/CheckFill.tsx": () => import("./components/Icons/CheckFill.js"), "../Icons/CheckOutline.tsx": () => import("./components/Icons/CheckOutline.js"), "../Icons/Chest.tsx": () => import("./components/Icons/Chest.js"), "../Icons/ChevronDown.tsx": () => import("./components/Icons/ChevronDown.js"), "../Icons/ChevronLeft.tsx": () => import("./components/Icons/ChevronLeft.js"), "../Icons/ChevronRight.tsx": () => import("./components/Icons/ChevronRight.js"), "../Icons/ChevronUp.tsx": () => import("./components/Icons/ChevronUp.js"), "../Icons/ChevronsDown.tsx": () => import("./components/Icons/ChevronsDown.js"), "../Icons/ChevronsUp.tsx": () => import("./components/Icons/ChevronsUp.js"), "../Icons/ChildPlaying.tsx": () => import("./components/Icons/ChildPlaying.js"), "../Icons/Cigarette.tsx": () => import("./components/Icons/Cigarette.js"), "../Icons/Coins.tsx": () => import("./components/Icons/Coins.js"), "../Icons/Contacts.tsx": () => import("./components/Icons/Contacts.js"), "../Icons/Copy.tsx": () => import("./components/Icons/Copy.js"), "../Icons/CoronaCertificate.tsx": () => import("./components/Icons/CoronaCertificate.js"), "../Icons/Coronavirus.tsx": () => import("./components/Icons/Coronavirus.js"), "../Icons/Cough.tsx": () => import("./components/Icons/Cough.js"), "../Icons/CreditCard.tsx": () => import("./components/Icons/CreditCard.js"), "../Icons/CriticalHealthInfo.tsx": () => import("./components/Icons/CriticalHealthInfo.js"), "../Icons/Cross.tsx": () => import("./components/Icons/Cross.js"), "../Icons/DataExchange.tsx": () => import("./components/Icons/DataExchange.js"), "../Icons/DataReceived.tsx": () => import("./components/Icons/DataReceived.js"), "../Icons/DataSent.tsx": () => import("./components/Icons/DataSent.js"), "../Icons/Depression.tsx": () => import("./components/Icons/Depression.js"), "../Icons/DigestiveSystem.tsx": () => import("./components/Icons/DigestiveSystem.js"), "../Icons/Dizzy.tsx": () => import("./components/Icons/Dizzy.js"), "../Icons/Documents.tsx": () => import("./components/Icons/Documents.js"), "../Icons/Dog.tsx": () => import("./components/Icons/Dog.js"), "../Icons/DonorCard.tsx": () => import("./components/Icons/DonorCard.js"), "../Icons/DotActive.tsx": () => import("./components/Icons/DotActive.js"), "../Icons/DotAlert.tsx": () => import("./components/Icons/DotAlert.js"), "../Icons/DotCancelled.tsx": () => import("./components/Icons/DotCancelled.js"), "../Icons/DotHalfDisc.tsx": () => import("./components/Icons/DotHalfDisc.js"), "../Icons/DotInactive.tsx": () => import("./components/Icons/DotInactive.js"), "../Icons/DotInfo.tsx": () => import("./components/Icons/DotInfo.js"), "../Icons/DotLookingGlass.tsx": () => import("./components/Icons/DotLookingGlass.js"), "../Icons/DotPending.tsx": () => import("./components/Icons/DotPending.js"), "../Icons/DotQuestionMark.tsx": () => import("./components/Icons/DotQuestionMark.js"), "../Icons/DotSuccess.tsx": () => import("./components/Icons/DotSuccess.js"), "../Icons/DotTransparent.tsx": () => import("./components/Icons/DotTransparent.js"), "../Icons/DotWarningTriangle.tsx": () => import("./components/Icons/DotWarningTriangle.js"), "../Icons/Download.tsx": () => import("./components/Icons/Download.js"), "../Icons/Draft.tsx": () => import("./components/Icons/Draft.js"), "../Icons/Drag.tsx": () => import("./components/Icons/Drag.js"), "../Icons/EChat.tsx": () => import("./components/Icons/EChat.js"), "../Icons/Ear.tsx": () => import("./components/Icons/Ear.js"), "../Icons/EarDeaf.tsx": () => import("./components/Icons/EarDeaf.js"), "../Icons/EarHearingAid.tsx": () => import("./components/Icons/EarHearingAid.js"), "../Icons/EarNoseThroat.tsx": () => import("./components/Icons/EarNoseThroat.js"), "../Icons/EarVolume.tsx": () => import("./components/Icons/EarVolume.js"), "../Icons/Edit.tsx": () => import("./components/Icons/Edit.js"), "../Icons/ElderlyPerson.tsx": () => import("./components/Icons/ElderlyPerson.js"), "../Icons/Embolization.tsx": () => import("./components/Icons/Embolization.js"), "../Icons/EmergencyCall.tsx": () => import("./components/Icons/EmergencyCall.js"), "../Icons/EmoticonAnnoyed.tsx": () => import("./components/Icons/EmoticonAnnoyed.js"), "../Icons/EmoticonDelighted.tsx": () => import("./components/Icons/EmoticonDelighted.js"), "../Icons/EmoticonDisappointed.tsx": () => import("./components/Icons/EmoticonDisappointed.js"), "../Icons/EmoticonHappy.tsx": () => import("./components/Icons/EmoticonHappy.js"), "../Icons/EmoticonMeh.tsx": () => import("./components/Icons/EmoticonMeh.js"), "../Icons/EmptyBox.tsx": () => import("./components/Icons/EmptyBox.js"), "../Icons/EnterFullScreen.tsx": () => import("./components/Icons/EnterFullScreen.js"), "../Icons/Envelope.tsx": () => import("./components/Icons/Envelope.js"), "../Icons/Epilepsy.tsx": () => import("./components/Icons/Epilepsy.js"), "../Icons/Eraser.tsx": () => import("./components/Icons/Eraser.js"), "../Icons/ErrorSignFill.tsx": () => import("./components/Icons/ErrorSignFill.js"), "../Icons/ErrorSignStroke.tsx": () => import("./components/Icons/ErrorSignStroke.js"), "../Icons/EuropeanHealthCard.tsx": () => import("./components/Icons/EuropeanHealthCard.js"), "../Icons/ExitFullScreen.tsx": () => import("./components/Icons/ExitFullScreen.js"), "../Icons/Eye.tsx": () => import("./components/Icons/Eye.js"), "../Icons/Facebook.tsx": () => import("./components/Icons/Facebook.js"), "../Icons/FallingLeaf.tsx": () => import("./components/Icons/FallingLeaf.js"), "../Icons/Female.tsx": () => import("./components/Icons/Female.js"), "../Icons/FemaleDoctor.tsx": () => import("./components/Icons/FemaleDoctor.js"), "../Icons/Ferry.tsx": () => import("./components/Icons/Ferry.js"), "../Icons/File.tsx": () => import("./components/Icons/File.js"), "../Icons/Filter.tsx": () => import("./components/Icons/Filter.js"), "../Icons/FingerBleed.tsx": () => import("./components/Icons/FingerBleed.js"), "../Icons/FirstAidKit.tsx": () => import("./components/Icons/FirstAidKit.js"), "../Icons/Fish.tsx": () => import("./components/Icons/Fish.js"), "../Icons/FloppyDisk.tsx": () => import("./components/Icons/FloppyDisk.js"), "../Icons/Football.tsx": () => import("./components/Icons/Football.js"), "../Icons/Form.tsx": () => import("./components/Icons/Form.js"), "../Icons/Forward.tsx": () => import("./components/Icons/Forward.js"), "../Icons/Gallery.tsx": () => import("./components/Icons/Gallery.js"), "../Icons/Garden.tsx": () => import("./components/Icons/Garden.js"), "../Icons/GasCan.tsx": () => import("./components/Icons/GasCan.js"), "../Icons/GenderIdentity.tsx": () => import("./components/Icons/GenderIdentity.js"), "../Icons/GlassWater.tsx": () => import("./components/Icons/GlassWater.js"), "../Icons/Glasses.tsx": () => import("./components/Icons/Glasses.js"), "../Icons/Globe.tsx": () => import("./components/Icons/Globe.js"), "../Icons/Grain.tsx": () => import("./components/Icons/Grain.js"), "../Icons/Graph.tsx": () => import("./components/Icons/Graph.js"), "../Icons/Group.tsx": () => import("./components/Icons/Group.js"), "../Icons/GroupTwins.tsx": () => import("./components/Icons/GroupTwins.js"), "../Icons/HTMLFile.tsx": () => import("./components/Icons/HTMLFile.js"), "../Icons/HandWaving.tsx": () => import("./components/Icons/HandWaving.js"), "../Icons/HandWithDisease.tsx": () => import("./components/Icons/HandWithDisease.js"), "../Icons/HandsAndHeart.tsx": () => import("./components/Icons/HandsAndHeart.js"), "../Icons/HealthClinic.tsx": () => import("./components/Icons/HealthClinic.js"), "../Icons/HealthMeasurements.tsx": () => import("./components/Icons/HealthMeasurements.js"), "../Icons/HealthWarning.tsx": () => import("./components/Icons/HealthWarning.js"), "../Icons/HealthcarePerson.tsx": () => import("./components/Icons/HealthcarePerson.js"), "../Icons/HealthcarePersonell.tsx": () => import("./components/Icons/HealthcarePersonell.js"), "../Icons/HearingProtection.tsx": () => import("./components/Icons/HearingProtection.js"), "../Icons/Heart.tsx": () => import("./components/Icons/Heart.js"), "../Icons/HeartHands.tsx": () => import("./components/Icons/HeartHands.js"), "../Icons/HelpSign.tsx": () => import("./components/Icons/HelpSign.js"), "../Icons/HelpingHand.tsx": () => import("./components/Icons/HelpingHand.js"), "../Icons/Hemodialysis.tsx": () => import("./components/Icons/Hemodialysis.js"), "../Icons/Hiker.tsx": () => import("./components/Icons/Hiker.js"), "../Icons/Hipprosthesis.tsx": () => import("./components/Icons/Hipprosthesis.js"), "../Icons/History.tsx": () => import("./components/Icons/History.js"), "../Icons/HivAndAids.tsx": () => import("./components/Icons/HivAndAids.js"), "../Icons/Home.tsx": () => import("./components/Icons/Home.js"), "../Icons/HomeFill.tsx": () => import("./components/Icons/HomeFill.js"), "../Icons/Hormone.tsx": () => import("./components/Icons/Hormone.js"), "../Icons/Hospital.tsx": () => import("./components/Icons/Hospital.js"), "../Icons/Hourglass.tsx": () => import("./components/Icons/Hourglass.js"), "../Icons/ImgFile.tsx": () => import("./components/Icons/ImgFile.js"), "../Icons/Inbox.tsx": () => import("./components/Icons/Inbox.js"), "../Icons/InfoSignFill.tsx": () => import("./components/Icons/InfoSignFill.js"), "../Icons/InfoSignStroke.tsx": () => import("./components/Icons/InfoSignStroke.js"), "../Icons/Instagram.tsx": () => import("./components/Icons/Instagram.js"), "../Icons/Intravenous.tsx": () => import("./components/Icons/Intravenous.js"), "../Icons/JointPain.tsx": () => import("./components/Icons/JointPain.js"), "../Icons/Journal.tsx": () => import("./components/Icons/Journal.js"), "../Icons/JpgFile.tsx": () => import("./components/Icons/JpgFile.js"), "../Icons/Kidney.tsx": () => import("./components/Icons/Kidney.js"), "../Icons/KitchenScale.tsx": () => import("./components/Icons/KitchenScale.js"), "../Icons/Kjernejournal.tsx": () => import("./components/Icons/Kjernejournal.js"), "../Icons/Laboratory.tsx": () => import("./components/Icons/Laboratory.js"), "../Icons/LaptopBlog.tsx": () => import("./components/Icons/LaptopBlog.js"), "../Icons/LawBook.tsx": () => import("./components/Icons/LawBook.js"), "../Icons/LegalDocument.tsx": () => import("./components/Icons/LegalDocument.js"), "../Icons/LightBulb.tsx": () => import("./components/Icons/LightBulb.js"), "../Icons/List.tsx": () => import("./components/Icons/List.js"), "../Icons/Location.tsx": () => import("./components/Icons/Location.js"), "../Icons/LocationFill.tsx": () => import("./components/Icons/LocationFill.js"), "../Icons/Lock.tsx": () => import("./components/Icons/Lock.js"), "../Icons/Login.tsx": () => import("./components/Icons/Login.js"), "../Icons/Logout.tsx": () => import("./components/Icons/Logout.js"), "../Icons/Lungs.tsx": () => import("./components/Icons/Lungs.js"), "../Icons/Makeup.tsx": () => import("./components/Icons/Makeup.js"), "../Icons/MaleDoctor.tsx": () => import("./components/Icons/MaleDoctor.js"), "../Icons/MaleDoctorAndPerson.tsx": () => import("./components/Icons/MaleDoctorAndPerson.js"), "../Icons/MaleDoctorCompact.tsx": () => import("./components/Icons/MaleDoctorCompact.js"), "../Icons/MaleDoctorCompactFill.tsx": () => import("./components/Icons/MaleDoctorCompactFill.js"), "../Icons/MaleGenitalia.tsx": () => import("./components/Icons/MaleGenitalia.js"), "../Icons/Medicine.tsx": () => import("./components/Icons/Medicine.js"), "../Icons/MedicineWarning.tsx": () => import("./components/Icons/MedicineWarning.js"), "../Icons/MentalHealthAdult.tsx": () => import("./components/Icons/MentalHealthAdult.js"), "../Icons/MentalHealthChild.tsx": () => import("./components/Icons/MentalHealthChild.js"), "../Icons/Menu.tsx": () => import("./components/Icons/Menu.js"), "../Icons/Microscope.tsx": () => import("./components/Icons/Microscope.js"), "../Icons/Minus.tsx": () => import("./components/Icons/Minus.js"), "../Icons/Mirror.tsx": () => import("./components/Icons/Mirror.js"), "../Icons/MobilePhone.tsx": () => import("./components/Icons/MobilePhone.js"), "../Icons/MotherHoldingBaby.tsx": () => import("./components/Icons/MotherHoldingBaby.js"), "../Icons/MuscleBack.tsx": () => import("./components/Icons/MuscleBack.js"), "../Icons/MuscleLeg.tsx": () => import("./components/Icons/MuscleLeg.js"), "../Icons/Mushroom.tsx": () => import("./components/Icons/Mushroom.js"), "../Icons/Music.tsx": () => import("./components/Icons/Music.js"), "../Icons/MusselsAndSalt.tsx": () => import("./components/Icons/MusselsAndSalt.js"), "../Icons/NoAccess.tsx": () => import("./components/Icons/NoAccess.js"), "../Icons/NoEye.tsx": () => import("./components/Icons/NoEye.js"), "../Icons/NoFilter.tsx": () => import("./components/Icons/NoFilter.js"), "../Icons/Notepad.tsx": () => import("./components/Icons/Notepad.js"), "../Icons/Osteotomy.tsx": () => import("./components/Icons/Osteotomy.js"), "../Icons/PaintRoller.tsx": () => import("./components/Icons/PaintRoller.js"), "../Icons/PaperPlane.tsx": () => import("./components/Icons/PaperPlane.js"), "../Icons/PatientAndPerson.tsx": () => import("./components/Icons/PatientAndPerson.js"), "../Icons/Pause.tsx": () => import("./components/Icons/Pause.js"), "../Icons/PdfFile.tsx": () => import("./components/Icons/PdfFile.js"), "../Icons/Pencil.tsx": () => import("./components/Icons/Pencil.js"), "../Icons/PeopleTalking.tsx": () => import("./components/Icons/PeopleTalking.js"), "../Icons/Peritonealdialysis.tsx": () => import("./components/Icons/Peritonealdialysis.js"), "../Icons/Person.tsx": () => import("./components/Icons/Person.js"), "../Icons/PersonAndPatient.tsx": () => import("./components/Icons/PersonAndPatient.js"), "../Icons/PersonCancel.tsx": () => import("./components/Icons/PersonCancel.js"), "../Icons/PersonInXRayMachine.tsx": () => import("./components/Icons/PersonInXRayMachine.js"), "../Icons/PersonOverweight.tsx": () => import("./components/Icons/PersonOverweight.js"), "../Icons/PersonRelaxing.tsx": () => import("./components/Icons/PersonRelaxing.js"), "../Icons/PersonWithBrain.tsx": () => import("./components/Icons/PersonWithBrain.js"), "../Icons/PersonWithBrokenArm.tsx": () => import("./components/Icons/PersonWithBrokenArm.js"), "../Icons/PersonWithCrutches.tsx": () => import("./components/Icons/PersonWithCrutches.js"), "../Icons/PersonWithJaw.tsx": () => import("./components/Icons/PersonWithJaw.js"), "../Icons/PersonWithMagnifyingGlass.tsx": () => import("./components/Icons/PersonWithMagnifyingGlass.js"), "../Icons/PersonWithSenses.tsx": () => import("./components/Icons/PersonWithSenses.js"), "../Icons/PersonWorking.tsx": () => import("./components/Icons/PersonWorking.js"), "../Icons/PersonalPlan.tsx": () => import("./components/Icons/PersonalPlan.js"), "../Icons/PizzaSlice.tsx": () => import("./components/Icons/PizzaSlice.js"), "../Icons/Plane.tsx": () => import("./components/Icons/Plane.js"), "../Icons/Plant.tsx": () => import("./components/Icons/Plant.js"), "../Icons/PlateKnifeFork.tsx": () => import("./components/Icons/PlateKnifeFork.js"), "../Icons/Play.tsx": () => import("./components/Icons/Play.js"), "../Icons/PlusLarge.tsx": () => import("./components/Icons/PlusLarge.js"), "../Icons/PlusSmall.tsx": () => import("./components/Icons/PlusSmall.js"), "../Icons/PngFile.tsx": () => import("./components/Icons/PngFile.js"), "../Icons/Podcast.tsx": () => import("./components/Icons/Podcast.js"), "../Icons/PoisonInformation.tsx": () => import("./components/Icons/PoisonInformation.js"), "../Icons/Pregnant.tsx": () => import("./components/Icons/Pregnant.js"), "../Icons/Printer.tsx": () => import("./components/Icons/Printer.js"), "../Icons/Psychosis.tsx": () => import("./components/Icons/Psychosis.js"), "../Icons/Publication.tsx": () => import("./components/Icons/Publication.js"), "../Icons/Puzzle.tsx": () => import("./components/Icons/Puzzle.js"), "../Icons/QrCode.tsx": () => import("./components/Icons/QrCode.js"), "../Icons/Quarrel.tsx": () => import("./components/Icons/Quarrel.js"), "../Icons/RadioTherapy.tsx": () => import("./components/Icons/RadioTherapy.js"), "../Icons/RadioactiveTreatment.tsx": () => import("./components/Icons/RadioactiveTreatment.js"), "../Icons/Radioiodine.tsx": () => import("./components/Icons/Radioiodine.js"), "../Icons/Receipt.tsx": () => import("./components/Icons/Receipt.js"), "../Icons/Receptionist.tsx": () => import("./components/Icons/Receptionist.js"), "../Icons/Recovery.tsx": () => import("./components/Icons/Recovery.js"), "../Icons/Referral.tsx": () => import("./components/Icons/Referral.js"), "../Icons/Refresh.tsx": () => import("./components/Icons/Refresh.js"), "../Icons/Refund.tsx": () => import("./components/Icons/Refund.js"), "../Icons/Reminder.tsx": () => import("./components/Icons/Reminder.js"), "../Icons/Reply.tsx": () => import("./components/Icons/Reply.js"), "../Icons/Rocket.tsx": () => import("./components/Icons/Rocket.js"), "../Icons/RtfFile.tsx": () => import("./components/Icons/RtfFile.js"), "../Icons/STDs.tsx": () => import("./components/Icons/STDs.js"), "../Icons/Save.tsx": () => import("./components/Icons/Save.js"), "../Icons/Scale.tsx": () => import("./components/Icons/Scale.js"), "../Icons/ScreenReader.tsx": () => import("./components/Icons/ScreenReader.js"), "../Icons/Search.tsx": () => import("./components/Icons/Search.js"), "../Icons/SectionSign.tsx": () => import("./components/Icons/SectionSign.js"), "../Icons/Settings.tsx": () => import("./components/Icons/Settings.js"), "../Icons/SettingsFill.tsx": () => import("./components/Icons/SettingsFill.js"), "../Icons/Sexualorientation.tsx": () => import("./components/Icons/Sexualorientation.js"), "../Icons/ShakingHand.tsx": () => import("./components/Icons/ShakingHand.js"), "../Icons/Share.tsx": () => import("./components/Icons/Share.js"), "../Icons/SharedHealthData.tsx": () => import("./components/Icons/SharedHealthData.js"), "../Icons/SharedHealthMeasurements.tsx": () => import("./components/Icons/SharedHealthMeasurements.js"), "../Icons/Shield.tsx": () => import("./components/Icons/Shield.js"), "../Icons/ShuntOperation.tsx": () => import("./components/Icons/ShuntOperation.js"), "../Icons/Skeleton.tsx": () => import("./components/Icons/Skeleton.js"), "../Icons/Skin.tsx": () => import("./components/Icons/Skin.js"), "../Icons/Snake.tsx": () => import("./components/Icons/Snake.js"), "../Icons/Snapchat.tsx": () => import("./components/Icons/Snapchat.js"), "../Icons/SortDown.tsx": () => import("./components/Icons/SortDown.js"), "../Icons/SortUp.tsx": () => import("./components/Icons/SortUp.js"), "../Icons/SpeechBubble.tsx": () => import("./components/Icons/SpeechBubble.js"), "../Icons/Spray.tsx": () => import("./components/Icons/Spray.js"), "../Icons/StickyNote.tsx": () => import("./components/Icons/StickyNote.js"), "../Icons/StickyNotes.tsx": () => import("./components/Icons/StickyNotes.js"), "../Icons/Stopwatch.tsx": () => import("./components/Icons/Stopwatch.js"), "../Icons/Sun.tsx": () => import("./components/Icons/Sun.js"), "../Icons/SupportingPerson.tsx": () => import("./components/Icons/SupportingPerson.js"), "../Icons/Surgery.tsx": () => import("./components/Icons/Surgery.js"), "../Icons/Sweets.tsx": () => import("./components/Icons/Sweets.js"), "../Icons/Syringe.tsx": () => import("./components/Icons/Syringe.js"), "../Icons/Taxi.tsx": () => import("./components/Icons/Taxi.js"), "../Icons/TeddyBear.tsx": () => import("./components/Icons/TeddyBear.js"), "../Icons/Teenagers.tsx": () => import("./components/Icons/Teenagers.js"), "../Icons/ThinkingAboutBaby.tsx": () => import("./components/Icons/ThinkingAboutBaby.js"), "../Icons/Ticket.tsx": () => import("./components/Icons/Ticket.js"), "../Icons/TimePassing.tsx": () => import("./components/Icons/TimePassing.js"), "../Icons/Toddler.tsx": () => import("./components/Icons/Toddler.js"), "../Icons/Tombstone.tsx": () => import("./components/Icons/Tombstone.js"), "../Icons/Toolbox.tsx": () => import("./components/Icons/Toolbox.js"), "../Icons/Tooth.tsx": () => import("./components/Icons/Tooth.js"), "../Icons/TotalKneeProsthesis.tsx": () => import("./components/Icons/TotalKneeProsthesis.js"), "../Icons/Train.tsx": () => import("./components/Icons/Train.js"), "../Icons/Transplantation.tsx": () => import("./components/Icons/Transplantation.js"), "../Icons/TrashCan.tsx": () => import("./components/Icons/TrashCan.js"), "../Icons/TravelRoute.tsx": () => import("./components/Icons/TravelRoute.js"), "../Icons/TreatmentAids.tsx": () => import("./components/Icons/TreatmentAids.js"), "../Icons/TriangleX.tsx": () => import("./components/Icons/TriangleX.js"), "../Icons/Twitter.tsx": () => import("./components/Icons/Twitter.js"), "../Icons/Undo.tsx": () => import("./components/Icons/Undo.js"), "../Icons/UniProsthesis.tsx": () => import("./components/Icons/UniProsthesis.js"), "../Icons/Upload.tsx": () => import("./components/Icons/Upload.js"), "../Icons/UserOrganization.tsx": () => import("./components/Icons/UserOrganization.js"), "../Icons/Vaccine.tsx": () => import("./components/Icons/Vaccine.js"), "../Icons/VerticalDots.tsx": () => import("./components/Icons/VerticalDots.js"), "../Icons/VideoCamera.tsx": () => import("./components/Icons/VideoCamera.js"), "../Icons/VideoChat.tsx": () => import("./components/Icons/VideoChat.js"), "../Icons/Wallet.tsx": () => import("./components/Icons/Wallet.js"), "../Icons/Watch.tsx": () => import("./components/Icons/Watch.js"), "../Icons/Website.tsx": () => import("./components/Icons/Website.js"), "../Icons/Wheelchair.tsx": () => import("./components/Icons/Wheelchair.js"), "../Icons/WheelchairActive.tsx": () => import("./components/Icons/WheelchairActive.js"), "../Icons/Window.tsx": () => import("./components/Icons/Window.js"), "../Icons/WordDocument.tsx": () => import("./components/Icons/WordDocument.js"), "../Icons/WorkSuitcase.tsx": () => import("./components/Icons/WorkSuitcase.js"), "../Icons/X.tsx": () => import("./components/Icons/X.js"), "../Icons/XOutline.tsx": () => import("./components/Icons/XOutline.js"), "../Icons/XmlFile.tsx": () => import("./components/Icons/XmlFile.js"), "../Icons/YouTube.tsx": () => import("./components/Icons/YouTube.js"), "../Icons/Zoom.tsx": () => import("./components/Icons/Zoom.js") }), `../Icons/${iconName}.tsx`, 3));
|
|
8
8
|
const LazyIcon = ({ iconName, size = IconSize.Small, ...rest }) => {
|
|
9
9
|
const icon = useMemo(() => lazyLoadIcon(iconName), [iconName]);
|
|
10
10
|
const isServerSide = useIsServerSide();
|