esewa-ui-library 1.0.4 → 1.0.6

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.
@@ -7094,18 +7094,22 @@ var EsewaFullPageLoadingScreen = function EsewaFullPageLoadingScreen(_ref) {
7094
7094
  };
7095
7095
 
7096
7096
  var _templateObject$l;
7097
- var StyledRadio = styled.div(_templateObject$l || (_templateObject$l = _taggedTemplateLiteralLoose(["\n .container{\n display:flex;\n align-items: center;\n gap: 8px;\n }\n\n .container input[type=\"radio\" i] {\n margin: 0;\n appearance: none;\n width: 16px;\n height: 16px;\n border: 2px solid var(--secondary);\n border-radius: 50%;\n position: relative;\n cursor: pointer;\n transition: border-color 0.3s ease;\n }\n\n .container input[type=\"radio\"]:checked {\n border-color: var(--primary);\n }\n\n .container input[type=\"radio\"]::before {\n content: '';\n width: 10px;\n height: 10px;\n background-color: transparent;\n border-radius: 50%;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n transition: background-color 0.3s ease;\n }\n\n .container input[type=\"radio\"]:checked::before {\n background-color: var(--primary);\n }\n"])));
7097
+ var StyledRadio = styled.div(_templateObject$l || (_templateObject$l = _taggedTemplateLiteralLoose(["\n .container{\n display:flex;\n align-items: center;\n gap: 8px;\n }\n\n .container input[type=\"radio\" i] {\n margin: 0;\n appearance: none;\n width: 16px;\n height: 16px;\n border: 2px solid var(--secondary);\n border-radius: 50%;\n position: relative;\n cursor: pointer;\n transition: border-color 0.3s ease;\n }\n\n .container input[type=\"radio\"]:checked {\n border-color: var(--primary);\n }\n\n .container input[type=\"radio\"]::before {\n content: '';\n width: 10px;\n height: 10px;\n background-color: transparent;\n border-radius: 50%;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n transition: background-color 0.3s ease;\n }\n\n .container input[type=\"radio\"]:checked::before {\n background-color: var(--primary);\n }\n\n .container input[type=\"radio\"]:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n }\n"])));
7098
7098
  var ESewaRadio = function ESewaRadio(_ref) {
7099
7099
  var label = _ref.label,
7100
+ value = _ref.value,
7100
7101
  name = _ref.name,
7101
7102
  className = _ref.className,
7102
7103
  _ref$labelClass = _ref.labelClass,
7103
7104
  labelClass = _ref$labelClass === void 0 ? '' : _ref$labelClass,
7104
7105
  onChange = _ref.onChange,
7105
- checked = _ref.checked;
7106
+ _ref$checked = _ref.checked,
7107
+ checked = _ref$checked === void 0 ? false : _ref$checked,
7108
+ _ref$disabled = _ref.disabled,
7109
+ disabled = _ref$disabled === void 0 ? false : _ref$disabled;
7106
7110
  var handleRadioChange = function handleRadioChange(e) {
7107
- if (onChange) {
7108
- onChange(e.target.checked);
7111
+ if (onChange && !disabled) {
7112
+ onChange(value, e.target.checked);
7109
7113
  }
7110
7114
  };
7111
7115
  return React__default.createElement(StyledRadio, null, React__default.createElement("div", {
@@ -7115,8 +7119,10 @@ var ESewaRadio = function ESewaRadio(_ref) {
7115
7119
  }, React__default.createElement("input", {
7116
7120
  type: 'radio',
7117
7121
  name: name,
7122
+ value: value,
7118
7123
  checked: checked,
7119
- onChange: handleRadioChange
7124
+ onChange: handleRadioChange,
7125
+ disabled: disabled
7120
7126
  }), React__default.createElement("span", {
7121
7127
  className: "" + labelClass
7122
7128
  }, label))));
@@ -7696,16 +7702,21 @@ var CONNECT_APP = function CONNECT_APP(data) {
7696
7702
  if ((_window$webkit = window.webkit) !== null && _window$webkit !== void 0 && _window$webkit.messageHandlers.iOSNative) {
7697
7703
  window.webkit.messageHandlers.iOSNative.postMessage(data);
7698
7704
  } else {
7699
- console.warn('iOS interface not available');
7705
+ console.warn('IOS interface not available');
7700
7706
  }
7701
7707
  }
7702
7708
  };
7703
- var requestFromMiniApp = function requestFromMiniApp(data, callbackKey, callback) {
7704
- var _window$webkit2, _window$webkit2$messa;
7705
- if (window.Android && callbackKey in window.Android) {
7706
- window.Android[callbackKey] = callback;
7707
- } else if ((_window$webkit2 = window.webkit) !== null && _window$webkit2 !== void 0 && (_window$webkit2$messa = _window$webkit2.messageHandlers) !== null && _window$webkit2$messa !== void 0 && _window$webkit2$messa.iOSNative && callbackKey in window.webkit.messageHandlers.iOSNative) {
7708
- window.webkit.messageHandlers.iOSNative[callbackKey] = callback;
7709
+ var requestFromMiniApp = function requestFromMiniApp(data, callbackFn) {
7710
+ var callbackKey = data.callbackKey;
7711
+ if (!callbackKey) {
7712
+ throw new Error('Callback key is missing in request data');
7713
+ }
7714
+ if (isAndroid) {
7715
+ window.Android = window.Android || {};
7716
+ window.Android[callbackKey] = callbackFn;
7717
+ } else if (isiOS) {
7718
+ window.iOSNative = window.iOSNative || {};
7719
+ window.iOSNative[callbackKey] = callbackFn;
7709
7720
  }
7710
7721
  CONNECT_APP(JSON.stringify(data));
7711
7722
  };
@@ -7877,11 +7888,13 @@ var useDebounce = function useDebounce(value, delay) {
7877
7888
  };
7878
7889
 
7879
7890
  var loadGoogleFont = function loadGoogleFont() {
7880
- if (!document.querySelector("link[href*='Source+Sans+Pro']")) {
7881
- var link = document.createElement('link');
7882
- link.href = 'https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@300;400;600;700&display=swap';
7883
- link.rel = 'stylesheet';
7884
- document.head.appendChild(link);
7891
+ if (typeof window !== 'undefined' && document) {
7892
+ if (!document.querySelector("link[href*='Source+Sans+Pro']")) {
7893
+ var link = document.createElement('link');
7894
+ link.href = 'https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@300;400;600;700&display=swap';
7895
+ link.rel = 'stylesheet';
7896
+ document.head.appendChild(link);
7897
+ }
7885
7898
  }
7886
7899
  };
7887
7900
  loadGoogleFont();