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.
@@ -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.sidebarCss, sidebarCss = _h === void 0 ? '' : _h, activeCss = _a.activeCss, _j = _a.bodyCss, bodyCss = _j === void 0 ? '' : _j, _k = _a.links, links = _k === void 0 ? [] : _k, children = _a.children, onClose = _a.onClose;
49
- var _l = (0, react_1.useState)(false), isMobile = _l[0], setIsMobile = _l[1];
50
- var _m = (0, react_1.useState)(open), internalOpen = _m[0], setInternalOpen = _m[1];
51
- var _o = (0, react_1.useState)('0px'), appBarHeight = _o[0], setAppBarHeight = _o[1];
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 mb-2 bt pt-2 pb-2" },
112
- react_1.default.createElement(Text_1.default, { size: "sm", funcss: "opacity-5 p-1 pl-2 pr-2" }, section),
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
  }))),
@@ -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="sidebar-section mb-2 bt pt-2 pb-2">
151
- <Text size="sm" funcss="opacity-5 p-1 pl-2 pr-2">{section}</Text>
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>