funuicss 3.0.7 → 3.0.9
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/css/fun.css +1 -0
- package/package.json +1 -1
- package/ui/carousel/Carousel.js +14 -2
- package/ui/chart/Bar.js +20 -8
- package/ui/drop/Dropdown.d.ts +2 -0
- package/ui/drop/Dropdown.js +9 -1
- package/ui/richtext/RichText.d.ts +0 -2
- package/ui/richtext/RichText.js +14 -2
package/css/fun.css
CHANGED
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "3.0.
|
|
2
|
+
"version": "3.0.9",
|
|
3
3
|
"name": "funuicss",
|
|
4
4
|
"description": "React and Next.js component UI Library for creating Easy and good looking websites with fewer lines of code. Elevate your web development experience with our cutting-edge React/Next.js component UI Library. Craft stunning websites effortlessly, boasting both seamless functionality and aesthetic appeal—all achieved with minimal lines of code. Unleash the power of simplicity and style in your projects!",
|
|
5
5
|
"main": "index.js",
|
package/ui/carousel/Carousel.js
CHANGED
|
@@ -47,6 +47,18 @@ var Carousel = function (_a) {
|
|
|
47
47
|
var scrollRef = (0, react_1.useRef)(null);
|
|
48
48
|
var _f = (0, react_1.useState)('start'), scrollPosition = _f[0], setScrollPosition = _f[1];
|
|
49
49
|
var _g = (0, react_1.useState)(false), isPhone = _g[0], setIsPhone = _g[1];
|
|
50
|
+
var _h = (0, react_1.useState)(false), isScrollable = _h[0], setIsScrollable = _h[1];
|
|
51
|
+
var checkScrollable = function () {
|
|
52
|
+
var container = scrollRef.current;
|
|
53
|
+
if (container) {
|
|
54
|
+
setIsScrollable(container.scrollWidth > container.clientWidth);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
(0, react_1.useEffect)(function () {
|
|
58
|
+
checkScrollable();
|
|
59
|
+
window.addEventListener('resize', checkScrollable); // Also listen to window resize
|
|
60
|
+
return function () { return window.removeEventListener('resize', checkScrollable); };
|
|
61
|
+
}, [children]);
|
|
50
62
|
(0, react_1.useEffect)(function () {
|
|
51
63
|
if ((0, Functions_1.isTouchDevice)()) {
|
|
52
64
|
setIsPhone(true);
|
|
@@ -90,7 +102,7 @@ var Carousel = function (_a) {
|
|
|
90
102
|
}, []);
|
|
91
103
|
return (react_1.default.createElement("div", { className: "carousel-wrapper ".concat(funcss) },
|
|
92
104
|
react_1.default.createElement(RowFlex_1.default, { gap: 1, wrap: "nowrap", alignItems: "center" },
|
|
93
|
-
!isPhone && (react_1.default.createElement("div", null,
|
|
105
|
+
!isPhone && isScrollable && (react_1.default.createElement("div", null,
|
|
94
106
|
react_1.default.createElement(Circle_1.default, { onClick: function () { return scroll('left'); } },
|
|
95
107
|
react_1.default.createElement(pi_1.PiCaretLeft, { size: 24 })))),
|
|
96
108
|
react_1.default.createElement("div", { ref: scrollRef, className: "carousel-container scrollbar-hide w-full", style: {
|
|
@@ -102,7 +114,7 @@ var Carousel = function (_a) {
|
|
|
102
114
|
scrollBehavior: 'smooth',
|
|
103
115
|
} }, react_1.default.Children.map(children, function (child) { return (react_1.default.createElement("div", { className: "carousel-item", style: { flexShrink: 0 } },
|
|
104
116
|
react_1.default.createElement("div", { className: "carousel-card" }, child))); })),
|
|
105
|
-
!isPhone && (react_1.default.createElement("div", null,
|
|
117
|
+
!isPhone && isScrollable && (react_1.default.createElement("div", null,
|
|
106
118
|
react_1.default.createElement(Circle_1.default, { onClick: function () { return scroll('right'); } },
|
|
107
119
|
react_1.default.createElement(pi_1.PiCaretRight, { size: 24 }))))),
|
|
108
120
|
showDashes && (react_1.default.createElement("div", { className: "center padding-top-10" },
|
package/ui/chart/Bar.js
CHANGED
|
@@ -43,15 +43,27 @@ var CustomTooltip = function (_a) {
|
|
|
43
43
|
return null;
|
|
44
44
|
};
|
|
45
45
|
var Bars = function (_a) {
|
|
46
|
-
var data = _a.data, series = _a.series, _b = _a.width, width = _b === void 0 ? '100%' : _b,
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
var data = _a.data, series = _a.series, _b = _a.width, width = _b === void 0 ? '100%' : _b, height = _a.height, _c = _a.layout, layout = _c === void 0 ? 'horizontal' : _c, _d = _a.margin, margin = _d === void 0 ? {} : _d, _e = _a.barRadius, barRadius = _e === void 0 ? 6 : _e, _f = _a.barSize, barSize = _f === void 0 ? 30 : _f, _g = _a.barGap, barGap = _g === void 0 ? 4 : _g, _h = _a.barCategoryGap, barCategoryGap = _h === void 0 ? '10%' : _h, _j = _a.showXAxis, showXAxis = _j === void 0 ? true : _j, _k = _a.showYAxis, showYAxis = _k === void 0 ? true : _k, _l = _a.xAxisProps, xAxisProps = _l === void 0 ? {} : _l, _m = _a.yAxisProps, yAxisProps = _m === void 0 ? {} : _m, _o = _a.xInterval, xInterval = _o === void 0 ? 0 : _o, _p = _a.yInterval, yInterval = _p === void 0 ? 0 : _p, _q = _a.showGrid, showGrid = _q === void 0 ? true : _q, _r = _a.gridProps, gridProps = _r === void 0 ? {} : _r, _s = _a.showTooltip, showTooltip = _s === void 0 ? true : _s, tooltipFormatter = _a.tooltipFormatter, _t = _a.showLegend, showLegend = _t === void 0 ? true : _t, _u = _a.legendProps, legendProps = _u === void 0 ? {} : _u, _v = _a.isAnimationActive, isAnimationActive = _v === void 0 ? true : _v, funcss = _a.funcss;
|
|
47
|
+
var isVertical = layout === 'vertical';
|
|
48
|
+
// Smart default margins
|
|
49
|
+
var defaultMargin = {
|
|
50
|
+
top: 20,
|
|
51
|
+
right: 30,
|
|
52
|
+
bottom: isVertical ? 30 : 50,
|
|
53
|
+
left: isVertical ? 100 : 40,
|
|
54
|
+
};
|
|
55
|
+
var mergedMargin = __assign(__assign({}, defaultMargin), margin);
|
|
56
|
+
// Smart height for vertical layout based on data length
|
|
57
|
+
var autoHeight = isVertical ? Math.max(300, data.length * 45) : 300;
|
|
58
|
+
var resolvedHeight = height || autoHeight;
|
|
59
|
+
return (react_1.default.createElement(recharts_1.ResponsiveContainer, { className: funcss || '', width: width, height: resolvedHeight },
|
|
60
|
+
react_1.default.createElement(recharts_1.BarChart, { data: data, layout: layout, margin: mergedMargin, barGap: barGap, barCategoryGap: barCategoryGap },
|
|
49
61
|
showGrid && react_1.default.createElement(recharts_1.CartesianGrid, __assign({ strokeDasharray: "3 3" }, gridProps)),
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
62
|
+
isVertical ? (react_1.default.createElement(react_1.default.Fragment, null,
|
|
63
|
+
showYAxis && (react_1.default.createElement(recharts_1.YAxis, __assign({ type: "category", dataKey: "label", interval: 0, tick: __assign({ angle: 0, fontSize: 12, textAnchor: 'start', dx: -5, dy: 4, fill: '#555' }, (yAxisProps.tick || {})), tickMargin: 10 }, yAxisProps))),
|
|
64
|
+
showXAxis && (react_1.default.createElement(recharts_1.XAxis, __assign({ type: "number", interval: xInterval, tick: { fontSize: 12 } }, xAxisProps))))) : (react_1.default.createElement(react_1.default.Fragment, null,
|
|
65
|
+
showXAxis && (react_1.default.createElement(recharts_1.XAxis, __assign({ type: "category", dataKey: "label", interval: 0, tick: __assign({ fontSize: 12, angle: 0, fill: '#555' }, xAxisProps.tick), tickMargin: 8 }, xAxisProps))),
|
|
66
|
+
showYAxis && (react_1.default.createElement(recharts_1.YAxis, __assign({ type: "number", interval: yInterval, tick: { fontSize: 12 } }, yAxisProps))))),
|
|
55
67
|
showTooltip && (react_1.default.createElement(recharts_1.Tooltip, { content: react_1.default.createElement(CustomTooltip, null), formatter: tooltipFormatter })),
|
|
56
68
|
showLegend && react_1.default.createElement(recharts_1.Legend, __assign({}, legendProps)),
|
|
57
69
|
series.map(function (s) { return (react_1.default.createElement(recharts_1.Bar, { key: s.dataKey, dataKey: s.dataKey, name: s.label || s.dataKey, fill: resolveColor(s.color), radius: layout === 'horizontal'
|
package/ui/drop/Dropdown.d.ts
CHANGED
package/ui/drop/Dropdown.js
CHANGED
|
@@ -33,8 +33,12 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
return result;
|
|
34
34
|
};
|
|
35
35
|
})();
|
|
36
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
+
};
|
|
36
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
40
|
var react_1 = __importStar(require("react"));
|
|
41
|
+
var Flex_1 = __importDefault(require("../flex/Flex"));
|
|
38
42
|
var Dropdown = function (_a) {
|
|
39
43
|
var _b = _a.direction, direction = _b === void 0 ? 'dropdown' : _b, _c = _a.position, position = _c === void 0 ? 'left' : _c, button = _a.button, items = _a.items, _d = _a.hoverable, hoverable = _d === void 0 ? true : _d, _e = _a.openOnHover, openOnHover = _e === void 0 ? true : _e, _f = _a.closableOnlyOutside, closableOnlyOutside = _f === void 0 ? false : _f, _g = _a.className, className = _g === void 0 ? '' : _g, width = _a.width, minWidth = _a.minWidth, maxWidth = _a.maxWidth, height = _a.height, minHeight = _a.minHeight, maxHeight = _a.maxHeight;
|
|
40
44
|
var containerRef = (0, react_1.useRef)(null);
|
|
@@ -70,6 +74,10 @@ var Dropdown = function (_a) {
|
|
|
70
74
|
if (!openOnHover)
|
|
71
75
|
setOpen(false);
|
|
72
76
|
}
|
|
73
|
-
} },
|
|
77
|
+
} },
|
|
78
|
+
react_1.default.createElement(Flex_1.default, { wrap: 'nowrap', gap: 0.2, alignItems: 'center', justify: 'flex-start' },
|
|
79
|
+
react_1.default.createElement("span", { style: { lineHeight: 0 } }, (item === null || item === void 0 ? void 0 : item.startIcon) || ''),
|
|
80
|
+
item.label,
|
|
81
|
+
react_1.default.createElement("span", { style: { lineHeight: 0 } }, (item === null || item === void 0 ? void 0 : item.endIcon) || '')))); }))));
|
|
74
82
|
};
|
|
75
83
|
exports.default = Dropdown;
|
package/ui/richtext/RichText.js
CHANGED
|
@@ -39,8 +39,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
39
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
40
|
var react_1 = __importStar(require("react"));
|
|
41
41
|
var react_quilljs_1 = require("react-quilljs");
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
// import 'quill/dist/quill.bubble.css';
|
|
43
|
+
// import 'quill/dist/quill.snow.css';
|
|
44
44
|
var md_1 = require("react-icons/md");
|
|
45
45
|
var Emojis_1 = require("../../utils/Emojis");
|
|
46
46
|
var Dropdown_1 = __importDefault(require("../drop/Dropdown"));
|
|
@@ -60,6 +60,18 @@ var RichText = function (_a) {
|
|
|
60
60
|
placeholder: placeholder,
|
|
61
61
|
modules: modules || defaultModules,
|
|
62
62
|
}), quill = _f.quill, quillRef = _f.quillRef;
|
|
63
|
+
(0, react_1.useEffect)(function () {
|
|
64
|
+
var cssPath = theme === 'bubble' ?
|
|
65
|
+
'/node_modules/quill/dist/quill.bubble.css' :
|
|
66
|
+
'/node_modules/quill/dist/quill.snow.css';
|
|
67
|
+
var existingLink = document.querySelector("link[href*=\"".concat(theme, "\"]"));
|
|
68
|
+
if (!existingLink) {
|
|
69
|
+
var link = document.createElement('link');
|
|
70
|
+
link.rel = 'stylesheet';
|
|
71
|
+
link.href = cssPath;
|
|
72
|
+
document.head.appendChild(link);
|
|
73
|
+
}
|
|
74
|
+
}, [theme]);
|
|
63
75
|
(0, react_1.useEffect)(function () {
|
|
64
76
|
if (!quill)
|
|
65
77
|
return;
|