@codecademy/brand 2.0.0-alpha.fd9088f77a.0 → 2.0.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/Banner/CountdownTimer.d.ts +7 -0
- package/dist/Banner/CountdownTimer.js +110 -0
- package/dist/Banner/EnhancedBanner.d.ts +17 -0
- package/dist/Banner/EnhancedBanner.js +178 -0
- package/dist/Banner/index.d.ts +10 -0
- package/dist/Banner/index.js +27 -6
- package/dist/GlobalHeader/GlobalHeaderItems.d.ts +1 -1
- package/dist/GlobalHeader/GlobalHeaderItems.js +6 -3
- package/dist/GlobalHeader/GlobalHeaderVariants.js +1 -1
- package/dist/GlobalHeader/index.js +5 -0
- package/dist/GlobalHeader/types.d.ts +1 -1
- package/dist/PlanCard/index.js +23 -14
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/stories/Molecules/EnhancedBanner.stories.d.ts +10 -0
- package/dist/stories/Molecules/EnhancedBanner.stories.js +114 -0
- package/package.json +1 -1
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { action } from '@storybook/addon-actions';
|
|
2
|
+
import { Banner } from '../../index';
|
|
3
|
+
const meta = {
|
|
4
|
+
title: 'Molecules/Enhanced Banner',
|
|
5
|
+
component: Banner,
|
|
6
|
+
argTypes: {
|
|
7
|
+
header: {
|
|
8
|
+
control: 'text',
|
|
9
|
+
description: 'Main heading text for the enhanced banner'
|
|
10
|
+
},
|
|
11
|
+
subheader: {
|
|
12
|
+
control: 'text',
|
|
13
|
+
description: 'Secondary descriptive text'
|
|
14
|
+
},
|
|
15
|
+
variant: {
|
|
16
|
+
control: 'select',
|
|
17
|
+
options: ['navy', 'yellow', 'subtle'],
|
|
18
|
+
description: 'Visual style variant'
|
|
19
|
+
},
|
|
20
|
+
cta: {
|
|
21
|
+
control: 'object',
|
|
22
|
+
description: 'Call-to-action object: { title, href }'
|
|
23
|
+
},
|
|
24
|
+
countdownTo: {
|
|
25
|
+
control: 'text',
|
|
26
|
+
description: 'ISO date string for countdown timer (e.g., "2024-12-31T23:59:59Z")'
|
|
27
|
+
},
|
|
28
|
+
isInEnhancedBannerVariant: {
|
|
29
|
+
control: 'boolean',
|
|
30
|
+
description: 'Enable enhanced banner features',
|
|
31
|
+
table: {
|
|
32
|
+
defaultValue: {
|
|
33
|
+
summary: 'true'
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
onClose: {
|
|
38
|
+
action: 'closed',
|
|
39
|
+
description: 'Callback when banner is closed'
|
|
40
|
+
},
|
|
41
|
+
onCtaClick: {
|
|
42
|
+
action: 'cta-clicked',
|
|
43
|
+
description: 'Callback when CTA button is clicked'
|
|
44
|
+
},
|
|
45
|
+
onCountdownExpire: {
|
|
46
|
+
action: 'countdown-expired',
|
|
47
|
+
description: 'Callback when countdown timer expires'
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
args: {
|
|
51
|
+
isInEnhancedBannerVariant: true,
|
|
52
|
+
variant: 'navy',
|
|
53
|
+
onClose: action('banner-closed'),
|
|
54
|
+
onCtaClick: action('cta-clicked'),
|
|
55
|
+
onCountdownExpire: action('countdown-expired')
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
export default meta;
|
|
59
|
+
export const WithCountdownTimer = {
|
|
60
|
+
args: {
|
|
61
|
+
header: '🔥 Limited Time Offer',
|
|
62
|
+
subheader: 'Save 50% on annual Pro subscription',
|
|
63
|
+
cta: {
|
|
64
|
+
title: 'Claim Offer',
|
|
65
|
+
href: '/limited-offer'
|
|
66
|
+
},
|
|
67
|
+
countdownTo: (() => {
|
|
68
|
+
const futureDate = new Date();
|
|
69
|
+
futureDate.setHours(futureDate.getHours() + 24);
|
|
70
|
+
return futureDate.toISOString();
|
|
71
|
+
})()
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
export const WithoutCountdownTimer = {
|
|
75
|
+
args: {
|
|
76
|
+
header: '⭐ Upgrade to Pro',
|
|
77
|
+
subheader: 'Unlock unlimited access to all courses and projects',
|
|
78
|
+
cta: {
|
|
79
|
+
title: 'Start Free Trial',
|
|
80
|
+
href: '/pro/trial'
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
export const YellowVariant = {
|
|
85
|
+
args: {
|
|
86
|
+
variant: 'yellow',
|
|
87
|
+
header: '⭐ System Maintenance Scheduled',
|
|
88
|
+
subheader: 'Platform will be offline for updates',
|
|
89
|
+
cta: {
|
|
90
|
+
title: 'Learn More',
|
|
91
|
+
href: '/maintenance'
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
export const SubtleVariant = {
|
|
96
|
+
args: {
|
|
97
|
+
variant: 'subtle',
|
|
98
|
+
header: '💡 Pro Tip',
|
|
99
|
+
subheader: 'Make the most of your learning experience',
|
|
100
|
+
cta: {
|
|
101
|
+
title: 'Practice Mode',
|
|
102
|
+
href: '/practice-mode'
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
export const WithoutSubheader = {
|
|
107
|
+
args: {
|
|
108
|
+
header: '🎉 Welcome to the Platform',
|
|
109
|
+
cta: {
|
|
110
|
+
title: 'Get Started',
|
|
111
|
+
href: '/get-started'
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codecademy/brand",
|
|
3
3
|
"description": "Brand component library for Codecademy",
|
|
4
|
-
"version": "2.0.0
|
|
4
|
+
"version": "2.0.0",
|
|
5
5
|
"author": "Codecademy Engineering <dev@codecademy.com>",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@emotion/is-prop-valid": "^1.2.1",
|