@app-studio/web 0.1.0
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/LICENSE +448 -0
- package/README.md +50 -0
- package/dist/App.d.ts +3 -0
- package/dist/components/Button/Button/Button.props.d.ts +77 -0
- package/dist/components/Button/Button/Button.state.d.ts +5 -0
- package/dist/components/Button/Button/Button.style.d.ts +5 -0
- package/dist/components/Button/Button/Button.view.d.ts +4 -0
- package/dist/components/Button/Button.d.ts +6 -0
- package/dist/components/Button/examples/AutoFocusButton.d.ts +2 -0
- package/dist/components/Button/examples/BorderedButtons.d.ts +2 -0
- package/dist/components/Button/examples/ColoredButtons.d.ts +2 -0
- package/dist/components/Button/examples/DefaultButton.d.ts +2 -0
- package/dist/components/Button/examples/DisabledButton.d.ts +2 -0
- package/dist/components/Button/examples/IconButtons.d.ts +2 -0
- package/dist/components/Button/examples/LoadingButtons.d.ts +2 -0
- package/dist/components/Button/examples/ShadowButton.d.ts +2 -0
- package/dist/components/Button/examples/SizeButtons.d.ts +2 -0
- package/dist/components/Button/examples/VariantButtons.d.ts +2 -0
- package/dist/components/Button/examples/index.d.ts +9 -0
- package/dist/components/Form/Checkbox/Checkbox/Checkbox.props.d.ts +97 -0
- package/dist/components/Form/Checkbox/Checkbox/Checkbox.state.d.ts +8 -0
- package/dist/components/Form/Checkbox/Checkbox/Checkbox.style.d.ts +4 -0
- package/dist/components/Form/Checkbox/Checkbox/Checkbox.view.d.ts +4 -0
- package/dist/components/Form/Checkbox/Checkbox.d.ts +6 -0
- package/dist/components/Form/Checkbox/examples/ColorScheme.d.ts +2 -0
- package/dist/components/Form/Checkbox/examples/Default.d.ts +2 -0
- package/dist/components/Form/Checkbox/examples/DisabledInput.d.ts +2 -0
- package/dist/components/Form/Checkbox/examples/ErrorCheckbox.d.ts +2 -0
- package/dist/components/Form/Checkbox/examples/FormCheckout.d.ts +2 -0
- package/dist/components/Form/Checkbox/examples/IconCheckbox.d.ts +2 -0
- package/dist/components/Form/Checkbox/examples/IndeterminateCheckbox.d.ts +2 -0
- package/dist/components/Form/Checkbox/examples/ReadOnlyInput.d.ts +2 -0
- package/dist/components/Form/Checkbox/examples/Shadow.d.ts +2 -0
- package/dist/components/Form/Checkbox/examples/SizeInput.d.ts +2 -0
- package/dist/components/Form/Checkbox/examples/StylesInput.d.ts +2 -0
- package/dist/components/Form/Checkbox/examples/index.d.ts +11 -0
- package/dist/components/Form/CountryPicker/CountryPicker/CountryPicker.props.d.ts +173 -0
- package/dist/components/Form/CountryPicker/CountryPicker/CountryPicker.state.d.ts +15 -0
- package/dist/components/Form/CountryPicker/CountryPicker/CountryPicker.style.d.ts +3 -0
- package/dist/components/Form/CountryPicker/CountryPicker/CountryPicker.view.d.ts +6 -0
- package/dist/components/Form/CountryPicker/CountryPicker.d.ts +6 -0
- package/dist/components/Form/CountryPicker/examples/Color.d.ts +2 -0
- package/dist/components/Form/CountryPicker/examples/Default.d.ts +2 -0
- package/dist/components/Form/CountryPicker/examples/Disabled.d.ts +2 -0
- package/dist/components/Form/CountryPicker/examples/Error.d.ts +2 -0
- package/dist/components/Form/CountryPicker/examples/Form.d.ts +2 -0
- package/dist/components/Form/CountryPicker/examples/Formik.d.ts +2 -0
- package/dist/components/Form/CountryPicker/examples/HelperText.d.ts +2 -0
- package/dist/components/Form/CountryPicker/examples/ReadOnlyInput.d.ts +2 -0
- package/dist/components/Form/CountryPicker/examples/Shadow.d.ts +2 -0
- package/dist/components/Form/CountryPicker/examples/Shape.d.ts +2 -0
- package/dist/components/Form/CountryPicker/examples/SizeInput.d.ts +2 -0
- package/dist/components/Form/CountryPicker/examples/StylesInput.d.ts +2 -0
- package/dist/components/Form/CountryPicker/examples/Variant.d.ts +2 -0
- package/dist/components/Form/CountryPicker/examples/index.d.ts +12 -0
- package/dist/components/Form/DatePicker/DatePicker/DatePicker.props.d.ts +103 -0
- package/dist/components/Form/DatePicker/DatePicker/DatePicker.state.d.ts +9 -0
- package/dist/components/Form/DatePicker/DatePicker/DatePicker.style.d.ts +3 -0
- package/dist/components/Form/DatePicker/DatePicker/DatePicker.view.d.ts +4 -0
- package/dist/components/Form/DatePicker/DatePicker.d.ts +6 -0
- package/dist/components/Form/DatePicker/examples/ColorScheme.d.ts +2 -0
- package/dist/components/Form/DatePicker/examples/Default.d.ts +2 -0
- package/dist/components/Form/DatePicker/examples/DisabledInput.d.ts +2 -0
- package/dist/components/Form/DatePicker/examples/ErrorCheckbox.d.ts +2 -0
- package/dist/components/Form/DatePicker/examples/FormCheckout.d.ts +2 -0
- package/dist/components/Form/DatePicker/examples/Formik.d.ts +2 -0
- package/dist/components/Form/DatePicker/examples/ReadOnlyInput.d.ts +2 -0
- package/dist/components/Form/DatePicker/examples/Shadow.d.ts +2 -0
- package/dist/components/Form/DatePicker/examples/SizeInput.d.ts +2 -0
- package/dist/components/Form/DatePicker/examples/StylesInput.d.ts +2 -0
- package/dist/components/Form/DatePicker/examples/helperTextDatePicker.d.ts +2 -0
- package/dist/components/Form/DatePicker/examples/index.d.ts +11 -0
- package/dist/components/Form/Label/Label/Label.props.d.ts +36 -0
- package/dist/components/Form/Label/Label/Label.style.d.ts +2 -0
- package/dist/components/Form/Label/Label/Label.type.d.ts +3 -0
- package/dist/components/Form/Label/Label/Label.view.d.ts +4 -0
- package/dist/components/Form/Label/Label.d.ts +3 -0
- package/dist/components/Form/Password/Password/Password.props.d.ts +34 -0
- package/dist/components/Form/Password/Password/Password.state.d.ts +5 -0
- package/dist/components/Form/Password/Password/Password.view.d.ts +4 -0
- package/dist/components/Form/Password/Password.d.ts +6 -0
- package/dist/components/Form/Password/example/Default.d.ts +2 -0
- package/dist/components/Form/Password/example/DisabledInput.d.ts +2 -0
- package/dist/components/Form/Password/example/ErrorInput.d.ts +2 -0
- package/dist/components/Form/Password/example/FormikErrorInput.d.ts +2 -0
- package/dist/components/Form/Password/example/FormikHelperText.d.ts +2 -0
- package/dist/components/Form/Password/example/HelperText.d.ts +2 -0
- package/dist/components/Form/Select/Select/Select.props.d.ts +234 -0
- package/dist/components/Form/Select/Select/Select.state.d.ts +16 -0
- package/dist/components/Form/Select/Select/Select.style.d.ts +4 -0
- package/dist/components/Form/Select/Select/Select.view.d.ts +5 -0
- package/dist/components/Form/Select/Select.d.ts +6 -0
- package/dist/components/Form/Select/examples/Color.d.ts +2 -0
- package/dist/components/Form/Select/examples/Default.d.ts +2 -0
- package/dist/components/Form/Select/examples/Disabled.d.ts +2 -0
- package/dist/components/Form/Select/examples/Error.d.ts +2 -0
- package/dist/components/Form/Select/examples/Form.d.ts +2 -0
- package/dist/components/Form/Select/examples/Formik.d.ts +2 -0
- package/dist/components/Form/Select/examples/HelperText.d.ts +2 -0
- package/dist/components/Form/Select/examples/Multiple.d.ts +2 -0
- package/dist/components/Form/Select/examples/ReadOnlyInput.d.ts +2 -0
- package/dist/components/Form/Select/examples/Shadow.d.ts +2 -0
- package/dist/components/Form/Select/examples/SizeInput.d.ts +2 -0
- package/dist/components/Form/Select/examples/StylesInput.d.ts +2 -0
- package/dist/components/Form/Switch/Switch/Switch.props.d.ts +72 -0
- package/dist/components/Form/Switch/Switch/Switch.state.d.ts +8 -0
- package/dist/components/Form/Switch/Switch/Switch.style.d.ts +5 -0
- package/dist/components/Form/Switch/Switch/Switch.view.d.ts +4 -0
- package/dist/components/Form/Switch/Switch.d.ts +3 -0
- package/dist/components/Form/Switch/examples/ChildSwitch.d.ts +2 -0
- package/dist/components/Form/Switch/examples/ColorScheme.d.ts +2 -0
- package/dist/components/Form/Switch/examples/Default.d.ts +2 -0
- package/dist/components/Form/Switch/examples/DisabledInput.d.ts +2 -0
- package/dist/components/Form/Switch/examples/FormSwitch.d.ts +2 -0
- package/dist/components/Form/Switch/examples/Formik.d.ts +2 -0
- package/dist/components/Form/Switch/examples/ReadOnlyInput.d.ts +2 -0
- package/dist/components/Form/Switch/examples/Shadow.d.ts +2 -0
- package/dist/components/Form/Switch/examples/SizeInput.d.ts +2 -0
- package/dist/components/Form/Switch/examples/StylesInput.d.ts +2 -0
- package/dist/components/Form/TextArea/TextArea/TextArea.props.d.ts +144 -0
- package/dist/components/Form/TextArea/TextArea/TextArea.state.d.ts +12 -0
- package/dist/components/Form/TextArea/TextArea/TextArea.type.d.ts +11 -0
- package/dist/components/Form/TextArea/TextArea/TextArea.view.d.ts +4 -0
- package/dist/components/Form/TextArea/TextArea.d.ts +6 -0
- package/dist/components/Form/TextArea/examples/ColorScheme.d.ts +2 -0
- package/dist/components/Form/TextArea/examples/Default.d.ts +2 -0
- package/dist/components/Form/TextArea/examples/DisabledInput.d.ts +2 -0
- package/dist/components/Form/TextArea/examples/ErrorInput.d.ts +2 -0
- package/dist/components/Form/TextArea/examples/FormikErrorInput.d.ts +2 -0
- package/dist/components/Form/TextArea/examples/FormikHelperText.d.ts +2 -0
- package/dist/components/Form/TextArea/examples/HelperText.d.ts +2 -0
- package/dist/components/Form/TextArea/examples/LabelInput.d.ts +2 -0
- package/dist/components/Form/TextArea/examples/MaxRowCol.d.ts +2 -0
- package/dist/components/Form/TextArea/examples/Placeholder.d.ts +2 -0
- package/dist/components/Form/TextArea/examples/ReadOnlyInput.d.ts +2 -0
- package/dist/components/Form/TextArea/examples/ShadowArea.d.ts +2 -0
- package/dist/components/Form/TextArea/examples/ShapeInput.d.ts +2 -0
- package/dist/components/Form/TextArea/examples/SizeInput.d.ts +2 -0
- package/dist/components/Form/TextArea/examples/StylesInput.d.ts +2 -0
- package/dist/components/Form/TextArea/examples/VariantsInputs.d.ts +2 -0
- package/dist/components/Form/TextArea/examples/index.d.ts +15 -0
- package/dist/components/Form/TextField/TextField/TextField.props.d.ts +124 -0
- package/dist/components/Form/TextField/TextField/TextField.state.d.ts +12 -0
- package/dist/components/Form/TextField/TextField/TextField.view.d.ts +4 -0
- package/dist/components/Form/TextField/TextField.d.ts +6 -0
- package/dist/components/Form/TextField/examples/ClearInput.d.ts +2 -0
- package/dist/components/Form/TextField/examples/ColorScheme.d.ts +2 -0
- package/dist/components/Form/TextField/examples/Default.d.ts +2 -0
- package/dist/components/Form/TextField/examples/DisabledInput.d.ts +2 -0
- package/dist/components/Form/TextField/examples/ErrorInput.d.ts +2 -0
- package/dist/components/Form/TextField/examples/FormikErrorInput.d.ts +2 -0
- package/dist/components/Form/TextField/examples/FormikHelperText.d.ts +2 -0
- package/dist/components/Form/TextField/examples/HelperText.d.ts +2 -0
- package/dist/components/Form/TextField/examples/LabelInput.d.ts +2 -0
- package/dist/components/Form/TextField/examples/LeftChild.d.ts +2 -0
- package/dist/components/Form/TextField/examples/Placeholder.d.ts +2 -0
- package/dist/components/Form/TextField/examples/ReadOnlyInput.d.ts +2 -0
- package/dist/components/Form/TextField/examples/RightChild.d.ts +2 -0
- package/dist/components/Form/TextField/examples/ShapeInput.d.ts +2 -0
- package/dist/components/Form/TextField/examples/SizeInput.d.ts +2 -0
- package/dist/components/Form/TextField/examples/StylesInput.d.ts +2 -0
- package/dist/components/Form/TextField/examples/VariantsInputs.d.ts +2 -0
- package/dist/components/Form/TextField/examples/index.d.ts +17 -0
- package/dist/components/Layout/Center/Center/Center.props.d.ts +16 -0
- package/dist/components/Layout/Center/Center/Center.view.d.ts +4 -0
- package/dist/components/Layout/Center/Center.d.ts +3 -0
- package/dist/components/Layout/Horizontal/Horizontal/Horizontal.props.d.ts +24 -0
- package/dist/components/Layout/Horizontal/Horizontal/Horizontal.view.d.ts +4 -0
- package/dist/components/Layout/Horizontal/Horizontal.d.ts +3 -0
- package/dist/components/Layout/Horizontal/examples/Default.d.ts +2 -0
- package/dist/components/Layout/Horizontal/examples/Justify.d.ts +2 -0
- package/dist/components/Layout/Horizontal/examples/Reversed.d.ts +2 -0
- package/dist/components/Layout/Horizontal/examples/Wrap.d.ts +2 -0
- package/dist/components/Layout/Horizontal/examples/index.d.ts +4 -0
- package/dist/components/Layout/Input/FieldContainer/FieldContainer/FieldContainer.props.d.ts +24 -0
- package/dist/components/Layout/Input/FieldContainer/FieldContainer.d.ts +3 -0
- package/dist/components/Layout/Input/FieldContent/FieldContent/FieldContent.props.d.ts +74 -0
- package/dist/components/Layout/Input/FieldContent/FieldContent.d.ts +3 -0
- package/dist/components/Layout/Input/FieldIcons/FieldIcons/FieldIcons.props.d.ts +11 -0
- package/dist/components/Layout/Input/FieldIcons/FieldIcons.d.ts +3 -0
- package/dist/components/Layout/Input/FieldLabel/FieldLabel/FieldLabel.props.d.ts +30 -0
- package/dist/components/Layout/Input/FieldLabel/FieldLabel.d.ts +3 -0
- package/dist/components/Layout/Input/FieldLayout/FieldLayout/FieldLayout.props.d.ts +28 -0
- package/dist/components/Layout/Input/FieldLayout/FieldLayout.d.ts +3 -0
- package/dist/components/Layout/Input/FieldWrapper/FieldWrapper.d.ts +3 -0
- package/dist/components/Layout/Input/FieldWrapper/FieldWrapper.props.d.ts +11 -0
- package/dist/components/Layout/Input/HelperText/HelperText.d.ts +3 -0
- package/dist/components/Layout/Input/HelperText/HelperText.props.d.ts +20 -0
- package/dist/components/Layout/Input/index.d.ts +7 -0
- package/dist/components/Layout/Vertical/Vertical/Vertical.props.d.ts +24 -0
- package/dist/components/Layout/Vertical/Vertical/Vertical.type.d.ts +2 -0
- package/dist/components/Layout/Vertical/Vertical/Vertical.view.d.ts +4 -0
- package/dist/components/Layout/Vertical/Vertical.d.ts +3 -0
- package/dist/components/Layout/Vertical/examples/Default.d.ts +2 -0
- package/dist/components/Layout/Vertical/examples/Justify.d.ts +2 -0
- package/dist/components/Layout/Vertical/examples/Reversed.d.ts +2 -0
- package/dist/components/Layout/Vertical/examples/Wrap.d.ts +2 -0
- package/dist/components/Layout/Vertical/examples/index.d.ts +5 -0
- package/dist/components/Layout/View/View.d.ts +2 -0
- package/dist/components/Layout/configs/Input.style.d.ts +16 -0
- package/dist/components/Layout/configs/Input.type.d.ts +12 -0
- package/dist/components/Link/Link/Link.props.d.ts +47 -0
- package/dist/components/Link/Link/Link.state.d.ts +5 -0
- package/dist/components/Link/Link/Link.style.d.ts +2 -0
- package/dist/components/Link/Link/Link.view.d.ts +4 -0
- package/dist/components/Link/Link.d.ts +6 -0
- package/dist/components/Link/examples/Default.d.ts +2 -0
- package/dist/components/Link/examples/IsExternal.d.ts +2 -0
- package/dist/components/Link/examples/Underline.d.ts +2 -0
- package/dist/components/Loader/Loader/Loader.props.d.ts +93 -0
- package/dist/components/Loader/Loader/Loader.style.d.ts +4 -0
- package/dist/components/Loader/Loader/Loader.view.d.ts +4 -0
- package/dist/components/Loader/Loader.d.ts +6 -0
- package/dist/components/Loader/examples/ColorLoader.d.ts +2 -0
- package/dist/components/Loader/examples/DefaultLoader.d.ts +2 -0
- package/dist/components/Loader/examples/PositionLoader.d.ts +2 -0
- package/dist/components/Loader/examples/SizeLoader.d.ts +2 -0
- package/dist/components/Loader/examples/SpeedLoader.d.ts +2 -0
- package/dist/components/Loader/examples/TextLoader.d.ts +2 -0
- package/dist/components/Loader/examples/VariantLoader.d.ts +2 -0
- package/dist/components/Loader/examples/index.d.ts +7 -0
- package/dist/components/Modal/Examples/BlurModal.d.ts +2 -0
- package/dist/components/Modal/Examples/CloseButtonModal.d.ts +2 -0
- package/dist/components/Modal/Examples/DefaultModal.d.ts +2 -0
- package/dist/components/Modal/Examples/FullScreenModal.d.ts +2 -0
- package/dist/components/Modal/Examples/ModalPosition.d.ts +2 -0
- package/dist/components/Modal/Examples/PreventCloseModal.d.ts +2 -0
- package/dist/components/Modal/Examples/ScrollModal.d.ts +2 -0
- package/dist/components/Modal/Examples/ShadowModal.d.ts +2 -0
- package/dist/components/Modal/Examples/VariantModal.d.ts +2 -0
- package/dist/components/Modal/Examples/index.d.ts +9 -0
- package/dist/components/Modal/Modal/Modal.props.d.ts +178 -0
- package/dist/components/Modal/Modal/Modal.style.d.ts +5 -0
- package/dist/components/Modal/Modal/Modal.view.d.ts +7 -0
- package/dist/components/Modal/Modal.d.ts +6 -0
- package/dist/components/Svg/ArrowDown.d.ts +8 -0
- package/dist/components/Svg/ArrowUp.d.ts +8 -0
- package/dist/components/Svg/Check.d.ts +8 -0
- package/dist/components/Svg/Close.d.ts +8 -0
- package/dist/components/Svg/CloseEye.d.ts +8 -0
- package/dist/components/Svg/DustBin.d.ts +7 -0
- package/dist/components/Svg/Edit.d.ts +8 -0
- package/dist/components/Svg/ExternalLink.d.ts +8 -0
- package/dist/components/Svg/Indeterminate.d.ts +8 -0
- package/dist/components/Svg/OpenEye.d.ts +8 -0
- package/dist/components/Svg/Profile.d.ts +8 -0
- package/dist/components/Svg/RightArrow.d.ts +8 -0
- package/dist/components/Svg/index.d.ts +12 -0
- package/dist/components/Text/Text/Text.props.d.ts +77 -0
- package/dist/components/Text/Text/Text.style.d.ts +2 -0
- package/dist/components/Text/Text/Text.view.d.ts +4 -0
- package/dist/components/Text/Text.d.ts +6 -0
- package/dist/components/Wrapper.d.ts +6 -0
- package/dist/components/index.d.ts +18 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +8 -0
- package/dist/web.cjs.development.js +27 -0
- package/dist/web.cjs.development.js.map +1 -0
- package/dist/web.cjs.production.min.js +2 -0
- package/dist/web.cjs.production.min.js.map +1 -0
- package/dist/web.esm.js +23 -0
- package/dist/web.esm.js.map +1 -0
- package/package.json +153 -0
- package/src/components/Button/Button/Button.props.ts +79 -0
- package/src/components/Button/Button/Button.state.ts +7 -0
- package/src/components/Button/Button/Button.style.ts +95 -0
- package/src/components/Button/Button/Button.type.d.ts +11 -0
- package/src/components/Button/Button/Button.view.tsx +116 -0
- package/src/components/Button/Button.md +165 -0
- package/src/components/Button/Button.tsx +24 -0
- package/src/components/Button/examples/AutoFocusButton.tsx +13 -0
- package/src/components/Button/examples/BorderedButtons.tsx +14 -0
- package/src/components/Button/examples/ColoredButtons.tsx +12 -0
- package/src/components/Button/examples/DefaultButton.tsx +4 -0
- package/src/components/Button/examples/DisabledButton.tsx +13 -0
- package/src/components/Button/examples/IconButtons.tsx +23 -0
- package/src/components/Button/examples/LoadingButtons.tsx +28 -0
- package/src/components/Button/examples/ShadowButton.tsx +6 -0
- package/src/components/Button/examples/SizeButtons.tsx +16 -0
- package/src/components/Button/examples/VariantButtons.tsx +20 -0
- package/src/components/Button/examples/index.ts +9 -0
- package/src/components/Form/Checkbox/Checkbox/Checkbox.props.ts +118 -0
- package/src/components/Form/Checkbox/Checkbox/Checkbox.state.ts +15 -0
- package/src/components/Form/Checkbox/Checkbox/Checkbox.style.ts +29 -0
- package/src/components/Form/Checkbox/Checkbox/Checkbox.type.d.ts +8 -0
- package/src/components/Form/Checkbox/Checkbox/Checkbox.view.tsx +98 -0
- package/src/components/Form/Checkbox/Checkbox.md +128 -0
- package/src/components/Form/Checkbox/Checkbox.tsx +15 -0
- package/src/components/Form/Checkbox/examples/ColorScheme.tsx +12 -0
- package/src/components/Form/Checkbox/examples/Default.tsx +5 -0
- package/src/components/Form/Checkbox/examples/DisabledInput.tsx +5 -0
- package/src/components/Form/Checkbox/examples/ErrorCheckbox.tsx +5 -0
- package/src/components/Form/Checkbox/examples/FormCheckout.tsx +46 -0
- package/src/components/Form/Checkbox/examples/IconCheckbox.tsx +8 -0
- package/src/components/Form/Checkbox/examples/IndeterminateCheckbox.tsx +5 -0
- package/src/components/Form/Checkbox/examples/ReadOnlyInput.tsx +5 -0
- package/src/components/Form/Checkbox/examples/Shadow.tsx +11 -0
- package/src/components/Form/Checkbox/examples/SizeInput.tsx +18 -0
- package/src/components/Form/Checkbox/examples/StylesInput.tsx +22 -0
- package/src/components/Form/Checkbox/examples/index.ts +11 -0
- package/src/components/Form/CountryPicker/CountryPicker/CountryPicker.props.ts +187 -0
- package/src/components/Form/CountryPicker/CountryPicker/CountryPicker.state.ts +28 -0
- package/src/components/Form/CountryPicker/CountryPicker/CountryPicker.style.ts +17 -0
- package/src/components/Form/CountryPicker/CountryPicker/CountryPicker.type.d.ts +22 -0
- package/src/components/Form/CountryPicker/CountryPicker/CountryPicker.view.tsx +234 -0
- package/src/components/Form/CountryPicker/CountryPicker.md +206 -0
- package/src/components/Form/CountryPicker/CountryPicker.tsx +16 -0
- package/src/components/Form/CountryPicker/countries.json +1453 -0
- package/src/components/Form/CountryPicker/examples/Color.tsx +12 -0
- package/src/components/Form/CountryPicker/examples/Default.tsx +4 -0
- package/src/components/Form/CountryPicker/examples/Disabled.tsx +5 -0
- package/src/components/Form/CountryPicker/examples/Error.tsx +4 -0
- package/src/components/Form/CountryPicker/examples/Form.tsx +23 -0
- package/src/components/Form/CountryPicker/examples/Formik.tsx +39 -0
- package/src/components/Form/CountryPicker/examples/HelperText.tsx +5 -0
- package/src/components/Form/CountryPicker/examples/ReadOnlyInput.tsx +5 -0
- package/src/components/Form/CountryPicker/examples/Shadow.tsx +4 -0
- package/src/components/Form/CountryPicker/examples/Shape.tsx +13 -0
- package/src/components/Form/CountryPicker/examples/SizeInput.tsx +16 -0
- package/src/components/Form/CountryPicker/examples/StylesInput.tsx +19 -0
- package/src/components/Form/CountryPicker/examples/Variant.tsx +13 -0
- package/src/components/Form/CountryPicker/examples/index.ts +12 -0
- package/src/components/Form/CountryPicker/styles.css +7 -0
- package/src/components/Form/DatePicker/DatePicker/DatePicker.props.ts +113 -0
- package/src/components/Form/DatePicker/DatePicker/DatePicker.state.ts +17 -0
- package/src/components/Form/DatePicker/DatePicker/DatePicker.style.ts +17 -0
- package/src/components/Form/DatePicker/DatePicker/DatePicker.type.d.ts +15 -0
- package/src/components/Form/DatePicker/DatePicker/DatePicker.view.tsx +118 -0
- package/src/components/Form/DatePicker/DatePicker.md +115 -0
- package/src/components/Form/DatePicker/DatePicker.tsx +15 -0
- package/src/components/Form/DatePicker/examples/ColorScheme.tsx +12 -0
- package/src/components/Form/DatePicker/examples/Default.tsx +4 -0
- package/src/components/Form/DatePicker/examples/DisabledInput.tsx +5 -0
- package/src/components/Form/DatePicker/examples/ErrorCheckbox.tsx +4 -0
- package/src/components/Form/DatePicker/examples/FormCheckout.tsx +23 -0
- package/src/components/Form/DatePicker/examples/Formik.tsx +35 -0
- package/src/components/Form/DatePicker/examples/ReadOnlyInput.tsx +5 -0
- package/src/components/Form/DatePicker/examples/Shadow.tsx +10 -0
- package/src/components/Form/DatePicker/examples/SizeInput.tsx +16 -0
- package/src/components/Form/DatePicker/examples/StylesInput.tsx +14 -0
- package/src/components/Form/DatePicker/examples/helperTextDatePicker.tsx +6 -0
- package/src/components/Form/DatePicker/examples/index.ts +11 -0
- package/src/components/Form/Label/Label/Label.props.ts +36 -0
- package/src/components/Form/Label/Label/Label.style.ts +35 -0
- package/src/components/Form/Label/Label/Label.type.ts +14 -0
- package/src/components/Form/Label/Label/Label.view.tsx +35 -0
- package/src/components/Form/Label/Label.tsx +8 -0
- package/src/components/Form/Password/Password/Password.props.ts +36 -0
- package/src/components/Form/Password/Password/Password.state.ts +6 -0
- package/src/components/Form/Password/Password/Password.type.d.ts +14 -0
- package/src/components/Form/Password/Password/Password.view.tsx +32 -0
- package/src/components/Form/Password/Password.md +108 -0
- package/src/components/Form/Password/Password.tsx +15 -0
- package/src/components/Form/Password/example/Default.tsx +9 -0
- package/src/components/Form/Password/example/DisabledInput.tsx +17 -0
- package/src/components/Form/Password/example/ErrorInput.tsx +66 -0
- package/src/components/Form/Password/example/FormikErrorInput.tsx +61 -0
- package/src/components/Form/Password/example/FormikHelperText.tsx +65 -0
- package/src/components/Form/Password/example/HelperText.tsx +65 -0
- package/src/components/Form/Select/Select/Select.props.ts +262 -0
- package/src/components/Form/Select/Select/Select.state.ts +19 -0
- package/src/components/Form/Select/Select/Select.style.ts +19 -0
- package/src/components/Form/Select/Select/Select.type.d.ts +15 -0
- package/src/components/Form/Select/Select/Select.view.tsx +342 -0
- package/src/components/Form/Select/Select.md +165 -0
- package/src/components/Form/Select/Select.tsx +16 -0
- package/src/components/Form/Select/examples/Color.tsx +12 -0
- package/src/components/Form/Select/examples/Default.tsx +4 -0
- package/src/components/Form/Select/examples/Disabled.tsx +5 -0
- package/src/components/Form/Select/examples/Error.tsx +4 -0
- package/src/components/Form/Select/examples/Form.tsx +23 -0
- package/src/components/Form/Select/examples/Formik.tsx +41 -0
- package/src/components/Form/Select/examples/HelperText.tsx +7 -0
- package/src/components/Form/Select/examples/Multiple.tsx +6 -0
- package/src/components/Form/Select/examples/ReadOnlyInput.tsx +5 -0
- package/src/components/Form/Select/examples/Shadow.tsx +11 -0
- package/src/components/Form/Select/examples/SizeInput.tsx +16 -0
- package/src/components/Form/Select/examples/StylesInput.tsx +15 -0
- package/src/components/Form/Switch/Switch/Switch.props.ts +91 -0
- package/src/components/Form/Switch/Switch/Switch.state.ts +11 -0
- package/src/components/Form/Switch/Switch/Switch.style.ts +72 -0
- package/src/components/Form/Switch/Switch/Switch.type.d.ts +6 -0
- package/src/components/Form/Switch/Switch/Switch.view.tsx +78 -0
- package/src/components/Form/Switch/Switch.md +148 -0
- package/src/components/Form/Switch/Switch.tsx +12 -0
- package/src/components/Form/Switch/examples/ChildSwitch.tsx +20 -0
- package/src/components/Form/Switch/examples/ColorScheme.tsx +5 -0
- package/src/components/Form/Switch/examples/Default.tsx +4 -0
- package/src/components/Form/Switch/examples/DisabledInput.tsx +7 -0
- package/src/components/Form/Switch/examples/FormSwitch.tsx +22 -0
- package/src/components/Form/Switch/examples/Formik.tsx +30 -0
- package/src/components/Form/Switch/examples/ReadOnlyInput.tsx +7 -0
- package/src/components/Form/Switch/examples/Shadow.tsx +11 -0
- package/src/components/Form/Switch/examples/SizeInput.tsx +21 -0
- package/src/components/Form/Switch/examples/StylesInput.tsx +34 -0
- package/src/components/Form/TextArea/TextArea/TextArea.props.ts +154 -0
- package/src/components/Form/TextArea/TextArea/TextArea.state.ts +21 -0
- package/src/components/Form/TextArea/TextArea/TextArea.type.ts +15 -0
- package/src/components/Form/TextArea/TextArea/TextArea.view.tsx +143 -0
- package/src/components/Form/TextArea/TextArea.md +169 -0
- package/src/components/Form/TextArea/TextArea.tsx +15 -0
- package/src/components/Form/TextArea/examples/ColorScheme.tsx +13 -0
- package/src/components/Form/TextArea/examples/Default.tsx +5 -0
- package/src/components/Form/TextArea/examples/DisabledInput.tsx +7 -0
- package/src/components/Form/TextArea/examples/ErrorInput.tsx +50 -0
- package/src/components/Form/TextArea/examples/FormikErrorInput.tsx +52 -0
- package/src/components/Form/TextArea/examples/FormikHelperText.tsx +51 -0
- package/src/components/Form/TextArea/examples/HelperText.tsx +49 -0
- package/src/components/Form/TextArea/examples/LabelInput.tsx +23 -0
- package/src/components/Form/TextArea/examples/MaxRowCol.tsx +7 -0
- package/src/components/Form/TextArea/examples/Placeholder.tsx +23 -0
- package/src/components/Form/TextArea/examples/ReadOnlyInput.tsx +7 -0
- package/src/components/Form/TextArea/examples/ShadowArea.tsx +28 -0
- package/src/components/Form/TextArea/examples/ShapeInput.tsx +15 -0
- package/src/components/Form/TextArea/examples/SizeInput.tsx +16 -0
- package/src/components/Form/TextArea/examples/StylesInput.tsx +34 -0
- package/src/components/Form/TextArea/examples/VariantsInputs.tsx +15 -0
- package/src/components/Form/TextArea/examples/index.ts +15 -0
- package/src/components/Form/TextArea/styles.css +7 -0
- package/src/components/Form/TextField/TextField/TextField.props.ts +134 -0
- package/src/components/Form/TextField/TextField/TextField.state.ts +21 -0
- package/src/components/Form/TextField/TextField/TextField.type.d.ts +15 -0
- package/src/components/Form/TextField/TextField/TextField.view.tsx +170 -0
- package/src/components/Form/TextField/TextField.md +193 -0
- package/src/components/Form/TextField/TextField.tsx +14 -0
- package/src/components/Form/TextField/examples/ClearInput.tsx +13 -0
- package/src/components/Form/TextField/examples/ColorScheme.tsx +13 -0
- package/src/components/Form/TextField/examples/Default.tsx +23 -0
- package/src/components/Form/TextField/examples/DisabledInput.tsx +7 -0
- package/src/components/Form/TextField/examples/ErrorInput.tsx +74 -0
- package/src/components/Form/TextField/examples/FormikErrorInput.tsx +76 -0
- package/src/components/Form/TextField/examples/FormikHelperText.tsx +62 -0
- package/src/components/Form/TextField/examples/HelperText.tsx +60 -0
- package/src/components/Form/TextField/examples/LabelInput.tsx +23 -0
- package/src/components/Form/TextField/examples/LeftChild.tsx +8 -0
- package/src/components/Form/TextField/examples/Placeholder.tsx +23 -0
- package/src/components/Form/TextField/examples/ReadOnlyInput.tsx +7 -0
- package/src/components/Form/TextField/examples/RightChild.tsx +8 -0
- package/src/components/Form/TextField/examples/ShapeInput.tsx +15 -0
- package/src/components/Form/TextField/examples/SizeInput.tsx +16 -0
- package/src/components/Form/TextField/examples/StylesInput.tsx +35 -0
- package/src/components/Form/TextField/examples/VariantsInputs.tsx +15 -0
- package/src/components/Form/TextField/examples/index.ts +17 -0
- package/src/components/Form/TextField/styles.css +7 -0
- package/src/components/Layout/Center/Center/Center.props.ts +18 -0
- package/src/components/Layout/Center/Center/Center.view.tsx +12 -0
- package/src/components/Layout/Center/Center.md +17 -0
- package/src/components/Layout/Center/Center.tsx +11 -0
- package/src/components/Layout/Horizontal/Horizontal/Horizontal.props.ts +26 -0
- package/src/components/Layout/Horizontal/Horizontal/Horizontal.view.tsx +24 -0
- package/src/components/Layout/Horizontal/Horizontal.md +107 -0
- package/src/components/Layout/Horizontal/Horizontal.tsx +11 -0
- package/src/components/Layout/Horizontal/examples/Default.tsx +11 -0
- package/src/components/Layout/Horizontal/examples/Justify.tsx +25 -0
- package/src/components/Layout/Horizontal/examples/Reversed.tsx +11 -0
- package/src/components/Layout/Horizontal/examples/Wrap.tsx +29 -0
- package/src/components/Layout/Horizontal/examples/index.ts +4 -0
- package/src/components/Layout/Input/FieldContainer/FieldContainer/FieldContainer.props.ts +25 -0
- package/src/components/Layout/Input/FieldContainer/FieldContainer.tsx +17 -0
- package/src/components/Layout/Input/FieldContent/FieldContent/FieldContent.props.ts +75 -0
- package/src/components/Layout/Input/FieldContent/FieldContent.tsx +55 -0
- package/src/components/Layout/Input/FieldIcons/FieldIcons/FieldIcons.props.ts +12 -0
- package/src/components/Layout/Input/FieldIcons/FieldIcons.tsx +19 -0
- package/src/components/Layout/Input/FieldLabel/FieldLabel/FieldLabel.props.ts +31 -0
- package/src/components/Layout/Input/FieldLabel/FieldLabel.tsx +30 -0
- package/src/components/Layout/Input/FieldLayout/FieldLayout/FieldLayout.props.ts +29 -0
- package/src/components/Layout/Input/FieldLayout/FieldLayout.tsx +33 -0
- package/src/components/Layout/Input/FieldWrapper/FieldWrapper.props.ts +12 -0
- package/src/components/Layout/Input/FieldWrapper/FieldWrapper.tsx +11 -0
- package/src/components/Layout/Input/HelperText/HelperText.props.ts +21 -0
- package/src/components/Layout/Input/HelperText/HelperText.tsx +22 -0
- package/src/components/Layout/Input/index.ts +7 -0
- package/src/components/Layout/Vertical/Vertical/Vertical.props.ts +26 -0
- package/src/components/Layout/Vertical/Vertical/Vertical.type.ts +3 -0
- package/src/components/Layout/Vertical/Vertical/Vertical.view.tsx +23 -0
- package/src/components/Layout/Vertical/Vertical.md +120 -0
- package/src/components/Layout/Vertical/Vertical.tsx +12 -0
- package/src/components/Layout/Vertical/examples/Default.tsx +11 -0
- package/src/components/Layout/Vertical/examples/Justify.tsx +26 -0
- package/src/components/Layout/Vertical/examples/Reversed.tsx +11 -0
- package/src/components/Layout/Vertical/examples/Wrap.tsx +30 -0
- package/src/components/Layout/Vertical/examples/index.tsx +5 -0
- package/src/components/Layout/View/View.tsx +2 -0
- package/src/components/Layout/configs/Input.style.ts +45 -0
- package/src/components/Layout/configs/Input.type.ts +18 -0
- package/src/components/Link/Link/Link.props.ts +50 -0
- package/src/components/Link/Link/Link.state.ts +6 -0
- package/src/components/Link/Link/Link.style.ts +14 -0
- package/src/components/Link/Link/Link.type.d.ts +8 -0
- package/src/components/Link/Link/Link.view.tsx +44 -0
- package/src/components/Link/Link.md +61 -0
- package/src/components/Link/Link.tsx +15 -0
- package/src/components/Link/examples/Default.tsx +5 -0
- package/src/components/Link/examples/IsExternal.tsx +10 -0
- package/src/components/Link/examples/Underline.tsx +23 -0
- package/src/components/Loader/Loader/Loader.props.ts +105 -0
- package/src/components/Loader/Loader/Loader.style.ts +25 -0
- package/src/components/Loader/Loader/Loader.type.d.ts +4 -0
- package/src/components/Loader/Loader/Loader.view.tsx +138 -0
- package/src/components/Loader/Loader.md +111 -0
- package/src/components/Loader/Loader.tsx +11 -0
- package/src/components/Loader/examples/ColorLoader.tsx +13 -0
- package/src/components/Loader/examples/DefaultLoader.tsx +4 -0
- package/src/components/Loader/examples/PositionLoader.tsx +19 -0
- package/src/components/Loader/examples/SizeLoader.tsx +12 -0
- package/src/components/Loader/examples/SpeedLoader.tsx +12 -0
- package/src/components/Loader/examples/TextLoader.tsx +8 -0
- package/src/components/Loader/examples/VariantLoader.tsx +12 -0
- package/src/components/Loader/examples/index.ts +7 -0
- package/src/components/Modal/Examples/BlurModal.tsx +38 -0
- package/src/components/Modal/Examples/CloseButtonModal.tsx +44 -0
- package/src/components/Modal/Examples/DefaultModal.tsx +38 -0
- package/src/components/Modal/Examples/FullScreenModal.tsx +28 -0
- package/src/components/Modal/Examples/ModalPosition.tsx +61 -0
- package/src/components/Modal/Examples/PreventCloseModal.tsx +27 -0
- package/src/components/Modal/Examples/ScrollModal.tsx +41 -0
- package/src/components/Modal/Examples/ShadowModal.tsx +29 -0
- package/src/components/Modal/Examples/VariantModal.tsx +48 -0
- package/src/components/Modal/Examples/index.ts +9 -0
- package/src/components/Modal/Modal/Modal.props.ts +202 -0
- package/src/components/Modal/Modal/Modal.style.ts +23 -0
- package/src/components/Modal/Modal/Modal.type.d.ts +7 -0
- package/src/components/Modal/Modal/Modal.view.tsx +169 -0
- package/src/components/Modal/Modal.md +509 -0
- package/src/components/Modal/Modal.tsx +18 -0
- package/src/components/Svg/ArrowDown.tsx +32 -0
- package/src/components/Svg/ArrowUp.tsx +32 -0
- package/src/components/Svg/Check.tsx +28 -0
- package/src/components/Svg/Close.tsx +31 -0
- package/src/components/Svg/CloseEye.tsx +26 -0
- package/src/components/Svg/DustBin.tsx +29 -0
- package/src/components/Svg/Edit.tsx +34 -0
- package/src/components/Svg/ExternalLink.tsx +31 -0
- package/src/components/Svg/Indeterminate.tsx +21 -0
- package/src/components/Svg/OpenEye.tsx +26 -0
- package/src/components/Svg/Profile.tsx +40 -0
- package/src/components/Svg/RightArrow.tsx +44 -0
- package/src/components/Svg/index.tsx +12 -0
- package/src/components/Text/Text/Text.props.ts +84 -0
- package/src/components/Text/Text/Text.style.ts +34 -0
- package/src/components/Text/Text/Text.type.d.ts +14 -0
- package/src/components/Text/Text/Text.view.tsx +96 -0
- package/src/components/Text/Text.md +163 -0
- package/src/components/Text/Text.tsx +13 -0
- package/src/components/Wrapper.tsx +19 -0
- package/src/components/index.tsx +18 -0
package/package.json
ADDED
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@app-studio/web",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"main": "dist/index.js",
|
|
5
|
+
"typings": "dist/index.d.ts",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist",
|
|
8
|
+
"src/components"
|
|
9
|
+
],
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"app-studio": "^0.1.16",
|
|
12
|
+
"date-fns": "^2.30.0",
|
|
13
|
+
"formik": "^2.2.9"
|
|
14
|
+
},
|
|
15
|
+
"engines": {
|
|
16
|
+
"node": ">=10"
|
|
17
|
+
},
|
|
18
|
+
"scripts": {
|
|
19
|
+
"start": "react-scripts start",
|
|
20
|
+
"build": "tsdx build ./src/components/index.tsx --tsconfig tsconfig.build.json",
|
|
21
|
+
"test": "react-scripts test",
|
|
22
|
+
"test:unwatch": "react-scripts test --watchAll=false",
|
|
23
|
+
"eject": "react-scripts eject",
|
|
24
|
+
"storybook": "start-storybook -p 6006 -s public",
|
|
25
|
+
"build-storybook": "build-storybook -s public",
|
|
26
|
+
"styleguide": "styleguidist server",
|
|
27
|
+
"styleguide:build": "styleguidist build",
|
|
28
|
+
"eslint": "eslint --cache --ext .ts,.tsx",
|
|
29
|
+
"eslint:fix": "eslint --fix --cache --ext .ts,.tsx",
|
|
30
|
+
"lint": "npm run eslint && npm run prettier",
|
|
31
|
+
"lint-staged": "lint-staged",
|
|
32
|
+
"lint-staged:eslint": "eslint --fix --cache --ext .ts,.tsx",
|
|
33
|
+
"lint:fix": "npm run eslint:fix && npm run prettier:fix",
|
|
34
|
+
"docker": "npm run build && docker-compose up",
|
|
35
|
+
"prettier": "prettier --write \"src/**/*.{js,jsx,ts,tsx, json}\"",
|
|
36
|
+
"prettier:fix": "prettier --write \"src/**/*.{js,jsx,ts,tsx, json}\"",
|
|
37
|
+
"prepare": "husky install",
|
|
38
|
+
"commit:lint": "npm run test:unwatch && npm run lint:fix",
|
|
39
|
+
"lighthouse": "lighthouse http://localhost:3000 --view --budget-path=./budget.json",
|
|
40
|
+
"bundle-analyzer": "node ./scripts/analyse.js",
|
|
41
|
+
"size": "size-limit",
|
|
42
|
+
"analyze": "size-limit --why"
|
|
43
|
+
},
|
|
44
|
+
"config": {
|
|
45
|
+
"commitizen": {
|
|
46
|
+
"path": "git-cz"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"eslintConfig": {
|
|
50
|
+
"extends": [
|
|
51
|
+
"react-app",
|
|
52
|
+
"react-app/jest"
|
|
53
|
+
],
|
|
54
|
+
"overrides": [
|
|
55
|
+
{
|
|
56
|
+
"files": [
|
|
57
|
+
"**/*.stories.*"
|
|
58
|
+
],
|
|
59
|
+
"rules": {
|
|
60
|
+
"import/no-anonymous-default-export": "off"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
]
|
|
64
|
+
},
|
|
65
|
+
"browserslist": {
|
|
66
|
+
"production": [
|
|
67
|
+
">0.2%",
|
|
68
|
+
"not dead",
|
|
69
|
+
"not op_mini all"
|
|
70
|
+
],
|
|
71
|
+
"development": [
|
|
72
|
+
"last 1 chrome version",
|
|
73
|
+
"last 1 firefox version",
|
|
74
|
+
"last 1 safari version"
|
|
75
|
+
]
|
|
76
|
+
},
|
|
77
|
+
"devDependencies": {
|
|
78
|
+
"@babel/core": "^7.21.8",
|
|
79
|
+
"@babel/preset-env": "^7.23.2",
|
|
80
|
+
"@babel/preset-react": "^7.18.6",
|
|
81
|
+
"@commitlint/cli": "^17.6.5",
|
|
82
|
+
"@commitlint/config-conventional": "^17.6.5",
|
|
83
|
+
"@testing-library/jest-dom": "^5.16.5",
|
|
84
|
+
"@testing-library/react": "^14.0.0",
|
|
85
|
+
"@testing-library/user-event": "^13.5.0",
|
|
86
|
+
"@types/jest": "^27.5.2",
|
|
87
|
+
"@types/node": "^16.18.14",
|
|
88
|
+
"@types/react": "^18.0.28",
|
|
89
|
+
"@types/react-dom": "^18.0.11",
|
|
90
|
+
"@types/react-test-renderer": "^18.0.0",
|
|
91
|
+
"@types/styled-components": "^5.1.26",
|
|
92
|
+
"@typescript-eslint/eslint-plugin": "^5.59.7",
|
|
93
|
+
"@typescript-eslint/parser": "^5.59.7",
|
|
94
|
+
"babel-jest": "^29.5.0",
|
|
95
|
+
"babel-loader": "^9.1.2",
|
|
96
|
+
"babel-plugin-named-exports-order": "^0.0.2",
|
|
97
|
+
"babel-plugin-react-require": "^4.0.0",
|
|
98
|
+
"brotli-webpack-plugin": "^1.1.0",
|
|
99
|
+
"commitizen": "^4.3.0",
|
|
100
|
+
"compression": "^1.7.4",
|
|
101
|
+
"compression-webpack-plugin": "^10.0.0",
|
|
102
|
+
"core-js": "^3.33.2",
|
|
103
|
+
"css-loader": "^6.7.3",
|
|
104
|
+
"dotenv": "^16.1.4",
|
|
105
|
+
"env-cmd": "^10.1.0",
|
|
106
|
+
"eslint": "^8.41.0",
|
|
107
|
+
"eslint-plugin-import": "^2.27.5",
|
|
108
|
+
"eslint-plugin-react": "^7.32.2",
|
|
109
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
|
110
|
+
"eslint-plugin-simple-import-sort": "^10.0.0",
|
|
111
|
+
"express": "^4.18.2",
|
|
112
|
+
"git-conventional-commits": "^1.4.2",
|
|
113
|
+
"git-cz": "^4.9.0",
|
|
114
|
+
"husky": "^8.0.0",
|
|
115
|
+
"lighthouse": "^10.2.0",
|
|
116
|
+
"lint-staged": "^13.2.2",
|
|
117
|
+
"prettier": "^2.8.8",
|
|
118
|
+
"react": "^18.2.0",
|
|
119
|
+
"react-docgen-typescript": "^2.2.2",
|
|
120
|
+
"react-dom": "^18.2.0",
|
|
121
|
+
"react-router-dom": "^6.11.1",
|
|
122
|
+
"react-scripts": "5.0.1",
|
|
123
|
+
"react-styleguidist": "^13.1.1",
|
|
124
|
+
"react-test-renderer": "^18.2.0",
|
|
125
|
+
"router": "^1.3.8",
|
|
126
|
+
"style-loader": "^3.3.2",
|
|
127
|
+
"styled-components": "^5.3.11",
|
|
128
|
+
"ts-loader": "^9.4.2",
|
|
129
|
+
"tsdx": "^0.14.1",
|
|
130
|
+
"tslib": "^2.3.1",
|
|
131
|
+
"typescript": "^4.9.5",
|
|
132
|
+
"web-vitals": "^2.1.4",
|
|
133
|
+
"webpack": "^5.85.1",
|
|
134
|
+
"webpack-bundle-analyzer": "^4.8.0",
|
|
135
|
+
"webpack-cli": "^5.1.3",
|
|
136
|
+
"zustand": "^4.3.8"
|
|
137
|
+
},
|
|
138
|
+
"peerDependencies": {
|
|
139
|
+
"react": ">= 16",
|
|
140
|
+
"styled-components": ">= 5"
|
|
141
|
+
},
|
|
142
|
+
"size-limit": [
|
|
143
|
+
{
|
|
144
|
+
"path": "dist/app-studio-web.esm.cjs.production.min.js",
|
|
145
|
+
"limit": "10 KB"
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"path": "dist/app-studio-web.esm.esm.js",
|
|
149
|
+
"limit": "10 KB"
|
|
150
|
+
}
|
|
151
|
+
],
|
|
152
|
+
"module": "dist/app-studio-web.esm.js"
|
|
153
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import React, { CSSProperties } from 'react';
|
|
2
|
+
import { Shadow } from 'app-studio';
|
|
3
|
+
import { Elevation } from 'src/utils/elevation';
|
|
4
|
+
|
|
5
|
+
import { IconPosition, Shape, Size, Variant } from './Button.type';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Represents the properties for the Button component.
|
|
9
|
+
*/
|
|
10
|
+
export interface ButtonProps {
|
|
11
|
+
/**
|
|
12
|
+
* The content to be rendered inside the button.
|
|
13
|
+
*/
|
|
14
|
+
children?: React.ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* Sets the background color of the button.
|
|
17
|
+
*/
|
|
18
|
+
colorScheme?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Specifies the external URL used when the variant is set to "link".
|
|
21
|
+
*/
|
|
22
|
+
externalHref?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Indicates whether the button is in a loading state.
|
|
25
|
+
*/
|
|
26
|
+
isLoading?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* The icon component rendered within the button.
|
|
29
|
+
*/
|
|
30
|
+
icon?: React.ReactNode;
|
|
31
|
+
/**
|
|
32
|
+
* Specifies the position of the icon within the button.
|
|
33
|
+
*/
|
|
34
|
+
iconPosition?: IconPosition;
|
|
35
|
+
/**
|
|
36
|
+
* Disables the button if set to true.
|
|
37
|
+
*/
|
|
38
|
+
isDisabled?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Adjusts the width of the button to take available space.
|
|
41
|
+
*/
|
|
42
|
+
isFilled?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Adjusts the width of the button based on content size.
|
|
45
|
+
*/
|
|
46
|
+
isAuto?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Makes the icon container shape rounded if set to true.
|
|
49
|
+
*/
|
|
50
|
+
isIconRounded?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* The event handler called when the button is clicked or pressed.
|
|
53
|
+
*/
|
|
54
|
+
onPress?: Function;
|
|
55
|
+
/**
|
|
56
|
+
* Specifies the size of the button's text and padding.
|
|
57
|
+
*/
|
|
58
|
+
size?: Size;
|
|
59
|
+
/**
|
|
60
|
+
* Sets a shadow effect applied to the button.
|
|
61
|
+
*/
|
|
62
|
+
shadow?: Shadow | Elevation | CSSProperties;
|
|
63
|
+
/**
|
|
64
|
+
* Specifies the shape of the button's corners.
|
|
65
|
+
*/
|
|
66
|
+
shape?: Shape;
|
|
67
|
+
/**
|
|
68
|
+
* Descriptive label for accessibility (ARIA) purposes.
|
|
69
|
+
*/
|
|
70
|
+
ariaLabel?: string;
|
|
71
|
+
/**
|
|
72
|
+
* Specifies the style variant of the button.
|
|
73
|
+
*/
|
|
74
|
+
variant?: Variant;
|
|
75
|
+
/**
|
|
76
|
+
* Additional properties for the button component.
|
|
77
|
+
*/
|
|
78
|
+
[x: string]: any;
|
|
79
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
|
|
3
|
+
import { Shape, Size } from './Button.type';
|
|
4
|
+
|
|
5
|
+
export const ButtonSizes: Record<Size, CSSProperties> = {
|
|
6
|
+
xs: {
|
|
7
|
+
width: 79,
|
|
8
|
+
paddingTop: 8,
|
|
9
|
+
paddingBottom: 8,
|
|
10
|
+
paddingLeft: 12,
|
|
11
|
+
paddingRight: 12,
|
|
12
|
+
fontWeight: 600,
|
|
13
|
+
fontSize: 'xs',
|
|
14
|
+
lineHeight: 16,
|
|
15
|
+
letterSpacing: 1.25,
|
|
16
|
+
},
|
|
17
|
+
sm: {
|
|
18
|
+
width: 128,
|
|
19
|
+
paddingTop: 10,
|
|
20
|
+
paddingBottom: 10,
|
|
21
|
+
paddingLeft: 16,
|
|
22
|
+
paddingRight: 16,
|
|
23
|
+
fontWeight: 600,
|
|
24
|
+
fontSize: 'sm',
|
|
25
|
+
lineHeight: 20,
|
|
26
|
+
letterSpacing: 1.25,
|
|
27
|
+
},
|
|
28
|
+
md: {
|
|
29
|
+
width: 144,
|
|
30
|
+
paddingTop: 12,
|
|
31
|
+
paddingBottom: 12,
|
|
32
|
+
paddingLeft: 18,
|
|
33
|
+
paddingRight: 18,
|
|
34
|
+
fontWeight: 600,
|
|
35
|
+
fontSize: 'md',
|
|
36
|
+
lineHeight: 24,
|
|
37
|
+
letterSpacing: 1.25,
|
|
38
|
+
},
|
|
39
|
+
lg: {
|
|
40
|
+
width: 178,
|
|
41
|
+
paddingTop: 14,
|
|
42
|
+
paddingBottom: 14,
|
|
43
|
+
paddingLeft: 22,
|
|
44
|
+
paddingRight: 22,
|
|
45
|
+
fontWeight: 600,
|
|
46
|
+
fontSize: 'lg',
|
|
47
|
+
lineHeight: 24,
|
|
48
|
+
letterSpacing: 1.25,
|
|
49
|
+
},
|
|
50
|
+
xl: {
|
|
51
|
+
width: 220,
|
|
52
|
+
paddingTop: 16,
|
|
53
|
+
paddingBottom: 16,
|
|
54
|
+
paddingLeft: 26,
|
|
55
|
+
paddingRight: 26,
|
|
56
|
+
fontWeight: 600,
|
|
57
|
+
fontSize: 'xl',
|
|
58
|
+
lineHeight: 24,
|
|
59
|
+
letterSpacing: 1.25,
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export const ButtonShapes: Record<Shape, number | string> = {
|
|
64
|
+
sharp: 0,
|
|
65
|
+
rounded: 4,
|
|
66
|
+
pillShaped: 24,
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export const IconSizes: Record<Size, CSSProperties> = {
|
|
70
|
+
xs: {
|
|
71
|
+
width: 24,
|
|
72
|
+
height: 24,
|
|
73
|
+
padding: 12,
|
|
74
|
+
},
|
|
75
|
+
sm: {
|
|
76
|
+
width: 24,
|
|
77
|
+
height: 24,
|
|
78
|
+
padding: 15,
|
|
79
|
+
},
|
|
80
|
+
md: {
|
|
81
|
+
width: 36,
|
|
82
|
+
height: 36,
|
|
83
|
+
padding: 15,
|
|
84
|
+
},
|
|
85
|
+
lg: {
|
|
86
|
+
width: 36,
|
|
87
|
+
height: 36,
|
|
88
|
+
padding: 18,
|
|
89
|
+
},
|
|
90
|
+
xl: {
|
|
91
|
+
width: 36,
|
|
92
|
+
height: 36,
|
|
93
|
+
padding: 24,
|
|
94
|
+
},
|
|
95
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type BorderWeights = 'light' | 'normal' | 'bold' | 'extrabold' | 'black';
|
|
2
|
+
|
|
3
|
+
export type Shape = 'sharp' | 'rounded' | 'pillShaped';
|
|
4
|
+
|
|
5
|
+
export type Size = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
6
|
+
|
|
7
|
+
export type Loaders = 'spinner' | 'points' | 'points-opacity';
|
|
8
|
+
|
|
9
|
+
export type IconPosition = 'left' | 'right';
|
|
10
|
+
|
|
11
|
+
export type Variant = 'filled' | 'outline' | 'link' | 'ghost';
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import React, { CSSProperties } from 'react';
|
|
2
|
+
import { Element, useTheme } 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
|
+
onPress = () => {},
|
|
26
|
+
...props
|
|
27
|
+
}) => {
|
|
28
|
+
const isActive = !(isDisabled || isLoading);
|
|
29
|
+
const {getColor} = useTheme()
|
|
30
|
+
|
|
31
|
+
const defaultNativeProps = { disabled: !isActive };
|
|
32
|
+
|
|
33
|
+
const buttonColor = isActive ? colorScheme : 'theme.disabled';
|
|
34
|
+
|
|
35
|
+
const ButtonVariants: Record<Variant, CSSProperties> = {
|
|
36
|
+
filled: {
|
|
37
|
+
backgroundColor: buttonColor,
|
|
38
|
+
color: 'color.white',
|
|
39
|
+
},
|
|
40
|
+
outline: {
|
|
41
|
+
backgroundColor: 'transparent',
|
|
42
|
+
borderWidth: 1,
|
|
43
|
+
borderStyle: 'solid',
|
|
44
|
+
borderColor: colorScheme,
|
|
45
|
+
color: buttonColor,
|
|
46
|
+
},
|
|
47
|
+
link: {
|
|
48
|
+
backgroundColor: 'transparent',
|
|
49
|
+
border: 'none',
|
|
50
|
+
color: buttonColor,
|
|
51
|
+
textDecorationLine: 'underline',
|
|
52
|
+
},
|
|
53
|
+
ghost: {
|
|
54
|
+
backgroundColor: 'transparent',
|
|
55
|
+
border: 'none',
|
|
56
|
+
color: buttonColor,
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
const buttonSizeStyles = ButtonSizes[size];
|
|
61
|
+
|
|
62
|
+
const buttonVariant = ButtonVariants[variant];
|
|
63
|
+
|
|
64
|
+
const scaleWidth = {
|
|
65
|
+
width: isAuto ? 'fit-content' : isFilled ? '100%' : buttonSizeStyles.width,
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const changePadding = {
|
|
69
|
+
padding: isIconRounded ? IconSizes[size].padding : ButtonSizes[size].padding,
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
const content = (
|
|
73
|
+
<>
|
|
74
|
+
{icon && iconPosition === 'left' && !isLoading && icon}
|
|
75
|
+
{children}
|
|
76
|
+
{icon && iconPosition === 'right' && !isLoading && icon}
|
|
77
|
+
</>
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
console.log({buttonColor, r: getColor(buttonColor)})
|
|
81
|
+
|
|
82
|
+
return (
|
|
83
|
+
<Element
|
|
84
|
+
gap={8}
|
|
85
|
+
as="button"
|
|
86
|
+
role="button"
|
|
87
|
+
border="none"
|
|
88
|
+
color="color.white"
|
|
89
|
+
display="flex"
|
|
90
|
+
alignItems="center"
|
|
91
|
+
justifyContent="center"
|
|
92
|
+
ariaLabel={ariaLabel}
|
|
93
|
+
backgroundColor={buttonColor}
|
|
94
|
+
borderRadius={ButtonShapes[shape]}
|
|
95
|
+
onPress={props.onClick ?? onPress}
|
|
96
|
+
cursor={isActive ? 'pointer' : 'default'}
|
|
97
|
+
{...defaultNativeProps} // set default native html button properties
|
|
98
|
+
{...buttonSizeStyles} // set default width, paddings and fonts
|
|
99
|
+
{...buttonVariant} // changes default background color, color and border
|
|
100
|
+
{...scaleWidth} //changes the actual fixed width when isAuto or isFilled are true
|
|
101
|
+
{...changePadding} // changes the actual padding when variant equals to circled
|
|
102
|
+
{...shadow}
|
|
103
|
+
{...props}
|
|
104
|
+
>
|
|
105
|
+
{variant === 'link' && externalHref ? (
|
|
106
|
+
<Link href={externalHref} textDecorationColor={colorScheme} colorScheme={colorScheme} isExternal>
|
|
107
|
+
{content}
|
|
108
|
+
</Link>
|
|
109
|
+
) : (
|
|
110
|
+
content
|
|
111
|
+
)}
|
|
112
|
+
</Element>
|
|
113
|
+
);
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
export default ButtonView;
|
|
@@ -0,0 +1,165 @@
|
|
|
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
|
+
```
|
|
@@ -0,0 +1,24 @@
|
|
|
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;
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
);
|
|
@@ -0,0 +1,14 @@
|
|
|
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
|
+
);
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
);
|