@kushagradhawan/kookie-ui 0.1.20 → 0.1.21

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.
Files changed (32) hide show
  1. package/components.css +1417 -0
  2. package/dist/cjs/components/index.d.ts +1 -0
  3. package/dist/cjs/components/index.d.ts.map +1 -1
  4. package/dist/cjs/components/index.js +1 -1
  5. package/dist/cjs/components/index.js.map +3 -3
  6. package/dist/cjs/components/sidebar.d.ts +157 -0
  7. package/dist/cjs/components/sidebar.d.ts.map +1 -0
  8. package/dist/cjs/components/sidebar.js +2 -0
  9. package/dist/cjs/components/sidebar.js.map +7 -0
  10. package/dist/cjs/components/sidebar.props.d.ts +60 -0
  11. package/dist/cjs/components/sidebar.props.d.ts.map +1 -0
  12. package/dist/cjs/components/sidebar.props.js +2 -0
  13. package/dist/cjs/components/sidebar.props.js.map +7 -0
  14. package/dist/esm/components/index.d.ts +1 -0
  15. package/dist/esm/components/index.d.ts.map +1 -1
  16. package/dist/esm/components/index.js +1 -1
  17. package/dist/esm/components/index.js.map +3 -3
  18. package/dist/esm/components/sidebar.d.ts +157 -0
  19. package/dist/esm/components/sidebar.d.ts.map +1 -0
  20. package/dist/esm/components/sidebar.js +2 -0
  21. package/dist/esm/components/sidebar.js.map +7 -0
  22. package/dist/esm/components/sidebar.props.d.ts +60 -0
  23. package/dist/esm/components/sidebar.props.d.ts.map +1 -0
  24. package/dist/esm/components/sidebar.props.js +2 -0
  25. package/dist/esm/components/sidebar.props.js.map +7 -0
  26. package/package.json +1 -1
  27. package/src/components/index.css +1 -0
  28. package/src/components/index.tsx +1 -1
  29. package/src/components/sidebar.css +1043 -0
  30. package/src/components/sidebar.props.tsx +54 -0
  31. package/src/components/sidebar.tsx +740 -0
  32. package/styles.css +1417 -0
@@ -0,0 +1,157 @@
1
+ import * as React from 'react';
2
+ import { Accordion } from 'radix-ui';
3
+ import { sidebarPropDefs } from './sidebar.props.js';
4
+ import { IconButton } from './icon-button.js';
5
+ import { Separator } from './separator.js';
6
+ import type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';
7
+ import type { GetPropDefTypes } from '../props/prop-def.js';
8
+ import type { BadgeProps } from './badge.js';
9
+ type BadgeConfig = {
10
+ content: React.ReactNode;
11
+ variant?: BadgeProps['variant'];
12
+ size?: BadgeProps['size'];
13
+ color?: BadgeProps['color'];
14
+ highContrast?: BadgeProps['highContrast'];
15
+ radius?: BadgeProps['radius'];
16
+ };
17
+ type SidebarContextProps = {
18
+ state: 'expanded' | 'collapsed';
19
+ open: boolean;
20
+ setOpen: (open: boolean) => void;
21
+ openMobile: boolean;
22
+ setOpenMobile: (open: boolean) => void;
23
+ isMobile: boolean;
24
+ toggleSidebar: () => void;
25
+ side: 'left' | 'right';
26
+ type: 'sidebar' | 'floating';
27
+ variant: 'soft' | 'surface' | 'ghost';
28
+ menuVariant: 'solid' | 'soft';
29
+ collapsible: 'offcanvas' | 'icon' | 'none';
30
+ size: '1' | '2';
31
+ };
32
+ declare function useSidebar(): SidebarContextProps;
33
+ interface SidebarProviderProps extends React.ComponentPropsWithoutRef<'div'> {
34
+ defaultOpen?: boolean;
35
+ open?: boolean;
36
+ onOpenChange?: (open: boolean) => void;
37
+ side?: 'left' | 'right';
38
+ }
39
+ declare const SidebarProvider: React.ForwardRefExoticComponent<SidebarProviderProps & React.RefAttributes<HTMLDivElement>>;
40
+ type SidebarOwnProps = GetPropDefTypes<typeof sidebarPropDefs>;
41
+ interface SidebarProps extends ComponentPropsWithout<'div', RemovedProps>, SidebarOwnProps {
42
+ }
43
+ declare const Sidebar: React.ForwardRefExoticComponent<SidebarProps & React.RefAttributes<HTMLDivElement>>;
44
+ interface SidebarContentProps extends React.ComponentPropsWithoutRef<'div'> {
45
+ }
46
+ declare const SidebarContent: React.ForwardRefExoticComponent<SidebarContentProps & React.RefAttributes<HTMLDivElement>>;
47
+ interface SidebarHeaderProps extends React.ComponentPropsWithoutRef<'div'> {
48
+ /**
49
+ * Whether to use the default flex container layout.
50
+ * @default true
51
+ */
52
+ asContainer?: boolean;
53
+ }
54
+ declare const SidebarHeader: React.ForwardRefExoticComponent<SidebarHeaderProps & React.RefAttributes<HTMLDivElement>>;
55
+ interface SidebarFooterProps extends React.ComponentPropsWithoutRef<'div'> {
56
+ /**
57
+ * Whether to use the default flex container layout.
58
+ * @default true
59
+ */
60
+ asContainer?: boolean;
61
+ }
62
+ declare const SidebarFooter: React.ForwardRefExoticComponent<SidebarFooterProps & React.RefAttributes<HTMLDivElement>>;
63
+ interface SidebarTriggerProps extends ComponentPropsWithout<typeof IconButton, RemovedProps> {
64
+ }
65
+ declare const SidebarTrigger: React.ForwardRefExoticComponent<Omit<SidebarTriggerProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
66
+ interface SidebarSeparatorProps extends ComponentPropsWithout<typeof Separator, RemovedProps> {
67
+ }
68
+ declare const SidebarSeparator: React.ForwardRefExoticComponent<SidebarSeparatorProps & React.RefAttributes<HTMLSpanElement>>;
69
+ interface SidebarMenuProps extends React.ComponentPropsWithoutRef<'ul'> {
70
+ }
71
+ declare const SidebarMenu: React.ForwardRefExoticComponent<SidebarMenuProps & React.RefAttributes<HTMLUListElement>>;
72
+ interface SidebarMenuItemProps extends React.ComponentPropsWithoutRef<'li'> {
73
+ }
74
+ declare const SidebarMenuItem: React.ForwardRefExoticComponent<SidebarMenuItemProps & React.RefAttributes<HTMLLIElement>>;
75
+ interface SidebarMenuButtonProps extends React.ComponentPropsWithoutRef<'button'> {
76
+ asChild?: boolean;
77
+ isActive?: boolean;
78
+ shortcut?: React.ReactNode;
79
+ badge?: string | BadgeConfig;
80
+ }
81
+ declare const SidebarMenuButton: React.ForwardRefExoticComponent<SidebarMenuButtonProps & React.RefAttributes<HTMLButtonElement>>;
82
+ interface SidebarMenuSubProps extends React.ComponentPropsWithoutRef<'div'> {
83
+ defaultOpen?: boolean;
84
+ }
85
+ declare const SidebarMenuSub: React.ForwardRefExoticComponent<SidebarMenuSubProps & React.RefAttributes<HTMLDivElement>>;
86
+ interface SidebarMenuSubTriggerProps extends React.ComponentPropsWithoutRef<typeof Accordion.Trigger> {
87
+ asChild?: boolean;
88
+ }
89
+ declare const SidebarMenuSubTrigger: React.ForwardRefExoticComponent<SidebarMenuSubTriggerProps & React.RefAttributes<HTMLButtonElement>>;
90
+ interface SidebarMenuSubContentProps extends React.ComponentPropsWithoutRef<typeof Accordion.Content> {
91
+ }
92
+ declare const SidebarMenuSubContent: React.ForwardRefExoticComponent<SidebarMenuSubContentProps & React.RefAttributes<HTMLDivElement>>;
93
+ interface SidebarGroupProps extends React.ComponentPropsWithoutRef<'div'> {
94
+ }
95
+ declare const SidebarGroup: React.ForwardRefExoticComponent<SidebarGroupProps & React.RefAttributes<HTMLDivElement>>;
96
+ interface SidebarGroupLabelProps extends React.ComponentPropsWithoutRef<'div'> {
97
+ asChild?: boolean;
98
+ }
99
+ declare const SidebarGroupLabel: React.ForwardRefExoticComponent<SidebarGroupLabelProps & React.RefAttributes<HTMLDivElement>>;
100
+ interface SidebarGroupContentProps extends React.ComponentPropsWithoutRef<'div'> {
101
+ }
102
+ declare const SidebarGroupContent: React.ForwardRefExoticComponent<SidebarGroupContentProps & React.RefAttributes<HTMLDivElement>>;
103
+ export { SidebarProvider as Provider, Sidebar as Root, SidebarContent as Content, SidebarHeader as Header, SidebarFooter as Footer, SidebarTrigger as Trigger, SidebarSeparator as Separator, SidebarMenu as Menu, SidebarMenuItem as MenuItem, SidebarMenuButton as MenuButton, SidebarMenuSub as MenuSub, SidebarMenuSubTrigger as MenuSubTrigger, SidebarMenuSubContent as MenuSubContent, SidebarGroup as Group, SidebarGroupLabel as GroupLabel, SidebarGroupContent as GroupContent, useSidebar, };
104
+ /**
105
+ * Enhanced Sidebar Header and Footer Usage Examples:
106
+ *
107
+ * 1. Simple default container (backwards compatible):
108
+ * <Sidebar.Header>
109
+ * <Logo />
110
+ * <span>App Name</span>
111
+ * </Sidebar.Header>
112
+ *
113
+ * 2. Custom flex layout:
114
+ * <Sidebar.Header className="rt-justify-between rt-gap-3">
115
+ * <Logo />
116
+ * <Sidebar.MenuButton>
117
+ * <SettingsIcon />
118
+ * </Sidebar.MenuButton>
119
+ * </Sidebar.Header>
120
+ *
121
+ * 3. Column layout for multiple rows:
122
+ * <Sidebar.Header className="rt-flex-col rt-gap-2" asContainer={false}>
123
+ * <div className="rt-flex rt-items-center rt-gap-2">
124
+ * <Logo />
125
+ * <span>App Name</span>
126
+ * </div>
127
+ * <Sidebar.MenuButton>
128
+ * <UserAvatar />
129
+ * <span>John Doe</span>
130
+ * </Sidebar.MenuButton>
131
+ * </Sidebar.Header>
132
+ *
133
+ * 4. Interactive footer with menu button:
134
+ * <Sidebar.Footer>
135
+ * <Sidebar.MenuButton>
136
+ * <UserIcon />
137
+ * <span>Settings</span>
138
+ * <ChevronUpIcon />
139
+ * </Sidebar.MenuButton>
140
+ * </Sidebar.Footer>
141
+ *
142
+ * 5. Custom footer layout:
143
+ * <Sidebar.Footer className="rt-justify-between">
144
+ * <span>v1.0.0</span>
145
+ * <Sidebar.MenuButton>
146
+ * <HelpIcon />
147
+ * </Sidebar.MenuButton>
148
+ * </Sidebar.Footer>
149
+ *
150
+ * Available utility classes:
151
+ * - Layout: rt-flex-row, rt-flex-col
152
+ * - Alignment: rt-items-center, rt-items-start, rt-items-end
153
+ * - Justification: rt-justify-between, rt-justify-center, rt-justify-start, rt-justify-end
154
+ * - Gap: rt-gap-1, rt-gap-2, rt-gap-3, rt-gap-4
155
+ */
156
+ export type { SidebarProviderProps as ProviderProps, SidebarProps as RootProps, SidebarContentProps as ContentProps, SidebarHeaderProps as HeaderProps, SidebarFooterProps as FooterProps, SidebarTriggerProps as TriggerProps, BadgeConfig, };
157
+ //# sourceMappingURL=sidebar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sidebar.d.ts","sourceRoot":"","sources":["../../../src/components/sidebar.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,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,CAAC;CACnB;AAED,QAAA,MAAM,iBAAiB,+FAYtB,CAAC;AAGF,UAAU,wBAAyB,SAAQ,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC;CAAG;AAEnF,QAAA,MAAM,mBAAmB,iGAQxB,CAAC;AAIF,OAAO,EACL,eAAe,IAAI,QAAQ,EAC3B,OAAO,IAAI,IAAI,EACf,cAAc,IAAI,OAAO,EACzB,aAAa,IAAI,MAAM,EACvB,aAAa,IAAI,MAAM,EACvB,cAAc,IAAI,OAAO,EACzB,gBAAgB,IAAI,SAAS,EAC7B,WAAW,IAAI,IAAI,EACnB,eAAe,IAAI,QAAQ,EAC3B,iBAAiB,IAAI,UAAU,EAC/B,cAAc,IAAI,OAAO,EACzB,qBAAqB,IAAI,cAAc,EACvC,qBAAqB,IAAI,cAAc,EACvC,YAAY,IAAI,KAAK,EACrB,iBAAiB,IAAI,UAAU,EAC/B,mBAAmB,IAAI,YAAY,EAEnC,UAAU,GACX,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AAEH,YAAY,EACV,oBAAoB,IAAI,aAAa,EACrC,YAAY,IAAI,SAAS,EACzB,mBAAmB,IAAI,YAAY,EACnC,kBAAkB,IAAI,WAAW,EACjC,kBAAkB,IAAI,WAAW,EACjC,mBAAmB,IAAI,YAAY,EACnC,WAAW,GACZ,CAAC"}
@@ -0,0 +1,2 @@
1
+ "use client";import*as e from"react";import n from"classnames";import{Slot as R}from"./slot.js";import{Accordion as x}from"radix-ui";import{sidebarPropDefs as P}from"./sidebar.props.js";import{Theme as H,useThemeContext as J}from"./theme.js";import{IconButton as Q}from"./icon-button.js";import{ScrollArea as X}from"./scroll-area.js";import{Separator as Y}from"./separator.js";import{ChevronDownIcon as Z,ThickChevronRightIcon as ee}from"./icons.js";import{extractProps as oe}from"../helpers/extract-props.js";import{Kbd as re}from"./kbd.js";import{Badge as L}from"./badge.js";const h=e.createContext(null);function w(){const o=e.useContext(h);if(!o)throw new Error("useSidebar must be used within a SidebarProvider.");return o}function te(){const[o,t]=e.useState(!1);return e.useEffect(()=>{const r=()=>{t(window.innerWidth<768)};return r(),window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)},[]),o}const z=e.forwardRef(({defaultOpen:o=!0,open:t,onOpenChange:r,side:a="left",className:i,children:s,...l},u)=>{const d=te(),[S,c]=e.useState(!1),[b,v]=e.useState(o),p=t??b,g=e.useCallback(f=>{const T=typeof f=="function"?f(p):f;r?r(T):v(T)},[r,p]),m=e.useCallback(()=>d?c(f=>!f):g(f=>!f),[d,g,c]),N=p?"expanded":"collapsed",y=e.useMemo(()=>({state:N,open:p,setOpen:g,isMobile:d,openMobile:S,setOpenMobile:c,toggleSidebar:m,side:a}),[N,p,g,d,S,c,m,a]);return e.createElement("div",{...l,ref:u,className:n("rt-SidebarProvider",i),"data-state":N,"data-side":a},e.createElement(h.Provider,{value:y},s))});z.displayName="Sidebar.Provider";const I=e.forwardRef((o,t)=>{const r=J(),{isMobile:a,state:i,openMobile:s,setOpenMobile:l}=w(),{size:u=P.size.default,variant:d=P.variant.default,menuVariant:S=P.menuVariant.default,type:c=P.type.default,side:b=P.side.default,collapsible:v=P.collapsible.default,panelBackground:p,color:g,highContrast:m=P.highContrast.default,asChild:N}=o,{className:y,children:f,...T}=oe(o,P),{asChild:ae,panelBackground:ne,...B}=T,M=g||r.accentColor,q=typeof u=="object"?u.initial||"2":u,C=e.useContext(h);return C&&(C.side=b,C.type=c,C.variant=d,C.menuVariant=S,C.collapsible=v,C.size=q),v==="none"?e.createElement("div",{...B,ref:t,"data-accent-color":M,"data-state":i,"data-side":b,"data-type":c,"data-collapsible":v,className:n("rt-SidebarRoot",`rt-r-size-${u}`,y)},e.createElement(H,null,e.createElement("div",{className:n("rt-SidebarContainer",`rt-variant-${d}`),"data-accent-color":M,"data-high-contrast":m||void 0,"data-side":b,"data-panel-background":p},f))):a?e.createElement("div",{...B,ref:t,"data-accent-color":M,"data-state":s?"open":"closed","data-side":b,"data-type":c,"data-collapsible":v,className:n("rt-SidebarRoot","rt-SidebarRoot--mobile",y)},e.createElement(H,null,e.createElement("div",{className:n("rt-SidebarContainer",`rt-variant-${d}`,`rt-r-size-${u}`),"data-accent-color":M,"data-high-contrast":m||void 0,"data-side":b,"data-panel-background":p},f))):e.createElement("div",{...B,ref:t,"data-accent-color":M,"data-state":i,"data-side":b,"data-type":c,"data-collapsible":v,className:n("rt-SidebarRoot",y)},e.createElement(H,null,e.createElement("div",{className:n("rt-SidebarContainer",`rt-variant-${d}`,`rt-r-size-${u}`),"data-accent-color":M,"data-high-contrast":m||void 0,"data-side":b,"data-panel-background":p},f)))});I.displayName="Sidebar.Root";const E=e.forwardRef(({className:o,children:t,...r},a)=>{const i=e.useContext(h),{size:s="2",menuVariant:l="soft"}=i||{};return e.createElement(X,{type:"auto"},e.createElement("div",{...r,ref:a,className:n("rt-SidebarContent",`rt-r-size-${s}`,`rt-menu-variant-${l}`,o)},t))});E.displayName="Sidebar.Content";const G=e.forwardRef(({className:o,asContainer:t=!0,...r},a)=>{const i=e.useContext(h),{size:s="2",menuVariant:l="soft"}=i||{};return e.createElement("div",{...r,ref:a,className:n("rt-SidebarHeader",`rt-r-size-${s}`,`rt-menu-variant-${l}`,{"rt-SidebarHeader--container":t},o)})});G.displayName="Sidebar.Header";const W=e.forwardRef(({className:o,asContainer:t=!0,...r},a)=>{const i=e.useContext(h),{size:s="2",menuVariant:l="soft"}=i||{};return e.createElement("div",{...r,ref:a,className:n("rt-SidebarFooter",`rt-r-size-${s}`,`rt-menu-variant-${l}`,{"rt-SidebarFooter--container":t},o)})});W.displayName="Sidebar.Footer";const D=e.forwardRef(({onClick:o,children:t,...r},a)=>{const{toggleSidebar:i}=w();return e.createElement(Q,{...r,ref:a,variant:"ghost",onClick:s=>{o?.(s),i()}},t||e.createElement(Z,null))});D.displayName="Sidebar.Trigger";const A=e.forwardRef(({className:o,...t},r)=>e.createElement(Y,{...t,ref:r,className:n("rt-SidebarSeparator",o)}));A.displayName="Sidebar.Separator";const $=e.forwardRef(({className:o,...t},r)=>e.createElement("ul",{...t,ref:r,className:n("rt-SidebarMenu",o)}));$.displayName="Sidebar.Menu";const O=e.forwardRef(({className:o,...t},r)=>e.createElement("li",{...t,ref:r,className:n("rt-SidebarMenuItem",o)}));O.displayName="Sidebar.MenuItem";const k=e.forwardRef(({asChild:o=!1,isActive:t=!1,shortcut:r,badge:a,className:i,children:s,onMouseEnter:l,onMouseLeave:u,...d},S)=>{const[c,b]=e.useState(!1),v=e.useContext(h),{size:p="2"}=v||{};return e.createElement(o?R:"button",{...d,ref:S,className:n("rt-reset","rt-SidebarMenuButton",i),"data-active":t||void 0,"data-highlighted":c||void 0,onMouseEnter:m=>{b(!0),l?.(m)},onMouseLeave:m=>{b(!1),u?.(m)}},o?s:e.createElement(e.Fragment,null,s,a&&e.createElement("div",{className:"rt-SidebarMenuBadge"},typeof a=="string"?e.createElement(L,{size:p,variant:"soft"},a):e.createElement(L,{size:a.size||p,variant:a.variant||"soft",color:a.color,highContrast:a.highContrast,radius:a.radius},a.content)),r&&e.createElement("div",{className:"rt-BaseMenuShortcut rt-SidebarMenuShortcut"},e.createElement(re,{size:p},r))))});k.displayName="Sidebar.MenuButton";const F=e.forwardRef(({defaultOpen:o=!1,children:t,...r},a)=>e.createElement("div",{...r,ref:a},e.createElement(x.Root,{type:"single",collapsible:!0,defaultValue:o?"item":void 0},e.createElement(x.Item,{value:"item"},t))));F.displayName="Sidebar.MenuSub";const V=e.forwardRef(({asChild:o=!1,className:t,children:r,onMouseEnter:a,onMouseLeave:i,...s},l)=>{const[u,d]=e.useState(!1);return e.createElement(x.Header,{asChild:!0},e.createElement("div",null,e.createElement(x.Trigger,{...s,ref:l,asChild:o,className:n("rt-reset","rt-SidebarMenuButton","rt-SidebarMenuSubTrigger",t),"data-highlighted":u||void 0,onMouseEnter:S=>{d(!0),a?.(S)},onMouseLeave:S=>{d(!1),i?.(S)}},o?r:e.createElement(e.Fragment,null,r,e.createElement(ee,{className:n("rt-BaseMenuSubTriggerIcon","rt-SidebarMenuSubTriggerIcon")})))))});V.displayName="Sidebar.MenuSubTrigger";const j=e.forwardRef(({className:o,children:t,...r},a)=>e.createElement(x.Content,{...r,ref:a,className:n("rt-SidebarMenuSubContent",o)},e.createElement("div",{className:"rt-SidebarMenuSubList"},t)));j.displayName="Sidebar.MenuSubContent";const _=e.forwardRef(({className:o,...t},r)=>e.createElement("div",{...t,ref:r,className:n("rt-SidebarGroup",o)}));_.displayName="Sidebar.Group";const K=e.forwardRef(({asChild:o=!1,className:t,...r},a)=>e.createElement(o?R:"div",{...r,ref:a,className:n("rt-SidebarGroupLabel",t)}));K.displayName="Sidebar.GroupLabel";const U=e.forwardRef(({className:o,...t},r)=>e.createElement("div",{...t,ref:r,className:n("rt-SidebarGroupContent",o)}));U.displayName="Sidebar.GroupContent";export{E as Content,W as Footer,_ as Group,U as GroupContent,K as GroupLabel,G as Header,$ as Menu,k as MenuButton,O as MenuItem,F as MenuSub,j as MenuSubContent,V as MenuSubTrigger,z as Provider,I as Root,A as Separator,D as Trigger,w as useSidebar};
2
+ //# sourceMappingURL=sidebar.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/sidebar.tsx"],
4
+ "sourcesContent": ["'use client';\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { Slot } from './slot.js';\nimport { Accordion } from 'radix-ui';\n\nimport { sidebarPropDefs } from './sidebar.props.js';\nimport { Theme, useThemeContext } from './theme.js';\nimport { IconButton } from './icon-button.js';\nimport { ScrollArea } from './scroll-area.js';\nimport { Separator } from './separator.js';\nimport { ChevronDownIcon, ThickChevronRightIcon } from './icons.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { Kbd } from './kbd.js';\nimport { Badge } from './badge.js';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\nimport type { BadgeProps } from './badge.js';\n\n// Badge configuration type for sidebar menu buttons\ntype BadgeConfig = {\n content: React.ReactNode;\n variant?: BadgeProps['variant'];\n size?: BadgeProps['size'];\n color?: BadgeProps['color'];\n highContrast?: BadgeProps['highContrast'];\n radius?: BadgeProps['radius'];\n};\n\n// Sidebar context for state management\ntype SidebarContextProps = {\n state: 'expanded' | 'collapsed';\n open: boolean;\n setOpen: (open: boolean) => void;\n openMobile: boolean;\n setOpenMobile: (open: boolean) => void;\n isMobile: boolean;\n toggleSidebar: () => void;\n side: 'left' | 'right';\n type: 'sidebar' | 'floating';\n variant: 'soft' | 'surface' | 'ghost';\n menuVariant: 'solid' | 'soft';\n collapsible: 'offcanvas' | 'icon' | 'none';\n size: '1' | '2';\n};\n\nconst SidebarContext = React.createContext<SidebarContextProps | null>(null);\n\nfunction useSidebar() {\n const context = React.useContext(SidebarContext);\n if (!context) {\n throw new Error('useSidebar must be used within a SidebarProvider.');\n }\n return context;\n}\n\n// Hook to detect mobile (simplified version)\nfunction useIsMobile() {\n const [isMobile, setIsMobile] = React.useState(false);\n\n React.useEffect(() => {\n const checkIsMobile = () => {\n setIsMobile(window.innerWidth < 768);\n };\n\n checkIsMobile();\n window.addEventListener('resize', checkIsMobile);\n return () => window.removeEventListener('resize', checkIsMobile);\n }, []);\n\n return isMobile;\n}\n\n// Provider component\ninterface SidebarProviderProps extends React.ComponentPropsWithoutRef<'div'> {\n defaultOpen?: boolean;\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n side?: 'left' | 'right';\n}\n\nconst SidebarProvider = React.forwardRef<HTMLDivElement, SidebarProviderProps>(\n (\n {\n defaultOpen = true,\n open: openProp,\n onOpenChange: setOpenProp,\n side = 'left',\n className,\n children,\n ...props\n },\n forwardedRef,\n ) => {\n const isMobile = useIsMobile();\n const [openMobile, setOpenMobile] = React.useState(false);\n\n // Internal state for uncontrolled mode\n const [internalOpen, setInternalOpen] = React.useState(defaultOpen);\n\n // Use controlled state if provided, otherwise internal state\n const open = openProp ?? internalOpen;\n\n const setOpen = React.useCallback(\n (value: boolean | ((value: boolean) => boolean)) => {\n const openState = typeof value === 'function' ? value(open) : value;\n if (setOpenProp) {\n setOpenProp(openState);\n } else {\n setInternalOpen(openState);\n }\n },\n [setOpenProp, open],\n );\n\n // Helper to toggle the sidebar\n const toggleSidebar = React.useCallback(() => {\n return isMobile ? setOpenMobile((open) => !open) : setOpen((open) => !open);\n }, [isMobile, setOpen, setOpenMobile]);\n\n // State for data attributes\n const state = open ? 'expanded' : 'collapsed';\n\n const contextValue = React.useMemo<Partial<SidebarContextProps>>(\n () => ({\n state,\n open,\n setOpen,\n isMobile,\n openMobile,\n setOpenMobile,\n toggleSidebar,\n side,\n }),\n [state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar, side],\n );\n\n return (\n <div\n {...props}\n ref={forwardedRef}\n className={classNames('rt-SidebarProvider', className)}\n data-state={state}\n data-side={side}\n >\n <SidebarContext.Provider value={contextValue as SidebarContextProps}>\n {children}\n </SidebarContext.Provider>\n </div>\n );\n },\n);\nSidebarProvider.displayName = 'Sidebar.Provider';\n\n// Main Sidebar component\ntype SidebarOwnProps = GetPropDefTypes<typeof sidebarPropDefs>;\ninterface SidebarProps extends ComponentPropsWithout<'div', RemovedProps>, SidebarOwnProps {}\n\nconst Sidebar = React.forwardRef<HTMLDivElement, SidebarProps>((props, forwardedRef) => {\n const themeContext = useThemeContext();\n const { isMobile, state, openMobile, setOpenMobile } = useSidebar();\n\n const {\n size = sidebarPropDefs.size.default,\n variant = sidebarPropDefs.variant.default,\n menuVariant = sidebarPropDefs.menuVariant.default,\n type = sidebarPropDefs.type.default,\n side = sidebarPropDefs.side.default,\n collapsible = sidebarPropDefs.collapsible.default,\n panelBackground,\n color,\n highContrast = sidebarPropDefs.highContrast.default,\n asChild,\n } = props;\n\n const { className, children, ...rootProps } = extractProps(props, sidebarPropDefs);\n const { asChild: _, panelBackground: __, ...safeRootProps } = rootProps; // Remove asChild and panelBackground from DOM props\n const resolvedColor = color || themeContext.accentColor;\n\n // Update context with current props - we'll pass the resolved values\n const resolvedSize = typeof size === 'object' ? size.initial || '2' : size;\n const context = React.useContext(SidebarContext);\n if (context) {\n context.side = side;\n context.type = type;\n context.variant = variant;\n context.menuVariant = menuVariant;\n context.collapsible = collapsible;\n context.size = resolvedSize;\n }\n\n if (collapsible === 'none') {\n return (\n <div\n {...safeRootProps}\n ref={forwardedRef}\n data-accent-color={resolvedColor}\n data-state={state}\n data-side={side}\n data-type={type}\n data-collapsible={collapsible}\n className={classNames('rt-SidebarRoot', `rt-r-size-${size}`, className)}\n >\n <Theme>\n <div\n className={classNames('rt-SidebarContainer', `rt-variant-${variant}`)}\n data-accent-color={resolvedColor}\n data-high-contrast={highContrast || undefined}\n data-side={side}\n data-panel-background={panelBackground}\n >\n {children}\n </div>\n </Theme>\n </div>\n );\n }\n\n if (isMobile) {\n return (\n <div\n {...safeRootProps}\n ref={forwardedRef}\n data-accent-color={resolvedColor}\n data-state={openMobile ? 'open' : 'closed'}\n data-side={side}\n data-type={type}\n data-collapsible={collapsible}\n className={classNames('rt-SidebarRoot', 'rt-SidebarRoot--mobile', className)}\n >\n <Theme>\n <div\n className={classNames(\n 'rt-SidebarContainer',\n `rt-variant-${variant}`,\n `rt-r-size-${size}`,\n )}\n data-accent-color={resolvedColor}\n data-high-contrast={highContrast || undefined}\n data-side={side}\n data-panel-background={panelBackground}\n >\n {children}\n </div>\n </Theme>\n </div>\n );\n }\n\n return (\n <div\n {...safeRootProps}\n ref={forwardedRef}\n data-accent-color={resolvedColor}\n data-state={state}\n data-side={side}\n data-type={type}\n data-collapsible={collapsible}\n className={classNames('rt-SidebarRoot', className)}\n >\n <Theme>\n <div\n className={classNames(\n 'rt-SidebarContainer',\n `rt-variant-${variant}`,\n `rt-r-size-${size}`,\n )}\n data-accent-color={resolvedColor}\n data-high-contrast={highContrast || undefined}\n data-side={side}\n data-panel-background={panelBackground}\n >\n {children}\n </div>\n </Theme>\n </div>\n );\n});\nSidebar.displayName = 'Sidebar.Root';\n\n// Sidebar content area\ninterface SidebarContentProps extends React.ComponentPropsWithoutRef<'div'> {}\n\nconst SidebarContent = React.forwardRef<HTMLDivElement, SidebarContentProps>(\n ({ className, children, ...props }, forwardedRef) => {\n const context = React.useContext(SidebarContext);\n const { size = '2', menuVariant = 'soft' } = context || {};\n\n return (\n <ScrollArea type=\"auto\">\n <div\n {...props}\n ref={forwardedRef}\n className={classNames(\n 'rt-SidebarContent',\n `rt-r-size-${size}`,\n `rt-menu-variant-${menuVariant}`,\n className,\n )}\n >\n {children}\n </div>\n </ScrollArea>\n );\n },\n);\nSidebarContent.displayName = 'Sidebar.Content';\n\n// Sidebar header\ninterface SidebarHeaderProps extends React.ComponentPropsWithoutRef<'div'> {\n /**\n * Whether to use the default flex container layout.\n * @default true\n */\n asContainer?: boolean;\n}\n\nconst SidebarHeader = React.forwardRef<HTMLDivElement, SidebarHeaderProps>(\n ({ className, asContainer = true, ...props }, forwardedRef) => {\n const context = React.useContext(SidebarContext);\n const { size = '2', menuVariant = 'soft' } = context || {};\n\n return (\n <div\n {...props}\n ref={forwardedRef}\n className={classNames(\n 'rt-SidebarHeader',\n `rt-r-size-${size}`,\n `rt-menu-variant-${menuVariant}`,\n {\n 'rt-SidebarHeader--container': asContainer,\n },\n className,\n )}\n />\n );\n },\n);\nSidebarHeader.displayName = 'Sidebar.Header';\n\n// Sidebar footer\ninterface SidebarFooterProps extends React.ComponentPropsWithoutRef<'div'> {\n /**\n * Whether to use the default flex container layout.\n * @default true\n */\n asContainer?: boolean;\n}\n\nconst SidebarFooter = React.forwardRef<HTMLDivElement, SidebarFooterProps>(\n ({ className, asContainer = true, ...props }, forwardedRef) => {\n const context = React.useContext(SidebarContext);\n const { size = '2', menuVariant = 'soft' } = context || {};\n\n return (\n <div\n {...props}\n ref={forwardedRef}\n className={classNames(\n 'rt-SidebarFooter',\n `rt-r-size-${size}`,\n `rt-menu-variant-${menuVariant}`,\n {\n 'rt-SidebarFooter--container': asContainer,\n },\n className,\n )}\n />\n );\n },\n);\nSidebarFooter.displayName = 'Sidebar.Footer';\n\n// Sidebar trigger button\ninterface SidebarTriggerProps extends ComponentPropsWithout<typeof IconButton, RemovedProps> {}\n\nconst SidebarTrigger = React.forwardRef<React.ElementRef<typeof IconButton>, SidebarTriggerProps>(\n ({ onClick, children, ...props }, forwardedRef) => {\n const { toggleSidebar } = useSidebar();\n\n return (\n <IconButton\n {...props}\n ref={forwardedRef}\n variant=\"ghost\"\n onClick={(event) => {\n onClick?.(event);\n toggleSidebar();\n }}\n >\n {children || <ChevronDownIcon />}\n </IconButton>\n );\n },\n);\nSidebarTrigger.displayName = 'Sidebar.Trigger';\n\n// Removed SidebarInset - not needed\n\n// Sidebar separator\ninterface SidebarSeparatorProps extends ComponentPropsWithout<typeof Separator, RemovedProps> {}\n\nconst SidebarSeparator = React.forwardRef<\n React.ComponentRef<typeof Separator>,\n SidebarSeparatorProps\n>(({ className, ...props }, forwardedRef) => (\n <Separator\n {...props}\n ref={forwardedRef}\n className={classNames('rt-SidebarSeparator', className)}\n />\n));\nSidebarSeparator.displayName = 'Sidebar.Separator';\n\n// Menu components - reusing dropdown menu structure\ninterface SidebarMenuProps extends React.ComponentPropsWithoutRef<'ul'> {}\n\nconst SidebarMenu = React.forwardRef<HTMLUListElement, SidebarMenuProps>(\n ({ className, ...props }, forwardedRef) => (\n <ul {...props} ref={forwardedRef} className={classNames('rt-SidebarMenu', className)} />\n ),\n);\nSidebarMenu.displayName = 'Sidebar.Menu';\n\ninterface SidebarMenuItemProps extends React.ComponentPropsWithoutRef<'li'> {}\n\nconst SidebarMenuItem = React.forwardRef<HTMLLIElement, SidebarMenuItemProps>(\n ({ className, ...props }, forwardedRef) => (\n <li {...props} ref={forwardedRef} className={classNames('rt-SidebarMenuItem', className)} />\n ),\n);\nSidebarMenuItem.displayName = 'Sidebar.MenuItem';\n\ninterface SidebarMenuButtonProps extends React.ComponentPropsWithoutRef<'button'> {\n asChild?: boolean;\n isActive?: boolean;\n shortcut?: React.ReactNode;\n badge?: string | BadgeConfig;\n}\n\nconst SidebarMenuButton = React.forwardRef<HTMLButtonElement, SidebarMenuButtonProps>(\n (\n {\n asChild = false,\n isActive = false,\n shortcut,\n badge,\n className,\n children,\n onMouseEnter,\n onMouseLeave,\n ...props\n },\n forwardedRef,\n ) => {\n const [isHighlighted, setIsHighlighted] = React.useState(false);\n const context = React.useContext(SidebarContext);\n const { size: sidebarSize = '2' } = context || {};\n\n const Comp = asChild ? Slot : 'button';\n\n return (\n <Comp\n {...props}\n ref={forwardedRef}\n className={classNames('rt-reset', 'rt-SidebarMenuButton', className)}\n data-active={isActive || undefined}\n data-highlighted={isHighlighted || undefined}\n onMouseEnter={(event) => {\n setIsHighlighted(true);\n onMouseEnter?.(event);\n }}\n onMouseLeave={(event) => {\n setIsHighlighted(false);\n onMouseLeave?.(event);\n }}\n >\n {asChild ? (\n children\n ) : (\n <>\n {children}\n {/* Badge with soft variant default and size mapping to sidebar size */}\n {badge && (\n <div className=\"rt-SidebarMenuBadge\">\n {typeof badge === 'string' ? (\n <Badge size={sidebarSize} variant=\"soft\">\n {badge}\n </Badge>\n ) : (\n <Badge\n size={badge.size || sidebarSize}\n variant={badge.variant || 'soft'}\n color={badge.color}\n highContrast={badge.highContrast}\n radius={badge.radius}\n >\n {badge.content}\n </Badge>\n )}\n </div>\n )}\n {shortcut && (\n <div className=\"rt-BaseMenuShortcut rt-SidebarMenuShortcut\">\n <Kbd size={sidebarSize}>{shortcut}</Kbd>\n </div>\n )}\n </>\n )}\n </Comp>\n );\n },\n);\nSidebarMenuButton.displayName = 'Sidebar.MenuButton';\n\n// Sub-menu components using Radix Accordion\ninterface SidebarMenuSubProps extends React.ComponentPropsWithoutRef<'div'> {\n defaultOpen?: boolean;\n}\n\nconst SidebarMenuSub = React.forwardRef<HTMLDivElement, SidebarMenuSubProps>(\n ({ defaultOpen = false, children, ...props }, forwardedRef) => {\n return (\n <div {...props} ref={forwardedRef}>\n <Accordion.Root type=\"single\" collapsible defaultValue={defaultOpen ? 'item' : undefined}>\n <Accordion.Item value=\"item\">{children}</Accordion.Item>\n </Accordion.Root>\n </div>\n );\n },\n);\nSidebarMenuSub.displayName = 'Sidebar.MenuSub';\n\ninterface SidebarMenuSubTriggerProps\n extends React.ComponentPropsWithoutRef<typeof Accordion.Trigger> {\n asChild?: boolean;\n}\n\nconst SidebarMenuSubTrigger = React.forwardRef<\n React.ElementRef<typeof Accordion.Trigger>,\n SidebarMenuSubTriggerProps\n>(\n (\n { asChild = false, className, children, onMouseEnter, onMouseLeave, ...props },\n forwardedRef,\n ) => {\n const [isHighlighted, setIsHighlighted] = React.useState(false);\n\n return (\n <Accordion.Header asChild>\n <div>\n <Accordion.Trigger\n {...props}\n ref={forwardedRef}\n asChild={asChild}\n className={classNames(\n 'rt-reset',\n 'rt-SidebarMenuButton',\n 'rt-SidebarMenuSubTrigger',\n className,\n )}\n data-highlighted={isHighlighted || undefined}\n onMouseEnter={(event) => {\n setIsHighlighted(true);\n onMouseEnter?.(event);\n }}\n onMouseLeave={(event) => {\n setIsHighlighted(false);\n onMouseLeave?.(event);\n }}\n >\n {asChild ? (\n children\n ) : (\n <>\n {children}\n <ThickChevronRightIcon\n className={classNames(\n 'rt-BaseMenuSubTriggerIcon',\n 'rt-SidebarMenuSubTriggerIcon',\n )}\n />\n </>\n )}\n </Accordion.Trigger>\n </div>\n </Accordion.Header>\n );\n },\n);\nSidebarMenuSubTrigger.displayName = 'Sidebar.MenuSubTrigger';\n\ninterface SidebarMenuSubContentProps\n extends React.ComponentPropsWithoutRef<typeof Accordion.Content> {}\n\nconst SidebarMenuSubContent = React.forwardRef<\n React.ElementRef<typeof Accordion.Content>,\n SidebarMenuSubContentProps\n>(({ className, children, ...props }, forwardedRef) => {\n return (\n <Accordion.Content\n {...props}\n ref={forwardedRef}\n className={classNames('rt-SidebarMenuSubContent', className)}\n >\n <div className=\"rt-SidebarMenuSubList\">{children}</div>\n </Accordion.Content>\n );\n});\nSidebarMenuSubContent.displayName = 'Sidebar.MenuSubContent';\n\n// Group components\ninterface SidebarGroupProps extends React.ComponentPropsWithoutRef<'div'> {}\n\nconst SidebarGroup = React.forwardRef<HTMLDivElement, SidebarGroupProps>(\n ({ className, ...props }, forwardedRef) => (\n <div {...props} ref={forwardedRef} className={classNames('rt-SidebarGroup', className)} />\n ),\n);\nSidebarGroup.displayName = 'Sidebar.Group';\n\ninterface SidebarGroupLabelProps extends React.ComponentPropsWithoutRef<'div'> {\n asChild?: boolean;\n}\n\nconst SidebarGroupLabel = React.forwardRef<HTMLDivElement, SidebarGroupLabelProps>(\n ({ asChild = false, className, ...props }, forwardedRef) => {\n const Comp = asChild ? Slot : 'div';\n\n return (\n <Comp\n {...props}\n ref={forwardedRef}\n className={classNames('rt-SidebarGroupLabel', className)}\n />\n );\n },\n);\nSidebarGroupLabel.displayName = 'Sidebar.GroupLabel';\n\ninterface SidebarGroupContentProps extends React.ComponentPropsWithoutRef<'div'> {}\n\nconst SidebarGroupContent = React.forwardRef<HTMLDivElement, SidebarGroupContentProps>(\n ({ className, ...props }, forwardedRef) => (\n <div\n {...props}\n ref={forwardedRef}\n className={classNames('rt-SidebarGroupContent', className)}\n />\n ),\n);\nSidebarGroupContent.displayName = 'Sidebar.GroupContent';\n\n// Export all components following shadcn's pattern\nexport {\n SidebarProvider as Provider,\n Sidebar as Root,\n SidebarContent as Content,\n SidebarHeader as Header,\n SidebarFooter as Footer,\n SidebarTrigger as Trigger,\n SidebarSeparator as Separator,\n SidebarMenu as Menu,\n SidebarMenuItem as MenuItem,\n SidebarMenuButton as MenuButton,\n SidebarMenuSub as MenuSub,\n SidebarMenuSubTrigger as MenuSubTrigger,\n SidebarMenuSubContent as MenuSubContent,\n SidebarGroup as Group,\n SidebarGroupLabel as GroupLabel,\n SidebarGroupContent as GroupContent,\n // Export hook\n useSidebar,\n};\n\n/**\n * Enhanced Sidebar Header and Footer Usage Examples:\n *\n * 1. Simple default container (backwards compatible):\n * <Sidebar.Header>\n * <Logo />\n * <span>App Name</span>\n * </Sidebar.Header>\n *\n * 2. Custom flex layout:\n * <Sidebar.Header className=\"rt-justify-between rt-gap-3\">\n * <Logo />\n * <Sidebar.MenuButton>\n * <SettingsIcon />\n * </Sidebar.MenuButton>\n * </Sidebar.Header>\n *\n * 3. Column layout for multiple rows:\n * <Sidebar.Header className=\"rt-flex-col rt-gap-2\" asContainer={false}>\n * <div className=\"rt-flex rt-items-center rt-gap-2\">\n * <Logo />\n * <span>App Name</span>\n * </div>\n * <Sidebar.MenuButton>\n * <UserAvatar />\n * <span>John Doe</span>\n * </Sidebar.MenuButton>\n * </Sidebar.Header>\n *\n * 4. Interactive footer with menu button:\n * <Sidebar.Footer>\n * <Sidebar.MenuButton>\n * <UserIcon />\n * <span>Settings</span>\n * <ChevronUpIcon />\n * </Sidebar.MenuButton>\n * </Sidebar.Footer>\n *\n * 5. Custom footer layout:\n * <Sidebar.Footer className=\"rt-justify-between\">\n * <span>v1.0.0</span>\n * <Sidebar.MenuButton>\n * <HelpIcon />\n * </Sidebar.MenuButton>\n * </Sidebar.Footer>\n *\n * Available utility classes:\n * - Layout: rt-flex-row, rt-flex-col\n * - Alignment: rt-items-center, rt-items-start, rt-items-end\n * - Justification: rt-justify-between, rt-justify-center, rt-justify-start, rt-justify-end\n * - Gap: rt-gap-1, rt-gap-2, rt-gap-3, rt-gap-4\n */\n\nexport type {\n SidebarProviderProps as ProviderProps,\n SidebarProps as RootProps,\n SidebarContentProps as ContentProps,\n SidebarHeaderProps as HeaderProps,\n SidebarFooterProps as FooterProps,\n SidebarTriggerProps as TriggerProps,\n BadgeConfig,\n};\n"],
5
+ "mappings": "aAEA,UAAYA,MAAW,QACvB,OAAOC,MAAgB,aACvB,OAAS,QAAAC,MAAY,YACrB,OAAS,aAAAC,MAAiB,WAE1B,OAAS,mBAAAC,MAAuB,qBAChC,OAAS,SAAAC,EAAO,mBAAAC,MAAuB,aACvC,OAAS,cAAAC,MAAkB,mBAC3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CAAS,EAAG,CAE5F,EACAsD,EAAa,YAAc,gBAM3B,MAAMC,EAAoBlF,EAAM,WAC9B,CAAC,CAAE,QAAAoD,EAAU,GAAO,UAAAzB,EAAW,GAAGE,CAAM,EAAGC,IAIvC9B,EAAA,cAHWoD,EAAUlD,EAAO,MAG3B,CACE,GAAG2B,EACJ,IAAKC,EACL,UAAW7B,EAAW,uBAAwB0B,CAAS,EACzD,CAGN,EACAuD,EAAkB,YAAc,qBAIhC,MAAMC,EAAsBnF,EAAM,WAChC,CAAC,CAAE,UAAA2B,EAAW,GAAGE,CAAM,EAAGC,IACxB9B,EAAA,cAAC,OACE,GAAG6B,EACJ,IAAKC,EACL,UAAW7B,EAAW,yBAA0B0B,CAAS,EAC3D,CAEJ,EACAwD,EAAoB,YAAc",
6
+ "names": ["React", "classNames", "Slot", "Accordion", "sidebarPropDefs", "Theme", "useThemeContext", "IconButton", "ScrollArea", "Separator", "ChevronDownIcon", "ThickChevronRightIcon", "extractProps", "Kbd", "Badge", "SidebarContext", "useSidebar", "context", "useIsMobile", "isMobile", "setIsMobile", "checkIsMobile", "SidebarProvider", "defaultOpen", "openProp", "setOpenProp", "side", "className", "children", "props", "forwardedRef", "openMobile", "setOpenMobile", "internalOpen", "setInternalOpen", "open", "setOpen", "value", "openState", "toggleSidebar", "state", "contextValue", "Sidebar", "themeContext", "size", "variant", "menuVariant", "type", "collapsible", "panelBackground", "color", "highContrast", "asChild", "rootProps", "_", "__", "safeRootProps", "resolvedColor", "resolvedSize", "SidebarContent", "SidebarHeader", "asContainer", "SidebarFooter", "SidebarTrigger", "onClick", "event", "SidebarSeparator", "SidebarMenu", "SidebarMenuItem", "SidebarMenuButton", "isActive", "shortcut", "badge", "onMouseEnter", "onMouseLeave", "isHighlighted", "setIsHighlighted", "sidebarSize", "SidebarMenuSub", "SidebarMenuSubTrigger", "SidebarMenuSubContent", "SidebarGroup", "SidebarGroupLabel", "SidebarGroupContent"]
7
+ }
@@ -0,0 +1,60 @@
1
+ export { baseMenuContentPropDefs as sidebarContentPropDefs, baseMenuItemPropDefs as sidebarItemPropDefs, baseMenuCheckboxItemPropDefs as sidebarCheckboxItemPropDefs, baseMenuRadioItemPropDefs as sidebarRadioItemPropDefs, } from './_internal/base-menu.props.js';
2
+ declare const sidebarPropDefs: {
3
+ highContrast: {
4
+ type: "boolean";
5
+ className: string;
6
+ default: undefined;
7
+ };
8
+ color: {
9
+ type: "enum";
10
+ values: readonly ["gray", "gold", "bronze", "brown", "yellow", "amber", "orange", "tomato", "red", "ruby", "crimson", "pink", "plum", "purple", "violet", "iris", "indigo", "blue", "cyan", "teal", "jade", "green", "grass", "lime", "mint", "sky"];
11
+ default: ("gray" | "gold" | "bronze" | "brown" | "yellow" | "amber" | "orange" | "tomato" | "red" | "ruby" | "crimson" | "pink" | "plum" | "purple" | "violet" | "iris" | "indigo" | "blue" | "cyan" | "teal" | "jade" | "green" | "grass" | "lime" | "mint" | "sky") | undefined;
12
+ };
13
+ size: {
14
+ type: "enum";
15
+ className: string;
16
+ values: readonly ["1", "2"];
17
+ default: "2";
18
+ responsive: true;
19
+ };
20
+ variant: {
21
+ type: "enum";
22
+ className: string;
23
+ values: readonly ["soft", "surface", "ghost"];
24
+ default: "surface";
25
+ };
26
+ menuVariant: {
27
+ type: "enum";
28
+ className: string;
29
+ values: readonly ["solid", "soft"];
30
+ default: "soft";
31
+ };
32
+ type: {
33
+ type: "enum";
34
+ className: string;
35
+ values: readonly ["sidebar", "floating"];
36
+ default: "sidebar";
37
+ };
38
+ side: {
39
+ type: "enum";
40
+ className: string;
41
+ values: readonly ["left", "right"];
42
+ default: "left";
43
+ };
44
+ collapsible: {
45
+ type: "enum";
46
+ className: string;
47
+ values: readonly ["offcanvas", "icon", "none"];
48
+ default: "offcanvas";
49
+ };
50
+ panelBackground: {
51
+ type: "enum";
52
+ values: ("solid" | "translucent")[];
53
+ default: undefined;
54
+ };
55
+ asChild: {
56
+ type: "boolean";
57
+ };
58
+ };
59
+ export { sidebarPropDefs };
60
+ //# sourceMappingURL=sidebar.props.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sidebar.props.d.ts","sourceRoot":"","sources":["../../../src/components/sidebar.props.tsx"],"names":[],"mappings":"AAOA,OAAO,EACL,uBAAuB,IAAI,sBAAsB,EACjD,oBAAoB,IAAI,mBAAmB,EAC3C,4BAA4B,IAAI,2BAA2B,EAC3D,yBAAyB,IAAI,wBAAwB,GACtD,MAAM,gCAAgC,CAAC;AAUxC,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BpB,CAAC;AAEF,OAAO,EAAE,eAAe,EAAE,CAAC"}
@@ -0,0 +1,2 @@
1
+ import{asChildPropDef as e}from"../props/as-child.prop.js";import{colorPropDef as s}from"../props/color.prop.js";import{highContrastPropDef as a}from"../props/high-contrast.prop.js";import{baseMenuContentPropDefs as b,baseMenuItemPropDefs as D,baseMenuCheckboxItemPropDefs as P,baseMenuRadioItemPropDefs as y}from"./_internal/base-menu.props.js";const t=["1","2"],o=["soft","surface","ghost"],r=["solid","soft"],n=["sidebar","floating"],p=["left","right"],f=["offcanvas","icon","none"],i={...e,size:{type:"enum",className:"rt-r-size",values:t,default:"2",responsive:!0},variant:{type:"enum",className:"rt-variant",values:o,default:"surface"},menuVariant:{type:"enum",className:"rt-menu-variant",values:r,default:"soft"},type:{type:"enum",className:"rt-type",values:n,default:"sidebar"},side:{type:"enum",className:"rt-side",values:p,default:"left"},collapsible:{type:"enum",className:"rt-collapsible",values:f,default:"offcanvas"},panelBackground:{type:"enum",values:["solid","translucent"],default:void 0},...s,...a};export{P as sidebarCheckboxItemPropDefs,b as sidebarContentPropDefs,D as sidebarItemPropDefs,i as sidebarPropDefs,y as sidebarRadioItemPropDefs};
2
+ //# sourceMappingURL=sidebar.props.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/sidebar.props.tsx"],
4
+ "sourcesContent": ["import { asChildPropDef } from '../props/as-child.prop.js';\nimport { colorPropDef } from '../props/color.prop.js';\nimport { highContrastPropDef } from '../props/high-contrast.prop.js';\n\nimport type { PropDef } from '../props/prop-def.js';\n\n// Re-export base menu props for sidebar menu components\nexport {\n baseMenuContentPropDefs as sidebarContentPropDefs,\n baseMenuItemPropDefs as sidebarItemPropDefs,\n baseMenuCheckboxItemPropDefs as sidebarCheckboxItemPropDefs,\n baseMenuRadioItemPropDefs as sidebarRadioItemPropDefs,\n} from './_internal/base-menu.props.js';\n\n// Sidebar container props\nconst sizes = ['1', '2'] as const;\nconst variants = ['soft', 'surface', 'ghost'] as const;\nconst menuVariants = ['solid', 'soft'] as const;\nconst types = ['sidebar', 'floating'] as const;\nconst sides = ['left', 'right'] as const;\nconst collapsibleModes = ['offcanvas', 'icon', 'none'] as const;\n\nconst sidebarPropDefs = {\n ...asChildPropDef,\n size: { type: 'enum', className: 'rt-r-size', values: sizes, default: '2', responsive: true },\n variant: { type: 'enum', className: 'rt-variant', values: variants, default: 'surface' },\n menuVariant: {\n type: 'enum',\n className: 'rt-menu-variant',\n values: menuVariants,\n default: 'soft',\n },\n type: { type: 'enum', className: 'rt-type', values: types, default: 'sidebar' },\n side: { type: 'enum', className: 'rt-side', values: sides, default: 'left' },\n collapsible: {\n type: 'enum',\n className: 'rt-collapsible',\n values: collapsibleModes,\n default: 'offcanvas',\n },\n panelBackground: { type: 'enum', values: ['solid', 'translucent'], default: undefined },\n ...colorPropDef,\n ...highContrastPropDef,\n} satisfies {\n size: PropDef<(typeof sizes)[number]>;\n variant: PropDef<(typeof variants)[number]>;\n menuVariant: PropDef<(typeof menuVariants)[number]>;\n type: PropDef<(typeof types)[number]>;\n side: PropDef<(typeof sides)[number]>;\n collapsible: PropDef<(typeof collapsibleModes)[number]>;\n panelBackground: PropDef<'solid' | 'translucent'>;\n};\n\nexport { sidebarPropDefs };\n"],
5
+ "mappings": "AAAA,OAAS,kBAAAA,MAAsB,4BAC/B,OAAS,gBAAAC,MAAoB,yBAC7B,OAAS,uBAAAC,MAA2B,iCAKpC,OAC6B,2BAA3BC,EACwB,wBAAxBC,EACgC,gCAAhCC,EAC6B,6BAA7BC,MACK,iCAGP,MAAMC,EAAQ,CAAC,IAAK,GAAG,EACjBC,EAAW,CAAC,OAAQ,UAAW,OAAO,EACtCC,EAAe,CAAC,QAAS,MAAM,EAC/BC,EAAQ,CAAC,UAAW,UAAU,EAC9BC,EAAQ,CAAC,OAAQ,OAAO,EACxBC,EAAmB,CAAC,YAAa,OAAQ,MAAM,EAE/CC,EAAkB,CACtB,GAAGb,EACH,KAAM,CAAE,KAAM,OAAQ,UAAW,YAAa,OAAQO,EAAO,QAAS,IAAK,WAAY,EAAK,EAC5F,QAAS,CAAE,KAAM,OAAQ,UAAW,aAAc,OAAQC,EAAU,QAAS,SAAU,EACvF,YAAa,CACX,KAAM,OACN,UAAW,kBACX,OAAQC,EACR,QAAS,MACX,EACA,KAAM,CAAE,KAAM,OAAQ,UAAW,UAAW,OAAQC,EAAO,QAAS,SAAU,EAC9E,KAAM,CAAE,KAAM,OAAQ,UAAW,UAAW,OAAQC,EAAO,QAAS,MAAO,EAC3E,YAAa,CACX,KAAM,OACN,UAAW,iBACX,OAAQC,EACR,QAAS,WACX,EACA,gBAAiB,CAAE,KAAM,OAAQ,OAAQ,CAAC,QAAS,aAAa,EAAG,QAAS,MAAU,EACtF,GAAGX,EACH,GAAGC,CACL",
6
+ "names": ["asChildPropDef", "colorPropDef", "highContrastPropDef", "baseMenuContentPropDefs", "baseMenuItemPropDefs", "baseMenuCheckboxItemPropDefs", "baseMenuRadioItemPropDefs", "sizes", "variants", "menuVariants", "types", "sides", "collapsibleModes", "sidebarPropDefs"]
7
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kushagradhawan/kookie-ui",
3
- "version": "0.1.20",
3
+ "version": "0.1.21",
4
4
  "description": "A modern React component library with beautiful design tokens, flexible theming, and comprehensive docs",
5
5
  "keywords": [
6
6
  "react",
@@ -41,6 +41,7 @@
41
41
  @import './segmented-control.css';
42
42
  @import './select.css';
43
43
  @import './separator.css';
44
+ @import './sidebar.css';
44
45
  @import './slider.css';
45
46
  @import './spinner.css';
46
47
  @import './strong.css';
@@ -65,4 +65,4 @@ export { ToggleButton, type ToggleButtonProps } from './toggle-button.js';
65
65
  export { ToggleIconButton, type ToggleIconButtonProps } from './toggle-icon-button.js';
66
66
  export { Tooltip, type TooltipProps } from './tooltip.js';
67
67
  export { VisuallyHidden, type VisuallyHiddenProps } from './visually-hidden.js';
68
- // export * as Sidebar from './sidebar.js'; // Temporarily disabled due to ESM import issues
68
+ export * as Sidebar from './sidebar.js';