@brightlocal/ui-components 0.4.1 → 1.0.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/README.md +2 -1
- package/dist/accordion.cjs +1 -1
- package/dist/accordion.js +2 -2
- package/dist/alert.cjs +1 -1
- package/dist/alert.d.ts +2 -2
- package/dist/alert.js +64 -64
- package/dist/blocks/data-table.cjs +1 -1
- package/dist/blocks/data-table.js +38 -38
- package/dist/blocks/sidebar.cjs +1 -1
- package/dist/blocks/sidebar.d.ts +2 -2
- package/dist/blocks/sidebar.d.ts.map +1 -1
- package/dist/blocks/sidebar.js +23 -23
- package/dist/breadcrumb.cjs +1 -1
- package/dist/breadcrumb.js +34 -34
- package/dist/button.cjs +1 -1
- package/dist/button.d.ts +2 -2
- package/dist/button.d.ts.map +1 -1
- package/dist/button.js +58 -57
- package/dist/calendar.cjs +1 -1
- package/dist/calendar.d.ts.map +1 -1
- package/dist/calendar.js +19 -40
- package/dist/centred-layout.cjs +1 -1
- package/dist/centred-layout.js +1 -1
- package/dist/chart.cjs +2 -2
- package/dist/chart.d.ts +3 -1
- package/dist/chart.d.ts.map +1 -1
- package/dist/chart.js +21 -21
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.js +3 -3
- package/dist/combobox.cjs +1 -1
- package/dist/combobox.d.ts +6 -2
- package/dist/combobox.d.ts.map +1 -1
- package/dist/combobox.js +157 -149
- package/dist/command.cjs +1 -1
- package/dist/command.js +35 -35
- package/dist/context-menu.cjs +1 -1
- package/dist/context-menu.js +2 -2
- package/dist/date-picker.cjs +1 -1
- package/dist/date-picker.js +7 -7
- package/dist/dialog.cjs +1 -1
- package/dist/dialog.js +22 -22
- package/dist/dropdown-menu.cjs +1 -1
- package/dist/dropdown-menu.d.ts.map +1 -1
- package/dist/dropdown-menu.js +40 -45
- package/dist/field.cjs +1 -1
- package/dist/field.d.ts +8 -1
- package/dist/field.d.ts.map +1 -1
- package/dist/field.js +133 -92
- package/dist/header.d.ts.map +1 -1
- package/dist/header.js +1 -4
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +394 -381
- package/dist/input-chip.d.ts.map +1 -1
- package/dist/input-chip.js +18 -25
- package/dist/input-group.cjs +1 -1
- package/dist/input-group.d.ts +1 -1
- package/dist/input-group.js +10 -10
- package/dist/input-otp.cjs +1 -1
- package/dist/input-otp.d.ts +3 -20
- package/dist/input-otp.d.ts.map +1 -1
- package/dist/input-otp.js +93 -134
- package/dist/input-password.cjs +1 -1
- package/dist/input-password.d.ts.map +1 -1
- package/dist/input-password.js +16 -16
- package/dist/input.cjs +1 -1
- package/dist/input.js +9 -9
- package/dist/label.cjs +1 -1
- package/dist/label.js +1 -1
- package/dist/link.cjs +1 -1
- package/dist/link.d.ts.map +1 -1
- package/dist/link.js +1 -8
- package/dist/logo.cjs +1 -1
- package/dist/logo.d.ts.map +1 -1
- package/dist/logo.js +23 -11
- package/dist/menubar.cjs +1 -1
- package/dist/menubar.js +12 -12
- package/dist/pagination.cjs +1 -1
- package/dist/pagination.d.ts.map +1 -1
- package/dist/pagination.js +15 -15
- package/dist/radio-group.cjs +1 -1
- package/dist/radio-group.d.ts +3 -19
- package/dist/radio-group.d.ts.map +1 -1
- package/dist/radio-group.js +93 -121
- package/dist/resizable.d.ts +1 -1
- package/dist/select.cjs +1 -1
- package/dist/select.d.ts +1 -1
- package/dist/select.d.ts.map +1 -1
- package/dist/select.js +46 -50
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.d.ts.map +1 -1
- package/dist/sheet.js +19 -19
- package/dist/sonner.cjs +1 -1
- package/dist/sonner.d.ts.map +1 -1
- package/dist/sonner.js +7 -8
- package/dist/switch.cjs +1 -1
- package/dist/switch.d.ts +1 -21
- package/dist/switch.d.ts.map +1 -1
- package/dist/switch.js +31 -100
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.d.ts.map +1 -1
- package/dist/tabs.js +10 -12
- package/dist/toggle.cjs +1 -1
- package/dist/toggle.js +9 -9
- package/dist/typography.cjs +1 -0
- package/dist/typography.d.ts +176 -0
- package/dist/typography.d.ts.map +1 -0
- package/dist/typography.js +331 -0
- package/package.json +2 -2
- package/src/blocks/data-table.tsx +10 -10
- package/src/blocks/sidebar.tsx +13 -13
- package/src/components/accordion.tsx +2 -2
- package/src/components/alert.tsx +10 -10
- package/src/components/breadcrumb.tsx +3 -3
- package/src/components/button.tsx +7 -7
- package/src/components/calendar.tsx +4 -22
- package/src/components/centred-layout.tsx +1 -1
- package/src/components/chart.tsx +5 -5
- package/src/components/checkbox.tsx +3 -3
- package/src/components/combobox.tsx +26 -10
- package/src/components/command.tsx +5 -5
- package/src/components/context-menu.tsx +2 -2
- package/src/components/date-picker.tsx +1 -1
- package/src/components/dialog.tsx +3 -3
- package/src/components/dropdown-menu.tsx +6 -11
- package/src/components/field.tsx +70 -22
- package/src/components/header.tsx +1 -4
- package/src/components/input-chip.tsx +1 -4
- package/src/components/input-group.tsx +1 -1
- package/src/components/input-otp.tsx +12 -92
- package/src/components/input-password.tsx +2 -10
- package/src/components/input.tsx +1 -1
- package/src/components/label.tsx +1 -1
- package/src/components/link.tsx +1 -5
- package/src/components/logo.tsx +11 -5
- package/src/components/menubar.tsx +2 -2
- package/src/components/pagination.tsx +4 -8
- package/src/components/radio-group.tsx +66 -130
- package/src/components/select.tsx +8 -12
- package/src/components/sheet.tsx +5 -5
- package/src/components/sonner.tsx +4 -5
- package/src/components/switch.tsx +29 -140
- package/src/components/tabs.tsx +0 -2
- package/src/components/toggle.tsx +1 -1
- package/src/components/typography.tsx +678 -0
- package/src/index.ts +1 -0
- package/dist/link.figma.d.ts +0 -2
- package/dist/link.figma.d.ts.map +0 -1
- package/dist/switch.figma.d.ts +0 -2
- package/dist/switch.figma.d.ts.map +0 -1
- package/dist/toggle.figma.d.ts +0 -2
- package/dist/toggle.figma.d.ts.map +0 -1
- package/src/components/link.figma.tsx +0 -71
- package/src/components/switch.figma.tsx +0 -111
- package/src/components/toggle.figma.tsx +0 -75
package/dist/select.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as t, jsxs as d } from "react/jsx-runtime";
|
|
2
2
|
import * as a from "@radix-ui/react-select";
|
|
3
|
-
import {
|
|
4
|
-
import { cva as
|
|
3
|
+
import { Check as v, ChevronDown as u, ChevronUp as h } from "@brightlocal/icons";
|
|
4
|
+
import { cva as S } from "class-variance-authority";
|
|
5
5
|
import { cn as o } from "@brightlocal/ui-components/lib/utils";
|
|
6
|
-
function
|
|
6
|
+
function x({ children: e, ...r }) {
|
|
7
7
|
return /* @__PURE__ */ t(a.Root, { "data-slot": "select", ...r, children: e });
|
|
8
8
|
}
|
|
9
|
-
|
|
9
|
+
x.displayName = "Select";
|
|
10
10
|
function y(e) {
|
|
11
11
|
return /* @__PURE__ */ t(a.Group, { "data-slot": "select-group", ...e });
|
|
12
12
|
}
|
|
@@ -15,12 +15,12 @@ function w(e) {
|
|
|
15
15
|
return /* @__PURE__ */ t(a.Value, { "data-slot": "select-value", ...e });
|
|
16
16
|
}
|
|
17
17
|
w.displayName = "SelectValue";
|
|
18
|
-
const N =
|
|
18
|
+
const N = S([
|
|
19
19
|
// Base layout
|
|
20
20
|
"relative flex w-full h-9 items-center justify-between gap-2",
|
|
21
21
|
"px-3 py-2",
|
|
22
22
|
// Base appearance
|
|
23
|
-
"border border-border rounded-sm outline-none transition-
|
|
23
|
+
"border border-border rounded-sm outline-none transition-[border-color,box-shadow,background-color]",
|
|
24
24
|
"bg-neutral-50 border-neutral-300",
|
|
25
25
|
"dark:bg-white/5 dark:border-white/15",
|
|
26
26
|
// Typography
|
|
@@ -37,44 +37,42 @@ const N = x([
|
|
|
37
37
|
// Disabled state
|
|
38
38
|
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
39
39
|
// Icon styles (chevron and custom icons)
|
|
40
|
-
"[&_svg]:pointer-events-none [&_svg]:shrink-0"
|
|
41
|
-
"[&_svg:not([class*='size-'])]:size-4",
|
|
42
|
-
"[&_svg:not([class*='text-'])]:text-muted-foreground"
|
|
40
|
+
"[&_svg]:pointer-events-none [&_svg]:shrink-0"
|
|
43
41
|
]);
|
|
44
|
-
function
|
|
42
|
+
function k({
|
|
45
43
|
className: e,
|
|
46
44
|
children: r,
|
|
47
|
-
placeholder:
|
|
48
|
-
dataHook:
|
|
49
|
-
error:
|
|
50
|
-
...
|
|
45
|
+
placeholder: n,
|
|
46
|
+
dataHook: i,
|
|
47
|
+
error: s,
|
|
48
|
+
...l
|
|
51
49
|
}) {
|
|
52
|
-
const c =
|
|
50
|
+
const c = s || l["aria-invalid"] === !0 || l["aria-invalid"] === "true", f = l["aria-required"] === !0 || l["aria-required"] === "true", b = l["aria-label"] || n || "Select an option", g = c ? "border-destructive dark:border-destructive focus-visible:border-destructive focus-visible:shadow-destructive" : "";
|
|
53
51
|
return /* @__PURE__ */ d(
|
|
54
52
|
a.Trigger,
|
|
55
53
|
{
|
|
56
|
-
...
|
|
54
|
+
...l,
|
|
57
55
|
"aria-invalid": c ? "true" : void 0,
|
|
58
|
-
"aria-label":
|
|
56
|
+
"aria-label": b,
|
|
59
57
|
"aria-required": f ? "true" : void 0,
|
|
60
|
-
className: o(N(),
|
|
61
|
-
"data-hook":
|
|
58
|
+
className: o(N(), g, e),
|
|
59
|
+
"data-hook": i,
|
|
62
60
|
"data-slot": "select-trigger",
|
|
63
61
|
children: [
|
|
64
62
|
r,
|
|
65
|
-
/* @__PURE__ */ t(a.Icon, { asChild: !0, children: /* @__PURE__ */ t(u, { className: "text-muted-foreground"
|
|
63
|
+
/* @__PURE__ */ t(a.Icon, { asChild: !0, children: /* @__PURE__ */ t(u, { className: "text-muted-foreground" }) })
|
|
66
64
|
]
|
|
67
65
|
}
|
|
68
66
|
);
|
|
69
67
|
}
|
|
70
|
-
|
|
71
|
-
function
|
|
68
|
+
k.displayName = "SelectTrigger";
|
|
69
|
+
function C({
|
|
72
70
|
className: e,
|
|
73
71
|
children: r,
|
|
74
|
-
position:
|
|
75
|
-
...
|
|
72
|
+
position: n = "popper",
|
|
73
|
+
...i
|
|
76
74
|
}) {
|
|
77
|
-
const
|
|
75
|
+
const s = o(
|
|
78
76
|
// Base appearance
|
|
79
77
|
"relative z-50 overflow-hidden",
|
|
80
78
|
"min-w-[8rem]",
|
|
@@ -91,7 +89,7 @@ function k({
|
|
|
91
89
|
"data-[side=left]:slide-in-from-right-2",
|
|
92
90
|
"data-[side=right]:slide-in-from-left-2",
|
|
93
91
|
"data-[side=top]:slide-in-from-bottom-2"
|
|
94
|
-
),
|
|
92
|
+
), l = n === "popper" && o(
|
|
95
93
|
"data-[side=bottom]:translate-y-1",
|
|
96
94
|
"data-[side=left]:-translate-x-1",
|
|
97
95
|
"data-[side=right]:translate-x-1",
|
|
@@ -100,10 +98,10 @@ function k({
|
|
|
100
98
|
return /* @__PURE__ */ t(a.Portal, { children: /* @__PURE__ */ d(
|
|
101
99
|
a.Content,
|
|
102
100
|
{
|
|
103
|
-
className: o(
|
|
101
|
+
className: o(s, l, e),
|
|
104
102
|
"data-slot": "select-content",
|
|
105
|
-
position:
|
|
106
|
-
...
|
|
103
|
+
position: n,
|
|
104
|
+
...i,
|
|
107
105
|
children: [
|
|
108
106
|
/* @__PURE__ */ t(m, {}),
|
|
109
107
|
/* @__PURE__ */ t(
|
|
@@ -111,7 +109,7 @@ function k({
|
|
|
111
109
|
{
|
|
112
110
|
className: o(
|
|
113
111
|
"p-1",
|
|
114
|
-
|
|
112
|
+
n === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"
|
|
115
113
|
),
|
|
116
114
|
children: r
|
|
117
115
|
}
|
|
@@ -121,7 +119,7 @@ function k({
|
|
|
121
119
|
}
|
|
122
120
|
) });
|
|
123
121
|
}
|
|
124
|
-
|
|
122
|
+
C.displayName = "SelectContent";
|
|
125
123
|
function I({
|
|
126
124
|
className: e,
|
|
127
125
|
...r
|
|
@@ -139,12 +137,12 @@ function I({
|
|
|
139
137
|
);
|
|
140
138
|
}
|
|
141
139
|
I.displayName = "SelectLabel";
|
|
142
|
-
function
|
|
140
|
+
function j({
|
|
143
141
|
className: e,
|
|
144
142
|
children: r,
|
|
145
|
-
...
|
|
143
|
+
...n
|
|
146
144
|
}) {
|
|
147
|
-
const
|
|
145
|
+
const i = o(
|
|
148
146
|
// Base layout
|
|
149
147
|
"relative flex w-full cursor-default select-none items-center gap-2",
|
|
150
148
|
"rounded py-1.5 pl-2 pr-8",
|
|
@@ -157,25 +155,23 @@ function _({
|
|
|
157
155
|
// Disabled state
|
|
158
156
|
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
159
157
|
// Icon styles
|
|
160
|
-
"[&_svg]:pointer-events-none [&_svg]:shrink-0"
|
|
161
|
-
"[&_svg:not([class*='size-'])]:size-4",
|
|
162
|
-
"[&_svg:not([class*='text-'])]:text-foreground"
|
|
158
|
+
"[&_svg]:pointer-events-none [&_svg]:shrink-0"
|
|
163
159
|
);
|
|
164
160
|
return /* @__PURE__ */ d(
|
|
165
161
|
a.Item,
|
|
166
162
|
{
|
|
167
|
-
className: o(
|
|
163
|
+
className: o(i, e),
|
|
168
164
|
"data-slot": "select-item",
|
|
169
|
-
...
|
|
165
|
+
...n,
|
|
170
166
|
children: [
|
|
171
|
-
/* @__PURE__ */ t("span", { className: "absolute right-2 flex size-4 items-center justify-center", children: /* @__PURE__ */ t(a.ItemIndicator, { children: /* @__PURE__ */ t(v, {
|
|
167
|
+
/* @__PURE__ */ t("span", { className: "absolute right-2 flex size-4 items-center justify-center", children: /* @__PURE__ */ t(a.ItemIndicator, { children: /* @__PURE__ */ t(v, {}) }) }),
|
|
172
168
|
/* @__PURE__ */ t(a.ItemText, { children: r })
|
|
173
169
|
]
|
|
174
170
|
}
|
|
175
171
|
);
|
|
176
172
|
}
|
|
177
|
-
|
|
178
|
-
function
|
|
173
|
+
j.displayName = "SelectItem";
|
|
174
|
+
function B({
|
|
179
175
|
className: e,
|
|
180
176
|
...r
|
|
181
177
|
}) {
|
|
@@ -188,7 +184,7 @@ function C({
|
|
|
188
184
|
}
|
|
189
185
|
);
|
|
190
186
|
}
|
|
191
|
-
|
|
187
|
+
B.displayName = "SelectSeparator";
|
|
192
188
|
function m({
|
|
193
189
|
className: e,
|
|
194
190
|
...r
|
|
@@ -202,7 +198,7 @@ function m({
|
|
|
202
198
|
),
|
|
203
199
|
"data-slot": "select-scroll-up-button",
|
|
204
200
|
...r,
|
|
205
|
-
children: /* @__PURE__ */ t(h, {
|
|
201
|
+
children: /* @__PURE__ */ t(h, {})
|
|
206
202
|
}
|
|
207
203
|
);
|
|
208
204
|
}
|
|
@@ -220,20 +216,20 @@ function p({
|
|
|
220
216
|
),
|
|
221
217
|
"data-slot": "select-scroll-down-button",
|
|
222
218
|
...r,
|
|
223
|
-
children: /* @__PURE__ */ t(u, {
|
|
219
|
+
children: /* @__PURE__ */ t(u, {})
|
|
224
220
|
}
|
|
225
221
|
);
|
|
226
222
|
}
|
|
227
223
|
p.displayName = "SelectScrollDownButton";
|
|
228
224
|
export {
|
|
229
|
-
|
|
230
|
-
|
|
225
|
+
x as Select,
|
|
226
|
+
C as SelectContent,
|
|
231
227
|
y as SelectGroup,
|
|
232
|
-
|
|
228
|
+
j as SelectItem,
|
|
233
229
|
I as SelectLabel,
|
|
234
230
|
p as SelectScrollDownButton,
|
|
235
231
|
m as SelectScrollUpButton,
|
|
236
|
-
|
|
237
|
-
|
|
232
|
+
B as SelectSeparator,
|
|
233
|
+
k as SelectTrigger,
|
|
238
234
|
w as SelectValue
|
|
239
235
|
};
|
package/dist/sheet.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),v=require("react"),w=require("@radix-ui/react-dialog"),R=require("class-variance-authority"),C=require("@brightlocal/icons"),n=require("@brightlocal/ui-components/lib/utils");function c(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const i=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,i.get?i:{enumerable:!0,get:()=>e[a]})}}return t.default=e,Object.freeze(t)}const r=c(v),s=c(w),O=R.cva(["bg-background","data-[state=open]:animate-in","data-[state=closed]:animate-out","fixed","z-50","flex","flex-col","gap-4","p-6","shadow-lg","transition","ease-in-out","data-[state=closed]:duration-300","data-[state=open]:duration-500"],{variants:{side:{top:["data-[state=closed]:slide-out-to-top","data-[state=open]:slide-in-from-top","inset-x-0","top-0","h-auto","border-b"],right:["data-[state=closed]:slide-out-to-right","data-[state=open]:slide-in-from-right","inset-y-0","right-0","h-full","w-3/4","border-l","sm:max-w-sm"],bottom:["data-[state=closed]:slide-out-to-bottom","data-[state=open]:slide-in-from-bottom","inset-x-0","bottom-0","h-auto","border-t"],left:["data-[state=closed]:slide-out-to-left","data-[state=open]:slide-in-from-left","inset-y-0","left-0","h-full","w-3/4","border-r","sm:max-w-sm"]}},defaultVariants:{side:"right"}});function f({...e}){return o.jsx(s.Root,{"data-slot":"sheet",modal:!0,...e})}f.displayName="Sheet";const h=r.forwardRef(({dataHook:e,...t},a)=>o.jsx(s.Trigger,{ref:a,"data-hook":e,"data-slot":"sheet-trigger",...t}));h.displayName="SheetTrigger";const u=r.forwardRef(({...e},t)=>o.jsx(s.Close,{ref:t,"data-slot":"sheet-close",...e}));u.displayName="SheetClose";function l({...e}){return o.jsx(s.Portal,{"data-slot":"sheet-portal",...e})}l.displayName="SheetPortal";const d=r.forwardRef(({className:e,...t},a)=>o.jsx(s.Overlay,{ref:a,className:n.cn("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),"data-slot":"sheet-overlay",...t}));d.displayName="SheetOverlay";const m=r.forwardRef(({className:e,children:t,side:a,dataHook:i,trackingEl:y,trackingLabel:b,...j},N)=>o.jsxs(l,{children:[o.jsx(d,{}),o.jsxs(s.Content,{ref:N,className:n.cn(O({side:a}),e),"data-hook":i,"data-slot":"sheet-content","data-tracking-el":y,"data-tracking-label":b,...j,children:[t,o.jsxs(s.Close,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0",children:[o.jsx(C.X,{}),o.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));m.displayName="SheetContent";const p=r.forwardRef(({className:e,...t},a)=>o.jsx("div",{ref:a,className:n.cn("flex flex-col gap-2 text-center sm:text-left",e),"data-slot":"sheet-header",...t}));p.displayName="SheetHeader";const g=r.forwardRef(({className:e,...t},a)=>o.jsx("div",{ref:a,className:n.cn("mt-auto flex flex-col gap-2 sm:flex-row sm:justify-end",e),"data-slot":"sheet-footer",...t}));g.displayName="SheetFooter";const x=r.forwardRef(({className:e,...t},a)=>o.jsx(s.Title,{ref:a,className:n.cn("text-foreground text-lg font-semibold",e),"data-slot":"sheet-title",...t}));x.displayName="SheetTitle";const S=r.forwardRef(({className:e,...t},a)=>o.jsx(s.Description,{ref:a,className:n.cn("text-muted-foreground text-sm",e),"data-slot":"sheet-description",...t}));S.displayName="SheetDescription";exports.Sheet=f;exports.SheetClose=u;exports.SheetContent=m;exports.SheetDescription=S;exports.SheetFooter=g;exports.SheetHeader=p;exports.SheetOverlay=d;exports.SheetPortal=l;exports.SheetTitle=x;exports.SheetTrigger=h;
|
package/dist/sheet.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sheet.d.ts","sourceRoot":"","sources":["../../src/components/sheet.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAA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,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,YAAY,EACZ,WAAW,EACX,UAAU,EACV,YAAY,GACb,CAAC;AAEF,YAAY,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,CAAC"}
|
package/dist/sheet.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsx as o, jsxs as
|
|
1
|
+
import { jsx as o, jsxs as i } from "react/jsx-runtime";
|
|
2
2
|
import * as r from "react";
|
|
3
3
|
import * as s from "@radix-ui/react-dialog";
|
|
4
4
|
import { cva as g } from "class-variance-authority";
|
|
5
|
-
import {
|
|
6
|
-
import { cn as
|
|
5
|
+
import { X as u } from "@brightlocal/icons";
|
|
6
|
+
import { cn as d } from "@brightlocal/ui-components/lib/utils";
|
|
7
7
|
const x = g(
|
|
8
8
|
[
|
|
9
9
|
"bg-background",
|
|
@@ -83,17 +83,17 @@ const S = r.forwardRef(({ dataHook: t, ...e }, a) => /* @__PURE__ */ o(
|
|
|
83
83
|
S.displayName = "SheetTrigger";
|
|
84
84
|
const b = r.forwardRef(({ ...t }, e) => /* @__PURE__ */ o(s.Close, { ref: e, "data-slot": "sheet-close", ...t }));
|
|
85
85
|
b.displayName = "SheetClose";
|
|
86
|
-
function
|
|
86
|
+
function l({
|
|
87
87
|
...t
|
|
88
88
|
}) {
|
|
89
89
|
return /* @__PURE__ */ o(s.Portal, { "data-slot": "sheet-portal", ...t });
|
|
90
90
|
}
|
|
91
|
-
|
|
92
|
-
const
|
|
91
|
+
l.displayName = "SheetPortal";
|
|
92
|
+
const n = r.forwardRef(({ className: t, ...e }, a) => /* @__PURE__ */ o(
|
|
93
93
|
s.Overlay,
|
|
94
94
|
{
|
|
95
95
|
ref: a,
|
|
96
|
-
className:
|
|
96
|
+
className: d(
|
|
97
97
|
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
|
|
98
98
|
t
|
|
99
99
|
),
|
|
@@ -101,7 +101,7 @@ const l = r.forwardRef(({ className: t, ...e }, a) => /* @__PURE__ */ o(
|
|
|
101
101
|
...e
|
|
102
102
|
}
|
|
103
103
|
));
|
|
104
|
-
|
|
104
|
+
n.displayName = "SheetOverlay";
|
|
105
105
|
const N = r.forwardRef(
|
|
106
106
|
({
|
|
107
107
|
className: t,
|
|
@@ -111,13 +111,13 @@ const N = r.forwardRef(
|
|
|
111
111
|
trackingEl: c,
|
|
112
112
|
trackingLabel: m,
|
|
113
113
|
...h
|
|
114
|
-
}, p) => /* @__PURE__ */
|
|
115
|
-
/* @__PURE__ */ o(
|
|
116
|
-
/* @__PURE__ */
|
|
114
|
+
}, p) => /* @__PURE__ */ i(l, { children: [
|
|
115
|
+
/* @__PURE__ */ o(n, {}),
|
|
116
|
+
/* @__PURE__ */ i(
|
|
117
117
|
s.Content,
|
|
118
118
|
{
|
|
119
119
|
ref: p,
|
|
120
|
-
className:
|
|
120
|
+
className: d(x({ side: a }), t),
|
|
121
121
|
"data-hook": f,
|
|
122
122
|
"data-slot": "sheet-content",
|
|
123
123
|
"data-tracking-el": c,
|
|
@@ -125,7 +125,7 @@ const N = r.forwardRef(
|
|
|
125
125
|
...h,
|
|
126
126
|
children: [
|
|
127
127
|
e,
|
|
128
|
-
/* @__PURE__ */
|
|
128
|
+
/* @__PURE__ */ i(s.Close, { className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0", children: [
|
|
129
129
|
/* @__PURE__ */ o(u, {}),
|
|
130
130
|
/* @__PURE__ */ o("span", { className: "sr-only", children: "Close" })
|
|
131
131
|
] })
|
|
@@ -139,7 +139,7 @@ const v = r.forwardRef(({ className: t, ...e }, a) => /* @__PURE__ */ o(
|
|
|
139
139
|
"div",
|
|
140
140
|
{
|
|
141
141
|
ref: a,
|
|
142
|
-
className:
|
|
142
|
+
className: d("flex flex-col gap-2 text-center sm:text-left", t),
|
|
143
143
|
"data-slot": "sheet-header",
|
|
144
144
|
...e
|
|
145
145
|
}
|
|
@@ -149,7 +149,7 @@ const w = r.forwardRef(({ className: t, ...e }, a) => /* @__PURE__ */ o(
|
|
|
149
149
|
"div",
|
|
150
150
|
{
|
|
151
151
|
ref: a,
|
|
152
|
-
className:
|
|
152
|
+
className: d(
|
|
153
153
|
"mt-auto flex flex-col gap-2 sm:flex-row sm:justify-end",
|
|
154
154
|
t
|
|
155
155
|
),
|
|
@@ -162,7 +162,7 @@ const R = r.forwardRef(({ className: t, ...e }, a) => /* @__PURE__ */ o(
|
|
|
162
162
|
s.Title,
|
|
163
163
|
{
|
|
164
164
|
ref: a,
|
|
165
|
-
className:
|
|
165
|
+
className: d("text-foreground text-lg font-semibold", t),
|
|
166
166
|
"data-slot": "sheet-title",
|
|
167
167
|
...e
|
|
168
168
|
}
|
|
@@ -172,7 +172,7 @@ const C = r.forwardRef(({ className: t, ...e }, a) => /* @__PURE__ */ o(
|
|
|
172
172
|
s.Description,
|
|
173
173
|
{
|
|
174
174
|
ref: a,
|
|
175
|
-
className:
|
|
175
|
+
className: d("text-muted-foreground text-sm", t),
|
|
176
176
|
"data-slot": "sheet-description",
|
|
177
177
|
...e
|
|
178
178
|
}
|
|
@@ -185,8 +185,8 @@ export {
|
|
|
185
185
|
C as SheetDescription,
|
|
186
186
|
w as SheetFooter,
|
|
187
187
|
v as SheetHeader,
|
|
188
|
-
|
|
189
|
-
|
|
188
|
+
n as SheetOverlay,
|
|
189
|
+
l as SheetPortal,
|
|
190
190
|
R as SheetTitle,
|
|
191
191
|
S as SheetTrigger
|
|
192
192
|
};
|
package/dist/sonner.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),c=require("@brightlocal/icons"),u=require("class-variance-authority"),m=require("sonner"),x=require("@brightlocal/ui-components/button"),a=require("@brightlocal/ui-components/lib/utils"),b=u.cva(["flex","items-center","justify-between","w-full","md:w-auto","md:min-w-[364px]","rounded-md","border","border-border","p-4","gap-2","shadow-lg"].join(" "),{variants:{colorSchema:{default:"bg-white dark:bg-popover",success:"bg-green-200 dark:bg-popover"}},defaultVariants:{colorSchema:"default"}}),v=u.cva("text-sm leading-normal font-medium",{variants:{colorSchema:{default:"text-foreground",success:"text-green-900"}},defaultVariants:{colorSchema:"default"}}),g=u.cva("text-sm leading-normal",{variants:{colorSchema:{default:"text-muted-foreground",success:"text-green-900"}},defaultVariants:{colorSchema:"default"}}),s=u.cva("",{variants:{colorSchema:{default:"text-foreground",success:"text-green-900"}},defaultVariants:{colorSchema:"default"}});function p(n,e){switch(n){case"info":return o.jsx(c.Info,{className:a.cn(s({colorSchema:e}))});case"success":return o.jsx(c.CheckCircle2,{className:a.cn(s({colorSchema:e}))});case"warning":return o.jsx(c.AlertTriangle,{className:a.cn(s({colorSchema:e}))});case"error":return o.jsx(c.XCircle,{className:a.cn(s({colorSchema:e}))});case"loading":return o.jsx(c.Loader2,{className:a.cn(s({colorSchema:e}),"animate-spin")});default:return null}}function N(n,e){const{id:r,...t}=n,d=r!=null?{...e,id:e?.id??r}:e;m.toast.custom(l=>{const f=t.button&&t.button.label?{label:t.button.label,variant:t.button.variant,onClick:()=>{t.button?.onClick&&t.button.onClick(),m.toast.dismiss(l)}}:void 0;return o.jsx(j,{button:f,colorSchema:t.colorSchema,description:t.description,icon:t.icon??void 0,id:l,title:t.title})},d)}function j(n){const{button:e,description:r,icon:t,title:d,colorSchema:l}=n,i=(S=>S==="success"?"success":"default")(l);return o.jsxs("div",{"aria-atomic":"true","aria-live":"polite",className:a.cn(b({colorSchema:i})),role:"status",children:[o.jsxs("div",{className:"flex flex-1 items-start gap-2",children:[t!=null&&p(t,i),o.jsxs("div",{className:"w-full",children:[o.jsx("p",{className:a.cn(v({colorSchema:i})),children:d}),r&&o.jsx("p",{className:a.cn(g({colorSchema:i})),children:r})]})]}),e?.label&&o.jsx(x.Button,{"aria-label":e.label,className:"min-h-6 px-2 py-0 text-xs leading-normal font-medium",dataHook:"toast-action",size:"default",variant:e.variant,onClick:e.onClick,children:e.label})]})}function h(){return o.jsx(m.Toaster,{position:"top-right"})}h.displayName="Sonner";exports.Sonner=h;exports.sonner=N;
|
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;A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;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACtB,CAAC;AAEF;;GAEG;AACH,KAAK,UAAU,GAAG,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,GAAG;IAAE,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,CAAC;AAoGpE,iBAAS,MAAM,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAkCtE;AAqDD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkEG;AACH,iBAAS,MAAM,4CAEd;kBAFQ,MAAM;;;AAKf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmEG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC"}
|
package/dist/sonner.js
CHANGED
|
@@ -64,26 +64,25 @@ const I = i(
|
|
|
64
64
|
function A(r, e) {
|
|
65
65
|
switch (r) {
|
|
66
66
|
case "info":
|
|
67
|
-
return /* @__PURE__ */ o(v, { className: a(n({ colorSchema: e }))
|
|
67
|
+
return /* @__PURE__ */ o(v, { className: a(n({ colorSchema: e })) });
|
|
68
68
|
case "success":
|
|
69
|
-
return /* @__PURE__ */ o(g, { className: a(n({ colorSchema: e }))
|
|
69
|
+
return /* @__PURE__ */ o(g, { className: a(n({ colorSchema: e })) });
|
|
70
70
|
case "warning":
|
|
71
|
-
return /* @__PURE__ */ o(b, { className: a(n({ colorSchema: e }))
|
|
71
|
+
return /* @__PURE__ */ o(b, { className: a(n({ colorSchema: e })) });
|
|
72
72
|
case "error":
|
|
73
|
-
return /* @__PURE__ */ o(p, { className: a(n({ colorSchema: e }))
|
|
73
|
+
return /* @__PURE__ */ o(p, { className: a(n({ colorSchema: e })) });
|
|
74
74
|
case "loading":
|
|
75
75
|
return /* @__PURE__ */ o(
|
|
76
76
|
S,
|
|
77
77
|
{
|
|
78
|
-
className: a(n({ colorSchema: e }), "animate-spin")
|
|
79
|
-
size: 20
|
|
78
|
+
className: a(n({ colorSchema: e }), "animate-spin")
|
|
80
79
|
}
|
|
81
80
|
);
|
|
82
81
|
default:
|
|
83
82
|
return null;
|
|
84
83
|
}
|
|
85
84
|
}
|
|
86
|
-
function
|
|
85
|
+
function E(r, e) {
|
|
87
86
|
const { id: c, ...t } = r, m = c != null ? { ...e, id: e?.id ?? c } : e;
|
|
88
87
|
f.custom((l) => {
|
|
89
88
|
const u = t.button && t.button.label ? {
|
|
@@ -145,5 +144,5 @@ function w() {
|
|
|
145
144
|
w.displayName = "Sonner";
|
|
146
145
|
export {
|
|
147
146
|
w as Sonner,
|
|
148
|
-
|
|
147
|
+
E as sonner
|
|
149
148
|
};
|
package/dist/switch.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const 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:focus-visible:border-neutral-500 dark:data-[state=unchecked]:bg-input/80","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 focus-visible:shadow-default","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
CHANGED
|
@@ -1,32 +1,12 @@
|
|
|
1
|
-
import { VariantProps } from 'class-variance-authority';
|
|
2
1
|
import * as React from "react";
|
|
3
2
|
import * as SwitchPrimitive from "@radix-ui/react-switch";
|
|
4
|
-
|
|
5
|
-
* Visual style variants for Switch component
|
|
6
|
-
*/
|
|
7
|
-
export type SwitchVariant = "default" | "box";
|
|
8
|
-
/**
|
|
9
|
-
* Label position for switch (used in Default variant)
|
|
10
|
-
*/
|
|
11
|
-
export type SwitchSide = "left" | "right";
|
|
12
|
-
declare const switchVariants: (props?: ({
|
|
13
|
-
variant?: "box" | "default" | null | undefined;
|
|
14
|
-
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
15
|
-
interface SwitchProps extends Omit<React.ComponentProps<typeof SwitchPrimitive.Root>, "asChild">, VariantProps<typeof switchVariants> {
|
|
3
|
+
interface SwitchProps extends Omit<React.ComponentProps<typeof SwitchPrimitive.Root>, "asChild"> {
|
|
16
4
|
/** Data hook for automated testing (REQUIRED) */
|
|
17
5
|
dataHook: string;
|
|
18
6
|
/** Tracking element identifier for analytics */
|
|
19
7
|
trackingEl?: string;
|
|
20
8
|
/** Tracking label for analytics context */
|
|
21
9
|
trackingLabel?: string;
|
|
22
|
-
/** Visual style variant */
|
|
23
|
-
variant?: SwitchVariant;
|
|
24
|
-
/** Label text for the switch */
|
|
25
|
-
label?: string;
|
|
26
|
-
/** Description text (visible in Box variant) */
|
|
27
|
-
description?: string;
|
|
28
|
-
/** Label position - left or right (for Default variant) */
|
|
29
|
-
side?: SwitchSide;
|
|
30
10
|
}
|
|
31
11
|
declare const Switch: React.ForwardRefExoticComponent<Omit<SwitchProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
32
12
|
export { Switch, type SwitchProps };
|
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;
|
|
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,WACR,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC;IAC1E,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
|
@@ -1,106 +1,37 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
[
|
|
8
|
-
"peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring dark:focus-visible:border-neutral-500 dark:data-[state=unchecked]:bg-input/80",
|
|
9
|
-
"inline-flex h-5 w-9 shrink-0 items-center rounded-full border-1 border-transparent shadow-xs transition-all outline-none focus-visible:shadow-default",
|
|
10
|
-
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
11
|
-
"pl-[1px]"
|
|
12
|
-
],
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import * as c from "react";
|
|
3
|
+
import * as a from "@radix-ui/react-switch";
|
|
4
|
+
import { cn as e } from "@brightlocal/ui-components/lib/utils";
|
|
5
|
+
const l = c.forwardRef(({ className: r, dataHook: o, trackingEl: i, trackingLabel: s, ...d }, n) => /* @__PURE__ */ t(
|
|
6
|
+
a.Root,
|
|
13
7
|
{
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
trackingEl: h,
|
|
30
|
-
trackingLabel: b,
|
|
31
|
-
label: a,
|
|
32
|
-
description: d,
|
|
33
|
-
side: o = "right",
|
|
34
|
-
...i
|
|
35
|
-
}, p) => {
|
|
36
|
-
const r = /* @__PURE__ */ e(
|
|
37
|
-
m.Root,
|
|
8
|
+
ref: n,
|
|
9
|
+
className: e(
|
|
10
|
+
"peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring dark:focus-visible:border-neutral-500 dark:data-[state=unchecked]:bg-input/80",
|
|
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 focus-visible:shadow-default",
|
|
12
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
13
|
+
"pl-[1px]",
|
|
14
|
+
r
|
|
15
|
+
),
|
|
16
|
+
"data-hook": o,
|
|
17
|
+
"data-slot": "switch",
|
|
18
|
+
"data-tracking-el": i || "switch",
|
|
19
|
+
"data-tracking-label": s,
|
|
20
|
+
...d,
|
|
21
|
+
children: /* @__PURE__ */ t(
|
|
22
|
+
a.Thumb,
|
|
38
23
|
{
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
"data-tracking-el": h || `switch-${t}`,
|
|
44
|
-
"data-tracking-label": b,
|
|
45
|
-
...i,
|
|
46
|
-
children: /* @__PURE__ */ e(
|
|
47
|
-
m.Thumb,
|
|
48
|
-
{
|
|
49
|
-
className: s(
|
|
50
|
-
"bg-background",
|
|
51
|
-
"pointer-events-none block size-4 rounded-full ring-0 transition-transform",
|
|
52
|
-
"data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0"
|
|
53
|
-
),
|
|
54
|
-
"data-slot": "switch-thumb"
|
|
55
|
-
}
|
|
56
|
-
)
|
|
57
|
-
}
|
|
58
|
-
);
|
|
59
|
-
if (t === "default")
|
|
60
|
-
return /* @__PURE__ */ n(
|
|
61
|
-
"div",
|
|
62
|
-
{
|
|
63
|
-
className: s(
|
|
64
|
-
"flex items-center gap-2",
|
|
65
|
-
o === "left" && "flex-row-reverse"
|
|
66
|
-
),
|
|
67
|
-
children: [
|
|
68
|
-
r,
|
|
69
|
-
a && /* @__PURE__ */ e(
|
|
70
|
-
"label",
|
|
71
|
-
{
|
|
72
|
-
className: "cursor-pointer text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
|
73
|
-
htmlFor: i.id,
|
|
74
|
-
children: a
|
|
75
|
-
}
|
|
76
|
-
)
|
|
77
|
-
]
|
|
78
|
-
}
|
|
79
|
-
);
|
|
80
|
-
if (t === "box") {
|
|
81
|
-
const l = /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: [
|
|
82
|
-
a && /* @__PURE__ */ e(
|
|
83
|
-
"label",
|
|
84
|
-
{
|
|
85
|
-
className: "cursor-pointer text-sm leading-none font-medium",
|
|
86
|
-
htmlFor: i.id,
|
|
87
|
-
children: a
|
|
88
|
-
}
|
|
24
|
+
className: e(
|
|
25
|
+
"bg-background",
|
|
26
|
+
"pointer-events-none block size-4 rounded-full ring-0 transition-transform",
|
|
27
|
+
"data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0"
|
|
89
28
|
),
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
r,
|
|
94
|
-
l
|
|
95
|
-
] }) : /* @__PURE__ */ n(c, { children: [
|
|
96
|
-
l,
|
|
97
|
-
r
|
|
98
|
-
] }) });
|
|
99
|
-
}
|
|
100
|
-
return r;
|
|
29
|
+
"data-slot": "switch-thumb"
|
|
30
|
+
}
|
|
31
|
+
)
|
|
101
32
|
}
|
|
102
|
-
);
|
|
103
|
-
|
|
33
|
+
));
|
|
34
|
+
l.displayName = "Switch";
|
|
104
35
|
export {
|
|
105
|
-
|
|
36
|
+
l as Switch
|
|
106
37
|
};
|