Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vuluu2k/snappy-lib
Library of snappy express
https://github.com/vuluu2k/snappy-lib
library microbundle react storybook
Last synced: 16 days ago
JSON representation
Library of snappy express
- Host: GitHub
- URL: https://github.com/vuluu2k/snappy-lib
- Owner: vuluu2k
- License: mit
- Created: 2022-08-02T04:06:55.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-10-19T07:28:28.000Z (over 1 year ago)
- Last Synced: 2024-04-25T05:22:14.440Z (10 months ago)
- Topics: library, microbundle, react, storybook
- Language: JavaScript
- Homepage: https://vuluu2k.github.io/snappy-lib/
- Size: 3.98 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
React components custom for antd at Snappy.vn
You are visiting [docs](https://vuluu2k.github.io/snappy-lib/) now!
## 📦 Install
```bash
npm install snappy-lib
``````bash
yarn add snappy-lib
```## Attachment
```bash
npm install antd @ant-design/icons react-icons
``````bash
yarn add antd @ant-design/icons react-icons
```## 🔨 Usage
```jsx
import { SnyButton, SnyStatus } from 'snappy-express';const App = () => (
<>
Snappy
>
);
```# SnyStatus
```jsx
SnyStatus.propTypes = {
statusArray: PropTypes.array,
status: PropTypes.string,
status_vi: PropTypes.string,
type: PropTypes.string,
label: PropTypes.string,
children: PropTypes.node,
tooltip: PropTypes.object,
badge: PropTypes.object,
style: PropTypes.object,
className: PropTypes.string,
};SnyStatus.defaultProps = {
statusArray: [
{ array: ['request_received', 'waiting_for_return', 'returning', 'part_delivery'], color: 'orange' },
{ array: ['processing_picked_up', 'out_for_delivery', 'picked_up'], color: 'blue' },
{ array: ['import_picking_warehouse', 'on_the_way', 'import_returning_warehouse', 'returned'], color: 'cyan' },
{ array: ['picked_up_fail', 'undeliverable', 'return_fail', 'canceled'], color: 'red' },
{ array: ['processing_on_the_way', 'on_the_way_returning', 'waiting_on_the_way'], color: 'purple' },
{ array: ['delivered'], color: 'green' },
],
status: undefined,
status_vi: 'SnappyExpress',
type: '',
label: undefined,
children: undefined,
tooltip: {},
badge: {},
style: {},
className: '',
};
```# SnyButton
```jsx
SnyButton.propTypes = {
label: PropTypes.node,
type: PropTypes.string,
size: PropTypes.string,
style: PropTypes.object,
icon: PropTypes.node,
loading: PropTypes.bool,
onClick: PropTypes.func,
disabled: PropTypes.bool,
className: PropTypes.string,
suffixIcon: PropTypes.node,
shape: PropTypes.string,
badge: PropTypes.object,
iconButton: PropTypes.bool,
tooltip: PropTypes.object,
template: PropTypes.string,
};SnyButton.defaultProps = {
label: 'SnappyExpress',
type: 'default',
size: 'md',
style: {},
icon: false,
loading: false,
onClick: e => e.isDefaultPrevented(),
disabled: false,
className: '',
suffixIcon: false,
shape: '',
badge: {},
iconButton: false,
tooltip: {},
template: '',
};
```# SnyTabs
```jsx
SnyTabs.propTypes = {
options: PropTypes.array,
onClick: PropTypes.func,
style: PropTypes.object,
styleTab: PropTypes.object,
className: PropTypes.string,
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
arrayActive: PropTypes.array,
};SnyTabs.defaultProps = {
options: [
{ value: 1, label: 'SnappyExpress1' },
{ value: 2, label: 'SnappyExpress2' },
{ value: 3, label: 'SnappyExpress3' },
{ value: 4, label: 'SnappyExpress4' },
],
onClick: (value, label) => console.log(value, label),
style: {},
styleTab: {},
className: '',
value: 1,
arrayActive: [],
};
```