@appquality/unguess-design-system 2.12.11 → 2.12.13

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.
@@ -0,0 +1,74 @@
1
+ # For most projects, this workflow file will not need changing; you simply need
2
+ # to commit it to your repository.
3
+ #
4
+ # You may wish to alter this file to override the set of languages analyzed,
5
+ # or to provide custom queries or build logic.
6
+ #
7
+ # ******** NOTE ********
8
+ # We have attempted to detect the languages in your repository. Please check
9
+ # the `language` matrix defined below to confirm you have the correct set of
10
+ # supported CodeQL languages.
11
+ #
12
+ name: "CodeQL"
13
+
14
+ on:
15
+ push:
16
+ branches: [ "master" ]
17
+ pull_request:
18
+ # The branches below must be a subset of the branches above
19
+ branches: [ "master" ]
20
+ schedule:
21
+ - cron: '40 13 * * 1'
22
+
23
+ jobs:
24
+ analyze:
25
+ name: Analyze
26
+ runs-on: ubuntu-latest
27
+ permissions:
28
+ actions: read
29
+ contents: read
30
+ security-events: write
31
+
32
+ strategy:
33
+ fail-fast: false
34
+ matrix:
35
+ language: [ 'javascript' ]
36
+ # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
37
+ # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
38
+
39
+ steps:
40
+ - name: Checkout repository
41
+ uses: actions/checkout@v3
42
+
43
+ # Initializes the CodeQL tools for scanning.
44
+ - name: Initialize CodeQL
45
+ uses: github/codeql-action/init@v2
46
+ with:
47
+ languages: ${{ matrix.language }}
48
+ # If you wish to specify custom queries, you can do so here or in a config file.
49
+ # By default, queries listed here will override any specified in a config file.
50
+ # Prefix the list here with "+" to use these queries and those in the config file.
51
+
52
+ # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
53
+ # queries: security-extended,security-and-quality
54
+
55
+
56
+ # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
57
+ # If this step fails, then you should remove it and run the build manually (see below)
58
+ - name: Autobuild
59
+ uses: github/codeql-action/autobuild@v2
60
+
61
+ # ℹ️ Command-line programs to run using the OS shell.
62
+ # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
63
+
64
+ # If the Autobuild fails above, remove it and uncomment the following three lines.
65
+ # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
66
+
67
+ # - run: |
68
+ # echo "Run, Build Application using script"
69
+ # ./location_of_script_within_repo/buildscript.sh
70
+
71
+ - name: Perform CodeQL Analysis
72
+ uses: github/codeql-action/analyze@v2
73
+ with:
74
+ category: "/language:${{matrix.language}}"
package/CHANGELOG.md CHANGED
@@ -1,3 +1,27 @@
1
+ # v2.12.13 (Wed Sep 28 2022)
2
+
3
+ #### ⚠️ Pushed to `master`
4
+
5
+ - Create codeql-analysis.yml ([@cannarocks](https://github.com/cannarocks))
6
+
7
+ #### Authors: 1
8
+
9
+ - Luca Cannarozzo ([@cannarocks](https://github.com/cannarocks))
10
+
11
+ ---
12
+
13
+ # v2.12.12 (Tue Sep 27 2022)
14
+
15
+ #### ⚠️ Pushed to `master`
16
+
17
+ - feat(sidebar): add projectAccordion scroll ([@cannarocks](https://github.com/cannarocks))
18
+
19
+ #### Authors: 1
20
+
21
+ - Luca Cannarozzo ([@cannarocks](https://github.com/cannarocks))
22
+
23
+ ---
24
+
1
25
  # v2.12.11 (Wed Sep 21 2022)
2
26
 
3
27
  #### ⚠️ 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 NavItemProject = function (props) { return jsxRuntime.jsx(UgNavItem, __assign({}, props)); };
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: (props: NavItemArgs) => JSX.Element;
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
- declare const NavItemProject: {
3
- (props: NavItemArgs): JSX.Element;
4
- Title: (props: import("./_types").NavItemTextArgs) => JSX.Element;
5
- SubTitle: import("styled-components").StyledComponent<(props: import("./_types").NavItemTextArgs) => JSX.Element, any, NavItemArgs, never>;
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>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appquality/unguess-design-system",
3
- "version": "2.12.11",
3
+ "version": "2.12.13",
4
4
  "dependencies": {
5
5
  "@tiptap/extension-bubble-menu": "^2.0.0-beta.61",
6
6
  "@tiptap/extension-character-count": "^2.0.0-beta.31",