@1interface/widgets 0.1.0

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 (119) hide show
  1. package/dist/Chart.web-DQzthytj.js +1 -0
  2. package/dist/GoogleMapsComponent-CtYLbyvO.js +1 -0
  3. package/dist/Markdown.web-vx2MyFJ8.js +1 -0
  4. package/dist/OpenStreetMapComponent-BWRPzQtp.js +1 -0
  5. package/dist/constants-D8-vgQM1.js +1 -0
  6. package/dist/index-DvAx4AnX.js +1 -0
  7. package/dist/index.d.ts +2556 -0
  8. package/dist/index.mjs +1 -0
  9. package/dist/widgets.css +1 -0
  10. package/native/WidgetErrorBoundary.js +1 -0
  11. package/native/WidgetRenderer.js +36 -0
  12. package/native/WidgetRenderer.native.js +1 -0
  13. package/native/assets/image-placeholder.png +0 -0
  14. package/native/compat/FormContext.js +1 -0
  15. package/native/compat/WidgetStateContext.js +1 -0
  16. package/native/compat/WidgetThemeContext.js +1 -0
  17. package/native/components/BackgroundFill.js +1 -0
  18. package/native/components/Badge.js +1 -0
  19. package/native/components/BasicRoot.js +1 -0
  20. package/native/components/Box.js +1 -0
  21. package/native/components/Button.js +1 -0
  22. package/native/components/Card.js +1 -0
  23. package/native/components/Chart.js +1 -0
  24. package/native/components/ChartWidget.js +1 -0
  25. package/native/components/Checkbox.js +1 -0
  26. package/native/components/DatePicker.js +1 -0
  27. package/native/components/DatePicker.native.js +1 -0
  28. package/native/components/Divider.js +1 -0
  29. package/native/components/FileUploadRequest.js +1 -0
  30. package/native/components/Form.js +1 -0
  31. package/native/components/GlassSurface.js +1 -0
  32. package/native/components/Icon.js +1 -0
  33. package/native/components/Image.js +1 -0
  34. package/native/components/Input.js +1 -0
  35. package/native/components/ListView.js +1 -0
  36. package/native/components/Map/index.js +1 -0
  37. package/native/components/Map/index.native.js +1 -0
  38. package/native/components/Map/native/CalloutContent.js +1 -0
  39. package/native/components/Map/native/MapWebView.js +132 -0
  40. package/native/components/Map/native/NativeMapDisplay.js +1 -0
  41. package/native/components/Map/native/NativeMapInput.js +3 -0
  42. package/native/components/Map/native/NativeSearchOverlay.js +1 -0
  43. package/native/components/Map/shared/getLng.js +1 -0
  44. package/native/components/Map/shared/nominatim.js +1 -0
  45. package/native/components/Map/shared/partitionOverlays.js +1 -0
  46. package/native/components/Map/shared/types.js +0 -0
  47. package/native/components/Map/web/UserLocationContext.js +1 -0
  48. package/native/components/Map/web/adapters/GoogleMapsComponent.js +1 -0
  49. package/native/components/Map/web/adapters/OpenStreetMapComponent.js +1 -0
  50. package/native/components/Map/web/adapters/google.js +1 -0
  51. package/native/components/Map/web/adapters/index.js +1 -0
  52. package/native/components/Map/web/adapters/openstreetmap.js +1 -0
  53. package/native/components/Map/web/components/AdvancedMapMarker.js +1 -0
  54. package/native/components/Map/web/components/DataMarkerPopupContent.js +1 -0
  55. package/native/components/Map/web/components/GoogleInfoWindowTheme.js +15 -0
  56. package/native/components/Map/web/components/LeafletPopupTheme.js +8 -0
  57. package/native/components/Map/web/components/MapInputShell.js +1 -0
  58. package/native/components/Map/web/components/MapSearchOverlay.js +1 -0
  59. package/native/components/Map/web/components/MapSelectionIndicator.js +1 -0
  60. package/native/components/Map/web/components/MapShell.js +1 -0
  61. package/native/components/Map/web/components/MapSkeleton.js +1 -0
  62. package/native/components/Map/web/components/PopupContent.js +1 -0
  63. package/native/components/Map/web/components/SafeMapContainer.js +1 -0
  64. package/native/components/Map/web/components/SearchMarkerPopupContent.js +1 -0
  65. package/native/components/Map/web/constants.js +1 -0
  66. package/native/components/Map/web/hooks/useDirectionsUrl.js +1 -0
  67. package/native/components/Map/web/hooks/useMapFeatures.js +1 -0
  68. package/native/components/Map/web/hooks/useMapInput.js +3 -0
  69. package/native/components/Map/web/mapConfig.js +1 -0
  70. package/native/components/Map/web/mapRenderer.js +1 -0
  71. package/native/components/Map/web/services/google/googlePlaces.js +1 -0
  72. package/native/components/Map/web/services/index.js +1 -0
  73. package/native/components/Map/web/services/nominatim.js +1 -0
  74. package/native/components/Map/web/types.js +1 -0
  75. package/native/components/Map/web/utils/partitionOverlays.js +1 -0
  76. package/native/components/Map/web/utils.js +1 -0
  77. package/native/components/MapWidget.js +1 -0
  78. package/native/components/MapWidget.native.js +1 -0
  79. package/native/components/Markdown.js +3 -0
  80. package/native/components/MarkdownWidget.js +1 -0
  81. package/native/components/MediaDownloadButton.native.js +1 -0
  82. package/native/components/Placeholder.js +1 -0
  83. package/native/components/RadioGroup.js +1 -0
  84. package/native/components/Select.js +1 -0
  85. package/native/components/Spacer.js +1 -0
  86. package/native/components/Text.js +1 -0
  87. package/native/components/Textarea.js +1 -0
  88. package/native/components/Transition.js +1 -0
  89. package/native/components/Video.js +1 -0
  90. package/native/components/index.js +1 -0
  91. package/native/config.js +1 -0
  92. package/native/constants/validation.js +1 -0
  93. package/native/icons/icon-map.js +1 -0
  94. package/native/index.js +1 -0
  95. package/native/lib/utils.js +1 -0
  96. package/native/runtime/index.js +1 -0
  97. package/native/runtime/layoutContext.js +1 -0
  98. package/native/runtime/render.js +1 -0
  99. package/native/schema/action-types.js +1 -0
  100. package/native/schema/branding-types.js +0 -0
  101. package/native/schema/index.js +1 -0
  102. package/native/schema/widget-types.js +1 -0
  103. package/native/state/context.js +1 -0
  104. package/native/state/index.js +1 -0
  105. package/native/state/reducer.js +1 -0
  106. package/native/theme/ThemeContext.js +1 -0
  107. package/native/theme/defaults.js +1 -0
  108. package/native/theme/index.js +1 -0
  109. package/native/theme/resolveBranding.js +1 -0
  110. package/native/theme/style.js +1 -0
  111. package/native/theme/stylePipeline.js +1 -0
  112. package/native/theme/tokens.js +1 -0
  113. package/native/theme/variants.js +1 -0
  114. package/native/utils/formValidation.js +1 -0
  115. package/native/utils/formValidation.native.js +1 -0
  116. package/native/utils/formValidationCore.js +1 -0
  117. package/native/utils/safeRender.js +1 -0
  118. package/native/utils/widgetUtils.js +1 -0
  119. package/package.json +110 -0
@@ -0,0 +1,8 @@
1
+ import{jsx as p}from"react/jsx-runtime";import{useTheme as t}from"../../../../theme";function n(){const{tokens:o}=t(),e=`
2
+ .leaflet-popup-content-wrapper {
3
+ background: ${o.color.surface};
4
+ color: ${o.color.text};
5
+ }
6
+ .leaflet-popup-tip-container { display: none; }
7
+ .leaflet-popup-close-button { color: ${o.color.textMuted} !important; }
8
+ `;return p("style",{children:e})}export{n as LeafletPopupTheme};
@@ -0,0 +1 @@
1
+ import{jsx as r,jsxs as N}from"react/jsx-runtime";import{createContext as m,useContext as M,useCallback as g}from"react";import{useMessageId as I,useWidgetDispatch as f,REDUCER_ACTIONS as C}from"../../../../state";import{getMapAdapter as x}from"../mapRenderer";import{useMapInput as L}from"../hooks/useMapInput";import{MapShell as b}from"./MapShell";import{MapSelectionIndicator as w}from"./MapSelectionIndicator";const o=m(null);function D(){const e=M(o);if(!e)throw new Error("useMapInputState must be used within MapInputShell");return e}function O({width:e,height:p,name:t,children:l}){const v=I(),a=f(),i=g(S=>{t&&a&&a({type:C.SET_FORM_FIELD,payload:{name:t,value:S}})},[t,a]),{selectedLocation:n,isSearching:c,handleSearch:s,handleSearchSelect:u,handleMapClick:d,selectNamedLocation:h}=L({adapter:x(),onValueChange:i});return r(o.Provider,{value:{selectedLocation:n,handleMapClick:d,selectNamedLocation:h},children:N(b,{width:e,height:p,hasCenter:!0,allowSearch:!0,isSearching:c,onSearch:s,onSelect:u,clearOnSelect:!0,children:[l,n&&r(w,{locationName:n.name})]})})}export{O as MapInputShell,D as useMapInputState};
@@ -0,0 +1 @@
1
+ import{jsx as s,jsxs as y}from"react/jsx-runtime";import{useState as u,useRef as v,useCallback as a,useEffect as E}from"react";import{useTheme as D}from"../../../../theme";const O=300;function L({onSearch:b,onSelect:m,isSearching:x,clearOnSelect:S}){const{tokens:o}=D(),[w,p]=u(""),[n,c]=u([]),[d,l]=u(-1),[f,r]=u(!1),i=v(void 0),R=v(null),k=a(async e=>{if(e.trim().length<2){c([]),r(!1);return}const t=await b(e);c(t),l(-1),r(t.length>0)},[b]),C=a(e=>{const t=e.target.value;p(t),i.current&&clearTimeout(i.current),i.current=setTimeout(()=>k(t),O)},[k]),h=a(e=>{p(S?"":e.name),c([]),r(!1),m(e)},[m,S]),M=a(()=>{p(""),c([]),r(!1),l(-1),R.current?.focus()},[]),T=a(e=>{!f||n.length===0||(e.key==="ArrowDown"?(e.preventDefault(),l(t=>t<n.length-1?t+1:0)):e.key==="ArrowUp"?(e.preventDefault(),l(t=>t>0?t-1:n.length-1)):e.key==="Enter"&&d>=0?(e.preventDefault(),h(n[d])):e.key==="Escape"&&(r(!1),l(-1)))},[f,n,d,h]),g=v(null);return E(()=>{const e=t=>{g.current&&!g.current.contains(t.target)&&r(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),E(()=>()=>{i.current&&clearTimeout(i.current)},[]),y("div",{ref:g,style:{position:"relative",background:o.color.surface,padding:"8px 10px",borderBottom:`1px solid ${o.color.border}`},children:[y("div",{style:{position:"relative"},children:[s("input",{ref:R,type:"text",value:w,onChange:C,onKeyDown:T,onFocus:()=>n.length>0&&r(!0),placeholder:"Search location...",style:{width:"100%",paddingRight:36,boxSizing:"border-box",height:32,paddingLeft:12,border:`1px solid ${o.color.border}`,borderRadius:6,fontSize:14,outline:"none",background:o.color.surfaceAlt,color:o.color.text,fontFamily:o.font.family}}),(w||x)&&s("button",{onClick:M,title:"Clear search",style:{position:"absolute",right:4,top:"50%",transform:"translateY(-50%)",width:28,height:28,display:"flex",alignItems:"center",justifyContent:"center",fontSize:16,padding:0,background:"none",border:"none",cursor:"pointer",color:o.color.textMuted},children:x?"...":"\xD7"})]}),f&&n.length>0&&s("div",{style:{position:"absolute",top:"100%",left:0,right:0,zIndex:1e3,background:o.color.surface,border:`1px solid ${o.color.border}`,borderRadius:"0 0 8px 8px",boxShadow:"0 4px 12px rgba(0,0,0,0.1)",maxHeight:240,overflowY:"auto"},children:n.map((e,t)=>y("div",{onClick:()=>h(e),onMouseEnter:()=>l(t),style:{padding:"8px 12px",cursor:"pointer",borderBottom:t<n.length-1?`1px solid ${o.color.border}`:"none",background:t===d?"rgba(59,79,254,0.06)":"transparent"},children:[s("div",{style:{fontSize:13,fontWeight:500,color:o.color.text},children:e.name}),s("div",{style:{fontSize:11,color:o.color.textMuted,marginTop:2,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.description})]},e.id))})]})}export{L as MapSearchOverlay};
@@ -0,0 +1 @@
1
+ import{jsx as e,jsxs as i}from"react/jsx-runtime";import{useTheme as n}from"../../../../theme";function p({locationName:t}){const{tokens:o}=n();return i("div",{style:{position:"absolute",bottom:0,left:0,right:0,zIndex:1e3,background:o.color.surface,padding:"8px 12px",borderTop:`1px solid ${o.color.border}`,display:"flex",alignItems:"center",gap:6,fontSize:13,color:o.color.text},children:[e("span",{style:{fontSize:14},children:"\u{1F4CD}"}),e("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t})]})}export{p as MapSelectionIndicator};
@@ -0,0 +1 @@
1
+ import{Fragment as n,jsx as e,jsxs as y}from"react/jsx-runtime";import{MapSearchOverlay as S}from"./MapSearchOverlay";import{useTheme as m}from"../../../../theme";function g({width:o,height:t,hasCenter:a,allowSearch:c,isSearching:s,onSearch:d,onSelect:p,children:f,outerRef:u,errorFallback:l,loadingFallback:i,clearOnSelect:h}){const{tokens:r}=m();return a?l?e(n,{children:l}):i?e(n,{children:i}):y("div",{ref:u,style:{width:o,height:t,display:"flex",flexDirection:"column",border:`1px solid ${r.color.border}`,borderRadius:8,overflow:"hidden"},children:[c&&e(S,{onSearch:d,onSelect:p,isSearching:s,clearOnSelect:h}),e("div",{style:{position:"relative",flex:1,minHeight:0},children:f})]}):e("div",{style:{width:o,height:t,background:r.color.surfaceAlt,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:8,fontSize:14},children:e("span",{style:{color:r.color.textMuted},children:"Map: No coordinates"})})}export{g as MapShell};
@@ -0,0 +1 @@
1
+ import{jsx as e}from"react/jsx-runtime";function i(t){return e("div",{style:{width:t.width||"100%",height:t.height||"300px",background:"#f4f4f5",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:8},children:e("span",{style:{color:"#6b7280",fontSize:14},children:"Loading map..."})})}export{i as MapSkeleton};
@@ -0,0 +1 @@
1
+ import{jsx as t,jsxs as f}from"react/jsx-runtime";import{useTheme as g}from"../../../../theme";function y({title:a,subtitle:n,directionsUrl:e,actions:p,children:c}){const{tokens:o}=g();return f("div",{style:{width:300,padding:"8px 16px 8px 16px",boxSizing:"border-box"},children:[t("strong",{style:{display:"block",marginBottom:4,fontSize:13,color:o.color.text,fontFamily:o.font.family},children:a}),c,n&&t("span",{style:{display:"block",fontSize:12,color:o.color.textMuted,marginTop:2,fontFamily:o.font.family},children:n}),e&&t("a",{href:e,target:"_blank",rel:"noopener noreferrer",style:{display:"block",marginTop:6,color:o.color.primary.solid,fontSize:13,textDecoration:"none",fontFamily:o.font.family},children:"Get Directions \u2192"}),p?.map((r,i)=>{const l=r.color==="danger",s=l?o.color.danger.solid:o.color.primary.solid,d=l?o.color.danger.text:o.color.primary.text;return t("button",{onClick:r.onClick,style:{marginTop:i===0?8:4,whiteSpace:"normal",height:"auto",minHeight:26,paddingBlock:6,paddingInline:8,width:"100%",border:"none",borderRadius:6,cursor:"pointer",fontSize:13,fontWeight:500,background:s,color:d,fontFamily:o.font.family},children:r.label},i)})]})}export{y as PopupContent};
@@ -0,0 +1 @@
1
+ import{jsx as o}from"react/jsx-runtime";import{MapContainer as s}from"react-leaflet";import n from"leaflet";const p=n.Map.prototype._initContainer;n.Map.prototype._initContainer=function(e){const t=n.DomUtil.get(e);return t&&t._leaflet_id&&(n.DomEvent.off(t),delete t._leaflet_id),p.call(this,e)};const l=n.Map.prototype.remove;n.Map.prototype.remove=function(){try{return l.call(this)}catch(e){if(e instanceof Error&&e.message.includes("reused by another instance"))return this;throw e}};function c({children:e,className:t,id:a,style:r,placeholder:d,...i}){return o("div",{className:t,id:a,style:{width:"100%",height:"100%"},children:o(s,{style:r,...i,children:e})})}export{c as SafeMapContainer};
@@ -0,0 +1 @@
1
+ import{jsx as n}from"react/jsx-runtime";import{PopupContent as e}from"./PopupContent";function p({name:r,description:t}){return n(e,{title:r,subtitle:t})}export{p as SearchMarkerPopupContent};
@@ -0,0 +1 @@
1
+ const t={primary:{name:"blue",hex:"#4285F4",border:"#1a73e8"},search:{name:"violet",hex:"#A142F4",border:"#8430ce"}},e="https://unpkg.com/leaflet@1.9.4/dist/images",n="https://raw.githubusercontent.com/pointhi/leaflet-color-markers/master/img",a={defaultIcon:`${e}/marker-icon.png`,defaultIcon2x:`${e}/marker-icon-2x.png`,shadow:`${e}/marker-shadow.png`,colored:o=>`${n}/marker-icon-2x-${o}.png`},r="https://maps.google.com/mapfiles/ms/icons",s={colored:o=>`${r}/${o}-dot.png`,primary:`${r}/${t.primary.name}-dot.png`,searchMarker:`${r}/${t.search.name}-dot.png`};export{s as GOOGLE_ICONS,r as GOOGLE_MARKER_CDN,e as LEAFLET_CDN,n as LEAFLET_COLOR_MARKERS_CDN,a as LEAFLET_ICONS,t as MARKER_COLORS};
@@ -0,0 +1 @@
1
+ import{getMapAdapter as i}from"../mapRenderer";import{useLocationCoordinates as o}from"../UserLocationContext";function m(r,n,t){const e=o();return i().getDirectionsUrl({lat:r,lng:n},t,e??void 0)}export{m as useDirectionsUrl};
@@ -0,0 +1 @@
1
+ import{useState as c,useCallback as t}from"react";function m({adapter:e}){const[l,n]=c(!1),[u,o]=c(null),s=t((a,r)=>{e.flyTo(a,r,13)},[e]),h=t(async a=>{n(!0);try{return await e.search(a)}finally{n(!1)}},[e]),i=t(async a=>{const r=await e.resolveSearchResult(a);r&&(o(r),s(r.lat,r.lng))},[e,s]);return{isSearching:l,searchMarker:u,handleSearch:h,handleSearchSelect:i,focusMarker:s}}export{m as useMapFeatures};
@@ -0,0 +1,3 @@
1
+ import{useState as S,useCallback as l}from"react";const p=13,M=15;function m(r,o,u,c){const s=[];return u&&s.push(`- **Name:** ${u}`),c&&s.push(`- **Address:** ${c}`),s.push(`- **Latitude:** ${r}`),s.push(`- **Longitude:** ${o}`),`
2
+ `+s.join(`
3
+ `)}function v({adapter:r,onValueChange:o}){const[u,c]=S(null),[s,d]=S(!1),i=l((t,e,n)=>{const a=r.getZoom(),L=a!==void 0&&a>=n?void 0:n;r.flyTo(t,e,L)},[r]),h=l(async t=>{d(!0);try{return await r.search(t)}finally{d(!1)}},[r]),f=l(async t=>{const e=await r.resolveSearchResult(t);if(e){const n={name:e.name,lat:e.lat,lng:e.lng};c(n),i(e.lat,e.lng,M),o(m(e.lat,e.lng,e.name,e.description))}},[i,o]),g=l((t,e)=>{const a={name:`${t.toFixed(6)}, ${e.toFixed(6)}`,lat:t,lng:e};c(a),i(t,e,p),o(m(t,e))},[i,o]),b=l((t,e,n,a)=>{c({name:t,lat:e,lng:n}),i(e,n,p),o(m(e,n,t,a))},[i,o]);return{selectedLocation:u,isSearching:s,handleSearch:h,handleSearchSelect:f,handleMapClick:g,selectNamedLocation:b}}export{v as useMapInput};
@@ -0,0 +1 @@
1
+ import{MAP_PROVIDERS as o}from"./types";let e={};function t(r){e={...e,...r}}function i(){return e.provider||import.meta.env.VITE_MAP_PROVIDER||o.GOOGLE}function n(){return e.googleMapsApiKey||import.meta.env.VITE_GOOGLE_MAPS_API_KEY||""}function g(){return e.googleMapsMapId||import.meta.env.VITE_GOOGLE_MAPS_MAP_ID||"DEMO_MAP_ID"}function M(){return e.thunderforestApiKey||import.meta.env.VITE_THUNDERFOREST_API_KEY||""}export{t as configureMap,n as getGoogleMapsApiKey,g as getGoogleMapsMapId,i as getMapProvider,M as getThunderforestApiKey};
@@ -0,0 +1 @@
1
+ import{jsx as t}from"react/jsx-runtime";import{Suspense as o}from"react";import{createMapAdapter as m}from"./adapters";import{MapInputShell as u}from"./components/MapInputShell";import{MapSkeleton as n}from"./components/MapSkeleton";import{getMapProvider as h}from"./mapConfig";let a=null,d=null;function f(){const e=h();return(!a||d!==e)&&(a=m(e),d=e),a}function S(e){const{height:r="300px",width:p="100%",name:l}=e,i=f();return e.mode==="input"?t(u,{width:p,height:r,name:l,children:t(o,{fallback:t(n,{width:p,height:r}),children:i.renderInputSurface(e)})}):t(o,{fallback:t(n,{width:p,height:r}),children:i.renderDisplay(e)})}export{f as getMapAdapter,S as renderMap};
@@ -0,0 +1 @@
1
+ async function a(o,l){const{suggestions:e}=await google.maps.places.AutocompleteSuggestion.fetchAutocompleteSuggestions({input:o,sessionToken:l});return e.filter(n=>n.placePrediction).slice(0,5).map(n=>{const t=n.placePrediction;return{id:t.placeId,name:t.mainText?.text??t.text.text,description:t.text.text,lat:0,lng:0}})}async function c(o){const l=new google.maps.places.Place({id:o}),{place:e}=await l.fetchFields({fields:["location"]});return e.location?{lat:e.location.lat(),lng:e.location.lng()}:null}export{c as getPlaceDetails,a as searchGooglePlaces};
@@ -0,0 +1 @@
1
+ import{searchNominatim as r,reverseGeocodeNominatim as a}from"./nominatim";import{searchGooglePlaces as t,getPlaceDetails as c}from"./google/googlePlaces";export{c as getPlaceDetails,a as reverseGeocodeNominatim,t as searchGooglePlaces,r as searchNominatim};
@@ -0,0 +1 @@
1
+ import{searchNominatim as o,reverseGeocodeNominatim as r}from"../../shared/nominatim";export{r as reverseGeocodeNominatim,o as searchNominatim};
@@ -0,0 +1 @@
1
+ const e={OPENSTREETMAP:"openstreetmap",GOOGLE:"google"};export{e as MAP_PROVIDERS};
@@ -0,0 +1 @@
1
+ import{partitionOverlays as t}from"../../shared/partitionOverlays";export{t as partitionOverlays};
@@ -0,0 +1 @@
1
+ import{getLng as o}from"../shared/getLng";export{o as getLng};
@@ -0,0 +1 @@
1
+ import{Fragment as t,jsx as a}from"react/jsx-runtime";import{renderMap as p}from"./Map";function i(e){return a(t,{children:p(e)})}export{i as MapWidget};
@@ -0,0 +1 @@
1
+ import{Fragment as t,jsx as a}from"react/jsx-runtime";import{renderMap as p}from"./Map";function i(e){return a(t,{children:p(e)})}export{i as MapWidget};
@@ -0,0 +1,3 @@
1
+ import{jsx as n}from"react/jsx-runtime";import m from"react";import{View as c}from"react-native";import g from"react-native-markdown-display";import{useTokens as f,useTheme as s}from"../theme";function p(o,t){const r={color:o.color.text,fontFamily:o.font.family,fontSize:o.font.size.text.md,lineHeight:o.font.size.text.md*1.6};return{body:r,heading1:{...r,fontSize:o.font.size.title["2xl"],fontWeight:"700",marginBottom:8,marginTop:16},heading2:{...r,fontSize:o.font.size.title.xl,fontWeight:"700",marginBottom:6,marginTop:14},heading3:{...r,fontSize:o.font.size.title.lg,fontWeight:"600",marginBottom:4,marginTop:12},heading4:{...r,fontSize:o.font.size.title.md,fontWeight:"600",marginBottom:4,marginTop:10},heading5:{...r,fontSize:o.font.size.title.sm,fontWeight:"600",marginBottom:2,marginTop:8},heading6:{...r,fontSize:o.font.size.text.md,fontWeight:"600",marginBottom:2,marginTop:8},paragraph:{...r,marginTop:0,marginBottom:8},strong:{fontWeight:"700"},em:{fontStyle:"italic"},link:{color:o.color.primary.solid,textDecorationLine:"underline"},blockquote:{borderLeftWidth:3,borderLeftColor:o.color.primary.solid,paddingLeft:12,marginLeft:0,marginVertical:8,backgroundColor:o.color.surfaceAlt,paddingVertical:4},code_inline:{fontFamily:o.font.monoFamily,fontSize:o.font.size.text.sm,backgroundColor:o.color.surfaceAlt,paddingHorizontal:4,paddingVertical:2,borderRadius:o.radius.xs,color:o.color.text},code_block:{fontFamily:o.font.monoFamily,fontSize:o.font.size.text.sm,backgroundColor:o.color.surfaceAlt,padding:12,borderRadius:o.radius.sm,color:o.color.text,marginVertical:8},fence:{fontFamily:o.font.monoFamily,fontSize:o.font.size.text.sm,backgroundColor:o.color.surfaceAlt,padding:12,borderRadius:o.radius.sm,color:o.color.text,marginVertical:8},list_item:{...r,marginBottom:4},bullet_list:{marginVertical:4},ordered_list:{marginVertical:4},hr:{backgroundColor:o.color.border,height:1,marginVertical:12},table:{borderWidth:1,borderColor:o.color.border,borderRadius:o.radius.sm,marginVertical:8},thead:{backgroundColor:o.color.surfaceAlt},th:{...r,fontWeight:"600",padding:8,borderBottomWidth:1,borderColor:o.color.border},td:{...r,padding:8,borderBottomWidth:1,borderColor:o.color.border},tr:{borderBottomWidth:1,borderColor:o.color.border},image:{width:"100%",minHeight:100,resizeMode:"contain"}}}function u(o){return o.replace(/\\n/g,`
2
+ `).replace(/\t/g,"").replace(/\n/g,`
3
+ `)}function x({id:o,value:t,streaming:r}){const i=f(),{mode:a}=s(),e=u(t??""),l=r?`${e}\u2582`:e,d=m.useMemo(()=>p(i,a),[i,a]);return n(c,{nativeID:o,children:n(g,{style:d,children:l})})}export{x as Markdown};
@@ -0,0 +1 @@
1
+ import{jsx as n}from"react/jsx-runtime";import{Markdown as r}from"./Markdown";function a(o){return n(r,{...o})}export{a as MarkdownWidget};
@@ -0,0 +1 @@
1
+ import{jsx as s}from"react/jsx-runtime";import{useState as p,useCallback as u}from"react";import{Pressable as w,Alert as r,Platform as m,StyleSheet as b}from"react-native";import{downloadAsync as y,cacheDirectory as h}from"expo-file-system/legacy";import*as i from"expo-sharing";import{Icon as g}from"./Icon";function B({url:o,filename:e}){const[t,a]=p(!1),d=u(async()=>{if(!t){a(!0);try{const c=e||o.split("/").pop()?.split("?")[0]||"download",f=`${h}${c}`,{uri:n}=await y(o,f);await i.isAvailableAsync()?await i.shareAsync(n):r.alert("Downloaded",`Saved to ${n}`)}catch{r.alert("Error","Failed to download file.")}finally{a(!1)}}},[o,e,t]);return m.OS==="web"?null:s(w,{onPress:d,style:[l.button,t&&l.disabled],hitSlop:8,children:s(g,{name:"download-01",size:"md",color:"primary"})})}const l=b.create({button:{position:"absolute",top:8,right:8,width:32,height:32,borderRadius:16,backgroundColor:"rgba(0,0,0,0.5)",alignItems:"center",justifyContent:"center",zIndex:10},disabled:{opacity:.5}});export{B as MediaDownloadButton};
@@ -0,0 +1 @@
1
+ import{jsx as t,jsxs as h}from"react/jsx-runtime";import{View as n,Text as o}from"react-native";import{PRIMITIVE_KINDS as d,resolveStyle as c,useTheme as p}from"../theme";function g({label:l,note:r}){const{tokens:e}=p(),i={...e.layout.placeholder.wrap,backgroundColor:e.color.surfaceAlt,borderColor:e.color.textFaint,borderRadius:e.radius.lg,padding:e.placeholder.padding,minHeight:e.placeholder.minHeight,gap:e.placeholder.innerGap,borderWidth:e.placeholder.borderWidth},a=c(i,d.BOX,{hasBackground:!0});return h(n,{style:a,children:[t(o,{style:{color:e.color.text,fontFamily:e.font.family,fontSize:e.placeholder.label.fontSize,fontWeight:e.placeholder.label.weight},children:l}),t(o,{style:{color:e.color.textFaint,fontFamily:e.font.family,fontSize:e.placeholder.note.fontSize},children:r??"Coming in V2"})]})}export{g as Placeholder};
@@ -0,0 +1 @@
1
+ import{jsx as d,jsxs as k}from"react/jsx-runtime";import{useEffect as I,useState as v}from"react";import{Pressable as x,Text as C,View as l}from"react-native";import{PRIMITIVE_KINDS as r,resolveStyle as a,useTheme as T}from"../theme";import{useActionHandler as B,useMessageId as E,useWidgetDispatch as F,useWidgetState as O}from"../state";import{REDUCER_ACTIONS as D}from"../state";import{useRegisterRequired as G}from"./Form";function W(o){const{tokens:e}=T(),c=F(),n=O(),u=E(),y=B();G(o.name,o.required);const g=n.formFields[o.name],[i,m]=v(g??o.defaultValue);I(()=>{i!==void 0&&i!==(n.formFields[o.name]??"")&&c({type:D.SET_FORM_FIELD,payload:{name:o.name,value:i}})},[i]);function f(t){o.disabled||(m(t),o.onChangeAction&&y({...o.onChangeAction,payload:{...o.onChangeAction.payload??{},value:t,...u?{messageId:u}:{}}}))}const b={...e.layout.radio.group,flexDirection:o.direction==="row"?"row":"column",gap:e.radio.groupGap},h=a(b,r.BOX,{});return d(l,{style:h,accessibilityRole:"radiogroup",accessibilityLabel:o.ariaLabel,children:(o.options??[]).map(t=>{const s=i===t.value,p={...e.layout.radio.ring,width:e.radio.ring,height:e.radio.ring,borderRadius:e.radio.ring/2,borderWidth:e.radio.ringBorder,borderColor:s?e.color.primary.solid:e.color.textFaint},S=a(p,r.BOX,{}),R={width:e.radio.dot,height:e.radio.dot,borderRadius:e.radio.dot/2,backgroundColor:e.color.primary.solid},w=a(R,r.BOX,{hasBackground:!0}),V={...e.layout.radio.row,gap:e.radio.rowGap},A=a(V,r.BOX,{});return k(x,{onPress:()=>!t.disabled&&f(t.value),disabled:t.disabled||o.disabled,accessibilityRole:"radio",accessibilityState:{selected:s,disabled:!!t.disabled},style:A,children:[d(l,{style:S,children:s?d(l,{style:w}):null}),d(C,{style:{color:e.color.text,fontFamily:e.font.family,fontSize:e.font.baseSize},children:t.label})]},t.value)})})}export{W as RadioGroup};
@@ -0,0 +1 @@
1
+ import{Fragment as ue,jsx as n,jsxs as f}from"react/jsx-runtime";import{createElement as i,useCallback as I,useEffect as H,useLayoutEffect as Z,useRef as M,useState as b}from"react";import{Modal as $,Platform as C,Pressable as u,ScrollView as A,Text as p,View as h}from"react-native";import{PRIMITIVE_KINDS as ee,resolveStyle as te,useTheme as oe}from"../theme";import{controlRadius as ne}from"../theme/style";import{useActionHandler as le,useMessageId as re,useWidgetDispatch as ae,useWidgetState as se}from"../state";import{REDUCER_ACTIONS as ie}from"../state";import{Icon as w}from"./Icon";import{useRegisterRequired as de,useFieldError as ce}from"./Form";let N=(()=>null);C.OS==="web"&&import("react-dom").then(e=>{N=e.createPortal}).catch(()=>{});function xe(e){const{tokens:t,variants:B}=oe(),D=ae(),E=se(),F=re(),W=le(),m=t.control.size[e.size],_=e.variant==="outline"||e.variant==="ghost"?e.variant:"soft",d=B.input[_];de(e.name,e.required);const P=ce(e.name),q=E.formFields[e.name],[l,K]=b(q??e.defaultValue),[O,x]=b(!1);H(()=>{l!==void 0&&l!==(E.formFields[e.name]??"")&&D({type:ie.SET_FORM_FIELD,payload:{name:e.name,value:l}})},[l]);function T(o){K(o),x(!1),e.onChangeAction&&W({...e.onChangeAction,payload:{...e.onChangeAction.payload??{},[e.name]:o??"",...F?{messageId:F}:{}}})}const U={...t.layout.select.trigger,paddingHorizontal:m.padH,borderRadius:ne(e.size,t,e.pill),backgroundColor:d.bg,borderWidth:d.borderWidth,borderColor:d.border,gap:m.gap,...e.block?t.layout.select.block:{}},V=te(U,ee.BOX,{controlHeightPx:m.h,hasBackground:d.bg!==void 0}),S=!!P&&!l,[c,k]=b(!1),v=M(null),[R,X]=b(null);Z(()=>{if(C.OS!=="web"||!c||!v.current)return;const a=v.current.getBoundingClientRect();X({top:a.bottom+4,left:a.left,width:a.width})},[c]);const z=I(o=>{const a=o.target,r=v.current;if(r&&!r.contains(a)){const s=document.getElementById("widget-select-portal");if(s&&s.contains(a))return;k(!1)}},[]);if(H(()=>{if(C.OS==="web"&&c)return document.addEventListener("mousedown",z),()=>document.removeEventListener("mousedown",z)},[c,z]),C.OS==="web"){const o=e.options.find(r=>r.value===l)?.label??e.placeholder??"Select",a=c&&R?N(i("div",{id:"widget-select-portal",style:{position:"fixed",top:R.top,left:R.left,width:R.width,zIndex:1e6,backgroundColor:"#FFFFFF",borderRadius:16,padding:6,maxHeight:260,overflow:"hidden",boxShadow:"0px 12px 32px rgba(0, 0, 0, 0.28)"}},i(A,{style:{maxHeight:248}},i(h,{style:{gap:4}},e.options.map(r=>{const s=r.value===l;return i("div",{key:r.value,onClick:()=>{T(r.value),k(!1)},onMouseEnter:g=>{g.currentTarget.style.backgroundColor="#F3F3F3"},onMouseLeave:g=>{g.currentTarget.style.backgroundColor="transparent"},style:{display:"flex",flexDirection:"row",alignItems:"center",gap:8,padding:"8px 14px",borderRadius:8,cursor:"pointer"}},i("div",{style:{width:16,height:16,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center"}},s?i(w,{name:"check",size:"sm",color:"#9B9B9B"}):null),i("span",{style:{color:"#111111",fontFamily:t.font.family,fontSize:14,lineHeight:"20px",fontWeight:s?"500":"400"}},r.label))})))),document.body):null;return f(h,{children:[n(h,{ref:v,children:f(u,{onPress:()=>!e.disabled&&k(!c),disabled:e.disabled,style:({pressed:r})=>[V,S?{borderColor:t.color.danger.solid}:null,r?{opacity:t.ui.pressedOpacity}:null],children:[n(p,{numberOfLines:1,style:[t.layout.select.label,{color:l?d.fg:t.color.placeholder,fontFamily:t.font.family,fontSize:m.font}],children:o}),n(w,{name:"chevron-down",size:"sm",color:"secondary"})]})}),S?n(p,{style:{color:t.color.danger.solid,fontSize:12,marginTop:4,fontFamily:t.font.family},children:P}):null,a]})}const j=!!e.clearable&&l!==void 0&&l!=="",G=e.options.find(o=>o.value===l)?.label??e.placeholder??"Select",L=M(null),[y,J]=b(null),Q=I(()=>{e.disabled||L.current?.measure((o,a,r,s,g,Y)=>{J({x:g,y:Y,width:r,height:s}),x(!0)})},[e.disabled]);return f(ue,{children:[f(h,{ref:L,children:[f(u,{onPress:Q,accessibilityRole:"button",accessibilityState:{disabled:!!e.disabled,expanded:O},style:({pressed:o})=>[V,S?{borderColor:t.color.danger.solid}:null,o?{opacity:t.ui.pressedOpacity}:null],disabled:e.disabled,children:[n(p,{numberOfLines:1,style:[t.layout.select.label,{color:l?d.fg:t.color.placeholder,fontFamily:t.font.family,fontSize:m.font}],children:G}),j?n(u,{onPress:o=>{o.stopPropagation?.(),T(void 0)},accessibilityRole:"button",accessibilityLabel:"Clear selection",hitSlop:8,children:n(w,{name:"x-close",size:"sm",color:"secondary"})}):n(w,{name:"chevron-down",size:"sm",color:"secondary"})]}),S?n(p,{style:{color:t.color.danger.solid,fontSize:12,marginTop:4,fontFamily:t.font.family},children:P}):null]}),n($,{visible:O,transparent:!0,animationType:"fade",onRequestClose:()=>x(!1),children:n(u,{style:{flex:1},onPress:()=>x(!1),children:y&&n(h,{style:{position:"absolute",top:y.y+y.height+4,left:y.x,width:y.width,maxHeight:220,backgroundColor:t.color.surface,borderRadius:12,paddingVertical:4,shadowColor:"#000",shadowOffset:{width:0,height:8},shadowOpacity:.25,shadowRadius:16,elevation:8},children:n(u,{onPress:o=>o.stopPropagation(),children:n(A,{style:{maxHeight:212},bounces:!1,children:e.options.map(o=>f(u,{onPress:()=>T(o.value),style:({pressed:a})=>[t.layout.select.option,{paddingVertical:10,paddingHorizontal:14,borderRadius:8,marginHorizontal:4},a?{backgroundColor:t.color.surfaceAlt}:null],children:[n(p,{style:{color:t.color.text,fontFamily:t.font.family,fontSize:t.font.baseSize},children:o.label}),o.value===l?n(w,{name:"check",size:"sm",color:"primary"}):null]},o.value))})})})})})]})}export{xe as Select};
@@ -0,0 +1 @@
1
+ import{jsx as s}from"react/jsx-runtime";import{View as t}from"react-native";import{PRIMITIVE_KINDS as o,resolveStyle as m}from"../theme";import{sizeToRN as n}from"../theme/style";function c(i){const e=n(i.minSize),r=m(e!==void 0?{flexGrow:0,flexShrink:0,flexBasis:e,minWidth:e,minHeight:e}:{flexGrow:1,flexShrink:1,flexBasis:0},o.BOX,{});return s(t,{nativeID:i.id,style:r})}export{c as Spacer};
@@ -0,0 +1 @@
1
+ import{jsx as l,jsxs as I}from"react/jsx-runtime";import{useState as R}from"react";import{Pressable as b,Text as r,TextInput as w,View as z}from"react-native";import{useTheme as u}from"../theme";import{resolveTextColor as L,resolveTypographyColor as m,sizeToRN as E}from"../theme/style";import{PRIMITIVE_KINDS as f,resolveStyle as c}from"../theme/stylePipeline";import{useWidgetDispatch as A}from"../state";import{REDUCER_ACTIONS as C}from"../state";import{useIsRequired as N,useRegisterRequired as F}from"./Form";function d(e){if(e==="start")return"left";if(e==="center")return"center";if(e==="end")return"right"}function P(e){const{tokens:t,mode:n}=u(),i=A(),o=e.editable&&typeof e.editable=="object"?e.editable:null,[s,y]=R(!1),[g,v]=R(e.value);F(o?.name,o?.required);const x={color:L(e.color,t,n),fontFamily:t.font.family,fontSize:t.font.size.text[e.size],fontWeight:t.font.weight[e.weight],fontStyle:e.italic?"italic":"normal",textDecorationLine:e.lineThrough?"line-through":"none",textAlign:d(e.textAlign)},a=E(e.width);a!==void 0&&(x.width=a,e.textAlign||(x.textAlign="center"));const T=c(x,f.TEXT,{textWidthPx:typeof a=="number"?a:void 0});if(o&&s)return l(w,{value:g,onChangeText:v,onBlur:()=>{y(!1),i({type:C.SET_FORM_FIELD,payload:{name:o.name,value:g}})},autoFocus:o.autoFocus!==!1,selectTextOnFocus:!!o.autoSelect,placeholder:o.placeholder,style:T,autoComplete:o.allowAutofillExtensions===!1?"off":o.autoComplete});const S=e.streaming?e.value+"\u258A":e.value,h=l(r,{style:T,numberOfLines:e.truncate?1:e.maxLines,ellipsizeMode:e.truncate?"tail":void 0,children:S});return o?l(b,{onPress:()=>y(!0),accessibilityRole:"button",accessibilityLabel:"Edit text",children:h}):h}function X(e){const{tokens:t,mode:n}=u(),i={color:m(e.color,t,n)??t.color.text,fontFamily:t.font.family,fontSize:t.font.size.title[e.size],fontWeight:t.font.weight[e.weight],textAlign:d(e.textAlign),letterSpacing:t.text.titleLetterSpacing},o=c(i,f.TEXT);return l(r,{style:o,numberOfLines:e.truncate?1:e.maxLines,ellipsizeMode:e.truncate?"tail":void 0,children:e.value})}function _(e){const{tokens:t,mode:n}=u(),i={color:m(e.color,t,n)??t.color.textMuted,fontFamily:t.font.family,fontSize:t.font.size.caption[e.size],fontWeight:t.font.weight[e.weight],textAlign:d(e.textAlign),opacity:t.text.captionOpacity},o=c(i,f.TEXT);return l(r,{style:o,numberOfLines:e.truncate?1:e.maxLines,ellipsizeMode:e.truncate?"tail":void 0,children:e.value})}function B(e){const{tokens:t,mode:n}=u(),i=N(e.fieldName),o={color:m(e.color,t,n)??t.color.textMuted,fontFamily:t.font.family,fontSize:t.font.size.text[e.size],fontWeight:t.font.weight[e.weight],textAlign:d(e.textAlign)},s=c(o,f.TEXT);return I(z,{style:t.layout.label.row,children:[l(r,{style:s,children:e.value}),i?l(r,{style:[s,{color:t.color.danger.solid,marginLeft:t.text.requiredMarker.marginLeft}],children:"*"}):null]})}export{_ as Caption,B as Label,P as Text,X as Title};
@@ -0,0 +1 @@
1
+ import{jsx as c}from"react/jsx-runtime";import{useEffect as w,useState as s}from"react";import{TextInput as C,View as I}from"react-native";import{PRIMITIVE_KINDS as V,resolveStyle as E,useTheme as H}from"../theme";import{controlRadius as F}from"../theme/style";import{useWidgetDispatch as M,useWidgetState as O}from"../state";import{REDUCER_ACTIONS as B}from"../state";import{useRegisterRequired as D}from"./Form";function N(e){const{tokens:t,variants:f}=H(),m=M(),l=O(),o=f.input[e.variant];D(e.name,e.required,"text",e.pattern);const h=l.formFields[e.name],[n,g]=s(h??e.defaultValue??""),[d,y]=s(void 0),[x,S]=s(!1);w(()=>{n!==(l.formFields[e.name]??"")&&m({type:B.SET_FORM_FIELD,payload:{name:e.name,value:n}})},[n]);const a=t.control.size[e.size],R=e.gutterSize?t.control.size[e.gutterSize].padH:a.padH,i=a.h*e.rows*.75,p=e.maxRows??Math.max(e.rows,20),z=a.h*p*.75,u=e.autoResize&&d!==void 0?Math.min(Math.max(d,i),z):void 0,b={minHeight:i,...u!==void 0?{height:u}:{},paddingHorizontal:R,paddingVertical:t.space[8],borderRadius:F(e.size,t),backgroundColor:o.bg,borderWidth:o.borderWidth,borderColor:o.border},v=E(b,V.BOX,{hasBackground:o.bg!==void 0});function T(){if(e.pattern)try{const r=new RegExp(e.pattern);S(!r.test(n))}catch{}}return c(I,{style:v,children:c(C,{value:n,onChangeText:g,onBlur:T,onContentSizeChange:r=>{e.autoResize&&y(r.nativeEvent.contentSize.height)},placeholder:e.placeholder,placeholderTextColor:t.color.placeholder,multiline:!0,numberOfLines:e.rows,autoFocus:e.autoFocus,selectTextOnFocus:!!e.autoSelect,editable:!e.disabled,autoComplete:e.allowAutofillExtensions===!1?"off":void 0,style:[t.layout.textarea.input,{color:o.fg,fontFamily:t.font.family,fontSize:a.font,minHeight:i,outlineStyle:"none"},x?{color:t.color.danger.solid}:null]})})}export{N as Textarea};
@@ -0,0 +1 @@
1
+ import{jsx as m}from"react/jsx-runtime";import{useEffect as o,useRef as r}from"react";import{Animated as t}from"react-native";import{useRendererConfig as s}from"../theme";const u=10;function d({children:a}){const n=s(),e=r(new t.Value(0)).current,i=r(new t.Value(u)).current;return o(()=>{t.parallel([t.timing(e,{toValue:1,duration:n.animation.transitionDurationMs,useNativeDriver:!0}),t.timing(i,{toValue:0,duration:n.animation.transitionDurationMs,useNativeDriver:!0})]).start()},[n.animation.transitionDurationMs,e,i]),m(t.View,{style:{opacity:e,transform:[{translateY:i}]},children:a})}export{d as Transition};
@@ -0,0 +1 @@
1
+ import{Fragment as H,jsx as t,jsxs as h}from"react/jsx-runtime";import{createElement as R,Component as x}from"react";import{Image as g,Platform as m,StyleSheet as l,View as s}from"react-native";import{PRIMITIVE_KINDS as z,resolveStyle as k,useTheme as E}from"../theme";import{radiusToNumber as I,sizeToRN as i}from"../theme/style";import{Icon as b}from"./Icon";let a=null;if(m.OS!=="web")try{a=require("./MediaDownloadButton.native").MediaDownloadButton}catch{a=null}let n=null;if(m.OS!=="web")try{n=require("react-native-video").default}catch{n=null}function M(e){const{tokens:o}=E(),r=I(e.radius,o),d=i(e.width??e.size),S=i(e.height??e.size),y=i(e.minHeight??e.minSize),u=i(e.maxHeight??e.maxSize),f=i(e.minWidth??e.minSize),w=i(e.maxWidth??e.maxSize),V=S??u??o.overlay.videoDefaultH,v={...o.layout.video.wrap,width:d??"100%",height:V,...y!==void 0?{minHeight:y}:{},...u!==void 0?{maxHeight:u}:{},...f!==void 0?{minWidth:f}:{},...w!==void 0?{maxWidth:w}:{},borderRadius:r??o.radius.lg,backgroundColor:o.color.surfaceAlt},c=k(v,z.BOX,{hasBackground:!0});return m.OS==="web"?t(s,{style:c,children:R("video",{src:e.src,poster:e.poster,controls:e.controls!==!1,autoPlay:!!e.autoPlay,loop:!!e.loop,muted:!!e.muted,playsInline:e.playsInline!==!1,preload:e.preload??"metadata",style:{width:"100%",height:"100%",objectFit:e.fit??"cover",display:"block",borderRadius:r??o.radius.lg}})}):n?h(s,{style:c,children:[a&&e.src&&e.downloadable?t(a,{url:e.src}):null,t(p,{fallback:h(H,{children:[e.poster?t(g,{source:{uri:e.poster},style:[l.absoluteFill,{borderRadius:r??o.radius.lg}],resizeMode:e.fit==="contain"?"contain":"cover"}):null,t(s,{style:[l.absoluteFill,o.layout.video.overlay,{backgroundColor:o.overlay.video}],children:t(b,{name:"play",size:"2xl",color:"primary"})})]}),children:t(n,{source:{uri:e.src},poster:e.poster,posterResizeMode:"cover",style:[l.absoluteFill,{borderRadius:r??o.radius.lg}],resizeMode:e.fit==="contain"?"contain":"cover",controls:e.controls!==!1,repeat:!!e.loop,muted:e.muted!==!1,paused:e.autoPlay===!1,playInBackground:!1,useTextureView:!0})})]}):h(s,{style:c,children:[a&&e.src&&e.downloadable?t(a,{url:e.src}):null,e.poster?t(g,{source:{uri:e.poster},style:[l.absoluteFill,{borderRadius:r??o.radius.lg}],resizeMode:e.fit==="contain"?"contain":"cover"}):null,t(s,{style:[l.absoluteFill,o.layout.video.overlay,{backgroundColor:o.overlay.video}],children:t(b,{name:"play",size:"2xl",color:"primary"})})]})}class p extends x{constructor(){super(...arguments);this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(r,d){console.warn("Video widget playback failed:",d.componentStack)}render(){return this.state.hasError?this.props.fallback:this.props.children}}export{M as Video};
@@ -0,0 +1 @@
1
+ import{BackgroundFill as e}from"./BackgroundFill";import{Badge as p}from"./Badge";import{BasicRoot as m}from"./BasicRoot";import{Box as i,BoxRender as a,Row as n,Col as d}from"./Box";import{Button as s}from"./Button";import{Card as c,StatusBanner as B}from"./Card";import{Checkbox as I}from"./Checkbox";import{DatePicker as F}from"./DatePicker";import{Divider as P}from"./Divider";import{FileUploadRequest as S}from"./FileUploadRequest";import{Form as b,useFormSubmit as q,useRegisterRequired as w,useIsRequired as y}from"./Form";import{Icon as V}from"./Icon";import{Image as D}from"./Image";import{Input as G}from"./Input";import{ListView as j,ListViewItem as z}from"./ListView";import{Placeholder as E}from"./Placeholder";import{RadioGroup as J}from"./RadioGroup";import{Select as M}from"./Select";import{Spacer as O}from"./Spacer";import{Text as W,Title as X,Caption as Y,Label as Z}from"./Text";import{Textarea as $}from"./Textarea";import{Transition as ro}from"./Transition";import{Video as to}from"./Video";export{e as BackgroundFill,p as Badge,m as BasicRoot,i as Box,a as BoxRender,s as Button,Y as Caption,c as Card,I as Checkbox,d as Col,F as DatePicker,P as Divider,S as FileUploadRequest,b as Form,V as Icon,D as Image,G as Input,Z as Label,j as ListView,z as ListViewItem,E as Placeholder,J as RadioGroup,n as Row,M as Select,O as Spacer,B as StatusBanner,W as Text,$ as Textarea,X as Title,ro as Transition,to as Video,q as useFormSubmit,y as useIsRequired,w as useRegisterRequired};
@@ -0,0 +1 @@
1
+ const i={scroll:{allowOrthogonalAxis:!0,forbidSameAxis:!0},animation:{transitionDurationMs:300},fileUpload:{maxSizeBytes:25e6,allowedExtensions:[]},template:{dataSelectToken:"<data-select>",dataCheckboxToken:"<data-checkbox>",dataInputToken:"<data-input>",dataFieldPattern:/<data:(\w+)>/,formPlaceholderPattern:/\{\{(.+?)\}\}/},platform:{monoFontFamily:"monospace"}};function s(a){if(!a)return i;const n={...i},r=a;for(const t of Object.keys(r)){const e=r[t],o=n[t];e&&typeof e=="object"&&!Array.isArray(e)&&typeof o=="object"&&o!==null?n[t]={...o,...e}:e!==void 0&&(n[t]=e)}return n}export{i as DEFAULT_CONFIG,s as mergeConfig};
@@ -0,0 +1 @@
1
+ const e={email:{regex:"[a-zA-Z0-9._%+\\-]+@[a-zA-Z0-9.\\-]+\\.[a-zA-Z]{2,}",message:"Please enter a valid email address"},url:{regex:"https?:\\/\\/.+",message:"Please enter a valid URL"},tel:{regex:"[\\d\\s\\-\\+\\(\\)]{7,}",message:"Please enter a valid phone number"}};export{e as DEFAULT_INPUT_PATTERNS};