@jamsrui/otp-input 0.0.12 → 0.0.13
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/chunk-5TVJ6UCI.mjs +1 -0
- package/dist/chunk-6EZ5ORGY.mjs +1 -0
- package/dist/chunk-7OASMB7X.mjs +1 -0
- package/dist/chunk-EQPCLKKL.mjs +1 -0
- package/dist/chunk-HOOWHAPU.mjs +1 -0
- package/dist/chunk-IOPU4CKA.mjs +1 -0
- package/dist/chunk-NYIKF22A.mjs +1 -0
- package/dist/chunk-OVL5L7PR.mjs +1 -0
- package/dist/chunk-W3C7AQ5G.mjs +1 -0
- package/dist/chunk-XJPALAY7.mjs +1 -0
- package/dist/chunk-Y77CDLW4.mjs +1 -0
- package/dist/index.d.mts +21 -3
- package/dist/index.mjs +1 -1
- package/dist/otp-input-caret.d.mts +10 -0
- package/dist/otp-input-caret.mjs +1 -0
- package/dist/otp-input-config.d.mts +10 -2
- package/dist/otp-input-config.mjs +1 -1
- package/dist/otp-input-context.d.mts +19 -0
- package/dist/otp-input-context.mjs +1 -0
- package/dist/otp-input-group.d.mts +10 -0
- package/dist/otp-input-group.mjs +1 -0
- package/dist/otp-input-input.d.mts +10 -0
- package/dist/otp-input-input.mjs +1 -0
- package/dist/otp-input-root.d.mts +10 -0
- package/dist/otp-input-root.mjs +1 -0
- package/dist/otp-input-separator.d.mts +10 -0
- package/dist/otp-input-separator.mjs +1 -0
- package/dist/otp-input-slot.d.mts +11 -0
- package/dist/otp-input-slot.mjs +1 -0
- package/dist/otp-input.d.mts +13 -4
- package/dist/otp-input.mjs +1 -1
- package/dist/regexp.d.mts +5 -0
- package/dist/regexp.mjs +1 -0
- package/dist/styles.d.mts +103 -1
- package/dist/styles.mjs +1 -0
- package/dist/use-otp-input.d.mts +33 -4
- package/dist/use-otp-input.mjs +1 -1
- package/package.json +4 -4
- package/dist/chunk-WPMKZ7NQ.mjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as C}from"./chunk-OVL5L7PR.mjs";import{useCallback as l,useEffect as st,useMemo as y,useRef as J,useState as Q}from"react";import{useControlledState as at,useFocus as lt,useHover as ut,useMergeRefs as ct}from"@jamsrui/hooks";import{dataAttr as O,dataAttrDev as m,mapPropsVariants as pt,mergeProps as it}from"@jamsrui/utils";var Pt=S=>{let[U,W]=pt(S,C.variantKeys),r=C(W),{value:X,onValueChange:Y,defaultValue:Z,disabled:c=!1,maxLength:o,onComplete:b,placeholder:w,pattern:N,ref:tt,...V}=U,[p="",G]=at({defaultProp:Z,prop:X,onChange:Y}),s=J(null),{ref:et,isHovered:D}=ut({isDisabled:c}),{ref:nt,isFocused:L}=lt({isDisabled:c}),M=ct([s,et,nt,tt]),R=J([s.current?.selectionStart??null,s.current?.selectionEnd??null,s.current?.selectionDirection??"none"]),d=y(()=>N?new RegExp(N):null,[N]),[f,v]=Q(null),[P,h]=Q(null),T=l(t=>{v(null),h(null)},[]),k=l(t=>{if(s.current){let e=Math.min(s.current.value.length,o-1),n=s.current.value.length;s.current.setSelectionRange(e,n),v(e),h(n)}},[o]),F=l(t=>{let e=t.currentTarget.value.slice(0,o);if(e.length>0&&d&&!d.test(e)){t.preventDefault();return}G(e),e.length===o&&b?.(e)},[o,b,d,G]);st(()=>{let t=s.current;if(!t)return;R.current=[t.selectionStart,t.selectionEnd,t.selectionDirection];function e(){if(!t)return;if(document.activeElement!==t){v(null),h(null);return}let n=t.selectionStart,g=t.selectionEnd,E=t.selectionDirection,i=R.current,a=-1,u=-1,I;if(p.length!==0&&n!==null&&g!==null){if(n===g){if(n===0)a=0,u=1;else if(n===o)a=o-1,u=o;else if(o>1&&p.length>1){let z=0;if(i[0]!==null&&i[1]!==null){I=n<i[1]?"backward":"forward";let ot=i[0]===i[1]&&i[0]<n;I==="backward"&&!ot&&(z=-1)}a=n+z,u=a+1}}a!=-1&&u!==-1&&a!==u&&t.setSelectionRange(a,u,I)}let $=a!==-1?a:n,q=u!==-1?u:g,rt=I??E;v($),h(q),R.current=[$,q,rt]}return document.addEventListener("selectionchange",e,{capture:!0}),()=>{document.removeEventListener("selectionchange",e,{capture:!0})}},[o,p]);let H=y(()=>Array.from({length:6}).map((t,e)=>{let n=p[e]??null,g=w?.[e],E=f!==null&&P!==null&&(f===P&&f===e||f<=e&&P>e);return{char:n,placeholderChar:g,isActive:E}}),[w,P,f,p]),x=l(t=>({"data-slot":m("root"),"data-disabled":O(c),"aria-disabled":O(c),"data-hover":O(D),"data-focus":O(L),...t,className:r.root({className:t.className})}),[L,D,r,c]),A=l(t=>({"data-slot":m("group"),...t,className:r.group({className:t.className})}),[r]),B=l(t=>({"data-slot":m("slot"),...t,className:r.slot({className:t.className})}),[r]),K=l(t=>({"data-slot":m("separator"),...t,className:r.separator({className:t.className})}),[r]),j=l(()=>({...it(V,{onChange:F,onBlur:T,onFocus:k}),ref:M,"data-slot":m("input"),value:p,maxLength:o,className:r.input({className:S.className}),disabled:c,pattern:d?.source}),[V,p,F,T,k,M,o,r,S.className,c,d?.source]),_=l(t=>({"data-slot":m("caret"),...t,className:r.caret({className:t.className})}),[r]);return y(()=>({getRootProps:x,getGroupProps:A,getSlotProps:B,getSeparatorProps:K,getInputProps:j,getCaretProps:_,slots:H}),[x,A,B,K,j,_,H])};export{Pt as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createContext as e,use as n}from"react";var p=e(null),u=()=>{let t=n(p);if(!t)throw new Error("useOtpInputContext must be used within an OtpInputContext");return t};export{p as a,u as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as s}from"./chunk-XJPALAY7.mjs";import{b as p}from"./chunk-6EZ5ORGY.mjs";import{useMemo as m}from"react";import{useRenderElement as u}from"@jamsrui/hooks";import{dataAttr as a}from"@jamsrui/utils";import{jsx as d}from"react/jsx-runtime";var P=n=>{let{getSlotProps:i,slots:l}=p(),t=l[n.index],e=t?.isActive??!1,r=t?.char??"",o=t?.placeholderChar??"",c=m(()=>r||o||(e?d(s,{}):null),[r,o,e]);return u("div",{props:[i(n),{"data-active":a(e),children:c}]})};export{P as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var _="^\\d+$",o="^[a-zA-Z]+$",t="^[a-zA-Z0-9]+$";export{_ as a,o as b,t as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as e}from"./chunk-6EZ5ORGY.mjs";import{useRenderElement as p}from"@jamsrui/hooks";var a=t=>{let{getSeparatorProps:r}=e();return p("div",{props:r(t)})};export{a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as n}from"./chunk-5TVJ6UCI.mjs";import{a as p}from"./chunk-Y77CDLW4.mjs";import{a as o}from"./chunk-NYIKF22A.mjs";import{a as t}from"./chunk-6EZ5ORGY.mjs";import{jsx as r,jsxs as O}from"react/jsx-runtime";var f=e=>{let{children:u,...s}=e,I=n(s);return r(t,{value:I,children:O(o,{children:[r(p,{}),u]})})};export{f as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as t}from"./chunk-6EZ5ORGY.mjs";import{useRenderElement as r}from"@jamsrui/hooks";var m=e=>{let{getRootProps:o}=t();return r("div",{props:o(e)})};export{m as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{radiusVariant as t,tv as r}from"@jamsrui/utils";var o=r({slots:{root:"otp-input otp-input__root relative flex gap-2 items-center group data-disabled:opacity-50 data-disabled:cursor-not-allowed",group:"otp-input__group flex",slot:"otp-input__slot border-divider relative flex items-center justify-center border-y border-r first:border-l first:rounded-l-md last:rounded-r-md transition-all duration-300 ease-in-out outline-solid outline-0 outline-accent-foreground/20 group-data-hover:border-primary-foreground/20 group-focus-within:border-primary-foreground/30 data-active:outline-primary-foreground",separator:"otp-input__separator w-4 h-1 bg-divider",input:["otp-input__input absolute bg-transparent inset-0 size-full outline-none outline-0 border-none border-0","z-10 text-transparent selection:text-transparent selection:bg-transparent"],caret:"otp-input__caret absolute pointer-events-none flex w-[1.5px] bg-primary-foreground animate-caret-blink z-1"},variants:{radius:t(["group","separator"],"otp-input"),size:{sm:{slot:"w-8 h-8 data-active:outline-2",caret:"h-4"},md:{slot:"w-10 h-10 data-active:outline-3",caret:"h-5"},lg:{slot:"w-12 h-12 data-active:outline-4",caret:"h-6"}}},defaultVariants:{radius:"md",size:"md"}});export{o as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as e}from"./chunk-6EZ5ORGY.mjs";import{useRenderElement as p}from"@jamsrui/hooks";var u=t=>{let{getGroupProps:r}=e();return p("div",{props:r(t)})};export{u as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as e}from"./chunk-6EZ5ORGY.mjs";import{useRenderElement as p}from"@jamsrui/hooks";var m=t=>{let{getCaretProps:r}=e();return p("span",{props:r(t)})};export{m as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as t}from"./chunk-6EZ5ORGY.mjs";import{useRenderElement as e}from"@jamsrui/hooks";var u=n=>{let{getInputProps:p}=t();return e("input",{props:p()})};export{u as a};
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,24 @@
|
|
|
1
|
-
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
+
import { OtpInput as OtpInput$1 } from './otp-input.mjs';
|
|
4
|
+
import { OtpInputGroup } from './otp-input-group.mjs';
|
|
5
|
+
import { OtpInputSeparator } from './otp-input-separator.mjs';
|
|
6
|
+
import { OtpInputSlot } from './otp-input-slot.mjs';
|
|
2
7
|
export { OtpInputConfig, useOtpInputConfig } from './otp-input-config.mjs';
|
|
3
|
-
|
|
8
|
+
export { REGEXP_ONLY_CHARS, REGEXP_ONLY_DIGITS, REGEXP_ONLY_DIGITS_AND_CHARS } from './regexp.mjs';
|
|
9
|
+
import './use-otp-input.mjs';
|
|
4
10
|
import '@jamsrui/utils';
|
|
5
|
-
import '
|
|
11
|
+
import './otp-input-caret.mjs';
|
|
12
|
+
import './otp-input-input.mjs';
|
|
13
|
+
import './otp-input-root.mjs';
|
|
14
|
+
import './styles.mjs';
|
|
6
15
|
import '@jamsrui/core';
|
|
16
|
+
|
|
17
|
+
declare const OtpInput: ((props: OtpInput$1.Props) => react_jsx_runtime.JSX.Element) & {
|
|
18
|
+
Root: (props: OtpInput$1.Props) => react_jsx_runtime.JSX.Element;
|
|
19
|
+
Slot: (props: OtpInputSlot.Props) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>>;
|
|
20
|
+
Separator: (props: OtpInputSeparator.Props) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>>;
|
|
21
|
+
Group: (props: OtpInputGroup.Props) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>>;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export { OtpInput };
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"
|
|
1
|
+
import{a as r}from"./chunk-7OASMB7X.mjs";import{a as t}from"./chunk-IOPU4CKA.mjs";import{a as O,b as u,c as m}from"./chunk-EQPCLKKL.mjs";import"./chunk-5TVJ6UCI.mjs";import"./chunk-OVL5L7PR.mjs";import"./chunk-XJPALAY7.mjs";import{a as n,b as I}from"./chunk-WEHL2U4J.mjs";import{a as p}from"./chunk-W3C7AQ5G.mjs";import"./chunk-Y77CDLW4.mjs";import"./chunk-NYIKF22A.mjs";import{a as o}from"./chunk-HOOWHAPU.mjs";import"./chunk-6EZ5ORGY.mjs";var i=Object.assign(t,{Root:t,Slot:r,Separator:o,Group:p});export{i as OtpInput,n as OtpInputConfig,u as REGEXP_ONLY_CHARS,O as REGEXP_ONLY_DIGITS,m as REGEXP_ONLY_DIGITS_AND_CHARS,I as useOtpInputConfig};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { UIProps } from '@jamsrui/utils';
|
|
3
|
+
|
|
4
|
+
declare const OtpInputCaret: (props: OtpInputCaret.Props) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>>;
|
|
5
|
+
declare namespace OtpInputCaret {
|
|
6
|
+
interface Props extends UIProps<"span"> {
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { OtpInputCaret };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{a}from"./chunk-XJPALAY7.mjs";import"./chunk-6EZ5ORGY.mjs";export{a as OtpInputCaret};
|
|
@@ -1,8 +1,16 @@
|
|
|
1
|
-
import { OtpInput } from './otp-input.mjs';
|
|
2
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
2
|
import { GlobalConfigProps } from '@jamsrui/core';
|
|
4
|
-
import '
|
|
3
|
+
import { OtpInput } from './otp-input.mjs';
|
|
4
|
+
import './use-otp-input.mjs';
|
|
5
5
|
import '@jamsrui/utils';
|
|
6
|
+
import './otp-input-caret.mjs';
|
|
7
|
+
import 'react';
|
|
8
|
+
import './otp-input-group.mjs';
|
|
9
|
+
import './otp-input-input.mjs';
|
|
10
|
+
import './otp-input-root.mjs';
|
|
11
|
+
import './otp-input-separator.mjs';
|
|
12
|
+
import './otp-input-slot.mjs';
|
|
13
|
+
import './styles.mjs';
|
|
6
14
|
|
|
7
15
|
declare const useOtpInputConfig: () => Record<string, any>;
|
|
8
16
|
declare const OtpInputConfig: (props: Omit<Partial<Record<string, any>>, "children"> & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b}from"./chunk-WEHL2U4J.mjs";export{a as OtpInputConfig,b as useOtpInputConfig};
|
|
1
|
+
"use client";import{a,b}from"./chunk-WEHL2U4J.mjs";export{a as OtpInputConfig,b as useOtpInputConfig};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { useOtpInput } from './use-otp-input.mjs';
|
|
3
|
+
import '@jamsrui/utils';
|
|
4
|
+
import './otp-input-caret.mjs';
|
|
5
|
+
import './otp-input-group.mjs';
|
|
6
|
+
import './otp-input-input.mjs';
|
|
7
|
+
import './otp-input-root.mjs';
|
|
8
|
+
import './otp-input-separator.mjs';
|
|
9
|
+
import './otp-input-slot.mjs';
|
|
10
|
+
import './styles.mjs';
|
|
11
|
+
|
|
12
|
+
declare const useOtpInputContext: () => OtpInputContext.Props;
|
|
13
|
+
declare const OtpInputContext: react.Context<OtpInputContext.Props | null>;
|
|
14
|
+
declare namespace OtpInputContext {
|
|
15
|
+
interface Props extends ReturnType<typeof useOtpInput> {
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export { OtpInputContext, useOtpInputContext };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b}from"./chunk-6EZ5ORGY.mjs";export{a as OtpInputContext,b as useOtpInputContext};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { UIProps } from '@jamsrui/utils';
|
|
3
|
+
|
|
4
|
+
declare const OtpInputGroup: (props: OtpInputGroup.Props) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>>;
|
|
5
|
+
declare namespace OtpInputGroup {
|
|
6
|
+
interface Props extends UIProps<"div"> {
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { OtpInputGroup };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{a}from"./chunk-W3C7AQ5G.mjs";import"./chunk-6EZ5ORGY.mjs";export{a as OtpInputGroup};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { UIProps } from '@jamsrui/utils';
|
|
3
|
+
|
|
4
|
+
declare const OtpInputInput: (props: OtpInputInput.Props) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>>;
|
|
5
|
+
declare namespace OtpInputInput {
|
|
6
|
+
interface Props extends UIProps<"input"> {
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { OtpInputInput };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{a}from"./chunk-Y77CDLW4.mjs";import"./chunk-6EZ5ORGY.mjs";export{a as OtpInputInput};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { UIProps } from '@jamsrui/utils';
|
|
3
|
+
|
|
4
|
+
declare const OtpInputRoot: (props: OtpInputRoot.Props) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>>;
|
|
5
|
+
declare namespace OtpInputRoot {
|
|
6
|
+
interface Props extends UIProps<"div"> {
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { OtpInputRoot };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{a}from"./chunk-NYIKF22A.mjs";import"./chunk-6EZ5ORGY.mjs";export{a as OtpInputRoot};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { UIProps } from '@jamsrui/utils';
|
|
3
|
+
|
|
4
|
+
declare const OtpInputSeparator: (props: OtpInputSeparator.Props) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>>;
|
|
5
|
+
declare namespace OtpInputSeparator {
|
|
6
|
+
interface Props extends UIProps<"div"> {
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { OtpInputSeparator };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{a}from"./chunk-HOOWHAPU.mjs";import"./chunk-6EZ5ORGY.mjs";export{a as OtpInputSeparator};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { UIProps } from '@jamsrui/utils';
|
|
3
|
+
|
|
4
|
+
declare const OtpInputSlot: (props: OtpInputSlot.Props) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>>;
|
|
5
|
+
declare namespace OtpInputSlot {
|
|
6
|
+
interface Props extends UIProps<"div"> {
|
|
7
|
+
index: number;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { OtpInputSlot };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{a}from"./chunk-7OASMB7X.mjs";import"./chunk-XJPALAY7.mjs";import"./chunk-6EZ5ORGY.mjs";export{a as OtpInputSlot};
|
package/dist/otp-input.d.mts
CHANGED
|
@@ -1,9 +1,18 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import {
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { useOtpInput } from './use-otp-input.mjs';
|
|
3
|
+
import '@jamsrui/utils';
|
|
4
|
+
import './otp-input-caret.mjs';
|
|
5
|
+
import 'react';
|
|
6
|
+
import './otp-input-group.mjs';
|
|
7
|
+
import './otp-input-input.mjs';
|
|
8
|
+
import './otp-input-root.mjs';
|
|
9
|
+
import './otp-input-separator.mjs';
|
|
10
|
+
import './otp-input-slot.mjs';
|
|
11
|
+
import './styles.mjs';
|
|
3
12
|
|
|
4
|
-
declare const OtpInput: (props: OtpInput.Props) =>
|
|
13
|
+
declare const OtpInput: (props: OtpInput.Props) => react_jsx_runtime.JSX.Element;
|
|
5
14
|
declare namespace OtpInput {
|
|
6
|
-
interface Props extends
|
|
15
|
+
interface Props extends useOtpInput.Props {
|
|
7
16
|
}
|
|
8
17
|
}
|
|
9
18
|
|
package/dist/otp-input.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
"use client";import{a}from"./chunk-IOPU4CKA.mjs";import"./chunk-5TVJ6UCI.mjs";import"./chunk-OVL5L7PR.mjs";import"./chunk-Y77CDLW4.mjs";import"./chunk-NYIKF22A.mjs";import"./chunk-6EZ5ORGY.mjs";export{a as OtpInput};
|
package/dist/regexp.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c}from"./chunk-EQPCLKKL.mjs";export{b as REGEXP_ONLY_CHARS,a as REGEXP_ONLY_DIGITS,c as REGEXP_ONLY_DIGITS_AND_CHARS};
|
package/dist/styles.d.mts
CHANGED
|
@@ -1,2 +1,104 @@
|
|
|
1
|
+
import * as _jamsrui_utils from '@jamsrui/utils';
|
|
2
|
+
import { VariantProps } from '@jamsrui/utils';
|
|
1
3
|
|
|
2
|
-
|
|
4
|
+
declare const otpInputVariants: _jamsrui_utils.TVReturnType<{
|
|
5
|
+
radius: {
|
|
6
|
+
sm: {};
|
|
7
|
+
md: {};
|
|
8
|
+
lg: {};
|
|
9
|
+
xl: {};
|
|
10
|
+
"2xl": {};
|
|
11
|
+
"3xl": {};
|
|
12
|
+
full: {};
|
|
13
|
+
none: {};
|
|
14
|
+
};
|
|
15
|
+
size: {
|
|
16
|
+
sm: {
|
|
17
|
+
slot: string;
|
|
18
|
+
caret: string;
|
|
19
|
+
};
|
|
20
|
+
md: {
|
|
21
|
+
slot: string;
|
|
22
|
+
caret: string;
|
|
23
|
+
};
|
|
24
|
+
lg: {
|
|
25
|
+
slot: string;
|
|
26
|
+
caret: string;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
}, {
|
|
30
|
+
root: string;
|
|
31
|
+
group: string;
|
|
32
|
+
slot: string;
|
|
33
|
+
separator: string;
|
|
34
|
+
input: string[];
|
|
35
|
+
caret: string;
|
|
36
|
+
}, undefined, {
|
|
37
|
+
radius: {
|
|
38
|
+
sm: {};
|
|
39
|
+
md: {};
|
|
40
|
+
lg: {};
|
|
41
|
+
xl: {};
|
|
42
|
+
"2xl": {};
|
|
43
|
+
"3xl": {};
|
|
44
|
+
full: {};
|
|
45
|
+
none: {};
|
|
46
|
+
};
|
|
47
|
+
size: {
|
|
48
|
+
sm: {
|
|
49
|
+
slot: string;
|
|
50
|
+
caret: string;
|
|
51
|
+
};
|
|
52
|
+
md: {
|
|
53
|
+
slot: string;
|
|
54
|
+
caret: string;
|
|
55
|
+
};
|
|
56
|
+
lg: {
|
|
57
|
+
slot: string;
|
|
58
|
+
caret: string;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
}, {
|
|
62
|
+
root: string;
|
|
63
|
+
group: string;
|
|
64
|
+
slot: string;
|
|
65
|
+
separator: string;
|
|
66
|
+
input: string[];
|
|
67
|
+
caret: string;
|
|
68
|
+
}, _jamsrui_utils.TVReturnType<{
|
|
69
|
+
radius: {
|
|
70
|
+
sm: {};
|
|
71
|
+
md: {};
|
|
72
|
+
lg: {};
|
|
73
|
+
xl: {};
|
|
74
|
+
"2xl": {};
|
|
75
|
+
"3xl": {};
|
|
76
|
+
full: {};
|
|
77
|
+
none: {};
|
|
78
|
+
};
|
|
79
|
+
size: {
|
|
80
|
+
sm: {
|
|
81
|
+
slot: string;
|
|
82
|
+
caret: string;
|
|
83
|
+
};
|
|
84
|
+
md: {
|
|
85
|
+
slot: string;
|
|
86
|
+
caret: string;
|
|
87
|
+
};
|
|
88
|
+
lg: {
|
|
89
|
+
slot: string;
|
|
90
|
+
caret: string;
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
}, {
|
|
94
|
+
root: string;
|
|
95
|
+
group: string;
|
|
96
|
+
slot: string;
|
|
97
|
+
separator: string;
|
|
98
|
+
input: string[];
|
|
99
|
+
caret: string;
|
|
100
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
101
|
+
type OtpInputVariants = VariantProps<typeof otpInputVariants>;
|
|
102
|
+
type OtpInputSlots = keyof ReturnType<typeof otpInputVariants>;
|
|
103
|
+
|
|
104
|
+
export { type OtpInputSlots, type OtpInputVariants, otpInputVariants };
|
package/dist/styles.mjs
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-OVL5L7PR.mjs";export{a as otpInputVariants};
|
package/dist/use-otp-input.d.mts
CHANGED
|
@@ -1,7 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { PropGetter } from '@jamsrui/utils';
|
|
2
|
+
import { OtpInputCaret } from './otp-input-caret.mjs';
|
|
3
|
+
import { OtpInputGroup } from './otp-input-group.mjs';
|
|
4
|
+
import { OtpInputInput } from './otp-input-input.mjs';
|
|
5
|
+
import { OtpInputRoot } from './otp-input-root.mjs';
|
|
6
|
+
import { OtpInputSeparator } from './otp-input-separator.mjs';
|
|
7
|
+
import { OtpInputSlot } from './otp-input-slot.mjs';
|
|
8
|
+
import { OtpInputVariants } from './styles.mjs';
|
|
9
|
+
import 'react';
|
|
10
|
+
|
|
11
|
+
type OverrideProps<T, R> = Omit<T, keyof R> & R;
|
|
12
|
+
declare const useOtpInput: (props: useOtpInput.Props) => {
|
|
13
|
+
getRootProps: PropGetter<OtpInputRoot.Props>;
|
|
14
|
+
getGroupProps: PropGetter<OtpInputGroup.Props>;
|
|
15
|
+
getSlotProps: PropGetter<OtpInputSlot.Props>;
|
|
16
|
+
getSeparatorProps: PropGetter<OtpInputSeparator.Props>;
|
|
17
|
+
getInputProps: () => OtpInputInput.Props;
|
|
18
|
+
getCaretProps: PropGetter<OtpInputCaret.Props>;
|
|
19
|
+
slots: {
|
|
20
|
+
char: string | null;
|
|
21
|
+
placeholderChar: string | undefined;
|
|
22
|
+
isActive: boolean;
|
|
23
|
+
}[];
|
|
24
|
+
};
|
|
25
|
+
declare namespace useOtpInput {
|
|
26
|
+
interface Props extends OtpInputVariants, OverrideProps<OtpInputInput.Props, {
|
|
27
|
+
value?: string;
|
|
28
|
+
onValueChange?: (value: string) => void;
|
|
29
|
+
defaultValue?: string;
|
|
30
|
+
maxLength: number;
|
|
31
|
+
onComplete?: (value: string) => void;
|
|
32
|
+
}> {
|
|
4
33
|
}
|
|
5
34
|
}
|
|
6
35
|
|
|
7
|
-
export {
|
|
36
|
+
export { useOtpInput };
|
package/dist/use-otp-input.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{a}from"./chunk-5TVJ6UCI.mjs";import"./chunk-OVL5L7PR.mjs";export{a as useOtpInput};
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jamsrui/otp-input",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.13",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"react": ">=19"
|
|
6
6
|
},
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@jamsrui/
|
|
9
|
-
"@jamsrui/
|
|
10
|
-
"@jamsrui/utils": "^0.0.
|
|
8
|
+
"@jamsrui/core": "^0.0.11",
|
|
9
|
+
"@jamsrui/hooks": "^0.0.13",
|
|
10
|
+
"@jamsrui/utils": "^0.0.13"
|
|
11
11
|
},
|
|
12
12
|
"exports": {
|
|
13
13
|
".": {
|
package/dist/chunk-WPMKZ7NQ.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{useRenderElement as t}from"@jamsrui/hooks";var s=e=>{let{render:p,...r}=e;return t("div",{props:r})};export{s as a};
|