arengibook 0.0.15 → 0.0.17

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.
Files changed (2) hide show
  1. package/dist/index.js +27 -16
  2. package/package.json +2 -4
package/dist/index.js CHANGED
@@ -1254,16 +1254,19 @@ function styleInject(css, ref) {
1254
1254
  var css_248z = ".storybook-button {\n display: inline-block;\n cursor: pointer;\n border: 0;\n border-radius: 3em;\n font-weight: 700;\n line-height: 1;\n font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;\n}\n.storybook-button--primary {\n background-color: #555ab9;\n color: white;\n}\n.storybook-button--secondary {\n box-shadow: rgba(0, 0, 0, 0.15) 0px 0px 0px 1px inset;\n background-color: transparent;\n color: #333;\n}\n.storybook-button--small {\n padding: 10px 16px;\n font-size: 12px;\n}\n.storybook-button--medium {\n padding: 11px 20px;\n font-size: 14px;\n}\n.storybook-button--large {\n padding: 12px 24px;\n font-size: 16px;\n}\n";
1255
1255
  styleInject(css_248z);
1256
1256
 
1257
- const _excluded = ["primary", "backgroundColor", "borderRadius", "size", "label"];
1257
+ const _excluded = ["label", "primary", "size", "backgroundColor", "borderRadius", "onClick"];
1258
1258
 
1259
- /** Primary UI component for user interaction */
1259
+ /**
1260
+ * Reusable button component
1261
+ */
1260
1262
  const Button = _ref => {
1261
1263
  let {
1264
+ label,
1262
1265
  primary = false,
1263
- backgroundColor = null,
1264
- borderRadius = 10,
1265
1266
  size = 'medium',
1266
- label
1267
+ backgroundColor = null,
1268
+ borderRadius = 8,
1269
+ onClick
1267
1270
  } = _ref,
1268
1271
  props = _objectWithoutProperties(_ref, _excluded);
1269
1272
  const mode = primary ? 'storybook-button--primary' : 'storybook-button--secondary';
@@ -1273,22 +1276,30 @@ const Button = _ref => {
1273
1276
  style: {
1274
1277
  backgroundColor,
1275
1278
  borderRadius
1276
- }
1279
+ },
1280
+ onClick: onClick
1277
1281
  }, props), label);
1278
1282
  };
1279
1283
  Button.propTypes = {
1280
- /** Is this the principal call to action on the page? */
1284
+ /** Text inside the button */
1285
+ label: PropTypes.string.isRequired,
1286
+ /** Primary button styling */
1281
1287
  primary: PropTypes.bool,
1282
- /** What background color to use */
1283
- backgroundColor: PropTypes.string,
1284
- /** How large should the button be? */
1288
+ /** Size of the button */
1285
1289
  size: PropTypes.oneOf(['small', 'medium', 'large']),
1286
- /** Button contents */
1287
- label: PropTypes.string.isRequired,
1288
- /** Optional click handler */
1289
- onClick: PropTypes.func,
1290
- /** Je test mon border-radius */
1291
- borderRadius: PropTypes.number
1290
+ /** Custom background color */
1291
+ backgroundColor: PropTypes.string,
1292
+ /** Border radius in px */
1293
+ borderRadius: PropTypes.number,
1294
+ /** Click handler */
1295
+ onClick: PropTypes.func
1296
+ };
1297
+ Button.defaultProps = {
1298
+ primary: false,
1299
+ size: 'medium',
1300
+ backgroundColor: null,
1301
+ borderRadius: 8,
1302
+ onClick: undefined
1292
1303
  };
1293
1304
 
1294
1305
  export { Button };
package/package.json CHANGED
@@ -1,13 +1,11 @@
1
1
  {
2
2
  "name": "arengibook",
3
3
  "private": false,
4
- "version": "0.0.15",
4
+ "version": "0.0.17",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
- "module": "dist/index.js",
8
7
  "exports": {
9
- "import": "./dist/index.js",
10
- "require": "./dist/index.js"
8
+ ".": "./dist/index.js"
11
9
  },
12
10
  "files": [
13
11
  "dist"