@agentero/design-system 0.32.2 → 0.33.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.
@@ -0,0 +1,57 @@
1
+ "use client";
2
+ import { Button as e } from "../button/button.js";
3
+ import { Input as t } from "../input/input.js";
4
+ import { InputGroup as n } from "../input-group/index.js";
5
+ import { IconVisibility as r, IconVisibilityOff as i } from "./icons.js";
6
+ import { tv as a } from "tailwind-variants";
7
+ import { useState as o } from "react";
8
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
9
+ //#region src/input-password/input-password.tsx
10
+ var l = a({
11
+ slots: {
12
+ toggle: "group-has-[input:disabled]/input-group:hidden",
13
+ button: "[&_svg]:mx-0"
14
+ },
15
+ variants: { size: {
16
+ sm: {
17
+ toggle: "-me-2.25",
18
+ button: "rounded-sm [&_svg]:size-4"
19
+ },
20
+ md: {
21
+ toggle: "-me-2.25",
22
+ button: "rounded-sm [&_svg]:size-5"
23
+ },
24
+ lg: {
25
+ toggle: "-me-1.25",
26
+ button: "[&_svg]:size-6"
27
+ }
28
+ } },
29
+ defaultVariants: { size: "md" }
30
+ }), u = ({ className: a, size: u, ...d }) => {
31
+ let [f, p] = o("password"), m = f === "password", h = l({ size: u });
32
+ return /* @__PURE__ */ c(n.Root, {
33
+ "data-slot": "input-password",
34
+ className: a,
35
+ children: [/* @__PURE__ */ s(t, {
36
+ ...d,
37
+ size: u,
38
+ type: f
39
+ }), /* @__PURE__ */ s(n.Addon, {
40
+ className: h.toggle(),
41
+ children: /* @__PURE__ */ s(e, {
42
+ type: "button",
43
+ variant: "ghost",
44
+ iconOnly: !0,
45
+ size: u === "sm" ? "xs" : "sm",
46
+ className: h.button(),
47
+ "aria-label": m ? "Show password" : "Hide password",
48
+ onMouseDown: (e) => e.preventDefault(),
49
+ onClick: () => p(m ? "text" : "password"),
50
+ children: s(m ? r : i, {})
51
+ })
52
+ })]
53
+ });
54
+ };
55
+ u.displayName = "InputPassword";
56
+ //#endregion
57
+ export { u as InputPassword, l as inputPasswordRecipe };