@lifesg/react-design-system 1.0.0-alpha.4 → 1.0.0-alpha.5
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/accordion/index.css +1 -0
- package/accordion/index.js +70 -73
- package/accordion/index.js.map +1 -1
- package/alert/index.css +1 -0
- package/alert/index.js +48 -51
- package/alert/index.js.map +1 -1
- package/animations/index.css +1 -0
- package/box-container/index.css +1 -0
- package/box-container/index.js +58 -61
- package/box-container/index.js.map +1 -1
- package/breadcrumb/index.css +1 -0
- package/breadcrumb/index.js +52 -55
- package/breadcrumb/index.js.map +1 -1
- package/button/index.css +1 -0
- package/button/index.js +48 -51
- package/button/index.js.map +1 -1
- package/checkbox/index.css +1 -0
- package/checkbox/index.js +5 -8
- package/checkbox/index.js.map +1 -1
- package/cjs/index.css +1 -0
- package/cjs/index.js +675 -81
- package/cjs/index.js.map +1 -1
- package/color/index.css +1 -0
- package/color/index.js.map +1 -1
- package/date-input/index.css +1 -0
- package/date-input/index.js +53 -68
- package/date-input/index.js.map +1 -1
- package/footer/footer-download-app.d.ts +2 -0
- package/footer/footer-download-app.style.d.ts +6 -0
- package/footer/footer-helper.d.ts +12 -0
- package/footer/footer.d.ts +3 -0
- package/footer/footer.style.d.ts +12 -0
- package/footer/index.css +1 -0
- package/footer/index.d.ts +2 -0
- package/footer/index.js +361 -0
- package/footer/index.js.map +1 -0
- package/footer/package.json +7 -0
- package/footer/types.d.ts +31 -0
- package/form/form-label.d.ts +1 -1
- package/form/form-label.style.d.ts +1 -0
- package/form/index.css +1 -0
- package/form/index.d.ts +1 -1
- package/form/index.js +194 -191
- package/form/index.js.map +1 -1
- package/form/types.d.ts +2 -0
- package/icon/cross-icon.d.ts +3 -0
- package/icon/index.css +1 -0
- package/icon/index.js +3 -6
- package/icon/index.js.map +1 -1
- package/icon/play-icon.d.ts +3 -0
- package/icon-button/index.css +1 -0
- package/icon-button/index.js +7 -10
- package/icon-button/index.js.map +1 -1
- package/index.css +1 -0
- package/index.d.ts +5 -0
- package/index.js +676 -82
- package/index.js.map +1 -1
- package/input/index.css +1 -0
- package/input/index.js +15 -3
- package/input/index.js.map +1 -1
- package/input/input.style.d.ts +2 -0
- package/input-group/index.css +1 -0
- package/input-group/index.js +128 -119
- package/input-group/index.js.map +1 -1
- package/input-group/input-group.style.d.ts +1 -0
- package/input-select/index.css +1 -0
- package/input-select/index.js +98 -104
- package/input-select/index.js.map +1 -1
- package/input-textarea/index.css +1 -0
- package/input-textarea/index.js +118 -111
- package/input-textarea/index.js.map +1 -1
- package/input-textarea/textarea-counter.d.ts +2 -1
- package/input-textarea/types.d.ts +1 -0
- package/layout/container.d.ts +3 -0
- package/layout/content.d.ts +3 -0
- package/layout/index.css +1 -0
- package/layout/index.d.ts +7 -0
- package/layout/index.js +51 -0
- package/layout/index.js.map +1 -0
- package/layout/package.json +7 -0
- package/layout/section.d.ts +3 -0
- package/layout/types.d.ts +15 -0
- package/link-list/index.css +1 -0
- package/link-list/index.js +55 -58
- package/link-list/index.js.map +1 -1
- package/masonry/index.css +1 -0
- package/masthead/index.css +1 -0
- package/masthead/index.d.ts +1 -0
- package/masthead/index.js +5 -0
- package/masthead/index.js.map +1 -0
- package/masthead/masthead.d.ts +3 -0
- package/masthead/package.json +7 -0
- package/media/index.css +1 -0
- package/modal/index.css +1 -0
- package/modal/index.js +12 -15
- package/modal/index.js.map +1 -1
- package/navbar/brand.d.ts +10 -0
- package/navbar/brand.styles.d.ts +5 -0
- package/navbar/drawer.d.ts +3 -0
- package/navbar/drawer.styles.d.ts +12 -0
- package/navbar/index.css +1 -0
- package/navbar/index.d.ts +6 -0
- package/navbar/index.js +659 -0
- package/navbar/index.js.map +1 -0
- package/navbar/navbar-action-buttons.d.ts +10 -0
- package/navbar/navbar-action-buttons.styles.d.ts +9 -0
- package/navbar/navbar-items.d.ts +11 -0
- package/navbar/navbar-items.styles.d.ts +10 -0
- package/navbar/navbar.d.ts +3 -0
- package/navbar/navbar.styles.d.ts +14 -0
- package/navbar/package.json +7 -0
- package/navbar/types.d.ts +56 -0
- package/notification-banner/index.css +1 -0
- package/notification-banner/index.d.ts +3 -0
- package/notification-banner/index.js +262 -0
- package/notification-banner/index.js.map +1 -0
- package/notification-banner/notification-banner-hoc.d.ts +3 -0
- package/notification-banner/notification-banner-label.d.ts +3 -0
- package/notification-banner/notification-banner.d.ts +6 -0
- package/notification-banner/notification-banner.styles.d.ts +12 -0
- package/notification-banner/package.json +7 -0
- package/notification-banner/types.d.ts +22 -0
- package/overlay/index.css +1 -0
- package/package.json +1 -1
- package/popover/index.css +1 -0
- package/popover/index.js +55 -58
- package/popover/index.js.map +1 -1
- package/radio-button/index.css +1 -0
- package/radio-button/index.js.map +1 -1
- package/text/index.css +1 -0
- package/text/index.js +25 -28
- package/text/index.js.map +1 -1
- package/text-list/index.css +1 -0
- package/text-list/index.js.map +1 -1
- package/theme/index.css +1 -0
- package/theme/index.js.map +1 -1
- package/theme/types.d.ts +2 -2
- package/timeline/index.css +1 -0
- package/timeline/index.js +52 -55
- package/timeline/index.js.map +1 -1
- package/timepicker/index.css +1 -0
- package/timepicker/index.js +88 -91
- package/timepicker/index.js.map +1 -1
- package/toggle-button/index.css +1 -0
- package/toggle-button/index.js +110 -113
- package/toggle-button/index.js.map +1 -1
- package/tooltip/index.css +1 -0
- package/tooltip/index.js +51 -54
- package/tooltip/index.js.map +1 -1
- package/transition/index.css +1 -0
- package/icon/play-alt-icon.d.ts +0 -3
package/layout/index.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:root{--sgds-masthead-font-family:system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--sgds-masthead-background-color:hsl(0, 0%, 94%);--sgds-masthead-text-color:hsl(0, 0%, 28%);--sgds-masthead-link-color:hsl(220, 100%, 47%);--sgds-masthead-link-hover-color:hsl(220, 100%, 37%);--sgds-masthead-tablet-padding-x:1.25rem;--sgds-masthead-tablet-font-size:0.75rem;--sgds-masthead-crest-color:rgb(239, 51, 32)}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const Layout: {
|
|
3
|
+
Section: import("react").ForwardRefExoticComponent<import("./types").SectionProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
4
|
+
Container: import("react").ForwardRefExoticComponent<import("./types").ContainerProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
5
|
+
Content: import("react").ForwardRefExoticComponent<import("./types").ContentProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
6
|
+
};
|
|
7
|
+
export * from "./types";
|
package/layout/index.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import e from"react";import i,{css as a}from"styled-components";const r={mobileS:320,mobileM:375,mobileL:480,tablet:1199,desktopM:1399,desktopL:1999,desktop4k:3840},d=t=>Object.keys(r).reduce(((e,i)=>{const a=r[i];return e[i]=`@media screen and (${t}: ${a}px)`,e}),{}),n=d("max-width"),o=(d("min-width"),e.forwardRef(((e,i)=>{const{children:a,"data-testid":r="container",type:d="flex",...n}=e;return t(m,{ref:i,"data-testid":r,type:d,...n,children:a})}))),m=i.div`
|
|
2
|
+
flex-grow: 1;
|
|
3
|
+
margin: 0 auto;
|
|
4
|
+
position: relative;
|
|
5
|
+
width: auto;
|
|
6
|
+
|
|
7
|
+
/* Max width restrictions */
|
|
8
|
+
max-width: 1344px;
|
|
9
|
+
|
|
10
|
+
${n.desktopM} {
|
|
11
|
+
max-width: 1152px;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
${n.tablet} {
|
|
15
|
+
max-width: 960px;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
${n.mobileL} {
|
|
19
|
+
width: 100%;
|
|
20
|
+
max-width: unset;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
${t=>"grid"===t.type?a`
|
|
24
|
+
column-gap: 2rem;
|
|
25
|
+
display: grid;
|
|
26
|
+
grid-template-columns: repeat(12, minmax(0, 1fr));
|
|
27
|
+
height: auto;
|
|
28
|
+
|
|
29
|
+
${n.tablet} {
|
|
30
|
+
column-gap: 1.5rem;
|
|
31
|
+
grid-template-columns: repeat(8, minmax(0, 1fr));
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
${n.mobileL} {
|
|
35
|
+
column-gap: 1rem;
|
|
36
|
+
grid-template-columns: repeat(4, minmax(0, 1fr));
|
|
37
|
+
}
|
|
38
|
+
`:a`
|
|
39
|
+
display: flex;
|
|
40
|
+
height: auto;
|
|
41
|
+
`}
|
|
42
|
+
`,l=e.forwardRef(((e,i)=>{const{children:a,"data-testid":r="section",...d}=e;return t(s,{ref:i,"data-testid":r,...d,children:a})})),s=i.section`
|
|
43
|
+
display: block;
|
|
44
|
+
position: relative;
|
|
45
|
+
padding: 0 1.5rem;
|
|
46
|
+
|
|
47
|
+
// Extra enforcement
|
|
48
|
+
padding-left: 1.5rem !important;
|
|
49
|
+
padding-right: 1.5rem !important;
|
|
50
|
+
`,p=e.forwardRef(((e,i)=>{const{children:a,"data-testid":r="content",className:d,type:n="flex",...m}=e;return t(l,{ref:i,"data-testid":r,className:d,...m,children:t(o,{"data-testid":`${r}-container`,type:n,"data-id":"container",children:a})})})),c={Section:l,Container:o,Content:p};export{c as Layout};
|
|
51
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/spec/media-spec.ts","../../src/media/media.ts","../../src/layout/container.tsx","../../src/layout/section.tsx","../../src/layout/content.tsx","../../src/layout/index.ts"],"sourcesContent":["import { MediaWidth } from \"../media/types\";\n\nexport const MediaWidths: MediaWidth = {\n mobileS: 320,\n mobileM: 375,\n mobileL: 480,\n tablet: 1199,\n desktopM: 1399,\n desktopL: 1999,\n desktop4k: 3840,\n};\n","import { MediaWidths as MediaWidthsSpec } from \"../spec/media-spec\";\nimport { MediaType, MediaWidth } from \"./types\";\n\n// =============================================================================\n// HELPER FUNCTION\n// =============================================================================\nconst getMediaQuerySpec = (type: \"max-width\" | \"min-width\") => {\n return Object.keys(MediaWidthsSpec).reduce((accumulator, key) => {\n const mediaWidth = MediaWidthsSpec[key as keyof MediaWidth];\n accumulator[\n key as keyof MediaType\n ] = `@media screen and (${type}: ${mediaWidth}px)`;\n\n return accumulator;\n }, {} as MediaType);\n};\n\n// =============================================================================\n// EXPORTS\n// =============================================================================\nexport const MediaQuery = {\n MaxWidth: getMediaQuerySpec(\"max-width\"),\n MinWidth: getMediaQuerySpec(\"min-width\"),\n};\n\nexport const MediaWidths = MediaWidthsSpec;\n","import React from \"react\";\nimport styled, { css } from \"styled-components\";\nimport { MediaQuery } from \"../media/media\";\nimport { ContainerProps, ContainerType, DivRef } from \"./types\";\n\nconst Component = (props: ContainerProps, ref: DivRef): JSX.Element => {\n const {\n children,\n \"data-testid\": testId = \"container\",\n type = \"flex\",\n ...otherProps\n } = props;\n\n return (\n <StyledContainer\n ref={ref}\n data-testid={testId}\n type={type}\n {...otherProps}\n >\n {children}\n </StyledContainer>\n );\n};\n\n// =============================================================================\n// EXPORT\n// =============================================================================\nexport const Container = React.forwardRef(Component);\n\n// =============================================================================\n// STYLING\n// =============================================================================\ninterface StyleProps {\n type: ContainerType;\n}\n\nconst StyledContainer = styled.div<StyleProps>`\n flex-grow: 1;\n margin: 0 auto;\n position: relative;\n width: auto;\n\n /* Max width restrictions */\n max-width: 1344px;\n\n ${MediaQuery.MaxWidth.desktopM} {\n max-width: 1152px;\n }\n\n ${MediaQuery.MaxWidth.tablet} {\n max-width: 960px;\n }\n\n ${MediaQuery.MaxWidth.mobileL} {\n width: 100%;\n max-width: unset;\n }\n\n ${(props) => {\n switch (props.type) {\n case \"grid\":\n return css`\n column-gap: 2rem;\n display: grid;\n grid-template-columns: repeat(12, minmax(0, 1fr));\n height: auto;\n\n ${MediaQuery.MaxWidth.tablet} {\n column-gap: 1.5rem;\n grid-template-columns: repeat(8, minmax(0, 1fr));\n }\n\n ${MediaQuery.MaxWidth.mobileL} {\n column-gap: 1rem;\n grid-template-columns: repeat(4, minmax(0, 1fr));\n }\n `;\n case \"flex\":\n default:\n return css`\n display: flex;\n height: auto;\n `;\n }\n }}\n`;\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport { DivRef, SectionProps } from \"./types\";\n\nconst Component = (props: SectionProps, ref: DivRef): JSX.Element => {\n const {\n children,\n \"data-testid\": testId = \"section\",\n ...otherProps\n } = props;\n\n return (\n <StyledSection ref={ref} data-testid={testId} {...otherProps}>\n {children}\n </StyledSection>\n );\n};\n\n// =============================================================================\n// EXPORT\n// =============================================================================\nexport const Section = React.forwardRef(Component);\n\n// =============================================================================\n// STYLING\n// =============================================================================\nconst StyledSection = styled.section`\n display: block;\n position: relative;\n padding: 0 1.5rem;\n\n // Extra enforcement\n padding-left: 1.5rem !important;\n padding-right: 1.5rem !important;\n`;\n","import React from \"react\";\nimport { Container } from \"./container\";\nimport { Section } from \"./section\";\nimport { ContentProps, DivRef } from \"./types\";\n\nconst Component = (props: ContentProps, ref: DivRef): JSX.Element => {\n const {\n children,\n \"data-testid\": testId = \"content\",\n className,\n type = \"flex\",\n ...otherProps\n } = props;\n\n return (\n <Section\n ref={ref}\n data-testid={testId}\n className={className}\n {...otherProps}\n >\n <Container\n data-testid={`${testId}-container`}\n type={type}\n data-id=\"container\"\n >\n {children}\n </Container>\n </Section>\n );\n};\n\n// =============================================================================\n// EXPORT\n// =============================================================================\nexport const Content = React.forwardRef(Component);\n","import { Container } from \"./container\";\nimport { Content } from \"./content\";\nimport { Section } from \"./section\";\n\nexport const Layout = {\n Section,\n Container,\n Content,\n};\n\nexport * from \"./types\";\n"],"names":["MediaWidths","mobileS","mobileM","mobileL","tablet","desktopM","desktopL","desktop4k","getMediaQuerySpec","type","Object","keys","MediaWidthsSpec","reduce","accumulator","key","mediaWidth","MediaQuery","Container","React","forwardRef","props","ref","children","testId","otherProps","_jsx","StyledContainer","styled","div","css","Section","StyledSection","section","Content","className","Layout"],"mappings":"wGAEO,MAAMA,EAA0B,CACnCC,QAAS,IACTC,QAAS,IACTC,QAAS,IACTC,OAAQ,KACRC,SAAU,KACVC,SAAU,KACVC,UAAW,MCHTC,EAAqBC,GAChBC,OAAOC,KAAKC,GAAiBC,QAAO,CAACC,EAAaC,KACrD,MAAMC,EAAaJ,EAAgBG,GAKnC,OAJAD,EACIC,GACA,sBAAsBN,MAASO,OAE5BF,IACR,IAMMG,EACCT,EAAkB,aCOnBU,GDNCV,EAAkB,aCMPW,EAAMC,YAvBb,CAACC,EAAuBC,KACtC,MAAMC,SACFA,EACA,cAAeC,EAAS,YAAWf,KACnCA,EAAO,UACJgB,GACHJ,EAEJ,OACIK,EAACC,GACGL,IAAKA,EACQ,cAAAE,EACbf,KAAMA,KACFgB,WAEHF,QAiBPI,EAAkBC,EAAOC,GAAe;;;;;;;;;MASxCZ,EAAoBZ;;;;MAIpBY,EAAoBb;;;;MAIpBa,EAAoBd;;;;;MAKnBkB,GAEU,SADDA,EAAMZ,KAECqB,CAAG;;;;;;sBAMJb,EAAoBb;;;;;sBAKpBa,EAAoBd;;;;kBAOnB2B,CAAG;;;;EC3DbC,EAAUZ,EAAMC,YAjBX,CAACC,EAAqBC,KACpC,MAAMC,SACFA,EACA,cAAeC,EAAS,aACrBC,GACHJ,EAEJ,OACIK,EAACM,EAAa,CAACV,IAAKA,EAAkB,cAAAE,KAAYC,EAAUF,SACvDA,OAaPS,EAAgBJ,EAAOK,OAAO;;;;;;;;ECSvBC,EAAUf,EAAMC,YA9BX,CAACC,EAAqBC,KACpC,MAAMC,SACFA,EACA,cAAeC,EAAS,UAASW,UACjCA,EAAS1B,KACTA,EAAO,UACJgB,GACHJ,EAEJ,OACIK,EAACK,EAAO,CACJT,IAAKA,EACQ,cAAAE,EACbW,UAAWA,KACPV,EAAUF,SAEdG,EAACR,EACgB,CAAA,cAAA,GAAGM,cAChBf,KAAMA,EAAI,UACF,YAEPc,SAAAA,SCtBJa,EAAS,CAClBL,UACAb,YACAgB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface CommonLayoutProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
"data-testid"?: string | undefined;
|
|
5
|
+
}
|
|
6
|
+
export interface SectionProps extends CommonLayoutProps {
|
|
7
|
+
}
|
|
8
|
+
export declare type ContainerType = "flex" | "grid";
|
|
9
|
+
export interface ContainerProps extends CommonLayoutProps {
|
|
10
|
+
/** The type of display style. Values: "flex" | "grid" */
|
|
11
|
+
type?: ContainerType | undefined;
|
|
12
|
+
}
|
|
13
|
+
export interface ContentProps extends ContainerProps {
|
|
14
|
+
}
|
|
15
|
+
export declare type DivRef = React.Ref<HTMLDivElement>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:root{--sgds-masthead-font-family:system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--sgds-masthead-background-color:hsl(0, 0%, 94%);--sgds-masthead-text-color:hsl(0, 0%, 28%);--sgds-masthead-link-color:hsl(220, 100%, 47%);--sgds-masthead-link-hover-color:hsl(220, 100%, 37%);--sgds-masthead-tablet-padding-x:1.25rem;--sgds-masthead-tablet-font-size:0.75rem;--sgds-masthead-crest-color:rgb(239, 51, 32)}
|