@cuemath/leap 3.0.27 → 3.0.30-j

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 (40) hide show
  1. package/dist/features/auth/comps/auth-page-layout/auth-page-layout-styled.js +21 -0
  2. package/dist/features/auth/comps/auth-page-layout/auth-page-layout-styled.js.map +1 -0
  3. package/dist/features/auth/comps/auth-page-layout/auth-page-layout.js +8 -9
  4. package/dist/features/auth/comps/auth-page-layout/auth-page-layout.js.map +1 -1
  5. package/dist/features/auth/comps/auth-static-panel/auth-static-panel.js +1 -1
  6. package/dist/features/auth/comps/auth-static-panel/auth-static-panel.js.map +1 -1
  7. package/dist/features/auth/forgot-password/forgot-password-styled.js +15 -3
  8. package/dist/features/auth/forgot-password/forgot-password-styled.js.map +1 -1
  9. package/dist/features/auth/forgot-password/otp-form/otp-form.js +29 -29
  10. package/dist/features/auth/forgot-password/otp-form/otp-form.js.map +1 -1
  11. package/dist/features/auth/forgot-password/reset-password-form/reset-password-form.js +2 -4
  12. package/dist/features/auth/forgot-password/reset-password-form/reset-password-form.js.map +1 -1
  13. package/dist/features/auth/forgot-password/user-identifier-form/user-identifier-form.js +13 -15
  14. package/dist/features/auth/forgot-password/user-identifier-form/user-identifier-form.js.map +1 -1
  15. package/dist/features/auth/login/login-styled.js +13 -0
  16. package/dist/features/auth/login/login-styled.js.map +1 -0
  17. package/dist/features/auth/login/social-login-methods/social-login-methods-styled.js +9 -0
  18. package/dist/features/auth/login/social-login-methods/social-login-methods-styled.js.map +1 -0
  19. package/dist/features/auth/login/social-login-methods/social-login-methods.js +43 -34
  20. package/dist/features/auth/login/social-login-methods/social-login-methods.js.map +1 -1
  21. package/dist/features/auth/login/username-password-form/username-password-form.js +22 -21
  22. package/dist/features/auth/login/username-password-form/username-password-form.js.map +1 -1
  23. package/dist/features/hooks/use-device-type.js +25 -0
  24. package/dist/features/hooks/use-device-type.js.map +1 -0
  25. package/dist/features/ui/buttons/button/button-styled.js +29 -29
  26. package/dist/features/ui/buttons/button/button-styled.js.map +1 -1
  27. package/dist/features/ui/error/error.js +20 -20
  28. package/dist/features/ui/error/error.js.map +1 -1
  29. package/dist/features/utils/media.js +16 -0
  30. package/dist/features/utils/media.js.map +1 -0
  31. package/dist/features/worksheet/worksheet/worksheet-helpers.js +57 -58
  32. package/dist/features/worksheet/worksheet/worksheet-helpers.js.map +1 -1
  33. package/dist/features/worksheet/worksheet/worksheet-questions-controller/use-handler-callbacks.js +90 -94
  34. package/dist/features/worksheet/worksheet/worksheet-questions-controller/use-handler-callbacks.js.map +1 -1
  35. package/dist/index.d.ts +19 -4
  36. package/dist/index.js +53 -49
  37. package/dist/index.js.map +1 -1
  38. package/package.json +3 -3
  39. package/dist/features/auth/comps/auth-page-layout/auth-page-layout-styles.js +0 -12
  40. package/dist/features/auth/comps/auth-page-layout/auth-page-layout-styles.js.map +0 -1
@@ -1,12 +1,13 @@
1
1
  import { jsxs as n, jsx as e } from "react/jsx-runtime";
2
2
  import { memo as f, useCallback as l } from "react";
3
3
  import w from "../../../ui/buttons/button/button.js";
4
- import $ from "../../../ui/buttons/text-button/text-button.js";
4
+ import C from "../../../ui/buttons/text-button/text-button.js";
5
5
  import u from "../../../ui/inputs/text-input/text-input.js";
6
6
  import s from "../../../ui/layout/flex-view.js";
7
- import a from "../../../ui/separator/separator.js";
8
- import y from "../../comps/input-status-icon/input-status-icon.js";
9
- const C = ({
7
+ import o from "../../../ui/separator/separator.js";
8
+ import $ from "../../comps/input-status-icon/input-status-icon.js";
9
+ import { FormContainer as y } from "../login-styled.js";
10
+ const k = ({
10
11
  username: i,
11
12
  password: m,
12
13
  errors: r,
@@ -16,28 +17,28 @@ const C = ({
16
17
  onForgotPassword: h
17
18
  }) => {
18
19
  const c = d || !i.trim() || !m.trim(), g = l(
19
- (o) => {
20
- t("username", o.target.value);
20
+ (a) => {
21
+ t("username", a.target.value);
21
22
  },
22
23
  [t]
23
24
  ), b = l(
24
- (o) => {
25
- t("password", o.target.value);
25
+ (a) => {
26
+ t("password", a.target.value);
26
27
  },
27
28
  [t]
28
29
  );
29
30
  return /* @__PURE__ */ n(
30
31
  s,
31
32
  {
32
- $gutterX: 2,
33
+ $gutterX: 1.5,
33
34
  $gapX: 1.5,
34
35
  $alignItems: "center",
35
36
  $justifyContent: "center",
36
37
  $background: "BLACK_2",
37
38
  $height: 308,
38
39
  children: [
39
- /* @__PURE__ */ e(a, { heightX: 0.5 }),
40
- /* @__PURE__ */ n("form", { onSubmit: p, children: [
40
+ /* @__PURE__ */ e(o, { heightX: 0.5 }),
41
+ /* @__PURE__ */ n(y, { onSubmit: p, children: [
41
42
  /* @__PURE__ */ n(s, { $alignItems: "center", $justifyContent: "center", children: [
42
43
  /* @__PURE__ */ e(
43
44
  u,
@@ -47,14 +48,14 @@ const C = ({
47
48
  autoComplete: "username",
48
49
  label: "Username",
49
50
  value: i,
51
+ width: "100%",
50
52
  onChange: g,
51
- width: 330,
52
53
  required: !0,
53
54
  shape: "borderLess",
54
55
  errorMessage: r.username
55
56
  }
56
57
  ),
57
- /* @__PURE__ */ e(a, { height: 36 }),
58
+ /* @__PURE__ */ e(o, { height: 36 }),
58
59
  /* @__PURE__ */ e(
59
60
  u,
60
61
  {
@@ -63,18 +64,18 @@ const C = ({
63
64
  autoComplete: "password",
64
65
  label: "Password",
65
66
  value: m,
67
+ width: "100%",
66
68
  onChange: b,
67
- width: 330,
68
69
  required: !0,
69
70
  shape: "borderLess",
70
71
  errorMessage: r.password,
71
- siblingElement: /* @__PURE__ */ e(y, { isError: !!r.password })
72
+ siblingElement: /* @__PURE__ */ e($, { isError: !!r.password })
72
73
  }
73
74
  )
74
75
  ] }),
75
- /* @__PURE__ */ e(a, { heightX: 1.25 }),
76
- /* @__PURE__ */ e(s, { $alignItems: "flex-end", children: /* @__PURE__ */ e($, { label: "Forgot Password?", onClick: h, color: "WHITE_T_60" }) }),
77
- /* @__PURE__ */ e(a, { heightX: 2 }),
76
+ /* @__PURE__ */ e(o, { heightX: 1.25 }),
77
+ /* @__PURE__ */ e(s, { $alignItems: "flex-end", children: /* @__PURE__ */ e(C, { label: "Forgot Password?", onClick: h, color: "WHITE_T_60" }) }),
78
+ /* @__PURE__ */ e(o, { heightX: 2 }),
78
79
  /* @__PURE__ */ e(s, { $justifyContent: "center", children: /* @__PURE__ */ e(
79
80
  w,
80
81
  {
@@ -82,7 +83,7 @@ const C = ({
82
83
  renderAs: "secondary-dark",
83
84
  type: "submit",
84
85
  label: "Log in",
85
- width: 336,
86
+ width: "100%",
86
87
  busy: d,
87
88
  disabled: c
88
89
  }
@@ -91,8 +92,8 @@ const C = ({
91
92
  ]
92
93
  }
93
94
  );
94
- }, A = f(C);
95
+ }, B = f(k);
95
96
  export {
96
- A as default
97
+ B as default
97
98
  };
98
99
  //# sourceMappingURL=username-password-form.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"username-password-form.js","sources":["../../../../../src/features/auth/login/username-password-form/username-password-form.tsx"],"sourcesContent":["import type { IUsernamePasswordFormProps } from './username-password-form-types';\n\nimport { type ChangeEvent, type FC, memo, useCallback } from 'react';\n\nimport Button from '../../../ui/buttons/button/button';\nimport TextButton from '../../../ui/buttons/text-button/text-button';\nimport TextInput from '../../../ui/inputs/text-input/text-input';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Separator from '../../../ui/separator/separator';\nimport InputStatusIcon from '../../comps/input-status-icon/input-status-icon';\n\nconst UsernamePasswordForm: FC<IUsernamePasswordFormProps> = ({\n username,\n password,\n errors,\n isLoading,\n onChange,\n onSubmit,\n onForgotPassword,\n}) => {\n const isSubmitDisabled = isLoading || !username.trim() || !password.trim();\n\n const handleUsernameChange = useCallback(\n (e: ChangeEvent<HTMLInputElement>) => {\n onChange('username', e.target.value);\n },\n [onChange],\n );\n\n const handlePasswordChange = useCallback(\n (e: ChangeEvent<HTMLInputElement>) => {\n onChange('password', e.target.value);\n },\n [onChange],\n );\n\n return (\n <FlexView\n $gutterX={2}\n $gapX={1.5}\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $background=\"BLACK_2\"\n $height={308}\n >\n <Separator heightX={0.5} />\n <form onSubmit={onSubmit}>\n <FlexView $alignItems=\"center\" $justifyContent=\"center\">\n <TextInput\n renderAs={errors.username ? 'error-dark' : 'primary-dark'}\n autoFocus\n autoComplete=\"username\"\n label=\"Username\"\n value={username}\n onChange={handleUsernameChange}\n width={330}\n required\n shape=\"borderLess\"\n errorMessage={errors.username}\n />\n <Separator height={36} />\n <TextInput\n type=\"password\"\n renderAs={errors.password ? 'error-dark' : 'primary-dark'}\n autoComplete=\"password\"\n label=\"Password\"\n value={password}\n onChange={handlePasswordChange}\n width={330}\n required\n shape=\"borderLess\"\n errorMessage={errors.password}\n siblingElement={<InputStatusIcon isError={!!errors.password} />}\n />\n </FlexView>\n <Separator heightX={1.25} />\n <FlexView $alignItems=\"flex-end\">\n <TextButton label=\"Forgot Password?\" onClick={onForgotPassword} color=\"WHITE_T_60\" />\n </FlexView>\n <Separator heightX={2} />\n <FlexView $justifyContent=\"center\">\n <Button\n size=\"small\"\n renderAs=\"secondary-dark\"\n type=\"submit\"\n label=\"Log in\"\n width={336}\n busy={isLoading}\n disabled={isSubmitDisabled}\n />\n </FlexView>\n </form>\n </FlexView>\n );\n};\n\nexport default memo(UsernamePasswordForm);\n"],"names":["UsernamePasswordForm","username","password","errors","isLoading","onChange","onSubmit","onForgotPassword","isSubmitDisabled","handleUsernameChange","useCallback","e","handlePasswordChange","jsxs","FlexView","jsx","Separator","TextInput","InputStatusIcon","TextButton","Button","usernamePasswordForm","memo"],"mappings":";;;;;;;;AAWA,MAAMA,IAAuD,CAAC;AAAA,EAC5D,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,kBAAAC;AACF,MAAM;AACE,QAAAC,IAAmBJ,KAAa,CAACH,EAAS,UAAU,CAACC,EAAS,QAE9DO,IAAuBC;A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,EAAAG,GAAA,EAAgB,SAAS,CAAC,CAACf,EAAO,UAAU;AAAA,cAAA;AAAA,YAC/D;AAAA,UAAA,GACF;AAAA,UACA,gBAAAY,EAACC,GAAU,EAAA,SAAS,KAAM,CAAA;AAAA,UACzB,gBAAAD,EAAAD,GAAA,EAAS,aAAY,YACpB,UAAC,gBAAAC,EAAAI,GAAA,EAAW,OAAM,oBAAmB,SAASZ,GAAkB,OAAM,aAAa,CAAA,GACrF;AAAA,UACA,gBAAAQ,EAACC,GAAU,EAAA,SAAS,EAAG,CAAA;AAAA,UACvB,gBAAAD,EAACD,GAAS,EAAA,iBAAgB,UACxB,UAAA,gBAAAC;AAAA,YAACK;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,UAAS;AAAA,cACT,MAAK;AAAA,cACL,OAAM;AAAA,cACN,OAAO;AAAA,cACP,MAAMhB;AAAA,cACN,UAAUI;AAAA,YAAA;AAAA,UAAA,GAEd;AAAA,QAAA,GACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN,GAEea,IAAAC,EAAKtB,CAAoB;"}
1
+ {"version":3,"file":"username-password-form.js","sources":["../../../../../src/features/auth/login/username-password-form/username-password-form.tsx"],"sourcesContent":["import type { IUsernamePasswordFormProps } from './username-password-form-types';\n\nimport { type ChangeEvent, type FC, memo, useCallback } from 'react';\n\nimport Button from '../../../ui/buttons/button/button';\nimport TextButton from '../../../ui/buttons/text-button/text-button';\nimport TextInput from '../../../ui/inputs/text-input/text-input';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Separator from '../../../ui/separator/separator';\nimport InputStatusIcon from '../../comps/input-status-icon/input-status-icon';\nimport * as Styled from '../login-styled';\n\nconst UsernamePasswordForm: FC<IUsernamePasswordFormProps> = ({\n username,\n password,\n errors,\n isLoading,\n onChange,\n onSubmit,\n onForgotPassword,\n}) => {\n const isSubmitDisabled = isLoading || !username.trim() || !password.trim();\n\n const handleUsernameChange = useCallback(\n (e: ChangeEvent<HTMLInputElement>) => {\n onChange('username', e.target.value);\n },\n [onChange],\n );\n\n const handlePasswordChange = useCallback(\n (e: ChangeEvent<HTMLInputElement>) => {\n onChange('password', e.target.value);\n },\n [onChange],\n );\n\n return (\n <FlexView\n $gutterX={1.5}\n $gapX={1.5}\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $background=\"BLACK_2\"\n $height={308}\n >\n <Separator heightX={0.5} />\n <Styled.FormContainer onSubmit={onSubmit}>\n <FlexView $alignItems=\"center\" $justifyContent=\"center\">\n <TextInput\n renderAs={errors.username ? 'error-dark' : 'primary-dark'}\n autoFocus\n autoComplete=\"username\"\n label=\"Username\"\n value={username}\n width=\"100%\"\n onChange={handleUsernameChange}\n required\n shape=\"borderLess\"\n errorMessage={errors.username}\n />\n <Separator height={36} />\n <TextInput\n type=\"password\"\n renderAs={errors.password ? 'error-dark' : 'primary-dark'}\n autoComplete=\"password\"\n label=\"Password\"\n value={password}\n width=\"100%\"\n onChange={handlePasswordChange}\n required\n shape=\"borderLess\"\n errorMessage={errors.password}\n siblingElement={<InputStatusIcon isError={!!errors.password} />}\n />\n </FlexView>\n <Separator heightX={1.25} />\n <FlexView $alignItems=\"flex-end\">\n <TextButton label=\"Forgot Password?\" onClick={onForgotPassword} color=\"WHITE_T_60\" />\n </FlexView>\n <Separator heightX={2} />\n <FlexView $justifyContent=\"center\">\n <Button\n size=\"small\"\n renderAs=\"secondary-dark\"\n type=\"submit\"\n label=\"Log in\"\n width=\"100%\"\n busy={isLoading}\n disabled={isSubmitDisabled}\n />\n </FlexView>\n </Styled.FormContainer>\n </FlexView>\n );\n};\n\nexport default memo(UsernamePasswordForm);\n"],"names":["UsernamePasswordForm","username","password","errors","isLoading","onChange","onSubmit","onForgotPassword","isSubmitDisabled","handleUsernameChange","useCallback","e","handlePasswordChange","jsxs","FlexView","jsx","Separator","Styled.FormContainer","TextInput","InputStatusIcon","TextButton","Button","usernamePasswordForm","memo"],"mappings":";;;;;;;;;AAYA,MAAMA,IAAuD,CAAC;A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AAAA,gBACL,UAAUf,EAAO,WAAW,eAAe;AAAA,gBAC3C,cAAa;AAAA,gBACb,OAAM;AAAA,gBACN,OAAOD;AAAA,gBACP,OAAM;AAAA,gBACN,UAAUU;AAAA,gBACV,UAAQ;AAAA,gBACR,OAAM;AAAA,gBACN,cAAcT,EAAO;AAAA,gBACrB,gBAAiB,gBAAAY,EAAAI,GAAA,EAAgB,SAAS,CAAC,CAAChB,EAAO,UAAU;AAAA,cAAA;AAAA,YAC/D;AAAA,UAAA,GACF;AAAA,UACA,gBAAAY,EAACC,GAAU,EAAA,SAAS,KAAM,CAAA;AAAA,UACzB,gBAAAD,EAAAD,GAAA,EAAS,aAAY,YACpB,UAAC,gBAAAC,EAAAK,GAAA,EAAW,OAAM,oBAAmB,SAASb,GAAkB,OAAM,aAAa,CAAA,GACrF;AAAA,UACA,gBAAAQ,EAACC,GAAU,EAAA,SAAS,EAAG,CAAA;AAAA,UACvB,gBAAAD,EAACD,GAAS,EAAA,iBAAgB,UACxB,UAAA,gBAAAC;AAAA,YAACM;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,UAAS;AAAA,cACT,MAAK;AAAA,cACL,OAAM;AAAA,cACN,OAAM;AAAA,cACN,MAAMjB;AAAA,cACN,UAAUI;AAAA,YAAA;AAAA,UAAA,GAEd;AAAA,QAAA,GACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN,GAEec,IAAAC,EAAKvB,CAAoB;"}
@@ -0,0 +1,25 @@
1
+ import { useState as n, useEffect as o } from "react";
2
+ import { getDeviceType as r } from "../utils/media.js";
3
+ const d = () => {
4
+ const [i, s] = n(() => window.innerWidth);
5
+ o(() => {
6
+ function t() {
7
+ s(window.innerWidth);
8
+ }
9
+ return window.addEventListener("resize", t), () => window.removeEventListener("resize", t);
10
+ }, []);
11
+ const e = r(i);
12
+ return {
13
+ width: i,
14
+ isMobile: e === "mobile",
15
+ isTablet: e === "tablet",
16
+ isDesktop: e === "desktop",
17
+ isLarge: e === "large",
18
+ isXL: e === "xl",
19
+ deviceType: e
20
+ };
21
+ }, p = d;
22
+ export {
23
+ p as default
24
+ };
25
+ //# sourceMappingURL=use-device-type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-device-type.js","sources":["../../../src/features/hooks/use-device-type.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\n\nimport { getDeviceType } from '../utils/media';\n\ninterface IUseDeviceTypeReturn {\n width: number;\n isMobile: boolean;\n isTablet: boolean;\n isDesktop: boolean;\n isLarge: boolean;\n isXL: boolean;\n deviceType: 'mobile' | 'tablet' | 'desktop' | 'large' | 'xl';\n}\n\nconst useDeviceType = (): IUseDeviceTypeReturn => {\n const [width, setWidth] = useState(() => window.innerWidth);\n\n useEffect(() => {\n function handleResize() {\n setWidth(window.innerWidth);\n }\n\n window.addEventListener('resize', handleResize);\n\n return () => window.removeEventListener('resize', handleResize);\n }, []);\n\n const deviceType = getDeviceType(width);\n\n return {\n width,\n isMobile: deviceType === 'mobile',\n isTablet: deviceType === 'tablet',\n isDesktop: deviceType === 'desktop',\n isLarge: deviceType === 'large',\n isXL: deviceType === 'xl',\n deviceType,\n };\n};\n\nexport default useDeviceType;\n"],"names":["useDeviceType","width","setWidth","useState","useEffect","handleResize","deviceType","getDeviceType","useDeviceType$1"],"mappings":";;AAcA,MAAMA,IAAgB,MAA4B;AAChD,QAAM,CAACC,GAAOC,CAAQ,IAAIC,EAAS,MAAM,OAAO,UAAU;AAE1D,EAAAC,EAAU,MAAM;AACd,aAASC,IAAe;AACtB,MAAAH,EAAS,OAAO,UAAU;AAAA,IAC5B;AAEO,kBAAA,iBAAiB,UAAUG,CAAY,GAEvC,MAAM,OAAO,oBAAoB,UAAUA,CAAY;AAAA,EAChE,GAAG,CAAE,CAAA;AAEC,QAAAC,IAAaC,EAAcN,CAAK;AAE/B,SAAA;AAAA,IACL,OAAAA;AAAA,IACA,UAAUK,MAAe;AAAA,IACzB,UAAUA,MAAe;AAAA,IACzB,WAAWA,MAAe;AAAA,IAC1B,SAASA,MAAe;AAAA,IACxB,MAAMA,MAAe;AAAA,IACrB,YAAAA;AAAA,EAAA;AAEJ,GAEAE,IAAeR;"}
@@ -1,16 +1,16 @@
1
1
  import u from "styled-components";
2
2
  import x from "../../text/text.js";
3
- const d = u.button(
4
- ({ theme: c, $width: e, $widthX: i, $alignSelf: o, $justifyContent: t, $renderAs: a, $size: n, $shape: $ }) => {
5
- const { button: b, colors: r, layout: p } = c, { backgroundColorName: s, borderColorName: l } = b.variants[a], { height: v, paddingHorizontal: g, borderWidth: h } = b.sizes[n];
3
+ const s = u.button(
4
+ ({ theme: c, $width: t, $widthX: i, $alignSelf: o, $justifyContent: e, $renderAs: a, $size: n, $shape: $ }) => {
5
+ const { button: b, colors: r, layout: p } = c, { backgroundColorName: d, borderColorName: l } = b.variants[a], { height: v, paddingHorizontal: g, borderWidth: h } = b.sizes[n];
6
6
  return `
7
7
  position: relative;
8
8
  display: flex;
9
- justify-content: ${t};
9
+ justify-content: ${e};
10
10
  align-items: center;
11
11
  ${o ? `align-self: ${o};` : ""}
12
12
 
13
- width: ${e ? `${e}px` : "auto"};
13
+ width: ${t ? `${t}` : "auto"}${typeof t == "number" ? "px" : ""};
14
14
  ${i ? `width: ${i * p.gutter}px;` : ""}
15
15
  height: ${v}px;
16
16
  padding: 0 ${g}px;
@@ -19,56 +19,56 @@ const d = u.button(
19
19
  border-radius: ${$ === "curved" ? v / 2 : 0}px;
20
20
  outline: none;
21
21
 
22
- background-color: ${r[s.inactive]};
22
+ background-color: ${r[d.inactive]};
23
23
  border-color: ${r[l.inactive]};
24
24
 
25
25
  transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;
26
26
  cursor: pointer;
27
27
 
28
28
  &:hover {
29
- background-color: ${r[s.active]};
29
+ background-color: ${r[d.active]};
30
30
  border-color: ${r[l.active]};
31
31
  }
32
32
 
33
33
  &:active {
34
- background: ${r[s.inactive]};
34
+ background: ${r[d.inactive]};
35
35
  border-color: ${r[l.inactive]};
36
36
  }
37
37
 
38
38
  &[data-busy="true"] {
39
39
  cursor: wait;
40
- background-color: ${r[s.active]};
40
+ background-color: ${r[d.active]};
41
41
  border-color: ${r[l.active]};
42
42
  }
43
43
 
44
44
  &:disabled {
45
- background-color: ${r[s.disabled]};
45
+ background-color: ${r[d.disabled]};
46
46
  border-color: ${r[l.disabled]};
47
47
  cursor: not-allowed;
48
48
  }
49
49
  `;
50
50
  }
51
- ), k = u(x)(({ theme: c, $buttonRenderAs: e }) => {
52
- const { button: i, colors: o } = c, { colorName: t } = i.variants[e];
51
+ ), f = u(x)(({ theme: c, $buttonRenderAs: t }) => {
52
+ const { button: i, colors: o } = c, { colorName: e } = i.variants[t];
53
53
  return `
54
- color: ${o[t.inactive]};
54
+ color: ${o[e.inactive]};
55
55
  transition: color 0.2s ease-in-out;
56
56
 
57
- ${d}:hover & {
58
- color: ${o[t.active]};
57
+ ${s}:hover & {
58
+ color: ${o[e.active]};
59
59
  }
60
60
 
61
- ${d}:active & {
62
- color: ${o[t.inactive]};
61
+ ${s}:active & {
62
+ color: ${o[e.inactive]};
63
63
  }
64
64
 
65
- ${d}:disabled & {
66
- color: ${o[t.disabled]};
65
+ ${s}:disabled & {
66
+ color: ${o[e.disabled]};
67
67
  opacity: 0.5;
68
68
  }
69
69
  `;
70
- }), f = u.div(({ theme: c, $buttonRenderAs: e, $size: i, $iconPosition: o }) => {
71
- const { button: t, colors: a } = c, { colorName: n } = t.variants[e], { iconSize: $, iconPadding: b } = t.sizes[i];
70
+ }), k = u.div(({ theme: c, $buttonRenderAs: t, $size: i, $iconPosition: o }) => {
71
+ const { button: e, colors: a } = c, { colorName: n } = e.variants[t], { iconSize: $, iconPadding: b } = e.sizes[i];
72
72
  return `
73
73
  ${o === "left" ? "padding-right" : "padding-left"}: ${b}px;
74
74
  order: ${o === "left" ? -1 : 1};
@@ -80,31 +80,31 @@ const d = u.button(
80
80
  color: ${a[n.inactive]};
81
81
  transition: color 0.2s ease-in-out;
82
82
 
83
- ${d}:hover & {
83
+ ${s}:hover & {
84
84
  color: ${a[n.active]};
85
85
  }
86
86
 
87
- ${d}:active & {
87
+ ${s}:active & {
88
88
  color: ${a[n.inactive]};
89
89
  }
90
90
 
91
- ${d}:disabled & {
91
+ ${s}:disabled & {
92
92
  color: ${a[n.disabled]};
93
93
  opacity: 0.5;
94
94
  }
95
95
  }
96
96
  `;
97
- }), z = u.img(({ theme: c, $size: e }) => {
98
- const { button: i } = c, { loaderSize: o } = i.sizes[e];
97
+ }), z = u.img(({ theme: c, $size: t }) => {
98
+ const { button: i } = c, { loaderSize: o } = i.sizes[t];
99
99
  return `
100
100
  width: ${o}px;
101
101
  height: ${o}px;
102
102
  `;
103
103
  });
104
104
  export {
105
- d as Button,
106
- f as Icon,
107
- k as Label,
105
+ s as Button,
106
+ k as Icon,
107
+ f as Label,
108
108
  z as Loader
109
109
  };
110
110
  //# sourceMappingURL=button-styled.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"button-styled.js","sources":["../../../../../src/features/ui/buttons/button/button-styled.tsx"],"sourcesContent":["import type { IButtonProps } from './button-types';\n\nimport styled from 'styled-components';\n\nimport Text from '../../text/text';\n\ninterface IStyledButtonProps {\n $width: IButtonProps['width'];\n $widthX: IButtonProps['widthX'];\n $alignSelf: IButtonProps['alignSelf'];\n $renderAs: IButtonProps['renderAs'];\n $size: Required<IButtonProps>['size'];\n $shape: Required<IButtonProps>['shape'];\n $justifyContent: IButtonProps['justifyContent'];\n}\n\nconst Button = styled.button<IStyledButtonProps>(\n ({ theme, $width, $widthX, $alignSelf, $justifyContent, $renderAs, $size, $shape }) => {\n const { button, colors, layout } = theme;\n const { backgroundColorName, borderColorName } = button.variants[$renderAs];\n const { height, paddingHorizontal, borderWidth } = button.sizes[$size];\n\n return `\n position: relative;\n display: flex;\n justify-content: ${$justifyContent};\n align-items: center;\n ${$alignSelf ? `align-self: ${$alignSelf};` : ''}\n \n width: ${$width ? `${$width}px` : 'auto'};\n ${$widthX ? `width: ${$widthX * layout.gutter}px;` : ''}\n height: ${height}px;\n padding: 0 ${paddingHorizontal}px;\n border-width: ${borderWidth}px;\n border-style: solid;\n border-radius: ${$shape === 'curved' ? height / 2 : 0}px;\n outline: none;\n\n background-color: ${colors[backgroundColorName.inactive]};\n border-color: ${colors[borderColorName.inactive]};\n \n transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;\n cursor: pointer;\n\n &:hover {\n background-color: ${colors[backgroundColorName.active]};\n border-color: ${colors[borderColorName.active]};\n }\n\n &:active {\n background: ${colors[backgroundColorName.inactive]};\n border-color: ${colors[borderColorName.inactive]};\n }\n\n &[data-busy=\"true\"] {\n cursor: wait;\n background-color: ${colors[backgroundColorName.active]};\n border-color: ${colors[borderColorName.active]};\n }\n\n &:disabled {\n background-color: ${colors[backgroundColorName.disabled]};\n border-color: ${colors[borderColorName.disabled]};\n cursor: not-allowed;\n }\n `;\n },\n);\n\ninterface IStyledTextProps {\n $buttonRenderAs: IButtonProps['renderAs'];\n}\n\nconst Label = styled(Text)<IStyledTextProps>(({ theme, $buttonRenderAs }) => {\n const { button, colors } = theme;\n const { colorName } = button.variants[$buttonRenderAs];\n\n return `\n color: ${colors[colorName.inactive]};\n transition: color 0.2s ease-in-out;\n\n ${Button}:hover & {\n color: ${colors[colorName.active]};\n }\n \n ${Button}:active & {\n color: ${colors[colorName.inactive]};\n }\n\n ${Button}:disabled & {\n color: ${colors[colorName.disabled]};\n opacity: 0.5;\n }\n `;\n});\n\ninterface IStyledIconProps {\n $size: NonNullable<IButtonProps['size']>;\n $iconPosition: NonNullable<IButtonProps['iconPosition']>;\n $buttonRenderAs: IButtonProps['renderAs'];\n}\n\nconst Icon = styled.div<IStyledIconProps>(({ theme, $buttonRenderAs, $size, $iconPosition }) => {\n const { button, colors } = theme;\n const { colorName } = button.variants[$buttonRenderAs];\n const { iconSize, iconPadding } = button.sizes[$size];\n\n return `\n ${$iconPosition === 'left' ? 'padding-right' : 'padding-left'}: ${iconPadding}px;\n order: ${$iconPosition === 'left' ? -1 : 1};\n \n & svg {\n display: block;\n width: ${iconSize}px;\n height: ${iconSize}px;\n color: ${colors[colorName.inactive]};\n transition: color 0.2s ease-in-out;\n\n ${Button}:hover & {\n color: ${colors[colorName.active]};\n }\n\n ${Button}:active & {\n color: ${colors[colorName.inactive]};\n }\n\n ${Button}:disabled & {\n color: ${colors[colorName.disabled]};\n opacity: 0.5;\n }\n }\n `;\n});\n\ninterface IStyledLoaderProps {\n $size: Required<IButtonProps>['size'];\n}\n\nconst Loader = styled.img<IStyledLoaderProps>(({ theme, $size }) => {\n const { button } = theme;\n const { loaderSize } = button.sizes[$size];\n\n return `\n width: ${loaderSize}px;\n height: ${loaderSize}px;\n `;\n});\n\nexport { Button, Label, Icon, Loader };\n"],"names":["Button","styled","theme","$width","$widthX","$alignSelf","$justifyContent","$renderAs","$size","$shape","button","colors","layout","backgroundColorName","borderColorName","height","paddingHorizontal","borderWidth","Label","Text","$buttonRenderAs","colorName","Icon","$iconPosition","iconSize","iconPadding","Loader","loaderSize"],"mappings":";;AAgBA,MAAMA,IAASC,EAAO;AAAA,EACpB,CAAC,EAAE,OAAAC,GAAO,QAAAC,GAAQ,SAAAC,GAAS,YAAAC,GAAY,iBAAAC,GAAiB,WAAAC,GAAW,OAAAC,GAAO,QAAAC,QAAa;AACrF,UAAM,EAAE,QAAAC,GAAQ,QAAAC,GAAQ,QAAAC,EAAA,IAAWV,GAC7B,EAAE,qBAAAW,GAAqB,iBAAAC,EAAA,IAAoBJ,EAAO,SAASH,CAAS,GACpE,EAAE,QAAAQ,GAAQ,mBAAAC,GAAmB,aAAAC,EAAgB,IAAAP,EAAO,MAAMF,CAAK;AAE9D,WAAA;AAAA;AAAA;AAAA,yBAGcF,CAAe;AAAA;AAAA,QAEhCD,IAAa,eAAeA,CAAU,MAAM,EAAE;AAAA;AAAA,eAEvCF,IAAS,GAAGA,CAAM,OAAO,MAAM;AAAA,QACtCC,IAAU,UAAUA,IAAUQ,EAAO,M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,iBAAAkB,GAAiB,OAAAZ,GAAO,eAAAe,QAAoB;AACxF,QAAA,EAAE,QAAAb,GAAQ,QAAAC,EAAW,IAAAT,GACrB,EAAE,WAAAmB,EAAc,IAAAX,EAAO,SAASU,CAAe,GAC/C,EAAE,UAAAI,GAAU,aAAAC,EAAA,IAAgBf,EAAO,MAAMF,CAAK;AAE7C,SAAA;AAAA,QACDe,MAAkB,SAAS,kBAAkB,cAAc,KAAKE,CAAW;AAAA,eACpEF,MAAkB,SAAS,KAAK,CAAC;AAAA;AAAA;AAAA;AAAA,iBAI/BC,CAAQ;AAAA,kBACPA,CAAQ;AAAA,iBACTb,EAAOU,EAAU,QAAQ,CAAC;AAAA;AAAA;AAAA,UAGjCrB,CAAM;AAAA,mBACGW,EAAOU,EAAU,MAAM,CAAC;AAAA;AAAA;AAAA,UAGjCrB,CAAM;AAAA,mBACGW,EAAOU,EAAU,QAAQ,CAAC;AAAA;AAAA;AAAA,UAGnCrB,CAAM;AAAA,mBACGW,EAAOU,EAAU,QAAQ,CAAC;AAAA;AAAA;AAAA;AAAA;AAK7C,CAAC,GAMKK,IAASzB,EAAO,IAAwB,CAAC,EAAE,OAAAC,GAAO,OAAAM,QAAY;AAC5D,QAAA,EAAE,QAAAE,EAAW,IAAAR,GACb,EAAE,YAAAyB,EAAe,IAAAjB,EAAO,MAAMF,CAAK;AAElC,SAAA;AAAA,aACImB,CAAU;AAAA,cACTA,CAAU;AAAA;AAExB,CAAC;"}
1
+ {"version":3,"file":"button-styled.js","sources":["../../../../../src/features/ui/buttons/button/button-styled.tsx"],"sourcesContent":["import type { IButtonProps } from './button-types';\n\nimport styled from 'styled-components';\n\nimport Text from '../../text/text';\n\ninterface IStyledButtonProps {\n $width: IButtonProps['width'];\n $widthX: IButtonProps['widthX'];\n $alignSelf: IButtonProps['alignSelf'];\n $renderAs: IButtonProps['renderAs'];\n $size: Required<IButtonProps>['size'];\n $shape: Required<IButtonProps>['shape'];\n $justifyContent: IButtonProps['justifyContent'];\n}\n\nconst Button = styled.button<IStyledButtonProps>(\n ({ theme, $width, $widthX, $alignSelf, $justifyContent, $renderAs, $size, $shape }) => {\n const { button, colors, layout } = theme;\n const { backgroundColorName, borderColorName } = button.variants[$renderAs];\n const { height, paddingHorizontal, borderWidth } = button.sizes[$size];\n\n return `\n position: relative;\n display: flex;\n justify-content: ${$justifyContent};\n align-items: center;\n ${$alignSelf ? `align-self: ${$alignSelf};` : ''}\n \n width: ${$width ? `${$width}` : 'auto'}${typeof $width === 'number' ? 'px' : ''};\n ${$widthX ? `width: ${$widthX * layout.gutter}px;` : ''}\n height: ${height}px;\n padding: 0 ${paddingHorizontal}px;\n border-width: ${borderWidth}px;\n border-style: solid;\n border-radius: ${$shape === 'curved' ? height / 2 : 0}px;\n outline: none;\n\n background-color: ${colors[backgroundColorName.inactive]};\n border-color: ${colors[borderColorName.inactive]};\n \n transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;\n cursor: pointer;\n\n &:hover {\n background-color: ${colors[backgroundColorName.active]};\n border-color: ${colors[borderColorName.active]};\n }\n\n &:active {\n background: ${colors[backgroundColorName.inactive]};\n border-color: ${colors[borderColorName.inactive]};\n }\n\n &[data-busy=\"true\"] {\n cursor: wait;\n background-color: ${colors[backgroundColorName.active]};\n border-color: ${colors[borderColorName.active]};\n }\n\n &:disabled {\n background-color: ${colors[backgroundColorName.disabled]};\n border-color: ${colors[borderColorName.disabled]};\n cursor: not-allowed;\n }\n `;\n },\n);\n\ninterface IStyledTextProps {\n $buttonRenderAs: IButtonProps['renderAs'];\n}\n\nconst Label = styled(Text)<IStyledTextProps>(({ theme, $buttonRenderAs }) => {\n const { button, colors } = theme;\n const { colorName } = button.variants[$buttonRenderAs];\n\n return `\n color: ${colors[colorName.inactive]};\n transition: color 0.2s ease-in-out;\n\n ${Button}:hover & {\n color: ${colors[colorName.active]};\n }\n \n ${Button}:active & {\n color: ${colors[colorName.inactive]};\n }\n\n ${Button}:disabled & {\n color: ${colors[colorName.disabled]};\n opacity: 0.5;\n }\n `;\n});\n\ninterface IStyledIconProps {\n $size: NonNullable<IButtonProps['size']>;\n $iconPosition: NonNullable<IButtonProps['iconPosition']>;\n $buttonRenderAs: IButtonProps['renderAs'];\n}\n\nconst Icon = styled.div<IStyledIconProps>(({ theme, $buttonRenderAs, $size, $iconPosition }) => {\n const { button, colors } = theme;\n const { colorName } = button.variants[$buttonRenderAs];\n const { iconSize, iconPadding } = button.sizes[$size];\n\n return `\n ${$iconPosition === 'left' ? 'padding-right' : 'padding-left'}: ${iconPadding}px;\n order: ${$iconPosition === 'left' ? -1 : 1};\n \n & svg {\n display: block;\n width: ${iconSize}px;\n height: ${iconSize}px;\n color: ${colors[colorName.inactive]};\n transition: color 0.2s ease-in-out;\n\n ${Button}:hover & {\n color: ${colors[colorName.active]};\n }\n\n ${Button}:active & {\n color: ${colors[colorName.inactive]};\n }\n\n ${Button}:disabled & {\n color: ${colors[colorName.disabled]};\n opacity: 0.5;\n }\n }\n `;\n});\n\ninterface IStyledLoaderProps {\n $size: Required<IButtonProps>['size'];\n}\n\nconst Loader = styled.img<IStyledLoaderProps>(({ theme, $size }) => {\n const { button } = theme;\n const { loaderSize } = button.sizes[$size];\n\n return `\n width: ${loaderSize}px;\n height: ${loaderSize}px;\n `;\n});\n\nexport { Button, Label, Icon, Loader };\n"],"names":["Button","styled","theme","$width","$widthX","$alignSelf","$justifyContent","$renderAs","$size","$shape","button","colors","layout","backgroundColorName","borderColorName","height","paddingHorizontal","borderWidth","Label","Text","$buttonRenderAs","colorName","Icon","$iconPosition","iconSize","iconPadding","Loader","loaderSize"],"mappings":";;AAgBA,MAAMA,IAASC,EAAO;AAAA,EACpB,CAAC,EAAE,OAAAC,GAAO,QAAAC,GAAQ,SAAAC,GAAS,YAAAC,GAAY,iBAAAC,GAAiB,WAAAC,GAAW,OAAAC,GAAO,QAAAC,QAAa;AACrF,UAAM,EAAE,QAAAC,GAAQ,QAAAC,GAAQ,QAAAC,EAAA,IAAWV,GAC7B,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AA,aACImB,CAAU;AAAA,cACTA,CAAU;AAAA;AAExB,CAAC;"}
@@ -1,17 +1,17 @@
1
- import { jsxs as o, jsx as r, Fragment as h } from "react/jsx-runtime";
2
- import { useCallback as g } from "react";
3
- import { ILLUSTRATIONS as $ } from "../../../assets/illustrations/illustrations.js";
4
- import p from "../buttons/button/button.js";
5
- import f from "../image/image.js";
6
- import n from "../layout/flex-view.js";
7
- import i from "../text/text.js";
8
- const w = (a) => {
9
- const { height: l, onTryAgain: t, theme: s = "light", title: m, description: c } = a, d = g(() => {
1
+ import { jsxs as o, jsx as r } from "react/jsx-runtime";
2
+ import { useCallback as m } from "react";
3
+ import { ILLUSTRATIONS as c } from "../../../assets/illustrations/illustrations.js";
4
+ import d from "../buttons/button/button.js";
5
+ import h from "../image/image.js";
6
+ import i from "../layout/flex-view.js";
7
+ import n from "../text/text.js";
8
+ const $ = ({ height: a, onTryAgain: t, theme: l = "light" }) => {
9
+ const s = m(() => {
10
10
  t ? t() : window.location.reload();
11
- }, [t]), e = s === "dark" ? "WHITE_T_87" : "BLACK_T_87";
12
- return /* @__PURE__ */ o(n, { $alignItems: "center", $justifyContent: "center", $height: l, children: [
11
+ }, [t]), e = l === "dark" ? "WHITE_T_87" : "BLACK_T_87";
12
+ return /* @__PURE__ */ o(i, { $alignItems: "center", $justifyContent: "center", $height: a, children: [
13
13
  /* @__PURE__ */ r(
14
- n,
14
+ i,
15
15
  {
16
16
  $widthX: 22.5,
17
17
  $heightX: 11.5,
@@ -20,28 +20,28 @@ const w = (a) => {
20
20
  $background: "GREY_1",
21
21
  $justifyContent: "center",
22
22
  $alignItems: "center",
23
- children: /* @__PURE__ */ r(f, { width: 122, height: 100, src: $.ROCKET_BROKEN, withLoader: !1 })
23
+ children: /* @__PURE__ */ r(h, { width: 122, height: 100, src: c.ROCKET_BROKEN, withLoader: !1 })
24
24
  }
25
25
  ),
26
- /* @__PURE__ */ r(i, { $renderAs: "h4", $marginBottomX: 0.5, $color: e, $align: "center", children: m ?? "Oops! Looks like something went wrong" }),
27
- /* @__PURE__ */ r(i, { $renderAs: "body2", $align: "center", $marginBottomX: 1.5, $color: e, children: c ?? /* @__PURE__ */ o(h, { children: [
26
+ /* @__PURE__ */ r(n, { $renderAs: "h4", $marginBottomX: 0.5, $color: e, $align: "center", children: "Oops! Looks like something went wrong" }),
27
+ /* @__PURE__ */ o(n, { $renderAs: "body2", $align: "center", $marginBottomX: 1.5, $color: e, children: [
28
28
  "Please try again. Alternatively if that does not work,",
29
29
  /* @__PURE__ */ r("br", {}),
30
30
  " please contact support."
31
- ] }) }),
31
+ ] }),
32
32
  /* @__PURE__ */ r(
33
- p,
33
+ d,
34
34
  {
35
35
  label: "Try again",
36
- onClick: d,
36
+ onClick: s,
37
37
  renderAs: "primary",
38
38
  size: "small",
39
39
  widthX: 14
40
40
  }
41
41
  )
42
42
  ] });
43
- }, b = w;
43
+ }, T = $;
44
44
  export {
45
- b as default
45
+ T as default
46
46
  };
47
47
  //# sourceMappingURL=error.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"error.js","sources":["../../../../src/features/ui/error/error.tsx"],"sourcesContent":["import React, { useCallback } from 'react';\n\nimport { ILLUSTRATIONS } from '../../../assets/illustrations/illustrations';\nimport Button from '../buttons/button/button';\nimport Image from '../image/image';\nimport FlexView from '../layout/flex-view';\nimport Text from '../text/text';\n\ninterface IErrorProps {\n onTryAgain?: () => void;\n height?: string | number;\n theme?: 'light' | 'dark';\n title?: string;\n description?: string;\n}\n\nconst Error: React.FC<IErrorProps> = props => {\n const { height, onTryAgain, theme = 'light', title, description } = props;\n const handleTryAgain = useCallback(() => {\n if (onTryAgain) {\n onTryAgain();\n } else {\n window.location.reload();\n }\n }, [onTryAgain]);\n\n const textColor = theme === 'dark' ? 'WHITE_T_87' : 'BLACK_T_87';\n\n return (\n <FlexView $alignItems=\"center\" $justifyContent=\"center\" $height={height}>\n <FlexView\n $widthX={22.5}\n $heightX={11.5}\n $borderRadiusX={1}\n $marginBottomX={1.5}\n $background=\"GREY_1\"\n $justifyContent=\"center\"\n $alignItems=\"center\"\n >\n <Image width={122} height={100} src={ILLUSTRATIONS.ROCKET_BROKEN} withLoader={false} />\n </FlexView>\n <Text $renderAs=\"h4\" $marginBottomX={0.5} $color={textColor} $align=\"center\">\n {title ?? 'Oops! Looks like something went wrong'}\n </Text>\n <Text $renderAs=\"body2\" $align=\"center\" $marginBottomX={1.5} $color={textColor}>\n {description ?? (\n <>\n Please try again. Alternatively if that does not work,\n <br /> please contact support.\n </>\n )}\n </Text>\n <Button\n label=\"Try again\"\n onClick={handleTryAgain}\n renderAs=\"primary\"\n size=\"small\"\n widthX={14}\n />\n </FlexView>\n );\n};\n\nexport default Error;\n"],"names":["Error","props","height","onTryAgain","theme","title","description","handleTryAgain","useCallback","textColor","FlexView","jsx","Image","ILLUSTRATIONS","Text","jsxs","Fragment","Button","Error$1"],"mappings":";;;;;;;AAgBA,MAAMA,IAA+B,CAASC,MAAA;AAC5C,QAAM,EAAE,QAAAC,GAAQ,YAAAC,GAAY,OAAAC,IAAQ,SAAS,OAAAC,GAAO,aAAAC,EAAgB,IAAAL,GAC9DM,IAAiBC,EAAY,MAAM;AACvC,IAAIL,IACSA,MAEX,OAAO,SAAS;EAClB,GACC,CAACA,CAAU,CAAC,GAETM,IAAYL,MAAU,SAAS,eAAe;AAEpD,2BACGM,GAAS,EAAA,aAAY,UAAS,iBAAgB,UAAS,SAASR,GAC/D,UAAA;AAAA,IAAA,gBAAAS;AAAA,MAACD;AAAA,MAAA;AAAA,QACC,SAAS;AAAA,QACT,UAAU;AAAA,QACV,gBAAgB;AAAA,QAChB,gBAAgB;AAAA,QAChB,aAAY;AAAA,QACZ,iBAAgB;AAAA,QAChB,aAAY;AAAA,QAEZ,UAAA,gBAAAC,EAACC,GAAM,EAAA,OAAO,KAAK,QAAQ,KAAK,KAAKC,EAAc,eAAe,YAAY,GAAO,CAAA;AAAA,MAAA;AAAA,IACvF;AAAA,IACA,gBAAAF,EAACG,GAAK,EAAA,WAAU,MAAK,gBAAgB,KAAK,QAAQL,GAAW,QAAO,UACjE,UAAAJ,KAAS,wCACZ,CAAA;AAAA,IACA,gBAAAM,EAACG,GAAK,EAAA,WAAU,SAAQ,QAAO,UAAS,gBAAgB,KAAK,QAAQL,GAClE,UAAAH,KACG,gBAAAS,EAAAC,GAAA,EAAA,UAAA;AAAA,MAAA;AAAA,wBAEC,MAAG,EAAA;AAAA,MAAE;AAAA,IAAA,EAAA,CACR,EAEJ,CAAA;AAAA,IACA,gBAAAL;AAAA,MAACM;AAAA,MAAA;AAAA,QACC,OAAM;AAAA,QACN,SAASV;AAAA,QACT,UAAS;AAAA,QACT,MAAK;AAAA,QACL,QAAQ;AAAA,MAAA;AAAA,IACV;AAAA,EACF,EAAA,CAAA;AAEJ,GAEAW,IAAelB;"}
1
+ {"version":3,"file":"error.js","sources":["../../../../src/features/ui/error/error.tsx"],"sourcesContent":["import React, { useCallback } from 'react';\n\nimport { ILLUSTRATIONS } from '../../../assets/illustrations/illustrations';\nimport Button from '../buttons/button/button';\nimport Image from '../image/image';\nimport FlexView from '../layout/flex-view';\nimport Text from '../text/text';\n\ninterface IErrorProps {\n onTryAgain?: () => void;\n height?: string | number;\n theme?: 'light' | 'dark';\n}\n\nconst Error: React.FC<IErrorProps> = ({ height, onTryAgain, theme = 'light' }) => {\n const handleTryAgain = useCallback(() => {\n if (onTryAgain) {\n onTryAgain();\n } else {\n window.location.reload();\n }\n }, [onTryAgain]);\n\n const textColor = theme === 'dark' ? 'WHITE_T_87' : 'BLACK_T_87';\n\n return (\n <FlexView $alignItems=\"center\" $justifyContent=\"center\" $height={height}>\n <FlexView\n $widthX={22.5}\n $heightX={11.5}\n $borderRadiusX={1}\n $marginBottomX={1.5}\n $background=\"GREY_1\"\n $justifyContent=\"center\"\n $alignItems=\"center\"\n >\n <Image width={122} height={100} src={ILLUSTRATIONS.ROCKET_BROKEN} withLoader={false} />\n </FlexView>\n <Text $renderAs=\"h4\" $marginBottomX={0.5} $color={textColor} $align=\"center\">\n Oops! Looks like something went wrong\n </Text>\n <Text $renderAs=\"body2\" $align=\"center\" $marginBottomX={1.5} $color={textColor}>\n Please try again. Alternatively if that does not work,\n <br /> please contact support.\n </Text>\n <Button\n label=\"Try again\"\n onClick={handleTryAgain}\n renderAs=\"primary\"\n size=\"small\"\n widthX={14}\n />\n </FlexView>\n );\n};\n\nexport default Error;\n"],"names":["Error","height","onTryAgain","theme","handleTryAgain","useCallback","textColor","FlexView","jsx","Image","ILLUSTRATIONS","Text","jsxs","Button","Error$1"],"mappings":";;;;;;;AAcA,MAAMA,IAA+B,CAAC,EAAE,QAAAC,GAAQ,YAAAC,GAAY,OAAAC,IAAQ,cAAc;AAC1E,QAAAC,IAAiBC,EAAY,MAAM;AACvC,IAAIH,IACSA,MAEX,OAAO,SAAS;EAClB,GACC,CAACA,CAAU,CAAC,GAETI,IAAYH,MAAU,SAAS,eAAe;AAEpD,2BACGI,GAAS,EAAA,aAAY,UAAS,iBAAgB,UAAS,SAASN,GAC/D,UAAA;AAAA,IAAA,gBAAAO;AAAA,MAACD;AAAA,MAAA;AAAA,QACC,SAAS;AAAA,QACT,UAAU;AAAA,QACV,gBAAgB;AAAA,QAChB,gBAAgB;AAAA,QAChB,aAAY;AAAA,QACZ,iBAAgB;AAAA,QAChB,aAAY;AAAA,QAEZ,UAAA,gBAAAC,EAACC,GAAM,EAAA,OAAO,KAAK,QAAQ,KAAK,KAAKC,EAAc,eAAe,YAAY,GAAO,CAAA;AAAA,MAAA;AAAA,IACvF;AAAA,IACA,gBAAAF,EAACG,GAAK,EAAA,WAAU,MAAK,gBAAgB,KAAK,QAAQL,GAAW,QAAO,UAAS,UAE7E,wCAAA,CAAA;AAAA,IACA,gBAAAM,EAACD,KAAK,WAAU,SAAQ,QAAO,UAAS,gBAAgB,KAAK,QAAQL,GAAW,UAAA;AAAA,MAAA;AAAA,wBAE7E,MAAG,EAAA;AAAA,MAAE;AAAA,IAAA,GACR;AAAA,IACA,gBAAAE;AAAA,MAACK;AAAA,MAAA;AAAA,QACC,OAAM;AAAA,QACN,SAAST;AAAA,QACT,UAAS;AAAA,QACT,MAAK;AAAA,QACL,QAAQ;AAAA,MAAA;AAAA,IACV;AAAA,EACF,EAAA,CAAA;AAEJ,GAEAU,IAAed;"}
@@ -0,0 +1,16 @@
1
+ const e = {
2
+ mobile: 480,
3
+ tablet: 760,
4
+ desktop: 920,
5
+ large: 1200,
6
+ xl: 1424
7
+ }, t = (r) => r < e.mobile || r >= e.mobile && r < e.tablet ? "mobile" : r >= e.tablet && r < e.desktop ? "tablet" : r >= e.desktop && r < e.large ? "desktop" : r >= e.large && r < e.xl ? "large" : (r >= e.xl, "xl"), l = {
8
+ up920: `@media (min-width: ${e.desktop}px)`,
9
+ down919: `@media (max-width: ${e.desktop - 1}px)`
10
+ };
11
+ export {
12
+ e as BREAKPOINTS,
13
+ t as getDeviceType,
14
+ l as media
15
+ };
16
+ //# sourceMappingURL=media.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"media.js","sources":["../../../src/features/utils/media.ts"],"sourcesContent":["export const BREAKPOINTS = {\n mobile: 480,\n tablet: 760,\n desktop: 920,\n large: 1200,\n xl: 1424,\n};\nexport type TDeviceType = 'mobile' | 'tablet' | 'desktop' | 'large' | 'xl';\n\nexport const getDeviceType = (width: number): TDeviceType => {\n if (width < BREAKPOINTS.mobile) return 'mobile';\n\n if (width >= BREAKPOINTS.mobile && width < BREAKPOINTS.tablet) return 'mobile';\n\n if (width >= BREAKPOINTS.tablet && width < BREAKPOINTS.desktop) return 'tablet';\n\n if (width >= BREAKPOINTS.desktop && width < BREAKPOINTS.large) return 'desktop';\n\n if (width >= BREAKPOINTS.large && width < BREAKPOINTS.xl) return 'large';\n\n if (width >= BREAKPOINTS.xl) return 'xl';\n\n return 'xl';\n};\n\nexport const media = {\n up920: `@media (min-width: ${BREAKPOINTS.desktop}px)`,\n down919: `@media (max-width: ${BREAKPOINTS.desktop - 1}px)`,\n};\n"],"names":["BREAKPOINTS","getDeviceType","width","media"],"mappings":"AAAO,MAAMA,IAAc;AAAA,EACzB,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,OAAO;AAAA,EACP,IAAI;AACN,GAGaC,IAAgB,CAACC,MACxBA,IAAQF,EAAY,UAEpBE,KAASF,EAAY,UAAUE,IAAQF,EAAY,SAAe,WAElEE,KAASF,EAAY,UAAUE,IAAQF,EAAY,UAAgB,WAEnEE,KAASF,EAAY,WAAWE,IAAQF,EAAY,QAAc,YAElEE,KAASF,EAAY,SAASE,IAAQF,EAAY,KAAW,WAE7DE,KAASF,EAAY,IAAW,OAKzBG,IAAQ;AAAA,EACnB,OAAO,sBAAsBH,EAAY,OAAO;AAAA,EAChD,SAAS,sBAAsBA,EAAY,UAAU,CAAC;AACxD;"}