@plurix/ecom-components 0.0.2-beta.8 → 1.0.0-SL.1698.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 -48
- package/dist/assets/svgs/ArrowIcon.d.ts +1 -1
- package/dist/assets/svgs/ArrowIcon.js +3 -2
- package/dist/assets/svgs/ErrorIcon.d.ts +1 -1
- package/dist/assets/svgs/NoCouponIcon.d.ts +6 -1
- package/dist/assets/svgs/NoCouponIcon.js +664 -96
- package/dist/main.d.ts +1 -0
- package/dist/main.js +4 -2
- package/dist/packages/Coupons/components/NoCoupons.js +7 -7
- package/dist/packages/Modal/Modal.d.ts +14 -0
- package/dist/packages/Modal/Modal.js +53 -0
- package/dist/packages/Onboarding/constants/tips.js +9 -9
- package/dist/packages/Onboarding/tips/Tip2.js +225 -236
- package/dist/packages/Onboarding/tips/Tip3.js +236 -225
- package/dist/packages/Regionalization/utils/localStorage.js +1 -1
- package/dist/styles/modal.global.css +1 -0
- package/package.json +72 -58
- package/dist/packages/Carousel/test/Carrousel.test.js +0 -80
- package/dist/packages/Coupons/test/Alert.test.js +0 -18
- package/dist/packages/Coupons/test/Breadcrumb.test.js +0 -41
- package/dist/packages/Coupons/test/ModalFooter.test.js +0 -32
- package/dist/packages/Coupons/test/ModalHeader.test.js +0 -23
- package/dist/packages/Coupons/test/NoCoupons.test.js +0 -17
- package/dist/packages/Tour/test/TooltipFooter.test.js +0 -68
- package/dist/packages/Tour/test/TooltipHeader.test.js +0 -18
- package/dist/packages/Tour/test/Tour.test.js +0 -45
- package/dist/packages/Tour/test/TourOverlay.test.js +0 -18
- package/dist/packages/Tour/test/TourTooltip.test.js +0 -40
- /package/dist/{packages/Regionalization/utils/constants.d.ts → constants/index.d.ts} +0 -0
- /package/dist/{packages/Regionalization/utils/constants.js → constants/index.js} +0 -0
package/README.md
CHANGED
|
@@ -1,48 +1,76 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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
|
+
```
|
|
@@ -5,5 +5,5 @@ interface ArrowIconProps {
|
|
|
5
5
|
rotate?: Rotate;
|
|
6
6
|
}
|
|
7
7
|
type Rotate = 'Up' | 'Right' | 'Down' | 'Left';
|
|
8
|
-
export declare const ArrowIcon: ({ width, height, color, rotate
|
|
8
|
+
export declare const ArrowIcon: ({ width, height, color, rotate }: ArrowIconProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
export {};
|
|
@@ -4,7 +4,7 @@ const i = {
|
|
|
4
4
|
Right: 180,
|
|
5
5
|
Down: 270,
|
|
6
6
|
Left: 0
|
|
7
|
-
},
|
|
7
|
+
}, a = ({
|
|
8
8
|
width: r = 16,
|
|
9
9
|
height: t = 16,
|
|
10
10
|
color: e = "var(--color-grayScale)",
|
|
@@ -20,6 +20,7 @@ const i = {
|
|
|
20
20
|
viewBox: "0 0 16 16",
|
|
21
21
|
fill: "none",
|
|
22
22
|
xmlns: "http://www.w3.org/2000/svg",
|
|
23
|
+
"data-testid": "arrow-icon",
|
|
23
24
|
children: /* @__PURE__ */ o(
|
|
24
25
|
"path",
|
|
25
26
|
{
|
|
@@ -33,5 +34,5 @@ const i = {
|
|
|
33
34
|
}
|
|
34
35
|
);
|
|
35
36
|
export {
|
|
36
|
-
|
|
37
|
+
a as ArrowIcon
|
|
37
38
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
interface ErrorIconProps {
|
|
2
2
|
color?: string;
|
|
3
3
|
}
|
|
4
|
-
export declare const ErrorIcon: ({ color
|
|
4
|
+
export declare const ErrorIcon: ({ color }: ErrorIconProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
export {};
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
interface NoCouponsIconProps {
|
|
2
|
+
width?: number;
|
|
3
|
+
height?: number;
|
|
4
|
+
}
|
|
5
|
+
export declare const NoCouponsIcon: ({ width, height }: NoCouponsIconProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|