@cuemath/leap 3.5.17-as1 → 3.5.17-as2
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.
- package/dist/features/timeline/comps/accordion-item/accordion-item.js +29 -29
- package/dist/features/timeline/comps/accordion-item/accordion-item.js.map +1 -1
- package/dist/features/timeline/comps/utils.js +9 -9
- package/dist/features/timeline/comps/utils.js.map +1 -1
- package/dist/features/ui/buttons/text-button/text-button-styled.js +11 -9
- package/dist/features/ui/buttons/text-button/text-button-styled.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,59 +1,59 @@
|
|
|
1
1
|
import { jsxs as t, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { memo as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
2
|
+
import { memo as S, useMemo as K, useCallback as $ } from "react";
|
|
3
|
+
import u from "../../../ui/buttons/text-button/text-button.js";
|
|
4
|
+
import l from "../../../ui/layout/flex-view.js";
|
|
5
5
|
import d from "../../../ui/text/text.js";
|
|
6
|
-
import { getStateConf as
|
|
7
|
-
import { BLOCK_TYPE as
|
|
8
|
-
import { CODING_ACTIVITY_NODE_TYPES as
|
|
9
|
-
import { NODE_STATE as
|
|
10
|
-
import { NODE_TYPES as
|
|
11
|
-
const
|
|
6
|
+
import { getStateConf as N } from "../utils.js";
|
|
7
|
+
import { BLOCK_TYPE as g } from "../../../chapters-v2/constants/block-constants.js";
|
|
8
|
+
import { CODING_ACTIVITY_NODE_TYPES as O } from "../constants.js";
|
|
9
|
+
import { NODE_STATE as k, CARD_TYPE as P, USER_TYPE as i } from "../../daily-timeline-types.js";
|
|
10
|
+
import { NODE_TYPES as Y } from "../../../../types/models/worksheet.js";
|
|
11
|
+
const G = S(
|
|
12
12
|
({ type: T, userType: o, card: s, onPuzzleClick: n, onReviewClick: m }) => {
|
|
13
13
|
const {
|
|
14
|
-
label:
|
|
15
|
-
title:
|
|
14
|
+
label: b,
|
|
15
|
+
title: h,
|
|
16
16
|
state: E,
|
|
17
17
|
subtext: _,
|
|
18
18
|
user_node_id: a,
|
|
19
19
|
block_type: p,
|
|
20
|
-
user_block_id:
|
|
20
|
+
user_block_id: C,
|
|
21
21
|
node_type: f
|
|
22
|
-
} = s, c = p ===
|
|
22
|
+
} = s, c = p === g.SAT_MOCK_TEST, x = f === Y.PUZZLE_CARD, [A, w, B] = N(E), r = E === k.COMPLETED, D = K(() => T === P.CIRCLE ? !1 : o === i.TEACHER ? !c || r : o === i.STUDENT ? r && !O.includes(
|
|
23
23
|
f
|
|
24
|
-
) : !1, [o, T, c, r, f]), I = r && (o ===
|
|
24
|
+
) : !1, [o, T, c, r, f]), I = r && (o === i.STUDENT || o === i.PARENT) || o === i.TEACHER, L = $(() => {
|
|
25
25
|
n == null || n(s);
|
|
26
|
-
}, [n, s]),
|
|
27
|
-
m && a && m(a, c,
|
|
28
|
-
}, [c, m,
|
|
29
|
-
return /* @__PURE__ */ t(
|
|
30
|
-
/* @__PURE__ */ e(
|
|
31
|
-
/* @__PURE__ */ t(
|
|
26
|
+
}, [n, s]), R = $(() => {
|
|
27
|
+
m && a && m(a, c, C);
|
|
28
|
+
}, [c, m, C, a]);
|
|
29
|
+
return /* @__PURE__ */ t(l, { $flexDirection: "row", $flexGapX: 1.5, children: [
|
|
30
|
+
/* @__PURE__ */ e(l, { $justifyContent: "flex-end", $height: 18, $background: "WHITE", children: /* @__PURE__ */ e(l, { $background: w, $borderColor: "BLACK_1", $borderRadiusX: 0.8, children: A && /* @__PURE__ */ e(A, { width: 14, height: 14, color: B }) }) }),
|
|
31
|
+
/* @__PURE__ */ t(l, { $flexRowGapX: 0.25, children: [
|
|
32
32
|
/* @__PURE__ */ t(d, { $renderAs: "ub2", $color: "BLACK_1", children: [
|
|
33
33
|
/* @__PURE__ */ t(d, { $renderAs: "ub2-bold", $inline: !0, $color: "BLACK_1", children: [
|
|
34
|
-
|
|
34
|
+
b,
|
|
35
35
|
":"
|
|
36
36
|
] }),
|
|
37
37
|
" ",
|
|
38
|
-
|
|
38
|
+
h
|
|
39
39
|
] }),
|
|
40
40
|
x ? I ? /* @__PURE__ */ e(
|
|
41
|
-
|
|
41
|
+
u,
|
|
42
42
|
{
|
|
43
43
|
label: r ? "View reviewed puzzle" : "View assigned puzzle",
|
|
44
44
|
size: "small",
|
|
45
45
|
color: "BLACK_T_60",
|
|
46
|
-
onClick:
|
|
46
|
+
onClick: L
|
|
47
47
|
}
|
|
48
|
-
) : /* @__PURE__ */ e(d, { $renderAs: "ub3", $color: "BLACK_T_60", children: _ }) : /* @__PURE__ */ t(
|
|
48
|
+
) : /* @__PURE__ */ e(d, { $renderAs: "ub3", $color: "BLACK_T_60", children: _ }) : /* @__PURE__ */ t(l, { $flexDirection: "row", $flexGapX: 0.75, $alignItems: "center", children: [
|
|
49
49
|
_ && /* @__PURE__ */ e(d, { $renderAs: "ub3", $color: "BLACK_T_60", children: _ }),
|
|
50
50
|
D && /* @__PURE__ */ e(
|
|
51
|
-
|
|
51
|
+
u,
|
|
52
52
|
{
|
|
53
53
|
label: "Review",
|
|
54
54
|
size: "small",
|
|
55
55
|
color: "BLACK_T_60",
|
|
56
|
-
onClick:
|
|
56
|
+
onClick: R
|
|
57
57
|
}
|
|
58
58
|
)
|
|
59
59
|
] })
|
|
@@ -61,8 +61,8 @@ const Y = B(
|
|
|
61
61
|
] });
|
|
62
62
|
}
|
|
63
63
|
);
|
|
64
|
-
|
|
64
|
+
G.displayName = "AccordionItem";
|
|
65
65
|
export {
|
|
66
|
-
|
|
66
|
+
G as default
|
|
67
67
|
};
|
|
68
68
|
//# sourceMappingURL=accordion-item.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accordion-item.js","sources":["../../../../../src/features/timeline/comps/accordion-item/accordion-item.tsx"],"sourcesContent":["import { memo, useCallback, useMemo, type FC } from 'react';\n\nimport TextButton from '../../../ui/buttons/text-button/text-button';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Text from '../../../ui/text/text';\nimport type { IAccordionItemProps } from './accordion-item-types';\nimport { getStateConf } from '../utils';\nimport { BLOCK_TYPE } from '../../../chapters-v2/constants/block-constants';\nimport { type TColorNames } from '../../../ui/types';\nimport { CODING_ACTIVITY_NODE_TYPES } from '../constants';\nimport { CARD_TYPE, NODE_STATE, USER_TYPE } from '../../daily-timeline-types';\nimport { NODE_TYPES } from '../../../../types/models/worksheet';\n\nconst AccordionItem: FC<IAccordionItemProps> = memo(\n ({ type, userType, card, onPuzzleClick, onReviewClick }) => {\n const {\n label,\n title,\n state,\n subtext,\n user_node_id: userNodeId,\n block_type: blockType,\n user_block_id: userBlockId,\n node_type: nodeType,\n } = card;\n const isSatMockTestBlock = blockType === BLOCK_TYPE.SAT_MOCK_TEST;\n const isPuzzleCard = nodeType === NODE_TYPES.PUZZLE_CARD;\n const [Icon, bgColor] = getStateConf(state) as [FC<React.SVGProps<SVGSVGElement
|
|
1
|
+
{"version":3,"file":"accordion-item.js","sources":["../../../../../src/features/timeline/comps/accordion-item/accordion-item.tsx"],"sourcesContent":["import { memo, useCallback, useMemo, type FC } from 'react';\n\nimport TextButton from '../../../ui/buttons/text-button/text-button';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Text from '../../../ui/text/text';\nimport type { IAccordionItemProps } from './accordion-item-types';\nimport { getStateConf } from '../utils';\nimport { BLOCK_TYPE } from '../../../chapters-v2/constants/block-constants';\nimport { type TColorNames } from '../../../ui/types';\nimport { CODING_ACTIVITY_NODE_TYPES } from '../constants';\nimport { CARD_TYPE, NODE_STATE, USER_TYPE } from '../../daily-timeline-types';\nimport { NODE_TYPES } from '../../../../types/models/worksheet';\n\nconst AccordionItem: FC<IAccordionItemProps> = memo(\n ({ type, userType, card, onPuzzleClick, onReviewClick }) => {\n const {\n label,\n title,\n state,\n subtext,\n user_node_id: userNodeId,\n block_type: blockType,\n user_block_id: userBlockId,\n node_type: nodeType,\n } = card;\n const isSatMockTestBlock = blockType === BLOCK_TYPE.SAT_MOCK_TEST;\n const isPuzzleCard = nodeType === NODE_TYPES.PUZZLE_CARD;\n const [Icon, bgColor, color] = getStateConf(state) as [\n FC<React.SVGProps<SVGSVGElement>>,\n TColorNames,\n TColorNames,\n ];\n const isCompleted = state === NODE_STATE.COMPLETED;\n const shouldShowReview = useMemo(() => {\n if (type === CARD_TYPE.CIRCLE) return false;\n\n if (userType === USER_TYPE.TEACHER) return !isSatMockTestBlock || isCompleted;\n\n if (userType === USER_TYPE.STUDENT)\n return (\n isCompleted &&\n !CODING_ACTIVITY_NODE_TYPES.includes(\n nodeType as (typeof CODING_ACTIVITY_NODE_TYPES)[number],\n )\n );\n\n return false;\n }, [userType, type, isSatMockTestBlock, isCompleted, nodeType]);\n\n const canReviewPuzzle =\n (isCompleted && (userType === USER_TYPE.STUDENT || userType === USER_TYPE.PARENT)) ||\n userType === USER_TYPE.TEACHER;\n\n const handlePuzzleClick = useCallback(() => {\n onPuzzleClick?.(card);\n }, [onPuzzleClick, card]);\n\n const handleReviewClick = useCallback(() => {\n if (onReviewClick && userNodeId) {\n onReviewClick(userNodeId, isSatMockTestBlock, userBlockId);\n }\n }, [isSatMockTestBlock, onReviewClick, userBlockId, userNodeId]);\n\n return (\n <FlexView $flexDirection=\"row\" $flexGapX={1.5}>\n <FlexView $justifyContent=\"flex-end\" $height={18} $background=\"WHITE\">\n <FlexView $background={bgColor} $borderColor=\"BLACK_1\" $borderRadiusX={0.8}>\n {Icon && <Icon width={14} height={14} color={color} />}\n </FlexView>\n </FlexView>\n <FlexView $flexRowGapX={0.25}>\n <Text $renderAs=\"ub2\" $color=\"BLACK_1\">\n <Text $renderAs=\"ub2-bold\" $inline $color=\"BLACK_1\">\n {label}:\n </Text>{' '}\n {title}\n </Text>\n {isPuzzleCard ? (\n canReviewPuzzle ? (\n <TextButton\n label={isCompleted ? 'View reviewed puzzle' : 'View assigned puzzle'}\n size=\"small\"\n color=\"BLACK_T_60\"\n onClick={handlePuzzleClick}\n />\n ) : (\n <Text $renderAs=\"ub3\" $color=\"BLACK_T_60\">\n {subtext}\n </Text>\n )\n ) : (\n <FlexView $flexDirection=\"row\" $flexGapX={0.75} $alignItems=\"center\">\n {subtext && (\n <Text $renderAs=\"ub3\" $color=\"BLACK_T_60\">\n {subtext}\n </Text>\n )}\n {shouldShowReview && (\n <TextButton\n label=\"Review\"\n size=\"small\"\n color=\"BLACK_T_60\"\n onClick={handleReviewClick}\n />\n )}\n </FlexView>\n )}\n </FlexView>\n </FlexView>\n );\n },\n);\n\nAccordionItem.displayName = 'AccordionItem';\n\nexport default AccordionItem;\n"],"names":["AccordionItem","memo","type","userType","card","onPuzzleClick","onReviewClick","label","title","state","subtext","userNodeId","blockType","userBlockId","nodeType","isSatMockTestBlock","BLOCK_TYPE","isPuzzleCard","NODE_TYPES","Icon","bgColor","color","getStateConf","isCompleted","NODE_STATE","shouldShowReview","useMemo","CARD_TYPE","USER_TYPE","CODING_ACTIVITY_NODE_TYPES","canReviewPuzzle","handlePuzzleClick","useCallback","handleReviewClick","jsxs","FlexView","jsx","Text","TextButton"],"mappings":";;;;;;;;;;AAaA,MAAMA,IAAyCC;AAAA,EAC7C,CAAC,EAAE,MAAAC,GAAM,UAAAC,GAAU,MAAAC,GAAM,eAAAC,GAAe,eAAAC,QAAoB;AACpD,UAAA;AAAA,MACJ,OAAAC;AAAA,MACA,OAAAC;AAAA,MACA,OAAAC;AAAA,MACA,SAAAC;AAAA,MACA,cAAcC;AAAA,MACd,YAAYC;AAAA,MACZ,eAAeC;AAAA,MACf,WAAWC;AAAA,IACT,IAAAV,GACEW,IAAqBH,MAAcI,EAAW,eAC9CC,IAAeH,MAAaI,EAAW,aACvC,CAACC,GAAMC,GAASC,CAAK,IAAIC,EAAab,CAAK,GAK3Cc,IAAcd,MAAUe,EAAW,WACnCC,IAAmBC,EAAQ,MAC3BxB,MAASyB,EAAU,SAAe,KAElCxB,MAAayB,EAAU,UAAgB,CAACb,KAAsBQ,IAE9DpB,MAAayB,EAAU,UAEvBL,KACA,CAACM,EAA2B;AAAA,MAC1Bf;AAAA,IAAA,IAIC,IACN,CAACX,GAAUD,GAAMa,GAAoBQ,GAAaT,CAAQ,CAAC,GAExDgB,IACHP,MAAgBpB,MAAayB,EAAU,WAAWzB,MAAayB,EAAU,WAC1EzB,MAAayB,EAAU,SAEnBG,IAAoBC,EAAY,MAAM;AAC1C,MAAA3B,KAAA,QAAAA,EAAgBD;AAAA,IAAI,GACnB,CAACC,GAAeD,CAAI,CAAC,GAElB6B,IAAoBD,EAAY,MAAM;AAC1C,MAAI1B,KAAiBK,KACLL,EAAAK,GAAYI,GAAoBF,CAAW;AAAA,OAE1D,CAACE,GAAoBT,GAAeO,GAAaF,CAAU,CAAC;AAE/D,WACG,gBAAAuB,EAAAC,GAAA,EAAS,gBAAe,OAAM,WAAW,KACxC,UAAA;AAAA,MAAC,gBAAAC,EAAAD,GAAA,EAAS,iBAAgB,YAAW,SAAS,IAAI,aAAY,SAC5D,UAAA,gBAAAC,EAACD,GAAS,EAAA,aAAaf,GAAS,cAAa,WAAU,gBAAgB,KACpE,UAAQD,KAAA,gBAAAiB,EAACjB,GAAK,EAAA,OAAO,IAAI,QAAQ,IAAI,OAAAE,EAAc,CAAA,EAAA,CACtD,EACF,CAAA;AAAA,MACA,gBAAAa,EAACC,GAAS,EAAA,cAAc,MACtB,UAAA;AAAA,QAAA,gBAAAD,EAACG,GAAK,EAAA,WAAU,OAAM,QAAO,WAC3B,UAAA;AAAA,UAAA,gBAAAH,EAACG,KAAK,WAAU,YAAW,SAAO,IAAC,QAAO,WACvC,UAAA;AAAA,YAAA9B;AAAA,YAAM;AAAA,UAAA,GACT;AAAA,UAAQ;AAAA,UACPC;AAAA,QAAA,GACH;AAAA,QACCS,IACCa,IACE,gBAAAM;AAAA,UAACE;AAAA,UAAA;AAAA,YACC,OAAOf,IAAc,yBAAyB;AAAA,YAC9C,MAAK;AAAA,YACL,OAAM;AAAA,YACN,SAASQ;AAAA,UAAA;AAAA,QAAA,IAGV,gBAAAK,EAAAC,GAAA,EAAK,WAAU,OAAM,QAAO,cAC1B,UAAA3B,EACH,CAAA,IAGF,gBAAAwB,EAACC,KAAS,gBAAe,OAAM,WAAW,MAAM,aAAY,UACzD,UAAA;AAAA,UAAAzB,uBACE2B,GAAK,EAAA,WAAU,OAAM,QAAO,cAC1B,UACH3B,GAAA;AAAA,UAEDe,KACC,gBAAAW;AAAA,YAACE;AAAA,YAAA;AAAA,cACC,OAAM;AAAA,cACN,MAAK;AAAA,cACL,OAAM;AAAA,cACN,SAASL;AAAA,YAAA;AAAA,UACX;AAAA,QAAA,GAEJ;AAAA,MAAA,GAEJ;AAAA,IACF,EAAA,CAAA;AAAA,EAEJ;AACF;AAEAjC,EAAc,cAAc;"}
|
|
@@ -3,19 +3,19 @@ import a from "../../../assets/line-icons/icons/check2.js";
|
|
|
3
3
|
import m from "../../../assets/line-icons/icons/cross.js";
|
|
4
4
|
import n from "../../../assets/line-icons/icons/status.js";
|
|
5
5
|
import { CARD_TYPE as e, NODE_STATE as o } from "../daily-timeline-types.js";
|
|
6
|
-
import { formatDate as
|
|
7
|
-
const
|
|
6
|
+
import { formatDate as C } from "../../../node_modules/date-fns/format.js";
|
|
7
|
+
const i = (t) => {
|
|
8
8
|
switch (t) {
|
|
9
9
|
case o.COMPLETED:
|
|
10
|
-
return [a, "
|
|
10
|
+
return [a, "BLACK_1", "WHITE"];
|
|
11
11
|
case o.IN_PROGRESS:
|
|
12
|
-
return [n, "
|
|
12
|
+
return [n, "BLACK_1", "WHITE"];
|
|
13
13
|
case o.PENDING:
|
|
14
|
-
return [m, "
|
|
14
|
+
return [m, "WHITE", "BLACK_1"];
|
|
15
15
|
default:
|
|
16
16
|
return [n, "GREY_2"];
|
|
17
17
|
}
|
|
18
|
-
},
|
|
18
|
+
}, T = (t) => {
|
|
19
19
|
switch (t) {
|
|
20
20
|
case e.CW:
|
|
21
21
|
return r.CW_ICON;
|
|
@@ -30,11 +30,11 @@ const N = (t) => {
|
|
|
30
30
|
day: t.getDate(),
|
|
31
31
|
month: t.getMonth() + 1,
|
|
32
32
|
year: t.getFullYear(),
|
|
33
|
-
monthName:
|
|
33
|
+
monthName: C(t, "MMM")
|
|
34
34
|
});
|
|
35
35
|
export {
|
|
36
36
|
_ as getDayMonthYear,
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
i as getStateConf,
|
|
38
|
+
T as getTimelineCardIcon
|
|
39
39
|
};
|
|
40
40
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../../../src/features/timeline/comps/utils.ts"],"sourcesContent":["import { format } from 'date-fns';\n\nimport { ILLUSTRATIONS } from '../../../assets/illustrations/illustrations';\nimport Check2Icon from '../../../assets/line-icons/icons/check2';\nimport CrossIcon from '../../../assets/line-icons/icons/cross';\nimport StatusIcon from '../../../assets/line-icons/icons/status';\nimport { CARD_TYPE, NODE_STATE } from '../daily-timeline-types';\n\nexport const getStateConf = (state: NODE_STATE) => {\n switch (state) {\n case NODE_STATE.COMPLETED:\n return [Check2Icon, '
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../../../src/features/timeline/comps/utils.ts"],"sourcesContent":["import { format } from 'date-fns';\n\nimport { ILLUSTRATIONS } from '../../../assets/illustrations/illustrations';\nimport Check2Icon from '../../../assets/line-icons/icons/check2';\nimport CrossIcon from '../../../assets/line-icons/icons/cross';\nimport StatusIcon from '../../../assets/line-icons/icons/status';\nimport { CARD_TYPE, NODE_STATE } from '../daily-timeline-types';\n\nexport const getStateConf = (state: NODE_STATE) => {\n switch (state) {\n case NODE_STATE.COMPLETED:\n return [Check2Icon, 'BLACK_1', 'WHITE'];\n case NODE_STATE.IN_PROGRESS:\n return [StatusIcon, 'BLACK_1', 'WHITE'];\n case NODE_STATE.PENDING:\n return [CrossIcon, 'WHITE', 'BLACK_1'];\n default:\n return [StatusIcon, 'GREY_2'];\n }\n};\n\nexport const getTimelineCardIcon = (type: CARD_TYPE) => {\n switch (type) {\n case CARD_TYPE.CW:\n return ILLUSTRATIONS.CW_ICON;\n case CARD_TYPE.HW:\n return ILLUSTRATIONS.HW_ICON;\n case CARD_TYPE.CIRCLE:\n return ILLUSTRATIONS.CIRCLE_ICON;\n default:\n return null;\n }\n};\n\nexport const getDayMonthYear = (dateObj: Date) => ({\n day: dateObj.getDate(),\n month: dateObj.getMonth() + 1,\n year: dateObj.getFullYear(),\n monthName: format(dateObj, 'MMM'),\n});\n"],"names":["getStateConf","state","NODE_STATE","Check2Icon","StatusIcon","CrossIcon","getTimelineCardIcon","type","CARD_TYPE","ILLUSTRATIONS","getDayMonthYear","dateObj","format"],"mappings":";;;;;;AAQa,MAAAA,IAAe,CAACC,MAAsB;AACjD,UAAQA,GAAO;AAAA,IACb,KAAKC,EAAW;AACP,aAAA,CAACC,GAAY,WAAW,OAAO;AAAA,IACxC,KAAKD,EAAW;AACP,aAAA,CAACE,GAAY,WAAW,OAAO;AAAA,IACxC,KAAKF,EAAW;AACP,aAAA,CAACG,GAAW,SAAS,SAAS;AAAA,IACvC;AACS,aAAA,CAACD,GAAY,QAAQ;AAAA,EAChC;AACF,GAEaE,IAAsB,CAACC,MAAoB;AACtD,UAAQA,GAAM;AAAA,IACZ,KAAKC,EAAU;AACb,aAAOC,EAAc;AAAA,IACvB,KAAKD,EAAU;AACb,aAAOC,EAAc;AAAA,IACvB,KAAKD,EAAU;AACb,aAAOC,EAAc;AAAA,IACvB;AACS,aAAA;AAAA,EACX;AACF,GAEaC,IAAkB,CAACC,OAAmB;AAAA,EACjD,KAAKA,EAAQ,QAAQ;AAAA,EACrB,OAAOA,EAAQ,SAAA,IAAa;AAAA,EAC5B,MAAMA,EAAQ,YAAY;AAAA,EAC1B,WAAWC,EAAOD,GAAS,KAAK;AAClC;"}
|
|
@@ -1,23 +1,25 @@
|
|
|
1
1
|
import i from "styled-components";
|
|
2
|
-
import
|
|
3
|
-
import { ClickableWrapper as
|
|
4
|
-
const p = i(
|
|
5
|
-
const { textButton:
|
|
2
|
+
import d from "../../text/text.js";
|
|
3
|
+
import { ClickableWrapper as c } from "../clickable/clickable-styled.js";
|
|
4
|
+
const p = i(d)(({ theme: t, $buttonSize: o }) => {
|
|
5
|
+
const { textButton: n } = t, { underlineHeight: e, underlineOffset: r } = n.sizes[o];
|
|
6
6
|
return `
|
|
7
7
|
text-decoration: underline;
|
|
8
8
|
text-decoration-thickness: ${e}px;
|
|
9
9
|
text-underline-offset: ${r}px;
|
|
10
10
|
|
|
11
|
-
&:hover {
|
|
12
|
-
text-decoration: none;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
11
|
&:active {
|
|
16
12
|
text-decoration: underline;
|
|
17
13
|
text-decoration-thickness: ${e}px;
|
|
18
14
|
}
|
|
19
15
|
|
|
20
|
-
|
|
16
|
+
@media (hover: hover) {
|
|
17
|
+
&:hover {
|
|
18
|
+
text-decoration: none;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
${c}[aria-disabled='true'] & {
|
|
21
23
|
text-decoration: underline;
|
|
22
24
|
text-decoration-thickness: ${e}px;
|
|
23
25
|
opacity: 0.5;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-button-styled.js","sources":["../../../../../src/features/ui/buttons/text-button/text-button-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport UIText from '../../text/text';\nimport { ClickableWrapper } from '../clickable/clickable-styled';\nimport type { ITextButtonProps } from './text-button-types';\n\ninterface IStyledTextProps {\n $buttonSize: NonNullable<ITextButtonProps['size']>;\n}\n\nconst Text = styled(UIText)<IStyledTextProps>(({ theme, $buttonSize }) => {\n const { textButton } = theme;\n const { underlineHeight, underlineOffset } = textButton.sizes[$buttonSize];\n\n return `\n text-decoration: underline;\n text-decoration-thickness: ${underlineHeight}px;\n text-underline-offset: ${underlineOffset}px;\n\n &:
|
|
1
|
+
{"version":3,"file":"text-button-styled.js","sources":["../../../../../src/features/ui/buttons/text-button/text-button-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport UIText from '../../text/text';\nimport { ClickableWrapper } from '../clickable/clickable-styled';\nimport type { ITextButtonProps } from './text-button-types';\n\ninterface IStyledTextProps {\n $buttonSize: NonNullable<ITextButtonProps['size']>;\n}\n\nconst Text = styled(UIText)<IStyledTextProps>(({ theme, $buttonSize }) => {\n const { textButton } = theme;\n const { underlineHeight, underlineOffset } = textButton.sizes[$buttonSize];\n\n return `\n text-decoration: underline;\n text-decoration-thickness: ${underlineHeight}px;\n text-underline-offset: ${underlineOffset}px;\n\n &:active {\n text-decoration: underline;\n text-decoration-thickness: ${underlineHeight}px;\n }\n\n @media (hover: hover) {\n &:hover {\n text-decoration: none;\n }\n }\n\n ${ClickableWrapper}[aria-disabled='true'] & {\n text-decoration: underline;\n text-decoration-thickness: ${underlineHeight}px;\n opacity: 0.5;\n }\n `;\n});\n\nexport { Text };\n"],"names":["Text","styled","UIText","theme","$buttonSize","textButton","underlineHeight","underlineOffset","ClickableWrapper"],"mappings":";;;AAUM,MAAAA,IAAOC,EAAOC,CAAM,EAAoB,CAAC,EAAE,OAAAC,GAAO,aAAAC,QAAkB;AAClE,QAAA,EAAE,YAAAC,EAAe,IAAAF,GACjB,EAAE,iBAAAG,GAAiB,iBAAAC,EAAA,IAAoBF,EAAW,MAAMD,CAAW;AAElE,SAAA;AAAA;AAAA,iCAEwBE,CAAe;AAAA,6BACnBC,CAAe;AAAA;AAAA;AAAA;AAAA,mCAITD,CAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAS5CE,CAAgB;AAAA;AAAA,mCAEaF,CAAe;AAAA;AAAA;AAAA;AAIlD,CAAC;"}
|