sprint-asia-custom-component 0.1.143 → 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
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('.components/dropdownbutton')) :
3
- typeof define === 'function' && define.amd ? define(['exports', 'react', '.components/dropdownbutton'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.MyComponent = {}, global.React, global.dropdownbutton));
5
- })(this, (function (exports, React, dropdownbutton) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', 'react'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.MyComponent = {}, global.React));
5
+ })(this, (function (exports, React) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
@@ -26,7 +26,6 @@
26
26
 
27
27
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
28
28
  var React__namespace = /*#__PURE__*/_interopNamespace(React);
29
- var dropdownbutton__default = /*#__PURE__*/_interopDefaultLegacy(dropdownbutton);
30
29
 
31
30
  var DefaultContext = {
32
31
  color: undefined,
@@ -23902,7 +23901,7 @@
23902
23901
  };
23903
23902
 
23904
23903
  // THIS FILE IS AUTO GENERATED
23905
- 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);}
23906
23905
 
23907
23906
  const DescriptionFile = ({
23908
23907
  title = "Title",
@@ -48835,10 +48834,74 @@
48835
48834
  }, footer)));
48836
48835
  };
48837
48836
 
48838
- Object.defineProperty(exports, 'DropdownButton', {
48839
- enumerable: true,
48840
- get: function () { return dropdownbutton__default["default"]; }
48841
- });
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
+
48842
48905
  exports.Alert = Alert;
48843
48906
  exports.BillerList = BillerList;
48844
48907
  exports.BillerProductList = BillerProductList;
@@ -48860,6 +48923,7 @@
48860
48923
  exports.Description = Description;
48861
48924
  exports.DescriptionFile = DescriptionFile;
48862
48925
  exports.DetailDivision = DetailDivision;
48926
+ exports.DropdownButton = DropdownButton;
48863
48927
  exports.DropdownCard = DropdownCard;
48864
48928
  exports.DropdownChip = DropdownChip;
48865
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.143",
4
+ "version": "0.1.144",
5
5
  "private": false,
6
6
  "dependencies": {
7
7
  "@headlessui/react": "^1.7.18",
package/src/index.js CHANGED
@@ -90,7 +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
+ import DropdownButton from "./components/dropdownbutton";
94
94
 
95
95
  export {
96
96
  Header,