@streamlayer/react-ui 0.47.0 → 0.48.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 (33) hide show
  1. package/lib/index.js +34 -32
  2. package/lib/ui/app/Features/Gamification/Question.js +22 -56
  3. package/lib/ui/app/Features/Gamification/index.js +12 -9
  4. package/lib/ui/app/Features/index.js +11 -8
  5. package/lib/ui/app/masters.js +11 -8
  6. package/lib/ui/demo/Gamification.js +6 -4
  7. package/lib/ui/demo/Highlights.js +6 -4
  8. package/lib/ui/demo/components/Question.js +22 -20
  9. package/lib/ui/demo/components/index.js +18 -16
  10. package/lib/ui/demo/index.js +6 -4
  11. package/lib/ui/gamification/detail/sponsor/index.d.ts +4 -0
  12. package/lib/ui/gamification/detail/sponsor/index.js +14 -0
  13. package/lib/ui/gamification/vote/feedback/index.d.ts +14 -0
  14. package/lib/ui/gamification/vote/feedback/index.js +33 -0
  15. package/lib/ui/gamification/vote/feedback/styles.d.ts +8 -0
  16. package/lib/ui/gamification/vote/feedback/styles.js +70 -0
  17. package/lib/ui/gamification/vote/index.d.ts +3 -8
  18. package/lib/ui/gamification/vote/index.js +62 -49
  19. package/lib/ui/gamification/vote/styles.d.ts +1 -5
  20. package/lib/ui/gamification/vote/styles.js +18 -53
  21. package/lib/ui/gamification/vote/vote-option/index.d.ts +9 -17
  22. package/lib/ui/gamification/vote/vote-option/index.js +53 -5
  23. package/lib/ui/gamification/vote/vote-option/styles.d.ts +12 -8
  24. package/lib/ui/gamification/vote/vote-option/styles.js +119 -66
  25. package/lib/ui/icons/index.d.ts +2 -0
  26. package/lib/ui/icons/index.js +22 -20
  27. package/package.json +10 -10
  28. package/lib/index-7f3361f2.js +0 -71
  29. package/lib/ui/gamification/vote/types.d.js +0 -1
  30. /package/lib/ui/gamification/{vote → detail}/header/index.d.ts +0 -0
  31. /package/lib/ui/gamification/{vote → detail}/header/index.js +0 -0
  32. /package/lib/ui/gamification/{vote → detail}/header/styles.d.ts +0 -0
  33. /package/lib/ui/gamification/{vote → detail}/header/styles.js +0 -0
@@ -0,0 +1,70 @@
1
+ import { styled as r } from "@linaria/react";
2
+ import { SvgIcon as e } from "../../../icons/index.js";
3
+ import "react/jsx-runtime";
4
+ import "react";
5
+ const c = r.div`
6
+ width: 100%;
7
+ padding: 8px 0px;
8
+ display: flex;
9
+ align-items: center;
10
+ margin-bottom: 16px;
11
+ font-size: 14px;
12
+
13
+ &[data-isPrediction='true'] {
14
+ align-items: flex-start;
15
+ }
16
+ `, n = r(e)`
17
+ min-width: 24px;
18
+ width: 24px;
19
+ height: 24px;
20
+ margin-right: 14px;
21
+ margin-left: 12px;
22
+
23
+ g > path {
24
+ fill: var(--color-primary-green1);
25
+ fill-opacity: 1;
26
+ }
27
+ `, d = r.div`
28
+ min-width: 32px;
29
+ width: 32px;
30
+ height: 32px;
31
+ border-radius: 50%;
32
+ display: flex;
33
+ align-items: center;
34
+ justify-content: center;
35
+ margin-right: 16px;
36
+
37
+ &[data-feedbackType='correct'] {
38
+ background-color: var(--color-primary-green1);
39
+ }
40
+
41
+ &[data-feedbackType='incorrect'] {
42
+ background-color: var(--color-secondary-red1);
43
+ }
44
+ `, p = r.div`
45
+ font-weight: var(--font-weight-default);
46
+ `, l = r.span`
47
+ margin-right: 5px;
48
+
49
+ &[data-feedbackType='correct'] {
50
+ color: var(--color-primary-green1);
51
+ }
52
+
53
+ &[data-feedbackType='incorrect'] {
54
+ color: var(--color-secondary-red1);
55
+ }
56
+ `, g = r.span`
57
+ color: var(--color-neutrals-gray9);
58
+ `, s = r.div`
59
+ font-weight: 400;
60
+ margin-top: 10px;
61
+ `;
62
+ export {
63
+ c as Container,
64
+ g as FeedbackDescription,
65
+ p as FeedbackHeader,
66
+ d as FeedbackIconWrap,
67
+ s as FeedbackText,
68
+ l as FeedbackTitle,
69
+ n as IconPrediction
70
+ };
@@ -1,13 +1,8 @@
1
1
  /// <reference types="react" />
2
- import { QuestionType } from '@streamlayer/sdk-web-types';
2
+ import { ExtendedQuestion } from '@streamlayer/sdk-web-types';
3
3
  interface VoteProps {
4
- title: string;
5
- questionId: string;
6
- options: any[];
7
- questionType: QuestionType;
8
- feedbackMessages: any;
9
- questionAnswered: boolean;
10
- questionAnsweredCorrectly?: boolean;
4
+ openedQuestion: ExtendedQuestion;
5
+ vote: (questionId: string, answerId: string) => void;
11
6
  }
12
7
  export declare const Vote: React.FC<VoteProps>;
13
8
  export {};
@@ -1,58 +1,71 @@
1
- import { jsxs as c, jsx as i } from "react/jsx-runtime";
2
- import { useState as p, useCallback as s, useEffect as b } from "react";
3
- import { QuestionType as N } from "@streamlayer/sdk-web-types";
4
- import { V as S, c as D } from "../../../index-7f3361f2.js";
5
- import { Container as j, Title as M, Options as h, Loader as u, Feedback as Z, FeedbackIcon as L, FeedbackTitle as T, FeedbackDescription as z } from "./styles.js";
6
- import { WinBar as G } from "./win-bar/index.js";
7
- import "./vote-option/styles.js";
1
+ import { jsx as s, jsxs as A } from "react/jsx-runtime";
2
+ import { useState as e, useCallback as C, useMemo as l } from "react";
3
+ import { Feedback as b } from "./feedback/index.js";
4
+ import { Container as E, Content as M, Title as j, Options as k } from "./styles.js";
5
+ import { VotingOption as O } from "./vote-option/index.js";
6
+ import { WinBar as I } from "./win-bar/index.js";
7
+ import "@streamlayer/sdk-web-types";
8
+ import "../../icons/index.js";
8
9
  import "@linaria/react";
10
+ import "./feedback/styles.js";
11
+ import "./vote-option/styles.js";
9
12
  import "../../timer/index.js";
10
13
  import "react-countdown-circle-timer";
11
14
  import "../../theme/constants.js";
12
15
  import "./win-bar/styles.js";
13
- import "../../icons/index.js";
14
- const A = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3QgeT0iMC4wMDE5NTMxMiIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiByeD0iMTIiIGZpbGw9IiNGODAwMjIiLz4KPHJlY3QgeD0iOC4yNSIgeT0iNy4wMDE5NSIgd2lkdGg9IjEyLjM3NDQiIGhlaWdodD0iMS43Njc3NyIgcng9IjAuODgzODg0IiB0cmFuc2Zvcm09InJvdGF0ZSg0NSA4LjI1IDcuMDAxOTUpIiBmaWxsPSJ3aGl0ZSIvPgo8cmVjdCB4PSI3IiB5PSIxNS43NTIiIHdpZHRoPSIxMi4zNzQ0IiBoZWlnaHQ9IjEuNzY3NzciIHJ4PSIwLjg4Mzg4NCIgdHJhbnNmb3JtPSJyb3RhdGUoLTQ1IDcgMTUuNzUyKSIgZmlsbD0id2hpdGUiLz4KPC9zdmc+Cg==", W = ({
15
- title: m,
16
- questionId: a,
17
- options: r,
18
- questionAnswered: l,
19
- feedbackMessages: I,
20
- questionAnsweredCorrectly: t,
21
- questionType: d
22
- }) => {
23
- const [g, n] = p(!1), e = s(
24
- (o) => {
25
- n(o);
16
+ const X = ({ openedQuestion: r, vote: f }) => {
17
+ var V;
18
+ const d = r.subject, q = r.type, a = (V = r.options) == null ? void 0 : V.options, [n, v] = e(!1), [w, T] = e(!1), [y, g] = e(""), m = r == null ? void 0 : r.id, p = C(
19
+ async (t) => {
20
+ if (m) {
21
+ const c = t.currentTarget.value;
22
+ g(c), T(!0), await f(m, c), T(!1);
23
+ }
26
24
  },
27
- [n]
28
- );
29
- return b(() => {
30
- e(!1);
31
- }, [r, e]), /* @__PURE__ */ c(j, { children: [
32
- /* @__PURE__ */ i(G, { title: "To win", points: 100, isTimer: !0 }),
33
- /* @__PURE__ */ i(M, { children: m }),
34
- /* @__PURE__ */ c(h, { children: [
35
- g && /* @__PURE__ */ i(u, { children: "Loading..." }),
36
- r.map((o) => /* @__PURE__ */ i(
37
- S,
38
- {
39
- toggleIsLoadingSubmitAnswer: e,
40
- questionId: a,
41
- questionType: d,
42
- ...o
43
- },
44
- o.id
45
- ))
46
- ] }),
47
- l && d === N.TRIVIA && /* @__PURE__ */ c(Z, { children: [
48
- /* @__PURE__ */ i(L, { alt: "reaction-to-answer", src: t ? D : A }),
49
- /* @__PURE__ */ c("div", { children: [
50
- /* @__PURE__ */ i(T, { children: t ? I.correctFeedback.title : I.incorrectFeedback.title }),
51
- /* @__PURE__ */ i(z, { children: t ? I.correctFeedback.description : I.incorrectFeedback.description })
52
- ] })
53
- ] })
54
- ] });
25
+ [m, g, f]
26
+ ), i = l(
27
+ () => r == null ? void 0 : r.answers.find((t) => t.youVoted === !0),
28
+ [r]
29
+ ), o = l(
30
+ () => !!(r != null && r.answers.find((t) => t.correct === !0)),
31
+ [r]
32
+ ), h = l(() => r ? r.answers.map((t) => {
33
+ var c;
34
+ return {
35
+ ...t,
36
+ questionVoted: !!i,
37
+ youSelected: y === t.id,
38
+ isLoading: w,
39
+ hasCorrectAnswer: o,
40
+ questionType: r.type,
41
+ imageMode: (c = r.notification) == null ? void 0 : c.imageMode,
42
+ onVote: p
43
+ };
44
+ }) : [], [o, w, r, i, p, y]), x = a && (a.case === "trivia" || a.case === "prediction") ? a.value : void 0;
45
+ return /* @__PURE__ */ s(E, { children: /* @__PURE__ */ A(M, { children: [
46
+ x && /* @__PURE__ */ s(
47
+ b,
48
+ {
49
+ feedbackMessages: x,
50
+ questionVoted: !!i,
51
+ questionVotedCorrectly: i == null ? void 0 : i.correct,
52
+ questionType: q,
53
+ hasCorrectAnswer: o
54
+ }
55
+ ),
56
+ /* @__PURE__ */ s(
57
+ I,
58
+ {
59
+ title: n ? "Expired" : "To win",
60
+ points: n ? void 0 : 100,
61
+ onTimerExpired: () => v(!0),
62
+ isTimer: !0
63
+ }
64
+ ),
65
+ /* @__PURE__ */ s(j, { children: d }),
66
+ /* @__PURE__ */ s(k, { children: h.map((t) => /* @__PURE__ */ s(O, { ...t }, t.id)) })
67
+ ] }) });
55
68
  };
56
69
  export {
57
- W as Vote
70
+ X as Vote
58
71
  };
@@ -1,9 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  export declare const Container: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
3
+ export declare const Content: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
3
4
  export declare const Title: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
4
5
  export declare const Options: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
5
- export declare const Loader: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
6
- export declare const Feedback: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
7
- export declare const FeedbackIcon: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLImageElement> & import("react").ImgHTMLAttributes<HTMLImageElement> & Record<never, unknown>>;
8
- export declare const FeedbackTitle: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
9
- export declare const FeedbackDescription: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
@@ -1,65 +1,30 @@
1
1
  import { styled as t } from "@linaria/react";
2
- const e = t.div`
3
- padding: 16px;
4
- color: #fff;
2
+ const o = t.div`
5
3
  width: 100%;
6
- font-weight: 700;
7
- font-size: 14px;
4
+ height: 100%;
8
5
 
9
6
  & > div:not(:last-child) {
10
7
  margin-bottom: 16px;
11
8
  }
12
- `, o = t.div`
13
- font-size: 16px;
14
9
  `, n = t.div`
15
- overflow-y: auto;
16
- max-height: 220px;
17
- position: relative;
18
-
19
- & > div:not(:last-child) {
20
- margin-bottom: 12px;
21
- }
22
- `, d = t.div`
23
- position: absolute;
24
- left: 0px;
25
- background-color: var(--color-transparent-vote-container);
26
10
  width: 100%;
27
- height: 100%;
28
- z-index: 1;
29
- display: flex;
30
- justify-content: center;
31
- align-items: center;
32
- `, a = t.div`
33
- padding: 14px 12px 14px 16px;
11
+ padding: 0px 16px;
12
+ `, r = t.div`
13
+ font-family: var(--font-serif);
14
+ font-size: 16px;
15
+ color: var(--color-primary-green2);
16
+ font-weight: 400;
17
+ margin: 16px 0px;
18
+ margin-bottom: 16px;
19
+ `, e = t.div`
20
+ position: relative;
21
+ gap: 8px;
34
22
  display: flex;
35
- align-items: center;
36
- `, l = t.img`
37
- width: 24px;
38
- height: 24px;
39
- margin-right: 12px;
40
- `, p = t.div`
41
- overflow: hidden;
42
- text-overflow: ellipsis;
43
- white-space: nowrap;
44
- font-size: 16;
45
- font-weight: 700;
46
- margin-bottom: 10px;
47
- `, s = t.div`
48
- display: -webkit-box;
49
- -webkit-box-orient: vertical;
50
- -webkit-line-clamp: 4;
51
- overflow: hidden;
52
- text-overflow: ellipsis;
53
- font-size: 14;
54
- font-weight: 500;
23
+ flex-direction: column;
55
24
  `;
56
25
  export {
57
- e as Container,
58
- a as Feedback,
59
- s as FeedbackDescription,
60
- l as FeedbackIcon,
61
- p as FeedbackTitle,
62
- d as Loader,
63
- n as Options,
64
- o as Title
26
+ o as Container,
27
+ n as Content,
28
+ e as Options,
29
+ r as Title
65
30
  };
@@ -1,20 +1,12 @@
1
1
  /// <reference types="react" />
2
- import { QuestionType } from '@streamlayer/sdk-web-types';
3
- interface VotingOptionProps {
4
- icon: string;
5
- title: string;
6
- id: string;
7
- questionId: string;
8
- percentage: number;
9
- disabled: boolean;
10
- correct: boolean;
11
- questionAnswered: boolean;
12
- hasCorrectAnswer: boolean;
13
- answered: boolean;
14
- points: number;
2
+ import { QuestionType, QuestionImages, ExtendedQuestionAnswer } from '@streamlayer/sdk-web-types';
3
+ export type VotingOptionProps = ExtendedQuestionAnswer & {
4
+ questionVoted: boolean;
5
+ youSelected: boolean;
6
+ isLoading: boolean;
7
+ hasCorrectAnswer?: boolean;
15
8
  questionType: QuestionType;
16
- onVote: (questionId: string, answerId: string) => void;
17
- toggleIsLoadingSubmitAnswer: (flag: boolean) => void;
18
- }
9
+ imageMode?: QuestionImages;
10
+ onVote: (e: React.MouseEvent<HTMLButtonElement>) => void;
11
+ };
19
12
  export declare const VotingOption: React.FC<VotingOptionProps>;
20
- export {};
@@ -1,8 +1,56 @@
1
- import "react/jsx-runtime";
2
- import "@streamlayer/sdk-web-types";
3
- import { V as n } from "../../../../index-7f3361f2.js";
4
- import "./styles.js";
1
+ import { jsx as n, jsxs as s } from "react/jsx-runtime";
2
+ import { QuestionImages as c, QuestionType as o } from "@streamlayer/sdk-web-types";
3
+ import { IconDefault as T, IconContainer as C, IconWrap as R, IconCircle as S, ButtonContainer as w, ButtonPct as D, ButtonBody as O, Title as P, Indicators as A, CheckIcon as x, Percentage as B } from "./styles.js";
5
4
  import "@linaria/react";
5
+ import "../../../icons/index.js";
6
+ import "react";
7
+ const d = {
8
+ [c.CENTERED]: (t) => /* @__PURE__ */ n(T, { alt: "option-icon", src: t }),
9
+ [c.TRANSPARENT]: (t) => /* @__PURE__ */ n(C, { children: /* @__PURE__ */ n(R, { style: { backgroundImage: `url(${t})` } }) }),
10
+ [c.ROUNDED]: (t) => /* @__PURE__ */ n(S, { alt: "option-icon", src: t }),
11
+ [c.NONE]: () => null,
12
+ [c.UNSET]: () => null
13
+ }, k = ({ questionType: t, hasCorrectAnswer: l, correct: e, youVoted: r, questionVoted: i }) => t === o.POLL ? r ? "correct" : "unset" : t === o.PREDICTION ? l ? r ? e ? "correct" : "incorrect" : e ? "correct" : "unset" : "correct" : t === o.TRIVIA && i ? r ? e ? "correct" : "incorrect" : e ? "correct" : "unset" : "unset", U = (t) => {
14
+ var p;
15
+ const {
16
+ // option props
17
+ id: l,
18
+ icon: e,
19
+ text: r,
20
+ percentageDecimal: i,
21
+ // extra props
22
+ onVote: g,
23
+ youSelected: h,
24
+ questionVoted: u,
25
+ imageMode: I,
26
+ isLoading: E,
27
+ questionType: m
28
+ } = t, a = k(t), N = m === o.TRIVIA || m === o.PREDICTION, f = a === "correct" ? "correct" : a === "incorrect" ? "incorrect" : "";
29
+ return /* @__PURE__ */ s(
30
+ w,
31
+ {
32
+ value: l,
33
+ "data-selected": h,
34
+ "data-answerState": a,
35
+ disabled: u || E,
36
+ onClick: g,
37
+ children: [
38
+ u && /* @__PURE__ */ n(D, { "data-answerState": a, style: { width: `${i}%` } }),
39
+ /* @__PURE__ */ s(O, { children: [
40
+ e && I && ((p = d[I]) == null ? void 0 : p.call(d, e)),
41
+ /* @__PURE__ */ n(P, { children: r }),
42
+ u && /* @__PURE__ */ s(A, { children: [
43
+ N && f && /* @__PURE__ */ n(x, { name: f }),
44
+ /* @__PURE__ */ s(B, { children: [
45
+ i,
46
+ "%"
47
+ ] })
48
+ ] })
49
+ ] })
50
+ ]
51
+ }
52
+ );
53
+ };
6
54
  export {
7
- n as VotingOption
55
+ U as VotingOption
8
56
  };
@@ -1,13 +1,17 @@
1
1
  /// <reference types="react" />
2
- export declare const Container: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
3
- export declare const AnsweredContainer: import("@linaria/react").StyledMeta & import("react").FunctionComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown> & {
4
- as?: import("react").ElementType<any> | undefined;
5
- }>;
2
+ export declare const ButtonContainer: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & Record<never, unknown>>;
6
3
  export declare const ButtonPct: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
7
- export declare const Button: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & Record<never, unknown>>;
4
+ export declare const ButtonBody: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement> & Record<never, unknown>>;
5
+ export declare const IconContainer: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
6
+ export declare const IconWrap: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
8
7
  export declare const Icon: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLImageElement> & import("react").ImgHTMLAttributes<HTMLImageElement> & Record<never, unknown>>;
8
+ export declare const IconDefault: import("@linaria/react").StyledMeta & import("react").FunctionComponent<import("react").ClassAttributes<HTMLImageElement> & import("react").ImgHTMLAttributes<HTMLImageElement> & Record<never, unknown> & {
9
+ as?: import("react").ElementType<any> | undefined;
10
+ }>;
11
+ export declare const IconCircle: import("@linaria/react").StyledMeta & import("react").FunctionComponent<import("react").ClassAttributes<HTMLImageElement> & import("react").ImgHTMLAttributes<HTMLImageElement> & Record<never, unknown> & {
12
+ as?: import("react").ElementType<any> | undefined;
13
+ }>;
9
14
  export declare const Title: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement> & Record<never, unknown>>;
10
15
  export declare const Indicators: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement> & Record<never, unknown>>;
11
- export declare const CheckIconWrap: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
12
- export declare const Percentage: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
13
- export declare const CheckIcon: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLImageElement> & import("react").ImgHTMLAttributes<HTMLImageElement> & Record<never, unknown>>;
16
+ export declare const Percentage: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement> & Record<never, unknown>>;
17
+ export declare const CheckIcon: any;
@@ -1,96 +1,149 @@
1
- import { styled as r } from "@linaria/react";
2
- const o = r.div`
1
+ import { styled as o } from "@linaria/react";
2
+ import { SvgIcon as t } from "../../../icons/index.js";
3
+ import "react/jsx-runtime";
4
+ import "react";
5
+ const c = o.button`
6
+ background-color: var(--color-neutrals-gray2);
7
+ border: 1px solid transparent;
3
8
  box-sizing: border-box;
4
9
  border-radius: 4px;
5
- background-color: var(--color-bg-transparent-item-vote);
6
- border: 2px solid transparent;
7
10
  position: relative;
11
+ max-height: 44px;
12
+ min-height: 44px;
13
+ height: 44px;
14
+ width: 100%;
8
15
 
9
- &[data-questionAnswered='false'] {
10
- &:hover {
11
- border-color: inherit;
12
- }
16
+ &:hover:not(:disabled) {
17
+ border-color: var(--color-neutrals-gray5);
18
+ }
19
+
20
+ &[data-selected='true'] {
21
+ border-color: var(--color-neutrals-gray9);
22
+ background-color: var(--color-white);
13
23
  }
14
- `, t = r(o)`
15
- border: 2px solid;
16
24
 
17
- &[data-answeredCorrect='true'] {
18
- background-color: var(--color-transparent-item-success);
19
- border-color: var(--color-blue-primary);
25
+ &[data-answerState='correct'] {
26
+ position: relative;
27
+ border-color: var(--color-primary-green1);
20
28
 
21
- &:hover {
22
- border-color: var(--color-blue-primary);
29
+ &:before {
30
+ content: '';
31
+ top: 0;
32
+ left: 0;
33
+ opacity: 0.1;
34
+ display: block;
35
+ width: inherit;
36
+ height: inherit;
37
+ position: absolute;
38
+ background-color: var(--color-primary-green1);
23
39
  }
24
40
  }
25
41
 
26
- &[data-answeredCorrect='false'] {
27
- background-color: var(--color-transparent-item-error);
28
- border-color: var(--color-red-primary);
42
+ &[data-answerState='incorrect'] {
43
+ position: relative;
44
+ border-color: var(--color-secondary-red1);
29
45
 
30
- &:hover {
31
- border-color: var(--color-red-primary);
46
+ &:before {
47
+ content: '';
48
+ top: 0;
49
+ left: 0;
50
+ opacity: 0.1;
51
+ display: block;
52
+ width: inherit;
53
+ height: inherit;
54
+ position: absolute;
55
+ background-color: var(--color-secondary-red1);
32
56
  }
33
57
  }
34
- `, i = r.div`
58
+
59
+ &[data-isNotChecked='true'] {
60
+ border-color: var(--color-neutrals-gray3);
61
+ background-color: var(--color-white);
62
+ }
63
+ `, l = o.div`
64
+ transition: width 1s ease-in;
35
65
  position: absolute;
66
+ border-radius: 3px;
67
+ height: 100%;
68
+ z-index: 0;
36
69
  left: 0;
70
+
71
+ background-color: var(--color-neutrals-gray3);
72
+
73
+ &[data-answerState='correct'] {
74
+ background-color: var(--color-primary-green1);
75
+ opacity: 0.3;
76
+ }
77
+
78
+ &[data-answerState='incorrect'] {
79
+ background-color: var(--color-secondary-red1);
80
+ opacity: 0.3;
81
+ }
82
+
83
+ &[data-answerState='unset'] {
84
+ background-color: var(--color-neutrals-gray3);
85
+ }
86
+ `, d = o.span`
87
+ font-weight: var(--font-weight-default);
88
+ color: var(--color-neutrals-gray9);
89
+ font-family: var(--font-regular);
90
+ background-color: transparent;
91
+ padding: 5px 15px 5px 9px;
92
+ align-items: center;
37
93
  border-radius: 2px;
38
- z-index: 0;
39
- height: 100%;
40
- background-color: inherit;
41
- transition: all 1s ease-in;
42
- `, n = r.button`
43
- border-radius: 20px;
44
94
  position: relative;
45
- background-color: transparent;
46
- padding: 0px 16px;
95
+ font-size: 12px;
96
+ outline: none;
47
97
  display: flex;
48
- align-items: center;
98
+ height: 100%;
49
99
  border: none;
50
- outline: none;
51
100
  width: 100%;
52
- color: var(--color-white);
53
- font-weight: 700;
54
- font-size: 14px;
55
- height: 100%;
56
- border-radius: 2px;
57
- cursor: pointer;
58
-
59
- &:disabled {
60
- cursor: default;
61
- }
62
- `, a = r.img`
63
- width: 32px;
101
+ `, s = o.div`
102
+ width: 60px;
103
+ `, p = o.div`
104
+ position: absolute;
105
+ left: 0;
106
+ bottom: 0;
107
+ background-repeat: no-repeat;
108
+ background-size: contain;
109
+ width: 52px;
110
+ height: 52px;
111
+ `, r = o.img`
112
+ margin-right: 8px;
113
+ `, g = o(r)`
64
114
  height: 32px;
115
+ width: 32px;
116
+ `, h = o(r)`
65
117
  border-radius: 50%;
66
- margin-right: 8px;
67
- `, d = r.span`
118
+ height: 32px;
119
+ width: 32px;
120
+ `, u = o.span`
68
121
  overflow: hidden;
69
- word-break: break-all;
70
- padding: 12px 0px;
71
- flex: 1;
72
122
  text-align: left;
73
- `, s = r.span`
123
+ white-space: nowrap;
124
+ text-overflow: ellipsis;
125
+ flex: 1;
126
+ `, b = o.span`
74
127
  display: flex;
75
- `, c = r.div`
76
- width: 16px;
77
- height: 16px;
128
+ `, x = o.span`
129
+ margin-left: 8px;
130
+ line-height: 17px;
131
+ `, v = o(t)`
78
132
  margin-left: 8px;
79
- `, l = r.div`
80
- margin-left: 12px;
81
- `, p = r.img`
82
- width: 16px;
83
133
  height: 16px;
134
+ width: 16px;
84
135
  `;
85
136
  export {
86
- t as AnsweredContainer,
87
- n as Button,
88
- i as ButtonPct,
89
- p as CheckIcon,
90
- c as CheckIconWrap,
91
- o as Container,
92
- a as Icon,
93
- s as Indicators,
94
- l as Percentage,
95
- d as Title
137
+ d as ButtonBody,
138
+ c as ButtonContainer,
139
+ l as ButtonPct,
140
+ v as CheckIcon,
141
+ r as Icon,
142
+ h as IconCircle,
143
+ s as IconContainer,
144
+ g as IconDefault,
145
+ p as IconWrap,
146
+ b as Indicators,
147
+ x as Percentage,
148
+ u as Title
96
149
  };
@@ -30,6 +30,8 @@ export declare const icons: {
30
30
  'icon-btn-leaderboard': any;
31
31
  'icon-check': any;
32
32
  'icon-arrow': any;
33
+ correct: any;
34
+ incorrect: any;
33
35
  };
34
36
  export declare const Icon: React.FC<{
35
37
  name: keyof typeof icons;