@stack-spot/portal-components 0.0.6 → 0.0.8

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.
@@ -0,0 +1,4 @@
1
+ export declare const BannerWarning: ({ children }: {
2
+ children: React.ReactNode;
3
+ }) => import("react/jsx-runtime").JSX.Element;
4
+ //# sourceMappingURL=BannerWarning.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BannerWarning.d.ts","sourceRoot":"","sources":["../src/BannerWarning.tsx"],"names":[],"mappings":"AAIA,eAAO,MAAM,aAAa;cAA8B,MAAM,SAAS;6CAgBtE,CAAA"}
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Flex, IconBox, Text } from '@citric/core';
3
+ import { ExclamationTriangle } from '@citric/icons';
4
+ import { Alert } from '@citric/ui';
5
+ export const BannerWarning = ({ children }) => (_jsx(Flex, { sx: { position: 'fixed', top: 0, zIndex: '999', w: 12, left: 0 }, children: _jsxs(Alert, { colorScheme: "warning", sx: { p: 2, w: 12, justifyContent: 'center', height: ['60px', '100px'] }, children: [_jsx(IconBox, { size: "md", colorScheme: "light", sx: { display: ['block', 'none'] }, children: _jsx(ExclamationTriangle, {}) }), _jsx(Flex, { sx: { py: [5, 3] }, children: _jsx(Text, { sx: { fontSize: ['16px', '14px'], whiteSpace: 'pre-line' }, colorScheme: "warning.contrastText", children: children }) }), _jsx(IconBox, { size: "md", colorScheme: "light", sx: { display: ['block', 'none'] }, children: _jsx(ExclamationTriangle, {}) })] }) }));
6
+ //# sourceMappingURL=BannerWarning.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BannerWarning.js","sourceRoot":"","sources":["../src/BannerWarning.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAElC,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,EAAE,QAAQ,EAAiC,EAAE,EAAE,CAAC,CAC5E,KAAC,IAAI,IAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,YACpE,MAAC,KAAK,IAAC,WAAW,EAAC,SAAS,EAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,aACnG,KAAC,OAAO,IAAC,IAAI,EAAC,IAAI,EAAC,WAAW,EAAC,OAAO,EAAC,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE,YACvE,KAAC,mBAAmB,KAAG,GACf,EACV,KAAC,IAAI,IAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,YACtB,KAAC,IAAI,IAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,UAAU,EAAE,UAAU,EAAE,EAAE,WAAW,EAAC,sBAAsB,YACjG,QAAQ,GACJ,GACF,EACP,KAAC,OAAO,IAAC,IAAI,EAAC,IAAI,EAAC,WAAW,EAAC,OAAO,EAAC,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE,YACvE,KAAC,mBAAmB,KAAG,GACf,IACJ,GACH,CACR,CAAA"}
package/dist/Login.d.ts CHANGED
@@ -19,7 +19,8 @@ interface Props {
19
19
  removeLoadingOnSuccess?: boolean;
20
20
  className?: string;
21
21
  style?: React.CSSProperties;
22
+ showBanner?: boolean;
22
23
  }
23
- export declare const Login: ({ onSubmit, initialValue, welcomeText, removeLoadingOnSuccess, className, style }: Props) => import("react/jsx-runtime").JSX.Element;
24
+ export declare const Login: ({ onSubmit, initialValue, welcomeText, removeLoadingOnSuccess, className, style, showBanner }: Props) => import("react/jsx-runtime").JSX.Element;
24
25
  export {};
25
26
  //# sourceMappingURL=Login.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Login.d.ts","sourceRoot":"","sources":["../src/Login.tsx"],"names":[],"mappings":";AASA,KAAK,SAAS,GAAG,KAAK,GAAG,KAAK,CAAA;AAE9B,UAAU,QAAQ;IAChB,IAAI,EAAE,SAAS,CAAC;CACjB;AAED,UAAU,OAAQ,SAAQ,QAAQ;IAChC,IAAI,EAAE,KAAK,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf;AAED,UAAU,OAAQ,SAAQ,QAAQ;IAChC,IAAI,EAAE,KAAK,CAAC;IACZ,QAAQ,EAAE,qBAAqB,CAAC;CACjC;AAED,KAAK,SAAS,GAAG,OAAO,GAAG,OAAO,CAAA;AAElC,UAAU,KAAK;IACb,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AA4CD,eAAO,MAAM,KAAK,sFAA4F,KAAK,4CAmDlH,CAAA"}
1
+ {"version":3,"file":"Login.d.ts","sourceRoot":"","sources":["../src/Login.tsx"],"names":[],"mappings":";AAWA,KAAK,SAAS,GAAG,KAAK,GAAG,KAAK,CAAA;AAE9B,UAAU,QAAQ;IAChB,IAAI,EAAE,SAAS,CAAC;CACjB;AAED,UAAU,OAAQ,SAAQ,QAAQ;IAChC,IAAI,EAAE,KAAK,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf;AAED,UAAU,OAAQ,SAAQ,QAAQ;IAChC,IAAI,EAAE,KAAK,CAAC;IACZ,QAAQ,EAAE,qBAAqB,CAAC;CACjC;AAED,KAAK,SAAS,GAAG,OAAO,GAAG,OAAO,CAAA;AAElC,UAAU,KAAK;IACb,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AA4CD,eAAO,MAAM,KAAK,kGAAwG,KAAK,4CAwD9H,CAAA"}
package/dist/Login.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ /* eslint-disable max-len */
2
3
  import { Button, IconBox, Input, Text } from '@citric/core';
3
4
  import { Github } from '@citric/icons';
4
5
  import { LoadingCircular } from '@citric/ui';
@@ -7,6 +8,7 @@ import { useTranslate } from '@stack-spot/portal-translate';
7
8
  import { useState } from 'react';
8
9
  import { styled } from 'styled-components';
9
10
  import { MiniLogo } from './MiniLogo.js';
11
+ import { BannerWarning } from './BannerWarning.js';
10
12
  const LoginBox = styled.form `
11
13
  display: flex;
12
14
  flex-direction: column;
@@ -48,7 +50,7 @@ const LoginBox = styled.form `
48
50
  line-height: 1.5rem;
49
51
  }
50
52
  `;
51
- export const Login = ({ onSubmit, initialValue = '', welcomeText, removeLoadingOnSuccess, className, style }) => {
53
+ export const Login = ({ onSubmit, initialValue = '', welcomeText, removeLoadingOnSuccess, className, style, showBanner }) => {
52
54
  const t = useTranslate(dictionary);
53
55
  const searchParams = new URLSearchParams(location.search);
54
56
  const [error, setError] = useState(searchParams.get('error_description') || searchParams.get('error') || '');
@@ -75,7 +77,7 @@ export const Login = ({ onSubmit, initialValue = '', welcomeText, removeLoadingO
75
77
  return;
76
78
  login('sso');
77
79
  }
78
- return (_jsxs(LoginBox, { onSubmit: submitForm, className: className, style: style, children: [_jsxs("header", { children: [_jsx(MiniLogo, {}), _jsx(Text, { className: "title", children: welcomeText || t.welcome })] }), _jsx(Input, { name: "email", value: email, onChange: e => setEmail(e.target.value), placeholder: t.placeholder }), _jsx(Button, { colorScheme: "primary", disabled: disabled || loading, children: loading ? _jsx(LoadingCircular, {}) : _jsx(Text, { children: t.continue }) }), _jsx("p", { className: "separator", children: t.or }), _jsx(Button, { colorScheme: "light", type: "button", onClick: () => login('idp'), disabled: loading, children: loading ? _jsx(LoadingCircular, {}) : (_jsxs(_Fragment, { children: [_jsx(IconBox, { children: _jsx(Github, {}) }), _jsx(Text, { children: t.loginWithGithub })] })) }), error && _jsxs(Text, { className: "error", children: [t.error, ": ", error] })] }));
80
+ return (_jsxs(_Fragment, { children: [_jsxs(LoginBox, { onSubmit: submitForm, className: className, style: style, children: [_jsxs("header", { children: [_jsx(MiniLogo, {}), _jsx(Text, { className: "title", children: welcomeText || t.welcome })] }), _jsx(Input, { name: "email", value: email, onChange: e => setEmail(e.target.value), placeholder: t.placeholder }), _jsx(Button, { colorScheme: "primary", disabled: disabled || loading, children: loading ? _jsx(LoadingCircular, {}) : _jsx(Text, { children: t.continue }) }), _jsx("p", { className: "separator", children: t.or }), _jsx(Button, { colorScheme: "light", type: "button", onClick: () => login('idp'), disabled: loading, children: loading ? _jsx(LoadingCircular, {}) : (_jsxs(_Fragment, { children: [_jsx(IconBox, { children: _jsx(Github, {}) }), _jsx(Text, { children: t.loginWithGithub })] })) }), error && _jsxs(Text, { className: "error", children: [t.error, ": ", error] })] }), showBanner && _jsx(BannerWarning, { children: t.bannerText })] }));
79
81
  };
80
82
  const dictionary = {
81
83
  en: {
@@ -85,6 +87,8 @@ const dictionary = {
85
87
  or: 'or',
86
88
  loginWithGithub: 'Login with Github',
87
89
  error: 'Error while attempting to login',
90
+ bannerText: `We want to inform you that StackSpot will be undergoing maintenance on April 11, 2024 (Thursday) from 19:00 (GMT-3) until 23:59. During this period, the entire platform, including the Portal, CLI and APIs, will be temporarily unavailable.
91
+ Client applications will not be affected and should continue to operate during this maintenance window.`,
88
92
  },
89
93
  pt: {
90
94
  welcome: 'Bem vindo à StackSpot',
@@ -93,6 +97,8 @@ const dictionary = {
93
97
  or: 'ou',
94
98
  loginWithGithub: 'Logar com o GitHub',
95
99
  error: 'Erro ao fazer login',
100
+ bannerText: `Queremos informar que a StackSpot estará em manutenção no dia 11 de Abril de 2024 (quinta-feira) das 19:00 (GMT-3) até às 23:59. Durante este período, toda a plataforma, incluindo Portal, CLI e APIs, estará temporariamente indisponível.
101
+ As aplicações de clientes não terão impacto e devem manter seu funcionamento durante essa janela de manutenção.temporariamente indisponível.`,
96
102
  },
97
103
  };
98
104
  //# sourceMappingURL=Login.js.map
package/dist/Login.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Login.js","sourceRoot":"","sources":["../src/Login.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;AAChD,OAAO,EAAc,YAAY,EAAE,MAAM,8BAA8B,CAAA;AACvE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AA6BrC,MAAM,QAAQ,GAA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AQ,GACnD,EACT,YAAG,SAAS,EAAC,WAAW,YAAE,CAAC,CAAC,EAAE,GAAK,EACnC,KAAC,MAAM,IAAC,WAAW,EAAC,OAAO,EAAC,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,QAAQ,EAAE,OAAO,YACrF,OAAO,CAAC,CAAC,CAAC,KAAC,eAAe,KAAG,CAAC,CAAC,CAAC,CAC/B,8BACE,KAAC,OAAO,cACN,KAAC,MAAM,KAAG,GACF,EACV,KAAC,IAAI,cAAE,CAAC,CAAC,eAAe,GAAQ,IAC/B,CACJ,GACM,EACR,KAAK,IAAI,MAAC,IAAI,IAAC,SAAS,EAAC,OAAO,aAAE,CAAC,CAAC,KAAK,QAAI,KAAK,IAAQ,IAClD,EACV,UAAU,IAAI,KAAC,aAAa,cAC1B,CAAC,CAAC,UAAU,GACC,IACf,CACJ,CAAA;AACH,CAAC,CAAA;AAED,MAAM,UAAU,GAAG;IACjB,EAAE,EAAE;QACF,OAAO,EAAE,sBAAsB;QAC/B,WAAW,EAAE,gBAAgB;QAC7B,QAAQ,EAAE,UAAU;QACpB,EAAE,EAAE,IAAI;QACR,eAAe,EAAE,mBAAmB;QACpC,KAAK,EAAE,iCAAiC;QACxC,UAAU,EACR;8GACwG;KAC3G;IACD,EAAE,EAAE;QACF,OAAO,EAAE,uBAAuB;QAChC,WAAW,EAAE,gBAAgB;QAC7B,QAAQ,EAAE,WAAW;QACrB,EAAE,EAAE,IAAI;QACR,eAAe,EAAE,oBAAoB;QACrC,KAAK,EAAE,qBAAqB;QAC5B,UAAU,EACR;mJAC6I;KAChJ;CACmB,CAAA"}
package/dist/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export { Login } from './Login.js';
2
+ export { BannerWarning } from './BannerWarning.js';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA"}
package/dist/index.js CHANGED
@@ -1,2 +1,3 @@
1
1
  export { Login } from './Login.js';
2
+ export { BannerWarning } from './BannerWarning.js';
2
3
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stack-spot/portal-components",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -0,0 +1,21 @@
1
+ import { Flex, IconBox, Text } from '@citric/core'
2
+ import { ExclamationTriangle } from '@citric/icons'
3
+ import { Alert } from '@citric/ui'
4
+
5
+ export const BannerWarning = ({ children }: { children: React.ReactNode }) => (
6
+ <Flex sx={{ position: 'fixed', top: 0, zIndex: '999', w: 12, left: 0 }}>
7
+ <Alert colorScheme="warning" sx={{ p: 2, w: 12, justifyContent: 'center', height: ['60px', '100px'] }}>
8
+ <IconBox size="md" colorScheme="light" sx={{ display: ['block', 'none'] }}>
9
+ <ExclamationTriangle />
10
+ </IconBox>
11
+ <Flex sx={{ py: [5, 3] }}>
12
+ <Text sx={{ fontSize: ['16px', '14px'], whiteSpace: 'pre-line' }} colorScheme="warning.contrastText">
13
+ {children}
14
+ </Text>
15
+ </Flex>
16
+ <IconBox size="md" colorScheme="light" sx={{ display: ['block', 'none'] }}>
17
+ <ExclamationTriangle />
18
+ </IconBox>
19
+ </Alert>
20
+ </Flex>
21
+ )
package/src/Login.tsx CHANGED
@@ -1,3 +1,4 @@
1
+ /* eslint-disable max-len */
1
2
  import { Button, IconBox, Input, Text } from '@citric/core'
2
3
  import { Github } from '@citric/icons'
3
4
  import { LoadingCircular } from '@citric/ui'
@@ -6,6 +7,7 @@ import { Dictionary, useTranslate } from '@stack-spot/portal-translate'
6
7
  import { useState } from 'react'
7
8
  import { styled } from 'styled-components'
8
9
  import { MiniLogo } from './MiniLogo'
10
+ import { BannerWarning } from './BannerWarning'
9
11
 
10
12
  type LoginType = 'sso' | 'idp'
11
13
 
@@ -32,6 +34,7 @@ interface Props {
32
34
  removeLoadingOnSuccess?: boolean,
33
35
  className?: string,
34
36
  style?: React.CSSProperties,
37
+ showBanner?: boolean,
35
38
  }
36
39
 
37
40
  const LoginBox = styled.form`
@@ -76,7 +79,7 @@ const LoginBox = styled.form`
76
79
  }
77
80
  `
78
81
 
79
- export const Login = ({ onSubmit, initialValue = '', welcomeText, removeLoadingOnSuccess, className, style }: Props) => {
82
+ export const Login = ({ onSubmit, initialValue = '', welcomeText, removeLoadingOnSuccess, className, style, showBanner }: Props) => {
80
83
  const t = useTranslate(dictionary)
81
84
  const searchParams = new URLSearchParams(location.search)
82
85
  const [error, setError] = useState(searchParams.get('error_description') || searchParams.get('error') || '')
@@ -104,28 +107,33 @@ export const Login = ({ onSubmit, initialValue = '', welcomeText, removeLoadingO
104
107
  }
105
108
 
106
109
  return (
107
- <LoginBox onSubmit={submitForm} className={className} style={style}>
108
- <header>
109
- <MiniLogo />
110
- <Text className="title">{welcomeText || t.welcome}</Text>
111
- </header>
112
- <Input name="email" value={email} onChange={e => setEmail(e.target.value)} placeholder={t.placeholder} />
113
- <Button colorScheme="primary" disabled={disabled || loading}>
114
- {loading ? <LoadingCircular /> : <Text>{t.continue}</Text>}
115
- </Button>
116
- <p className="separator">{t.or}</p>
117
- <Button colorScheme="light" type="button" onClick={() => login('idp')} disabled={loading}>
118
- {loading ? <LoadingCircular /> : (
119
- <>
120
- <IconBox>
121
- <Github />
122
- </IconBox>
123
- <Text>{t.loginWithGithub}</Text>
124
- </>
125
- )}
126
- </Button>
127
- {error && <Text className="error">{t.error}: {error}</Text>}
128
- </LoginBox>
110
+ <>
111
+ <LoginBox onSubmit={submitForm} className={className} style={style}>
112
+ <header>
113
+ <MiniLogo />
114
+ <Text className="title">{welcomeText || t.welcome}</Text>
115
+ </header>
116
+ <Input name="email" value={email} onChange={e => setEmail(e.target.value)} placeholder={t.placeholder} />
117
+ <Button colorScheme="primary" disabled={disabled || loading}>
118
+ {loading ? <LoadingCircular /> : <Text>{t.continue}</Text>}
119
+ </Button>
120
+ <p className="separator">{t.or}</p>
121
+ <Button colorScheme="light" type="button" onClick={() => login('idp')} disabled={loading}>
122
+ {loading ? <LoadingCircular /> : (
123
+ <>
124
+ <IconBox>
125
+ <Github />
126
+ </IconBox>
127
+ <Text>{t.loginWithGithub}</Text>
128
+ </>
129
+ )}
130
+ </Button>
131
+ {error && <Text className="error">{t.error}: {error}</Text>}
132
+ </LoginBox>
133
+ {showBanner && <BannerWarning>
134
+ {t.bannerText}
135
+ </BannerWarning>}
136
+ </>
129
137
  )
130
138
  }
131
139
 
@@ -137,6 +145,9 @@ const dictionary = {
137
145
  or: 'or',
138
146
  loginWithGithub: 'Login with Github',
139
147
  error: 'Error while attempting to login',
148
+ bannerText:
149
+ `We want to inform you that StackSpot will be undergoing maintenance on April 11, 2024 (Thursday) from 19:00 (GMT-3) until 23:59. During this period, the entire platform, including the Portal, CLI and APIs, will be temporarily unavailable.
150
+ Client applications will not be affected and should continue to operate during this maintenance window.`,
140
151
  },
141
152
  pt: {
142
153
  welcome: 'Bem vindo à StackSpot',
@@ -145,5 +156,8 @@ const dictionary = {
145
156
  or: 'ou',
146
157
  loginWithGithub: 'Logar com o GitHub',
147
158
  error: 'Erro ao fazer login',
159
+ bannerText:
160
+ `Queremos informar que a StackSpot estará em manutenção no dia 11 de Abril de 2024 (quinta-feira) das 19:00 (GMT-3) até às 23:59. Durante este período, toda a plataforma, incluindo Portal, CLI e APIs, estará temporariamente indisponível.
161
+ As aplicações de clientes não terão impacto e devem manter seu funcionamento durante essa janela de manutenção.temporariamente indisponível.`,
148
162
  },
149
163
  } satisfies Dictionary
package/src/index.ts CHANGED
@@ -1 +1,2 @@
1
1
  export { Login } from './Login'
2
+ export { BannerWarning } from './BannerWarning'