@brightlocal/ui-components 0.3.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/alert.d.ts +2 -2
- package/dist/alert.js +3 -3
- package/dist/blocks/sidebar.cjs +1 -1
- package/dist/blocks/sidebar.d.ts +2 -2
- package/dist/blocks/sidebar.js +0 -1
- package/dist/breadcrumb.js +3 -3
- package/dist/button.d.ts +1 -1
- package/dist/carousel.js +3 -3
- package/dist/centred-layout.cjs +1 -1
- package/dist/centred-layout.d.ts +1 -1
- package/dist/centred-layout.js +6 -6
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/combobox.d.ts +6 -6
- package/dist/combobox.d.ts.map +1 -1
- package/dist/combobox.js +13 -13
- package/dist/date-picker.js +4 -4
- package/dist/field.cjs +1 -1
- package/dist/field.d.ts +103 -10
- package/dist/field.d.ts.map +1 -1
- package/dist/field.js +118 -58
- package/dist/index.cjs +1 -1
- package/dist/index.js +351 -349
- package/dist/input-chip.cjs +1 -1
- package/dist/input-chip.js +1 -1
- package/dist/input-group.d.ts +1 -1
- package/dist/input-otp.js +3 -3
- package/dist/input-password.js +1 -1
- package/dist/label.cjs +1 -1
- package/dist/label.js +1 -1
- package/dist/link.cjs +1 -1
- package/dist/link.d.ts +5 -0
- package/dist/link.d.ts.map +1 -1
- package/dist/link.js +24 -23
- package/dist/pagination.d.ts +1 -1
- package/dist/pagination.js +3 -3
- package/dist/radio-group.d.ts +2 -2
- package/dist/resizable.d.ts +1 -1
- package/dist/select.cjs +1 -1
- package/dist/select.d.ts +19 -14
- package/dist/select.d.ts.map +1 -1
- package/dist/select.js +102 -133
- package/dist/sonner.js +1 -1
- package/dist/switch.d.ts +1 -1
- package/package.json +9 -9
- package/src/components/centred-layout.tsx +3 -3
- package/src/components/checkbox.tsx +1 -1
- package/src/components/field.tsx +187 -15
- package/src/components/label.tsx +1 -1
- package/src/components/link.tsx +7 -1
- package/src/components/select.tsx +22 -86
package/dist/alert.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
declare const alertVariants: (props?: ({
|
|
4
|
-
variant?: "
|
|
4
|
+
variant?: "info" | "default" | "success" | "destructive" | "warning" | null | undefined;
|
|
5
5
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
6
6
|
declare const Alert: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & VariantProps<(props?: ({
|
|
7
|
-
variant?: "
|
|
7
|
+
variant?: "info" | "default" | "success" | "destructive" | "warning" | null | undefined;
|
|
8
8
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string> & React.RefAttributes<HTMLDivElement>>;
|
|
9
9
|
declare const AlertTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
10
10
|
declare const AlertDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
package/dist/alert.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as e, jsxs as n } from "react/jsx-runtime";
|
|
2
2
|
import * as f from "react";
|
|
3
3
|
import { cva as m } from "class-variance-authority";
|
|
4
|
-
import {
|
|
4
|
+
import { CircleX as v, Info as k, CircleCheck as h, TriangleAlert as u } from "@brightlocal/icons";
|
|
5
5
|
import { cn as x } from "@brightlocal/ui-components/lib/utils";
|
|
6
6
|
const p = m(
|
|
7
7
|
"relative w-full rounded-lg px-4 py-3 text-sm flex gap-3 items-start [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:translate-y-0.5",
|
|
@@ -72,7 +72,7 @@ function A({
|
|
|
72
72
|
"data-tracking-label": s,
|
|
73
73
|
variant: "success",
|
|
74
74
|
children: [
|
|
75
|
-
/* @__PURE__ */ e(
|
|
75
|
+
/* @__PURE__ */ e(h, {}),
|
|
76
76
|
/* @__PURE__ */ n("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
|
|
77
77
|
a && /* @__PURE__ */ e(g, { children: a }),
|
|
78
78
|
/* @__PURE__ */ e(o, { children: t })
|
|
@@ -128,7 +128,7 @@ function C({
|
|
|
128
128
|
"data-tracking-label": s,
|
|
129
129
|
variant: "destructive",
|
|
130
130
|
children: [
|
|
131
|
-
/* @__PURE__ */ e(
|
|
131
|
+
/* @__PURE__ */ e(v, {}),
|
|
132
132
|
/* @__PURE__ */ n("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
|
|
133
133
|
a && /* @__PURE__ */ e(g, { children: a }),
|
|
134
134
|
/* @__PURE__ */ e(o, { children: t })
|
package/dist/blocks/sidebar.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),fe=require("react"),k=require("@radix-ui/react-slot"),R=require("class-variance-authority"),f=require("@brightlocal/icons"),d=require("@brightlocal/ui-components/lib/utils"),ge=require("../button.cjs"),me=require("../input.cjs"),he=require("../separator.cjs"),C=require("../sheet.cjs"),D=require("../skeleton.cjs"),M=require("../tooltip.cjs"),xe=require("../hooks/use-mobile.cjs");function ve(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return a.default=e,Object.freeze(a)}const i=ve(fe);var E=(e=>(e.LEFT="left",e))(E||{}),z=(e=>(e.SIDEBAR="sidebar",e))(z||{}),O=(e=>(e.OFFCANVAS="offcanvas",e.ICON="icon",e.NONE="none",e))(O||{}),A=(e=>(e.DEFAULT="default",e.SM="sm",e.XS="xs",e))(A||{}),T=(e=>(e.DEFAULT="default",e.COLLAPSIBLE="collapsible",e.ACTION="action",e))(T||{}),_=(e=>(e.SIMPLE="simple",e.COLLAPSIBLE="collapsible",e.DROPDOWN="dropdown",e.TREE="tree",e.BADGE="badge",e.BIG_ICON="bigIcon",e.CHECKBOX="checkbox",e))(_||{}),L=(e=>(e.DEFAULT="default",e.SM="sm",e.LG="lg",e))(L||{}),B=(e=>(e.DEFAULT="default",e.BORDER="border",e.INDENT="indent",e))(B||{}),P=(e=>(e.SM="sm",e.MD="md",e))(P||{}),q=(e=>(e.CARET="caret",e.HORIZONTAL="horizontal",e.VERTICAL="vertical",e.UP_DOWN="upDown",e.PLUS_MINUS="plusMinus",e.DOTS="dots",e))(q||{});const Se="sidebar:state",we=3600*24*7,ke="256px",Ne="288px",ye="48px",je="b",G=i.createContext(null);function N(){const e=i.useContext(G);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const F=i.forwardRef(({dataHook:e,trackingEl:a,trackingLabel:t,defaultOpen:o=!0,open:s,onOpenChange:n,className:l,style:c,children:g,...m},v)=>{const u=xe.useIsMobile(),[b,h]=i.useState(!1),[S,be]=i.useState(o),w=s??S,y=i.useCallback(p=>{const x=typeof p=="function"?p(w):p;n?n(x):be(x),document.cookie=`${Se}=${x}; path=/; max-age=${we}`},[n,w]),j=i.useCallback(()=>u?h(p=>!p):y(p=>!p),[u,y,h]);i.useEffect(()=>{const p=x=>{x.key===je&&(x.metaKey||x.ctrlKey)&&(x.preventDefault(),j())};return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[j]);const I=w?"expanded":"collapsed",pe=i.useMemo(()=>({state:I,open:w,setOpen:y,isMobile:u,openMobile:b,setOpenMobile:h,toggleSidebar:j}),[I,w,y,u,b,h,j]);return r.jsx(G.Provider,{value:pe,children:r.jsx(M.TooltipProvider,{delayDuration:0,children:r.jsx("div",{ref:v,className:d.cn("group/sidebar-wrapper flex min-h-svh w-full",l),"data-hook":e,"data-slot":"sidebar-provider","data-tracking-el":a||"sidebar-provider","data-tracking-label":t,style:{"--sidebar-width":ke,"--sidebar-width-icon":ye,...c},...m,children:g})})})});F.displayName="SidebarProvider";const H=i.forwardRef(({dataHook:e,trackingEl:a,trackingLabel:t,side:o="left",variant:s="sidebar",collapsible:n="offcanvas",className:l,children:c,...g},m)=>{const{isMobile:v,state:u,openMobile:b,setOpenMobile:h}=N();return n==="none"?r.jsx("div",{ref:m,className:d.cn("bg-sidebar text-sidebar-foreground flex h-full w-[var(--sidebar-width)] flex-col",l),"data-hook":e,"data-slot":"sidebar","data-tracking-el":a||"sidebar","data-tracking-label":t,...g,children:c}):v?r.jsx(C.Sheet,{open:b,onOpenChange:h,children:r.jsx(C.SheetContent,{className:"bg-sidebar text-sidebar-foreground w-[var(--sidebar-width)] p-0 [&>button]:hidden","data-hook":`${e}-mobile-content`,"data-mobile":"true","data-sidebar":"sidebar",side:"left",style:{"--sidebar-width":Ne},children:r.jsx("div",{className:"flex h-full w-full flex-col",children:c})})}):r.jsxs("div",{ref:m,className:"group peer text-sidebar-foreground hidden md:block","data-collapsible":u==="collapsed"?n:"","data-hook":e,"data-side":o,"data-slot":"sidebar","data-state":u,"data-tracking-el":a||"sidebar","data-tracking-label":t,"data-variant":s,children:[r.jsx("div",{className:d.cn("relative h-svh w-[var(--sidebar-width)] bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[collapsible=icon]:w-[var(--sidebar-width-icon)]")}),r.jsx("div",{className:d.cn("fixed inset-y-0 z-10 hidden h-svh w-[var(--sidebar-width)] transition-[left,right,width] duration-200 ease-linear md:flex","left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]","group-data-[collapsible=icon]:w-[var(--sidebar-width-icon)]",l),...g,children:r.jsx("div",{className:"bg-sidebar flex h-full w-full flex-col","data-sidebar":"sidebar",children:c})})]})});H.displayName="Sidebar";const K=i.forwardRef(({className:e,onClick:a,dataHook:t="sidebar-trigger",...o},s)=>{const{toggleSidebar:n}=N();return r.jsxs(ge.Button,{ref:s,"aria-label":"Toggle Sidebar",className:d.cn("h-7 w-7",e),"data-slot":"sidebar-trigger",dataHook:t,size:"sm",variant:"ghost",onClick:l=>{a?.(l),n()},...o,children:[r.jsx(f.PanelLeft,{}),r.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});K.displayName="SidebarTrigger";const U=i.forwardRef(({className:e,...a},t)=>{const{toggleSidebar:o}=N();return r.jsx("button",{ref:t,"aria-label":"Toggle Sidebar",className:d.cn("hover:after:bg-sidebar-border absolute inset-y-0 -right-4 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] sm:flex","cursor-w-resize","[[data-state=collapsed]_&]:cursor-e-resize","group-data-[collapsible=offcanvas]:hover:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full","[[data-collapsible=offcanvas]_&]:-right-2",e),"data-slot":"sidebar-rail",tabIndex:-1,title:"Toggle Sidebar",onClick:o,...a})});U.displayName="SidebarRail";const W=i.forwardRef(({className:e,dataHook:a,trackingEl:t,trackingLabel:o,...s},n)=>r.jsx("main",{ref:n,className:d.cn("bg-background relative flex min-h-svh flex-1 flex-col",e),"data-hook":a,"data-slot":"sidebar-inset","data-tracking-el":t||"sidebar-inset","data-tracking-label":o,...s}));W.displayName="SidebarInset";const V=i.forwardRef(({className:e,...a},t)=>r.jsx(me.Input,{ref:t,className:d.cn("bg-background focus-visible:ring-sidebar-ring h-8 w-full shadow-none focus-visible:ring-2",e),"data-slot":"sidebar-input",dataHook:"sidebar-input",...a}));V.displayName="SidebarInput";const X=i.forwardRef(({className:e,dataHook:a,...t},o)=>r.jsx("div",{ref:o,className:d.cn("flex flex-col gap-2 p-2",e),"data-hook":a,"data-slot":"sidebar-header",...t}));X.displayName="SidebarHeader";const Y=i.forwardRef(({className:e,dataHook:a,...t},o)=>r.jsx("div",{ref:o,className:d.cn("flex flex-col gap-2 p-2",e),"data-hook":a,"data-slot":"sidebar-footer",...t}));Y.displayName="SidebarFooter";const Z=i.forwardRef(({className:e,...a},t)=>r.jsx(he.Separator,{ref:t,className:d.cn("bg-sidebar-border mx-2 w-auto group-data-[collapsible=icon]:mx-0",e),"data-slot":"sidebar-separator",...a}));Z.displayName="SidebarSeparator";const J=i.forwardRef(({className:e,dataHook:a,...t},o)=>r.jsx("div",{ref:o,className:d.cn("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),"data-hook":a,"data-slot":"sidebar-content",...t}));J.displayName="SidebarContent";const Q=i.forwardRef(({className:e,dataHook:a,...t},o)=>r.jsx("div",{ref:o,className:d.cn("relative flex w-full min-w-0 flex-col p-2",e),"data-hook":a,"data-slot":"sidebar-group",...t}));Q.displayName="SidebarGroup";const Me=R.cva("flex h-8 shrink-0 items-center rounded-md px-2 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",{variants:{size:{default:"text-sm",sm:"text-sm",xs:"text-xs"},variant:{default:"",collapsible:"w-full justify-between cursor-pointer hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",action:"w-full justify-between cursor-pointer hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"}},defaultVariants:{size:"sm",variant:"default"}}),$=i.forwardRef(({className:e,dataHook:a,asChild:t=!1,size:o="sm",variant:s="default",isOpen:n=!1,onToggle:l,onAction:c,children:g,...m},v)=>{const u=t?k.Slot:"div",b=()=>{s==="collapsible"&&l?l():s==="action"&&c&&c()},h=S=>{(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),b())};return r.jsxs(u,{ref:v,className:d.cn(Me({size:o,variant:s}),e),"data-hook":a,"data-slot":"sidebar-group-label","data-variant":s,role:s!=="default"?"button":void 0,tabIndex:s!=="default"?0:void 0,onClick:s!=="default"?b:void 0,onKeyDown:s!=="default"?h:void 0,...m,children:[r.jsx("span",{children:g}),s==="collapsible"&&r.jsx(f.ChevronDown,{className:d.cn("size-4 shrink-0 transition-transform duration-200",n&&"rotate-180")}),s==="action"&&r.jsx(f.Plus,{className:"size-4 shrink-0"})]})});$.displayName="SidebarGroupLabel";const ee=i.forwardRef(({className:e,asChild:a=!1,...t},o)=>{const s=a?k.Slot:"button";return r.jsx(s,{ref:o,className:d.cn("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 transition-transform outline-none focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",e),"data-slot":"sidebar-group-action",...t})});ee.displayName="SidebarGroupAction";const ae=i.forwardRef(({className:e,dataHook:a,...t},o)=>r.jsx("div",{ref:o,className:d.cn("w-full text-sm",e),"data-hook":a,"data-slot":"sidebar-group-content",...t}));ae.displayName="SidebarGroupContent";const te=i.forwardRef(({className:e,dataHook:a,...t},o)=>r.jsx("ul",{ref:o,className:d.cn("flex w-full min-w-0 flex-col gap-1",e),"data-hook":a,"data-slot":"sidebar-menu",...t}));te.displayName="SidebarMenu";const re=i.forwardRef(({className:e,dataHook:a,...t},o)=>r.jsx("li",{ref:o,className:d.cn("group/menu-item relative",e),"data-hook":a,"data-slot":"sidebar-menu-item",...t}));re.displayName="SidebarMenuItem";const oe=i.forwardRef(({type:e="caret",isActive:a=!1,className:t,...o},s)=>{const n={ref:s,className:d.cn("size-4 shrink-0 transition-transform",a&&e==="caret"&&"rotate-90",t),"data-slot":"sidebar-collapse-icon",...o};switch(e){case"horizontal":return r.jsx(f.ChevronRight,{...n});case"vertical":return r.jsx(f.ChevronDown,{...n});case"upDown":return r.jsx(f.ChevronsUpDown,{...n});case"plusMinus":return a?r.jsx(f.Minus,{...n}):r.jsx(f.Plus,{...n});case"dots":return r.jsx(f.Ellipsis,{...n});case"caret":default:return r.jsx(f.ChevronRight,{...n})}});oe.displayName="SidebarCollapseIcon";const Re=R.cva("peer/menu-button flex w-full items-center gap-3 overflow-hidden rounded-full px-6 py-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 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 group-data-[collapsible=icon]:rounded-md [&>span:last-child]:truncate [&>svg]:size-4.5 [&>svg]:shrink-0 [&>svg]:stroke-2 [&>svg]:opacity-70 data-[active=true]:[&>svg]:opacity-100 group-data-[collapsible=icon]:[&>span]:hidden group-data-[collapsible=icon]:[&>div]:hidden",{variants:{variant:{simple:"",collapsible:"[&>[data-collapse-icon]]:ml-auto [&>[data-collapse-icon]]:transition-transform data-[state=open]:[&>[data-collapse-icon]]:rotate-90",dropdown:"group-has-[[data-sidebar=menu-action]]/menu-item:pr-8",tree:"[&>[data-tree-icon]]:size-4 [&>[data-tree-icon]]:shrink-0 [&>[data-tree-icon]]:opacity-70 [&>[data-tree-icon]]:transition-transform data-[state=open]:[&>[data-tree-icon]]:rotate-90 group-data-[collapsible=icon]:[&>[data-tree-icon]]:hidden",badge:"group-has-[[data-sidebar=menu-badge]]/menu-item:pr-8",bigIcon:"h-auto flex-col items-start gap-1 rounded-lg p-3 [&>svg]:size-6 [&>svg]:rounded-md [&>svg]:bg-sidebar-foreground [&>svg]:p-1 [&>svg]:text-sidebar [&>svg]:opacity-100 hover:[&>svg]:bg-sidebar-foreground hover:[&>svg]:text-sidebar group-data-[collapsible=icon]:!size-10 group-data-[collapsible=icon]:!p-2 group-data-[collapsible=icon]:items-center group-data-[collapsible=icon]:[&>svg]:size-6",checkbox:"[&>[data-checkbox]]:size-4 [&>[data-checkbox]]:shrink-0 [&>[data-checkbox]]:rounded [&>[data-checkbox]]:border [&>[data-checkbox]]:border-sidebar-foreground/30 data-[checked=true]:[&>[data-checkbox]]:bg-primary data-[checked=true]:[&>[data-checkbox]]:border-primary data-[checked=true]:[&>[data-checkbox]]:text-primary-foreground"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"simple",size:"default"}}),se=i.forwardRef(({asChild:e=!1,isActive:a=!1,variant:t="simple",size:o="default",tooltip:s,className:n,dataHook:l,...c},g)=>{const m=e?k.Slot:"button",{isMobile:v,state:u}=N(),b=r.jsx(m,{ref:g,className:d.cn(Re({variant:t,size:o}),n),"data-active":a,"data-hook":l,"data-size":o,"data-slot":"sidebar-menu-button","data-variant":t,...c});return s?(typeof s=="string"&&(s={children:s,dataHook:"sidebar-menu-button-tooltip"}),r.jsxs(M.Tooltip,{children:[r.jsx(M.TooltipTrigger,{asChild:!0,children:b}),r.jsx(M.TooltipContent,{hideArrow:!0,...s,align:"center",className:d.cn("bg-foreground text-background border-none",s.className),hidden:u!=="collapsed"||v,side:"right",sideOffset:8})]})):b});se.displayName="SidebarMenuButton";const ie=i.forwardRef(({className:e,asChild:a=!1,showOnHover:t=!1,...o},s)=>{const n=a?k.Slot:"button";return r.jsx(n,{ref:s,className:d.cn("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 transition-transform outline-none focus-visible:ring-2 [&>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","peer-data-[size=bigIcon]/menu-button:top-2.5","peer-data-[size=tree]/menu-button:top-1.5","group-data-[collapsible=icon]:hidden",t&&"peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0",e),"data-slot":"sidebar-menu-action",...o})});ie.displayName="SidebarMenuAction";const ne=i.forwardRef(({className:e,...a},t)=>r.jsx("div",{ref:t,className:d.cn("text-sidebar-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums select-none","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","peer-data-[size=bigIcon]/menu-button:top-2.5","peer-data-[size=tree]/menu-button:top-1.5","group-data-[collapsible=icon]:hidden",e),"data-slot":"sidebar-menu-badge",...a}));ne.displayName="SidebarMenuBadge";const de=i.forwardRef(({className:e,showIcon:a=!1,...t},o)=>{const s=i.useId(),n=i.useMemo(()=>{let l=0;for(let c=0;c<s.length;c++)l=(l<<5)-l+s.charCodeAt(c),l|=0;return`${Math.abs(l)%40+50}%`},[s]);return r.jsxs("div",{ref:o,className:d.cn("flex h-8 items-center gap-2 rounded-md px-2",e),"data-slot":"sidebar-menu-skeleton",...t,children:[a&&r.jsx(D.Skeleton,{className:"size-4 rounded-md","data-slot":"sidebar-menu-skeleton-icon"}),r.jsx(D.Skeleton,{className:"h-4 max-w-[--skeleton-width] flex-1","data-slot":"sidebar-menu-skeleton-text",style:{"--skeleton-width":n}})]})});de.displayName="SidebarMenuSkeleton";const Ie=R.cva("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 px-2.5 py-0.5 group-data-[collapsible=icon]:hidden",{variants:{variant:{default:"",border:"border-l border-sidebar-border",indent:"ml-0 border-l-0"}},defaultVariants:{variant:"border"}}),le=i.forwardRef(({className:e,variant:a="border",dataHook:t,...o},s)=>r.jsx("ul",{ref:s,className:d.cn(Ie({variant:a}),e),"data-hook":t,"data-slot":"sidebar-menu-sub",...o}));le.displayName="SidebarMenuSub";const ce=i.forwardRef(({dataHook:e,...a},t)=>r.jsx("li",{ref:t,"data-hook":e,"data-slot":"sidebar-menu-sub-item",...a}));ce.displayName="SidebarMenuSubItem";const ue=i.forwardRef(({asChild:e=!1,size:a="md",isActive:t,className:o,dataHook:s,...n},l)=>{const c=e?k.Slot:"a";return r.jsx(c,{ref:l,className:d.cn("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-none focus-visible:ring-2 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","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",a==="sm"&&"text-xs",a==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",o),"data-active":t,"data-hook":s,"data-size":a,"data-slot":"sidebar-menu-sub-button",...n})});ue.displayName="SidebarMenuSubButton";exports.Sidebar=H;exports.SidebarCollapseIcon=oe;exports.SidebarCollapseIconType=q;exports.SidebarCollapsible=O;exports.SidebarContent=J;exports.SidebarFooter=Y;exports.SidebarGroup=Q;exports.SidebarGroupAction=ee;exports.SidebarGroupContent=ae;exports.SidebarGroupLabel=$;exports.SidebarGroupLabelSize=A;exports.SidebarGroupLabelVariant=T;exports.SidebarHeader=X;exports.SidebarInput=V;exports.SidebarInset=W;exports.SidebarMenu=te;exports.SidebarMenuAction=ie;exports.SidebarMenuBadge=ne;exports.SidebarMenuButton=se;exports.SidebarMenuButtonSize=L;exports.SidebarMenuButtonVariant=_;exports.SidebarMenuItem=re;exports.SidebarMenuSkeleton=de;exports.SidebarMenuSub=le;exports.SidebarMenuSubButton=ue;exports.SidebarMenuSubButtonSize=P;exports.SidebarMenuSubItem=ce;exports.SidebarMenuSubVariant=B;exports.SidebarProvider=F;exports.SidebarRail=U;exports.SidebarSeparator=Z;exports.SidebarSide=E;exports.SidebarTrigger=K;exports.SidebarVariant=z;exports.useSidebar=N;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),fe=require("react"),k=require("@radix-ui/react-slot"),R=require("class-variance-authority"),f=require("@brightlocal/icons"),d=require("@brightlocal/ui-components/lib/utils"),ge=require("../button.cjs"),me=require("../input.cjs"),he=require("../separator.cjs"),C=require("../sheet.cjs"),D=require("../skeleton.cjs"),M=require("../tooltip.cjs"),xe=require("../hooks/use-mobile.cjs");function ve(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return a.default=e,Object.freeze(a)}const i=ve(fe);var E=(e=>(e.LEFT="left",e))(E||{}),z=(e=>(e.SIDEBAR="sidebar",e))(z||{}),O=(e=>(e.OFFCANVAS="offcanvas",e.ICON="icon",e.NONE="none",e))(O||{}),A=(e=>(e.DEFAULT="default",e.SM="sm",e.XS="xs",e))(A||{}),T=(e=>(e.DEFAULT="default",e.COLLAPSIBLE="collapsible",e.ACTION="action",e))(T||{}),_=(e=>(e.SIMPLE="simple",e.COLLAPSIBLE="collapsible",e.DROPDOWN="dropdown",e.TREE="tree",e.BADGE="badge",e.BIG_ICON="bigIcon",e.CHECKBOX="checkbox",e))(_||{}),L=(e=>(e.DEFAULT="default",e.SM="sm",e.LG="lg",e))(L||{}),B=(e=>(e.DEFAULT="default",e.BORDER="border",e.INDENT="indent",e))(B||{}),P=(e=>(e.SM="sm",e.MD="md",e))(P||{}),q=(e=>(e.CARET="caret",e.HORIZONTAL="horizontal",e.VERTICAL="vertical",e.UP_DOWN="upDown",e.PLUS_MINUS="plusMinus",e.DOTS="dots",e))(q||{});const Se="sidebar:state",we=3600*24*7,ke="256px",Ne="288px",ye="48px",je="b",G=i.createContext(null);function N(){const e=i.useContext(G);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const F=i.forwardRef(({dataHook:e,trackingEl:a,trackingLabel:t,defaultOpen:o=!0,open:s,onOpenChange:n,className:l,style:c,children:g,...m},v)=>{const u=xe.useIsMobile(),[b,h]=i.useState(!1),[S,be]=i.useState(o),w=s??S,y=i.useCallback(p=>{const x=typeof p=="function"?p(w):p;n?n(x):be(x),document.cookie=`${Se}=${x}; path=/; max-age=${we}`},[n,w]),j=i.useCallback(()=>u?h(p=>!p):y(p=>!p),[u,y,h]);i.useEffect(()=>{const p=x=>{x.key===je&&(x.metaKey||x.ctrlKey)&&(x.preventDefault(),j())};return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[j]);const I=w?"expanded":"collapsed",pe=i.useMemo(()=>({state:I,open:w,setOpen:y,isMobile:u,openMobile:b,setOpenMobile:h,toggleSidebar:j}),[I,w,y,u,b,h,j]);return r.jsx(G.Provider,{value:pe,children:r.jsx(M.TooltipProvider,{delayDuration:0,children:r.jsx("div",{ref:v,className:d.cn("group/sidebar-wrapper flex min-h-svh w-full",l),"data-hook":e,"data-slot":"sidebar-provider","data-tracking-el":a||"sidebar-provider","data-tracking-label":t,style:{"--sidebar-width":ke,"--sidebar-width-icon":ye,...c},...m,children:g})})})});F.displayName="SidebarProvider";const H=i.forwardRef(({dataHook:e,trackingEl:a,trackingLabel:t,side:o="left",variant:s="sidebar",collapsible:n="offcanvas",className:l,children:c,...g},m)=>{const{isMobile:v,state:u,openMobile:b,setOpenMobile:h}=N();return n==="none"?r.jsx("div",{ref:m,className:d.cn("bg-sidebar text-sidebar-foreground flex h-full w-[var(--sidebar-width)] flex-col",l),"data-hook":e,"data-slot":"sidebar","data-tracking-el":a||"sidebar","data-tracking-label":t,...g,children:c}):v?r.jsx(C.Sheet,{open:b,onOpenChange:h,children:r.jsx(C.SheetContent,{className:"bg-sidebar text-sidebar-foreground w-[var(--sidebar-width)] p-0 [&>button]:hidden","data-hook":`${e}-mobile-content`,"data-mobile":"true","data-sidebar":"sidebar",side:"left",style:{"--sidebar-width":Ne},children:r.jsx("div",{className:"flex h-full w-full flex-col",children:c})})}):r.jsxs("div",{ref:m,className:"group peer text-sidebar-foreground hidden md:block","data-collapsible":u==="collapsed"?n:"","data-hook":e,"data-side":o,"data-slot":"sidebar","data-state":u,"data-tracking-el":a||"sidebar","data-tracking-label":t,"data-variant":s,children:[r.jsx("div",{className:d.cn("relative h-svh w-[var(--sidebar-width)] bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[collapsible=icon]:w-[var(--sidebar-width-icon)]")}),r.jsx("div",{className:d.cn("fixed inset-y-0 z-10 hidden h-svh w-[var(--sidebar-width)] transition-[left,right,width] duration-200 ease-linear md:flex","left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]","group-data-[collapsible=icon]:w-[var(--sidebar-width-icon)]",l),...g,children:r.jsx("div",{className:"bg-sidebar flex h-full w-full flex-col","data-sidebar":"sidebar",children:c})})]})});H.displayName="Sidebar";const K=i.forwardRef(({className:e,onClick:a,dataHook:t="sidebar-trigger",...o},s)=>{const{toggleSidebar:n}=N();return r.jsxs(ge.Button,{ref:s,"aria-label":"Toggle Sidebar",className:d.cn("h-7 w-7",e),"data-slot":"sidebar-trigger",dataHook:t,size:"sm",variant:"ghost",onClick:l=>{a?.(l),n()},...o,children:[r.jsx(f.PanelLeft,{}),r.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});K.displayName="SidebarTrigger";const U=i.forwardRef(({className:e,...a},t)=>{const{toggleSidebar:o}=N();return r.jsx("button",{ref:t,"aria-label":"Toggle Sidebar",className:d.cn("hover:after:bg-sidebar-border absolute inset-y-0 -right-4 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] sm:flex","cursor-w-resize","[[data-state=collapsed]_&]:cursor-e-resize","group-data-[collapsible=offcanvas]:hover:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full","[[data-collapsible=offcanvas]_&]:-right-2",e),"data-slot":"sidebar-rail",tabIndex:-1,title:"Toggle Sidebar",onClick:o,...a})});U.displayName="SidebarRail";const W=i.forwardRef(({className:e,dataHook:a,trackingEl:t,trackingLabel:o,...s},n)=>r.jsx("main",{ref:n,className:d.cn("bg-background relative flex min-h-svh flex-1 flex-col",e),"data-hook":a,"data-slot":"sidebar-inset","data-tracking-el":t||"sidebar-inset","data-tracking-label":o,...s}));W.displayName="SidebarInset";const V=i.forwardRef(({className:e,...a},t)=>r.jsx(me.Input,{ref:t,className:d.cn("bg-background focus-visible:ring-sidebar-ring h-8 w-full shadow-none focus-visible:ring-2",e),"data-slot":"sidebar-input",dataHook:"sidebar-input",...a}));V.displayName="SidebarInput";const X=i.forwardRef(({className:e,dataHook:a,...t},o)=>r.jsx("div",{ref:o,className:d.cn("flex flex-col gap-2 p-2",e),"data-hook":a,"data-slot":"sidebar-header",...t}));X.displayName="SidebarHeader";const Y=i.forwardRef(({className:e,dataHook:a,...t},o)=>r.jsx("div",{ref:o,className:d.cn("flex flex-col gap-2 p-2",e),"data-hook":a,"data-slot":"sidebar-footer",...t}));Y.displayName="SidebarFooter";const Z=i.forwardRef(({className:e,...a},t)=>r.jsx(he.Separator,{ref:t,className:d.cn("bg-sidebar-border mx-2 w-auto group-data-[collapsible=icon]:mx-0",e),"data-slot":"sidebar-separator",...a}));Z.displayName="SidebarSeparator";const J=i.forwardRef(({className:e,dataHook:a,...t},o)=>r.jsx("div",{ref:o,className:d.cn("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),"data-hook":a,"data-slot":"sidebar-content",...t}));J.displayName="SidebarContent";const Q=i.forwardRef(({className:e,dataHook:a,...t},o)=>r.jsx("div",{ref:o,className:d.cn("relative flex w-full min-w-0 flex-col p-2",e),"data-hook":a,"data-slot":"sidebar-group",...t}));Q.displayName="SidebarGroup";const Me=R.cva("flex h-8 shrink-0 items-center rounded-md px-2 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",{variants:{size:{default:"text-sm",sm:"text-sm",xs:"text-xs"},variant:{default:"",collapsible:"w-full justify-between cursor-pointer hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",action:"w-full justify-between cursor-pointer hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"}},defaultVariants:{size:"sm",variant:"default"}}),$=i.forwardRef(({className:e,dataHook:a,asChild:t=!1,size:o="sm",variant:s="default",isOpen:n=!1,onToggle:l,onAction:c,children:g,...m},v)=>{const u=t?k.Slot:"div",b=()=>{s==="collapsible"&&l?l():s==="action"&&c&&c()},h=S=>{(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),b())};return r.jsxs(u,{ref:v,className:d.cn(Me({size:o,variant:s}),e),"data-hook":a,"data-slot":"sidebar-group-label","data-variant":s,role:s!=="default"?"button":void 0,tabIndex:s!=="default"?0:void 0,onClick:s!=="default"?b:void 0,onKeyDown:s!=="default"?h:void 0,...m,children:[r.jsx("span",{children:g}),s==="collapsible"&&r.jsx(f.ChevronDown,{className:d.cn("size-4 shrink-0 transition-transform duration-200",n&&"rotate-180")}),s==="action"&&r.jsx(f.Plus,{className:"size-4 shrink-0"})]})});$.displayName="SidebarGroupLabel";const ee=i.forwardRef(({className:e,asChild:a=!1,...t},o)=>{const s=a?k.Slot:"button";return r.jsx(s,{ref:o,className:d.cn("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 transition-transform outline-none focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",e),"data-slot":"sidebar-group-action",...t})});ee.displayName="SidebarGroupAction";const ae=i.forwardRef(({className:e,dataHook:a,...t},o)=>r.jsx("div",{ref:o,className:d.cn("w-full text-sm",e),"data-hook":a,"data-slot":"sidebar-group-content",...t}));ae.displayName="SidebarGroupContent";const te=i.forwardRef(({className:e,dataHook:a,...t},o)=>r.jsx("ul",{ref:o,className:d.cn("flex w-full min-w-0 flex-col gap-1",e),"data-hook":a,"data-slot":"sidebar-menu",...t}));te.displayName="SidebarMenu";const re=i.forwardRef(({className:e,dataHook:a,...t},o)=>r.jsx("li",{ref:o,className:d.cn("group/menu-item relative",e),"data-hook":a,"data-slot":"sidebar-menu-item",...t}));re.displayName="SidebarMenuItem";const oe=i.forwardRef(({type:e="caret",isActive:a=!1,className:t,...o},s)=>{const n={ref:s,className:d.cn("size-4 shrink-0 transition-transform",a&&e==="caret"&&"rotate-90",t),"data-slot":"sidebar-collapse-icon",...o};switch(e){case"horizontal":return r.jsx(f.ChevronRight,{...n});case"vertical":return r.jsx(f.ChevronDown,{...n});case"upDown":return r.jsx(f.ChevronsUpDown,{...n});case"plusMinus":return a?r.jsx(f.Minus,{...n}):r.jsx(f.Plus,{...n});case"dots":return r.jsx(f.Ellipsis,{...n});default:return r.jsx(f.ChevronRight,{...n})}});oe.displayName="SidebarCollapseIcon";const Re=R.cva("peer/menu-button flex w-full items-center gap-3 overflow-hidden rounded-full px-6 py-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 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 group-data-[collapsible=icon]:rounded-md [&>span:last-child]:truncate [&>svg]:size-4.5 [&>svg]:shrink-0 [&>svg]:stroke-2 [&>svg]:opacity-70 data-[active=true]:[&>svg]:opacity-100 group-data-[collapsible=icon]:[&>span]:hidden group-data-[collapsible=icon]:[&>div]:hidden",{variants:{variant:{simple:"",collapsible:"[&>[data-collapse-icon]]:ml-auto [&>[data-collapse-icon]]:transition-transform data-[state=open]:[&>[data-collapse-icon]]:rotate-90",dropdown:"group-has-[[data-sidebar=menu-action]]/menu-item:pr-8",tree:"[&>[data-tree-icon]]:size-4 [&>[data-tree-icon]]:shrink-0 [&>[data-tree-icon]]:opacity-70 [&>[data-tree-icon]]:transition-transform data-[state=open]:[&>[data-tree-icon]]:rotate-90 group-data-[collapsible=icon]:[&>[data-tree-icon]]:hidden",badge:"group-has-[[data-sidebar=menu-badge]]/menu-item:pr-8",bigIcon:"h-auto flex-col items-start gap-1 rounded-lg p-3 [&>svg]:size-6 [&>svg]:rounded-md [&>svg]:bg-sidebar-foreground [&>svg]:p-1 [&>svg]:text-sidebar [&>svg]:opacity-100 hover:[&>svg]:bg-sidebar-foreground hover:[&>svg]:text-sidebar group-data-[collapsible=icon]:!size-10 group-data-[collapsible=icon]:!p-2 group-data-[collapsible=icon]:items-center group-data-[collapsible=icon]:[&>svg]:size-6",checkbox:"[&>[data-checkbox]]:size-4 [&>[data-checkbox]]:shrink-0 [&>[data-checkbox]]:rounded [&>[data-checkbox]]:border [&>[data-checkbox]]:border-sidebar-foreground/30 data-[checked=true]:[&>[data-checkbox]]:bg-primary data-[checked=true]:[&>[data-checkbox]]:border-primary data-[checked=true]:[&>[data-checkbox]]:text-primary-foreground"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"simple",size:"default"}}),se=i.forwardRef(({asChild:e=!1,isActive:a=!1,variant:t="simple",size:o="default",tooltip:s,className:n,dataHook:l,...c},g)=>{const m=e?k.Slot:"button",{isMobile:v,state:u}=N(),b=r.jsx(m,{ref:g,className:d.cn(Re({variant:t,size:o}),n),"data-active":a,"data-hook":l,"data-size":o,"data-slot":"sidebar-menu-button","data-variant":t,...c});return s?(typeof s=="string"&&(s={children:s,dataHook:"sidebar-menu-button-tooltip"}),r.jsxs(M.Tooltip,{children:[r.jsx(M.TooltipTrigger,{asChild:!0,children:b}),r.jsx(M.TooltipContent,{hideArrow:!0,...s,align:"center",className:d.cn("bg-foreground text-background border-none",s.className),hidden:u!=="collapsed"||v,side:"right",sideOffset:8})]})):b});se.displayName="SidebarMenuButton";const ie=i.forwardRef(({className:e,asChild:a=!1,showOnHover:t=!1,...o},s)=>{const n=a?k.Slot:"button";return r.jsx(n,{ref:s,className:d.cn("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 transition-transform outline-none focus-visible:ring-2 [&>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","peer-data-[size=bigIcon]/menu-button:top-2.5","peer-data-[size=tree]/menu-button:top-1.5","group-data-[collapsible=icon]:hidden",t&&"peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0",e),"data-slot":"sidebar-menu-action",...o})});ie.displayName="SidebarMenuAction";const ne=i.forwardRef(({className:e,...a},t)=>r.jsx("div",{ref:t,className:d.cn("text-sidebar-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums select-none","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","peer-data-[size=bigIcon]/menu-button:top-2.5","peer-data-[size=tree]/menu-button:top-1.5","group-data-[collapsible=icon]:hidden",e),"data-slot":"sidebar-menu-badge",...a}));ne.displayName="SidebarMenuBadge";const de=i.forwardRef(({className:e,showIcon:a=!1,...t},o)=>{const s=i.useId(),n=i.useMemo(()=>{let l=0;for(let c=0;c<s.length;c++)l=(l<<5)-l+s.charCodeAt(c),l|=0;return`${Math.abs(l)%40+50}%`},[s]);return r.jsxs("div",{ref:o,className:d.cn("flex h-8 items-center gap-2 rounded-md px-2",e),"data-slot":"sidebar-menu-skeleton",...t,children:[a&&r.jsx(D.Skeleton,{className:"size-4 rounded-md","data-slot":"sidebar-menu-skeleton-icon"}),r.jsx(D.Skeleton,{className:"h-4 max-w-[--skeleton-width] flex-1","data-slot":"sidebar-menu-skeleton-text",style:{"--skeleton-width":n}})]})});de.displayName="SidebarMenuSkeleton";const Ie=R.cva("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 px-2.5 py-0.5 group-data-[collapsible=icon]:hidden",{variants:{variant:{default:"",border:"border-l border-sidebar-border",indent:"ml-0 border-l-0"}},defaultVariants:{variant:"border"}}),le=i.forwardRef(({className:e,variant:a="border",dataHook:t,...o},s)=>r.jsx("ul",{ref:s,className:d.cn(Ie({variant:a}),e),"data-hook":t,"data-slot":"sidebar-menu-sub",...o}));le.displayName="SidebarMenuSub";const ce=i.forwardRef(({dataHook:e,...a},t)=>r.jsx("li",{ref:t,"data-hook":e,"data-slot":"sidebar-menu-sub-item",...a}));ce.displayName="SidebarMenuSubItem";const ue=i.forwardRef(({asChild:e=!1,size:a="md",isActive:t,className:o,dataHook:s,...n},l)=>{const c=e?k.Slot:"a";return r.jsx(c,{ref:l,className:d.cn("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-none focus-visible:ring-2 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","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",a==="sm"&&"text-xs",a==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",o),"data-active":t,"data-hook":s,"data-size":a,"data-slot":"sidebar-menu-sub-button",...n})});ue.displayName="SidebarMenuSubButton";exports.Sidebar=H;exports.SidebarCollapseIcon=oe;exports.SidebarCollapseIconType=q;exports.SidebarCollapsible=O;exports.SidebarContent=J;exports.SidebarFooter=Y;exports.SidebarGroup=Q;exports.SidebarGroupAction=ee;exports.SidebarGroupContent=ae;exports.SidebarGroupLabel=$;exports.SidebarGroupLabelSize=A;exports.SidebarGroupLabelVariant=T;exports.SidebarHeader=X;exports.SidebarInput=V;exports.SidebarInset=W;exports.SidebarMenu=te;exports.SidebarMenuAction=ie;exports.SidebarMenuBadge=ne;exports.SidebarMenuButton=se;exports.SidebarMenuButtonSize=L;exports.SidebarMenuButtonVariant=_;exports.SidebarMenuItem=re;exports.SidebarMenuSkeleton=de;exports.SidebarMenuSub=le;exports.SidebarMenuSubButton=ue;exports.SidebarMenuSubButtonSize=P;exports.SidebarMenuSubItem=ce;exports.SidebarMenuSubVariant=B;exports.SidebarProvider=F;exports.SidebarRail=U;exports.SidebarSeparator=Z;exports.SidebarSide=E;exports.SidebarTrigger=K;exports.SidebarVariant=z;exports.useSidebar=N;
|
package/dist/blocks/sidebar.d.ts
CHANGED
|
@@ -363,7 +363,7 @@ interface SidebarCollapseIconProps extends React.ComponentProps<"svg"> {
|
|
|
363
363
|
}
|
|
364
364
|
declare const SidebarCollapseIcon: React.ForwardRefExoticComponent<Omit<SidebarCollapseIconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
365
365
|
declare const sidebarMenuButtonVariants: (props?: ({
|
|
366
|
-
variant?: "
|
|
366
|
+
variant?: "checkbox" | "tree" | "badge" | "collapsible" | "dropdown" | "simple" | "bigIcon" | null | undefined;
|
|
367
367
|
size?: "default" | "sm" | "lg" | null | undefined;
|
|
368
368
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
369
369
|
/**
|
|
@@ -426,7 +426,7 @@ interface SidebarMenuSkeletonProps extends React.ComponentProps<"div"> {
|
|
|
426
426
|
}
|
|
427
427
|
declare const SidebarMenuSkeleton: React.ForwardRefExoticComponent<Omit<SidebarMenuSkeletonProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
428
428
|
declare const sidebarMenuSubVariants: (props?: ({
|
|
429
|
-
variant?: "
|
|
429
|
+
variant?: "indent" | "default" | "border" | null | undefined;
|
|
430
430
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
431
431
|
/**
|
|
432
432
|
* Props for the SidebarMenuSub component
|
package/dist/blocks/sidebar.js
CHANGED
package/dist/breadcrumb.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as t, jsxs as i } from "react/jsx-runtime";
|
|
2
2
|
import * as s from "react";
|
|
3
3
|
import { Slot as l } from "@radix-ui/react-slot";
|
|
4
|
-
import {
|
|
4
|
+
import { MoreHorizontal as c, ChevronRight as n } from "@brightlocal/icons";
|
|
5
5
|
import { cn as o } from "@brightlocal/ui-components/lib/utils";
|
|
6
6
|
const b = s.forwardRef(
|
|
7
7
|
({ dataHook: a, trackingEl: r, trackingLabel: e, ...d }, m) => /* @__PURE__ */ t(
|
|
@@ -75,7 +75,7 @@ const g = s.forwardRef(({ children: a, className: r, ...e }, d) => /* @__PURE__
|
|
|
75
75
|
"data-slot": "breadcrumb-separator",
|
|
76
76
|
role: "presentation",
|
|
77
77
|
...e,
|
|
78
|
-
children: a ?? /* @__PURE__ */ t(
|
|
78
|
+
children: a ?? /* @__PURE__ */ t(n, {})
|
|
79
79
|
}
|
|
80
80
|
));
|
|
81
81
|
g.displayName = "BreadcrumbSeparator";
|
|
@@ -89,7 +89,7 @@ const B = s.forwardRef(({ className: a, ...r }, e) => /* @__PURE__ */ i(
|
|
|
89
89
|
role: "presentation",
|
|
90
90
|
...r,
|
|
91
91
|
children: [
|
|
92
|
-
/* @__PURE__ */ t(
|
|
92
|
+
/* @__PURE__ */ t(c, { className: "size-4" }),
|
|
93
93
|
/* @__PURE__ */ t("span", { className: "sr-only", children: "More" })
|
|
94
94
|
]
|
|
95
95
|
}
|
package/dist/button.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ type ButtonVariantProps = {
|
|
|
15
15
|
size?: "default" | "sm" | "lg";
|
|
16
16
|
};
|
|
17
17
|
declare const ButtonVariants: (props?: ({
|
|
18
|
-
variant?: "default" | "destructive" | "warning" | "outline" | "secondary" |
|
|
18
|
+
variant?: "ghost" | "default" | "destructive" | "warning" | "outline" | "secondary" | null | undefined;
|
|
19
19
|
size?: "default" | "sm" | "lg" | null | undefined;
|
|
20
20
|
state?: "disabled" | "default" | "loading" | null | undefined;
|
|
21
21
|
fullWidth?: boolean | null | undefined;
|
package/dist/carousel.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as s, jsxs as p } from "react/jsx-runtime";
|
|
2
2
|
import * as o from "react";
|
|
3
3
|
import E from "embla-carousel-react";
|
|
4
|
-
import {
|
|
4
|
+
import { ArrowRight as I, ArrowLeft as K } from "@brightlocal/icons";
|
|
5
5
|
import { cn as f } from "@brightlocal/ui-components/lib/utils";
|
|
6
6
|
import { Button as N } from "@brightlocal/ui-components/button";
|
|
7
7
|
const v = o.createContext(null);
|
|
@@ -151,7 +151,7 @@ function B({
|
|
|
151
151
|
onClick: d,
|
|
152
152
|
...i,
|
|
153
153
|
children: [
|
|
154
|
-
/* @__PURE__ */ s(
|
|
154
|
+
/* @__PURE__ */ s(K, {}),
|
|
155
155
|
/* @__PURE__ */ s("span", { className: "sr-only", children: "Previous slide" })
|
|
156
156
|
]
|
|
157
157
|
}
|
|
@@ -183,7 +183,7 @@ function U({
|
|
|
183
183
|
onClick: d,
|
|
184
184
|
...i,
|
|
185
185
|
children: [
|
|
186
|
-
/* @__PURE__ */ s(
|
|
186
|
+
/* @__PURE__ */ s(I, {}),
|
|
187
187
|
/* @__PURE__ */ s("span", { className: "sr-only", children: "Next slide" })
|
|
188
188
|
]
|
|
189
189
|
}
|
package/dist/centred-layout.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),p=require("react"),o=require("@brightlocal/ui-components/lib/utils");function g(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),p=require("react"),o=require("@brightlocal/ui-components/lib/utils");function g(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const c=g(p),s=c.forwardRef(({className:t,maxWidth:e,children:n,dataHook:r,trackingEl:d,trackingLabel:i,...f},y)=>{const m=e!==void 0?{maxWidth:typeof e=="number"?`${e}px`:e}:void 0;return a.jsx("div",{ref:y,className:o.cn("bg-background flex min-h-screen flex-col items-center justify-center gap-4 p-section",!e&&"max-w-7xl",t),"data-hook":r,"data-slot":"centred-layout","data-tracking-el":d,"data-tracking-label":i,style:m,...f,children:n})});s.displayName="CentredLayout";const l=c.forwardRef(({className:t,children:e,...n},r)=>a.jsx("div",{ref:r,className:o.cn("flex w-full items-center justify-center lg:justify-start",t),"data-slot":"centred-layout-header",...n,children:e}));l.displayName="CentredLayoutHeader";const u=c.forwardRef(({className:t,children:e,...n},r)=>a.jsx("div",{ref:r,className:o.cn("flex flex-1 flex-col items-center justify-center",t),"data-slot":"centred-layout-content",...n,children:e}));u.displayName="CentredLayoutContent";exports.CentredLayout=s;exports.CentredLayoutContent=u;exports.CentredLayoutHeader=l;
|
package/dist/centred-layout.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import * as React from "react";
|
|
|
3
3
|
* CentredLayout provides a responsive centered container with max-width constraint.
|
|
4
4
|
*
|
|
5
5
|
* Spacing tokens used:
|
|
6
|
-
* - Padding:
|
|
6
|
+
* - Padding: section-padding-x/y tokens (responsive: 16px mobile, 24px desktop)
|
|
7
7
|
* - Header to content gap: gap-4 (spacing.4 = 16px)
|
|
8
8
|
* - Max width: max-w-7xl (1280px) by default
|
|
9
9
|
*
|
package/dist/centred-layout.js
CHANGED
|
@@ -7,8 +7,8 @@ const u = n.forwardRef(
|
|
|
7
7
|
maxWidth: e,
|
|
8
8
|
children: a,
|
|
9
9
|
dataHook: r,
|
|
10
|
-
trackingEl:
|
|
11
|
-
trackingLabel:
|
|
10
|
+
trackingEl: s,
|
|
11
|
+
trackingLabel: d,
|
|
12
12
|
...c
|
|
13
13
|
}, f) => {
|
|
14
14
|
const i = e !== void 0 ? {
|
|
@@ -19,15 +19,15 @@ const u = n.forwardRef(
|
|
|
19
19
|
{
|
|
20
20
|
ref: f,
|
|
21
21
|
className: l(
|
|
22
|
-
// Base styles with
|
|
23
|
-
"bg-background flex min-h-screen flex-col items-center justify-center gap-4 p-
|
|
22
|
+
// Base styles with section-padding tokens (responsive: 16px mobile, 24px desktop) and gap-4 for header/content spacing
|
|
23
|
+
"bg-background flex min-h-screen flex-col items-center justify-center gap-4 p-section",
|
|
24
24
|
!e && "max-w-7xl",
|
|
25
25
|
t
|
|
26
26
|
),
|
|
27
27
|
"data-hook": r,
|
|
28
28
|
"data-slot": "centred-layout",
|
|
29
|
-
"data-tracking-el":
|
|
30
|
-
"data-tracking-label":
|
|
29
|
+
"data-tracking-el": s,
|
|
30
|
+
"data-tracking-label": d,
|
|
31
31
|
style: i,
|
|
32
32
|
...c,
|
|
33
33
|
children: a
|
package/dist/checkbox.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),m=require("react"),g=require("@radix-ui/react-checkbox"),x=require("@brightlocal/icons"),p=require("class-variance-authority"),v=require("@brightlocal/ui-components/lib/utils");function s(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const a=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,a.get?a:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const o=s(m),i=s(g),y=p.cva(["size-4 shrink-0 self-start mt-0.5","bg-background peer border border-ring dark:bg-input/30 rounded-xs transition-colors outline-none","data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary","focus-visible:border-ring focus-visible:shadow-default","disabled:cursor-not-allowed disabled:opacity-50"],{variants:{error:{true:["border-red-600/40 dark:border-red-400/60","focus-visible:border-destructive focus-visible:shadow-destructive"]}},defaultVariants:{error:!1}}),n=o.forwardRef(({className:e,disabled:r=!1,error:t,dataHook:a,trackingEl:d,trackingLabel:l,id:u,...b},f)=>{const k=o.useId(),h=u||k;return c.jsx(i.Root,{ref:f,"aria-invalid":t?"true":void 0,className:v.cn(y({error:t}),e),"data-hook":a,"data-slot":"checkbox","data-tracking-el":d,"data-tracking-label":l,disabled:r,id:h,...b,children:c.jsx(i.Indicator,{className:"flex items-center justify-center text-current transition-none","data-slot":"checkbox-indicator",children:c.jsx(x.CheckIcon,{className:"size-3.5"})})})});n.displayName="Checkbox";exports.Checkbox=n;
|
package/dist/checkbox.js
CHANGED
|
@@ -7,7 +7,7 @@ import { cn as h } from "@brightlocal/ui-components/lib/utils";
|
|
|
7
7
|
const p = u(
|
|
8
8
|
[
|
|
9
9
|
// Layout & Size
|
|
10
|
-
"size-4 shrink-0 self-start",
|
|
10
|
+
"size-4 shrink-0 self-start mt-0.5",
|
|
11
11
|
// Appearance
|
|
12
12
|
"bg-background peer border border-ring dark:bg-input/30 rounded-xs transition-colors outline-none",
|
|
13
13
|
// Checked State
|
package/dist/combobox.d.ts
CHANGED
|
@@ -58,13 +58,13 @@ export interface ComboboxInputProps extends React.ComponentProps<typeof CommandI
|
|
|
58
58
|
/** Called when input value changes. Use to trigger async search requests. */
|
|
59
59
|
onValueChange?: (value: string) => void;
|
|
60
60
|
}
|
|
61
|
-
declare const ComboboxInput: React.ForwardRefExoticComponent<ComboboxInputProps & React.RefAttributes<
|
|
61
|
+
declare const ComboboxInput: React.ForwardRefExoticComponent<Omit<ComboboxInputProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
62
62
|
export type ComboboxListProps = React.ComponentProps<typeof CommandList>;
|
|
63
|
-
declare const ComboboxList: React.ForwardRefExoticComponent<
|
|
63
|
+
declare const ComboboxList: React.ForwardRefExoticComponent<Omit<Omit<import('../command').CommandListProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
64
64
|
export type ComboboxEmptyProps = React.ComponentProps<typeof CommandEmpty>;
|
|
65
|
-
declare const ComboboxEmpty: React.ForwardRefExoticComponent<
|
|
65
|
+
declare const ComboboxEmpty: React.ForwardRefExoticComponent<Omit<Omit<import('../command').CommandEmptyProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
66
66
|
export type ComboboxGroupProps = React.ComponentProps<typeof CommandGroup>;
|
|
67
|
-
declare const ComboboxGroup: React.ForwardRefExoticComponent<
|
|
67
|
+
declare const ComboboxGroup: React.ForwardRefExoticComponent<Omit<Omit<import('../command').CommandGroupProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
68
68
|
export interface ComboboxItemProps extends Omit<React.ComponentProps<typeof CommandItem>, "onSelect"> {
|
|
69
69
|
/** The value of the item (required) */
|
|
70
70
|
value: string;
|
|
@@ -77,9 +77,9 @@ export interface ComboboxItemProps extends Omit<React.ComponentProps<typeof Comm
|
|
|
77
77
|
/** Class name for highlighted text */
|
|
78
78
|
highlightClassName?: string;
|
|
79
79
|
}
|
|
80
|
-
declare const ComboboxItem: React.ForwardRefExoticComponent<Omit<ComboboxItemProps, "ref"> & React.RefAttributes<
|
|
80
|
+
declare const ComboboxItem: React.ForwardRefExoticComponent<Omit<ComboboxItemProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
81
81
|
export type ComboboxSeparatorProps = React.ComponentProps<typeof CommandSeparator>;
|
|
82
|
-
declare const ComboboxSeparator: React.ForwardRefExoticComponent<
|
|
82
|
+
declare const ComboboxSeparator: React.ForwardRefExoticComponent<Omit<Omit<import('../command').CommandSeparatorProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
83
83
|
export interface ComboboxLoadingProps {
|
|
84
84
|
/** Custom className */
|
|
85
85
|
className?: string;
|
package/dist/combobox.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox.d.ts","sourceRoot":"","sources":["../../src/components/combobox.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAQlE,OAAO,EAEL,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,WAAW,EACX,gBAAgB,EACjB,MAAM,oCAAoC,CAAC;AAgC5C,MAAM,WAAW,aAAa;IAC5B,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CACxB,CAAC;AAEF,QAAA,MAAM,iBAAiB,2MAOrB,CAAC;AAOH,MAAM,WAAW,oBAAoB;IACnC,uBAAuB;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wCAAwC;IACxC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,iBAAS,eAAe,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,oBAAoB,2CAiBrE;AAMD,OAAO,EACL,QAAQ,EACR,eAAe,EACf,aAAa,EACb,eAAe,EACf,aAAa,EACb,YAAY,EACZ,aAAa,EACb,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,eAAe,GAChB,CAAC"}
|
package/dist/combobox.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as n, jsxs as I, Fragment as j } from "react/jsx-runtime";
|
|
2
2
|
import * as t from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { CheckIcon as z, LoaderIcon as P, ChevronsUpDownIcon as M } from "@brightlocal/icons";
|
|
4
4
|
import { cva as G } from "class-variance-authority";
|
|
5
5
|
import { cn as w } from "@brightlocal/ui-components/lib/utils";
|
|
6
|
-
import { Popover as U,
|
|
7
|
-
import { Command as F,
|
|
6
|
+
import { Popover as U, PopoverContent as _, PopoverTrigger as $ } from "@brightlocal/ui-components/popover";
|
|
7
|
+
import { Command as F, CommandEmpty as O, CommandGroup as D, CommandInput as H, CommandItem as V, CommandList as q, CommandSeparator as A } from "@brightlocal/ui-components/command";
|
|
8
8
|
const E = t.createContext(null);
|
|
9
9
|
function y() {
|
|
10
10
|
const o = t.useContext(E);
|
|
@@ -113,7 +113,7 @@ const B = G(
|
|
|
113
113
|
...d
|
|
114
114
|
}, f) => {
|
|
115
115
|
const { open: m, disabled: b, value: x } = y(), u = t.useId(), l = !x;
|
|
116
|
-
return /* @__PURE__ */ n(
|
|
116
|
+
return /* @__PURE__ */ n($, { asChild: !0, children: /* @__PURE__ */ I(
|
|
117
117
|
"button",
|
|
118
118
|
{
|
|
119
119
|
ref: f,
|
|
@@ -134,7 +134,7 @@ const B = G(
|
|
|
134
134
|
children: [
|
|
135
135
|
i,
|
|
136
136
|
/* @__PURE__ */ n(
|
|
137
|
-
|
|
137
|
+
M,
|
|
138
138
|
{
|
|
139
139
|
"aria-hidden": "true",
|
|
140
140
|
className: "text-muted-foreground ml-auto size-4 shrink-0"
|
|
@@ -168,7 +168,7 @@ function mo({
|
|
|
168
168
|
}) {
|
|
169
169
|
const { shouldFilter: s } = y();
|
|
170
170
|
return /* @__PURE__ */ n(
|
|
171
|
-
|
|
171
|
+
_,
|
|
172
172
|
{
|
|
173
173
|
align: r,
|
|
174
174
|
className: w("w-[var(--radix-popover-trigger-width)] p-0", e),
|
|
@@ -186,13 +186,13 @@ function mo({
|
|
|
186
186
|
}
|
|
187
187
|
);
|
|
188
188
|
}
|
|
189
|
-
const K = t.forwardRef((o, e) => /* @__PURE__ */ n(
|
|
189
|
+
const K = t.forwardRef((o, e) => /* @__PURE__ */ n(H, { ref: e, "data-slot": "combobox-input", ...o }));
|
|
190
190
|
K.displayName = "ComboboxInput";
|
|
191
|
-
const Q = t.forwardRef((o, e) => /* @__PURE__ */ n(
|
|
191
|
+
const Q = t.forwardRef((o, e) => /* @__PURE__ */ n(q, { ref: e, "data-slot": "combobox-list", ...o }));
|
|
192
192
|
Q.displayName = "ComboboxList";
|
|
193
|
-
const W = t.forwardRef((o, e) => /* @__PURE__ */ n(
|
|
193
|
+
const W = t.forwardRef((o, e) => /* @__PURE__ */ n(O, { ref: e, "data-slot": "combobox-empty", ...o }));
|
|
194
194
|
W.displayName = "ComboboxEmpty";
|
|
195
|
-
const X = t.forwardRef((o, e) => /* @__PURE__ */ n(
|
|
195
|
+
const X = t.forwardRef((o, e) => /* @__PURE__ */ n(D, { ref: e, "data-slot": "combobox-group", ...o }));
|
|
196
196
|
X.displayName = "ComboboxGroup";
|
|
197
197
|
function Y(o, e, a) {
|
|
198
198
|
if (!e || !e.trim())
|
|
@@ -230,7 +230,7 @@ const Z = t.forwardRef(
|
|
|
230
230
|
d || "text-sm leading-normal font-semibold"
|
|
231
231
|
) : r;
|
|
232
232
|
return /* @__PURE__ */ I(
|
|
233
|
-
|
|
233
|
+
V,
|
|
234
234
|
{
|
|
235
235
|
ref: m,
|
|
236
236
|
className: w("justify-between", s),
|
|
@@ -242,7 +242,7 @@ const Z = t.forwardRef(
|
|
|
242
242
|
children: [
|
|
243
243
|
h(),
|
|
244
244
|
g && /* @__PURE__ */ n(
|
|
245
|
-
|
|
245
|
+
z,
|
|
246
246
|
{
|
|
247
247
|
"aria-hidden": "true",
|
|
248
248
|
className: "text-muted-foreground size-4 shrink-0"
|
|
@@ -266,7 +266,7 @@ function lo({ className: o, children: e }) {
|
|
|
266
266
|
),
|
|
267
267
|
"data-slot": "combobox-loading",
|
|
268
268
|
children: e || /* @__PURE__ */ I(j, { children: [
|
|
269
|
-
/* @__PURE__ */ n(
|
|
269
|
+
/* @__PURE__ */ n(P, { "aria-hidden": "true", className: "size-4 animate-spin" }),
|
|
270
270
|
"Loading..."
|
|
271
271
|
] })
|
|
272
272
|
}
|
package/dist/date-picker.js
CHANGED
|
@@ -5,7 +5,7 @@ import { Calendar as V } from "@brightlocal/icons";
|
|
|
5
5
|
import { cn as p } from "@brightlocal/ui-components/lib/utils";
|
|
6
6
|
import { inputVariants as R } from "./input.js";
|
|
7
7
|
import { Calendar as S } from "@brightlocal/ui-components/calendar";
|
|
8
|
-
import {
|
|
8
|
+
import { PopoverContent as H, Popover as E, PopoverTrigger as M } from "@brightlocal/ui-components/popover";
|
|
9
9
|
import { Select as I, SelectTrigger as L, SelectValue as j, SelectContent as O, SelectItem as _ } from "@brightlocal/ui-components/select";
|
|
10
10
|
const x = f.createContext(
|
|
11
11
|
null
|
|
@@ -72,12 +72,12 @@ function A({
|
|
|
72
72
|
l
|
|
73
73
|
]
|
|
74
74
|
);
|
|
75
|
-
return /* @__PURE__ */ n(x.Provider, { value: T, children: /* @__PURE__ */ n(
|
|
75
|
+
return /* @__PURE__ */ n(x.Provider, { value: T, children: /* @__PURE__ */ n(E, { open: b, onOpenChange: C, children: e }) });
|
|
76
76
|
}
|
|
77
77
|
A.displayName = "DatePickerRoot";
|
|
78
78
|
const F = f.forwardRef(({ className: e, children: c, id: r, ...l }, a) => {
|
|
79
79
|
const { mode: d, date: u, dateRange: o, dateFormat: s, placeholder: t, disabled: i, dataHook: m } = k(), D = d === "single" ? u ? P(u, s) : null : o?.from ? o.to ? `${P(o.from, s)} - ${P(o.to, s)}` : P(o.from, s) : null, g = D !== null;
|
|
80
|
-
return /* @__PURE__ */ n(
|
|
80
|
+
return /* @__PURE__ */ n(M, { asChild: !0, children: /* @__PURE__ */ v(
|
|
81
81
|
"button",
|
|
82
82
|
{
|
|
83
83
|
ref: a,
|
|
@@ -114,7 +114,7 @@ F.displayName = "DatePickerTrigger";
|
|
|
114
114
|
const U = f.forwardRef(({ className: e, children: c, ...r }, l) => {
|
|
115
115
|
const { dataHook: a } = k();
|
|
116
116
|
return /* @__PURE__ */ n(
|
|
117
|
-
|
|
117
|
+
H,
|
|
118
118
|
{
|
|
119
119
|
ref: l,
|
|
120
120
|
align: "start",
|
package/dist/field.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),g=require("class-variance-authority"),p=require("@brightlocal/icons"),o=require("@brightlocal/ui-components/lib/utils"),m=require("./description.cjs"),h=require("@brightlocal/ui-components/label");function s({className:t,...e}){return l.jsx("fieldset",{className:o.cn("flex flex-col gap-6","has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3",t),"data-slot":"field-set",...e})}s.displayName="FieldSet";const x=["legend","label"];function b({className:t,variant:e="legend",...a}){return l.jsx("legend",{className:o.cn("mb-3 font-medium","data-[variant=legend]:text-base","data-[variant=label]:text-sm",t),"data-slot":"field-legend","data-variant":e,...a})}function F({className:t,...e}){return l.jsx("div",{className:o.cn("group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4",t),"data-slot":"field-group",...e})}const v=g.cva("group/field flex w-full gap-2",{variants:{orientation:{vertical:["flex-col [&>*]:w-full [&>.sr-only]:w-auto"],horizontal:["grid grid-cols-[auto_1fr] items-center","[&>[data-slot=field-description]]:col-start-2 [&>[data-slot=field-error]]:col-start-2","has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"],responsive:["flex-col [&>*]:w-full [&>.sr-only]:w-auto @md/field-group:grid @md/field-group:grid-cols-[auto_1fr] @md/field-group:items-center @md/field-group:[&>*]:w-auto","@md/field-group:[&>[data-slot=field-description]]:col-start-2 @md/field-group:[&>[data-slot=field-error]]:col-start-2","@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"]}},defaultVariants:{orientation:"vertical"}});function j({className:t,orientation:e="vertical",...a}){return l.jsx("div",{className:o.cn(v({orientation:e}),t),"data-orientation":e,"data-slot":"field",role:"group",...a})}function k({className:t,...e}){return l.jsx("div",{className:o.cn("group/field-content flex flex-1 flex-col gap-1.5 leading-snug",t),"data-slot":"field-content",...e})}function N({className:t,htmlFor:e,dataHook:a,...r}){return l.jsx(h.Label,{className:o.cn("group/field-label peer/field-label w-fit","has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4","has-data-[state=checked]:bg-primary/5 has-data-[state=checked]:border-primary dark:has-data-[state=checked]:bg-primary/10",t),"data-hook":a,"data-slot":"field-label",htmlFor:e,...r})}function y({className:t,dataHook:e,...a}){return l.jsx(m.Description,{className:o.cn("mt-2","group-has-[[data-orientation=horizontal]]/field:text-balance","last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5",t),"data-hook":e,"data-slot":"field-description",...a})}function w({icon:t=p.AlertCircle,className:e,...a}){return l.jsx(t,{"aria-hidden":"true",className:o.cn("inline-block size-4 shrink-0 align-text-bottom",e),...a})}function L({className:t,dataHook:e,children:a,errors:r,...n}){const i=r?.filter(d=>!!d?.message);if(!a&&(!i||i.length===0))return null;const c=o.cn("text-destructive-foreground text-sm font-normal leading-5","mt-2","group-has-[[data-orientation=horizontal]]/field:text-balance","last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5",t),f=i&&i.length>1;return l.jsx("div",{className:c,"data-hook":e,"data-slot":"field-error",role:"alert",...n,children:f?l.jsx("ul",{className:"list-disc space-y-1 pl-4",children:i.map((d,u)=>l.jsx("li",{children:d.message},u))}):l.jsx("p",{className:"m-0",children:a||i?.[0]?.message})})}exports.Field=j;exports.FieldContent=k;exports.FieldDescription=y;exports.FieldError=L;exports.FieldErrorIcon=w;exports.FieldGroup=F;exports.FieldLabel=N;exports.FieldLegend=b;exports.FieldSet=s;exports.fieldLegendVariants=x;
|