cleanplate 0.0.4 → 0.0.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/README.md +84 -9
- package/dist/index.css +1 -1
- package/dist/index.es.css +1 -1
- package/dist/index.es.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,16 +2,91 @@
|
|
|
2
2
|
|
|
3
3
|
CleanPlate - Headless React UI Framework
|
|
4
4
|
|
|
5
|
-
###
|
|
5
|
+
### Installation
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
```
|
|
8
|
+
npm install cleanplate
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Check all versions at [NPM](https://www.npmjs.com/package/cleanplate).
|
|
12
|
+
|
|
13
|
+
### Usage
|
|
14
|
+
|
|
15
|
+
All components can be consumed by `import` using their respective names from `cleanplate` package.
|
|
16
|
+
|
|
17
|
+
#### Button
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
import { Button } from "cleanplate";
|
|
21
|
+
|
|
22
|
+
<Button variant="primary" onClick={() => {}}>Save</Button>
|
|
23
|
+
<Button variant="secondary" onClick={() => {}}>Save</Button>
|
|
24
|
+
<Button variant="nude" onClick={() => {}}>Save</Button>
|
|
25
|
+
<Button variant="special" onClick={() => {}}>Save</Button>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
#### Typography
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
import { Typography } from "cleanplate";
|
|
32
|
+
|
|
33
|
+
<Typography variant="h1">Hello World!</Typography>
|
|
34
|
+
<Typography variant="h2">Hello World!</Typography>
|
|
35
|
+
<Typography variant="h3">Hello World!</Typography>
|
|
36
|
+
<Typography variant="h4">Hello World!</Typography>
|
|
37
|
+
<Typography variant="h5">Hello World!</Typography>
|
|
38
|
+
<Typography variant="h6">Hello World!</Typography>
|
|
39
|
+
<Typography variant="p">Hello World!</Typography>
|
|
40
|
+
<Typography variant="small">Hello World!</Typography>
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
#### Badge
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
import { Badge } from "cleanplate";
|
|
48
|
+
|
|
49
|
+
<Badge label="New" />
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
#### AppShell
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
import { AppShell } from "cleanplate";
|
|
56
|
+
|
|
57
|
+
<AppShell />
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
#### Form Controls
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
import { FormControl } from "cleanplate";
|
|
64
|
+
|
|
65
|
+
<FormControl.Input
|
|
66
|
+
name="email"
|
|
67
|
+
onChange={(e) => handleChange(e)}
|
|
68
|
+
value={values.email}
|
|
69
|
+
/>
|
|
70
|
+
|
|
71
|
+
<FormControl.TextArea
|
|
72
|
+
name="bio"
|
|
73
|
+
onChange={(e) => handleChange(e)}
|
|
74
|
+
value={values.bio}
|
|
75
|
+
/>
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
#### Icon
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
import { Icon } from "cleanplate";
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
#### Modal
|
|
85
|
+
|
|
86
|
+
```
|
|
87
|
+
import { Modal } from "cleanplate";
|
|
88
|
+
```
|
|
14
89
|
|
|
15
90
|
### Documentation & Demo
|
|
16
91
|
|
|
17
|
-
Storybook playground is available at [https://cleanplate.sivadass.in](https://cleanplate.sivadass.in)
|
|
92
|
+
Storybook playground is available for all components at [https://cleanplate.sivadass.in](https://cleanplate.sivadass.in).
|
package/dist/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.cp-typography{color:red}.cp-app-shell,.cp-typography{font-family:inherit;font-size:inherit;line-height:1.5}.cp-app-shell{color:orange}.cp-badge,.cp-modal{color:red;line-height:1.5}.cp-badge,.cp-form-field,.cp-modal{font-family:inherit;font-size:inherit}.cp-form-field{margin-bottom:16px}.cp-form-label{color:#999;display:block;margin-bottom:8px}.cp-form-control{border:1px solid #ccc;border-radius:8px;height:44px;padding:0 16px}.cp-textarea-field textarea{min-height:88px;padding:16px}.cp-button{border:1px solid #ccc;border-radius:8px;cursor:pointer;height:44px;padding:0 16px}.cp-
|
|
1
|
+
.cp-typography{color:red}.cp-app-shell,.cp-typography{font-family:inherit;font-size:inherit;line-height:1.5}.cp-app-shell{color:orange}.cp-badge,.cp-modal{color:red;line-height:1.5}.cp-badge,.cp-form-field,.cp-modal{font-family:inherit;font-size:inherit}.cp-form-field{margin-bottom:16px}.cp-form-label{color:#999;display:block;margin-bottom:8px}.cp-form-control{border:1px solid #ccc;border-radius:8px;height:44px;padding:0 16px}.cp-textarea-field textarea{min-height:88px;padding:16px}.cp-button{border:1px solid #ccc;border-radius:8px;cursor:pointer;font-family:inherit;font-size:inherit;height:44px;padding:0 16px}.cp-icon{word-wrap:normal;-webkit-font-feature-settings:"liga";-webkit-font-smoothing:antialiased;direction:ltr;display:inline-block;font-family:Material Symbols Outlined;font-size:24px;font-style:normal;font-weight:400;letter-spacing:normal;line-height:1;text-transform:none;white-space:nowrap}
|
package/dist/index.es.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.cp-typography{color:red}.cp-app-shell,.cp-typography{font-family:inherit;font-size:inherit;line-height:1.5}.cp-app-shell{color:orange}.cp-badge,.cp-modal{color:red;line-height:1.5}.cp-badge,.cp-form-field,.cp-modal{font-family:inherit;font-size:inherit}.cp-form-field{margin-bottom:16px}.cp-form-label{color:#999;display:block;margin-bottom:8px}.cp-form-control{border:1px solid #ccc;border-radius:8px;height:44px;padding:0 16px}.cp-textarea-field textarea{min-height:88px;padding:16px}.cp-button{border:1px solid #ccc;border-radius:8px;cursor:pointer;height:44px;padding:0 16px}.cp-
|
|
1
|
+
.cp-typography{color:red}.cp-app-shell,.cp-typography{font-family:inherit;font-size:inherit;line-height:1.5}.cp-app-shell{color:orange}.cp-badge,.cp-modal{color:red;line-height:1.5}.cp-badge,.cp-form-field,.cp-modal{font-family:inherit;font-size:inherit}.cp-form-field{margin-bottom:16px}.cp-form-label{color:#999;display:block;margin-bottom:8px}.cp-form-control{border:1px solid #ccc;border-radius:8px;height:44px;padding:0 16px}.cp-textarea-field textarea{min-height:88px;padding:16px}.cp-button{border:1px solid #ccc;border-radius:8px;cursor:pointer;font-family:inherit;font-size:inherit;height:44px;padding:0 16px}.cp-icon{word-wrap:normal;-webkit-font-feature-settings:"liga";-webkit-font-smoothing:antialiased;direction:ltr;display:inline-block;font-family:Material Symbols Outlined;font-size:24px;font-style:normal;font-weight:400;letter-spacing:normal;line-height:1;text-transform:none;white-space:nowrap}
|
package/dist/index.es.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"react";const a=({children:a,variant:t})=>{switch(t){case"h1":return e.createElement("h1",{className:"cp-typography"},a);case"h2":return e.createElement("h2",{className:"cp-typography"},a);case"h3":return e.createElement("h3",{className:"cp-typography"},a);case"h4":return e.createElement("h4",{className:"cp-typography"},a);case"h5":return e.createElement("h5",{className:"cp-typography"},a);case"h6":return e.createElement("h6",{className:"cp-typography"},a);default:return e.createElement("p",{className:"cp-typography"},a)}},t=({children:e})=>React.createElement("div",{className:"cp-app-shell"},e),l=({children:a})=>e.createElement("p",{className:"cp-modal"},a),c=({label:a})=>e.createElement("p",{className:"cp-badge"},a);var r={Input:({name:a,id:t,onChange:l,defaultValue:c,value:r,label:s="",isDisabled:n=!1,type:m="text",className:p=""})=>{const o=`cp-form-field cp-input-field ${p}`;return e.createElement("div",{className:o},s&&e.createElement("label",{className:"cp-form-label"},s),e.createElement("input",{className:"cp-form-control",type:m,disabled:n,name:a,id:t,defaultValue:c,value:r,onChange:e=>{l&&l(e)}}))},TextArea:({name:a,id:t,onChange:l,defaultValue:c,value:r,label:s="",isDisabled:n=!1,type:m="text",className:p=""})=>{const o=`cp-form-field cp-textarea-field ${p}`;return e.createElement("div",{className:o},s&&e.createElement("label",{className:"cp-form-label"},s),e.createElement("textarea",{className:"cp-form-control",type:m,disabled:n,name:a,id:t,defaultValue:c,value:r,onChange:e=>{l&&l(e)}}))}};const s=({children:a})=>e.createElement("button",{className:"cp-button"},a),n=({name:a=""})=>
|
|
1
|
+
import e from"react";const a=({children:a,variant:t})=>{switch(t){case"h1":return e.createElement("h1",{className:"cp-typography"},a);case"h2":return e.createElement("h2",{className:"cp-typography"},a);case"h3":return e.createElement("h3",{className:"cp-typography"},a);case"h4":return e.createElement("h4",{className:"cp-typography"},a);case"h5":return e.createElement("h5",{className:"cp-typography"},a);case"h6":return e.createElement("h6",{className:"cp-typography"},a);default:return e.createElement("p",{className:"cp-typography"},a)}},t=({children:e})=>React.createElement("div",{className:"cp-app-shell"},e),l=({children:a})=>e.createElement("p",{className:"cp-modal"},a),c=({label:a})=>e.createElement("p",{className:"cp-badge"},a);var r={Input:({name:a,id:t,onChange:l,defaultValue:c,value:r,label:s="",isDisabled:n=!1,type:m="text",className:p=""})=>{const o=`cp-form-field cp-input-field ${p}`;return e.createElement("div",{className:o},s&&e.createElement("label",{className:"cp-form-label"},s),e.createElement("input",{className:"cp-form-control",type:m,disabled:n,name:a,id:t,defaultValue:c,value:r,onChange:e=>{l&&l(e)}}))},TextArea:({name:a,id:t,onChange:l,defaultValue:c,value:r,label:s="",isDisabled:n=!1,type:m="text",className:p=""})=>{const o=`cp-form-field cp-textarea-field ${p}`;return e.createElement("div",{className:o},s&&e.createElement("label",{className:"cp-form-label"},s),e.createElement("textarea",{className:"cp-form-control",type:m,disabled:n,name:a,id:t,defaultValue:c,value:r,onChange:e=>{l&&l(e)}}))}};const s=({children:a})=>e.createElement("button",{className:"cp-button"},a),n=({name:a=""})=>e.createElement("span",{class:"cp-icon"},a);export{t as AppShell,c as Badge,s as Button,r as FormControls,n as Icon,l as Modal,a as Typography};
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("react");var a={Input:({name:a,id:t,onChange:l,defaultValue:c,value:r,label:s="",isDisabled:n=!1,type:p="text",className:m=""})=>{const o=`cp-form-field cp-input-field ${m}`;return e.createElement("div",{className:o},s&&e.createElement("label",{className:"cp-form-label"},s),e.createElement("input",{className:"cp-form-control",type:p,disabled:n,name:a,id:t,defaultValue:c,value:r,onChange:e=>{l&&l(e)}}))},TextArea:({name:a,id:t,onChange:l,defaultValue:c,value:r,label:s="",isDisabled:n=!1,type:p="text",className:m=""})=>{const o=`cp-form-field cp-textarea-field ${m}`;return e.createElement("div",{className:o},s&&e.createElement("label",{className:"cp-form-label"},s),e.createElement("textarea",{className:"cp-form-control",type:p,disabled:n,name:a,id:t,defaultValue:c,value:r,onChange:e=>{l&&l(e)}}))}};exports.AppShell=({children:e})=>React.createElement("div",{className:"cp-app-shell"},e),exports.Badge=({label:a})=>e.createElement("p",{className:"cp-badge"},a),exports.Button=({children:a})=>e.createElement("button",{className:"cp-button"},a),exports.FormControls=a,exports.Icon=({name:a=""})=>
|
|
1
|
+
"use strict";var e=require("react");var a={Input:({name:a,id:t,onChange:l,defaultValue:c,value:r,label:s="",isDisabled:n=!1,type:p="text",className:m=""})=>{const o=`cp-form-field cp-input-field ${m}`;return e.createElement("div",{className:o},s&&e.createElement("label",{className:"cp-form-label"},s),e.createElement("input",{className:"cp-form-control",type:p,disabled:n,name:a,id:t,defaultValue:c,value:r,onChange:e=>{l&&l(e)}}))},TextArea:({name:a,id:t,onChange:l,defaultValue:c,value:r,label:s="",isDisabled:n=!1,type:p="text",className:m=""})=>{const o=`cp-form-field cp-textarea-field ${m}`;return e.createElement("div",{className:o},s&&e.createElement("label",{className:"cp-form-label"},s),e.createElement("textarea",{className:"cp-form-control",type:p,disabled:n,name:a,id:t,defaultValue:c,value:r,onChange:e=>{l&&l(e)}}))}};exports.AppShell=({children:e})=>React.createElement("div",{className:"cp-app-shell"},e),exports.Badge=({label:a})=>e.createElement("p",{className:"cp-badge"},a),exports.Button=({children:a})=>e.createElement("button",{className:"cp-button"},a),exports.FormControls=a,exports.Icon=({name:a=""})=>e.createElement("span",{class:"cp-icon"},a),exports.Modal=({children:a})=>e.createElement("p",{className:"cp-modal"},a),exports.Typography=({children:a,variant:t})=>{switch(t){case"h1":return e.createElement("h1",{className:"cp-typography"},a);case"h2":return e.createElement("h2",{className:"cp-typography"},a);case"h3":return e.createElement("h3",{className:"cp-typography"},a);case"h4":return e.createElement("h4",{className:"cp-typography"},a);case"h5":return e.createElement("h5",{className:"cp-typography"},a);case"h6":return e.createElement("h6",{className:"cp-typography"},a);default:return e.createElement("p",{className:"cp-typography"},a)}};
|