@bitrise/bitkit-v2 0.3.459 → 0.3.460-beta.2905
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/dist/components/BitkitMultiselect/BitkitMultiselect.js +2 -1
- package/dist/components/BitkitMultiselect/BitkitMultiselect.js.map +1 -1
- package/dist/components/BitkitMultiselectMenu/BitkitMultiselectMenu.d.ts +3 -3
- package/dist/components/BitkitMultiselectMenu/BitkitMultiselectMenu.js.map +1 -1
- package/dist/components/BitkitSelect/BitkitSelect.js +2 -1
- package/dist/components/BitkitSelect/BitkitSelect.js.map +1 -1
- package/dist/components/BitkitSelectMenu/BitkitSelectMenu.d.ts +7 -2
- package/dist/components/BitkitSelectMenu/BitkitSelectMenu.js.map +1 -1
- package/dist/components/BitkitSelectMenu/SelectMenuShell.d.ts +3 -3
- package/dist/components/BitkitSelectMenu/SelectMenuShell.js +22 -4
- package/dist/components/BitkitSelectMenu/SelectMenuShell.js.map +1 -1
- package/dist/components/BitkitUISideNav/BitkitUISideNav.d.ts +37 -0
- package/dist/components/BitkitUISideNav/BitkitUISideNav.js +135 -0
- package/dist/components/BitkitUISideNav/BitkitUISideNav.js.map +1 -0
- package/dist/components/BitkitUISideNav/UISideNavBody.d.ts +7 -0
- package/dist/components/BitkitUISideNav/UISideNavBody.js +20 -0
- package/dist/components/BitkitUISideNav/UISideNavBody.js.map +1 -0
- package/dist/components/BitkitUISideNav/UISideNavContext.d.ts +32 -0
- package/dist/components/BitkitUISideNav/UISideNavContext.js +28 -0
- package/dist/components/BitkitUISideNav/UISideNavContext.js.map +1 -0
- package/dist/components/BitkitUISideNav/UISideNavFooter.d.ts +16 -0
- package/dist/components/BitkitUISideNav/UISideNavFooter.js +28 -0
- package/dist/components/BitkitUISideNav/UISideNavFooter.js.map +1 -0
- package/dist/components/BitkitUISideNav/UISideNavFooterHeading.d.ts +12 -0
- package/dist/components/BitkitUISideNav/UISideNavFooterHeading.js +26 -0
- package/dist/components/BitkitUISideNav/UISideNavFooterHeading.js.map +1 -0
- package/dist/components/BitkitUISideNav/UISideNavItem.d.ts +26 -0
- package/dist/components/BitkitUISideNav/UISideNavItem.js +33 -0
- package/dist/components/BitkitUISideNav/UISideNavItem.js.map +1 -0
- package/dist/components/BitkitUISideNav/UISideNavLink.d.ts +30 -0
- package/dist/components/BitkitUISideNav/UISideNavLink.js +58 -0
- package/dist/components/BitkitUISideNav/UISideNavLink.js.map +1 -0
- package/dist/components/BitkitUISideNav/UISideNavWorkspaceSelector.d.ts +45 -0
- package/dist/components/BitkitUISideNav/UISideNavWorkspaceSelector.js +119 -0
- package/dist/components/BitkitUISideNav/UISideNavWorkspaceSelector.js.map +1 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/main.js +4 -1
- package/dist/theme/semantic-tokens/index.d.ts +17 -2
- package/dist/theme/semantic-tokens/semanticColors.d.ts +17 -2
- package/dist/theme/semantic-tokens/semanticColors.js +5 -2
- package/dist/theme/semantic-tokens/semanticColors.js.map +1 -1
- package/dist/theme/slot-recipes/DatePickerSelect.recipe.d.ts +14 -2
- package/dist/theme/slot-recipes/Select.recipe.d.ts +23 -5
- package/dist/theme/slot-recipes/Select.recipe.js +37 -3
- package/dist/theme/slot-recipes/Select.recipe.js.map +1 -1
- package/dist/theme/slot-recipes/UISideNav.recipe.d.ts +114 -0
- package/dist/theme/slot-recipes/UISideNav.recipe.js +413 -0
- package/dist/theme/slot-recipes/UISideNav.recipe.js.map +1 -0
- package/dist/theme/slot-recipes/index.d.ts +145 -7
- package/dist/theme/slot-recipes/index.js +3 -1
- package/dist/theme/slot-recipes/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BitkitUISideNav.js","names":[],"sources":["../../../lib/components/BitkitUISideNav/BitkitUISideNav.tsx"],"sourcesContent":["import { Box, type BoxProps } from '@chakra-ui/react/box';\nimport { Drawer } from '@chakra-ui/react/drawer';\nimport { Portal } from '@chakra-ui/react/portal';\nimport { useSlotRecipe } from '@chakra-ui/react/styled-system';\nimport { type FocusEvent, forwardRef, type ReactNode, useMemo, useRef, useState } from 'react';\n\nimport useResponsive from '../../hooks/useResponsive';\nimport { withSubComponents } from '../../utilities/withSubComponents';\nimport BitkitCloseButton from '../BitkitCloseButton/BitkitCloseButton';\nimport UISideNavBody from './UISideNavBody';\nimport { UISideNavContextProvider } from './UISideNavContext';\nimport UISideNavFooter from './UISideNavFooter';\nimport UISideNavFooterHeading from './UISideNavFooterHeading';\nimport UISideNavItem from './UISideNavItem';\nimport UISideNavLink from './UISideNavLink';\nimport UISideNavWorkspaceSelector from './UISideNavWorkspaceSelector';\n\nexport interface BitkitUISideNavProps extends Omit<BoxProps, 'children'> {\n children: ReactNode;\n /**\n * Forces the desktop rail open or shut, overriding the pointer and focus behaviour. Leave it\n * unset for the normal rail. Set it to `true` while something the rail does not know about is\n * anchored to it, such as a popover opened from the footer.\n */\n expanded?: boolean;\n /** Mobile drawer visibility. Controlled, because the header's menu button is what opens it. */\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n}\n\n/**\n * The platform's primary navigation. It expects a workspace selector, a body of navigation\n * items, and an optional footer:\n *\n * ```tsx\n * <BitkitUISideNav open={open} onOpenChange={setOpen}>\n * <BitkitUISideNav.WorkspaceSelector\n * workspaces={workspaces}\n * value={workspace}\n * onValueChange={setWorkspace}\n * />\n * <BitkitUISideNav.Body>\n * <BitkitUISideNav.Item href=\"/dashboard\" icon={IconDashboard} selectedIcon={IconDashboardFilled} selected>\n * Dashboard\n * </BitkitUISideNav.Item>\n * </BitkitUISideNav.Body>\n * <BitkitUISideNav.Footer>…</BitkitUISideNav.Footer>\n * </BitkitUISideNav>\n * ```\n *\n * On desktop it is a 72px rail that widens to 256px under the pointer and while anything inside\n * it holds keyboard focus. The rows are always laid out at the full width and clipped, so the\n * labels appear without any text reflowing. It will not collapse while the workspace menu is\n * open. There is no pin: the rail is the resting state.\n *\n * Below the `tablet` breakpoint it becomes an overlay drawer instead, opened by the header rather\n * than by hovering. Pass `open` and `onOpenChange`; they are ignored on desktop.\n *\n * It does not position itself. The consumer decides where it sits and how tall it is, which is\n * what lets a page slot it under a header of any height. The expanded rail overlays the page\n * rather than pushing it, so give it a `position` of your own and reserve 72px beside it.\n *\n * Descendants can read the current state with `useUISideNav()`.\n */\nconst BitkitUISideNav = forwardRef<HTMLElement, BitkitUISideNavProps>((props, ref) => {\n const { children, css, expanded: expandedProp, onOpenChange, open = false, ...rest } = props;\n\n const { isMobile } = useResponsive();\n\n const [pointerInside, setPointerInside] = useState(false);\n const [focusInside, setFocusInside] = useState(false);\n const [menuOpen, setMenuOpen] = useState(false);\n const menuContainerRef = useRef<HTMLDivElement>(null);\n\n const recipe = useSlotRecipe({ key: 'uiSideNav' });\n const styles = recipe({ layout: isMobile ? 'drawer' : 'rail' });\n\n const expanded = isMobile || (expandedProp ?? (pointerInside || focusInside || menuOpen));\n const tracksPointer = !isMobile && expandedProp === undefined;\n\n const handleFocus = (event: FocusEvent<HTMLElement>) => {\n if (!event.target.matches(':focus-visible')) return;\n setFocusInside(true);\n };\n\n const handleBlur = (event: FocusEvent<HTMLElement>) => {\n if (event.currentTarget.contains(event.relatedTarget)) return;\n setFocusInside(false);\n };\n\n const nav = (\n <Box\n ref={ref}\n aria-label=\"Platform navigation\"\n asChild\n data-expanded={expanded ? '' : undefined}\n {...rest}\n css={[styles.root, css]}\n onBlur={tracksPointer ? handleBlur : undefined}\n onFocus={tracksPointer ? handleFocus : undefined}\n onPointerEnter={tracksPointer ? () => setPointerInside(true) : undefined}\n onPointerLeave={tracksPointer ? () => setPointerInside(false) : undefined}\n >\n <nav>{children}</nav>\n </Box>\n );\n\n const context = useMemo(\n () => ({ expanded, isMobile, menuContainerRef, setMenuOpen, styles }),\n [expanded, isMobile, styles],\n );\n\n if (!isMobile) {\n return <UISideNavContextProvider value={context}>{nav}</UISideNavContextProvider>;\n }\n\n return (\n <UISideNavContextProvider value={context}>\n <Drawer.Root onOpenChange={(details) => onOpenChange?.(details.open)} open={open}>\n <Portal>\n <Drawer.Backdrop css={styles.backdrop} />\n <Drawer.Positioner css={styles.positioner}>\n <Drawer.Content ref={menuContainerRef} css={styles.content}>\n {nav}\n <Box css={styles.closeButton}>\n <BitkitCloseButton\n aria-label=\"Close navigation\"\n colorVariant=\"white\"\n onClick={() => onOpenChange?.(false)}\n size=\"md\"\n />\n </Box>\n </Drawer.Content>\n </Drawer.Positioner>\n </Portal>\n </Drawer.Root>\n </UISideNavContextProvider>\n );\n});\n\nexport { uiSideNavRailWidth } from '../../theme/slot-recipes/UISideNav.recipe';\nexport { type BitkitUISideNavBodyProps } from './UISideNavBody';\nexport { type BitkitUISideNavFooterProps } from './UISideNavFooter';\nexport { type BitkitUISideNavFooterHeadingProps } from './UISideNavFooterHeading';\nexport { type BitkitUISideNavItemProps } from './UISideNavItem';\nexport {\n type BitkitUISideNavLinkAsAnchorProps,\n type BitkitUISideNavLinkAsButtonProps,\n type BitkitUISideNavLinkProps,\n} from './UISideNavLink';\nexport {\n type BitkitUISideNavWorkspaceProps,\n type BitkitUISideNavWorkspaceSelectorProps,\n} from './UISideNavWorkspaceSelector';\n\nBitkitUISideNav.displayName = 'BitkitUISideNav';\n\nexport default withSubComponents(BitkitUISideNav, {\n Body: UISideNavBody,\n Footer: UISideNavFooter,\n FooterHeading: UISideNavFooterHeading,\n Item: UISideNavItem,\n Link: UISideNavLink,\n WorkspaceSelector: UISideNavWorkspaceSelector,\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgEA,IAAM,kBAAkB,YAA+C,OAAO,QAAQ;CACpF,MAAM,EAAE,UAAU,KAAK,UAAU,cAAc,cAAc,OAAO,OAAO,GAAG,SAAS;CAEvF,MAAM,EAAE,aAAa,cAAc;CAEnC,MAAM,CAAC,eAAe,oBAAoB,SAAS,KAAK;CACxD,MAAM,CAAC,aAAa,kBAAkB,SAAS,KAAK;CACpD,MAAM,CAAC,UAAU,eAAe,SAAS,KAAK;CAC9C,MAAM,mBAAmB,OAAuB,IAAI;CAGpD,MAAM,SADS,cAAc,EAAE,KAAK,YAAY,CACjC,CAAA,CAAO,EAAE,QAAQ,WAAW,WAAW,OAAO,CAAC;CAE9D,MAAM,WAAW,aAAa,iBAAiB,iBAAiB,eAAe;CAC/E,MAAM,gBAAgB,CAAC,YAAY,iBAAiB,KAAA;CAEpD,MAAM,eAAe,UAAmC;EACtD,IAAI,CAAC,MAAM,OAAO,QAAQ,gBAAgB,GAAG;EAC7C,eAAe,IAAI;CACrB;CAEA,MAAM,cAAc,UAAmC;EACrD,IAAI,MAAM,cAAc,SAAS,MAAM,aAAa,GAAG;EACvD,eAAe,KAAK;CACtB;CAEA,MAAM,MACJ,oBAAC,KAAD;EACO;EACL,cAAW;EACX,SAAA;EACA,iBAAe,WAAW,KAAK,KAAA;EAC/B,GAAI;EACJ,KAAK,CAAC,OAAO,MAAM,GAAG;EACtB,QAAQ,gBAAgB,aAAa,KAAA;EACrC,SAAS,gBAAgB,cAAc,KAAA;EACvC,gBAAgB,sBAAsB,iBAAiB,IAAI,IAAI,KAAA;EAC/D,gBAAgB,sBAAsB,iBAAiB,KAAK,IAAI,KAAA;EAEhE,UAAA,oBAAC,OAAD,EAAM,SAAc,CAAA;CACjB,CAAA;CAGP,MAAM,UAAU,eACP;EAAE;EAAU;EAAU;EAAkB;EAAa;CAAO,IACnE;EAAC;EAAU;EAAU;CAAM,CAC7B;CAEA,IAAI,CAAC,UACH,OAAO,oBAAC,0BAAD;EAA0B,OAAO;EAAU,UAAA;CAA8B,CAAA;CAGlF,OACE,oBAAC,0BAAD;EAA0B,OAAO;EAC/B,UAAA,oBAAC,OAAO,MAAR;GAAa,eAAe,YAAY,eAAe,QAAQ,IAAI;GAAS;GAC1E,UAAA,qBAAC,QAAD,EAAA,UAAA,CACE,oBAAC,OAAO,UAAR,EAAiB,KAAK,OAAO,SAAW,CAAA,GACxC,oBAAC,OAAO,YAAR;IAAmB,KAAK,OAAO;IAC7B,UAAA,qBAAC,OAAO,SAAR;KAAgB,KAAK;KAAkB,KAAK,OAAO;KAAnD,UAAA,CACG,KACD,oBAAC,KAAD;MAAK,KAAK,OAAO;MACf,UAAA,oBAAC,mBAAD;OACE,cAAW;OACX,cAAa;OACb,eAAe,eAAe,KAAK;OACnC,MAAK;MACN,CAAA;KACE,CAAA,CACS;;GACC,CAAA,CACb,EAAA,CAAA;EACG,CAAA;CACW,CAAA;AAE9B,CAAC;AAiBD,gBAAgB,cAAc;AAE9B,IAAA,0BAAe,kBAAkB,iBAAiB;CAChD,MAAM;CACN,QAAQ;CACR,eAAe;CACf,MAAM;CACN,MAAM;CACN,mBAAmB;AACrB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BoxProps } from '@chakra-ui/react/box';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
export interface BitkitUISideNavBodyProps extends BoxProps {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
}
|
|
6
|
+
declare const UISideNavBody: import('react').ForwardRefExoticComponent<BitkitUISideNavBodyProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
7
|
+
export default UISideNavBody;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { useUISideNavContext } from "./UISideNavContext.js";
|
|
2
|
+
import { Box } from "@chakra-ui/react/box";
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
//#region lib/components/BitkitUISideNav/UISideNavBody.tsx
|
|
6
|
+
var UISideNavBody = forwardRef((props, ref) => {
|
|
7
|
+
const { children, css, ...rest } = props;
|
|
8
|
+
const { styles } = useUISideNavContext();
|
|
9
|
+
return /* @__PURE__ */ jsx(Box, {
|
|
10
|
+
ref,
|
|
11
|
+
...rest,
|
|
12
|
+
css: [styles.body, css],
|
|
13
|
+
children
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
UISideNavBody.displayName = "BitkitUISideNav.Body";
|
|
17
|
+
//#endregion
|
|
18
|
+
export { UISideNavBody as default };
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=UISideNavBody.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UISideNavBody.js","names":[],"sources":["../../../lib/components/BitkitUISideNav/UISideNavBody.tsx"],"sourcesContent":["import { Box, type BoxProps } from '@chakra-ui/react/box';\nimport { forwardRef, type ReactNode } from 'react';\n\nimport { useUISideNavContext } from './UISideNavContext';\n\nexport interface BitkitUISideNavBodyProps extends BoxProps {\n children: ReactNode;\n}\n\nconst UISideNavBody = forwardRef<HTMLDivElement, BitkitUISideNavBodyProps>((props, ref) => {\n const { children, css, ...rest } = props;\n\n const { styles } = useUISideNavContext();\n\n return (\n <Box ref={ref} {...rest} css={[styles.body, css]}>\n {children}\n </Box>\n );\n});\n\nUISideNavBody.displayName = 'BitkitUISideNav.Body';\n\nexport default UISideNavBody;\n"],"mappings":";;;;;AASA,IAAM,gBAAgB,YAAsD,OAAO,QAAQ;CACzF,MAAM,EAAE,UAAU,KAAK,GAAG,SAAS;CAEnC,MAAM,EAAE,WAAW,oBAAoB;CAEvC,OACE,oBAAC,KAAD;EAAU;EAAK,GAAI;EAAM,KAAK,CAAC,OAAO,MAAM,GAAG;EAC5C;CACE,CAAA;AAET,CAAC;AAED,cAAc,cAAc"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { SystemStyleObject } from '@chakra-ui/react/styled-system';
|
|
2
|
+
import { RefObject } from 'react';
|
|
3
|
+
export interface UISideNavContextValue {
|
|
4
|
+
/** True while the rail is showing its labels, and always true in the mobile drawer. */
|
|
5
|
+
expanded: boolean;
|
|
6
|
+
isMobile: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Where a menu opened inside the drawer has to be portalled: the panel itself. The panel
|
|
9
|
+
* scrolls, so a menu left in the flow would scroll with it and be clipped by it, and anywhere
|
|
10
|
+
* outside the panel is outside the dialog's focus trap.
|
|
11
|
+
*/
|
|
12
|
+
menuContainerRef: RefObject<HTMLDivElement | null>;
|
|
13
|
+
/**
|
|
14
|
+
* How a descendant menu holds the rail open. The rail cannot collapse while a menu anchored
|
|
15
|
+
* inside it is open, or the menu would be left hanging beside a 72px strip.
|
|
16
|
+
*/
|
|
17
|
+
setMenuOpen: (open: boolean) => void;
|
|
18
|
+
styles: Record<string, SystemStyleObject>;
|
|
19
|
+
}
|
|
20
|
+
declare const UISideNavContextProvider: import('react').Provider<UISideNavContextValue>, useUISideNavContext: () => UISideNavContextValue;
|
|
21
|
+
export { UISideNavContextProvider, useUISideNavContext };
|
|
22
|
+
/**
|
|
23
|
+
* Reads the side navigation's current state from inside it. Anything rendered in the footer that
|
|
24
|
+
* has to lay itself out differently in the collapsed rail should call this rather than have the
|
|
25
|
+
* state passed down to it.
|
|
26
|
+
*
|
|
27
|
+
* ```tsx
|
|
28
|
+
* const { expanded } = useUISideNav();
|
|
29
|
+
* return expanded ? <McpWidget /> : <McpWidgetIcon />;
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export declare const useUISideNav: () => Pick<UISideNavContextValue, "expanded" | "isMobile">;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { createContext } from "@chakra-ui/react";
|
|
2
|
+
//#region lib/components/BitkitUISideNav/UISideNavContext.tsx
|
|
3
|
+
var [UISideNavContextProvider, useUISideNavContext] = createContext({
|
|
4
|
+
hookName: "useUISideNavContext",
|
|
5
|
+
name: "UISideNavContext",
|
|
6
|
+
providerName: "<BitkitUISideNav />"
|
|
7
|
+
});
|
|
8
|
+
/**
|
|
9
|
+
* Reads the side navigation's current state from inside it. Anything rendered in the footer that
|
|
10
|
+
* has to lay itself out differently in the collapsed rail should call this rather than have the
|
|
11
|
+
* state passed down to it.
|
|
12
|
+
*
|
|
13
|
+
* ```tsx
|
|
14
|
+
* const { expanded } = useUISideNav();
|
|
15
|
+
* return expanded ? <McpWidget /> : <McpWidgetIcon />;
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
var useUISideNav = () => {
|
|
19
|
+
const { expanded, isMobile } = useUISideNavContext();
|
|
20
|
+
return {
|
|
21
|
+
expanded,
|
|
22
|
+
isMobile
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
//#endregion
|
|
26
|
+
export { UISideNavContextProvider, useUISideNav, useUISideNavContext };
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=UISideNavContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UISideNavContext.js","names":[],"sources":["../../../lib/components/BitkitUISideNav/UISideNavContext.tsx"],"sourcesContent":["// eslint-disable-next-line no-restricted-imports\nimport { createContext } from '@chakra-ui/react';\nimport { type SystemStyleObject } from '@chakra-ui/react/styled-system';\nimport { type RefObject } from 'react';\n\nexport interface UISideNavContextValue {\n /** True while the rail is showing its labels, and always true in the mobile drawer. */\n expanded: boolean;\n isMobile: boolean;\n /**\n * Where a menu opened inside the drawer has to be portalled: the panel itself. The panel\n * scrolls, so a menu left in the flow would scroll with it and be clipped by it, and anywhere\n * outside the panel is outside the dialog's focus trap.\n */\n menuContainerRef: RefObject<HTMLDivElement | null>;\n /**\n * How a descendant menu holds the rail open. The rail cannot collapse while a menu anchored\n * inside it is open, or the menu would be left hanging beside a 72px strip.\n */\n setMenuOpen: (open: boolean) => void;\n styles: Record<string, SystemStyleObject>;\n}\n\nconst [UISideNavContextProvider, useUISideNavContext] = createContext<UISideNavContextValue>({\n hookName: 'useUISideNavContext',\n name: 'UISideNavContext',\n providerName: '<BitkitUISideNav />',\n});\n\nexport { UISideNavContextProvider, useUISideNavContext };\n\n/**\n * Reads the side navigation's current state from inside it. Anything rendered in the footer that\n * has to lay itself out differently in the collapsed rail should call this rather than have the\n * state passed down to it.\n *\n * ```tsx\n * const { expanded } = useUISideNav();\n * return expanded ? <McpWidget /> : <McpWidgetIcon />;\n * ```\n */\nexport const useUISideNav = (): Pick<UISideNavContextValue, 'expanded' | 'isMobile'> => {\n const { expanded, isMobile } = useUISideNavContext();\n return { expanded, isMobile };\n};\n"],"mappings":";;AAuBA,IAAM,CAAC,0BAA0B,uBAAuB,cAAqC;CAC3F,UAAU;CACV,MAAM;CACN,cAAc;AAChB,CAAC;;;;;;;;;;;AAcD,IAAa,qBAA2E;CACtF,MAAM,EAAE,UAAU,aAAa,oBAAoB;CACnD,OAAO;EAAE;EAAU;CAAS;AAC9B"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BoxProps } from '@chakra-ui/react/box';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
export interface BitkitUISideNavFooterProps extends BoxProps {
|
|
4
|
+
/**
|
|
5
|
+
* The rows below the navigation. Drop a `FooterHeading` between them to start a further
|
|
6
|
+
* section, the way the mobile drawer parts its status row from its Help links.
|
|
7
|
+
*/
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* An uppercase heading for the whole block, e.g. `Help`, drawn under the footer's own rule.
|
|
11
|
+
* The desktop rail has nowhere to show one when collapsed, so it usually has none.
|
|
12
|
+
*/
|
|
13
|
+
label?: string;
|
|
14
|
+
}
|
|
15
|
+
declare const UISideNavFooter: import('react').ForwardRefExoticComponent<BitkitUISideNavFooterProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
16
|
+
export default UISideNavFooter;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { useUISideNavContext } from "./UISideNavContext.js";
|
|
2
|
+
import { Box } from "@chakra-ui/react/box";
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { Text } from "@chakra-ui/react/text";
|
|
6
|
+
//#region lib/components/BitkitUISideNav/UISideNavFooter.tsx
|
|
7
|
+
var UISideNavFooter = forwardRef((props, ref) => {
|
|
8
|
+
const { children, css, label, ...rest } = props;
|
|
9
|
+
const { styles } = useUISideNavContext();
|
|
10
|
+
return /* @__PURE__ */ jsxs(Box, {
|
|
11
|
+
ref,
|
|
12
|
+
...rest,
|
|
13
|
+
css: [styles.footer, css],
|
|
14
|
+
children: [
|
|
15
|
+
/* @__PURE__ */ jsx(Box, { css: styles.footerSeparator }),
|
|
16
|
+
label && /* @__PURE__ */ jsx(Text, {
|
|
17
|
+
css: styles.footerHeading,
|
|
18
|
+
children: label
|
|
19
|
+
}),
|
|
20
|
+
children
|
|
21
|
+
]
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
UISideNavFooter.displayName = "BitkitUISideNav.Footer";
|
|
25
|
+
//#endregion
|
|
26
|
+
export { UISideNavFooter as default };
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=UISideNavFooter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UISideNavFooter.js","names":[],"sources":["../../../lib/components/BitkitUISideNav/UISideNavFooter.tsx"],"sourcesContent":["import { Box, type BoxProps } from '@chakra-ui/react/box';\nimport { Text } from '@chakra-ui/react/text';\nimport { forwardRef, type ReactNode } from 'react';\n\nimport { useUISideNavContext } from './UISideNavContext';\n\nexport interface BitkitUISideNavFooterProps extends BoxProps {\n /**\n * The rows below the navigation. Drop a `FooterHeading` between them to start a further\n * section, the way the mobile drawer parts its status row from its Help links.\n */\n children: ReactNode;\n /**\n * An uppercase heading for the whole block, e.g. `Help`, drawn under the footer's own rule.\n * The desktop rail has nowhere to show one when collapsed, so it usually has none.\n */\n label?: string;\n}\n\nconst UISideNavFooter = forwardRef<HTMLDivElement, BitkitUISideNavFooterProps>((props, ref) => {\n const { children, css, label, ...rest } = props;\n\n const { styles } = useUISideNavContext();\n\n return (\n <Box ref={ref} {...rest} css={[styles.footer, css]}>\n {/* Always drawn: the design parts the footer from the navigation above it in both layouts. */}\n <Box css={styles.footerSeparator} />\n {label && <Text css={styles.footerHeading}>{label}</Text>}\n {children}\n </Box>\n );\n});\n\nUISideNavFooter.displayName = 'BitkitUISideNav.Footer';\n\nexport default UISideNavFooter;\n"],"mappings":";;;;;;AAmBA,IAAM,kBAAkB,YAAwD,OAAO,QAAQ;CAC7F,MAAM,EAAE,UAAU,KAAK,OAAO,GAAG,SAAS;CAE1C,MAAM,EAAE,WAAW,oBAAoB;CAEvC,OACE,qBAAC,KAAD;EAAU;EAAK,GAAI;EAAM,KAAK,CAAC,OAAO,QAAQ,GAAG;EAAjD,UAAA;GAEE,oBAAC,KAAD,EAAK,KAAK,OAAO,gBAAkB,CAAA;GAClC,SAAS,oBAAC,MAAD;IAAM,KAAK,OAAO;IAAgB,UAAA;GAAY,CAAA;GACvD;EACE;;AAET,CAAC;AAED,gBAAgB,cAAc"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { TextProps } from '@chakra-ui/react/text';
|
|
2
|
+
export interface BitkitUISideNavFooterHeadingProps extends Omit<TextProps, 'children'> {
|
|
3
|
+
/** The heading, e.g. `Help`. Drawn uppercase, so write it in normal case. */
|
|
4
|
+
children: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Starts a further section inside a footer that already holds rows, bringing a rule of its own.
|
|
8
|
+
* A footer that is nothing but one titled section says the same thing with `label` — and without
|
|
9
|
+
* the second rule, since the footer already draws one at its top.
|
|
10
|
+
*/
|
|
11
|
+
declare const UISideNavFooterHeading: import('react').ForwardRefExoticComponent<BitkitUISideNavFooterHeadingProps & import('react').RefAttributes<HTMLParagraphElement>>;
|
|
12
|
+
export default UISideNavFooterHeading;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { useUISideNavContext } from "./UISideNavContext.js";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { Text } from "@chakra-ui/react/text";
|
|
5
|
+
//#region lib/components/BitkitUISideNav/UISideNavFooterHeading.tsx
|
|
6
|
+
/**
|
|
7
|
+
* Starts a further section inside a footer that already holds rows, bringing a rule of its own.
|
|
8
|
+
* A footer that is nothing but one titled section says the same thing with `label` — and without
|
|
9
|
+
* the second rule, since the footer already draws one at its top.
|
|
10
|
+
*/
|
|
11
|
+
var UISideNavFooterHeading = forwardRef((props, ref) => {
|
|
12
|
+
const { children, css, ...rest } = props;
|
|
13
|
+
const { styles } = useUISideNavContext();
|
|
14
|
+
return /* @__PURE__ */ jsx(Text, {
|
|
15
|
+
ref,
|
|
16
|
+
"data-section": "",
|
|
17
|
+
...rest,
|
|
18
|
+
css: [styles.footerHeading, css],
|
|
19
|
+
children
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
UISideNavFooterHeading.displayName = "BitkitUISideNav.FooterHeading";
|
|
23
|
+
//#endregion
|
|
24
|
+
export { UISideNavFooterHeading as default };
|
|
25
|
+
|
|
26
|
+
//# sourceMappingURL=UISideNavFooterHeading.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UISideNavFooterHeading.js","names":[],"sources":["../../../lib/components/BitkitUISideNav/UISideNavFooterHeading.tsx"],"sourcesContent":["import { Text, type TextProps } from '@chakra-ui/react/text';\nimport { forwardRef } from 'react';\n\nimport { useUISideNavContext } from './UISideNavContext';\n\nexport interface BitkitUISideNavFooterHeadingProps extends Omit<TextProps, 'children'> {\n /** The heading, e.g. `Help`. Drawn uppercase, so write it in normal case. */\n children: string;\n}\n\n/**\n * Starts a further section inside a footer that already holds rows, bringing a rule of its own.\n * A footer that is nothing but one titled section says the same thing with `label` — and without\n * the second rule, since the footer already draws one at its top.\n */\nconst UISideNavFooterHeading = forwardRef<HTMLParagraphElement, BitkitUISideNavFooterHeadingProps>((props, ref) => {\n const { children, css, ...rest } = props;\n\n const { styles } = useUISideNavContext();\n\n return (\n <Text ref={ref} data-section=\"\" {...rest} css={[styles.footerHeading, css]}>\n {children}\n </Text>\n );\n});\n\nUISideNavFooterHeading.displayName = 'BitkitUISideNav.FooterHeading';\n\nexport default UISideNavFooterHeading;\n"],"mappings":";;;;;;;;;;AAeA,IAAM,yBAAyB,YAAqE,OAAO,QAAQ;CACjH,MAAM,EAAE,UAAU,KAAK,GAAG,SAAS;CAEnC,MAAM,EAAE,WAAW,oBAAoB;CAEvC,OACE,oBAAC,MAAD;EAAW;EAAK,gBAAa;EAAG,GAAI;EAAM,KAAK,CAAC,OAAO,eAAe,GAAG;EACtE;CACG,CAAA;AAEV,CAAC;AAED,uBAAuB,cAAc"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { HTMLChakraProps } from '@chakra-ui/react/styled-system';
|
|
2
|
+
import { BitkitIconComponent } from '../../icons';
|
|
3
|
+
export interface BitkitUISideNavItemProps extends Omit<HTMLChakraProps<'a'>, 'children'> {
|
|
4
|
+
/**
|
|
5
|
+
* The destination. Always an anchor: the platform navigation moves between server-rendered
|
|
6
|
+
* product areas, so every row is a real link rather than a button with a handler.
|
|
7
|
+
*/
|
|
8
|
+
href: string;
|
|
9
|
+
/**
|
|
10
|
+
* The row's label. A string rather than `ReactNode` because the collapsed rail clips it and
|
|
11
|
+
* the expanded rail truncates it, neither of which survives arbitrary markup.
|
|
12
|
+
*/
|
|
13
|
+
children: string;
|
|
14
|
+
/** Shown at rest. In the collapsed rail this is the only thing visible. */
|
|
15
|
+
icon: BitkitIconComponent;
|
|
16
|
+
/** Marks the row as the current product area. The consumer decides what counts as current. */
|
|
17
|
+
selected?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Swapped in for `icon` while selected. The design pairs an outline icon with its filled
|
|
20
|
+
* counterpart, e.g. `IconDashboard` with `IconDashboardFilled`. Without it the outline icon
|
|
21
|
+
* stays and only the row's colour and marker change.
|
|
22
|
+
*/
|
|
23
|
+
selectedIcon?: BitkitIconComponent;
|
|
24
|
+
}
|
|
25
|
+
declare const UISideNavItem: import('react').ForwardRefExoticComponent<BitkitUISideNavItemProps & import('react').RefAttributes<HTMLAnchorElement>>;
|
|
26
|
+
export default UISideNavItem;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { useUISideNavContext } from "./UISideNavContext.js";
|
|
2
|
+
import { Box } from "@chakra-ui/react/box";
|
|
3
|
+
import { chakra } from "@chakra-ui/react/styled-system";
|
|
4
|
+
import { forwardRef } from "react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { Text } from "@chakra-ui/react/text";
|
|
7
|
+
//#region lib/components/BitkitUISideNav/UISideNavItem.tsx
|
|
8
|
+
var UISideNavItem = forwardRef((props, ref) => {
|
|
9
|
+
const { children, css, icon: Icon, selected, selectedIcon: SelectedIcon, ...rest } = props;
|
|
10
|
+
const { styles } = useUISideNavContext();
|
|
11
|
+
const RowIcon = selected && SelectedIcon ? SelectedIcon : Icon;
|
|
12
|
+
return /* @__PURE__ */ jsxs(chakra.a, {
|
|
13
|
+
ref,
|
|
14
|
+
"aria-current": selected ? "page" : void 0,
|
|
15
|
+
"data-selected": selected ? "" : void 0,
|
|
16
|
+
...rest,
|
|
17
|
+
css: [styles.item, css],
|
|
18
|
+
children: [
|
|
19
|
+
/* @__PURE__ */ jsx(RowIcon, { css: styles.itemIcon }),
|
|
20
|
+
/* @__PURE__ */ jsx(Text, {
|
|
21
|
+
as: "span",
|
|
22
|
+
css: styles.itemLabel,
|
|
23
|
+
children
|
|
24
|
+
}),
|
|
25
|
+
selected && /* @__PURE__ */ jsx(Box, { css: styles.itemIndicator })
|
|
26
|
+
]
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
UISideNavItem.displayName = "BitkitUISideNav.Item";
|
|
30
|
+
//#endregion
|
|
31
|
+
export { UISideNavItem as default };
|
|
32
|
+
|
|
33
|
+
//# sourceMappingURL=UISideNavItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UISideNavItem.js","names":[],"sources":["../../../lib/components/BitkitUISideNav/UISideNavItem.tsx"],"sourcesContent":["import { Box } from '@chakra-ui/react/box';\nimport { chakra, type HTMLChakraProps } from '@chakra-ui/react/styled-system';\nimport { Text } from '@chakra-ui/react/text';\nimport { forwardRef } from 'react';\n\nimport { type BitkitIconComponent } from '../../icons';\nimport { useUISideNavContext } from './UISideNavContext';\n\nexport interface BitkitUISideNavItemProps extends Omit<HTMLChakraProps<'a'>, 'children'> {\n /**\n * The destination. Always an anchor: the platform navigation moves between server-rendered\n * product areas, so every row is a real link rather than a button with a handler.\n */\n href: string;\n /**\n * The row's label. A string rather than `ReactNode` because the collapsed rail clips it and\n * the expanded rail truncates it, neither of which survives arbitrary markup.\n */\n children: string;\n /** Shown at rest. In the collapsed rail this is the only thing visible. */\n icon: BitkitIconComponent;\n /** Marks the row as the current product area. The consumer decides what counts as current. */\n selected?: boolean;\n /**\n * Swapped in for `icon` while selected. The design pairs an outline icon with its filled\n * counterpart, e.g. `IconDashboard` with `IconDashboardFilled`. Without it the outline icon\n * stays and only the row's colour and marker change.\n */\n selectedIcon?: BitkitIconComponent;\n}\n\nconst UISideNavItem = forwardRef<HTMLAnchorElement, BitkitUISideNavItemProps>((props, ref) => {\n const { children, css, icon: Icon, selected, selectedIcon: SelectedIcon, ...rest } = props;\n\n const { styles } = useUISideNavContext();\n\n const RowIcon = selected && SelectedIcon ? SelectedIcon : Icon;\n\n // `chakra.a` rather than `Link`: the row is styled entirely by the nav's own `item` slot, and\n // `Link` would layer its own recipe over it.\n return (\n <chakra.a\n ref={ref}\n aria-current={selected ? 'page' : undefined}\n data-selected={selected ? '' : undefined}\n {...rest}\n css={[styles.item, css]}\n >\n <RowIcon css={styles.itemIcon} />\n <Text as=\"span\" css={styles.itemLabel}>\n {children}\n </Text>\n {selected && <Box css={styles.itemIndicator} />}\n </chakra.a>\n );\n});\n\nUISideNavItem.displayName = 'BitkitUISideNav.Item';\n\nexport default UISideNavItem;\n"],"mappings":";;;;;;;AA+BA,IAAM,gBAAgB,YAAyD,OAAO,QAAQ;CAC5F,MAAM,EAAE,UAAU,KAAK,MAAM,MAAM,UAAU,cAAc,cAAc,GAAG,SAAS;CAErF,MAAM,EAAE,WAAW,oBAAoB;CAEvC,MAAM,UAAU,YAAY,eAAe,eAAe;CAI1D,OACE,qBAAC,OAAO,GAAR;EACO;EACL,gBAAc,WAAW,SAAS,KAAA;EAClC,iBAAe,WAAW,KAAK,KAAA;EAC/B,GAAI;EACJ,KAAK,CAAC,OAAO,MAAM,GAAG;EALxB,UAAA;GAOE,oBAAC,SAAD,EAAS,KAAK,OAAO,SAAW,CAAA;GAChC,oBAAC,MAAD;IAAM,IAAG;IAAO,KAAK,OAAO;IACzB;GACG,CAAA;GACL,YAAY,oBAAC,KAAD,EAAK,KAAK,OAAO,cAAgB,CAAA;EACtC;;AAEd,CAAC;AAED,cAAc,cAAc"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { HTMLChakraProps } from '@chakra-ui/react/styled-system';
|
|
2
|
+
import { BitkitIconComponent } from '../../icons';
|
|
3
|
+
interface UISideNavLinkCommonProps {
|
|
4
|
+
children: string;
|
|
5
|
+
icon: BitkitIconComponent;
|
|
6
|
+
/**
|
|
7
|
+
* A second line under the label, for a row that reports something rather than just naming a
|
|
8
|
+
* destination. It steps the row up to 56px and the label down to the smaller semibold size.
|
|
9
|
+
*/
|
|
10
|
+
secondaryText?: string;
|
|
11
|
+
/**
|
|
12
|
+
* A coloured dot on the icon's trailing bottom corner. Use it with `secondaryText`, which is
|
|
13
|
+
* what spells the state out; the dot alone only carries colour.
|
|
14
|
+
*/
|
|
15
|
+
status?: 'critical' | 'neutral' | 'success';
|
|
16
|
+
}
|
|
17
|
+
export interface BitkitUISideNavLinkAsAnchorProps extends UISideNavLinkCommonProps, Omit<HTMLChakraProps<'a'>, 'children'> {
|
|
18
|
+
href: string;
|
|
19
|
+
/** Adds the north-east arrow and the usual `target`/`rel` pair for a link leaving the app. */
|
|
20
|
+
isExternal?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface BitkitUISideNavLinkAsButtonProps extends UISideNavLinkCommonProps, Omit<HTMLChakraProps<'button'>, 'children'> {
|
|
23
|
+
href?: undefined;
|
|
24
|
+
isExternal?: undefined;
|
|
25
|
+
/** Makes the row a button instead of a link — for one that opens a dialog rather than navigating. */
|
|
26
|
+
onClick: NonNullable<HTMLChakraProps<'button'>['onClick']>;
|
|
27
|
+
}
|
|
28
|
+
export type BitkitUISideNavLinkProps = BitkitUISideNavLinkAsAnchorProps | BitkitUISideNavLinkAsButtonProps;
|
|
29
|
+
declare const UISideNavLink: import('react').ForwardRefExoticComponent<BitkitUISideNavLinkProps & import('react').RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
|
|
30
|
+
export default UISideNavLink;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import IconArrowNortheast from "../../icons/IconArrowNortheast.js";
|
|
2
|
+
import { useUISideNavContext } from "./UISideNavContext.js";
|
|
3
|
+
import { Box } from "@chakra-ui/react/box";
|
|
4
|
+
import { chakra } from "@chakra-ui/react/styled-system";
|
|
5
|
+
import { forwardRef } from "react";
|
|
6
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { Text } from "@chakra-ui/react/text";
|
|
8
|
+
//#region lib/components/BitkitUISideNav/UISideNavLink.tsx
|
|
9
|
+
var UISideNavLink = forwardRef((props, ref) => {
|
|
10
|
+
const { children, css, href, icon: Icon, isExternal, rel, secondaryText, status, target, ...rest } = props;
|
|
11
|
+
const { styles } = useUISideNavContext();
|
|
12
|
+
const content = /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
13
|
+
/* @__PURE__ */ jsxs(Box, {
|
|
14
|
+
css: styles.linkIconBlock,
|
|
15
|
+
children: [/* @__PURE__ */ jsx(Icon, { css: styles.linkIcon }), status && /* @__PURE__ */ jsx(Box, {
|
|
16
|
+
css: styles.linkStatusDot,
|
|
17
|
+
"data-status": status
|
|
18
|
+
})]
|
|
19
|
+
}),
|
|
20
|
+
/* @__PURE__ */ jsxs(Box, {
|
|
21
|
+
css: styles.linkTextBlock,
|
|
22
|
+
children: [/* @__PURE__ */ jsx(Text, {
|
|
23
|
+
as: "span",
|
|
24
|
+
css: styles.linkLabel,
|
|
25
|
+
children
|
|
26
|
+
}), secondaryText && /* @__PURE__ */ jsx(Text, {
|
|
27
|
+
as: "span",
|
|
28
|
+
css: styles.linkSecondaryText,
|
|
29
|
+
children: secondaryText
|
|
30
|
+
})]
|
|
31
|
+
}),
|
|
32
|
+
isExternal && /* @__PURE__ */ jsx(IconArrowNortheast, { css: styles.linkIcon })
|
|
33
|
+
] });
|
|
34
|
+
const rootProps = {
|
|
35
|
+
"data-with-secondary": secondaryText ? "" : void 0,
|
|
36
|
+
...rest,
|
|
37
|
+
css: [styles.link, css]
|
|
38
|
+
};
|
|
39
|
+
if (href === void 0) return /* @__PURE__ */ jsx(chakra.button, {
|
|
40
|
+
ref,
|
|
41
|
+
type: "button",
|
|
42
|
+
...rootProps,
|
|
43
|
+
children: content
|
|
44
|
+
});
|
|
45
|
+
return /* @__PURE__ */ jsx(chakra.a, {
|
|
46
|
+
ref,
|
|
47
|
+
href,
|
|
48
|
+
rel: isExternal ? rel ? `${rel} noreferrer noopener` : "noreferrer noopener" : rel,
|
|
49
|
+
target: isExternal ? "_blank" : target,
|
|
50
|
+
...rootProps,
|
|
51
|
+
children: content
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
UISideNavLink.displayName = "BitkitUISideNav.Link";
|
|
55
|
+
//#endregion
|
|
56
|
+
export { UISideNavLink as default };
|
|
57
|
+
|
|
58
|
+
//# sourceMappingURL=UISideNavLink.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UISideNavLink.js","names":[],"sources":["../../../lib/components/BitkitUISideNav/UISideNavLink.tsx"],"sourcesContent":["import { Box } from '@chakra-ui/react/box';\nimport { chakra, type HTMLChakraProps } from '@chakra-ui/react/styled-system';\nimport { Text } from '@chakra-ui/react/text';\nimport { forwardRef, type Ref } from 'react';\n\nimport { type BitkitIconComponent, IconArrowNortheast } from '../../icons';\nimport { useUISideNavContext } from './UISideNavContext';\n\ninterface UISideNavLinkCommonProps {\n children: string;\n icon: BitkitIconComponent;\n /**\n * A second line under the label, for a row that reports something rather than just naming a\n * destination. It steps the row up to 56px and the label down to the smaller semibold size.\n */\n secondaryText?: string;\n /**\n * A coloured dot on the icon's trailing bottom corner. Use it with `secondaryText`, which is\n * what spells the state out; the dot alone only carries colour.\n */\n status?: 'critical' | 'neutral' | 'success';\n}\n\nexport interface BitkitUISideNavLinkAsAnchorProps\n extends UISideNavLinkCommonProps, Omit<HTMLChakraProps<'a'>, 'children'> {\n href: string;\n /** Adds the north-east arrow and the usual `target`/`rel` pair for a link leaving the app. */\n isExternal?: boolean;\n}\n\nexport interface BitkitUISideNavLinkAsButtonProps\n extends UISideNavLinkCommonProps, Omit<HTMLChakraProps<'button'>, 'children'> {\n href?: undefined;\n isExternal?: undefined;\n /** Makes the row a button instead of a link — for one that opens a dialog rather than navigating. */\n onClick: NonNullable<HTMLChakraProps<'button'>['onClick']>;\n}\n\nexport type BitkitUISideNavLinkProps = BitkitUISideNavLinkAsAnchorProps | BitkitUISideNavLinkAsButtonProps;\n\nconst UISideNavLink = forwardRef<HTMLAnchorElement | HTMLButtonElement, BitkitUISideNavLinkProps>((props, ref) => {\n const {\n children,\n css,\n href,\n icon: Icon,\n isExternal,\n rel,\n secondaryText,\n status,\n target,\n ...rest\n } = props as BitkitUISideNavLinkAsAnchorProps;\n\n const { styles } = useUISideNavContext();\n\n const content = (\n <>\n <Box css={styles.linkIconBlock}>\n <Icon css={styles.linkIcon} />\n {status && <Box css={styles.linkStatusDot} data-status={status} />}\n </Box>\n <Box css={styles.linkTextBlock}>\n <Text as=\"span\" css={styles.linkLabel}>\n {children}\n </Text>\n {secondaryText && (\n <Text as=\"span\" css={styles.linkSecondaryText}>\n {secondaryText}\n </Text>\n )}\n </Box>\n {isExternal && <IconArrowNortheast css={styles.linkIcon} />}\n </>\n );\n\n const rootProps = {\n 'data-with-secondary': secondaryText ? '' : undefined,\n ...rest,\n css: [styles.link, css],\n };\n\n // `chakra.button` / `chakra.a` rather than `Button` / `Link`: the row is styled entirely by the\n // nav's own `link` slot, and either named primitive would layer its own recipe over it.\n if (href === undefined) {\n return (\n <chakra.button ref={ref as Ref<HTMLButtonElement>} type=\"button\" {...(rootProps as HTMLChakraProps<'button'>)}>\n {content}\n </chakra.button>\n );\n }\n\n return (\n <chakra.a\n ref={ref as Ref<HTMLAnchorElement>}\n href={href}\n rel={isExternal ? (rel ? `${rel} noreferrer noopener` : 'noreferrer noopener') : rel}\n target={isExternal ? '_blank' : target}\n {...rootProps}\n >\n {content}\n </chakra.a>\n );\n});\n\nUISideNavLink.displayName = 'BitkitUISideNav.Link';\n\nexport default UISideNavLink;\n"],"mappings":";;;;;;;;AAwCA,IAAM,gBAAgB,YAA6E,OAAO,QAAQ;CAChH,MAAM,EACJ,UACA,KACA,MACA,MAAM,MACN,YACA,KACA,eACA,QACA,QACA,GAAG,SACD;CAEJ,MAAM,EAAE,WAAW,oBAAoB;CAEvC,MAAM,UACJ,qBAAA,YAAA,EAAA,UAAA;EACE,qBAAC,KAAD;GAAK,KAAK,OAAO;GAAjB,UAAA,CACE,oBAAC,MAAD,EAAM,KAAK,OAAO,SAAW,CAAA,GAC5B,UAAU,oBAAC,KAAD;IAAK,KAAK,OAAO;IAAe,eAAa;GAAS,CAAA,CAC9D;;EACL,qBAAC,KAAD;GAAK,KAAK,OAAO;GAAjB,UAAA,CACE,oBAAC,MAAD;IAAM,IAAG;IAAO,KAAK,OAAO;IACzB;GACG,CAAA,GACL,iBACC,oBAAC,MAAD;IAAM,IAAG;IAAO,KAAK,OAAO;IACzB,UAAA;GACG,CAAA,CAEL;;EACJ,cAAc,oBAAC,oBAAD,EAAoB,KAAK,OAAO,SAAW,CAAA;CAC1D,EAAA,CAAA;CAGJ,MAAM,YAAY;EAChB,uBAAuB,gBAAgB,KAAK,KAAA;EAC5C,GAAG;EACH,KAAK,CAAC,OAAO,MAAM,GAAG;CACxB;CAIA,IAAI,SAAS,KAAA,GACX,OACE,oBAAC,OAAO,QAAR;EAAoB;EAA+B,MAAK;EAAS,GAAK;EACnE,UAAA;CACY,CAAA;CAInB,OACE,oBAAC,OAAO,GAAR;EACO;EACC;EACN,KAAK,aAAc,MAAM,GAAG,IAAI,wBAAwB,wBAAyB;EACjF,QAAQ,aAAa,WAAW;EAChC,GAAI;EAEH,UAAA;CACO,CAAA;AAEd,CAAC;AAED,cAAc,cAAc"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Select, SelectTriggerProps } from '@chakra-ui/react/select';
|
|
2
|
+
import { BitkitSelectMenuEmptyStateProps, BitkitSelectMenuErrorStateProps, BitkitSelectMenuItemProps, BitkitSelectMenuScrollProps, BitkitSelectMenuSearchProps } from '../BitkitSelectMenu/BitkitSelectMenu';
|
|
3
|
+
import { BitkitSelectMenuActionChild } from '../BitkitSelectMenu/BitkitSelectMenuAction';
|
|
4
|
+
export type BitkitUISideNavWorkspaceProps = Pick<BitkitSelectMenuItemProps, 'label' | 'value'> & {
|
|
5
|
+
/**
|
|
6
|
+
* The workspace's logo. Leave it off and the avatar falls back to the initials of `label` —
|
|
7
|
+
* a workspace always has one, unlike a plain menu item.
|
|
8
|
+
*/
|
|
9
|
+
avatar?: string;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* The list length at which the design adds the search input. Below it the menu is short enough
|
|
13
|
+
* to read at a glance and a search field would only be in the way. Exported for the stories,
|
|
14
|
+
* which label each list by the side of this it falls on — not part of the package's surface.
|
|
15
|
+
*/
|
|
16
|
+
export declare const searchableFrom = 6;
|
|
17
|
+
export type BitkitUISideNavWorkspaceSelectorProps = Omit<SelectTriggerProps, 'children' | 'onChange'> & {
|
|
18
|
+
/**
|
|
19
|
+
* A single `BitkitSelectMenuAction` shown under the list, typically "Create workspace". Its
|
|
20
|
+
* presence is the toggle — there is no boolean for it.
|
|
21
|
+
*/
|
|
22
|
+
children?: BitkitSelectMenuActionChild;
|
|
23
|
+
isLoading?: boolean;
|
|
24
|
+
/** The small uppercase caption above the workspace name. */
|
|
25
|
+
label?: string;
|
|
26
|
+
onValueChange?: (value: string) => void;
|
|
27
|
+
/** The selected workspace's `value`. Leave it off to let the selector track the choice itself. */
|
|
28
|
+
value?: string;
|
|
29
|
+
workspaces: Array<BitkitUISideNavWorkspaceProps>;
|
|
30
|
+
} & Omit<BitkitSelectMenuSearchProps, 'searchPlaceholder'> & BitkitSelectMenuScrollProps & BitkitSelectMenuEmptyStateProps & BitkitSelectMenuErrorStateProps;
|
|
31
|
+
declare const UISideNavWorkspaceSelector: import('react').ForwardRefExoticComponent<Omit<Select.TriggerProps, "children" | "onChange"> & {
|
|
32
|
+
/**
|
|
33
|
+
* A single `BitkitSelectMenuAction` shown under the list, typically "Create workspace". Its
|
|
34
|
+
* presence is the toggle — there is no boolean for it.
|
|
35
|
+
*/
|
|
36
|
+
children?: BitkitSelectMenuActionChild;
|
|
37
|
+
isLoading?: boolean;
|
|
38
|
+
/** The small uppercase caption above the workspace name. */
|
|
39
|
+
label?: string;
|
|
40
|
+
onValueChange?: (value: string) => void;
|
|
41
|
+
/** The selected workspace's `value`. Leave it off to let the selector track the choice itself. */
|
|
42
|
+
value?: string;
|
|
43
|
+
workspaces: Array<BitkitUISideNavWorkspaceProps>;
|
|
44
|
+
} & Omit<BitkitSelectMenuSearchProps, "searchPlaceholder"> & BitkitSelectMenuScrollProps & BitkitSelectMenuEmptyStateProps & BitkitSelectMenuErrorStateProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
45
|
+
export default UISideNavWorkspaceSelector;
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import IconChevronDown from "../../icons/IconChevronDown.js";
|
|
2
|
+
import BitkitAvatar from "../BitkitAvatar/BitkitAvatar.js";
|
|
3
|
+
import BitkitSelectMenu from "../BitkitSelectMenu/BitkitSelectMenu.js";
|
|
4
|
+
import { useUISideNavContext } from "./UISideNavContext.js";
|
|
5
|
+
import { Box } from "@chakra-ui/react/box";
|
|
6
|
+
import { forwardRef, useMemo, useRef, useState } from "react";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { Portal } from "@chakra-ui/react/portal";
|
|
9
|
+
import { Text } from "@chakra-ui/react/text";
|
|
10
|
+
import { useControllableState } from "@chakra-ui/react/hooks";
|
|
11
|
+
import { createListCollection } from "@chakra-ui/react/collection";
|
|
12
|
+
import { Select } from "@chakra-ui/react/select";
|
|
13
|
+
import { useFilter } from "@chakra-ui/react/locale";
|
|
14
|
+
var UISideNavWorkspaceSelector = forwardRef((props, ref) => {
|
|
15
|
+
const { children, css, emptyHelperText, emptyLabel, errorHelperText, errorLabel, isLoading, label = "Workspace", onScrolledToBottom, onSearchChange, onValueChange, searchValue, value, workspaces, ...rest } = props;
|
|
16
|
+
const { isMobile, menuContainerRef, setMenuOpen, styles } = useUISideNavContext();
|
|
17
|
+
const { contains } = useFilter({ sensitivity: "base" });
|
|
18
|
+
const [ownQuery, setOwnQuery] = useState("");
|
|
19
|
+
const [currentValue, setCurrentValue] = useControllableState({
|
|
20
|
+
defaultValue: void 0,
|
|
21
|
+
value
|
|
22
|
+
});
|
|
23
|
+
const isSearchDelegated = onSearchChange !== void 0;
|
|
24
|
+
const query = isSearchDelegated ? searchValue : ownQuery;
|
|
25
|
+
const hasSearch = isSearchDelegated || workspaces.length >= 6;
|
|
26
|
+
const collection = useMemo(() => {
|
|
27
|
+
const items = (ownQuery ? workspaces.filter((workspace) => contains(workspace.label, ownQuery)) : workspaces).map((workspace) => ({
|
|
28
|
+
...workspace,
|
|
29
|
+
avatar: workspace.avatar ?? null
|
|
30
|
+
}));
|
|
31
|
+
return createListCollection({ items });
|
|
32
|
+
}, [
|
|
33
|
+
contains,
|
|
34
|
+
ownQuery,
|
|
35
|
+
workspaces
|
|
36
|
+
]);
|
|
37
|
+
const lastSelected = useRef(void 0);
|
|
38
|
+
const matched = workspaces.find((workspace) => workspace.value === currentValue);
|
|
39
|
+
if (matched) lastSelected.current = matched;
|
|
40
|
+
const selected = matched ?? (lastSelected.current?.value === currentValue ? lastSelected.current : void 0);
|
|
41
|
+
return /* @__PURE__ */ jsxs(Select.Root, {
|
|
42
|
+
collection,
|
|
43
|
+
css: styles.workspaceRoot,
|
|
44
|
+
onOpenChange: (details) => {
|
|
45
|
+
setMenuOpen(details.open);
|
|
46
|
+
if (!details.open) setOwnQuery("");
|
|
47
|
+
},
|
|
48
|
+
onValueChange: (details) => {
|
|
49
|
+
setCurrentValue(details.value[0]);
|
|
50
|
+
onValueChange?.(details.value[0]);
|
|
51
|
+
},
|
|
52
|
+
positioning: isMobile ? {
|
|
53
|
+
gutter: 0,
|
|
54
|
+
offset: { crossAxis: 16 },
|
|
55
|
+
overflowPadding: 16
|
|
56
|
+
} : {
|
|
57
|
+
gutter: -8,
|
|
58
|
+
offset: { crossAxis: 16 },
|
|
59
|
+
placement: "bottom-start"
|
|
60
|
+
},
|
|
61
|
+
size: "lg",
|
|
62
|
+
value: currentValue === void 0 ? [] : [currentValue],
|
|
63
|
+
children: [/* @__PURE__ */ jsxs(Select.Control, {
|
|
64
|
+
css: styles.workspaceControl,
|
|
65
|
+
children: [/* @__PURE__ */ jsx(Select.HiddenSelect, {}), /* @__PURE__ */ jsxs(Select.Trigger, {
|
|
66
|
+
ref,
|
|
67
|
+
unstyled: true,
|
|
68
|
+
...rest,
|
|
69
|
+
css: [styles.workspace, css],
|
|
70
|
+
children: [
|
|
71
|
+
/* @__PURE__ */ jsx(BitkitAvatar, {
|
|
72
|
+
borderColor: "border/minimal",
|
|
73
|
+
borderWidth: "1",
|
|
74
|
+
name: selected?.label ?? "",
|
|
75
|
+
size: "40",
|
|
76
|
+
src: selected?.avatar ?? "",
|
|
77
|
+
variant: "image"
|
|
78
|
+
}),
|
|
79
|
+
/* @__PURE__ */ jsxs(Box, {
|
|
80
|
+
css: styles.workspaceTextBlock,
|
|
81
|
+
children: [/* @__PURE__ */ jsx(Text, {
|
|
82
|
+
css: styles.workspaceLabel,
|
|
83
|
+
children: label
|
|
84
|
+
}), /* @__PURE__ */ jsx(Text, {
|
|
85
|
+
css: styles.workspaceValue,
|
|
86
|
+
children: selected?.label
|
|
87
|
+
})]
|
|
88
|
+
}),
|
|
89
|
+
/* @__PURE__ */ jsx(Select.Indicator, {
|
|
90
|
+
css: styles.workspaceChevron,
|
|
91
|
+
children: /* @__PURE__ */ jsx(IconChevronDown, {})
|
|
92
|
+
})
|
|
93
|
+
]
|
|
94
|
+
})]
|
|
95
|
+
}), /* @__PURE__ */ jsx(Portal, {
|
|
96
|
+
container: isMobile ? menuContainerRef : void 0,
|
|
97
|
+
children: /* @__PURE__ */ jsx(Select.Positioner, { children: /* @__PURE__ */ jsx(BitkitSelectMenu, {
|
|
98
|
+
collection,
|
|
99
|
+
contentProps: { css: styles.workspaceMenu },
|
|
100
|
+
emptyHelperText,
|
|
101
|
+
emptyLabel,
|
|
102
|
+
errorHelperText,
|
|
103
|
+
errorLabel,
|
|
104
|
+
isLoading,
|
|
105
|
+
onScrolledToBottom,
|
|
106
|
+
onSearchChange: hasSearch ? onSearchChange ?? setOwnQuery : void 0,
|
|
107
|
+
searchPlaceholder: "Search your workspaces",
|
|
108
|
+
searchValue: query,
|
|
109
|
+
size: "lg",
|
|
110
|
+
children
|
|
111
|
+
}) })
|
|
112
|
+
})]
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
UISideNavWorkspaceSelector.displayName = "BitkitUISideNav.WorkspaceSelector";
|
|
116
|
+
//#endregion
|
|
117
|
+
export { UISideNavWorkspaceSelector as default };
|
|
118
|
+
|
|
119
|
+
//# sourceMappingURL=UISideNavWorkspaceSelector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UISideNavWorkspaceSelector.js","names":[],"sources":["../../../lib/components/BitkitUISideNav/UISideNavWorkspaceSelector.tsx"],"sourcesContent":["import { Box } from '@chakra-ui/react/box';\nimport { createListCollection } from '@chakra-ui/react/collection';\nimport { useControllableState } from '@chakra-ui/react/hooks';\nimport { useFilter } from '@chakra-ui/react/locale';\nimport { Portal } from '@chakra-ui/react/portal';\nimport { Select, type SelectTriggerProps } from '@chakra-ui/react/select';\nimport { Text } from '@chakra-ui/react/text';\nimport { forwardRef, useMemo, useRef, useState } from 'react';\n\nimport { IconChevronDown } from '../../icons';\nimport BitkitAvatar from '../BitkitAvatar/BitkitAvatar';\nimport BitkitSelectMenu, {\n type BitkitSelectMenuEmptyStateProps,\n type BitkitSelectMenuErrorStateProps,\n type BitkitSelectMenuItemProps,\n type BitkitSelectMenuScrollProps,\n type BitkitSelectMenuSearchProps,\n} from '../BitkitSelectMenu/BitkitSelectMenu';\nimport { type BitkitSelectMenuActionChild } from '../BitkitSelectMenu/BitkitSelectMenuAction';\nimport { useUISideNavContext } from './UISideNavContext';\n\nexport type BitkitUISideNavWorkspaceProps = Pick<BitkitSelectMenuItemProps, 'label' | 'value'> & {\n /**\n * The workspace's logo. Leave it off and the avatar falls back to the initials of `label` —\n * a workspace always has one, unlike a plain menu item.\n */\n avatar?: string;\n};\n\n/**\n * The list length at which the design adds the search input. Below it the menu is short enough\n * to read at a glance and a search field would only be in the way. Exported for the stories,\n * which label each list by the side of this it falls on — not part of the package's surface.\n */\nexport const searchableFrom = 6;\n\nexport type BitkitUISideNavWorkspaceSelectorProps = Omit<SelectTriggerProps, 'children' | 'onChange'> & {\n /**\n * A single `BitkitSelectMenuAction` shown under the list, typically \"Create workspace\". Its\n * presence is the toggle — there is no boolean for it.\n */\n children?: BitkitSelectMenuActionChild;\n isLoading?: boolean;\n /** The small uppercase caption above the workspace name. */\n label?: string;\n onValueChange?: (value: string) => void;\n /** The selected workspace's `value`. Leave it off to let the selector track the choice itself. */\n value?: string;\n workspaces: Array<BitkitUISideNavWorkspaceProps>;\n // The copy is the design's, not the consumer's, so the placeholder is not on the way through.\n} & Omit<BitkitSelectMenuSearchProps, 'searchPlaceholder'> &\n BitkitSelectMenuScrollProps &\n BitkitSelectMenuEmptyStateProps &\n BitkitSelectMenuErrorStateProps;\n\nconst UISideNavWorkspaceSelector = forwardRef<HTMLButtonElement, BitkitUISideNavWorkspaceSelectorProps>(\n (props, ref) => {\n const {\n children,\n css,\n emptyHelperText,\n emptyLabel,\n errorHelperText,\n errorLabel,\n isLoading,\n label = 'Workspace',\n onScrolledToBottom,\n onSearchChange,\n onValueChange,\n searchValue,\n value,\n workspaces,\n ...rest\n } = props;\n\n const { isMobile, menuContainerRef, setMenuOpen, styles } = useUISideNavContext();\n const { contains } = useFilter({ sensitivity: 'base' });\n\n const [ownQuery, setOwnQuery] = useState('');\n const [currentValue, setCurrentValue] = useControllableState<string | undefined>({\n defaultValue: undefined,\n value,\n });\n\n // A consumer that passes `onSearchChange` is searching somewhere we cannot see — a server, a\n // paged list — so `workspaces` is already the result and its length says nothing about how\n // many there are. They keep the input and the filtering; otherwise both are ours.\n const isSearchDelegated = onSearchChange !== undefined;\n const query = isSearchDelegated ? searchValue : ownQuery;\n const hasSearch = isSearchDelegated || workspaces.length >= searchableFrom;\n\n const collection = useMemo(() => {\n const matches = ownQuery ? workspaces.filter((workspace) => contains(workspace.label, ownQuery)) : workspaces;\n\n // `null` rather than nothing for a workspace without a logo: that is what tells the menu to\n // draw the initials, where an absent `avatar` would leave the row with no avatar at all.\n const items: Array<BitkitSelectMenuItemProps> = matches.map((workspace) => ({\n ...workspace,\n avatar: workspace.avatar ?? null,\n }));\n\n return createListCollection({ items });\n }, [contains, ownQuery, workspaces]);\n\n // `workspaces` is the search result while the search is delegated, so the selected workspace\n // can drop out of it mid-query. The cell keeps naming the workspace you are actually in.\n const lastSelected = useRef<BitkitUISideNavWorkspaceProps>(undefined);\n const matched = workspaces.find((workspace) => workspace.value === currentValue);\n if (matched) lastSelected.current = matched;\n const selected = matched ?? (lastSelected.current?.value === currentValue ? lastSelected.current : undefined);\n\n return (\n <Select.Root\n collection={collection}\n css={styles.workspaceRoot}\n onOpenChange={(details) => {\n setMenuOpen(details.open);\n if (!details.open) setOwnQuery('');\n }}\n onValueChange={(details) => {\n setCurrentValue(details.value[0]);\n onValueChange?.(details.value[0]);\n }}\n // Tucked into the rail rather than hung off it: inset from the rail's edge and lapping\n // over the workspace cell, so the menu reads as the cell unfolding.\n positioning={\n isMobile\n ? { gutter: 0, offset: { crossAxis: 16 }, overflowPadding: 16 }\n : { gutter: -8, offset: { crossAxis: 16 }, placement: 'bottom-start' }\n }\n size=\"lg\"\n value={currentValue === undefined ? [] : [currentValue]}\n >\n <Select.Control css={styles.workspaceControl}>\n <Select.HiddenSelect />\n <Select.Trigger ref={ref} unstyled {...rest} css={[styles.workspace, css]}>\n <BitkitAvatar\n borderColor=\"border/minimal\"\n borderWidth=\"1\"\n name={selected?.label ?? ''}\n size=\"40\"\n src={selected?.avatar ?? ''}\n variant=\"image\"\n />\n <Box css={styles.workspaceTextBlock}>\n <Text css={styles.workspaceLabel}>{label}</Text>\n <Text css={styles.workspaceValue}>{selected?.label}</Text>\n </Box>\n <Select.Indicator css={styles.workspaceChevron}>\n <IconChevronDown />\n </Select.Indicator>\n </Select.Trigger>\n </Select.Control>\n {/*\n In the drawer the menu goes to the panel rather than the document: the panel scrolls\n under its own header, so a menu left in the flow would travel with the rows and be\n clipped by them, and anywhere outside the panel is outside the dialog's focus trap.\n */}\n <Portal container={isMobile ? menuContainerRef : undefined}>\n <Select.Positioner>\n <BitkitSelectMenu\n collection={collection}\n contentProps={{ css: styles.workspaceMenu }}\n emptyHelperText={emptyHelperText}\n emptyLabel={emptyLabel}\n errorHelperText={errorHelperText}\n errorLabel={errorLabel}\n isLoading={isLoading}\n onScrolledToBottom={onScrolledToBottom}\n onSearchChange={hasSearch ? (onSearchChange ?? setOwnQuery) : undefined}\n searchPlaceholder=\"Search your workspaces\"\n searchValue={query}\n size=\"lg\"\n >\n {children}\n </BitkitSelectMenu>\n </Select.Positioner>\n </Portal>\n </Select.Root>\n );\n },\n);\n\nUISideNavWorkspaceSelector.displayName = 'BitkitUISideNav.WorkspaceSelector';\n\nexport default UISideNavWorkspaceSelector;\n"],"mappings":";;;;;;;;;;;;;AAuDA,IAAM,6BAA6B,YAChC,OAAO,QAAQ;CACd,MAAM,EACJ,UACA,KACA,iBACA,YACA,iBACA,YACA,WACA,QAAQ,aACR,oBACA,gBACA,eACA,aACA,OACA,YACA,GAAG,SACD;CAEJ,MAAM,EAAE,UAAU,kBAAkB,aAAa,WAAW,oBAAoB;CAChF,MAAM,EAAE,aAAa,UAAU,EAAE,aAAa,OAAO,CAAC;CAEtD,MAAM,CAAC,UAAU,eAAe,SAAS,EAAE;CAC3C,MAAM,CAAC,cAAc,mBAAmB,qBAAyC;EAC/E,cAAc,KAAA;EACd;CACF,CAAC;CAKD,MAAM,oBAAoB,mBAAmB,KAAA;CAC7C,MAAM,QAAQ,oBAAoB,cAAc;CAChD,MAAM,YAAY,qBAAqB,WAAW,UAAA;CAElD,MAAM,aAAa,cAAc;EAK/B,MAAM,SAJU,WAAW,WAAW,QAAQ,cAAc,SAAS,UAAU,OAAO,QAAQ,CAAC,IAAI,WAAA,CAI3C,KAAK,eAAe;GAC1E,GAAG;GACH,QAAQ,UAAU,UAAU;EAC9B,EAAE;EAEF,OAAO,qBAAqB,EAAE,MAAM,CAAC;CACvC,GAAG;EAAC;EAAU;EAAU;CAAU,CAAC;CAInC,MAAM,eAAe,OAAsC,KAAA,CAAS;CACpE,MAAM,UAAU,WAAW,MAAM,cAAc,UAAU,UAAU,YAAY;CAC/E,IAAI,SAAS,aAAa,UAAU;CACpC,MAAM,WAAW,YAAY,aAAa,SAAS,UAAU,eAAe,aAAa,UAAU,KAAA;CAEnG,OACE,qBAAC,OAAO,MAAR;EACc;EACZ,KAAK,OAAO;EACZ,eAAe,YAAY;GACzB,YAAY,QAAQ,IAAI;GACxB,IAAI,CAAC,QAAQ,MAAM,YAAY,EAAE;EACnC;EACA,gBAAgB,YAAY;GAC1B,gBAAgB,QAAQ,MAAM,EAAE;GAChC,gBAAgB,QAAQ,MAAM,EAAE;EAClC;EAGA,aACE,WACI;GAAE,QAAQ;GAAG,QAAQ,EAAE,WAAW,GAAG;GAAG,iBAAiB;EAAG,IAC5D;GAAE,QAAQ;GAAI,QAAQ,EAAE,WAAW,GAAG;GAAG,WAAW;EAAe;EAEzE,MAAK;EACL,OAAO,iBAAiB,KAAA,IAAY,CAAC,IAAI,CAAC,YAAY;EAnBxD,UAAA,CAqBE,qBAAC,OAAO,SAAR;GAAgB,KAAK,OAAO;GAA5B,UAAA,CACE,oBAAC,OAAO,cAAR,CAAsB,CAAA,GACtB,qBAAC,OAAO,SAAR;IAAqB;IAAK,UAAA;IAAS,GAAI;IAAM,KAAK,CAAC,OAAO,WAAW,GAAG;IAAxE,UAAA;KACE,oBAAC,cAAD;MACE,aAAY;MACZ,aAAY;MACZ,MAAM,UAAU,SAAS;MACzB,MAAK;MACL,KAAK,UAAU,UAAU;MACzB,SAAQ;KACT,CAAA;KACD,qBAAC,KAAD;MAAK,KAAK,OAAO;MAAjB,UAAA,CACE,oBAAC,MAAD;OAAM,KAAK,OAAO;OAAiB,UAAA;MAAY,CAAA,GAC/C,oBAAC,MAAD;OAAM,KAAK,OAAO;OAAiB,UAAA,UAAU;MAAY,CAAA,CACtD;;KACL,oBAAC,OAAO,WAAR;MAAkB,KAAK,OAAO;MAC5B,UAAA,oBAAC,iBAAD,CAAkB,CAAA;KACF,CAAA;IACJ;GACF,CAAA,CAAA;EAMhB,CAAA,GAAA,oBAAC,QAAD;GAAQ,WAAW,WAAW,mBAAmB,KAAA;GAC/C,UAAA,oBAAC,OAAO,YAAR,EAAA,UACE,oBAAC,kBAAD;IACc;IACZ,cAAc,EAAE,KAAK,OAAO,cAAc;IACzB;IACL;IACK;IACL;IACD;IACS;IACpB,gBAAgB,YAAa,kBAAkB,cAAe,KAAA;IAC9D,mBAAkB;IAClB,aAAa;IACb,MAAK;IAEJ;GACe,CAAA,EACD,CAAA;EACb,CAAA,CACG;;AAEjB,CACF;AAEA,2BAA2B,cAAc"}
|
|
@@ -93,3 +93,5 @@ export { default as BitkitToggleButton, type BitkitToggleButtonProps } from './B
|
|
|
93
93
|
export { default as BitkitTooltip, type BitkitTooltipProps } from './BitkitTooltip/BitkitTooltip';
|
|
94
94
|
export { default as BitkitTour, type BitkitTourInstance, type BitkitTourOptions, type BitkitTourProps, type BitkitTourSecondaryAction, type BitkitTourStep, useBitkitTour, } from './BitkitTour/BitkitTour';
|
|
95
95
|
export { default as BitkitTreeView, type BitkitTreeViewBranchProps, type BitkitTreeViewExpandedChangeDetails, type BitkitTreeViewLeafProps, type BitkitTreeViewNodeRenderProps, type BitkitTreeViewRootProps, type BitkitTreeViewSelectionChangeDetails, createTreeCollection, } from './BitkitTreeView/BitkitTreeView';
|
|
96
|
+
export { default as BitkitUISideNav, type BitkitUISideNavBodyProps, type BitkitUISideNavFooterHeadingProps, type BitkitUISideNavFooterProps, type BitkitUISideNavItemProps, type BitkitUISideNavLinkAsAnchorProps, type BitkitUISideNavLinkAsButtonProps, type BitkitUISideNavLinkProps, type BitkitUISideNavProps, type BitkitUISideNavWorkspaceProps, type BitkitUISideNavWorkspaceSelectorProps, uiSideNavRailWidth, } from './BitkitUISideNav/BitkitUISideNav';
|
|
97
|
+
export { useUISideNav } from './BitkitUISideNav/UISideNavContext';
|