@latte-macchiat-io/latte-vanilla-components 0.0.185 → 0.0.186
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 +8 -12
- package/src/components/Button/stories.tsx +260 -0
- package/src/components/Footer/stories.tsx +1 -1
- package/src/components/Header/stories.tsx +1 -1
- package/src/components/Logo/stories.tsx +1 -1
- package/src/components/Modal/stories.tsx +408 -0
- package/src/components/Nav/stories.tsx +1 -1
- package/src/components/NavLegal/stories.tsx +1 -1
- package/src/components/Section/stories.tsx +344 -0
- package/src/index.ts +10 -10
- package/src/components/Actions/stories.tsx +0 -34
- package/src/components/ConsentCookie/stories.tsx +0 -28
- package/src/components/Form/Row/stories.tsx +0 -41
- package/src/components/Form/TextField/Textarea/stories.tsx +0 -44
- package/src/components/NavSocial/stories.tsx +0 -33
- package/src/themes/default.css.ts +0 -20
- package/src/utils/createCustomTheme.ts +0 -52
- package/src/utils/themeOverrides.ts +0 -10
@@ -0,0 +1,344 @@
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
2
|
+
import { Section } from './Section';
|
3
|
+
import { Button } from '../Button/Button';
|
4
|
+
|
5
|
+
const meta: Meta<typeof Section> = {
|
6
|
+
title: 'Layout Components/Section',
|
7
|
+
component: Section,
|
8
|
+
parameters: {
|
9
|
+
layout: 'fullscreen',
|
10
|
+
docs: {
|
11
|
+
description: {
|
12
|
+
component: `
|
13
|
+
The Section component provides consistent spacing and layout for content sections throughout your application.
|
14
|
+
|
15
|
+
## Features
|
16
|
+
- Consistent vertical spacing and padding
|
17
|
+
- Multiple alignment options (left, center, right)
|
18
|
+
- Dark mode support
|
19
|
+
- Full height option for hero sections
|
20
|
+
- Flexible spacing options (none, small, medium, large)
|
21
|
+
- Semantic HTML elements (section, div, main, article, aside)
|
22
|
+
- Theme-aware styling
|
23
|
+
- Responsive design
|
24
|
+
`,
|
25
|
+
},
|
26
|
+
},
|
27
|
+
},
|
28
|
+
tags: ['autodocs'],
|
29
|
+
argTypes: {
|
30
|
+
align: {
|
31
|
+
control: 'select',
|
32
|
+
options: ['left', 'center', 'right'],
|
33
|
+
description: 'Text alignment for the section content',
|
34
|
+
},
|
35
|
+
isDark: {
|
36
|
+
control: 'boolean',
|
37
|
+
description: 'Apply dark background styling',
|
38
|
+
},
|
39
|
+
isFullHeight: {
|
40
|
+
control: 'boolean',
|
41
|
+
description: 'Make the section take full viewport height',
|
42
|
+
},
|
43
|
+
spacing: {
|
44
|
+
control: 'select',
|
45
|
+
options: ['none', 'small', 'medium', 'large'],
|
46
|
+
description: 'Amount of vertical padding',
|
47
|
+
},
|
48
|
+
as: {
|
49
|
+
control: 'select',
|
50
|
+
options: ['section', 'div', 'main', 'article', 'aside'],
|
51
|
+
description: 'HTML element to render as',
|
52
|
+
},
|
53
|
+
},
|
54
|
+
};
|
55
|
+
|
56
|
+
export default meta;
|
57
|
+
type Story = StoryObj<typeof Section>;
|
58
|
+
|
59
|
+
export const Default: Story = {
|
60
|
+
args: {
|
61
|
+
children: (
|
62
|
+
<>
|
63
|
+
<h2>Default Section</h2>
|
64
|
+
<p>This is a default section with standard spacing and alignment.</p>
|
65
|
+
<Button variant="primary">Call to Action</Button>
|
66
|
+
</>
|
67
|
+
),
|
68
|
+
},
|
69
|
+
};
|
70
|
+
|
71
|
+
export const CenterAligned: Story = {
|
72
|
+
args: {
|
73
|
+
align: 'center',
|
74
|
+
children: (
|
75
|
+
<>
|
76
|
+
<h2>Centered Section</h2>
|
77
|
+
<p>This section has center-aligned content, perfect for hero sections or call-to-action areas.</p>
|
78
|
+
<Button variant="primary">Get Started</Button>
|
79
|
+
</>
|
80
|
+
),
|
81
|
+
},
|
82
|
+
};
|
83
|
+
|
84
|
+
export const RightAligned: Story = {
|
85
|
+
args: {
|
86
|
+
align: 'right',
|
87
|
+
children: (
|
88
|
+
<>
|
89
|
+
<h2>Right Aligned Section</h2>
|
90
|
+
<p>This section has right-aligned content.</p>
|
91
|
+
<Button variant="secondary">Learn More</Button>
|
92
|
+
</>
|
93
|
+
),
|
94
|
+
},
|
95
|
+
};
|
96
|
+
|
97
|
+
export const DarkSection: Story = {
|
98
|
+
args: {
|
99
|
+
isDark: true,
|
100
|
+
align: 'center',
|
101
|
+
children: (
|
102
|
+
<>
|
103
|
+
<h2 style={{ color: 'white' }}>Dark Section</h2>
|
104
|
+
<p style={{ color: 'rgba(255, 255, 255, 0.8)' }}>
|
105
|
+
This section has a dark background, great for creating visual contrast.
|
106
|
+
</p>
|
107
|
+
<Button variant="primary">Get Started</Button>
|
108
|
+
</>
|
109
|
+
),
|
110
|
+
},
|
111
|
+
};
|
112
|
+
|
113
|
+
export const FullHeight: Story = {
|
114
|
+
args: {
|
115
|
+
isFullHeight: true,
|
116
|
+
align: 'center',
|
117
|
+
children: (
|
118
|
+
<div style={{ display: 'flex', flexDirection: 'column', justifyContent: 'center', alignItems: 'center', height: '100%' }}>
|
119
|
+
<h1>Full Height Hero Section</h1>
|
120
|
+
<p style={{ fontSize: '1.2rem', marginBottom: '2rem', maxWidth: '600px' }}>
|
121
|
+
This section takes up the full viewport height, perfect for hero sections and landing page intros.
|
122
|
+
</p>
|
123
|
+
<div style={{ display: 'flex', gap: '1rem' }}>
|
124
|
+
<Button variant="primary" size="large">Get Started</Button>
|
125
|
+
<Button variant="secondary" size="large">Learn More</Button>
|
126
|
+
</div>
|
127
|
+
</div>
|
128
|
+
),
|
129
|
+
},
|
130
|
+
};
|
131
|
+
|
132
|
+
export const NoSpacing: Story = {
|
133
|
+
args: {
|
134
|
+
spacing: 'none',
|
135
|
+
children: (
|
136
|
+
<>
|
137
|
+
<h2>No Spacing Section</h2>
|
138
|
+
<p>This section has no vertical padding, useful when you want to control spacing manually.</p>
|
139
|
+
</>
|
140
|
+
),
|
141
|
+
},
|
142
|
+
};
|
143
|
+
|
144
|
+
export const SmallSpacing: Story = {
|
145
|
+
args: {
|
146
|
+
spacing: 'small',
|
147
|
+
children: (
|
148
|
+
<>
|
149
|
+
<h2>Small Spacing Section</h2>
|
150
|
+
<p>This section has reduced vertical padding for tighter layouts.</p>
|
151
|
+
</>
|
152
|
+
),
|
153
|
+
},
|
154
|
+
};
|
155
|
+
|
156
|
+
export const LargeSpacing: Story = {
|
157
|
+
args: {
|
158
|
+
spacing: 'large',
|
159
|
+
children: (
|
160
|
+
<>
|
161
|
+
<h2>Large Spacing Section</h2>
|
162
|
+
<p>This section has increased vertical padding for more breathing room.</p>
|
163
|
+
</>
|
164
|
+
),
|
165
|
+
},
|
166
|
+
};
|
167
|
+
|
168
|
+
export const AsMain: Story = {
|
169
|
+
args: {
|
170
|
+
as: 'main',
|
171
|
+
children: (
|
172
|
+
<>
|
173
|
+
<h1>Main Content Area</h1>
|
174
|
+
<p>This section is rendered as a main element for semantic HTML.</p>
|
175
|
+
</>
|
176
|
+
),
|
177
|
+
},
|
178
|
+
parameters: {
|
179
|
+
docs: {
|
180
|
+
description: {
|
181
|
+
story: 'Section rendered as a main element for the primary content area.',
|
182
|
+
},
|
183
|
+
},
|
184
|
+
},
|
185
|
+
};
|
186
|
+
|
187
|
+
export const AsArticle: Story = {
|
188
|
+
args: {
|
189
|
+
as: 'article',
|
190
|
+
children: (
|
191
|
+
<>
|
192
|
+
<h2>Article Section</h2>
|
193
|
+
<p>This section is rendered as an article element for standalone content.</p>
|
194
|
+
<p>Perfect for blog posts, news articles, or any self-contained content.</p>
|
195
|
+
</>
|
196
|
+
),
|
197
|
+
},
|
198
|
+
parameters: {
|
199
|
+
docs: {
|
200
|
+
description: {
|
201
|
+
story: 'Section rendered as an article element for standalone content.',
|
202
|
+
},
|
203
|
+
},
|
204
|
+
},
|
205
|
+
};
|
206
|
+
|
207
|
+
// Real-world Examples
|
208
|
+
export const HeroSection: Story = {
|
209
|
+
render: () => (
|
210
|
+
<Section isFullHeight={true} align="center" backgroundColor="primary">
|
211
|
+
<div style={{
|
212
|
+
color: 'white',
|
213
|
+
textAlign: 'center',
|
214
|
+
display: 'flex',
|
215
|
+
flexDirection: 'column',
|
216
|
+
justifyContent: 'center',
|
217
|
+
alignItems: 'center',
|
218
|
+
height: '100%',
|
219
|
+
maxWidth: '800px',
|
220
|
+
margin: '0 auto'
|
221
|
+
}}>
|
222
|
+
<h1 style={{ fontSize: '3rem', marginBottom: '1rem' }}>
|
223
|
+
Welcome to Our Platform
|
224
|
+
</h1>
|
225
|
+
<p style={{ fontSize: '1.25rem', marginBottom: '3rem', opacity: 0.9 }}>
|
226
|
+
Build amazing applications with our comprehensive component library.
|
227
|
+
Get started in minutes and scale to millions of users.
|
228
|
+
</p>
|
229
|
+
<div style={{ display: 'flex', gap: '1rem', flexWrap: 'wrap', justifyContent: 'center' }}>
|
230
|
+
<Button variant="secondary" size="large">Get Started Free</Button>
|
231
|
+
<Button variant="ghost" size="large" style={{ borderColor: 'white', color: 'white' }}>
|
232
|
+
Watch Demo
|
233
|
+
</Button>
|
234
|
+
</div>
|
235
|
+
</div>
|
236
|
+
</Section>
|
237
|
+
),
|
238
|
+
parameters: {
|
239
|
+
docs: {
|
240
|
+
description: {
|
241
|
+
story: 'A complete hero section example with full height and centered content.',
|
242
|
+
},
|
243
|
+
},
|
244
|
+
},
|
245
|
+
};
|
246
|
+
|
247
|
+
export const FeatureSection: Story = {
|
248
|
+
render: () => (
|
249
|
+
<Section spacing="large">
|
250
|
+
<div style={{ maxWidth: '1200px', margin: '0 auto' }}>
|
251
|
+
<div style={{ textAlign: 'center', marginBottom: '3rem' }}>
|
252
|
+
<h2 style={{ fontSize: '2.5rem', marginBottom: '1rem' }}>
|
253
|
+
Why Choose Our Components?
|
254
|
+
</h2>
|
255
|
+
<p style={{ fontSize: '1.1rem', color: 'var(--latte-colors-textSecondary)', maxWidth: '600px', margin: '0 auto' }}>
|
256
|
+
Built with modern best practices, accessibility in mind, and developer experience at the forefront.
|
257
|
+
</p>
|
258
|
+
</div>
|
259
|
+
|
260
|
+
<div style={{
|
261
|
+
display: 'grid',
|
262
|
+
gridTemplateColumns: 'repeat(auto-fit, minmax(300px, 1fr))',
|
263
|
+
gap: '2rem'
|
264
|
+
}}>
|
265
|
+
{[
|
266
|
+
{
|
267
|
+
title: '🎨 Theme System',
|
268
|
+
description: 'Flexible theming with light/dark modes and complete customization options.'
|
269
|
+
},
|
270
|
+
{
|
271
|
+
title: '⚡ Performance',
|
272
|
+
description: 'Zero-runtime CSS-in-JS with Vanilla Extract for optimal performance.'
|
273
|
+
},
|
274
|
+
{
|
275
|
+
title: '🔒 Type Safety',
|
276
|
+
description: 'Full TypeScript support with excellent IntelliSense and autocomplete.'
|
277
|
+
},
|
278
|
+
{
|
279
|
+
title: '📱 Responsive',
|
280
|
+
description: 'Mobile-first design with responsive utilities and breakpoint support.'
|
281
|
+
},
|
282
|
+
{
|
283
|
+
title: '♿ Accessible',
|
284
|
+
description: 'WCAG compliant components with proper ARIA attributes and keyboard navigation.'
|
285
|
+
},
|
286
|
+
{
|
287
|
+
title: '🚀 Developer Experience',
|
288
|
+
description: 'Great documentation, hot reloading, and intuitive component APIs.'
|
289
|
+
}
|
290
|
+
].map((feature, index) => (
|
291
|
+
<div key={index} style={{
|
292
|
+
padding: '2rem',
|
293
|
+
backgroundColor: 'var(--latte-colors-surface)',
|
294
|
+
borderRadius: 'var(--latte-radii-lg)',
|
295
|
+
border: '1px solid var(--latte-colors-border)'
|
296
|
+
}}>
|
297
|
+
<h3 style={{ marginBottom: '1rem', fontSize: '1.25rem' }}>
|
298
|
+
{feature.title}
|
299
|
+
</h3>
|
300
|
+
<p style={{ color: 'var(--latte-colors-textSecondary)' }}>
|
301
|
+
{feature.description}
|
302
|
+
</p>
|
303
|
+
</div>
|
304
|
+
))}
|
305
|
+
</div>
|
306
|
+
</div>
|
307
|
+
</Section>
|
308
|
+
),
|
309
|
+
parameters: {
|
310
|
+
docs: {
|
311
|
+
description: {
|
312
|
+
story: 'A feature showcase section with grid layout and cards.',
|
313
|
+
},
|
314
|
+
},
|
315
|
+
},
|
316
|
+
};
|
317
|
+
|
318
|
+
export const CallToActionSection: Story = {
|
319
|
+
render: () => (
|
320
|
+
<Section isDark={true} align="center" spacing="large">
|
321
|
+
<div style={{ color: 'white', textAlign: 'center', maxWidth: '600px', margin: '0 auto' }}>
|
322
|
+
<h2 style={{ fontSize: '2.5rem', marginBottom: '1rem' }}>
|
323
|
+
Ready to Get Started?
|
324
|
+
</h2>
|
325
|
+
<p style={{ fontSize: '1.1rem', marginBottom: '2rem', opacity: 0.9 }}>
|
326
|
+
Join thousands of developers building amazing applications with our component library.
|
327
|
+
</p>
|
328
|
+
<div style={{ display: 'flex', gap: '1rem', justifyContent: 'center', flexWrap: 'wrap' }}>
|
329
|
+
<Button variant="primary" size="large">Start Building</Button>
|
330
|
+
<Button variant="ghost" size="large" style={{ borderColor: 'white', color: 'white' }}>
|
331
|
+
View Documentation
|
332
|
+
</Button>
|
333
|
+
</div>
|
334
|
+
</div>
|
335
|
+
</Section>
|
336
|
+
),
|
337
|
+
parameters: {
|
338
|
+
docs: {
|
339
|
+
description: {
|
340
|
+
story: 'A call-to-action section with dark background and centered content.',
|
341
|
+
},
|
342
|
+
},
|
343
|
+
},
|
344
|
+
};
|
package/src/index.ts
CHANGED
@@ -86,19 +86,19 @@ export { type TextareaVariants } from './components/Form/TextField/Textarea/Text
|
|
86
86
|
|
87
87
|
export { ToRemove } from './components/ToRemove/ToRemove';
|
88
88
|
|
89
|
-
// Theme
|
90
|
-
export { createDarkTheme, createLightTheme, type ThemeOverrides } from './utils/theme';
|
91
|
-
export { createCustomLightTheme, createCustomDarkTheme, type ThemeOverrides as CustomThemeOverrides } from './utils/createCustomTheme';
|
92
|
-
export { createScopedTheme } from './utils/themeOverrides';
|
93
|
-
export { quickTheme, createQuickTheme } from './utils/quickTheme';
|
94
|
-
// Theme contract and values
|
89
|
+
// Theme System - Core Exports
|
95
90
|
export { themeContract } from './theme/contract.css';
|
96
91
|
export { baseLightTheme, baseDarkTheme } from './theme/baseThemeValues';
|
97
92
|
|
98
|
-
// Pre-built
|
93
|
+
// Pre-built Themes (Ready to Use)
|
99
94
|
export { lightTheme } from './themes/light.css';
|
100
95
|
export { darkTheme } from './themes/dark.css';
|
101
|
-
export { defaultTheme } from './themes/default.css';
|
102
96
|
|
103
|
-
// Theme
|
104
|
-
export {
|
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,34 +0,0 @@
|
|
1
|
-
// import type { Meta, StoryObj } from '@storybook/react';
|
2
|
-
|
3
|
-
// import { Actions, Button } from '../../index';
|
4
|
-
// import { actionsStyle } from './styles.css';
|
5
|
-
|
6
|
-
// import { defaultTheme } from '../../assets/styles/default-theme';
|
7
|
-
// import { buttonStyle } from '../Button/styles.css';
|
8
|
-
|
9
|
-
// // More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
|
10
|
-
// const meta: Meta<typeof Actions> = {
|
11
|
-
// title: 'Latte Components / 3. Buttons / Actions',
|
12
|
-
// component: Actions,
|
13
|
-
// parameters: {
|
14
|
-
// // Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
|
15
|
-
// layout: 'centered',
|
16
|
-
// },
|
17
|
-
// // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
|
18
|
-
// tags: ['autodocs'],
|
19
|
-
// // More on argTypes: https://storybook.js.org/docs/api/argtypes
|
20
|
-
// argTypes: {},
|
21
|
-
// // Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args
|
22
|
-
// };
|
23
|
-
|
24
|
-
// export default meta;
|
25
|
-
// type Story = StoryObj<typeof meta>;
|
26
|
-
|
27
|
-
// // More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
|
28
|
-
// export const Default: Story = {
|
29
|
-
// args: {
|
30
|
-
// theme: defaultTheme,
|
31
|
-
// className: actionsStyle,
|
32
|
-
// children: <Button className={buttonStyle}>Button</Button>,
|
33
|
-
// },
|
34
|
-
// };
|
@@ -1,28 +0,0 @@
|
|
1
|
-
// import type { Meta, StoryObj } from '@storybook/react';
|
2
|
-
//
|
3
|
-
// import { ConsentCookie } from '.';
|
4
|
-
//
|
5
|
-
// // More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
|
6
|
-
// const meta: Meta<typeof ConsentCookie> = {
|
7
|
-
// title: 'Latte Components / 5. Consent / Cookie',
|
8
|
-
// component: ConsentCookie,
|
9
|
-
// parameters: {
|
10
|
-
// // Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
|
11
|
-
// layout: 'centered',
|
12
|
-
// },
|
13
|
-
// // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
|
14
|
-
// tags: ['autodocs'],
|
15
|
-
// // More on argTypes: https://storybook.js.org/docs/api/argtypes
|
16
|
-
// argTypes: {},
|
17
|
-
// // Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args
|
18
|
-
// };
|
19
|
-
//
|
20
|
-
// export default meta;
|
21
|
-
// type Story = StoryObj<typeof meta>;
|
22
|
-
//
|
23
|
-
// // More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
|
24
|
-
// export const Default: Story = {
|
25
|
-
// args: {
|
26
|
-
// children: 'Cookies with your latte? In accordance with our cookies policy',
|
27
|
-
// },
|
28
|
-
// };
|
@@ -1,41 +0,0 @@
|
|
1
|
-
// import type { Meta, StoryObj } from '@storybook/react';
|
2
|
-
//
|
3
|
-
// import { TextField } from '../TextField';
|
4
|
-
//
|
5
|
-
// import { Row } from '.';
|
6
|
-
//
|
7
|
-
// // More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
|
8
|
-
// const meta: Meta<typeof Row> = {
|
9
|
-
// title: 'Latte Components / Form / Row',
|
10
|
-
// component: Row,
|
11
|
-
// parameters: {
|
12
|
-
// // Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
|
13
|
-
// layout: 'centered',
|
14
|
-
// },
|
15
|
-
// // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
|
16
|
-
// tags: ['autodocs'],
|
17
|
-
// // More on argTypes: https://storybook.js.org/docs/api/argtypes
|
18
|
-
// argTypes: {},
|
19
|
-
// // Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args
|
20
|
-
// };
|
21
|
-
//
|
22
|
-
// export default meta;
|
23
|
-
// type Story = StoryObj<typeof meta>;
|
24
|
-
//
|
25
|
-
// // More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
|
26
|
-
// export const Default: Story = {
|
27
|
-
// args: {
|
28
|
-
// children: <TextField name="hello" label="hello" />,
|
29
|
-
// },
|
30
|
-
// };
|
31
|
-
//
|
32
|
-
// export const MultipleChildren: Story = {
|
33
|
-
// args: {
|
34
|
-
// children: (
|
35
|
-
// <>
|
36
|
-
// <TextField name="hello" label="hello" />
|
37
|
-
// <TextField name="hello" label="hello" />
|
38
|
-
// </>
|
39
|
-
// ),
|
40
|
-
// },
|
41
|
-
// };
|
@@ -1,44 +0,0 @@
|
|
1
|
-
// import type { Meta, StoryObj } from '@storybook/react';
|
2
|
-
//
|
3
|
-
// import { TextFieldTextarea } from '../../../../index';
|
4
|
-
//
|
5
|
-
// // More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
|
6
|
-
// const meta: Meta<typeof TextFieldTextarea> = {
|
7
|
-
// title: 'Latte Components / Form / Text Field / Textarea',
|
8
|
-
// component: TextFieldTextarea,
|
9
|
-
// parameters: {
|
10
|
-
// // Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
|
11
|
-
// layout: 'centered',
|
12
|
-
// },
|
13
|
-
// // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
|
14
|
-
// tags: ['autodocs'],
|
15
|
-
// // More on argTypes: https://storybook.js.org/docs/api/argtypes
|
16
|
-
// argTypes: {},
|
17
|
-
// // Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args
|
18
|
-
// };
|
19
|
-
//
|
20
|
-
// export default meta;
|
21
|
-
// type Story = StoryObj<typeof meta>;
|
22
|
-
//
|
23
|
-
// // More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
|
24
|
-
// export const Default: Story = {
|
25
|
-
// args: {},
|
26
|
-
// };
|
27
|
-
//
|
28
|
-
// export const Placeholder: Story = {
|
29
|
-
// args: {
|
30
|
-
// placeholder: "It's a placeholder",
|
31
|
-
// },
|
32
|
-
// };
|
33
|
-
//
|
34
|
-
// export const Disabled: Story = {
|
35
|
-
// args: {
|
36
|
-
// disabled: true,
|
37
|
-
// },
|
38
|
-
// };
|
39
|
-
//
|
40
|
-
// export const Rows10: Story = {
|
41
|
-
// args: {
|
42
|
-
// rows: 10,
|
43
|
-
// },
|
44
|
-
// };
|
@@ -1,33 +0,0 @@
|
|
1
|
-
// import type { Meta, StoryObj } from '@storybook/react';
|
2
|
-
//
|
3
|
-
// import { NavSocial } from '../../index';
|
4
|
-
//
|
5
|
-
// // More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
|
6
|
-
// const meta: Meta<typeof NavSocial> = {
|
7
|
-
// title: 'Latte Components / 6. Nav / Social',
|
8
|
-
// component: NavSocial,
|
9
|
-
// parameters: {
|
10
|
-
// // Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
|
11
|
-
// layout: 'centered',
|
12
|
-
// },
|
13
|
-
// // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
|
14
|
-
// tags: ['autodocs'],
|
15
|
-
// // More on argTypes: https://storybook.js.org/docs/api/argtypes
|
16
|
-
// argTypes: {},
|
17
|
-
// // Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args
|
18
|
-
// };
|
19
|
-
//
|
20
|
-
// export default meta;
|
21
|
-
// type Story = StoryObj<typeof meta>;
|
22
|
-
//
|
23
|
-
// // More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
|
24
|
-
// export const Default: Story = {
|
25
|
-
// args: {
|
26
|
-
// navSocial: [
|
27
|
-
// {
|
28
|
-
// name: 'instagram',
|
29
|
-
// link: 'https://www.instagram.com/',
|
30
|
-
// },
|
31
|
-
// ],
|
32
|
-
// },
|
33
|
-
// };
|
@@ -1,20 +0,0 @@
|
|
1
|
-
import { createGlobalTheme } from '@vanilla-extract/css';
|
2
|
-
import { themeContract } from '../theme/contract.css';
|
3
|
-
import { baseLightTheme } from '../theme/baseThemeValues';
|
4
|
-
|
5
|
-
// Create a default theme for quick usage and RAD (Rapid Application Development)
|
6
|
-
// This provides a ready-to-use theme without any customization needed
|
7
|
-
export const defaultTheme = createGlobalTheme(':root', themeContract, {
|
8
|
-
colors: baseLightTheme.colors,
|
9
|
-
space: baseLightTheme.space,
|
10
|
-
radii: baseLightTheme.radii,
|
11
|
-
fonts: baseLightTheme.fonts,
|
12
|
-
maxWidth: baseLightTheme.maxWidth,
|
13
|
-
fontSizes: baseLightTheme.fontSizes,
|
14
|
-
fontWeights: baseLightTheme.fontWeights,
|
15
|
-
lineHeights: baseLightTheme.lineHeights,
|
16
|
-
shadows: baseLightTheme.shadows,
|
17
|
-
section: baseLightTheme.section,
|
18
|
-
header: baseLightTheme.header,
|
19
|
-
footer: baseLightTheme.footer,
|
20
|
-
});
|
@@ -1,52 +0,0 @@
|
|
1
|
-
import { baseLightTheme, baseDarkTheme } from '../theme/baseThemeValues';
|
2
|
-
|
3
|
-
// Type for partial theme overrides
|
4
|
-
export type ThemeOverrides = {
|
5
|
-
colors?: Partial<typeof baseLightTheme.colors>;
|
6
|
-
space?: Partial<typeof baseLightTheme.space>;
|
7
|
-
radii?: Partial<typeof baseLightTheme.radii>;
|
8
|
-
fonts?: Partial<typeof baseLightTheme.fonts>;
|
9
|
-
maxWidth?: string;
|
10
|
-
fontSizes?: Partial<typeof baseLightTheme.fontSizes>;
|
11
|
-
fontWeights?: Partial<typeof baseLightTheme.fontWeights>;
|
12
|
-
lineHeights?: Partial<typeof baseLightTheme.lineHeights>;
|
13
|
-
shadows?: Partial<typeof baseLightTheme.shadows>;
|
14
|
-
section?: Partial<typeof baseLightTheme.section>;
|
15
|
-
header?: Partial<typeof baseLightTheme.header>;
|
16
|
-
footer?: Partial<typeof baseLightTheme.footer>;
|
17
|
-
};
|
18
|
-
|
19
|
-
// Utility to merge overrides with base theme
|
20
|
-
export const createCustomLightTheme = (overrides: ThemeOverrides = {}) => {
|
21
|
-
return {
|
22
|
-
colors: { ...baseLightTheme.colors, ...overrides.colors },
|
23
|
-
space: { ...baseLightTheme.space, ...overrides.space },
|
24
|
-
radii: { ...baseLightTheme.radii, ...overrides.radii },
|
25
|
-
fonts: { ...baseLightTheme.fonts, ...overrides.fonts },
|
26
|
-
maxWidth: overrides.maxWidth || `${baseLightTheme.maxWidth}px`,
|
27
|
-
fontSizes: { ...baseLightTheme.fontSizes, ...overrides.fontSizes },
|
28
|
-
fontWeights: { ...baseLightTheme.fontWeights, ...overrides.fontWeights },
|
29
|
-
lineHeights: { ...baseLightTheme.lineHeights, ...overrides.lineHeights },
|
30
|
-
shadows: { ...baseLightTheme.shadows, ...overrides.shadows },
|
31
|
-
section: { ...baseLightTheme.section, ...overrides.section },
|
32
|
-
header: { ...baseLightTheme.header, ...overrides.header },
|
33
|
-
footer: { ...baseLightTheme.footer, ...overrides.footer },
|
34
|
-
};
|
35
|
-
};
|
36
|
-
|
37
|
-
export const createCustomDarkTheme = (overrides: ThemeOverrides = {}) => {
|
38
|
-
return {
|
39
|
-
colors: { ...baseDarkTheme.colors, ...overrides.colors },
|
40
|
-
space: { ...baseDarkTheme.space, ...overrides.space },
|
41
|
-
radii: { ...baseDarkTheme.radii, ...overrides.radii },
|
42
|
-
fonts: { ...baseDarkTheme.fonts, ...overrides.fonts },
|
43
|
-
maxWidth: overrides.maxWidth || `${baseDarkTheme.maxWidth}px`,
|
44
|
-
fontSizes: { ...baseDarkTheme.fontSizes, ...overrides.fontSizes },
|
45
|
-
fontWeights: { ...baseDarkTheme.fontWeights, ...overrides.fontWeights },
|
46
|
-
lineHeights: { ...baseDarkTheme.lineHeights, ...overrides.lineHeights },
|
47
|
-
shadows: { ...baseDarkTheme.shadows, ...overrides.shadows },
|
48
|
-
section: { ...baseDarkTheme.section, ...overrides.section },
|
49
|
-
header: { ...baseDarkTheme.header, ...overrides.header },
|
50
|
-
footer: { ...baseDarkTheme.footer, ...overrides.footer },
|
51
|
-
};
|
52
|
-
};
|
@@ -1,10 +0,0 @@
|
|
1
|
-
import { createGlobalTheme, createThemeContract } from '@vanilla-extract/css';
|
2
|
-
import { themeContract } from '../theme/contract.css';
|
3
|
-
|
4
|
-
// Create a higher-specificity theme that can override the base themes
|
5
|
-
export const themeOverrides = createThemeContract(themeContract);
|
6
|
-
|
7
|
-
// Export a utility to create CSS theme overrides with custom selectors
|
8
|
-
export const createScopedTheme = (selector: string, values: Partial<typeof themeContract>) => {
|
9
|
-
return createGlobalTheme(selector, themeContract, values as any);
|
10
|
-
};
|