@brightlocal/ui-components 1.1.1 → 1.2.1
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/AI_USAGE.md +390 -0
- package/README.md +45 -10
- package/component-meta.json +1488 -0
- package/dist/blocks/input-list.cjs +2 -0
- package/dist/blocks/input-list.d.ts +93 -0
- package/dist/blocks/input-list.d.ts.map +1 -0
- package/dist/blocks/input-list.js +215 -0
- package/dist/blocks/sidebar.d.ts.map +1 -1
- package/dist/breadcrumb.cjs +1 -1
- package/dist/breadcrumb.d.ts.map +1 -1
- package/dist/breadcrumb.js +17 -14
- package/dist/button.cjs +1 -1
- package/dist/button.d.ts.map +1 -1
- package/dist/button.js +9 -8
- package/dist/calendar.cjs +1 -1
- package/dist/calendar.js +1 -1
- package/dist/card.cjs +1 -1
- package/dist/card.d.ts.map +1 -1
- package/dist/card.js +20 -16
- package/dist/centred-layout.cjs +1 -1
- package/dist/centred-layout.js +1 -1
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.d.ts.map +1 -1
- package/dist/checkbox.js +8 -10
- package/dist/combobox.cjs +1 -1
- package/dist/combobox.d.ts +12 -1
- package/dist/combobox.d.ts.map +1 -1
- package/dist/combobox.js +87 -79
- package/dist/command.cjs +1 -1
- package/dist/command.d.ts.map +1 -1
- package/dist/command.js +60 -50
- package/dist/date-picker.cjs +1 -1
- package/dist/date-picker.d.ts.map +1 -1
- package/dist/date-picker.js +66 -57
- package/dist/field.cjs +1 -1
- package/dist/field.d.ts.map +1 -1
- package/dist/field.js +2 -2
- package/dist/header.cjs +1 -1
- package/dist/header.d.ts +4 -0
- package/dist/header.d.ts.map +1 -1
- package/dist/header.js +33 -13
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +281 -268
- package/dist/input-chip.cjs +1 -1
- package/dist/input-chip.js +2 -2
- package/dist/input-group.cjs +1 -1
- package/dist/input-group.js +17 -17
- package/dist/input-otp.cjs +1 -1
- package/dist/input-otp.d.ts.map +1 -1
- package/dist/input-otp.js +20 -20
- package/dist/input-password.cjs +1 -1
- package/dist/input-password.d.ts.map +1 -1
- package/dist/input-password.js +33 -25
- package/dist/input.cjs +1 -1
- package/dist/input.js +15 -15
- package/dist/label.d.ts.map +1 -1
- package/dist/link.cjs +1 -1
- package/dist/link.d.ts.map +1 -1
- package/dist/link.js +24 -25
- package/dist/list.cjs +1 -0
- package/dist/list.d.ts +104 -0
- package/dist/list.d.ts.map +1 -0
- package/dist/list.js +145 -0
- package/dist/navigation-menu.cjs +1 -1
- package/dist/navigation-menu.d.ts.map +1 -1
- package/dist/navigation-menu.js +6 -5
- package/dist/radio-group.cjs +1 -1
- package/dist/radio-group.js +20 -20
- package/dist/select.cjs +1 -1
- package/dist/select.js +1 -1
- package/dist/sheet.d.ts.map +1 -1
- package/dist/sonner.cjs +1 -1
- package/dist/sonner.d.ts +10 -4
- package/dist/sonner.d.ts.map +1 -1
- package/dist/sonner.js +69 -56
- package/dist/split-layout.cjs +1 -1
- package/dist/split-layout.d.ts +66 -15
- package/dist/split-layout.d.ts.map +1 -1
- package/dist/split-layout.js +100 -96
- package/dist/switch.cjs +1 -1
- package/dist/switch.d.ts.map +1 -1
- package/dist/switch.js +2 -2
- package/dist/textarea.cjs +1 -1
- package/dist/textarea.js +1 -1
- package/dist/tooltip.cjs +1 -1
- package/dist/tooltip.d.ts.map +1 -1
- package/dist/tooltip.js +40 -38
- package/package.json +5 -1
- package/src/blocks/input-list.tsx +366 -0
- package/src/blocks/sidebar.tsx +7 -7
- package/src/components/breadcrumb.tsx +4 -1
- package/src/components/button.tsx +1 -0
- package/src/components/calendar.tsx +1 -1
- package/src/components/card.tsx +8 -4
- package/src/components/centred-layout.tsx +1 -1
- package/src/components/checkbox.tsx +2 -4
- package/src/components/combobox.tsx +21 -2
- package/src/components/command.tsx +25 -9
- package/src/components/date-picker.tsx +15 -5
- package/src/components/dropdown-menu.tsx +3 -3
- package/src/components/field.tsx +5 -3
- package/src/components/header.tsx +28 -2
- package/src/components/input-chip.tsx +2 -2
- package/src/components/input-group.tsx +4 -4
- package/src/components/input-otp.tsx +7 -3
- package/src/components/input-password.tsx +8 -2
- package/src/components/input.tsx +1 -1
- package/src/components/label.tsx +1 -4
- package/src/components/link.tsx +3 -4
- package/src/components/list.tsx +290 -0
- package/src/components/navigation-menu.tsx +1 -0
- package/src/components/radio-group.tsx +2 -2
- package/src/components/select.tsx +3 -3
- package/src/components/sheet.tsx +2 -2
- package/src/components/sonner.tsx +65 -38
- package/src/components/split-layout.tsx +200 -79
- package/src/components/switch.tsx +6 -4
- package/src/components/textarea.tsx +1 -1
- package/src/components/tooltip.tsx +4 -2
- package/src/index.ts +2 -0
package/dist/sonner.d.ts
CHANGED
|
@@ -36,6 +36,8 @@ export type SonnerColorSchema = "default" | "success";
|
|
|
36
36
|
type SonnerCustomOptions = {
|
|
37
37
|
className?: string;
|
|
38
38
|
id?: string | number;
|
|
39
|
+
/** Duration in ms before the toast auto-dismisses. Set to `Infinity` for a persistent toast that can only be dismissed programmatically via `sonner.dismiss(id)` or through an action button. @default 4000 */
|
|
40
|
+
duration?: number;
|
|
39
41
|
};
|
|
40
42
|
/**
|
|
41
43
|
* Input type for creating a toast. The `id` is optional as it will be generated if not provided.
|
|
@@ -43,7 +45,12 @@ type SonnerCustomOptions = {
|
|
|
43
45
|
type ToastInput = Omit<ToastProps, "id"> & {
|
|
44
46
|
id?: string | number;
|
|
45
47
|
};
|
|
46
|
-
|
|
48
|
+
interface SonnerFn {
|
|
49
|
+
(toast: ToastInput, options?: SonnerCustomOptions): void;
|
|
50
|
+
/** Dismiss a toast by its `id`. */
|
|
51
|
+
dismiss: (id: string | number) => void;
|
|
52
|
+
}
|
|
53
|
+
declare const sonner: SonnerFn;
|
|
47
54
|
/**
|
|
48
55
|
* Sonner toaster component that must be mounted once in your application root.
|
|
49
56
|
* This component manages the toast container and handles toast display, stacking, and animations.
|
|
@@ -130,7 +137,6 @@ declare namespace Sonner {
|
|
|
130
137
|
* ```tsx
|
|
131
138
|
* // 1. Mount the Sonner component in your app root
|
|
132
139
|
* import { Sonner } from './sonner';
|
|
133
|
-
* import { toast } from 'sonner';
|
|
134
140
|
*
|
|
135
141
|
* <Sonner />
|
|
136
142
|
*
|
|
@@ -167,14 +173,14 @@ declare namespace Sonner {
|
|
|
167
173
|
* // After operation completes, dismiss the loading toast and show success
|
|
168
174
|
* try {
|
|
169
175
|
* await uploadFile();
|
|
170
|
-
*
|
|
176
|
+
* sonner.dismiss(loadingToastId);
|
|
171
177
|
* sonner({
|
|
172
178
|
* title: "Upload complete!",
|
|
173
179
|
* icon: "success",
|
|
174
180
|
* colorSchema: "success"
|
|
175
181
|
* });
|
|
176
182
|
* } catch (error) {
|
|
177
|
-
*
|
|
183
|
+
* sonner.dismiss(loadingToastId);
|
|
178
184
|
* sonner({
|
|
179
185
|
* title: "Upload failed",
|
|
180
186
|
* description: error.message,
|
package/dist/sonner.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sonner.d.ts","sourceRoot":"","sources":["../../src/components/sonner.tsx"],"names":[],"mappings":"AAeA;;;;GAIG;AACH,KAAK,UAAU,GAAG;IAChB,2CAA2C;IAC3C,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,yCAAyC;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,0DAA0D;IAC1D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2CAA2C;IAC3C,MAAM,CAAC,EAAE;QACP,wBAAwB;QACxB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,mCAAmC;QACnC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;QACrB,mCAAmC;QACnC,OAAO,CAAC,EACJ,SAAS,GACT,aAAa,GACb,SAAS,GACT,WAAW,GACX,OAAO,GACP,SAAS,CAAC;KACf,CAAC;IACF,gCAAgC;IAChC,WAAW,CAAC,EAAE,iBAAiB,CAAC;IAChC,mCAAmC;IACnC,IAAI,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;CAC7B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;AAE9E,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,IAAI,CAAC;AAE9C;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,SAAS,CAAC;AAEtD,KAAK,mBAAmB,GAAG;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"sonner.d.ts","sourceRoot":"","sources":["../../src/components/sonner.tsx"],"names":[],"mappings":"AAeA;;;;GAIG;AACH,KAAK,UAAU,GAAG;IAChB,2CAA2C;IAC3C,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,yCAAyC;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,0DAA0D;IAC1D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2CAA2C;IAC3C,MAAM,CAAC,EAAE;QACP,wBAAwB;QACxB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,mCAAmC;QACnC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;QACrB,mCAAmC;QACnC,OAAO,CAAC,EACJ,SAAS,GACT,aAAa,GACb,SAAS,GACT,WAAW,GACX,OAAO,GACP,SAAS,CAAC;KACf,CAAC;IACF,gCAAgC;IAChC,WAAW,CAAC,EAAE,iBAAiB,CAAC;IAChC,mCAAmC;IACnC,IAAI,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;CAC7B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;AAE9E,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,IAAI,CAAC;AAE9C;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,SAAS,CAAC;AAEtD,KAAK,mBAAmB,GAAG;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,+MAA+M;IAC/M,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;GAEG;AACH,KAAK,UAAU,GAAG,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,GAAG;IAAE,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,CAAC;AAuGpE,UAAU,QAAQ;IAChB,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAAC;IACzD,mCAAmC;IACnC,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAC;CACxC;AAED,QAAA,MAAM,MAAM,EAAE,QA+Cb,CAAC;AAyDF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkEG;AACH,iBAAS,MAAM,4CAEd;kBAFQ,MAAM;;;AAKf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkEG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC"}
|
package/dist/sonner.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsx as o, jsxs as
|
|
1
|
+
import { jsx as o, jsxs as u } from "react/jsx-runtime";
|
|
2
2
|
import { Loader2 as S, XCircle as p, AlertTriangle as b, CheckCircle2 as g, Info as v } from "@brightlocal/icons";
|
|
3
|
-
import { cva as
|
|
4
|
-
import { Toaster as
|
|
5
|
-
import { Button as
|
|
3
|
+
import { cva as d } from "class-variance-authority";
|
|
4
|
+
import { Toaster as x, toast as f } from "sonner";
|
|
5
|
+
import { Button as N } from "@brightlocal/ui-components/button";
|
|
6
6
|
import { cn as a } from "@brightlocal/ui-components/lib/utils";
|
|
7
|
-
const I =
|
|
7
|
+
const I = 4e3, T = d(
|
|
8
8
|
[
|
|
9
9
|
"flex",
|
|
10
10
|
"items-center",
|
|
@@ -30,100 +30,113 @@ const I = i(
|
|
|
30
30
|
colorSchema: "default"
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
-
),
|
|
33
|
+
), k = d("text-sm leading-normal font-medium", {
|
|
34
34
|
variants: {
|
|
35
35
|
colorSchema: {
|
|
36
36
|
default: "text-foreground",
|
|
37
|
-
success: "text-green-900"
|
|
37
|
+
success: "text-green-900 dark:text-green-100"
|
|
38
38
|
}
|
|
39
39
|
},
|
|
40
40
|
defaultVariants: {
|
|
41
41
|
colorSchema: "default"
|
|
42
42
|
}
|
|
43
|
-
}),
|
|
43
|
+
}), A = d("text-sm leading-normal", {
|
|
44
44
|
variants: {
|
|
45
45
|
colorSchema: {
|
|
46
46
|
default: "text-muted-foreground",
|
|
47
|
-
success: "text-green-900"
|
|
47
|
+
success: "text-green-900 dark:text-green-100"
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
50
|
defaultVariants: {
|
|
51
51
|
colorSchema: "default"
|
|
52
52
|
}
|
|
53
|
-
}),
|
|
53
|
+
}), i = d("", {
|
|
54
54
|
variants: {
|
|
55
55
|
colorSchema: {
|
|
56
56
|
default: "text-foreground",
|
|
57
|
-
success: "text-green-900"
|
|
57
|
+
success: "text-green-900 dark:text-green-100"
|
|
58
58
|
}
|
|
59
59
|
},
|
|
60
60
|
defaultVariants: {
|
|
61
61
|
colorSchema: "default"
|
|
62
62
|
}
|
|
63
63
|
});
|
|
64
|
-
function
|
|
65
|
-
switch (
|
|
64
|
+
function C(n, e) {
|
|
65
|
+
switch (n) {
|
|
66
66
|
case "info":
|
|
67
|
-
return /* @__PURE__ */ o(v, { className: a(
|
|
67
|
+
return /* @__PURE__ */ o(v, { className: a(i({ colorSchema: e })) });
|
|
68
68
|
case "success":
|
|
69
|
-
return /* @__PURE__ */ o(g, { className: a(
|
|
69
|
+
return /* @__PURE__ */ o(g, { className: a(i({ colorSchema: e })) });
|
|
70
70
|
case "warning":
|
|
71
|
-
return /* @__PURE__ */ o(b, { className: a(
|
|
71
|
+
return /* @__PURE__ */ o(b, { className: a(i({ colorSchema: e })) });
|
|
72
72
|
case "error":
|
|
73
|
-
return /* @__PURE__ */ o(p, { className: a(
|
|
73
|
+
return /* @__PURE__ */ o(p, { className: a(i({ colorSchema: e })) });
|
|
74
74
|
case "loading":
|
|
75
75
|
return /* @__PURE__ */ o(
|
|
76
76
|
S,
|
|
77
77
|
{
|
|
78
|
-
className: a(
|
|
78
|
+
className: a(i({ colorSchema: e }), "animate-spin")
|
|
79
79
|
}
|
|
80
80
|
);
|
|
81
81
|
default:
|
|
82
82
|
return null;
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
|
-
function
|
|
86
|
-
const { id: c, ...t } =
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
85
|
+
const w = function(e, s) {
|
|
86
|
+
const { id: c, ...t } = e, l = {
|
|
87
|
+
...s,
|
|
88
|
+
duration: s?.duration ?? I,
|
|
89
|
+
...c != null && { id: s?.id ?? c }
|
|
90
|
+
}, h = l.duration === 1 / 0;
|
|
91
|
+
f.custom(
|
|
92
|
+
(r) => {
|
|
93
|
+
const m = t.button && t.button.label ? {
|
|
94
|
+
label: t.button.label,
|
|
95
|
+
variant: t.button.variant,
|
|
96
|
+
onClick: () => {
|
|
97
|
+
t.button?.onClick && t.button.onClick(), f.dismiss(r);
|
|
98
|
+
}
|
|
99
|
+
} : void 0;
|
|
100
|
+
return /* @__PURE__ */ o(
|
|
101
|
+
V,
|
|
102
|
+
{
|
|
103
|
+
button: m,
|
|
104
|
+
colorSchema: t.colorSchema,
|
|
105
|
+
description: t.description,
|
|
106
|
+
icon: t.icon ?? void 0,
|
|
107
|
+
id: r,
|
|
108
|
+
title: t.title
|
|
109
|
+
}
|
|
110
|
+
);
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
...l,
|
|
114
|
+
...h && { dismissible: !1 }
|
|
115
|
+
}
|
|
116
|
+
);
|
|
117
|
+
};
|
|
118
|
+
w.dismiss = (n) => {
|
|
119
|
+
f.dismiss(n);
|
|
120
|
+
};
|
|
121
|
+
function V(n) {
|
|
122
|
+
const { button: e, description: s, icon: c, title: t, colorSchema: l } = n, r = ((m) => m === "success" ? "success" : "default")(l);
|
|
123
|
+
return /* @__PURE__ */ u(
|
|
111
124
|
"div",
|
|
112
125
|
{
|
|
113
126
|
"aria-atomic": "true",
|
|
114
127
|
"aria-live": "polite",
|
|
115
|
-
className: a(
|
|
128
|
+
className: a(T({ colorSchema: r })),
|
|
116
129
|
role: "status",
|
|
117
130
|
children: [
|
|
118
|
-
/* @__PURE__ */
|
|
119
|
-
|
|
120
|
-
/* @__PURE__ */
|
|
121
|
-
/* @__PURE__ */ o("p", { className: a(
|
|
122
|
-
|
|
131
|
+
/* @__PURE__ */ u("div", { className: "flex flex-1 items-start gap-2", children: [
|
|
132
|
+
c != null && C(c, r),
|
|
133
|
+
/* @__PURE__ */ u("div", { className: "w-full", children: [
|
|
134
|
+
/* @__PURE__ */ o("p", { className: a(k({ colorSchema: r })), children: t }),
|
|
135
|
+
s && /* @__PURE__ */ o("p", { className: a(A({ colorSchema: r })), children: s })
|
|
123
136
|
] })
|
|
124
137
|
] }),
|
|
125
138
|
e?.label && /* @__PURE__ */ o(
|
|
126
|
-
|
|
139
|
+
N,
|
|
127
140
|
{
|
|
128
141
|
"aria-label": e.label,
|
|
129
142
|
className: "min-h-6 px-2 py-0 text-xs leading-normal font-medium",
|
|
@@ -138,11 +151,11 @@ function k(r) {
|
|
|
138
151
|
}
|
|
139
152
|
);
|
|
140
153
|
}
|
|
141
|
-
function
|
|
142
|
-
return /* @__PURE__ */ o(
|
|
154
|
+
function R() {
|
|
155
|
+
return /* @__PURE__ */ o(x, { position: "top-right" });
|
|
143
156
|
}
|
|
144
|
-
|
|
157
|
+
R.displayName = "Sonner";
|
|
145
158
|
export {
|
|
146
|
-
|
|
147
|
-
|
|
159
|
+
R as Sonner,
|
|
160
|
+
w as sonner
|
|
148
161
|
};
|
package/dist/split-layout.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),
|
|
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;
|
package/dist/split-layout.d.ts
CHANGED
|
@@ -6,40 +6,91 @@ interface SplitLayoutProps extends React.ComponentProps<"div"> {
|
|
|
6
6
|
trackingEl?: string;
|
|
7
7
|
/** Tracking label for analytics context */
|
|
8
8
|
trackingLabel?: string;
|
|
9
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* Content for the left/primary section.
|
|
11
|
+
* @deprecated Use `<SplitLayoutContentLeft>` composition instead.
|
|
12
|
+
*/
|
|
10
13
|
left?: React.ReactNode;
|
|
11
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* Content for the right/secondary section.
|
|
16
|
+
* @deprecated Use `<SplitLayoutContentRight>` composition instead.
|
|
17
|
+
*/
|
|
12
18
|
right?: React.ReactNode;
|
|
13
19
|
}
|
|
14
20
|
/**
|
|
15
|
-
* SplitLayout component for creating responsive two-column layouts
|
|
21
|
+
* SplitLayout component for creating responsive two-column layouts.
|
|
16
22
|
*
|
|
17
23
|
* Displays content in two sections side-by-side on large screens (≥1024px),
|
|
18
24
|
* and shows only the left section on smaller screens (hiding the right/marketing section).
|
|
19
25
|
* This pattern is commonly used for authentication pages where the form is prioritized on mobile.
|
|
20
26
|
*
|
|
27
|
+
* Uses a composition pattern with SplitLayoutHeader, SplitLayoutContentLeft,
|
|
28
|
+
* and SplitLayoutContentRight sub-components.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* // Basic usage
|
|
32
|
+
* <SplitLayout dataHook="login-layout">
|
|
33
|
+
* <SplitLayoutContentLeft>
|
|
34
|
+
* <LoginForm />
|
|
35
|
+
* </SplitLayoutContentLeft>
|
|
36
|
+
* <SplitLayoutContentRight>
|
|
37
|
+
* <MarketingContent />
|
|
38
|
+
* </SplitLayoutContentRight>
|
|
39
|
+
* </SplitLayout>
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* // With Header
|
|
43
|
+
* <SplitLayout dataHook="login-layout">
|
|
44
|
+
* <SplitLayoutHeader>
|
|
45
|
+
* <Header dataHook="my-header"><Logo dataHook="my-logo" /></Header>
|
|
46
|
+
* </SplitLayoutHeader>
|
|
47
|
+
* <SplitLayoutContentLeft>
|
|
48
|
+
* <LoginForm />
|
|
49
|
+
* </SplitLayoutContentLeft>
|
|
50
|
+
* <SplitLayoutContentRight>
|
|
51
|
+
* <MarketingContent />
|
|
52
|
+
* </SplitLayoutContentRight>
|
|
53
|
+
* </SplitLayout>
|
|
54
|
+
*
|
|
21
55
|
* Layout specifications:
|
|
22
56
|
* - Mobile/Tablet: Stacked layout, only left section visible, content centered
|
|
23
|
-
* -
|
|
24
|
-
* -
|
|
25
|
-
* - Left section: Content aligned to right edge with responsive padding
|
|
26
|
-
* - Right section: Content aligned to left edge with responsive padding
|
|
57
|
+
* - Desktop (≥1024px): Side-by-side, content centered within each section
|
|
58
|
+
* - Section padding uses responsive section tokens (16px mobile, 24px desktop)
|
|
27
59
|
* - Background colors extend full-width of viewport
|
|
28
60
|
* - Content within each section can be independently sized (e.g., using Card components)
|
|
29
61
|
*/
|
|
30
62
|
declare const SplitLayout: React.ForwardRefExoticComponent<Omit<SplitLayoutProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
31
|
-
interface
|
|
63
|
+
interface SplitLayoutHeaderProps extends React.ComponentProps<"div"> {
|
|
32
64
|
/**
|
|
33
|
-
*
|
|
34
|
-
* @default "left"
|
|
65
|
+
* Header content (e.g., Header component with Logo)
|
|
35
66
|
*/
|
|
36
|
-
|
|
67
|
+
children: React.ReactNode;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* SplitLayoutHeader component for rendering header content at the top of SplitLayout.
|
|
71
|
+
* Content is centered on mobile/tablet, left-aligned from lg breakpoint onwards.
|
|
72
|
+
* Uses section padding tokens for responsive horizontal and vertical padding (16px mobile, 24px desktop).
|
|
73
|
+
*/
|
|
74
|
+
declare const SplitLayoutHeader: React.ForwardRefExoticComponent<Omit<SplitLayoutHeaderProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
75
|
+
interface SplitLayoutContentLeftProps extends React.ComponentProps<"div"> {
|
|
76
|
+
children: React.ReactNode;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* SplitLayoutContentLeft - Left/primary section within a SplitLayout.
|
|
80
|
+
*
|
|
81
|
+
* Always visible. When a SplitLayoutHeader is present, top padding is
|
|
82
|
+
* automatically reduced to avoid excessive spacing below the header.
|
|
83
|
+
*/
|
|
84
|
+
declare const SplitLayoutContentLeft: React.ForwardRefExoticComponent<Omit<SplitLayoutContentLeftProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
85
|
+
interface SplitLayoutContentRightProps extends React.ComponentProps<"div"> {
|
|
86
|
+
children: React.ReactNode;
|
|
37
87
|
}
|
|
38
88
|
/**
|
|
39
|
-
*
|
|
89
|
+
* SplitLayoutContentRight - Right/secondary section within a SplitLayout.
|
|
40
90
|
*
|
|
41
|
-
*
|
|
91
|
+
* Hidden on mobile/tablet (<1024px), visible on desktop (≥1024px).
|
|
92
|
+
* Uses bg-card background color.
|
|
42
93
|
*/
|
|
43
|
-
declare const
|
|
44
|
-
export { SplitLayout,
|
|
94
|
+
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, };
|
|
45
96
|
//# sourceMappingURL=split-layout.d.ts.map
|
|
@@ -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;
|
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,QAAA,MAAM,WAAW,sGA6EhB,CAAC;AAQF,UAAU,sBAAuB,SAAQ,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC;IAClE;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED;;;;GAIG;AACH,QAAA,MAAM,iBAAiB,4GAiBrB,CAAC;AAQH,UAAU,2BAA4B,SAAQ,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC;IACvE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED;;;;;GAKG;AACH,QAAA,MAAM,sBAAsB,iHAoB1B,CAAC;AAQH,UAAU,4BAA6B,SAAQ,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC;IACxE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED;;;;;GAKG;AACH,QAAA,MAAM,uBAAuB,kHAiB3B,CAAC;AAQH,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,sBAAsB,EACtB,uBAAuB,EACvB,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,2BAA2B,EAChC,KAAK,4BAA4B,GAClC,CAAC"}
|
package/dist/split-layout.js
CHANGED
|
@@ -1,108 +1,112 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
{
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
"lg:flex",
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
1
|
+
import { jsxs as h, jsx as n } from "react/jsx-runtime";
|
|
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(
|
|
5
|
+
({
|
|
6
|
+
className: a,
|
|
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) {
|
|
18
|
+
t.Children.forEach(
|
|
19
|
+
e.props.children,
|
|
20
|
+
y
|
|
21
|
+
);
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
e.type === g ? d.push(e) : e.type === u ? p.push(e) : f.push(e);
|
|
25
|
+
}
|
|
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(
|
|
30
|
+
"div",
|
|
31
|
+
{
|
|
32
|
+
ref: w,
|
|
33
|
+
className: i(
|
|
34
|
+
"flex min-h-screen w-full flex-col lg:flex-row",
|
|
35
|
+
a
|
|
36
|
+
),
|
|
37
|
+
"data-hook": l,
|
|
38
|
+
"data-slot": "split-layout",
|
|
39
|
+
"data-tracking-el": o || "split-layout",
|
|
40
|
+
"data-tracking-label": s,
|
|
41
|
+
...v,
|
|
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__ */ h(x.Provider, { value: R, children: [
|
|
49
|
+
d,
|
|
50
|
+
m ? r && /* @__PURE__ */ n(C, { children: r }) : f
|
|
51
|
+
] })
|
|
52
|
+
}
|
|
53
|
+
),
|
|
54
|
+
m ? c && /* @__PURE__ */ n(u, { children: c }) : p
|
|
44
55
|
]
|
|
45
56
|
}
|
|
46
|
-
|
|
47
|
-
defaultVariants: {
|
|
48
|
-
side: "left"
|
|
49
|
-
}
|
|
57
|
+
);
|
|
50
58
|
}
|
|
51
|
-
)
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
);
|
|
60
|
+
j.displayName = "SplitLayout";
|
|
61
|
+
const g = t.forwardRef(({ className: a, children: l, ...o }, s) => /* @__PURE__ */ n(
|
|
62
|
+
"div",
|
|
63
|
+
{
|
|
64
|
+
ref: s,
|
|
65
|
+
className: i(
|
|
66
|
+
"px-section-sm pt-section-sm flex w-full items-center justify-center lg:justify-start",
|
|
67
|
+
a
|
|
68
|
+
),
|
|
69
|
+
"data-slot": "split-layout-header",
|
|
70
|
+
...o,
|
|
71
|
+
children: l
|
|
72
|
+
}
|
|
73
|
+
));
|
|
74
|
+
g.displayName = "SplitLayoutHeader";
|
|
75
|
+
const C = t.forwardRef(({ className: a, children: l, ...o }, s) => {
|
|
76
|
+
const r = t.useContext(x);
|
|
77
|
+
return /* @__PURE__ */ n(
|
|
62
78
|
"div",
|
|
63
79
|
{
|
|
64
|
-
ref:
|
|
65
|
-
className:
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
"div",
|
|
74
|
-
{
|
|
75
|
-
className: o({ side: "left" }),
|
|
76
|
-
"data-slot": "split-layout-left",
|
|
77
|
-
children: a
|
|
78
|
-
}
|
|
79
|
-
),
|
|
80
|
-
r && /* @__PURE__ */ s(
|
|
81
|
-
"div",
|
|
82
|
-
{
|
|
83
|
-
className: o({ side: "right" }),
|
|
84
|
-
"data-slot": "split-layout-right",
|
|
85
|
-
children: r
|
|
86
|
-
}
|
|
87
|
-
),
|
|
88
|
-
p
|
|
89
|
-
]
|
|
80
|
+
ref: s,
|
|
81
|
+
className: i(
|
|
82
|
+
"p-section-sm flex flex-1 items-center justify-center overflow-auto",
|
|
83
|
+
r && "pt-2",
|
|
84
|
+
a
|
|
85
|
+
),
|
|
86
|
+
"data-slot": "split-layout-left",
|
|
87
|
+
...o,
|
|
88
|
+
children: l
|
|
90
89
|
}
|
|
91
|
-
)
|
|
92
|
-
);
|
|
93
|
-
|
|
94
|
-
const
|
|
90
|
+
);
|
|
91
|
+
});
|
|
92
|
+
C.displayName = "SplitLayoutContentLeft";
|
|
93
|
+
const u = t.forwardRef(({ className: a, children: l, ...o }, s) => /* @__PURE__ */ n(
|
|
95
94
|
"div",
|
|
96
95
|
{
|
|
97
|
-
ref:
|
|
98
|
-
className:
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
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
|
|
100
|
+
),
|
|
101
|
+
"data-slot": "split-layout-right",
|
|
102
|
+
...o,
|
|
103
|
+
children: l
|
|
102
104
|
}
|
|
103
105
|
));
|
|
104
|
-
|
|
106
|
+
u.displayName = "SplitLayoutContentRight";
|
|
105
107
|
export {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
+
j as SplitLayout,
|
|
109
|
+
C as SplitLayoutContentLeft,
|
|
110
|
+
u as SplitLayoutContentRight,
|
|
111
|
+
g as SplitLayoutHeader
|
|
108
112
|
};
|
package/dist/switch.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),u=require("react"),b=require("@radix-ui/react-switch"),o=require("@brightlocal/ui-components/lib/utils");function i(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return a.default=e,Object.freeze(a)}const h=i(u),c=i(b),s=h.forwardRef(({className:e,dataHook:a,trackingEl:t,trackingLabel:r,...d},l)=>n.jsx(c.Root,{ref:l,className:o.cn("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring dark:
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),u=require("react"),b=require("@radix-ui/react-switch"),o=require("@brightlocal/ui-components/lib/utils");function i(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return a.default=e,Object.freeze(a)}const h=i(u),c=i(b),s=h.forwardRef(({className:e,dataHook:a,trackingEl:t,trackingLabel:r,...d},l)=>n.jsx(c.Root,{ref:l,className:o.cn("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring dark:data-[state=unchecked]:bg-input/80 dark:focus-visible:border-neutral-500","focus-visible:shadow-default inline-flex h-5 w-9 shrink-0 items-center rounded-full border-1 border-transparent shadow-xs transition-[background-color,border-color,box-shadow] outline-none","disabled:cursor-not-allowed disabled:opacity-50","pl-[1px]",e),"data-hook":a,"data-slot":"switch","data-tracking-el":t||"switch","data-tracking-label":r,...d,children:n.jsx(c.Thumb,{className:o.cn("bg-background","pointer-events-none block size-4 rounded-full ring-0 transition-transform","data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0"),"data-slot":"switch-thumb"})}));s.displayName="Switch";exports.Switch=s;
|
package/dist/switch.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../src/components/switch.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAI1D,UAAU,
|
|
1
|
+
{"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../src/components/switch.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAI1D,UAAU,WAAY,SAAQ,IAAI,CAChC,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,EACjD,SAAS,CACV;IACC,iDAAiD;IACjD,QAAQ,EAAE,MAAM,CAAC;IACjB,gDAAgD;IAChD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2CAA2C;IAC3C,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,QAAA,MAAM,MAAM,oGA8BV,CAAC;AAIH,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,CAAC"}
|
package/dist/switch.js
CHANGED
|
@@ -7,8 +7,8 @@ const l = c.forwardRef(({ className: r, dataHook: o, trackingEl: i, trackingLabe
|
|
|
7
7
|
{
|
|
8
8
|
ref: n,
|
|
9
9
|
className: e(
|
|
10
|
-
"peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring dark:
|
|
11
|
-
"inline-flex h-5 w-9 shrink-0 items-center rounded-full border-1 border-transparent shadow-xs transition-[background-color,border-color,box-shadow] outline-none
|
|
10
|
+
"peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring dark:data-[state=unchecked]:bg-input/80 dark:focus-visible:border-neutral-500",
|
|
11
|
+
"focus-visible:shadow-default inline-flex h-5 w-9 shrink-0 items-center rounded-full border-1 border-transparent shadow-xs transition-[background-color,border-color,box-shadow] outline-none",
|
|
12
12
|
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
13
13
|
"pl-[1px]",
|
|
14
14
|
r
|
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
|
|
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;
|
package/dist/textarea.js
CHANGED
|
@@ -30,7 +30,7 @@ const b = c([
|
|
|
30
30
|
"aria-invalid": e ? "true" : void 0,
|
|
31
31
|
className: u(
|
|
32
32
|
b(),
|
|
33
|
-
e && "border-destructive
|
|
33
|
+
e && "border-destructive-40 focus-visible:border-destructive-40 focus-visible:shadow-destructive",
|
|
34
34
|
a
|
|
35
35
|
),
|
|
36
36
|
"data-hook": o,
|