@codecademy/brand 5.10.0-alpha.cfbadc666.0 → 5.11.0-alpha.93b754c9d.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.
- package/dist/AccordionAreaDeprecated/index.d.ts +1 -0
- package/dist/AccordionAreaDeprecated/index.js +2 -1
- package/dist/AccordionButtonDeprecated/index.d.ts +1 -0
- package/dist/AccordionButtonDeprecated/index.js +1 -0
- package/dist/AccordionDeprecated/index.d.ts +2 -0
- package/dist/AccordionDeprecated/index.js +2 -0
- package/dist/CoachingSessionCard/index.js +63 -40
- package/package.json +1 -1
- package/dist/stories/Molecules/AccordionDeprecated.stories.js +0 -19
|
@@ -14,6 +14,7 @@ export type AccordionAreaDeprecatedProps = {
|
|
|
14
14
|
/**
|
|
15
15
|
* @deprecated
|
|
16
16
|
* This component is in the old visual identity and will be updated soon.
|
|
17
|
+
* @see `Disclosure` and `List` from `@codecademy/gamut`
|
|
17
18
|
*
|
|
18
19
|
* Check the [Gamut Board](https://www.notion.so/codecademy/Gamut-Status-Timeline-dd3c135d3848464ea6eb1b48e68fbb1d) for component status
|
|
19
20
|
*/
|
|
@@ -18,6 +18,7 @@ const variants = {
|
|
|
18
18
|
/**
|
|
19
19
|
* @deprecated
|
|
20
20
|
* This component is in the old visual identity and will be updated soon.
|
|
21
|
+
* @see `Disclosure` and `List` from `@codecademy/gamut`
|
|
21
22
|
*
|
|
22
23
|
* Check the [Gamut Board](https://www.notion.so/codecademy/Gamut-Status-Timeline-dd3c135d3848464ea6eb1b48e68fbb1d) for component status
|
|
23
24
|
*/
|
|
@@ -55,6 +56,6 @@ const StyledAccordionBody = /*#__PURE__*/_styled(motion.div, {
|
|
|
55
56
|
styles: "overflow:hidden"
|
|
56
57
|
} : {
|
|
57
58
|
name: "d3v9zr",
|
|
58
|
-
styles: "overflow:hidden/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
59
|
+
styles: "overflow:hidden/*# sourceMappingURL=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ZHlcbiAgICAgICAgYW5pbWF0ZT17ZXhwYW5kZWQgPyAnZXhwYW5kZWQnIDogJ2ZvbGRlZCd9XG4gICAgICAgIGluaXRpYWw9e2V4cGFuZGVkID8gJ2V4cGFuZGVkJyA6ICdmb2xkZWQnfVxuICAgICAgICB0cmFuc2l0aW9uPXt7IGR1cmF0aW9uOiAwLjIsIGVhc2U6ICdlYXNlSW5PdXQnIH19XG4gICAgICAgIHZhcmlhbnRzPXt2YXJpYW50c31cbiAgICAgID5cbiAgICAgICAgeyhleHBhbmRlZCB8fCBkZWxheUV4cGFuZGVkKSAmJiBjaGlsZHJlbn1cbiAgICAgIDwvU3R5bGVkQWNjb3JkaW9uQm9keT5cbiAgICA8L2Rpdj5cbiAgKTtcbn07XG5cbmNvbnN0IFN0eWxlZEFjY29yZGlvbkJvZHkgPSBzdHlsZWQobW90aW9uLmRpdilgXG4gIG92ZXJmbG93OiBoaWRkZW47XG5gO1xuIl19 */",
|
|
59
60
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
60
61
|
});
|
|
@@ -19,6 +19,7 @@ export type AccordionButtonDeprecatedProps = ButtonDeprecatedBaseProps & {
|
|
|
19
19
|
/**
|
|
20
20
|
* @deprecated
|
|
21
21
|
* This component is in the old visual identity and will be updated soon.
|
|
22
|
+
* @see `Disclosure` and `List` from `@codecademy/gamut`
|
|
22
23
|
*
|
|
23
24
|
* Check the [Gamut Board](https://www.notion.so/codecademy/Gamut-Status-Timeline-dd3c135d3848464ea6eb1b48e68fbb1d) for component status
|
|
24
25
|
*/
|
|
@@ -30,6 +30,7 @@ const buttonThemes = {
|
|
|
30
30
|
/**
|
|
31
31
|
* @deprecated
|
|
32
32
|
* This component is in the old visual identity and will be updated soon.
|
|
33
|
+
* @see `Disclosure` and `List` from `@codecademy/gamut`
|
|
33
34
|
*
|
|
34
35
|
* Check the [Gamut Board](https://www.notion.so/codecademy/Gamut-Status-Timeline-dd3c135d3848464ea6eb1b48e68fbb1d) for component status
|
|
35
36
|
*/
|
|
@@ -34,6 +34,8 @@ export type AccordionDeprecatedProps = {
|
|
|
34
34
|
* @deprecated
|
|
35
35
|
* This component is in the old visual identity and will be updated soon.
|
|
36
36
|
*
|
|
37
|
+
* @see `Disclosure` and `List` from `@codecademy/gamut`
|
|
38
|
+
*
|
|
37
39
|
* Check the [Gamut Board](https://www.notion.so/codecademy/Gamut-Status-Timeline-dd3c135d3848464ea6eb1b48e68fbb1d) for component status
|
|
38
40
|
*/
|
|
39
41
|
export declare const AccordionDeprecated: React.FC<AccordionDeprecatedProps>;
|
|
@@ -7,6 +7,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
7
7
|
* @deprecated
|
|
8
8
|
* This component is in the old visual identity and will be updated soon.
|
|
9
9
|
*
|
|
10
|
+
* @see `Disclosure` and `List` from `@codecademy/gamut`
|
|
11
|
+
*
|
|
10
12
|
* Check the [Gamut Board](https://www.notion.so/codecademy/Gamut-Status-Timeline-dd3c135d3848464ea6eb1b48e68fbb1d) for component status
|
|
11
13
|
*/
|
|
12
14
|
|
|
@@ -1,65 +1,88 @@
|
|
|
1
|
-
import { Card, FillButton, FlexBox, StrokeButton, Text, TextButton } from '@codecademy/gamut';
|
|
1
|
+
import { Box, Card, FillButton, FlexBox, StrokeButton, Text, TextButton } from '@codecademy/gamut';
|
|
2
2
|
import { CalendarIcon, ClockIcon } from '@codecademy/gamut-icons';
|
|
3
3
|
import { formatInTimeZone } from 'date-fns-tz';
|
|
4
4
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
5
|
const formatTime = (timeString, format) => {
|
|
6
6
|
return formatInTimeZone(new Date(timeString), Intl.DateTimeFormat().resolvedOptions().timeZone, format);
|
|
7
7
|
};
|
|
8
|
+
const formatDaysLeft = timeString => {
|
|
9
|
+
const start = new Date(timeString).getTime();
|
|
10
|
+
if (Number.isNaN(start)) return '';
|
|
11
|
+
const now = Date.now();
|
|
12
|
+
const dayInMs = 24 * 60 * 60 * 1000;
|
|
13
|
+
const daysLeft = Math.max(0, Math.ceil((start - now) / dayInMs));
|
|
14
|
+
if (daysLeft === 0) {
|
|
15
|
+
return 'today';
|
|
16
|
+
}
|
|
17
|
+
return `in ${daysLeft} day${daysLeft === 1 ? '' : 's'}`;
|
|
18
|
+
};
|
|
8
19
|
export const CoachingSessionCard = ({
|
|
9
20
|
session,
|
|
10
21
|
ctas
|
|
11
22
|
}) => /*#__PURE__*/_jsx(Card, {
|
|
12
23
|
borderRadius: "xl",
|
|
13
24
|
p: 32,
|
|
14
|
-
|
|
25
|
+
border: 1,
|
|
26
|
+
borderColor: "border-primary",
|
|
15
27
|
children: /*#__PURE__*/_jsxs(FlexBox, {
|
|
16
28
|
column: true,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
alignItems: "center",
|
|
32
|
-
gap: 8,
|
|
33
|
-
children: [/*#__PURE__*/_jsx(CalendarIcon, {
|
|
34
|
-
size: 16
|
|
35
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
36
|
-
variant: "p-small",
|
|
37
|
-
color: "text-secondary",
|
|
38
|
-
children: new Date(session.startTime).toLocaleDateString(undefined, {
|
|
39
|
-
weekday: 'long',
|
|
40
|
-
month: 'long',
|
|
41
|
-
day: 'numeric',
|
|
42
|
-
year: 'numeric'
|
|
43
|
-
})
|
|
29
|
+
justifyContent: "space-between",
|
|
30
|
+
height: "100%",
|
|
31
|
+
children: [/*#__PURE__*/_jsxs(Box, {
|
|
32
|
+
children: [/*#__PURE__*/_jsxs(Text, {
|
|
33
|
+
mb: 4,
|
|
34
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
35
|
+
fontWeight: "bold",
|
|
36
|
+
children: session.coachOfferingCategoryName
|
|
37
|
+
}), ' ', "coaching session with", ' ', /*#__PURE__*/_jsx(Text, {
|
|
38
|
+
fontWeight: "bold",
|
|
39
|
+
children: session.participantName
|
|
40
|
+
}), /*#__PURE__*/_jsxs(Text, {
|
|
41
|
+
fontWeight: "bold",
|
|
42
|
+
children: [" ", formatDaysLeft(session.startTime)]
|
|
44
43
|
})]
|
|
45
44
|
}), /*#__PURE__*/_jsxs(FlexBox, {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
45
|
+
column: true,
|
|
46
|
+
alignItems: "flex-start",
|
|
47
|
+
gap: 4,
|
|
48
|
+
mb: 4,
|
|
49
|
+
children: [/*#__PURE__*/_jsxs(FlexBox, {
|
|
50
|
+
alignItems: "center",
|
|
51
|
+
gap: 4,
|
|
52
|
+
py: 8,
|
|
53
|
+
children: [/*#__PURE__*/_jsx(CalendarIcon, {
|
|
54
|
+
size: 16
|
|
55
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
56
|
+
variant: "p-small",
|
|
57
|
+
color: "text-secondary",
|
|
58
|
+
children: new Date(session.startTime).toLocaleDateString(undefined, {
|
|
59
|
+
weekday: 'long',
|
|
60
|
+
month: 'long',
|
|
61
|
+
day: 'numeric',
|
|
62
|
+
year: 'numeric'
|
|
63
|
+
})
|
|
64
|
+
})]
|
|
65
|
+
}), /*#__PURE__*/_jsxs(FlexBox, {
|
|
66
|
+
alignItems: "center",
|
|
67
|
+
gap: 4,
|
|
68
|
+
py: 8,
|
|
69
|
+
children: [/*#__PURE__*/_jsx(ClockIcon, {
|
|
70
|
+
size: 16
|
|
71
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
72
|
+
variant: "p-small",
|
|
73
|
+
color: "text-secondary",
|
|
74
|
+
children: `${formatTime(session.startTime, 'h:mm aa')} - ${formatTime(session.endTime, 'h:mm aa z')}`
|
|
75
|
+
})]
|
|
76
|
+
}), session.status && /*#__PURE__*/_jsxs(Text, {
|
|
51
77
|
variant: "p-small",
|
|
52
|
-
|
|
53
|
-
children:
|
|
78
|
+
fontWeight: "bold",
|
|
79
|
+
children: ["Status: ", session.status]
|
|
54
80
|
})]
|
|
55
|
-
}), session.status && /*#__PURE__*/_jsxs(Text, {
|
|
56
|
-
variant: "p-small",
|
|
57
|
-
fontWeight: "bold",
|
|
58
|
-
children: ["Status: ", session.status]
|
|
59
81
|
})]
|
|
60
82
|
}), /*#__PURE__*/_jsx(FlexBox, {
|
|
61
83
|
alignItems: "center",
|
|
62
84
|
gap: 8,
|
|
85
|
+
flexWrap: "wrap",
|
|
63
86
|
children: ctas?.map(cta => {
|
|
64
87
|
const Button = cta.buttonType === 'fill' ? FillButton : cta.buttonType === 'stroke' ? StrokeButton : TextButton;
|
|
65
88
|
return /*#__PURE__*/_jsx(Button, {
|
package/package.json
CHANGED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { AccordionDeprecated } from '../../index';
|
|
2
|
-
const meta = {
|
|
3
|
-
component: AccordionDeprecated
|
|
4
|
-
};
|
|
5
|
-
export default meta;
|
|
6
|
-
export const Default = {
|
|
7
|
-
args: {
|
|
8
|
-
top: 'Click to expand',
|
|
9
|
-
children: 'Accordion panel content.'
|
|
10
|
-
},
|
|
11
|
-
name: 'AccordionDeprecated'
|
|
12
|
-
};
|
|
13
|
-
export const InitiallyExpanded = {
|
|
14
|
-
args: {
|
|
15
|
-
top: 'Expanded by default',
|
|
16
|
-
children: 'This panel starts open.',
|
|
17
|
-
initiallyExpanded: true
|
|
18
|
-
}
|
|
19
|
-
};
|