@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,113 +0,0 @@
|
|
|
1
|
-
import React, { CSSProperties } from 'react';
|
|
2
|
-
import { Element } from 'app-studio';
|
|
3
|
-
import { Link } from 'src/components';
|
|
4
|
-
|
|
5
|
-
import { ButtonProps } from './Button.props';
|
|
6
|
-
import { ButtonShapes, ButtonSizes, IconSizes } from './Button.style';
|
|
7
|
-
import { Variant } from './Button.type';
|
|
8
|
-
|
|
9
|
-
const ButtonView: React.FC<ButtonProps> = ({
|
|
10
|
-
icon,
|
|
11
|
-
shadow,
|
|
12
|
-
children,
|
|
13
|
-
ariaLabel,
|
|
14
|
-
externalHref,
|
|
15
|
-
isAuto = false,
|
|
16
|
-
isFilled = false,
|
|
17
|
-
isIconRounded = false,
|
|
18
|
-
isLoading = false,
|
|
19
|
-
isDisabled = false,
|
|
20
|
-
size = 'md',
|
|
21
|
-
variant = 'filled',
|
|
22
|
-
iconPosition = 'left',
|
|
23
|
-
colorScheme = 'theme.primary',
|
|
24
|
-
shape = 'rounded',
|
|
25
|
-
onClick = () => {},
|
|
26
|
-
...props
|
|
27
|
-
}) => {
|
|
28
|
-
const isActive = !(isDisabled || isLoading);
|
|
29
|
-
|
|
30
|
-
const defaultNativeProps = { disabled: !isActive };
|
|
31
|
-
|
|
32
|
-
const buttonColor = isActive ? colorScheme : 'theme.disabled';
|
|
33
|
-
|
|
34
|
-
const ButtonVariants: Record<Variant, CSSProperties> = {
|
|
35
|
-
filled: {
|
|
36
|
-
backgroundColor: buttonColor,
|
|
37
|
-
color: 'color.white',
|
|
38
|
-
},
|
|
39
|
-
outline: {
|
|
40
|
-
backgroundColor: 'transparent',
|
|
41
|
-
borderWidth: 1,
|
|
42
|
-
borderStyle: 'solid',
|
|
43
|
-
borderColor: colorScheme,
|
|
44
|
-
color: buttonColor,
|
|
45
|
-
},
|
|
46
|
-
link: {
|
|
47
|
-
backgroundColor: 'transparent',
|
|
48
|
-
border: 'none',
|
|
49
|
-
color: buttonColor,
|
|
50
|
-
textDecorationLine: 'underline',
|
|
51
|
-
},
|
|
52
|
-
ghost: {
|
|
53
|
-
backgroundColor: 'transparent',
|
|
54
|
-
border: 'none',
|
|
55
|
-
color: buttonColor,
|
|
56
|
-
},
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
const buttonSizeStyles = ButtonSizes[size];
|
|
60
|
-
|
|
61
|
-
const buttonVariant = ButtonVariants[variant];
|
|
62
|
-
|
|
63
|
-
const scaleWidth = {
|
|
64
|
-
width: isAuto ? 'fit-content' : isFilled ? '100%' : buttonSizeStyles.width,
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
const changePadding = {
|
|
68
|
-
padding: isIconRounded ? IconSizes[size].padding : ButtonSizes[size].padding,
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
const content = (
|
|
72
|
-
<>
|
|
73
|
-
{icon && iconPosition === 'left' && !isLoading && icon}
|
|
74
|
-
{children}
|
|
75
|
-
{icon && iconPosition === 'right' && !isLoading && icon}
|
|
76
|
-
</>
|
|
77
|
-
);
|
|
78
|
-
|
|
79
|
-
return (
|
|
80
|
-
<Element
|
|
81
|
-
gap={8}
|
|
82
|
-
as="button"
|
|
83
|
-
role="button"
|
|
84
|
-
border="none"
|
|
85
|
-
color="color.white"
|
|
86
|
-
display="flex"
|
|
87
|
-
alignItems="center"
|
|
88
|
-
justifyContent="center"
|
|
89
|
-
ariaLabel={ariaLabel}
|
|
90
|
-
backgroundColor={buttonColor}
|
|
91
|
-
borderRadius={ButtonShapes[shape]}
|
|
92
|
-
onClick={props.onClick ?? onClick}
|
|
93
|
-
cursor={isActive ? 'pointer' : 'default'}
|
|
94
|
-
{...defaultNativeProps} // set default native html button properties
|
|
95
|
-
{...buttonSizeStyles} // set default width, paddings and fonts
|
|
96
|
-
{...buttonVariant} // changes default background color, color and border
|
|
97
|
-
{...scaleWidth} //changes the actual fixed width when isAuto or isFilled are true
|
|
98
|
-
{...changePadding} // changes the actual padding when variant equals to circled
|
|
99
|
-
{...shadow}
|
|
100
|
-
{...props}
|
|
101
|
-
>
|
|
102
|
-
{variant === 'link' && externalHref ? (
|
|
103
|
-
<Link href={externalHref} textDecorationColor={colorScheme} colorScheme={colorScheme} isExternal>
|
|
104
|
-
{content}
|
|
105
|
-
</Link>
|
|
106
|
-
) : (
|
|
107
|
-
content
|
|
108
|
-
)}
|
|
109
|
-
</Element>
|
|
110
|
-
);
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
export default ButtonView;
|
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
### **Import**
|
|
2
|
-
|
|
3
|
-
```tsx static
|
|
4
|
-
import { Button } from 'app-studio';
|
|
5
|
-
```
|
|
6
|
-
|
|
7
|
-
### **Default**
|
|
8
|
-
|
|
9
|
-
```tsx
|
|
10
|
-
import { Center } from '../Layout/Center/Center';
|
|
11
|
-
|
|
12
|
-
<Center width="100%">
|
|
13
|
-
<Button>Push Me</Button>
|
|
14
|
-
</Center>;
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
### **Disabled**
|
|
18
|
-
|
|
19
|
-
“isDisabled” makes the button unusable and un-clickable with a “disabled” look.
|
|
20
|
-
|
|
21
|
-
```tsx
|
|
22
|
-
import { Center } from '../Layout/Center/Center';
|
|
23
|
-
<Center width="100%">
|
|
24
|
-
<Button isDisabled>Disabled</Button>
|
|
25
|
-
</Center>;
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
### **Size**
|
|
29
|
-
|
|
30
|
-
“size” alters the padding, text size, and border of the button. This attribute belongs to the "Sizes" type and has a default value of "md".
|
|
31
|
-
|
|
32
|
-
```jsx
|
|
33
|
-
import { Vertical } from '../Layout/Vertical/Vertical';
|
|
34
|
-
|
|
35
|
-
<Vertical gap={10}>
|
|
36
|
-
{['xs', 'sm', 'md', 'lg', 'xl'].map((size, index) => (
|
|
37
|
-
<Button key={index} size={size}>
|
|
38
|
-
{size}
|
|
39
|
-
</Button>
|
|
40
|
-
))}
|
|
41
|
-
<Button isAuto>Auto Width</Button>
|
|
42
|
-
<Button isFilled>Full Width</Button>
|
|
43
|
-
</Vertical>;
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
### **ColorScheme**
|
|
47
|
-
|
|
48
|
-
“colorScheme” allows you to modify the background color of the button. It accepts a value from the "ColorThemes" type, with the default color set to "theme.primary".
|
|
49
|
-
|
|
50
|
-
```tsx
|
|
51
|
-
import { Horizontal } from '../Layout/Horizontal/Horizontal';
|
|
52
|
-
|
|
53
|
-
<Horizontal justify="space-evenly" gap={10}>
|
|
54
|
-
{['theme.primary', 'theme.secondary', 'theme.warning', 'theme.success', 'theme.error'].map((color, index) => (
|
|
55
|
-
<Button key={index} colorScheme={color} isAuto>
|
|
56
|
-
{color}
|
|
57
|
-
</Button>
|
|
58
|
-
))}
|
|
59
|
-
</Horizontal>;
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
### **Shadow**
|
|
63
|
-
|
|
64
|
-
"shadow" attribute applies a shadow effect to the button.
|
|
65
|
-
|
|
66
|
-
```tsx
|
|
67
|
-
import { Center } from '../Layout/Center/Center';
|
|
68
|
-
<Center width="100%">
|
|
69
|
-
<Button shadow={{ boxShadow: 'rgb(249, 115, 22) 0px 4px 14px 0px' }}>Click Me</Button>
|
|
70
|
-
</Center>;
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
### **Loading**
|
|
74
|
-
|
|
75
|
-
"isLoading" and "loading" attributes display a loading animation, which indicates that an action is in progress.
|
|
76
|
-
|
|
77
|
-
```tsx
|
|
78
|
-
import { Loading } from '../Loader/Loader';
|
|
79
|
-
import { Text } from '../Text/Text';
|
|
80
|
-
import { Center } from '../Layout/Center/Center';
|
|
81
|
-
|
|
82
|
-
<Center width="100%">
|
|
83
|
-
<Button isLoading>
|
|
84
|
-
<Loading loaderColor="white" />
|
|
85
|
-
<Text size="sm">Submitting</Text>
|
|
86
|
-
</Button>
|
|
87
|
-
</Center>;
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
### **Variant**
|
|
91
|
-
|
|
92
|
-
"variant" allows for the customization of the button's styles. The attribute belongs to the "Variants" type and has a default variant of "filled".
|
|
93
|
-
|
|
94
|
-
```tsx
|
|
95
|
-
import { Horizontal } from '../Layout/Horizontal/Horizontal';
|
|
96
|
-
|
|
97
|
-
<Horizontal justify="space-evenly" gap={10}>
|
|
98
|
-
{['filled', 'outline', 'link', 'ghost'].map((variant, index) => (
|
|
99
|
-
<Button key={index} variant={variant} colorScheme="theme.primary" isAuto>
|
|
100
|
-
{variant}
|
|
101
|
-
</Button>
|
|
102
|
-
))}
|
|
103
|
-
</Horizontal>;
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
### **Shape**
|
|
107
|
-
|
|
108
|
-
“shape” property changes the edges of the button. This property belongs to the "Shapes" type and has a default value of "rounded".
|
|
109
|
-
|
|
110
|
-
```tsx
|
|
111
|
-
import { Horizontal } from '../Layout/Horizontal/Horizontal';
|
|
112
|
-
|
|
113
|
-
<Horizontal justify="space-evenly" wrap="nowrap" gap={10}>
|
|
114
|
-
{['sharp', 'rounded', 'pillShaped'].map((border, index) => (
|
|
115
|
-
<Button key={index} shape={border} isAuto>
|
|
116
|
-
{border}
|
|
117
|
-
</Button>
|
|
118
|
-
))}
|
|
119
|
-
</Horizontal>;
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
### **Icon**
|
|
123
|
-
|
|
124
|
-
“icon” provides the flexibility to incorporate any desired icon within the button.
|
|
125
|
-
|
|
126
|
-
```tsx
|
|
127
|
-
import { Center } from '../Layout/Center/Center';
|
|
128
|
-
import { DustBinSvg } from '../Svg/DustBin';
|
|
129
|
-
|
|
130
|
-
<Center justifyContent="space-evenly">
|
|
131
|
-
<Button icon={<BsBucket size={24} />} height={48}>
|
|
132
|
-
Delete
|
|
133
|
-
</Button>
|
|
134
|
-
<Button height={48} icon={<DustBinSvg size={24} />} shape={'pillShaped'} iconPosition="right" colorScheme="theme.secondary">
|
|
135
|
-
Delete
|
|
136
|
-
</Button>
|
|
137
|
-
<Button icon={<DustBinSvg size={24} />} colorScheme="color.black" isIconRounded isAuto />
|
|
138
|
-
</Center>;
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
### Types
|
|
142
|
-
|
|
143
|
-
#### Sizes
|
|
144
|
-
|
|
145
|
-
```tsx static
|
|
146
|
-
type ButtonSizes = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
#### Variants
|
|
150
|
-
|
|
151
|
-
```tsx static
|
|
152
|
-
type Variants = 'filled' | 'outline' | 'link' | 'ghost';
|
|
153
|
-
```
|
|
154
|
-
|
|
155
|
-
#### IconPositions
|
|
156
|
-
|
|
157
|
-
```tsx static
|
|
158
|
-
type IconPositions = 'left' | 'right';
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
#### Shapes
|
|
162
|
-
|
|
163
|
-
```tsx static
|
|
164
|
-
type Shapes = 'sharp' | 'rounded' | 'pillShaped';
|
|
165
|
-
```
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import { ButtonProps } from './Button/Button.props';
|
|
4
|
-
import { useButtonState } from './Button/Button.state';
|
|
5
|
-
import ButtonView from './Button/Button.view';
|
|
6
|
-
|
|
7
|
-
const ButtonComponent: React.FC<ButtonProps> = (props) => {
|
|
8
|
-
const { isHovered, setIsHovered } = useButtonState();
|
|
9
|
-
const handleHover = () => setIsHovered(!isHovered);
|
|
10
|
-
|
|
11
|
-
return (
|
|
12
|
-
<ButtonView
|
|
13
|
-
onMouseEnter={handleHover}
|
|
14
|
-
onMouseLeave={handleHover}
|
|
15
|
-
filter={isHovered ? 'brightness(0.85)' : 'brightness(1)'}
|
|
16
|
-
{...props}
|
|
17
|
-
/>
|
|
18
|
-
);
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Buttons allow us to trigger an event or an action with a single click.
|
|
23
|
-
*/
|
|
24
|
-
export const Button = ButtonComponent;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Button, Horizontal } from 'src/components';
|
|
3
|
-
|
|
4
|
-
export const ExternalButton = () => (
|
|
5
|
-
<Horizontal gap={10}>
|
|
6
|
-
<Button colorScheme="theme.secondary" type="button" autofocus>
|
|
7
|
-
Button
|
|
8
|
-
</Button>
|
|
9
|
-
<Button colorScheme="theme.secondary" type="submit">
|
|
10
|
-
Button
|
|
11
|
-
</Button>
|
|
12
|
-
</Horizontal>
|
|
13
|
-
);
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Button, Horizontal } from 'src/components';
|
|
3
|
-
|
|
4
|
-
import { Shape } from '../Button/Button.type';
|
|
5
|
-
|
|
6
|
-
export const BorderedButtons = () => (
|
|
7
|
-
<Horizontal gap={15}>
|
|
8
|
-
{['sharp', 'rounded', 'pillShaped'].map((border, index) => (
|
|
9
|
-
<Button key={index} shape={border as Shape} isAuto>
|
|
10
|
-
{border}
|
|
11
|
-
</Button>
|
|
12
|
-
))}
|
|
13
|
-
</Horizontal>
|
|
14
|
-
);
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Button, Horizontal } from 'src/components';
|
|
3
|
-
|
|
4
|
-
export const ColoredButtons = () => (
|
|
5
|
-
<Horizontal gap={10}>
|
|
6
|
-
{['theme.primary', 'theme.secondary', 'theme.warning', 'theme.success', 'theme.error'].map((color, index) => (
|
|
7
|
-
<Button key={index} colorScheme={color} isAuto>
|
|
8
|
-
{color}
|
|
9
|
-
</Button>
|
|
10
|
-
))}
|
|
11
|
-
</Horizontal>
|
|
12
|
-
);
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Button, Center } from 'src/components';
|
|
3
|
-
import { DustBinSvg } from 'src/components/Svg';
|
|
4
|
-
|
|
5
|
-
import { Shape } from '../Button/Button.type';
|
|
6
|
-
|
|
7
|
-
export const IconButtons = () => (
|
|
8
|
-
<Center gap={15}>
|
|
9
|
-
<Button icon={<DustBinSvg size={24} />} height={48}>
|
|
10
|
-
Delete
|
|
11
|
-
</Button>
|
|
12
|
-
<Button
|
|
13
|
-
height={48}
|
|
14
|
-
icon={<DustBinSvg size={24} />}
|
|
15
|
-
shape={'pillShaped' as Shape}
|
|
16
|
-
iconPosition="right"
|
|
17
|
-
colorScheme="theme.secondary"
|
|
18
|
-
>
|
|
19
|
-
Delete
|
|
20
|
-
</Button>
|
|
21
|
-
<Button icon={<DustBinSvg size={24} />} colorScheme="theme.primary" isIconRounded isAuto />
|
|
22
|
-
</Center>
|
|
23
|
-
);
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Button, Loading, Vertical } from 'src/components';
|
|
3
|
-
|
|
4
|
-
export const LoadingButtons = () => (
|
|
5
|
-
<Vertical gap={15}>
|
|
6
|
-
<Button isLoading isFilled>
|
|
7
|
-
{<Loading />}
|
|
8
|
-
</Button>
|
|
9
|
-
<Button isLoading isFilled>
|
|
10
|
-
<Loading
|
|
11
|
-
type="dotted"
|
|
12
|
-
styles={{
|
|
13
|
-
loader: { color: 'color.white' },
|
|
14
|
-
text: {
|
|
15
|
-
color: 'color.black',
|
|
16
|
-
},
|
|
17
|
-
}}
|
|
18
|
-
>
|
|
19
|
-
Loading
|
|
20
|
-
</Loading>
|
|
21
|
-
</Button>
|
|
22
|
-
<Button isLoading isFilled>
|
|
23
|
-
<Loading
|
|
24
|
-
type="quarter"
|
|
25
|
-
textPosition="right"
|
|
26
|
-
styles={{ loader: { color: 'color.black' }, text: { color: 'color.black' } }}
|
|
27
|
-
>
|
|
28
|
-
Submitting
|
|
29
|
-
</Loading>
|
|
30
|
-
</Button>
|
|
31
|
-
</Vertical>
|
|
32
|
-
);
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Button, Vertical } from 'src/components';
|
|
3
|
-
|
|
4
|
-
import { Size } from '../Button/Button.type';
|
|
5
|
-
|
|
6
|
-
export const ButtonSizes = () => (
|
|
7
|
-
<Vertical gap={10}>
|
|
8
|
-
{['xs', 'sm', 'md', 'lg', 'xl'].map((size, index) => (
|
|
9
|
-
<Button key={index} size={size as Size}>
|
|
10
|
-
Button
|
|
11
|
-
</Button>
|
|
12
|
-
))}
|
|
13
|
-
<Button isAuto>Auto Width</Button>
|
|
14
|
-
<Button isFilled>Fill Width</Button>
|
|
15
|
-
</Vertical>
|
|
16
|
-
);
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Button, Vertical } from 'src/components';
|
|
3
|
-
|
|
4
|
-
import { Variant } from '../Button/Button.type';
|
|
5
|
-
|
|
6
|
-
export const VariantButtons = () => (
|
|
7
|
-
<Vertical gap={15}>
|
|
8
|
-
{['filled', 'outline', 'link', 'ghost'].map((variant, index) => (
|
|
9
|
-
<Button
|
|
10
|
-
key={index}
|
|
11
|
-
externalHref="https://www.npmjs.com/package/app-studio"
|
|
12
|
-
variant={variant as Variant}
|
|
13
|
-
colorScheme="theme.primary"
|
|
14
|
-
isFilled
|
|
15
|
-
>
|
|
16
|
-
{variant}
|
|
17
|
-
</Button>
|
|
18
|
-
))}
|
|
19
|
-
</Vertical>
|
|
20
|
-
);
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export * from 'src/components/Button/examples/BorderedButtons';
|
|
2
|
-
export * from 'src/components/Button/examples/ColoredButtons';
|
|
3
|
-
export * from 'src/components/Button/examples/DefaultButton';
|
|
4
|
-
export * from 'src/components/Button/examples/DisabledButton';
|
|
5
|
-
export * from 'src/components/Button/examples/IconButtons';
|
|
6
|
-
export * from 'src/components/Button/examples/LoadingButtons';
|
|
7
|
-
export * from 'src/components/Button/examples/ShadowButton';
|
|
8
|
-
export * from 'src/components/Button/examples/SizeButtons';
|
|
9
|
-
export * from 'src/components/Button/examples/VariantButtons';
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import React, { CSSProperties } from 'react';
|
|
2
|
-
import { Elevation } from 'src/utils/elevation';
|
|
3
|
-
import { Shadow } from 'app-studio';
|
|
4
|
-
|
|
5
|
-
import { CheckboxStyles, Size } from './Checkbox.type';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Represents the properties for a checkbox component.
|
|
9
|
-
*/
|
|
10
|
-
export interface CheckboxProps {
|
|
11
|
-
/**
|
|
12
|
-
* The identifier for the checkbox.
|
|
13
|
-
*/
|
|
14
|
-
id?: string;
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Custom icon to be displayed when the checkbox is checked.
|
|
18
|
-
*/
|
|
19
|
-
icon?: React.ReactNode;
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Indicates whether the checkbox has an error.
|
|
23
|
-
*/
|
|
24
|
-
error?: boolean;
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* The name of the checkbox element.
|
|
28
|
-
*/
|
|
29
|
-
name?: string;
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* The label of the checkbox.
|
|
33
|
-
*/
|
|
34
|
-
label?: string;
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Changes the background color of the checkbox.
|
|
38
|
-
*/
|
|
39
|
-
colorScheme?: string;
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Give control on the selected state of the checkbox component.
|
|
43
|
-
*/
|
|
44
|
-
isChecked?: boolean;
|
|
45
|
-
/**
|
|
46
|
-
* Allows you to set the initial state of the checkbox without controlling its value
|
|
47
|
-
*/
|
|
48
|
-
defaultIsSelected?: boolean;
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* If true, the checkbox cannot be interacted with.
|
|
52
|
-
*/
|
|
53
|
-
isReadOnly?: boolean;
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* If true, the checkbox is disabled and cannot be selected.
|
|
57
|
-
*/
|
|
58
|
-
isDisabled?: boolean;
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Indicates that the checkbox is neither checked nor unchecked.
|
|
62
|
-
*/
|
|
63
|
-
isIndeterminate?: boolean;
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Handler function called when the controlled checkbox value changes.
|
|
67
|
-
*/
|
|
68
|
-
onChange?: Function;
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Handler function called when the checkbox value changes on iOS and Android devices.
|
|
72
|
-
*/
|
|
73
|
-
onValueChange?: Function;
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* CSS styles
|
|
77
|
-
*/
|
|
78
|
-
styles?: CheckboxStyles;
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Sets the height and width of the checkbox.
|
|
82
|
-
*/
|
|
83
|
-
size?: Size;
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* Sets a shadow effect for the checkbox.
|
|
87
|
-
*/
|
|
88
|
-
shadow?: Shadow | Elevation | CSSProperties;
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* Other additional properties.
|
|
92
|
-
*/
|
|
93
|
-
[x: string]: any;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
export interface CheckboxViewProps extends CheckboxProps {
|
|
97
|
-
/**
|
|
98
|
-
* Indicates whether the checkbox is currently being hovered.
|
|
99
|
-
*/
|
|
100
|
-
isHovered?: boolean;
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* A function to set the hovered state of the checkbox.
|
|
104
|
-
* @param hovered - The hovered state to set.
|
|
105
|
-
*/
|
|
106
|
-
setIsHovered?: (hovered: boolean) => void;
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* Indicates whether the checkbox is selected/checked.
|
|
110
|
-
*/
|
|
111
|
-
isChecked?: boolean;
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* A function to set the selected state of the checkbox.
|
|
115
|
-
* @param selected - The selected state to set.
|
|
116
|
-
*/
|
|
117
|
-
setIsChecked?: (selected: boolean) => void;
|
|
118
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import { CheckboxProps } from './Checkbox.props';
|
|
4
|
-
|
|
5
|
-
export const useCheckboxState = ({ defaultIsSelected = false }: CheckboxProps) => {
|
|
6
|
-
const [isHovered, setIsHovered] = React.useState(false);
|
|
7
|
-
const [isSelected, setIsSelected] = React.useState<boolean>(defaultIsSelected);
|
|
8
|
-
|
|
9
|
-
return {
|
|
10
|
-
isHovered,
|
|
11
|
-
setIsHovered,
|
|
12
|
-
isSelected,
|
|
13
|
-
setIsSelected,
|
|
14
|
-
};
|
|
15
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { CSSProperties } from 'react';
|
|
2
|
-
|
|
3
|
-
import { Size } from './Checkbox.type';
|
|
4
|
-
|
|
5
|
-
export const Sizes: Record<Size, CSSProperties> = {
|
|
6
|
-
xs: { height: 8, width: 8 },
|
|
7
|
-
sm: { height: 12, width: 12 },
|
|
8
|
-
md: { height: 18, width: 18 },
|
|
9
|
-
lg: { height: 24, width: 24 },
|
|
10
|
-
xl: { height: 30, width: 30 },
|
|
11
|
-
'2xl': { height: 36, width: 36 },
|
|
12
|
-
'3xl': { height: 42, width: 42 },
|
|
13
|
-
'4xl': { height: 48, width: 48 },
|
|
14
|
-
'5xl': { height: 54, width: 54 },
|
|
15
|
-
'6xl': { height: 60, width: 60 },
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export const IconSizes: Record<Size, number> = {
|
|
19
|
-
xs: 6,
|
|
20
|
-
sm: 12,
|
|
21
|
-
md: 18,
|
|
22
|
-
lg: 24,
|
|
23
|
-
xl: 30,
|
|
24
|
-
'2xl': 36,
|
|
25
|
-
'3xl': 42,
|
|
26
|
-
'4xl': 48,
|
|
27
|
-
'5xl': 54,
|
|
28
|
-
'6xl': 60,
|
|
29
|
-
};
|