@helsenorge/designsystem-react 3.0.0 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. package/CHANGELOG.md +380 -668
  2. package/HelpBubble.js +1 -1
  3. package/HelpBubble.js.map +1 -1
  4. package/HorizontalScroll.js.map +1 -1
  5. package/Input.js +1 -1
  6. package/Input.js.map +1 -1
  7. package/ListHeader.js +1 -1
  8. package/ListHeader.js.map +1 -1
  9. package/Modal.js.map +1 -1
  10. package/PopOver.js +1 -1
  11. package/PopOver.js.map +1 -1
  12. package/RadioButton.js +1 -1
  13. package/RadioButton.js.map +1 -1
  14. package/Textarea.js +1 -1
  15. package/Textarea.js.map +1 -1
  16. package/Title.js.map +1 -1
  17. package/Tooltip.js.map +1 -1
  18. package/TooltipWord.js +1 -1
  19. package/TooltipWord.js.map +1 -1
  20. package/components/AnchorLink/styles.module.scss +11 -6
  21. package/components/Avatar/styles.module.scss +2 -2
  22. package/components/Badge/styles.module.scss +7 -1
  23. package/components/Button/styles.module.scss +35 -21
  24. package/components/Checkbox/styles.module.scss +12 -12
  25. package/components/Close/styles.module.scss +15 -7
  26. package/components/Dropdown/index.js +1 -1
  27. package/components/Dropdown/index.js.map +1 -1
  28. package/components/Dropdown/styles.module.scss +31 -10
  29. package/components/Duolist/styles.module.scss +5 -3
  30. package/components/ErrorWrapper/styles.module.scss +8 -6
  31. package/components/Expander/styles.module.scss +46 -15
  32. package/components/ExpanderHierarchy/expander.module.scss +13 -8
  33. package/components/ExpanderHierarchy/expander.module.scss.d.ts +1 -1
  34. package/components/ExpanderHierarchy/styles.module.scss +3 -3
  35. package/components/ExpanderList/index.js.map +1 -1
  36. package/components/ExpanderList/styles.module.scss +17 -6
  37. package/components/FormExample/FormExample.d.ts.map +1 -1
  38. package/components/FormExample/index.js.map +1 -1
  39. package/components/FormExample/styles.module.scss +6 -6
  40. package/components/FormGroup/styles.module.scss +5 -4
  41. package/components/FormLayout/styles.module.scss +5 -2
  42. package/components/HelpBubble/HelpBubble.d.ts +2 -2
  43. package/components/HelpBubble/HelpBubble.d.ts.map +1 -1
  44. package/components/HelpBubble/index.js +1 -1
  45. package/components/HelpBubble/styles.module.scss +10 -10
  46. package/components/HelpBubble/styles.module.scss.d.ts +0 -1
  47. package/components/HelpBubbleExample/index.js +1 -1
  48. package/components/HighlightBox/index.js.map +1 -1
  49. package/components/HighlightBox/styles.module.scss +38 -29
  50. package/components/HorizontalScroll/HorizontalScroll.d.ts.map +1 -1
  51. package/components/HorizontalScroll/styles.module.scss +10 -3
  52. package/components/Icons/SortUp.js +1 -1
  53. package/components/Icons/SortUp.js.map +1 -1
  54. package/components/Input/Input.d.ts.map +1 -1
  55. package/components/Input/styles.module.scss +8 -7
  56. package/components/LinkList/styles.module.scss +23 -5
  57. package/components/List/styles.module.scss +4 -0
  58. package/components/ListHeader/ListHeader.d.ts +9 -7
  59. package/components/ListHeader/ListHeader.d.ts.map +1 -1
  60. package/components/ListHeader/styles.module.scss +36 -11
  61. package/components/Loader/styles.module.scss +40 -18
  62. package/components/Logo/index.js.map +1 -1
  63. package/components/MaxCharacters/styles.module.scss +7 -5
  64. package/components/Modal/styles.module.scss +39 -23
  65. package/components/NotificationPanel/DetailButton/styles.module.scss +9 -5
  66. package/components/NotificationPanel/index.js.map +1 -1
  67. package/components/NotificationPanel/styles.module.scss +45 -12
  68. package/components/Panel/styles.module.scss +53 -29
  69. package/components/PanelList/styles.module.scss +6 -5
  70. package/components/PopMenu/PopMenu.d.ts.map +1 -1
  71. package/components/PopMenu/styles.module.scss +28 -7
  72. package/components/PopOver/PopOver.d.ts +5 -3
  73. package/components/PopOver/PopOver.d.ts.map +1 -1
  74. package/components/PopOver/componentdata.json +1 -1
  75. package/components/PopOver/styles.module.scss +16 -13
  76. package/components/RadioButton/RadioButton.d.ts.map +1 -1
  77. package/components/RadioButton/styles.module.scss +12 -14
  78. package/components/Select/styles.module.scss +14 -8
  79. package/components/Slider/Slider.d.ts.map +1 -1
  80. package/components/Slider/index.js +1 -1
  81. package/components/Slider/index.js.map +1 -1
  82. package/components/Slider/styles.module.scss +1 -1
  83. package/components/Spacer/styles.module.scss +13 -1
  84. package/components/StatusDot/styles.module.scss +2 -2
  85. package/components/Stepper/styles.module.scss +28 -20
  86. package/components/Table/Table.d.ts.map +1 -1
  87. package/components/Table/index.js +1 -1
  88. package/components/Table/index.js.map +1 -1
  89. package/components/Table/styles.module.scss +32 -20
  90. package/components/Tag/styles.module.scss +39 -27
  91. package/components/TagList/styles.module.scss +3 -3
  92. package/components/Textarea/Textarea.d.ts.map +1 -1
  93. package/components/Textarea/styles.module.scss +6 -5
  94. package/components/Tile/styles.module.scss +11 -6
  95. package/components/Title/Title.d.ts +1 -1
  96. package/components/Title/Title.d.ts.map +1 -1
  97. package/components/Title/styles.module.scss +5 -0
  98. package/components/Tooltip/TooltipWord/TooltipWord.d.ts +1 -1
  99. package/components/Tooltip/TooltipWord/TooltipWord.d.ts.map +1 -1
  100. package/components/Tooltip/TooltipWord/styles.module.scss +3 -3
  101. package/components/Tooltip/index.js +1 -1
  102. package/components/TooltipExample/index.js +1 -1
  103. package/components/Validation/styles.module.scss +3 -3
  104. package/hoc/withBreakpoint/withBreakpoint.d.ts +1 -1
  105. package/hoc/withBreakpoint/withBreakpoint.d.ts.map +1 -1
  106. package/hoc/withBreakpoint/withBreakpoint.js.map +1 -1
  107. package/hooks/useFocusTrap.d.ts.map +1 -1
  108. package/hooks/useFocusTrap.js.map +1 -1
  109. package/hooks/useSize.js.map +1 -1
  110. package/package.json +1 -1
  111. package/scss/_body.scss +3 -1
  112. package/scss/_breakpoints.scss +5 -8
  113. package/scss/_figma-tokens.scss +2 -2
  114. package/scss/_fonts.scss +36 -21
  115. package/scss/_grid.scss +5 -4
  116. package/scss/_input.scss +20 -11
  117. package/scss/_palette.scss +3 -11
  118. package/scss/_print.scss +58 -18
  119. package/scss/_screen-reader.scss +0 -2
  120. package/scss/_spacers.scss +17 -15
  121. package/scss/_title.scss +11 -5
  122. package/scss/helsenorge.scss +1 -1
  123. package/scss/typography.module.scss +20 -13
  124. package/utils/component.d.ts +1 -0
  125. package/utils/component.d.ts.map +1 -1
  126. package/utils/component.js +1 -1
  127. package/utils/component.js.map +1 -1
  128. package/utils/debounce.d.ts +1 -2
  129. package/utils/debounce.d.ts.map +1 -1
  130. package/utils/debounce.js +1 -1
  131. package/utils/debounce.js.map +1 -1
@@ -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 \"region\". 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 const ariaLabelAttributes = getAriaLabelAttributes({ label, id: uuid });\n\n const ariaRole = role || (variant === 'alert' && 'alert') || 'region';\n\n return (\n <FluidWrapper fluid={fluid} variant={variant}>\n <section\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 </section>\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":"0rCAoBO,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,mBAAkBC,EAAY,SAAW,GAAGL,CACjE,EAAAL,kBACAW,EAAK,CAAA,QAASd,EAAae,EAAYC,CAAA,CAAa,CACvD,CACF,EACChB,GAAeW,EAAA,cAAA,MAAA,CAAI,UAAWF,EAAWC,EAAO,6CAA6C,CAAC,GAAId,CAAQ,CAC7G,CAEJ,ECaMqB,EAAyC,CAAC,CAAE,MAAAC,EAAO,QAAAC,EAAS,SAAAC,KAAe,CAC/E,GAAIF,EAAO,CACT,MAAMG,EAAeZ,EAAWC,EAAO,eAAe,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B,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 \"region\". 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 const ariaLabelAttributes = getAriaLabelAttributes({ label, id: uuid });\n\n const ariaRole = role || (variant === 'alert' && 'alert') || 'region';\n\n return (\n <FluidWrapper fluid={fluid} variant={variant}>\n <section\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 </section>\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":"0rCAoBO,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,mBAAkBC,EAAY,SAAW,GAAGL,CACjE,EAAAL,kBACAW,EAAK,CAAA,QAASd,EAAae,EAAYC,CAAA,CAAa,CACvD,CACF,EACChB,GAAeW,EAAA,cAAA,MAAA,CAAI,UAAWF,EAAWC,EAAO,6CAA6C,CAAC,GAAId,CAAQ,CAC7G,CAEJ,ECaMqB,EAAyC,CAAC,CAAE,MAAAC,EA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AAa,CAAA,MAAAC,EAAc,QAAAC,CAC1B,EAAAR,EAAA,cAAC,UAAA,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,36 +1,42 @@
1
- @import '../../scss/_spacers.scss';
2
- @import '../../scss/_breakpoints.scss';
3
- @import '../../scss/_font-settings.scss';
4
- @import '../../scss/_palette.scss';
5
- @import '../AnchorLink/styles.module.scss';
1
+ @use 'sass:map';
2
+ @import '../../scss/spacers';
3
+ @import '../../scss/breakpoints';
4
+ @import '../../scss/font-settings';
5
+ @import '../../scss/palette';
6
+ @import '../AnchorLink/styles.module';
6
7
 
7
8
  .notification-panel {
8
9
  $panel: &;
10
+
9
11
  display: flex;
10
12
  padding: getSpacer(2xs) getSpacer(s) getSpacer(2xs) getSpacer(2xs);
11
- box-shadow: 0.25rem 0.25rem 0.375rem rgba(0, 0, 0, 0.15);
13
+ box-shadow: 0.25rem 0.25rem 0.375rem rgb(0 0 0 / 15%);
12
14
  border-radius: 0.25rem;
13
15
 
14
- @media (min-width: map-get($grid-breakpoints, md)) {
16
+ @media (min-width: map.get($grid-breakpoints, md)) {
15
17
  padding-left: getSpacer(s);
16
18
  padding-right: getSpacer(m);
17
19
  #{$panel}__icon {
18
20
  margin-right: getSpacer(m);
19
21
  }
20
22
  }
23
+
21
24
  &__compact {
22
25
  width: fit-content;
23
26
  font-weight: 600;
24
27
  font-size: $font-size-xs;
25
28
  line-height: 1.25rem;
26
29
  box-shadow: none;
27
- @media (min-width: map-get($grid-breakpoints, md)) {
30
+
31
+ @media (min-width: map.get($grid-breakpoints, md)) {
28
32
  padding-left: getSpacer(2xs);
29
33
  padding-right: getSpacer(s);
30
34
  }
35
+
31
36
  &--basic {
32
37
  font-weight: 400;
33
38
  }
39
+
34
40
  &--outline {
35
41
  border: none;
36
42
  }
@@ -38,59 +44,75 @@
38
44
  #{$panel}__icon {
39
45
  margin-right: getSpacer(2xs);
40
46
  }
47
+
41
48
  &--dismissable {
42
49
  padding: getSpacer(2xs) getSpacer(2xs) getSpacer(m) getSpacer(2xs);
43
50
  }
51
+
44
52
  &--small {
45
- max-width: map-get($grid-breakpoints, sm);
53
+ max-width: map.get($grid-breakpoints, sm);
46
54
  }
55
+
47
56
  &--medium {
48
- max-width: map-get($grid-breakpoints, md);
57
+ max-width: map.get($grid-breakpoints, md);
49
58
  }
59
+
50
60
  &--large {
51
- max-width: map-get($grid-breakpoints, lg);
61
+ max-width: map.get($grid-breakpoints, lg);
52
62
  }
63
+
53
64
  &--info {
54
65
  border: 0.125rem solid $blueberry700;
55
66
  background-color: $blueberry50;
56
67
  }
68
+
57
69
  &--info.notification-panel__compact {
58
70
  box-shadow: none;
59
71
  background-color: transparent;
60
72
  }
73
+
61
74
  &--info.notification-panel__compact--basic {
62
75
  border: none;
63
76
  }
77
+
64
78
  &--warn {
65
79
  border: 0.125rem solid $banana700;
66
80
  background-color: $banana50;
67
81
  }
82
+
68
83
  &--warn.notification-panel__compact {
69
84
  box-shadow: none;
70
85
  background-color: transparent;
71
86
  }
87
+
72
88
  &--warn.notification-panel__compact--basic {
73
89
  border: none;
74
90
  }
91
+
75
92
  &--alert {
76
93
  border: 0.125rem solid $cherry700;
77
94
  background-color: $cherry50;
78
95
  }
96
+
79
97
  &--alert.notification-panel__compact {
80
98
  box-shadow: none;
81
99
  background-color: transparent;
82
100
  }
101
+
83
102
  &--alert.notification-panel__compact--basic {
84
103
  border: none;
85
104
  }
105
+
86
106
  &--success {
87
107
  border: 0.125rem solid $kiwi900;
88
108
  background-color: $kiwi50;
89
109
  }
110
+
90
111
  &--success.notification-panel__compact {
91
112
  box-shadow: none;
92
113
  background-color: transparent;
93
114
  }
115
+
94
116
  &--success.notification-panel__compact--basic {
95
117
  border: none;
96
118
  }
@@ -100,13 +122,16 @@
100
122
  margin-left: auto;
101
123
  padding-left: getSpacer(2xs);
102
124
  }
125
+
103
126
  &__content {
104
127
  align-self: center;
128
+
105
129
  a {
106
130
  @include anchorlink;
107
131
  @include anchorlink-icon;
108
132
  }
109
133
  }
134
+
110
135
  &__children.notification-panel__label-and-content--spacing {
111
136
  font-weight: 500;
112
137
  }
@@ -116,34 +141,42 @@
116
141
  font-size: $font-size-xs;
117
142
  line-height: $lineheight-size-xs;
118
143
  margin: 0;
119
- @media (min-width: map-get($grid-breakpoints, md)) {
144
+
145
+ @media (min-width: map.get($grid-breakpoints, md)) {
120
146
  font-size: $font-size-sm;
121
147
  line-height: 1.625rem;
122
148
  }
123
149
  }
150
+
124
151
  &__label {
125
152
  font-weight: 700;
126
153
  margin: getSpacer(2xs) 0 0 0;
154
+
127
155
  &__compact {
128
156
  font-weight: 600;
129
157
  font-size: $font-size-xs;
130
158
  line-height: 1.25rem;
131
159
  }
160
+
132
161
  &__compact--basic {
133
162
  font-weight: 400;
134
163
  }
135
164
  }
165
+
136
166
  &__label--no-content {
137
167
  margin: 0;
138
168
  font-weight: 600;
139
169
  }
170
+
140
171
  &__children {
141
172
  font-weight: 600;
142
173
  padding: getSpacer(3xs) 0;
143
174
  }
175
+
144
176
  &__icon {
145
177
  line-height: 0;
146
178
  }
179
+
147
180
  &--with-content {
148
181
  padding-bottom: getSpacer(xs);
149
182
  }
@@ -1,7 +1,8 @@
1
- @import '../../scss/_spacers.scss';
2
- @import '../../scss/_breakpoints.scss';
3
- @import '../../scss/_palette.scss';
4
- @import '../../scss/_font-settings.scss';
1
+ @use 'sass:map';
2
+ @import '../../scss/spacers';
3
+ @import '../../scss/breakpoints';
4
+ @import '../../scss/palette';
5
+ @import '../../scss/font-settings';
5
6
 
6
7
  .panel-wrapper {
7
8
  width: 100%;
@@ -10,14 +11,15 @@
10
11
  @mixin panel-padding {
11
12
  padding: getSpacer(s) getSpacer(s) getSpacer(s) getSpacer(s);
12
13
 
13
- @media (min-width: map-get($grid-breakpoints, md)) {
14
+ @media (min-width: map.get($grid-breakpoints, md)) {
14
15
  padding: getSpacer(l) getSpacer(m) getSpacer(l) getSpacer(l);
15
16
  }
16
17
  }
17
18
 
18
19
  @mixin panel-padding-icon {
19
20
  padding: getSpacer(m) getSpacer(s) getSpacer(l) getSpacer(s);
20
- @media (min-width: map-get($grid-breakpoints, md)) {
21
+
22
+ @media (min-width: map.get($grid-breakpoints, md)) {
21
23
  padding: getSpacer(m) getSpacer(m) getSpacer(l) getSpacer(m);
22
24
  }
23
25
  }
@@ -28,26 +30,27 @@
28
30
  }
29
31
 
30
32
  &:focus {
31
- box-shadow: inset 0px 0px 0px 3px $box-shadow-color;
33
+ box-shadow: inset 0 0 0 3px $box-shadow-color;
32
34
  }
33
35
  }
34
36
 
35
37
  .panel {
36
38
  @include panel-padding;
39
+
37
40
  outline: none;
38
41
  position: relative;
39
42
  width: 100%;
40
43
  box-sizing: border-box;
41
44
 
42
45
  &__container {
43
- @media (min-width: map-get($grid-breakpoints, md)) {
46
+ @media (min-width: map.get($grid-breakpoints, md)) {
44
47
  display: flex;
45
48
  flex-direction: row;
46
49
  flex: 1;
47
50
  }
48
51
 
49
52
  &--layout3 {
50
- @media (min-width: map-get($grid-breakpoints, lg)) {
53
+ @media (min-width: map.get($grid-breakpoints, lg)) {
51
54
  display: flex;
52
55
  flex-direction: row;
53
56
  }
@@ -61,13 +64,14 @@
61
64
  &--with-icon {
62
65
  display: flex;
63
66
  flex-direction: row;
67
+
64
68
  @include panel-padding-icon;
65
69
  }
66
70
 
67
71
  &__icon {
68
72
  padding-right: getSpacer(s);
69
73
 
70
- @media (min-width: map-get($grid-breakpoints, md)) {
74
+ @media (min-width: map.get($grid-breakpoints, md)) {
71
75
  padding-right: getSpacer(l);
72
76
  }
73
77
 
@@ -91,7 +95,8 @@
91
95
  &--layout1 {
92
96
  display: flex;
93
97
  flex-direction: column;
94
- @media (min-width: map-get($grid-breakpoints, md)) {
98
+
99
+ @media (min-width: map.get($grid-breakpoints, md)) {
95
100
  flex-direction: row;
96
101
  }
97
102
  }
@@ -99,7 +104,8 @@
99
104
  &--layout2 {
100
105
  display: flex;
101
106
  flex-direction: column;
102
- @media (min-width: map-get($grid-breakpoints, md)) {
107
+
108
+ @media (min-width: map.get($grid-breakpoints, md)) {
103
109
  max-width: 200px;
104
110
  }
105
111
  }
@@ -108,7 +114,8 @@
108
114
  display: flex;
109
115
  flex-direction: column;
110
116
  padding-left: 0;
111
- @media (min-width: map-get($grid-breakpoints, lg)) {
117
+
118
+ @media (min-width: map.get($grid-breakpoints, lg)) {
112
119
  flex-direction: row;
113
120
  padding-left: getSpacer(m);
114
121
  }
@@ -117,9 +124,11 @@
117
124
  &--layout3a {
118
125
  flex: 0.4;
119
126
  }
127
+
120
128
  &--layout3b {
121
129
  flex: 0.55;
122
130
  }
131
+
123
132
  &--layout3c {
124
133
  flex: 0.65;
125
134
  }
@@ -128,7 +137,8 @@
128
137
  &__btn-container {
129
138
  display: flex;
130
139
  flex-direction: column;
131
- @media (min-width: map-get($grid-breakpoints, lg)) {
140
+
141
+ @media (min-width: map.get($grid-breakpoints, lg)) {
132
142
  align-self: flex-end;
133
143
  flex-direction: row;
134
144
  }
@@ -137,10 +147,12 @@
137
147
  display: flex;
138
148
  align-self: initial;
139
149
  flex-direction: column;
140
- @media (min-width: map-get($grid-breakpoints, lg)) {
150
+
151
+ @media (min-width: map.get($grid-breakpoints, lg)) {
141
152
  align-self: flex-end;
142
153
  }
143
154
  }
155
+
144
156
  &--padding-top {
145
157
  padding-top: getSpacer(s);
146
158
  }
@@ -148,7 +160,8 @@
148
160
 
149
161
  &__details-btn {
150
162
  align-self: flex-start;
151
- @media (min-width: map-get($grid-breakpoints, lg)) {
163
+
164
+ @media (min-width: map.get($grid-breakpoints, lg)) {
152
165
  align-self: flex-end;
153
166
  margin-left: auto;
154
167
  }
@@ -156,13 +169,11 @@
156
169
 
157
170
  &__expand {
158
171
  position: unset;
159
- &:after {
160
- bottom: 0;
172
+
173
+ &::after {
174
+ inset: 0;
161
175
  content: '';
162
- left: 0;
163
176
  position: absolute;
164
- right: 0;
165
- top: 0;
166
177
  }
167
178
  }
168
179
 
@@ -192,7 +203,7 @@
192
203
  }
193
204
 
194
205
  &--white#{&}--selected {
195
- box-shadow: inset 0px 0px 0px 6px $neutral100;
206
+ box-shadow: inset 0 0 0 6px $neutral100;
196
207
  }
197
208
 
198
209
  &--stroke {
@@ -201,6 +212,7 @@
201
212
 
202
213
  &--stroke#{&}--clickable {
203
214
  @include hover-and-focus-effects($neutral50, $neutral100);
215
+
204
216
  &:focus {
205
217
  border-color: $neutral600;
206
218
  }
@@ -236,7 +248,7 @@
236
248
  cursor: pointer;
237
249
  }
238
250
 
239
- //Panel status
251
+ // Panel status
240
252
  &--status {
241
253
  &::before {
242
254
  content: '';
@@ -248,6 +260,7 @@
248
260
  border-left-style: solid;
249
261
  }
250
262
  }
263
+
251
264
  &--new {
252
265
  &::before {
253
266
  border-left-color: $blueberry600;
@@ -271,23 +284,28 @@
271
284
  .panel-details {
272
285
  background-color: $neutral50;
273
286
  display: none;
287
+
274
288
  @include panel-padding;
275
289
 
276
290
  @media print {
277
291
  display: flex;
278
292
  flex-direction: column;
279
293
  }
294
+
280
295
  &--open {
281
296
  display: flex;
282
297
  flex-direction: column;
283
298
  }
299
+
284
300
  &--line {
285
301
  background: $white;
286
302
  border-bottom: 1px solid $neutral500;
287
303
  }
304
+
288
305
  &--white {
289
306
  background: $white;
290
307
  }
308
+
291
309
  &--with-icon {
292
310
  @include panel-padding-icon;
293
311
  }
@@ -298,6 +316,7 @@
298
316
  color: $cherry500;
299
317
  display: flex;
300
318
  margin-bottom: getSpacer(2xs);
319
+
301
320
  span {
302
321
  padding-left: 5px;
303
322
  align-self: center;
@@ -308,11 +327,12 @@
308
327
  color: $blueberry800;
309
328
  }
310
329
  }
330
+
311
331
  .panel-content-a {
312
332
  flex: 1;
313
333
  padding-right: 0;
314
334
 
315
- @media (min-width: map-get($grid-breakpoints, md)) {
335
+ @media (min-width: map.get($grid-breakpoints, md)) {
316
336
  padding-right: getSpacer(m);
317
337
  }
318
338
 
@@ -332,9 +352,11 @@
332
352
  &--layout3a {
333
353
  flex: 0.6;
334
354
  }
355
+
335
356
  &--layout3b {
336
357
  flex: 0.45;
337
358
  }
359
+
338
360
  &--layout3c {
339
361
  flex: 0.35;
340
362
  }
@@ -344,19 +366,21 @@
344
366
  flex: 1;
345
367
  padding-top: getSpacer(s);
346
368
 
347
- @media (min-width: map-get($grid-breakpoints, lg)) {
369
+ @media (min-width: map.get($grid-breakpoints, lg)) {
348
370
  padding-top: 0;
349
371
  }
350
372
 
351
373
  &--layout1 {
352
374
  padding-top: getSpacer(s);
353
375
  padding-left: 0;
354
- @media (min-width: map-get($grid-breakpoints, md)) {
376
+
377
+ @media (min-width: map.get($grid-breakpoints, md)) {
355
378
  padding-right: getSpacer(m);
356
379
  }
357
380
  }
381
+
358
382
  &--layout3 {
359
- @media (min-width: map-get($grid-breakpoints, lg)) {
383
+ @media (min-width: map.get($grid-breakpoints, lg)) {
360
384
  padding-right: getSpacer(m);
361
385
  }
362
386
  }
@@ -366,7 +390,7 @@
366
390
  display: flex;
367
391
  flex-direction: column;
368
392
 
369
- @media (min-width: map-get($grid-breakpoints, lg)) {
393
+ @media (min-width: map.get($grid-breakpoints, lg)) {
370
394
  padding-top: getSpacer(xs);
371
395
  flex-direction: row;
372
396
  }
@@ -376,7 +400,7 @@
376
400
  align-items: center;
377
401
  padding-bottom: getSpacer(2xs);
378
402
 
379
- @media (min-width: map-get($grid-breakpoints, lg)) {
403
+ @media (min-width: map.get($grid-breakpoints, lg)) {
380
404
  padding-top: 0;
381
405
  padding-right: getSpacer(m);
382
406
  padding-bottom: 0;
@@ -1,13 +1,14 @@
1
- @import '../../scss/_spacers.scss';
2
- @import '../../scss/_breakpoints.scss';
3
- @import '../../scss/_palette.scss';
4
- @import '../../scss/_font-settings.scss';
1
+ @use 'sass:map';
2
+ @import '../../scss/spacers';
3
+ @import '../../scss/breakpoints';
4
+ @import '../../scss/palette';
5
+ @import '../../scss/font-settings';
5
6
 
6
7
  .panel-list {
7
8
  &__panel:not(:last-child) {
8
9
  margin-bottom: getSpacer(2xs);
9
10
 
10
- @media (min-width: map-get($grid-breakpoints, md)) {
11
+ @media (min-width: map.get($grid-breakpoints, md)) {
11
12
  margin-bottom: getSpacer(s);
12
13
  }
13
14
  }
@@ -1 +1 @@
1
- {"version":3,"file":"PopMenu.d.ts","sourceRoot":"","sources":["../../../src/components/PopMenu/PopMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAchD,OAAiB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAKtD,oBAAY,cAAc;IACxB,OAAO,aAAa;IACpB,MAAM,YAAY;IAClB,WAAW,iBAAiB;CAC7B;AAED,MAAM,WAAW,YAAY;IAC3B,2DAA2D;IAC3D,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;IAC5C,kDAAkD;IAClD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,0CAA0C;IAC1C,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,yDAAyD;IACzD,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,gEAAgE;IAChE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,iEAAiE;IACjE,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,sDAAsD;IACtD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,yDAAyD;IACzD,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,0DAA0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