@app-studio/web 0.3.55 → 0.3.57

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.
@@ -7,8 +7,33 @@ export declare const usePasswordState: (props: PasswordProps) => {
7
7
  setIsFocused: import("react").Dispatch<import("react").SetStateAction<boolean>>;
8
8
  isHovered: boolean;
9
9
  setIsHovered: import("react").Dispatch<import("react").SetStateAction<boolean>>;
10
- setValue: import("react").Dispatch<any>;
11
- value: any;
10
+ setValue: import("react").Dispatch<import("react").SetStateAction<string>>;
11
+ value: string;
12
+ name?: string | undefined;
13
+ isDisabled?: boolean | undefined;
14
+ visibleIcon?: import("react").ReactNode;
15
+ hiddenIcon?: import("react").ReactNode;
16
+ id?: string | undefined;
17
+ error?: any;
18
+ helperText?: string | undefined;
19
+ label?: string | undefined;
20
+ colorScheme?: string | undefined;
21
+ leftChild?: import("react").ReactNode;
22
+ rightChild?: import("react").ReactNode;
23
+ placeholder?: string | undefined;
24
+ isReadOnly?: boolean | undefined;
25
+ isClearable?: boolean | undefined;
26
+ isAutoFocus?: boolean | undefined;
27
+ onChange?: ((value: any) => void) | undefined;
28
+ onChangeText?: ((value: string) => void) | undefined;
29
+ onBlur?: ((value: any) => void) | undefined;
30
+ onClick?: (() => void) | undefined;
31
+ onFocus?: (() => void) | undefined;
32
+ size?: "xs" | "sm" | "md" | "lg" | "xl" | undefined;
33
+ shadow?: import("app-studio").Shadow | import("../../../../utils/elevation").Elevation | import("react").CSSProperties | undefined;
34
+ shape?: "default" | "sharp" | "rounded" | "pillShaped" | undefined;
35
+ styles?: import("../../TextField/TextField/TextField.type").TextFieldStyles | undefined;
36
+ variant?: "default" | "outline" | "none" | undefined;
12
37
  isVisible: boolean;
13
38
  setIsVisible: import("react").Dispatch<import("react").SetStateAction<boolean>>;
14
39
  };
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { TextAreaProps } from './TextArea.props';
3
- export declare const useTextAreaState: ({ label, placeholder, value: defaultValue }: TextAreaProps) => {
3
+ export declare const useTextAreaState: ({ label, placeholder, value: defaultValue, }: TextAreaProps) => {
4
4
  hint: string | undefined;
5
5
  setHint: import("react").Dispatch<import("react").SetStateAction<string | undefined>>;
6
6
  isHovered: boolean;
@@ -1,12 +1,12 @@
1
1
  /// <reference types="react" />
2
2
  import { TextFieldProps } from './TextField.props';
3
- export declare const useTextFieldState: ({ label, placeholder, value: defaultValue }: TextFieldProps) => {
3
+ export declare const useTextFieldState: ({ label, placeholder, value: defaultValue, }: TextFieldProps) => {
4
4
  hint: string | undefined;
5
5
  setHint: import("react").Dispatch<import("react").SetStateAction<string | undefined>>;
6
6
  isFocused: boolean;
7
7
  setIsFocused: import("react").Dispatch<import("react").SetStateAction<boolean>>;
8
8
  isHovered: boolean;
9
9
  setIsHovered: import("react").Dispatch<import("react").SetStateAction<boolean>>;
10
- setValue: import("react").Dispatch<import("react").SetStateAction<string>>;
11
- value: string;
10
+ setValue: import("react").Dispatch<import("react").SetStateAction<string | undefined>>;
11
+ value: string | undefined;
12
12
  };
@@ -3360,7 +3360,7 @@ var useTextFieldState = function useTextFieldState(_ref) {
3360
3360
  var _useState3 = React.useState(false),
3361
3361
  isHovered = _useState3[0],
3362
3362
  setIsHovered = _useState3[1];
3363
- var _useState4 = React.useState(defaultValue || ''),
3363
+ var _useState4 = React.useState(defaultValue),
3364
3364
  value = _useState4[0],
3365
3365
  setValue = _useState4[1];
3366
3366
  React.useMemo(function () {
@@ -3386,7 +3386,7 @@ var usePasswordState = function usePasswordState(props) {
3386
3386
  return _extends({
3387
3387
  isVisible: isVisible,
3388
3388
  setIsVisible: setIsVisible
3389
- }, textFieldStates);
3389
+ }, props, textFieldStates);
3390
3390
  };
3391
3391
 
3392
3392
  var _excluded$p = ["id", "name", "label", "hint", "value", "onChange", "leftChild", "rightChild", "helperText", "placeholder", "onChangeText", "shadow", "styles", "size", "shape", "variant", "colorScheme", "error", "isFocused", "isHovered", "isDisabled", "isReadOnly", "isClearable", "isAutoFocus", "setHint", "setIsFocused", "setIsHovered", "setValue", "onClick", "onFocus", "onBlur"];
@@ -3478,7 +3478,7 @@ var TextFieldView = function TextFieldView(_ref) {
3478
3478
  return setIsHovered(!isHovered);
3479
3479
  };
3480
3480
  var handleBlur = function handleBlur(event) {
3481
- onBlur(event);
3481
+ if (onBlur) onBlur(event);
3482
3482
  setIsFocused(false);
3483
3483
  };
3484
3484
  var handleChange = function handleChange(event) {
@@ -3503,12 +3503,8 @@ var TextFieldView = function TextFieldView(_ref) {
3503
3503
  name: name
3504
3504
  }
3505
3505
  });
3506
- onChange({
3507
- target: {
3508
- name: name,
3509
- value: ''
3510
- }
3511
- });
3506
+ if (onChangeText) onChangeText('');
3507
+ if (onChange) onChange('');
3512
3508
  }
3513
3509
  //for ios and android
3514
3510
  if (typeof document === 'undefined' && onChangeText) onChangeText('');
@@ -3552,8 +3548,6 @@ var TextFieldView = function TextFieldView(_ref) {
3552
3548
  }, fieldStyles, props, {
3553
3549
  onChange: handleChange,
3554
3550
  value: value
3555
- }, onChange && {
3556
- onChange: handleChange
3557
3551
  }))), (rightChild || isClearable && value) && React__default.createElement(FieldIcons, null, rightChild && React__default.createElement(React__default.Fragment, null, rightChild), isClearable && value && !isReadOnly && !isDisabled && React__default.createElement(CloseSvg, {
3558
3552
  size: appStudio.Typography.fontSizes[size],
3559
3553
  color: IconColor,
@@ -3576,8 +3570,8 @@ var PasswordComponent = function PasswordComponent(_ref) {
3576
3570
  var _usePasswordState = usePasswordState(props),
3577
3571
  isVisible = _usePasswordState.isVisible,
3578
3572
  setIsVisible = _usePasswordState.setIsVisible,
3579
- passwordState = _objectWithoutPropertiesLoose(_usePasswordState, _excluded2$1);
3580
- return React__default.createElement(TextFieldView, Object.assign({}, props, passwordState, {
3573
+ passwordProps = _objectWithoutPropertiesLoose(_usePasswordState, _excluded2$1);
3574
+ return React__default.createElement(TextFieldView, Object.assign({}, passwordProps, {
3581
3575
  type: isVisible ? 'text' : 'password',
3582
3576
  isClearable: false,
3583
3577
  rightChild: React__default.createElement(appStudio.View, {