@vritti/quantum-ui 0.1.7 → 0.1.9

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 ADDED
@@ -0,0 +1,150 @@
1
+ # @vritti/quantum-ui
2
+
3
+ A modern, TypeScript-first React component library built on Radix UI primitives and styled with Tailwind CSS v4. Fully typed, accessible, and tree-shakeable.
4
+
5
+ [![npm version](https://img.shields.io/npm/v/@vritti/quantum-ui.svg)](https://www.npmjs.com/package/@vritti/quantum-ui)
6
+ [![License](https://img.shields.io/npm/l/@vritti/quantum-ui.svg)](https://github.com/vritti-hub/quantum-ui/blob/main/LICENSE)
7
+
8
+ ## Features
9
+
10
+ - 🎨 **Tailwind CSS v4** - Modern utility-first styling
11
+ - ♿ **Accessible** - Built on Radix UI primitives
12
+ - 📦 **Tree-shakeable** - Import only what you need
13
+ - 🔷 **TypeScript** - Fully typed with excellent IntelliSense support
14
+ - 🎭 **Themeable** - Dark mode support with ThemeToggle component
15
+ - 📚 **Documented** - Comprehensive Storybook documentation
16
+
17
+ ## Documentation
18
+
19
+ 📖 [View full documentation and interactive examples on Storybook](https://vritti-hub.github.io/quantum-ui)
20
+
21
+ ## Installation
22
+
23
+ ```bash
24
+ npm install @vritti/quantum-ui
25
+ ```
26
+
27
+ ```bash
28
+ yarn add @vritti/quantum-ui
29
+ ```
30
+
31
+ ```bash
32
+ pnpm add @vritti/quantum-ui
33
+ ```
34
+
35
+ ### Peer Dependencies
36
+
37
+ Make sure you have the following peer dependencies installed:
38
+
39
+ ```bash
40
+ npm install react react-dom
41
+ ```
42
+
43
+ This library supports React 18.x and 19.x.
44
+
45
+ ## Usage
46
+
47
+ Import components individually for optimal tree-shaking:
48
+
49
+ ```tsx
50
+ import { Button } from '@vritti/quantum-ui/Button';
51
+ import { Card } from '@vritti/quantum-ui/Card';
52
+ import { TextField } from '@vritti/quantum-ui/TextField';
53
+
54
+ function App() {
55
+ return (
56
+ <Card>
57
+ <TextField label="Email" placeholder="Enter your email" />
58
+ <Button variant="primary">Submit</Button>
59
+ </Card>
60
+ );
61
+ }
62
+ ```
63
+
64
+ Or import from the main entry point:
65
+
66
+ ```tsx
67
+ import { Button, Card, TextField } from '@vritti/quantum-ui';
68
+ ```
69
+
70
+ ## Available Components
71
+
72
+ - **Button** - Versatile button component with multiple variants
73
+ - **Card** - Container component for grouping content
74
+ - **TextField** - Text input with label and validation support
75
+ - **PasswordField** - Secure password input with show/hide toggle
76
+ - **Checkbox** - Accessible checkbox component
77
+ - **Typography** - Text styling component
78
+ - **ThemeToggle** - Dark/light mode toggle
79
+
80
+ ## Development
81
+
82
+ ### Prerequisites
83
+
84
+ - Node.js 18+ or 20+
85
+ - npm, yarn, or pnpm
86
+
87
+ ### Setup
88
+
89
+ 1. Clone the repository:
90
+ ```bash
91
+ git clone https://github.com/vritti-hub/quantum-ui.git
92
+ cd quantum-ui
93
+ ```
94
+
95
+ 2. Install dependencies:
96
+ ```bash
97
+ npm install
98
+ ```
99
+
100
+ 3. Start Storybook for development:
101
+ ```bash
102
+ npm run storybook
103
+ ```
104
+
105
+ 4. Build the library:
106
+ ```bash
107
+ npm run build
108
+ ```
109
+
110
+ ### Scripts
111
+
112
+ - `npm run dev` - Start Vite dev server
113
+ - `npm run build` - Build the library for production
114
+ - `npm run storybook` - Start Storybook development server
115
+ - `npm run build-storybook` - Build Storybook for production
116
+ - `npm run lint` - Lint the codebase
117
+
118
+ ## Contributing
119
+
120
+ We welcome contributions! Please follow these steps:
121
+
122
+ 1. Fork the repository
123
+ 2. Create a new branch (`git checkout -b feature/amazing-feature`)
124
+ 3. Make your changes
125
+ 4. Commit your changes (`git commit -m 'Add some amazing feature'`)
126
+ 5. Push to the branch (`git push origin feature/amazing-feature`)
127
+ 6. Open a Pull Request
128
+
129
+ ### Contribution Guidelines
130
+
131
+ - Follow the existing code style
132
+ - Write meaningful commit messages
133
+ - Add tests for new features
134
+ - Update documentation as needed
135
+ - Ensure all tests pass before submitting PR
136
+
137
+ ## Issues and Support
138
+
139
+ Found a bug or have a feature request? Please [open an issue](https://github.com/vritti-hub/quantum-ui/issues).
140
+
141
+ ## License
142
+
143
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
144
+
145
+ ## Links
146
+
147
+ - [Documentation (Storybook)](https://vritti-hub.github.io/quantum-ui)
148
+ - [GitHub Repository](https://github.com/vritti-hub/quantum-ui)
149
+ - [npm Package](https://www.npmjs.com/package/@vritti/quantum-ui)
150
+ - [Report Issues](https://github.com/vritti-hub/quantum-ui/issues)
package/dist/Label.js ADDED
@@ -0,0 +1,40 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
+ import { P as Primitive } from './index2.js';
4
+ import { c as cn } from './utils.js';
5
+
6
+ var NAME = "Label";
7
+ var Label$1 = React.forwardRef((props, forwardedRef) => {
8
+ return /* @__PURE__ */ jsx(
9
+ Primitive.label,
10
+ {
11
+ ...props,
12
+ ref: forwardedRef,
13
+ onMouseDown: (event) => {
14
+ const target = event.target;
15
+ if (target.closest("button, input, select, textarea")) return;
16
+ props.onMouseDown?.(event);
17
+ if (!event.defaultPrevented && event.detail > 1) event.preventDefault();
18
+ }
19
+ }
20
+ );
21
+ });
22
+ Label$1.displayName = NAME;
23
+ var Root = Label$1;
24
+
25
+ function Label({ className, ...props }) {
26
+ return /* @__PURE__ */ jsx(
27
+ Root,
28
+ {
29
+ "data-slot": "label",
30
+ className: cn(
31
+ "flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
32
+ className
33
+ ),
34
+ ...props
35
+ }
36
+ );
37
+ }
38
+
39
+ export { Label as L };
40
+ //# sourceMappingURL=Label.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Label.js","sources":["../node_modules/@radix-ui/react-label/dist/index.mjs","../shadcn/shadcnLabel/Label.tsx"],"sourcesContent":["\"use client\";\n\n// src/label.tsx\nimport * as React from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { jsx } from \"react/jsx-runtime\";\nvar NAME = \"Label\";\nvar Label = React.forwardRef((props, forwardedRef) => {\n return /* @__PURE__ */ jsx(\n Primitive.label,\n {\n ...props,\n ref: forwardedRef,\n onMouseDown: (event) => {\n const target = event.target;\n if (target.closest(\"button, input, select, textarea\")) return;\n props.onMouseDown?.(event);\n if (!event.defaultPrevented && event.detail > 1) event.preventDefault();\n }\n }\n );\n});\nLabel.displayName = NAME;\nvar Root = Label;\nexport {\n Label,\n Root\n};\n//# sourceMappingURL=index.mjs.map\n","import * as LabelPrimitive from '@radix-ui/react-label';\nimport * as React from 'react';\n\nimport { cn } from '../utils';\n\nfunction Label({ className, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>) {\n return (\n <LabelPrimitive.Root\n data-slot='label'\n className={cn(\n 'flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50',\n className\n )}\n {...props}\n />\n );\n}\n\nexport { Label };\n"],"names":["Label","LabelPrimitive.Root"],"mappings":";;;;;AAMA,IAAI,IAAI,GAAG,OAAO;AAClB,IAAIA,OAAK,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,KAAK,EAAE,YAAY,KAAK;AACtD,EAAE,uBAAuB,GAAG;AAC5B,IAAI,SAAS,CAAC,KAAK;AACnB,IAAI;AACJ,MAAM,GAAG,KAAK;AACd,MAAM,GAAG,EAAE,YAAY;AACvB,MAAM,WAAW,EAAE,CAAC,KAAK,KAAK;AAC9B,QAAQ,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM;AACnC,QAAQ,IAAI,MAAM,CAAC,OAAO,CAAC,iCAAiC,CAAC,EAAE;AAC/D,QAAQ,KAAK,CAAC,WAAW,GAAG,KAAK,CAAC;AAClC,QAAQ,IAAI,CAAC,KAAK,CAAC,gBAAgB,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,KAAK,CAAC,cAAc,EAAE;AAC/E,MAAM;AACN;AACA,GAAG;AACH,CAAC,CAAC;AACFA,OAAK,CAAC,WAAW,GAAG,IAAI;AACxB,IAAI,IAAI,GAAGA,OAAK;;AClBhB,SAAS,KAAA,CAAM,EAAE,SAAA,EAAW,GAAG,OAAM,EAAqD;AACxF,EAAA,uBACE,GAAA;AAAA,IAACC,IAAe;AAAA,IAAf;AAAA,MACC,WAAA,EAAU,OAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACT,qNAAA;AAAA,QACA;AAAA,OACF;AAAA,MACC,GAAG;AAAA;AAAA,GACN;AAEJ;;;;","x_google_ignoreList":[0]}
@@ -0,0 +1,17 @@
1
+ import { default as default_2 } from 'react';
2
+
3
+ export declare const OTPField: default_2.FC<OTPFieldProps>;
4
+
5
+ export declare interface OTPFieldProps {
6
+ value: string;
7
+ onChange: (value: string) => void;
8
+ length?: number;
9
+ label?: string;
10
+ message?: string;
11
+ error?: boolean;
12
+ disabled?: boolean;
13
+ required?: boolean;
14
+ className?: string;
15
+ }
16
+
17
+ export { }
@@ -4,6 +4,8 @@ export declare const PasswordField: default_2.FC<PasswordFieldProps>;
4
4
 
5
5
  declare interface PasswordFieldProps extends Omit<TextFieldProps, 'type' | 'endAdornment'> {
6
6
  showStrengthIndicator?: boolean;
7
+ showMatchIndicator?: boolean;
8
+ matchPassword?: string;
7
9
  toggleAriaLabel?: string;
8
10
  }
9
11
 
@@ -12,6 +12,20 @@ import { c as createLucideIcon } from './createLucideIcon.js';
12
12
  */
13
13
 
14
14
 
15
+ const __iconNode$2 = [
16
+ ["path", { d: "M21.801 10A10 10 0 1 1 17 3.335", key: "yps3ct" }],
17
+ ["path", { d: "m9 11 3 3L22 4", key: "1pflzl" }]
18
+ ];
19
+ const CircleCheckBig = createLucideIcon("circle-check-big", __iconNode$2);
20
+
21
+ /**
22
+ * @license lucide-react v0.544.0 - ISC
23
+ *
24
+ * This source code is licensed under the ISC license.
25
+ * See the LICENSE file in the root directory of this source tree.
26
+ */
27
+
28
+
15
29
  const __iconNode$1 = [
16
30
  [
17
31
  "path",
@@ -59,12 +73,14 @@ const getPasswordStrength = (password) => {
59
73
  if (/[a-z]/.test(password)) strength += 1;
60
74
  if (/[0-9]/.test(password)) strength += 1;
61
75
  if (/[^A-Za-z0-9]/.test(password)) strength += 1;
62
- if (strength < 2) return { label: "Weak", color: "text-red-500", bgColor: "bg-red-500", width: "20%" };
76
+ if (strength < 2) return { label: "Weak", color: "text-destructive", bgColor: "bg-destructive", width: "25%" };
63
77
  if (strength < 4) return { label: "Fair", color: "text-yellow-500", bgColor: "bg-yellow-500", width: "60%" };
64
- return { label: "Strong", color: "text-green-500", bgColor: "bg-green-500", width: "100%" };
78
+ return { label: "Strong", color: "text-success", bgColor: "bg-success", width: "100%" };
65
79
  };
66
80
  const PasswordField = ({
67
81
  showStrengthIndicator = false,
82
+ showMatchIndicator = false,
83
+ matchPassword,
68
84
  toggleAriaLabel,
69
85
  value = "",
70
86
  message,
@@ -76,9 +92,10 @@ const PasswordField = ({
76
92
  setShowPassword(!showPassword);
77
93
  };
78
94
  const passwordStrength = getPasswordStrength(String(value));
79
- const enhancedMessage = showStrengthIndicator && value && !error ? /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
80
- /* @__PURE__ */ jsxs("div", { className: "flex justify-between items-center text-xs", children: [
81
- /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Password strength:" }),
95
+ const passwordsMatch = matchPassword !== void 0 && value !== "" && value === matchPassword;
96
+ const enhancedMessage = showStrengthIndicator && value && !error ? /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
97
+ /* @__PURE__ */ jsxs("div", { className: "flex justify-between items-center text-[10px]", children: [
98
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Strength:" }),
82
99
  /* @__PURE__ */ jsx("span", { className: passwordStrength.color, children: passwordStrength.label })
83
100
  ] }),
84
101
  /* @__PURE__ */ jsx("div", { className: "w-full bg-muted rounded-full h-1", children: /* @__PURE__ */ jsx(
@@ -89,6 +106,10 @@ const PasswordField = ({
89
106
  }
90
107
  ) }),
91
108
  message && /* @__PURE__ */ jsx("div", { children: message })
109
+ ] }) : showMatchIndicator && passwordsMatch && !error ? /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
110
+ /* @__PURE__ */ jsx(CircleCheckBig, { className: "h-3 w-3 text-success" }),
111
+ /* @__PURE__ */ jsx("span", { className: "text-[10px] text-success", children: "Passwords match" }),
112
+ message && /* @__PURE__ */ jsx("div", { children: message })
92
113
  ] }) : message;
93
114
  const eyeIcon = /* @__PURE__ */ jsx(
94
115
  "button",
@@ -1 +1 @@
1
- {"version":3,"file":"PasswordField.js","sources":["../node_modules/lucide-react/dist/esm/icons/eye-off.js","../node_modules/lucide-react/dist/esm/icons/eye.js","../lib/components/PasswordField/PasswordField.tsx"],"sourcesContent":["/**\n * @license lucide-react v0.544.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49\",\n key: \"ct8e1f\"\n }\n ],\n [\"path\", { d: \"M14.084 14.158a3 3 0 0 1-4.242-4.242\", key: \"151rxh\" }],\n [\n \"path\",\n {\n d: \"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143\",\n key: \"13bj9a\"\n }\n ],\n [\"path\", { d: \"m2 2 20 20\", key: \"1ooewy\" }]\n];\nconst EyeOff = createLucideIcon(\"eye-off\", __iconNode);\n\nexport { __iconNode, EyeOff as default };\n//# sourceMappingURL=eye-off.js.map\n","/**\n * @license lucide-react v0.544.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0\",\n key: \"1nclc0\"\n }\n ],\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"3\", key: \"1v7zrd\" }]\n];\nconst Eye = createLucideIcon(\"eye\", __iconNode);\n\nexport { __iconNode, Eye as default };\n//# sourceMappingURL=eye.js.map\n","import { Eye, EyeOff } from 'lucide-react';\nimport React, { useState } from 'react';\nimport { cn } from '../../../shadcn/utils';\nimport { TextField, TextFieldProps } from '../TextField/TextField';\n\nexport interface PasswordFieldProps extends Omit<TextFieldProps, 'type' | 'endAdornment'> {\n /**\n * Whether to show password strength indicator\n */\n showStrengthIndicator?: boolean;\n\n /**\n * Custom aria-label for the visibility toggle button\n */\n toggleAriaLabel?: string;\n}\n\n// Helper function to calculate password strength\nconst getPasswordStrength = (password: string) => {\n let strength = 0;\n if (password.length >= 8) strength += 1;\n if (/[A-Z]/.test(password)) strength += 1;\n if (/[a-z]/.test(password)) strength += 1;\n if (/[0-9]/.test(password)) strength += 1;\n if (/[^A-Za-z0-9]/.test(password)) strength += 1;\n\n if (strength < 2) return { label: 'Weak', color: 'text-red-500', bgColor: 'bg-red-500', width: '20%' };\n if (strength < 4) return { label: 'Fair', color: 'text-yellow-500', bgColor: 'bg-yellow-500', width: '60%' };\n return { label: 'Strong', color: 'text-green-500', bgColor: 'bg-green-500', width: '100%' };\n};\n\n// PasswordField component - specialized TextField for password inputs\nexport const PasswordField: React.FC<PasswordFieldProps> = ({\n showStrengthIndicator = false,\n toggleAriaLabel,\n value = '',\n message,\n error,\n ...props\n}) => {\n const [showPassword, setShowPassword] = useState(false);\n\n const togglePasswordVisibility = () => {\n setShowPassword(!showPassword);\n };\n\n const passwordStrength = getPasswordStrength(String(value));\n\n // Combine strength indicator with existing message\n const enhancedMessage =\n showStrengthIndicator && value && !error ? (\n <div className='space-y-2'>\n <div className='flex justify-between items-center text-xs'>\n <span className='text-muted-foreground'>Password strength:</span>\n <span className={passwordStrength.color}>{passwordStrength.label}</span>\n </div>\n <div className='w-full bg-muted rounded-full h-1'>\n <div\n className={cn('h-1 rounded-full transition-all duration-300', passwordStrength.bgColor)}\n style={{ width: passwordStrength.width }}\n />\n </div>\n {message && <div>{message}</div>}\n </div>\n ) : (\n message\n );\n\n const eyeIcon = (\n <button\n type=\"button\"\n onClick={togglePasswordVisibility}\n aria-label={toggleAriaLabel || (showPassword ? 'Hide password' : 'Show password')}\n className=\"cursor-pointer\"\n >\n {showPassword ? (\n <EyeOff className=\"h-3.5 w-3.5 text-muted-foreground\" />\n ) : (\n <Eye className=\"h-3.5 w-3.5 text-muted-foreground\" />\n )}\n </button>\n );\n\n return (\n <TextField\n {...props}\n type={showPassword ? 'text' : 'password'}\n value={value}\n message={enhancedMessage}\n error={error}\n endAdornment={eyeIcon}\n />\n );\n};\n"],"names":["__iconNode"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;;;AAIA,MAAMA,YAAU,GAAG;AACnB,EAAE;AACF,IAAI,MAAM;AACV,IAAI;AACJ,MAAM,CAAC,EAAE,gGAAgG;AACzG,MAAM,GAAG,EAAE;AACX;AACA,GAAG;AACH,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,sCAAsC,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC;AACxE,EAAE;AACF,IAAI,MAAM;AACV,IAAI;AACJ,MAAM,CAAC,EAAE,8FAA8F;AACvG,MAAM,GAAG,EAAE;AACX;AACA,GAAG;AACH,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,YAAY,EAAE,GAAG,EAAE,QAAQ,EAAE;AAC7C,CAAC;AACD,MAAM,MAAM,GAAG,gBAAgB,CAAC,SAAS,EAAEA,YAAU,CAAC;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,EAAA,OAAA,EAAQ;AAAA,GAAA,EAC5B,CAAA,GAEA,OAAA;AAGJ,EAAA,MAAM,OAAA,mBACJ,GAAA;AAAA,IAAC,QAAA;AAAA,IAAA;AAAA,MACC,IAAA,EAAK,QAAA;AAAA,MACL,OAAA,EAAS,wBAAA;AAAA,MACT,YAAA,EAAY,eAAA,KAAoB,YAAA,GAAe,eAAA,GAAkB,eAAA,CAAA;AAAA,MACjE,SAAA,EAAU,gBAAA;AAAA,MAET,QAAA,EAAA,YAAA,uBACE,MAAA,EAAA,EAAO,SAAA,EAAU,qCAAoC,CAAA,mBAEtD,GAAA,CAAC,GAAA,EAAA,EAAI,SAAA,EAAU,mCAAA,EAAoC;AAAA;AAAA,GAEvD;AAGF,EAAA,uBACE,GAAA;AAAA,IAAC,SAAA;AAAA,IAAA;AAAA,MACE,GAAG,KAAA;AAAA,MACJ,IAAA,EAAM,eAAe,MAAA,GAAS,UAAA;AAAA,MAC9B,KAAA;AAAA,MACA,OAAA,EAAS,eAAA;AAAA,MACT,KAAA;AAAA,MACA,YAAA,EAAc;AAAA;AAAA,GAChB;AAEJ;;;;","x_google_ignoreList":[0,1]}
1
+ {"version":3,"file":"PasswordField.js","sources":["../node_modules/lucide-react/dist/esm/icons/circle-check-big.js","../node_modules/lucide-react/dist/esm/icons/eye-off.js","../node_modules/lucide-react/dist/esm/icons/eye.js","../lib/components/PasswordField/PasswordField.tsx"],"sourcesContent":["/**\n * @license lucide-react v0.544.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"path\", { d: \"M21.801 10A10 10 0 1 1 17 3.335\", key: \"yps3ct\" }],\n [\"path\", { d: \"m9 11 3 3L22 4\", key: \"1pflzl\" }]\n];\nconst CircleCheckBig = createLucideIcon(\"circle-check-big\", __iconNode);\n\nexport { __iconNode, CircleCheckBig as default };\n//# sourceMappingURL=circle-check-big.js.map\n","/**\n * @license lucide-react v0.544.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49\",\n key: \"ct8e1f\"\n }\n ],\n [\"path\", { d: \"M14.084 14.158a3 3 0 0 1-4.242-4.242\", key: \"151rxh\" }],\n [\n \"path\",\n {\n d: \"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143\",\n key: \"13bj9a\"\n }\n ],\n [\"path\", { d: \"m2 2 20 20\", key: \"1ooewy\" }]\n];\nconst EyeOff = createLucideIcon(\"eye-off\", __iconNode);\n\nexport { __iconNode, EyeOff as default };\n//# sourceMappingURL=eye-off.js.map\n","/**\n * @license lucide-react v0.544.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0\",\n key: \"1nclc0\"\n }\n ],\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"3\", key: \"1v7zrd\" }]\n];\nconst Eye = createLucideIcon(\"eye\", __iconNode);\n\nexport { __iconNode, Eye as default };\n//# sourceMappingURL=eye.js.map\n","import { CheckCircle, Eye, EyeOff } from 'lucide-react';\nimport React, { useState } from 'react';\nimport { cn } from '../../../shadcn/utils';\nimport { TextField, TextFieldProps } from '../TextField/TextField';\n\nexport interface PasswordFieldProps extends Omit<TextFieldProps, 'type' | 'endAdornment'> {\n /**\n * Whether to show password strength indicator\n */\n showStrengthIndicator?: boolean;\n\n /**\n * Whether to show password match indicator\n */\n showMatchIndicator?: boolean;\n\n /**\n * Password to match against (for confirm password fields)\n */\n matchPassword?: string;\n\n /**\n * Custom aria-label for the visibility toggle button\n */\n toggleAriaLabel?: string;\n}\n\n// Helper function to calculate password strength\nconst getPasswordStrength = (password: string) => {\n let strength = 0;\n if (password.length >= 8) strength += 1;\n if (/[A-Z]/.test(password)) strength += 1;\n if (/[a-z]/.test(password)) strength += 1;\n if (/[0-9]/.test(password)) strength += 1;\n if (/[^A-Za-z0-9]/.test(password)) strength += 1;\n\n if (strength < 2) return { label: 'Weak', color: 'text-destructive', bgColor: 'bg-destructive', width: '25%' };\n if (strength < 4) return { label: 'Fair', color: 'text-yellow-500', bgColor: 'bg-yellow-500', width: '60%' };\n return { label: 'Strong', color: 'text-success', bgColor: 'bg-success', width: '100%' };\n};\n\n// PasswordField component - specialized TextField for password inputs\nexport const PasswordField: React.FC<PasswordFieldProps> = ({\n showStrengthIndicator = false,\n showMatchIndicator = false,\n matchPassword,\n toggleAriaLabel,\n value = '',\n message,\n error,\n ...props\n}) => {\n const [showPassword, setShowPassword] = useState(false);\n\n const togglePasswordVisibility = () => {\n setShowPassword(!showPassword);\n };\n\n const passwordStrength = getPasswordStrength(String(value));\n const passwordsMatch = matchPassword !== undefined && value !== '' && value === matchPassword;\n\n // Combine strength indicator with existing message\n const enhancedMessage =\n showStrengthIndicator && value && !error ? (\n <div className='space-y-1'>\n <div className='flex justify-between items-center text-[10px]'>\n <span className='text-muted-foreground'>Strength:</span>\n <span className={passwordStrength.color}>{passwordStrength.label}</span>\n </div>\n <div className='w-full bg-muted rounded-full h-1'>\n <div\n className={cn('h-1 rounded-full transition-all duration-300', passwordStrength.bgColor)}\n style={{ width: passwordStrength.width }}\n />\n </div>\n {message && <div>{message}</div>}\n </div>\n ) : showMatchIndicator && passwordsMatch && !error ? (\n <div className='flex items-center gap-1'>\n <CheckCircle className='h-3 w-3 text-success' />\n <span className='text-[10px] text-success'>Passwords match</span>\n {message && <div>{message}</div>}\n </div>\n ) : (\n message\n );\n\n const eyeIcon = (\n <button\n type='button'\n onClick={togglePasswordVisibility}\n aria-label={toggleAriaLabel || (showPassword ? 'Hide password' : 'Show password')}\n className='cursor-pointer'\n >\n {showPassword ? (\n <EyeOff className='h-3.5 w-3.5 text-muted-foreground' />\n ) : (\n <Eye className='h-3.5 w-3.5 text-muted-foreground' />\n )}\n </button>\n );\n\n return (\n <TextField\n {...props}\n type={showPassword ? 'text' : 'password'}\n value={value}\n message={enhancedMessage}\n error={error}\n endAdornment={eyeIcon}\n />\n );\n};\n"],"names":["__iconNode","CheckCircle"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;;;AAIA,MAAMA,YAAU,GAAG;AACnB,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,iCAAiC,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC;AACnE,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,gBAAgB,EAAE,GAAG,EAAE,QAAQ,EAAE;AACjD,CAAC;AACD,MAAM,cAAc,GAAG,gBAAgB,CAAC,kBAAkB,EAAEA,YAAU,CAAC;;ACbvE;AACA;AACA;AACA;AACA;AACA;;;AAIA,MAAMA,YAAU,GAAG;AACnB,EAAE;AACF,IAAI,MAAM;AACV,IAAI;AACJ,MAAM,CAAC,EAAE,gGAAgG;AACzG,MAAM,GAAG,EAAE;AACX;AACA,GAAG;AACH,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,sCAAsC,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC;AACxE,EAAE;AACF,IAAI,MAAM;AACV,IAAI;AACJ,MAAM,CAAC,EAAE,8FAA8F;AACvG,MAAM,GAAG,EAAE;AACX;AACA,GAAG;AACH,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,YAAY,EAAE,GAAG,EAAE,QAAQ,EAAE;AAC7C,CAAC;AACD,MAAM,MAAM,GAAG,gBAAgB,CAAC,SAAS,EAAEA,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_google_ignoreList":[0,1,2]}
@@ -0,0 +1,24 @@
1
+ import { Country } from 'react-phone-number-input';
2
+ import { default as default_2 } from 'react';
3
+ import { isValidPhoneNumber } from 'react-phone-number-input';
4
+ import { Value as PhoneValue } from 'react-phone-number-input';
5
+
6
+ export { isValidPhoneNumber }
7
+
8
+ export declare const PhoneField: default_2.FC<PhoneFieldProps>;
9
+
10
+ export declare interface PhoneFieldProps {
11
+ value?: PhoneValue;
12
+ onChange: (value: PhoneValue | undefined) => void;
13
+ defaultCountry?: Country;
14
+ label?: string;
15
+ message?: string;
16
+ error?: boolean;
17
+ disabled?: boolean;
18
+ className?: string;
19
+ placeholder?: string;
20
+ }
21
+
22
+ export { PhoneValue }
23
+
24
+ export { }