@fanvue/ui 1.2.1 → 1.3.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/dist/cjs/components/Icons/EyeClosedIcon.cjs +49 -0
- package/dist/cjs/components/Icons/EyeClosedIcon.cjs.map +1 -0
- package/dist/cjs/components/PasswordField/PasswordField.cjs +59 -0
- package/dist/cjs/components/PasswordField/PasswordField.cjs.map +1 -0
- package/dist/cjs/index.cjs +4 -0
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/components/Icons/EyeClosedIcon.mjs +32 -0
- package/dist/components/Icons/EyeClosedIcon.mjs.map +1 -0
- package/dist/components/PasswordField/PasswordField.mjs +42 -0
- package/dist/components/PasswordField/PasswordField.mjs.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.mjs +4 -0
- package/dist/index.mjs.map +1 -1
- package/dist/styles/theme.css +3 -0
- package/package.json +2 -1
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
5
|
+
const React = require("react");
|
|
6
|
+
const cn = require("../../utils/cn.cjs");
|
|
7
|
+
function _interopNamespaceDefault(e) {
|
|
8
|
+
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
9
|
+
if (e) {
|
|
10
|
+
for (const k in e) {
|
|
11
|
+
if (k !== "default") {
|
|
12
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
13
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: () => e[k]
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
n.default = e;
|
|
21
|
+
return Object.freeze(n);
|
|
22
|
+
}
|
|
23
|
+
const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
|
|
24
|
+
const EyeClosedIcon = React__namespace.forwardRef(
|
|
25
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
26
|
+
"svg",
|
|
27
|
+
{
|
|
28
|
+
ref,
|
|
29
|
+
viewBox: "0 0 20 20",
|
|
30
|
+
fill: "none",
|
|
31
|
+
"aria-hidden": "true",
|
|
32
|
+
className: cn.cn("size-5", className),
|
|
33
|
+
...props,
|
|
34
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
35
|
+
"path",
|
|
36
|
+
{
|
|
37
|
+
d: "M8.233 8.233A2.5 2.5 0 1 0 11.767 11.767M8.233 8.233 2.5 2.5M8.233 8.233 11.767 11.767M11.767 11.767 17.5 17.5M14.95 14.95c1.55-1.217 2.55-2.95 2.55-4.95 0-1.667-3.333-5.833-7.5-5.833-1.333 0-2.617.5-3.717 1.217M5.05 5.05C3.5 6.267 2.5 8 2.5 10c0 1.667 3.333 5.833 7.5 5.833 1.333 0 2.617-.5 3.717-1.217",
|
|
38
|
+
stroke: "currentColor",
|
|
39
|
+
strokeWidth: "1.5",
|
|
40
|
+
strokeLinecap: "round",
|
|
41
|
+
strokeLinejoin: "round"
|
|
42
|
+
}
|
|
43
|
+
)
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
);
|
|
47
|
+
EyeClosedIcon.displayName = "EyeClosedIcon";
|
|
48
|
+
exports.EyeClosedIcon = EyeClosedIcon;
|
|
49
|
+
//# sourceMappingURL=EyeClosedIcon.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EyeClosedIcon.cjs","sources":["../../../../src/components/Icons/EyeClosedIcon.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"@/utils/cn\";\nimport type { IconProps } from \"./types\";\n\n/** A closed eye icon for visibility/show actions (20 × 20). */\nexport const EyeClosedIcon = React.forwardRef<SVGSVGElement, IconProps>(\n ({ className, ...props }, ref) => (\n <svg\n ref={ref}\n viewBox=\"0 0 20 20\"\n fill=\"none\"\n aria-hidden=\"true\"\n className={cn(\"size-5\", className)}\n {...props}\n >\n <path\n d=\"M8.233 8.233A2.5 2.5 0 1 0 11.767 11.767M8.233 8.233 2.5 2.5M8.233 8.233 11.767 11.767M11.767 11.767 17.5 17.5M14.95 14.95c1.55-1.217 2.55-2.95 2.55-4.95 0-1.667-3.333-5.833-7.5-5.833-1.333 0-2.617.5-3.717 1.217M5.05 5.05C3.5 6.267 2.5 8 2.5 10c0 1.667 3.333 5.833 7.5 5.833 1.333 0 2.617-.5 3.717-1.217\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n ),\n);\n\nEyeClosedIcon.displayName = \"EyeClosedIcon\";\n"],"names":["React","jsx","cn"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAKO,MAAM,gBAAgBA,iBAAM;AAAA,EACjC,CAAC,EAAE,WAAW,GAAG,MAAA,GAAS,QACxBC,2BAAAA;AAAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA,SAAQ;AAAA,MACR,MAAK;AAAA,MACL,eAAY;AAAA,MACZ,WAAWC,GAAAA,GAAG,UAAU,SAAS;AAAA,MAChC,GAAG;AAAA,MAEJ,UAAAD,2BAAAA;AAAAA,QAAC;AAAA,QAAA;AAAA,UACC,GAAE;AAAA,UACF,QAAO;AAAA,UACP,aAAY;AAAA,UACZ,eAAc;AAAA,UACd,gBAAe;AAAA,QAAA;AAAA,MAAA;AAAA,IACjB;AAAA,EAAA;AAGN;AAEA,cAAc,cAAc;;"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
5
|
+
const React = require("react");
|
|
6
|
+
const EyeClosedIcon = require("../Icons/EyeClosedIcon.cjs");
|
|
7
|
+
const EyeIcon = require("../Icons/EyeIcon.cjs");
|
|
8
|
+
const TextField = require("../TextField/TextField.cjs");
|
|
9
|
+
function _interopNamespaceDefault(e) {
|
|
10
|
+
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
11
|
+
if (e) {
|
|
12
|
+
for (const k in e) {
|
|
13
|
+
if (k !== "default") {
|
|
14
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
15
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: () => e[k]
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
n.default = e;
|
|
23
|
+
return Object.freeze(n);
|
|
24
|
+
}
|
|
25
|
+
const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
|
|
26
|
+
const PasswordField = React__namespace.forwardRef(
|
|
27
|
+
({ disabled, ...props }, ref) => {
|
|
28
|
+
const [showPassword, setShowPassword] = React__namespace.useState(false);
|
|
29
|
+
const togglePasswordVisibility = () => {
|
|
30
|
+
setShowPassword((prev) => !prev);
|
|
31
|
+
};
|
|
32
|
+
const rightIcon = /* @__PURE__ */ jsxRuntime.jsx(
|
|
33
|
+
"button",
|
|
34
|
+
{
|
|
35
|
+
type: "button",
|
|
36
|
+
onClick: togglePasswordVisibility,
|
|
37
|
+
disabled,
|
|
38
|
+
"aria-label": showPassword ? "Hide password" : "Show password",
|
|
39
|
+
tabIndex: -1,
|
|
40
|
+
className: "flex size-5 shrink-0 items-center justify-center text-body-200 transition-colors hover:text-body-100 focus:outline-none disabled:cursor-not-allowed",
|
|
41
|
+
children: showPassword ? /* @__PURE__ */ jsxRuntime.jsx(EyeClosedIcon.EyeClosedIcon, {}) : /* @__PURE__ */ jsxRuntime.jsx(EyeIcon.EyeIcon, {})
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
45
|
+
TextField.TextField,
|
|
46
|
+
{
|
|
47
|
+
ref,
|
|
48
|
+
type: showPassword ? "text" : "password",
|
|
49
|
+
disabled,
|
|
50
|
+
rightIcon,
|
|
51
|
+
"aria-label": !props.label ? "Password field" : void 0,
|
|
52
|
+
...props
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
PasswordField.displayName = "PasswordField";
|
|
58
|
+
exports.PasswordField = PasswordField;
|
|
59
|
+
//# sourceMappingURL=PasswordField.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PasswordField.cjs","sources":["../../../../src/components/PasswordField/PasswordField.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { EyeClosedIcon } from \"../Icons/EyeClosedIcon\";\nimport { EyeIcon } from \"../Icons/EyeIcon\";\nimport { TextField, type TextFieldProps } from \"../TextField/TextField\";\n\nexport type PasswordFieldSize = \"48\" | \"40\" | \"32\";\n\nexport interface PasswordFieldProps extends Omit<TextFieldProps, \"type\" | \"rightIcon\"> {\n /** Size variant of the password field */\n size?: PasswordFieldSize;\n}\n\nexport const PasswordField = React.forwardRef<HTMLInputElement, PasswordFieldProps>(\n ({ disabled, ...props }, ref) => {\n const [showPassword, setShowPassword] = React.useState(false);\n\n const togglePasswordVisibility = () => {\n setShowPassword((prev) => !prev);\n };\n\n const rightIcon = (\n <button\n type=\"button\"\n onClick={togglePasswordVisibility}\n disabled={disabled}\n aria-label={showPassword ? \"Hide password\" : \"Show password\"}\n tabIndex={-1}\n className=\"flex size-5 shrink-0 items-center justify-center text-body-200 transition-colors hover:text-body-100 focus:outline-none disabled:cursor-not-allowed\"\n >\n {showPassword ? <EyeClosedIcon /> : <EyeIcon />}\n </button>\n );\n\n return (\n <TextField\n ref={ref}\n type={showPassword ? \"text\" : \"password\"}\n disabled={disabled}\n rightIcon={rightIcon}\n aria-label={!props.label ? \"Password field\" : undefined}\n {...props}\n />\n );\n },\n);\n\nPasswordField.displayName = \"PasswordField\";\n"],"names":["React","jsx","EyeClosedIcon","EyeIcon","TextField"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAYO,MAAM,gBAAgBA,iBAAM;AAAA,EACjC,CAAC,EAAE,UAAU,GAAG,MAAA,GAAS,QAAQ;AAC/B,UAAM,CAAC,cAAc,eAAe,IAAIA,iBAAM,SAAS,KAAK;AAE5D,UAAM,2BAA2B,MAAM;AACrC,sBAAgB,CAAC,SAAS,CAAC,IAAI;AAAA,IACjC;AAEA,UAAM,YACJC,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,SAAS;AAAA,QACT;AAAA,QACA,cAAY,eAAe,kBAAkB;AAAA,QAC7C,UAAU;AAAA,QACV,WAAU;AAAA,QAET,UAAA,eAAeA,+BAACC,cAAAA,eAAA,CAAA,CAAc,mCAAMC,QAAAA,SAAA,CAAA,CAAQ;AAAA,MAAA;AAAA,IAAA;AAIjD,WACEF,2BAAAA;AAAAA,MAACG,UAAAA;AAAAA,MAAA;AAAA,QACC;AAAA,QACA,MAAM,eAAe,SAAS;AAAA,QAC9B;AAAA,QACA;AAAA,QACA,cAAY,CAAC,MAAM,QAAQ,mBAAmB;AAAA,QAC7C,GAAG;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;AAEA,cAAc,cAAc;;"}
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -22,6 +22,7 @@ const CrossIcon = require("./components/Icons/CrossIcon.cjs");
|
|
|
22
22
|
const CrownIcon = require("./components/Icons/CrownIcon.cjs");
|
|
23
23
|
const ErrorCircleIcon = require("./components/Icons/ErrorCircleIcon.cjs");
|
|
24
24
|
const ErrorIcon = require("./components/Icons/ErrorIcon.cjs");
|
|
25
|
+
const EyeClosedIcon = require("./components/Icons/EyeClosedIcon.cjs");
|
|
25
26
|
const EyeIcon = require("./components/Icons/EyeIcon.cjs");
|
|
26
27
|
const FireIcon = require("./components/Icons/FireIcon.cjs");
|
|
27
28
|
const HomeIcon = require("./components/Icons/HomeIcon.cjs");
|
|
@@ -38,6 +39,7 @@ const WarningIcon = require("./components/Icons/WarningIcon.cjs");
|
|
|
38
39
|
const WarningTriangleIcon = require("./components/Icons/WarningTriangleIcon.cjs");
|
|
39
40
|
const Logo = require("./components/Logo/Logo.cjs");
|
|
40
41
|
const Pagination = require("./components/Pagination/Pagination.cjs");
|
|
42
|
+
const PasswordField = require("./components/PasswordField/PasswordField.cjs");
|
|
41
43
|
const Pill = require("./components/Pill/Pill.cjs");
|
|
42
44
|
const ProgressBar = require("./components/ProgressBar/ProgressBar.cjs");
|
|
43
45
|
const Radio = require("./components/Radio/Radio.cjs");
|
|
@@ -79,6 +81,7 @@ exports.CrossIcon = CrossIcon.CrossIcon;
|
|
|
79
81
|
exports.CrownIcon = CrownIcon.CrownIcon;
|
|
80
82
|
exports.ErrorCircleIcon = ErrorCircleIcon.ErrorCircleIcon;
|
|
81
83
|
exports.ErrorIcon = ErrorIcon.ErrorIcon;
|
|
84
|
+
exports.EyeClosedIcon = EyeClosedIcon.EyeClosedIcon;
|
|
82
85
|
exports.EyeIcon = EyeIcon.EyeIcon;
|
|
83
86
|
exports.FireIcon = FireIcon.FireIcon;
|
|
84
87
|
exports.HomeIcon = HomeIcon.HomeIcon;
|
|
@@ -95,6 +98,7 @@ exports.WarningIcon = WarningIcon.WarningIcon;
|
|
|
95
98
|
exports.WarningTriangleIcon = WarningTriangleIcon.WarningTriangleIcon;
|
|
96
99
|
exports.Logo = Logo.Logo;
|
|
97
100
|
exports.Pagination = Pagination.Pagination;
|
|
101
|
+
exports.PasswordField = PasswordField.PasswordField;
|
|
98
102
|
exports.Pill = Pill.Pill;
|
|
99
103
|
exports.ProgressBar = ProgressBar.ProgressBar;
|
|
100
104
|
exports.Radio = Radio.Radio;
|
package/dist/cjs/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { cn } from "../../utils/cn.mjs";
|
|
5
|
+
const EyeClosedIcon = React.forwardRef(
|
|
6
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
7
|
+
"svg",
|
|
8
|
+
{
|
|
9
|
+
ref,
|
|
10
|
+
viewBox: "0 0 20 20",
|
|
11
|
+
fill: "none",
|
|
12
|
+
"aria-hidden": "true",
|
|
13
|
+
className: cn("size-5", className),
|
|
14
|
+
...props,
|
|
15
|
+
children: /* @__PURE__ */ jsx(
|
|
16
|
+
"path",
|
|
17
|
+
{
|
|
18
|
+
d: "M8.233 8.233A2.5 2.5 0 1 0 11.767 11.767M8.233 8.233 2.5 2.5M8.233 8.233 11.767 11.767M11.767 11.767 17.5 17.5M14.95 14.95c1.55-1.217 2.55-2.95 2.55-4.95 0-1.667-3.333-5.833-7.5-5.833-1.333 0-2.617.5-3.717 1.217M5.05 5.05C3.5 6.267 2.5 8 2.5 10c0 1.667 3.333 5.833 7.5 5.833 1.333 0 2.617-.5 3.717-1.217",
|
|
19
|
+
stroke: "currentColor",
|
|
20
|
+
strokeWidth: "1.5",
|
|
21
|
+
strokeLinecap: "round",
|
|
22
|
+
strokeLinejoin: "round"
|
|
23
|
+
}
|
|
24
|
+
)
|
|
25
|
+
}
|
|
26
|
+
)
|
|
27
|
+
);
|
|
28
|
+
EyeClosedIcon.displayName = "EyeClosedIcon";
|
|
29
|
+
export {
|
|
30
|
+
EyeClosedIcon
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=EyeClosedIcon.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EyeClosedIcon.mjs","sources":["../../../src/components/Icons/EyeClosedIcon.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"@/utils/cn\";\nimport type { IconProps } from \"./types\";\n\n/** A closed eye icon for visibility/show actions (20 × 20). */\nexport const EyeClosedIcon = React.forwardRef<SVGSVGElement, IconProps>(\n ({ className, ...props }, ref) => (\n <svg\n ref={ref}\n viewBox=\"0 0 20 20\"\n fill=\"none\"\n aria-hidden=\"true\"\n className={cn(\"size-5\", className)}\n {...props}\n >\n <path\n d=\"M8.233 8.233A2.5 2.5 0 1 0 11.767 11.767M8.233 8.233 2.5 2.5M8.233 8.233 11.767 11.767M11.767 11.767 17.5 17.5M14.95 14.95c1.55-1.217 2.55-2.95 2.55-4.95 0-1.667-3.333-5.833-7.5-5.833-1.333 0-2.617.5-3.717 1.217M5.05 5.05C3.5 6.267 2.5 8 2.5 10c0 1.667 3.333 5.833 7.5 5.833 1.333 0 2.617-.5 3.717-1.217\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n ),\n);\n\nEyeClosedIcon.displayName = \"EyeClosedIcon\";\n"],"names":[],"mappings":";;;;AAKO,MAAM,gBAAgB,MAAM;AAAA,EACjC,CAAC,EAAE,WAAW,GAAG,MAAA,GAAS,QACxB;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA,SAAQ;AAAA,MACR,MAAK;AAAA,MACL,eAAY;AAAA,MACZ,WAAW,GAAG,UAAU,SAAS;AAAA,MAChC,GAAG;AAAA,MAEJ,UAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,GAAE;AAAA,UACF,QAAO;AAAA,UACP,aAAY;AAAA,UACZ,eAAc;AAAA,UACd,gBAAe;AAAA,QAAA;AAAA,MAAA;AAAA,IACjB;AAAA,EAAA;AAGN;AAEA,cAAc,cAAc;"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { EyeClosedIcon } from "../Icons/EyeClosedIcon.mjs";
|
|
5
|
+
import { EyeIcon } from "../Icons/EyeIcon.mjs";
|
|
6
|
+
import { TextField } from "../TextField/TextField.mjs";
|
|
7
|
+
const PasswordField = React.forwardRef(
|
|
8
|
+
({ disabled, ...props }, ref) => {
|
|
9
|
+
const [showPassword, setShowPassword] = React.useState(false);
|
|
10
|
+
const togglePasswordVisibility = () => {
|
|
11
|
+
setShowPassword((prev) => !prev);
|
|
12
|
+
};
|
|
13
|
+
const rightIcon = /* @__PURE__ */ jsx(
|
|
14
|
+
"button",
|
|
15
|
+
{
|
|
16
|
+
type: "button",
|
|
17
|
+
onClick: togglePasswordVisibility,
|
|
18
|
+
disabled,
|
|
19
|
+
"aria-label": showPassword ? "Hide password" : "Show password",
|
|
20
|
+
tabIndex: -1,
|
|
21
|
+
className: "flex size-5 shrink-0 items-center justify-center text-body-200 transition-colors hover:text-body-100 focus:outline-none disabled:cursor-not-allowed",
|
|
22
|
+
children: showPassword ? /* @__PURE__ */ jsx(EyeClosedIcon, {}) : /* @__PURE__ */ jsx(EyeIcon, {})
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
return /* @__PURE__ */ jsx(
|
|
26
|
+
TextField,
|
|
27
|
+
{
|
|
28
|
+
ref,
|
|
29
|
+
type: showPassword ? "text" : "password",
|
|
30
|
+
disabled,
|
|
31
|
+
rightIcon,
|
|
32
|
+
"aria-label": !props.label ? "Password field" : void 0,
|
|
33
|
+
...props
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
PasswordField.displayName = "PasswordField";
|
|
39
|
+
export {
|
|
40
|
+
PasswordField
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=PasswordField.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PasswordField.mjs","sources":["../../../src/components/PasswordField/PasswordField.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { EyeClosedIcon } from \"../Icons/EyeClosedIcon\";\nimport { EyeIcon } from \"../Icons/EyeIcon\";\nimport { TextField, type TextFieldProps } from \"../TextField/TextField\";\n\nexport type PasswordFieldSize = \"48\" | \"40\" | \"32\";\n\nexport interface PasswordFieldProps extends Omit<TextFieldProps, \"type\" | \"rightIcon\"> {\n /** Size variant of the password field */\n size?: PasswordFieldSize;\n}\n\nexport const PasswordField = React.forwardRef<HTMLInputElement, PasswordFieldProps>(\n ({ disabled, ...props }, ref) => {\n const [showPassword, setShowPassword] = React.useState(false);\n\n const togglePasswordVisibility = () => {\n setShowPassword((prev) => !prev);\n };\n\n const rightIcon = (\n <button\n type=\"button\"\n onClick={togglePasswordVisibility}\n disabled={disabled}\n aria-label={showPassword ? \"Hide password\" : \"Show password\"}\n tabIndex={-1}\n className=\"flex size-5 shrink-0 items-center justify-center text-body-200 transition-colors hover:text-body-100 focus:outline-none disabled:cursor-not-allowed\"\n >\n {showPassword ? <EyeClosedIcon /> : <EyeIcon />}\n </button>\n );\n\n return (\n <TextField\n ref={ref}\n type={showPassword ? \"text\" : \"password\"}\n disabled={disabled}\n rightIcon={rightIcon}\n aria-label={!props.label ? \"Password field\" : undefined}\n {...props}\n />\n );\n },\n);\n\nPasswordField.displayName = \"PasswordField\";\n"],"names":[],"mappings":";;;;;;AAYO,MAAM,gBAAgB,MAAM;AAAA,EACjC,CAAC,EAAE,UAAU,GAAG,MAAA,GAAS,QAAQ;AAC/B,UAAM,CAAC,cAAc,eAAe,IAAI,MAAM,SAAS,KAAK;AAE5D,UAAM,2BAA2B,MAAM;AACrC,sBAAgB,CAAC,SAAS,CAAC,IAAI;AAAA,IACjC;AAEA,UAAM,YACJ;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,SAAS;AAAA,QACT;AAAA,QACA,cAAY,eAAe,kBAAkB;AAAA,QAC7C,UAAU;AAAA,QACV,WAAU;AAAA,QAET,UAAA,eAAe,oBAAC,eAAA,CAAA,CAAc,wBAAM,SAAA,CAAA,CAAQ;AAAA,MAAA;AAAA,IAAA;AAIjD,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,MAAM,eAAe,SAAS;AAAA,QAC9B;AAAA,QACA;AAAA,QACA,cAAY,CAAC,MAAM,QAAQ,mBAAmB;AAAA,QAC7C,GAAG;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;AAEA,cAAc,cAAc;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -390,6 +390,11 @@ export declare const ErrorIcon: default_2.ForwardRefExoticComponent<default_2.SV
|
|
|
390
390
|
className?: string;
|
|
391
391
|
} & default_2.RefAttributes<SVGSVGElement>>;
|
|
392
392
|
|
|
393
|
+
/** A closed eye icon for visibility/show actions (20 × 20). */
|
|
394
|
+
export declare const EyeClosedIcon: React_2.ForwardRefExoticComponent<React_2.SVGAttributes<SVGSVGElement> & {
|
|
395
|
+
className?: string;
|
|
396
|
+
} & React_2.RefAttributes<SVGSVGElement>>;
|
|
397
|
+
|
|
393
398
|
/** An eye icon for visibility/show actions (20 × 20). */
|
|
394
399
|
export declare const EyeIcon: React_2.ForwardRefExoticComponent<React_2.SVGAttributes<SVGSVGElement> & {
|
|
395
400
|
className?: string;
|
|
@@ -544,6 +549,15 @@ export declare interface PaginationProps extends Omit<React_2.HTMLAttributes<HTM
|
|
|
544
549
|
/** Pagination display style — numbered buttons or minimal dots. */
|
|
545
550
|
export declare type PaginationVariant = "default" | "dots";
|
|
546
551
|
|
|
552
|
+
export declare const PasswordField: React_2.ForwardRefExoticComponent<PasswordFieldProps & React_2.RefAttributes<HTMLInputElement>>;
|
|
553
|
+
|
|
554
|
+
export declare interface PasswordFieldProps extends Omit<TextFieldProps, "type" | "rightIcon"> {
|
|
555
|
+
/** Size variant of the password field */
|
|
556
|
+
size?: PasswordFieldSize;
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
export declare type PasswordFieldSize = "48" | "40" | "32";
|
|
560
|
+
|
|
547
561
|
/**
|
|
548
562
|
* A small rounded label for categorisation, status, or tagging.
|
|
549
563
|
*
|
package/dist/index.mjs
CHANGED
|
@@ -20,6 +20,7 @@ import { CrossIcon } from "./components/Icons/CrossIcon.mjs";
|
|
|
20
20
|
import { CrownIcon } from "./components/Icons/CrownIcon.mjs";
|
|
21
21
|
import { ErrorCircleIcon } from "./components/Icons/ErrorCircleIcon.mjs";
|
|
22
22
|
import { ErrorIcon } from "./components/Icons/ErrorIcon.mjs";
|
|
23
|
+
import { EyeClosedIcon } from "./components/Icons/EyeClosedIcon.mjs";
|
|
23
24
|
import { EyeIcon } from "./components/Icons/EyeIcon.mjs";
|
|
24
25
|
import { FireIcon } from "./components/Icons/FireIcon.mjs";
|
|
25
26
|
import { HomeIcon } from "./components/Icons/HomeIcon.mjs";
|
|
@@ -36,6 +37,7 @@ import { WarningIcon } from "./components/Icons/WarningIcon.mjs";
|
|
|
36
37
|
import { WarningTriangleIcon } from "./components/Icons/WarningTriangleIcon.mjs";
|
|
37
38
|
import { Logo } from "./components/Logo/Logo.mjs";
|
|
38
39
|
import { Pagination } from "./components/Pagination/Pagination.mjs";
|
|
40
|
+
import { PasswordField } from "./components/PasswordField/PasswordField.mjs";
|
|
39
41
|
import { Pill } from "./components/Pill/Pill.mjs";
|
|
40
42
|
import { ProgressBar } from "./components/ProgressBar/ProgressBar.mjs";
|
|
41
43
|
import { Radio } from "./components/Radio/Radio.mjs";
|
|
@@ -77,6 +79,7 @@ export {
|
|
|
77
79
|
Divider,
|
|
78
80
|
ErrorCircleIcon,
|
|
79
81
|
ErrorIcon,
|
|
82
|
+
EyeClosedIcon,
|
|
80
83
|
EyeIcon,
|
|
81
84
|
FireIcon,
|
|
82
85
|
HomeIcon,
|
|
@@ -87,6 +90,7 @@ export {
|
|
|
87
90
|
MicrophoneIcon,
|
|
88
91
|
MinusIcon,
|
|
89
92
|
Pagination,
|
|
93
|
+
PasswordField,
|
|
90
94
|
Pill,
|
|
91
95
|
PlusIcon,
|
|
92
96
|
ProgressBar,
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/styles/theme.css
CHANGED
|
@@ -9,6 +9,9 @@
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
@theme {
|
|
12
|
+
--breakpoint-sm: 850px;
|
|
13
|
+
--breakpoint-md: 1280px;
|
|
14
|
+
|
|
12
15
|
--shadow-background-blur: 0 0 0 2px var(--color-background-inverse-solid), 0 0 0 4px var(--color-brand-purple-500);
|
|
13
16
|
--shadow-focus-ring: 0 0 0 2px var(--color-background-inverse-solid), 0 0 0 4px var(--color-brand-purple-500);
|
|
14
17
|
--color-primary-50: var(--color-primary-50);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fanvue/ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "React component library built with Tailwind CSS for Fanvue ecosystem",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org",
|
|
@@ -111,6 +111,7 @@
|
|
|
111
111
|
"react": "19.2.3",
|
|
112
112
|
"react-day-picker": "9.13.1",
|
|
113
113
|
"react-dom": "19.2.3",
|
|
114
|
+
"remark-gfm": "4.0.1",
|
|
114
115
|
"size-limit": "12.0.0",
|
|
115
116
|
"storybook": "10.2.3",
|
|
116
117
|
"style-dictionary": "4.2.0",
|