initial structure for components rewrite
This commit is contained in:
1 parent
944afe4a3e
commit
c391c007ff
284 files changed
+68087
-17215
No files matched your search
@@ -0,0 +1,34 @@
|
||||
import React from 'react';
|
||||
import t from 'prop-types';
|
||||
|
||||
const Label = ({ children, spacing, className, text, ...rest }) => {
|
||||
const baseClasses = 'block text-gray-700 text-sm font-bold';
|
||||
|
||||
const getClasses = () => {
|
||||
const classes = [];
|
||||
classes.push(baseClasses);
|
||||
classes.push(className);
|
||||
return classes.join(' ');
|
||||
};
|
||||
|
||||
return (
|
||||
<div>
|
||||
<label className={getClasses()}>
|
||||
{text}
|
||||
{children}
|
||||
</label>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
const spacing = {
|
||||
small: 'mb-1',
|
||||
medium: 'mb-2',
|
||||
large: 'mb-3',
|
||||
};
|
||||
|
||||
Label.defaultProps = {};
|
||||
|
||||
Label.prototypes = {};
|
||||
|
||||
export default Label;
|
||||
@@ -0,0 +1,20 @@
|
||||
---
|
||||
name: Label
|
||||
menu: Components
|
||||
route: components/label
|
||||
---
|
||||
|
||||
import { Playground, Props } from 'docz';
|
||||
import Label from './';
|
||||
|
||||
# Label
|
||||
|
||||
## Properties
|
||||
|
||||
<Props of={Label} />
|
||||
|
||||
## Basic usage
|
||||
|
||||
<Playground>
|
||||
<Label text="Label" />
|
||||
</Playground>
|
||||
@@ -0,0 +1,2 @@
|
||||
import Label from './Label';
|
||||
export default Label;
|
||||
Reference in new issue
Block a user