funuicss 2.6.17 → 2.6.19
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 +0 -6
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/ui/chart/Bar.d.ts +13 -1
- package/ui/chart/Bar.js +26 -24
- package/ui/chart/Bar.tsx +49 -14
- package/ui/chart/Line.d.ts +14 -1
- package/ui/chart/Line.js +25 -13
- package/ui/chart/Line.tsx +62 -19
- package/ui/chart/Pie.d.ts +4 -0
- package/ui/chart/Pie.js +37 -13
- package/ui/chart/Pie.tsx +41 -13
- package/ui/sidebar/SideBar.d.ts +4 -1
- package/ui/sidebar/SideBar.js +7 -7
- package/ui/sidebar/SideBar.tsx +9 -3
package/ui/sidebar/SideBar.js
CHANGED
|
@@ -45,10 +45,10 @@ var navigation_1 = require("next/navigation");
|
|
|
45
45
|
var link_1 = __importDefault(require("next/link"));
|
|
46
46
|
function SideBar(_a) {
|
|
47
47
|
var _b;
|
|
48
|
-
var _c = _a.funcss, funcss = _c === void 0 ? '' : _c, _d = _a.position, position = _d === void 0 ? 'left' : _d, _e = _a.open, open = _e === void 0 ? false : _e, header = _a.header, content = _a.content, footer = _a.footer, _f = _a.top, top = _f === void 0 ? 0 : _f, _g = _a.sidebarWidth, sidebarWidth = _g === void 0 ? 250 : _g, _h = _a.
|
|
49
|
-
var
|
|
50
|
-
var
|
|
51
|
-
var
|
|
48
|
+
var _c = _a.funcss, funcss = _c === void 0 ? '' : _c, _d = _a.position, position = _d === void 0 ? 'left' : _d, _e = _a.open, open = _e === void 0 ? false : _e, header = _a.header, content = _a.content, footer = _a.footer, _f = _a.top, top = _f === void 0 ? 0 : _f, _g = _a.sidebarWidth, sidebarWidth = _g === void 0 ? 250 : _g, _h = _a.iconCSS, iconCSS = _h === void 0 ? '' : _h, _j = _a.sidebarCss, sidebarCss = _j === void 0 ? '' : _j, activeCss = _a.activeCss, _k = _a.bodyCss, bodyCss = _k === void 0 ? '' : _k, _l = _a.popIcon, popIcon = _l === void 0 ? false : _l, _m = _a.dividers, dividers = _m === void 0 ? false : _m, _o = _a.links, links = _o === void 0 ? [] : _o, children = _a.children, onClose = _a.onClose;
|
|
49
|
+
var _p = (0, react_1.useState)(false), isMobile = _p[0], setIsMobile = _p[1];
|
|
50
|
+
var _q = (0, react_1.useState)(open), internalOpen = _q[0], setInternalOpen = _q[1];
|
|
51
|
+
var _r = (0, react_1.useState)('0px'), appBarHeight = _r[0], setAppBarHeight = _r[1];
|
|
52
52
|
var pathname = (0, navigation_1.usePathname)();
|
|
53
53
|
var sidebarRef = (0, react_1.useRef)(null);
|
|
54
54
|
var updateIsMobile = (0, react_1.useCallback)(function () {
|
|
@@ -108,8 +108,8 @@ function SideBar(_a) {
|
|
|
108
108
|
react_1.default.createElement("section", { className: "sidebar-body mt-3" },
|
|
109
109
|
links.length > 0 && (react_1.default.createElement("nav", { className: "sidebar-links" }, Object.entries(groupedLinks).map(function (_a) {
|
|
110
110
|
var section = _a[0], sectionLinks = _a[1];
|
|
111
|
-
return (react_1.default.createElement("div", { key: section, className: "sidebar-section
|
|
112
|
-
react_1.default.createElement(Text_1.default, { size: "sm", funcss: "opacity-
|
|
111
|
+
return (react_1.default.createElement("div", { key: section, className: "sidebar-section ".concat(dividers ? "bt" : "", " pt-2 pb-2") },
|
|
112
|
+
react_1.default.createElement(Text_1.default, { size: "sm", funcss: "opacity-6 p-1 pl-2 pr-2" }, section),
|
|
113
113
|
sectionLinks.map(function (link) {
|
|
114
114
|
var isActive = pathname === link.uri;
|
|
115
115
|
return (react_1.default.createElement(link_1.default, { onClick: function () {
|
|
@@ -118,7 +118,7 @@ function SideBar(_a) {
|
|
|
118
118
|
}
|
|
119
119
|
}, key: link.uri, href: link.uri },
|
|
120
120
|
react_1.default.createElement("div", { className: "p-1 pl-2 pr-2 sidebar-link ".concat(isActive ? "primary50 outline-primary200 ".concat(activeCss || '') : 'hoverable') },
|
|
121
|
-
react_1.default.createElement("span", { style: { lineHeight: 0 } }, link.icon),
|
|
121
|
+
react_1.default.createElement("span", { className: "".concat(iconCSS || '', " ").concat(popIcon ? "p-1 border lighter central" : ""), style: { lineHeight: 0, borderRadius: "0.4rem" } }, link.icon),
|
|
122
122
|
react_1.default.createElement(Text_1.default, { text: link.text, size: "sm", weight: 400 }))));
|
|
123
123
|
})));
|
|
124
124
|
}))),
|
package/ui/sidebar/SideBar.tsx
CHANGED
|
@@ -30,7 +30,10 @@ interface SideBarProps {
|
|
|
30
30
|
sidebarWidth?: number;
|
|
31
31
|
sidebarCss?: string;
|
|
32
32
|
activeCss?: string;
|
|
33
|
+
iconCSS?: string;
|
|
33
34
|
bodyCss?: string;
|
|
35
|
+
popIcon?:boolean;
|
|
36
|
+
dividers?:boolean;
|
|
34
37
|
links?: SideBarLink[];
|
|
35
38
|
children?: ReactNode;
|
|
36
39
|
onClose?: () => void;
|
|
@@ -45,9 +48,12 @@ export default function SideBar({
|
|
|
45
48
|
footer,
|
|
46
49
|
top = 0,
|
|
47
50
|
sidebarWidth = 250,
|
|
51
|
+
iconCSS = '',
|
|
48
52
|
sidebarCss = '',
|
|
49
53
|
activeCss,
|
|
50
54
|
bodyCss = '',
|
|
55
|
+
popIcon = false,
|
|
56
|
+
dividers = false,
|
|
51
57
|
links = [],
|
|
52
58
|
children,
|
|
53
59
|
onClose,
|
|
@@ -147,8 +153,8 @@ export default function SideBar({
|
|
|
147
153
|
{links.length > 0 && (
|
|
148
154
|
<nav className="sidebar-links">
|
|
149
155
|
{Object.entries(groupedLinks).map(([section, sectionLinks]) => (
|
|
150
|
-
<div key={section} className=
|
|
151
|
-
<Text size="sm" funcss="opacity-
|
|
156
|
+
<div key={section} className={`sidebar-section ${dividers ? "bt" : ""} pt-2 pb-2`}>
|
|
157
|
+
<Text size="sm" funcss="opacity-6 p-1 pl-2 pr-2">{section}</Text>
|
|
152
158
|
{sectionLinks.map(link => {
|
|
153
159
|
const isActive = pathname === link.uri;
|
|
154
160
|
return (
|
|
@@ -160,7 +166,7 @@ export default function SideBar({
|
|
|
160
166
|
<div className={`p-1 pl-2 pr-2 sidebar-link ${
|
|
161
167
|
isActive ? `primary50 outline-primary200 ${activeCss || ''}` : 'hoverable'
|
|
162
168
|
}`}>
|
|
163
|
-
<span style={{ lineHeight: 0 }}>{link.icon}</span>
|
|
169
|
+
<span className={`${iconCSS || '' } ${popIcon ? `p-1 border lighter central` : ""}`} style={{ lineHeight: 0 , borderRadius:"0.4rem"}}>{link.icon}</span>
|
|
164
170
|
<Text text={link.text} size="sm" weight={400} />
|
|
165
171
|
</div>
|
|
166
172
|
</Link>
|