@helsenorge/designsystem-react 5.11.0 → 5.14.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/Button.js +1 -1
- package/Button.js.map +1 -1
- package/CHANGELOG.md +23 -0
- package/components/Button/Button.d.ts.map +1 -1
- package/components/Button/styles.module.scss +10 -2
- package/components/FormGroup/styles.module.scss +3 -3
- package/components/Label/componentdata.json +1 -1
- package/components/NotificationPanel/NotificationPanel.d.ts.map +1 -1
- package/components/NotificationPanel/index.js +1 -1
- package/components/NotificationPanel/index.js.map +1 -1
- package/components/NotificationPanel/styles.module.scss +8 -0
- package/components/NotificationPanel/styles.module.scss.d.ts +1 -0
- package/components/Slider/Slider.d.ts +3 -1
- package/components/Slider/Slider.d.ts.map +1 -1
- package/components/Slider/componentdata.json +1 -1
- package/components/Slider/index.js +1 -1
- package/components/Slider/index.js.map +1 -1
- package/components/Slider/styles.module.scss +13 -11
- package/components/Slider/styles.module.scss.d.ts +1 -0
- package/components/Tile/Tile.d.ts +1 -0
- package/components/Tile/Tile.d.ts.map +1 -1
- package/components/Tile/index.js +1 -1
- package/components/Tile/index.js.map +1 -1
- package/components/Tile/styles.module.scss +4 -0
- package/components/Tile/styles.module.scss.d.ts +1 -0
- package/package.json +1 -1
- package/scss/_font-settings.scss +2 -0
- package/scss/_title.scss +13 -0
- package/scss/typography.module.scss +1 -8
package/Button.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import o,{useRef as
|
|
1
|
+
import o,{useRef as lt,useEffect as ct}from"react";import m from"classnames";import{Icon as it}from"./components/Icons/Icon.js";import{AnalyticsId as V,IconSize as y}from"./constants.js";import{useBreakpoint as ut}from"./hooks/useBreakpoint.js";import{useHover as W}from"./hooks/useHover.js";import{useIcons as mt}from"./hooks/useIcons.js";import{useSize as pt}from"./hooks/useSize.js";import{getColor as c}from"./theme/currys/color.js";import{breakpoints as bt}from"./theme/grid.js";import{isTest as dt,isProd as ft}from"./utils/environment.js";import ht from"./components/Icons/ArrowRight.js";import t from"./components/Button/styles.module.scss";const gt=(e,r,n,p,s,g)=>g&&n?!s||e?c("neutral",r?500:700):c("white"):n?!s||e?c("neutral",500):`${c("white")}b3`:e&&!s||!e&&s?"white":p==="normal"?c("blueberry",600):c("cherry",500),k=(e,r)=>r&&e?y.Small:e?y.Medium:y.XSmall,_t=(e,r,n)=>{if(n&&e&&(r===void 0||r===""))throw new Error("Fyll inn ariaLabel prop på Button uten tekst for å opprettholde UU krav")},wt=o.forwardRef(function(r,n){const{ariaLabel:p,id:s,children:g,wrapperClassName:$,className:j,arrow:v=!1,concept:B="normal",disabled:b=!1,ellipsis:N=!1,fluid:D=!1,htmlMarkup:_="button",mode:X="onlight",onBlur:R,onClick:E,size:q="medium",variant:w="fill",href:G,tabIndex:S,testId:x,target:z,type:J="button",...A}=r,[d,f,F]=mt(o.Children.toArray(g)),{hoverRef:H,isHovered:K}=_==="button"?W(n):W(n),L=lt(null);pt(L);const a=!!(d||f)&&!F,M=d&&(f||v)&&!a,I=X==="ondark",h=ut()<bt.md,O=B==="destructive"&&!b,Q=w==="outline",i=w==="borderless",Y=gt(w==="fill",i,b,B,I,h),P=v&&!i,u=q==="large"&&!O&&!i,Z={...A},T=m(t["button-wrapper"],{[t["button-wrapper--fluid"]]:D||N},$),tt=m(t.button,{[t["button--destructive"]]:O,[t["button--normal"]]:!u,[t["button--large"]]:u,[t["button--outline"]]:Q,[t["button--borderless"]]:i,[t["button--left-icon"]]:d&&!a,[t["button--right-icon"]]:f&&!a,[t["button--both-icons"]]:M,[t["button--only-icon"]]:a,[t["button--arrow"]]:P,[t["button--on-dark"]]:I},j),ot=m(t.button__text,{[t["button__text--ellipsis"]]:N}),et=m(t.diagonal,{[t["diagonal--on-dark"]]:I});ct(()=>{_t(a,p,!dt()&&!ft())},[]);const C=(l,nt,st)=>{const at=l&&l.props&&l.props.color?l.props.color:Y;return l&&Object.keys(l).length>0?o.cloneElement(l,{size:nt,color:at,isHovered:K,className:st}):null},rt=()=>o.createElement("span",{className:ot,ref:L},b&&i&&o.createElement("span",{className:et},o.createElement("span",{className:t.diagonal__line})),o.createElement("span",null,a?p:F)),U=()=>o.createElement("span",{className:tt},C(d,k(u,h),a?void 0:t["button__left-icon"]),rt(),P?C(o.createElement(it,{svgIcon:ht}),k(u,h),m(t.button__arrow,{[t["button__arrow--both-icons"]]:M})):C(f,k(u,h),t["button__right-icon"]));return o.createElement(o.Fragment,null,_==="button"&&o.createElement("button",{id:s,onBlur:R,onClick:E,disabled:b,"data-testid":x,"data-analyticsid":V.Button,className:T,ref:H,tabIndex:S,type:J,...Z},U()),_==="a"&&o.createElement("a",{id:s,onBlur:R,onClick:E,"data-testid":x,"data-analyticsid":V.Button,className:T,href:G,target:z,rel:z==="_blank"?"noopener noreferrer":r.rel,ref:H,tabIndex:S,...A},U()))}),Ht=wt;export{Ht as B};
|
|
2
2
|
//# sourceMappingURL=Button.js.map
|
package/Button.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sources":["../src/components/Button/Button.tsx"],"sourcesContent":["import React, { AriaAttributes, useEffect, useRef } from 'react';\n\nimport classNames from 'classnames';\n\nimport Icon, { IconProps, IconSize } from './../Icons/';\nimport { HTMLButtonProps, HTMLAnchorProps, AnalyticsId } from '../../constants';\nimport { useBreakpoint } from '../../hooks/useBreakpoint';\nimport { useHover } from '../../hooks/useHover';\nimport { useIcons } from '../../hooks/useIcons';\nimport { useSize } from '../../hooks/useSize';\nimport { getColor } from '../../theme/currys/color';\nimport { breakpoints } from '../../theme/grid';\nimport { isTest, isProd } from '../../utils/environment';\nimport ArrowRight from '../Icons/ArrowRight';\n\nimport buttonStyles from './styles.module.scss';\n\nexport type ButtonConcept = 'normal' | 'destructive';\nexport type ButtonVariant = 'fill' | 'outline' | 'borderless';\nexport type ButtonSize = 'medium' | 'large';\nexport type ButtonMode = 'onlight' | 'ondark';\nexport type ButtonTags = 'button' | 'a';\n\nexport interface ButtonProps extends HTMLButtonProps, HTMLAnchorProps, AriaAttributes {\n /** Sets the aria-label of the button, use when the button only includes an icon */\n ariaLabel?: string;\n /** Gives a unique id to the button */\n id?: string;\n /** Sets the content of the button. */\n children: React.ReactNode;\n /** Adds custom classes to the wrapper element. */\n wrapperClassName?: string;\n /** Adds custom classes to the element. */\n className?: string;\n /** Enables an arrow icon to the right inside the button (Not available in borderless variant) */\n arrow?: boolean;\n /** Changes the intent of the button. Mostly changes the color profile. */\n concept?: ButtonConcept;\n /** Disables text wrapping and enables ellipsis. */\n ellipsis?: boolean;\n /** Makes the button scale to full width of its parent element. */\n fluid?: boolean;\n /** Changes the underlying element of the button. */\n htmlMarkup?: ButtonTags;\n /** Changes the button colors for different backgrounds. */\n mode?: ButtonMode;\n /** Function that is called when the Button loses focus */\n onBlur?: () => void;\n /** Function that is called when clicked */\n onClick?: (e?: React.MouseEvent<HTMLElement, MouseEvent> | React.FormEvent<{}> | React.KeyboardEvent<HTMLUListElement> | null) => void;\n /** Changes the button colors for different backgrounds. (Large not available in borderless variant) */\n size?: ButtonSize;\n /** Changes the visual representation of the button. */\n variant?: ButtonVariant;\n /** Specifies the focus order relative to the other buttons or controls on the page */\n tabIndex?: number;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Button type. Default: button */\n type?: React.ButtonHTMLAttributes<HTMLButtonElement>['type'];\n}\n\nconst getIconColor = (\n fill: boolean,\n borderless: boolean,\n disabled: boolean,\n concept: ButtonConcept,\n ondark: boolean,\n mobile: boolean\n): string => {\n if (mobile && disabled) {\n return !ondark || fill ? getColor('neutral', !borderless ? 700 : 500) : getColor('white');\n }\n if (disabled) {\n return !ondark || fill ? getColor('neutral', 500) : `${getColor('white')}b3`;\n }\n if ((fill && !ondark) || (!fill && ondark)) {\n return 'white';\n }\n\n return concept === 'normal' ? getColor('blueberry', 600) : getColor('cherry', 500);\n};\nconst getLargeIconSize = (large: boolean, mobile: boolean): IconSize => {\n if (mobile && large) return IconSize.Small;\n if (large) return IconSize.Medium;\n return IconSize.XSmall;\n};\n\nconst checkOnlyIconAria = (onlyIcon: boolean, ariaLabel: string | undefined, devEnv: boolean) => {\n if (devEnv && onlyIcon && (ariaLabel === undefined || ariaLabel === '')) {\n throw new Error('Fyll inn ariaLabel prop på Button uten tekst for å opprettholde UU krav');\n }\n};\n\nconst Button = React.forwardRef(function ButtonForwardedRef(\n props: ButtonProps,\n ref: React.ForwardedRef<HTMLButtonElement | HTMLAnchorElement>\n) {\n const {\n ariaLabel,\n id,\n children,\n wrapperClassName,\n className,\n arrow = false,\n concept = 'normal',\n disabled = false,\n ellipsis = false,\n fluid = false,\n htmlMarkup = 'button',\n mode = 'onlight',\n onBlur,\n onClick,\n size = 'medium',\n variant = 'fill',\n href,\n tabIndex,\n testId,\n target,\n type = 'button',\n ...restProps\n } = props;\n\n const [leftIcon, rightIcon, restChildren] = useIcons(React.Children.toArray(children));\n const { hoverRef, isHovered } =\n htmlMarkup === 'button'\n ? useHover<HTMLButtonElement>(ref as React.RefObject<HTMLButtonElement>)\n : useHover<HTMLAnchorElement>(ref as React.RefObject<HTMLAnchorElement>);\n const buttonContentRef = useRef<HTMLDivElement>(null);\n const buttonContentSize = useSize(buttonContentRef);\n const onlyIcon = !!(leftIcon || rightIcon) && !restChildren;\n const bothIcons = leftIcon && (rightIcon || arrow) && !onlyIcon;\n const onDark = mode === 'ondark';\n const breakpoint = useBreakpoint();\n const mobile = breakpoint < breakpoints.md;\n const destructive = concept === 'destructive' && !disabled;\n const outlineVariant = variant === 'outline';\n const borderlessVariant = variant === 'borderless';\n const iconColor = getIconColor(variant === 'fill', borderlessVariant, disabled, concept, onDark, mobile);\n const hasArrow = arrow && !borderlessVariant;\n const large = size === 'large' && !destructive && !borderlessVariant;\n const rest = { ...restProps };\n\n const buttonWrapperClasses = classNames(\n buttonStyles['button-wrapper'],\n { [buttonStyles['button-wrapper--fluid']]: fluid || ellipsis },\n wrapperClassName\n );\n const buttonClasses = classNames(\n buttonStyles.button,\n {\n [buttonStyles['button--destructive']]: destructive,\n [buttonStyles['button--normal']]: !large,\n [buttonStyles['button--large']]: large,\n [buttonStyles['button--outline']]: outlineVariant,\n [buttonStyles['button--borderless']]: borderlessVariant,\n [buttonStyles['button--left-icon']]: leftIcon && !onlyIcon,\n [buttonStyles['button--right-icon']]: rightIcon && !onlyIcon,\n [buttonStyles['button--both-icons']]: bothIcons,\n [buttonStyles['button--only-icon']]: onlyIcon,\n [buttonStyles['button--arrow']]: hasArrow,\n [buttonStyles['button--on-dark']]: onDark,\n },\n className\n );\n const buttonTextClasses = classNames(buttonStyles['button__text'], {\n [buttonStyles['button__text--ellipsis']]: ellipsis,\n });\n const diagonalClasses = classNames(buttonStyles['diagonal'], {\n [buttonStyles['diagonal--on-dark']]: onDark,\n });\n\n useEffect(() => {\n checkOnlyIconAria(onlyIcon, ariaLabel, !isTest() && !isProd());\n }, []);\n\n const renderIcon = (\n iconElement: React.ReactElement<IconProps> | {} | undefined | null,\n iconSize: number,\n iconClassName?: string\n ): React.ReactElement<IconProps> | React.Component<IconProps> | null => {\n const color =\n iconElement && (iconElement as React.ReactElement<IconProps>).props && (iconElement as React.ReactElement<IconProps>).props.color\n ? (iconElement as React.ReactElement<IconProps>).props.color\n : iconColor;\n return iconElement && Object.keys(iconElement).length > 0\n ? React.cloneElement(iconElement as React.ReactElement<IconProps>, { size: iconSize, color, isHovered, className: iconClassName })\n : null;\n };\n\n const renderButtonContent = (): JSX.Element => {\n let angle;\n let diagonalWidth;\n if (buttonContentSize) {\n angle = Math.atan2(buttonContentSize.height, buttonContentSize.width);\n diagonalWidth = Math.sqrt(Math.pow(buttonContentSize.width, 2) + Math.pow(buttonContentSize.height, 2));\n }\n\n return (\n <span className={buttonTextClasses} ref={buttonContentRef}>\n {disabled && borderlessVariant && (\n <span className={diagonalClasses}>\n <span style={{ transform: `rotate(${angle}rad)`, width: diagonalWidth }} className={buttonStyles['diagonal__line']} />\n </span>\n )}\n <span>{onlyIcon ? ariaLabel : restChildren}</span>\n </span>\n );\n };\n\n const renderbuttonContentWrapper = (): JSX.Element => (\n <span className={buttonClasses}>\n {renderIcon(leftIcon, getLargeIconSize(large, mobile), !onlyIcon ? buttonStyles['button__left-icon'] : undefined)}\n {renderButtonContent()}\n {hasArrow\n ? renderIcon(\n <Icon svgIcon={ArrowRight} />,\n getLargeIconSize(large, mobile),\n classNames(buttonStyles['button__arrow'], { [buttonStyles['button__arrow--both-icons']]: bothIcons })\n )\n : renderIcon(rightIcon, getLargeIconSize(large, mobile), buttonStyles['button__right-icon'])}\n </span>\n );\n\n return (\n <>\n {htmlMarkup === 'button' && (\n <button\n id={id}\n onBlur={onBlur}\n onClick={onClick}\n disabled={disabled}\n data-testid={testId}\n data-analyticsid={AnalyticsId.Button}\n className={buttonWrapperClasses}\n ref={hoverRef as React.ForwardedRef<HTMLButtonElement>}\n tabIndex={tabIndex}\n type={type}\n {...rest}\n >\n {renderbuttonContentWrapper()}\n </button>\n )}\n {htmlMarkup === 'a' && (\n <a\n id={id}\n onBlur={onBlur}\n onClick={onClick}\n data-testid={testId}\n data-analyticsid={AnalyticsId.Button}\n className={buttonWrapperClasses}\n href={href}\n target={target}\n rel={target === '_blank' ? 'noopener noreferrer' : props.rel}\n ref={hoverRef as React.ForwardedRef<HTMLAnchorElement>}\n tabIndex={tabIndex}\n {...restProps}\n >\n {renderbuttonContentWrapper()}\n </a>\n )}\n </>\n );\n});\n\nexport default Button;\n"],"names":["getIconColor","fill","borderless","disabled","concept","ondark","mobile","getColor","getLargeIconSize","large","IconSize","checkOnlyIconAria","onlyIcon","ariaLabel","devEnv","Button","React","props","ref","id","children","wrapperClassName","className","arrow","ellipsis","fluid","htmlMarkup","mode","onBlur","onClick","size","variant","href","tabIndex","testId","target","type","restProps","leftIcon","rightIcon","restChildren","useIcons","hoverRef","isHovered","useHover","buttonContentRef","useRef","buttonContentSize","useSize","bothIcons","onDark","useBreakpoint","breakpoints","destructive","outlineVariant","borderlessVariant","iconColor","hasArrow","rest","buttonWrapperClasses","classNames","buttonStyles","buttonClasses","buttonTextClasses","diagonalClasses","useEffect","isTest","isProd","renderIcon","iconElement","iconSize","iconClassName","color","renderButtonContent","angle","diagonalWidth","renderbuttonContentWrapper","Icon","ArrowRight","AnalyticsId","Button$1"],"mappings":"yoBA8DA,MAAMA,GAAe,CACnBC,EACAC,EACAC,EACAC,EACAC,EACAC,IAEIA,GAAUH,EACL,CAACE,GAAUJ,EAAOM,EAAS,UAAYL,EAAmB,IAAN,GAAS,EAAIK,EAAS,OAAO,EAEtFJ,EACK,CAACE,GAAUJ,EAAOM,EAAS,UAAW,GAAG,EAAI,GAAGA,EAAS,OAAO,CAAC,KAErEN,GAAQ,CAACI,GAAY,CAACJ,GAAQI,EAC1B,QAGFD,IAAY,SAAWG,EAAS,YAAa,GAAG,EAAIA,EAAS,SAAU,GAAG,EAE7EC,EAAmB,CAACC,EAAgBH,IACpCA,GAAUG,EAAcC,EAAS,MACjCD,EAAcC,EAAS,OACpBA,EAAS,OAGZC,GAAoB,CAACC,EAAmBC,EAA+BC,IAAoB,CAC/F,GAAIA,GAAUF,IAAaC,IAAc,QAAaA,IAAc,IAC5D,MAAA,IAAI,MAAM,yEAAyE,CAE7F,EAEME,GAASC,EAAM,WAAW,SAC9BC,EACAC,EACA,CACM,KAAA,CACJ,UAAAL,EACA,GAAAM,EACA,SAAAC,EACA,iBAAAC,EACA,UAAAC,EACA,MAAAC,EAAQ,GACR,QAAAnB,EAAU,SACV,SAAAD,EAAW,GACX,SAAAqB,EAAW,GACX,MAAAC,EAAQ,GACR,WAAAC,EAAa,SACb,KAAAC,EAAO,UACP,OAAAC,EACA,QAAAC,EACA,KAAAC,EAAO,SACP,QAAAC,EAAU,OACV,KAAAC,EACA,SAAAC,EACA,OAAAC,EACA,OAAAC,EACA,KAAAC,EAAO,SACP,GAAGC,CACD,EAAApB,EAEE,CAACqB,EAAUC,EAAWC,CAAY,EAAIC,GAASzB,EAAM,SAAS,QAAQI,CAAQ,CAAC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BAAmB,CAAa,EAC/GY,KACAhB,EACGW,EACEpD,EAAA,cAAC6D,GAAK,CAAA,QAASC,EAAY,CAAA,EAC3BtE,EAAiBC,EAAOH,CAAM,EAC9BsD,EAAWC,EAAa,cAAkB,CAAE,CAACA,EAAa,2BAA2B,CAAC,EAAGZ,EAAW,CAAA,EAEtGmB,EAAW7B,EAAW/B,EAAiBC,EAAOH,CAAM,EAAGuD,EAAa,oBAAoB,CAAC,CAC/F,EAIA,OAAA7C,EAAA,cAAAA,EAAA,SAAA,KACGU,IAAe,UACdV,EAAA,cAAC,SAAA,CACC,GAAAG,EACA,OAAAS,EACA,QAAAC,EACA,SAAA1B,EACA,cAAa+B,EACb,mBAAkB6C,EAAY,OAC9B,UAAWpB,EACX,IAAKjB,EACL,SAAAT,EACA,KAAAG,EACC,GAAGsB,EAAA,EAEHkB,EAA2B,CAAA,EAG/BlD,IAAe,KACdV,EAAA,cAAC,IAAA,CACC,GAAAG,EACA,OAAAS,EACA,QAAAC,EACA,cAAaK,EACb,mBAAkB6C,EAAY,OAC9B,UAAWpB,EACX,KAAA3B,EACA,OAAAG,EACA,IAAKA,IAAW,SAAW,sBAAwBlB,EAAM,IACzD,IAAKyB,EACL,SAAAT,EACC,GAAGI,CAAA,EAEHuC,EAA2B,CAAA,CAGlC,CAEJ,CAAC,EAEDI,GAAejE"}
|
|
1
|
+
{"version":3,"file":"Button.js","sources":["../src/components/Button/Button.tsx"],"sourcesContent":["import React, { AriaAttributes, useEffect, useRef } from 'react';\n\nimport classNames from 'classnames';\n\nimport Icon, { IconProps, IconSize } from './../Icons/';\nimport { HTMLButtonProps, HTMLAnchorProps, AnalyticsId } from '../../constants';\nimport { useBreakpoint } from '../../hooks/useBreakpoint';\nimport { useHover } from '../../hooks/useHover';\nimport { useIcons } from '../../hooks/useIcons';\nimport { useSize } from '../../hooks/useSize';\nimport { getColor } from '../../theme/currys/color';\nimport { breakpoints } from '../../theme/grid';\nimport { isTest, isProd } from '../../utils/environment';\nimport ArrowRight from '../Icons/ArrowRight';\n\nimport buttonStyles from './styles.module.scss';\n\nexport type ButtonConcept = 'normal' | 'destructive';\nexport type ButtonVariant = 'fill' | 'outline' | 'borderless';\nexport type ButtonSize = 'medium' | 'large';\nexport type ButtonMode = 'onlight' | 'ondark';\nexport type ButtonTags = 'button' | 'a';\n\nexport interface ButtonProps extends HTMLButtonProps, HTMLAnchorProps, AriaAttributes {\n /** Sets the aria-label of the button, use when the button only includes an icon */\n ariaLabel?: string;\n /** Gives a unique id to the button */\n id?: string;\n /** Sets the content of the button. */\n children: React.ReactNode;\n /** Adds custom classes to the wrapper element. */\n wrapperClassName?: string;\n /** Adds custom classes to the element. */\n className?: string;\n /** Enables an arrow icon to the right inside the button (Not available in borderless variant) */\n arrow?: boolean;\n /** Changes the intent of the button. Mostly changes the color profile. */\n concept?: ButtonConcept;\n /** Disables text wrapping and enables ellipsis. */\n ellipsis?: boolean;\n /** Makes the button scale to full width of its parent element. */\n fluid?: boolean;\n /** Changes the underlying element of the button. */\n htmlMarkup?: ButtonTags;\n /** Changes the button colors for different backgrounds. */\n mode?: ButtonMode;\n /** Function that is called when the Button loses focus */\n onBlur?: () => void;\n /** Function that is called when clicked */\n onClick?: (e?: React.MouseEvent<HTMLElement, MouseEvent> | React.FormEvent<{}> | React.KeyboardEvent<HTMLUListElement> | null) => void;\n /** Changes the button colors for different backgrounds. (Large not available in borderless variant) */\n size?: ButtonSize;\n /** Changes the visual representation of the button. */\n variant?: ButtonVariant;\n /** Specifies the focus order relative to the other buttons or controls on the page */\n tabIndex?: number;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Button type. Default: button */\n type?: React.ButtonHTMLAttributes<HTMLButtonElement>['type'];\n}\n\nconst getIconColor = (\n fill: boolean,\n borderless: boolean,\n disabled: boolean,\n concept: ButtonConcept,\n ondark: boolean,\n mobile: boolean\n): string => {\n if (mobile && disabled) {\n return !ondark || fill ? getColor('neutral', !borderless ? 700 : 500) : getColor('white');\n }\n if (disabled) {\n return !ondark || fill ? getColor('neutral', 500) : `${getColor('white')}b3`;\n }\n if ((fill && !ondark) || (!fill && ondark)) {\n return 'white';\n }\n\n return concept === 'normal' ? getColor('blueberry', 600) : getColor('cherry', 500);\n};\nconst getLargeIconSize = (large: boolean, mobile: boolean): IconSize => {\n if (mobile && large) return IconSize.Small;\n if (large) return IconSize.Medium;\n return IconSize.XSmall;\n};\n\nconst checkOnlyIconAria = (onlyIcon: boolean, ariaLabel: string | undefined, devEnv: boolean) => {\n if (devEnv && onlyIcon && (ariaLabel === undefined || ariaLabel === '')) {\n throw new Error('Fyll inn ariaLabel prop på Button uten tekst for å opprettholde UU krav');\n }\n};\n\nconst Button = React.forwardRef(function ButtonForwardedRef(\n props: ButtonProps,\n ref: React.ForwardedRef<HTMLButtonElement | HTMLAnchorElement>\n) {\n const {\n ariaLabel,\n id,\n children,\n wrapperClassName,\n className,\n arrow = false,\n concept = 'normal',\n disabled = false,\n ellipsis = false,\n fluid = false,\n htmlMarkup = 'button',\n mode = 'onlight',\n onBlur,\n onClick,\n size = 'medium',\n variant = 'fill',\n href,\n tabIndex,\n testId,\n target,\n type = 'button',\n ...restProps\n } = props;\n\n const [leftIcon, rightIcon, restChildren] = useIcons(React.Children.toArray(children));\n const { hoverRef, isHovered } =\n htmlMarkup === 'button'\n ? useHover<HTMLButtonElement>(ref as React.RefObject<HTMLButtonElement>)\n : useHover<HTMLAnchorElement>(ref as React.RefObject<HTMLAnchorElement>);\n const buttonContentRef = useRef<HTMLDivElement>(null);\n const buttonContentSize = useSize(buttonContentRef);\n const onlyIcon = !!(leftIcon || rightIcon) && !restChildren;\n const bothIcons = leftIcon && (rightIcon || arrow) && !onlyIcon;\n const onDark = mode === 'ondark';\n const breakpoint = useBreakpoint();\n const mobile = breakpoint < breakpoints.md;\n const destructive = concept === 'destructive' && !disabled;\n const outlineVariant = variant === 'outline';\n const borderlessVariant = variant === 'borderless';\n const iconColor = getIconColor(variant === 'fill', borderlessVariant, disabled, concept, onDark, mobile);\n const hasArrow = arrow && !borderlessVariant;\n const large = size === 'large' && !destructive && !borderlessVariant;\n const rest = { ...restProps };\n\n const buttonWrapperClasses = classNames(\n buttonStyles['button-wrapper'],\n { [buttonStyles['button-wrapper--fluid']]: fluid || ellipsis },\n wrapperClassName\n );\n const buttonClasses = classNames(\n buttonStyles.button,\n {\n [buttonStyles['button--destructive']]: destructive,\n [buttonStyles['button--normal']]: !large,\n [buttonStyles['button--large']]: large,\n [buttonStyles['button--outline']]: outlineVariant,\n [buttonStyles['button--borderless']]: borderlessVariant,\n [buttonStyles['button--left-icon']]: leftIcon && !onlyIcon,\n [buttonStyles['button--right-icon']]: rightIcon && !onlyIcon,\n [buttonStyles['button--both-icons']]: bothIcons,\n [buttonStyles['button--only-icon']]: onlyIcon,\n [buttonStyles['button--arrow']]: hasArrow,\n [buttonStyles['button--on-dark']]: onDark,\n },\n className\n );\n const buttonTextClasses = classNames(buttonStyles['button__text'], {\n [buttonStyles['button__text--ellipsis']]: ellipsis,\n });\n const diagonalClasses = classNames(buttonStyles['diagonal'], {\n [buttonStyles['diagonal--on-dark']]: onDark,\n });\n\n useEffect(() => {\n checkOnlyIconAria(onlyIcon, ariaLabel, !isTest() && !isProd());\n }, []);\n\n const renderIcon = (\n iconElement: React.ReactElement<IconProps> | {} | undefined | null,\n iconSize: number,\n iconClassName?: string\n ): React.ReactElement<IconProps> | React.Component<IconProps> | null => {\n const color =\n iconElement && (iconElement as React.ReactElement<IconProps>).props && (iconElement as React.ReactElement<IconProps>).props.color\n ? (iconElement as React.ReactElement<IconProps>).props.color\n : iconColor;\n return iconElement && Object.keys(iconElement).length > 0\n ? React.cloneElement(iconElement as React.ReactElement<IconProps>, { size: iconSize, color, isHovered, className: iconClassName })\n : null;\n };\n\n const renderButtonContent = (): JSX.Element => {\n return (\n <span className={buttonTextClasses} ref={buttonContentRef}>\n {disabled && borderlessVariant && (\n <span className={diagonalClasses}>\n <span className={buttonStyles['diagonal__line']} />\n </span>\n )}\n <span>{onlyIcon ? ariaLabel : restChildren}</span>\n </span>\n );\n };\n\n const renderbuttonContentWrapper = (): JSX.Element => (\n <span className={buttonClasses}>\n {renderIcon(leftIcon, getLargeIconSize(large, mobile), !onlyIcon ? buttonStyles['button__left-icon'] : undefined)}\n {renderButtonContent()}\n {hasArrow\n ? renderIcon(\n <Icon svgIcon={ArrowRight} />,\n getLargeIconSize(large, mobile),\n classNames(buttonStyles['button__arrow'], { [buttonStyles['button__arrow--both-icons']]: bothIcons })\n )\n : renderIcon(rightIcon, getLargeIconSize(large, mobile), buttonStyles['button__right-icon'])}\n </span>\n );\n\n return (\n <>\n {htmlMarkup === 'button' && (\n <button\n id={id}\n onBlur={onBlur}\n onClick={onClick}\n disabled={disabled}\n data-testid={testId}\n data-analyticsid={AnalyticsId.Button}\n className={buttonWrapperClasses}\n ref={hoverRef as React.ForwardedRef<HTMLButtonElement>}\n tabIndex={tabIndex}\n type={type}\n {...rest}\n >\n {renderbuttonContentWrapper()}\n </button>\n )}\n {htmlMarkup === 'a' && (\n <a\n id={id}\n onBlur={onBlur}\n onClick={onClick}\n data-testid={testId}\n data-analyticsid={AnalyticsId.Button}\n className={buttonWrapperClasses}\n href={href}\n target={target}\n rel={target === '_blank' ? 'noopener noreferrer' : props.rel}\n ref={hoverRef as React.ForwardedRef<HTMLAnchorElement>}\n tabIndex={tabIndex}\n {...restProps}\n >\n {renderbuttonContentWrapper()}\n </a>\n )}\n </>\n );\n});\n\nexport default Button;\n"],"names":["getIconColor","fill","borderless","disabled","concept","ondark","mobile","getColor","getLargeIconSize","large","IconSize","checkOnlyIconAria","onlyIcon","ariaLabel","devEnv","Button","React","props","ref","id","children","wrapperClassName","className","arrow","ellipsis","fluid","htmlMarkup","mode","onBlur","onClick","size","variant","href","tabIndex","testId","target","type","restProps","leftIcon","rightIcon","restChildren","useIcons","hoverRef","isHovered","useHover","buttonContentRef","useRef","useSize","bothIcons","onDark","useBreakpoint","breakpoints","destructive","outlineVariant","borderlessVariant","iconColor","hasArrow","rest","buttonWrapperClasses","classNames","buttonStyles","buttonClasses","buttonTextClasses","diagonalClasses","useEffect","isTest","isProd","renderIcon","iconElement","iconSize","iconClassName","color","renderButtonContent","renderbuttonContentWrapper","Icon","ArrowRight","AnalyticsId","Button$1"],"mappings":"yoBA8DA,MAAMA,GAAe,CACnBC,EACAC,EACAC,EACAC,EACAC,EACAC,IAEIA,GAAUH,EACL,CAACE,GAAUJ,EAAOM,EAAS,UAAYL,EAAmB,IAAN,GAAS,EAAIK,EAAS,OAAO,EAEtFJ,EACK,CAACE,GAAUJ,EAAOM,EAAS,UAAW,GAAG,EAAI,GAAGA,EAAS,OAAO,CAAC,KAErEN,GAAQ,CAACI,GAAY,CAACJ,GAAQI,EAC1B,QAGFD,IAAY,SAAWG,EAAS,YAAa,GAAG,EAAIA,EAAS,SAAU,GAAG,EAE7EC,EAAmB,CAACC,EAAgBH,IACpCA,GAAUG,EAAcC,EAAS,MACjCD,EAAcC,EAAS,OACpBA,EAAS,OAGZC,GAAoB,CAACC,EAAmBC,EAA+BC,IAAoB,CAC/F,GAAIA,GAAUF,IAAaC,IAAc,QAAaA,IAAc,IAC5D,MAAA,IAAI,MAAM,yEAAyE,CAE7F,EAEME,GAASC,EAAM,WAAW,SAC9BC,EACAC,EACA,CACM,KAAA,CACJ,UAAAL,EACA,GAAAM,EACA,SAAAC,EACA,iBAAAC,EACA,UAAAC,EACA,MAAAC,EAAQ,GACR,QAAAnB,EAAU,SACV,SAAAD,EAAW,GACX,SAAAqB,EAAW,GACX,MAAAC,EAAQ,GACR,WAAAC,EAAa,SACb,KAAAC,EAAO,UACP,OAAAC,EACA,QAAAC,EACA,KAAAC,EAAO,SACP,QAAAC,EAAU,OACV,KAAAC,EACA,SAAAC,EACA,OAAAC,EACA,OAAAC,EACA,KAAAC,EAAO,SACP,GAAGC,CACD,EAAApB,EAEE,CAACqB,EAAUC,EAAWC,CAAY,EAAIC,GAASzB,EAAM,SAAS,QAAQI,CAAQ,CAAC,EAC/E,C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AAA,cAAAA,EAAA,SAAA,KACGU,IAAe,UACdV,EAAA,cAAC,SAAA,CACC,GAAAG,EACA,OAAAS,EACA,QAAAC,EACA,SAAA1B,EACA,cAAa+B,EACb,mBAAkB0C,EAAY,OAC9B,UAAWlB,EACX,IAAKhB,EACL,SAAAT,EACA,KAAAG,EACC,GAAGqB,CAAA,EAEHgB,EAA2B,CAAA,EAG/B/C,IAAe,KACdV,EAAA,cAAC,IAAA,CACC,GAAAG,EACA,OAAAS,EACA,QAAAC,EACA,cAAaK,EACb,mBAAkB0C,EAAY,OAC9B,UAAWlB,EACX,KAAA1B,EACA,OAAAG,EACA,IAAKA,IAAW,SAAW,sBAAwBlB,EAAM,IACzD,IAAKyB,EACL,SAAAT,EACC,GAAGI,CAAA,EAEHoC,EAA2B,CAAA,CAGlC,CAEJ,CAAC,EAEDI,GAAe9D"}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,26 @@
|
|
|
1
|
+
## [5.12.0](https://github.com/helsenorge/designsystem/branchCompare?baseVersion=GTv5.11.0&targetVersion=GTv5.12.0) (2024-01-04)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
- datepicker eksporterer funksjoner riktig
|
|
6
|
+
([46285e5](https://github.com/helsenorge/designsystem/commit/46285e5e4cacf0f1fa224fcaa42eb75b73ce24e1)), closes
|
|
7
|
+
[#315273](https://github.com/helsenorge/designsystem/issues/315273)
|
|
8
|
+
- justert fontstørrelse på legend i form
|
|
9
|
+
([afd858b](https://github.com/helsenorge/designsystem/commit/afd858b850330bb13d0dca6b11aae50f7e1cd17c)), closes
|
|
10
|
+
[#316149](https://github.com/helsenorge/designsystem/issues/316149)
|
|
11
|
+
- sentrere tekst på notificationpanel
|
|
12
|
+
([5188c22](https://github.com/helsenorge/designsystem/commit/5188c22bbdd920479655eab87dd19657b84ed27e)), closes
|
|
13
|
+
[#311338](https://github.com/helsenorge/designsystem/issues/311338)
|
|
14
|
+
|
|
15
|
+
## [5.11.0](https://github.com/helsenorge/designsystem/branchCompare?baseVersion=GTv5.10.0&targetVersion=GTv5.11.0) (2023-12-18)
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
- justeringer på button ([927e486](https://github.com/helsenorge/designsystem/commit/927e486876be4cbe2bb6c9b6d022e032439a2a11)), closes
|
|
20
|
+
[#308138](https://github.com/helsenorge/designsystem/issues/308138)
|
|
21
|
+
- oppdatert metadata til ikoner ([3b3510b](https://github.com/helsenorge/designsystem/commit/3b3510bb19da59156adb077e15137eb855cb1722)),
|
|
22
|
+
closes [#316105](https://github.com/helsenorge/designsystem/issues/316105)
|
|
23
|
+
|
|
1
24
|
## [5.10.0](https://github.com/helsenorge/designsystem/branchCompare?baseVersion=GTv5.9.2&targetVersion=GTv5.10.0) (2023-12-13)
|
|
2
25
|
|
|
3
26
|
### Features
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,cAAc,EAAqB,MAAM,OAAO,CAAC;AAKjE,OAAO,EAAE,eAAe,EAAE,eAAe,EAAe,MAAM,iBAAiB,CAAC;AAYhF,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,aAAa,CAAC;AACrD,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,SAAS,GAAG,YAAY,CAAC;AAC9D,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,OAAO,CAAC;AAC5C,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,QAAQ,CAAC;AAC9C,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,GAAG,CAAC;AAExC,MAAM,WAAW,WAAY,SAAQ,eAAe,EAAE,eAAe,EAAE,cAAc;IACnF,mFAAmF;IACnF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sCAAsC;IACtC,EAAE,CAAC,EAAE,MAAM,CAA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C,aAAa,CAAC,gBAAgB,CAAC,GAAG,IAAI,KAAK,IAAI,CAAC;IACvI,uGAAuG;IACvG,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,uDAAuD;IACvD,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,uFAAuF;IACvF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,sCAAsC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mCAAmC;IACnC,IAAI,CAAC,EAAE,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;CAC9D;AAkCD,QAAA,MAAM,MAAM,2GAkKV,CAAC;AAEH,eAAe,MAAM,CAAC"}
|
|
@@ -293,6 +293,7 @@ $with-icons: // icon-class, size-class, padding-left, padding-right, padding-lef
|
|
|
293
293
|
/* stylelint-disable-next-line */
|
|
294
294
|
&--borderless {
|
|
295
295
|
border-radius: 0;
|
|
296
|
+
|
|
296
297
|
&:hover {
|
|
297
298
|
box-shadow: none;
|
|
298
299
|
}
|
|
@@ -314,6 +315,10 @@ $with-icons: // icon-class, size-class, padding-left, padding-right, padding-lef
|
|
|
314
315
|
&__text {
|
|
315
316
|
color: $white;
|
|
316
317
|
margin: 0 auto 0 0;
|
|
318
|
+
position: relative;
|
|
319
|
+
display: flex;
|
|
320
|
+
align-items: center;
|
|
321
|
+
justify-content: center;
|
|
317
322
|
|
|
318
323
|
@media (min-width: map.get($grid-breakpoints, md)) {
|
|
319
324
|
margin: 0 auto 0 0;
|
|
@@ -352,13 +357,16 @@ $with-icons: // icon-class, size-class, padding-left, padding-right, padding-lef
|
|
|
352
357
|
|
|
353
358
|
.diagonal {
|
|
354
359
|
display: block;
|
|
355
|
-
transform: matrix(-1, 0, 0, 1,
|
|
360
|
+
transform: matrix(-1, 0, 0, 1, -8, 2);
|
|
361
|
+
position: absolute;
|
|
362
|
+
width: 3.7rem;
|
|
363
|
+
height: 2.25rem;
|
|
356
364
|
|
|
357
365
|
&__line {
|
|
358
366
|
display: block;
|
|
359
367
|
border-bottom: getSpacer(4xs) dashed $neutral500;
|
|
360
368
|
transform-origin: top left;
|
|
361
|
-
|
|
369
|
+
transform: rotate(37.4deg);
|
|
362
370
|
}
|
|
363
371
|
|
|
364
372
|
&--on-dark &__line {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
@import '../../scss/spacers';
|
|
2
2
|
@import '../../scss/breakpoints';
|
|
3
3
|
@import '../../scss/palette';
|
|
4
|
-
@import '../../scss/
|
|
4
|
+
@import '../../scss/title';
|
|
5
5
|
|
|
6
6
|
.form-group-wrapper {
|
|
7
7
|
&__title {
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
&__legend {
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
@include legend;
|
|
29
|
+
|
|
30
30
|
margin-bottom: getSpacer(m);
|
|
31
31
|
margin-top: 0;
|
|
32
32
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"props":{"toString":{"defaultValue":{},"description":"Returns a string representation of a string.\nReturns a string representation of an object.\n@param radix Specifies a radix for converting numeric values to strings. This value is only used for numbers.","name":"toString","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"Number"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"Object"}],"required":false,"type":{"name":"(() => string) | ((radix?: number) => string) | (() => string)"}},"charAt":{"defaultValue":null,"description":"Returns the character at the specified index.\n@param pos The zero-based index of the desired character.","name":"charAt","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"}],"required":true,"type":{"name":"(pos: number) => string"}},"charCodeAt":{"defaultValue":null,"description":"Returns the Unicode value of the character at the specified location.\n@param index The zero-based index of the desired character. If there is no character at the specified index, NaN is returned.","name":"charCodeAt","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"}],"required":true,"type":{"name":"(index: number) => number"}},"concat":{"defaultValue":null,"description":"Returns a string that contains the concatenation of two or more strings.\n@param strings The strings to append to the end of the string.","name":"concat","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"}],"required":true,"type":{"name":"(...strings: string[]) => string"}},"indexOf":{"defaultValue":null,"description":"Returns the position of the first occurrence of a substring.\n@param searchString The substring to search for in the string\n@param position The index at which to begin searching the String object. If omitted, search starts at the beginning of the string.","name":"indexOf","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"}],"required":true,"type":{"name":"(searchString: string, position?: number | undefined) => number"}},"lastIndexOf":{"defaultValue":null,"description":"Returns the last occurrence of a substring in the string.\n@param searchString The substring to search for.\n@param position The index at which to begin searching. If omitted, the search begins at the end of the string.","name":"lastIndexOf","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"}],"required":true,"type":{"name":"(searchString: string, position?: number | undefined) => number"}},"localeCompare":{"defaultValue":null,"description":"Determines whether two strings are equivalent in the current locale.\nDetermines whether two strings are equivalent in the current or specified locale.\n@param that String to compare to target string\n@param that String to compare to target string\n@param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. This parameter must conform to BCP 47 standards; see the Intl.Collator object for details.\n@param options An object that contains one or more properties that specify comparison options. see the Intl.Collator object for details.","name":"localeCompare","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"}],"required":true,"type":{"name":"{ (that: string): number; (that: string, locales?: string | string[] | undefined, options?: CollatorOptions | undefined): number; }"}},"match":{"defaultValue":null,"description":"Matches a string with a regular expression, and returns an array containing the results of that search.\nMatches a string or an object that supports being matched against, and returns an array\ncontaining the results of that search, or null if no matches are found.\n@param regexp A variable name or string literal containing the regular expression pattern and flags.\n@param matcher An object that supports being matched against.","name":"match","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","name":"String"}],"required":true,"type":{"name":"{ (regexp: string | RegExp): RegExpMatchArray | null; (matcher: { [Symbol.match](string: string): RegExpMatchArray | null; }): RegExpMatchArray | null; }"}},"replace":{"defaultValue":null,"description":"Replaces text in a string, using a regular expression or search string.\nPasses a string and {@linkcode replaceValue} to the `[Symbol.replace]` method on {@linkcode searchValue}. This method is expected to implement its own replacement algorithm.\nReplaces text in a string, using an object that supports replacement within a string.\n@param searchValue A string or regular expression to search for.\n@param replaceValue A string containing the text to replace. When the {@linkcode searchValue } is a `RegExp`, all matches are replaced if the `g` flag is set (or only those matches at the beginning, if the `y` flag is also present). Otherwise, only the first match of {@linkcode searchValue } is replaced.\n@param searchValue A string to search for.\n@param replacer A function that returns the replacement text.\n@param searchValue An object that supports searching for and replacing matches within a string.\n@param replaceValue The replacement text.\n@param searchValue A object can search for and replace matches within a string.\n@param replacer A function that returns the replacement text.","name":"replace","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","name":"String"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","name":"String"}],"required":true,"type":{"name":"{ (searchValue: string | RegExp, replaceValue: string): string; (searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string; (searchValue: { ...; }, replaceValue: string): string; (searchValue: { ...; }, replacer: (substring: string, ...args: any[]) => string): string; }"}},"search":{"defaultValue":null,"description":"Finds the first substring match in a regular expression search.\n@param regexp The regular expression pattern and applicable flags.\n@param searcher An object which supports searching within a string.","name":"search","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","name":"String"}],"required":true,"type":{"name":"{ (regexp: string | RegExp): number; (searcher: { [Symbol.search](string: string): number; }): number; }"}},"slice":{"defaultValue":null,"description":"Returns a section of a string.\n@param start The index to the beginning of the specified portion of stringObj.\n@param end The index to the end of the specified portion of stringObj. The substring includes the characters up to, but not including, the character indicated by end.\nIf this value is not specified, the substring continues to the end of stringObj.","name":"slice","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"}],"required":true,"type":{"name":"(start?: number | undefined, end?: number | undefined) => string"}},"split":{"defaultValue":null,"description":"Split a string into substrings using the specified separator and return them as an array.\n@param separator A string that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned.\n@param limit A value used to limit the number of elements returned in the array.\n@param splitter An object that can split a string.\n@param limit A value used to limit the number of elements returned in the array.","name":"split","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","name":"String"}],"required":true,"type":{"name":"{ (separator: string | RegExp, limit?: number | undefined): string[]; (splitter: { [Symbol.split](string: string, limit?: number | undefined): string[]; }, limit?: number | undefined): string[]; }"}},"substring":{"defaultValue":null,"description":"Returns the substring at the specified location within a String object.\n@param start The zero-based index number indicating the beginning of the substring.\n@param end Zero-based index number indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end.\nIf end is omitted, the characters from start through the end of the original string are returned.","name":"substring","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"}],"required":true,"type":{"name":"(start: number, end?: number | undefined) => string"}},"toLowerCase":{"defaultValue":null,"description":"Converts all the alphabetic characters in a string to lowercase.","name":"toLowerCase","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"}],"required":true,"type":{"name":"() => string"}},"toLocaleLowerCase":{"defaultValue":null,"description":"Converts all alphabetic characters to lowercase, taking into account the host environment's current locale.","name":"toLocaleLowerCase","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"}],"required":true,"type":{"name":"(locales?: string | string[] | undefined) => string"}},"toUpperCase":{"defaultValue":null,"description":"Converts all the alphabetic characters in a string to uppercase.","name":"toUpperCase","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"}],"required":true,"type":{"name":"() => string"}},"toLocaleUpperCase":{"defaultValue":null,"description":"Returns a string where all alphabetic characters have been converted to uppercase, taking into account the host environment's current locale.","name":"toLocaleUpperCase","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"}],"required":true,"type":{"name":"(locales?: string | string[] | undefined) => string"}},"trim":{"defaultValue":null,"description":"Removes the leading and trailing white space and line terminator characters from a string.","name":"trim","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"}],"required":true,"type":{"name":"() => string"}},"length":{"defaultValue":null,"description":"Returns the length of a String object.","name":"length","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"}],"required":true,"type":{"name":"number"}},"substr":{"defaultValue":null,"description":"Gets a substring beginning at the specified location and having the specified length.\n@deprecated A legacy feature for browser compatibility\n@param from The starting position of the desired substring. The index of the first character in the string is zero.\n@param length The number of characters to include in the returned substring.","name":"substr","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"}],"required":true,"type":{"name":"(from: number, length?: number | undefined) => string"}},"valueOf":{"defaultValue":{},"description":"Returns the primitive value of the specified object.","name":"valueOf","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"Number"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"Boolean"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"Object"}],"required":false,"type":{"name":"(() => string) | (() => number) | (() => boolean) | (() => Object)"}},"codePointAt":{"defaultValue":null,"description":"Returns a nonnegative integer Number less than 1114112 (0x110000) that is the code point\nvalue of the UTF-16 encoded code point starting at the string element at position pos in\nthe String resulting from converting this object to a String.\nIf there is no element at that position, the result is undefined.\nIf a valid UTF-16 surrogate pair does not begin at pos, the result is the code unit at pos.","name":"codePointAt","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"(pos: number) => number | undefined"}},"includes":{"defaultValue":null,"description":"Returns true if searchString appears as a substring of the result of converting this\nobject to a String, at one or more positions that are\ngreater than or equal to position; otherwise, returns false.\n@param searchString search string\n@param position If position is undefined, 0 is assumed, so as to search all of the String.","name":"includes","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"(searchString: string, position?: number | undefined) => boolean"}},"endsWith":{"defaultValue":null,"description":"Returns true if the sequence of elements of searchString converted to a String is the\nsame as the corresponding elements of this object (converted to a String) starting at\nendPosition – length(this). Otherwise returns false.","name":"endsWith","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"(searchString: string, endPosition?: number | undefined) => boolean"}},"normalize":{"defaultValue":null,"description":"Returns the String value result of normalizing the string into the normalization form\nnamed by form as specified in Unicode Standard Annex #15, Unicode Normalization Forms.\n@param form Applicable values: \"NFC\", \"NFD\", \"NFKC\", or \"NFKD\", If not specified default\nis \"NFC\"\n@param form Applicable values: \"NFC\", \"NFD\", \"NFKC\", or \"NFKD\", If not specified default\nis \"NFC\"","name":"normalize","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"{ (form: \"NFC\" | \"NFD\" | \"NFKC\" | \"NFKD\"): string; (form?: string | undefined): string; }"}},"repeat":{"defaultValue":null,"description":"Returns a String value that is made from count copies appended together. If count is 0,\nthe empty string is returned.\n@param count number of copies to append","name":"repeat","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"(count: number) => string"}},"startsWith":{"defaultValue":null,"description":"Returns true if the sequence of elements of searchString converted to a String is the\nsame as the corresponding elements of this object (converted to a String) starting at\nposition. Otherwise returns false.","name":"startsWith","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"(searchString: string, position?: number | undefined) => boolean"}},"anchor":{"defaultValue":null,"description":"Returns an `<a>` HTML anchor element and sets the name attribute to the text value\n@deprecated A legacy feature for browser compatibility\n@param name","name":"anchor","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"(name: string) => string"}},"big":{"defaultValue":null,"description":"Returns a `<big>` HTML element\n@deprecated A legacy feature for browser compatibility","name":"big","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"() => string"}},"blink":{"defaultValue":null,"description":"Returns a `<blink>` HTML element\n@deprecated A legacy feature for browser compatibility","name":"blink","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"() => string"}},"bold":{"defaultValue":null,"description":"Returns a `<b>` HTML element\n@deprecated A legacy feature for browser compatibility","name":"bold","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"() => string"}},"fixed":{"defaultValue":null,"description":"Returns a `<tt>` HTML element\n@deprecated A legacy feature for browser compatibility","name":"fixed","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"() => string"}},"fontcolor":{"defaultValue":null,"description":"Returns a `<font>` HTML element and sets the color attribute value\n@deprecated A legacy feature for browser compatibility","name":"fontcolor","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"(color: string) => string"}},"fontsize":{"defaultValue":null,"description":"Returns a `<font>` HTML element and sets the size attribute value\n@deprecated A legacy feature for browser compatibility\n@deprecated A legacy feature for browser compatibility","name":"fontsize","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"{ (size: number): string; (size: string): string; }"}},"italics":{"defaultValue":null,"description":"Returns an `<i>` HTML element\n@deprecated A legacy feature for browser compatibility","name":"italics","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"() => string"}},"link":{"defaultValue":null,"description":"Returns an `<a>` HTML element and sets the href attribute value\n@deprecated A legacy feature for browser compatibility","name":"link","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"(url: string) => string"}},"small":{"defaultValue":null,"description":"Returns a `<small>` HTML element\n@deprecated A legacy feature for browser compatibility","name":"small","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"() => string"}},"strike":{"defaultValue":null,"description":"Returns a `<strike>` HTML element\n@deprecated A legacy feature for browser compatibility","name":"strike","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"() => string"}},"sub":{"defaultValue":null,"description":"Returns a `<sub>` HTML element\n@deprecated A legacy feature for browser compatibility","name":"sub","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"() => string"}},"sup":{"defaultValue":null,"description":"Returns a `<sup>` HTML element\n@deprecated A legacy feature for browser compatibility","name":"sup","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"() => string"}},"padStart":{"defaultValue":null,"description":"Pads the current string with a given string (possibly repeated) so that the resulting string reaches a given length.\nThe padding is applied from the start (left) of the current string.\n@param maxLength The length of the resulting string once the current string has been padded.\nIf this parameter is smaller than the current string's length, the current string will be returned as it is.\n@param fillString The string to pad the current string with.\nIf this string is too long, it will be truncated and the left-most part will be applied.\nThe default value for this parameter is \" \" (U+0020).","name":"padStart","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2017.string.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2017.string.d.ts","name":"String"}],"required":true,"type":{"name":"(maxLength: number, fillString?: string | undefined) => string"}},"padEnd":{"defaultValue":null,"description":"Pads the current string with a given string (possibly repeated) so that the resulting string reaches a given length.\nThe padding is applied from the end (right) of the current string.\n@param maxLength The length of the resulting string once the current string has been padded.\nIf this parameter is smaller than the current string's length, the current string will be returned as it is.\n@param fillString The string to pad the current string with.\nIf this string is too long, it will be truncated and the left-most part will be applied.\nThe default value for this parameter is \" \" (U+0020).","name":"padEnd","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2017.string.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2017.string.d.ts","name":"String"}],"required":true,"type":{"name":"(maxLength: number, fillString?: string | undefined) => string"}},"trimEnd":{"defaultValue":null,"description":"Removes the trailing white space and line terminator characters from a string.","name":"trimEnd","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2019.string.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2019.string.d.ts","name":"String"}],"required":true,"type":{"name":"() => string"}},"trimStart":{"defaultValue":null,"description":"Removes the leading white space and line terminator characters from a string.","name":"trimStart","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2019.string.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2019.string.d.ts","name":"String"}],"required":true,"type":{"name":"() => string"}},"trimLeft":{"defaultValue":null,"description":"Removes the leading white space and line terminator characters from a string.\n@deprecated A legacy feature for browser compatibility. Use `trimStart` instead","name":"trimLeft","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2019.string.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2019.string.d.ts","name":"String"}],"required":true,"type":{"name":"() => string"}},"trimRight":{"defaultValue":null,"description":"Removes the trailing white space and line terminator characters from a string.\n@deprecated A legacy feature for browser compatibility. Use `trimEnd` instead","name":"trimRight","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2019.string.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2019.string.d.ts","name":"String"}],"required":true,"type":{"name":"() => string"}},"matchAll":{"defaultValue":null,"description":"Matches a string with a regular expression, and returns an iterable of matches\ncontaining the results of that search.\n@param regexp A variable name or string literal containing the regular expression pattern and flags.","name":"matchAll","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2020.string.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2020.string.d.ts","name":"String"}],"required":true,"type":{"name":"(regexp: RegExp) => IterableIterator<RegExpMatchArray>"}},"replaceAll":{"defaultValue":null,"description":"Replace all instances of a substring in a string, using a regular expression or search string.\n@param searchValue A string to search for.\n@param replaceValue A string containing the text to replace for every successful match of searchValue in this string.\n@param searchValue A string to search for.\n@param replacer A function that returns the replacement text.","name":"replaceAll","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2021.string.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2021.string.d.ts","name":"String"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es2021.string.d.ts","name":"String"}],"required":true,"type":{"name":"{ (searchValue: string | RegExp, replaceValue: string): string; (searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string; }"}},"at":{"defaultValue":null,"description":"Returns a new String consisting of the single UTF-16 code unit located at the specified index.\n@param index The zero-based index of the desired code unit. A negative index will count back from the last item.","name":"at","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2022.string.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2022.string.d.ts","name":"String"}],"required":true,"type":{"name":"(index: number) => string | undefined"}},"__@iterator@6206":{"defaultValue":null,"description":"Iterator","name":"__@iterator@6206","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.iterable.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.iterable.d.ts","name":"String"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.iterable.d.ts","name":"Iterable"}],"required":true,"type":{"name":"(() => IterableIterator<string>) | (() => Iterator<ReactNode, any, undefined>)"}},"toFixed":{"defaultValue":null,"description":"Returns a string representing a number in fixed-point notation.\n@param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive.","name":"toFixed","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"Number"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"Number"}],"required":true,"type":{"name":"(fractionDigits?: number | undefined) => string"}},"toExponential":{"defaultValue":null,"description":"Returns a string containing a number represented in exponential notation.\n@param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive.","name":"toExponential","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"Number"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"Number"}],"required":true,"type":{"name":"(fractionDigits?: number | undefined) => string"}},"toPrecision":{"defaultValue":null,"description":"Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.\n@param precision Number of significant digits. Must be in the range 1 - 21, inclusive.","name":"toPrecision","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"Number"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"Number"}],"required":true,"type":{"name":"(precision?: number | undefined) => string"}},"toLocaleString":{"defaultValue":{},"description":"Returns a date converted to a string using the current locale.\nConverts a number to a string by using the current or specified locale.\n@param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.\n@param options An object that contains one or more properties that specify comparison options.\n@param locales A locale string, array of locale strings, Intl.Locale object, or array of Intl.Locale objects that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.\n@param options An object that contains one or more properties that specify comparison options.","name":"toLocaleString","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"Object"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"Object"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"Number"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es2020.number.d.ts","name":"Number"}],"required":false,"type":{"name":"(() => string) | { (locales?: string | string[], options?: NumberFormatOptions): string; (locales?: LocalesArgument, options?: NumberFormatOptions | undefined): string; }"}},"type":{"defaultValue":null,"description":"","name":"type","parent":{"fileName":"designsystem/node_modules/@types/react/index.d.ts","name":"ReactElement"},"declarations":[{"fileName":"designsystem/node_modules/@types/react/index.d.ts","name":"ReactElement"}],"required":true,"type":{"name":"string | JSXElementConstructor<any>"}},"props":{"defaultValue":null,"description":"","name":"props","parent":{"fileName":"designsystem/node_modules/@types/react/index.d.ts","name":"ReactElement"},"declarations":[{"fileName":"designsystem/node_modules/@types/react/index.d.ts","name":"ReactElement"}],"required":true,"type":{"name":"any"}}}}
|
|
1
|
+
{"props":{"toString":{"defaultValue":{},"description":"Returns a string representation of a string.\nReturns a string representation of an object.\n@param radix Specifies a radix for converting numeric values to strings. This value is only used for numbers.","name":"toString","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"Number"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"Object"}],"required":false,"type":{"name":"(() => string) | ((radix?: number) => string) | (() => string)"}},"charAt":{"defaultValue":null,"description":"Returns the character at the specified index.\n@param pos The zero-based index of the desired character.","name":"charAt","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"}],"required":true,"type":{"name":"(pos: number) => string"}},"charCodeAt":{"defaultValue":null,"description":"Returns the Unicode value of the character at the specified location.\n@param index The zero-based index of the desired character. If there is no character at the specified index, NaN is returned.","name":"charCodeAt","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"}],"required":true,"type":{"name":"(index: number) => number"}},"concat":{"defaultValue":null,"description":"Returns a string that contains the concatenation of two or more strings.\n@param strings The strings to append to the end of the string.","name":"concat","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"}],"required":true,"type":{"name":"(...strings: string[]) => string"}},"indexOf":{"defaultValue":null,"description":"Returns the position of the first occurrence of a substring.\n@param searchString The substring to search for in the string\n@param position The index at which to begin searching the String object. If omitted, search starts at the beginning of the string.","name":"indexOf","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"}],"required":true,"type":{"name":"(searchString: string, position?: number | undefined) => number"}},"lastIndexOf":{"defaultValue":null,"description":"Returns the last occurrence of a substring in the string.\n@param searchString The substring to search for.\n@param position The index at which to begin searching. If omitted, the search begins at the end of the string.","name":"lastIndexOf","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"}],"required":true,"type":{"name":"(searchString: string, position?: number | undefined) => number"}},"localeCompare":{"defaultValue":null,"description":"Determines whether two strings are equivalent in the current locale.\nDetermines whether two strings are equivalent in the current or specified locale.\n@param that String to compare to target string\n@param that String to compare to target string\n@param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. This parameter must conform to BCP 47 standards; see the Intl.Collator object for details.\n@param options An object that contains one or more properties that specify comparison options. see the Intl.Collator object for details.","name":"localeCompare","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"}],"required":true,"type":{"name":"{ (that: string): number; (that: string, locales?: string | string[] | undefined, options?: CollatorOptions | undefined): number; }"}},"match":{"defaultValue":null,"description":"Matches a string with a regular expression, and returns an array containing the results of that search.\nMatches a string or an object that supports being matched against, and returns an array\ncontaining the results of that search, or null if no matches are found.\n@param regexp A variable name or string literal containing the regular expression pattern and flags.\n@param matcher An object that supports being matched against.","name":"match","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","name":"String"}],"required":true,"type":{"name":"{ (regexp: string | RegExp): RegExpMatchArray | null; (matcher: { [Symbol.match](string: string): RegExpMatchArray | null; }): RegExpMatchArray | null; }"}},"replace":{"defaultValue":null,"description":"Replaces text in a string, using a regular expression or search string.\nPasses a string and {@linkcode replaceValue} to the `[Symbol.replace]` method on {@linkcode searchValue}. This method is expected to implement its own replacement algorithm.\nReplaces text in a string, using an object that supports replacement within a string.\n@param searchValue A string or regular expression to search for.\n@param replaceValue A string containing the text to replace. When the {@linkcode searchValue } is a `RegExp`, all matches are replaced if the `g` flag is set (or only those matches at the beginning, if the `y` flag is also present). Otherwise, only the first match of {@linkcode searchValue } is replaced.\n@param searchValue A string to search for.\n@param replacer A function that returns the replacement text.\n@param searchValue An object that supports searching for and replacing matches within a string.\n@param replaceValue The replacement text.\n@param searchValue A object can search for and replace matches within a string.\n@param replacer A function that returns the replacement text.","name":"replace","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","name":"String"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","name":"String"}],"required":true,"type":{"name":"{ (searchValue: string | RegExp, replaceValue: string): string; (searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string; (searchValue: { ...; }, replaceValue: string): string; (searchValue: { ...; }, replacer: (substring: string, ...args: any[]) => string): string; }"}},"search":{"defaultValue":null,"description":"Finds the first substring match in a regular expression search.\n@param regexp The regular expression pattern and applicable flags.\n@param searcher An object which supports searching within a string.","name":"search","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","name":"String"}],"required":true,"type":{"name":"{ (regexp: string | RegExp): number; (searcher: { [Symbol.search](string: string): number; }): number; }"}},"slice":{"defaultValue":null,"description":"Returns a section of a string.\n@param start The index to the beginning of the specified portion of stringObj.\n@param end The index to the end of the specified portion of stringObj. The substring includes the characters up to, but not including, the character indicated by end.\nIf this value is not specified, the substring continues to the end of stringObj.","name":"slice","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"}],"required":true,"type":{"name":"(start?: number | undefined, end?: number | undefined) => string"}},"split":{"defaultValue":null,"description":"Split a string into substrings using the specified separator and return them as an array.\n@param separator A string that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned.\n@param limit A value used to limit the number of elements returned in the array.\n@param splitter An object that can split a string.\n@param limit A value used to limit the number of elements returned in the array.","name":"split","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","name":"String"}],"required":true,"type":{"name":"{ (separator: string | RegExp, limit?: number | undefined): string[]; (splitter: { [Symbol.split](string: string, limit?: number | undefined): string[]; }, limit?: number | undefined): string[]; }"}},"substring":{"defaultValue":null,"description":"Returns the substring at the specified location within a String object.\n@param start The zero-based index number indicating the beginning of the substring.\n@param end Zero-based index number indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end.\nIf end is omitted, the characters from start through the end of the original string are returned.","name":"substring","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"}],"required":true,"type":{"name":"(start: number, end?: number | undefined) => string"}},"toLowerCase":{"defaultValue":null,"description":"Converts all the alphabetic characters in a string to lowercase.","name":"toLowerCase","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"}],"required":true,"type":{"name":"() => string"}},"toLocaleLowerCase":{"defaultValue":null,"description":"Converts all alphabetic characters to lowercase, taking into account the host environment's current locale.","name":"toLocaleLowerCase","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"}],"required":true,"type":{"name":"(locales?: string | string[] | undefined) => string"}},"toUpperCase":{"defaultValue":null,"description":"Converts all the alphabetic characters in a string to uppercase.","name":"toUpperCase","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"}],"required":true,"type":{"name":"() => string"}},"toLocaleUpperCase":{"defaultValue":null,"description":"Returns a string where all alphabetic characters have been converted to uppercase, taking into account the host environment's current locale.","name":"toLocaleUpperCase","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"}],"required":true,"type":{"name":"(locales?: string | string[] | undefined) => string"}},"trim":{"defaultValue":null,"description":"Removes the leading and trailing white space and line terminator characters from a string.","name":"trim","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"}],"required":true,"type":{"name":"() => string"}},"length":{"defaultValue":null,"description":"Returns the length of a String object.","name":"length","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"}],"required":true,"type":{"name":"number"}},"substr":{"defaultValue":null,"description":"Gets a substring beginning at the specified location and having the specified length.\n@deprecated A legacy feature for browser compatibility\n@param from The starting position of the desired substring. The index of the first character in the string is zero.\n@param length The number of characters to include in the returned substring.","name":"substr","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"}],"required":true,"type":{"name":"(from: number, length?: number | undefined) => string"}},"valueOf":{"defaultValue":{},"description":"Returns the primitive value of the specified object.","name":"valueOf","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"Number"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"Boolean"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"Object"}],"required":false,"type":{"name":"(() => string) | (() => number) | (() => boolean) | (() => Object)"}},"codePointAt":{"defaultValue":null,"description":"Returns a nonnegative integer Number less than 1114112 (0x110000) that is the code point\nvalue of the UTF-16 encoded code point starting at the string element at position pos in\nthe String resulting from converting this object to a String.\nIf there is no element at that position, the result is undefined.\nIf a valid UTF-16 surrogate pair does not begin at pos, the result is the code unit at pos.","name":"codePointAt","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"(pos: number) => number | undefined"}},"includes":{"defaultValue":null,"description":"Returns true if searchString appears as a substring of the result of converting this\nobject to a String, at one or more positions that are\ngreater than or equal to position; otherwise, returns false.\n@param searchString search string\n@param position If position is undefined, 0 is assumed, so as to search all of the String.","name":"includes","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"(searchString: string, position?: number | undefined) => boolean"}},"endsWith":{"defaultValue":null,"description":"Returns true if the sequence of elements of searchString converted to a String is the\nsame as the corresponding elements of this object (converted to a String) starting at\nendPosition – length(this). Otherwise returns false.","name":"endsWith","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"(searchString: string, endPosition?: number | undefined) => boolean"}},"normalize":{"defaultValue":null,"description":"Returns the String value result of normalizing the string into the normalization form\nnamed by form as specified in Unicode Standard Annex #15, Unicode Normalization Forms.\n@param form Applicable values: \"NFC\", \"NFD\", \"NFKC\", or \"NFKD\", If not specified default\nis \"NFC\"\n@param form Applicable values: \"NFC\", \"NFD\", \"NFKC\", or \"NFKD\", If not specified default\nis \"NFC\"","name":"normalize","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"{ (form: \"NFC\" | \"NFD\" | \"NFKC\" | \"NFKD\"): string; (form?: string | undefined): string; }"}},"repeat":{"defaultValue":null,"description":"Returns a String value that is made from count copies appended together. If count is 0,\nthe empty string is returned.\n@param count number of copies to append","name":"repeat","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"(count: number) => string"}},"startsWith":{"defaultValue":null,"description":"Returns true if the sequence of elements of searchString converted to a String is the\nsame as the corresponding elements of this object (converted to a String) starting at\nposition. Otherwise returns false.","name":"startsWith","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"(searchString: string, position?: number | undefined) => boolean"}},"anchor":{"defaultValue":null,"description":"Returns an `<a>` HTML anchor element and sets the name attribute to the text value\n@deprecated A legacy feature for browser compatibility\n@param name","name":"anchor","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"(name: string) => string"}},"big":{"defaultValue":null,"description":"Returns a `<big>` HTML element\n@deprecated A legacy feature for browser compatibility","name":"big","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"() => string"}},"blink":{"defaultValue":null,"description":"Returns a `<blink>` HTML element\n@deprecated A legacy feature for browser compatibility","name":"blink","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"() => string"}},"bold":{"defaultValue":null,"description":"Returns a `<b>` HTML element\n@deprecated A legacy feature for browser compatibility","name":"bold","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"() => string"}},"fixed":{"defaultValue":null,"description":"Returns a `<tt>` HTML element\n@deprecated A legacy feature for browser compatibility","name":"fixed","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"() => string"}},"fontcolor":{"defaultValue":null,"description":"Returns a `<font>` HTML element and sets the color attribute value\n@deprecated A legacy feature for browser compatibility","name":"fontcolor","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"(color: string) => string"}},"fontsize":{"defaultValue":null,"description":"Returns a `<font>` HTML element and sets the size attribute value\n@deprecated A legacy feature for browser compatibility\n@deprecated A legacy feature for browser compatibility","name":"fontsize","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"{ (size: number): string; (size: string): string; }"}},"italics":{"defaultValue":null,"description":"Returns an `<i>` HTML element\n@deprecated A legacy feature for browser compatibility","name":"italics","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"() => string"}},"link":{"defaultValue":null,"description":"Returns an `<a>` HTML element and sets the href attribute value\n@deprecated A legacy feature for browser compatibility","name":"link","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"(url: string) => string"}},"small":{"defaultValue":null,"description":"Returns a `<small>` HTML element\n@deprecated A legacy feature for browser compatibility","name":"small","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"() => string"}},"strike":{"defaultValue":null,"description":"Returns a `<strike>` HTML element\n@deprecated A legacy feature for browser compatibility","name":"strike","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"() => string"}},"sub":{"defaultValue":null,"description":"Returns a `<sub>` HTML element\n@deprecated A legacy feature for browser compatibility","name":"sub","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"() => string"}},"sup":{"defaultValue":null,"description":"Returns a `<sup>` HTML element\n@deprecated A legacy feature for browser compatibility","name":"sup","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"() => string"}},"padStart":{"defaultValue":null,"description":"Pads the current string with a given string (possibly repeated) so that the resulting string reaches a given length.\nThe padding is applied from the start (left) of the current string.\n@param maxLength The length of the resulting string once the current string has been padded.\nIf this parameter is smaller than the current string's length, the current string will be returned as it is.\n@param fillString The string to pad the current string with.\nIf this string is too long, it will be truncated and the left-most part will be applied.\nThe default value for this parameter is \" \" (U+0020).","name":"padStart","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2017.string.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2017.string.d.ts","name":"String"}],"required":true,"type":{"name":"(maxLength: number, fillString?: string | undefined) => string"}},"padEnd":{"defaultValue":null,"description":"Pads the current string with a given string (possibly repeated) so that the resulting string reaches a given length.\nThe padding is applied from the end (right) of the current string.\n@param maxLength The length of the resulting string once the current string has been padded.\nIf this parameter is smaller than the current string's length, the current string will be returned as it is.\n@param fillString The string to pad the current string with.\nIf this string is too long, it will be truncated and the left-most part will be applied.\nThe default value for this parameter is \" \" (U+0020).","name":"padEnd","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2017.string.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2017.string.d.ts","name":"String"}],"required":true,"type":{"name":"(maxLength: number, fillString?: string | undefined) => string"}},"trimEnd":{"defaultValue":null,"description":"Removes the trailing white space and line terminator characters from a string.","name":"trimEnd","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2019.string.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2019.string.d.ts","name":"String"}],"required":true,"type":{"name":"() => string"}},"trimStart":{"defaultValue":null,"description":"Removes the leading white space and line terminator characters from a string.","name":"trimStart","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2019.string.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2019.string.d.ts","name":"String"}],"required":true,"type":{"name":"() => string"}},"trimLeft":{"defaultValue":null,"description":"Removes the leading white space and line terminator characters from a string.\n@deprecated A legacy feature for browser compatibility. Use `trimStart` instead","name":"trimLeft","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2019.string.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2019.string.d.ts","name":"String"}],"required":true,"type":{"name":"() => string"}},"trimRight":{"defaultValue":null,"description":"Removes the trailing white space and line terminator characters from a string.\n@deprecated A legacy feature for browser compatibility. Use `trimEnd` instead","name":"trimRight","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2019.string.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2019.string.d.ts","name":"String"}],"required":true,"type":{"name":"() => string"}},"matchAll":{"defaultValue":null,"description":"Matches a string with a regular expression, and returns an iterable of matches\ncontaining the results of that search.\n@param regexp A variable name or string literal containing the regular expression pattern and flags.","name":"matchAll","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2020.string.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2020.string.d.ts","name":"String"}],"required":true,"type":{"name":"(regexp: RegExp) => IterableIterator<RegExpMatchArray>"}},"replaceAll":{"defaultValue":null,"description":"Replace all instances of a substring in a string, using a regular expression or search string.\n@param searchValue A string to search for.\n@param replaceValue A string containing the text to replace for every successful match of searchValue in this string.\n@param searchValue A string to search for.\n@param replacer A function that returns the replacement text.","name":"replaceAll","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2021.string.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2021.string.d.ts","name":"String"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es2021.string.d.ts","name":"String"}],"required":true,"type":{"name":"{ (searchValue: string | RegExp, replaceValue: string): string; (searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string; }"}},"at":{"defaultValue":null,"description":"Returns a new String consisting of the single UTF-16 code unit located at the specified index.\n@param index The zero-based index of the desired code unit. A negative index will count back from the last item.","name":"at","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2022.string.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2022.string.d.ts","name":"String"}],"required":true,"type":{"name":"(index: number) => string | undefined"}},"__@iterator@6216":{"defaultValue":null,"description":"Iterator","name":"__@iterator@6216","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.iterable.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.iterable.d.ts","name":"String"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.iterable.d.ts","name":"Iterable"}],"required":true,"type":{"name":"(() => IterableIterator<string>) | (() => Iterator<ReactNode, any, undefined>)"}},"toFixed":{"defaultValue":null,"description":"Returns a string representing a number in fixed-point notation.\n@param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive.","name":"toFixed","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"Number"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"Number"}],"required":true,"type":{"name":"(fractionDigits?: number | undefined) => string"}},"toExponential":{"defaultValue":null,"description":"Returns a string containing a number represented in exponential notation.\n@param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive.","name":"toExponential","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"Number"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"Number"}],"required":true,"type":{"name":"(fractionDigits?: number | undefined) => string"}},"toPrecision":{"defaultValue":null,"description":"Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.\n@param precision Number of significant digits. Must be in the range 1 - 21, inclusive.","name":"toPrecision","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"Number"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"Number"}],"required":true,"type":{"name":"(precision?: number | undefined) => string"}},"toLocaleString":{"defaultValue":{},"description":"Returns a date converted to a string using the current locale.\nConverts a number to a string by using the current or specified locale.\n@param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.\n@param options An object that contains one or more properties that specify comparison options.\n@param locales A locale string, array of locale strings, Intl.Locale object, or array of Intl.Locale objects that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.\n@param options An object that contains one or more properties that specify comparison options.","name":"toLocaleString","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"Object"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"Object"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"Number"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es2020.number.d.ts","name":"Number"}],"required":false,"type":{"name":"(() => string) | { (locales?: string | string[], options?: NumberFormatOptions): string; (locales?: LocalesArgument, options?: NumberFormatOptions | undefined): string; }"}},"type":{"defaultValue":null,"description":"","name":"type","parent":{"fileName":"designsystem/node_modules/@types/react/index.d.ts","name":"ReactElement"},"declarations":[{"fileName":"designsystem/node_modules/@types/react/index.d.ts","name":"ReactElement"}],"required":true,"type":{"name":"string | JSXElementConstructor<any>"}},"props":{"defaultValue":null,"description":"","name":"props","parent":{"fileName":"designsystem/node_modules/@types/react/index.d.ts","name":"ReactElement"},"declarations":[{"fileName":"designsystem/node_modules/@types/react/index.d.ts","name":"ReactElement"}],"required":true,"type":{"name":"any"}}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationPanel.d.ts","sourceRoot":"","sources":["../../../src/components/NotificationPanel/NotificationPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAmB1B,MAAM,MAAM,yBAAyB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;AAC9E,MAAM,MAAM,2BAA2B,GAAG,OAAO,GAAG,SAAS,CAAC;AAC9D,MAAM,MAAM,sBAAsB,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AAElE,MAAM,WAAW,sBAAsB;IACrC,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iCAAiC;IACjC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,oCAAoC;IACpC,gBAAgB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACnC,+BAA+B;IAC/B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,2CAA2C;IAC3C,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,yCAAyC;IACzC,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,mEAAmE;IACnE,OAAO,CAAC,EAAE,yBAAyB,CAAC;IACpC,oEAAoE;IACpE,cAAc,CAAC,EAAE,2BAA2B,CAAC;IAC7C,mDAAmD;IACnD,IAAI,CAAC,EAAE,sBAAsB,CAAC;IAC9B,sFAAsF;IACtF,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC;IAClE,wDAAwD;IACxD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,6EAA6E;IAC7E,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,+CAA+C;IAC/C,KAAK,CAAC,EAAE,MAAM,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WAAW,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC;IAClE,wDAAwD;IACxD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,6EAA6E;IAC7E,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,+CAA+C;IAC/C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8BAA8B;IAC9B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,8BAA8B;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,2JAA2J;IAC3J,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IAC1B,sCAAsC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAeD,QAAA,MAAM,iBAAiB,+FA4HrB,CAAC;AAEH,eAAe,iBAAiB,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import t,{useState as $}from"react";import m from"classnames";import{AnalyticsId as N,IconSize as r}from"../../constants.js";import{useUuid as I}from"../../hooks/useUuid.js";import{getAriaLabelAttributes as S}from"../../utils/accessibility.js";import{B as R}from"../../Button.js";import{Icon as _}from"../Icons/Icon.js";import D from"../Icons/ChevronDown.js";import U from"../Icons/ChevronUp.js";import f from"./DetailButton/styles.module.scss";import{getColor as M}from"../../theme/currys/color.js";import{palette as c}from"../../theme/palette.js";import{C as O}from"../../Close.js";import V from"../Icons/CheckFill.js";import W from"../Icons/ErrorSignFill.js";import j from"../Icons/InfoSignFill.js";import q from"../Icons/TriangleX.js";import e from"./styles.module.scss";import"../../uuid.js";import"../../utils/environment.js";import"../../hooks/useBreakpoint.js";import"../../theme/grid.js";import"../../hooks/useHover.js";import"../../hooks/usePseudoClasses.js";import"../../hooks/useIcons.js";import"../../hooks/useSize.js";import"../../utils/debounce.js";import"../Icons/ArrowRight.js";import"../Button/styles.module.scss";import"../../theme/index.js";import"../../theme/spacers.js";import"../../utils/refs.js";import"../Icons/X.js";import"../Close/styles.module.scss";const G=({content:p,buttonText:d,buttonClosedText:o,expanderOpenFromStart:n})=>{const[i,v]=$(n),l=i?d:o,b=I(),u=S({label:l,id:b,prefer:"label"}),E={onClick:()=>v(!i),variant:"borderless",className:m(f["notification-panel__detail"],f["notification-panel__detail-button"]),"aria-expanded":i,...u};return t.createElement("div",{className:f["notification-panel__detail-section"]},t.createElement("div",{className:f["notification-panel__detail-section__button--wrapper"]},t.createElement(R,{testId:"expand","data-analyticsid":N.Expander,...E},l,t.createElement(_,{svgIcon:i?U:D}))),i&&t.createElement("div",{className:m(f["notification-panel__detail-section__content"])},p))},H=({fluid:p,variant:d,children:o})=>{if(p){const n=m(e["fluid-wrapper"],{[e[`fluid-wrapper--${d}`]]:d});return t.createElement("div",{className:n},o)}return o},J=t.forwardRef((p,d)=>{const{children:o,variant:n="info",dismissable:i=!1,onClick:v,expanderChildren:l,expanderButtonText:b,expanderButtonClosedText:u,expanderOpenFromStart:E=!1,compactVariant:a,label:s,fluid:g=!1,size:h,className:w,labelId:y,role:T,testId:B}=p,C=I(y),k={info:t.createElement(_,{svgIcon:j,color:c.blueberry700,hoverColor:c.blueberry700,size:a?r.XSmall:r.Small}),warn:t.createElement(_,{svgIcon:W,color:c.banana700,hoverColor:c.banana700,size:a?r.XSmall:r.Small}),alert:t.createElement(_,{svgIcon:q,color:c.cherry700,hoverColor:c.cherry700,size:a?r.XSmall:r.Small}),success:t.createElement(_,{svgIcon:V,color:c.kiwi900,hoverColor:c.kiwi900,size:a?r.XSmall:r.Small})},z=()=>{const L=m(e["notification-panel__content"]),P=m(e["notification-panel__label"],{[e["notification-panel__label--no-content"]]:!o&&!l,[e["notification-panel__label__compact"]]:!!a,[e["notification-panel__label__compact--basic"]]:a==="basic"}),X=m(e["notification-panel__children"],{[e["notification-panel__label-and-content--spacing"]]:s,[e["notification-panel__children--expander-no-label"]]:l&&!s});return t.createElement("div",{className:L,id:s?void 0:C},s&&t.createElement("h1",{className:P,id:C},s),o&&!a&&t.createElement("div",{className:X},o),l&&b&&u&&!a&&t.createElement(G,{expanderOpenFromStart:E,content:l,buttonText:b,buttonClosedText:u}))},A=m(e["notification-panel"],e[`notification-panel--${n}`],{[e[`notification-panel--${h}`]]:!!h,[e["notification-panel__compact"]]:!!a,[e["notification-panel__compact--basic"]]:a==="basic",[e["notification-panel__compact--outline"]]:a==="outline",[e["notification-panel--has-children"]]:!!o,[e["notification-panel--with-content"]]:l||s&&o,[e["notification-panel--dismissable"]]:i},w),x=T||n==="alert"&&"alert"||void 0,F=x?S({label:s,id:C}):void 0;return t.createElement(H,{fluid:g,variant:n},t.createElement("div",{ref:d,role:x,"data-testid":B,"data-analyticsid":N.NotificationPanel,className:A,...F},t.createElement("span",{className:e["notification-panel__icon"]},k[n]),i&&t.createElement("span",{className:e["notification-panel__close"]},t.createElement(O,{ariaLabel:p.ariaLabelCloseBtn,onClick:v,color:M("black")})),z()))}),ke=J;export{ke as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/NotificationPanel/DetailButton/DetailButton.tsx","../../../src/components/NotificationPanel/NotificationPanel.tsx"],"sourcesContent":["import React, { useState } from 'react';\n\nimport classNames from 'classnames';\n\nimport { AnalyticsId } from '../../../constants';\nimport { useUuid } from '../../../hooks/useUuid';\nimport { AriaLabelAttributes, getAriaLabelAttributes } from '../../../utils/accessibility';\nimport Button, { ButtonProps } from '../../Button';\nimport Icon from '../../Icons';\nimport ChevronDown from '../../Icons/ChevronDown';\nimport ChevronUp from '../../Icons/ChevronUp';\n\nimport styles from './styles.module.scss';\n\ntype Props = {\n content: React.ReactNode;\n buttonClosedText: string;\n buttonText: string;\n expanderOpenFromStart: boolean;\n};\nexport const DetailButton: React.FC<Props> = ({ content, buttonText, buttonClosedText, expanderOpenFromStart }: Props): JSX.Element => {\n const [isExpanded, setIsExpanded] = useState<boolean>(expanderOpenFromStart);\n const activeButtonText = isExpanded ? buttonText : buttonClosedText;\n\n const buttonTextId = useUuid();\n\n const ariaLabelAttributes = getAriaLabelAttributes({\n label: activeButtonText,\n id: buttonTextId,\n prefer: 'label',\n });\n\n const commonProps: Partial<ButtonProps> & AriaLabelAttributes = {\n onClick: () => setIsExpanded(!isExpanded),\n variant: 'borderless',\n className: classNames(styles['notification-panel__detail'], styles['notification-panel__detail-button']),\n 'aria-expanded': isExpanded,\n ...ariaLabelAttributes,\n };\n\n return (\n <div className={styles['notification-panel__detail-section']}>\n <div className={styles['notification-panel__detail-section__button--wrapper']}>\n <Button testId=\"expand\" data-analyticsid={AnalyticsId.Expander} {...commonProps}>\n {activeButtonText}\n <Icon svgIcon={isExpanded ? ChevronUp : ChevronDown} />\n </Button>\n </div>\n {isExpanded && <div className={classNames(styles['notification-panel__detail-section__content'])}>{content}</div>}\n </div>\n );\n};\n","import React from 'react';\n\nimport classNames from 'classnames';\n\nimport { DetailButton } from './DetailButton/DetailButton';\nimport { AnalyticsId, IconSize } from '../../constants';\nimport { useUuid } from '../../hooks/useUuid';\nimport { getColor } from '../../theme/currys';\nimport { palette } from '../../theme/palette';\nimport { getAriaLabelAttributes } from '../../utils/accessibility';\nimport Close from '../Close';\nimport Icon from '../Icons';\nimport CheckFill from '../Icons/CheckFill';\nimport ErrorSignFill from '../Icons/ErrorSignFill';\nimport InfoSignFill from '../Icons/InfoSignFill';\nimport TriangleX from '../Icons/TriangleX';\n\nimport styles from './styles.module.scss';\n\nexport type NotificationPanelVariants = 'info' | 'warn' | 'alert' | 'success';\nexport type NotificationCompactVariants = 'basic' | 'outline';\nexport type NotificationPanelSizes = 'small' | 'medium' | 'large';\n\nexport interface NotificationPanelProps {\n /** Adds custom classes to the element. */\n className?: string;\n /** Adds inner child elements. */\n children?: React.ReactNode;\n /** Adds inner expander elements. */\n expanderChildren?: React.ReactNode;\n /** Text for expanderButton. */\n expanderButtonText?: string;\n /** Text for expanderButton when closed. */\n expanderButtonClosedText?: string;\n /** Makes expander be open from start. */\n expanderOpenFromStart?: boolean;\n /** Changes the visual representation of the notification panel. */\n variant?: NotificationPanelVariants;\n /** Makes the panel more compact. Available in basic and outline. */\n compactVariant?: NotificationCompactVariants;\n /** Sets a fixed size for the content container. */\n size?: NotificationPanelSizes;\n /** Used in combination with dismissiable property to close the notification panel. */\n onClick?: (e?: React.MouseEvent<HTMLElement, MouseEvent>) => void;\n /** Toggles the close button in the top right corner. */\n dismissable?: boolean;\n /** Enables a fluid outer container that spans the entire width of parent. */\n fluid?: boolean;\n /** Sets a label for the notification panel. */\n label?: string;\n /** Close button aria-label */\n ariaLabelCloseBtn?: string;\n /** Custom id for the label */\n labelId?: string;\n /** Custom role for the panel. Default is no role. If variant is alert or crisis, the aria role will be set to \"alert\" unless the role-prop is also set. */\n role?: 'region' | 'alert';\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\ntype WrapFluidProps = Pick<NotificationPanelProps, 'fluid' | 'variant'> & {\n children: React.ReactElement;\n};\n\nconst FluidWrapper: React.FC<WrapFluidProps> = ({ fluid, variant, children }) => {\n if (fluid) {\n const fluidClasses = classNames(styles['fluid-wrapper'], { [styles[`fluid-wrapper--${variant}`]]: variant });\n\n return <div className={fluidClasses}>{children}</div>;\n }\n return children;\n};\n\nconst NotificationPanel = React.forwardRef<HTMLDivElement, NotificationPanelProps>((props, ref) => {\n const {\n children,\n variant = 'info',\n dismissable = false,\n onClick,\n expanderChildren,\n expanderButtonText,\n expanderButtonClosedText,\n expanderOpenFromStart = false,\n compactVariant,\n label,\n fluid = false,\n size,\n className,\n labelId,\n role,\n testId,\n } = props;\n const uuid = useUuid(labelId);\n const variantToIconMap = {\n info: (\n <Icon\n svgIcon={InfoSignFill}\n color={palette.blueberry700}\n hoverColor={palette.blueberry700}\n size={compactVariant ? IconSize.XSmall : IconSize.Small}\n />\n ),\n warn: (\n <Icon\n svgIcon={ErrorSignFill}\n color={palette.banana700}\n hoverColor={palette.banana700}\n size={compactVariant ? IconSize.XSmall : IconSize.Small}\n />\n ),\n alert: (\n <Icon\n svgIcon={TriangleX}\n color={palette.cherry700}\n hoverColor={palette.cherry700}\n size={compactVariant ? IconSize.XSmall : IconSize.Small}\n />\n ),\n success: (\n <Icon\n svgIcon={CheckFill}\n color={palette.kiwi900}\n hoverColor={palette.kiwi900}\n size={compactVariant ? IconSize.XSmall : IconSize.Small}\n />\n ),\n };\n const renderContent = (): JSX.Element => {\n const contentClasses = classNames(styles['notification-panel__content']);\n const labelClasses = classNames(styles['notification-panel__label'], {\n [styles['notification-panel__label--no-content']]: !children && !expanderChildren,\n [styles['notification-panel__label__compact']]: !!compactVariant,\n [styles['notification-panel__label__compact--basic']]: compactVariant === 'basic',\n });\n const childrenClasses = classNames(styles['notification-panel__children'], {\n [styles['notification-panel__label-and-content--spacing']]: label,\n });\n\n return (\n <div className={contentClasses} id={!label ? uuid : undefined}>\n {label && (\n <h1 className={labelClasses} id={uuid}>\n {label}\n </h1>\n )}\n {children && !compactVariant && <div className={childrenClasses}>{children}</div>}\n {expanderChildren && expanderButtonText && expanderButtonClosedText && !compactVariant && (\n <DetailButton\n expanderOpenFromStart={expanderOpenFromStart}\n content={expanderChildren}\n buttonText={expanderButtonText}\n buttonClosedText={expanderButtonClosedText}\n />\n )}\n </div>\n );\n };\n\n const notificationPanelClasses = classNames(\n styles['notification-panel'],\n styles[`notification-panel--${variant}`],\n {\n [styles[`notification-panel--${size}`]]: !!size,\n [styles['notification-panel__compact']]: !!compactVariant,\n [styles['notification-panel__compact--basic']]: compactVariant === 'basic',\n [styles['notification-panel__compact--outline']]: compactVariant === 'outline',\n [styles['notification-panel--has-children']]: !!children,\n [styles['notification-panel--with-content']]: expanderChildren || (label && children),\n [styles['notification-panel--dismissable']]: dismissable,\n },\n className\n );\n\n const ariaRole = role || (variant === 'alert' && 'alert') || undefined;\n const ariaLabelAttributes = ariaRole ? getAriaLabelAttributes({ label, id: uuid }) : undefined;\n\n return (\n <FluidWrapper fluid={fluid} variant={variant}>\n <div\n ref={ref}\n role={ariaRole}\n data-testid={testId}\n data-analyticsid={AnalyticsId.NotificationPanel}\n className={notificationPanelClasses}\n {...ariaLabelAttributes}\n >\n <span className={styles['notification-panel__icon']}>{variantToIconMap[variant]}</span>\n {dismissable && (\n <span className={styles['notification-panel__close']}>\n <Close ariaLabel={props.ariaLabelCloseBtn} onClick={onClick} color={getColor('black')} />\n </span>\n )}\n {renderContent()}\n </div>\n </FluidWrapper>\n );\n});\n\nexport default NotificationPanel;\n"],"names":["DetailButton","content","buttonText","buttonClosedText","expanderOpenFromStart","isExpanded","setIsExpanded","useState","activeButtonText","buttonTextId","useUuid","ariaLabelAttributes","getAriaLabelAttributes","commonProps","classNames","styles","React","Button","AnalyticsId","Icon","ChevronUp","ChevronDown","FluidWrapper","fluid","variant","children","fluidClasses","NotificationPanel","props","ref","dismissable","onClick","expanderChildren","expanderButtonText","expanderButtonClosedText","compactVariant","label","size","className","labelId","role","testId","uuid","variantToIconMap","InfoSignFill","palette","IconSize","ErrorSignFill","TriangleX","CheckFill","renderContent","contentClasses","labelClasses","childrenClasses","notificationPanelClasses","ariaRole","Close","getColor","NotificationPanel$1"],"mappings":"8vCAoBO,MAAMA,EAAgC,CAAC,CAAE,QAAAC,EAAS,WAAAC,EAAY,iBAAAC,EAAkB,sBAAAC,KAAgD,CACrI,KAAM,CAACC,EAAYC,CAAa,EAAIC,EAAkBH,CAAqB,EACrEI,EAAmBH,EAAaH,EAAaC,EAE7CM,EAAeC,IAEfC,EAAsBC,EAAuB,CACjD,MAAOJ,EACP,GAAIC,EACJ,OAAQ,OAAA,CACT,EAEKI,EAA0D,CAC9D,QAAS,IAAMP,EAAc,CAACD,CAAU,EACxC,QAAS,aACT,UAAWS,EAAWC,EAAO,4BAA4B,EAAGA,EAAO,mCAAmC,CAAC,EACvG,gBAAiBV,EACjB,GAAGM,CAAA,EAGL,uBACG,MAAI,CAAA,UAAWI,EAAO,oCAAoC,CAAA,kBACxD,MAAI,CAAA,UAAWA,EAAO,qDAAqD,GACzEC,EAAA,cAAAC,EAAA,CAAO,OAAO,SAAS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C,EAAG,CAAC,CAACU,EAChD,CAACV,EAAO,kCAAkC,CAAC,EAAGiB,GAAqBI,GAASX,EAC5E,CAACV,EAAO,iCAAiC,CAAC,EAAGe,CAC/C,EACAQ,CAAA,EAGIiB,EAAWf,GAAShB,IAAY,SAAW,SAAY,OACvDb,EAAsB4C,EAAW3C,EAAuB,CAAE,MAAAwB,EAAO,GAAIM,CAAA,CAAM,EAAI,OAGnF,OAAA1B,EAAA,cAACM,EAAa,CAAA,MAAAC,EAAc,QAAAC,CAC1B,EAAAR,EAAA,cAAC,MAAA,CACC,IAAAa,EACA,KAAM0B,EACN,cAAad,EACb,mBAAkBvB,EAAY,kBAC9B,UAAWoC,EACV,GAAG3C,CAAA,EAEJK,EAAA,cAAC,QAAK,UAAWD,EAAO,0BAA0B,CAAI,EAAA4B,EAAiBnB,CAAO,CAAE,EAC/EM,GACEd,EAAA,cAAA,OAAA,CAAK,UAAWD,EAAO,2BAA2B,CACjD,EAAAC,EAAA,cAACwC,EAAM,CAAA,UAAW5B,EAAM,kBAAmB,QAAAG,EAAkB,MAAO0B,EAAS,OAAO,EAAG,CACzF,EAEDP,EAAc,CAAA,CAEnB,CAEJ,CAAC,EAEDQ,GAAe/B"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/NotificationPanel/DetailButton/DetailButton.tsx","../../../src/components/NotificationPanel/NotificationPanel.tsx"],"sourcesContent":["import React, { useState } from 'react';\n\nimport classNames from 'classnames';\n\nimport { AnalyticsId } from '../../../constants';\nimport { useUuid } from '../../../hooks/useUuid';\nimport { AriaLabelAttributes, getAriaLabelAttributes } from '../../../utils/accessibility';\nimport Button, { ButtonProps } from '../../Button';\nimport Icon from '../../Icons';\nimport ChevronDown from '../../Icons/ChevronDown';\nimport ChevronUp from '../../Icons/ChevronUp';\n\nimport styles from './styles.module.scss';\n\ntype Props = {\n content: React.ReactNode;\n buttonClosedText: string;\n buttonText: string;\n expanderOpenFromStart: boolean;\n};\nexport const DetailButton: React.FC<Props> = ({ content, buttonText, buttonClosedText, expanderOpenFromStart }: Props): JSX.Element => {\n const [isExpanded, setIsExpanded] = useState<boolean>(expanderOpenFromStart);\n const activeButtonText = isExpanded ? buttonText : buttonClosedText;\n\n const buttonTextId = useUuid();\n\n const ariaLabelAttributes = getAriaLabelAttributes({\n label: activeButtonText,\n id: buttonTextId,\n prefer: 'label',\n });\n\n const commonProps: Partial<ButtonProps> & AriaLabelAttributes = {\n onClick: () => setIsExpanded(!isExpanded),\n variant: 'borderless',\n className: classNames(styles['notification-panel__detail'], styles['notification-panel__detail-button']),\n 'aria-expanded': isExpanded,\n ...ariaLabelAttributes,\n };\n\n return (\n <div className={styles['notification-panel__detail-section']}>\n <div className={styles['notification-panel__detail-section__button--wrapper']}>\n <Button testId=\"expand\" data-analyticsid={AnalyticsId.Expander} {...commonProps}>\n {activeButtonText}\n <Icon svgIcon={isExpanded ? ChevronUp : ChevronDown} />\n </Button>\n </div>\n {isExpanded && <div className={classNames(styles['notification-panel__detail-section__content'])}>{content}</div>}\n </div>\n );\n};\n","import React from 'react';\n\nimport classNames from 'classnames';\n\nimport { DetailButton } from './DetailButton/DetailButton';\nimport { AnalyticsId, IconSize } from '../../constants';\nimport { useUuid } from '../../hooks/useUuid';\nimport { getColor } from '../../theme/currys';\nimport { palette } from '../../theme/palette';\nimport { getAriaLabelAttributes } from '../../utils/accessibility';\nimport Close from '../Close';\nimport Icon from '../Icons';\nimport CheckFill from '../Icons/CheckFill';\nimport ErrorSignFill from '../Icons/ErrorSignFill';\nimport InfoSignFill from '../Icons/InfoSignFill';\nimport TriangleX from '../Icons/TriangleX';\n\nimport styles from './styles.module.scss';\n\nexport type NotificationPanelVariants = 'info' | 'warn' | 'alert' | 'success';\nexport type NotificationCompactVariants = 'basic' | 'outline';\nexport type NotificationPanelSizes = 'small' | 'medium' | 'large';\n\nexport interface NotificationPanelProps {\n /** Adds custom classes to the element. */\n className?: string;\n /** Adds inner child elements. */\n children?: React.ReactNode;\n /** Adds inner expander elements. */\n expanderChildren?: React.ReactNode;\n /** Text for expanderButton. */\n expanderButtonText?: string;\n /** Text for expanderButton when closed. */\n expanderButtonClosedText?: string;\n /** Makes expander be open from start. */\n expanderOpenFromStart?: boolean;\n /** Changes the visual representation of the notification panel. */\n variant?: NotificationPanelVariants;\n /** Makes the panel more compact. Available in basic and outline. */\n compactVariant?: NotificationCompactVariants;\n /** Sets a fixed size for the content container. */\n size?: NotificationPanelSizes;\n /** Used in combination with dismissiable property to close the notification panel. */\n onClick?: (e?: React.MouseEvent<HTMLElement, MouseEvent>) => void;\n /** Toggles the close button in the top right corner. */\n dismissable?: boolean;\n /** Enables a fluid outer container that spans the entire width of parent. */\n fluid?: boolean;\n /** Sets a label for the notification panel. */\n label?: string;\n /** Close button aria-label */\n ariaLabelCloseBtn?: string;\n /** Custom id for the label */\n labelId?: string;\n /** Custom role for the panel. Default is no role. If variant is alert or crisis, the aria role will be set to \"alert\" unless the role-prop is also set. */\n role?: 'region' | 'alert';\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\ntype WrapFluidProps = Pick<NotificationPanelProps, 'fluid' | 'variant'> & {\n children: React.ReactElement;\n};\n\nconst FluidWrapper: React.FC<WrapFluidProps> = ({ fluid, variant, children }) => {\n if (fluid) {\n const fluidClasses = classNames(styles['fluid-wrapper'], { [styles[`fluid-wrapper--${variant}`]]: variant });\n\n return <div className={fluidClasses}>{children}</div>;\n }\n return children;\n};\n\nconst NotificationPanel = React.forwardRef<HTMLDivElement, NotificationPanelProps>((props, ref) => {\n const {\n children,\n variant = 'info',\n dismissable = false,\n onClick,\n expanderChildren,\n expanderButtonText,\n expanderButtonClosedText,\n expanderOpenFromStart = false,\n compactVariant,\n label,\n fluid = false,\n size,\n className,\n labelId,\n role,\n testId,\n } = props;\n const uuid = useUuid(labelId);\n const variantToIconMap = {\n info: (\n <Icon\n svgIcon={InfoSignFill}\n color={palette.blueberry700}\n hoverColor={palette.blueberry700}\n size={compactVariant ? IconSize.XSmall : IconSize.Small}\n />\n ),\n warn: (\n <Icon\n svgIcon={ErrorSignFill}\n color={palette.banana700}\n hoverColor={palette.banana700}\n size={compactVariant ? IconSize.XSmall : IconSize.Small}\n />\n ),\n alert: (\n <Icon\n svgIcon={TriangleX}\n color={palette.cherry700}\n hoverColor={palette.cherry700}\n size={compactVariant ? IconSize.XSmall : IconSize.Small}\n />\n ),\n success: (\n <Icon\n svgIcon={CheckFill}\n color={palette.kiwi900}\n hoverColor={palette.kiwi900}\n size={compactVariant ? IconSize.XSmall : IconSize.Small}\n />\n ),\n };\n const renderContent = (): JSX.Element => {\n const contentClasses = classNames(styles['notification-panel__content']);\n const labelClasses = classNames(styles['notification-panel__label'], {\n [styles['notification-panel__label--no-content']]: !children && !expanderChildren,\n [styles['notification-panel__label__compact']]: !!compactVariant,\n [styles['notification-panel__label__compact--basic']]: compactVariant === 'basic',\n });\n const childrenClasses = classNames(styles['notification-panel__children'], {\n [styles['notification-panel__label-and-content--spacing']]: label,\n [styles['notification-panel__children--expander-no-label']]: expanderChildren && !label,\n });\n\n return (\n <div className={contentClasses} id={!label ? uuid : undefined}>\n {label && (\n <h1 className={labelClasses} id={uuid}>\n {label}\n </h1>\n )}\n {children && !compactVariant && <div className={childrenClasses}>{children}</div>}\n {expanderChildren && expanderButtonText && expanderButtonClosedText && !compactVariant && (\n <DetailButton\n expanderOpenFromStart={expanderOpenFromStart}\n content={expanderChildren}\n buttonText={expanderButtonText}\n buttonClosedText={expanderButtonClosedText}\n />\n )}\n </div>\n );\n };\n\n const notificationPanelClasses = classNames(\n styles['notification-panel'],\n styles[`notification-panel--${variant}`],\n {\n [styles[`notification-panel--${size}`]]: !!size,\n [styles['notification-panel__compact']]: !!compactVariant,\n [styles['notification-panel__compact--basic']]: compactVariant === 'basic',\n [styles['notification-panel__compact--outline']]: compactVariant === 'outline',\n [styles['notification-panel--has-children']]: !!children,\n [styles['notification-panel--with-content']]: expanderChildren || (label && children),\n [styles['notification-panel--dismissable']]: dismissable,\n },\n className\n );\n\n const ariaRole = role || (variant === 'alert' && 'alert') || undefined;\n const ariaLabelAttributes = ariaRole ? getAriaLabelAttributes({ label, id: uuid }) : undefined;\n\n return (\n <FluidWrapper fluid={fluid} variant={variant}>\n <div\n ref={ref}\n role={ariaRole}\n data-testid={testId}\n data-analyticsid={AnalyticsId.NotificationPanel}\n className={notificationPanelClasses}\n {...ariaLabelAttributes}\n >\n <span className={styles['notification-panel__icon']}>{variantToIconMap[variant]}</span>\n {dismissable && (\n <span className={styles['notification-panel__close']}>\n <Close ariaLabel={props.ariaLabelCloseBtn} onClick={onClick} color={getColor('black')} />\n </span>\n )}\n {renderContent()}\n </div>\n </FluidWrapper>\n );\n});\n\nexport default NotificationPanel;\n"],"names":["DetailButton","content","buttonText","buttonClosedText","expanderOpenFromStart","isExpanded","setIsExpanded","useState","activeButtonText","buttonTextId","useUuid","ariaLabelAttributes","getAriaLabelAttributes","commonProps","classNames","styles","React","Button","AnalyticsId","Icon","ChevronUp","ChevronDown","FluidWrapper","fluid","variant","children","fluidClasses","NotificationPanel","props","ref","dismissable","onClick","expanderChildren","expanderButtonText","expanderButtonClosedText","compactVariant","label","size","className","labelId","role","testId","uuid","variantToIconMap","InfoSignFill","palette","IconSize","ErrorSignFill","TriangleX","CheckFill","renderContent","contentClasses","labelClasses","childrenClasses","notificationPanelClasses","ariaRole","Close","getColor","NotificationPanel$1"],"mappings":"8vCAoBO,MAAMA,EAAgC,CAAC,CAAE,QAAAC,EAAS,WAAAC,EAAY,iBAAAC,EAAkB,sBAAAC,KAAgD,CACrI,KAAM,CAACC,EAAYC,CAAa,EAAIC,EAAkBH,CAAqB,EACrEI,EAAmBH,EAAaH,EAAaC,EAE7CM,EAAeC,IAEfC,EAAsBC,EAAuB,CACjD,MAAOJ,EACP,GAAIC,EACJ,OAAQ,OAAA,CACT,EAEKI,EAA0D,CAC9D,QAAS,IAAMP,EAAc,CAACD,CAAU,EACxC,QAAS,aACT,UAAWS,EAAWC,EAAO,4BAA4B,EAAGA,E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,CAACT,EAAO,uBAAuBsB,CAAI,EAAE,CAAC,EAAG,CAAC,CAACA,EAC3C,CAACtB,EAAO,6BAA6B,CAAC,EAAG,CAAC,CAACoB,EAC3C,CAACpB,EAAO,oCAAoC,CAAC,EAAGoB,IAAmB,QACnE,CAACpB,EAAO,sCAAsC,CAAC,EAAGoB,IAAmB,UACrE,CAACpB,EAAO,kCAAkC,CAAC,EAAG,CAAC,CAACU,EAChD,CAACV,EAAO,kCAAkC,CAAC,EAAGiB,GAAqBI,GAASX,EAC5E,CAACV,EAAO,iCAAiC,CAAC,EAAGe,CAC/C,EACAQ,CAAA,EAGIiB,EAAWf,GAAShB,IAAY,SAAW,SAAY,OACvDb,EAAsB4C,EAAW3C,EAAuB,CAAE,MAAAwB,EAAO,GAAIM,CAAA,CAAM,EAAI,OAGnF,OAAA1B,EAAA,cAACM,EAAa,CAAA,MAAAC,EAAc,QAAAC,CAC1B,EAAAR,EAAA,cAAC,MAAA,CACC,IAAAa,EACA,KAAM0B,EACN,cAAad,EACb,mBAAkBvB,EAAY,kBAC9B,UAAWoC,EACV,GAAG3C,CAAA,EAEJK,EAAA,cAAC,QAAK,UAAWD,EAAO,0BAA0B,CAAI,EAAA4B,EAAiBnB,CAAO,CAAE,EAC/EM,GACEd,EAAA,cAAA,OAAA,CAAK,UAAWD,EAAO,2BAA2B,CACjD,EAAAC,EAAA,cAACwC,EAAM,CAAA,UAAW5B,EAAM,kBAAmB,QAAAG,EAAkB,MAAO0B,EAAS,OAAO,EAAG,CACzF,EAEDP,EAAc,CAAA,CAEnB,CAEJ,CAAC,EAEDQ,GAAe/B"}
|
|
@@ -171,6 +171,14 @@
|
|
|
171
171
|
&__children {
|
|
172
172
|
font-weight: 600;
|
|
173
173
|
padding: getSpacer(3xs) 0;
|
|
174
|
+
|
|
175
|
+
&--expander-no-label {
|
|
176
|
+
margin: getSpacer(2xs) 0 0 0;
|
|
177
|
+
|
|
178
|
+
@media (max-width: map.get($grid-breakpoints, lg)) {
|
|
179
|
+
padding-top: 0;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
174
182
|
}
|
|
175
183
|
|
|
176
184
|
&__icon {
|
|
@@ -5,6 +5,7 @@ export type Styles = {
|
|
|
5
5
|
'fluid-wrapper': string;
|
|
6
6
|
'notification-panel': string;
|
|
7
7
|
'notification-panel__children': string;
|
|
8
|
+
'notification-panel__children--expander-no-label': string;
|
|
8
9
|
'notification-panel__close': string;
|
|
9
10
|
'notification-panel__compact': string;
|
|
10
11
|
'notification-panel__compact--basic': string;
|
|
@@ -20,7 +20,9 @@ interface SliderProps {
|
|
|
20
20
|
maxValue?: number;
|
|
21
21
|
/** Function to be called when the value state has changed. */
|
|
22
22
|
onChange?: (value: number) => void;
|
|
23
|
-
/**
|
|
23
|
+
/** If set to false will only trigger onChange once a user interaction has been made, updates to this prop will be taken into account - true by default */
|
|
24
|
+
selected?: boolean;
|
|
25
|
+
/** Sets the steps data for the slider */
|
|
24
26
|
steps?: SliderStep[];
|
|
25
27
|
/** Sets the step to move per point in the slider */
|
|
26
28
|
step?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Slider.d.ts","sourceRoot":"","sources":["../../../src/components/Slider/Slider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAgC3D,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,UAAU,WAAW;IACnB,oCAAoC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+CAA+C;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gDAAgD;IAChD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qCAAqC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mCAAmC;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iHAAiH;IACjH,QAAQ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":{"title":{"defaultValue":null,"description":"Sets the title of the slider.","name":"title","parent":{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"},"declarations":[{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"}],"required":false,"type":{"name":"string"}},"labelLeft":{"defaultValue":null,"description":"Adds the left hand label to the element.","name":"labelLeft","parent":{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"},"declarations":[{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"}],"required":false,"type":{"name":"string"}},"labelRight":{"defaultValue":null,"description":"Adds the right hand label to the element.","name":"labelRight","parent":{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"},"declarations":[{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"}],"required":false,"type":{"name":"string"}},"ariaLabel":{"defaultValue":null,"description":"Sets aria-label of the slider.","name":"ariaLabel","parent":{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"},"declarations":[{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"}],"required":false,"type":{"name":"string"}},"disabled":{"defaultValue":{"value":"false"},"description":"Disables the slider element.","name":"disabled","parent":{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"},"declarations":[{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"}],"required":false,"type":{"name":"boolean"}},"minValue":{"defaultValue":{"value":"0"},"description":"Sets the minimum allowed value on the slider - this overrides the use of steps prop for minValue/maxValue.","name":"minValue","parent":{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"},"declarations":[{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"}],"required":false,"type":{"name":"number"}},"maxValue":{"defaultValue":{"value":"steps ? steps.length - 1 : 100"},"description":"Sets the maximum allowed value on the slider - this overrides the use of steps prop for minValue/maxValue.","name":"maxValue","parent":{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"},"declarations":[{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"}],"required":false,"type":{"name":"number"}},"onChange":{"defaultValue":null,"description":"Function to be called when the value state has changed.","name":"onChange","parent":{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"},"declarations":[{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"}],"required":false,"type":{"name":"((value: number) => void)"}},"steps":{"defaultValue":null,"description":"Sets the steps data for the slider","name":"steps","parent":{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"},"declarations":[{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"}],"required":false,"type":{"name":"SliderStep[]"}},"step":{"defaultValue":{"value":"1"},"description":"Sets the step to move per point in the slider","name":"step","parent":{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"},"declarations":[{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"}],"required":false,"type":{"name":"number"}},"testId":{"defaultValue":null,"description":"Sets the data-testid attribute.","name":"testId","parent":{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"},"declarations":[{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"}],"required":false,"type":{"name":"string"}}}}
|
|
1
|
+
{"props":{"title":{"defaultValue":null,"description":"Sets the title of the slider.","name":"title","parent":{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"},"declarations":[{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"}],"required":false,"type":{"name":"string"}},"labelLeft":{"defaultValue":null,"description":"Adds the left hand label to the element.","name":"labelLeft","parent":{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"},"declarations":[{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"}],"required":false,"type":{"name":"string"}},"labelRight":{"defaultValue":null,"description":"Adds the right hand label to the element.","name":"labelRight","parent":{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"},"declarations":[{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"}],"required":false,"type":{"name":"string"}},"ariaLabel":{"defaultValue":null,"description":"Sets aria-label of the slider.","name":"ariaLabel","parent":{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"},"declarations":[{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"}],"required":false,"type":{"name":"string"}},"disabled":{"defaultValue":{"value":"false"},"description":"Disables the slider element.","name":"disabled","parent":{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"},"declarations":[{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"}],"required":false,"type":{"name":"boolean"}},"minValue":{"defaultValue":{"value":"0"},"description":"Sets the minimum allowed value on the slider - this overrides the use of steps prop for minValue/maxValue.","name":"minValue","parent":{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"},"declarations":[{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"}],"required":false,"type":{"name":"number"}},"maxValue":{"defaultValue":{"value":"steps ? steps.length - 1 : 100"},"description":"Sets the maximum allowed value on the slider - this overrides the use of steps prop for minValue/maxValue.","name":"maxValue","parent":{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"},"declarations":[{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"}],"required":false,"type":{"name":"number"}},"onChange":{"defaultValue":null,"description":"Function to be called when the value state has changed.","name":"onChange","parent":{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"},"declarations":[{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"}],"required":false,"type":{"name":"((value: number) => void)"}},"selected":{"defaultValue":{"value":"true"},"description":"If set to false will only trigger onChange once a user interaction has been made, updates to this prop will be taken into account - true by default","name":"selected","parent":{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"},"declarations":[{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"}],"required":false,"type":{"name":"boolean"}},"steps":{"defaultValue":null,"description":"Sets the steps data for the slider","name":"steps","parent":{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"},"declarations":[{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"}],"required":false,"type":{"name":"SliderStep[]"}},"step":{"defaultValue":{"value":"1"},"description":"Sets the step to move per point in the slider","name":"step","parent":{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"},"declarations":[{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"}],"required":false,"type":{"name":"number"}},"testId":{"defaultValue":null,"description":"Sets the data-testid attribute.","name":"testId","parent":{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"},"declarations":[{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"}],"required":false,"type":{"name":"string"}}}}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import a,{useState as
|
|
1
|
+
import a,{useState as M,useRef as X,useEffect as E}from"react";import A from"classnames";import{AnalyticsId as Y}from"../../constants.js";import{useSize as Z}from"../../hooks/useSize.js";import{useUuid as I}from"../../hooks/useUuid.js";import{getAriaLabelAttributes as x}from"../../utils/accessibility.js";import{T as V}from"../../Title.js";import o from"./styles.module.scss";import"../../utils/debounce.js";import"../../uuid.js";import"../../utils/environment.js";import"../Title/styles.module.scss";const ee=(u,f,l)=>{const[v,n]=M(u),y=r=>{r>l?n(l):r<f?n(f):n(r)};return E(()=>{n((l-f)/2+f)},[f,l]),[v,y]},te=({title:u,ariaLabel:f,labelLeft:l,labelRight:v,disabled:n=!1,onChange:y,steps:r,step:_=1,minValue:i=0,maxValue:s=r?r.length-1:100,selected:w=!0,testId:z})=>{const[C,D]=M(!1),[k,L]=M(w),[d,m]=ee((s-i)/2+i,i,s),p=I(),S=I(),N=I(),b=X(null),P=X(null),{width:U}=Z(b)||{width:0},R=s/10;E(()=>{const t=()=>{D(!1)};return document.addEventListener("pointerup",t),()=>{document.removeEventListener("pointerup",t)}},[]);const $=t=>{var T;const e=((T=b.current)==null?void 0:T.getBoundingClientRect().x)??0,c=(t-e)/U,g=s-i;let h=c*g+i;return h=Math.round(h/_)*_,h=Math.max(i,Math.min(s,h)),h};E(()=>{const t=e=>{if(!n&&C){const c=$(e.clientX);m(c)}};return document.addEventListener("pointermove",t),()=>{document.removeEventListener("pointermove",t)}},[C]),E(()=>{!n&&k&&y&&y(d)},[d,k]),E(()=>{w!==k&&L(w)},[w]);const B=()=>{k===!1&&L(!0)},K=t=>{if(n)return;let e=!1;switch(t.key){case"ArrowLeft":case"ArrowDown":m(d-_),e=!0;break;case"PageDown":m(d-R),e=!0;break;case"ArrowRight":case"ArrowUp":m(d+_),e=!0;break;case"PageUp":m(d+R),e=!0;break;case"Home":m(i),e=!0;break;case"End":m(s),e=!0;break}e&&(B(),t.preventDefault(),t.stopPropagation())},H=t=>{var c;if(n)return;B();const e=$(t.clientX);m(e),(c=P.current)==null||c.focus()},O=t=>{var e;n||(D(!0),t.preventDefault(),t.stopPropagation(),(e=P.current)==null||e.focus())},W=s!==i?U/(s-i)*(d-i):0,q=()=>{const t=r?Math.round((d-i)/_):null;if(r&&t!==null&&t>=0&&t<r.length){const e=r[t],c=e.emojiUniCode,g=typeof e.label<"u"?e.label.toString():void 0;return c&&g?`${c} ${g}`:c||g}},F=x({label:f,id:(()=>{if(u&&l&&v)return[p,S,N].join(" ");if(u&&l)return[p,S].join(" ");if(u&&v)return[p,N].join(" ");if(u)return p})(),prefer:"label"}),j=(t,e)=>({left:`${t/(e-1)*100}%`}),G=()=>a.createElement("div",{className:o["slider__emoji-container"]},r==null?void 0:r.map((t,e)=>t.emojiUniCode&&a.createElement("div",{"aria-hidden":!0,key:"emoji"+e,className:o.slider__emoji,style:j(e,r.length)},t.emojiUniCode))),J=()=>r==null?void 0:r.map((t,e)=>a.createElement("div",{key:"step"+e,className:o.slider__track__step,style:j(e,r.length)})),Q=()=>a.createElement("div",{className:o["slider__value-container"]},r==null?void 0:r.map((t,e)=>typeof t.label<"u"&&a.createElement("div",{"aria-hidden":!0,key:"label"+e,className:o.slider__value,style:j(e,r.length)},t.label)));return a.createElement("div",{className:o.slider,"data-testid":z,"data-analyticsid":Y.Slider},u&&a.createElement(V,{className:o.slider__title,htmlMarkup:"h3",margin:0,appearance:"title3",id:p},u),a.createElement("div",{className:o["slider__content-container"]},G(),a.createElement("div",{ref:b,className:A(o["slider__track-wrapper"],n&&o["slider__track-wrapper--disabled"]),onClick:H,onPointerDown:O},a.createElement("div",{className:A(o.slider__track,n&&o["slider__track--disabled"])},J()),a.createElement("div",{role:n?void 0:"slider",ref:P,className:A(o.slider__marker,{[o["slider__marker--disabled"]]:n,[o["slider__marker--selected"]]:k}),style:{left:`${W}px`},onKeyDown:K,"aria-valuenow":d,"aria-valuetext":q(),"aria-valuemin":i,"aria-valuemax":s,tabIndex:n?void 0:0,"aria-disabled":n,...F})),Q()),(l||v)&&a.createElement("span",{className:o.slider__options},a.createElement("span",{id:S},l),a.createElement("span",{id:N},v)))},ke=te;export{te as Slider,ke as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/Slider/Slider.tsx"],"sourcesContent":["import React, { useEffect, useState, useRef } from 'react';\n\nimport classNames from 'classnames';\n\nimport { AnalyticsId } from '../../constants';\nimport { useSize } from '../../hooks/useSize';\nimport { useUuid } from '../../hooks/useUuid';\nimport { getAriaLabelAttributes } from '../../utils/accessibility';\nimport Title from '../Title';\n\nimport styles from './styles.module.scss';\n\nconst useSafeNumberValue = (initial: number, min: number, max: number): [number, (value: number) => void] => {\n const [value, setValue] = useState(initial);\n\n const setSafeValue = (newValue: number): void => {\n if (newValue > max) {\n setValue(max);\n } else if (newValue < min) {\n setValue(min);\n } else {\n setValue(newValue);\n }\n };\n\n useEffect(() => {\n setValue((max - min) / 2 + min);\n }, [min, max]);\n\n return [value, setSafeValue];\n};\n\nexport type SliderStep = {\n label?: number | string;\n emojiUniCode?: string;\n};\n\ninterface SliderProps {\n /**\tSets the title of the slider. */\n title?: string;\n /** Adds the left hand label to the element. */\n labelLeft?: string;\n /** Adds the right hand label to the element. */\n labelRight?: string;\n /**\tSets aria-label of the slider. */\n ariaLabel?: string;\n /** Disables the slider element. */\n disabled?: boolean;\n /** Sets the minimum allowed value on the slider - this overrides the use of steps prop for minValue/maxValue. */\n minValue?: number;\n /** Sets the maximum allowed value on the slider - this overrides the use of steps prop for minValue/maxValue. */\n maxValue?: number;\n /** Function to be called when the value state has changed. */\n onChange?: (value: number) => void;\n /** Sets the steps data for the slider*/\n steps?: SliderStep[];\n /** Sets the step to move per point in the slider */\n step?: number;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\nexport const Slider: React.FC<SliderProps> = ({\n title,\n ariaLabel,\n labelLeft,\n labelRight,\n disabled = false,\n onChange,\n steps,\n step = 1,\n minValue = 0,\n maxValue = steps ? steps.length - 1 : 100,\n testId,\n}) => {\n const [isMoving, setIsMoving] = useState(false);\n const [value, setValue] = useSafeNumberValue((maxValue - minValue) / 2 + minValue, minValue, maxValue);\n\n const titleId = useUuid();\n const labelLeftId = useUuid();\n const labelRightId = useUuid();\n const trackRef = useRef<HTMLDivElement>(null);\n const markerRef = useRef<HTMLDivElement>(null);\n const { width: trackWidth } = useSize(trackRef) || { width: 0 };\n const largeStep = maxValue / 10;\n\n useEffect(() => {\n const handlePointerUp = (): void => {\n setIsMoving(false);\n };\n\n document.addEventListener('pointerup', handlePointerUp);\n\n return () => {\n document.removeEventListener('pointerup', handlePointerUp);\n };\n }, []);\n\n const getValueBasedOnMarkerPosition = (markerPosition: number): number => {\n const trackPosition = trackRef.current?.getBoundingClientRect().x ?? 0;\n\n // Calculate the normalized position (0 to 1) of the marker along the track\n const normalizedPosition = (markerPosition - trackPosition) / trackWidth;\n const valueRange = maxValue - minValue;\n // Calculate the value without considering the step\n let value = normalizedPosition * valueRange + minValue;\n // Adjust the value to account for the step increment\n const stepCount = Math.round(value / step);\n value = stepCount * step;\n value = Math.max(minValue, Math.min(maxValue, value));\n\n return value;\n };\n\n useEffect(() => {\n const handlePointerMove = (e: PointerEvent): void => {\n if (!disabled && isMoving) {\n const newValue = getValueBasedOnMarkerPosition(e.clientX);\n setValue(newValue);\n }\n };\n\n document.addEventListener('pointermove', handlePointerMove);\n\n return () => {\n document.removeEventListener('pointermove', handlePointerMove);\n };\n }, [isMoving]);\n\n useEffect(() => {\n if (!disabled && onChange) {\n onChange(value);\n }\n }, [value]);\n\n const handleKeyDown: React.KeyboardEventHandler<HTMLDivElement> = e => {\n if (disabled) return;\n\n let flag = false;\n\n switch (e.key) {\n case 'ArrowLeft':\n case 'ArrowDown':\n setValue(value - step);\n flag = true;\n break;\n case 'PageDown':\n setValue(value - largeStep);\n flag = true;\n break;\n case 'ArrowRight':\n case 'ArrowUp':\n setValue(value + step);\n flag = true;\n break;\n case 'PageUp':\n setValue(value + largeStep);\n flag = true;\n break;\n case 'Home':\n setValue(minValue);\n flag = true;\n break;\n case 'End':\n setValue(maxValue);\n flag = true;\n break;\n default:\n break;\n }\n\n if (flag) {\n e.preventDefault();\n e.stopPropagation();\n }\n };\n\n const handleTrackClick: React.MouseEventHandler<HTMLDivElement> = e => {\n if (disabled) return;\n\n const newValue = getValueBasedOnMarkerPosition(e.clientX);\n setValue(newValue);\n markerRef.current?.focus();\n };\n\n const handlePointerDown: React.PointerEventHandler<HTMLDivElement> = e => {\n if (disabled) return;\n\n setIsMoving(true);\n\n e.preventDefault();\n e.stopPropagation();\n\n markerRef.current?.focus();\n };\n\n const markerXPos = maxValue !== minValue ? (trackWidth / (maxValue - minValue)) * (value - minValue) : 0;\n\n const getAriaValueText = (): string | undefined => {\n const stepIndex = steps ? Math.round((value - minValue) / step) : null;\n\n if (steps && stepIndex !== null && stepIndex >= 0 && stepIndex < steps.length) {\n const step = steps[stepIndex];\n const emojiCode = step.emojiUniCode;\n const label = typeof step.label !== 'undefined' ? step.label.toString() : undefined;\n\n return emojiCode && label ? `${emojiCode} ${label}` : emojiCode || label;\n }\n\n return undefined;\n };\n\n const getAriaLabeledById = (): string | undefined => {\n if (title && labelLeft && labelRight) {\n return [titleId, labelLeftId, labelRightId].join(' ');\n }\n if (title && labelLeft) {\n return [titleId, labelLeftId].join(' ');\n }\n if (title && labelRight) {\n return [titleId, labelRightId].join(' ');\n }\n if (title) {\n return titleId;\n }\n };\n\n const ariaLabelAttributes = getAriaLabelAttributes({\n label: ariaLabel,\n id: getAriaLabeledById(),\n prefer: 'label',\n });\n\n const getXPostionStyling = (index: number, stepsLength: number): { left: string } => {\n return { left: `${(index / (stepsLength - 1)) * 100}%` };\n };\n\n const renderEmojies = (): React.ReactNode => {\n return (\n <div className={styles['slider__emoji-container']}>\n {steps?.map((step, index) => {\n return (\n step.emojiUniCode && (\n <div\n aria-hidden={true}\n key={'emoji' + index}\n className={styles['slider__emoji']}\n style={getXPostionStyling(index, steps.length)}\n >\n {step.emojiUniCode}\n </div>\n )\n );\n })}\n </div>\n );\n };\n\n const renderSteps = (): React.ReactNode => {\n return steps?.map((_step, index) => {\n return <div key={'step' + index} className={styles['slider__track__step']} style={getXPostionStyling(index, steps.length)} />;\n });\n };\n\n const renderStepLabels = (): React.ReactNode => {\n return (\n <div className={styles['slider__value-container']}>\n {steps?.map((step, index) => {\n return (\n typeof step.label !== 'undefined' && (\n <div\n aria-hidden={true}\n key={'label' + index}\n className={styles['slider__value']}\n style={getXPostionStyling(index, steps.length)}\n >\n {step.label}\n </div>\n )\n );\n })}\n </div>\n );\n };\n\n return (\n <div className={styles.slider} data-testid={testId} data-analyticsid={AnalyticsId.Slider}>\n {title && (\n <Title className={styles['slider__title']} htmlMarkup={'h3'} margin={0} appearance={'title3'} id={titleId}>\n {title}\n </Title>\n )}\n <div className={styles['slider__content-container']}>\n {renderEmojies()}\n {/* Komponenten er tilgjengelig for mus/keyboard gjennom bruk av slideren */}\n {/* eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */}\n <div\n ref={trackRef}\n className={classNames(styles['slider__track-wrapper'], disabled && styles['slider__track-wrapper--disabled'])}\n onClick={handleTrackClick}\n onPointerDown={handlePointerDown}\n >\n <div className={classNames(styles.slider__track, disabled && styles['slider__track--disabled'])}>{renderSteps()}</div>\n <div\n role={disabled ? undefined : 'slider'}\n ref={markerRef}\n className={classNames(styles.slider__marker, disabled && styles['slider__marker--disabled'])}\n style={{\n left: `${markerXPos}px`,\n }}\n onKeyDown={handleKeyDown}\n aria-valuenow={value}\n aria-valuetext={getAriaValueText()}\n aria-valuemin={minValue}\n aria-valuemax={maxValue}\n tabIndex={disabled ? undefined : 0}\n aria-disabled={disabled}\n {...ariaLabelAttributes}\n />\n </div>\n {renderStepLabels()}\n </div>\n {(labelLeft || labelRight) && (\n <span className={styles.slider__options}>\n <span id={labelLeftId}>{labelLeft}</span>\n <span id={labelRightId}>{labelRight}</span>\n </span>\n )}\n </div>\n );\n};\n\nexport default Slider;\n"],"names":["useSafeNumberValue","initial","min","max","value","setValue","useState","setSafeValue","newValue","useEffect","Slider","title","ariaLabel","labelLeft","labelRight","disabled","onChange","steps","step","minValue","maxValue","testId","isMoving","setIsMoving","titleId","useUuid","labelLeftId","labelRightId","trackRef","useRef","markerRef","trackWidth","useSize","largeStep","handlePointerUp","getValueBasedOnMarkerPosition","markerPosition","trackPosition","_a","normalizedPosition","valueRange","handlePointerMove","handleKeyDown","e","flag","handleTrackClick","handlePointerDown","markerXPos","getAriaValueText","stepIndex","emojiCode","label","ariaLabelAttributes","getAriaLabelAttributes","getXPostionStyling","index","stepsLength","renderEmojies","React","styles","renderSteps","_step","renderStepLabels","AnalyticsId","Title","classNames","Slider$1"],"mappings":"sfAYA,MAAMA,EAAqB,CAACC,EAAiBC,EAAaC,IAAmD,CAC3G,KAAM,CAACC,EAAOC,CAAQ,EAAIC,EAASL,CAAO,EAEpCM,EAAgBC,GAA2B,CAC3CA,EAAWL,EACbE,EAASF,CAAG,EACHK,EAAWN,EACpBG,EAASH,CAAG,EAEZG,EAASG,CAAQ,CACnB,EAGF,OAAAC,EAAU,IAAM,CACJJ,GAAAF,EAAMD,GAAO,EAAIA,CAAG,CAAA,EAC7B,CAACA,EAAKC,CAAG,CAAC,EAEN,CAACC,EAAOG,CAAY,CAC7B,EAgCaG,EAAgC,CAAC,CAC5C,MAAAC,EACA,UAAAC,EACA,UAAAC,EACA,WAAAC,EACA,SAA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,MAAM,CAAA,EAE5CC,EAAK,KAAA,EAKhB,EAIJ,OACGwC,EAAA,cAAA,MAAA,CAAI,UAAWC,EAAO,OAAQ,cAAatC,EAAQ,mBAAkB0C,EAAY,QAC/EpD,GACC+C,EAAA,cAACM,EAAM,CAAA,UAAWL,EAAO,cAAkB,WAAY,KAAM,OAAQ,EAAG,WAAY,SAAU,GAAInC,CAC/F,EAAAb,CACH,EAEF+C,EAAA,cAAC,OAAI,UAAWC,EAAO,2BAA2B,GAC/CF,IAGDC,EAAA,cAAC,MAAA,CACC,IAAK9B,EACL,UAAWqC,EAAWN,EAAO,uBAAuB,EAAG5C,GAAY4C,EAAO,iCAAiC,CAAC,EAC5G,QAASd,EACT,cAAeC,CAAA,EAEdY,EAAA,cAAA,MAAA,CAAI,UAAWO,EAAWN,EAAO,cAAe5C,GAAY4C,EAAO,yBAAyB,CAAC,CAAI,EAAAC,EAAA,CAAc,EAChHF,EAAA,cAAC,MAAA,CACC,KAAM3C,EAAW,OAAY,SAC7B,IAAKe,EACL,UAAWmC,EAAWN,EAAO,eAAgB5C,GAAY4C,EAAO,0BAA0B,CAAC,EAC3F,MAAO,CACL,KAAM,GAAGZ,CAAU,IACrB,EACA,UAAWL,EACX,gBAAetC,EACf,iBAAgB4C,EAAiB,EACjC,gBAAe7B,EACf,gBAAeC,EACf,SAAUL,EAAW,OAAY,EACjC,gBAAeA,EACd,GAAGqC,CAAA,CACN,CACF,EACCU,GACH,GACEjD,GAAaC,IACb4C,EAAA,cAAC,OAAK,CAAA,UAAWC,EAAO,eAAA,kBACrB,OAAK,CAAA,GAAIjC,CAAc,EAAAb,CAAU,EAClC6C,EAAA,cAAC,QAAK,GAAI/B,CAAA,EAAeb,CAAW,CACtC,CAEJ,CAEJ,EAEAoD,GAAexD"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/Slider/Slider.tsx"],"sourcesContent":["import React, { useEffect, useState, useRef } from 'react';\n\nimport classNames from 'classnames';\n\nimport { AnalyticsId } from '../../constants';\nimport { useSize } from '../../hooks/useSize';\nimport { useUuid } from '../../hooks/useUuid';\nimport { getAriaLabelAttributes } from '../../utils/accessibility';\nimport Title from '../Title';\n\nimport styles from './styles.module.scss';\n\nconst useSafeNumberValue = (initial: number, min: number, max: number): [number, (value: number) => void] => {\n const [value, setValue] = useState(initial);\n\n const setSafeValue = (newValue: number): void => {\n if (newValue > max) {\n setValue(max);\n } else if (newValue < min) {\n setValue(min);\n } else {\n setValue(newValue);\n }\n };\n\n useEffect(() => {\n setValue((max - min) / 2 + min);\n }, [min, max]);\n\n return [value, setSafeValue];\n};\n\nexport type SliderStep = {\n label?: number | string;\n emojiUniCode?: string;\n};\n\ninterface SliderProps {\n /**\tSets the title of the slider. */\n title?: string;\n /** Adds the left hand label to the element. */\n labelLeft?: string;\n /** Adds the right hand label to the element. */\n labelRight?: string;\n /**\tSets aria-label of the slider. */\n ariaLabel?: string;\n /** Disables the slider element. */\n disabled?: boolean;\n /** Sets the minimum allowed value on the slider - this overrides the use of steps prop for minValue/maxValue. */\n minValue?: number;\n /** Sets the maximum allowed value on the slider - this overrides the use of steps prop for minValue/maxValue. */\n maxValue?: number;\n /** Function to be called when the value state has changed. */\n onChange?: (value: number) => void;\n /** If set to false will only trigger onChange once a user interaction has been made, updates to this prop will be taken into account - true by default */\n selected?: boolean;\n /** Sets the steps data for the slider */\n steps?: SliderStep[];\n /** Sets the step to move per point in the slider */\n step?: number;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\nexport const Slider: React.FC<SliderProps> = ({\n title,\n ariaLabel,\n labelLeft,\n labelRight,\n disabled = false,\n onChange,\n steps,\n step = 1,\n minValue = 0,\n maxValue = steps ? steps.length - 1 : 100,\n selected = true,\n testId,\n}) => {\n const [isMoving, setIsMoving] = useState(false);\n const [selectedState, setSelectedState] = useState(selected);\n const [value, setValue] = useSafeNumberValue((maxValue - minValue) / 2 + minValue, minValue, maxValue);\n\n const titleId = useUuid();\n const labelLeftId = useUuid();\n const labelRightId = useUuid();\n const trackRef = useRef<HTMLDivElement>(null);\n const markerRef = useRef<HTMLDivElement>(null);\n const { width: trackWidth } = useSize(trackRef) || { width: 0 };\n const largeStep = maxValue / 10;\n\n useEffect(() => {\n const handlePointerUp = (): void => {\n setIsMoving(false);\n };\n\n document.addEventListener('pointerup', handlePointerUp);\n\n return () => {\n document.removeEventListener('pointerup', handlePointerUp);\n };\n }, []);\n\n const getValueBasedOnMarkerPosition = (markerPosition: number): number => {\n const trackPosition = trackRef.current?.getBoundingClientRect().x ?? 0;\n\n // Calculate the normalized position (0 to 1) of the marker along the track\n const normalizedPosition = (markerPosition - trackPosition) / trackWidth;\n const valueRange = maxValue - minValue;\n // Calculate the value without considering the step\n let value = normalizedPosition * valueRange + minValue;\n // Adjust the value to account for the step increment\n const stepCount = Math.round(value / step);\n value = stepCount * step;\n value = Math.max(minValue, Math.min(maxValue, value));\n\n return value;\n };\n\n useEffect(() => {\n const handlePointerMove = (e: PointerEvent): void => {\n if (!disabled && isMoving) {\n const newValue = getValueBasedOnMarkerPosition(e.clientX);\n setValue(newValue);\n }\n };\n\n document.addEventListener('pointermove', handlePointerMove);\n\n return () => {\n document.removeEventListener('pointermove', handlePointerMove);\n };\n }, [isMoving]);\n\n useEffect(() => {\n if (!disabled && selectedState && onChange) {\n onChange(value);\n }\n }, [value, selectedState]);\n\n useEffect(() => {\n if (selected !== selectedState) {\n setSelectedState(selected);\n }\n }, [selected]);\n\n const handleSelected = (): void => {\n if (selectedState === false) {\n setSelectedState(true);\n }\n };\n\n const handleKeyDown: React.KeyboardEventHandler<HTMLDivElement> = e => {\n if (disabled) return;\n\n let flag = false;\n\n switch (e.key) {\n case 'ArrowLeft':\n case 'ArrowDown':\n setValue(value - step);\n flag = true;\n break;\n case 'PageDown':\n setValue(value - largeStep);\n flag = true;\n break;\n case 'ArrowRight':\n case 'ArrowUp':\n setValue(value + step);\n flag = true;\n break;\n case 'PageUp':\n setValue(value + largeStep);\n flag = true;\n break;\n case 'Home':\n setValue(minValue);\n flag = true;\n break;\n case 'End':\n setValue(maxValue);\n flag = true;\n break;\n default:\n break;\n }\n\n if (flag) {\n handleSelected();\n e.preventDefault();\n e.stopPropagation();\n }\n };\n\n const handleTrackClick: React.MouseEventHandler<HTMLDivElement> = e => {\n if (disabled) return;\n\n handleSelected();\n const newValue = getValueBasedOnMarkerPosition(e.clientX);\n setValue(newValue);\n markerRef.current?.focus();\n };\n\n const handlePointerDown: React.PointerEventHandler<HTMLDivElement> = e => {\n if (disabled) return;\n\n setIsMoving(true);\n\n e.preventDefault();\n e.stopPropagation();\n\n markerRef.current?.focus();\n };\n\n const markerXPos = maxValue !== minValue ? (trackWidth / (maxValue - minValue)) * (value - minValue) : 0;\n\n const getAriaValueText = (): string | undefined => {\n const stepIndex = steps ? Math.round((value - minValue) / step) : null;\n\n if (steps && stepIndex !== null && stepIndex >= 0 && stepIndex < steps.length) {\n const step = steps[stepIndex];\n const emojiCode = step.emojiUniCode;\n const label = typeof step.label !== 'undefined' ? step.label.toString() : undefined;\n\n return emojiCode && label ? `${emojiCode} ${label}` : emojiCode || label;\n }\n\n return undefined;\n };\n\n const getAriaLabeledById = (): string | undefined => {\n if (title && labelLeft && labelRight) {\n return [titleId, labelLeftId, labelRightId].join(' ');\n }\n if (title && labelLeft) {\n return [titleId, labelLeftId].join(' ');\n }\n if (title && labelRight) {\n return [titleId, labelRightId].join(' ');\n }\n if (title) {\n return titleId;\n }\n };\n\n const ariaLabelAttributes = getAriaLabelAttributes({\n label: ariaLabel,\n id: getAriaLabeledById(),\n prefer: 'label',\n });\n\n const getXPostionStyling = (index: number, stepsLength: number): { left: string } => {\n return { left: `${(index / (stepsLength - 1)) * 100}%` };\n };\n\n const renderEmojies = (): React.ReactNode => {\n return (\n <div className={styles['slider__emoji-container']}>\n {steps?.map((step, index) => {\n return (\n step.emojiUniCode && (\n <div\n aria-hidden={true}\n key={'emoji' + index}\n className={styles['slider__emoji']}\n style={getXPostionStyling(index, steps.length)}\n >\n {step.emojiUniCode}\n </div>\n )\n );\n })}\n </div>\n );\n };\n\n const renderSteps = (): React.ReactNode => {\n return steps?.map((_step, index) => {\n return <div key={'step' + index} className={styles['slider__track__step']} style={getXPostionStyling(index, steps.length)} />;\n });\n };\n\n const renderStepLabels = (): React.ReactNode => {\n return (\n <div className={styles['slider__value-container']}>\n {steps?.map((step, index) => {\n return (\n typeof step.label !== 'undefined' && (\n <div\n aria-hidden={true}\n key={'label' + index}\n className={styles['slider__value']}\n style={getXPostionStyling(index, steps.length)}\n >\n {step.label}\n </div>\n )\n );\n })}\n </div>\n );\n };\n\n return (\n <div className={styles.slider} data-testid={testId} data-analyticsid={AnalyticsId.Slider}>\n {title && (\n <Title className={styles['slider__title']} htmlMarkup={'h3'} margin={0} appearance={'title3'} id={titleId}>\n {title}\n </Title>\n )}\n <div className={styles['slider__content-container']}>\n {renderEmojies()}\n {/* Komponenten er tilgjengelig for mus/keyboard gjennom bruk av slideren */}\n {/* eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */}\n <div\n ref={trackRef}\n className={classNames(styles['slider__track-wrapper'], disabled && styles['slider__track-wrapper--disabled'])}\n onClick={handleTrackClick}\n onPointerDown={handlePointerDown}\n >\n <div className={classNames(styles.slider__track, disabled && styles['slider__track--disabled'])}>{renderSteps()}</div>\n <div\n role={disabled ? undefined : 'slider'}\n ref={markerRef}\n className={classNames(styles.slider__marker, {\n [styles['slider__marker--disabled']]: disabled,\n [styles['slider__marker--selected']]: selectedState,\n })}\n style={{\n left: `${markerXPos}px`,\n }}\n onKeyDown={handleKeyDown}\n aria-valuenow={value}\n aria-valuetext={getAriaValueText()}\n aria-valuemin={minValue}\n aria-valuemax={maxValue}\n tabIndex={disabled ? undefined : 0}\n aria-disabled={disabled}\n {...ariaLabelAttributes}\n />\n </div>\n {renderStepLabels()}\n </div>\n {(labelLeft || labelRight) && (\n <span className={styles.slider__options}>\n <span id={labelLeftId}>{labelLeft}</span>\n <span id={labelRightId}>{labelRight}</span>\n </span>\n )}\n </div>\n );\n};\n\nexport default Slider;\n"],"names":["useSafeNumberValue","initial","min","max","value","setValue","useState","setSafeValue","newValue","useEffect","Slider","title","ariaLabel","labelLeft","labelRight","disabled","onChange","steps","step","minValue","maxValue","selected","testId","isMoving","setIsMoving","selectedState","setSelectedState","titleId","useUuid","labelLeftId","labelRightId","trackRef","useRef","markerRef","trackWidth","useSize","largeStep","handlePointerUp","getValueBasedOnMarkerPosition","markerPosition","trackPosition","_a","normalizedPosition","valueRange","handlePointerMove","handleSelected","handleKeyDown","e","flag","handleTrackClick","handlePointerDown","markerXPos","getAriaValueText","stepIndex","emojiCode","label","ariaLabelAttributes","getAriaLabelAttributes","getXPostionStyling","index","stepsLength","renderEmojies","React","styles","renderSteps","_step","renderStepLabels","AnalyticsId","Title","classNames","Slider$1"],"mappings":"sfAYA,MAAMA,GAAqB,CAACC,EAAiBC,EAAaC,IAAmD,CAC3G,KAAM,CAACC,EAAOC,CAAQ,EAAIC,EAASL,CAAO,EAEpCM,EAAgBC,GAA2B,CAC3CA,EAAWL,EACbE,EAASF,CAAG,EACHK,EAAWN,EACpBG,EAASH,CAAG,EAEZG,EAASG,CAAQ,CACnB,EAGF,OAAAC,EAAU,IAAM,CACJJ,GAAAF,EAAMD,GAAO,EAAIA,CAAG,CAAA,EAC7B,CAACA,EAAKC,CAAG,CAAC,EAEN,CAACC,EAAOG,CAAY,CAC7B,EAkCaG,GAAgC,CAAC,CAC5C,MAAAC,EACA,UAAAC,EACA,UAAAC,EACA,WAAAC,EACA,SAAAC,EAAW,GACX,SAAAC,EACA,MAAAC,EACA,KAAAC,EAAO,EACP,SAAAC,EAAW,EACX,SAAAC,EAAWH,EAAQA,EAAM,OAAS,EAAI,IACtC,SAAAI,EAAW,GACX,OAAAC,CACF,IAAM,CACJ,KAAM,CAACC,EAAUC,CAAW,EAAIlB,EAAS,EAAK,EACxC,CAACmB,EAAeC,CAAgB,EAAIpB,EAASe,CAAQ,EACrD,CAACj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
92
|
}
|
|
93
93
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
94
|
+
&--selected {
|
|
95
|
+
&::after {
|
|
96
|
+
content: '';
|
|
97
|
+
width: 1.25rem;
|
|
98
|
+
height: 1.25rem;
|
|
99
|
+
border: 0.1rem solid $black;
|
|
100
|
+
border-radius: 10rem;
|
|
101
|
+
background-color: $blueberry600;
|
|
102
|
+
|
|
103
|
+
:hover > &,
|
|
104
|
+
:focus > & {
|
|
105
|
+
background-color: $blueberry700;
|
|
106
|
+
}
|
|
105
107
|
}
|
|
106
108
|
}
|
|
107
109
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TitleTags } from './../Title/Title';
|
|
3
3
|
interface TileProps extends Pick<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'href' | 'target' | 'onClick' | 'rel'> {
|
|
4
|
+
children?: React.ReactNode;
|
|
4
5
|
/** Adds custom classes to the element. */
|
|
5
6
|
className?: string;
|
|
6
7
|
/** Sets the icon to be displayed inside the tile. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tile.d.ts","sourceRoot":"","sources":["../../../src/components/Tile/Tile.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAQ7C,UAAU,SAAU,SAAQ,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,GAAG,KAAK,CAAC;IACpH,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qDAAqD;IACrD,IAAI,EAAE,KAAK,CAAC,YAAY,CAAC;IACzB,sDAAsD;IACtD,KAAK,EAAE,KA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DAAiD;IACjD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,4DAA4D;IAC5D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mDAAmD;IACnD,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,sCAAsC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,UAAU,cAAc;IACtB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,YAAa,SAAQ,KAAK,CAAC,yBAAyB,CAAC,SAAS,GAAG,KAAK,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAC;IACvH,KAAK,EAAE,KAAK,CAAC,yBAAyB,CAAC,cAAc,GAAG,KAAK,CAAC,aAAa,CAAC,kBAAkB,CAAC,CAAC,CAAC;CAClG;AAuBD,eAAO,MAAM,IAAI,cAiDC,CAAC;AAKnB,eAAe,IAAI,CAAC"}
|
package/components/Tile/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import t from"react";import d from"classnames";import{AnalyticsId as C,IconSize as R}from"../../constants.js";import{useHover as k}from"../../hooks/useHover.js";import{mergeRefs as
|
|
1
|
+
import t from"react";import d from"classnames";import{AnalyticsId as C,IconSize as R}from"../../constants.js";import{useHover as k}from"../../hooks/useHover.js";import{mergeRefs as x}from"../../utils/refs.js";import"../Icons/Icon.js";import e from"./styles.module.scss";import"../../hooks/usePseudoClasses.js";import"../../hooks/useUuid.js";import"../../uuid.js";import"../../utils/environment.js";const _=t.forwardRef((r,s)=>{const{children:a,className:o,htmlMarkup:c="span",highlighted:m,compact:i}=r,n=d(e.tile__title,{[e["tile__title--highlighted"]]:m,[e["tile__title--compact"]]:i},o),l=c;return t.createElement(l,{className:n,ref:s},a)});_.displayName="Title";const f=t.forwardRef((r,s)=>{const{children:a,icon:o,title:c,className:m="",description:i,fixed:n=!1,highlighted:l=!1,testId:g,target:h,rel:N,href:T,onClick:u}=r,{hoverRef:E,isHovered:v}=k(),p=!i,w=d(e.tile,{[e["tile--fixed"]]:n,[e["tile--compact"]]:p,[e["tile--highlighted"]]:l},m),y=d(e["title-wrapper"],{[e["title-wrapper--compact"]]:p});return t.createElement("a",{ref:x([s,E]),href:T,target:h,rel:h==="_blank"?"noopener noreferrer":N,className:w,"data-testid":g,"data-analyticsid":C.Tile,onClick:u},t.createElement("div",{className:y},t.cloneElement(o,{size:R.Medium,isHovered:v,color:l?"white":"black"}),t.cloneElement(c,{highlighted:l,compact:p})),i&&t.createElement("p",{className:e.tile__description},i),a&&t.createElement("div",{className:e.tile__children},a))});f.displayName="Tile";f.Title=_;const B=f;export{f as Tile,B as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/Tile/Tile.tsx"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport { TitleTags } from './../Title/Title';\nimport { AnalyticsId } from '../../constants';\nimport { useHover } from '../../hooks/useHover';\nimport { mergeRefs } from '../../utils/refs';\nimport { IconSize } from '../Icons';\n\nimport tileStyles from './styles.module.scss';\n\ninterface TileProps extends Pick<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'href' | 'target' | 'onClick' | 'rel'> {\n /** Adds custom classes to the element. */\n className?: string;\n /**\tSets the icon to be displayed inside the tile. */\n icon: React.ReactElement;\n /**\tSets the title to be displayed inside the tile. */\n title: React.ReactElement;\n /** Toggles the highlighted style of the tile. */\n highlighted?: boolean;\n /** Sets the description to be displayed inside the tile. */\n description?: string;\n /** Sets a fixed max and min width for the tile. */\n fixed?: boolean;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\ninterface TileTitleProps {\n children: React.ReactNode;\n className?: string;\n htmlMarkup?: TitleTags;\n highlighted?: boolean;\n compact?: boolean;\n}\n\nexport interface TileCompound extends React.ForwardRefExoticComponent<TileProps & React.RefAttributes<HTMLAnchorElement>> {\n Title: React.ForwardRefExoticComponent<TileTitleProps & React.RefAttributes<HTMLHeadingElement>>;\n}\n\nconst Title = React.forwardRef<HTMLHeadingElement, TileTitleProps>((props, ref) => {\n const { children, className, htmlMarkup = 'span', highlighted, compact } = props;\n const titleClasses = classNames(\n tileStyles['tile__title'],\n {\n [tileStyles['tile__title--highlighted']]: highlighted,\n [tileStyles['tile__title--compact']]: compact,\n },\n className\n );\n const CustomTag = htmlMarkup;\n\n return (\n <CustomTag className={titleClasses} ref={ref}>\n {children}\n </CustomTag>\n );\n});\n\nTitle.displayName = 'Title';\n\nexport const Tile = React.forwardRef<HTMLAnchorElement, TileProps>((props, ref) => {\n const {
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/Tile/Tile.tsx"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport { TitleTags } from './../Title/Title';\nimport { AnalyticsId } from '../../constants';\nimport { useHover } from '../../hooks/useHover';\nimport { mergeRefs } from '../../utils/refs';\nimport { IconSize } from '../Icons';\n\nimport tileStyles from './styles.module.scss';\n\ninterface TileProps extends Pick<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'href' | 'target' | 'onClick' | 'rel'> {\n children?: React.ReactNode;\n /** Adds custom classes to the element. */\n className?: string;\n /**\tSets the icon to be displayed inside the tile. */\n icon: React.ReactElement;\n /**\tSets the title to be displayed inside the tile. */\n title: React.ReactElement;\n /** Toggles the highlighted style of the tile. */\n highlighted?: boolean;\n /** Sets the description to be displayed inside the tile. */\n description?: string;\n /** Sets a fixed max and min width for the tile. */\n fixed?: boolean;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\ninterface TileTitleProps {\n children: React.ReactNode;\n className?: string;\n htmlMarkup?: TitleTags;\n highlighted?: boolean;\n compact?: boolean;\n}\n\nexport interface TileCompound extends React.ForwardRefExoticComponent<TileProps & React.RefAttributes<HTMLAnchorElement>> {\n Title: React.ForwardRefExoticComponent<TileTitleProps & React.RefAttributes<HTMLHeadingElement>>;\n}\n\nconst Title = React.forwardRef<HTMLHeadingElement, TileTitleProps>((props, ref) => {\n const { children, className, htmlMarkup = 'span', highlighted, compact } = props;\n const titleClasses = classNames(\n tileStyles['tile__title'],\n {\n [tileStyles['tile__title--highlighted']]: highlighted,\n [tileStyles['tile__title--compact']]: compact,\n },\n className\n );\n const CustomTag = htmlMarkup;\n\n return (\n <CustomTag className={titleClasses} ref={ref}>\n {children}\n </CustomTag>\n );\n});\n\nTitle.displayName = 'Title';\n\nexport const Tile = React.forwardRef<HTMLAnchorElement, TileProps>((props, ref) => {\n const {\n children,\n icon,\n title,\n className = '',\n description,\n fixed = false,\n highlighted = false,\n testId,\n target,\n rel,\n href,\n onClick,\n } = props;\n const { hoverRef, isHovered } = useHover<HTMLAnchorElement>();\n const compact = !description;\n const tileClasses = classNames(\n tileStyles.tile,\n {\n [tileStyles['tile--fixed']]: fixed,\n [tileStyles['tile--compact']]: compact,\n [tileStyles['tile--highlighted']]: highlighted,\n },\n className\n );\n const tileTitleWrapperClasses = classNames(tileStyles['title-wrapper'], {\n [tileStyles['title-wrapper--compact']]: compact,\n });\n\n return (\n <a\n ref={mergeRefs([ref, hoverRef])}\n href={href}\n target={target}\n rel={target === '_blank' ? 'noopener noreferrer' : rel}\n className={tileClasses}\n data-testid={testId}\n data-analyticsid={AnalyticsId.Tile}\n onClick={onClick}\n >\n <div className={tileTitleWrapperClasses}>\n {React.cloneElement(icon, { size: IconSize.Medium, isHovered, color: highlighted ? 'white' : 'black' })}\n {React.cloneElement(title, { highlighted: highlighted, compact: compact })}\n </div>\n {description && <p className={tileStyles.tile__description}>{description}</p>}\n {children && <div className={tileStyles.tile__children}>{children}</div>}\n </a>\n );\n}) as TileCompound;\n\nTile.displayName = 'Tile';\nTile.Title = Title;\n\nexport default Tile;\n"],"names":["Title","React","props","ref","children","className","htmlMarkup","highlighted","compact","titleClasses","classNames","tileStyles","CustomTag","Tile","icon","title","description","fixed","testId","target","rel","href","onClick","hoverRef","isHovered","useHover","tileClasses","tileTitleWrapperClasses","mergeRefs","AnalyticsId","IconSize","Tile$1"],"mappings":"8YA0CA,MAAMA,EAAQC,EAAM,WAA+C,CAACC,EAAOC,IAAQ,CACjF,KAAM,CAAE,SAAAC,EAAU,UAAAC,EAAW,WAAAC,EAAa,OAAQ,YAAAC,EAAa,QAAAC,CAAY,EAAAN,EACrEO,EAAeC,EACnBC,EAAW,YACX,CACE,CAACA,EAAW,0BAA0B,CAAC,EAAGJ,EAC1C,CAACI,EAAW,sBAAsB,CAAC,EAAGH,CACxC,EACAH,CAAA,EAEIO,EAAYN,EAElB,OACGL,EAAA,cAAAW,EAAA,CAAU,UAAWH,EAAc,IAAAN,GACjCC,CACH,CAEJ,CAAC,EAEDJ,EAAM,YAAc,QAEb,MAAMa,EAAOZ,EAAM,WAAyC,CAACC,EAAOC,IAAQ,CAC3E,KAAA,CACJ,SAAAC,EACA,KAAAU,EACA,MAAAC,EACA,UAAAV,EAAY,GACZ,YAAAW,EACA,MAAAC,EAAQ,GACR,YAAAV,EAAc,GACd,OAAAW,EACA,OAAAC,EACA,IAAAC,EACA,KAAAC,EACA,QAAAC,CACE,EAAApB,EACE,CAAE,SAAAqB,EAAU,UAAAC,CAAU,EAAIC,EAA4B,EACtDjB,EAAU,CAACQ,EACXU,EAAchB,EAClBC,EAAW,KACX,CACE,CAACA,EAAW,aAAa,CAAC,EAAGM,EAC7B,CAACN,EAAW,eAAe,CAAC,EAAGH,EAC/B,CAACG,EAAW,mBAAmB,CAAC,EAAGJ,CACrC,EACAF,CAAA,EAEIsB,EAA0BjB,EAAWC,EAAW,eAAe,EAAG,CACtE,CAACA,EAAW,wBAAwB,CAAC,EAAGH,CAAA,CACzC,EAGC,OAAAP,EAAA,cAAC,IAAA,CACC,IAAK2B,EAAU,CAACzB,EAAKoB,CAAQ,CAAC,EAC9B,KAAAF,EACA,OAAAF,EACA,IAAKA,IAAW,SAAW,sBAAwBC,EACnD,UAAWM,EACX,cAAaR,EACb,mBAAkBW,EAAY,KAC9B,QAAAP,CAAA,EAEArB,EAAA,cAAC,MAAI,CAAA,UAAW0B,CACb,EAAA1B,EAAM,aAAaa,EAAM,CAAE,KAAMgB,EAAS,OAAQ,UAAAN,EAAW,MAAOjB,EAAc,QAAU,OAAQ,CAAC,EACrGN,EAAM,aAAac,EAAO,CAAE,YAAAR,EAA0B,QAAAC,CAAkB,CAAA,CAC3E,EACCQ,GAAgBf,EAAA,cAAA,IAAA,CAAE,UAAWU,EAAW,mBAAoBK,CAAY,EACxEZ,GAAaH,EAAA,cAAA,MAAA,CAAI,UAAWU,EAAW,gBAAiBP,CAAS,CAAA,CAGxE,CAAC,EAEDS,EAAK,YAAc,OACnBA,EAAK,MAAQb,EAEb,MAAA+B,EAAelB"}
|
package/package.json
CHANGED
package/scss/_font-settings.scss
CHANGED
package/scss/_title.scss
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
@import './breakpoints';
|
|
4
4
|
@import './font-settings';
|
|
5
5
|
|
|
6
|
+
// @todo rename denne filen til font-mixins e.l.
|
|
7
|
+
|
|
6
8
|
@mixin title-feature {
|
|
7
9
|
font-size: 2.375rem;
|
|
8
10
|
line-height: 2.875rem;
|
|
@@ -63,3 +65,14 @@
|
|
|
63
65
|
font-size: $font-size-sm;
|
|
64
66
|
}
|
|
65
67
|
}
|
|
68
|
+
|
|
69
|
+
@mixin legend {
|
|
70
|
+
font-size: 1.25rem;
|
|
71
|
+
line-height: 1.75rem;
|
|
72
|
+
font-weight: 600;
|
|
73
|
+
|
|
74
|
+
@media (min-width: map.get($grid-breakpoints, md)) {
|
|
75
|
+
font-size: 1.5rem;
|
|
76
|
+
line-height: 2rem;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -51,14 +51,7 @@ import designsystemtypography from './scss/typography.scss'
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
.legend {
|
|
54
|
-
|
|
55
|
-
line-height: 1.625rem;
|
|
56
|
-
font-weight: 600;
|
|
57
|
-
|
|
58
|
-
@media (min-width: map.get($grid-breakpoints, md)) {
|
|
59
|
-
font-size: getSpacer(m);
|
|
60
|
-
line-height: $lineheight-size-md;
|
|
61
|
-
}
|
|
54
|
+
@include legend;
|
|
62
55
|
}
|
|
63
56
|
|
|
64
57
|
.label {
|