@faststore/core 22.42.6
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/.babelrc +4 -0
- package/.editorconfig +13 -0
- package/.eslintignore +8 -0
- package/.eslintrc +21 -0
- package/.github/CODEOWNERS +2 -0
- package/.github/workflows/release.yml +40 -0
- package/.husky/pre-commit +4 -0
- package/.prettierignore +8 -0
- package/.prettierrc +1 -0
- package/.release-it.json +31 -0
- package/.storybook/components/BestPractices.tsx +18 -0
- package/.storybook/components/BestPracticesRule.tsx +43 -0
- package/.storybook/components/Callout.tsx +12 -0
- package/.storybook/components/SectionItem.tsx +44 -0
- package/.storybook/components/SectionList.tsx +27 -0
- package/.storybook/components/TokenDivider.tsx +12 -0
- package/.storybook/components/TokenRow.tsx +32 -0
- package/.storybook/components/TokenTable.tsx +33 -0
- package/.storybook/components/index.ts +8 -0
- package/.storybook/main.js +59 -0
- package/.storybook/manager-head.html +9 -0
- package/.storybook/manager.js +6 -0
- package/.storybook/mocks/cart-sidebar.js +40 -0
- package/.storybook/mocks/filter-slider.js +59 -0
- package/.storybook/mocks/index.ts +5 -0
- package/.storybook/mocks/product.ts +67 -0
- package/.storybook/mocks/productGridItems.ts +334 -0
- package/.storybook/mocks/searchHistory.ts +8 -0
- package/.storybook/mocks/searchTerms.ts +5 -0
- package/.storybook/preview-head.html +1 -0
- package/.storybook/preview.js +89 -0
- package/.storybook/storybook.css +550 -0
- package/.storybook/theme.js +21 -0
- package/.stylelintignore +1 -0
- package/.vscode/settings.json +7 -0
- package/@generated/graphql/index.ts +1133 -0
- package/@generated/graphql/persisted.json +12 -0
- package/CHANGELOG.md +730 -0
- package/LICENSE +21 -0
- package/README.md +437 -0
- package/bun.lockb +0 -0
- package/cms/content-types.json +52 -0
- package/cms/sections.json +350 -0
- package/cms/translation-keys.json +1 -0
- package/cms-webhook-urls.json +5 -0
- package/codegen.yml +22 -0
- package/cypress/fixtures/example.json +5 -0
- package/cypress/global.js +15 -0
- package/cypress/integration/a11y.test.js +45 -0
- package/cypress/integration/analytics.test.js +381 -0
- package/cypress/integration/cart.test.js +100 -0
- package/cypress/integration/performance.test.js +65 -0
- package/cypress/integration/plp.test.js +224 -0
- package/cypress/integration/search.test.js +38 -0
- package/cypress/integration/seo.test.js +318 -0
- package/cypress/plugins/index.js +41 -0
- package/cypress/support/commands.js +70 -0
- package/cypress/support/index.js +3 -0
- package/cypress.json +9 -0
- package/lighthouserc.js +22 -0
- package/next-env.d.ts +5 -0
- package/next.config.js +35 -0
- package/package.json +114 -0
- package/postcss.config.js +5 -0
- package/public/brandless-negative.png +0 -0
- package/public/brandless-neutral.png +0 -0
- package/public/brandless-positive.png +0 -0
- package/public/brandless-storybook.png +0 -0
- package/public/favicon.ico +0 -0
- package/public/icons.svg +58 -0
- package/public/logo.svg +42 -0
- package/public/mockServiceWorker.js +367 -0
- package/public/robots.txt +5 -0
- package/pull_request_template.md +37 -0
- package/renovate.json +5 -0
- package/src/Layout.tsx +51 -0
- package/src/components/ThirdPartyScripts/GoogleTagManager.tsx +61 -0
- package/src/components/ThirdPartyScripts/ThirdPartyScripts.tsx +37 -0
- package/src/components/ThirdPartyScripts/index.ts +1 -0
- package/src/components/ThirdPartyScripts/vtex.tsx +23 -0
- package/src/components/cart/CartItem/CartItem.stories.mdx +134 -0
- package/src/components/cart/CartItem/CartItem.tsx +158 -0
- package/src/components/cart/CartItem/cart-item.module.scss +68 -0
- package/src/components/cart/CartItem/index.ts +1 -0
- package/src/components/cart/CartSidebar/CartSidebar.stories.mdx +119 -0
- package/src/components/cart/CartSidebar/CartSidebar.tsx +140 -0
- package/src/components/cart/CartSidebar/cart-sidebar.module.scss +69 -0
- package/src/components/cart/CartSidebar/index.ts +1 -0
- package/src/components/cart/CartToggle/CartToggle.tsx +20 -0
- package/src/components/cart/CartToggle/index.ts +1 -0
- package/src/components/cart/EmptyCart/EmptyCart.tsx +26 -0
- package/src/components/cart/EmptyCart/index.ts +1 -0
- package/src/components/cart/OrderSummary/OrderSummary.tsx +39 -0
- package/src/components/cart/OrderSummary/index.ts +1 -0
- package/src/components/cart/OrderSummary/order-summary.module.scss +22 -0
- package/src/components/cms/RenderPageSections.tsx +52 -0
- package/src/components/cms/SectionBoundary.tsx +34 -0
- package/src/components/common/Alert/Alert.tsx +53 -0
- package/src/components/common/Alert/index.ts +1 -0
- package/src/components/common/Footer/Footer.stories.mdx +158 -0
- package/src/components/common/Footer/Footer.tsx +160 -0
- package/src/components/common/Footer/FooterLinks.tsx +155 -0
- package/src/components/common/Footer/footer.module.scss +246 -0
- package/src/components/common/Footer/index.ts +2 -0
- package/src/components/common/Navbar/NavLinks.stories.mdx +122 -0
- package/src/components/common/Navbar/NavLinks.tsx +58 -0
- package/src/components/common/Navbar/Navbar.stories.mdx +179 -0
- package/src/components/common/Navbar/Navbar.tsx +97 -0
- package/src/components/common/Navbar/NavbarSlider.stories.mdx +108 -0
- package/src/components/common/Navbar/NavbarSlider.tsx +62 -0
- package/src/components/common/Navbar/index.ts +3 -0
- package/src/components/common/Navbar/navbar-slider.module.scss +60 -0
- package/src/components/common/Navbar/navbar.module.scss +204 -0
- package/src/components/common/Navbar/navlinks.module.scss +96 -0
- package/src/components/common/Toast/Toast.tsx +40 -0
- package/src/components/common/Toast/index.ts +1 -0
- package/src/components/product/OutOfStock/OutOfStock.stories.mdx +127 -0
- package/src/components/product/OutOfStock/OutOfStock.tsx +134 -0
- package/src/components/product/OutOfStock/index.ts +2 -0
- package/src/components/product/OutOfStock/out-of-stock.module.scss +55 -0
- package/src/components/product/ProductCard/ProductCard.stories.mdx +412 -0
- package/src/components/product/ProductCard/ProductCard.tsx +170 -0
- package/src/components/product/ProductCard/index.ts +2 -0
- package/src/components/product/ProductCard/product-card.module.scss +254 -0
- package/src/components/product/ProductGrid/ProductGrid.stories.mdx +97 -0
- package/src/components/product/ProductGrid/ProductGrid.tsx +37 -0
- package/src/components/product/ProductGrid/index.ts +1 -0
- package/src/components/product/ProductGrid/product-grid.module.scss +39 -0
- package/src/components/regionalization/Regionalization.stories.mdx +182 -0
- package/src/components/regionalization/RegionalizationBar/RegionalizationBar.stories.mdx +116 -0
- package/src/components/regionalization/RegionalizationBar/RegionalizationBar.tsx +40 -0
- package/src/components/regionalization/RegionalizationBar/index.ts +1 -0
- package/src/components/regionalization/RegionalizationBar/regionalization-bar.module.scss +56 -0
- package/src/components/regionalization/RegionalizationButton/RegionalizationButton.tsx +24 -0
- package/src/components/regionalization/RegionalizationButton/index.ts +1 -0
- package/src/components/regionalization/RegionalizationInput/RegionalizationInput.tsx +61 -0
- package/src/components/regionalization/RegionalizationInput/index.ts +1 -0
- package/src/components/regionalization/RegionalizationModal/RegionalizationModal.stories.mdx +161 -0
- package/src/components/regionalization/RegionalizationModal/RegionalizationModal.tsx +13 -0
- package/src/components/regionalization/RegionalizationModal/RegionalizationModalContent.tsx +48 -0
- package/src/components/regionalization/RegionalizationModal/index.ts +2 -0
- package/src/components/regionalization/RegionalizationModal/regionalization-modal-content.module.scss +79 -0
- package/src/components/search/Filter/Facets.stories.mdx +284 -0
- package/src/components/search/Filter/Facets.tsx +136 -0
- package/src/components/search/Filter/Filter.stories.mdx +209 -0
- package/src/components/search/Filter/Filter.tsx +91 -0
- package/src/components/search/Filter/FilterSlider.stories.mdx +226 -0
- package/src/components/search/Filter/FilterSlider.tsx +109 -0
- package/src/components/search/Filter/facets.module.scss +117 -0
- package/src/components/search/Filter/filter-slider.module.scss +63 -0
- package/src/components/search/Filter/index.ts +2 -0
- package/src/components/search/Filter/useFilter.ts +131 -0
- package/src/components/search/Search.stories.mdx +169 -0
- package/src/components/search/SearchDropdown/SearchDropdown.stories.mdx +62 -0
- package/src/components/search/SearchDropdown/SearchDropdown.tsx +44 -0
- package/src/components/search/SearchDropdown/index.ts +2 -0
- package/src/components/search/SearchHistory/SearchHistory.stories.mdx +59 -0
- package/src/components/search/SearchHistory/SearchHistory.tsx +51 -0
- package/src/components/search/SearchHistory/index.ts +1 -0
- package/src/components/search/SearchInput/SearchInput.stories.mdx +205 -0
- package/src/components/search/SearchInput/SearchInput.tsx +128 -0
- package/src/components/search/SearchInput/index.ts +2 -0
- package/src/components/search/SearchInput/search-input.module.scss +153 -0
- package/src/components/search/SearchProductCard/SearchProductCard.stories.mdx +96 -0
- package/src/components/search/SearchProductCard/SearchProductCard.tsx +103 -0
- package/src/components/search/SearchProductCard/index.ts +1 -0
- package/src/components/search/SearchProductCard/search-product-card.module.scss +54 -0
- package/src/components/search/SearchSharedTokenTable.mdx +98 -0
- package/src/components/search/SearchSuggestions/SearchSuggestions.stories.mdx +58 -0
- package/src/components/search/SearchSuggestions/SearchSuggestions.tsx +136 -0
- package/src/components/search/SearchSuggestions/index.ts +2 -0
- package/src/components/search/SearchTop/SearchTop.stories.mdx +58 -0
- package/src/components/search/SearchTop/SearchTop.tsx +78 -0
- package/src/components/search/SearchTop/index.ts +2 -0
- package/src/components/search/Sort/Sort.tsx +42 -0
- package/src/components/search/Sort/index.ts +1 -0
- package/src/components/search/search.module.scss +101 -0
- package/src/components/search/searchMock.ts +48 -0
- package/src/components/sections/BannerNewsletter/BannerNewsletter.tsx +28 -0
- package/src/components/sections/BannerNewsletter/banner-newsletter.module.scss +23 -0
- package/src/components/sections/BannerText/BannerText.stories.mdx +270 -0
- package/src/components/sections/BannerText/BannerText.tsx +87 -0
- package/src/components/sections/BannerText/banner-text.module.scss +127 -0
- package/src/components/sections/BannerText/index.ts +2 -0
- package/src/components/sections/Breadcrumb/Breadcrumb.tsx +24 -0
- package/src/components/sections/Breadcrumb/index.ts +1 -0
- package/src/components/sections/Hero/Hero.stories.mdx +277 -0
- package/src/components/sections/Hero/Hero.tsx +109 -0
- package/src/components/sections/Hero/hero.module.scss +180 -0
- package/src/components/sections/Hero/index.ts +2 -0
- package/src/components/sections/Incentives/Incentives.stories.mdx +159 -0
- package/src/components/sections/Incentives/Incentives.tsx +69 -0
- package/src/components/sections/Incentives/IncentivesFooter.tsx +8 -0
- package/src/components/sections/Incentives/IncentivesHeader.tsx +23 -0
- package/src/components/sections/Incentives/incentives.module.scss +122 -0
- package/src/components/sections/Incentives/incentivesMock.ts +55 -0
- package/src/components/sections/Incentives/index.ts +2 -0
- package/src/components/sections/Newsletter/Newsletter.stories.mdx +139 -0
- package/src/components/sections/Newsletter/Newsletter.tsx +151 -0
- package/src/components/sections/Newsletter/index.ts +2 -0
- package/src/components/sections/Newsletter/newsletter.module.scss +135 -0
- package/src/components/sections/ProducDetailsContent/ProductDetailsContent.stories.mdx +66 -0
- package/src/components/sections/ProducDetailsContent/ProductDetailsContent.tsx +278 -0
- package/src/components/sections/ProducDetailsContent/index.ts +1 -0
- package/src/components/sections/ProducDetailsContent/product-details-content.module.scss +50 -0
- package/src/components/sections/ProductDetails/ProductDetails.tsx +316 -0
- package/src/components/sections/ProductDetails/index.ts +1 -0
- package/src/components/sections/ProductDetails/product-details.module.scss +194 -0
- package/src/components/sections/ProductGallery/EmptyGallery.tsx +38 -0
- package/src/components/sections/ProductGallery/ProductGallery.tsx +186 -0
- package/src/components/sections/ProductGallery/ProductGalleryPage.tsx +70 -0
- package/src/components/sections/ProductGallery/index.ts +1 -0
- package/src/components/sections/ProductGallery/product-gallery.module.scss +184 -0
- package/src/components/sections/ProductGallery/useDelayedFacets.ts +18 -0
- package/src/components/sections/ProductGallery/useDelayedPagination.ts +16 -0
- package/src/components/sections/ProductGallery/useGalleryQuery.ts +58 -0
- package/src/components/sections/ProductGallery/usePageProducts.ts +48 -0
- package/src/components/sections/ProductShelf/ProductShelf.tsx +68 -0
- package/src/components/sections/ProductShelf/index.ts +1 -0
- package/src/components/sections/ProductShelf/product-shelf.module.scss +41 -0
- package/src/components/sections/ProductTiles/ProductTiles.tsx +83 -0
- package/src/components/sections/ProductTiles/index.ts +1 -0
- package/src/components/sections/ScrollToTopButton/ScrollToTopButton.tsx +45 -0
- package/src/components/sections/ScrollToTopButton/index.ts +1 -0
- package/src/components/sections/ScrollToTopButton/scroll-to-top-button.module.scss +12 -0
- package/src/components/sections/Section/Section.tsx +15 -0
- package/src/components/sections/Section/index.ts +1 -0
- package/src/components/sections/Section/section.scss +16 -0
- package/src/components/skeletons/FilterSkeleton/FilterSkeleton.stories.mdx +97 -0
- package/src/components/skeletons/FilterSkeleton/FilterSkeleton.tsx +34 -0
- package/src/components/skeletons/FilterSkeleton/filter-skeleton.module.scss +51 -0
- package/src/components/skeletons/FilterSkeleton/index.ts +1 -0
- package/src/components/skeletons/ProductCardSkeleton/ProductCardSkeleton.stories.mdx +176 -0
- package/src/components/skeletons/ProductCardSkeleton/ProductCardSkeleton.tsx +52 -0
- package/src/components/skeletons/ProductCardSkeleton/index.ts +1 -0
- package/src/components/skeletons/ProductCardSkeleton/product-card-skeleton.module.scss +97 -0
- package/src/components/skeletons/ProductGridSkeleton/ProductGridSkeleton.tsx +29 -0
- package/src/components/skeletons/ProductGridSkeleton/index.ts +1 -0
- package/src/components/skeletons/ProductShelfSkeleton/ProductShelfSkeleton.tsx +32 -0
- package/src/components/skeletons/ProductShelfSkeleton/index.ts +1 -0
- package/src/components/skeletons/ProductTilesSkeleton/ProductTileSkeleton/ProductTileSkeleton.tsx +57 -0
- package/src/components/skeletons/ProductTilesSkeleton/ProductTileSkeleton/index.ts +1 -0
- package/src/components/skeletons/ProductTilesSkeleton/ProductTileSkeleton/product-tile-skeleton.module.scss +218 -0
- package/src/components/skeletons/ProductTilesSkeleton/ProductTilesSkeleton.tsx +33 -0
- package/src/components/skeletons/ProductTilesSkeleton/index.ts +2 -0
- package/src/components/skeletons/Shimmer/Shimmer.tsx +11 -0
- package/src/components/skeletons/Shimmer/index.ts +1 -0
- package/src/components/skeletons/Shimmer/shimmer.module.scss +43 -0
- package/src/components/skeletons/Skeleton/Skeleton.tsx +49 -0
- package/src/components/skeletons/Skeleton/index.ts +1 -0
- package/src/components/skeletons/Skeleton/skeleton.module.scss +77 -0
- package/src/components/skeletons/Skeletons.stories.mdx +178 -0
- package/src/components/ui/Accordion/Accordion.stories.mdx +219 -0
- package/src/components/ui/Accordion/Accordion.tsx +39 -0
- package/src/components/ui/Accordion/AccordionItem.stories.mdx +116 -0
- package/src/components/ui/Accordion/AccordionItem.tsx +82 -0
- package/src/components/ui/Accordion/accordion.module.scss +65 -0
- package/src/components/ui/Accordion/index.ts +2 -0
- package/src/components/ui/Alert/Alert.stories.mdx +164 -0
- package/src/components/ui/Alert/Alert.tsx +78 -0
- package/src/components/ui/Alert/alert.module.scss +93 -0
- package/src/components/ui/Alert/index.ts +1 -0
- package/src/components/ui/Badge/Badge.stories.mdx +465 -0
- package/src/components/ui/Badge/Badge.tsx +76 -0
- package/src/components/ui/Badge/DiscountBadge.stories.mdx +191 -0
- package/src/components/ui/Badge/DiscountBadge.tsx +57 -0
- package/src/components/ui/Badge/badge.module.scss +252 -0
- package/src/components/ui/Badge/index.ts +4 -0
- package/src/components/ui/Breadcrumb/Breadcrumb.stories.mdx +197 -0
- package/src/components/ui/Breadcrumb/Breadcrumb.tsx +122 -0
- package/src/components/ui/Breadcrumb/breadcrumb.module.scss +144 -0
- package/src/components/ui/Breadcrumb/index.ts +2 -0
- package/src/components/ui/Button/Button.stories.mdx +685 -0
- package/src/components/ui/Button/Button.tsx +85 -0
- package/src/components/ui/Button/ButtonBuy/ButtonBuy.tsx +24 -0
- package/src/components/ui/Button/ButtonBuy/index.ts +1 -0
- package/src/components/ui/Button/ButtonLink/ButtonLink.tsx +49 -0
- package/src/components/ui/Button/ButtonLink/ButtonSignIn/ButtonSignIn.tsx +22 -0
- package/src/components/ui/Button/ButtonLink/ButtonSignIn/ButtonSignInFallback/ButtonSignInFallback.tsx +18 -0
- package/src/components/ui/Button/ButtonLink/ButtonSignIn/ButtonSignInFallback/index.ts +1 -0
- package/src/components/ui/Button/ButtonLink/ButtonSignIn/index.ts +1 -0
- package/src/components/ui/Button/ButtonLink/index.ts +1 -0
- package/src/components/ui/Button/button.module.scss +392 -0
- package/src/components/ui/Button/index.ts +6 -0
- package/src/components/ui/Checkbox/Checkbox.stories.mdx +268 -0
- package/src/components/ui/Checkbox/Checkbox.tsx +20 -0
- package/src/components/ui/Checkbox/checkbox.module.scss +157 -0
- package/src/components/ui/Checkbox/index.ts +2 -0
- package/src/components/ui/Dropdown/Dropdown.stories.mdx +232 -0
- package/src/components/ui/Dropdown/Dropdown.tsx +12 -0
- package/src/components/ui/Dropdown/DropdownButton.tsx +20 -0
- package/src/components/ui/Dropdown/DropdownItem.stories.mdx +139 -0
- package/src/components/ui/Dropdown/DropdownItem.tsx +26 -0
- package/src/components/ui/Dropdown/DropdownMenu.stories.mdx +115 -0
- package/src/components/ui/Dropdown/DropdownMenu.tsx +34 -0
- package/src/components/ui/Dropdown/dropdown.module.scss +101 -0
- package/src/components/ui/Dropdown/index.ts +4 -0
- package/src/components/ui/EmptyState/EmptyState.stories.mdx +146 -0
- package/src/components/ui/EmptyState/EmptyState.tsx +26 -0
- package/src/components/ui/EmptyState/empty-state.module.scss +63 -0
- package/src/components/ui/EmptyState/index.ts +1 -0
- package/src/components/ui/Gift/Gift.stories.mdx +99 -0
- package/src/components/ui/Gift/Gift.tsx +76 -0
- package/src/components/ui/Gift/gift.module.scss +94 -0
- package/src/components/ui/Gift/index.ts +2 -0
- package/src/components/ui/Icon/Icon.tsx +35 -0
- package/src/components/ui/Icon/index.ts +1 -0
- package/src/components/ui/Image/Image.tsx +59 -0
- package/src/components/ui/Image/index.ts +1 -0
- package/src/components/ui/Image/thumborUrlBuilder.ts +101 -0
- package/src/components/ui/Image/useImage.ts +46 -0
- package/src/components/ui/ImageGallery/ImageGallery.stories.mdx +173 -0
- package/src/components/ui/ImageGallery/ImageGallery.tsx +51 -0
- package/src/components/ui/ImageGallery/ImageGallerySelector.tsx +116 -0
- package/src/components/ui/ImageGallery/ImageZoom.tsx +12 -0
- package/src/components/ui/ImageGallery/image-gallery-selector.module.scss +131 -0
- package/src/components/ui/ImageGallery/image-gallery.module.scss +56 -0
- package/src/components/ui/ImageGallery/index.ts +4 -0
- package/src/components/ui/InputText/InputText.stories.mdx +311 -0
- package/src/components/ui/InputText/InputText.tsx +128 -0
- package/src/components/ui/InputText/index.ts +2 -0
- package/src/components/ui/InputText/input-text.module.scss +168 -0
- package/src/components/ui/Link/Link.stories.mdx +272 -0
- package/src/components/ui/Link/Link.tsx +68 -0
- package/src/components/ui/Link/index.ts +2 -0
- package/src/components/ui/Link/link.module.scss +98 -0
- package/src/components/ui/Logo/Logo.tsx +14 -0
- package/src/components/ui/Logo/index.ts +1 -0
- package/src/components/ui/Logo/logo.module.scss +12 -0
- package/src/components/ui/Modal/Modal.stories.mdx +142 -0
- package/src/components/ui/Modal/Modal.tsx +43 -0
- package/src/components/ui/Modal/index.ts +1 -0
- package/src/components/ui/Modal/modal.module.scss +46 -0
- package/src/components/ui/Price/Price.stories.mdx +194 -0
- package/src/components/ui/Price/Price.tsx +32 -0
- package/src/components/ui/Price/index.ts +1 -0
- package/src/components/ui/Price/price.module.scss +27 -0
- package/src/components/ui/PriceRange/PriceRange.stories.mdx +192 -0
- package/src/components/ui/PriceRange/PriceRange.tsx +138 -0
- package/src/components/ui/PriceRange/index.ts +1 -0
- package/src/components/ui/PriceRange/price-range.module.scss +176 -0
- package/src/components/ui/ProductTitle/ProductTitle.stories.mdx +107 -0
- package/src/components/ui/ProductTitle/ProductTitle.tsx +11 -0
- package/src/components/ui/ProductTitle/index.ts +1 -0
- package/src/components/ui/ProductTitle/product-title.module.scss +48 -0
- package/src/components/ui/QuantitySelector/QuantitySelector.stories.mdx +246 -0
- package/src/components/ui/QuantitySelector/QuantitySelector.tsx +103 -0
- package/src/components/ui/QuantitySelector/index.ts +1 -0
- package/src/components/ui/QuantitySelector/quantity-selector.module.scss +160 -0
- package/src/components/ui/Radio/Radio.stories.mdx +237 -0
- package/src/components/ui/Radio/Radio.tsx +36 -0
- package/src/components/ui/Radio/index.ts +2 -0
- package/src/components/ui/Radio/radio.module.scss +122 -0
- package/src/components/ui/SROnly/SROnly.tsx +20 -0
- package/src/components/ui/SROnly/index.ts +1 -0
- package/src/components/ui/SROnly/sr-only.module.scss +15 -0
- package/src/components/ui/Select/Select.stories.mdx +168 -0
- package/src/components/ui/Select/Select.tsx +70 -0
- package/src/components/ui/Select/index.ts +2 -0
- package/src/components/ui/Select/select.module.scss +85 -0
- package/src/components/ui/ShippingSimulation/ShippingSimulation.stories.mdx +140 -0
- package/src/components/ui/ShippingSimulation/ShippingSimulation.tsx +109 -0
- package/src/components/ui/ShippingSimulation/index.ts +1 -0
- package/src/components/ui/ShippingSimulation/shipping-simulation.module.scss +96 -0
- package/src/components/ui/ShippingSimulation/useShippingSimulation.ts +225 -0
- package/src/components/ui/SkuSelector/Selectors.stories.mdx +82 -0
- package/src/components/ui/SkuSelector/Selectors.tsx +87 -0
- package/src/components/ui/SkuSelector/SkuSelector.stories.mdx +345 -0
- package/src/components/ui/SkuSelector/SkuSelector.tsx +46 -0
- package/src/components/ui/SkuSelector/index.ts +3 -0
- package/src/components/ui/SkuSelector/sku-selector.module.scss +172 -0
- package/src/components/ui/SkuSelector/skuVariants.ts +59 -0
- package/src/components/ui/SlideOver/SlideOver.stories.mdx +285 -0
- package/src/components/ui/SlideOver/SlideOver.tsx +58 -0
- package/src/components/ui/SlideOver/index.ts +1 -0
- package/src/components/ui/SlideOver/overlay.scss +14 -0
- package/src/components/ui/SlideOver/slide-over.module.scss +63 -0
- package/src/components/ui/Tiles/Tiles.stories.mdx +153 -0
- package/src/components/ui/Tiles/Tiles.tsx +14 -0
- package/src/components/ui/Tiles/index.ts +5 -0
- package/src/components/ui/Tiles/tiles.module.scss +60 -0
- package/src/components/ui/Toast/Toast.stories.mdx +158 -0
- package/src/components/ui/Toast/Toast.tsx +56 -0
- package/src/components/ui/Toast/index.ts +1 -0
- package/src/components/ui/Toast/toast.module.scss +112 -0
- package/src/components/ui/Toggle/Toggle.stories.mdx +604 -0
- package/src/components/ui/Toggle/Toggle.tsx +75 -0
- package/src/components/ui/Toggle/index.ts +2 -0
- package/src/components/ui/Toggle/toggle.module.scss +200 -0
- package/src/constants.ts +2 -0
- package/src/fonts/WebFonts.tsx +15 -0
- package/src/images/icon.png +0 -0
- package/src/pages/404.tsx +27 -0
- package/src/pages/500.tsx +31 -0
- package/src/pages/[...slug].tsx +186 -0
- package/src/pages/[slug]/p.tsx +209 -0
- package/src/pages/_app.tsx +38 -0
- package/src/pages/_document.tsx +22 -0
- package/src/pages/account.tsx +20 -0
- package/src/pages/api/graphql.ts +72 -0
- package/src/pages/api/preview.ts +61 -0
- package/src/pages/checkout.tsx +20 -0
- package/src/pages/index.tsx +72 -0
- package/src/pages/login.tsx +20 -0
- package/src/pages/s.tsx +83 -0
- package/src/sdk/analytics/hooks/useViewItemListEvent.ts +51 -0
- package/src/sdk/analytics/index.tsx +30 -0
- package/src/sdk/analytics/platform/vtex/index.ts +11 -0
- package/src/sdk/analytics/platform/vtex/search.ts +102 -0
- package/src/sdk/analytics/types.ts +22 -0
- package/src/sdk/cart/index.ts +187 -0
- package/src/sdk/cart/useBuyButton.ts +62 -0
- package/src/sdk/cart/useCartToggleButton.ts +23 -0
- package/src/sdk/cart/useCheckoutButton.ts +22 -0
- package/src/sdk/cart/useRemoveButton.ts +56 -0
- package/src/sdk/error/ErrorBoundary/ErrorBoundary.tsx +67 -0
- package/src/sdk/error/ErrorBoundary/index.ts +1 -0
- package/src/sdk/graphql/prefetchQuery.ts +20 -0
- package/src/sdk/graphql/request.ts +25 -0
- package/src/sdk/graphql/useLazyQuery.ts +29 -0
- package/src/sdk/graphql/useQuery.ts +40 -0
- package/src/sdk/newsletter/useNewsletter.ts +31 -0
- package/src/sdk/product/useDiscountPercent.ts +10 -0
- package/src/sdk/product/useFormattedPrice.ts +27 -0
- package/src/sdk/product/useProduct.ts +46 -0
- package/src/sdk/product/useProductLink.ts +69 -0
- package/src/sdk/product/useProductsQuery.ts +107 -0
- package/src/sdk/search/Sentinel.tsx +78 -0
- package/src/sdk/search/state.ts +11 -0
- package/src/sdk/search/useSearchHistory.ts +40 -0
- package/src/sdk/search/useSearchInput.tsx +43 -0
- package/src/sdk/search/useSuggestions.ts +49 -0
- package/src/sdk/search/useTopSearch.ts +49 -0
- package/src/sdk/session/index.ts +71 -0
- package/src/sdk/tests/mark.tsx +10 -0
- package/src/sdk/ui/Provider.tsx +151 -0
- package/src/sdk/ui/useFadeEffect.ts +21 -0
- package/src/sdk/ui/useOnClickOutside.ts +39 -0
- package/src/sdk/ui/useScrollDirection.ts +31 -0
- package/src/sdk/useStore.ts +24 -0
- package/src/server/cms.ts +66 -0
- package/src/server/index.ts +105 -0
- package/src/stories/brandless.stories.mdx +85 -0
- package/src/stories/changelog-template.stories.mdx +10 -0
- package/src/stories/colors.stories.mdx +306 -0
- package/src/stories/customizing.stories.mdx +113 -0
- package/src/stories/getting-started.stories.mdx +65 -0
- package/src/stories/grid-layout.stories.mdx +53 -0
- package/src/stories/icons.stories.mdx +237 -0
- package/src/stories/interactive-controls.stories.mdx +50 -0
- package/src/stories/midnight.stories.mdx +56 -0
- package/src/stories/refinements.stories.mdx +96 -0
- package/src/stories/soft-blue.stories.mdx +56 -0
- package/src/stories/spacing.stories.mdx +38 -0
- package/src/stories/typography.stories.mdx +224 -0
- package/src/styles/global/components.scss +5 -0
- package/src/styles/global/layout.scss +80 -0
- package/src/styles/global/resets.scss +48 -0
- package/src/styles/global/storybook-components.scss +5 -0
- package/src/styles/global/tokens.scss +276 -0
- package/src/styles/global/typography.scss +66 -0
- package/src/styles/global/utilities.scss +69 -0
- package/src/styles/scaffold.scss +7 -0
- package/src/styles/themes/custom-theme.scss +36 -0
- package/src/styles/themes/midnight.scss +123 -0
- package/src/styles/themes/soft-blue.scss +79 -0
- package/src/styles/vendors/include-media.scss +4 -0
- package/src/styles/vendors/include-media_overwrite.scss +9 -0
- package/src/styles/vendors/modern-normalize.css +270 -0
- package/src/typings/global.d.ts +6 -0
- package/src/typings/module.css.d.ts +7 -0
- package/store.config.js +69 -0
- package/stylelint.config.js +82 -0
- package/tsconfig.json +25 -0
- package/vtex.env +14 -0
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { Description, Meta } from '@storybook/addon-docs'
|
|
2
|
+
|
|
3
|
+
import { SectionList, SectionItem } from 'src/../.storybook/components'
|
|
4
|
+
|
|
5
|
+
<Meta
|
|
6
|
+
title="Theming/Customizing"
|
|
7
|
+
parameters={{ options: { showToolbar: false } }}
|
|
8
|
+
/>
|
|
9
|
+
|
|
10
|
+
<header className="sbdocs-hero">
|
|
11
|
+
|
|
12
|
+
# Customizing
|
|
13
|
+
|
|
14
|
+
**Design tokens** are parameters that affect all UI look 'n' feel and they are the **main configuration** file of a Theme. Component-specific tokens often inherit from global tokens but are named specifically to apply those tokens in component development.
|
|
15
|
+
|
|
16
|
+
</header>
|
|
17
|
+
|
|
18
|
+
## Global Tokens
|
|
19
|
+
|
|
20
|
+
FastStore uses a default theme called `Brandless`, which provides structural styles for your components and pages. Please read <a href="../?path=/docs/theming-brandless--page">Brandless's page</a> to further information about our themeable architecture.
|
|
21
|
+
|
|
22
|
+
Its presets are defined on `src/styles/global/tokens.scss` and it's separated in these main areas:
|
|
23
|
+
|
|
24
|
+
<SectionList grid="grid" classes="sbdocs-tokens-links">
|
|
25
|
+
<SectionItem
|
|
26
|
+
title="Colors"
|
|
27
|
+
actionPath="../?path=/docs/global-tokens-colors--page"
|
|
28
|
+
description={<>The store palette with all the tones needed.</>}
|
|
29
|
+
>
|
|
30
|
+
<FooterLinks />
|
|
31
|
+
</SectionItem>
|
|
32
|
+
<SectionItem
|
|
33
|
+
title="Typography"
|
|
34
|
+
actionPath="../?path=/docs/global-tokens-typography--page"
|
|
35
|
+
description={
|
|
36
|
+
<>
|
|
37
|
+
A standard scale and basic definitions for your text:{' '}
|
|
38
|
+
<code>font family</code>,<code>weight</code> and <code>sizes</code>.
|
|
39
|
+
</>
|
|
40
|
+
}
|
|
41
|
+
>
|
|
42
|
+
<IncentivesFooter />
|
|
43
|
+
</SectionItem>
|
|
44
|
+
<SectionItem
|
|
45
|
+
title="Spacing"
|
|
46
|
+
actionPath="../?path=/docs/global-tokens-spacing--page"
|
|
47
|
+
description={
|
|
48
|
+
<>
|
|
49
|
+
All tokens used for spacings on the store: <code>padding</code>,{' '}
|
|
50
|
+
<code>margins</code> and <code>sizes</code>. It's also used as base for
|
|
51
|
+
grid tokens.
|
|
52
|
+
</>
|
|
53
|
+
}
|
|
54
|
+
>
|
|
55
|
+
<FooterLinks />
|
|
56
|
+
</SectionItem>
|
|
57
|
+
<SectionItem
|
|
58
|
+
title="Grid & Layout"
|
|
59
|
+
actionPath="../?path=/docs/global-tokens-grid-layout--page"
|
|
60
|
+
description={
|
|
61
|
+
<>
|
|
62
|
+
<code>Padding</code>, <code>Container</code>, <code>Gaps</code> and{' '}
|
|
63
|
+
<code>Breakpoints</code> definitions.
|
|
64
|
+
</>
|
|
65
|
+
}
|
|
66
|
+
>
|
|
67
|
+
<IncentivesFooter />
|
|
68
|
+
</SectionItem>
|
|
69
|
+
<SectionItem
|
|
70
|
+
title="Interactive Controls"
|
|
71
|
+
actionPath="../?path=/docs/global-tokens-interactive-controls--page"
|
|
72
|
+
description={
|
|
73
|
+
<>
|
|
74
|
+
<code>Tap</code>, <code>States</code> and <code>Sizing</code>{' '}
|
|
75
|
+
definitions.
|
|
76
|
+
</>
|
|
77
|
+
}
|
|
78
|
+
>
|
|
79
|
+
<FooterLinks />
|
|
80
|
+
</SectionItem>
|
|
81
|
+
<SectionItem
|
|
82
|
+
title="Refinements"
|
|
83
|
+
actionPath="../?path=/docs/global-tokens-refinements--page"
|
|
84
|
+
description={
|
|
85
|
+
<>
|
|
86
|
+
<code>Transition</code>, <code>Borders</code> and <code>Shadow</code>{' '}
|
|
87
|
+
definitions.
|
|
88
|
+
</>
|
|
89
|
+
}
|
|
90
|
+
>
|
|
91
|
+
<IncentivesFooter />
|
|
92
|
+
</SectionItem>
|
|
93
|
+
</SectionList>
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## Build your new theme
|
|
98
|
+
|
|
99
|
+
1. Create a new `.scss` file on `src/styles/themes` and overwrite the tokens you want: e.g. `my-theme.scss`
|
|
100
|
+
2. Import `my-theme.scss` file on `src/pages/_app.tsx`
|
|
101
|
+
|
|
102
|
+
```jsx
|
|
103
|
+
import '../styles/themes/my-theme.scss'
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
3. Go to `store.config.js` and change the `theme` to your file's name:
|
|
107
|
+
|
|
108
|
+
```js
|
|
109
|
+
// Theming
|
|
110
|
+
theme: 'my-theme',
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
If you want, you can work on `custom-theme.scss` file that's ready to use. Also, we provide two themes as examples: [soft-blue](?path=/docs/theming-themes-soft-blue--page) and [midnight](?path=/docs/theming-themes-midnight--page).
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { Description, Meta } from '@storybook/addon-docs'
|
|
2
|
+
import { Callout } from 'src/../.storybook/components'
|
|
3
|
+
|
|
4
|
+
import ButtonLink from '../components/ui/Button/ButtonLink'
|
|
5
|
+
import Icon from '../components/ui/Icon'
|
|
6
|
+
|
|
7
|
+
<Meta
|
|
8
|
+
title="Getting Started"
|
|
9
|
+
parameters={{ options: { showToolbar: false } }}
|
|
10
|
+
/>
|
|
11
|
+
|
|
12
|
+
<header className="sbdocs-hero">
|
|
13
|
+
|
|
14
|
+
# Getting Started
|
|
15
|
+
|
|
16
|
+
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
|
+
<ButtonLink
|
|
19
|
+
variant="tertiary"
|
|
20
|
+
href="https://nextjs.vtex.app/"
|
|
21
|
+
data-fs-button-size="small"
|
|
22
|
+
>
|
|
23
|
+
NextJS Store Starter
|
|
24
|
+
<Icon name="ArrowRight" width="18" height="18" weight="bold" />
|
|
25
|
+
</ButtonLink>
|
|
26
|
+
|
|
27
|
+
<ButtonLink
|
|
28
|
+
variant="tertiary"
|
|
29
|
+
href="https://www.faststore.dev/reference/ui/faststore-ui"
|
|
30
|
+
data-fs-button-size="small"
|
|
31
|
+
>
|
|
32
|
+
FastStore UI library
|
|
33
|
+
<Icon name="ArrowRight" width="18" height="18" weight="bold" />
|
|
34
|
+
</ButtonLink>
|
|
35
|
+
|
|
36
|
+
</header>
|
|
37
|
+
|
|
38
|
+
<Callout>
|
|
39
|
+
When trying to switch between
|
|
40
|
+
<code>Sandbox</code> and <code>Docs</code> tabs, the <code>Sandbox</code> tab might
|
|
41
|
+
not be working properly, try to refresh the page after switching tabs. It seems
|
|
42
|
+
to be a <a href="https://github.com/storybookjs/storybook/issues/17625">
|
|
43
|
+
bug in the Storybook
|
|
44
|
+
</a>.
|
|
45
|
+
</Callout>
|
|
46
|
+
|
|
47
|
+
## Sections
|
|
48
|
+
|
|
49
|
+
This product is designed and built following the **Atomic Design pattern**. Atomic Design breaks user interfaces hierarchically into smaller and simpler components. In this Storybook, we organized our components in the following groups:
|
|
50
|
+
|
|
51
|
+
- Atoms
|
|
52
|
+
- Molecules
|
|
53
|
+
- Organisms
|
|
54
|
+
- Features: group of components related to a specific feature, such as `Regionalization`.
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Subsections
|
|
59
|
+
|
|
60
|
+
Also, on the component's pages we use the following terms:
|
|
61
|
+
|
|
62
|
+
- `Compound Components`: list components that compound it.
|
|
63
|
+
- `Related Components`: list components that are related.
|
|
64
|
+
- `Use Cases/Examples`: list examples of where the components are applied.
|
|
65
|
+
- `Components`: list components that are part of a Feature.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Meta, ColorPalette, ColorItem } from '@storybook/addon-docs'
|
|
2
|
+
import '/.storybook/storybook.css'
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
TokenTable,
|
|
6
|
+
TokenRow,
|
|
7
|
+
TokenDivider,
|
|
8
|
+
} from 'src/../.storybook/components'
|
|
9
|
+
|
|
10
|
+
<Meta
|
|
11
|
+
title="Global Tokens/Grid & Layout"
|
|
12
|
+
parameters={{ options: { showToolbar: false } }}
|
|
13
|
+
/>
|
|
14
|
+
|
|
15
|
+
<header>
|
|
16
|
+
|
|
17
|
+
# Grid & Layout
|
|
18
|
+
|
|
19
|
+
`Padding`, `Container`, `Gaps` and `Breakpoints` definitions.
|
|
20
|
+
|
|
21
|
+
</header>
|
|
22
|
+
|
|
23
|
+
## Padding
|
|
24
|
+
|
|
25
|
+
<TokenTable title="Global Token" description="Value">
|
|
26
|
+
<TokenRow token="--fs-grid-padding" value="var(--fs-spacing-3)" />
|
|
27
|
+
</TokenTable>
|
|
28
|
+
|
|
29
|
+
## Container
|
|
30
|
+
|
|
31
|
+
<TokenTable title="Global Token" description="Value">
|
|
32
|
+
<TokenRow token="--fs-grid-max-width" value="var(--fs-spacing-3)" />
|
|
33
|
+
</TokenTable>
|
|
34
|
+
|
|
35
|
+
## Gaps
|
|
36
|
+
|
|
37
|
+
<TokenTable title="Global Token" description="Value">
|
|
38
|
+
<TokenRow token="--fs-grid-gap-0" value="var(--fs-spacing-1)" />
|
|
39
|
+
<TokenRow token="--fs-grid-gap-1" value="var(--fs-spacing-2)" />
|
|
40
|
+
<TokenRow token="--fs-grid-gap-2" value="var(--fs-spacing-3)" />
|
|
41
|
+
<TokenRow token="--fs-grid-gap-3" value="var(--fs-spacing-4)" />
|
|
42
|
+
<TokenRow token="--fs-grid-gap-4" value="var(--fs-spacing-5)" />
|
|
43
|
+
</TokenTable>
|
|
44
|
+
|
|
45
|
+
## Breakpoints
|
|
46
|
+
|
|
47
|
+
<TokenTable title="Global Token" description="Value">
|
|
48
|
+
<TokenRow token="--fs-grid-breakpoint-phone" value="320px" />
|
|
49
|
+
<TokenRow token="--fs-grid-breakpoint-phonemid" value="375px" />
|
|
50
|
+
<TokenRow token="--fs-grid-breakpoint-tablet" value="768px" />
|
|
51
|
+
<TokenRow token="--fs-grid-breakpoint-notebook" value="1280px" />
|
|
52
|
+
<TokenRow token="--fs-grid-breakpoint-desktop" value="1440px" />
|
|
53
|
+
</TokenTable>
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Canvas,
|
|
3
|
+
Meta,
|
|
4
|
+
Title,
|
|
5
|
+
IconGallery,
|
|
6
|
+
IconItem,
|
|
7
|
+
} from '@storybook/addon-docs'
|
|
8
|
+
|
|
9
|
+
import Icon from '../components/ui/Icon'
|
|
10
|
+
import { Callout } from 'src/../.storybook/components'
|
|
11
|
+
|
|
12
|
+
<Meta title="Media/Icons" parameters={{ options: { showToolbar: false } }} />
|
|
13
|
+
|
|
14
|
+
<header>
|
|
15
|
+
|
|
16
|
+
# Icons
|
|
17
|
+
|
|
18
|
+
</header>
|
|
19
|
+
|
|
20
|
+
This project uses SVGs from <a ahref="https://phosphoricons.com/">Phosphor icons</a>.
|
|
21
|
+
|
|
22
|
+
<Callout>
|
|
23
|
+
Icons help build web pages by illustrating concepts and improving website
|
|
24
|
+
navigation. However, using icons can decrease the page's performance. One
|
|
25
|
+
option to avoid the decrease of the page's performance is to use SVGs from a
|
|
26
|
+
single SVG file, located in <code>/static/icons.svg</code>, and load them with
|
|
27
|
+
the <code>ui/Icon</code>.Please check the{' '}
|
|
28
|
+
<a href="https://github.com/vtex-sites/nextjs.store#managing-svg-icons">
|
|
29
|
+
Managing SVG Icons
|
|
30
|
+
</a>{' '}
|
|
31
|
+
section on our readme for further instructions.
|
|
32
|
+
</Callout>
|
|
33
|
+
|
|
34
|
+
| Weights |
|
|
35
|
+
| ------------------------------------ |
|
|
36
|
+
| thin, light, regular (default), bold |
|
|
37
|
+
|
|
38
|
+
| Sizes |
|
|
39
|
+
| ---------------------------------- |
|
|
40
|
+
| 16px, 18px, 20px, 32px, 48px, 56px |
|
|
41
|
+
|
|
42
|
+
<Canvas>
|
|
43
|
+
<Icon name="ShoppingCart" weight="bold" width="16" height="16" />
|
|
44
|
+
<Icon name="ShoppingCart" weight="bold" width="18" height="18" />
|
|
45
|
+
<Icon name="ShoppingCart" weight="bold" width="20" height="20" />
|
|
46
|
+
<Icon name="ShoppingCart" width="32" height="32" />
|
|
47
|
+
<Icon name="ShoppingCart" weight="light" width="48" height="48" />
|
|
48
|
+
<Icon name="ShoppingCart" weight="light" width="56" height="56" />
|
|
49
|
+
</Canvas>
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## UI Actions
|
|
54
|
+
|
|
55
|
+
<IconGallery>
|
|
56
|
+
<IconItem name="X">
|
|
57
|
+
<Icon name="X" />
|
|
58
|
+
</IconItem>
|
|
59
|
+
<IconItem name="Plus">
|
|
60
|
+
<Icon name="Plus" />
|
|
61
|
+
</IconItem>
|
|
62
|
+
<IconItem name="PlusCircle">
|
|
63
|
+
<Icon name="PlusCircle" />
|
|
64
|
+
</IconItem>
|
|
65
|
+
<IconItem name="Minus">
|
|
66
|
+
<Icon name="Minus" />
|
|
67
|
+
</IconItem>
|
|
68
|
+
<IconItem name="MinusCircle">
|
|
69
|
+
<Icon name="MinusCircle" />
|
|
70
|
+
</IconItem>
|
|
71
|
+
<IconItem name="XCircle">
|
|
72
|
+
<Icon name="XCircle" />
|
|
73
|
+
</IconItem>
|
|
74
|
+
<IconItem name="ArrowLeft">
|
|
75
|
+
<Icon name="ArrowLeft" />
|
|
76
|
+
</IconItem>
|
|
77
|
+
<IconItem name="ArrowRight">
|
|
78
|
+
<Icon name="ArrowRight" />
|
|
79
|
+
</IconItem>
|
|
80
|
+
<IconItem name="ArrowUpRight">
|
|
81
|
+
<Icon name="ArrowUpRight" />
|
|
82
|
+
</IconItem>
|
|
83
|
+
<IconItem name="ArrowSquareOut">
|
|
84
|
+
<Icon name="ArrowSquareOut" />
|
|
85
|
+
</IconItem>
|
|
86
|
+
<IconItem name="ArrowElbowDownRight">
|
|
87
|
+
<Icon name="ArrowElbowDownRight" />
|
|
88
|
+
</IconItem>
|
|
89
|
+
<IconItem name="CaretLeft">
|
|
90
|
+
<Icon name="CaretLeft" />
|
|
91
|
+
</IconItem>
|
|
92
|
+
<IconItem name="CaretRight">
|
|
93
|
+
<Icon name="CaretRight" />
|
|
94
|
+
</IconItem>
|
|
95
|
+
<IconItem name="CaretUp">
|
|
96
|
+
<Icon name="CaretUp" />
|
|
97
|
+
</IconItem>
|
|
98
|
+
<IconItem name="CaretDown">
|
|
99
|
+
<Icon name="CaretDown" />
|
|
100
|
+
</IconItem>
|
|
101
|
+
<IconItem name="Ellipsis">
|
|
102
|
+
<Icon name="Ellipsis" />
|
|
103
|
+
</IconItem>
|
|
104
|
+
<IconItem name="Checked">
|
|
105
|
+
<Icon name="Checked" />
|
|
106
|
+
</IconItem>
|
|
107
|
+
<IconItem name="MagnifyingGlass">
|
|
108
|
+
<Icon name="MagnifyingGlass" />
|
|
109
|
+
</IconItem>
|
|
110
|
+
<IconItem name="FadersHorizontal">
|
|
111
|
+
<Icon name="FadersHorizontal" />
|
|
112
|
+
</IconItem>
|
|
113
|
+
<IconItem name="List">
|
|
114
|
+
<Icon name="List" />
|
|
115
|
+
</IconItem>
|
|
116
|
+
</IconGallery>
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## Common Actions
|
|
121
|
+
|
|
122
|
+
<IconGallery>
|
|
123
|
+
<IconItem name="User">
|
|
124
|
+
<Icon name="User" />
|
|
125
|
+
</IconItem>
|
|
126
|
+
<IconItem name="Calendar">
|
|
127
|
+
<Icon name="Calendar" />
|
|
128
|
+
</IconItem>
|
|
129
|
+
<IconItem name="ShoppingCart">
|
|
130
|
+
<Icon name="ShoppingCart" />
|
|
131
|
+
</IconItem>
|
|
132
|
+
<IconItem name="MapPin">
|
|
133
|
+
<Icon name="MapPin" />
|
|
134
|
+
</IconItem>
|
|
135
|
+
<IconItem name="Clock">
|
|
136
|
+
<Icon name="Clock" />
|
|
137
|
+
</IconItem>
|
|
138
|
+
<IconItem name="House">
|
|
139
|
+
<Icon name="House" />
|
|
140
|
+
</IconItem>
|
|
141
|
+
</IconGallery>
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## Informative
|
|
146
|
+
|
|
147
|
+
<IconGallery>
|
|
148
|
+
<IconItem name="ShieldCheck">
|
|
149
|
+
<Icon name="ShieldCheck" />
|
|
150
|
+
</IconItem>
|
|
151
|
+
<IconItem name="Gift">
|
|
152
|
+
<Icon name="Gift" />
|
|
153
|
+
</IconItem>
|
|
154
|
+
<IconItem name="Storefront">
|
|
155
|
+
<Icon name="Storefront" />
|
|
156
|
+
</IconItem>
|
|
157
|
+
<IconItem name="Medal">
|
|
158
|
+
<Icon name="Medal" />
|
|
159
|
+
</IconItem>
|
|
160
|
+
<IconItem name="CircleWavyCheck">
|
|
161
|
+
<Icon name="CircleWavyCheck" />
|
|
162
|
+
</IconItem>
|
|
163
|
+
<IconItem name="CircleWavyWarning">
|
|
164
|
+
<Icon name="CircleWavyWarning" />
|
|
165
|
+
</IconItem>
|
|
166
|
+
<IconItem name="Headphones">
|
|
167
|
+
<Icon name="Headphones" />
|
|
168
|
+
</IconItem>
|
|
169
|
+
<IconItem name="Truck">
|
|
170
|
+
<Icon name="Truck" />
|
|
171
|
+
</IconItem>
|
|
172
|
+
<IconItem name="Bell">
|
|
173
|
+
<Icon name="Bell" />
|
|
174
|
+
</IconItem>
|
|
175
|
+
<IconItem name="BellRinging">
|
|
176
|
+
<Icon name="BellRinging" />
|
|
177
|
+
</IconItem>
|
|
178
|
+
<IconItem name="Clock">
|
|
179
|
+
<Icon name="Clock" />
|
|
180
|
+
</IconItem>
|
|
181
|
+
<IconItem name="RocketLaunch">
|
|
182
|
+
<Icon name="RocketLaunch" />
|
|
183
|
+
</IconItem>
|
|
184
|
+
<IconItem name="House">
|
|
185
|
+
<Icon name="House" />
|
|
186
|
+
</IconItem>
|
|
187
|
+
</IconGallery>
|
|
188
|
+
|
|
189
|
+
---
|
|
190
|
+
|
|
191
|
+
## Payment
|
|
192
|
+
|
|
193
|
+
<IconGallery>
|
|
194
|
+
<IconItem name="GooglePay">
|
|
195
|
+
<Icon name="GooglePay" />
|
|
196
|
+
</IconItem>
|
|
197
|
+
<IconItem name="ApplePay">
|
|
198
|
+
<Icon name="ApplePay" />
|
|
199
|
+
</IconItem>
|
|
200
|
+
<IconItem name="Diners">
|
|
201
|
+
<Icon name="Diners" />
|
|
202
|
+
</IconItem>
|
|
203
|
+
<IconItem name="EloCard">
|
|
204
|
+
<Icon name="EloCard" />
|
|
205
|
+
</IconItem>
|
|
206
|
+
<IconItem name="Mastercard">
|
|
207
|
+
<Icon name="Mastercard" />
|
|
208
|
+
</IconItem>
|
|
209
|
+
<IconItem name="PayPal">
|
|
210
|
+
<Icon name="PayPal" />
|
|
211
|
+
</IconItem>
|
|
212
|
+
<IconItem name="Stripe">
|
|
213
|
+
<Icon name="Stripe" />
|
|
214
|
+
</IconItem>
|
|
215
|
+
<IconItem name="Visa">
|
|
216
|
+
<Icon name="Visa" />
|
|
217
|
+
</IconItem>
|
|
218
|
+
</IconGallery>
|
|
219
|
+
|
|
220
|
+
---
|
|
221
|
+
|
|
222
|
+
## Social
|
|
223
|
+
|
|
224
|
+
<IconGallery>
|
|
225
|
+
<IconItem name="Instagram">
|
|
226
|
+
<Icon name="Instagram" />
|
|
227
|
+
</IconItem>
|
|
228
|
+
<IconItem name="Pinterest">
|
|
229
|
+
<Icon name="Pinterest" />
|
|
230
|
+
</IconItem>
|
|
231
|
+
<IconItem name="Twitter">
|
|
232
|
+
<Icon name="Twitter" />
|
|
233
|
+
</IconItem>
|
|
234
|
+
<IconItem name="Facebook">
|
|
235
|
+
<Icon name="Facebook" />
|
|
236
|
+
</IconItem>
|
|
237
|
+
</IconGallery>
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Meta, ColorPalette, ColorItem } from '@storybook/addon-docs'
|
|
2
|
+
import '/.storybook/storybook.css'
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
TokenTable,
|
|
6
|
+
TokenRow,
|
|
7
|
+
TokenDivider,
|
|
8
|
+
} from 'src/../.storybook/components'
|
|
9
|
+
|
|
10
|
+
<Meta
|
|
11
|
+
title="Global Tokens/Interactive Controls"
|
|
12
|
+
parameters={{ options: { showToolbar: false } }}
|
|
13
|
+
/>
|
|
14
|
+
|
|
15
|
+
<header>
|
|
16
|
+
|
|
17
|
+
# Interactive Controls
|
|
18
|
+
|
|
19
|
+
`Tap`, `States` and `Sizing` definitions.
|
|
20
|
+
|
|
21
|
+
</header>
|
|
22
|
+
|
|
23
|
+
## Tap
|
|
24
|
+
|
|
25
|
+
<TokenTable title="Global Token" description="Value">
|
|
26
|
+
<TokenRow token="--fs-control-tap-size" value="var(--fs-spacing-7)" />
|
|
27
|
+
<TokenRow
|
|
28
|
+
token="--fs-control-tap-size-smallest"
|
|
29
|
+
value="calc(var(--fs-control-tap-size) / 2)"
|
|
30
|
+
/>
|
|
31
|
+
<TokenRow
|
|
32
|
+
token="--fs-control-min-height"
|
|
33
|
+
value="var(--fs-control-tap-size)"
|
|
34
|
+
/>
|
|
35
|
+
</TokenTable>
|
|
36
|
+
|
|
37
|
+
## States
|
|
38
|
+
|
|
39
|
+
<TokenTable title="Global Token" description="Value">
|
|
40
|
+
<TokenRow
|
|
41
|
+
token="--fs-control-bkg"
|
|
42
|
+
value="var(--fs-color-neutral-0)"
|
|
43
|
+
isColor
|
|
44
|
+
/>
|
|
45
|
+
<TokenRow
|
|
46
|
+
token="--fs-control-bkg-disabled"
|
|
47
|
+
value="var(--fs-color-disabled-bkg)"
|
|
48
|
+
isColor
|
|
49
|
+
/>
|
|
50
|
+
</TokenTable>
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Description, Meta } from '@storybook/addon-docs'
|
|
2
|
+
|
|
3
|
+
import { SectionList, SectionItem } from 'src/../.storybook/components'
|
|
4
|
+
|
|
5
|
+
<Meta
|
|
6
|
+
title="Theming/Themes/Midnight"
|
|
7
|
+
parameters={{ options: { showToolbar: false } }}
|
|
8
|
+
/>
|
|
9
|
+
|
|
10
|
+
<header>
|
|
11
|
+
|
|
12
|
+
# Midnight
|
|
13
|
+
|
|
14
|
+
A darkmode theme created for testing purposes.
|
|
15
|
+
|
|
16
|
+
</header>
|
|
17
|
+
|
|
18
|
+
<section className="sbdocs-section-theme">
|
|
19
|
+
<div className="sbdocs-section-theme-img">
|
|
20
|
+
<img
|
|
21
|
+
src="https://vtexhelp.vtexassets.com/assets/docs/src/midnight___2bb274e36a39ff9c2cfa3dcc740cbfab.png"
|
|
22
|
+
/>
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
<article>
|
|
26
|
+
|
|
27
|
+
## Use `midnight` as your theme
|
|
28
|
+
|
|
29
|
+
1. Import `midnight.scss` file on `src/pages/_app.tsx`
|
|
30
|
+
|
|
31
|
+
```jsx
|
|
32
|
+
import '../styles/themes/midnight.scss'
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
2. Go to `store.config.js` and change the `theme` to your file's name:
|
|
36
|
+
|
|
37
|
+
```js
|
|
38
|
+
// Theming
|
|
39
|
+
theme: 'midnight',
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
3. Add the [Raleway](https://fonts.google.com/specimen/Raleway?query=raleway) font on `src/fonts/WebFonts.tsx`
|
|
43
|
+
|
|
44
|
+
```tsx
|
|
45
|
+
function WebFonts() {
|
|
46
|
+
return (
|
|
47
|
+
<link
|
|
48
|
+
rel="stylesheet"
|
|
49
|
+
href="https://fonts.googleapis.com/css2?family=Raleway:wght@300;400;700;900&display=swap"
|
|
50
|
+
/>
|
|
51
|
+
)
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
</article>
|
|
56
|
+
</section>
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { Meta, ColorPalette, ColorItem } from '@storybook/addon-docs'
|
|
2
|
+
import '/.storybook/storybook.css'
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
TokenTable,
|
|
6
|
+
TokenRow,
|
|
7
|
+
TokenDivider,
|
|
8
|
+
} from 'src/../.storybook/components'
|
|
9
|
+
|
|
10
|
+
<Meta
|
|
11
|
+
title="Global Tokens/Refinements"
|
|
12
|
+
parameters={{ options: { showToolbar: false } }}
|
|
13
|
+
/>
|
|
14
|
+
|
|
15
|
+
<header>
|
|
16
|
+
|
|
17
|
+
# Refinements
|
|
18
|
+
|
|
19
|
+
`Transition`, `Borders` and `Shadow` definitions.
|
|
20
|
+
|
|
21
|
+
</header>
|
|
22
|
+
|
|
23
|
+
## Transition
|
|
24
|
+
|
|
25
|
+
<TokenTable title="Global Token" description="Value">
|
|
26
|
+
<TokenRow token="--fs-transition-timing" value=".2s" />
|
|
27
|
+
<TokenRow token="--fs-transition-property" value="all" />
|
|
28
|
+
<TokenRow token="--fs-transition-function" value="ease-in-out" />
|
|
29
|
+
</TokenTable>
|
|
30
|
+
|
|
31
|
+
## Borders
|
|
32
|
+
|
|
33
|
+
<TokenTable title="Global Token" description="Value">
|
|
34
|
+
<TokenRow token="--fs-border-radius-small" value="1px" />
|
|
35
|
+
<TokenRow token="--fs-border-radius" value="2px" />
|
|
36
|
+
<TokenRow token="--fs-border-radius-medium" value="8px" />
|
|
37
|
+
<TokenRow token="--fs-border-radius-pill" value="100px" />
|
|
38
|
+
<TokenRow token="--fs-border-radius-circle" value="100%" />
|
|
39
|
+
<TokenDivider />
|
|
40
|
+
<TokenRow token="--fs-border-width" value="1px" />
|
|
41
|
+
<TokenRow token="--fs-border-width-thick" value="2px" />
|
|
42
|
+
<TokenRow token="--fs-border-width-thickest" value="3px" />
|
|
43
|
+
<TokenDivider />
|
|
44
|
+
<TokenRow
|
|
45
|
+
token="--fs-border-color"
|
|
46
|
+
value="var(--fs-color-neutral-4)"
|
|
47
|
+
isColor
|
|
48
|
+
/>
|
|
49
|
+
<TokenRow
|
|
50
|
+
token="--fs-border-color-hover"
|
|
51
|
+
value="var(--fs-color-main-3)"
|
|
52
|
+
isColor
|
|
53
|
+
/>
|
|
54
|
+
<TokenRow
|
|
55
|
+
token="--fs-border-color-active"
|
|
56
|
+
value="var(--fs-color-main-2)"
|
|
57
|
+
isColor
|
|
58
|
+
/>
|
|
59
|
+
<TokenRow
|
|
60
|
+
token="--fs-border-color-disabled"
|
|
61
|
+
value="var(--fs-color-neutral-6)"
|
|
62
|
+
isColor
|
|
63
|
+
/>
|
|
64
|
+
<TokenDivider />
|
|
65
|
+
<TokenRow
|
|
66
|
+
token="--fs-border-color-light"
|
|
67
|
+
value="var(--fs-color-neutral-2)"
|
|
68
|
+
isColor
|
|
69
|
+
/>
|
|
70
|
+
<TokenRow
|
|
71
|
+
token="--fs-border-color-light-hover"
|
|
72
|
+
value="var(--fs-color-neutral-3)"
|
|
73
|
+
isColor
|
|
74
|
+
/>
|
|
75
|
+
<TokenRow
|
|
76
|
+
token="--fs-border-color-light-active"
|
|
77
|
+
value="var(--fs-color-neutral-3)"
|
|
78
|
+
isColor
|
|
79
|
+
/>
|
|
80
|
+
<TokenRow
|
|
81
|
+
token="--fs-border-color-light-disabled"
|
|
82
|
+
value="var(--fs-color-neutral-5)"
|
|
83
|
+
isColor
|
|
84
|
+
/>
|
|
85
|
+
</TokenTable>
|
|
86
|
+
|
|
87
|
+
## Shadow
|
|
88
|
+
|
|
89
|
+
<TokenTable>
|
|
90
|
+
<TokenRow token="--fs-shadow" value="none" />
|
|
91
|
+
<TokenRow token="--fs-shadow-darker" value="0 0 10px rgb(0 0 0 / 20%)" />
|
|
92
|
+
<TokenRow
|
|
93
|
+
token="--fs-shadow-hover"
|
|
94
|
+
value="0 0 0 1px var(--fs-color-main-4)"
|
|
95
|
+
/>
|
|
96
|
+
</TokenTable>
|