@latte-macchiat-io/latte-vanilla-components 0.0.170 → 0.0.172
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/dist/components/Carousel/Carousel.css.ts +1 -2
- package/dist/components/Header/ToggleNav/styles.css.ts +2 -2
- package/dist/index.cjs.js +2 -2
- package/dist/index.es.js +1643 -1642
- package/dist/types/components/Form/TextField/TextField.d.ts +1 -1
- package/dist/types/components/Header/HeaderOverlay/index.d.ts +1 -3
- package/dist/types/index.d.ts +1 -1
- package/dist/utils/theme.css.ts +131 -0
- package/package.json +5 -7
- package/src/components/Carousel/Carousel.css.ts +1 -2
- package/src/components/Header/ToggleNav/styles.css.ts +2 -2
- package/src/utils/theme.css.ts +131 -0
- /package/dist/types/utils/{theme.d.ts → theme.css.d.ts} +0 -0
@@ -1,5 +1,5 @@
|
|
1
|
-
import { Sprinkles } from '../../../styles/sprinkles.css';
|
2
1
|
import { TextFieldVariants } from './TextField.css';
|
2
|
+
import { Sprinkles } from '../../../styles/sprinkles.css';
|
3
3
|
export type InputType = 'text' | 'email' | 'search' | 'number' | 'hidden' | 'password' | 'textarea';
|
4
4
|
export interface TextFieldProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'color' | 'onChange'>, Sprinkles, NonNullable<TextFieldVariants> {
|
5
5
|
css?: string;
|
@@ -1,9 +1,7 @@
|
|
1
|
-
import { Theme } from '../../../types/theme';
|
2
1
|
import { WithClassName } from '../../../types/withClassName';
|
3
2
|
export interface HeaderOverlayProps {
|
4
|
-
theme: Theme;
|
5
3
|
isOpen: boolean;
|
6
4
|
children: React.ReactNode;
|
7
5
|
}
|
8
|
-
declare const HeaderOverlay: ({
|
6
|
+
declare const HeaderOverlay: ({ isOpen, children, className }: HeaderOverlayProps & WithClassName) => import("react").JSX.Element;
|
9
7
|
export default HeaderOverlay;
|
package/dist/types/index.d.ts
CHANGED
@@ -51,4 +51,4 @@ export { Input, type InputProps, type InputType as InputFieldType } from './comp
|
|
51
51
|
export { type InputVariants } from './components/Form/TextField/Input/Input.css';
|
52
52
|
export { Textarea, type TextareaProps } from './components/Form/TextField/Textarea/Textarea';
|
53
53
|
export { type TextareaVariants } from './components/Form/TextField/Textarea/Textarea.css';
|
54
|
-
export { createDarkTheme, createLightTheme, type ThemeOverrides } from './utils/theme';
|
54
|
+
export { createDarkTheme, createLightTheme, type ThemeOverrides } from './utils/theme.css';
|
@@ -0,0 +1,131 @@
|
|
1
|
+
import { createGlobalTheme } from '@vanilla-extract/css';
|
2
|
+
import { baseDarkTheme, baseLightTheme } from '../theme/baseThemeValues';
|
3
|
+
import { themeContract } from '../theme/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: {
|
25
|
+
...baseLightTheme.colors,
|
26
|
+
...overrides.colors,
|
27
|
+
},
|
28
|
+
space: {
|
29
|
+
...baseLightTheme.space,
|
30
|
+
...overrides.space,
|
31
|
+
},
|
32
|
+
radii: {
|
33
|
+
...baseLightTheme.radii,
|
34
|
+
...overrides.radii,
|
35
|
+
},
|
36
|
+
fonts: {
|
37
|
+
...baseLightTheme.fonts,
|
38
|
+
...overrides.fonts,
|
39
|
+
},
|
40
|
+
maxWidth: `${baseLightTheme.maxWidth || overrides.maxWidth}`,
|
41
|
+
fontSizes: {
|
42
|
+
...baseLightTheme.fontSizes,
|
43
|
+
...overrides.fontSizes,
|
44
|
+
},
|
45
|
+
fontWeights: {
|
46
|
+
...baseLightTheme.fontWeights,
|
47
|
+
...overrides.fontWeights,
|
48
|
+
},
|
49
|
+
lineHeights: {
|
50
|
+
...baseLightTheme.lineHeights,
|
51
|
+
...overrides.lineHeights,
|
52
|
+
},
|
53
|
+
shadows: {
|
54
|
+
...baseLightTheme.shadows,
|
55
|
+
...overrides.shadows,
|
56
|
+
},
|
57
|
+
section: {
|
58
|
+
...baseLightTheme.section,
|
59
|
+
...overrides.section,
|
60
|
+
},
|
61
|
+
header: {
|
62
|
+
...baseLightTheme.header,
|
63
|
+
...overrides.header,
|
64
|
+
},
|
65
|
+
footer: {
|
66
|
+
...baseLightTheme.footer,
|
67
|
+
...overrides.footer,
|
68
|
+
},
|
69
|
+
});
|
70
|
+
};
|
71
|
+
|
72
|
+
// Utility to create a theme with partial overrides over dark theme base
|
73
|
+
const createAppDarkTheme = (selector: string, overrides: ThemeOverrides = {}) => {
|
74
|
+
return createGlobalTheme(selector, themeContract, {
|
75
|
+
colors: {
|
76
|
+
...baseDarkTheme.colors,
|
77
|
+
...overrides.colors,
|
78
|
+
},
|
79
|
+
space: {
|
80
|
+
...baseDarkTheme.space,
|
81
|
+
...overrides.space,
|
82
|
+
},
|
83
|
+
radii: {
|
84
|
+
...baseDarkTheme.radii,
|
85
|
+
...overrides.radii,
|
86
|
+
},
|
87
|
+
fonts: {
|
88
|
+
...baseDarkTheme.fonts,
|
89
|
+
...overrides.fonts,
|
90
|
+
},
|
91
|
+
maxWidth: `${baseLightTheme.maxWidth || overrides.maxWidth}`,
|
92
|
+
fontSizes: {
|
93
|
+
...baseLightTheme.fontSizes,
|
94
|
+
...overrides.fontSizes,
|
95
|
+
},
|
96
|
+
fontWeights: {
|
97
|
+
...baseLightTheme.fontWeights,
|
98
|
+
...overrides.fontWeights,
|
99
|
+
},
|
100
|
+
lineHeights: {
|
101
|
+
...baseLightTheme.lineHeights,
|
102
|
+
...overrides.lineHeights,
|
103
|
+
},
|
104
|
+
shadows: {
|
105
|
+
...baseLightTheme.shadows,
|
106
|
+
...overrides.shadows,
|
107
|
+
},
|
108
|
+
section: {
|
109
|
+
...baseLightTheme.section,
|
110
|
+
...overrides.section,
|
111
|
+
},
|
112
|
+
header: {
|
113
|
+
...baseLightTheme.header,
|
114
|
+
...overrides.header,
|
115
|
+
},
|
116
|
+
footer: {
|
117
|
+
...baseLightTheme.footer,
|
118
|
+
...overrides.footer,
|
119
|
+
},
|
120
|
+
});
|
121
|
+
};
|
122
|
+
|
123
|
+
// Convenience function for light theme (extends base light theme)
|
124
|
+
export const createLightTheme = (overrides: ThemeOverrides = {}) => {
|
125
|
+
return createAppTheme('html', overrides);
|
126
|
+
};
|
127
|
+
|
128
|
+
// Convenience function for dark theme (extends base dark theme)
|
129
|
+
export const createDarkTheme = (overrides: ThemeOverrides = {}) => {
|
130
|
+
return createAppDarkTheme('html[data-theme="dark"]', overrides);
|
131
|
+
};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@latte-macchiat-io/latte-vanilla-components",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.172",
|
4
4
|
"description": "Beautiful components for amazing projects, with a touch of Vanilla 🥤",
|
5
5
|
"main": "dist/index.cjs.js",
|
6
6
|
"module": "dist/index.es.js",
|
@@ -38,15 +38,14 @@
|
|
38
38
|
"@types/node": "^20",
|
39
39
|
"@types/react": "^19",
|
40
40
|
"@types/react-dom": "^19",
|
41
|
-
"@typescript-eslint/eslint-plugin": "8.
|
41
|
+
"@typescript-eslint/eslint-plugin": "^8.42.0",
|
42
42
|
"@vanilla-extract/css": "^1.17.4",
|
43
43
|
"@vanilla-extract/dynamic": "^2.1.5",
|
44
44
|
"@vanilla-extract/recipes": "^0.5.7",
|
45
45
|
"@vanilla-extract/sprinkles": "^1.6.5",
|
46
|
-
"@vitejs/plugin-react": "^
|
46
|
+
"@vitejs/plugin-react": "^5.0.2",
|
47
47
|
"clsx": "^2.1.1",
|
48
48
|
"eslint": "^9.15.0",
|
49
|
-
"eslint-config-next": "15.1.6",
|
50
49
|
"eslint-config-prettier": "^10.0.1",
|
51
50
|
"eslint-plugin-import": "^2.31.0",
|
52
51
|
"eslint-plugin-jsx-a11y": "^6.6.1",
|
@@ -55,9 +54,8 @@
|
|
55
54
|
"storybook": "^8.5.2",
|
56
55
|
"typescript": "5.6.3",
|
57
56
|
"typescript-eslint": "^8.21.0",
|
58
|
-
"vite": "^
|
59
|
-
"vite-plugin-dts": "^4.5.
|
60
|
-
"vite-plugin-static-copy": "^3.1.2"
|
57
|
+
"vite": "^7.1.4",
|
58
|
+
"vite-plugin-dts": "^4.5.4"
|
61
59
|
},
|
62
60
|
"engines": {
|
63
61
|
"node": ">=20.9.0",
|
@@ -2,8 +2,7 @@ import { keyframes, style } from '@vanilla-extract/css';
|
|
2
2
|
import { recipe, RecipeVariants } from '@vanilla-extract/recipes';
|
3
3
|
import { queries } from '../../styles/mediaqueries';
|
4
4
|
import { themeContract } from '../../theme';
|
5
|
-
|
6
|
-
const slideTransition = keyframes({
|
5
|
+
keyframes({
|
7
6
|
'0%': { transform: 'translateX(0)' },
|
8
7
|
'100%': { transform: 'translateX(var(--slide-offset))' },
|
9
8
|
});
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { createVar,
|
1
|
+
import { createVar, globalStyle, style } from '@vanilla-extract/css';
|
2
2
|
|
3
3
|
export const vars = {
|
4
4
|
displayOnDesktop: createVar(),
|
@@ -37,4 +37,4 @@ globalStyle(`${toggleNavBarStyle}[data-open="true"]:nth-of-type(1)`, {
|
|
37
37
|
|
38
38
|
globalStyle(`${toggleNavBarStyle}[data-open="true"]:nth-of-type(2)`, {
|
39
39
|
transform: 'rotate(-45deg) translate(4px, -3px)',
|
40
|
-
});
|
40
|
+
});
|
@@ -0,0 +1,131 @@
|
|
1
|
+
import { createGlobalTheme } from '@vanilla-extract/css';
|
2
|
+
import { baseDarkTheme, baseLightTheme } from '../theme/baseThemeValues';
|
3
|
+
import { themeContract } from '../theme/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: {
|
25
|
+
...baseLightTheme.colors,
|
26
|
+
...overrides.colors,
|
27
|
+
},
|
28
|
+
space: {
|
29
|
+
...baseLightTheme.space,
|
30
|
+
...overrides.space,
|
31
|
+
},
|
32
|
+
radii: {
|
33
|
+
...baseLightTheme.radii,
|
34
|
+
...overrides.radii,
|
35
|
+
},
|
36
|
+
fonts: {
|
37
|
+
...baseLightTheme.fonts,
|
38
|
+
...overrides.fonts,
|
39
|
+
},
|
40
|
+
maxWidth: `${baseLightTheme.maxWidth || overrides.maxWidth}`,
|
41
|
+
fontSizes: {
|
42
|
+
...baseLightTheme.fontSizes,
|
43
|
+
...overrides.fontSizes,
|
44
|
+
},
|
45
|
+
fontWeights: {
|
46
|
+
...baseLightTheme.fontWeights,
|
47
|
+
...overrides.fontWeights,
|
48
|
+
},
|
49
|
+
lineHeights: {
|
50
|
+
...baseLightTheme.lineHeights,
|
51
|
+
...overrides.lineHeights,
|
52
|
+
},
|
53
|
+
shadows: {
|
54
|
+
...baseLightTheme.shadows,
|
55
|
+
...overrides.shadows,
|
56
|
+
},
|
57
|
+
section: {
|
58
|
+
...baseLightTheme.section,
|
59
|
+
...overrides.section,
|
60
|
+
},
|
61
|
+
header: {
|
62
|
+
...baseLightTheme.header,
|
63
|
+
...overrides.header,
|
64
|
+
},
|
65
|
+
footer: {
|
66
|
+
...baseLightTheme.footer,
|
67
|
+
...overrides.footer,
|
68
|
+
},
|
69
|
+
});
|
70
|
+
};
|
71
|
+
|
72
|
+
// Utility to create a theme with partial overrides over dark theme base
|
73
|
+
const createAppDarkTheme = (selector: string, overrides: ThemeOverrides = {}) => {
|
74
|
+
return createGlobalTheme(selector, themeContract, {
|
75
|
+
colors: {
|
76
|
+
...baseDarkTheme.colors,
|
77
|
+
...overrides.colors,
|
78
|
+
},
|
79
|
+
space: {
|
80
|
+
...baseDarkTheme.space,
|
81
|
+
...overrides.space,
|
82
|
+
},
|
83
|
+
radii: {
|
84
|
+
...baseDarkTheme.radii,
|
85
|
+
...overrides.radii,
|
86
|
+
},
|
87
|
+
fonts: {
|
88
|
+
...baseDarkTheme.fonts,
|
89
|
+
...overrides.fonts,
|
90
|
+
},
|
91
|
+
maxWidth: `${baseLightTheme.maxWidth || overrides.maxWidth}`,
|
92
|
+
fontSizes: {
|
93
|
+
...baseLightTheme.fontSizes,
|
94
|
+
...overrides.fontSizes,
|
95
|
+
},
|
96
|
+
fontWeights: {
|
97
|
+
...baseLightTheme.fontWeights,
|
98
|
+
...overrides.fontWeights,
|
99
|
+
},
|
100
|
+
lineHeights: {
|
101
|
+
...baseLightTheme.lineHeights,
|
102
|
+
...overrides.lineHeights,
|
103
|
+
},
|
104
|
+
shadows: {
|
105
|
+
...baseLightTheme.shadows,
|
106
|
+
...overrides.shadows,
|
107
|
+
},
|
108
|
+
section: {
|
109
|
+
...baseLightTheme.section,
|
110
|
+
...overrides.section,
|
111
|
+
},
|
112
|
+
header: {
|
113
|
+
...baseLightTheme.header,
|
114
|
+
...overrides.header,
|
115
|
+
},
|
116
|
+
footer: {
|
117
|
+
...baseLightTheme.footer,
|
118
|
+
...overrides.footer,
|
119
|
+
},
|
120
|
+
});
|
121
|
+
};
|
122
|
+
|
123
|
+
// Convenience function for light theme (extends base light theme)
|
124
|
+
export const createLightTheme = (overrides: ThemeOverrides = {}) => {
|
125
|
+
return createAppTheme('html', overrides);
|
126
|
+
};
|
127
|
+
|
128
|
+
// Convenience function for dark theme (extends base dark theme)
|
129
|
+
export const createDarkTheme = (overrides: ThemeOverrides = {}) => {
|
130
|
+
return createAppDarkTheme('html[data-theme="dark"]', overrides);
|
131
|
+
};
|
File without changes
|