sprint-asia-custom-component 0.1.142 → 0.1.144

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
@@ -23901,7 +23901,7 @@
23901
23901
  };
23902
23902
 
23903
23903
  // THIS FILE IS AUTO GENERATED
23904
- function FaFileAlt(props){return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 384 512"},"child":[{"tag":"path","attr":{"d":"M224 136V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V160H248c-13.2 0-24-10.8-24-24zm64 236c0 6.6-5.4 12-12 12H108c-6.6 0-12-5.4-12-12v-8c0-6.6 5.4-12 12-12h168c6.6 0 12 5.4 12 12v8zm0-64c0 6.6-5.4 12-12 12H108c-6.6 0-12-5.4-12-12v-8c0-6.6 5.4-12 12-12h168c6.6 0 12 5.4 12 12v8zm0-72v8c0 6.6-5.4 12-12 12H108c-6.6 0-12-5.4-12-12v-8c0-6.6 5.4-12 12-12h168c6.6 0 12 5.4 12 12zm96-114.1v6.1H256V0h6.1c6.4 0 12.5 2.5 17 7l97.9 98c4.5 4.5 7 10.6 7 16.9z"}}]})(props);}function FaFileImage(props){return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 384 512"},"child":[{"tag":"path","attr":{"d":"M384 121.941V128H256V0h6.059a24 24 0 0 1 16.97 7.029l97.941 97.941a24.002 24.002 0 0 1 7.03 16.971zM248 160c-13.2 0-24-10.8-24-24V0H24C10.745 0 0 10.745 0 24v464c0 13.255 10.745 24 24 24h336c13.255 0 24-10.745 24-24V160H248zm-135.455 16c26.51 0 48 21.49 48 48s-21.49 48-48 48-48-21.49-48-48 21.491-48 48-48zm208 240h-256l.485-48.485L104.545 328c4.686-4.686 11.799-4.201 16.485.485L160.545 368 264.06 264.485c4.686-4.686 12.284-4.686 16.971 0L320.545 304v112z"}}]})(props);}
23904
+ function FaChevronDown(props){return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 448 512"},"child":[{"tag":"path","attr":{"d":"M207.029 381.476L12.686 187.132c-9.373-9.373-9.373-24.569 0-33.941l22.667-22.667c9.357-9.357 24.522-9.375 33.901-.04L224 284.505l154.745-154.021c9.379-9.335 24.544-9.317 33.901.04l22.667 22.667c9.373 9.373 9.373 24.569 0 33.941L240.971 381.476c-9.373 9.372-24.569 9.372-33.942 0z"}}]})(props);}function FaFileAlt(props){return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 384 512"},"child":[{"tag":"path","attr":{"d":"M224 136V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V160H248c-13.2 0-24-10.8-24-24zm64 236c0 6.6-5.4 12-12 12H108c-6.6 0-12-5.4-12-12v-8c0-6.6 5.4-12 12-12h168c6.6 0 12 5.4 12 12v8zm0-64c0 6.6-5.4 12-12 12H108c-6.6 0-12-5.4-12-12v-8c0-6.6 5.4-12 12-12h168c6.6 0 12 5.4 12 12v8zm0-72v8c0 6.6-5.4 12-12 12H108c-6.6 0-12-5.4-12-12v-8c0-6.6 5.4-12 12-12h168c6.6 0 12 5.4 12 12zm96-114.1v6.1H256V0h6.1c6.4 0 12.5 2.5 17 7l97.9 98c4.5 4.5 7 10.6 7 16.9z"}}]})(props);}function FaFileImage(props){return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 384 512"},"child":[{"tag":"path","attr":{"d":"M384 121.941V128H256V0h6.059a24 24 0 0 1 16.97 7.029l97.941 97.941a24.002 24.002 0 0 1 7.03 16.971zM248 160c-13.2 0-24-10.8-24-24V0H24C10.745 0 0 10.745 0 24v464c0 13.255 10.745 24 24 24h336c13.255 0 24-10.745 24-24V160H248zm-135.455 16c26.51 0 48 21.49 48 48s-21.49 48-48 48-48-21.49-48-48 21.491-48 48-48zm208 240h-256l.485-48.485L104.545 328c4.686-4.686 11.799-4.201 16.485.485L160.545 368 264.06 264.485c4.686-4.686 12.284-4.686 16.971 0L320.545 304v112z"}}]})(props);}
23905
23905
 
23906
23906
  const DescriptionFile = ({
23907
23907
  title = "Title",
@@ -48834,6 +48834,74 @@
48834
48834
  }, footer)));
48835
48835
  };
48836
48836
 
48837
+ const DropdownButton = ({
48838
+ defaultType = 'Voucher Type'
48839
+ }) => {
48840
+ const [isOpen, setIsOpen] = React.useState(false);
48841
+ const [selectedValue, setSelectedValue] = React.useState(defaultType);
48842
+ const toggleDropdown = () => {
48843
+ setIsOpen(!isOpen);
48844
+ };
48845
+ const handleOptionClick = value => {
48846
+ setSelectedValue(value);
48847
+ setIsOpen(false);
48848
+ };
48849
+ return /*#__PURE__*/React__default["default"].createElement("div", {
48850
+ style: {
48851
+ position: 'relative',
48852
+ display: 'inline-block'
48853
+ }
48854
+ }, /*#__PURE__*/React__default["default"].createElement("button", {
48855
+ onClick: toggleDropdown,
48856
+ style: {
48857
+ display: 'flex',
48858
+ alignItems: 'center',
48859
+ justifyContent: 'space-between',
48860
+ border: '1px solid #007bff',
48861
+ background: '#fff',
48862
+ color: '#007bff',
48863
+ borderRadius: '5px',
48864
+ padding: '10px 15px',
48865
+ cursor: 'pointer',
48866
+ fontSize: '16px',
48867
+ fontWeight: 'bold'
48868
+ }
48869
+ }, selectedValue, /*#__PURE__*/React__default["default"].createElement(FaChevronDown, {
48870
+ style: {
48871
+ marginLeft: '8px'
48872
+ }
48873
+ })), isOpen && /*#__PURE__*/React__default["default"].createElement("div", {
48874
+ style: {
48875
+ position: 'absolute',
48876
+ top: '100%',
48877
+ left: '0',
48878
+ background: '#fff',
48879
+ boxShadow: '0 4px 6px rgba(0, 0, 0, 0.1)',
48880
+ borderRadius: '5px',
48881
+ marginTop: '8px',
48882
+ zIndex: 10
48883
+ }
48884
+ }, /*#__PURE__*/React__default["default"].createElement("ul", {
48885
+ style: {
48886
+ listStyle: 'none',
48887
+ margin: 0,
48888
+ padding: '10px 0'
48889
+ }
48890
+ }, /*#__PURE__*/React__default["default"].createElement("li", {
48891
+ style: {
48892
+ padding: '10px 20px',
48893
+ cursor: 'pointer'
48894
+ },
48895
+ onClick: () => handleOptionClick('Digital Voucher')
48896
+ }, "Digital Voucher"), /*#__PURE__*/React__default["default"].createElement("li", {
48897
+ style: {
48898
+ padding: '10px 20px',
48899
+ cursor: 'pointer'
48900
+ },
48901
+ onClick: () => handleOptionClick('PPOB Voucher')
48902
+ }, "PPOB Voucher"))));
48903
+ };
48904
+
48837
48905
  exports.Alert = Alert;
48838
48906
  exports.BillerList = BillerList;
48839
48907
  exports.BillerProductList = BillerProductList;
@@ -48855,6 +48923,7 @@
48855
48923
  exports.Description = Description;
48856
48924
  exports.DescriptionFile = DescriptionFile;
48857
48925
  exports.DetailDivision = DetailDivision;
48926
+ exports.DropdownButton = DropdownButton;
48858
48927
  exports.DropdownCard = DropdownCard;
48859
48928
  exports.DropdownChip = DropdownChip;
48860
48929
  exports.DropdownText = DropdownText;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sprint-asia-custom-component",
3
3
  "main": "dist/index.js",
4
- "version": "0.1.142",
4
+ "version": "0.1.144",
5
5
  "private": false,
6
6
  "dependencies": {
7
7
  "@headlessui/react": "^1.7.18",
@@ -54,7 +54,7 @@
54
54
  "@rollup/plugin-json": "^6.1.0",
55
55
  "@rollup/plugin-node-resolve": "^15.2.3",
56
56
  "postcss": "^8.4.35",
57
- "rollup": "^2.79.1",
57
+ "rollup": "^2.79.2",
58
58
  "rollup-plugin-babel": "^4.4.0",
59
59
  "rollup-plugin-postcss": "^4.0.2"
60
60
  }
@@ -0,0 +1,71 @@
1
+ import React, { useState } from 'react';
2
+ import { FaChevronDown } from 'react-icons/fa'; // Install dengan `npm install react-icons`
3
+
4
+ const DropdownButton = ({ defaultType = 'Voucher Type' }) => {
5
+ const [isOpen, setIsOpen] = useState(false);
6
+ const [selectedValue, setSelectedValue] = useState(defaultType);
7
+
8
+ const toggleDropdown = () => {
9
+ setIsOpen(!isOpen);
10
+ };
11
+
12
+ const handleOptionClick = (value) => {
13
+ setSelectedValue(value);
14
+ setIsOpen(false);
15
+ };
16
+
17
+ return (
18
+ <div style={{ position: 'relative', display: 'inline-block' }}>
19
+ <button
20
+ onClick={toggleDropdown}
21
+ style={{
22
+ display: 'flex',
23
+ alignItems: 'center',
24
+ justifyContent: 'space-between',
25
+ border: '1px solid #007bff',
26
+ background: '#fff',
27
+ color: '#007bff',
28
+ borderRadius: '5px',
29
+ padding: '10px 15px',
30
+ cursor: 'pointer',
31
+ fontSize: '16px',
32
+ fontWeight: 'bold',
33
+ }}
34
+ >
35
+ {selectedValue}
36
+ <FaChevronDown style={{ marginLeft: '8px' }} />
37
+ </button>
38
+ {isOpen && (
39
+ <div
40
+ style={{
41
+ position: 'absolute',
42
+ top: '100%',
43
+ left: '0',
44
+ background: '#fff',
45
+ boxShadow: '0 4px 6px rgba(0, 0, 0, 0.1)',
46
+ borderRadius: '5px',
47
+ marginTop: '8px',
48
+ zIndex: 10,
49
+ }}
50
+ >
51
+ <ul style={{ listStyle: 'none', margin: 0, padding: '10px 0' }}>
52
+ <li
53
+ style={{ padding: '10px 20px', cursor: 'pointer' }}
54
+ onClick={() => handleOptionClick('Digital Voucher')}
55
+ >
56
+ Digital Voucher
57
+ </li>
58
+ <li
59
+ style={{ padding: '10px 20px', cursor: 'pointer' }}
60
+ onClick={() => handleOptionClick('PPOB Voucher')}
61
+ >
62
+ PPOB Voucher
63
+ </li>
64
+ </ul>
65
+ </div>
66
+ )}
67
+ </div>
68
+ );
69
+ };
70
+
71
+ export default DropdownButton;
package/src/index.js CHANGED
@@ -90,6 +90,7 @@ import Header from "./components/header";
90
90
  import TextEditor from "./components/texteditor";
91
91
  import CustomPhone from "./components/customphone";
92
92
  import TextArea from "./components/textarea";
93
+ import DropdownButton from "./components/dropdownbutton";
93
94
 
94
95
  export {
95
96
  Header,
@@ -152,4 +153,5 @@ export {
152
153
  TextEditor,
153
154
  CustomPhone,
154
155
  TextArea,
156
+ DropdownButton,
155
157
  };
@@ -62,6 +62,7 @@ import CellModelSeven from "../components/table/listTable/cellmodelseven";
62
62
  import CustomPhone from "../components/customphone";
63
63
  import DescriptionFile from "../components/description/file";
64
64
  import FilterCheckboxDropdown from "../components/filter/filterCheckboxDropdown";
65
+ import DropdownButton from "../components/dropdownbutton";
65
66
 
66
67
  const Templates = () => {
67
68
  const [startDate, setStartDate] = useState(null);
@@ -862,9 +863,9 @@ const Templates = () => {
862
863
  titleRightButton="Submit"
863
864
  isActiveLeftButton
864
865
  isActiveRightButton
865
- onClickLeftButton={() => {}}
866
- onClickRightButton={() => {}}
867
- additionalButton={<PrimaryButton title={"Additional"} onClick={() => {}} isActive={true} />}
866
+ onClickLeftButton={() => { }}
867
+ onClickRightButton={() => { }}
868
+ additionalButton={<PrimaryButton title={"Additional"} onClick={() => { }} isActive={true} />}
868
869
  />
869
870
  </div>
870
871
 
@@ -1094,18 +1095,24 @@ const Templates = () => {
1094
1095
  onChangeEndDate={setEndDate}
1095
1096
  />
1096
1097
 
1098
+ <div className="m-9"></div>
1099
+ <p className="text-black font-bold text-2xl text-center py-2">Dropdown Button</p>
1100
+ <DropdownButton
1101
+ defaultType="Voucher Type"
1102
+ />
1103
+
1097
1104
  <div className="m-9"></div>
1098
1105
  <p className="text-black font-bold text-2xl text-center py-2">Description</p>
1099
1106
  <Description
1100
1107
  title="Sample Title"
1101
1108
  value={"This is a sample description.\n HHEHEEH \n LOh"}
1102
- // image="https://static.promediateknologi.id/crop/0x0:0x0/0x0/webp/photo/jawapos/2022/09/one-piece-red.jpeg"
1109
+ // image="https://static.promediateknologi.id/crop/0x0:0x0/0x0/webp/photo/jawapos/2022/09/one-piece-red.jpeg"
1103
1110
  />
1104
1111
  <Description
1105
1112
  title="Sample Title"
1106
1113
  value={"This is a sample description.\n HHEHEEH \n LOh"}
1107
1114
  icon={<PiCalendarBlank size={20} />}
1108
- // image="https://static.promediateknologi.id/crop/0x0:0x0/0x0/webp/photo/jawapos/2022/09/one-piece-red.jpeg"
1115
+ // image="https://static.promediateknologi.id/crop/0x0:0x0/0x0/webp/photo/jawapos/2022/09/one-piece-red.jpeg"
1109
1116
  />
1110
1117
 
1111
1118
  <div className="m-9"></div>
@@ -1174,20 +1181,20 @@ const Templates = () => {
1174
1181
  <FilterText options={["Option 1", "Option 2", "Option 3"]} onSelect={handleSelect} />
1175
1182
 
1176
1183
  <div className="m-9"></div>
1177
- <FilterCheckboxDropdown
1184
+ <FilterCheckboxDropdown
1178
1185
  options={[
1179
1186
  {
1180
- option : "Option1",
1181
- value : "value 1"
1187
+ option: "Option1",
1188
+ value: "value 1"
1182
1189
  },
1183
1190
  {
1184
- option : "Option2",
1185
- value : "value 2"
1191
+ option: "Option2",
1192
+ value: "value 2"
1186
1193
  },
1187
1194
  ]}
1188
1195
  buttonText="Division"
1189
1196
  currentValue={valueSelectFilter}
1190
- onSelect={setValueSelectFilter}
1197
+ onSelect={setValueSelectFilter}
1191
1198
  />
1192
1199
 
1193
1200
  {