@streamlayer/react-ui 0.1.0

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 (122) hide show
  1. package/README.md +7 -0
  2. package/package.json +38 -0
  3. package/src/index.d.ts +10 -0
  4. package/src/index.js +11 -0
  5. package/src/index.js.map +1 -0
  6. package/src/lib/demo/Gamification.d.ts +7 -0
  7. package/src/lib/demo/Gamification.js +21 -0
  8. package/src/lib/demo/Gamification.js.map +1 -0
  9. package/src/lib/demo/Login.d.ts +5 -0
  10. package/src/lib/demo/Login.js +9 -0
  11. package/src/lib/demo/Login.js.map +1 -0
  12. package/src/lib/demo/components/InPlayGame.d.ts +6 -0
  13. package/src/lib/demo/components/InPlayGame.js +6 -0
  14. package/src/lib/demo/components/InPlayGame.js.map +1 -0
  15. package/src/lib/demo/components/Notifications.d.ts +6 -0
  16. package/src/lib/demo/components/Notifications.js +37 -0
  17. package/src/lib/demo/components/Notifications.js.map +1 -0
  18. package/src/lib/demo/components/Question.d.ts +7 -0
  19. package/src/lib/demo/components/Question.js +61 -0
  20. package/src/lib/demo/components/Question.js.map +1 -0
  21. package/src/lib/demo/components/QuestionsList.d.ts +6 -0
  22. package/src/lib/demo/components/QuestionsList.js +13 -0
  23. package/src/lib/demo/components/QuestionsList.js.map +1 -0
  24. package/src/lib/demo/components/UserSummary.d.ts +5 -0
  25. package/src/lib/demo/components/UserSummary.js +11 -0
  26. package/src/lib/demo/components/UserSummary.js.map +1 -0
  27. package/src/lib/demo/components/index.d.ts +5 -0
  28. package/src/lib/demo/components/index.js +6 -0
  29. package/src/lib/demo/components/index.js.map +1 -0
  30. package/src/lib/demo/index.d.ts +5 -0
  31. package/src/lib/demo/index.js +19 -0
  32. package/src/lib/demo/index.js.map +1 -0
  33. package/src/lib/demo/styles.d.ts +13 -0
  34. package/src/lib/demo/styles.js +14 -0
  35. package/src/lib/demo/styles.js.map +1 -0
  36. package/src/lib/gamification/inapp/index.d.ts +13 -0
  37. package/src/lib/gamification/inapp/index.js +12 -0
  38. package/src/lib/gamification/inapp/index.js.map +1 -0
  39. package/src/lib/gamification/inapp/styles.d.ts +37 -0
  40. package/src/lib/gamification/inapp/styles.js +74 -0
  41. package/src/lib/gamification/inapp/styles.js.map +1 -0
  42. package/src/lib/gamification/login/index.d.ts +6 -0
  43. package/src/lib/gamification/login/index.js +49 -0
  44. package/src/lib/gamification/login/index.js.map +1 -0
  45. package/src/lib/gamification/login/styles.d.ts +29 -0
  46. package/src/lib/gamification/login/styles.js +67 -0
  47. package/src/lib/gamification/login/styles.js.map +1 -0
  48. package/src/lib/gamification/onboarding/index.d.ts +6 -0
  49. package/src/lib/gamification/onboarding/index.js +4 -0
  50. package/src/lib/gamification/onboarding/index.js.map +1 -0
  51. package/src/lib/gamification/onboarding/styles.d.ts +21 -0
  52. package/src/lib/gamification/onboarding/styles.js +41 -0
  53. package/src/lib/gamification/onboarding/styles.js.map +1 -0
  54. package/src/lib/gamification/question/index.d.ts +5 -0
  55. package/src/lib/gamification/question/index.js +28 -0
  56. package/src/lib/gamification/question/index.js.map +1 -0
  57. package/src/lib/gamification/question/styles.d.ts +45 -0
  58. package/src/lib/gamification/question/styles.js +80 -0
  59. package/src/lib/gamification/question/styles.js.map +1 -0
  60. package/src/lib/gamification/question-list/index.d.ts +8 -0
  61. package/src/lib/gamification/question-list/index.js +7 -0
  62. package/src/lib/gamification/question-list/index.js.map +1 -0
  63. package/src/lib/gamification/question-list/styles.d.ts +13 -0
  64. package/src/lib/gamification/question-list/styles.js +25 -0
  65. package/src/lib/gamification/question-list/styles.js.map +1 -0
  66. package/src/lib/gamification/user-statistics/components/rank/index.d.ts +7 -0
  67. package/src/lib/gamification/user-statistics/components/rank/index.js +4 -0
  68. package/src/lib/gamification/user-statistics/components/rank/index.js.map +1 -0
  69. package/src/lib/gamification/user-statistics/components/rank/styles.d.ts +13 -0
  70. package/src/lib/gamification/user-statistics/components/rank/styles.js +20 -0
  71. package/src/lib/gamification/user-statistics/components/rank/styles.js.map +1 -0
  72. package/src/lib/gamification/user-statistics/components/statistics/index.d.ts +7 -0
  73. package/src/lib/gamification/user-statistics/components/statistics/index.js +4 -0
  74. package/src/lib/gamification/user-statistics/components/statistics/index.js.map +1 -0
  75. package/src/lib/gamification/user-statistics/components/statistics/styles.d.ts +9 -0
  76. package/src/lib/gamification/user-statistics/components/statistics/styles.js +14 -0
  77. package/src/lib/gamification/user-statistics/components/statistics/styles.js.map +1 -0
  78. package/src/lib/gamification/user-statistics/index.d.ts +15 -0
  79. package/src/lib/gamification/user-statistics/index.js +14 -0
  80. package/src/lib/gamification/user-statistics/index.js.map +1 -0
  81. package/src/lib/gamification/user-statistics/styles.d.ts +57 -0
  82. package/src/lib/gamification/user-statistics/styles.js +98 -0
  83. package/src/lib/gamification/user-statistics/styles.js.map +1 -0
  84. package/src/lib/gamification/vote/components/voting-header/components/points/index.d.ts +6 -0
  85. package/src/lib/gamification/vote/components/voting-header/components/points/index.js +4 -0
  86. package/src/lib/gamification/vote/components/voting-header/components/points/index.js.map +1 -0
  87. package/src/lib/gamification/vote/components/voting-header/components/points/styles.d.ts +21 -0
  88. package/src/lib/gamification/vote/components/voting-header/components/points/styles.js +30 -0
  89. package/src/lib/gamification/vote/components/voting-header/components/points/styles.js.map +1 -0
  90. package/src/lib/gamification/vote/components/voting-header/components/timer/index.d.ts +8 -0
  91. package/src/lib/gamification/vote/components/voting-header/components/timer/index.js +19 -0
  92. package/src/lib/gamification/vote/components/voting-header/components/timer/index.js.map +1 -0
  93. package/src/lib/gamification/vote/components/voting-header/components/timer/styles.d.ts +7 -0
  94. package/src/lib/gamification/vote/components/voting-header/components/timer/styles.js +6 -0
  95. package/src/lib/gamification/vote/components/voting-header/components/timer/styles.js.map +1 -0
  96. package/src/lib/gamification/vote/components/voting-header/index.d.ts +12 -0
  97. package/src/lib/gamification/vote/components/voting-header/index.js +17 -0
  98. package/src/lib/gamification/vote/components/voting-header/index.js.map +1 -0
  99. package/src/lib/gamification/vote/components/voting-header/styles.d.ts +35 -0
  100. package/src/lib/gamification/vote/components/voting-header/styles.js +54 -0
  101. package/src/lib/gamification/vote/components/voting-header/styles.js.map +1 -0
  102. package/src/lib/gamification/vote/components/voting-option/index.d.ts +16 -0
  103. package/src/lib/gamification/vote/components/voting-option/index.js +11 -0
  104. package/src/lib/gamification/vote/components/voting-option/index.js.map +1 -0
  105. package/src/lib/gamification/vote/components/voting-option/styles.d.ts +49 -0
  106. package/src/lib/gamification/vote/components/voting-option/styles.js +85 -0
  107. package/src/lib/gamification/vote/components/voting-option/styles.js.map +1 -0
  108. package/src/lib/gamification/vote/index.d.ts +13 -0
  109. package/src/lib/gamification/vote/index.js +14 -0
  110. package/src/lib/gamification/vote/index.js.map +1 -0
  111. package/src/lib/gamification/vote/styles.d.ts +29 -0
  112. package/src/lib/gamification/vote/styles.js +50 -0
  113. package/src/lib/gamification/vote/styles.js.map +1 -0
  114. package/src/lib/theme/index.d.ts +4 -0
  115. package/src/lib/theme/index.js +5 -0
  116. package/src/lib/theme/index.js.map +1 -0
  117. package/src/lib/theme/theme.d.ts +41 -0
  118. package/src/lib/theme/theme.js +35 -0
  119. package/src/lib/theme/theme.js.map +1 -0
  120. package/src/utils/login.d.ts +2 -0
  121. package/src/utils/login.js +20 -0
  122. package/src/utils/login.js.map +1 -0
@@ -0,0 +1,13 @@
1
+ /// <reference types="react" />
2
+ import { QuestionType } from '@streamlayer/sdk-web-types';
3
+ interface VoteProps {
4
+ title: string;
5
+ questionId: string;
6
+ options: any[];
7
+ questionType: QuestionType;
8
+ feedbackMessages: any;
9
+ questionAnswered: boolean;
10
+ questionAnsweredCorrectly?: boolean;
11
+ }
12
+ export declare const Vote: React.FC<VoteProps>;
13
+ export {};
@@ -0,0 +1,14 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
+ import { QuestionType } from '@streamlayer/sdk-web-types';
3
+ import checkIcon from '../../../assets/icons/icon-check.svg';
4
+ import closeIcon from '../../../assets/icons/icon-close.svg';
5
+ import { VotingOption } from './components/voting-option';
6
+ import { Container, Title, Options, Feedback, FeedbackIcon, FeedbackTitle, FeedbackDescription } from './styles';
7
+ export const Vote = ({ title, questionId, options, questionAnswered, feedbackMessages, questionAnsweredCorrectly, questionType, }) => {
8
+ return (_jsxs(Container, { children: [_jsx(Title, { children: title }), _jsx(Options, { children: options.map((props) => (_jsx(VotingOption, { questionId: questionId, ...props }, props.id))) }), questionAnswered && questionType === QuestionType.TRIVIA && (_jsxs(Feedback, { children: [_jsx(FeedbackIcon, { alt: "reaction-to-answer", src: questionAnsweredCorrectly ? checkIcon : closeIcon }), _jsxs("div", { children: [_jsx(FeedbackTitle, { children: questionAnsweredCorrectly
9
+ ? feedbackMessages.correctFeedback.title
10
+ : feedbackMessages.incorrectFeedback.title }), _jsx(FeedbackDescription, { children: questionAnsweredCorrectly
11
+ ? feedbackMessages.correctFeedback.description
12
+ : feedbackMessages.incorrectFeedback.description })] })] }))] }));
13
+ };
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/react-ui/src/lib/gamification/vote/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAEzD,OAAO,SAAS,MAAM,sCAAsC,CAAA;AAC5D,OAAO,SAAS,MAAM,sCAAsC,CAAA;AAE5D,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AACzD,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AAWhH,MAAM,CAAC,MAAM,IAAI,GAAwB,CAAC,EACxC,KAAK,EACL,UAAU,EACV,OAAO,EACP,gBAAgB,EAChB,gBAAgB,EAChB,yBAAyB,EACzB,YAAY,GACb,EAAE,EAAE;IACH,OAAO,CACL,MAAC,SAAS,eACR,KAAC,KAAK,cAAE,KAAK,GAAS,EACtB,KAAC,OAAO,cACL,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CACtB,KAAC,YAAY,IAAC,UAAU,EAAE,UAAU,KAAqB,KAAK,IAAnB,KAAK,CAAC,EAAE,CAAe,CACnE,CAAC,GACM,EACT,gBAAgB,IAAI,YAAY,KAAK,YAAY,CAAC,MAAM,IAAI,CAC3D,MAAC,QAAQ,eACP,KAAC,YAAY,IAAC,GAAG,EAAC,oBAAoB,EAAC,GAAG,EAAE,yBAAyB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,GAAiB,EAC9G,0BACE,KAAC,aAAa,cACX,yBAAyB;oCACxB,CAAC,CAAC,gBAAgB,CAAC,eAAe,CAAC,KAAK;oCACxC,CAAC,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,KAAK,GAC9B,EAChB,KAAC,mBAAmB,cACjB,yBAAyB;oCACxB,CAAC,CAAC,gBAAgB,CAAC,eAAe,CAAC,WAAW;oCAC9C,CAAC,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,WAAW,GAC9B,IAClB,IACG,CACZ,IACS,CACb,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,29 @@
1
+ /// <reference types="react" />
2
+ export declare const Container: import("@emotion/styled").StyledComponent<{
3
+ theme?: import("@emotion/react").Theme | undefined;
4
+ as?: import("react").ElementType<any> | undefined;
5
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
6
+ export declare const Title: import("@emotion/styled").StyledComponent<{
7
+ theme?: import("@emotion/react").Theme | undefined;
8
+ as?: import("react").ElementType<any> | undefined;
9
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
10
+ export declare const Options: import("@emotion/styled").StyledComponent<{
11
+ theme?: import("@emotion/react").Theme | undefined;
12
+ as?: import("react").ElementType<any> | undefined;
13
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
14
+ export declare const Feedback: import("@emotion/styled").StyledComponent<{
15
+ theme?: import("@emotion/react").Theme | undefined;
16
+ as?: import("react").ElementType<any> | undefined;
17
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
18
+ export declare const FeedbackIcon: import("@emotion/styled").StyledComponent<{
19
+ theme?: import("@emotion/react").Theme | undefined;
20
+ as?: import("react").ElementType<any> | undefined;
21
+ }, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
22
+ export declare const FeedbackTitle: import("@emotion/styled").StyledComponent<{
23
+ theme?: import("@emotion/react").Theme | undefined;
24
+ as?: import("react").ElementType<any> | undefined;
25
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
26
+ export declare const FeedbackDescription: import("@emotion/styled").StyledComponent<{
27
+ theme?: import("@emotion/react").Theme | undefined;
28
+ as?: import("react").ElementType<any> | undefined;
29
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -0,0 +1,50 @@
1
+ import styled from '@emotion/styled';
2
+ export const Container = styled.div `
3
+ padding: 16px;
4
+ color: ${(props) => props.theme.COLORS.WHITE};
5
+ font-weight: 700;
6
+ font-size: 14px;
7
+
8
+ & > div:not(:last-child) {
9
+ margin-bottom: 16px;
10
+ }
11
+ `;
12
+ export const Title = styled.div `
13
+ font-size: 16px;
14
+ `;
15
+ export const Options = styled.div `
16
+ overflow-y: auto;
17
+ max-height: 220px;
18
+
19
+ & > div:not(:last-child) {
20
+ margin-bottom: 12px;
21
+ }
22
+ `;
23
+ export const Feedback = styled.div `
24
+ padding: 14px 12px 14px 16px;
25
+ display: flex;
26
+ align-items: center;
27
+ `;
28
+ export const FeedbackIcon = styled.img `
29
+ width: 24px;
30
+ height: 24px;
31
+ margin-right: 12px;
32
+ `;
33
+ export const FeedbackTitle = styled.div `
34
+ overflow: hidden;
35
+ text-overflow: ellipsis;
36
+ white-space: nowrap;
37
+ font-size: 16;
38
+ font-weight: 700;
39
+ margin-bottom: 10px;
40
+ `;
41
+ export const FeedbackDescription = styled.div `
42
+ display: -webkit-box;
43
+ -webkit-box-orient: vertical;
44
+ -webkit-line-clamp: 4;
45
+ overflow: hidden;
46
+ text-overflow: ellipsis;
47
+ font-size: 14;
48
+ font-weight: 500;
49
+ `;
50
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../../../../packages/react-ui/src/lib/gamification/vote/styles.tsx"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,iBAAiB,CAAA;AAEpC,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAA;;WAExB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK;;;;;;;CAO7C,CAAA;AAED,MAAM,CAAC,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAA;;CAE9B,CAAA;AAED,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;CAOhC,CAAA;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAA;;;;CAIjC,CAAA;AAED,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAAA;;;;CAIrC,CAAA;AAED,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;CAOtC,CAAA;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;CAQ5C,CAAA"}
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ export declare const StreamLayerThemeProvider: React.FC<{
3
+ children: React.ReactNode;
4
+ }>;
@@ -0,0 +1,5 @@
1
+ import { jsx as _jsx } from "@emotion/react/jsx-runtime";
2
+ import { ThemeProvider } from '@emotion/react';
3
+ import { theme } from './theme';
4
+ export const StreamLayerThemeProvider = ({ children }) => (_jsx(ThemeProvider, { theme: theme, children: children }));
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/react-ui/src/lib/theme/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAE9C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAE/B,MAAM,CAAC,MAAM,wBAAwB,GAA4C,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CACjG,KAAC,aAAa,IAAC,KAAK,EAAE,KAAK,YAAG,QAAQ,GAAiB,CACxD,CAAA"}
@@ -0,0 +1,41 @@
1
+ type COLORS_VARIABLES = keyof (typeof theme)['COLORS'];
2
+ type FONT_VARIABLES = keyof (typeof theme)['FONT'];
3
+ export interface EmotionTheme {
4
+ COLORS: Record<COLORS_VARIABLES, string>;
5
+ FONT: Record<FONT_VARIABLES, string>;
6
+ }
7
+ export declare const theme: {
8
+ COLORS: {
9
+ BG_TRANSPARENT: string;
10
+ BG_TRANSPARENT_VOTE_CONTAINER: string;
11
+ BG_TRANSPARENT_ITEM: string;
12
+ BG_TRANSPARENT_ITEM_VOTE: string;
13
+ BG_TRANSPARENT_ITEM_SUCCESS: string;
14
+ BG_TRANSPARENT_ITEM_ERROR: string;
15
+ BG_TRANSPARENT_VOTE_PROGRESS: string;
16
+ BG_TRANSPARENT_VOTE_PROGRESS_SUCCESS: string;
17
+ BG_TRANSPARENT_VOTE_PROGRESS_ERROR: string;
18
+ BG_TRANSPARENT_USER_CONTAINER: string;
19
+ BLUE_PRIMARY: string;
20
+ RED_PRIMARY: string;
21
+ BLUE_QUESTION_ACTION_BTN: string;
22
+ WHITE: string;
23
+ GREY_1: string;
24
+ GREY_2: string;
25
+ GREY_3: string;
26
+ GREY_4: string;
27
+ BLACK_1: string;
28
+ GREEN_1: string;
29
+ RED_1: string;
30
+ RED_2: string;
31
+ GREY_PRIMARY: string;
32
+ DIVIDER_COLOR_PRIMARY: string;
33
+ DIVIDER_COLOR_SECONDARY: string;
34
+ GREEN_PRIMARY_BTN: string;
35
+ };
36
+ FONT: {
37
+ FAMILY: string;
38
+ COLOR: string;
39
+ };
40
+ };
41
+ export {};
@@ -0,0 +1,35 @@
1
+ export const theme = {
2
+ COLORS: {
3
+ BG_TRANSPARENT: 'rgba(0,0,0, .8)',
4
+ BG_TRANSPARENT_VOTE_CONTAINER: 'rgba(10, 14, 19, 0.8)',
5
+ BG_TRANSPARENT_ITEM: 'rgba(0, 0, 0, 0.7)',
6
+ BG_TRANSPARENT_ITEM_VOTE: 'rgba(255, 255, 255, 0.1)',
7
+ BG_TRANSPARENT_ITEM_SUCCESS: 'rgba(0, 139, 251, 0.2)',
8
+ BG_TRANSPARENT_ITEM_ERROR: 'rgba(205, 37, 37, 0.2)',
9
+ BG_TRANSPARENT_VOTE_PROGRESS: 'rgba(255, 255, 255, 0.2)',
10
+ BG_TRANSPARENT_VOTE_PROGRESS_SUCCESS: 'rgba(60, 139, 251, 0.5)',
11
+ BG_TRANSPARENT_VOTE_PROGRESS_ERROR: 'rgba(205, 37, 37, 0.5)',
12
+ BG_TRANSPARENT_USER_CONTAINER: 'rgba(255, 255, 255, 0.05)',
13
+ BLUE_PRIMARY: '#1589EE',
14
+ RED_PRIMARY: '#CD2525',
15
+ BLUE_QUESTION_ACTION_BTN: '#1589ee',
16
+ WHITE: '#FFFFFF',
17
+ GREY_1: '#909395',
18
+ GREY_2: '#22262b',
19
+ GREY_3: '#2d3135',
20
+ GREY_4: '#53565a',
21
+ BLACK_1: '#161a1f',
22
+ GREEN_1: '#F7B801',
23
+ RED_1: '#A30000',
24
+ RED_2: '#FF4170',
25
+ GREY_PRIMARY: '#909395',
26
+ DIVIDER_COLOR_PRIMARY: '#2d3135',
27
+ DIVIDER_COLOR_SECONDARY: '#53565a',
28
+ GREEN_PRIMARY_BTN: '#009B77',
29
+ },
30
+ FONT: {
31
+ FAMILY: 'Roboto, sans-serif',
32
+ COLOR: '#fff',
33
+ },
34
+ };
35
+ //# sourceMappingURL=theme.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.js","sourceRoot":"","sources":["../../../../../../packages/react-ui/src/lib/theme/theme.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB,MAAM,EAAE;QACN,cAAc,EAAE,iBAAiB;QACjC,6BAA6B,EAAE,uBAAuB;QACtD,mBAAmB,EAAE,oBAAoB;QACzC,wBAAwB,EAAE,0BAA0B;QACpD,2BAA2B,EAAE,wBAAwB;QACrD,yBAAyB,EAAE,wBAAwB;QACnD,4BAA4B,EAAE,0BAA0B;QACxD,oCAAoC,EAAE,yBAAyB;QAC/D,kCAAkC,EAAE,wBAAwB;QAC5D,6BAA6B,EAAE,2BAA2B;QAC1D,YAAY,EAAE,SAAS;QACvB,WAAW,EAAE,SAAS;QACtB,wBAAwB,EAAE,SAAS;QACnC,KAAK,EAAE,SAAS;QAChB,MAAM,EAAE,SAAS;QACjB,MAAM,EAAE,SAAS;QACjB,MAAM,EAAE,SAAS;QACjB,MAAM,EAAE,SAAS;QACjB,OAAO,EAAE,SAAS;QAClB,OAAO,EAAE,SAAS;QAClB,KAAK,EAAE,SAAS;QAChB,KAAK,EAAE,SAAS;QAChB,YAAY,EAAE,SAAS;QACvB,qBAAqB,EAAE,SAAS;QAChC,uBAAuB,EAAE,SAAS;QAClC,iBAAiB,EAAE,SAAS;KAC7B;IACD,IAAI,EAAE;QACJ,MAAM,EAAE,oBAAoB;QAC5B,KAAK,EAAE,MAAM;KACd;CACF,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const requestLoginCode: (phone: string) => Promise<boolean>;
2
+ export declare const login: (phone: string, code: string) => Promise<string | undefined>;
@@ -0,0 +1,20 @@
1
+ import { createGrpcWebTransport } from '@bufbuild/connect-web';
2
+ import { createPromiseClient } from '@connectrpc/connect';
3
+ import { Users } from '@streamlayer/sl-eslib/users/users_connect';
4
+ export const requestLoginCode = async (phone) => {
5
+ const transport = createGrpcWebTransport({
6
+ baseUrl: process.env.NX_GRPC_HOST || 'https://grpc-web.next.streamlayer.io:443',
7
+ });
8
+ const userClient = createPromiseClient(Users, transport);
9
+ await userClient.requestPassword({ id: phone });
10
+ return true;
11
+ };
12
+ export const login = async (phone, code) => {
13
+ const transport = createGrpcWebTransport({
14
+ baseUrl: process.env.NX_GRPC_HOST || 'https://grpc-web.next.streamlayer.io:443',
15
+ });
16
+ const userClient = createPromiseClient(Users, transport);
17
+ const res = await userClient.login({ id: phone, password: code });
18
+ return res?.meta?.jwt;
19
+ };
20
+ //# sourceMappingURL=login.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"login.js","sourceRoot":"","sources":["../../../../../packages/react-ui/src/utils/login.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAA;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AACzD,OAAO,EAAE,KAAK,EAAE,MAAM,2CAA2C,CAAA;AAEjE,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,EAAE,KAAa,EAAE,EAAE;IACtD,MAAM,SAAS,GAAG,sBAAsB,CAAC;QACvC,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,0CAA0C;KAChF,CAAC,CAAA;IAEF,MAAM,UAAU,GAAG,mBAAmB,CAAC,KAAK,EAAE,SAAS,CAAC,CAAA;IAExD,MAAM,UAAU,CAAC,eAAe,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,CAAA;IAE/C,OAAO,IAAI,CAAA;AACb,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,KAAK,GAAG,KAAK,EAAE,KAAa,EAAE,IAAY,EAAE,EAAE;IACzD,MAAM,SAAS,GAAG,sBAAsB,CAAC;QACvC,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,0CAA0C;KAChF,CAAC,CAAA;IAEF,MAAM,UAAU,GAAG,mBAAmB,CAAC,KAAK,EAAE,SAAS,CAAC,CAAA;IAExD,MAAM,GAAG,GAAG,MAAM,UAAU,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAA;IAEjE,OAAO,GAAG,EAAE,IAAI,EAAE,GAAG,CAAA;AACvB,CAAC,CAAA"}