@lifesg/react-design-system 3.5.0 → 3.6.0-canary.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.
- package/breadcrumb/breadcrumb.js +1 -1
- package/breadcrumb/breadcrumb.js.map +1 -1
- package/breadcrumb/breadcrumb.style.d.ts +1 -6
- package/breadcrumb/breadcrumb.style.js +27 -43
- package/breadcrumb/breadcrumb.style.js.map +1 -1
- package/breadcrumb/types.d.ts +2 -5
- package/cjs/breadcrumb/breadcrumb.js +1 -1
- package/cjs/breadcrumb/breadcrumb.js.map +1 -1
- package/cjs/breadcrumb/breadcrumb.style.js +16 -32
- package/cjs/breadcrumb/breadcrumb.style.js.map +1 -1
- package/cjs/drawer/drawer.js +1 -1
- package/cjs/drawer/drawer.js.map +1 -1
- package/cjs/drawer/drawer.styles.js +48 -31
- package/cjs/drawer/drawer.styles.js.map +1 -1
- package/cjs/local-nav/local-nav-dropdown/local-nav-dropdown.js +1 -1
- package/cjs/local-nav/local-nav-dropdown/local-nav-dropdown.js.map +1 -1
- package/cjs/local-nav/local-nav-dropdown/local-nav-dropdown.styles.js +30 -16
- package/cjs/local-nav/local-nav-dropdown/local-nav-dropdown.styles.js.map +1 -1
- package/cjs/local-nav/local-nav-menu/local-nav-menu.js +1 -1
- package/cjs/local-nav/local-nav-menu/local-nav-menu.js.map +1 -1
- package/cjs/local-nav/local-nav-menu/local-nav-menu.styles.js +25 -11
- package/cjs/local-nav/local-nav-menu/local-nav-menu.styles.js.map +1 -1
- package/cjs/menu/menu-content.js +1 -1
- package/cjs/menu/menu-content.js.map +1 -1
- package/cjs/menu/menu-content.styles.js +4 -1
- package/cjs/menu/menu-content.styles.js.map +1 -1
- package/cjs/menu/menu-item.styles.js +1 -1
- package/cjs/menu/menu-item.styles.js.map +1 -1
- package/cjs/menu/menu-link.styles.js +1 -1
- package/cjs/menu/menu-link.styles.js.map +1 -1
- package/cjs/menu/menu-section.js +1 -1
- package/cjs/menu/menu-section.js.map +1 -1
- package/cjs/menu/menu-section.styles.js +23 -9
- package/cjs/menu/menu-section.styles.js.map +1 -1
- package/cjs/navbar/navbar-items.js +1 -1
- package/cjs/navbar/navbar-items.js.map +1 -1
- package/cjs/pagination/pagination.js +1 -1
- package/cjs/pagination/pagination.js.map +1 -1
- package/cjs/shared/dropdown-list/dropdown-label.js +1 -1
- package/cjs/shared/dropdown-list/dropdown-label.js.map +1 -1
- package/cjs/shared/fade-wrapper/fade-wrapper.js +1 -1
- package/cjs/shared/fade-wrapper/fade-wrapper.js.map +1 -1
- package/drawer/drawer.d.ts +1 -1
- package/drawer/drawer.js +1 -1
- package/drawer/drawer.js.map +1 -1
- package/drawer/drawer.styles.d.ts +8 -1
- package/drawer/drawer.styles.js +46 -29
- package/drawer/drawer.styles.js.map +1 -1
- package/drawer/types.d.ts +7 -0
- package/input-group/types.d.ts +1 -1
- package/input-select/types.d.ts +1 -1
- package/local-nav/local-nav-dropdown/local-nav-dropdown.js +1 -1
- package/local-nav/local-nav-dropdown/local-nav-dropdown.js.map +1 -1
- package/local-nav/local-nav-dropdown/local-nav-dropdown.styles.d.ts +3 -0
- package/local-nav/local-nav-dropdown/local-nav-dropdown.styles.js +42 -28
- package/local-nav/local-nav-dropdown/local-nav-dropdown.styles.js.map +1 -1
- package/local-nav/local-nav-menu/local-nav-menu.js +1 -1
- package/local-nav/local-nav-menu/local-nav-menu.js.map +1 -1
- package/local-nav/local-nav-menu/local-nav-menu.styles.d.ts +3 -0
- package/local-nav/local-nav-menu/local-nav-menu.styles.js +25 -11
- package/local-nav/local-nav-menu/local-nav-menu.styles.js.map +1 -1
- package/local-nav/types.d.ts +17 -0
- package/menu/menu-content.js +1 -1
- package/menu/menu-content.js.map +1 -1
- package/menu/menu-content.styles.d.ts +1 -0
- package/menu/menu-content.styles.js +17 -14
- package/menu/menu-content.styles.js.map +1 -1
- package/menu/menu-item.styles.js +1 -1
- package/menu/menu-item.styles.js.map +1 -1
- package/menu/menu-link.styles.js +1 -1
- package/menu/menu-link.styles.js.map +1 -1
- package/menu/menu-section.d.ts +1 -1
- package/menu/menu-section.js +1 -1
- package/menu/menu-section.js.map +1 -1
- package/menu/menu-section.styles.d.ts +9 -2
- package/menu/menu-section.styles.js +22 -8
- package/menu/menu-section.styles.js.map +1 -1
- package/menu/menu.d.ts +1 -1
- package/menu/types.d.ts +2 -2
- package/navbar/navbar-items.js +1 -1
- package/navbar/navbar-items.js.map +1 -1
- package/navbar/types.d.ts +1 -0
- package/package.json +1 -1
- package/pagination/pagination.js +1 -1
- package/pagination/pagination.js.map +1 -1
- package/pagination/types.d.ts +1 -0
- package/select-histogram/types.d.ts +1 -1
- package/shared/dropdown-list/dropdown-label.d.ts +2 -2
- package/shared/dropdown-list/dropdown-label.js +1 -1
- package/shared/dropdown-list/dropdown-label.js.map +1 -1
- package/shared/dropdown-list/types.d.ts +2 -2
- package/shared/fade-wrapper/fade-wrapper.js +1 -1
- package/shared/fade-wrapper/fade-wrapper.js.map +1 -1
- package/shared/fade-wrapper/types.d.ts +1 -0
package/breadcrumb/breadcrumb.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__rest as e}from"../_virtual/_tslib.js";import{
|
|
1
|
+
import{__rest as e}from"../_virtual/_tslib.js";import{jsx as r,jsxs as i}from"react/jsx-runtime";import{useRef as t,useContext as l}from"react";import"../util/calendar-helper.js";import"../util/date-helper.js";import"../util/date-input-helper.js";import"../util/simple-id-generator.js";import"../util/string-helper.js";import"@react-aria/live-announcer";import{useEvent as n}from"../util/use-event.js";import{useIsomorphicLayoutEffect as o}from"../util/use-isomorphic-layout-effect.js";import{Wrapper as a,Content as s,CurrentLabel as d,PreviousLink as m,Item as c,Caret as p,Slash as h}from"./breadcrumb.style.js";import{ThemeContext as u}from"styled-components";import{Breakpoint as f}from"../theme/index.js";const j=j=>{var{links:b,fadeColor:g,fadePosition:v="both",itemStyle:y,id:w,separatorStyle:S="chevron"}=j,x=e(j,["links","fadeColor","fadePosition","itemStyle","id","separatorStyle"]);const P=t(null),C=l(u),O=f["lg-max"]({theme:C}),k=n((()=>{var e;b&&b.length>1&&window.innerWidth<=O&&(null===(e=P.current)||void 0===e||e.scrollToEnd())}));if(o((()=>{k()}),[k,O]),!b)return null;return r(a,Object.assign({ref:P,id:w||"breadcrumb",fadeColor:g,fadePosition:v,onResize:k},x,{children:r("nav",{"aria-label":"Breadcrumb",children:r(s,{children:b.map(((e,t)=>{let l;return e.children?(l=t!==b.length-1&&e.href?r(m,Object.assign({},e,{weight:"semibold",underlineStyle:"none"})):r(d,{weight:"semibold",forwardedAs:"span",children:e.children}),i(c,Object.assign({$styleProps:y},t===b.length-1&&{"aria-current":"page"},{children:[l,t<b.length-1&&("chevron"===S?r(p,{"aria-hidden":!0}):r(h,{inline:!0,"aria-hidden":!0,children:"/"}))]}),t)):null}))})})}))};export{j as Breadcrumb};
|
|
2
2
|
//# sourceMappingURL=breadcrumb.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"breadcrumb.js","sources":["../../src/breadcrumb/breadcrumb.tsx"],"sourcesContent":["import { useContext, useRef
|
|
1
|
+
{"version":3,"file":"breadcrumb.js","sources":["../../src/breadcrumb/breadcrumb.tsx"],"sourcesContent":["import { useContext, useRef } from \"react\";\nimport { useEvent, useIsomorphicLayoutEffect } from \"../util\";\nimport {\n Caret,\n Content,\n CurrentLabel,\n Item,\n PreviousLink,\n Slash,\n Wrapper,\n} from \"./breadcrumb.style\";\nimport { BreadcrumbProps } from \"./types\";\nimport { ThemeContext } from \"styled-components\";\nimport { Breakpoint } from \"../theme\";\nimport { FadeWrapperRef } from \"../shared/fade-wrapper\";\n\nexport const Breadcrumb = ({\n links,\n fadeColor,\n fadePosition = \"both\",\n itemStyle,\n id,\n separatorStyle = \"chevron\",\n ...otherProps\n}: BreadcrumbProps) => {\n // =========================================================================\n // CONST, STATE, REFS\n // =========================================================================\n const fadeWrapperRef = useRef<FadeWrapperRef>(null);\n\n // =============================================================================\n // EVENT HANDLERS\n // =============================================================================\n\n const theme = useContext(ThemeContext);\n const tabletBreakpoint = Breakpoint[\"lg-max\"]({ theme });\n\n const handleResize = useEvent(() => {\n if (\n links &&\n links.length > 1 &&\n window.innerWidth <= tabletBreakpoint\n ) {\n fadeWrapperRef.current?.scrollToEnd();\n }\n });\n\n // =============================================================================\n // EFFECTS\n // =============================================================================\n useIsomorphicLayoutEffect(() => {\n handleResize();\n }, [handleResize, tabletBreakpoint]);\n\n // =========================================================================\n // RENDER\n // =========================================================================\n if (!links) return null;\n\n const renderLinks = () => {\n return links.map((link, index) => {\n let element: JSX.Element;\n if (!link.children) {\n return null;\n }\n\n if (index === links.length - 1 || !link.href) {\n element = (\n <CurrentLabel weight=\"semibold\" forwardedAs=\"span\">\n {link.children}\n </CurrentLabel>\n );\n } else {\n element = (\n <PreviousLink\n {...link}\n weight=\"semibold\"\n underlineStyle=\"none\"\n />\n );\n }\n\n return (\n <Item\n key={index}\n $styleProps={itemStyle}\n {...(index === links.length - 1 && {\n \"aria-current\": \"page\",\n })}\n >\n {element}\n {index < links.length - 1 &&\n (separatorStyle === \"chevron\" ? (\n <Caret aria-hidden />\n ) : (\n <Slash inline aria-hidden>\n /\n </Slash>\n ))}\n </Item>\n );\n });\n };\n\n return (\n <Wrapper\n ref={fadeWrapperRef}\n id={id || \"breadcrumb\"}\n fadeColor={fadeColor}\n fadePosition={fadePosition}\n onResize={handleResize}\n {...otherProps}\n >\n <nav aria-label=\"Breadcrumb\">\n <Content>{renderLinks()}</Content>\n </nav>\n </Wrapper>\n );\n};\n"],"names":["Breadcrumb","_a","links","fadeColor","fadePosition","itemStyle","id","separatorStyle","otherProps","__rest","fadeWrapperRef","useRef","theme","useContext","ThemeContext","tabletBreakpoint","Breakpoint","handleResize","useEvent","length","window","innerWidth","current","scrollToEnd","useIsomorphicLayoutEffect","_jsx","Wrapper","ref","onResize","children","Content","map","link","index","element","href","PreviousLink","Object","assign","weight","underlineStyle","CurrentLabel","forwardedAs","_jsxs","Item","$styleProps","Caret","Slash","inline"],"mappings":"usBAgBO,MAAMA,EAAcC,QAAAC,MACvBA,EAAKC,UACLA,EAASC,aACTA,EAAe,OAAMC,UACrBA,EAASC,GACTA,EAAEC,eACFA,EAAiB,WAASN,EACvBO,EAAUC,EAAAR,EAPU,wEAYvB,MAAMS,EAAiBC,EAAuB,MAMxCC,EAAQC,EAAWC,GACnBC,EAAmBC,EAAW,UAAU,CAAEJ,UAE1CK,EAAeC,GAAS,WAEtBhB,GACAA,EAAMiB,OAAS,GACfC,OAAOC,YAAcN,IAEC,QAAtBd,EAAAS,EAAeY,eAAO,IAAArB,GAAAA,EAAEsB,cAC5B,IAaJ,GAPAC,GAA0B,KACtBP,GAAc,GACf,CAACA,EAAcF,KAKbb,EAAO,OAAO,KA+CnB,OACIuB,EAACC,iBACGC,IAAKjB,EACLJ,GAAIA,GAAM,aACVH,UAAWA,EACXC,aAAcA,EACdwB,SAAUX,GACNT,EAAU,CAAAqB,SAEdJ,sBAAgB,aAAYI,SACxBJ,EAACK,YAtDF5B,EAAM6B,KAAI,CAACC,EAAMC,KACpB,IAAIC,EACJ,OAAKF,EAAKH,UAWNK,EAPAD,IAAU/B,EAAMiB,OAAS,GAAMa,EAAKG,KAQhCV,EAACW,EAAYC,OAAAC,OAAA,CAAA,EACLN,EAAI,CACRO,OAAO,WACPC,eAAe,UATnBf,EAACgB,EAAY,CAACF,OAAO,WAAWG,YAAY,OAAMb,SAC7CG,EAAKH,WAcdc,EAACC,EAAIP,OAAAC,OAAA,CAAAO,YAEYxC,GACR4B,IAAU/B,EAAMiB,OAAS,GAAK,CAC/B,eAAgB,QAClB,CAAAU,SAAA,CAEDK,EACAD,EAAQ/B,EAAMiB,OAAS,IACA,YAAnBZ,EACGkB,EAACqB,EAAK,CAAA,eAAA,IAENrB,EAACsB,EAAK,CAACC,QAAM,EAAA,eAAA,EAAAnB,SAAA,UAXhBI,IArBF,IAoCA,UAiBL"}
|
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
interface FadeProps {
|
|
2
|
-
$backgroundColor?: string[];
|
|
3
|
-
$position?: "left" | "right";
|
|
4
|
-
}
|
|
5
1
|
interface ItemStyleProps {
|
|
6
2
|
$styleProps?: string;
|
|
7
3
|
}
|
|
8
|
-
export declare const Wrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").
|
|
4
|
+
export declare const Wrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("../shared/fade-wrapper").FadeWrapperProps & import("react").RefAttributes<import("../shared/fade-wrapper").FadeWrapperRef>, never> & Partial<Pick<import("../shared/fade-wrapper").FadeWrapperProps & import("react").RefAttributes<import("../shared/fade-wrapper").FadeWrapperRef>, never>>> & string & Omit<(props: import("../shared/fade-wrapper").FadeWrapperProps & import("react").RefAttributes<import("../shared/fade-wrapper").FadeWrapperRef>) => React.ReactElement | null, keyof import("react").Component<any, {}, any>>;
|
|
9
5
|
export declare const Content: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>, never>>> & string;
|
|
10
|
-
export declare const Fade: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof FadeProps> & FadeProps, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof FadeProps> & FadeProps, never>>> & string;
|
|
11
6
|
export declare const Item: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "$styleProps"> & ItemStyleProps, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "$styleProps"> & ItemStyleProps, never>>> & string;
|
|
12
7
|
export declare const Caret: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<import("react").SVGProps<SVGSVGElement>, "ref"> & {
|
|
13
8
|
ref?: ((instance: SVGSVGElement | null) => void) | import("react").RefObject<SVGSVGElement> | null | undefined;
|
|
@@ -1,64 +1,48 @@
|
|
|
1
|
-
import{ChevronRightIcon as
|
|
2
|
-
position: relative;
|
|
3
|
-
width: 100%;
|
|
1
|
+
import{ChevronRightIcon as i}from"@lifesg/react-icons/chevron-right";import e from"styled-components";import{Spacing as t,MediaQuery as a,Font as r,Colour as n}from"../theme/index.js";import{Typography as o}from"../typography/typography.js";import{FadeWrapper as p}from"../shared/fade-wrapper/fade-wrapper.js";const s=e(p)`
|
|
4
2
|
z-index: 1;
|
|
5
|
-
margin: ${
|
|
3
|
+
margin: ${t["spacing-32"]} 0;
|
|
4
|
+
|
|
5
|
+
${a.MaxWidth.xl} {
|
|
6
|
+
margin: ${t["spacing-24"]} 0;
|
|
7
|
+
}
|
|
6
8
|
|
|
7
|
-
${
|
|
8
|
-
margin: ${
|
|
9
|
+
${a.MaxWidth.lg} {
|
|
10
|
+
margin: ${t["spacing-16"]} 0;
|
|
9
11
|
}
|
|
10
12
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
+
[data-id="left-fade"],
|
|
14
|
+
[data-id="right-fade"] {
|
|
15
|
+
height: calc(1lh + ${t["spacing-4"]});
|
|
16
|
+
top: 50%;
|
|
17
|
+
transform: translateY(-50%);
|
|
13
18
|
}
|
|
14
|
-
`,
|
|
19
|
+
`,l=e.ul`
|
|
15
20
|
display: inline-flex;
|
|
16
21
|
width: 100%;
|
|
17
22
|
flex-wrap: wrap;
|
|
18
23
|
white-space: nowrap;
|
|
19
|
-
margin-left: -${
|
|
24
|
+
margin-left: -${t["spacing-8"]};
|
|
20
25
|
font-size: ${r.Spec["body-size-md"]};
|
|
21
|
-
|
|
22
|
-
overflow-y: hidden;
|
|
23
|
-
scrollbar-width: none; /* Firefox */
|
|
24
|
-
-ms-overflow-style: none; /* IE 10+ */
|
|
25
|
-
&::-webkit-scrollbar {
|
|
26
|
-
display: none; /* Chrome/Safari/Webkit */
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
${o.MaxWidth.lg} {
|
|
26
|
+
${a.MaxWidth.lg} {
|
|
30
27
|
flex-wrap: nowrap;
|
|
31
28
|
}
|
|
32
|
-
`,
|
|
33
|
-
width: ${e["spacing-64"]};
|
|
34
|
-
height: calc(1lh + ${e["spacing-4"]});
|
|
35
|
-
position: absolute;
|
|
36
|
-
top: 50%;
|
|
37
|
-
transform: translateY(-50%);
|
|
38
|
-
pointer-events: none;
|
|
39
|
-
|
|
40
|
-
${t=>{let i;const e="rgba(255,255,255,0.001)",r=a.bg(t);return i="left"===t.$position?`\n\t\t\t\tleft: -8px;\n\t\t\t\tbackground-image: linear-gradient(\n\t\t\t\t\tto right, \n\t\t\t\t\t${t.$backgroundColor||r}, \n\t\t\t\t\t${e}\n\t\t\t\t);\n\t\t\t`:`\n\t\t\t\tright: 8px;\n\t\t\t\tbackground-image: linear-gradient(\n\t\t\t\t\tto left,\n\t\t\t\t\t${t.$backgroundColor||r},\n\t\t\t\t\t${e}\n\t\t\t\t);\n\t\t\t`,n`
|
|
41
|
-
${o.MaxWidth.lg} {
|
|
42
|
-
${i}
|
|
43
|
-
}
|
|
44
|
-
`}};
|
|
45
|
-
`,c=i.li`
|
|
29
|
+
`,d=e.li`
|
|
46
30
|
display: flex;
|
|
47
31
|
flex-direction: row;
|
|
48
32
|
align-items: center;
|
|
49
33
|
line-height: inherit;
|
|
50
34
|
font-size: inherit;
|
|
51
|
-
${
|
|
52
|
-
`,
|
|
35
|
+
${i=>i.$styleProps||""};
|
|
36
|
+
`,m=e(i)`
|
|
53
37
|
height: 1em;
|
|
54
38
|
width: 1em;
|
|
55
|
-
color: ${
|
|
56
|
-
`,
|
|
39
|
+
color: ${n["icon-subtle"]};
|
|
40
|
+
`,g=e(o.BodyMD)`
|
|
57
41
|
display: inline-block;
|
|
58
|
-
color: ${
|
|
59
|
-
`,
|
|
60
|
-
margin: ${
|
|
61
|
-
|
|
62
|
-
margin: ${
|
|
63
|
-
`;export{
|
|
42
|
+
color: ${n["text-subtlest"]};
|
|
43
|
+
`,c=e(o.BodyMD)`
|
|
44
|
+
margin: ${t["spacing-8"]} !important;
|
|
45
|
+
`,h=e(o.LinkMD)`
|
|
46
|
+
margin: ${t["spacing-8"]} !important;
|
|
47
|
+
`;export{m as Caret,l as Content,c as CurrentLabel,d as Item,h as PreviousLink,g as Slash,s as Wrapper};
|
|
64
48
|
//# sourceMappingURL=breadcrumb.style.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"breadcrumb.style.js","sources":["../../src/breadcrumb/breadcrumb.style.tsx"],"sourcesContent":["import { ChevronRightIcon } from \"@lifesg/react-icons/chevron-right\";\nimport styled
|
|
1
|
+
{"version":3,"file":"breadcrumb.style.js","sources":["../../src/breadcrumb/breadcrumb.style.tsx"],"sourcesContent":["import { ChevronRightIcon } from \"@lifesg/react-icons/chevron-right\";\nimport styled from \"styled-components\";\nimport { Colour, Font, MediaQuery, Spacing } from \"../theme\";\nimport { Typography } from \"../typography/typography\";\nimport { FadeWrapper } from \"../shared/fade-wrapper\";\n\n// =============================================================================\n// STYLE TYPES, transient props are denoted with $\n// See more https://styled-components.com/docs/api#transient-props\n// =============================================================================\ninterface ItemStyleProps {\n $styleProps?: string;\n}\n\n// =============================================================================\n// STYLE COMPONENTS\n// =============================================================================\nexport const Wrapper = styled(FadeWrapper)`\n z-index: 1;\n margin: ${Spacing[\"spacing-32\"]} 0;\n\n ${MediaQuery.MaxWidth.xl} {\n margin: ${Spacing[\"spacing-24\"]} 0;\n }\n\n ${MediaQuery.MaxWidth.lg} {\n margin: ${Spacing[\"spacing-16\"]} 0;\n }\n\n [data-id=\"left-fade\"],\n [data-id=\"right-fade\"] {\n height: calc(1lh + ${Spacing[\"spacing-4\"]});\n top: 50%;\n transform: translateY(-50%);\n }\n`;\n\nexport const Content = styled.ul`\n display: inline-flex;\n width: 100%;\n flex-wrap: wrap;\n white-space: nowrap;\n margin-left: -${Spacing[\"spacing-8\"]};\n font-size: ${Font.Spec[\"body-size-md\"]};\n ${MediaQuery.MaxWidth.lg} {\n flex-wrap: nowrap;\n }\n`;\n\nexport const Item = styled.li<ItemStyleProps>`\n display: flex;\n flex-direction: row;\n align-items: center;\n line-height: inherit;\n font-size: inherit;\n ${(props) => {\n return props.$styleProps || ``;\n }};\n`;\n\nexport const Caret = styled(ChevronRightIcon)`\n height: 1em;\n width: 1em;\n color: ${Colour[\"icon-subtle\"]};\n`;\n\nexport const Slash = styled(Typography.BodyMD)`\n display: inline-block;\n color: ${Colour[\"text-subtlest\"]};\n`;\n\nexport const CurrentLabel = styled(Typography.BodyMD)`\n margin: ${Spacing[\"spacing-8\"]} !important;\n`;\n\nexport const PreviousLink = styled(Typography.LinkMD)`\n margin: ${Spacing[\"spacing-8\"]} !important;\n`;\n"],"names":["Wrapper","styled","FadeWrapper","Spacing","MediaQuery","MaxWidth","xl","lg","Content","ul","Font","Spec","Item","li","props","$styleProps","Caret","ChevronRightIcon","Colour","Slash","Typography","BodyMD","CurrentLabel","PreviousLink","LinkMD"],"mappings":"4TAiBaA,EAAUC,EAAOC,EAAY;;cAE5BC,EAAQ;;MAEhBC,EAAWC,SAASC;kBACRH,EAAQ;;;MAGpBC,EAAWC,SAASE;kBACRJ,EAAQ;;;;;6BAKGA,EAAQ;;;;EAMxBK,EAAUP,EAAOQ,EAAE;;;;;oBAKZN,EAAQ;iBACXO,EAAKC,KAAK;MACrBP,EAAWC,SAASE;;;EAKbK,EAAOX,EAAOY,EAAkB;;;;;;MAMtCC,GACQA,EAAMC,aAAe;EAIvBC,EAAQf,EAAOgB,EAAiB;;;aAGhCC,EAAO;EAGPC,EAAQlB,EAAOmB,EAAWC,OAAO;;aAEjCH,EAAO;EAGPI,EAAerB,EAAOmB,EAAWC,OAAO;cACvClB,EAAQ;EAGToB,EAAetB,EAAOmB,EAAWI,OAAO;cACvCrB,EAAQ;"}
|
package/breadcrumb/types.d.ts
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { FadeColorSet, FadePosition } from "../shared/fade-wrapper";
|
|
2
|
+
export type { FadeColorSet, FadePosition };
|
|
2
3
|
export type SeparatorStyle = "chevron" | "slash";
|
|
3
|
-
export interface FadeColorSet {
|
|
4
|
-
left?: string[] | undefined;
|
|
5
|
-
right?: string[] | undefined;
|
|
6
|
-
}
|
|
7
4
|
export interface BreadcrumbProps {
|
|
8
5
|
links: React.AnchorHTMLAttributes<HTMLAnchorElement>[];
|
|
9
6
|
fadeColor?: string[] | FadeColorSet | undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("../_virtual/_tslib.js"),r=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";var e=require("../_virtual/_tslib.js"),r=require("react/jsx-runtime"),i=require("react");require("../util/calendar-helper.js"),require("../util/date-helper.js"),require("../util/date-input-helper.js"),require("../util/simple-id-generator.js"),require("../util/string-helper.js"),require("@react-aria/live-announcer");var t=require("../util/use-event.js"),n=require("../util/use-isomorphic-layout-effect.js"),l=require("./breadcrumb.style.js"),s=require("styled-components"),a=require("../theme/index.js");exports.Breadcrumb=u=>{var{links:o,fadeColor:d,fadePosition:c="both",itemStyle:h,id:j,separatorStyle:m="chevron"}=u,p=e.__rest(u,["links","fadeColor","fadePosition","itemStyle","id","separatorStyle"]);const b=i.useRef(null),f=i.useContext(s.ThemeContext),q=a.Breakpoint["lg-max"]({theme:f}),x=t.useEvent((()=>{var e;o&&o.length>1&&window.innerWidth<=q&&(null===(e=b.current)||void 0===e||e.scrollToEnd())}));if(n.useIsomorphicLayoutEffect((()=>{x()}),[x,q]),!o)return null;return r.jsx(l.Wrapper,Object.assign({ref:b,id:j||"breadcrumb",fadeColor:d,fadePosition:c,onResize:x},p,{children:r.jsx("nav",{"aria-label":"Breadcrumb",children:r.jsx(l.Content,{children:o.map(((e,i)=>{let t;return e.children?(t=i!==o.length-1&&e.href?r.jsx(l.PreviousLink,Object.assign({},e,{weight:"semibold",underlineStyle:"none"})):r.jsx(l.CurrentLabel,{weight:"semibold",forwardedAs:"span",children:e.children}),r.jsxs(l.Item,Object.assign({$styleProps:h},i===o.length-1&&{"aria-current":"page"},{children:[t,i<o.length-1&&("chevron"===m?r.jsx(l.Caret,{"aria-hidden":!0}):r.jsx(l.Slash,{inline:!0,"aria-hidden":!0,children:"/"}))]}),i)):null}))})})}))};
|
|
2
2
|
//# sourceMappingURL=breadcrumb.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"breadcrumb.js","sources":["../../../src/breadcrumb/breadcrumb.tsx"],"sourcesContent":["import { useContext, useRef
|
|
1
|
+
{"version":3,"file":"breadcrumb.js","sources":["../../../src/breadcrumb/breadcrumb.tsx"],"sourcesContent":["import { useContext, useRef } from \"react\";\nimport { useEvent, useIsomorphicLayoutEffect } from \"../util\";\nimport {\n Caret,\n Content,\n CurrentLabel,\n Item,\n PreviousLink,\n Slash,\n Wrapper,\n} from \"./breadcrumb.style\";\nimport { BreadcrumbProps } from \"./types\";\nimport { ThemeContext } from \"styled-components\";\nimport { Breakpoint } from \"../theme\";\nimport { FadeWrapperRef } from \"../shared/fade-wrapper\";\n\nexport const Breadcrumb = ({\n links,\n fadeColor,\n fadePosition = \"both\",\n itemStyle,\n id,\n separatorStyle = \"chevron\",\n ...otherProps\n}: BreadcrumbProps) => {\n // =========================================================================\n // CONST, STATE, REFS\n // =========================================================================\n const fadeWrapperRef = useRef<FadeWrapperRef>(null);\n\n // =============================================================================\n // EVENT HANDLERS\n // =============================================================================\n\n const theme = useContext(ThemeContext);\n const tabletBreakpoint = Breakpoint[\"lg-max\"]({ theme });\n\n const handleResize = useEvent(() => {\n if (\n links &&\n links.length > 1 &&\n window.innerWidth <= tabletBreakpoint\n ) {\n fadeWrapperRef.current?.scrollToEnd();\n }\n });\n\n // =============================================================================\n // EFFECTS\n // =============================================================================\n useIsomorphicLayoutEffect(() => {\n handleResize();\n }, [handleResize, tabletBreakpoint]);\n\n // =========================================================================\n // RENDER\n // =========================================================================\n if (!links) return null;\n\n const renderLinks = () => {\n return links.map((link, index) => {\n let element: JSX.Element;\n if (!link.children) {\n return null;\n }\n\n if (index === links.length - 1 || !link.href) {\n element = (\n <CurrentLabel weight=\"semibold\" forwardedAs=\"span\">\n {link.children}\n </CurrentLabel>\n );\n } else {\n element = (\n <PreviousLink\n {...link}\n weight=\"semibold\"\n underlineStyle=\"none\"\n />\n );\n }\n\n return (\n <Item\n key={index}\n $styleProps={itemStyle}\n {...(index === links.length - 1 && {\n \"aria-current\": \"page\",\n })}\n >\n {element}\n {index < links.length - 1 &&\n (separatorStyle === \"chevron\" ? (\n <Caret aria-hidden />\n ) : (\n <Slash inline aria-hidden>\n /\n </Slash>\n ))}\n </Item>\n );\n });\n };\n\n return (\n <Wrapper\n ref={fadeWrapperRef}\n id={id || \"breadcrumb\"}\n fadeColor={fadeColor}\n fadePosition={fadePosition}\n onResize={handleResize}\n {...otherProps}\n >\n <nav aria-label=\"Breadcrumb\">\n <Content>{renderLinks()}</Content>\n </nav>\n </Wrapper>\n );\n};\n"],"names":["_a","links","fadeColor","fadePosition","itemStyle","id","separatorStyle","otherProps","__rest","fadeWrapperRef","useRef","theme","useContext","ThemeContext","tabletBreakpoint","Breakpoint","handleResize","useEvent","length","window","innerWidth","current","scrollToEnd","useIsomorphicLayoutEffect","_jsx","Wrapper","ref","onResize","children","Content","map","link","index","element","href","PreviousLink","Object","assign","weight","underlineStyle","CurrentLabel","forwardedAs","_jsxs","Item","$styleProps","Caret","Slash","inline"],"mappings":"yhBAgB2BA,QAAAC,MACvBA,EAAKC,UACLA,EAASC,aACTA,EAAe,OAAMC,UACrBA,EAASC,GACTA,EAAEC,eACFA,EAAiB,WAASN,EACvBO,EAAUC,EAAAA,OAAAR,EAPU,wEAYvB,MAAMS,EAAiBC,EAAAA,OAAuB,MAMxCC,EAAQC,EAAAA,WAAWC,gBACnBC,EAAmBC,EAAAA,WAAW,UAAU,CAAEJ,UAE1CK,EAAeC,EAAAA,UAAS,WAEtBhB,GACAA,EAAMiB,OAAS,GACfC,OAAOC,YAAcN,IAEC,QAAtBd,EAAAS,EAAeY,eAAO,IAAArB,GAAAA,EAAEsB,cAC5B,IAaJ,GAPAC,EAAAA,2BAA0B,KACtBP,GAAc,GACf,CAACA,EAAcF,KAKbb,EAAO,OAAO,KA+CnB,OACIuB,EAAAA,IAACC,EAAAA,uBACGC,IAAKjB,EACLJ,GAAIA,GAAM,aACVH,UAAWA,EACXC,aAAcA,EACdwB,SAAUX,GACNT,EAAU,CAAAqB,SAEdJ,EAAAA,wBAAgB,aAAYI,SACxBJ,EAAAA,IAACK,EAAAA,kBAtDF5B,EAAM6B,KAAI,CAACC,EAAMC,KACpB,IAAIC,EACJ,OAAKF,EAAKH,UAWNK,EAPAD,IAAU/B,EAAMiB,OAAS,GAAMa,EAAKG,KAQhCV,EAAAA,IAACW,EAAAA,aAAYC,OAAAC,OAAA,CAAA,EACLN,EAAI,CACRO,OAAO,WACPC,eAAe,UATnBf,EAAAA,IAACgB,eAAY,CAACF,OAAO,WAAWG,YAAY,OAAMb,SAC7CG,EAAKH,WAcdc,OAACC,EAAAA,KAAIP,OAAAC,OAAA,CAAAO,YAEYxC,GACR4B,IAAU/B,EAAMiB,OAAS,GAAK,CAC/B,eAAgB,QAClB,CAAAU,SAAA,CAEDK,EACAD,EAAQ/B,EAAMiB,OAAS,IACA,YAAnBZ,EACGkB,EAAAA,IAACqB,QAAK,CAAA,eAAA,IAENrB,EAAAA,IAACsB,QAAK,CAACC,QAAM,EAAA,eAAA,EAAAnB,SAAA,UAXhBI,IArBF,IAoCA,UAiBL"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
"use strict";var
|
|
2
|
-
position: relative;
|
|
3
|
-
width: 100%;
|
|
1
|
+
"use strict";var e=require("@lifesg/react-icons/chevron-right"),a=require("styled-components"),i=require("../theme/index.js"),r=require("../typography/typography.js"),t=require("../shared/fade-wrapper/fade-wrapper.js");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var p=n(a);const o=p.default(t.FadeWrapper)`
|
|
4
2
|
z-index: 1;
|
|
5
3
|
margin: ${i.Spacing["spacing-32"]} 0;
|
|
6
4
|
|
|
@@ -11,54 +9,40 @@
|
|
|
11
9
|
${i.MediaQuery.MaxWidth.lg} {
|
|
12
10
|
margin: ${i.Spacing["spacing-16"]} 0;
|
|
13
11
|
}
|
|
14
|
-
|
|
12
|
+
|
|
13
|
+
[data-id="left-fade"],
|
|
14
|
+
[data-id="right-fade"] {
|
|
15
|
+
height: calc(1lh + ${i.Spacing["spacing-4"]});
|
|
16
|
+
top: 50%;
|
|
17
|
+
transform: translateY(-50%);
|
|
18
|
+
}
|
|
19
|
+
`,l=p.default.ul`
|
|
15
20
|
display: inline-flex;
|
|
16
21
|
width: 100%;
|
|
17
22
|
flex-wrap: wrap;
|
|
18
23
|
white-space: nowrap;
|
|
19
24
|
margin-left: -${i.Spacing["spacing-8"]};
|
|
20
25
|
font-size: ${i.Font.Spec["body-size-md"]};
|
|
21
|
-
overflow-x: scroll;
|
|
22
|
-
overflow-y: hidden;
|
|
23
|
-
scrollbar-width: none; /* Firefox */
|
|
24
|
-
-ms-overflow-style: none; /* IE 10+ */
|
|
25
|
-
&::-webkit-scrollbar {
|
|
26
|
-
display: none; /* Chrome/Safari/Webkit */
|
|
27
|
-
}
|
|
28
|
-
|
|
29
26
|
${i.MediaQuery.MaxWidth.lg} {
|
|
30
27
|
flex-wrap: nowrap;
|
|
31
28
|
}
|
|
32
|
-
`,p
|
|
33
|
-
width: ${i.Spacing["spacing-64"]};
|
|
34
|
-
height: calc(1lh + ${i.Spacing["spacing-4"]});
|
|
35
|
-
position: absolute;
|
|
36
|
-
top: 50%;
|
|
37
|
-
transform: translateY(-50%);
|
|
38
|
-
pointer-events: none;
|
|
39
|
-
|
|
40
|
-
${t=>{let n;const r="rgba(255,255,255,0.001)",a=i.Colour.bg(t);return n="left"===t.$position?`\n\t\t\t\tleft: -8px;\n\t\t\t\tbackground-image: linear-gradient(\n\t\t\t\t\tto right, \n\t\t\t\t\t${t.$backgroundColor||a}, \n\t\t\t\t\t${r}\n\t\t\t\t);\n\t\t\t`:`\n\t\t\t\tright: 8px;\n\t\t\t\tbackground-image: linear-gradient(\n\t\t\t\t\tto left,\n\t\t\t\t\t${t.$backgroundColor||a},\n\t\t\t\t\t${r}\n\t\t\t\t);\n\t\t\t`,e.css`
|
|
41
|
-
${i.MediaQuery.MaxWidth.lg} {
|
|
42
|
-
${n}
|
|
43
|
-
}
|
|
44
|
-
`}};
|
|
45
|
-
`,s=a.default.li`
|
|
29
|
+
`,s=p.default.li`
|
|
46
30
|
display: flex;
|
|
47
31
|
flex-direction: row;
|
|
48
32
|
align-items: center;
|
|
49
33
|
line-height: inherit;
|
|
50
34
|
font-size: inherit;
|
|
51
|
-
${
|
|
52
|
-
`,
|
|
35
|
+
${e=>e.$styleProps||""};
|
|
36
|
+
`,d=p.default(e.ChevronRightIcon)`
|
|
53
37
|
height: 1em;
|
|
54
38
|
width: 1em;
|
|
55
39
|
color: ${i.Colour["icon-subtle"]};
|
|
56
|
-
`,
|
|
40
|
+
`,g=p.default(r.Typography.BodyMD)`
|
|
57
41
|
display: inline-block;
|
|
58
42
|
color: ${i.Colour["text-subtlest"]};
|
|
59
|
-
`,c=
|
|
43
|
+
`,c=p.default(r.Typography.BodyMD)`
|
|
60
44
|
margin: ${i.Spacing["spacing-8"]} !important;
|
|
61
|
-
`,
|
|
45
|
+
`,h=p.default(r.Typography.LinkMD)`
|
|
62
46
|
margin: ${i.Spacing["spacing-8"]} !important;
|
|
63
|
-
`;exports.Caret=
|
|
47
|
+
`;exports.Caret=d,exports.Content=l,exports.CurrentLabel=c,exports.Item=s,exports.PreviousLink=h,exports.Slash=g,exports.Wrapper=o;
|
|
64
48
|
//# sourceMappingURL=breadcrumb.style.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"breadcrumb.style.js","sources":["../../../src/breadcrumb/breadcrumb.style.tsx"],"sourcesContent":["import { ChevronRightIcon } from \"@lifesg/react-icons/chevron-right\";\nimport styled
|
|
1
|
+
{"version":3,"file":"breadcrumb.style.js","sources":["../../../src/breadcrumb/breadcrumb.style.tsx"],"sourcesContent":["import { ChevronRightIcon } from \"@lifesg/react-icons/chevron-right\";\nimport styled from \"styled-components\";\nimport { Colour, Font, MediaQuery, Spacing } from \"../theme\";\nimport { Typography } from \"../typography/typography\";\nimport { FadeWrapper } from \"../shared/fade-wrapper\";\n\n// =============================================================================\n// STYLE TYPES, transient props are denoted with $\n// See more https://styled-components.com/docs/api#transient-props\n// =============================================================================\ninterface ItemStyleProps {\n $styleProps?: string;\n}\n\n// =============================================================================\n// STYLE COMPONENTS\n// =============================================================================\nexport const Wrapper = styled(FadeWrapper)`\n z-index: 1;\n margin: ${Spacing[\"spacing-32\"]} 0;\n\n ${MediaQuery.MaxWidth.xl} {\n margin: ${Spacing[\"spacing-24\"]} 0;\n }\n\n ${MediaQuery.MaxWidth.lg} {\n margin: ${Spacing[\"spacing-16\"]} 0;\n }\n\n [data-id=\"left-fade\"],\n [data-id=\"right-fade\"] {\n height: calc(1lh + ${Spacing[\"spacing-4\"]});\n top: 50%;\n transform: translateY(-50%);\n }\n`;\n\nexport const Content = styled.ul`\n display: inline-flex;\n width: 100%;\n flex-wrap: wrap;\n white-space: nowrap;\n margin-left: -${Spacing[\"spacing-8\"]};\n font-size: ${Font.Spec[\"body-size-md\"]};\n ${MediaQuery.MaxWidth.lg} {\n flex-wrap: nowrap;\n }\n`;\n\nexport const Item = styled.li<ItemStyleProps>`\n display: flex;\n flex-direction: row;\n align-items: center;\n line-height: inherit;\n font-size: inherit;\n ${(props) => {\n return props.$styleProps || ``;\n }};\n`;\n\nexport const Caret = styled(ChevronRightIcon)`\n height: 1em;\n width: 1em;\n color: ${Colour[\"icon-subtle\"]};\n`;\n\nexport const Slash = styled(Typography.BodyMD)`\n display: inline-block;\n color: ${Colour[\"text-subtlest\"]};\n`;\n\nexport const CurrentLabel = styled(Typography.BodyMD)`\n margin: ${Spacing[\"spacing-8\"]} !important;\n`;\n\nexport const PreviousLink = styled(Typography.LinkMD)`\n margin: ${Spacing[\"spacing-8\"]} !important;\n`;\n"],"names":["Wrapper","styled","FadeWrapper","Spacing","MediaQuery","MaxWidth","xl","lg","Content","ul","Font","Spec","Item","li","props","$styleProps","Caret","ChevronRightIcon","Colour","Slash","Typography","BodyMD","CurrentLabel","PreviousLink","LinkMD"],"mappings":"oTAiBaA,EAAUC,EAAAA,QAAOC,EAAAA,YAAY;;cAE5BC,EAAAA,QAAQ;;MAEhBC,EAAAA,WAAWC,SAASC;kBACRH,EAAAA,QAAQ;;;MAGpBC,EAAAA,WAAWC,SAASE;kBACRJ,EAAAA,QAAQ;;;;;6BAKGA,EAAAA,QAAQ;;;;EAMxBK,EAAUP,EAAAA,QAAOQ,EAAE;;;;;oBAKZN,EAAAA,QAAQ;iBACXO,EAAAA,KAAKC,KAAK;MACrBP,EAAAA,WAAWC,SAASE;;;EAKbK,EAAOX,EAAAA,QAAOY,EAAkB;;;;;;MAMtCC,GACQA,EAAMC,aAAe;EAIvBC,EAAQf,EAAAA,QAAOgB,EAAAA,iBAAiB;;;aAGhCC,EAAAA,OAAO;EAGPC,EAAQlB,EAAAA,QAAOmB,aAAWC,OAAO;;aAEjCH,EAAAA,OAAO;EAGPI,EAAerB,EAAAA,QAAOmB,aAAWC,OAAO;cACvClB,EAAAA,QAAQ;EAGToB,EAAetB,EAAAA,QAAOmB,aAAWI,OAAO;cACvCrB,EAAAA,QAAQ;"}
|
package/cjs/drawer/drawer.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("../_virtual/_tslib.js"),r=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";var e=require("../_virtual/_tslib.js"),r=require("react/jsx-runtime"),t=require("@floating-ui/react"),i=require("@lifesg/react-icons/cross"),s=require("react"),a=require("../external/react-resize-detector/build/index.esm.js"),o=require("styled-components"),n=require("../overlay/overlay.js"),l=require("../theme/index.js");require("../util/calendar-helper.js"),require("../util/date-helper.js"),require("../util/date-input-helper.js");var u=require("../util/simple-id-generator.js");require("../util/string-helper.js"),require("@react-aria/live-announcer");var c=require("./drawer.styles.js");exports.Drawer=d=>{var{children:h,heading:f,show:g,onClose:j,onOverlayClick:v,customCallToAction:x}=d,p=e.__rest(d,["children","heading","show","onClose","onOverlayClick","customCallToAction"]);const[C,m]=s.useState(g),[q,y]=s.useState(),w=u.useId(),b=s.useContext(o.ThemeContext),k=l.Breakpoint["sm-max"]({theme:b}),T=s.useRef(null),{width:F,ref:O}=a.useResizeDetector({refreshMode:"throttle",refreshRate:300,onResize:()=>{const e=T.current;e&&y(e.offsetTop+e.offsetHeight/2)}}),A=void 0!==F&&F<=k,{context:H,refs:I}=t.useFloating({open:g,onOpenChange:e=>{!e&&j&&j()}}),R=t.useDismiss(H,{escapeKey:!0,outsidePress:!1}),{getFloatingProps:_}=t.useInteractions([R]),{isMounted:z,status:D}=t.useTransitionStatus(H,{duration:800});s.useEffect((()=>{if(!g){const e=setTimeout((()=>m(!1)),800);return()=>clearTimeout(e)}m(!0)}),[g]);return r.jsx(n.Overlay,{show:C,enableOverlayClick:!0,onOverlayClick:v,children:z?r.jsx(t.FloatingFocusManager,{context:H,initialFocus:-1,returnFocus:!0,children:r.jsxs(c.Container,Object.assign({ref:I.setFloating,$show:g,"data-status":D,"data-testid":"drawer",onClick:e=>{e.stopPropagation()},"aria-modal":!0,role:"dialog","aria-labelledby":w,onTransitionEnd:e=>{var r;"visibility"===e.propertyName&&g&&(null===(r=T.current)||void 0===r||r.focus())}},_(),p,{children:[r.jsxs(c.Header,{ref:O,$stacked:!!x&&A,children:[r.jsx(c.Heading,{id:w,ref:T,tabIndex:-1,weight:"bold",forwardedAs:"h2",children:f}),x?r.jsx(c.CallToAction,{$stacked:A,children:x}):null]}),r.jsx(c.Content,{children:h}),r.jsx(c.CloseButton,{"aria-label":"Close drawer",onClick:j,focusHighlight:!1,style:void 0!==q?{top:q,transform:"translateY(-50%)"}:void 0,children:r.jsx(i.CrossIcon,{"aria-hidden":!0})})]}))}):void 0})};
|
|
2
2
|
//# sourceMappingURL=drawer.js.map
|
package/cjs/drawer/drawer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drawer.js","sources":["../../../src/drawer/drawer.tsx"],"sourcesContent":["import {\n FloatingFocusManager,\n useDismiss,\n useFloating,\n useInteractions,\n useTransitionStatus,\n} from \"@floating-ui/react\";\nimport { CrossIcon } from \"@lifesg/react-icons/cross\";\nimport { useEffect, useRef, useState } from \"react\";\nimport { Overlay } from \"../overlay\";\nimport { useId } from \"../util\";\nimport {\n CloseButton,\n Container,\n Content,\n Header,\n Heading,\n} from \"./drawer.styles\";\nimport { DrawerProps } from \"./types\";\n\nexport const Drawer = ({\n children,\n heading,\n show,\n onClose,\n onOverlayClick,\n ...otherProps\n}: DrawerProps) => {\n // =========================================================================\n // CONST, STATE, REFS\n // =========================================================================\n const [showOverlay, setShowOverlay] = useState(show);\n const id = useId();\n const initialFocusRef = useRef<HTMLHeadingElement>(null);\n\n // =========================================================================\n // FLOATING UI CONFIG\n // =========================================================================\n const { context, refs } = useFloating({\n open: show,\n onOpenChange: (open) => {\n if (!open && onClose) {\n onClose();\n }\n },\n });\n\n const dismiss = useDismiss(context, {\n escapeKey: true,\n outsidePress: false, // defer to Overlay click\n });\n\n const { getFloatingProps } = useInteractions([dismiss]);\n\n const { isMounted, status } = useTransitionStatus(context, {\n duration: 800,\n });\n\n // =========================================================================\n // EFFECTS\n // =========================================================================\n useEffect(() => {\n if (!show) {\n const timer = setTimeout(() => setShowOverlay(false), 800);\n return () => clearTimeout(timer);\n } else {\n setShowOverlay(true);\n }\n }, [show]);\n\n // =========================================================================\n // EVENT HANDLERS\n // =========================================================================\n const handleDialogVisibility = (e: React.TransitionEvent) => {\n if (e.propertyName === \"visibility\" && show) {\n // focus the first element so that the screenreader enters the dialog\n initialFocusRef.current?.focus();\n }\n };\n\n const handleClick = (event: React.MouseEvent) => {\n event.stopPropagation();\n };\n\n // =========================================================================\n // RENDER FUNCTIONS\n // =========================================================================\n return (\n <Overlay\n show={showOverlay}\n enableOverlayClick\n onOverlayClick={onOverlayClick}\n >\n {isMounted ? (\n <FloatingFocusManager\n context={context}\n initialFocus={-1}\n returnFocus={true}\n >\n <Container\n ref={refs.setFloating}\n $show={show}\n data-status={status}\n data-testid=\"drawer\"\n onClick={handleClick}\n aria-modal\n role=\"dialog\"\n aria-labelledby={id}\n onTransitionEnd={handleDialogVisibility}\n {...getFloatingProps()}\n {...otherProps}\n >\n <Header>\n <Heading\n id={id}\n ref={initialFocusRef}\n tabIndex={-1}\n weight=\"bold\"\n forwardedAs=\"h2\"\n >\n {heading}\n </Heading>\n </Header>\n <Content>{children}</Content>\n <CloseButton\n aria-label=\"Close drawer\"\n onClick={onClose}\n focusHighlight={false}\n >\n <CrossIcon aria-hidden />\n </CloseButton>\n </Container>\n </FloatingFocusManager>\n ) : undefined}\n </Overlay>\n );\n};\n"],"names":["_a","children","heading","show","onClose","onOverlayClick","otherProps","__rest","showOverlay","setShowOverlay","useState","id","useId","initialFocusRef","useRef","context","refs","useFloating","open","onOpenChange","dismiss","useDismiss","escapeKey","outsidePress","getFloatingProps","useInteractions","isMounted","status","useTransitionStatus","duration","useEffect","timer","setTimeout","clearTimeout","_jsx","Overlay","enableOverlayClick","FloatingFocusManager","initialFocus","returnFocus","_jsxs","Container","Object","assign","ref","setFloating","$show","onClick","event","stopPropagation","role","onTransitionEnd","e","propertyName","current","focus","Header","Heading","tabIndex","weight","forwardedAs","Content","CloseButton","focusHighlight","CrossIcon","undefined"],"mappings":"6eAoBuBA,IAAA,IAAAC,SACnBA,EAAQC,QACRA,EAAOC,KACPA,EAAIC,QACJA,EAAOC,eACPA,GAAcL,EACXM,EAAUC,EAAAA,OAAAP,EANM,0DAWnB,MAAOQ,EAAaC,GAAkBC,EAAAA,SAASP,GACzCQ,EAAKC,EAAAA,QACLC,EAAkBC,EAAAA,OAA2B,OAK7CC,QAAEA,EAAOC,KAAEA,GAASC,cAAY,CAClCC,KAAMf,EACNgB,aAAeD,KACNA,GAAQd,GACTA,GACJ,IAIFgB,EAAUC,EAAAA,WAAWN,EAAS,CAChCO,WAAW,EACXC,cAAc,KAGZC,iBAAEA,GAAqBC,kBAAgB,CAACL,KAExCM,UAAEA,EAASC,OAAEA,GAAWC,EAAAA,oBAAoBb,EAAS,CACvDc,SAAU,MAMdC,EAAAA,WAAU,KACN,IAAK3B,EAAM,CACP,MAAM4B,EAAQC,YAAW,IAAMvB,GAAe,IAAQ,KACtD,MAAO,IAAMwB,aAAaF,EAC9B,CACItB,GAAe,EACnB,GACD,CAACN,IAmBJ,OACI+B,MAACC,EAAAA,QAAO,CACJhC,KAAMK,EACN4B,oBAAkB,EAClB/B,eAAgBA,EAAcJ,SAE7ByB,EACGQ,MAACG,EAAAA,qBAAoB,CACjBtB,QAASA,EACTuB,cAAc,EACdC,aAAa,EAAItC,SAEjBuC,EAAAA,KAACC,YAASC,OAAAC,OAAA,CACNC,IAAK5B,EAAK6B,YAAWC,MACd3C,EAAI,cACEwB,EAAM,cACP,SACZoB,QAxBCC,IACjBA,EAAMC,iBAAiB,EAuBa,cAAA,EAEpBC,KAAK,SAAQ,kBACIvC,EACjBwC,gBAnCYC,UACL,eAAnBA,EAAEC,cAAiClD,IAEZ,QAAvBH,EAAAa,EAAgByC,eAAO,IAAAtD,GAAAA,EAAEuD,QAC7B,GAgCoB/B,IACAlB,EAAU,CAAAL,SAAA,CAEdiC,EAAAA,IAACsB,SAAM,CAAAvD,SACHiC,EAAAA,IAACuB,EAAAA,QAAO,CACJ9C,GAAIA,EACJiC,IAAK/B,EACL6C,UAAU,EACVC,OAAO,OACPC,YAAY,KAAI3D,SAEfC,MAGTgC,EAAAA,IAAC2B,EAAAA,QAAO,CAAA5D,SAAEA,IACViC,EAAAA,IAAC4B,cAAW,CAAA,aACG,eACXf,QAAS3C,EACT2D,gBAAgB,EAAK9D,SAErBiC,EAAAA,IAAC8B,EAAAA,UAAS,CAAA,eAAA,iBAItBC,GACE"}
|
|
1
|
+
{"version":3,"file":"drawer.js","sources":["../../../src/drawer/drawer.tsx"],"sourcesContent":["import {\n FloatingFocusManager,\n useDismiss,\n useFloating,\n useInteractions,\n useTransitionStatus,\n} from \"@floating-ui/react\";\nimport { CrossIcon } from \"@lifesg/react-icons/cross\";\nimport { useContext, useEffect, useRef, useState } from \"react\";\nimport { useResizeDetector } from \"react-resize-detector\";\nimport { ThemeContext } from \"styled-components\";\nimport { Overlay } from \"../overlay\";\nimport { Breakpoint } from \"../theme\";\nimport { useId } from \"../util\";\nimport {\n CallToAction,\n CloseButton,\n Container,\n Content,\n Header,\n Heading,\n} from \"./drawer.styles\";\nimport { DrawerProps } from \"./types\";\n\nexport const Drawer = ({\n children,\n heading,\n show,\n onClose,\n onOverlayClick,\n customCallToAction,\n ...otherProps\n}: DrawerProps) => {\n // =========================================================================\n // CONST, STATE, REFS\n // =========================================================================\n const [showOverlay, setShowOverlay] = useState(show);\n // Vertical centre of the heading, used to align the (last-in-DOM,\n // absolutely positioned) close button with it. A custom call-to-action can\n // make the header taller than the heading, so a fixed offset would leave\n // the close button misaligned.\n const [closeButtonTop, setCloseButtonTop] = useState<number>();\n const id = useId();\n const theme = useContext(ThemeContext);\n const stackWidth = Breakpoint[\"sm-max\"]({ theme });\n const initialFocusRef = useRef<HTMLHeadingElement>(null);\n // Observe the header (whose size tracks the drawer's actual width, which\n // consumers may override) to drive layout in one pass: the width decides\n // call-to-action stacking, and each resize re-centres the close button on\n // the heading. offsetTop/offsetHeight are relative to the drawer (the\n // positioned ancestor), so they share the close button's coordinate space.\n const { width: headerWidth, ref: headerRef } =\n useResizeDetector<HTMLDivElement>({\n refreshMode: \"throttle\",\n refreshRate: 300,\n onResize: () => {\n const headingEl = initialFocusRef.current;\n if (headingEl) {\n setCloseButtonTop(\n headingEl.offsetTop + headingEl.offsetHeight / 2\n );\n }\n },\n });\n const stackCallToAction =\n headerWidth !== undefined && headerWidth <= stackWidth;\n\n // =========================================================================\n // FLOATING UI CONFIG\n // =========================================================================\n const { context, refs } = useFloating({\n open: show,\n onOpenChange: (open) => {\n if (!open && onClose) {\n onClose();\n }\n },\n });\n\n const dismiss = useDismiss(context, {\n escapeKey: true,\n outsidePress: false, // defer to Overlay click\n });\n\n const { getFloatingProps } = useInteractions([dismiss]);\n\n const { isMounted, status } = useTransitionStatus(context, {\n duration: 800,\n });\n\n // =========================================================================\n // EFFECTS\n // =========================================================================\n useEffect(() => {\n if (!show) {\n const timer = setTimeout(() => setShowOverlay(false), 800);\n return () => clearTimeout(timer);\n } else {\n setShowOverlay(true);\n }\n }, [show]);\n\n // =========================================================================\n // EVENT HANDLERS\n // =========================================================================\n const handleDialogVisibility = (e: React.TransitionEvent) => {\n if (e.propertyName === \"visibility\" && show) {\n // focus the first element so that the screenreader enters the dialog\n initialFocusRef.current?.focus();\n }\n };\n\n const handleClick = (event: React.MouseEvent) => {\n event.stopPropagation();\n };\n\n // =========================================================================\n // RENDER FUNCTIONS\n // =========================================================================\n return (\n <Overlay\n show={showOverlay}\n enableOverlayClick\n onOverlayClick={onOverlayClick}\n >\n {isMounted ? (\n <FloatingFocusManager\n context={context}\n initialFocus={-1}\n returnFocus={true}\n >\n <Container\n ref={refs.setFloating}\n $show={show}\n data-status={status}\n data-testid=\"drawer\"\n onClick={handleClick}\n aria-modal\n role=\"dialog\"\n aria-labelledby={id}\n onTransitionEnd={handleDialogVisibility}\n {...getFloatingProps()}\n {...otherProps}\n >\n <Header\n ref={headerRef}\n $stacked={!!customCallToAction && stackCallToAction}\n >\n <Heading\n id={id}\n ref={initialFocusRef}\n tabIndex={-1}\n weight=\"bold\"\n forwardedAs=\"h2\"\n >\n {heading}\n </Heading>\n {customCallToAction ? (\n <CallToAction $stacked={stackCallToAction}>\n {customCallToAction}\n </CallToAction>\n ) : null}\n </Header>\n <Content>{children}</Content>\n {/* Rendered last so assistive tech reaches the heading\n and content before the close button; centred against\n the heading via its measured position. */}\n <CloseButton\n aria-label=\"Close drawer\"\n onClick={onClose}\n focusHighlight={false}\n style={\n closeButtonTop !== undefined\n ? {\n top: closeButtonTop,\n transform: \"translateY(-50%)\",\n }\n : undefined\n }\n >\n <CrossIcon aria-hidden />\n </CloseButton>\n </Container>\n </FloatingFocusManager>\n ) : undefined}\n </Overlay>\n );\n};\n"],"names":["_a","children","heading","show","onClose","onOverlayClick","customCallToAction","otherProps","__rest","showOverlay","setShowOverlay","useState","closeButtonTop","setCloseButtonTop","id","useId","theme","useContext","ThemeContext","stackWidth","Breakpoint","initialFocusRef","useRef","width","headerWidth","ref","headerRef","useResizeDetector","refreshMode","refreshRate","onResize","headingEl","current","offsetTop","offsetHeight","stackCallToAction","undefined","context","refs","useFloating","open","onOpenChange","dismiss","useDismiss","escapeKey","outsidePress","getFloatingProps","useInteractions","isMounted","status","useTransitionStatus","duration","useEffect","timer","setTimeout","clearTimeout","_jsx","Overlay","enableOverlayClick","FloatingFocusManager","initialFocus","returnFocus","_jsxs","Container","Object","assign","setFloating","$show","onClick","event","stopPropagation","role","onTransitionEnd","e","propertyName","focus","Header","$stacked","Heading","tabIndex","weight","forwardedAs","CallToAction","Content","CloseButton","focusHighlight","style","top","transform","CrossIcon"],"mappings":"6mBAwBuBA,IAAA,IAAAC,SACnBA,EAAQC,QACRA,EAAOC,KACPA,EAAIC,QACJA,EAAOC,eACPA,EAAcC,mBACdA,GAAkBN,EACfO,EAAUC,EAAAA,OAAAR,EAPM,+EAYnB,MAAOS,EAAaC,GAAkBC,EAAAA,SAASR,IAKxCS,EAAgBC,GAAqBF,aACtCG,EAAKC,EAAAA,QACLC,EAAQC,EAAAA,WAAWC,gBACnBC,EAAaC,EAAAA,WAAW,UAAU,CAAEJ,UACpCK,EAAkBC,EAAAA,OAA2B,OAM3CC,MAAOC,EAAaC,IAAKC,GAC7BC,EAAAA,kBAAkC,CAC9BC,YAAa,WACbC,YAAa,IACbC,SAAU,KACN,MAAMC,EAAYV,EAAgBW,QAC9BD,GACAlB,EACIkB,EAAUE,UAAYF,EAAUG,aAAe,EAEvD,IAGNC,OACcC,IAAhBZ,GAA6BA,GAAeL,GAK1CkB,QAAEA,EAAOC,KAAEA,GAASC,cAAY,CAClCC,KAAMrC,EACNsC,aAAeD,KACNA,GAAQpC,GACTA,GACJ,IAIFsC,EAAUC,EAAAA,WAAWN,EAAS,CAChCO,WAAW,EACXC,cAAc,KAGZC,iBAAEA,GAAqBC,kBAAgB,CAACL,KAExCM,UAAEA,EAASC,OAAEA,GAAWC,EAAAA,oBAAoBb,EAAS,CACvDc,SAAU,MAMdC,EAAAA,WAAU,KACN,IAAKjD,EAAM,CACP,MAAMkD,EAAQC,YAAW,IAAM5C,GAAe,IAAQ,KACtD,MAAO,IAAM6C,aAAaF,EAC9B,CACI3C,GAAe,EACnB,GACD,CAACP,IAmBJ,OACIqD,MAACC,EAAAA,QAAO,CACJtD,KAAMM,EACNiD,sBACArD,eAAgBA,EAAcJ,SAE7B+C,EACGQ,EAAAA,IAACG,EAAAA,qBAAoB,CACjBtB,QAASA,EACTuB,cAAc,EACdC,aAAa,EAAI5D,SAEjB6D,EAAAA,KAACC,EAAAA,UAASC,OAAAC,OAAA,CACNxC,IAAKa,EAAK4B,YAAWC,MACdhE,EAAI,cACE8C,gBACD,SACZmB,QAxBCC,IACjBA,EAAMC,iBAAiB,EAuBa,cAAA,EAEpBC,KAAK,2BACYzD,EACjB0D,gBAnCYC,UACL,eAAnBA,EAAEC,cAAiCvE,IAEZ,QAAvBH,EAAAqB,EAAgBW,eAAO,IAAAhC,GAAAA,EAAE2E,QAC7B,GAgCoB7B,IACAvC,EAAU,CAAAN,SAAA,CAEd6D,EAAAA,KAACc,EAAAA,OAAM,CACHnD,IAAKC,EAASmD,WACFvE,GAAsB6B,YAElCqB,EAAAA,IAACsB,EAAAA,QAAO,CACJhE,GAAIA,EACJW,IAAKJ,EACL0D,UAAU,EACVC,OAAO,OACPC,YAAY,KAAIhF,SAEfC,IAEJI,EACGkD,EAAAA,IAAC0B,EAAAA,aAAY,CAAAL,SAAW1C,EAAiBlC,SACpCK,IAEL,QAERkD,MAAC2B,EAAAA,kBAASlF,IAIVuD,EAAAA,IAAC4B,cAAW,CAAA,aACG,eACXhB,QAAShE,EACTiF,gBAAgB,EAChBC,WACuBlD,IAAnBxB,EACM,CACI2E,IAAK3E,EACL4E,UAAW,yBAEfpD,EAASnC,SAGnBuD,EAAAA,IAACiC,EAAAA,2CAIbrD,GACE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var i=require("styled-components"),t=require("../shared/clickable-icon/clickable-icon.js"),
|
|
1
|
+
"use strict";var i=require("styled-components"),t=require("../shared/clickable-icon/clickable-icon.js"),e=require("../theme/index.js"),o=require("../typography/typography.js");function a(i){return i&&"object"==typeof i&&"default"in i?i:{default:i}}var n=a(i);const d=i.css`
|
|
2
2
|
transition-property: right, visibility;
|
|
3
3
|
|
|
4
4
|
&[data-status="initial"] {
|
|
@@ -7,15 +7,15 @@
|
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
&[data-status="open"] {
|
|
10
|
-
transition-duration: ${
|
|
11
|
-
transition-timing-function: ${
|
|
10
|
+
transition-duration: ${e.Motion["duration-800"]};
|
|
11
|
+
transition-timing-function: ${e.Motion["ease-entrance"]};
|
|
12
12
|
right: 0;
|
|
13
13
|
visibility: visible;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
&[data-status="close"] {
|
|
17
|
-
transition-duration: ${
|
|
18
|
-
transition-timing-function: ${
|
|
17
|
+
transition-duration: ${e.Motion["duration-800"]};
|
|
18
|
+
transition-timing-function: ${e.Motion["ease-exit"]};
|
|
19
19
|
right: -100%;
|
|
20
20
|
visibility: hidden;
|
|
21
21
|
}
|
|
@@ -27,22 +27,22 @@
|
|
|
27
27
|
flex-direction: column;
|
|
28
28
|
height: 100%;
|
|
29
29
|
|
|
30
|
-
background-color: ${
|
|
31
|
-
box-shadow: ${
|
|
30
|
+
background-color: ${e.Colour.bg};
|
|
31
|
+
box-shadow: ${e.Shadow["lg-subtle"]};
|
|
32
32
|
|
|
33
33
|
${d}
|
|
34
34
|
|
|
35
35
|
width: 40%;
|
|
36
|
-
border-top-left-radius: ${
|
|
37
|
-
border-bottom-left-radius: ${
|
|
36
|
+
border-top-left-radius: ${e.Radius.md};
|
|
37
|
+
border-bottom-left-radius: ${e.Radius.md};
|
|
38
38
|
overflow: hidden;
|
|
39
39
|
|
|
40
|
-
${
|
|
40
|
+
${e.MediaQuery.MaxWidth.xl} {
|
|
41
41
|
width: 50%;
|
|
42
42
|
min-width: 700px;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
${
|
|
45
|
+
${e.MediaQuery.MaxWidth.lg} {
|
|
46
46
|
width: 100%;
|
|
47
47
|
min-width: unset;
|
|
48
48
|
border-top-left-radius: 0;
|
|
@@ -52,40 +52,57 @@
|
|
|
52
52
|
top: 0;
|
|
53
53
|
display: flex;
|
|
54
54
|
align-items: center;
|
|
55
|
-
gap: ${
|
|
56
|
-
padding: ${
|
|
57
|
-
${
|
|
58
|
-
calc(${
|
|
59
|
-
background-color: ${
|
|
60
|
-
border-bottom: ${
|
|
55
|
+
gap: ${e.Spacing["spacing-16"]};
|
|
56
|
+
padding: ${e.Spacing["spacing-32"]} ${e.Spacing["spacing-16"]}
|
|
57
|
+
${e.Spacing["spacing-16"]}
|
|
58
|
+
calc(${e.Font.Spec["heading-lh-md"]} + ${e.Spacing["spacing-32"]});
|
|
59
|
+
background-color: ${e.Colour.bg};
|
|
60
|
+
border-bottom: ${e.Border["width-010"]} ${e.Border.solid} ${e.Colour.border};
|
|
61
61
|
|
|
62
|
-
${
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
62
|
+
${t=>t.$stacked&&i.css`
|
|
63
|
+
/* Stack the call-to-action below the heading when the drawer is too
|
|
64
|
+
narrow to fit both on one line. */
|
|
65
|
+
flex-direction: column;
|
|
66
|
+
align-items: stretch;
|
|
67
|
+
gap: ${e.Spacing["spacing-16"]};
|
|
68
|
+
`}
|
|
69
|
+
|
|
70
|
+
${e.MediaQuery.MaxWidth.lg} {
|
|
71
|
+
padding: ${e.Spacing["spacing-32"]} ${e.Spacing["spacing-20"]}
|
|
72
|
+
${e.Spacing["spacing-16"]}
|
|
73
|
+
calc(${e.Font.Spec["heading-lh-md"]} + ${e.Spacing["spacing-24"]});
|
|
67
74
|
}
|
|
75
|
+
`,l=n.default.div`
|
|
76
|
+
display: flex;
|
|
77
|
+
/* Flush right, beside the heading. */
|
|
78
|
+
margin-left: auto;
|
|
79
|
+
|
|
80
|
+
${t=>t.$stacked&&i.css`
|
|
81
|
+
/* When stacked, flush left so the buttons line up with the heading
|
|
82
|
+
(the header's left padding already clears the close icon). */
|
|
83
|
+
margin-left: 0;
|
|
84
|
+
`}
|
|
68
85
|
`,c=n.default(t.ClickableIcon)`
|
|
69
|
-
color: ${
|
|
86
|
+
color: ${e.Colour.icon};
|
|
70
87
|
padding: 0;
|
|
71
88
|
position: absolute;
|
|
72
|
-
top: ${
|
|
73
|
-
left: ${
|
|
89
|
+
top: ${e.Spacing["spacing-32"]};
|
|
90
|
+
left: ${e.Spacing["spacing-16"]};
|
|
74
91
|
&:active,
|
|
75
92
|
&:focus {
|
|
76
|
-
color: ${
|
|
93
|
+
color: ${e.Colour["icon-hover"]};
|
|
77
94
|
}
|
|
78
95
|
|
|
79
96
|
svg {
|
|
80
|
-
height: ${
|
|
81
|
-
width: ${
|
|
97
|
+
height: ${e.Font.Spec["heading-lh-md"]};
|
|
98
|
+
width: ${e.Font.Spec["heading-lh-md"]};
|
|
82
99
|
}
|
|
83
|
-
`,
|
|
100
|
+
`,p=n.default(o.Typography.HeadingMD)`
|
|
84
101
|
text-overflow: ellipsis;
|
|
85
102
|
overflow: hidden;
|
|
86
103
|
white-space: nowrap;
|
|
87
|
-
`,
|
|
104
|
+
`,g=n.default.div`
|
|
88
105
|
flex: 1;
|
|
89
106
|
overflow-y: auto;
|
|
90
|
-
`;exports.CloseButton=c,exports.Container=r,exports.Content=
|
|
107
|
+
`;exports.CallToAction=l,exports.CloseButton=c,exports.Container=r,exports.Content=g,exports.Header=s,exports.Heading=p;
|
|
91
108
|
//# sourceMappingURL=drawer.styles.js.map
|