@platformatic/ui-components 0.1.13 → 0.1.14
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/assets/index.fcbe6de7.js +797 -0
- package/dist/index.html +2 -2
- package/dist/main.css +20 -52
- package/dist/platformatic-ui.css +1 -0
- package/package.json +1 -1
- package/src/components/Button.jsx +28 -0
- package/src/components/Button.module.css +17 -0
- package/src/components/Input.jsx +10 -0
- package/src/components/Input.module.css +7 -0
- package/src/stories/Button.stories.jsx +53 -22
- package/src/stories/Input.stories.jsx +15 -0
- package/dist/assets/index.133cf9fb.css +0 -1
- package/dist/assets/index.97014e0d.js +0 -797
- package/src/stories/Button.jsx +0 -50
- package/src/stories/button.css +0 -30
package/src/stories/Button.jsx
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import PropTypes from 'prop-types'
|
|
3
|
-
import './button.css'
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Primary UI component for user interaction
|
|
7
|
-
*/
|
|
8
|
-
export const Button = ({ primary, backgroundColor, size, label, ...props }) => {
|
|
9
|
-
const mode = primary ? 'storybook-button--primary' : 'storybook-button--secondary'
|
|
10
|
-
return (
|
|
11
|
-
<button
|
|
12
|
-
type='button'
|
|
13
|
-
className={['storybook-button', `storybook-button--${size}`, mode].join(' ')}
|
|
14
|
-
style={backgroundColor && { backgroundColor }}
|
|
15
|
-
{...props}
|
|
16
|
-
>
|
|
17
|
-
{label}
|
|
18
|
-
</button>
|
|
19
|
-
)
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
Button.propTypes = {
|
|
23
|
-
/**
|
|
24
|
-
* Is this the principal call to action on the page?
|
|
25
|
-
*/
|
|
26
|
-
primary: PropTypes.bool,
|
|
27
|
-
/**
|
|
28
|
-
* What background color to use
|
|
29
|
-
*/
|
|
30
|
-
backgroundColor: PropTypes.string,
|
|
31
|
-
/**
|
|
32
|
-
* How large should the button be?
|
|
33
|
-
*/
|
|
34
|
-
size: PropTypes.oneOf(['small', 'medium', 'large']),
|
|
35
|
-
/**
|
|
36
|
-
* Button contents
|
|
37
|
-
*/
|
|
38
|
-
label: PropTypes.string.isRequired,
|
|
39
|
-
/**
|
|
40
|
-
* Optional click handler
|
|
41
|
-
*/
|
|
42
|
-
onClick: PropTypes.func
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
Button.defaultProps = {
|
|
46
|
-
backgroundColor: null,
|
|
47
|
-
primary: false,
|
|
48
|
-
size: 'medium',
|
|
49
|
-
onClick: undefined
|
|
50
|
-
}
|
package/src/stories/button.css
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
.storybook-button {
|
|
2
|
-
font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
|
3
|
-
font-weight: 700;
|
|
4
|
-
border: 0;
|
|
5
|
-
border-radius: 3em;
|
|
6
|
-
cursor: pointer;
|
|
7
|
-
display: inline-block;
|
|
8
|
-
line-height: 1;
|
|
9
|
-
}
|
|
10
|
-
.storybook-button--primary {
|
|
11
|
-
color: white;
|
|
12
|
-
background-color: #1ea7fd;
|
|
13
|
-
}
|
|
14
|
-
.storybook-button--secondary {
|
|
15
|
-
color: #333;
|
|
16
|
-
background-color: transparent;
|
|
17
|
-
box-shadow: rgba(0, 0, 0, 0.15) 0px 0px 0px 1px inset;
|
|
18
|
-
}
|
|
19
|
-
.storybook-button--small {
|
|
20
|
-
font-size: 12px;
|
|
21
|
-
padding: 10px 16px;
|
|
22
|
-
}
|
|
23
|
-
.storybook-button--medium {
|
|
24
|
-
font-size: 14px;
|
|
25
|
-
padding: 11px 20px;
|
|
26
|
-
}
|
|
27
|
-
.storybook-button--large {
|
|
28
|
-
font-size: 16px;
|
|
29
|
-
padding: 12px 24px;
|
|
30
|
-
}
|