@invoicebox/ui 0.1.0-alpha.2 → 0.1.0-alpha.4
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/index.js +5 -0
- package/{build → dist}/stories/Button.js +12 -8
- package/{build → dist}/stories/Button.stories.js +10 -7
- package/{build → dist}/stories/styles.js +9 -6
- package/package.json +6 -7
- package/build/index.js +0 -1
- /package/{build → dist}/index.d.ts +0 -0
- /package/{build → dist}/stories/Button.d.ts +0 -0
- /package/{build → dist}/stories/Button.stories.d.ts +0 -0
- /package/{build → dist}/stories/styles.d.ts +0 -0
package/dist/index.js
ADDED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __assign = (this && this.__assign) || function () {
|
|
2
3
|
__assign = Object.assign || function(t) {
|
|
3
4
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
@@ -20,18 +21,21 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
21
|
}
|
|
21
22
|
return t;
|
|
22
23
|
};
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.Button = void 0;
|
|
26
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
27
|
+
var styles_1 = require("./styles");
|
|
25
28
|
/**
|
|
26
29
|
* Primary UI component for user interaction
|
|
27
30
|
*/
|
|
28
|
-
|
|
31
|
+
var Button = function (_a) {
|
|
29
32
|
var _b = _a.primary, primary = _b === void 0 ? false : _b, _c = _a.size, size = _c === void 0 ? 'medium' : _c, backgroundColor = _a.backgroundColor, label = _a.label, props = __rest(_a, ["primary", "size", "backgroundColor", "label"]);
|
|
30
|
-
var modeStyles = primary ? primaryStyles : secondaryStyles;
|
|
33
|
+
var modeStyles = primary ? styles_1.primaryStyles : styles_1.secondaryStyles;
|
|
31
34
|
var sizeStyles = {
|
|
32
|
-
small: smallStyles,
|
|
33
|
-
medium: mediumStyles,
|
|
34
|
-
large: largeStyles,
|
|
35
|
+
small: styles_1.smallStyles,
|
|
36
|
+
medium: styles_1.mediumStyles,
|
|
37
|
+
large: styles_1.largeStyles,
|
|
35
38
|
}[size];
|
|
36
|
-
return (
|
|
39
|
+
return ((0, jsx_runtime_1.jsx)("button", __assign({ type: "button", style: __assign(__assign(__assign(__assign({}, styles_1.wrapperStyles), modeStyles), sizeStyles), (backgroundColor ? { backgroundColor: backgroundColor } : {})) }, props, { children: label })));
|
|
37
40
|
};
|
|
41
|
+
exports.Button = Button;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Small = exports.Large = exports.Secondary = exports.Primary = void 0;
|
|
4
|
+
var Button_1 = require("./Button");
|
|
2
5
|
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
|
|
3
6
|
var meta = {
|
|
4
7
|
title: 'Example/Button',
|
|
5
|
-
component: Button,
|
|
8
|
+
component: Button_1.Button,
|
|
6
9
|
parameters: {
|
|
7
10
|
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
|
|
8
11
|
layout: 'centered',
|
|
@@ -14,26 +17,26 @@ var meta = {
|
|
|
14
17
|
backgroundColor: { control: 'color' },
|
|
15
18
|
},
|
|
16
19
|
};
|
|
17
|
-
|
|
20
|
+
exports.default = meta;
|
|
18
21
|
// More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
|
|
19
|
-
|
|
22
|
+
exports.Primary = {
|
|
20
23
|
args: {
|
|
21
24
|
primary: true,
|
|
22
25
|
label: 'Button',
|
|
23
26
|
},
|
|
24
27
|
};
|
|
25
|
-
|
|
28
|
+
exports.Secondary = {
|
|
26
29
|
args: {
|
|
27
30
|
label: 'Button',
|
|
28
31
|
},
|
|
29
32
|
};
|
|
30
|
-
|
|
33
|
+
exports.Large = {
|
|
31
34
|
args: {
|
|
32
35
|
size: 'large',
|
|
33
36
|
label: 'Button',
|
|
34
37
|
},
|
|
35
38
|
};
|
|
36
|
-
|
|
39
|
+
exports.Small = {
|
|
37
40
|
args: {
|
|
38
41
|
size: 'small',
|
|
39
42
|
label: 'Button',
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.largeStyles = exports.mediumStyles = exports.smallStyles = exports.secondaryStyles = exports.primaryStyles = exports.wrapperStyles = void 0;
|
|
4
|
+
exports.wrapperStyles = {
|
|
2
5
|
fontFamily: "'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif",
|
|
3
6
|
fontWeight: 700,
|
|
4
7
|
border: 0,
|
|
@@ -7,24 +10,24 @@ export var wrapperStyles = {
|
|
|
7
10
|
display: 'inline-block',
|
|
8
11
|
lineHeight: 1,
|
|
9
12
|
};
|
|
10
|
-
|
|
13
|
+
exports.primaryStyles = {
|
|
11
14
|
color: 'white',
|
|
12
15
|
backgroundColor: '#1ea7fd',
|
|
13
16
|
};
|
|
14
|
-
|
|
17
|
+
exports.secondaryStyles = {
|
|
15
18
|
color: '#333',
|
|
16
19
|
backgroundColor: 'transparent',
|
|
17
20
|
boxShadow: 'rgba(0, 0, 0, 0.15) 0px 0px 0px 1px inset',
|
|
18
21
|
};
|
|
19
|
-
|
|
22
|
+
exports.smallStyles = {
|
|
20
23
|
fontSize: '12px',
|
|
21
24
|
padding: '10px 16px',
|
|
22
25
|
};
|
|
23
|
-
|
|
26
|
+
exports.mediumStyles = {
|
|
24
27
|
fontSize: '14px',
|
|
25
28
|
padding: '11px 20px',
|
|
26
29
|
};
|
|
27
|
-
|
|
30
|
+
exports.largeStyles = {
|
|
28
31
|
fontSize: '16px',
|
|
29
32
|
padding: '12px 24px',
|
|
30
33
|
};
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@invoicebox/ui",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.4",
|
|
4
4
|
"description": "Invoicebox UI",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"storybook": "storybook dev -p 6006",
|
|
8
8
|
"build-storybook": "storybook build",
|
|
9
|
-
"build": "tsc --project tsconfig.json"
|
|
9
|
+
"build": "tsc --project tsconfig.json",
|
|
10
|
+
"release": "git checkout main && git merge develop && git push && npm publish && git checkout develop"
|
|
10
11
|
},
|
|
11
12
|
"bugs": {
|
|
12
13
|
"url": "https://github.com/InvoiceBox/invoicebox-ui/issues"
|
|
@@ -43,12 +44,10 @@
|
|
|
43
44
|
"node": "^16.17.1"
|
|
44
45
|
},
|
|
45
46
|
"files": [
|
|
46
|
-
"
|
|
47
|
+
"dist"
|
|
47
48
|
],
|
|
48
|
-
"
|
|
49
|
-
"types": "./build/index.d.ts",
|
|
50
|
-
"module": "./build/index.js",
|
|
49
|
+
"main": "./dist/index.js",
|
|
51
50
|
"exports": {
|
|
52
|
-
"
|
|
51
|
+
"require": "./dist/index.js"
|
|
53
52
|
}
|
|
54
53
|
}
|
package/build/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Button } from './stories/Button';
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|