pcm-shared-components 0.0.5 β 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.
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = exports.Primary = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _index = _interopRequireDefault(require("./index"));
|
|
11
|
+
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
|
+
|
|
14
|
+
var _default = {
|
|
15
|
+
/* π The title prop is optional.
|
|
16
|
+
* See https://storybook.js.org/docs/react/configure/overview#configure-story-loading
|
|
17
|
+
* to learn how to generate automatic titles
|
|
18
|
+
*/
|
|
19
|
+
title: 'Button',
|
|
20
|
+
component: _index["default"]
|
|
21
|
+
}; //π We create a βtemplateβ of how args map to rendering
|
|
22
|
+
|
|
23
|
+
exports["default"] = _default;
|
|
24
|
+
|
|
25
|
+
var Template = function Template(args) {
|
|
26
|
+
return /*#__PURE__*/_react["default"].createElement(_index["default"], args);
|
|
27
|
+
}; // π Each story then reuses that template
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
var Primary = Template.bind({});
|
|
31
|
+
exports.Primary = Primary;
|
|
32
|
+
Primary.args = {
|
|
33
|
+
background: '#ff0',
|
|
34
|
+
label: 'Button'
|
|
35
|
+
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
export interface ButtonProps {}
|
|
3
2
|
|
|
4
|
-
export const Button = (
|
|
3
|
+
export const Button = () => {
|
|
5
4
|
return (
|
|
6
5
|
<button
|
|
7
6
|
type="button"
|
|
@@ -11,3 +10,5 @@ export const Button = (props: ButtonProps) => {
|
|
|
11
10
|
</button>
|
|
12
11
|
);
|
|
13
12
|
};
|
|
13
|
+
|
|
14
|
+
export default Button;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pcm-shared-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"babel": {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"build-storybook": "build-storybook",
|
|
18
18
|
"clean": "rm -Rf dist",
|
|
19
19
|
"build-tailwind": "NODE_ENV=production npx tailwindcss -o ./dist/styles/tailwind.css --minify",
|
|
20
|
-
"
|
|
20
|
+
"build": "npm run clean && NODE_ENV=production npx babel src/ --out-dir -d dist --copy-files && npm run build-tailwind"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
23
|
"react": "^17.0.2",
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
3
|
-
import { Button } from './index';
|
|
4
|
-
|
|
5
|
-
const Component: ComponentMeta<typeof Button> = {
|
|
6
|
-
title: 'Example/Button',
|
|
7
|
-
component: Button,
|
|
8
|
-
argTypes: {
|
|
9
|
-
backgroundColor: { control: 'color' },
|
|
10
|
-
},
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export default Component;
|
|
14
|
-
|
|
15
|
-
const Template: ComponentStory<typeof Button> = (args) => <Button {...args} />;
|
|
16
|
-
|
|
17
|
-
export const Primary = Template.bind({});
|
|
18
|
-
Primary.args = {};
|