@latte-macchiat-io/latte-vanilla-components 0.0.186 → 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 (51) hide show
  1. package/README.md +286 -10
  2. package/package.json +5 -3
  3. package/src/components/Actions/Actions.css.ts +1 -1
  4. package/src/components/Button/Button.css.ts +1 -1
  5. package/src/components/Button/stories.tsx +10 -17
  6. package/src/components/Carousel/Carousel.css.ts +1 -1
  7. package/src/components/Columns/Columns.css.ts +1 -1
  8. package/src/components/ConsentCookie/ConsentCookie.css.ts +1 -1
  9. package/src/components/Footer/Footer.css.ts +1 -1
  10. package/src/components/Form/Form.css.ts +1 -1
  11. package/src/components/Form/Row/Row.css.ts +1 -1
  12. package/src/components/Form/TextField/Input/Input.css.ts +1 -1
  13. package/src/components/Form/TextField/Label/Label.css.ts +1 -1
  14. package/src/components/Form/TextField/TextField.css.ts +1 -1
  15. package/src/components/Form/TextField/Textarea/Textarea.css.ts +1 -1
  16. package/src/components/Header/Header.css.ts +1 -1
  17. package/src/components/Header/HeaderOverlay/index.tsx +1 -1
  18. package/src/components/Header/HeaderOverlay/styles.css.ts +7 -7
  19. package/src/components/Header/ToggleNav/index.tsx +2 -5
  20. package/src/components/Icon/Icon.css.ts +0 -1
  21. package/src/components/KeyNumber/KeyNumber.css.ts +1 -1
  22. package/src/components/LanguageSwitcher/LanguageSwitcher.css.ts +1 -1
  23. package/src/components/Logo/Logo.css.ts +1 -1
  24. package/src/components/Logo/stories.tsx +1 -0
  25. package/src/components/Main/Main.css.ts +1 -1
  26. package/src/components/Modal/Modal.css.ts +1 -1
  27. package/src/components/Modal/stories.tsx +55 -89
  28. package/src/components/Nav/Nav.css.ts +1 -1
  29. package/src/components/Nav/Nav.tsx +1 -0
  30. package/src/components/NavLegal/NavLegal.css.ts +1 -1
  31. package/src/components/NavSocial/NavSocial.css.ts +1 -1
  32. package/src/components/Section/Section.css.ts +1 -1
  33. package/src/components/Section/stories.tsx +61 -61
  34. package/src/components/Video/Video.css.ts +1 -1
  35. package/src/components/VideoFullWidth/VideoFullWidth.css.ts +1 -1
  36. package/src/index.ts +9 -22
  37. package/src/styles/sprinkles.css.ts +1 -1
  38. package/src/themes/createTheme.css.ts +65 -0
  39. package/src/themes/dark.css.ts +4 -3
  40. package/src/themes/light.css.ts +3 -3
  41. package/src/types/withClassName.ts +1 -0
  42. package/src/assets/styles/default-theme.ts +0 -312
  43. package/src/assets/styles/mediaqueries.tsx +0 -24
  44. package/src/components/ToRemove/ToRemove.tsx +0 -3
  45. package/src/theme/index.ts +0 -6
  46. package/src/theme/utils.ts +0 -76
  47. package/src/types/theme.ts +0 -295
  48. package/src/utils/quickTheme.ts +0 -38
  49. package/src/utils/theme.ts +0 -131
  50. /package/src/{theme → themes}/baseThemeValues.ts +0 -0
  51. /package/src/{theme → themes}/contract.css.ts +0 -0
@@ -1,6 +1,6 @@
1
1
  import { createGlobalTheme } from '@vanilla-extract/css';
2
- import { themeContract } from '../theme/contract.css';
3
- import { baseLightTheme } from '../theme/baseThemeValues';
2
+ import { themeContract } from './/contract.css';
3
+ import { baseLightTheme } from './/baseThemeValues';
4
4
 
5
5
  // Create the light theme at module level so Vanilla Extract can process it
6
6
  export const lightTheme = createGlobalTheme(':root', themeContract, {
@@ -16,4 +16,4 @@ export const lightTheme = createGlobalTheme(':root', themeContract, {
16
16
  section: baseLightTheme.section,
17
17
  header: baseLightTheme.header,
18
18
  footer: baseLightTheme.footer,
19
- });
19
+ });
@@ -1,3 +1,4 @@
1
+ // TODO Could be removed and replaced by `React.HTMLAttributes<HTMLElement>` in most cases
1
2
  export type WithClassName = {
2
3
  className: string;
3
4
  };
@@ -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
- };