@plurix/ecom-components 0.0.2-beta.4 → 0.0.2-beta.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.
@@ -1,4 +1,4 @@
1
- import { jsxs as x, jsx as v } from "react/jsx-runtime";
1
+ import { jsxs as x, jsx as u } from "react/jsx-runtime";
2
2
  import { SetViewButton as d } from "./SetViewButton.js";
3
3
  import { ArrowIcon as C } from "../../../assets/svgs/ArrowIcon.js";
4
4
  import { useRegionalizationContext as N } from "../context/RegionalizationContext.js";
@@ -13,17 +13,17 @@ const F = ({
13
13
  textBackButton: S,
14
14
  delivery: e,
15
15
  pickup: a,
16
- pickupAddress: t,
16
+ pickupAddress: o,
17
17
  internalMethod: l,
18
18
  regionalizeCatalog: n,
19
- address: o,
19
+ address: t,
20
20
  deliveryRequestInfos: b,
21
21
  postalCode: w,
22
22
  setMethod: r,
23
23
  setCity: m,
24
24
  setUf: c,
25
25
  setPickupName: f,
26
- setPickupTimes: u,
26
+ setPickupTimes: v,
27
27
  pickupTimes: B,
28
28
  setInputPostalCode: p
29
29
  } = N();
@@ -34,12 +34,12 @@ const F = ({
34
34
  view: i ? "InitialView" : h ? "AllStoresScreen" : "PostalCodeInputScreen",
35
35
  className: "back-button",
36
36
  children: [
37
- /* @__PURE__ */ v("span", { children: /* @__PURE__ */ v(C, {}) }),
37
+ /* @__PURE__ */ u("span", { children: /* @__PURE__ */ u(C, { color: "var(--color-main)" }) }),
38
38
  S
39
39
  ]
40
40
  }
41
41
  ),
42
- /* @__PURE__ */ v(
42
+ /* @__PURE__ */ u(
43
43
  d,
44
44
  {
45
45
  view: "InitialView",
@@ -47,7 +47,7 @@ const F = ({
47
47
  className: "continue-button",
48
48
  onClick: () => {
49
49
  var s;
50
- r == null || r(l), l === "delivery" ? (V(o, b, w), m == null || m(o == null ? void 0 : o.localidade), c == null || c(o == null ? void 0 : o.uf), n == null || n(w)) : (p(((s = t == null ? void 0 : t.address) == null ? void 0 : s.postalCode) || ""), j(t, B), f == null || f(t == null ? void 0 : t.name), u == null || u(B), n == null || n(t == null ? void 0 : t.address.postalCode));
50
+ r == null || r(l), l === "delivery" ? (V(t, b, w), m == null || m(t == null ? void 0 : t.localidade), c == null || c(t == null ? void 0 : t.uf), n == null || n(w)) : (p(((s = o == null ? void 0 : o.address) == null ? void 0 : s.postalCode) || ""), j(o, B), f == null || f(o == null ? void 0 : o.name), v == null || v(B), n == null || n(o == null ? void 0 : o.address.postalCode));
51
51
  },
52
52
  children: i ? I : l === "delivery" ? e == null ? void 0 : e.confirmButton : a == null ? void 0 : a.confirmButton
53
53
  }
@@ -7,32 +7,32 @@ import { SetViewButton as N } from "../components/SetViewButton.js";
7
7
  import { ArrowIcon as u } from "../../../assets/svgs/ArrowIcon.js";
8
8
  import { useRegionalizationContext as C } from "../context/RegionalizationContext.js";
9
9
  const E = () => {
10
- const { pickup: t, pickupPoints: l, textBackButton: d } = C(), s = f(null), [n, a] = v(l), m = l.length > 0 ? l : [];
10
+ const { pickup: r, pickupPoints: l, textBackButton: m } = C(), a = f(null), [n, s] = v(l), d = l.length > 0 ? l : [];
11
11
  b(() => {
12
- a(m);
12
+ s(d);
13
13
  }, [l]);
14
14
  const i = () => {
15
- a(
15
+ s(
16
16
  l == null ? void 0 : l.filter(
17
- ({ name: r }) => {
17
+ ({ name: t }) => {
18
18
  var c;
19
- return r.toLowerCase().includes(((c = s.current) == null ? void 0 : c.value.toLowerCase()) ?? "");
19
+ return t.toLowerCase().includes(((c = a.current) == null ? void 0 : c.value.toLowerCase()) ?? "");
20
20
  }
21
21
  )
22
22
  );
23
23
  };
24
24
  return /* @__PURE__ */ o(h, { children: [
25
- /* @__PURE__ */ e(S, { title: t == null ? void 0 : t.title }),
25
+ /* @__PURE__ */ e(S, { title: r == null ? void 0 : r.title }),
26
26
  /* @__PURE__ */ o("div", { className: "stores-filter", children: [
27
- /* @__PURE__ */ e("p", { children: t == null ? void 0 : t.labelFilter }),
27
+ /* @__PURE__ */ e("p", { children: r == null ? void 0 : r.labelFilter }),
28
28
  /* @__PURE__ */ o("div", { children: [
29
29
  /* @__PURE__ */ e(
30
30
  "input",
31
31
  {
32
32
  type: "text",
33
33
  placeholder: "Loja",
34
- ref: s,
35
- onKeyDown: (r) => r.key === "Enter" && i()
34
+ ref: a,
35
+ onKeyDown: (t) => t.key === "Enter" && i()
36
36
  }
37
37
  ),
38
38
  /* @__PURE__ */ e(
@@ -44,15 +44,15 @@ const E = () => {
44
44
  }
45
45
  )
46
46
  ] }),
47
- /* @__PURE__ */ e("div", { className: "divider", children: /* @__PURE__ */ e("span", { children: t == null ? void 0 : t.divider }) })
47
+ /* @__PURE__ */ e("div", { className: "divider", children: /* @__PURE__ */ e("span", { children: r == null ? void 0 : r.divider }) })
48
48
  ] }),
49
- /* @__PURE__ */ e("p", { className: "stores-label", children: t == null ? void 0 : t.labelStores }),
50
- /* @__PURE__ */ e("div", { className: "stores-container", children: n == null ? void 0 : n.map((r) => /* @__PURE__ */ e(
49
+ /* @__PURE__ */ e("p", { className: "stores-label", children: r == null ? void 0 : r.labelStores }),
50
+ /* @__PURE__ */ e("div", { className: "stores-container", children: n == null ? void 0 : n.map((t) => /* @__PURE__ */ e(
51
51
  w,
52
52
  {
53
- pickupPointInfos: r
53
+ pickupPointInfos: t
54
54
  },
55
- r == null ? void 0 : r.id
55
+ t == null ? void 0 : t.id
56
56
  )) }),
57
57
  /* @__PURE__ */ e("br", {}),
58
58
  /* @__PURE__ */ o(
@@ -61,8 +61,8 @@ const E = () => {
61
61
  view: "PickupPointInfoScreen",
62
62
  className: "back-button-all-store",
63
63
  children: [
64
- /* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(u, {}) }),
65
- d
64
+ /* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(u, { color: "var(--color-main)" }) }),
65
+ m
66
66
  ]
67
67
  }
68
68
  )
@@ -1,43 +1,43 @@
1
1
  import { jsxs as i, jsx as e } from "react/jsx-runtime";
2
2
  import { useEffect as p } from "react";
3
3
  import { Title as f } from "../components/Title.js";
4
- import { SetViewButton as t } from "../components/SetViewButton.js";
4
+ import { SetViewButton as n } from "../components/SetViewButton.js";
5
5
  import { ArrowIcon as d } from "../../../assets/svgs/ArrowIcon.js";
6
6
  import { ShoppingBagsIcon as h } from "../../../assets/svgs/ShoppingBagsIcon.js";
7
- import { ShoppingIcon as I } from "../../../assets/svgs/ShoppingIcon.js";
8
- import { useRegionalizationContext as u } from "../context/RegionalizationContext.js";
9
- import { formatPrice as v } from "../utils/formatPrice.js";
7
+ import { ShoppingIcon as v } from "../../../assets/svgs/ShoppingIcon.js";
8
+ import { useRegionalizationContext as I } from "../context/RegionalizationContext.js";
9
+ import { formatPrice as u } from "../utils/formatPrice.js";
10
10
  const R = () => {
11
11
  const {
12
12
  titleText: c,
13
13
  moreInfosText: a,
14
14
  deliveryPrice: m,
15
- priceStockInformation: s,
16
- backToDelivery: n,
15
+ priceStockInformation: l,
16
+ backToDelivery: t,
17
17
  setBackToDelivery: r,
18
18
  status: o,
19
- setStatus: l
20
- } = u();
19
+ setStatus: s
20
+ } = I();
21
21
  return p(() => {
22
- n && (r == null || r(!1)), (o == null ? void 0 : o.status) === "failed" && l({});
23
- }, [n, o]), /* @__PURE__ */ i("div", { className: "inital-view-container", children: [
22
+ t && (r == null || r(!1)), (o == null ? void 0 : o.status) === "failed" && s({});
23
+ }, [t, o]), /* @__PURE__ */ i("div", { className: "inital-view-container", children: [
24
24
  /* @__PURE__ */ e(f, { title: c }),
25
- /* @__PURE__ */ e("p", { className: "price-stock-information", children: s }),
26
- /* @__PURE__ */ i(t, { view: "MoreInfosScreen", className: "more-infos-button", children: [
25
+ /* @__PURE__ */ e("p", { className: "price-stock-information", children: l }),
26
+ /* @__PURE__ */ i(n, { view: "MoreInfosScreen", className: "more-infos-button", children: [
27
27
  a,
28
- /* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(d, {}) })
28
+ /* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(d, { color: "var(--color-main)" }) })
29
29
  ] }),
30
30
  /* @__PURE__ */ i("div", { className: "delivery-option-container", children: [
31
- /* @__PURE__ */ i(t, { view: "PostalCodeInputScreen", className: "option", children: [
31
+ /* @__PURE__ */ i(n, { view: "PostalCodeInputScreen", className: "option", children: [
32
32
  /* @__PURE__ */ e(h, {}),
33
33
  /* @__PURE__ */ e("h4", { children: "Receber em casa" }),
34
34
  /* @__PURE__ */ i("p", { children: [
35
35
  " A partir de ",
36
- v(m ?? 0)
36
+ u(m ?? 0)
37
37
  ] })
38
38
  ] }),
39
- /* @__PURE__ */ i(t, { view: "PickupPointInfoScreen", className: "option", children: [
40
- /* @__PURE__ */ e(I, {}),
39
+ /* @__PURE__ */ i(n, { view: "PickupPointInfoScreen", className: "option", children: [
40
+ /* @__PURE__ */ e(v, {}),
41
41
  /* @__PURE__ */ e("h4", { children: "Retirar na Loja" }),
42
42
  /* @__PURE__ */ e("p", { children: " Grátis" })
43
43
  ] })
@@ -1,14 +1,14 @@
1
- import { jsx as n, jsxs as r } from "react/jsx-runtime";
1
+ import { jsx as r, jsxs as n } from "react/jsx-runtime";
2
2
  import { Title as c } from "../components/Title.js";
3
3
  import { InfoPrices as l } from "../components/InfoPrices.js";
4
4
  import { SetViewButton as i } from "../components/SetViewButton.js";
5
- import { ArrowIcon as s } from "../../../assets/svgs/ArrowIcon.js";
6
- import { useRegionalizationContext as a } from "../context/RegionalizationContext.js";
5
+ import { ArrowIcon as a } from "../../../assets/svgs/ArrowIcon.js";
6
+ import { useRegionalizationContext as s } from "../context/RegionalizationContext.js";
7
7
  const N = () => {
8
- const { pickup: e, textBackButton: t, backToDelivery: o } = a();
9
- return /* @__PURE__ */ n("div", { className: "delivery-pickup-container", children: /* @__PURE__ */ r("div", { className: "content-container", children: [
10
- /* @__PURE__ */ n(c, { title: e == null ? void 0 : e.title }),
11
- /* @__PURE__ */ n(
8
+ const { pickup: e, textBackButton: o, backToDelivery: t } = s();
9
+ return /* @__PURE__ */ r("div", { className: "delivery-pickup-container", children: /* @__PURE__ */ n("div", { className: "content-container", children: [
10
+ /* @__PURE__ */ r(c, { title: e == null ? void 0 : e.title }),
11
+ /* @__PURE__ */ r(
12
12
  l,
13
13
  {
14
14
  containerClassName: "pickup-container",
@@ -17,23 +17,23 @@ const N = () => {
17
17
  price: e == null ? void 0 : e.price
18
18
  }
19
19
  ),
20
- /* @__PURE__ */ r("div", { className: "pickup-instructions", children: [
21
- /* @__PURE__ */ n("p", { children: e == null ? void 0 : e.labelScheduling }),
22
- /* @__PURE__ */ n("span", { children: e == null ? void 0 : e.scheduling })
20
+ /* @__PURE__ */ n("div", { className: "pickup-instructions", children: [
21
+ /* @__PURE__ */ r("p", { children: e == null ? void 0 : e.labelScheduling }),
22
+ /* @__PURE__ */ r("span", { children: e == null ? void 0 : e.scheduling })
23
23
  ] }),
24
- /* @__PURE__ */ r("div", { className: "pickup-open-stores-container", children: [
25
- /* @__PURE__ */ r(
24
+ /* @__PURE__ */ n("div", { className: "pickup-open-stores-container", children: [
25
+ /* @__PURE__ */ n(
26
26
  i,
27
27
  {
28
- view: o ? "PostalCodeInputScreen" : "InitialView",
28
+ view: t ? "PostalCodeInputScreen" : "InitialView",
29
29
  className: "back-button",
30
30
  children: [
31
- /* @__PURE__ */ n("span", { children: /* @__PURE__ */ n(s, {}) }),
32
- t
31
+ /* @__PURE__ */ r("span", { children: /* @__PURE__ */ r(a, { color: "var(--color-main)" }) }),
32
+ o
33
33
  ]
34
34
  }
35
35
  ),
36
- /* @__PURE__ */ n(i, { view: "AllStoresScreen", className: "pickup-open-stores", children: e == null ? void 0 : e.buttonOpenStores })
36
+ /* @__PURE__ */ r(i, { view: "AllStoresScreen", className: "pickup-open-stores", children: e == null ? void 0 : e.buttonOpenStores })
37
37
  ] })
38
38
  ] }) });
39
39
  };
@@ -1,4 +1,4 @@
1
- import { jsx as n, Fragment as f, jsxs as o } from "react/jsx-runtime";
1
+ import { jsx as n, Fragment as f, jsxs as c } from "react/jsx-runtime";
2
2
  import { Title as g } from "../components/Title.js";
3
3
  import { SetViewButton as s } from "../components/SetViewButton.js";
4
4
  import { InfoPrices as k } from "../components/InfoPrices.js";
@@ -11,7 +11,7 @@ const T = () => {
11
11
  const {
12
12
  delivery: e,
13
13
  status: r,
14
- postalCodeValidation: c,
14
+ postalCodeValidation: o,
15
15
  setInputPostalCode: m,
16
16
  postalCode: p,
17
17
  deliveryPrice: h,
@@ -19,9 +19,9 @@ const T = () => {
19
19
  pickup: t,
20
20
  setBackToDelivery: a
21
21
  } = x(), l = (r == null ? void 0 : r.status) === "failed";
22
- return /* @__PURE__ */ n(f, { children: /* @__PURE__ */ n("div", { className: "delivery-pickup-container", children: /* @__PURE__ */ o("div", { className: "content-container", children: [
22
+ return /* @__PURE__ */ n(f, { children: /* @__PURE__ */ n("div", { className: "delivery-pickup-container", children: /* @__PURE__ */ c("div", { className: "content-container", children: [
23
23
  /* @__PURE__ */ n(g, { title: l ? "Tente outro CEP" : e == null ? void 0 : e.title }),
24
- l ? /* @__PURE__ */ o("div", { className: "warning-container", children: [
24
+ l ? /* @__PURE__ */ c("div", { className: "warning-container", children: [
25
25
  /* @__PURE__ */ n(u, {}),
26
26
  /* @__PURE__ */ n("span", { className: "warning-text", children: r == null ? void 0 : r.message })
27
27
  ] }) : /* @__PURE__ */ n(
@@ -33,12 +33,12 @@ const T = () => {
33
33
  price: h
34
34
  }
35
35
  ),
36
- /* @__PURE__ */ o("div", { className: "postal-code-container", children: [
37
- /* @__PURE__ */ o("div", { className: "postal-code-container-action", children: [
36
+ /* @__PURE__ */ c("div", { className: "postal-code-container", children: [
37
+ /* @__PURE__ */ c("div", { className: "postal-code-container-action", children: [
38
38
  /* @__PURE__ */ n(
39
39
  "input",
40
40
  {
41
- onKeyDown: (i) => i.key === "Enter" && (c == null ? void 0 : c()),
41
+ onKeyDown: (i) => i.key === "Enter" && (o == null ? void 0 : o()),
42
42
  type: "text",
43
43
  onChange: (i) => m(i.target.value),
44
44
  maxLength: 9,
@@ -49,17 +49,17 @@ const T = () => {
49
49
  /* @__PURE__ */ n(
50
50
  "button",
51
51
  {
52
- onKeyDown: (i) => i.key === "Enter" && (c == null ? void 0 : c()),
53
- onClick: () => c == null ? void 0 : c(),
52
+ onKeyDown: (i) => i.key === "Enter" && (o == null ? void 0 : o()),
53
+ onClick: () => o == null ? void 0 : o(),
54
54
  disabled: r == null ? void 0 : r.loading,
55
55
  children: r != null && r.loading ? r.message : e == null ? void 0 : e.searchButton
56
56
  }
57
57
  )
58
58
  ] }),
59
59
  /* @__PURE__ */ n("a", { href: e == null ? void 0 : e.linkHref, target: "_blank", className: "", children: e == null ? void 0 : e.linkText }),
60
- l && /* @__PURE__ */ o("div", { className: "postal-code-container-pickup", children: [
60
+ l && /* @__PURE__ */ c("div", { className: "postal-code-container-pickup", children: [
61
61
  /* @__PURE__ */ n("label", { children: "Você pode escolhes retirar na loja" }),
62
- /* @__PURE__ */ o(
62
+ /* @__PURE__ */ c(
63
63
  s,
64
64
  {
65
65
  onClick: () => a == null ? void 0 : a(!0),
@@ -67,7 +67,7 @@ const T = () => {
67
67
  className: "postal-code-container-pickup-select",
68
68
  children: [
69
69
  /* @__PURE__ */ n(N, {}),
70
- /* @__PURE__ */ o("div", { className: "postal-code-container-pickup-select-informative", children: [
70
+ /* @__PURE__ */ c("div", { className: "postal-code-container-pickup-select-informative", children: [
71
71
  /* @__PURE__ */ n("h4", { children: t == null ? void 0 : t.title }),
72
72
  /* @__PURE__ */ n("p", { children: " Grátis" })
73
73
  ] })
@@ -76,8 +76,8 @@ const T = () => {
76
76
  )
77
77
  ] })
78
78
  ] }),
79
- /* @__PURE__ */ o(s, { view: "InitialView", className: "back-button", children: [
80
- /* @__PURE__ */ n("span", { children: /* @__PURE__ */ n(w, {}) }),
79
+ /* @__PURE__ */ c(s, { view: "InitialView", className: "back-button", children: [
80
+ /* @__PURE__ */ n("span", { children: /* @__PURE__ */ n(w, { color: "var(--color-main)" }) }),
81
81
  d
82
82
  ] })
83
83
  ] }) }) });
package/package.json CHANGED
@@ -1,58 +1,58 @@
1
- {
2
- "name": "@plurix/ecom-components",
3
- "author": "Plurix",
4
- "private": false,
5
- "version": "0.0.2-beta.4",
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
- "preview": "vite preview"
25
- },
26
- "peerDependencies": {
27
- "react": "^18.2.0",
28
- "react-dom": "^18.2.0"
29
- },
30
- "devDependencies": {
31
- "@commitlint/cli": "^17.4.2",
32
- "@commitlint/config-conventional": "^17.4.2",
33
- "@testing-library/jest-dom": "^6.4.5",
34
- "@testing-library/react": "^15.0.7",
35
- "@types/jest": "^29.5.12",
36
- "@types/node": "^20.11.30",
37
- "@types/react": "^18.2.71",
38
- "@types/react-dom": "^18.2.22",
39
- "@typescript-eslint/eslint-plugin": "^6.21.0",
40
- "@typescript-eslint/parser": "^6.21.0",
41
- "@vitejs/plugin-react": "^4.2.1",
42
- "eslint": "^8.57.0",
43
- "eslint-plugin-react-hooks": "^4.6.0",
44
- "eslint-plugin-react-refresh": "^0.4.6",
45
- "glob": "^10.3.10",
46
- "prettier": "^2.2.1",
47
- "react": "^18.2.0",
48
- "react-dom": "^18.2.0",
49
- "typescript": "^5.4.3",
50
- "vite": "^4.5.3",
51
- "vite-plugin-dts": "^3.7.3",
52
- "vite-plugin-lib-inject-css": "^2.0.1"
53
- },
54
- "dependencies": {
55
- "@acctglobal/skeleton": "^1.0.0",
56
- "axios": "1.3.0"
57
- }
58
- }
1
+ {
2
+ "name": "@plurix/ecom-components",
3
+ "author": "Plurix",
4
+ "private": false,
5
+ "version": "0.0.2-beta.6",
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
+ "preview": "vite preview"
25
+ },
26
+ "peerDependencies": {
27
+ "react": "^18.2.0",
28
+ "react-dom": "^18.2.0"
29
+ },
30
+ "devDependencies": {
31
+ "@commitlint/cli": "^17.4.2",
32
+ "@commitlint/config-conventional": "^17.4.2",
33
+ "@testing-library/jest-dom": "^6.4.5",
34
+ "@testing-library/react": "^15.0.7",
35
+ "@types/jest": "^29.5.12",
36
+ "@types/node": "^20.11.30",
37
+ "@types/react": "^18.2.71",
38
+ "@types/react-dom": "^18.2.22",
39
+ "@typescript-eslint/eslint-plugin": "^6.21.0",
40
+ "@typescript-eslint/parser": "^6.21.0",
41
+ "@vitejs/plugin-react": "^4.2.1",
42
+ "eslint": "^8.57.0",
43
+ "eslint-plugin-react-hooks": "^4.6.0",
44
+ "eslint-plugin-react-refresh": "^0.4.6",
45
+ "glob": "^10.3.10",
46
+ "prettier": "^2.2.1",
47
+ "react": "^18.2.0",
48
+ "react-dom": "^18.2.0",
49
+ "typescript": "^5.4.3",
50
+ "vite": "^4.5.3",
51
+ "vite-plugin-dts": "^3.7.3",
52
+ "vite-plugin-lib-inject-css": "^2.0.1"
53
+ },
54
+ "dependencies": {
55
+ "@acctglobal/skeleton": "^1.0.0",
56
+ "axios": "1.3.0"
57
+ }
58
+ }