@faststore/core 0.3.8 → 0.3.10

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.
Files changed (34) hide show
  1. package/.storybook/components/SectionItem.tsx +9 -5
  2. package/.storybook/storybook.css +1 -1
  3. package/CHANGELOG.md +14 -0
  4. package/package.json +1 -1
  5. package/src/components/common/Navbar/NavbarSlider.stories.mdx +1 -1
  6. package/src/components/product/ProductCard/ProductCard.stories.mdx +2 -1
  7. package/src/components/regionalization/Regionalization.stories.mdx +12 -9
  8. package/src/components/regionalization/RegionalizationModal/RegionalizationModal.stories.mdx +1 -1
  9. package/src/components/search/Filter/Filter.stories.mdx +2 -1
  10. package/src/components/search/Filter/FilterSlider.stories.mdx +2 -1
  11. package/src/components/search/SearchHistory/SearchHistory.stories.mdx +5 -10
  12. package/src/components/sections/BannerText/BannerText.tsx +3 -5
  13. package/src/components/sections/BannerText/banner-text.module.scss +1 -1
  14. package/src/components/sections/Hero/Hero.tsx +9 -4
  15. package/src/components/sections/ProductGallery/EmptyGallery.tsx +6 -5
  16. package/src/components/sections/ProductGallery/ProductGallery.tsx +6 -7
  17. package/src/components/skeletons/Skeletons.stories.mdx +0 -1
  18. package/src/components/ui/Accordion/Accordion.stories.mdx +20 -17
  19. package/src/components/ui/Button/Button.stories.mdx +2 -3
  20. package/src/components/ui/Button/{ButtonLink/ButtonSignIn → ButtonSignIn}/ButtonSignIn.tsx +6 -4
  21. package/src/components/ui/Button/{ButtonLink/ButtonSignIn → ButtonSignIn}/ButtonSignInFallback/ButtonSignInFallback.tsx +6 -4
  22. package/src/components/ui/Button/{ButtonLink/ButtonSignIn → ButtonSignIn}/ButtonSignInFallback/index.ts +0 -0
  23. package/src/components/ui/Button/{ButtonLink/ButtonSignIn → ButtonSignIn}/index.ts +0 -0
  24. package/src/components/ui/Button/index.ts +2 -3
  25. package/src/components/ui/EmptyState/EmptyState.stories.mdx +6 -6
  26. package/src/components/ui/Modal/Modal.stories.mdx +8 -6
  27. package/src/components/ui/Toast/Toast.stories.mdx +1 -1
  28. package/src/customizations/{index.ts → components/index.ts} +0 -0
  29. package/src/pages/[slug]/p.tsx +9 -9
  30. package/src/pages/index.tsx +6 -9
  31. package/src/stories/brandless.stories.mdx +7 -5
  32. package/src/stories/getting-started.stories.mdx +12 -9
  33. package/src/components/ui/Button/ButtonLink/ButtonLink.tsx +0 -50
  34. 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 ButtonLink from '../../src/components/ui/Button/ButtonLink'
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
- <ButtonLink
31
+ <LinkButton
32
+ size="small"
31
33
  variant="tertiary"
32
34
  href={actionPath}
33
- data-fs-button-size="small"
35
+ icon={
36
+ <Icon name="ArrowRight" width="18" height="18" weight="bold" />
37
+ }
38
+ iconPosition="right"
34
39
  >
35
40
  See more
36
- <Icon name="ArrowRight" width="18" height="18" weight="bold" />
37
- </ButtonLink>
41
+ </LinkButton>
38
42
  )}
39
43
  </article>
40
44
  </li>
@@ -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-link]:first-of-type {
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.10](https://github.com/vtex-sites/nextjs.store/compare/0.3.9...0.3.10) (2022-12-19)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * custom components on home page ([#325](https://github.com/vtex-sites/nextjs.store/issues/325)) ([c7fbdec](https://github.com/vtex-sites/nextjs.store/commit/c7fbdecd9c2730d4f474444ee086a7099fa2843f)), closes [#326](https://github.com/vtex-sites/nextjs.store/issues/326)
14
+
15
+ ### [0.3.9](https://github.com/vtex-sites/nextjs.store/compare/0.3.8...0.3.9) (2022-12-16)
16
+
17
+
18
+ ### Chores
19
+
20
+ * Replaces `LinkButton` UI ([#322](https://github.com/vtex-sites/nextjs.store/issues/322)) ([532f20d](https://github.com/vtex-sites/nextjs.store/commit/532f20d96611254f2453bf0b29e610cb6052daa2))
21
+
8
22
  ### [0.3.8](https://github.com/vtex-sites/nextjs.store/compare/0.3.7...0.3.8) (2022-12-16)
9
23
 
10
24
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faststore/core",
3
- "version": "0.3.8",
3
+ "version": "0.3.10",
4
4
  "license": "MIT",
5
5
  "browserslist": "supports es6-module and not dead",
6
6
  "scripts": {
@@ -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 'src/components/ui/Button'
5
+ import { Button } from '@faststore/ui'
6
6
  import Icon from 'src/components/ui/Icon'
7
7
 
8
8
  import { NavbarSlider } from '.'
@@ -1,7 +1,8 @@
1
1
  import { Meta, Canvas, Story, ArgsTable } from '@storybook/addon-docs'
2
2
 
3
+ import { Button } from '@faststore/ui'
4
+
3
5
  import Icon from '../../ui/Icon'
4
- import Button from '../../ui/Button'
5
6
  import ProductCard from '.'
6
7
 
7
8
  import {
@@ -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
- <ButtonLink
97
+ <LinkButton
98
+ size="small"
97
99
  variant="tertiary"
98
100
  href="../?path=/docs/features-regionalization-regionalizationbar--bar"
99
- data-fs-button-size="small"
101
+ icon={<Icon name="ArrowRight" width="18" height="18" weight="bold" />}
102
+ iconPosition="right"
100
103
  >
101
104
  See more
102
- <Icon name="ArrowRight" width="18" height="18" weight="bold" />
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
- <ButtonLink
134
+ <LinkButton
135
+ size="small"
133
136
  variant="tertiary"
134
137
  href="../?path=/docs/features-regionalization-regionalizationmodal--overview"
135
- data-fs-button-size="small"
138
+ icon={<Icon name="ArrowRight" width="18" height="18" weight="bold" />}
139
+ iconPosition="right"
136
140
  >
137
141
  See more
138
- <Icon name="ArrowRight" width="18" height="18" weight="bold" />
139
- </ButtonLink>
142
+ </LinkButton>
140
143
  </article>
141
144
  </li>
142
145
  </ul>
@@ -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
- import Button from 'src/components/ui/Button'
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 'src/components/ui/Button'
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 'src/components/ui/Button'
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: "600px",
24
- margin: "0 auto",
25
- padding: "0 16px",
26
- background: "white",
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
- <ButtonLink
71
+ <LinkButton
74
72
  href={actionPath}
75
73
  variant={variant}
76
74
  inverse={colorVariant === 'main'}
77
75
  >
78
76
  {actionLabel}
79
- </ButtonLink>
77
+ </LinkButton>
80
78
  </BannerLink>
81
79
  </BannerContent>
82
80
  </Banner>
@@ -59,7 +59,7 @@
59
59
  height: 100%;
60
60
  }
61
61
 
62
- [data-fs-banner-text-link] [data-fs-button-link] {
62
+ [data-fs-banner-text-link] [data-fs-link-button] {
63
63
  min-width: var(--fs-banner-button-link-min-width);
64
64
  margin-top: var(--fs-banner-button-link-margin-top);
65
65
  }
@@ -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
- <ButtonLink href={link} inverse={colorVariant === 'main'}>
95
- {linkText} <Icon name="ArrowRight" width={24} height={24} />
96
- </ButtonLink>
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 { ButtonLink } from 'src/components/ui/Button'
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
- <ButtonLink
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
- </ButtonLink>
25
- <ButtonLink
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
- </ButtonLink>
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
- <ButtonLink
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
- </ButtonLink>
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
- <ButtonLink
166
- data-testid="show-more"
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
- </ButtonLink>
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
- <ButtonLink
168
+ <UILinkButton
169
+ size="small"
170
170
  variant="tertiary"
171
171
  href="../?path=/docs/molecules-accordion-accordionitem--default-story"
172
- data-fs-button-size="small"
172
+ icon={<Icon name="ArrowRight" width="18" height="18" weight="bold" />}
173
+ iconPosition="right"
173
174
  >
174
175
  See more
175
- <Icon name="ArrowRight" width="18" height="18" weight="bold" />
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 product information in different sections.
192
+ Used by the <code>ProductDetailsContent</code> component to organize
193
+ product information in different sections.
193
194
  </p>
194
- <ButtonLink
195
+ <UILinkButton
196
+ size="small"
195
197
  variant="tertiary"
196
198
  href="../?path=/docs/organisms-productdetailscontent--default-story"
197
- data-fs-button-size="small"
199
+ icon={<Icon name="ArrowRight" width="18" height="18" weight="bold" />}
200
+ iconPosition="right"
198
201
  >
199
202
  See more
200
- <Icon name="ArrowRight" width="18" height="18" weight="bold" />
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
- <ButtonLink
210
+ <UILinkButton
211
+ size="small"
209
212
  variant="tertiary"
210
213
  href="../?path=/docs/organisms-footer--default-story"
211
- data-fs-button-size="small"
214
+ icon={<Icon name="ArrowRight" width="18" height="18" weight="bold" />}
215
+ iconPosition="right"
212
216
  >
213
217
  See more
214
- <Icon name="ArrowRight" width="18" height="18" weight="bold" />
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 { ButtonLink } from '.'
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
- <ButtonLink href="/">Button Link</ButtonLink>
613
+ <LinkButton href="/">Button Link</LinkButton>
615
614
  </SectionItem>
616
615
  </SectionList>
617
616
 
@@ -1,4 +1,5 @@
1
- import { ButtonLink } from 'src/components/ui/Button'
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
- <ButtonLink
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
- </ButtonLink>
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
- <ButtonLink
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
- </ButtonLink>
16
+ </LinkButton>
15
17
  )
16
18
  }
17
19
 
@@ -1,3 +1,2 @@
1
- export { default as ButtonLink } from './ButtonLink'
2
- export { default as ButtonSignIn } from './ButtonLink/ButtonSignIn'
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 'src/components/ui/Button'
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
- <ButtonLink
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
- </ButtonLink>
129
- <ButtonLink
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
- </ButtonLink>
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
- <ButtonLink
132
+ <LinkButton
133
+ size="small"
132
134
  variant="tertiary"
133
135
  href="../?path=/docs/features-regionalization-regionalizationmodal--overview"
134
- data-fs-button-size="small"
136
+ icon={<Icon name="ArrowRight" width="18" height="18" weight="bold" />}
137
+ iconPosition="right"
135
138
  >
136
139
  See more
137
- <Icon name="ArrowRight" width="18" height="18" weight="bold" />
138
- </ButtonLink>
140
+ </LinkButton>
139
141
  </article>
140
142
  </li>
141
143
  </ul>
@@ -8,7 +8,7 @@ import {
8
8
  import UIProvider, { useUI } from 'src/sdk/ui/Provider'
9
9
 
10
10
  import Toast from '.'
11
- import Button from 'src/components/ui/Button'
11
+ import { Button } from '@faststore/ui'
12
12
 
13
13
  <Meta title="Atoms/Toast" component={Toast} />
14
14
 
@@ -1,24 +1,24 @@
1
1
  import { isNotFoundError } from '@faststore/api'
2
2
  import { gql } from '@faststore/graphql-utils'
3
- import { BreadcrumbJsonLd, NextSeo, ProductJsonLd } from 'next-seo'
3
+ import type { Locator } from '@vtex/client-cms'
4
4
  import type { GetStaticPaths, GetStaticProps } from 'next'
5
+ import { BreadcrumbJsonLd, NextSeo, ProductJsonLd } from 'next-seo'
5
6
  import type { ComponentType } from 'react'
6
- import type { Locator } from '@vtex/client-cms'
7
7
 
8
+ import type {
9
+ ServerProductPageQueryQuery,
10
+ ServerProductPageQueryQueryVariables,
11
+ } from '@generated/graphql'
8
12
  import RenderPageSections from 'src/components/cms/RenderPageSections'
9
13
  import BannerNewsletter from 'src/components/sections/BannerNewsletter/BannerNewsletter'
10
14
  import CrossSellingShelf from 'src/components/sections/CrossSellingShelf'
11
15
  import ProductDetails from 'src/components/sections/ProductDetails'
16
+ import CUSTOM_COMPONENTS from 'src/customizations/components'
12
17
  import { useSession } from 'src/sdk/session'
13
18
  import { mark } from 'src/sdk/tests/mark'
14
19
  import { execute } from 'src/server'
15
- import { getPage } from 'src/server/cms'
16
20
  import type { PDPContentType } from 'src/server/cms'
17
- import CUSTOM_SECTIONS from 'src/customizations'
18
- import type {
19
- ServerProductPageQueryQuery,
20
- ServerProductPageQueryQueryVariables,
21
- } from '@generated/graphql'
21
+ import { getPage } from 'src/server/cms'
22
22
 
23
23
  import storeConfig from '../../../store.config'
24
24
 
@@ -30,7 +30,7 @@ const COMPONENTS: Record<string, ComponentType<any>> = {
30
30
  ProductDetails,
31
31
  BannerNewsletter,
32
32
  CrossSellingShelf,
33
- ...CUSTOM_SECTIONS,
33
+ ...CUSTOM_COMPONENTS,
34
34
  }
35
35
 
36
36
  type Props = ServerProductPageQueryQuery & PDPContentType
@@ -1,7 +1,7 @@
1
+ import type { Locator } from '@vtex/client-cms'
2
+ import type { GetStaticProps } from 'next'
1
3
  import { NextSeo, SiteLinksSearchBoxJsonLd } from 'next-seo'
2
4
  import type { ComponentType } from 'react'
3
- import type { GetStaticProps } from 'next'
4
- import type { Locator } from '@vtex/client-cms'
5
5
 
6
6
  import RenderPageSections from 'src/components/cms/RenderPageSections'
7
7
  import BannerText from 'src/components/sections/BannerText'
@@ -10,17 +10,14 @@ import IncentivesHeader from 'src/components/sections/Incentives/IncentivesHeade
10
10
  import Newsletter from 'src/components/sections/Newsletter'
11
11
  import ProductShelf from 'src/components/sections/ProductShelf'
12
12
  import ProductTiles from 'src/components/sections/ProductTiles'
13
+ import CUSTOM_COMPONENTS from 'src/customizations/components'
13
14
  import { mark } from 'src/sdk/tests/mark'
14
- import { getPage } from 'src/server/cms'
15
15
  import type { PageContentType } from 'src/server/cms'
16
- import CUSTOM_SECTIONS from 'src/customizations'
16
+ import { getPage } from 'src/server/cms'
17
17
 
18
18
  import storeConfig from '../../store.config'
19
19
 
20
- /**
21
- * Sections: Components imported from each store's custom components and '../components/sections'.
22
- * Do not import or render components from any other folder in here.
23
- */
20
+ /* A list of components that can be used in the CMS. */
24
21
  const COMPONENTS: Record<string, ComponentType<any>> = {
25
22
  Hero,
26
23
  BannerText,
@@ -28,7 +25,7 @@ const COMPONENTS: Record<string, ComponentType<any>> = {
28
25
  ProductShelf,
29
26
  ProductTiles,
30
27
  Newsletter,
31
- ...CUSTOM_SECTIONS,
28
+ ...CUSTOM_COMPONENTS,
32
29
  }
33
30
 
34
31
  type Props = PageContentType
@@ -1,6 +1,7 @@
1
1
  import { Description, Meta } from '@storybook/addon-docs'
2
2
 
3
- import ButtonLink from '../components/ui/Button/ButtonLink'
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
- <ButtonLink
18
+ <LinkButton
19
+ size="small"
18
20
  variant="tertiary"
19
21
  href="../?path=/docs/theming-customizing--page"
20
- data-fs-button-size="small"
22
+ icon={<Icon name="ArrowRight" width="18" height="18" weight="bold" />}
23
+ iconPosition="right"
21
24
  >
22
25
  Customizing your store
23
- <Icon name="ArrowRight" width="18" height="18" weight="bold" />
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 ButtonLink from '../components/ui/Button/ButtonLink'
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
- <ButtonLink
19
+ <LinkButton
20
+ size="small"
19
21
  variant="tertiary"
20
22
  href="https://nextjs.vtex.app/"
21
- data-fs-button-size="small"
23
+ icon={<Icon name="ArrowRight" width="18" height="18" weight="bold" />}
24
+ iconPosition="right"
22
25
  >
23
26
  NextJS Store Starter
24
- <Icon name="ArrowRight" width="18" height="18" weight="bold" />
25
- </ButtonLink>
27
+ </LinkButton>
26
28
 
27
- <ButtonLink
29
+ <LinkButton
30
+ size="small"
28
31
  variant="tertiary"
29
32
  href="https://www.faststore.dev/reference/ui/faststore-ui"
30
- data-fs-button-size="small"
33
+ icon={<Icon name="ArrowRight" width="18" height="18" weight="bold" />}
34
+ iconPosition="right"
31
35
  >
32
36
  FastStore UI library
33
- <Icon name="ArrowRight" width="18" height="18" weight="bold" />
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'