@griddo/ax 10.1.69 → 10.1.71

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.
Files changed (50) hide show
  1. package/config/jest/setup.js +14 -4
  2. package/package.json +5 -2
  3. package/public/img/logos/logoSQY.svg +3 -0
  4. package/public/img/slider/analytics.png +0 -0
  5. package/public/img/slider/content.png +0 -0
  6. package/public/img/slider/editor.png +0 -0
  7. package/public/img/slider/gallery.png +0 -0
  8. package/public/img/slider/left-on.svg +4 -0
  9. package/public/img/slider/left.svg +4 -0
  10. package/public/img/slider/right-on.svg +4 -0
  11. package/public/img/slider/right.svg +4 -0
  12. package/src/__tests__/components/Login/Login.test.tsx +5 -7
  13. package/src/api/integrations.tsx +18 -1
  14. package/src/components/Fields/CheckField/index.tsx +6 -12
  15. package/src/components/Fields/CheckField/style.tsx +16 -6
  16. package/src/components/Fields/NoteField/style.tsx +8 -8
  17. package/src/components/Fields/TextField/index.tsx +3 -1
  18. package/src/components/Fields/TextField/style.tsx +6 -1
  19. package/src/components/Fields/UniqueCheck/index.tsx +3 -1
  20. package/src/components/FieldsBehavior/index.tsx +4 -3
  21. package/src/components/FieldsBehavior/style.tsx +35 -22
  22. package/src/components/Login/Circle/index.tsx +16 -0
  23. package/src/components/Login/Circle/style.tsx +30 -0
  24. package/src/components/Login/LoginSlider/index.tsx +63 -0
  25. package/src/components/Login/LoginSlider/style.tsx +68 -0
  26. package/src/components/Login/index.tsx +102 -58
  27. package/src/components/Login/style.tsx +121 -16
  28. package/src/components/MainWrapper/AppBar/index.tsx +5 -1
  29. package/src/components/MainWrapper/AppBar/style.tsx +17 -1
  30. package/src/components/MainWrapper/index.tsx +3 -1
  31. package/src/components/MainWrapper/style.tsx +35 -4
  32. package/src/components/TableList/index.tsx +3 -5
  33. package/src/containers/App/actions.tsx +23 -7
  34. package/src/containers/App/constants.tsx +2 -0
  35. package/src/containers/App/interfaces.tsx +6 -0
  36. package/src/containers/App/reducer.tsx +4 -0
  37. package/src/containers/Integrations/actions.tsx +32 -2
  38. package/src/modules/Login/index.tsx +16 -3
  39. package/src/modules/Settings/Integrations/BulkHeader/TableHeader/index.tsx +1 -1
  40. package/src/modules/Settings/Integrations/BulkHeader/TableHeader/style.tsx +2 -2
  41. package/src/modules/Settings/Integrations/IntegrationForm/index.tsx +2 -1
  42. package/src/modules/Settings/Integrations/IntegrationItem/index.tsx +27 -13
  43. package/src/modules/Settings/Integrations/IntegrationItem/style.tsx +32 -5
  44. package/src/modules/Settings/Integrations/index.tsx +114 -81
  45. package/src/modules/Settings/Integrations/style.tsx +20 -1
  46. package/src/modules/Sites/SitesList/index.tsx +18 -3
  47. package/src/modules/Sites/SitesList/style.tsx +28 -1
  48. package/src/modules/Sites/index.tsx +4 -1
  49. package/src/themes/theme.json +4 -0
  50. package/src/types/index.tsx +2 -0
@@ -1,5 +1,15 @@
1
- require('babel-plugin-require-context-hook/register')()
1
+ require("babel-plugin-require-context-hook/register")();
2
2
 
3
- module.exports = () =>{
4
- global.IS_REACT_ACT_ENVIRONMENT = true;
5
- }
3
+ module.exports = () => {
4
+ global.IS_REACT_ACT_ENVIRONMENT = true;
5
+ };
6
+
7
+ window.matchMedia =
8
+ window.matchMedia ||
9
+ function () {
10
+ return {
11
+ matches: false,
12
+ addListener: function () {},
13
+ removeListener: function () {},
14
+ };
15
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@griddo/ax",
3
3
  "description": "Griddo Author Experience",
4
- "version": "10.1.69",
4
+ "version": "10.1.71",
5
5
  "authors": [
6
6
  "Álvaro Sánchez' <alvaro.sanches@secuoyas.com>",
7
7
  "Carlos Torres <carlos.torres@secuoyas.com>",
@@ -61,6 +61,7 @@
61
61
  "@types/react-redux": "^7.1.23",
62
62
  "@types/react-router-dom": "5.3.3",
63
63
  "@types/react-select": "^3.0.8",
64
+ "@types/react-slick": "^0.23.10",
64
65
  "@types/react-test-renderer": "17.0.1",
65
66
  "@types/react-textarea-autosize": "^4.3.5",
66
67
  "@types/styled-components": "^5.1.25",
@@ -131,6 +132,7 @@
131
132
  "react-refresh": "^0.10.0",
132
133
  "react-router-dom": "5.1.2",
133
134
  "react-select": "^3.0.8",
135
+ "react-slick": "^0.29.0",
134
136
  "react-textarea-autosize": "^7.1.2",
135
137
  "redux": "4.0.4",
136
138
  "redux-devtools-extension": "2.13.8",
@@ -142,6 +144,7 @@
142
144
  "sass-alias": "^1.0.5",
143
145
  "sass-loader": "^10.0.0",
144
146
  "semver": "^7.3.5",
147
+ "slick-carousel": "^1.8.1",
145
148
  "source-map-loader": "^1.1.2",
146
149
  "string-replace-loader": "^3.0.1",
147
150
  "style-loader": "^1.2.1",
@@ -230,5 +233,5 @@
230
233
  "publishConfig": {
231
234
  "access": "public"
232
235
  },
233
- "gitHead": "063e80a3a399854898829fab01c32edcfc33a9fb"
236
+ "gitHead": "e745de8a8f3748766462e1782eb7960df7100936"
234
237
  }
@@ -0,0 +1,3 @@
1
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M20 9.99997C20 15.5228 15.5229 20 10 20C4.47712 20 0 15.5228 0 9.99997C0 4.4771 4.47712 0 10 0C15.5229 0 20 4.4771 20 9.99997ZM12.1697 15.1504C12.1548 15.299 12.244 15.3734 12.3926 15.3734H14.3096C14.4582 15.3734 14.5326 15.299 14.5326 15.1504V11.3907C14.5326 11.2421 14.4434 11.1679 14.3096 11.1679H12.0954C11.9616 11.1679 11.8724 11.2421 11.8724 11.3907V11.6434C11.8724 11.6434 11.5753 13.0254 9.86629 13.0254C9.22724 13.0254 8.79624 12.6835 8.79624 12.2378C8.79624 10.93 14.3245 11.4947 14.3245 7.86866C14.3245 5.9665 12.9424 4.61419 10.6984 4.61419C9.46504 4.61419 8.64769 4.98576 8.12758 5.50581L8.18701 4.92626C8.20185 4.77765 8.11267 4.70331 7.96405 4.70331H6.04704C5.89842 4.70331 5.82415 4.77765 5.82415 4.92626V8.68601C5.82415 8.83462 5.91327 8.90896 6.04704 8.90896H8.26128C8.39506 8.90896 8.48417 8.83462 8.48417 8.68601V8.44828C8.48417 7.85382 9.03404 7.12566 10.2972 7.12566C10.966 7.12566 11.3523 7.40798 11.3523 7.86866C11.3523 9.48851 5.46749 8.67117 5.46749 12.3269C5.46749 13.8872 6.52257 15.4773 9.12322 15.4773C11.0997 15.4773 12.1697 14.4223 12.1994 14.4223L12.1697 15.1504Z" fill="white"/>
3
+ </svg>
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,4 @@
1
+ <svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <circle cx="20" cy="20" r="19.6226" fill="white" fill-opacity="0.2" stroke="white" stroke-width="0.754717"/>
3
+ <path d="M16.784 24.5785C17.0303 24.8142 17.4186 24.8142 17.6649 24.5785C17.9268 24.3279 17.927 23.9094 17.6653 23.6586L14.5012 20.625L27.375 20.625C27.7202 20.625 28 20.3452 28 20C28 19.6548 27.7202 19.375 27.375 19.375L14.5012 19.375L17.6653 16.3414C17.927 16.0905 17.9268 15.6721 17.6649 15.4215C17.4186 15.1858 17.0303 15.1858 16.784 15.4215L12 20L16.784 24.5785Z" fill="white"/>
4
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <circle cx="20" cy="20" r="19.6226" stroke="white" stroke-width="0.754717"/>
3
+ <path d="M16.784 24.5785C17.0303 24.8142 17.4186 24.8142 17.6649 24.5785C17.9268 24.3279 17.927 23.9094 17.6653 23.6586L14.5012 20.625L27.375 20.625C27.7202 20.625 28 20.3452 28 20C28 19.6548 27.7202 19.375 27.375 19.375L14.5012 19.375L17.6653 16.3414C17.927 16.0905 17.9268 15.6721 17.6649 15.4215C17.4186 15.1858 17.0303 15.1858 16.784 15.4215L12 20L16.784 24.5785Z" fill="white"/>
4
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <circle cx="20" cy="20" r="19.6226" fill="white" fill-opacity="0.2" stroke="white" stroke-width="0.754717"/>
3
+ <path d="M23.216 15.4215C22.9697 15.1858 22.5814 15.1858 22.3351 15.4215C22.0732 15.6721 22.073 16.0906 22.3347 16.3414L25.4988 19.375H12.625C12.2798 19.375 12 19.6548 12 20C12 20.3452 12.2798 20.625 12.625 20.625H25.4988L22.3347 23.6586C22.073 23.9094 22.0732 24.3279 22.3351 24.5785C22.5814 24.8142 22.9697 24.8142 23.216 24.5785L28 20L23.216 15.4215Z" fill="white"/>
4
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <circle cx="20" cy="20" r="19.6226" stroke="white" stroke-width="0.754717"/>
3
+ <path d="M23.216 15.4215C22.9697 15.1858 22.5814 15.1858 22.3351 15.4215C22.0732 15.6721 22.073 16.0906 22.3347 16.3414L25.4988 19.375H12.625C12.2798 19.375 12 19.6548 12 20C12 20.3452 12.2798 20.625 12.625 20.625H25.4988L22.3347 23.6586C22.073 23.9094 22.0732 24.3279 22.3351 24.5785C22.5814 24.8142 22.9697 24.8142 23.216 24.5785L28 20L23.216 15.4215Z" fill="white"/>
4
+ </svg>
@@ -17,6 +17,8 @@ const settings = {
17
17
  siteLogoMini: "https://images.dev.griddo.io/logobs-mini_1",
18
18
  welcomeText1: "Welcome back to",
19
19
  welcomeText2: "Griddo",
20
+ autoSummary: false,
21
+ autoTranslation: false,
20
22
  };
21
23
 
22
24
  describe("Login component rendering", () => {
@@ -41,11 +43,7 @@ describe("Login component rendering", () => {
41
43
 
42
44
  const wrapper = screen.getByTestId("login-wrapper");
43
45
  expect(wrapper).toBeTruthy();
44
- const welcomeText1 = screen.getByText("Welcome back to");
45
- expect(welcomeText1).toBeTruthy();
46
- const welcomeText2 = screen.getByText("Griddo");
47
- expect(welcomeText2).toBeTruthy();
48
- const loginButton = screen.getByText("Log in");
46
+ const loginButton = screen.getByText("Login");
49
47
  expect(loginButton).toBeTruthy();
50
48
  });
51
49
 
@@ -69,7 +67,7 @@ describe("Login component rendering", () => {
69
67
  </ThemeProvider>
70
68
  );
71
69
 
72
- const loginButton = screen.queryByText("Log in");
70
+ const loginButton = screen.queryByText("Login");
73
71
  expect(loginButton).toBeFalsy();
74
72
  const loginButtonSending = screen.getByText("Sending");
75
73
  expect(loginButtonSending).toBeTruthy();
@@ -99,7 +97,7 @@ describe("Login component events", () => {
99
97
  </ThemeProvider>
100
98
  );
101
99
 
102
- const loginButton = screen.getByText("Log in");
100
+ const loginButton = screen.getByText("Login");
103
101
  expect(loginButton).toBeTruthy();
104
102
  fireEvent.click(loginButton);
105
103
  expect(handleSubmitMock).toBeCalledTimes(1);
@@ -49,6 +49,11 @@ const SERVICES: { [key: string]: IServiceConfig } = {
49
49
  endpoint: ["/integration/", "/duplicate/"],
50
50
  method: "POST",
51
51
  },
52
+ ORDER_INTEGRATION: {
53
+ ...template,
54
+ endpoint: ["/integration/", "/order/"],
55
+ method: "PUT",
56
+ },
52
57
  };
53
58
 
54
59
  const getIntegrations = async (site: number, params: any = {}): Promise<AxiosResponse> => {
@@ -59,7 +64,7 @@ const getIntegrations = async (site: number, params: any = {}): Promise<AxiosRes
59
64
  } = SERVICES.GET_INTEGRATIONS;
60
65
 
61
66
  const stateQuery = filterState ? `&filterState=${filterState}` : "";
62
- SERVICES.GET_INTEGRATIONS.dynamicUrl = `${host}${prefix}${site}${suffix}?pagination=${pagination}${filter}${stateQuery}`;
67
+ SERVICES.GET_INTEGRATIONS.dynamicUrl = `${host}${prefix}${site}${suffix}?pagination=${pagination}&order=scriptOrder-asc${filter}${stateQuery}`;
63
68
  if (pagination) SERVICES.GET_INTEGRATIONS.dynamicUrl += `&page=${page}&itemsPerPage=${itemsPerPage}`;
64
69
 
65
70
  return sendRequest(SERVICES.GET_INTEGRATIONS);
@@ -140,6 +145,17 @@ const duplicateIntegration = async (id: number, site: number): Promise<AxiosResp
140
145
  return sendRequest(SERVICES.DUPLICATE_INTEGRATION);
141
146
  };
142
147
 
148
+ const orderIntegration = async (id: number, newOrder: number): Promise<AxiosResponse> => {
149
+ const {
150
+ host,
151
+ endpoint: [prefix, suffix],
152
+ } = SERVICES.ORDER_INTEGRATION;
153
+
154
+ SERVICES.ORDER_INTEGRATION.dynamicUrl = `${host}${prefix}${id}${suffix}${newOrder}`;
155
+
156
+ return sendRequest(SERVICES.ORDER_INTEGRATION);
157
+ };
158
+
143
159
  export default {
144
160
  getIntegrations,
145
161
  createIntegration,
@@ -150,4 +166,5 @@ export default {
150
166
  changeState,
151
167
  changeStateBulk,
152
168
  duplicateIntegration,
169
+ orderIntegration,
153
170
  };
@@ -4,17 +4,9 @@ import Icon from "@ax/components/Icon";
4
4
 
5
5
  import * as S from "./style";
6
6
 
7
- const CheckField = ({
8
- name,
9
- title,
10
- value,
11
- checked,
12
- error,
13
- disabled,
14
- indeterminate,
15
- onChange,
16
- icon,
17
- }: ICheckFieldProps): JSX.Element => {
7
+ const CheckField = (props: ICheckFieldProps): JSX.Element => {
8
+ const { name, title, value, checked, error, disabled, indeterminate, onChange, icon, inversed = false } = props;
9
+
18
10
  const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
19
11
  const isChecked = e.target.checked;
20
12
  if (onChange) {
@@ -24,7 +16,7 @@ const CheckField = ({
24
16
 
25
17
  return (
26
18
  <S.Wrapper>
27
- <S.Label data-testid="check-field-label" disabled={disabled}>
19
+ <S.Label data-testid="check-field-label" disabled={disabled} inversed={inversed}>
28
20
  {icon ? (
29
21
  <S.IconLabelWrapper data-testid="check-field-icon-label">
30
22
  <S.IconWrapper>
@@ -50,6 +42,7 @@ const CheckField = ({
50
42
  checked={checked}
51
43
  error={error}
52
44
  indeterminate={indeterminate}
45
+ inversed={inversed}
53
46
  />
54
47
  </S.Label>
55
48
  </S.Wrapper>
@@ -66,6 +59,7 @@ export interface ICheckFieldProps {
66
59
  indeterminate?: boolean;
67
60
  onChange?: (value: ICheck) => void;
68
61
  icon?: string;
62
+ inversed?: boolean;
69
63
  }
70
64
 
71
65
  export default CheckField;
@@ -2,7 +2,7 @@ import styled from "styled-components";
2
2
 
3
3
  const Wrapper = styled.div``;
4
4
 
5
- const Label = styled.label<{ disabled: boolean | undefined }>`
5
+ const Label = styled.label<{ disabled: boolean | undefined; inversed: boolean }>`
6
6
  ${(p) => p.theme.textStyle.fieldContent};
7
7
  display: block;
8
8
  position: relative;
@@ -10,13 +10,19 @@ const Label = styled.label<{ disabled: boolean | undefined }>`
10
10
  margin-bottom: ${(p) => p.theme.spacing.xs};
11
11
  cursor: pointer;
12
12
  user-select: none;
13
- color: ${(p) => p.disabled && p.theme.color.interactiveDisabled};
13
+ color: ${(p) =>
14
+ p.disabled
15
+ ? p.theme.color.interactiveDisabled
16
+ : p.inversed
17
+ ? p.theme.color.textHighEmphasisInverse
18
+ : p.theme.color.textMediumEmphasis};
14
19
  `;
15
20
 
16
21
  const CheckMark = styled.span<{
17
22
  checked: boolean | undefined;
18
23
  error: boolean | undefined;
19
24
  indeterminate: boolean | undefined;
25
+ inversed: boolean;
20
26
  }>`
21
27
  position: absolute;
22
28
  top: 2px;
@@ -24,10 +30,12 @@ const CheckMark = styled.span<{
24
30
  height: ${(p) => p.theme.spacing.s};
25
31
  width: ${(p) => p.theme.spacing.s};
26
32
  background-color: ${(p) =>
27
- p.checked || p.indeterminate
28
- ? p.error
29
- ? p.theme.color.error
30
- : p.theme.color.interactive01
33
+ p.error
34
+ ? p.theme.color.error
35
+ : p.checked || p.indeterminate
36
+ ? p.theme.color.interactive01
37
+ : p.inversed
38
+ ? "transparent"
31
39
  : p.theme.color.interactiveBackground};
32
40
  border: 2px solid
33
41
  ${(p) =>
@@ -35,6 +43,8 @@ const CheckMark = styled.span<{
35
43
  ? p.theme.color.error
36
44
  : p.checked || p.indeterminate
37
45
  ? p.theme.color.interactive01
46
+ : p.inversed
47
+ ? p.theme.color.interactiveInverse
38
48
  : p.theme.color.interactiveInactive};
39
49
  border-radius: 1.5px;
40
50
  :after {
@@ -1,20 +1,20 @@
1
1
  import styled from "styled-components";
2
2
 
3
3
  const Wrapper = styled.div`
4
- background-color: ${(p) => p.theme.color?.uiBackground03};
5
- padding: ${(p) => p.theme.spacing?.s};
6
- border-radius: ${(p) => p.theme.radii?.s};
4
+ background-color: ${(p) => p.theme.color.uiBackground03};
5
+ padding: ${(p) => p.theme.spacing.s};
6
+ border-radius: ${(p) => p.theme.radii.s};
7
7
  `;
8
8
 
9
9
  const Title = styled.div`
10
- ${(p) => p.theme.textStyle?.headingXS};
11
- color: ${(p) => p.theme.color?.textMediumEmphasis};
12
- margin-bottom: ${(p) => p.theme.spacing?.xs};
10
+ ${(p) => p.theme.textStyle.headingXS};
11
+ color: ${(p) => p.theme.color.textMediumEmphasis};
12
+ margin-bottom: ${(p) => p.theme.spacing.xs};
13
13
  `;
14
14
 
15
15
  const Text = styled.div`
16
- ${(p) => p.theme.textStyle?.uiXS};
17
- color: ${(p) => p.theme.color?.textMediumEmphasis};
16
+ ${(p) => p.theme.textStyle.uiXS};
17
+ color: ${(p) => p.theme.color.textMediumEmphasis};
18
18
  `;
19
19
 
20
20
  export { Wrapper, Title, Text };
@@ -23,6 +23,7 @@ const TextField = (props: ITextFieldProps): JSX.Element => {
23
23
  handleValidation,
24
24
  validators,
25
25
  editorID,
26
+ inversed = false,
26
27
  } = props;
27
28
 
28
29
  const [width, setWidth] = useState(0);
@@ -99,7 +100,7 @@ const TextField = (props: ITextFieldProps): JSX.Element => {
99
100
  aria-label={name}
100
101
  />
101
102
  {hasBackgroundIcon && (
102
- <S.BackgroundIcon data-testid="background-icon-component" onClick={onClickIcon}>
103
+ <S.BackgroundIcon data-testid="background-icon-component" onClick={onClickIcon} inversed={inversed}>
103
104
  <Icon name={icon || ""} size="24" />
104
105
  </S.BackgroundIcon>
105
106
  )}
@@ -131,6 +132,7 @@ interface ITextFieldProps {
131
132
  handleValidation?: (value: string, validators?: Record<string, unknown>) => void;
132
133
  validators?: Record<string, unknown>;
133
134
  editorID?: number;
135
+ inversed?: boolean;
134
136
  }
135
137
 
136
138
  export default TextField;
@@ -82,7 +82,7 @@ const FieldWrapper = styled.div<{ error: boolean | undefined }>`
82
82
  }
83
83
  `;
84
84
 
85
- const BackgroundIcon = styled.div<{ onClick?: any }>`
85
+ const BackgroundIcon = styled.div<{ onClick?: any; inversed: boolean }>`
86
86
  position: absolute;
87
87
  right: ${(p) => p.theme.spacing.xs};
88
88
  top: 50%;
@@ -90,6 +90,11 @@ const BackgroundIcon = styled.div<{ onClick?: any }>`
90
90
  height: 24px;
91
91
  width: 24px;
92
92
  cursor: ${(p) => (p.onClick ? "pointer" : "default")};
93
+ svg {
94
+ path {
95
+ fill: ${(p) => p.inversed ? p.theme.color.iconNonActive : p.theme.color.interactive01};
96
+ }
97
+ }
93
98
  `;
94
99
 
95
100
  const Prefix = styled.div`
@@ -2,7 +2,7 @@ import React from "react";
2
2
  import { CheckField } from "@ax/components";
3
3
 
4
4
  const UniqueCheck = (props: IProps) => {
5
- const { name, value, options, onChange, disabled } = props;
5
+ const { name, value, options, onChange, disabled, inversed = false } = props;
6
6
  const uniqueOption = options[0];
7
7
 
8
8
  const handleChange = (changeEvt: ICheckEvent) => {
@@ -18,6 +18,7 @@ const UniqueCheck = (props: IProps) => {
18
18
  value={value}
19
19
  onChange={handleChange}
20
20
  disabled={disabled}
21
+ inversed={inversed}
21
22
  />
22
23
  );
23
24
  };
@@ -33,6 +34,7 @@ interface IProps {
33
34
  options: ICheck[];
34
35
  onChange: any;
35
36
  disabled?: boolean;
37
+ inversed?: boolean;
36
38
  }
37
39
 
38
40
  interface ICheck {
@@ -26,6 +26,7 @@ const FieldsBehavior = (props: any): JSX.Element => {
26
26
  deleteError,
27
27
  editorID,
28
28
  objKey,
29
+ inversed = false,
29
30
  } = props;
30
31
  const [showAdvanced, setShowAdvanced] = useState(false);
31
32
  const [errorField, setErrorField] = useState(false);
@@ -40,7 +41,7 @@ const FieldsBehavior = (props: any): JSX.Element => {
40
41
  // eslint-disable-next-line react-hooks/exhaustive-deps
41
42
  }, [editorID, error]);
42
43
 
43
- const helpTextWrapper = message ? <S.HelpText error={errorField}>{message}</S.HelpText> : "";
44
+ const helpTextWrapper = message ? <S.HelpText error={errorField} inversed={inversed}>{message}</S.HelpText> : "";
44
45
  const isComponentArray = fieldType === "ComponentArray";
45
46
  const isComponentContainer = fieldType === "ComponentContainer";
46
47
  const hasMultipleOptions: boolean = whiteList && whiteList.length > 1;
@@ -80,7 +81,7 @@ const FieldsBehavior = (props: any): JSX.Element => {
80
81
 
81
82
  return (
82
83
  <S.Wrapper className={wrapperClass} showTitle={showTitle} id={`gdd_${objKey}`}>
83
- <S.Content error={errorField} data-testid="fields-behavior-wrapper">
84
+ <S.Content error={errorField} inversed={inversed} data-testid="fields-behavior-wrapper">
84
85
  <Field
85
86
  {...props}
86
87
  showAdvanced={showAdvanced}
@@ -91,7 +92,7 @@ const FieldsBehavior = (props: any): JSX.Element => {
91
92
  </S.Content>
92
93
  <S.Header className="fieldHeader">
93
94
  {showTitle && (
94
- <S.Label htmlFor={name} error={errorField}>
95
+ <S.Label htmlFor={name} error={errorField} inversed={inversed}>
95
96
  {title} <Asterisk />
96
97
  </S.Label>
97
98
  )}
@@ -1,21 +1,29 @@
1
1
  import styled from "styled-components";
2
2
 
3
- export const Label = styled.label<{
4
- error: boolean | undefined;
5
- }>`
6
- ${(p) => p.theme.textStyle?.fieldLabel};
7
- color: ${(p) => (p.error === true ? p.theme.color?.error : p.theme.color?.textMediumEmphasis)};
3
+ export const Label = styled.label<{ error: boolean | undefined; inversed: boolean }>`
4
+ ${(p) => p.theme.textStyle.fieldLabel};
5
+ color: ${(p) =>
6
+ p.error === true
7
+ ? p.theme.color.error
8
+ : p.inversed
9
+ ? p.theme.color.textHighEmphasisInverse
10
+ : p.theme.color.textMediumEmphasis};
8
11
  display: block;
9
- margin-bottom: ${(p) => p.theme.spacing?.xs};
12
+ margin-bottom: ${(p) => p.theme.spacing.xs};
10
13
  `;
11
14
 
12
15
  export const Asterisk = styled.span`
13
- color: ${(p) => p.theme.color?.error};
16
+ color: ${(p) => p.theme.color.error};
14
17
  `;
15
18
 
16
- export const HelpText = styled.div<{ error: boolean | undefined }>`
19
+ export const HelpText = styled.div<{ error: boolean | undefined; inversed: boolean }>`
17
20
  ${(p) => p.theme.textStyle.uiXS};
18
- color: ${(p) => (p.error === true ? p.theme.color?.error : p.theme.color?.textMediumEmphasis)};
21
+ color: ${(p) =>
22
+ p.error === true
23
+ ? p.theme.color.error
24
+ : p.inversed
25
+ ? p.theme.color.textMediumEmphasisInverse
26
+ : p.theme.color.textMediumEmphasis};
19
27
  `;
20
28
 
21
29
  export const Header = styled.div`
@@ -34,8 +42,8 @@ export const Icons = styled.div`
34
42
 
35
43
  export const Wrapper = styled.div<{ showTitle: boolean | undefined }>`
36
44
  position: relative;
37
- margin-bottom: ${(p) => p.theme.spacing?.m};
38
- padding-top: ${(p) => (p.showTitle ? p.theme.spacing?.m : 0)};
45
+ margin-bottom: ${(p) => p.theme.spacing.m};
46
+ padding-top: ${(p) => (p.showTitle ? p.theme.spacing.m : 0)};
39
47
  width: 100%;
40
48
 
41
49
  &:hover > .fieldHeader ${Icons} {
@@ -43,25 +51,30 @@ export const Wrapper = styled.div<{ showTitle: boolean | undefined }>`
43
51
  }
44
52
 
45
53
  &.filled {
46
- padding-top: ${(p) => (p.showTitle ? `calc(${p.theme.spacing?.m} + ${p.theme.spacing?.s})` : p.theme.spacing?.s)};
47
- padding-left: ${(p) => p.theme.spacing?.s};
48
- padding-right: ${(p) => p.theme.spacing?.s};
49
- padding-bottom: ${(p) => p.theme.spacing?.xs};
50
- background-color: ${(p) => p.theme.color?.uiBarBackground};
51
- border-radius: ${(p) => p.theme.radii?.s};
52
- box-shadow: ${(p) => p.theme.shadow?.shadowS};
54
+ padding-top: ${(p) => (p.showTitle ? `calc(${p.theme.spacing.m} + ${p.theme.spacing.s})` : p.theme.spacing.s)};
55
+ padding-left: ${(p) => p.theme.spacing.s};
56
+ padding-right: ${(p) => p.theme.spacing.s};
57
+ padding-bottom: ${(p) => p.theme.spacing.xs};
58
+ background-color: ${(p) => p.theme.color.uiBarBackground};
59
+ border-radius: ${(p) => p.theme.radii.s};
60
+ box-shadow: ${(p) => p.theme.shadow.shadowS};
53
61
 
54
62
  ${Header} {
55
- top: ${(p) => p.theme.spacing?.s};
56
- left: ${(p) => p.theme.spacing?.s};
63
+ top: ${(p) => p.theme.spacing.s};
64
+ left: ${(p) => p.theme.spacing.s};
57
65
  }
58
66
  }
59
67
  `;
60
68
 
61
- export const Content = styled.div<{ error: boolean | undefined }>`
69
+ export const Content = styled.div<{ error: boolean | undefined; inversed: boolean }>`
62
70
  &:focus-within {
63
71
  & + div label {
64
- color: ${(p) => (p.error === true ? p.theme.color?.error : p.theme.color?.interactive01)};
72
+ color: ${(p) =>
73
+ p.error === true
74
+ ? p.theme.color.error
75
+ : p.inversed
76
+ ? p.theme.color.textHighEmphasisInverse
77
+ : p.theme.color.interactive01};
65
78
  }
66
79
  }
67
80
  `;
@@ -0,0 +1,16 @@
1
+ import * as React from "react";
2
+
3
+ import * as S from "./style";
4
+
5
+ const Circle = (props: ICircleProps) => {
6
+ const { animation, size = 400 } = props;
7
+
8
+ return <S.Circle animation={animation} size={size} />;
9
+ };
10
+
11
+ interface ICircleProps {
12
+ animation: number;
13
+ size?: number;
14
+ }
15
+
16
+ export default Circle;
@@ -0,0 +1,30 @@
1
+ import styled, { keyframes } from "styled-components";
2
+
3
+ const animation1 = keyframes`
4
+ from { left: 5%; bottom: 10%; }
5
+ to { left: 15%; bottom: 15%; }
6
+ `;
7
+
8
+ const animation2 = keyframes`
9
+ from { right: 5%; top: 10%; }
10
+ to { right: 15%; top: 15%; }
11
+ `;
12
+
13
+ const animations = [animation1, animation2];
14
+ const colors = ["#A950CF", "#FBE15C"];
15
+
16
+
17
+ const Circle = styled.div<{ size: number; animation: number }>`
18
+ position: absolute;
19
+ width: ${(p) => `${p.size}px`};
20
+ height: ${(p) => `${p.size}px`};
21
+ border-radius: 50%;
22
+ filter: blur(50px);
23
+ background-color: ${(p) => colors[p.animation - 1]};
24
+ animation: ${(p) => animations[p.animation - 1]} 5s linear infinite alternate;
25
+ backface-visibility: hidden;
26
+ transform: translate3d(0, 0, 0);
27
+ opacity: 0.6;
28
+ `;
29
+
30
+ export { Circle };
@@ -0,0 +1,63 @@
1
+ import React, { useRef } from "react";
2
+ import Slider from "react-slick";
3
+ import "slick-carousel/slick/slick.css";
4
+
5
+ import * as S from "./style";
6
+
7
+ const LoginSlider = (props: ILoginSliderProps): JSX.Element => {
8
+ const { className } = props;
9
+
10
+ const customSlider = useRef<any>(null);
11
+
12
+ const beforeChange = (prev: number, next: number) => {
13
+ const prevSlideElement = customSlider.current.innerSlider.list.querySelector(`[data-index="${prev}"]`);
14
+ const nextSlideElement = customSlider.current.innerSlider.list.querySelector(`[data-index="${next}"]`);
15
+
16
+ setTimeout(() => {
17
+ prevSlideElement.classList.add('prev-slide-anim');
18
+ nextSlideElement.classList.remove('prev-slide-anim');
19
+ },100);
20
+ }
21
+
22
+ const settings = {
23
+ dots: false,
24
+ arrows: false,
25
+ infinite: true,
26
+ draggable: false,
27
+ speed: 800,
28
+ slidesToShow: 1,
29
+ slidesToScroll: 1,
30
+ beforeChange,
31
+ };
32
+
33
+ const handleNext = () => customSlider.current?.slickNext();
34
+ const handlePrev = () => customSlider.current?.slickPrev();
35
+
36
+ const Banner = ({ text, image }: any) => (
37
+ <S.BannerWrapper>
38
+ <S.Title>{text}</S.Title>
39
+ <S.Image image={image} />
40
+ </S.BannerWrapper>
41
+ );
42
+
43
+ return (
44
+ <S.Wrapper className={className}>
45
+ <S.Buttons>
46
+ <S.Arrow onClick={handlePrev} direction="left" />
47
+ <S.Arrow onClick={handleNext} direction="right" />
48
+ </S.Buttons>
49
+ <Slider {...settings} ref={(slider) => (customSlider.current = slider)}>
50
+ <Banner text="Full independence to publish content at any time" image="/img/slider/content.png" />
51
+ <Banner text="Thousands of possibilities, literally" image="/img/slider/editor.png" />
52
+ {/*<Banner text="Optimized images without any effort" image="/img/slider/gallery.png" />*/}
53
+ <Banner text="Comprehensive integration with Analytics" image="/img/slider/analytics.png" />
54
+ </Slider>
55
+ </S.Wrapper>
56
+ );
57
+ };
58
+
59
+ export interface ILoginSliderProps {
60
+ className: string;
61
+ }
62
+
63
+ export default LoginSlider;