laif-ds 0.2.23 → 0.2.25
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/_virtual/index2.js +5 -2
- package/dist/_virtual/index3.js +2 -5
- package/dist/_virtual/index6.js +2 -2
- package/dist/_virtual/index7.js +2 -2
- package/dist/components/ui/alert-dialog.js +6 -6
- package/dist/components/ui/app-multiple-select-dropdown.js +34 -34
- package/dist/components/ui/app-select.js +127 -124
- package/dist/components/ui/badge.js +13 -12
- package/dist/components/ui/button.js +20 -18
- package/dist/components/ui/calendar.js +6 -6
- package/dist/components/ui/checkbox.js +9 -9
- package/dist/components/ui/confirmer.js +45 -19
- package/dist/components/ui/context-menu.js +4 -4
- package/dist/components/ui/date-picker.js +45 -36
- package/dist/components/ui/input-otp.js +16 -16
- package/dist/components/ui/input-selector.js +19 -19
- package/dist/components/ui/input.js +19 -19
- package/dist/components/ui/menubar.js +1 -1
- package/dist/components/ui/pagination.js +90 -77
- package/dist/components/ui/radio-group.js +14 -14
- package/dist/components/ui/select.js +27 -27
- package/dist/components/ui/switch.js +8 -6
- package/dist/components/ui/table.js +16 -16
- package/dist/components/ui/tables/data-cross-table/data-cross-table.js +6 -6
- package/dist/components/ui/tables/data-table/components/data-table-actions.js +51 -0
- package/dist/components/ui/tables/data-table/components/data-table-advanced-filter.js +470 -0
- package/dist/components/ui/tables/data-table/components/data-table-body.js +340 -0
- package/dist/components/ui/tables/data-table/components/data-table-column-visibility.js +274 -0
- package/dist/components/ui/tables/data-table/components/data-table-filter-inputs.js +177 -0
- package/dist/components/ui/tables/data-table/components/data-table-filters.js +286 -0
- package/dist/components/ui/tables/data-table/components/data-table-pagination.js +131 -0
- package/dist/components/ui/tables/data-table/components/data-table-searchbar.js +112 -0
- package/dist/components/ui/tables/data-table/components/data-table-simple-filters.js +263 -0
- package/dist/components/ui/tables/data-table/components/data-table-sorting.js +128 -0
- package/dist/components/ui/tables/data-table/data-table-constants.js +58 -0
- package/dist/components/ui/tables/data-table/data-table-i18n.js +138 -0
- package/dist/components/ui/tables/data-table/data-table.js +549 -0
- package/dist/components/ui/tables/data-table/data-table.service.js +254 -0
- package/dist/components/ui/tabs.js +33 -33
- package/dist/components/ui/textarea.js +11 -11
- package/dist/components/ui/tooltip.js +10 -10
- package/dist/css-for-template.css +57 -0
- package/dist/index.d.ts +249 -76
- package/dist/index.js +64 -64
- package/dist/node_modules/eventemitter3/index.js +1 -1
- package/dist/node_modules/eventemitter3/index2.js +1 -1
- package/dist/node_modules/recharts/es6/util/Events.js +1 -1
- package/dist/node_modules/style-to-object/cjs/index.js +1 -1
- package/dist/node_modules/use-sync-external-store/shim/index.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.v3.css +1 -1
- package/package.json +5 -3
- package/dist/components/ui/data-table.js +0 -461
- package/dist/components/ui/data-table.service.js +0 -62
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as i, jsx as e } from "react/jsx-runtime";
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
3
|
+
import { Label as N } from "./label.js";
|
|
4
|
+
import { cn as c } from "../../lib/utils.js";
|
|
5
|
+
import { cva as I } from "../../node_modules/class-variance-authority/dist/index.js";
|
|
6
|
+
import * as f from "react";
|
|
7
7
|
import { Icon as l } from "./icon.js";
|
|
8
|
-
const M =
|
|
8
|
+
const M = I(
|
|
9
9
|
"file:text-d-foreground placeholder:text-d-muted-foreground shadow-none selection:bg-d-primary selection:text-d-primary-foreground flex w-full min-w-0 rounded-md bg-d-input border border-d-border/50 px-3 py-1 text-base transition-all duration-200 outline-none file:inline-flex file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
10
10
|
{
|
|
11
11
|
variants: {
|
|
@@ -19,34 +19,34 @@ const M = N(
|
|
|
19
19
|
size: "default"
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
-
), P =
|
|
22
|
+
), P = f.forwardRef(
|
|
23
23
|
({
|
|
24
24
|
className: x,
|
|
25
25
|
type: m,
|
|
26
26
|
label: r,
|
|
27
|
-
labelClassName:
|
|
28
|
-
id:
|
|
29
|
-
iconLeft:
|
|
30
|
-
iconRight:
|
|
27
|
+
labelClassName: b,
|
|
28
|
+
id: g,
|
|
29
|
+
iconLeft: o,
|
|
30
|
+
iconRight: a,
|
|
31
31
|
size: t,
|
|
32
32
|
...u
|
|
33
33
|
}, h) => {
|
|
34
|
-
const p =
|
|
35
|
-
return /* @__PURE__ */ i("div", { className:
|
|
36
|
-
r && /* @__PURE__ */ e(
|
|
34
|
+
const p = g || (r ? `input-${Math.random().toString(36).substring(2, 9)}` : void 0), n = m === "password", [s, v] = f.useState(!1), w = n ? s ? "text" : "password" : m, y = !!a || n;
|
|
35
|
+
return /* @__PURE__ */ i("div", { className: c("space-y-1.5", x), children: [
|
|
36
|
+
r && /* @__PURE__ */ e(N, { htmlFor: p, className: b, children: r }),
|
|
37
37
|
/* @__PURE__ */ i("div", { className: "relative w-full", children: [
|
|
38
|
-
|
|
38
|
+
o && /* @__PURE__ */ e("div", { className: "text-d-muted-foreground pointer-events-none absolute top-1/2 left-3 -translate-y-1/2", children: /* @__PURE__ */ e(l, { name: o, size: t === "lg" ? "sm" : "xs" }) }),
|
|
39
39
|
/* @__PURE__ */ e(
|
|
40
40
|
"input",
|
|
41
41
|
{
|
|
42
42
|
id: p,
|
|
43
43
|
type: w,
|
|
44
44
|
"data-slot": "input",
|
|
45
|
-
className:
|
|
45
|
+
className: c(
|
|
46
46
|
M({ size: t }),
|
|
47
|
-
"focus-visible:
|
|
48
|
-
"aria-invalid:ring-d-destructive/20
|
|
49
|
-
|
|
47
|
+
"focus-visible:border-d-ring focus-visible:border-1 focus-visible:ring-0 focus-visible:outline-none",
|
|
48
|
+
"aria-invalid:ring-d-destructive/20 aria-invalid:border-d-destructive",
|
|
49
|
+
o ? t !== "lg" ? "pl-9" : "pl-10" : "",
|
|
50
50
|
y ? t !== "lg" ? "pr-9" : "pr-10" : ""
|
|
51
51
|
),
|
|
52
52
|
ref: h,
|
|
@@ -73,7 +73,7 @@ const M = N(
|
|
|
73
73
|
/* @__PURE__ */ e("span", { className: "sr-only", children: s ? "Nascondi password" : "Mostra password" })
|
|
74
74
|
]
|
|
75
75
|
}
|
|
76
|
-
) :
|
|
76
|
+
) : a && /* @__PURE__ */ e("div", { className: "text-d-muted-foreground pointer-events-none absolute top-1/2 right-3 -translate-y-1/2", children: /* @__PURE__ */ e(l, { name: a, size: t === "lg" ? "sm" : "xs" }) })
|
|
77
77
|
] })
|
|
78
78
|
] });
|
|
79
79
|
}
|
|
@@ -92,7 +92,7 @@ function E({
|
|
|
92
92
|
"data-inset": t,
|
|
93
93
|
"data-variant": n,
|
|
94
94
|
className: r(
|
|
95
|
-
"focus:bg-d-accent focus:text-d-accent-foreground data-[variant=destructive]:text-d-destructive data-[variant=destructive]:focus:bg-d-destructive/10
|
|
95
|
+
"focus:bg-d-accent focus:text-d-accent-foreground data-[variant=destructive]:text-d-destructive data-[variant=destructive]:focus:bg-d-destructive/10 data-[variant=destructive]:focus:text-d-destructive data-[variant=destructive]:*:[svg]:!text-d-destructive [&_svg:not([class*='text-'])]:text-d-secondary-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
96
96
|
e
|
|
97
97
|
),
|
|
98
98
|
...o
|
|
@@ -1,164 +1,177 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { cn as
|
|
2
|
+
import { jsx as a, jsxs as r } from "react/jsx-runtime";
|
|
3
|
+
import { cn as i } from "../../lib/utils.js";
|
|
4
4
|
import { buttonVariants as c } from "./button.js";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
5
|
+
import m from "../../node_modules/lucide-react/dist/esm/icons/ellipsis.js";
|
|
6
|
+
import p from "../../node_modules/lucide-react/dist/esm/icons/chevron-right.js";
|
|
7
|
+
import d from "../../node_modules/lucide-react/dist/esm/icons/chevron-left.js";
|
|
8
|
+
import u from "../../node_modules/lucide-react/dist/esm/icons/chevron-first.js";
|
|
9
9
|
import g from "../../node_modules/lucide-react/dist/esm/icons/chevron-last.js";
|
|
10
|
-
function
|
|
11
|
-
return /* @__PURE__ */
|
|
10
|
+
function j({ className: n, ...e }) {
|
|
11
|
+
return /* @__PURE__ */ a(
|
|
12
12
|
"nav",
|
|
13
13
|
{
|
|
14
14
|
role: "navigation",
|
|
15
15
|
"aria-label": "pagination",
|
|
16
16
|
"data-slot": "pagination",
|
|
17
|
-
className:
|
|
18
|
-
...
|
|
17
|
+
className: i("mx-auto flex w-full justify-center", n),
|
|
18
|
+
...e
|
|
19
19
|
}
|
|
20
20
|
);
|
|
21
21
|
}
|
|
22
|
-
function
|
|
23
|
-
className:
|
|
24
|
-
...
|
|
22
|
+
function k({
|
|
23
|
+
className: n,
|
|
24
|
+
...e
|
|
25
25
|
}) {
|
|
26
|
-
return /* @__PURE__ */
|
|
26
|
+
return /* @__PURE__ */ a(
|
|
27
27
|
"ul",
|
|
28
28
|
{
|
|
29
29
|
"data-slot": "pagination-content",
|
|
30
|
-
className:
|
|
31
|
-
...
|
|
30
|
+
className: i("flex flex-row items-center gap-1", n),
|
|
31
|
+
...e
|
|
32
32
|
}
|
|
33
33
|
);
|
|
34
34
|
}
|
|
35
|
-
function
|
|
36
|
-
return /* @__PURE__ */
|
|
35
|
+
function C({ ...n }) {
|
|
36
|
+
return /* @__PURE__ */ a("li", { "data-slot": "pagination-item", ...n });
|
|
37
37
|
}
|
|
38
|
-
function
|
|
39
|
-
className:
|
|
40
|
-
isActive:
|
|
41
|
-
isDisabled:
|
|
38
|
+
function o({
|
|
39
|
+
className: n,
|
|
40
|
+
isActive: e,
|
|
41
|
+
isDisabled: t,
|
|
42
42
|
size: s = "icon",
|
|
43
43
|
...l
|
|
44
44
|
}) {
|
|
45
|
-
return /* @__PURE__ */
|
|
45
|
+
return /* @__PURE__ */ a(
|
|
46
46
|
"a",
|
|
47
47
|
{
|
|
48
|
-
"aria-current":
|
|
48
|
+
"aria-current": e ? "page" : void 0,
|
|
49
49
|
"data-slot": "pagination-link",
|
|
50
|
-
"data-active":
|
|
51
|
-
className:
|
|
50
|
+
"data-active": e,
|
|
51
|
+
className: i(
|
|
52
|
+
"border-d-border/30 select-none",
|
|
52
53
|
c({
|
|
53
|
-
variant:
|
|
54
|
-
// variant: isDisabled ? "disabled" : isActive ? "outline" : "ghost",
|
|
54
|
+
variant: e ? "outline" : "ghost",
|
|
55
55
|
size: s
|
|
56
56
|
}),
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
t && "pointer-events-none cursor-not-allowed opacity-40",
|
|
58
|
+
e && "bg-d-secondary border-d-border border",
|
|
59
|
+
n
|
|
59
60
|
),
|
|
60
61
|
...l
|
|
61
62
|
}
|
|
62
63
|
);
|
|
63
64
|
}
|
|
64
65
|
function G({
|
|
65
|
-
className:
|
|
66
|
-
label:
|
|
67
|
-
...
|
|
66
|
+
className: n,
|
|
67
|
+
label: e,
|
|
68
|
+
...t
|
|
68
69
|
}) {
|
|
69
|
-
return /* @__PURE__ */
|
|
70
|
-
|
|
70
|
+
return /* @__PURE__ */ r(
|
|
71
|
+
o,
|
|
71
72
|
{
|
|
72
73
|
"aria-label": "Go to previous page",
|
|
73
|
-
className:
|
|
74
|
-
|
|
74
|
+
className: i(
|
|
75
|
+
"flex items-center justify-center gap-1 px-2.5 align-middle select-none sm:pl-2.5",
|
|
76
|
+
n
|
|
77
|
+
),
|
|
78
|
+
...t,
|
|
75
79
|
children: [
|
|
76
|
-
/* @__PURE__ */
|
|
77
|
-
/* @__PURE__ */
|
|
80
|
+
/* @__PURE__ */ a(u, {}),
|
|
81
|
+
/* @__PURE__ */ a("span", { className: "hidden sm:block", children: e ?? "Primo" })
|
|
78
82
|
]
|
|
79
83
|
}
|
|
80
84
|
);
|
|
81
85
|
}
|
|
82
86
|
function L({
|
|
83
|
-
className:
|
|
84
|
-
label:
|
|
85
|
-
...
|
|
87
|
+
className: n,
|
|
88
|
+
label: e,
|
|
89
|
+
...t
|
|
86
90
|
}) {
|
|
87
|
-
return /* @__PURE__ */
|
|
88
|
-
|
|
91
|
+
return /* @__PURE__ */ r(
|
|
92
|
+
o,
|
|
89
93
|
{
|
|
90
94
|
"aria-label": "Go to previous page",
|
|
91
|
-
className:
|
|
92
|
-
|
|
95
|
+
className: i(
|
|
96
|
+
"flex items-center justify-center gap-1 px-2.5 align-middle select-none sm:pl-2.5",
|
|
97
|
+
n
|
|
98
|
+
),
|
|
99
|
+
...t,
|
|
93
100
|
children: [
|
|
94
|
-
/* @__PURE__ */
|
|
95
|
-
/* @__PURE__ */
|
|
101
|
+
/* @__PURE__ */ a(d, {}),
|
|
102
|
+
/* @__PURE__ */ a("span", { className: "hidden sm:block", children: e ?? "Precedente" })
|
|
96
103
|
]
|
|
97
104
|
}
|
|
98
105
|
);
|
|
99
106
|
}
|
|
100
107
|
function w({
|
|
101
|
-
className:
|
|
102
|
-
label:
|
|
103
|
-
...
|
|
108
|
+
className: n,
|
|
109
|
+
label: e,
|
|
110
|
+
...t
|
|
104
111
|
}) {
|
|
105
|
-
return /* @__PURE__ */
|
|
106
|
-
|
|
112
|
+
return /* @__PURE__ */ r(
|
|
113
|
+
o,
|
|
107
114
|
{
|
|
108
115
|
"aria-label": "Go to next page",
|
|
109
|
-
className:
|
|
110
|
-
|
|
116
|
+
className: i(
|
|
117
|
+
"flex items-center justify-center gap-1 px-2.5 align-middle select-none sm:pl-2.5",
|
|
118
|
+
n
|
|
119
|
+
),
|
|
120
|
+
...t,
|
|
111
121
|
children: [
|
|
112
|
-
/* @__PURE__ */
|
|
113
|
-
/* @__PURE__ */
|
|
122
|
+
/* @__PURE__ */ a("span", { className: "hidden sm:block", children: e ?? "Prossimo" }),
|
|
123
|
+
/* @__PURE__ */ a(p, {})
|
|
114
124
|
]
|
|
115
125
|
}
|
|
116
126
|
);
|
|
117
127
|
}
|
|
118
128
|
function z({
|
|
119
|
-
className:
|
|
120
|
-
label:
|
|
121
|
-
...
|
|
129
|
+
className: n,
|
|
130
|
+
label: e,
|
|
131
|
+
...t
|
|
122
132
|
}) {
|
|
123
|
-
return /* @__PURE__ */
|
|
124
|
-
|
|
133
|
+
return /* @__PURE__ */ r(
|
|
134
|
+
o,
|
|
125
135
|
{
|
|
126
136
|
"aria-label": "Go to next page",
|
|
127
|
-
className:
|
|
128
|
-
|
|
137
|
+
className: i(
|
|
138
|
+
"flex items-center justify-center gap-1 px-2.5 align-middle select-none sm:pr-2.5",
|
|
139
|
+
n
|
|
140
|
+
),
|
|
141
|
+
...t,
|
|
129
142
|
children: [
|
|
130
|
-
/* @__PURE__ */
|
|
131
|
-
/* @__PURE__ */
|
|
143
|
+
/* @__PURE__ */ a("span", { className: "hidden sm:block", children: e ?? "Ultimo" }),
|
|
144
|
+
/* @__PURE__ */ a(g, {})
|
|
132
145
|
]
|
|
133
146
|
}
|
|
134
147
|
);
|
|
135
148
|
}
|
|
136
149
|
function E({
|
|
137
|
-
className:
|
|
138
|
-
...
|
|
150
|
+
className: n,
|
|
151
|
+
...e
|
|
139
152
|
}) {
|
|
140
|
-
return /* @__PURE__ */
|
|
153
|
+
return /* @__PURE__ */ r(
|
|
141
154
|
"span",
|
|
142
155
|
{
|
|
143
156
|
"aria-hidden": !0,
|
|
144
157
|
"data-slot": "pagination-ellipsis",
|
|
145
|
-
className:
|
|
146
|
-
...
|
|
158
|
+
className: i("flex size-9 items-center justify-center", n),
|
|
159
|
+
...e,
|
|
147
160
|
children: [
|
|
148
|
-
/* @__PURE__ */
|
|
149
|
-
/* @__PURE__ */
|
|
161
|
+
/* @__PURE__ */ a(m, { className: "size-4" }),
|
|
162
|
+
/* @__PURE__ */ a("span", { className: "sr-only", children: "More pages" })
|
|
150
163
|
]
|
|
151
164
|
}
|
|
152
165
|
);
|
|
153
166
|
}
|
|
154
167
|
export {
|
|
155
|
-
|
|
156
|
-
|
|
168
|
+
j as Pagination,
|
|
169
|
+
k as PaginationContent,
|
|
157
170
|
E as PaginationEllipsis,
|
|
158
171
|
G as PaginationFirst,
|
|
159
|
-
|
|
172
|
+
C as PaginationItem,
|
|
160
173
|
z as PaginationLast,
|
|
161
|
-
|
|
174
|
+
o as PaginationLink,
|
|
162
175
|
w as PaginationNext,
|
|
163
176
|
L as PaginationPrevious
|
|
164
177
|
};
|
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as r } from "react/jsx-runtime";
|
|
3
|
-
import { Root as
|
|
4
|
-
import { cn as
|
|
5
|
-
import
|
|
3
|
+
import { Root as t, Item as a, Indicator as s } from "../../node_modules/@radix-ui/react-radio-group/dist/index.js";
|
|
4
|
+
import { cn as e } from "../../lib/utils.js";
|
|
5
|
+
import d from "../../node_modules/lucide-react/dist/esm/icons/circle.js";
|
|
6
6
|
function m({
|
|
7
7
|
className: i,
|
|
8
|
-
...
|
|
8
|
+
...o
|
|
9
9
|
}) {
|
|
10
10
|
return /* @__PURE__ */ r(
|
|
11
|
-
|
|
11
|
+
t,
|
|
12
12
|
{
|
|
13
13
|
"data-slot": "radio-group",
|
|
14
|
-
className:
|
|
15
|
-
...
|
|
14
|
+
className: e("grid gap-3", i),
|
|
15
|
+
...o
|
|
16
16
|
}
|
|
17
17
|
);
|
|
18
18
|
}
|
|
19
19
|
function p({
|
|
20
20
|
className: i,
|
|
21
|
-
...
|
|
21
|
+
...o
|
|
22
22
|
}) {
|
|
23
23
|
return /* @__PURE__ */ r(
|
|
24
|
-
|
|
24
|
+
a,
|
|
25
25
|
{
|
|
26
26
|
"data-slot": "radio-group-item",
|
|
27
|
-
className:
|
|
28
|
-
"border-d-border text-d-primary focus-visible:border-d-ring focus-visible:ring-d-ring/50 aria-invalid:ring-d-destructive/20
|
|
27
|
+
className: e(
|
|
28
|
+
"border-d-border text-d-primary focus-visible:border-d-ring focus-visible:ring-d-ring/50 aria-invalid:ring-d-destructive/20 aria-invalid:border-d-destructive aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
|
|
29
29
|
i
|
|
30
30
|
),
|
|
31
|
-
...
|
|
31
|
+
...o,
|
|
32
32
|
children: /* @__PURE__ */ r(
|
|
33
|
-
|
|
33
|
+
s,
|
|
34
34
|
{
|
|
35
35
|
"data-slot": "radio-group-indicator",
|
|
36
36
|
className: "relative flex items-center justify-center",
|
|
37
|
-
children: /* @__PURE__ */ r(
|
|
37
|
+
children: /* @__PURE__ */ r(d, { className: "fill-d-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2" })
|
|
38
38
|
}
|
|
39
39
|
)
|
|
40
40
|
}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as i, jsx as e } from "react/jsx-runtime";
|
|
3
|
-
import * as c from "react";
|
|
4
3
|
import { Root as p, Group as f, Value as g, Trigger as x, Icon as h, Portal as v, Content as b, Viewport as y, Label as S, Item as z, ItemIndicator as w, ItemText as N, Separator as C, ScrollUpButton as I, ScrollDownButton as _ } from "../../node_modules/@radix-ui/react-select/dist/index.js";
|
|
5
|
-
import
|
|
4
|
+
import * as c from "react";
|
|
6
5
|
import { Label as j } from "./label.js";
|
|
6
|
+
import { cn as o } from "../../lib/utils.js";
|
|
7
7
|
import u from "../../node_modules/lucide-react/dist/esm/icons/chevron-down.js";
|
|
8
8
|
import k from "../../node_modules/lucide-react/dist/esm/icons/check.js";
|
|
9
9
|
import B from "../../node_modules/lucide-react/dist/esm/icons/chevron-up.js";
|
|
10
10
|
function q({
|
|
11
11
|
size: t = "default",
|
|
12
12
|
label: a,
|
|
13
|
-
className:
|
|
14
|
-
labelClassName:
|
|
13
|
+
className: s,
|
|
14
|
+
labelClassName: r,
|
|
15
15
|
...d
|
|
16
16
|
}) {
|
|
17
17
|
const n = c.useId();
|
|
18
|
-
return /* @__PURE__ */ i("div", { className:
|
|
19
|
-
a && /* @__PURE__ */ e(j, { htmlFor: n, className:
|
|
18
|
+
return /* @__PURE__ */ i("div", { className: o("space-y-1.5", s), children: [
|
|
19
|
+
a && /* @__PURE__ */ e(j, { htmlFor: n, className: r, children: a }),
|
|
20
20
|
/* @__PURE__ */ e(m.Provider, { value: { size: t, id: n }, children: /* @__PURE__ */ e(p, { "data-slot": "select", ...d }) })
|
|
21
21
|
] });
|
|
22
22
|
}
|
|
@@ -34,8 +34,8 @@ function E({
|
|
|
34
34
|
function H({
|
|
35
35
|
className: t,
|
|
36
36
|
size: a,
|
|
37
|
-
children:
|
|
38
|
-
...
|
|
37
|
+
children: s,
|
|
38
|
+
...r
|
|
39
39
|
}) {
|
|
40
40
|
const { size: d, id: n } = L(), l = a || d;
|
|
41
41
|
return /* @__PURE__ */ i(
|
|
@@ -44,13 +44,13 @@ function H({
|
|
|
44
44
|
id: n,
|
|
45
45
|
"data-slot": "select-trigger",
|
|
46
46
|
"data-size": l,
|
|
47
|
-
className:
|
|
47
|
+
className: o(
|
|
48
48
|
"border-d-border/50 ring-offset-background data-[placeholder]:text-d-muted-foreground bg-d-input flex items-center justify-between rounded-md border px-3 py-2 whitespace-nowrap focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
|
|
49
49
|
"focus-visible:ring-d-ring focus-visible:ring-1",
|
|
50
50
|
// Ring solo con tastiera
|
|
51
51
|
"data-[state=open]:ring-d-ring data-[state=open]:ring-1",
|
|
52
52
|
// Ring quando dropdown è aperto
|
|
53
|
-
"aria-invalid:ring-d-destructive/20
|
|
53
|
+
"aria-invalid:ring-d-destructive/20 aria-invalid:border-d-destructive",
|
|
54
54
|
"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
55
55
|
"*:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2",
|
|
56
56
|
"transition-all duration-300",
|
|
@@ -59,9 +59,9 @@ function H({
|
|
|
59
59
|
l === "lg" && "h-10 text-lg",
|
|
60
60
|
t
|
|
61
61
|
),
|
|
62
|
-
...
|
|
62
|
+
...r,
|
|
63
63
|
children: [
|
|
64
|
-
|
|
64
|
+
s,
|
|
65
65
|
/* @__PURE__ */ e(h, { asChild: !0, children: /* @__PURE__ */ e(u, { className: "size-4 opacity-50" }) })
|
|
66
66
|
]
|
|
67
67
|
}
|
|
@@ -70,28 +70,28 @@ function H({
|
|
|
70
70
|
function J({
|
|
71
71
|
className: t,
|
|
72
72
|
children: a,
|
|
73
|
-
position:
|
|
74
|
-
...
|
|
73
|
+
position: s = "popper",
|
|
74
|
+
...r
|
|
75
75
|
}) {
|
|
76
76
|
return /* @__PURE__ */ e(v, { children: /* @__PURE__ */ i(
|
|
77
77
|
b,
|
|
78
78
|
{
|
|
79
79
|
"data-slot": "select-content",
|
|
80
|
-
className:
|
|
80
|
+
className: o(
|
|
81
81
|
"bg-d-popover text-d-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 border-d-border relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",
|
|
82
|
-
|
|
82
|
+
s === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
83
83
|
t
|
|
84
84
|
),
|
|
85
|
-
position:
|
|
86
|
-
...
|
|
85
|
+
position: s,
|
|
86
|
+
...r,
|
|
87
87
|
children: [
|
|
88
88
|
/* @__PURE__ */ e(D, {}),
|
|
89
89
|
/* @__PURE__ */ e(
|
|
90
90
|
y,
|
|
91
91
|
{
|
|
92
|
-
className:
|
|
92
|
+
className: o(
|
|
93
93
|
"p-1",
|
|
94
|
-
|
|
94
|
+
s === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"
|
|
95
95
|
),
|
|
96
96
|
children: a
|
|
97
97
|
}
|
|
@@ -109,7 +109,7 @@ function K({
|
|
|
109
109
|
S,
|
|
110
110
|
{
|
|
111
111
|
"data-slot": "select-label",
|
|
112
|
-
className:
|
|
112
|
+
className: o(
|
|
113
113
|
"text-d-secondary-foreground px-2 py-1.5 text-xs",
|
|
114
114
|
t
|
|
115
115
|
),
|
|
@@ -120,17 +120,17 @@ function K({
|
|
|
120
120
|
function M({
|
|
121
121
|
className: t,
|
|
122
122
|
children: a,
|
|
123
|
-
...
|
|
123
|
+
...s
|
|
124
124
|
}) {
|
|
125
125
|
return /* @__PURE__ */ i(
|
|
126
126
|
z,
|
|
127
127
|
{
|
|
128
128
|
"data-slot": "select-item",
|
|
129
|
-
className:
|
|
129
|
+
className: o(
|
|
130
130
|
"focus:bg-d-accent focus:text-d-accent-foreground [&_svg:not([class*='text-'])]:text-d-secondary-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
|
|
131
131
|
t
|
|
132
132
|
),
|
|
133
|
-
...
|
|
133
|
+
...s,
|
|
134
134
|
children: [
|
|
135
135
|
/* @__PURE__ */ e("span", { className: "absolute right-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ e(w, { children: /* @__PURE__ */ e(k, { className: "size-4" }) }) }),
|
|
136
136
|
/* @__PURE__ */ e(N, { children: a })
|
|
@@ -146,7 +146,7 @@ function O({
|
|
|
146
146
|
C,
|
|
147
147
|
{
|
|
148
148
|
"data-slot": "select-separator",
|
|
149
|
-
className:
|
|
149
|
+
className: o(
|
|
150
150
|
"bg-d-border pointer-events-none -mx-1 my-1 h-px",
|
|
151
151
|
t
|
|
152
152
|
),
|
|
@@ -162,7 +162,7 @@ function D({
|
|
|
162
162
|
I,
|
|
163
163
|
{
|
|
164
164
|
"data-slot": "select-scroll-up-button",
|
|
165
|
-
className:
|
|
165
|
+
className: o(
|
|
166
166
|
"flex cursor-default items-center justify-center py-1",
|
|
167
167
|
t
|
|
168
168
|
),
|
|
@@ -179,7 +179,7 @@ function R({
|
|
|
179
179
|
_,
|
|
180
180
|
{
|
|
181
181
|
"data-slot": "select-scroll-down-button",
|
|
182
|
-
className:
|
|
182
|
+
className: o(
|
|
183
183
|
"flex cursor-default items-center justify-center py-1",
|
|
184
184
|
t
|
|
185
185
|
),
|
|
@@ -1,26 +1,28 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as e } from "react/jsx-runtime";
|
|
3
|
-
import { Root as
|
|
3
|
+
import { Root as a, Thumb as n } from "../../node_modules/@radix-ui/react-switch/dist/index.js";
|
|
4
4
|
import { cn as t } from "../../lib/utils.js";
|
|
5
5
|
function c({
|
|
6
6
|
className: r,
|
|
7
|
-
...
|
|
7
|
+
...o
|
|
8
8
|
}) {
|
|
9
9
|
return /* @__PURE__ */ e(
|
|
10
|
-
|
|
10
|
+
a,
|
|
11
11
|
{
|
|
12
12
|
"data-slot": "switch",
|
|
13
13
|
className: t(
|
|
14
|
-
"peer data-[state=checked]:bg-d-primary data-[state=unchecked]:bg-d-
|
|
14
|
+
"peer data-[state=checked]:bg-d-primary data-[state=unchecked]:bg-d-foreground/20 focus-visible:border-d-ring focus-visible:ring-d-ring/50 inline-flex h-[1.25rem] w-8 shrink-0 cursor-pointer items-center justify-start rounded-full border-0 px-0.5 py-0.5 transition-colors duration-300 outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
|
|
15
15
|
r
|
|
16
16
|
),
|
|
17
|
-
...
|
|
17
|
+
...o,
|
|
18
18
|
children: /* @__PURE__ */ e(
|
|
19
19
|
n,
|
|
20
20
|
{
|
|
21
21
|
"data-slot": "switch-thumb",
|
|
22
22
|
className: t(
|
|
23
|
-
|
|
23
|
+
// Smooth slide: track w-8 (32px) with px-0.5 (2px) each side => inner 28px.
|
|
24
|
+
// Thumb size is 16px, so travel distance = 28 - 16 = 12px.
|
|
25
|
+
"bg-d-foreground data-[state=unchecked]:bg-d-foreground data-[state=checked]:bg-d-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform duration-200 ease-out will-change-transform data-[state=checked]:translate-x-[12px] data-[state=unchecked]:translate-x-0"
|
|
24
26
|
)
|
|
25
27
|
}
|
|
26
28
|
)
|