extended-dynamic-forms 0.1.5 → 0.1.7
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/extended-dynamic-forms-vanilla.js +38 -0
- package/package.json +32 -25
- package/dist/ExtendedForm.d.ts +0 -4
- package/dist/components/fields/AddressField.d.ts +0 -4
- package/dist/components/fields/CurrencyField.d.ts +0 -4
- package/dist/components/fields/PhoneField.d.ts +0 -4
- package/dist/components/index.d.ts +0 -10
- package/dist/components/ui/badge.d.ts +0 -9
- package/dist/components/ui/button.d.ts +0 -11
- package/dist/components/ui/card.d.ts +0 -8
- package/dist/components/ui/input.d.ts +0 -5
- package/dist/components/ui/label.d.ts +0 -5
- package/dist/components/ui/slider.d.ts +0 -4
- package/dist/events/FormEventContext.d.ts +0 -20
- package/dist/events/FormEventHub.d.ts +0 -27
- package/dist/events/FormEventManager.d.ts +0 -10
- package/dist/events/index.d.ts +0 -4
- package/dist/index.d.ts +0 -13
- package/dist/index.es.js +0 -4124
- package/dist/index.umd.js +0 -21
- package/dist/layouts/grid/GridLayout.d.ts +0 -11
- package/dist/layouts/horizontal/HorizontalLayout.d.ts +0 -10
- package/dist/layouts/index.d.ts +0 -3
- package/dist/layouts/vertical/VerticalLayout.d.ts +0 -9
- package/dist/lib/utils.d.ts +0 -3
- package/dist/style.css +0 -1
- package/dist/types/index.d.ts +0 -47
- package/dist/utils/formDataUtils.d.ts +0 -22
- package/dist/utils/index.d.ts +0 -3
- package/dist/utils/schemaUtils.d.ts +0 -24
- package/dist/utils/validationUtils.d.ts +0 -26
- package/dist/widgets/date/DateWidget.d.ts +0 -4
- package/dist/widgets/file/FileWidget.d.ts +0 -4
- package/dist/widgets/index.d.ts +0 -14
- package/dist/widgets/input/ColorWidget.d.ts +0 -4
- package/dist/widgets/input/RangeWidget.d.ts +0 -4
- package/dist/widgets/input/RatingWidget.d.ts +0 -4
package/dist/index.umd.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
(function(C,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("react/jsx-runtime"),require("react"),require("react-dom"),require("@rjsf/validator-ajv8"),require("@rjsf/shadcn")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom","@rjsf/validator-ajv8","@rjsf/shadcn"],l):(C=typeof globalThis<"u"?globalThis:C||self,l(C.ExtendedDynamicForms={},C.React.jsxRuntime,C.React,C.ReactDOM,C.RJSFValidatorAjv8,C.RJSFShadcn))})(this,function(C,l,E,ro,be,me){"use strict";var eo=Object.defineProperty;var to=(C,l,E)=>l in C?eo(C,l,{enumerable:!0,configurable:!0,writable:!0,value:E}):C[l]=E;var q=(C,l,E)=>to(C,typeof l!="symbol"?l+"":l,E);function Ct(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,o.get?o:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const m=Ct(E);function ye(e){var t,r,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var n=e.length;for(t=0;t<n;t++)e[t]&&(r=ye(e[t]))&&(o&&(o+=" "),o+=r)}else for(r in e)e[r]&&(o&&(o+=" "),o+=r);return o}function ve(){for(var e,t,r=0,o="",n=arguments.length;r<n;r++)(e=arguments[r])&&(t=ye(e))&&(o&&(o+=" "),o+=t);return o}const le="-",St=e=>{const t=kt(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:a=>{const i=a.split(le);return i[0]===""&&i.length!==1&&i.shift(),we(i,t)||Nt(a)},getConflictingClassGroupIds:(a,i)=>{const c=r[a]||[];return i&&o[a]?[...c,...o[a]]:c}}},we=(e,t)=>{var a;if(e.length===0)return t.classGroupId;const r=e[0],o=t.nextPart.get(r),n=o?we(e.slice(1),o):void 0;if(n)return n;if(t.validators.length===0)return;const s=e.join(le);return(a=t.validators.find(({validator:i})=>i(s)))==null?void 0:a.classGroupId},xe=/^\[(.+)\]$/,Nt=e=>{if(xe.test(e)){const t=xe.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},kt=e=>{const{theme:t,prefix:r}=e,o={nextPart:new Map,validators:[]};return Et(Object.entries(e.classGroups),r).forEach(([s,a])=>{ce(a,o,s,t)}),o},ce=(e,t,r,o)=>{e.forEach(n=>{if(typeof n=="string"){const s=n===""?t:Ce(t,n);s.classGroupId=r;return}if(typeof n=="function"){if(Pt(n)){ce(n(o),t,r,o);return}t.validators.push({validator:n,classGroupId:r});return}Object.entries(n).forEach(([s,a])=>{ce(a,Ce(t,s),r,o)})})},Ce=(e,t)=>{let r=e;return t.split(le).forEach(o=>{r.nextPart.has(o)||r.nextPart.set(o,{nextPart:new Map,validators:[]}),r=r.nextPart.get(o)}),r},Pt=e=>e.isThemeGetter,Et=(e,t)=>t?e.map(([r,o])=>{const n=o.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([a,i])=>[t+a,i])):s);return[r,n]}):e,Mt=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,o=new Map;const n=(s,a)=>{r.set(s,a),t++,t>e&&(t=0,o=r,r=new Map)};return{get(s){let a=r.get(s);if(a!==void 0)return a;if((a=o.get(s))!==void 0)return n(s,a),a},set(s,a){r.has(s)?r.set(s,a):n(s,a)}}},Se="!",At=e=>{const{separator:t,experimentalParseClassName:r}=e,o=t.length===1,n=t[0],s=t.length,a=i=>{const c=[];let u=0,f=0,d;for(let p=0;p<i.length;p++){let b=i[p];if(u===0){if(b===n&&(o||i.slice(p,p+s)===t)){c.push(i.slice(f,p)),f=p+s;continue}if(b==="/"){d=p;continue}}b==="["?u++:b==="]"&&u--}const h=c.length===0?i:i.substring(f),y=h.startsWith(Se),v=y?h.substring(1):h,g=d&&d>f?d-f:void 0;return{modifiers:c,hasImportantModifier:y,baseClassName:v,maybePostfixModifierPosition:g}};return r?i=>r({className:i,parseClassName:a}):a},Ft=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(o=>{o[0]==="["?(t.push(...r.sort(),o),r=[]):r.push(o)}),t.push(...r.sort()),t},$t=e=>({cache:Mt(e.cacheSize),parseClassName:At(e),...St(e)}),zt=/\s+/,Vt=(e,t)=>{const{parseClassName:r,getClassGroupId:o,getConflictingClassGroupIds:n}=t,s=[],a=e.trim().split(zt);let i="";for(let c=a.length-1;c>=0;c-=1){const u=a[c],{modifiers:f,hasImportantModifier:d,baseClassName:h,maybePostfixModifierPosition:y}=r(u);let v=!!y,g=o(v?h.substring(0,y):h);if(!g){if(!v){i=u+(i.length>0?" "+i:i);continue}if(g=o(h),!g){i=u+(i.length>0?" "+i:i);continue}v=!1}const p=Ft(f).join(":"),b=d?p+Se:p,w=b+g;if(s.includes(w))continue;s.push(w);const N=n(g,v);for(let x=0;x<N.length;++x){const F=N[x];s.push(b+F)}i=u+(i.length>0?" "+i:i)}return i};function Tt(){let e=0,t,r,o="";for(;e<arguments.length;)(t=arguments[e++])&&(r=Ne(t))&&(o&&(o+=" "),o+=r);return o}const Ne=e=>{if(typeof e=="string")return e;let t,r="";for(let o=0;o<e.length;o++)e[o]&&(t=Ne(e[o]))&&(r&&(r+=" "),r+=t);return r};function _t(e,...t){let r,o,n,s=a;function a(c){const u=t.reduce((f,d)=>d(f),e());return r=$t(u),o=r.cache.get,n=r.cache.set,s=i,i(c)}function i(c){const u=o(c);if(u)return u;const f=Vt(c,r);return n(c,f),f}return function(){return s(Tt.apply(null,arguments))}}const P=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},ke=/^\[(?:([a-z-]+):)?(.+)\]$/i,It=/^\d+\/\d+$/,jt=new Set(["px","full","screen"]),Ot=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ht=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Lt=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Bt=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Wt=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,O=e=>Y(e)||jt.has(e)||It.test(e),W=e=>J(e,"length",Yt),Y=e=>!!e&&!Number.isNaN(Number(e)),de=e=>J(e,"number",Y),oe=e=>!!e&&Number.isInteger(Number(e)),Dt=e=>e.endsWith("%")&&Y(e.slice(0,-1)),S=e=>ke.test(e),D=e=>Ot.test(e),Gt=new Set(["length","size","percentage"]),Ut=e=>J(e,Gt,Pe),Kt=e=>J(e,"position",Pe),qt=new Set(["image","url"]),Qt=e=>J(e,qt,Xt),Rt=e=>J(e,"",Jt),ne=()=>!0,J=(e,t,r)=>{const o=ke.exec(e);return o?o[1]?typeof t=="string"?o[1]===t:t.has(o[1]):r(o[2]):!1},Yt=e=>Ht.test(e)&&!Lt.test(e),Pe=()=>!1,Jt=e=>Bt.test(e),Xt=e=>Wt.test(e),Zt=_t(()=>{const e=P("colors"),t=P("spacing"),r=P("blur"),o=P("brightness"),n=P("borderColor"),s=P("borderRadius"),a=P("borderSpacing"),i=P("borderWidth"),c=P("contrast"),u=P("grayscale"),f=P("hueRotate"),d=P("invert"),h=P("gap"),y=P("gradientColorStops"),v=P("gradientColorStopPositions"),g=P("inset"),p=P("margin"),b=P("opacity"),w=P("padding"),N=P("saturate"),x=P("scale"),F=P("sepia"),V=P("skew"),I=P("space"),te=P("translate"),Q=()=>["auto","contain","none"],$=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto",S,t],k=()=>[S,t],H=()=>["",O,W],R=()=>["auto",Y,S],re=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],j=()=>["solid","dashed","dotted","double","none"],L=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],_=()=>["start","end","center","between","around","evenly","stretch"],K=()=>["","0",S],xt=()=>["auto","avoid","all","avoid-page","page","left","right","column"],B=()=>[Y,S];return{cacheSize:500,separator:":",theme:{colors:[ne],spacing:[O,W],blur:["none","",D,S],brightness:B(),borderColor:[e],borderRadius:["none","","full",D,S],borderSpacing:k(),borderWidth:H(),contrast:B(),grayscale:K(),hueRotate:B(),invert:K(),gap:k(),gradientColorStops:[e],gradientColorStopPositions:[Dt,W],inset:M(),margin:M(),opacity:B(),padding:k(),saturate:B(),scale:B(),sepia:K(),skew:B(),space:k(),translate:k()},classGroups:{aspect:[{aspect:["auto","square","video",S]}],container:["container"],columns:[{columns:[D]}],"break-after":[{"break-after":xt()}],"break-before":[{"break-before":xt()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...re(),S]}],overflow:[{overflow:$()}],"overflow-x":[{"overflow-x":$()}],"overflow-y":[{"overflow-y":$()}],overscroll:[{overscroll:Q()}],"overscroll-x":[{"overscroll-x":Q()}],"overscroll-y":[{"overscroll-y":Q()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",oe,S]}],basis:[{basis:M()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",S]}],grow:[{grow:K()}],shrink:[{shrink:K()}],order:[{order:["first","last","none",oe,S]}],"grid-cols":[{"grid-cols":[ne]}],"col-start-end":[{col:["auto",{span:["full",oe,S]},S]}],"col-start":[{"col-start":R()}],"col-end":[{"col-end":R()}],"grid-rows":[{"grid-rows":[ne]}],"row-start-end":[{row:["auto",{span:[oe,S]},S]}],"row-start":[{"row-start":R()}],"row-end":[{"row-end":R()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",S]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",S]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",..._()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",..._(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[..._(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[w]}],px:[{px:[w]}],py:[{py:[w]}],ps:[{ps:[w]}],pe:[{pe:[w]}],pt:[{pt:[w]}],pr:[{pr:[w]}],pb:[{pb:[w]}],pl:[{pl:[w]}],m:[{m:[p]}],mx:[{mx:[p]}],my:[{my:[p]}],ms:[{ms:[p]}],me:[{me:[p]}],mt:[{mt:[p]}],mr:[{mr:[p]}],mb:[{mb:[p]}],ml:[{ml:[p]}],"space-x":[{"space-x":[I]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[I]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",S,t]}],"min-w":[{"min-w":[S,t,"min","max","fit"]}],"max-w":[{"max-w":[S,t,"none","full","min","max","fit","prose",{screen:[D]},D]}],h:[{h:[S,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[S,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[S,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[S,t,"auto","min","max","fit"]}],"font-size":[{text:["base",D,W]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",de]}],"font-family":[{font:[ne]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",S]}],"line-clamp":[{"line-clamp":["none",Y,de]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",O,S]}],"list-image":[{"list-image":["none",S]}],"list-style-type":[{list:["none","disc","decimal",S]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...j(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",O,W]}],"underline-offset":[{"underline-offset":["auto",O,S]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:k()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",S]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",S]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...re(),Kt]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Ut]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Qt]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[y]}],"gradient-via":[{via:[y]}],"gradient-to":[{to:[y]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[i]}],"border-w-x":[{"border-x":[i]}],"border-w-y":[{"border-y":[i]}],"border-w-s":[{"border-s":[i]}],"border-w-e":[{"border-e":[i]}],"border-w-t":[{"border-t":[i]}],"border-w-r":[{"border-r":[i]}],"border-w-b":[{"border-b":[i]}],"border-w-l":[{"border-l":[i]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:[...j(),"hidden"]}],"divide-x":[{"divide-x":[i]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[i]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[b]}],"divide-style":[{divide:j()}],"border-color":[{border:[n]}],"border-color-x":[{"border-x":[n]}],"border-color-y":[{"border-y":[n]}],"border-color-s":[{"border-s":[n]}],"border-color-e":[{"border-e":[n]}],"border-color-t":[{"border-t":[n]}],"border-color-r":[{"border-r":[n]}],"border-color-b":[{"border-b":[n]}],"border-color-l":[{"border-l":[n]}],"divide-color":[{divide:[n]}],"outline-style":[{outline:["",...j()]}],"outline-offset":[{"outline-offset":[O,S]}],"outline-w":[{outline:[O,W]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:H()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[O,W]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",D,Rt]}],"shadow-color":[{shadow:[ne]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...L(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":L()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[o]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",D,S]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[f]}],invert:[{invert:[d]}],saturate:[{saturate:[N]}],sepia:[{sepia:[F]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[f]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[N]}],"backdrop-sepia":[{"backdrop-sepia":[F]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",S]}],duration:[{duration:B()}],ease:[{ease:["linear","in","out","in-out",S]}],delay:[{delay:B()}],animate:[{animate:["none","spin","ping","pulse","bounce",S]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[x]}],"scale-x":[{"scale-x":[x]}],"scale-y":[{"scale-y":[x]}],rotate:[{rotate:[oe,S]}],"translate-x":[{"translate-x":[te]}],"translate-y":[{"translate-y":[te]}],"skew-x":[{"skew-x":[V]}],"skew-y":[{"skew-y":[V]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",S]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",S]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":k()}],"scroll-mx":[{"scroll-mx":k()}],"scroll-my":[{"scroll-my":k()}],"scroll-ms":[{"scroll-ms":k()}],"scroll-me":[{"scroll-me":k()}],"scroll-mt":[{"scroll-mt":k()}],"scroll-mr":[{"scroll-mr":k()}],"scroll-mb":[{"scroll-mb":k()}],"scroll-ml":[{"scroll-ml":k()}],"scroll-p":[{"scroll-p":k()}],"scroll-px":[{"scroll-px":k()}],"scroll-py":[{"scroll-py":k()}],"scroll-ps":[{"scroll-ps":k()}],"scroll-pe":[{"scroll-pe":k()}],"scroll-pt":[{"scroll-pt":k()}],"scroll-pr":[{"scroll-pr":k()}],"scroll-pb":[{"scroll-pb":k()}],"scroll-pl":[{"scroll-pl":k()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",S]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[O,W,de]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}});function A(...e){return Zt(ve(e))}const T=m.forwardRef(({className:e,type:t,...r},o)=>l.jsx("input",{type:t,className:A("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...r}));T.displayName="Input";function Ee(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Me(...e){return t=>{let r=!1;const o=e.map(n=>{const s=Ee(n,t);return!r&&typeof s=="function"&&(r=!0),s});if(r)return()=>{for(let n=0;n<o.length;n++){const s=o[n];typeof s=="function"?s():Ee(e[n],null)}}}}function G(...e){return m.useCallback(Me(...e),e)}function se(e){const t=tr(e),r=m.forwardRef((o,n)=>{const{children:s,...a}=o,i=m.Children.toArray(s),c=i.find(or);if(c){const u=c.props.children,f=i.map(d=>d===c?m.Children.count(u)>1?m.Children.only(null):m.isValidElement(u)?u.props.children:null:d);return l.jsx(t,{...a,ref:n,children:m.isValidElement(u)?m.cloneElement(u,void 0,f):null})}return l.jsx(t,{...a,ref:n,children:s})});return r.displayName=`${e}.Slot`,r}var er=se("Slot");function tr(e){const t=m.forwardRef((r,o)=>{const{children:n,...s}=r;if(m.isValidElement(n)){const a=sr(n),i=nr(s,n.props);return n.type!==m.Fragment&&(i.ref=o?Me(o,a):a),m.cloneElement(n,i)}return m.Children.count(n)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var rr=Symbol("radix.slottable");function or(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===rr}function nr(e,t){const r={...t};for(const o in t){const n=e[o],s=t[o];/^on[A-Z]/.test(o)?n&&s?r[o]=(...i)=>{const c=s(...i);return n(...i),c}:n&&(r[o]=n):o==="style"?r[o]={...n,...s}:o==="className"&&(r[o]=[n,s].filter(Boolean).join(" "))}return{...e,...r}}function sr(e){var o,n;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(n=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var ir=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],X=ir.reduce((e,t)=>{const r=se(`Primitive.${t}`),o=m.forwardRef((n,s)=>{const{asChild:a,...i}=n,c=a?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...i,ref:s})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{}),ar="Label",Ae=m.forwardRef((e,t)=>l.jsx(X.label,{...e,ref:t,onMouseDown:r=>{var n;r.target.closest("button, input, select, textarea")||((n=e.onMouseDown)==null||n.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));Ae.displayName=ar;var Fe=Ae;const $e=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,ze=ve,ue=(e,t)=>r=>{var o;if((t==null?void 0:t.variants)==null)return ze(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:n,defaultVariants:s}=t,a=Object.keys(n).map(u=>{const f=r==null?void 0:r[u],d=s==null?void 0:s[u];if(f===null)return null;const h=$e(f)||$e(d);return n[u][h]}),i=r&&Object.entries(r).reduce((u,f)=>{let[d,h]=f;return h===void 0||(u[d]=h),u},{}),c=t==null||(o=t.compoundVariants)===null||o===void 0?void 0:o.reduce((u,f)=>{let{class:d,className:h,...y}=f;return Object.entries(y).every(v=>{let[g,p]=v;return Array.isArray(p)?p.includes({...s,...i}[g]):{...s,...i}[g]===p})?[...u,d,h]:u},[]);return ze(e,a,c,r==null?void 0:r.class,r==null?void 0:r.className)},lr=ue("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),z=m.forwardRef(({className:e,...t},r)=>l.jsx(Fe,{ref:r,className:A(lr(),e),...t}));z.displayName=Fe.displayName;const Ve=m.forwardRef(({className:e,...t},r)=>l.jsx("div",{ref:r,className:A("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Ve.displayName="Card";const Te=m.forwardRef(({className:e,...t},r)=>l.jsx("div",{ref:r,className:A("flex flex-col space-y-1.5 p-6",e),...t}));Te.displayName="CardHeader";const _e=m.forwardRef(({className:e,...t},r)=>l.jsx("h3",{ref:r,className:A("text-2xl font-semibold leading-none tracking-tight",e),...t}));_e.displayName="CardTitle";const cr=m.forwardRef(({className:e,...t},r)=>l.jsx("p",{ref:r,className:A("text-sm text-muted-foreground",e),...t}));cr.displayName="CardDescription";const Ie=m.forwardRef(({className:e,...t},r)=>l.jsx("div",{ref:r,className:A("p-6 pt-0",e),...t}));Ie.displayName="CardContent";const dr=m.forwardRef(({className:e,...t},r)=>l.jsx("div",{ref:r,className:A("flex items-center p-6 pt-0",e),...t}));dr.displayName="CardFooter";const je=({formData:e,onChange:t,required:r,disabled:o,readonly:n,schema:s,idSchema:a})=>{const i=c=>u=>{t({...e,[c]:u.target.value})};return l.jsxs(Ve,{children:[l.jsx(Te,{className:"pb-4",children:l.jsx(_e,{className:"text-lg",children:s.title||"Address"})}),l.jsxs(Ie,{className:"space-y-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsxs(z,{htmlFor:`${a.$id}_street`,children:["Street Address",r&&l.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),l.jsx(T,{id:`${a.$id}_street`,type:"text",value:(e==null?void 0:e.street)||"",onChange:i("street"),disabled:o||n,placeholder:"123 Main St"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs(z,{htmlFor:`${a.$id}_city`,children:["City",r&&l.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),l.jsx(T,{id:`${a.$id}_city`,type:"text",value:(e==null?void 0:e.city)||"",onChange:i("city"),disabled:o||n,placeholder:"New York"})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsxs(z,{htmlFor:`${a.$id}_state`,children:["State/Province",r&&l.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),l.jsx(T,{id:`${a.$id}_state`,type:"text",value:(e==null?void 0:e.state)||"",onChange:i("state"),disabled:o||n,placeholder:"NY"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs(z,{htmlFor:`${a.$id}_zip`,children:["ZIP/Postal Code",r&&l.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),l.jsx(T,{id:`${a.$id}_zip`,type:"text",value:(e==null?void 0:e.zip)||"",onChange:i("zip"),disabled:o||n,placeholder:"10001"})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(z,{htmlFor:`${a.$id}_country`,children:"Country"}),l.jsx(T,{id:`${a.$id}_country`,type:"text",value:(e==null?void 0:e.country)||"",onChange:i("country"),disabled:o||n,placeholder:"United States"})]})]})]})},Oe=E.createContext(null),He=({eventHub:e,formData:t,children:r})=>l.jsx(Oe.Provider,{value:{eventHub:e,formData:t},children:r}),Le=()=>{const e=E.useContext(Oe);if(!e)throw new Error("useFormEventHub must be used within a FormEventProvider");return e},U=(e,t,r)=>{const{eventHub:o,formData:n}=Le();return E.useMemo(()=>o.createFieldEventHandlers(e,t,n,r),[o,e,t,n,r])},Be=({formData:e,onChange:t,required:r,disabled:o,readonly:n,schema:s,idSchema:a})=>{const i=U(a.$id,s),c=f=>{const d=f.replace(/\D/g,""),h=d.length;return h<4?d:h<7?`(${d.slice(0,3)}) ${d.slice(3)}`:`(${d.slice(0,3)}) ${d.slice(3,6)}-${d.slice(6,10)}`},u=async f=>{const d=c(f.target.value);t(d),await i.onChange(d)};return l.jsxs("div",{className:"space-y-2",children:[l.jsxs(z,{htmlFor:a.$id,children:[s.title||"Phone Number",r&&l.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),l.jsx(T,{id:a.$id,type:"tel",value:e||"",onChange:u,disabled:o||n,placeholder:"(555) 123-4567",maxLength:14})]})},We=({formData:e,onChange:t,required:r,disabled:o,readonly:n,schema:s,uiSchema:a,idSchema:i})=>{var v,g;const c=((v=a==null?void 0:a["ui:options"])==null?void 0:v.currency)||"USD",u=((g=a==null?void 0:a["ui:options"])==null?void 0:g.symbol)||"$",f=U(i.$id,s),d=p=>{const b=parseFloat(p.replace(/[^0-9.-]+/g,""));return isNaN(b)?"":b.toFixed(2)},h=async p=>{const b=p.target.value.replace(/[^0-9.-]+/g,""),w=b?parseFloat(b):void 0;t(w),await f.onChange(w)},y=async p=>{const b=d(p.target.value),w=b?parseFloat(b):void 0;t(w),await f.onBlur(w)};return l.jsxs("div",{className:"space-y-2",children:[l.jsxs(z,{htmlFor:i.$id,children:[s.title||"Amount",r&&l.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),l.jsxs("div",{className:"relative",children:[l.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground",children:String(u)}),l.jsx(T,{id:i.$id,type:"text",inputMode:"decimal",value:e||"",onChange:h,onBlur:y,disabled:o||n,placeholder:"0.00",className:"pl-8 pr-12"}),l.jsx("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground",children:String(c)})]})]})},De={address:je,phone:Be,currency:We},Ge=({id:e,value:t,required:r,disabled:o,readonly:n,label:s,onChange:a,onBlur:i,onFocus:c,schema:u})=>{const f=U(e,u),d=async v=>{const g=v.target.value;a(g),await f.onChange(g)},h=async v=>{const g=v.target.value;i&&i(e,g),await f.onBlur(g)},y=async v=>{const g=v.target.value;c&&c(e,g),await f.onFocus(g)};return l.jsxs("div",{className:"space-y-2",children:[l.jsxs(z,{htmlFor:e,children:[s||u.title,r&&l.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),l.jsx(T,{id:e,type:"color",value:t||"#000000",required:r,disabled:o||n,onChange:d,onBlur:h,onFocus:y,className:"h-10 w-full cursor-pointer"})]})},Ue=({id:e,value:t,required:r,disabled:o,readonly:n,label:s,onChange:a,onBlur:i,onFocus:c,options:u,schema:f})=>{const d=u.inputType||"date",h=U(e,f),y=async p=>{const b=p.target.value;a(b),await h.onChange(b)},v=async p=>{const b=p.target.value;i&&i(e,b),await h.onBlur(b)},g=async p=>{const b=p.target.value;c&&c(e,b),await h.onFocus(b)};return l.jsxs("div",{className:"space-y-2",children:[l.jsxs(z,{htmlFor:e,children:[s||f.title,r&&l.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),l.jsx(T,{id:e,type:d,value:t||"",required:r,disabled:o||n,onChange:y,onBlur:v,onFocus:g,min:typeof u.minDate=="string"||typeof u.minDate=="number"?u.minDate:void 0,max:typeof u.maxDate=="string"||typeof u.maxDate=="number"?u.maxDate:void 0,className:"w-full"})]})},ur=ue("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),ie=m.forwardRef(({className:e,variant:t,size:r,asChild:o=!1,...n},s)=>{const a=o?er:"button";return l.jsx(a,{className:A(ur({variant:t,size:r,className:e})),ref:s,...n})});ie.displayName="Button";const fr=ue("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Ke({className:e,variant:t,...r}){return l.jsx("div",{className:A(fr({variant:t}),e),...r})}/**
|
|
2
|
-
* @license lucide-react v0.303.0 - ISC
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the ISC license.
|
|
5
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/var pr={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
7
|
-
* @license lucide-react v0.303.0 - ISC
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the ISC license.
|
|
10
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const hr=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),qe=(e,t)=>{const r=E.forwardRef(({color:o="currentColor",size:n=24,strokeWidth:s=2,absoluteStrokeWidth:a,className:i="",children:c,...u},f)=>E.createElement("svg",{ref:f,...pr,width:n,height:n,stroke:o,strokeWidth:a?Number(s)*24/Number(n):s,className:["lucide",`lucide-${hr(e)}`,i].join(" "),...u},[...t.map(([d,h])=>E.createElement(d,h)),...Array.isArray(c)?c:[c]]));return r.displayName=`${e}`,r};/**
|
|
12
|
-
* @license lucide-react v0.303.0 - ISC
|
|
13
|
-
*
|
|
14
|
-
* This source code is licensed under the ISC license.
|
|
15
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/const gr=qe("Star",[["polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2",key:"8f66p6"}]]);/**
|
|
17
|
-
* @license lucide-react v0.303.0 - ISC
|
|
18
|
-
*
|
|
19
|
-
* This source code is licensed under the ISC license.
|
|
20
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
-
*/const Qe=qe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Re=({id:e,value:t,required:r,disabled:o,readonly:n,label:s,onChange:a,options:i,schema:c})=>{const u=E.useRef(null),f=i.accept||"*/*",d=i.multiple||!1,h=U(e,c),y=async p=>{const b=p.target.files;if(!b)return;let w;if(d){const N=Array.from(b).map(x=>({name:x.name,size:x.size,type:x.type,lastModified:x.lastModified}));w=N,a(N)}else{const N=b[0];N&&(w={name:N.name,size:N.size,type:N.type,lastModified:N.lastModified},a(w))}w&&await h.onChange(w)},v=async()=>{u.current&&(u.current.value=""),a(null),await h.onChange(null)},g=p=>p<1024?p+" B":p<1024*1024?(p/1024).toFixed(1)+" KB":(p/(1024*1024)).toFixed(1)+" MB";return l.jsxs("div",{className:"space-y-2",children:[l.jsxs(z,{htmlFor:e,children:[s||c.title,r&&l.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),l.jsx(T,{ref:u,id:e,type:"file",accept:f,multiple:d,required:r,disabled:o||n,onChange:y,className:"cursor-pointer"}),t&&l.jsx("div",{className:"space-y-2",children:d&&Array.isArray(t)?l.jsx("div",{className:"flex flex-wrap gap-2",children:t.map((p,b)=>l.jsxs(Ke,{variant:"secondary",className:"flex items-center gap-1 pr-1",children:[l.jsxs("span",{className:"text-xs",children:[p.name," (",g(p.size),")"]}),!o&&!n&&l.jsx(ie,{type:"button",variant:"ghost",size:"icon",className:"h-4 w-4 p-0 hover:bg-transparent",onClick:v,children:l.jsx(Qe,{className:"h-3 w-3"})})]},b))}):t&&typeof t=="object"&&"name"in t?l.jsxs(Ke,{variant:"secondary",className:"inline-flex items-center gap-1 pr-1",children:[l.jsxs("span",{className:"text-xs",children:[t.name," (",g(t.size),")"]}),!o&&!n&&l.jsx(ie,{type:"button",variant:"ghost",size:"icon",className:"h-4 w-4 p-0 hover:bg-transparent",onClick:v,children:l.jsx(Qe,{className:"h-3 w-3"})})]}):null})]})};function Ye(e,[t,r]){return Math.min(r,Math.max(t,e))}function Z(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(e==null||e(n),r===!1||!n.defaultPrevented)return t==null?void 0:t(n)}}function Je(e,t=[]){let r=[];function o(s,a){const i=m.createContext(a),c=r.length;r=[...r,a];const u=d=>{var b;const{scope:h,children:y,...v}=d,g=((b=h==null?void 0:h[e])==null?void 0:b[c])||i,p=m.useMemo(()=>v,Object.values(v));return l.jsx(g.Provider,{value:p,children:y})};u.displayName=s+"Provider";function f(d,h){var g;const y=((g=h==null?void 0:h[e])==null?void 0:g[c])||i,v=m.useContext(y);if(v)return v;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[u,f]}const n=()=>{const s=r.map(a=>m.createContext(a));return function(i){const c=(i==null?void 0:i[e])||s;return m.useMemo(()=>({[`__scope${e}`]:{...i,[e]:c}}),[i,c])}};return n.scopeName=e,[o,br(n,...t)]}function br(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const o=e.map(n=>({useScope:n(),scopeName:n.scopeName}));return function(s){const a=o.reduce((i,{useScope:c,scopeName:u})=>{const d=c(s)[`__scope${u}`];return{...i,...d}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return r.scopeName=t.scopeName,r}var Xe=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},mr=m[" useInsertionEffect ".trim().toString()]||Xe;function yr({prop:e,defaultProp:t,onChange:r=()=>{},caller:o}){const[n,s,a]=vr({defaultProp:t,onChange:r}),i=e!==void 0,c=i?e:n;{const f=m.useRef(e!==void 0);m.useEffect(()=>{const d=f.current;d!==i&&console.warn(`${o} is changing from ${d?"controlled":"uncontrolled"} to ${i?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=i},[i,o])}const u=m.useCallback(f=>{var d;if(i){const h=wr(f)?f(e):f;h!==e&&((d=a.current)==null||d.call(a,h))}else s(f)},[i,e,s,a]);return[c,u]}function vr({defaultProp:e,onChange:t}){const[r,o]=m.useState(e),n=m.useRef(r),s=m.useRef(t);return mr(()=>{s.current=t},[t]),m.useEffect(()=>{var a;n.current!==r&&((a=s.current)==null||a.call(s,r),n.current=r)},[r,n]),[r,o,s]}function wr(e){return typeof e=="function"}var xr=m.createContext(void 0);function Cr(e){const t=m.useContext(xr);return e||t||"ltr"}function Sr(e){const t=m.useRef({value:e,previous:e});return m.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function Nr(e){const[t,r]=m.useState(void 0);return Xe(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(n=>{if(!Array.isArray(n)||!n.length)return;const s=n[0];let a,i;if("borderBoxSize"in s){const c=s.borderBoxSize,u=Array.isArray(c)?c[0]:c;a=u.inlineSize,i=u.blockSize}else a=e.offsetWidth,i=e.offsetHeight;r({width:a,height:i})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else r(void 0)},[e]),t}function kr(e){const t=e+"CollectionProvider",[r,o]=Je(t),[n,s]=r(t,{collectionRef:{current:null},itemMap:new Map}),a=g=>{const{scope:p,children:b}=g,w=E.useRef(null),N=E.useRef(new Map).current;return l.jsx(n,{scope:p,itemMap:N,collectionRef:w,children:b})};a.displayName=t;const i=e+"CollectionSlot",c=se(i),u=E.forwardRef((g,p)=>{const{scope:b,children:w}=g,N=s(i,b),x=G(p,N.collectionRef);return l.jsx(c,{ref:x,children:w})});u.displayName=i;const f=e+"CollectionItemSlot",d="data-radix-collection-item",h=se(f),y=E.forwardRef((g,p)=>{const{scope:b,children:w,...N}=g,x=E.useRef(null),F=G(p,x),V=s(f,b);return E.useEffect(()=>(V.itemMap.set(x,{ref:x,...N}),()=>void V.itemMap.delete(x))),l.jsx(h,{[d]:"",ref:F,children:w})});y.displayName=f;function v(g){const p=s(e+"CollectionConsumer",g);return E.useCallback(()=>{const w=p.collectionRef.current;if(!w)return[];const N=Array.from(w.querySelectorAll(`[${d}]`));return Array.from(p.itemMap.values()).sort((V,I)=>N.indexOf(V.ref.current)-N.indexOf(I.ref.current))},[p.collectionRef,p.itemMap])}return[{Provider:a,Slot:u,ItemSlot:y},v,o]}var Ze=["PageUp","PageDown"],et=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],tt={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},ee="Slider",[fe,Pr,Er]=kr(ee),[rt,no]=Je(ee,[Er]),[Mr,ae]=rt(ee),ot=m.forwardRef((e,t)=>{const{name:r,min:o=0,max:n=100,step:s=1,orientation:a="horizontal",disabled:i=!1,minStepsBetweenThumbs:c=0,defaultValue:u=[o],value:f,onValueChange:d=()=>{},onValueCommit:h=()=>{},inverted:y=!1,form:v,...g}=e,p=m.useRef(new Set),b=m.useRef(0),N=a==="horizontal"?Ar:Fr,[x=[],F]=yr({prop:f,defaultProp:u,onChange:M=>{var H;(H=[...p.current][b.current])==null||H.focus(),d(M)}}),V=m.useRef(x);function I(M){const k=_r(x,M);$(M,k)}function te(M){$(M,b.current)}function Q(){const M=V.current[b.current];x[b.current]!==M&&h(x)}function $(M,k,{commit:H}={commit:!1}){const R=Hr(s),re=Lr(Math.round((M-o)/s)*s+o,R),j=Ye(re,[o,n]);F((L=[])=>{const _=Vr(L,j,k);if(Or(_,c*s)){b.current=_.indexOf(j);const K=String(_)!==String(L);return K&&H&&h(_),K?_:L}else return L})}return l.jsx(Mr,{scope:e.__scopeSlider,name:r,disabled:i,min:o,max:n,valueIndexToChangeRef:b,thumbs:p.current,values:x,orientation:a,form:v,children:l.jsx(fe.Provider,{scope:e.__scopeSlider,children:l.jsx(fe.Slot,{scope:e.__scopeSlider,children:l.jsx(N,{"aria-disabled":i,"data-disabled":i?"":void 0,...g,ref:t,onPointerDown:Z(g.onPointerDown,()=>{i||(V.current=x)}),min:o,max:n,inverted:y,onSlideStart:i?void 0:I,onSlideMove:i?void 0:te,onSlideEnd:i?void 0:Q,onHomeKeyDown:()=>!i&&$(o,0,{commit:!0}),onEndKeyDown:()=>!i&&$(n,x.length-1,{commit:!0}),onStepKeyDown:({event:M,direction:k})=>{if(!i){const re=Ze.includes(M.key)||M.shiftKey&&et.includes(M.key)?10:1,j=b.current,L=x[j],_=s*re*k;$(L+_,j,{commit:!0})}}})})})})});ot.displayName=ee;var[nt,st]=rt(ee,{startEdge:"left",endEdge:"right",size:"width",direction:1}),Ar=m.forwardRef((e,t)=>{const{min:r,max:o,dir:n,inverted:s,onSlideStart:a,onSlideMove:i,onSlideEnd:c,onStepKeyDown:u,...f}=e,[d,h]=m.useState(null),y=G(t,N=>h(N)),v=m.useRef(void 0),g=Cr(n),p=g==="ltr",b=p&&!s||!p&&s;function w(N){const x=v.current||d.getBoundingClientRect(),F=[0,x.width],I=ge(F,b?[r,o]:[o,r]);return v.current=x,I(N-x.left)}return l.jsx(nt,{scope:e.__scopeSlider,startEdge:b?"left":"right",endEdge:b?"right":"left",direction:b?1:-1,size:"width",children:l.jsx(it,{dir:g,"data-orientation":"horizontal",...f,ref:y,style:{...f.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:N=>{const x=w(N.clientX);a==null||a(x)},onSlideMove:N=>{const x=w(N.clientX);i==null||i(x)},onSlideEnd:()=>{v.current=void 0,c==null||c()},onStepKeyDown:N=>{const F=tt[b?"from-left":"from-right"].includes(N.key);u==null||u({event:N,direction:F?-1:1})}})})}),Fr=m.forwardRef((e,t)=>{const{min:r,max:o,inverted:n,onSlideStart:s,onSlideMove:a,onSlideEnd:i,onStepKeyDown:c,...u}=e,f=m.useRef(null),d=G(t,f),h=m.useRef(void 0),y=!n;function v(g){const p=h.current||f.current.getBoundingClientRect(),b=[0,p.height],N=ge(b,y?[o,r]:[r,o]);return h.current=p,N(g-p.top)}return l.jsx(nt,{scope:e.__scopeSlider,startEdge:y?"bottom":"top",endEdge:y?"top":"bottom",size:"height",direction:y?1:-1,children:l.jsx(it,{"data-orientation":"vertical",...u,ref:d,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:g=>{const p=v(g.clientY);s==null||s(p)},onSlideMove:g=>{const p=v(g.clientY);a==null||a(p)},onSlideEnd:()=>{h.current=void 0,i==null||i()},onStepKeyDown:g=>{const b=tt[y?"from-bottom":"from-top"].includes(g.key);c==null||c({event:g,direction:b?-1:1})}})})}),it=m.forwardRef((e,t)=>{const{__scopeSlider:r,onSlideStart:o,onSlideMove:n,onSlideEnd:s,onHomeKeyDown:a,onEndKeyDown:i,onStepKeyDown:c,...u}=e,f=ae(ee,r);return l.jsx(X.span,{...u,ref:t,onKeyDown:Z(e.onKeyDown,d=>{d.key==="Home"?(a(d),d.preventDefault()):d.key==="End"?(i(d),d.preventDefault()):Ze.concat(et).includes(d.key)&&(c(d),d.preventDefault())}),onPointerDown:Z(e.onPointerDown,d=>{const h=d.target;h.setPointerCapture(d.pointerId),d.preventDefault(),f.thumbs.has(h)?h.focus():o(d)}),onPointerMove:Z(e.onPointerMove,d=>{d.target.hasPointerCapture(d.pointerId)&&n(d)}),onPointerUp:Z(e.onPointerUp,d=>{const h=d.target;h.hasPointerCapture(d.pointerId)&&(h.releasePointerCapture(d.pointerId),s(d))})})}),at="SliderTrack",lt=m.forwardRef((e,t)=>{const{__scopeSlider:r,...o}=e,n=ae(at,r);return l.jsx(X.span,{"data-disabled":n.disabled?"":void 0,"data-orientation":n.orientation,...o,ref:t})});lt.displayName=at;var pe="SliderRange",ct=m.forwardRef((e,t)=>{const{__scopeSlider:r,...o}=e,n=ae(pe,r),s=st(pe,r),a=m.useRef(null),i=G(t,a),c=n.values.length,u=n.values.map(h=>ft(h,n.min,n.max)),f=c>1?Math.min(...u):0,d=100-Math.max(...u);return l.jsx(X.span,{"data-orientation":n.orientation,"data-disabled":n.disabled?"":void 0,...o,ref:i,style:{...e.style,[s.startEdge]:f+"%",[s.endEdge]:d+"%"}})});ct.displayName=pe;var he="SliderThumb",dt=m.forwardRef((e,t)=>{const r=Pr(e.__scopeSlider),[o,n]=m.useState(null),s=G(t,i=>n(i)),a=m.useMemo(()=>o?r().findIndex(i=>i.ref.current===o):-1,[r,o]);return l.jsx($r,{...e,ref:s,index:a})}),$r=m.forwardRef((e,t)=>{const{__scopeSlider:r,index:o,name:n,...s}=e,a=ae(he,r),i=st(he,r),[c,u]=m.useState(null),f=G(t,w=>u(w)),d=c?a.form||!!c.closest("form"):!0,h=Nr(c),y=a.values[o],v=y===void 0?0:ft(y,a.min,a.max),g=Tr(o,a.values.length),p=h==null?void 0:h[i.size],b=p?Ir(p,v,i.direction):0;return m.useEffect(()=>{if(c)return a.thumbs.add(c),()=>{a.thumbs.delete(c)}},[c,a.thumbs]),l.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[i.startEdge]:`calc(${v}% + ${b}px)`},children:[l.jsx(fe.ItemSlot,{scope:e.__scopeSlider,children:l.jsx(X.span,{role:"slider","aria-label":e["aria-label"]||g,"aria-valuemin":a.min,"aria-valuenow":y,"aria-valuemax":a.max,"aria-orientation":a.orientation,"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,tabIndex:a.disabled?void 0:0,...s,ref:f,style:y===void 0?{display:"none"}:e.style,onFocus:Z(e.onFocus,()=>{a.valueIndexToChangeRef.current=o})})}),d&&l.jsx(ut,{name:n??(a.name?a.name+(a.values.length>1?"[]":""):void 0),form:a.form,value:y},o)]})});dt.displayName=he;var zr="RadioBubbleInput",ut=m.forwardRef(({__scopeSlider:e,value:t,...r},o)=>{const n=m.useRef(null),s=G(n,o),a=Sr(t);return m.useEffect(()=>{const i=n.current;if(!i)return;const c=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(c,"value").set;if(a!==t&&f){const d=new Event("input",{bubbles:!0});f.call(i,t),i.dispatchEvent(d)}},[a,t]),l.jsx(X.input,{style:{display:"none"},...r,ref:s,defaultValue:t})});ut.displayName=zr;function Vr(e=[],t,r){const o=[...e];return o[r]=t,o.sort((n,s)=>n-s)}function ft(e,t,r){const s=100/(r-t)*(e-t);return Ye(s,[0,100])}function Tr(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function _r(e,t){if(e.length===1)return 0;const r=e.map(n=>Math.abs(n-t)),o=Math.min(...r);return r.indexOf(o)}function Ir(e,t,r){const o=e/2,s=ge([0,50],[0,o]);return(o-s(t)*r)*r}function jr(e){return e.slice(0,-1).map((t,r)=>e[r+1]-t)}function Or(e,t){if(t>0){const r=jr(e);return Math.min(...r)>=t}return!0}function ge(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const o=(t[1]-t[0])/(e[1]-e[0]);return t[0]+o*(r-e[0])}}function Hr(e){return(String(e).split(".")[1]||"").length}function Lr(e,t){const r=Math.pow(10,t);return Math.round(e*r)/r}var pt=ot,Br=lt,Wr=ct,Dr=dt;const ht=m.forwardRef(({className:e,...t},r)=>l.jsxs(pt,{ref:r,className:A("relative flex w-full touch-none select-none items-center",e),...t,children:[l.jsx(Br,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:l.jsx(Wr,{className:"absolute h-full bg-primary"})}),l.jsx(Dr,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"})]}));ht.displayName=pt.displayName;const gt=({id:e,value:t,required:r,disabled:o,readonly:n,label:s,onChange:a,onBlur:i,schema:c})=>{const u=c.minimum||0,f=c.maximum||100,d=c.multipleOf||1,h=U(e,c),y=async v=>{const g=v[0];a(g),i&&i(e,g),await h.onChange(g)};return l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs(z,{htmlFor:e,children:[s||c.title,r&&l.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),l.jsx("span",{className:"text-sm font-medium tabular-nums",children:t||u})]}),l.jsx(ht,{id:e,min:u,max:f,step:d,value:[t||u],onValueChange:y,disabled:o||n,className:"w-full"})]})},bt=({id:e,value:t,required:r,disabled:o,readonly:n,label:s,onChange:a,options:i,schema:c})=>{const u=Number(i.max||c.maximum||5),f=Array.from({length:u},(y,v)=>v+1),d=U(e,c),h=async y=>{!o&&!n&&(a(y),await d.onChange(y))};return l.jsxs("div",{className:"space-y-2",children:[l.jsxs(z,{htmlFor:e,children:[s||c.title,r&&l.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),l.jsx("div",{className:"flex items-center gap-1",role:"radiogroup","aria-labelledby":e,children:f.map(y=>l.jsx(ie,{type:"button",variant:"ghost",size:"icon",className:A("h-8 w-8 p-0 hover:bg-transparent",o||n?"cursor-not-allowed opacity-50":"cursor-pointer"),onClick:()=>h(y),disabled:o||n,"aria-label":`Rate ${y} out of ${u}`,role:"radio","aria-checked":y===t,children:l.jsx(gr,{className:A("h-5 w-5 transition-colors",y<=(t||0)?"fill-yellow-400 text-yellow-400":"text-muted-foreground")})},y))})]})},mt={color:Ge,date:Ue,file:Re,range:gt,rating:bt},Gr={small:"space-y-2",medium:"space-y-4",large:"space-y-6"},Ur=({children:e,spacing:t="medium",className:r=""})=>l.jsx("div",{className:A("flex flex-col",Gr[t],r),children:e}),Kr={small:"space-x-2",medium:"space-x-4",large:"space-x-6"},qr={start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch"},Qr=({children:e,spacing:t="medium",align:r="center",className:o=""})=>l.jsx("div",{className:A("flex flex-row",Kr[t],qr[r],o),children:e}),Rr={small:"gap-2",medium:"gap-4",large:"gap-6"},Yr=({children:e,columns:t="auto-fit",gap:r="medium",minItemWidth:o="250px",className:n=""})=>{const s={display:"grid"};return typeof t=="number"?s.gridTemplateColumns=`repeat(${t}, 1fr)`:s.gridTemplateColumns=`repeat(${t}, minmax(${o}, 1fr))`,l.jsx("div",{className:A("grid",Rr[r],n),style:s,children:e})};class Jr{constructor(t){q(this,"handlers");this.handlers=t}async handleBeforeSubmit(t){return this.handlers.beforeSubmit?await this.handlers.beforeSubmit(t):t}async handleAfterSubmit(t){this.handlers.afterSubmit&&await this.handlers.afterSubmit(t)}async handleBeforeValidation(t){return this.handlers.beforeValidation?await this.handlers.beforeValidation(t):t}async handleAfterValidation(t,r){this.handlers.afterValidation&&await this.handlers.afterValidation(t,r)}}class yt{constructor(t,r={},o=[]){q(this,"formHandlers");q(this,"fieldHandlers");q(this,"webhooks");q(this,"debounceTimers",new Map);q(this,"webhookQueue",[]);q(this,"isProcessingQueue",!1);this.formHandlers=t,this.fieldHandlers=r,this.webhooks=o}async handleBeforeSubmit(t){return this.formHandlers.beforeSubmit?await this.formHandlers.beforeSubmit(t):t}async handleAfterSubmit(t){this.formHandlers.afterSubmit&&await this.formHandlers.afterSubmit(t)}async handleBeforeValidation(t){return this.formHandlers.beforeValidation?await this.formHandlers.beforeValidation(t):t}async handleAfterValidation(t,r){this.formHandlers.afterValidation&&await this.formHandlers.afterValidation(t,r)}async handleFieldEvent(t,r,o,n,s,a){const i={eventType:t,fieldId:r,fieldValue:o,schema:n,formData:s,timestamp:Date.now(),fieldPath:a};try{switch(t){case"focus":this.fieldHandlers.onFieldFocus&&await this.fieldHandlers.onFieldFocus(i);break;case"blur":this.fieldHandlers.onFieldBlur&&await this.fieldHandlers.onFieldBlur(i);break;case"change":this.fieldHandlers.onFieldChange&&await this.fieldHandlers.onFieldChange(i);break}}catch(c){console.error(`Error in field event handler (${t}):`,c)}this.processWebhooks(i)}processWebhooks(t){const r=this.webhooks.filter(o=>!o.events||o.events.includes(t.eventType));for(const o of r)o.debounceMs&&o.debounceMs>0?this.debounceWebhook(o,t):this.queueWebhook(o,t)}debounceWebhook(t,r){const o=`${t.url}-${r.fieldId}-${r.eventType}`;this.debounceTimers.has(o)&&clearTimeout(this.debounceTimers.get(o));const n=setTimeout(()=>{this.queueWebhook(t,r),this.debounceTimers.delete(o)},t.debounceMs);this.debounceTimers.set(o,n)}queueWebhook(t,r){this.webhookQueue.push({config:t,event:r,retryCount:0}),this.isProcessingQueue||this.processWebhookQueue()}async processWebhookQueue(){if(!(this.isProcessingQueue||this.webhookQueue.length===0)){for(this.isProcessingQueue=!0;this.webhookQueue.length>0;){const t=this.webhookQueue.shift();try{await this.callWebhook(t.config,t.event)}catch(r){const o=t.config.retries||3;t.retryCount<o?(t.retryCount++,setTimeout(()=>{this.webhookQueue.push(t)},Math.pow(2,t.retryCount)*1e3)):console.error(`Webhook failed after ${o} retries:`,r)}}this.isProcessingQueue=!1}}async callWebhook(t,r){const o={event:r,timestamp:Date.now(),source:"extended-dynamic-forms"},n={method:t.method||"POST",headers:{"Content-Type":"application/json",...t.headers},body:JSON.stringify(o)};t.timeout&&(n.signal=AbortSignal.timeout(t.timeout));const s=await fetch(t.url,n);if(!s.ok)throw new Error(`Webhook request failed: ${s.status} ${s.statusText}`)}createFieldEventHandlers(t,r,o,n){return{onFocus:s=>this.handleFieldEvent("focus",t,s,r,o,n),onBlur:s=>this.handleFieldEvent("blur",t,s,r,o,n),onChange:s=>this.handleFieldEvent("change",t,s,r,o,n)}}cleanup(){for(const t of this.debounceTimers.values())clearTimeout(t);this.debounceTimers.clear()}}const vt={cloneFormData:e=>JSON.parse(JSON.stringify(e)),mergeFormData:(e,t)=>({...e,...t}),getNestedValue:(e,t)=>{const r=t.split(".");let o=e;for(const n of r)if(o&&typeof o=="object"&&n in o)o=o[n];else return;return o},setNestedValue:(e,t,r)=>{const o=t.split("."),n={...e};let s=n;for(let a=0;a<o.length-1;a++){const i=o[a];(!(i in s)||typeof s[i]!="object")&&(s[i]={}),s=s[i]}return s[o[o.length-1]]=r,n},removeEmptyValues:e=>{if(Array.isArray(e))return e.filter(t=>t!=null&&t!=="");if(e!==null&&typeof e=="object"){const t={};for(const[r,o]of Object.entries(e))o!=null&&o!==""&&(t[r]=vt.removeEmptyValues(o));return t}return e}},wt={getRequiredFields:e=>e.required||[],isFieldRequired:(e,t)=>(e.required||[]).includes(t),getFieldSchema:(e,t)=>{const r=t.split(".");let o=e;for(const n of r)if(o.type==="object"&&o.properties)o=o.properties[n];else if(o.type==="array"&&o.items)o=o.items;else return;return o},mergeSchemas:(e,t)=>({...e,...t,properties:{...e.properties,...t.properties},required:[...new Set([...e.required||[],...t.required||[]])]}),getAllFieldPaths:(e,t="")=>{const r=[];if(e.type==="object"&&e.properties)for(const[o,n]of Object.entries(e.properties)){const s=t?`${t}.${o}`:o;r.push(s),r.push(...wt.getAllFieldPaths(n,s))}return r}},Xr={isValidEmail:e=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e),isValidPhone:e=>/^\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/.test(e),isValidUrl:e=>{try{return new URL(e),!0}catch{return!1}},isValidDate:e=>{const t=new Date(e);return t instanceof Date&&!isNaN(t.getTime())},isInRange:(e,t,r)=>!(t!==void 0&&e<t||r!==void 0&&e>r),getValidationMessage:(e,t)=>({required:"This field is required",email:"Please enter a valid email address",phone:"Please enter a valid phone number",url:"Please enter a valid URL",date:"Please enter a valid date",min:`Value must be at least ${t==null?void 0:t.min}`,max:`Value must be at most ${t==null?void 0:t.max}`,minLength:`Must be at least ${t==null?void 0:t.minLength} characters`,maxLength:`Must be at most ${t==null?void 0:t.maxLength} characters`})[e]||"Invalid value"},Zr=({schema:e,uiSchema:t,formData:r,onSubmit:o,onChange:n,onError:s,onBlur:a,onFocus:i,beforeSubmit:c,afterSubmit:u,beforeValidation:f,afterValidation:d,onFieldFocus:h,onFieldBlur:y,onFieldChange:v,webhooks:g=[],widgets:p={},fields:b={},templates:w={},...N})=>{const x=E.useRef(null),F=E.useMemo(()=>{const $=new yt({beforeSubmit:c,afterSubmit:u,beforeValidation:f,afterValidation:d},{onFieldFocus:h,onFieldBlur:y,onFieldChange:v},g);return x.current=$,$},[c,u,f,d,h,y,v,g]);E.useEffect(()=>()=>{x.current&&x.current.cleanup()},[]);const V=async($,M)=>{const k=await F.handleBeforeSubmit($);o&&await o(k,M),await F.handleAfterSubmit(k)},I=$=>{n&&n($)},te={...mt,...p},Q={...De,...b};return l.jsx(He,{eventHub:F,formData:r,children:l.jsx(me,{schema:e,uiSchema:t,formData:r,validator:be,onSubmit:V,onChange:I,onError:s,onBlur:a,onFocus:i,widgets:te,fields:Q,templates:w,...N})})};C.validator=be,Object.defineProperty(C,"generateTheme",{enumerable:!0,get:()=>me.generateTheme}),C.AddressField=je,C.ColorWidget=Ge,C.CurrencyField=We,C.DateWidget=Ue,C.ExtendedForm=Zr,C.FileWidget=Re,C.FormEventHub=yt,C.FormEventManager=Jr,C.FormEventProvider=He,C.GridLayout=Yr,C.HorizontalLayout=Qr,C.PhoneField=Be,C.RangeWidget=gt,C.RatingWidget=bt,C.VerticalLayout=Ur,C.cn=A,C.customFields=De,C.customWidgets=mt,C.formDataUtils=vt,C.schemaUtils=wt,C.useFieldEventHandlers=U,C.useFormEventHub=Le,C.validationUtils=Xr,Object.defineProperty(C,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
|
|
3
|
-
interface GridLayoutProps {
|
|
4
|
-
children: React.ReactNode;
|
|
5
|
-
columns?: number | 'auto-fit' | 'auto-fill';
|
|
6
|
-
gap?: 'small' | 'medium' | 'large';
|
|
7
|
-
minItemWidth?: string;
|
|
8
|
-
className?: string;
|
|
9
|
-
}
|
|
10
|
-
export declare const GridLayout: React.FC<GridLayoutProps>;
|
|
11
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
|
|
3
|
-
interface HorizontalLayoutProps {
|
|
4
|
-
children: React.ReactNode;
|
|
5
|
-
spacing?: 'small' | 'medium' | 'large';
|
|
6
|
-
align?: 'start' | 'center' | 'end' | 'stretch';
|
|
7
|
-
className?: string;
|
|
8
|
-
}
|
|
9
|
-
export declare const HorizontalLayout: React.FC<HorizontalLayoutProps>;
|
|
10
|
-
export {};
|
package/dist/layouts/index.d.ts
DELETED
package/dist/lib/utils.d.ts
DELETED
package/dist/style.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}:root{--background: 0 0% 100%;--foreground: 222.2 84% 4.9%;--card: 0 0% 100%;--card-foreground: 222.2 84% 4.9%;--popover: 0 0% 100%;--popover-foreground: 222.2 84% 4.9%;--primary: 222.2 47.4% 11.2%;--primary-foreground: 210 40% 98%;--secondary: 210 40% 96.1%;--secondary-foreground: 222.2 47.4% 11.2%;--muted: 210 40% 96.1%;--muted-foreground: 215.4 16.3% 46.9%;--accent: 210 40% 96.1%;--accent-foreground: 222.2 47.4% 11.2%;--destructive: 0 84.2% 60.2%;--destructive-foreground: 210 40% 98%;--border: 214.3 31.8% 91.4%;--input: 214.3 31.8% 91.4%;--ring: 222.2 84% 4.9%;--radius: .5rem}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));color:hsl(var(--foreground))}.absolute{position:absolute}.relative{position:relative}.left-3{left:.75rem}.right-3{right:.75rem}.top-1\/2{top:50%}.ml-1{margin-left:.25rem}.block{display:block}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-2{height:.5rem}.h-3{height:.75rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-full{height:100%}.w-10{width:2.5rem}.w-3{width:.75rem}.w-4{width:1rem}.w-5{width:1.25rem}.w-8{width:2rem}.w-full{width:100%}.grow{flex-grow:1}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-stretch{align-items:stretch}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-6>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1.5rem * var(--tw-space-x-reverse));margin-left:calc(1.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.overflow-hidden{overflow:hidden}.whitespace-nowrap{white-space:nowrap}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.border{border-width:1px}.border-2{border-width:2px}.border-input{border-color:hsl(var(--input))}.border-primary{border-color:hsl(var(--primary))}.border-transparent{border-color:transparent}.bg-background{background-color:hsl(var(--background))}.bg-card{background-color:hsl(var(--card))}.bg-destructive{background-color:hsl(var(--destructive))}.bg-primary{background-color:hsl(var(--primary))}.bg-secondary{background-color:hsl(var(--secondary))}.fill-yellow-400{fill:#facc15}.p-0{padding:0}.p-6{padding:1.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.pb-4{padding-bottom:1rem}.pl-8{padding-left:2rem}.pr-1{padding-right:.25rem}.pr-12{padding-right:3rem}.pt-0{padding-top:0}.text-2xl{font-size:1.5rem;line-height:2rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-medium{font-weight:500}.font-semibold{font-weight:600}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-none{line-height:1}.tracking-tight{letter-spacing:-.025em}.text-card-foreground{color:hsl(var(--card-foreground))}.text-destructive{color:hsl(var(--destructive))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-foreground{color:hsl(var(--foreground))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-yellow-400{--tw-text-opacity: 1;color:rgb(250 204 21 / var(--tw-text-opacity, 1))}.underline-offset-4{text-underline-offset:4px}.opacity-50{opacity:.5}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline{outline-style:solid}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.file\:border-0::file-selector-button{border-width:0px}.file\:bg-transparent::file-selector-button{background-color:transparent}.file\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\:font-medium::file-selector-button{font-weight:500}.placeholder\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.hover\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\:bg-destructive\/80:hover{background-color:hsl(var(--destructive) / .8)}.hover\:bg-destructive\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\:bg-primary\/80:hover{background-color:hsl(var(--primary) / .8)}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\:bg-transparent:hover{background-color:transparent}.hover\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\:underline:hover{text-decoration-line:underline}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.peer:disabled~.peer-disabled\:cursor-not-allowed{cursor:not-allowed}.peer:disabled~.peer-disabled\:opacity-70{opacity:.7}
|
package/dist/types/index.d.ts
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { FormProps } from '@rjsf/core';
|
|
2
|
-
import { RJSFSchema, UiSchema } from '@rjsf/utils';
|
|
3
|
-
|
|
4
|
-
export interface FormEventHandlers {
|
|
5
|
-
beforeSubmit?: (data: any) => Promise<any> | any;
|
|
6
|
-
afterSubmit?: (data: any) => Promise<void> | void;
|
|
7
|
-
beforeValidation?: (data: any) => Promise<any> | any;
|
|
8
|
-
afterValidation?: (data: any, errors: any) => Promise<void> | void;
|
|
9
|
-
}
|
|
10
|
-
export interface FormFieldEvent {
|
|
11
|
-
eventType: 'focus' | 'blur' | 'change';
|
|
12
|
-
fieldId: string;
|
|
13
|
-
fieldValue: any;
|
|
14
|
-
schema?: any;
|
|
15
|
-
formData?: any;
|
|
16
|
-
timestamp: number;
|
|
17
|
-
fieldPath?: string[];
|
|
18
|
-
}
|
|
19
|
-
export interface WebhookConfig {
|
|
20
|
-
url: string;
|
|
21
|
-
method?: 'POST' | 'PUT' | 'PATCH';
|
|
22
|
-
headers?: Record<string, string>;
|
|
23
|
-
events?: ('focus' | 'blur' | 'change')[];
|
|
24
|
-
debounceMs?: number;
|
|
25
|
-
retries?: number;
|
|
26
|
-
timeout?: number;
|
|
27
|
-
}
|
|
28
|
-
export interface FieldEventHandlers {
|
|
29
|
-
onFieldFocus?: (event: FormFieldEvent) => Promise<void> | void;
|
|
30
|
-
onFieldBlur?: (event: FormFieldEvent) => Promise<void> | void;
|
|
31
|
-
onFieldChange?: (event: FormFieldEvent) => Promise<void> | void;
|
|
32
|
-
}
|
|
33
|
-
export interface ExtendedFormProps extends Omit<FormProps, 'validator'>, FormEventHandlers, FieldEventHandlers {
|
|
34
|
-
schema: RJSFSchema;
|
|
35
|
-
uiSchema?: UiSchema;
|
|
36
|
-
webhooks?: WebhookConfig[];
|
|
37
|
-
}
|
|
38
|
-
export interface CustomWidgetProps {
|
|
39
|
-
label?: string;
|
|
40
|
-
required?: boolean;
|
|
41
|
-
disabled?: boolean;
|
|
42
|
-
readonly?: boolean;
|
|
43
|
-
autofocus?: boolean;
|
|
44
|
-
placeholder?: string;
|
|
45
|
-
help?: string;
|
|
46
|
-
rawErrors?: string[];
|
|
47
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export declare const formDataUtils: {
|
|
2
|
-
/**
|
|
3
|
-
* Deep clone form data to avoid mutations
|
|
4
|
-
*/
|
|
5
|
-
cloneFormData: (data: any) => any;
|
|
6
|
-
/**
|
|
7
|
-
* Merge two form data objects
|
|
8
|
-
*/
|
|
9
|
-
mergeFormData: (current: any, updates: any) => any;
|
|
10
|
-
/**
|
|
11
|
-
* Get nested value from form data using dot notation
|
|
12
|
-
*/
|
|
13
|
-
getNestedValue: (data: any, path: string) => any;
|
|
14
|
-
/**
|
|
15
|
-
* Set nested value in form data using dot notation
|
|
16
|
-
*/
|
|
17
|
-
setNestedValue: (data: any, path: string, value: any) => any;
|
|
18
|
-
/**
|
|
19
|
-
* Remove empty values from form data
|
|
20
|
-
*/
|
|
21
|
-
removeEmptyValues: (data: any) => any;
|
|
22
|
-
};
|
package/dist/utils/index.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { RJSFSchema } from '@rjsf/utils';
|
|
2
|
-
|
|
3
|
-
export declare const schemaUtils: {
|
|
4
|
-
/**
|
|
5
|
-
* Get required fields from schema
|
|
6
|
-
*/
|
|
7
|
-
getRequiredFields: (schema: RJSFSchema) => string[];
|
|
8
|
-
/**
|
|
9
|
-
* Check if a field is required
|
|
10
|
-
*/
|
|
11
|
-
isFieldRequired: (schema: RJSFSchema, fieldName: string) => boolean;
|
|
12
|
-
/**
|
|
13
|
-
* Get field schema by path
|
|
14
|
-
*/
|
|
15
|
-
getFieldSchema: (schema: RJSFSchema, path: string) => RJSFSchema | undefined;
|
|
16
|
-
/**
|
|
17
|
-
* Merge two schemas
|
|
18
|
-
*/
|
|
19
|
-
mergeSchemas: (schema1: RJSFSchema, schema2: RJSFSchema) => RJSFSchema;
|
|
20
|
-
/**
|
|
21
|
-
* Get all field paths from schema
|
|
22
|
-
*/
|
|
23
|
-
getAllFieldPaths: (schema: RJSFSchema, prefix?: string) => string[];
|
|
24
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export declare const validationUtils: {
|
|
2
|
-
/**
|
|
3
|
-
* Validate email format
|
|
4
|
-
*/
|
|
5
|
-
isValidEmail: (email: string) => boolean;
|
|
6
|
-
/**
|
|
7
|
-
* Validate phone number format
|
|
8
|
-
*/
|
|
9
|
-
isValidPhone: (phone: string) => boolean;
|
|
10
|
-
/**
|
|
11
|
-
* Validate URL format
|
|
12
|
-
*/
|
|
13
|
-
isValidUrl: (url: string) => boolean;
|
|
14
|
-
/**
|
|
15
|
-
* Validate date format
|
|
16
|
-
*/
|
|
17
|
-
isValidDate: (date: string) => boolean;
|
|
18
|
-
/**
|
|
19
|
-
* Validate number in range
|
|
20
|
-
*/
|
|
21
|
-
isInRange: (value: number, min?: number, max?: number) => boolean;
|
|
22
|
-
/**
|
|
23
|
-
* Custom validation messages
|
|
24
|
-
*/
|
|
25
|
-
getValidationMessage: (type: string, params?: any) => string;
|
|
26
|
-
};
|
package/dist/widgets/index.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { ColorWidget } from './input/ColorWidget';
|
|
2
|
-
import { DateWidget } from './date/DateWidget';
|
|
3
|
-
import { FileWidget } from './file/FileWidget';
|
|
4
|
-
import { RangeWidget } from './input/RangeWidget';
|
|
5
|
-
import { RatingWidget } from './input/RatingWidget';
|
|
6
|
-
|
|
7
|
-
export declare const customWidgets: {
|
|
8
|
-
color: import('react').FC<import('@rjsf/utils').WidgetProps<any, import('@rjsf/utils').RJSFSchema, any>>;
|
|
9
|
-
date: import('react').FC<import('@rjsf/utils').WidgetProps<any, import('@rjsf/utils').RJSFSchema, any>>;
|
|
10
|
-
file: import('react').FC<import('@rjsf/utils').WidgetProps<any, import('@rjsf/utils').RJSFSchema, any>>;
|
|
11
|
-
range: import('react').FC<import('@rjsf/utils').WidgetProps<any, import('@rjsf/utils').RJSFSchema, any>>;
|
|
12
|
-
rating: import('react').FC<import('@rjsf/utils').WidgetProps<any, import('@rjsf/utils').RJSFSchema, any>>;
|
|
13
|
-
};
|
|
14
|
-
export { ColorWidget, DateWidget, FileWidget, RangeWidget, RatingWidget, };
|