@app-studio/web 0.3.11 → 0.3.13

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,17 +2503,17 @@ 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 = {
2514
2515
  default: {
2515
- borderTopLeftRadius: 6,
2516
- borderTopRightRadius: 6,
2517
- borderBottomLeftRadius: 0,
2518
- borderBottomRightRadius: 0
2516
+ borderRadius: 0
2519
2517
  },
2520
2518
  sharp: {
2521
2519
  borderRadius: 0
@@ -2598,7 +2596,7 @@ var FieldContent = function FieldContent(_ref) {
2598
2596
  borderStyle: "solid",
2599
2597
  alignItems: "center",
2600
2598
  borderColor: color,
2601
- backgroundColor: "trueGray.50",
2599
+ backgroundColor: "color.white",
2602
2600
  transition: "padding 0.2s ease",
2603
2601
  justifyContent: "space-between",
2604
2602
  fontSize: appStudio.Typography.fontSizes[size],
@@ -3023,7 +3021,7 @@ var DatePickerView = function DatePickerView(_ref) {
3023
3021
  },
3024
3022
  fontSize: appStudio.Typography.fontSizes[size],
3025
3023
  backgroundColor: 'transparent',
3026
- color: isDisabled ? 'trueGray.600' : 'blueGray.700',
3024
+ color: isDisabled ? 'color.trueGray.600' : 'color.blueGray.700',
3027
3025
  cursor: isDisabled ? 'not-allowed' : isReadOnly ? 'auto' : 'pointer'
3028
3026
  }, styles['field']);
3029
3027
  return React__default.createElement(FieldContainer, {
@@ -3431,7 +3429,7 @@ var SelectBox = function SelectBox(_ref2) {
3431
3429
  paddingHorizontal: 0,
3432
3430
  fontSize: appStudio.Typography.fontSizes[size],
3433
3431
  backgroundColor: 'transparent',
3434
- color: isDisabled ? 'trueGray.600' : 'blueGray.700',
3432
+ color: isDisabled ? 'color.trueGray.600' : 'color.blueGray.700',
3435
3433
  cursor: isDisabled ? 'not-allowed' : 'auto'
3436
3434
  }, styles['field'], styles['text']);
3437
3435
  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 +3547,7 @@ var MultiSelect = function MultiSelect(_ref5) {
3549
3547
  borderRadius: 4,
3550
3548
  alignItems: "center",
3551
3549
  fontSize: appStudio.Typography.fontSizes[size],
3552
- backgroundColor: "trueGray.300",
3550
+ backgroundColor: "color.trueGray.300",
3553
3551
  onClick: function onClick(event) {
3554
3552
  return event.stopPropagation();
3555
3553
  }
@@ -4046,7 +4044,7 @@ var TextAreaView = function TextAreaView(_ref) {
4046
4044
  },
4047
4045
  fontSize: appStudio.Typography.fontSizes[size],
4048
4046
  backgroundColor: 'transparent',
4049
- color: isDisabled ? 'trueGray.600' : 'blueGray.700',
4047
+ color: isDisabled ? 'color.trueGray.600' : 'color.blueGray.700',
4050
4048
  cursor: isDisabled ? 'not-allowed' : 'auto'
4051
4049
  }, styles['field']);
4052
4050
  var handleHover = function handleHover() {