@faststore/ui 2.0.16-alpha.0 → 2.0.19-alpha.0
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/CHANGELOG.md +18 -0
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/components/atoms/Button/styles.scss +1 -1
- package/src/components/molecules/LinkButton/styles.scss +9 -0
- package/src/components/organisms/Hero/styles.scss +203 -0
- package/src/index.ts +0 -11
- package/src/styles/components.scss +5 -1
- package/dist/components/organisms/Hero/Hero.d.ts +0 -11
- package/dist/components/organisms/Hero/Hero.js +0 -6
- package/dist/components/organisms/Hero/Hero.js.map +0 -1
- package/dist/components/organisms/Hero/HeroHeading.d.ts +0 -10
- package/dist/components/organisms/Hero/HeroHeading.js +0 -6
- package/dist/components/organisms/Hero/HeroHeading.js.map +0 -1
- package/dist/components/organisms/Hero/HeroImage.d.ts +0 -10
- package/dist/components/organisms/Hero/HeroImage.js +0 -6
- package/dist/components/organisms/Hero/HeroImage.js.map +0 -1
- package/dist/components/organisms/Hero/index.d.ts +0 -6
- package/dist/components/organisms/Hero/index.js +0 -4
- package/dist/components/organisms/Hero/index.js.map +0 -1
- package/src/components/organisms/Hero/Hero.tsx +0 -23
- package/src/components/organisms/Hero/HeroHeading.tsx +0 -24
- package/src/components/organisms/Hero/HeroImage.tsx +0 -22
- package/src/components/organisms/Hero/index.tsx +0 -8
- package/src/components/organisms/Hero/stories/Hero.mdx +0 -48
- package/src/components/organisms/Hero/stories/Hero.stories.tsx +0 -56
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,24 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [2.0.19-alpha.0](https://github.com/vtex/faststore/compare/v2.0.18-alpha.0...v2.0.19-alpha.0) (2022-12-16)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* Adds `Hero` component ([#1556](https://github.com/vtex/faststore/issues/1556)) ([871f35c](https://github.com/vtex/faststore/commit/871f35cdcfc85d5ec0038dcc55a9aeedcc5ff546))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## [2.0.17-alpha.0](https://github.com/vtex/faststore/compare/v2.0.16-alpha.0...v2.0.17-alpha.0) (2022-12-15)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
* Create `LinkButton` component ([#1558](https://github.com/vtex/faststore/issues/1558)) ([bbbebdb](https://github.com/vtex/faststore/commit/bbbebdb081f9c40315d8b661461e3b09a34b84b6))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
6
24
|
## [2.0.16-alpha.0](https://github.com/vtex/faststore/compare/v2.0.15-alpha.0...v2.0.16-alpha.0) (2022-12-15)
|
|
7
25
|
|
|
8
26
|
|
package/dist/index.d.ts
CHANGED
|
@@ -63,7 +63,5 @@ export { default as OutOfStock, OutOfStockTitle, OutOfStockMessage, } from './co
|
|
|
63
63
|
export type { OutOfStockProps, OutOfStockMessageProps, OutOfStockTitleProps, } from './components/organisms/OutOfStock';
|
|
64
64
|
export { Tiles, Tile } from './components/organisms/Tiles';
|
|
65
65
|
export type { TilesProps, TileProps } from './components/organisms/Tiles';
|
|
66
|
-
export { default as Hero, HeroHeading, HeroImage, } from './components/organisms/Hero';
|
|
67
|
-
export type { HeroProps, HeroHeadingProps, HeroImageProps, } from './components/organisms/Hero';
|
|
68
66
|
export { default as useSlider } from './hooks/useSlider';
|
|
69
67
|
export type { UseSliderArgs, SliderState, SliderDispatch, SlideDirection, } from './hooks/useSlider';
|
package/dist/index.js
CHANGED
|
@@ -34,7 +34,6 @@ export { default as Dropdown, DropdownButton, DropdownItem, DropdownMenu, } from
|
|
|
34
34
|
// Organisms
|
|
35
35
|
export { default as OutOfStock, OutOfStockTitle, OutOfStockMessage, } from './components/organisms/OutOfStock';
|
|
36
36
|
export { Tiles, Tile } from './components/organisms/Tiles';
|
|
37
|
-
export { default as Hero, HeroHeading, HeroImage, } from './components/organisms/Hero';
|
|
38
37
|
// Hooks
|
|
39
38
|
export { default as useSlider } from './hooks/useSlider';
|
|
40
39
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA;AAErC,QAAQ;AACR,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAG/D,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AAGjE,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAG7D,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AAGjE,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAG/D,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAGnE,YAAY;AACZ,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,oCAAoC,CAAA;AAG3E,OAAO,EACL,OAAO,IAAI,IAAI,EACf,WAAW,EACX,SAAS,GACV,MAAM,6BAA6B,CAAA;AAOpC,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,qCAAqC,CAAA;AAG7E,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,qCAAqC,CAAA;AAG7E,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,wCAAwC,CAAA;AAGnF,OAAO,EACL,OAAO,IAAI,WAAW,EACtB,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,oCAAoC,CAAA;AAQ3C,OAA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O,IAAI,KAAK,EAAE,MAAM,8BAA8B,CAAA;AAG/D,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,yCAAyC,CAAA;AAGrF,OAAO,EACL,OAAO,IAAI,QAAQ,EACnB,cAAc,EACd,YAAY,EACZ,YAAY,GACb,MAAM,iCAAiC,CAAA;AAQxC,YAAY;AACZ,OAAO,EACL,OAAO,IAAI,UAAU,EACrB,eAAe,EACf,iBAAiB,GAClB,MAAM,mCAAmC,CAAA;AAO1C,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAA;AAG1D,QAAQ;AACR,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,mBAAmB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faststore/ui",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.19-alpha.0",
|
|
4
4
|
"description": "A lightweight, framework agnostic component library for React",
|
|
5
5
|
"author": "emersonlaurentino",
|
|
6
6
|
"license": "MIT",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@babel/core": "^7.19.6",
|
|
52
52
|
"@faststore/shared": "^2.0.3-alpha.0",
|
|
53
|
-
"@faststore/styles": "^2.0.
|
|
53
|
+
"@faststore/styles": "^2.0.19-alpha.0",
|
|
54
54
|
"@size-limit/preset-small-lib": "^7.0.8",
|
|
55
55
|
"@storybook/addon-a11y": "^6.5.13",
|
|
56
56
|
"@storybook/addon-actions": "^6.5.13",
|
|
@@ -78,5 +78,5 @@
|
|
|
78
78
|
"node": "16.18.0",
|
|
79
79
|
"yarn": "1.19.1"
|
|
80
80
|
},
|
|
81
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "40266ca0a2dc46a9a3da1632caf5c8a264157efd"
|
|
82
82
|
}
|
|
@@ -136,7 +136,7 @@
|
|
|
136
136
|
&[data-fs-button-variant] {
|
|
137
137
|
@include focus-ring-visible;
|
|
138
138
|
|
|
139
|
-
&:disabled, &[data-button-disabled="true"] {
|
|
139
|
+
&:disabled, &[data-fs-button-disabled="true"] {
|
|
140
140
|
color: var(--fs-button-disabled-text-color);
|
|
141
141
|
cursor: not-allowed;
|
|
142
142
|
background-color: var(--fs-button-disabled-bkg-color);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
[data-fs-link-button] {
|
|
2
|
+
// --------------------------------------------------------
|
|
3
|
+
// Structural Styles
|
|
4
|
+
// --------------------------------------------------------
|
|
5
|
+
|
|
6
|
+
&:hover { text-decoration: none; }
|
|
7
|
+
|
|
8
|
+
&:disabled, &[data-fs-button-disabled="true"] { pointer-events: none; }
|
|
9
|
+
}
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
[data-fs-hero] {
|
|
2
|
+
// --------------------------------------------------------
|
|
3
|
+
// Design Tokens for Hero Section
|
|
4
|
+
// --------------------------------------------------------
|
|
5
|
+
|
|
6
|
+
// Default properties
|
|
7
|
+
--fs-hero-text-size : var(--fs-text-size-lead);
|
|
8
|
+
--fs-hero-text-line-height : 1.33;
|
|
9
|
+
|
|
10
|
+
// Image
|
|
11
|
+
--fs-hero-image-border-radius : 0;
|
|
12
|
+
|
|
13
|
+
// Title
|
|
14
|
+
--fs-hero-title-padding : var(--fs-spacing-5) 0 var(--fs-spacing-6);
|
|
15
|
+
--fs-hero-title-weight : var(--fs-text-weight-black);
|
|
16
|
+
--fs-hero-title-line-height : 1.1;
|
|
17
|
+
|
|
18
|
+
// Subtitle
|
|
19
|
+
--fs-hero-subtitle-margin-top-mobile : var(--fs-spacing-2);
|
|
20
|
+
--fs-hero-subtitle-margin-top-tablet : var(--fs-spacing-4);
|
|
21
|
+
--fs-hero-subtitle-size : var(--fs-hero-text-size);
|
|
22
|
+
--fs-hero-subtitle-line-height : var(--fs-hero-text-line-height);
|
|
23
|
+
|
|
24
|
+
// Primary
|
|
25
|
+
--fs-hero-primary-image-height-mobile : 15rem; // 240px
|
|
26
|
+
--fs-hero-primary-image-height-desktop : 29rem; // 464px
|
|
27
|
+
--fs-hero-primary-title-size : var(--fs-text-size-title-huge);
|
|
28
|
+
|
|
29
|
+
// Secondary
|
|
30
|
+
--fs-hero-secondary-image-height-mobile : 11.25rem; // 180px
|
|
31
|
+
--fs-hero-secondary-image-height-desktop : 14.188rem; // 227px
|
|
32
|
+
--fs-hero-secondary-title-size : var(--fs-text-size-title-page);
|
|
33
|
+
|
|
34
|
+
// Main
|
|
35
|
+
--fs-hero-main-bkg-color : var(--fs-color-primary-bkg);
|
|
36
|
+
--fs-hero-main-text-color : var(--fs-color-primary-text);
|
|
37
|
+
|
|
38
|
+
// Light
|
|
39
|
+
--fs-hero-light-bkg-color : var(--fs-color-secondary-bkg-light);
|
|
40
|
+
--fs-hero-light-text-color : var(--fs-color-text-display);
|
|
41
|
+
|
|
42
|
+
// Accent
|
|
43
|
+
--fs-hero-accent-bkg-color : var(--fs-color-highlighted-bkg);
|
|
44
|
+
--fs-hero-accent-text-color : var(--fs-hero-light-text-color);
|
|
45
|
+
|
|
46
|
+
// --------------------------------------------------------
|
|
47
|
+
// Structural Styles
|
|
48
|
+
// --------------------------------------------------------
|
|
49
|
+
|
|
50
|
+
display: flex;
|
|
51
|
+
flex-direction: column;
|
|
52
|
+
width: 100%;
|
|
53
|
+
|
|
54
|
+
@include media(">=tablet") {
|
|
55
|
+
position: relative;
|
|
56
|
+
flex-direction: row-reverse;
|
|
57
|
+
justify-content: flex-end;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
[data-fs-hero-image] {
|
|
61
|
+
border-radius: var(--fs-hero-image-border-radius);
|
|
62
|
+
|
|
63
|
+
@include media(">=tablet") {
|
|
64
|
+
position: absolute;
|
|
65
|
+
right: 0;
|
|
66
|
+
width: 50%;
|
|
67
|
+
height: 100%;
|
|
68
|
+
overflow: hidden;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
[data-fs-hero-heading] {
|
|
73
|
+
width: 100%;
|
|
74
|
+
padding: var(--fs-hero-title-padding);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
[data-fs-hero-wrapper] {
|
|
78
|
+
display: flex;
|
|
79
|
+
gap: var(--fs-spacing-3);
|
|
80
|
+
justify-content: space-between;
|
|
81
|
+
|
|
82
|
+
@include media(">=tablet") {
|
|
83
|
+
gap: var(--fs-spacing-1);
|
|
84
|
+
justify-content: flex-start;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
[data-fs-hero-title] {
|
|
89
|
+
font-weight: var(--fs-hero-title-weight);
|
|
90
|
+
line-height: var(--fs-hero-title-line-height);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
[data-fs-hero-subtitle] {
|
|
94
|
+
margin-top: var(--fs-hero-subtitle-margin-top-mobile);
|
|
95
|
+
font-size: var(--fs-hero-subtitle-size);
|
|
96
|
+
line-height: var(--fs-hero-subtitle-line-height);
|
|
97
|
+
|
|
98
|
+
@include media(">=tablet") {
|
|
99
|
+
margin-top: var(--fs-hero-subtitle-margin-top-tablet);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
[data-fs-button] {
|
|
104
|
+
justify-content: space-between;
|
|
105
|
+
min-width: 11.25rem;
|
|
106
|
+
margin-top: var(--fs-spacing-6);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
[data-fs-hero-icon] {
|
|
110
|
+
color: var(--fs-hero-text-color);
|
|
111
|
+
height: fit-content;
|
|
112
|
+
> * {
|
|
113
|
+
height: var(--fs-spacing-6);
|
|
114
|
+
width: var(--fs-spacing-6);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// --------------------------------------------------------
|
|
119
|
+
// Variants Styles
|
|
120
|
+
// --------------------------------------------------------
|
|
121
|
+
|
|
122
|
+
&[data-fs-hero-variant="primary"] {
|
|
123
|
+
@include media(">=tablet") {
|
|
124
|
+
min-height: var(--fs-hero-primary-image-height-desktop);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
[data-fs-hero-title] {
|
|
128
|
+
font-size: var(--fs-hero-primary-title-size);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
[data-fs-hero-heading] {
|
|
132
|
+
@include media(">=tablet") {
|
|
133
|
+
display: flex;
|
|
134
|
+
align-items: center;
|
|
135
|
+
padding: var(--fs-spacing-9) 0;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
[data-fs-button] {
|
|
140
|
+
@include media(">=tablet") {
|
|
141
|
+
margin-top: var(--fs-spacing-8);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
[data-fs-hero-image] {
|
|
146
|
+
@include media("<tablet") {
|
|
147
|
+
height: var(--fs-hero-primary-image-height-mobile);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
[data-fs-hero-info] {
|
|
152
|
+
@include media(">=tablet") {
|
|
153
|
+
width: 46%;
|
|
154
|
+
padding-right: var(--fs-spacing-9);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
&[data-fs-hero-variant="secondary"] {
|
|
160
|
+
@include media(">=tablet") {
|
|
161
|
+
min-height: var(--fs-hero-secondary-image-height-desktop);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
[data-fs-hero-title] {
|
|
165
|
+
font-size: var(--fs-hero-secondary-title-size);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
[data-fs-hero-info] {
|
|
169
|
+
@include media(">=tablet") {
|
|
170
|
+
width: 42%;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
[data-fs-hero-heading] {
|
|
175
|
+
padding: var(--fs-spacing-4) 0 var(--fs-spacing-5);
|
|
176
|
+
|
|
177
|
+
@include media(">=tablet") {
|
|
178
|
+
padding: var(--fs-spacing-5) 0;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
[data-fs-hero-image] {
|
|
183
|
+
@include media("<tablet") {
|
|
184
|
+
height: var(--fs-hero-secondary-image-height-mobile);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
&[data-fs-hero-color-variant="main"] {
|
|
190
|
+
color: var(--fs-hero-main-text-color);
|
|
191
|
+
background-color: var(--fs-hero-main-bkg-color);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
&[data-fs-hero-color-variant="light"] {
|
|
195
|
+
color: var(--fs-hero-light-text-color);
|
|
196
|
+
background-color: var(--fs-hero-light-bkg-color);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
&[data-fs-hero-color-variant="accent"] {
|
|
200
|
+
color: var(--fs-hero-accent-text-color);
|
|
201
|
+
background-color: var(--fs-hero-accent-bkg-color);
|
|
202
|
+
}
|
|
203
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -204,17 +204,6 @@ export type {
|
|
|
204
204
|
export { Tiles, Tile } from './components/organisms/Tiles'
|
|
205
205
|
export type { TilesProps, TileProps } from './components/organisms/Tiles'
|
|
206
206
|
|
|
207
|
-
export {
|
|
208
|
-
default as Hero,
|
|
209
|
-
HeroHeading,
|
|
210
|
-
HeroImage,
|
|
211
|
-
} from './components/organisms/Hero'
|
|
212
|
-
export type {
|
|
213
|
-
HeroProps,
|
|
214
|
-
HeroHeadingProps,
|
|
215
|
-
HeroImageProps,
|
|
216
|
-
} from './components/organisms/Hero'
|
|
217
|
-
|
|
218
207
|
// Hooks
|
|
219
208
|
export { default as useSlider } from './hooks/useSlider'
|
|
220
209
|
export type {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
@import "../components/atoms/Button/styles";
|
|
4
4
|
@import "../components/atoms/Checkbox/styles";
|
|
5
5
|
@import "../components/atoms/Icon/styles";
|
|
6
|
-
@import "../components/atoms/Link/styles";
|
|
6
|
+
@import "../components/atoms/Link/styles";
|
|
7
7
|
@import "../components/atoms/Input/styles";
|
|
8
8
|
@import "../components/atoms/List/styles";
|
|
9
9
|
@import "../components/atoms/Overlay/styles";
|
|
@@ -17,8 +17,12 @@
|
|
|
17
17
|
@import "../components/molecules/CheckboxField/styles";
|
|
18
18
|
@import "../components/molecules/DiscountBadge/styles";
|
|
19
19
|
@import "../components/molecules/InputField/styles";
|
|
20
|
+
@import "../components/molecules/LinkButton/styles";
|
|
20
21
|
@import "../components/molecules/RadioField/styles";
|
|
21
22
|
@import "../components/molecules/SelectField/styles";
|
|
22
23
|
@import "../components/molecules/Tag/styles";
|
|
23
24
|
@import "../components/molecules/Toggle/styles";
|
|
24
25
|
@import "../components/molecules/ToggleField/styles";
|
|
26
|
+
|
|
27
|
+
// Organisms
|
|
28
|
+
@import "../components/organisms/Hero/styles";
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { HTMLAttributes } from 'react';
|
|
3
|
-
export interface HeroProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
-
/**
|
|
5
|
-
* ID to find this component in testing tools (e.g.: cypress,
|
|
6
|
-
* testing-library, and jest).
|
|
7
|
-
*/
|
|
8
|
-
testId?: string;
|
|
9
|
-
}
|
|
10
|
-
declare const Hero: React.ForwardRefExoticComponent<HeroProps & React.RefAttributes<HTMLDivElement>>;
|
|
11
|
-
export default Hero;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import React, { forwardRef } from 'react';
|
|
2
|
-
const Hero = forwardRef(function Hero({ testId = 'store-hero', children, ...otherProps }, ref) {
|
|
3
|
-
return (React.createElement("article", Object.assign({ ref: ref, "data-fs-hero": true, "data-testid": testId }, otherProps), children));
|
|
4
|
-
});
|
|
5
|
-
export default Hero;
|
|
6
|
-
//# sourceMappingURL=Hero.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Hero.js","sourceRoot":"","sources":["../../../../src/components/organisms/Hero/Hero.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAWzC,MAAM,IAAI,GAAG,UAAU,CAA4B,SAAS,IAAI,CAC9D,EAAE,MAAM,GAAG,YAAY,EAAE,QAAQ,EAAE,GAAG,UAAU,EAAE,EAClD,GAAG;IAEH,OAAO,CACL,+CAAS,GAAG,EAAE,GAAG,uCAA4B,MAAM,IAAM,UAAU,GAChE,QAAQ,CACD,CACX,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,eAAe,IAAI,CAAA"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { HTMLAttributes } from 'react';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
export interface HeroHeadingProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
-
/**
|
|
5
|
-
* ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
|
|
6
|
-
*/
|
|
7
|
-
testId?: string;
|
|
8
|
-
}
|
|
9
|
-
declare const HeroHeading: React.ForwardRefExoticComponent<HeroHeadingProps & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
-
export default HeroHeading;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import React, { forwardRef } from 'react';
|
|
2
|
-
const HeroHeading = forwardRef(function HeroHeading({ testId = 'store-hero-heading', children, ...otherProps }, ref) {
|
|
3
|
-
return (React.createElement("header", Object.assign({ ref: ref, "data-hero-heading": true, "data-testid": testId }, otherProps), children));
|
|
4
|
-
});
|
|
5
|
-
export default HeroHeading;
|
|
6
|
-
//# sourceMappingURL=HeroHeading.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"HeroHeading.js","sourceRoot":"","sources":["../../../../src/components/organisms/Hero/HeroHeading.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AASzC,MAAM,WAAW,GAAG,UAAU,CAC5B,SAAS,WAAW,CAClB,EAAE,MAAM,GAAG,oBAAoB,EAAE,QAAQ,EAAE,GAAG,UAAU,EAAE,EAC1D,GAAG;IAEH,OAAO,CACL,8CAAQ,GAAG,EAAE,GAAG,4CAAiC,MAAM,IAAM,UAAU,GACpE,QAAQ,CACF,CACV,CAAA;AACH,CAAC,CACF,CAAA;AAED,eAAe,WAAW,CAAA"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { HTMLAttributes } from 'react';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
export interface HeroImageProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
-
/**
|
|
5
|
-
* ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
|
|
6
|
-
*/
|
|
7
|
-
testId?: string;
|
|
8
|
-
}
|
|
9
|
-
declare const HeroImage: React.ForwardRefExoticComponent<HeroImageProps & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
-
export default HeroImage;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import React, { forwardRef } from 'react';
|
|
2
|
-
const HeroImage = forwardRef(function HeroImage({ testId = 'store-hero-image', children, ...otherProps }, ref) {
|
|
3
|
-
return (React.createElement("div", Object.assign({ ref: ref, "data-hero-image": true, "data-testid": testId }, otherProps), children));
|
|
4
|
-
});
|
|
5
|
-
export default HeroImage;
|
|
6
|
-
//# sourceMappingURL=HeroImage.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"HeroImage.js","sourceRoot":"","sources":["../../../../src/components/organisms/Hero/HeroImage.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AASzC,MAAM,SAAS,GAAG,UAAU,CAAiC,SAAS,SAAS,CAC7E,EAAE,MAAM,GAAG,kBAAkB,EAAE,QAAQ,EAAE,GAAG,UAAU,EAAE,EACxD,GAAG;IAEH,OAAO,CACL,2CAAK,GAAG,EAAE,GAAG,0CAA+B,MAAM,IAAM,UAAU,GAC/D,QAAQ,CACL,CACP,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,eAAe,SAAS,CAAA"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { default } from './Hero';
|
|
2
|
-
export type { HeroProps } from './Hero';
|
|
3
|
-
export { default as HeroImage } from './HeroImage';
|
|
4
|
-
export type { HeroImageProps } from './HeroImage';
|
|
5
|
-
export { default as HeroHeading } from './HeroHeading';
|
|
6
|
-
export type { HeroHeadingProps } from './HeroHeading';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/organisms/Hero/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAA;AAGhC,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAA;AAGlD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAA"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import React, { forwardRef } from 'react'
|
|
2
|
-
import type { HTMLAttributes } from 'react'
|
|
3
|
-
|
|
4
|
-
export interface HeroProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
-
/**
|
|
6
|
-
* ID to find this component in testing tools (e.g.: cypress,
|
|
7
|
-
* testing-library, and jest).
|
|
8
|
-
*/
|
|
9
|
-
testId?: string
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
const Hero = forwardRef<HTMLDivElement, HeroProps>(function Hero(
|
|
13
|
-
{ testId = 'store-hero', children, ...otherProps },
|
|
14
|
-
ref
|
|
15
|
-
) {
|
|
16
|
-
return (
|
|
17
|
-
<article ref={ref} data-fs-hero data-testid={testId} {...otherProps}>
|
|
18
|
-
{children}
|
|
19
|
-
</article>
|
|
20
|
-
)
|
|
21
|
-
})
|
|
22
|
-
|
|
23
|
-
export default Hero
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { HTMLAttributes } from 'react'
|
|
2
|
-
import React, { forwardRef } from 'react'
|
|
3
|
-
|
|
4
|
-
export interface HeroHeadingProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
-
/**
|
|
6
|
-
* ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
|
|
7
|
-
*/
|
|
8
|
-
testId?: string
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const HeroHeading = forwardRef<HTMLDivElement, HeroHeadingProps>(
|
|
12
|
-
function HeroHeading(
|
|
13
|
-
{ testId = 'store-hero-heading', children, ...otherProps },
|
|
14
|
-
ref
|
|
15
|
-
) {
|
|
16
|
-
return (
|
|
17
|
-
<header ref={ref} data-hero-heading data-testid={testId} {...otherProps}>
|
|
18
|
-
{children}
|
|
19
|
-
</header>
|
|
20
|
-
)
|
|
21
|
-
}
|
|
22
|
-
)
|
|
23
|
-
|
|
24
|
-
export default HeroHeading
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { HTMLAttributes } from 'react'
|
|
2
|
-
import React, { forwardRef } from 'react'
|
|
3
|
-
|
|
4
|
-
export interface HeroImageProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
-
/**
|
|
6
|
-
* ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
|
|
7
|
-
*/
|
|
8
|
-
testId?: string
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const HeroImage = forwardRef<HTMLDivElement, HeroImageProps>(function HeroImage(
|
|
12
|
-
{ testId = 'store-hero-image', children, ...otherProps },
|
|
13
|
-
ref
|
|
14
|
-
) {
|
|
15
|
-
return (
|
|
16
|
-
<div ref={ref} data-hero-image data-testid={testId} {...otherProps}>
|
|
17
|
-
{children}
|
|
18
|
-
</div>
|
|
19
|
-
)
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
-
export default HeroImage
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export { default } from './Hero'
|
|
2
|
-
export type { HeroProps } from './Hero'
|
|
3
|
-
|
|
4
|
-
export { default as HeroImage } from './HeroImage'
|
|
5
|
-
export type { HeroImageProps } from './HeroImage'
|
|
6
|
-
|
|
7
|
-
export { default as HeroHeading } from './HeroHeading'
|
|
8
|
-
export type { HeroHeadingProps } from './HeroHeading'
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { Canvas, Props, Story, ArgsTable } from '@storybook/addon-docs'
|
|
2
|
-
|
|
3
|
-
import Hero from '../Hero'
|
|
4
|
-
import HeroImage from '../HeroImage'
|
|
5
|
-
import HeroHeading from '../HeroHeading'
|
|
6
|
-
|
|
7
|
-
# Hero
|
|
8
|
-
|
|
9
|
-
<Canvas>
|
|
10
|
-
<Story id="organisms-hero--hero" />
|
|
11
|
-
</Canvas>
|
|
12
|
-
|
|
13
|
-
## Components
|
|
14
|
-
|
|
15
|
-
The `Hero` uses the [Compound Component](https://kentcdodds.com/blog/compound-components-with-react-hooks) pattern, its components are:
|
|
16
|
-
|
|
17
|
-
- `Hero`: the wrapper component.
|
|
18
|
-
- `HeroImage`: the component that wraps the image displayed in the component.
|
|
19
|
-
- `HeroHeading`: the component should have a title, description, and a call to action link.
|
|
20
|
-
|
|
21
|
-
## Props
|
|
22
|
-
|
|
23
|
-
All hero-related components support all attributes also supported by the `<div>` tag.
|
|
24
|
-
|
|
25
|
-
Besides those attributes, the following props are also supported:
|
|
26
|
-
|
|
27
|
-
### `Hero`
|
|
28
|
-
|
|
29
|
-
<ArgsTable of={Hero} />
|
|
30
|
-
|
|
31
|
-
### `HeroImage`
|
|
32
|
-
|
|
33
|
-
<ArgsTable of={HeroImage} />
|
|
34
|
-
|
|
35
|
-
### `HeroHeading`
|
|
36
|
-
|
|
37
|
-
<ArgsTable of={HeroHeading} />
|
|
38
|
-
|
|
39
|
-
## CSS Selectors
|
|
40
|
-
|
|
41
|
-
```css
|
|
42
|
-
[data-fs-hero] {
|
|
43
|
-
}
|
|
44
|
-
[data-hero-image] {
|
|
45
|
-
}
|
|
46
|
-
[data-hero-heading] {
|
|
47
|
-
}
|
|
48
|
-
```
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import type { Story, Meta } from '@storybook/react'
|
|
2
|
-
import React from 'react'
|
|
3
|
-
|
|
4
|
-
import HeroComponent from '../Hero'
|
|
5
|
-
import HeroImage from '../HeroImage'
|
|
6
|
-
import HeroHeading from '../HeroHeading'
|
|
7
|
-
import type { HeroProps } from '../Hero'
|
|
8
|
-
import { Icon } from '../../../../'
|
|
9
|
-
import mdx from './Hero.mdx'
|
|
10
|
-
|
|
11
|
-
const RightArrow = () => (
|
|
12
|
-
<svg
|
|
13
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
14
|
-
width="18"
|
|
15
|
-
height="18"
|
|
16
|
-
viewBox="0 0 18 18"
|
|
17
|
-
>
|
|
18
|
-
<path
|
|
19
|
-
d="M10.6553 3.40717C10.3624 3.11428 9.88756 3.11428 9.59467 3.40717C9.30178 3.70006 9.30178 4.17494 9.59467 4.46783L13.3768 8.25H2.8125C2.39829 8.25 2.0625 8.58579 2.0625 9C2.0625 9.41421 2.39829 9.75 2.8125 9.75H13.3768L9.59467 13.5322C9.30178 13.8251 9.30178 14.2999 9.59467 14.5928C9.88756 14.8857 10.3624 14.8857 10.6553 14.5928L15.7178 9.53033C15.8643 9.38388 15.9375 9.19194 15.9375 9C15.9375 8.89831 15.9173 8.80134 15.8806 8.71291C15.844 8.62445 15.7897 8.54158 15.7178 8.46967L10.6553 3.40717Z"
|
|
20
|
-
fill="currentColor"
|
|
21
|
-
/>
|
|
22
|
-
</svg>
|
|
23
|
-
)
|
|
24
|
-
|
|
25
|
-
const HeroTemplate: Story<HeroProps> = ({ testId }) => (
|
|
26
|
-
<HeroComponent testId={testId}>
|
|
27
|
-
<HeroImage>
|
|
28
|
-
<img
|
|
29
|
-
alt="Quest 2 Controller on a table"
|
|
30
|
-
src="https://storeframework.vtexassets.com/arquivos/ids/190897/Photo.jpg"
|
|
31
|
-
/>
|
|
32
|
-
</HeroImage>
|
|
33
|
-
<HeroHeading>
|
|
34
|
-
<h1>New Products Available</h1>
|
|
35
|
-
<p>
|
|
36
|
-
At BaseStore you can shop the best tech of 2022. Enjoy and get 10% off
|
|
37
|
-
on your first purchase.
|
|
38
|
-
</p>
|
|
39
|
-
<a href="/">
|
|
40
|
-
See all <Icon component={<RightArrow />} />
|
|
41
|
-
</a>
|
|
42
|
-
</HeroHeading>
|
|
43
|
-
</HeroComponent>
|
|
44
|
-
)
|
|
45
|
-
|
|
46
|
-
export const Hero = HeroTemplate.bind({})
|
|
47
|
-
Hero.storyName = 'Hero'
|
|
48
|
-
|
|
49
|
-
export default {
|
|
50
|
-
title: 'Organisms/Hero',
|
|
51
|
-
parameters: {
|
|
52
|
-
docs: {
|
|
53
|
-
page: mdx,
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
} as Meta
|