@dimasbaguspm/versaur 0.0.46 → 0.0.48

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.
@@ -1,4 +1,4 @@
1
- import { C as a, b as n, a as p, D as u, E as i, P as s, c as l, R as I, S, e as c, d as g, f as r, h, g as m, i as P, j as b, T as k, k as o } from "../time-picker-input-DrZ4dyEB.js";
1
+ import { C as a, b as n, a as p, D as u, E as i, P as s, c as l, R as I, S, e as c, d as g, f as r, h, g as m, i as P, j as b, T as k, k as o } from "../time-picker-input-JBEgDV2V.js";
2
2
  export {
3
3
  a as CheckboxInput,
4
4
  n as ChipMultipleInput,
package/dist/js/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { L as s, P as t, S as r } from "./skeleton-BNZyaRjo.js";
2
2
  import { A as n, a as p, B as u, b as i, F as l, f as c, P as I, c as S, d as g, e as d, S as m, T as B } from "./top-bar-Dx0JVXms.js";
3
- import { C as T, b as P, a as x, D as f, E as h, P as A, c as C, R as k, S as M, e as F, d as L, f as D, h as H, g as R, i as G, j, T as q, k as v } from "./time-picker-input-DrZ4dyEB.js";
3
+ import { C as T, b as P, a as x, D as f, E as h, P as A, c as C, R as k, S as M, e as F, d as L, f as D, h as H, g as R, i as G, j, T as q, k as v } from "./time-picker-input-JBEgDV2V.js";
4
4
  import { B as y, D as E, M as N, T as z } from "./tooltip-D6fUigp2.js";
5
5
  import { A as K, a as O, b as Q, c as U, d as V, e as W, f as X, B as Y, r as Z, g as _, h as $, k as aa, i as ea, j as sa, C as ta, F as ra, H as oa, l as na, I as pa, o as ua, q as ia, p as la, M as ca, N as Ia, T as Sa, m as ga, n as da } from "./image-rectangle-B4nXH4Q5.js";
6
6
  import { S as Ba } from "./snackbar-DH8jCh2V.js";
@@ -0,0 +1 @@
1
+
@@ -606,7 +606,8 @@ const mr = m.forwardRef(function({ value: t = "", onChange: o, label: s, formatt
606
606
  }
607
607
  )
608
608
  ), Ce = v(
609
- "w-12 h-12 text-center border rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none disabled:bg-gray-50 text-lg font-semibold",
609
+ // align sizing with TextInput which uses h-9; keep width slightly narrower for single-digit input
610
+ "w-9 h-9 text-center border rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none disabled:bg-gray-50 text-sm font-semibold",
610
611
  {
611
612
  variants: {
612
613
  variant: {
@@ -658,7 +659,6 @@ const mr = m.forwardRef(function({ value: t = "", onChange: o, label: s, formatt
658
659
  id: f,
659
660
  type: a ? "password" : "text",
660
661
  inputMode: "numeric",
661
- pattern: "[0-9]*",
662
662
  maxLength: 1,
663
663
  value: a ? r ? "•" : "" : r,
664
664
  onChange: (h) => {
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export { PinVerifierDrawer } from './pin-verifier-drawer';
2
+ export type { PinVerifierDrawerProps, NumericKeypadProps } from './types';
@@ -0,0 +1,7 @@
1
+ import { default as React } from 'react';
2
+ import { NumericKeypadProps } from './types';
3
+ /**
4
+ * NumericKeypad - A 3x4 grid of numbers (1-9, 0) with delete button
5
+ * Provides touch-friendly input for PIN entry in drawer mode
6
+ */
7
+ export declare const NumericKeypad: React.FC<NumericKeypadProps>;
@@ -0,0 +1,10 @@
1
+ import { default as React } from 'react';
2
+ import { PinVerifierDrawerProps } from './types';
3
+ /**
4
+ * PinVerifierDrawer - A responsive PIN verification component
5
+ *
6
+ * Adapts between Modal (desktop) and Drawer (mobile) based on the `as` prop.
7
+ * For drawer mode, includes a numeric keypad for touch-friendly PIN entry.
8
+ * Provides complete PIN verification flow with proper accessibility and UX.
9
+ */
10
+ export declare const PinVerifierDrawer: React.FC<PinVerifierDrawerProps>;
@@ -0,0 +1,102 @@
1
+ import { ReactNode } from 'react';
2
+ import { PinFieldProps } from '../../forms/pin-field';
3
+ import { DrawerProps } from '../../overlays/drawer';
4
+ import { ModalRootProps } from '../../overlays/modal';
5
+ /**
6
+ * Pin verifier display mode
7
+ */
8
+ export type PinVerifierAs = 'modal' | 'drawer';
9
+ /**
10
+ * Base props for PinVerifierDrawer component
11
+ */
12
+ export interface PinVerifierDrawerProps {
13
+ /**
14
+ * Whether the PIN verifier is open
15
+ */
16
+ isOpen: boolean;
17
+ /**
18
+ * Callback fired when the verifier should close
19
+ */
20
+ onClose: () => void;
21
+ /**
22
+ * Title to display in the header
23
+ */
24
+ title?: ReactNode;
25
+ /**
26
+ * Current PIN value (controlled)
27
+ */
28
+ value?: string;
29
+ /**
30
+ * Default PIN value (uncontrolled)
31
+ */
32
+ defaultValue?: string;
33
+ /**
34
+ * Callback fired when PIN value changes
35
+ */
36
+ onChange?: (value: string) => void;
37
+ /**
38
+ * Callback fired when PIN is completed (6 digits entered)
39
+ */
40
+ onComplete?: (value: string) => void;
41
+ /**
42
+ * Callback fired when verify button is clicked
43
+ */
44
+ onVerify?: (value: string) => void;
45
+ /**
46
+ * Whether to show PIN as dots for security
47
+ */
48
+ secure?: boolean;
49
+ /**
50
+ * Whether the component is in a loading state
51
+ */
52
+ loading?: boolean;
53
+ /**
54
+ * Error message for invalid PIN
55
+ */
56
+ error?: ReactNode;
57
+ /**
58
+ * Whether to show the numeric keypad (only shown for drawer mode)
59
+ */
60
+ showKeypad?: boolean;
61
+ /**
62
+ * Display mode - 'modal' for desktop, 'drawer' for mobile
63
+ */
64
+ as?: PinVerifierAs;
65
+ /**
66
+ * Custom verify button text
67
+ */
68
+ verifyButtonText?: string;
69
+ /**
70
+ * PIN field variant
71
+ */
72
+ variant?: PinFieldProps['variant'];
73
+ /**
74
+ * Additional props passed to Modal (when as='modal')
75
+ */
76
+ modalProps?: Partial<Omit<ModalRootProps, 'isOpen' | 'onClose' | 'children'>>;
77
+ /**
78
+ * Additional props passed to Drawer (when as='drawer')
79
+ */
80
+ drawerProps?: Partial<Omit<DrawerProps, 'isOpen' | 'onClose' | 'children'>>;
81
+ }
82
+ /**
83
+ * Props for the numeric keypad
84
+ */
85
+ export interface NumericKeypadProps {
86
+ /**
87
+ * Callback fired when a number is pressed
88
+ */
89
+ onNumberPress: (digit: string) => void;
90
+ /**
91
+ * Callback fired when delete/backspace is pressed
92
+ */
93
+ onDelete: () => void;
94
+ /**
95
+ * Whether the keypad is disabled
96
+ */
97
+ disabled?: boolean;
98
+ /**
99
+ * Size of the keypad buttons
100
+ */
101
+ size?: 'sm' | 'md' | 'lg';
102
+ }
@@ -73,6 +73,7 @@ const symbolToSubpath = {
73
73
  "Tile": "primitive",
74
74
  "SnackbarsProvider": "providers",
75
75
  "useSnackbars": "providers",
76
+ "PinVerifierDrawer": "templates",
76
77
  "cn": "utils",
77
78
  "cva": "utils",
78
79
  "createVariants": "utils",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dimasbaguspm/versaur",
3
- "version": "0.0.46",
3
+ "version": "0.0.48",
4
4
  "description": "React UI library with Tailwind CSS",
5
5
  "author": "Dimas Bagus Prayogo Mukti<dimas.bagus.pm@gmail.com>",
6
6
  "license": "MIT",
@@ -42,6 +42,10 @@
42
42
  "import": "./dist/js/providers/index.js",
43
43
  "types": "./dist/types/providers/index.d.ts"
44
44
  },
45
+ "./templates": {
46
+ "import": "./dist/js/templates/index.js",
47
+ "types": "./dist/types/templates/index.d.ts"
48
+ },
45
49
  "./styles.css": "./dist/assets/styles.css",
46
50
  "./eslint-subpath-import": "./dist/utils/enforce-subpath-import.js"
47
51
  },