@xetwa/design-system 1.0.2
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/.github/workflows/publish.yml +30 -0
- package/.storybook/main.ts +17 -0
- package/.storybook/preview.tsx +65 -0
- package/eslint.config.js +22 -0
- package/index.html +13 -0
- package/package.json +55 -0
- package/public/favicon.svg +1 -0
- package/public/icons.svg +24 -0
- package/src/App.css +184 -0
- package/src/App.tsx +122 -0
- package/src/BordasSombras.mdx +343 -0
- package/src/Colors.mdx +393 -0
- package/src/GrelhaLayout.mdx +375 -0
- package/src/Icons.mdx +42 -0
- package/src/MovimentoBreakpoints.mdx +379 -0
- package/src/Spacing.mdx +231 -0
- package/src/Typography.mdx +321 -0
- package/src/assets/Mascots/vava/estaticos/vava-acenar.svg +3 -0
- package/src/assets/Mascots/vava/estaticos/vava-acertou.svg +3 -0
- package/src/assets/Mascots/vava/estaticos/vava-celebrar.svg +3 -0
- package/src/assets/Mascots/vava/estaticos/vava-com-autocolantes.svg +3 -0
- package/src/assets/Mascots/vava/estaticos/vava-dormir.svg +3 -0
- package/src/assets/Mascots/vava/estaticos/vava-errou.svg +3 -0
- package/src/assets/Mascots/vava/estaticos/vava-feliz.svg +3 -0
- package/src/assets/Mascots/vava/estaticos/vava-neutra.svg +3 -0
- package/src/assets/Mascots/vava/estaticos/vava-original.svg +3 -0
- package/src/assets/Mascots/vava/estaticos/vava-pensar.svg +3 -0
- package/src/assets/Mascots/vava/estaticos/vava-surpresa.svg +3 -0
- package/src/assets/Mascots/yaya/avatar/yaya-avatar-falar.svg +7 -0
- package/src/assets/Mascots/yaya/avatar/yaya-avatar-feliz.svg +7 -0
- package/src/assets/Mascots/yaya/avatar/yaya-avatar-transparente.svg +6 -0
- package/src/assets/Mascots/yaya/estaticos/yaya-acertou.svg +13 -0
- package/src/assets/Mascots/yaya/estaticos/yaya-celebrar.svg +13 -0
- package/src/assets/Mascots/yaya/estaticos/yaya-dormir.svg +13 -0
- package/src/assets/Mascots/yaya/estaticos/yaya-errou.svg +13 -0
- package/src/assets/Mascots/yaya/estaticos/yaya-falar.svg +13 -0
- package/src/assets/Mascots/yaya/estaticos/yaya-feliz.svg +13 -0
- package/src/assets/Mascots/yaya/estaticos/yaya-neutra.svg +13 -0
- package/src/assets/Mascots/yaya/estaticos/yaya-pensar.svg +13 -0
- package/src/assets/Mascots/yaya/estaticos/yaya-surpresa.svg +13 -0
- package/src/assets/hero.png +0 -0
- package/src/assets/react.svg +1 -0
- package/src/assets/vite.svg +1 -0
- package/src/components/Buttons/BackButton/BackButton.stories.tsx +86 -0
- package/src/components/Buttons/BackButton/BackButton.tsx +107 -0
- package/src/components/Buttons/FabButton/FabButton.stories.tsx +74 -0
- package/src/components/Buttons/FabButton/FabButton.tsx +161 -0
- package/src/components/Buttons/IconButton/IconButton.stories.tsx +99 -0
- package/src/components/Buttons/IconButton/IconButton.tsx +189 -0
- package/src/components/Buttons/JourneyButton/JourneyButton.stories.tsx +80 -0
- package/src/components/Buttons/JourneyButton/JourneyButton.tsx +194 -0
- package/src/components/Buttons/MainButton/MainButton.stories.tsx +144 -0
- package/src/components/Buttons/MainButton/MainButton.tsx +258 -0
- package/src/components/Buttons/WordChip/WordChip.stories.tsx +84 -0
- package/src/components/Buttons/WordChip/WordChip.tsx +157 -0
- package/src/components/Buttons/WordChip/index.ts +1 -0
- package/src/components/Cards/AnswerOptionCard/AnswerOptionCard.stories.tsx +181 -0
- package/src/components/Cards/AnswerOptionCard/AnswerOptionCard.tsx +201 -0
- package/src/components/Cards/BaseCard/BaseCard.stories.tsx +148 -0
- package/src/components/Cards/BaseCard/BaseCard.tsx +181 -0
- package/src/components/Cards/BoardingPassCard/BoardingPassCard.stories.tsx +205 -0
- package/src/components/Cards/BoardingPassCard/BoardingPassCard.tsx +384 -0
- package/src/components/Cards/BoardingPassCard/FlightIcon.tsx +21 -0
- package/src/components/Cards/BoardingPassCard/FlightIcon.web.tsx +18 -0
- package/src/components/Cards/CountryCard/CountryCard.stories.tsx +97 -0
- package/src/components/Cards/CountryCard/CountryCard.tsx +185 -0
- package/src/components/Cards/LevelProgressCard/LevelProgressCard.stories.tsx +61 -0
- package/src/components/Cards/LevelProgressCard/LevelProgressCard.tsx +143 -0
- package/src/components/Cards/ModuleCard/ModuleCard.stories.tsx +108 -0
- package/src/components/Cards/ModuleCard/ModuleCard.tsx +304 -0
- package/src/components/Cards/ModuleCompletionCard/ModuleCompletionCard.stories.tsx +53 -0
- package/src/components/Cards/ModuleCompletionCard/ModuleCompletionCard.tsx +167 -0
- package/src/components/Cards/Passport/PassportCover.tsx +114 -0
- package/src/components/Cards/Passport/PassportIDPage.tsx +217 -0
- package/src/components/Cards/Passport/PassportStampPage.tsx +253 -0
- package/src/components/Cards/Passport/PassportViewer.stories.tsx +95 -0
- package/src/components/Cards/Passport/PassportViewer.tsx +328 -0
- package/src/components/Cards/PlanCard/PlanCard.stories.tsx +159 -0
- package/src/components/Cards/PlanCard/PlanCard.tsx +317 -0
- package/src/components/Cards/PricingCard/PricingCard.stories.tsx +83 -0
- package/src/components/Cards/PricingCard/PricingCard.tsx +144 -0
- package/src/components/Cards/SelectionCard/SelectionCard.stories.tsx +77 -0
- package/src/components/Cards/SelectionCard/SelectionCard.tsx +111 -0
- package/src/components/Cards/TeacherCard/TeacherCard.stories.tsx +126 -0
- package/src/components/Cards/TeacherCard/TeacherCard.tsx +236 -0
- package/src/components/Charts/WeeklyProgressChart/WeeklyProgressChart.stories.tsx +89 -0
- package/src/components/Charts/WeeklyProgressChart/WeeklyProgressChart.tsx +179 -0
- package/src/components/Charts/WeeklyProgressChart/index.ts +1 -0
- package/src/components/DataDisplay/Avatar/Avatar.stories.tsx +85 -0
- package/src/components/DataDisplay/Avatar/Avatar.tsx +118 -0
- package/src/components/DataDisplay/Avatar/index.ts +1 -0
- package/src/components/DataDisplay/Badge/Badge.stories.tsx +62 -0
- package/src/components/DataDisplay/Badge/Badge.tsx +146 -0
- package/src/components/DataDisplay/Flag/Flag.stories.tsx +98 -0
- package/src/components/DataDisplay/Flag/Flag.tsx +347 -0
- package/src/components/DataDisplay/Flag/Flag.web.tsx +334 -0
- package/src/components/DataDisplay/InstructionBubble/InstructionBubble.stories.tsx +80 -0
- package/src/components/DataDisplay/InstructionBubble/InstructionBubble.tsx +86 -0
- package/src/components/DataDisplay/LevelBadge/LevelBadge.stories.tsx +99 -0
- package/src/components/DataDisplay/LevelBadge/LevelBadge.tsx +118 -0
- package/src/components/DataDisplay/ProgressBar/ProgressBar.stories.tsx +95 -0
- package/src/components/DataDisplay/ProgressBar/ProgressBar.tsx +117 -0
- package/src/components/DataDisplay/StatBadge/StatBadge.stories.tsx +82 -0
- package/src/components/DataDisplay/StatBadge/StatBadge.tsx +135 -0
- package/src/components/DataDisplay/StatBadge/index.ts +1 -0
- package/src/components/DataDisplay/Tag/Tag.stories.tsx +63 -0
- package/src/components/DataDisplay/Tag/Tag.tsx +148 -0
- package/src/components/Feedback/FeedbackBottomSheet/FeedbackBottomSheet.stories.tsx +74 -0
- package/src/components/Feedback/FeedbackBottomSheet/FeedbackBottomSheet.tsx +200 -0
- package/src/components/Forms/Checkbox/Checkbox.stories.tsx +60 -0
- package/src/components/Forms/Checkbox/Checkbox.tsx +127 -0
- package/src/components/Forms/Checkbox/index.ts +1 -0
- package/src/components/Forms/DaySelector/DaySelector.stories.tsx +62 -0
- package/src/components/Forms/DaySelector/DaySelector.tsx +133 -0
- package/src/components/Forms/Radio/Radio.stories.tsx +61 -0
- package/src/components/Forms/Radio/Radio.tsx +141 -0
- package/src/components/Forms/Radio/index.ts +1 -0
- package/src/components/Forms/SegmentedToggle/SegmentedToggle.stories.tsx +67 -0
- package/src/components/Forms/SegmentedToggle/SegmentedToggle.tsx +150 -0
- package/src/components/Forms/SegmentedToggle/index.ts +1 -0
- package/src/components/Forms/Select/Select.stories.tsx +59 -0
- package/src/components/Forms/Select/Select.tsx +255 -0
- package/src/components/Forms/Select/index.ts +1 -0
- package/src/components/Forms/Switch/Switch.stories.tsx +57 -0
- package/src/components/Forms/Switch/Switch.tsx +120 -0
- package/src/components/Forms/Switch/index.ts +1 -0
- package/src/components/Forms/TimeSlot/TimeSlot.stories.tsx +62 -0
- package/src/components/Forms/TimeSlot/TimeSlot.tsx +116 -0
- package/src/components/Headers/CountryHeader/CountryHeader.stories.tsx +114 -0
- package/src/components/Headers/CountryHeader/CountryHeader.tsx +147 -0
- package/src/components/Headers/ProfileHeader/ProfileHeader.stories.tsx +141 -0
- package/src/components/Headers/ProfileHeader/ProfileHeader.tsx +233 -0
- package/src/components/Inputs/FillInTheBlank/FillInTheBlank.stories.tsx +333 -0
- package/src/components/Inputs/FillInTheBlank/FillInTheBlank.tsx +287 -0
- package/src/components/Inputs/FillInTheBlank/index.ts +1 -0
- package/src/components/Inputs/TextInput/TextInput.stories.tsx +103 -0
- package/src/components/Inputs/TextInput/TextInput.tsx +187 -0
- package/src/components/Mascots/Vava/Vava.stories.tsx +114 -0
- package/src/components/Mascots/Vava/Vava.tsx +276 -0
- package/src/components/Mascots/Yaya/Yaya.stories.tsx +98 -0
- package/src/components/Mascots/Yaya/Yaya.tsx +233 -0
- package/src/components/Navigation/BottomTabBar/BottomTabBar.stories.tsx +68 -0
- package/src/components/Navigation/BottomTabBar/BottomTabBar.tsx +85 -0
- package/src/components/Navigation/BottomTabBar/BottomTabBarItem.tsx +68 -0
- package/src/components/Navigation/BottomTabBar/index.ts +2 -0
- package/src/components/Navigation/PaginationDots/PaginationDots.stories.tsx +62 -0
- package/src/components/Navigation/PaginationDots/PaginationDots.tsx +81 -0
- package/src/components/Navigation/PaginationDots/index.ts +1 -0
- package/src/components/Navigation/ProgressMap/ProgressMap.stories.tsx +116 -0
- package/src/components/Navigation/ProgressMap/ProgressMap.tsx +827 -0
- package/src/components/Navigation/WorldProgressMap/WorldProgressMap.stories.tsx +169 -0
- package/src/components/Navigation/WorldProgressMap/WorldProgressMap.tsx +790 -0
- package/src/components/Typography/Typography.stories.tsx +127 -0
- package/src/components/Typography/Typography.tsx +53 -0
- package/src/hooks/useResponsive.ts +41 -0
- package/src/hooks/useTheme.ts +32 -0
- package/src/index.css +355 -0
- package/src/index.ts +28 -0
- package/src/main.tsx +10 -0
- package/src/mocks/codegenNativeComponent.ts +5 -0
- package/src/styles/countryThemes.ts +79 -0
- package/src/styles/theme.ts +297 -0
- package/src/utils/iconMap.ts +23 -0
- package/tsconfig.app.json +25 -0
- package/tsconfig.json +7 -0
- package/tsconfig.node.json +24 -0
- package/vite.config.ts +51 -0
- package/vitest.shims.d.ts +1 -0
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { WorldProgressMap } from './WorldProgressMap';
|
|
3
|
+
import type { WorldMapStation } from './WorldProgressMap';
|
|
4
|
+
|
|
5
|
+
const meta = {
|
|
6
|
+
title: 'Components/Navigation/WorldProgressMap',
|
|
7
|
+
component: WorldProgressMap,
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: 'fullscreen',
|
|
10
|
+
docs: {
|
|
11
|
+
description: {
|
|
12
|
+
component:
|
|
13
|
+
'O **WorldProgressMap** é um mapa interativo premium com rolagem horizontal e vertical. Apresenta continentes desenhados geograficamente, rotas pontilhadas conectando países francófonos em várias partes do mundo, bandeiras e uma interface de viagem imersiva.',
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
tags: ['autodocs'],
|
|
18
|
+
argTypes: {
|
|
19
|
+
activeStationId: {
|
|
20
|
+
control: { type: 'number' },
|
|
21
|
+
description: 'O ID da paragem atualmente ativa (Estás Aqui).',
|
|
22
|
+
},
|
|
23
|
+
onStationPress: { action: 'stationPressed' },
|
|
24
|
+
onContinuePress: { action: 'continuePressed' },
|
|
25
|
+
onBackPress: { action: 'backPressed' },
|
|
26
|
+
onFlightPress: { action: 'flightPressed' },
|
|
27
|
+
},
|
|
28
|
+
} satisfies Meta<any>;
|
|
29
|
+
|
|
30
|
+
export default meta;
|
|
31
|
+
type Story = StoryObj<any>;
|
|
32
|
+
|
|
33
|
+
// Geographic coordinate reference points (1200x800 canvas)
|
|
34
|
+
// Americas: X: 150-350, Y: 100-700
|
|
35
|
+
// Europe: X: 450-650, Y: 150-350
|
|
36
|
+
// Africa: X: 450-750, Y: 400-700
|
|
37
|
+
// Asia/Oceania: X: 800-1100, Y: 200-700
|
|
38
|
+
|
|
39
|
+
const stations: WorldMapStation[] = [
|
|
40
|
+
{
|
|
41
|
+
id: 1,
|
|
42
|
+
label: 'Montréal',
|
|
43
|
+
levelCode: 'A1',
|
|
44
|
+
countryCode: 'CA', // Canada
|
|
45
|
+
status: 'visited',
|
|
46
|
+
x: 200,
|
|
47
|
+
y: 200,
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
id: 2,
|
|
51
|
+
label: 'Port-au-Prince',
|
|
52
|
+
levelCode: 'A1',
|
|
53
|
+
countryCode: 'HT', // Haiti
|
|
54
|
+
status: 'visited',
|
|
55
|
+
x: 250,
|
|
56
|
+
y: 380,
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
id: 3,
|
|
60
|
+
label: 'Paris',
|
|
61
|
+
levelCode: 'A2',
|
|
62
|
+
countryCode: 'FR', // France
|
|
63
|
+
status: 'visited',
|
|
64
|
+
x: 500,
|
|
65
|
+
y: 200,
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
id: 4,
|
|
69
|
+
label: 'Bruxelles',
|
|
70
|
+
levelCode: 'A2',
|
|
71
|
+
countryCode: 'BE', // Belgium
|
|
72
|
+
status: 'current',
|
|
73
|
+
x: 550,
|
|
74
|
+
y: 150,
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
id: 5,
|
|
78
|
+
label: 'Genève',
|
|
79
|
+
levelCode: 'B1',
|
|
80
|
+
countryCode: 'CH', // Switzerland
|
|
81
|
+
status: 'locked',
|
|
82
|
+
x: 590,
|
|
83
|
+
y: 220,
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
id: 6,
|
|
87
|
+
label: 'Dakar',
|
|
88
|
+
levelCode: 'B1',
|
|
89
|
+
countryCode: 'SN', // Senegal
|
|
90
|
+
status: 'locked',
|
|
91
|
+
x: 440,
|
|
92
|
+
y: 420,
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
id: 7,
|
|
96
|
+
label: 'Abidjan',
|
|
97
|
+
levelCode: 'B2',
|
|
98
|
+
countryCode: 'CI', // Ivory Coast
|
|
99
|
+
status: 'locked',
|
|
100
|
+
x: 480,
|
|
101
|
+
y: 520,
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
id: 8,
|
|
105
|
+
label: 'Yaoundé',
|
|
106
|
+
levelCode: 'B2',
|
|
107
|
+
countryCode: 'CM', // Cameroon
|
|
108
|
+
status: 'locked',
|
|
109
|
+
x: 560,
|
|
110
|
+
y: 550,
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
id: 9,
|
|
114
|
+
label: 'Antananarivo',
|
|
115
|
+
levelCode: 'C1',
|
|
116
|
+
countryCode: 'MG', // Madagascar
|
|
117
|
+
status: 'locked',
|
|
118
|
+
x: 680,
|
|
119
|
+
y: 650,
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
id: 10,
|
|
123
|
+
label: 'Port Vila',
|
|
124
|
+
levelCode: 'C1',
|
|
125
|
+
countryCode: 'VU', // Vanuatu
|
|
126
|
+
status: 'locked',
|
|
127
|
+
x: 950,
|
|
128
|
+
y: 550,
|
|
129
|
+
},
|
|
130
|
+
];
|
|
131
|
+
|
|
132
|
+
export const DefaultMap: Story = {
|
|
133
|
+
args: {
|
|
134
|
+
title: 'A ROTA DA FRANCOFONIA',
|
|
135
|
+
subtitle: '10 destinos · Viagem Global',
|
|
136
|
+
stations,
|
|
137
|
+
activeStationId: 4,
|
|
138
|
+
height: 700, // Custom viewport height constraint for testing
|
|
139
|
+
},
|
|
140
|
+
render: (args: any) => (
|
|
141
|
+
<div style={{ width: '100%', height: '700px', maxWidth: '600px', margin: '0 auto', border: '1px solid #ddd' }}>
|
|
142
|
+
<WorldProgressMap {...args} />
|
|
143
|
+
</div>
|
|
144
|
+
),
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
// Start of the journey
|
|
148
|
+
export const MapStart: Story = {
|
|
149
|
+
args: {
|
|
150
|
+
...DefaultMap.args,
|
|
151
|
+
activeStationId: 1,
|
|
152
|
+
stations: stations.map((s) =>
|
|
153
|
+
s.id === 1 ? { ...s, status: 'current' } : { ...s, status: 'locked' }
|
|
154
|
+
),
|
|
155
|
+
},
|
|
156
|
+
render: DefaultMap.render,
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
// End of the journey
|
|
160
|
+
export const MapEnd: Story = {
|
|
161
|
+
args: {
|
|
162
|
+
...DefaultMap.args,
|
|
163
|
+
activeStationId: 10,
|
|
164
|
+
stations: stations.map((s) =>
|
|
165
|
+
s.id === 10 ? { ...s, status: 'current' } : { ...s, status: 'visited' }
|
|
166
|
+
),
|
|
167
|
+
},
|
|
168
|
+
render: DefaultMap.render,
|
|
169
|
+
};
|