@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
@@ -102,9 +102,7 @@ export const DarkSection: Story = {
102
102
  children: (
103
103
  <>
104
104
  <h2 style={{ color: 'white' }}>Dark Section</h2>
105
- <p style={{ color: 'rgba(255, 255, 255, 0.8)' }}>
106
- This section has a dark background, great for creating visual contrast.
107
- </p>
105
+ <p style={{ color: 'rgba(255, 255, 255, 0.8)' }}>This section has a dark background, great for creating visual contrast.</p>
108
106
  <Button variant="primary">Get Started</Button>
109
107
  </>
110
108
  ),
@@ -122,8 +120,12 @@ export const FullHeight: Story = {
122
120
  This section takes up the full viewport height, perfect for hero sections and landing page intros.
123
121
  </p>
124
122
  <div style={{ display: 'flex', gap: '1rem' }}>
125
- <Button variant="primary" size="large">Get Started</Button>
126
- <Button variant="secondary" size="large">Learn More</Button>
123
+ <Button variant="primary" size="lg">
124
+ Get Started
125
+ </Button>
126
+ <Button variant="secondary" size="lg">
127
+ Learn More
128
+ </Button>
127
129
  </div>
128
130
  </div>
129
131
  ),
@@ -144,7 +146,7 @@ export const NoSpacing: Story = {
144
146
 
145
147
  export const SmallSpacing: Story = {
146
148
  args: {
147
- spacing: 'small',
149
+ spacing: 'sm',
148
150
  children: (
149
151
  <>
150
152
  <h2>Small Spacing Section</h2>
@@ -156,7 +158,7 @@ export const SmallSpacing: Story = {
156
158
 
157
159
  export const LargeSpacing: Story = {
158
160
  args: {
159
- spacing: 'large',
161
+ spacing: 'lg',
160
162
  children: (
161
163
  <>
162
164
  <h2>Large Spacing Section</h2>
@@ -209,27 +211,27 @@ export const AsArticle: Story = {
209
211
  export const HeroSection: Story = {
210
212
  render: () => (
211
213
  <Section isFullHeight={true} align="center" backgroundColor="primary">
212
- <div style={{
213
- color: 'white',
214
- textAlign: 'center',
215
- display: 'flex',
216
- flexDirection: 'column',
217
- justifyContent: 'center',
218
- alignItems: 'center',
219
- height: '100%',
220
- maxWidth: '800px',
221
- margin: '0 auto'
222
- }}>
223
- <h1 style={{ fontSize: '3rem', marginBottom: '1rem' }}>
224
- Welcome to Our Platform
225
- </h1>
214
+ <div
215
+ style={{
216
+ color: 'white',
217
+ textAlign: 'center',
218
+ display: 'flex',
219
+ flexDirection: 'column',
220
+ justifyContent: 'center',
221
+ alignItems: 'center',
222
+ height: '100%',
223
+ maxWidth: '800px',
224
+ margin: '0 auto',
225
+ }}>
226
+ <h1 style={{ fontSize: '3rem', marginBottom: '1rem' }}>Welcome to Our Platform</h1>
226
227
  <p style={{ fontSize: '1.25rem', marginBottom: '3rem', opacity: 0.9 }}>
227
- Build amazing applications with our comprehensive component library.
228
- Get started in minutes and scale to millions of users.
228
+ Build amazing applications with our comprehensive component library. Get started in minutes and scale to millions of users.
229
229
  </p>
230
230
  <div style={{ display: 'flex', gap: '1rem', flexWrap: 'wrap', justifyContent: 'center' }}>
231
- <Button variant="secondary" size="large">Get Started Free</Button>
232
- <Button variant="ghost" size="large" style={{ borderColor: 'white', color: 'white' }}>
231
+ <Button variant="secondary" size="lg">
232
+ Get Started Free
233
+ </Button>
234
+ <Button variant="ghost" size="lg" style={{ borderColor: 'white', color: 'white' }}>
233
235
  Watch Demo
234
236
  </Button>
235
237
  </div>
@@ -247,60 +249,57 @@ export const HeroSection: Story = {
247
249
 
248
250
  export const FeatureSection: Story = {
249
251
  render: () => (
250
- <Section spacing="large">
252
+ <Section spacing="lg">
251
253
  <div style={{ maxWidth: '1200px', margin: '0 auto' }}>
252
254
  <div style={{ textAlign: 'center', marginBottom: '3rem' }}>
253
- <h2 style={{ fontSize: '2.5rem', marginBottom: '1rem' }}>
254
- Why Choose Our Components?
255
- </h2>
255
+ <h2 style={{ fontSize: '2.5rem', marginBottom: '1rem' }}>Why Choose Our Components?</h2>
256
256
  <p style={{ fontSize: '1.1rem', color: 'var(--latte-colors-textSecondary)', maxWidth: '600px', margin: '0 auto' }}>
257
257
  Built with modern best practices, accessibility in mind, and developer experience at the forefront.
258
258
  </p>
259
259
  </div>
260
-
261
- <div style={{
262
- display: 'grid',
263
- gridTemplateColumns: 'repeat(auto-fit, minmax(300px, 1fr))',
264
- gap: '2rem'
265
- }}>
260
+
261
+ <div
262
+ style={{
263
+ display: 'grid',
264
+ gridTemplateColumns: 'repeat(auto-fit, minmax(300px, 1fr))',
265
+ gap: '2rem',
266
+ }}>
266
267
  {[
267
268
  {
268
269
  title: '🎨 Theme System',
269
- description: 'Flexible theming with light/dark modes and complete customization options.'
270
+ description: 'Flexible theming with light/dark modes and complete customization options.',
270
271
  },
271
272
  {
272
273
  title: '⚡ Performance',
273
- description: 'Zero-runtime CSS-in-JS with Vanilla Extract for optimal performance.'
274
+ description: 'Zero-runtime CSS-in-JS with Vanilla Extract for optimal performance.',
274
275
  },
275
276
  {
276
277
  title: '🔒 Type Safety',
277
- description: 'Full TypeScript support with excellent IntelliSense and autocomplete.'
278
+ description: 'Full TypeScript support with excellent IntelliSense and autocomplete.',
278
279
  },
279
280
  {
280
281
  title: '📱 Responsive',
281
- description: 'Mobile-first design with responsive utilities and breakpoint support.'
282
+ description: 'Mobile-first design with responsive utilities and breakpoint support.',
282
283
  },
283
284
  {
284
285
  title: '♿ Accessible',
285
- description: 'WCAG compliant components with proper ARIA attributes and keyboard navigation.'
286
+ description: 'WCAG compliant components with proper ARIA attributes and keyboard navigation.',
286
287
  },
287
288
  {
288
289
  title: '🚀 Developer Experience',
289
- description: 'Great documentation, hot reloading, and intuitive component APIs.'
290
- }
290
+ description: 'Great documentation, hot reloading, and intuitive component APIs.',
291
+ },
291
292
  ].map((feature, index) => (
292
- <div key={index} style={{
293
- padding: '2rem',
294
- backgroundColor: 'var(--latte-colors-surface)',
295
- borderRadius: 'var(--latte-radii-lg)',
296
- border: '1px solid var(--latte-colors-border)'
297
- }}>
298
- <h3 style={{ marginBottom: '1rem', fontSize: '1.25rem' }}>
299
- {feature.title}
300
- </h3>
301
- <p style={{ color: 'var(--latte-colors-textSecondary)' }}>
302
- {feature.description}
303
- </p>
293
+ <div
294
+ key={index}
295
+ style={{
296
+ padding: '2rem',
297
+ backgroundColor: 'var(--latte-colors-surface)',
298
+ borderRadius: 'var(--latte-radii-lg)',
299
+ border: '1px solid var(--latte-colors-border)',
300
+ }}>
301
+ <h3 style={{ marginBottom: '1rem', fontSize: '1.25rem' }}>{feature.title}</h3>
302
+ <p style={{ color: 'var(--latte-colors-textSecondary)' }}>{feature.description}</p>
304
303
  </div>
305
304
  ))}
306
305
  </div>
@@ -318,17 +317,17 @@ export const FeatureSection: Story = {
318
317
 
319
318
  export const CallToActionSection: Story = {
320
319
  render: () => (
321
- <Section isDark={true} align="center" spacing="large">
320
+ <Section isDark={true} align="center" spacing="lg">
322
321
  <div style={{ color: 'white', textAlign: 'center', maxWidth: '600px', margin: '0 auto' }}>
323
- <h2 style={{ fontSize: '2.5rem', marginBottom: '1rem' }}>
324
- Ready to Get Started?
325
- </h2>
322
+ <h2 style={{ fontSize: '2.5rem', marginBottom: '1rem' }}>Ready to Get Started?</h2>
326
323
  <p style={{ fontSize: '1.1rem', marginBottom: '2rem', opacity: 0.9 }}>
327
324
  Join thousands of developers building amazing applications with our component library.
328
325
  </p>
329
326
  <div style={{ display: 'flex', gap: '1rem', justifyContent: 'center', flexWrap: 'wrap' }}>
330
- <Button variant="primary" size="large">Start Building</Button>
331
- <Button variant="ghost" size="large" style={{ borderColor: 'white', color: 'white' }}>
327
+ <Button variant="primary" size="lg">
328
+ Start Building
329
+ </Button>
330
+ <Button variant="ghost" size="lg" style={{ borderColor: 'white', color: 'white' }}>
332
331
  View Documentation
333
332
  </Button>
334
333
  </div>
@@ -342,4 +341,4 @@ export const CallToActionSection: Story = {
342
341
  },
343
342
  },
344
343
  },
345
- };
344
+ };
@@ -1,6 +1,6 @@
1
1
  import { style } from '@vanilla-extract/css';
2
2
  import { recipe, RecipeVariants } from '@vanilla-extract/recipes';
3
- import { themeContract } from '../../theme/contract.css';
3
+ import { themeContract } from '../../themes/contract.css';
4
4
 
5
5
  const videoBase = style({
6
6
  position: 'relative',
@@ -1,6 +1,6 @@
1
1
  import { style } from '@vanilla-extract/css';
2
2
  import { recipe, RecipeVariants } from '@vanilla-extract/recipes';
3
- import { themeContract } from '../../theme/contract.css';
3
+ import { themeContract } from '../../themes/contract.css';
4
4
 
5
5
  const videoFullWidthBase = style({
6
6
  height: 0,
package/src/index.ts CHANGED
@@ -1,11 +1,17 @@
1
1
  // Theme system - Import this first to apply global styles
2
- export * from './theme';
2
+ export { themeContract } from './themes/contract.css';
3
+ export { baseLightTheme, baseDarkTheme } from './themes/baseThemeValues';
4
+ export { createLightTheme, createDarkTheme, type ThemeOverrides } from './themes/createTheme.css';
3
5
 
4
- // Styles utilities
6
+ // Available themes
7
+ export { lightTheme } from './themes/light.css';
8
+ export { darkTheme } from './themes/dark.css';
9
+
10
+ // Styles utilities (sprinkles, media queries, etc.)
5
11
  export { sprinkles, responsiveProperties, type Sprinkles } from './styles/sprinkles.css';
6
12
  export { breakpoints, queries } from './styles/mediaqueries';
7
13
 
8
- // Vanilla Extract Components (fully migrated)
14
+ // Components
9
15
  export { Button, type ButtonProps } from './components/Button/Button';
10
16
  export { type ButtonVariants } from './components/Button/Button.css';
11
17
 
@@ -83,22 +89,3 @@ export { type InputVariants } from './components/Form/TextField/Input/Input.css'
83
89
 
84
90
  export { Textarea, type TextareaProps } from './components/Form/TextField/Textarea/Textarea';
85
91
  export { type TextareaVariants } from './components/Form/TextField/Textarea/Textarea.css';
86
-
87
- export { ToRemove } from './components/ToRemove/ToRemove';
88
-
89
- // Theme System - Core Exports
90
- export { themeContract } from './theme/contract.css';
91
- export { baseLightTheme, baseDarkTheme } from './theme/baseThemeValues';
92
-
93
- // Pre-built Themes (Ready to Use)
94
- export { lightTheme } from './themes/light.css';
95
- export { darkTheme } from './themes/dark.css';
96
-
97
- // Quick Theme Utilities (For Rapid Development)
98
- export { quickTheme, createQuickTheme } from './utils/quickTheme';
99
-
100
- // Advanced Theme Creation
101
- export { createDarkTheme, createLightTheme, type ThemeOverrides } from './utils/theme';
102
-
103
- // Theme Management Utilities
104
- export { toggleTheme, setTheme, getCurrentTheme } from './theme/utils';
@@ -1,6 +1,6 @@
1
1
  import { createSprinkles, defineProperties } from '@vanilla-extract/sprinkles';
2
2
  import { queries } from './mediaqueries';
3
- import { themeContract } from '../theme';
3
+ import { themeContract } from '../themes/contract.css';
4
4
 
5
5
  const responsiveProperties = defineProperties({
6
6
  conditions: {
@@ -0,0 +1,65 @@
1
+ import { createGlobalTheme } from '@vanilla-extract/css';
2
+ import { baseDarkTheme, baseLightTheme } from './baseThemeValues';
3
+ import { themeContract } from './contract.css';
4
+
5
+ // Type for partial theme overrides
6
+ export type ThemeOverrides = {
7
+ colors?: Partial<typeof baseLightTheme.colors>;
8
+ space?: Partial<typeof baseLightTheme.space>;
9
+ radii?: Partial<typeof baseLightTheme.radii>;
10
+ fonts?: Partial<typeof baseLightTheme.fonts>;
11
+ maxWidth?: Partial<typeof baseLightTheme.maxWidth>;
12
+ fontSizes?: Partial<typeof baseLightTheme.fontSizes>;
13
+ fontWeights?: Partial<typeof baseLightTheme.fontSizes>;
14
+ lineHeights?: Partial<typeof baseLightTheme.fontSizes>;
15
+ shadows?: Partial<typeof baseLightTheme.fontSizes>;
16
+ section?: Partial<typeof baseLightTheme.fontSizes>;
17
+ header?: Partial<typeof baseLightTheme.fontSizes>;
18
+ footer?: Partial<typeof baseLightTheme.fontSizes>;
19
+ };
20
+
21
+ // Utility to create a theme with partial overrides over light theme base
22
+ const createAppTheme = (selector: string, overrides: ThemeOverrides = {}) => {
23
+ return createGlobalTheme(selector, themeContract, {
24
+ colors: { ...baseLightTheme.colors, ...overrides.colors },
25
+ space: { ...baseLightTheme.space, ...overrides.space },
26
+ radii: { ...baseLightTheme.radii, ...overrides.radii },
27
+ fonts: { ...baseLightTheme.fonts, ...overrides.fonts },
28
+ maxWidth: `${baseLightTheme.maxWidth || overrides.maxWidth}`,
29
+ fontSizes: { ...baseLightTheme.fontSizes, ...overrides.fontSizes },
30
+ fontWeights: { ...baseLightTheme.fontWeights, ...overrides.fontWeights },
31
+ lineHeights: { ...baseLightTheme.lineHeights, ...overrides.lineHeights },
32
+ shadows: { ...baseLightTheme.shadows, ...overrides.shadows },
33
+ section: { ...baseLightTheme.section, ...overrides.section },
34
+ header: { ...baseLightTheme.header, ...overrides.header },
35
+ footer: { ...baseLightTheme.footer, ...overrides.footer },
36
+ });
37
+ };
38
+
39
+ // Utility to create a theme with partial overrides over dark theme base
40
+ const createAppDarkTheme = (selector: string, overrides: ThemeOverrides = {}) => {
41
+ return createGlobalTheme(selector, themeContract, {
42
+ colors: { ...baseDarkTheme.colors, ...overrides.colors },
43
+ space: { ...baseDarkTheme.space, ...overrides.space },
44
+ radii: { ...baseDarkTheme.radii, ...overrides.radii },
45
+ fonts: { ...baseDarkTheme.fonts, ...overrides.fonts },
46
+ maxWidth: overrides.maxWidth || `${baseDarkTheme.maxWidth}px`,
47
+ fontSizes: { ...baseDarkTheme.fontSizes, ...overrides.fontSizes },
48
+ fontWeights: { ...baseDarkTheme.fontWeights, ...overrides.fontWeights },
49
+ lineHeights: { ...baseDarkTheme.lineHeights, ...overrides.lineHeights },
50
+ shadows: { ...baseDarkTheme.shadows, ...overrides.shadows },
51
+ section: { ...baseDarkTheme.section, ...overrides.section },
52
+ header: { ...baseDarkTheme.header, ...overrides.header },
53
+ footer: { ...baseDarkTheme.footer, ...overrides.footer },
54
+ });
55
+ };
56
+
57
+ // Convenience function for light theme (extends base light theme)
58
+ export const createLightTheme = (overrides: ThemeOverrides = {}) => {
59
+ return createAppTheme('html', overrides);
60
+ };
61
+
62
+ // Convenience function for dark theme (extends base dark theme)
63
+ export const createDarkTheme = (overrides: ThemeOverrides = {}) => {
64
+ return createAppDarkTheme('html[data-theme="dark"]', overrides);
65
+ };
@@ -1,8 +1,9 @@
1
1
  import { createGlobalTheme } from '@vanilla-extract/css';
2
- import { themeContract } from '../theme/contract.css';
3
- import { baseDarkTheme } from '../theme/baseThemeValues';
2
+ import { baseDarkTheme } from './baseThemeValues';
3
+ import { themeContract } from './contract.css';
4
4
 
5
5
  // Create the dark theme at module level so Vanilla Extract can process it
6
+ // The dark theme will only be applied when the html element has a data-theme="dark" attribute
6
7
  export const darkTheme = createGlobalTheme('html[data-theme="dark"]', themeContract, {
7
8
  colors: baseDarkTheme.colors,
8
9
  space: baseDarkTheme.space,
@@ -16,4 +17,4 @@ export const darkTheme = createGlobalTheme('html[data-theme="dark"]', themeContr
16
17
  section: baseDarkTheme.section,
17
18
  header: baseDarkTheme.header,
18
19
  footer: baseDarkTheme.footer,
19
- });
20
+ });
@@ -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
  };