sprint-asia-custom-component 0.1.119 → 0.1.121
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/index.js
CHANGED
|
@@ -153,6 +153,8 @@
|
|
|
153
153
|
size = "large",
|
|
154
154
|
isIconVisible = false,
|
|
155
155
|
icon = null,
|
|
156
|
+
positionIcon = "left",
|
|
157
|
+
//left, right
|
|
156
158
|
onClick = () => {}
|
|
157
159
|
}) => {
|
|
158
160
|
const [isPressed, setIsPressed] = React.useState(false);
|
|
@@ -185,9 +187,11 @@
|
|
|
185
187
|
onTouchEnd: handleButtonRelease
|
|
186
188
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
187
189
|
className: "flex items-center"
|
|
188
|
-
}, isIconVisible && icon && /*#__PURE__*/React__default["default"].createElement("span", {
|
|
190
|
+
}, isIconVisible && positionIcon == "left" && icon && /*#__PURE__*/React__default["default"].createElement("span", {
|
|
189
191
|
className: "mr-1"
|
|
190
|
-
}, icon), /*#__PURE__*/React__default["default"].createElement("p", null, title)
|
|
192
|
+
}, icon), /*#__PURE__*/React__default["default"].createElement("p", null, title), isIconVisible && positionIcon == "right" && icon && /*#__PURE__*/React__default["default"].createElement("span", {
|
|
193
|
+
className: "ml-1"
|
|
194
|
+
}, icon)));
|
|
191
195
|
};
|
|
192
196
|
|
|
193
197
|
const Alert = ({
|
|
@@ -47946,6 +47950,7 @@
|
|
|
47946
47950
|
|
|
47947
47951
|
var img$6 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAXmSURBVHgBvVhrbBRVFP5mdrvU3ba03XbbVbFbCArIo40aAaMshcQAIiVGG/wDRUhMjLb8ABMTA/yCCJFtTOQHShc1AhoVHwlREtk/lkQTKY+ikDbZUh62tbAt+37MeO7sbnfp7s7c2RK/ZP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J4vW6hmdfHliTqUkuOF101cF1s42S77otiI0NIHTtDOT4/dYRBAGmh0pRajEDM2cT92mKvztA/3aa2M8zg5vc285OMm8SScmqVTftiYkaXL7yAvoHVyrXJdY5sCx+BQYzfboxGmA0mRRR5daqpLjqeYB9Oc1CSYapHj1/bMbQjfmIRMxq03jT1lMWm92jlJ3Jol3ByGgDDbgAQzfnU/vk5MAzawzYvj+rGo+RVa6foTarFq1ZnDxS6PsthNPdmW1m1qNXYKvxUvsXbLWDqKiYfAG0k/XceQUqIsnVI/86Ok5+877qStt2VmPWE6b8IplLq+bdxz/y7ijGxxIFx3uq+TRWPv9Zl7DEc19dnpMsMMLX373n0XADen6YEkslZQjYVuL3WxU54pj11MQx/Hl+7amp4hjybmIxf+1G2RDpFiAX/D4zdDWqHGkr9vxyE4e/2E/pfBBr/o6jrW0DKqzJDy6Xe0JQAz3npwzlofb8fSo4+MYtlwyh4JPNxLW+VYVfT0ygj0T0hg5QfEfgML2M2XXN2EB9tEgc2ztWcA4ZcteuTx/uLCxeAx9svb2Fdg1W6Tu0uL3RfUr7iGE1ag3PqHLJaj5JlHfsOmJ3q/E0E9ZdR+1uYwloX5GOqfEScjhzjrAaVbEaubRRSxyDru8Yh9687YjHpD20LlboO7L7opSpXIl9rJxXi4vwmPGlKRMJPlmQu4xlYdcOVyN3klzchxbCgW23nZIkOemt0SRQ4e+Ht6E/dkJJOKrEeb4GQ+u4LKCX+jwQhd6dn9g9KAL/AeM0NLmkDzUcAAAAAElFTkSuQmCC";
|
|
47948
47952
|
|
|
47953
|
+
/* eslint-disable jsx-a11y/anchor-is-valid */
|
|
47949
47954
|
const Header = ({
|
|
47950
47955
|
title = "Label",
|
|
47951
47956
|
fullName = "Undefined Name",
|
|
@@ -47965,7 +47970,8 @@
|
|
|
47965
47970
|
}],
|
|
47966
47971
|
isNotificationActive = false,
|
|
47967
47972
|
dataNotification = ["Notification 1", "Notification 2"],
|
|
47968
|
-
dataBalance = "0"
|
|
47973
|
+
dataBalance = "0",
|
|
47974
|
+
onClickWallet
|
|
47969
47975
|
}) => {
|
|
47970
47976
|
const [isProfileContentVisible, setProfileContentVisible] = React.useState(false);
|
|
47971
47977
|
const [isNotificationContentVisible, setNotificationContentVisible] = React.useState(false);
|
|
@@ -47987,8 +47993,9 @@
|
|
|
47987
47993
|
className: "text-2xl font-semibold"
|
|
47988
47994
|
}, title), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
47989
47995
|
className: "flex"
|
|
47990
|
-
}, /*#__PURE__*/React__default["default"].createElement("
|
|
47991
|
-
className: "flex items-center"
|
|
47996
|
+
}, /*#__PURE__*/React__default["default"].createElement("a", {
|
|
47997
|
+
className: "flex items-center cursor-pointer",
|
|
47998
|
+
onClick: onClickWallet
|
|
47992
47999
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
47993
48000
|
className: "w-10 h-10 rounded-full border border-neutral40 mr-2 flex items-center justify-center"
|
|
47994
48001
|
}, /*#__PURE__*/React__default["default"].createElement(PiWalletDuotone, {
|
|
@@ -48018,7 +48025,7 @@
|
|
|
48018
48025
|
}, dataNotification.map((value, index) => /*#__PURE__*/React__default["default"].createElement("div", {
|
|
48019
48026
|
key: index,
|
|
48020
48027
|
className: `px-2 flex items-center cursor-pointer bg-white hover:bg-neutral20 p-2
|
|
48021
|
-
${dataProfile.length == 1 ? "rounded-md" : index === 0 ? "rounded-t-md" : index === dataProfile.length - 1 ?
|
|
48028
|
+
${dataProfile.length == 1 ? "rounded-md" : index === 0 ? "rounded-t-md" : index === dataProfile.length - 1 ? "rounded-b-md" : ""}
|
|
48022
48029
|
`,
|
|
48023
48030
|
onClick: value.action
|
|
48024
48031
|
}, /*#__PURE__*/React__default["default"].createElement("p", {
|
|
@@ -48045,7 +48052,7 @@
|
|
|
48045
48052
|
}, dataProfile.map((value, index) => /*#__PURE__*/React__default["default"].createElement("div", {
|
|
48046
48053
|
key: index,
|
|
48047
48054
|
className: `px-2 flex items-center cursor-pointer bg-white hover:bg-neutral20 p-2
|
|
48048
|
-
${dataProfile.length == 1 ? "rounded-md" : index === 0 ? "rounded-t-md" : index === dataProfile.length - 1 ?
|
|
48055
|
+
${dataProfile.length == 1 ? "rounded-md" : index === 0 ? "rounded-t-md" : index === dataProfile.length - 1 ? "rounded-b-md" : ""}
|
|
48049
48056
|
`,
|
|
48050
48057
|
onClick: value.action
|
|
48051
48058
|
}, /*#__PURE__*/React__default["default"].createElement(value.logo, {
|
package/package.json
CHANGED
|
@@ -7,6 +7,7 @@ const PrimaryButton = ({
|
|
|
7
7
|
size = "large",
|
|
8
8
|
isIconVisible = false,
|
|
9
9
|
icon = null,
|
|
10
|
+
positionIcon = "left", //left, right
|
|
10
11
|
onClick = () => {}
|
|
11
12
|
}) => {
|
|
12
13
|
const [isPressed, setIsPressed] = useState(false);
|
|
@@ -46,9 +47,12 @@ const PrimaryButton = ({
|
|
|
46
47
|
>
|
|
47
48
|
<div className='flex items-center'>
|
|
48
49
|
{
|
|
49
|
-
isIconVisible && icon && <span className='mr-1'>{icon}</span>
|
|
50
|
+
isIconVisible && positionIcon == "left" && icon && <span className='mr-1'>{icon}</span>
|
|
50
51
|
}
|
|
51
52
|
<p>{title}</p>
|
|
53
|
+
{
|
|
54
|
+
isIconVisible && positionIcon == "right" && icon && <span className='ml-1'>{icon}</span>
|
|
55
|
+
}
|
|
52
56
|
</div>
|
|
53
57
|
</button>
|
|
54
58
|
);
|
|
@@ -1,134 +1,144 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
/* eslint-disable jsx-a11y/anchor-is-valid */
|
|
2
|
+
import React, { useState, useRef } from "react";
|
|
3
|
+
import Profile from "../../assets/images/profile.png";
|
|
4
|
+
import { PiDoorOpenDuotone, PiUserCircleDuotone, PiBellDuotone, PiWalletDuotone } from "react-icons/pi";
|
|
4
5
|
|
|
5
6
|
const Header = ({
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
7
|
+
title = "Label",
|
|
8
|
+
fullName = "Undefined Name",
|
|
9
|
+
roleName = "Undefined Role",
|
|
10
|
+
dataProfile = [
|
|
11
|
+
{
|
|
12
|
+
title: "Change Password",
|
|
13
|
+
action: () => {
|
|
14
|
+
console.log("Change Password");
|
|
15
|
+
},
|
|
16
|
+
logo: PiUserCircleDuotone,
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
title: "Logout",
|
|
20
|
+
action: () => {
|
|
21
|
+
console.log("Logout");
|
|
22
|
+
},
|
|
23
|
+
logo: PiDoorOpenDuotone,
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
isNotificationActive = false,
|
|
27
|
+
dataNotification = ["Notification 1", "Notification 2"],
|
|
28
|
+
dataBalance = "0",
|
|
29
|
+
onClickWallet,
|
|
16
30
|
}) => {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const modalRefNotification = useRef(null);
|
|
31
|
+
const [isProfileContentVisible, setProfileContentVisible] = useState(false);
|
|
32
|
+
const [isNotificationContentVisible, setNotificationContentVisible] = useState(false);
|
|
33
|
+
const modalRefProfile = useRef(null);
|
|
34
|
+
const modalRefNotification = useRef(null);
|
|
22
35
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
36
|
+
function toggleProfileContent() {
|
|
37
|
+
setProfileContentVisible(!isProfileContentVisible);
|
|
38
|
+
setNotificationContentVisible(false);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function toggleNotificationContent() {
|
|
42
|
+
setNotificationContentVisible(!isNotificationContentVisible);
|
|
43
|
+
setProfileContentVisible(false);
|
|
44
|
+
}
|
|
27
45
|
|
|
28
|
-
function toggleNotificationContent() {
|
|
29
|
-
setNotificationContentVisible(!isNotificationContentVisible)
|
|
30
|
-
setProfileContentVisible(false)
|
|
31
|
-
}
|
|
32
|
-
|
|
33
46
|
return (
|
|
34
|
-
<div className=
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
47
|
+
<div className="w-full h-16 flex items-center bg-white border-b border-neutral40 px-8">
|
|
48
|
+
<div className="flex w-full justify-between items-center">
|
|
49
|
+
<p className="text-2xl font-semibold">{title}</p>
|
|
50
|
+
<div className="flex">
|
|
51
|
+
<a className="flex items-center cursor-pointer" onClick={onClickWallet}>
|
|
52
|
+
<div className="w-10 h-10 rounded-full border border-neutral40 mr-2 flex items-center justify-center">
|
|
53
|
+
<PiWalletDuotone size={24} />
|
|
54
|
+
</div>
|
|
55
|
+
<div>
|
|
56
|
+
<p className="text-neutral300 text-xs">Balance:</p>
|
|
57
|
+
<p className="font-semibold text-black">Rp {dataBalance}</p>
|
|
58
|
+
</div>
|
|
59
|
+
</a>
|
|
60
|
+
<div className="w-px bg-neutral40 h-16 mx-3"></div>
|
|
61
|
+
<div
|
|
62
|
+
className="flex items-center cursor-pointer"
|
|
63
|
+
onClick={toggleNotificationContent}
|
|
64
|
+
ref={modalRefNotification}
|
|
65
|
+
>
|
|
66
|
+
<div className="w-10 h-10 rounded-full border border-neutral40 flex items-center justify-center">
|
|
67
|
+
<div className="relative">
|
|
68
|
+
<PiBellDuotone size={24} />
|
|
69
|
+
{isNotificationActive && (
|
|
70
|
+
<div className="absolute top-0 right-0 border border-white w-2 h-2 rounded-full bg-danger500"></div>
|
|
71
|
+
)}
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
{isNotificationContentVisible && (
|
|
75
|
+
<div className="absolute right-20 top-16 z-50">
|
|
76
|
+
{dataNotification.length !== 0 && (
|
|
77
|
+
<div className="z-50 w-48 bg-white border border-neutral40 rounded-md shadow-md">
|
|
78
|
+
{dataNotification.map((value, index) => (
|
|
79
|
+
<div
|
|
80
|
+
key={index}
|
|
81
|
+
className={`px-2 flex items-center cursor-pointer bg-white hover:bg-neutral20 p-2
|
|
82
|
+
${
|
|
83
|
+
dataProfile.length == 1
|
|
84
|
+
? "rounded-md"
|
|
85
|
+
: index === 0
|
|
86
|
+
? "rounded-t-md"
|
|
87
|
+
: index === dataProfile.length - 1
|
|
88
|
+
? "rounded-b-md"
|
|
89
|
+
: ""
|
|
77
90
|
}
|
|
78
91
|
`}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
index ===
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
index === dataProfile.length - 1 ?
|
|
113
|
-
'rounded-b-md'
|
|
114
|
-
: ""
|
|
92
|
+
onClick={value.action}
|
|
93
|
+
>
|
|
94
|
+
<p className="text-sm">{value}</p>
|
|
95
|
+
</div>
|
|
96
|
+
))}
|
|
97
|
+
</div>
|
|
98
|
+
)}
|
|
99
|
+
</div>
|
|
100
|
+
)}
|
|
101
|
+
</div>
|
|
102
|
+
<div className="w-px bg-neutral40 h-16 mx-3"></div>
|
|
103
|
+
<div className="flex items-center cursor-pointer" onClick={toggleProfileContent} ref={modalRefProfile}>
|
|
104
|
+
<img src={Profile} className="w-10 h-10 mr-2" />
|
|
105
|
+
<div className="flex-1">
|
|
106
|
+
<p className="text-sm text-black font-semibold whitespace-nowrap">{fullName}</p>
|
|
107
|
+
<p className="text-xs text-neutral300 font-normal whitespace-nowrap">{roleName}</p>
|
|
108
|
+
</div>
|
|
109
|
+
{isProfileContentVisible && (
|
|
110
|
+
<div className="absolute right-0 top-16 z-50">
|
|
111
|
+
{dataProfile.length !== 0 && (
|
|
112
|
+
<div className="z-50 w-48 bg-white border border-neutral40 rounded-md shadow-md">
|
|
113
|
+
{dataProfile.map((value, index) => (
|
|
114
|
+
<div
|
|
115
|
+
key={index}
|
|
116
|
+
className={`px-2 flex items-center cursor-pointer bg-white hover:bg-neutral20 p-2
|
|
117
|
+
${
|
|
118
|
+
dataProfile.length == 1
|
|
119
|
+
? "rounded-md"
|
|
120
|
+
: index === 0
|
|
121
|
+
? "rounded-t-md"
|
|
122
|
+
: index === dataProfile.length - 1
|
|
123
|
+
? "rounded-b-md"
|
|
124
|
+
: ""
|
|
115
125
|
}
|
|
116
126
|
`}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
</div>
|
|
127
|
+
onClick={value.action}
|
|
128
|
+
>
|
|
129
|
+
<value.logo size={16} className="text-neutral300 mr-2" />
|
|
130
|
+
<p className="text-sm">{value.title}</p>
|
|
131
|
+
</div>
|
|
132
|
+
))}
|
|
133
|
+
</div>
|
|
134
|
+
)}
|
|
135
|
+
</div>
|
|
136
|
+
)}
|
|
137
|
+
</div>
|
|
129
138
|
</div>
|
|
139
|
+
</div>
|
|
130
140
|
</div>
|
|
131
|
-
)
|
|
132
|
-
}
|
|
141
|
+
);
|
|
142
|
+
};
|
|
133
143
|
|
|
134
|
-
export default Header
|
|
144
|
+
export default Header;
|