@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
@@ -0,0 +1,133 @@
|
|
1
|
+
import { clsx } from 'clsx';
|
2
|
+
import { forwardRef } from 'react';
|
3
|
+
import { navLegalRecipe, type NavLegalVariants } from './NavLegal.css';
|
4
|
+
import { sprinkles, type Sprinkles } from '../../styles/sprinkles.css';
|
5
|
+
|
6
|
+
export interface NavLegalProps extends Omit<React.HTMLAttributes<HTMLElement>, 'color'>, Sprinkles, NonNullable<NavLegalVariants> {
|
7
|
+
css?: string;
|
8
|
+
as?: 'nav' | 'div' | 'footer';
|
9
|
+
}
|
10
|
+
|
11
|
+
export const NavLegal = forwardRef<HTMLElement, NavLegalProps>(
|
12
|
+
(
|
13
|
+
{
|
14
|
+
children,
|
15
|
+
orientation,
|
16
|
+
size,
|
17
|
+
variant,
|
18
|
+
align,
|
19
|
+
as: Component = 'nav',
|
20
|
+
css,
|
21
|
+
className,
|
22
|
+
// Extract sprinkles props
|
23
|
+
margin,
|
24
|
+
marginTop,
|
25
|
+
marginBottom,
|
26
|
+
marginLeft,
|
27
|
+
marginRight,
|
28
|
+
padding,
|
29
|
+
paddingTop,
|
30
|
+
paddingBottom,
|
31
|
+
paddingLeft,
|
32
|
+
paddingRight,
|
33
|
+
gap,
|
34
|
+
display,
|
35
|
+
flexDirection,
|
36
|
+
justifyContent,
|
37
|
+
flexWrap,
|
38
|
+
flex,
|
39
|
+
width,
|
40
|
+
height,
|
41
|
+
minWidth,
|
42
|
+
maxWidth,
|
43
|
+
minHeight,
|
44
|
+
position,
|
45
|
+
top,
|
46
|
+
bottom,
|
47
|
+
left,
|
48
|
+
right,
|
49
|
+
zIndex,
|
50
|
+
fontSize,
|
51
|
+
fontFamily,
|
52
|
+
lineHeight,
|
53
|
+
textAlign,
|
54
|
+
fontWeight,
|
55
|
+
color,
|
56
|
+
backgroundColor,
|
57
|
+
borderRadius,
|
58
|
+
borderWidth,
|
59
|
+
borderStyle,
|
60
|
+
borderColor,
|
61
|
+
boxShadow,
|
62
|
+
opacity,
|
63
|
+
overflow,
|
64
|
+
overflowX,
|
65
|
+
overflowY,
|
66
|
+
...htmlProps
|
67
|
+
},
|
68
|
+
ref
|
69
|
+
) => {
|
70
|
+
return (
|
71
|
+
<Component
|
72
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
73
|
+
ref={ref as any}
|
74
|
+
className={clsx(
|
75
|
+
navLegalRecipe({ orientation, size, variant, align }),
|
76
|
+
sprinkles({
|
77
|
+
margin,
|
78
|
+
marginTop,
|
79
|
+
marginBottom,
|
80
|
+
marginLeft,
|
81
|
+
marginRight,
|
82
|
+
padding,
|
83
|
+
paddingTop,
|
84
|
+
paddingBottom,
|
85
|
+
paddingLeft,
|
86
|
+
paddingRight,
|
87
|
+
gap,
|
88
|
+
display,
|
89
|
+
flexDirection,
|
90
|
+
justifyContent,
|
91
|
+
flexWrap,
|
92
|
+
flex,
|
93
|
+
width,
|
94
|
+
height,
|
95
|
+
minWidth,
|
96
|
+
maxWidth,
|
97
|
+
minHeight,
|
98
|
+
position,
|
99
|
+
top,
|
100
|
+
bottom,
|
101
|
+
left,
|
102
|
+
right,
|
103
|
+
zIndex,
|
104
|
+
fontSize,
|
105
|
+
fontFamily,
|
106
|
+
lineHeight,
|
107
|
+
textAlign,
|
108
|
+
fontWeight,
|
109
|
+
color,
|
110
|
+
backgroundColor,
|
111
|
+
borderRadius,
|
112
|
+
borderWidth,
|
113
|
+
borderStyle,
|
114
|
+
borderColor,
|
115
|
+
boxShadow,
|
116
|
+
opacity,
|
117
|
+
overflow,
|
118
|
+
overflowX,
|
119
|
+
overflowY,
|
120
|
+
}),
|
121
|
+
css,
|
122
|
+
className
|
123
|
+
)}
|
124
|
+
role="navigation"
|
125
|
+
aria-label="Legal navigation"
|
126
|
+
{...htmlProps}>
|
127
|
+
{children}
|
128
|
+
</Component>
|
129
|
+
);
|
130
|
+
}
|
131
|
+
);
|
132
|
+
|
133
|
+
NavLegal.displayName = 'NavLegal';
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
2
|
+
|
3
|
+
import { NavLegal } 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 NavLegal> = {
|
7
|
+
title: 'Latte Components / 6. Nav / Legal',
|
8
|
+
component: NavLegal,
|
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: '',
|
27
|
+
},
|
28
|
+
};
|
@@ -0,0 +1,169 @@
|
|
1
|
+
import { clsx } from 'clsx';
|
2
|
+
import { forwardRef } from 'react';
|
3
|
+
import { navSocialLink, navSocialRecipe, type NavSocialVariants } from './NavSocial.css';
|
4
|
+
import { sprinkles, type Sprinkles } from '../../styles/sprinkles.css';
|
5
|
+
import { Icon } from '../Icon/Icon';
|
6
|
+
|
7
|
+
export type SocialNetwork = 'instagram' | 'linkedIn' | 'facebook' | 'pinterest' | 'spotify' | 'X' | 'youtube' | 'tiktok';
|
8
|
+
|
9
|
+
export interface SocialLink {
|
10
|
+
name: SocialNetwork;
|
11
|
+
url: string;
|
12
|
+
label?: string;
|
13
|
+
}
|
14
|
+
|
15
|
+
export interface NavSocialProps extends Omit<React.HTMLAttributes<HTMLElement>, 'color'>, Sprinkles, NonNullable<NavSocialVariants> {
|
16
|
+
css?: string;
|
17
|
+
links: SocialLink[];
|
18
|
+
iconSize?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
19
|
+
as?: 'nav' | 'div' | 'ul';
|
20
|
+
}
|
21
|
+
|
22
|
+
export const NavSocial = forwardRef<HTMLElement, NavSocialProps>(
|
23
|
+
(
|
24
|
+
{
|
25
|
+
links,
|
26
|
+
iconSize = 'md',
|
27
|
+
orientation,
|
28
|
+
size,
|
29
|
+
variant,
|
30
|
+
as: Component = 'nav',
|
31
|
+
css,
|
32
|
+
className,
|
33
|
+
// Extract sprinkles props
|
34
|
+
margin,
|
35
|
+
marginTop,
|
36
|
+
marginBottom,
|
37
|
+
marginLeft,
|
38
|
+
marginRight,
|
39
|
+
padding,
|
40
|
+
paddingTop,
|
41
|
+
paddingBottom,
|
42
|
+
paddingLeft,
|
43
|
+
paddingRight,
|
44
|
+
gap,
|
45
|
+
display,
|
46
|
+
flexDirection,
|
47
|
+
justifyContent,
|
48
|
+
flexWrap,
|
49
|
+
flex,
|
50
|
+
width,
|
51
|
+
height,
|
52
|
+
minWidth,
|
53
|
+
maxWidth,
|
54
|
+
minHeight,
|
55
|
+
position,
|
56
|
+
top,
|
57
|
+
bottom,
|
58
|
+
left,
|
59
|
+
right,
|
60
|
+
zIndex,
|
61
|
+
fontSize,
|
62
|
+
fontFamily,
|
63
|
+
lineHeight,
|
64
|
+
textAlign,
|
65
|
+
fontWeight,
|
66
|
+
color,
|
67
|
+
backgroundColor,
|
68
|
+
borderRadius,
|
69
|
+
borderWidth,
|
70
|
+
borderStyle,
|
71
|
+
borderColor,
|
72
|
+
boxShadow,
|
73
|
+
opacity,
|
74
|
+
overflow,
|
75
|
+
overflowX,
|
76
|
+
overflowY,
|
77
|
+
...htmlProps
|
78
|
+
},
|
79
|
+
ref
|
80
|
+
) => {
|
81
|
+
const getSocialIcon = (name: SocialNetwork): string => {
|
82
|
+
const iconMap: Record<SocialNetwork, string> = {
|
83
|
+
instagram: 'socialInstagram',
|
84
|
+
linkedIn: 'socialLinkedIn',
|
85
|
+
facebook: 'socialFacebook',
|
86
|
+
pinterest: 'socialPinterest',
|
87
|
+
spotify: 'socialSpotify',
|
88
|
+
X: 'socialX',
|
89
|
+
youtube: 'socialYoutube',
|
90
|
+
tiktok: 'socialTiktok',
|
91
|
+
};
|
92
|
+
return iconMap[name];
|
93
|
+
};
|
94
|
+
|
95
|
+
return (
|
96
|
+
<Component
|
97
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
98
|
+
ref={ref as any}
|
99
|
+
className={clsx(
|
100
|
+
navSocialRecipe({ orientation, size, variant }),
|
101
|
+
sprinkles({
|
102
|
+
margin,
|
103
|
+
marginTop,
|
104
|
+
marginBottom,
|
105
|
+
marginLeft,
|
106
|
+
marginRight,
|
107
|
+
padding,
|
108
|
+
paddingTop,
|
109
|
+
paddingBottom,
|
110
|
+
paddingLeft,
|
111
|
+
paddingRight,
|
112
|
+
gap,
|
113
|
+
display,
|
114
|
+
flexDirection,
|
115
|
+
justifyContent,
|
116
|
+
flexWrap,
|
117
|
+
flex,
|
118
|
+
width,
|
119
|
+
height,
|
120
|
+
minWidth,
|
121
|
+
maxWidth,
|
122
|
+
minHeight,
|
123
|
+
position,
|
124
|
+
top,
|
125
|
+
bottom,
|
126
|
+
left,
|
127
|
+
right,
|
128
|
+
zIndex,
|
129
|
+
fontSize,
|
130
|
+
fontFamily,
|
131
|
+
lineHeight,
|
132
|
+
textAlign,
|
133
|
+
fontWeight,
|
134
|
+
color,
|
135
|
+
backgroundColor,
|
136
|
+
borderRadius,
|
137
|
+
borderWidth,
|
138
|
+
borderStyle,
|
139
|
+
borderColor,
|
140
|
+
boxShadow,
|
141
|
+
opacity,
|
142
|
+
overflow,
|
143
|
+
overflowX,
|
144
|
+
overflowY,
|
145
|
+
}),
|
146
|
+
css,
|
147
|
+
className
|
148
|
+
)}
|
149
|
+
role="navigation"
|
150
|
+
aria-label="Social media links"
|
151
|
+
{...htmlProps}>
|
152
|
+
{links.map((social, index) => (
|
153
|
+
<a
|
154
|
+
key={`${social.name}-${index}`}
|
155
|
+
href={social.url}
|
156
|
+
target="_blank"
|
157
|
+
rel="noopener noreferrer"
|
158
|
+
className={navSocialLink}
|
159
|
+
aria-label={social.label || `Visit our ${social.name} page`}>
|
160
|
+
{/*eslint-disable-next-line @typescript-eslint/no-explicit-any*/}
|
161
|
+
<Icon icon={getSocialIcon(social.name) as any} size={iconSize} aria-hidden="true" />
|
162
|
+
</a>
|
163
|
+
))}
|
164
|
+
</Component>
|
165
|
+
);
|
166
|
+
}
|
167
|
+
);
|
168
|
+
|
169
|
+
NavSocial.displayName = 'NavSocial';
|
@@ -1,10 +1,11 @@
|
|
1
1
|
// import type { Meta, StoryObj } from '@storybook/react';
|
2
|
-
//
|
2
|
+
//
|
3
|
+
// import { NavSocial } from '../../index';
|
3
4
|
//
|
4
5
|
// // More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
|
5
|
-
// const meta = {
|
6
|
-
// title: 'Latte Components /
|
7
|
-
// component:
|
6
|
+
// const meta: Meta<typeof NavSocial> = {
|
7
|
+
// title: 'Latte Components / 6. Nav / Social',
|
8
|
+
// component: NavSocial,
|
8
9
|
// parameters: {
|
9
10
|
// // Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
|
10
11
|
// layout: 'centered',
|
@@ -14,7 +15,7 @@
|
|
14
15
|
// // More on argTypes: https://storybook.js.org/docs/api/argtypes
|
15
16
|
// argTypes: {},
|
16
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
|
17
|
-
// }
|
18
|
+
// };
|
18
19
|
//
|
19
20
|
// export default meta;
|
20
21
|
// type Story = StoryObj<typeof meta>;
|
@@ -22,14 +23,11 @@
|
|
22
23
|
// // More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
|
23
24
|
// export const Default: Story = {
|
24
25
|
// args: {
|
25
|
-
//
|
26
|
-
//
|
27
|
-
//
|
28
|
-
//
|
29
|
-
//
|
30
|
-
//
|
31
|
-
// args: {
|
32
|
-
// columns: [4, 4, 4],
|
33
|
-
// children: '<div>Column 1</div> <div>Column 2</div> <div>Column 3</div>',
|
26
|
+
// navSocial: [
|
27
|
+
// {
|
28
|
+
// name: 'instagram',
|
29
|
+
// link: 'https://www.instagram.com/',
|
30
|
+
// },
|
31
|
+
// ],
|
34
32
|
// },
|
35
33
|
// };
|
@@ -0,0 +1,130 @@
|
|
1
|
+
'use client';
|
2
|
+
|
3
|
+
import { clsx } from 'clsx';
|
4
|
+
import { forwardRef } from 'react';
|
5
|
+
import { sectionRecipe, type SectionVariants } from './Section.css';
|
6
|
+
import { sprinkles, type Sprinkles } from '../../styles/sprinkles.css';
|
7
|
+
|
8
|
+
export interface SectionProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'color'>, Sprinkles, NonNullable<SectionVariants> {
|
9
|
+
css?: string;
|
10
|
+
as?: 'section' | 'div' | 'main' | 'article' | 'aside';
|
11
|
+
}
|
12
|
+
|
13
|
+
export const Section = forwardRef<HTMLDivElement, SectionProps>(
|
14
|
+
(
|
15
|
+
{
|
16
|
+
children,
|
17
|
+
align,
|
18
|
+
isDark,
|
19
|
+
isFullHeight,
|
20
|
+
spacing,
|
21
|
+
as: Component = 'section',
|
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
|
+
return (
|
73
|
+
<Component
|
74
|
+
ref={ref}
|
75
|
+
className={clsx(
|
76
|
+
sectionRecipe({ align, isDark, isFullHeight, spacing }),
|
77
|
+
sprinkles({
|
78
|
+
margin,
|
79
|
+
marginTop,
|
80
|
+
marginBottom,
|
81
|
+
marginLeft,
|
82
|
+
marginRight,
|
83
|
+
padding,
|
84
|
+
paddingTop,
|
85
|
+
paddingBottom,
|
86
|
+
paddingLeft,
|
87
|
+
paddingRight,
|
88
|
+
gap,
|
89
|
+
display,
|
90
|
+
flexDirection,
|
91
|
+
justifyContent,
|
92
|
+
flexWrap,
|
93
|
+
flex,
|
94
|
+
width,
|
95
|
+
height,
|
96
|
+
minWidth,
|
97
|
+
maxWidth,
|
98
|
+
minHeight,
|
99
|
+
position,
|
100
|
+
top,
|
101
|
+
bottom,
|
102
|
+
left,
|
103
|
+
right,
|
104
|
+
zIndex,
|
105
|
+
fontSize,
|
106
|
+
fontFamily,
|
107
|
+
lineHeight,
|
108
|
+
textAlign,
|
109
|
+
fontWeight,
|
110
|
+
color,
|
111
|
+
backgroundColor,
|
112
|
+
borderRadius,
|
113
|
+
borderWidth,
|
114
|
+
borderStyle,
|
115
|
+
borderColor,
|
116
|
+
boxShadow,
|
117
|
+
opacity,
|
118
|
+
overflow,
|
119
|
+
overflowX,
|
120
|
+
overflowY,
|
121
|
+
}),
|
122
|
+
css,
|
123
|
+
className
|
124
|
+
)}
|
125
|
+
{...htmlProps}>
|
126
|
+
{children}
|
127
|
+
</Component>
|
128
|
+
);
|
129
|
+
}
|
130
|
+
);
|