beem-component 1.8.5 → 1.8.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/.eslintrc
CHANGED
|
@@ -18,12 +18,6 @@
|
|
|
18
18
|
"extensions": [".js", ".jsx"]
|
|
19
19
|
}
|
|
20
20
|
],
|
|
21
|
-
"import/no-extraneous-dependencies": [
|
|
22
|
-
"error",
|
|
23
|
-
{
|
|
24
|
-
"devDependencies": ["**/*.test.js", "**/*.spec.js", "**/stories/*"]
|
|
25
|
-
}
|
|
26
|
-
],
|
|
27
21
|
"func-style": ["error", "expression"],
|
|
28
22
|
"jest/no-disabled-tests": "warn",
|
|
29
23
|
"jest/no-focused-tests": "error",
|
|
@@ -43,7 +37,8 @@
|
|
|
43
37
|
"import/prefer-default-export": "off",
|
|
44
38
|
"react/require-default-props": "off",
|
|
45
39
|
"consistent-return": "off",
|
|
46
|
-
"react/forbid-prop-types": "off"
|
|
40
|
+
"react/forbid-prop-types": "off",
|
|
41
|
+
"import/no-extraneous-dependencies": "off"
|
|
47
42
|
},
|
|
48
43
|
"globals": {
|
|
49
44
|
"fetch": false
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = exports.BasicSample = void 0;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _buttonGroup = _interopRequireDefault(require("./buttonGroup"));
|
|
10
|
+
require("../../../main.scss");
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
14
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
15
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
16
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
17
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
18
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
19
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
20
|
+
var _default = {
|
|
21
|
+
component: _buttonGroup.default,
|
|
22
|
+
title: 'components/ButtonGroup'
|
|
23
|
+
};
|
|
24
|
+
exports.default = _default;
|
|
25
|
+
var BasicSample = function BasicSample() {
|
|
26
|
+
var _useState = (0, _react.useState)(),
|
|
27
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
28
|
+
item = _useState2[0],
|
|
29
|
+
setItem = _useState2[1];
|
|
30
|
+
var Occurance = ['Now', 'Later', 'Recurring'];
|
|
31
|
+
return /*#__PURE__*/_react.default.createElement(_buttonGroup.default, null, Occurance && Occurance.map(function (e) {
|
|
32
|
+
return /*#__PURE__*/_react.default.createElement(_buttonGroup.default.Item, {
|
|
33
|
+
onClick: function onClick() {
|
|
34
|
+
return setItem(e);
|
|
35
|
+
},
|
|
36
|
+
active: e === item
|
|
37
|
+
}, /*#__PURE__*/_react.default.createElement("p", null, e));
|
|
38
|
+
}));
|
|
39
|
+
};
|
|
40
|
+
exports.BasicSample = BasicSample;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "beem-component",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.6",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "dist/components/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -107,6 +107,7 @@
|
|
|
107
107
|
"husky": "^7.0.4",
|
|
108
108
|
"lint-staged": "^11.2.6",
|
|
109
109
|
"prettier": "^2.7.1",
|
|
110
|
-
"storybook-addon-jsx": "^7.3.14"
|
|
110
|
+
"storybook-addon-jsx": "^7.3.14",
|
|
111
|
+
"webpack": "^5.76.2"
|
|
111
112
|
}
|
|
112
113
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/* eslint-disable import/no-anonymous-default-export */
|
|
2
|
+
import React, { useState } from 'react';
|
|
3
|
+
import BmButtonGroup from './buttonGroup';
|
|
4
|
+
import '../../../main.scss';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
component: BmButtonGroup,
|
|
8
|
+
title: 'components/ButtonGroup',
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const BasicSample = () => {
|
|
12
|
+
const [item, setItem] = useState();
|
|
13
|
+
const Occurance = ['Now', 'Later', 'Recurring'];
|
|
14
|
+
return (
|
|
15
|
+
<BmButtonGroup>
|
|
16
|
+
{Occurance &&
|
|
17
|
+
Occurance.map((e) => (
|
|
18
|
+
<BmButtonGroup.Item onClick={() => setItem(e)} active={e === item}>
|
|
19
|
+
<p>{e}</p>
|
|
20
|
+
</BmButtonGroup.Item>
|
|
21
|
+
))}
|
|
22
|
+
</BmButtonGroup>
|
|
23
|
+
);
|
|
24
|
+
};
|