@appquality/unguess-design-system 2.12.11 → 2.12.12
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/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
# v2.12.12 (Tue Sep 27 2022)
|
|
2
|
+
|
|
3
|
+
#### ⚠️ Pushed to `master`
|
|
4
|
+
|
|
5
|
+
- feat(sidebar): add projectAccordion scroll ([@cannarocks](https://github.com/cannarocks))
|
|
6
|
+
|
|
7
|
+
#### Authors: 1
|
|
8
|
+
|
|
9
|
+
- Luca Cannarozzo ([@cannarocks](https://github.com/cannarocks))
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
1
13
|
# v2.12.11 (Wed Sep 21 2022)
|
|
2
14
|
|
|
3
15
|
#### ⚠️ Pushed to `master`
|
package/build/index.js
CHANGED
|
@@ -2031,10 +2031,7 @@ var UgNavItem$2 = styled__default["default"](reactChrome.NavItem)(templateObject
|
|
|
2031
2031
|
var theme = _a.theme;
|
|
2032
2032
|
return theme.space.xs;
|
|
2033
2033
|
});
|
|
2034
|
-
var NavItem = function (props) {
|
|
2035
|
-
// const { isExpanded } = props;
|
|
2036
|
-
return jsxRuntime.jsx(UgNavItem$2, __assign({}, props));
|
|
2037
|
-
};
|
|
2034
|
+
var NavItem = React.forwardRef(function (props, ref) { return jsxRuntime.jsx(UgNavItem$2, __assign({ ref: ref }, props)); });
|
|
2038
2035
|
var templateObject_1$w, templateObject_2$h;
|
|
2039
2036
|
|
|
2040
2037
|
var UgNavIcon = styled__default["default"](reactChrome.NavItemIcon)(templateObject_1$v || (templateObject_1$v = __makeTemplateObject([""], [""])));
|
|
@@ -2113,7 +2110,8 @@ var UgNavItem = styled__default["default"](NavItem)(templateObject_2$g || (templ
|
|
|
2113
2110
|
var theme = _a.theme;
|
|
2114
2111
|
return theme.space.xxl;
|
|
2115
2112
|
});
|
|
2116
|
-
var
|
|
2113
|
+
var NavItemComponent = React.forwardRef(function (props, ref) { return jsxRuntime.jsx(UgNavItem, __assign({ ref: ref }, props)); });
|
|
2114
|
+
var NavItemProject = NavItemComponent;
|
|
2117
2115
|
NavItemProject.Title = NavItemText;
|
|
2118
2116
|
NavItemProject.SubTitle = UgProjectSubtitle;
|
|
2119
2117
|
var templateObject_1$s, templateObject_2$g;
|
|
@@ -2342,6 +2340,7 @@ var SidebarLabel = styled__default["default"](SM)(templateObject_4$9 || (templat
|
|
|
2342
2340
|
var Sidebar = function (_a) {
|
|
2343
2341
|
var projects = _a.projects, _b = _a.defaultAccordionPanels, defaultAccordionPanels = _b === void 0 ? [0] : _b, props = __rest(_a, ["projects", "defaultAccordionPanels"]);
|
|
2344
2342
|
var _c = React.useState(props.currentRoute || "home"), nav = _c[0], setNav = _c[1];
|
|
2343
|
+
var prjRef = React.useRef(null);
|
|
2345
2344
|
var showWorkspacesDropdown = window.matchMedia("only screen and (max-width: ".concat(theme.breakpoints.sm, ")")).matches;
|
|
2346
2345
|
var toggleNav = function () {
|
|
2347
2346
|
props.onToggleMenu && props.onToggleMenu();
|
|
@@ -2356,9 +2355,18 @@ var Sidebar = function (_a) {
|
|
|
2356
2355
|
paddingBottom: 0,
|
|
2357
2356
|
}
|
|
2358
2357
|
: {};
|
|
2358
|
+
React.useEffect(function () {
|
|
2359
|
+
var _a;
|
|
2360
|
+
if (prjRef && prjRef.current && props.isExpanded) {
|
|
2361
|
+
(_a = prjRef.current) === null || _a === void 0 ? void 0 : _a.scrollIntoView({
|
|
2362
|
+
behavior: "auto",
|
|
2363
|
+
block: "end"
|
|
2364
|
+
});
|
|
2365
|
+
}
|
|
2366
|
+
}, [props.isExpanded]);
|
|
2359
2367
|
return props.isLoading ? (jsxRuntime.jsx(LoadingSidebar, __assign({}, props))) : (jsxRuntime.jsxs(Nav, __assign({}, props, { children: [jsxRuntime.jsxs(ScrollingContainer, { children: [jsxRuntime.jsx(NavToggle, { onClick: toggleNav, isExpanded: props.isExpanded }), showWorkspacesDropdown &&
|
|
2360
2368
|
props.workspaces &&
|
|
2361
|
-
props.workspaces.length > 1 && (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx(StyledNavItem, __assign({ title: "Workspaces", hasLogo: true, isExpanded: props.isExpanded, style: padding }, { children: jsxRuntime.jsx(WorkspacesDropdown, { workspaces: props.workspaces, workspacesLabel: props.workspacesLabel, activeWorkspace: props.activeWorkspace, onWorkspaceChange: props.onWorkspaceChange, isCompact: true }) })) })), props.tokens && (jsxRuntime.jsx(SidebarLabel, __assign({ isExpanded: props.isExpanded }, { children: props.activityLabel || "My activity" }))), jsxRuntime.jsxs(NavItem, __assign({ className: "sidebar-first-level-item", title: "Home", isExpanded: props.isExpanded, isCurrent: nav === "home", onClick: function () { return navigate("home"); } }, { children: [jsxRuntime.jsx(NavItemIcon, __assign({ isStyled: true }, { children: nav === "home" ? jsxRuntime.jsx(SvgHomeFillStyled, {}) : jsxRuntime.jsx(SvgHomeFill, {}) })), jsxRuntime.jsx(NavItemText, { children: props.homeItemLabel || "My Campaigns" })] })), projects && projects.length ? (jsxRuntime.jsx(AccordionItem, __assign({ className: "sidebar-project-accordion-first-item", level: 4, defaultExpandedSections: defaultAccordionPanels, isExpanded: props.isExpanded }, { children: jsxRuntime.jsxs(AccordionItem.Section, { children: [jsxRuntime.jsx(AccordionItem.Header, { children: jsxRuntime.jsxs(AccordionItem.Label, { children: [props.dividerLabel || "", " ", jsxRuntime.jsx(SvgFolderIcon, { style: { marginLeft: theme.space.xs } })] }) }), jsxRuntime.jsx(AccordionItem.Panel, { children: projects.map(function (project) { return (jsxRuntime.jsxs(NavItemProject, __assign({ className: "sidebar-project-item", isExpanded: props.isExpanded, isCurrent: nav === "projects/".concat(project.id), onClick: function () { return navigate("projects", project.id); } }, { children: [jsxRuntime.jsx(NavItemProject.Title, { title: project.title, children: project.title }), jsxRuntime.jsx(NavItemProject.SubTitle, { children: project.campaigns })] }), project.id)); }) })] }) }))) : null, jsxRuntime.jsx(NavDivider, { isExpanded: props.isExpanded }), jsxRuntime.jsxs(NavItem, __assign({ className: "sidebar-first-level-item", title: "Services", isExpanded: props.isExpanded, isCurrent: nav === "services", onClick: function () { return navigate("services"); }, style: { marginBottom: "16px" } }, { children: [jsxRuntime.jsx(NavItemIcon, __assign({ isStyled: true }, { children: nav === "services" ? jsxRuntime.jsx(SvgTemplatesActive, {}) : jsxRuntime.jsx(SvgTemplates, {}) })), jsxRuntime.jsx(NavItemText, { children: props.servicesItemLabel || "Services" })] })), props.tokens && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(SidebarLabel, __assign({ isExpanded: props.isExpanded }, { children: props.walletLabel || "Wallet" })), jsxRuntime.jsx(StyledNavItem, __assign({ title: "Tokens", isExpanded: props.isExpanded, style: { pointerEvents: "none", paddingTop: 0 } }, { children: jsxRuntime.jsx(Card, __assign({ style: { padding: theme.space.sm } }, { children: jsxRuntime.jsxs(TokenContainer, { children: [jsxRuntime.jsx(SvgToken, { width: 32 }), jsxRuntime.jsx(Span, __assign({ isBold: true, style: {
|
|
2369
|
+
props.workspaces.length > 1 && (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx(StyledNavItem, __assign({ title: "Workspaces", hasLogo: true, isExpanded: props.isExpanded, style: padding }, { children: jsxRuntime.jsx(WorkspacesDropdown, { workspaces: props.workspaces, workspacesLabel: props.workspacesLabel, activeWorkspace: props.activeWorkspace, onWorkspaceChange: props.onWorkspaceChange, isCompact: true }) })) })), props.tokens && (jsxRuntime.jsx(SidebarLabel, __assign({ isExpanded: props.isExpanded }, { children: props.activityLabel || "My activity" }))), jsxRuntime.jsxs(NavItem, __assign({ className: "sidebar-first-level-item", title: "Home", isExpanded: props.isExpanded, isCurrent: nav === "home", onClick: function () { return navigate("home"); } }, { children: [jsxRuntime.jsx(NavItemIcon, __assign({ isStyled: true }, { children: nav === "home" ? jsxRuntime.jsx(SvgHomeFillStyled, {}) : jsxRuntime.jsx(SvgHomeFill, {}) })), jsxRuntime.jsx(NavItemText, { children: props.homeItemLabel || "My Campaigns" })] })), projects && projects.length ? (jsxRuntime.jsx(AccordionItem, __assign({ className: "sidebar-project-accordion-first-item", level: 4, defaultExpandedSections: defaultAccordionPanels, isExpanded: props.isExpanded }, { children: jsxRuntime.jsxs(AccordionItem.Section, { children: [jsxRuntime.jsx(AccordionItem.Header, { children: jsxRuntime.jsxs(AccordionItem.Label, { children: [props.dividerLabel || "", " ", jsxRuntime.jsx(SvgFolderIcon, { style: { marginLeft: theme.space.xs } })] }) }), jsxRuntime.jsx(AccordionItem.Panel, { children: projects.map(function (project, index) { return (jsxRuntime.jsxs(NavItemProject, __assign({ className: "sidebar-project-item", isExpanded: props.isExpanded, isCurrent: nav === "projects/".concat(project.id) }, (nav === "projects/".concat(project.id) && { ref: prjRef }), { onClick: function () { return navigate("projects", project.id); } }, (index === projects.length - 1 && { style: { marginBottom: 61 } }), { children: [jsxRuntime.jsx(NavItemProject.Title, { title: project.title, children: project.title }), jsxRuntime.jsx(NavItemProject.SubTitle, { children: project.campaigns })] }), project.id)); }) })] }) }))) : null, jsxRuntime.jsx(NavDivider, { isExpanded: props.isExpanded }), jsxRuntime.jsxs(NavItem, __assign({ className: "sidebar-first-level-item", title: "Services", isExpanded: props.isExpanded, isCurrent: nav === "services", onClick: function () { return navigate("services"); }, style: { marginBottom: "16px" } }, { children: [jsxRuntime.jsx(NavItemIcon, __assign({ isStyled: true }, { children: nav === "services" ? jsxRuntime.jsx(SvgTemplatesActive, {}) : jsxRuntime.jsx(SvgTemplates, {}) })), jsxRuntime.jsx(NavItemText, { children: props.servicesItemLabel || "Services" })] })), props.tokens && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(SidebarLabel, __assign({ isExpanded: props.isExpanded }, { children: props.walletLabel || "Wallet" })), jsxRuntime.jsx(StyledNavItem, __assign({ title: "Tokens", isExpanded: props.isExpanded, style: { pointerEvents: "none", paddingTop: 0 } }, { children: jsxRuntime.jsx(Card, __assign({ style: { padding: theme.space.sm } }, { children: jsxRuntime.jsxs(TokenContainer, { children: [jsxRuntime.jsx(SvgToken, { width: 32 }), jsxRuntime.jsx(Span, __assign({ isBold: true, style: {
|
|
2362
2370
|
marginLeft: theme.space.xs,
|
|
2363
2371
|
color: theme.palette.grey[800],
|
|
2364
2372
|
} }, { children: props.tokens + " " + (props.tokensLabel || "tokens") }))] }) })) }))] }))] }), jsxRuntime.jsxs(NavItem, __assign({ isExpanded: props.isExpanded, hasBrandmark: true, title: "Be smart from the start", style: { pointerEvents: "none", paddingBottom: theme.space.md } }, { children: [jsxRuntime.jsx(NavItemIcon, { children: jsxRuntime.jsx(Logo, { type: "icon", size: 150 }) }), jsxRuntime.jsx(NavItemText, { children: "UNGUESS" })] }))] })));
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { NavItemArgs } from "./_types";
|
|
2
|
-
declare const NavItem: (
|
|
3
|
+
declare const NavItem: import("react").ForwardRefExoticComponent<NavItemArgs & import("react").RefAttributes<HTMLButtonElement>>;
|
|
3
4
|
export { NavItem };
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { NavItemArgs } from "./_types";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import { NavItemText } from "./navItemText";
|
|
4
|
+
declare const UgProjectSubtitle: import("styled-components").StyledComponent<(props: import("./_types").NavItemTextArgs) => JSX.Element, any, NavItemArgs, never>;
|
|
5
|
+
declare const NavItemProject: import("react").ForwardRefExoticComponent<NavItemArgs & import("react").RefAttributes<HTMLButtonElement>> & {
|
|
6
|
+
Title: typeof NavItemText;
|
|
7
|
+
SubTitle: typeof UgProjectSubtitle;
|
|
6
8
|
};
|
|
7
9
|
export { NavItemProject };
|
|
@@ -3,6 +3,7 @@ import { SidebarArgs } from "./_types";
|
|
|
3
3
|
interface SidebarStoryArgs extends SidebarArgs {
|
|
4
4
|
}
|
|
5
5
|
export declare const Default: Story<SidebarStoryArgs>;
|
|
6
|
+
export declare const SingleProject: Story<SidebarStoryArgs>;
|
|
6
7
|
export declare const MultipleWorkspaces: Story<SidebarStoryArgs>;
|
|
7
8
|
export declare const WithTokens: Story<SidebarStoryArgs>;
|
|
8
9
|
export declare const WithAll: Story<SidebarStoryArgs>;
|