@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.
- package/dist/components/PromoCode/index.d.ts +2 -4
- package/dist/components/PromoCode/index.js +28 -28
- package/dist/main.d.ts +1 -0
- package/dist/main.js +20 -18
- package/package.json +1 -1
|
@@ -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
|
|
24
|
-
export
|
|
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
|
|
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
|
-
|
|
6
|
+
function K({
|
|
7
7
|
value: e,
|
|
8
|
-
onChange:
|
|
9
|
-
onApply:
|
|
10
|
-
onRemove:
|
|
8
|
+
onChange: d,
|
|
9
|
+
onApply: f,
|
|
10
|
+
onRemove: m,
|
|
11
11
|
isLoading: x = !1,
|
|
12
12
|
isApplied: y = !1,
|
|
13
|
-
discountLabel:
|
|
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 =
|
|
22
|
-
e?.trim() &&
|
|
23
|
-
}, [e,
|
|
24
|
-
(
|
|
25
|
-
|
|
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 =
|
|
28
|
+
), g = n(() => {
|
|
29
29
|
if (!e?.trim()) {
|
|
30
30
|
p(!1);
|
|
31
31
|
return;
|
|
32
32
|
}
|
|
33
33
|
t();
|
|
34
|
-
}, [e, t]), z =
|
|
35
|
-
|
|
36
|
-
}, [
|
|
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
|
-
|
|
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:
|
|
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: (
|
|
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: (
|
|
93
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
|
10
|
-
import { LinearProgress as
|
|
11
|
-
import { MediaCardWithAction as
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
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
|
-
|
|
20
|
+
m as Button,
|
|
20
21
|
a as CheckBox,
|
|
21
22
|
B as CheckboxGroup,
|
|
22
23
|
i as Dialog,
|
|
23
|
-
|
|
24
|
+
u as Dropdown,
|
|
24
25
|
b as FlatBanner,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
S as
|
|
31
|
-
w as
|
|
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
|
};
|