@faststore/ui 2.0.2-alpha.0 → 2.0.4-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/assets/ShoppingCart.d.ts +2 -2
- package/dist/assets/ShoppingCart.js.map +1 -1
- package/dist/assets/X.d.ts +2 -2
- package/dist/assets/X.js.map +1 -1
- package/package.json +30 -37
- package/src/assets/ShoppingCart.tsx +50 -0
- package/src/assets/X.tsx +38 -0
- package/src/base/layout.scss +78 -0
- package/src/base/tokens.scss +274 -0
- package/src/base/typography.scss +64 -0
- package/src/components/atoms/Badge/Badge.stories.mdx +156 -0
- package/src/components/atoms/Badge/styles.scss +209 -0
- package/src/components/atoms/Button/Button.stories.mdx +110 -0
- package/src/components/atoms/Button/styles.scss +316 -0
- package/src/components/atoms/Checkbox/styles.scss +155 -0
- package/src/{atoms → components/atoms}/Incentive/Incentive.tsx +0 -0
- package/src/{atoms → components/atoms}/Incentive/index.tsx +0 -0
- package/src/{atoms → components/atoms}/Incentive/stories/Incentive.mdx +0 -0
- package/src/{atoms → components/atoms}/Incentive/stories/Incentive.stories.tsx +0 -0
- package/src/{atoms → components/atoms}/Incentive/stories/assets/Icons.tsx +0 -0
- package/src/{atoms → components/atoms}/Input/Input.tsx +0 -0
- package/src/{atoms → components/atoms}/Input/index.ts +0 -0
- package/src/{atoms → components/atoms}/Input/stories/Input.mdx +0 -0
- package/src/{atoms → components/atoms}/Input/stories/Input.stories.tsx +1 -1
- package/src/components/atoms/Label/Label.stories.mdx +65 -0
- package/src/{atoms → components/atoms}/Link/Link.tsx +1 -1
- package/src/{atoms → components/atoms}/Link/index.tsx +0 -0
- package/src/{atoms → components/atoms}/Link/stories/Link.mdx +0 -0
- package/src/{atoms → components/atoms}/Link/stories/Link.stories.tsx +0 -0
- package/src/{atoms → components/atoms}/List/List.tsx +0 -0
- package/src/{atoms → components/atoms}/List/index.ts +0 -0
- package/src/{atoms → components/atoms}/List/stories/List.mdx +0 -0
- package/src/{atoms → components/atoms}/List/stories/List.stories.tsx +1 -1
- package/src/{atoms → components/atoms}/Overlay/Overlay.tsx +0 -0
- package/src/{atoms → components/atoms}/Overlay/index.ts +0 -0
- package/src/{atoms → components/atoms}/Overlay/stories/Overlay.mdx +0 -0
- package/src/{atoms → components/atoms}/Overlay/stories/Overlay.stories.tsx +1 -1
- package/src/{atoms → components/atoms}/Popover/Popover.tsx +0 -0
- package/src/{atoms → components/atoms}/Popover/index.ts +0 -0
- package/src/{atoms → components/atoms}/Popover/stories/Popover.mdx +0 -0
- package/src/{atoms → components/atoms}/Popover/stories/Popover.stories.tsx +1 -1
- package/src/{atoms → components/atoms}/Price/Price.tsx +0 -0
- package/src/{atoms → components/atoms}/Price/index.ts +0 -0
- package/src/{atoms → components/atoms}/Price/stories/Price.mdx +0 -0
- package/src/{atoms → components/atoms}/Price/stories/Price.stories.tsx +1 -1
- package/src/components/atoms/Radio/Radio.stories.mdx +101 -0
- package/src/components/atoms/Radio/styles.scss +108 -0
- package/src/{atoms → components/atoms}/Select/Select.tsx +0 -0
- package/src/{atoms → components/atoms}/Select/index.ts +0 -0
- package/src/{atoms → components/atoms}/Select/stories/Select.mdx +0 -0
- package/src/{atoms → components/atoms}/Select/stories/Select.stories.tsx +1 -1
- package/src/{atoms → components/atoms}/Skeleton/Skeleton.tsx +0 -0
- package/src/{atoms → components/atoms}/Skeleton/index.ts +0 -0
- package/src/{atoms → components/atoms}/Skeleton/stories/Skeleton.mdx +0 -0
- package/src/{atoms → components/atoms}/Skeleton/stories/Skeleton.stories.tsx +0 -0
- package/src/{atoms → components/atoms}/Slider/Slider.tsx +0 -0
- package/src/{atoms → components/atoms}/Slider/index.ts +0 -0
- package/src/{atoms → components/atoms}/Slider/stories/Slider.mdx +0 -0
- package/src/{atoms → components/atoms}/Slider/stories/Slider.stories.tsx +1 -1
- package/src/{atoms → components/atoms}/Spinner/Spinner.tsx +0 -0
- package/src/{atoms → components/atoms}/Spinner/index.tsx +0 -0
- package/src/{atoms → components/atoms}/Spinner/stories/Spinner.mdx +0 -0
- package/src/{atoms → components/atoms}/Spinner/stories/Spinner.stories.tsx +0 -0
- package/src/{atoms → components/atoms}/TextArea/TextArea.tsx +0 -0
- package/src/{atoms → components/atoms}/TextArea/index.ts +0 -0
- package/src/{atoms → components/atoms}/TextArea/stories/TextArea.mdx +0 -0
- package/src/{atoms → components/atoms}/TextArea/stories/TextArea.stories.tsx +1 -1
- package/src/{molecules → components/molecules}/Accordion/Accordion.tsx +0 -0
- package/src/{molecules → components/molecules}/Accordion/AccordionButton.tsx +4 -4
- package/src/{molecules → components/molecules}/Accordion/AccordionItem.tsx +1 -1
- package/src/{molecules → components/molecules}/Accordion/AccordionPanel.tsx +0 -0
- package/src/{molecules → components/molecules}/Accordion/index.ts +0 -0
- package/src/{molecules → components/molecules}/Accordion/stories/Accordion.mdx +0 -0
- package/src/{molecules → components/molecules}/Accordion/stories/Accordion.stories.tsx +1 -1
- package/src/{molecules → components/molecules}/AggregateRating/AggregateRating.tsx +0 -0
- package/src/{molecules → components/molecules}/AggregateRating/index.ts +0 -0
- package/src/{molecules → components/molecules}/AggregateRating/stories/AggregateRating.mdx +0 -0
- package/src/{molecules → components/molecules}/AggregateRating/stories/AggregateRating.stories.tsx +1 -1
- package/src/{molecules → components/molecules}/Alert/Alert.tsx +0 -0
- package/src/{molecules → components/molecules}/Alert/index.ts +0 -0
- package/src/{molecules → components/molecules}/Alert/stories/Alert.mdx +0 -0
- package/src/{molecules → components/molecules}/Alert/stories/Alert.stories.tsx +3 -3
- package/src/{molecules → components/molecules}/Banner/Banner.tsx +0 -0
- package/src/{molecules → components/molecules}/Banner/BannerContent.tsx +0 -0
- package/src/{molecules → components/molecules}/Banner/BannerImage.tsx +0 -0
- package/src/{molecules → components/molecules}/Banner/BannerLink.tsx +0 -0
- package/src/{molecules → components/molecules}/Banner/index.ts +0 -0
- package/src/{molecules → components/molecules}/Banner/stories/Banner.mdx +0 -0
- package/src/{molecules → components/molecules}/Banner/stories/Banner.stories.tsx +1 -1
- package/src/{molecules → components/molecules}/Breadcrumb/Breadcrumb.tsx +0 -0
- package/src/{molecules → components/molecules}/Breadcrumb/index.ts +0 -0
- package/src/{molecules → components/molecules}/Breadcrumb/stories/Breadcrumb.mdx +0 -0
- package/src/{molecules → components/molecules}/Breadcrumb/stories/Breadcrumb.stories.tsx +1 -1
- package/src/{molecules → components/molecules}/Bullets/Bullets.tsx +1 -1
- package/src/{molecules → components/molecules}/Bullets/index.ts +0 -0
- package/src/{molecules → components/molecules}/Bullets/stories/Bullets.mdx +0 -0
- package/src/{molecules → components/molecules}/Bullets/stories/Bullets.stories.tsx +1 -1
- package/src/{molecules → components/molecules}/Card/Card.tsx +0 -0
- package/src/{molecules → components/molecules}/Card/CardActions.tsx +0 -0
- package/src/{molecules → components/molecules}/Card/CardContent.tsx +0 -0
- package/src/{molecules → components/molecules}/Card/CardImage.tsx +0 -0
- package/src/{molecules → components/molecules}/Card/index.tsx +0 -0
- package/src/{molecules → components/molecules}/Card/stories/Card.mdx +0 -0
- package/src/{molecules → components/molecules}/Card/stories/Card.stories.tsx +5 -5
- package/src/{molecules → components/molecules}/Carousel/Arrows.tsx +0 -0
- package/src/{molecules → components/molecules}/Carousel/Carousel.tsx +2 -2
- package/src/{molecules → components/molecules}/Carousel/CarouselItem.tsx +1 -1
- package/src/{molecules → components/molecules}/Carousel/hooks/useSlideVisibility.ts +0 -0
- package/src/{molecules → components/molecules}/Carousel/index.ts +0 -0
- package/src/{molecules → components/molecules}/Carousel/stories/Carousel.mdx +0 -0
- package/src/{molecules → components/molecules}/Carousel/stories/Carousel.stories.tsx +1 -1
- package/src/{molecules → components/molecules}/CartItem/CartItem.tsx +0 -0
- package/src/{molecules → components/molecules}/CartItem/CartItemActions.tsx +0 -0
- package/src/{molecules → components/molecules}/CartItem/CartItemContent.tsx +0 -0
- package/src/{molecules → components/molecules}/CartItem/CartItemImage.tsx +0 -0
- package/src/{molecules → components/molecules}/CartItem/CartItemPrices.tsx +0 -0
- package/src/{molecules → components/molecules}/CartItem/CartItemSummary.tsx +0 -0
- package/src/{molecules → components/molecules}/CartItem/CartItemTitle.tsx +0 -0
- package/src/{molecules → components/molecules}/CartItem/index.tsx +0 -0
- package/src/{molecules → components/molecules}/CartItem/stories/CartItem.mdx +0 -0
- package/src/{molecules → components/molecules}/CartItem/stories/CartItem.stories.tsx +1 -1
- package/src/components/molecules/CheckboxField/CheckboxField.stories.mdx +38 -0
- package/src/components/molecules/CheckboxField/styles.scss +12 -0
- package/src/{molecules → components/molecules}/Dropdown/Dropdown.tsx +0 -0
- package/src/{molecules → components/molecules}/Dropdown/DropdownButton.tsx +0 -0
- package/src/{molecules → components/molecules}/Dropdown/DropdownItem.tsx +0 -0
- package/src/{molecules → components/molecules}/Dropdown/DropdownMenu.tsx +0 -0
- package/src/{molecules → components/molecules}/Dropdown/contexts/DropdownContext.ts +0 -0
- package/src/{molecules → components/molecules}/Dropdown/hooks/useDropdown.ts +0 -0
- package/src/{molecules → components/molecules}/Dropdown/hooks/useDropdownPosition.ts +0 -0
- package/src/{molecules → components/molecules}/Dropdown/index.ts +0 -0
- package/src/{molecules → components/molecules}/Dropdown/stories/Dropdown.mdx +0 -0
- package/src/{molecules → components/molecules}/Dropdown/stories/Dropdown.stories.tsx +1 -1
- package/src/{molecules → components/molecules}/Dropdown/stories/assets/Caret.tsx +0 -0
- package/src/{molecules → components/molecules}/Form/Form.tsx +0 -0
- package/src/{molecules → components/molecules}/Form/index.ts +0 -0
- package/src/{molecules → components/molecules}/Form/stories/Form.mdx +0 -0
- package/src/{molecules → components/molecules}/Form/stories/Form.stories.tsx +2 -1
- package/src/{molecules → components/molecules}/Gift/Gift.tsx +2 -3
- package/src/{molecules → components/molecules}/Gift/GiftContent.tsx +0 -0
- package/src/{molecules → components/molecules}/Gift/GiftImage.tsx +0 -0
- package/src/{molecules → components/molecules}/Gift/index.tsx +0 -0
- package/src/{molecules → components/molecules}/Gift/stories/Gift.mdx +0 -0
- package/src/{molecules → components/molecules}/Gift/stories/Gift.stories.tsx +1 -1
- package/src/components/molecules/IconButton/IconButton.stories.mdx +47 -0
- package/src/{molecules → components/molecules}/LoadingButton/LoadingButton.tsx +3 -8
- package/src/{molecules → components/molecules}/LoadingButton/index.tsx +0 -0
- package/src/{molecules → components/molecules}/LoadingButton/stories/LoadingButton.mdx +0 -0
- package/src/{molecules → components/molecules}/LoadingButton/stories/LoadingButton.stories.tsx +1 -1
- package/src/{molecules → components/molecules}/Modal/Modal.tsx +0 -0
- package/src/{molecules → components/molecules}/Modal/ModalContent.tsx +0 -0
- package/src/{molecules → components/molecules}/Modal/index.tsx +0 -0
- package/src/{molecules → components/molecules}/Modal/stories/Modal.mdx +0 -0
- package/src/{molecules → components/molecules}/Modal/stories/Modal.stories.tsx +1 -1
- package/src/{molecules → components/molecules}/Modal/useTrapFocus.ts +0 -0
- package/src/{molecules → components/molecules}/OrderSummary/OrderSummary.tsx +0 -0
- package/src/{molecules → components/molecules}/OrderSummary/index.tsx +0 -0
- package/src/{molecules → components/molecules}/OrderSummary/stories/OrderSummary.mdx +0 -0
- package/src/{molecules → components/molecules}/OrderSummary/stories/OrderSummary.stories.tsx +0 -0
- package/src/{molecules → components/molecules}/PaymentMethods/PaymentMethods.tsx +0 -0
- package/src/{molecules → components/molecules}/PaymentMethods/index.tsx +0 -0
- package/src/{molecules → components/molecules}/PaymentMethods/stories/PaymentMethods.mdx +0 -0
- package/src/{molecules → components/molecules}/PaymentMethods/stories/PaymentMethods.stories.tsx +0 -0
- package/src/{molecules → components/molecules}/PaymentMethods/stories/assets/Icons.tsx +0 -0
- package/src/{molecules → components/molecules}/PriceRange/PriceRange.tsx +0 -0
- package/src/{molecules → components/molecules}/PriceRange/index.ts +0 -0
- package/src/{molecules → components/molecules}/PriceRange/stories/PriceRange.mdx +0 -0
- package/src/{molecules → components/molecules}/PriceRange/stories/PriceRange.stories.tsx +1 -1
- package/src/{molecules → components/molecules}/ProductCard/ProductCard.tsx +0 -0
- package/src/{molecules → components/molecules}/ProductCard/ProductCardActions.tsx +0 -0
- package/src/{molecules → components/molecules}/ProductCard/ProductCardContent.tsx +0 -0
- package/src/{molecules → components/molecules}/ProductCard/ProductCardImage.tsx +0 -0
- package/src/{molecules → components/molecules}/ProductCard/index.tsx +0 -0
- package/src/{molecules → components/molecules}/ProductCard/stories/ProductCard.mdx +0 -0
- package/src/{molecules → components/molecules}/ProductCard/stories/ProductCard.stories.tsx +1 -2
- package/src/{molecules → components/molecules}/ProductTitle/ProductTitle.tsx +0 -0
- package/src/{molecules → components/molecules}/ProductTitle/index.tsx +0 -0
- package/src/{molecules → components/molecules}/ProductTitle/stories/ProductTitle.mdx +0 -0
- package/src/{molecules → components/molecules}/ProductTitle/stories/ProductTitle.stories.tsx +3 -3
- package/src/{molecules → components/molecules}/QuantitySelector/QuantitySelector.tsx +2 -2
- package/src/{molecules → components/molecules}/QuantitySelector/index.ts +0 -0
- package/src/{molecules → components/molecules}/QuantitySelector/stories/QuantitySelector.mdx +0 -0
- package/src/{molecules → components/molecules}/QuantitySelector/stories/QuantitySelector.stories.tsx +0 -0
- package/src/{molecules → components/molecules}/QuantitySelector/stories/assets/Icons.tsx +0 -0
- package/src/components/molecules/RadioField/RadioField.stories.mdx +38 -0
- package/src/components/molecules/RadioField/styles.scss +12 -0
- package/src/{molecules → components/molecules}/RadioGroup/RadioGroup.tsx +0 -0
- package/src/{molecules → components/molecules}/RadioGroup/RadioOption.tsx +1 -1
- package/src/{molecules → components/molecules}/RadioGroup/index.tsx +0 -0
- package/src/{molecules → components/molecules}/RadioGroup/stories/RadioGroup.mdx +0 -0
- package/src/{molecules → components/molecules}/RadioGroup/stories/RadioGroup.stories.tsx +0 -0
- package/src/{molecules → components/molecules}/RadioGroup/useRadioGroup.ts +0 -0
- package/src/{molecules → components/molecules}/SearchInput/SearchInput.tsx +2 -3
- package/src/{molecules → components/molecules}/SearchInput/index.ts +0 -0
- package/src/{molecules → components/molecules}/SearchInput/stories/SearchInput.mdx +0 -0
- package/src/{molecules → components/molecules}/SearchInput/stories/SearchInput.stories.tsx +1 -1
- package/src/{molecules → components/molecules}/SearchInput/stories/assets/CustomIcon.tsx +0 -0
- package/src/{molecules → components/molecules}/SkuSelector/SkuSelector.tsx +3 -2
- package/src/{molecules → components/molecules}/SkuSelector/index.tsx +0 -0
- package/src/{molecules → components/molecules}/SkuSelector/stories/SkuSelector.mdx +0 -0
- package/src/{molecules → components/molecules}/SkuSelector/stories/SkuSelector.stories.tsx +1 -1
- package/src/{molecules → components/molecules}/Table/Table.tsx +0 -0
- package/src/{molecules → components/molecules}/Table/TableBody.tsx +0 -0
- package/src/{molecules → components/molecules}/Table/TableCell.tsx +0 -0
- package/src/{molecules → components/molecules}/Table/TableFooter.tsx +0 -0
- package/src/{molecules → components/molecules}/Table/TableHead.tsx +0 -0
- package/src/{molecules → components/molecules}/Table/TableRow.tsx +0 -0
- package/src/{molecules → components/molecules}/Table/index.ts +0 -0
- package/src/{molecules → components/molecules}/Table/stories/Table.mdx +0 -0
- package/src/{molecules → components/molecules}/Table/stories/Table.stories.tsx +0 -0
- package/src/components/molecules/Tag/Tag.stories.mdx +31 -0
- package/src/components/molecules/Tag/styles.scss +99 -0
- package/src/{organisms → components/organisms}/Hero/Hero.tsx +0 -0
- package/src/{organisms → components/organisms}/Hero/HeroHeading.tsx +0 -0
- package/src/{organisms → components/organisms}/Hero/HeroImage.tsx +0 -0
- package/src/{organisms → components/organisms}/Hero/index.tsx +0 -0
- package/src/{organisms → components/organisms}/Hero/stories/Hero.mdx +0 -0
- package/src/{organisms → components/organisms}/Hero/stories/Hero.stories.tsx +1 -1
- package/src/{organisms → components/organisms}/OutOfStock/OutOfStock.tsx +0 -0
- package/src/{organisms → components/organisms}/OutOfStock/OutOfStockMessage.tsx +0 -0
- package/src/{organisms → components/organisms}/OutOfStock/OutOfStockTitle.tsx +0 -0
- package/src/{organisms → components/organisms}/OutOfStock/index.tsx +0 -0
- package/src/{organisms → components/organisms}/OutOfStock/stories/OutOfStock.mdx +0 -0
- package/src/{organisms → components/organisms}/OutOfStock/stories/OutOfStock.stories.tsx +1 -1
- package/src/{organisms → components/organisms}/Tiles/Tile.tsx +0 -0
- package/src/{organisms → components/organisms}/Tiles/Tiles.tsx +0 -0
- package/src/{organisms → components/organisms}/Tiles/index.ts +0 -0
- package/src/{organisms → components/organisms}/Tiles/stories/Tiles.mdx +0 -0
- package/src/{organisms → components/organisms}/Tiles/stories/Tiles.stories.tsx +0 -0
- package/src/index.ts +97 -99
- package/src/styles/base.scss +3 -0
- package/src/styles/components.scss +10 -0
- package/src/styles/global.scss +4 -0
- package/src/styles/reset.scss +54 -0
- package/src/styles/utilities.scss +75 -0
- package/src/typings/utils.d.ts +2 -2
- package/dist/assets/index.d.ts +0 -2
- package/dist/assets/index.js +0 -3
- package/dist/assets/index.js.map +0 -1
- package/src/atoms/Badge/Badge.test.tsx +0 -23
- package/src/atoms/Badge/Badge.tsx +0 -23
- package/src/atoms/Badge/index.ts +0 -2
- package/src/atoms/Badge/stories/Badge.mdx +0 -18
- package/src/atoms/Badge/stories/Badge.stories.tsx +0 -37
- package/src/atoms/Button/Button.test.tsx +0 -12
- package/src/atoms/Button/Button.tsx +0 -23
- package/src/atoms/Button/index.ts +0 -2
- package/src/atoms/Button/stories/Button.mdx +0 -18
- package/src/atoms/Button/stories/Button.stories.tsx +0 -36
- package/src/atoms/Checkbox/Checkbox.test.tsx +0 -65
- package/src/atoms/Checkbox/Checkbox.tsx +0 -27
- package/src/atoms/Checkbox/index.ts +0 -2
- package/src/atoms/Checkbox/stories/Checkbox.mdx +0 -18
- package/src/atoms/Checkbox/stories/Checkbox.stories.tsx +0 -65
- package/src/atoms/Icon/Icon.test.tsx +0 -43
- package/src/atoms/Icon/Icon.tsx +0 -26
- package/src/atoms/Icon/index.ts +0 -2
- package/src/atoms/Icon/stories/Icon.mdx +0 -18
- package/src/atoms/Icon/stories/Icon.stories.tsx +0 -40
- package/src/atoms/Icon/stories/assets/ShoppingCart.tsx +0 -23
- package/src/atoms/Incentive/Incentive.test.tsx +0 -36
- package/src/atoms/Input/Input.test.tsx +0 -73
- package/src/atoms/Label/Label.test.tsx +0 -71
- package/src/atoms/Label/Label.tsx +0 -22
- package/src/atoms/Label/index.ts +0 -2
- package/src/atoms/Label/stories/Label.mdx +0 -18
- package/src/atoms/Label/stories/Label.stories.tsx +0 -30
- package/src/atoms/Link/Link.test.tsx +0 -53
- package/src/atoms/List/List.test.tsx +0 -195
- package/src/atoms/Overlay/Overlay.test.tsx +0 -23
- package/src/atoms/Popover/Popover.test.tsx +0 -39
- package/src/atoms/Price/Price.test.tsx +0 -63
- package/src/atoms/Radio/Radio.test.tsx +0 -59
- package/src/atoms/Radio/Radio.tsx +0 -24
- package/src/atoms/Radio/index.ts +0 -2
- package/src/atoms/Radio/stories/Radio.mdx +0 -18
- package/src/atoms/Radio/stories/Radio.stories.tsx +0 -41
- package/src/atoms/Select/Select.test.tsx +0 -71
- package/src/atoms/Skeleton/Skeleton.test.tsx +0 -13
- package/src/atoms/Slider/Slider.test.tsx +0 -32
- package/src/atoms/Spinner/Spinner.test.tsx +0 -12
- package/src/atoms/TextArea/TextArea.test.tsx +0 -77
- package/src/hooks/useSlider/useSlider.test.ts +0 -176
- package/src/molecules/Accordion/Accordion.test.tsx +0 -226
- package/src/molecules/AggregateRating/AggregateRating.test.tsx +0 -87
- package/src/molecules/Alert/Alert.test.tsx +0 -23
- package/src/molecules/Banner/Banner.test.tsx +0 -67
- package/src/molecules/Breadcrumb/Breadcrumb.test.tsx +0 -124
- package/src/molecules/Bullets/Bullets.test.tsx +0 -128
- package/src/molecules/Card/Card.test.tsx +0 -68
- package/src/molecules/Carousel/Carousel.test.tsx +0 -587
- package/src/molecules/Carousel/hooks/hooks.test.ts +0 -109
- package/src/molecules/CartItem/CartItem.test.tsx +0 -79
- package/src/molecules/Dropdown/Dropdown.test.tsx +0 -275
- package/src/molecules/Form/Form.test.tsx +0 -61
- package/src/molecules/Gift/Gift.test.tsx +0 -53
- package/src/molecules/IconButton/IconButton.test.tsx +0 -31
- package/src/molecules/IconButton/IconButton.tsx +0 -35
- package/src/molecules/IconButton/index.tsx +0 -2
- package/src/molecules/IconButton/stories/IconButton.mdx +0 -27
- package/src/molecules/IconButton/stories/IconButton.stories.tsx +0 -35
- package/src/molecules/LoadingButton/LoadingButton.test.tsx +0 -14
- package/src/molecules/Modal/Modal.test.tsx +0 -241
- package/src/molecules/OrderSummary/OrderSummary.test.tsx +0 -103
- package/src/molecules/PaymentMethods/PaymentMethods.test.tsx +0 -37
- package/src/molecules/PriceRange/PriceRange.test.tsx +0 -70
- package/src/molecules/ProductCard/ProductCard.test.tsx +0 -75
- package/src/molecules/QuantitySelector/QuantitySelector.test.tsx +0 -93
- package/src/molecules/RadioGroup/RadioGroup.test.tsx +0 -107
- package/src/molecules/SearchInput/SearchInput.test.tsx +0 -34
- package/src/molecules/SkuSelector/SkuSelector.test.tsx +0 -42
- package/src/molecules/Table/Table.test.tsx +0 -233
- package/src/organisms/Hero/Hero.test.tsx +0 -60
- package/src/organisms/OutOfStock/OutOfStock.test.tsx +0 -122
- package/src/setupTests.ts +0 -7
- package/src/utils/toHaveNoIncomplete.ts +0 -76
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/index.ts
CHANGED
|
@@ -1,103 +1,91 @@
|
|
|
1
|
-
|
|
2
|
-
export { default as Link } from './atoms/Link'
|
|
3
|
-
export type { LinkProps } from './atoms/Link'
|
|
4
|
-
|
|
5
|
-
export { default as Button } from './atoms/Button'
|
|
6
|
-
export type { ButtonProps } from './atoms/Button'
|
|
7
|
-
|
|
8
|
-
export { default as Input } from './atoms/Input'
|
|
9
|
-
export type { InputProps } from './atoms/Input'
|
|
10
|
-
|
|
11
|
-
export { default as Icon } from './atoms/Icon'
|
|
12
|
-
export type { IconProps } from './atoms/Icon'
|
|
1
|
+
export * from '@faststore/components'
|
|
13
2
|
|
|
14
|
-
|
|
15
|
-
export
|
|
16
|
-
|
|
17
|
-
export { default as Price } from './atoms/Price'
|
|
18
|
-
export type { PriceProps } from './atoms/Price'
|
|
19
|
-
|
|
20
|
-
export { default as TextArea } from './atoms/TextArea'
|
|
21
|
-
export type { TextAreaProps } from './atoms/TextArea'
|
|
3
|
+
// Atoms
|
|
4
|
+
export { default as Link } from './components/atoms/Link'
|
|
5
|
+
export type { LinkProps } from './components/atoms/Link'
|
|
22
6
|
|
|
23
|
-
export { default as
|
|
24
|
-
export type {
|
|
7
|
+
export { default as Input } from './components/atoms/Input'
|
|
8
|
+
export type { InputProps } from './components/atoms/Input'
|
|
25
9
|
|
|
26
|
-
export { default as
|
|
27
|
-
export type {
|
|
10
|
+
export { default as Popover } from './components/atoms/Popover'
|
|
11
|
+
export type { PopoverProps } from './components/atoms/Popover'
|
|
28
12
|
|
|
29
|
-
export { default as
|
|
30
|
-
export type {
|
|
13
|
+
export { default as Price } from './components/atoms/Price'
|
|
14
|
+
export type { PriceProps } from './components/atoms/Price'
|
|
31
15
|
|
|
32
|
-
export { default as
|
|
33
|
-
export type {
|
|
16
|
+
export { default as TextArea } from './components/atoms/TextArea'
|
|
17
|
+
export type { TextAreaProps } from './components/atoms/TextArea'
|
|
34
18
|
|
|
35
|
-
export { default as
|
|
36
|
-
export type {
|
|
19
|
+
export { default as Overlay } from './components/atoms/Overlay'
|
|
20
|
+
export type { OverlayProps } from './components/atoms/Overlay'
|
|
37
21
|
|
|
38
|
-
export { default as
|
|
39
|
-
export type {
|
|
22
|
+
export { default as Select } from './components/atoms/Select'
|
|
23
|
+
export type { SelectProps } from './components/atoms/Select'
|
|
40
24
|
|
|
41
|
-
export { default as
|
|
42
|
-
export type {
|
|
25
|
+
export { default as Slider } from './components/atoms/Slider'
|
|
26
|
+
export type { SliderProps } from './components/atoms/Slider'
|
|
43
27
|
|
|
44
|
-
export { default as
|
|
45
|
-
export type {
|
|
28
|
+
export { default as List } from './components/atoms/List'
|
|
29
|
+
export type { ListProps } from './components/atoms/List'
|
|
46
30
|
|
|
47
|
-
export { default as
|
|
48
|
-
export type {
|
|
31
|
+
export { default as Skeleton } from './components/atoms/Skeleton'
|
|
32
|
+
export type { SkeletonProps } from './components/atoms/Skeleton'
|
|
49
33
|
|
|
50
|
-
export { default as
|
|
51
|
-
export type {
|
|
34
|
+
export { default as Spinner } from './components/atoms/Spinner'
|
|
35
|
+
export type { SpinnerProps } from './components/atoms/Spinner'
|
|
52
36
|
|
|
53
|
-
export { default as Incentive } from './atoms/Incentive'
|
|
54
|
-
export type { IncentiveProps } from './atoms/Incentive'
|
|
37
|
+
export { default as Incentive } from './components/atoms/Incentive'
|
|
38
|
+
export type { IncentiveProps } from './components/atoms/Incentive'
|
|
55
39
|
|
|
56
40
|
// Molecules
|
|
57
|
-
export { default as SkuSelector } from './molecules/SkuSelector'
|
|
58
|
-
export type { SkuSelectorProps } from './molecules/SkuSelector'
|
|
41
|
+
export { default as SkuSelector } from './components/molecules/SkuSelector'
|
|
42
|
+
export type { SkuSelectorProps } from './components/molecules/SkuSelector'
|
|
59
43
|
|
|
60
|
-
export {
|
|
44
|
+
export {
|
|
45
|
+
default as Gift,
|
|
46
|
+
GiftContent,
|
|
47
|
+
GiftImage,
|
|
48
|
+
} from './components/molecules/Gift'
|
|
61
49
|
export type {
|
|
62
50
|
GiftProps,
|
|
63
51
|
GiftContentProps,
|
|
64
52
|
GiftImageProps,
|
|
65
|
-
} from './molecules/Gift'
|
|
53
|
+
} from './components/molecules/Gift'
|
|
66
54
|
|
|
67
|
-
export { default as ProductTitle } from './molecules/ProductTitle'
|
|
68
|
-
export type { ProductTitleProps } from './molecules/ProductTitle'
|
|
55
|
+
export { default as ProductTitle } from './components/molecules/ProductTitle'
|
|
56
|
+
export type { ProductTitleProps } from './components/molecules/ProductTitle'
|
|
69
57
|
|
|
70
|
-
export { default as OrderSummary } from './molecules/OrderSummary'
|
|
71
|
-
export type { OrderSummaryProps } from './molecules/OrderSummary'
|
|
58
|
+
export { default as OrderSummary } from './components/molecules/OrderSummary'
|
|
59
|
+
export type { OrderSummaryProps } from './components/molecules/OrderSummary'
|
|
72
60
|
|
|
73
|
-
export { default as AggregateRating } from './molecules/AggregateRating'
|
|
74
|
-
export type { AggregateRatingProps } from './molecules/AggregateRating'
|
|
61
|
+
export { default as AggregateRating } from './components/molecules/AggregateRating'
|
|
62
|
+
export type { AggregateRatingProps } from './components/molecules/AggregateRating'
|
|
75
63
|
|
|
76
64
|
export {
|
|
77
65
|
default as ProductCard,
|
|
78
66
|
ProductCardImage,
|
|
79
67
|
ProductCardContent,
|
|
80
68
|
ProductCardActions,
|
|
81
|
-
} from './molecules/ProductCard'
|
|
69
|
+
} from './components/molecules/ProductCard'
|
|
82
70
|
export type {
|
|
83
71
|
ProductCardProps,
|
|
84
72
|
ProductCardImageProps,
|
|
85
73
|
ProductCardContentProps,
|
|
86
74
|
ProductCardActionsProps,
|
|
87
|
-
} from './molecules/ProductCard'
|
|
75
|
+
} from './components/molecules/ProductCard'
|
|
88
76
|
|
|
89
77
|
export {
|
|
90
78
|
default as Card,
|
|
91
79
|
CardImage,
|
|
92
80
|
CardContent,
|
|
93
81
|
CardActions,
|
|
94
|
-
} from './molecules/Card'
|
|
82
|
+
} from './components/molecules/Card'
|
|
95
83
|
export type {
|
|
96
84
|
CardProps,
|
|
97
85
|
CardImageProps,
|
|
98
86
|
CardContentProps,
|
|
99
87
|
CardActionsProps,
|
|
100
|
-
} from './molecules/Card'
|
|
88
|
+
} from './components/molecules/Card'
|
|
101
89
|
|
|
102
90
|
export {
|
|
103
91
|
default as CartItem,
|
|
@@ -107,7 +95,7 @@ export {
|
|
|
107
95
|
CartItemPrices,
|
|
108
96
|
CartItemSummary,
|
|
109
97
|
CartItemTitle,
|
|
110
|
-
} from './molecules/CartItem'
|
|
98
|
+
} from './components/molecules/CartItem'
|
|
111
99
|
export type {
|
|
112
100
|
CartItemProps,
|
|
113
101
|
CartItemActionsProps,
|
|
@@ -116,63 +104,69 @@ export type {
|
|
|
116
104
|
CartItemPricesProps,
|
|
117
105
|
CartItemSummaryProps,
|
|
118
106
|
CartItemTitleProps,
|
|
119
|
-
} from './molecules/CartItem'
|
|
120
|
-
|
|
121
|
-
export { default as Bullets } from './molecules/Bullets'
|
|
122
|
-
export type { BulletsProps } from './molecules/Bullets'
|
|
107
|
+
} from './components/molecules/CartItem'
|
|
123
108
|
|
|
124
|
-
export { default as
|
|
125
|
-
export type {
|
|
109
|
+
export { default as Bullets } from './components/molecules/Bullets'
|
|
110
|
+
export type { BulletsProps } from './components/molecules/Bullets'
|
|
126
111
|
|
|
127
|
-
export { default as
|
|
128
|
-
export type {
|
|
112
|
+
export { default as SearchInput } from './components/molecules/SearchInput'
|
|
113
|
+
export type {
|
|
114
|
+
SearchInputProps,
|
|
115
|
+
SearchInputRef,
|
|
116
|
+
} from './components/molecules/SearchInput'
|
|
129
117
|
|
|
130
|
-
export { default as
|
|
131
|
-
export type {
|
|
118
|
+
export { default as Carousel } from './components/molecules/Carousel'
|
|
119
|
+
export type { CarouselProps } from './components/molecules/Carousel'
|
|
132
120
|
|
|
133
|
-
export { default as Modal } from './molecules/Modal'
|
|
134
|
-
export type { ModalProps } from './molecules/Modal'
|
|
121
|
+
export { default as Modal } from './components/molecules/Modal'
|
|
122
|
+
export type { ModalProps } from './components/molecules/Modal'
|
|
135
123
|
|
|
136
124
|
export {
|
|
137
125
|
default as Banner,
|
|
138
126
|
BannerContent,
|
|
139
127
|
BannerImage,
|
|
140
128
|
BannerLink,
|
|
141
|
-
} from './molecules/Banner'
|
|
129
|
+
} from './components/molecules/Banner'
|
|
142
130
|
export type {
|
|
143
131
|
BannerProps,
|
|
144
132
|
BannerContentProps,
|
|
145
133
|
BannerImageProps,
|
|
146
134
|
BannerLinkProps,
|
|
147
|
-
} from './molecules/Banner'
|
|
135
|
+
} from './components/molecules/Banner'
|
|
148
136
|
|
|
149
|
-
export { default as PaymentMethods } from './molecules/PaymentMethods'
|
|
150
|
-
export type { PaymentMethodsProps } from './molecules/PaymentMethods'
|
|
137
|
+
export { default as PaymentMethods } from './components/molecules/PaymentMethods'
|
|
138
|
+
export type { PaymentMethodsProps } from './components/molecules/PaymentMethods'
|
|
151
139
|
|
|
152
|
-
export { default as Breadcrumb } from './molecules/Breadcrumb'
|
|
153
|
-
export type { BreadcrumbProps } from './molecules/Breadcrumb'
|
|
140
|
+
export { default as Breadcrumb } from './components/molecules/Breadcrumb'
|
|
141
|
+
export type { BreadcrumbProps } from './components/molecules/Breadcrumb'
|
|
154
142
|
|
|
155
|
-
export { default as LoadingButton } from './molecules/LoadingButton'
|
|
156
|
-
export type { LoadingButtonProps } from './molecules/LoadingButton'
|
|
143
|
+
export { default as LoadingButton } from './components/molecules/LoadingButton'
|
|
144
|
+
export type { LoadingButtonProps } from './components/molecules/LoadingButton'
|
|
157
145
|
|
|
158
|
-
export { default as PriceRange } from './molecules/PriceRange'
|
|
159
|
-
export type { PriceRangeProps } from './molecules/PriceRange'
|
|
146
|
+
export { default as PriceRange } from './components/molecules/PriceRange'
|
|
147
|
+
export type { PriceRangeProps } from './components/molecules/PriceRange'
|
|
160
148
|
|
|
161
|
-
export {
|
|
162
|
-
|
|
149
|
+
export {
|
|
150
|
+
default as RadioGroup,
|
|
151
|
+
RadioOption,
|
|
152
|
+
} from './components/molecules/RadioGroup'
|
|
153
|
+
export type {
|
|
154
|
+
RadioGroupProps,
|
|
155
|
+
RadioOptionProps,
|
|
156
|
+
} from './components/molecules/RadioGroup'
|
|
163
157
|
|
|
164
158
|
export {
|
|
165
159
|
default as Accordion,
|
|
166
160
|
AccordionItem,
|
|
167
161
|
AccordionButton,
|
|
168
162
|
AccordionPanel,
|
|
169
|
-
} from './molecules/Accordion'
|
|
163
|
+
} from './components/molecules/Accordion'
|
|
170
164
|
export type {
|
|
171
165
|
AccordionProps,
|
|
172
166
|
AccordionItemProps,
|
|
173
167
|
AccordionButtonProps,
|
|
174
168
|
AccordionPanelProps,
|
|
175
|
-
} from './molecules/Accordion'
|
|
169
|
+
} from './components/molecules/Accordion'
|
|
176
170
|
|
|
177
171
|
export {
|
|
178
172
|
Table,
|
|
@@ -181,7 +175,7 @@ export {
|
|
|
181
175
|
TableFooter,
|
|
182
176
|
TableHead,
|
|
183
177
|
TableRow,
|
|
184
|
-
} from './molecules/Table'
|
|
178
|
+
} from './components/molecules/Table'
|
|
185
179
|
export type {
|
|
186
180
|
TableProps,
|
|
187
181
|
TableBodyProps,
|
|
@@ -189,51 +183,55 @@ export type {
|
|
|
189
183
|
TableFooterProps,
|
|
190
184
|
TableHeadProps,
|
|
191
185
|
TableRowProps,
|
|
192
|
-
} from './molecules/Table'
|
|
186
|
+
} from './components/molecules/Table'
|
|
193
187
|
|
|
194
|
-
export { default as Form } from './molecules/Form'
|
|
195
|
-
export type { FormProps } from './molecules/Form'
|
|
188
|
+
export { default as Form } from './components/molecules/Form'
|
|
189
|
+
export type { FormProps } from './components/molecules/Form'
|
|
196
190
|
|
|
197
|
-
export { default as Alert } from './molecules/Alert'
|
|
198
|
-
export type { AlertProps } from './molecules/Alert'
|
|
191
|
+
export { default as Alert } from './components/molecules/Alert'
|
|
192
|
+
export type { AlertProps } from './components/molecules/Alert'
|
|
199
193
|
|
|
200
|
-
export { default as QuantitySelector } from './molecules/QuantitySelector'
|
|
201
|
-
export type { QuantitySelectorProps } from './molecules/QuantitySelector'
|
|
194
|
+
export { default as QuantitySelector } from './components/molecules/QuantitySelector'
|
|
195
|
+
export type { QuantitySelectorProps } from './components/molecules/QuantitySelector'
|
|
202
196
|
|
|
203
197
|
export {
|
|
204
198
|
default as Dropdown,
|
|
205
199
|
DropdownButton,
|
|
206
200
|
DropdownItem,
|
|
207
201
|
DropdownMenu,
|
|
208
|
-
} from './molecules/Dropdown'
|
|
202
|
+
} from './components/molecules/Dropdown'
|
|
209
203
|
export type {
|
|
210
204
|
DropdownProps,
|
|
211
205
|
DropdownButtonProps,
|
|
212
206
|
DropdownItemProps,
|
|
213
207
|
DropdownMenuProps,
|
|
214
|
-
} from './molecules/Dropdown'
|
|
208
|
+
} from './components/molecules/Dropdown'
|
|
215
209
|
|
|
216
210
|
// Organisms
|
|
217
211
|
export {
|
|
218
212
|
default as OutOfStock,
|
|
219
213
|
OutOfStockTitle,
|
|
220
214
|
OutOfStockMessage,
|
|
221
|
-
} from './organisms/OutOfStock'
|
|
215
|
+
} from './components/organisms/OutOfStock'
|
|
222
216
|
export type {
|
|
223
217
|
OutOfStockProps,
|
|
224
218
|
OutOfStockMessageProps,
|
|
225
219
|
OutOfStockTitleProps,
|
|
226
|
-
} from './organisms/OutOfStock'
|
|
220
|
+
} from './components/organisms/OutOfStock'
|
|
227
221
|
|
|
228
|
-
export { Tiles, Tile } from './organisms/Tiles'
|
|
229
|
-
export type { TilesProps, TileProps } from './organisms/Tiles'
|
|
222
|
+
export { Tiles, Tile } from './components/organisms/Tiles'
|
|
223
|
+
export type { TilesProps, TileProps } from './components/organisms/Tiles'
|
|
230
224
|
|
|
231
|
-
export {
|
|
225
|
+
export {
|
|
226
|
+
default as Hero,
|
|
227
|
+
HeroHeading,
|
|
228
|
+
HeroImage,
|
|
229
|
+
} from './components/organisms/Hero'
|
|
232
230
|
export type {
|
|
233
231
|
HeroProps,
|
|
234
232
|
HeroHeadingProps,
|
|
235
233
|
HeroImageProps,
|
|
236
|
-
} from './organisms/Hero'
|
|
234
|
+
} from './components/organisms/Hero'
|
|
237
235
|
|
|
238
236
|
// Hooks
|
|
239
237
|
export { default as useSlider } from './hooks/useSlider'
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Atoms
|
|
2
|
+
@import "../components/atoms/Badge/styles";
|
|
3
|
+
@import "../components/atoms/Button/styles";
|
|
4
|
+
@import "../components/atoms/Checkbox/styles";
|
|
5
|
+
@import "../components/atoms/Radio/styles";
|
|
6
|
+
|
|
7
|
+
// Molecules
|
|
8
|
+
@import "../components/molecules/CheckboxField/styles";
|
|
9
|
+
@import "../components/molecules/RadioField/styles";
|
|
10
|
+
@import "../components/molecules/Tag/styles";
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
@import "~modern-normalize/modern-normalize";
|
|
2
|
+
|
|
3
|
+
// Reset default styles
|
|
4
|
+
body {
|
|
5
|
+
padding: 0;
|
|
6
|
+
margin: 0;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
// Remove all of the default margins
|
|
10
|
+
blockquote,
|
|
11
|
+
dl,
|
|
12
|
+
dd,
|
|
13
|
+
h1,
|
|
14
|
+
h2,
|
|
15
|
+
h3,
|
|
16
|
+
h4,
|
|
17
|
+
h5,
|
|
18
|
+
h6,
|
|
19
|
+
hr,
|
|
20
|
+
figure,
|
|
21
|
+
p,
|
|
22
|
+
pre {
|
|
23
|
+
margin: 0;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Remove heading elements default style
|
|
27
|
+
h1,
|
|
28
|
+
h2,
|
|
29
|
+
h3,
|
|
30
|
+
h4,
|
|
31
|
+
h5,
|
|
32
|
+
h6 {
|
|
33
|
+
font-size: inherit;
|
|
34
|
+
font-weight: inherit;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Remove list elements default style
|
|
38
|
+
ol,
|
|
39
|
+
ul {
|
|
40
|
+
padding: 0;
|
|
41
|
+
margin: 0;
|
|
42
|
+
list-style: none;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
button {
|
|
46
|
+
border: 0;
|
|
47
|
+
outline: none;
|
|
48
|
+
background-color: transparent;
|
|
49
|
+
box-shadow: none;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
html {
|
|
53
|
+
font-size: 100%;
|
|
54
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/* SQ-DISABLE */
|
|
2
|
+
@use "sass:math";
|
|
3
|
+
/* SQ-ENABLE */
|
|
4
|
+
|
|
5
|
+
@import "~include-media/dist/include-media";
|
|
6
|
+
|
|
7
|
+
// Include Media Overwrites //////////////////////////
|
|
8
|
+
|
|
9
|
+
$breakpoints: (
|
|
10
|
+
"phone": 320px,
|
|
11
|
+
"phonemid": 375px,
|
|
12
|
+
"tablet": 768px,
|
|
13
|
+
"notebook": 1280px,
|
|
14
|
+
"desktop": 1440px,
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
// Px to rem.
|
|
18
|
+
$base: 16px !default;
|
|
19
|
+
|
|
20
|
+
@function rem($size) {
|
|
21
|
+
$rem: math.div($size, $base);
|
|
22
|
+
|
|
23
|
+
@return #{$rem}rem;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@mixin input-focus-ring($outline: #{var(--fs-color-focus-ring)}, $border: #{var(--fs-border-color-active)}) {
|
|
27
|
+
@media not all and (min-resolution: .001dpcm) { // Target only Safari browsers
|
|
28
|
+
@supports (-webkit-appearance:none) { // Use `focus` instead of `focus-visible`
|
|
29
|
+
&:hover:focus, // due to Safari's lack of support
|
|
30
|
+
&:focus {
|
|
31
|
+
border-color: $border;
|
|
32
|
+
outline: none;
|
|
33
|
+
box-shadow:
|
|
34
|
+
0 0 0 1px var(--fs-color-body-bkg),
|
|
35
|
+
0 0 0 var(--fs-border-width-thickest) $outline,
|
|
36
|
+
inset 0 0 0 var(--fs-border-width) $border;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&:focus-visible,
|
|
42
|
+
&:hover:focus-visible {
|
|
43
|
+
border-color: $border;
|
|
44
|
+
outline: none;
|
|
45
|
+
box-shadow:
|
|
46
|
+
0 0 0 1px var(--fs-color-body-bkg),
|
|
47
|
+
0 0 0 var(--fs-border-width-thickest) $outline,
|
|
48
|
+
inset 0 0 0 var(--fs-border-width) $border;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@mixin focus-ring {
|
|
53
|
+
outline: none;
|
|
54
|
+
box-shadow: 0 0 0 1px var(--fs-color-body-bkg), 0 0 0 var(--fs-border-width-thickest) var(--fs-color-focus-ring);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
@mixin focus-ring-visible {
|
|
58
|
+
@media not all and (min-resolution: .001dpcm) { // Target only Safari browsers
|
|
59
|
+
@supports (-webkit-appearance:none) { // Use `focus` instead of `focus-visible`
|
|
60
|
+
&:focus { @include focus-ring; } // due to Safari's lack of support
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
&:focus-visible { @include focus-ring; }
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
@mixin truncate-title($max-lines: var(--fs-text-max-lines)) {
|
|
67
|
+
display: -webkit-box;
|
|
68
|
+
overflow: hidden;
|
|
69
|
+
-webkit-box-orient: vertical;
|
|
70
|
+
-moz-box-orient: vertical;
|
|
71
|
+
-webkit-line-clamp: $max-lines;
|
|
72
|
+
line-clamp: $max-lines;
|
|
73
|
+
text-overflow: -o-ellipsis-lastline;
|
|
74
|
+
text-overflow: ellipsis;
|
|
75
|
+
}
|
package/src/typings/utils.d.ts
CHANGED
package/dist/assets/index.d.ts
DELETED
package/dist/assets/index.js
DELETED
package/dist/assets/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/assets/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAA;AACxD,OAAO,EAAE,OAAO,IAAI,CAAC,EAAE,MAAM,KAAK,CAAA"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { render } from '@testing-library/react'
|
|
3
|
-
import { axe } from 'jest-axe'
|
|
4
|
-
|
|
5
|
-
import Badge from './Badge'
|
|
6
|
-
|
|
7
|
-
describe('Badge', () => {
|
|
8
|
-
it('should have `data-fs-badge` attribute', () => {
|
|
9
|
-
const { getByText } = render(<Badge>-25%</Badge>)
|
|
10
|
-
|
|
11
|
-
const renderedBadge = getByText('-25%')
|
|
12
|
-
|
|
13
|
-
expect(renderedBadge).toHaveAttribute('data-fs-badge')
|
|
14
|
-
})
|
|
15
|
-
|
|
16
|
-
describe('Accessibility', () => {
|
|
17
|
-
it('should not have violations', async () => {
|
|
18
|
-
const { container } = render(<Badge>-25%</Badge>)
|
|
19
|
-
|
|
20
|
-
expect(await axe(container)).toHaveNoViolations()
|
|
21
|
-
})
|
|
22
|
-
})
|
|
23
|
-
})
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { ReactNode, HTMLAttributes } from 'react'
|
|
2
|
-
import React, { forwardRef } from 'react'
|
|
3
|
-
|
|
4
|
-
export interface BadgeProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
-
/**
|
|
6
|
-
* ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
|
|
7
|
-
*/
|
|
8
|
-
testId?: string
|
|
9
|
-
children?: ReactNode
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
const Badge = forwardRef<HTMLDivElement, BadgeProps>(function Badge(
|
|
13
|
-
{ testId = 'store-badge', children, ...otherProps }: BadgeProps,
|
|
14
|
-
ref
|
|
15
|
-
) {
|
|
16
|
-
return (
|
|
17
|
-
<div ref={ref} data-fs-badge data-testid={testId} {...otherProps}>
|
|
18
|
-
{children}
|
|
19
|
-
</div>
|
|
20
|
-
)
|
|
21
|
-
})
|
|
22
|
-
|
|
23
|
-
export default Badge
|
package/src/atoms/Badge/index.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Story, Canvas, ArgsTable } from '@storybook/addon-docs'
|
|
2
|
-
import Badge from '../Badge'
|
|
3
|
-
|
|
4
|
-
# Badge
|
|
5
|
-
|
|
6
|
-
<Canvas>
|
|
7
|
-
<Story id="atoms-badge--badge" />
|
|
8
|
-
</Canvas>
|
|
9
|
-
|
|
10
|
-
## Props
|
|
11
|
-
|
|
12
|
-
<ArgsTable of={Badge} />
|
|
13
|
-
|
|
14
|
-
## CSS Selectors
|
|
15
|
-
|
|
16
|
-
```css
|
|
17
|
-
[data-fs-badge] {}
|
|
18
|
-
```
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import type { Story } from '@storybook/react'
|
|
2
|
-
import React from 'react'
|
|
3
|
-
|
|
4
|
-
import type { ComponentArgTypes } from '../../../typings/utils'
|
|
5
|
-
import Component from '../Badge'
|
|
6
|
-
import mdx from './Badge.mdx'
|
|
7
|
-
|
|
8
|
-
interface StoryControls {
|
|
9
|
-
badgeText: string
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
const BadgeTemplate: Story<StoryControls> = ({ badgeText }) => (
|
|
13
|
-
<Component>{badgeText}</Component>
|
|
14
|
-
)
|
|
15
|
-
|
|
16
|
-
export const Badge = BadgeTemplate.bind({})
|
|
17
|
-
|
|
18
|
-
const argTypes: ComponentArgTypes<StoryControls> = {
|
|
19
|
-
badgeText: {
|
|
20
|
-
name: 'Badge text',
|
|
21
|
-
control: {
|
|
22
|
-
type: 'text',
|
|
23
|
-
},
|
|
24
|
-
defaultValue: '-25%',
|
|
25
|
-
},
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export default {
|
|
29
|
-
title: 'Atoms/Badge',
|
|
30
|
-
component: Badge,
|
|
31
|
-
argTypes,
|
|
32
|
-
parameters: {
|
|
33
|
-
docs: {
|
|
34
|
-
page: mdx,
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { render } from '@testing-library/react'
|
|
2
|
-
import React from 'react'
|
|
3
|
-
|
|
4
|
-
import Button from './Button'
|
|
5
|
-
|
|
6
|
-
describe('Button', () => {
|
|
7
|
-
it('`data-fs-button` is present', () => {
|
|
8
|
-
const { getByText } = render(<Button>Hello World!</Button>)
|
|
9
|
-
|
|
10
|
-
expect(getByText('Hello World!')).toHaveAttribute('data-fs-button')
|
|
11
|
-
})
|
|
12
|
-
})
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { ButtonHTMLAttributes } from 'react'
|
|
2
|
-
import React, { forwardRef } from 'react'
|
|
3
|
-
|
|
4
|
-
export interface ButtonProps<T = HTMLButtonElement>
|
|
5
|
-
extends ButtonHTMLAttributes<T> {
|
|
6
|
-
/**
|
|
7
|
-
* ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
|
|
8
|
-
*/
|
|
9
|
-
testId?: string
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
const Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(
|
|
13
|
-
{ children, testId = 'store-button', ...otherProps },
|
|
14
|
-
ref
|
|
15
|
-
) {
|
|
16
|
-
return (
|
|
17
|
-
<button ref={ref} data-fs-button data-testid={testId} {...otherProps}>
|
|
18
|
-
{children}
|
|
19
|
-
</button>
|
|
20
|
-
)
|
|
21
|
-
})
|
|
22
|
-
|
|
23
|
-
export default Button
|