@xyo-network/react-appbar 2.37.17 → 2.37.19

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.
@@ -1 +1 @@
1
- {"version":3,"file":"CollapseToggle.d.ts","sourceRoot":"","sources":["../../../../src/components/CollapsibleDrawer/CollapseToggle.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAW,MAAM,uBAAuB,CAAA;AAK7D,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAoBrD,CAAA"}
1
+ {"version":3,"file":"CollapseToggle.d.ts","sourceRoot":"","sources":["../../../../src/components/CollapsibleDrawer/CollapseToggle.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAW,MAAM,uBAAuB,CAAA;AAM7D,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAuBrD,CAAA"}
@@ -1,16 +1,17 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { IconButton } from '@mui/material';
2
+ import { Icon, useTheme } from '@mui/material';
3
3
  import { FlexRow } from '@xylabs/react-flexbox';
4
+ import { useState } from 'react';
4
5
  import { VscArrowSmallLeft, VscArrowSmallRight } from 'react-icons/vsc';
5
6
  import { useCollapsible } from '../../contexts';
6
7
  export const CollapseToggleFlex = (props) => {
7
8
  const { collapse, setCollapse, setCollapseEnd } = useCollapsible();
9
+ const [hover, setHover] = useState(false);
10
+ const theme = useTheme();
8
11
  const handleCollapseToggle = () => {
9
12
  setCollapse?.(!collapse);
10
13
  setCollapseEnd?.((previous) => (previous ? false : previous));
11
14
  };
12
- return (_jsx(FlexRow, { mt: 2, py: 2, ...props, children: _jsx(IconButton, { onClick: handleCollapseToggle, sx: {
13
- flexDirection: 'column',
14
- }, children: !collapse ? _jsx(VscArrowSmallLeft, {}) : _jsx(VscArrowSmallRight, {}) }) }));
15
+ return (_jsx(FlexRow, { mt: 2, py: 2, ...props, children: _jsx(Icon, { onClick: handleCollapseToggle, onMouseEnter: () => setHover(true), onMouseLeave: () => setHover(false), fontSize: 'large', sx: { color: hover ? theme.palette.primary.main : 'initial', cursor: 'pointer' }, children: !collapse ? _jsx(VscArrowSmallLeft, {}) : _jsx(VscArrowSmallRight, {}) }) }));
15
16
  };
16
17
  //# sourceMappingURL=CollapseToggle.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CollapseToggle.js","sourceRoot":"","sources":["../../../../src/components/CollapsibleDrawer/CollapseToggle.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAgB,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAC7D,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAEvE,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAE/C,MAAM,CAAC,MAAM,kBAAkB,GAA2B,CAAC,KAAK,EAAE,EAAE;IAClE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,cAAc,EAAE,GAAG,cAAc,EAAE,CAAA;IAElE,MAAM,oBAAoB,GAAG,GAAG,EAAE;QAChC,WAAW,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAA;QACxB,cAAc,EAAE,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAA;IAC/D,CAAC,CAAA;IAED,OAAO,CACL,KAAC,OAAO,IAAC,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,KAAM,KAAK,YAC9B,KAAC,UAAU,IACT,OAAO,EAAE,oBAAoB,EAC7B,EAAE,EAAE;gBACF,aAAa,EAAE,QAAQ;aACxB,YAEA,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAC,iBAAiB,KAAG,CAAC,CAAC,CAAC,KAAC,kBAAkB,KAAG,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EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,YAE/E,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAC,iBAAiB,KAAG,CAAC,CAAC,CAAC,KAAC,kBAAkB,KAAG,GACtD,GACC,CACX,CAAA;AACH,CAAC,CAAA"}
@@ -5,6 +5,7 @@ export interface MenuSectionProps extends FlexBoxProps {
5
5
  title: string;
6
6
  listItems: MenuListItemProps[];
7
7
  showTitle?: boolean;
8
+ iconMenuTextSpacing?: string;
8
9
  }
9
10
  export declare const MenuSection: React.FC<MenuSectionProps>;
10
11
  //# sourceMappingURL=MenuSection.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"MenuSection.d.ts","sourceRoot":"","sources":["../../../../src/components/SiteMenu/MenuSection.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAW,MAAM,uBAAuB,CAAA;AAE7D,OAAO,EAAyB,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAEzE,MAAM,WAAW,gBAAiB,SAAQ,YAAY;IACpD,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,iBAAiB,EAAE,CAAA;IAC9B,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;AAED,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAYlD,CAAA"}
1
+ {"version":3,"file":"MenuSection.d.ts","sourceRoot":"","sources":["../../../../src/components/SiteMenu/MenuSection.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAW,MAAM,uBAAuB,CAAA;AAE7D,OAAO,EAAyB,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAEzE,MAAM,WAAW,gBAAiB,SAAQ,YAAY;IACpD,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,iBAAiB,EAAE,CAAA;IAC9B,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,mBAAmB,CAAC,EAAE,MAAM,CAAA;CAC7B;AAED,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAYlD,CAAA"}
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Collapse, ListSubheader } from '@mui/material';
3
3
  import { FlexCol } from '@xylabs/react-flexbox';
4
4
  import { MenuListItemContainer } from './MenuListItem';
5
- export const MenuSection = ({ title, listItems, showTitle = true, ...props }) => {
6
- return (_jsxs(FlexCol, { alignItems: "stretch", ...props, children: [_jsx(Collapse, { in: showTitle, timeout: 700, children: _jsx(ListSubheader, { children: title }) }), listItems.map((item, index) => (_jsx(MenuListItemContainer, { ...item }, index)))] }));
5
+ export const MenuSection = ({ title, listItems, iconMenuTextSpacing, showTitle = true, ...props }) => {
6
+ return (_jsxs(FlexCol, { alignItems: "stretch", ...props, children: [_jsx(Collapse, { in: showTitle, timeout: 700, children: _jsx(ListSubheader, { children: title }) }), listItems.map((item, index) => (_jsx(MenuListItemContainer, { iconMenuTextSpacing: iconMenuTextSpacing, ...item }, index)))] }));
7
7
  };
8
8
  //# sourceMappingURL=MenuSection.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MenuSection.js","sourceRoot":"","sources":["../../../../src/components/SiteMenu/MenuSection.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AACvD,OAAO,EAAgB,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAE7D,OAAO,EAAE,qBAAqB,EAAqB,MAAM,gBAAgB,CAAA;AAQzE,MAAM,CAAC,MAAM,WAAW,GAA+B,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,GAAG,IAAI,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IAC1G,OAAO,CACL,MAAC,OAAO,IAAC,UAAU,EAAC,SAAS,KAAK,KAAK,aACrC,KAAC,QAAQ,IAAC,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,YACnC,KAAC,aAAa,cAAE,KAAK,GAAiB,GAC7B,EAEV,SAAS,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CAC9B,KAAC,qBAAqB,OAAiB,IAAI,IAAf,KAAK,CAAoC,CACtE,CAAC,IACM,CACX,CAAA;AACH,CAAC,CAAA"}
1
+ {"version":3,"file":"MenuSection.js","sourceRoot":"","sources":["../../../../src/components/SiteMenu/MenuSection.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AACvD,OAAO,EAAgB,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAE7D,OAAO,EAAE,qBAAqB,EAAqB,MAAM,gBAAgB,CAAA;AASzE,MAAM,CAAC,MAAM,WAAW,GAA+B,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,mBAAmB,EAAE,SAAS,GAAG,IAAI,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IAC/H,OAAO,CACL,MAAC,OAAO,IAAC,UAAU,EAAC,SAAS,KAAK,KAAK,aACrC,KAAC,QAAQ,IAAC,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,YACnC,KAAC,aAAa,cAAE,KAAK,GAAiB,GAC7B,EAEV,SAAS,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CAC9B,KAAC,qBAAqB,IAAa,mBAAmB,EAAE,mBAAmB,KAAM,IAAI,IAAzD,KAAK,CAA8E,CAChH,CAAC,IACM,CACX,CAAA;AACH,CAAC,CAAA"}
package/package.json CHANGED
@@ -16,11 +16,11 @@
16
16
  "@xylabs/react-flexbox": "^2.15.1",
17
17
  "@xylabs/react-link": "^2.15.1",
18
18
  "@xylabs/react-shared": "^2.15.1",
19
- "@xyo-network/react-app-settings": "^2.37.17",
20
- "@xyo-network/react-archive": "^2.37.17",
21
- "@xyo-network/react-auth-sets": "^2.37.17",
22
- "@xyo-network/react-network": "^2.37.17",
23
- "@xyo-network/react-shared": "^2.37.17",
19
+ "@xyo-network/react-app-settings": "^2.37.19",
20
+ "@xyo-network/react-archive": "^2.37.19",
21
+ "@xyo-network/react-auth-sets": "^2.37.19",
22
+ "@xyo-network/react-network": "^2.37.19",
23
+ "@xyo-network/react-shared": "^2.37.19",
24
24
  "tslib": "^2.4.0"
25
25
  },
26
26
  "peerDependencies": {
@@ -77,5 +77,5 @@
77
77
  },
78
78
  "sideEffects": false,
79
79
  "types": "dist/esm/index.d.ts",
80
- "version": "2.37.17"
80
+ "version": "2.37.19"
81
81
  }
@@ -1,6 +1,6 @@
1
- import { useTheme } from '@mui/material'
1
+ import { Divider, useTheme } from '@mui/material'
2
2
  import { ComponentMeta, ComponentStory, DecoratorFn } from '@storybook/react'
3
- import { FlexGrowCol } from '@xylabs/react-flexbox'
3
+ import { FlexCol, FlexGrowCol, FlexRow } from '@xylabs/react-flexbox'
4
4
 
5
5
  import { CollapsibleProvider, useCollapsible } from '../../contexts'
6
6
  import { MenuSection } from '../SiteMenu'
@@ -32,16 +32,17 @@ const Template: ComponentStory<typeof CollapsibleDrawer> = (args) => {
32
32
  const { collapse, setCollapseEnd } = useCollapsible()
33
33
  const theme = useTheme()
34
34
  return (
35
- <>
36
- <FlexGrowCol alignItems="start">
35
+ <FlexRow justifyContent="start">
36
+ <FlexCol alignItems="start">
37
37
  <CollapsibleDrawer in={!collapse} orientation="horizontal" collapsedSize={theme.spacing(5)} onExited={() => setCollapseEnd?.(true)} {...args}>
38
38
  <MenuSection title="Explore & Create" listItems={menuDataTop} showTitle={!collapse} />
39
39
  <MenuSection title="Settings & Analytics" listItems={menuDataBottom} showTitle={!collapse} />
40
40
  <FlexGrowCol height="100%" />
41
41
  <CollapseToggleFlex justifyContent="start" />
42
42
  </CollapsibleDrawer>
43
- </FlexGrowCol>
44
- </>
43
+ </FlexCol>
44
+ <Divider flexItem orientation={'vertical'} />
45
+ </FlexRow>
45
46
  )
46
47
  }
47
48
 
@@ -1,11 +1,14 @@
1
- import { IconButton } from '@mui/material'
1
+ import { Icon, useTheme } from '@mui/material'
2
2
  import { FlexBoxProps, FlexRow } from '@xylabs/react-flexbox'
3
+ import { useState } from 'react'
3
4
  import { VscArrowSmallLeft, VscArrowSmallRight } from 'react-icons/vsc'
4
5
 
5
6
  import { useCollapsible } from '../../contexts'
6
7
 
7
8
  export const CollapseToggleFlex: React.FC<FlexBoxProps> = (props) => {
8
9
  const { collapse, setCollapse, setCollapseEnd } = useCollapsible()
10
+ const [hover, setHover] = useState(false)
11
+ const theme = useTheme()
9
12
 
10
13
  const handleCollapseToggle = () => {
11
14
  setCollapse?.(!collapse)
@@ -14,14 +17,15 @@ export const CollapseToggleFlex: React.FC<FlexBoxProps> = (props) => {
14
17
 
15
18
  return (
16
19
  <FlexRow mt={2} py={2} {...props}>
17
- <IconButton
20
+ <Icon
18
21
  onClick={handleCollapseToggle}
19
- sx={{
20
- flexDirection: 'column',
21
- }}
22
+ onMouseEnter={() => setHover(true)}
23
+ onMouseLeave={() => setHover(false)}
24
+ fontSize={'large'}
25
+ sx={{ color: hover ? theme.palette.primary.main : 'initial', cursor: 'pointer' }}
22
26
  >
23
27
  {!collapse ? <VscArrowSmallLeft /> : <VscArrowSmallRight />}
24
- </IconButton>
28
+ </Icon>
25
29
  </FlexRow>
26
30
  )
27
31
  }
@@ -7,9 +7,10 @@ export interface MenuSectionProps extends FlexBoxProps {
7
7
  title: string
8
8
  listItems: MenuListItemProps[]
9
9
  showTitle?: boolean
10
+ iconMenuTextSpacing?: string
10
11
  }
11
12
 
12
- export const MenuSection: React.FC<MenuSectionProps> = ({ title, listItems, showTitle = true, ...props }) => {
13
+ export const MenuSection: React.FC<MenuSectionProps> = ({ title, listItems, iconMenuTextSpacing, showTitle = true, ...props }) => {
13
14
  return (
14
15
  <FlexCol alignItems="stretch" {...props}>
15
16
  <Collapse in={showTitle} timeout={700}>
@@ -17,7 +18,7 @@ export const MenuSection: React.FC<MenuSectionProps> = ({ title, listItems, show
17
18
  </Collapse>
18
19
 
19
20
  {listItems.map((item, index) => (
20
- <MenuListItemContainer key={index} {...item}></MenuListItemContainer>
21
+ <MenuListItemContainer key={index} iconMenuTextSpacing={iconMenuTextSpacing} {...item}></MenuListItemContainer>
21
22
  ))}
22
23
  </FlexCol>
23
24
  )