@latte-macchiat-io/latte-vanilla-components 0.0.199 → 0.0.201
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/Actions/export.tsx +2 -4
- package/src/components/Actions/index.tsx +2 -7
- package/src/components/Actions/stories.tsx +29 -0
- package/src/components/Actions/styles.css.ts +1 -0
- package/src/components/Actions/theme.ts +40 -0
- package/src/components/Button/index.tsx +0 -2
- package/src/components/Carousel/index.tsx +0 -2
- package/src/components/Columns/index.tsx +0 -2
- package/src/components/ConsentCookie/ConsentCookie.tsx +0 -2
- package/src/components/Footer/index.tsx +0 -2
- package/src/components/Form/Form.tsx +0 -2
- package/src/components/Form/Row/Row.tsx +0 -2
- package/src/components/Form/TextField/Input/Input.tsx +0 -2
- package/src/components/Form/TextField/Label/Label.tsx +0 -2
- package/src/components/Form/TextField/Textarea/Textarea.tsx +0 -2
- package/src/components/Header/index.tsx +0 -2
- package/src/components/KeyNumber/index.tsx +0 -2
- package/src/components/LanguageSwitcher/index.tsx +0 -2
- package/src/components/Modal/index.tsx +0 -2
- package/src/components/Nav/index.tsx +0 -2
- package/src/components/NavLegal/index.tsx +0 -2
- package/src/components/NavSocial/index.tsx +0 -2
- package/src/components/Section/index.tsx +0 -2
- package/src/components/Video/index.tsx +0 -4
- package/src/index.ts +3 -3
- package/src/theme/baseThemeValues.ts +4 -52
package/package.json
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
'use client';
|
2
|
-
|
3
1
|
import { clsx } from 'clsx';
|
4
2
|
import { forwardRef } from 'react';
|
5
3
|
|
@@ -7,14 +5,11 @@ import { actionsRecipe, type ActionsVariants } from './styles.css';
|
|
7
5
|
|
8
6
|
export type ActionsProps = React.HTMLAttributes<HTMLDivElement> &
|
9
7
|
ActionsVariants & {
|
10
|
-
css?: string;
|
11
8
|
children: React.ReactNode;
|
12
9
|
};
|
13
10
|
|
14
|
-
export const Actions = forwardRef<HTMLDivElement, ActionsProps>(({ align, direction,
|
15
|
-
<div ref={ref} className={clsx(actionsRecipe({ align, direction }),
|
11
|
+
export const Actions = forwardRef<HTMLDivElement, ActionsProps>(({ align, direction, className, children }, ref) => (
|
12
|
+
<div ref={ref} className={clsx(actionsRecipe({ align, direction }), className)}>
|
16
13
|
{children}
|
17
14
|
</div>
|
18
15
|
));
|
19
|
-
|
20
|
-
Actions.displayName = 'Actions';
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
2
|
+
import React from 'react';
|
3
|
+
|
4
|
+
import { Actions } from '.';
|
5
|
+
|
6
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
|
7
|
+
const meta: Meta<typeof Actions> = {
|
8
|
+
title: 'Latte Components / 1. Global / Actions',
|
9
|
+
component: Actions,
|
10
|
+
parameters: {
|
11
|
+
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
|
12
|
+
layout: 'centered',
|
13
|
+
},
|
14
|
+
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
|
15
|
+
tags: ['autodocs'],
|
16
|
+
// More on argTypes: https://storybook.js.org/docs/api/argtypes
|
17
|
+
argTypes: {},
|
18
|
+
// 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
|
19
|
+
};
|
20
|
+
|
21
|
+
export default meta;
|
22
|
+
type Story = StoryObj<typeof meta>;
|
23
|
+
|
24
|
+
// More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
|
25
|
+
export const Default: Story = {
|
26
|
+
args: {
|
27
|
+
children: <div>hello</div>,
|
28
|
+
},
|
29
|
+
};
|
@@ -0,0 +1,40 @@
|
|
1
|
+
const themeActionsBase = {
|
2
|
+
actions: {
|
3
|
+
gap: {
|
4
|
+
mobile: '15px',
|
5
|
+
sm: '15px',
|
6
|
+
md: '30px',
|
7
|
+
lg: '30px',
|
8
|
+
xl: '50px',
|
9
|
+
'2xl': '50px',
|
10
|
+
},
|
11
|
+
paddingTop: {
|
12
|
+
mobile: '15px',
|
13
|
+
sm: '15px',
|
14
|
+
md: '30px',
|
15
|
+
lg: '30px',
|
16
|
+
xl: '50px',
|
17
|
+
'2xl': '50px',
|
18
|
+
},
|
19
|
+
paddingBottom: {
|
20
|
+
mobile: '15px',
|
21
|
+
sm: '15px',
|
22
|
+
md: '30px',
|
23
|
+
lg: '30px',
|
24
|
+
xl: '50px',
|
25
|
+
'2xl': '50px',
|
26
|
+
},
|
27
|
+
},
|
28
|
+
};
|
29
|
+
|
30
|
+
export const themeActionsLight = {
|
31
|
+
actions: {
|
32
|
+
...themeActionsBase.actions,
|
33
|
+
},
|
34
|
+
};
|
35
|
+
|
36
|
+
export const themeActionsDark = {
|
37
|
+
actions: {
|
38
|
+
...themeActionsBase.actions,
|
39
|
+
},
|
40
|
+
};
|
@@ -1,7 +1,5 @@
|
|
1
1
|
'use client';
|
2
2
|
|
3
|
-
/* eslint-disable jsx-a11y/media-has-caption */
|
4
|
-
|
5
3
|
import { clsx } from 'clsx';
|
6
4
|
import { forwardRef, useEffect, useRef, useState } from 'react';
|
7
5
|
import {
|
@@ -113,5 +111,3 @@ export const Video = forwardRef<HTMLDivElement, VideoProps>(
|
|
113
111
|
);
|
114
112
|
}
|
115
113
|
);
|
116
|
-
|
117
|
-
Video.displayName = 'Video';
|
package/src/index.ts
CHANGED
@@ -10,6 +10,8 @@ export { breakpoints, queries } from './styles/mediaqueries';
|
|
10
10
|
// Components
|
11
11
|
export { ThemeToggle } from './components/ThemeToggle';
|
12
12
|
|
13
|
+
export * from './components/Actions/export';
|
14
|
+
|
13
15
|
export { Button, type ButtonProps } from './components/Button';
|
14
16
|
export { type ButtonVariants } from './components/Button/styles.css';
|
15
17
|
|
@@ -35,9 +37,6 @@ export { Logo, type LogoProps } from './components/Logo';
|
|
35
37
|
|
36
38
|
export { Columns, type ColumnsProps } from './components/Columns';
|
37
39
|
|
38
|
-
export { Actions, type ActionsProps } from './components/Actions';
|
39
|
-
export { type ActionsVariants } from './components/Actions/styles.css';
|
40
|
-
|
41
40
|
export { Carousel, type CarouselProps } from './components/Carousel';
|
42
41
|
export { type CarouselVariants } from './components/Carousel/styles.css';
|
43
42
|
|
@@ -48,6 +47,7 @@ export { KeyNumber, type KeyNumberProps } from './components/KeyNumber';
|
|
48
47
|
export { type KeyNumberVariants } from './components/KeyNumber/styles.css';
|
49
48
|
|
50
49
|
export { NavSocial, type NavSocialProps } from './components/NavSocial';
|
50
|
+
export { type Social } from './components/NavSocial/types';
|
51
51
|
|
52
52
|
export { NavLegal, type NavLegalProps } from './components/NavLegal';
|
53
53
|
|
@@ -1,3 +1,5 @@
|
|
1
|
+
import { themeActionsDark, themeActionsLight } from '../components/Actions/theme';
|
2
|
+
|
1
3
|
// Base theme values that can be imported and extended by apps
|
2
4
|
export const baseLightTheme = {
|
3
5
|
colors: {
|
@@ -208,32 +210,7 @@ export const baseLightTheme = {
|
|
208
210
|
},
|
209
211
|
},
|
210
212
|
|
211
|
-
|
212
|
-
gap: {
|
213
|
-
mobile: '15px',
|
214
|
-
sm: '15px',
|
215
|
-
md: '30px',
|
216
|
-
lg: '30px',
|
217
|
-
xl: '50px',
|
218
|
-
'2xl': '50px',
|
219
|
-
},
|
220
|
-
paddingTop: {
|
221
|
-
mobile: '15px',
|
222
|
-
sm: '15px',
|
223
|
-
md: '30px',
|
224
|
-
lg: '30px',
|
225
|
-
xl: '50px',
|
226
|
-
'2xl': '50px',
|
227
|
-
},
|
228
|
-
paddingBottom: {
|
229
|
-
mobile: '15px',
|
230
|
-
sm: '15px',
|
231
|
-
md: '30px',
|
232
|
-
lg: '30px',
|
233
|
-
xl: '50px',
|
234
|
-
'2xl': '50px',
|
235
|
-
},
|
236
|
-
},
|
213
|
+
...themeActionsLight,
|
237
214
|
|
238
215
|
button: {
|
239
216
|
minWidth: '100',
|
@@ -980,32 +957,7 @@ export const baseDarkTheme = {
|
|
980
957
|
color: '#FF7377',
|
981
958
|
},
|
982
959
|
|
983
|
-
|
984
|
-
gap: {
|
985
|
-
mobile: '15px',
|
986
|
-
sm: '15px',
|
987
|
-
md: '30px',
|
988
|
-
lg: '30px',
|
989
|
-
xl: '50px',
|
990
|
-
'2xl': '50px',
|
991
|
-
},
|
992
|
-
paddingTop: {
|
993
|
-
mobile: '15px',
|
994
|
-
sm: '15px',
|
995
|
-
md: '30px',
|
996
|
-
lg: '30px',
|
997
|
-
xl: '50px',
|
998
|
-
'2xl': '50px',
|
999
|
-
},
|
1000
|
-
paddingBottom: {
|
1001
|
-
mobile: '15px',
|
1002
|
-
sm: '15px',
|
1003
|
-
md: '30px',
|
1004
|
-
lg: '30px',
|
1005
|
-
xl: '50px',
|
1006
|
-
'2xl': '50px',
|
1007
|
-
},
|
1008
|
-
},
|
960
|
+
...themeActionsDark,
|
1009
961
|
|
1010
962
|
modal: {
|
1011
963
|
border: 'none',
|