@jamsrui/input 0.0.9 → 0.0.11
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-3Z56DQ4V.mjs +1 -0
- package/dist/chunk-4LKT64RP.mjs +1 -0
- package/dist/chunk-5HFZKP5Z.mjs +1 -0
- package/dist/chunk-AYL2YJ7L.mjs +1 -0
- package/dist/chunk-CSQOTAPR.mjs +1 -0
- package/dist/chunk-D4PQ7L52.mjs +1 -0
- package/dist/chunk-EAUBBKY5.mjs +1 -0
- package/dist/chunk-IJYNHO5F.mjs +1 -0
- package/dist/chunk-JZ5MUM6R.mjs +1 -0
- package/dist/chunk-LCBLRGH5.mjs +1 -0
- package/dist/chunk-M46PIXLU.mjs +1 -0
- package/dist/chunk-QA6KD5QS.mjs +1 -0
- package/dist/chunk-U25JGUU3.mjs +1 -0
- package/dist/chunk-VU73JURM.mjs +1 -0
- package/dist/chunk-ZNAJDFMD.mjs +1 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{input-CH01QDEa.d.mts → input-Ulbg7ZdJ.d.mts} +7 -5
- package/dist/input-clear-button.mjs +1 -1
- package/dist/input-config.d.mts +1 -1
- package/dist/input-config.mjs +1 -1
- package/dist/input-content-wrapper.mjs +1 -1
- package/dist/input-content.mjs +1 -1
- package/dist/input-context.d.mts +1 -1
- package/dist/input-context.mjs +1 -1
- package/dist/input-description.mjs +1 -1
- package/dist/input-end-content.mjs +1 -1
- package/dist/input-error-message.mjs +1 -1
- package/dist/input-field.mjs +1 -1
- package/dist/input-label.mjs +1 -1
- package/dist/input-root.mjs +1 -1
- package/dist/input-start-content.mjs +1 -1
- package/dist/input-wrapper.mjs +1 -1
- package/dist/input.d.mts +1 -1
- package/dist/input.mjs +1 -1
- package/dist/styles.d.mts +3 -3
- package/dist/styles.mjs +1 -1
- package/dist/use-input.d.mts +1 -1
- package/dist/use-input.mjs +1 -1
- package/package.json +5 -6
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as r}from"./chunk-D4PQ7L52.mjs";import{useRenderElement as o}from"@jamsrui/hooks";var u=t=>{let{getDescriptionProps:p,helperText:e}=r(),n=o("span",{props:[p(t),{children:e}]});return e?n:null};export{u as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{radiusVariant as t,tv as e}from"@jamsrui/utils";var o=e({slots:{root:"flex flex-col gap-1.5 group",label:"shrink-0 text-sm font-normal text-foreground",description:"text-xs text-foreground-tertiary",errorMessage:"text-xs text-danger",input:["grow bg-transparent font-normal","placeholder:text-foreground-secondary read-only:cursor-not-allowed focus:outline-none disabled:cursor-not-allowed disabled:opacity-50"],wrapper:"",content:"grow flex",contentWrapper:["border flex items-center border-divider","uig-disabled:cursor-not-allowed uig-disabled:opacity-60","not-uig-invalid:uig-focus:border-primary uig-focus:ring-primary","not-uig-invalid:uig-hover:border-divider-dark"],startContent:"pl-2 text-sm text-foreground-secondary",endContent:"pr-2 text-sm text-foreground-secondary",clearButton:""},variants:{fullWidth:{true:{root:"w-full"}},size:{sm:{input:"px-3 py-1.5 text-sm placeholder:text-sm"},md:{input:"px-3 py-2 text-sm placeholder:text-sm"},lg:{input:"px-3 py-2 text-base placeholder:text-base"}},isInvalid:{true:{contentWrapper:"border-danger",label:"text-danger"}},radius:t("contentWrapper")},defaultVariants:{fullWidth:!1,isInvalid:!1,radius:"md",size:"md"}});export{o as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as g}from"./chunk-AYL2YJ7L.mjs";import{a as i}from"./chunk-EAUBBKY5.mjs";import{a as f}from"./chunk-U25JGUU3.mjs";import{a as s}from"./chunk-CSQOTAPR.mjs";import{a}from"./chunk-IJYNHO5F.mjs";import{a as C}from"./chunk-LCBLRGH5.mjs";import{a as c}from"./chunk-QA6KD5QS.mjs";import{b as r}from"./chunk-ZNAJDFMD.mjs";import{a as m}from"./chunk-M46PIXLU.mjs";import{a as e}from"./chunk-VU73JURM.mjs";import{a as u}from"./chunk-3Z56DQ4V.mjs";import{a as I}from"./chunk-JZ5MUM6R.mjs";import{a as n}from"./chunk-D4PQ7L52.mjs";import{mergeConfigProps as W}from"@jamsrui/utils";import{jsx as t,jsxs as o}from"react/jsx-runtime";var y=x=>{let p=r(),P=W(p,p,x),d=g(P);return t(n,{value:d,children:o(a,{children:[o(c,{children:[t(s,{}),o(m,{children:[t(C,{}),t(e,{children:t(f,{})}),t(I,{})]})]}),t(u,{}),t(i,{})]})})};export{y as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as u}from"./chunk-4LKT64RP.mjs";import{useCallback as o,useMemo as J}from"react";import{useControlledState as Q,useFocus as X,useFocusVisible as Y,useHover as Z,useIsDisabled as _,useMergeRefs as tt}from"@jamsrui/hooks";import{cn as r,dataAttrDev as a,mapPropsVariants as et,mergeProps as p}from"@jamsrui/utils";var ct=F=>{let[x,m]=et(F,u.variantKeys),{startContent:d,endContent:P,classNames:s,label:C,isClearable:st,isDisabled:U=!1,isReadonly:nt,description:I,errorMessage:N,value:j,defaultValue:k,onValueChange:A,onClearInput:f,ref:K,slotProps:e,...g}=x,[b="",c]=Q({defaultProp:k,onChange:A,prop:j}),n=u(m),i=m.isInvalid,{isDisabled:l,ref:O}=_({isDisabled:U,isFormControl:!1}),{isFocused:M,ref:$}=X({isDisabled:l}),{isFocusVisible:v,ref:q}=Y({isDisabled:l}),{isHovered:R,ref:z}=Z({isDisabled:l}),y=tt([K,O,$,q,z]),ot=o(t=>{f?.(t),c("")},[f,c]),E=o(t=>{c(t.target.value)},[c]),W=o(t=>({...p(e?.root,t),"data-component":a("input"),"data-slot":a("root"),"data-focused":M,"data-focus-visible":v,"data-hovered":R,"data-disabled":l,"aria-disabled":l,"data-invalid":i,className:n.root({className:r(e?.root?.className,s?.root,t.className)})}),[s?.root,l,v,M,R,i,e?.root,n]),B=o(t=>({...g,...t,ref:y,disabled:l,"data-slot":a("input"),className:n.input({className:r(s?.input,t.className)}),value:b,onChange:E}),[s?.input,g,E,y,l,n,b]),D=o(t=>({...p(e?.wrapper,t),"data-slot":a("inputWrapper"),className:n.wrapper({className:r(e?.wrapper?.className,s?.wrapper,t.className)})}),[s?.wrapper,e?.wrapper,n]),G=o(t=>({...p(e?.content,t),"data-slot":a("content"),className:n.content({className:r(e?.content?.className,s?.content,t.className)})}),[s?.content,e?.content,n]),V=o(t=>({...p(e?.contentWrapper,t),"data-slot":a("contentWrapper"),className:n.contentWrapper({className:r(e?.contentWrapper?.className,s?.contentWrapper,t.className)})}),[s?.contentWrapper,e?.contentWrapper,n]),h=o(t=>({...p(e?.startContent,t),"data-slot":a("startContent"),className:n.startContent({className:r(e?.startContent?.className,s?.startContent,t.className)})}),[s?.startContent,e?.startContent,n]),L=o(t=>({...p(e?.endContent,t),"data-slot":a("endContent"),className:n.endContent({className:r(e?.endContent?.className,s?.endContent,t.className)})}),[s?.endContent,e?.endContent,n]),T=o(t=>({...p(e?.description,t),"data-slot":a("description"),className:n.description({className:r(e?.description?.className,s?.description,t.className)})}),[s?.description,e?.description,n]),w=o(t=>({...p(e?.errorMessage,t),"data-slot":a("errorMessage"),className:n.errorMessage({className:r(e?.errorMessage?.className,s?.errorMessage,t.className)})}),[s?.errorMessage,e?.errorMessage,n]),H=o(t=>({...p(e?.clearButton,t),"data-slot":a("clearButton"),className:n.clearButton({className:r(e?.clearButton?.className,s?.clearButton,t.className)})}),[s?.clearButton,e?.clearButton,n]),S=o(t=>({...p(e?.label,t),"data-slot":a("label"),className:n.label({className:r(e?.label?.className,s?.label,t.className)})}),[s?.label,e?.label,n]);return J(()=>({getRootProps:W,getClearButtonProps:H,getStartContentProps:h,getEndContentProps:L,getInputProps:B,getLabelProps:S,getDescriptionProps:T,getErrorMessageProps:w,label:C,helperText:I,errorMessage:N,isInvalid:i,getWrapperProps:D,getContentProps:G,getContentWrapperProps:V,startContent:d,endContent:P}),[W,H,h,L,B,S,T,w,C,I,N,i,D,G,V,d,P])};export{ct as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as r}from"./chunk-D4PQ7L52.mjs";import{useRenderElement as p}from"@jamsrui/hooks";var a=t=>{let{getLabelProps:n,label:e}=r(),o=p("label",{props:[n(t),{children:e}]});return e?o:null};export{a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createContext as e,use as n}from"react";var o=e(null),r=()=>{let t=n(o);if(!t)throw new Error("useInputContext must be used within InputContextProvider");return t};export{o as a,r as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as e}from"./chunk-D4PQ7L52.mjs";import{useRenderElement as n}from"@jamsrui/hooks";var u=s=>{let{getErrorMessageProps:o,errorMessage:r}=e(),t=n("span",{props:[o(s),{children:r}]});return r?t:null};export{u as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as t}from"./chunk-D4PQ7L52.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{b as t}from"./chunk-D4PQ7L52.mjs";import{useRenderElement as p}from"@jamsrui/hooks";var u=e=>{let{getEndContentProps:r,endContent:n}=t(),o=p("div",{props:[r(e),{children:n}]});return n?o:null};export{u as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as e}from"./chunk-D4PQ7L52.mjs";import{useRenderElement as p}from"@jamsrui/hooks";var i=r=>{let{getStartContentProps:n,startContent:t}=e(),o=p("div",{props:[n(r),{children:t}]});return t?o:null};export{i as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as e}from"./chunk-D4PQ7L52.mjs";import{useRenderElement as p}from"@jamsrui/hooks";var m=r=>{let{getContentWrapperProps:t}=e();return p("div",{props:[t(r)]})};export{m as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as r}from"./chunk-D4PQ7L52.mjs";import{useRenderElement as t}from"@jamsrui/hooks";var m=e=>{let{getWrapperProps:p}=r();return t("div",{props:[p(e)]})};export{m as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as e}from"./chunk-D4PQ7L52.mjs";import{useRenderElement as p}from"@jamsrui/hooks";var u=t=>{let{getInputProps:r}=e();return p("input",{props:[r(t)]})};export{u as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as t}from"./chunk-D4PQ7L52.mjs";import{useRenderElement as r}from"@jamsrui/hooks";var m=e=>{let{getContentProps:n}=t();return r("div",{props:[n(e)]})};export{m as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createConfigContext as o}from"@jamsrui/utils";var[t,n]=o({displayName:"InputConfig"});export{t as a,n as b};
|
package/dist/index.d.mts
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{
|
|
1
|
+
"use client";import{a as t}from"./chunk-5HFZKP5Z.mjs";import"./chunk-AYL2YJ7L.mjs";import"./chunk-EAUBBKY5.mjs";import"./chunk-U25JGUU3.mjs";import"./chunk-CSQOTAPR.mjs";import"./chunk-IJYNHO5F.mjs";import"./chunk-LCBLRGH5.mjs";import"./chunk-QA6KD5QS.mjs";import"./chunk-4LKT64RP.mjs";import{a as n,b as o}from"./chunk-ZNAJDFMD.mjs";import"./chunk-M46PIXLU.mjs";import"./chunk-VU73JURM.mjs";import"./chunk-3Z56DQ4V.mjs";import"./chunk-JZ5MUM6R.mjs";import"./chunk-D4PQ7L52.mjs";export{t as Input,n as InputConfig,o as useInputConfig};
|
|
@@ -24,8 +24,8 @@ declare const useInput: (props: useInput.Props) => {
|
|
|
24
24
|
getDescriptionProps: PropGetter<InputDescription.Props>;
|
|
25
25
|
getErrorMessageProps: PropGetter<InputErrorMessage.Props>;
|
|
26
26
|
label: string | undefined;
|
|
27
|
-
helperText:
|
|
28
|
-
errorMessage:
|
|
27
|
+
helperText: react.ReactNode;
|
|
28
|
+
errorMessage: react.ReactNode;
|
|
29
29
|
isInvalid: boolean | undefined;
|
|
30
30
|
getWrapperProps: PropGetter<InputWrapper.Props>;
|
|
31
31
|
getContentProps: PropGetter<InputContent.Props>;
|
|
@@ -40,13 +40,15 @@ declare namespace useInput {
|
|
|
40
40
|
classNames?: SlotsToClassNames<InputSlots>;
|
|
41
41
|
label?: string;
|
|
42
42
|
isClearable?: boolean;
|
|
43
|
-
|
|
44
|
-
errorMessage?:
|
|
43
|
+
description?: React.ReactNode;
|
|
44
|
+
errorMessage?: React.ReactNode;
|
|
45
45
|
isInvalid?: boolean;
|
|
46
46
|
value?: string;
|
|
47
47
|
defaultValue?: string;
|
|
48
48
|
onValueChange?: (value: string) => void;
|
|
49
49
|
onClearInput?: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
50
|
+
isDisabled?: boolean;
|
|
51
|
+
isReadonly?: boolean;
|
|
50
52
|
slotProps?: {
|
|
51
53
|
root?: Omit<Input.Props, "classNames" | "slotProps">;
|
|
52
54
|
wrapper?: InputWrapper.Props;
|
|
@@ -55,7 +57,7 @@ declare namespace useInput {
|
|
|
55
57
|
startContent?: InputStartContent.Props;
|
|
56
58
|
endContent?: InputEndContent.Props;
|
|
57
59
|
label?: InputLabel.Props;
|
|
58
|
-
|
|
60
|
+
description?: InputDescription.Props;
|
|
59
61
|
errorMessage?: InputErrorMessage.Props;
|
|
60
62
|
clearButton?: InputClearButton.Props;
|
|
61
63
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{b as t}from"./chunk-D4PQ7L52.mjs";import{useRenderElement as o}from"@jamsrui/hooks";var u=e=>{let{getClearButtonProps:r}=t();return o("button",{props:[r(e)]})};export{u as InputClearButton};
|
package/dist/input-config.d.mts
CHANGED
package/dist/input-config.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a,b}from"./chunk-ZNAJDFMD.mjs";export{a as InputConfig,b as useInputConfig};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a}from"./chunk-M46PIXLU.mjs";import"./chunk-D4PQ7L52.mjs";export{a as InputContentWrapper};
|
package/dist/input-content.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a}from"./chunk-VU73JURM.mjs";import"./chunk-D4PQ7L52.mjs";export{a as InputContent};
|
package/dist/input-context.d.mts
CHANGED
package/dist/input-context.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a,b}from"./chunk-D4PQ7L52.mjs";export{a as InputContext,b as useInputContext};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a}from"./chunk-3Z56DQ4V.mjs";import"./chunk-D4PQ7L52.mjs";export{a as InputDescription};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a}from"./chunk-JZ5MUM6R.mjs";import"./chunk-D4PQ7L52.mjs";export{a as InputEndContent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a}from"./chunk-EAUBBKY5.mjs";import"./chunk-D4PQ7L52.mjs";export{a as InputErrorMessage};
|
package/dist/input-field.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a}from"./chunk-U25JGUU3.mjs";import"./chunk-D4PQ7L52.mjs";export{a as InputField};
|
package/dist/input-label.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a}from"./chunk-CSQOTAPR.mjs";import"./chunk-D4PQ7L52.mjs";export{a as InputLabel};
|
package/dist/input-root.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a}from"./chunk-IJYNHO5F.mjs";import"./chunk-D4PQ7L52.mjs";export{a as InputRoot};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a}from"./chunk-LCBLRGH5.mjs";import"./chunk-D4PQ7L52.mjs";export{a as InputStartContent};
|
package/dist/input-wrapper.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a}from"./chunk-QA6KD5QS.mjs";import"./chunk-D4PQ7L52.mjs";export{a as InputWrapper};
|
package/dist/input.d.mts
CHANGED
package/dist/input.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a}from"./chunk-5HFZKP5Z.mjs";import"./chunk-AYL2YJ7L.mjs";import"./chunk-EAUBBKY5.mjs";import"./chunk-U25JGUU3.mjs";import"./chunk-CSQOTAPR.mjs";import"./chunk-IJYNHO5F.mjs";import"./chunk-LCBLRGH5.mjs";import"./chunk-QA6KD5QS.mjs";import"./chunk-4LKT64RP.mjs";import"./chunk-ZNAJDFMD.mjs";import"./chunk-M46PIXLU.mjs";import"./chunk-VU73JURM.mjs";import"./chunk-3Z56DQ4V.mjs";import"./chunk-JZ5MUM6R.mjs";import"./chunk-D4PQ7L52.mjs";export{a as Input};
|
package/dist/styles.d.mts
CHANGED
|
@@ -37,7 +37,7 @@ declare const inputVariants: _jamsrui_utils.TVReturnType<{
|
|
|
37
37
|
}, {
|
|
38
38
|
root: string;
|
|
39
39
|
label: string;
|
|
40
|
-
|
|
40
|
+
description: string;
|
|
41
41
|
errorMessage: string;
|
|
42
42
|
input: string[];
|
|
43
43
|
wrapper: string;
|
|
@@ -82,7 +82,7 @@ declare const inputVariants: _jamsrui_utils.TVReturnType<{
|
|
|
82
82
|
}, {
|
|
83
83
|
root: string;
|
|
84
84
|
label: string;
|
|
85
|
-
|
|
85
|
+
description: string;
|
|
86
86
|
errorMessage: string;
|
|
87
87
|
input: string[];
|
|
88
88
|
wrapper: string;
|
|
@@ -127,7 +127,7 @@ declare const inputVariants: _jamsrui_utils.TVReturnType<{
|
|
|
127
127
|
}, {
|
|
128
128
|
root: string;
|
|
129
129
|
label: string;
|
|
130
|
-
|
|
130
|
+
description: string;
|
|
131
131
|
errorMessage: string;
|
|
132
132
|
input: string[];
|
|
133
133
|
wrapper: string;
|
package/dist/styles.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a}from"./chunk-4LKT64RP.mjs";export{a as inputVariants};
|
package/dist/use-input.d.mts
CHANGED
package/dist/use-input.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a}from"./chunk-AYL2YJ7L.mjs";import"./chunk-4LKT64RP.mjs";export{a as useInput};
|
package/package.json
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jamsrui/input",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.11",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"react": ">=19"
|
|
6
6
|
},
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@jamsrui/hooks": "^0.0.
|
|
9
|
-
"@jamsrui/core": "^0.0.
|
|
10
|
-
"@jamsrui/utils": "^0.0.
|
|
8
|
+
"@jamsrui/hooks": "^0.0.11",
|
|
9
|
+
"@jamsrui/core": "^0.0.10",
|
|
10
|
+
"@jamsrui/utils": "^0.0.11"
|
|
11
11
|
},
|
|
12
12
|
"exports": {
|
|
13
13
|
".": {
|
|
14
14
|
"types": "./dist/index.d.ts",
|
|
15
|
-
"import": "./dist/index.mjs"
|
|
16
|
-
"require": "./dist/index.js"
|
|
15
|
+
"import": "./dist/index.mjs"
|
|
17
16
|
}
|
|
18
17
|
},
|
|
19
18
|
"description": "A modern and beautiful Next.js UI components library.",
|