@blocklet/launcher-ux 1.7.30

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/README.md ADDED
@@ -0,0 +1,14 @@
1
+ # Launcher UX Lib
2
+
3
+ Launcher common UX component
4
+
5
+ ## Usage
6
+
7
+ ```jsx
8
+ import React from 'react';
9
+ import CheckBox from '@blocklet/launcher-ux/lib/checked-box';
10
+
11
+ function App() {
12
+ return <CheckBox checked>Content</CheckBox>;
13
+ }
14
+ ```
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = CheckBox;
7
+
8
+ var _react = _interopRequireDefault(require("react"));
9
+
10
+ var _propTypes = _interopRequireDefault(require("prop-types"));
11
+
12
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
13
+
14
+ var _Check = _interopRequireDefault(require("@mui/icons-material/Check"));
15
+
16
+ const _excluded = ["children", "checked", "checkIconSize", "className"];
17
+
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
+
20
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
21
+
22
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
23
+
24
+ function CheckBox(_ref) {
25
+ let {
26
+ children,
27
+ checked,
28
+ checkIconSize,
29
+ className
30
+ } = _ref,
31
+ rest = _objectWithoutProperties(_ref, _excluded);
32
+
33
+ return /*#__PURE__*/_react.default.createElement(Content, Object.assign({
34
+ className: "".concat(checked ? 'checked' : '', " ").concat(className),
35
+ checkIconSize: checkIconSize
36
+ }, rest), children, /*#__PURE__*/_react.default.createElement("div", {
37
+ className: "check-container"
38
+ }, /*#__PURE__*/_react.default.createElement(_Check.default, {
39
+ className: "check-icon"
40
+ })));
41
+ }
42
+
43
+ CheckBox.propTypes = {
44
+ children: _propTypes.default.any.isRequired,
45
+ checkIconSize: _propTypes.default.number,
46
+ checked: _propTypes.default.bool,
47
+ className: _propTypes.default.string
48
+ };
49
+ CheckBox.defaultProps = {
50
+ checked: false,
51
+ checkIconSize: 20,
52
+ className: ''
53
+ };
54
+
55
+ const Content = _styledComponents.default.div.withConfig({
56
+ displayName: "check-box__Content",
57
+ componentId: "sc-7zt78z-0"
58
+ })(["position:relative;padding:10px;border:0 solid ", ";border-radius:8px;transition:all ease 0.2s;cursor:pointer;.check-container{position:absolute;right:0;bottom:0;display:flex;justify-content:flex-end;align-items:flex-end;width:", "px;height:", "px;border-radius:0 0 7px 0;color:", ";overflow:hidden;transition:all ease 0.3s;&:after{position:absolute;z-index:0;left:", "px;top:", "px;display:block;width:0;height:0;border-top:transparent solid ", "px;border-left:transparent solid ", "px;border-bottom:", " solid ", "px;border-right:", " solid ", "px;transition:all ease 0.1s;content:'';}.check-icon{width:60%;height:60%;position:relative;z-index:2;margin:0 1px 1px 0;font-size:16px;transform:scale(0);transition:all ease 0.2s;}}&.checked{background-color:#ecfbfd;border-color:#ecfbfd;.check-container{&:after{left:0;top:0;}.check-icon{transform:scale(1);}}}"], props => props.theme.palette.grey['100'], props => props.checkIconSize, props => props.checkIconSize, props => props.theme.palette.common.white, props => props.checkIconSize, props => props.checkIconSize, props => props.checkIconSize / 2, props => props.checkIconSize / 2, props => props.theme.palette.primary.main, props => props.checkIconSize / 2, props => props.theme.palette.primary.main, props => props.checkIconSize / 2);
package/package.json ADDED
@@ -0,0 +1,52 @@
1
+ {
2
+ "name": "@blocklet/launcher-ux",
3
+ "version": "1.7.30",
4
+ "description": "Launcher UX lib",
5
+ "publishConfig": {
6
+ "access": "public"
7
+ },
8
+ "keywords": [
9
+ "launcher",
10
+ "ux"
11
+ ],
12
+ "author": "polunzh <polunzh@gmail.com>",
13
+ "homepage": "https://github.com/blocklet/launcher#readme",
14
+ "license": "ISC",
15
+ "main": "lib/index.js",
16
+ "files": [
17
+ "lib",
18
+ "LICENSE",
19
+ "package.json",
20
+ "README.md"
21
+ ],
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "git+https://github.com/blocklet/launcher.git"
25
+ },
26
+ "scripts": {
27
+ "lint": "eslint src",
28
+ "build": "rm -rf lib && babel src --out-dir lib --copy-files",
29
+ "watch": "babel src --out-dir lib -w --copy-files",
30
+ "precommit": "CI=1 yarn test",
31
+ "prepush": "CI=1 yarn test",
32
+ "prepublish": "npm run build"
33
+ },
34
+ "bugs": {
35
+ "url": "https://github.com/blocklet/launcher/issues"
36
+ },
37
+ "peerDependencies": {
38
+ "@mui/icons-material": "^5.6.2",
39
+ "prop-types": "^15.8.1",
40
+ "react": ">=18.1.0",
41
+ "styled-components": "^5.0.1"
42
+ },
43
+ "devDependencies": {
44
+ "@babel/cli": "^7.8.4",
45
+ "@babel/core": "^7.8.4",
46
+ "@babel/preset-env": "^7.8.4",
47
+ "@babel/preset-react": "^7.8.3",
48
+ "babel-plugin-inline-react-svg": "^2.0.1",
49
+ "babel-plugin-styled-components": "^1.10.7"
50
+ },
51
+ "gitHead": "c83697fe0fdeaf15890358279f3b3f219a3236f1"
52
+ }