@app-studio/web 0.3.38 → 0.3.39

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/web.esm.js CHANGED
@@ -1,6 +1,8 @@
1
1
  import React, { useState, useRef, useEffect, useMemo, useCallback, Fragment } from 'react';
2
2
  import { View as View$1, Element, Typography, useTheme, Input, Image } from 'app-studio';
3
3
  import { Link as Link$1 } from 'react-router-dom';
4
+ import { Loader as Loader$1 } from 'src/components/Loader/Loader';
5
+ import { Horizontal as Horizontal$1 } from 'src/components/Layout/Horizontal/Horizontal';
4
6
  import format from 'date-fns/format';
5
7
  import { create } from 'zustand';
6
8
 
@@ -561,7 +563,7 @@ var IconSizes$1 = {
561
563
  }
562
564
  };
563
565
 
564
- var _excluded$b = ["icon", "shadow", "children", "ariaLabel", "externalHref", "isAuto", "isFilled", "isIconRounded", "isLoader", "isDisabled", "size", "variant", "iconPosition", "colorScheme", "shape", "onClick"];
566
+ var _excluded$b = ["icon", "shadow", "children", "ariaLabel", "externalHref", "isAuto", "isFilled", "isIconRounded", "isLoading", "isDisabled", "size", "variant", "iconPosition", "colorScheme", "shape", "onClick", "loaderProps", "loaderPosition"];
565
567
  var ButtonView = function ButtonView(_ref) {
566
568
  var _props$onClick;
567
569
  var icon = _ref.icon,
@@ -575,8 +577,8 @@ var ButtonView = function ButtonView(_ref) {
575
577
  isFilled = _ref$isFilled === void 0 ? false : _ref$isFilled,
576
578
  _ref$isIconRounded = _ref.isIconRounded,
577
579
  isIconRounded = _ref$isIconRounded === void 0 ? false : _ref$isIconRounded,
578
- _ref$isLoader = _ref.isLoader,
579
- isLoader = _ref$isLoader === void 0 ? false : _ref$isLoader,
580
+ _ref$isLoading = _ref.isLoading,
581
+ isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
580
582
  _ref$isDisabled = _ref.isDisabled,
581
583
  isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
582
584
  _ref$size = _ref.size,
@@ -591,8 +593,12 @@ var ButtonView = function ButtonView(_ref) {
591
593
  shape = _ref$shape === void 0 ? 'rounded' : _ref$shape,
592
594
  _ref$onClick = _ref.onClick,
593
595
  onClick = _ref$onClick === void 0 ? function () {} : _ref$onClick,
596
+ _ref$loaderProps = _ref.loaderProps,
597
+ loaderProps = _ref$loaderProps === void 0 ? {} : _ref$loaderProps,
598
+ _ref$loaderPosition = _ref.loaderPosition,
599
+ loaderPosition = _ref$loaderPosition === void 0 ? 'left' : _ref$loaderPosition,
594
600
  props = _objectWithoutPropertiesLoose(_ref, _excluded$b);
595
- var isActive = !(isDisabled || isLoader);
601
+ var isActive = !(isDisabled || isLoading);
596
602
  var defaultNativeProps = {
597
603
  disabled: !isActive
598
604
  };
@@ -629,7 +635,9 @@ var ButtonView = function ButtonView(_ref) {
629
635
  var changePadding = {
630
636
  padding: isIconRounded ? IconSizes$1[size].padding : ButtonSizes[size].padding
631
637
  };
632
- var content = React.createElement(React.Fragment, null, icon && iconPosition === 'left' && !isLoader && icon, children, icon && iconPosition === 'right' && !isLoader && icon);
638
+ var content = React.createElement(Horizontal$1, {
639
+ gap: 4
640
+ }, isLoading && loaderPosition === 'left' && React.createElement(Loader$1, Object.assign({}, loaderProps)), icon && iconPosition === 'left' && !isLoading && icon, children, icon && iconPosition === 'right' && !isLoading && icon, isLoading && loaderPosition === 'right' && React.createElement(Loader$1, Object.assign({}, loaderProps)));
633
641
  return React.createElement(Element, Object.assign({
634
642
  gap: 8,
635
643
  as: "button",
@@ -3359,7 +3367,8 @@ var PasswordComponent = function PasswordComponent(_ref) {
3359
3367
  isVisible = _usePasswordState.isVisible,
3360
3368
  setIsVisible = _usePasswordState.setIsVisible,
3361
3369
  passwordState = _objectWithoutPropertiesLoose(_usePasswordState, _excluded2);
3362
- return isVisible ? React.createElement(TextFieldView, Object.assign({
3370
+ return React.createElement(TextFieldView, Object.assign({}, props, passwordState, {
3371
+ type: isVisible ? 'text' : 'password',
3363
3372
  isClearable: false,
3364
3373
  rightChild: React.createElement(View$1, {
3365
3374
  onClick: function onClick() {
@@ -3368,17 +3377,6 @@ var PasswordComponent = function PasswordComponent(_ref) {
3368
3377
  }
3369
3378
  }
3370
3379
  }, isVisible ? visibleIcon : hiddenIcon)
3371
- }, passwordState, props)) : React.createElement(TextFieldView, Object.assign({
3372
- isClearable: false,
3373
- rightChild: React.createElement(View$1, {
3374
- onClick: function onClick() {
3375
- if (!props.isDisabled) {
3376
- setIsVisible(!isVisible);
3377
- }
3378
- }
3379
- }, isVisible ? visibleIcon : hiddenIcon)
3380
- }, passwordState, props, {
3381
- type: 'password'
3382
3380
  }));
3383
3381
  };
3384
3382
  /**