ui-beyable 1.0.0 → 1.0.1

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 (48) hide show
  1. package/lib/cjs/components/Button/BYbtn.d.ts +6 -0
  2. package/lib/cjs/components/Button/type.d.ts +27 -0
  3. package/lib/cjs/components/Collapse/BYcollapse.d.ts +4 -0
  4. package/lib/cjs/components/Collapse/type.d.ts +5 -0
  5. package/lib/cjs/components/Modal/BYmodal.d.ts +4 -0
  6. package/lib/cjs/components/Modal/types.d.ts +11 -0
  7. package/lib/cjs/components/Portal/BYportal.d.ts +3 -0
  8. package/lib/cjs/components/Portal/type.d.ts +6 -0
  9. package/lib/cjs/esm/components/BYbtn.d.ts +6 -0
  10. package/lib/cjs/esm/components/Button/BYbtn.d.ts +6 -0
  11. package/lib/cjs/esm/components/Button/type.d.ts +27 -0
  12. package/lib/cjs/esm/components/Button.d.ts +7 -0
  13. package/lib/cjs/esm/components/Collapse/BYcollapse.d.ts +4 -0
  14. package/lib/cjs/esm/components/Collapse/type.d.ts +5 -0
  15. package/lib/cjs/esm/components/Modal/BYmodal.d.ts +4 -0
  16. package/lib/cjs/esm/components/Modal/types.d.ts +11 -0
  17. package/lib/cjs/esm/components/Portal/BYportal.d.ts +3 -0
  18. package/lib/cjs/esm/components/Portal/type.d.ts +6 -0
  19. package/lib/cjs/esm/components/type.d.ts +27 -0
  20. package/lib/cjs/esm/index.d.ts +60 -0
  21. package/lib/cjs/index.css +36 -0
  22. package/lib/cjs/index.css.map +1 -0
  23. package/lib/cjs/index.d.ts +60 -0
  24. package/lib/cjs/index.js +170 -0
  25. package/lib/cjs/index.js.map +1 -0
  26. package/lib/esm/components/BYbtn.d.ts +6 -0
  27. package/lib/esm/components/Button/BYbtn.d.ts +6 -0
  28. package/lib/esm/components/Button/type.d.ts +27 -0
  29. package/lib/esm/components/Button.d.ts +7 -0
  30. package/lib/esm/components/Collapse/BYcollapse.d.ts +4 -0
  31. package/lib/esm/components/Collapse/type.d.ts +5 -0
  32. package/lib/esm/components/Modal/BYmodal.d.ts +4 -0
  33. package/lib/esm/components/Modal/types.d.ts +11 -0
  34. package/lib/esm/components/Portal/BYportal.d.ts +3 -0
  35. package/lib/esm/components/Portal/type.d.ts +6 -0
  36. package/lib/esm/components/type.d.ts +27 -0
  37. package/lib/esm/index.css +36 -0
  38. package/lib/esm/index.css.map +1 -0
  39. package/lib/esm/index.d.ts +60 -0
  40. package/lib/esm/index.js +165 -0
  41. package/lib/esm/index.js.map +1 -0
  42. package/lib/index.d.ts +51 -0
  43. package/package.json +35 -15
  44. package/src/components/Button.css +0 -3
  45. package/src/components/Button.js +0 -8
  46. package/src/components/Button.tsx +0 -18
  47. package/src/components/ByBtn.js +0 -7
  48. package/src/components/ByBtn.tsx +0 -11
@@ -0,0 +1,60 @@
1
+ import BYBtn from './components/Button/BYbtn';
2
+ import BYmodal from './components/Modal/BYmodal';
3
+ import ByPortal from './components/Portal/BYportal';
4
+ import BYcollapse from './components/Collapse/BYcollapse';
5
+ import "./style/globalStyle.css";
6
+ import "./style/params.css";
7
+ import "./style/animate.css";
8
+ import "./style/bootstrap-overrides.css";
9
+ import "./style/bootstrap/css/bootstrap_framework.css";
10
+ import "./style/btn.css";
11
+ import "./style/c3.min.css";
12
+ import "./style/checkbox.css";
13
+ import "./style/colorpicker.css";
14
+ import "./style/custom-antd.css";
15
+ import "./style/customInput.css";
16
+ import "./style/datepicker.css";
17
+ import "./style/datepickerrange.min.css";
18
+ import "./style/empty.css";
19
+ import "./style/field.css";
20
+ import "./style/flex.css";
21
+ import "./style/fonts.css";
22
+ import "./style/form.css";
23
+ import "./style/gridstack.min.css";
24
+ import "./style/Header.css";
25
+ import "./style/icofont.min.css";
26
+ import "./style/icon.css";
27
+ import "./style/Informations.css";
28
+ import "./style/insights.css";
29
+ import "./style/jqCron.css";
30
+ import "./style/listbox.css";
31
+ import "./style/modal.css";
32
+ import "./style/navigation.css";
33
+ import "./style/notifications.css";
34
+ import "./style/orchestration.css";
35
+ import "./style/page.css";
36
+ import "./style/panel.css";
37
+ import "./style/place_autocomplete.css";
38
+ import "./style/react-cron.css";
39
+ import "./style/react-table.css";
40
+ import "./style/reset.css";
41
+ import "./style/scroll.css";
42
+ import "./style/section.css";
43
+ import "./style/setup.css";
44
+ import "./style/shepherd.css";
45
+ import "./style/simplegrid.css";
46
+ import "./style/spinner.css";
47
+ import "./style/stats.css";
48
+ import "./style/style.css";
49
+ import "./style/SideBar.css";
50
+ import "./style/table.css";
51
+ import "./style/tabs.css";
52
+ import "./style/thumb_list.css";
53
+ import "./style/tippy.css";
54
+ import "./style/traffic-overview.css";
55
+ import "./style/utils.css";
56
+ import "./style/var.css";
57
+ import "./style/variation.css";
58
+ import "./style/wheel.css";
59
+ import "./style/wishlists.css";
60
+ export { BYBtn, BYmodal, ByPortal, BYcollapse };
@@ -0,0 +1,165 @@
1
+ import React from 'react';
2
+ import ReactDOM from 'react-dom';
3
+
4
+ var Btn = function (_a) {
5
+ var children = _a.children, _b = _a.type, type = _b === void 0 ? 'button' : _b, _c = _a.htmlTag, htmlTag = _c === void 0 ? "button" : _c, onClickFunction = _a.onClickFunction, onClick = _a.onClick, _d = _a.href, href = _d === void 0 ? '' : _d, _e = _a.target, target = _e === void 0 ? '' : _e, _f = _a.message, message = _f === void 0 ? '' : _f, _g = _a.color, color = _g === void 0 ? 'primary' : _g, _h = _a.style, style = _h === void 0 ? '' : _h, _j = _a.rounded, rounded = _j === void 0 ? false : _j, _k = _a.disabled, disabled = _k === void 0 ? false : _k, _l = _a.className, className = _l === void 0 ? '' : _l, _m = _a.strong, strong = _m === void 0 ? false : _m, _o = _a.light, light = _o === void 0 ? false : _o, _p = _a.size, size = _p === void 0 ? "" : _p, _q = _a.fontSize, fontSize = _q === void 0 ? '' : _q, _r = _a.fullWidth, fullWidth = _r === void 0 ? false : _r, _s = _a.fullHeight, fullHeight = _s === void 0 ? false : _s, icon = _a.icon, _t = _a.iconPosition, iconPosition = _t === void 0 ? 'before' : _t, _u = _a.arrow, arrow = _u === void 0 ? false : _u, dataFor = _a.dataFor, dataTip = _a.dataTip;
6
+ var click = function (ev) {
7
+ if (typeof onClickFunction === 'function') {
8
+ onClickFunction(ev);
9
+ }
10
+ if (typeof onClick === 'function') {
11
+ onClick(ev);
12
+ }
13
+ };
14
+ var cssClass = ['btnUi'];
15
+ if (className) {
16
+ cssClass = cssClass.concat(className);
17
+ }
18
+ // Style and Color
19
+ var styleClass = 'btn';
20
+ if (style === 'outline' || style === 'ghost') {
21
+ styleClass += '_' + style;
22
+ }
23
+ styleClass += '_' + color;
24
+ cssClass.push(styleClass);
25
+ // Rounded
26
+ if (rounded) {
27
+ cssClass.push('btn_rounded');
28
+ }
29
+ // Disabled
30
+ if (disabled) {
31
+ cssClass.push('btn_disabled');
32
+ }
33
+ // Strong
34
+ if (strong) {
35
+ cssClass.push('btn_strong');
36
+ }
37
+ // Light
38
+ if (light) {
39
+ cssClass.push('btn_light');
40
+ }
41
+ // Arrow
42
+ if (arrow) {
43
+ cssClass.push('has_arrow');
44
+ }
45
+ // Size : xs, s, default, l, xl, xxl
46
+ if (size) {
47
+ cssClass.push('btn_' + size);
48
+ }
49
+ // Font size : s
50
+ if (fontSize) {
51
+ cssClass.push('btn_fs_' + fontSize);
52
+ }
53
+ // Icon
54
+ if (icon) {
55
+ cssClass.push('has_icon');
56
+ }
57
+ // Full width
58
+ if (fullWidth) {
59
+ cssClass.push('w_full');
60
+ }
61
+ // Full height
62
+ if (fullHeight) {
63
+ cssClass.push('h_full');
64
+ }
65
+ // Type
66
+ if (href) {
67
+ htmlTag = "a";
68
+ }
69
+ return (React.createElement("div", { className: "BYUI" },
70
+ htmlTag == 'button' &&
71
+ React.createElement("button", { type: type, className: cssClass.join(' '), onClick: function (e) { return click(e); }, "data-for": dataFor, "data-tip": dataTip },
72
+ icon && iconPosition !== 'after' &&
73
+ icon,
74
+ message &&
75
+ React.createElement("span", { className: "btn_txt" }, message),
76
+ children &&
77
+ React.createElement("span", { className: "btn_txt" }, children),
78
+ icon && iconPosition === 'after' &&
79
+ icon),
80
+ htmlTag == 'a' &&
81
+ React.createElement("a", { className: cssClass.join(' '), onClick: function (e) { return click(e); }, target: target, href: href, "data-for": dataFor, "data-tip": dataTip },
82
+ icon && iconPosition !== 'after' &&
83
+ icon,
84
+ message &&
85
+ React.createElement("span", { className: "btn_txt" }, message),
86
+ children &&
87
+ React.createElement("span", { className: "btn_txt" }, children),
88
+ icon && iconPosition === 'after' &&
89
+ icon)));
90
+ };
91
+ var BYbtn = React.memo(Btn);
92
+
93
+ function Portal(_a) {
94
+ var _b = _a.target, target = _b === void 0 ? document.body : _b, children = _a.children;
95
+ return ReactDOM.createPortal(children, target);
96
+ }
97
+
98
+ function Modal(_a) {
99
+ var children = _a.children, _b = _a.isOpen, isOpen = _b === void 0 ? false : _b, onClose = _a.onClose, _c = _a.noClose, noClose = _c === void 0 ? false : _c, width = _a.width, height = _a.height, minHeight = _a.minHeight;
100
+ var style = { width: '', height: '', minHeight: '' };
101
+ var hide = function (ev) {
102
+ if (typeof onClose === 'function') {
103
+ onClose(ev);
104
+ }
105
+ };
106
+ if (width) {
107
+ style.width = width + 'px';
108
+ }
109
+ if (height) {
110
+ style.height = height + 'px';
111
+ }
112
+ if (minHeight) {
113
+ style.minHeight = 'min(100%, ' + minHeight + 'px)';
114
+ }
115
+ if (!isOpen)
116
+ return React.createElement(React.Fragment, null);
117
+ return (React.createElement(Portal, null,
118
+ React.createElement("div", { className: "modal_outer section_root", tabIndex: -1 },
119
+ React.createElement("div", { className: "modal_inner", style: style },
120
+ !noClose &&
121
+ React.createElement("a", { onClick: function (ev) { return hide(ev); }, className: "modal_close" }),
122
+ children))));
123
+ }
124
+
125
+ var styles = {"wrapper_common":"collapse-module_wrapper_common__OhNXa","wrapper_close":"collapse-module_wrapper_close__pPihr","wrapper_open":"collapse-module_wrapper_open__-Pauk","header":"collapse-module_header__3XouW","header_btn":"collapse-module_header_btn__WqgSX","arrow":"collapse-module_arrow__m09w4","fas":"collapse-module_fas__KttZB","body":"collapse-module_body__n-AEV","wrapperCommon":"collapse-module_wrapper_common__OhNXa","wrapperClose":"collapse-module_wrapper_close__pPihr","wrapperOpen":"collapse-module_wrapper_open__-Pauk","headerBtn":"collapse-module_header_btn__WqgSX"};
126
+
127
+ console.log('🚀--** ~ file: BYcollapse.tsx:2 ~ React:', React);
128
+ function Collapse(_a) {
129
+ var label = _a.label, children = _a.children, _b = _a.defaultOpen, defaultOpen = _b === void 0 ? false : _b;
130
+ var _c = React.useState(true), isOpen = _c[0], setIsOpen = _c[1];
131
+ var bodyRef = React.useRef(null);
132
+ var toggle = function () {
133
+ if (!bodyRef.current)
134
+ return;
135
+ var delay = isOpen ? 0 : 300;
136
+ //@ts-ignore
137
+ var height = bodyRef.current.scrollHeight;
138
+ //@ts-ignore
139
+ bodyRef.current.style.height = height + 'px';
140
+ //@ts-ignore
141
+ bodyRef.current.style.overflow = 'hidden';
142
+ setTimeout(function () {
143
+ //@ts-ignore
144
+ bodyRef.current.style.height = '';
145
+ //@ts-ignore
146
+ bodyRef.current.style.overflow = '';
147
+ }, delay);
148
+ setIsOpen(!isOpen);
149
+ };
150
+ React.useEffect(function () {
151
+ if (defaultOpen && defaultOpen !== isOpen) {
152
+ setIsOpen(defaultOpen);
153
+ }
154
+ }, [defaultOpen]);
155
+ return (React.createElement("div", { className: isOpen ? styles.wrapper_open : styles.wrapper_close },
156
+ React.createElement("div", { className: styles.header },
157
+ React.createElement("div", { className: styles.header_btn, onClick: function () { return toggle(); } },
158
+ React.createElement("span", { className: styles.arrow },
159
+ React.createElement("i", { className: "fas fa-sm fa-chevron-down", style: { 'display': 'block' } })),
160
+ label)),
161
+ React.createElement("div", { className: styles.body, ref: bodyRef }, children)));
162
+ }
163
+
164
+ export { BYbtn as BYBtn, Collapse as BYcollapse, Modal as BYmodal, Portal as ByPortal };
165
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/lib/index.d.ts ADDED
@@ -0,0 +1,51 @@
1
+ import React$1 from 'react';
2
+
3
+ interface IBYmodal {
4
+ children: React$1.ReactNode;
5
+ isOpen:boolean;
6
+ onClose?:(e:any) => any ;
7
+ noClose?:boolean ;
8
+ width?: string ;
9
+ height? : string;
10
+ minHeight?: string;
11
+ }
12
+
13
+ interface IBYportal {
14
+ target?: any;
15
+ children: React.ReactNode;
16
+ }
17
+
18
+ interface IBYbtn {
19
+ children? : React$1.ReactNode;
20
+ type? : "button" | "submit" |"reset" ;
21
+ htmlTag?: 'button' | 'a';
22
+ onClickFunction? : (e : React$1.MouseEvent) => any;
23
+ onClick? : (e : React$1.MouseEvent) => any;
24
+ href? : string;
25
+ target? :string;
26
+ message? :string;
27
+ color? : string;
28
+ style? : string;
29
+ rounded? :boolean;
30
+ disabled? :boolean;
31
+ className? : string;
32
+ strong? :boolean;
33
+ light? :boolean;
34
+ size?: ""|"xxs"|'xs'|'s'|'m'|'l'|'xl'|'xxl';
35
+ fontSize? : string;
36
+ fullWidth?: boolean;
37
+ fullHeight?: boolean;
38
+ icon? : any;
39
+ iconPosition? : 'before' | 'after';
40
+ arrow? :boolean | "true" | "false";
41
+ dataFor? : string;
42
+ dataTip? : string;
43
+ }
44
+
45
+ interface IBYcollapse {
46
+ label?:string,
47
+ children?:any,
48
+ defaultOpen ?:boolean
49
+ }
50
+
51
+ export { IBYbtn, IBYcollapse, IBYmodal, IBYportal };
package/package.json CHANGED
@@ -1,14 +1,16 @@
1
1
  {
2
2
  "name": "ui-beyable",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Ui library of Beyable projets",
5
- "main": "src/index.ts",
6
- "files": [
7
- "src/**/*"
8
- ],
5
+ "main": "./lib/cjs/index.js",
6
+ "module": "./lib/esm/index.js",
7
+ "types": "./lib/esm/index.d.ts",
9
8
  "scripts": {
10
- "test": "echo \"Error: no test specified\" && exit 1",
11
- "build": "tsc"
9
+ "buildrollup": "rollup -c",
10
+ "build": "npm run build:esm && npm run build:cjs",
11
+ "build:esm": "tsc",
12
+ "build:cjs": "tsc --module commonjs --outDir lib/cjs",
13
+ "prepublishOnly": "rollup -c"
12
14
  },
13
15
  "plugins": [
14
16
  {
@@ -28,17 +30,35 @@
28
30
  "url": "https://github.com/BEYABLE/beyableUI/issues"
29
31
  },
30
32
  "homepage": "https://github.com/BEYABLE/beyableUI#readme",
33
+ "peerDependencies": {
34
+ "react": "18.2.0",
35
+ "react-dom": "18.2.0"
36
+ },
31
37
  "dependencies": {
32
38
  "@fortawesome/fontawesome-svg-core": "^6.4.0",
39
+ "@rollup/plugin-commonjs": "^25.0.1",
40
+ "@rollup/plugin-node-resolve": "^15.1.0",
41
+ "@rollup/plugin-typescript": "^11.1.1",
33
42
  "@tsconfig/recommended": "^1.0.2",
34
- "react": "^18.2.0",
35
- "react-dom": "^18.2.0",
36
- "typescript": "^5.1.3",
37
- "@types/react": "^18.2.12",
38
- "@types/react-dom": "^18.2.5",
39
- "typescript-plugin-css-modules": "^3.4.0"
43
+ "autoprefixer": "^10.4.14",
44
+ "postcss": "^8.4.24",
45
+ "rollup": "^3.25.1",
46
+ "rollup-plugin-dts": "^5.3.0",
47
+ "rollup-plugin-peer-deps-external": "^2.2.4",
48
+ "rollup-plugin-postcss": "^4.0.2",
49
+ "rollup-plugin-postcss-modules": "^2.1.1",
50
+ "rollup-plugin-typescript2": "^0.34.1",
51
+ "tslib": "^2.5.3",
52
+ "typescript-plugin-css-modules": "^5.0.1"
40
53
  },
41
54
  "devDependencies": {
42
-
43
- }
55
+ "@types/react": "18.2.0",
56
+ "@types/react-dom": "18.2.0",
57
+ "react": "18.2.0",
58
+ "react-dom": "18.2.0",
59
+ "typescript": "^4.0.2"
60
+ },
61
+ "files": [
62
+ "/lib"
63
+ ]
44
64
  }
@@ -1,3 +0,0 @@
1
- .btn{
2
- color: blue;
3
- }
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const jsx_runtime_1 = require("react/jsx-runtime");
4
- const Button = (props) => {
5
- const { children } = props;
6
- return ((0, jsx_runtime_1.jsx)("button", { children: children }));
7
- };
8
- exports.default = Button;
@@ -1,18 +0,0 @@
1
-
2
- import React from "react";
3
- interface IButtonProps extends React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement> {
4
- backgroundColor?: string;
5
- color?: string;
6
- }
7
-
8
- const Button: React.FunctionComponent<IButtonProps> = (props) => {
9
- const { children } = props;
10
-
11
-
12
- return (
13
- <button >
14
- {children}
15
- </button>
16
- )};
17
-
18
- export default Button
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const jsx_runtime_1 = require("react/jsx-runtime");
4
- const BYBtn = (props) => {
5
- return (0, jsx_runtime_1.jsx)("button", { children: props.label });
6
- };
7
- exports.default = BYBtn;
@@ -1,11 +0,0 @@
1
- import React from "react";
2
-
3
- export interface ButtonProps {
4
- label: string;
5
- }
6
-
7
- const BYBtn = (props: ButtonProps) => {
8
- return <button>{props.label}</button>;
9
- };
10
-
11
- export default BYBtn;