@latte-macchiat-io/latte-vanilla-components 0.0.217 → 0.0.219
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 +1 -1
- package/src/components/Header/HeaderToggleNav/index.tsx +1 -1
- package/src/components/Section/styles.css.ts +9 -0
- package/src/components/ThemeToggle/export.tsx +1 -0
- package/src/components/ThemeToggle/index.tsx +8 -3
- package/src/components/ThemeToggle/styles.css.ts +11 -0
- package/src/index.ts +2 -1
package/package.json
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
import { style } from '@vanilla-extract/css';
|
2
|
+
import { calc } from '@vanilla-extract/css-utils';
|
2
3
|
import { recipe, type RecipeVariants } from '@vanilla-extract/recipes';
|
3
4
|
|
4
5
|
import { themeContract } from '../../theme/contract.css';
|
@@ -67,6 +68,14 @@ export const sectionRecipe = recipe({
|
|
67
68
|
justifyContent: 'flex-start',
|
68
69
|
},
|
69
70
|
},
|
71
|
+
isHeaderFixed: {
|
72
|
+
true: {
|
73
|
+
// minHeight: calc.subtract('100vh', themeContract.header.height),
|
74
|
+
},
|
75
|
+
false: {
|
76
|
+
minHeight: '100vh',
|
77
|
+
},
|
78
|
+
},
|
70
79
|
withPaddingTop: {
|
71
80
|
true: {
|
72
81
|
'@media': {
|
@@ -0,0 +1 @@
|
|
1
|
+
export { ThemeToggle, type ThemeToggleProps } from './';
|
@@ -1,8 +1,13 @@
|
|
1
1
|
'use client';
|
2
2
|
|
3
|
+
import clsx from 'clsx';
|
3
4
|
import { useEffect, useState } from 'react';
|
4
5
|
|
5
|
-
|
6
|
+
import { themeToggleRecipe } from './styles.css';
|
7
|
+
|
8
|
+
export type ThemeToggleProps = React.HTMLAttributes<HTMLDivElement> & {};
|
9
|
+
|
10
|
+
export const ThemeToggle = ({ className }: ThemeToggleProps) => {
|
6
11
|
const [theme, setTheme] = useState<'light' | 'dark'>('light');
|
7
12
|
|
8
13
|
useEffect(() => {
|
@@ -23,8 +28,8 @@ export function ThemeToggle() {
|
|
23
28
|
};
|
24
29
|
|
25
30
|
return (
|
26
|
-
<button onClick={toggleTheme} aria-label="Toggle theme">
|
31
|
+
<button onClick={toggleTheme} aria-label="Toggle theme" className={clsx(themeToggleRecipe(), className)}>
|
27
32
|
{theme === 'light' ? '🌙' : '☀️'}
|
28
33
|
</button>
|
29
34
|
);
|
30
|
-
}
|
35
|
+
};
|
package/src/index.ts
CHANGED
@@ -8,7 +8,8 @@ export { sprinkles, type Sprinkles } from './styles/sprinkles.css';
|
|
8
8
|
export { breakpoints, queries } from './styles/mediaqueries';
|
9
9
|
|
10
10
|
// Components
|
11
|
-
|
11
|
+
|
12
|
+
export * from './components/ThemeToggle/export';
|
12
13
|
|
13
14
|
export * from './components/Actions/export';
|
14
15
|
export * from './components/Button/export';
|