@latte-macchiat-io/latte-vanilla-components 0.0.176 → 0.0.178
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 +9 -22
- package/src/assets/styles/mediaqueries.tsx +24 -0
- package/src/components/Actions/Actions.tsx +132 -0
- package/src/components/Actions/export.tsx +4 -0
- package/src/components/{Main/stories.ts → Actions/stories.tsx} +14 -13
- package/src/components/Button/Button.tsx +132 -0
- package/src/components/Button/export.tsx +5 -0
- package/src/components/Carousel/Carousel.tsx +328 -0
- package/src/components/Carousel/export.tsx +4 -0
- package/src/components/Columns/Columns.tsx +142 -0
- package/src/components/Columns/export.tsx +5 -0
- package/src/components/ConsentCookie/ConsentCookie.tsx +202 -0
- package/src/components/ConsentCookie/export.tsx +4 -0
- package/src/components/{Icon/stories.ts → ConsentCookie/stories.tsx} +7 -8
- package/src/components/Footer/Footer.tsx +130 -0
- package/src/components/Footer/export.tsx +4 -0
- package/src/components/Footer/stories.tsx +26 -0
- package/src/components/Form/Form.tsx +127 -0
- package/src/components/Form/Row/Row.tsx +137 -0
- package/src/components/Form/Row/stories.tsx +41 -0
- package/src/components/Form/TextField/Input/Input.tsx +139 -0
- package/src/components/Form/TextField/Input/export.tsx +6 -0
- package/src/components/Form/TextField/Label/Label.tsx +133 -0
- package/src/components/Form/TextField/Label/export.tsx +4 -0
- package/src/components/Form/TextField/TextField.tsx +200 -0
- package/src/components/Form/TextField/Textarea/Textarea.tsx +135 -0
- package/src/components/Form/TextField/Textarea/export.tsx +6 -0
- package/src/components/Form/TextField/Textarea/stories.tsx +44 -0
- package/src/components/Form/TextField/export.tsx +4 -0
- package/src/components/Form/export.tsx +4 -0
- package/src/components/Header/Header.tsx +158 -0
- package/src/components/Header/HeaderOverlay/index.tsx +32 -0
- package/src/components/Header/ToggleNav/index.tsx +32 -0
- package/src/components/Header/export.tsx +4 -0
- package/src/components/Header/stories.tsx +26 -0
- package/src/components/Icon/Icon.tsx +159 -0
- package/src/components/Icon/export.tsx +4 -0
- package/src/components/KeyNumber/KeyNumber.tsx +166 -0
- package/src/components/KeyNumber/export.tsx +4 -0
- package/src/components/LanguageSwitcher/LanguageSwitcher.tsx +168 -0
- package/src/components/LanguageSwitcher/export.tsx +4 -0
- package/src/components/Logo/Logo.tsx +137 -0
- package/src/components/Logo/export.tsx +4 -0
- package/src/components/Logo/stories.tsx +28 -0
- package/src/components/Main/Main.tsx +130 -0
- package/src/components/Main/export.tsx +4 -0
- package/src/components/Modal/Modal.tsx +194 -0
- package/src/components/Modal/export.tsx +4 -0
- package/src/components/Modal/types.tsx +5 -0
- package/src/components/Nav/Nav.tsx +129 -0
- package/src/components/Nav/export.tsx +4 -0
- package/src/components/Nav/stories.tsx +28 -0
- package/src/components/NavLegal/NavLegal.tsx +133 -0
- package/src/components/NavLegal/export.tsx +4 -0
- package/src/components/NavLegal/stories.tsx +28 -0
- package/src/components/NavSocial/NavSocial.tsx +169 -0
- package/src/components/NavSocial/export.tsx +5 -0
- package/src/components/{Columns/stories.ts → NavSocial/stories.tsx} +12 -14
- package/src/components/Section/Section.tsx +130 -0
- package/src/components/Section/export.tsx +6 -0
- package/src/components/ToRemove/ToRemove.tsx +3 -0
- package/src/components/Video/Video.tsx +243 -0
- package/src/components/Video/export.tsx +2 -0
- package/src/components/VideoFullWidth/VideoFullWidth.tsx +152 -0
- package/src/components/VideoFullWidth/export.tsx +2 -0
- package/dist/components/Actions/Actions.css.ts +0 -113
- package/dist/components/Button/Button.css.ts +0 -119
- package/dist/components/Carousel/Carousel.css.ts +0 -179
- package/dist/components/Columns/Columns.css.ts +0 -185
- package/dist/components/ConsentCookie/ConsentCookie.css.ts +0 -167
- package/dist/components/Footer/Footer.css.ts +0 -108
- package/dist/components/Form/Form.css.ts +0 -64
- package/dist/components/Form/Row/Row.css.ts +0 -70
- package/dist/components/Form/TextField/Input/Input.css.ts +0 -106
- package/dist/components/Form/TextField/Label/Label.css.ts +0 -58
- package/dist/components/Form/TextField/TextField.css.ts +0 -139
- package/dist/components/Form/TextField/Textarea/Textarea.css.ts +0 -121
- package/dist/components/Header/Header.css.ts +0 -111
- package/dist/components/Header/HeaderOverlay/styles.css.ts +0 -33
- package/dist/components/Header/ToggleNav/styles.css.ts +0 -40
- package/dist/components/Icon/Icon.css.ts +0 -102
- package/dist/components/KeyNumber/KeyNumber.css.ts +0 -158
- package/dist/components/LanguageSwitcher/LanguageSwitcher.css.ts +0 -120
- package/dist/components/Logo/Logo.css.ts +0 -98
- package/dist/components/Main/Main.css.ts +0 -62
- package/dist/components/Modal/Modal.css.ts +0 -203
- package/dist/components/Nav/Nav.css.ts +0 -123
- package/dist/components/NavLegal/NavLegal.css.ts +0 -121
- package/dist/components/NavSocial/NavSocial.css.ts +0 -121
- package/dist/components/Section/Section.css.ts +0 -101
- package/dist/components/Video/Video.css.ts +0 -210
- package/dist/components/VideoFullWidth/VideoFullWidth.css.ts +0 -50
- package/dist/css/index.cjs +0 -1
- package/dist/css/index.js +0 -34
- package/dist/index.cjs.js +0 -2
- package/dist/index.es.js +0 -3863
- package/dist/styles/sprinkles.css.ts +0 -84
- package/dist/theme/contract.css.ts +0 -83
- package/dist/theme.css-CNjMk-g_.cjs +0 -1
- package/dist/theme.css-Dj6kL9o0.js +0 -3020
- package/dist/types/components/Actions/Actions.css.d.ts +0 -74
- package/dist/types/components/Actions/Actions.d.ts +0 -7
- package/dist/types/components/Actions/stories.d.ts +0 -0
- package/dist/types/components/Button/Button.css.d.ts +0 -65
- package/dist/types/components/Button/Button.d.ts +0 -8
- package/dist/types/components/Button/export.d.ts +0 -0
- package/dist/types/components/Button/stories.d.ts +0 -0
- package/dist/types/components/Carousel/Carousel.css.d.ts +0 -33
- package/dist/types/components/Carousel/Carousel.d.ts +0 -15
- package/dist/types/components/Carousel/export.d.ts +0 -0
- package/dist/types/components/Columns/Columns.css.d.ts +0 -104
- package/dist/types/components/Columns/Columns.d.ts +0 -8
- package/dist/types/components/Columns/export.d.ts +0 -0
- package/dist/types/components/Columns/stories.d.ts +0 -0
- package/dist/types/components/ConsentCookie/ConsentCookie.css.d.ts +0 -15
- package/dist/types/components/ConsentCookie/ConsentCookie.d.ts +0 -17
- package/dist/types/components/ConsentCookie/export.d.ts +0 -0
- package/dist/types/components/ConsentCookie/stories.d.ts +0 -0
- package/dist/types/components/Footer/Footer.css.d.ts +0 -50
- package/dist/types/components/Footer/Footer.d.ts +0 -7
- package/dist/types/components/Footer/export.d.ts +0 -0
- package/dist/types/components/Footer/stories.d.ts +0 -6
- package/dist/types/components/Form/Form.css.d.ts +0 -46
- package/dist/types/components/Form/Form.d.ts +0 -7
- package/dist/types/components/Form/Row/Row.css.d.ts +0 -51
- package/dist/types/components/Form/Row/Row.d.ts +0 -9
- package/dist/types/components/Form/Row/index.d.ts +0 -0
- package/dist/types/components/Form/Row/stories.d.ts +0 -0
- package/dist/types/components/Form/TextField/Input/Input.css.d.ts +0 -32
- package/dist/types/components/Form/TextField/Input/Input.d.ts +0 -10
- package/dist/types/components/Form/TextField/Input/export.d.ts +0 -0
- package/dist/types/components/Form/TextField/Label/Label.css.d.ts +0 -23
- package/dist/types/components/Form/TextField/Label/Label.d.ts +0 -9
- package/dist/types/components/Form/TextField/Label/export.d.ts +0 -0
- package/dist/types/components/Form/TextField/TextField.css.d.ts +0 -19
- package/dist/types/components/Form/TextField/TextField.d.ts +0 -21
- package/dist/types/components/Form/TextField/Textarea/Textarea.css.d.ts +0 -56
- package/dist/types/components/Form/TextField/Textarea/Textarea.d.ts +0 -8
- package/dist/types/components/Form/TextField/Textarea/export.d.ts +0 -0
- package/dist/types/components/Form/TextField/Textarea/stories.d.ts +0 -0
- package/dist/types/components/Form/TextField/export.d.ts +0 -0
- package/dist/types/components/Form/export.d.ts +0 -0
- package/dist/types/components/Header/Header.css.d.ts +0 -36
- package/dist/types/components/Header/Header.d.ts +0 -11
- package/dist/types/components/Header/HeaderOverlay/index.d.ts +0 -7
- package/dist/types/components/Header/HeaderOverlay/styles.css.d.ts +0 -5
- package/dist/types/components/Header/ToggleNav/index.d.ts +0 -9
- package/dist/types/components/Header/ToggleNav/styles.css.d.ts +0 -5
- package/dist/types/components/Header/export.d.ts +0 -0
- package/dist/types/components/Header/stories.d.ts +0 -6
- package/dist/types/components/Icon/Icon.css.d.ts +0 -45
- package/dist/types/components/Icon/Icon.d.ts +0 -12
- package/dist/types/components/Icon/export.d.ts +0 -0
- package/dist/types/components/Icon/path.d.ts +0 -19
- package/dist/types/components/Icon/stories.d.ts +0 -0
- package/dist/types/components/KeyNumber/KeyNumber.css.d.ts +0 -40
- package/dist/types/components/KeyNumber/KeyNumber.d.ts +0 -15
- package/dist/types/components/KeyNumber/export.d.ts +0 -0
- package/dist/types/components/LanguageSwitcher/LanguageSwitcher.css.d.ts +0 -18
- package/dist/types/components/LanguageSwitcher/LanguageSwitcher.d.ts +0 -16
- package/dist/types/components/LanguageSwitcher/export.d.ts +0 -0
- package/dist/types/components/Logo/Logo.css.d.ts +0 -54
- package/dist/types/components/Logo/Logo.d.ts +0 -8
- package/dist/types/components/Logo/export.d.ts +0 -0
- package/dist/types/components/Logo/stories.d.ts +0 -6
- package/dist/types/components/Main/Main.css.d.ts +0 -32
- package/dist/types/components/Main/Main.d.ts +0 -7
- package/dist/types/components/Main/export.d.ts +0 -0
- package/dist/types/components/Main/stories.d.ts +0 -0
- package/dist/types/components/Modal/Modal.css.d.ts +0 -82
- package/dist/types/components/Modal/Modal.d.ts +0 -15
- package/dist/types/components/Modal/export.d.ts +0 -0
- package/dist/types/components/Modal/types.d.ts +0 -5
- package/dist/types/components/Nav/Nav.css.d.ts +0 -52
- package/dist/types/components/Nav/Nav.d.ts +0 -7
- package/dist/types/components/Nav/export.d.ts +0 -0
- package/dist/types/components/Nav/stories.d.ts +0 -6
- package/dist/types/components/NavLegal/NavLegal.css.d.ts +0 -57
- package/dist/types/components/NavLegal/NavLegal.d.ts +0 -7
- package/dist/types/components/NavLegal/export.d.ts +0 -0
- package/dist/types/components/NavLegal/stories.d.ts +0 -6
- package/dist/types/components/NavSocial/NavSocial.css.d.ts +0 -30
- package/dist/types/components/NavSocial/NavSocial.d.ts +0 -15
- package/dist/types/components/NavSocial/export.d.ts +0 -0
- package/dist/types/components/NavSocial/stories.d.ts +0 -0
- package/dist/types/components/Section/Section.css.d.ts +0 -60
- package/dist/types/components/Section/Section.d.ts +0 -7
- package/dist/types/components/Section/export.d.ts +0 -0
- package/dist/types/components/Section/stories.d.ts +0 -0
- package/dist/types/components/ToRemove/ToRemove.d.ts +0 -1
- package/dist/types/components/Video/Video.css.d.ts +0 -43
- package/dist/types/components/Video/Video.d.ts +0 -17
- package/dist/types/components/Video/export.d.ts +0 -0
- package/dist/types/components/VideoFullWidth/VideoFullWidth.css.d.ts +0 -18
- package/dist/types/components/VideoFullWidth/VideoFullWidth.d.ts +0 -14
- package/dist/types/components/VideoFullWidth/export.d.ts +0 -0
- package/dist/types/css/index.d.ts +0 -28
- package/dist/types/index.d.ts +0 -58
- package/dist/types/styles/mediaqueries.d.ts +0 -16
- package/dist/types/styles/sprinkles.css.d.ts +0 -3423
- package/dist/types/theme/baseThemeValues.d.ts +0 -158
- package/dist/types/theme/contract.css.d.ts +0 -79
- package/dist/types/theme/index.d.ts +0 -3
- package/dist/types/theme/utils.d.ts +0 -86
- package/dist/types/utils/cookie.d.ts +0 -2
- package/dist/types/utils/deep-merge-objects.d.ts +0 -2
- package/dist/types/utils/theme.css.d.ts +0 -173
- package/dist/types/utils/use-breakpoint-key.d.ts +0 -1
- package/dist/types/utils/use-window-size.d.ts +0 -5
- package/dist/utils/theme.css.ts +0 -129
- package/src/components/Button/stories.ts +0 -127
- package/src/components/Section/stories.ts +0 -64
- package/src/css/index.ts +0 -33
- package/src/themes/dark.ts +0 -3
- package/src/themes/index.ts +0 -5
- package/src/themes/light.ts +0 -3
- /package/{dist/types/components/Actions/export.d.ts → src/components/Form/Row/index.tsx} +0 -0
- /package/{dist/types/components/NavLegal/types.d.ts → src/components/NavLegal/types.tsx} +0 -0
- /package/{dist/types/components/NavSocial/types.d.ts → src/components/NavSocial/types.tsx} +0 -0
@@ -1,11 +1,11 @@
|
|
1
1
|
// import type { Meta, StoryObj } from '@storybook/react';
|
2
|
-
//
|
3
|
-
// import {
|
2
|
+
//
|
3
|
+
// import { ConsentCookie } from '.';
|
4
4
|
//
|
5
5
|
// // More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
|
6
|
-
// const meta = {
|
7
|
-
// title: 'Latte Components /
|
8
|
-
// component:
|
6
|
+
// const meta: Meta<typeof ConsentCookie> = {
|
7
|
+
// title: 'Latte Components / 5. Consent / Cookie',
|
8
|
+
// component: ConsentCookie,
|
9
9
|
// parameters: {
|
10
10
|
// // Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
|
11
11
|
// layout: 'centered',
|
@@ -15,7 +15,7 @@
|
|
15
15
|
// // More on argTypes: https://storybook.js.org/docs/api/argtypes
|
16
16
|
// argTypes: {},
|
17
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
|
-
// }
|
18
|
+
// };
|
19
19
|
//
|
20
20
|
// export default meta;
|
21
21
|
// type Story = StoryObj<typeof meta>;
|
@@ -23,7 +23,6 @@
|
|
23
23
|
// // More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
|
24
24
|
// export const Default: Story = {
|
25
25
|
// args: {
|
26
|
-
//
|
27
|
-
// theme: defaultTheme,
|
26
|
+
// children: 'Cookies with your latte? In accordance with our cookies policy',
|
28
27
|
// },
|
29
28
|
// };
|
@@ -0,0 +1,130 @@
|
|
1
|
+
import { clsx } from 'clsx';
|
2
|
+
import { forwardRef } from 'react';
|
3
|
+
import { footerRecipe, type FooterVariants } from './Footer.css';
|
4
|
+
import { sprinkles, type Sprinkles } from '../../styles/sprinkles.css';
|
5
|
+
|
6
|
+
export interface FooterProps extends Omit<React.HTMLAttributes<HTMLElement>, 'color'>, Sprinkles, NonNullable<FooterVariants> {
|
7
|
+
css?: string;
|
8
|
+
as?: 'footer' | 'div';
|
9
|
+
}
|
10
|
+
|
11
|
+
export const Footer = forwardRef<HTMLElement, FooterProps>(
|
12
|
+
(
|
13
|
+
{
|
14
|
+
children,
|
15
|
+
variant,
|
16
|
+
size,
|
17
|
+
layout,
|
18
|
+
as: Component = 'footer',
|
19
|
+
css,
|
20
|
+
className,
|
21
|
+
// Extract sprinkles props
|
22
|
+
margin,
|
23
|
+
marginTop,
|
24
|
+
marginBottom,
|
25
|
+
marginLeft,
|
26
|
+
marginRight,
|
27
|
+
padding,
|
28
|
+
paddingTop,
|
29
|
+
paddingBottom,
|
30
|
+
paddingLeft,
|
31
|
+
paddingRight,
|
32
|
+
gap,
|
33
|
+
display,
|
34
|
+
flexDirection,
|
35
|
+
justifyContent,
|
36
|
+
flexWrap,
|
37
|
+
flex,
|
38
|
+
width,
|
39
|
+
height,
|
40
|
+
minWidth,
|
41
|
+
maxWidth,
|
42
|
+
minHeight,
|
43
|
+
position,
|
44
|
+
top,
|
45
|
+
bottom,
|
46
|
+
left,
|
47
|
+
right,
|
48
|
+
zIndex,
|
49
|
+
fontSize,
|
50
|
+
fontFamily,
|
51
|
+
lineHeight,
|
52
|
+
textAlign,
|
53
|
+
fontWeight,
|
54
|
+
color,
|
55
|
+
backgroundColor,
|
56
|
+
borderRadius,
|
57
|
+
borderWidth,
|
58
|
+
borderStyle,
|
59
|
+
borderColor,
|
60
|
+
boxShadow,
|
61
|
+
opacity,
|
62
|
+
overflow,
|
63
|
+
overflowX,
|
64
|
+
overflowY,
|
65
|
+
...htmlProps
|
66
|
+
},
|
67
|
+
ref
|
68
|
+
) => {
|
69
|
+
return (
|
70
|
+
<Component
|
71
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
72
|
+
ref={ref as any}
|
73
|
+
className={clsx(
|
74
|
+
footerRecipe({ variant, size, layout }),
|
75
|
+
sprinkles({
|
76
|
+
margin,
|
77
|
+
marginTop,
|
78
|
+
marginBottom,
|
79
|
+
marginLeft,
|
80
|
+
marginRight,
|
81
|
+
padding,
|
82
|
+
paddingTop,
|
83
|
+
paddingBottom,
|
84
|
+
paddingLeft,
|
85
|
+
paddingRight,
|
86
|
+
gap,
|
87
|
+
display,
|
88
|
+
flexDirection,
|
89
|
+
justifyContent,
|
90
|
+
flexWrap,
|
91
|
+
flex,
|
92
|
+
width,
|
93
|
+
height,
|
94
|
+
minWidth,
|
95
|
+
maxWidth,
|
96
|
+
minHeight,
|
97
|
+
position,
|
98
|
+
top,
|
99
|
+
bottom,
|
100
|
+
left,
|
101
|
+
right,
|
102
|
+
zIndex,
|
103
|
+
fontSize,
|
104
|
+
fontFamily,
|
105
|
+
lineHeight,
|
106
|
+
textAlign,
|
107
|
+
fontWeight,
|
108
|
+
color,
|
109
|
+
backgroundColor,
|
110
|
+
borderRadius,
|
111
|
+
borderWidth,
|
112
|
+
borderStyle,
|
113
|
+
borderColor,
|
114
|
+
boxShadow,
|
115
|
+
opacity,
|
116
|
+
overflow,
|
117
|
+
overflowX,
|
118
|
+
overflowY,
|
119
|
+
}),
|
120
|
+
css,
|
121
|
+
className
|
122
|
+
)}
|
123
|
+
{...htmlProps}>
|
124
|
+
{children}
|
125
|
+
</Component>
|
126
|
+
);
|
127
|
+
}
|
128
|
+
);
|
129
|
+
|
130
|
+
Footer.displayName = 'Footer';
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
2
|
+
|
3
|
+
import { Footer } 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 Footer> = {
|
7
|
+
title: 'Latte Components / Layout / Footer',
|
8
|
+
component: Footer,
|
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
|
+
};
|
@@ -0,0 +1,127 @@
|
|
1
|
+
import { clsx } from 'clsx';
|
2
|
+
import { forwardRef } from 'react';
|
3
|
+
import { formRecipe, type FormVariants } from './Form.css';
|
4
|
+
import { sprinkles, type Sprinkles } from '../../styles/sprinkles.css';
|
5
|
+
|
6
|
+
export interface FormProps extends Omit<React.FormHTMLAttributes<HTMLFormElement>, 'color'>, Sprinkles, NonNullable<FormVariants> {
|
7
|
+
css?: string;
|
8
|
+
children: React.ReactNode;
|
9
|
+
}
|
10
|
+
|
11
|
+
export const Form = forwardRef<HTMLFormElement, FormProps>(
|
12
|
+
(
|
13
|
+
{
|
14
|
+
children,
|
15
|
+
spacing,
|
16
|
+
layout,
|
17
|
+
css,
|
18
|
+
className,
|
19
|
+
// Extract sprinkles props
|
20
|
+
margin,
|
21
|
+
marginTop,
|
22
|
+
marginBottom,
|
23
|
+
marginLeft,
|
24
|
+
marginRight,
|
25
|
+
padding,
|
26
|
+
paddingTop,
|
27
|
+
paddingBottom,
|
28
|
+
paddingLeft,
|
29
|
+
paddingRight,
|
30
|
+
gap,
|
31
|
+
display,
|
32
|
+
flexDirection,
|
33
|
+
justifyContent,
|
34
|
+
flexWrap,
|
35
|
+
flex,
|
36
|
+
width,
|
37
|
+
height,
|
38
|
+
minWidth,
|
39
|
+
maxWidth,
|
40
|
+
minHeight,
|
41
|
+
position,
|
42
|
+
top,
|
43
|
+
bottom,
|
44
|
+
left,
|
45
|
+
right,
|
46
|
+
zIndex,
|
47
|
+
fontSize,
|
48
|
+
fontFamily,
|
49
|
+
lineHeight,
|
50
|
+
textAlign,
|
51
|
+
fontWeight,
|
52
|
+
color,
|
53
|
+
backgroundColor,
|
54
|
+
borderRadius,
|
55
|
+
borderWidth,
|
56
|
+
borderStyle,
|
57
|
+
borderColor,
|
58
|
+
boxShadow,
|
59
|
+
opacity,
|
60
|
+
overflow,
|
61
|
+
overflowX,
|
62
|
+
overflowY,
|
63
|
+
...htmlProps
|
64
|
+
},
|
65
|
+
ref
|
66
|
+
) => {
|
67
|
+
return (
|
68
|
+
<form
|
69
|
+
ref={ref}
|
70
|
+
className={clsx(
|
71
|
+
formRecipe({ spacing, layout }),
|
72
|
+
sprinkles({
|
73
|
+
margin,
|
74
|
+
marginTop,
|
75
|
+
marginBottom,
|
76
|
+
marginLeft,
|
77
|
+
marginRight,
|
78
|
+
padding,
|
79
|
+
paddingTop,
|
80
|
+
paddingBottom,
|
81
|
+
paddingLeft,
|
82
|
+
paddingRight,
|
83
|
+
gap,
|
84
|
+
display,
|
85
|
+
flexDirection,
|
86
|
+
justifyContent,
|
87
|
+
flexWrap,
|
88
|
+
flex,
|
89
|
+
width,
|
90
|
+
height,
|
91
|
+
minWidth,
|
92
|
+
maxWidth,
|
93
|
+
minHeight,
|
94
|
+
position,
|
95
|
+
top,
|
96
|
+
bottom,
|
97
|
+
left,
|
98
|
+
right,
|
99
|
+
zIndex,
|
100
|
+
fontSize,
|
101
|
+
fontFamily,
|
102
|
+
lineHeight,
|
103
|
+
textAlign,
|
104
|
+
fontWeight,
|
105
|
+
color,
|
106
|
+
backgroundColor,
|
107
|
+
borderRadius,
|
108
|
+
borderWidth,
|
109
|
+
borderStyle,
|
110
|
+
borderColor,
|
111
|
+
boxShadow,
|
112
|
+
opacity,
|
113
|
+
overflow,
|
114
|
+
overflowX,
|
115
|
+
overflowY,
|
116
|
+
}),
|
117
|
+
css,
|
118
|
+
className
|
119
|
+
)}
|
120
|
+
{...htmlProps}>
|
121
|
+
{children}
|
122
|
+
</form>
|
123
|
+
);
|
124
|
+
}
|
125
|
+
);
|
126
|
+
|
127
|
+
Form.displayName = 'Form';
|
@@ -0,0 +1,137 @@
|
|
1
|
+
import { clsx } from 'clsx';
|
2
|
+
import { forwardRef } from 'react';
|
3
|
+
import { rowRecipe, type RowVariants } from './Row.css';
|
4
|
+
import { sprinkles, type Sprinkles } from '../../../styles/sprinkles.css';
|
5
|
+
|
6
|
+
export interface RowProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'color'>, Sprinkles, NonNullable<RowVariants> {
|
7
|
+
css?: string;
|
8
|
+
children: React.ReactNode;
|
9
|
+
isActions?: boolean;
|
10
|
+
isMessage?: boolean;
|
11
|
+
}
|
12
|
+
|
13
|
+
export const Row = forwardRef<HTMLDivElement, RowProps>(
|
14
|
+
(
|
15
|
+
{
|
16
|
+
children,
|
17
|
+
align,
|
18
|
+
variant,
|
19
|
+
spacing,
|
20
|
+
isActions = false,
|
21
|
+
isMessage = false,
|
22
|
+
css,
|
23
|
+
className,
|
24
|
+
// Extract sprinkles props
|
25
|
+
margin,
|
26
|
+
marginTop,
|
27
|
+
marginBottom,
|
28
|
+
marginLeft,
|
29
|
+
marginRight,
|
30
|
+
padding,
|
31
|
+
paddingTop,
|
32
|
+
paddingBottom,
|
33
|
+
paddingLeft,
|
34
|
+
paddingRight,
|
35
|
+
gap,
|
36
|
+
display,
|
37
|
+
flexDirection,
|
38
|
+
justifyContent,
|
39
|
+
flexWrap,
|
40
|
+
flex,
|
41
|
+
width,
|
42
|
+
height,
|
43
|
+
minWidth,
|
44
|
+
maxWidth,
|
45
|
+
minHeight,
|
46
|
+
position,
|
47
|
+
top,
|
48
|
+
bottom,
|
49
|
+
left,
|
50
|
+
right,
|
51
|
+
zIndex,
|
52
|
+
fontSize,
|
53
|
+
fontFamily,
|
54
|
+
lineHeight,
|
55
|
+
textAlign,
|
56
|
+
fontWeight,
|
57
|
+
color,
|
58
|
+
backgroundColor,
|
59
|
+
borderRadius,
|
60
|
+
borderWidth,
|
61
|
+
borderStyle,
|
62
|
+
borderColor,
|
63
|
+
boxShadow,
|
64
|
+
opacity,
|
65
|
+
overflow,
|
66
|
+
overflowX,
|
67
|
+
overflowY,
|
68
|
+
...htmlProps
|
69
|
+
},
|
70
|
+
ref
|
71
|
+
) => {
|
72
|
+
// Determine the variant based on the props
|
73
|
+
let computedVariant = variant;
|
74
|
+
if (isActions) computedVariant = 'actions';
|
75
|
+
if (isMessage) computedVariant = 'message';
|
76
|
+
|
77
|
+
return (
|
78
|
+
<div
|
79
|
+
ref={ref}
|
80
|
+
className={clsx(
|
81
|
+
rowRecipe({ align, variant: computedVariant, spacing }),
|
82
|
+
sprinkles({
|
83
|
+
margin,
|
84
|
+
marginTop,
|
85
|
+
marginBottom,
|
86
|
+
marginLeft,
|
87
|
+
marginRight,
|
88
|
+
padding,
|
89
|
+
paddingTop,
|
90
|
+
paddingBottom,
|
91
|
+
paddingLeft,
|
92
|
+
paddingRight,
|
93
|
+
gap,
|
94
|
+
display,
|
95
|
+
flexDirection,
|
96
|
+
justifyContent,
|
97
|
+
flexWrap,
|
98
|
+
flex,
|
99
|
+
width,
|
100
|
+
height,
|
101
|
+
minWidth,
|
102
|
+
maxWidth,
|
103
|
+
minHeight,
|
104
|
+
position,
|
105
|
+
top,
|
106
|
+
bottom,
|
107
|
+
left,
|
108
|
+
right,
|
109
|
+
zIndex,
|
110
|
+
fontSize,
|
111
|
+
fontFamily,
|
112
|
+
lineHeight,
|
113
|
+
textAlign,
|
114
|
+
fontWeight,
|
115
|
+
color,
|
116
|
+
backgroundColor,
|
117
|
+
borderRadius,
|
118
|
+
borderWidth,
|
119
|
+
borderStyle,
|
120
|
+
borderColor,
|
121
|
+
boxShadow,
|
122
|
+
opacity,
|
123
|
+
overflow,
|
124
|
+
overflowX,
|
125
|
+
overflowY,
|
126
|
+
}),
|
127
|
+
css,
|
128
|
+
className
|
129
|
+
)}
|
130
|
+
{...htmlProps}>
|
131
|
+
{children}
|
132
|
+
</div>
|
133
|
+
);
|
134
|
+
}
|
135
|
+
);
|
136
|
+
|
137
|
+
Row.displayName = 'Row';
|
@@ -0,0 +1,41 @@
|
|
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
|
+
// };
|
@@ -0,0 +1,139 @@
|
|
1
|
+
import { clsx } from 'clsx';
|
2
|
+
import { forwardRef } from 'react';
|
3
|
+
import { inputRecipe, type InputVariants } from './Input.css';
|
4
|
+
import { sprinkles, type Sprinkles } from '../../../../styles/sprinkles.css';
|
5
|
+
|
6
|
+
export type InputType = 'text' | 'email' | 'search' | 'number' | 'hidden' | 'password' | 'tel' | 'url' | 'date' | 'time' | 'datetime-local' | 'color';
|
7
|
+
|
8
|
+
export interface InputProps
|
9
|
+
extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'color' | 'size' | 'height' | 'width'>,
|
10
|
+
Sprinkles,
|
11
|
+
NonNullable<InputVariants> {
|
12
|
+
css?: string;
|
13
|
+
name: string;
|
14
|
+
type?: InputType;
|
15
|
+
hasError?: boolean;
|
16
|
+
}
|
17
|
+
|
18
|
+
export const Input = forwardRef<HTMLInputElement, InputProps>(
|
19
|
+
(
|
20
|
+
{
|
21
|
+
name,
|
22
|
+
type = 'text',
|
23
|
+
hasError = false,
|
24
|
+
size,
|
25
|
+
variant,
|
26
|
+
css,
|
27
|
+
className,
|
28
|
+
// Extract sprinkles props
|
29
|
+
margin,
|
30
|
+
marginTop,
|
31
|
+
marginBottom,
|
32
|
+
marginLeft,
|
33
|
+
marginRight,
|
34
|
+
padding,
|
35
|
+
paddingTop,
|
36
|
+
paddingBottom,
|
37
|
+
paddingLeft,
|
38
|
+
paddingRight,
|
39
|
+
gap,
|
40
|
+
display,
|
41
|
+
flexDirection,
|
42
|
+
justifyContent,
|
43
|
+
flexWrap,
|
44
|
+
flex,
|
45
|
+
width,
|
46
|
+
height,
|
47
|
+
minWidth,
|
48
|
+
maxWidth,
|
49
|
+
minHeight,
|
50
|
+
position,
|
51
|
+
top,
|
52
|
+
bottom,
|
53
|
+
left,
|
54
|
+
right,
|
55
|
+
zIndex,
|
56
|
+
fontSize,
|
57
|
+
fontFamily,
|
58
|
+
lineHeight,
|
59
|
+
textAlign,
|
60
|
+
fontWeight,
|
61
|
+
color,
|
62
|
+
backgroundColor,
|
63
|
+
borderRadius,
|
64
|
+
borderWidth,
|
65
|
+
borderStyle,
|
66
|
+
borderColor,
|
67
|
+
boxShadow,
|
68
|
+
opacity,
|
69
|
+
overflow,
|
70
|
+
overflowX,
|
71
|
+
overflowY,
|
72
|
+
...htmlProps
|
73
|
+
},
|
74
|
+
ref
|
75
|
+
) => {
|
76
|
+
return (
|
77
|
+
<input
|
78
|
+
ref={ref}
|
79
|
+
id={name}
|
80
|
+
name={name}
|
81
|
+
type={type}
|
82
|
+
className={clsx(
|
83
|
+
inputRecipe({ size, variant }),
|
84
|
+
sprinkles({
|
85
|
+
margin,
|
86
|
+
marginTop,
|
87
|
+
marginBottom,
|
88
|
+
marginLeft,
|
89
|
+
marginRight,
|
90
|
+
padding,
|
91
|
+
paddingTop,
|
92
|
+
paddingBottom,
|
93
|
+
paddingLeft,
|
94
|
+
paddingRight,
|
95
|
+
gap,
|
96
|
+
display,
|
97
|
+
flexDirection,
|
98
|
+
justifyContent,
|
99
|
+
flexWrap,
|
100
|
+
flex,
|
101
|
+
width,
|
102
|
+
height,
|
103
|
+
minWidth,
|
104
|
+
maxWidth,
|
105
|
+
minHeight,
|
106
|
+
position,
|
107
|
+
top,
|
108
|
+
bottom,
|
109
|
+
left,
|
110
|
+
right,
|
111
|
+
zIndex,
|
112
|
+
fontSize,
|
113
|
+
fontFamily,
|
114
|
+
lineHeight,
|
115
|
+
textAlign,
|
116
|
+
fontWeight,
|
117
|
+
color,
|
118
|
+
backgroundColor,
|
119
|
+
borderRadius,
|
120
|
+
borderWidth,
|
121
|
+
borderStyle,
|
122
|
+
borderColor,
|
123
|
+
boxShadow,
|
124
|
+
opacity,
|
125
|
+
overflow,
|
126
|
+
overflowX,
|
127
|
+
overflowY,
|
128
|
+
}),
|
129
|
+
css,
|
130
|
+
className
|
131
|
+
)}
|
132
|
+
data-error={hasError}
|
133
|
+
{...htmlProps}
|
134
|
+
/>
|
135
|
+
);
|
136
|
+
}
|
137
|
+
);
|
138
|
+
|
139
|
+
Input.displayName = 'Input';
|