@appquality/unguess-design-system 2.12.7 → 2.12.9

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.9 (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
+ - add ref to accordion component ([@cannarocks](https://github.com/cannarocks))
7
+
8
+ #### Authors: 1
9
+
10
+ - Luca Cannarozzo ([@cannarocks](https://github.com/cannarocks))
11
+
12
+ ---
13
+
14
+ # v2.12.8 (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
+ - minor fix ([@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.7 (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;
@@ -2335,7 +2336,6 @@ var SidebarLabel = styled__default["default"](SM)(templateObject_4$9 || (templat
2335
2336
  var Sidebar = function (_a) {
2336
2337
  var projects = _a.projects, props = __rest(_a, ["projects"]);
2337
2338
  var _b = React.useState(props.currentRoute || "home"), nav = _b[0], setNav = _b[1];
2338
- var _c = React.useState([]), accordionPanels = _c[0], setAccordionPanels = _c[1];
2339
2339
  var showWorkspacesDropdown = window.matchMedia("only screen and (max-width: ".concat(theme.breakpoints.sm, ")")).matches;
2340
2340
  var toggleNav = function () {
2341
2341
  props.onToggleMenu && props.onToggleMenu();
@@ -2350,13 +2350,9 @@ var Sidebar = function (_a) {
2350
2350
  paddingBottom: 0,
2351
2351
  }
2352
2352
  : {};
2353
- React.useEffect(function () {
2354
- if (projects === null || projects === void 0 ? void 0 : projects.length)
2355
- setAccordionPanels([0]);
2356
- }, [projects]);
2357
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 &&
2358
2354
  props.workspaces &&
2359
- 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: accordionPanels, 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, 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: {
2360
2356
  marginLeft: theme.space.xs,
2361
2357
  color: theme.palette.grey[800],
2362
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>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appquality/unguess-design-system",
3
- "version": "2.12.7",
3
+ "version": "2.12.9",
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",