@jamsrui/input 0.0.8 → 0.0.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/dist/index.d.mts +3 -3
- package/dist/{input-GVjmJHy9.d.mts → input-CH01QDEa.d.mts} +5 -4
- package/dist/input-config.d.mts +3 -3
- package/dist/input-context.d.mts +3 -3
- package/dist/input-description.d.mts +10 -0
- package/dist/input-description.mjs +1 -0
- package/dist/input-root.d.mts +10 -0
- package/dist/input-root.mjs +1 -0
- package/dist/input.d.mts +3 -3
- package/dist/input.mjs +1 -1
- package/dist/styles.d.mts +4 -5
- package/dist/styles.mjs +1 -1
- package/dist/use-input.d.mts +3 -3
- package/dist/use-input.mjs +1 -1
- package/package.json +4 -4
- package/dist/input-helper-text.d.mts +0 -10
- package/dist/input-helper-text.mjs +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { I as Input } from './input-
|
|
1
|
+
export { I as Input } from './input-CH01QDEa.mjs';
|
|
2
2
|
export { InputConfig, useInputConfig } from './input-config.mjs';
|
|
3
3
|
import 'react/jsx-runtime';
|
|
4
4
|
import 'react';
|
|
@@ -6,13 +6,13 @@ import '@jamsrui/utils';
|
|
|
6
6
|
import './input-clear-button.mjs';
|
|
7
7
|
import './input-content.mjs';
|
|
8
8
|
import './input-content-wrapper.mjs';
|
|
9
|
+
import './input-description.mjs';
|
|
9
10
|
import './input-end-content.mjs';
|
|
10
11
|
import './input-error-message.mjs';
|
|
11
12
|
import './input-field.mjs';
|
|
12
|
-
import './input-helper-text.mjs';
|
|
13
13
|
import './input-label.mjs';
|
|
14
|
+
import './input-root.mjs';
|
|
14
15
|
import './input-start-content.mjs';
|
|
15
16
|
import './input-wrapper.mjs';
|
|
16
17
|
import './styles.mjs';
|
|
17
|
-
import 'tailwind-variants';
|
|
18
18
|
import '@jamsrui/core';
|
|
@@ -4,23 +4,24 @@ import { PropGetter, UIProps, SlotsToClassNames } from '@jamsrui/utils';
|
|
|
4
4
|
import { InputClearButton } from './input-clear-button.mjs';
|
|
5
5
|
import { InputContent } from './input-content.mjs';
|
|
6
6
|
import { InputContentWrapper } from './input-content-wrapper.mjs';
|
|
7
|
+
import { InputDescription } from './input-description.mjs';
|
|
7
8
|
import { InputEndContent } from './input-end-content.mjs';
|
|
8
9
|
import { InputErrorMessage } from './input-error-message.mjs';
|
|
9
10
|
import { InputField } from './input-field.mjs';
|
|
10
|
-
import { InputHelperText } from './input-helper-text.mjs';
|
|
11
11
|
import { InputLabel } from './input-label.mjs';
|
|
12
|
+
import { InputRoot } from './input-root.mjs';
|
|
12
13
|
import { InputStartContent } from './input-start-content.mjs';
|
|
13
14
|
import { InputWrapper } from './input-wrapper.mjs';
|
|
14
15
|
import { InputVariantProps, InputSlots } from './styles.mjs';
|
|
15
16
|
|
|
16
17
|
declare const useInput: (props: useInput.Props) => {
|
|
17
|
-
getRootProps: PropGetter<
|
|
18
|
+
getRootProps: PropGetter<InputRoot.Props>;
|
|
18
19
|
getClearButtonProps: PropGetter<InputClearButton.Props>;
|
|
19
20
|
getStartContentProps: PropGetter<InputStartContent.Props>;
|
|
20
21
|
getEndContentProps: PropGetter<InputEndContent.Props>;
|
|
21
22
|
getInputProps: PropGetter<InputField.Props>;
|
|
22
23
|
getLabelProps: PropGetter<InputLabel.Props>;
|
|
23
|
-
|
|
24
|
+
getDescriptionProps: PropGetter<InputDescription.Props>;
|
|
24
25
|
getErrorMessageProps: PropGetter<InputErrorMessage.Props>;
|
|
25
26
|
label: string | undefined;
|
|
26
27
|
helperText: string | undefined;
|
|
@@ -54,7 +55,7 @@ declare namespace useInput {
|
|
|
54
55
|
startContent?: InputStartContent.Props;
|
|
55
56
|
endContent?: InputEndContent.Props;
|
|
56
57
|
label?: InputLabel.Props;
|
|
57
|
-
helperText?:
|
|
58
|
+
helperText?: InputDescription.Props;
|
|
58
59
|
errorMessage?: InputErrorMessage.Props;
|
|
59
60
|
clearButton?: InputClearButton.Props;
|
|
60
61
|
};
|
package/dist/input-config.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { I as Input } from './input-
|
|
1
|
+
import { I as Input } from './input-CH01QDEa.mjs';
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
3
|
import { GlobalConfigProps } from '@jamsrui/core';
|
|
4
4
|
import 'react';
|
|
@@ -6,15 +6,15 @@ import '@jamsrui/utils';
|
|
|
6
6
|
import './input-clear-button.mjs';
|
|
7
7
|
import './input-content.mjs';
|
|
8
8
|
import './input-content-wrapper.mjs';
|
|
9
|
+
import './input-description.mjs';
|
|
9
10
|
import './input-end-content.mjs';
|
|
10
11
|
import './input-error-message.mjs';
|
|
11
12
|
import './input-field.mjs';
|
|
12
|
-
import './input-helper-text.mjs';
|
|
13
13
|
import './input-label.mjs';
|
|
14
|
+
import './input-root.mjs';
|
|
14
15
|
import './input-start-content.mjs';
|
|
15
16
|
import './input-wrapper.mjs';
|
|
16
17
|
import './styles.mjs';
|
|
17
|
-
import 'tailwind-variants';
|
|
18
18
|
|
|
19
19
|
declare const useInputConfig: () => Record<string, any>;
|
|
20
20
|
declare const InputConfig: (props: Omit<Partial<Record<string, any>>, "children"> & {
|
package/dist/input-context.d.mts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { u as useInput } from './input-
|
|
2
|
+
import { u as useInput } from './input-CH01QDEa.mjs';
|
|
3
3
|
import 'react/jsx-runtime';
|
|
4
4
|
import '@jamsrui/utils';
|
|
5
5
|
import './input-clear-button.mjs';
|
|
6
6
|
import './input-content.mjs';
|
|
7
7
|
import './input-content-wrapper.mjs';
|
|
8
|
+
import './input-description.mjs';
|
|
8
9
|
import './input-end-content.mjs';
|
|
9
10
|
import './input-error-message.mjs';
|
|
10
11
|
import './input-field.mjs';
|
|
11
|
-
import './input-helper-text.mjs';
|
|
12
12
|
import './input-label.mjs';
|
|
13
|
+
import './input-root.mjs';
|
|
13
14
|
import './input-start-content.mjs';
|
|
14
15
|
import './input-wrapper.mjs';
|
|
15
16
|
import './styles.mjs';
|
|
16
|
-
import 'tailwind-variants';
|
|
17
17
|
|
|
18
18
|
declare const useInputContext: () => InputContext.Props;
|
|
19
19
|
declare const InputContext: react.Context<InputContext.Props | null>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { UIProps } from '@jamsrui/utils';
|
|
3
|
+
|
|
4
|
+
declare const InputDescription: (props: InputDescription.Props) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | null;
|
|
5
|
+
declare namespace InputDescription {
|
|
6
|
+
interface Props extends UIProps<"span"> {
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { InputDescription };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useRenderElement as n}from"@jamsrui/hooks";import{useInputContext as o}from"./input-context";const u=r=>{const{getDescriptionProps:t,helperText:e}=o(),p=n("span",{props:[t(r),{children:e}]});return e?p:null};export{u as InputDescription};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { UIProps } from '@jamsrui/utils';
|
|
3
|
+
|
|
4
|
+
declare const InputRoot: (props: InputRoot.Props) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>>;
|
|
5
|
+
declare namespace InputRoot {
|
|
6
|
+
interface Props extends UIProps<"div"> {
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { InputRoot };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useRenderElement as o}from"@jamsrui/hooks";import{useInputContext as r}from"./input-context";const m=t=>{const{getRootProps:e}=r();return o("div",{props:[e(t)]})};export{m as InputRoot};
|
package/dist/input.d.mts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import 'react/jsx-runtime';
|
|
2
|
-
export { I as Input } from './input-
|
|
2
|
+
export { I as Input } from './input-CH01QDEa.mjs';
|
|
3
3
|
import 'react';
|
|
4
4
|
import '@jamsrui/utils';
|
|
5
5
|
import './input-clear-button.mjs';
|
|
6
6
|
import './input-content.mjs';
|
|
7
7
|
import './input-content-wrapper.mjs';
|
|
8
|
+
import './input-description.mjs';
|
|
8
9
|
import './input-end-content.mjs';
|
|
9
10
|
import './input-error-message.mjs';
|
|
10
11
|
import './input-field.mjs';
|
|
11
|
-
import './input-helper-text.mjs';
|
|
12
12
|
import './input-label.mjs';
|
|
13
|
+
import './input-root.mjs';
|
|
13
14
|
import './input-start-content.mjs';
|
|
14
15
|
import './input-wrapper.mjs';
|
|
15
16
|
import './styles.mjs';
|
|
16
|
-
import 'tailwind-variants';
|
package/dist/input.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{jsx as t,jsxs as o}from"react/jsx-runtime";import{mergeConfigProps as m}from"@jamsrui/utils";import{useInputConfig as u}from"./input-config";import{InputContent as I}from"./input-content";import{InputContentWrapper as i}from"./input-content-wrapper";import{InputContext as f}from"./input-context";import{InputDescription as s}from"./input-description";import{InputEndContent as a}from"./input-end-content";import{InputErrorMessage as C}from"./input-error-message";import{InputField as c}from"./input-field";import{InputLabel as g}from"./input-label";import{InputRoot as x}from"./input-root";import{InputStartContent as P}from"./input-start-content";import{InputWrapper as d}from"./input-wrapper";import{useInput as W}from"./use-input";const y=r=>{const p=u(),n=m(p,p,r),e=W(n);return t(f,{value:e,children:o(x,{children:[o(d,{children:[t(g,{}),o(i,{children:[t(P,{}),t(I,{children:t(c,{})}),t(a,{})]})]}),t(s,{}),t(C,{})]})})};export{y as Input};
|
package/dist/styles.d.mts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _jamsrui_utils from '@jamsrui/utils';
|
|
2
2
|
import { VariantProps } from '@jamsrui/utils';
|
|
3
3
|
|
|
4
|
-
declare const
|
|
5
|
-
declare const inputVariants: tailwind_variants.TVReturnType<{
|
|
4
|
+
declare const inputVariants: _jamsrui_utils.TVReturnType<{
|
|
6
5
|
fullWidth: {
|
|
7
6
|
true: {
|
|
8
7
|
root: string;
|
|
@@ -92,7 +91,7 @@ declare const inputVariants: tailwind_variants.TVReturnType<{
|
|
|
92
91
|
startContent: string;
|
|
93
92
|
endContent: string;
|
|
94
93
|
clearButton: string;
|
|
95
|
-
},
|
|
94
|
+
}, _jamsrui_utils.TVReturnType<{
|
|
96
95
|
fullWidth: {
|
|
97
96
|
true: {
|
|
98
97
|
root: string;
|
|
@@ -141,4 +140,4 @@ declare const inputVariants: tailwind_variants.TVReturnType<{
|
|
|
141
140
|
type InputVariantProps = VariantProps<typeof inputVariants>;
|
|
142
141
|
type InputSlots = keyof ReturnType<typeof inputVariants>;
|
|
143
142
|
|
|
144
|
-
export { type InputSlots, type InputVariantProps, inputVariants
|
|
143
|
+
export { type InputSlots, type InputVariantProps, inputVariants };
|
package/dist/styles.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{radiusVariant as t,tv as e}from"@jamsrui/utils";const o=
|
|
1
|
+
import{radiusVariant as t,tv as e}from"@jamsrui/utils";const o=e({slots:{root:"flex flex-col gap-1 group",label:"shrink-0 text-sm font-medium text-foreground",helperText:"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-2 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:"p-3 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 inputVariants};
|
package/dist/use-input.d.mts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import 'react';
|
|
2
2
|
import '@jamsrui/utils';
|
|
3
|
-
export { u as useInput } from './input-
|
|
3
|
+
export { u as useInput } from './input-CH01QDEa.mjs';
|
|
4
4
|
import './input-clear-button.mjs';
|
|
5
5
|
import './input-content.mjs';
|
|
6
6
|
import './input-content-wrapper.mjs';
|
|
7
|
+
import './input-description.mjs';
|
|
7
8
|
import './input-end-content.mjs';
|
|
8
9
|
import './input-error-message.mjs';
|
|
9
10
|
import './input-field.mjs';
|
|
10
|
-
import './input-helper-text.mjs';
|
|
11
11
|
import './input-label.mjs';
|
|
12
|
+
import './input-root.mjs';
|
|
12
13
|
import './input-start-content.mjs';
|
|
13
14
|
import './input-wrapper.mjs';
|
|
14
15
|
import './styles.mjs';
|
|
15
16
|
import 'react/jsx-runtime';
|
|
16
|
-
import 'tailwind-variants';
|
package/dist/use-input.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useCallback as s,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 o,dataAttrDev as
|
|
1
|
+
import{useCallback as s,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 o,dataAttrDev as r,mapPropsVariants as et,mergeProps as p}from"@jamsrui/utils";import{inputVariants as H}from"./styles";const ut=S=>{const[F,i]=et(S,H.variantKeys),{startContent:m,endContent:d,classNames:a,label:P,isClearable:at,helperText:C,errorMessage:I,disabled:U=!1,value:j,defaultValue:k,onValueChange:A,onClearInput:N,ref:K,slotProps:e,...f}=F,[g="",c]=Q({defaultProp:k,onChange:A,prop:j}),n=H(i),u=i.isInvalid,{isDisabled:l,ref:O}=_({isDisabled:U,isFormControl:!1}),{isFocused:b,ref:$}=X({isDisabled:l}),{isFocusVisible:M,ref:q}=Y({isDisabled:l}),{isHovered:v,ref:z}=Z({isDisabled:l}),h=tt([K,O,$,q,z]),nt=s(t=>{N?.(t),c("")},[N,c]),T=s(t=>{c(t.target.value)},[c]),E=s(t=>({...p(e?.root,t),"data-component":r("input"),"data-slot":r("root"),"data-focused":b,"data-focus-visible":M,"data-hovered":v,"data-disabled":l,"aria-disabled":l,"data-invalid":u,className:n.root({className:o(e?.root?.className,a?.root,t.className)})}),[a?.root,l,M,b,v,u,e?.root,n]),W=s(t=>({...f,...t,ref:h,disabled:l,"data-slot":r("input"),className:n.input({className:o(a?.input,t.className)}),value:g,onChange:T}),[a?.input,f,T,h,l,n,g]),y=s(t=>({...p(e?.wrapper,t),"data-slot":r("inputWrapper"),className:n.wrapper({className:o(e?.wrapper?.className,a?.wrapper,t.className)})}),[a?.wrapper,e?.wrapper,n]),R=s(t=>({...p(e?.content,t),"data-slot":r("content"),className:n.content({className:o(e?.content?.className,a?.content,t.className)})}),[a?.content,e?.content,n]),x=s(t=>({...p(e?.contentWrapper,t),"data-slot":r("contentWrapper"),className:n.contentWrapper({className:o(e?.contentWrapper?.className,a?.contentWrapper,t.className)})}),[a?.contentWrapper,e?.contentWrapper,n]),B=s(t=>({...p(e?.startContent,t),"data-slot":r("startContent"),className:n.startContent({className:o(e?.startContent?.className,a?.startContent,t.className)})}),[a?.startContent,e?.startContent,n]),G=s(t=>({...p(e?.endContent,t),"data-slot":r("endContent"),className:n.endContent({className:o(e?.endContent?.className,a?.endContent,t.className)})}),[a?.endContent,e?.endContent,n]),V=s(t=>({...p(e?.helperText,t),"data-slot":r("helperText"),className:n.helperText({className:o(e?.helperText?.className,a?.helperText,t.className)})}),[a?.helperText,e?.helperText,n]),L=s(t=>({...p(e?.errorMessage,t),"data-slot":r("errorMessage"),className:n.errorMessage({className:o(e?.errorMessage?.className,a?.errorMessage,t.className)})}),[a?.errorMessage,e?.errorMessage,n]),w=s(t=>({...p(e?.clearButton,t),"data-slot":r("clearButton"),className:n.clearButton({className:o(e?.clearButton?.className,a?.clearButton,t.className)})}),[a?.clearButton,e?.clearButton,n]),D=s(t=>({...p(e?.label,t),"data-slot":r("label"),className:n.label({className:o(e?.label?.className,a?.label,t.className)})}),[a?.label,e?.label,n]);return J(()=>({getRootProps:E,getClearButtonProps:w,getStartContentProps:B,getEndContentProps:G,getInputProps:W,getLabelProps:D,getDescriptionProps:V,getErrorMessageProps:L,label:P,helperText:C,errorMessage:I,isInvalid:u,getWrapperProps:y,getContentProps:R,getContentWrapperProps:x,startContent:m,endContent:d}),[E,w,B,G,W,D,V,L,P,C,I,u,y,R,x,m,d])};export{ut as useInput};
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jamsrui/input",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"react": ">=19"
|
|
6
6
|
},
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@jamsrui/
|
|
9
|
-
"@jamsrui/
|
|
10
|
-
"@jamsrui/
|
|
8
|
+
"@jamsrui/hooks": "^0.0.9",
|
|
9
|
+
"@jamsrui/core": "^0.0.8",
|
|
10
|
+
"@jamsrui/utils": "^0.0.9"
|
|
11
11
|
},
|
|
12
12
|
"exports": {
|
|
13
13
|
".": {
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import * as react from 'react';
|
|
2
|
-
import { UIProps } from '@jamsrui/utils';
|
|
3
|
-
|
|
4
|
-
declare const InputHelperText: (props: InputHelperText.Props) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | null;
|
|
5
|
-
declare namespace InputHelperText {
|
|
6
|
-
interface Props extends UIProps<"span"> {
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export { InputHelperText };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{useRenderElement as n}from"@jamsrui/hooks";import{useInputContext as o}from"./input-context";const u=r=>{const{getHelperTextProps:t,helperText:e}=o(),p=n("span",{props:[t(r),{children:e}]});return e?p:null};export{u as InputHelperText};
|