@chayns-components/navigation 5.0.65 → 5.1.1
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/lib/cjs/components/navigation-layout/NavigationLayout.constants.js +14 -0
- package/lib/cjs/components/navigation-layout/NavigationLayout.constants.js.map +1 -0
- package/lib/cjs/components/navigation-layout/NavigationLayout.context.js +26 -0
- package/lib/cjs/components/navigation-layout/NavigationLayout.context.js.map +1 -0
- package/lib/cjs/components/navigation-layout/NavigationLayout.js +105 -0
- package/lib/cjs/components/navigation-layout/NavigationLayout.js.map +1 -0
- package/lib/cjs/components/navigation-layout/NavigationLayout.styles.js +74 -0
- package/lib/cjs/components/navigation-layout/NavigationLayout.styles.js.map +1 -0
- package/lib/cjs/components/navigation-layout/NavigationLayout.types.js +6 -0
- package/lib/cjs/components/navigation-layout/NavigationLayout.types.js.map +1 -0
- package/lib/cjs/components/navigation-layout/NavigationLayout.utils.js +261 -0
- package/lib/cjs/components/navigation-layout/NavigationLayout.utils.js.map +1 -0
- package/lib/cjs/components/navigation-layout/navigation-header/NavigationHeader.js +31 -0
- package/lib/cjs/components/navigation-layout/navigation-header/NavigationHeader.js.map +1 -0
- package/lib/cjs/components/navigation-layout/navigation-header/NavigationHeader.styles.js +30 -0
- package/lib/cjs/components/navigation-layout/navigation-header/NavigationHeader.styles.js.map +1 -0
- package/lib/cjs/components/navigation-layout/navigation-header/NavigationHeader.types.js +6 -0
- package/lib/cjs/components/navigation-layout/navigation-header/NavigationHeader.types.js.map +1 -0
- package/lib/cjs/components/navigation-layout/navigation-header/menu-toggle/MenuToggle.js +71 -0
- package/lib/cjs/components/navigation-layout/navigation-header/menu-toggle/MenuToggle.js.map +1 -0
- package/lib/cjs/components/navigation-layout/navigation-header/menu-toggle/MenuToggle.styles.js +19 -0
- package/lib/cjs/components/navigation-layout/navigation-header/menu-toggle/MenuToggle.styles.js.map +1 -0
- package/lib/cjs/components/navigation-layout/navigation-sidebar/NavigationSidebar.context.js +26 -0
- package/lib/cjs/components/navigation-layout/navigation-sidebar/NavigationSidebar.context.js.map +1 -0
- package/lib/cjs/components/navigation-layout/navigation-sidebar/NavigationSidebar.js +140 -0
- package/lib/cjs/components/navigation-layout/navigation-sidebar/NavigationSidebar.js.map +1 -0
- package/lib/cjs/components/navigation-layout/navigation-sidebar/NavigationSidebar.styles.js +89 -0
- package/lib/cjs/components/navigation-layout/navigation-sidebar/NavigationSidebar.styles.js.map +1 -0
- package/lib/cjs/components/navigation-layout/navigation-sidebar/NavigationSidebar.types.js +6 -0
- package/lib/cjs/components/navigation-layout/navigation-sidebar/NavigationSidebar.types.js.map +1 -0
- package/lib/cjs/components/navigation-layout/navigation-sidebar/NavigationSidebar.utils.js +83 -0
- package/lib/cjs/components/navigation-layout/navigation-sidebar/NavigationSidebar.utils.js.map +1 -0
- package/lib/cjs/components/navigation-layout/navigation-sidebar/sidebar-divider/SidebarDivider.js +17 -0
- package/lib/cjs/components/navigation-layout/navigation-sidebar/sidebar-divider/SidebarDivider.js.map +1 -0
- package/lib/cjs/components/navigation-layout/navigation-sidebar/sidebar-divider/SidebarDivider.styles.js +19 -0
- package/lib/cjs/components/navigation-layout/navigation-sidebar/sidebar-divider/SidebarDivider.styles.js.map +1 -0
- package/lib/cjs/components/navigation-layout/navigation-sidebar/sidebar-group/SidebarGroup.context.js +26 -0
- package/lib/cjs/components/navigation-layout/navigation-sidebar/sidebar-group/SidebarGroup.context.js.map +1 -0
- package/lib/cjs/components/navigation-layout/navigation-sidebar/sidebar-group/SidebarGroup.hooks.js +129 -0
- package/lib/cjs/components/navigation-layout/navigation-sidebar/sidebar-group/SidebarGroup.hooks.js.map +1 -0
- package/lib/cjs/components/navigation-layout/navigation-sidebar/sidebar-group/SidebarGroup.js +79 -0
- package/lib/cjs/components/navigation-layout/navigation-sidebar/sidebar-group/SidebarGroup.js.map +1 -0
- package/lib/cjs/components/navigation-layout/navigation-sidebar/sidebar-group/SidebarGroup.styles.js +69 -0
- package/lib/cjs/components/navigation-layout/navigation-sidebar/sidebar-group/SidebarGroup.styles.js.map +1 -0
- package/lib/cjs/components/navigation-layout/navigation-sidebar/sidebar-group/sidebar-item/SidebarItem.hooks.js +265 -0
- package/lib/cjs/components/navigation-layout/navigation-sidebar/sidebar-group/sidebar-item/SidebarItem.hooks.js.map +1 -0
- package/lib/cjs/components/navigation-layout/navigation-sidebar/sidebar-group/sidebar-item/SidebarItem.js +193 -0
- package/lib/cjs/components/navigation-layout/navigation-sidebar/sidebar-group/sidebar-item/SidebarItem.js.map +1 -0
- package/lib/cjs/components/navigation-layout/navigation-sidebar/sidebar-group/sidebar-item/SidebarItem.styles.js +132 -0
- package/lib/cjs/components/navigation-layout/navigation-sidebar/sidebar-group/sidebar-item/SidebarItem.styles.js.map +1 -0
- package/lib/cjs/components/navigation-layout/navigation-sidebar/sidebar-group/sidebar-item/SidebarItem.utils.js +78 -0
- package/lib/cjs/components/navigation-layout/navigation-sidebar/sidebar-group/sidebar-item/SidebarItem.utils.js.map +1 -0
- package/lib/cjs/components/split-layout/SplitLayout.js +90 -0
- package/lib/cjs/components/split-layout/SplitLayout.js.map +1 -0
- package/lib/cjs/components/split-layout/SplitLayout.styles.js +44 -0
- package/lib/cjs/components/split-layout/SplitLayout.styles.js.map +1 -0
- package/lib/cjs/components/split-layout/SplitLayout.types.js +12 -0
- package/lib/cjs/components/split-layout/SplitLayout.types.js.map +1 -0
- package/lib/cjs/components/split-layout/SplitLayout.utils.js +25 -0
- package/lib/cjs/components/split-layout/SplitLayout.utils.js.map +1 -0
- package/lib/cjs/components/split-layout/resize-handle/ResizeHandle.hooks.js +63 -0
- package/lib/cjs/components/split-layout/resize-handle/ResizeHandle.hooks.js.map +1 -0
- package/lib/cjs/components/split-layout/resize-handle/ResizeHandle.js +34 -0
- package/lib/cjs/components/split-layout/resize-handle/ResizeHandle.js.map +1 -0
- package/lib/cjs/components/split-layout/resize-handle/ResizeHandle.styles.js +58 -0
- package/lib/cjs/components/split-layout/resize-handle/ResizeHandle.styles.js.map +1 -0
- package/lib/cjs/components/user-image/UserImage.js +38 -0
- package/lib/cjs/components/user-image/UserImage.js.map +1 -0
- package/lib/cjs/components/user-image/UserImage.types.js +6 -0
- package/lib/cjs/components/user-image/UserImage.types.js.map +1 -0
- package/lib/cjs/components/user-image/userImage.styles.js +27 -0
- package/lib/cjs/components/user-image/userImage.styles.js.map +1 -0
- package/lib/cjs/index.js +49 -1
- package/lib/cjs/index.js.map +1 -1
- package/lib/esm/components/navigation-layout/NavigationLayout.constants.js +8 -0
- package/lib/esm/components/navigation-layout/NavigationLayout.constants.js.map +1 -0
- package/lib/esm/components/navigation-layout/NavigationLayout.context.js +17 -0
- package/lib/esm/components/navigation-layout/NavigationLayout.context.js.map +1 -0
- package/lib/esm/components/navigation-layout/NavigationLayout.js +97 -0
- package/lib/esm/components/navigation-layout/NavigationLayout.js.map +1 -0
- package/lib/esm/components/navigation-layout/NavigationLayout.styles.js +67 -0
- package/lib/esm/components/navigation-layout/NavigationLayout.styles.js.map +1 -0
- package/lib/esm/components/navigation-layout/NavigationLayout.types.js +2 -0
- package/lib/esm/components/navigation-layout/NavigationLayout.types.js.map +1 -0
- package/lib/esm/components/navigation-layout/NavigationLayout.utils.js +251 -0
- package/lib/esm/components/navigation-layout/NavigationLayout.utils.js.map +1 -0
- package/lib/esm/components/navigation-layout/navigation-header/NavigationHeader.js +24 -0
- package/lib/esm/components/navigation-layout/navigation-header/NavigationHeader.js.map +1 -0
- package/lib/esm/components/navigation-layout/navigation-header/NavigationHeader.styles.js +23 -0
- package/lib/esm/components/navigation-layout/navigation-header/NavigationHeader.styles.js.map +1 -0
- package/lib/esm/components/navigation-layout/navigation-header/NavigationHeader.types.js +2 -0
- package/lib/esm/components/navigation-layout/navigation-header/NavigationHeader.types.js.map +1 -0
- package/lib/esm/components/navigation-layout/navigation-header/menu-toggle/MenuToggle.js +64 -0
- package/lib/esm/components/navigation-layout/navigation-header/menu-toggle/MenuToggle.js.map +1 -0
- package/lib/esm/components/navigation-layout/navigation-header/menu-toggle/MenuToggle.styles.js +12 -0
- package/lib/esm/components/navigation-layout/navigation-header/menu-toggle/MenuToggle.styles.js.map +1 -0
- package/lib/esm/components/navigation-layout/navigation-sidebar/NavigationSidebar.context.js +17 -0
- package/lib/esm/components/navigation-layout/navigation-sidebar/NavigationSidebar.context.js.map +1 -0
- package/lib/esm/components/navigation-layout/navigation-sidebar/NavigationSidebar.js +132 -0
- package/lib/esm/components/navigation-layout/navigation-sidebar/NavigationSidebar.js.map +1 -0
- package/lib/esm/components/navigation-layout/navigation-sidebar/NavigationSidebar.styles.js +82 -0
- package/lib/esm/components/navigation-layout/navigation-sidebar/NavigationSidebar.styles.js.map +1 -0
- package/lib/esm/components/navigation-layout/navigation-sidebar/NavigationSidebar.types.js +2 -0
- package/lib/esm/components/navigation-layout/navigation-sidebar/NavigationSidebar.types.js.map +1 -0
- package/lib/esm/components/navigation-layout/navigation-sidebar/NavigationSidebar.utils.js +73 -0
- package/lib/esm/components/navigation-layout/navigation-sidebar/NavigationSidebar.utils.js.map +1 -0
- package/lib/esm/components/navigation-layout/navigation-sidebar/sidebar-divider/SidebarDivider.js +10 -0
- package/lib/esm/components/navigation-layout/navigation-sidebar/sidebar-divider/SidebarDivider.js.map +1 -0
- package/lib/esm/components/navigation-layout/navigation-sidebar/sidebar-divider/SidebarDivider.styles.js +12 -0
- package/lib/esm/components/navigation-layout/navigation-sidebar/sidebar-divider/SidebarDivider.styles.js.map +1 -0
- package/lib/esm/components/navigation-layout/navigation-sidebar/sidebar-group/SidebarGroup.context.js +17 -0
- package/lib/esm/components/navigation-layout/navigation-sidebar/sidebar-group/SidebarGroup.context.js.map +1 -0
- package/lib/esm/components/navigation-layout/navigation-sidebar/sidebar-group/SidebarGroup.hooks.js +119 -0
- package/lib/esm/components/navigation-layout/navigation-sidebar/sidebar-group/SidebarGroup.hooks.js.map +1 -0
- package/lib/esm/components/navigation-layout/navigation-sidebar/sidebar-group/SidebarGroup.js +71 -0
- package/lib/esm/components/navigation-layout/navigation-sidebar/sidebar-group/SidebarGroup.js.map +1 -0
- package/lib/esm/components/navigation-layout/navigation-sidebar/sidebar-group/SidebarGroup.styles.js +62 -0
- package/lib/esm/components/navigation-layout/navigation-sidebar/sidebar-group/SidebarGroup.styles.js.map +1 -0
- package/lib/esm/components/navigation-layout/navigation-sidebar/sidebar-group/sidebar-item/SidebarItem.hooks.js +257 -0
- package/lib/esm/components/navigation-layout/navigation-sidebar/sidebar-group/sidebar-item/SidebarItem.hooks.js.map +1 -0
- package/lib/esm/components/navigation-layout/navigation-sidebar/sidebar-group/sidebar-item/SidebarItem.js +186 -0
- package/lib/esm/components/navigation-layout/navigation-sidebar/sidebar-group/sidebar-item/SidebarItem.js.map +1 -0
- package/lib/esm/components/navigation-layout/navigation-sidebar/sidebar-group/sidebar-item/SidebarItem.styles.js +126 -0
- package/lib/esm/components/navigation-layout/navigation-sidebar/sidebar-group/sidebar-item/SidebarItem.styles.js.map +1 -0
- package/lib/esm/components/navigation-layout/navigation-sidebar/sidebar-group/sidebar-item/SidebarItem.utils.js +67 -0
- package/lib/esm/components/navigation-layout/navigation-sidebar/sidebar-group/sidebar-item/SidebarItem.utils.js.map +1 -0
- package/lib/esm/components/split-layout/SplitLayout.js +80 -0
- package/lib/esm/components/split-layout/SplitLayout.js.map +1 -0
- package/lib/esm/components/split-layout/SplitLayout.styles.js +37 -0
- package/lib/esm/components/split-layout/SplitLayout.styles.js.map +1 -0
- package/lib/esm/components/split-layout/SplitLayout.types.js +6 -0
- package/lib/esm/components/split-layout/SplitLayout.types.js.map +1 -0
- package/lib/esm/components/split-layout/SplitLayout.utils.js +17 -0
- package/lib/esm/components/split-layout/SplitLayout.utils.js.map +1 -0
- package/lib/esm/components/split-layout/resize-handle/ResizeHandle.hooks.js +54 -0
- package/lib/esm/components/split-layout/resize-handle/ResizeHandle.hooks.js.map +1 -0
- package/lib/esm/components/split-layout/resize-handle/ResizeHandle.js +27 -0
- package/lib/esm/components/split-layout/resize-handle/ResizeHandle.js.map +1 -0
- package/lib/esm/components/split-layout/resize-handle/ResizeHandle.styles.js +52 -0
- package/lib/esm/components/split-layout/resize-handle/ResizeHandle.styles.js.map +1 -0
- package/lib/esm/components/user-image/UserImage.js +31 -0
- package/lib/esm/components/user-image/UserImage.js.map +1 -0
- package/lib/esm/components/user-image/UserImage.types.js +2 -0
- package/lib/esm/components/user-image/UserImage.types.js.map +1 -0
- package/lib/esm/components/user-image/userImage.styles.js +20 -0
- package/lib/esm/components/user-image/userImage.styles.js.map +1 -0
- package/lib/esm/index.js +15 -1
- package/lib/esm/index.js.map +1 -1
- package/lib/types/components/navigation-layout/NavigationLayout.constants.d.ts +7 -0
- package/lib/types/components/navigation-layout/NavigationLayout.context.d.ts +15 -0
- package/lib/types/components/navigation-layout/NavigationLayout.d.ts +4 -0
- package/lib/types/components/navigation-layout/NavigationLayout.styles.d.ts +19 -0
- package/lib/types/components/navigation-layout/NavigationLayout.types.d.ts +125 -0
- package/lib/types/components/navigation-layout/NavigationLayout.utils.d.ts +22 -0
- package/lib/types/components/navigation-layout/navigation-header/NavigationHeader.d.ts +4 -0
- package/lib/types/components/navigation-layout/navigation-header/NavigationHeader.styles.d.ts +9 -0
- package/lib/types/components/navigation-layout/navigation-header/NavigationHeader.types.d.ts +10 -0
- package/lib/types/components/navigation-layout/navigation-header/menu-toggle/MenuToggle.d.ts +8 -0
- package/lib/types/components/navigation-layout/navigation-header/menu-toggle/MenuToggle.styles.d.ts +3 -0
- package/lib/types/components/navigation-layout/navigation-sidebar/NavigationSidebar.context.d.ts +19 -0
- package/lib/types/components/navigation-layout/navigation-sidebar/NavigationSidebar.d.ts +4 -0
- package/lib/types/components/navigation-layout/navigation-sidebar/NavigationSidebar.styles.d.ts +27 -0
- package/lib/types/components/navigation-layout/navigation-sidebar/NavigationSidebar.types.d.ts +54 -0
- package/lib/types/components/navigation-layout/navigation-sidebar/NavigationSidebar.utils.d.ts +22 -0
- package/lib/types/components/navigation-layout/navigation-sidebar/sidebar-divider/SidebarDivider.d.ts +6 -0
- package/lib/types/components/navigation-layout/navigation-sidebar/sidebar-divider/SidebarDivider.styles.d.ts +6 -0
- package/lib/types/components/navigation-layout/navigation-sidebar/sidebar-group/SidebarGroup.context.d.ts +22 -0
- package/lib/types/components/navigation-layout/navigation-sidebar/sidebar-group/SidebarGroup.d.ts +9 -0
- package/lib/types/components/navigation-layout/navigation-sidebar/sidebar-group/SidebarGroup.hooks.d.ts +26 -0
- package/lib/types/components/navigation-layout/navigation-sidebar/sidebar-group/SidebarGroup.styles.d.ts +9 -0
- package/lib/types/components/navigation-layout/navigation-sidebar/sidebar-group/sidebar-item/SidebarItem.d.ts +10 -0
- package/lib/types/components/navigation-layout/navigation-sidebar/sidebar-group/sidebar-item/SidebarItem.hooks.d.ts +51 -0
- package/lib/types/components/navigation-layout/navigation-sidebar/sidebar-group/sidebar-item/SidebarItem.styles.d.ts +24 -0
- package/lib/types/components/navigation-layout/navigation-sidebar/sidebar-group/sidebar-item/SidebarItem.utils.d.ts +23 -0
- package/lib/types/components/split-layout/SplitLayout.d.ts +4 -0
- package/lib/types/components/split-layout/SplitLayout.styles.d.ts +12 -0
- package/lib/types/components/split-layout/SplitLayout.types.d.ts +19 -0
- package/lib/types/components/split-layout/SplitLayout.utils.d.ts +8 -0
- package/lib/types/components/split-layout/resize-handle/ResizeHandle.d.ts +11 -0
- package/lib/types/components/split-layout/resize-handle/ResizeHandle.hooks.d.ts +9 -0
- package/lib/types/components/split-layout/resize-handle/ResizeHandle.styles.d.ts +15 -0
- package/lib/types/components/user-image/UserImage.d.ts +4 -0
- package/lib/types/components/user-image/UserImage.types.d.ts +8 -0
- package/lib/types/components/user-image/userImage.styles.d.ts +10 -0
- package/lib/types/index.d.ts +10 -2
- package/package.json +3 -3
package/lib/esm/index.js
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
// noinspection JSUnusedGlobalSymbols
|
|
2
|
+
|
|
3
|
+
// Components
|
|
2
4
|
export { default as DynamicToolbar } from './components/dynamic-toolbar/DynamicToolbar';
|
|
3
|
-
export { DynamicToolbarLayout } from './components/dynamic-toolbar/DynamicToolbar.types';
|
|
4
5
|
export { default as DynamicToolbarSpacer } from './components/dynamic-toolbar-spacer/DynamicToolbarSpacer';
|
|
6
|
+
export { default as SplitLayout } from './components/split-layout/SplitLayout';
|
|
7
|
+
export { default as UserImage } from './components/user-image/UserImage';
|
|
8
|
+
export { default as MenuToggle } from './components/navigation-layout/navigation-header/menu-toggle/MenuToggle';
|
|
9
|
+
export { default as NavigationLayout } from './components/navigation-layout/NavigationLayout';
|
|
10
|
+
|
|
11
|
+
// Types
|
|
12
|
+
|
|
13
|
+
// Emums
|
|
14
|
+
export { DynamicToolbarLayout } from './components/dynamic-toolbar/DynamicToolbar.types';
|
|
15
|
+
export { SplitLayoutDirection } from './components/split-layout/SplitLayout.types';
|
|
16
|
+
|
|
17
|
+
// Utils
|
|
18
|
+
export { reorderNavigationLayoutGroupItems, reorderNavigationLayoutGroups } from './components/navigation-layout/NavigationLayout.utils';
|
|
5
19
|
//# sourceMappingURL=index.js.map
|
package/lib/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["default","DynamicToolbar","DynamicToolbarLayout","
|
|
1
|
+
{"version":3,"file":"index.js","names":["default","DynamicToolbar","DynamicToolbarSpacer","SplitLayout","UserImage","MenuToggle","NavigationLayout","DynamicToolbarLayout","SplitLayoutDirection","reorderNavigationLayoutGroupItems","reorderNavigationLayoutGroups"],"sources":["../../src/index.ts"],"sourcesContent":["// noinspection JSUnusedGlobalSymbols\n\n// Components\nexport { default as DynamicToolbar } from './components/dynamic-toolbar/DynamicToolbar';\nexport { default as DynamicToolbarSpacer } from './components/dynamic-toolbar-spacer/DynamicToolbarSpacer';\nexport { default as SplitLayout } from './components/split-layout/SplitLayout';\nexport { default as UserImage } from './components/user-image/UserImage';\nexport { default as MenuToggle } from './components/navigation-layout/navigation-header/menu-toggle/MenuToggle';\nexport { default as NavigationLayout } from './components/navigation-layout/NavigationLayout';\n\n// Types\nexport type { DynamicToolbarSpacerProps } from './components/dynamic-toolbar-spacer/DynamicToolbarSpacer.types';\nexport type {\n DynamicToolbarItem,\n DynamicToolbarProps,\n} from './components/dynamic-toolbar/DynamicToolbar.types';\nexport type {\n NavigationLayoutConfig,\n NavigationLayoutGroup,\n NavigationLayoutItem,\n NavigationLayoutItemLocation,\n NavigationLayoutItemReorderEvent,\n NavigationLayoutItemReorderPlacement,\n NavigationLayoutItemReorderSource,\n NavigationLayoutItemReorderTarget,\n NavigationLayoutProps,\n} from './components/navigation-layout/NavigationLayout.types';\nexport type { SplitLayoutView } from './components/split-layout/SplitLayout.types';\n\n// Emums\nexport { DynamicToolbarLayout } from './components/dynamic-toolbar/DynamicToolbar.types';\nexport { SplitLayoutDirection } from './components/split-layout/SplitLayout.types';\n\n// Utils\nexport {\n reorderNavigationLayoutGroupItems,\n reorderNavigationLayoutGroups,\n} from './components/navigation-layout/NavigationLayout.utils';\n"],"mappings":"AAAA;;AAEA;AACA,SAASA,OAAO,IAAIC,cAAc,QAAQ,6CAA6C;AACvF,SAASD,OAAO,IAAIE,oBAAoB,QAAQ,0DAA0D;AAC1G,SAASF,OAAO,IAAIG,WAAW,QAAQ,uCAAuC;AAC9E,SAASH,OAAO,IAAII,SAAS,QAAQ,mCAAmC;AACxE,SAASJ,OAAO,IAAIK,UAAU,QAAQ,yEAAyE;AAC/G,SAASL,OAAO,IAAIM,gBAAgB,QAAQ,iDAAiD;;AAE7F;;AAmBA;AACA,SAASC,oBAAoB,QAAQ,mDAAmD;AACxF,SAASC,oBAAoB,QAAQ,6CAA6C;;AAElF;AACA,SACIC,iCAAiC,EACjCC,6BAA6B,QAC1B,uDAAuD","ignoreList":[]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { NavigationLayoutProps } from './NavigationLayout.types';
|
|
3
|
+
interface NavigationLayoutContextValue {
|
|
4
|
+
onItemReorder?: NavigationLayoutProps['onItemReorder'];
|
|
5
|
+
}
|
|
6
|
+
interface NavigationLayoutProviderProps {
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
value: NavigationLayoutContextValue;
|
|
9
|
+
}
|
|
10
|
+
export declare const NavigationLayoutProvider: {
|
|
11
|
+
({ children, value }: NavigationLayoutProviderProps): React.JSX.Element;
|
|
12
|
+
displayName: string;
|
|
13
|
+
};
|
|
14
|
+
export declare const useNavigationLayoutContext: () => NavigationLayoutContextValue;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { WithTheme } from '@chayns-components/core';
|
|
2
|
+
export declare const StyledNavigationLayout: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
3
|
+
export declare const StyledMotionNavigationLayoutContentWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<Omit<import("motion/react").HTMLMotionProps<"div">, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & {
|
|
4
|
+
ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
5
|
+
}, never>> & string & Omit<import("motion/react").ForwardRefComponent<HTMLDivElement, import("motion/react").HTMLMotionProps<"div">>, keyof import("react").Component<any, {}, any>>;
|
|
6
|
+
type StyledNavigationLayoutContentProps = WithTheme<{
|
|
7
|
+
$isCornerContent: boolean;
|
|
8
|
+
$isMobile: boolean;
|
|
9
|
+
}>;
|
|
10
|
+
export declare const StyledNavigationLayoutContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledNavigationLayoutContentProps>> & string;
|
|
11
|
+
export declare const StyledMotionNavigationLayoutContentOverlay: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<Omit<import("motion/react").HTMLMotionProps<"div">, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & {
|
|
12
|
+
ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
13
|
+
}, never>> & string & Omit<import("motion/react").ForwardRefComponent<HTMLDivElement, import("motion/react").HTMLMotionProps<"div">>, keyof import("react").Component<any, {}, any>>;
|
|
14
|
+
type StyledNavigationLayoutBackgroundProps = WithTheme<{
|
|
15
|
+
$backgroundColor: string;
|
|
16
|
+
}>;
|
|
17
|
+
export declare const StyledNavigationLayoutBackground: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledNavigationLayoutBackgroundProps>> & string;
|
|
18
|
+
export declare const StyledNavigationLayoutBackgroundImage: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, never>> & string;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export type NavigationLayoutItemReorderPlacement = 'before' | 'after' | 'inside';
|
|
3
|
+
/**
|
|
4
|
+
* Describes a location inside the item tree of a single navigation group.
|
|
5
|
+
*/
|
|
6
|
+
export interface NavigationLayoutItemLocation {
|
|
7
|
+
/**
|
|
8
|
+
* Ordered parent chain from root level to the direct parent.
|
|
9
|
+
*/
|
|
10
|
+
parentIds: NavigationLayoutItem['id'][];
|
|
11
|
+
/**
|
|
12
|
+
* Zero-based index within the resolved level.
|
|
13
|
+
*/
|
|
14
|
+
index: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Describes the dragged item and its original position.
|
|
18
|
+
*/
|
|
19
|
+
export interface NavigationLayoutItemReorderSource extends NavigationLayoutItemLocation {
|
|
20
|
+
itemId: NavigationLayoutItem['id'];
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Describes the resolved drop target inside the current group.
|
|
24
|
+
*/
|
|
25
|
+
export interface NavigationLayoutItemReorderTarget extends NavigationLayoutItemLocation {
|
|
26
|
+
itemId?: NavigationLayoutItem['id'];
|
|
27
|
+
placement: NavigationLayoutItemReorderPlacement;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Payload emitted after a valid reorder interaction within a single group.
|
|
31
|
+
*/
|
|
32
|
+
export interface NavigationLayoutItemReorderEvent {
|
|
33
|
+
groupId: NavigationLayoutGroup['id'];
|
|
34
|
+
itemId: NavigationLayoutItem['id'];
|
|
35
|
+
source: NavigationLayoutItemReorderSource;
|
|
36
|
+
target: NavigationLayoutItemReorderTarget;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Public props for the navigation layout shell.
|
|
40
|
+
*/
|
|
41
|
+
export interface NavigationLayoutProps {
|
|
42
|
+
/**
|
|
43
|
+
* Main content rendered next to the navigation sidebar.
|
|
44
|
+
*/
|
|
45
|
+
children: ReactNode;
|
|
46
|
+
/**
|
|
47
|
+
* Visual configuration for header, sidebar and background.
|
|
48
|
+
*/
|
|
49
|
+
config?: NavigationLayoutConfig;
|
|
50
|
+
/**
|
|
51
|
+
* Grouped navigation data rendered in the sidebar.
|
|
52
|
+
*/
|
|
53
|
+
groups: NavigationLayoutGroup[];
|
|
54
|
+
/**
|
|
55
|
+
* Optional content rendered above the navigation items.
|
|
56
|
+
*/
|
|
57
|
+
sidebarTopContent?: ReactNode;
|
|
58
|
+
/**
|
|
59
|
+
* Optional content rendered below the navigation items.
|
|
60
|
+
*/
|
|
61
|
+
sidebarBottomContent?: ReactNode;
|
|
62
|
+
/**
|
|
63
|
+
* Currently selected item id.
|
|
64
|
+
*/
|
|
65
|
+
selectedItemId?: NavigationLayoutItem['id'];
|
|
66
|
+
/**
|
|
67
|
+
* Called when a navigation item is clicked.
|
|
68
|
+
*/
|
|
69
|
+
onItemClick?: (id: NavigationLayoutItem['id'], parentIds?: NavigationLayoutItem['id'][]) => void;
|
|
70
|
+
/**
|
|
71
|
+
* Called after a successful reorder inside a single group.
|
|
72
|
+
*/
|
|
73
|
+
onItemReorder?: (event: NavigationLayoutItemReorderEvent) => void;
|
|
74
|
+
/**
|
|
75
|
+
* Content rendered inside the fixed header.
|
|
76
|
+
*/
|
|
77
|
+
headerContent: ReactNode;
|
|
78
|
+
/**
|
|
79
|
+
* Called when the sidebar snaps open.
|
|
80
|
+
*/
|
|
81
|
+
onSidebarOpen?: VoidFunction;
|
|
82
|
+
/**
|
|
83
|
+
* Called when the sidebar snaps closed.
|
|
84
|
+
*/
|
|
85
|
+
onSidebarClose?: VoidFunction;
|
|
86
|
+
/**
|
|
87
|
+
* Shows labels in collapsed mode via tooltip-like popups.
|
|
88
|
+
*/
|
|
89
|
+
shouldShowCollapsedLabel?: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Enables the mobile layout variant.
|
|
92
|
+
*/
|
|
93
|
+
isMobile?: boolean;
|
|
94
|
+
}
|
|
95
|
+
export interface SafeAreas {
|
|
96
|
+
top?: number;
|
|
97
|
+
bottom?: number;
|
|
98
|
+
left?: number;
|
|
99
|
+
right?: number;
|
|
100
|
+
}
|
|
101
|
+
export interface NavigationLayoutConfig {
|
|
102
|
+
headerHeight?: number;
|
|
103
|
+
backgroundColor?: string;
|
|
104
|
+
backgroundImage?: string;
|
|
105
|
+
color?: string;
|
|
106
|
+
sidebarMinWidth?: number;
|
|
107
|
+
sidebarMaxWidth?: number;
|
|
108
|
+
safeAreas?: SafeAreas;
|
|
109
|
+
}
|
|
110
|
+
export interface NavigationLayoutItem {
|
|
111
|
+
id: string;
|
|
112
|
+
label: string;
|
|
113
|
+
icons?: string[];
|
|
114
|
+
imageUrl?: string;
|
|
115
|
+
imageElement?: ReactNode;
|
|
116
|
+
isDisabled?: boolean;
|
|
117
|
+
disabledReason?: string;
|
|
118
|
+
children?: NavigationLayoutItem[];
|
|
119
|
+
}
|
|
120
|
+
export interface NavigationLayoutGroup {
|
|
121
|
+
id: string;
|
|
122
|
+
isReorderable?: boolean;
|
|
123
|
+
isPinned?: boolean;
|
|
124
|
+
items: NavigationLayoutItem[];
|
|
125
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { NavigationLayoutGroup, NavigationLayoutItem, NavigationLayoutItemReorderEvent, NavigationLayoutItemReorderTarget } from './NavigationLayout.types';
|
|
2
|
+
interface IsNavigationLayoutItemReorderEventValidOptions {
|
|
3
|
+
items: NavigationLayoutItem[];
|
|
4
|
+
event: NavigationLayoutItemReorderEvent;
|
|
5
|
+
}
|
|
6
|
+
interface ReorderNavigationLayoutGroupItemsOptions {
|
|
7
|
+
items: NavigationLayoutItem[];
|
|
8
|
+
event: NavigationLayoutItemReorderEvent;
|
|
9
|
+
}
|
|
10
|
+
interface ReorderNavigationLayoutGroupsOptions {
|
|
11
|
+
groups: NavigationLayoutGroup[];
|
|
12
|
+
event: NavigationLayoutItemReorderEvent;
|
|
13
|
+
}
|
|
14
|
+
interface IsNavigationLayoutReorderTargetEqualOptions {
|
|
15
|
+
targetA: NavigationLayoutItemReorderTarget | null;
|
|
16
|
+
targetB: NavigationLayoutItemReorderTarget | null;
|
|
17
|
+
}
|
|
18
|
+
export declare function isNavigationLayoutReorderTargetEqual({ targetA, targetB, }: IsNavigationLayoutReorderTargetEqualOptions): boolean;
|
|
19
|
+
export declare function isNavigationLayoutItemReorderEventValid({ items, event, }: IsNavigationLayoutItemReorderEventValidOptions): boolean;
|
|
20
|
+
export declare function reorderNavigationLayoutGroupItems({ items, event, }: ReorderNavigationLayoutGroupItemsOptions): NavigationLayoutItem[];
|
|
21
|
+
export declare function reorderNavigationLayoutGroups({ groups, event, }: ReorderNavigationLayoutGroupsOptions): NavigationLayoutGroup[];
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { WithTheme } from '@chayns-components/core';
|
|
2
|
+
import { NavigationLayoutConfig } from '../NavigationLayout.types';
|
|
3
|
+
type StyledNavigationHeaderProps = WithTheme<{
|
|
4
|
+
$height: number;
|
|
5
|
+
$color: string;
|
|
6
|
+
$safeAreas: NavigationLayoutConfig['safeAreas'];
|
|
7
|
+
}>;
|
|
8
|
+
export declare const StyledNavigationHeader: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledNavigationHeaderProps>> & string;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { NavigationLayoutConfig, NavigationLayoutProps } from '../NavigationLayout.types';
|
|
2
|
+
export interface NavigationHeaderProps {
|
|
3
|
+
height: number;
|
|
4
|
+
color: string;
|
|
5
|
+
safeAreas?: NavigationLayoutConfig['safeAreas'];
|
|
6
|
+
headerContent: NavigationLayoutProps['headerContent'];
|
|
7
|
+
isMobile: NavigationLayoutProps['isMobile'];
|
|
8
|
+
isMobileOpen: boolean;
|
|
9
|
+
onMenuClick: () => void;
|
|
10
|
+
}
|
package/lib/types/components/navigation-layout/navigation-header/menu-toggle/MenuToggle.styles.d.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const StyledMotionMenuToggle: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<Omit<import("motion/react").HTMLMotionProps<"button">, "ref"> & import("react").RefAttributes<HTMLButtonElement>, "ref"> & {
|
|
2
|
+
ref?: ((instance: HTMLButtonElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLButtonElement> | null | undefined;
|
|
3
|
+
}, never>> & string & Omit<import("motion/react").ForwardRefComponent<HTMLButtonElement, import("motion/react").HTMLMotionProps<"button">>, keyof import("react").Component<any, {}, any>>;
|
package/lib/types/components/navigation-layout/navigation-sidebar/NavigationSidebar.context.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { NavigationLayoutProps } from '../NavigationLayout.types';
|
|
3
|
+
interface NavigationSidebarContextValue {
|
|
4
|
+
color: string;
|
|
5
|
+
isCompact: boolean;
|
|
6
|
+
selectedItemId?: NavigationLayoutProps['selectedItemId'];
|
|
7
|
+
onItemClick?: NavigationLayoutProps['onItemClick'];
|
|
8
|
+
shouldShowCollapsedLabel?: NavigationLayoutProps['shouldShowCollapsedLabel'];
|
|
9
|
+
}
|
|
10
|
+
interface NavigationSidebarProviderProps {
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
value: NavigationSidebarContextValue;
|
|
13
|
+
}
|
|
14
|
+
export declare const NavigationSidebarProvider: {
|
|
15
|
+
({ children, value }: NavigationSidebarProviderProps): React.JSX.Element;
|
|
16
|
+
displayName: string;
|
|
17
|
+
};
|
|
18
|
+
export declare const useNavigationSidebarContext: () => NavigationSidebarContextValue;
|
|
19
|
+
export {};
|
package/lib/types/components/navigation-layout/navigation-sidebar/NavigationSidebar.styles.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { WithTheme } from '@chayns-components/core';
|
|
2
|
+
type StyledNavigationSidebarProps = WithTheme<{
|
|
3
|
+
$color: string;
|
|
4
|
+
$isMobile?: boolean;
|
|
5
|
+
}>;
|
|
6
|
+
export declare const StyledMotionNavigationSidebar: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<Omit<Omit<import("motion/react").HTMLMotionProps<"div">, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & {
|
|
7
|
+
ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
8
|
+
}, StyledNavigationSidebarProps>> & string & Omit<import("motion/react").ForwardRefComponent<HTMLDivElement, import("motion/react").HTMLMotionProps<"div">>, keyof import("react").Component<any, {}, any>>;
|
|
9
|
+
export declare const StyledMotionNavigationSidebarContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<Omit<import("motion/react").HTMLMotionProps<"div">, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & {
|
|
10
|
+
ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
11
|
+
}, never>> & string & Omit<import("motion/react").ForwardRefComponent<HTMLDivElement, import("motion/react").HTMLMotionProps<"div">>, keyof import("react").Component<any, {}, any>>;
|
|
12
|
+
export declare const StyledMotionNavigationSidebarContentWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<Omit<import("motion/react").HTMLMotionProps<"div">, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & {
|
|
13
|
+
ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
14
|
+
}, never>> & string & Omit<import("motion/react").ForwardRefComponent<HTMLDivElement, import("motion/react").HTMLMotionProps<"div">>, keyof import("react").Component<any, {}, any>>;
|
|
15
|
+
export declare const StyledMotionNavigationSidebarExternalContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<Omit<import("motion/react").HTMLMotionProps<"div">, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & {
|
|
16
|
+
ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
17
|
+
}, never>> & string & Omit<import("motion/react").ForwardRefComponent<HTMLDivElement, import("motion/react").HTMLMotionProps<"div">>, keyof import("react").Component<any, {}, any>>;
|
|
18
|
+
type StyledMotionNavigationSidebarContentListProps = WithTheme<{
|
|
19
|
+
$isPinned?: boolean;
|
|
20
|
+
}>;
|
|
21
|
+
export declare const StyledMotionNavigationSidebarContentList: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<Omit<Omit<import("motion/react").HTMLMotionProps<"div">, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & {
|
|
22
|
+
ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
23
|
+
}, StyledMotionNavigationSidebarContentListProps>> & string & Omit<import("motion/react").ForwardRefComponent<HTMLDivElement, import("motion/react").HTMLMotionProps<"div">>, keyof import("react").Component<any, {}, any>>;
|
|
24
|
+
export declare const StyledNavigationSidebarResizeHandle: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<Omit<import("motion/react").HTMLMotionProps<"div">, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & {
|
|
25
|
+
ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
26
|
+
}, never>> & string & Omit<import("motion/react").ForwardRefComponent<HTMLDivElement, import("motion/react").HTMLMotionProps<"div">>, keyof import("react").Component<any, {}, any>>;
|
|
27
|
+
export {};
|
package/lib/types/components/navigation-layout/navigation-sidebar/NavigationSidebar.types.d.ts
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { NavigationLayoutProps } from '../NavigationLayout.types';
|
|
2
|
+
/**
|
|
3
|
+
* Internal props used to render the navigation sidebar.
|
|
4
|
+
*/
|
|
5
|
+
export interface NavigationSidebarProps {
|
|
6
|
+
/**
|
|
7
|
+
* Color used for icons, text highlights and separators.
|
|
8
|
+
*/
|
|
9
|
+
color: string;
|
|
10
|
+
/**
|
|
11
|
+
* Optional content rendered above the item groups.
|
|
12
|
+
*/
|
|
13
|
+
topContent: NavigationLayoutProps['sidebarTopContent'];
|
|
14
|
+
/**
|
|
15
|
+
* Optional content rendered below the item groups.
|
|
16
|
+
*/
|
|
17
|
+
bottomContent: NavigationLayoutProps['sidebarBottomContent'];
|
|
18
|
+
/**
|
|
19
|
+
* Collapsed sidebar width.
|
|
20
|
+
*/
|
|
21
|
+
minWidth: number;
|
|
22
|
+
/**
|
|
23
|
+
* Expanded sidebar width.
|
|
24
|
+
*/
|
|
25
|
+
maxWidth: number;
|
|
26
|
+
/**
|
|
27
|
+
* Grouped navigation items shown in the sidebar.
|
|
28
|
+
*/
|
|
29
|
+
groups: NavigationLayoutProps['groups'];
|
|
30
|
+
/**
|
|
31
|
+
* Currently selected item id.
|
|
32
|
+
*/
|
|
33
|
+
selectedItemId?: NavigationLayoutProps['selectedItemId'];
|
|
34
|
+
/**
|
|
35
|
+
* Called when an item is clicked.
|
|
36
|
+
*/
|
|
37
|
+
onItemClick?: NavigationLayoutProps['onItemClick'];
|
|
38
|
+
/**
|
|
39
|
+
* Called when the sidebar snaps open.
|
|
40
|
+
*/
|
|
41
|
+
onSidebarOpen?: NavigationLayoutProps['onSidebarOpen'];
|
|
42
|
+
/**
|
|
43
|
+
* Called when the sidebar snaps closed.
|
|
44
|
+
*/
|
|
45
|
+
onSidebarClose?: NavigationLayoutProps['onSidebarClose'];
|
|
46
|
+
/**
|
|
47
|
+
* Enables collapsed labels for top-level items.
|
|
48
|
+
*/
|
|
49
|
+
shouldShowCollapsedLabel?: NavigationLayoutProps['shouldShowCollapsedLabel'];
|
|
50
|
+
/**
|
|
51
|
+
* Enables the mobile layout behaviour.
|
|
52
|
+
*/
|
|
53
|
+
isMobile?: NavigationLayoutProps['isMobile'];
|
|
54
|
+
}
|
package/lib/types/components/navigation-layout/navigation-sidebar/NavigationSidebar.utils.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface UseGlobalUserSelectOptions {
|
|
2
|
+
isDisabled: boolean;
|
|
3
|
+
}
|
|
4
|
+
export declare const useGlobalUserSelect: ({ isDisabled }: UseGlobalUserSelectOptions) => void;
|
|
5
|
+
interface ClampSideBarWidthOptions {
|
|
6
|
+
width: number;
|
|
7
|
+
minWidth: number;
|
|
8
|
+
maxWidth: number;
|
|
9
|
+
}
|
|
10
|
+
export declare const clampSideBarWidth: ({ width, minWidth, maxWidth, }: ClampSideBarWidthOptions) => number;
|
|
11
|
+
interface GetNearestSideBarWidthOptions {
|
|
12
|
+
width: number;
|
|
13
|
+
minWidth: number;
|
|
14
|
+
maxWidth: number;
|
|
15
|
+
}
|
|
16
|
+
interface GetSideBarCompactBreakpointOptions {
|
|
17
|
+
minWidth: number;
|
|
18
|
+
maxWidth: number;
|
|
19
|
+
}
|
|
20
|
+
export declare const getNearestSideBarWidth: ({ width, minWidth, maxWidth, }: GetNearestSideBarWidthOptions) => number;
|
|
21
|
+
export declare const getSideBarCompactBreakpoint: ({ minWidth, maxWidth, }: GetSideBarCompactBreakpointOptions) => number;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { WithTheme } from '@chayns-components/core';
|
|
2
|
+
type StyledSidebarDividerProps = WithTheme<{
|
|
3
|
+
$color: string;
|
|
4
|
+
}>;
|
|
5
|
+
export declare const StyledSidebarDivider: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledSidebarDividerProps>> & string;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { NavigationLayoutItem, NavigationLayoutItemReorderSource, NavigationLayoutItemReorderTarget } from '../../NavigationLayout.types';
|
|
3
|
+
interface SidebarGroupReorderContextValue {
|
|
4
|
+
draggedItemId?: NavigationLayoutItem['id'];
|
|
5
|
+
dropTarget: NavigationLayoutItemReorderTarget | null;
|
|
6
|
+
isDragging: boolean;
|
|
7
|
+
isReorderEnabled: boolean;
|
|
8
|
+
onDragEnd: VoidFunction;
|
|
9
|
+
onDragStart: (event: React.DragEvent<HTMLDivElement>, item: NavigationLayoutItemReorderSource) => void;
|
|
10
|
+
onDrop: (target: NavigationLayoutItemReorderTarget) => void;
|
|
11
|
+
onDropTargetChange: (target: NavigationLayoutItemReorderTarget) => void;
|
|
12
|
+
}
|
|
13
|
+
interface SidebarGroupReorderProviderProps {
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
value: SidebarGroupReorderContextValue;
|
|
16
|
+
}
|
|
17
|
+
export declare const SidebarGroupReorderProvider: {
|
|
18
|
+
({ children, value, }: SidebarGroupReorderProviderProps): React.JSX.Element;
|
|
19
|
+
displayName: string;
|
|
20
|
+
};
|
|
21
|
+
export declare const useSidebarGroupReorderContext: () => SidebarGroupReorderContextValue;
|
|
22
|
+
export {};
|
package/lib/types/components/navigation-layout/navigation-sidebar/sidebar-group/SidebarGroup.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { NavigationLayoutGroup, NavigationLayoutItem } from '../../NavigationLayout.types';
|
|
3
|
+
interface SidebarGroupProps {
|
|
4
|
+
groupId: NavigationLayoutGroup['id'];
|
|
5
|
+
items: NavigationLayoutItem[];
|
|
6
|
+
isReorderable?: NavigationLayoutGroup['isReorderable'];
|
|
7
|
+
}
|
|
8
|
+
declare const _default: React.NamedExoticComponent<SidebarGroupProps>;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { NavigationLayoutGroup, NavigationLayoutItem, NavigationLayoutItemReorderSource, NavigationLayoutItemReorderTarget, NavigationLayoutProps } from '../../NavigationLayout.types';
|
|
3
|
+
interface UseSidebarGroupReorderOptions {
|
|
4
|
+
groupId: NavigationLayoutGroup['id'];
|
|
5
|
+
isCompact: boolean;
|
|
6
|
+
isReorderable?: NavigationLayoutGroup['isReorderable'];
|
|
7
|
+
items: NavigationLayoutItem[];
|
|
8
|
+
onItemReorder?: NavigationLayoutProps['onItemReorder'];
|
|
9
|
+
}
|
|
10
|
+
interface UseSidebarGroupReorderResult {
|
|
11
|
+
draggedItemId?: NavigationLayoutItem['id'];
|
|
12
|
+
dropTarget: NavigationLayoutItemReorderTarget | null;
|
|
13
|
+
isDragging: boolean;
|
|
14
|
+
isGroupEndTargetActive: boolean;
|
|
15
|
+
isReorderEnabled: boolean;
|
|
16
|
+
handleDragEnd: VoidFunction;
|
|
17
|
+
handleDragStart: (event: React.DragEvent<HTMLDivElement>, item: NavigationLayoutItemReorderSource) => void;
|
|
18
|
+
handleDrop: (target: NavigationLayoutItemReorderTarget) => void;
|
|
19
|
+
handleDropTargetChange: (target: NavigationLayoutItemReorderTarget) => void;
|
|
20
|
+
handleGroupDragOver: (event: React.DragEvent<HTMLDivElement>) => void;
|
|
21
|
+
handleGroupDrop: (event: React.DragEvent<HTMLDivElement>) => void;
|
|
22
|
+
handleGroupEndDragOver: (event: React.DragEvent<HTMLDivElement>) => void;
|
|
23
|
+
handleGroupEndDrop: (event: React.DragEvent<HTMLDivElement>) => void;
|
|
24
|
+
}
|
|
25
|
+
export declare const useSidebarGroupReorder: ({ groupId, isCompact, isReorderable, items, onItemReorder, }: UseSidebarGroupReorderOptions) => UseSidebarGroupReorderResult;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const StyledSidebarGroup: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
2
|
+
interface StyledSidebarDropZoneProps {
|
|
3
|
+
$depth?: number;
|
|
4
|
+
$isActive: boolean;
|
|
5
|
+
$isDragging: boolean;
|
|
6
|
+
$placement?: 'before' | 'after' | 'inside';
|
|
7
|
+
}
|
|
8
|
+
export declare const StyledSidebarDropZone: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledSidebarDropZoneProps>> & string;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { NavigationLayoutItem } from '../../../NavigationLayout.types';
|
|
3
|
+
interface SidebarItemProps {
|
|
4
|
+
item: NavigationLayoutItem;
|
|
5
|
+
index: number;
|
|
6
|
+
parentIds: NavigationLayoutItem['id'][];
|
|
7
|
+
shouldShowCollapsedLabel?: boolean;
|
|
8
|
+
}
|
|
9
|
+
declare const _default: React.NamedExoticComponent<SidebarItemProps>;
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
import { Coordinates } from './SidebarItem.utils';
|
|
3
|
+
import { NavigationLayoutItem, NavigationLayoutItemReorderSource, NavigationLayoutItemReorderTarget } from '../../../NavigationLayout.types';
|
|
4
|
+
export interface UseSidebarItemPopupOptions {
|
|
5
|
+
isDisabled: boolean;
|
|
6
|
+
shouldShowCollapsedLabel?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface UseSidebarItemPopupResult {
|
|
9
|
+
coordinates: Coordinates | null;
|
|
10
|
+
handleMouseEnter: () => void;
|
|
11
|
+
handleMouseLeave: () => void;
|
|
12
|
+
isHovered: boolean;
|
|
13
|
+
itemRef: RefObject<HTMLDivElement>;
|
|
14
|
+
popupContainer: HTMLElement | null;
|
|
15
|
+
shouldRenderPopup: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface UseSidebarItemReorderOptions {
|
|
18
|
+
childItems: NavigationLayoutItem['children'];
|
|
19
|
+
draggedItemId?: NavigationLayoutItem['id'];
|
|
20
|
+
dropTarget: NavigationLayoutItemReorderTarget | null;
|
|
21
|
+
id: NavigationLayoutItem['id'];
|
|
22
|
+
index: number;
|
|
23
|
+
isDisabled?: NavigationLayoutItem['isDisabled'];
|
|
24
|
+
isReorderEnabled: boolean;
|
|
25
|
+
onDragEnd: VoidFunction;
|
|
26
|
+
onDragStart: (event: React.DragEvent<HTMLDivElement>, item: NavigationLayoutItemReorderSource) => void;
|
|
27
|
+
onDrop: (target: NavigationLayoutItemReorderTarget) => void;
|
|
28
|
+
onDropInside?: VoidFunction;
|
|
29
|
+
onDropTargetChange: (target: NavigationLayoutItemReorderTarget) => void;
|
|
30
|
+
parentIds: NavigationLayoutItem['id'][];
|
|
31
|
+
}
|
|
32
|
+
export interface UseSidebarItemReorderResult {
|
|
33
|
+
canDragItem: boolean;
|
|
34
|
+
canDropInsideItem: boolean;
|
|
35
|
+
childParentIds: NavigationLayoutItem['id'][];
|
|
36
|
+
childListEndTarget: NavigationLayoutItemReorderTarget | null;
|
|
37
|
+
handleBeforeDragOver: (event: React.DragEvent<HTMLDivElement>) => void;
|
|
38
|
+
handleBeforeDrop: (event: React.DragEvent<HTMLDivElement>) => void;
|
|
39
|
+
handleChildListEndDragOver: (event: React.DragEvent<HTMLDivElement>) => void;
|
|
40
|
+
handleChildListEndDrop: (event: React.DragEvent<HTMLDivElement>) => void;
|
|
41
|
+
handleDragEnd: VoidFunction;
|
|
42
|
+
handleDragStart: (event: React.DragEvent<HTMLDivElement>) => void;
|
|
43
|
+
handleInsideDragOver: (event: React.DragEvent<HTMLDivElement>) => void;
|
|
44
|
+
handleInsideDrop: (event: React.DragEvent<HTMLDivElement>) => void;
|
|
45
|
+
isBeforeDropTargetActive: boolean;
|
|
46
|
+
isChildListEndTargetActive: boolean;
|
|
47
|
+
isDragging: boolean;
|
|
48
|
+
isInsideDropTargetActive: boolean;
|
|
49
|
+
}
|
|
50
|
+
export declare const useSidebarItemPopup: ({ isDisabled, shouldShowCollapsedLabel, }: UseSidebarItemPopupOptions) => UseSidebarItemPopupResult;
|
|
51
|
+
export declare const useSidebarItemReorder: ({ childItems, draggedItemId, dropTarget, id, index, isDisabled, isReorderEnabled, onDragEnd, onDragStart, onDrop, onDropInside, onDropTargetChange, parentIds, }: UseSidebarItemReorderOptions) => UseSidebarItemReorderResult;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { WithTheme } from '@chayns-components/core';
|
|
2
|
+
import { Coordinates } from './SidebarItem.utils';
|
|
3
|
+
export declare const StyledSidebarItem: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
4
|
+
type StyledSidebarItemHeadProps = WithTheme<{
|
|
5
|
+
$shouldHighlight: boolean;
|
|
6
|
+
$hasDisabledReason: boolean;
|
|
7
|
+
$isDisabled?: boolean;
|
|
8
|
+
$isDragging?: boolean;
|
|
9
|
+
$isReorderable?: boolean;
|
|
10
|
+
}>;
|
|
11
|
+
export declare const StyledSidebarItemHead: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledSidebarItemHeadProps>> & string;
|
|
12
|
+
export declare const StyledSidebarItemHeadContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
13
|
+
type StyledSidebarItemPopupProps = WithTheme<{
|
|
14
|
+
$coordinates: Coordinates;
|
|
15
|
+
}>;
|
|
16
|
+
export declare const StyledSidebarItemPopup: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledSidebarItemPopupProps>> & string;
|
|
17
|
+
export declare const StyledSidebarItemIcon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
18
|
+
export declare const StyledMotionSidebarOpenIcon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<Omit<import("motion/react").HTMLMotionProps<"div">, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & {
|
|
19
|
+
ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
20
|
+
}, never>> & string & Omit<import("motion/react").ForwardRefComponent<HTMLDivElement, import("motion/react").HTMLMotionProps<"div">>, keyof import("react").Component<any, {}, any>>;
|
|
21
|
+
export declare const StyledSidebarItemIconImage: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, never>> & string;
|
|
22
|
+
export declare const StyledSidebarItemLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
23
|
+
export declare const StyledSidebarItemChildren: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { NavigationLayoutItem } from '../../../NavigationLayout.types';
|
|
2
|
+
export interface Coordinates {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
}
|
|
6
|
+
interface AreCoordinatesEqualOptions {
|
|
7
|
+
coordinatesA: Coordinates | null;
|
|
8
|
+
coordinatesB: Coordinates | null;
|
|
9
|
+
}
|
|
10
|
+
interface GetSidebarItemPopupCoordinatesOptions {
|
|
11
|
+
container: HTMLElement;
|
|
12
|
+
item: HTMLElement;
|
|
13
|
+
offset?: number;
|
|
14
|
+
}
|
|
15
|
+
interface GetScrollableAncestorElementsOptions {
|
|
16
|
+
element: HTMLElement;
|
|
17
|
+
boundaryElement?: HTMLElement | null;
|
|
18
|
+
}
|
|
19
|
+
export declare const areCoordinatesEqual: ({ coordinatesA, coordinatesB, }: AreCoordinatesEqualOptions) => boolean;
|
|
20
|
+
export declare const getSidebarItemPopupCoordinates: ({ container, item, offset, }: GetSidebarItemPopupCoordinatesOptions) => Coordinates;
|
|
21
|
+
export declare const getScrollableAncestorElements: ({ element, boundaryElement, }: GetScrollableAncestorElementsOptions) => HTMLElement[];
|
|
22
|
+
export declare const isItemOrChildSelected: (item: NavigationLayoutItem, selectedId?: string) => boolean;
|
|
23
|
+
export {};
|