@plurix/ecom-components 1.11.6 → 1.13.0-club.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/README.md +76 -76
- package/package.json +71 -70
- package/dist/assets/svgs/ArrowIcon.d.ts +0 -9
- package/dist/assets/svgs/ArrowIcon.js +0 -38
- package/dist/assets/svgs/CartEmptyCoupon.d.ts +0 -1
- package/dist/assets/svgs/CartEmptyCoupon.js +0 -937
- package/dist/assets/svgs/CloseIcon.d.ts +0 -7
- package/dist/assets/svgs/CloseIcon.js +0 -41
- package/dist/assets/svgs/CouponIcon.d.ts +0 -4
- package/dist/assets/svgs/CouponIcon.js +0 -22
- package/dist/assets/svgs/DeliveryExpressIcon.d.ts +0 -1
- package/dist/assets/svgs/DeliveryExpressIcon.js +0 -21
- package/dist/assets/svgs/DeliveryIcon.d.ts +0 -1
- package/dist/assets/svgs/DeliveryIcon.js +0 -21
- package/dist/assets/svgs/DiscountIcon.d.ts +0 -1
- package/dist/assets/svgs/DiscountIcon.js +0 -37
- package/dist/assets/svgs/ErrorIcon.d.ts +0 -5
- package/dist/assets/svgs/ErrorIcon.js +0 -29
- package/dist/assets/svgs/FacebookIcon.d.ts +0 -1
- package/dist/assets/svgs/FacebookIcon.js +0 -22
- package/dist/assets/svgs/GlassIcon.d.ts +0 -1
- package/dist/assets/svgs/GlassIcon.js +0 -23
- package/dist/assets/svgs/GroceriesShopping.d.ts +0 -1
- package/dist/assets/svgs/GroceriesShopping.js +0 -8892
- package/dist/assets/svgs/InfoIcon.d.ts +0 -6
- package/dist/assets/svgs/InfoIcon.js +0 -47
- package/dist/assets/svgs/InstagramIcon.d.ts +0 -1
- package/dist/assets/svgs/InstagramIcon.js +0 -49
- package/dist/assets/svgs/NoCouponIcon.d.ts +0 -6
- package/dist/assets/svgs/NoCouponIcon.js +0 -676
- package/dist/assets/svgs/ShoppingBagsIcon.d.ts +0 -1
- package/dist/assets/svgs/ShoppingBagsIcon.js +0 -30
- package/dist/assets/svgs/ShoppingIcon.d.ts +0 -1
- package/dist/assets/svgs/ShoppingIcon.js +0 -21
- package/dist/assets/svgs/SuccessIcon.d.ts +0 -6
- package/dist/assets/svgs/SuccessIcon.js +0 -38
- package/dist/assets/svgs/WarningIcon.d.ts +0 -1
- package/dist/assets/svgs/WarningIcon.js +0 -25
- package/dist/constants/index.d.ts +0 -2
- package/dist/constants/index.js +0 -5
- package/dist/hooks/useAnalitcsEvents.d.ts +0 -4
- package/dist/hooks/useAnalitcsEvents.js +0 -11
- package/dist/main.d.ts +0 -13
- package/dist/main.js +0 -20
- package/dist/packages/Carousel/Carousel.d.ts +0 -26
- package/dist/packages/Carousel/Carousel.js +0 -132
- package/dist/packages/Carousel/components/Arrows.d.ts +0 -8
- package/dist/packages/Carousel/components/Arrows.js +0 -43
- package/dist/packages/Carousel/components/Bullets.d.ts +0 -8
- package/dist/packages/Carousel/components/Bullets.js +0 -13
- package/dist/packages/Carousel/utils/defaultProps.d.ts +0 -19
- package/dist/packages/Carousel/utils/defaultProps.js +0 -22
- package/dist/packages/CartClubAlert/CartClubAlert.d.ts +0 -9
- package/dist/packages/CartClubAlert/CartClubAlert.js +0 -27
- package/dist/packages/ChangeOrderModal/ChangeOrderModal.d.ts +0 -18
- package/dist/packages/ChangeOrderModal/ChangeOrderModal.js +0 -105
- package/dist/packages/ChangeOrderModal/api/getOrderForm.d.ts +0 -1
- package/dist/packages/ChangeOrderModal/api/getOrderForm.js +0 -25
- package/dist/packages/ChangeOrderModal/api/getProductsSimilars.d.ts +0 -12
- package/dist/packages/ChangeOrderModal/api/getProductsSimilars.js +0 -33
- package/dist/packages/ChangeOrderModal/api/postChangeOrder.d.ts +0 -1
- package/dist/packages/ChangeOrderModal/api/postChangeOrder.js +0 -32
- package/dist/packages/ChangeOrderModal/assets/icons.d.ts +0 -9
- package/dist/packages/ChangeOrderModal/assets/icons.js +0 -72
- package/dist/packages/ChangeOrderModal/components/ModalFooter.d.ts +0 -3
- package/dist/packages/ChangeOrderModal/components/ModalFooter.js +0 -14
- package/dist/packages/ChangeOrderModal/components/NoSimilarProduct.d.ts +0 -1
- package/dist/packages/ChangeOrderModal/components/NoSimilarProduct.js +0 -9
- package/dist/packages/ChangeOrderModal/components/ProductSelected.d.ts +0 -15
- package/dist/packages/ChangeOrderModal/components/ProductSelected.js +0 -41
- package/dist/packages/ChangeOrderModal/components/SimilarProductList.d.ts +0 -9
- package/dist/packages/ChangeOrderModal/components/SimilarProductList.js +0 -110
- package/dist/packages/ChangeOrderModal/components/SimilarProducts.d.ts +0 -11
- package/dist/packages/ChangeOrderModal/components/SimilarProducts.js +0 -35
- package/dist/packages/ChangeOrderModal/mocks.d.ts +0 -115
- package/dist/packages/ChangeOrderModal/mocks.js +0 -285
- package/dist/packages/Coupons/Coupons.d.ts +0 -17
- package/dist/packages/Coupons/Coupons.js +0 -110
- package/dist/packages/Coupons/api/addCoupon.d.ts +0 -3
- package/dist/packages/Coupons/api/addCoupon.js +0 -14
- package/dist/packages/Coupons/api/getCoupons.d.ts +0 -3
- package/dist/packages/Coupons/api/getCoupons.js +0 -8
- package/dist/packages/Coupons/api/removeCoupon.d.ts +0 -3
- package/dist/packages/Coupons/api/removeCoupon.js +0 -13
- package/dist/packages/Coupons/components/Alert.d.ts +0 -6
- package/dist/packages/Coupons/components/Alert.js +0 -13
- package/dist/packages/Coupons/components/Breadcrumb.d.ts +0 -6
- package/dist/packages/Coupons/components/Breadcrumb.js +0 -33
- package/dist/packages/Coupons/components/CouponCard.d.ts +0 -25
- package/dist/packages/Coupons/components/CouponCard.js +0 -132
- package/dist/packages/Coupons/components/Modal.d.ts +0 -8
- package/dist/packages/Coupons/components/Modal.js +0 -34
- package/dist/packages/Coupons/components/ModalFooter.d.ts +0 -9
- package/dist/packages/Coupons/components/ModalFooter.js +0 -25
- package/dist/packages/Coupons/components/ModalHeader.d.ts +0 -6
- package/dist/packages/Coupons/components/ModalHeader.js +0 -25
- package/dist/packages/Coupons/components/NoCoupons.d.ts +0 -1
- package/dist/packages/Coupons/components/NoCoupons.js +0 -10
- package/dist/packages/Coupons/types/CouponType.d.ts +0 -8
- package/dist/packages/Coupons/types/CouponType.js +0 -1
- package/dist/packages/Coupons/types/SetOrderFormCouponResponse.d.ts +0 -10
- package/dist/packages/Coupons/types/SetOrderFormCouponResponse.js +0 -1
- package/dist/packages/Coupons/types/Views.d.ts +0 -1
- package/dist/packages/Coupons/types/Views.js +0 -1
- package/dist/packages/Coupons/views/CouponsView.d.ts +0 -13
- package/dist/packages/Coupons/views/CouponsView.js +0 -122
- package/dist/packages/Coupons/views/EmptyCartView.d.ts +0 -6
- package/dist/packages/Coupons/views/EmptyCartView.js +0 -36
- package/dist/packages/Coupons/views/LoadingView.d.ts +0 -7
- package/dist/packages/Coupons/views/LoadingView.js +0 -39
- package/dist/packages/Coupons/views/OverwriteView.d.ts +0 -14
- package/dist/packages/Coupons/views/OverwriteView.js +0 -58
- package/dist/packages/Coupons/views/RulesView.d.ts +0 -13
- package/dist/packages/Coupons/views/RulesView.js +0 -49
- package/dist/packages/Coupons/views/index.d.ts +0 -5
- package/dist/packages/Coupons/views/index.js +0 -12
- package/dist/packages/Modal/Modal.d.ts +0 -16
- package/dist/packages/Modal/Modal.js +0 -62
- package/dist/packages/Onboarding/Onboarding.d.ts +0 -10
- package/dist/packages/Onboarding/Onboarding.js +0 -47
- package/dist/packages/Onboarding/components/Bullets.d.ts +0 -5
- package/dist/packages/Onboarding/components/Bullets.js +0 -10
- package/dist/packages/Onboarding/components/Content.d.ts +0 -9
- package/dist/packages/Onboarding/components/Content.js +0 -30
- package/dist/packages/Onboarding/components/Footer.d.ts +0 -9
- package/dist/packages/Onboarding/components/Footer.js +0 -15
- package/dist/packages/Onboarding/components/Header.d.ts +0 -6
- package/dist/packages/Onboarding/components/Header.js +0 -15
- package/dist/packages/Onboarding/components/SocialMedia.d.ts +0 -10
- package/dist/packages/Onboarding/components/SocialMedia.js +0 -36
- package/dist/packages/Onboarding/constants/tips.d.ts +0 -11
- package/dist/packages/Onboarding/constants/tips.js +0 -36
- package/dist/packages/Onboarding/tips/Tip1.d.ts +0 -1
- package/dist/packages/Onboarding/tips/Tip1.js +0 -2130
- package/dist/packages/Onboarding/tips/Tip2.d.ts +0 -1
- package/dist/packages/Onboarding/tips/Tip2.js +0 -350
- package/dist/packages/Onboarding/tips/Tip3.d.ts +0 -1
- package/dist/packages/Onboarding/tips/Tip3.js +0 -361
- package/dist/packages/Onboarding/tips/Tip4.d.ts +0 -1
- package/dist/packages/Onboarding/tips/Tip4.js +0 -593
- package/dist/packages/Onboarding/tips/Tip5.d.ts +0 -1
- package/dist/packages/Onboarding/tips/Tip5.js +0 -1571
- package/dist/packages/Regionalization/Regionalization.d.ts +0 -3
- package/dist/packages/Regionalization/Regionalization.js +0 -93
- package/dist/packages/Regionalization/components/Delivery.d.ts +0 -24
- package/dist/packages/Regionalization/components/Delivery.js +0 -48
- package/dist/packages/Regionalization/components/DeliveryExpress.d.ts +0 -9
- package/dist/packages/Regionalization/components/DeliveryExpress.js +0 -25
- package/dist/packages/Regionalization/components/InfoPrices.d.ts +0 -9
- package/dist/packages/Regionalization/components/InfoPrices.js +0 -15
- package/dist/packages/Regionalization/components/Navigation.d.ts +0 -6
- package/dist/packages/Regionalization/components/Navigation.js +0 -59
- package/dist/packages/Regionalization/components/NormalDelivery.d.ts +0 -7
- package/dist/packages/Regionalization/components/NormalDelivery.js +0 -23
- package/dist/packages/Regionalization/components/PickupPoint.d.ts +0 -7
- package/dist/packages/Regionalization/components/PickupPoint.js +0 -32
- package/dist/packages/Regionalization/components/Price.d.ts +0 -7
- package/dist/packages/Regionalization/components/Price.js +0 -10
- package/dist/packages/Regionalization/components/SetViewButton.d.ts +0 -11
- package/dist/packages/Regionalization/components/SetViewButton.js +0 -24
- package/dist/packages/Regionalization/components/Title.d.ts +0 -8
- package/dist/packages/Regionalization/components/Title.js +0 -21
- package/dist/packages/Regionalization/context/RegionalizationContext.d.ts +0 -4
- package/dist/packages/Regionalization/context/RegionalizationContext.js +0 -113
- package/dist/packages/Regionalization/types/Address.d.ts +0 -13
- package/dist/packages/Regionalization/types/Address.js +0 -1
- package/dist/packages/Regionalization/types/ContextProps.d.ts +0 -29
- package/dist/packages/Regionalization/types/ContextProps.js +0 -1
- package/dist/packages/Regionalization/types/PikcupPointType.d.ts +0 -22
- package/dist/packages/Regionalization/types/PikcupPointType.js +0 -1
- package/dist/packages/Regionalization/types/PricesAndHours.d.ts +0 -13
- package/dist/packages/Regionalization/types/PricesAndHours.js +0 -1
- package/dist/packages/Regionalization/types/RegionalizationProps.d.ts +0 -87
- package/dist/packages/Regionalization/types/RegionalizationProps.js +0 -1
- package/dist/packages/Regionalization/types/index.d.ts +0 -5
- package/dist/packages/Regionalization/types/index.js +0 -1
- package/dist/packages/Regionalization/utils/deliverySetData.d.ts +0 -3
- package/dist/packages/Regionalization/utils/deliverySetData.js +0 -13
- package/dist/packages/Regionalization/utils/formatPrice.d.ts +0 -1
- package/dist/packages/Regionalization/utils/formatPrice.js +0 -8
- package/dist/packages/Regionalization/utils/localStorage.d.ts +0 -9
- package/dist/packages/Regionalization/utils/localStorage.js +0 -23
- package/dist/packages/Regionalization/utils/pickupSetData.d.ts +0 -3
- package/dist/packages/Regionalization/utils/pickupSetData.js +0 -11
- package/dist/packages/Regionalization/utils/postalCode.d.ts +0 -3
- package/dist/packages/Regionalization/utils/postalCode.js +0 -9
- package/dist/packages/Regionalization/views/AllStoresScreen.d.ts +0 -1
- package/dist/packages/Regionalization/views/AllStoresScreen.js +0 -73
- package/dist/packages/Regionalization/views/ConfirmScreen.d.ts +0 -1
- package/dist/packages/Regionalization/views/ConfirmScreen.js +0 -60
- package/dist/packages/Regionalization/views/InitialView.d.ts +0 -1
- package/dist/packages/Regionalization/views/InitialView.js +0 -49
- package/dist/packages/Regionalization/views/MoreInfosScreen.d.ts +0 -1
- package/dist/packages/Regionalization/views/MoreInfosScreen.js +0 -42
- package/dist/packages/Regionalization/views/PickupPointInfoScreen.d.ts +0 -1
- package/dist/packages/Regionalization/views/PickupPointInfoScreen.js +0 -42
- package/dist/packages/Regionalization/views/PostalCodeInputScreen.d.ts +0 -1
- package/dist/packages/Regionalization/views/PostalCodeInputScreen.js +0 -87
- package/dist/packages/Regionalization/views/ViewsContainer.d.ts +0 -1
- package/dist/packages/Regionalization/views/ViewsContainer.js +0 -22
- package/dist/packages/SearchSugestions/components/Button/index.d.ts +0 -13
- package/dist/packages/SearchSugestions/components/Button/index.js +0 -48
- package/dist/packages/SearchSugestions/components/Button/showMoreOrLess.d.ts +0 -1
- package/dist/packages/SearchSugestions/components/Button/showMoreOrLess.js +0 -6
- package/dist/packages/SearchSugestions/components/Link/index.d.ts +0 -10
- package/dist/packages/SearchSugestions/components/Link/index.js +0 -34
- package/dist/packages/SearchSugestions/components/Link/navigation.d.ts +0 -1
- package/dist/packages/SearchSugestions/components/Link/navigation.js +0 -8
- package/dist/packages/SearchSugestions/components/SearchSuggestions/index.d.ts +0 -4
- package/dist/packages/SearchSugestions/components/SearchSuggestions/index.js +0 -83
- package/dist/packages/SearchSugestions/components/SearchText/Index.d.ts +0 -10
- package/dist/packages/SearchSugestions/components/SearchText/Index.js +0 -37
- package/dist/packages/SearchSugestions/index.d.ts +0 -3
- package/dist/packages/SearchSugestions/index.js +0 -4
- package/dist/packages/SearchSugestions/mocks.d.ts +0 -4
- package/dist/packages/SearchSugestions/mocks.js +0 -16
- package/dist/packages/SearchSugestions/styles/baseAllSuggestionsContainerStyle.d.ts +0 -3
- package/dist/packages/SearchSugestions/styles/baseAllSuggestionsContainerStyle.js +0 -10
- package/dist/packages/SearchSugestions/styles/baseButtonHoveredStyle.d.ts +0 -3
- package/dist/packages/SearchSugestions/styles/baseButtonHoveredStyle.js +0 -7
- package/dist/packages/SearchSugestions/styles/baseButtonStyle.d.ts +0 -3
- package/dist/packages/SearchSugestions/styles/baseButtonStyle.js +0 -13
- package/dist/packages/SearchSugestions/styles/baseSearchForStyle.d.ts +0 -3
- package/dist/packages/SearchSugestions/styles/baseSearchForStyle.js +0 -9
- package/dist/packages/SearchSugestions/styles/baseSearchForTermStyle.d.ts +0 -3
- package/dist/packages/SearchSugestions/styles/baseSearchForTermStyle.js +0 -8
- package/dist/packages/SearchSugestions/styles/baseSuggestionLinkHoveredStyle.d.ts +0 -3
- package/dist/packages/SearchSugestions/styles/baseSuggestionLinkHoveredStyle.js +0 -7
- package/dist/packages/SearchSugestions/styles/baseSuggestionLinkStyle.d.ts +0 -3
- package/dist/packages/SearchSugestions/styles/baseSuggestionLinkStyle.js +0 -14
- package/dist/packages/SearchSugestions/styles/baseTitleStyle.d.ts +0 -3
- package/dist/packages/SearchSugestions/styles/baseTitleStyle.js +0 -9
- package/dist/packages/SearchSugestions/types/ResponseApi.d.ts +0 -10
- package/dist/packages/SearchSugestions/types/ResponseApi.js +0 -1
- package/dist/packages/SearchSugestions/types/SearchSuggestionsProps.d.ts +0 -24
- package/dist/packages/SearchSugestions/types/SearchSuggestionsProps.js +0 -1
- package/dist/packages/Tour/Tour.d.ts +0 -10
- package/dist/packages/Tour/Tour.js +0 -68
- package/dist/packages/Tour/components/TooltipFooter.d.ts +0 -11
- package/dist/packages/Tour/components/TooltipFooter.js +0 -14
- package/dist/packages/Tour/components/TooltipHeader.d.ts +0 -8
- package/dist/packages/Tour/components/TooltipHeader.js +0 -13
- package/dist/packages/Tour/components/TourOverlay.d.ts +0 -7
- package/dist/packages/Tour/components/TourOverlay.js +0 -12
- package/dist/packages/Tour/components/TourTooltip.d.ts +0 -17
- package/dist/packages/Tour/components/TourTooltip.js +0 -42
- package/dist/packages/Tour/types/TourStep.d.ts +0 -4
- package/dist/packages/Tour/types/TourStep.js +0 -1
- package/dist/styles/carousel.global.css +0 -1
- package/dist/styles/cart-club-alert.global.css +0 -1
- package/dist/styles/change-order-modal.global.css +0 -1
- package/dist/styles/coupons.global.css +0 -1
- package/dist/styles/modal.global.css +0 -1
- package/dist/styles/onboarding.global.css +0 -1
- package/dist/styles/regionalization.global.css +0 -1
- package/dist/styles/tour.global.css +0 -1
- package/dist/types/ChangeOrderModal.d.ts +0 -47
- package/dist/types/ChangeOrderModal.js +0 -1
- package/dist/types/FixedLengthArray.d.ts +0 -7
- package/dist/types/FixedLengthArray.js +0 -1
- package/dist/types/OrderForm.d.ts +0 -16
- package/dist/types/OrderForm.js +0 -1
- package/dist/types/global.d.js +0 -1
- package/dist/utils/changerOrderModal.d.ts +0 -8
- package/dist/utils/changerOrderModal.js +0 -31
- package/dist/vite-env.d.js +0 -1
package/README.md
CHANGED
|
@@ -1,76 +1,76 @@
|
|
|
1
|
-
# @plurix/ecom-components
|
|
2
|
-
|
|
3
|
-
## Dependencies
|
|
4
|
-
|
|
5
|
-
Use `yarn` to install all dependencies and prepare `husky` (used to run scripts in git steps).
|
|
6
|
-
|
|
7
|
-
## Folder Structure
|
|
8
|
-
|
|
9
|
-
- `lib`: files that will be compiled and published in the `@plurix/ecom-components` package
|
|
10
|
-
- `src`: local development
|
|
11
|
-
|
|
12
|
-
## How to Create a New Component in the Package
|
|
13
|
-
|
|
14
|
-
- Create a new folder in `lib/packages`, with your component name. Example: `MyComponent`;
|
|
15
|
-
- Create a `.tsx` file inside this new folder and export a component from there. Example:
|
|
16
|
-
|
|
17
|
-
```tsx
|
|
18
|
-
// lib/packages/MyComponent/MyComponent.tsx
|
|
19
|
-
|
|
20
|
-
export const MyComponent = () => {
|
|
21
|
-
return <h1>My Component</h1>
|
|
22
|
-
}
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
- Export the new component in `lib/main.ts`. Example:
|
|
26
|
-
|
|
27
|
-
```tsx
|
|
28
|
-
// lib/main.ts
|
|
29
|
-
|
|
30
|
-
export { MyComponent } from './packages/MyComponent/MyComponent'
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
- Create a new file called `<component-name>Example.tsx` in `src/examples` and import your component. Example:
|
|
34
|
-
|
|
35
|
-
```tsx
|
|
36
|
-
// src/examples/MyComponentExample.tsx
|
|
37
|
-
|
|
38
|
-
import { MyComponent } from '../../lib/main'
|
|
39
|
-
|
|
40
|
-
export const MyComponentExample = () => {
|
|
41
|
-
return (
|
|
42
|
-
<div className="my-component-example-container">
|
|
43
|
-
<MyComponent />
|
|
44
|
-
</div>
|
|
45
|
-
)
|
|
46
|
-
}
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
- Export the new example component in `src/index.ts`. Example:
|
|
50
|
-
|
|
51
|
-
```tsx
|
|
52
|
-
// src/examples/index.ts
|
|
53
|
-
|
|
54
|
-
export { MyComponentExample } from './MyComponentExample'
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
- Run `yarn dev`;
|
|
58
|
-
- Open the localhost link in the terminal;
|
|
59
|
-
- Choose your component in the sidebar. Now, you can develop your component and test it with `fast refresh`.
|
|
60
|
-
|
|
61
|
-
OBS: If you need to use `css` in your components, create them as `<component-name>.global.css` and import them in your Lib Component. Then, you are able to use that in `VTEX IO` and `VTEX Faststore`.
|
|
62
|
-
|
|
63
|
-

|
|
64
|
-
|
|
65
|
-
## Publishing
|
|
66
|
-
|
|
67
|
-
- After finishing your component changes, upgrade the package version in `package.json` and create an entry in `CHANGELOG.md`.
|
|
68
|
-
- Commit and push your changes to the remote repository. It will run the husky scripts: commitlint, prettier, lint, tests, and build.
|
|
69
|
-
- After all scripts pass successfully, run `npm publish` in your terminal.
|
|
70
|
-
- Copy the published version from your terminal and install it in another repository.
|
|
71
|
-
- You can import the new component by using:
|
|
72
|
-
|
|
73
|
-
```tsx
|
|
74
|
-
import { MyComponent } from '@plurix/ecom-components'
|
|
75
|
-
import '@plurix/ecom-components/dist/styles/my-component.global.css' // If you are using css
|
|
76
|
-
```
|
|
1
|
+
# @plurix/ecom-components
|
|
2
|
+
|
|
3
|
+
## Dependencies
|
|
4
|
+
|
|
5
|
+
Use `yarn` to install all dependencies and prepare `husky` (used to run scripts in git steps).
|
|
6
|
+
|
|
7
|
+
## Folder Structure
|
|
8
|
+
|
|
9
|
+
- `lib`: files that will be compiled and published in the `@plurix/ecom-components` package
|
|
10
|
+
- `src`: local development
|
|
11
|
+
|
|
12
|
+
## How to Create a New Component in the Package
|
|
13
|
+
|
|
14
|
+
- Create a new folder in `lib/packages`, with your component name. Example: `MyComponent`;
|
|
15
|
+
- Create a `.tsx` file inside this new folder and export a component from there. Example:
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
// lib/packages/MyComponent/MyComponent.tsx
|
|
19
|
+
|
|
20
|
+
export const MyComponent = () => {
|
|
21
|
+
return <h1>My Component</h1>
|
|
22
|
+
}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
- Export the new component in `lib/main.ts`. Example:
|
|
26
|
+
|
|
27
|
+
```tsx
|
|
28
|
+
// lib/main.ts
|
|
29
|
+
|
|
30
|
+
export { MyComponent } from './packages/MyComponent/MyComponent'
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
- Create a new file called `<component-name>Example.tsx` in `src/examples` and import your component. Example:
|
|
34
|
+
|
|
35
|
+
```tsx
|
|
36
|
+
// src/examples/MyComponentExample.tsx
|
|
37
|
+
|
|
38
|
+
import { MyComponent } from '../../lib/main'
|
|
39
|
+
|
|
40
|
+
export const MyComponentExample = () => {
|
|
41
|
+
return (
|
|
42
|
+
<div className="my-component-example-container">
|
|
43
|
+
<MyComponent />
|
|
44
|
+
</div>
|
|
45
|
+
)
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
- Export the new example component in `src/index.ts`. Example:
|
|
50
|
+
|
|
51
|
+
```tsx
|
|
52
|
+
// src/examples/index.ts
|
|
53
|
+
|
|
54
|
+
export { MyComponentExample } from './MyComponentExample'
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
- Run `yarn dev`;
|
|
58
|
+
- Open the localhost link in the terminal;
|
|
59
|
+
- Choose your component in the sidebar. Now, you can develop your component and test it with `fast refresh`.
|
|
60
|
+
|
|
61
|
+
OBS: If you need to use `css` in your components, create them as `<component-name>.global.css` and import them in your Lib Component. Then, you are able to use that in `VTEX IO` and `VTEX Faststore`.
|
|
62
|
+
|
|
63
|
+

|
|
64
|
+
|
|
65
|
+
## Publishing
|
|
66
|
+
|
|
67
|
+
- After finishing your component changes, upgrade the package version in `package.json` and create an entry in `CHANGELOG.md`.
|
|
68
|
+
- Commit and push your changes to the remote repository. It will run the husky scripts: commitlint, prettier, lint, tests, and build.
|
|
69
|
+
- After all scripts pass successfully, run `npm publish` in your terminal.
|
|
70
|
+
- Copy the published version from your terminal and install it in another repository.
|
|
71
|
+
- You can import the new component by using:
|
|
72
|
+
|
|
73
|
+
```tsx
|
|
74
|
+
import { MyComponent } from '@plurix/ecom-components'
|
|
75
|
+
import '@plurix/ecom-components/dist/styles/my-component.global.css' // If you are using css
|
|
76
|
+
```
|
package/package.json
CHANGED
|
@@ -1,70 +1,71 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@plurix/ecom-components",
|
|
3
|
-
"author": "Plurix",
|
|
4
|
-
"private": false,
|
|
5
|
-
"version": "1.
|
|
6
|
-
"type": "module",
|
|
7
|
-
"main": "dist/main.js",
|
|
8
|
-
"types": "dist/main.d.ts",
|
|
9
|
-
"files": [
|
|
10
|
-
"dist"
|
|
11
|
-
],
|
|
12
|
-
"repository": {
|
|
13
|
-
"type": "git",
|
|
14
|
-
"url": "https://github.com/plurix-ecommerce/ecom-components"
|
|
15
|
-
},
|
|
16
|
-
"sideEffects": [
|
|
17
|
-
"**/*.css"
|
|
18
|
-
],
|
|
19
|
-
"scripts": {
|
|
20
|
-
"dev": "vite",
|
|
21
|
-
"build": "tsc --p ./tsconfig-build.json && vite build",
|
|
22
|
-
"format": "prettier --write .",
|
|
23
|
-
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
|
24
|
-
"prepare": "husky install",
|
|
25
|
-
"preview": "vite preview",
|
|
26
|
-
"test": "jest"
|
|
27
|
-
},
|
|
28
|
-
"peerDependencies": {
|
|
29
|
-
"react": "^18.2.0",
|
|
30
|
-
"react-dom": "^18.2.0"
|
|
31
|
-
},
|
|
32
|
-
"devDependencies": {
|
|
33
|
-
"@babel/preset-env": "^7.24.5",
|
|
34
|
-
"@babel/preset-react": "^7.24.1",
|
|
35
|
-
"@commitlint/cli": "^17.4.2",
|
|
36
|
-
"@commitlint/config-conventional": "^17.4.2",
|
|
37
|
-
"@jest/globals": "^29.7.0",
|
|
38
|
-
"@testing-library/jest-dom": "^6.4.5",
|
|
39
|
-
"@testing-library/react": "^15.0.7",
|
|
40
|
-
"@types/jest": "^29.5.12",
|
|
41
|
-
"@types/node": "^20.11.30",
|
|
42
|
-
"@types/react": "^18.2.71",
|
|
43
|
-
"@types/react-dom": "^18.2.22",
|
|
44
|
-
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
|
45
|
-
"@typescript-eslint/parser": "^6.21.0",
|
|
46
|
-
"@vitejs/plugin-react": "^4.2.1",
|
|
47
|
-
"eslint": "^8.57.0",
|
|
48
|
-
"eslint-plugin-react-hooks": "^4.6.0",
|
|
49
|
-
"eslint-plugin-react-refresh": "^0.4.6",
|
|
50
|
-
"glob": "^10.3.10",
|
|
51
|
-
"husky": "^9.0.11",
|
|
52
|
-
"identity-obj-proxy": "^3.0.0",
|
|
53
|
-
"jest": "^29.7.0",
|
|
54
|
-
"jest-environment-jsdom": "^29.7.0",
|
|
55
|
-
"jest-svg-transformer": "^1.0.0",
|
|
56
|
-
"prettier": "^2.2.1",
|
|
57
|
-
"react": "^18.2.0",
|
|
58
|
-
"react-dom": "^18.2.0",
|
|
59
|
-
"rollup-plugin-delete": "^2.0.0",
|
|
60
|
-
"ts-jest": "^29.1.2",
|
|
61
|
-
"typescript": "^5.4.3",
|
|
62
|
-
"vite": "^4.5.3",
|
|
63
|
-
"vite-plugin-dts": "^3.7.3",
|
|
64
|
-
"vite-plugin-lib-inject-css": "^2.0.1"
|
|
65
|
-
},
|
|
66
|
-
"dependencies": {
|
|
67
|
-
"@acctglobal/skeleton": "^1.0.0",
|
|
68
|
-
"
|
|
69
|
-
|
|
70
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@plurix/ecom-components",
|
|
3
|
+
"author": "Plurix",
|
|
4
|
+
"private": false,
|
|
5
|
+
"version": "1.13.0-club.0",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "dist/main.js",
|
|
8
|
+
"types": "dist/main.d.ts",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist"
|
|
11
|
+
],
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "git+https://github.com/plurix-ecommerce/ecom-components.git"
|
|
15
|
+
},
|
|
16
|
+
"sideEffects": [
|
|
17
|
+
"**/*.css"
|
|
18
|
+
],
|
|
19
|
+
"scripts": {
|
|
20
|
+
"dev": "vite",
|
|
21
|
+
"build": "tsc --p ./tsconfig-build.json && vite build",
|
|
22
|
+
"format": "prettier --write .",
|
|
23
|
+
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
|
24
|
+
"prepare": "husky install",
|
|
25
|
+
"preview": "vite preview",
|
|
26
|
+
"test": "jest"
|
|
27
|
+
},
|
|
28
|
+
"peerDependencies": {
|
|
29
|
+
"react": "^18.2.0",
|
|
30
|
+
"react-dom": "^18.2.0"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@babel/preset-env": "^7.24.5",
|
|
34
|
+
"@babel/preset-react": "^7.24.1",
|
|
35
|
+
"@commitlint/cli": "^17.4.2",
|
|
36
|
+
"@commitlint/config-conventional": "^17.4.2",
|
|
37
|
+
"@jest/globals": "^29.7.0",
|
|
38
|
+
"@testing-library/jest-dom": "^6.4.5",
|
|
39
|
+
"@testing-library/react": "^15.0.7",
|
|
40
|
+
"@types/jest": "^29.5.12",
|
|
41
|
+
"@types/node": "^20.11.30",
|
|
42
|
+
"@types/react": "^18.2.71",
|
|
43
|
+
"@types/react-dom": "^18.2.22",
|
|
44
|
+
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
|
45
|
+
"@typescript-eslint/parser": "^6.21.0",
|
|
46
|
+
"@vitejs/plugin-react": "^4.2.1",
|
|
47
|
+
"eslint": "^8.57.0",
|
|
48
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
|
49
|
+
"eslint-plugin-react-refresh": "^0.4.6",
|
|
50
|
+
"glob": "^10.3.10",
|
|
51
|
+
"husky": "^9.0.11",
|
|
52
|
+
"identity-obj-proxy": "^3.0.0",
|
|
53
|
+
"jest": "^29.7.0",
|
|
54
|
+
"jest-environment-jsdom": "^29.7.0",
|
|
55
|
+
"jest-svg-transformer": "^1.0.0",
|
|
56
|
+
"prettier": "^2.2.1",
|
|
57
|
+
"react": "^18.2.0",
|
|
58
|
+
"react-dom": "^18.2.0",
|
|
59
|
+
"rollup-plugin-delete": "^2.0.0",
|
|
60
|
+
"ts-jest": "^29.1.2",
|
|
61
|
+
"typescript": "^5.4.3",
|
|
62
|
+
"vite": "^4.5.3",
|
|
63
|
+
"vite-plugin-dts": "^3.7.3",
|
|
64
|
+
"vite-plugin-lib-inject-css": "^2.0.1"
|
|
65
|
+
},
|
|
66
|
+
"dependencies": {
|
|
67
|
+
"@acctglobal/skeleton": "^1.0.0",
|
|
68
|
+
"@faststore/ui": "^3.41.5",
|
|
69
|
+
"axios": "^1.7.4"
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
interface ArrowIconProps {
|
|
2
|
-
width?: number;
|
|
3
|
-
height?: number;
|
|
4
|
-
color?: string;
|
|
5
|
-
rotate?: Rotate;
|
|
6
|
-
}
|
|
7
|
-
type Rotate = 'Up' | 'Right' | 'Down' | 'Left';
|
|
8
|
-
export declare const ArrowIcon: ({ width, height, color, rotate }: ArrowIconProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export {};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
const i = {
|
|
3
|
-
Up: 90,
|
|
4
|
-
Right: 180,
|
|
5
|
-
Down: 270,
|
|
6
|
-
Left: 0
|
|
7
|
-
}, a = ({
|
|
8
|
-
width: r = 16,
|
|
9
|
-
height: t = 16,
|
|
10
|
-
color: e = "var(--color-grayScale)",
|
|
11
|
-
rotate: n = "Right"
|
|
12
|
-
}) => /* @__PURE__ */ o(
|
|
13
|
-
"svg",
|
|
14
|
-
{
|
|
15
|
-
style: {
|
|
16
|
-
transform: `rotate(${i[n]}deg)`
|
|
17
|
-
},
|
|
18
|
-
width: r,
|
|
19
|
-
height: t,
|
|
20
|
-
viewBox: "0 0 16 16",
|
|
21
|
-
fill: "none",
|
|
22
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
23
|
-
"data-testid": "arrow-icon",
|
|
24
|
-
children: /* @__PURE__ */ o(
|
|
25
|
-
"path",
|
|
26
|
-
{
|
|
27
|
-
d: "M9 4L5 8L9 12",
|
|
28
|
-
stroke: e,
|
|
29
|
-
strokeWidth: "1.5",
|
|
30
|
-
strokeLinecap: "round",
|
|
31
|
-
strokeLinejoin: "round"
|
|
32
|
-
}
|
|
33
|
-
)
|
|
34
|
-
}
|
|
35
|
-
);
|
|
36
|
-
export {
|
|
37
|
-
a as ArrowIcon
|
|
38
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const CartEmptyCoupon: () => import("react/jsx-runtime").JSX.Element;
|