react-luna-form 0.0.33 → 0.0.34

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.
Files changed (74) hide show
  1. package/dist/client/cjs/index.js +1 -1
  2. package/dist/client/esm/index.js +1 -1
  3. package/dist/config/cjs/index.js +1 -1
  4. package/dist/config/esm/index.js +1 -1
  5. package/dist/server/cjs/index.js +1 -1
  6. package/dist/server/esm/index.js +1 -1
  7. package/dist/types/luna-core/src/helper/input.d.ts +6 -0
  8. package/dist/types/luna-core/src/type.d.ts +4 -0
  9. package/dist/types/luna-core/src/util/constant.d.ts +2 -0
  10. package/dist/types/luna-core/src/util/date.d.ts +11 -0
  11. package/dist/types/luna-core/src/util/is-input.d.ts +1 -0
  12. package/package.json +2 -2
  13. package/dist/types/client/component/field/field-list.d.ts +0 -2
  14. package/dist/types/client/component/field/field-with-state.d.ts +0 -13
  15. package/dist/types/client/component/field/field.d.ts +0 -7
  16. package/dist/types/client/component/form-content.d.ts +0 -20
  17. package/dist/types/client/component/form.d.ts +0 -20
  18. package/dist/types/client/component/guard/list-guard.d.ts +0 -2
  19. package/dist/types/client/component/guard/visibility-guard.d.ts +0 -6
  20. package/dist/types/client/component/input.d.ts +0 -16
  21. package/dist/types/client/component/slot/slot.d.ts +0 -7
  22. package/dist/types/client/hook/use-data-source.d.ts +0 -3
  23. package/dist/types/client/hook/use-fetch.d.ts +0 -3
  24. package/dist/types/client/hook/use-field-list.d.ts +0 -2
  25. package/dist/types/client/hook/use-form-action.d.ts +0 -13
  26. package/dist/types/client/hook/use-input.d.ts +0 -2
  27. package/dist/types/client/hook/use-schema.d.ts +0 -2
  28. package/dist/types/client/hook/use-store.d.ts +0 -1
  29. package/dist/types/client/hook/use-timeout.d.ts +0 -1
  30. package/dist/types/client/hook/use-value.d.ts +0 -6
  31. package/dist/types/client/index.d.ts +0 -3
  32. package/dist/types/client/lib/error-store.d.ts +0 -7
  33. package/dist/types/client/lib/source-store.d.ts +0 -5
  34. package/dist/types/client/lib/state-store.d.ts +0 -5
  35. package/dist/types/client/lib/store-helper.d.ts +0 -26
  36. package/dist/types/client/lib/value-store.d.ts +0 -10
  37. package/dist/types/component/chevron-icon.d.ts +0 -3
  38. package/dist/types/component/column.d.ts +0 -5
  39. package/dist/types/component/control.d.ts +0 -5
  40. package/dist/types/component/description.d.ts +0 -3
  41. package/dist/types/component/field/field-base.d.ts +0 -12
  42. package/dist/types/component/field/field-error.d.ts +0 -5
  43. package/dist/types/component/field/field-group.d.ts +0 -8
  44. package/dist/types/component/field/field-horizontal.d.ts +0 -2
  45. package/dist/types/component/field/field-list-item.d.ts +0 -8
  46. package/dist/types/component/field/field-list.d.ts +0 -7
  47. package/dist/types/component/field/field-set-advanced.d.ts +0 -5
  48. package/dist/types/component/field/field-set-base.d.ts +0 -7
  49. package/dist/types/component/field/field-set.d.ts +0 -6
  50. package/dist/types/component/field/field-vertical.d.ts +0 -2
  51. package/dist/types/component/field/field.d.ts +0 -10
  52. package/dist/types/component/form.d.ts +0 -13
  53. package/dist/types/component/formatted-description.d.ts +0 -7
  54. package/dist/types/component/group.d.ts +0 -4
  55. package/dist/types/component/input/input-base.d.ts +0 -9
  56. package/dist/types/component/input-group.d.ts +0 -10
  57. package/dist/types/component/input-label.d.ts +0 -9
  58. package/dist/types/component/label.d.ts +0 -7
  59. package/dist/types/component/legend.d.ts +0 -4
  60. package/dist/types/component/list.d.ts +0 -5
  61. package/dist/types/component/separator.d.ts +0 -1
  62. package/dist/types/component/slot/list-slot.d.ts +0 -2
  63. package/dist/types/component/slot/slot-base.d.ts +0 -16
  64. package/dist/types/component/slot/slot-create.d.ts +0 -10
  65. package/dist/types/component/slot/slot-list.d.ts +0 -12
  66. package/dist/types/component/slot/slot.d.ts +0 -7
  67. package/dist/types/config/index.d.ts +0 -31
  68. package/dist/types/lib/render-If-exists.d.ts +0 -1
  69. package/dist/types/lib/string.d.ts +0 -1
  70. package/dist/types/server/component/fallback.d.ts +0 -7
  71. package/dist/types/server/component/form.d.ts +0 -13
  72. package/dist/types/server/component/input.d.ts +0 -13
  73. package/dist/types/server/index.d.ts +0 -4
  74. package/dist/types/type.d.ts +0 -29
@@ -1 +1 @@
1
- import{jsx as on}from"react/jsx-runtime";function re(e){let t=typeof e.children=="function"?e.children({isPending:e.isPending}):e.children;return on("div",{"data-slot":"field-control",className:"w-full",children:t})}import{Activity as kn,useCallback as Ln,useState as En}from"react";import{jsx as oe}from"react/jsx-runtime";function ie(e){return oe("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:`size-4 transition-transform duration-200 ${e.expanded?"rotate-90":""}`,children:oe("path",{fillRule:"evenodd",d:"M8.22 5.22a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L11.94 10 8.22 6.28a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"})})}var L="input",le="input/email",ae="input/number";var se="textarea",de="radio",ce="checkbox",z="list";var ue="select",fe="select/month",me="select/year";var T="column",ge="description",U="fields",pe="label",Y="value",E="options",X="email",ye="number",xe="password",be="tel",A="text",Re="aria-errormessage",he="aria-invalid",Te="data-invalid",Ae="data-readonly",Fe="aria",Se="data",Ne="min",Ce="max",Ie="minLength",ve="maxLength",b="$ref";var ke="type";function a(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function f(e){return m(e)||typeof e=="number"||ln(e)}function m(e){return typeof e=="string"}function ln(e){return typeof e=="boolean"}function Le(e,t=Y){if(e!=null){if(f(e))return e;if(a(e)){let n=an(e,t);if(f(n))return n}}}function an(e,t){let n=d(e,t);if(f(n))return n}function d(e,t){if(!t||!a(e))return null;let n=t.split(".").filter(o=>o!=="");if(n.length===0)return null;let r=e;for(let o of n)if(a(r)&&o in r)r=r[o];else return null;return r}function Ee(e,t={description:ge,label:pe,value:Y}){return e.map(n=>{if(a(n)){let r=d(n,t.label),o=d(n,t.value);if(f(r)&&f(o)){let i=d(n,t.description);return{label:`${r}`,value:`${o}`,...f(i)&&{description:`${i}`}}}}return n})}function we(e=A){if(e){let t=e.lastIndexOf("/"),n=t===-1?e:e.slice(t+1);if(n&&n!==L)return n.trim().toLowerCase()}return A}var sn=/\[([^\]]{1,500})\]\(([^)]{1,2000})\)/g;function H(e,t={}){if(m(e))return dn(e,t);if(Array.isArray(e))return e.map(n=>H(n,t));if(a(e)){let n={};for(let r in e)n[r]=H(e[r],t);return n}return e}function w(e,t={}){return K(e)?H(e,t):e}function K(e){return m(e)?/{([^}]{1,200})}/.test(e):Array.isArray(e)?e.some(t=>K(t)):a(e)?Object.values(e).some(t=>K(t)):!1}function dn(e,t={}){return e.replace(/{([^}]{1,200})}/g,(n,r)=>{let o=r.includes(".")?d(t,r):t[r];return f(o)?String(o):n})}function Pe(e,t){if(!m(e)||!e||e.trim().length===0)return null;let n,r=0,o=!1,i=[];for(;(n=sn.exec(e))!==null;){let[l,s,nn]=n,k=n.index;o=!0,k>r&&i.push(e.substring(r,k));let rn=t?t(k,nn,s):l;i.push(rn),r=k+l.length}return o?(r<e.length&&i.push(e.substring(r)),i):e}var Oe=e=>u(fe)(e),Me=e=>u(me)(e),c=u(ce),De=u(L),y=u(de),g=u(ue),_e=u(se),Ve=u(A,X,xe,be),wr=u(le,X),Be=u(ae,ye);function Ge(e){return y(e)||c(e)}function $e(e){return e.type===z}function R(e){return e.type===T}function P(e){return e.type!==T&&e.type!==z}function W(e){return g(e)||y(e)}function q(e){return e!=null&&e!==""}function u(...e){return t=>{let n=m(t.type)?t.type:void 0;return n?e.some(r=>n===r||n?.startsWith(`${r}/`)):!1}}function ze(e,t={}){if(g(e)&&e.disabled){let n=e.name?t?.[e.name]:void 0;if(n&&a(n))return[n]}}function Ue(e){return y(e)||c(e)?!0:e.advanced?.horizontal??!1}function Ye(e){return c(e)?e.advanced?.reverse!==!1:!1}function Xe(e,t){let n=e.readonly??!1;return t||n}function He(e){if(y(e)||g(e)&&!e.disabled){let t=e.source;if(Array.isArray(t)||a(t)&&!(b in t))return t}}var cn=/^\d+$/;function Ke(){return Array.from({length:12},(e,t)=>({value:(t+1).toString(),label:new Date(0,t).toLocaleString("default",{month:"long"})}))}function We(e,t){return t>=e?Array.from({length:t-e+1},(n,r)=>{let o=e+r;return{value:o.toString(),label:o.toString()}}):[]}function Z(){return new Date().getFullYear()}function J(e,t){if(typeof e=="number")return e;let n=t??Z(),r=e.trim().toLowerCase();if(r.startsWith("current")){let o=r.match(/^current([+-])(\d+)$/);if(o){let[,i,l]=o,s=parseInt(l,10);if(!isNaN(s))return i==="+"?n+s:n-s}return n}return cn.test(r)?parseInt(r,10):n}var O=Z();function un(e){if(g(e))return fn(e)}function fn(e){if(Oe(e))return Ke();if(Me(e)){let t=e.advanced?.length?.min??O,n=e.advanced?.length?.max??O+5;return We(J(t,O),J(n,O))}}function qe(e,t=!1){let n={disabled:t,id:e.name,name:e.name,placeholder:e.placeholder,required:e.required};return De(e)?{...n,...mn(e)}:g(e)?{...n,...gn(e)}:_e(e)?{...n,...pn(e)}:n}function mn(e){let t=we(e.type),n={...e,type:t};return{...Ze(e),...yn(n),...Ve(n)?Je(n):{},type:t}}function gn(e){let t=un(e);return t?{options:t}:{}}function pn(e){return{...Ze(e),...Je(e)}}function Ze(e){let t=e.advanced?.autocomplete;return t?{autoComplete:t}:{}}function yn(e){return Be(e)?xn(e):{}}function Je(e){return Qe(e,{min:Ie,max:ve})}function xn(e){return Qe(e,{min:Ne,max:Ce})}function Qe(e,t){let n={},r=e.advanced?.length;return r&&(r.min!==void 0&&(n[t.min]=r.min),r.max!==void 0&&(n[t.max]=r.max)),n}function je(e,t){let n=He(e);return n||ze(e,t)}function bn(e,t){let n=a(t)&&e.name in t?t[e.name]:t;return Le(n,e.advanced?.entity)}function Rn(e,t,n){return W(e)&&Array.isArray(n)?{...t,[E]:n}:t}function hn(e,t,n){if(e.required&&!q(n)&&g(e)&&e.advanced?.preselected!==!1&&E in t){let r=t[E];if(Array.isArray(r)&&r.length===1)return r[0]}return n}function Tn(e,t){return W(e)&&Array.isArray(t)?Ee(t,e.advanced?.options):t}function et(e,t,n,r){let o=bn(e,r),i=Array.isArray(n)?Tn(e,n):n,l=Rn(e,t,i),s=hn(e,l,o);return{commonPropsWithOptions:l,defaultValue:s}}function tt(e,t){return c(e)?{defaultChecked:q(t)}:{defaultValue:t}}var An=/^#\/definition\//;function D(e=[],t){let n=M(e,t);return Array.isArray(n)?n.filter(Sn).sort((r,o)=>nt(r)-nt(o)):[]}function M(e,t,n=new Map,r=new WeakSet){if(!Fn(t)||!e||typeof e!="object")return e;if(n.has(e))return n.get(e);if(r.has(e))return e;if(r.add(e),Array.isArray(e))return e.map(i=>M(i,t,n,r));if(b in e&&m(e[b])){let i=e[b].replace(An,""),l=d(t,i);return l!==null?M(l,t,n,r):e}let o={};for(let[i,l]of Object.entries(e))o[i]=M(l,t,n,r);return r.delete(e),n.set(e,o),o}function rt(e){return Object.entries(e??{})}function nt(e){return e.order??Number.MAX_VALUE}function Fn(e){return e!==void 0&&a(e)&&Object.keys(e).length>0}function Sn(e){return ke in e?!0:Array.isArray(e[U])?e[U].length>0:!0}function ot(e,t){let n={};for(let[r,o]of rt(t))n[`${e}-${r}`]=o;return n}function Nn(e){return ot(Fe,e)}function Cn(e){return ot(Se,e)}function it(e,t){let n=Nn(e.advanced?.aria);return t&&t.length>0&&(n[he]="true",n[Re]=`${e.name}-error`),n}function lt(e){return Cn(e.advanced?.data)}var at={1:"md:grid-cols-1",2:"md:grid-cols-2",3:"md:grid-cols-3"},st={1:"md:col-span-1",2:"md:col-span-2",3:"md:col-span-3"};function dt(e,t=2){return at[e&&e in at?e:t]}function ct(e){if(e&&e in st)return st[e]}function In(e,t){let n=e.advanced?.length?.min??1;if(t){let r=d(t,e.name);if(Array.isArray(r))return Math.max(r.length,n)}return Math.max(n,0)}function ut(e){return!Array.isArray(e.fields)||e.fields.length===0?!1:e.fields.length>1||e.fields[0].type===T}function ft(e,t){let n=In(e,t);return Array.from({length:n},(r,o)=>o)}function mt(e){return e.label??e.name}function h(e,t){return e?t?t[e]??e:e:""}function _(e,t){return{...e,...t}}import{jsx as vn}from"react/jsx-runtime";function p(e){return Pe(e,(t,n,r)=>vn("a",{className:"underline",href:n,rel:"noopener noreferrer",target:"_blank",children:r},`${n}-${t}`))}import{jsx as F,jsxs as Q}from"react/jsx-runtime";function gt(e){let{fields:t=[]}=e.section,[n,r]=En(!1),o=Ln(()=>r(i=>!i),[]);return Q("fieldset",{"data-slot":"field-set","data-advanced":"true","data-expanded":n,"data-empty":t.length===0,className:"flex flex-col",id:e.section.id?.toString(),children:[F("legend",{children:Q("button",{className:"flex cursor-pointer items-center gap-2 text-base font-medium text-slate-600 dark:text-slate-400",onClick:o,type:"button",children:[F(ie,{expanded:n}),F("span",{children:p(e.section.title)})]})}),F(kn,{mode:n?"visible":"hidden",children:Q("div",{className:"mt-3 ml-1.5 flex flex-col gap-4 border-l-2 border-slate-300 pl-4 dark:border-slate-600","data-slot":"field-set-content",children:[e.section.description&&F("p",{className:"text-sm leading-normal font-normal text-slate-600 dark:text-slate-400",children:p(e.section.description)}),e.group]})})]})}import{Fragment as wn,jsx as pt,jsxs as Pn}from"react/jsx-runtime";function yt(e){return Pn(wn,{children:[e.title&&pt("legend",{className:"mb-3 font-medium text-slate-800 dark:text-slate-200",children:p(e.title)}),e.description&&pt("p",{className:"-mt-2 text-sm leading-normal font-normal text-slate-600 dark:text-slate-400",children:p(e.description)})]})}import{jsx as On,jsxs as Mn}from"react/jsx-runtime";function V(e){return Mn("fieldset",{"data-slot":"field-set","data-empty":e.empty,className:"flex flex-col data-[empty=false]:gap-6",id:e.id,children:[On(yt,{description:e.description,title:e.title}),e.children]})}import{jsx as Dn}from"react/jsx-runtime";function x(e){return Dn("div",{"data-slot":"field-group","data-compact":e.compact,className:"flex w-full flex-col gap-8 data-[compact=true]:gap-3",children:e.children})}import{jsx as j}from"react/jsx-runtime";function xt(e){let{fields:t=[]}=e.section,{compact:n}=_(e.style,{compact:e.section.compact}),r=j(x,{compact:n,children:e.children});return!e.section.title&&!e.section.description?r:e.section.advanced?j(gt,{section:e.section,group:r}):j(V,{description:e.section.description,empty:t.length===0,id:e.section.id?.toString(),title:e.section.title,children:r})}import{useAtomValue as Un}from"jotai";import{atom as S}from"jotai";import{atomFamily as _n}from"jotai-family";import{deepEqual as bt}from"fast-equals";function Vn(e,t){let{[t]:n,...r}=e;return r}function Bn(e){return _n(t=>S(n=>n(e)[t]??void 0,(n,r,o)=>{let i=n(e);if(o!=null){let l=i[t];(!l||!bt(l,o))&&r(e,{...i,[t]:o})}else i[t]&&r(e,Vn(i,t))}))}function Gn(e){return S(null,(t,n)=>{let r=t(e);r&&Object.keys(r).length>0&&n(e,{})})}function $n(e){return S(null,(t,n,r)=>{let i={...t(e)},l=!1;for(let s of r)i[s]&&(delete i[s],l=!0);l&&n(e,i)})}function zn(e){return S(null,(t,n,r)=>{let o=t(e);bt(o,r)||n(e,r)})}function Rt(e={}){let t=S(e);return{atom:t,clearAll:Gn(t),clear:$n(t),bulkReport:zn(t),report:Bn(t)}}var ht=Rt(),Tt=ht.atom,Po=ht.report;function Yn(e,t){return e.fields.every(n=>At(n,t))}function At(e,t){return t[e.name]?.hidden??e.hidden??!1}function Xn(e,t){return R(e)?Yn(e,t):At(e,t)}function Ft(e){let t=Un(Tt);return e.container&&(t[e.container.name]?.hidden??e.container.hidden??!1)||e.fields.length===0||e.fields.every(r=>Xn(r,t))?null:e.children}import{jsx as St}from"react/jsx-runtime";function Nt(){return St("div",{"data-slot":"field-separator",className:"relative -my-2 h-5 text-sm",children:St("div",{className:"absolute inset-0 top-1/2 h-px w-full bg-slate-200 dark:bg-slate-800"})})}import{jsx as N,jsxs as Ct}from"react/jsx-runtime";function It(e){let t=D(e.sections,e.definition);return N("div",{className:"h-full w-full",children:N("form",{noValidate:e.noValidate,action:e.action,children:Ct(x,{children:[t.map((n,r)=>Ct(Ft,{fields:n.fields??[],children:[N(xt,{section:n,style:e.config.style,children:e.children({disabled:e.readOnly,fields:n.fields})}),n.separator&&N(Nt,{})]},r)),e.control&&N(re,{isPending:e.isPending,children:e.control})]})})})}import{jsx as Hn}from"react/jsx-runtime";function vt(e){return Hn("p",{className:"-mt-2 text-xs leading-normal font-normal text-slate-600 dark:text-slate-400",children:e.children})}import{jsx as Kn}from"react/jsx-runtime";function B(e){let t={context:e.context,env:e.config?.env},n=h(w(e.text,t),e.translations),r=p(n);return r?Kn(vt,{children:r}):null}import{twMerge as Wn}from"tailwind-merge";import{jsx as qn,jsxs as Zn}from"react/jsx-runtime";function kt(e){let t=e.style?.showOptionalLabel??!0,n=y(e.field)||c(e.field);return Zn("label",{"data-slot":"field-label","data-normal":n,className:Wn("flex w-fit items-center gap-2 text-sm leading-snug font-medium select-none","data-[normal=true]:font-normal","group-data-[readonly=true]:cursor-not-allowed group-data-[readonly=true]:opacity-50"),htmlFor:e.field.name,children:[e.children,t&&!e.field.required&&qn("span",{className:"text-sm text-slate-600 dark:text-slate-400",children:h("(Optional)",e.translations)})]})}import{jsx as Lt,jsxs as Jn}from"react/jsx-runtime";function Et(e){let t={context:e.context,env:e.config?.env},n=w(e.field.label,t);return Jn("div",{"data-slot":"field-content",className:"flex w-full flex-1 flex-col gap-1.5 leading-snug",children:[Lt(kt,{field:e.field,style:e.config?.style,translations:e.translations,children:h(n,e.translations)}),e.horizontal===!0&&Lt(B,{config:e.config,context:e.context,text:e.field.description,translations:e.translations})]})}import{Fragment as Qn,jsx as wt,jsxs as jn}from"react/jsx-runtime";function Pt(e){return jn(Qn,{children:[e.field.name&&e.field.label&&wt(Et,{config:e.config,context:e.context,field:e.field,horizontal:e.horizontal,translations:e.translations}),e.children,e.horizontal===!1&&wt(B,{config:e.config,context:e.context,text:e.field.description,translations:e.translations})]})}function Ot(e,t){return e?t(e):null}import{jsx as Mt}from"react/jsx-runtime";function Dt(e){let t=je(e.field,e.value),{commonPropsWithOptions:n,defaultValue:r}=et(e.field,e.commonProps,t,e.value),o=tt(e.field,r);return Ot(e.config.inputs[e.field.type],i=>Mt(Pt,{config:e.config,context:e.context,field:e.field,horizontal:e.horizontal,translations:e.translations,children:Mt(i,{...e.ariaAttributes,...n,...e.dataAttributes,...o})}))}import{jsx as _t}from"react/jsx-runtime";function Vt(e){return!e.errors||e.errors.length===0?null:_t("ul",{className:"text-sm text-red-600 dark:text-red-500",id:e.name?`${e.name}-error`:void 0,children:e.errors?.map((t,n)=>_t("li",{children:t},e.name?`${e.name}-error-${n}`:n))})}import{twMerge as er}from"tailwind-merge";import{jsx as tr}from"react/jsx-runtime";function G(e){let t=e.errors&&e.errors.length>0;return tr("div",{"data-slot":"field","data-clickable":e.isClickable?"true":"false",...t&&{[Te]:"true"},...e.disabled&&{[Ae]:"true"},"data-orientation":e.orientation,className:er("group flex w-full flex-col items-center data-[invalid=true]:text-red-600 data-[invalid=true]:dark:text-red-500","data-[clickable=true]:items-start",e.isCheckbox&&(e.isReversed?"flex-row-reverse!":"flex-row!"),"data-[clickable=true]:has-[>[data-slot=field-content]]:[&>:first-child]:mt-px",e.className),children:e.children})}import{twMerge as nr}from"tailwind-merge";import{jsx as rr}from"react/jsx-runtime";function Bt(e){return rr(G,{...e,orientation:"vertical",className:nr("gap-3 has-[>[data-slot=field-content]]:items-start",!e.isClickable&&"[&>*]:w-full"),children:e.children})}import{twMerge as or}from"tailwind-merge";import{jsx as ir}from"react/jsx-runtime";function Gt(e){return ir(G,{...e,orientation:"horizontal",className:or("gap-2 md:flex-row md:gap-4","[&>[data-slot=field-content]]:min-w-0 [&>[data-slot=field-content]]:flex-grow [&>[data-slot=field-content]]:self-start","[&_[role=checkbox]]:mt-[1.5px]",e.isClickable&&"md:flex-col",!e.isClickable&&["md:justify-between","[&>*:not([data-slot=field-content])]:w-full","[&>*:not([data-slot=field-content])]:md:w-1/2","[&>*:not([data-slot=field-content])]:xl:w-2/5"]),children:e.children})}import{jsx as $t}from"react/jsx-runtime";function zt(e){let t=Ge(e.field),n=c(e.field),r=Ye(e.field);return e.horizontal?$t(Gt,{disabled:e.disabled,errors:e.errors,isCheckbox:n,isReversed:r,isClickable:t,children:e.children}):$t(Bt,{disabled:e.disabled,errors:e.errors,isCheckbox:n,isReversed:r,isClickable:t,children:e.children})}function Ut(e){if(!e.field.type)return null;let t=qe(e.field,e.disabled),n=lt(e.field),r=it(e.field,e.errors),o={...e.field,disabled:t.disabled};return e.children({ariaAttributes:r,commonProps:t,dataAttributes:n,field:o,horizontal:e.horizontal})}import{twMerge as lr}from"tailwind-merge";import{jsx as ee,jsxs as ar}from"react/jsx-runtime";function Yt(e){let t=e.field.advanced?.cols,n=e.field.name?e.errors?.[e.field.name]:void 0,{horizontal:r}=_(e.style,{horizontal:Ue(e.field)}),o=Xe(e.field,e.disabled);return ar("div",{className:lr("flex flex-col gap-3",ct(t)),children:[ee(zt,{disabled:o,errors:n,field:e.field,horizontal:r,children:ee(Ut,{disabled:o,errors:n,field:e.field,horizontal:r,children:e.children})}),ee(Vt,{errors:n,name:e.field.name})]})}import{twMerge as sr}from"tailwind-merge";import{jsx as C,jsxs as $}from"react/jsx-runtime";function Xt(e){function t(){e.canRemove&&e.onRemove&&e.onRemove(e.index)}let n=e.canRemove&&e.onRemove!=null&&C("button",{"aria-label":`Remove ${e.label} item ${e.index+1}`,className:sr("rounded p-1 text-xl text-slate-400","transition-colors duration-150","hover:text-red-500","focus-visible:ring-2 focus-visible:ring-slate-400 focus-visible:outline-none","dark:text-slate-500 dark:hover:text-red-400"),onClick:t,type:"button",children:C("span",{"aria-hidden":"true",children:"\xD7"})});return e.isMultiField?$("div",{className:"rounded-lg border border-slate-100 p-4 dark:border-slate-900",children:[$("div",{className:"mb-3 flex items-center justify-between",children:[$("span",{className:"text-sm font-medium text-slate-400 dark:text-slate-500",children:[e.label," ",e.index+1]}),n]}),C(x,{children:e.children})]}):$("div",{className:"flex items-start gap-2",children:[C(x,{children:e.children}),n&&C("div",{className:"shrink-0",children:n})]})}import{jsx as dr}from"react/jsx-runtime";function Ht(e){let t=mt(e.field),n=ut(e.field);return ft(e.field,e.value).map(r=>dr(Xt,{index:r,isMultiField:n,label:t,children:e.children(r)},r))}import{jsx as cr}from"react/jsx-runtime";function Kt(e){let t=Array.isArray(e.field.fields)&&e.field.fields.length===0;return cr(V,{description:e.field.description,empty:t,id:e.field.name,title:e.field.label,children:e.children})}import{jsx as Wt}from"react/jsx-runtime";function qt({children:e,field:t,value:n}){return Wt(Kt,{field:t,children:Wt(Ht,{field:t,value:n,children:e})})}import{twMerge as ur}from"tailwind-merge";import{jsx as Zt}from"react/jsx-runtime";function Jt(e){let t=dt(e.column?.advanced?.cols);return Zt("div",{className:"flex w-full flex-col gap-4",children:Zt("div",{className:ur("grid grid-cols-1 gap-3 sm:gap-4",t),children:e.children})})}import{Fragment as mr}from"react";import{jsx as fr}from"react/jsx-runtime";function Qt(e){let t=Array.isArray(e.field.fields)?e.field.fields.map(n=>P(n)?{...n,name:`${e.field.name}.${e.index}.${n.name}`}:R(n)?{...n,fields:n.fields.map(r=>({...r,name:`${e.field.name}.${e.index}.${r.name}`}))}:n):[];return fr(I,{children:e.children,components:e.components,disabled:e.disabled,fields:t,style:e.style,value:e.value})}import{jsx as v,jsxs as gr}from"react/jsx-runtime";function I(e){let{field:t,list:n}=e.components;return D(e.fields).map((r,o)=>gr(mr,{children:[R(r)&&v(Jt,{column:r,children:v(I,{...e,fields:r.fields})}),P(r)&&v(t,{disabled:e.disabled,field:r,style:e.style,children:e.children}),$e(r)&&v(n,{field:r,value:e.value,children:i=>v(Qt,{children:e.children,components:e.components,disabled:e.disabled,field:r,index:i,style:e.style,value:e.value})})]},o))}import{jsx as pr}from"react/jsx-runtime";function jt(e){return n=>pr(I,{...n,components:e})}var en=jt({field:Yt,list:qt});import{jsx as te}from"react/jsx-runtime";function ne(e){let t=e.translations?.[e.lang??""];return te(It,{config:e.config,control:e.children,definition:e.definition,readOnly:e.readOnly,sections:e.sections,children:({disabled:n,fields:r})=>te(en,{disabled:n,fields:r,style:e.config.style,children:o=>te(Dt,{...o,config:e.config,context:e.context,translations:t,value:e.value})})})}import{Suspense as yr}from"react";import{jsx as tn}from"react/jsx-runtime";function xr(e){return tn(yr,{fallback:tn(ne,{config:e.config,sections:e.sections,readOnly:!0}),children:e.children})}export{xr as Fallback,ne as Form};
1
+ import{jsx as yn}from"react/jsx-runtime";function ce(e){let t=typeof e.children=="function"?e.children({isPending:e.isPending}):e.children;return yn("div",{"data-slot":"field-control",className:"w-full",children:t})}import{Activity as Yn,useCallback as Xn,useState as Hn}from"react";import{jsx as de}from"react/jsx-runtime";function ue(e){return de("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:`size-4 transition-transform duration-200 ${e.expanded?"rotate-90":""}`,children:de("path",{fillRule:"evenodd",d:"M8.22 5.22a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L11.94 10 8.22 6.28a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"})})}var P="input",fe="input/email",me="input/number";var ge="textarea",pe="radio",ye="checkbox",H="list";var xe="select",be="select/month",Re="select/year",Te="select/timezone";var N="column",he="description",Z="fields",Ae="label",K="value",w="options",W="email",Se="number",Ne="password",Fe="tel",F="text",Ce="aria-errormessage",Ie="aria-invalid",ve="data-invalid",Ee="data-readonly",ke="aria",Le="data",Pe="min",we="max",Oe="minLength",Me="maxLength",T="$ref";var De="type",_e={Africa:"Africa",America:"Americas",Antarctica:"Other",Arctic:"Other",Asia:"Asia / Pacific",Atlantic:"Atlantic",Australia:"Asia / Pacific",Europe:"Europe",Indian:"Asia / Pacific",Pacific:"Asia / Pacific"};function a(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function g(e){return p(e)||typeof e=="number"||xn(e)}function p(e){return typeof e=="string"}function xn(e){return typeof e=="boolean"}function Ve(e,t=K){if(e!=null){if(g(e))return e;if(a(e)){let n=bn(e,t);if(g(n))return n}}}function bn(e,t){let n=f(e,t);if(g(n))return n}function f(e,t){if(!t||!a(e))return null;let n=t.split(".").filter(o=>o!=="");if(n.length===0)return null;let r=e;for(let o of n)if(a(r)&&o in r)r=r[o];else return null;return r}function ze(e,t={description:he,label:Ae,value:K}){return e.map(n=>{if(a(n)){let r=f(n,t.label),o=f(n,t.value);if(g(r)&&g(o)){let i=f(n,t.description);return{label:`${r}`,value:`${o}`,...g(i)&&{description:`${i}`}}}}return n})}function Ge(e=F){if(e){let t=e.lastIndexOf("/"),n=t===-1?e:e.slice(t+1);if(n&&n!==P)return n.trim().toLowerCase()}return F}var Rn=/\[([^\]]{1,500})\]\(([^)]{1,2000})\)/g;function q(e,t={}){if(p(e))return Tn(e,t);if(Array.isArray(e))return e.map(n=>q(n,t));if(a(e)){let n={};for(let r in e)n[r]=q(e[r],t);return n}return e}function O(e,t={}){return J(e)?q(e,t):e}function J(e){return p(e)?/{([^}]{1,200})}/.test(e):Array.isArray(e)?e.some(t=>J(t)):a(e)?Object.values(e).some(t=>J(t)):!1}function Tn(e,t={}){return e.replace(/{([^}]{1,200})}/g,(n,r)=>{let o=r.includes(".")?f(t,r):t[r];return g(o)?String(o):n})}function $e(e,t){if(!p(e)||!e||e.trim().length===0)return null;let n,r=0,o=!1,i=[];for(;(n=Rn.exec(e))!==null;){let[l,s,c]=n,d=n.index;o=!0,d>r&&i.push(e.substring(r,d));let S=t?t(d,c,s):l;i.push(S),r=d+l.length}return o?(r<e.length&&i.push(e.substring(r)),i):e}var Be=e=>u(be)(e),Ue=e=>u(Re)(e),Ye=e=>u(Te)(e),m=u(ye),Xe=u(P),b=u(pe),y=u(xe),He=u(ge),Ze=u(F,W,Ne,Fe),Zr=u(fe,W),Ke=u(me,Se);function We(e){return b(e)||m(e)}function qe(e){return e.type===H}function h(e){return e.type===N}function M(e){return e.type!==N&&e.type!==H}function Q(e){return y(e)||b(e)}function j(e){return e!=null&&e!==""}function u(...e){return t=>{let n=p(t.type)?t.type:void 0;return n?e.some(r=>n===r||n?.startsWith(`${r}/`)):!1}}function Je(e,t={}){if(y(e)&&e.disabled){let n=e.name?t?.[e.name]:void 0;if(n&&a(n))return[n]}}function Qe(e){return b(e)||m(e)?!0:e.advanced?.horizontal??!1}function je(e){return m(e)?e.advanced?.reverse!==!1:!1}function et(e,t){let n=e.readonly??!1;return t||n}function tt(e){if(b(e)||y(e)&&!e.disabled){let t=e.source;if(Array.isArray(t)||a(t)&&!(T in t))return t}}var hn=/^\d+$/,An=()=>"supportedValuesOf"in Intl?Intl.supportedValuesOf("timeZone"):[];function ot(){return Array.from({length:12},(e,t)=>({value:(t+1).toString(),label:new Date(0,t).toLocaleString("default",{month:"long"})}))}function it(e,t){return t>=e?Array.from({length:t-e+1},(n,r)=>{let o=e+r;return{value:o.toString(),label:o.toString()}}):[]}function ee(){return new Date().getFullYear()}function Sn(){return Intl.DateTimeFormat().resolvedOptions().timeZone}function Nn(e){let t=e.indexOf("/"),n=t===-1?e:e.slice(0,t);return _e[n]??"Other"}function Fn(e,t){return(e.find(r=>r.type==="timeZoneName")?.value??t).replace(/\s+(?:Standard|Daylight(?: Saving)?|Summer|Winter)\s+Time$/,"")}function nt(e,t){let n=new Intl.DateTimeFormat("en",{timeZone:e,timeZoneName:"longOffset"}).formatToParts(t),r=new Intl.DateTimeFormat("en",{timeZone:e,timeZoneName:"long"}).formatToParts(t),i=(n.find(s=>s.type==="timeZoneName")?.value??"GMT+00:00").replace("GMT","UTC"),l=Fn(r,e);return{offset:i,longName:l}}function rt(e){return e.slice(e.lastIndexOf("/")+1).replace(/_/g," ")}var D=null;function lt(){if(D)return D;let e=new Date,t=Sn(),n=new Map,r=rt(t),{offset:o,longName:i}=nt(t,e),l={value:t,label:`${r} - ${i} (${o})`};for(let c of An()){if(c===t)continue;let d=rt(c),{offset:S,longName:pn}=nt(c,e),ae={value:c,label:`${d} - ${pn} (${S})`},X=Nn(c);if(X==="Other")continue;let se=n.get(X);se?se.push(ae):n.set(X,[ae])}for(let c of n.values())c.sort((d,S)=>d.label.localeCompare(S.label));let s=Array.from(n.entries()).sort(([c],[d])=>c.localeCompare(d)).map(([c,d])=>({label:c,items:d}));return D=[{label:"Suggested",items:[l]},...s],D}function te(e,t){if(typeof e=="number")return e;let n=t??ee(),r=e.trim().toLowerCase();if(r.startsWith("current")){let o=r.match(/^current([+-])(\d+)$/);if(o){let[,i,l]=o,s=parseInt(l,10);if(!isNaN(s))return i==="+"?n+s:n-s}return n}return hn.test(r)?parseInt(r,10):n}var _=ee();function Cn(e){if(y(e))return In(e)}function In(e){if(Be(e))return ot();if(Ue(e)){let t=e.advanced?.length?.min??_,n=e.advanced?.length?.max??_+5;return it(te(t,_),te(n,_))}if(Ye(e))return lt()}function at(e,t=!1){let n={disabled:t,id:e.name,name:e.name,placeholder:e.placeholder,required:e.required};return Xe(e)?{...n,...vn(e)}:y(e)?{...n,...En(e)}:He(e)?{...n,...kn(e)}:n}function vn(e){let t=Ge(e.type),n={...e,type:t};return{...st(e),...Ln(n),...Ze(n)?ct(n):{},type:t}}function En(e){let t=Cn(e);return t?{options:t}:{}}function kn(e){return{...st(e),...ct(e)}}function st(e){let t=e.advanced?.autocomplete;return t?{autoComplete:t}:{}}function Ln(e){return Ke(e)?Pn(e):{}}function ct(e){return dt(e,{min:Oe,max:Me})}function Pn(e){return dt(e,{min:Pe,max:we})}function dt(e,t){let n={},r=e.advanced?.length;return r&&(r.min!==void 0&&(n[t.min]=r.min),r.max!==void 0&&(n[t.max]=r.max)),n}function ut(e,t){let n=tt(e);return n||Je(e,t)}function wn(e,t){let n=a(t)&&e.name in t?t[e.name]:t;return Ve(n,e.advanced?.entity)}function On(e,t,n){return Q(e)&&Array.isArray(n)?{...t,[w]:n}:t}function Mn(e,t,n){if(e.required&&!j(n)&&y(e)&&e.advanced?.preselected!==!1&&w in t){let r=t[w];if(Array.isArray(r)&&r.length===1)return r[0]}return n}function Dn(e,t){return Q(e)&&Array.isArray(t)?ze(t,e.advanced?.options):t}function ft(e,t,n,r){let o=wn(e,r),i=Array.isArray(n)?Dn(e,n):n,l=On(e,t,i),s=Mn(e,l,o);return{commonPropsWithOptions:l,defaultValue:s}}function mt(e,t){return m(e)?{defaultChecked:j(t)}:{defaultValue:t}}var _n=/^#\/definition\//;function z(e=[],t){let n=V(e,t);return Array.isArray(n)?n.filter(zn).sort((r,o)=>gt(r)-gt(o)):[]}function V(e,t,n=new Map,r=new WeakSet){if(!Vn(t)||!e||typeof e!="object")return e;if(n.has(e))return n.get(e);if(r.has(e))return e;if(r.add(e),Array.isArray(e))return e.map(i=>V(i,t,n,r));if(T in e&&p(e[T])){let i=e[T].replace(_n,""),l=f(t,i);return l!==null?V(l,t,n,r):e}let o={};for(let[i,l]of Object.entries(e))o[i]=V(l,t,n,r);return r.delete(e),n.set(e,o),o}function pt(e){return Object.entries(e??{})}function gt(e){return e.order??Number.MAX_VALUE}function Vn(e){return e!==void 0&&a(e)&&Object.keys(e).length>0}function zn(e){return De in e?!0:Array.isArray(e[Z])?e[Z].length>0:!0}function yt(e,t){let n={};for(let[r,o]of pt(t))n[`${e}-${r}`]=o;return n}function Gn(e){return yt(ke,e)}function $n(e){return yt(Le,e)}function xt(e,t){let n=Gn(e.advanced?.aria);return t&&t.length>0&&(n[Ie]="true",n[Ce]=`${e.name}-error`),n}function bt(e){return $n(e.advanced?.data)}var Rt={1:"md:grid-cols-1",2:"md:grid-cols-2",3:"md:grid-cols-3"},Tt={1:"md:col-span-1",2:"md:col-span-2",3:"md:col-span-3"};function ht(e,t=2){return Rt[e&&e in Rt?e:t]}function At(e){if(e&&e in Tt)return Tt[e]}function Bn(e,t){let n=e.advanced?.length?.min??1;if(t){let r=f(t,e.name);if(Array.isArray(r))return Math.max(r.length,n)}return Math.max(n,0)}function St(e){return!Array.isArray(e.fields)||e.fields.length===0?!1:e.fields.length>1||e.fields[0].type===N}function Nt(e,t){let n=Bn(e,t);return Array.from({length:n},(r,o)=>o)}function Ft(e){return e.label??e.name}function A(e,t){return e?t?t[e]??e:e:""}function G(e,t){return{...e,...t}}import{jsx as Un}from"react/jsx-runtime";function x(e){return $e(e,(t,n,r)=>Un("a",{className:"underline",href:n,rel:"noopener noreferrer",target:"_blank",children:r},`${n}-${t}`))}import{jsx as C,jsxs as ne}from"react/jsx-runtime";function Ct(e){let{fields:t=[]}=e.section,[n,r]=Hn(!1),o=Xn(()=>r(i=>!i),[]);return ne("fieldset",{"data-slot":"field-set","data-advanced":"true","data-expanded":n,"data-empty":t.length===0,className:"flex flex-col",id:e.section.id?.toString(),children:[C("legend",{children:ne("button",{className:"flex cursor-pointer items-center gap-2 text-base font-medium text-slate-600 dark:text-slate-400",onClick:o,type:"button",children:[C(ue,{expanded:n}),C("span",{children:x(e.section.title)})]})}),C(Yn,{mode:n?"visible":"hidden",children:ne("div",{className:"mt-3 ml-1.5 flex flex-col gap-4 border-l-2 border-slate-300 pl-4 dark:border-slate-600","data-slot":"field-set-content",children:[e.section.description&&C("p",{className:"text-sm leading-normal font-normal text-slate-600 dark:text-slate-400",children:x(e.section.description)}),e.group]})})]})}import{Fragment as Zn,jsx as It,jsxs as Kn}from"react/jsx-runtime";function vt(e){return Kn(Zn,{children:[e.title&&It("legend",{className:"mb-3 font-medium text-slate-800 dark:text-slate-200",children:x(e.title)}),e.description&&It("p",{className:"-mt-2 text-sm leading-normal font-normal text-slate-600 dark:text-slate-400",children:x(e.description)})]})}import{jsx as Wn,jsxs as qn}from"react/jsx-runtime";function $(e){return qn("fieldset",{"data-slot":"field-set","data-empty":e.empty,className:"flex flex-col data-[empty=false]:gap-6",id:e.id,children:[Wn(vt,{description:e.description,title:e.title}),e.children]})}import{jsx as Jn}from"react/jsx-runtime";function R(e){return Jn("div",{"data-slot":"field-group","data-compact":e.compact,className:"flex w-full flex-col gap-8 data-[compact=true]:gap-3",children:e.children})}import{jsx as re}from"react/jsx-runtime";function Et(e){let{fields:t=[]}=e.section,{compact:n}=G(e.style,{compact:e.section.compact}),r=re(R,{compact:n,children:e.children});return!e.section.title&&!e.section.description?r:e.section.advanced?re(Ct,{section:e.section,group:r}):re($,{description:e.section.description,empty:t.length===0,id:e.section.id?.toString(),title:e.section.title,children:r})}import{useAtomValue as or}from"jotai";import{atom as I}from"jotai";import{atomFamily as Qn}from"jotai-family";import{deepEqual as kt}from"fast-equals";function jn(e,t){let{[t]:n,...r}=e;return r}function er(e){return Qn(t=>I(n=>n(e)[t]??void 0,(n,r,o)=>{let i=n(e);if(o!=null){let l=i[t];(!l||!kt(l,o))&&r(e,{...i,[t]:o})}else i[t]&&r(e,jn(i,t))}))}function tr(e){return I(null,(t,n)=>{let r=t(e);r&&Object.keys(r).length>0&&n(e,{})})}function nr(e){return I(null,(t,n,r)=>{let i={...t(e)},l=!1;for(let s of r)i[s]&&(delete i[s],l=!0);l&&n(e,i)})}function rr(e){return I(null,(t,n,r)=>{let o=t(e);kt(o,r)||n(e,r)})}function Lt(e={}){let t=I(e);return{atom:t,clearAll:tr(t),clear:nr(t),bulkReport:rr(t),report:er(t)}}var Pt=Lt(),wt=Pt.atom,Wo=Pt.report;function ir(e,t){return e.fields.every(n=>Ot(n,t))}function Ot(e,t){return t[e.name]?.hidden??e.hidden??!1}function lr(e,t){return h(e)?ir(e,t):Ot(e,t)}function Mt(e){let t=or(wt);return e.container&&(t[e.container.name]?.hidden??e.container.hidden??!1)||e.fields.length===0||e.fields.every(r=>lr(r,t))?null:e.children}import{jsx as Dt}from"react/jsx-runtime";function _t(){return Dt("div",{"data-slot":"field-separator",className:"relative -my-2 h-5 text-sm",children:Dt("div",{className:"absolute inset-0 top-1/2 h-px w-full bg-slate-200 dark:bg-slate-800"})})}import{jsx as v,jsxs as Vt}from"react/jsx-runtime";function zt(e){let t=z(e.sections,e.definition);return v("div",{className:"h-full w-full",children:v("form",{noValidate:e.noValidate,action:e.action,children:Vt(R,{children:[t.map((n,r)=>Vt(Mt,{fields:n.fields??[],children:[v(Et,{section:n,style:e.config.style,children:e.children({disabled:e.readOnly,fields:n.fields})}),n.separator&&v(_t,{})]},r)),e.control&&v(ce,{isPending:e.isPending,children:e.control})]})})})}import{jsx as ar}from"react/jsx-runtime";function Gt(e){return ar("p",{className:"-mt-2 text-xs leading-normal font-normal text-slate-600 dark:text-slate-400",children:e.children})}import{jsx as sr}from"react/jsx-runtime";function B(e){let t={context:e.context,env:e.config?.env},n=A(O(e.text,t),e.translations),r=x(n);return r?sr(Gt,{children:r}):null}import{twMerge as cr}from"tailwind-merge";import{jsx as dr,jsxs as ur}from"react/jsx-runtime";function $t(e){let t=e.style?.showOptionalLabel??!0,n=b(e.field)||m(e.field);return ur("label",{"data-slot":"field-label","data-normal":n,className:cr("flex w-fit items-center gap-2 text-sm leading-snug font-medium select-none","data-[normal=true]:font-normal","group-data-[readonly=true]:cursor-not-allowed group-data-[readonly=true]:opacity-50"),htmlFor:e.field.name,children:[e.children,t&&!e.field.required&&dr("span",{className:"text-sm text-slate-600 dark:text-slate-400",children:A("(Optional)",e.translations)})]})}import{jsx as Bt,jsxs as fr}from"react/jsx-runtime";function Ut(e){let t={context:e.context,env:e.config?.env},n=O(e.field.label,t);return fr("div",{"data-slot":"field-content",className:"flex w-full flex-1 flex-col gap-1.5 leading-snug",children:[Bt($t,{field:e.field,style:e.config?.style,translations:e.translations,children:A(n,e.translations)}),e.horizontal===!0&&Bt(B,{config:e.config,context:e.context,text:e.field.description,translations:e.translations})]})}import{Fragment as mr,jsx as Yt,jsxs as gr}from"react/jsx-runtime";function Xt(e){return gr(mr,{children:[e.field.name&&e.field.label&&Yt(Ut,{config:e.config,context:e.context,field:e.field,horizontal:e.horizontal,translations:e.translations}),e.children,e.horizontal===!1&&Yt(B,{config:e.config,context:e.context,text:e.field.description,translations:e.translations})]})}function Ht(e,t){return e?t(e):null}import{jsx as Zt}from"react/jsx-runtime";function Kt(e){let t=ut(e.field,e.value),{commonPropsWithOptions:n,defaultValue:r}=ft(e.field,e.commonProps,t,e.value),o=mt(e.field,r);return Ht(e.config.inputs[e.field.type],i=>Zt(Xt,{config:e.config,context:e.context,field:e.field,horizontal:e.horizontal,translations:e.translations,children:Zt(i,{...e.ariaAttributes,...n,...e.dataAttributes,...o})}))}import{jsx as Wt}from"react/jsx-runtime";function qt(e){return!e.errors||e.errors.length===0?null:Wt("ul",{className:"text-sm text-red-600 dark:text-red-500",id:e.name?`${e.name}-error`:void 0,children:e.errors?.map((t,n)=>Wt("li",{children:t},e.name?`${e.name}-error-${n}`:n))})}import{twMerge as pr}from"tailwind-merge";import{jsx as yr}from"react/jsx-runtime";function U(e){let t=e.errors&&e.errors.length>0;return yr("div",{"data-slot":"field","data-clickable":e.isClickable?"true":"false",...t&&{[ve]:"true"},...e.disabled&&{[Ee]:"true"},"data-orientation":e.orientation,className:pr("group flex w-full flex-col items-center data-[invalid=true]:text-red-600 data-[invalid=true]:dark:text-red-500","data-[clickable=true]:items-start",e.isCheckbox&&(e.isReversed?"flex-row-reverse!":"flex-row!"),"data-[clickable=true]:has-[>[data-slot=field-content]]:[&>:first-child]:mt-px",e.className),children:e.children})}import{twMerge as xr}from"tailwind-merge";import{jsx as br}from"react/jsx-runtime";function Jt(e){return br(U,{...e,orientation:"vertical",className:xr("gap-3 has-[>[data-slot=field-content]]:items-start",!e.isClickable&&"[&>*]:w-full"),children:e.children})}import{twMerge as Rr}from"tailwind-merge";import{jsx as Tr}from"react/jsx-runtime";function Qt(e){return Tr(U,{...e,orientation:"horizontal",className:Rr("gap-2 md:flex-row md:gap-4","[&>[data-slot=field-content]]:min-w-0 [&>[data-slot=field-content]]:flex-grow [&>[data-slot=field-content]]:self-start","[&_[role=checkbox]]:mt-[1.5px]",e.isClickable&&"md:flex-col",!e.isClickable&&["md:justify-between","[&>*:not([data-slot=field-content])]:w-full","[&>*:not([data-slot=field-content])]:md:w-1/2","[&>*:not([data-slot=field-content])]:xl:w-2/5"]),children:e.children})}import{jsx as jt}from"react/jsx-runtime";function en(e){let t=We(e.field),n=m(e.field),r=je(e.field);return e.horizontal?jt(Qt,{disabled:e.disabled,errors:e.errors,isCheckbox:n,isReversed:r,isClickable:t,children:e.children}):jt(Jt,{disabled:e.disabled,errors:e.errors,isCheckbox:n,isReversed:r,isClickable:t,children:e.children})}function tn(e){if(!e.field.type)return null;let t=at(e.field,e.disabled),n=bt(e.field),r=xt(e.field,e.errors),o={...e.field,disabled:t.disabled};return e.children({ariaAttributes:r,commonProps:t,dataAttributes:n,field:o,horizontal:e.horizontal})}import{twMerge as hr}from"tailwind-merge";import{jsx as oe,jsxs as Ar}from"react/jsx-runtime";function nn(e){let t=e.field.advanced?.cols,n=e.field.name?e.errors?.[e.field.name]:void 0,{horizontal:r}=G(e.style,{horizontal:Qe(e.field)}),o=et(e.field,e.disabled);return Ar("div",{className:hr("flex flex-col gap-3",At(t)),children:[oe(en,{disabled:o,errors:n,field:e.field,horizontal:r,children:oe(tn,{disabled:o,errors:n,field:e.field,horizontal:r,children:e.children})}),oe(qt,{errors:n,name:e.field.name})]})}import{twMerge as Sr}from"tailwind-merge";import{jsx as E,jsxs as Y}from"react/jsx-runtime";function rn(e){function t(){e.canRemove&&e.onRemove&&e.onRemove(e.index)}let n=e.canRemove&&e.onRemove!=null&&E("button",{"aria-label":`Remove ${e.label} item ${e.index+1}`,className:Sr("rounded p-1 text-xl text-slate-400","transition-colors duration-150","hover:text-red-500","focus-visible:ring-2 focus-visible:ring-slate-400 focus-visible:outline-none","dark:text-slate-500 dark:hover:text-red-400"),onClick:t,type:"button",children:E("span",{"aria-hidden":"true",children:"\xD7"})});return e.isMultiField?Y("div",{className:"rounded-lg border border-slate-100 p-4 dark:border-slate-900",children:[Y("div",{className:"mb-3 flex items-center justify-between",children:[Y("span",{className:"text-sm font-medium text-slate-400 dark:text-slate-500",children:[e.label," ",e.index+1]}),n]}),E(R,{children:e.children})]}):Y("div",{className:"flex items-start gap-2",children:[E(R,{children:e.children}),n&&E("div",{className:"shrink-0",children:n})]})}import{jsx as Nr}from"react/jsx-runtime";function on(e){let t=Ft(e.field),n=St(e.field);return Nt(e.field,e.value).map(r=>Nr(rn,{index:r,isMultiField:n,label:t,children:e.children(r)},r))}import{jsx as Fr}from"react/jsx-runtime";function ln(e){let t=Array.isArray(e.field.fields)&&e.field.fields.length===0;return Fr($,{description:e.field.description,empty:t,id:e.field.name,title:e.field.label,children:e.children})}import{jsx as an}from"react/jsx-runtime";function sn({children:e,field:t,value:n}){return an(ln,{field:t,children:an(on,{field:t,value:n,children:e})})}import{twMerge as Cr}from"tailwind-merge";import{jsx as cn}from"react/jsx-runtime";function dn(e){let t=ht(e.column?.advanced?.cols);return cn("div",{className:"flex w-full flex-col gap-4",children:cn("div",{className:Cr("grid grid-cols-1 gap-3 sm:gap-4",t),children:e.children})})}import{Fragment as vr}from"react";import{jsx as Ir}from"react/jsx-runtime";function un(e){let t=Array.isArray(e.field.fields)?e.field.fields.map(n=>M(n)?{...n,name:`${e.field.name}.${e.index}.${n.name}`}:h(n)?{...n,fields:n.fields.map(r=>({...r,name:`${e.field.name}.${e.index}.${r.name}`}))}:n):[];return Ir(k,{children:e.children,components:e.components,disabled:e.disabled,fields:t,style:e.style,value:e.value})}import{jsx as L,jsxs as Er}from"react/jsx-runtime";function k(e){let{field:t,list:n}=e.components;return z(e.fields).map((r,o)=>Er(vr,{children:[h(r)&&L(dn,{column:r,children:L(k,{...e,fields:r.fields})}),M(r)&&L(t,{disabled:e.disabled,field:r,style:e.style,children:e.children}),qe(r)&&L(n,{field:r,value:e.value,children:i=>L(un,{children:e.children,components:e.components,disabled:e.disabled,field:r,index:i,style:e.style,value:e.value})})]},o))}import{jsx as kr}from"react/jsx-runtime";function fn(e){return n=>kr(k,{...n,components:e})}var mn=fn({field:nn,list:sn});import{jsx as ie}from"react/jsx-runtime";function le(e){let t=e.translations?.[e.lang??""];return ie(zt,{config:e.config,control:e.children,definition:e.definition,readOnly:e.readOnly,sections:e.sections,children:({disabled:n,fields:r})=>ie(mn,{disabled:n,fields:r,style:e.config.style,children:o=>ie(Kt,{...o,config:e.config,context:e.context,translations:t,value:e.value})})})}import{Suspense as Lr}from"react";import{jsx as gn}from"react/jsx-runtime";function Pr(e){return gn(Lr,{fallback:gn(le,{config:e.config,sections:e.sections,readOnly:!0}),children:e.children})}export{Pr as Fallback,le as Form};
@@ -2,6 +2,12 @@ import type { CommonProps, DataSource, Field, Nullable, Value } from '../type';
2
2
  export declare function buildOptionSelect(field: Field): {
3
3
  value: string;
4
4
  label: string;
5
+ }[] | {
6
+ label: string;
7
+ items: {
8
+ value: string;
9
+ label: string;
10
+ }[];
5
11
  }[] | undefined;
6
12
  export declare function buildCommon(field: Field, disabled?: boolean): CommonProps;
7
13
  export declare function resolveSource(field: Field, value?: Nullable<Record<string, unknown>>): DataSource | unknown[] | undefined;
@@ -36,6 +36,10 @@ export type Option = {
36
36
  label: string;
37
37
  value: string;
38
38
  };
39
+ export type OptionGroup = {
40
+ label: string;
41
+ items: Array<Option>;
42
+ };
39
43
  export type List = {
40
44
  advanced?: {
41
45
  action?: string;
@@ -13,6 +13,7 @@ export declare const DATA_TABLE = "data-table";
13
13
  export declare const SELECT = "select";
14
14
  export declare const SELECT_MONTH = "select/month";
15
15
  export declare const SELECT_YEAR = "select/year";
16
+ export declare const SELECT_TIMEZONE = "select/timezone";
16
17
  export declare const SELECTS: string[];
17
18
  export declare const COLUMN = "column";
18
19
  export declare const DESCRIPTION = "description";
@@ -42,3 +43,4 @@ export declare const STATE = "state";
42
43
  export declare const COMMON_URL = "http://luna.internal";
43
44
  export declare const HIDDEN = "hidden";
44
45
  export declare const TYPE = "type";
46
+ export declare const TIMEZONE_REGIONS: Record<string, string>;
@@ -7,4 +7,15 @@ export declare function getYear(min: number, max: number): Array<{
7
7
  label: string;
8
8
  }>;
9
9
  export declare function getCurrentYear(): number;
10
+ export declare function getUserTimezone(): string;
11
+ type TimezoneItem = {
12
+ value: string;
13
+ label: string;
14
+ };
15
+ type TimezoneGroup = {
16
+ label: string;
17
+ items: TimezoneItem[];
18
+ };
19
+ export declare function getTimezones(): TimezoneGroup[];
10
20
  export declare function getConvert(value: string | number, current?: number): number;
21
+ export {};
@@ -1,6 +1,7 @@
1
1
  import type { Column, Field, Input, List, Nullable, Select } from '../type';
2
2
  export declare const isSelectMonth: (field: Field) => boolean;
3
3
  export declare const isSelectYear: (field: Field) => boolean;
4
+ export declare const isSelectTimezone: (field: Field) => boolean;
4
5
  export declare const isCheckbox: (field: Field) => field is Input;
5
6
  export declare const isInput: (field: Field) => field is Input;
6
7
  export declare const isRadio: (field: Field) => field is Select;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-luna-form",
3
- "version": "0.0.33",
3
+ "version": "0.0.34",
4
4
  "description": "A React library for building forms based on JSON",
5
5
  "main": "./dist/client/cjs/index.js",
6
6
  "module": "./dist/client/esm/index.js",
@@ -33,7 +33,7 @@
33
33
  "eslint-plugin-react": "7.37.5",
34
34
  "eslint-plugin-react-hooks": "7.0.1",
35
35
  "eslint-plugin-react-refresh": "0.5.2",
36
- "@luna-form/core": "0.0.33"
36
+ "@luna-form/core": "0.0.34"
37
37
  },
38
38
  "license": "Apache-2.0",
39
39
  "repository": {
@@ -1,2 +0,0 @@
1
- import type { ListProps } from '../../../component/field/field-list';
2
- export declare function FieldList(props: ListProps): import("react/jsx-runtime").JSX.Element;
@@ -1,13 +0,0 @@
1
- export declare function withError<P extends {
2
- errors?: Record<string, string[]>;
3
- field: {
4
- name: string;
5
- };
6
- }>(Component: React.ComponentType<P>): (props: Readonly<P>) => import("react/jsx-runtime").JSX.Element | null;
7
- export declare function withState<P extends {
8
- disabled?: boolean;
9
- field: {
10
- name: string;
11
- hidden?: boolean;
12
- };
13
- }>(Component: React.ComponentType<P>): (props: Readonly<P>) => import("react/jsx-runtime").JSX.Element | null;
@@ -1,7 +0,0 @@
1
- export declare const Field: (props: Readonly<Readonly<Readonly<{
2
- children: import("../../../type").Children;
3
- disabled?: boolean;
4
- errors?: Record<string, string[]>;
5
- field: import("@luna-form/core").Field;
6
- style?: import("@luna-form/core").Style;
7
- }>>>) => import("react/jsx-runtime").JSX.Element | null;
@@ -1,20 +0,0 @@
1
- import { type FormState } from '../hook/use-form-action';
2
- import type { Config, Control } from '../../type';
3
- import type { Definition, Nullable, Sections, ZodSchema } from '@luna-form/core';
4
- export declare function FormContent<T extends Record<string, unknown> = Record<string, unknown>, F = Record<string, unknown>>(props: Readonly<{
5
- action?: (formData: F, schema?: ZodSchema) => Promise<FormState<T>>;
6
- children?: Control;
7
- config: Config;
8
- context?: Record<string, unknown>;
9
- definition?: Definition;
10
- lang?: string;
11
- onSuccess?: (data: T) => void;
12
- onValueChange?: (input: {
13
- name: string;
14
- value: unknown;
15
- }) => void;
16
- readOnly?: boolean;
17
- sections: Sections;
18
- translations?: Record<string, Record<string, string>>;
19
- value?: Nullable<T>;
20
- }>): import("react/jsx-runtime").JSX.Element;
@@ -1,20 +0,0 @@
1
- import type { Config, Control } from '../../type';
2
- import type { Definition, Nullable, Sections, ZodSchema } from '@luna-form/core';
3
- import type { FormState } from '../hook/use-form-action';
4
- export declare function Form<T extends Record<string, unknown> = Record<string, unknown>, F = Record<string, unknown>>(props: Readonly<{
5
- action?: (formData: F, schema?: ZodSchema) => Promise<FormState<T>>;
6
- children?: Control;
7
- config: Config;
8
- context?: Record<string, unknown>;
9
- definition?: Definition;
10
- lang?: string;
11
- onSuccess?: (data: T) => void;
12
- onValueChange?: (input: {
13
- name: string;
14
- value: unknown;
15
- }) => void;
16
- readOnly?: boolean;
17
- sections: Sections;
18
- translations?: Record<string, Record<string, string>>;
19
- value?: Nullable<T>;
20
- }>): import("react/jsx-runtime").JSX.Element;
@@ -1,2 +0,0 @@
1
- import type { ListProps } from '../../../component/field/field-list';
2
- export declare function ListGuard({ children, field, value }: ListProps): import("react/jsx-runtime").JSX.Element;
@@ -1,6 +0,0 @@
1
- import type { Field, Fields, List } from '@luna-form/core';
2
- export declare function VisibilityGuard(props: Readonly<{
3
- children: React.ReactNode;
4
- container?: Field | List;
5
- fields: Fields;
6
- }>): import("react").ReactNode;
@@ -1,16 +0,0 @@
1
- import { type AriaAttributes, type CommonProps, type DataAttributes, type Field, type Nullable, type Schema } from '@luna-form/core';
2
- import type { Config, InputChange } from '../../type';
3
- export declare function Input(props: Readonly<{
4
- ariaAttributes?: AriaAttributes;
5
- commonProps: CommonProps;
6
- config: Config;
7
- context?: Record<string, unknown>;
8
- dataAttributes?: DataAttributes;
9
- field: Field;
10
- horizontal?: boolean;
11
- onMount: (name: string, schema: Schema, field: Field) => void;
12
- onUnmount: (name: string) => void;
13
- onValueChange?: (input: InputChange) => void;
14
- translations?: Record<string, string>;
15
- value?: Nullable<Record<string, unknown>>;
16
- }>): import("react").ReactNode;
@@ -1,7 +0,0 @@
1
- export declare const Slot: (props: Readonly<{
2
- children: import("../../../type").Children;
3
- disabled?: boolean;
4
- fields?: import("@luna-form/core").Fields;
5
- style?: import("@luna-form/core").Style;
6
- value?: import("@luna-form/core").Nullable<Record<string, unknown>>;
7
- }>) => import("react/jsx-runtime").JSX.Element;
@@ -1,3 +0,0 @@
1
- import { type Field, type Nullable } from '@luna-form/core';
2
- import type { Config } from '../../type';
3
- export declare function useDataSource(field: Field, config: Config, value?: Nullable<Record<string, unknown>>): readonly [Nullable<unknown[]>, (target: string, value: import("@luna-form/core").DataSource | undefined) => void];
@@ -1,3 +0,0 @@
1
- import { type DataSource, type Nullable } from '@luna-form/core';
2
- import type { Config } from '../../type';
3
- export declare function useFetch<T>(dataSource: Nullable<DataSource | T[]> | undefined, config: Config, disabled?: boolean): Nullable<T[]>;
@@ -1,2 +0,0 @@
1
- import { type List, type Nullable } from '@luna-form/core';
2
- export declare function useFieldList(field: List, value?: Nullable<Record<string, unknown>>): readonly [number[], () => void, (index: number) => void, boolean, boolean, number];
@@ -1,13 +0,0 @@
1
- import { type Field, type FormStateError, type Nullable, type Schemas, type ZodSchema } from '@luna-form/core';
2
- export type FormState<T> = {
3
- data: Nullable<T>;
4
- error: Nullable<FormStateError>;
5
- success: boolean;
6
- };
7
- export type FormActionOptions<T> = {
8
- onSuccess?: (data: T) => void;
9
- preserveValues?: boolean;
10
- translations?: Record<string, string>;
11
- validation?: boolean;
12
- };
13
- export declare function useFormState<T, F = Record<string, unknown>>(getSchema: () => readonly [Schemas, Field[]], action?: (formData: F, schema?: ZodSchema) => Promise<FormState<T>>, options?: FormActionOptions<T>): readonly [(payload: FormData) => void, FormState<T>, boolean];
@@ -1,2 +0,0 @@
1
- import type { Field, Schema } from '@luna-form/core';
2
- export declare function useInput(field: Field, onMount: (name: string, schema: Schema, field: Field) => void, onUnmount: (name: string) => void, translations?: Record<string, string>): import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>;
@@ -1,2 +0,0 @@
1
- import type { Field, Schema, Schemas } from '@luna-form/core';
2
- export declare function useSchema(): readonly [() => readonly [Schemas, Field[]], (name: string, schema: Schema, field: Field) => void, (name: string) => void];
@@ -1 +0,0 @@
1
- export declare function useStore(): (names: string | string[]) => void;
@@ -1 +0,0 @@
1
- export declare function useTimeout(): (callback: () => void, delay: number) => void;
@@ -1,6 +0,0 @@
1
- import { type Field, type Nullable } from '@luna-form/core';
2
- export declare function useValue(field: Field, currentValue?: Nullable<Record<string, unknown>>): {
3
- readonly setValue: (newValue: unknown) => void;
4
- readonly shouldSkipOnChange: () => boolean;
5
- readonly value: {} | undefined;
6
- };
@@ -1,3 +0,0 @@
1
- import { Form } from './component/form';
2
- export { Form };
3
- export type { Sections, Source, ZodSchema } from '@luna-form/core';
@@ -1,7 +0,0 @@
1
- export declare const clearInputErrorAtom: import("jotai").WritableAtom<null, [names: string[]], void> & {
2
- init: null;
3
- };
4
- export declare const reportErrorAtom: import("jotai").WritableAtom<null, [newValue: Record<string, string[]>], void> & {
5
- init: null;
6
- };
7
- export declare const reportInputErrorAtom: import("jotai-family").AtomFamily<string, import("jotai").WritableAtom<string[] | undefined, [newValue: string[] | undefined], void>>;
@@ -1,5 +0,0 @@
1
- import { type DataSource } from '@luna-form/core';
2
- export declare const reportSourceAtom: import("jotai-family").AtomFamily<string, import("jotai").WritableAtom<DataSource | undefined, [target: string, value: DataSource | undefined], void>>;
3
- export declare const clearInputSourceAtom: import("jotai").WritableAtom<null, [contributorNames: string[]], void> & {
4
- init: null;
5
- };
@@ -1,5 +0,0 @@
1
- import type { FieldState } from '@luna-form/core';
2
- export declare const fieldStateAtom: import("jotai").PrimitiveAtom<Record<string, FieldState>> & {
3
- init: Record<string, FieldState>;
4
- };
5
- export declare const reportFieldStateAtom: import("jotai-family").AtomFamily<string, import("jotai").WritableAtom<FieldState | undefined, [newValue: FieldState | undefined], void>>;
@@ -1,26 +0,0 @@
1
- import { type PrimitiveAtom } from 'jotai';
2
- interface NestedAtomFamilyOptions<TInner> {
3
- merge?: (values: TInner[]) => TInner | undefined;
4
- validateTarget?: (target: string) => boolean;
5
- }
6
- export declare function omitKey<T extends Record<string, unknown>>(obj: T, key: string): T;
7
- export declare function createNestedRecordAtomFamily<TInner, TRecord extends Record<string, Record<string, TInner>> = Record<string, Record<string, TInner>>>(baseAtom: PrimitiveAtom<TRecord>, options?: NestedAtomFamilyOptions<TInner>): import("jotai-family").AtomFamily<string, import("jotai").WritableAtom<TInner | undefined, [target: string, value: TInner | undefined], void>>;
8
- export declare function createNestedClearAtom<TInner>(baseAtom: PrimitiveAtom<Record<string, Record<string, TInner>>>): import("jotai").WritableAtom<null, [contributorNames: string[]], void> & {
9
- init: null;
10
- };
11
- export declare function createAtomStore<T>(initialValue?: Record<string, T>): {
12
- atom: PrimitiveAtom<Record<string, T>> & {
13
- init: Record<string, T>;
14
- };
15
- clearAll: import("jotai").WritableAtom<null, [], void> & {
16
- init: null;
17
- };
18
- clear: import("jotai").WritableAtom<null, [names: string[]], void> & {
19
- init: null;
20
- };
21
- bulkReport: import("jotai").WritableAtom<null, [newValue: Record<string, T>], void> & {
22
- init: null;
23
- };
24
- report: import("jotai-family").AtomFamily<string, import("jotai").WritableAtom<NonNullable<T> | undefined, [newValue: T | undefined], void>>;
25
- };
26
- export {};
@@ -1,10 +0,0 @@
1
- export declare const valueAtom: import("jotai").PrimitiveAtom<Record<string, unknown>> & {
2
- init: Record<string, unknown>;
3
- };
4
- export declare const clearAllValueAtom: import("jotai").WritableAtom<null, [], void> & {
5
- init: null;
6
- };
7
- export declare const clearInputValueAtom: import("jotai").WritableAtom<null, [names: string[]], void> & {
8
- init: null;
9
- };
10
- export declare const reportValueAtom: import("jotai-family").AtomFamily<string, import("jotai").WritableAtom<{} | undefined, [newValue: unknown], void>>;
@@ -1,3 +0,0 @@
1
- export declare function ChevronIcon(props: Readonly<{
2
- expanded: boolean;
3
- }>): import("react/jsx-runtime").JSX.Element;
@@ -1,5 +0,0 @@
1
- import { type Column } from '@luna-form/core';
2
- export declare function Column(props: Readonly<{
3
- children?: React.ReactNode;
4
- column?: Column;
5
- }>): import("react/jsx-runtime").JSX.Element;
@@ -1,5 +0,0 @@
1
- import type { Control } from '../type';
2
- export declare function Control(props: Readonly<{
3
- children?: Control;
4
- isPending?: boolean;
5
- }>): import("react/jsx-runtime").JSX.Element;
@@ -1,3 +0,0 @@
1
- export declare function Description(props: Readonly<{
2
- children: string | React.ReactNode;
3
- }>): import("react/jsx-runtime").JSX.Element;
@@ -1,12 +0,0 @@
1
- export type FieldLayoutProps = {
2
- children: React.ReactNode;
3
- disabled?: boolean;
4
- errors?: string[];
5
- isCheckbox?: boolean;
6
- isReversed?: boolean;
7
- isClickable?: boolean;
8
- };
9
- export declare function FieldBase(props: Readonly<FieldLayoutProps & {
10
- className?: string;
11
- orientation: 'horizontal' | 'vertical';
12
- }>): import("react/jsx-runtime").JSX.Element;
@@ -1,5 +0,0 @@
1
- import type { Nullable } from '@luna-form/core';
2
- export declare function FieldError(props: Readonly<{
3
- errors?: Nullable<string[]>;
4
- name?: string;
5
- }>): import("react/jsx-runtime").JSX.Element | null;
@@ -1,8 +0,0 @@
1
- import { type Field } from '@luna-form/core';
2
- export declare function FieldGroup(props: Readonly<{
3
- children: React.ReactNode;
4
- disabled?: boolean;
5
- errors?: string[];
6
- field: Field;
7
- horizontal?: boolean;
8
- }>): import("react/jsx-runtime").JSX.Element;
@@ -1,2 +0,0 @@
1
- import { type FieldLayoutProps } from './field-base';
2
- export declare function FieldHorizontal(props: Readonly<FieldLayoutProps>): import("react/jsx-runtime").JSX.Element;
@@ -1,8 +0,0 @@
1
- export declare function FieldListItem(props: Readonly<{
2
- canRemove?: boolean;
3
- children: React.ReactNode;
4
- index: number;
5
- isMultiField: boolean;
6
- label: string;
7
- onRemove?: (index: number) => void;
8
- }>): import("react/jsx-runtime").JSX.Element;
@@ -1,7 +0,0 @@
1
- import { type List, type Nullable } from '@luna-form/core';
2
- export type ListProps = Readonly<{
3
- children: (index: number) => React.ReactNode;
4
- field: List;
5
- value?: Nullable<Record<string, unknown>>;
6
- }>;
7
- export declare function FieldList(props: ListProps): import("react/jsx-runtime").JSX.Element[];
@@ -1,5 +0,0 @@
1
- import type { Section } from '@luna-form/core';
2
- export declare function FieldSetAdvanced(props: Readonly<{
3
- section: Section;
4
- group: React.ReactNode;
5
- }>): import("react/jsx-runtime").JSX.Element;
@@ -1,7 +0,0 @@
1
- export declare function FieldSetBase(props: Readonly<{
2
- children?: React.ReactNode;
3
- description?: string;
4
- empty?: boolean;
5
- id?: string;
6
- title?: string;
7
- }>): import("react/jsx-runtime").JSX.Element;
@@ -1,6 +0,0 @@
1
- import { type Section, type Style } from '@luna-form/core';
2
- export declare function FieldSet(props: Readonly<{
3
- children?: React.ReactNode;
4
- section: Section;
5
- style?: Style;
6
- }>): import("react/jsx-runtime").JSX.Element;
@@ -1,2 +0,0 @@
1
- import { type FieldLayoutProps } from './field-base';
2
- export declare function FieldVertical(props: Readonly<FieldLayoutProps>): import("react/jsx-runtime").JSX.Element;
@@ -1,10 +0,0 @@
1
- import { type Field, type Style } from '@luna-form/core';
2
- import type { Children } from '../../type';
3
- export type FieldProps = Readonly<{
4
- children: Children;
5
- disabled?: boolean;
6
- errors?: Record<string, string[]>;
7
- field: Field;
8
- style?: Style;
9
- }>;
10
- export declare function Field(props: FieldProps): import("react/jsx-runtime").JSX.Element;
@@ -1,13 +0,0 @@
1
- import { type Definition, type Sections } from '@luna-form/core';
2
- import type { Config, Control, Slot } from '../type';
3
- export declare function Form(props: Readonly<{
4
- action?: (formData: FormData) => void;
5
- children: Slot;
6
- config: Config;
7
- control?: Control;
8
- definition?: Definition;
9
- isPending?: boolean;
10
- noValidate?: boolean;
11
- readOnly?: boolean;
12
- sections: Sections;
13
- }>): import("react/jsx-runtime").JSX.Element;
@@ -1,7 +0,0 @@
1
- import type { Config } from '../type';
2
- export declare function FormattedDescription(props: Readonly<{
3
- config?: Config;
4
- context?: Record<string, unknown>;
5
- text?: string;
6
- translations?: Record<string, string>;
7
- }>): import("react/jsx-runtime").JSX.Element | null;
@@ -1,4 +0,0 @@
1
- export declare function Group(props: Readonly<{
2
- children?: React.ReactNode;
3
- compact?: boolean;
4
- }>): import("react/jsx-runtime").JSX.Element;
@@ -1,9 +0,0 @@
1
- import { type Field } from '@luna-form/core';
2
- import type { Children } from '../../type';
3
- export declare function InputBase(props: Readonly<{
4
- children: Children;
5
- disabled?: boolean;
6
- errors?: string[];
7
- field: Field;
8
- horizontal?: boolean;
9
- }>): import("react").ReactNode;
@@ -1,10 +0,0 @@
1
- import type { Config } from '../type';
2
- import type { Field } from '@luna-form/core';
3
- export declare function InputGroup(props: Readonly<{
4
- children: React.ReactNode;
5
- config?: Config;
6
- context?: Record<string, unknown>;
7
- field: Field;
8
- horizontal?: boolean;
9
- translations?: Record<string, string>;
10
- }>): import("react/jsx-runtime").JSX.Element;
@@ -1,9 +0,0 @@
1
- import { type Field } from '@luna-form/core';
2
- import type { Config } from '../type';
3
- export declare function InputLabel(props: Readonly<{
4
- config?: Config;
5
- context?: Record<string, unknown>;
6
- field: Field;
7
- horizontal?: boolean;
8
- translations?: Record<string, string>;
9
- }>): import("react/jsx-runtime").JSX.Element;