@latte-macchiat-io/latte-vanilla-components 0.0.211 → 0.0.213

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@latte-macchiat-io/latte-vanilla-components",
3
- "version": "0.0.211",
3
+ "version": "0.0.213",
4
4
  "description": "Beautiful components for amazing projects, with a touch of Vanilla 🥤",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
@@ -1,17 +1,17 @@
1
1
  import { clsx } from 'clsx';
2
2
  import { useState } from 'react';
3
3
 
4
- import { headerOverlayRecipe, headerPlaceholder, headerRecipe, headerToggleNav } from './styles.css';
4
+ import { headerOverlayRecipe, headerPlaceholder, headerRecipe, headerToggleNav, HeaderToggleNavVariants } from './styles.css';
5
5
 
6
- export type HeaderProps = React.HTMLAttributes<HTMLDivElement> & {
7
- isFixed?: boolean;
8
- hideToggleNav?: boolean;
9
- children: React.ReactNode;
10
- childrenOverlay?: React.ReactNode;
11
- childrenToggleNav?: React.ReactNode;
12
- };
6
+ export type HeaderProps = React.HTMLAttributes<HTMLDivElement> &
7
+ HeaderToggleNavVariants & {
8
+ isFixed?: boolean;
9
+ children: React.ReactNode;
10
+ childrenOverlay?: React.ReactNode;
11
+ childrenToggleNav?: React.ReactNode;
12
+ };
13
13
 
14
- export const Header = ({ children, childrenOverlay, childrenToggleNav, isFixed = false, hideToggleNav = false, className }: HeaderProps) => {
14
+ export const Header = ({ children, childrenOverlay, childrenToggleNav, isFixed = false, visibility, className }: HeaderProps) => {
15
15
  const [isNavOpen, setNavOpen] = useState(false);
16
16
  const onToggleNav = () => setNavOpen(!isNavOpen);
17
17
 
@@ -22,8 +22,8 @@ export const Header = ({ children, childrenOverlay, childrenToggleNav, isFixed =
22
22
 
23
23
  {children}
24
24
 
25
- {!hideToggleNav && (
26
- <button onClick={onToggleNav} aria-label="Toggle navigation" className={headerToggleNav}>
25
+ {visibility !== 'hide' && (
26
+ <button onClick={onToggleNav} aria-label="Toggle navigation" className={headerToggleNav({ visibility })}>
27
27
  {childrenToggleNav}
28
28
  </button>
29
29
  )}
@@ -1,6 +1,6 @@
1
1
  import { style } from '@vanilla-extract/css';
2
2
  import { recipe } from '@vanilla-extract/recipes';
3
- import { themeContract } from '../..';
3
+ import { queries, themeContract } from '../..';
4
4
  import { generateResponsiveMedia } from '../../utils/generateResponsiveMedia';
5
5
 
6
6
  export const headerRecipe = recipe({
@@ -52,13 +52,6 @@ export const headerPlaceholder = style([
52
52
  },
53
53
  ]);
54
54
 
55
- export const headerToggleNav = style([
56
- {
57
- border: 0,
58
- zIndex: 30,
59
- },
60
- ]);
61
-
62
55
  export const headerOverlayRecipe = recipe({
63
56
  base: {
64
57
  inset: 0,
@@ -86,4 +79,30 @@ export const headerOverlayRecipe = recipe({
86
79
  },
87
80
  });
88
81
 
82
+ export const headerToggleNav = recipe({
83
+ base: {
84
+ border: 0,
85
+ zIndex: 30,
86
+ },
87
+
88
+ variants: {
89
+ visibility: {
90
+ show: { display: 'block' },
91
+ hide: { display: 'none' },
92
+ mobileOnly: {
93
+ display: 'block',
94
+ '@media': {
95
+ [queries.md]: {
96
+ display: 'none',
97
+ },
98
+ },
99
+ },
100
+ },
101
+ },
102
+ defaultVariants: {
103
+ visibility: 'mobileOnly',
104
+ },
105
+ });
106
+
107
+ export type HeaderToggleNavVariants = Parameters<typeof headerToggleNav>[0];
89
108
  export type HeaderOverlayVariants = Parameters<typeof headerOverlayRecipe>[0];
@@ -33,14 +33,14 @@ The Section component provides consistent spacing and layout for content section
33
33
  options: ['left', 'center', 'right'],
34
34
  description: 'Text alignment for the section content',
35
35
  },
36
- isDark: {
37
- control: 'boolean',
38
- description: 'Apply dark background styling',
39
- },
40
36
  isFullHeight: {
41
37
  control: 'boolean',
42
38
  description: 'Make the section take full viewport height',
43
39
  },
40
+ withPaddingTop: {
41
+ control: 'boolean',
42
+ description: '',
43
+ },
44
44
  },
45
45
  };
46
46
 
@@ -24,18 +24,15 @@ export const sectionRecipe = recipe({
24
24
 
25
25
  variants: {
26
26
  variant: {
27
- transparent: {
28
- color: themeContract.section.variant.transparent.color,
29
- backgroundColor: themeContract.section.variant.transparent.backgroundColor,
30
- },
31
27
  primary: {
32
- color: themeContract.section.variant.primary.color,
33
28
  backgroundColor: themeContract.section.variant.primary.backgroundColor,
34
29
  },
35
30
  secondary: {
36
- color: themeContract.section.variant.secondary.color,
37
31
  backgroundColor: themeContract.section.variant.secondary.backgroundColor,
38
32
  },
33
+ transparent: {
34
+ backgroundColor: themeContract.section.variant.transparent.backgroundColor,
35
+ },
39
36
  },
40
37
 
41
38
  align: {
@@ -9,10 +9,10 @@ const themeSectionBase = {
9
9
  '2xl': '50px',
10
10
  },
11
11
  paddingTop: {
12
- mobile: '15px',
13
- sm: '15px',
14
- md: '30px',
15
- lg: '30px',
12
+ mobile: '50px',
13
+ sm: '50px',
14
+ md: '50px',
15
+ lg: '50px',
16
16
  xl: '50px',
17
17
  '2xl': '50px',
18
18
  },
@@ -33,15 +33,12 @@ export const themeSectionLight = {
33
33
 
34
34
  variant: {
35
35
  transparent: {
36
- color: '',
37
36
  backgroundColor: '',
38
37
  },
39
38
  primary: {
40
- color: '',
41
39
  backgroundColor: '',
42
40
  },
43
41
  secondary: {
44
- color: '',
45
42
  backgroundColor: '',
46
43
  },
47
44
  },
@@ -54,15 +51,12 @@ export const themeSectionDark = {
54
51
 
55
52
  variant: {
56
53
  transparent: {
57
- color: '',
58
54
  backgroundColor: '',
59
55
  },
60
56
  primary: {
61
- color: '',
62
57
  backgroundColor: '',
63
58
  },
64
59
  secondary: {
65
- color: '',
66
60
  backgroundColor: '',
67
61
  },
68
62
  },
@@ -114,15 +114,12 @@ export const themeContract = createGlobalThemeContract({
114
114
  section: {
115
115
  variant: {
116
116
  transparent: {
117
- color: 'latte-section-variant-transparent-color',
118
117
  backgroundColor: 'latte-section-variant-transparent-backgroundColor',
119
118
  },
120
119
  primary: {
121
- color: 'latte-section-variant-primary-color',
122
120
  backgroundColor: 'latte-section-variant-primary-backgroundColor',
123
121
  },
124
122
  secondary: {
125
- color: 'latte-section-variant-secondary-color',
126
123
  backgroundColor: 'latte-section-variant-secondary-backgroundColor',
127
124
  },
128
125
  },