@brightlocal/ui-components 2.0.0 → 2.1.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.
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react");function o(e,n,r){process.env.NODE_ENV==="development"&&i.useEffect(()=>{const t=requestAnimationFrame(()=>{e()&&console.warn(`[BrightLocal DS] ${n}`)});return()=>cancelAnimationFrame(t)},r)}exports.useDevWarning=o;
@@ -0,0 +1,12 @@
1
+ import { useEffect as t } from "react";
2
+ function a(e, n, r) {
3
+ process.env.NODE_ENV === "development" && t(() => {
4
+ const o = requestAnimationFrame(() => {
5
+ e() && console.warn(`[BrightLocal DS] ${n}`);
6
+ });
7
+ return () => cancelAnimationFrame(o);
8
+ }, r);
9
+ }
10
+ export {
11
+ a as useDevWarning
12
+ };
@@ -28,7 +28,7 @@ type ResizablePanelProps = React.ComponentProps<typeof ResizablePrimitive.Panel>
28
28
  /**
29
29
  * Individual resizable panel within a panel group.
30
30
  */
31
- declare const ResizablePanel: React.ForwardRefExoticComponent<Omit<Omit<React.HTMLAttributes<HTMLElement | HTMLDivElement | HTMLObjectElement | HTMLSlotElement | HTMLStyleElement | HTMLLinkElement | HTMLMapElement | HTMLButtonElement | HTMLDialogElement | HTMLFormElement | HTMLImageElement | HTMLOptionElement | HTMLTableElement | HTMLTimeElement | HTMLVideoElement | HTMLAnchorElement | HTMLAreaElement | HTMLAudioElement | HTMLBaseElement | HTMLQuoteElement | HTMLBodyElement | HTMLBRElement | HTMLCanvasElement | HTMLTableColElement | HTMLDataElement | HTMLDataListElement | HTMLModElement | HTMLDetailsElement | HTMLDListElement | HTMLEmbedElement | HTMLFieldSetElement | HTMLHeadingElement | HTMLHeadElement | HTMLHRElement | HTMLHtmlElement | HTMLIFrameElement | HTMLInputElement | HTMLLabelElement | HTMLLegendElement | HTMLLIElement | HTMLMetaElement | HTMLMeterElement | HTMLOListElement | HTMLOptGroupElement | HTMLOutputElement | HTMLParagraphElement | HTMLPreElement | HTMLProgressElement | HTMLScriptElement | HTMLSelectElement | HTMLSourceElement | HTMLSpanElement | HTMLTemplateElement | HTMLTableSectionElement | HTMLTableCellElement | HTMLTextAreaElement | HTMLTitleElement | HTMLTableRowElement | HTMLTrackElement | HTMLUListElement | HTMLTableCaptionElement | HTMLMenuElement | HTMLPictureElement>, "id" | "onResize"> & {
31
+ declare const ResizablePanel: React.ForwardRefExoticComponent<Omit<Omit<React.HTMLAttributes<HTMLElement | HTMLDivElement | HTMLObjectElement | HTMLSlotElement | HTMLStyleElement | HTMLLinkElement | HTMLMapElement | HTMLButtonElement | HTMLDialogElement | HTMLFormElement | HTMLImageElement | HTMLOptionElement | HTMLTableElement | HTMLTimeElement | HTMLVideoElement | HTMLAnchorElement | HTMLAreaElement | HTMLAudioElement | HTMLBaseElement | HTMLQuoteElement | HTMLBodyElement | HTMLBRElement | HTMLCanvasElement | HTMLTableColElement | HTMLDataElement | HTMLDataListElement | HTMLModElement | HTMLDetailsElement | HTMLDListElement | HTMLEmbedElement | HTMLFieldSetElement | HTMLHeadingElement | HTMLHeadElement | HTMLHRElement | HTMLHtmlElement | HTMLIFrameElement | HTMLInputElement | HTMLLabelElement | HTMLLegendElement | HTMLLIElement | HTMLMetaElement | HTMLMeterElement | HTMLOListElement | HTMLOptGroupElement | HTMLOutputElement | HTMLParagraphElement | HTMLPreElement | HTMLProgressElement | HTMLScriptElement | HTMLSelectElement | HTMLSourceElement | HTMLSpanElement | HTMLTemplateElement | HTMLTableSectionElement | HTMLTableCellElement | HTMLTextAreaElement | HTMLTitleElement | HTMLTableRowElement | HTMLTrackElement | HTMLUListElement | HTMLMenuElement | HTMLTableCaptionElement | HTMLPictureElement>, "id" | "onResize"> & {
32
32
  className?: string;
33
33
  collapsedSize?: number | undefined;
34
34
  collapsible?: boolean | undefined;
package/dist/select.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),k=require("react"),q=require("@radix-ui/react-select"),d=require("@brightlocal/icons"),C=require("class-variance-authority"),n=require("@brightlocal/ui-components/lib/utils"),D=require("@brightlocal/ui-components/lib/use-dev-warning");function p(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const s=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(r,a,s.get?s:{enumerable:!0,get:()=>e[a]})}}return r.default=e,Object.freeze(r)}const I=p(k),o=p(q);function f({children:e,...r}){return t.jsx(o.Root,{"data-slot":"select",...r,children:e})}f.displayName="Select";function b(e){return t.jsx(o.Group,{"data-slot":"select-group",...e})}b.displayName="SelectGroup";function g(e){return t.jsx(o.Value,{"data-slot":"select-value",...e})}g.displayName="SelectValue";const _=C.cva(["relative flex w-full h-9 items-center justify-between gap-2","px-3 py-2","border border-border rounded-sm outline-none transition-[border-color,box-shadow,background-color]","bg-neutral-50 border-neutral-300","dark:bg-white/5 dark:border-white/15","text-sm font-normal font-sans text-foreground","[&>span]:block [&>span]:truncate","data-[placeholder]:text-muted-foreground","focus-visible:outline-none focus-visible:border-ring dark:focus-visible:border-neutral-500 focus-visible:bg-background","focus-visible:shadow-default","data-[state=open]:border-ring","disabled:cursor-not-allowed disabled:opacity-50","[&_svg]:pointer-events-none [&_svg]:shrink-0"]);function x({className:e,children:r,placeholder:a,dataHook:s,error:i,...l}){const c=i||l["aria-invalid"]===!0||l["aria-invalid"]==="true",j=l["aria-required"]===!0||l["aria-required"]==="true",w=l["aria-label"]||a||"Select an option",N=c?"border-destructive-40 dark:border-destructive-40 focus-visible:border-destructive-40 dark:focus-visible:border-destructive-40 focus-visible:shadow-destructive data-[state=open]:border-destructive-40 dark:data-[state=open]:border-destructive-40 data-[state=open]:shadow-destructive":"";return t.jsxs(o.Trigger,{...l,"aria-invalid":c?"true":void 0,"aria-label":w,"aria-required":j?"true":void 0,className:n.cn(_(),N,e),"data-hook":s,"data-slot":"select-trigger",children:[r,t.jsx(o.Icon,{asChild:!0,children:t.jsx(d.ChevronDown,{className:"text-muted-foreground"})})]})}x.displayName="SelectTrigger";function v({className:e,children:r,position:a="popper",...s}){const i=I.useRef(null);D.useDevWarning(()=>i.current?i.current.querySelectorAll('[data-slot="select-item"]').length>=100:!1,`Select contains many items. For large lists (100+), consider using <Combobox> which supports search and filtering.
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),k=require("react"),q=require("@radix-ui/react-select"),d=require("@brightlocal/icons"),C=require("class-variance-authority"),n=require("@brightlocal/ui-components/lib/utils"),D=require("./lib/use-dev-warning.cjs");function p(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const s=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(r,a,s.get?s:{enumerable:!0,get:()=>e[a]})}}return r.default=e,Object.freeze(r)}const I=p(k),o=p(q);function f({children:e,...r}){return t.jsx(o.Root,{"data-slot":"select",...r,children:e})}f.displayName="Select";function b(e){return t.jsx(o.Group,{"data-slot":"select-group",...e})}b.displayName="SelectGroup";function g(e){return t.jsx(o.Value,{"data-slot":"select-value",...e})}g.displayName="SelectValue";const _=C.cva(["relative flex w-full h-9 items-center justify-between gap-2","px-3 py-2","border border-border rounded-sm outline-none transition-[border-color,box-shadow,background-color]","bg-neutral-50 border-neutral-300","dark:bg-white/5 dark:border-white/15","text-sm font-normal font-sans text-foreground","[&>span]:block [&>span]:truncate","data-[placeholder]:text-muted-foreground","focus-visible:outline-none focus-visible:border-ring dark:focus-visible:border-neutral-500 focus-visible:bg-background","focus-visible:shadow-default","data-[state=open]:border-ring","disabled:cursor-not-allowed disabled:opacity-50","[&_svg]:pointer-events-none [&_svg]:shrink-0"]);function x({className:e,children:r,placeholder:a,dataHook:s,error:i,...l}){const c=i||l["aria-invalid"]===!0||l["aria-invalid"]==="true",j=l["aria-required"]===!0||l["aria-required"]==="true",w=l["aria-label"]||a||"Select an option",N=c?"border-destructive-40 dark:border-destructive-40 focus-visible:border-destructive-40 dark:focus-visible:border-destructive-40 focus-visible:shadow-destructive data-[state=open]:border-destructive-40 dark:data-[state=open]:border-destructive-40 data-[state=open]:shadow-destructive":"";return t.jsxs(o.Trigger,{...l,"aria-invalid":c?"true":void 0,"aria-label":w,"aria-required":j?"true":void 0,className:n.cn(_(),N,e),"data-hook":s,"data-slot":"select-trigger",children:[r,t.jsx(o.Icon,{asChild:!0,children:t.jsx(d.ChevronDown,{className:"text-muted-foreground"})})]})}x.displayName="SelectTrigger";function v({className:e,children:r,position:a="popper",...s}){const i=I.useRef(null);D.useDevWarning(()=>i.current?i.current.querySelectorAll('[data-slot="select-item"]').length>=100:!1,`Select contains many items. For large lists (100+), consider using <Combobox> which supports search and filtering.
2
2
  Import: import { Combobox } from "@brightlocal/ui-components/combobox"`,[r]);const l=n.cn("relative z-50 overflow-hidden","min-w-[8rem]","rounded-md border border-border bg-popover shadow-md","text-popover-foreground","max-h-[var(--radix-select-content-available-height)]","origin-[var(--radix-select-content-transform-origin)]","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"),c=a==="popper"&&n.cn("data-[side=bottom]:translate-y-1","data-[side=left]:-translate-x-1","data-[side=right]:translate-x-1","data-[side=top]:-translate-y-1");return t.jsx(o.Portal,{children:t.jsxs(o.Content,{className:n.cn(l,c,e),"data-slot":"select-content",position:a,...s,children:[t.jsx(u,{}),t.jsx(o.Viewport,{ref:i,className:n.cn("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:r}),t.jsx(m,{})]})})}v.displayName="SelectContent";function S({className:e,...r}){return t.jsx(o.Label,{className:n.cn("text-muted-foreground px-2 py-1.5 text-xs font-medium",e),"data-slot":"select-label",...r})}S.displayName="SelectLabel";function h({className:e,children:r,...a}){const s=n.cn("relative flex w-full cursor-default select-none items-center gap-2","rounded py-1.5 pl-2 pr-8","text-sm font-normal leading-5 text-popover-foreground","focus:bg-accent focus:text-accent-foreground","hover:bg-accent/50 hover:text-accent-foreground","outline-none focus:outline-none","data-[disabled]:pointer-events-none data-[disabled]:opacity-50","[&_svg]:pointer-events-none [&_svg]:shrink-0");return t.jsxs(o.Item,{className:n.cn(s,e),"data-slot":"select-item",...a,children:[t.jsx("span",{className:"absolute right-2 flex size-4 items-center justify-center",children:t.jsx(o.ItemIndicator,{children:t.jsx(d.Check,{})})}),t.jsx(o.ItemText,{children:r})]})}h.displayName="SelectItem";function y({className:e,...r}){return t.jsx(o.Separator,{className:n.cn("bg-border pointer-events-none -mx-1 my-1 h-px",e),"data-slot":"select-separator",...r})}y.displayName="SelectSeparator";function u({className:e,...r}){return t.jsx(o.ScrollUpButton,{className:n.cn("flex cursor-default items-center justify-center py-1",e),"data-slot":"select-scroll-up-button",...r,children:t.jsx(d.ChevronUp,{})})}u.displayName="SelectScrollUpButton";function m({className:e,...r}){return t.jsx(o.ScrollDownButton,{className:n.cn("flex cursor-default items-center justify-center py-1",e),"data-slot":"select-scroll-down-button",...r,children:t.jsx(d.ChevronDown,{})})}m.displayName="SelectScrollDownButton";exports.Select=f;exports.SelectContent=v;exports.SelectGroup=b;exports.SelectItem=h;exports.SelectLabel=S;exports.SelectScrollDownButton=m;exports.SelectScrollUpButton=u;exports.SelectSeparator=y;exports.SelectTrigger=x;exports.SelectValue=g;
package/dist/select.js CHANGED
@@ -4,7 +4,7 @@ import * as o from "@radix-ui/react-select";
4
4
  import { Check as h, ChevronDown as u, ChevronUp as S } from "@brightlocal/icons";
5
5
  import { cva as x } from "class-variance-authority";
6
6
  import { cn as a } from "@brightlocal/ui-components/lib/utils";
7
- import { useDevWarning as y } from "@brightlocal/ui-components/lib/use-dev-warning";
7
+ import { useDevWarning as y } from "./lib/use-dev-warning.js";
8
8
  function w({ children: e, ...r }) {
9
9
  return /* @__PURE__ */ t(o.Root, { "data-slot": "select", ...r, children: e });
10
10
  }
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),N=require("react"),c=require("@brightlocal/ui-components/lib/utils");function R(t){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const l=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(a,e,l.get?l:{enumerable:!0,get:()=>t[e]})}}return a.default=t,Object.freeze(a)}const n=R(N),x=n.createContext(!1),j=n.forwardRef(({className:t,dataHook:a,trackingEl:e,trackingLabel:l,left:r,right:u,children:L,...C},S)=>{const d=[],f=[],p=[],m=o=>{if(n.isValidElement(o)){if(o.type===n.Fragment){n.Children.forEach(o.props.children,m);return}o.type===y?d.push(o):o.type===i?p.push(o):f.push(o)}};n.Children.forEach(L,m);const b=r!=null||u!=null,v=f.length>0||p.length>0,g=b&&!v,w=d.length>0;return s.jsxs("div",{ref:S,className:c.cn("flex min-h-screen w-full flex-col lg:flex-row",t),"data-hook":a,"data-slot":"split-layout","data-tracking-el":e||"split-layout","data-tracking-label":l,...C,children:[s.jsx("div",{className:"bg-background flex flex-1 flex-col","data-slot":"split-layout-body",children:s.jsxs(x.Provider,{value:w,children:[d,g?r&&s.jsx(h,{children:r}):f]})}),g?u&&s.jsx(i,{children:u}):p]})});j.displayName="SplitLayout";const y=n.forwardRef(({className:t,children:a,...e},l)=>s.jsx("div",{ref:l,className:c.cn("px-section-sm pt-section-sm flex w-full items-center justify-center lg:justify-start",t),"data-slot":"split-layout-header",...e,children:a}));y.displayName="SplitLayoutHeader";const h=n.forwardRef(({className:t,children:a,...e},l)=>{const r=n.useContext(x);return s.jsx("div",{ref:l,className:c.cn("p-section-sm flex flex-1 items-center justify-center overflow-auto",r&&"pt-2",t),"data-slot":"split-layout-left",...e,children:a})});h.displayName="SplitLayoutContentLeft";const i=n.forwardRef(({className:t,children:a,...e},l)=>s.jsx("div",{ref:l,className:c.cn("bg-card p-section-sm hidden flex-1 items-center justify-center overflow-auto lg:flex",t),"data-slot":"split-layout-right",...e,children:a}));i.displayName="SplitLayoutContentRight";exports.SplitLayout=j;exports.SplitLayoutContentLeft=h;exports.SplitLayoutContentRight=i;exports.SplitLayoutHeader=y;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),R=require("react"),c=require("@brightlocal/ui-components/lib/utils");function k(t){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const l=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(a,e,l.get?l:{enumerable:!0,get:()=>t[e]})}}return a.default=t,Object.freeze(a)}const o=k(R),j=o.createContext(!1),C=o.forwardRef(({className:t,dataHook:a,trackingEl:e,trackingLabel:l,left:s,right:i,children:d,...f},p)=>{const y=[],m=[],g=[],L=r=>{if(o.isValidElement(r)){if(r.type===o.Fragment){o.Children.forEach(r.props.children,L);return}r.type===h?y.push(r):r.type===u?g.push(r):m.push(r)}};o.Children.forEach(d,L);const v=s!=null||i!=null,w=m.length>0||g.length>0,S=v&&!w,N=y.length>0;return n.jsxs("div",{ref:p,className:c.cn("flex min-h-screen w-full flex-col lg:flex-row",t),"data-hook":a,"data-slot":"split-layout","data-tracking-el":e||"split-layout","data-tracking-label":l,...f,children:[n.jsx("div",{className:"bg-background flex flex-1 flex-col","data-slot":"split-layout-body",children:n.jsxs(j.Provider,{value:N,children:[y,S?s&&n.jsx(x,{children:s}):m]})}),S?i&&n.jsx(u,{children:i}):g]})});C.displayName="SplitLayout";const h=o.forwardRef(({className:t,children:a,...e},l)=>n.jsx("div",{ref:l,className:c.cn("px-section-sm pt-section-sm flex w-full items-center justify-center lg:justify-start",t),"data-slot":"split-layout-header",...e,children:a}));h.displayName="SplitLayoutHeader";const x=o.forwardRef(({className:t,children:a,...e},l)=>{const s=o.useContext(j);return n.jsx("div",{ref:l,className:c.cn("p-section-sm flex flex-1 items-center justify-center overflow-auto",s&&"pt-2",t),"data-slot":"split-layout-left",...e,children:a})});x.displayName="SplitLayoutContentLeft";const u=o.forwardRef(({className:t,flush:a=!1,children:e,...l},s)=>n.jsx("div",{ref:s,className:c.cn("bg-card hidden",a?"relative h-screen overflow-hidden lg:block lg:w-1/2 lg:shrink-0":"p-section-sm flex-1 items-center justify-center overflow-auto lg:flex",t),"data-slot":"split-layout-right",...l,children:e}));u.displayName="SplitLayoutContentRight";const b=o.forwardRef(({className:t,dataHook:a,src:e,alt:l,objectFit:s="cover",objectPosition:i="center",style:d,...f},p)=>n.jsx("img",{ref:p,alt:l,className:c.cn("absolute inset-0 h-full w-full",t),"data-hook":a,"data-slot":"split-layout-image",src:e,style:{objectFit:s,objectPosition:i,...d},...f}));b.displayName="SplitLayoutImage";exports.SplitLayout=C;exports.SplitLayoutContentLeft=x;exports.SplitLayoutContentRight=u;exports.SplitLayoutHeader=h;exports.SplitLayoutImage=b;
@@ -84,13 +84,64 @@ interface SplitLayoutContentLeftProps extends React.ComponentProps<"div"> {
84
84
  declare const SplitLayoutContentLeft: React.ForwardRefExoticComponent<Omit<SplitLayoutContentLeftProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
85
85
  interface SplitLayoutContentRightProps extends React.ComponentProps<"div"> {
86
86
  children: React.ReactNode;
87
+ /**
88
+ * Removes padding so content can fill edge-to-edge.
89
+ * Use with `SplitLayoutImage` for full-bleed imagery.
90
+ * @default false
91
+ */
92
+ flush?: boolean;
87
93
  }
88
94
  /**
89
95
  * SplitLayoutContentRight - Right/secondary section within a SplitLayout.
90
96
  *
91
97
  * Hidden on mobile/tablet (<1024px), visible on desktop (≥1024px).
92
98
  * Uses bg-card background color.
99
+ *
100
+ * Set `flush` to remove padding for full-bleed content (e.g. images).
93
101
  */
94
102
  declare const SplitLayoutContentRight: React.ForwardRefExoticComponent<Omit<SplitLayoutContentRightProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
95
- export { SplitLayout, SplitLayoutHeader, SplitLayoutContentLeft, SplitLayoutContentRight, type SplitLayoutProps, type SplitLayoutHeaderProps, type SplitLayoutContentLeftProps, type SplitLayoutContentRightProps, };
103
+ interface SplitLayoutImageProps extends React.ComponentProps<"img"> {
104
+ /**
105
+ * Data hook for automated testing (REQUIRED)
106
+ */
107
+ dataHook: string;
108
+ /**
109
+ * Image source URL
110
+ */
111
+ src: string;
112
+ /**
113
+ * Alt text for the image
114
+ */
115
+ alt: string;
116
+ /**
117
+ * How the image fits its container.
118
+ * @default "cover"
119
+ */
120
+ objectFit?: "cover" | "contain";
121
+ /**
122
+ * CSS object-position value controlling the focal point of the image.
123
+ * @default "center"
124
+ * @example "top", "center", "left 30%"
125
+ */
126
+ objectPosition?: string;
127
+ }
128
+ /**
129
+ * SplitLayoutImage — Full-bleed image for the right section of a SplitLayout.
130
+ *
131
+ * Fills the entire right panel with no margins. Uses `object-cover` by default
132
+ * so the image scales and crops naturally as the viewport resizes.
133
+ *
134
+ * Must be used inside `<SplitLayoutContentRight flush>`.
135
+ *
136
+ * @example
137
+ * <SplitLayoutContentRight flush>
138
+ * <SplitLayoutImage
139
+ * dataHook="signup-hero"
140
+ * src="/images/signup-step-1.png"
141
+ * alt="Welcome illustration"
142
+ * />
143
+ * </SplitLayoutContentRight>
144
+ */
145
+ declare const SplitLayoutImage: React.ForwardRefExoticComponent<Omit<SplitLayoutImageProps, "ref"> & React.RefAttributes<HTMLImageElement>>;
146
+ export { SplitLayout, SplitLayoutHeader, SplitLayoutContentLeft, SplitLayoutContentRight, SplitLayoutImage, type SplitLayoutProps, type SplitLayoutHeaderProps, type SplitLayoutContentLeftProps, type SplitLayoutContentRightProps, type SplitLayoutImageProps, };
96
147
  //# sourceMappingURL=split-layout.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file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MAAM,CAAC;IACjB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAChC;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,QAAA,MAAM,gBAAgB,6GA8BrB,CAAC;AAQF,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,sBAAsB,EACtB,uBAAuB,EACvB,gBAAgB,EAChB,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,2BAA2B,EAChC,KAAK,4BAA4B,EACjC,KAAK,qBAAqB,GAC3B,CAAC"}
@@ -1,112 +1,139 @@
1
- import { jsxs as h, jsx as n } from "react/jsx-runtime";
1
+ import { jsxs as C, jsx as n } from "react/jsx-runtime";
2
2
  import * as t from "react";
3
- import { cn as i } from "@brightlocal/ui-components/lib/utils";
4
- const x = t.createContext(!1), j = t.forwardRef(
3
+ import { cn as c } from "@brightlocal/ui-components/lib/utils";
4
+ const L = t.createContext(!1), b = t.forwardRef(
5
5
  ({
6
- className: a,
6
+ className: e,
7
7
  dataHook: l,
8
- trackingEl: o,
9
- trackingLabel: s,
10
- left: r,
11
- right: c,
12
- children: L,
13
- ...v
14
- }, w) => {
15
- const d = [], f = [], p = [], y = (e) => {
16
- if (t.isValidElement(e)) {
17
- if (e.type === t.Fragment) {
8
+ trackingEl: a,
9
+ trackingLabel: o,
10
+ left: s,
11
+ right: i,
12
+ children: d,
13
+ ...f
14
+ }, u) => {
15
+ const p = [], y = [], m = [], g = (r) => {
16
+ if (t.isValidElement(r)) {
17
+ if (r.type === t.Fragment) {
18
18
  t.Children.forEach(
19
- e.props.children,
20
- y
19
+ r.props.children,
20
+ g
21
21
  );
22
22
  return;
23
23
  }
24
- e.type === g ? d.push(e) : e.type === u ? p.push(e) : f.push(e);
24
+ r.type === w ? p.push(r) : r.type === h ? m.push(r) : y.push(r);
25
25
  }
26
26
  };
27
- t.Children.forEach(L, y);
28
- const N = r != null || c != null, S = f.length > 0 || p.length > 0, m = N && !S, R = d.length > 0;
29
- return /* @__PURE__ */ h(
27
+ t.Children.forEach(d, g);
28
+ const N = s != null || i != null, S = y.length > 0 || m.length > 0, x = N && !S, R = p.length > 0;
29
+ return /* @__PURE__ */ C(
30
30
  "div",
31
31
  {
32
- ref: w,
33
- className: i(
32
+ ref: u,
33
+ className: c(
34
34
  "flex min-h-screen w-full flex-col lg:flex-row",
35
- a
35
+ e
36
36
  ),
37
37
  "data-hook": l,
38
38
  "data-slot": "split-layout",
39
- "data-tracking-el": o || "split-layout",
40
- "data-tracking-label": s,
41
- ...v,
39
+ "data-tracking-el": a || "split-layout",
40
+ "data-tracking-label": o,
41
+ ...f,
42
42
  children: [
43
43
  /* @__PURE__ */ n(
44
44
  "div",
45
45
  {
46
46
  className: "bg-background flex flex-1 flex-col",
47
47
  "data-slot": "split-layout-body",
48
- children: /* @__PURE__ */ h(x.Provider, { value: R, children: [
49
- d,
50
- m ? r && /* @__PURE__ */ n(C, { children: r }) : f
48
+ children: /* @__PURE__ */ C(L.Provider, { value: R, children: [
49
+ p,
50
+ x ? s && /* @__PURE__ */ n(v, { children: s }) : y
51
51
  ] })
52
52
  }
53
53
  ),
54
- m ? c && /* @__PURE__ */ n(u, { children: c }) : p
54
+ x ? i && /* @__PURE__ */ n(h, { children: i }) : m
55
55
  ]
56
56
  }
57
57
  );
58
58
  }
59
59
  );
60
- j.displayName = "SplitLayout";
61
- const g = t.forwardRef(({ className: a, children: l, ...o }, s) => /* @__PURE__ */ n(
60
+ b.displayName = "SplitLayout";
61
+ const w = t.forwardRef(({ className: e, children: l, ...a }, o) => /* @__PURE__ */ n(
62
62
  "div",
63
63
  {
64
- ref: s,
65
- className: i(
64
+ ref: o,
65
+ className: c(
66
66
  "px-section-sm pt-section-sm flex w-full items-center justify-center lg:justify-start",
67
- a
67
+ e
68
68
  ),
69
69
  "data-slot": "split-layout-header",
70
- ...o,
70
+ ...a,
71
71
  children: l
72
72
  }
73
73
  ));
74
- g.displayName = "SplitLayoutHeader";
75
- const C = t.forwardRef(({ className: a, children: l, ...o }, s) => {
76
- const r = t.useContext(x);
74
+ w.displayName = "SplitLayoutHeader";
75
+ const v = t.forwardRef(({ className: e, children: l, ...a }, o) => {
76
+ const s = t.useContext(L);
77
77
  return /* @__PURE__ */ n(
78
78
  "div",
79
79
  {
80
- ref: s,
81
- className: i(
80
+ ref: o,
81
+ className: c(
82
82
  "p-section-sm flex flex-1 items-center justify-center overflow-auto",
83
- r && "pt-2",
84
- a
83
+ s && "pt-2",
84
+ e
85
85
  ),
86
86
  "data-slot": "split-layout-left",
87
- ...o,
87
+ ...a,
88
88
  children: l
89
89
  }
90
90
  );
91
91
  });
92
- C.displayName = "SplitLayoutContentLeft";
93
- const u = t.forwardRef(({ className: a, children: l, ...o }, s) => /* @__PURE__ */ n(
92
+ v.displayName = "SplitLayoutContentLeft";
93
+ const h = t.forwardRef(({ className: e, flush: l = !1, children: a, ...o }, s) => /* @__PURE__ */ n(
94
94
  "div",
95
95
  {
96
96
  ref: s,
97
- className: i(
98
- "bg-card p-section-sm hidden flex-1 items-center justify-center overflow-auto lg:flex",
99
- a
97
+ className: c(
98
+ "bg-card hidden",
99
+ l ? "relative h-screen overflow-hidden lg:block lg:w-1/2 lg:shrink-0" : "p-section-sm flex-1 items-center justify-center overflow-auto lg:flex",
100
+ e
100
101
  ),
101
102
  "data-slot": "split-layout-right",
102
103
  ...o,
103
- children: l
104
+ children: a
104
105
  }
105
106
  ));
106
- u.displayName = "SplitLayoutContentRight";
107
+ h.displayName = "SplitLayoutContentRight";
108
+ const k = t.forwardRef(
109
+ ({
110
+ className: e,
111
+ dataHook: l,
112
+ src: a,
113
+ alt: o,
114
+ objectFit: s = "cover",
115
+ objectPosition: i = "center",
116
+ style: d,
117
+ ...f
118
+ }, u) => /* @__PURE__ */ n(
119
+ "img",
120
+ {
121
+ ref: u,
122
+ alt: o,
123
+ className: c("absolute inset-0 h-full w-full", e),
124
+ "data-hook": l,
125
+ "data-slot": "split-layout-image",
126
+ src: a,
127
+ style: { objectFit: s, objectPosition: i, ...d },
128
+ ...f
129
+ }
130
+ )
131
+ );
132
+ k.displayName = "SplitLayoutImage";
107
133
  export {
108
- j as SplitLayout,
109
- C as SplitLayoutContentLeft,
110
- u as SplitLayoutContentRight,
111
- g as SplitLayoutHeader
134
+ b as SplitLayout,
135
+ v as SplitLayoutContentLeft,
136
+ h as SplitLayoutContentRight,
137
+ w as SplitLayoutHeader,
138
+ k as SplitLayoutImage
112
139
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightlocal/ui-components",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "description": "BrightLocal Design System UI Components",
5
5
  "type": "module",
6
6
  "private": false,
@@ -33,14 +33,14 @@
33
33
  "import": "./dist/hooks/*.js",
34
34
  "require": "./dist/hooks/*.cjs"
35
35
  },
36
- "./lib/*": {
36
+ "./lib/utils": {
37
37
  "source": {
38
- "types": "./src/lib/*.ts",
39
- "import": "./src/lib/*.ts"
38
+ "types": "./src/lib/utils.ts",
39
+ "import": "./src/lib/utils.ts"
40
40
  },
41
- "types": "./dist/lib/*.d.ts",
42
- "import": "./dist/lib/*.js",
43
- "require": "./dist/lib/*.cjs"
41
+ "types": "./dist/lib/utils.d.ts",
42
+ "import": "./dist/lib/utils.js",
43
+ "require": "./dist/lib/utils.cjs"
44
44
  },
45
45
  "./blocks/*": {
46
46
  "source": {