laif-ds 1.0.3 → 1.0.5
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/CHANGELOG.md +12 -0
- package/dist/_virtual/index2.js +5 -2
- package/dist/_virtual/index3.js +2 -5
- package/dist/_virtual/index5.js +5 -5
- package/dist/_virtual/index6.js +2 -2
- package/dist/_virtual/index7.js +2 -2
- package/dist/agent-docs/adoption-report.json +14 -15
- package/dist/agent-docs/components/Button.md +1 -1
- package/dist/agent-docs/manifest.json +3 -3
- package/dist/components/design-tokens.js +4 -1
- package/dist/components/ui/button.js +60 -46
- package/dist/components/ui/input.js +167 -136
- package/dist/css-for-template.css +9 -0
- package/dist/index.d.ts +1 -1
- package/dist/node_modules/eventemitter3/index.js +1 -1
- package/dist/node_modules/eventemitter3/index2.js +1 -1
- package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.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.v3.css +1 -1
- package/package.json +1 -1
|
@@ -1,41 +1,42 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { cva as
|
|
2
|
+
import { jsxs as u, jsx as o } from "react/jsx-runtime";
|
|
3
|
+
import { cva as G } from "../../node_modules/class-variance-authority/dist/index.js";
|
|
4
4
|
import * as a from "react";
|
|
5
|
-
import { designTokens as
|
|
6
|
-
import { Label as
|
|
7
|
-
import { cn as
|
|
8
|
-
import { Icon as
|
|
9
|
-
import { Typo as
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
5
|
+
import { designTokens as i } from "../design-tokens.js";
|
|
6
|
+
import { Label as oe } from "./label.js";
|
|
7
|
+
import { cn as c } from "../../lib/utils.js";
|
|
8
|
+
import { Icon as k } from "./icon.js";
|
|
9
|
+
import { Typo as ie } from "./typo.js";
|
|
10
|
+
const le = G(
|
|
11
|
+
c(
|
|
12
|
+
i.input.base,
|
|
13
|
+
i.radius.default,
|
|
14
14
|
"items-center gap-2 px-3",
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
i.focusRingWithin,
|
|
16
|
+
i.input.invalid
|
|
17
17
|
),
|
|
18
18
|
{
|
|
19
19
|
variants: {
|
|
20
20
|
size: {
|
|
21
|
-
default:
|
|
22
|
-
sm:
|
|
23
|
-
lg:
|
|
21
|
+
default: i.sizes.default,
|
|
22
|
+
sm: i.sizes.sm,
|
|
23
|
+
lg: i.sizes.lg
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
defaultVariants: {
|
|
27
27
|
size: "default"
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
),
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
), ce = G(
|
|
31
|
+
c(
|
|
32
|
+
i.text.base,
|
|
33
33
|
"shadow-none flex-1 min-w-0 bg-transparent outline-none border-0 p-0 overflow-hidden text-ellipsis",
|
|
34
34
|
"file:text-d-foreground file:inline-flex file:border-0 file:bg-transparent file:text-sm file:font-medium",
|
|
35
|
-
|
|
35
|
+
i.text.placeholder,
|
|
36
36
|
"selection:bg-d-primary selection:text-d-primary-foreground",
|
|
37
|
-
|
|
38
|
-
"[-webkit-autofill]:shadow-[0_0_0_1000px_transparent_inset] [-webkit-autofill]:[-webkit-text-fill-color:inherit]"
|
|
37
|
+
i.interaction.disabled,
|
|
38
|
+
"[-webkit-autofill]:shadow-[0_0_0_1000px_transparent_inset] [-webkit-autofill]:[-webkit-text-fill-color:inherit]",
|
|
39
|
+
"[&::-webkit-search-cancel-button]:appearance-none [&::-webkit-search-decoration]:appearance-none"
|
|
39
40
|
),
|
|
40
41
|
{
|
|
41
42
|
variants: {
|
|
@@ -49,167 +50,197 @@ const ae = j(
|
|
|
49
50
|
size: "default"
|
|
50
51
|
}
|
|
51
52
|
}
|
|
52
|
-
),
|
|
53
|
+
), x = {
|
|
53
54
|
show: "Mostra password",
|
|
54
55
|
hide: "Nascondi password"
|
|
55
|
-
},
|
|
56
|
+
}, T = "Cancella", xe = a.forwardRef(
|
|
56
57
|
({
|
|
57
|
-
className:
|
|
58
|
-
type:
|
|
59
|
-
label:
|
|
60
|
-
labelClassName:
|
|
61
|
-
id:
|
|
62
|
-
iconLeft:
|
|
63
|
-
iconRight:
|
|
64
|
-
startContent:
|
|
65
|
-
endContent:
|
|
66
|
-
size:
|
|
67
|
-
disabled:
|
|
68
|
-
required:
|
|
69
|
-
onBlur:
|
|
70
|
-
onChange:
|
|
71
|
-
onInvalid:
|
|
72
|
-
"aria-invalid":
|
|
73
|
-
"aria-describedby":
|
|
74
|
-
showValidMessage:
|
|
75
|
-
showValidityMessage:
|
|
76
|
-
validityI18n:
|
|
77
|
-
|
|
78
|
-
},
|
|
79
|
-
const [
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
58
|
+
className: F,
|
|
59
|
+
type: d,
|
|
60
|
+
label: E,
|
|
61
|
+
labelClassName: X,
|
|
62
|
+
id: $,
|
|
63
|
+
iconLeft: M,
|
|
64
|
+
iconRight: V,
|
|
65
|
+
startContent: C,
|
|
66
|
+
endContent: L,
|
|
67
|
+
size: f,
|
|
68
|
+
disabled: l,
|
|
69
|
+
required: O,
|
|
70
|
+
onBlur: _,
|
|
71
|
+
onChange: z,
|
|
72
|
+
onInvalid: B,
|
|
73
|
+
"aria-invalid": J,
|
|
74
|
+
"aria-describedby": K,
|
|
75
|
+
showValidMessage: D = !1,
|
|
76
|
+
showValidityMessage: A = !1,
|
|
77
|
+
validityI18n: t,
|
|
78
|
+
...m
|
|
79
|
+
}, Q) => {
|
|
80
|
+
const [p, Y] = a.useState(!1), [w, N] = a.useState(!0), [Z, R] = a.useState(!1), [U, S] = a.useState(""), q = a.useId(), b = $ ?? q, j = `${b}-validity`, h = a.useRef(null), v = d === "password", W = d === "search", [H, P] = a.useState(
|
|
81
|
+
() => String(m.value ?? m.defaultValue ?? "").length > 0
|
|
82
|
+
), I = v ? p ? "text" : "password" : d, y = J ?? (!w && Z ? !0 : void 0), ee = [K, A && j].filter(Boolean).join(" ").trim() || void 0;
|
|
83
|
+
a.useImperativeHandle(Q, () => h.current);
|
|
84
|
+
const te = a.useCallback(
|
|
85
|
+
(e) => {
|
|
86
|
+
if (l) return;
|
|
87
|
+
const s = e.target;
|
|
85
88
|
if (s.tagName === "INPUT" || s.tagName === "BUTTON") return;
|
|
86
|
-
const r =
|
|
87
|
-
r && (r.focus(), !
|
|
89
|
+
const r = h.current;
|
|
90
|
+
r && (r.focus(), !v && d !== "file" && r.select());
|
|
88
91
|
},
|
|
89
|
-
[
|
|
90
|
-
),
|
|
91
|
-
(
|
|
92
|
-
const s =
|
|
92
|
+
[l, v, d]
|
|
93
|
+
), g = a.useCallback(
|
|
94
|
+
(e) => {
|
|
95
|
+
const s = e.validity, r = e.validationMessage !== "" ? e.validationMessage : "✓";
|
|
93
96
|
if (s.valid)
|
|
94
97
|
return {
|
|
95
98
|
isValid: !0,
|
|
96
|
-
message:
|
|
99
|
+
message: D ? t?.valid ?? r : ""
|
|
97
100
|
};
|
|
98
|
-
if (!
|
|
101
|
+
if (!t)
|
|
99
102
|
return { isValid: !1, message: r };
|
|
100
|
-
let
|
|
101
|
-
return s.valueMissing &&
|
|
103
|
+
let n = r;
|
|
104
|
+
return s.valueMissing && t.valueMissing ? n = t.valueMissing : s.typeMismatch && t.typeMismatch ? n = t.typeMismatch : s.patternMismatch && t.patternMismatch ? n = t.patternMismatch : s.tooLong && t.tooLong ? n = t.tooLong : s.tooShort && t.tooShort ? n = t.tooShort : s.rangeUnderflow && t.rangeUnderflow ? n = t.rangeUnderflow : s.rangeOverflow && t.rangeOverflow ? n = t.rangeOverflow : s.badInput && t.badInput ? n = t.badInput : s.stepMismatch && t.stepMismatch ? n = t.stepMismatch : s.customError && t.customError && (n = t.customError), { isValid: !1, message: n };
|
|
102
105
|
},
|
|
103
|
-
[
|
|
106
|
+
[D, t]
|
|
104
107
|
);
|
|
105
108
|
a.useEffect(() => {
|
|
106
|
-
if (
|
|
107
|
-
const { isValid:
|
|
108
|
-
|
|
109
|
+
if (h.current) {
|
|
110
|
+
const { isValid: e, message: s } = g(h.current);
|
|
111
|
+
N(e), S(s);
|
|
109
112
|
}
|
|
110
|
-
}, [
|
|
111
|
-
const
|
|
112
|
-
(
|
|
113
|
-
|
|
114
|
-
const { isValid: s, message: r } =
|
|
115
|
-
|
|
113
|
+
}, [g]);
|
|
114
|
+
const se = a.useCallback(
|
|
115
|
+
(e) => {
|
|
116
|
+
R(!0);
|
|
117
|
+
const { isValid: s, message: r } = g(e.currentTarget);
|
|
118
|
+
N(s), S(r), P(e.currentTarget.value.length > 0), z?.(e);
|
|
116
119
|
},
|
|
117
|
-
[
|
|
118
|
-
)
|
|
119
|
-
|
|
120
|
-
|
|
120
|
+
[z, g]
|
|
121
|
+
);
|
|
122
|
+
a.useEffect(() => {
|
|
123
|
+
m.value !== void 0 && P(String(m.value).length > 0);
|
|
124
|
+
}, [m.value]);
|
|
125
|
+
const ae = a.useCallback(() => {
|
|
126
|
+
const e = h.current;
|
|
127
|
+
if (!e) return;
|
|
128
|
+
Object.getOwnPropertyDescriptor(
|
|
129
|
+
window.HTMLInputElement.prototype,
|
|
130
|
+
"value"
|
|
131
|
+
)?.set?.call(e, ""), e.dispatchEvent(new Event("input", { bubbles: !0 })), e.focus();
|
|
132
|
+
}, []), re = a.useCallback(
|
|
133
|
+
(e) => {
|
|
134
|
+
R(!0), _?.(e);
|
|
121
135
|
},
|
|
122
|
-
[
|
|
123
|
-
),
|
|
124
|
-
(
|
|
125
|
-
const { isValid: s, message: r } =
|
|
126
|
-
|
|
136
|
+
[_]
|
|
137
|
+
), ne = a.useCallback(
|
|
138
|
+
(e) => {
|
|
139
|
+
const { isValid: s, message: r } = g(e.currentTarget);
|
|
140
|
+
N(s), S(r), B?.(e);
|
|
127
141
|
},
|
|
128
|
-
[
|
|
142
|
+
[B, g]
|
|
129
143
|
);
|
|
130
|
-
return /* @__PURE__ */
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
!
|
|
144
|
+
return /* @__PURE__ */ u("div", { className: c("flex flex-col gap-1.5", F), children: [
|
|
145
|
+
E && /* @__PURE__ */ u(oe, { htmlFor: b, className: c("gap-0.5", X), children: [
|
|
146
|
+
E,
|
|
147
|
+
O && w && /* @__PURE__ */ o("div", { children: "*" }),
|
|
148
|
+
!w && /* @__PURE__ */ o("div", { className: "text-d-destructive", children: "*" })
|
|
135
149
|
] }),
|
|
136
|
-
/* @__PURE__ */
|
|
150
|
+
/* @__PURE__ */ u(
|
|
137
151
|
"div",
|
|
138
152
|
{
|
|
139
|
-
className:
|
|
140
|
-
|
|
141
|
-
|
|
153
|
+
className: c(
|
|
154
|
+
le({ size: f }),
|
|
155
|
+
l ? "cursor-not-allowed opacity-50" : "cursor-text"
|
|
142
156
|
),
|
|
143
|
-
"aria-invalid":
|
|
144
|
-
onClick:
|
|
157
|
+
"aria-invalid": y,
|
|
158
|
+
onClick: te,
|
|
145
159
|
children: [
|
|
146
|
-
(
|
|
147
|
-
|
|
148
|
-
|
|
160
|
+
(M || C) && /* @__PURE__ */ u("div", { className: "text-d-muted-foreground flex shrink-0 items-center gap-2", children: [
|
|
161
|
+
M && /* @__PURE__ */ o(k, { name: M, size: f === "lg" ? "sm" : "xs" }),
|
|
162
|
+
C
|
|
149
163
|
] }),
|
|
150
|
-
/* @__PURE__ */
|
|
164
|
+
/* @__PURE__ */ o(
|
|
151
165
|
"input",
|
|
152
166
|
{
|
|
153
|
-
id:
|
|
154
|
-
type:
|
|
167
|
+
id: b,
|
|
168
|
+
type: I,
|
|
155
169
|
"data-slot": "input",
|
|
156
|
-
className:
|
|
157
|
-
ref:
|
|
158
|
-
disabled:
|
|
159
|
-
onChange:
|
|
160
|
-
onBlur:
|
|
161
|
-
onInvalid:
|
|
162
|
-
"aria-invalid":
|
|
163
|
-
"aria-describedby":
|
|
164
|
-
required:
|
|
165
|
-
step:
|
|
166
|
-
|
|
170
|
+
className: c(ce({ size: f })),
|
|
171
|
+
ref: h,
|
|
172
|
+
disabled: l,
|
|
173
|
+
onChange: se,
|
|
174
|
+
onBlur: re,
|
|
175
|
+
onInvalid: ne,
|
|
176
|
+
"aria-invalid": y,
|
|
177
|
+
"aria-describedby": ee,
|
|
178
|
+
required: O,
|
|
179
|
+
step: d === "number" ? "any" : void 0,
|
|
180
|
+
...m
|
|
167
181
|
}
|
|
168
182
|
),
|
|
169
|
-
|
|
183
|
+
v ? /* @__PURE__ */ u(
|
|
170
184
|
"button",
|
|
171
185
|
{
|
|
172
186
|
type: "button",
|
|
173
|
-
onClick: (
|
|
174
|
-
|
|
187
|
+
onClick: (e) => {
|
|
188
|
+
e.stopPropagation(), e.preventDefault(), Y((s) => !s);
|
|
175
189
|
},
|
|
176
|
-
className:
|
|
190
|
+
className: c(
|
|
177
191
|
"text-d-muted-foreground flex shrink-0 cursor-pointer items-center",
|
|
178
|
-
|
|
192
|
+
l && "cursor-not-allowed"
|
|
179
193
|
),
|
|
180
|
-
"aria-label":
|
|
181
|
-
"aria-pressed":
|
|
182
|
-
"aria-controls":
|
|
183
|
-
title:
|
|
184
|
-
disabled:
|
|
194
|
+
"aria-label": p ? x.hide : x.show,
|
|
195
|
+
"aria-pressed": p,
|
|
196
|
+
"aria-controls": b,
|
|
197
|
+
title: p ? x.hide : x.show,
|
|
198
|
+
disabled: l,
|
|
185
199
|
children: [
|
|
186
|
-
/* @__PURE__ */
|
|
187
|
-
|
|
200
|
+
/* @__PURE__ */ o(
|
|
201
|
+
k,
|
|
188
202
|
{
|
|
189
|
-
name:
|
|
190
|
-
size:
|
|
203
|
+
name: p ? "EyeOff" : "Eye",
|
|
204
|
+
size: f === "lg" ? "sm" : "xs"
|
|
191
205
|
}
|
|
192
206
|
),
|
|
193
|
-
/* @__PURE__ */
|
|
207
|
+
/* @__PURE__ */ o("span", { className: "sr-only", children: p ? x.hide : x.show })
|
|
194
208
|
]
|
|
195
209
|
}
|
|
196
|
-
) : (
|
|
197
|
-
|
|
198
|
-
|
|
210
|
+
) : (W && H && !l ? !0 : V || L) && /* @__PURE__ */ u("div", { className: "text-d-muted-foreground flex shrink-0 items-center gap-2", children: [
|
|
211
|
+
L,
|
|
212
|
+
W && H && !l && /* @__PURE__ */ u(
|
|
213
|
+
"button",
|
|
214
|
+
{
|
|
215
|
+
type: "button",
|
|
216
|
+
onClick: (e) => {
|
|
217
|
+
e.stopPropagation(), e.preventDefault(), ae();
|
|
218
|
+
},
|
|
219
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
220
|
+
className: "text-d-muted-foreground flex shrink-0 cursor-pointer items-center",
|
|
221
|
+
"aria-label": T,
|
|
222
|
+
title: T,
|
|
223
|
+
children: [
|
|
224
|
+
/* @__PURE__ */ o(k, { name: "X", size: f === "lg" ? "sm" : "xs" }),
|
|
225
|
+
/* @__PURE__ */ o("span", { className: "sr-only", children: T })
|
|
226
|
+
]
|
|
227
|
+
}
|
|
228
|
+
),
|
|
229
|
+
V && /* @__PURE__ */ o(k, { name: V, size: f === "lg" ? "sm" : "xs" })
|
|
199
230
|
] })
|
|
200
231
|
]
|
|
201
232
|
}
|
|
202
233
|
),
|
|
203
|
-
|
|
204
|
-
|
|
234
|
+
A && U.length > 0 && /* @__PURE__ */ o(
|
|
235
|
+
ie,
|
|
205
236
|
{
|
|
206
237
|
variant: "caption",
|
|
207
|
-
id:
|
|
208
|
-
role:
|
|
238
|
+
id: j,
|
|
239
|
+
role: w ? "status" : "alert",
|
|
209
240
|
"aria-live": "polite",
|
|
210
|
-
className:
|
|
241
|
+
className: c(
|
|
211
242
|
"max-w-full min-w-0 text-wrap",
|
|
212
|
-
|
|
243
|
+
w ? "text-d-success" : "text-d-destructive"
|
|
213
244
|
),
|
|
214
245
|
children: U
|
|
215
246
|
}
|
|
@@ -218,6 +249,6 @@ const ae = j(
|
|
|
218
249
|
}
|
|
219
250
|
);
|
|
220
251
|
export {
|
|
221
|
-
|
|
222
|
-
|
|
252
|
+
xe as Input,
|
|
253
|
+
ce as inputVariants
|
|
223
254
|
};
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
/* This files contains everything that should be imported in the template */
|
|
2
2
|
|
|
3
|
+
/* A control that can be used right now: neither natively disabled nor marked
|
|
4
|
+
`data-disabled` (how Button flags a disabled `asChild` link). Gates hover/press feedback without `pointer-events: none`,
|
|
5
|
+
which would drop the `not-allowed` cursor and any tooltip explaining why.
|
|
6
|
+
`:where()` keeps specificity at zero so a consumer's `hover:` class still
|
|
7
|
+
wins. Declared here, not in index.css, because consumer apps compile the
|
|
8
|
+
laif-ds classes with their own Tailwind and only import this file.
|
|
9
|
+
Mirrored in tailwind.config.v3.js. */
|
|
10
|
+
@custom-variant interactive (&:where(:not(:disabled, [data-disabled])));
|
|
11
|
+
|
|
3
12
|
@theme inline {
|
|
4
13
|
--radius-d-sm: calc(var(--d-radius) - 4px);
|
|
5
14
|
--radius-d-md: calc(var(--d-radius) - 2px);
|
package/dist/index.d.ts
CHANGED
|
@@ -952,7 +952,7 @@ export declare function BreadcrumbPage({ className, ...props }: React_2.Componen
|
|
|
952
952
|
|
|
953
953
|
export declare function BreadcrumbSeparator({ children, className, ...props }: React_2.ComponentProps<"li">): JSX.Element;
|
|
954
954
|
|
|
955
|
-
export declare function Button({ className, variant, size, asChild, iconLeft, iconRight, isLoading, ...props }: ButtonProps): JSX.Element;
|
|
955
|
+
export declare function Button({ className, variant, size, asChild, iconLeft, iconRight, isLoading, disabled, onClick, ...props }: ButtonProps): JSX.Element;
|
|
956
956
|
|
|
957
957
|
export declare interface ButtonProps extends React_2.ComponentProps<"button"> {
|
|
958
958
|
variant?: ButtonVariant;
|
|
@@ -3,7 +3,7 @@ import { stringify as w } from "../../comma-separated-tokens/index.js";
|
|
|
3
3
|
import { ok as u } from "../../devlop/lib/default.js";
|
|
4
4
|
import { svg as m, html as C } from "../../property-information/index.js";
|
|
5
5
|
import { stringify as N } from "../../space-separated-tokens/index.js";
|
|
6
|
-
import S from "../../../_virtual/
|
|
6
|
+
import S from "../../../_virtual/index5.js";
|
|
7
7
|
import { whitespace as j } from "../../hast-util-whitespace/lib/index.js";
|
|
8
8
|
import { name as x } from "../../estree-util-is-identifier-name/lib/index.js";
|
|
9
9
|
import { VFileMessage as h } from "../../vfile-message/lib/index.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { __module as e } from "../../../_virtual/
|
|
2
|
+
import { __module as e } from "../../../_virtual/index3.js";
|
|
3
3
|
import { __require as i } from "../cjs/use-sync-external-store-shim.production.js";
|
|
4
4
|
import { __require as o } from "../cjs/use-sync-external-store-shim.development.js";
|
|
5
5
|
var r;
|