@xyo-network/react-appbar 4.1.9 → 4.1.11
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/browser/components/AppBar/Application.d.ts +3 -3
- package/dist/browser/components/AppBar/Application.d.ts.map +1 -1
- package/dist/browser/components/CollapsibleDrawer/CollapseToggle.d.ts.map +1 -1
- package/dist/browser/components/CollapsibleDrawer/CollapsibleDrawer.d.ts.map +1 -1
- package/dist/browser/components/CollapsibleDrawer/storyExampleMenuData.d.ts +1 -1
- package/dist/browser/components/CollapsibleDrawer/storyExampleMenuData.d.ts.map +1 -1
- package/dist/browser/components/Toolbar/Context/ContextToolbar.d.ts +5 -6
- package/dist/browser/components/Toolbar/Context/ContextToolbar.d.ts.map +1 -1
- package/dist/browser/components/Toolbar/Context/LogoLinkEx.d.ts +1 -0
- package/dist/browser/components/Toolbar/Context/LogoLinkEx.d.ts.map +1 -1
- package/dist/browser/components/Toolbar/System/SystemToolbar.d.ts +3 -4
- package/dist/browser/components/Toolbar/System/SystemToolbar.d.ts.map +1 -1
- package/dist/browser/components/index.d.ts +0 -1
- package/dist/browser/components/index.d.ts.map +1 -1
- package/dist/browser/index.d.ts +0 -1
- package/dist/browser/index.d.ts.map +1 -1
- package/dist/browser/index.mjs +70 -349
- package/dist/browser/index.mjs.map +1 -1
- package/package.json +9 -10
- package/src/components/AppBar/Application.stories.tsx +11 -11
- package/src/components/AppBar/Application.tsx +8 -8
- package/src/components/CollapsibleDrawer/CollapseDrawer.stories.tsx +2 -2
- package/src/components/CollapsibleDrawer/CollapseToggle.tsx +1 -2
- package/src/components/CollapsibleDrawer/CollapsibleDrawer.tsx +1 -2
- package/src/components/CollapsibleDrawer/storyExampleMenuData.tsx +1 -2
- package/src/components/Toolbar/Context/ContextToolbar.stories.tsx +6 -6
- package/src/components/Toolbar/Context/ContextToolbar.tsx +8 -8
- package/src/components/Toolbar/Context/LogoLinkEx.tsx +4 -3
- package/src/components/Toolbar/System/SystemToolbar.stories.tsx +8 -9
- package/src/components/Toolbar/System/SystemToolbar.tsx +8 -19
- package/src/components/index.ts +0 -1
- package/src/index.ts +0 -1
- package/dist/browser/components/SiteMenu/Menu.d.ts +0 -9
- package/dist/browser/components/SiteMenu/Menu.d.ts.map +0 -1
- package/dist/browser/components/SiteMenu/MenuListItem/MenuListItemContainer.d.ts +0 -11
- package/dist/browser/components/SiteMenu/MenuListItem/MenuListItemContainer.d.ts.map +0 -1
- package/dist/browser/components/SiteMenu/MenuListItem/index.d.ts +0 -2
- package/dist/browser/components/SiteMenu/MenuListItem/index.d.ts.map +0 -1
- package/dist/browser/components/SiteMenu/MenuListItem/list-item-components/ListItemTooltip.d.ts +0 -7
- package/dist/browser/components/SiteMenu/MenuListItem/list-item-components/ListItemTooltip.d.ts.map +0 -1
- package/dist/browser/components/SiteMenu/MenuListItem/list-item-components/MenuIcon.d.ts +0 -8
- package/dist/browser/components/SiteMenu/MenuListItem/list-item-components/MenuIcon.d.ts.map +0 -1
- package/dist/browser/components/SiteMenu/MenuListItem/list-item-components/MenuListItem.d.ts +0 -7
- package/dist/browser/components/SiteMenu/MenuListItem/list-item-components/MenuListItem.d.ts.map +0 -1
- package/dist/browser/components/SiteMenu/MenuListItem/list-item-components/index.d.ts +0 -4
- package/dist/browser/components/SiteMenu/MenuListItem/list-item-components/index.d.ts.map +0 -1
- package/dist/browser/components/SiteMenu/MenuListItem/sub-nav/SubNavListItemCollapse.d.ts +0 -11
- package/dist/browser/components/SiteMenu/MenuListItem/sub-nav/SubNavListItemCollapse.d.ts.map +0 -1
- package/dist/browser/components/SiteMenu/MenuListItem/sub-nav/SubNavToggleIconButton.d.ts +0 -9
- package/dist/browser/components/SiteMenu/MenuListItem/sub-nav/SubNavToggleIconButton.d.ts.map +0 -1
- package/dist/browser/components/SiteMenu/MenuListItem/sub-nav/index.d.ts +0 -3
- package/dist/browser/components/SiteMenu/MenuListItem/sub-nav/index.d.ts.map +0 -1
- package/dist/browser/components/SiteMenu/MenuSection.d.ts +0 -11
- package/dist/browser/components/SiteMenu/MenuSection.d.ts.map +0 -1
- package/dist/browser/components/SiteMenu/hooks/index.d.ts +0 -2
- package/dist/browser/components/SiteMenu/hooks/index.d.ts.map +0 -1
- package/dist/browser/components/SiteMenu/hooks/useMenuItemsShared.d.ts +0 -7
- package/dist/browser/components/SiteMenu/hooks/useMenuItemsShared.d.ts.map +0 -1
- package/dist/browser/components/SiteMenu/index.d.ts +0 -6
- package/dist/browser/components/SiteMenu/index.d.ts.map +0 -1
- package/dist/browser/components/SiteMenu/lib/MenuListItemBase.d.ts +0 -5
- package/dist/browser/components/SiteMenu/lib/MenuListItemBase.d.ts.map +0 -1
- package/dist/browser/components/SiteMenu/lib/NavListItemProps.d.ts +0 -12
- package/dist/browser/components/SiteMenu/lib/NavListItemProps.d.ts.map +0 -1
- package/dist/browser/components/SiteMenu/lib/index.d.ts +0 -3
- package/dist/browser/components/SiteMenu/lib/index.d.ts.map +0 -1
- package/dist/browser/contexts/Collapsible/State.d.ts +0 -9
- package/dist/browser/contexts/Collapsible/State.d.ts.map +0 -1
- package/dist/browser/contexts/Collapsible/context.d.ts +0 -3
- package/dist/browser/contexts/Collapsible/context.d.ts.map +0 -1
- package/dist/browser/contexts/Collapsible/index.d.ts +0 -4
- package/dist/browser/contexts/Collapsible/index.d.ts.map +0 -1
- package/dist/browser/contexts/Collapsible/provider.d.ts +0 -8
- package/dist/browser/contexts/Collapsible/provider.d.ts.map +0 -1
- package/dist/browser/contexts/Collapsible/use.d.ts +0 -2
- package/dist/browser/contexts/Collapsible/use.d.ts.map +0 -1
- package/dist/browser/contexts/index.d.ts +0 -2
- package/dist/browser/contexts/index.d.ts.map +0 -1
- package/src/components/SiteMenu/Menu.tsx +0 -53
- package/src/components/SiteMenu/MenuListItem/MenuListItemContainer.stories.tsx +0 -54
- package/src/components/SiteMenu/MenuListItem/MenuListItemContainer.tsx +0 -87
- package/src/components/SiteMenu/MenuListItem/index.ts +0 -1
- package/src/components/SiteMenu/MenuListItem/list-item-components/ListItemTooltip.tsx +0 -23
- package/src/components/SiteMenu/MenuListItem/list-item-components/MenuIcon.tsx +0 -16
- package/src/components/SiteMenu/MenuListItem/list-item-components/MenuListItem.tsx +0 -31
- package/src/components/SiteMenu/MenuListItem/list-item-components/index.ts +0 -3
- package/src/components/SiteMenu/MenuListItem/sub-nav/SubNavListItemCollapse.tsx +0 -22
- package/src/components/SiteMenu/MenuListItem/sub-nav/SubNavToggleIconButton.tsx +0 -27
- package/src/components/SiteMenu/MenuListItem/sub-nav/index.ts +0 -2
- package/src/components/SiteMenu/MenuSection.tsx +0 -30
- package/src/components/SiteMenu/hooks/index.ts +0 -1
- package/src/components/SiteMenu/hooks/useMenuItemsShared.tsx +0 -29
- package/src/components/SiteMenu/index.ts +0 -5
- package/src/components/SiteMenu/lib/MenuListItemBase.tsx +0 -4
- package/src/components/SiteMenu/lib/NavListItemProps.ts +0 -12
- package/src/components/SiteMenu/lib/index.ts +0 -2
- package/src/contexts/Collapsible/State.ts +0 -9
- package/src/contexts/Collapsible/context.ts +0 -5
- package/src/contexts/Collapsible/index.ts +0 -3
- package/src/contexts/Collapsible/provider.tsx +0 -26
- package/src/contexts/Collapsible/use.ts +0 -5
- package/src/contexts/index.ts +0 -1
@@ -1,29 +0,0 @@
|
|
1
|
-
import { useMemo } from 'react'
|
2
|
-
|
3
|
-
import { useCollapsible } from '../../../contexts/index.ts'
|
4
|
-
import type { MenuListItemProps } from '../MenuListItem/index.ts'
|
5
|
-
|
6
|
-
export type DefaultSiteMenuListItemProps = Pick<MenuListItemProps, 'collapseEnd' | 'dense' | 'iconOnly' | 'sx'>
|
7
|
-
|
8
|
-
export const useMenuItemsShared = () => {
|
9
|
-
const {
|
10
|
-
collapse, collapseEnd, setCollapse, setCollapseEnd,
|
11
|
-
} = useCollapsible()
|
12
|
-
|
13
|
-
const onMenuItemToggle = (open?: boolean) => {
|
14
|
-
setCollapse?.(previous => (open ? false : previous))
|
15
|
-
setCollapseEnd?.(previous => (open ? false : previous))
|
16
|
-
}
|
17
|
-
|
18
|
-
const defaultSiteMenuListItemProps: DefaultSiteMenuListItemProps = useMemo(
|
19
|
-
() => ({
|
20
|
-
collapseEnd,
|
21
|
-
dense: true,
|
22
|
-
iconOnly: collapse,
|
23
|
-
sx: { px: '8px' },
|
24
|
-
}),
|
25
|
-
[collapse, collapseEnd],
|
26
|
-
)
|
27
|
-
|
28
|
-
return { defaultSiteMenuListItemProps, onMenuItemToggle }
|
29
|
-
}
|
@@ -1,12 +0,0 @@
|
|
1
|
-
import type { ListItemProps, ListItemTextProps } from '@mui/material'
|
2
|
-
import type { ReactNode } from 'react'
|
3
|
-
import type { To } from 'react-router-dom'
|
4
|
-
|
5
|
-
export interface NavListItemProps {
|
6
|
-
href?: string
|
7
|
-
icon?: ReactNode
|
8
|
-
onButtonClick?: ListItemProps['onClick']
|
9
|
-
primary: ListItemTextProps['primary']
|
10
|
-
to?: To
|
11
|
-
tooltip?: string
|
12
|
-
}
|
@@ -1,9 +0,0 @@
|
|
1
|
-
import type { ContextExState } from '@xyo-network/react-shared'
|
2
|
-
import type { Dispatch, SetStateAction } from 'react'
|
3
|
-
|
4
|
-
export interface CollapsibleState extends ContextExState {
|
5
|
-
collapse?: boolean
|
6
|
-
collapseEnd?: boolean
|
7
|
-
setCollapse?: Dispatch<SetStateAction<boolean>>
|
8
|
-
setCollapseEnd?: Dispatch<SetStateAction<boolean>>
|
9
|
-
}
|
@@ -1,26 +0,0 @@
|
|
1
|
-
import type { PropsWithChildren } from 'react'
|
2
|
-
import React, { useState } from 'react'
|
3
|
-
|
4
|
-
import { CollapsibleContext } from './context.ts'
|
5
|
-
|
6
|
-
export interface CollapsibleProviderProps extends PropsWithChildren {
|
7
|
-
defaultCollapse?: boolean
|
8
|
-
defaultCollapseEnd?: boolean
|
9
|
-
}
|
10
|
-
|
11
|
-
export const CollapsibleProvider: React.FC<CollapsibleProviderProps> = ({
|
12
|
-
defaultCollapse = false, defaultCollapseEnd = false, children,
|
13
|
-
}) => {
|
14
|
-
const [collapse, setCollapse] = useState(() => defaultCollapse)
|
15
|
-
const [collapseEnd, setCollapseEnd] = useState(() => defaultCollapseEnd)
|
16
|
-
|
17
|
-
return (
|
18
|
-
// eslint-disable-next-line @eslint-react/no-unstable-context-value
|
19
|
-
<CollapsibleContext.Provider value={{
|
20
|
-
collapse, collapseEnd, provided: true, setCollapse, setCollapseEnd,
|
21
|
-
}}
|
22
|
-
>
|
23
|
-
{children}
|
24
|
-
</CollapsibleContext.Provider>
|
25
|
-
)
|
26
|
-
}
|
package/src/contexts/index.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export * from './Collapsible/index.ts'
|