@lifesg/react-design-system 3.5.0-canary.7 → 3.5.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/_virtual/_tslib.js +1 -1
- package/accordion/accordion-item.js +1 -1
- package/accordion/accordion-item.js.map +1 -1
- package/accordion/types.d.ts +7 -0
- package/button/button.style.js +20 -19
- package/button/button.style.js.map +1 -1
- package/cjs/_virtual/_tslib.js +1 -1
- package/cjs/accordion/accordion-item.js +1 -1
- package/cjs/accordion/accordion-item.js.map +1 -1
- package/cjs/button/button.style.js +3 -2
- package/cjs/button/button.style.js.map +1 -1
- package/cjs/external/@govtechsg/sgds-web-component/base/sgds-element.js +2 -0
- package/cjs/external/@govtechsg/sgds-web-component/base/sgds-element.js.map +1 -0
- package/cjs/external/@govtechsg/sgds-web-component/base/sgds-element2.js +2 -0
- package/cjs/external/@govtechsg/sgds-web-component/base/sgds-element2.js.map +1 -0
- package/cjs/external/@govtechsg/sgds-web-component/components/Masthead/index.js +2 -0
- package/cjs/external/@govtechsg/sgds-web-component/components/Masthead/index.js.map +1 -0
- package/cjs/external/@govtechsg/sgds-web-component/components/Masthead/masthead.js +2 -0
- package/cjs/external/@govtechsg/sgds-web-component/components/Masthead/masthead.js.map +1 -0
- package/cjs/external/@govtechsg/sgds-web-component/components/Masthead/sgds-masthead.js +154 -0
- package/cjs/external/@govtechsg/sgds-web-component/components/Masthead/sgds-masthead.js.map +1 -0
- package/cjs/external/@govtechsg/sgds-web-component/styles/anchor.js +2 -0
- package/cjs/external/@govtechsg/sgds-web-component/styles/anchor.js.map +1 -0
- package/cjs/external/@govtechsg/sgds-web-component/styles/svg.js +2 -0
- package/cjs/external/@govtechsg/sgds-web-component/styles/svg.js.map +1 -0
- package/cjs/external/@govtechsg/sgds-web-component/themes/day.css.js +1 -1
- package/cjs/external/@govtechsg/sgds-web-component/themes/night.css.js +1 -1
- package/cjs/external/@govtechsg/sgds-web-component/utils/ce-registry.js +2 -0
- package/cjs/external/@govtechsg/sgds-web-component/utils/ce-registry.js.map +1 -0
- package/cjs/external/@lit/reactive-element/css-tag.js +7 -0
- package/cjs/external/@lit/reactive-element/css-tag.js.map +1 -0
- package/cjs/external/@lit/reactive-element/decorators/property.js +7 -0
- package/cjs/external/@lit/reactive-element/decorators/property.js.map +1 -0
- package/cjs/external/@lit/reactive-element/decorators/state.js +7 -0
- package/cjs/external/@lit/reactive-element/decorators/state.js.map +1 -0
- package/cjs/external/@lit/reactive-element/reactive-element.js +7 -0
- package/cjs/external/@lit/reactive-element/reactive-element.js.map +1 -0
- package/cjs/external/lit-element/lit-element.js +8 -0
- package/cjs/external/lit-element/lit-element.js.map +1 -0
- package/cjs/external/lit-html/lit-html.js +7 -0
- package/cjs/external/lit-html/lit-html.js.map +1 -0
- package/cjs/file-download/file-download.js +1 -1
- package/cjs/file-download/file-download.js.map +1 -1
- package/cjs/file-download/file-list-card/file-list-card.js +1 -1
- package/cjs/file-download/file-list-card/file-list-card.js.map +1 -1
- package/cjs/file-download/file-list-card/file-list-card.styles.js +75 -59
- package/cjs/file-download/file-list-card/file-list-card.styles.js.map +1 -1
- package/cjs/file-upload/helper.js +1 -1
- package/cjs/file-upload/helper.js.map +1 -1
- package/cjs/fullscreen-image-carousel/fullscreen-image-carousel.js +1 -1
- package/cjs/fullscreen-image-carousel/fullscreen-image-carousel.js.map +1 -1
- package/cjs/fullscreen-image-carousel/fullscreen-image-carousel.style.js +19 -19
- package/cjs/fullscreen-image-carousel/fullscreen-image-carousel.style.js.map +1 -1
- package/cjs/masthead/masthead.js +1 -1
- package/cjs/masthead/masthead.js.map +1 -1
- package/cjs/navbar/menu.js +1 -1
- package/cjs/navbar/menu.js.map +1 -1
- package/cjs/navbar/menu.styles.js +1 -1
- package/cjs/navbar/menu.styles.js.map +1 -1
- package/cjs/navbar/navbar-items.js +1 -1
- package/cjs/navbar/navbar-items.js.map +1 -1
- package/cjs/navbar/navbar-items.styles.js +20 -21
- package/cjs/navbar/navbar-items.styles.js.map +1 -1
- package/cjs/notification-banner/notification-banner-hoc.js +1 -1
- package/cjs/notification-banner/notification-banner-hoc.js.map +1 -1
- package/codemods/run-codemod.js +10 -3
- package/codemods/run-codemod.js.map +1 -1
- package/codemods/run-codemod.ts +12 -4
- package/external/@govtechsg/sgds-web-component/base/sgds-element.js +2 -0
- package/external/@govtechsg/sgds-web-component/base/sgds-element.js.map +1 -0
- package/external/@govtechsg/sgds-web-component/base/sgds-element2.js +2 -0
- package/external/@govtechsg/sgds-web-component/base/sgds-element2.js.map +1 -0
- package/external/@govtechsg/sgds-web-component/components/Masthead/index.js +2 -0
- package/external/@govtechsg/sgds-web-component/components/Masthead/index.js.map +1 -0
- package/external/@govtechsg/sgds-web-component/components/Masthead/masthead.js +2 -0
- package/external/@govtechsg/sgds-web-component/components/Masthead/masthead.js.map +1 -0
- package/external/@govtechsg/sgds-web-component/components/Masthead/sgds-masthead.js +154 -0
- package/external/@govtechsg/sgds-web-component/components/Masthead/sgds-masthead.js.map +1 -0
- package/external/@govtechsg/sgds-web-component/styles/anchor.js +2 -0
- package/external/@govtechsg/sgds-web-component/styles/anchor.js.map +1 -0
- package/external/@govtechsg/sgds-web-component/styles/svg.js +2 -0
- package/external/@govtechsg/sgds-web-component/styles/svg.js.map +1 -0
- package/external/@govtechsg/sgds-web-component/themes/day.css.js +1 -1
- package/external/@govtechsg/sgds-web-component/themes/night.css.js +1 -1
- package/external/@govtechsg/sgds-web-component/utils/ce-registry.js +2 -0
- package/external/@govtechsg/sgds-web-component/utils/ce-registry.js.map +1 -0
- package/external/@lit/reactive-element/css-tag.js +7 -0
- package/external/@lit/reactive-element/css-tag.js.map +1 -0
- package/external/@lit/reactive-element/decorators/property.js +7 -0
- package/external/@lit/reactive-element/decorators/property.js.map +1 -0
- package/external/@lit/reactive-element/decorators/state.js +7 -0
- package/external/@lit/reactive-element/decorators/state.js.map +1 -0
- package/external/@lit/reactive-element/reactive-element.js +7 -0
- package/external/@lit/reactive-element/reactive-element.js.map +1 -0
- package/external/lit-element/lit-element.js +7 -0
- package/external/lit-element/lit-element.js.map +1 -0
- package/external/lit-html/lit-html.js +7 -0
- package/external/lit-html/lit-html.js.map +1 -0
- package/file-download/file-download.d.ts +1 -1
- package/file-download/file-download.js +1 -1
- package/file-download/file-download.js.map +1 -1
- package/file-download/file-list-card/file-list-card.d.ts +1 -1
- package/file-download/file-list-card/file-list-card.js +1 -1
- package/file-download/file-list-card/file-list-card.js.map +1 -1
- package/file-download/file-list-card/file-list-card.styles.d.ts +8 -0
- package/file-download/file-list-card/file-list-card.styles.js +53 -37
- package/file-download/file-list-card/file-list-card.styles.js.map +1 -1
- package/file-download/file-list-card/types.d.ts +2 -1
- package/file-download/types.d.ts +7 -0
- package/file-upload/helper.d.ts +30 -0
- package/file-upload/helper.js +1 -1
- package/file-upload/helper.js.map +1 -1
- package/fullscreen-image-carousel/fullscreen-image-carousel.d.ts +1 -1
- package/fullscreen-image-carousel/fullscreen-image-carousel.js +1 -1
- package/fullscreen-image-carousel/fullscreen-image-carousel.js.map +1 -1
- package/fullscreen-image-carousel/fullscreen-image-carousel.style.d.ts +7 -0
- package/fullscreen-image-carousel/fullscreen-image-carousel.style.js +21 -21
- package/fullscreen-image-carousel/fullscreen-image-carousel.style.js.map +1 -1
- package/fullscreen-image-carousel/types.d.ts +16 -0
- package/masthead/masthead.js +1 -1
- package/masthead/masthead.js.map +1 -1
- package/navbar/menu.d.ts +2 -1
- package/navbar/menu.js +1 -1
- package/navbar/menu.js.map +1 -1
- package/navbar/menu.styles.js +3 -3
- package/navbar/menu.styles.js.map +1 -1
- package/navbar/navbar-items.js +1 -1
- package/navbar/navbar-items.js.map +1 -1
- package/navbar/navbar-items.styles.js +30 -31
- package/navbar/navbar-items.styles.js.map +1 -1
- package/notification-banner/notification-banner-hoc.js +1 -1
- package/notification-banner/notification-banner-hoc.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{ChevronUpIcon as e}from"@lifesg/react-icons/chevron-up";import t,{css as
|
|
1
|
+
import{ChevronUpIcon as e}from"@lifesg/react-icons/chevron-up";import t,{css as i}from"styled-components";import{ClickableIcon as o}from"../shared/clickable-icon/clickable-icon.js";import{MediaQuery as r,Font as n,Spacing as l,Colour as a}from"../theme/index.js";import{ThemeNavbar as d}from"../theme/components/theme-helper.js";const c=t.ul`
|
|
2
2
|
display: flex;
|
|
3
3
|
list-style: none;
|
|
4
4
|
position: relative;
|
|
@@ -8,7 +8,7 @@ import{ChevronUpIcon as e}from"@lifesg/react-icons/chevron-up";import t,{css as
|
|
|
8
8
|
${r.MaxWidth.lg} {
|
|
9
9
|
display: none;
|
|
10
10
|
}
|
|
11
|
-
`,
|
|
11
|
+
`,s=t.ul`
|
|
12
12
|
display: none;
|
|
13
13
|
list-style: none;
|
|
14
14
|
|
|
@@ -17,7 +17,7 @@ import{ChevronUpIcon as e}from"@lifesg/react-icons/chevron-up";import t,{css as
|
|
|
17
17
|
flex-direction: column;
|
|
18
18
|
overflow: hidden;
|
|
19
19
|
}
|
|
20
|
-
`,
|
|
20
|
+
`,h=t.li`
|
|
21
21
|
display: flex;
|
|
22
22
|
margin: 0 1rem;
|
|
23
23
|
|
|
@@ -28,36 +28,35 @@ import{ChevronUpIcon as e}from"@lifesg/react-icons/chevron-up";import t,{css as
|
|
|
28
28
|
|
|
29
29
|
${r.MaxWidth.lg} {
|
|
30
30
|
flex-direction: column;
|
|
31
|
-
padding: 0.125rem 0;
|
|
32
31
|
width: 100%;
|
|
33
32
|
margin-left: 0rem;
|
|
34
33
|
}
|
|
35
|
-
`,m=
|
|
34
|
+
`,m=i`
|
|
36
35
|
${e=>n[`body-md-${e.$weight}`]}
|
|
37
36
|
|
|
38
37
|
display: flex;
|
|
39
38
|
position: relative;
|
|
40
39
|
align-items: center;
|
|
41
40
|
text-align: center;
|
|
42
|
-
color: ${
|
|
41
|
+
color: ${d["navbar-link-colour-text"]};
|
|
43
42
|
height: 100%;
|
|
44
|
-
gap:
|
|
43
|
+
gap: ${l["spacing-16"]};
|
|
45
44
|
|
|
46
45
|
&:active,
|
|
47
46
|
&:hover,
|
|
48
47
|
&:focus,
|
|
49
48
|
&:focus-within {
|
|
50
|
-
color: ${e=>e.$selected?
|
|
49
|
+
color: ${e=>e.$selected?d["navbar-link-colour-text-selected-hover"]:d["navbar-link-colour-text-hover"]};
|
|
51
50
|
}
|
|
52
51
|
|
|
53
52
|
${r.MaxWidth.lg} {
|
|
54
53
|
width: 100%;
|
|
55
|
-
padding:
|
|
54
|
+
padding: 10px ${l["spacing-24"]};
|
|
56
55
|
text-align: left;
|
|
57
56
|
}
|
|
58
|
-
`,
|
|
57
|
+
`,g=t.a`
|
|
59
58
|
${m}
|
|
60
|
-
|
|
59
|
+
`,$=t.button`
|
|
61
60
|
${m}
|
|
62
61
|
background: none;
|
|
63
62
|
border: 0;
|
|
@@ -68,7 +67,7 @@ import{ChevronUpIcon as e}from"@lifesg/react-icons/chevron-up";import t,{css as
|
|
|
68
67
|
box-shadow: none;
|
|
69
68
|
font: inherit;
|
|
70
69
|
color: inherit;
|
|
71
|
-
|
|
70
|
+
`,p=t.div`
|
|
72
71
|
flex: 1;
|
|
73
72
|
|
|
74
73
|
overflow: hidden;
|
|
@@ -82,16 +81,16 @@ import{ChevronUpIcon as e}from"@lifesg/react-icons/chevron-up";import t,{css as
|
|
|
82
81
|
left: 0;
|
|
83
82
|
right: 0;
|
|
84
83
|
height: 0.25rem;
|
|
85
|
-
background-color: ${
|
|
84
|
+
background-color: ${a["border-selected"]};
|
|
86
85
|
|
|
87
|
-
${e=>e.$selected&&
|
|
88
|
-
${h}:active &,
|
|
89
|
-
${h}:hover &,
|
|
90
|
-
${h}:focus &,
|
|
86
|
+
${e=>e.$selected&&i`
|
|
91
87
|
${g}:active &,
|
|
92
88
|
${g}:hover &,
|
|
93
|
-
${g}:focus
|
|
94
|
-
|
|
89
|
+
${g}:focus &,
|
|
90
|
+
${$}:active &,
|
|
91
|
+
${$}:hover &,
|
|
92
|
+
${$}:focus & {
|
|
93
|
+
background-color: ${a["border-selected-hover"]};
|
|
95
94
|
}
|
|
96
95
|
`};
|
|
97
96
|
|
|
@@ -103,31 +102,31 @@ import{ChevronUpIcon as e}from"@lifesg/react-icons/chevron-up";import t,{css as
|
|
|
103
102
|
height: 100%;
|
|
104
103
|
width: 0.25rem;
|
|
105
104
|
}
|
|
106
|
-
`,
|
|
105
|
+
`,v=t.div`
|
|
107
106
|
margin-right: -0.5rem;
|
|
108
|
-
`,
|
|
107
|
+
`,u=t(o)`
|
|
109
108
|
padding: 0.5rem;
|
|
110
109
|
transform: rotate(${e=>e.$expanded?0:180}deg);
|
|
111
110
|
transition: transform 300ms ease-in-out;
|
|
112
|
-
margin: auto 0
|
|
113
|
-
`,
|
|
111
|
+
margin: auto 0;
|
|
112
|
+
`,x=t(e)`
|
|
114
113
|
height: 1.25rem;
|
|
115
114
|
width: 1.25rem;
|
|
116
|
-
color: ${
|
|
115
|
+
color: ${a.icon};
|
|
117
116
|
|
|
118
|
-
${h}:active &,
|
|
119
|
-
${h}:hover &,
|
|
120
|
-
${h}:focus &,
|
|
121
117
|
${g}:active &,
|
|
122
118
|
${g}:hover &,
|
|
123
|
-
${g}:focus
|
|
124
|
-
|
|
119
|
+
${g}:focus &,
|
|
120
|
+
${$}:active &,
|
|
121
|
+
${$}:hover &,
|
|
122
|
+
${$}:focus & {
|
|
123
|
+
color: ${e=>e.$selected?a["icon-selected-hover"]:a["icon-hover"]};
|
|
125
124
|
}
|
|
126
|
-
`,
|
|
125
|
+
`,b=t(x)`
|
|
127
126
|
transform: rotate(${e=>e.$expanded?0:180}deg);
|
|
128
127
|
transition: transform 300ms ease-in-out;
|
|
129
128
|
|
|
130
129
|
height: 1.125rem;
|
|
131
130
|
width: 1.125rem;
|
|
132
|
-
`;export{
|
|
131
|
+
`;export{x as ChevronIcon,b as ChevronIconDesktop,u as ExpandCollapseButton,g as Link,$ as LinkButton,v as LinkIconContainer,f as LinkIndicator,h as LinkItem,p as LinkLabel,s as MobileWrapper,c as Wrapper};
|
|
133
132
|
//# sourceMappingURL=navbar-items.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navbar-items.styles.js","sources":["../../src/navbar/navbar-items.styles.tsx"],"sourcesContent":["import { ChevronUpIcon } from \"@lifesg/react-icons/chevron-up\";\nimport styled, { css } from \"styled-components\";\nimport { ClickableIcon } from \"../shared/clickable-icon\";\nimport { Font, MediaQuery } from \"../theme\";\nimport { Colour } from \"../theme\";\nimport { ThemeNavbar } from \"../theme/components/theme-helper\";\nimport { TypographyWeight } from \"../typography\";\n\n// =============================================================================\n// STYLE INTERFACE, transient props are denoted with $\n// See more https://styled-components.com/docs/api#transient-props\n// =============================================================================\ninterface StyleProps {\n $selected: boolean;\n $expanded?: boolean;\n}\n\ninterface WrapperStyleProps {\n $alignLeft: boolean | undefined;\n}\n\ninterface ItemStyleProps {\n $hiddenBranding: boolean | undefined;\n}\n\n// =============================================================================\n// WRAPPER\n// =============================================================================\n\nexport const Wrapper = styled.ul<WrapperStyleProps>`\n display: flex;\n list-style: none;\n position: relative;\n\n ${(props) => props.$alignLeft && \"margin-right: auto;\"}\n\n ${MediaQuery.MaxWidth.lg} {\n display: none;\n }\n`;\n\nexport const MobileWrapper = styled.ul`\n display: none;\n list-style: none;\n\n ${MediaQuery.MaxWidth.lg} {\n display: flex;\n flex-direction: column;\n overflow: hidden;\n }\n`;\n\n// =============================================================================\n// LINK ITEMS\n// =============================================================================\nexport const LinkItem = styled.li<ItemStyleProps>`\n display: flex;\n margin: 0 1rem;\n\n &:first-child {\n // negative margin to preserve touch target size for link\n margin-left: ${(props) => (props.$hiddenBranding ? \"-0.5rem\" : \"0\")};\n }\n\n ${MediaQuery.MaxWidth.lg} {\n flex-direction: column;\n
|
|
1
|
+
{"version":3,"file":"navbar-items.styles.js","sources":["../../src/navbar/navbar-items.styles.tsx"],"sourcesContent":["import { ChevronUpIcon } from \"@lifesg/react-icons/chevron-up\";\nimport styled, { css } from \"styled-components\";\nimport { ClickableIcon } from \"../shared/clickable-icon\";\nimport { Font, MediaQuery, Spacing } from \"../theme\";\nimport { Colour } from \"../theme\";\nimport { ThemeNavbar } from \"../theme/components/theme-helper\";\nimport { TypographyWeight } from \"../typography\";\n\n// =============================================================================\n// STYLE INTERFACE, transient props are denoted with $\n// See more https://styled-components.com/docs/api#transient-props\n// =============================================================================\ninterface StyleProps {\n $selected: boolean;\n $expanded?: boolean;\n}\n\ninterface WrapperStyleProps {\n $alignLeft: boolean | undefined;\n}\n\ninterface ItemStyleProps {\n $hiddenBranding: boolean | undefined;\n}\n\n// =============================================================================\n// WRAPPER\n// =============================================================================\n\nexport const Wrapper = styled.ul<WrapperStyleProps>`\n display: flex;\n list-style: none;\n position: relative;\n\n ${(props) => props.$alignLeft && \"margin-right: auto;\"}\n\n ${MediaQuery.MaxWidth.lg} {\n display: none;\n }\n`;\n\nexport const MobileWrapper = styled.ul`\n display: none;\n list-style: none;\n\n ${MediaQuery.MaxWidth.lg} {\n display: flex;\n flex-direction: column;\n overflow: hidden;\n }\n`;\n\n// =============================================================================\n// LINK ITEMS\n// =============================================================================\nexport const LinkItem = styled.li<ItemStyleProps>`\n display: flex;\n margin: 0 1rem;\n\n &:first-child {\n // negative margin to preserve touch target size for link\n margin-left: ${(props) => (props.$hiddenBranding ? \"-0.5rem\" : \"0\")};\n }\n\n ${MediaQuery.MaxWidth.lg} {\n flex-direction: column;\n width: 100%;\n margin-left: 0rem;\n }\n`;\n\nconst linkCss = css<{ $selected: boolean; $weight: TypographyWeight }>`\n ${(props) => Font[`body-md-${props.$weight}`]}\n\n display: flex;\n position: relative;\n align-items: center;\n text-align: center;\n color: ${ThemeNavbar[\"navbar-link-colour-text\"]};\n height: 100%;\n gap: ${Spacing[\"spacing-16\"]};\n\n &:active,\n &:hover,\n &:focus,\n &:focus-within {\n color: ${(props) =>\n props.$selected\n ? ThemeNavbar[\"navbar-link-colour-text-selected-hover\"]\n : ThemeNavbar[\"navbar-link-colour-text-hover\"]};\n }\n\n ${MediaQuery.MaxWidth.lg} {\n width: 100%;\n padding: 10px ${Spacing[\"spacing-24\"]};\n text-align: left;\n }\n`;\nexport const Link = styled.a<{ $selected: boolean; $weight: TypographyWeight }>`\n ${linkCss}\n`;\n\nexport const LinkButton = styled.button<{\n $selected: boolean;\n $weight: TypographyWeight;\n}>`\n ${linkCss}\n background: none;\n border: 0;\n padding: 0;\n cursor: pointer;\n text-align: left;\n margin: 0;\n box-shadow: none;\n font: inherit;\n color: inherit;\n`;\n\nexport const LinkLabel = styled.div`\n flex: 1;\n\n overflow: hidden;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 3;\n white-space: pre-wrap;\n`;\n\nexport const LinkIndicator = styled.div<StyleProps>`\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n height: 0.25rem;\n background-color: ${Colour[\"border-selected\"]};\n\n ${(props) =>\n props.$selected &&\n css`\n ${Link}:active &,\n ${Link}:hover &,\n ${Link}:focus &,\n ${LinkButton}:active &,\n ${LinkButton}:hover &,\n ${LinkButton}:focus & {\n background-color: ${Colour[\"border-selected-hover\"]};\n }\n `};\n\n ${MediaQuery.MaxWidth.lg} {\n left: 0;\n right: unset;\n top: 0;\n bottom: 0;\n height: 100%;\n width: 0.25rem;\n }\n`;\n\nexport const LinkIconContainer = styled.div`\n margin-right: -0.5rem;\n`;\n\nexport const ExpandCollapseButton = styled(ClickableIcon)<StyleProps>`\n padding: 0.5rem;\n transform: rotate(${(props) => (props.$expanded ? 0 : 180)}deg);\n transition: transform 300ms ease-in-out;\n margin: auto 0;\n`;\n\nexport const ChevronIcon = styled(ChevronUpIcon)<StyleProps>`\n height: 1.25rem;\n width: 1.25rem;\n color: ${Colour.icon};\n\n ${Link}:active &,\n ${Link}:hover &,\n ${Link}:focus &,\n ${LinkButton}:active &,\n ${LinkButton}:hover &,\n ${LinkButton}:focus & {\n color: ${(props) =>\n props.$selected\n ? Colour[\"icon-selected-hover\"]\n : Colour[\"icon-hover\"]};\n }\n`;\n\nexport const ChevronIconDesktop = styled(ChevronIcon)<StyleProps>`\n transform: rotate(${(props) => (props.$expanded ? 0 : 180)}deg);\n transition: transform 300ms ease-in-out;\n\n height: 1.125rem;\n width: 1.125rem;\n`;\n"],"names":["Wrapper","styled","ul","props","$alignLeft","MediaQuery","MaxWidth","lg","MobileWrapper","LinkItem","li","$hiddenBranding","linkCss","css","Font","$weight","ThemeNavbar","Spacing","$selected","Link","a","LinkButton","button","LinkLabel","div","LinkIndicator","Colour","LinkIconContainer","ExpandCollapseButton","ClickableIcon","$expanded","ChevronIcon","ChevronUpIcon","icon","ChevronIconDesktop"],"mappings":"yUA6BO,MAAMA,EAAUC,EAAOC,EAAqB;;;;;MAK5CC,GAAUA,EAAMC,YAAc;;MAE/BC,EAAWC,SAASC;;;EAKbC,EAAgBP,EAAOC,EAAE;;;;MAIhCG,EAAWC,SAASC;;;;;EAUbE,EAAWR,EAAOS,EAAkB;;;;;;uBAMzBP,GAAWA,EAAMQ,gBAAkB,UAAY;;;MAGjEN,EAAWC,SAASC;;;;;EAOpBK,EAAUC,CAAsD;MAC/DV,GAAUW,EAAK,WAAWX,EAAMY;;;;;;aAM1BC,EAAY;;WAEdC,EAAQ;;;;;;iBAMDd,GACNA,EAAMe,UACAF,EAAY,0CACZA,EAAY;;;MAGxBX,EAAWC,SAASC;;wBAEFU,EAAQ;;;EAInBE,EAAOlB,EAAOmB,CAAoD;MACzER;EAGOS,EAAapB,EAAOqB,MAG/B;MACIV;;;;;;;;;;EAYOW,EAAYtB,EAAOuB,GAAG;;;;;;;;EAUtBC,EAAgBxB,EAAOuB,GAAe;;;;;;wBAM3BE,EAAO;;MAExBvB,GACCA,EAAMe,WACNL,CAAG;cACGM;cACAA;cACAA;cACAE;cACAA;cACAA;oCACsBK,EAAO;;;;MAIrCrB,EAAWC,SAASC;;;;;;;;EAUboB,EAAoB1B,EAAOuB,GAAG;;EAI9BI,EAAuB3B,EAAO4B,EAA0B;;wBAE5C1B,GAAWA,EAAM2B,UAAY,EAAI;;;EAK7CC,EAAc9B,EAAO+B,EAA0B;;;aAG/CN,EAAOO;;MAEdd;MACAA;MACAA;MACAE;MACAA;MACAA;iBACYlB,GACNA,EAAMe,UACAQ,EAAO,uBACPA,EAAO;;EAIZQ,EAAqBjC,EAAO8B,EAAwB;wBACxC5B,GAAWA,EAAM2B,UAAY,EAAI;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{__rest as t}from"../_virtual/_tslib.js";import{jsx as r}from"react/jsx-runtime";import e from"../external/dompurify/dist/purify.es.js";import n from"react";import{NBComponent as i,NotificationBanner as o}from"./notification-banner.js";const s=s=>n.forwardRef(((n,a)=>r(i,Object.assign({forwardedRef:a},n,{children:s.length>0?s.map(((n,i)=>{var s;if("text"===n.type){const t=n.otherAttributes,o=e.sanitize(n.content);return r("p",Object.assign({},t,{dangerouslySetInnerHTML:{__html:o}}),i)}{const a=function(r){const{href:n}=r,i=t(r,["href"]);return"string"==typeof n&&e.isValidAttribute("a","href",n)?r:i}(null!==(s=n.otherAttributes)&&void 0!==s?s:{});return r(o.Link,Object.assign({},a,{children:n.content}),i)}})):(console.error("[NotificationBannerHOC] Empty data passed"),null)}))));export{s as withNotificationBanner};
|
|
2
2
|
//# sourceMappingURL=notification-banner-hoc.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification-banner-hoc.js","sources":["../../src/notification-banner/notification-banner-hoc.tsx"],"sourcesContent":["import DOMPurify from \"dompurify\";\nimport React from \"react\";\nimport { NBComponent, NotificationBanner } from \"./notification-banner\";\nimport {\n ContentLinkAttributes,\n ContentTextAttributes,\n NotificationBannerWithForwardedRefProps,\n NotificationContentAttributes,\n} from \"./types\";\n\nexport const withNotificationBanner = (\n data: NotificationContentAttributes[]\n) => {\n const ComponentToReturn = (\n props: NotificationBannerWithForwardedRefProps,\n ref: React.Ref<HTMLDivElement>\n ) => {\n const renderContent = () => {\n if (data.length > 0) {\n return data.map((attribute, index) => {\n if (attribute.type === \"text\") {\n const otherAttributes =\n attribute.otherAttributes as ContentTextAttributes;\n\n const sanitizedContent = DOMPurify.sanitize(\n attribute.content\n );\n return (\n <p\n key={index}\n {...otherAttributes}\n dangerouslySetInnerHTML={{\n __html: sanitizedContent,\n }}\n />\n );\n } else {\n const otherAttributes
|
|
1
|
+
{"version":3,"file":"notification-banner-hoc.js","sources":["../../src/notification-banner/notification-banner-hoc.tsx"],"sourcesContent":["import DOMPurify from \"dompurify\";\nimport React from \"react\";\nimport { NBComponent, NotificationBanner } from \"./notification-banner\";\nimport {\n ContentLinkAttributes,\n ContentTextAttributes,\n NotificationBannerWithForwardedRefProps,\n NotificationContentAttributes,\n} from \"./types\";\n\nfunction sanitizeLinkAttributes(\n attrs: ContentLinkAttributes\n): ContentLinkAttributes {\n const { href, ...rest } = attrs;\n\n if (\n typeof href !== \"string\" ||\n !DOMPurify.isValidAttribute(\"a\", \"href\", href)\n ) {\n return rest;\n }\n\n return attrs;\n}\n\nexport const withNotificationBanner = (\n data: NotificationContentAttributes[]\n) => {\n const ComponentToReturn = (\n props: NotificationBannerWithForwardedRefProps,\n ref: React.Ref<HTMLDivElement>\n ) => {\n const renderContent = () => {\n if (data.length > 0) {\n return data.map((attribute, index) => {\n if (attribute.type === \"text\") {\n const otherAttributes =\n attribute.otherAttributes as ContentTextAttributes;\n\n const sanitizedContent = DOMPurify.sanitize(\n attribute.content\n );\n return (\n <p\n key={index}\n {...otherAttributes}\n dangerouslySetInnerHTML={{\n __html: sanitizedContent,\n }}\n />\n );\n } else {\n const otherAttributes = sanitizeLinkAttributes(\n (attribute.otherAttributes ??\n {}) as ContentLinkAttributes\n );\n return (\n <NotificationBanner.Link\n key={index}\n {...otherAttributes}\n >\n {attribute.content}\n </NotificationBanner.Link>\n );\n }\n });\n }\n\n console.error(\"[NotificationBannerHOC] Empty data passed\");\n return null;\n };\n\n return (\n <NBComponent forwardedRef={ref} {...props}>\n {renderContent()}\n </NBComponent>\n );\n };\n\n return React.forwardRef(ComponentToReturn);\n};\n"],"names":["withNotificationBanner","data","React","forwardRef","props","ref","_jsx","NBComponent","Object","assign","forwardedRef","children","length","map","attribute","index","type","otherAttributes","sanitizedContent","DOMPurify","sanitize","content","dangerouslySetInnerHTML","__html","attrs","href","rest","__rest","isValidAttribute","sanitizeLinkAttributes","_a","NotificationBanner","Link","console","error"],"mappings":"kPAyBO,MAAMA,EACTC,GAqDOC,EAAMC,YAnDa,CACtBC,EACAC,IA2CIC,EAACC,EAAWC,OAAAC,OAAA,CAACC,aAAcL,GAASD,EAAK,CAAAO,SAxCrCV,EAAKW,OAAS,EACPX,EAAKY,KAAI,CAACC,EAAWC,WACxB,GAAuB,SAAnBD,EAAUE,KAAiB,CAC3B,MAAMC,EACFH,EAAUG,gBAERC,EAAmBC,EAAUC,SAC/BN,EAAUO,SAEd,OACIf,EAAA,IAAAE,OAAAC,OAAA,GAEQQ,EAAe,CACnBK,wBAAyB,CACrBC,OAAQL,KAHPH,EAOjB,CAAO,CACH,MAAME,EA1C9B,SACIO,GAEA,MAAMC,KAAEA,GAAkBD,EAATE,EAAIC,EAAKH,EAApB,CAAA,SAEN,MACoB,iBAATC,GACNN,EAAUS,iBAAiB,IAAK,OAAQH,GAKtCD,EAHIE,CAIf,CA6BgDG,CACM,QAAzBC,EAAAhB,EAAUG,uBAAe,IAAAa,EAAAA,EACtB,CAAA,GAER,OACIxB,EAACyB,EAAmBC,KAAIxB,OAAAC,OAAA,CAAA,EAEhBQ,EAAe,CAAAN,SAElBG,EAAUO,UAHNN,EAMjB,MAIRkB,QAAQC,MAAM,6CACP"}
|