@app-studio/web 0.1.4 → 0.1.6
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/components/Button/examples/index.d.ts +9 -9
- package/dist/components/Form/Checkbox/examples/index.d.ts +11 -11
- package/dist/components/Form/CountryPicker/examples/index.d.ts +12 -12
- package/dist/components/Form/DatePicker/examples/index.d.ts +11 -11
- package/dist/components/Form/Password/Password/Password.props.d.ts +1 -1
- package/dist/components/Form/TextArea/examples/index.d.ts +15 -15
- package/dist/components/Form/TextField/examples/index.d.ts +17 -17
- package/dist/components/Layout/Horizontal/examples/index.d.ts +4 -4
- package/dist/components/Layout/Input/FieldContainer/FieldContainer/FieldContainer.props.d.ts +1 -1
- package/dist/components/Layout/Input/FieldContent/FieldContent/FieldContent.props.d.ts +1 -1
- package/dist/components/Layout/Input/FieldLabel/FieldLabel/FieldLabel.props.d.ts +1 -1
- package/dist/components/Layout/Input/FieldLayout/FieldLayout/FieldLayout.props.d.ts +1 -1
- package/dist/components/Layout/Input/HelperText/HelperText.props.d.ts +1 -1
- package/dist/components/Layout/Input/index.d.ts +7 -7
- package/dist/components/Loader/examples/index.d.ts +7 -7
- package/dist/components/Modal/Examples/index.d.ts +9 -9
- package/dist/components/index.d.ts +18 -18
- package/package.json +6 -7
- package/src/components/Button/Button/Button.props.ts +0 -79
- package/src/components/Button/Button/Button.state.ts +0 -7
- package/src/components/Button/Button/Button.style.ts +0 -95
- package/src/components/Button/Button/Button.type.d.ts +0 -11
- package/src/components/Button/Button/Button.view.tsx +0 -113
- package/src/components/Button/Button.md +0 -165
- package/src/components/Button/Button.tsx +0 -24
- package/src/components/Button/examples/AutoFocusButton.tsx +0 -13
- package/src/components/Button/examples/BorderedButtons.tsx +0 -14
- package/src/components/Button/examples/ColoredButtons.tsx +0 -12
- package/src/components/Button/examples/DefaultButton.tsx +0 -4
- package/src/components/Button/examples/DisabledButton.tsx +0 -13
- package/src/components/Button/examples/IconButtons.tsx +0 -23
- package/src/components/Button/examples/LoadingButtons.tsx +0 -32
- package/src/components/Button/examples/ShadowButton.tsx +0 -6
- package/src/components/Button/examples/SizeButtons.tsx +0 -16
- package/src/components/Button/examples/VariantButtons.tsx +0 -20
- package/src/components/Button/examples/index.ts +0 -9
- package/src/components/Form/Checkbox/Checkbox/Checkbox.props.ts +0 -118
- package/src/components/Form/Checkbox/Checkbox/Checkbox.state.ts +0 -15
- package/src/components/Form/Checkbox/Checkbox/Checkbox.style.ts +0 -29
- package/src/components/Form/Checkbox/Checkbox/Checkbox.type.d.ts +0 -8
- package/src/components/Form/Checkbox/Checkbox/Checkbox.view.tsx +0 -98
- package/src/components/Form/Checkbox/Checkbox.md +0 -128
- package/src/components/Form/Checkbox/Checkbox.tsx +0 -15
- package/src/components/Form/Checkbox/examples/ColorScheme.tsx +0 -12
- package/src/components/Form/Checkbox/examples/Default.tsx +0 -5
- package/src/components/Form/Checkbox/examples/DisabledInput.tsx +0 -5
- package/src/components/Form/Checkbox/examples/ErrorCheckbox.tsx +0 -5
- package/src/components/Form/Checkbox/examples/FormCheckout.tsx +0 -46
- package/src/components/Form/Checkbox/examples/IconCheckbox.tsx +0 -8
- package/src/components/Form/Checkbox/examples/IndeterminateCheckbox.tsx +0 -5
- package/src/components/Form/Checkbox/examples/ReadOnlyInput.tsx +0 -5
- package/src/components/Form/Checkbox/examples/Shadow.tsx +0 -11
- package/src/components/Form/Checkbox/examples/SizeInput.tsx +0 -18
- package/src/components/Form/Checkbox/examples/StylesInput.tsx +0 -22
- package/src/components/Form/Checkbox/examples/index.ts +0 -11
- package/src/components/Form/CountryPicker/CountryPicker/CountryPicker.props.ts +0 -187
- package/src/components/Form/CountryPicker/CountryPicker/CountryPicker.state.ts +0 -28
- package/src/components/Form/CountryPicker/CountryPicker/CountryPicker.style.ts +0 -17
- package/src/components/Form/CountryPicker/CountryPicker/CountryPicker.type.d.ts +0 -22
- package/src/components/Form/CountryPicker/CountryPicker/CountryPicker.view.tsx +0 -234
- package/src/components/Form/CountryPicker/CountryPicker.md +0 -206
- package/src/components/Form/CountryPicker/CountryPicker.tsx +0 -16
- package/src/components/Form/CountryPicker/countries.json +0 -1453
- package/src/components/Form/CountryPicker/examples/Color.tsx +0 -12
- package/src/components/Form/CountryPicker/examples/Default.tsx +0 -4
- package/src/components/Form/CountryPicker/examples/Disabled.tsx +0 -5
- package/src/components/Form/CountryPicker/examples/Error.tsx +0 -4
- package/src/components/Form/CountryPicker/examples/Form.tsx +0 -23
- package/src/components/Form/CountryPicker/examples/Formik.tsx +0 -39
- package/src/components/Form/CountryPicker/examples/HelperText.tsx +0 -5
- package/src/components/Form/CountryPicker/examples/ReadOnlyInput.tsx +0 -5
- package/src/components/Form/CountryPicker/examples/Shadow.tsx +0 -4
- package/src/components/Form/CountryPicker/examples/Shape.tsx +0 -13
- package/src/components/Form/CountryPicker/examples/SizeInput.tsx +0 -16
- package/src/components/Form/CountryPicker/examples/StylesInput.tsx +0 -17
- package/src/components/Form/CountryPicker/examples/Variant.tsx +0 -13
- package/src/components/Form/CountryPicker/examples/index.ts +0 -12
- package/src/components/Form/CountryPicker/styles.css +0 -7
- package/src/components/Form/DatePicker/DatePicker/DatePicker.props.ts +0 -113
- package/src/components/Form/DatePicker/DatePicker/DatePicker.state.ts +0 -17
- package/src/components/Form/DatePicker/DatePicker/DatePicker.style.ts +0 -17
- package/src/components/Form/DatePicker/DatePicker/DatePicker.type.d.ts +0 -15
- package/src/components/Form/DatePicker/DatePicker/DatePicker.view.tsx +0 -118
- package/src/components/Form/DatePicker/DatePicker.md +0 -115
- package/src/components/Form/DatePicker/DatePicker.tsx +0 -15
- package/src/components/Form/DatePicker/examples/ColorScheme.tsx +0 -12
- package/src/components/Form/DatePicker/examples/Default.tsx +0 -4
- package/src/components/Form/DatePicker/examples/DisabledInput.tsx +0 -5
- package/src/components/Form/DatePicker/examples/ErrorCheckbox.tsx +0 -4
- package/src/components/Form/DatePicker/examples/FormCheckout.tsx +0 -23
- package/src/components/Form/DatePicker/examples/Formik.tsx +0 -35
- package/src/components/Form/DatePicker/examples/ReadOnlyInput.tsx +0 -5
- package/src/components/Form/DatePicker/examples/Shadow.tsx +0 -10
- package/src/components/Form/DatePicker/examples/SizeInput.tsx +0 -16
- package/src/components/Form/DatePicker/examples/StylesInput.tsx +0 -14
- package/src/components/Form/DatePicker/examples/helperTextDatePicker.tsx +0 -6
- package/src/components/Form/DatePicker/examples/index.ts +0 -11
- package/src/components/Form/Label/Label/Label.props.ts +0 -36
- package/src/components/Form/Label/Label/Label.style.ts +0 -34
- package/src/components/Form/Label/Label/Label.type.ts +0 -14
- package/src/components/Form/Label/Label/Label.view.tsx +0 -35
- package/src/components/Form/Label/Label.tsx +0 -8
- package/src/components/Form/Password/Password/Password.props.ts +0 -36
- package/src/components/Form/Password/Password/Password.state.ts +0 -6
- package/src/components/Form/Password/Password/Password.type.d.ts +0 -14
- package/src/components/Form/Password/Password/Password.view.tsx +0 -32
- package/src/components/Form/Password/Password.md +0 -108
- package/src/components/Form/Password/Password.tsx +0 -15
- package/src/components/Form/Password/example/Default.tsx +0 -9
- package/src/components/Form/Password/example/DisabledInput.tsx +0 -17
- package/src/components/Form/Password/example/ErrorInput.tsx +0 -66
- package/src/components/Form/Password/example/FormikErrorInput.tsx +0 -67
- package/src/components/Form/Password/example/FormikHelperText.tsx +0 -65
- package/src/components/Form/Password/example/HelperText.tsx +0 -65
- package/src/components/Form/Select/Select/Select.props.ts +0 -262
- package/src/components/Form/Select/Select/Select.state.ts +0 -19
- package/src/components/Form/Select/Select/Select.style.ts +0 -19
- package/src/components/Form/Select/Select/Select.type.d.ts +0 -15
- package/src/components/Form/Select/Select/Select.view.tsx +0 -337
- package/src/components/Form/Select/Select.md +0 -165
- package/src/components/Form/Select/Select.tsx +0 -16
- package/src/components/Form/Select/examples/Color.tsx +0 -12
- package/src/components/Form/Select/examples/Default.tsx +0 -4
- package/src/components/Form/Select/examples/Disabled.tsx +0 -5
- package/src/components/Form/Select/examples/Error.tsx +0 -4
- package/src/components/Form/Select/examples/Form.tsx +0 -23
- package/src/components/Form/Select/examples/Formik.tsx +0 -41
- package/src/components/Form/Select/examples/HelperText.tsx +0 -7
- package/src/components/Form/Select/examples/Multiple.tsx +0 -6
- package/src/components/Form/Select/examples/ReadOnlyInput.tsx +0 -5
- package/src/components/Form/Select/examples/Shadow.tsx +0 -11
- package/src/components/Form/Select/examples/SizeInput.tsx +0 -16
- package/src/components/Form/Select/examples/StylesInput.tsx +0 -15
- package/src/components/Form/Switch/Switch/Switch.props.ts +0 -91
- package/src/components/Form/Switch/Switch/Switch.state.ts +0 -11
- package/src/components/Form/Switch/Switch/Switch.style.ts +0 -72
- package/src/components/Form/Switch/Switch/Switch.type.d.ts +0 -6
- package/src/components/Form/Switch/Switch/Switch.view.tsx +0 -78
- package/src/components/Form/Switch/Switch.md +0 -148
- package/src/components/Form/Switch/Switch.tsx +0 -12
- package/src/components/Form/Switch/examples/ChildSwitch.tsx +0 -20
- package/src/components/Form/Switch/examples/ColorScheme.tsx +0 -5
- package/src/components/Form/Switch/examples/Default.tsx +0 -4
- package/src/components/Form/Switch/examples/DisabledInput.tsx +0 -7
- package/src/components/Form/Switch/examples/FormSwitch.tsx +0 -22
- package/src/components/Form/Switch/examples/Formik.tsx +0 -30
- package/src/components/Form/Switch/examples/ReadOnlyInput.tsx +0 -7
- package/src/components/Form/Switch/examples/Shadow.tsx +0 -11
- package/src/components/Form/Switch/examples/SizeInput.tsx +0 -21
- package/src/components/Form/Switch/examples/StylesInput.tsx +0 -32
- package/src/components/Form/TextArea/TextArea/TextArea.props.ts +0 -154
- package/src/components/Form/TextArea/TextArea/TextArea.state.ts +0 -21
- package/src/components/Form/TextArea/TextArea/TextArea.type.ts +0 -15
- package/src/components/Form/TextArea/TextArea/TextArea.view.tsx +0 -143
- package/src/components/Form/TextArea/TextArea.md +0 -169
- package/src/components/Form/TextArea/TextArea.tsx +0 -15
- package/src/components/Form/TextArea/examples/ColorScheme.tsx +0 -13
- package/src/components/Form/TextArea/examples/Default.tsx +0 -5
- package/src/components/Form/TextArea/examples/DisabledInput.tsx +0 -7
- package/src/components/Form/TextArea/examples/ErrorInput.tsx +0 -50
- package/src/components/Form/TextArea/examples/FormikErrorInput.tsx +0 -52
- package/src/components/Form/TextArea/examples/FormikHelperText.tsx +0 -51
- package/src/components/Form/TextArea/examples/HelperText.tsx +0 -49
- package/src/components/Form/TextArea/examples/LabelInput.tsx +0 -23
- package/src/components/Form/TextArea/examples/MaxRowCol.tsx +0 -7
- package/src/components/Form/TextArea/examples/Placeholder.tsx +0 -23
- package/src/components/Form/TextArea/examples/ReadOnlyInput.tsx +0 -7
- package/src/components/Form/TextArea/examples/ShadowArea.tsx +0 -28
- package/src/components/Form/TextArea/examples/ShapeInput.tsx +0 -15
- package/src/components/Form/TextArea/examples/SizeInput.tsx +0 -16
- package/src/components/Form/TextArea/examples/StylesInput.tsx +0 -32
- package/src/components/Form/TextArea/examples/VariantsInputs.tsx +0 -15
- package/src/components/Form/TextArea/examples/index.ts +0 -15
- package/src/components/Form/TextArea/styles.css +0 -7
- package/src/components/Form/TextField/TextField/TextField.props.ts +0 -134
- package/src/components/Form/TextField/TextField/TextField.state.ts +0 -21
- package/src/components/Form/TextField/TextField/TextField.type.d.ts +0 -15
- package/src/components/Form/TextField/TextField/TextField.view.tsx +0 -170
- package/src/components/Form/TextField/TextField.md +0 -193
- package/src/components/Form/TextField/TextField.tsx +0 -14
- package/src/components/Form/TextField/examples/ClearInput.tsx +0 -13
- package/src/components/Form/TextField/examples/ColorScheme.tsx +0 -13
- package/src/components/Form/TextField/examples/Default.tsx +0 -23
- package/src/components/Form/TextField/examples/DisabledInput.tsx +0 -7
- package/src/components/Form/TextField/examples/ErrorInput.tsx +0 -74
- package/src/components/Form/TextField/examples/FormikErrorInput.tsx +0 -76
- package/src/components/Form/TextField/examples/FormikHelperText.tsx +0 -62
- package/src/components/Form/TextField/examples/HelperText.tsx +0 -60
- package/src/components/Form/TextField/examples/LabelInput.tsx +0 -23
- package/src/components/Form/TextField/examples/LeftChild.tsx +0 -8
- package/src/components/Form/TextField/examples/Placeholder.tsx +0 -23
- package/src/components/Form/TextField/examples/ReadOnlyInput.tsx +0 -7
- package/src/components/Form/TextField/examples/RightChild.tsx +0 -8
- package/src/components/Form/TextField/examples/ShapeInput.tsx +0 -15
- package/src/components/Form/TextField/examples/SizeInput.tsx +0 -16
- package/src/components/Form/TextField/examples/StylesInput.tsx +0 -33
- package/src/components/Form/TextField/examples/VariantsInputs.tsx +0 -15
- package/src/components/Form/TextField/examples/index.ts +0 -17
- package/src/components/Form/TextField/styles.css +0 -7
- package/src/components/Layout/Center/Center/Center.props.ts +0 -18
- package/src/components/Layout/Center/Center/Center.view.tsx +0 -12
- package/src/components/Layout/Center/Center.md +0 -17
- package/src/components/Layout/Center/Center.tsx +0 -11
- package/src/components/Layout/Horizontal/Horizontal/Horizontal.props.ts +0 -26
- package/src/components/Layout/Horizontal/Horizontal/Horizontal.view.tsx +0 -24
- package/src/components/Layout/Horizontal/Horizontal.md +0 -107
- package/src/components/Layout/Horizontal/Horizontal.tsx +0 -11
- package/src/components/Layout/Horizontal/examples/Default.tsx +0 -11
- package/src/components/Layout/Horizontal/examples/Justify.tsx +0 -25
- package/src/components/Layout/Horizontal/examples/Reversed.tsx +0 -11
- package/src/components/Layout/Horizontal/examples/Wrap.tsx +0 -29
- package/src/components/Layout/Horizontal/examples/index.ts +0 -4
- package/src/components/Layout/Input/FieldContainer/FieldContainer/FieldContainer.props.ts +0 -25
- package/src/components/Layout/Input/FieldContainer/FieldContainer.tsx +0 -17
- package/src/components/Layout/Input/FieldContent/FieldContent/FieldContent.props.ts +0 -75
- package/src/components/Layout/Input/FieldContent/FieldContent.tsx +0 -55
- package/src/components/Layout/Input/FieldIcons/FieldIcons/FieldIcons.props.ts +0 -12
- package/src/components/Layout/Input/FieldIcons/FieldIcons.tsx +0 -19
- package/src/components/Layout/Input/FieldLabel/FieldLabel/FieldLabel.props.ts +0 -31
- package/src/components/Layout/Input/FieldLabel/FieldLabel.tsx +0 -30
- package/src/components/Layout/Input/FieldLayout/FieldLayout/FieldLayout.props.ts +0 -29
- package/src/components/Layout/Input/FieldLayout/FieldLayout.tsx +0 -33
- package/src/components/Layout/Input/FieldWrapper/FieldWrapper.props.ts +0 -12
- package/src/components/Layout/Input/FieldWrapper/FieldWrapper.tsx +0 -11
- package/src/components/Layout/Input/HelperText/HelperText.props.ts +0 -21
- package/src/components/Layout/Input/HelperText/HelperText.tsx +0 -22
- package/src/components/Layout/Input/index.ts +0 -7
- package/src/components/Layout/Vertical/Vertical/Vertical.props.ts +0 -26
- package/src/components/Layout/Vertical/Vertical/Vertical.type.ts +0 -3
- package/src/components/Layout/Vertical/Vertical/Vertical.view.tsx +0 -23
- package/src/components/Layout/Vertical/Vertical.md +0 -120
- package/src/components/Layout/Vertical/Vertical.tsx +0 -12
- package/src/components/Layout/Vertical/examples/Default.tsx +0 -11
- package/src/components/Layout/Vertical/examples/Justify.tsx +0 -26
- package/src/components/Layout/Vertical/examples/Reversed.tsx +0 -11
- package/src/components/Layout/Vertical/examples/Wrap.tsx +0 -30
- package/src/components/Layout/Vertical/examples/index.tsx +0 -5
- package/src/components/Layout/View/View.tsx +0 -2
- package/src/components/Layout/configs/Input.style.ts +0 -45
- package/src/components/Layout/configs/Input.type.ts +0 -18
- package/src/components/Link/Link/Link.props.ts +0 -50
- package/src/components/Link/Link/Link.state.ts +0 -6
- package/src/components/Link/Link/Link.style.ts +0 -14
- package/src/components/Link/Link/Link.type.d.ts +0 -8
- package/src/components/Link/Link/Link.view.tsx +0 -44
- package/src/components/Link/Link.md +0 -61
- package/src/components/Link/Link.tsx +0 -15
- package/src/components/Link/examples/Default.tsx +0 -5
- package/src/components/Link/examples/IsExternal.tsx +0 -10
- package/src/components/Link/examples/Underline.tsx +0 -23
- package/src/components/Loader/Loader/Loader.props.ts +0 -105
- package/src/components/Loader/Loader/Loader.style.ts +0 -25
- package/src/components/Loader/Loader/Loader.type.d.ts +0 -4
- package/src/components/Loader/Loader/Loader.view.tsx +0 -138
- package/src/components/Loader/Loader.md +0 -111
- package/src/components/Loader/Loader.tsx +0 -11
- package/src/components/Loader/examples/ColorLoader.tsx +0 -13
- package/src/components/Loader/examples/DefaultLoader.tsx +0 -4
- package/src/components/Loader/examples/PositionLoader.tsx +0 -19
- package/src/components/Loader/examples/SizeLoader.tsx +0 -12
- package/src/components/Loader/examples/SpeedLoader.tsx +0 -12
- package/src/components/Loader/examples/TextLoader.tsx +0 -8
- package/src/components/Loader/examples/VariantLoader.tsx +0 -12
- package/src/components/Loader/examples/index.ts +0 -7
- package/src/components/Modal/Examples/BlurModal.tsx +0 -38
- package/src/components/Modal/Examples/CloseButtonModal.tsx +0 -44
- package/src/components/Modal/Examples/DefaultModal.tsx +0 -38
- package/src/components/Modal/Examples/FullScreenModal.tsx +0 -28
- package/src/components/Modal/Examples/ModalPosition.tsx +0 -61
- package/src/components/Modal/Examples/PreventCloseModal.tsx +0 -27
- package/src/components/Modal/Examples/ScrollModal.tsx +0 -41
- package/src/components/Modal/Examples/ShadowModal.tsx +0 -29
- package/src/components/Modal/Examples/VariantModal.tsx +0 -48
- package/src/components/Modal/Examples/index.ts +0 -9
- package/src/components/Modal/Modal/Modal.props.ts +0 -202
- package/src/components/Modal/Modal/Modal.style.ts +0 -23
- package/src/components/Modal/Modal/Modal.type.d.ts +0 -7
- package/src/components/Modal/Modal/Modal.view.tsx +0 -169
- package/src/components/Modal/Modal.md +0 -509
- package/src/components/Modal/Modal.tsx +0 -18
- package/src/components/Svg/ArrowDown.tsx +0 -32
- package/src/components/Svg/ArrowUp.tsx +0 -32
- package/src/components/Svg/Check.tsx +0 -28
- package/src/components/Svg/Close.tsx +0 -31
- package/src/components/Svg/CloseEye.tsx +0 -26
- package/src/components/Svg/DustBin.tsx +0 -29
- package/src/components/Svg/Edit.tsx +0 -34
- package/src/components/Svg/ExternalLink.tsx +0 -31
- package/src/components/Svg/Indeterminate.tsx +0 -21
- package/src/components/Svg/OpenEye.tsx +0 -26
- package/src/components/Svg/Profile.tsx +0 -40
- package/src/components/Svg/RightArrow.tsx +0 -44
- package/src/components/Svg/index.tsx +0 -12
- package/src/components/Text/Text/Text.props.ts +0 -84
- package/src/components/Text/Text/Text.style.ts +0 -34
- package/src/components/Text/Text/Text.type.d.ts +0 -14
- package/src/components/Text/Text/Text.view.tsx +0 -96
- package/src/components/Text/Text.md +0 -163
- package/src/components/Text/Text.tsx +0 -13
- package/src/components/index.tsx +0 -18
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Vertical } from 'src/components/Layout/Vertical/examples';
|
|
3
|
-
|
|
4
|
-
import { CountryPicker } from '../CountryPicker';
|
|
5
|
-
|
|
6
|
-
export const ColorCountryPicker = () => (
|
|
7
|
-
<Vertical gap={15}>
|
|
8
|
-
{['theme.primary', 'theme.secondary', 'theme.error', 'theme.success', 'theme.warning'].map((color) => (
|
|
9
|
-
<CountryPicker key={color} label={color} colorScheme={color} />
|
|
10
|
-
))}
|
|
11
|
-
</Vertical>
|
|
12
|
-
);
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Button } from 'src/components';
|
|
3
|
-
import { Vertical } from 'src/components/Layout/Vertical/examples';
|
|
4
|
-
|
|
5
|
-
import { CountryPicker } from '../CountryPicker';
|
|
6
|
-
|
|
7
|
-
export const FormCountryPicker = () => {
|
|
8
|
-
const handleSubmit = (event: any) => {
|
|
9
|
-
event.preventDefault();
|
|
10
|
-
const formData = new FormData(event.target);
|
|
11
|
-
alert(`You CountryPickered: ${formData.getAll('formItem')}`);
|
|
12
|
-
};
|
|
13
|
-
return (
|
|
14
|
-
<form onSubmit={handleSubmit}>
|
|
15
|
-
<Vertical gap={10} width="100%">
|
|
16
|
-
<CountryPicker id="formItem" name="formItem" placeholder="CountryPicker an item..." />
|
|
17
|
-
<Button type="submit" alignSelf="center">
|
|
18
|
-
Submit
|
|
19
|
-
</Button>
|
|
20
|
-
</Vertical>
|
|
21
|
-
</form>
|
|
22
|
-
);
|
|
23
|
-
};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Field, Form, Formik } from 'formik';
|
|
3
|
-
import { Button } from 'src/components';
|
|
4
|
-
import { Vertical } from 'src/components/Layout/Vertical/examples';
|
|
5
|
-
|
|
6
|
-
import { CountryPicker } from '../CountryPicker';
|
|
7
|
-
|
|
8
|
-
export const FormikCountryPicker = () => {
|
|
9
|
-
const initialValues = {
|
|
10
|
-
country: '',
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
const onSubmit = (values: any) => {
|
|
14
|
-
alert(`${values.country}`);
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
return (
|
|
18
|
-
<Formik initialValues={initialValues} onSubmit={onSubmit}>
|
|
19
|
-
{({ values, handleChange }) => (
|
|
20
|
-
<Form>
|
|
21
|
-
<Vertical gap={10}>
|
|
22
|
-
<Field
|
|
23
|
-
id="country"
|
|
24
|
-
name="country"
|
|
25
|
-
as={CountryPicker}
|
|
26
|
-
value={values.country}
|
|
27
|
-
onChange={handleChange}
|
|
28
|
-
placeholder="CountryPicker an item..."
|
|
29
|
-
/>
|
|
30
|
-
|
|
31
|
-
<Button type="submit" alignSelf="center">
|
|
32
|
-
Submit
|
|
33
|
-
</Button>
|
|
34
|
-
</Vertical>
|
|
35
|
-
</Form>
|
|
36
|
-
)}
|
|
37
|
-
</Formik>
|
|
38
|
-
);
|
|
39
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { CountryPicker } from 'src/components';
|
|
3
|
-
import { Vertical } from 'src/components/Layout/Vertical/examples';
|
|
4
|
-
|
|
5
|
-
import { Shape } from '../CountryPicker/CountryPicker.type';
|
|
6
|
-
|
|
7
|
-
export const ShapeCountryPicker = () => (
|
|
8
|
-
<Vertical gap={10}>
|
|
9
|
-
{['default', 'sharp', 'rounded', 'pillShaped'].map((shape) => (
|
|
10
|
-
<CountryPicker key={shape} label={shape} shape={shape as Shape} placeholder="Select a country..." />
|
|
11
|
-
))}
|
|
12
|
-
</Vertical>
|
|
13
|
-
);
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Vertical } from 'src/components/Layout/Vertical/examples';
|
|
3
|
-
|
|
4
|
-
import { CountryPicker } from '../CountryPicker';
|
|
5
|
-
|
|
6
|
-
export const SizeCountryPicker = () => {
|
|
7
|
-
return (
|
|
8
|
-
<Vertical gap={10}>
|
|
9
|
-
<CountryPicker name="xs" size="xs" label="xs" />
|
|
10
|
-
<CountryPicker name="sm" size="sm" label="sm" />
|
|
11
|
-
<CountryPicker name="md" size="md" label="md" />
|
|
12
|
-
<CountryPicker name="lg" size="lg" label="lg" />
|
|
13
|
-
<CountryPicker name="xl" size="xl" label="xl" />
|
|
14
|
-
</Vertical>
|
|
15
|
-
);
|
|
16
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import { CountryPicker } from '../CountryPicker';
|
|
4
|
-
|
|
5
|
-
export const StyledCountryPicker = () => (
|
|
6
|
-
<CountryPicker
|
|
7
|
-
name="colorScheme"
|
|
8
|
-
colorScheme="theme.primary"
|
|
9
|
-
styles={{
|
|
10
|
-
box: { borderRadius: 10, borderColor: 'theme.primary', borderStyle: 'solid', borderWidth: 1 },
|
|
11
|
-
text: { color: 'theme.primary' },
|
|
12
|
-
label: { fontWeight: 'bold', color: 'theme.primary' },
|
|
13
|
-
dropDown: { color: 'theme.primary' },
|
|
14
|
-
field: { color: 'theme.primary' },
|
|
15
|
-
}}
|
|
16
|
-
/>
|
|
17
|
-
);
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { CountryPicker } from 'src/components';
|
|
3
|
-
import { Vertical } from 'src/components/Layout/Vertical/examples';
|
|
4
|
-
|
|
5
|
-
import { Variant } from '../CountryPicker/CountryPicker.type';
|
|
6
|
-
|
|
7
|
-
export const VariantCountryPicker = () => (
|
|
8
|
-
<Vertical gap={10}>
|
|
9
|
-
{['outline', 'default', 'unStyled'].map((variant) => (
|
|
10
|
-
<CountryPicker key={variant} variant={variant as Variant} label={variant} placeholder="Select a country..." />
|
|
11
|
-
))}
|
|
12
|
-
</Vertical>
|
|
13
|
-
);
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export * from 'src/components/Form/CountryPicker/examples/Color';
|
|
2
|
-
export * from 'src/components/Form/CountryPicker/examples/Default';
|
|
3
|
-
export * from 'src/components/Form/CountryPicker/examples/Disabled';
|
|
4
|
-
export * from 'src/components/Form/CountryPicker/examples/Error';
|
|
5
|
-
export * from 'src/components/Form/CountryPicker/examples/Form';
|
|
6
|
-
export * from 'src/components/Form/CountryPicker/examples/HelperText';
|
|
7
|
-
export * from 'src/components/Form/CountryPicker/examples/ReadOnlyInput';
|
|
8
|
-
export * from 'src/components/Form/CountryPicker/examples/Shadow';
|
|
9
|
-
export * from 'src/components/Form/CountryPicker/examples/Shape';
|
|
10
|
-
export * from 'src/components/Form/CountryPicker/examples/SizeInput';
|
|
11
|
-
export * from 'src/components/Form/CountryPicker/examples/StylesInput';
|
|
12
|
-
export * from 'src/components/Form/CountryPicker/examples/Variant';
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import React, { CSSProperties } from 'react';
|
|
2
|
-
import { Elevation } from 'src/utils/elevation';
|
|
3
|
-
import { Shadow } from 'app-studio';
|
|
4
|
-
|
|
5
|
-
import { DatePickerStyles, Shape, Size, Variant } from './DatePicker.type';
|
|
6
|
-
|
|
7
|
-
export interface DatePickerProps {
|
|
8
|
-
/**
|
|
9
|
-
* The identifier for the DatePicker component.
|
|
10
|
-
*/
|
|
11
|
-
id?: string;
|
|
12
|
-
/**
|
|
13
|
-
* Custom icon to display when the DatePicker is checked.
|
|
14
|
-
*/
|
|
15
|
-
icon?: React.ReactNode;
|
|
16
|
-
/**
|
|
17
|
-
* Indicates whether the DatePicker has an error.
|
|
18
|
-
*/
|
|
19
|
-
error?: boolean;
|
|
20
|
-
/**
|
|
21
|
-
* Additional helper text that provides information about the field.
|
|
22
|
-
*/
|
|
23
|
-
helperText?: string;
|
|
24
|
-
/**
|
|
25
|
-
* The name of the toggle.
|
|
26
|
-
*/
|
|
27
|
-
name?: string;
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* The color scheme that changes the background color of the DatePicker.
|
|
31
|
-
*/
|
|
32
|
-
colorScheme?: string;
|
|
33
|
-
/**
|
|
34
|
-
* If true, the DatePicker cannot be selected.
|
|
35
|
-
*/
|
|
36
|
-
isReadOnly?: boolean;
|
|
37
|
-
/**
|
|
38
|
-
* If true, the DatePicker will be unusable.
|
|
39
|
-
*/
|
|
40
|
-
isDisabled?: boolean;
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* The label text for the field.
|
|
44
|
-
*/
|
|
45
|
-
label?: string;
|
|
46
|
-
/**
|
|
47
|
-
* Callback function triggered when the DatePicker value changes.
|
|
48
|
-
*/
|
|
49
|
-
onChange?: (value: any) => void;
|
|
50
|
-
/**
|
|
51
|
-
* Callback function triggered when the DatePicker value changes for IOS and Android.
|
|
52
|
-
*/
|
|
53
|
-
onChangeText?: (text: string) => void;
|
|
54
|
-
/**
|
|
55
|
-
* CSS styles for the DatePicker container and label.
|
|
56
|
-
*/
|
|
57
|
-
styles?: DatePickerStyles;
|
|
58
|
-
/**
|
|
59
|
-
* The shape that changes the outlines of the field.
|
|
60
|
-
*/
|
|
61
|
-
shape?: Shape;
|
|
62
|
-
/**
|
|
63
|
-
* Changes the style of the field.
|
|
64
|
-
*/
|
|
65
|
-
variant?: Variant;
|
|
66
|
-
/**
|
|
67
|
-
* The size that sets the height and width of the DatePicker.
|
|
68
|
-
*/
|
|
69
|
-
size?: Size;
|
|
70
|
-
/**
|
|
71
|
-
* Adds a shadow effect to the DatePicker.
|
|
72
|
-
*/
|
|
73
|
-
shadow?: Shadow | Elevation | CSSProperties;
|
|
74
|
-
/**
|
|
75
|
-
* Other properties that can be passed to the component.
|
|
76
|
-
*/
|
|
77
|
-
[x: string]: any;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
export interface DatePickerViewProps extends DatePickerProps {
|
|
81
|
-
/**
|
|
82
|
-
* The selected date value as a string.
|
|
83
|
-
*/
|
|
84
|
-
date: string;
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* A function to set the selected date value.
|
|
88
|
-
* @param {string} newDate - The new date value to set.
|
|
89
|
-
*/
|
|
90
|
-
setDate: (newDate: string) => void;
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Flag indicating if the date picker is currently being hovered.
|
|
94
|
-
*/
|
|
95
|
-
isHovered: boolean;
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* A function to set the hovered state of the date picker.
|
|
99
|
-
* @param {boolean} hovered - The hovered state to set.
|
|
100
|
-
*/
|
|
101
|
-
setIsHovered: (hovered: boolean) => void;
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* Flag indicating if the date picker is currently focused.
|
|
105
|
-
*/
|
|
106
|
-
isFocused: boolean;
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* A function to set the focus state of the date picker.
|
|
110
|
-
* @param {boolean} focused - The focus state to set.
|
|
111
|
-
*/
|
|
112
|
-
setIsFocused: (focused: boolean) => void;
|
|
113
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import format from 'date-fns/format';
|
|
3
|
-
|
|
4
|
-
export const useDatePickerState = () => {
|
|
5
|
-
const [isHovered, setIsHovered] = React.useState(false);
|
|
6
|
-
const [isFocused, setIsFocused] = React.useState(false);
|
|
7
|
-
const [date, setDate] = React.useState(format(new Date(), 'yyyy-MM-dd'));
|
|
8
|
-
|
|
9
|
-
return {
|
|
10
|
-
date,
|
|
11
|
-
setDate,
|
|
12
|
-
isHovered,
|
|
13
|
-
setIsHovered,
|
|
14
|
-
isFocused,
|
|
15
|
-
setIsFocused,
|
|
16
|
-
};
|
|
17
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Size } from './DatePicker.type';
|
|
2
|
-
|
|
3
|
-
export const IconSizes: Record<Size, string> = {
|
|
4
|
-
xs: '8px',
|
|
5
|
-
sm: '10px',
|
|
6
|
-
md: '12px',
|
|
7
|
-
lg: '14px',
|
|
8
|
-
xl: '16px',
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export const LabelSizes: Record<Size, number> = {
|
|
12
|
-
xs: 8,
|
|
13
|
-
sm: 10,
|
|
14
|
-
md: 12,
|
|
15
|
-
lg: 14,
|
|
16
|
-
xl: 16,
|
|
17
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export type Size = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
2
|
-
|
|
3
|
-
export type DatePickerStyles = {
|
|
4
|
-
box?: CSSProperties;
|
|
5
|
-
text?: CSSProperties;
|
|
6
|
-
label?: CSSProperties;
|
|
7
|
-
helperText?: CSSProperties;
|
|
8
|
-
field?: CSSProperties;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export type Position = 'top' | 'left' | 'right' | 'bottom';
|
|
12
|
-
|
|
13
|
-
export type Shape = 'default' | 'sharp' | 'rounded' | 'pillShaped';
|
|
14
|
-
|
|
15
|
-
export type Variant = 'default' | 'outline' | 'unStyled';
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Input, Typography } from 'app-studio';
|
|
3
|
-
import { FieldContainer } from 'src/components/Layout/Input/FieldContainer/FieldContainer';
|
|
4
|
-
import { FieldContent } from 'src/components/Layout/Input/FieldContent/FieldContent';
|
|
5
|
-
import { FieldLabel } from 'src/components/Layout/Input/FieldLabel/FieldLabel';
|
|
6
|
-
import { FieldWrapper } from 'src/components/Layout/Input/FieldWrapper/FieldWrapper';
|
|
7
|
-
|
|
8
|
-
import { DatePickerViewProps } from './DatePicker.props';
|
|
9
|
-
|
|
10
|
-
const DatePickerContent = (props: any) => <Input type="date" {...props} />;
|
|
11
|
-
|
|
12
|
-
const DatePickerView: React.FC<DatePickerViewProps> = ({
|
|
13
|
-
id,
|
|
14
|
-
icon,
|
|
15
|
-
name,
|
|
16
|
-
label,
|
|
17
|
-
date,
|
|
18
|
-
children,
|
|
19
|
-
helperText,
|
|
20
|
-
shadow = {},
|
|
21
|
-
size = 'md',
|
|
22
|
-
variant = 'default',
|
|
23
|
-
shape = 'default',
|
|
24
|
-
colorScheme = 'theme.primary',
|
|
25
|
-
styles = { box: {}, label: {}, helperText: {}, text: {}, field: {} },
|
|
26
|
-
error = false,
|
|
27
|
-
isHovered = false,
|
|
28
|
-
isFocused = false,
|
|
29
|
-
isDisabled = false,
|
|
30
|
-
isReadOnly = false,
|
|
31
|
-
setDate = () => {},
|
|
32
|
-
setIsFocused = () => {},
|
|
33
|
-
setIsHovered = () => {},
|
|
34
|
-
onChange,
|
|
35
|
-
onChangeText,
|
|
36
|
-
...props
|
|
37
|
-
}) => {
|
|
38
|
-
const isWithLabel = !!(isFocused && label);
|
|
39
|
-
|
|
40
|
-
const handleHover = () => setIsHovered(!isHovered);
|
|
41
|
-
const handleFocus = () => setIsFocused(true);
|
|
42
|
-
|
|
43
|
-
const handleDateChange = (event: any) => {
|
|
44
|
-
if (typeof event === 'string') {
|
|
45
|
-
setDate(event);
|
|
46
|
-
if (onChangeText) onChangeText(event);
|
|
47
|
-
} else {
|
|
48
|
-
setDate(event.target.value);
|
|
49
|
-
if (onChange) onChange(event);
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
const fieldStyles = {
|
|
54
|
-
margin: 0,
|
|
55
|
-
paddingVertical: 8,
|
|
56
|
-
paddingHorizontal: 0,
|
|
57
|
-
width: '100%',
|
|
58
|
-
heigth: '100%',
|
|
59
|
-
border: 'none',
|
|
60
|
-
on: {
|
|
61
|
-
focus: {
|
|
62
|
-
outline: 'none',
|
|
63
|
-
backgroundColor: 'transparent',
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
fontSize: Typography.fontSizes[size],
|
|
67
|
-
backgroundColor: 'transparent',
|
|
68
|
-
color: isDisabled ? 'trueGray.600' : 'blueGray.700',
|
|
69
|
-
cursor: isDisabled ? 'not-allowed' : isReadOnly ? 'auto' : 'pointer',
|
|
70
|
-
...styles['field'],
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
return (
|
|
74
|
-
<FieldContainer helperText={helperText} error={error} styles={styles}>
|
|
75
|
-
<FieldContent
|
|
76
|
-
label={label}
|
|
77
|
-
size={size}
|
|
78
|
-
error={error}
|
|
79
|
-
shape={shape}
|
|
80
|
-
styles={styles}
|
|
81
|
-
shadow={shadow}
|
|
82
|
-
variant={variant}
|
|
83
|
-
value={date}
|
|
84
|
-
color={colorScheme}
|
|
85
|
-
isHovered={isHovered}
|
|
86
|
-
isDisabled={isDisabled}
|
|
87
|
-
isReadOnly={isReadOnly}
|
|
88
|
-
isFocused={isFocused}
|
|
89
|
-
isWithLabel={isWithLabel}
|
|
90
|
-
colorScheme={colorScheme}
|
|
91
|
-
onMouseEnter={handleHover}
|
|
92
|
-
onMouseLeave={handleHover}
|
|
93
|
-
>
|
|
94
|
-
<FieldWrapper>
|
|
95
|
-
{isWithLabel && (
|
|
96
|
-
<FieldLabel htmlFor={id} color={colorScheme} error={error} {...styles}>
|
|
97
|
-
{label}
|
|
98
|
-
</FieldLabel>
|
|
99
|
-
)}
|
|
100
|
-
<DatePickerContent
|
|
101
|
-
id={id}
|
|
102
|
-
name={name}
|
|
103
|
-
value={date}
|
|
104
|
-
onFocus={handleFocus}
|
|
105
|
-
onChange={handleDateChange}
|
|
106
|
-
disabled={isDisabled}
|
|
107
|
-
readOnly={isReadOnly}
|
|
108
|
-
{...fieldStyles}
|
|
109
|
-
{...(onChangeText && { onChangeText: handleDateChange })}
|
|
110
|
-
{...props}
|
|
111
|
-
/>
|
|
112
|
-
</FieldWrapper>
|
|
113
|
-
</FieldContent>
|
|
114
|
-
</FieldContainer>
|
|
115
|
-
);
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
export default DatePickerView;
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
### **Default**
|
|
2
|
-
|
|
3
|
-
```jsx
|
|
4
|
-
<DatePicker />
|
|
5
|
-
```
|
|
6
|
-
|
|
7
|
-
### **Disabled**
|
|
8
|
-
|
|
9
|
-
“**_isDisabled_**” makes the field unusable and unwritable.
|
|
10
|
-
|
|
11
|
-
```tsx
|
|
12
|
-
<DatePicker name="disabled" isDisabled />
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
### **Read Only**
|
|
16
|
-
|
|
17
|
-
“**_isReadOnly_**” makes the field readable but not writable. Can only read the the date.
|
|
18
|
-
|
|
19
|
-
```tsx
|
|
20
|
-
<DatePicker name="readOnly" isReadOnly />
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
### **Size**
|
|
24
|
-
|
|
25
|
-
“**_size_**” modifies the date picker's font size and label. The default value is "md.
|
|
26
|
-
|
|
27
|
-
```tsx
|
|
28
|
-
import { Vertical } from "../../Layout/Vertical/Vertical";
|
|
29
|
-
|
|
30
|
-
<Vertical gap={10}>
|
|
31
|
-
<DatePicker name="xs" size="xs" />
|
|
32
|
-
<DatePicker name="sm" size="sm" />
|
|
33
|
-
<DatePicker name="md" size="md" />
|
|
34
|
-
<DatePicker name="lg" size="lg" />
|
|
35
|
-
<DatePicker name="xl" size="xl" />
|
|
36
|
-
</Vertical>;
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
### **Color Scheme**
|
|
40
|
-
|
|
41
|
-
“**_colorScheme_**” property modifies the background color of the datePicker.
|
|
42
|
-
|
|
43
|
-
```jsx
|
|
44
|
-
import { Vertical } from "../../Layout/Vertical/Vertical";
|
|
45
|
-
|
|
46
|
-
<Vertical gap={15}>
|
|
47
|
-
{["theme.primary", "theme.secondary", "theme.error", "theme.success", "warning"].map((color) => (
|
|
48
|
-
<DatePicker key={color} name={color} colorScheme={color} />
|
|
49
|
-
))}
|
|
50
|
-
</Vertical>;
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
### **Error**
|
|
54
|
-
|
|
55
|
-
“**_error_**” indicate the presence of an issue or problem with the field
|
|
56
|
-
|
|
57
|
-
```tsx
|
|
58
|
-
<DatePicker id="error" name="error" error />
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
### **Helper Text**
|
|
62
|
-
|
|
63
|
-
“**_helperTex_**t” a text to provides additional information about the field.
|
|
64
|
-
|
|
65
|
-
```jsx
|
|
66
|
-
<DatePicker
|
|
67
|
-
id="helper"
|
|
68
|
-
name="helper"
|
|
69
|
-
helperText="Please select another date"
|
|
70
|
-
error
|
|
71
|
-
/>
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
### **Shadow**
|
|
75
|
-
|
|
76
|
-
“**_shadow_**” applies a shadow effects to the date picker.
|
|
77
|
-
|
|
78
|
-
```tsx
|
|
79
|
-
<DatePicker
|
|
80
|
-
name="shadow"
|
|
81
|
-
shadow={{
|
|
82
|
-
boxShadow: "rgba(0, 0, 0, 0.20) 0px 3px 8px",
|
|
83
|
-
}}
|
|
84
|
-
/>
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
### **Styles**
|
|
88
|
-
|
|
89
|
-
“**_styles”_** is used to customize the appearance of both the DatePicker and its associated label.
|
|
90
|
-
|
|
91
|
-
```tsx
|
|
92
|
-
<DatePicker
|
|
93
|
-
colorScheme="theme.primary"
|
|
94
|
-
styles={{
|
|
95
|
-
datePicker: { borderRadius: 10, borderColor: "color.purple" },
|
|
96
|
-
label: { color: "color.purple" },
|
|
97
|
-
}}
|
|
98
|
-
/>
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
## Types
|
|
102
|
-
|
|
103
|
-
```tsx static
|
|
104
|
-
type Size = "sm" | "md" | "lg" | "xl";
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
```jsx static
|
|
108
|
-
type Styles = {
|
|
109
|
-
box?: CSSProperties,
|
|
110
|
-
text?: CSSProperties,
|
|
111
|
-
label?: CSSProperties,
|
|
112
|
-
helperText?: CSSProperties,
|
|
113
|
-
field?: CSSProperties,ssss
|
|
114
|
-
};
|
|
115
|
-
```
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import { DatePickerProps } from './DatePicker/DatePicker.props';
|
|
4
|
-
import { useDatePickerState } from './DatePicker/DatePicker.state';
|
|
5
|
-
import DatePickerView from './DatePicker/DatePicker.view';
|
|
6
|
-
|
|
7
|
-
const DatePickerComponent: React.FC<DatePickerProps> = (props) => {
|
|
8
|
-
const datePickerStates = useDatePickerState();
|
|
9
|
-
return <DatePickerView {...datePickerStates} {...props} />;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Date picker allows users to select a date from a calendar view.
|
|
14
|
-
*/
|
|
15
|
-
export const DatePicker = DatePickerComponent;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Vertical } from 'src/components/Layout/Vertical/examples';
|
|
3
|
-
|
|
4
|
-
import { DatePicker } from '../DatePicker';
|
|
5
|
-
|
|
6
|
-
export const ColorDatePicker = () => (
|
|
7
|
-
<Vertical gap={15}>
|
|
8
|
-
{['theme.primary', 'theme.secondary', 'theme.error', 'theme.success', 'theme.warning'].map((color) => (
|
|
9
|
-
<DatePicker key={color} name="name" colorScheme={color} label="Select a date:" />
|
|
10
|
-
))}
|
|
11
|
-
</Vertical>
|
|
12
|
-
);
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Button } from 'src/components';
|
|
3
|
-
import { Horizontal } from 'src/components';
|
|
4
|
-
|
|
5
|
-
import { DatePicker } from '../DatePicker';
|
|
6
|
-
|
|
7
|
-
export const FormDatePicker = () => {
|
|
8
|
-
const handleSubmit = (event: any) => {
|
|
9
|
-
event.preventDefault();
|
|
10
|
-
const formData = new FormData(event.target);
|
|
11
|
-
alert(`You selected: ${formData.getAll('datePicker')}`);
|
|
12
|
-
};
|
|
13
|
-
return (
|
|
14
|
-
<form onSubmit={handleSubmit}>
|
|
15
|
-
<Horizontal gap={10}>
|
|
16
|
-
<DatePicker id="date" name="datePicker" />
|
|
17
|
-
<Button type="submit" marginTop={10}>
|
|
18
|
-
Submit
|
|
19
|
-
</Button>
|
|
20
|
-
</Horizontal>
|
|
21
|
-
</form>
|
|
22
|
-
);
|
|
23
|
-
};
|