@latte-macchiat-io/latte-vanilla-components 0.0.187 → 0.0.188

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 (49) hide show
  1. package/package.json +2 -1
  2. package/src/components/Actions/Actions.css.ts +1 -1
  3. package/src/components/Button/Button.css.ts +1 -1
  4. package/src/components/Button/stories.tsx +9 -17
  5. package/src/components/Carousel/Carousel.css.ts +1 -1
  6. package/src/components/Columns/Columns.css.ts +1 -1
  7. package/src/components/ConsentCookie/ConsentCookie.css.ts +1 -1
  8. package/src/components/Footer/Footer.css.ts +1 -1
  9. package/src/components/Form/Form.css.ts +1 -1
  10. package/src/components/Form/Row/Row.css.ts +1 -1
  11. package/src/components/Form/TextField/Input/Input.css.ts +1 -1
  12. package/src/components/Form/TextField/Label/Label.css.ts +1 -1
  13. package/src/components/Form/TextField/TextField.css.ts +1 -1
  14. package/src/components/Form/TextField/Textarea/Textarea.css.ts +1 -1
  15. package/src/components/Header/Header.css.ts +1 -1
  16. package/src/components/Header/HeaderOverlay/index.tsx +1 -1
  17. package/src/components/Header/HeaderOverlay/styles.css.ts +7 -7
  18. package/src/components/Header/ToggleNav/index.tsx +2 -5
  19. package/src/components/Icon/Icon.css.ts +0 -1
  20. package/src/components/KeyNumber/KeyNumber.css.ts +1 -1
  21. package/src/components/LanguageSwitcher/LanguageSwitcher.css.ts +1 -1
  22. package/src/components/Logo/Logo.css.ts +1 -1
  23. package/src/components/Main/Main.css.ts +1 -1
  24. package/src/components/Modal/Modal.css.ts +1 -1
  25. package/src/components/Modal/stories.tsx +54 -89
  26. package/src/components/Nav/Nav.css.ts +1 -1
  27. package/src/components/Nav/Nav.tsx +1 -0
  28. package/src/components/NavLegal/NavLegal.css.ts +1 -1
  29. package/src/components/NavSocial/NavSocial.css.ts +1 -1
  30. package/src/components/Section/Section.css.ts +1 -1
  31. package/src/components/Section/stories.tsx +60 -61
  32. package/src/components/Video/Video.css.ts +1 -1
  33. package/src/components/VideoFullWidth/VideoFullWidth.css.ts +1 -1
  34. package/src/index.ts +9 -22
  35. package/src/styles/sprinkles.css.ts +1 -1
  36. package/src/themes/createTheme.css.ts +65 -0
  37. package/src/themes/dark.css.ts +4 -3
  38. package/src/themes/light.css.ts +3 -3
  39. package/src/types/withClassName.ts +1 -0
  40. package/src/assets/styles/default-theme.ts +0 -312
  41. package/src/assets/styles/mediaqueries.tsx +0 -24
  42. package/src/components/ToRemove/ToRemove.tsx +0 -3
  43. package/src/theme/index.ts +0 -6
  44. package/src/theme/utils.ts +0 -76
  45. package/src/types/theme.ts +0 -295
  46. package/src/utils/quickTheme.ts +0 -38
  47. package/src/utils/theme.ts +0 -131
  48. /package/src/{theme → themes}/baseThemeValues.ts +0 -0
  49. /package/src/{theme → themes}/contract.css.ts +0 -0
@@ -1,312 +0,0 @@
1
- import { Theme } from '@/types/theme';
2
-
3
- const brandFont = '"Goudy Bookletter 1911", sans-serif';
4
- const defaultFont = '"Gill Sans", sans-serif';
5
-
6
- const brandColorTerracotta = '#FF7377';
7
-
8
- const brandColorBeigeDark = '#C8AE96';
9
- const brandColorBeigeLight = '#FCEFE6';
10
-
11
- const brandColorGrey = '#2E2E2E';
12
- const brandColorGreyLight = '#CCCCCC';
13
- const brandColorGreyMedium = ' #888888';
14
- const brandColorBlack = '#000000';
15
-
16
- const brandColor = brandColorTerracotta;
17
-
18
- export const defaultTheme: Theme = {
19
- global: {
20
- maxWidth: 1200,
21
- paddingLeft: [15, 15, 30, 30],
22
- paddingRight: [15, 15, 30, 30],
23
-
24
- brandFont: brandFont,
25
- defaultFont: defaultFont,
26
- },
27
-
28
- colors: {
29
- defaultText: brandColorBlack,
30
- defaultLightText: brandColorBeigeLight,
31
- defaultTitle: '',
32
- defaultLink: brandColorBlack,
33
- defaultIcon: brandColorBlack,
34
- },
35
-
36
- backgroundColors: {
37
- modal: brandColorBeigeLight,
38
- modalOverlay: 'rgba(0, 0, 0, 0.6)',
39
- cookieConsent: brandColorBeigeLight,
40
- },
41
-
42
- borders: {
43
- hr: `1px solid ${brandColorBeigeDark}`,
44
- cookieConsent: `2px solid ${brandColorBlack}`,
45
- },
46
-
47
- borderRadius: {
48
- modal: 30,
49
- input: 30,
50
- cookieConsent: 30,
51
- },
52
-
53
- widthSizes: {
54
- modal: 600,
55
- cookieConsent: 500,
56
- },
57
-
58
- transitions: {
59
- global: 'all 0.3s ease-in-out',
60
- },
61
-
62
- actions: {
63
- gap: [15, 15, 30, 30],
64
- paddingTop: [15, 15, 30, 30],
65
- paddingBottom: [15, 15, 30, 30],
66
- },
67
-
68
- button: {
69
- minWidth: 80,
70
- fontWeight: 400,
71
- letterSpacing: 0.1,
72
- color: {
73
- primary: brandColorBeigeLight,
74
- secondary: brandColorGrey,
75
- disabled: brandColorGreyMedium,
76
- },
77
- backgroundColor: {
78
- primary: brandColor,
79
- secondary: brandColorBeigeDark,
80
- disabled: brandColorGreyLight,
81
- },
82
- border: {
83
- width: 2,
84
- style: 'solid',
85
- color: {
86
- primary: brandColor,
87
- secondary: brandColorBeigeDark,
88
- disabled: brandColorGreyLight,
89
- },
90
- },
91
- borderRadius: 50,
92
- paddingTop: {
93
- small: [5, 5, 10, 10, 15, 15],
94
- medium: [10, 10, 15, 15, 20, 20],
95
- large: [15, 15, 20, 20, 25, 25],
96
- },
97
- paddingBottom: {
98
- small: [5, 5, 10, 10, 15, 15],
99
- medium: [10, 10, 15, 15, 20, 20],
100
- large: [15, 15, 20, 20, 25, 25],
101
- },
102
- paddingLeft: {
103
- small: [5, 5, 10, 10, 15, 15],
104
- medium: [10, 10, 15, 15, 20, 20],
105
- large: [15, 15, 20, 20, 25, 25],
106
- },
107
- paddingRight: {
108
- small: [5, 5, 10, 10, 15, 15],
109
- medium: [10, 10, 15, 15, 20, 20],
110
- large: [15, 15, 20, 20, 25, 25],
111
- },
112
- transition: 'all 0.3s ease-in-out',
113
- },
114
-
115
- columns: {
116
- gap: 30,
117
- },
118
-
119
- keyNumber: {
120
- paddingBottom: [5, 5, 10, 10, 15, 15],
121
- },
122
-
123
- form: {
124
- width: 800,
125
- padding: ['15px', '30px'],
126
- backgroundColor: '',
127
-
128
- row: {
129
- gap: [30, 60],
130
- padding: ['15px', '30px'],
131
- },
132
-
133
- label: {
134
- font: brandFont,
135
- fontWeight: 500,
136
- color: brandColor,
137
- paddingBottom: 5,
138
- },
139
-
140
- input: {
141
- color: '',
142
- borderRadius: 0,
143
- padding: [5, 10],
144
- font: defaultFont,
145
- backgroundColor: '',
146
- placeholder: {
147
- color: '',
148
- opacity: 1,
149
- },
150
- border: `2px solid ${brandColorBlack}`,
151
- },
152
-
153
- textarea: {
154
- color: '',
155
- borderRadius: 0,
156
- padding: [5, 10],
157
- font: defaultFont,
158
- backgroundColor: '',
159
- placeholder: {
160
- color: '',
161
- opacity: 1,
162
- },
163
- border: `2px solid ${brandColorBlack}`,
164
- },
165
-
166
- error: {
167
- color: brandColorTerracotta,
168
- },
169
- },
170
-
171
- header: {
172
- gap: [15, 15, 15, 15],
173
- height: [60, 60, 120, 120],
174
- backgroundColor: brandColorBeigeLight,
175
-
176
- paddingTop: [15, 30, 50, 100],
177
- paddingLeft: [15, 30, 50, 100],
178
- paddingRight: [15, 30, 50, 100],
179
- paddingBottom: [15, 30, 50, 100],
180
-
181
- overlayGap: [15, 15, 15, 15],
182
- overlayBackgroundColor: brandColorBeigeLight,
183
-
184
- toggleNavColor: brandColorBlack,
185
- toggleNavOpenColor: brandColorBlack,
186
- toggleNavBorderRadius: 5,
187
- },
188
-
189
- main: {
190
- minHeight: '45vh',
191
- backgroundColor: brandColorBeigeLight,
192
- },
193
-
194
- section: {
195
- paddingTop: [15, 30, 50, 100],
196
- paddingBottom: [15, 30, 50, 100],
197
- },
198
-
199
- footer: {
200
- gap: [15, 15, 15, 15],
201
- height: [60, 60, 120, 120],
202
- backgroundColor: brandColorBeigeLight,
203
-
204
- paddingTop: [15, 30, 50, 100],
205
- paddingBottom: [15, 30, 50, 100],
206
- },
207
-
208
- modal: {
209
- border: '',
210
- borderRadius: 0,
211
- width: [50, 50, 75, 75],
212
- backgroundColor: brandColorBeigeLight,
213
-
214
- overlayBlur: 0,
215
- overlayOpacity: 0.5,
216
- overlayBackgroundColor: brandColorBlack,
217
-
218
- paddingTop: [15, 30, 50, 100],
219
- paddingLeft: [15, 30, 50, 100],
220
- paddingRight: [15, 30, 50, 100],
221
- paddingBottom: [15, 30, 50, 100],
222
- },
223
-
224
- languageSwitcher: {
225
- border: '',
226
- borderRadius: 0,
227
- color: brandColorBlack,
228
- width: [150, 150, 200, 200],
229
- backgroundColor: brandColorBeigeLight,
230
-
231
- paddingTop: [15, 30, 50, 100],
232
- paddingLeft: [15, 30, 50, 100],
233
- paddingRight: [15, 30, 50, 100],
234
- paddingBottom: [15, 30, 50, 100],
235
- },
236
-
237
- carousel: {
238
- gap: [0, 0, 30, 60],
239
- bullet: {
240
- borderRadius: 0,
241
- width: [12, 12, 12, 12],
242
- height: [12, 12, 12, 12],
243
- backgroundColor: brandColorBeigeLight,
244
- },
245
- },
246
-
247
- video: {
248
- playButton: {
249
- border: '',
250
- borderRadius: 0,
251
- width: [50, 50, 75, 75],
252
- height: [50, 50, 75, 75],
253
- color: brandColorBlack,
254
- backgroundColor: brandColorBeigeLight,
255
- },
256
- pauseButton: {
257
- border: '',
258
- borderRadius: 0,
259
- width: [40, 40, 50, 50],
260
- height: [40, 40, 50, 50],
261
- color: brandColorBlack,
262
- backgroundColor: brandColorBeigeLight,
263
- },
264
- soundButton: {
265
- border: '',
266
- borderRadius: 0,
267
- width: [40, 40, 50, 50],
268
- height: [40, 40, 50, 50],
269
- color: brandColorBlack,
270
- backgroundColor: brandColorBeigeLight,
271
- },
272
- closeButton: {
273
- border: '',
274
- borderRadius: 0,
275
- width: [40, 40, 50, 50],
276
- height: [40, 40, 50, 50],
277
- color: brandColorBlack,
278
- backgroundColor: brandColorBeigeLight,
279
- },
280
- },
281
-
282
- consentCookie: {
283
- borders: 0,
284
- borderRadius: 0,
285
- width: [50, 50, 75, 75],
286
- backgroundColor: brandColorBeigeLight,
287
-
288
- overlayBlur: 0,
289
- overlayOpacity: 0.5,
290
- overlayBackgroundColor: brandColorBlack,
291
-
292
- paddingTop: [15, 30, 50, 100],
293
- paddingLeft: [15, 30, 50, 100],
294
- paddingRight: [15, 30, 50, 100],
295
- paddingBottom: [15, 30, 50, 100],
296
-
297
- actionsGap: 30,
298
- actionsPaddingTop: [15, 100, 100, 100],
299
- },
300
-
301
- nav: {
302
- gap: [15, 15, 15, 15],
303
- },
304
-
305
- navSocial: {
306
- gap: [15, 15, 15, 15],
307
- },
308
-
309
- navLegal: {
310
- gap: [15, 15, 15, 15],
311
- },
312
- };
@@ -1,24 +0,0 @@
1
- export const breakpoints1 = [
2
- 640 /* Small devices (portrait tablets and large phones, 640px and up) */, 768 /* Medium devices (landscape tablets, 768px and up) */,
3
- 1024 /* Large devices (laptops/desktops, 1024px and up) */, 1680 /* Extra large devices (large laptops and desktops, 1280px and up) */,
4
- ];
5
-
6
- export const mq = breakpoints1.map((bp) => `(min-width: ${bp}px)`);
7
-
8
- export const breakpoints = {
9
- mobile: 0, // Mobile par défaut
10
- sm: 640, // Mobile large
11
- md: 768, // Tablette
12
- lg: 1024, // Petit laptop
13
- xl: 1280, // Desktop
14
- '2xl': 1536, // Grand écran
15
- } as const;
16
-
17
- export const queries = {
18
- mobile: `screen and (min-width: ${breakpoints.mobile}px)`,
19
- sm: `screen and (min-width: ${breakpoints.sm}px)`,
20
- md: `screen and (min-width: ${breakpoints.md}px)`,
21
- lg: `screen and (min-width: ${breakpoints.lg}px)`,
22
- xl: `screen and (min-width: ${breakpoints.xl}px)`,
23
- '2xl': `screen and (min-width: ${breakpoints['2xl']}px)`,
24
- };
@@ -1,3 +0,0 @@
1
- export const ToRemove = () => {
2
- return <div>ToRemove</div>;
3
- };
@@ -1,6 +0,0 @@
1
- // Theme contract and values
2
- export { themeContract } from './contract.css';
3
- export { baseLightTheme, baseDarkTheme } from './baseThemeValues';
4
-
5
- // Theme utilities
6
- export { createThemeOverride, getThemeContract, getThemeValues, toggleTheme, setTheme, getCurrentTheme, type ThemeValues } from './utils';
@@ -1,76 +0,0 @@
1
- import { baseDarkTheme, baseLightTheme } from './baseThemeValues';
2
- import { themeContract } from './contract.css';
3
-
4
- export type ThemeValues = typeof baseLightTheme;
5
-
6
- export const createThemeOverride = (overrides: Partial<ThemeValues>): ThemeValues => {
7
- return {
8
- ...baseLightTheme,
9
- ...overrides,
10
- colors: {
11
- ...baseLightTheme.colors,
12
- ...overrides.colors,
13
- },
14
- space: {
15
- ...baseLightTheme.space,
16
- ...overrides.space,
17
- },
18
- radii: {
19
- ...baseLightTheme.radii,
20
- ...overrides.radii,
21
- },
22
- fonts: {
23
- ...baseLightTheme.fonts,
24
- ...overrides.fonts,
25
- },
26
- fontSizes: {
27
- ...baseLightTheme.fontSizes,
28
- ...overrides.fontSizes,
29
- },
30
- lineHeights: {
31
- ...baseLightTheme.lineHeights,
32
- ...overrides.lineHeights,
33
- },
34
- shadows: {
35
- ...baseLightTheme.shadows,
36
- ...overrides.shadows,
37
- },
38
- };
39
- };
40
-
41
- export const getThemeContract = () => themeContract;
42
-
43
- export const getThemeValues = (isDark = false): ThemeValues => {
44
- return isDark ? baseDarkTheme : baseLightTheme;
45
- };
46
-
47
- export const toggleTheme = () => {
48
- const html = document.documentElement;
49
- const currentTheme = html.getAttribute('data-theme');
50
- const newTheme = currentTheme === 'dark' ? null : 'dark';
51
-
52
- if (newTheme) {
53
- html.setAttribute('data-theme', newTheme);
54
- } else {
55
- html.removeAttribute('data-theme');
56
- }
57
-
58
- return newTheme === 'dark';
59
- };
60
-
61
- export const setTheme = (theme: 'light' | 'dark') => {
62
- const html = document.documentElement;
63
-
64
- if (theme === 'dark') {
65
- html.setAttribute('data-theme', 'dark');
66
- } else {
67
- html.removeAttribute('data-theme');
68
- }
69
- };
70
-
71
- export const getCurrentTheme = (): 'light' | 'dark' => {
72
- if (typeof window === 'undefined') return 'light';
73
-
74
- const html = document.documentElement;
75
- return html.getAttribute('data-theme') === 'dark' ? 'dark' : 'light';
76
- };
@@ -1,295 +0,0 @@
1
- export interface Theme {
2
- global: {
3
- maxWidth: number;
4
- paddingLeft: number[];
5
- paddingRight: number[];
6
-
7
- brandFont: string;
8
- defaultFont: string;
9
- };
10
-
11
- colors: {
12
- defaultText: string;
13
- defaultLightText: string;
14
- defaultTitle: string;
15
- defaultLink: string;
16
- defaultIcon: string;
17
- };
18
-
19
- backgroundColors: {
20
- modal: string;
21
- modalOverlay: string;
22
- cookieConsent: string;
23
- };
24
-
25
- borders: {
26
- hr: string;
27
- cookieConsent: string;
28
- };
29
-
30
- borderRadius: {
31
- modal: number;
32
- input: number;
33
- cookieConsent: number;
34
- };
35
-
36
- widthSizes: {
37
- modal: number;
38
- cookieConsent: number;
39
- };
40
-
41
- transitions: {
42
- global: string;
43
- };
44
-
45
- actions: {
46
- gap: number[];
47
- paddingTop: number[];
48
- paddingBottom: number[];
49
- };
50
-
51
- button: {
52
- minWidth: number;
53
- fontWeight: number;
54
- letterSpacing: number;
55
- color: {
56
- primary: string;
57
- secondary: string;
58
- disabled: string;
59
- };
60
- backgroundColor: {
61
- primary: string;
62
- secondary: string;
63
- disabled: string;
64
- };
65
- border: {
66
- width: number;
67
- style: string;
68
- color: {
69
- primary: string;
70
- secondary: string;
71
- disabled: string;
72
- };
73
- };
74
- borderRadius: number;
75
- paddingTop: {
76
- small: number[];
77
- medium: number[];
78
- large: number[];
79
- };
80
- paddingBottom: {
81
- small: number[];
82
- medium: number[];
83
- large: number[];
84
- };
85
- paddingRight: {
86
- small: number[];
87
- medium: number[];
88
- large: number[];
89
- };
90
- paddingLeft: {
91
- small: number[];
92
- medium: number[];
93
- large: number[];
94
- };
95
- transition: string;
96
- };
97
-
98
- keyNumber: {
99
- paddingBottom: number[];
100
- };
101
-
102
- columns: {
103
- gap: number;
104
- };
105
-
106
- form: {
107
- width: number;
108
- backgroundColor: string;
109
- padding: [string | number, string | number];
110
-
111
- row: {
112
- gap: [string | number, string | number];
113
- padding: [string | number, string | number];
114
- };
115
-
116
- label: {
117
- font: string;
118
- color: string;
119
- fontWeight: number;
120
- paddingBottom: number;
121
- };
122
-
123
- input: {
124
- font: string;
125
- color: string;
126
- border: string;
127
- padding: number[];
128
- borderRadius: number;
129
- backgroundColor: string;
130
- placeholder: {
131
- color: string;
132
- opacity: number;
133
- };
134
- };
135
-
136
- textarea: {
137
- font: string;
138
- color: string;
139
- border: string;
140
- padding: number[];
141
- borderRadius: number;
142
- backgroundColor: string;
143
- placeholder: {
144
- color: string;
145
- opacity: number;
146
- };
147
- };
148
-
149
- error: {
150
- color: string;
151
- };
152
- };
153
-
154
- header: {
155
- gap: number[];
156
- height: number[];
157
- backgroundColor: string;
158
-
159
- paddingTop: number[];
160
- paddingLeft: number[];
161
- paddingRight: number[];
162
- paddingBottom: number[];
163
-
164
- overlayGap: number[];
165
- overlayBackgroundColor: string;
166
-
167
- toggleNavColor: string;
168
- toggleNavOpenColor: string;
169
- toggleNavBorderRadius: number;
170
- };
171
-
172
- main: {
173
- minHeight: string;
174
- backgroundColor: string;
175
- };
176
-
177
- section: {
178
- paddingTop: number[];
179
- paddingBottom: number[];
180
- };
181
-
182
- footer: {
183
- gap: number[];
184
- height: number[];
185
- backgroundColor: string;
186
-
187
- paddingTop: number[];
188
- paddingBottom: number[];
189
- };
190
-
191
- modal: {
192
- border: string;
193
- width: number[];
194
- borderRadius: number;
195
- backgroundColor: string;
196
-
197
- overlayBlur: number;
198
- overlayOpacity: number;
199
- overlayBackgroundColor: string;
200
-
201
- paddingTop: number[];
202
- paddingLeft: number[];
203
- paddingRight: number[];
204
- paddingBottom: number[];
205
- };
206
-
207
- languageSwitcher: {
208
- color: string;
209
- border: string;
210
- width: number[];
211
- borderRadius: number;
212
- backgroundColor: string;
213
-
214
- paddingTop: number[];
215
- paddingLeft: number[];
216
- paddingRight: number[];
217
- paddingBottom: number[];
218
- };
219
-
220
- carousel: {
221
- gap: number[];
222
- bullet: {
223
- width: number[];
224
- height: number[];
225
- borderRadius: number;
226
- backgroundColor: string;
227
- };
228
- };
229
-
230
- video: {
231
- playButton: {
232
- color: string;
233
- border: string;
234
- width: number[];
235
- height: number[];
236
- borderRadius: number;
237
- backgroundColor: string;
238
- };
239
- pauseButton: {
240
- color: string;
241
- border: string;
242
- width: number[];
243
- height: number[];
244
- borderRadius: number;
245
- backgroundColor: string;
246
- };
247
- soundButton: {
248
- color: string;
249
- border: string;
250
- width: number[];
251
- height: number[];
252
- borderRadius: number;
253
- backgroundColor: string;
254
- };
255
- closeButton: {
256
- color: string;
257
- border: string;
258
- width: number[];
259
- height: number[];
260
- borderRadius: number;
261
- backgroundColor: string;
262
- };
263
- };
264
-
265
- consentCookie: {
266
- borders: number;
267
- width: number[];
268
- borderRadius: number;
269
- backgroundColor: string;
270
-
271
- overlayBlur: number;
272
- overlayOpacity: number;
273
- overlayBackgroundColor: string;
274
-
275
- paddingTop: number[];
276
- paddingLeft: number[];
277
- paddingRight: number[];
278
- paddingBottom: number[];
279
-
280
- actionsGap: number;
281
- actionsPaddingTop: number[];
282
- };
283
-
284
- nav: {
285
- gap: number[];
286
- };
287
-
288
- navSocial: {
289
- gap: number[];
290
- };
291
-
292
- navLegal: {
293
- gap: number[];
294
- };
295
- }