@faststore/core 0.3.7 → 0.3.9
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/.storybook/components/SectionItem.tsx +9 -5
- package/.storybook/storybook.css +1 -1
- package/CHANGELOG.md +14 -0
- package/package.json +3 -3
- package/src/components/common/Navbar/NavbarSlider.stories.mdx +1 -1
- package/src/components/product/ProductCard/ProductCard.stories.mdx +2 -1
- package/src/components/regionalization/Regionalization.stories.mdx +12 -9
- package/src/components/regionalization/RegionalizationModal/RegionalizationModal.stories.mdx +1 -1
- package/src/components/search/Filter/Filter.stories.mdx +2 -1
- package/src/components/search/Filter/FilterSlider.stories.mdx +2 -1
- package/src/components/search/SearchHistory/SearchHistory.stories.mdx +5 -10
- package/src/components/sections/BannerText/BannerText.tsx +3 -5
- package/src/components/sections/BannerText/banner-text.module.scss +1 -1
- package/src/components/sections/Hero/Hero.tsx +9 -4
- package/src/components/sections/ProductGallery/EmptyGallery.tsx +6 -5
- package/src/components/sections/ProductGallery/ProductGallery.tsx +6 -7
- package/src/components/skeletons/Skeletons.stories.mdx +0 -1
- package/src/components/ui/Accordion/Accordion.stories.mdx +20 -17
- package/src/components/ui/Button/Button.stories.mdx +2 -3
- package/src/components/ui/Button/{ButtonLink/ButtonSignIn → ButtonSignIn}/ButtonSignIn.tsx +6 -4
- package/src/components/ui/Button/{ButtonLink/ButtonSignIn → ButtonSignIn}/ButtonSignInFallback/ButtonSignInFallback.tsx +6 -4
- package/src/components/ui/Button/{ButtonLink/ButtonSignIn → ButtonSignIn}/ButtonSignInFallback/index.ts +0 -0
- package/src/components/ui/Button/{ButtonLink/ButtonSignIn → ButtonSignIn}/index.ts +0 -0
- package/src/components/ui/Button/index.ts +2 -3
- package/src/components/ui/EmptyState/EmptyState.stories.mdx +6 -6
- package/src/components/ui/Modal/Modal.stories.mdx +8 -6
- package/src/components/ui/Toast/Toast.stories.mdx +1 -1
- package/src/stories/brandless.stories.mdx +7 -5
- package/src/stories/getting-started.stories.mdx +12 -9
- package/src/components/ui/Button/ButtonLink/ButtonLink.tsx +0 -50
- package/src/components/ui/Button/ButtonLink/index.ts +0 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { CSSProperties, PropsWithChildren, ReactNode } from 'react'
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import { LinkButton } from '@faststore/ui'
|
|
4
|
+
|
|
4
5
|
import Icon from '../../src/components/ui/Icon'
|
|
5
6
|
|
|
6
7
|
type SectionItemProps = {
|
|
@@ -27,14 +28,17 @@ const SectionItem = ({
|
|
|
27
28
|
<h3 className="sbdocs sbdocs-h3">{title}</h3>
|
|
28
29
|
<p className="sbdocs sbdocs-p">{description}</p>
|
|
29
30
|
{actionPath && (
|
|
30
|
-
<
|
|
31
|
+
<LinkButton
|
|
32
|
+
size="small"
|
|
31
33
|
variant="tertiary"
|
|
32
34
|
href={actionPath}
|
|
33
|
-
|
|
35
|
+
icon={
|
|
36
|
+
<Icon name="ArrowRight" width="18" height="18" weight="bold" />
|
|
37
|
+
}
|
|
38
|
+
iconPosition="right"
|
|
34
39
|
>
|
|
35
40
|
See more
|
|
36
|
-
|
|
37
|
-
</ButtonLink>
|
|
41
|
+
</LinkButton>
|
|
38
42
|
)}
|
|
39
43
|
</article>
|
|
40
44
|
</li>
|
package/.storybook/storybook.css
CHANGED
|
@@ -460,7 +460,7 @@ header.sbdocs-hero + .sbdocs-callout {
|
|
|
460
460
|
margin-bottom: var(--fs-spacing-5);
|
|
461
461
|
}
|
|
462
462
|
|
|
463
|
-
.sbdocs-content > header.sbdocs-hero [data-fs-button
|
|
463
|
+
.sbdocs-content > header.sbdocs-hero [data-fs-link-button]:first-of-type {
|
|
464
464
|
margin-left: calc(-1 * var(--fs-spacing-1));
|
|
465
465
|
}
|
|
466
466
|
|
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,20 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Conventional Changelog](https://github.com/conventional-changelog/conventional-changelog),
|
|
6
6
|
and this project adheres to [Calendar Versioning](https://calver.org/).
|
|
7
7
|
|
|
8
|
+
### [0.3.9](https://github.com/vtex-sites/nextjs.store/compare/0.3.8...0.3.9) (2022-12-16)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Chores
|
|
12
|
+
|
|
13
|
+
* Replaces `LinkButton` UI ([#322](https://github.com/vtex-sites/nextjs.store/issues/322)) ([532f20d](https://github.com/vtex-sites/nextjs.store/commit/532f20d96611254f2453bf0b29e610cb6052daa2))
|
|
14
|
+
|
|
15
|
+
### [0.3.8](https://github.com/vtex-sites/nextjs.store/compare/0.3.7...0.3.8) (2022-12-16)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* Integration tests ([#323](https://github.com/vtex-sites/nextjs.store/issues/323)) ([6e927e5](https://github.com/vtex-sites/nextjs.store/commit/6e927e563cd355ae7af82b5de42abda909965009))
|
|
21
|
+
|
|
8
22
|
### [0.3.7](https://github.com/vtex-sites/nextjs.store/compare/0.3.6...0.3.7) (2022-12-15)
|
|
9
23
|
|
|
10
24
|
### [0.3.6](https://github.com/vtex-sites/nextjs.store/compare/0.3.5...0.3.6) (2022-12-15)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faststore/core",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.9",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"browserslist": "supports es6-module and not dead",
|
|
6
6
|
"scripts": {
|
|
@@ -31,10 +31,10 @@
|
|
|
31
31
|
"@envelop/parser-cache": "^2.2.0",
|
|
32
32
|
"@envelop/validation-cache": "^2.2.0",
|
|
33
33
|
"@faststore/api": "^2.0.3-alpha.0",
|
|
34
|
-
"@faststore/components": "^2.0.
|
|
34
|
+
"@faststore/components": "^2.0.18-alpha.0",
|
|
35
35
|
"@faststore/graphql-utils": "^2.0.3-alpha.0",
|
|
36
36
|
"@faststore/sdk": "^2.0.3-alpha.0",
|
|
37
|
-
"@faststore/ui": "^2.0.
|
|
37
|
+
"@faststore/ui": "^2.0.17-alpha.0",
|
|
38
38
|
"@types/react": "^18.0.14",
|
|
39
39
|
"@vtex/client-cms": "^0.2.12",
|
|
40
40
|
"@vtex/tsconfig": "0.6.0",
|
|
@@ -2,7 +2,7 @@ import { Meta, Canvas, Story, ArgsTable } from '@storybook/addon-docs'
|
|
|
2
2
|
|
|
3
3
|
import UIProvider, { useUI } from 'src/sdk/ui/Provider'
|
|
4
4
|
|
|
5
|
-
import Button from '
|
|
5
|
+
import { Button } from '@faststore/ui'
|
|
6
6
|
import Icon from 'src/components/ui/Icon'
|
|
7
7
|
|
|
8
8
|
import { NavbarSlider } from '.'
|
|
@@ -2,8 +2,9 @@ import UIProvider, { useUI } from 'src/sdk/ui/Provider'
|
|
|
2
2
|
|
|
3
3
|
import { Meta, Canvas, Story, ArgsTable } from '@storybook/addon-docs'
|
|
4
4
|
|
|
5
|
+
import { LinkButton } from '@faststore/ui'
|
|
6
|
+
|
|
5
7
|
import RegionalizationButton from './RegionalizationButton'
|
|
6
|
-
import ButtonLink from '../ui/Button/ButtonLink'
|
|
7
8
|
import RegionalizationInput from './RegionalizationInput'
|
|
8
9
|
import RegionalizationBar from './RegionalizationBar'
|
|
9
10
|
import RegionalizationModal, {
|
|
@@ -93,14 +94,15 @@ With the Regionalization feature enabled, if a customer enters their Postal Code
|
|
|
93
94
|
The Bar has a similar proposal for the button, usually used on mobile
|
|
94
95
|
devices only. It also triggers <code>RegionalizationModal</code>.
|
|
95
96
|
</p>
|
|
96
|
-
<
|
|
97
|
+
<LinkButton
|
|
98
|
+
size="small"
|
|
97
99
|
variant="tertiary"
|
|
98
100
|
href="../?path=/docs/features-regionalization-regionalizationbar--bar"
|
|
99
|
-
|
|
101
|
+
icon={<Icon name="ArrowRight" width="18" height="18" weight="bold" />}
|
|
102
|
+
iconPosition="right"
|
|
100
103
|
>
|
|
101
104
|
See more
|
|
102
|
-
|
|
103
|
-
</ButtonLink>
|
|
105
|
+
</LinkButton>
|
|
104
106
|
</article>
|
|
105
107
|
</li>
|
|
106
108
|
<li>
|
|
@@ -129,14 +131,15 @@ With the Regionalization feature enabled, if a customer enters their Postal Code
|
|
|
129
131
|
<code>RegionalizationBar</code>, shows the user the{' '}
|
|
130
132
|
<code>RegionalizationInput</code> search.
|
|
131
133
|
</p>
|
|
132
|
-
<
|
|
134
|
+
<LinkButton
|
|
135
|
+
size="small"
|
|
133
136
|
variant="tertiary"
|
|
134
137
|
href="../?path=/docs/features-regionalization-regionalizationmodal--overview"
|
|
135
|
-
|
|
138
|
+
icon={<Icon name="ArrowRight" width="18" height="18" weight="bold" />}
|
|
139
|
+
iconPosition="right"
|
|
136
140
|
>
|
|
137
141
|
See more
|
|
138
|
-
|
|
139
|
-
</ButtonLink>
|
|
142
|
+
</LinkButton>
|
|
140
143
|
</article>
|
|
141
144
|
</li>
|
|
142
145
|
</ul>
|
package/src/components/regionalization/RegionalizationModal/RegionalizationModal.stories.mdx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Meta, Canvas, Story, ArgsTable } from '@storybook/addon-docs'
|
|
2
2
|
import UIProvider, { useUI } from 'src/sdk/ui/Provider'
|
|
3
|
-
|
|
3
|
+
|
|
4
4
|
import RegionalizationModal, { RegionalizationModalContent } from '.'
|
|
5
5
|
import RegionalizationButton from 'src/components/regionalization/RegionalizationButton'
|
|
6
6
|
|
|
@@ -7,7 +7,8 @@ import UIProvider, { useUI } from 'src/sdk/ui/Provider'
|
|
|
7
7
|
import { validateSession } from 'src/sdk/session'
|
|
8
8
|
import { useFilter } from './useFilter'
|
|
9
9
|
|
|
10
|
-
import Button from '
|
|
10
|
+
import { Button } from '@faststore/ui'
|
|
11
|
+
|
|
11
12
|
import Icon from 'src/components/ui/Icon'
|
|
12
13
|
import Facets from './Facets'
|
|
13
14
|
import FilterSlider from './FilterSlider'
|
|
@@ -7,7 +7,8 @@ import UIProvider, { useUI } from 'src/sdk/ui/Provider'
|
|
|
7
7
|
import { validateSession } from 'src/sdk/session'
|
|
8
8
|
import { useFilter } from './useFilter'
|
|
9
9
|
|
|
10
|
-
import Button from '
|
|
10
|
+
import { Button } from '@faststore/ui'
|
|
11
|
+
|
|
11
12
|
import Icon from 'src/components/ui/Icon'
|
|
12
13
|
import FilterSlider from './FilterSlider'
|
|
13
14
|
|
|
@@ -7,23 +7,18 @@ import {
|
|
|
7
7
|
} from 'src/../.storybook/components'
|
|
8
8
|
|
|
9
9
|
import { SearchInputProvider } from 'src/sdk/search/useSearchInput'
|
|
10
|
-
import Button from 'src/components/ui/Button'
|
|
11
|
-
|
|
12
10
|
import { SearchHistory } from '.'
|
|
13
11
|
|
|
14
|
-
<Meta
|
|
15
|
-
title="Features/Search/SearchHistory"
|
|
16
|
-
component={SearchHistory}
|
|
17
|
-
/>
|
|
12
|
+
<Meta title="Features/Search/SearchHistory" component={SearchHistory} />
|
|
18
13
|
|
|
19
14
|
export const Template = (args) => {
|
|
20
15
|
return (
|
|
21
16
|
<div
|
|
22
17
|
style={{
|
|
23
|
-
maxWidth:
|
|
24
|
-
margin:
|
|
25
|
-
padding:
|
|
26
|
-
background:
|
|
18
|
+
maxWidth: '600px',
|
|
19
|
+
margin: '0 auto',
|
|
20
|
+
padding: '0 16px',
|
|
21
|
+
background: 'white',
|
|
27
22
|
}}
|
|
28
23
|
>
|
|
29
24
|
<SearchInputProvider>
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { Banner, BannerContent, BannerLink } from '@faststore/ui'
|
|
1
|
+
import { Banner, BannerContent, BannerLink, LinkButton } from '@faststore/ui'
|
|
2
2
|
import type { HTMLAttributes } from 'react'
|
|
3
3
|
|
|
4
|
-
import { ButtonLink } from 'src/components/ui/Button'
|
|
5
|
-
|
|
6
4
|
import Section from '../Section'
|
|
7
5
|
import styles from './banner-text.module.scss'
|
|
8
6
|
|
|
@@ -70,13 +68,13 @@ function BannerText({
|
|
|
70
68
|
{variant === 'secondary' && caption && <p>{caption}</p>}
|
|
71
69
|
</div>
|
|
72
70
|
<BannerLink data-fs-banner-text-link>
|
|
73
|
-
<
|
|
71
|
+
<LinkButton
|
|
74
72
|
href={actionPath}
|
|
75
73
|
variant={variant}
|
|
76
74
|
inverse={colorVariant === 'main'}
|
|
77
75
|
>
|
|
78
76
|
{actionLabel}
|
|
79
|
-
</
|
|
77
|
+
</LinkButton>
|
|
80
78
|
</BannerLink>
|
|
81
79
|
</BannerContent>
|
|
82
80
|
</Banner>
|
|
@@ -3,9 +3,9 @@ import {
|
|
|
3
3
|
Hero as UIHero,
|
|
4
4
|
HeroHeading as UIHeroHeading,
|
|
5
5
|
HeroImage as UIHeroImage,
|
|
6
|
+
LinkButton as UILinkButton,
|
|
6
7
|
} from '@faststore/ui'
|
|
7
8
|
|
|
8
|
-
import { ButtonLink } from 'src/components/ui/Button'
|
|
9
9
|
import Icon from 'src/components/ui/Icon'
|
|
10
10
|
import Image from 'src/components/ui/Image/Image'
|
|
11
11
|
|
|
@@ -91,9 +91,14 @@ const Hero = ({
|
|
|
91
91
|
<h1 data-fs-hero-title>{title}</h1>
|
|
92
92
|
<p data-fs-hero-subtitle>{subtitle}</p>
|
|
93
93
|
{!!link && (
|
|
94
|
-
<
|
|
95
|
-
|
|
96
|
-
|
|
94
|
+
<UILinkButton
|
|
95
|
+
href={link}
|
|
96
|
+
inverse={colorVariant === 'main'}
|
|
97
|
+
icon={<Icon name="ArrowRight" width={24} height={24} />}
|
|
98
|
+
iconPosition="right"
|
|
99
|
+
>
|
|
100
|
+
{linkText}
|
|
101
|
+
</UILinkButton>
|
|
97
102
|
)}
|
|
98
103
|
</div>
|
|
99
104
|
{icon && variant === 'secondary' && (
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LinkButton } from '@faststore/ui'
|
|
2
|
+
|
|
2
3
|
import EmptyState from 'src/components/ui/EmptyState'
|
|
3
4
|
import Icon from 'src/components/ui/Icon'
|
|
4
5
|
|
|
@@ -11,7 +12,7 @@ function EmptyGallery() {
|
|
|
11
12
|
<p>Nothing matches with your search</p>
|
|
12
13
|
</header>
|
|
13
14
|
|
|
14
|
-
<
|
|
15
|
+
<LinkButton
|
|
15
16
|
data-fs-empty-state-link
|
|
16
17
|
href="/office"
|
|
17
18
|
variant="secondary"
|
|
@@ -21,8 +22,8 @@ function EmptyGallery() {
|
|
|
21
22
|
iconPosition="left"
|
|
22
23
|
>
|
|
23
24
|
Browse Offers
|
|
24
|
-
</
|
|
25
|
-
<
|
|
25
|
+
</LinkButton>
|
|
26
|
+
<LinkButton
|
|
26
27
|
data-fs-empty-state-link
|
|
27
28
|
href="/technology"
|
|
28
29
|
variant="secondary"
|
|
@@ -30,7 +31,7 @@ function EmptyGallery() {
|
|
|
30
31
|
iconPosition="left"
|
|
31
32
|
>
|
|
32
33
|
Just Arrived
|
|
33
|
-
</
|
|
34
|
+
</LinkButton>
|
|
34
35
|
</EmptyState>
|
|
35
36
|
)
|
|
36
37
|
}
|
|
@@ -2,14 +2,13 @@ import { useSearch } from '@faststore/sdk'
|
|
|
2
2
|
import { NextSeo } from 'next-seo'
|
|
3
3
|
import { lazy, Suspense } from 'react'
|
|
4
4
|
import type { MouseEvent } from 'react'
|
|
5
|
-
import { Button as UIButton } from '@faststore/ui'
|
|
5
|
+
import { Button as UIButton, LinkButton as UILinkButton } from '@faststore/ui'
|
|
6
6
|
|
|
7
7
|
import Filter from 'src/components/search/Filter'
|
|
8
8
|
import Sort from 'src/components/search/Sort'
|
|
9
9
|
import FilterSkeleton from 'src/components/skeletons/FilterSkeleton'
|
|
10
10
|
import ProductGridSkeleton from 'src/components/skeletons/ProductGridSkeleton'
|
|
11
11
|
import Skeleton from 'src/components/skeletons/Skeleton'
|
|
12
|
-
import { ButtonLink } from 'src/components/ui/Button'
|
|
13
12
|
import Icon from 'src/components/ui/Icon'
|
|
14
13
|
import { mark } from 'src/sdk/tests/mark'
|
|
15
14
|
import { useUI } from 'src/sdk/ui/Provider'
|
|
@@ -121,7 +120,7 @@ function ProductGallery({ title, searchTerm }: Props) {
|
|
|
121
120
|
<NextSeo
|
|
122
121
|
additionalLinkTags={[{ rel: 'prev', href: prev.link }]}
|
|
123
122
|
/>
|
|
124
|
-
<
|
|
123
|
+
<UILinkButton
|
|
125
124
|
onClick={(e: MouseEvent<HTMLElement>) => {
|
|
126
125
|
e.currentTarget.blur()
|
|
127
126
|
e.preventDefault()
|
|
@@ -136,7 +135,7 @@ function ProductGallery({ title, searchTerm }: Props) {
|
|
|
136
135
|
}
|
|
137
136
|
>
|
|
138
137
|
Previous Page
|
|
139
|
-
</
|
|
138
|
+
</UILinkButton>
|
|
140
139
|
</div>
|
|
141
140
|
)}
|
|
142
141
|
|
|
@@ -162,8 +161,8 @@ function ProductGallery({ title, searchTerm }: Props) {
|
|
|
162
161
|
<NextSeo
|
|
163
162
|
additionalLinkTags={[{ rel: 'next', href: next.link }]}
|
|
164
163
|
/>
|
|
165
|
-
<
|
|
166
|
-
|
|
164
|
+
<UILinkButton
|
|
165
|
+
testId="show-more"
|
|
167
166
|
onClick={(e: MouseEvent<HTMLElement>) => {
|
|
168
167
|
e.currentTarget.blur()
|
|
169
168
|
e.preventDefault()
|
|
@@ -174,7 +173,7 @@ function ProductGallery({ title, searchTerm }: Props) {
|
|
|
174
173
|
variant="secondary"
|
|
175
174
|
>
|
|
176
175
|
Load more products
|
|
177
|
-
</
|
|
176
|
+
</UILinkButton>
|
|
178
177
|
</div>
|
|
179
178
|
)}
|
|
180
179
|
</div>
|
|
@@ -8,7 +8,6 @@ import FilterSkeleton from './FilterSkeleton'
|
|
|
8
8
|
import ProductCardSkeleton from './ProductCardSkeleton'
|
|
9
9
|
|
|
10
10
|
import Icon from 'src/components/ui/Icon'
|
|
11
|
-
import ButtonLink from 'src/components/ui/Icon'
|
|
12
11
|
|
|
13
12
|
export const TemplateSkeleton = ({ ...args }) => <Skeleton {...args} />
|
|
14
13
|
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { Meta, Canvas, Story, ArgsTable } from '@storybook/addon-docs'
|
|
2
|
-
import { List as UIList } from '@faststore/ui'
|
|
2
|
+
import { List as UIList, LinkButton as UILinkButton } from '@faststore/ui'
|
|
3
3
|
import { useState } from 'react'
|
|
4
4
|
|
|
5
5
|
import Accordion, { AccordionItem } from '.'
|
|
6
|
-
import ButtonLink from '../Button/ButtonLink'
|
|
7
6
|
import Icon from '../Icon'
|
|
8
7
|
|
|
9
8
|
<Meta
|
|
@@ -166,14 +165,15 @@ The `Accordion` component uses [FastStore UI Accordion](https://www.faststore.de
|
|
|
166
165
|
<p>
|
|
167
166
|
An item of the <code>Accordion</code> component.
|
|
168
167
|
</p>
|
|
169
|
-
<
|
|
168
|
+
<UILinkButton
|
|
169
|
+
size="small"
|
|
170
170
|
variant="tertiary"
|
|
171
171
|
href="../?path=/docs/molecules-accordion-accordionitem--default-story"
|
|
172
|
-
|
|
172
|
+
icon={<Icon name="ArrowRight" width="18" height="18" weight="bold" />}
|
|
173
|
+
iconPosition="right"
|
|
173
174
|
>
|
|
174
175
|
See more
|
|
175
|
-
|
|
176
|
-
</ButtonLink>
|
|
176
|
+
</UILinkButton>
|
|
177
177
|
</article>
|
|
178
178
|
</li>
|
|
179
179
|
</ul>
|
|
@@ -189,31 +189,34 @@ The `Accordion` component uses [FastStore UI Accordion](https://www.faststore.de
|
|
|
189
189
|
<article className="sbdocs-list-text">
|
|
190
190
|
<h3>ProductDetailsContent</h3>
|
|
191
191
|
<p>
|
|
192
|
-
Used by the <code>ProductDetailsContent</code> component to organize
|
|
192
|
+
Used by the <code>ProductDetailsContent</code> component to organize
|
|
193
|
+
product information in different sections.
|
|
193
194
|
</p>
|
|
194
|
-
<
|
|
195
|
+
<UILinkButton
|
|
196
|
+
size="small"
|
|
195
197
|
variant="tertiary"
|
|
196
198
|
href="../?path=/docs/organisms-productdetailscontent--default-story"
|
|
197
|
-
|
|
199
|
+
icon={<Icon name="ArrowRight" width="18" height="18" weight="bold" />}
|
|
200
|
+
iconPosition="right"
|
|
198
201
|
>
|
|
199
202
|
See more
|
|
200
|
-
|
|
201
|
-
</ButtonLink>
|
|
203
|
+
</UILinkButton>
|
|
202
204
|
</article>
|
|
203
205
|
<article className="sbdocs-list-text">
|
|
204
206
|
<h3>Footer</h3>
|
|
205
207
|
<p>
|
|
206
208
|
Used by the <code>Footer</code> component on mobile devices.
|
|
207
209
|
</p>
|
|
208
|
-
<
|
|
210
|
+
<UILinkButton
|
|
211
|
+
size="small"
|
|
209
212
|
variant="tertiary"
|
|
210
213
|
href="../?path=/docs/organisms-footer--default-story"
|
|
211
|
-
|
|
214
|
+
icon={<Icon name="ArrowRight" width="18" height="18" weight="bold" />}
|
|
215
|
+
iconPosition="right"
|
|
212
216
|
>
|
|
213
217
|
See more
|
|
214
|
-
|
|
215
|
-
</ButtonLink>
|
|
218
|
+
</UILinkButton>
|
|
216
219
|
</article>
|
|
217
|
-
</li>
|
|
220
|
+
</li>
|
|
218
221
|
</ul>
|
|
219
|
-
</section>
|
|
222
|
+
</section>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ArgsTable, Canvas, Meta, Story } from '@storybook/addon-docs'
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import { Button, BuyButton } from '@faststore/ui'
|
|
3
|
+
import { Button, BuyButton, LinkButton } from '@faststore/ui'
|
|
5
4
|
import Icon from 'src/components/ui/Icon'
|
|
6
5
|
|
|
7
6
|
import {
|
|
@@ -611,7 +610,7 @@ export const Usage = ({ inverse, ...args }) => {
|
|
|
611
610
|
title="Button Link"
|
|
612
611
|
description="A button that acts as a link to navigate users between pages."
|
|
613
612
|
>
|
|
614
|
-
<
|
|
613
|
+
<LinkButton href="/">Button Link</LinkButton>
|
|
615
614
|
</SectionItem>
|
|
616
615
|
</SectionList>
|
|
617
616
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LinkButton } from '@faststore/ui'
|
|
2
|
+
|
|
2
3
|
import styles from 'src/components/ui/Button/button.module.scss'
|
|
3
4
|
import Icon from 'src/components/ui/Icon'
|
|
4
5
|
import { useSession } from 'src/sdk/session'
|
|
@@ -7,15 +8,16 @@ const ButtonSignIn = () => {
|
|
|
7
8
|
const { person } = useSession()
|
|
8
9
|
|
|
9
10
|
return (
|
|
10
|
-
<
|
|
11
|
+
<LinkButton
|
|
11
12
|
data-fs-button-signin-link
|
|
12
13
|
href={person?.id ? '/account' : '/login'}
|
|
13
14
|
className={`${styles.fsButton} text__title-mini`}
|
|
14
15
|
variant="tertiary"
|
|
16
|
+
icon={<Icon name="User" width={18} height={18} weight="bold" />}
|
|
17
|
+
iconPosition="left"
|
|
15
18
|
>
|
|
16
|
-
<Icon name="User" width={18} height={18} weight="bold" />
|
|
17
19
|
<span>{person?.id ? 'My Account' : 'Sign In'}</span>
|
|
18
|
-
</
|
|
20
|
+
</LinkButton>
|
|
19
21
|
)
|
|
20
22
|
}
|
|
21
23
|
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
+
import { LinkButton } from '@faststore/ui'
|
|
2
|
+
|
|
1
3
|
import Icon from 'src/components/ui/Icon'
|
|
2
|
-
import ButtonLink from 'src/components/ui/Button/ButtonLink'
|
|
3
4
|
|
|
4
5
|
function ButtonSignInFallback() {
|
|
5
6
|
return (
|
|
6
|
-
<
|
|
7
|
+
<LinkButton
|
|
7
8
|
data-fs-button-signin-link
|
|
8
9
|
href="/login"
|
|
9
10
|
className="text__title-mini"
|
|
10
11
|
variant="tertiary"
|
|
12
|
+
icon={<Icon name="User" width={18} height={18} weight="bold" />}
|
|
13
|
+
iconPosition="left"
|
|
11
14
|
>
|
|
12
|
-
<Icon name="User" width={18} height={18} weight="bold" />
|
|
13
15
|
<span>{'Sign In'}</span>
|
|
14
|
-
</
|
|
16
|
+
</LinkButton>
|
|
15
17
|
)
|
|
16
18
|
}
|
|
17
19
|
|
|
File without changes
|
|
File without changes
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
export { default as
|
|
2
|
-
export { default as
|
|
3
|
-
export { default as ButtonSignInFallback } from './ButtonLink/ButtonSignIn/ButtonSignInFallback'
|
|
1
|
+
export { default as ButtonSignIn } from './ButtonSignIn'
|
|
2
|
+
export { default as ButtonSignInFallback } from './ButtonSignIn/ButtonSignInFallback'
|
|
@@ -2,9 +2,9 @@ import { ArgsTable, Canvas, Meta, Story } from '@storybook/addon-docs'
|
|
|
2
2
|
|
|
3
3
|
import { TokenTable, TokenRow } from 'src/../.storybook/components'
|
|
4
4
|
|
|
5
|
-
import Button from '
|
|
5
|
+
import { Button, LinkButton } from '@faststore/ui'
|
|
6
|
+
|
|
6
7
|
import Icon from 'src/components/ui/Icon'
|
|
7
|
-
import { ButtonLink } from 'src/components/ui/Button'
|
|
8
8
|
|
|
9
9
|
import EmptyState from '.'
|
|
10
10
|
|
|
@@ -115,7 +115,7 @@ export const TemplateEmptyGallery = (args) => {
|
|
|
115
115
|
<Icon name="CircleWavyWarning" width={56} height={56} weight="thin" />
|
|
116
116
|
<p>Nothing matches with your search</p>
|
|
117
117
|
</header>
|
|
118
|
-
<
|
|
118
|
+
<LinkButton
|
|
119
119
|
data-fs-empty-state-link
|
|
120
120
|
href="#"
|
|
121
121
|
variant="secondary"
|
|
@@ -125,8 +125,8 @@ export const TemplateEmptyGallery = (args) => {
|
|
|
125
125
|
iconPosition="left"
|
|
126
126
|
>
|
|
127
127
|
Browse Offers
|
|
128
|
-
</
|
|
129
|
-
<
|
|
128
|
+
</LinkButton>
|
|
129
|
+
<LinkButton
|
|
130
130
|
data-fs-empty-state-link
|
|
131
131
|
href="#"
|
|
132
132
|
variant="secondary"
|
|
@@ -134,7 +134,7 @@ export const TemplateEmptyGallery = (args) => {
|
|
|
134
134
|
iconPosition="left"
|
|
135
135
|
>
|
|
136
136
|
Just Arrived
|
|
137
|
-
</
|
|
137
|
+
</LinkButton>
|
|
138
138
|
</EmptyState>
|
|
139
139
|
)
|
|
140
140
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Meta, Canvas, Story, ArgsTable } from '@storybook/addon-docs'
|
|
2
|
+
|
|
3
|
+
import { Button, LinkButton } from '@faststore/ui'
|
|
4
|
+
|
|
2
5
|
import UIProvider, { useUI } from 'src/sdk/ui/Provider'
|
|
3
|
-
import Button from 'src/components/ui/Button'
|
|
4
|
-
import ButtonLink from 'src/components/ui/Button/ButtonLink'
|
|
5
6
|
import { RegionalizationModalContent } from 'src/components/regionalization/RegionalizationModal'
|
|
6
7
|
|
|
7
8
|
import Modal from '.'
|
|
@@ -128,14 +129,15 @@ The `Modal` component uses [FastStore UI Modal](https://www.faststore.dev/refere
|
|
|
128
129
|
<code>RegionalizationBar</code>, shows the user the{' '}
|
|
129
130
|
<code>RegionalizationInput</code> search.
|
|
130
131
|
</p>
|
|
131
|
-
<
|
|
132
|
+
<LinkButton
|
|
133
|
+
size="small"
|
|
132
134
|
variant="tertiary"
|
|
133
135
|
href="../?path=/docs/features-regionalization-regionalizationmodal--overview"
|
|
134
|
-
|
|
136
|
+
icon={<Icon name="ArrowRight" width="18" height="18" weight="bold" />}
|
|
137
|
+
iconPosition="right"
|
|
135
138
|
>
|
|
136
139
|
See more
|
|
137
|
-
|
|
138
|
-
</ButtonLink>
|
|
140
|
+
</LinkButton>
|
|
139
141
|
</article>
|
|
140
142
|
</li>
|
|
141
143
|
</ul>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Description, Meta } from '@storybook/addon-docs'
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import { LinkButton } from '@faststore/ui'
|
|
4
|
+
|
|
4
5
|
import Icon from '../components/ui/Icon'
|
|
5
6
|
|
|
6
7
|
<Meta
|
|
@@ -14,14 +15,15 @@ import Icon from '../components/ui/Icon'
|
|
|
14
15
|
|
|
15
16
|
This themeable structure is made of two complementary layers: a useful and assorted library of templates for the components and sections, alongside a comprehensive set of design tokens to further customize them.
|
|
16
17
|
|
|
17
|
-
<
|
|
18
|
+
<LinkButton
|
|
19
|
+
size="small"
|
|
18
20
|
variant="tertiary"
|
|
19
21
|
href="../?path=/docs/theming-customizing--page"
|
|
20
|
-
|
|
22
|
+
icon={<Icon name="ArrowRight" width="18" height="18" weight="bold" />}
|
|
23
|
+
iconPosition="right"
|
|
21
24
|
>
|
|
22
25
|
Customizing your store
|
|
23
|
-
|
|
24
|
-
</ButtonLink>
|
|
26
|
+
</LinkButton>
|
|
25
27
|
|
|
26
28
|
</header>
|
|
27
29
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Description, Meta } from '@storybook/addon-docs'
|
|
2
2
|
import { Callout } from 'src/../.storybook/components'
|
|
3
3
|
|
|
4
|
-
import
|
|
4
|
+
import { LinkButton } from '@faststore/ui'
|
|
5
|
+
|
|
5
6
|
import Icon from '../components/ui/Icon'
|
|
6
7
|
|
|
7
8
|
<Meta
|
|
@@ -15,23 +16,25 @@ import Icon from '../components/ui/Icon'
|
|
|
15
16
|
|
|
16
17
|
FastStore NextJS Starter's components library is an ecommerce-focused library **created by VTEX** that provides best-of-breed components, blazing-fast performance, and a frictionless development experience to create storefronts using FastStore UI library as base.
|
|
17
18
|
|
|
18
|
-
<
|
|
19
|
+
<LinkButton
|
|
20
|
+
size="small"
|
|
19
21
|
variant="tertiary"
|
|
20
22
|
href="https://nextjs.vtex.app/"
|
|
21
|
-
|
|
23
|
+
icon={<Icon name="ArrowRight" width="18" height="18" weight="bold" />}
|
|
24
|
+
iconPosition="right"
|
|
22
25
|
>
|
|
23
26
|
NextJS Store Starter
|
|
24
|
-
|
|
25
|
-
</ButtonLink>
|
|
27
|
+
</LinkButton>
|
|
26
28
|
|
|
27
|
-
<
|
|
29
|
+
<LinkButton
|
|
30
|
+
size="small"
|
|
28
31
|
variant="tertiary"
|
|
29
32
|
href="https://www.faststore.dev/reference/ui/faststore-ui"
|
|
30
|
-
|
|
33
|
+
icon={<Icon name="ArrowRight" width="18" height="18" weight="bold" />}
|
|
34
|
+
iconPosition="right"
|
|
31
35
|
>
|
|
32
36
|
FastStore UI library
|
|
33
|
-
|
|
34
|
-
</ButtonLink>
|
|
37
|
+
</LinkButton>
|
|
35
38
|
|
|
36
39
|
</header>
|
|
37
40
|
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { useRef } from 'react'
|
|
2
|
-
import type { FocusEvent } from 'react'
|
|
3
|
-
import { Icon as UIIcon } from '@faststore/ui'
|
|
4
|
-
import type { ButtonProps } from '@faststore/ui'
|
|
5
|
-
|
|
6
|
-
import Link from 'src/components/ui/Link'
|
|
7
|
-
import type { LinkProps } from 'src/components/ui/Link'
|
|
8
|
-
|
|
9
|
-
import styles from '../button.module.scss'
|
|
10
|
-
|
|
11
|
-
type ButtonLinkProps = ButtonProps & Omit<LinkProps, 'variant'>
|
|
12
|
-
|
|
13
|
-
function ButtonLink({
|
|
14
|
-
variant = 'primary',
|
|
15
|
-
inverse,
|
|
16
|
-
icon,
|
|
17
|
-
iconPosition,
|
|
18
|
-
children,
|
|
19
|
-
disabled = false,
|
|
20
|
-
...otherProps
|
|
21
|
-
}: ButtonLinkProps) {
|
|
22
|
-
const linkRef = useRef<HTMLAnchorElement | null>(null)
|
|
23
|
-
|
|
24
|
-
return (
|
|
25
|
-
<Link
|
|
26
|
-
ref={linkRef}
|
|
27
|
-
className={styles.fsButton}
|
|
28
|
-
data-fs-button
|
|
29
|
-
data-fs-button-link
|
|
30
|
-
data-fs-link={null}
|
|
31
|
-
data-fs-button-variant={variant}
|
|
32
|
-
data-fs-button-inverse={inverse}
|
|
33
|
-
data-fs-button-disabled={disabled}
|
|
34
|
-
onFocus={(e: FocusEvent) => {
|
|
35
|
-
e.preventDefault()
|
|
36
|
-
|
|
37
|
-
if (disabled) {
|
|
38
|
-
linkRef.current?.blur()
|
|
39
|
-
}
|
|
40
|
-
}}
|
|
41
|
-
{...otherProps}
|
|
42
|
-
>
|
|
43
|
-
{iconPosition === 'left' && <UIIcon component={icon} />}
|
|
44
|
-
{children}
|
|
45
|
-
{iconPosition === 'right' && <UIIcon component={icon} />}
|
|
46
|
-
</Link>
|
|
47
|
-
)
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export default ButtonLink
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './ButtonLink'
|