@adam-milo/ui 1.0.20 → 1.0.22

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.
Files changed (66) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/index.js +53 -53
  3. package/dist/index10.cjs +1 -1
  4. package/dist/index10.js +38 -36
  5. package/dist/index11.cjs +1 -1
  6. package/dist/index11.js +82 -76
  7. package/dist/index12.cjs +1 -1
  8. package/dist/index12.js +50 -49
  9. package/dist/index13.cjs +1 -1
  10. package/dist/index13.js +30 -30
  11. package/dist/index14.cjs +1 -1
  12. package/dist/index14.js +348 -209
  13. package/dist/index15.cjs +1 -1
  14. package/dist/index15.js +92 -82
  15. package/dist/index16.cjs +1 -1
  16. package/dist/index16.js +32 -31
  17. package/dist/index17.cjs +1 -1
  18. package/dist/index17.js +10 -7
  19. package/dist/index19.cjs +1 -0
  20. package/dist/index19.js +22 -0
  21. package/dist/index2.cjs +1 -1
  22. package/dist/index2.js +26 -26
  23. package/dist/index20.cjs +1 -0
  24. package/dist/index20.js +301 -0
  25. package/dist/index21.cjs +1 -0
  26. package/dist/index21.js +16 -0
  27. package/dist/index3.cjs +1 -1
  28. package/dist/index3.js +37 -95
  29. package/dist/index30.cjs +1 -0
  30. package/dist/index30.js +9 -0
  31. package/dist/index33.cjs +1 -0
  32. package/dist/index33.js +21 -0
  33. package/dist/index4.cjs +1 -1
  34. package/dist/index4.js +18 -174
  35. package/dist/index5.cjs +1 -1
  36. package/dist/index5.js +51 -155
  37. package/dist/index6.cjs +1 -1
  38. package/dist/index6.js +102 -159
  39. package/dist/index7.cjs +1 -1
  40. package/dist/index7.js +76 -61
  41. package/dist/index8.cjs +1 -1
  42. package/dist/index8.js +68 -54
  43. package/dist/index9.cjs +1 -1
  44. package/dist/index9.js +47 -43
  45. package/dist/src/components/forms/alphanumeric-input/AlphanumericInput.component.d.ts +23 -38
  46. package/dist/src/components/forms/alphanumeric-input/AlphanumericInput.component.d.ts.map +1 -1
  47. package/dist/src/components/forms/email-input/EmailInput.component.d.ts +17 -20
  48. package/dist/src/components/forms/email-input/EmailInput.component.d.ts.map +1 -1
  49. package/dist/src/components/forms/input/Input.component.d.ts +105 -0
  50. package/dist/src/components/forms/input/Input.component.d.ts.map +1 -0
  51. package/dist/src/components/forms/numeric-input/NumericInput.component.d.ts +30 -48
  52. package/dist/src/components/forms/numeric-input/NumericInput.component.d.ts.map +1 -1
  53. package/dist/src/components/forms/password-input/PasswordInput.component.d.ts +19 -16
  54. package/dist/src/components/forms/password-input/PasswordInput.component.d.ts.map +1 -1
  55. package/dist/src/lib/debounce.d.ts +12 -0
  56. package/dist/src/lib/debounce.d.ts.map +1 -0
  57. package/dist/src/lib/debounce.spec.d.ts +2 -0
  58. package/dist/src/lib/debounce.spec.d.ts.map +1 -0
  59. package/dist/src/lib/dev-utils.d.ts +41 -0
  60. package/dist/src/lib/dev-utils.d.ts.map +1 -0
  61. package/dist/src/lib/index.d.ts +15 -2
  62. package/dist/src/lib/index.d.ts.map +1 -1
  63. package/dist/src/lib/useMergedRef.d.ts +19 -0
  64. package/dist/src/lib/useMergedRef.d.ts.map +1 -0
  65. package/dist/style.css +1 -1
  66. package/package.json +5 -2
package/dist/index9.js CHANGED
@@ -1,61 +1,65 @@
1
- import { jsx as c } from "react/jsx-runtime";
2
- import { forwardRef as m } from "react";
3
- import * as a from "@radix-ui/react-tabs";
4
- import { cn as b } from "./index17.js";
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from "react";
3
+ import * as TabsPrimitive from "@radix-ui/react-tabs";
4
+ import { cn } from "./index17.js";
5
5
  /* empty css */
6
- const C = a.Root, g = m(
7
- ({ className: s, "data-cy": t, "data-testid": i, ...n }, r) => {
8
- const e = t || "tabs-list", o = i || "tabs-list";
9
- return /* @__PURE__ */ c(
10
- a.List,
6
+ const Tabs = TabsPrimitive.Root;
7
+ const TabsList = forwardRef(
8
+ ({ className, "data-cy": dataCy, "data-testid": dataTestId, ...props }, ref) => {
9
+ const finalDataCy = dataCy || "tabs-list";
10
+ const finalTestId = dataTestId || "tabs-list";
11
+ return /* @__PURE__ */ jsx(
12
+ TabsPrimitive.List,
11
13
  {
12
- ref: r,
13
- className: b("tabs-list", s),
14
- "data-cy": e,
15
- "data-testid": o,
16
- ...n
14
+ ref,
15
+ className: cn("tabs-list", className),
16
+ "data-cy": finalDataCy,
17
+ "data-testid": finalTestId,
18
+ ...props
17
19
  }
18
20
  );
19
21
  }
20
22
  );
21
- g.displayName = a.List.displayName;
22
- const y = m(
23
- ({ className: s, value: t, "data-cy": i, "data-testid": n, ...r }, e) => {
24
- const o = i || (t ? `tabs-trigger-${t}` : "tabs-trigger"), d = n || (t ? `tabs-trigger-${t}` : "tabs-trigger");
25
- return /* @__PURE__ */ c(
26
- a.Trigger,
23
+ TabsList.displayName = TabsPrimitive.List.displayName;
24
+ const TabsTrigger = forwardRef(
25
+ ({ className, value, "data-cy": dataCy, "data-testid": dataTestId, ...props }, ref) => {
26
+ const finalDataCy = dataCy || (value ? `tabs-trigger-${value}` : "tabs-trigger");
27
+ const finalTestId = dataTestId || (value ? `tabs-trigger-${value}` : "tabs-trigger");
28
+ return /* @__PURE__ */ jsx(
29
+ TabsPrimitive.Trigger,
27
30
  {
28
- ref: e,
29
- className: b("tabs-trigger", s),
30
- value: t,
31
- "data-cy": o,
32
- "data-testid": d,
33
- ...r
31
+ ref,
32
+ className: cn("tabs-trigger", className),
33
+ value,
34
+ "data-cy": finalDataCy,
35
+ "data-testid": finalTestId,
36
+ ...props
34
37
  }
35
38
  );
36
39
  }
37
40
  );
38
- y.displayName = a.Trigger.displayName;
39
- const f = m(
40
- ({ className: s, value: t, "data-cy": i, "data-testid": n, ...r }, e) => {
41
- const o = i || (t ? `tabs-content-${t}` : "tabs-content"), d = n || (t ? `tabs-content-${t}` : "tabs-content");
42
- return /* @__PURE__ */ c(
43
- a.Content,
41
+ TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
42
+ const TabsContent = forwardRef(
43
+ ({ className, value, "data-cy": dataCy, "data-testid": dataTestId, ...props }, ref) => {
44
+ const finalDataCy = dataCy || (value ? `tabs-content-${value}` : "tabs-content");
45
+ const finalTestId = dataTestId || (value ? `tabs-content-${value}` : "tabs-content");
46
+ return /* @__PURE__ */ jsx(
47
+ TabsPrimitive.Content,
44
48
  {
45
- ref: e,
46
- className: b("tabs-content", s),
47
- value: t,
48
- "data-cy": o,
49
- "data-testid": d,
50
- ...r
49
+ ref,
50
+ className: cn("tabs-content", className),
51
+ value,
52
+ "data-cy": finalDataCy,
53
+ "data-testid": finalTestId,
54
+ ...props
51
55
  }
52
56
  );
53
57
  }
54
58
  );
55
- f.displayName = a.Content.displayName;
59
+ TabsContent.displayName = TabsPrimitive.Content.displayName;
56
60
  export {
57
- C as Tabs,
58
- f as TabsContent,
59
- g as TabsList,
60
- y as TabsTrigger
61
+ Tabs,
62
+ TabsContent,
63
+ TabsList,
64
+ TabsTrigger
61
65
  };
@@ -1,22 +1,18 @@
1
- import { InputHTMLAttributes } from 'react';
1
+ import { InputProps } from '../input/Input.component';
2
2
 
3
- export interface AlphanumericInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type'> {
4
- label?: string;
5
- error?: string;
6
- helperText?: string;
7
- fullWidth?: boolean;
3
+ export interface AlphanumericInputProps extends Omit<InputProps, 'type'> {
8
4
  /**
9
- * Allow hyphen (-) character
5
+ * Allow hyphens in the input
10
6
  * @default false
11
7
  */
12
8
  allowHyphen?: boolean;
13
9
  /**
14
- * Allow underscore (_) character
10
+ * Allow underscores in the input
15
11
  * @default false
16
12
  */
17
13
  allowUnderscore?: boolean;
18
14
  /**
19
- * Allow space character
15
+ * Allow spaces in the input
20
16
  * @default false
21
17
  */
22
18
  allowSpace?: boolean;
@@ -28,35 +24,24 @@ export interface AlphanumericInputProps extends Omit<InputHTMLAttributes<HTMLInp
28
24
  * Maximum length
29
25
  */
30
26
  maxLength?: number;
31
- /**
32
- * Custom validation message for invalid format
33
- * @default "Only letters and numbers are allowed"
34
- */
35
- invalidFormatMessage?: string;
36
- /**
37
- * Custom validation message for min length
38
- * @default "Must be at least {minLength} characters"
39
- */
40
- minLengthMessage?: string;
41
- /**
42
- * Custom validation message for max length
43
- * @default "Must be at most {maxLength} characters"
44
- */
45
- maxLengthMessage?: string;
46
- /**
47
- * Callback when validation changes
48
- */
49
- onValidationChange?: (isValid: boolean) => void;
50
- /**
51
- * Custom data-cy attribute for Cypress testing
52
- * Auto-generates as "alphanumeric-input" if not provided
53
- */
54
- 'data-cy'?: string;
55
- /**
56
- * Custom data-testid attribute for unit testing
57
- * Auto-generates as "alphanumeric-input" if not provided
58
- */
59
- 'data-testid'?: string;
60
27
  }
28
+ /**
29
+ * AlphanumericInput - Specialized input component for alphanumeric values
30
+ *
31
+ * A wrapper around the base Input component that only allows letters and numbers,
32
+ * with optional support for hyphens, underscores, and spaces.
33
+ *
34
+ * @example
35
+ * ```tsx
36
+ * <AlphanumericInput
37
+ * label="Username"
38
+ * placeholder="Enter username"
39
+ * minLength={3}
40
+ * maxLength={20}
41
+ * allowUnderscore={true}
42
+ * required
43
+ * />
44
+ * ```
45
+ */
61
46
  export declare const AlphanumericInput: import('react').ForwardRefExoticComponent<AlphanumericInputProps & import('react').RefAttributes<HTMLInputElement>>;
62
47
  //# sourceMappingURL=AlphanumericInput.component.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AlphanumericInput.component.d.ts","sourceRoot":"","sources":["../../../../../src/components/forms/alphanumeric-input/AlphanumericInput.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EAMpB,MAAM,OAAO,CAAC;AAEf,OAAO,yBAAyB,CAAC;AAEjC,MAAM,WAAW,sBAAuB,SAAQ,IAAI,CAClD,mBAAmB,CAAC,gBAAgB,CAAC,EACrC,MAAM,CACP;IACC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAE9B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,kBAAkB,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAEhD;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,iBAAiB,qHAgO7B,CAAC"}
1
+ {"version":3,"file":"AlphanumericInput.component.d.ts","sourceRoot":"","sources":["../../../../../src/components/forms/alphanumeric-input/AlphanumericInput.component.tsx"],"names":[],"mappings":"AACA,OAAO,EAAS,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAG7D,MAAM,WAAW,sBAAuB,SAAQ,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC;IACtE;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,iBAAiB,qHAwJ7B,CAAC"}
@@ -1,10 +1,6 @@
1
- import { InputHTMLAttributes } from 'react';
1
+ import { InputProps } from '../input/Input.component';
2
2
 
3
- export interface EmailInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type'> {
4
- label?: string;
5
- error?: string;
6
- helperText?: string;
7
- fullWidth?: boolean;
3
+ export interface EmailInputProps extends Omit<InputProps, 'type'> {
8
4
  /**
9
5
  * Enable client-side email validation
10
6
  * @default true
@@ -15,20 +11,21 @@ export interface EmailInputProps extends Omit<InputHTMLAttributes<HTMLInputEleme
15
11
  * @default "Not a valid email address"
16
12
  */
17
13
  invalidEmailMessage?: string;
18
- /**
19
- * Callback when email validation changes
20
- */
21
- onValidationChange?: (isValid: boolean) => void;
22
- /**
23
- * Custom data-cy attribute for Cypress testing
24
- * Auto-generates as "email-input" if not provided
25
- */
26
- 'data-cy'?: string;
27
- /**
28
- * Custom data-testid attribute for unit testing
29
- * Auto-generates as "email-input" if not provided
30
- */
31
- 'data-testid'?: string;
32
14
  }
15
+ /**
16
+ * EmailInput - Specialized input component for email addresses
17
+ *
18
+ * A wrapper around the base Input component with built-in email validation.
19
+ *
20
+ * @example
21
+ * ```tsx
22
+ * <EmailInput
23
+ * label="Email"
24
+ * placeholder="Enter your email"
25
+ * required
26
+ * validateEmail={true}
27
+ * />
28
+ * ```
29
+ */
33
30
  export declare const EmailInput: import('react').ForwardRefExoticComponent<EmailInputProps & import('react').RefAttributes<HTMLInputElement>>;
34
31
  //# sourceMappingURL=EmailInput.component.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"EmailInput.component.d.ts","sourceRoot":"","sources":["../../../../../src/components/forms/email-input/EmailInput.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAA4C,MAAM,OAAO,CAAC;AAEtF,OAAO,kBAAkB,CAAC;AAE1B,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1F,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAE7B;;OAEG;IACH,kBAAkB,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAEhD;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAQD,eAAO,MAAM,UAAU,8GAuHtB,CAAC"}
1
+ {"version":3,"file":"EmailInput.component.d.ts","sourceRoot":"","sources":["../../../../../src/components/forms/email-input/EmailInput.component.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAS,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAE7D,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC;IAC/D;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,UAAU,8GA4CtB,CAAC"}
@@ -0,0 +1,105 @@
1
+ import { InputHTMLAttributes } from 'react';
2
+
3
+ export interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
4
+ /**
5
+ * Label text for the input
6
+ */
7
+ label?: string;
8
+ /**
9
+ * Error message to display below the input
10
+ */
11
+ error?: string;
12
+ /**
13
+ * Helper text to display below the input (only shown when no error)
14
+ */
15
+ helperText?: string;
16
+ /**
17
+ * Whether the input should take full width
18
+ * @default false
19
+ */
20
+ fullWidth?: boolean;
21
+ /**
22
+ * Show password visibility toggle (only for type="password")
23
+ * @default true for password inputs
24
+ */
25
+ showPasswordToggle?: boolean;
26
+ /**
27
+ * Show last character preview for password inputs
28
+ * When enabled, only the last typed character is visible, all others are masked with bullets (•)
29
+ * NOTE: Only works in uncontrolled mode (without value prop)
30
+ * @default true for password inputs
31
+ */
32
+ showLastChar?: boolean;
33
+ /**
34
+ * Delay in milliseconds before fully masking the last character
35
+ * @default 500
36
+ */
37
+ lastCharDelay?: number;
38
+ /**
39
+ * Custom validation function
40
+ * Returns error message if invalid, undefined if valid
41
+ */
42
+ validate?: (value: string) => string | undefined;
43
+ /**
44
+ * Callback when validation state changes
45
+ */
46
+ onValidationChange?: (isValid: boolean) => void;
47
+ /**
48
+ * Custom data-cy attribute for Cypress testing
49
+ * Auto-generates as "input" if not provided
50
+ */
51
+ 'data-cy'?: string;
52
+ /**
53
+ * Custom data-testid attribute for unit testing
54
+ * Auto-generates as "input" if not provided
55
+ */
56
+ 'data-testid'?: string;
57
+ }
58
+ /**
59
+ * Input - Generic input component for the Saas Design System
60
+ *
61
+ * A flexible input component that can be configured for different use cases:
62
+ * - Text input
63
+ * - Email input with custom validation
64
+ * - Password input with visibility toggle and last character preview
65
+ * - Any other HTML input type
66
+ *
67
+ * Features:
68
+ * - Automatically adds asterisk (*) to label when required={true}
69
+ * - Adds aria-required attribute for accessibility
70
+ * - Custom validation with error messages
71
+ * - Password visibility toggle
72
+ * - Last character preview for password inputs (shows ONLY last typed char, masks rest with •)
73
+ * - Helper text support
74
+ * - Full keyboard accessibility
75
+ *
76
+ * @example
77
+ * ```tsx
78
+ * // Simple text input
79
+ * <Input label="Name" placeholder="Enter your name" />
80
+ *
81
+ * // Email with validation (asterisk added automatically)
82
+ * <Input
83
+ * type="email"
84
+ * label="Email"
85
+ * placeholder="Enter your email"
86
+ * required
87
+ * validate={(value) => {
88
+ * if (!value.includes('@')) return 'Not a valid email';
89
+ * }}
90
+ * />
91
+ *
92
+ * // Password with toggle and last char preview (asterisk added automatically)
93
+ * <Input
94
+ * type="password"
95
+ * label="Password"
96
+ * placeholder="Enter your password"
97
+ * required
98
+ * showPasswordToggle
99
+ * showLastChar
100
+ * lastCharDelay={500}
101
+ * />
102
+ * ```
103
+ */
104
+ export declare const Input: import('react').ForwardRefExoticComponent<InputProps & import('react').RefAttributes<HTMLInputElement>>;
105
+ //# sourceMappingURL=Input.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Input.component.d.ts","sourceRoot":"","sources":["../../../../../src/components/forms/input/Input.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EAQpB,MAAM,OAAO,CAAC;AAEf,OAAO,aAAa,CAAC;AAErB,MAAM,WAAW,UAAW,SAAQ,mBAAmB,CAAC,gBAAgB,CAAC;IACvE;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B;;;;;OAKG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IAEjD;;OAEG;IACH,kBAAkB,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAEhD;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,eAAO,MAAM,KAAK,yGAsWjB,CAAC"}
@@ -1,62 +1,44 @@
1
- import { InputHTMLAttributes } from 'react';
1
+ import { InputProps } from '../input/Input.component';
2
2
 
3
- export interface NumericInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'min' | 'max' | 'step'> {
4
- label?: string;
5
- error?: string;
6
- helperText?: string;
7
- fullWidth?: boolean;
3
+ export interface NumericInputProps extends Omit<InputProps, 'type'> {
8
4
  /**
9
- * Allow decimal numbers (e.g., 3.14)
10
- * @default false
11
- */
12
- allowDecimal?: boolean;
13
- /**
14
- * Allow negative numbers
15
- * @default false
16
- */
17
- allowNegative?: boolean;
18
- /**
19
- * Minimum value (inclusive)
5
+ * Minimum value allowed
20
6
  */
21
7
  min?: number;
22
8
  /**
23
- * Maximum value (inclusive)
9
+ * Maximum value allowed
24
10
  */
25
11
  max?: number;
26
12
  /**
27
- * Maximum number of decimal places
28
- * @default 2
29
- */
30
- decimalPlaces?: number;
31
- /**
32
- * Custom validation message for invalid number
33
- * @default "Please enter a valid number"
13
+ * Step increment for the number input
14
+ * @default 1
34
15
  */
35
- invalidNumberMessage?: string;
16
+ step?: number;
36
17
  /**
37
- * Custom validation message for min value
38
- * @default "Value must be at least {min}"
39
- */
40
- minValueMessage?: string;
41
- /**
42
- * Custom validation message for max value
43
- * @default "Value must be at most {max}"
44
- */
45
- maxValueMessage?: string;
46
- /**
47
- * Callback when validation changes
48
- */
49
- onValidationChange?: (isValid: boolean) => void;
50
- /**
51
- * Custom data-cy attribute for Cypress testing
52
- * Auto-generates as "numeric-input" if not provided
53
- */
54
- 'data-cy'?: string;
55
- /**
56
- * Custom data-testid attribute for unit testing
57
- * Auto-generates as "numeric-input" if not provided
18
+ * Allow decimal numbers
19
+ * @default false
58
20
  */
59
- 'data-testid'?: string;
21
+ allowDecimals?: boolean;
60
22
  }
23
+ /**
24
+ * NumericInput - Specialized input component for numeric values
25
+ *
26
+ * A wrapper around the base Input component with number-specific features:
27
+ * - Type="number" by default
28
+ * - Min/max validation
29
+ * - Step increments
30
+ * - Optional decimal support
31
+ *
32
+ * @example
33
+ * ```tsx
34
+ * <NumericInput
35
+ * label="Age"
36
+ * placeholder="Enter age"
37
+ * min={0}
38
+ * max={120}
39
+ * required
40
+ * />
41
+ * ```
42
+ */
61
43
  export declare const NumericInput: import('react').ForwardRefExoticComponent<NumericInputProps & import('react').RefAttributes<HTMLInputElement>>;
62
44
  //# sourceMappingURL=NumericInput.component.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"NumericInput.component.d.ts","sourceRoot":"","sources":["../../../../../src/components/forms/numeric-input/NumericInput.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EAMpB,MAAM,OAAO,CAAC;AAEf,OAAO,oBAAoB,CAAC;AAE5B,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAC7C,mBAAmB,CAAC,gBAAgB,CAAC,EACrC,MAAM,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,CAChC;IACC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;OAGG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAE9B;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,kBAAkB,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAEhD;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,YAAY,gHAqNxB,CAAC"}
1
+ {"version":3,"file":"NumericInput.component.d.ts","sourceRoot":"","sources":["../../../../../src/components/forms/numeric-input/NumericInput.component.tsx"],"names":[],"mappings":"AACA,OAAO,EAAS,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAE7D,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC;IACjE;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,YAAY,gHAmExB,CAAC"}
@@ -1,25 +1,28 @@
1
- import { InputHTMLAttributes } from 'react';
1
+ import { InputProps } from '../input/Input.component';
2
2
 
3
- export interface PasswordInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type'> {
4
- label?: string;
5
- error?: string;
6
- helperText?: string;
7
- fullWidth?: boolean;
3
+ export interface PasswordInputProps extends Omit<InputProps, 'type'> {
8
4
  /**
9
5
  * Show password visibility toggle button
10
6
  * @default true
11
7
  */
12
8
  showToggle?: boolean;
13
- /**
14
- * Custom data-cy attribute for Cypress testing
15
- * Auto-generates as "password-input" if not provided
16
- */
17
- 'data-cy'?: string;
18
- /**
19
- * Custom data-testid attribute for unit testing
20
- * Auto-generates as "password-input" if not provided
21
- */
22
- 'data-testid'?: string;
23
9
  }
10
+ /**
11
+ * PasswordInput - Specialized input component for passwords
12
+ *
13
+ * A wrapper around the base Input component with password-specific features:
14
+ * - Password visibility toggle
15
+ * - Type="password" by default
16
+ *
17
+ * @example
18
+ * ```tsx
19
+ * <PasswordInput
20
+ * label="Password"
21
+ * placeholder="Enter your password"
22
+ * required
23
+ * showToggle={true}
24
+ * />
25
+ * ```
26
+ */
24
27
  export declare const PasswordInput: import('react').ForwardRefExoticComponent<PasswordInputProps & import('react').RefAttributes<HTMLInputElement>>;
25
28
  //# sourceMappingURL=PasswordInput.component.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PasswordInput.component.d.ts","sourceRoot":"","sources":["../../../../../src/components/forms/password-input/PasswordInput.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAA+B,MAAM,OAAO,CAAC;AAEzE,OAAO,qBAAqB,CAAC;AAE7B,MAAM,WAAW,kBAAmB,SAAQ,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC7F,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,aAAa,iHA8JzB,CAAC"}
1
+ {"version":3,"file":"PasswordInput.component.d.ts","sourceRoot":"","sources":["../../../../../src/components/forms/password-input/PasswordInput.component.tsx"],"names":[],"mappings":"AACA,OAAO,EAAS,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAE7D,MAAM,WAAW,kBAAmB,SAAQ,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC;IAClE;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,aAAa,iHAazB,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Creates a debounced function that delays invoking func until after wait milliseconds
3
+ * have elapsed since the last time the debounced function was invoked.
4
+ *
5
+ * @param func - The function to debounce
6
+ * @param wait - The number of milliseconds to delay
7
+ * @returns The debounced function with a cancel method
8
+ */
9
+ export declare function debounce<T extends (...args: any[]) => void>(func: T, wait: number): ((...args: Parameters<T>) => void) & {
10
+ cancel: () => void;
11
+ };
12
+ //# sourceMappingURL=debounce.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debounce.d.ts","sourceRoot":"","sources":["../../../src/lib/debounce.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,EACzD,IAAI,EAAE,CAAC,EACP,IAAI,EAAE,MAAM,GACX,CAAC,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,GAAG;IAAE,MAAM,EAAE,MAAM,IAAI,CAAA;CAAE,CAyB7D"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=debounce.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debounce.spec.d.ts","sourceRoot":"","sources":["../../../src/lib/debounce.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Development-only utilities
3
+ * These functions are optimized away in production builds
4
+ */
5
+ /**
6
+ * Logs a warning message only in development mode
7
+ * In production builds, this function call is stripped by the bundler
8
+ *
9
+ * @param message - The warning message to display
10
+ *
11
+ * @example
12
+ * ```typescript
13
+ * devWarn('Component: Invalid prop value provided');
14
+ * ```
15
+ */
16
+ export declare const devWarn: (message: string) => void;
17
+ /**
18
+ * Logs an error message only in development mode
19
+ * In production builds, this function call is stripped by the bundler
20
+ *
21
+ * @param message - The error message to display
22
+ *
23
+ * @example
24
+ * ```typescript
25
+ * devError('Component: Critical error occurred');
26
+ * ```
27
+ */
28
+ export declare const devError: (message: string) => void;
29
+ /**
30
+ * Logs an info message only in development mode
31
+ * In production builds, this function call is stripped by the bundler
32
+ *
33
+ * @param message - The info message to display
34
+ *
35
+ * @example
36
+ * ```typescript
37
+ * devLog('Component: Rendering with props:', props);
38
+ * ```
39
+ */
40
+ export declare const devLog: (message: string, ...args: unknown[]) => void;
41
+ //# sourceMappingURL=dev-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dev-utils.d.ts","sourceRoot":"","sources":["../../../src/lib/dev-utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;;;;;;;;GAUG;AACH,eAAO,MAAM,OAAO,GAAI,SAAS,MAAM,KAAG,IAIzC,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,QAAQ,GAAI,SAAS,MAAM,KAAG,IAI1C,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,MAAM,GAAI,SAAS,MAAM,EAAE,GAAG,MAAM,OAAO,EAAE,KAAG,IAI5D,CAAC"}
@@ -1,6 +1,19 @@
1
+ import { ClassValue } from 'clsx';
2
+
1
3
  /**
2
- * Combines class names conditionally
4
+ * Combines class names conditionally with proper Tailwind class merging
5
+ * Uses clsx for conditional classes and tailwind-merge to resolve conflicts
6
+ *
7
+ * @example
8
+ * ```typescript
9
+ * cn('text-red-500', 'text-blue-500') // => 'text-blue-500' (last class wins)
10
+ * cn('p-4', undefined, false, 'bg-white') // => 'p-4 bg-white'
11
+ * cn({ 'hidden': isHidden, 'block': !isHidden }) // => 'hidden' or 'block'
12
+ * ```
3
13
  */
4
- export declare function cn(...classes: (string | undefined | null | false)[]): string;
14
+ export declare function cn(...inputs: ClassValue[]): string;
5
15
  export declare function generateId(prefix?: string): string;
16
+ export { devWarn, devError, devLog } from './dev-utils';
17
+ export { debounce } from './debounce';
18
+ export { useMergedRef } from './useMergedRef';
6
19
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/index.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,wBAAgB,EAAE,CAAC,GAAG,OAAO,EAAE,CAAC,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,KAAK,CAAC,EAAE,GAAG,MAAM,CAE5E;AAMD,wBAAgB,UAAU,CAAC,MAAM,SAAO,GAAG,MAAM,CAGhD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,UAAU,EAAQ,MAAM,MAAM,CAAC;AAG7C;;;;;;;;;;GAUG;AACH,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,CAElD;AAMD,wBAAgB,UAAU,CAAC,MAAM,SAAO,GAAG,MAAM,CAGhD;AAGD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAExD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Merges multiple React refs into a single callback ref.
3
+ * Useful when you need to forward a ref while also keeping an internal ref.
4
+ *
5
+ * @param refs - Array of refs to merge (can be callback refs or ref objects)
6
+ * @returns A callback ref that updates all provided refs
7
+ *
8
+ * @example
9
+ * ```tsx
10
+ * const MyComponent = forwardRef((props, forwardedRef) => {
11
+ * const internalRef = useRef(null);
12
+ * const mergedRef = useMergedRef(forwardedRef, internalRef);
13
+ *
14
+ * return <input ref={mergedRef} />;
15
+ * });
16
+ * ```
17
+ */
18
+ export declare function useMergedRef<T = unknown>(...refs: (React.Ref<T> | undefined)[]): React.RefCallback<T>;
19
+ //# sourceMappingURL=useMergedRef.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMergedRef.d.ts","sourceRoot":"","sources":["../../../src/lib/useMergedRef.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,YAAY,CAAC,CAAC,GAAG,OAAO,EACtC,GAAG,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,EAAE,GACpC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CActB"}