@bizapps/design-system-testing 1.0.7 → 1.0.8

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/main.cjs CHANGED
@@ -4733,65 +4733,228 @@ function CanNot({ permission, mode = "any", fallback = null, children }) {
4733
4733
  return /* @__PURE__ */ jsxRuntime.jsx(Can, { permission, mode, negate: true, fallback, children });
4734
4734
  }
4735
4735
  CanNot.displayName = "CanNot";
4736
- var SidebarContext = react.createContext({
4737
- open: true,
4738
- setOpen: () => {
4739
- },
4740
- isMobile: false
4741
- });
4742
- function useSidebar() {
4743
- return react.useContext(SidebarContext);
4736
+ var MOBILE_BREAKPOINT = 768;
4737
+ function useIsMobile() {
4738
+ const [isMobile, setIsMobile] = react.useState(void 0);
4739
+ react.useEffect(() => {
4740
+ const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
4741
+ const onChange = () => {
4742
+ setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
4743
+ };
4744
+ mql.addEventListener("change", onChange);
4745
+ setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
4746
+ return () => mql.removeEventListener("change", onChange);
4747
+ }, []);
4748
+ return !!isMobile;
4744
4749
  }
4745
- var SidebarProvider = react.forwardRef(
4746
- ({ defaultOpen = true, open: controlledOpen, onOpenChange, className, children, ...props }, ref) => {
4747
- const [internalOpen, setInternalOpen] = react.useState(defaultOpen);
4748
- const [isMobile, setIsMobile] = react.useState(false);
4749
- const containerRef = react.useRef(null);
4750
- const open = controlledOpen ?? internalOpen;
4751
- const setOpen = react.useCallback(
4752
- (value) => {
4753
- setInternalOpen(value);
4754
- onOpenChange?.(value);
4755
- },
4756
- [onOpenChange]
4757
- );
4758
- react.useEffect(() => {
4759
- const check = () => {
4760
- const el = containerRef.current;
4761
- if (el) setIsMobile(el.offsetWidth < 768);
4762
- };
4763
- check();
4764
- const ro = new ResizeObserver(check);
4765
- if (containerRef.current) ro.observe(containerRef.current);
4766
- return () => ro.disconnect();
4767
- }, []);
4768
- return /* @__PURE__ */ jsxRuntime.jsx(SidebarContext.Provider, { value: { open, setOpen, isMobile }, children: /* @__PURE__ */ jsxRuntime.jsx(
4769
- "div",
4750
+ function Sheet({ ...props }) {
4751
+ return /* @__PURE__ */ jsxRuntime.jsx(radixUi.Dialog.Root, { "data-slot": "sheet", ...props });
4752
+ }
4753
+ function SheetTrigger({ ...props }) {
4754
+ return /* @__PURE__ */ jsxRuntime.jsx(radixUi.Dialog.Trigger, { "data-slot": "sheet-trigger", ...props });
4755
+ }
4756
+ function SheetClose({ ...props }) {
4757
+ return /* @__PURE__ */ jsxRuntime.jsx(radixUi.Dialog.Close, { "data-slot": "sheet-close", ...props });
4758
+ }
4759
+ function SheetPortal({ ...props }) {
4760
+ return /* @__PURE__ */ jsxRuntime.jsx(radixUi.Dialog.Portal, { "data-slot": "sheet-portal", ...props });
4761
+ }
4762
+ function SheetOverlay({
4763
+ className,
4764
+ ...props
4765
+ }) {
4766
+ return /* @__PURE__ */ jsxRuntime.jsx(
4767
+ radixUi.Dialog.Overlay,
4768
+ {
4769
+ "data-slot": "sheet-overlay",
4770
+ className: cn(
4771
+ "fixed inset-0 z-50 bg-black/30 duration-100 supports-backdrop-filter:backdrop-blur-sm data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",
4772
+ className
4773
+ ),
4774
+ ...props
4775
+ }
4776
+ );
4777
+ }
4778
+ function SheetContent({
4779
+ className,
4780
+ children,
4781
+ side = "right",
4782
+ showCloseButton = true,
4783
+ ...props
4784
+ }) {
4785
+ return /* @__PURE__ */ jsxRuntime.jsxs(SheetPortal, { children: [
4786
+ /* @__PURE__ */ jsxRuntime.jsx(SheetOverlay, {}),
4787
+ /* @__PURE__ */ jsxRuntime.jsxs(
4788
+ radixUi.Dialog.Content,
4770
4789
  {
4771
- ref: (node) => {
4772
- containerRef.current = node;
4773
- if (typeof ref === "function") ref(node);
4774
- else if (ref) ref.current = node;
4775
- },
4776
- className: cn("flex h-full w-full overflow-hidden", className),
4790
+ "data-slot": "sheet-content",
4791
+ "data-side": side,
4792
+ className: cn(
4793
+ "fixed z-50 flex flex-col bg-popover bg-clip-padding text-sm text-popover-foreground shadow-xl transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-[side=bottom]:data-open:slide-in-from-bottom-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:animate-out data-closed:fade-out-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=right]:data-closed:slide-out-to-right-10 data-[side=top]:data-closed:slide-out-to-top-10",
4794
+ className
4795
+ ),
4777
4796
  ...props,
4778
- children
4797
+ children: [
4798
+ children,
4799
+ showCloseButton && /* @__PURE__ */ jsxRuntime.jsx(radixUi.Dialog.Close, { "data-slot": "sheet-close", asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "ghost", className: "absolute top-4 right-4 bg-secondary", size: "icon-sm", children: [
4800
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.XIcon, {}),
4801
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Close" })
4802
+ ] }) })
4803
+ ]
4779
4804
  }
4780
- ) });
4805
+ )
4806
+ ] });
4807
+ }
4808
+ function SheetHeader({ className, ...props }) {
4809
+ return /* @__PURE__ */ jsxRuntime.jsx(
4810
+ "div",
4811
+ {
4812
+ "data-slot": "sheet-header",
4813
+ className: cn("flex flex-col gap-1.5 p-6", className),
4814
+ ...props
4815
+ }
4816
+ );
4817
+ }
4818
+ function SheetFooter({ className, ...props }) {
4819
+ return /* @__PURE__ */ jsxRuntime.jsx(
4820
+ "div",
4821
+ {
4822
+ "data-slot": "sheet-footer",
4823
+ className: cn("mt-auto flex flex-col gap-2 p-6", className),
4824
+ ...props
4825
+ }
4826
+ );
4827
+ }
4828
+ function SheetTitle({
4829
+ className,
4830
+ ...props
4831
+ }) {
4832
+ return /* @__PURE__ */ jsxRuntime.jsx(
4833
+ radixUi.Dialog.Title,
4834
+ {
4835
+ "data-slot": "sheet-title",
4836
+ className: cn("text-base font-medium text-foreground", className),
4837
+ ...props
4838
+ }
4839
+ );
4840
+ }
4841
+ function SheetDescription({
4842
+ className,
4843
+ ...props
4844
+ }) {
4845
+ return /* @__PURE__ */ jsxRuntime.jsx(
4846
+ radixUi.Dialog.Description,
4847
+ {
4848
+ "data-slot": "sheet-description",
4849
+ className: cn("text-sm text-muted-foreground", className),
4850
+ ...props
4851
+ }
4852
+ );
4853
+ }
4854
+ var SIDEBAR_COOKIE_NAME = "sidebar_state";
4855
+ var SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
4856
+ var SIDEBAR_WIDTH = "16rem";
4857
+ var SIDEBAR_WIDTH_MOBILE = "18rem";
4858
+ var SIDEBAR_WIDTH_ICON = "3rem";
4859
+ var SIDEBAR_KEYBOARD_SHORTCUT = "b";
4860
+ var SidebarContext = react.createContext(null);
4861
+ function useSidebar() {
4862
+ const context = react.useContext(SidebarContext);
4863
+ if (!context) {
4864
+ throw new Error("useSidebar must be used within a SidebarProvider.");
4781
4865
  }
4782
- );
4783
- SidebarProvider.displayName = "SidebarProvider";
4784
- var Sidebar = react.forwardRef(
4785
- ({ collapsible = "offcanvas", className, children, ...props }, ref) => {
4786
- const { open } = useSidebar();
4866
+ return context;
4867
+ }
4868
+ function SidebarProvider({
4869
+ defaultOpen = true,
4870
+ open: openProp,
4871
+ onOpenChange: setOpenProp,
4872
+ className,
4873
+ style,
4874
+ children,
4875
+ ...props
4876
+ }) {
4877
+ const isMobile = useIsMobile();
4878
+ const [openMobile, setOpenMobile] = react.useState(false);
4879
+ const [_open, _setOpen] = react.useState(defaultOpen);
4880
+ const open = openProp ?? _open;
4881
+ const setOpen = react.useCallback(
4882
+ (value) => {
4883
+ const openState = typeof value === "function" ? value(open) : value;
4884
+ if (setOpenProp) {
4885
+ setOpenProp(openState);
4886
+ } else {
4887
+ _setOpen(openState);
4888
+ }
4889
+ document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}; SameSite=Lax; Secure`;
4890
+ },
4891
+ [setOpenProp, open]
4892
+ );
4893
+ const toggleSidebar = react.useCallback(() => {
4894
+ return isMobile ? setOpenMobile((open2) => !open2) : setOpen((open2) => !open2);
4895
+ }, [isMobile, setOpen, setOpenMobile]);
4896
+ react.useEffect(() => {
4897
+ const handleKeyDown = (event) => {
4898
+ if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
4899
+ const target = event.target;
4900
+ if (target.isContentEditable || target.tagName === "INPUT" || target.tagName === "TEXTAREA" || target.tagName === "SELECT") {
4901
+ return;
4902
+ }
4903
+ event.preventDefault();
4904
+ toggleSidebar();
4905
+ }
4906
+ };
4907
+ window.addEventListener("keydown", handleKeyDown);
4908
+ return () => window.removeEventListener("keydown", handleKeyDown);
4909
+ }, [toggleSidebar]);
4910
+ const state = open ? "expanded" : "collapsed";
4911
+ const contextValue = react.useMemo(
4912
+ () => ({
4913
+ state,
4914
+ open,
4915
+ setOpen,
4916
+ isMobile,
4917
+ openMobile,
4918
+ setOpenMobile,
4919
+ toggleSidebar
4920
+ }),
4921
+ [state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]
4922
+ );
4923
+ return /* @__PURE__ */ jsxRuntime.jsx(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsx(
4924
+ "div",
4925
+ {
4926
+ "data-slot": "sidebar-wrapper",
4927
+ style: {
4928
+ "--sidebar-width": SIDEBAR_WIDTH,
4929
+ "--sidebar-width-icon": SIDEBAR_WIDTH_ICON,
4930
+ ...style
4931
+ },
4932
+ className: cn(
4933
+ "group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-dvh w-full",
4934
+ className
4935
+ ),
4936
+ ...props,
4937
+ children
4938
+ }
4939
+ ) });
4940
+ }
4941
+ function Sidebar({
4942
+ side = "left",
4943
+ variant = "sidebar",
4944
+ collapsible = "offcanvas",
4945
+ className,
4946
+ children,
4947
+ dir,
4948
+ ...props
4949
+ }) {
4950
+ const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
4951
+ if (collapsible === "none") {
4787
4952
  return /* @__PURE__ */ jsxRuntime.jsx(
4788
4953
  "div",
4789
4954
  {
4790
- ref,
4791
- "data-state": open ? "expanded" : "collapsed",
4955
+ "data-slot": "sidebar",
4792
4956
  className: cn(
4793
- "bg-sidebar text-sidebar-foreground border-sidebar-border relative flex h-full shrink-0 flex-col border-r transition-all duration-300 ease-in-out",
4794
- open ? "w-64" : collapsible === "icon" ? "w-12" : "w-0 overflow-hidden",
4957
+ "bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",
4795
4958
  className
4796
4959
  ),
4797
4960
  ...props,
@@ -4799,154 +4962,455 @@ var Sidebar = react.forwardRef(
4799
4962
  }
4800
4963
  );
4801
4964
  }
4802
- );
4803
- Sidebar.displayName = "Sidebar";
4804
- var SidebarTrigger = react.forwardRef(({ className, onClick, ...props }, ref) => {
4805
- const { open, setOpen } = useSidebar();
4965
+ if (isMobile) {
4966
+ return /* @__PURE__ */ jsxRuntime.jsx(Sheet, { open: openMobile, onOpenChange: setOpenMobile, ...props, children: /* @__PURE__ */ jsxRuntime.jsxs(
4967
+ SheetContent,
4968
+ {
4969
+ dir,
4970
+ "data-sidebar": "sidebar",
4971
+ "data-slot": "sidebar",
4972
+ "data-mobile": "true",
4973
+ showCloseButton: false,
4974
+ className: "bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0",
4975
+ style: {
4976
+ "--sidebar-width": SIDEBAR_WIDTH_MOBILE
4977
+ },
4978
+ side,
4979
+ children: [
4980
+ /* @__PURE__ */ jsxRuntime.jsxs(SheetHeader, { className: "sr-only", children: [
4981
+ /* @__PURE__ */ jsxRuntime.jsx(SheetTitle, { children: "Sidebar" }),
4982
+ /* @__PURE__ */ jsxRuntime.jsx(SheetDescription, { children: "Displays the mobile sidebar." })
4983
+ ] }),
4984
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-full w-full flex-col", children })
4985
+ ]
4986
+ }
4987
+ ) });
4988
+ }
4989
+ return /* @__PURE__ */ jsxRuntime.jsxs(
4990
+ "div",
4991
+ {
4992
+ className: "group peer text-sidebar-foreground hidden md:block",
4993
+ "data-state": state,
4994
+ "data-collapsible": state === "collapsed" ? collapsible : "",
4995
+ "data-variant": variant,
4996
+ "data-side": side,
4997
+ "data-slot": "sidebar",
4998
+ children: [
4999
+ /* @__PURE__ */ jsxRuntime.jsx(
5000
+ "div",
5001
+ {
5002
+ "data-slot": "sidebar-gap",
5003
+ className: cn(
5004
+ "relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear",
5005
+ "group-data-[collapsible=offcanvas]:w-0",
5006
+ "group-data-[side=right]:rotate-180",
5007
+ variant === "floating" || variant === "inset" ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon)"
5008
+ )
5009
+ }
5010
+ ),
5011
+ /* @__PURE__ */ jsxRuntime.jsx(
5012
+ "div",
5013
+ {
5014
+ "data-slot": "sidebar-container",
5015
+ "data-side": side,
5016
+ className: cn(
5017
+ "fixed inset-y-0 z-10 hidden h-dvh w-(--sidebar-width) overflow-hidden transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex",
5018
+ // Adjust the padding for floating and inset variants.
5019
+ variant === "floating" || variant === "inset" ? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",
5020
+ className
5021
+ ),
5022
+ ...props,
5023
+ children: /* @__PURE__ */ jsxRuntime.jsx(
5024
+ "div",
5025
+ {
5026
+ "data-sidebar": "sidebar",
5027
+ "data-slot": "sidebar-inner",
5028
+ className: "bg-sidebar group-data-[variant=floating]:ring-sidebar-border flex size-full flex-col group-data-[variant=floating]:rounded-2xl group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1",
5029
+ children
5030
+ }
5031
+ )
5032
+ }
5033
+ )
5034
+ ]
5035
+ }
5036
+ );
5037
+ }
5038
+ function SidebarTrigger({ className, onClick, ...props }) {
5039
+ const { toggleSidebar } = useSidebar();
4806
5040
  return /* @__PURE__ */ jsxRuntime.jsxs(
4807
5041
  Button,
4808
5042
  {
4809
- ref,
4810
- variant: "ghost",
4811
- size: "md",
4812
- className: cn("shrink-0", className),
4813
- onClick: (e) => {
4814
- onClick?.(e);
4815
- setOpen(!open);
4816
- },
4817
- ...props,
4818
- children: [
4819
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Menu, { className: "size-4" }),
4820
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Toggle sidebar" })
4821
- ]
5043
+ "data-sidebar": "trigger",
5044
+ "data-slot": "sidebar-trigger",
5045
+ variant: "ghost",
5046
+ size: "icon-sm",
5047
+ className: cn(className),
5048
+ onClick: (event) => {
5049
+ onClick?.(event);
5050
+ toggleSidebar();
5051
+ },
5052
+ ...props,
5053
+ children: [
5054
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MenuIcon, {}),
5055
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Toggle Sidebar" })
5056
+ ]
5057
+ }
5058
+ );
5059
+ }
5060
+ function SidebarRail({ className, ...props }) {
5061
+ const { toggleSidebar } = useSidebar();
5062
+ return /* @__PURE__ */ jsxRuntime.jsx(
5063
+ "button",
5064
+ {
5065
+ "data-sidebar": "rail",
5066
+ "data-slot": "sidebar-rail",
5067
+ "aria-label": "Toggle Sidebar",
5068
+ tabIndex: -1,
5069
+ onClick: toggleSidebar,
5070
+ title: "Toggle Sidebar",
5071
+ className: cn(
5072
+ "hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:start-1/2 after:w-[2px] sm:flex ltr:-translate-x-1/2 rtl:-translate-x-1/2",
5073
+ "in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize",
5074
+ "[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize",
5075
+ "hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full",
5076
+ "[[data-side=left][data-collapsible=offcanvas]_&]:-right-2",
5077
+ "[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",
5078
+ className
5079
+ ),
5080
+ ...props
5081
+ }
5082
+ );
5083
+ }
5084
+ function SidebarInset({ className, ...props }) {
5085
+ return /* @__PURE__ */ jsxRuntime.jsx(
5086
+ "main",
5087
+ {
5088
+ "data-slot": "sidebar-inset",
5089
+ className: cn(
5090
+ "bg-background relative flex w-full flex-1 flex-col md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-2xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",
5091
+ className
5092
+ ),
5093
+ ...props
5094
+ }
5095
+ );
5096
+ }
5097
+ function SidebarInput({ className, ...props }) {
5098
+ return /* @__PURE__ */ jsxRuntime.jsx(
5099
+ Input,
5100
+ {
5101
+ "data-slot": "sidebar-input",
5102
+ "data-sidebar": "input",
5103
+ className: cn("bg-input/50 h-8 w-full shadow-none", className),
5104
+ ...props
5105
+ }
5106
+ );
5107
+ }
5108
+ function SidebarHeader({ className, ...props }) {
5109
+ return /* @__PURE__ */ jsxRuntime.jsx(
5110
+ "div",
5111
+ {
5112
+ "data-slot": "sidebar-header",
5113
+ "data-sidebar": "header",
5114
+ className: cn("flex flex-col gap-2 p-2 [--radius:var(--radius-xl)]", className),
5115
+ ...props
5116
+ }
5117
+ );
5118
+ }
5119
+ function SidebarFooter({ className, ...props }) {
5120
+ return /* @__PURE__ */ jsxRuntime.jsx(
5121
+ "div",
5122
+ {
5123
+ "data-slot": "sidebar-footer",
5124
+ "data-sidebar": "footer",
5125
+ className: cn("flex flex-col gap-2 p-2", className),
5126
+ ...props
5127
+ }
5128
+ );
5129
+ }
5130
+ function SidebarSeparator({ className, ...props }) {
5131
+ return /* @__PURE__ */ jsxRuntime.jsx(
5132
+ Separator,
5133
+ {
5134
+ "data-slot": "sidebar-separator",
5135
+ "data-sidebar": "separator",
5136
+ className: cn("bg-sidebar-border mx-2 w-auto", className),
5137
+ ...props
5138
+ }
5139
+ );
5140
+ }
5141
+ function SidebarContent({ className, ...props }) {
5142
+ return /* @__PURE__ */ jsxRuntime.jsx(
5143
+ "div",
5144
+ {
5145
+ "data-slot": "sidebar-content",
5146
+ "data-sidebar": "content",
5147
+ className: cn(
5148
+ "no-scrollbar flex min-h-0 flex-1 flex-col gap-2 overflow-auto [--radius:var(--radius-xl)] group-data-[collapsible=icon]:overflow-hidden",
5149
+ className
5150
+ ),
5151
+ ...props
5152
+ }
5153
+ );
5154
+ }
5155
+ function SidebarGroup({ className, ...props }) {
5156
+ return /* @__PURE__ */ jsxRuntime.jsx(
5157
+ "div",
5158
+ {
5159
+ "data-slot": "sidebar-group",
5160
+ "data-sidebar": "group",
5161
+ className: cn("relative flex w-full min-w-0 flex-col p-2", className),
5162
+ ...props
5163
+ }
5164
+ );
5165
+ }
5166
+ function SidebarGroupLabel({
5167
+ className,
5168
+ asChild = false,
5169
+ ...props
5170
+ }) {
5171
+ const Comp = asChild ? radixUi.Slot.Root : "div";
5172
+ return /* @__PURE__ */ jsxRuntime.jsx(
5173
+ Comp,
5174
+ {
5175
+ "data-slot": "sidebar-group-label",
5176
+ "data-sidebar": "group-label",
5177
+ className: cn(
5178
+ "text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-xl px-3 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
5179
+ className
5180
+ ),
5181
+ ...props
5182
+ }
5183
+ );
5184
+ }
5185
+ function SidebarGroupAction({
5186
+ className,
5187
+ asChild = false,
5188
+ ...props
5189
+ }) {
5190
+ const Comp = asChild ? radixUi.Slot.Root : "button";
5191
+ return /* @__PURE__ */ jsxRuntime.jsx(
5192
+ Comp,
5193
+ {
5194
+ "data-slot": "sidebar-group-action",
5195
+ "data-sidebar": "group-action",
5196
+ className: cn(
5197
+ "text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-xl p-0 outline-hidden transition-transform group-data-[collapsible=icon]:hidden after:absolute after:-inset-2 focus-visible:ring-2 md:after:hidden [&>svg]:size-4 [&>svg]:shrink-0",
5198
+ className
5199
+ ),
5200
+ ...props
5201
+ }
5202
+ );
5203
+ }
5204
+ function SidebarGroupContent({ className, ...props }) {
5205
+ return /* @__PURE__ */ jsxRuntime.jsx(
5206
+ "div",
5207
+ {
5208
+ "data-slot": "sidebar-group-content",
5209
+ "data-sidebar": "group-content",
5210
+ className: cn("w-full text-sm", className),
5211
+ ...props
5212
+ }
5213
+ );
5214
+ }
5215
+ function SidebarMenu({ className, ...props }) {
5216
+ return /* @__PURE__ */ jsxRuntime.jsx(
5217
+ "ul",
5218
+ {
5219
+ "data-slot": "sidebar-menu",
5220
+ "data-sidebar": "menu",
5221
+ className: cn("flex w-full min-w-0 flex-col gap-0.5", className),
5222
+ ...props
5223
+ }
5224
+ );
5225
+ }
5226
+ function SidebarMenuItem({ className, ...props }) {
5227
+ return /* @__PURE__ */ jsxRuntime.jsx(
5228
+ "li",
5229
+ {
5230
+ "data-slot": "sidebar-menu-item",
5231
+ "data-sidebar": "menu-item",
5232
+ className: cn("group/menu-item relative", className),
5233
+ ...props
5234
+ }
5235
+ );
5236
+ }
5237
+ var sidebarMenuButtonVariants = classVarianceAuthority.cva(
5238
+ "peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-xl px-3 py-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate",
5239
+ {
5240
+ variants: {
5241
+ variant: {
5242
+ default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
5243
+ outline: "bg-background shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]"
5244
+ },
5245
+ size: {
5246
+ default: "h-9 text-sm",
5247
+ sm: "h-8 text-xs",
5248
+ lg: "h-14 px-3 text-sm group-data-[collapsible=icon]:p-0!"
5249
+ }
5250
+ },
5251
+ defaultVariants: {
5252
+ variant: "default",
5253
+ size: "default"
5254
+ }
5255
+ }
5256
+ );
5257
+ function SidebarMenuButton({
5258
+ asChild = false,
5259
+ isActive = false,
5260
+ variant = "default",
5261
+ size = "default",
5262
+ tooltip,
5263
+ className,
5264
+ ...props
5265
+ }) {
5266
+ const Comp = asChild ? radixUi.Slot.Root : "button";
5267
+ const { isMobile, state } = useSidebar();
5268
+ const button = /* @__PURE__ */ jsxRuntime.jsx(
5269
+ Comp,
5270
+ {
5271
+ "data-slot": "sidebar-menu-button",
5272
+ "data-sidebar": "menu-button",
5273
+ "data-size": size,
5274
+ "data-active": isActive,
5275
+ className: cn(sidebarMenuButtonVariants({ variant, size }), className),
5276
+ ...props
5277
+ }
5278
+ );
5279
+ if (!tooltip) {
5280
+ return button;
5281
+ }
5282
+ if (typeof tooltip === "string") {
5283
+ tooltip = {
5284
+ children: tooltip
5285
+ };
5286
+ }
5287
+ return /* @__PURE__ */ jsxRuntime.jsxs(Tooltip, { children: [
5288
+ /* @__PURE__ */ jsxRuntime.jsx(TooltipTrigger, { asChild: true, children: button }),
5289
+ /* @__PURE__ */ jsxRuntime.jsx(
5290
+ TooltipContent,
5291
+ {
5292
+ side: "right",
5293
+ align: "center",
5294
+ hidden: state !== "collapsed" || isMobile,
5295
+ ...tooltip
5296
+ }
5297
+ )
5298
+ ] });
5299
+ }
5300
+ function SidebarMenuAction({
5301
+ className,
5302
+ asChild = false,
5303
+ showOnHover = false,
5304
+ ...props
5305
+ }) {
5306
+ const Comp = asChild ? radixUi.Slot.Root : "button";
5307
+ return /* @__PURE__ */ jsxRuntime.jsx(
5308
+ Comp,
5309
+ {
5310
+ "data-slot": "sidebar-menu-action",
5311
+ "data-sidebar": "menu-action",
5312
+ className: cn(
5313
+ "text-sidebar-foreground ring-sidebar-ring peer-hover/menu-button:text-sidebar-accent-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-xl p-0 outline-hidden transition-transform group-data-[collapsible=icon]:hidden peer-data-[size=default]/menu-button:top-2 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 after:absolute after:-inset-2 focus-visible:ring-2 md:after:hidden [&>svg]:size-4 [&>svg]:shrink-0",
5314
+ showOnHover && "peer-data-active/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 aria-expanded:opacity-100 md:opacity-0",
5315
+ className
5316
+ ),
5317
+ ...props
4822
5318
  }
4823
5319
  );
4824
- });
4825
- SidebarTrigger.displayName = "SidebarTrigger";
4826
- var SidebarHeader = react.forwardRef(
4827
- ({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
5320
+ }
5321
+ function SidebarMenuBadge({ className, ...props }) {
5322
+ return /* @__PURE__ */ jsxRuntime.jsx(
4828
5323
  "div",
4829
5324
  {
4830
- ref,
4831
- "data-slot": "sidebar-header",
4832
- className: cn("flex shrink-0 flex-col gap-2 p-3", className),
5325
+ "data-slot": "sidebar-menu-badge",
5326
+ "data-sidebar": "menu-badge",
5327
+ className: cn(
5328
+ "text-sidebar-foreground peer-hover/menu-button:text-sidebar-accent-foreground peer-data-active/menu-button:text-sidebar-accent-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-xl px-1 text-xs font-medium tabular-nums select-none group-data-[collapsible=icon]:hidden peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1",
5329
+ className
5330
+ ),
4833
5331
  ...props
4834
5332
  }
4835
- )
4836
- );
4837
- SidebarHeader.displayName = "SidebarHeader";
4838
- var SidebarContent = react.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
4839
- "div",
4840
- {
4841
- ref,
4842
- "data-slot": "sidebar-content",
4843
- className: cn(
4844
- "flex flex-1 flex-col gap-2 overflow-x-hidden overflow-y-auto p-2",
4845
- className
4846
- ),
4847
- ...props
4848
- }
4849
- ));
4850
- SidebarContent.displayName = "SidebarContent";
4851
- var SidebarFooter = react.forwardRef(
4852
- ({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
5333
+ );
5334
+ }
5335
+ function SidebarMenuSkeleton({
5336
+ className,
5337
+ showIcon = false,
5338
+ ...props
5339
+ }) {
5340
+ const [width] = react.useState(() => {
5341
+ return `${Math.floor(Math.random() * 40) + 50}%`;
5342
+ });
5343
+ return /* @__PURE__ */ jsxRuntime.jsxs(
4853
5344
  "div",
4854
5345
  {
4855
- ref,
4856
- "data-slot": "sidebar-footer",
4857
- className: cn("flex shrink-0 flex-col gap-2 p-3", className),
4858
- ...props
5346
+ "data-slot": "sidebar-menu-skeleton",
5347
+ "data-sidebar": "menu-skeleton",
5348
+ className: cn("flex h-8 items-center gap-2 rounded-xl px-2", className),
5349
+ ...props,
5350
+ children: [
5351
+ showIcon && /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "size-4 rounded-xl", "data-sidebar": "menu-skeleton-icon" }),
5352
+ /* @__PURE__ */ jsxRuntime.jsx(
5353
+ Skeleton,
5354
+ {
5355
+ className: "h-4 max-w-(--skeleton-width) flex-1",
5356
+ "data-sidebar": "menu-skeleton-text",
5357
+ style: {
5358
+ "--skeleton-width": width
5359
+ }
5360
+ }
5361
+ )
5362
+ ]
4859
5363
  }
4860
- )
4861
- );
4862
- SidebarFooter.displayName = "SidebarFooter";
4863
- var SidebarGroup = react.forwardRef(
4864
- ({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
4865
- "div",
5364
+ );
5365
+ }
5366
+ function SidebarMenuSub({ className, ...props }) {
5367
+ return /* @__PURE__ */ jsxRuntime.jsx(
5368
+ "ul",
4866
5369
  {
4867
- ref,
4868
- "data-slot": "sidebar-group",
4869
- className: cn("flex flex-col gap-1", className),
5370
+ "data-slot": "sidebar-menu-sub",
5371
+ "data-sidebar": "menu-sub",
5372
+ className: cn(
5373
+ "border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5 group-data-[collapsible=icon]:hidden",
5374
+ className
5375
+ ),
4870
5376
  ...props
4871
5377
  }
4872
- )
4873
- );
4874
- SidebarGroup.displayName = "SidebarGroup";
4875
- var SidebarGroupLabel = react.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
4876
- "div",
4877
- {
4878
- ref,
4879
- className: cn(
4880
- "text-sidebar-foreground/50 px-2 py-1 text-xs font-medium tracking-wider uppercase",
4881
- className
4882
- ),
4883
- ...props
4884
- }
4885
- ));
4886
- SidebarGroupLabel.displayName = "SidebarGroupLabel";
4887
- var SidebarGroupContent = react.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
4888
- "div",
4889
- {
4890
- ref,
4891
- "data-slot": "sidebar-group-content",
4892
- className: cn("flex flex-col gap-0.5", className),
4893
- ...props
4894
- }
4895
- ));
4896
- SidebarGroupContent.displayName = "SidebarGroupContent";
4897
- var SidebarMenu = react.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
4898
- "ul",
4899
- {
4900
- ref,
4901
- "data-slot": "sidebar-menu",
4902
- className: cn("m-0 flex list-none flex-col gap-0.5 p-0", className),
4903
- ...props
4904
- }
4905
- ));
4906
- SidebarMenu.displayName = "SidebarMenu";
4907
- var SidebarMenuItem = react.forwardRef(
4908
- ({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
5378
+ );
5379
+ }
5380
+ function SidebarMenuSubItem({ className, ...props }) {
5381
+ return /* @__PURE__ */ jsxRuntime.jsx(
4909
5382
  "li",
4910
5383
  {
4911
- ref,
4912
- "data-slot": "sidebar-menu-item",
4913
- className: cn("relative", className),
5384
+ "data-slot": "sidebar-menu-sub-item",
5385
+ "data-sidebar": "menu-sub-item",
5386
+ className: cn("group/menu-sub-item relative", className),
4914
5387
  ...props
4915
5388
  }
4916
- )
4917
- );
4918
- SidebarMenuItem.displayName = "SidebarMenuItem";
4919
- var SidebarMenuButton = react.forwardRef(
4920
- ({ asChild, isActive, className, children, ...props }, ref) => {
4921
- const { open } = useSidebar();
4922
- const Comp = asChild ? radixUi.Slot.Root : "button";
4923
- return /* @__PURE__ */ jsxRuntime.jsx(
4924
- Comp,
4925
- {
4926
- ref,
4927
- "data-active": isActive || void 0,
4928
- className: cn(
4929
- "flex w-full cursor-pointer items-center gap-2 rounded-lg px-3 py-2 text-sm font-normal transition-colors outline-none",
4930
- "text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
4931
- "data-[active]:bg-sidebar-primary/10 data-[active]:text-sidebar-primary data-[active]:font-normal",
4932
- !open && "justify-center px-2",
4933
- className
4934
- ),
4935
- ...props,
4936
- children: react.Children.map(children, (child, i) => {
4937
- if (i === 0 && react.isValidElement(child)) {
4938
- return react.cloneElement(child, {
4939
- className: cn("size-4 shrink-0", child.props.className)
4940
- });
4941
- }
4942
- if (i > 0 && !open) return null;
4943
- return child;
4944
- })
4945
- }
4946
- );
4947
- }
4948
- );
4949
- SidebarMenuButton.displayName = "SidebarMenuButton";
5389
+ );
5390
+ }
5391
+ function SidebarMenuSubButton({
5392
+ asChild = false,
5393
+ size = "md",
5394
+ isActive = false,
5395
+ className,
5396
+ ...props
5397
+ }) {
5398
+ const Comp = asChild ? radixUi.Slot.Root : "a";
5399
+ return /* @__PURE__ */ jsxRuntime.jsx(
5400
+ Comp,
5401
+ {
5402
+ "data-slot": "sidebar-menu-sub-button",
5403
+ "data-sidebar": "menu-sub-button",
5404
+ "data-size": size,
5405
+ "data-active": isActive,
5406
+ className: cn(
5407
+ "text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-xl px-3 outline-hidden group-data-[collapsible=icon]:hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[size=md]:text-sm data-[size=sm]:text-xs [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",
5408
+ className
5409
+ ),
5410
+ ...props
5411
+ }
5412
+ );
5413
+ }
4950
5414
  var defaultItems = [
4951
5415
  { label: "Home", icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.House, {}) },
4952
5416
  { label: "Vacations", icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plane, {}) },
@@ -4954,11 +5418,20 @@ var defaultItems = [
4954
5418
  { label: "Apps", icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.LayoutDashboardIcon, {}) }
4955
5419
  ];
4956
5420
  function SidebarBrand({ brandName }) {
4957
- const { open } = useSidebar();
4958
- if (!open) return null;
5421
+ const { state } = useSidebar();
5422
+ const collapsed = state === "collapsed";
4959
5423
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
4960
5424
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-primary text-primary-foreground flex size-7 shrink-0 items-center justify-center rounded-md text-xs font-bold", children: brandName.charAt(0) }),
4961
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-sm font-semibold", children: brandName })
5425
+ /* @__PURE__ */ jsxRuntime.jsx(
5426
+ "span",
5427
+ {
5428
+ className: cn(
5429
+ "truncate text-sm font-semibold transition-opacity duration-200",
5430
+ collapsed ? "opacity-0 pointer-events-none w-0 overflow-hidden" : "opacity-100"
5431
+ ),
5432
+ children: brandName
5433
+ }
5434
+ )
4962
5435
  ] });
4963
5436
  }
4964
5437
  function AppShell({
@@ -4967,48 +5440,64 @@ function AppShell({
4967
5440
  onItemClick,
4968
5441
  brandName = "Total Portal",
4969
5442
  showHeader = true,
5443
+ open,
5444
+ onOpenChange,
5445
+ defaultOpen,
4970
5446
  className,
4971
5447
  mainClassName,
4972
5448
  children
4973
5449
  }) {
4974
- return /* @__PURE__ */ jsxRuntime.jsxs(SidebarProvider, { className: cn("min-h-0", className), children: [
4975
- /* @__PURE__ */ jsxRuntime.jsxs(Sidebar, { collapsible: "icon", children: [
4976
- /* @__PURE__ */ jsxRuntime.jsxs(SidebarHeader, { className: "flex flex-row items-center gap-2 p-2", children: [
4977
- /* @__PURE__ */ jsxRuntime.jsx(SidebarTrigger, { variant: "ghost", className: "size-8 shrink-0" }),
4978
- /* @__PURE__ */ jsxRuntime.jsx(SidebarBrand, { brandName })
4979
- ] }),
4980
- /* @__PURE__ */ jsxRuntime.jsx(SidebarContent, { children: /* @__PURE__ */ jsxRuntime.jsx(SidebarGroup, { children: /* @__PURE__ */ jsxRuntime.jsx(SidebarGroupContent, { children: /* @__PURE__ */ jsxRuntime.jsx(SidebarMenu, { children: items.map((item) => {
4981
- const menuItem = /* @__PURE__ */ jsxRuntime.jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsxRuntime.jsxs(
4982
- SidebarMenuButton,
4983
- {
4984
- isActive: activeItem === item.label || item.active,
4985
- onClick: () => {
4986
- item.onClick?.();
4987
- onItemClick?.(item.label);
4988
- },
4989
- children: [
4990
- item.icon,
4991
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: item.label })
4992
- ]
4993
- }
4994
- ) }, item.label);
4995
- if (!item.permission) return menuItem;
4996
- return /* @__PURE__ */ jsxRuntime.jsx(
4997
- Can,
4998
- {
4999
- permission: item.permission,
5000
- mode: item.permissionMode,
5001
- children: menuItem
5002
- },
5003
- item.label
5004
- );
5005
- }) }) }) }) })
5006
- ] }),
5007
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-1 flex-col", children: [
5008
- showHeader && /* @__PURE__ */ jsxRuntime.jsx("header", { className: "flex h-14 items-center justify-between border-b px-4", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-medium", children: brandName }) }),
5009
- /* @__PURE__ */ jsxRuntime.jsx("main", { className: cn("overflow-y-auto flex-1 p-6", mainClassName), children })
5010
- ] })
5011
- ] });
5450
+ return /* @__PURE__ */ jsxRuntime.jsxs(
5451
+ SidebarProvider,
5452
+ {
5453
+ className: cn("h-dvh overflow-hidden", className),
5454
+ open,
5455
+ onOpenChange,
5456
+ defaultOpen,
5457
+ children: [
5458
+ /* @__PURE__ */ jsxRuntime.jsxs(Sidebar, { collapsible: "icon", children: [
5459
+ /* @__PURE__ */ jsxRuntime.jsxs(SidebarHeader, { className: "flex flex-row items-center gap-2 p-2", children: [
5460
+ /* @__PURE__ */ jsxRuntime.jsx(SidebarTrigger, { variant: "ghost", className: "size-8 shrink-0" }),
5461
+ /* @__PURE__ */ jsxRuntime.jsx(SidebarBrand, { brandName })
5462
+ ] }),
5463
+ /* @__PURE__ */ jsxRuntime.jsx(SidebarContent, { children: /* @__PURE__ */ jsxRuntime.jsx(SidebarGroup, { children: /* @__PURE__ */ jsxRuntime.jsx(SidebarGroupContent, { children: /* @__PURE__ */ jsxRuntime.jsx(SidebarMenu, { children: items.map((item) => {
5464
+ const menuItem = /* @__PURE__ */ jsxRuntime.jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsxRuntime.jsxs(
5465
+ SidebarMenuButton,
5466
+ {
5467
+ tooltip: item.label,
5468
+ isActive: activeItem === item.label || item.active,
5469
+ onClick: () => {
5470
+ item.onClick?.();
5471
+ onItemClick?.(item.label);
5472
+ },
5473
+ children: [
5474
+ item.icon,
5475
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: item.label })
5476
+ ]
5477
+ }
5478
+ ) }, item.label);
5479
+ if (!item.permission) return menuItem;
5480
+ return /* @__PURE__ */ jsxRuntime.jsx(
5481
+ Can,
5482
+ {
5483
+ permission: item.permission,
5484
+ mode: item.permissionMode,
5485
+ children: menuItem
5486
+ },
5487
+ item.label
5488
+ );
5489
+ }) }) }) }) })
5490
+ ] }),
5491
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-1 flex-col overflow-hidden", children: [
5492
+ showHeader ? /* @__PURE__ */ jsxRuntime.jsxs("header", { className: "flex h-14 items-center gap-2 border-b px-4", children: [
5493
+ /* @__PURE__ */ jsxRuntime.jsx(SidebarTrigger, { variant: "ghost", className: "size-8 shrink-0 md:hidden" }),
5494
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-medium", children: brandName })
5495
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx(SidebarTrigger, { variant: "ghost", className: "size-8 shrink-0 md:hidden" }),
5496
+ /* @__PURE__ */ jsxRuntime.jsx("main", { className: cn("overflow-y-auto flex-1 p-6", mainClassName), children })
5497
+ ] })
5498
+ ]
5499
+ }
5500
+ );
5012
5501
  }
5013
5502
  function Textarea({ className, ...props }) {
5014
5503
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -5066,11 +5555,14 @@ var eventCalendarStyles = `
5066
5555
  align-items: center;
5067
5556
  }
5068
5557
 
5558
+ .sx__calendar-header-content {
5559
+ padding-right: 14px;
5560
+ }
5561
+
5069
5562
  /* Range title \u2014 "June 2026" */
5070
5563
  .sx-tcce .sx__range-heading {
5071
5564
  font-size: 15px;
5072
5565
  font-weight: 700;
5073
- letter-spacing: -0.02em;
5074
5566
  color: var(--color-foreground);
5075
5567
  font-family: var(--font-heading, inherit);
5076
5568
  }
@@ -5086,21 +5578,37 @@ var eventCalendarStyles = `
5086
5578
  background: var(--color-primary);
5087
5579
  color: var(--color-primary-foreground);
5088
5580
  cursor: pointer;
5089
- transition: opacity 150ms;
5581
+ transition: opacity 150ms, background 150ms, outline 150ms;
5582
+ }
5583
+ .sx-tcce .sx__today-button:focus-visible {
5584
+ outline: 3px solid color-mix(in srgb, var(--ring) 50%, transparent);
5585
+ outline-offset: -1px;
5090
5586
  }
5091
5587
  .sx-tcce .sx__today-button:hover {
5092
5588
  opacity: 0.88;
5589
+ background: var(--color-primary);
5093
5590
  }
5094
5591
  .sx-tcce .sx__today-button:active {
5095
5592
  opacity: 0.72;
5593
+ background: var(--color-primary);
5594
+ }
5595
+ .sx-tcce .sx__today-button:focus {
5596
+ background: var(--color-primary);
5096
5597
  }
5097
5598
 
5098
5599
  /* Prev / Next arrow buttons */
5600
+ .sx__forward-backward-navigation {
5601
+ display: flex;
5602
+ align-items: center;
5603
+ justify-content: center;
5604
+ height: 32px;
5605
+ }
5099
5606
  .sx-tcce .sx__chevron-wrapper {
5100
- width: 32px;
5607
+ width: 30px;
5101
5608
  height: 32px;
5102
- min-width: 32px;
5103
- border-radius: var(--border-radius-secondary-button, 0.625rem);
5609
+ min-width: 30px !important;
5610
+ min-height: 32px !important;
5611
+ border-radius: var(--border-radius-secondary-button, 0.625rem);=
5104
5612
  border: 1px solid var(--color-border);
5105
5613
  background: var(--color-background);
5106
5614
  transition: background 150ms;
@@ -5108,6 +5616,9 @@ var eventCalendarStyles = `
5108
5616
  .sx-tcce .sx__chevron-wrapper:hover {
5109
5617
  background: var(--color-muted);
5110
5618
  }
5619
+ .sx__chevron-wrapper {
5620
+ min-height: 30px !important;
5621
+ }
5111
5622
 
5112
5623
  /* \u2500\u2500 View selector \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
5113
5624
  /* Hide the "View" text label (kept in DOM for a11y) */
@@ -5134,12 +5645,18 @@ var eventCalendarStyles = `
5134
5645
  align-items: center;
5135
5646
  gap: 4px;
5136
5647
  cursor: pointer;
5137
- transition: opacity 150ms;
5648
+ transition: opacity 150ms, background 150ms, color 150ms;
5138
5649
  }
5139
5650
  .sx-tcce .sx__view-selection-selected-item:hover,
5140
5651
  .sx-tcce .sx__view-selection-selected-item:focus,
5141
5652
  .sx-tcce .sx__view-selection-selected-item:active {
5142
5653
  opacity: 0.85;
5654
+ background: var(--color-primary);
5655
+ color: var(--color-primary-foreground);
5656
+ }
5657
+ .sx-tcce .sx__view-selection-selected-item:focus-visible {
5658
+ outline: 3px solid color-mix(in srgb, var(--ring) 50%, transparent);
5659
+ outline-offset: -1px;
5143
5660
  }
5144
5661
 
5145
5662
  /* Chevron image inside the view button */
@@ -5167,7 +5684,8 @@ var eventCalendarStyles = `
5167
5684
  transition: background 100ms;
5168
5685
  }
5169
5686
  .sx-tcce .sx__view-selection-item:hover {
5170
- background: color-mix(in srgb, var(--color-primary) 8%, transparent);
5687
+ background: var(--color-primary);
5688
+ color: var(--color-primary-foreground);
5171
5689
  }
5172
5690
 
5173
5691
  /* \u2500\u2500 Date input (top-right "6/5/2026 \u25BC") \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
@@ -5180,44 +5698,68 @@ var eventCalendarStyles = `
5180
5698
  clip: rect(0, 0, 0, 0);
5181
5699
  white-space: nowrap;
5182
5700
  }
5183
-
5184
5701
  .sx-tcce .sx__date-input-wrapper {
5185
5702
  display: inline-flex;
5186
5703
  align-items: center;
5187
- gap: 2px;
5704
+ gap: 0.5rem;
5705
+ flex-shrink: 0;
5706
+
5188
5707
  height: 32px;
5189
- padding: 0 8px;
5190
- border: 1px solid var(--color-border);
5191
- border-radius: var(--border-radius-secondary-button, 0.625rem);
5192
- background: var(--color-background);
5708
+ padding: 0 1rem;
5709
+ min-width: 120px;
5710
+
5711
+ border-radius: 0.5rem;
5712
+ border: 1px solid transparent;
5713
+ background-color: var(--color-primary);
5714
+
5193
5715
  cursor: pointer;
5194
- transition: border-color 150ms;
5716
+ outline: none;
5717
+ user-select: none;
5718
+ transition: all 150ms ease;
5719
+
5195
5720
  overflow: hidden;
5721
+ justify-content: flex-start;
5722
+ color: var(--color-primary-foreground) !important;
5196
5723
  }
5197
5724
  .sx-tcce .sx__date-input-wrapper:focus-within {
5198
- border-color: var(--color-primary);
5725
+ border-color: var(--ring);
5726
+ box-shadow: 0 0 0 3px rgba(var(--ring-rgb), 0.3);
5727
+ }
5728
+ .sx-tcce .sx__date-input-wrapper:hover {
5729
+ background-color: var(--color-primary);
5730
+ opacity: 0.8;
5199
5731
  }
5200
-
5201
5732
  .sx-tcce .sx__date-input {
5202
- font-size: 12px;
5203
- font-weight: 500;
5733
+ font-size: 0.875rem;
5734
+ font-weight: 400;
5735
+ color: #ffffff;
5736
+ font-family: inherit;
5737
+
5204
5738
  background: transparent;
5205
5739
  border: none;
5206
5740
  outline: none;
5207
- width: 80px;
5208
- cursor: pointer;
5209
- color: var(--color-foreground);
5210
5741
  padding: 0;
5211
- font-family: inherit;
5742
+
5743
+ min-width: 100px;
5744
+ flex: 1;
5745
+
5746
+ cursor: pointer;
5747
+ }
5748
+
5749
+ .sx-tcce .sx__date-input::placeholder {
5750
+ color: rgba(255, 255, 255, 0.7);
5212
5751
  }
5213
5752
 
5214
5753
  .sx-tcce .sx__date-input-chevron-wrapper {
5215
- padding: 0;
5216
- width: 16px;
5217
- height: 16px;
5218
5754
  display: flex;
5219
5755
  align-items: center;
5220
5756
  justify-content: center;
5757
+ flex-shrink: 0;
5758
+
5759
+ width: 1rem;
5760
+ height: 1rem;
5761
+ padding: 0;
5762
+
5221
5763
  background: transparent;
5222
5764
  border: none;
5223
5765
  outline: none;
@@ -5225,52 +5767,199 @@ var eventCalendarStyles = `
5225
5767
  appearance: none;
5226
5768
  }
5227
5769
  .sx-tcce .sx__date-input-chevron {
5228
- width: 12px;
5229
- height: 12px;
5230
- opacity: 0.45;
5770
+ width: 1rem;
5771
+ height: 1rem;
5772
+ opacity: 1;
5773
+ color: #ffffff;
5231
5774
  }
5232
5775
 
5233
5776
  /* Date picker popup (the calendar that drops when clicking the date input) */
5234
5777
  .sx-tcce .sx__date-picker-popup {
5235
- border-radius: var(--border-radius-article, 0.875rem);
5778
+ border-radius: 0.5rem;
5236
5779
  border: 1px solid var(--color-border);
5780
+ background-color: var(--color-background);
5781
+
5782
+ padding: 0.75rem;
5783
+ font-size: 0.75rem;
5237
5784
  overflow: hidden;
5238
- font-size: 12px;
5239
- background: var(--color-background);
5785
+
5786
+ animation: popoverSlideIn 150ms ease-out;
5787
+ box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
5788
+ }
5789
+ @keyframes popoverSlideIn {
5790
+ from {
5791
+ opacity: 0;
5792
+ transform: translateY(-4px);
5793
+ }
5794
+ to {
5795
+ opacity: 1;
5796
+ transform: translateY(0);
5797
+ }
5240
5798
  }
5241
5799
  .sx-tcce .sx__date-picker__month-view-header {
5242
- padding: 10px 12px 6px;
5800
+ padding: 0.75rem 0.75rem 0.375rem;
5243
5801
  }
5244
5802
  .sx-tcce .sx__date-picker__month-view-header__month-year {
5245
- font-size: 13px;
5246
- font-weight: 700;
5803
+ font-size: 0.8125rem;
5804
+ font-weight: 600;
5805
+ color: var(--color-foreground);
5806
+ text-align: center;
5247
5807
  }
5248
5808
  .sx-tcce .sx__date-picker__day-names {
5249
- padding: 0 4px;
5809
+ display: flex;
5810
+ gap: 0.25rem;
5811
+ padding: 0.5rem 0.25rem;
5250
5812
  }
5251
5813
  .sx-tcce .sx__date-picker__day-name {
5252
- width: 32px;
5253
- font-size: 10px;
5814
+ display: flex;
5815
+ align-items: center;
5816
+ justify-content: center;
5817
+ flex: 1;
5818
+
5819
+ width: 2rem;
5820
+ height: 2rem;
5821
+ min-height: 2rem;
5822
+
5823
+ font-size: 0.625rem;
5254
5824
  font-weight: 600;
5255
5825
  color: var(--color-muted-foreground);
5256
5826
  text-transform: uppercase;
5257
5827
  letter-spacing: 0.04em;
5828
+
5829
+ user-select: none;
5830
+ }
5831
+ /* Week */
5832
+ .sx-tcce .sx__date-picker__week {
5833
+ display: flex;
5834
+ gap: 0.25rem;
5835
+ margin-top: 0.5rem;
5258
5836
  }
5259
5837
  .sx-tcce .sx__date-picker__day {
5260
- width: 32px;
5261
- height: 32px;
5262
- font-size: 12px;
5263
- border-radius: 6px;
5264
- transition: background 100ms;
5838
+ /* Layout */
5839
+ display: flex;
5840
+ align-items: center;
5841
+ justify-content: center;
5842
+ flex: 1;
5843
+
5844
+ width: 2rem;
5845
+ height: 2rem;
5846
+ min-height: 2rem;
5847
+ aspect-ratio: 1;
5848
+
5849
+ border-radius: 0.375rem;
5850
+ border: none;
5851
+ background: transparent;
5852
+ padding: 0;
5853
+ cursor: pointer;
5854
+
5855
+ font-size: 0.75rem;
5856
+ font-weight: 400;
5857
+ color: var(--color-foreground);
5858
+
5859
+ transition: all 100ms ease;
5860
+ outline: none;
5861
+ user-select: none;
5862
+ }
5863
+ .sx-tcce .sx__date-picker__day:hover:not(:disabled) {
5864
+ background-color: var(--color-accent);
5865
+ color: var(--color-accent-foreground);
5866
+ }
5867
+ .sx-tcce .sx__date-picker__day:focus-visible {
5868
+ box-shadow: inset 0 0 0 2px var(--color-primary);
5869
+ border-radius: 0.375rem;
5265
5870
  }
5266
5871
  .sx-tcce .sx__date-picker__day--today {
5267
- font-weight: 700;
5872
+ font-weight: 600;
5873
+ color: var(--color-primary);
5874
+ background-color: var(--color-accent);
5875
+ }
5876
+ .sx-tcce .sx__date-picker__day--today:hover {
5877
+ background-color: var(--color-accent);
5268
5878
  color: var(--color-primary);
5269
5879
  }
5270
5880
  .sx-tcce .sx__date-picker__day--selected {
5271
5881
  background: var(--color-primary) !important;
5272
5882
  color: var(--color-primary-foreground) !important;
5273
- border-radius: 50% !important;
5883
+ }
5884
+ /* Selected day */
5885
+ .sx-tcce .sx__date-picker__day--selected {
5886
+ background-color: var(--color-primary) !important;
5887
+ color: var(--color-primary-foreground) !important;
5888
+ border-radius: 0.375rem;
5889
+ font-weight: 500;
5890
+ }
5891
+
5892
+ .sx-tcce .sx__date-picker__day--selected:hover {
5893
+ opacity: 0.9;
5894
+ }
5895
+
5896
+ /* Outside days (prev/next month) */
5897
+ .sx-tcce .sx__date-picker__day--outside {
5898
+ color: var(--color-muted-foreground);
5899
+ opacity: 0.5;
5900
+ cursor: not-allowed;
5901
+ }
5902
+
5903
+ /* Disabled days */
5904
+ .sx-tcce .sx__date-picker__day:disabled {
5905
+ color: var(--color-muted-foreground);
5906
+ opacity: 0.4;
5907
+ cursor: not-allowed;
5908
+ }
5909
+
5910
+ .sx-tcce .sx__date-picker__day--range-start {
5911
+ background-color: var(--color-primary) !important;
5912
+ color: var(--color-primary-foreground) !important;
5913
+ border-radius: 0.375rem 0 0 0.375rem;
5914
+ }
5915
+
5916
+ .sx-tcce .sx__date-picker__day--range-middle {
5917
+ background-color: var(--color-primary);
5918
+ opacity: 0.2;
5919
+ border-radius: 0;
5920
+ }
5921
+
5922
+ .sx-tcce .sx__date-picker__day--range-end {
5923
+ background-color: var(--color-primary) !important;
5924
+ color: var(--color-primary-foreground) !important;
5925
+ border-radius: 0 0.375rem 0.375rem 0;
5926
+ }
5927
+
5928
+ /* Navigation buttons (previous/next month) */
5929
+ .sx-tcce .sx__date-picker__nav-button {
5930
+ display: flex;
5931
+ align-items: center;
5932
+ justify-content: center;
5933
+ width: 1.75rem;
5934
+ height: 1.75rem;
5935
+ padding: 0;
5936
+
5937
+ background: transparent;
5938
+ border: none;
5939
+ border-radius: 0.375rem;
5940
+ cursor: pointer;
5941
+ opacity: 0.5;
5942
+ transition: all 150ms ease;
5943
+ outline: none;
5944
+ }
5945
+
5946
+ .sx-tcce .sx__date-picker__nav-button:hover:not(:disabled) {
5947
+ opacity: 1;
5948
+ background-color: var(--color-accent);
5949
+ }
5950
+
5951
+ .sx-tcce .sx__date-picker__nav-button:focus-visible {
5952
+ box-shadow: 0 0 0 2px var(--color-primary);
5953
+ }
5954
+
5955
+ .sx-tcce .sx__date-picker__nav-button:disabled {
5956
+ opacity: 0.3;
5957
+ cursor: not-allowed;
5958
+ }
5959
+
5960
+ .sx-tcce .sx__date-picker__nav-button svg {
5961
+ width: 1rem;
5962
+ height: 1rem;
5274
5963
  }
5275
5964
 
5276
5965
  /* \u2500\u2500 Month grid \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
@@ -5678,7 +6367,7 @@ function TableHead({ className, ...props }) {
5678
6367
  {
5679
6368
  "data-slot": "table-head",
5680
6369
  className: cn(
5681
- "text-foreground h-12 px-3 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0",
6370
+ "text-foreground has([role=checkbox])]:pr-0 h-12 px-3 text-left align-middle font-medium whitespace-nowrap",
5682
6371
  className
5683
6372
  ),
5684
6373
  ...props
@@ -5691,7 +6380,7 @@ function TableCell({ className, ...props }) {
5691
6380
  {
5692
6381
  "data-slot": "table-cell",
5693
6382
  className: cn(
5694
- "p-3 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0",
6383
+ "has([role=checkbox])]:pr-0 p-3 align-middle whitespace-nowrap",
5695
6384
  className
5696
6385
  ),
5697
6386
  ...props
@@ -6691,7 +7380,7 @@ function useTablePersistence({
6691
7380
  };
6692
7381
  }
6693
7382
  var cellSizeClass = {
6694
- sm: "px-4 py-2 text-xs",
7383
+ sm: "px-1 py-0 text-xs",
6695
7384
  md: "px-5 py-2.5 text-sm",
6696
7385
  lg: "px-6 py-3 text-sm"
6697
7386
  };
@@ -7702,7 +8391,36 @@ exports.SelectSeparator = SelectSeparator;
7702
8391
  exports.SelectTrigger = SelectTrigger;
7703
8392
  exports.SelectValue = SelectValue;
7704
8393
  exports.Separator = Separator;
8394
+ exports.Sheet = Sheet;
8395
+ exports.SheetClose = SheetClose;
8396
+ exports.SheetContent = SheetContent;
8397
+ exports.SheetDescription = SheetDescription;
8398
+ exports.SheetFooter = SheetFooter;
8399
+ exports.SheetHeader = SheetHeader;
8400
+ exports.SheetTitle = SheetTitle;
8401
+ exports.SheetTrigger = SheetTrigger;
8402
+ exports.Sidebar = Sidebar;
8403
+ exports.SidebarContent = SidebarContent;
8404
+ exports.SidebarFooter = SidebarFooter;
8405
+ exports.SidebarGroup = SidebarGroup;
8406
+ exports.SidebarGroupAction = SidebarGroupAction;
8407
+ exports.SidebarGroupContent = SidebarGroupContent;
8408
+ exports.SidebarGroupLabel = SidebarGroupLabel;
8409
+ exports.SidebarHeader = SidebarHeader;
8410
+ exports.SidebarInput = SidebarInput;
8411
+ exports.SidebarInset = SidebarInset;
8412
+ exports.SidebarMenu = SidebarMenu;
8413
+ exports.SidebarMenuAction = SidebarMenuAction;
8414
+ exports.SidebarMenuBadge = SidebarMenuBadge;
8415
+ exports.SidebarMenuButton = SidebarMenuButton;
8416
+ exports.SidebarMenuItem = SidebarMenuItem;
8417
+ exports.SidebarMenuSkeleton = SidebarMenuSkeleton;
8418
+ exports.SidebarMenuSub = SidebarMenuSub;
8419
+ exports.SidebarMenuSubButton = SidebarMenuSubButton;
8420
+ exports.SidebarMenuSubItem = SidebarMenuSubItem;
7705
8421
  exports.SidebarProvider = SidebarProvider;
8422
+ exports.SidebarRail = SidebarRail;
8423
+ exports.SidebarSeparator = SidebarSeparator;
7706
8424
  exports.SidebarTrigger = SidebarTrigger;
7707
8425
  exports.Skeleton = Skeleton;
7708
8426
  exports.Slider = Slider;
@@ -7790,6 +8508,7 @@ exports.useCan = useCan;
7790
8508
  exports.useCarousel = useCarousel;
7791
8509
  exports.useColorPicker = useColorPicker;
7792
8510
  exports.useColumnFilter = useColumnFilter;
8511
+ exports.useSidebar = useSidebar;
7793
8512
  exports.useTableContext = useTableContext;
7794
8513
  exports.useTableData = useTableData;
7795
8514
  exports.useTableFiltering = useTableFiltering;