@xyo-network/react-appbar 3.0.1 → 3.0.3
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 +11 -0
- package/dist/browser/components/AppBar/Application.d.ts.map +1 -0
- package/dist/browser/components/AppBar/index.d.ts +2 -0
- package/dist/browser/components/AppBar/index.d.ts.map +1 -0
- package/dist/browser/components/CollapsibleDrawer/CollapseToggle.d.ts +4 -0
- package/dist/browser/components/CollapsibleDrawer/CollapseToggle.d.ts.map +1 -0
- package/dist/browser/components/CollapsibleDrawer/CollapsibleDrawer.d.ts +5 -0
- package/dist/browser/components/CollapsibleDrawer/CollapsibleDrawer.d.ts.map +1 -0
- package/dist/browser/components/CollapsibleDrawer/index.d.ts +3 -0
- package/dist/browser/components/CollapsibleDrawer/index.d.ts.map +1 -0
- package/dist/browser/components/CollapsibleDrawer/storyExampleMenuData.d.ts +4 -0
- package/dist/browser/components/CollapsibleDrawer/storyExampleMenuData.d.ts.map +1 -0
- package/dist/browser/components/MobileSystemControls/SystemControls.d.ts +5 -0
- package/dist/browser/components/MobileSystemControls/SystemControls.d.ts.map +1 -0
- package/dist/browser/components/MobileSystemControls/SystemControlsRoot.d.ts +4 -0
- package/dist/browser/components/MobileSystemControls/SystemControlsRoot.d.ts.map +1 -0
- package/dist/browser/components/MobileSystemControls/SystemControlsType.d.ts +6 -0
- package/dist/browser/components/MobileSystemControls/SystemControlsType.d.ts.map +1 -0
- package/dist/browser/components/MobileSystemControls/SystemControlsUnstyled.d.ts +11 -0
- package/dist/browser/components/MobileSystemControls/SystemControlsUnstyled.d.ts.map +1 -0
- package/dist/browser/components/MobileSystemControls/controls/SystemControl.d.ts +11 -0
- package/dist/browser/components/MobileSystemControls/controls/SystemControl.d.ts.map +1 -0
- package/dist/browser/components/MobileSystemControls/controls/SystemControlText.d.ts +8 -0
- package/dist/browser/components/MobileSystemControls/controls/SystemControlText.d.ts.map +1 -0
- package/dist/browser/components/MobileSystemControls/controls/index.d.ts +3 -0
- package/dist/browser/components/MobileSystemControls/controls/index.d.ts.map +1 -0
- package/dist/browser/components/MobileSystemControls/index.d.ts +4 -0
- package/dist/browser/components/MobileSystemControls/index.d.ts.map +1 -0
- package/dist/browser/components/SearchBar/SearchBar.d.ts +7 -0
- package/dist/browser/components/SearchBar/SearchBar.d.ts.map +1 -0
- package/dist/browser/components/SearchBar/index.d.ts +2 -0
- package/dist/browser/components/SearchBar/index.d.ts.map +1 -0
- package/dist/browser/components/SiteMenu/Menu.d.ts +9 -0
- package/dist/browser/components/SiteMenu/Menu.d.ts.map +1 -0
- package/dist/browser/components/SiteMenu/MenuListItem/MenuListItemContainer.d.ts +11 -0
- package/dist/browser/components/SiteMenu/MenuListItem/MenuListItemContainer.d.ts.map +1 -0
- package/dist/browser/components/SiteMenu/MenuListItem/index.d.ts +2 -0
- package/dist/browser/components/SiteMenu/MenuListItem/index.d.ts.map +1 -0
- package/dist/browser/components/SiteMenu/MenuListItem/list-item-components/ListItemTooltip.d.ts +7 -0
- package/dist/browser/components/SiteMenu/MenuListItem/list-item-components/ListItemTooltip.d.ts.map +1 -0
- package/dist/browser/components/SiteMenu/MenuListItem/list-item-components/MenuIcon.d.ts +8 -0
- package/dist/browser/components/SiteMenu/MenuListItem/list-item-components/MenuIcon.d.ts.map +1 -0
- package/dist/browser/components/SiteMenu/MenuListItem/list-item-components/MenuListItem.d.ts +7 -0
- package/dist/browser/components/SiteMenu/MenuListItem/list-item-components/MenuListItem.d.ts.map +1 -0
- package/dist/browser/components/SiteMenu/MenuListItem/list-item-components/index.d.ts +4 -0
- package/dist/browser/components/SiteMenu/MenuListItem/list-item-components/index.d.ts.map +1 -0
- package/dist/browser/components/SiteMenu/MenuListItem/sub-nav/SubNavListItemCollapse.d.ts +11 -0
- package/dist/browser/components/SiteMenu/MenuListItem/sub-nav/SubNavListItemCollapse.d.ts.map +1 -0
- package/dist/browser/components/SiteMenu/MenuListItem/sub-nav/SubNavToggleIconButton.d.ts +9 -0
- package/dist/browser/components/SiteMenu/MenuListItem/sub-nav/SubNavToggleIconButton.d.ts.map +1 -0
- package/dist/browser/components/SiteMenu/MenuListItem/sub-nav/index.d.ts +3 -0
- package/dist/browser/components/SiteMenu/MenuListItem/sub-nav/index.d.ts.map +1 -0
- package/dist/browser/components/SiteMenu/MenuSection.d.ts +11 -0
- package/dist/browser/components/SiteMenu/MenuSection.d.ts.map +1 -0
- package/dist/browser/components/SiteMenu/hooks/index.d.ts +2 -0
- package/dist/browser/components/SiteMenu/hooks/index.d.ts.map +1 -0
- package/dist/browser/components/SiteMenu/hooks/useMenuItemsShared.d.ts +7 -0
- package/dist/browser/components/SiteMenu/hooks/useMenuItemsShared.d.ts.map +1 -0
- package/dist/browser/components/SiteMenu/index.d.ts +6 -0
- package/dist/browser/components/SiteMenu/index.d.ts.map +1 -0
- package/dist/browser/components/SiteMenu/lib/MenuListItemBase.d.ts +5 -0
- package/dist/browser/components/SiteMenu/lib/MenuListItemBase.d.ts.map +1 -0
- package/dist/browser/components/SiteMenu/lib/NavListItemProps.d.ts +12 -0
- package/dist/browser/components/SiteMenu/lib/NavListItemProps.d.ts.map +1 -0
- package/dist/browser/components/SiteMenu/lib/index.d.ts +3 -0
- package/dist/browser/components/SiteMenu/lib/index.d.ts.map +1 -0
- package/dist/browser/components/Toolbar/Context/ContextToolbar.d.ts +9 -0
- package/dist/browser/components/Toolbar/Context/ContextToolbar.d.ts.map +1 -0
- package/dist/browser/components/Toolbar/Context/Logo.d.ts +3 -0
- package/dist/browser/components/Toolbar/Context/Logo.d.ts.map +1 -0
- package/dist/browser/components/Toolbar/Context/LogoLinkEx.d.ts +7 -0
- package/dist/browser/components/Toolbar/Context/LogoLinkEx.d.ts.map +1 -0
- package/dist/browser/components/Toolbar/Context/index.d.ts +2 -0
- package/dist/browser/components/Toolbar/Context/index.d.ts.map +1 -0
- package/dist/browser/components/Toolbar/System/SystemToolbar.d.ts +16 -0
- package/dist/browser/components/Toolbar/System/SystemToolbar.d.ts.map +1 -0
- package/dist/browser/components/Toolbar/System/index.d.ts +2 -0
- package/dist/browser/components/Toolbar/System/index.d.ts.map +1 -0
- package/dist/browser/components/Toolbar/index.d.ts +3 -0
- package/dist/browser/components/Toolbar/index.d.ts.map +1 -0
- package/dist/browser/components/index.d.ts +7 -0
- package/dist/browser/components/index.d.ts.map +1 -0
- package/dist/browser/contexts/Collapsible/State.d.ts +9 -0
- package/dist/browser/contexts/Collapsible/State.d.ts.map +1 -0
- package/dist/browser/contexts/Collapsible/context.d.ts +3 -0
- package/dist/browser/contexts/Collapsible/context.d.ts.map +1 -0
- package/dist/browser/contexts/Collapsible/index.d.ts +4 -0
- package/dist/browser/contexts/Collapsible/index.d.ts.map +1 -0
- package/dist/browser/contexts/Collapsible/provider.d.ts +8 -0
- package/dist/browser/contexts/Collapsible/provider.d.ts.map +1 -0
- package/dist/browser/contexts/Collapsible/use.d.ts +2 -0
- package/dist/browser/contexts/Collapsible/use.d.ts.map +1 -0
- package/dist/browser/contexts/index.d.ts +2 -0
- package/dist/browser/contexts/index.d.ts.map +1 -0
- package/dist/browser/index.d.ts +3 -116
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/browser/index.mjs +5 -15
- package/dist/browser/index.mjs.map +1 -1
- package/package.json +59 -53
- package/src/components/AppBar/Application.stories.tsx +8 -8
- package/src/components/AppBar/Application.tsx +8 -4
- package/src/components/CollapsibleDrawer/CollapseDrawer.stories.tsx +8 -10
- package/src/components/CollapsibleDrawer/CollapseToggle.tsx +5 -2
- package/src/components/CollapsibleDrawer/CollapsibleDrawer.tsx +8 -3
- package/src/components/CollapsibleDrawer/storyExampleMenuData.tsx +10 -4
- package/src/components/MobileSystemControls/SystemControls.stories.tsx +2 -6
- package/src/components/MobileSystemControls/SystemControls.tsx +1 -1
- package/src/components/MobileSystemControls/SystemControlsRoot.tsx +4 -7
- package/src/components/MobileSystemControls/SystemControlsUnstyled.tsx +4 -2
- package/src/components/MobileSystemControls/controls/SystemControl.tsx +5 -3
- package/src/components/MobileSystemControls/controls/SystemControlText.tsx +2 -1
- package/src/components/SearchBar/SearchBar.tsx +24 -5
- package/src/components/SiteMenu/Menu.tsx +8 -3
- package/src/components/SiteMenu/MenuListItem/MenuListItemContainer.stories.tsx +7 -8
- package/src/components/SiteMenu/MenuListItem/MenuListItemContainer.tsx +6 -3
- package/src/components/SiteMenu/MenuListItem/list-item-components/ListItemTooltip.tsx +2 -1
- package/src/components/SiteMenu/MenuListItem/list-item-components/MenuIcon.tsx +4 -2
- package/src/components/SiteMenu/MenuListItem/list-item-components/MenuListItem.tsx +17 -5
- package/src/components/SiteMenu/MenuListItem/sub-nav/SubNavListItemCollapse.tsx +7 -4
- package/src/components/SiteMenu/MenuListItem/sub-nav/SubNavToggleIconButton.tsx +6 -2
- package/src/components/SiteMenu/MenuSection.tsx +7 -3
- package/src/components/SiteMenu/hooks/useMenuItemsShared.tsx +5 -5
- package/src/components/SiteMenu/lib/NavListItemProps.ts +3 -3
- package/src/components/Toolbar/Context/ContextToolbar.stories.tsx +2 -6
- package/src/components/Toolbar/Context/ContextToolbar.tsx +6 -3
- package/src/components/Toolbar/Context/LogoLinkEx.tsx +5 -2
- package/src/components/Toolbar/System/SystemToolbar.stories.tsx +7 -8
- package/src/components/Toolbar/System/SystemToolbar.tsx +8 -4
- package/src/contexts/Collapsible/State.ts +2 -2
- package/src/contexts/Collapsible/context.ts +1 -1
- package/src/contexts/Collapsible/provider.tsx +11 -14
- package/xy.config.ts +2 -4
@@ -1,5 +1,5 @@
|
|
1
|
-
import { WithChildren } from '@xylabs/react-shared'
|
2
|
-
import React, {
|
1
|
+
import type { WithChildren } from '@xylabs/react-shared'
|
2
|
+
import React, { useState } from 'react'
|
3
3
|
|
4
4
|
import { CollapsibleContext } from './context.ts'
|
5
5
|
|
@@ -8,21 +8,18 @@ export interface CollapsibleProviderProps extends WithChildren {
|
|
8
8
|
defaultCollapseEnd?: boolean
|
9
9
|
}
|
10
10
|
|
11
|
-
export const CollapsibleProvider: React.FC<CollapsibleProviderProps> = ({
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
setCollapse(defaultCollapse)
|
17
|
-
}, [defaultCollapse])
|
18
|
-
|
19
|
-
useEffect(() => {
|
20
|
-
setCollapseEnd(defaultCollapseEnd)
|
21
|
-
}, [defaultCollapseEnd])
|
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)
|
22
16
|
|
23
17
|
return (
|
24
18
|
// eslint-disable-next-line @eslint-react/no-unstable-context-value
|
25
|
-
<CollapsibleContext.Provider value={{
|
19
|
+
<CollapsibleContext.Provider value={{
|
20
|
+
collapse, collapseEnd, provided: true, setCollapse, setCollapseEnd,
|
21
|
+
}}
|
22
|
+
>
|
26
23
|
{children}
|
27
24
|
</CollapsibleContext.Provider>
|
28
25
|
)
|
package/xy.config.ts
CHANGED