esewa-ui-library 1.10.0 → 1.10.2

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.
@@ -343,7 +343,7 @@ var ESewaDatePicker = function ESewaDatePicker(_ref) {
343
343
  };
344
344
 
345
345
  var _templateObject$6;
346
- var StyledDailog = styled.div(_templateObject$6 || (_templateObject$6 = _taggedTemplateLiteralLoose(["\n .dialog-overlay {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: rgba(0, 0, 0, 0.5);\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: 1000;\n transition: opacity 400ms cubic-bezier(0.4, 0, 0.2, 1);\n animation: fadeIn 0.3s ease-out;\n }\n\n .dialog {\n &-box {\n background: var(--card-bg);\n border-top-left-radius: var(--values-value-16);\n border-top-right-radius: var(--values-value-16);\n width: 100%;\n max-width: 100%;\n padding: 16px;\n box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);\n transition: transform 0.3s ease-in-out;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n &.slide-down {\n animation: slideDown 0.2s ease-out forwards;\n }\n &.slide-up {\n animation: slideUp 0.3s ease-out forwards;\n }\n }\n &-center {\n align-self: center;\n }\n &-top {\n align-self: flex-start;\n }\n &-bottom {\n align-self: flex-end;\n }\n &-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding-bottom: 8px;\n border-bottom: 1px solid var(--border);\n &-left-icon {\n color: var(--secondary);\n [class^='icon-'],\n [class*=' icon-'] {\n font-weight: 600;\n }\n }\n &-title {\n margin: 0;\n font-weight: bold;\n text-align: center;\n color: var(--text-dark);\n }\n &-close-icon {\n color: var(--secondary);\n [class^='icon-'],\n [class*=' icon-'] {\n font-weight: 600;\n }\n }\n }\n\n &-body {\n margin: 16px 0;\n color: var(--text-tertiary);\n }\n &-footer {\n display: flex;\n width: 100%;\n gap: 16px;\n justify-content: flex-end;\n }\n }\n @keyframes fadeIn {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n }\n\n @keyframes slideUp {\n from {\n transform: translateY(100px);\n opacity: 0;\n }\n to {\n transform: translateY(0);\n opacity: 1;\n }\n }\n @keyframes slideDown {\n from {\n transform: translateY(0);\n opacity: 1;\n }\n to {\n transform: translateY(100px);\n opacity: 0;\n }\n }\n"])));
346
+ var StyledDailog = styled.div(_templateObject$6 || (_templateObject$6 = _taggedTemplateLiteralLoose(["\n .dialog-overlay {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: rgba(0, 0, 0, 0.5);\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: 1000;\n transition: opacity 400ms cubic-bezier(0.4, 0, 0.2, 1);\n animation: fadeIn 0.3s ease-out;\n }\n\n .dialog {\n &-box {\n background: var(--card-bg);\n border-top-left-radius: var(--values-value-16);\n border-top-right-radius: var(--values-value-16);\n width: 100%;\n max-width: 100%;\n padding: 16px;\n box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);\n transition: transform 0.3s ease-in-out;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n &.slide-down {\n animation: slideDown 0.2s ease-out forwards;\n }\n &.slide-up {\n animation: slideUp 0.3s ease-out forwards;\n }\n }\n &-center {\n align-self: center;\n }\n &-top {\n align-self: flex-start;\n }\n &-bottom {\n align-self: flex-end;\n }\n &-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding-bottom: 8px;\n border-bottom: 1px solid var(--border);\n &-left-icon {\n color: var(--secondary);\n [class^='icon-'],\n [class*=' icon-'] {\n font-weight: 600;\n }\n }\n &-title {\n margin: 0;\n font-weight: bold;\n text-align: center;\n color: var(--text-dark);\n }\n &-close-icon {\n color: var(--secondary);\n [class^='icon-'],\n [class*=' icon-'] {\n font-weight: 600;\n }\n }\n }\n\n &-body {\n margin: 16px 0;\n color: var(--text-tertiary);\n }\n &-footer {\n width: 100%;\n }\n }\n @keyframes fadeIn {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n }\n\n @keyframes slideUp {\n from {\n transform: translateY(100px);\n opacity: 0;\n }\n to {\n transform: translateY(0);\n opacity: 1;\n }\n }\n @keyframes slideDown {\n from {\n transform: translateY(0);\n opacity: 1;\n }\n to {\n transform: translateY(100px);\n opacity: 0;\n }\n }\n"])));
347
347
  var ESewaDialog = function ESewaDialog(_ref) {
348
348
  var isOpen = _ref.isOpen,
349
349
  _ref$showLeftIcon = _ref.showLeftIcon,
@@ -7017,8 +7017,16 @@ var ESewaChipGroup = function ESewaChipGroup(_ref3) {
7017
7017
  required = _ref3.required,
7018
7018
  chips = _ref3.chips,
7019
7019
  className = _ref3.className,
7020
+ defaultValue = _ref3.defaultValue,
7020
7021
  onChange = _ref3.onChange;
7021
- var _useState = useState([]),
7022
+ var initialSelectedChips = useMemo(function () {
7023
+ if (defaultValue === undefined) return [];
7024
+ if (selection === 'single') {
7025
+ return typeof defaultValue === 'number' ? [defaultValue] : [];
7026
+ }
7027
+ return Array.isArray(defaultValue) ? defaultValue : [];
7028
+ }, [defaultValue, selection]);
7029
+ var _useState = useState(initialSelectedChips),
7022
7030
  selectedChips = _useState[0],
7023
7031
  setSelectedChips = _useState[1];
7024
7032
  var handleSelectChip = function handleSelectChip(id) {
@@ -7709,8 +7717,8 @@ var ESewaPaymentProvider = function ESewaPaymentProvider(_ref) {
7709
7717
  }, children);
7710
7718
  };
7711
7719
 
7712
- var isAndroid = /Android/i.test(navigator.userAgent);
7713
- var isiOS = /iPhone|iPad|iPod/i.test(navigator.userAgent);
7720
+ var isAndroid = typeof navigator !== 'undefined' && /Android/i.test(navigator.userAgent);
7721
+ var isiOS = typeof navigator !== 'undefined' && /iPhone|iPad|iPod/i.test(navigator.userAgent);
7714
7722
  var requestMiniApp = function requestMiniApp(data) {
7715
7723
  var token = sessionStorage.getItem('token');
7716
7724
  if (token) {