@fangzsx/component-library 0.0.26 → 0.0.27

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,5 +1,3 @@
1
- import { default as React } from 'react';
2
-
3
1
  interface PromoCodeProps {
4
2
  /** Current promo code value */
5
3
  value: string;
@@ -20,5 +18,5 @@ interface PromoCodeProps {
20
18
  /** Input placeholder text */
21
19
  placeholder?: string;
22
20
  }
23
- declare const PromoCode: React.FC<PromoCodeProps>;
24
- export default PromoCode;
21
+ export declare function PromoCode({ value, onChange, onApply, onRemove, isLoading, isApplied, discountLabel, errorMessage, placeholder, }: PromoCodeProps): import("react/jsx-runtime").JSX.Element;
22
+ export {};
@@ -1,39 +1,39 @@
1
1
  import { jsxs as B, jsx as o } from "react/jsx-runtime";
2
2
  import { Close as D, LocalOffer as I } from "@mui/icons-material";
3
3
  import { Box as c, Chip as S, IconButton as A, Typography as h, TextField as R, InputAdornment as T, CircularProgress as W, Button as k } from "@mui/material";
4
- import { useState as w, useRef as O, useEffect as P, useCallback as i } from "react";
4
+ import { useState as w, useRef as O, useEffect as P, useCallback as n } from "react";
5
5
  import { c as r } from "../../colors-DvNGPCDl.js";
6
- const M = ({
6
+ function K({
7
7
  value: e,
8
- onChange: m,
9
- onApply: d,
10
- onRemove: a,
8
+ onChange: d,
9
+ onApply: f,
10
+ onRemove: m,
11
11
  isLoading: x = !1,
12
12
  isApplied: y = !1,
13
- discountLabel: f = "",
13
+ discountLabel: a = "",
14
14
  errorMessage: l = "",
15
15
  placeholder: C = "Add promotional code"
16
- }) => {
16
+ }) {
17
17
  const [s, p] = w(!1), u = O(null);
18
18
  P(() => {
19
19
  s && u.current?.focus();
20
20
  }, [s]);
21
- const t = i(() => {
22
- e?.trim() && d?.();
23
- }, [e, d]), b = i(
24
- (n) => {
25
- n.key === "Enter" && t();
21
+ const t = n(() => {
22
+ e?.trim() && f?.();
23
+ }, [e, f]), b = n(
24
+ (i) => {
25
+ i.key === "Enter" && t();
26
26
  },
27
27
  [t]
28
- ), g = i(() => {
28
+ ), g = n(() => {
29
29
  if (!e?.trim()) {
30
30
  p(!1);
31
31
  return;
32
32
  }
33
33
  t();
34
- }, [e, t]), z = i(() => {
35
- a?.(), p(!1);
36
- }, [a]);
34
+ }, [e, t]), z = n(() => {
35
+ m?.(), p(!1);
36
+ }, [m]);
37
37
  return y ? /* @__PURE__ */ B(c, { mt: 0.5, children: [
38
38
  /* @__PURE__ */ o(
39
39
  S,
@@ -56,7 +56,7 @@ const M = ({
56
56
  }
57
57
  }
58
58
  ),
59
- f && /* @__PURE__ */ o(
59
+ a && /* @__PURE__ */ o(
60
60
  h,
61
61
  {
62
62
  variant: "caption",
@@ -64,7 +64,7 @@ const M = ({
64
64
  color: "text.secondary",
65
65
  display: "block",
66
66
  mt: 0.5,
67
- children: f
67
+ children: a
68
68
  }
69
69
  )
70
70
  ] }) : s ? /* @__PURE__ */ o(c, { mt: 2, children: /* @__PURE__ */ o(
@@ -73,7 +73,7 @@ const M = ({
73
73
  inputRef: u,
74
74
  value: e ?? "",
75
75
  placeholder: C,
76
- onChange: (n) => m?.(n.target.value),
76
+ onChange: (i) => d?.(i.target.value),
77
77
  onBlur: g,
78
78
  onKeyDown: b,
79
79
  error: !!l,
@@ -87,10 +87,9 @@ const M = ({
87
87
  {
88
88
  component: "span",
89
89
  fontWeight: 700,
90
- color: "primary",
91
90
  sx: { cursor: "pointer", fontSize: "0.875rem", color: r.primary500 },
92
- onMouseDown: (n) => {
93
- n.preventDefault(), t();
91
+ onMouseDown: (i) => {
92
+ i.preventDefault(), t();
94
93
  },
95
94
  children: "Apply"
96
95
  }
@@ -98,13 +97,14 @@ const M = ({
98
97
  sx: {
99
98
  borderRadius: "5px",
100
99
  height: 40,
101
- bgcolor: "white",
102
- borderColor: "#C4CBD4"
100
+ bgcolor: "white"
103
101
  }
104
102
  },
105
103
  sx: {
106
104
  "& .MuiOutlinedInput-root": {
107
- "& fieldset": { borderColor: "#C4CBD4" }
105
+ "& fieldset": { borderColor: "#C4CBD4" },
106
+ "&:hover fieldset": { borderColor: "#C4CBD4" },
107
+ "&.Mui-focused fieldset": { borderColor: "#C4CBD4" }
108
108
  }
109
109
  }
110
110
  }
@@ -113,7 +113,7 @@ const M = ({
113
113
  {
114
114
  variant: "text",
115
115
  onClick: () => {
116
- m?.(""), p(!0);
116
+ d?.(""), p(!0);
117
117
  },
118
118
  sx: {
119
119
  bgcolor: r.grey50,
@@ -132,7 +132,7 @@ const M = ({
132
132
  children: "Add promo code"
133
133
  }
134
134
  ) });
135
- };
135
+ }
136
136
  export {
137
- M as default
137
+ K as PromoCode
138
138
  };
package/dist/main.d.ts CHANGED
@@ -9,6 +9,7 @@ export { FlatBanner } from './components/FlatBanner';
9
9
  export { Label } from './components/Label';
10
10
  export { LinearProgress } from './components/LinearProgress';
11
11
  export { MediaCardWithAction } from './components/MediaCardWithAction';
12
+ export { PromoCode } from './components/PromoCode';
12
13
  export { RadioButtonGroup } from './components/RadioButtonGroup';
13
14
  export { Stepper } from './components/Stepper';
14
15
  export { Text } from './components/Text';
package/dist/main.js CHANGED
@@ -1,32 +1,34 @@
1
1
  import { AppBarPublic as e } from "./components/AppBarPublic/index.js";
2
2
  import { Banner as p } from "./components/Banner/index.js";
3
- import { B as f } from "./index-CS-LWC7Z.js";
3
+ import { B as m } from "./index-CS-LWC7Z.js";
4
4
  import { CheckBox as a } from "./components/Checkbox/index.js";
5
5
  import { ScrollableDialog as i } from "./components/Dialog/index.js";
6
6
  import { CheckboxGroup as B } from "./components/CheckboxGroup/index.js";
7
- import { Dropdown as c } from "./components/Dropdown/index.js";
7
+ import { Dropdown as u } from "./components/Dropdown/index.js";
8
8
  import { FlatBanner as b } from "./components/FlatBanner/index.js";
9
- import { Label as g } from "./components/Label/index.js";
10
- import { LinearProgress as C } from "./components/LinearProgress/index.js";
11
- import { MediaCardWithAction as k } from "./components/MediaCardWithAction/index.js";
12
- import { RadioButtonGroup as F } from "./components/RadioButtonGroup/index.js";
13
- import { Stepper as L } from "./components/Stepper/index.js";
14
- import { Text as S } from "./components/Text/index.js";
15
- import { TextFieldInput as w } from "./components/TextFieldInput/index.js";
9
+ import { Label as C } from "./components/Label/index.js";
10
+ import { LinearProgress as h } from "./components/LinearProgress/index.js";
11
+ import { MediaCardWithAction as P } from "./components/MediaCardWithAction/index.js";
12
+ import { PromoCode as A } from "./components/PromoCode/index.js";
13
+ import { RadioButtonGroup as G } from "./components/RadioButtonGroup/index.js";
14
+ import { Stepper as S } from "./components/Stepper/index.js";
15
+ import { Text as w } from "./components/Text/index.js";
16
+ import { TextFieldInput as M } from "./components/TextFieldInput/index.js";
16
17
  export {
17
18
  e as AppBarPublic,
18
19
  p as Banner,
19
- f as Button,
20
+ m as Button,
20
21
  a as CheckBox,
21
22
  B as CheckboxGroup,
22
23
  i as Dialog,
23
- c as Dropdown,
24
+ u as Dropdown,
24
25
  b as FlatBanner,
25
- g as Label,
26
- C as LinearProgress,
27
- k as MediaCardWithAction,
28
- F as RadioButtonGroup,
29
- L as Stepper,
30
- S as Text,
31
- w as TextFieldInput
26
+ C as Label,
27
+ h as LinearProgress,
28
+ P as MediaCardWithAction,
29
+ A as PromoCode,
30
+ G as RadioButtonGroup,
31
+ S as Stepper,
32
+ w as Text,
33
+ M as TextFieldInput
32
34
  };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@fangzsx/component-library",
3
3
  "author": "Jay Gilbert Garzon",
4
4
  "private": false,
5
- "version": "0.0.26",
5
+ "version": "0.0.27",
6
6
  "type": "module",
7
7
  "main": "dist/main.js",
8
8
  "types": "dist/main.d.ts",