sprint-asia-custom-component 0.1.106 → 0.1.108
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
|
@@ -108,6 +108,7 @@
|
|
|
108
108
|
size = "large",
|
|
109
109
|
isIconVisible = false,
|
|
110
110
|
icon = null,
|
|
111
|
+
mode = "primary",
|
|
111
112
|
onClick = () => {}
|
|
112
113
|
}) => {
|
|
113
114
|
const [isPressed, setIsPressed] = React.useState(false);
|
|
@@ -122,16 +123,16 @@
|
|
|
122
123
|
};
|
|
123
124
|
return /*#__PURE__*/React__default["default"].createElement("button", {
|
|
124
125
|
className: `
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
126
|
+
${isPressed && isActive ? `bg-white text-${mode === "danger" ? "danger500" : "primary500"} border-2 border-${mode === "danger" ? "danger500" : "primary500"}` : isActive ? `bg-white border-2 border-${mode === "danger" ? "danger500" : "primary500"} text-${mode === "danger" ? "danger500" : "primary500"}` : "bg-neutral30 text-neutral80 cursor-default"}
|
|
127
|
+
${type === "full" && "w-full"}
|
|
128
|
+
${size === "small" && "text-sm h-7 w-32"}
|
|
129
|
+
${size === "medium" && "text-md h-8"}
|
|
130
|
+
${size === "large" && "text-lg h-10"}
|
|
131
|
+
${size === "very large" && "text-xl h-12"}
|
|
132
|
+
${size === "extra very large" && "text-2xl h-14"}
|
|
133
|
+
${size === "detail division" && "text-sm h-10 w-24"}
|
|
134
|
+
${size === "client approval" && "text-sm h-8"}
|
|
135
|
+
rounded-lg drop-shadow-md text-center py-1.5 px-4 flex justify-center items-center`,
|
|
135
136
|
disabled: !isActive,
|
|
136
137
|
onClick: handleClick,
|
|
137
138
|
onMouseDown: handleButtonPress,
|
|
@@ -47904,7 +47905,7 @@
|
|
|
47904
47905
|
onClickRightButton
|
|
47905
47906
|
}) => {
|
|
47906
47907
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
47907
|
-
className: "fixed bottom-0 flex justify-end w-full items-center py-1 px-6 bg-white z-
|
|
47908
|
+
className: "fixed bottom-0 flex justify-end w-full items-center py-1 px-6 bg-white z-50"
|
|
47908
47909
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
47909
47910
|
className: "flex items-center mr-48"
|
|
47910
47911
|
}, isActiveLeftButton && /*#__PURE__*/React__default["default"].createElement("div", {
|
package/package.json
CHANGED
|
@@ -1,57 +1,65 @@
|
|
|
1
|
-
import React, { useState } from
|
|
1
|
+
import React, { useState } from "react";
|
|
2
2
|
|
|
3
3
|
const OutlineButton = ({
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
title = "Button",
|
|
5
|
+
type = "wrap",
|
|
6
|
+
isActive = true,
|
|
7
|
+
size = "large",
|
|
8
|
+
isIconVisible = false,
|
|
9
|
+
icon = null,
|
|
10
|
+
mode = "primary",
|
|
11
|
+
onClick = () => {},
|
|
11
12
|
}) => {
|
|
12
|
-
|
|
13
|
+
const [isPressed, setIsPressed] = useState(false);
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
const handleButtonPress = () => {
|
|
16
|
+
setIsPressed(true);
|
|
17
|
+
};
|
|
17
18
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
const handleButtonRelease = () => {
|
|
20
|
+
setIsPressed(false);
|
|
21
|
+
};
|
|
21
22
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
const handleClick = () => {
|
|
24
|
+
onClick();
|
|
25
|
+
};
|
|
25
26
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
27
|
+
return (
|
|
28
|
+
<button
|
|
29
|
+
className={`
|
|
30
|
+
${
|
|
31
|
+
isPressed && isActive
|
|
32
|
+
? `bg-white text-${mode === "danger" ? "danger500" : "primary500"} border-2 border-${
|
|
33
|
+
mode === "danger" ? "danger500" : "primary500"
|
|
34
|
+
}`
|
|
35
|
+
: isActive
|
|
36
|
+
? `bg-white border-2 border-${mode === "danger" ? "danger500" : "primary500"} text-${
|
|
37
|
+
mode === "danger" ? "danger500" : "primary500"
|
|
38
|
+
}`
|
|
39
|
+
: "bg-neutral30 text-neutral80 cursor-default"
|
|
40
|
+
}
|
|
41
|
+
${type === "full" && "w-full"}
|
|
42
|
+
${size === "small" && "text-sm h-7 w-32"}
|
|
43
|
+
${size === "medium" && "text-md h-8"}
|
|
44
|
+
${size === "large" && "text-lg h-10"}
|
|
45
|
+
${size === "very large" && "text-xl h-12"}
|
|
46
|
+
${size === "extra very large" && "text-2xl h-14"}
|
|
47
|
+
${size === "detail division" && "text-sm h-10 w-24"}
|
|
48
|
+
${size === "client approval" && "text-sm h-8"}
|
|
49
|
+
rounded-lg drop-shadow-md text-center py-1.5 px-4 flex justify-center items-center`}
|
|
50
|
+
disabled={!isActive}
|
|
51
|
+
onClick={handleClick}
|
|
52
|
+
onMouseDown={handleButtonPress}
|
|
53
|
+
onMouseUp={handleButtonRelease}
|
|
54
|
+
onTouchStart={handleButtonPress}
|
|
55
|
+
onTouchEnd={handleButtonRelease}
|
|
56
|
+
>
|
|
57
|
+
<div className="flex items-center">
|
|
58
|
+
{isIconVisible && icon && <span className="mr-1">{icon}</span>}
|
|
59
|
+
<p>{title}</p>
|
|
60
|
+
</div>
|
|
61
|
+
</button>
|
|
62
|
+
);
|
|
55
63
|
};
|
|
56
64
|
|
|
57
65
|
export default OutlineButton;
|
|
@@ -15,7 +15,7 @@ const Footer = ({
|
|
|
15
15
|
onClickRightButton,
|
|
16
16
|
}) => {
|
|
17
17
|
return (
|
|
18
|
-
<div className="fixed bottom-0 flex justify-end w-full items-center py-1 px-6 bg-white z-
|
|
18
|
+
<div className="fixed bottom-0 flex justify-end w-full items-center py-1 px-6 bg-white z-50">
|
|
19
19
|
<div className="flex items-center mr-48">
|
|
20
20
|
{isActiveLeftButton && (
|
|
21
21
|
<div className="m-1">
|
package/src/templates/index.js
CHANGED
|
@@ -968,7 +968,7 @@ const Templates = () => {
|
|
|
968
968
|
<p className="text-black font-bold text-2xl text-center py-2">Outline Button</p>
|
|
969
969
|
<p className="text-black font-semibold text-xl text-left py-1">Full Width</p>
|
|
970
970
|
<p className="text-black font-normal text-lg text-left py-3">1. Small</p>
|
|
971
|
-
<OutlineButton type="full" size="small" />
|
|
971
|
+
<OutlineButton type="full" size="small" mode="danger" />
|
|
972
972
|
<p className="text-black font-normal text-lg text-left py-3">2. Medium</p>
|
|
973
973
|
<OutlineButton type="full" size="medium" />
|
|
974
974
|
<p className="text-black font-normal text-lg text-left py-3">3. Large</p>
|