@smartbooks-ai/layout 0.0.7 → 0.0.8

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.
@@ -2,7 +2,6 @@ import { AvailableCompany } from '@smartbooks-ai/api-client';
2
2
  import { UserProfile } from '../../../security/UserProfile';
3
3
  type Props = {
4
4
  companyCode?: string;
5
- tenantCode?: string;
6
5
  isExpanded: boolean;
7
6
  profile: UserProfile | null;
8
7
  onCompanyClicked: (company: AvailableCompany) => Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/PageWithMenuLayout/AppSelect/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAI7D,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAI5D,KAAK,KAAK,GAAG;IACX,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,OAAO,EAAE,WAAW,GAAG,IAAI,CAAC;IAC5B,gBAAgB,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAChE,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CA+CrC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/PageWithMenuLayout/AppSelect/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAI7D,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAI5D,KAAK,KAAK,GAAG;IACX,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,OAAO,CAAC;IACpB,OAAO,EAAE,WAAW,GAAG,IAAI,CAAC;IAC5B,gBAAgB,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAChE,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CA8CrC,CAAC"}
@@ -3,11 +3,11 @@ import { useMemo } from 'react';
3
3
  import * as Styled from './styles';
4
4
  import { MenuSelect } from '../MenuSelect';
5
5
  import { MultiSubscriptionsMenuItems } from '../MultiSubscriptionsMenuItems';
6
- export const AppSelect = ({ companyCode, isExpanded, tenantCode, profile, onCompanyClicked }) => {
6
+ export const AppSelect = ({ companyCode, isExpanded, profile, onCompanyClicked }) => {
7
7
  const tenants = profile?.allowedTenants;
8
8
  const tenantsWithCompanies = useMemo(() => tenants?.filter(({ companies }) => companies.length > 0) ?? [], [tenants]);
9
9
  const currentCompany = companyCode ? profile?.allowedCompanies.find(({ code }) => code === companyCode) : undefined;
10
- const tenant = tenants?.find((t) => currentCompany ? t.companies.some(({ code }) => code === currentCompany.code) : t.code === tenantCode);
10
+ const tenant = tenants?.find((t) => currentCompany ? t.companies.some(({ code }) => code === currentCompany.code) : undefined);
11
11
  const onCompanySelected = (closeMenu) => (company) => {
12
12
  closeMenu();
13
13
  onCompanyClicked(company);
@@ -6,7 +6,6 @@ export type PageWithMenuLayoutProps = {
6
6
  topMenu?: MenuStructure;
7
7
  bottomMenu: MenuStructure;
8
8
  profile: UserProfile | null;
9
- tenantCode?: string;
10
9
  switchToCompany: (company: AvailableCompany) => Promise<void>;
11
10
  logout: () => void;
12
11
  additionalOutletContent?: React.ReactNode;
@@ -1 +1 @@
1
- {"version":3,"file":"PageWithMenuLayout.d.ts","sourceRoot":"","sources":["../../../src/components/PageWithMenuLayout/PageWithMenuLayout.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAQ7D,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAGxC,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAEzD,MAAM,MAAM,uBAAuB,GAAG;IACpC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,UAAU,EAAE,aAAa,CAAC;IAC1B,OAAO,EAAE,WAAW,GAAG,IAAI,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9D,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,uBAAuB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3C,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CA2EhE,CAAC"}
1
+ {"version":3,"file":"PageWithMenuLayout.d.ts","sourceRoot":"","sources":["../../../src/components/PageWithMenuLayout/PageWithMenuLayout.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAQ7D,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAGxC,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAEzD,MAAM,MAAM,uBAAuB,GAAG;IACpC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,UAAU,EAAE,aAAa,CAAC;IAC1B,OAAO,EAAE,WAAW,GAAG,IAAI,CAAC;IAC5B,eAAe,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9D,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,uBAAuB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3C,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CAyEhE,CAAC"}
@@ -9,7 +9,7 @@ import LogoHeaderText from './LogoHeaderText';
9
9
  import { AppSelect, MenuItemWithChildren, UserProfileSelect } from './index';
10
10
  import * as Styled from './styles';
11
11
  import { useMenuToggle } from './useMenuToggle';
12
- export const PageWithMenuLayout = ({ resolvedCompanyCode, topMenu, bottomMenu, profile, tenantCode, switchToCompany, logout, additionalOutletContent, }) => {
12
+ export const PageWithMenuLayout = ({ resolvedCompanyCode, topMenu, bottomMenu, profile, switchToCompany, logout, additionalOutletContent, }) => {
13
13
  const { isExpanded, openMenu, toggleIsExpanded } = useMenuToggle();
14
- return (_jsxs(_Fragment, { children: [_jsx(Styled.LockMenuButton, { onClick: toggleIsExpanded, isExpanded: isExpanded, children: _jsx(KeyboardArrowLeftIcon, { fontSize: "inherit" }) }), createPortal(_jsxs(Styled.Drawer, { open: isExpanded, variant: "permanent", children: [_jsxs(Styled.Header, { children: [_jsx(Styled.LogoContainer, { children: _jsx(NavLink, { to: "/", children: _jsx(LogoHeaderImage, { height: 24 }) }) }), _jsx(Fade, { in: isExpanded, children: _jsx(NavLink, { to: "/", children: _jsx(LogoHeaderText, { height: 12 }) }) })] }), _jsx(AppSelect, { tenantCode: tenantCode, companyCode: resolvedCompanyCode, isExpanded: isExpanded, profile: profile, onCompanyClicked: switchToCompany }), _jsx(Styled.TopMenuList, { children: topMenu?.map((firstLevelItem) => (_jsx(MenuItemWithChildren, { menuItem: firstLevelItem, isMenuOpen: isExpanded, openMenu: openMenu }, firstLevelItem.title))) }), _jsx(MenuList, { disablePadding: true, children: bottomMenu?.map((firstLevelItem) => (_jsx(MenuItemWithChildren, { menuItem: firstLevelItem, isMenuOpen: isExpanded, openMenu: openMenu }, firstLevelItem.title))) }), _jsx(UserProfileSelect, { isTextVisible: isExpanded, profile: profile, logout: logout })] }), document.body), _jsxs(Styled.Main, { isLocked: isExpanded, children: [_jsx(Outlet, {}), additionalOutletContent] })] }));
14
+ return (_jsxs(_Fragment, { children: [_jsx(Styled.LockMenuButton, { onClick: toggleIsExpanded, isExpanded: isExpanded, children: _jsx(KeyboardArrowLeftIcon, { fontSize: "inherit" }) }), createPortal(_jsxs(Styled.Drawer, { open: isExpanded, variant: "permanent", children: [_jsxs(Styled.Header, { children: [_jsx(Styled.LogoContainer, { children: _jsx(NavLink, { to: "/", children: _jsx(LogoHeaderImage, { height: 24 }) }) }), _jsx(Fade, { in: isExpanded, children: _jsx(NavLink, { to: "/", children: _jsx(LogoHeaderText, { height: 12 }) }) })] }), _jsx(AppSelect, { companyCode: resolvedCompanyCode, isExpanded: isExpanded, profile: profile, onCompanyClicked: switchToCompany }), _jsx(Styled.TopMenuList, { children: topMenu?.map((firstLevelItem) => (_jsx(MenuItemWithChildren, { menuItem: firstLevelItem, isMenuOpen: isExpanded, openMenu: openMenu }, firstLevelItem.title))) }), _jsx(MenuList, { disablePadding: true, children: bottomMenu?.map((firstLevelItem) => (_jsx(MenuItemWithChildren, { menuItem: firstLevelItem, isMenuOpen: isExpanded, openMenu: openMenu }, firstLevelItem.title))) }), _jsx(UserProfileSelect, { isTextVisible: isExpanded, profile: profile, logout: logout })] }), document.body), _jsxs(Styled.Main, { isLocked: isExpanded, children: [_jsx(Outlet, {}), additionalOutletContent] })] }));
15
15
  };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- import './emotion.d.ts';
2
1
  export * from './components';
3
2
  export * from './hooks';
4
3
  export * from './security';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,CAAC;AAExB,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
package/dist/index.js CHANGED
@@ -1,4 +1,3 @@
1
- import './emotion.d.ts';
2
1
  export * from './components';
3
2
  export * from './hooks';
4
3
  export * from './security';
@@ -1,3 +1,3 @@
1
- import { ColorPrimitives } from '../emotion';
1
+ import { ColorPrimitives } from './emotion';
2
2
  export declare const colorPrimitives: ColorPrimitives;
3
3
  //# sourceMappingURL=colorPrimitives.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"colorPrimitives.d.ts","sourceRoot":"","sources":["../../src/theme/colorPrimitives.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,eAAO,MAAM,eAAe,EAAE,eAwG7B,CAAC"}
1
+ {"version":3,"file":"colorPrimitives.d.ts","sourceRoot":"","sources":["../../src/theme/colorPrimitives.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,eAAO,MAAM,eAAe,EAAE,eAwG7B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/theme/index.tsx"],"names":[],"mappings":"AAqNA,wBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,CAAC,iBAAiB,oDAc3D"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/theme/index.tsx"],"names":[],"mappings":"AAoNA,wBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,CAAC,iBAAiB,oDAc3D"}
@@ -1 +1 @@
1
- {"version":3,"file":"typography.d.ts","sourceRoot":"","sources":["../../src/theme/typography.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,yBAAyB,EAAE,MAAM,eAAe,CAAC;AAgB3E,QAAA,MAAM,UAAU,EAAE,yBAqBjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"typography.d.ts","sourceRoot":"","sources":["../../src/theme/typography.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,yBAAyB,EAAE,MAAM,eAAe,CAAC;AAe3E,QAAA,MAAM,UAAU,EAAE,yBAqBjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "author": "smartbooks",
3
3
  "dependencies": {
4
- "@smartbooks-ai/api-client": "0.0.7",
4
+ "@smartbooks-ai/api-client": "0.0.8",
5
5
  "use-resize-observer": "^9.1.0"
6
6
  },
7
7
  "devDependencies": {
@@ -51,5 +51,5 @@
51
51
  },
52
52
  "type": "module",
53
53
  "types": "./dist/index.d.ts",
54
- "version": "0.0.7"
54
+ "version": "0.0.8"
55
55
  }