@appquality/unguess-design-system 2.12.8 → 2.12.10

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,29 @@
1
+ # v2.12.10 (Tue Sep 20 2022)
2
+
3
+ #### ⚠️ Pushed to `master`
4
+
5
+ - Merge branch 'master' of github.com:AppQuality/unguess-design-system ([@cannarocks](https://github.com/cannarocks))
6
+ - fix(sidebar): move out prj accordion panel setting ([@cannarocks](https://github.com/cannarocks))
7
+
8
+ #### Authors: 1
9
+
10
+ - Luca Cannarozzo ([@cannarocks](https://github.com/cannarocks))
11
+
12
+ ---
13
+
14
+ # v2.12.9 (Tue Sep 20 2022)
15
+
16
+ #### ⚠️ Pushed to `master`
17
+
18
+ - Merge branch 'master' of github.com:AppQuality/unguess-design-system ([@cannarocks](https://github.com/cannarocks))
19
+ - add ref to accordion component ([@cannarocks](https://github.com/cannarocks))
20
+
21
+ #### Authors: 1
22
+
23
+ - Luca Cannarozzo ([@cannarocks](https://github.com/cannarocks))
24
+
25
+ ---
26
+
1
27
  # v2.12.8 (Tue Sep 20 2022)
2
28
 
3
29
  #### ⚠️ Pushed to `master`
package/build/index.js CHANGED
@@ -8,11 +8,11 @@ var reactTheming = require('@zendeskgarden/react-theming');
8
8
  var UAParser = require('ua-parser-js');
9
9
  var jsxRuntime = require('react/jsx-runtime');
10
10
  var reactAccordions = require('@zendeskgarden/react-accordions');
11
+ var React = require('react');
11
12
  var reactNotifications = require('@zendeskgarden/react-notifications');
12
13
  var reactAvatars = require('@zendeskgarden/react-avatars');
13
14
  var reactBreadcrumbs = require('@zendeskgarden/react-breadcrumbs');
14
15
  var reactButtons = require('@zendeskgarden/react-buttons');
15
- var React = require('react');
16
16
  var reactTags = require('@zendeskgarden/react-tags');
17
17
  var reactLoaders = require('@zendeskgarden/react-loaders');
18
18
  var reactTypography = require('@zendeskgarden/react-typography');
@@ -277,7 +277,8 @@ var templateObject_1$1i;
277
277
  - To organize related information into sections
278
278
  - To surface information through progressive disclosure
279
279
  */
280
- var Accordion = function (props) { return jsxRuntime.jsx(reactAccordions.Accordion, __assign({}, props)); };
280
+ var AccordionComponent = React.forwardRef(function (props, ref) { return (jsxRuntime.jsx(reactAccordions.Accordion, __assign({ ref: ref }, props))); });
281
+ var Accordion = AccordionComponent;
281
282
  Accordion.Section = reactAccordions.Accordion.Section;
282
283
  Accordion.Header = reactAccordions.Accordion.Header;
283
284
  Accordion.Label = reactAccordions.Accordion.Label;
@@ -2333,8 +2334,8 @@ var SidebarLabel = styled__default["default"](SM)(templateObject_4$9 || (templat
2333
2334
  - To give a consistent dashboard and navigation experience
2334
2335
  */
2335
2336
  var Sidebar = function (_a) {
2336
- var projects = _a.projects, props = __rest(_a, ["projects"]);
2337
- var _b = React.useState(props.currentRoute || "home"), nav = _b[0], setNav = _b[1];
2337
+ var projects = _a.projects, _b = _a.defaultAccordionPanels, defaultAccordionPanels = _b === void 0 ? [0] : _b, props = __rest(_a, ["projects", "defaultAccordionPanels"]);
2338
+ var _c = React.useState(props.currentRoute || "home"), nav = _c[0], setNav = _c[1];
2338
2339
  var showWorkspacesDropdown = window.matchMedia("only screen and (max-width: ".concat(theme.breakpoints.sm, ")")).matches;
2339
2340
  var toggleNav = function () {
2340
2341
  props.onToggleMenu && props.onToggleMenu();
@@ -2351,7 +2352,7 @@ var Sidebar = function (_a) {
2351
2352
  : {};
2352
2353
  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 &&
2353
2354
  props.workspaces &&
2354
- 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, expandedSections: [0], 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: {
2355
+ 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: {
2355
2356
  marginLeft: theme.space.xs,
2356
2357
  color: theme.palette.grey[800],
2357
2358
  } }, { 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,17 +1,9 @@
1
1
  /// <reference types="react" />
2
- import { AccordionArgs } from './_types';
3
- /**
4
- * Accordions are headers that can be expanded to reveal content or collapsed to hide it.
5
- * <hr>
6
- * Used for this:
7
- - To organize related information into sections
8
- - To surface information through progressive disclosure
9
- */
10
- declare const Accordion: {
11
- (props: AccordionArgs): JSX.Element;
12
- Section: import("react").ForwardRefExoticComponent<import("react").HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
13
- Header: import("react").ForwardRefExoticComponent<import("react").HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
14
- Label: import("react").ForwardRefExoticComponent<import("react").ButtonHTMLAttributes<HTMLButtonElement> & import("react").RefAttributes<HTMLButtonElement>>;
15
- Panel: import("react").ForwardRefExoticComponent<import("react").HTMLAttributes<HTMLElement> & import("react").RefAttributes<HTMLElement>>;
2
+ import { Accordion as ZendeskAccordion } from "@zendeskgarden/react-accordions";
3
+ import { AccordionArgs } from "./_types";
4
+ export declare const Accordion: import("react").ForwardRefExoticComponent<AccordionArgs & import("react").RefAttributes<HTMLDivElement>> & {
5
+ Section: typeof ZendeskAccordion.Section;
6
+ Header: typeof ZendeskAccordion.Header;
7
+ Label: typeof ZendeskAccordion.Label;
8
+ Panel: typeof ZendeskAccordion.Panel;
16
9
  };
17
- export { Accordion };
@@ -11,8 +11,7 @@ export declare const Default: Story<AccordionStoryArg>;
11
11
  export declare const Bare: Story<AccordionStoryArg>;
12
12
  export declare const Expandable: Story<AccordionStoryArg>;
13
13
  export declare const Compact: Story<AccordionStoryArg>;
14
- declare const _default: ComponentMeta<{
15
- (props: AccordionArgs): JSX.Element;
14
+ declare const _default: ComponentMeta<import("react").ForwardRefExoticComponent<AccordionArgs & import("react").RefAttributes<HTMLDivElement>> & {
16
15
  Section: import("react").ForwardRefExoticComponent<import("react").HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
17
16
  Header: import("react").ForwardRefExoticComponent<import("react").HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
18
17
  Label: import("react").ForwardRefExoticComponent<import("react").ButtonHTMLAttributes<HTMLButtonElement> & import("react").RefAttributes<HTMLButtonElement>>;
@@ -1,8 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { AccordionArgs } from "../../../accordions/_types";
3
3
  import { NavItemArgs } from "./_types";
4
- declare const AccordionItem: import("styled-components").StyledComponent<{
5
- (props: AccordionArgs): JSX.Element;
4
+ declare const AccordionItem: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<AccordionArgs & import("react").RefAttributes<HTMLDivElement>> & {
6
5
  Section: import("react").ForwardRefExoticComponent<import("react").HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
7
6
  Header: import("react").ForwardRefExoticComponent<import("react").HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
8
7
  Label: import("react").ForwardRefExoticComponent<import("react").ButtonHTMLAttributes<HTMLButtonElement> & import("react").RefAttributes<HTMLButtonElement>>;
@@ -24,4 +24,5 @@ export interface SidebarArgs extends NavArgs, WorkspaceDropdownArgs {
24
24
  onNavToggle?: (route: string, parameter?: string) => void;
25
25
  isLoading?: boolean;
26
26
  features?: Array<FeatureItem>;
27
+ defaultAccordionPanels?: Array<number>;
27
28
  }
@@ -5,5 +5,5 @@ import { SidebarArgs } from "./_types";
5
5
  * Used for this:
6
6
  - To give a consistent dashboard and navigation experience
7
7
  */
8
- declare const Sidebar: ({ projects, ...props }: SidebarArgs) => JSX.Element;
8
+ declare const Sidebar: ({ projects, defaultAccordionPanels, ...props }: SidebarArgs) => JSX.Element;
9
9
  export { Sidebar };
@@ -6,5 +6,5 @@ export declare const Default: Story<SidebarStoryArgs>;
6
6
  export declare const MultipleWorkspaces: Story<SidebarStoryArgs>;
7
7
  export declare const WithTokens: Story<SidebarStoryArgs>;
8
8
  export declare const WithAll: Story<SidebarStoryArgs>;
9
- declare const _default: ComponentMeta<({ projects, ...props }: SidebarArgs) => JSX.Element>;
9
+ declare const _default: ComponentMeta<({ projects, defaultAccordionPanels, ...props }: SidebarArgs) => JSX.Element>;
10
10
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appquality/unguess-design-system",
3
- "version": "2.12.8",
3
+ "version": "2.12.10",
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",