@brightlocal/ui-components 2.3.0 → 2.5.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/input.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react/jsx-runtime"),b=require("react"),p=require("class-variance-authority"),v=require("@brightlocal/ui-components/lib/utils");function g(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 h=g(b),n=p.cva(["flex w-full min-w-0 h-9","border border-input bg-background rounded-sm","outline-none transition-[border-color,box-shadow,background-color]","text-sm font-sans","text-foreground","overflow-hidden text-ellipsis","focus-visible:outline-none focus-visible:border-ring focus-visible:bg-background","focus-visible:shadow-default","disabled:cursor-not-allowed disabled:opacity-50","placeholder:text-muted-foreground","placeholder:overflow-hidden placeholder:text-ellipsis","items-center px-3 pb-[1px] leading-5","[&::-webkit-calendar-picker-indicator]:hidden"],{variants:{hasIcon:{true:"pl-9",false:""},hasSecondaryIcon:{true:"pr-9",false:""}},defaultVariants:{hasIcon:!1,hasSecondaryIcon:!1}}),s=h.forwardRef(({className:e,hasIcon:r=!1,hasSecondaryIcon:t=!1,dataHook:a,error:l,trackingEl:c,trackingLabel:d,...o},u)=>{const i=l||o["aria-invalid"]===!0||o["aria-invalid"]==="true";return f.jsx("input",{ref:u,"aria-invalid":i?"true":void 0,className:v.cn(n({hasIcon:r,hasSecondaryIcon:t}),i&&"border-destructive-40 focus-visible:border-destructive-40 focus-visible:shadow-destructive",e),"data-hook":a,"data-slot":"input","data-tracking-el":c,"data-tracking-label":d,...o})});s.displayName="Input";exports.Input=s;exports.inputVariants=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react/jsx-runtime"),b=require("react"),p=require("class-variance-authority"),v=require("@brightlocal/ui-components/lib/utils");function g(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 h=g(b),n=p.cva(["flex w-full min-w-0 h-9","border border-input bg-background rounded-sm","outline-none transition-[border-color,box-shadow,background-color]","text-base font-sans","text-foreground","overflow-hidden text-ellipsis","focus-visible:outline-none focus-visible:border-ring focus-visible:bg-background","focus-visible:shadow-default","disabled:cursor-not-allowed disabled:opacity-50","placeholder:text-muted-foreground","placeholder:overflow-hidden placeholder:text-ellipsis","items-center px-3","[&::-webkit-calendar-picker-indicator]:hidden"],{variants:{hasIcon:{true:"pl-9",false:""},hasSecondaryIcon:{true:"pr-9",false:""}},defaultVariants:{hasIcon:!1,hasSecondaryIcon:!1}}),s=h.forwardRef(({className:e,hasIcon:r=!1,hasSecondaryIcon:t=!1,dataHook:a,error:l,trackingEl:c,trackingLabel:d,...o},u)=>{const i=l||o["aria-invalid"]===!0||o["aria-invalid"]==="true";return f.jsx("input",{ref:u,"aria-invalid":i?"true":void 0,className:v.cn(n({hasIcon:r,hasSecondaryIcon:t}),i&&"border-destructive-40 focus-visible:border-destructive-40 focus-visible:shadow-destructive",e),"data-hook":a,"data-slot":"input","data-tracking-el":c,"data-tracking-label":d,...o})});s.displayName="Input";exports.Input=s;exports.inputVariants=n;
@@ -1 +1 @@
1
- {"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../src/components/input.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGlE;;;GAGG;AACH,eAAO,MAAM,aAAa;;;8EAwCzB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,WAAW,UACf,SACE,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC,EACzD,YAAY,CAAC,OAAO,aAAa,CAAC;IACpC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,KAAK,qFAsCjB,CAAC"}
1
+ {"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../src/components/input.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGlE;;;GAGG;AACH,eAAO,MAAM,aAAa;;;8EAuCzB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,WAAW,UACf,SACE,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC,EACzD,YAAY,CAAC,OAAO,aAAa,CAAC;IACpC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,KAAK,qFAsCjB,CAAC"}
package/dist/input.js CHANGED
@@ -10,7 +10,7 @@ const p = f(
10
10
  "border border-input bg-background rounded-sm",
11
11
  "outline-none transition-[border-color,box-shadow,background-color]",
12
12
  // Typography
13
- "text-sm font-sans",
13
+ "text-base font-sans",
14
14
  "text-foreground",
15
15
  "overflow-hidden text-ellipsis",
16
16
  // States - Focus
@@ -21,8 +21,7 @@ const p = f(
21
21
  // Pseudo-elements
22
22
  "placeholder:text-muted-foreground",
23
23
  "placeholder:overflow-hidden placeholder:text-ellipsis",
24
- // Text input alignment - uses design token for text/sm line-height (20px)
25
- "items-center px-3 pb-[1px] leading-5",
24
+ "items-center px-3",
26
25
  // Hide default browser icons for date/time inputs
27
26
  "[&::-webkit-calendar-picker-indicator]:hidden"
28
27
  ],
@@ -46,8 +45,8 @@ const p = f(
46
45
  ({
47
46
  className: o,
48
47
  hasIcon: r = !1,
49
- hasSecondaryIcon: i = !1,
50
- dataHook: t,
48
+ hasSecondaryIcon: t = !1,
49
+ dataHook: i,
51
50
  error: s,
52
51
  trackingEl: d,
53
52
  trackingLabel: n,
@@ -60,11 +59,11 @@ const p = f(
60
59
  ref: l,
61
60
  "aria-invalid": a ? "true" : void 0,
62
61
  className: b(
63
- p({ hasIcon: r, hasSecondaryIcon: i }),
62
+ p({ hasIcon: r, hasSecondaryIcon: t }),
64
63
  a && "border-destructive-40 focus-visible:border-destructive-40 focus-visible:shadow-destructive",
65
64
  o
66
65
  ),
67
- "data-hook": t,
66
+ "data-hook": i,
68
67
  "data-slot": "input",
69
68
  "data-tracking-el": d,
70
69
  "data-tracking-label": n,
@@ -1 +1 @@
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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),h=require("react"),r=require("@brightlocal/ui-components/lib/utils");function S(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 i=S(h),y=i.forwardRef(({className:t,dataHook:a,trackingEl:e,trackingLabel:l,left:s,right:n,children:u,...c},d)=>o.jsxs("div",{ref:d,className:r.cn("group/split-layout bg-background grid min-h-screen w-full grid-cols-1 grid-rows-[auto_1fr] lg:has-[[data-slot=split-layout-right]]:grid-cols-2",t),"data-hook":a,"data-slot":"split-layout","data-tracking-el":e||"split-layout","data-tracking-label":l,...c,children:[u,s&&o.jsx(p,{children:s}),n&&o.jsx(f,{children:n})]}));y.displayName="SplitLayout";const g=i.forwardRef(({className:t,children:a,...e},l)=>o.jsx("div",{ref:l,className:r.cn("px-section-sm pt-section-sm col-start-1 row-start-1 flex w-full items-center justify-center lg:justify-start",t),"data-slot":"split-layout-header",...e,children:a}));g.displayName="SplitLayoutHeader";const p=i.forwardRef(({className:t,children:a,...e},l)=>o.jsx("div",{ref:l,className:r.cn("p-section-sm col-start-1 row-start-2 flex min-h-0 items-center justify-center overflow-auto","group-has-[[data-slot=split-layout-header]]/split-layout:pt-2",t),"data-slot":"split-layout-left",...e,children:a}));p.displayName="SplitLayoutContentLeft";const f=i.forwardRef(({className:t,flush:a=!1,children:e,...l},s)=>o.jsx("div",{ref:s,className:r.cn("bg-card hidden lg:col-start-2 lg:row-span-full lg:row-start-1",a?"relative overflow-hidden lg:block":"p-section-sm min-h-0 items-center justify-center overflow-auto lg:flex",t),"data-slot":"split-layout-right",...l,children:e}));f.displayName="SplitLayoutContentRight";const m=i.forwardRef(({className:t,dataHook:a,src:e,alt:l,objectFit:s="cover",objectPosition:n="center",style:u,...c},d)=>o.jsx("img",{ref:d,alt:l,className:r.cn("absolute inset-0 h-full w-full",t),"data-hook":a,"data-slot":"split-layout-image",src:e,style:{objectFit:s,objectPosition:n,...u},...c}));m.displayName="SplitLayoutImage";exports.SplitLayout=y;exports.SplitLayoutContentLeft=p;exports.SplitLayoutContentRight=f;exports.SplitLayoutHeader=g;exports.SplitLayoutImage=m;
@@ -24,8 +24,10 @@ interface SplitLayoutProps extends React.ComponentProps<"div"> {
24
24
  * and shows only the left section on smaller screens (hiding the right/marketing section).
25
25
  * This pattern is commonly used for authentication pages where the form is prioritized on mobile.
26
26
  *
27
- * Uses a composition pattern with SplitLayoutHeader, SplitLayoutContentLeft,
28
- * and SplitLayoutContentRight sub-components.
27
+ * Uses CSS Grid for slot positioning — sub-components self-place into the correct
28
+ * grid area via their own classes, so SplitLayout renders {children} without
29
+ * inspecting them. This enables composition through any wrapping: Fragments,
30
+ * router Outlets, memoized components, or conditional renders.
29
31
  *
30
32
  * @example
31
33
  * // Basic usage
@@ -52,6 +54,15 @@ interface SplitLayoutProps extends React.ComponentProps<"div"> {
52
54
  * </SplitLayoutContentRight>
53
55
  * </SplitLayout>
54
56
  *
57
+ * @example
58
+ * // With router Outlet — slots project up through any wrapping
59
+ * <SplitLayout dataHook="auth-layout">
60
+ * <SplitLayoutHeader>
61
+ * <Header dataHook="my-header"><Logo dataHook="my-logo" /></Header>
62
+ * </SplitLayoutHeader>
63
+ * <Outlet />
64
+ * </SplitLayout>
65
+ *
55
66
  * Layout specifications:
56
67
  * - Mobile/Tablet: Stacked layout, only left section visible, content centered
57
68
  * - Desktop (≥1024px): Side-by-side, content centered within each section
@@ -70,6 +81,7 @@ interface SplitLayoutHeaderProps extends React.ComponentProps<"div"> {
70
81
  * SplitLayoutHeader component for rendering header content at the top of SplitLayout.
71
82
  * Content is centered on mobile/tablet, left-aligned from lg breakpoint onwards.
72
83
  * Uses section padding tokens for responsive horizontal and vertical padding (16px mobile, 24px desktop).
84
+ * Self-positions in the first column, first row of the grid.
73
85
  */
74
86
  declare const SplitLayoutHeader: React.ForwardRefExoticComponent<Omit<SplitLayoutHeaderProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
75
87
  interface SplitLayoutContentLeftProps extends React.ComponentProps<"div"> {
@@ -79,7 +91,8 @@ interface SplitLayoutContentLeftProps extends React.ComponentProps<"div"> {
79
91
  * SplitLayoutContentLeft - Left/primary section within a SplitLayout.
80
92
  *
81
93
  * Always visible. When a SplitLayoutHeader is present, top padding is
82
- * automatically reduced to avoid excessive spacing below the header.
94
+ * automatically reduced via CSS :has() to avoid excessive spacing below the header.
95
+ * Self-positions in the first column, second row of the grid.
83
96
  */
84
97
  declare const SplitLayoutContentLeft: React.ForwardRefExoticComponent<Omit<SplitLayoutContentLeftProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
85
98
  interface SplitLayoutContentRightProps extends React.ComponentProps<"div"> {
@@ -96,6 +109,7 @@ interface SplitLayoutContentRightProps extends React.ComponentProps<"div"> {
96
109
  *
97
110
  * Hidden on mobile/tablet (<1024px), visible on desktop (≥1024px).
98
111
  * Uses bg-card background color.
112
+ * Self-positions in the second column, spanning all rows of the grid.
99
113
  *
100
114
  * Set `flush` to remove padding for full-bleed content (e.g. images).
101
115
  */
@@ -1 +1 @@
1
- {"version":3,"file":"split-layout.d.ts","sourceRoot":"","sources":["../../src/components/split-layout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAa/B,UAAU,gBAAiB,SAAQ,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC;IAC5D,iDAAiD;IACjD,QAAQ,EAAE,MAAM,CAAC;IACjB,gDAAgD;IAChD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2CAA2C;IAC3C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB;;;OAGG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACzB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyC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AEG;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,139 +1,111 @@
1
- import { jsxs as C, jsx as n } from "react/jsx-runtime";
2
- import * as t from "react";
3
- import { cn as c } from "@brightlocal/ui-components/lib/utils";
4
- const L = t.createContext(!1), b = t.forwardRef(
1
+ import { jsxs as m, jsx as s } from "react/jsx-runtime";
2
+ import * as r from "react";
3
+ import { cn as i } from "@brightlocal/ui-components/lib/utils";
4
+ const y = r.forwardRef(
5
5
  ({
6
- className: e,
7
- dataHook: l,
8
- trackingEl: a,
9
- trackingLabel: o,
10
- left: s,
11
- right: i,
6
+ className: t,
7
+ dataHook: a,
8
+ trackingEl: l,
9
+ trackingLabel: e,
10
+ left: o,
11
+ right: n,
12
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
- t.Children.forEach(
19
- r.props.children,
20
- g
21
- );
22
- return;
23
- }
24
- r.type === w ? p.push(r) : r.type === h ? m.push(r) : y.push(r);
25
- }
26
- };
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
- "div",
31
- {
32
- ref: u,
33
- className: c(
34
- "flex min-h-screen w-full flex-col lg:flex-row",
35
- e
36
- ),
37
- "data-hook": l,
38
- "data-slot": "split-layout",
39
- "data-tracking-el": a || "split-layout",
40
- "data-tracking-label": o,
41
- ...f,
42
- children: [
43
- /* @__PURE__ */ n(
44
- "div",
45
- {
46
- className: "bg-background flex flex-1 flex-col",
47
- "data-slot": "split-layout-body",
48
- children: /* @__PURE__ */ C(L.Provider, { value: R, children: [
49
- p,
50
- x ? s && /* @__PURE__ */ n(v, { children: s }) : y
51
- ] })
52
- }
53
- ),
54
- x ? i && /* @__PURE__ */ n(h, { children: i }) : m
55
- ]
56
- }
57
- );
58
- }
13
+ ...u
14
+ }, c) => /* @__PURE__ */ m(
15
+ "div",
16
+ {
17
+ ref: c,
18
+ className: i(
19
+ "group/split-layout bg-background grid min-h-screen w-full grid-cols-1 grid-rows-[auto_1fr] lg:has-[[data-slot=split-layout-right]]:grid-cols-2",
20
+ t
21
+ ),
22
+ "data-hook": a,
23
+ "data-slot": "split-layout",
24
+ "data-tracking-el": l || "split-layout",
25
+ "data-tracking-label": e,
26
+ ...u,
27
+ children: [
28
+ d,
29
+ o && /* @__PURE__ */ s(p, { children: o }),
30
+ n && /* @__PURE__ */ s(f, { children: n })
31
+ ]
32
+ }
33
+ )
59
34
  );
60
- b.displayName = "SplitLayout";
61
- const w = t.forwardRef(({ className: e, children: l, ...a }, o) => /* @__PURE__ */ n(
35
+ y.displayName = "SplitLayout";
36
+ const g = r.forwardRef(({ className: t, children: a, ...l }, e) => /* @__PURE__ */ s(
62
37
  "div",
63
38
  {
64
- ref: o,
65
- className: c(
66
- "px-section-sm pt-section-sm flex w-full items-center justify-center lg:justify-start",
67
- e
39
+ ref: e,
40
+ className: i(
41
+ "px-section-sm pt-section-sm col-start-1 row-start-1 flex w-full items-center justify-center lg:justify-start",
42
+ t
68
43
  ),
69
44
  "data-slot": "split-layout-header",
70
- ...a,
71
- children: l
45
+ ...l,
46
+ children: a
72
47
  }
73
48
  ));
74
- w.displayName = "SplitLayoutHeader";
75
- const v = t.forwardRef(({ className: e, children: l, ...a }, o) => {
76
- const s = t.useContext(L);
77
- return /* @__PURE__ */ n(
78
- "div",
79
- {
80
- ref: o,
81
- className: c(
82
- "p-section-sm flex flex-1 items-center justify-center overflow-auto",
83
- s && "pt-2",
84
- e
85
- ),
86
- "data-slot": "split-layout-left",
87
- ...a,
88
- children: l
89
- }
90
- );
91
- });
92
- v.displayName = "SplitLayoutContentLeft";
93
- const h = t.forwardRef(({ className: e, flush: l = !1, children: a, ...o }, s) => /* @__PURE__ */ n(
49
+ g.displayName = "SplitLayoutHeader";
50
+ const p = r.forwardRef(({ className: t, children: a, ...l }, e) => /* @__PURE__ */ s(
94
51
  "div",
95
52
  {
96
- ref: s,
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
53
+ ref: e,
54
+ className: i(
55
+ "p-section-sm col-start-1 row-start-2 flex min-h-0 items-center justify-center overflow-auto",
56
+ "group-has-[[data-slot=split-layout-header]]/split-layout:pt-2",
57
+ t
101
58
  ),
102
- "data-slot": "split-layout-right",
103
- ...o,
59
+ "data-slot": "split-layout-left",
60
+ ...l,
104
61
  children: a
105
62
  }
106
63
  ));
107
- h.displayName = "SplitLayoutContentRight";
108
- const k = t.forwardRef(
64
+ p.displayName = "SplitLayoutContentLeft";
65
+ const f = r.forwardRef(({ className: t, flush: a = !1, children: l, ...e }, o) => /* @__PURE__ */ s(
66
+ "div",
67
+ {
68
+ ref: o,
69
+ className: i(
70
+ "bg-card hidden lg:col-start-2 lg:row-span-full lg:row-start-1",
71
+ a ? "relative overflow-hidden lg:block" : "p-section-sm min-h-0 items-center justify-center overflow-auto lg:flex",
72
+ t
73
+ ),
74
+ "data-slot": "split-layout-right",
75
+ ...e,
76
+ children: l
77
+ }
78
+ ));
79
+ f.displayName = "SplitLayoutContentRight";
80
+ const h = r.forwardRef(
109
81
  ({
110
- className: e,
111
- dataHook: l,
112
- src: a,
113
- alt: o,
114
- objectFit: s = "cover",
115
- objectPosition: i = "center",
82
+ className: t,
83
+ dataHook: a,
84
+ src: l,
85
+ alt: e,
86
+ objectFit: o = "cover",
87
+ objectPosition: n = "center",
116
88
  style: d,
117
- ...f
118
- }, u) => /* @__PURE__ */ n(
89
+ ...u
90
+ }, c) => /* @__PURE__ */ s(
119
91
  "img",
120
92
  {
121
- ref: u,
122
- alt: o,
123
- className: c("absolute inset-0 h-full w-full", e),
124
- "data-hook": l,
93
+ ref: c,
94
+ alt: e,
95
+ className: i("absolute inset-0 h-full w-full", t),
96
+ "data-hook": a,
125
97
  "data-slot": "split-layout-image",
126
- src: a,
127
- style: { objectFit: s, objectPosition: i, ...d },
128
- ...f
98
+ src: l,
99
+ style: { objectFit: o, objectPosition: n, ...d },
100
+ ...u
129
101
  }
130
102
  )
131
103
  );
132
- k.displayName = "SplitLayoutImage";
104
+ h.displayName = "SplitLayoutImage";
133
105
  export {
134
- b as SplitLayout,
135
- v as SplitLayoutContentLeft,
136
- h as SplitLayoutContentRight,
137
- w as SplitLayoutHeader,
138
- k as SplitLayoutImage
106
+ y as SplitLayout,
107
+ p as SplitLayoutContentLeft,
108
+ f as SplitLayoutContentRight,
109
+ g as SplitLayoutHeader,
110
+ h as SplitLayoutImage
139
111
  };
package/dist/table.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),y=require("react"),b=require("class-variance-authority"),r=require("@brightlocal/ui-components/lib/utils");function w(a){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const e in a)if(e!=="default"){const o=Object.getOwnPropertyDescriptor(a,e);Object.defineProperty(t,e,o.get?o:{enumerable:!0,get:()=>a[e]})}}return t.default=a,Object.freeze(t)}const s=w(y),N=b.cva("align-middle bg-transparent text-foreground text-sm font-normal leading-normal break-words",{variants:{size:{default:"h-12 p-2",md:"h-16 p-2",lg:"h-24 p-2"},align:{left:"text-left",right:"text-right"}},defaultVariants:{size:"default",align:"left"}}),j=b.cva("h-10 p-2 border-b align-middle text-muted-foreground text-sm font-medium leading-normal hover:bg-muted break-words outline-none focus-visible:shadow-default transition-[background-color,box-shadow] duration-150 ease-in-out",{variants:{align:{left:"text-left",right:"text-right"}},defaultVariants:{align:"left"}}),c=s.forwardRef(({className:a,dataHook:t,trackingEl:e,trackingLabel:o,...d},n)=>l.jsx("div",{className:"relative w-full overflow-x-auto","data-slot":"table-container",children:l.jsx("table",{ref:n,className:r.cn("w-full caption-bottom text-sm",a),"data-hook":t,"data-slot":"table","data-tracking-el":e,"data-tracking-label":o,...d})}));c.displayName="Table";const f=s.forwardRef(({className:a,dataHook:t,...e},o)=>l.jsx("thead",{ref:o,className:r.cn("[&_tr]:border-b",a),"data-hook":t,"data-slot":"table-header",...e}));f.displayName="TableHeader";const u=s.forwardRef(({className:a,dataHook:t,...e},o)=>l.jsx("tbody",{ref:o,className:r.cn("[&_tr:last-child]:border-0",a),"data-hook":t,"data-slot":"table-body",...e}));u.displayName="TableBody";const m=s.forwardRef(({className:a,dataHook:t,...e},o)=>l.jsx("tfoot",{ref:o,className:r.cn("bg-muted/50 border-t [&>tr]:last:border-b-0",a),"data-hook":t,"data-slot":"table-footer",...e}));m.displayName="TableFooter";const g=s.forwardRef(({className:a,dataHook:t,...e},o)=>l.jsx("tr",{ref:o,className:r.cn("data-[state=selected]:bg-muted border-b transition-colors duration-150 ease-in-out",a),"data-hook":t,"data-slot":"table-row",...e}));g.displayName="TableRow";const h=s.forwardRef(({className:a,dataHook:t,align:e,minWidth:o,style:d,...n},i)=>l.jsx("th",{ref:i,className:r.cn(j({align:e}),a),"data-hook":t,"data-slot":"table-head",style:{minWidth:o,...d},...n}));h.displayName="TableHead";const p=s.forwardRef(({className:a,dataHook:t,size:e,align:o,minWidth:d,style:n,...i},x)=>l.jsx("td",{ref:x,className:r.cn(N({size:e,align:o}),a),"data-hook":t,"data-slot":"table-cell",style:{minWidth:d,...n},...i}));p.displayName="TableCell";const T=s.forwardRef(({className:a,dataHook:t,...e},o)=>l.jsx("caption",{ref:o,className:r.cn("text-muted-foreground mt-4 text-sm",a),"data-hook":t,"data-slot":"table-caption",...e}));T.displayName="TableCaption";exports.Table=c;exports.TableBody=u;exports.TableCaption=T;exports.TableCell=p;exports.TableFooter=m;exports.TableHead=h;exports.TableHeader=f;exports.TableRow=g;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),y=require("react"),b=require("class-variance-authority"),r=require("@brightlocal/ui-components/lib/utils");function w(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const l=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,l.get?l:{enumerable:!0,get:()=>e[a]})}}return t.default=e,Object.freeze(t)}const s=w(y),N=b.cva("align-middle bg-transparent text-foreground text-sm font-normal leading-normal break-words",{variants:{size:{default:"h-12 p-2",md:"h-16 p-2",lg:"h-24 p-2"},align:{left:"text-left",right:"text-right",center:"text-center"}},defaultVariants:{size:"default",align:"left"}}),j=b.cva("h-10 p-2 align-middle text-muted-foreground text-sm font-medium leading-normal hover:bg-muted break-words outline-none focus-visible:shadow-default transition-[background-color,box-shadow] duration-150 ease-in-out",{variants:{align:{left:"text-left",right:"text-right",center:"text-center"}},defaultVariants:{align:"left"}}),f=s.forwardRef(({className:e,dataHook:t,trackingEl:a,trackingLabel:l,...n},d)=>o.jsx("div",{className:"relative w-full overflow-x-auto","data-slot":"table-container",children:o.jsx("table",{ref:d,className:r.cn("w-full caption-bottom text-sm",e),"data-hook":t,"data-slot":"table","data-tracking-el":a,"data-tracking-label":l,...n})}));f.displayName="Table";const u=s.forwardRef(({className:e,dataHook:t,...a},l)=>o.jsx("thead",{ref:l,className:r.cn(e),"data-hook":t,"data-slot":"table-header",...a}));u.displayName="TableHeader";const m=s.forwardRef(({className:e,dataHook:t,...a},l)=>o.jsx("tbody",{ref:l,className:r.cn(e),"data-hook":t,"data-slot":"table-body",...a}));m.displayName="TableBody";const g=s.forwardRef(({className:e,dataHook:t,...a},l)=>o.jsx("tfoot",{ref:l,className:r.cn("bg-muted/50",e),"data-hook":t,"data-slot":"table-footer",...a}));g.displayName="TableFooter";const p=s.forwardRef(({className:e,dataHook:t,...a},l)=>o.jsx("tr",{ref:l,className:r.cn("data-[state=selected]:bg-muted transition-colors duration-150 ease-in-out",e),"data-hook":t,"data-slot":"table-row",...a}));p.displayName="TableRow";const x=s.forwardRef(({className:e,dataHook:t,align:a,minWidth:l,style:n,scope:d="col",...i},c)=>o.jsx("th",{ref:c,className:r.cn(j({align:a}),e),"data-hook":t,"data-slot":"table-head",scope:d,style:{minWidth:l,...n},...i}));x.displayName="TableHead";const T=s.forwardRef(({className:e,dataHook:t,size:a,align:l,minWidth:n,style:d,...i},c)=>o.jsx("td",{ref:c,className:r.cn(N({size:a,align:l}),e),"data-hook":t,"data-slot":"table-cell",style:{minWidth:n,...d},...i}));T.displayName="TableCell";const h=s.forwardRef(({className:e,dataHook:t,...a},l)=>o.jsx("caption",{ref:l,className:r.cn("text-muted-foreground mt-4 text-center text-sm",e),"data-hook":t,"data-slot":"table-caption",...a}));h.displayName="TableCaption";exports.Table=f;exports.TableBody=m;exports.TableCaption=h;exports.TableCell=T;exports.TableFooter=g;exports.TableHead=x;exports.TableHeader=u;exports.TableRow=p;
package/dist/table.d.ts CHANGED
@@ -2,10 +2,10 @@ import { VariantProps } from 'class-variance-authority';
2
2
  import * as React from "react";
3
3
  declare const tableCellVariants: (props?: ({
4
4
  size?: "default" | "lg" | "md" | null | undefined;
5
- align?: "left" | "right" | null | undefined;
5
+ align?: "center" | "left" | "right" | null | undefined;
6
6
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
7
7
  declare const tableHeadVariants: (props?: ({
8
- align?: "left" | "right" | null | undefined;
8
+ align?: "center" | "left" | "right" | null | undefined;
9
9
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
10
10
  interface TableProps extends React.ComponentProps<"table"> {
11
11
  /**
@@ -60,10 +60,10 @@ interface TableHeadProps extends Omit<React.ComponentProps<"th">, "align">, Vari
60
60
  */
61
61
  minWidth?: string;
62
62
  /**
63
- * Text alignment for the header cell
63
+ * Text alignment for the header cell.
64
64
  * @default "left"
65
65
  */
66
- align?: "left" | "right";
66
+ align?: "left" | "right" | "center";
67
67
  }
68
68
  declare const TableHead: React.ForwardRefExoticComponent<Omit<TableHeadProps, "ref"> & React.RefAttributes<HTMLTableCellElement>>;
69
69
  interface TableCellProps extends Omit<React.ComponentProps<"td">, "align">, VariantProps<typeof tableCellVariants> {
@@ -81,10 +81,10 @@ interface TableCellProps extends Omit<React.ComponentProps<"td">, "align">, Vari
81
81
  */
82
82
  size?: "default" | "md" | "lg";
83
83
  /**
84
- * Text alignment for the cell
84
+ * Text alignment for the cell.
85
85
  * @default "left"
86
86
  */
87
- align?: "left" | "right";
87
+ align?: "left" | "right" | "center";
88
88
  }
89
89
  declare const TableCell: React.ForwardRefExoticComponent<Omit<TableCellProps, "ref"> & React.RefAttributes<HTMLTableCellElement>>;
90
90
  interface TableCaptionProps extends React.ComponentProps<"caption"> {
@@ -1 +1 @@
1
- {"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../src/components/table.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAIlE,QAAA,MAAM,iBAAiB;;;8EAmBtB,CAAC;AAEF,QAAA,MAAM,iBAAiB;;8EAatB,CAAC;AAEF,UAAU,UAAW,SAAQ,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC;IACxD;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,M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B,SAAQ,KAAK,CAAC,cAAc,CAAC,SAAS,CAAC;IACjE;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,QAAA,MAAM,YAAY,gHAWhB,CAAC;AAQH,OAAO,EACL,KAAK,EACL,WAAW,EACX,SAAS,EACT,WAAW,EACX,SAAS,EACT,QAAQ,EACR,SAAS,EACT,YAAY,GACb,CAAC;AAEF,YAAY,EACV,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,cAAc,EACd,iBAAiB,GAClB,CAAC"}
package/dist/table.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { jsx as l } from "react/jsx-runtime";
2
2
  import * as d from "react";
3
- import { cva as b } from "class-variance-authority";
3
+ import { cva as f } from "class-variance-authority";
4
4
  import { cn as r } from "@brightlocal/ui-components/lib/utils";
5
- const f = b(
5
+ const b = f(
6
6
  "align-middle bg-transparent text-foreground text-sm font-normal leading-normal break-words",
7
7
  {
8
8
  variants: {
@@ -13,7 +13,8 @@ const f = b(
13
13
  },
14
14
  align: {
15
15
  left: "text-left",
16
- right: "text-right"
16
+ right: "text-right",
17
+ center: "text-center"
17
18
  }
18
19
  },
19
20
  defaultVariants: {
@@ -21,21 +22,22 @@ const f = b(
21
22
  align: "left"
22
23
  }
23
24
  }
24
- ), c = b(
25
- "h-10 p-2 border-b align-middle text-muted-foreground text-sm font-medium leading-normal hover:bg-muted break-words outline-none focus-visible:shadow-default transition-[background-color,box-shadow] duration-150 ease-in-out",
25
+ ), c = f(
26
+ "h-10 p-2 align-middle text-muted-foreground text-sm font-medium leading-normal hover:bg-muted break-words outline-none focus-visible:shadow-default transition-[background-color,box-shadow] duration-150 ease-in-out",
26
27
  {
27
28
  variants: {
28
29
  align: {
29
30
  left: "text-left",
30
- right: "text-right"
31
+ right: "text-right",
32
+ center: "text-center"
31
33
  }
32
34
  },
33
35
  defaultVariants: {
34
36
  align: "left"
35
37
  }
36
38
  }
37
- ), h = d.forwardRef(
38
- ({ className: a, dataHook: t, trackingEl: e, trackingLabel: o, ...s }, i) => /* @__PURE__ */ l(
39
+ ), u = d.forwardRef(
40
+ ({ className: a, dataHook: t, trackingEl: e, trackingLabel: o, ...s }, n) => /* @__PURE__ */ l(
39
41
  "div",
40
42
  {
41
43
  className: "relative w-full overflow-x-auto",
@@ -43,7 +45,7 @@ const f = b(
43
45
  children: /* @__PURE__ */ l(
44
46
  "table",
45
47
  {
46
- ref: i,
48
+ ref: n,
47
49
  className: r("w-full caption-bottom text-sm", a),
48
50
  "data-hook": t,
49
51
  "data-slot": "table",
@@ -55,26 +57,26 @@ const f = b(
55
57
  }
56
58
  )
57
59
  );
58
- h.displayName = "Table";
59
- const u = d.forwardRef(
60
+ u.displayName = "Table";
61
+ const h = d.forwardRef(
60
62
  ({ className: a, dataHook: t, ...e }, o) => /* @__PURE__ */ l(
61
63
  "thead",
62
64
  {
63
65
  ref: o,
64
- className: r("[&_tr]:border-b", a),
66
+ className: r(a),
65
67
  "data-hook": t,
66
68
  "data-slot": "table-header",
67
69
  ...e
68
70
  }
69
71
  )
70
72
  );
71
- u.displayName = "TableHeader";
73
+ h.displayName = "TableHeader";
72
74
  const g = d.forwardRef(
73
75
  ({ className: a, dataHook: t, ...e }, o) => /* @__PURE__ */ l(
74
76
  "tbody",
75
77
  {
76
78
  ref: o,
77
- className: r("[&_tr:last-child]:border-0", a),
79
+ className: r(a),
78
80
  "data-hook": t,
79
81
  "data-slot": "table-body",
80
82
  ...e
@@ -87,7 +89,7 @@ const p = d.forwardRef(
87
89
  "tfoot",
88
90
  {
89
91
  ref: o,
90
- className: r("bg-muted/50 border-t [&>tr]:last:border-b-0", a),
92
+ className: r("bg-muted/50", a),
91
93
  "data-hook": t,
92
94
  "data-slot": "table-footer",
93
95
  ...e
@@ -101,7 +103,7 @@ const w = d.forwardRef(
101
103
  {
102
104
  ref: o,
103
105
  className: r(
104
- "data-[state=selected]:bg-muted border-b transition-colors duration-150 ease-in-out",
106
+ "data-[state=selected]:bg-muted transition-colors duration-150 ease-in-out",
105
107
  a
106
108
  ),
107
109
  "data-hook": t,
@@ -111,52 +113,53 @@ const w = d.forwardRef(
111
113
  )
112
114
  );
113
115
  w.displayName = "TableRow";
114
- const N = d.forwardRef(
115
- ({ className: a, dataHook: t, align: e, minWidth: o, style: s, ...i }, n) => /* @__PURE__ */ l(
116
+ const x = d.forwardRef(
117
+ ({ className: a, dataHook: t, align: e, minWidth: o, style: s, scope: n = "col", ...i }, m) => /* @__PURE__ */ l(
116
118
  "th",
117
119
  {
118
- ref: n,
120
+ ref: m,
119
121
  className: r(c({ align: e }), a),
120
122
  "data-hook": t,
121
123
  "data-slot": "table-head",
124
+ scope: n,
122
125
  style: { minWidth: o, ...s },
123
126
  ...i
124
127
  }
125
128
  )
126
129
  );
127
- N.displayName = "TableHead";
128
- const T = d.forwardRef(
129
- ({ className: a, dataHook: t, size: e, align: o, minWidth: s, style: i, ...n }, m) => /* @__PURE__ */ l(
130
+ x.displayName = "TableHead";
131
+ const N = d.forwardRef(
132
+ ({ className: a, dataHook: t, size: e, align: o, minWidth: s, style: n, ...i }, m) => /* @__PURE__ */ l(
130
133
  "td",
131
134
  {
132
135
  ref: m,
133
- className: r(f({ size: e, align: o }), a),
136
+ className: r(b({ size: e, align: o }), a),
134
137
  "data-hook": t,
135
138
  "data-slot": "table-cell",
136
- style: { minWidth: s, ...i },
137
- ...n
139
+ style: { minWidth: s, ...n },
140
+ ...i
138
141
  }
139
142
  )
140
143
  );
141
- T.displayName = "TableCell";
142
- const x = d.forwardRef(({ className: a, dataHook: t, ...e }, o) => /* @__PURE__ */ l(
144
+ N.displayName = "TableCell";
145
+ const T = d.forwardRef(({ className: a, dataHook: t, ...e }, o) => /* @__PURE__ */ l(
143
146
  "caption",
144
147
  {
145
148
  ref: o,
146
- className: r("text-muted-foreground mt-4 text-sm", a),
149
+ className: r("text-muted-foreground mt-4 text-center text-sm", a),
147
150
  "data-hook": t,
148
151
  "data-slot": "table-caption",
149
152
  ...e
150
153
  }
151
154
  ));
152
- x.displayName = "TableCaption";
155
+ T.displayName = "TableCaption";
153
156
  export {
154
- h as Table,
157
+ u as Table,
155
158
  g as TableBody,
156
- x as TableCaption,
157
- T as TableCell,
159
+ T as TableCaption,
160
+ N as TableCell,
158
161
  p as TableFooter,
159
- N as TableHead,
160
- u as TableHeader,
162
+ x as TableHead,
163
+ h as TableHeader,
161
164
  w as TableRow
162
165
  };
package/dist/textarea.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),u=require("react"),l=require("class-variance-authority"),b=require("@brightlocal/ui-components/lib/utils");function f(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 g=f(u),v=l.cva(["flex w-full","border border-input bg-background rounded-md","outline-none transition-[border-color,background-color,box-shadow]","text-sm leading-normal font-sans","text-foreground","px-3 py-2","focus-visible:outline-none focus-visible:border-ring focus-visible:bg-background","focus-visible:shadow-default","disabled:cursor-not-allowed disabled:opacity-50","placeholder:text-muted-foreground"]),n=g.forwardRef(({className:e,dataHook:r,error:t,trackingEl:a,trackingLabel:s,...o},c)=>{const i=t||o["aria-invalid"]===!0||o["aria-invalid"]==="true";return d.jsx("textarea",{ref:c,"aria-invalid":i?"true":void 0,className:b.cn(v(),i&&"border-destructive-40 focus-visible:border-destructive-40 focus-visible:shadow-destructive",e),"data-hook":r,"data-slot":"textarea","data-tracking-el":a,"data-tracking-label":s,...o})});n.displayName="Textarea";exports.Textarea=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),u=require("react"),l=require("class-variance-authority"),b=require("@brightlocal/ui-components/lib/utils");function f(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 g=f(u),v=l.cva(["flex w-full","border border-input bg-background rounded-md","outline-none transition-[border-color,background-color,box-shadow]","text-base leading-normal font-sans","text-foreground","px-3 py-2","focus-visible:outline-none focus-visible:border-ring focus-visible:bg-background","focus-visible:shadow-default","disabled:cursor-not-allowed disabled:opacity-50","placeholder:text-muted-foreground"]),n=g.forwardRef(({className:e,dataHook:r,error:t,trackingEl:a,trackingLabel:s,...o},c)=>{const i=t||o["aria-invalid"]===!0||o["aria-invalid"]==="true";return d.jsx("textarea",{ref:c,"aria-invalid":i?"true":void 0,className:b.cn(v(),i&&"border-destructive-40 focus-visible:border-destructive-40 focus-visible:shadow-destructive",e),"data-hook":r,"data-slot":"textarea","data-tracking-el":a,"data-tracking-label":s,...o})});n.displayName="Textarea";exports.Textarea=n;