ml-uikit 1.1.1 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ui/alert.d.ts +4 -0
- package/dist/components/ui/alert.d.ts.map +1 -1
- package/dist/components/ui/select.d.ts +6 -1
- package/dist/components/ui/select.d.ts.map +1 -1
- package/dist/components/ui/sidebar.d.ts.map +1 -1
- package/dist/index.cjs4.js +1 -1
- package/dist/index.cjs4.js.map +1 -1
- package/dist/index.cjs42.js +1 -1
- package/dist/index.cjs42.js.map +1 -1
- package/dist/index.cjs45.js +1 -1
- package/dist/index.cjs45.js.map +1 -1
- package/dist/index.cjs52.js +1 -1
- package/dist/index.cjs52.js.map +1 -1
- package/dist/index.es4.js +49 -44
- package/dist/index.es4.js.map +1 -1
- package/dist/index.es42.js +150 -86
- package/dist/index.es42.js.map +1 -1
- package/dist/index.es45.js +254 -229
- package/dist/index.es45.js.map +1 -1
- package/dist/index.es52.js +16 -16
- package/dist/index.es52.js.map +1 -1
- package/dist/style.css +219 -98
- package/package.json +1 -1
- package/dist/hooks/use-mobile.d.ts +0 -2
- package/dist/hooks/use-mobile.d.ts.map +0 -1
- package/dist/index.cjs58.js +0 -2
- package/dist/index.cjs58.js.map +0 -1
- package/dist/index.es58.js +0 -15
- package/dist/index.es58.js.map +0 -1
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
type AlertState = "warning" | "neutral" | "success" | "negative";
|
|
3
4
|
declare const Alert: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & VariantProps<(props?: ({
|
|
4
5
|
variant?: "default" | "destructive" | "success" | "error" | "warning" | "info" | null | undefined;
|
|
5
6
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string> & {
|
|
6
7
|
icon?: React.ReactNode;
|
|
8
|
+
showIcon?: boolean | undefined;
|
|
9
|
+
state?: AlertState | undefined;
|
|
10
|
+
action?: React.ReactNode;
|
|
7
11
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
8
12
|
declare const AlertTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHeadingElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
9
13
|
declare const AlertDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/alert.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/alert.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAQ9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAwCjE,KAAK,UAAU,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,CAAA;AAShE,QAAA,MAAM,KAAK;;;WAIE,MAAM,SAAS;;;aAGb,MAAM,SAAS;wCAgC5B,CAAA;AAGF,QAAA,MAAM,UAAU,uHASd,CAAA;AAGF,QAAA,MAAM,gBAAgB,yHAYpB,CAAA;AAGF,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,CAAA"}
|
|
@@ -6,7 +6,12 @@ declare const SelectValue: React.ForwardRefExoticComponent<SelectPrimitive.Selec
|
|
|
6
6
|
declare const SelectTrigger: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
7
7
|
declare const SelectScrollUpButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollUpButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
8
|
declare const SelectScrollDownButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollDownButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
-
declare const SelectContent: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectContentProps & React.RefAttributes<HTMLDivElement>, "ref"> &
|
|
9
|
+
declare const SelectContent: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
10
|
+
enableSearch?: boolean | undefined;
|
|
11
|
+
searchPlaceholder?: string | undefined;
|
|
12
|
+
searchValue?: string | undefined;
|
|
13
|
+
onSearchValueChange?: ((value: string) => void) | undefined;
|
|
14
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
10
15
|
declare const SelectLabel: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
11
16
|
declare const SelectItem: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
12
17
|
declare const SelectSeparator: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/select.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAA;AAKzD,QAAA,MAAM,MAAM,uCAAuB,CAAA;AAEnC,QAAA,MAAM,WAAW,yGAAwB,CAAA;AAEzC,QAAA,MAAM,WAAW,0GAAwB,CAAA;AAEzC,QAAA,MAAM,aAAa,oKAqBjB,CAAA;AAGF,QAAA,MAAM,oBAAoB,qKAcxB,CAAA;AAGF,QAAA,MAAM,sBAAsB,uKAc1B,CAAA;
|
|
1
|
+
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/select.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAA;AAKzD,QAAA,MAAM,MAAM,uCAAuB,CAAA;AAEnC,QAAA,MAAM,WAAW,yGAAwB,CAAA;AAEzC,QAAA,MAAM,WAAW,0GAAwB,CAAA;AAEzC,QAAA,MAAM,aAAa,oKAqBjB,CAAA;AAGF,QAAA,MAAM,oBAAoB,qKAcxB,CAAA;AAGF,QAAA,MAAM,sBAAsB,uKAc1B,CAAA;AAwCF,QAAA,MAAM,aAAa;;;;mCA9Ba,MAAM,KAAK,IAAI;wCAoJ9C,CAAA;AAGD,QAAA,MAAM,WAAW,4JASf,CAAA;AAGF,QAAA,MAAM,UAAU,2JA2Bd,CAAA;AAGF,QAAA,MAAM,eAAe,gKASnB,CAAA;AAGF,OAAO,EACL,MAAM,EACN,WAAW,EACX,WAAW,EACX,aAAa,EACb,aAAa,EACb,WAAW,EACX,UAAU,EACV,eAAe,EACf,oBAAoB,EACpB,sBAAsB,GACvB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sidebar.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/sidebar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"sidebar.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/sidebar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AA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AGF,QAAA,MAAM,kBAAkB,kKAG6B,CAAA;AAGrD,QAAA,MAAM,oBAAoB;;;;mDA2BxB,CAAA;AAGF,OAAO,EACL,OAAO,EACP,cAAc,EACd,aAAa,EACb,YAAY,EACZ,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACnB,cAAc,EACd,oBAAoB,EACpB,kBAAkB,EAClB,eAAe,EACf,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,UAAU,GACX,CAAA"}
|
package/dist/index.cjs4.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("react"),l=require("lucide-react"),d=require("class-variance-authority"),c=require("./index.cjs57.js");function N(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const a in t)if(a!=="default"){const n=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(r,a,n.get?n:{enumerable:!0,get:()=>t[a]})}}return r.default=t,Object.freeze(r)}const e=N(g),h=d.cva("flex w-full flex-col items-end gap-3 rounded-[8px] border bg-white px-3 py-3 text-[14px] leading-[20px] shadow-[0px_2px_4px_-2px_rgba(19,25,39,0.12),0px_4px_4px_-2px_rgba(19,25,39,0.08)]",{variants:{variant:{default:"border-[#e6e6e6] text-black",success:"border-[#307f4a] text-[#307f4a]",error:"border-[#e73f3f] text-[#e73f3f]",destructive:"border-[#e73f3f] text-[#e73f3f]",warning:"border-[#e49614] text-[#e49614]",info:"border-[#2563eb] text-[#2563eb]"}},defaultVariants:{variant:"default"}}),E=d.cva("flex h-6 w-6 shrink-0 items-center justify-center",{variants:{variant:{default:"text-[#adacb0]",success:"text-[#307f4a]",error:"text-[#e73f3f]",destructive:"text-[#e73f3f]",warning:"text-[#e49614]",info:"text-[#2563eb]"}},defaultVariants:{variant:"default"}}),y={warning:"warning",neutral:"default",success:"success",negative:"error"},u=e.forwardRef(({className:t,variant:r,icon:a,showIcon:n=!0,state:i,action:o,children:p,...v},b)=>{const s=i?y[i]:r??"default",w={default:e.createElement(l.SquareDashed,{className:"h-5 w-5"}),success:e.createElement(l.CheckCircle2,{className:"h-5 w-5"}),error:e.createElement(l.CircleX,{className:"h-5 w-5"}),destructive:e.createElement(l.CircleX,{className:"h-5 w-5"}),warning:e.createElement(l.AlertCircle,{className:"h-5 w-5"}),info:e.createElement(l.Info,{className:"h-5 w-5"})},f=a===void 0?w[s]:a;return e.createElement("div",{ref:b,role:"alert",className:c.cn(h({variant:s}),t),...v},e.createElement("div",{className:"flex w-full items-start gap-2"},n&&f?e.createElement("span",{className:c.cn(E({variant:s}))},f):null,e.createElement("div",{className:"min-w-0 flex-1"},p)),o?e.createElement("div",{className:"flex w-full justify-end"},o):null)});u.displayName="Alert";const m=e.forwardRef(({className:t,...r},a)=>e.createElement("h5",{ref:a,className:c.cn("text-[14px] font-normal leading-[20px] text-current",t),...r}));m.displayName="AlertTitle";const x=e.forwardRef(({className:t,...r},a)=>e.createElement("div",{ref:a,className:c.cn("text-[12px] leading-[16px] text-[#7f7d83] [&:not(:first-child)]:mt-2",t),...r}));x.displayName="AlertDescription";exports.Alert=u;exports.AlertDescription=x;exports.AlertTitle=m;
|
|
2
2
|
//# sourceMappingURL=index.cjs4.js.map
|
package/dist/index.cjs4.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs4.js","sources":["../src/components/ui/alert.tsx"],"sourcesContent":["import * as React from \"react\"\nimport {
|
|
1
|
+
{"version":3,"file":"index.cjs4.js","sources":["../src/components/ui/alert.tsx"],"sourcesContent":["import * as React from \"react\"\nimport {\n AlertCircle,\n CheckCircle2,\n CircleX,\n Info,\n SquareDashed,\n} from \"lucide-react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst alertVariants = cva(\n \"flex w-full flex-col items-end gap-3 rounded-[8px] border bg-white px-3 py-3 text-[14px] leading-[20px] shadow-[0px_2px_4px_-2px_rgba(19,25,39,0.12),0px_4px_4px_-2px_rgba(19,25,39,0.08)]\",\n {\n variants: {\n variant: {\n default: \"border-[#e6e6e6] text-black\",\n success: \"border-[#307f4a] text-[#307f4a]\",\n error: \"border-[#e73f3f] text-[#e73f3f]\",\n destructive: \"border-[#e73f3f] text-[#e73f3f]\",\n warning: \"border-[#e49614] text-[#e49614]\",\n info: \"border-[#2563eb] text-[#2563eb]\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n }\n)\n\nconst alertIconVariants = cva(\"flex h-6 w-6 shrink-0 items-center justify-center\", {\n variants: {\n variant: {\n default: \"text-[#adacb0]\",\n success: \"text-[#307f4a]\",\n error: \"text-[#e73f3f]\",\n destructive: \"text-[#e73f3f]\",\n warning: \"text-[#e49614]\",\n info: \"text-[#2563eb]\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n})\n\ntype AlertVariant = NonNullable<VariantProps<typeof alertVariants>[\"variant\"]>\ntype AlertState = \"warning\" | \"neutral\" | \"success\" | \"negative\"\n\nconst stateToVariant: Record<AlertState, AlertVariant> = {\n warning: \"warning\",\n neutral: \"default\",\n success: \"success\",\n negative: \"error\",\n}\n\nconst Alert = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement> &\n VariantProps<typeof alertVariants> & {\n icon?: React.ReactNode\n showIcon?: boolean\n state?: AlertState\n action?: React.ReactNode\n }\n>(({ className, variant, icon, showIcon = true, state, action, children, ...props }, ref) => {\n const resolvedVariant = (state ? stateToVariant[state] : variant ?? \"default\") as AlertVariant\n const defaultIcons: Record<AlertVariant, React.ReactNode> = {\n default: <SquareDashed className=\"h-5 w-5\" />,\n success: <CheckCircle2 className=\"h-5 w-5\" />,\n error: <CircleX className=\"h-5 w-5\" />,\n destructive: <CircleX className=\"h-5 w-5\" />,\n warning: <AlertCircle className=\"h-5 w-5\" />,\n info: <Info className=\"h-5 w-5\" />,\n }\n const resolvedIcon = icon === undefined ? defaultIcons[resolvedVariant] : icon\n\n return (\n <div\n ref={ref}\n role=\"alert\"\n className={cn(alertVariants({ variant: resolvedVariant }), className)}\n {...props}\n >\n <div className=\"flex w-full items-start gap-2\">\n {showIcon && resolvedIcon ? (\n <span className={cn(alertIconVariants({ variant: resolvedVariant }))}>\n {resolvedIcon}\n </span>\n ) : null}\n <div className=\"min-w-0 flex-1\">{children}</div>\n </div>\n {action ? <div className=\"flex w-full justify-end\">{action}</div> : null}\n </div>\n )\n})\nAlert.displayName = \"Alert\"\n\nconst AlertTitle = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLHeadingElement>\n>(({ className, ...props }, ref) => (\n <h5\n ref={ref}\n className={cn(\"text-[14px] font-normal leading-[20px] text-current\", className)}\n {...props}\n />\n))\nAlertTitle.displayName = \"AlertTitle\"\n\nconst AlertDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n \"text-[12px] leading-[16px] text-[#7f7d83] [&:not(:first-child)]:mt-2\",\n className\n )}\n {...props}\n />\n))\nAlertDescription.displayName = \"AlertDescription\"\n\nexport { Alert, AlertTitle, AlertDescription }\n"],"names":["alertVariants","cva","alertIconVariants","stateToVariant","Alert","React","className","variant","icon","showIcon","state","action","children","props","ref","resolvedVariant","defaultIcons","SquareDashed","CheckCircle2","CircleX","AlertCircle","Info","resolvedIcon","cn","AlertTitle","AlertDescription"],"mappings":"ieAYMA,EAAgBC,EAAAA,IACpB,6LACA,CACE,SAAU,CACR,QAAS,CACP,QAAS,8BACT,QAAS,kCACT,MAAO,kCACP,YAAa,kCACb,QAAS,kCACT,KAAM,iCAAA,CACR,EAEF,gBAAiB,CACf,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H,EACE,KACJjB,EAAA,cAAC,MAAA,CAAI,UAAU,gBAAA,EAAkBO,CAAS,CAC5C,EACCD,EAASN,EAAA,cAAC,MAAA,CAAI,UAAU,yBAAA,EAA2BM,CAAO,EAAS,IAAA,CAG1E,CAAC,EACDP,EAAM,YAAc,QAEpB,MAAMoB,EAAanB,EAAM,WAGvB,CAAC,CAAE,UAAAC,EAAW,GAAGO,CAAA,EAASC,IAC1BT,EAAA,cAAC,KAAA,CACC,IAAAS,EACA,UAAWS,EAAAA,GAAG,sDAAuDjB,CAAS,EAC7E,GAAGO,CAAA,CACN,CACD,EACDW,EAAW,YAAc,aAEzB,MAAMC,EAAmBpB,EAAM,WAG7B,CAAC,CAAE,UAAAC,EAAW,GAAGO,CAAA,EAASC,IAC1BT,EAAA,cAAC,MAAA,CACC,IAAAS,EACA,UAAWS,EAAAA,GACT,uEACAjB,CAAA,EAED,GAAGO,CAAA,CACN,CACD,EACDY,EAAiB,YAAc"}
|
package/dist/index.cjs42.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("react"),B=require("@radix-ui/react-select"),i=require("lucide-react"),c=require("./index.cjs57.js");function h(t){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(l,r,o.get?o:{enumerable:!0,get:()=>t[r]})}}return l.default=t,Object.freeze(l)}const e=h(q),a=h(B),k=a.Root,L=a.Group,O=a.Value,y=e.forwardRef(({className:t,children:l,...r},o)=>e.createElement(a.Trigger,{ref:o,className:c.cn("flex h-10 w-full items-center justify-between whitespace-nowrap rounded-[8px] border border-[#e6e6e6] bg-white px-3 py-2 text-[14px] leading-[20px] text-[#111111] shadow-none","data-[placeholder]:text-[#b3b3b3] [&>span]:line-clamp-1","focus-visible:outline-none focus-visible:border-[#1D1C20] data-[state=open]:border-[#1D1C20]","disabled:cursor-not-allowed disabled:bg-[#f2f2f2] disabled:text-[#9ca3af] disabled:data-[placeholder]:text-[#b3b3b3]","aria-invalid:border-[#ff3b30] aria-invalid:focus-visible:border-[#ff3b30]",t),...r},l,e.createElement(a.Icon,{asChild:!0},e.createElement(i.ChevronDown,{className:"h-4 w-4 text-[#7f7d83]"}))));y.displayName=a.Trigger.displayName;const f=e.forwardRef(({className:t,...l},r)=>e.createElement(a.ScrollUpButton,{ref:r,className:c.cn("flex cursor-default items-center justify-center py-1 text-[#7f7d83]",t),...l},e.createElement(i.ChevronUp,{className:"h-4 w-4"})));f.displayName=a.ScrollUpButton.displayName;const b=e.forwardRef(({className:t,...l},r)=>e.createElement(a.ScrollDownButton,{ref:r,className:c.cn("flex cursor-default items-center justify-center py-1 text-[#7f7d83]",t),...l},e.createElement(i.ChevronDown,{className:"h-4 w-4"})));b.displayName=a.ScrollDownButton.displayName;const w=e.createContext({enabled:!1,query:""}),m=t=>typeof t=="string"||typeof t=="number"?String(t):Array.isArray(t)?t.map(m).join(" "):e.isValidElement(t)?m(t.props.children):"",N=e.forwardRef(({className:t,children:l,position:r="popper",enableSearch:o=!1,searchPlaceholder:d="Search...",searchValue:s,onSearchValueChange:p,...u},R)=>{const[D,P]=e.useState(""),j=e.useRef(null),I=e.useCallback(n=>{j.current=n,!(!n||!o)&&window.requestAnimationFrame(()=>{n.focus()})},[o]),x=s??D,g=x.trim().toLowerCase(),V=e.useMemo(()=>({enabled:o,query:g}),[o,g]),T=n=>{const S=n.target.value;s===void 0&&P(S),p?.(S)};return e.createElement(a.Portal,null,e.createElement(a.Content,{ref:R,className:c.cn("relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-[8px] border border-[#e6e6e6] bg-white text-[#111111] shadow-sm","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:r,...u},e.createElement(f,null),o?e.createElement("div",{className:"border-b border-[#e6e6e6] p-1"},e.createElement("div",{className:"flex h-9 items-center gap-2 rounded-[6px] border border-[#e6e6e6] px-2"},e.createElement(i.Search,{className:"h-4 w-4 text-[#7f7d83]"}),e.createElement("input",{ref:I,type:"text",value:x,onChange:T,onClick:n=>{n.stopPropagation()},onPointerDown:n=>{n.stopPropagation()},onKeyDownCapture:n=>{n.key!=="Escape"&&n.stopPropagation()},onKeyUpCapture:n=>{n.stopPropagation()},onKeyDown:n=>{n.key!=="Escape"&&n.stopPropagation()},placeholder:d,"aria-label":"Search options",className:"h-full w-full border-0 bg-transparent text-[14px] leading-[20px] text-[#111111] outline-none placeholder:text-[#b3b3b3]"}))):null,e.createElement(a.Viewport,{className:c.cn("p-1",r==="popper"&&"w-full min-w-[var(--radix-select-trigger-width)]")},e.createElement(w.Provider,{value:V},l)),e.createElement(b,null)))});N.displayName=a.Content.displayName;const E=e.forwardRef(({className:t,...l},r)=>e.createElement(a.Label,{ref:r,className:c.cn("px-2 py-1 text-[12px] font-medium text-[#7f7d83]",t),...l}));E.displayName=a.Label.displayName;const v=e.forwardRef(({className:t,children:l,...r},o)=>{const{enabled:d,query:s}=e.useContext(w),p=m(l).toLowerCase(),u=d&&s.length>0&&!p.includes(s);return e.createElement(a.Item,{ref:o,className:c.cn("relative flex w-full cursor-default select-none items-center rounded-[6px] py-2 pl-2 pr-8 text-[14px] leading-[20px] outline-none","focus:bg-[#f1f1f1] focus:text-[#111111] data-[state=checked]:bg-[#f1f1f1] data-[disabled]:pointer-events-none data-[disabled]:opacity-50",u&&"hidden",t),...r},e.createElement("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center"},e.createElement(a.ItemIndicator,null,e.createElement(i.Check,{className:"h-4 w-4 text-[#26453f]"}))),e.createElement(a.ItemText,null,l))});v.displayName=a.Item.displayName;const C=e.forwardRef(({className:t,...l},r)=>e.createElement(a.Separator,{ref:r,className:c.cn("-mx-1 my-1 h-px bg-[#e6e6e6]",t),...l}));C.displayName=a.Separator.displayName;exports.Select=k;exports.SelectContent=N;exports.SelectGroup=L;exports.SelectItem=v;exports.SelectLabel=E;exports.SelectScrollDownButton=b;exports.SelectScrollUpButton=f;exports.SelectSeparator=C;exports.SelectTrigger=y;exports.SelectValue=O;
|
|
2
2
|
//# sourceMappingURL=index.cjs42.js.map
|
package/dist/index.cjs42.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs42.js","sources":["../src/components/ui/select.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport * as SelectPrimitive from \"@radix-ui/react-select\"\nimport { Check, ChevronDown, ChevronUp } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst Select = SelectPrimitive.Root\n\nconst SelectGroup = SelectPrimitive.Group\n\nconst SelectValue = SelectPrimitive.Value\n\nconst SelectTrigger = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>\n>(({ className, children, ...props }, ref) => (\n <SelectPrimitive.Trigger\n ref={ref}\n className={cn(\n \"flex h-10 w-full items-center justify-between whitespace-nowrap rounded-[8px] border border-[#e6e6e6] bg-white px-3 py-2 text-[14px] leading-[20px] text-[#111111] shadow-none\",\n \"data-[placeholder]:text-[#b3b3b3] [&>span]:line-clamp-1\",\n \"focus-visible:outline-none focus-visible:border-[#1D1C20] data-[state=open]:border-[#1D1C20]\",\n \"disabled:cursor-not-allowed disabled:bg-[#f2f2f2] disabled:text-[#9ca3af] disabled:data-[placeholder]:text-[#b3b3b3]\",\n \"aria-invalid:border-[#ff3b30] aria-invalid:focus-visible:border-[#ff3b30]\",\n className\n )}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon asChild>\n <ChevronDown className=\"h-4 w-4 text-[#7f7d83]\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n))\nSelectTrigger.displayName = SelectPrimitive.Trigger.displayName\n\nconst SelectScrollUpButton = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.ScrollUpButton>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollUpButton\n ref={ref}\n className={cn(\n \"flex cursor-default items-center justify-center py-1 text-[#7f7d83]\",\n className\n )}\n {...props}\n >\n <ChevronUp className=\"h-4 w-4\" />\n </SelectPrimitive.ScrollUpButton>\n))\nSelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName\n\nconst SelectScrollDownButton = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.ScrollDownButton>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollDownButton\n ref={ref}\n className={cn(\n \"flex cursor-default items-center justify-center py-1 text-[#7f7d83]\",\n className\n )}\n {...props}\n >\n <ChevronDown className=\"h-4 w-4\" />\n </SelectPrimitive.ScrollDownButton>\n))\nSelectScrollDownButton.displayName =\n SelectPrimitive.ScrollDownButton.displayName\n\nconst SelectContent = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>\n>(({ className, children, position = \"popper\", ...props }, ref) => (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n ref={ref}\n className={cn(\n \"relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-[8px] border border-[#e6e6e6] bg-white text-[#111111] shadow-sm\",\n \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]\",\n position === \"popper\" &&\n \"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1\",\n className\n )}\n position={position}\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.Viewport\n className={cn(\n \"p-1\",\n position === \"popper\" &&\n \"w-full min-w-[var(--radix-select-trigger-width)]\"\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n <SelectScrollDownButton />\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n))\nSelectContent.displayName = SelectPrimitive.Content.displayName\n\nconst SelectLabel = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Label\n ref={ref}\n className={cn(\"px-2 py-1 text-[12px] font-medium text-[#7f7d83]\", className)}\n {...props}\n />\n))\nSelectLabel.displayName = SelectPrimitive.Label.displayName\n\nconst SelectItem = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>\n>(({ className, children, ...props }, ref) => (\n <SelectPrimitive.Item\n ref={ref}\n className={cn(\n \"relative flex w-full cursor-default select-none items-center rounded-[6px] py-2 pl-2 pr-8 text-[14px] leading-[20px] outline-none\",\n \"focus:bg-[#f1f1f1] focus:text-[#111111] data-[state=checked]:bg-[#f1f1f1] data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\n className\n )}\n {...props}\n >\n <span className=\"absolute right-2 flex h-3.5 w-3.5 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <Check className=\"h-4 w-4 text-[#26453f]\" />\n </SelectPrimitive.ItemIndicator>\n </span>\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n))\nSelectItem.displayName = SelectPrimitive.Item.displayName\n\nconst SelectSeparator = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Separator\n ref={ref}\n className={cn(\"-mx-1 my-1 h-px bg-[#e6e6e6]\", className)}\n {...props}\n />\n))\nSelectSeparator.displayName = SelectPrimitive.Separator.displayName\n\nexport {\n Select,\n SelectGroup,\n SelectValue,\n SelectTrigger,\n SelectContent,\n SelectLabel,\n SelectItem,\n SelectSeparator,\n SelectScrollUpButton,\n SelectScrollDownButton,\n}\n"],"names":["Select","SelectPrimitive","SelectGroup","SelectValue","SelectTrigger","React","className","children","props","ref","cn","ChevronDown","SelectScrollUpButton","ChevronUp","SelectScrollDownButton","SelectContent","position","SelectLabel","SelectItem","Check","SelectSeparator"],"mappings":"seAQMA,EAASC,EAAgB,KAEzBC,EAAcD,EAAgB,MAE9BE,EAAcF,EAAgB,MAE9BG,EAAgBC,EAAM,WAG1B,CAAC,CAAE,UAAAC,EAAW,SAAAC,EAAU,GAAGC,CAAA,EAASC,IACpCJ,EAAA,cAACJ,EAAgB,QAAhB,CACC,IAAAQ,EACA,UAAWC,EAAAA,GACT,iLACA,0DACA,+FACA,uHACA,4EACAJ,CAAA,EAED,GAAGE,CAAA,EAEHD,EACDF,EAAA,cAACJ,EAAgB,KAAhB,CAAqB,QAAO,IAC3BI,EAAA,cAACM,EAAAA,YAAA,CAAY,UAAU,wBAAA,CAAyB,CAClD,CACF,CACD,EACDP,EAAc,YAAcH,EAAgB,QAAQ,YAEpD,MAAMW,EAAuBP,EAAM,WAGjC,CAAC,CAAE,UAAAC,EAAW,GAAGE,CAA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AAMiB,EAAab,EAAM,WAGvB,CAAC,CAAE,UAAAC,EAAW,SAAAC,EAAU,GAAGC,CAAA,EAASC,IACpCJ,EAAA,cAACJ,EAAgB,KAAhB,CACC,IAAAQ,EACA,UAAWC,EAAAA,GACT,oIACA,2IACAJ,CAAA,EAED,GAAGE,CAAA,EAEJH,EAAA,cAAC,OAAA,CAAK,UAAU,+DAAA,EACdA,EAAA,cAACJ,EAAgB,cAAhB,KACCI,EAAA,cAACc,EAAAA,MAAA,CAAM,UAAU,wBAAA,CAAyB,CAC5C,CACF,EACAd,EAAA,cAACJ,EAAgB,SAAhB,KAA0BM,CAAS,CACtC,CACD,EACDW,EAAW,YAAcjB,EAAgB,KAAK,YAE9C,MAAMmB,EAAkBf,EAAM,WAG5B,CAAC,CAAE,UAAAC,EAAW,GAAGE,CAAA,EAASC,IAC1BJ,EAAA,cAACJ,EAAgB,UAAhB,CACC,IAAAQ,EACA,UAAWC,EAAAA,GAAG,+BAAgCJ,CAAS,EACtD,GAAGE,CAAA,CACN,CACD,EACDY,EAAgB,YAAcnB,EAAgB,UAAU"}
|
|
1
|
+
{"version":3,"file":"index.cjs42.js","sources":["../src/components/ui/select.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport * as SelectPrimitive from \"@radix-ui/react-select\"\nimport { Check, ChevronDown, ChevronUp, Search } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst Select = SelectPrimitive.Root\n\nconst SelectGroup = SelectPrimitive.Group\n\nconst SelectValue = SelectPrimitive.Value\n\nconst SelectTrigger = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>\n>(({ className, children, ...props }, ref) => (\n <SelectPrimitive.Trigger\n ref={ref}\n className={cn(\n \"flex h-10 w-full items-center justify-between whitespace-nowrap rounded-[8px] border border-[#e6e6e6] bg-white px-3 py-2 text-[14px] leading-[20px] text-[#111111] shadow-none\",\n \"data-[placeholder]:text-[#b3b3b3] [&>span]:line-clamp-1\",\n \"focus-visible:outline-none focus-visible:border-[#1D1C20] data-[state=open]:border-[#1D1C20]\",\n \"disabled:cursor-not-allowed disabled:bg-[#f2f2f2] disabled:text-[#9ca3af] disabled:data-[placeholder]:text-[#b3b3b3]\",\n \"aria-invalid:border-[#ff3b30] aria-invalid:focus-visible:border-[#ff3b30]\",\n className\n )}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon asChild>\n <ChevronDown className=\"h-4 w-4 text-[#7f7d83]\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n))\nSelectTrigger.displayName = SelectPrimitive.Trigger.displayName\n\nconst SelectScrollUpButton = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.ScrollUpButton>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollUpButton\n ref={ref}\n className={cn(\n \"flex cursor-default items-center justify-center py-1 text-[#7f7d83]\",\n className\n )}\n {...props}\n >\n <ChevronUp className=\"h-4 w-4\" />\n </SelectPrimitive.ScrollUpButton>\n))\nSelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName\n\nconst SelectScrollDownButton = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.ScrollDownButton>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollDownButton\n ref={ref}\n className={cn(\n \"flex cursor-default items-center justify-center py-1 text-[#7f7d83]\",\n className\n )}\n {...props}\n >\n <ChevronDown className=\"h-4 w-4\" />\n </SelectPrimitive.ScrollDownButton>\n))\nSelectScrollDownButton.displayName =\n SelectPrimitive.ScrollDownButton.displayName\n\ntype SelectContentProps = React.ComponentPropsWithoutRef<\n typeof SelectPrimitive.Content\n> & {\n enableSearch?: boolean\n searchPlaceholder?: string\n searchValue?: string\n onSearchValueChange?: (value: string) => void\n}\n\ntype SelectSearchContextValue = {\n enabled: boolean\n query: string\n}\n\nconst SelectSearchContext = React.createContext<SelectSearchContextValue>({\n enabled: false,\n query: \"\",\n})\n\nconst getNodeText = (node: React.ReactNode): string => {\n if (typeof node === \"string\" || typeof node === \"number\") {\n return String(node)\n }\n\n if (Array.isArray(node)) {\n return node.map(getNodeText).join(\" \")\n }\n\n if (React.isValidElement(node)) {\n const element = node as React.ReactElement<{ children?: React.ReactNode }>\n return getNodeText(element.props.children)\n }\n\n return \"\"\n}\n\nconst SelectContent = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Content>,\n SelectContentProps\n>(\n (\n {\n className,\n children,\n position = \"popper\",\n enableSearch = false,\n searchPlaceholder = \"Search...\",\n searchValue,\n onSearchValueChange,\n ...props\n },\n ref\n ) => {\n const [localSearchValue, setLocalSearchValue] = React.useState(\"\")\n const searchInputRef = React.useRef<HTMLInputElement | null>(null)\n const setSearchInputRef = React.useCallback(\n (node: HTMLInputElement | null) => {\n searchInputRef.current = node\n if (!node || !enableSearch) {\n return\n }\n window.requestAnimationFrame(() => {\n node.focus()\n })\n },\n [enableSearch]\n )\n\n const currentSearchValue = searchValue ?? localSearchValue\n const normalizedSearchValue = currentSearchValue.trim().toLowerCase()\n const searchContextValue = React.useMemo(\n () => ({\n enabled: enableSearch,\n query: normalizedSearchValue,\n }),\n [enableSearch, normalizedSearchValue]\n )\n\n const handleSearchChange: React.ChangeEventHandler<HTMLInputElement> = (\n event\n ) => {\n const nextValue = event.target.value\n if (searchValue === undefined) {\n setLocalSearchValue(nextValue)\n }\n onSearchValueChange?.(nextValue)\n }\n\n return (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n ref={ref}\n className={cn(\n \"relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-[8px] border border-[#e6e6e6] bg-white text-[#111111] shadow-sm\",\n \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]\",\n position === \"popper\" &&\n \"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1\",\n className\n )}\n position={position}\n {...props}\n >\n <SelectScrollUpButton />\n {enableSearch ? (\n <div className=\"border-b border-[#e6e6e6] p-1\">\n <div className=\"flex h-9 items-center gap-2 rounded-[6px] border border-[#e6e6e6] px-2\">\n <Search className=\"h-4 w-4 text-[#7f7d83]\" />\n <input\n ref={setSearchInputRef}\n type=\"text\"\n value={currentSearchValue}\n onChange={handleSearchChange}\n onClick={(event) => {\n event.stopPropagation()\n }}\n onPointerDown={(event) => {\n event.stopPropagation()\n }}\n onKeyDownCapture={(event) => {\n if (event.key !== \"Escape\") {\n event.stopPropagation()\n }\n }}\n onKeyUpCapture={(event) => {\n event.stopPropagation()\n }}\n onKeyDown={(event) => {\n if (event.key !== \"Escape\") {\n event.stopPropagation()\n }\n }}\n placeholder={searchPlaceholder}\n aria-label=\"Search options\"\n className=\"h-full w-full border-0 bg-transparent text-[14px] leading-[20px] text-[#111111] outline-none placeholder:text-[#b3b3b3]\"\n />\n </div>\n </div>\n ) : null}\n <SelectPrimitive.Viewport\n className={cn(\n \"p-1\",\n position === \"popper\" &&\n \"w-full min-w-[var(--radix-select-trigger-width)]\"\n )}\n >\n <SelectSearchContext.Provider value={searchContextValue}>\n {children}\n </SelectSearchContext.Provider>\n </SelectPrimitive.Viewport>\n <SelectScrollDownButton />\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n )\n }\n)\nSelectContent.displayName = SelectPrimitive.Content.displayName\n\nconst SelectLabel = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Label\n ref={ref}\n className={cn(\"px-2 py-1 text-[12px] font-medium text-[#7f7d83]\", className)}\n {...props}\n />\n))\nSelectLabel.displayName = SelectPrimitive.Label.displayName\n\nconst SelectItem = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>\n>(({ className, children, ...props }, ref) => {\n const { enabled, query } = React.useContext(SelectSearchContext)\n const itemText = getNodeText(children).toLowerCase()\n const isHidden = enabled && query.length > 0 && !itemText.includes(query)\n\n return (\n <SelectPrimitive.Item\n ref={ref}\n className={cn(\n \"relative flex w-full cursor-default select-none items-center rounded-[6px] py-2 pl-2 pr-8 text-[14px] leading-[20px] outline-none\",\n \"focus:bg-[#f1f1f1] focus:text-[#111111] data-[state=checked]:bg-[#f1f1f1] data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\n isHidden && \"hidden\",\n className\n )}\n {...props}\n >\n <span className=\"absolute right-2 flex h-3.5 w-3.5 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <Check className=\"h-4 w-4 text-[#26453f]\" />\n </SelectPrimitive.ItemIndicator>\n </span>\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n )\n})\nSelectItem.displayName = SelectPrimitive.Item.displayName\n\nconst SelectSeparator = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Separator\n ref={ref}\n className={cn(\"-mx-1 my-1 h-px bg-[#e6e6e6]\", className)}\n {...props}\n />\n))\nSelectSeparator.displayName = SelectPrimitive.Separator.displayName\n\nexport {\n Select,\n SelectGroup,\n SelectValue,\n SelectTrigger,\n SelectContent,\n SelectLabel,\n SelectItem,\n SelectSeparator,\n SelectScrollUpButton,\n SelectScrollDownButton,\n}\n"],"names":["Select","SelectPrimitive","SelectGroup","SelectValue","SelectTrigger","React","className","children","props","ref","cn","ChevronDown","SelectScrollUpButton","ChevronUp","SelectScrollDownButton","SelectSearchContext","getNodeText","node","SelectContent","position","enableSearch","searchPlaceholder","searchValue","onSearchValueChange","localSearchValue","setLocalSearchValue","searchInputRef","setSearchInputRef","currentSearchValue","normalizedSearchValue","searchContextValue","handleSearchChange","event","nextValue","Search","SelectLabel","SelectItem","enabled","query","itemText","isHidden","Check","SelectSeparator"],"mappings":"seAQMA,EAASC,EAAgB,KAEzBC,EAAcD,EAAgB,MAE9BE,EAAcF,EAAgB,MAE9BG,EAAgBC,EAAM,WAG1B,CAAC,CAAE,UAAAC,EAAW,SAAAC,EAAU,GAAGC,CAAA,EAASC,IACpCJ,EAAA,cAACJ,EAAgB,QAAhB,CACC,IAAAQ,EACA,UAAWC,EAAAA,GACT,iLACA,0DACA,+FACA,uHACA,4EACAJ,CAAA,EAED,GAAGE,CAAA,EAEHD,EACDF,EAAA,cAACJ,EAAgB,KAAhB,CAAqB,QAAO,IAC3BI,EAAA,cAACM,EAAAA,YAAA,CAAY,UAAU,wBAAA,CAAyB,CAClD,CACF,CACD,EACDP,EAAc,YAAcH,EAAgB,QAAQ,YAEpD,MAAMW,EAAuBP,EAAM,WAGjC,CAAC,CAAE,UAAAC,EAAW,GAAGE,CAAA,EAASC,IAC1BJ,EAAA,cAACJ,EAAgB,eAAhB,CACC,IAAAQ,EACA,UAAWC,EAAAA,GACT,sEACAJ,CAAA,EAED,GAAGE,CAAA,EAEJH,EAAA,cAACQ,EAAAA,UAAA,CAAU,UAAU,SAAA,CAAU,CACjC,CACD,EACDD,EAAqB,YAAcX,EAAgB,eAAe,YAElE,MAAMa,EAAyBT,EAAM,WAGnC,CAAC,CAAE,UAAAC,EAAW,GAAGE,CAAA,EAASC,IAC1BJ,EAAA,cAACJ,EAAgB,iBAAhB,CACC,IAAAQ,EACA,UAAWC,EAAAA,GACT,sEACAJ,CAAA,EAED,GAAGE,CAA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CAAA,EAAUjC,EAAM,WAAWU,CAAmB,EACzDwB,EAAWvB,EAAYT,CAAQ,EAAE,YAAA,EACjCiC,EAAWH,GAAWC,EAAM,OAAS,GAAK,CAACC,EAAS,SAASD,CAAK,EAExE,OACEjC,EAAA,cAACJ,EAAgB,KAAhB,CACC,IAAAQ,EACA,UAAWC,EAAAA,GACT,oIACA,2IACA8B,GAAY,SACZlC,CAAA,EAED,GAAGE,CAAA,EAEJH,EAAA,cAAC,OAAA,CAAK,UAAU,+DAAA,EACdA,EAAA,cAACJ,EAAgB,cAAhB,KACCI,EAAA,cAACoC,EAAAA,MAAA,CAAM,UAAU,wBAAA,CAAyB,CAC5C,CACF,EACApC,EAAA,cAACJ,EAAgB,SAAhB,KAA0BM,CAAS,CAAA,CAG1C,CAAC,EACD6B,EAAW,YAAcnC,EAAgB,KAAK,YAE9C,MAAMyC,EAAkBrC,EAAM,WAG5B,CAAC,CAAE,UAAAC,EAAW,GAAGE,CAAA,EAASC,IAC1BJ,EAAA,cAACJ,EAAgB,UAAhB,CACC,IAAAQ,EACA,UAAWC,EAAAA,GAAG,+BAAgCJ,CAAS,EACtD,GAAGE,CAAA,CACN,CACD,EACDkC,EAAgB,YAAczC,EAAgB,UAAU"}
|
package/dist/index.cjs45.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Q=require("react"),h=require("@radix-ui/react-slot"),Z=require("class-variance-authority"),$=require("lucide-react"),ee=require("./index.cjs58.js"),i=require("./index.cjs57.js"),ae=require("./index.cjs10.js"),te=require("./index.cjs28.js"),re=require("./index.cjs43.js"),g=require("./index.cjs44.js"),N=require("./index.cjs46.js"),y=require("./index.cjs56.js");function ne(a){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const r in a)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(a,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>a[r]})}}return t.default=a,Object.freeze(t)}const e=ne(Q),ie="sidebar_state",oe=3600*24*7,de="16rem",se="18rem",le="3rem",ce="b",M=e.createContext(null);function S(){const a=e.useContext(M);if(!a)throw new Error("useSidebar must be used within a SidebarProvider.");return a}const R=e.forwardRef(({defaultOpen:a=!0,open:t,onOpenChange:r,className:n,style:o,children:d,...c},p)=>{const l=ee.useIsMobile(),[f,u]=e.useState(!1),[v,Y]=e.useState(a),m=t??v,x=e.useCallback(s=>{const b=typeof s=="function"?s(m):s;r?r(b):Y(b),document.cookie=`${ie}=${b}; path=/; max-age=${oe}`},[r,m]),w=e.useCallback(()=>l?u(s=>!s):x(s=>!s),[l,x,u]);e.useEffect(()=>{const s=b=>{b.key===ce&&(b.metaKey||b.ctrlKey)&&(b.preventDefault(),w())};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[w]);const E=m?"expanded":"collapsed",J=e.useMemo(()=>({state:E,open:m,setOpen:x,isMobile:l,openMobile:f,setOpenMobile:u,toggleSidebar:w}),[E,m,x,l,f,u,w]);return e.createElement(M.Provider,{value:J},e.createElement(y.TooltipProvider,{delayDuration:0},e.createElement("div",{style:{"--sidebar-width":de,"--sidebar-width-icon":le,...o},className:i.cn("group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",n),ref:p,...c},d)))});R.displayName="SidebarProvider";const _=e.forwardRef(({side:a="left",variant:t="sidebar",collapsible:r="offcanvas",className:n,children:o,...d},c)=>{const{isMobile:p,state:l,openMobile:f,setOpenMobile:u}=S();return r==="none"?e.createElement("div",{className:i.cn("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",n),ref:c,...d},o):p?e.createElement(g.Sheet,{open:f,onOpenChange:u,...d},e.createElement(g.SheetContent,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":se},side:a},e.createElement(g.SheetHeader,{className:"sr-only"},e.createElement(g.SheetTitle,null,"Sidebar"),e.createElement(g.SheetDescription,null,"Displays the mobile sidebar.")),e.createElement("div",{className:"flex h-full w-full flex-col"},o))):e.createElement("div",{ref:c,className:"group peer hidden text-sidebar-foreground md:block","data-state":l,"data-collapsible":l==="collapsed"?r:"","data-variant":t,"data-side":a},e.createElement("div",{className:i.cn("relative w-[--sidebar-width] bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),e.createElement("div",{className:i.cn("fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] duration-200 ease-linear md:flex",a==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",n),...d},e.createElement("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow"},o)))});_.displayName="Sidebar";const k=e.forwardRef(({className:a,onClick:t,...r},n)=>{const{toggleSidebar:o}=S();return e.createElement(ae.Button,{ref:n,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:i.cn("h-7 w-7",a),onClick:d=>{t?.(d),o()},...r},e.createElement($.PanelLeft,null),e.createElement("span",{className:"sr-only"},"Toggle Sidebar"))});k.displayName="SidebarTrigger";const I=e.forwardRef(({className:a,...t},r)=>{const{toggleSidebar:n}=S();return e.createElement("button",{ref:r,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:n,title:"Toggle Sidebar",className:i.cn("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",a),...t})});I.displayName="SidebarRail";const C=e.forwardRef(({className:a,...t},r)=>e.createElement("main",{ref:r,className:i.cn("relative flex w-full flex-1 flex-col bg-background","md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",a),...t}));C.displayName="SidebarInset";const z=e.forwardRef(({className:a,...t},r)=>e.createElement(te.Input,{ref:r,"data-sidebar":"input",className:i.cn("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",a),...t}));z.displayName="SidebarInput";const B=e.forwardRef(({className:a,...t},r)=>e.createElement("div",{ref:r,"data-sidebar":"header",className:i.cn("flex flex-col gap-2 p-2",a),...t}));B.displayName="SidebarHeader";const T=e.forwardRef(({className:a,...t},r)=>e.createElement("div",{ref:r,"data-sidebar":"footer",className:i.cn("flex flex-col gap-2 p-2",a),...t}));T.displayName="SidebarFooter";const O=e.forwardRef(({className:a,...t},r)=>e.createElement(re.Separator,{ref:r,"data-sidebar":"separator",className:i.cn("mx-2 w-auto bg-sidebar-border",a),...t}));O.displayName="SidebarSeparator";const A=e.forwardRef(({className:a,...t},r)=>e.createElement("div",{ref:r,"data-sidebar":"content",className:i.cn("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",a),...t}));A.displayName="SidebarContent";const D=e.forwardRef(({className:a,...t},r)=>e.createElement("div",{ref:r,"data-sidebar":"group",className:i.cn("relative flex w-full min-w-0 flex-col p-2",a),...t}));D.displayName="SidebarGroup";const q=e.forwardRef(({className:a,asChild:t=!1,...r},n)=>{const o=t?h.Slot:"div";return e.createElement(o,{ref:n,"data-sidebar":"group-label",className:i.cn("flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",a),...r})});q.displayName="SidebarGroupLabel";const G=e.forwardRef(({className:a,asChild:t=!1,...r},n)=>{const o=t?h.Slot:"button";return e.createElement(o,{ref:n,"data-sidebar":"group-action",className:i.cn("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",a),...r})});G.displayName="SidebarGroupAction";const j=e.forwardRef(({className:a,...t},r)=>e.createElement("div",{ref:r,"data-sidebar":"group-content",className:i.cn("w-full text-sm",a),...t}));j.displayName="SidebarGroupContent";const H=e.forwardRef(({className:a,...t},r)=>e.createElement("ul",{ref:r,"data-sidebar":"menu",className:i.cn("flex w-full min-w-0 flex-col gap-1",a),...t}));H.displayName="SidebarMenu";const P=e.forwardRef(({className:a,...t},r)=>e.createElement("li",{ref:r,"data-sidebar":"menu-item",className:i.cn("group/menu-item relative",a),...t}));P.displayName="SidebarMenuItem";const ue=Z.cva("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] 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 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"default"}}),L=e.forwardRef(({asChild:a=!1,isActive:t=!1,variant:r="default",size:n="default",tooltip:o,className:d,...c},p)=>{const l=a?h.Slot:"button",{isMobile:f,state:u}=S(),v=e.createElement(l,{ref:p,"data-sidebar":"menu-button","data-size":n,"data-active":t,className:i.cn(ue({variant:r,size:n}),d),...c});return o?(typeof o=="string"&&(o={children:o}),e.createElement(y.Tooltip,null,e.createElement(y.TooltipTrigger,{asChild:!0},v),e.createElement(y.TooltipContent,{side:"right",align:"center",hidden:u!=="collapsed"||f,...o}))):v});L.displayName="SidebarMenuButton";const K=e.forwardRef(({className:a,asChild:t=!1,showOnHover:r=!1,...n},o)=>{const d=t?h.Slot:"button";return e.createElement(d,{ref:o,"data-sidebar":"menu-action",className:i.cn("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",r&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",a),...n})});K.displayName="SidebarMenuAction";const V=e.forwardRef(({className:a,...t},r)=>e.createElement("div",{ref:r,"data-sidebar":"menu-badge",className:i.cn("pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",a),...t}));V.displayName="SidebarMenuBadge";const F=e.forwardRef(({className:a,showIcon:t=!1,...r},n)=>{const o=e.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return e.createElement("div",{ref:n,"data-sidebar":"menu-skeleton",className:i.cn("flex h-8 items-center gap-2 rounded-md px-2",a),...r},t&&e.createElement(N.Skeleton,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),e.createElement(N.Skeleton,{className:"h-4 max-w-[--skeleton-width] flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":o}}))});F.displayName="SidebarMenuSkeleton";const W=e.forwardRef(({className:a,...t},r)=>e.createElement("ul",{ref:r,"data-sidebar":"menu-sub",className:i.cn("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",a),...t}));W.displayName="SidebarMenuSub";const U=e.forwardRef(({...a},t)=>e.createElement("li",{ref:t,...a}));U.displayName="SidebarMenuSubItem";const X=e.forwardRef(({asChild:a=!1,size:t="md",isActive:r,className:n,...o},d)=>{const c=a?h.Slot:"a";return e.createElement(c,{ref:d,"data-sidebar":"menu-sub-button","data-size":t,"data-active":r,className:i.cn("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring 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 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",t==="sm"&&"text-xs",t==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",n),...o})});X.displayName="SidebarMenuSubButton";exports.Sidebar=_;exports.SidebarContent=A;exports.SidebarFooter=T;exports.SidebarGroup=D;exports.SidebarGroupAction=G;exports.SidebarGroupContent=j;exports.SidebarGroupLabel=q;exports.SidebarHeader=B;exports.SidebarInput=z;exports.SidebarInset=C;exports.SidebarMenu=H;exports.SidebarMenuAction=K;exports.SidebarMenuBadge=V;exports.SidebarMenuButton=L;exports.SidebarMenuItem=P;exports.SidebarMenuSkeleton=F;exports.SidebarMenuSub=W;exports.SidebarMenuSubButton=X;exports.SidebarMenuSubItem=U;exports.SidebarProvider=R;exports.SidebarRail=I;exports.SidebarSeparator=O;exports.SidebarTrigger=k;exports.useSidebar=S;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const J=require("react"),S=require("@radix-ui/react-slot"),Q=require("class-variance-authority"),Z=require("lucide-react"),i=require("./index.cjs57.js"),ee=require("./index.cjs10.js"),ae=require("./index.cjs28.js"),te=require("./index.cjs43.js"),h=require("./index.cjs44.js"),N=require("./index.cjs46.js"),y=require("./index.cjs56.js");function re(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const a in t)if(a!=="default"){const n=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(r,a,n.get?n:{enumerable:!0,get:()=>t[a]})}}return r.default=t,Object.freeze(r)}const e=re(J),ne="sidebar_state",ie=3600*24*7,oe="15rem",de="15rem",se="4.5rem",le=1024,ce="b";function ue(){const[t,r]=e.useState(void 0);return e.useEffect(()=>{const a=window.matchMedia(`(max-width: ${le-1}px)`),n=()=>{r(a.matches)};return n(),typeof a.addEventListener=="function"?(a.addEventListener("change",n),()=>a.removeEventListener("change",n)):(a.addListener(n),()=>a.removeListener(n))},[]),!!t}const M=e.createContext(null);function v(){const t=e.useContext(M);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}const k=e.forwardRef(({defaultOpen:t=!0,open:r,onOpenChange:a,className:n,style:o,children:d,...l},p)=>{const s=ue(),[u,b]=e.useState(!1),[m,Y]=e.useState(t),g=r??m,x=e.useCallback(c=>{const f=typeof c=="function"?c(g):c;a?a(f):Y(f),document.cookie=`${ne}=${f}; path=/; max-age=${ie}`},[a,g]),w=e.useCallback(()=>s?b(c=>!c):x(c=>!c),[s,x,b]);e.useEffect(()=>{const c=f=>{f.key===ce&&(f.metaKey||f.ctrlKey)&&(f.preventDefault(),w())};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[w]);const E=g?"expanded":"collapsed",$=e.useMemo(()=>({state:E,open:g,setOpen:x,isMobile:s,openMobile:u,setOpenMobile:b,toggleSidebar:w}),[E,g,x,s,u,b,w]);return e.createElement(M.Provider,{value:$},e.createElement(y.TooltipProvider,{delayDuration:0},e.createElement("div",{style:{"--sidebar-width":oe,"--sidebar-width-icon":se,...o},className:i.cn("group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",n),ref:p,...l},d)))});k.displayName="SidebarProvider";const R=e.forwardRef(({side:t="left",variant:r="sidebar",collapsible:a="offcanvas",className:n,children:o,...d},l)=>{const{isMobile:p,state:s,openMobile:u,setOpenMobile:b}=v(),m=a==="offcanvas"?"icon":a;return a==="none"?e.createElement("div",{className:i.cn("flex h-full w-[--sidebar-width] flex-col border-r border-[#e6e6e6] bg-white text-black",n),ref:l,...d},o):p?e.createElement(h.Sheet,{open:u,onOpenChange:b,...d},e.createElement(h.SheetContent,{"data-sidebar":"sidebar","data-mobile":"true",className:i.cn("w-[--sidebar-width] border-r border-[#e6e6e6] bg-white p-0 text-black shadow-none [&>button]:hidden",n),style:{"--sidebar-width":de},side:t},e.createElement(h.SheetHeader,{className:"sr-only"},e.createElement(h.SheetTitle,null,"Sidebar"),e.createElement(h.SheetDescription,null,"Displays the mobile sidebar.")),e.createElement("div",{className:"flex h-full w-full flex-col"},o))):e.createElement("div",{ref:l,className:"group peer hidden text-black lg:block","data-state":s,"data-collapsible":s==="collapsed"?m:"","data-variant":r,"data-side":t},e.createElement("div",{className:i.cn("relative w-[--sidebar-width] bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",r==="floating"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),e.createElement("div",{className:i.cn("fixed inset-y-0 z-20 hidden h-svh w-[--sidebar-width] transition-[left,right,width] duration-200 ease-linear lg:flex",t==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",r==="floating"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=left]:border-[#e6e6e6] group-data-[side=right]:border-l group-data-[side=right]:border-[#e6e6e6]",n),...d},e.createElement("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-white text-black group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-[#e6e6e6] group-data-[variant=floating]:shadow"},o)))});R.displayName="Sidebar";const I=e.forwardRef(({className:t,onClick:r,...a},n)=>{const{isMobile:o,open:d,openMobile:l,toggleSidebar:p}=v(),s=o?l:d;return e.createElement(ee.Button,{ref:n,"data-sidebar":"trigger",variant:"ghost",size:"icon","data-state":s?"open":"closed",className:i.cn("h-9 w-9 rounded-lg border border-[#dcdcde] bg-white text-black hover:bg-[#fafafa] hover:text-black",t),onClick:u=>{r?.(u),p()},...a},e.createElement(Z.PanelLeft,{className:"size-4"}),e.createElement("span",{className:"sr-only"},"Toggle Sidebar"))});I.displayName="SidebarTrigger";const _=e.forwardRef(({className:t,...r},a)=>{const{toggleSidebar:n}=v();return e.createElement("button",{ref:a,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:n,title:"Toggle Sidebar",className:i.cn("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",t),...r})});_.displayName="SidebarRail";const C=e.forwardRef(({className:t,...r},a)=>e.createElement("main",{ref:a,className:i.cn("relative flex w-full flex-1 flex-col bg-background","lg:peer-data-[variant=inset]:m-2 lg:peer-data-[variant=inset]:ml-0 lg:peer-data-[variant=inset]:rounded-xl lg:peer-data-[variant=inset]:shadow",t),...r}));C.displayName="SidebarInset";const z=e.forwardRef(({className:t,...r},a)=>e.createElement(ae.Input,{ref:a,"data-sidebar":"input",className:i.cn("h-10 w-full rounded-lg border-[#e6e6e6] bg-white text-black placeholder:text-[#adacb0] shadow-none focus-visible:ring-2 focus-visible:ring-[#26453f]",t),...r}));z.displayName="SidebarInput";const O=e.forwardRef(({className:t,...r},a)=>e.createElement("div",{ref:a,"data-sidebar":"header",className:i.cn("flex flex-col gap-4 px-5 py-5 group-data-[collapsible=icon]:items-center group-data-[collapsible=icon]:px-4 group-data-[collapsible=icon]:py-4",t),...r}));O.displayName="SidebarHeader";const T=e.forwardRef(({className:t,...r},a)=>e.createElement("div",{ref:a,"data-sidebar":"footer",className:i.cn("flex flex-col gap-3 px-5 py-5 group-data-[collapsible=icon]:items-center group-data-[collapsible=icon]:px-4 group-data-[collapsible=icon]:py-4",t),...r}));T.displayName="SidebarFooter";const B=e.forwardRef(({className:t,...r},a)=>e.createElement(te.Separator,{ref:a,"data-sidebar":"separator",className:i.cn("mx-0 w-full bg-[#e6e6e6]",t),...r}));B.displayName="SidebarSeparator";const A=e.forwardRef(({className:t,...r},a)=>e.createElement("div",{ref:a,"data-sidebar":"content",className:i.cn("flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden",t),...r}));A.displayName="SidebarContent";const D=e.forwardRef(({className:t,...r},a)=>e.createElement("div",{ref:a,"data-sidebar":"group",className:i.cn("relative flex w-full min-w-0 flex-col gap-2 px-5 py-5 group-data-[collapsible=icon]:items-center group-data-[collapsible=icon]:px-4",t),...r}));D.displayName="SidebarGroup";const q=e.forwardRef(({className:t,asChild:r=!1,...a},n)=>{const o=r?S.Slot:"div";return e.createElement(o,{ref:n,"data-sidebar":"group-label",className:i.cn("flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium uppercase tracking-wide text-[#adacb0] outline-none ring-sidebar-ring transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",t),...a})});q.displayName="SidebarGroupLabel";const G=e.forwardRef(({className:t,asChild:r=!1,...a},n)=>{const o=r?S.Slot:"button";return e.createElement(o,{ref:n,"data-sidebar":"group-action",className:i.cn("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:lg:hidden","group-data-[collapsible=icon]:hidden",t),...a})});G.displayName="SidebarGroupAction";const L=e.forwardRef(({className:t,...r},a)=>e.createElement("div",{ref:a,"data-sidebar":"group-content",className:i.cn("w-full text-sm",t),...r}));L.displayName="SidebarGroupContent";const j=e.forwardRef(({className:t,...r},a)=>e.createElement("ul",{ref:a,"data-sidebar":"menu",className:i.cn("flex w-full min-w-0 flex-col gap-2",t),...r}));j.displayName="SidebarMenu";const P=e.forwardRef(({className:t,...r},a)=>e.createElement("li",{ref:a,"data-sidebar":"menu-item",className:i.cn("group/menu-item relative",t),...r}));P.displayName="SidebarMenuItem";const be=Q.cva("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-[4px] border border-transparent bg-white p-2 text-left text-sm font-normal text-[#7f7d83] outline-none ring-sidebar-ring transition-[background-color,border-color,color,width,height,padding] hover:border-[#f1f1f1] hover:bg-[#fafafa] hover:text-black focus-visible:ring-2 focus-visible:ring-[#26453f] active:border-[#f1f1f1] active:bg-[#fafafa] active:text-black disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:border-[#f1f1f1] data-[active=true]:bg-[#fafafa] data-[active=true]:font-medium data-[active=true]:text-black data-[state=open]:border-[#f1f1f1] data-[state=open]:bg-[#fafafa] data-[state=open]:text-black group-data-[collapsible=icon]:!size-10 group-data-[collapsible=icon]:!justify-center group-data-[collapsible=icon]:!p-0 group-data-[collapsible=icon]:[&>span:last-child]:hidden [&>span:last-child]:truncate [&>svg]:size-5 [&>svg]:shrink-0",{variants:{variant:{default:"",outline:"border-[#e6e6e6] text-black hover:border-[#dcdcde] hover:bg-[#fafafa]"},size:{default:"h-10 text-sm",sm:"h-9 text-xs",lg:"h-11 text-sm"}},defaultVariants:{variant:"default",size:"default"}}),H=e.forwardRef(({asChild:t=!1,isActive:r=!1,variant:a="default",size:n="default",tooltip:o,className:d,...l},p)=>{const s=t?S.Slot:"button",{isMobile:u,state:b}=v(),m=e.createElement(s,{ref:p,"data-sidebar":"menu-button","data-size":n,"data-active":r,className:i.cn(be({variant:a,size:n}),d),...l});return o?(typeof o=="string"&&(o={children:o}),e.createElement(y.Tooltip,null,e.createElement(y.TooltipTrigger,{asChild:!0},m),e.createElement(y.TooltipContent,{side:"right",align:"center",hidden:b!=="collapsed"||u,...o}))):m});H.displayName="SidebarMenuButton";const K=e.forwardRef(({className:t,asChild:r=!1,showOnHover:a=!1,...n},o)=>{const d=r?S.Slot:"button";return e.createElement(d,{ref:o,"data-sidebar":"menu-action",className:i.cn("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:lg:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",a&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground lg:opacity-0",t),...n})});K.displayName="SidebarMenuAction";const V=e.forwardRef(({className:t,...r},a)=>e.createElement("div",{ref:a,"data-sidebar":"menu-badge",className:i.cn("pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",t),...r}));V.displayName="SidebarMenuBadge";const F=e.forwardRef(({className:t,showIcon:r=!1,...a},n)=>{const o=e.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return e.createElement("div",{ref:n,"data-sidebar":"menu-skeleton",className:i.cn("flex h-8 items-center gap-2 rounded-md px-2",t),...a},r&&e.createElement(N.Skeleton,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),e.createElement(N.Skeleton,{className:"h-4 max-w-[--skeleton-width] flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":o}}))});F.displayName="SidebarMenuSkeleton";const W=e.forwardRef(({className:t,...r},a)=>e.createElement("ul",{ref:a,"data-sidebar":"menu-sub",className:i.cn("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",t),...r}));W.displayName="SidebarMenuSub";const U=e.forwardRef(({...t},r)=>e.createElement("li",{ref:r,...t}));U.displayName="SidebarMenuSubItem";const X=e.forwardRef(({asChild:t=!1,size:r="md",isActive:a,className:n,...o},d)=>{const l=t?S.Slot:"a";return e.createElement(l,{ref:d,"data-sidebar":"menu-sub-button","data-size":r,"data-active":a,className:i.cn("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring 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 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",r==="sm"&&"text-xs",r==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",n),...o})});X.displayName="SidebarMenuSubButton";exports.Sidebar=R;exports.SidebarContent=A;exports.SidebarFooter=T;exports.SidebarGroup=D;exports.SidebarGroupAction=G;exports.SidebarGroupContent=L;exports.SidebarGroupLabel=q;exports.SidebarHeader=O;exports.SidebarInput=z;exports.SidebarInset=C;exports.SidebarMenu=j;exports.SidebarMenuAction=K;exports.SidebarMenuBadge=V;exports.SidebarMenuButton=H;exports.SidebarMenuItem=P;exports.SidebarMenuSkeleton=F;exports.SidebarMenuSub=W;exports.SidebarMenuSubButton=X;exports.SidebarMenuSubItem=U;exports.SidebarProvider=k;exports.SidebarRail=_;exports.SidebarSeparator=B;exports.SidebarTrigger=I;exports.useSidebar=v;
|
|
2
2
|
//# sourceMappingURL=index.cjs45.js.map
|
package/dist/index.cjs45.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs45.js","sources":["../src/components/ui/sidebar.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { PanelLeft } from \"lucide-react\"\n\nimport { useIsMobile } from \"@/hooks/use-mobile\"\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Input } from \"@/components/ui/input\"\nimport { Separator } from \"@/components/ui/separator\"\nimport {\n Sheet,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n} from \"@/components/ui/sheet\"\nimport { Skeleton } from \"@/components/ui/skeleton\"\nimport {\n Tooltip,\n TooltipContent,\n TooltipProvider,\n TooltipTrigger,\n} from \"@/components/ui/tooltip\"\n\nconst SIDEBAR_COOKIE_NAME = \"sidebar_state\"\nconst SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7\nconst SIDEBAR_WIDTH = \"16rem\"\nconst SIDEBAR_WIDTH_MOBILE = \"18rem\"\nconst SIDEBAR_WIDTH_ICON = \"3rem\"\nconst SIDEBAR_KEYBOARD_SHORTCUT = \"b\"\n\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}\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\n return context\n}\n\nconst SidebarProvider = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\"> & {\n defaultOpen?: boolean\n open?: boolean\n onOpenChange?: (open: boolean) => void\n }\n>(\n (\n {\n defaultOpen = true,\n open: openProp,\n onOpenChange: setOpenProp,\n className,\n style,\n children,\n ...props\n },\n ref\n ) => {\n const isMobile = useIsMobile()\n const [openMobile, setOpenMobile] = React.useState(false)\n\n // This is the internal state of the sidebar.\n // We use openProp and setOpenProp for control from outside the component.\n const [_open, _setOpen] = React.useState(defaultOpen)\n const open = openProp ?? _open\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 _setOpen(openState)\n }\n\n // This sets the cookie to keep the sidebar state.\n document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`\n },\n [setOpenProp, open]\n )\n\n // Helper to toggle the sidebar.\n const toggleSidebar = React.useCallback(() => {\n return isMobile\n ? setOpenMobile((open) => !open)\n : setOpen((open) => !open)\n }, [isMobile, setOpen, setOpenMobile])\n\n // Adds a keyboard shortcut to toggle the sidebar.\n React.useEffect(() => {\n const handleKeyDown = (event: KeyboardEvent) => {\n if (\n event.key === SIDEBAR_KEYBOARD_SHORTCUT &&\n (event.metaKey || event.ctrlKey)\n ) {\n event.preventDefault()\n toggleSidebar()\n }\n }\n\n window.addEventListener(\"keydown\", handleKeyDown)\n return () => window.removeEventListener(\"keydown\", handleKeyDown)\n }, [toggleSidebar])\n\n // We add a state so that we can do data-state=\"expanded\" or \"collapsed\".\n // This makes it easier to style the sidebar with Tailwind classes.\n const state = open ? \"expanded\" : \"collapsed\"\n\n const contextValue = React.useMemo<SidebarContextProps>(\n () => ({\n state,\n open,\n setOpen,\n isMobile,\n openMobile,\n setOpenMobile,\n toggleSidebar,\n }),\n [state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]\n )\n\n return (\n <SidebarContext.Provider value={contextValue}>\n <TooltipProvider delayDuration={0}>\n <div\n style={\n {\n \"--sidebar-width\": SIDEBAR_WIDTH,\n \"--sidebar-width-icon\": SIDEBAR_WIDTH_ICON,\n ...style,\n } as React.CSSProperties\n }\n className={cn(\n \"group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar\",\n className\n )}\n ref={ref}\n {...props}\n >\n {children}\n </div>\n </TooltipProvider>\n </SidebarContext.Provider>\n )\n }\n)\nSidebarProvider.displayName = \"SidebarProvider\"\n\nconst Sidebar = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\"> & {\n side?: \"left\" | \"right\"\n variant?: \"sidebar\" | \"floating\" | \"inset\"\n collapsible?: \"offcanvas\" | \"icon\" | \"none\"\n }\n>(\n (\n {\n side = \"left\",\n variant = \"sidebar\",\n collapsible = \"offcanvas\",\n className,\n children,\n ...props\n },\n ref\n ) => {\n const { isMobile, state, openMobile, setOpenMobile } = useSidebar()\n\n if (collapsible === \"none\") {\n return (\n <div\n className={cn(\n \"flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground\",\n className\n )}\n ref={ref}\n {...props}\n >\n {children}\n </div>\n )\n }\n\n if (isMobile) {\n return (\n <Sheet open={openMobile} onOpenChange={setOpenMobile} {...props}>\n <SheetContent\n data-sidebar=\"sidebar\"\n data-mobile=\"true\"\n className=\"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden\"\n style={\n {\n \"--sidebar-width\": SIDEBAR_WIDTH_MOBILE,\n } as React.CSSProperties\n }\n side={side}\n >\n <SheetHeader className=\"sr-only\">\n <SheetTitle>Sidebar</SheetTitle>\n <SheetDescription>Displays the mobile sidebar.</SheetDescription>\n </SheetHeader>\n <div className=\"flex h-full w-full flex-col\">{children}</div>\n </SheetContent>\n </Sheet>\n )\n }\n\n return (\n <div\n ref={ref}\n className=\"group peer hidden text-sidebar-foreground md:block\"\n data-state={state}\n data-collapsible={state === \"collapsed\" ? collapsible : \"\"}\n data-variant={variant}\n data-side={side}\n >\n {/* This is what handles the sidebar gap on desktop */}\n <div\n className={cn(\n \"relative w-[--sidebar-width] bg-transparent transition-[width] duration-200 ease-linear\",\n \"group-data-[collapsible=offcanvas]:w-0\",\n \"group-data-[side=right]:rotate-180\",\n variant === \"floating\" || variant === \"inset\"\n ? \"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]\"\n : \"group-data-[collapsible=icon]:w-[--sidebar-width-icon]\"\n )}\n />\n <div\n className={cn(\n \"fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] duration-200 ease-linear md:flex\",\n side === \"left\"\n ? \"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]\"\n : \"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]\",\n // Adjust the padding for floating and inset variants.\n variant === \"floating\" || variant === \"inset\"\n ? \"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]\"\n : \"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l\",\n className\n )}\n {...props}\n >\n <div\n data-sidebar=\"sidebar\"\n className=\"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow\"\n >\n {children}\n </div>\n </div>\n </div>\n )\n }\n)\nSidebar.displayName = \"Sidebar\"\n\nconst SidebarTrigger = React.forwardRef<\n React.ElementRef<typeof Button>,\n React.ComponentProps<typeof Button>\n>(({ className, onClick, ...props }, ref) => {\n const { toggleSidebar } = useSidebar()\n\n return (\n <Button\n ref={ref}\n data-sidebar=\"trigger\"\n variant=\"ghost\"\n size=\"icon\"\n className={cn(\"h-7 w-7\", className)}\n onClick={(event) => {\n onClick?.(event)\n toggleSidebar()\n }}\n {...props}\n >\n <PanelLeft />\n <span className=\"sr-only\">Toggle Sidebar</span>\n </Button>\n )\n})\nSidebarTrigger.displayName = \"SidebarTrigger\"\n\nconst SidebarRail = React.forwardRef<\n HTMLButtonElement,\n React.ComponentProps<\"button\">\n>(({ className, ...props }, ref) => {\n const { toggleSidebar } = useSidebar()\n\n return (\n <button\n ref={ref}\n data-sidebar=\"rail\"\n aria-label=\"Toggle Sidebar\"\n tabIndex={-1}\n onClick={toggleSidebar}\n title=\"Toggle Sidebar\"\n className={cn(\n \"absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex\",\n \"[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize\",\n \"[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize\",\n \"group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar\",\n \"[[data-side=left][data-collapsible=offcanvas]_&]:-right-2\",\n \"[[data-side=right][data-collapsible=offcanvas]_&]:-left-2\",\n className\n )}\n {...props}\n />\n )\n})\nSidebarRail.displayName = \"SidebarRail\"\n\nconst SidebarInset = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"main\">\n>(({ className, ...props }, ref) => {\n return (\n <main\n ref={ref}\n className={cn(\n \"relative flex w-full flex-1 flex-col bg-background\",\n \"md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow\",\n className\n )}\n {...props}\n />\n )\n})\nSidebarInset.displayName = \"SidebarInset\"\n\nconst SidebarInput = React.forwardRef<\n React.ElementRef<typeof Input>,\n React.ComponentProps<typeof Input>\n>(({ className, ...props }, ref) => {\n return (\n <Input\n ref={ref}\n data-sidebar=\"input\"\n className={cn(\n \"h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring\",\n className\n )}\n {...props}\n />\n )\n})\nSidebarInput.displayName = \"SidebarInput\"\n\nconst SidebarHeader = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\">\n>(({ className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n data-sidebar=\"header\"\n className={cn(\"flex flex-col gap-2 p-2\", className)}\n {...props}\n />\n )\n})\nSidebarHeader.displayName = \"SidebarHeader\"\n\nconst SidebarFooter = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\">\n>(({ className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n data-sidebar=\"footer\"\n className={cn(\"flex flex-col gap-2 p-2\", className)}\n {...props}\n />\n )\n})\nSidebarFooter.displayName = \"SidebarFooter\"\n\nconst SidebarSeparator = React.forwardRef<\n React.ElementRef<typeof Separator>,\n React.ComponentProps<typeof Separator>\n>(({ className, ...props }, ref) => {\n return (\n <Separator\n ref={ref}\n data-sidebar=\"separator\"\n className={cn(\"mx-2 w-auto bg-sidebar-border\", className)}\n {...props}\n />\n )\n})\nSidebarSeparator.displayName = \"SidebarSeparator\"\n\nconst SidebarContent = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\">\n>(({ className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n data-sidebar=\"content\"\n className={cn(\n \"flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden\",\n className\n )}\n {...props}\n />\n )\n})\nSidebarContent.displayName = \"SidebarContent\"\n\nconst SidebarGroup = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\">\n>(({ className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n data-sidebar=\"group\"\n className={cn(\"relative flex w-full min-w-0 flex-col p-2\", className)}\n {...props}\n />\n )\n})\nSidebarGroup.displayName = \"SidebarGroup\"\n\nconst SidebarGroupLabel = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\"> & { asChild?: boolean }\n>(({ className, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : \"div\"\n\n return (\n <Comp\n ref={ref}\n data-sidebar=\"group-label\"\n className={cn(\n \"flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0\",\n \"group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0\",\n className\n )}\n {...props}\n />\n )\n})\nSidebarGroupLabel.displayName = \"SidebarGroupLabel\"\n\nconst SidebarGroupAction = React.forwardRef<\n HTMLButtonElement,\n React.ComponentProps<\"button\"> & { asChild?: boolean }\n>(({ className, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : \"button\"\n\n return (\n <Comp\n ref={ref}\n data-sidebar=\"group-action\"\n className={cn(\n \"absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0\",\n // Increases the hit area of the button on mobile.\n \"after:absolute after:-inset-2 after:md:hidden\",\n \"group-data-[collapsible=icon]:hidden\",\n className\n )}\n {...props}\n />\n )\n})\nSidebarGroupAction.displayName = \"SidebarGroupAction\"\n\nconst SidebarGroupContent = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\">\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n data-sidebar=\"group-content\"\n className={cn(\"w-full text-sm\", className)}\n {...props}\n />\n))\nSidebarGroupContent.displayName = \"SidebarGroupContent\"\n\nconst SidebarMenu = React.forwardRef<\n HTMLUListElement,\n React.ComponentProps<\"ul\">\n>(({ className, ...props }, ref) => (\n <ul\n ref={ref}\n data-sidebar=\"menu\"\n className={cn(\"flex w-full min-w-0 flex-col gap-1\", className)}\n {...props}\n />\n))\nSidebarMenu.displayName = \"SidebarMenu\"\n\nconst SidebarMenuItem = React.forwardRef<\n HTMLLIElement,\n React.ComponentProps<\"li\">\n>(({ className, ...props }, ref) => (\n <li\n ref={ref}\n data-sidebar=\"menu-item\"\n className={cn(\"group/menu-item relative\", className)}\n {...props}\n />\n))\nSidebarMenuItem.displayName = \"SidebarMenuItem\"\n\nconst sidebarMenuButtonVariants = cva(\n \"peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] 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 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0\",\n {\n variants: {\n variant: {\n default: \"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground\",\n outline:\n \"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]\",\n },\n size: {\n default: \"h-8 text-sm\",\n sm: \"h-7 text-xs\",\n lg: \"h-12 text-sm group-data-[collapsible=icon]:!p-0\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n)\n\nconst SidebarMenuButton = React.forwardRef<\n HTMLButtonElement,\n React.ComponentProps<\"button\"> & {\n asChild?: boolean\n isActive?: boolean\n tooltip?: string | React.ComponentProps<typeof TooltipContent>\n } & VariantProps<typeof sidebarMenuButtonVariants>\n>(\n (\n {\n asChild = false,\n isActive = false,\n variant = \"default\",\n size = \"default\",\n tooltip,\n className,\n ...props\n },\n ref\n ) => {\n const Comp = asChild ? Slot : \"button\"\n const { isMobile, state } = useSidebar()\n\n const button = (\n <Comp\n ref={ref}\n data-sidebar=\"menu-button\"\n data-size={size}\n data-active={isActive}\n className={cn(sidebarMenuButtonVariants({ variant, size }), className)}\n {...props}\n />\n )\n\n if (!tooltip) {\n return button\n }\n\n if (typeof tooltip === \"string\") {\n tooltip = {\n children: tooltip,\n }\n }\n\n return (\n <Tooltip>\n <TooltipTrigger asChild>{button}</TooltipTrigger>\n <TooltipContent\n side=\"right\"\n align=\"center\"\n hidden={state !== \"collapsed\" || isMobile}\n {...tooltip}\n />\n </Tooltip>\n )\n }\n)\nSidebarMenuButton.displayName = \"SidebarMenuButton\"\n\nconst SidebarMenuAction = React.forwardRef<\n HTMLButtonElement,\n React.ComponentProps<\"button\"> & {\n asChild?: boolean\n showOnHover?: boolean\n }\n>(({ className, asChild = false, showOnHover = false, ...props }, ref) => {\n const Comp = asChild ? Slot : \"button\"\n\n return (\n <Comp\n ref={ref}\n data-sidebar=\"menu-action\"\n className={cn(\n \"absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0\",\n // Increases the hit area of the button on mobile.\n \"after:absolute after:-inset-2 after:md:hidden\",\n \"peer-data-[size=sm]/menu-button:top-1\",\n \"peer-data-[size=default]/menu-button:top-1.5\",\n \"peer-data-[size=lg]/menu-button:top-2.5\",\n \"group-data-[collapsible=icon]:hidden\",\n showOnHover &&\n \"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0\",\n className\n )}\n {...props}\n />\n )\n})\nSidebarMenuAction.displayName = \"SidebarMenuAction\"\n\nconst SidebarMenuBadge = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\">\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n data-sidebar=\"menu-badge\"\n className={cn(\n \"pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground\",\n \"peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground\",\n \"peer-data-[size=sm]/menu-button:top-1\",\n \"peer-data-[size=default]/menu-button:top-1.5\",\n \"peer-data-[size=lg]/menu-button:top-2.5\",\n \"group-data-[collapsible=icon]:hidden\",\n className\n )}\n {...props}\n />\n))\nSidebarMenuBadge.displayName = \"SidebarMenuBadge\"\n\nconst SidebarMenuSkeleton = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\"> & {\n showIcon?: boolean\n }\n>(({ className, showIcon = false, ...props }, ref) => {\n // Random width between 50 to 90%.\n const width = React.useMemo(() => {\n return `${Math.floor(Math.random() * 40) + 50}%`\n }, [])\n\n return (\n <div\n ref={ref}\n data-sidebar=\"menu-skeleton\"\n className={cn(\"flex h-8 items-center gap-2 rounded-md px-2\", className)}\n {...props}\n >\n {showIcon && (\n <Skeleton\n className=\"size-4 rounded-md\"\n data-sidebar=\"menu-skeleton-icon\"\n />\n )}\n <Skeleton\n className=\"h-4 max-w-[--skeleton-width] flex-1\"\n data-sidebar=\"menu-skeleton-text\"\n style={\n {\n \"--skeleton-width\": width,\n } as React.CSSProperties\n }\n />\n </div>\n )\n})\nSidebarMenuSkeleton.displayName = \"SidebarMenuSkeleton\"\n\nconst SidebarMenuSub = React.forwardRef<\n HTMLUListElement,\n React.ComponentProps<\"ul\">\n>(({ className, ...props }, ref) => (\n <ul\n ref={ref}\n data-sidebar=\"menu-sub\"\n className={cn(\n \"mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5\",\n \"group-data-[collapsible=icon]:hidden\",\n className\n )}\n {...props}\n />\n))\nSidebarMenuSub.displayName = \"SidebarMenuSub\"\n\nconst SidebarMenuSubItem = React.forwardRef<\n HTMLLIElement,\n React.ComponentProps<\"li\">\n>(({ ...props }, ref) => <li ref={ref} {...props} />)\nSidebarMenuSubItem.displayName = \"SidebarMenuSubItem\"\n\nconst SidebarMenuSubButton = React.forwardRef<\n HTMLAnchorElement,\n React.ComponentProps<\"a\"> & {\n asChild?: boolean\n size?: \"sm\" | \"md\"\n isActive?: boolean\n }\n>(({ asChild = false, size = \"md\", isActive, className, ...props }, ref) => {\n const Comp = asChild ? Slot : \"a\"\n\n return (\n <Comp\n ref={ref}\n data-sidebar=\"menu-sub-button\"\n data-size={size}\n data-active={isActive}\n className={cn(\n \"flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring 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 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground\",\n \"data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground\",\n size === \"sm\" && \"text-xs\",\n size === \"md\" && \"text-sm\",\n \"group-data-[collapsible=icon]:hidden\",\n className\n )}\n {...props}\n />\n )\n})\nSidebarMenuSubButton.displayName = \"SidebarMenuSubButton\"\n\nexport {\n Sidebar,\n SidebarContent,\n SidebarFooter,\n SidebarGroup,\n SidebarGroupAction,\n SidebarGroupContent,\n SidebarGroupLabel,\n SidebarHeader,\n SidebarInput,\n SidebarInset,\n SidebarMenu,\n SidebarMenuAction,\n SidebarMenuBadge,\n SidebarMenuButton,\n SidebarMenuItem,\n SidebarMenuSkeleton,\n SidebarMenuSub,\n SidebarMenuSubButton,\n SidebarMenuSubItem,\n SidebarProvider,\n SidebarRail,\n SidebarSeparator,\n SidebarTrigger,\n useSidebar,\n}\n"],"names":["SIDEBAR_COOKIE_NAME","SIDEBAR_COOKIE_MAX_AGE","SIDEBAR_WIDTH","SIDEBAR_WIDTH_MOBILE","SIDEBAR_WIDTH_ICON","SIDEBAR_KEYBOARD_SHORTCUT","SidebarContext","React","useSidebar","context","SidebarProvider","defaultOpen","openProp","setOpenProp","className","style","children","props","ref","isMobile","useIsMobile","openMobile","setOpenMobile","_open","_setOpen","open","setOpen","value","openState","toggleSidebar","handleKeyDown","event","state","contextValue","TooltipProvider","cn","Sidebar","side","variant","collapsible","Sheet","SheetContent","SheetHeader","SheetTitle","SheetDescription","SidebarTrigger","onClick","Button","PanelLeft","SidebarRail","SidebarInset","SidebarInput","Input","SidebarHeader","SidebarFooter","SidebarSeparator","Separator","SidebarContent","SidebarGroup","SidebarGroupLabel","asChild","Comp","Slot","SidebarGroupAction","SidebarGroupContent","SidebarMenu","SidebarMenuItem","sidebarMenuButtonVariants","cva","SidebarMenuButton","isActive","size","tooltip","button","Tooltip","TooltipTrigger","TooltipContent","SidebarMenuAction","showOnHover","SidebarMenuBadge","SidebarMenuSkeleton","showIcon","width","Skeleton","SidebarMenuSub","SidebarMenuSubItem","SidebarMenuSubButton"],"mappings":"2tBAyBMA,GAAsB,gBACtBC,GAAyB,KAAU,GAAK,EACxCC,GAAgB,QAChBC,GAAuB,QACvBC,GAAqB,OACrBC,GAA4B,IAY5BC,EAAiBC,EAAM,cAA0C,IAAI,EAE3E,SAASC,GAAa,CACpB,MAAMC,EAAUF,EAAM,WAAWD,CAAc,EAC/C,GAAI,CAACG,EACH,MAAM,IAAI,MAAM,mDAAmD,EAGrE,OAAOA,CACT,CAEA,MAAMC,EAAkBH,EAAM,WAQ5B,CACE,CACE,YAAAI,EAAc,GACd,KAAMC,EACN,aAAcC,EACd,UAAAC,EACA,MAAAC,EACA,SAAAC,EACA,GAAGC,CAAA,EAELC,IACG,CACH,MAAMC,EAAWC,GAAAA,YAAA,EACX,CAACC,EAAYC,CAAa,EAAIf,EAAM,SAAS,EAAK,EAIlD,CAACgB,EAAOC,CAAQ,EAAIjB,EAAM,SAASI,CAAW,EAC9Cc,EAAOb,GAAYW,EACnBG,EAAUnB,EAAM,YACnBoB,GAAmD,CAClD,MAAMC,EAAY,OAAOD,GAAU,WAAaA,EAAMF,CAAI,EAAIE,EAC1Dd,EACFA,EAAYe,CAAS,EAErBJ,EAASI,CAAS,EAIpB,SAAS,OAAS,GAAG5B,EAAmB,IAAI4B,CAAS,qBAAqB3B,EAAsB,EAClG,EACA,CAACY,EAAaY,CAAI,CAAA,EAIdI,EAAgBtB,EAAM,YAAY,IAC/BY,EACHG,EAAeG,GAAS,CAACA,CAAI,EAC7BC,EAASD,GAAS,CAACA,CAAI,EAC1B,CAACN,EA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b,UAAWnC,EAAAA,GACT,8eACA,yFACAoC,IAAS,MAAQ,UACjBA,IAAS,MAAQ,UACjB,uCACAzD,CAAA,EAED,GAAGG,CAAA,CAAA,CAGV,CAAC,EACDqE,EAAqB,YAAc"}
|
|
1
|
+
{"version":3,"file":"index.cjs45.js","sources":["../src/components/ui/sidebar.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { PanelLeft } from \"lucide-react\"\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Input } from \"@/components/ui/input\"\nimport { Separator } from \"@/components/ui/separator\"\nimport {\n Sheet,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n} from \"@/components/ui/sheet\"\nimport { Skeleton } from \"@/components/ui/skeleton\"\nimport {\n Tooltip,\n TooltipContent,\n TooltipProvider,\n TooltipTrigger,\n} from \"@/components/ui/tooltip\"\n\nconst SIDEBAR_COOKIE_NAME = \"sidebar_state\"\nconst SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7\nconst SIDEBAR_WIDTH = \"15rem\"\nconst SIDEBAR_WIDTH_MOBILE = \"15rem\"\nconst SIDEBAR_WIDTH_ICON = \"4.5rem\"\nconst SIDEBAR_BREAKPOINT = 1024\nconst SIDEBAR_KEYBOARD_SHORTCUT = \"b\"\n\nfunction useIsTabletOrMobile() {\n const [isTabletOrMobile, setIsTabletOrMobile] = React.useState<\n boolean | undefined\n >(undefined)\n\n React.useEffect(() => {\n const media = window.matchMedia(`(max-width: ${SIDEBAR_BREAKPOINT - 1}px)`)\n const onChange = () => {\n setIsTabletOrMobile(media.matches)\n }\n\n onChange()\n\n if (typeof media.addEventListener === \"function\") {\n media.addEventListener(\"change\", onChange)\n return () => media.removeEventListener(\"change\", onChange)\n }\n\n media.addListener(onChange)\n return () => media.removeListener(onChange)\n }, [])\n\n return !!isTabletOrMobile\n}\n\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}\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\n return context\n}\n\nconst SidebarProvider = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\"> & {\n defaultOpen?: boolean\n open?: boolean\n onOpenChange?: (open: boolean) => void\n }\n>(\n (\n {\n defaultOpen = true,\n open: openProp,\n onOpenChange: setOpenProp,\n className,\n style,\n children,\n ...props\n },\n ref\n ) => {\n const isMobile = useIsTabletOrMobile()\n const [openMobile, setOpenMobile] = React.useState(false)\n\n // This is the internal state of the sidebar.\n // We use openProp and setOpenProp for control from outside the component.\n const [_open, _setOpen] = React.useState(defaultOpen)\n const open = openProp ?? _open\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 _setOpen(openState)\n }\n\n // This sets the cookie to keep the sidebar state.\n document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`\n },\n [setOpenProp, open]\n )\n\n // Helper to toggle the sidebar.\n const toggleSidebar = React.useCallback(() => {\n return isMobile\n ? setOpenMobile((open) => !open)\n : setOpen((open) => !open)\n }, [isMobile, setOpen, setOpenMobile])\n\n // Adds a keyboard shortcut to toggle the sidebar.\n React.useEffect(() => {\n const handleKeyDown = (event: KeyboardEvent) => {\n if (\n event.key === SIDEBAR_KEYBOARD_SHORTCUT &&\n (event.metaKey || event.ctrlKey)\n ) {\n event.preventDefault()\n toggleSidebar()\n }\n }\n\n window.addEventListener(\"keydown\", handleKeyDown)\n return () => window.removeEventListener(\"keydown\", handleKeyDown)\n }, [toggleSidebar])\n\n // We add a state so that we can do data-state=\"expanded\" or \"collapsed\".\n // This makes it easier to style the sidebar with Tailwind classes.\n const state = open ? \"expanded\" : \"collapsed\"\n\n const contextValue = React.useMemo<SidebarContextProps>(\n () => ({\n state,\n open,\n setOpen,\n isMobile,\n openMobile,\n setOpenMobile,\n toggleSidebar,\n }),\n [state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]\n )\n\n return (\n <SidebarContext.Provider value={contextValue}>\n <TooltipProvider delayDuration={0}>\n <div\n style={\n {\n \"--sidebar-width\": SIDEBAR_WIDTH,\n \"--sidebar-width-icon\": SIDEBAR_WIDTH_ICON,\n ...style,\n } as React.CSSProperties\n }\n className={cn(\n \"group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar\",\n className\n )}\n ref={ref}\n {...props}\n >\n {children}\n </div>\n </TooltipProvider>\n </SidebarContext.Provider>\n )\n }\n)\nSidebarProvider.displayName = \"SidebarProvider\"\n\nconst Sidebar = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\"> & {\n side?: \"left\" | \"right\"\n variant?: \"sidebar\" | \"floating\" | \"inset\"\n collapsible?: \"offcanvas\" | \"icon\" | \"none\"\n }\n>(\n (\n {\n side = \"left\",\n variant = \"sidebar\",\n collapsible = \"offcanvas\",\n className,\n children,\n ...props\n },\n ref\n ) => {\n const { isMobile, state, openMobile, setOpenMobile } = useSidebar()\n const desktopCollapsible = collapsible === \"offcanvas\" ? \"icon\" : collapsible\n\n if (collapsible === \"none\") {\n return (\n <div\n className={cn(\n \"flex h-full w-[--sidebar-width] flex-col border-r border-[#e6e6e6] bg-white text-black\",\n className\n )}\n ref={ref}\n {...props}\n >\n {children}\n </div>\n )\n }\n\n if (isMobile) {\n return (\n <Sheet open={openMobile} onOpenChange={setOpenMobile} {...props}>\n <SheetContent\n data-sidebar=\"sidebar\"\n data-mobile=\"true\"\n className={cn(\n \"w-[--sidebar-width] border-r border-[#e6e6e6] bg-white p-0 text-black shadow-none [&>button]:hidden\",\n className\n )}\n style={\n {\n \"--sidebar-width\": SIDEBAR_WIDTH_MOBILE,\n } as React.CSSProperties\n }\n side={side}\n >\n <SheetHeader className=\"sr-only\">\n <SheetTitle>Sidebar</SheetTitle>\n <SheetDescription>Displays the mobile sidebar.</SheetDescription>\n </SheetHeader>\n <div className=\"flex h-full w-full flex-col\">{children}</div>\n </SheetContent>\n </Sheet>\n )\n }\n\n return (\n <div\n ref={ref}\n className=\"group peer hidden text-black lg:block\"\n data-state={state}\n data-collapsible={state === \"collapsed\" ? desktopCollapsible : \"\"}\n data-variant={variant}\n data-side={side}\n >\n {/* This is what handles the sidebar gap on desktop */}\n <div\n className={cn(\n \"relative w-[--sidebar-width] bg-transparent transition-[width] duration-200 ease-linear\",\n \"group-data-[collapsible=offcanvas]:w-0\",\n \"group-data-[side=right]:rotate-180\",\n variant === \"floating\"\n ? \"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]\"\n : \"group-data-[collapsible=icon]:w-[--sidebar-width-icon]\"\n )}\n />\n <div\n className={cn(\n \"fixed inset-y-0 z-20 hidden h-svh w-[--sidebar-width] transition-[left,right,width] duration-200 ease-linear lg:flex\",\n side === \"left\"\n ? \"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]\"\n : \"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]\",\n // Adjust the padding for floating and inset variants.\n variant === \"floating\"\n ? \"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]\"\n : \"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=left]:border-[#e6e6e6] group-data-[side=right]:border-l group-data-[side=right]:border-[#e6e6e6]\",\n className\n )}\n {...props}\n >\n <div\n data-sidebar=\"sidebar\"\n className=\"flex h-full w-full flex-col bg-white text-black group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-[#e6e6e6] group-data-[variant=floating]:shadow\"\n >\n {children}\n </div>\n </div>\n </div>\n )\n }\n)\nSidebar.displayName = \"Sidebar\"\n\nconst SidebarTrigger = React.forwardRef<\n React.ElementRef<typeof Button>,\n React.ComponentProps<typeof Button>\n>(({ className, onClick, ...props }, ref) => {\n const { isMobile, open, openMobile, toggleSidebar } = useSidebar()\n const isOpen = isMobile ? openMobile : open\n\n return (\n <Button\n ref={ref}\n data-sidebar=\"trigger\"\n variant=\"ghost\"\n size=\"icon\"\n data-state={isOpen ? \"open\" : \"closed\"}\n className={cn(\n \"h-9 w-9 rounded-lg border border-[#dcdcde] bg-white text-black hover:bg-[#fafafa] hover:text-black\",\n className\n )}\n onClick={(event) => {\n onClick?.(event)\n toggleSidebar()\n }}\n {...props}\n >\n <PanelLeft className=\"size-4\" />\n <span className=\"sr-only\">Toggle Sidebar</span>\n </Button>\n )\n})\nSidebarTrigger.displayName = \"SidebarTrigger\"\n\nconst SidebarRail = React.forwardRef<\n HTMLButtonElement,\n React.ComponentProps<\"button\">\n>(({ className, ...props }, ref) => {\n const { toggleSidebar } = useSidebar()\n\n return (\n <button\n ref={ref}\n data-sidebar=\"rail\"\n aria-label=\"Toggle Sidebar\"\n tabIndex={-1}\n onClick={toggleSidebar}\n title=\"Toggle Sidebar\"\n className={cn(\n \"absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex\",\n \"[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize\",\n \"[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize\",\n \"group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar\",\n \"[[data-side=left][data-collapsible=offcanvas]_&]:-right-2\",\n \"[[data-side=right][data-collapsible=offcanvas]_&]:-left-2\",\n className\n )}\n {...props}\n />\n )\n})\nSidebarRail.displayName = \"SidebarRail\"\n\nconst SidebarInset = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"main\">\n>(({ className, ...props }, ref) => {\n return (\n <main\n ref={ref}\n className={cn(\n \"relative flex w-full flex-1 flex-col bg-background\",\n \"lg:peer-data-[variant=inset]:m-2 lg:peer-data-[variant=inset]:ml-0 lg:peer-data-[variant=inset]:rounded-xl lg:peer-data-[variant=inset]:shadow\",\n className\n )}\n {...props}\n />\n )\n})\nSidebarInset.displayName = \"SidebarInset\"\n\nconst SidebarInput = React.forwardRef<\n React.ElementRef<typeof Input>,\n React.ComponentProps<typeof Input>\n>(({ className, ...props }, ref) => {\n return (\n <Input\n ref={ref}\n data-sidebar=\"input\"\n className={cn(\n \"h-10 w-full rounded-lg border-[#e6e6e6] bg-white text-black placeholder:text-[#adacb0] shadow-none focus-visible:ring-2 focus-visible:ring-[#26453f]\",\n className\n )}\n {...props}\n />\n )\n})\nSidebarInput.displayName = \"SidebarInput\"\n\nconst SidebarHeader = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\">\n>(({ className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n data-sidebar=\"header\"\n className={cn(\n \"flex flex-col gap-4 px-5 py-5 group-data-[collapsible=icon]:items-center group-data-[collapsible=icon]:px-4 group-data-[collapsible=icon]:py-4\",\n className\n )}\n {...props}\n />\n )\n})\nSidebarHeader.displayName = \"SidebarHeader\"\n\nconst SidebarFooter = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\">\n>(({ className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n data-sidebar=\"footer\"\n className={cn(\n \"flex flex-col gap-3 px-5 py-5 group-data-[collapsible=icon]:items-center group-data-[collapsible=icon]:px-4 group-data-[collapsible=icon]:py-4\",\n className\n )}\n {...props}\n />\n )\n})\nSidebarFooter.displayName = \"SidebarFooter\"\n\nconst SidebarSeparator = React.forwardRef<\n React.ElementRef<typeof Separator>,\n React.ComponentProps<typeof Separator>\n>(({ className, ...props }, ref) => {\n return (\n <Separator\n ref={ref}\n data-sidebar=\"separator\"\n className={cn(\"mx-0 w-full bg-[#e6e6e6]\", className)}\n {...props}\n />\n )\n})\nSidebarSeparator.displayName = \"SidebarSeparator\"\n\nconst SidebarContent = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\">\n>(({ className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n data-sidebar=\"content\"\n className={cn(\n \"flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden\",\n className\n )}\n {...props}\n />\n )\n})\nSidebarContent.displayName = \"SidebarContent\"\n\nconst SidebarGroup = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\">\n>(({ className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n data-sidebar=\"group\"\n className={cn(\n \"relative flex w-full min-w-0 flex-col gap-2 px-5 py-5 group-data-[collapsible=icon]:items-center group-data-[collapsible=icon]:px-4\",\n className\n )}\n {...props}\n />\n )\n})\nSidebarGroup.displayName = \"SidebarGroup\"\n\nconst SidebarGroupLabel = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\"> & { asChild?: boolean }\n>(({ className, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : \"div\"\n\n return (\n <Comp\n ref={ref}\n data-sidebar=\"group-label\"\n className={cn(\n \"flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium uppercase tracking-wide text-[#adacb0] outline-none ring-sidebar-ring transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0\",\n \"group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0\",\n className\n )}\n {...props}\n />\n )\n})\nSidebarGroupLabel.displayName = \"SidebarGroupLabel\"\n\nconst SidebarGroupAction = React.forwardRef<\n HTMLButtonElement,\n React.ComponentProps<\"button\"> & { asChild?: boolean }\n>(({ className, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : \"button\"\n\n return (\n <Comp\n ref={ref}\n data-sidebar=\"group-action\"\n className={cn(\n \"absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0\",\n // Increases the hit area of the button on mobile.\n \"after:absolute after:-inset-2 after:lg:hidden\",\n \"group-data-[collapsible=icon]:hidden\",\n className\n )}\n {...props}\n />\n )\n})\nSidebarGroupAction.displayName = \"SidebarGroupAction\"\n\nconst SidebarGroupContent = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\">\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n data-sidebar=\"group-content\"\n className={cn(\"w-full text-sm\", className)}\n {...props}\n />\n))\nSidebarGroupContent.displayName = \"SidebarGroupContent\"\n\nconst SidebarMenu = React.forwardRef<\n HTMLUListElement,\n React.ComponentProps<\"ul\">\n>(({ className, ...props }, ref) => (\n <ul\n ref={ref}\n data-sidebar=\"menu\"\n className={cn(\"flex w-full min-w-0 flex-col gap-2\", className)}\n {...props}\n />\n))\nSidebarMenu.displayName = \"SidebarMenu\"\n\nconst SidebarMenuItem = React.forwardRef<\n HTMLLIElement,\n React.ComponentProps<\"li\">\n>(({ className, ...props }, ref) => (\n <li\n ref={ref}\n data-sidebar=\"menu-item\"\n className={cn(\"group/menu-item relative\", className)}\n {...props}\n />\n))\nSidebarMenuItem.displayName = \"SidebarMenuItem\"\n\nconst sidebarMenuButtonVariants = cva(\n \"peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-[4px] border border-transparent bg-white p-2 text-left text-sm font-normal text-[#7f7d83] outline-none ring-sidebar-ring transition-[background-color,border-color,color,width,height,padding] hover:border-[#f1f1f1] hover:bg-[#fafafa] hover:text-black focus-visible:ring-2 focus-visible:ring-[#26453f] active:border-[#f1f1f1] active:bg-[#fafafa] active:text-black disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:border-[#f1f1f1] data-[active=true]:bg-[#fafafa] data-[active=true]:font-medium data-[active=true]:text-black data-[state=open]:border-[#f1f1f1] data-[state=open]:bg-[#fafafa] data-[state=open]:text-black group-data-[collapsible=icon]:!size-10 group-data-[collapsible=icon]:!justify-center group-data-[collapsible=icon]:!p-0 group-data-[collapsible=icon]:[&>span:last-child]:hidden [&>span:last-child]:truncate [&>svg]:size-5 [&>svg]:shrink-0\",\n {\n variants: {\n variant: {\n default: \"\",\n outline:\n \"border-[#e6e6e6] text-black hover:border-[#dcdcde] hover:bg-[#fafafa]\",\n },\n size: {\n default: \"h-10 text-sm\",\n sm: \"h-9 text-xs\",\n lg: \"h-11 text-sm\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n)\n\nconst SidebarMenuButton = React.forwardRef<\n HTMLButtonElement,\n React.ComponentProps<\"button\"> & {\n asChild?: boolean\n isActive?: boolean\n tooltip?: string | React.ComponentProps<typeof TooltipContent>\n } & VariantProps<typeof sidebarMenuButtonVariants>\n>(\n (\n {\n asChild = false,\n isActive = false,\n variant = \"default\",\n size = \"default\",\n tooltip,\n className,\n ...props\n },\n ref\n ) => {\n const Comp = asChild ? Slot : \"button\"\n const { isMobile, state } = useSidebar()\n\n const button = (\n <Comp\n ref={ref}\n data-sidebar=\"menu-button\"\n data-size={size}\n data-active={isActive}\n className={cn(sidebarMenuButtonVariants({ variant, size }), className)}\n {...props}\n />\n )\n\n if (!tooltip) {\n return button\n }\n\n if (typeof tooltip === \"string\") {\n tooltip = {\n children: tooltip,\n }\n }\n\n return (\n <Tooltip>\n <TooltipTrigger asChild>{button}</TooltipTrigger>\n <TooltipContent\n side=\"right\"\n align=\"center\"\n hidden={state !== \"collapsed\" || isMobile}\n {...tooltip}\n />\n </Tooltip>\n )\n }\n)\nSidebarMenuButton.displayName = \"SidebarMenuButton\"\n\nconst SidebarMenuAction = React.forwardRef<\n HTMLButtonElement,\n React.ComponentProps<\"button\"> & {\n asChild?: boolean\n showOnHover?: boolean\n }\n>(({ className, asChild = false, showOnHover = false, ...props }, ref) => {\n const Comp = asChild ? Slot : \"button\"\n\n return (\n <Comp\n ref={ref}\n data-sidebar=\"menu-action\"\n className={cn(\n \"absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0\",\n // Increases the hit area of the button on mobile.\n \"after:absolute after:-inset-2 after:lg:hidden\",\n \"peer-data-[size=sm]/menu-button:top-1\",\n \"peer-data-[size=default]/menu-button:top-1.5\",\n \"peer-data-[size=lg]/menu-button:top-2.5\",\n \"group-data-[collapsible=icon]:hidden\",\n showOnHover &&\n \"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground lg:opacity-0\",\n className\n )}\n {...props}\n />\n )\n})\nSidebarMenuAction.displayName = \"SidebarMenuAction\"\n\nconst SidebarMenuBadge = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\">\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n data-sidebar=\"menu-badge\"\n className={cn(\n \"pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground\",\n \"peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground\",\n \"peer-data-[size=sm]/menu-button:top-1\",\n \"peer-data-[size=default]/menu-button:top-1.5\",\n \"peer-data-[size=lg]/menu-button:top-2.5\",\n \"group-data-[collapsible=icon]:hidden\",\n className\n )}\n {...props}\n />\n))\nSidebarMenuBadge.displayName = \"SidebarMenuBadge\"\n\nconst SidebarMenuSkeleton = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<\"div\"> & {\n showIcon?: boolean\n }\n>(({ className, showIcon = false, ...props }, ref) => {\n // Random width between 50 to 90%.\n const width = React.useMemo(() => {\n return `${Math.floor(Math.random() * 40) + 50}%`\n }, [])\n\n return (\n <div\n ref={ref}\n data-sidebar=\"menu-skeleton\"\n className={cn(\"flex h-8 items-center gap-2 rounded-md px-2\", className)}\n {...props}\n >\n {showIcon && (\n <Skeleton\n className=\"size-4 rounded-md\"\n data-sidebar=\"menu-skeleton-icon\"\n />\n )}\n <Skeleton\n className=\"h-4 max-w-[--skeleton-width] flex-1\"\n data-sidebar=\"menu-skeleton-text\"\n style={\n {\n \"--skeleton-width\": width,\n } as React.CSSProperties\n }\n />\n </div>\n )\n})\nSidebarMenuSkeleton.displayName = \"SidebarMenuSkeleton\"\n\nconst SidebarMenuSub = React.forwardRef<\n HTMLUListElement,\n React.ComponentProps<\"ul\">\n>(({ className, ...props }, ref) => (\n <ul\n ref={ref}\n data-sidebar=\"menu-sub\"\n className={cn(\n \"mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5\",\n \"group-data-[collapsible=icon]:hidden\",\n className\n )}\n {...props}\n />\n))\nSidebarMenuSub.displayName = \"SidebarMenuSub\"\n\nconst SidebarMenuSubItem = React.forwardRef<\n HTMLLIElement,\n React.ComponentProps<\"li\">\n>(({ ...props }, ref) => <li ref={ref} {...props} />)\nSidebarMenuSubItem.displayName = \"SidebarMenuSubItem\"\n\nconst SidebarMenuSubButton = React.forwardRef<\n HTMLAnchorElement,\n React.ComponentProps<\"a\"> & {\n asChild?: boolean\n size?: \"sm\" | \"md\"\n isActive?: boolean\n }\n>(({ asChild = false, size = \"md\", isActive, className, ...props }, ref) => {\n const Comp = asChild ? Slot : \"a\"\n\n return (\n <Comp\n ref={ref}\n data-sidebar=\"menu-sub-button\"\n data-size={size}\n data-active={isActive}\n className={cn(\n \"flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring 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 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground\",\n \"data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground\",\n size === \"sm\" && \"text-xs\",\n size === \"md\" && \"text-sm\",\n \"group-data-[collapsible=icon]:hidden\",\n className\n )}\n {...props}\n />\n )\n})\nSidebarMenuSubButton.displayName = \"SidebarMenuSubButton\"\n\nexport {\n Sidebar,\n SidebarContent,\n SidebarFooter,\n SidebarGroup,\n SidebarGroupAction,\n SidebarGroupContent,\n SidebarGroupLabel,\n SidebarHeader,\n SidebarInput,\n SidebarInset,\n SidebarMenu,\n SidebarMenuAction,\n SidebarMenuBadge,\n SidebarMenuButton,\n SidebarMenuItem,\n SidebarMenuSkeleton,\n SidebarMenuSub,\n SidebarMenuSubButton,\n SidebarMenuSubItem,\n SidebarProvider,\n SidebarRail,\n SidebarSeparator,\n SidebarTrigger,\n useSidebar,\n}\n"],"names":["SIDEBAR_COOKIE_NAME","SIDEBAR_COOKIE_MAX_AGE","SIDEBAR_WIDTH","SIDEBAR_WIDTH_MOBILE","SIDEBAR_WIDTH_ICON","SIDEBAR_BREAKPOINT","SIDEBAR_KEYBOARD_SHORTCUT","useIsTabletOrMobile","isTabletOrMobile","setIsTabletOrMobile","React","media","onChange","SidebarContext","useSidebar","context","SidebarProvider","defaultOpen","openProp","setOpenProp","className","style","children","props","ref","isMobile","openMobile","setOpenMobile","_open","_setOpen","open","setOpen","value","openState","toggleSidebar","handleKeyDown","event","state","contextValue","TooltipProvider","cn","Sidebar","side","variant","collapsible","desktopCollapsible","Sheet","SheetContent","SheetHeader","SheetTitle","SheetDescription","SidebarTrigger","onClick","isOpen","Button","PanelLeft","SidebarRail","SidebarInset","SidebarInput","Input","SidebarHeader","SidebarFooter","SidebarSeparator","Separator","SidebarContent","SidebarGroup","SidebarGroupLabel","asChild","Comp","Slot","SidebarGroupAction","SidebarGroupContent","SidebarMenu","SidebarMenuItem","sidebarMenuButtonVariants","cva","SidebarMenuButton","isActive","size","tooltip","button","Tooltip","TooltipTrigger","TooltipContent","SidebarMenuAction","showOnHover","SidebarMenuBadge","SidebarMenuSkeleton","showIcon","width","Skeleton","SidebarMenuSub","SidebarMenuSubItem","SidebarMenuSubButton"],"mappings":"4rBAuBMA,GAAsB,gBACtBC,GAAyB,KAAU,GAAK,EACxCC,GAAgB,QAChBC,GAAuB,QACvBC,GAAqB,SACrBC,GAAqB,KACrBC,GAA4B,IAElC,SAASC,IAAsB,CAC7B,KAAM,CAACC,EAAkBC,CAAmB,EAAIC,EAAM,SAEpD,MAAS,EAEXA,OAAAA,EAAM,UAAU,IAAM,CACpB,MAAMC,EAAQ,OAAO,WAAW,eAAeN,GAAqB,CAAC,KAAK,EACpEO,EAAW,IAAM,CACrBH,EAAoBE,EAAM,OAAO,CACnC,EAIA,OAFAC,EAAA,EAEI,OAAOD,EAAM,kBAAqB,YACpCA,EAAM,iBAAiB,SAAUC,CAAQ,EAClC,IAAMD,EAAM,oBAAoB,SAAUC,CAAQ,IAG3DD,EAAM,YAAYC,CAAQ,EACnB,IAAMD,EAAM,eAAeC,CAAQ,EAC5C,EAAG,CAAA,CAAE,EAEE,CAAC,CAACJ,CACX,CAYA,MAAMK,EAAiBH,EAAM,cAA0C,IAAI,EAE3E,SAASI,GAAa,CACpB,MAAMC,EAAUL,EAAM,WAAWG,CAAc,EAC/C,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B,CAAS,EACrE,GAAGG,CAAA,EAEHiE,GACC9E,EAAA,cAACgF,EAAAA,SAAA,CACC,UAAU,oBACV,eAAa,oBAAA,CAAA,EAGjBhF,EAAA,cAACgF,EAAAA,SAAA,CACC,UAAU,sCACV,eAAa,qBACb,MACE,CACE,mBAAoBD,CAAA,CACtB,CAAA,CAEJ,CAGN,CAAC,EACDF,EAAoB,YAAc,sBAElC,MAAMI,EAAiBjF,EAAM,WAG3B,CAAC,CAAE,UAAAU,EAAW,GAAGG,CAAA,EAASC,IAC1Bd,EAAA,cAAC,KAAA,CACC,IAAAc,EACA,eAAa,WACb,UAAWgB,EAAAA,GACT,iGACA,uCACApB,CAAA,EAED,GAAGG,CAAA,CACN,CACD,EACDoE,EAAe,YAAc,iBAE7B,MAAMC,EAAqBlF,EAAM,WAG/B,CAAC,CAAE,GAAGa,CAAA,EAASC,IAAQd,EAAA,cAAC,KAAA,CAAG,IAAAc,EAAW,GAAGD,EAAO,CAAE,EACpDqE,EAAmB,YAAc,qBAEjC,MAAMC,EAAuBnF,EAAM,WAOjC,CAAC,CAAE,QAAAyD,EAAU,GAAO,KAAAW,EAAO,KAAM,SAAAD,EAAU,UAAAzD,EAAW,GAAGG,CAAA,EAASC,IAAQ,CAC1E,MAAM4C,EAAOD,EAAUE,EAAAA,KAAO,IAE9B,OACE3D,EAAA,cAAC0D,EAAA,CACC,IAAA5C,EACA,eAAa,kBACb,YAAWsD,EACX,cAAaD,EACb,UAAWrC,EAAAA,GACT,8eACA,yFACAsC,IAAS,MAAQ,UACjBA,IAAS,MAAQ,UACjB,uCACA1D,CAAA,EAED,GAAGG,CAAA,CAAA,CAGV,CAAC,EACDsE,EAAqB,YAAc"}
|
package/dist/index.cjs52.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("react"),d=require("@radix-ui/react-tabs"),n=require("./index.cjs57.js");function o(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("react"),d=require("@radix-ui/react-tabs"),n=require("./index.cjs57.js");function o(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const s=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,s.get?s:{enumerable:!0,get:()=>e[t]})}}return a.default=e,Object.freeze(a)}const r=o(b),i=o(d),p=i.Root,c=r.forwardRef(({className:e,...a},t)=>r.createElement(i.List,{ref:t,className:n.cn("flex w-full flex-wrap items-center gap-1 rounded-[8px] bg-[#f5f5f5] p-1","data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col data-[orientation=vertical]:items-start",e),...a}));c.displayName=i.List.displayName;const l=r.forwardRef(({className:e,...a},t)=>r.createElement(i.Trigger,{ref:t,className:n.cn("inline-flex h-7 items-center justify-center gap-1 whitespace-nowrap rounded-[8px] border border-transparent bg-transparent px-2 font-['Inter'] text-[16px] not-italic font-medium leading-[24px] [color:var(--raw-black,#000)] transition-colors","[&_svg]:size-3.5","hover:[color:var(--raw-black,#000)]","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#1D1C20] focus-visible:ring-offset-2","disabled:pointer-events-none disabled:bg-[#f2f2f2] disabled:text-[#b3b3b3]","data-[state=active]:bg-white data-[state=active]:shadow-[0_2px_4px_-2px_rgba(19,25,39,0.12),_0_4px_4px_-2px_rgba(19,25,39,0.08)]",e),...a}));l.displayName=i.Trigger.displayName;const f=r.forwardRef(({className:e,...a},t)=>r.createElement(i.Content,{ref:t,className:n.cn("mt-4 font-['Inter'] text-[16px] not-italic font-medium leading-[24px] [color:var(--raw-black,#000)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#1D1C20] focus-visible:ring-offset-2",e),...a}));f.displayName=i.Content.displayName;exports.Tabs=p;exports.TabsContent=f;exports.TabsList=c;exports.TabsTrigger=l;
|
|
2
2
|
//# sourceMappingURL=index.cjs52.js.map
|
package/dist/index.cjs52.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs52.js","sources":["../src/components/ui/tabs.tsx"],"sourcesContent":["import * as React from \"react\"\nimport * as TabsPrimitive from \"@radix-ui/react-tabs\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst Tabs = TabsPrimitive.Root\n\nconst TabsList = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>\n>(({ className, ...props }, ref) => (\n <TabsPrimitive.List\n ref={ref}\n className={cn(\n \"flex w-full flex-wrap items-center gap-1 rounded-[8px] bg-[#f5f5f5] p-1\",\n \"data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col data-[orientation=vertical]:items-start\",\n className\n )}\n {...props}\n />\n))\nTabsList.displayName = TabsPrimitive.List.displayName\n\nconst TabsTrigger = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>\n>(({ className, ...props }, ref) => (\n <TabsPrimitive.Trigger\n ref={ref}\n className={cn(\n \"inline-flex h-7 items-center justify-center gap-1 whitespace-nowrap rounded-[8px] border border-transparent bg-transparent px-2 text-[
|
|
1
|
+
{"version":3,"file":"index.cjs52.js","sources":["../src/components/ui/tabs.tsx"],"sourcesContent":["import * as React from \"react\"\nimport * as TabsPrimitive from \"@radix-ui/react-tabs\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst Tabs = TabsPrimitive.Root\n\nconst TabsList = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>\n>(({ className, ...props }, ref) => (\n <TabsPrimitive.List\n ref={ref}\n className={cn(\n \"flex w-full flex-wrap items-center gap-1 rounded-[8px] bg-[#f5f5f5] p-1\",\n \"data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col data-[orientation=vertical]:items-start\",\n className\n )}\n {...props}\n />\n))\nTabsList.displayName = TabsPrimitive.List.displayName\n\nconst TabsTrigger = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>\n>(({ className, ...props }, ref) => (\n <TabsPrimitive.Trigger\n ref={ref}\n className={cn(\n \"inline-flex h-7 items-center justify-center gap-1 whitespace-nowrap rounded-[8px] border border-transparent bg-transparent px-2 font-['Inter'] text-[16px] not-italic font-medium leading-[24px] [color:var(--raw-black,#000)] transition-colors\",\n \"[&_svg]:size-3.5\",\n \"hover:[color:var(--raw-black,#000)]\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#1D1C20] focus-visible:ring-offset-2\",\n \"disabled:pointer-events-none disabled:bg-[#f2f2f2] disabled:text-[#b3b3b3]\",\n \"data-[state=active]:bg-white data-[state=active]:shadow-[0_2px_4px_-2px_rgba(19,25,39,0.12),_0_4px_4px_-2px_rgba(19,25,39,0.08)]\",\n className\n )}\n {...props}\n />\n))\nTabsTrigger.displayName = TabsPrimitive.Trigger.displayName\n\nconst TabsContent = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>\n>(({ className, ...props }, ref) => (\n <TabsPrimitive.Content\n ref={ref}\n className={cn(\n \"mt-4 font-['Inter'] text-[16px] not-italic font-medium leading-[24px] [color:var(--raw-black,#000)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#1D1C20] focus-visible:ring-offset-2\",\n className\n )}\n {...props}\n />\n))\nTabsContent.displayName = TabsPrimitive.Content.displayName\n\nexport { Tabs, TabsList, TabsTrigger, TabsContent }\n"],"names":["Tabs","TabsPrimitive","TabsList","React","className","props","ref","cn","TabsTrigger","TabsContent"],"mappings":"0cAKMA,EAAOC,EAAc,KAErBC,EAAWC,EAAM,WAGrB,CAAC,CAAE,UAAAC,EAAW,GAAGC,CAAA,EAASC,IAC1BH,EAAA,cAACF,EAAc,KAAd,CACC,IAAAK,EACA,UAAWC,EAAAA,GACT,0EACA,kHACAH,CAAA,EAED,GAAGC,CAAA,CACN,CACD,EACDH,EAAS,YAAcD,EAAc,KAAK,YAE1C,MAAMO,EAAcL,EAAM,WAGxB,CAAC,CAAE,UAAAC,EAAW,GAAGC,CAAA,EAASC,IAC1BH,EAAA,cAACF,EAAc,QAAd,CACC,IAAAK,EACA,UAAWC,EAAAA,GACT,mPACA,mBACA,sCACA,2GACA,6EACA,mIACAH,CAAA,EAED,GAAGC,CAAA,CACN,CACD,EACDG,EAAY,YAAcP,EAAc,QAAQ,YAEhD,MAAMQ,EAAcN,EAAM,WAGxB,CAAC,CAAE,UAAAC,EAAW,GAAGC,CAAA,EAASC,IAC1BH,EAAA,cAACF,EAAc,QAAd,CACC,IAAAK,EACA,UAAWC,EAAAA,GACT,+MACAH,CAAA,EAED,GAAGC,CAAA,CACN,CACD,EACDI,EAAY,YAAcR,EAAc,QAAQ"}
|