@donotdev/crud 0.1.42 → 0.1.44

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 (147) hide show
  1. package/dist/CrudService.bulk.js +1 -1
  2. package/dist/CrudService.bulkAcross.js +1 -1
  3. package/dist/CrudService.cache.js +1 -1
  4. package/dist/CrudService.internal.js +2 -2
  5. package/dist/CrudService.mutations.js +1 -1
  6. package/dist/CrudService.optimistic.js +1 -1
  7. package/dist/CrudService.queries.js +1 -1
  8. package/dist/CrudService.subscriptions.js +1 -1
  9. package/dist/CrudStore.js +1 -1
  10. package/dist/adapters/FunctionsAdapter.js +1 -1
  11. package/dist/components/CrudButton.js +1 -1
  12. package/dist/components/CrudCard.d.ts.map +1 -1
  13. package/dist/components/CrudCard.js +1 -1
  14. package/dist/components/DateFilter.js +1 -1
  15. package/dist/components/DisplayFieldRenderer.js +1 -1
  16. package/dist/components/DisplayThumbnail.js +1 -1
  17. package/dist/components/EntityFilters.js +1 -1
  18. package/dist/components/FormFieldRenderer.js +1 -1
  19. package/dist/components/FormLayout.js +1 -1
  20. package/dist/components/YearFilter.js +1 -1
  21. package/dist/components/controlled/complex/ControlledAddressField.js +1 -1
  22. package/dist/components/controlled/complex/ControlledDateField.js +1 -1
  23. package/dist/components/controlled/complex/ControlledFieldArrayField.js +1 -1
  24. package/dist/components/controlled/complex/ControlledGeoPointField.js +1 -1
  25. package/dist/components/controlled/complex/ControlledMapField.js +1 -1
  26. package/dist/components/controlled/complex/ControlledMultiInputField.js +1 -1
  27. package/dist/components/controlled/complex/ControlledRichTextField.js +1 -1
  28. package/dist/components/controlled/complex/ControlledTimestampField.js +1 -1
  29. package/dist/components/controlled/file/ControlledDocumentField.js +1 -1
  30. package/dist/components/controlled/file/ControlledFileField.js +1 -1
  31. package/dist/components/controlled/file/ControlledImageField.js +1 -1
  32. package/dist/components/controlled/file/ControlledMultiDocumentField.js +1 -1
  33. package/dist/components/controlled/file/ControlledMultiFileField.js +1 -1
  34. package/dist/components/controlled/file/ControlledMultiImageField.js +1 -1
  35. package/dist/components/controlled/input/ControlledCurrencyField.js +1 -1
  36. package/dist/components/controlled/input/ControlledDurationField.js +1 -1
  37. package/dist/components/controlled/input/ControlledGdprConsentField.js +1 -1
  38. package/dist/components/controlled/input/ControlledNumberField.js +1 -1
  39. package/dist/components/controlled/input/ControlledPhoneField.js +1 -1
  40. package/dist/components/controlled/input/ControlledPriceField.js +1 -1
  41. package/dist/components/controlled/input/ControlledRangeField.js +1 -1
  42. package/dist/components/controlled/input/ControlledRatingField.js +1 -1
  43. package/dist/components/controlled/input/ControlledSwitchField.js +1 -1
  44. package/dist/components/controlled/input/ControlledTextField.js +1 -1
  45. package/dist/components/controlled/input/ControlledTextareaField.js +1 -1
  46. package/dist/components/controlled/select/ControlledComboboxField.js +1 -1
  47. package/dist/components/controlled/select/ControlledDropdownField.js +1 -1
  48. package/dist/components/controlled/select/ControlledMultiDropdownField.js +1 -1
  49. package/dist/components/controlled/select/ControlledRadioField.js +1 -1
  50. package/dist/components/controlled/select/ControlledReferenceField.js +1 -1
  51. package/dist/components/controlled/types.js +1 -1
  52. package/dist/components/fields/display/AvatarFieldDisplay.js +1 -1
  53. package/dist/components/fields/display/BadgeFieldDisplay.js +1 -1
  54. package/dist/components/fields/display/ButtonFieldDisplay.js +1 -1
  55. package/dist/components/fields/display/CheckboxFieldDisplay.js +1 -1
  56. package/dist/components/fields/display/DateFieldDisplay.js +1 -1
  57. package/dist/components/fields/display/DropdownDisplay.js +1 -1
  58. package/dist/components/fields/display/FileFieldDisplay.js +1 -1
  59. package/dist/components/fields/display/GeoPointFieldDisplay.js +1 -1
  60. package/dist/components/fields/display/HiddenFieldDisplay.js +1 -1
  61. package/dist/components/fields/display/ImageFieldDisplay.js +1 -1
  62. package/dist/components/fields/display/LinkFieldDisplay.js +1 -1
  63. package/dist/components/fields/display/MapFieldDisplay.js +1 -1
  64. package/dist/components/fields/display/MultiDropdownDisplay.js +1 -1
  65. package/dist/components/fields/display/MultiInputTextFieldDisplay.js +1 -1
  66. package/dist/components/fields/display/NumberFieldDisplay.js +1 -1
  67. package/dist/components/fields/display/PasswordFieldDisplay.js +1 -1
  68. package/dist/components/fields/display/RadioFieldDisplay.js +1 -1
  69. package/dist/components/fields/display/RangeFieldDisplay.js +1 -1
  70. package/dist/components/fields/display/ReferenceFieldDisplay.js +1 -1
  71. package/dist/components/fields/display/TextAreaDisplay.js +1 -1
  72. package/dist/components/fields/display/TextFieldDisplay.js +1 -1
  73. package/dist/components/fields/display/TimestampFieldDisplay.js +1 -1
  74. package/dist/components/fields/display/index.js +1 -1
  75. package/dist/components/form/fields/AddressFieldComponent.d.ts +12 -10
  76. package/dist/components/form/fields/AddressFieldComponent.d.ts.map +1 -1
  77. package/dist/components/form/fields/AddressFieldComponent.js +1 -1
  78. package/dist/components/form/fields/AvatarFieldComponent.js +1 -1
  79. package/dist/components/form/fields/BadgeFieldComponent.js +1 -1
  80. package/dist/components/form/fields/ButtonFieldComponent.js +1 -1
  81. package/dist/components/form/fields/CheckboxFieldComponent.js +1 -1
  82. package/dist/components/form/fields/ComboboxComponent.js +1 -1
  83. package/dist/components/form/fields/CurrencyFieldComponent.js +1 -1
  84. package/dist/components/form/fields/DateFieldComponent.js +1 -1
  85. package/dist/components/form/fields/DocumentFieldComponent.js +1 -1
  86. package/dist/components/form/fields/DropdownComponent.js +1 -1
  87. package/dist/components/form/fields/DurationFieldComponent.js +1 -1
  88. package/dist/components/form/fields/FileFieldComponent.js +1 -1
  89. package/dist/components/form/fields/GdprConsentFieldComponent.js +1 -1
  90. package/dist/components/form/fields/GeoPointFieldComponent.js +1 -1
  91. package/dist/components/form/fields/ImageFieldComponent.js +1 -1
  92. package/dist/components/form/fields/MapFieldComponent.js +1 -1
  93. package/dist/components/form/fields/MultiDropdownComponent.js +1 -1
  94. package/dist/components/form/fields/MultiInputTextFieldComponent.js +1 -1
  95. package/dist/components/form/fields/NumberFieldComponent.js +1 -1
  96. package/dist/components/form/fields/PasswordFieldComponent.js +1 -1
  97. package/dist/components/form/fields/PhoneNumberComponent.js +1 -1
  98. package/dist/components/form/fields/PriceFieldComponent.js +1 -1
  99. package/dist/components/form/fields/RadioFieldComponent.js +1 -1
  100. package/dist/components/form/fields/RangeFieldComponent.js +1 -1
  101. package/dist/components/form/fields/RatingFieldComponent.js +1 -1
  102. package/dist/components/form/fields/ReferenceFieldComponent.js +1 -1
  103. package/dist/components/form/fields/RichTextComponent.js +1 -1
  104. package/dist/components/form/fields/SwitchFieldComponent.js +1 -1
  105. package/dist/components/form/fields/TextAreaComponent.js +1 -1
  106. package/dist/components/form/fields/TextFieldComponent.js +1 -1
  107. package/dist/components/form/fields/TimestampFieldComponent.js +1 -1
  108. package/dist/components/form/fields/index.js +1 -1
  109. package/dist/components/form/fields/internal/TiptapEditor.js +2 -2
  110. package/dist/components/form/internal/ImageViewerDialog.js +1 -1
  111. package/dist/contexts/UploadContext.js +1 -1
  112. package/dist/fieldTypeRegistry.store.js +1 -1
  113. package/dist/forms/hooks/useController.js +1 -1
  114. package/dist/forms/hooks/useEntityField.js +1 -1
  115. package/dist/forms/hooks/useEntityForm.js +1 -1
  116. package/dist/forms/utils/buildInitialValues.js +1 -1
  117. package/dist/forms/utils/isFieldEditable.js +1 -1
  118. package/dist/forms/utils/translateFieldLabel.js +1 -1
  119. package/dist/forms/utils/validateEntity.js +1 -1
  120. package/dist/hooks/useCrudFilters.js +1 -1
  121. package/dist/hooks/useCrudPageSize.js +1 -1
  122. package/dist/hooks/useEntityFavorites.js +1 -1
  123. package/dist/hooks/useFieldConditions.js +1 -1
  124. package/dist/hooks/useFileUpload.js +1 -1
  125. package/dist/hooks/useReferenceResolver.js +1 -1
  126. package/dist/hooks/useRelatedItems.js +1 -1
  127. package/dist/index.js +1 -1
  128. package/dist/stores/FormStore.js +1 -1
  129. package/dist/stores/UploadStore.js +1 -1
  130. package/dist/stores/index.js +1 -1
  131. package/dist/symbol-index.json +1 -1
  132. package/dist/tsconfig.tsbuildinfo +1 -1
  133. package/dist/useBaseCrudList.js +1 -1
  134. package/dist/useCrud.js +1 -1
  135. package/dist/useCrudCardList.js +1 -1
  136. package/dist/useCrudList.js +1 -1
  137. package/dist/utils/clientListProcessing.js +1 -1
  138. package/dist/utils/collections.js +1 -1
  139. package/dist/utils/fileStorage.js +1 -1
  140. package/dist/utils/imageProcessing.js +1 -1
  141. package/dist/utils/matchesFilter.js +1 -1
  142. package/dist/utils/mergeWithOptimistic.js +1 -1
  143. package/dist/utils/sanitizeHtml.js +1 -1
  144. package/dist/utils/uploadValidation.js +1 -1
  145. package/dist/workflows/defineWorkflow.js +1 -1
  146. package/dist/workflows/useEntityWorkflow.js +1 -1
  147. package/package.json +3 -3
@@ -1 +1 @@
1
- "use client";import{jsx as l}from"react/jsx-runtime";import{Controller as c}from"react-hook-form";import{DocumentFieldComponent as p}from"../../form/fields";import{convertValidationRules as g}from"../types";function x(i){const{control:m,errors:C,fieldConfig:e,required:s,t:u}=i,{name:r,label:d,validation:o}=e,a=e.options||{};return l(c,{name:r,control:m,rules:o?g(o):void 0,render:({field:n,fieldState:t})=>l(p,{name:r,label:u(d),value:n.value??null,onChange:f=>n.onChange(f),error:!!t.error,helperText:t.error?.message,required:s,multiple:!1,maxFiles:1,maxSize:a.maxSize,storagePath:a.storagePath})})}export{x as ControlledDocumentField};
1
+ "use client";import{jsx as n}from"react/jsx-runtime";import{Controller as c}from"react-hook-form";import{DocumentFieldComponent as f}from"../../form/fields";import{convertValidationRules as g}from"../types";function x(i){const{control:m,errors:C,fieldConfig:e,required:s,t:u}=i,{name:r,label:d,validation:o}=e,l=e.options||{};return n(c,{name:r,control:m,rules:o?g(o):void 0,render:({field:a,fieldState:t})=>n(f,{name:r,label:u(d),value:a.value??null,onChange:p=>a.onChange(p),error:!!t.error,helperText:t.error?.message,required:s,multiple:!1,maxFiles:1,maxSize:l.maxSize,storagePath:l.storagePath})})}export{x as ControlledDocumentField};
@@ -1 +1 @@
1
- "use client";import{jsx as n}from"react/jsx-runtime";import{Controller as p}from"react-hook-form";import{FileFieldComponent as c}from"../../form/fields";import{convertValidationRules as g}from"../types";function x(t){const{control:m,errors:C,fieldConfig:e,required:s,t:d}=t,{name:r,label:u,validation:o}=e,l=e.options||{};return n(p,{name:r,control:m,rules:o?g(o):void 0,render:({field:a,fieldState:i})=>n(c,{name:r,label:d(u),value:a.value??null,onChange:f=>a.onChange(f),error:!!i.error,helperText:i.error?.message,required:s,multiple:!1,maxFiles:1,maxSize:l.maxSize,storagePath:l.storagePath})})}export{x as ControlledFileField};
1
+ "use client";import{jsx as n}from"react/jsx-runtime";import{Controller as f}from"react-hook-form";import{FileFieldComponent as c}from"../../form/fields";import{convertValidationRules as g}from"../types";function x(i){const{control:m,errors:C,fieldConfig:e,required:s,t:d}=i,{name:r,label:u,validation:o}=e,l=e.options||{};return n(f,{name:r,control:m,rules:o?g(o):void 0,render:({field:t,fieldState:a})=>n(c,{name:r,label:d(u),value:t.value??null,onChange:p=>t.onChange(p),error:!!a.error,helperText:a.error?.message,required:s,multiple:!1,maxFiles:1,maxSize:l.maxSize,storagePath:l.storagePath})})}export{x as ControlledFileField};
@@ -1 +1 @@
1
- "use client";import{jsx as n}from"react/jsx-runtime";import{Controller as p}from"react-hook-form";import{ImageFieldComponent as g}from"../../form/fields";import{convertValidationRules as c}from"../types";function x(t){const{control:m,errors:C,fieldConfig:e,required:s,t:d}=t,{name:r,label:f,validation:o}=e,a=e.options||{};return n(p,{name:r,control:m,rules:o?c(o):void 0,render:({field:l,fieldState:i})=>n(g,{name:r,label:d(f),value:l.value??null,onChange:u=>l.onChange(u),error:!!i.error,helperText:i.error?.message,required:s,multiple:!1,maxFiles:1,maxSize:a.maxSize,storagePath:a.fieldSpecific?.storagePath})})}export{x as ControlledImageField};
1
+ "use client";import{jsx as i}from"react/jsx-runtime";import{Controller as u}from"react-hook-form";import{ImageFieldComponent as c}from"../../form/fields";import{convertValidationRules as g}from"../types";function x(n){const{control:m,errors:C,fieldConfig:e,required:s,t:d}=n,{name:r,label:f,validation:o}=e,a=e.options||{};return i(u,{name:r,control:m,rules:o?g(o):void 0,render:({field:l,fieldState:t})=>i(c,{name:r,label:d(f),value:l.value??null,onChange:p=>l.onChange(p),error:!!t.error,helperText:t.error?.message,required:s,multiple:!1,maxFiles:1,maxSize:a.maxSize,storagePath:a.fieldSpecific?.storagePath})})}export{x as ControlledImageField};
@@ -1 +1 @@
1
- "use client";import{jsx as n}from"react/jsx-runtime";import{Controller as f}from"react-hook-form";import{DocumentFieldComponent as v}from"../../form/fields";import{convertValidationRules as g}from"../types";function x(i){const{control:m,errors:C,fieldConfig:o,required:s,t:u}=i,{name:l,label:d,validation:t}=o,r=o.options||{};return n(f,{name:l,control:m,rules:t?g(t):void 0,render:({field:e,fieldState:a})=>{const c=Array.isArray(e.value)?e.value:e.value?[e.value]:null;return n(v,{name:l,label:u(d),value:c,onChange:p=>e.onChange(p),error:!!a.error,helperText:a.error?.message,required:s,multiple:!0,maxFiles:r.maxFiles??10,maxSize:r.maxSize,storagePath:r.storagePath})}})}export{x as ControlledMultiDocumentField};
1
+ "use client";import{jsx as n}from"react/jsx-runtime";import{Controller as p}from"react-hook-form";import{DocumentFieldComponent as v}from"../../form/fields";import{convertValidationRules as x}from"../types";function g(i){const{control:m,errors:C,fieldConfig:o,required:s,t:u}=i,{name:l,label:d,validation:t}=o,r=o.options||{};return n(p,{name:l,control:m,rules:t?x(t):void 0,render:({field:e,fieldState:a})=>{const c=Array.isArray(e.value)?e.value:e.value?[e.value]:null;return n(v,{name:l,label:u(d),value:c,onChange:f=>e.onChange(f),error:!!a.error,helperText:a.error?.message,required:s,multiple:!0,maxFiles:r.maxFiles??10,maxSize:r.maxSize,storagePath:r.storagePath})}})}export{g as ControlledMultiDocumentField};
@@ -1 +1 @@
1
- "use client";import{jsx as t}from"react/jsx-runtime";import{Controller as v}from"react-hook-form";import{FileFieldComponent as c}from"../../form/fields";import{convertValidationRules as g}from"../types";function x(n){const{control:s,errors:C,fieldConfig:o,required:m,t:u}=n,{name:l,label:d,validation:a}=o,r=o.options||{};return t(v,{name:l,control:s,rules:a?g(a):void 0,render:({field:e,fieldState:i})=>{const p=Array.isArray(e.value)?e.value:e.value?[e.value]:null;return t(c,{name:l,label:u(d),value:p,onChange:f=>e.onChange(f),error:!!i.error,helperText:i.error?.message,required:m,multiple:!0,maxFiles:r.maxFiles??10,maxSize:r.maxSize,storagePath:r.storagePath})}})}export{x as ControlledMultiFileField};
1
+ "use client";import{jsx as i}from"react/jsx-runtime";import{Controller as v}from"react-hook-form";import{FileFieldComponent as c}from"../../form/fields";import{convertValidationRules as x}from"../types";function g(n){const{control:s,errors:C,fieldConfig:o,required:m,t:u}=n,{name:l,label:d,validation:a}=o,r=o.options||{};return i(v,{name:l,control:s,rules:a?x(a):void 0,render:({field:e,fieldState:t})=>{const p=Array.isArray(e.value)?e.value:e.value?[e.value]:null;return i(c,{name:l,label:u(d),value:p,onChange:f=>e.onChange(f),error:!!t.error,helperText:t.error?.message,required:m,multiple:!0,maxFiles:r.maxFiles??10,maxSize:r.maxSize,storagePath:r.storagePath})}})}export{g as ControlledMultiFileField};
@@ -1 +1 @@
1
- "use client";import{jsx as t}from"react/jsx-runtime";import{Controller as c}from"react-hook-form";import{ImageFieldComponent as v}from"../../form/fields";import{convertValidationRules as g}from"../types";function x(n){const{control:m,errors:C,fieldConfig:o,required:s,t:u}=n,{name:a,label:d,validation:l}=o,r=o.options||{};return t(c,{name:a,control:m,rules:l?g(l):void 0,render:({field:e,fieldState:i})=>{const f=Array.isArray(e.value)?e.value:e.value?[e.value]:null;return t(v,{name:a,label:u(d),value:f,onChange:p=>e.onChange(p),error:!!i.error,helperText:i.error?.message,required:s,multiple:!0,maxFiles:r.maxFiles??10,maxSize:r.maxSize,storagePath:r.fieldSpecific?.storagePath})}})}export{x as ControlledMultiImageField};
1
+ "use client";import{jsx as i}from"react/jsx-runtime";import{Controller as p}from"react-hook-form";import{ImageFieldComponent as g}from"../../form/fields";import{convertValidationRules as v}from"../types";function x(n){const{control:m,errors:C,fieldConfig:o,required:s,t:u}=n,{name:a,label:d,validation:l}=o,r=o.options||{};return i(p,{name:a,control:m,rules:l?v(l):void 0,render:({field:e,fieldState:t})=>{const f=Array.isArray(e.value)?e.value:e.value?[e.value]:null;return i(g,{name:a,label:u(d),value:f,onChange:c=>e.onChange(c),error:!!t.error,helperText:t.error?.message,required:s,multiple:!0,maxFiles:r.maxFiles??10,maxSize:r.maxSize,storagePath:r.fieldSpecific?.storagePath})}})}export{x as ControlledMultiImageField};
@@ -1 +1 @@
1
- "use client";import{jsx as i}from"react/jsx-runtime";import{Controller as g}from"react-hook-form";import{CurrencyFieldComponent as y}from"../../form/fields";import{convertValidationRules as N}from"../types";function x(u){const{control:c,errors:b,fieldConfig:o,t:s,placeholder:d,required:f}=u,{name:m,label:p,validation:l}=o,n=(o.options||{}).fieldSpecific;return i(g,{name:m,control:c,rules:l?N(l):void 0,render:({field:e,fieldState:a})=>{const C=h=>{const r=h.target.value;if(r==null||r===""){e.onChange(null);return}const t=typeof r=="number"?r/100:parseFloat(String(r))/100;isNaN(t)?e.onChange(null):e.onChange(t)},v=e.value!=null&&!isNaN(e.value)?Math.round(e.value*100):void 0;return i(y,{label:s(p),value:v,onChange:C,currency:n?.currency||"EUR",locale:n?.locale,error:!!a.error,helperText:a.error?.message,required:f,placeholder:d})}})}export{x as ControlledCurrencyField};
1
+ "use client";import{jsx as i}from"react/jsx-runtime";import{Controller as h}from"react-hook-form";import{CurrencyFieldComponent as y}from"../../form/fields";import{convertValidationRules as N}from"../types";function b(u){const{control:c,errors:x,fieldConfig:o,t:s,placeholder:d,required:f}=u,{name:m,label:p,validation:l}=o,n=(o.options||{}).fieldSpecific;return i(h,{name:m,control:c,rules:l?N(l):void 0,render:({field:e,fieldState:t})=>{const C=g=>{const r=g.target.value;if(r==null||r===""){e.onChange(null);return}const a=typeof r=="number"?r/100:parseFloat(String(r))/100;isNaN(a)?e.onChange(null):e.onChange(a)},v=e.value!=null&&!isNaN(e.value)?Math.round(e.value*100):void 0;return i(y,{label:s(p),value:v,onChange:C,currency:n?.currency||"EUR",locale:n?.locale,error:!!t.error,helperText:t.error?.message,required:f,placeholder:d})}})}export{b as ControlledCurrencyField};
@@ -1 +1 @@
1
- "use client";import{jsx as a}from"react/jsx-runtime";import{Controller as u}from"react-hook-form";import{DurationFieldComponent as c}from"../../form/fields";import{convertValidationRules as C}from"../types";function x(t){const{control:d,errors:v,fieldConfig:o,t:i,required:s}=t,{name:m,label:f,validation:n}=o,e=(o.options||{}).fieldSpecific;return a(u,{name:m,control:d,rules:n?C(n):void 0,render:({field:r,fieldState:l})=>a(c,{label:i(f),value:r.value??0,onChange:p=>r.onChange(p),error:!!l.error,helperText:l.error?.message,required:s,disabled:r.disabled,min:e?.min??0,max:e?.max??480,step:e?.step??5,t:i})})}export{x as ControlledDurationField};
1
+ "use client";import{jsx as t}from"react/jsx-runtime";import{Controller as p}from"react-hook-form";import{DurationFieldComponent as c}from"../../form/fields";import{convertValidationRules as C}from"../types";function v(a){const{control:s,errors:x,fieldConfig:r,t:i,required:d}=a,{name:m,label:f,validation:n}=r,e=(r.options||{}).fieldSpecific;return t(p,{name:m,control:s,rules:n?C(n):void 0,render:({field:o,fieldState:l})=>t(c,{label:i(f),value:o.value??0,onChange:u=>o.onChange(u),error:!!l.error,helperText:l.error?.message,required:d,disabled:o.disabled,min:e?.min??0,max:e?.max??480,step:e?.step??5,t:i})})}export{v as ControlledDurationField};
@@ -1 +1 @@
1
- "use client";import{jsx as n}from"react/jsx-runtime";import{Controller as u}from"react-hook-form";import{GdprConsentFieldComponent as h}from"../../form/fields";import{convertValidationRules as v}from"../types";function y(i){const{control:a,errors:P,fieldConfig:l,required:s}=i,{name:d,validation:t,options:c={}}=l,r=c.fieldSpecific,p=r?.privacyPolicyPath||"/legal/privacy",m=r?.termsPath||"/legal/terms";return n(u,{name:d,control:a,rules:t?v(t):void 0,render:({field:o})=>{const e=o.value,C=typeof e=="object"&&e!==null?!!e.gdprConsent:!!e;return n(h,{checked:C,onChange:f=>{if(f.target.checked){const g=new Date().toISOString().split("T")[0];o.onChange({gdprConsent:!0,gdprConsentDate:new Date().toISOString(),gdprConsentVersion:g})}else o.onChange(!1)},required:s,privacyPolicyPath:p,termsPath:m})}})}export{y as ControlledGdprConsentField};
1
+ "use client";import{jsx as o}from"react/jsx-runtime";import{Controller as u}from"react-hook-form";import{GdprConsentFieldComponent as h}from"../../form/fields";import{convertValidationRules as v}from"../types";function y(i){const{control:a,errors:P,fieldConfig:l,required:s}=i,{name:c,validation:t,options:d={}}=l,r=d.fieldSpecific,p=r?.privacyPolicyPath||"/legal/privacy",m=r?.termsPath||"/legal/terms";return o(u,{name:c,control:a,rules:t?v(t):void 0,render:({field:n})=>{const e=n.value,g=typeof e=="object"&&e!==null?!!e.gdprConsent:!!e;return o(h,{checked:g,onChange:C=>{if(C.target.checked){const f=new Date().toISOString().split("T")[0];n.onChange({gdprConsent:!0,gdprConsentDate:new Date().toISOString(),gdprConsentVersion:f})}else n.onChange(!1)},required:s,privacyPolicyPath:p,termsPath:m})}})}export{y as ControlledGdprConsentField};
@@ -1 +1 @@
1
- "use client";import{jsx as s}from"react/jsx-runtime";import{Controller as v}from"react-hook-form";import{NumberFieldComponent as C}from"../../form/fields";import{convertValidationRules as h}from"../types";function N(m){const{control:u,errors:x,fieldConfig:n,t:c,placeholder:b,required:d}=m,{name:f,label:p,validation:r}=n,t=n.options||{},a=t.fieldSpecific;return s(v,{name:f,control:u,rules:r?h(r):void 0,render:({field:e,fieldState:l})=>{const g=o=>{if(o.target.value===""||o.target.value===null){e.onChange(null);return}try{const i=parseFloat(o.target.value);isNaN(i)||e.onChange(i)}catch{e.onChange(0)}};return s(C,{...e,label:c(p),value:e.value??void 0,onChange:g,error:!!l.error,helperText:l.error?.message,required:d,min:r?.min,max:r?.max,step:a?.mask==="currency"?.01:a?.mask==="mileage"?1:void 0,mask:a?.mask||"number",className:t.className})}})}export{N as ControlledNumberField};
1
+ "use client";import{jsx as s}from"react/jsx-runtime";import{Controller as v}from"react-hook-form";import{NumberFieldComponent as C}from"../../form/fields";import{convertValidationRules as h}from"../types";function N(m){const{control:u,errors:b,fieldConfig:n,t:c,placeholder:x,required:d}=m,{name:f,label:p,validation:r}=n,t=n.options||{},a=t.fieldSpecific;return s(v,{name:f,control:u,rules:r?h(r):void 0,render:({field:e,fieldState:l})=>{const g=o=>{if(o.target.value===""||o.target.value===null){e.onChange(null);return}try{const i=parseFloat(o.target.value);isNaN(i)||e.onChange(i)}catch{e.onChange(0)}};return s(C,{...e,label:c(p),value:e.value??void 0,onChange:g,error:!!l.error,helperText:l.error?.message,required:d,min:r?.min,max:r?.max,step:a?.mask==="currency"?.01:a?.mask==="mileage"?1:void 0,mask:a?.mask||"number",className:t.className})}})}export{N as ControlledNumberField};
@@ -1 +1 @@
1
- "use client";import{jsx as n}from"react/jsx-runtime";import{Controller as f}from"react-hook-form";import{PhoneNumberComponent as g}from"../../form/fields";import{convertValidationRules as p}from"../types";function c(l){const{control:t,errors:v,fieldConfig:a,t:i,required:s}=l,{name:m,label:u,validation:r}=a;return n(f,{name:m,control:t,rules:r?p(r):void 0,render:({field:e,fieldState:o})=>n(g,{label:i(u),value:typeof e.value=="string"?e.value:"",onChange:d=>e.onChange(d.target.value||""),error:o.error?.message,helperText:o.error?.message,required:s})})}export{c as ControlledPhoneField};
1
+ "use client";import{jsx as n}from"react/jsx-runtime";import{Controller as f}from"react-hook-form";import{PhoneNumberComponent as p}from"../../form/fields";import{convertValidationRules as g}from"../types";function v(t){const{control:a,errors:c,fieldConfig:l,t:i,required:s}=t,{name:m,label:u,validation:r}=l;return n(f,{name:m,control:a,rules:r?g(r):void 0,render:({field:e,fieldState:o})=>n(p,{label:i(u),value:typeof e.value=="string"?e.value:"",onChange:d=>e.onChange(d.target.value||""),error:o.error?.message,helperText:o.error?.message,required:s})})}export{v as ControlledPhoneField};
@@ -1 +1 @@
1
- "use client";import{jsx as t}from"react/jsx-runtime";import{Controller as v}from"react-hook-form";import{PriceFieldComponent as h}from"../../form/fields";import{convertValidationRules as g}from"../types";function x(n){const{control:a,errors:F,fieldConfig:r,t:c,placeholder:s,required:d}=n,{name:u,label:f,validation:o}=r,e=(r.options||{}).fieldSpecific;return t(v,{name:u,control:a,rules:o?g(o):void 0,render:({field:l,fieldState:i})=>{const p=l.value,m=C=>{l.onChange(C)};return t(h,{label:c(f),value:p??void 0,onChange:m,error:!!i.error,helperText:i.error?.message,required:d,placeholder:s,defaultCurrency:e?.defaultCurrency??"EUR",optionsTitle:e?.optionsTitle,currencies:e?.currencies})}})}export{x as ControlledPriceField};
1
+ "use client";import{jsx as n}from"react/jsx-runtime";import{Controller as v}from"react-hook-form";import{PriceFieldComponent as h}from"../../form/fields";import{convertValidationRules as g}from"../types";function x(t){const{control:a,errors:F,fieldConfig:r,t:c,placeholder:s,required:d}=t,{name:u,label:f,validation:o}=r,e=(r.options||{}).fieldSpecific;return n(v,{name:u,control:a,rules:o?g(o):void 0,render:({field:l,fieldState:i})=>{const p=l.value,m=C=>{l.onChange(C)};return n(h,{label:c(f),value:p??void 0,onChange:m,error:!!i.error,helperText:i.error?.message,required:d,placeholder:s,defaultCurrency:e?.defaultCurrency??"EUR",optionsTitle:e?.optionsTitle,currencies:e?.currencies})}})}export{x as ControlledPriceField};
@@ -1 +1 @@
1
- "use client";import{jsx as t}from"react/jsx-runtime";import{Controller as c}from"react-hook-form";import{RangeFieldComponent as g}from"../../form/fields";import{convertValidationRules as C}from"../types";function h(i){const{control:m,errors:v,fieldConfig:n,t:s,required:d}=i,{name:u,label:f,validation:e}=n,a=n.options||{},p=a.fieldSpecific;return t(c,{name:u,control:m,rules:e?C(e):void 0,render:({field:r,fieldState:l})=>t(g,{label:s(f),value:r.value??void 0,onChange:o=>{typeof o=="number"?r.onChange(o):r.onChange(Number(o.target.value)||0)},error:!!l.error,helperText:l.error?.message,required:d,min:e?.min,max:e?.max,step:a.step,showValue:p?.showValue})})}export{h as ControlledRangeField};
1
+ "use client";import{jsx as t}from"react/jsx-runtime";import{Controller as c}from"react-hook-form";import{RangeFieldComponent as g}from"../../form/fields";import{convertValidationRules as v}from"../types";function C(i){const{control:m,errors:h,fieldConfig:n,t:s,required:d}=i,{name:u,label:f,validation:e}=n,a=n.options||{},p=a.fieldSpecific;return t(c,{name:u,control:m,rules:e?v(e):void 0,render:({field:r,fieldState:l})=>t(g,{label:s(f),value:r.value??void 0,onChange:o=>{typeof o=="number"?r.onChange(o):r.onChange(Number(o.target.value)||0)},error:!!l.error,helperText:l.error?.message,required:d,min:e?.min,max:e?.max,step:a.step,showValue:p?.showValue})})}export{C as ControlledRangeField};
@@ -1 +1 @@
1
- "use client";import{jsx as t}from"react/jsx-runtime";import{Controller as p}from"react-hook-form";import{RatingFieldComponent as c}from"../../form/fields";import{convertValidationRules as g}from"../types";function x(i){const{control:n,errors:C,fieldConfig:r,t:s,required:m}=i,{name:d,label:f,validation:e}=r,o=(r.options||{}).fieldSpecific;return t(p,{name:d,control:n,rules:e?g(e):void 0,render:({field:a,fieldState:l})=>t(c,{label:s(f),value:a.value??0,onChange:u=>{a.onChange(u)},error:!!l.error,helperText:l.error?.message,required:m,max:o?.max??e?.max??5,showValue:o?.showValue})})}export{x as ControlledRatingField};
1
+ "use client";import{jsx as l}from"react/jsx-runtime";import{Controller as p}from"react-hook-form";import{RatingFieldComponent as c}from"../../form/fields";import{convertValidationRules as g}from"../types";function x(i){const{control:t,errors:C,fieldConfig:r,t:s,required:m}=i,{name:d,label:f,validation:e}=r,o=(r.options||{}).fieldSpecific;return l(p,{name:d,control:t,rules:e?g(e):void 0,render:({field:a,fieldState:n})=>l(c,{label:s(f),value:a.value??0,onChange:u=>{a.onChange(u)},error:!!n.error,helperText:n.error?.message,required:m,max:o?.max??e?.max??5,showValue:o?.showValue})})}export{x as ControlledRatingField};
@@ -1 +1 @@
1
- "use client";import{jsx as i}from"react/jsx-runtime";import{Controller as S}from"react-hook-form";import{SwitchFieldComponent as x}from"../../form/fields";import"../types";function v(d){const{control:h,errors:V,fieldConfig:s,t:o,onChange:n}=d,{name:m,label:f,options:u={}}=s,e=u.fieldSpecific,k=e?.uncheckedValue??!1,r=e?.checkedValue??!0,t=e?.uncheckedLabel,l=e?.checkedLabel;return i(S,{name:m,control:h,render:({field:{value:p,onChange:g},fieldState:C})=>{const b=p===r,L=c=>{const a=c?r:k;g(a),n&&n(a)};return i(x,{label:o(f),checked:b,onChange:c=>L(c.target.checked),uncheckedLabel:t?o(t):void 0,checkedLabel:l?o(l):void 0,helperText:C.error?.message})}})}export{v as ControlledSwitchField};
1
+ "use client";import{jsx as i}from"react/jsx-runtime";import{Controller as S}from"react-hook-form";import{SwitchFieldComponent as v}from"../../form/fields";import"../types";function x(d){const{control:h,errors:V,fieldConfig:s,t:o,onChange:r}=d,{name:m,label:f,options:u={}}=s,e=u.fieldSpecific,k=e?.uncheckedValue??!1,c=e?.checkedValue??!0,t=e?.uncheckedLabel,l=e?.checkedLabel;return i(S,{name:m,control:h,render:({field:{value:p,onChange:b},fieldState:C})=>{const g=p===c,L=n=>{const a=n?c:k;b(a),r&&r(a)};return i(v,{label:o(f),checked:g,onChange:n=>L(n.target.checked),uncheckedLabel:t?o(t):void 0,checkedLabel:l?o(l):void 0,helperText:C.error?.message})}})}export{x as ControlledSwitchField};
@@ -1 +1 @@
1
- "use client";import{jsx as t}from"react/jsx-runtime";import{Controller as f}from"react-hook-form";import{TextFieldComponent as C}from"../../form/fields";import{convertValidationRules as x}from"../types";function g(n){const{control:i,errors:v,fieldConfig:r,t:s,placeholder:m,required:d}=n,{name:p,label:u,validation:o,options:l={}}=r,c=o?x(o):void 0,h=r.type==="email"?"email":r.type==="url"?"url":r.type==="color"?"color":"text";return t(f,{name:p,control:i,rules:c,render:({field:e,fieldState:a})=>t(C,{ref:e.ref,name:e.name,value:e.value??"",onChange:e.onChange,onBlur:e.onBlur,label:s(u),error:a.error?.message,helperText:a.error?.message,type:h,required:d,placeholder:m||l.placeholder,maxLength:o?.maxLength,showCharCount:l.showCharCount,className:l.className})})}export{g as ControlledTextField};
1
+ "use client";import{jsx as a}from"react/jsx-runtime";import{Controller as f}from"react-hook-form";import{TextFieldComponent as C}from"../../form/fields";import{convertValidationRules as x}from"../types";function g(n){const{control:i,errors:v,fieldConfig:r,t:s,placeholder:m,required:d}=n,{name:p,label:u,validation:o,options:l={}}=r,c=o?x(o):void 0,h=r.type==="email"?"email":r.type==="url"?"url":r.type==="color"?"color":"text";return a(f,{name:p,control:i,rules:c,render:({field:e,fieldState:t})=>a(C,{ref:e.ref,name:e.name,value:e.value??"",onChange:e.onChange,onBlur:e.onBlur,label:s(u),error:t.error?.message,helperText:t.error?.message,type:h,required:d,placeholder:m||l.placeholder,maxLength:o?.maxLength,showCharCount:l.showCharCount,className:l.className})})}export{g as ControlledTextField};
@@ -1 +1 @@
1
- "use client";import{jsx as t}from"react/jsx-runtime";import{Controller as c}from"react-hook-form";import{TextAreaComponent as p}from"../../form/fields";import{convertValidationRules as C}from"../types";function f(n){const{control:s,errors:x,fieldConfig:a,t:i,placeholder:m,required:d}=n,{name:u,label:h,validation:o}=a,e=a.options||{};return t(c,{name:u,control:s,rules:o?C(o):void 0,render:({field:r,fieldState:l})=>t(p,{...r,label:i(h),value:r.value??"",onChange:r.onChange,error:l.error?.message,helperText:l.error?.message,required:d,placeholder:m||e.placeholder,maxLength:o?.maxLength,showCharCount:e.showCharCount,autoResize:e.autoResize,rows:e.rows,className:e.className})})}export{f as ControlledTextareaField};
1
+ "use client";import{jsx as l}from"react/jsx-runtime";import{Controller as c}from"react-hook-form";import{TextAreaComponent as p}from"../../form/fields";import{convertValidationRules as C}from"../types";function f(n){const{control:s,errors:x,fieldConfig:a,t:i,placeholder:m,required:d}=n,{name:u,label:h,validation:o}=a,e=a.options||{};return l(c,{name:u,control:s,rules:o?C(o):void 0,render:({field:r,fieldState:t})=>l(p,{...r,label:i(h),value:r.value??"",onChange:r.onChange,error:t.error?.message,helperText:t.error?.message,required:d,placeholder:m||e.placeholder,maxLength:o?.maxLength,showCharCount:e.showCharCount,autoResize:e.autoResize,rows:e.rows,className:e.className})})}export{f as ControlledTextareaField};
@@ -1 +1 @@
1
- "use client";import{jsx as O}from"react/jsx-runtime";import{useMemo as y,useEffect as R,useRef as S}from"react";import{Controller as j,useWatch as D,useFormContext as E}from"react-hook-form";import{translateLabel as L}from"../../../forms/utils";import{ComboboxComponent as M}from"../../form/fields";import{convertValidationRules as T}from"../types";function w(V){const{control:p,errors:H,fieldConfig:a,t:s,placeholder:q,required:B}=V,{name:i,label:F,validation:t,options:m={}}=a,b=E(),h=b?.setValue,v=b?.resetField,o=D({control:p}),n="dependsOn"in a?a.dependsOn:void 0,l=n&&o?o[n.field]:void 0,d=y(()=>{const e=t?.options;return e?typeof e=="function"?e(o||{}):e:[]},[t?.options,o,l]),C=S(void 0);R(()=>{const e=C.current;if(C.current=l,e===void 0||e===l)return;const r=o?.[i];r&&!d.map(c=>c.value).includes(r)&&v&&v(i)},[l]);const P=y(()=>d.map(e=>({...e,label:L(e.label,s)})),[d,s]),u=m.fieldSpecific;return O(j,{name:i,control:p,rules:t?T(t):void 0,render:({field:e,fieldState:r})=>{const c=f=>{const g=typeof f=="string"?f:f.target.value;if(e.onChange(g),n&&h&&u?.setParentOnChange){const x=u.setParentOnChange(g,o||{});x!=null&&h(n.field,x,{shouldValidate:!0,shouldDirty:!0})}};return O(M,{...e,label:s(F),value:e.value??"",onChange:c,onBlur:e.onBlur,options:P,error:!!r.error,helperText:r.error?.message,required:B,placeholder:q||m.placeholder,creatable:u?.creatable??!1})}})}export{w as ControlledComboboxField};
1
+ "use client";import{jsx as O}from"react/jsx-runtime";import{useMemo as y,useEffect as S,useRef as V}from"react";import{Controller as j,useWatch as D,useFormContext as E}from"react-hook-form";import{translateLabel as L}from"../../../forms/utils";import{ComboboxComponent as M}from"../../form/fields";import{convertValidationRules as T}from"../types";function w(F){const{control:m,errors:H,fieldConfig:a,t:s,placeholder:q,required:B}=F,{name:i,label:P,validation:t,options:f={}}=a,b=E(),h=b?.setValue,v=b?.resetField,o=D({control:m}),n="dependsOn"in a?a.dependsOn:void 0,l=n&&o?o[n.field]:void 0,d=y(()=>{const e=t?.options;return e?typeof e=="function"?e(o||{}):e:[]},[t?.options,o,l]),C=V(void 0);S(()=>{const e=C.current;if(C.current=l,e===void 0||e===l)return;const r=o?.[i];r&&!d.map(c=>c.value).includes(r)&&v&&v(i)},[l]);const R=y(()=>d.map(e=>({...e,label:L(e.label,s)})),[d,s]),u=f.fieldSpecific;return O(j,{name:i,control:m,rules:t?T(t):void 0,render:({field:e,fieldState:r})=>{const c=p=>{const g=typeof p=="string"?p:p.target.value;if(e.onChange(g),n&&h&&u?.setParentOnChange){const x=u.setParentOnChange(g,o||{});x!=null&&h(n.field,x,{shouldValidate:!0,shouldDirty:!0})}};return O(M,{...e,label:s(P),value:e.value??"",onChange:c,onBlur:e.onBlur,options:R,error:!!r.error,helperText:r.error?.message,required:B,placeholder:q||f.placeholder,creatable:u?.creatable??!1})}})}export{w as ControlledComboboxField};
@@ -1 +1 @@
1
- "use client";import{jsx as v}from"react/jsx-runtime";import{useMemo as C}from"react";import{Controller as V,useWatch as q,useFormContext as w}from"react-hook-form";import{translateLabel as B}from"../../../forms/utils";import{DropdownComponent as F}from"../../form/fields";import{convertValidationRules as P}from"../types";function j(g){const{control:d,errors:L,fieldConfig:l,t:i,onChange:A,required:h}=g,{name:b,label:x,validation:r,options:y={}}=l,u=w()?.setValue,n="dependsOn"in l?l.dependsOn:void 0,o=n?n.field:void 0,O=typeof r?.options=="function",a=q({control:d,name:o,disabled:!o}),f=C(()=>{const e=r?.options;if(!e)return[];if(typeof e=="function"){const t=o?{[o]:a}:{};return e(t)}return e},[r?.options,O,o,a]),D=C(()=>f.map(e=>({...e,label:B(e.label,i)})),[f,i]),p=y.fieldSpecific;return v(V,{name:b,control:d,rules:r?P(r):void 0,render:({field:e,fieldState:t})=>{const S=s=>{const m=typeof s=="string"?s:s.target.value;if(e.onChange(m),n&&u&&p?.setParentOnChange){const c=p.setParentOnChange(m,o?{[o]:a}:{});c!=null&&u(n.field,c,{shouldValidate:!0,shouldDirty:!0})}};return v(F,{label:i(x),value:e.value!==void 0&&e.value!==null?String(e.value):"",onChange:S,onBlur:e.onBlur,options:D,error:!!t.error,helperText:t.error?.message,required:h})}})}export{j as ControlledDropdownField};
1
+ "use client";import{jsx as v}from"react/jsx-runtime";import{useMemo as C}from"react";import{Controller as V,useWatch as q,useFormContext as w}from"react-hook-form";import{translateLabel as B}from"../../../forms/utils";import{DropdownComponent as F}from"../../form/fields";import{convertValidationRules as P}from"../types";function j(g){const{control:d,errors:L,fieldConfig:l,t:a,onChange:A,required:h}=g,{name:b,label:x,validation:n,options:y={}}=l,u=w()?.setValue,r="dependsOn"in l?l.dependsOn:void 0,o=r?r.field:void 0,O=typeof n?.options=="function",i=q({control:d,name:o,disabled:!o}),f=C(()=>{const e=n?.options;if(!e)return[];if(typeof e=="function"){const t=o?{[o]:i}:{};return e(t)}return e},[n?.options,O,o,i]),D=C(()=>f.map(e=>({...e,label:B(e.label,a)})),[f,a]),p=y.fieldSpecific;return v(V,{name:b,control:d,rules:n?P(n):void 0,render:({field:e,fieldState:t})=>{const S=s=>{const m=typeof s=="string"?s:s.target.value;if(e.onChange(m),r&&u&&p?.setParentOnChange){const c=p.setParentOnChange(m,o?{[o]:i}:{});c!=null&&u(r.field,c,{shouldValidate:!0,shouldDirty:!0})}};return v(F,{label:a(x),value:e.value!==void 0&&e.value!==null?String(e.value):"",onChange:S,onBlur:e.onBlur,options:D,error:!!t.error,helperText:t.error?.message,required:h})}})}export{j as ControlledDropdownField};
@@ -1 +1 @@
1
- "use client";import{jsx as m}from"react/jsx-runtime";import{useMemo as f}from"react";import{Controller as A,useWatch as x}from"react-hook-form";import{translateLabel as M}from"../../../forms/utils";import{MultiDropdownComponent as O}from"../../form/fields";import{convertValidationRules as w}from"../types";function D(c){const{control:s,errors:S,fieldConfig:a,t:l,required:v}=c,{name:y,label:b,validation:e}=a,u="dependsOn"in a?a.dependsOn:void 0,o=u?u.field:void 0,g=typeof e?.options=="function",d=x({control:s,name:o,disabled:!o}),p=f(()=>{const r=e?.options;if(!r)return[];if(typeof r=="function"){const n=o?{[o]:d}:{};return r(n)}return r},[e?.options,g,o,d]),C=f(()=>p.map(r=>({value:String(r.value),label:M(r.label,l)})),[p,l]);return m(A,{name:y,control:s,rules:e?w(e):void 0,render:({field:r,fieldState:n})=>{const h=i=>{let t;if(Array.isArray(i))t=i;else try{t=JSON.parse(i.target.value)}catch{t=[]}r.onChange(t)};return m(O,{...r,label:l(b),value:Array.isArray(r.value)?r.value:[],onChange:h,onBlur:r.onBlur,options:C,error:!!n.error,helperText:n.error?.message,required:v})}})}export{D as ControlledMultiDropdownField};
1
+ "use client";import{jsx as f}from"react/jsx-runtime";import{useMemo as m}from"react";import{Controller as A,useWatch as x}from"react-hook-form";import{translateLabel as M}from"../../../forms/utils";import{MultiDropdownComponent as O}from"../../form/fields";import{convertValidationRules as S}from"../types";function w(c){const{control:s,errors:D,fieldConfig:a,t:l,required:v}=c,{name:y,label:b,validation:o}=a,u="dependsOn"in a?a.dependsOn:void 0,r=u?u.field:void 0,g=typeof o?.options=="function",d=x({control:s,name:r,disabled:!r}),p=m(()=>{const e=o?.options;if(!e)return[];if(typeof e=="function"){const t=r?{[r]:d}:{};return e(t)}return e},[o?.options,g,r,d]),C=m(()=>p.map(e=>({value:String(e.value),label:M(e.label,l)})),[p,l]);return f(A,{name:y,control:s,rules:o?S(o):void 0,render:({field:e,fieldState:t})=>{const h=i=>{let n;if(Array.isArray(i))n=i;else try{n=JSON.parse(i.target.value)}catch{n=[]}e.onChange(n)};return f(O,{...e,label:l(b),value:Array.isArray(e.value)?e.value:[],onChange:h,onBlur:e.onBlur,options:C,error:!!t.error,helperText:t.error?.message,required:v})}})}export{w as ControlledMultiDropdownField};
@@ -1 +1 @@
1
- "use client";import{jsx as p}from"react/jsx-runtime";import{useMemo as u}from"react";import{Controller as x,useWatch as y}from"react-hook-form";import{translateLabel as R}from"../../../forms/utils";import{RadioFieldComponent as F}from"../../form/fields";import{convertValidationRules as O}from"../types";function q(m){const{control:l,errors:S,fieldConfig:t,t:i,required:c}=m,{name:v,label:g,validation:o}=t,s="dependsOn"in t?t.dependsOn:void 0,r=s?s.field:void 0,b=typeof o?.options=="function",d=y({control:l,name:r,disabled:!r}),f=u(()=>{const e=o?.options;if(!e)return[];if(typeof e=="function"){const n=r?{[r]:d}:{};return e(n)}return e},[o?.options,b,r,d]),C=u(()=>f.map(e=>({value:String(e.value),label:R(e.label,i)})),[f,i]);return p(x,{name:v,control:l,rules:o?O(o):void 0,render:({field:e,fieldState:n})=>p(F,{...e,label:i(g),value:e.value??void 0,onChange:a=>{const h=typeof a=="string"?a:a.target.value;e.onChange(h)},options:C,error:!!n.error,helperText:n.error?.message,required:c})})}export{q as ControlledRadioField};
1
+ "use client";import{jsx as p}from"react/jsx-runtime";import{useMemo as u}from"react";import{Controller as x,useWatch as y}from"react-hook-form";import{translateLabel as R}from"../../../forms/utils";import{RadioFieldComponent as q}from"../../form/fields";import{convertValidationRules as F}from"../types";function O(m){const{control:a,errors:S,fieldConfig:n,t:i,required:c}=m,{name:v,label:g,validation:o}=n,s="dependsOn"in n?n.dependsOn:void 0,r=s?s.field:void 0,b=typeof o?.options=="function",d=y({control:a,name:r,disabled:!r}),f=u(()=>{const e=o?.options;if(!e)return[];if(typeof e=="function"){const t=r?{[r]:d}:{};return e(t)}return e},[o?.options,b,r,d]),C=u(()=>f.map(e=>({value:String(e.value),label:R(e.label,i)})),[f,i]);return p(x,{name:v,control:a,rules:o?F(o):void 0,render:({field:e,fieldState:t})=>p(q,{...e,label:i(g),value:e.value??void 0,onChange:l=>{const h=typeof l=="string"?l:l.target.value;e.onChange(h)},options:C,error:!!t.error,helperText:t.error?.message,required:c})})}export{O as ControlledRadioField};
@@ -1 +1 @@
1
- "use client";import{jsx as u}from"react/jsx-runtime";import{useMemo as S}from"react";import{Controller as x}from"react-hook-form";import{useCrudList as L}from"../../../useCrudList";import R from"../../form/fields/ReferenceFieldComponent";import{convertValidationRules as _}from"../types";const j=["name","title","label","displayName"];function p(e,n,o){if(n?.length){const r=n.map(l=>e[l]).filter(l=>l!=null&&l!=="");if(r.length)return r.join(" ")}if(o&&e[o]!=null&&e[o]!=="")return String(e[o]);for(const r of j)if(e[r]!=null&&e[r]!=="")return String(e[r]);return e.id??"?"}function y(e){const{control:n,errors:o,fieldConfig:r,t:l,placeholder:c,required:b}=e,{name:g,label:h,validation:t,options:d={}}=r,s=t?.reference,a=d.fieldSpecific,{items:f,loading:C}=L(s??"__disabled__",{enabled:!!s}),v=S(()=>f.map(i=>({id:i.id,label:p(i,a?.labelFields,a?.displayField)})),[f,a?.labelFields,a?.displayField]);return u(x,{name:g,control:n,rules:t?_(t):void 0,render:({field:i,fieldState:m})=>u(R,{label:l(h),value:i.value??"",onChange:F=>i.onChange(F),onBlur:i.onBlur,options:v,isLoading:C,error:!!m.error,helperText:m.error?.message,required:b,placeholder:c||d.placeholder})})}export{y as ControlledReferenceField,p as buildReferenceLabel};
1
+ "use client";import{jsx as m}from"react/jsx-runtime";import{useMemo as S}from"react";import{Controller as _}from"react-hook-form";import{useCrudList as x}from"../../../useCrudList";import y from"../../form/fields/ReferenceFieldComponent";import{convertValidationRules as L}from"../types";const R=["name","title","label","displayName"];function p(e,n,i){if(n?.length){const r=n.map(l=>e[l]).filter(l=>l!=null&&l!=="");if(r.length)return r.join(" ")}if(i&&e[i]!=null&&e[i]!=="")return String(e[i]);for(const r of R)if(e[r]!=null&&e[r]!=="")return String(e[r]);return e.id??"?"}function j(e){const{control:n,errors:i,fieldConfig:r,t:l,placeholder:c,required:b}=e,{name:g,label:h,validation:a,options:d={}}=r,s=a?.reference,t=d.fieldSpecific,{items:f,loading:C}=x(s??"__disabled__",{enabled:!!s}),v=S(()=>f.map(o=>({id:o.id,label:p(o,t?.labelFields,t?.displayField)})),[f,t?.labelFields,t?.displayField]);return m(_,{name:g,control:n,rules:a?L(a):void 0,render:({field:o,fieldState:u})=>m(y,{label:l(h),value:o.value??"",onChange:F=>o.onChange(F),onBlur:o.onBlur,options:v,isLoading:C,error:!!u.error,helperText:u.error?.message,required:b,placeholder:c||d.placeholder})})}export{j as ControlledReferenceField,p as buildReferenceLabel};
@@ -1 +1 @@
1
- "use client";function i(n){if(n){if(n instanceof RegExp)return n;try{const t=/^\/(.*)\/([gimyus]*)$/.exec(n);if(t){const[,r,e]=t;if(r)return new RegExp(r,e)}return new RegExp(n)}catch{return}}}function a(n){if(!n)return{};const t={};return n.required!==void 0&&(t.required=n.required),n.min!==void 0&&(t.min=n.min),n.max!==void 0&&(t.max=n.max),n.minLength!==void 0&&(t.minLength=n.minLength),n.maxLength!==void 0&&(t.maxLength=n.maxLength),n.pattern&&typeof n.pattern=="string"&&(t.pattern={value:i(n.pattern)||/.*/,message:"Invalid format"}),t}export{i as convertPatternToRegex,a as convertValidationRules};
1
+ "use client";function i(e){if(e){if(e instanceof RegExp)return e;try{const t=/^\/(.*)\/([gimyus]*)$/.exec(e);if(t){const[,r,n]=t;if(r)return new RegExp(r,n)}return new RegExp(e)}catch{return}}}function a(e){if(!e)return{};const t={};return e.required!==void 0&&(t.required=e.required),e.min!==void 0&&(t.min=e.min),e.max!==void 0&&(t.max=e.max),e.minLength!==void 0&&(t.minLength=e.minLength),e.maxLength!==void 0&&(t.maxLength=e.maxLength),e.pattern&&typeof e.pattern=="string"&&(t.pattern={value:i(e.pattern)||/.*/,message:"Invalid format"}),t}export{i as convertPatternToRegex,a as convertValidationRules};
@@ -1 +1 @@
1
- import{jsx as t}from"react/jsx-runtime";import{Avatar as n,Text as p}from"@donotdev/components";const l=({config:a,value:s,t:u,className:e,size:r="md"})=>{if(!s)return t(p,{as:"span",variant:"muted",className:e,children:"-"});const i={sm:"size-touch",md:"size-touch",lg:"h-16 w-16"},c=m=>m.split(" ").map(o=>o.charAt(0)).slice(0,2).join("").toUpperCase();return t(n,{src:s,alt:a.label||"Avatar",fallback:c(a.label||"AV"),className:`${i[r]} ${e||""}`})};var d=l;export{l as AvatarFieldDisplay,d as default};
1
+ import{jsx as e}from"react/jsx-runtime";import{Avatar as n,Text as p}from"@donotdev/components";const l=({config:a,value:s,t:d,className:t,size:r="md"})=>{if(!s)return e(p,{as:"span",variant:"muted",className:t,children:"-"});const i={sm:"size-touch",md:"size-touch",lg:"h-16 w-16"},c=m=>m.split(" ").map(o=>o.charAt(0)).slice(0,2).join("").toUpperCase();return e(n,{src:s,alt:a.label||"Avatar",fallback:c(a.label||"AV"),className:`${i[r]} ${t||""}`})};var u=l;export{l as AvatarFieldDisplay,u as default};
@@ -1 +1 @@
1
- import{jsx as o}from"react/jsx-runtime";import{Badge as l,Text as n}from"@donotdev/components";const s=({config:m,value:a,t:r,className:e})=>{if(a==null)return o(n,{as:"span",variant:"muted",className:e,children:"-"});const t=typeof a=="boolean"?r(a?"common.yes":"common.no"):String(a);return o(l,{variant:typeof a=="boolean"?a?"default":"secondary":"outline",className:e,children:t})};var i=s;export{s as BadgeFieldDisplay,i as default};
1
+ import{jsx as o}from"react/jsx-runtime";import{Badge as r,Text as l}from"@donotdev/components";const n=({config:m,value:a,t:s,className:e})=>{if(a==null)return o(l,{as:"span",variant:"muted",className:e,children:"-"});const t=typeof a=="boolean"?s(a?"common.yes":"common.no"):String(a);return o(r,{variant:typeof a=="boolean"?a?"default":"secondary":"outline",className:e,children:t})};var i=n;export{n as BadgeFieldDisplay,i as default};
@@ -1 +1 @@
1
- const t=()=>null;var a=t;export{t as ButtonFieldDisplay,a as default};
1
+ const a=()=>null;var t=a;export{a as ButtonFieldDisplay,t as default};
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import{Badge as c,Text as n}from"@donotdev/components";const r=({config:m,value:a,t,className:s})=>{if(a==null)return e(n,{as:"span",variant:"muted",className:s,children:"-"});const o=t(a?"common.yes":"common.no");return e(c,{variant:a?"default":"secondary",className:s,children:o})};var l=r;export{r as CheckboxFieldDisplay,l as default};
1
+ import{jsx as s}from"react/jsx-runtime";import{Badge as t,Text as c}from"@donotdev/components";const n=({config:m,value:a,t:o,className:e})=>{if(a==null)return s(c,{as:"span",variant:"muted",className:e,children:"-"});const r=o(a?"common.yes":"common.no");return s(t,{variant:a?"default":"secondary",className:e,children:r})};var l=n;export{n as CheckboxFieldDisplay,l as default};
@@ -1 +1 @@
1
- import{jsx as a,jsxs as o}from"react/jsx-runtime";import{Text as s,Spinner as p}from"@donotdev/components";import{getI18nInstance as u}from"@donotdev/core";const l=({config:c,value:n,t:g,className:e,loading:m=!1})=>{if(m)return a(p,{className:e});if(!n)return a(s,{as:"span",variant:"muted",className:e,children:"-"});try{const r=new Date(n),t=u()?.language,i=r.toLocaleDateString(t),d=r.toLocaleTimeString(t);return c.type==="date"?a(s,{as:"span",className:e,children:i}):o("div",{className:e,children:[a(s,{as:"span",children:i}),a(s,{as:"span",variant:"muted",level:"small",children:d})]})}catch{return a(s,{as:"span",variant:"muted",className:e,children:"-"})}};var f=l;export{l as DateFieldDisplay,f as default};
1
+ import{jsx as a,jsxs as d}from"react/jsx-runtime";import{Text as e,Spinner as p}from"@donotdev/components";import{getI18nInstance as u}from"@donotdev/core";const i=({config:c,value:t,t:g,className:s,loading:m=!1})=>{if(m)return a(p,{className:s});if(!t)return a(e,{as:"span",variant:"muted",className:s,children:"-"});try{const n=new Date(t),r=u()?.language,l=n.toLocaleDateString(r),o=n.toLocaleTimeString(r);return c.type==="date"?a(e,{as:"span",className:s,children:l}):d("div",{className:s,children:[a(e,{as:"span",children:l}),a(e,{as:"span",variant:"muted",level:"small",children:o})]})}catch{return a(e,{as:"span",variant:"muted",className:s,children:"-"})}};var f=i;export{i as DateFieldDisplay,f as default};
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import{Badge as r,BADGE_VARIANT as i,Text as n}from"@donotdev/components";const o=({config:c,value:a,t:l,className:s})=>a?e(r,{variant:i.OUTLINE,className:s,children:a}):e(n,{as:"span",variant:"muted",className:s,children:"-"});var t=o;export{o as DropdownDisplay,t as default};
1
+ import{jsx as e}from"react/jsx-runtime";import{Badge as t,BADGE_VARIANT as o,Text as i}from"@donotdev/components";const r=({config:n,value:a,t:c,className:s})=>a?e(t,{variant:o.OUTLINE,className:s,children:a}):e(i,{as:"span",variant:"muted",className:s,children:"-"});var l=r;export{r as DropdownDisplay,l as default};
@@ -1 +1 @@
1
- import{jsx as e,jsxs as l}from"react/jsx-runtime";import{Badge as n,BADGE_VARIANT as t,Text as i,Stack as c}from"@donotdev/components";const r=({config:o,value:a,t:m,className:s})=>a?l(c,{direction:"row",align:"center",className:s,children:[e(i,{as:"span",level:"small",children:a.name}),a.size&&l(n,{variant:t.SECONDARY,children:[(a.size/1024).toFixed(1)," KB"]})]}):e(i,{as:"span",variant:"muted",className:s,children:"-"});var d=r;export{r as FileFieldDisplay,d as default};
1
+ import{jsx as s,jsxs as i}from"react/jsx-runtime";import{Badge as n,BADGE_VARIANT as t,Text as l,Stack as c}from"@donotdev/components";const r=({config:m,value:a,t:o,className:e})=>a?i(c,{direction:"row",align:"center",className:e,children:[s(l,{as:"span",level:"small",children:a.name}),a.size&&i(n,{variant:t.SECONDARY,children:[(a.size/1024).toFixed(1)," KB"]})]}):s(l,{as:"span",variant:"muted",className:e,children:"-"});var d=r;export{r as FileFieldDisplay,d as default};
@@ -1 +1 @@
1
- import{jsx as o,jsxs as i}from"react/jsx-runtime";import{Text as e}from"@donotdev/components";const l=({config:t,value:a,t:m,className:s})=>!a||a.lat===void 0&&a.lng===void 0?o(e,{as:"span",variant:"muted",className:s,children:"-"}):i(e,{as:"div",level:"small",className:`font-mono ${s||""}`,children:[a.lat?.toFixed(6),", ",a.lng?.toFixed(6)]});var d=l;export{l as GeoPointFieldDisplay,d as default};
1
+ import{jsx as o,jsxs as t}from"react/jsx-runtime";import{Text as l}from"@donotdev/components";const e=({config:d,value:a,t:m,className:s})=>!a||a.lat===void 0&&a.lng===void 0?o(l,{as:"span",variant:"muted",className:s,children:"-"}):t(l,{as:"div",level:"small",className:`font-mono ${s||""}`,children:[a.lat?.toFixed(6),", ",a.lng?.toFixed(6)]});var i=e;export{e as GeoPointFieldDisplay,i as default};
@@ -1 +1 @@
1
- const l=()=>null;var a=l;export{l as HiddenFieldDisplay,a as default};
1
+ const a=()=>null;var l=a;export{a as HiddenFieldDisplay,l as default};
@@ -1 +1 @@
1
- import{jsx as l}from"react/jsx-runtime";import{Avatar as n,Text as p}from"@donotdev/components";const t=({config:a,value:s,t:u,className:e,size:r="md"})=>{if(!s)return l(p,{as:"span",variant:"muted",className:e,children:"-"});const i={sm:"size-touch",md:"size-touch",lg:"h-16 w-16"},c=m=>m.split(" ").map(o=>o.charAt(0)).slice(0,2).join("").toUpperCase();return l(n,{src:s,alt:a.label||"Image",fallback:c(a.label||"IMG"),className:`${i[r]} ${e||""}`})};var d=t;export{t as ImageFieldDisplay,d as default};
1
+ import{jsx as t}from"react/jsx-runtime";import{Avatar as n,Text as p}from"@donotdev/components";const l=({config:a,value:s,t:d,className:e,size:r="md"})=>{if(!s)return t(p,{as:"span",variant:"muted",className:e,children:"-"});const i={sm:"size-touch",md:"size-touch",lg:"h-16 w-16"},c=m=>m.split(" ").map(o=>o.charAt(0)).slice(0,2).join("").toUpperCase();return t(n,{src:s,alt:a.label||"Image",fallback:c(a.label||"IMG"),className:`${i[r]} ${e||""}`})};var u=l;export{l as ImageFieldDisplay,u as default};
@@ -1 +1 @@
1
- import{jsx as n}from"react/jsx-runtime";import{Text as i}from"@donotdev/components";const o=({config:l,value:e,t:r,className:t})=>{if(!e)return n(i,{as:"span",variant:"muted",className:t,children:"-"});const s=(()=>{switch(l.type){case"email":return{href:`mailto:${e}`,"aria-label":r("common.sendEmailTo",{email:e})};case"tel":return{href:`tel:${e}`,"aria-label":r("common.callNumber",{number:e})};default:return{href:e,target:"_blank",rel:"noopener noreferrer","aria-label":r("common.openLink")}}})();return n("a",{...s,className:t||"",style:{color:"var(--primary)",textDecoration:"none"},onMouseEnter:a=>a.currentTarget.style.textDecoration="underline",onMouseLeave:a=>a.currentTarget.style.textDecoration="none",children:e})};var c=o;export{o as LinkFieldDisplay,c as default};
1
+ import{jsx as t}from"react/jsx-runtime";import{Text as i}from"@donotdev/components";const o=({config:l,value:e,t:r,className:n})=>{if(!e)return t(i,{as:"span",variant:"muted",className:n,children:"-"});const s=(()=>{switch(l.type){case"email":return{href:`mailto:${e}`,"aria-label":r("common.sendEmailTo",{email:e})};case"tel":return{href:`tel:${e}`,"aria-label":r("common.callNumber",{number:e})};default:return{href:e,target:"_blank",rel:"noopener noreferrer","aria-label":r("common.openLink")}}})();return t("a",{...s,className:n||"",style:{color:"var(--primary)",textDecoration:"none"},onMouseEnter:a=>a.currentTarget.style.textDecoration="underline",onMouseLeave:a=>a.currentTarget.style.textDecoration="none",children:e})};var c=o;export{o as LinkFieldDisplay,c as default};
@@ -1 +1 @@
1
- import{jsx as o,jsxs as i}from"react/jsx-runtime";import{Text as l}from"@donotdev/components";const e=({config:m,value:a,t:r,className:s})=>!a||a.lat===void 0&&a.lng===void 0?o(l,{as:"span",variant:"muted",className:s,children:"-"}):i(l,{as:"div",level:"small",className:`font-mono ${s||""}`,children:[a.lat?.toFixed(6),", ",a.lng?.toFixed(6)]});var d=e;export{e as MapFieldDisplay,d as default};
1
+ import{jsx as o,jsxs as t}from"react/jsx-runtime";import{Text as l}from"@donotdev/components";const e=({config:d,value:a,t:m,className:s})=>!a||a.lat===void 0&&a.lng===void 0?o(l,{as:"span",variant:"muted",className:s,children:"-"}):t(l,{as:"div",level:"small",className:`font-mono ${s||""}`,children:[a.lat?.toFixed(6),", ",a.lng?.toFixed(6)]});var i=e;export{e as MapFieldDisplay,i as default};
@@ -1 +1 @@
1
- import{jsx as s}from"react/jsx-runtime";import{Badge as n,BADGE_VARIANT as o,Text as c,Stack as l}from"@donotdev/components";const t=({config:p,value:a,t:d,className:r})=>!a||!Array.isArray(a)||a.length===0?s(c,{as:"span",variant:"muted",className:r,children:"-"}):s(l,{direction:"row",wrap:"wrap",className:r,children:a.map((e,i)=>s(n,{variant:o.OUTLINE,children:String(e)},i))});var m=t;export{t as MultiDropdownDisplay,m as default};
1
+ import{jsx as r}from"react/jsx-runtime";import{Badge as n,BADGE_VARIANT as l,Text as o,Stack as c}from"@donotdev/components";const t=({config:p,value:a,t:d,className:s})=>!a||!Array.isArray(a)||a.length===0?r(o,{as:"span",variant:"muted",className:s,children:"-"}):r(c,{direction:"row",wrap:"wrap",className:s,children:a.map((e,i)=>r(n,{variant:l.OUTLINE,children:String(e)},i))});var m=t;export{t as MultiDropdownDisplay,m as default};
@@ -1 +1 @@
1
- import{jsx as s}from"react/jsx-runtime";import{Badge as l,BADGE_VARIANT as n,Text as c,Stack as m}from"@donotdev/components";const e=({config:p,value:a,t:d,className:t})=>!a||!Array.isArray(a)||a.length===0?s(c,{as:"span",variant:"muted",className:t,children:"-"}):s(m,{direction:"row",wrap:"wrap",className:t,children:a.map((r,i)=>s(l,{variant:n.OUTLINE,children:String(r)},i))});var o=e;export{e as MultiInputTextFieldDisplay,o as default};
1
+ import{jsx as r}from"react/jsx-runtime";import{Badge as l,BADGE_VARIANT as n,Text as c,Stack as m}from"@donotdev/components";const e=({config:p,value:a,t:d,className:s})=>!a||!Array.isArray(a)||a.length===0?r(c,{as:"span",variant:"muted",className:s,children:"-"}):r(m,{direction:"row",wrap:"wrap",className:s,children:a.map((t,i)=>r(l,{variant:n.OUTLINE,children:String(t)},i))});var o=e;export{e as MultiInputTextFieldDisplay,o as default};
@@ -1 +1 @@
1
- import{jsx as s}from"react/jsx-runtime";import{Text as n,Spinner as o}from"@donotdev/components";import{getI18nInstance as m}from"@donotdev/core";const t=({config:r,value:e,t:c,className:a,loading:l=!1})=>l?s(o,{className:a}):e==null?s(n,{as:"span",variant:"muted",className:a,children:"-"}):s(n,{as:"span",className:`font-mono ${a||""}`,children:e.toLocaleString(m()?.language)});var i=t;export{t as NumberFieldDisplay,i as default};
1
+ import{jsx as s}from"react/jsx-runtime";import{Text as e,Spinner as o}from"@donotdev/components";import{getI18nInstance as r}from"@donotdev/core";const l=({config:i,value:n,t:c,className:a,loading:t=!1})=>t?s(o,{className:a}):n==null?s(e,{as:"span",variant:"muted",className:a,children:"-"}):s(e,{as:"span",className:`font-mono ${a||""}`,children:n.toLocaleString(r()?.language)});var m=l;export{l as NumberFieldDisplay,m as default};
@@ -1 +1 @@
1
- import{jsx as o,jsxs as r}from"react/jsx-runtime";import{Eye as c,EyeOff as n}from"lucide-react";import{useState as u}from"react";import{Skeleton as m,Button as y,CopyToClipboard as f,Stack as i}from"@donotdev/components";const l=({config:w,value:e,t:s,className:t,loading:p=!1})=>{const[a,d]=u(!1);return p?o(m,{className:t}):e?r(i,{direction:"row",align:"center",className:t,children:[o("span",{style:{fontFamily:"monospace"},children:a?e:"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022"}),r(i,{direction:"row",align:"center",gap:"tight",children:[o(y,{type:"button",onClick:()=>d(!a),"aria-label":a?"Hide password":"Show password",children:a?o(n,{}):o(c,{})}),o(f,{text:e,tooltipText:s("copyToClipboard")||"Copy to clipboard",copiedTooltipText:s("copied")||"Copied!",ariaLabel:s("copyPassword")||"Copy password"})]})]}):o("div",{style:{color:"var(--muted-foreground)"},children:"-"})};var g=l;export{l as PasswordFieldDisplay,g as default};
1
+ import{jsx as o,jsxs as i}from"react/jsx-runtime";import{Eye as c,EyeOff as n}from"lucide-react";import{useState as u}from"react";import{Skeleton as m,Button as y,CopyToClipboard as f,Stack as t}from"@donotdev/components";const l=({config:g,value:e,t:r,className:s,loading:d=!1})=>{const[a,p]=u(!1);return d?o(m,{className:s}):e?i(t,{direction:"row",align:"center",className:s,children:[o("span",{style:{fontFamily:"monospace"},children:a?e:"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022"}),i(t,{direction:"row",align:"center",gap:"tight",children:[o(y,{type:"button",onClick:()=>p(!a),"aria-label":a?"Hide password":"Show password",children:a?o(n,{}):o(c,{})}),o(f,{text:e,tooltipText:r("copyToClipboard")||"Copy to clipboard",copiedTooltipText:r("copied")||"Copied!",ariaLabel:r("copyPassword")||"Copy password"})]})]}):o("div",{style:{color:"var(--muted-foreground)"},children:"-"})};var w=l;export{l as PasswordFieldDisplay,w as default};
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import{Badge as l,BADGE_VARIANT as o,Text as r}from"@donotdev/components";const i=({config:c,value:a,t:d,className:s})=>a?e(l,{variant:o.OUTLINE,className:s,children:a}):e(r,{as:"span",variant:"muted",className:s,children:"-"});var t=i;export{i as RadioFieldDisplay,t as default};
1
+ import{jsx as e}from"react/jsx-runtime";import{Badge as r,BADGE_VARIANT as t,Text as l}from"@donotdev/components";const i=({config:c,value:a,t:d,className:s})=>a?e(r,{variant:t.OUTLINE,className:s,children:a}):e(l,{as:"span",variant:"muted",className:s,children:"-"});var o=i;export{i as RadioFieldDisplay,o as default};
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import{Text as l}from"@donotdev/components";const o=({config:n,value:a,t:m,className:s})=>a==null?e(l,{as:"span",variant:"muted",className:s,children:"-"}):e(l,{as:"span",className:`font-mono ${s||""}`,children:a});var t=o;export{o as RangeFieldDisplay,t as default};
1
+ import{jsx as e}from"react/jsx-runtime";import{Text as l}from"@donotdev/components";const n=({config:t,value:a,t:m,className:s})=>a==null?e(l,{as:"span",variant:"muted",className:s,children:"-"}):e(l,{as:"span",className:`font-mono ${s||""}`,children:a});var o=n;export{n as RangeFieldDisplay,o as default};
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import{Badge as n,BADGE_VARIANT as r,Text as m}from"@donotdev/components";const t=({config:c,value:a,t:d,className:s})=>{if(!a)return e(m,{as:"span",variant:"muted",className:s,children:"-"});const i=a.displayName||a.name||a.id||a;return e(n,{variant:r.OUTLINE,className:s,children:String(i)})};var l=t;export{t as ReferenceFieldDisplay,l as default};
1
+ import{jsx as s}from"react/jsx-runtime";import{Badge as i,BADGE_VARIANT as n,Text as l}from"@donotdev/components";const r=({config:c,value:a,t:d,className:e})=>{if(!a)return s(l,{as:"span",variant:"muted",className:e,children:"-"});const t=a.displayName||a.name||a.id||a;return s(i,{variant:n.OUTLINE,className:e,children:String(t)})};var m=r;export{r as ReferenceFieldDisplay,m as default};
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import{Text as l}from"@donotdev/components";const t=({config:i,value:a,t:m,className:s})=>a?e(l,{as:"div",level:"small",className:`whitespace-pre-wrap ${s||""}`,children:a}):e(l,{as:"span",variant:"muted",className:s,children:"-"});var r=t;export{t as TextAreaDisplay,r as default};
1
+ import{jsx as s}from"react/jsx-runtime";import{Text as l}from"@donotdev/components";const r=({config:i,value:a,t:m,className:e})=>a?s(l,{as:"div",level:"small",className:`whitespace-pre-wrap ${e||""}`,children:a}):s(l,{as:"span",variant:"muted",className:e,children:"-"});var t=r;export{r as TextAreaDisplay,t as default};
@@ -1 +1 @@
1
- import{jsx as e,jsxs as n}from"react/jsx-runtime";import{Mail as k,Calendar as L,Clock as I}from"lucide-react";import{useState as A}from"react";import{Skeleton as T,Badge as B,BADGE_VARIANT as E,Text as l,cn as f,CopyToClipboard as x,Stack as o}from"@donotdev/components";import{getWeekFromISOString as M,getI18nInstance as C}from"@donotdev/core";const b=({config:i,value:a,t:r,className:s,loading:w=!1,showCopy:u=!1,asBadge:v=!1,truncate:c=!1,maxLength:d=50,showLabel:p=!1})=>{const[j,m]=A(!1),F=async()=>{try{await navigator.clipboard.writeText(a),m(!0),setTimeout(()=>m(!1),2e3)}catch{}},h=()=>{switch(i.type){case"email":return e(k,{});case"month":case"week":return e(L,{});case"time":return e(I,{});default:return null}},S=t=>{if(!t)return null;switch(i.type){case"email":return n("a",{href:`mailto:${t}`,style:{display:"flex",alignItems:"center",gap:"var(--gap-sm)"},onMouseEnter:g=>g.currentTarget.style.textDecoration="underline",onMouseLeave:g=>g.currentTarget.style.textDecoration="none",children:[h(),t]});case"month":return new Date(t).toLocaleDateString(C()?.language,{year:"numeric",month:"long"});case"week":return M(t);case"time":return new Date(`2000-01-01T${t}`).toLocaleTimeString(C()?.language);default:return t}},D=t=>!c||t.length<=d?t:`${t.substring(0,d)}...`;if(w)return n(o,{gap:"tight",children:[p&&e(T,{style:{height:"1rem",width:"6rem"}}),e(T,{className:"dndev-w-full",style:{height:"1.5rem"}})]});if(!a)return n(o,{gap:"tight",children:[p&&e(l,{as:"span",variant:"muted",children:i.label||i.name}),e(l,{as:"span",variant:"muted",className:f(s),style:{fontStyle:"italic"},children:r("common.noValue",{defaultValue:"No value"})})]});const N=S(a),y=D(String(N));return v?n(o,{direction:"row",align:"center",gap:"tight",children:[h(),e(B,{variant:E.SECONDARY,className:s,children:y}),u&&e(x,{text:a,tooltipText:r("copyToClipboard")||"Copy to clipboard",copiedTooltipText:r("copied")||"Copied!",ariaLabel:r("copyToClipboard")||"Copy to clipboard"})]}):n(o,{gap:"tight",children:[p&&e(l,{as:"span",variant:"muted",children:i.label||i.name}),n(o,{direction:"row",align:"center",gap:"tight",children:[e("div",{className:f("dndev-flex-1",c&&"truncate",s),title:c&&a.length>d?a:void 0,children:e(l,{as:"span",children:y})}),u&&e(x,{text:a,tooltipText:r("copyToClipboard")||"Copy to clipboard",copiedTooltipText:r("copied")||"Copied!",ariaLabel:r("copyToClipboard")||"Copy to clipboard"})]})]})};var V=b;export{b as TextFieldDisplay,V as default};
1
+ import{jsx as e,jsxs as n}from"react/jsx-runtime";import{Mail as L,Calendar as k,Clock as I}from"lucide-react";import{useState as A}from"react";import{Skeleton as T,Badge as B,BADGE_VARIANT as E,Text as l,cn as f,CopyToClipboard as x,Stack as i}from"@donotdev/components";import{getWeekFromISOString as M,getI18nInstance as b}from"@donotdev/core";const C=({config:o,value:a,t:r,className:s,loading:v=!1,showCopy:u=!1,asBadge:w=!1,truncate:c=!1,maxLength:d=50,showLabel:p=!1})=>{const[j,m]=A(!1),F=async()=>{try{await navigator.clipboard.writeText(a),m(!0),setTimeout(()=>m(!1),2e3)}catch{}},h=()=>{switch(o.type){case"email":return e(L,{});case"month":case"week":return e(k,{});case"time":return e(I,{});default:return null}},S=t=>{if(!t)return null;switch(o.type){case"email":return n("a",{href:`mailto:${t}`,style:{display:"flex",alignItems:"center",gap:"var(--gap-sm)"},onMouseEnter:g=>g.currentTarget.style.textDecoration="underline",onMouseLeave:g=>g.currentTarget.style.textDecoration="none",children:[h(),t]});case"month":return new Date(t).toLocaleDateString(b()?.language,{year:"numeric",month:"long"});case"week":return M(t);case"time":return new Date(`2000-01-01T${t}`).toLocaleTimeString(b()?.language);default:return t}},D=t=>!c||t.length<=d?t:`${t.substring(0,d)}...`;if(v)return n(i,{gap:"tight",children:[p&&e(T,{style:{height:"1rem",width:"6rem"}}),e(T,{className:"dndev-w-full",style:{height:"1.5rem"}})]});if(!a)return n(i,{gap:"tight",children:[p&&e(l,{as:"span",variant:"muted",children:o.label||o.name}),e(l,{as:"span",variant:"muted",className:f(s),style:{fontStyle:"italic"},children:r("common.noValue",{defaultValue:"No value"})})]});const N=S(a),y=D(String(N));return w?n(i,{direction:"row",align:"center",gap:"tight",children:[h(),e(B,{variant:E.SECONDARY,className:s,children:y}),u&&e(x,{text:a,tooltipText:r("copyToClipboard")||"Copy to clipboard",copiedTooltipText:r("copied")||"Copied!",ariaLabel:r("copyToClipboard")||"Copy to clipboard"})]}):n(i,{gap:"tight",children:[p&&e(l,{as:"span",variant:"muted",children:o.label||o.name}),n(i,{direction:"row",align:"center",gap:"tight",children:[e("div",{className:f("dndev-flex-1",c&&"truncate",s),title:c&&a.length>d?a:void 0,children:e(l,{as:"span",children:y})}),u&&e(x,{text:a,tooltipText:r("copyToClipboard")||"Copy to clipboard",copiedTooltipText:r("copied")||"Copied!",ariaLabel:r("copyToClipboard")||"Copy to clipboard"})]})]})};var V=C;export{C as TextFieldDisplay,V as default};
@@ -1 +1 @@
1
- import{jsx as a,jsxs as m}from"react/jsx-runtime";import{Text as e}from"@donotdev/components";import{getI18nInstance as o}from"@donotdev/core";const i=({config:p,value:t,t:u,className:s})=>{if(!t)return a(e,{as:"span",variant:"muted",className:s,children:"-"});try{const r=new Date(t),n=o()?.language,l=r.toLocaleDateString(n),c=r.toLocaleTimeString(n);return m("div",{className:s,children:[a(e,{as:"span",children:l}),a(e,{as:"span",variant:"muted",level:"small",children:c})]})}catch{return a(e,{as:"span",variant:"muted",className:s,children:"-"})}};var d=i;export{i as TimestampFieldDisplay,d as default};
1
+ import{jsx as a,jsxs as m}from"react/jsx-runtime";import{Text as e}from"@donotdev/components";import{getI18nInstance as o}from"@donotdev/core";const i=({config:p,value:t,t:u,className:s})=>{if(!t)return a(e,{as:"span",variant:"muted",className:s,children:"-"});try{const n=new Date(t),r=o()?.language,l=n.toLocaleDateString(r),c=n.toLocaleTimeString(r);return m("div",{className:s,children:[a(e,{as:"span",children:l}),a(e,{as:"span",variant:"muted",level:"small",children:c})]})}catch{return a(e,{as:"span",variant:"muted",className:s,children:"-"})}};var d=i;export{i as TimestampFieldDisplay,d as default};
@@ -1 +1 @@
1
- import{default as a}from"./TextFieldDisplay";import{default as i}from"./BadgeFieldDisplay";import{default as s}from"./AvatarFieldDisplay";import{default as l}from"./LinkFieldDisplay";import{default as e}from"./DateFieldDisplay";import{default as t}from"./NumberFieldDisplay";import{default as o}from"./PhoneNumberDisplay";import{default as r}from"./TextAreaDisplay";import{default as p}from"./RichTextDisplay";import{default as m}from"./CheckboxFieldDisplay";import{default as d}from"./DropdownDisplay";import{default as f}from"./MultiDropdownDisplay";import{default as u}from"./MultiInputTextFieldDisplay";import{default as D}from"./RadioFieldDisplay";import{default as y}from"./RangeFieldDisplay";import{default as F}from"./FileFieldDisplay";import{default as n}from"./ImageFieldDisplay";import{default as x}from"./GeoPointFieldDisplay";import{default as T}from"./MapFieldDisplay";import{default as b}from"./ReferenceFieldDisplay";import{default as g}from"./TimestampFieldDisplay";import{default as M}from"./HiddenFieldDisplay";import{default as R}from"./ButtonFieldDisplay";export{s as AvatarFieldDisplay,i as BadgeFieldDisplay,R as ButtonFieldDisplay,m as CheckboxFieldDisplay,e as DateFieldDisplay,d as DropdownDisplay,F as FileFieldDisplay,x as GeoPointFieldDisplay,M as HiddenFieldDisplay,n as ImageFieldDisplay,l as LinkFieldDisplay,T as MapFieldDisplay,f as MultiDropdownDisplay,u as MultiInputTextFieldDisplay,t as NumberFieldDisplay,o as PhoneNumberDisplay,D as RadioFieldDisplay,y as RangeFieldDisplay,b as ReferenceFieldDisplay,p as RichTextDisplay,r as TextAreaDisplay,a as TextFieldDisplay,g as TimestampFieldDisplay};
1
+ import{default as a}from"./TextFieldDisplay";import{default as i}from"./BadgeFieldDisplay";import{default as s}from"./AvatarFieldDisplay";import{default as l}from"./LinkFieldDisplay";import{default as e}from"./DateFieldDisplay";import{default as t}from"./NumberFieldDisplay";import{default as o}from"./PhoneNumberDisplay";import{default as r}from"./TextAreaDisplay";import{default as p}from"./RichTextDisplay";import{default as m}from"./CheckboxFieldDisplay";import{default as d}from"./DropdownDisplay";import{default as f}from"./MultiDropdownDisplay";import{default as u}from"./MultiInputTextFieldDisplay";import{default as D}from"./RadioFieldDisplay";import{default as y}from"./RangeFieldDisplay";import{default as F}from"./FileFieldDisplay";import{default as n}from"./ImageFieldDisplay";import{default as x}from"./GeoPointFieldDisplay";import{default as T}from"./MapFieldDisplay";import{default as R}from"./ReferenceFieldDisplay";import{default as b}from"./TimestampFieldDisplay";import{default as g}from"./HiddenFieldDisplay";import{default as M}from"./ButtonFieldDisplay";export{s as AvatarFieldDisplay,i as BadgeFieldDisplay,M as ButtonFieldDisplay,m as CheckboxFieldDisplay,e as DateFieldDisplay,d as DropdownDisplay,F as FileFieldDisplay,x as GeoPointFieldDisplay,g as HiddenFieldDisplay,n as ImageFieldDisplay,l as LinkFieldDisplay,T as MapFieldDisplay,f as MultiDropdownDisplay,u as MultiInputTextFieldDisplay,t as NumberFieldDisplay,o as PhoneNumberDisplay,D as RadioFieldDisplay,y as RangeFieldDisplay,R as ReferenceFieldDisplay,p as RichTextDisplay,r as TextAreaDisplay,a as TextFieldDisplay,b as TimestampFieldDisplay};
@@ -14,11 +14,14 @@ export interface AddressFieldComponentProps {
14
14
  /** Change handler */
15
15
  onChange: (value: any) => void;
16
16
  /**
17
- * Whether to enable Google Maps autocomplete (default: false)
18
- * Requires env var: VITE_GOOGLE_MAPS_API_KEY (Vite) or NEXT_PUBLIC_GOOGLE_MAPS_API_KEY (Next.js)
17
+ * Whether to enable Google Maps autocomplete (default: false).
18
+ * Requires env var: VITE_GOOGLE_MAPS_API_KEY (Vite) or NEXT_PUBLIC_GOOGLE_MAPS_API_KEY (Next.js).
19
19
  */
20
20
  enableGoogleMaps?: boolean;
21
- /** Whether to extract district code for Paris addresses */
21
+ /**
22
+ * Whether to extract district_code (last 2 digits of postal code, "92" prefix → 92)
23
+ * onto the address value.
24
+ */
22
25
  extractDistrictCode?: boolean;
23
26
  /** Error state */
24
27
  error?: boolean;
@@ -28,16 +31,15 @@ export interface AddressFieldComponentProps {
28
31
  required?: boolean;
29
32
  }
30
33
  /**
31
- * Address field component with Google Maps autocomplete
32
- * Integrates with Google Places API for address selection
34
+ * Address field component with Google Places autocomplete (new API).
33
35
  *
34
- * Environment variables required for Google Maps:
36
+ * Modes:
37
+ * - Manual (no API key or `enableGoogleMaps=false`): free-text via Combobox `creatable`.
38
+ * - Google: AutocompleteSuggestion + Place.fetchFields() with Geocoder fallback for coords.
39
+ *
40
+ * Env vars:
35
41
  * - Vite: VITE_GOOGLE_MAPS_API_KEY
36
42
  * - Next.js: NEXT_PUBLIC_GOOGLE_MAPS_API_KEY
37
- *
38
- * @component
39
- * @param {AddressFieldComponentProps} props - Component props
40
- * @returns {JSX.Element} Address input field with autocomplete
41
43
  */
42
44
  declare const AddressFieldComponent: ({ label, value, onChange, enableGoogleMaps, extractDistrictCode, error, helperText, required, }: AddressFieldComponentProps) => import("react/jsx-runtime").JSX.Element;
43
45
  export default AddressFieldComponent;
@@ -1 +1 @@
1
- {"version":3,"file":"AddressFieldComponent.d.ts","sourceRoot":"","sources":["../../../../src/components/form/fields/AddressFieldComponent.tsx"],"names":[],"mappings":"AAiBA;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,kBAAkB;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,2DAA2D;IAC3D,KAAK,CAAC,EAAE;QACN,iBAAiB,EAAE,MAAM,CAAC;QAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACpB,CAAC;IACF,qBAAqB;IACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IAC/B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,2DAA2D;IAC3D,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,kBAAkB;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,kBAAkB;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oCAAoC;IACpC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;;;;;;GAWG;AACH,QAAA,MAAM,qBAAqB,GAAI,iGAS5B,0BAA0B,4CAiT5B,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
1
+ {"version":3,"file":"AddressFieldComponent.d.ts","sourceRoot":"","sources":["../../../../src/components/form/fields/AddressFieldComponent.tsx"],"names":[],"mappings":"AAgBA;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,kBAAkB;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,2DAA2D;IAC3D,KAAK,CAAC,EAAE;QACN,iBAAiB,EAAE,MAAM,CAAC;QAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACpB,CAAC;IACF,qBAAqB;IACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IAC/B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;OAGG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,kBAAkB;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,kBAAkB;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oCAAoC;IACpC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAwFD;;;;;;;;;;GAUG;AACH,QAAA,MAAM,qBAAqB,GAAI,iGAS5B,0BAA0B,4CAsS5B,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
@@ -1 +1 @@
1
- import{jsx as a,jsxs as m}from"react/jsx-runtime";import{MapPin as R}from"lucide-react";import{useState as y,useEffect as w,useRef as S,useMemo as N}from"react";import{Combobox as L,Stack as M}from"@donotdev/components";import{useTranslation as U,getPlatformEnvVar as W}from"@donotdev/core";const Y=({label:b,value:l,onChange:x,enableGoogleMaps:T=!1,extractDistrictCode:q,error:i,helperText:c,required:z})=>{const{t:o}=U("crud"),[n,u]=y(l?.formatted_address||""),[g,f]=y([]),[E,p]=y(!1),v=S(null),h=S(null),d=S(null),_=W("GOOGLE_MAPS_API_KEY")||"",s=T&&!!_,G=N(()=>g.map(e=>({value:e.place_id,label:e.description,description:e.structured_formatting?.secondary_text,content:m("div",{style:{display:"flex",alignItems:"center",gap:"var(--gap-sm)"},children:[a(R,{style:{width:"var(--size-icon-sm)",height:"var(--size-icon-sm)"}}),m("div",{children:[a("div",{children:e.description}),e.structured_formatting?.secondary_text&&a("div",{style:{fontSize:"var(--font-size-xs)",color:"var(--muted-foreground)"},children:e.structured_formatting.secondary_text})]})]})})),[g]),K=e=>{h.current&&(p(!0),h.current.getDetails({placeId:e,fields:["formatted_address","geometry","address_components"]},(r,t)=>{if(p(!1),t===window.google?.maps?.places?.PlacesServiceStatus.OK&&r){const P=r.formatted_address||"",V=r.geometry?.location?.lat(),j=r.geometry?.location?.lng(),A={formatted_address:P,latitude:V,longitude:j};if(q&&r.address_components){const C=r.address_components.find(D=>D.types.includes("postal_code"))?.long_name||"",k=C.startsWith("92")?92:parseInt(C.slice(-2),10)||null;A.district_code=k}u(P),x(A)}}))};w(()=>{l?.formatted_address&&u(l.formatted_address)},[l]),w(()=>{if(!s)return;let e=null;const r=()=>{window.google?.maps?.places&&(v.current=new window.google.maps.places.AutocompleteService,h.current=new window.google.maps.places.PlacesService(document.createElement("div")))};return(()=>{if(window.google?.maps?.places){r();return}if(document.querySelector("#google-maps-script")){e=setInterval(()=>{window.google?.maps?.places&&(clearInterval(e),e=null,r())},100);return}const t=document.createElement("script");t.id="google-maps-script",t.src=`https://maps.googleapis.com/maps/api/js?key=${_}&libraries=places`,t.async=!0,t.defer=!0,t.onload=()=>r(),document.head.appendChild(t)})(),()=>{e!==null&&(clearInterval(e),e=null)}},[s,_]),w(()=>{if(!s||!n||!v.current){f([]);return}return d.current&&clearTimeout(d.current),d.current=setTimeout(()=>{p(!0),v.current.getPlacePredictions({input:n,types:["geocode","establishment"]},(e,r)=>{p(!1),r===window.google?.maps?.places?.PlacesServiceStatus.OK&&e?f(e):f([])})},300),()=>{d.current&&clearTimeout(d.current)}},[s,n]);const O=e=>{u(e),x({formatted_address:e})},I=e=>{const r=Array.isArray(e)?e[0]||"":e;if(!s){O(r);return}g.some(t=>t.place_id===r)&&K(r)};return s?m(M,{gap:"tight",children:[a(L,{label:b,value:n,onValueChange:I,onSearchChange:e=>{s&&u(e)},placeholder:o("address.placeholder","Enter address..."),emptyMessage:E?o("messages.loading","Loading..."):o("address.noResults","No addresses found"),options:G,required:z,variant:i?"destructive":void 0,isLoading:E,creatable:!0,createLabel:o("actions.use","Use this address")}),c&&a("p",{style:{fontSize:"var(--font-size-xs)",color:i?"var(--destructive-foreground)":"var(--muted-foreground)"},children:c})]}):m(M,{gap:"tight",children:[a(L,{label:b,value:n,onValueChange:I,placeholder:o("address.placeholder","Enter address..."),options:[],required:z,variant:i?"destructive":void 0,creatable:!0,createLabel:o("actions.use","Use this address")}),c&&a("p",{style:{fontSize:"var(--font-size-xs)",color:i?"var(--destructive-foreground)":"var(--muted-foreground)"},children:c})]})};var F=Y;export{F as default};
1
+ import{jsx as L,jsxs as V}from"react/jsx-runtime";import{useState as C,useEffect as q,useRef as B,useCallback as Z}from"react";import{Combobox as D,Stack as F}from"@donotdev/components";import{useTranslation as H,getPlatformEnvVar as Q}from"@donotdev/core";const K="dndev-address-autocomplete-cache",X=100;function $(){try{const o=typeof localStorage<"u"?localStorage.getItem(K):null;if(o)return new Map(JSON.parse(o))}catch{}return new Map}function ee(o){try{typeof localStorage<"u"&&localStorage.setItem(K,JSON.stringify([...o]))}catch{}}function W(o){if(o.size>X){const d=o.keys().next().value;d!==void 0&&o.delete(d)}}const z=$(),M=new Map;function te(o){const d={key:o,v:"weekly"},s="google",x="importLibrary",A="__ib__",m=document,u=window;u[s]=u[s]||{};const c=u[s].maps||(u[s].maps={}),l=new Set,a=new URLSearchParams,f=()=>c._p||(c._p=new Promise(async(S,p)=>{const h=m.createElement("script");a.set("libraries",[...l].join(","));for(const y of Object.keys(d))a.set(y.replace(/[A-Z]/g,E=>"_"+E[0].toLowerCase()),d[y]);a.set("callback",s+".maps."+A),h.src="https://maps.googleapis.com/maps/api/js?"+a,c[A]=S,h.onerror=()=>{c._p=null,p(new Error("Google Maps JS API could not load."))};const g=m.querySelector("script[nonce]");g?.nonce&&(h.nonce=g.nonce),m.head.append(h)}));c[x]||(c[x]=(S,...p)=>(l.add(S),f().then(()=>c[x](S,...p))))}const oe=({label:o,value:d,onChange:s,enableGoogleMaps:x=!1,extractDistrictCode:A,error:m,helperText:u,required:c})=>{const{t:l}=H("crud"),[a,f]=C(d?.formatted_address||""),[S,p]=C([]),[h,g]=C(!1),[y,E]=C(!1),[P,U]=C(!1),T=B(null),k=B(null),G=Q("GOOGLE_MAPS_API_KEY")||"",w=x&&!!G;q(()=>{const t=d?.formatted_address??"";f(e=>e===t?e:t)},[d]),q(()=>{if(!w||P)return;const t=window.google;if(t?.maps?.places?.AutocompleteSuggestion){T.current=new t.maps.places.AutocompleteSessionToken,U(!0);return}let e=!1;return(async()=>{try{if(window.google?.maps?.importLibrary||te(G),await window.google.maps.importLibrary("places"),e)return;T.current=new window.google.maps.places.AutocompleteSessionToken,U(!0)}catch{e||E(!0)}})(),()=>{e=!0}},[w,G,P]),q(()=>{if(!w||!P||y)return;if(a.length<3){p([]);return}const t=z.get(a);if(t){p(t);return}return k.current&&clearTimeout(k.current),k.current=setTimeout(async()=>{g(!0);try{const e=window.google.maps.places,{suggestions:v}=await e.AutocompleteSuggestion.fetchAutocompleteSuggestions({input:a,sessionToken:T.current}),b=v.filter(r=>r.placePrediction).map(r=>{const n=r.placePrediction,i=[n.mainText?.text,n.secondaryText?.text].filter(Boolean).join(", ");return M.set(i,n),W(M),{value:i,label:i}});p(b),z.set(a,b),W(z),ee(z)}catch{E(!0),p([])}finally{g(!1)}},300),()=>{k.current&&clearTimeout(k.current)}},[w,P,y,a]);const J=Z(async t=>{const e=Array.isArray(t)?t[0]||"":t;if(!e)return;if(!w){f(e),s({formatted_address:e});return}let v=M.get(e);const b=window.google?.maps?.places;if(b){if(!v){g(!0);try{const{suggestions:r}=await b.AutocompleteSuggestion.fetchAutocompleteSuggestions({input:e,sessionToken:T.current}),n=r.find(i=>[i.placePrediction?.mainText?.text,i.placePrediction?.secondaryText?.text].filter(Boolean).join(", ")===e);n?.placePrediction&&(v=n.placePrediction,M.set(e,v))}catch{}if(!v){g(!1),f(e),s({formatted_address:e});return}}g(!0);try{const r=v.toPlace();await r.fetchFields({fields:["formattedAddress","location","addressComponents"]});const n=r.formattedAddress||e;let i=r.location?.lat()??0,I=r.location?.lng()??0;if(i===0&&I===0&&n)try{const j=await window.google.maps.importLibrary("geocoding"),_=(await new j.Geocoder().geocode({address:n})).results?.[0]?.geometry?.location;_&&(i=_.lat(),I=_.lng())}catch{}const R={formatted_address:n,latitude:i,longitude:I};if(A){const j=r.addressComponents||[],_=j.find(O=>(O.types||[]).includes("postal_code"))?.longText||j.find(O=>(O.types||[]).includes("postal_code"))?.long_name||"",Y=_.startsWith("92")?92:parseInt(_.slice(-2),10)||null;R.district_code=Y}f(n),p([]),s(R),T.current=new b.AutocompleteSessionToken}catch{f(e),s({formatted_address:e})}finally{g(!1)}}},[w,A,s]),N=t=>{f(t)};return w?V(F,{gap:"tight",children:[L(D,{label:o,value:a,onValueChange:J,onSearchChange:N,placeholder:l("address.placeholder","Enter address..."),emptyMessage:h?l("messages.loading","Loading..."):l("address.noResults","No addresses found"),options:S.map(t=>({value:t.value,label:t.label})),required:c,variant:m?"destructive":void 0,isLoading:h,creatable:!0,createLabel:l("actions.use","Use this address"),disabled:!P&&!y}),y&&L("p",{style:{fontSize:"var(--font-size-xs)",color:"var(--muted-foreground)"},children:l("address.apiUnavailable","Google Places unavailable \u2014 type address manually")}),u&&L("p",{style:{fontSize:"var(--font-size-xs)",color:m?"var(--destructive-foreground)":"var(--muted-foreground)"},children:u})]}):V(F,{gap:"tight",children:[L(D,{label:o,value:a,onValueChange:J,onSearchChange:N,placeholder:l("address.placeholder","Enter address..."),options:[],required:c,variant:m?"destructive":void 0,creatable:!0,createLabel:l("actions.use","Use this address")}),u&&L("p",{style:{fontSize:"var(--font-size-xs)",color:m?"var(--destructive-foreground)":"var(--muted-foreground)"},children:u})]})};var ae=oe;export{ae as default};
@@ -1 +1 @@
1
- import{jsx as e,jsxs as o}from"react/jsx-runtime";import{Avatar as p,Input as u,cn as f,Stack as n}from"@donotdev/components";const s=({config:r,value:t,onChange:c,error:A,helperText:l,t:i,className:d,...v})=>{const h=a=>a.split(" ").map(m=>m.charAt(0)).slice(0,2).join("").toUpperCase();return o(n,{children:[o(n,{direction:"row",align:"center",children:[e(p,{src:t,alt:r.label||"Avatar",fallback:h(r.label||"AV"),style:{height:"var(--touch-target)",width:"var(--touch-target)"}}),e("div",{className:"dndev-flex-1",children:e(u,{type:"url",className:f("dndev-w-full",d),placeholder:i("common.enterAvatarUrl"),value:t,onChange:a=>c(a.target.value),...v})})]}),l&&e("p",{style:{fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)"},children:l})]})};var g=s;export{s as AvatarFieldComponent,g as default};
1
+ import{jsx as e,jsxs as o}from"react/jsx-runtime";import{Avatar as m,Input as u,cn as f,Stack as n}from"@donotdev/components";const s=({config:r,value:t,onChange:c,error:A,helperText:l,t:i,className:d,...h})=>{const v=a=>a.split(" ").map(p=>p.charAt(0)).slice(0,2).join("").toUpperCase();return o(n,{children:[o(n,{direction:"row",align:"center",children:[e(m,{src:t,alt:r.label||"Avatar",fallback:v(r.label||"AV"),style:{height:"var(--touch-target)",width:"var(--touch-target)"}}),e("div",{className:"dndev-flex-1",children:e(u,{type:"url",className:f("dndev-w-full",d),placeholder:i("common.enterAvatarUrl"),value:t,onChange:a=>c(a.target.value),...h})})]}),l&&e("p",{style:{fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)"},children:l})]})};var g=s;export{s as AvatarFieldComponent,g as default};
@@ -1 +1 @@
1
- import{jsx as e,jsxs as r}from"react/jsx-runtime";import{Badge as v,Input as f,cn as g,Stack as l}from"@donotdev/components";const o=({config:p,value:a,onChange:d,error:u,helperText:t,t:n,variant:s="default",className:i,...c})=>r(l,{children:[r(l,{direction:"row",align:"center",children:[e(v,{variant:s,style:{minWidth:0},children:a||n("common.badgePreview")}),e("div",{className:"dndev-flex-1",children:e(f,{type:"text",className:g("dndev-w-full",i),placeholder:n("common.enterBadgeText"),value:a,onChange:m=>d(m.target.value),...c})})]}),t&&e("p",{style:{fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)"},children:t})]});var h=o;export{o as BadgeFieldComponent,h as default};
1
+ import{jsx as e,jsxs as t}from"react/jsx-runtime";import{Badge as v,Input as f,cn as g,Stack as o}from"@donotdev/components";const l=({config:p,value:a,onChange:d,error:u,helperText:r,t:n,variant:s="default",className:i,...c})=>t(o,{children:[t(o,{direction:"row",align:"center",children:[e(v,{variant:s,style:{minWidth:0},children:a||n("common.badgePreview")}),e("div",{className:"dndev-flex-1",children:e(f,{type:"text",className:g("dndev-w-full",i),placeholder:n("common.enterBadgeText"),value:a,onChange:m=>d(m.target.value),...c})})]}),r&&e("p",{style:{fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)"},children:r})]});var h=l;export{l as BadgeFieldComponent,h as default};
@@ -1 +1 @@
1
- import{jsx as r}from"react/jsx-runtime";import{Button as e}from"@donotdev/components";const n=({label:a,type:t,onClick:i,variant:l,disabled:o=!1})=>r(e,{type:t,onClick:i,variant:l,disabled:o,children:a});var s=n;export{s as default};
1
+ import{jsx as o}from"react/jsx-runtime";import{Button as l}from"@donotdev/components";const n=({label:a,type:t,onClick:r,variant:e,disabled:i=!1})=>o(l,{type:t,onClick:r,variant:e,disabled:i,children:a});var s=n;export{s as default};
@@ -1 +1 @@
1
- import{jsx as h}from"react/jsx-runtime";import{Checkbox as d}from"@donotdev/components";const t=({label:r,checked:a=!1,onChange:e,required:c})=>h(d,{checked:a,onCheckedChange:o=>{e&&e({target:{checked:o}})},label:r,required:c});var n=t;export{n as default};
1
+ import{jsx as d}from"react/jsx-runtime";import{Checkbox as h}from"@donotdev/components";const t=({label:r,checked:a=!1,onChange:e,required:c})=>d(h,{checked:a,onCheckedChange:o=>{e&&e({target:{checked:o}})},label:r,required:c});var n=t;export{n as default};
@@ -1 +1 @@
1
- import{jsx as o,jsxs as c}from"react/jsx-runtime";import{useMemo as q,useId as D}from"react";import{Combobox as I,Stack as d}from"@donotdev/components";import{useTranslation as L}from"@donotdev/core";const N=({label:u,value:l,options:s,error:p,helperText:a,onChange:n,onBlur:m,required:g,placeholder:h,translationNamespace:v="dndev",placeholderKey:f="actions.select",placeholderDefault:b="Select",creatable:x=!1,createLabel:y,emptyMessage:S})=>{const{t:r}=L(v),i=D(),z=q(()=>s.map(e=>({value:String(e.value),label:e.label})),[s]),C=e=>{if(n){const $={target:{value:Array.isArray(e)?e[0]||"":e}};n($)}},A=e=>{e||m?.()},t=!!p,M=`${i}-error`,j=`${i}-helper`;return c(d,{gap:"tight",children:[o(I,{label:u,value:l||"",onValueChange:C,onOpenChange:A,placeholder:h||r(f,b),emptyMessage:S||r("messages.noResults","No results found"),creatable:x,createLabel:y||r("actions.create","Create"),options:z,required:g,variant:t?"destructive":void 0,clearable:!!l}),t&&c(d,{id:M,direction:"row",align:"center",gap:"tight",style:{fontSize:"var(--font-size-xs)",color:"var(--destructive-foreground)"},role:"alert",children:[o("span",{children:"\u26A0"}),a]}),a&&!t&&o("p",{id:j,style:{fontSize:"var(--font-size-xs)",color:"var(--muted-foreground)"},children:a})]})};var O=N;export{O as default};
1
+ import{jsx as o,jsxs as c}from"react/jsx-runtime";import{useMemo as L,useId as N}from"react";import{Combobox as $,Stack as d}from"@donotdev/components";import{useTranslation as D}from"@donotdev/core";const I=({label:u,value:l,options:s,error:p,helperText:r,onChange:n,onBlur:m,required:g,placeholder:h,translationNamespace:v="dndev",placeholderKey:f="actions.select",placeholderDefault:b="Select",creatable:x=!1,createLabel:y,emptyMessage:C})=>{const{t:a}=D(v),i=N(),z=L(()=>s.map(e=>({value:String(e.value),label:e.label})),[s]),S=e=>{if(n){const q={target:{value:Array.isArray(e)?e[0]||"":e}};n(q)}},A=e=>{e||m?.()},t=!!p,M=`${i}-error`,j=`${i}-helper`;return c(d,{gap:"tight",children:[o($,{label:u,value:l||"",onValueChange:S,onOpenChange:A,placeholder:h||a(f,b),emptyMessage:C||a("messages.noResults","No results found"),creatable:x,createLabel:y||a("actions.create","Create"),options:z,required:g,variant:t?"destructive":void 0,clearable:!!l}),t&&c(d,{id:M,direction:"row",align:"center",gap:"tight",style:{fontSize:"var(--font-size-xs)",color:"var(--destructive-foreground)"},role:"alert",children:[o("span",{children:"\u26A0"}),r]}),r&&!t&&o("p",{id:j,style:{fontSize:"var(--font-size-xs)",color:"var(--muted-foreground)"},children:r})]})};var O=I;export{O as default};
@@ -1 +1 @@
1
- import{jsx as n,jsxs as y}from"react/jsx-runtime";import{useState as h,useEffect as L,useId as M}from"react";import{Input as T,FloatingLabel as U,Stack as q}from"@donotdev/components";const B=({label:b,value:r,onChange:x,currency:o="EUR",locale:N,error:i,helperText:d,required:F=!1,disabled:u=!1,placeholder:I})=>{const c=M(),S=N||(typeof navigator<"u"?navigator.language:"en-US"),l=e=>e==null||isNaN(e)?"":(e/100).toString(),p=e=>{if(!e||e.trim()==="")return null;const a=e.replace(/[^\d.,\-]/g,"").replace(",","."),t=parseFloat(a);return isNaN(t)?null:Math.round(t*100)},[g,s]=h(l(r)),[v,m]=h(!1);L(()=>{v?p(g)!==r&&s(l(r)):s(l(r))},[r,v]);const z=e=>{const a=e.target.value;s(a);const t={target:{value:p(a)}};x(t)},E=()=>m(!0),j=()=>m(!1),f=(()=>{try{return new Intl.NumberFormat(S,{style:"currency",currency:o,currencyDisplay:"symbol"}).formatToParts(0).find(e=>e.type==="currency")?.value||o}catch{return o}})();return y(q,{gap:"tight",children:[n(U,{htmlFor:c,label:b,disabled:u,required:F,children:y("div",{style:{position:"relative"},children:[n("span",{style:{position:"absolute",left:"var(--gap-md)",top:"50%",transform:"translateY(-50%)",color:"var(--muted-foreground)",pointerEvents:"none",zIndex:1},children:f}),n(T,{id:c,type:"text",inputMode:"decimal",bare:!0,value:g,onChange:z,onFocus:E,onBlur:j,disabled:u,placeholder:I||"0","data-variant":i?"destructive":void 0,style:{paddingLeft:`calc(var(--gap-md) + ${f.length*.6}em + var(--gap-sm))`}})]})}),d&&n("p",{style:{fontSize:"var(--font-size-xs)",color:i?"var(--destructive-foreground)":"var(--muted-foreground)",marginTop:"var(--gap-sm)"},children:d})]})};var C=B;export{C as default};
1
+ import{jsx as n,jsxs as y}from"react/jsx-runtime";import{useState as h,useEffect as j,useId as q}from"react";import{Input as C,FloatingLabel as L,Stack as M}from"@donotdev/components";const U=({label:b,value:r,onChange:x,currency:l="EUR",locale:S,error:i,helperText:c,required:F=!1,disabled:u=!1,placeholder:N})=>{const d=q(),z=S||(typeof navigator<"u"?navigator.language:"en-US"),o=e=>e==null||isNaN(e)?"":(e/100).toString(),p=e=>{if(!e||e.trim()==="")return null;const a=e.replace(/[^\d.,\-]/g,"").replace(",","."),t=parseFloat(a);return isNaN(t)?null:Math.round(t*100)},[g,s]=h(o(r)),[v,m]=h(!1);j(()=>{v?p(g)!==r&&s(o(r)):s(o(r))},[r,v]);const E=e=>{const a=e.target.value;s(a);const t={target:{value:p(a)}};x(t)},I=()=>m(!0),T=()=>m(!1),f=(()=>{try{return new Intl.NumberFormat(z,{style:"currency",currency:l,currencyDisplay:"symbol"}).formatToParts(0).find(e=>e.type==="currency")?.value||l}catch{return l}})();return y(M,{gap:"tight",children:[n(L,{htmlFor:d,label:b,disabled:u,required:F,children:y("div",{style:{position:"relative"},children:[n("span",{style:{position:"absolute",left:"var(--gap-md)",top:"50%",transform:"translateY(-50%)",color:"var(--muted-foreground)",pointerEvents:"none",zIndex:1},children:f}),n(C,{id:d,type:"text",inputMode:"decimal",bare:!0,value:g,onChange:E,onFocus:I,onBlur:T,disabled:u,placeholder:N||"0","data-variant":i?"destructive":void 0,style:{paddingLeft:`calc(var(--gap-md) + ${f.length*.6}em + var(--gap-sm))`}})]})}),c&&n("p",{style:{fontSize:"var(--font-size-xs)",color:i?"var(--destructive-foreground)":"var(--muted-foreground)",marginTop:"var(--gap-sm)"},children:c})]})};var B=U;export{B as default};
@@ -1 +1 @@
1
- import{jsx as i,jsxs as n}from"react/jsx-runtime";import{useId as m}from"react";import{DatePicker as z,DateTimePicker as $,Input as y,cn as h,Stack as d}from"@donotdev/components";const b=({label:v,value:s,onChange:u,error:c,helperText:t,mode:a="date",required:g,...p})=>{const r=m(),e=!!c,f=o=>{const S=o.target.value?new Date(o.target.value).toISOString():null;u(S)};let l="";if(s){const o=new Date(s);a==="date"?l=o.toISOString().split("T")[0]||"":a==="datetime-local"?l=o.toISOString().slice(0,16)||"":a==="month"?l=o.toISOString().slice(0,7):a==="time"?l=o.toISOString().slice(11,16):a==="week"&&(l=o.toISOString().split("T")[0]||"")}return a==="date"?n(d,{gap:"tight",children:[i(z,{id:r,label:v,value:s??null,onChange:u,required:g,"aria-describedby":h(e&&`${r}-error`,t&&!e&&`${r}-helper`),"aria-invalid":e,"data-variant":e?"destructive":void 0}),e&&n(d,{id:`${r}-error`,direction:"row",align:"center",gap:"tight",style:{fontSize:"var(--font-size-xs)",color:"var(--destructive-foreground)"},role:"alert",children:[i("span",{children:"\u26A0"}),c]}),t&&!e&&i("p",{id:`${r}-helper`,style:{fontSize:"var(--font-size-xs)",color:"var(--muted-foreground)"},children:t})]}):a==="datetime-local"?n(d,{gap:"tight",children:[i($,{id:r,label:v,value:s??null,onChange:u,required:g,"aria-describedby":h(e&&`${r}-error`,t&&!e&&`${r}-helper`),"aria-invalid":e,"data-variant":e?"destructive":void 0}),e&&n(d,{id:`${r}-error`,direction:"row",align:"center",gap:"tight",style:{fontSize:"var(--font-size-xs)",color:"var(--destructive-foreground)"},role:"alert",children:[i("span",{children:"\u26A0"}),c]}),t&&!e&&i("p",{id:`${r}-helper`,style:{fontSize:"var(--font-size-xs)",color:"var(--muted-foreground)"},children:t})]}):n(d,{gap:"tight",children:[i(y,{id:r,label:v,type:a,value:l,onChange:f,required:g,"aria-describedby":h(e&&`${r}-error`,t&&!e&&`${r}-helper`),"aria-invalid":e,"data-variant":e?"destructive":void 0,className:"dndev-w-full",...p}),e&&n(d,{id:`${r}-error`,direction:"row",align:"center",gap:"tight",style:{fontSize:"var(--font-size-xs)",color:"var(--destructive-foreground)"},role:"alert",children:[i("span",{children:"\u26A0"}),c]}),t&&!e&&i("p",{id:`${r}-helper`,style:{fontSize:"var(--font-size-xs)",color:"var(--muted-foreground)"},children:t})]})};var x=b;export{x as default};
1
+ import{jsx as t,jsxs as n}from"react/jsx-runtime";import{useId as m}from"react";import{DatePicker as z,DateTimePicker as $,Input as b,cn as h,Stack as d}from"@donotdev/components";const x=({label:u,value:s,onChange:v,error:c,helperText:i,mode:a="date",required:g,...p})=>{const r=m(),e=!!c,f=o=>{const S=o.target.value?new Date(o.target.value).toISOString():null;v(S)};let l="";if(s){const o=new Date(s);a==="date"?l=o.toISOString().split("T")[0]||"":a==="datetime-local"?l=o.toISOString().slice(0,16)||"":a==="month"?l=o.toISOString().slice(0,7):a==="time"?l=o.toISOString().slice(11,16):a==="week"&&(l=o.toISOString().split("T")[0]||"")}return a==="date"?n(d,{gap:"tight",children:[t(z,{id:r,label:u,value:s??null,onChange:v,required:g,"aria-describedby":h(e&&`${r}-error`,i&&!e&&`${r}-helper`),"aria-invalid":e,"data-variant":e?"destructive":void 0}),e&&n(d,{id:`${r}-error`,direction:"row",align:"center",gap:"tight",style:{fontSize:"var(--font-size-xs)",color:"var(--destructive-foreground)"},role:"alert",children:[t("span",{children:"\u26A0"}),c]}),i&&!e&&t("p",{id:`${r}-helper`,style:{fontSize:"var(--font-size-xs)",color:"var(--muted-foreground)"},children:i})]}):a==="datetime-local"?n(d,{gap:"tight",children:[t($,{id:r,label:u,value:s??null,onChange:v,required:g,"aria-describedby":h(e&&`${r}-error`,i&&!e&&`${r}-helper`),"aria-invalid":e,"data-variant":e?"destructive":void 0}),e&&n(d,{id:`${r}-error`,direction:"row",align:"center",gap:"tight",style:{fontSize:"var(--font-size-xs)",color:"var(--destructive-foreground)"},role:"alert",children:[t("span",{children:"\u26A0"}),c]}),i&&!e&&t("p",{id:`${r}-helper`,style:{fontSize:"var(--font-size-xs)",color:"var(--muted-foreground)"},children:i})]}):n(d,{gap:"tight",children:[t(b,{id:r,label:u,type:a,value:l,onChange:f,required:g,"aria-describedby":h(e&&`${r}-error`,i&&!e&&`${r}-helper`),"aria-invalid":e,"data-variant":e?"destructive":void 0,className:"dndev-w-full",...p}),e&&n(d,{id:`${r}-error`,direction:"row",align:"center",gap:"tight",style:{fontSize:"var(--font-size-xs)",color:"var(--destructive-foreground)"},role:"alert",children:[t("span",{children:"\u26A0"}),c]}),i&&!e&&t("p",{id:`${r}-helper`,style:{fontSize:"var(--font-size-xs)",color:"var(--muted-foreground)"},children:i})]})};var y=x;export{y as default};