@knkcs/anker 1.7.0 → 1.8.0
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/index.d.ts +11 -3
- package/dist/components/index.js +167 -75
- package/dist/components/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -575,7 +575,14 @@ declare const SelectableCard: {
|
|
|
575
575
|
};
|
|
576
576
|
};
|
|
577
577
|
|
|
578
|
+
interface SidebarContextValue {
|
|
579
|
+
collapsed: boolean;
|
|
580
|
+
toggle: () => void;
|
|
581
|
+
}
|
|
582
|
+
declare function useSidebarContext(): SidebarContextValue;
|
|
578
583
|
interface SidebarProps {
|
|
584
|
+
storageKey?: string;
|
|
585
|
+
defaultCollapsed?: boolean;
|
|
579
586
|
children: React__default.ReactNode;
|
|
580
587
|
}
|
|
581
588
|
interface SidebarLogoProps {
|
|
@@ -591,6 +598,7 @@ interface SidebarItemProps {
|
|
|
591
598
|
children: React__default.ReactNode;
|
|
592
599
|
asChild?: boolean;
|
|
593
600
|
active?: boolean;
|
|
601
|
+
label?: string;
|
|
594
602
|
}
|
|
595
603
|
interface SidebarUserMenuProps {
|
|
596
604
|
user: {
|
|
@@ -605,7 +613,7 @@ interface SidebarUserMenuItemProps {
|
|
|
605
613
|
children: React__default.ReactNode;
|
|
606
614
|
}
|
|
607
615
|
declare const Sidebar: {
|
|
608
|
-
({ children }: SidebarProps): react_jsx_runtime.JSX.Element;
|
|
616
|
+
({ storageKey, defaultCollapsed, children, }: SidebarProps): react_jsx_runtime.JSX.Element;
|
|
609
617
|
displayName: string;
|
|
610
618
|
} & {
|
|
611
619
|
Header: {
|
|
@@ -641,7 +649,7 @@ declare const Sidebar: {
|
|
|
641
649
|
displayName: string;
|
|
642
650
|
};
|
|
643
651
|
Item: {
|
|
644
|
-
({ icon, children, asChild, active }: SidebarItemProps): react_jsx_runtime.JSX.Element;
|
|
652
|
+
({ icon, children, asChild, active, label, }: SidebarItemProps): react_jsx_runtime.JSX.Element;
|
|
645
653
|
displayName: string;
|
|
646
654
|
};
|
|
647
655
|
UserMenu: {
|
|
@@ -935,4 +943,4 @@ interface WidgetProps {
|
|
|
935
943
|
}
|
|
936
944
|
declare const Widget: React__default.FC<WidgetProps>;
|
|
937
945
|
|
|
938
|
-
export { ActionCell, type ActionCellAction, type ActionCellProps, AuthCard, type AuthCardProps, BooleanCell, type BooleanCellProps, BulkActionBar, type BulkActionBarProps, type BulkActionProps, type BulkPopoverActionProps, Card, CardList, CardListData, type CardListDataProps, CardListItem, type CardListItemProps, type CardListMenuItem, type CardListProps, type CardProps, ChipPicker, type ChipPickerProps, CodeCell, type CodeCellProps, ColorSwatchCell, type ColorSwatchCellProps, ContextRail, type ContextRailHeaderProps, type ContextRailProps, type ContextRailSectionProps, CountCell, type CountCellProps, DataTable, type DataTableProps, DateCell, type DateCellProps, type DrawerProps, DrawerRoot, FactBox, type FactBoxAction, type FactBoxProps, InlineCreatableList, type InlineCreatableListProps, LabeledSwitch, type LabeledSwitchProps, LinkCell, type LinkCellProps, MenuCell, type MenuCellAction, type MenuCellProps, Modal, type ModalProps, NumberCell, type NumberCellProps, PageHeader, type PageHeaderBreadcrumb, type PageHeaderProps, Pagination, type PaginationProps, SelectableCard, type SelectableCardBodyProps, type SelectableCardFooterProps, type SelectableCardProps, type SelectableCardThumbnailProps, Sidebar, type SidebarItemProps, type SidebarLogoProps, type SidebarSectionProps$1 as SidebarNavSectionProps, type SidebarProps, SidebarSection, type SidebarSectionProps, type SidebarUserMenuItemProps, type SidebarUserMenuProps, SlugCell, type SlugCellProps, StatusBadgeCell, type StatusBadgeCellProps, Stepper, StepperCompleted, StepperContainer, StepperContent, type StepperContentProps, StepperIcon, type StepperIconProps, type StepperProps, StepperProvider, StepperSeparator, type StepperSeparatorProps, StepperStep, type StepperStepProps, StepperStepTitle, StepperSteps, type StepperStepsProps, SwitchCell, type SwitchCellProps, CardList as Table, CardListData as TableData, type CardListDataProps as TableDataProps, CardListItem as TableItem, type CardListItemProps as TableItemProps, type CardListMenuItem as TableMenuItem, type CardListProps as TableProps, TimelineConnector, TimelineContent, TimelineDescription, TimelineIndicator, TimelineItem, type TimelineItemProps, TimelineRoot, type TimelineRootProps, TimelineSeparator, TimelineTitle, Toolbar, type ToolbarFilterChipProps, type ToolbarSearchProps, TreeViewBranch, TreeViewBranchContent, TreeViewBranchControl, TreeViewBranchIndicator, type TreeViewBranchProps, TreeViewBranchText, TreeViewBranchTrigger, TreeViewItem, TreeViewItemIndicator, type TreeViewItemProps, TreeViewItemText, TreeViewLabel, TreeViewNode, TreeViewRoot, type TreeViewRootProps, TreeViewTree, TruncatedTextCell, type TruncatedTextCellProps, UploadDropZone, type UploadDropZoneProps, UrlCell, type UrlCellProps, type UseStepProps, type UseStepperProps, type UseStepperReturn, Widget, type WidgetProps, emptyCellValue, pluralize, truncateText, useStep, useStepper, useStepperContext, useStepperNextButton, useStepperPrevButton };
|
|
946
|
+
export { ActionCell, type ActionCellAction, type ActionCellProps, AuthCard, type AuthCardProps, BooleanCell, type BooleanCellProps, BulkActionBar, type BulkActionBarProps, type BulkActionProps, type BulkPopoverActionProps, Card, CardList, CardListData, type CardListDataProps, CardListItem, type CardListItemProps, type CardListMenuItem, type CardListProps, type CardProps, ChipPicker, type ChipPickerProps, CodeCell, type CodeCellProps, ColorSwatchCell, type ColorSwatchCellProps, ContextRail, type ContextRailHeaderProps, type ContextRailProps, type ContextRailSectionProps, CountCell, type CountCellProps, DataTable, type DataTableProps, DateCell, type DateCellProps, type DrawerProps, DrawerRoot, FactBox, type FactBoxAction, type FactBoxProps, InlineCreatableList, type InlineCreatableListProps, LabeledSwitch, type LabeledSwitchProps, LinkCell, type LinkCellProps, MenuCell, type MenuCellAction, type MenuCellProps, Modal, type ModalProps, NumberCell, type NumberCellProps, PageHeader, type PageHeaderBreadcrumb, type PageHeaderProps, Pagination, type PaginationProps, SelectableCard, type SelectableCardBodyProps, type SelectableCardFooterProps, type SelectableCardProps, type SelectableCardThumbnailProps, Sidebar, type SidebarItemProps, type SidebarLogoProps, type SidebarSectionProps$1 as SidebarNavSectionProps, type SidebarProps, SidebarSection, type SidebarSectionProps, type SidebarUserMenuItemProps, type SidebarUserMenuProps, SlugCell, type SlugCellProps, StatusBadgeCell, type StatusBadgeCellProps, Stepper, StepperCompleted, StepperContainer, StepperContent, type StepperContentProps, StepperIcon, type StepperIconProps, type StepperProps, StepperProvider, StepperSeparator, type StepperSeparatorProps, StepperStep, type StepperStepProps, StepperStepTitle, StepperSteps, type StepperStepsProps, SwitchCell, type SwitchCellProps, CardList as Table, CardListData as TableData, type CardListDataProps as TableDataProps, CardListItem as TableItem, type CardListItemProps as TableItemProps, type CardListMenuItem as TableMenuItem, type CardListProps as TableProps, TimelineConnector, TimelineContent, TimelineDescription, TimelineIndicator, TimelineItem, type TimelineItemProps, TimelineRoot, type TimelineRootProps, TimelineSeparator, TimelineTitle, Toolbar, type ToolbarFilterChipProps, type ToolbarSearchProps, TreeViewBranch, TreeViewBranchContent, TreeViewBranchControl, TreeViewBranchIndicator, type TreeViewBranchProps, TreeViewBranchText, TreeViewBranchTrigger, TreeViewItem, TreeViewItemIndicator, type TreeViewItemProps, TreeViewItemText, TreeViewLabel, TreeViewNode, TreeViewRoot, type TreeViewRootProps, TreeViewTree, TruncatedTextCell, type TruncatedTextCellProps, UploadDropZone, type UploadDropZoneProps, UrlCell, type UrlCellProps, type UseStepProps, type UseStepperProps, type UseStepperReturn, Widget, type WidgetProps, emptyCellValue, pluralize, truncateText, useSidebarContext, useStep, useStepper, useStepperContext, useStepperNextButton, useStepperPrevButton };
|
package/dist/components/index.js
CHANGED
|
@@ -6,10 +6,10 @@ import { text_input_default } from '../chunk-OU6H3KU4.js';
|
|
|
6
6
|
import { Button, IconButton } from '../chunk-JS7ZEZV3.js';
|
|
7
7
|
import { Box, Flex, Text, Heading, HStack, Grid, GridItem, Code, Link, VStack, Spacer, Stack } from '../chunk-G4QMIXLC.js';
|
|
8
8
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
9
|
-
import { PanelRightOpen, PanelRightClose, ChevronRight, Search, X, Ellipsis, Plus, ChevronLeft, ArrowUp, ArrowDown, ArrowUpDown, ChevronDown, Check, Upload } from 'lucide-react';
|
|
9
|
+
import { PanelRightOpen, PanelRightClose, ChevronRight, PanelLeftOpen, PanelLeftClose, Search, X, Ellipsis, Plus, ChevronLeft, ArrowUp, ArrowDown, ArrowUpDown, ChevronDown, Check, Upload } from 'lucide-react';
|
|
10
10
|
import { createContext, Timeline, TreeView, Card as Card$1, Menu, Portal, Checkbox, Drawer, ButtonGroup, Dialog, useSlotRecipe, chakra } from '@chakra-ui/react';
|
|
11
11
|
export { createTreeCollection } from '@chakra-ui/react';
|
|
12
|
-
import React3, { createContext as createContext$1, useState, useEffect,
|
|
12
|
+
import React3, { createContext as createContext$1, useState, useEffect, useMemo, Children, useRef, useCallback, useContext } from 'react';
|
|
13
13
|
import dayjs from 'dayjs';
|
|
14
14
|
import { Link as Link$1 } from 'react-router-dom';
|
|
15
15
|
import { useReactTable, getSortedRowModel, getCoreRowModel, flexRender } from '@tanstack/react-table';
|
|
@@ -1798,19 +1798,78 @@ SelectableCard.displayName = "SelectableCard";
|
|
|
1798
1798
|
SelectableCard.Thumbnail = SelectableCardThumbnail;
|
|
1799
1799
|
SelectableCard.Body = SelectableCardBody;
|
|
1800
1800
|
SelectableCard.Footer = SelectableCardFooter;
|
|
1801
|
-
var
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
borderRightWidth: "1px",
|
|
1810
|
-
borderRightColor: "border",
|
|
1811
|
-
children
|
|
1801
|
+
var COLLAPSED_WIDTH2 = "64px";
|
|
1802
|
+
var EXPANDED_WIDTH2 = "240px";
|
|
1803
|
+
var COLLAPSE_BREAKPOINT2 = 1440;
|
|
1804
|
+
var SidebarContext = React3.createContext(null);
|
|
1805
|
+
function useSidebarContext() {
|
|
1806
|
+
const ctx = React3.useContext(SidebarContext);
|
|
1807
|
+
if (!ctx) {
|
|
1808
|
+
throw new Error("useSidebarContext must be used inside <Sidebar>");
|
|
1812
1809
|
}
|
|
1813
|
-
|
|
1810
|
+
return ctx;
|
|
1811
|
+
}
|
|
1812
|
+
function getInitialCollapsed2(storageKey, defaultCollapsed) {
|
|
1813
|
+
if (typeof window === "undefined") return defaultCollapsed ?? false;
|
|
1814
|
+
if (storageKey) {
|
|
1815
|
+
const stored = window.localStorage.getItem(storageKey);
|
|
1816
|
+
if (stored === "true") return true;
|
|
1817
|
+
if (stored === "false") return false;
|
|
1818
|
+
}
|
|
1819
|
+
if (defaultCollapsed !== void 0) return defaultCollapsed;
|
|
1820
|
+
return window.innerWidth < COLLAPSE_BREAKPOINT2;
|
|
1821
|
+
}
|
|
1822
|
+
var SidebarRoot = ({
|
|
1823
|
+
storageKey,
|
|
1824
|
+
defaultCollapsed,
|
|
1825
|
+
children
|
|
1826
|
+
}) => {
|
|
1827
|
+
const [collapsed, setCollapsed] = useState(
|
|
1828
|
+
() => getInitialCollapsed2(storageKey, defaultCollapsed)
|
|
1829
|
+
);
|
|
1830
|
+
useEffect(() => {
|
|
1831
|
+
if (storageKey) {
|
|
1832
|
+
window.localStorage.setItem(storageKey, String(collapsed));
|
|
1833
|
+
}
|
|
1834
|
+
}, [collapsed, storageKey]);
|
|
1835
|
+
const ctx = useMemo(
|
|
1836
|
+
() => ({
|
|
1837
|
+
collapsed,
|
|
1838
|
+
toggle: () => setCollapsed((c) => !c)
|
|
1839
|
+
}),
|
|
1840
|
+
[collapsed]
|
|
1841
|
+
);
|
|
1842
|
+
return /* @__PURE__ */ jsx(SidebarContext.Provider, { value: ctx, children: /* @__PURE__ */ jsxs(
|
|
1843
|
+
Flex,
|
|
1844
|
+
{
|
|
1845
|
+
"data-testid": "sidebar",
|
|
1846
|
+
"data-collapsed": collapsed ? "true" : "false",
|
|
1847
|
+
direction: "column",
|
|
1848
|
+
w: collapsed ? COLLAPSED_WIDTH2 : EXPANDED_WIDTH2,
|
|
1849
|
+
minH: "100vh",
|
|
1850
|
+
bg: "bg-canvas",
|
|
1851
|
+
borderRightWidth: "1px",
|
|
1852
|
+
borderRightColor: "border",
|
|
1853
|
+
transition: "width 250ms ease-out",
|
|
1854
|
+
overflow: "hidden",
|
|
1855
|
+
position: "relative",
|
|
1856
|
+
children: [
|
|
1857
|
+
/* @__PURE__ */ jsx(Flex, { justify: "flex-end", px: "2", pt: "2", children: /* @__PURE__ */ jsx(
|
|
1858
|
+
IconButton,
|
|
1859
|
+
{
|
|
1860
|
+
"data-testid": "sidebar-toggle",
|
|
1861
|
+
"aria-label": collapsed ? "Expand sidebar" : "Collapse sidebar",
|
|
1862
|
+
variant: "ghost",
|
|
1863
|
+
size: "sm",
|
|
1864
|
+
onClick: () => setCollapsed((c) => !c),
|
|
1865
|
+
children: collapsed ? /* @__PURE__ */ jsx(PanelLeftOpen, { size: 16 }) : /* @__PURE__ */ jsx(PanelLeftClose, { size: 16 })
|
|
1866
|
+
}
|
|
1867
|
+
) }),
|
|
1868
|
+
children
|
|
1869
|
+
]
|
|
1870
|
+
}
|
|
1871
|
+
) });
|
|
1872
|
+
};
|
|
1814
1873
|
SidebarRoot.displayName = "Sidebar";
|
|
1815
1874
|
var SidebarHeader = ({ children }) => /* @__PURE__ */ jsx(Box, { p: "4", borderBottomWidth: "1px", borderBottomColor: "border", children });
|
|
1816
1875
|
SidebarHeader.displayName = "Sidebar.Header";
|
|
@@ -1818,55 +1877,82 @@ var SidebarBody = ({ children }) => /* @__PURE__ */ jsx(Box, { flex: "1", overfl
|
|
|
1818
1877
|
SidebarBody.displayName = "Sidebar.Body";
|
|
1819
1878
|
var SidebarFooter = ({ children }) => /* @__PURE__ */ jsx(Box, { p: "3", borderTopWidth: "1px", borderTopColor: "border", children });
|
|
1820
1879
|
SidebarFooter.displayName = "Sidebar.Footer";
|
|
1821
|
-
var SidebarLogo = ({ wordmark, subtitle }) =>
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
{
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1880
|
+
var SidebarLogo = ({ wordmark, subtitle }) => {
|
|
1881
|
+
const { collapsed } = useSidebarContext();
|
|
1882
|
+
if (collapsed) {
|
|
1883
|
+
return /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(
|
|
1884
|
+
Heading,
|
|
1885
|
+
{
|
|
1886
|
+
as: "span",
|
|
1887
|
+
fontSize: "lg",
|
|
1888
|
+
fontWeight: "bold",
|
|
1889
|
+
color: "primary.700",
|
|
1890
|
+
letterSpacing: "tight",
|
|
1891
|
+
children: wordmark.charAt(0)
|
|
1892
|
+
}
|
|
1893
|
+
) });
|
|
1894
|
+
}
|
|
1895
|
+
return /* @__PURE__ */ jsxs(Box, { mb: subtitle ? "3" : "0", children: [
|
|
1896
|
+
/* @__PURE__ */ jsx(
|
|
1897
|
+
Heading,
|
|
1898
|
+
{
|
|
1899
|
+
as: "span",
|
|
1900
|
+
fontSize: "lg",
|
|
1901
|
+
fontWeight: "bold",
|
|
1902
|
+
color: "primary.700",
|
|
1903
|
+
letterSpacing: "tight",
|
|
1904
|
+
children: wordmark
|
|
1905
|
+
}
|
|
1906
|
+
),
|
|
1907
|
+
subtitle && /* @__PURE__ */ jsx(
|
|
1908
|
+
Text,
|
|
1909
|
+
{
|
|
1910
|
+
fontSize: "2xs",
|
|
1911
|
+
fontWeight: "semibold",
|
|
1912
|
+
letterSpacing: "wider",
|
|
1913
|
+
textTransform: "uppercase",
|
|
1914
|
+
color: "muted",
|
|
1915
|
+
mt: "0.5",
|
|
1916
|
+
children: subtitle
|
|
1917
|
+
}
|
|
1918
|
+
)
|
|
1919
|
+
] });
|
|
1920
|
+
};
|
|
1846
1921
|
SidebarLogo.displayName = "Sidebar.Logo";
|
|
1847
1922
|
var SidebarSlot = ({ children }) => /* @__PURE__ */ jsx(Box, { mt: "3", children });
|
|
1848
1923
|
SidebarSlot.displayName = "Sidebar.Slot";
|
|
1849
|
-
var SidebarSection = ({ label, children }) =>
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1924
|
+
var SidebarSection = ({ label, children }) => {
|
|
1925
|
+
const { collapsed } = useSidebarContext();
|
|
1926
|
+
return /* @__PURE__ */ jsxs(Box, { mb: "4", px: "3", children: [
|
|
1927
|
+
!collapsed && /* @__PURE__ */ jsx(
|
|
1928
|
+
Text,
|
|
1929
|
+
{
|
|
1930
|
+
fontSize: "2xs",
|
|
1931
|
+
fontWeight: "semibold",
|
|
1932
|
+
letterSpacing: "wider",
|
|
1933
|
+
textTransform: "uppercase",
|
|
1934
|
+
color: "muted",
|
|
1935
|
+
px: "2",
|
|
1936
|
+
mb: "1",
|
|
1937
|
+
children: label
|
|
1938
|
+
}
|
|
1939
|
+
),
|
|
1940
|
+
/* @__PURE__ */ jsx(Flex, { direction: "column", gap: "0.5", children })
|
|
1941
|
+
] });
|
|
1942
|
+
};
|
|
1865
1943
|
SidebarSection.displayName = "Sidebar.Section";
|
|
1866
|
-
var SidebarItem = ({
|
|
1944
|
+
var SidebarItem = ({
|
|
1945
|
+
icon,
|
|
1946
|
+
children,
|
|
1947
|
+
asChild,
|
|
1948
|
+
active,
|
|
1949
|
+
label
|
|
1950
|
+
}) => {
|
|
1951
|
+
const { collapsed } = useSidebarContext();
|
|
1867
1952
|
const itemStyle = {
|
|
1868
1953
|
display: "flex",
|
|
1869
1954
|
alignItems: "center",
|
|
1955
|
+
justifyContent: collapsed ? "center" : "flex-start",
|
|
1870
1956
|
gap: "var(--chakra-spacing-2)",
|
|
1871
1957
|
paddingInline: "var(--chakra-spacing-3)",
|
|
1872
1958
|
paddingBlock: "var(--chakra-spacing-2)",
|
|
@@ -1880,7 +1966,7 @@ var SidebarItem = ({ icon, children, asChild, active }) => {
|
|
|
1880
1966
|
textDecoration: "none"
|
|
1881
1967
|
};
|
|
1882
1968
|
const iconEl = icon ? /* @__PURE__ */ jsx(Box, { display: "inline-flex", alignItems: "center", flexShrink: 0, children: icon }) : null;
|
|
1883
|
-
const activeTab = active ? /* @__PURE__ */ jsx(
|
|
1969
|
+
const activeTab = active && !collapsed ? /* @__PURE__ */ jsx(
|
|
1884
1970
|
"span",
|
|
1885
1971
|
{
|
|
1886
1972
|
"aria-hidden": "true",
|
|
@@ -1894,9 +1980,11 @@ var SidebarItem = ({ icon, children, asChild, active }) => {
|
|
|
1894
1980
|
}
|
|
1895
1981
|
}
|
|
1896
1982
|
) : null;
|
|
1983
|
+
const tooltipLabel = label || (typeof children === "string" ? children : "");
|
|
1984
|
+
const wrapTooltip = (node) => collapsed && tooltipLabel ? /* @__PURE__ */ jsx(Tooltip, { content: tooltipLabel, positioning: { placement: "right" }, children: node }) : node;
|
|
1897
1985
|
if (asChild) {
|
|
1898
1986
|
const child = React3.Children.only(children);
|
|
1899
|
-
|
|
1987
|
+
const cloned = React3.cloneElement(
|
|
1900
1988
|
child,
|
|
1901
1989
|
{
|
|
1902
1990
|
"data-active": active ? "true" : "false",
|
|
@@ -1906,26 +1994,30 @@ var SidebarItem = ({ icon, children, asChild, active }) => {
|
|
|
1906
1994
|
}
|
|
1907
1995
|
},
|
|
1908
1996
|
iconEl,
|
|
1909
|
-
child.props.children,
|
|
1997
|
+
collapsed ? null : child.props.children,
|
|
1910
1998
|
activeTab
|
|
1911
1999
|
);
|
|
2000
|
+
return wrapTooltip(cloned);
|
|
1912
2001
|
}
|
|
1913
|
-
return
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
2002
|
+
return wrapTooltip(
|
|
2003
|
+
/* @__PURE__ */ jsxs(
|
|
2004
|
+
Box,
|
|
2005
|
+
{
|
|
2006
|
+
"data-testid": "sidebar-item",
|
|
2007
|
+
"data-active": active ? "true" : "false",
|
|
2008
|
+
style: itemStyle,
|
|
2009
|
+
children: [
|
|
2010
|
+
iconEl,
|
|
2011
|
+
!collapsed && children,
|
|
2012
|
+
activeTab
|
|
2013
|
+
]
|
|
2014
|
+
}
|
|
2015
|
+
)
|
|
1925
2016
|
);
|
|
1926
2017
|
};
|
|
1927
2018
|
SidebarItem.displayName = "Sidebar.Item";
|
|
1928
2019
|
var SidebarUserMenu = ({ user, children }) => {
|
|
2020
|
+
const { collapsed } = useSidebarContext();
|
|
1929
2021
|
const initials = (user.name ?? user.email ?? "").split(/\s+/).slice(0, 2).map((s) => s[0]?.toUpperCase() ?? "").join("");
|
|
1930
2022
|
return /* @__PURE__ */ jsxs(MenuRoot, { children: [
|
|
1931
2023
|
/* @__PURE__ */ jsx(MenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
@@ -1935,9 +2027,9 @@ var SidebarUserMenu = ({ user, children }) => {
|
|
|
1935
2027
|
variant: "ghost",
|
|
1936
2028
|
size: "md",
|
|
1937
2029
|
w: "full",
|
|
1938
|
-
justifyContent: "flex-start",
|
|
2030
|
+
justifyContent: collapsed ? "center" : "flex-start",
|
|
1939
2031
|
px: "2",
|
|
1940
|
-
children: /* @__PURE__ */ jsxs(Flex, { align: "center", gap: "2", w: "full", children: [
|
|
2032
|
+
children: /* @__PURE__ */ jsxs(Flex, { align: "center", gap: "2", w: collapsed ? "auto" : "full", children: [
|
|
1941
2033
|
/* @__PURE__ */ jsx(
|
|
1942
2034
|
Flex,
|
|
1943
2035
|
{
|
|
@@ -1954,7 +2046,7 @@ var SidebarUserMenu = ({ user, children }) => {
|
|
|
1954
2046
|
children: initials || "?"
|
|
1955
2047
|
}
|
|
1956
2048
|
),
|
|
1957
|
-
/* @__PURE__ */ jsxs(Box, { textAlign: "start", flex: "1", minW: "0", children: [
|
|
2049
|
+
!collapsed && /* @__PURE__ */ jsxs(Box, { textAlign: "start", flex: "1", minW: "0", children: [
|
|
1958
2050
|
/* @__PURE__ */ jsx(
|
|
1959
2051
|
Text,
|
|
1960
2052
|
{
|
|
@@ -2644,6 +2736,6 @@ var Widget = ({
|
|
|
2644
2736
|
};
|
|
2645
2737
|
Widget.displayName = "Widget";
|
|
2646
2738
|
|
|
2647
|
-
export { ActionCell, AuthCard, BooleanCell, BulkActionBar, Card, CardList, CardListData, CardListItem, ChipPicker, CodeCell, ColorSwatchCell, ContextRail, CountCell, DataTable, DateCell, DrawerRoot, FactBox, InlineCreatableList, LabeledSwitch, LinkCell, MenuCell, Modal, NumberCell, PageHeader, Pagination, SelectableCard, Sidebar, SidebarSection2 as SidebarSection, SlugCell, StatusBadgeCell, Stepper, StepperCompleted, StepperContainer, StepperContent, StepperIcon, StepperProvider, StepperSeparator, StepperStep, StepperStepTitle, StepperSteps, SwitchCell, CardList as Table, CardListData as TableData, CardListItem as TableItem, TimelineConnector, TimelineContent, TimelineDescription, TimelineIndicator, TimelineItem, TimelineRoot, TimelineSeparator, TimelineTitle, Toolbar, TreeViewBranch, TreeViewBranchContent, TreeViewBranchControl, TreeViewBranchIndicator, TreeViewBranchText, TreeViewBranchTrigger, TreeViewItem, TreeViewItemIndicator, TreeViewItemText, TreeViewLabel, TreeViewNode, TreeViewRoot, TreeViewTree, TruncatedTextCell, UploadDropZone, UrlCell, Widget, emptyCellValue, pluralize, truncateText, useStep, useStepper, useStepperContext, useStepperNextButton, useStepperPrevButton };
|
|
2739
|
+
export { ActionCell, AuthCard, BooleanCell, BulkActionBar, Card, CardList, CardListData, CardListItem, ChipPicker, CodeCell, ColorSwatchCell, ContextRail, CountCell, DataTable, DateCell, DrawerRoot, FactBox, InlineCreatableList, LabeledSwitch, LinkCell, MenuCell, Modal, NumberCell, PageHeader, Pagination, SelectableCard, Sidebar, SidebarSection2 as SidebarSection, SlugCell, StatusBadgeCell, Stepper, StepperCompleted, StepperContainer, StepperContent, StepperIcon, StepperProvider, StepperSeparator, StepperStep, StepperStepTitle, StepperSteps, SwitchCell, CardList as Table, CardListData as TableData, CardListItem as TableItem, TimelineConnector, TimelineContent, TimelineDescription, TimelineIndicator, TimelineItem, TimelineRoot, TimelineSeparator, TimelineTitle, Toolbar, TreeViewBranch, TreeViewBranchContent, TreeViewBranchControl, TreeViewBranchIndicator, TreeViewBranchText, TreeViewBranchTrigger, TreeViewItem, TreeViewItemIndicator, TreeViewItemText, TreeViewLabel, TreeViewNode, TreeViewRoot, TreeViewTree, TruncatedTextCell, UploadDropZone, UrlCell, Widget, emptyCellValue, pluralize, truncateText, useSidebarContext, useStep, useStepper, useStepperContext, useStepperNextButton, useStepperPrevButton };
|
|
2648
2740
|
//# sourceMappingURL=index.js.map
|
|
2649
2741
|
//# sourceMappingURL=index.js.map
|