@helsenorge/designsystem-react 11.2.0-beta.0 → 11.3.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 +6 -8
- package/Button.js.map +1 -1
- package/CHANGELOG.md +928 -1496
- package/Close.js +21 -6
- package/Close.js.map +1 -1
- package/Drawer.js +370 -0
- package/Drawer.js.map +1 -0
- package/HelpBubble.js +78 -0
- package/HelpBubble.js.map +1 -0
- package/InfoTeaser.js +75 -0
- package/InfoTeaser.js.map +1 -0
- package/LazyIcon.js +1 -1
- package/LazyIcon.js.map +1 -1
- package/LazyIllustration.js +1 -1
- package/LazyIllustration.js.map +1 -1
- package/Panel.js +38 -5
- package/Panel.js.map +1 -1
- package/PopOver.js +141 -3589
- package/PopOver.js.map +1 -1
- package/components/ArticleTeaser/ArticleTeaser.d.ts +23 -0
- package/components/ArticleTeaser/ArticleTeaser.test.d.ts +1 -0
- package/components/ArticleTeaser/index.d.ts +3 -0
- package/components/ArticleTeaser/index.js +67 -0
- package/components/ArticleTeaser/index.js.map +1 -0
- package/components/ArticleTeaser/resourceHelper.d.ts +3 -0
- package/components/ArticleTeaser/styles.module.scss +79 -0
- package/components/ArticleTeaser/styles.module.scss.d.ts +13 -0
- package/components/Close/Close.d.ts +1 -1
- package/components/Close/styles.module.scss +51 -20
- package/components/Close/styles.module.scss.d.ts +3 -0
- package/components/Drawer/Drawer.d.ts +7 -1
- package/components/Drawer/index.js +1 -348
- package/components/Drawer/index.js.map +1 -1
- package/components/Drawer/styles.module.scss +44 -5
- package/components/Drawer/styles.module.scss.d.ts +2 -0
- package/components/Dropdown/index.js +1 -3
- package/components/Dropdown/index.js.map +1 -1
- package/components/HelpBubble/HelpBubble.d.ts +9 -7
- package/components/HelpBubble/index.js +3 -47
- package/components/HelpBubble/index.js.map +1 -1
- package/components/HelpBubble/styles.module.scss +7 -5
- package/components/HelpBubble/styles.module.scss.d.ts +1 -0
- package/components/HelpDrawer/HelpDrawer.d.ts +8 -0
- package/components/HelpDrawer/HelpDrawer.test.d.ts +1 -0
- package/components/HelpDrawer/index.d.ts +3 -0
- package/components/HelpDrawer/index.js +10 -0
- package/components/HelpDrawer/index.js.map +1 -0
- package/components/HelpDrawer/styles.module.scss +16 -0
- package/components/HelpDrawer/styles.module.scss.d.ts +10 -0
- package/components/HelpPanel/styles.module.scss +2 -3
- package/components/HelpTeaser/HelpTeaser.d.ts +20 -0
- package/components/HelpTeaser/HelpTeaser.test.d.ts +1 -0
- package/components/HelpTeaser/index.d.ts +3 -0
- package/components/HelpTeaser/index.js +25 -0
- package/components/HelpTeaser/index.js.map +1 -0
- package/components/HelpTeaser/styles.module.scss +22 -0
- package/components/HelpTeaser/styles.module.scss.d.ts +10 -0
- package/components/HelpTooltip/index.js +2 -2
- package/components/HelpTooltip/index.js.map +1 -1
- package/components/HighlightPanel/styles.module.scss +0 -1
- package/components/Icons/AdditionalIconInformation.d.ts +1 -1
- package/components/Icons/AdditionalIconInformation.js +1 -1
- package/components/Icons/AdditionalIconInformation.js.map +1 -1
- package/components/Icons/IconNames.d.ts +1 -1
- package/components/Icons/IconNames.js +1 -0
- package/components/Icons/IconNames.js.map +1 -1
- package/components/Icons/Toddler.d.ts +4 -0
- package/components/Icons/Toddler.js +10 -0
- package/components/Icons/Toddler.js.map +1 -0
- package/components/Illustrations/BabyMobile.d.ts +8 -0
- package/components/Illustrations/BabyMobile.js +11 -0
- package/components/Illustrations/BabyMobile.js.map +1 -0
- package/components/Illustrations/BabyMobileMedium.d.ts +4 -0
- package/components/Illustrations/BabyMobileMedium.js +424 -0
- package/components/Illustrations/BabyMobileMedium.js.map +1 -0
- package/components/Illustrations/Child.d.ts +12 -0
- package/components/Illustrations/Child.js +11 -0
- package/components/Illustrations/Child.js.map +1 -0
- package/components/Illustrations/ChildMedium.d.ts +4 -0
- package/components/Illustrations/ChildMedium.js +185 -0
- package/components/Illustrations/ChildMedium.js.map +1 -0
- package/components/Illustrations/GiveBabyFood.d.ts +11 -0
- package/components/Illustrations/GiveBabyFood.js +11 -0
- package/components/Illustrations/GiveBabyFood.js.map +1 -0
- package/components/Illustrations/GiveBabyFoodMedium.d.ts +4 -0
- package/components/Illustrations/GiveBabyFoodMedium.js +377 -0
- package/components/Illustrations/GiveBabyFoodMedium.js.map +1 -0
- package/components/Illustrations/IllustrationNames.d.ts +1 -1
- package/components/Illustrations/IllustrationNames.js +15 -1
- package/components/Illustrations/IllustrationNames.js.map +1 -1
- package/components/Illustrations/Stroller.d.ts +12 -0
- package/components/Illustrations/Stroller.js +11 -0
- package/components/Illustrations/Stroller.js.map +1 -0
- package/components/Illustrations/StrollerMedium.d.ts +4 -0
- package/components/Illustrations/StrollerMedium.js +236 -0
- package/components/Illustrations/StrollerMedium.js.map +1 -0
- package/components/InfoTeaser/InfoTeaser.d.ts +28 -0
- package/components/InfoTeaser/InfoTeaser.test.d.ts +1 -0
- package/components/InfoTeaser/index.d.ts +3 -0
- package/components/InfoTeaser/index.js +5 -0
- package/components/InfoTeaser/index.js.map +1 -0
- package/components/InfoTeaser/resourceHelper.d.ts +3 -0
- package/components/InfoTeaser/styles.module.scss +98 -0
- package/components/InfoTeaser/styles.module.scss.d.ts +15 -0
- package/components/Modal/styles.module.scss +3 -1
- package/components/Panel/Panel.d.ts +3 -0
- package/components/Panel/resourceHelper.d.ts +3 -0
- package/components/Panel/styles.module.scss +6 -6
- package/components/PopMenu/index.js +24 -15
- package/components/PopMenu/index.js.map +1 -1
- package/components/PopMenu/styles.module.scss +10 -9
- package/components/PopMenu/styles.module.scss.d.ts +1 -0
- package/components/PopOver/PopOver.d.ts +5 -9
- package/components/PopOver/index.js +3 -3
- package/components/PopOver/styles.module.scss +53 -11
- package/components/PopOver/styles.module.scss.d.ts +5 -0
- package/constants.d.ts +2 -0
- package/constants.js +2 -0
- package/constants.js.map +1 -1
- package/designsystem-react.css +20 -6
- package/hooks/useBreakpoint.js +10 -28
- package/hooks/useBreakpoint.js.map +1 -1
- package/hooks/useIsMobileBreakpoint.d.ts +1 -0
- package/hooks/useIsMobileBreakpoint.js +10 -0
- package/hooks/useIsMobileBreakpoint.js.map +1 -0
- package/package.json +1 -1
- package/resources/HN.Designsystem.ArticleTeaser.en-GB.json.d.ts +7 -0
- package/resources/HN.Designsystem.ArticleTeaser.nb-NO.json.d.ts +7 -0
- package/resources/HN.Designsystem.Dropdown.nb-NO.json.d.ts +1 -2
- package/resources/HN.Designsystem.InfoTeaser.en-GB.json.d.ts +7 -0
- package/resources/HN.Designsystem.InfoTeaser.nb-NO.json.d.ts +7 -0
- package/resources/HN.Designsystem.Panel.en-GB.json.d.ts +7 -0
- package/resources/HN.Designsystem.Panel.nb-NO.json.d.ts +7 -0
- package/scss/_font-mixins.scss +0 -22
- package/scss/supernova/styles/colors.css +20 -6
- package/scss/supernova/styles/typography.css +2 -2
- package/scss/typography.module.scss +0 -8
- package/scss/typography.module.scss.d.ts +0 -2
- package/scss/typography.stories.tsx +0 -8
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { HNDesignsystemArticleTeaser } from '../../resources/Resources';
|
|
3
|
+
export type ArticleTeaserTags = 'div' | 'section' | 'aside' | 'article';
|
|
4
|
+
export interface ArticleTeaserProps {
|
|
5
|
+
/** Callback for the button. Should be used for setting the expanded boolean */
|
|
6
|
+
onExpand: () => void;
|
|
7
|
+
/** What's in the box? */
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
/** Id of the content, used to set aria-controls */
|
|
10
|
+
contentId: string;
|
|
11
|
+
/** If the component is expanded or not */
|
|
12
|
+
expanded: boolean;
|
|
13
|
+
/** For overriding the height of the collapsed teaser */
|
|
14
|
+
heightCollapsed?: string;
|
|
15
|
+
/** Changes the underlying element of the wrapper */
|
|
16
|
+
htmlMarkup?: ArticleTeaserTags;
|
|
17
|
+
/** Resources for component */
|
|
18
|
+
resources?: Partial<HNDesignsystemArticleTeaser>;
|
|
19
|
+
/** Sets the data-testid attribute */
|
|
20
|
+
testId?: string;
|
|
21
|
+
}
|
|
22
|
+
declare const ArticleTeaser: React.FC<ArticleTeaserProps>;
|
|
23
|
+
export default ArticleTeaser;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import classNames from "classnames";
|
|
3
|
+
import { LanguageLocales, AnalyticsId } from "../../constants.js";
|
|
4
|
+
import { useLanguage } from "../../utils/language.js";
|
|
5
|
+
import styles from "./styles.module.scss";
|
|
6
|
+
const expandButtonClose$1 = "Show more";
|
|
7
|
+
const expandButtonOpen$1 = "Show less";
|
|
8
|
+
const enGB = {
|
|
9
|
+
expandButtonClose: expandButtonClose$1,
|
|
10
|
+
expandButtonOpen: expandButtonOpen$1
|
|
11
|
+
};
|
|
12
|
+
const expandButtonClose = "Vis mer";
|
|
13
|
+
const expandButtonOpen = "Vis mindre";
|
|
14
|
+
const nbNO = {
|
|
15
|
+
expandButtonClose,
|
|
16
|
+
expandButtonOpen
|
|
17
|
+
};
|
|
18
|
+
const getResources = (language) => {
|
|
19
|
+
switch (language) {
|
|
20
|
+
case LanguageLocales.ENGLISH:
|
|
21
|
+
return enGB;
|
|
22
|
+
case LanguageLocales.NORWEGIAN:
|
|
23
|
+
default:
|
|
24
|
+
return nbNO;
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
const ArticleTeaser = (props) => {
|
|
28
|
+
const { onExpand, children, contentId, expanded, htmlMarkup = "div", resources, testId } = props;
|
|
29
|
+
const WrapperTag = htmlMarkup;
|
|
30
|
+
const { language } = useLanguage(LanguageLocales.NORWEGIAN);
|
|
31
|
+
const defaultResources = getResources(language);
|
|
32
|
+
const mergedResources = {
|
|
33
|
+
...defaultResources,
|
|
34
|
+
...resources
|
|
35
|
+
};
|
|
36
|
+
return /* @__PURE__ */ jsxs(WrapperTag, { className: classNames(styles.articleteaser), "data-testid": testId, "data-analyticsid": AnalyticsId.ArticleTeaser, children: [
|
|
37
|
+
/* @__PURE__ */ jsx(
|
|
38
|
+
"div",
|
|
39
|
+
{
|
|
40
|
+
className: classNames(styles["articleteaser__content"], {
|
|
41
|
+
[styles["articleteaser__content--collapsed"]]: !expanded
|
|
42
|
+
}),
|
|
43
|
+
style: {
|
|
44
|
+
maxHeight: expanded ? "none" : props.heightCollapsed
|
|
45
|
+
},
|
|
46
|
+
children
|
|
47
|
+
}
|
|
48
|
+
),
|
|
49
|
+
/* @__PURE__ */ jsx(
|
|
50
|
+
"button",
|
|
51
|
+
{
|
|
52
|
+
type: "button",
|
|
53
|
+
className: classNames(styles["articleteaser__button"], {
|
|
54
|
+
[styles["articleteaser__button--expanded"]]: expanded
|
|
55
|
+
}),
|
|
56
|
+
onClick: onExpand,
|
|
57
|
+
"aria-expanded": expanded,
|
|
58
|
+
"aria-controls": contentId,
|
|
59
|
+
children: expanded ? mergedResources.expandButtonOpen : mergedResources.expandButtonClose
|
|
60
|
+
}
|
|
61
|
+
)
|
|
62
|
+
] });
|
|
63
|
+
};
|
|
64
|
+
export {
|
|
65
|
+
ArticleTeaser as default
|
|
66
|
+
};
|
|
67
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/ArticleTeaser/resourceHelper.ts","../../../src/components/ArticleTeaser/ArticleTeaser.tsx"],"sourcesContent":["import { LanguageLocales } from '../../constants';\nimport enGB from '../../resources/HN.Designsystem.ArticleTeaser.en-GB.json';\nimport nbNO from '../../resources/HN.Designsystem.ArticleTeaser.nb-NO.json';\nimport { HNDesignsystemArticleTeaser } from '../../resources/Resources';\n\nexport const getResources = (language: LanguageLocales): HNDesignsystemArticleTeaser => {\n switch (language) {\n case LanguageLocales.ENGLISH:\n return enGB;\n case LanguageLocales.NORWEGIAN:\n default:\n return nbNO;\n }\n};\n","import React from 'react';\n\nimport classNames from 'classnames';\n\nimport { getResources } from './resourceHelper';\nimport { AnalyticsId, LanguageLocales } from '../../constants';\nimport { HNDesignsystemArticleTeaser } from '../../resources/Resources';\nimport { useLanguage } from '../../utils/language';\n\nimport styles from './styles.module.scss';\n\nexport type ArticleTeaserTags = 'div' | 'section' | 'aside' | 'article';\n\nexport interface ArticleTeaserProps {\n /** Callback for the button. Should be used for setting the expanded boolean */\n onExpand: () => void;\n /** What's in the box? */\n children: React.ReactNode;\n /** Id of the content, used to set aria-controls */\n contentId: string;\n /** If the component is expanded or not */\n expanded: boolean;\n /** For overriding the height of the collapsed teaser */\n heightCollapsed?: string;\n /** Changes the underlying element of the wrapper */\n htmlMarkup?: ArticleTeaserTags;\n /** Resources for component */\n resources?: Partial<HNDesignsystemArticleTeaser>;\n /** Sets the data-testid attribute */\n testId?: string;\n}\n\nconst ArticleTeaser: React.FC<ArticleTeaserProps> = props => {\n const { onExpand, children, contentId, expanded, htmlMarkup = 'div', resources, testId } = props;\n const WrapperTag = htmlMarkup;\n\n const { language } = useLanguage<LanguageLocales>(LanguageLocales.NORWEGIAN);\n const defaultResources = getResources(language);\n\n const mergedResources: HNDesignsystemArticleTeaser = {\n ...defaultResources,\n ...resources,\n };\n\n return (\n <WrapperTag className={classNames(styles.articleteaser)} data-testid={testId} data-analyticsid={AnalyticsId.ArticleTeaser}>\n <div\n className={classNames(styles['articleteaser__content'], {\n [styles['articleteaser__content--collapsed']]: !expanded,\n })}\n style={{\n maxHeight: expanded ? 'none' : props.heightCollapsed,\n }}\n >\n {children}\n </div>\n <button\n type=\"button\"\n className={classNames(styles['articleteaser__button'], {\n [styles['articleteaser__button--expanded']]: expanded,\n })}\n onClick={onExpand}\n aria-expanded={expanded}\n aria-controls={contentId}\n >\n {expanded ? mergedResources.expandButtonOpen : mergedResources.expandButtonClose}\n </button>\n </WrapperTag>\n );\n};\n\nexport default ArticleTeaser;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAKa,MAAA,eAAe,CAAC,aAA2D;AACtF,UAAQ,UAAU;AAAA,IAChB,KAAK,gBAAgB;AACZ,aAAA;AAAA,IACT,KAAK,gBAAgB;AAAA,IACrB;AACS,aAAA;AAAA,EAAA;AAEb;ACmBA,MAAM,gBAA8C,CAAS,UAAA;AACrD,QAAA,EAAE,UAAU,UAAU,WAAW,UAAU,aAAa,OAAO,WAAW,OAAA,IAAW;AAC3F,QAAM,aAAa;AAEnB,QAAM,EAAE,SAAa,IAAA,YAA6B,gBAAgB,SAAS;AACrE,QAAA,mBAAmB,aAAa,QAAQ;AAE9C,QAAM,kBAA+C;AAAA,IACnD,GAAG;AAAA,IACH,GAAG;AAAA,EACL;AAGE,SAAA,qBAAC,YAAW,EAAA,WAAW,WAAW,OAAO,aAAa,GAAG,eAAa,QAAQ,oBAAkB,YAAY,eAC1G,UAAA;AAAA,IAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAW,WAAW,OAAO,wBAAwB,GAAG;AAAA,UACtD,CAAC,OAAO,mCAAmC,CAAC,GAAG,CAAC;AAAA,QAAA,CACjD;AAAA,QACD,OAAO;AAAA,UACL,WAAW,WAAW,SAAS,MAAM;AAAA,QACvC;AAAA,QAEC;AAAA,MAAA;AAAA,IACH;AAAA,IACA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,WAAW,WAAW,OAAO,uBAAuB,GAAG;AAAA,UACrD,CAAC,OAAO,iCAAiC,CAAC,GAAG;AAAA,QAAA,CAC9C;AAAA,QACD,SAAS;AAAA,QACT,iBAAe;AAAA,QACf,iBAAe;AAAA,QAEd,UAAA,WAAW,gBAAgB,mBAAmB,gBAAgB;AAAA,MAAA;AAAA,IAAA;AAAA,EACjE,GACF;AAEJ;"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use '../../scss/breakpoints' as breakpoints;
|
|
3
|
+
@import '../../scss/supernova/styles/colors.css';
|
|
4
|
+
@import '../../scss/supernova/styles/spacers.css';
|
|
5
|
+
|
|
6
|
+
.articleteaser {
|
|
7
|
+
position: relative;
|
|
8
|
+
border-bottom: 1px solid var(--color-base-border-onlight);
|
|
9
|
+
|
|
10
|
+
&__content {
|
|
11
|
+
margin-bottom: var(--core-space-l);
|
|
12
|
+
overflow: hidden;
|
|
13
|
+
|
|
14
|
+
&--collapsed {
|
|
15
|
+
max-height: 10rem;
|
|
16
|
+
|
|
17
|
+
&::after {
|
|
18
|
+
content: '';
|
|
19
|
+
position: absolute;
|
|
20
|
+
height: var(--core-space-3xl);
|
|
21
|
+
background: linear-gradient(180deg, #ffffff40 0%, #fff 80%);
|
|
22
|
+
width: 100%;
|
|
23
|
+
bottom: 1px;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&__button {
|
|
29
|
+
position: absolute;
|
|
30
|
+
right: calc(50%);
|
|
31
|
+
border: none;
|
|
32
|
+
width: fit-content;
|
|
33
|
+
white-space: nowrap;
|
|
34
|
+
border-radius: 1.25rem;
|
|
35
|
+
background: var(--color-action-graphics-onlight, #188097);
|
|
36
|
+
color: var(--core-color-white, #fff);
|
|
37
|
+
padding: 0.375rem 1rem;
|
|
38
|
+
bottom: 0;
|
|
39
|
+
left: 50%;
|
|
40
|
+
transform: translateX(-50%) translateY(50%);
|
|
41
|
+
cursor: pointer;
|
|
42
|
+
|
|
43
|
+
/* @todo Mobile/HelpTriggerText */
|
|
44
|
+
font-size: 1rem;
|
|
45
|
+
font-style: normal;
|
|
46
|
+
font-weight: 600;
|
|
47
|
+
line-height: 120%; /* 1.2rem */
|
|
48
|
+
|
|
49
|
+
&:hover {
|
|
50
|
+
background-color: var(--color-action-graphics-onlight-hover);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&:focus-visible {
|
|
54
|
+
border: 1px solid var(--color-base-graphics-ondark);
|
|
55
|
+
outline: none;
|
|
56
|
+
box-shadow: 0 0 0 3px var(--color-base-graphics-onlight);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
&:active {
|
|
60
|
+
background-color: var(--core-color-blueberry-800);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&--expanded {
|
|
64
|
+
background: var(--color-action-graphics-ondark);
|
|
65
|
+
color: var(--color-action-graphics-onlight);
|
|
66
|
+
border: 1px solid var(--color-action-border-onlight);
|
|
67
|
+
|
|
68
|
+
&:hover {
|
|
69
|
+
// @todo: endre denne når ny token er laget
|
|
70
|
+
background-color: var(--color-action-graphics-ondark-hover);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
&:active {
|
|
74
|
+
// @todo: endre denne når ny token er laget
|
|
75
|
+
background-color: var(--color-action-graphics-ondark);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type Styles = {
|
|
2
|
+
articleteaser: string;
|
|
3
|
+
articleteaser__button: string;
|
|
4
|
+
'articleteaser__button--expanded': string;
|
|
5
|
+
articleteaser__content: string;
|
|
6
|
+
'articleteaser__content--collapsed': string;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export type ClassNames = keyof Styles;
|
|
10
|
+
|
|
11
|
+
declare const styles: Styles;
|
|
12
|
+
|
|
13
|
+
export default styles;
|
|
@@ -11,7 +11,7 @@ export interface CloseProps {
|
|
|
11
11
|
/** Adds custom classes to the element. */
|
|
12
12
|
className?: string;
|
|
13
13
|
/** Gives color to the svg */
|
|
14
|
-
color?:
|
|
14
|
+
color?: 'blueberry' | 'black' | 'plum';
|
|
15
15
|
}
|
|
16
16
|
declare const Close: React.ForwardRefExoticComponent<CloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
17
17
|
export default Close;
|
|
@@ -2,42 +2,73 @@
|
|
|
2
2
|
@use '../../scss/spacers' as spacers;
|
|
3
3
|
@use '../../scss/palette' as palette;
|
|
4
4
|
@use '../../scss/breakpoints' as breakpoints;
|
|
5
|
+
@import '../../scss/supernova/styles/colors.css';
|
|
6
|
+
|
|
7
|
+
$desktop-size: 3rem;
|
|
8
|
+
$mobile-inner-size: 2.375rem;
|
|
9
|
+
$mobile-outer-size: 2.75rem;
|
|
5
10
|
|
|
6
11
|
.close {
|
|
7
12
|
display: flex;
|
|
8
13
|
align-items: center;
|
|
9
14
|
justify-content: center;
|
|
10
|
-
height:
|
|
11
|
-
width:
|
|
15
|
+
height: $mobile-outer-size;
|
|
16
|
+
width: $mobile-outer-size;
|
|
12
17
|
padding: 0;
|
|
13
18
|
border: 0;
|
|
14
19
|
background-color: transparent;
|
|
15
20
|
cursor: pointer;
|
|
16
21
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
width: 2.375rem;
|
|
22
|
+
&:focus-visible {
|
|
23
|
+
outline: none;
|
|
20
24
|
}
|
|
21
25
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
26
|
+
@media (min-width: map.get(breakpoints.$grid-breakpoints, md)) {
|
|
27
|
+
height: $desktop-size;
|
|
28
|
+
width: $desktop-size;
|
|
25
29
|
}
|
|
26
30
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
border-radius: 0;
|
|
31
|
-
border: 0;
|
|
32
|
-
outline: none;
|
|
31
|
+
&--small {
|
|
32
|
+
height: $mobile-outer-size;
|
|
33
|
+
width: $mobile-outer-size;
|
|
33
34
|
}
|
|
34
35
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
&__inner-container {
|
|
37
|
+
width: $mobile-inner-size;
|
|
38
|
+
height: $mobile-inner-size;
|
|
38
39
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
@media (min-width: map.get(breakpoints.$grid-breakpoints, md)) {
|
|
41
|
+
height: $desktop-size;
|
|
42
|
+
width: $desktop-size;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&--small {
|
|
46
|
+
width: $mobile-inner-size;
|
|
47
|
+
height: $mobile-inner-size;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
:hover > &,
|
|
51
|
+
:active > & {
|
|
52
|
+
background-color: var(--color-action-background-transparent-onlight-hover);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
:focus-visible > & {
|
|
56
|
+
outline: 3px solid var(--color-action-border-onlight-focus);
|
|
57
|
+
border-radius: 0;
|
|
58
|
+
border: 0;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
&--plum {
|
|
62
|
+
:hover > &,
|
|
63
|
+
:active > & {
|
|
64
|
+
background-color: var(--color-help-background-transparent-onlight-hover, #6c36b31a);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
:focus-visible > & {
|
|
68
|
+
outline: 3px solid var(--color-action-border-onlight-focus);
|
|
69
|
+
border-radius: 0;
|
|
70
|
+
border: 0;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
42
73
|
}
|
|
43
74
|
}
|
|
@@ -12,8 +12,12 @@ export interface InnerDrawerProps {
|
|
|
12
12
|
ariaLabelledBy?: string;
|
|
13
13
|
/** Close button aria-label */
|
|
14
14
|
ariaLabelCloseBtn?: string;
|
|
15
|
+
/** Sets the style of the Drawer Close button. Meant for use by HelpDrawer */
|
|
16
|
+
closeColor?: 'blueberry' | 'plum';
|
|
15
17
|
/** Direction of the drawer on desktop. Default: left */
|
|
16
18
|
desktopDirection?: DesktopDirections;
|
|
19
|
+
/** Sets the style of the Drawer header */
|
|
20
|
+
headerClasses?: string;
|
|
17
21
|
/** Title to display in the header of the drawer */
|
|
18
22
|
title: string;
|
|
19
23
|
/** id of the drawer title */
|
|
@@ -21,11 +25,13 @@ export interface InnerDrawerProps {
|
|
|
21
25
|
/** Changes the underlying element of the title. Default: h3 */
|
|
22
26
|
titleHtmlMarkup?: TitleTags;
|
|
23
27
|
/** Callback that triggers when clicking on close button or outside the drawer, update isOpen state when this triggers */
|
|
24
|
-
onRequestClose
|
|
28
|
+
onRequestClose?: () => void;
|
|
25
29
|
/** Optional footer content that can be rendered instead of default CTA(s) */
|
|
26
30
|
footerContent?: React.ReactNode;
|
|
27
31
|
/** Main content of the drawer */
|
|
28
32
|
children?: React.ReactNode;
|
|
33
|
+
/** Hides the close button */
|
|
34
|
+
noCloseButton?: boolean;
|
|
29
35
|
/** Primary CTA callback */
|
|
30
36
|
onPrimaryAction?: () => void;
|
|
31
37
|
/** Text for primary CTA button if you want a default CTA button rendered (instead of `footerContent`) */
|