@app-studio/web 0.3.11 → 0.3.12

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.
@@ -0,0 +1,17 @@
1
+ import React, { PureComponent } from 'react';
2
+ export * from './Checkbox/Checkbox';
3
+ export * from './DatePicker/DatePicker';
4
+ export * from './Label/Label';
5
+ export * from './CountryPicker/CountryPicker';
6
+ export * from './Select/Select';
7
+ export * from './Switch/Switch';
8
+ export * from './TextArea/TextArea';
9
+ export * from './TextField/TextField';
10
+ export * from './Password/Password';
11
+ import type { FieldProps } from 'formik';
12
+ import { FormProps } from 'app-studio';
13
+ export declare function Form(props: FormProps): React.JSX.Element;
14
+ declare class FormContainer extends PureComponent<FieldProps> {
15
+ render(): React.JSX.Element;
16
+ }
17
+ export default FormContainer;
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+ export declare type FormItemProps = {
3
+ children: React.ReactNode;
4
+ } & {
5
+ name: string;
6
+ label?: string;
7
+ type?: string;
8
+ labelProps: any;
9
+ };
10
+ export declare const FormField: ({ name, children, label, labelProps, ...restProps }: FormItemProps) => React.JSX.Element;
@@ -10,7 +10,7 @@ export interface TextFieldProps {
10
10
  /**
11
11
  * Specifies whether the input field should display an error state.
12
12
  */
13
- error?: boolean;
13
+ error?: any;
14
14
  /**
15
15
  * Provides additional information about the input field.
16
16
  */
@@ -0,0 +1,10 @@
1
+ import type { FormikProps, FormikValues } from 'formik';
2
+ export declare const getForm: () => FormikProps<FormikValues>;
3
+ export declare const setForm: (newForm: FormikProps<FormikValues>) => void;
4
+ export interface InputFormProps {
5
+ name: string;
6
+ label?: string;
7
+ rightIcon?: any;
8
+ leftIcon?: any;
9
+ labelProps?: any;
10
+ }
@@ -2476,21 +2476,19 @@ var TextComponent = function TextComponent(props) {
2476
2476
  */
2477
2477
  var Text = TextComponent;
2478
2478
 
2479
- var _excluded$e = ["children", "styles", "error"];
2479
+ var _excluded$e = ["children", "styles"];
2480
2480
  var HelperText = function HelperText(_ref) {
2481
2481
  var children = _ref.children,
2482
2482
  _ref$styles = _ref.styles,
2483
2483
  styles = _ref$styles === void 0 ? {
2484
2484
  helperText: {}
2485
2485
  } : _ref$styles,
2486
- _ref$error = _ref.error,
2487
- error = _ref$error === void 0 ? false : _ref$error,
2488
2486
  props = _objectWithoutPropertiesLoose(_ref, _excluded$e);
2489
2487
  return React__default.createElement(Text, Object.assign({
2490
2488
  size: "xs",
2491
2489
  marginVertical: 0,
2492
2490
  marginHorizontal: 0,
2493
- color: error ? 'theme.error' : 'theme.text.dark'
2491
+ color: 'theme.text.dark'
2494
2492
  }, styles['helperText'], props), children);
2495
2493
  };
2496
2494
 
@@ -2505,9 +2503,12 @@ var FieldContainer = function FieldContainer(_ref) {
2505
2503
  return React__default.createElement(Vertical, Object.assign({
2506
2504
  gap: 5,
2507
2505
  position: "relative"
2508
- }, props), children, helperText && React__default.createElement(HelperText, Object.assign({
2509
- error: error
2510
- }, styles), helperText));
2506
+ }, props), children, !error && helperText && React__default.createElement(HelperText, Object.assign({}, styles), helperText), error && React__default.createElement(Text, {
2507
+ size: "xs",
2508
+ marginVertical: 0,
2509
+ marginHorizontal: 0,
2510
+ color: 'theme.error'
2511
+ }, error));
2511
2512
  };
2512
2513
 
2513
2514
  var Shapes = {
@@ -2598,7 +2599,7 @@ var FieldContent = function FieldContent(_ref) {
2598
2599
  borderStyle: "solid",
2599
2600
  alignItems: "center",
2600
2601
  borderColor: color,
2601
- backgroundColor: "trueGray.50",
2602
+ backgroundColor: "color.trueGray.50",
2602
2603
  transition: "padding 0.2s ease",
2603
2604
  justifyContent: "space-between",
2604
2605
  fontSize: appStudio.Typography.fontSizes[size],
@@ -3023,7 +3024,7 @@ var DatePickerView = function DatePickerView(_ref) {
3023
3024
  },
3024
3025
  fontSize: appStudio.Typography.fontSizes[size],
3025
3026
  backgroundColor: 'transparent',
3026
- color: isDisabled ? 'trueGray.600' : 'blueGray.700',
3027
+ color: isDisabled ? 'color.trueGray.600' : 'color.blueGray.700',
3027
3028
  cursor: isDisabled ? 'not-allowed' : isReadOnly ? 'auto' : 'pointer'
3028
3029
  }, styles['field']);
3029
3030
  return React__default.createElement(FieldContainer, {
@@ -3431,7 +3432,7 @@ var SelectBox = function SelectBox(_ref2) {
3431
3432
  paddingHorizontal: 0,
3432
3433
  fontSize: appStudio.Typography.fontSizes[size],
3433
3434
  backgroundColor: 'transparent',
3434
- color: isDisabled ? 'trueGray.600' : 'blueGray.700',
3435
+ color: isDisabled ? 'color.trueGray.600' : 'color.blueGray.700',
3435
3436
  cursor: isDisabled ? 'not-allowed' : 'auto'
3436
3437
  }, styles['field'], styles['text']);
3437
3438
  return React__default.createElement(Text, Object.assign({}, fieldStyles), (selected === '' || selected && selected.length === 0) && !!placeholder ? placeholder : React__default.createElement(React__default.Fragment, null, typeof selected === 'string' ? selected : selected && selected.length > 0 && React__default.createElement(Horizontal, {
@@ -3549,7 +3550,7 @@ var MultiSelect = function MultiSelect(_ref5) {
3549
3550
  borderRadius: 4,
3550
3551
  alignItems: "center",
3551
3552
  fontSize: appStudio.Typography.fontSizes[size],
3552
- backgroundColor: "trueGray.300",
3553
+ backgroundColor: "color.trueGray.300",
3553
3554
  onClick: function onClick(event) {
3554
3555
  return event.stopPropagation();
3555
3556
  }
@@ -4046,7 +4047,7 @@ var TextAreaView = function TextAreaView(_ref) {
4046
4047
  },
4047
4048
  fontSize: appStudio.Typography.fontSizes[size],
4048
4049
  backgroundColor: 'transparent',
4049
- color: isDisabled ? 'trueGray.600' : 'blueGray.700',
4050
+ color: isDisabled ? 'color.trueGray.600' : 'color.blueGray.700',
4050
4051
  cursor: isDisabled ? 'not-allowed' : 'auto'
4051
4052
  }, styles['field']);
4052
4053
  var handleHover = function handleHover() {