tembro 2.1.8 → 2.1.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/components/form/form-date-range-input.cjs +1 -1
- package/dist/components/form/form-date-range-input.d.ts +1 -1
- package/dist/components/form/form-date-range-input.js +1 -1
- package/dist/components/form/form-input.cjs +1 -1
- package/dist/components/form/form-input.d.ts +7 -7
- package/dist/components/form/form-input.js +11 -11
- package/dist/components/inputs/index.cjs +1 -1
- package/dist/components/inputs/index.d.ts +0 -14
- package/dist/components/inputs/index.js +9 -23
- package/dist/components/inputs/public.cjs +1 -1
- package/dist/components/inputs/public.d.ts +0 -14
- package/dist/components/inputs/public.js +9 -23
- package/dist/components/ui/input/chrome.cjs +1 -0
- package/dist/components/{inputs/input-chrome.js → ui/input/chrome.js} +2 -2
- package/dist/components/ui/input/clearable.cjs +1 -0
- package/dist/components/{inputs/clearable-input.d.ts → ui/input/clearable.d.ts} +1 -1
- package/dist/components/{inputs/clearable-input.js → ui/input/clearable.js} +4 -4
- package/dist/components/{inputs/date-range-input.cjs → ui/input/date-range.cjs} +1 -1
- package/dist/components/{inputs/date-range-input.d.ts → ui/input/date-range.d.ts} +1 -1
- package/dist/components/{inputs/date-range-input.js → ui/input/date-range.js} +3 -3
- package/dist/components/ui/input/date.cjs +1 -0
- package/dist/components/{inputs/date-input.d.ts → ui/input/date.d.ts} +1 -1
- package/dist/components/{inputs/date-input.js → ui/input/date.js} +3 -3
- package/dist/components/ui/input/decorator.cjs +1 -0
- package/dist/components/{inputs/input-decorator.js → ui/input/decorator.js} +3 -3
- package/dist/components/ui/input/index.cjs +1 -1
- package/dist/components/ui/input/index.d.ts +10 -10
- package/dist/components/ui/input/index.js +13 -13
- package/dist/components/ui/input/masked.cjs +1 -0
- package/dist/components/{inputs/masked-input.d.ts → ui/input/masked.d.ts} +1 -1
- package/dist/components/{inputs/masked-input.js → ui/input/masked.js} +3 -3
- package/dist/components/ui/input/money.cjs +1 -0
- package/dist/components/{inputs/money-input.js → ui/input/money.js} +5 -5
- package/dist/components/ui/input/number.cjs +1 -0
- package/dist/components/{inputs/number-input.d.ts → ui/input/number.d.ts} +1 -1
- package/dist/components/{inputs/number-input.js → ui/input/number.js} +3 -3
- package/dist/components/{inputs → ui/input}/numeric-value.js +1 -1
- package/dist/components/ui/input/password.cjs +1 -0
- package/dist/components/{inputs/password-input.d.ts → ui/input/password.d.ts} +1 -1
- package/dist/components/{inputs/password-input.js → ui/input/password.js} +2 -2
- package/dist/components/ui/input/phone.cjs +1 -0
- package/dist/components/{inputs/phone-input.d.ts → ui/input/phone.d.ts} +1 -1
- package/dist/components/{inputs/phone-input.js → ui/input/phone.js} +2 -2
- package/dist/components/ui/input/quantity.cjs +1 -0
- package/dist/components/{inputs/quantity-input.js → ui/input/quantity.js} +6 -6
- package/dist/components/ui/input/search.cjs +1 -0
- package/dist/components/{inputs/search-input.d.ts → ui/input/search.d.ts} +1 -1
- package/dist/components/{inputs/search-input.js → ui/input/search.js} +2 -2
- package/dist/components/{inputs/input-value.js → ui/input/value.js} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +124 -138
- package/dist/public-component-surface.cjs +1 -1
- package/dist/public-component-surface.js +0 -5
- package/dist/showcase/fallback.cjs +3 -3
- package/dist/showcase/fallback.js +119 -118
- package/dist/showcase/premium/combobox/mock.cjs +4 -3
- package/dist/showcase/premium/combobox/mock.js +2 -2
- package/dist/showcase/premium/combobox/showcase.cjs +1 -1
- package/dist/showcase/premium/combobox/showcase.js +2 -2
- package/dist/showcase/premium/date-input/mock.cjs +4 -3
- package/dist/showcase/premium/date-input/mock.js +2 -2
- package/dist/showcase/premium/date-input/showcase.cjs +1 -1
- package/dist/showcase/premium/date-input/showcase.js +2 -1
- package/dist/showcase/premium/date-range-input/mock.cjs +4 -3
- package/dist/showcase/premium/date-range-input/mock.js +2 -2
- package/dist/showcase/premium/date-range-input/showcase.cjs +1 -1
- package/dist/showcase/premium/date-range-input/showcase.js +2 -1
- package/dist/showcase/premium/masked-input/mock.cjs +4 -3
- package/dist/showcase/premium/masked-input/mock.js +2 -2
- package/dist/showcase/premium/masked-input/showcase.cjs +1 -1
- package/dist/showcase/premium/masked-input/showcase.js +2 -1
- package/dist/showcase/premium/money-input/mock.cjs +4 -3
- package/dist/showcase/premium/money-input/mock.js +2 -2
- package/dist/showcase/premium/money-input/showcase.cjs +1 -1
- package/dist/showcase/premium/money-input/showcase.js +2 -1
- package/dist/showcase/premium/number-input/mock.cjs +5 -7
- package/dist/showcase/premium/number-input/mock.js +2 -2
- package/dist/showcase/premium/number-input/showcase.cjs +1 -1
- package/dist/showcase/premium/number-input/showcase.js +2 -1
- package/dist/showcase/premium/password-input/mock.cjs +3 -2
- package/dist/showcase/premium/password-input/mock.js +1 -1
- package/dist/showcase/premium/password-input/showcase.cjs +1 -1
- package/dist/showcase/premium/password-input/showcase.js +2 -1
- package/dist/showcase/premium/phone-input/mock.cjs +5 -4
- package/dist/showcase/premium/phone-input/mock.js +2 -2
- package/dist/showcase/premium/phone-input/showcase.cjs +1 -1
- package/dist/showcase/premium/phone-input/showcase.js +2 -1
- package/dist/showcase/premium/quantity-input/mock.cjs +4 -3
- package/dist/showcase/premium/quantity-input/mock.js +2 -2
- package/dist/showcase/premium/quantity-input/showcase.cjs +1 -1
- package/dist/showcase/premium/quantity-input/showcase.js +2 -1
- package/dist/showcase/premium/search-input/mock.cjs +3 -2
- package/dist/showcase/premium/search-input/mock.js +1 -1
- package/dist/showcase/premium/search-input/showcase.cjs +1 -1
- package/dist/showcase/premium/search-input/showcase.js +2 -1
- package/dist/showcase/premium/simple-select/mock.cjs +3 -3
- package/dist/showcase/premium/simple-select/mock.js +2 -2
- package/dist/showcase/premium/simple-select/showcase.cjs +1 -1
- package/dist/showcase/premium/simple-select/showcase.js +1 -1
- package/dist/showcase/registry-specific.cjs +1 -1
- package/dist/showcase/registry-specific.js +92 -92
- package/dist/showcase/render-registry-preview.cjs +1 -1
- package/dist/showcase/render-registry-preview.js +214 -215
- package/dist/showcase/tembro-registry.json.cjs +1 -1
- package/dist/showcase/tembro-registry.json.js +2 -3
- package/package.json +1 -1
- package/packages/cli/dist/index.cjs +18 -18
- package/packages/cli/vendor/src/components/form/form-date-range-input.tsx +5 -5
- package/packages/cli/vendor/src/components/form/form-input.tsx +7 -7
- package/packages/cli/vendor/src/components/inputs/index.ts +0 -14
- package/packages/cli/vendor/src/components/inputs/public.ts +0 -19
- package/packages/cli/vendor/src/components/{inputs/clearable-input.tsx → ui/input/clearable.tsx} +2 -2
- package/packages/cli/vendor/src/components/{inputs/date-range-input.tsx → ui/input/date-range.tsx} +1 -1
- package/packages/cli/vendor/src/components/{inputs/date-input.tsx → ui/input/date.tsx} +2 -2
- package/packages/cli/vendor/src/components/ui/input/index.tsx +11 -11
- package/packages/cli/vendor/src/components/{inputs/masked-input.tsx → ui/input/masked.tsx} +2 -2
- package/packages/cli/vendor/src/components/{inputs/money-input.tsx → ui/input/money.tsx} +3 -3
- package/packages/cli/vendor/src/components/{inputs/number-input.tsx → ui/input/number.tsx} +3 -3
- package/packages/cli/vendor/src/components/{inputs/password-input.tsx → ui/input/password.tsx} +1 -1
- package/packages/cli/vendor/src/components/{inputs/phone-input.tsx → ui/input/phone.tsx} +1 -1
- package/packages/cli/vendor/src/components/{inputs/quantity-input.tsx → ui/input/quantity.tsx} +3 -3
- package/packages/cli/vendor/src/components/{inputs/search-input.tsx → ui/input/search.tsx} +1 -1
- package/packages/cli/vendor/src/public-component-surface.ts +0 -1
- package/packages/cli/vendor/src/showcase/fallback.tsx +4 -6
- package/packages/cli/vendor/src/showcase/premium/combobox/mock.ts +4 -3
- package/packages/cli/vendor/src/showcase/premium/combobox/showcase.tsx +3 -3
- package/packages/cli/vendor/src/showcase/premium/date-input/mock.ts +4 -3
- package/packages/cli/vendor/src/showcase/premium/date-input/showcase.tsx +3 -2
- package/packages/cli/vendor/src/showcase/premium/date-range-input/mock.ts +4 -3
- package/packages/cli/vendor/src/showcase/premium/date-range-input/showcase.tsx +3 -2
- package/packages/cli/vendor/src/showcase/premium/masked-input/mock.ts +4 -3
- package/packages/cli/vendor/src/showcase/premium/masked-input/showcase.tsx +3 -2
- package/packages/cli/vendor/src/showcase/premium/money-input/mock.ts +4 -3
- package/packages/cli/vendor/src/showcase/premium/money-input/showcase.tsx +3 -2
- package/packages/cli/vendor/src/showcase/premium/number-input/mock.ts +5 -7
- package/packages/cli/vendor/src/showcase/premium/number-input/showcase.tsx +2 -2
- package/packages/cli/vendor/src/showcase/premium/password-input/mock.ts +3 -2
- package/packages/cli/vendor/src/showcase/premium/password-input/showcase.tsx +3 -2
- package/packages/cli/vendor/src/showcase/premium/phone-input/mock.ts +5 -4
- package/packages/cli/vendor/src/showcase/premium/phone-input/showcase.tsx +4 -3
- package/packages/cli/vendor/src/showcase/premium/quantity-input/mock.ts +4 -3
- package/packages/cli/vendor/src/showcase/premium/quantity-input/showcase.tsx +3 -2
- package/packages/cli/vendor/src/showcase/premium/search-input/mock.ts +3 -2
- package/packages/cli/vendor/src/showcase/premium/search-input/showcase.tsx +3 -2
- package/packages/cli/vendor/src/showcase/premium/simple-select/mock.ts +3 -3
- package/packages/cli/vendor/src/showcase/premium/simple-select/showcase.tsx +3 -3
- package/packages/cli/vendor/src/showcase/registry-specific.tsx +1 -2
- package/packages/cli/vendor/src/showcase/render-registry-preview.tsx +2 -4
- package/packages/cli/vendor/src/showcase/tembro-registry.json +1 -3
- package/registry.json +1 -3
- package/dist/components/inputs/clearable-input.cjs +0 -1
- package/dist/components/inputs/color-input.cjs +0 -1
- package/dist/components/inputs/color-input.d.ts +0 -11
- package/dist/components/inputs/color-input.js +0 -42
- package/dist/components/inputs/combobox.cjs +0 -1
- package/dist/components/inputs/combobox.d.ts +0 -29
- package/dist/components/inputs/combobox.js +0 -113
- package/dist/components/inputs/date-input.cjs +0 -1
- package/dist/components/inputs/input-chrome.cjs +0 -1
- package/dist/components/inputs/input-decorator.cjs +0 -1
- package/dist/components/inputs/masked-input.cjs +0 -1
- package/dist/components/inputs/money-input.cjs +0 -1
- package/dist/components/inputs/number-input.cjs +0 -1
- package/dist/components/inputs/password-input.cjs +0 -1
- package/dist/components/inputs/phone-input.cjs +0 -1
- package/dist/components/inputs/quantity-input.cjs +0 -1
- package/dist/components/inputs/quantity-stepper.cjs +0 -1
- package/dist/components/inputs/quantity-stepper.d.ts +0 -12
- package/dist/components/inputs/quantity-stepper.js +0 -52
- package/dist/components/inputs/search-input.cjs +0 -1
- package/dist/components/inputs/simple-select.cjs +0 -1
- package/dist/components/inputs/simple-select.d.ts +0 -13
- package/dist/components/inputs/simple-select.js +0 -8
- package/packages/cli/vendor/src/components/inputs/color-input.tsx +0 -49
- package/packages/cli/vendor/src/components/inputs/combobox.tsx +0 -180
- package/packages/cli/vendor/src/components/inputs/quantity-stepper.tsx +0 -51
- package/packages/cli/vendor/src/components/inputs/simple-select.tsx +0 -23
- /package/dist/components/{inputs/input-chrome.d.ts → ui/input/chrome.d.ts} +0 -0
- /package/dist/components/{inputs/input-decorator.d.ts → ui/input/decorator.d.ts} +0 -0
- /package/dist/components/{inputs/money-input.d.ts → ui/input/money.d.ts} +0 -0
- /package/dist/components/{inputs → ui/input}/numeric-value.cjs +0 -0
- /package/dist/components/{inputs → ui/input}/numeric-value.d.ts +0 -0
- /package/dist/components/{inputs/quantity-input.d.ts → ui/input/quantity.d.ts} +0 -0
- /package/dist/components/{inputs/input-value.cjs → ui/input/value.cjs} +0 -0
- /package/dist/components/{inputs/input-value.d.ts → ui/input/value.d.ts} +0 -0
- /package/packages/cli/vendor/src/components/{inputs/input-chrome.tsx → ui/input/chrome.tsx} +0 -0
- /package/packages/cli/vendor/src/components/{inputs/input-decorator.tsx → ui/input/decorator.tsx} +0 -0
- /package/packages/cli/vendor/src/components/{inputs → ui/input}/numeric-value.ts +0 -0
- /package/packages/cli/vendor/src/components/{inputs/input-value.ts → ui/input/value.ts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../ui/input/date-range.cjs"),t=require("./form-field-shell.cjs");let n=require("react/jsx-runtime"),r=require("react-hook-form");function i({control:i,fromName:a,toName:o,label:s,description:c,required:l,className:u,emptyValue:d=``,onValueChange:f,...p}){return(0,n.jsx)(r.Controller,{control:i,name:a,render:({field:a,fieldState:m})=>(0,n.jsx)(r.Controller,{control:i,name:o,render:({field:r,fieldState:i})=>(0,n.jsx)(t.FormFieldShell,{label:s,description:c,required:l,error:m.error?.message??i.error?.message,className:u,children:(0,n.jsx)(e.DateRangeInput,{value:{from:a.value??``,to:r.value??``},onValueChange:e=>{a.onChange(e.from||d),r.onChange(e.to||d),f?.(e)},...p})})})})}exports.FormDateRangeInput=i;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Control, type FieldPath, type FieldValues } from "react-hook-form";
|
|
2
2
|
import { type FormFieldShellProps } from "@/components/form/form-field-shell";
|
|
3
|
-
import { type DateRangeInputProps, type DateRangeValue } from "@/components/
|
|
3
|
+
import { type DateRangeInputProps, type DateRangeValue } from "@/components/ui/input/date-range";
|
|
4
4
|
export type FormDateRangeInputProps<TFieldValues extends FieldValues = FieldValues, TFromName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>, TToName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = Omit<DateRangeInputProps, "value" | "onValueChange"> & Pick<FormFieldShellProps, "label" | "description" | "required" | "className"> & {
|
|
5
5
|
control: Control<TFieldValues>;
|
|
6
6
|
fromName: TFromName;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DateRangeInput as e } from "../
|
|
1
|
+
import { DateRangeInput as e } from "../ui/input/date-range.js";
|
|
2
2
|
import { FormFieldShell as t } from "./form-field-shell.js";
|
|
3
3
|
import { jsx as n } from "react/jsx-runtime";
|
|
4
4
|
import { Controller as r } from "react-hook-form";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../inputs/date-input.cjs"),n=require("../inputs/date-range-input.cjs"),r=require("../inputs/money-input.cjs"),i=require("../inputs/masked-input.cjs"),a=require("../inputs/number-input.cjs"),o=require("../inputs/phone-input.cjs"),s=require("../inputs/quantity-input.cjs"),c=require("../ui/input/index.cjs"),l=require("./form-field-shell.cjs");let u=require("react");u=e.__toESM(u,1);let d=require("react/jsx-runtime"),f=require("react-hook-form");function p(e){return{label:e.label,description:e.description,success:e.success,loading:e.loading,required:e.required,className:e.className,htmlFor:e.id??e.name,layout:e.layout,descriptionPosition:e.descriptionPosition,labelAction:e.labelAction,requiredIndicator:e.requiredIndicator,errorIcon:e.errorIcon,showErrorIcon:e.showErrorIcon,disabled:e.disabled,readOnly:e.readOnly,labelClassName:e.labelClassName,labelRowClassName:e.labelRowClassName,descriptionClassName:e.descriptionClassName,errorClassName:e.errorClassName,contentClassName:e.contentClassName}}function m(e){let u=e.id??e.name,m=p(e),h=e.kind??`text`,g=e.fieldClassName??`w-full`;return(0,d.jsx)(f.Controller,{control:e.control,name:e.name,rules:e.rules,render:({field:f,fieldState:p})=>{let _=p.error?.message,v=l.resolveFormFieldIds(u,{description:e.description,error:_});if(h===`search`){let{control:t,name:n,label:r,description:i,required:a,className:o,layout:s,descriptionPosition:h,labelAction:y,requiredIndicator:b,errorIcon:x,showErrorIcon:S,disabled:C,readOnly:w,labelClassName:T,labelRowClassName:E,descriptionClassName:D,errorClassName:O,contentClassName:k,fieldClassName:A,id:j,kind:M,onValueChange:N,onBlur:P,...F}=e;return(0,d.jsx)(l.FormFieldShell,{...m,labelId:v.labelId,descriptionId:v.descriptionId,errorId:v.errorId,error:_,htmlFor:j??u,children:(0,d.jsx)(c.Input,{...F,type:`search`,id:j??u,name:f.name,ref:f.ref,value:f.value??``,disabled:C,readOnly:e.readOnly,inputClassName:A??g,"aria-invalid":p.invalid||void 0,"aria-describedby":v.describedBy,"aria-errormessage":_?v.errorId:void 0,onBlur:e=>{f.onBlur(),P?.(e)},onValueChange:e=>{f.onChange(e),N?.(e)}})})}if(h===`password`){let{control:t,name:n,label:r,description:i,required:a,className:o,layout:s,descriptionPosition:h,labelAction:y,requiredIndicator:b,errorIcon:x,showErrorIcon:S,disabled:C,readOnly:w,labelClassName:T,labelRowClassName:E,descriptionClassName:D,errorClassName:O,contentClassName:k,fieldClassName:A,id:j,kind:M,onValueChange:N,onBlur:P,...F}=e;return(0,d.jsx)(l.FormFieldShell,{...m,labelId:v.labelId,descriptionId:v.descriptionId,errorId:v.errorId,error:_,htmlFor:j??u,children:(0,d.jsx)(c.Input,{...F,type:`password`,id:j??u,ref:f.ref,name:f.name,value:f.value??``,disabled:C,readOnly:e.readOnly,inputClassName:A??g,"aria-describedby":v.describedBy,"aria-errormessage":_?v.errorId:void 0,onBlur:e=>{f.onBlur(),P?.(e)},onChange:e=>{let t=e.currentTarget.value;f.onChange(t),N?.(t)},"aria-invalid":p.invalid||void 0})})}if(h===`number`){let{control:t,name:n,label:r,description:i,required:o,className:s,layout:c,descriptionPosition:h,labelAction:y,requiredIndicator:b,errorIcon:x,showErrorIcon:S,disabled:C,readOnly:w,labelClassName:T,labelRowClassName:E,descriptionClassName:D,errorClassName:O,contentClassName:k,fieldClassName:A,id:j,kind:M,emptyValue:N=null,onNumberChange:P,onBlur:F,...I}=e;return(0,d.jsx)(l.FormFieldShell,{...m,labelId:v.labelId,descriptionId:v.descriptionId,errorId:v.errorId,error:_,htmlFor:j??u,children:(0,d.jsx)(a.NumberInput,{...I,id:j??u,name:f.name,ref:f.ref,value:f.value??``,disabled:C,readOnly:e.readOnly,className:A??g,"aria-invalid":p.invalid||void 0,"aria-describedby":v.describedBy,"aria-errormessage":_?v.errorId:void 0,onBlur:e=>{f.onBlur(),F?.(e)},onNumberChange:e=>{f.onChange(e??N),P?.(e)}})})}if(h===`phone`){let{control:t,name:n,label:r,description:i,required:a,className:s,layout:c,descriptionPosition:h,labelAction:y,requiredIndicator:b,errorIcon:x,showErrorIcon:S,disabled:C,readOnly:w,labelClassName:T,labelRowClassName:E,descriptionClassName:D,errorClassName:O,contentClassName:k,fieldClassName:A,id:j,kind:M,valueMode:N=`raw`,countryCode:P=`+998`,maxDigits:F=12,onValueChange:I,onBlur:L,...R}=e,z=f.value==null?``:String(f.value),B=N===`raw`?o.formatPhoneDigits(z,P,F):z;return(0,d.jsx)(l.FormFieldShell,{...m,labelId:v.labelId,descriptionId:v.descriptionId,errorId:v.errorId,error:_,htmlFor:j??u,children:(0,d.jsx)(o.PhoneInput,{...R,id:j??u,name:f.name,ref:f.ref,value:B,disabled:C,readOnly:e.readOnly,countryCode:P,maxDigits:F,className:A??g,"aria-invalid":p.invalid||void 0,"aria-describedby":v.describedBy,"aria-errormessage":_?v.errorId:void 0,onBlur:e=>{f.onBlur(),L?.(e)},onValueChange:(e,t)=>{let n=N===`raw`?t:e;f.onChange(n),I?.(n,t,e)}})})}if(h===`date`){let{control:n,name:r,label:i,description:a,required:o,className:s,layout:c,descriptionPosition:h,labelAction:y,requiredIndicator:b,errorIcon:x,showErrorIcon:S,disabled:C,readOnly:w,labelClassName:T,labelRowClassName:E,descriptionClassName:D,errorClassName:O,contentClassName:k,fieldClassName:A,id:j,kind:M,emptyValue:N=``,onValueChange:P,onBlur:F,...I}=e;return(0,d.jsx)(l.FormFieldShell,{...m,labelId:v.labelId,descriptionId:v.descriptionId,errorId:v.errorId,error:_,htmlFor:j??u,children:(0,d.jsx)(t.DateInput,{...I,id:j??u,name:f.name,ref:f.ref,value:f.value??``,disabled:C,readOnly:e.readOnly,className:A??g,"aria-invalid":p.invalid||void 0,"aria-describedby":v.describedBy,"aria-errormessage":_?v.errorId:void 0,onBlur:e=>{f.onBlur(),F?.(e)},onValueChange:e=>{f.onChange(e||N),P?.(e)}})})}if(h===`clearable`){let{control:t,name:n,label:r,description:i,required:a,className:o,layout:s,descriptionPosition:h,labelAction:y,requiredIndicator:b,errorIcon:x,showErrorIcon:S,disabled:C,readOnly:w,labelClassName:T,labelRowClassName:E,descriptionClassName:D,errorClassName:O,contentClassName:k,fieldClassName:A,id:j,kind:M,emptyValue:N=``,onValueChange:P,onBlur:F,...I}=e;return(0,d.jsx)(l.FormFieldShell,{...m,labelId:v.labelId,descriptionId:v.descriptionId,errorId:v.errorId,error:_,htmlFor:j??u,children:(0,d.jsx)(c.Input,{...I,clearable:!0,id:j??u,name:f.name,ref:f.ref,value:f.value??``,disabled:C,readOnly:e.readOnly,className:A??g,"aria-invalid":p.invalid||void 0,"aria-describedby":v.describedBy,"aria-errormessage":_?v.errorId:void 0,onBlur:e=>{f.onBlur(),F?.(e)},onValueChange:e=>{f.onChange(e||N),P?.(e)}})})}if(h===`masked`){let{control:t,name:n,label:r,description:a,required:o,className:s,layout:c,descriptionPosition:h,labelAction:y,requiredIndicator:b,errorIcon:x,showErrorIcon:S,disabled:C,readOnly:w,labelClassName:T,labelRowClassName:E,descriptionClassName:D,errorClassName:O,contentClassName:k,fieldClassName:A,id:j,kind:M,valueMode:N=`raw`,onValueChange:P,onBlur:F,...I}=e;return(0,d.jsx)(l.FormFieldShell,{...m,labelId:v.labelId,descriptionId:v.descriptionId,errorId:v.errorId,error:_,htmlFor:j??u,children:(0,d.jsx)(i.MaskedInput,{...I,id:j??u,name:f.name,ref:f.ref,value:String(f.value??``),disabled:C,readOnly:e.readOnly,className:A??g,"aria-invalid":p.invalid||void 0,"aria-describedby":v.describedBy,"aria-errormessage":_?v.errorId:void 0,onBlur:e=>{f.onBlur(),F?.(e)},onValueChange:(e,t)=>{let n=N===`raw`?t:e;f.onChange(n),P?.(e,t)}})})}if(h===`money`){let{control:t,name:n,label:i,description:a,required:o,className:s,layout:c,descriptionPosition:h,labelAction:y,requiredIndicator:b,errorIcon:x,showErrorIcon:S,disabled:C,readOnly:w,labelClassName:T,labelRowClassName:E,descriptionClassName:D,errorClassName:O,contentClassName:k,fieldClassName:A,id:j,kind:M,emptyValue:N=null,onValueChange:P,onBlur:F,...I}=e;return(0,d.jsx)(l.FormFieldShell,{...m,labelId:v.labelId,descriptionId:v.descriptionId,errorId:v.errorId,error:_,htmlFor:j??u,children:(0,d.jsx)(r.MoneyInput,{...I,id:j??u,name:f.name,ref:f.ref,value:f.value??null,disabled:C,readOnly:e.readOnly,className:A??g,"aria-invalid":p.invalid||void 0,"aria-describedby":v.describedBy,"aria-errormessage":_?v.errorId:void 0,onBlur:e=>{f.onBlur(),F?.(e)},onValueChange:(e,t)=>{f.onChange(e??N),P?.(e,t)}})})}if(h===`quantity`){let{control:t,name:n,label:r,description:i,required:a,className:o,layout:c,descriptionPosition:h,labelAction:y,requiredIndicator:b,errorIcon:x,showErrorIcon:S,disabled:C,readOnly:w,labelClassName:T,labelRowClassName:E,descriptionClassName:D,errorClassName:O,contentClassName:k,fieldClassName:A,id:j,kind:M,emptyValue:N=null,onValueChange:P,onBlur:F,...I}=e;return(0,d.jsx)(l.FormFieldShell,{...m,labelId:v.labelId,descriptionId:v.descriptionId,errorId:v.errorId,error:_,htmlFor:j??u,children:(0,d.jsx)(s.QuantityInput,{...I,id:j??u,name:f.name,ref:f.ref,value:f.value,disabled:C,readOnly:e.readOnly,className:A??g,"aria-invalid":p.invalid||void 0,"aria-describedby":v.describedBy,"aria-errormessage":_?v.errorId:void 0,onBlur:e=>{f.onBlur(),F?.(e)},onValueChange:e=>{f.onChange(e??N),P?.(e)}})})}if(h===`date-range`){let{control:t,name:r,label:i,description:a,required:o,className:s,layout:c,descriptionPosition:h,labelAction:g,requiredIndicator:y,errorIcon:b,showErrorIcon:x,disabled:S,labelClassName:C,labelRowClassName:w,descriptionClassName:T,errorClassName:E,contentClassName:D,fieldClassName:O,id:k,kind:A,onValueChange:j,onBlur:M,...N}=e,P=f.value;return(0,d.jsx)(l.FormFieldShell,{...m,labelId:v.labelId,descriptionId:v.descriptionId,errorId:v.errorId,error:_,htmlFor:k??u,children:(0,d.jsx)(n.DateRangeInput,{...N,id:k??u,value:P&&typeof P==`object`?{from:P.from,to:P.to}:{from:``,to:``},fromInputProps:{...N.fromInputProps??{},disabled:S,readOnly:e.readOnly,"aria-describedby":v.describedBy,"aria-errormessage":_?v.errorId:void 0},toInputProps:{...N.toInputProps??{},disabled:S,readOnly:e.readOnly,"aria-describedby":v.describedBy,"aria-errormessage":_?v.errorId:void 0},onValueChange:e=>{f.onChange(e),j?.(e)},"aria-invalid":p.invalid||void 0,onBlur:e=>{f.onBlur(),M?.(e)}})})}let{control:y,name:b,label:x,description:S,required:C,className:w,layout:T,descriptionPosition:E,labelAction:D,requiredIndicator:O,errorIcon:k,showErrorIcon:A,disabled:j,readOnly:M,labelClassName:N,labelRowClassName:P,descriptionClassName:F,errorClassName:I,contentClassName:L,fieldClassName:R,transformIn:z,transformOut:B,id:V,kind:H,onChange:U,onBlur:W,...G}=e;return(0,d.jsx)(l.FormFieldShell,{...m,labelId:v.labelId,descriptionId:v.descriptionId,errorId:v.errorId,error:_,htmlFor:V??u,children:(0,d.jsx)(c.Input,{...G,id:V??u,ref:f.ref,name:f.name,value:z?z(f.value):f.value??``,disabled:j,readOnly:M,onBlur:e=>{f.onBlur(),W?.(e)},onChange:e=>{f.onChange(B?B(e):e.target.value),U?.(e)},"aria-invalid":p.invalid||void 0,"aria-describedby":v.describedBy,"aria-errormessage":_?v.errorId:void 0,className:R??g})})}})}exports.FormInput=m;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../ui/input/date.cjs"),n=require("../ui/input/date-range.cjs"),r=require("../ui/input/masked.cjs"),i=require("../ui/input/money.cjs"),a=require("../ui/input/number.cjs"),o=require("../ui/input/phone.cjs"),s=require("../ui/input/quantity.cjs"),c=require("../ui/input/index.cjs"),l=require("./form-field-shell.cjs");let u=require("react");u=e.__toESM(u,1);let d=require("react/jsx-runtime"),f=require("react-hook-form");function p(e){return{label:e.label,description:e.description,success:e.success,loading:e.loading,required:e.required,className:e.className,htmlFor:e.id??e.name,layout:e.layout,descriptionPosition:e.descriptionPosition,labelAction:e.labelAction,requiredIndicator:e.requiredIndicator,errorIcon:e.errorIcon,showErrorIcon:e.showErrorIcon,disabled:e.disabled,readOnly:e.readOnly,labelClassName:e.labelClassName,labelRowClassName:e.labelRowClassName,descriptionClassName:e.descriptionClassName,errorClassName:e.errorClassName,contentClassName:e.contentClassName}}function m(e){let u=e.id??e.name,m=p(e),h=e.kind??`text`,g=e.fieldClassName??`w-full`;return(0,d.jsx)(f.Controller,{control:e.control,name:e.name,rules:e.rules,render:({field:f,fieldState:p})=>{let _=p.error?.message,v=l.resolveFormFieldIds(u,{description:e.description,error:_});if(h===`search`){let{control:t,name:n,label:r,description:i,required:a,className:o,layout:s,descriptionPosition:h,labelAction:y,requiredIndicator:b,errorIcon:x,showErrorIcon:S,disabled:C,readOnly:w,labelClassName:T,labelRowClassName:E,descriptionClassName:D,errorClassName:O,contentClassName:k,fieldClassName:A,id:j,kind:M,onValueChange:N,onBlur:P,...F}=e;return(0,d.jsx)(l.FormFieldShell,{...m,labelId:v.labelId,descriptionId:v.descriptionId,errorId:v.errorId,error:_,htmlFor:j??u,children:(0,d.jsx)(c.Input,{...F,type:`search`,id:j??u,name:f.name,ref:f.ref,value:f.value??``,disabled:C,readOnly:e.readOnly,inputClassName:A??g,"aria-invalid":p.invalid||void 0,"aria-describedby":v.describedBy,"aria-errormessage":_?v.errorId:void 0,onBlur:e=>{f.onBlur(),P?.(e)},onValueChange:e=>{f.onChange(e),N?.(e)}})})}if(h===`password`){let{control:t,name:n,label:r,description:i,required:a,className:o,layout:s,descriptionPosition:h,labelAction:y,requiredIndicator:b,errorIcon:x,showErrorIcon:S,disabled:C,readOnly:w,labelClassName:T,labelRowClassName:E,descriptionClassName:D,errorClassName:O,contentClassName:k,fieldClassName:A,id:j,kind:M,onValueChange:N,onBlur:P,...F}=e;return(0,d.jsx)(l.FormFieldShell,{...m,labelId:v.labelId,descriptionId:v.descriptionId,errorId:v.errorId,error:_,htmlFor:j??u,children:(0,d.jsx)(c.Input,{...F,type:`password`,id:j??u,ref:f.ref,name:f.name,value:f.value??``,disabled:C,readOnly:e.readOnly,inputClassName:A??g,"aria-describedby":v.describedBy,"aria-errormessage":_?v.errorId:void 0,onBlur:e=>{f.onBlur(),P?.(e)},onChange:e=>{let t=e.currentTarget.value;f.onChange(t),N?.(t)},"aria-invalid":p.invalid||void 0})})}if(h===`number`){let{control:t,name:n,label:r,description:i,required:o,className:s,layout:c,descriptionPosition:h,labelAction:y,requiredIndicator:b,errorIcon:x,showErrorIcon:S,disabled:C,readOnly:w,labelClassName:T,labelRowClassName:E,descriptionClassName:D,errorClassName:O,contentClassName:k,fieldClassName:A,id:j,kind:M,emptyValue:N=null,onNumberChange:P,onBlur:F,...I}=e;return(0,d.jsx)(l.FormFieldShell,{...m,labelId:v.labelId,descriptionId:v.descriptionId,errorId:v.errorId,error:_,htmlFor:j??u,children:(0,d.jsx)(a.NumberInput,{...I,id:j??u,name:f.name,ref:f.ref,value:f.value??``,disabled:C,readOnly:e.readOnly,className:A??g,"aria-invalid":p.invalid||void 0,"aria-describedby":v.describedBy,"aria-errormessage":_?v.errorId:void 0,onBlur:e=>{f.onBlur(),F?.(e)},onNumberChange:e=>{f.onChange(e??N),P?.(e)}})})}if(h===`phone`){let{control:t,name:n,label:r,description:i,required:a,className:s,layout:c,descriptionPosition:h,labelAction:y,requiredIndicator:b,errorIcon:x,showErrorIcon:S,disabled:C,readOnly:w,labelClassName:T,labelRowClassName:E,descriptionClassName:D,errorClassName:O,contentClassName:k,fieldClassName:A,id:j,kind:M,valueMode:N=`raw`,countryCode:P=`+998`,maxDigits:F=12,onValueChange:I,onBlur:L,...R}=e,z=f.value==null?``:String(f.value),B=N===`raw`?o.formatPhoneDigits(z,P,F):z;return(0,d.jsx)(l.FormFieldShell,{...m,labelId:v.labelId,descriptionId:v.descriptionId,errorId:v.errorId,error:_,htmlFor:j??u,children:(0,d.jsx)(o.PhoneInput,{...R,id:j??u,name:f.name,ref:f.ref,value:B,disabled:C,readOnly:e.readOnly,countryCode:P,maxDigits:F,className:A??g,"aria-invalid":p.invalid||void 0,"aria-describedby":v.describedBy,"aria-errormessage":_?v.errorId:void 0,onBlur:e=>{f.onBlur(),L?.(e)},onValueChange:(e,t)=>{let n=N===`raw`?t:e;f.onChange(n),I?.(n,t,e)}})})}if(h===`date`){let{control:n,name:r,label:i,description:a,required:o,className:s,layout:c,descriptionPosition:h,labelAction:y,requiredIndicator:b,errorIcon:x,showErrorIcon:S,disabled:C,readOnly:w,labelClassName:T,labelRowClassName:E,descriptionClassName:D,errorClassName:O,contentClassName:k,fieldClassName:A,id:j,kind:M,emptyValue:N=``,onValueChange:P,onBlur:F,...I}=e;return(0,d.jsx)(l.FormFieldShell,{...m,labelId:v.labelId,descriptionId:v.descriptionId,errorId:v.errorId,error:_,htmlFor:j??u,children:(0,d.jsx)(t.DateInput,{...I,id:j??u,name:f.name,ref:f.ref,value:f.value??``,disabled:C,readOnly:e.readOnly,className:A??g,"aria-invalid":p.invalid||void 0,"aria-describedby":v.describedBy,"aria-errormessage":_?v.errorId:void 0,onBlur:e=>{f.onBlur(),F?.(e)},onValueChange:e=>{f.onChange(e||N),P?.(e)}})})}if(h===`clearable`){let{control:t,name:n,label:r,description:i,required:a,className:o,layout:s,descriptionPosition:h,labelAction:y,requiredIndicator:b,errorIcon:x,showErrorIcon:S,disabled:C,readOnly:w,labelClassName:T,labelRowClassName:E,descriptionClassName:D,errorClassName:O,contentClassName:k,fieldClassName:A,id:j,kind:M,emptyValue:N=``,onValueChange:P,onBlur:F,...I}=e;return(0,d.jsx)(l.FormFieldShell,{...m,labelId:v.labelId,descriptionId:v.descriptionId,errorId:v.errorId,error:_,htmlFor:j??u,children:(0,d.jsx)(c.Input,{...I,clearable:!0,id:j??u,name:f.name,ref:f.ref,value:f.value??``,disabled:C,readOnly:e.readOnly,className:A??g,"aria-invalid":p.invalid||void 0,"aria-describedby":v.describedBy,"aria-errormessage":_?v.errorId:void 0,onBlur:e=>{f.onBlur(),F?.(e)},onValueChange:e=>{f.onChange(e||N),P?.(e)}})})}if(h===`masked`){let{control:t,name:n,label:i,description:a,required:o,className:s,layout:c,descriptionPosition:h,labelAction:y,requiredIndicator:b,errorIcon:x,showErrorIcon:S,disabled:C,readOnly:w,labelClassName:T,labelRowClassName:E,descriptionClassName:D,errorClassName:O,contentClassName:k,fieldClassName:A,id:j,kind:M,valueMode:N=`raw`,onValueChange:P,onBlur:F,...I}=e;return(0,d.jsx)(l.FormFieldShell,{...m,labelId:v.labelId,descriptionId:v.descriptionId,errorId:v.errorId,error:_,htmlFor:j??u,children:(0,d.jsx)(r.MaskedInput,{...I,id:j??u,name:f.name,ref:f.ref,value:String(f.value??``),disabled:C,readOnly:e.readOnly,className:A??g,"aria-invalid":p.invalid||void 0,"aria-describedby":v.describedBy,"aria-errormessage":_?v.errorId:void 0,onBlur:e=>{f.onBlur(),F?.(e)},onValueChange:(e,t)=>{let n=N===`raw`?t:e;f.onChange(n),P?.(e,t)}})})}if(h===`money`){let{control:t,name:n,label:r,description:a,required:o,className:s,layout:c,descriptionPosition:h,labelAction:y,requiredIndicator:b,errorIcon:x,showErrorIcon:S,disabled:C,readOnly:w,labelClassName:T,labelRowClassName:E,descriptionClassName:D,errorClassName:O,contentClassName:k,fieldClassName:A,id:j,kind:M,emptyValue:N=null,onValueChange:P,onBlur:F,...I}=e;return(0,d.jsx)(l.FormFieldShell,{...m,labelId:v.labelId,descriptionId:v.descriptionId,errorId:v.errorId,error:_,htmlFor:j??u,children:(0,d.jsx)(i.MoneyInput,{...I,id:j??u,name:f.name,ref:f.ref,value:f.value??null,disabled:C,readOnly:e.readOnly,className:A??g,"aria-invalid":p.invalid||void 0,"aria-describedby":v.describedBy,"aria-errormessage":_?v.errorId:void 0,onBlur:e=>{f.onBlur(),F?.(e)},onValueChange:(e,t)=>{f.onChange(e??N),P?.(e,t)}})})}if(h===`quantity`){let{control:t,name:n,label:r,description:i,required:a,className:o,layout:c,descriptionPosition:h,labelAction:y,requiredIndicator:b,errorIcon:x,showErrorIcon:S,disabled:C,readOnly:w,labelClassName:T,labelRowClassName:E,descriptionClassName:D,errorClassName:O,contentClassName:k,fieldClassName:A,id:j,kind:M,emptyValue:N=null,onValueChange:P,onBlur:F,...I}=e;return(0,d.jsx)(l.FormFieldShell,{...m,labelId:v.labelId,descriptionId:v.descriptionId,errorId:v.errorId,error:_,htmlFor:j??u,children:(0,d.jsx)(s.QuantityInput,{...I,id:j??u,name:f.name,ref:f.ref,value:f.value,disabled:C,readOnly:e.readOnly,className:A??g,"aria-invalid":p.invalid||void 0,"aria-describedby":v.describedBy,"aria-errormessage":_?v.errorId:void 0,onBlur:e=>{f.onBlur(),F?.(e)},onValueChange:e=>{f.onChange(e??N),P?.(e)}})})}if(h===`date-range`){let{control:t,name:r,label:i,description:a,required:o,className:s,layout:c,descriptionPosition:h,labelAction:g,requiredIndicator:y,errorIcon:b,showErrorIcon:x,disabled:S,labelClassName:C,labelRowClassName:w,descriptionClassName:T,errorClassName:E,contentClassName:D,fieldClassName:O,id:k,kind:A,onValueChange:j,onBlur:M,...N}=e,P=f.value;return(0,d.jsx)(l.FormFieldShell,{...m,labelId:v.labelId,descriptionId:v.descriptionId,errorId:v.errorId,error:_,htmlFor:k??u,children:(0,d.jsx)(n.DateRangeInput,{...N,id:k??u,value:P&&typeof P==`object`?{from:P.from,to:P.to}:{from:``,to:``},fromInputProps:{...N.fromInputProps??{},disabled:S,readOnly:e.readOnly,"aria-describedby":v.describedBy,"aria-errormessage":_?v.errorId:void 0},toInputProps:{...N.toInputProps??{},disabled:S,readOnly:e.readOnly,"aria-describedby":v.describedBy,"aria-errormessage":_?v.errorId:void 0},onValueChange:e=>{f.onChange(e),j?.(e)},"aria-invalid":p.invalid||void 0,onBlur:e=>{f.onBlur(),M?.(e)}})})}let{control:y,name:b,label:x,description:S,required:C,className:w,layout:T,descriptionPosition:E,labelAction:D,requiredIndicator:O,errorIcon:k,showErrorIcon:A,disabled:j,readOnly:M,labelClassName:N,labelRowClassName:P,descriptionClassName:F,errorClassName:I,contentClassName:L,fieldClassName:R,transformIn:z,transformOut:B,id:V,kind:H,onChange:U,onBlur:W,...G}=e;return(0,d.jsx)(l.FormFieldShell,{...m,labelId:v.labelId,descriptionId:v.descriptionId,errorId:v.errorId,error:_,htmlFor:V??u,children:(0,d.jsx)(c.Input,{...G,id:V??u,ref:f.ref,name:f.name,value:z?z(f.value):f.value??``,disabled:j,readOnly:M,onBlur:e=>{f.onBlur(),W?.(e)},onChange:e=>{f.onChange(B?B(e):e.target.value),U?.(e)},"aria-invalid":p.invalid||void 0,"aria-describedby":v.describedBy,"aria-errormessage":_?v.errorId:void 0,className:R??g})})}})}exports.FormInput=m;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { type Control, type FieldPath, type FieldValues, type RegisterOptions } from "react-hook-form";
|
|
3
|
-
import { type DateRangeInputProps, type DateRangeValue } from "@/components/
|
|
4
|
-
import { type DateInputProps } from "@/components/
|
|
3
|
+
import { type DateRangeInputProps, type DateRangeValue } from "@/components/ui/input/date-range";
|
|
4
|
+
import { type DateInputProps } from "@/components/ui/input/date";
|
|
5
5
|
import { type InputClearableProps, type InputSearchProps } from "@/components/ui/input";
|
|
6
|
-
import { type MaskedInputProps } from "@/components/
|
|
7
|
-
import { type MoneyInputProps } from "@/components/
|
|
8
|
-
import { type NumberInputProps } from "@/components/
|
|
9
|
-
import { type PhoneInputProps } from "@/components/
|
|
10
|
-
import { type QuantityInputProps } from "@/components/
|
|
6
|
+
import { type MaskedInputProps } from "@/components/ui/input/masked";
|
|
7
|
+
import { type MoneyInputProps } from "@/components/ui/input/money";
|
|
8
|
+
import { type NumberInputProps } from "@/components/ui/input/number";
|
|
9
|
+
import { type PhoneInputProps } from "@/components/ui/input/phone";
|
|
10
|
+
import { type QuantityInputProps } from "@/components/ui/input/quantity";
|
|
11
11
|
import { type FormFieldShellControlProps } from "@/components/form/form-field-shell";
|
|
12
12
|
export type FormInputKind = "text" | "search" | "password" | "number" | "phone" | "date" | "date-range" | "clearable" | "masked" | "money" | "quantity";
|
|
13
13
|
export type FormInputPhoneInputValueMode = "raw" | "masked";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { DateInput as e } from "../
|
|
2
|
-
import { DateRangeInput as t } from "../
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { NumberInput as i } from "../
|
|
6
|
-
import { PhoneInput as a, formatPhoneDigits as o } from "../
|
|
7
|
-
import { QuantityInput as s } from "../
|
|
1
|
+
import { DateInput as e } from "../ui/input/date.js";
|
|
2
|
+
import { DateRangeInput as t } from "../ui/input/date-range.js";
|
|
3
|
+
import { MaskedInput as n } from "../ui/input/masked.js";
|
|
4
|
+
import { MoneyInput as r } from "../ui/input/money.js";
|
|
5
|
+
import { NumberInput as i } from "../ui/input/number.js";
|
|
6
|
+
import { PhoneInput as a, formatPhoneDigits as o } from "../ui/input/phone.js";
|
|
7
|
+
import { QuantityInput as s } from "../ui/input/quantity.js";
|
|
8
8
|
import { Input as c } from "../ui/input/index.js";
|
|
9
9
|
import { FormFieldShell as l, resolveFormFieldIds as u } from "./form-field-shell.js";
|
|
10
10
|
import "react";
|
|
@@ -234,7 +234,7 @@ function m(m) {
|
|
|
234
234
|
});
|
|
235
235
|
}
|
|
236
236
|
if (_ === "masked") {
|
|
237
|
-
let { control: e, name: t, label:
|
|
237
|
+
let { control: e, name: t, label: r, description: i, required: a, className: o, layout: s, descriptionPosition: c, labelAction: u, requiredIndicator: _, errorIcon: x, showErrorIcon: S, disabled: C, readOnly: w, labelClassName: T, labelRowClassName: E, descriptionClassName: D, errorClassName: O, contentClassName: k, fieldClassName: A, id: j, kind: M, valueMode: N = "raw", onValueChange: P, onBlur: F, ...I } = m;
|
|
238
238
|
return /* @__PURE__ */ d(l, {
|
|
239
239
|
...g,
|
|
240
240
|
labelId: b.labelId,
|
|
@@ -242,7 +242,7 @@ function m(m) {
|
|
|
242
242
|
errorId: b.errorId,
|
|
243
243
|
error: y,
|
|
244
244
|
htmlFor: j ?? h,
|
|
245
|
-
children: /* @__PURE__ */ d(
|
|
245
|
+
children: /* @__PURE__ */ d(n, {
|
|
246
246
|
...I,
|
|
247
247
|
id: j ?? h,
|
|
248
248
|
name: f.name,
|
|
@@ -265,7 +265,7 @@ function m(m) {
|
|
|
265
265
|
});
|
|
266
266
|
}
|
|
267
267
|
if (_ === "money") {
|
|
268
|
-
let { control: e, name: t, label:
|
|
268
|
+
let { control: e, name: t, label: n, description: i, required: a, className: o, layout: s, descriptionPosition: c, labelAction: u, requiredIndicator: _, errorIcon: x, showErrorIcon: S, disabled: C, readOnly: w, labelClassName: T, labelRowClassName: E, descriptionClassName: D, errorClassName: O, contentClassName: k, fieldClassName: A, id: j, kind: M, emptyValue: N = null, onValueChange: P, onBlur: F, ...I } = m;
|
|
269
269
|
return /* @__PURE__ */ d(l, {
|
|
270
270
|
...g,
|
|
271
271
|
labelId: b.labelId,
|
|
@@ -273,7 +273,7 @@ function m(m) {
|
|
|
273
273
|
errorId: b.errorId,
|
|
274
274
|
error: y,
|
|
275
275
|
htmlFor: j ?? h,
|
|
276
|
-
children: /* @__PURE__ */ d(
|
|
276
|
+
children: /* @__PURE__ */ d(r, {
|
|
277
277
|
...I,
|
|
278
278
|
id: j ?? h,
|
|
279
279
|
name: f.name,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./async-select.cjs"),t=require("./otp-input.cjs"),n=require("./rating.cjs"),r=require("./slider.cjs"),i=require("./tag-input.cjs"),a=require("./inline-editable.cjs"),o=require("./json-input.cjs"),s=require("./time-picker.cjs");exports.AsyncMultiSelect=e.AsyncMultiSelect,exports.AsyncSelect=e.AsyncSelect,exports.DateTimePicker=s.DateTimePicker,exports.InlineEditable=a.InlineEditable,exports.JsonInput=o.JsonInput,exports.OtpInput=t.OtpInput,exports.RangeSlider=r.RangeSlider,exports.Rating=n.Rating,exports.Slider=r.Slider,exports.TagInput=i.TagInput,exports.TimePicker=s.TimePicker,exports.TimeRangePicker=s.TimeRangePicker;
|
|
@@ -1,20 +1,6 @@
|
|
|
1
1
|
export * from "./async-select";
|
|
2
|
-
export * from "./clearable-input";
|
|
3
|
-
export * from "./combobox";
|
|
4
|
-
export * from "./color-input";
|
|
5
|
-
export * from "./date-input";
|
|
6
|
-
export * from "./date-range-input";
|
|
7
|
-
export * from "./masked-input";
|
|
8
|
-
export * from "./money-input";
|
|
9
|
-
export * from "./number-input";
|
|
10
2
|
export * from "./otp-input";
|
|
11
|
-
export * from "./password-input";
|
|
12
|
-
export * from "./phone-input";
|
|
13
|
-
export * from "./quantity-input";
|
|
14
|
-
export * from "./quantity-stepper";
|
|
15
3
|
export * from "./rating";
|
|
16
|
-
export * from "./search-input";
|
|
17
|
-
export * from "./simple-select";
|
|
18
4
|
export * from "./json-input";
|
|
19
5
|
export * from "./time-picker";
|
|
20
6
|
export * from "./slider";
|
|
@@ -1,23 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
import { SearchInput as h } from "./search-input.js";
|
|
11
|
-
import { AsyncMultiSelect as g, AsyncSelect as _ } from "./async-select.js";
|
|
12
|
-
import { Combobox as v } from "./combobox.js";
|
|
13
|
-
import { SimpleSelect as y } from "./simple-select.js";
|
|
14
|
-
import { ColorInput as b } from "./color-input.js";
|
|
15
|
-
import { OtpInput as x } from "./otp-input.js";
|
|
16
|
-
import { QuantityStepper as S } from "./quantity-stepper.js";
|
|
17
|
-
import { Rating as C } from "./rating.js";
|
|
18
|
-
import { RangeSlider as w, Slider as T } from "./slider.js";
|
|
19
|
-
import { TagInput as E } from "./tag-input.js";
|
|
20
|
-
import { InlineEditable as D } from "./inline-editable.js";
|
|
21
|
-
import { JsonInput as O } from "./json-input.js";
|
|
22
|
-
import { DateTimePicker as k, TimePicker as A, TimeRangePicker as j } from "./time-picker.js";
|
|
23
|
-
export { g as AsyncMultiSelect, _ as AsyncSelect, e as ClearableInput, b as ColorInput, v as Combobox, t as DateInput, n as DateRangeInput, k as DateTimePicker, D as InlineEditable, O as JsonInput, a as MaskedInput, r as MoneyInput, o as NumberInput, x as OtpInput, l as PasswordInput, u as PhoneInput, p as QuantityInput, S as QuantityStepper, w as RangeSlider, C as Rating, h as SearchInput, y as SimpleSelect, T as Slider, E as TagInput, A as TimePicker, j as TimeRangePicker, s as clampNumber, m as clampQuantity, d as formatPhoneDigits, f as onlyDigits, i as parseMoneyInput, c as parseNumberInput };
|
|
1
|
+
import { AsyncMultiSelect as e, AsyncSelect as t } from "./async-select.js";
|
|
2
|
+
import { OtpInput as n } from "./otp-input.js";
|
|
3
|
+
import { Rating as r } from "./rating.js";
|
|
4
|
+
import { RangeSlider as i, Slider as a } from "./slider.js";
|
|
5
|
+
import { TagInput as o } from "./tag-input.js";
|
|
6
|
+
import { InlineEditable as s } from "./inline-editable.js";
|
|
7
|
+
import { JsonInput as c } from "./json-input.js";
|
|
8
|
+
import { DateTimePicker as l, TimePicker as u, TimeRangePicker as d } from "./time-picker.js";
|
|
9
|
+
export { e as AsyncMultiSelect, t as AsyncSelect, l as DateTimePicker, s as InlineEditable, c as JsonInput, n as OtpInput, i as RangeSlider, r as Rating, a as Slider, o as TagInput, u as TimePicker, d as TimeRangePicker };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./async-select.cjs"),t=require("./otp-input.cjs"),n=require("./rating.cjs"),r=require("./slider.cjs"),i=require("./tag-input.cjs"),a=require("./inline-editable.cjs"),o=require("./json-input.cjs"),s=require("./time-picker.cjs");exports.AsyncMultiSelect=e.AsyncMultiSelect,exports.AsyncSelect=e.AsyncSelect,exports.DateTimePicker=s.DateTimePicker,exports.InlineEditable=a.InlineEditable,exports.JsonInput=o.JsonInput,exports.OtpInput=t.OtpInput,exports.RangeSlider=r.RangeSlider,exports.Rating=n.Rating,exports.Slider=r.Slider,exports.TagInput=i.TagInput,exports.TimePicker=s.TimePicker,exports.TimeRangePicker=s.TimeRangePicker;
|
|
@@ -1,20 +1,6 @@
|
|
|
1
1
|
export * from "./async-select";
|
|
2
|
-
export * from "./combobox";
|
|
3
|
-
export * from "./simple-select";
|
|
4
|
-
export * from "./clearable-input";
|
|
5
|
-
export * from "./color-input";
|
|
6
|
-
export * from "./date-input";
|
|
7
|
-
export * from "./date-range-input";
|
|
8
|
-
export * from "./masked-input";
|
|
9
|
-
export * from "./money-input";
|
|
10
|
-
export * from "./number-input";
|
|
11
2
|
export * from "./otp-input";
|
|
12
|
-
export * from "./password-input";
|
|
13
|
-
export * from "./phone-input";
|
|
14
|
-
export * from "./quantity-input";
|
|
15
|
-
export * from "./quantity-stepper";
|
|
16
3
|
export * from "./rating";
|
|
17
|
-
export * from "./search-input";
|
|
18
4
|
export * from "./slider";
|
|
19
5
|
export * from "./tag-input";
|
|
20
6
|
export * from "./inline-editable";
|
|
@@ -1,23 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
import { SearchInput as h } from "./search-input.js";
|
|
11
|
-
import { AsyncMultiSelect as g, AsyncSelect as _ } from "./async-select.js";
|
|
12
|
-
import { Combobox as v } from "./combobox.js";
|
|
13
|
-
import { SimpleSelect as y } from "./simple-select.js";
|
|
14
|
-
import { ColorInput as b } from "./color-input.js";
|
|
15
|
-
import { OtpInput as x } from "./otp-input.js";
|
|
16
|
-
import { QuantityStepper as S } from "./quantity-stepper.js";
|
|
17
|
-
import { Rating as C } from "./rating.js";
|
|
18
|
-
import { RangeSlider as w, Slider as T } from "./slider.js";
|
|
19
|
-
import { TagInput as E } from "./tag-input.js";
|
|
20
|
-
import { InlineEditable as D } from "./inline-editable.js";
|
|
21
|
-
import { JsonInput as O } from "./json-input.js";
|
|
22
|
-
import { DateTimePicker as k, TimePicker as A, TimeRangePicker as j } from "./time-picker.js";
|
|
23
|
-
export { g as AsyncMultiSelect, _ as AsyncSelect, e as ClearableInput, b as ColorInput, v as Combobox, t as DateInput, n as DateRangeInput, k as DateTimePicker, D as InlineEditable, O as JsonInput, a as MaskedInput, r as MoneyInput, o as NumberInput, x as OtpInput, l as PasswordInput, u as PhoneInput, p as QuantityInput, S as QuantityStepper, w as RangeSlider, C as Rating, h as SearchInput, y as SimpleSelect, T as Slider, E as TagInput, A as TimePicker, j as TimeRangePicker, s as clampNumber, m as clampQuantity, d as formatPhoneDigits, f as onlyDigits, i as parseMoneyInput, c as parseNumberInput };
|
|
1
|
+
import { AsyncMultiSelect as e, AsyncSelect as t } from "./async-select.js";
|
|
2
|
+
import { OtpInput as n } from "./otp-input.js";
|
|
3
|
+
import { Rating as r } from "./rating.js";
|
|
4
|
+
import { RangeSlider as i, Slider as a } from "./slider.js";
|
|
5
|
+
import { TagInput as o } from "./tag-input.js";
|
|
6
|
+
import { InlineEditable as s } from "./inline-editable.js";
|
|
7
|
+
import { JsonInput as c } from "./json-input.js";
|
|
8
|
+
import { DateTimePicker as l, TimePicker as u, TimeRangePicker as d } from "./time-picker.js";
|
|
9
|
+
export { e as AsyncMultiSelect, t as AsyncSelect, l as DateTimePicker, s as InlineEditable, c as JsonInput, n as OtpInput, i as RangeSlider, r as Rating, a as Slider, o as TagInput, u as TimePicker, d as TimeRangePicker };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../lib/utils.cjs");let n=require("react");n=e.__toESM(n,1);let r=require("react/jsx-runtime");function i({start:e,end:n,startClassName:i,endClassName:a,className:o,children:s,...c}){return(0,r.jsxs)(`div`,{"data-slot":`input-chrome`,className:t.cn(`flex h-11 w-full min-w-0 items-center rounded-[var(--aui-control-radius,var(--radius-md))] border border-[color:var(--aui-control-border-strong,var(--input))] bg-[color:var(--aui-control-surface,var(--background))] shadow-[var(--aui-control-shadow,none)] transition-[background-color,border-color,box-shadow] hover:border-[color:var(--aui-control-hover-border,var(--ring))] hover:bg-[color:var(--aui-control-surface-hover,var(--background))] focus-within:border-[color:var(--ring)] focus-within:shadow-[var(--aui-control-shadow,none),0_0_0_1px_var(--aui-focus-ring,var(--ring)),0_0_0_4px_var(--aui-focus-ring-soft,transparent)]`,o),...c,children:[e&&(0,r.jsx)(`span`,{className:t.cn(`shrink-0`,i),children:e}),s,n&&(0,r.jsx)(`span`,{className:t.cn(`shrink-0`,a),children:n})]})}exports.InputChrome=i;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { cn as e } from "
|
|
1
|
+
import { cn as e } from "../../../lib/utils.js";
|
|
2
2
|
import "react";
|
|
3
3
|
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
4
|
-
//#region src/components/
|
|
4
|
+
//#region src/components/ui/input/chrome.tsx
|
|
5
5
|
function r({ start: r, end: i, startClassName: a, endClassName: o, className: s, children: c, ...l }) {
|
|
6
6
|
return /* @__PURE__ */ n("div", {
|
|
7
7
|
"data-slot": "input-chrome",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../lib/utils.cjs"),n=require("./decorator.cjs"),r=require("./value.cjs");let i=require("react");i=e.__toESM(i,1);let a=require("lucide-react"),o=require("react/jsx-runtime");var s=i.forwardRef(({value:e,onChange:s,onValueChange:c,onClear:l,clearable:u=!0,clearLabel:d=`Clear`,clearOnEscape:f=!0,focusAfterClear:p=!0,replaceTrailingWhenClear:m=!0,leadingIcon:h,trailing:g,trailingAction:_,disabled:v,onKeyDown:y,...b},x)=>{let S=i.useRef(null),C=r.getInputValue(e),w=u&&C.length>0&&!v&&!b.readOnly,T=r.createInputChangeHandler({onChange:s,onValueChange:c});i.useImperativeHandle(x,()=>S.current);let E=()=>{w&&(c?.(``),l?.(),p&&S.current?.focus())},D=e=>{t.stopInteractivePropagation(e),E()},O=e=>{t.stopInteractivePropagation(e)};return(0,o.jsx)(n.InputDecorator,{"data-slot":`clearable-input`,ref:S,value:C,disabled:v,onChange:T,onKeyDown:e=>{y?.(e),!e.defaultPrevented&&f&&e.key===`Escape`&&w&&(e.preventDefault(),E())},leading:h,trailing:w&&m?null:g,trailingAction:(0,o.jsxs)(o.Fragment,{children:[_,w&&(0,o.jsx)(`button`,{type:`button`,"data-slot":`clearable-input-clear`,"aria-label":d,className:`inline-flex size-7 items-center justify-center rounded-[var(--radius-sm)] border border-transparent bg-transparent text-muted-foreground/74 transition hover:border-border/60 hover:bg-muted/58 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/30`,onClick:D,onMouseDown:O,onDoubleClick:O,children:(0,o.jsx)(a.XIcon,{className:`size-4`})})]}),...b})});s.displayName=`ClearableInput`,exports.ClearableInput=s;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { InputDecorator } from "
|
|
2
|
+
import { InputDecorator } from "./decorator";
|
|
3
3
|
export type ClearableInputProps = Omit<React.ComponentProps<typeof InputDecorator>, "value" | "onChange"> & {
|
|
4
4
|
value?: string | number | null;
|
|
5
5
|
onChange?: React.ChangeEventHandler<HTMLInputElement>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { stopInteractivePropagation as e } from "
|
|
3
|
-
import { InputDecorator as t } from "./
|
|
4
|
-
import { createInputChangeHandler as n, getInputValue as r } from "./
|
|
2
|
+
import { stopInteractivePropagation as e } from "../../../lib/utils.js";
|
|
3
|
+
import { InputDecorator as t } from "./decorator.js";
|
|
4
|
+
import { createInputChangeHandler as n, getInputValue as r } from "./value.js";
|
|
5
5
|
import * as i from "react";
|
|
6
6
|
import { XIcon as a } from "lucide-react";
|
|
7
7
|
import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
8
|
-
//#region src/components/
|
|
8
|
+
//#region src/components/ui/input/clearable.tsx
|
|
9
9
|
var l = i.forwardRef(({ value: l, onChange: u, onValueChange: d, onClear: f, clearable: p = !0, clearLabel: m = "Clear", clearOnEscape: h = !0, focusAfterClear: g = !0, replaceTrailingWhenClear: _ = !0, leadingIcon: v, trailing: y, trailingAction: b, disabled: x, onKeyDown: S, ...C }, w) => {
|
|
10
10
|
let T = i.useRef(null), E = r(l), D = p && E.length > 0 && !x && !C.readOnly, O = n({
|
|
11
11
|
onChange: u,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../lib/utils.cjs"),n=require("./date.cjs");let r=require("react");r=e.__toESM(r,1);let i=require("react/jsx-runtime");function a({className:e,value:r,onValueChange:a,fromPlaceholder:o=`From`,toPlaceholder:s=`To`,fromInputProps:c,toInputProps:l,separator:u=`—`,inputClassName:d,...f}){let p=e=>{a?.({from:r?.from??``,to:r?.to??``,...e})};return(0,i.jsxs)(`div`,{"data-slot":`date-range-input`,className:t.cn(`flex w-full flex-col gap-2 sm:flex-row sm:items-center`,e),...f,children:[(0,i.jsx)(n.DateInput,{value:r?.from??``,placeholder:o,className:d,onValueChange:e=>p({from:e}),...c}),(0,i.jsx)(`span`,{className:`hidden text-sm text-muted-foreground sm:inline-flex`,children:u}),(0,i.jsx)(n.DateInput,{value:r?.to??``,placeholder:s,className:d,onValueChange:e=>p({to:e}),...l})]})}exports.DateRangeInput=a;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { cn as e } from "
|
|
2
|
-
import { DateInput as t } from "./date
|
|
1
|
+
import { cn as e } from "../../../lib/utils.js";
|
|
2
|
+
import { DateInput as t } from "./date.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
5
|
-
//#region src/components/
|
|
5
|
+
//#region src/components/ui/input/date-range.tsx
|
|
6
6
|
function i({ className: i, value: a, onValueChange: o, fromPlaceholder: s = "From", toPlaceholder: c = "To", fromInputProps: l, toInputProps: u, separator: d = "—", inputClassName: f, ...p }) {
|
|
7
7
|
let m = (e) => {
|
|
8
8
|
o?.({
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("./decorator.cjs"),n=require("./value.cjs");let r=require("react");r=e.__toESM(r,1);let i=require("lucide-react"),a=require("react/jsx-runtime");var o=r.forwardRef(({value:e,onChange:r,onValueChange:o,showIcon:s=!0,icon:c,leading:l,...u},d)=>{let f=n.createInputChangeHandler({onChange:r,onValueChange:o});return(0,a.jsx)(t.InputDecorator,{ref:d,type:`date`,value:n.getInputValue(e),leading:s?c??l??(0,a.jsx)(i.CalendarDaysIcon,{}):l,onChange:f,...u})});o.displayName=`DateInput`,exports.DateInput=o;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { InputDecorator } from "
|
|
2
|
+
import { InputDecorator } from "./decorator";
|
|
3
3
|
export type DateInputProps = Omit<React.ComponentProps<typeof InputDecorator>, "type" | "value" | "onChange"> & {
|
|
4
4
|
value?: string | null;
|
|
5
5
|
onChange?: React.ChangeEventHandler<HTMLInputElement>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { InputDecorator as e } from "./
|
|
2
|
-
import { createInputChangeHandler as t, getInputValue as n } from "./
|
|
1
|
+
import { InputDecorator as e } from "./decorator.js";
|
|
2
|
+
import { createInputChangeHandler as t, getInputValue as n } from "./value.js";
|
|
3
3
|
import * as r from "react";
|
|
4
4
|
import { CalendarDaysIcon as i } from "lucide-react";
|
|
5
5
|
import { jsx as a } from "react/jsx-runtime";
|
|
6
|
-
//#region src/components/
|
|
6
|
+
//#region src/components/ui/input/date.tsx
|
|
7
7
|
var o = r.forwardRef(({ value: r, onChange: o, onValueChange: s, showIcon: c = !0, icon: l, leading: u, ...d }, f) => {
|
|
8
8
|
let p = t({
|
|
9
9
|
onChange: o,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../lib/utils.cjs"),n=require("./primitive.cjs");let r=require("react");r=e.__toESM(r,1);let i=require("class-variance-authority"),a=require("react/jsx-runtime");var o=(0,i.cva)(`relative flex w-full items-center`,{variants:{density:{compact:`text-xs`,default:`text-sm`,comfortable:`text-base`},tone:{neutral:``,info:`[&_[data-slot=input]]:border-blue-500/30 [&_[data-slot=input]]:focus-visible:ring-blue-500/20`,success:`[&_[data-slot=input]]:border-emerald-500/30 [&_[data-slot=input]]:focus-visible:ring-emerald-500/20`,warning:`[&_[data-slot=input]]:border-amber-500/35 [&_[data-slot=input]]:focus-visible:ring-amber-500/20`,danger:`[&_[data-slot=input]]:border-destructive/40 [&_[data-slot=input]]:focus-visible:ring-destructive/20`}},defaultVariants:{density:`default`,tone:`neutral`}}),s=r.forwardRef(({className:e,value:r,leading:i,trailing:s,trailingAction:c,leadingPointerEvents:l=!1,trailingPointerEvents:u=!0,trailingActionPointerEvents:d=!0,wrapperClassName:f,inputClassName:p,leadingClassName:m,trailingClassName:h,trailingActionClassName:g,density:_,tone:v,...y},b)=>{let x=!!i,S=!!s,C=!!c,w=r==null?r===null?``:void 0:Array.isArray(r)?r:String(r);return(0,a.jsxs)(`div`,{"data-slot":`input-decorator`,"data-has-leading":x||void 0,"data-has-trailing":S||void 0,className:t.cn(o({density:_,tone:v}),f),children:[x&&(0,a.jsx)(`span`,{"data-slot":`input-leading`,className:t.cn(`absolute left-4 z-10 flex items-center text-muted-foreground/74 [&_svg]:size-4`,!l&&`pointer-events-none`,m),children:i}),(0,a.jsx)(n.InputPrimitive,{ref:b,value:w,className:t.cn(x&&`pl-11`,S&&C?`pr-28`:S||C?`pr-12`:void 0,p,e),...y}),S&&(0,a.jsx)(`span`,{"data-slot":`input-trailing`,className:t.cn(`absolute right-12 z-10 flex items-center gap-1.5 text-muted-foreground/74`,!u&&`pointer-events-none`,h),children:s}),C&&(0,a.jsx)(`span`,{"data-slot":`input-trailing-action`,className:t.cn(`absolute right-3 z-10 flex items-center gap-1.5 text-muted-foreground/74`,!d&&`pointer-events-none`,g),children:c})]})});s.displayName=`InputDecorator`,exports.InputDecorator=s,exports.inputDecoratorVariants=o;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { cn as e } from "
|
|
2
|
-
import { InputPrimitive as t } from "
|
|
1
|
+
import { cn as e } from "../../../lib/utils.js";
|
|
2
|
+
import { InputPrimitive as t } from "./primitive.js";
|
|
3
3
|
import * as n from "react";
|
|
4
4
|
import { cva as r } from "class-variance-authority";
|
|
5
5
|
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
|
-
//#region src/components/
|
|
6
|
+
//#region src/components/ui/input/decorator.tsx
|
|
7
7
|
var o = r("relative flex w-full items-center", {
|
|
8
8
|
variants: {
|
|
9
9
|
density: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../lib/utils.cjs"),n=require("./primitive.cjs"),r=require("./group.cjs"),i=require("
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../lib/utils.cjs"),n=require("./primitive.cjs"),r=require("./group.cjs"),i=require("./decorator.cjs"),a=require("./clearable.cjs"),o=require("./date.cjs"),s=require("./date-range.cjs"),c=require("./masked.cjs"),l=require("./money.cjs"),u=require("./number.cjs"),d=require("./password.cjs"),f=require("./phone.cjs"),p=require("./quantity.cjs"),m=require("./search.cjs");let h=require("react");h=e.__toESM(h,1);let g=require("react/jsx-runtime");function _(e){return typeof e==`string`?e.length:typeof e==`number`?String(e).length:Array.isArray(e)?e.join(``).length:0}function v(e){return e.type===`search`||e.searchIcon!==void 0||e.loading!==void 0||e.loadingLabel!==void 0||e.resultCount!==void 0||e.shortcut!==void 0||e.debounceMs!==void 0||e.showMetaOnClear!==void 0||e.onDebouncedValueChange!==void 0}var y=h.forwardRef((e,r)=>{let y=e.kind??`text`;if(y===`search`)return(0,g.jsx)(m.SearchInput,{ref:r,...e});if(y===`password`)return(0,g.jsx)(d.PasswordInput,{ref:r,...e});if(y===`number`)return(0,g.jsx)(u.NumberInput,{ref:r,...e});if(y===`phone`)return(0,g.jsx)(f.PhoneInput,{ref:r,...e});if(y===`money`)return(0,g.jsx)(l.MoneyInput,{ref:r,...e});if(y===`quantity`)return(0,g.jsx)(p.QuantityInput,{ref:r,...e});if(y===`masked`)return(0,g.jsx)(c.MaskedInput,{ref:r,...e});if(y===`date`)return(0,g.jsx)(o.DateInput,{ref:r,...e});if(y===`date-range`)return(0,g.jsx)(s.DateRangeInput,{...e});if(y===`clearable`)return(0,g.jsx)(a.ClearableInput,{ref:r,...e});let b=e;if(v(b)){let{leading:e,searchIcon:n,helperText:i,errorText:a,showCharacterCount:o,countFormatter:s,helperClassName:c,inputClassName:l,...u}=b,d=Array.isArray(b.value)?b.value.join(` `):b.value==null||typeof b.value==`string`||typeof b.value==`number`?b.value:String(b.value),f=Array.isArray(b.defaultValue)?b.defaultValue.join(` `):b.defaultValue==null||typeof b.defaultValue==`string`||typeof b.defaultValue==`number`?b.defaultValue:String(b.defaultValue),p=(0,g.jsx)(m.SearchInput,{ref:r,searchIcon:n??e,inputClassName:l,...u,value:d,defaultValue:f});if(!i&&!a&&!o)return p;let h=_(b.value??b.defaultValue);return(0,g.jsxs)(`div`,{"data-slot":`input-field`,className:`grid gap-1.5`,children:[p,(0,g.jsxs)(`div`,{"data-slot":`input-meta`,className:`flex items-start justify-between gap-3 px-1`,children:[(0,g.jsx)(`div`,{"data-slot":`input-helper`,className:t.cn(`min-w-0 text-xs leading-5`,a?`text-destructive`:`text-muted-foreground`,c),children:a??i}),o?(0,g.jsx)(`div`,{"data-slot":`input-count`,className:t.cn(`shrink-0 text-[11px] font-medium tabular-nums`,a?`text-destructive`:`text-muted-foreground`),children:s?.(h,b.maxLength)??(typeof b.maxLength==`number`?`${h}/${b.maxLength}`:h)}):null]})]})}let{value:x,defaultValue:S,leading:C,trailing:w,trailingAction:T,clearable:E=!1,onValueChange:D,onClear:O,clearLabel:k,clearOnEscape:A,focusAfterClear:j,replaceTrailingWhenClear:M,helperText:N,errorText:P,showCharacterCount:F=!1,countFormatter:I,wrapperClassName:L,inputClassName:R,helperClassName:z,leadingPointerEvents:ee=!1,trailingPointerEvents:B=!0,onChange:V,maxLength:H,className:U,...W}=b,G=x!==void 0,[K,q]=h.useState(()=>_(S)),J=G?_(x):K,Y=P??N,X=P?`text-destructive`:`text-muted-foreground`,Z=e=>{G||q(e.target.value.length),V?.(e)},Q=e=>{Z(e),D?.(e.target.value)},$=E?(0,g.jsx)(a.ClearableInput,{ref:r,value:x,defaultValue:x===void 0?S:void 0,type:W.type??`text`,leadingIcon:C,trailing:w,trailingAction:T,clearable:E,onChange:Z,onValueChange:D,onClear:O,clearLabel:k,clearOnEscape:A,focusAfterClear:j,replaceTrailingWhenClear:M,wrapperClassName:L,inputClassName:R,className:U,maxLength:H,...W}):C||w||T?(0,g.jsx)(i.InputDecorator,{ref:r,value:x??void 0,defaultValue:x===void 0?S:void 0,type:W.type??`text`,leading:C,trailing:w,trailingAction:T,leadingPointerEvents:ee,trailingPointerEvents:B,wrapperClassName:L,inputClassName:R,className:U,onChange:Q,maxLength:H,...W}):(0,g.jsx)(n.InputPrimitive,{ref:r,value:x??void 0,defaultValue:x===void 0?S:void 0,type:W.type??`text`,className:t.cn(R,U),onChange:Q,maxLength:H,...W});return!Y&&!F?$:(0,g.jsxs)(`div`,{"data-slot":`input-field`,className:`grid gap-1.5`,children:[$,(0,g.jsxs)(`div`,{"data-slot":`input-meta`,className:`flex items-start justify-between gap-3 px-1`,children:[(0,g.jsx)(`div`,{"data-slot":`input-helper`,className:t.cn(`min-w-0 text-xs leading-5`,X,z),children:Y}),F?(0,g.jsx)(`div`,{"data-slot":`input-count`,className:t.cn(`shrink-0 text-[11px] font-medium tabular-nums`,P?`text-destructive`:`text-muted-foreground`),children:I?.(J,H)??(typeof H==`number`?`${J}/${H}`:J)}):null]})]})});y.displayName=`Input`,exports.Input=y,exports.InputGroup=r.InputGroup,exports.InputGroupAddon=r.InputGroupAddon,exports.InputGroupButton=r.InputGroupButton,exports.InputGroupInput=r.InputGroupInput,exports.InputGroupText=r.InputGroupText,exports.InputGroupTextarea=r.InputGroupTextarea;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { type InputPrimitiveProps } from "./primitive";
|
|
3
3
|
import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea } from "./group";
|
|
4
|
-
import { type ClearableInputProps } from "
|
|
5
|
-
import { type DateInputProps } from "
|
|
6
|
-
import { type DateRangeInputProps } from "
|
|
7
|
-
import { type
|
|
8
|
-
import { type
|
|
9
|
-
import { type NumberInputProps } from "
|
|
10
|
-
import { type PasswordInputProps } from "
|
|
11
|
-
import { type PhoneInputProps } from "
|
|
12
|
-
import { type QuantityInputProps } from "
|
|
13
|
-
import { type SearchInputProps } from "
|
|
4
|
+
import { type ClearableInputProps } from "./clearable";
|
|
5
|
+
import { type DateInputProps } from "./date";
|
|
6
|
+
import { type DateRangeInputProps } from "./date-range";
|
|
7
|
+
import { type MaskedInputProps } from "./masked";
|
|
8
|
+
import { type MoneyInputProps } from "./money";
|
|
9
|
+
import { type NumberInputProps } from "./number";
|
|
10
|
+
import { type PasswordInputProps } from "./password";
|
|
11
|
+
import { type PhoneInputProps } from "./phone";
|
|
12
|
+
import { type QuantityInputProps } from "./quantity";
|
|
13
|
+
import { type SearchInputProps } from "./search";
|
|
14
14
|
export type InputKind = "text" | "clearable" | "search" | "password" | "number" | "phone" | "money" | "quantity" | "masked" | "date" | "date-range";
|
|
15
15
|
export type InputTextProps = Omit<InputPrimitiveProps, "value"> & {
|
|
16
16
|
kind?: "text";
|
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
import { cn as e } from "../../../lib/utils.js";
|
|
3
3
|
import { InputPrimitive as t } from "./primitive.js";
|
|
4
4
|
import { InputGroup as n, InputGroupAddon as r, InputGroupButton as i, InputGroupInput as a, InputGroupText as o, InputGroupTextarea as s } from "./group.js";
|
|
5
|
-
import { InputDecorator as c } from "
|
|
6
|
-
import { ClearableInput as l } from "
|
|
7
|
-
import { DateInput as u } from "
|
|
8
|
-
import { DateRangeInput as d } from "
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { NumberInput as m } from "
|
|
12
|
-
import { PasswordInput as h } from "
|
|
13
|
-
import { PhoneInput as g } from "
|
|
14
|
-
import { QuantityInput as _ } from "
|
|
15
|
-
import { SearchInput as v } from "
|
|
5
|
+
import { InputDecorator as c } from "./decorator.js";
|
|
6
|
+
import { ClearableInput as l } from "./clearable.js";
|
|
7
|
+
import { DateInput as u } from "./date.js";
|
|
8
|
+
import { DateRangeInput as d } from "./date-range.js";
|
|
9
|
+
import { MaskedInput as f } from "./masked.js";
|
|
10
|
+
import { MoneyInput as p } from "./money.js";
|
|
11
|
+
import { NumberInput as m } from "./number.js";
|
|
12
|
+
import { PasswordInput as h } from "./password.js";
|
|
13
|
+
import { PhoneInput as g } from "./phone.js";
|
|
14
|
+
import { QuantityInput as _ } from "./quantity.js";
|
|
15
|
+
import { SearchInput as v } from "./search.js";
|
|
16
16
|
import * as y from "react";
|
|
17
17
|
import { jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
18
18
|
//#region src/components/ui/input/index.tsx
|
|
@@ -40,7 +40,7 @@ var w = y.forwardRef((n, r) => {
|
|
|
40
40
|
ref: r,
|
|
41
41
|
...n
|
|
42
42
|
});
|
|
43
|
-
if (i === "money") return /* @__PURE__ */ b(
|
|
43
|
+
if (i === "money") return /* @__PURE__ */ b(p, {
|
|
44
44
|
ref: r,
|
|
45
45
|
...n
|
|
46
46
|
});
|
|
@@ -48,7 +48,7 @@ var w = y.forwardRef((n, r) => {
|
|
|
48
48
|
ref: r,
|
|
49
49
|
...n
|
|
50
50
|
});
|
|
51
|
-
if (i === "masked") return /* @__PURE__ */ b(
|
|
51
|
+
if (i === "masked") return /* @__PURE__ */ b(f, {
|
|
52
52
|
ref: r,
|
|
53
53
|
...n
|
|
54
54
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("./decorator.cjs"),n=require("./value.cjs");let r=require("react");r=e.__toESM(r,1);let i=require("react/jsx-runtime");function a(e){return e}function o(e){return e}var s=r.forwardRef(({value:e,onChange:r,onValueChange:s,mask:c=a,unmask:l=o,...u},d)=>(0,i.jsx)(t.InputDecorator,{ref:d,value:n.getInputValue(e),onChange:e=>{let t=l(e.target.value),i=c(t);n.setInputElementValue(e,i),r?.(e),s?.(i,t)},...u}));s.displayName=`MaskedInput`,exports.MaskedInput=s;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { InputDecorator } from "
|
|
2
|
+
import { InputDecorator } from "./decorator";
|
|
3
3
|
export type MaskedInputProps = Omit<React.ComponentProps<typeof InputDecorator>, "value" | "onChange"> & {
|
|
4
4
|
value?: string;
|
|
5
5
|
onChange?: React.ChangeEventHandler<HTMLInputElement>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { InputDecorator as e } from "./
|
|
2
|
-
import { getInputValue as t, setInputElementValue as n } from "./
|
|
1
|
+
import { InputDecorator as e } from "./decorator.js";
|
|
2
|
+
import { getInputValue as t, setInputElementValue as n } from "./value.js";
|
|
3
3
|
import * as r from "react";
|
|
4
4
|
import { jsx as i } from "react/jsx-runtime";
|
|
5
|
-
//#region src/components/
|
|
5
|
+
//#region src/components/ui/input/masked.tsx
|
|
6
6
|
function a(e) {
|
|
7
7
|
return e;
|
|
8
8
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../lib/utils.cjs"),n=require("./primitive.cjs"),r=require("./value.cjs"),i=require("./chrome.cjs"),a=require("./numeric-value.cjs");let o=require("react");o=e.__toESM(o,1);let s=require("react/jsx-runtime");function c(e){return a.parseMoneyLikeInput(e)}function l({value:e,onChange:a,onValueChange:o,prefix:l,suffix:u,wrapperClassName:d,inputClassName:f,className:p,inputMode:m=`decimal`,...h}){return(0,s.jsx)(i.InputChrome,{"data-slot":`money-input`,className:t.cn(`text-sm`,d),start:l?(0,s.jsx)(`span`,{className:`pl-2.5 text-xs font-medium text-muted-foreground`,children:l}):null,end:u?(0,s.jsx)(`span`,{className:`pr-2.5 text-xs font-medium text-muted-foreground`,children:u}):null,children:(0,s.jsx)(n.InputPrimitive,{value:r.getInputValue(e),onChange:e=>{a?.(e),o?.(c(e.target.value),e.target.value)},inputMode:m,className:t.cn(`h-full border-0 bg-transparent px-2.5 shadow-none focus-visible:border-0 focus-visible:ring-0`,f,p),...h})})}exports.MoneyInput=l,exports.parseMoneyInput=c;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { cn as e } from "
|
|
2
|
-
import { InputPrimitive as t } from "
|
|
3
|
-
import { getInputValue as n } from "./
|
|
4
|
-
import { InputChrome as r } from "./
|
|
1
|
+
import { cn as e } from "../../../lib/utils.js";
|
|
2
|
+
import { InputPrimitive as t } from "./primitive.js";
|
|
3
|
+
import { getInputValue as n } from "./value.js";
|
|
4
|
+
import { InputChrome as r } from "./chrome.js";
|
|
5
5
|
import { parseMoneyLikeInput as i } from "./numeric-value.js";
|
|
6
6
|
import "react";
|
|
7
7
|
import { jsx as a } from "react/jsx-runtime";
|
|
8
|
-
//#region src/components/
|
|
8
|
+
//#region src/components/ui/input/money.tsx
|
|
9
9
|
function o(e) {
|
|
10
10
|
return i(e);
|
|
11
11
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("./decorator.cjs"),n=require("./value.cjs"),r=require("./numeric-value.cjs");let i=require("react");i=e.__toESM(i,1);let a=require("react/jsx-runtime");function o(e){return r.parseDecimalInput(e)}function s(e,t,n){return r.clampNumericValue(e,t,n)}var c=i.forwardRef(({value:e,onChange:r,onValueChange:i,onNumberChange:c,min:l,max:u,step:d,allowEmpty:f=!0,prefix:p,suffix:m,leading:h,trailing:g,inputMode:_=`decimal`,onBlur:v,...y},b)=>{let x=n.getInputValue(e),S=e=>{let t=o(e),n=t==null?null:s(t,l,u);i?.(e),c?.(n)};return(0,a.jsx)(t.InputDecorator,{ref:b,type:`text`,value:x,inputMode:_,min:l,max:u,step:d,leading:p??h,trailing:m??g,onChange:e=>{r?.(e),S(e.target.value)},onBlur:e=>{if(!f&&!e.target.value.trim()){let t=String(l??0);e.currentTarget.value=t,S(t)}v?.(e)},...y})});c.displayName=`NumberInput`,exports.NumberInput=c,exports.clampNumber=s,exports.parseNumberInput=o;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { InputDecorator } from "
|
|
2
|
+
import { InputDecorator } from "./decorator";
|
|
3
3
|
export type NumberInputProps = Omit<React.ComponentProps<typeof InputDecorator>, "type" | "value" | "onChange" | "min" | "max" | "step"> & {
|
|
4
4
|
value?: number | string | null;
|
|
5
5
|
onChange?: React.ChangeEventHandler<HTMLInputElement>;
|