fluid-primitives 0.6.0 → 0.8.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.
- package/Resources/Public/JavaScript/dist/Accordion-DyRSZ01R.js +1 -0
- package/Resources/Public/JavaScript/dist/Checkbox-DH3KIA4G.js +1 -0
- package/Resources/Public/JavaScript/dist/Client-oBmSvCIl.js +1 -0
- package/Resources/Public/JavaScript/dist/Clipboard-CkdRKp1D.js +1 -0
- package/Resources/Public/JavaScript/dist/Collapsible-ndvh9m1d.js +1 -0
- package/Resources/Public/JavaScript/dist/Dialog-DLY2NftK.js +1 -0
- package/Resources/Public/JavaScript/dist/Field-ChHx-OA0.js +1 -0
- package/Resources/Public/JavaScript/dist/Form-CRD7_HtC.js +1 -0
- package/Resources/Public/JavaScript/dist/Popover-BYysiZof.js +1 -0
- package/Resources/Public/JavaScript/dist/ScrollArea-BseEK6t2.js +1 -0
- package/Resources/Public/JavaScript/dist/Select-Ksl75VK-.js +1 -0
- package/Resources/Public/JavaScript/dist/Tabs-ChCSBaRL.js +1 -0
- package/Resources/Public/JavaScript/dist/Tooltip-Cv1zWULX.js +1 -0
- package/Resources/Public/JavaScript/dist/accordion.d.ts +2 -2
- package/Resources/Public/JavaScript/dist/accordion.entry.js +1 -1
- package/Resources/Public/JavaScript/dist/accordion.js +1 -1
- package/Resources/Public/JavaScript/dist/checkbox.d.ts +45 -7
- package/Resources/Public/JavaScript/dist/checkbox.entry.js +1 -1
- package/Resources/Public/JavaScript/dist/checkbox.js +1 -1
- package/Resources/Public/JavaScript/dist/client.d.ts +2 -2
- package/Resources/Public/JavaScript/dist/client.js +1 -1
- package/Resources/Public/JavaScript/dist/clipboard.d.ts +4 -4
- package/Resources/Public/JavaScript/dist/clipboard.entry.js +1 -1
- package/Resources/Public/JavaScript/dist/clipboard.js +1 -1
- package/Resources/Public/JavaScript/dist/collapsible.d.ts +2 -2
- package/Resources/Public/JavaScript/dist/collapsible.entry.js +1 -1
- package/Resources/Public/JavaScript/dist/collapsible.js +1 -1
- package/Resources/Public/JavaScript/dist/dialog.d.ts +4 -4
- package/Resources/Public/JavaScript/dist/dialog.entry.js +1 -1
- package/Resources/Public/JavaScript/dist/dialog.js +1 -1
- package/Resources/Public/JavaScript/dist/field.d.ts +55 -0
- package/Resources/Public/JavaScript/dist/field.dom-BPeGctuk.js +1 -0
- package/Resources/Public/JavaScript/dist/field.entry.d.ts +1 -0
- package/Resources/Public/JavaScript/dist/field.entry.js +1 -0
- package/Resources/Public/JavaScript/dist/field.js +1 -0
- package/Resources/Public/JavaScript/dist/form.d.ts +66 -0
- package/Resources/Public/JavaScript/dist/form.entry.d.ts +1 -0
- package/Resources/Public/JavaScript/dist/form.entry.js +1 -0
- package/Resources/Public/JavaScript/dist/form.js +1 -0
- package/Resources/Public/JavaScript/dist/form.registry-ABqE-vzj.js +1 -0
- package/Resources/Public/JavaScript/dist/form.registry-D0xyZwqn.d.ts +7 -0
- package/Resources/Public/JavaScript/dist/{index-BxBl3DfU.d.ts → index-w1HRp_7W.d.ts} +32 -7
- package/Resources/Public/JavaScript/dist/popover.d.ts +52 -0
- package/Resources/Public/JavaScript/dist/popover.entry.d.ts +1 -0
- package/Resources/Public/JavaScript/dist/popover.entry.js +1 -0
- package/Resources/Public/JavaScript/dist/popover.js +1 -0
- package/Resources/Public/JavaScript/dist/scroll-area.d.ts +2 -2
- package/Resources/Public/JavaScript/dist/scroll-area.entry.js +1 -1
- package/Resources/Public/JavaScript/dist/scroll-area.js +1 -1
- package/Resources/Public/JavaScript/dist/select.d.ts +52 -5
- package/Resources/Public/JavaScript/dist/select.entry.js +1 -1
- package/Resources/Public/JavaScript/dist/select.js +1 -1
- package/Resources/Public/JavaScript/dist/tabs.d.ts +4 -4
- package/Resources/Public/JavaScript/dist/tabs.entry.js +1 -1
- package/Resources/Public/JavaScript/dist/tabs.js +1 -1
- package/Resources/Public/JavaScript/dist/tooltip.d.ts +4 -4
- package/Resources/Public/JavaScript/dist/tooltip.entry.js +1 -1
- package/Resources/Public/JavaScript/dist/tooltip.js +1 -1
- package/package.json +18 -4
- package/Resources/Public/JavaScript/dist/Accordion-BcKzcS8k.js +0 -1
- package/Resources/Public/JavaScript/dist/Checkbox-6PYAIX3u.js +0 -1
- package/Resources/Public/JavaScript/dist/Client-6Iwe-j89.js +0 -1
- package/Resources/Public/JavaScript/dist/Clipboard-DBOxpmyP.js +0 -1
- package/Resources/Public/JavaScript/dist/Collapsible-PDQY_Qe7.js +0 -1
- package/Resources/Public/JavaScript/dist/Dialog-RFdHrc0M.js +0 -1
- package/Resources/Public/JavaScript/dist/ScrollArea-D0pn7wBC.js +0 -1
- package/Resources/Public/JavaScript/dist/Select-5e5MbWtV.js +0 -1
- package/Resources/Public/JavaScript/dist/Tabs-CtsfAYSl.js +0 -1
- package/Resources/Public/JavaScript/dist/Tooltip-Cr9vsVp_.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Component as e,Machine as t,normalizeProps as n}from"./Client-oBmSvCIl.js";import*as r from"@zag-js/accordion";var i=class extends e{static name=`accordion`;initMachine(e){return new t(r.machine,{collapsible:!0,...e})}initApi(){return r.connect(this.machine.service,n)}render(){let e=this.getElement(`root`);e&&this.spreadProps(e,this.api.getRootProps());let t=this.getElements(`item`);t.forEach(e=>{this.spreadProps(e,this.api.getItemProps({value:e.getAttribute(`data-value`),disabled:e.getAttribute(`data-disabled`)===`true`}))});let n=this.getElements(`item-trigger`);n.forEach(e=>{this.spreadProps(e,this.api.getItemTriggerProps({value:e.getAttribute(`data-value`),disabled:e.getAttribute(`data-disabled`)===`true`}))});let r=this.getElements(`item-content`);r.forEach(e=>{this.spreadProps(e,this.api.getItemContentProps({value:e.getAttribute(`data-value`),disabled:e.getAttribute(`data-disabled`)===`true`}))});let i=this.getElements(`item-indicator`);i.forEach(e=>{this.spreadProps(e,this.api.getItemIndicatorProps({value:e.getAttribute(`data-value`),disabled:e.getAttribute(`data-disabled`)===`true`}))}),this.getElements(`item-header`)}};export{i as Accordion};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{FieldAwareComponent as e,Machine as t,mergeProps as n,normalizeProps as r}from"./Client-oBmSvCIl.js";import{getControlId as i,getLabelId as a}from"./field.dom-BPeGctuk.js";import*as o from"@zag-js/checkbox";var s=class extends e{static name=`checkbox`;propsWithField(e,t){return{value:`1`,...e,disabled:e.disabled??t.ctx.get(`disabled`),readOnly:e.readOnly??t.ctx.get(`readOnly`),required:e.required??t.ctx.get(`required`),invalid:e.invalid??t.ctx.get(`invalid`),name:e.name??t.prop(`name`),ids:{...e.ids,label:a(t.scope),hiddenInput:i(t.scope)}}}initMachine(e){return e=this.withFieldProps(e),new t(o.machine,e)}initApi(){return o.connect(this.machine.service,r)}render(){this.subscribeToFieldService();let e=this.getElement(`root`);e&&this.spreadProps(e,this.api.getRootProps());let t=this.getElement(`label`);t&&this.spreadProps(t,this.api.getLabelProps());let r=this.getElement(`control`);r&&this.spreadProps(r,this.api.getControlProps());let i=this.getElement(`indicator`);i&&this.spreadProps(i,this.api.getIndicatorProps());let a=this.getElement(`hidden-input`);if(a){let e=n(this.api.getHiddenInputProps(),{"aria-describedby":this.fieldMachine?.ctx.get(`describeIds`)||void 0});this.spreadProps(a,e)}}};export{s as Checkbox};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ListCollection as e}from"@zag-js/collection";import{INIT_STATE as t,MachineStatus as n,createScope as r,mergeProps as i}from"@zag-js/core";import{proxy as a,subscribe as o}from"@zag-js/store";import{compact as s,identity as c,isEqual as l,isFunction as u,isString as d,runIfFn as f,toArray as p,uuid as m,warn as h}from"@zag-js/utils";import{createNormalizer as g}from"@zag-js/types";var _=class{document;machine;api;hydrator=null;userProps;static name;get doc(){return this.document}constructor(e,t=document){this.document=t,this.userProps=this.transformProps(e),this.hydrator=this.initHydrator(e),this.machine=this.initMachine(e),this.api=this.initApi()}initHydrator(e){let t=e.id;if(!t)throw Error(`ComponentHydrator requires an id prop to initialize.`);return new E(this.getName(),t,e.ids,this.doc)}init(){this.render(),this.machine.subscribe(()=>{this.api=this.initApi(),this.render()}),this.machine.start()}getName(){return this.constructor.name}transformProps(e){return e}updateProps(e){let t={...this.userProps,...e};this.userProps=this.transformProps(t),this.machine.updateProps(t)}destroy=()=>{this.machine.stop(),this.hydrator?.destroy()};spreadProps(e,t){H(e,t,this.machine.scope.id)}getElement(e,t){return this.hydrator?.getElement(e,t)||null}getElements(e,t){return this.hydrator?.getElements(e,t)||[]}portalElement(e,t=this.doc.body){e&&e.parentNode!==t&&(t.appendChild(e),e.setAttribute(`data-portalled`,`true`))}};const v=new WeakMap;function y(e,t){e&&(v.set(e,t),e.dispatchEvent(new CustomEvent(`fluid-primitives:field:registered`,{bubbles:!0})))}function b(e){if(e)return v.get(e)}const x=[`invalid`,`disabled`,`readOnly`,`required`],S={disabled:e=>e.context.get(`disabled`),readOnly:e=>e.context.get(`readOnly`),required:e=>e.context.get(`required`),invalid:e=>e.context.get(`invalid`)};var C=class extends _{subscribedToField=!1;fieldMachine;closestField=null;getClosestField(){return this.closestField||this.getElement(`root`)?.closest(`[data-scope="field"][data-part="root"]`)||null}withFieldProps(e){if(this.closestField=this.getClosestField(),!this.closestField)return e;if(this.fieldMachine=b(this.closestField),this.fieldMachine)return this.propsWithField(e,this.fieldMachine);{let e=()=>{this.fieldMachine=b(this.closestField),this.updateProps(this.propsWithField(this.userProps,this.fieldMachine)),this.closestField?.removeEventListener(`fluid-primitives:field:registered`,e)};this.closestField.addEventListener(`fluid-primitives:field:registered`,e)}return e}subscribeToFieldService(){if(!this.subscribedToField&&(this.closestField=this.getClosestField(),this.closestField))if(this.fieldMachine)this.fieldMachine.subscribe(e=>{queueMicrotask(()=>{let t={};for(let n of x){let r=!!S[n](e),i=!!this.machine.prop(n);r!==i&&(t[n]=r)}Object.keys(t).length>0?this.updateProps(t):(this.api=this.initApi(),this.render())})}),this.subscribedToField=!0;else{let e=()=>{this.subscribeToFieldService(),this.closestField.removeEventListener(`fluid-primitives:field:registered`,e)};this.closestField.addEventListener(`fluid-primitives:field:registered`,e)}}};function w(e,t){let n=window.FluidPrimitives.hydrationData;return!n||typeof n!=`object`?null:e?n[e]?t?n[e][t]||null:n[e]:null:n}function T(e,t){let n=w(e);n&&Object.keys(n).forEach(r=>{if(n[r].controlled)return;let i=t(n[r]);i&&(window.FluidPrimitives.uncontrolledInstances[e]||(window.FluidPrimitives.uncontrolledInstances[e]={}),window.FluidPrimitives.uncontrolledInstances[e][r]=i)})}var E=class{componentName;doc;rootId;ids;elementRefs=new Map;constructor(e,t,n={},r=document){if(this.componentName=e,this.doc=r,!t)throw Error(`Root ID is required for component hydration: ${e}`);this.rootId=t,this.ids=n}getElement(e,t=this.doc){if(this.elementRefs.has(e))return this.elementRefs.get(e)||null;let n=null;return n=this.ids[e]?t.querySelector(`#${this.ids[e]}`):t.querySelector(`[data-hydrate-${this.componentName}="${this.rootId}"][data-part="${e}"][data-scope="${this.componentName}"]`),n&&(t===this.doc&&this.elementRefs.set(e,n),n.removeAttribute(`data-hydrate-${this.componentName}`),n.__rootId=this.rootId),n}getElements(e,t=this.doc){if(this.elementRefs.has(e))return this.elementRefs.get(e);let n=[];return n=this.ids[e]?Array.from(t.querySelectorAll(`#${this.ids[e]}`)):Array.from(t.querySelectorAll(`[data-hydrate-${this.componentName}="${this.rootId}"][data-part="${e}"][data-scope="${this.componentName}"]`)),t===this.doc&&this.elementRefs.set(e,n),n.forEach(e=>e.removeAttribute(`data-hydrate-${this.componentName}`)),n}generateRefAttributesString(e){let t=this.ids[e]||`${this.rootId}-${e}`;return`data-scope="${this.componentName}" data-part="${e}" data-hydrate-${this.componentName}="${t}"`}setRefAttributes(e,t){let n=this.generateRefAttributesString(t),r=n.split(` `).map(e=>e.trim());r.forEach(t=>{let[n,r]=t.split(`=`);e.setAttribute(n,r.replace(/"/g,``))})}destroy(){this.elementRefs.forEach(e=>{e instanceof Element?e.setAttribute(`data-hydrate-${this.componentName}`,this.rootId):e.forEach(e=>e.setAttribute(`data-hydrate-${this.componentName}`,this.rootId))}),this.elementRefs.clear()}};function D(t){if(t instanceof e)return t;let n=new e({items:t.items,itemToValue:t.itemToValueKey?e=>e?.[t.itemToValueKey]:void 0,itemToString:t.itemToStringKey?e=>e?.[t.itemToStringKey]:void 0,isItemDisabled:t.isItemDisabledKey?e=>e?.[t.isItemDisabledKey]:void 0,groupBy:t.groupByKey?e=>{let n=t.groupByKey;if(n)return n.includes(`.`)?n.split(`.`).reduce((e,t)=>e?e[t]:void 0,e):e?.[n]}:void 0});return n}function O(e){let t=e().value??e().defaultValue;e().debug&&console.log(`[bindable > ${e().debug}] initial`,t);let n=e().isEqual??Object.is,r=a({value:t}),i=()=>e().value!==void 0;return{initial:t,ref:r,get(){return i()?e().value:r.value},set(t){let a=r.value,o=u(t)?t(a):t;e().debug&&console.log(`[bindable > ${e().debug}] setValue`,{next:o,prev:a}),i()||(r.value=o),n(o,a)||e().onChange?.(o,a)},invoke(t,n){e().onChange?.(t,n)},hash(t){return e().hash?.(t)??String(t)}}}O.cleanup=e=>{},O.ref=e=>{let t=e;return{get:()=>t,set:e=>{t=e}}};function k(e){let t={current:e};return{get(e){return t.current[e]},set(e,n){t.current[e]=n}}}var A=class{scope;ctx;prop;state;refs;computed;event={type:``};previousEvent;effects=new Map;transition=null;cleanups=[];subscriptions=[];userPropsRef;getEvent=()=>({...this.event,current:()=>this.event,previous:()=>this.previousEvent});getState=()=>({...this.state,matches:(...e)=>e.includes(this.state.get()),hasTag:e=>!!this.machine.states[this.state.get()]?.tags?.includes(e)});debug=(...e)=>{this.machine.debug&&console.log(...e)};notify=()=>{this.publish()};constructor(e,n={}){this.machine=e,this.userPropsRef={current:n};let{id:i,ids:a,getRootNode:c}=f(n);this.scope=r({id:i,ids:a,getRootNode:c});let l=t=>{let n=f(this.userPropsRef.current),r=e.props?.({props:s(n),scope:this.scope})??n;return r[t]};this.prop=l;let u=e.context?.({prop:l,bindable:O,scope:this.scope,flush(e){queueMicrotask(e)},getContext(){return d},getComputed(){return p},getRefs(){return m},getEvent:this.getEvent.bind(this)});u&&Object.values(u).forEach(e=>{let t=o(e.ref,()=>this.notify());this.cleanups.push(t)});let d={get(e){return u?.[e].get()},set(e,t){u?.[e].set(t)},initial(e){return u?.[e].initial},hash(e){let t=u?.[e].get();return u?.[e].hash(t)}};this.ctx=d;let p=t=>e.computed?.[t]({context:d,event:this.getEvent(),prop:l,refs:this.refs,scope:this.scope,computed:p})??{};this.computed=p;let m=k(e.refs?.({prop:l,context:d})??{});this.refs=m;let h=O(()=>({defaultValue:e.initialState({prop:l}),onChange:(n,r)=>{if(r){let e=this.effects.get(r);e?.(),this.effects.delete(r)}r&&this.action(e.states[r]?.exit),this.action(this.transition?.actions);let i=this.effect(e.states[n]?.effects);if(i&&this.effects.set(n,i),r===t){this.action(e.entry);let n=this.effect(e.effects);n&&this.effects.set(t,n)}this.action(e.states[n]?.entry)}}));this.state=h,this.cleanups.push(o(this.state.ref,()=>this.notify()))}updateProps(e){this.userPropsRef.current=e,this.notify()}send=e=>{this.status===n.Started&&queueMicrotask(()=>{this.previousEvent=this.event,this.event=e,this.debug(`send`,e);let t=this.state.get(),n=this.machine.states[t].on?.[e.type]??this.machine.on?.[e.type],r=this.choose(n);if(!r)return;this.transition=r;let i=r.target??t;this.debug(`transition`,r);let a=i!==t;a?this.state.set(i):this.action(r.actions)})};action=e=>{let t=u(e)?e(this.getParams()):e;if(!t)return;let n=t.map(e=>{let t=this.machine.implementations?.actions?.[e];return t||h(`[zag-js] No implementation found for action "${JSON.stringify(e)}"`),t});for(let e of n)e?.(this.getParams())};guard=e=>u(e)?e(this.getParams()):this.machine.implementations?.guards?.[e](this.getParams());effect=e=>{let t=u(e)?e(this.getParams()):e;if(!t)return;let n=t.map(e=>{let t=this.machine.implementations?.effects?.[e];return t||h(`[zag-js] No implementation found for effect "${JSON.stringify(e)}"`),t}),r=[];for(let e of n){let t=e?.(this.getParams());t&&r.push(t)}return()=>r.forEach(e=>e?.())};choose=e=>p(e).find(e=>{let t=!e.guard;return d(e.guard)?t=!!this.guard(e.guard):u(e.guard)&&(t=e.guard(this.getParams())),t});start(){this.status=n.Started,this.debug(`initializing...`),this.state.invoke(this.state.initial,t),this.setupTrackers()}stop(){this.effects.forEach(e=>e?.()),this.effects.clear(),this.transition=null,this.action(this.machine.exit),this.cleanups.forEach(e=>e()),this.cleanups=[],this.status=n.Stopped,this.debug(`unmounting...`)}subscribe=e=>{this.subscriptions.push(e)};status=n.NotStarted;get service(){return{state:this.getState(),send:this.send,context:this.ctx,prop:this.prop,scope:this.scope,refs:this.refs,computed:this.computed,event:this.getEvent(),getStatus:()=>this.status}}publish=()=>{this.callTrackers(),this.subscriptions.forEach(e=>e(this.service))};trackers=[];setupTrackers=()=>{this.machine.watch?.(this.getParams())};callTrackers=()=>{this.trackers.forEach(({deps:e,fn:t})=>{let n=e.map(e=>e());l(t.prev,n)||(t(),t.prev=n)})};getParams=()=>({state:this.getState(),context:this.ctx,event:this.getEvent(),prop:this.prop,send:this.send,action:this.action,guard:this.guard,track:(e,t)=>{t.prev=e.map(e=>e()),this.trackers.push({deps:e,fn:t})},refs:this.refs,computed:this.computed,flush:c,scope:this.scope,choose:this.choose})};const j={onFocus:`onFocusin`,onBlur:`onFocusout`,onChange:`onInput`,onDoubleClick:`onDblclick`,htmlFor:`for`,className:`class`,defaultValue:`value`,defaultChecked:`checked`,onChange_:`onChange`},M=new Set([`viewBox`,`preserveAspectRatio`]),N=e=>{let t=``;for(let n in e){let r=e[n];if(r==null)continue;n.startsWith(`--`)||(n=n.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)),t+=`${n}:${r};`}return t},P=g(e=>Object.entries(e).reduce((e,[t,n])=>{if(n===void 0)return e;if(t in j&&(t=j[t]),t===`style`&&typeof n==`object`)return e.style=N(n),e;let r=M.has(t)?t:t.toLowerCase();return e[r]=n,e},{}));function F(...e){let t=i(...e);return`style`in t&&(t.style=N(t.style)),t}function I(e=`f`){return`«`+e+m()+`»`}const L=new Map,R=new Set([`value`,`checked`,`htmlFor`]),z=new Set([`viewBox`,`preserveAspectRatio`]),B=e=>e.tagName===`svg`||e.namespaceURI===`http://www.w3.org/2000/svg`,V=(e,t)=>{let n=B(e)&&z.has(t);return n?t:t.toLowerCase()};function H(e,t,n){e.__spreadId||=`spread_${I()}`;let r=``;r=n?`${e.__spreadId}_${n}`:`${e.__spreadId}`;let i=L.get(r)||{},a=Object.keys(t),o=(t,n)=>{e.addEventListener(t.toLowerCase(),n)},s=(t,n)=>{e.removeEventListener(t.toLowerCase(),n)},c=e=>e.startsWith(`on`),l=e=>!e.startsWith(`on`),u=e=>o(e.substring(2),t[e]),d=e=>s(e.substring(2),t[e]),f=n=>{let r=t[n],a=i[n];if(r!==a){if(n===`children`){e.textContent=r;return}if(typeof r==`boolean`&&(n.includes(`aria-`)||(r||=void 0)),r!=null){R.has(n)?e[n]=r:e.setAttribute(V(e,n),r);return}e.removeAttribute(V(e,n))}};for(let n in i)t[n]??e.removeAttribute(V(e,n));let p=Object.keys(i).filter(c);return p.forEach(e=>{s(e.substring(2),i[e])}),a.filter(c).forEach(u),a.filter(l).forEach(f),L.set(r,t),function(){a.filter(c).forEach(d)}}export{_ as Component,E as ComponentHydrator,C as FieldAwareComponent,A as Machine,w as getHydrationData,D as getListCollectionFromHydrationData,T as initAllComponentInstances,F as mergeProps,P as normalizeProps,y as registerFieldMachine,H as spreadProps,I as uid};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Component as e,Machine as t,normalizeProps as n}from"./Client-oBmSvCIl.js";import*as r from"@zag-js/clipboard";var i=class extends e{static name=`clipboard`;initMachine(e){return new t(r.machine,e)}initApi(){return r.connect(this.machine.service,n)}render(){let e=this.getElement(`root`);e&&this.spreadProps(e,this.api.getRootProps());let t=this.getElement(`label`);t&&this.spreadProps(t,this.api.getLabelProps());let n=this.getElement(`control`);n&&this.spreadProps(n,this.api.getControlProps());let r=this.getElement(`input`);r&&this.spreadProps(r,this.api.getInputProps());let i=this.getElement(`indicator-copied`);i&&this.spreadProps(i,this.api.getIndicatorProps({copied:!0}));let a=this.getElement(`indicator-idle`);a&&this.spreadProps(a,this.api.getIndicatorProps({copied:!1}));let o=this.getElement(`trigger`);o&&this.spreadProps(o,this.api.getTriggerProps())}};export{i as Clipboard};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Component as e,Machine as t,normalizeProps as n}from"./Client-oBmSvCIl.js";import*as r from"@zag-js/collapsible";var i=class extends e{static name=`collapsible`;initMachine(e){return new t(r.machine,e)}initApi(){return r.connect(this.machine.service,n)}render(){let e=this.getElement(`root`);e&&this.spreadProps(e,this.api.getRootProps());let t=this.getElement(`trigger`);t&&this.spreadProps(t,this.api.getTriggerProps());let n=this.getElement(`trigger-text`);n&&n.dataset.openText&&n.dataset.closeText&&(n.textContent=this.api.open?n.dataset.closeText:n.dataset.openText);let r=this.getElement(`content`);r&&this.spreadProps(r,this.api.getContentProps())}};export{i as Collapsible};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Component as e,Machine as t,normalizeProps as n}from"./Client-oBmSvCIl.js";import*as r from"@zag-js/dialog";var i=class extends e{static name=`dialog`;initMachine(e){return new t(r.machine,e)}initApi(){return r.connect(this.machine.service,n)}render(){let e=this.getElements(`trigger`);e.forEach(e=>{this.spreadProps(e,this.api.getTriggerProps())});let t=this.getElement(`backdrop`);t&&this.spreadProps(t,this.api.getBackdropProps());let n=this.getElement(`positioner`);n&&this.spreadProps(n,this.api.getPositionerProps());let r=this.getElement(`content`);r&&this.spreadProps(r,this.api.getContentProps());let i=this.getElement(`title`);i&&this.spreadProps(i,this.api.getTitleProps());let a=this.getElement(`description`);a&&this.spreadProps(a,this.api.getDescriptionProps());let o=this.getElements(`close-trigger`);o.forEach(e=>{this.spreadProps(e,this.api.getCloseTriggerProps())})}};export{i as Dialog};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Component as e,Machine as t,normalizeProps as n,registerFieldMachine as r}from"./Client-oBmSvCIl.js";import{getControlId as i,getErrorId as a,getLabelId as o,getRootEl as s,getRootId as c}from"./field.dom-BPeGctuk.js";import{getFormMachineFor as l,registerFieldMachineForForm as u}from"./form.registry-ABqE-vzj.js";import{createMachine as d}from"@zag-js/core";import{createAnatomy as f}from"@zag-js/anatomy";const p=f(`field`).parts(`root`,`label`,`control`,`error`),m=p.build();function h(e,t){let{scope:n,prop:r,context:s,computed:l}=e,u=s.get(`invalid`),d=l(`errors`);return{getFormMachine:()=>s.get(`formMachine`),invalid:u,errors:d,name:r(`name`),getErrorText(){return d.length?d[0]:null},getRootProps(){return t.element({...m.root.attrs,id:c(n),"data-invalid":u?``:void 0,"data-name":r(`name`)})},getLabelProps(){return t.label({...m.label.attrs,id:o(n),htmlFor:i(n)})},getControlProps(){return t.element({...m.control.attrs,id:i(n),name:r(`name`),"aria-invalid":u?`true`:`false`,"aria-describedby":s.get(`describeIds`),"data-invalid":u?``:void 0})},getErrorProps(){return t.element({...m.error.attrs,id:a(n),hidden:!u})}}}const g=d({initialState(){return`ready`},context({bindable:e,prop:t}){return{invalid:e(()=>({defaultValue:t(`invalid`)??!1})),required:e(()=>({defaultValue:t(`required`)??!1})),disabled:e(()=>({defaultValue:t(`disabled`)??!1})),readOnly:e(()=>({defaultValue:t(`readOnly`)??!1})),formMachine:e(()=>({defaultValue:null,hash:e=>JSON.stringify({state:e?.state,errors:e?.ctx.get(`errors`)})})),describeIds:e(()=>({defaultValue:void 0}))}},entry:[`getFormMachine`,`determineDescribeIds`,`updateInvalid`],states:{ready:{}},computed:{errors({context:e,prop:t}){let n=e.get(`formMachine`)?.ctx;if(!n)return[];let r=n.get(`errors`)?.[t(`name`)]??[];return r}},watch({track:e,context:t,computed:n,action:r}){e([()=>t.hash(`formMachine`),()=>n(`errors`).join(`|`)],()=>{r([`updateInvalid`])}),e([()=>t.get(`invalid`)],()=>{r([`determineDescribeIds`])})},implementations:{actions:{getFormMachine({context:e,scope:t}){if(e.get(`formMachine`))return;let n=s(t);if(!n)return;let r=l(n)??null;if(r)e.set(`formMachine`,r);else{let t=n.closest(`form`);if(!t)return;let r=()=>{let i=l(n)??null;e.set(`formMachine`,i),t.removeEventListener(`fluid-primitives:form:registered`,r)};t.addEventListener(`fluid-primitives:form:registered`,r)}},determineDescribeIds({context:e,scope:t}){let n=[];e.get(`invalid`)&&n.push(a(t));let r=n.join(` `)||void 0;e.set(`describeIds`,r)},updateInvalid({context:e,prop:t}){let n=e.get(`formMachine`)?.ctx;if(!n){e.set(`invalid`,t(`invalid`)??!1);return}let r=n.get(`errors`)?.[t(`name`)]??[];e.set(`invalid`,r.length>0)}}}});var _=class extends e{static name=`field`;subscribedToForm=!1;initMachine(e){let n=new t(g,e);return r(this.getElement(`root`),n),u(this.getElement(`root`),n),n}initApi(){return h(this.machine.service,n)}subscribeToFormMachine(){if(this.subscribedToForm)return;let e=this.api.getFormMachine();e&&(this.subscribedToForm=!0,e.subscribe(()=>{this.machine.notify()}))}render(){this.subscribeToFormMachine();let e=this.getElement(`root`);e&&this.spreadProps(e,this.api.getRootProps());let t=this.getElement(`label`);t&&this.spreadProps(t,this.api.getLabelProps());let n=this.getElement(`control`);n&&this.spreadProps(n,this.api.getControlProps());let r=this.getElement(`error`);if(r){this.spreadProps(r,this.api.getErrorProps());let e=this.api.getErrorText();r.textContent!==void 0&&(r.textContent=e??``)}}};export{_ as Field};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Component as e,Machine as t,normalizeProps as n}from"./Client-oBmSvCIl.js";import{getFieldMachinesFor as r,registerFormMachine as i}from"./form.registry-ABqE-vzj.js";import{createMachine as a}from"@zag-js/core";import{createAnatomy as o}from"@zag-js/anatomy";import{dataAttr as s}from"@zag-js/dom-query";const c=o(`form`).parts(`form`),l=c.build(),u=e=>e.ids?.form??`form:${e.id}:form`,d=e=>e.getById(u(e));function f(e,t){let{context:n,state:i,send:a,scope:o,prop:c}=e;function f(){return n.get(`values`)}function p(){return n.get(`errors`)}function m(){return n.get(`dirty`)}function h(){return d(o)}let g=i.matches(`submitting`),_=Object.values(m()).some(e=>e),v=Object.values(p()).some(e=>e),y=i.matches(`success`),b=i.matches(`error`),x=i.get();return{isSubmitting:g,isDirty:_,isInvalid:v,isSuccessful:y,isError:b,getValues:f,getErrors:p,getDirty:m,userRenderFn:c(`render`),getFormEl:h,getFields(){return r(d(o))},getAction(){let e=h();return e.getAttribute(`action`)||``},getFormProps(){return t.element({...l.form.attrs,noValidate:s(!0),id:u(o),"data-state":x,onSubmit:async e=>{e.preventDefault();let t=e.currentTarget;n.set(`values`,new FormData(t)),a({type:`SUBMIT`,detail:{event:e,api:this}})},onReset:e=>{let t=e.currentTarget;queueMicrotask(()=>{let e=new FormData(t);n.set(`initialValues`,e),n.set(`values`,e),n.set(`errors`,{});let r={};for(let t of Object.keys(e))r[t]=!1;n.set(`dirty`,r)}),a({type:`RESET`})},onInput:e=>{a({type:`INPUT`,detail:{target:e.target}})},onChange_:e=>{a({type:`INPUT`,detail:{target:e.target}})}})}}}let p;function m(e){return{lang:e?.lang??p?.lang,message:e?.message,abortEarly:e?.abortEarly??p?.abortEarly,abortPipeEarly:e?.abortPipeEarly??p?.abortPipeEarly}}function h(e,t,n){let r=e[`~run`]({value:t},m(n));return{typed:r.typed,success:!r.issues,output:r.value,issues:r.issues}}function g(e){if(!e||e.length===0)return``;let t=e.map(e=>typeof e.key==`number`?String(e.key):typeof e.key==`string`?e.key:typeof e.index==`number`?String(e.index):``).filter(Boolean);return t.join(`.`)}function _(e,t){if(e.success)return{};let n={};for(let r of e.issues){let e=t||g(r.path)||(typeof r.input==`string`?r.input:``),i=r.message??`Invalid value`;n[e]||(n[e]=[]),n[e].push(i)}return n}function v(e,t){let n={};for(let r in e){let i=r;t&&(i=i.replace(t+`.`,``)),n[i]=e[r]}return n}function y(e){let t=e;if(!(!t||!(`type`in t))){if(t.type===`checkbox`){let e=t;if(e.name){let t=e.form;if(t){let n=Array.from(t.querySelectorAll(`input[type="checkbox"][name="${CSS.escape(e.name)}"]`)),r=n.filter(e=>e.checked).map(e=>e.value||`on`);return n.length===1&&!n[0].value?n[0].checked:r}}return e.checked}if(t.type===`radio`){let e=t;if(e.form&&e.name){let t=e.form.querySelector(`input[type="radio"][name="${CSS.escape(e.name)}"]:checked`);return t?t.value:``}return e.checked?e.value:``}return t instanceof HTMLSelectElement&&t.multiple?Array.from(t.selectedOptions).map(e=>e.value):t.value}}function b(e,t,n){if(e===``)return``;n&&(e=`${n}[${e}]`);let r=e.split(`[`,2),i=`${t}[${r[0]}]`;return r.length>1&&(i+=`[${r[1]}`),i}const x=a({initialState(){return`ready`},context({bindable:e}){return{values:e(()=>({defaultValue:new FormData})),initialValues:e(()=>({defaultValue:new FormData})),errors:e(()=>({defaultValue:{}})),dirty:e(()=>({defaultValue:{}}))}},states:{ready:{},invalid:{},submitting:{},success:{},error:{}},on:{SUBMIT:{target:`submitting`,actions:[`validateAll`]},VALIDATE:{actions:[`validateAll`]},INVALID:{target:`invalid`},INPUT:{actions:[`handleInput`]},RESET:{target:`ready`,actions:[`resetForm`]},ERROR:{target:`error`},SUCCESS:{target:`success`}},entry:[`handleFieldBlurs`],implementations:{actions:{validateAll({context:e,send:t,prop:n,state:r,action:i,event:a,scope:o}){let s=r.matches(`submitting`),c=n(`schema`);if(c){let n=h(c,Object.fromEntries(e.get(`values`).entries())),r=_(n);if(e.set(`errors`,r),Object.keys(r).length>0){t({type:`INVALID`}),s&&i([`focusFirstInvalid`]);return}}if(!s){r.set(`ready`);return}let l=n(`onSubmit`);if(!l){t({type:`SUCCESS`});return}let u;try{u=l({formData:e.get(`values`),api:a.detail.api,event:a.detail.event,post:async(r,i)=>{let a=new FormData,s=n(`objectName`),c=d(o).getAttribute(`data-field-name-prefix`)||``;for(let[e,t]of i.entries()){if(e.includes(c)){a.append(e,t);continue}a.append(b(e,c,s),t)}let l=await fetch(r,{method:`POST`,body:a});if(l.status===422){let n=await l.json();e.set(`errors`,v(n,s)),t({type:`INVALID`})}return l}})}catch{t({type:`ERROR`});return}u instanceof Promise?u.then(e=>{t(e?{type:`SUCCESS`}:{type:`ERROR`})}).catch(()=>{t({type:`ERROR`})}):t(u?{type:`SUCCESS`}:{type:`ERROR`})},handleInput({context:e,event:t,action:n,prop:r}){let i=t,a=i?.detail?.target??i?.target??i?.currentTarget,o=a?.name;if(!o)return;let s=r(`reactiveFields`)||[];if(s.length===0||!s.includes(o))return;let c=i?.detail?.value??y(a),l=e.get(`values`);l.set(o,c),e.set(`values`,l);let u=e.get(`initialValues`).get(o),d={...e.get(`dirty`)};d[o]=JSON.stringify(l.get(o))!==JSON.stringify(u),e.set(`dirty`,d),e.get(`errors`)[o]&&n([`validateAll`])},resetForm({context:e}){let t=e.get(`initialValues`);e.set(`values`,{...t}),e.set(`errors`,{});let n={};for(let e of Object.keys(t))n[e]=!1;e.set(`dirty`,n)},focusFirstInvalid({context:e,scope:t}){let n=e.get(`errors`),r=Object.keys(n)[0];if(!r)return;let i=d(t),a=i.querySelector(`[name="${CSS.escape(r)}"]`);a?.focus()},handleFieldBlurs({scope:e}){let t=d(e);if(!t)return;let n=e=>{let t=e.target,n=t?.name};t.addEventListener(`blur`,n,!0)}}}});var S=class extends e{static name=`form`;initMachine(e){let n=new t(x,e);return i(this.getElement(`form`),n),n}initApi(){return f(this.machine.service,n)}render(){let e=this.getElement(`form`);e&&(this.spreadProps(e,this.api.getFormProps()),this.api.userRenderFn?.(this))}};export{S as Form};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Component as e,Machine as t,normalizeProps as n}from"./Client-oBmSvCIl.js";import*as r from"@zag-js/popover";var i=class extends e{static name=`popover`;initMachine(e){return new t(r.machine,{...e,positioning:{gutter:6,...e.positioning}})}initApi(){return r.connect(this.machine.service,n)}render(){let e=this.getElement(`trigger`);console.log({triggerEl:e}),e&&this.spreadProps(e,this.api.getTriggerProps());let t=this.getElement(`positioner`);t&&this.spreadProps(t,this.api.getPositionerProps());let n=this.getElement(`arrow`);n&&this.spreadProps(n,this.api.getArrowProps());let r=this.getElement(`arrow-tip`);r&&this.spreadProps(r,this.api.getArrowTipProps());let i=this.getElement(`content`);i&&this.spreadProps(i,this.api.getContentProps());let a=this.getElement(`title`);a&&this.spreadProps(a,this.api.getTitleProps());let o=this.getElement(`description`);o&&this.spreadProps(o,this.api.getDescriptionProps());let s=this.getElement(`close-trigger`);s&&this.spreadProps(s,this.api.getCloseTriggerProps());let c=this.getElement(`indicator`);c&&this.spreadProps(c,this.api.getIndicatorProps())}};export{i as Popover};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Component as e,Machine as t,normalizeProps as n}from"./Client-oBmSvCIl.js";import*as r from"@zag-js/scroll-area";var i=class extends e{static name=`scroll-area`;initMachine(e){return new t(r.machine,e)}initApi(){return r.connect(this.machine.service,n)}render(){let e=this.getElement(`root`);e&&this.spreadProps(e,this.api.getRootProps());let t=this.getElement(`viewport`);t&&this.spreadProps(t,this.api.getViewportProps());let n=this.getElement(`content`);n&&this.spreadProps(n,this.api.getContentProps());let r=this.getElements(`scrollbar`);r.forEach(e=>{this.spreadProps(e,this.api.getScrollbarProps({orientation:e.getAttribute(`data-orientation`)}))});let i=this.getElement(`corner`);i&&this.spreadProps(i,this.api.getCornerProps());let a=this.getElements(`thumb`);a.forEach(e=>{this.spreadProps(e,this.api.getThumbProps({orientation:e.getAttribute(`data-orientation`)}))})}};export{i as ScrollArea};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{FieldAwareComponent as e,Machine as t,getListCollectionFromHydrationData as n,mergeProps as r,normalizeProps as i}from"./Client-oBmSvCIl.js";import{getControlId as a,getLabelId as o}from"./field.dom-BPeGctuk.js";import*as s from"@zag-js/select";var c=class extends e{static name=`select`;propsWithField(e,t){return{...e,disabled:e.disabled??t.ctx.get(`disabled`),readOnly:e.readOnly??t.ctx.get(`readOnly`),required:e.required??t.ctx.get(`required`),invalid:e.invalid??t.ctx.get(`invalid`),name:e.name??t.prop(`name`),ids:{...e.ids,label:o(t.scope),hiddenSelect:a(t.scope)}}}transformProps(e){return{...e,get collection(){return n(e.collection)}}}initMachine(e){return e=this.withFieldProps(e),new t(s.machine,this.transformProps(e))}initApi(){return s.connect(this.machine.service,i)}render=()=>{this.subscribeToFieldService();let e=this.getElement(`root`);e&&this.spreadProps(e,this.api.getRootProps());let t=this.getElement(`control`);t&&this.spreadProps(t,this.api.getControlProps());let n=this.getElement(`hidden-select`);if(n){let e=r(this.api.getHiddenSelectProps(),{"aria-describedby":this.fieldMachine?.ctx.get(`describeIds`)||void 0});this.spreadProps(n,e)}let i=this.getElement(`label`);i&&this.spreadProps(i,this.api.getLabelProps());let a=this.getElement(`trigger`);a&&this.spreadProps(a,this.api.getTriggerProps());let o=this.getElement(`positioner`);o&&this.spreadProps(o,this.api.getPositionerProps());let s=this.getElement(`content`);s&&this.spreadProps(s,this.api.getContentProps());let c=this.getElement(`value-text`);c&&this.spreadProps(c,r(this.api.getValueTextProps(),{children:this.api.valueAsString||c.dataset.placeholder}));let l=this.getElements(`item-group`);l.forEach(e=>{this.spreadProps(e,this.api.getItemGroupProps({id:e.dataset.id}));let t=this.getElement(`item-group-label`,e);t&&this.spreadProps(t,this.api.getItemGroupLabelProps({htmlFor:e.dataset.id}))});let u=this.getElements(`item`);u.forEach(e=>{let t=this.api.collection.find(e.dataset.value);t&&this.spreadProps(e,this.api.getItemProps({item:t}))});let d=this.getElements(`item-text`);d.forEach(e=>{let t=this.api.collection.find(e.dataset.value);t&&this.spreadProps(e,this.api.getItemTextProps({item:t}))});let f=this.getElements(`item-indicator`);f.forEach(e=>{let t=this.api.collection.find(e.dataset.value);t&&this.spreadProps(e,this.api.getItemIndicatorProps({item:t}))});let p=this.getElement(`clear-trigger`);p&&this.spreadProps(p,this.api.getClearTriggerProps());let m=this.getElement(`indicator`);m&&this.spreadProps(m,this.api.getIndicatorProps())}};export{c as Select};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Component as e,Machine as t,normalizeProps as n}from"./Client-oBmSvCIl.js";import*as r from"@zag-js/tabs";var i=class extends e{static name=`tabs`;initMachine(e){return new t(r.machine,e)}initApi(){return r.connect(this.machine.service,n)}render=()=>{let e=this.getElement(`root`);e&&this.spreadProps(e,this.api.getRootProps());let t=this.getElement(`list`);t&&this.spreadProps(t,this.api.getListProps());let n=this.getElements(`trigger`);n.forEach(e=>{this.spreadProps(e,this.api.getTriggerProps({value:e.dataset.value,disabled:e.getAttribute(`data-disabled`)===`true`}))});let r=this.getElements(`content`);r.forEach(e=>{this.spreadProps(e,this.api.getContentProps({value:e.dataset.value}))});let i=this.getElement(`indicator`);i&&this.spreadProps(i,this.api.getIndicatorProps())}};export{i as Tabs};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Component as e,Machine as t,normalizeProps as n}from"./Client-oBmSvCIl.js";import*as r from"@zag-js/tooltip";var i=class extends e{static name=`tooltip`;initMachine(e){return new t(r.machine,{interactive:!0,...e,positioning:{placement:`top`,gutter:6,...e.positioning}})}initApi(){return r.connect(this.machine.service,n)}render(){let e=this.getElement(`trigger`);e&&this.spreadProps(e,this.api.getTriggerProps());let t=this.getElement(`positioner`);t&&this.spreadProps(t,this.api.getPositionerProps());let n=this.getElement(`arrow`);n&&this.spreadProps(n,this.api.getArrowProps());let r=this.getElement(`arrow-tip`);r&&this.spreadProps(r,this.api.getArrowTipProps());let i=this.getElement(`content`);i&&this.spreadProps(i,this.api.getContentProps())}};export{i as Tooltip};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Component$1 as Component, Machine$1 as Machine } from "./index-
|
|
1
|
+
import { Component$1 as Component, Machine$1 as Machine } from "./index-w1HRp_7W.js";
|
|
2
2
|
import * as _zag_js_types0 from "@zag-js/types";
|
|
3
3
|
import * as accordion from "@zag-js/accordion";
|
|
4
4
|
|
|
5
5
|
//#region Resources/Private/Primitives/Accordion/Accordion.d.ts
|
|
6
6
|
declare class Accordion extends Component<accordion.Props, accordion.Api> {
|
|
7
|
-
name: string;
|
|
7
|
+
static name: string;
|
|
8
8
|
initMachine(props: accordion.Props): Machine<any>;
|
|
9
9
|
initApi(): accordion.Api<_zag_js_types0.PropTypes<{
|
|
10
10
|
[x: string]: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{initAllComponentInstances as e}from"./Client-
|
|
1
|
+
import{initAllComponentInstances as e}from"./Client-oBmSvCIl.js";import{Accordion as t}from"./Accordion-DyRSZ01R.js";e(`accordion`,({props:e})=>{let n=new t(e);return n.init(),n});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./Client-
|
|
1
|
+
import"./Client-oBmSvCIl.js";import{Accordion as e}from"./Accordion-DyRSZ01R.js";export{e as Accordion};
|
|
@@ -1,14 +1,52 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as _zag_js_types0 from "@zag-js/types";
|
|
1
|
+
import { FieldAwareComponent$1 as FieldAwareComponent, FieldMachine, Machine$1 as Machine } from "./index-w1HRp_7W.js";
|
|
3
2
|
import * as checkbox from "@zag-js/checkbox";
|
|
4
3
|
|
|
5
4
|
//#region Resources/Private/Primitives/Checkbox/Checkbox.d.ts
|
|
6
|
-
declare class Checkbox extends
|
|
7
|
-
name: string;
|
|
5
|
+
declare class Checkbox extends FieldAwareComponent<checkbox.Props, checkbox.Api> {
|
|
6
|
+
static name: string;
|
|
7
|
+
propsWithField(props: checkbox.Props, fieldMachine: FieldMachine): checkbox.Props;
|
|
8
8
|
initMachine(props: checkbox.Props): Machine<any>;
|
|
9
|
-
initApi(): checkbox.Api<
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
initApi(): checkbox.Api<{
|
|
10
|
+
button: {
|
|
11
|
+
[x: string]: any;
|
|
12
|
+
};
|
|
13
|
+
label: {
|
|
14
|
+
[x: string]: any;
|
|
15
|
+
};
|
|
16
|
+
input: {
|
|
17
|
+
[x: string]: any;
|
|
18
|
+
};
|
|
19
|
+
textarea: {
|
|
20
|
+
[x: string]: any;
|
|
21
|
+
};
|
|
22
|
+
img: {
|
|
23
|
+
[x: string]: any;
|
|
24
|
+
};
|
|
25
|
+
output: {
|
|
26
|
+
[x: string]: any;
|
|
27
|
+
};
|
|
28
|
+
element: {
|
|
29
|
+
[x: string]: any;
|
|
30
|
+
};
|
|
31
|
+
select: {
|
|
32
|
+
[x: string]: any;
|
|
33
|
+
};
|
|
34
|
+
rect: {
|
|
35
|
+
[x: string]: any;
|
|
36
|
+
};
|
|
37
|
+
style: {
|
|
38
|
+
[x: string]: any;
|
|
39
|
+
};
|
|
40
|
+
circle: {
|
|
41
|
+
[x: string]: any;
|
|
42
|
+
};
|
|
43
|
+
svg: {
|
|
44
|
+
[x: string]: any;
|
|
45
|
+
};
|
|
46
|
+
path: {
|
|
47
|
+
[x: string]: any;
|
|
48
|
+
};
|
|
49
|
+
}>;
|
|
12
50
|
render(): void;
|
|
13
51
|
}
|
|
14
52
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{initAllComponentInstances as e}from"./Client-
|
|
1
|
+
import{initAllComponentInstances as e}from"./Client-oBmSvCIl.js";import"./field.dom-BPeGctuk.js";import{Checkbox as t}from"./Checkbox-DH3KIA4G.js";e(`checkbox`,({props:e})=>{let n=new t(e);return n.init(),n});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./Client-
|
|
1
|
+
import"./Client-oBmSvCIl.js";import"./field.dom-BPeGctuk.js";import{Checkbox as e}from"./Checkbox-DH3KIA4G.js";export{e as Checkbox};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Component$1 as Component, ComponentHydrationData, ComponentHydrator$1 as ComponentHydrator, ComponentInterface, Machine$1 as Machine, getHydrationData$1 as getHydrationData, initAllComponentInstances$1 as initAllComponentInstances, mergeProps$1 as mergeProps, normalizeProps$1 as normalizeProps, spreadProps$1 as spreadProps } from "./index-
|
|
2
|
-
export { Component, ComponentHydrationData, ComponentHydrator, ComponentInterface, Machine, getHydrationData, initAllComponentInstances, mergeProps, normalizeProps, spreadProps };
|
|
1
|
+
import { Component$1 as Component, ComponentHydrationData, ComponentHydrator$1 as ComponentHydrator, ComponentInterface, FieldAwareComponent$1 as FieldAwareComponent, Machine$1 as Machine, getHydrationData$1 as getHydrationData, initAllComponentInstances$1 as initAllComponentInstances, mergeProps$1 as mergeProps, normalizeProps$1 as normalizeProps, spreadProps$1 as spreadProps, uid$1 as uid } from "./index-w1HRp_7W.js";
|
|
2
|
+
export { Component, ComponentHydrationData, ComponentHydrator, ComponentInterface, FieldAwareComponent, Machine, getHydrationData, initAllComponentInstances, mergeProps, normalizeProps, spreadProps, uid };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Component as e,ComponentHydrator as t,
|
|
1
|
+
import{Component as e,ComponentHydrator as t,FieldAwareComponent as n,Machine as r,getHydrationData as i,initAllComponentInstances as a,mergeProps as o,normalizeProps as s,spreadProps as c,uid as l}from"./Client-oBmSvCIl.js";export{e as Component,t as ComponentHydrator,n as FieldAwareComponent,r as Machine,i as getHydrationData,a as initAllComponentInstances,o as mergeProps,s as normalizeProps,c as spreadProps,l as uid};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { Component$1 as Component, Machine$1 as Machine } from "./index-
|
|
2
|
-
import * as
|
|
1
|
+
import { Component$1 as Component, Machine$1 as Machine } from "./index-w1HRp_7W.js";
|
|
2
|
+
import * as _zag_js_types1 from "@zag-js/types";
|
|
3
3
|
import * as clipboard from "@zag-js/clipboard";
|
|
4
4
|
|
|
5
5
|
//#region Resources/Private/Primitives/Clipboard/Clipboard.d.ts
|
|
6
6
|
declare class Clipboard extends Component<clipboard.Props, clipboard.Api> {
|
|
7
|
-
name: string;
|
|
7
|
+
static name: string;
|
|
8
8
|
initMachine(props: clipboard.Props): Machine<clipboard.Schema>;
|
|
9
|
-
initApi(): clipboard.Api<
|
|
9
|
+
initApi(): clipboard.Api<_zag_js_types1.PropTypes<{
|
|
10
10
|
[x: string]: any;
|
|
11
11
|
}>>;
|
|
12
12
|
render(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{initAllComponentInstances as e}from"./Client-
|
|
1
|
+
import{initAllComponentInstances as e}from"./Client-oBmSvCIl.js";import{Clipboard as t}from"./Clipboard-CkdRKp1D.js";e(`clipboard`,({props:e})=>{let n=new t(e);return n.init(),n});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./Client-
|
|
1
|
+
import"./Client-oBmSvCIl.js";import{Clipboard as e}from"./Clipboard-CkdRKp1D.js";export{e as Clipboard};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Component$1 as Component, Machine$1 as Machine } from "./index-
|
|
1
|
+
import { Component$1 as Component, Machine$1 as Machine } from "./index-w1HRp_7W.js";
|
|
2
2
|
import * as _zag_js_types2 from "@zag-js/types";
|
|
3
3
|
import * as collapsible from "@zag-js/collapsible";
|
|
4
4
|
|
|
5
5
|
//#region Resources/Private/Primitives/Collapsible/Collapsible.d.ts
|
|
6
6
|
declare class Collapsible extends Component<collapsible.Props, collapsible.Api> {
|
|
7
|
-
name: string;
|
|
7
|
+
static name: string;
|
|
8
8
|
initMachine(props: collapsible.Props): Machine<any>;
|
|
9
9
|
initApi(): collapsible.Api<_zag_js_types2.PropTypes<{
|
|
10
10
|
[x: string]: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{initAllComponentInstances as e}from"./Client-
|
|
1
|
+
import{initAllComponentInstances as e}from"./Client-oBmSvCIl.js";import{Collapsible as t}from"./Collapsible-ndvh9m1d.js";e(`collapsible`,({props:e})=>{let n=new t(e);return n.init(),n});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./Client-
|
|
1
|
+
import"./Client-oBmSvCIl.js";import{Collapsible as e}from"./Collapsible-ndvh9m1d.js";export{e as Collapsible};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { Component$1 as Component, Machine$1 as Machine } from "./index-
|
|
2
|
-
import * as
|
|
1
|
+
import { Component$1 as Component, Machine$1 as Machine } from "./index-w1HRp_7W.js";
|
|
2
|
+
import * as _zag_js_types0 from "@zag-js/types";
|
|
3
3
|
import * as dialog from "@zag-js/dialog";
|
|
4
4
|
|
|
5
5
|
//#region Resources/Private/Primitives/Dialog/Dialog.d.ts
|
|
6
6
|
declare class Dialog extends Component<dialog.Props, dialog.Api> {
|
|
7
|
-
name: string;
|
|
7
|
+
static name: string;
|
|
8
8
|
initMachine(props: dialog.Props): Machine<any>;
|
|
9
|
-
initApi(): dialog.Api<
|
|
9
|
+
initApi(): dialog.Api<_zag_js_types0.PropTypes<{
|
|
10
10
|
[x: string]: any;
|
|
11
11
|
}>>;
|
|
12
12
|
render(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{initAllComponentInstances as e}from"./Client-
|
|
1
|
+
import{initAllComponentInstances as e}from"./Client-oBmSvCIl.js";import{Dialog as t}from"./Dialog-DLY2NftK.js";e(`dialog`,({props:e})=>{let n=new t(e);return n.init(),n});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./Client-
|
|
1
|
+
import"./Client-oBmSvCIl.js";import{Dialog as e}from"./Dialog-DLY2NftK.js";export{e as Dialog};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Component$1 as Component, Machine$1 as Machine } from "./index-w1HRp_7W.js";
|
|
2
|
+
import { FormMachine } from "./form.registry-D0xyZwqn.js";
|
|
3
|
+
import { EventObject } from "@zag-js/core";
|
|
4
|
+
import { PropTypes } from "@zag-js/types";
|
|
5
|
+
|
|
6
|
+
//#region Resources/Private/Primitives/Field/src/field.types.d.ts
|
|
7
|
+
interface FieldProps {
|
|
8
|
+
id: string;
|
|
9
|
+
name: string;
|
|
10
|
+
invalid?: boolean;
|
|
11
|
+
required?: boolean;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
readOnly?: boolean;
|
|
14
|
+
}
|
|
15
|
+
interface FieldSchema {
|
|
16
|
+
props: FieldProps;
|
|
17
|
+
context: {
|
|
18
|
+
invalid: boolean;
|
|
19
|
+
required: boolean;
|
|
20
|
+
disabled: boolean;
|
|
21
|
+
readOnly: boolean;
|
|
22
|
+
formMachine: FormMachine | null;
|
|
23
|
+
describeIds: string | undefined;
|
|
24
|
+
};
|
|
25
|
+
computed: {
|
|
26
|
+
errors: string[];
|
|
27
|
+
};
|
|
28
|
+
state: 'ready';
|
|
29
|
+
event: EventObject;
|
|
30
|
+
action: string;
|
|
31
|
+
effect: string;
|
|
32
|
+
}
|
|
33
|
+
interface FieldApi {
|
|
34
|
+
getFormMachine(): FieldSchema['context']['formMachine'];
|
|
35
|
+
invalid: boolean;
|
|
36
|
+
errors: string[];
|
|
37
|
+
name: string;
|
|
38
|
+
getRootProps(): PropTypes['element'];
|
|
39
|
+
getLabelProps(): PropTypes['label'];
|
|
40
|
+
getControlProps(): PropTypes['element'];
|
|
41
|
+
getErrorProps(): PropTypes['element'];
|
|
42
|
+
getErrorText(): string | null;
|
|
43
|
+
}
|
|
44
|
+
//#endregion
|
|
45
|
+
//#region Resources/Private/Primitives/Field/Field.d.ts
|
|
46
|
+
declare class Field extends Component<FieldProps, FieldApi> {
|
|
47
|
+
static name: string;
|
|
48
|
+
private subscribedToForm;
|
|
49
|
+
initMachine(props: FieldProps): Machine<FieldSchema>;
|
|
50
|
+
initApi(): FieldApi;
|
|
51
|
+
subscribeToFormMachine(): void;
|
|
52
|
+
render(): void;
|
|
53
|
+
}
|
|
54
|
+
//#endregion
|
|
55
|
+
export { Field };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=e=>e.ids?.form??`field:${e.id}:root`,t=e=>e.ids?.label??`field:${e.id}:label`,n=e=>e.ids?.control??`field:${e.id}:control`,r=e=>e.ids?.error??`field:${e.id}:error`,i=t=>t.getById(e(t));export{n as getControlId,r as getErrorId,t as getLabelId,i as getRootEl,e as getRootId};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{initAllComponentInstances as e}from"./Client-oBmSvCIl.js";import"./field.dom-BPeGctuk.js";import"./form.registry-ABqE-vzj.js";import{Field as t}from"./Field-ChHx-OA0.js";e(`field`,({props:e})=>{let n=new t(e);return n.init(),n});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./Client-oBmSvCIl.js";import"./field.dom-BPeGctuk.js";import"./form.registry-ABqE-vzj.js";import{Field as e}from"./Field-ChHx-OA0.js";export{e as Field};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { Component$1 as Component, Machine$1 as Machine } from "./index-w1HRp_7W.js";
|
|
2
|
+
import { FieldMachine$1 as FieldMachine } from "./form.registry-D0xyZwqn.js";
|
|
3
|
+
import { EventObject } from "@zag-js/core";
|
|
4
|
+
import { JSX, PropTypes } from "@zag-js/types";
|
|
5
|
+
import * as v from "valibot";
|
|
6
|
+
|
|
7
|
+
//#region Resources/Private/Primitives/Form/src/form.types.d.ts
|
|
8
|
+
type FormErrors = Record<string, string[]>;
|
|
9
|
+
type FormDirty = Record<string, boolean>;
|
|
10
|
+
type ValibotFormSchema = v.ObjectSchema<v.ObjectEntries, v.ErrorMessage<v.ObjectIssue> | undefined>;
|
|
11
|
+
interface FormProps {
|
|
12
|
+
id: string;
|
|
13
|
+
schema?: ValibotFormSchema;
|
|
14
|
+
reactiveFields?: string[];
|
|
15
|
+
objectName?: string;
|
|
16
|
+
onSubmit?: ({
|
|
17
|
+
formData,
|
|
18
|
+
api,
|
|
19
|
+
event,
|
|
20
|
+
post
|
|
21
|
+
}: {
|
|
22
|
+
formData: FormData;
|
|
23
|
+
api: FormApi;
|
|
24
|
+
event: JSX.FormEvent<HTMLElement>;
|
|
25
|
+
post: (url: string, data: FormData) => Promise<Response>;
|
|
26
|
+
}) => Promise<boolean> | boolean;
|
|
27
|
+
render?: (form: Form) => void;
|
|
28
|
+
}
|
|
29
|
+
interface FormSchema {
|
|
30
|
+
props: FormProps;
|
|
31
|
+
context: {
|
|
32
|
+
values: FormData;
|
|
33
|
+
initialValues: FormData;
|
|
34
|
+
errors: FormErrors;
|
|
35
|
+
dirty: FormDirty;
|
|
36
|
+
};
|
|
37
|
+
state: 'invalid' | 'ready' | 'submitting' | 'success' | 'error';
|
|
38
|
+
event: EventObject;
|
|
39
|
+
action: string;
|
|
40
|
+
effect: string;
|
|
41
|
+
}
|
|
42
|
+
interface FormApi {
|
|
43
|
+
isSubmitting: boolean;
|
|
44
|
+
isDirty: boolean;
|
|
45
|
+
isInvalid: boolean;
|
|
46
|
+
isSuccessful: boolean;
|
|
47
|
+
isError: boolean;
|
|
48
|
+
getFormProps(): PropTypes['element'];
|
|
49
|
+
getValues(): FormData;
|
|
50
|
+
getErrors(): FormErrors;
|
|
51
|
+
getDirty(): FormDirty;
|
|
52
|
+
userRenderFn: FormProps['render'];
|
|
53
|
+
getFields(): Map<string, FieldMachine>;
|
|
54
|
+
getFormEl(): HTMLFormElement | null;
|
|
55
|
+
getAction(): string;
|
|
56
|
+
}
|
|
57
|
+
//#endregion
|
|
58
|
+
//#region Resources/Private/Primitives/Form/Form.d.ts
|
|
59
|
+
declare class Form extends Component<FormProps, FormApi> {
|
|
60
|
+
static name: string;
|
|
61
|
+
initMachine(props: FormProps): Machine<FormSchema>;
|
|
62
|
+
initApi(): FormApi;
|
|
63
|
+
render(): void;
|
|
64
|
+
}
|
|
65
|
+
//#endregion
|
|
66
|
+
export { Form };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{initAllComponentInstances as e}from"./Client-oBmSvCIl.js";import"./form.registry-ABqE-vzj.js";import{Form as t}from"./Form-CRD7_HtC.js";e(`form`,({props:e})=>{let n=new t(e);return n.init(),n});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./Client-oBmSvCIl.js";import"./form.registry-ABqE-vzj.js";import{Form as e}from"./Form-CRD7_HtC.js";export{e as Form};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=new WeakMap;function t(t,n){t&&(e.set(t,{machine:n,fields:new Map,expectedFieldCount:t.querySelectorAll(`[data-scope="field"][data-part="root"]`).length||0}),t.dispatchEvent(new CustomEvent(`fluid-primitives:form:registered`,{bubbles:!0})))}function n(t,n){if(!t)return;let i=r(t);if(!i)return;let a=e=>{e.fields.set(n.prop(`name`),n),e.fields.size===e.expectedFieldCount&&e.machine.notify()},o=()=>{let t=e.get(i);t&&(a(t),i.removeEventListener(`fluid-primitives:form:registered`,o))},s=e.get(i);s?a(s):i.addEventListener(`fluid-primitives:form:registered`,o)}function r(e){if(!e)return null;if(e instanceof HTMLFormElement)return e;let t=e.closest(`form`);return t}function i(t){if(!t)return;let n=r(t);if(n)return e.get(n)?.machine}function a(t){if(!t)return new Map;let n=r(t);if(!n)return new Map;let i=e.get(n);return i?i.fields:new Map}export{a as getFieldMachinesFor,i as getFormMachineFor,n as registerFieldMachineForForm,t as registerFormMachine};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Machine$1 as Machine } from "./index-w1HRp_7W.js";
|
|
2
|
+
|
|
3
|
+
//#region Resources/Private/Primitives/Form/src/form.registry.d.ts
|
|
4
|
+
type FormMachine = Machine<any>;
|
|
5
|
+
type FieldMachine = Machine<any>;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { FieldMachine as FieldMachine$1, FormMachine };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Bindable, BindableContext, BindableRefs, ComputedFn, Machine, MachineSchema, Params, PropFn, Scope, Service, mergeProps } from "@zag-js/core";
|
|
2
1
|
import { ListCollection } from "@zag-js/collection";
|
|
3
|
-
import
|
|
2
|
+
import { Bindable, BindableContext, BindableRefs, ComputedFn, Machine, MachineSchema, Params, PropFn, Scope, Service } from "@zag-js/core";
|
|
3
|
+
import * as _zag_js_types6 from "@zag-js/types";
|
|
4
4
|
|
|
5
5
|
//#region Resources/Private/Client/src/types.d.ts
|
|
6
6
|
declare global {
|
|
@@ -51,14 +51,17 @@ declare abstract class Component<Props, Api> implements ComponentInterface<Api>
|
|
|
51
51
|
machine: Machine$1<any>;
|
|
52
52
|
api: Api;
|
|
53
53
|
hydrator: ComponentHydrator | null;
|
|
54
|
-
userProps?: Props
|
|
55
|
-
|
|
54
|
+
userProps?: Partial<Props>;
|
|
55
|
+
static name: string;
|
|
56
56
|
get doc(): Document;
|
|
57
57
|
constructor(props: Props, userDocument?: Document);
|
|
58
58
|
abstract initMachine(props: Props): Machine$1<any>;
|
|
59
59
|
abstract initApi(): Api;
|
|
60
|
+
initHydrator(props: Props): ComponentHydrator;
|
|
60
61
|
init(): void;
|
|
61
|
-
|
|
62
|
+
getName(): string;
|
|
63
|
+
transformProps(props: Partial<Props>): Partial<Props>;
|
|
64
|
+
updateProps(props: Partial<Props>): void;
|
|
62
65
|
destroy: () => void;
|
|
63
66
|
abstract render(): void;
|
|
64
67
|
spreadProps(node: HTMLElement, attrs: Attrs): void;
|
|
@@ -67,6 +70,20 @@ declare abstract class Component<Props, Api> implements ComponentInterface<Api>
|
|
|
67
70
|
portalElement(el: HTMLElement | null, target?: HTMLElement | Document): void;
|
|
68
71
|
}
|
|
69
72
|
//#endregion
|
|
73
|
+
//#region Resources/Private/Primitives/Field/src/field.registry.d.ts
|
|
74
|
+
type FieldMachine = Machine$1<any>;
|
|
75
|
+
//#endregion
|
|
76
|
+
//#region Resources/Private/Client/src/lib/field-aware-component.d.ts
|
|
77
|
+
declare abstract class FieldAwareComponent<Props, Api> extends Component<Props, Api> {
|
|
78
|
+
protected subscribedToField: boolean;
|
|
79
|
+
protected fieldMachine: FieldMachine | undefined;
|
|
80
|
+
protected closestField: Element | null;
|
|
81
|
+
protected abstract propsWithField(props: Partial<Props>, fieldMachine: FieldMachine): Props;
|
|
82
|
+
protected getClosestField(): Element | null;
|
|
83
|
+
protected withFieldProps(props: Props): Props;
|
|
84
|
+
subscribeToFieldService(): void;
|
|
85
|
+
}
|
|
86
|
+
//#endregion
|
|
70
87
|
//#region Resources/Private/Client/src/lib/hydration.d.ts
|
|
71
88
|
declare function getHydrationData(component: string): Record<string, ComponentHydrationData> | null;
|
|
72
89
|
declare function getHydrationData(component: string, id: string): ComponentHydrationData | null;
|
|
@@ -104,11 +121,13 @@ declare class Machine$1<T extends MachineSchema> {
|
|
|
104
121
|
private transition;
|
|
105
122
|
private cleanups;
|
|
106
123
|
private subscriptions;
|
|
124
|
+
private userPropsRef;
|
|
107
125
|
private getEvent;
|
|
108
126
|
private getState;
|
|
109
127
|
debug: (...args: any[]) => void;
|
|
110
128
|
notify: () => void;
|
|
111
129
|
constructor(machine: Machine<T>, userProps?: Partial<T['props']> | (() => Partial<T['props']>));
|
|
130
|
+
updateProps(newProps: Partial<T['props']> | (() => Partial<T['props']>)): void;
|
|
112
131
|
send: (event: any) => void;
|
|
113
132
|
private action;
|
|
114
133
|
private guard;
|
|
@@ -126,9 +145,15 @@ declare class Machine$1<T extends MachineSchema> {
|
|
|
126
145
|
getParams: () => Params<T>;
|
|
127
146
|
}
|
|
128
147
|
//#endregion
|
|
148
|
+
//#region Resources/Private/Client/src/lib/merge-props.d.ts
|
|
149
|
+
declare function mergeProps$1(...args: Record<string | symbol, any>[]): Record<string | symbol, any>;
|
|
150
|
+
//#endregion
|
|
129
151
|
//#region Resources/Private/Client/src/lib/normalize-props.d.ts
|
|
130
|
-
declare const normalizeProps:
|
|
152
|
+
declare const normalizeProps: _zag_js_types6.NormalizeProps<_zag_js_types6.PropTypes<{
|
|
131
153
|
[x: string]: any;
|
|
132
154
|
}>>;
|
|
133
155
|
//#endregion
|
|
134
|
-
|
|
156
|
+
//#region Resources/Private/Client/src/lib/uid.d.ts
|
|
157
|
+
declare function uid(prefix?: string): string;
|
|
158
|
+
//#endregion
|
|
159
|
+
export { Component as Component$1, ComponentHydrationData, ComponentHydrator as ComponentHydrator$1, ComponentInterface, FieldAwareComponent as FieldAwareComponent$1, FieldMachine, Machine$1, getHydrationData as getHydrationData$1, initAllComponentInstances as initAllComponentInstances$1, mergeProps$1, normalizeProps as normalizeProps$1, spreadProps as spreadProps$1, uid as uid$1 };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Component$1 as Component, Machine$1 as Machine } from "./index-w1HRp_7W.js";
|
|
2
|
+
import * as popover from "@zag-js/popover";
|
|
3
|
+
|
|
4
|
+
//#region Resources/Private/Primitives/Popover/Popover.d.ts
|
|
5
|
+
declare class Popover extends Component<popover.Props, popover.Api> {
|
|
6
|
+
static name: string;
|
|
7
|
+
initMachine(props: popover.Props): Machine<any>;
|
|
8
|
+
initApi(): popover.Api<{
|
|
9
|
+
button: {
|
|
10
|
+
[x: string]: any;
|
|
11
|
+
};
|
|
12
|
+
label: {
|
|
13
|
+
[x: string]: any;
|
|
14
|
+
};
|
|
15
|
+
input: {
|
|
16
|
+
[x: string]: any;
|
|
17
|
+
};
|
|
18
|
+
textarea: {
|
|
19
|
+
[x: string]: any;
|
|
20
|
+
};
|
|
21
|
+
img: {
|
|
22
|
+
[x: string]: any;
|
|
23
|
+
};
|
|
24
|
+
output: {
|
|
25
|
+
[x: string]: any;
|
|
26
|
+
};
|
|
27
|
+
element: {
|
|
28
|
+
[x: string]: any;
|
|
29
|
+
};
|
|
30
|
+
select: {
|
|
31
|
+
[x: string]: any;
|
|
32
|
+
};
|
|
33
|
+
rect: {
|
|
34
|
+
[x: string]: any;
|
|
35
|
+
};
|
|
36
|
+
style: {
|
|
37
|
+
[x: string]: any;
|
|
38
|
+
};
|
|
39
|
+
circle: {
|
|
40
|
+
[x: string]: any;
|
|
41
|
+
};
|
|
42
|
+
svg: {
|
|
43
|
+
[x: string]: any;
|
|
44
|
+
};
|
|
45
|
+
path: {
|
|
46
|
+
[x: string]: any;
|
|
47
|
+
};
|
|
48
|
+
}>;
|
|
49
|
+
render(): void;
|
|
50
|
+
}
|
|
51
|
+
//#endregion
|
|
52
|
+
export { Popover };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{initAllComponentInstances as e}from"./Client-oBmSvCIl.js";import{Popover as t}from"./Popover-BYysiZof.js";e(`popover`,({props:e})=>{let n=new t(e);return n.init(),n});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./Client-oBmSvCIl.js";import{Popover as e}from"./Popover-BYysiZof.js";export{e as Popover};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Component$1 as Component, Machine$1 as Machine } from "./index-
|
|
1
|
+
import { Component$1 as Component, Machine$1 as Machine } from "./index-w1HRp_7W.js";
|
|
2
2
|
import { PropTypes } from "@zag-js/types";
|
|
3
3
|
import * as scrollArea from "@zag-js/scroll-area";
|
|
4
4
|
|
|
5
5
|
//#region Resources/Private/Primitives/ScrollArea/ScrollArea.d.ts
|
|
6
6
|
declare class ScrollArea extends Component<scrollArea.Props, scrollArea.Api<PropTypes>> {
|
|
7
|
-
name: string;
|
|
7
|
+
static name: string;
|
|
8
8
|
initMachine(props: scrollArea.Props): Machine<any>;
|
|
9
9
|
initApi(): scrollArea.Api<PropTypes<{
|
|
10
10
|
[x: string]: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{initAllComponentInstances as e}from"./Client-
|
|
1
|
+
import{initAllComponentInstances as e}from"./Client-oBmSvCIl.js";import{ScrollArea as t}from"./ScrollArea-BseEK6t2.js";e(`scroll-area`,({props:e})=>{let n=new t(e);return n.init(),n});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./Client-
|
|
1
|
+
import"./Client-oBmSvCIl.js";import{ScrollArea as e}from"./ScrollArea-BseEK6t2.js";export{e as ScrollArea};
|
|
@@ -1,12 +1,59 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as
|
|
1
|
+
import { FieldAwareComponent$1 as FieldAwareComponent, FieldMachine, Machine$1 as Machine } from "./index-w1HRp_7W.js";
|
|
2
|
+
import * as _zag_js_collection0 from "@zag-js/collection";
|
|
3
|
+
import * as _zag_js_types3 from "@zag-js/types";
|
|
3
4
|
import * as select from "@zag-js/select";
|
|
4
5
|
|
|
5
6
|
//#region Resources/Private/Primitives/Select/Select.d.ts
|
|
6
|
-
declare class Select extends
|
|
7
|
-
name: string;
|
|
7
|
+
declare class Select extends FieldAwareComponent<select.Props, select.Api> {
|
|
8
|
+
static name: string;
|
|
9
|
+
propsWithField(props: select.Props, fieldMachine: FieldMachine): select.Props;
|
|
10
|
+
transformProps(props: select.Props): {
|
|
11
|
+
collection: _zag_js_collection0.ListCollection<any>;
|
|
12
|
+
ids?: Partial<{
|
|
13
|
+
root: string;
|
|
14
|
+
content: string;
|
|
15
|
+
control: string;
|
|
16
|
+
trigger: string;
|
|
17
|
+
clearTrigger: string;
|
|
18
|
+
label: string;
|
|
19
|
+
hiddenSelect: string;
|
|
20
|
+
positioner: string;
|
|
21
|
+
item: (id: string | number) => string;
|
|
22
|
+
itemGroup: (id: string | number) => string;
|
|
23
|
+
itemGroupLabel: (id: string | number) => string;
|
|
24
|
+
}> | undefined;
|
|
25
|
+
name?: string | undefined;
|
|
26
|
+
form?: string | undefined;
|
|
27
|
+
disabled?: boolean | undefined;
|
|
28
|
+
invalid?: boolean | undefined;
|
|
29
|
+
readOnly?: boolean | undefined;
|
|
30
|
+
required?: boolean | undefined;
|
|
31
|
+
closeOnSelect?: boolean | undefined;
|
|
32
|
+
onSelect?: ((details: select.SelectionDetails) => void) | undefined;
|
|
33
|
+
onHighlightChange?: ((details: select.HighlightChangeDetails<any>) => void) | undefined;
|
|
34
|
+
onValueChange?: ((details: select.ValueChangeDetails<any>) => void) | undefined;
|
|
35
|
+
onOpenChange?: ((details: select.OpenChangeDetails) => void) | undefined;
|
|
36
|
+
positioning?: select.PositioningOptions | undefined;
|
|
37
|
+
value?: string[] | undefined;
|
|
38
|
+
defaultValue?: string[] | undefined;
|
|
39
|
+
highlightedValue?: string | null | undefined;
|
|
40
|
+
defaultHighlightedValue?: string | null | undefined;
|
|
41
|
+
loopFocus?: boolean | undefined;
|
|
42
|
+
multiple?: boolean | undefined;
|
|
43
|
+
open?: boolean | undefined;
|
|
44
|
+
defaultOpen?: boolean | undefined;
|
|
45
|
+
scrollToIndexFn?: ((details: select.ScrollToIndexDetails) => void) | undefined;
|
|
46
|
+
composite?: boolean | undefined;
|
|
47
|
+
deselectable?: boolean | undefined;
|
|
48
|
+
dir?: "ltr" | "rtl" | undefined;
|
|
49
|
+
id: string;
|
|
50
|
+
getRootNode?: (() => ShadowRoot | Document | Node) | undefined;
|
|
51
|
+
onPointerDownOutside?: ((event: select.PointerDownOutsideEvent) => void) | undefined;
|
|
52
|
+
onFocusOutside?: ((event: select.FocusOutsideEvent) => void) | undefined;
|
|
53
|
+
onInteractOutside?: ((event: select.InteractOutsideEvent) => void) | undefined;
|
|
54
|
+
};
|
|
8
55
|
initMachine(props: select.Props): Machine<any>;
|
|
9
|
-
initApi(): select.Api<
|
|
56
|
+
initApi(): select.Api<_zag_js_types3.PropTypes<{
|
|
10
57
|
[x: string]: any;
|
|
11
58
|
}>, any>;
|
|
12
59
|
render: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{initAllComponentInstances as e}from"./Client-
|
|
1
|
+
import{initAllComponentInstances as e}from"./Client-oBmSvCIl.js";import"./field.dom-BPeGctuk.js";import{Select as t}from"./Select-Ksl75VK-.js";e(`select`,({props:e})=>{let n=new t(e);return n.init(),n});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./Client-
|
|
1
|
+
import"./Client-oBmSvCIl.js";import"./field.dom-BPeGctuk.js";import{Select as e}from"./Select-Ksl75VK-.js";export{e as Select};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { Component$1 as Component, Machine$1 as Machine } from "./index-
|
|
2
|
-
import * as
|
|
1
|
+
import { Component$1 as Component, Machine$1 as Machine } from "./index-w1HRp_7W.js";
|
|
2
|
+
import * as _zag_js_types4 from "@zag-js/types";
|
|
3
3
|
import * as tabs from "@zag-js/tabs";
|
|
4
4
|
|
|
5
5
|
//#region Resources/Private/Primitives/Tabs/Tabs.d.ts
|
|
6
6
|
declare class Tabs extends Component<tabs.Props, tabs.Api> {
|
|
7
|
-
name: string;
|
|
7
|
+
static name: string;
|
|
8
8
|
initMachine(props: tabs.Props): Machine<any>;
|
|
9
|
-
initApi(): tabs.Api<
|
|
9
|
+
initApi(): tabs.Api<_zag_js_types4.PropTypes<{
|
|
10
10
|
[x: string]: any;
|
|
11
11
|
}>>;
|
|
12
12
|
render: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{initAllComponentInstances as e}from"./Client-
|
|
1
|
+
import{initAllComponentInstances as e}from"./Client-oBmSvCIl.js";import{Tabs as t}from"./Tabs-ChCSBaRL.js";e(`tabs`,({props:e})=>{let n=new t(e);return n.init(),n});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./Client-
|
|
1
|
+
import"./Client-oBmSvCIl.js";import{Tabs as e}from"./Tabs-ChCSBaRL.js";export{e as Tabs};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { Component$1 as Component, Machine$1 as Machine } from "./index-
|
|
2
|
-
import * as
|
|
1
|
+
import { Component$1 as Component, Machine$1 as Machine } from "./index-w1HRp_7W.js";
|
|
2
|
+
import * as _zag_js_types5 from "@zag-js/types";
|
|
3
3
|
import * as tooltip from "@zag-js/tooltip";
|
|
4
4
|
|
|
5
5
|
//#region Resources/Private/Primitives/Tooltip/Tooltip.d.ts
|
|
6
6
|
declare class Tooltip extends Component<tooltip.Props, tooltip.Api> {
|
|
7
|
-
name: string;
|
|
7
|
+
static name: string;
|
|
8
8
|
initMachine(props: tooltip.Props): Machine<any>;
|
|
9
|
-
initApi(): tooltip.Api<
|
|
9
|
+
initApi(): tooltip.Api<_zag_js_types5.PropTypes<{
|
|
10
10
|
[x: string]: any;
|
|
11
11
|
}>>;
|
|
12
12
|
render(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{initAllComponentInstances as e}from"./Client-
|
|
1
|
+
import{initAllComponentInstances as e}from"./Client-oBmSvCIl.js";import{Tooltip as t}from"./Tooltip-Cv1zWULX.js";e(`tooltip`,({props:e})=>{let n=new t(e);return n.init(),n});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./Client-
|
|
1
|
+
import"./Client-oBmSvCIl.js";import{Tooltip as e}from"./Tooltip-Cv1zWULX.js";export{e as Tooltip};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fluid-primitives",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Client-side library for Fluid Primitives.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -39,6 +39,18 @@
|
|
|
39
39
|
"import": "./Resources/Public/JavaScript/dist/collapsible.js",
|
|
40
40
|
"types": "./Resources/Public/JavaScript/dist/collapsible.d.ts"
|
|
41
41
|
},
|
|
42
|
+
"./field": {
|
|
43
|
+
"import": "./Resources/Public/JavaScript/dist/field.js",
|
|
44
|
+
"types": "./Resources/Public/JavaScript/dist/field.d.ts"
|
|
45
|
+
},
|
|
46
|
+
"./form": {
|
|
47
|
+
"import": "./Resources/Public/JavaScript/dist/form.js",
|
|
48
|
+
"types": "./Resources/Public/JavaScript/dist/form.d.ts"
|
|
49
|
+
},
|
|
50
|
+
"./popover": {
|
|
51
|
+
"import": "./Resources/Public/JavaScript/dist/popover.js",
|
|
52
|
+
"types": "./Resources/Public/JavaScript/dist/popover.d.ts"
|
|
53
|
+
},
|
|
42
54
|
"./scroll-area": {
|
|
43
55
|
"import": "./Resources/Public/JavaScript/dist/scroll-area.js",
|
|
44
56
|
"types": "./Resources/Public/JavaScript/dist/scroll-area.d.ts"
|
|
@@ -65,10 +77,12 @@
|
|
|
65
77
|
"devDependencies": {
|
|
66
78
|
"@types/node": "^22.15.17",
|
|
67
79
|
"tsdown": "^0.11.9",
|
|
68
|
-
"typescript": "^5.8.3"
|
|
80
|
+
"typescript": "^5.8.3",
|
|
81
|
+
"valibot": "^1.1.0"
|
|
69
82
|
},
|
|
70
83
|
"dependencies": {
|
|
71
84
|
"@zag-js/accordion": "^1.27.0",
|
|
85
|
+
"@zag-js/anatomy": "^1.27.1",
|
|
72
86
|
"@zag-js/checkbox": "^1.27.0",
|
|
73
87
|
"@zag-js/clipboard": "^1.27.0",
|
|
74
88
|
"@zag-js/collapsible": "^1.27.0",
|
|
@@ -76,13 +90,13 @@
|
|
|
76
90
|
"@zag-js/core": "^1.27.0",
|
|
77
91
|
"@zag-js/dialog": "^1.27.0",
|
|
78
92
|
"@zag-js/dom-query": "^1.27.0",
|
|
93
|
+
"@zag-js/popover": "^1.29.1",
|
|
79
94
|
"@zag-js/scroll-area": "^1.27.0",
|
|
80
95
|
"@zag-js/select": "^1.27.0",
|
|
81
96
|
"@zag-js/store": "^1.27.0",
|
|
82
97
|
"@zag-js/tabs": "^1.27.0",
|
|
83
98
|
"@zag-js/tooltip": "^1.27.0",
|
|
84
99
|
"@zag-js/types": "^1.27.0",
|
|
85
|
-
"@zag-js/utils": "^1.27.0"
|
|
86
|
-
"nanoid": "^5.1.5"
|
|
100
|
+
"@zag-js/utils": "^1.27.0"
|
|
87
101
|
}
|
|
88
102
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Component as e,Machine as t,normalizeProps as n}from"./Client-6Iwe-j89.js";import*as r from"@zag-js/accordion";var i=class extends e{name=`accordion`;initMachine(e){return new t(r.machine,{collapsible:!0,...e})}initApi(){return r.connect(this.machine.service,n)}render(){let e=this.getElement(`root`);e&&this.spreadProps(e,this.api.getRootProps());let t=this.getElements(`item`);t.forEach(e=>{this.spreadProps(e,this.api.getItemProps({value:e.getAttribute(`data-value`),disabled:e.getAttribute(`data-disabled`)===`true`}))});let n=this.getElements(`item-trigger`);n.forEach(e=>{this.spreadProps(e,this.api.getItemTriggerProps({value:e.getAttribute(`data-value`),disabled:e.getAttribute(`data-disabled`)===`true`}))});let r=this.getElements(`item-content`);r.forEach(e=>{this.spreadProps(e,this.api.getItemContentProps({value:e.getAttribute(`data-value`),disabled:e.getAttribute(`data-disabled`)===`true`}))});let i=this.getElements(`item-indicator`);i.forEach(e=>{this.spreadProps(e,this.api.getItemIndicatorProps({value:e.getAttribute(`data-value`),disabled:e.getAttribute(`data-disabled`)===`true`}))}),this.getElements(`item-header`)}};export{i as Accordion};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Component as e,Machine as t,normalizeProps as n}from"./Client-6Iwe-j89.js";import*as r from"@zag-js/checkbox";var i=class extends e{name=`checkbox`;initMachine(e){return new t(r.machine,e)}initApi(){return r.connect(this.machine.service,n)}render(){let e=this.getElement(`root`);e&&this.spreadProps(e,this.api.getRootProps());let t=this.getElement(`label`);t&&this.spreadProps(t,this.api.getLabelProps());let n=this.getElement(`control`);n&&this.spreadProps(n,this.api.getControlProps());let r=this.getElement(`indicator`);r&&this.spreadProps(r,this.api.getIndicatorProps());let i=this.getElement(`hidden-input`);i&&this.spreadProps(i,this.api.getHiddenInputProps())}};export{i as Checkbox};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{INIT_STATE as e,MachineStatus as t,createScope as n,mergeProps as r}from"@zag-js/core";import{ListCollection as i}from"@zag-js/collection";import{proxy as a,subscribe as o}from"@zag-js/store";import{compact as s,identity as c,isEqual as l,isFunction as u,isString as d,runIfFn as f,toArray as p,warn as m}from"@zag-js/utils";import{createNormalizer as h}from"@zag-js/types";import{nanoid as g}from"nanoid";var _=class{document;machine;api;hydrator=null;userProps;get doc(){return this.document}constructor(e,t=document){this.document=t,this.userProps=e,this.machine=this.initMachine(e),this.api=this.initApi()}init(){this.hydrator=new b(this.name,this.machine.scope.id,this.machine.scope.ids,this.doc),this.render(),this.machine.subscribe(()=>{this.api=this.initApi(),this.render()}),this.machine.start()}updateProps(e){this.machine.stop(),this.machine=this.initMachine({...this.userProps,...e}),this.api=this.initApi(),this.init()}destroy=()=>{this.machine.stop(),this.hydrator?.destroy()};spreadProps(e,t){P(e,t,this.machine.scope.id)}getElement(e,t){return this.hydrator?.getElement(e,t)||null}getElements(e,t){return this.hydrator?.getElements(e,t)||[]}portalElement(e,t=this.doc.body){e&&e.parentNode!==t&&(t.appendChild(e),e.setAttribute(`data-portalled`,`true`))}};function v(e,t){let n=window.FluidPrimitives.hydrationData;return!n||typeof n!=`object`?null:e?n[e]?t?n[e][t]||null:n[e]:null:n}function y(e,t){let n=v(e);n&&Object.keys(n).forEach(r=>{if(n[r].controlled)return;let i=t(n[r]);i&&(window.FluidPrimitives.uncontrolledInstances[e]||(window.FluidPrimitives.uncontrolledInstances[e]={}),window.FluidPrimitives.uncontrolledInstances[e][r]=i)})}var b=class{componentName;doc;rootId;ids;elementRefs=new Map;constructor(e,t,n={},r=document){if(this.componentName=e,this.doc=r,!t)throw Error(`Root ID is required for component hydration: ${e}`);this.rootId=t,this.ids=n}getElement(e,t=this.doc){if(this.elementRefs.has(e))return this.elementRefs.get(e)||null;let n=null;return n=this.ids[e]?t.querySelector(`#${this.ids[e]}`):t.querySelector(`[data-hydrate-${this.componentName}="${this.rootId}"][data-part="${e}"][data-scope="${this.componentName}"]`),n&&(t===this.doc&&this.elementRefs.set(e,n),n.removeAttribute(`data-hydrate-${this.componentName}`),n.__rootId=this.rootId),n}getElements(e,t=this.doc){if(this.elementRefs.has(e))return this.elementRefs.get(e);let n=[];return n=this.ids[e]?Array.from(t.querySelectorAll(`#${this.ids[e]}`)):Array.from(t.querySelectorAll(`[data-hydrate-${this.componentName}="${this.rootId}"][data-part="${e}"][data-scope="${this.componentName}"]`)),t===this.doc&&this.elementRefs.set(e,n),n.forEach(e=>e.removeAttribute(`data-hydrate-${this.componentName}`)),n}generateRefAttributesString(e){let t=this.ids[e]||`${this.rootId}-${e}`;return`data-scope="${this.componentName}" data-part="${e}" data-hydrate-${this.componentName}="${t}"`}setRefAttributes(e,t){let n=this.generateRefAttributesString(t),r=n.split(` `).map(e=>e.trim());r.forEach(t=>{let[n,r]=t.split(`=`);e.setAttribute(n,r.replace(/"/g,``))})}destroy(){this.elementRefs.clear()}};function x(e){let t=new i({items:e.items,itemToValue:e.itemToValueKey?t=>t?.[e.itemToValueKey]:void 0,itemToString:e.itemToStringKey?t=>t?.[e.itemToStringKey]:void 0,isItemDisabled:e.isItemDisabledKey?t=>t?.[e.isItemDisabledKey]:void 0,groupBy:e.groupByKey?t=>{let n=e.groupByKey;if(n)return n.includes(`.`)?n.split(`.`).reduce((e,t)=>e?e[t]:void 0,t):t?.[n]}:void 0});return t}function S(e){let t=e().value??e().defaultValue;e().debug&&console.log(`[bindable > ${e().debug}] initial`,t);let n=e().isEqual??Object.is,r=a({value:t}),i=()=>e().value!==void 0;return{initial:t,ref:r,get(){return i()?e().value:r.value},set(t){let a=r.value,o=u(t)?t(a):t;e().debug&&console.log(`[bindable > ${e().debug}] setValue`,{next:o,prev:a}),i()||(r.value=o),n(o,a)||e().onChange?.(o,a)},invoke(t,n){e().onChange?.(t,n)},hash(t){return e().hash?.(t)??String(t)}}}S.cleanup=e=>{},S.ref=e=>{let t=e;return{get:()=>t,set:e=>{t=e}}};function C(e){let t={current:e};return{get(e){return t.current[e]},set(e,n){t.current[e]=n}}}var w=class{scope;ctx;prop;state;refs;computed;event={type:``};previousEvent;effects=new Map;transition=null;cleanups=[];subscriptions=[];getEvent=()=>({...this.event,current:()=>this.event,previous:()=>this.previousEvent});getState=()=>({...this.state,matches:(...e)=>e.includes(this.state.get()),hasTag:e=>!!this.machine.states[this.state.get()]?.tags?.includes(e)});debug=(...e)=>{this.machine.debug&&console.log(...e)};notify=()=>{this.publish()};constructor(t,r={}){this.machine=t;let{id:i,ids:a,getRootNode:c}=f(r);this.scope=n({id:i,ids:a,getRootNode:c});let l=e=>{let n=f(r),i=t.props?.({props:s(n),scope:this.scope})??n;return i[e]};this.prop=l;let u=t.context?.({prop:l,bindable:S,scope:this.scope,flush(e){queueMicrotask(e)},getContext(){return d},getComputed(){return p},getRefs(){return m},getEvent:this.getEvent.bind(this)});u&&Object.values(u).forEach(e=>{let t=o(e.ref,()=>this.notify());this.cleanups.push(t)});let d={get(e){return u?.[e].get()},set(e,t){u?.[e].set(t)},initial(e){return u?.[e].initial},hash(e){let t=u?.[e].get();return u?.[e].hash(t)}};this.ctx=d;let p=e=>t.computed?.[e]({context:d,event:this.getEvent(),prop:l,refs:this.refs,scope:this.scope,computed:p})??{};this.computed=p;let m=C(t.refs?.({prop:l,context:d})??{});this.refs=m;let h=S(()=>({defaultValue:t.initialState({prop:l}),onChange:(n,r)=>{if(r){let e=this.effects.get(r);e?.(),this.effects.delete(r)}r&&this.action(t.states[r]?.exit),this.action(this.transition?.actions);let i=this.effect(t.states[n]?.effects);if(i&&this.effects.set(n,i),r===e){this.action(t.entry);let n=this.effect(t.effects);n&&this.effects.set(e,n)}this.action(t.states[n]?.entry)}}));this.state=h,this.cleanups.push(o(this.state.ref,()=>this.notify()))}send=e=>{this.status===t.Started&&queueMicrotask(()=>{this.previousEvent=this.event,this.event=e,this.debug(`send`,e);let t=this.state.get(),n=this.machine.states[t].on?.[e.type]??this.machine.on?.[e.type],r=this.choose(n);if(!r)return;this.transition=r;let i=r.target??t;this.debug(`transition`,r);let a=i!==t;a?this.state.set(i):this.action(r.actions)})};action=e=>{let t=u(e)?e(this.getParams()):e;if(!t)return;let n=t.map(e=>{let t=this.machine.implementations?.actions?.[e];return t||m(`[zag-js] No implementation found for action "${JSON.stringify(e)}"`),t});for(let e of n)e?.(this.getParams())};guard=e=>u(e)?e(this.getParams()):this.machine.implementations?.guards?.[e](this.getParams());effect=e=>{let t=u(e)?e(this.getParams()):e;if(!t)return;let n=t.map(e=>{let t=this.machine.implementations?.effects?.[e];return t||m(`[zag-js] No implementation found for effect "${JSON.stringify(e)}"`),t}),r=[];for(let e of n){let t=e?.(this.getParams());t&&r.push(t)}return()=>r.forEach(e=>e?.())};choose=e=>p(e).find(e=>{let t=!e.guard;return d(e.guard)?t=!!this.guard(e.guard):u(e.guard)&&(t=e.guard(this.getParams())),t});start(){this.status=t.Started,this.debug(`initializing...`),this.state.invoke(this.state.initial,e),this.setupTrackers()}stop(){this.effects.forEach(e=>e?.()),this.effects.clear(),this.transition=null,this.action(this.machine.exit),this.cleanups.forEach(e=>e()),this.cleanups=[],this.status=t.Stopped,this.debug(`unmounting...`)}subscribe=e=>{this.subscriptions.push(e)};status=t.NotStarted;get service(){return{state:this.getState(),send:this.send,context:this.ctx,prop:this.prop,scope:this.scope,refs:this.refs,computed:this.computed,event:this.getEvent(),getStatus:()=>this.status}}publish=()=>{this.callTrackers(),this.subscriptions.forEach(e=>e(this.service))};trackers=[];setupTrackers=()=>{this.machine.watch?.(this.getParams())};callTrackers=()=>{this.trackers.forEach(({deps:e,fn:t})=>{let n=e.map(e=>e());l(t.prev,n)||(t(),t.prev=n)})};getParams=()=>({state:this.getState(),context:this.ctx,event:this.getEvent(),prop:this.prop,send:this.send,action:this.action,guard:this.guard,track:(e,t)=>{t.prev=e.map(e=>e()),this.trackers.push({deps:e,fn:t})},refs:this.refs,computed:this.computed,flush:c,scope:this.scope,choose:this.choose})};const T={onFocus:`onFocusin`,onBlur:`onFocusout`,onChange:`onInput`,onDoubleClick:`onDblclick`,htmlFor:`for`,className:`class`,defaultValue:`value`,defaultChecked:`checked`},E=new Set([`viewBox`,`preserveAspectRatio`]),D=e=>{let t=``;for(let n in e){let r=e[n];if(r==null)continue;n.startsWith(`--`)||(n=n.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)),t+=`${n}:${r};`}return t},O=h(e=>Object.entries(e).reduce((e,[t,n])=>{if(n===void 0)return e;if(t in T&&(t=T[t]),t===`style`&&typeof n==`object`)return e.style=D(n),e;let r=E.has(t)?t:t.toLowerCase();return e[r]=n,e},{})),k=new Map,A=new Set([`value`,`checked`,`htmlFor`]),j=new Set([`viewBox`,`preserveAspectRatio`]),M=e=>e.tagName===`svg`||e.namespaceURI===`http://www.w3.org/2000/svg`,N=(e,t)=>{let n=M(e)&&j.has(t);return n?t:t.toLowerCase()};function P(e,t,n){e.__spreadId||=`spread_${g()}`;let r=``;r=n?`${e.__spreadId}_${n}`:`${e.__spreadId}`;let i=k.get(r)||{},a=Object.keys(t),o=(t,n)=>{e.addEventListener(t.toLowerCase(),n)},s=(t,n)=>{e.removeEventListener(t.toLowerCase(),n)},c=e=>e.startsWith(`on`),l=e=>!e.startsWith(`on`),u=e=>o(e.substring(2),t[e]),d=e=>s(e.substring(2),t[e]),f=n=>{let r=t[n],a=i[n];if(r!==a){if(n===`children`){e.textContent=r;return}if(typeof r==`boolean`&&(n.includes(`aria-`)||(r||=void 0)),r!=null){A.has(n)?e[n]=r:e.setAttribute(N(e,n),r);return}e.removeAttribute(N(e,n))}};for(let n in i)t[n]??e.removeAttribute(N(e,n));let p=Object.keys(i).filter(c);return p.forEach(e=>{s(e.substring(2),i[e])}),a.filter(c).forEach(u),a.filter(l).forEach(f),k.set(r,t),function(){a.filter(c).forEach(d)}}export{_ as Component,b as ComponentHydrator,w as Machine,v as getHydrationData,x as getListCollectionFromHydrationData,y as initAllComponentInstances,r as mergeProps,O as normalizeProps,P as spreadProps};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Component as e,Machine as t,normalizeProps as n}from"./Client-6Iwe-j89.js";import*as r from"@zag-js/clipboard";var i=class extends e{name=`clipboard`;initMachine(e){return new t(r.machine,e)}initApi(){return r.connect(this.machine.service,n)}render(){let e=this.getElement(`root`);e&&this.spreadProps(e,this.api.getRootProps());let t=this.getElement(`label`);t&&this.spreadProps(t,this.api.getLabelProps());let n=this.getElement(`control`);n&&this.spreadProps(n,this.api.getControlProps());let r=this.getElement(`input`);r&&this.spreadProps(r,this.api.getInputProps());let i=this.getElement(`indicator-copied`);i&&this.spreadProps(i,this.api.getIndicatorProps({copied:!0}));let a=this.getElement(`indicator-idle`);a&&this.spreadProps(a,this.api.getIndicatorProps({copied:!1}));let o=this.getElement(`trigger`);o&&this.spreadProps(o,this.api.getTriggerProps())}};export{i as Clipboard};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Component as e,Machine as t,normalizeProps as n}from"./Client-6Iwe-j89.js";import*as r from"@zag-js/collapsible";var i=class extends e{name=`collapsible`;initMachine(e){return new t(r.machine,e)}initApi(){return r.connect(this.machine.service,n)}render(){let e=this.getElement(`root`);e&&this.spreadProps(e,this.api.getRootProps());let t=this.getElement(`trigger`);t&&this.spreadProps(t,this.api.getTriggerProps());let n=this.getElement(`trigger-text`);n&&n.dataset.openText&&n.dataset.closeText&&(n.textContent=this.api.open?n.dataset.closeText:n.dataset.openText);let r=this.getElement(`content`);r&&this.spreadProps(r,this.api.getContentProps())}};export{i as Collapsible};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Component as e,Machine as t,normalizeProps as n}from"./Client-6Iwe-j89.js";import*as r from"@zag-js/dialog";var i=class extends e{name=`dialog`;initMachine(e){return new t(r.machine,e)}initApi(){return r.connect(this.machine.service,n)}render(){let e=this.getElements(`trigger`);e.forEach(e=>{this.spreadProps(e,this.api.getTriggerProps())});let t=this.getElement(`backdrop`);t&&this.spreadProps(t,this.api.getBackdropProps());let n=this.getElement(`positioner`);n&&this.spreadProps(n,this.api.getPositionerProps());let r=this.getElement(`content`);r&&this.spreadProps(r,this.api.getContentProps());let i=this.getElement(`title`);i&&this.spreadProps(i,this.api.getTitleProps());let a=this.getElement(`description`);a&&this.spreadProps(a,this.api.getDescriptionProps());let o=this.getElements(`close-trigger`);o.forEach(e=>{this.spreadProps(e,this.api.getCloseTriggerProps())})}};export{i as Dialog};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Component as e,Machine as t,normalizeProps as n}from"./Client-6Iwe-j89.js";import*as r from"@zag-js/scroll-area";var i=class extends e{name=`scroll-area`;initMachine(e){return new t(r.machine,e)}initApi(){return r.connect(this.machine.service,n)}render(){let e=this.getElement(`root`);e&&this.spreadProps(e,this.api.getRootProps());let t=this.getElement(`viewport`);t&&this.spreadProps(t,this.api.getViewportProps());let n=this.getElement(`content`);n&&this.spreadProps(n,this.api.getContentProps());let r=this.getElements(`scrollbar`);r.forEach(e=>{this.spreadProps(e,this.api.getScrollbarProps({orientation:e.getAttribute(`data-orientation`)}))});let i=this.getElement(`corner`);i&&this.spreadProps(i,this.api.getCornerProps());let a=this.getElements(`thumb`);a.forEach(e=>{this.spreadProps(e,this.api.getThumbProps({orientation:e.getAttribute(`data-orientation`)}))})}};export{i as ScrollArea};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Component as e,Machine as t,getListCollectionFromHydrationData as n,mergeProps as r,normalizeProps as i}from"./Client-6Iwe-j89.js";import*as a from"@zag-js/select";var o=class extends e{name=`select`;initMachine(e){return new t(a.machine,{...e,get collection(){return n(e.collection)}})}initApi(){return a.connect(this.machine.service,i)}render=()=>{let e=this.getElement(`root`);e&&this.spreadProps(e,this.api.getRootProps());let t=this.getElement(`control`);t&&this.spreadProps(t,this.api.getControlProps());let n=this.getElement(`hidden-select`);n&&this.spreadProps(n,this.api.getHiddenSelectProps());let i=this.getElement(`label`);i&&this.spreadProps(i,this.api.getLabelProps());let a=this.getElement(`trigger`);a&&this.spreadProps(a,this.api.getTriggerProps());let o=this.getElement(`positioner`);o&&this.spreadProps(o,this.api.getPositionerProps());let s=this.getElement(`content`);s&&this.spreadProps(s,this.api.getContentProps());let c=this.getElement(`value-text`);c&&this.spreadProps(c,r(this.api.getValueTextProps(),{children:this.api.valueAsString||c.dataset.placeholder}));let l=this.getElements(`item-group`);l.forEach(e=>{this.spreadProps(e,this.api.getItemGroupProps({id:e.dataset.id}));let t=this.getElement(`item-group-label`,e);t&&this.spreadProps(t,this.api.getItemGroupLabelProps({htmlFor:e.dataset.id}))});let u=this.getElements(`item`);u.forEach(e=>{let t=this.api.collection.find(e.dataset.value);t&&this.spreadProps(e,this.api.getItemProps({item:t}))});let d=this.getElements(`item-text`);d.forEach(e=>{let t=this.api.collection.find(e.dataset.value);t&&this.spreadProps(e,this.api.getItemTextProps({item:t}))});let f=this.getElements(`item-indicator`);f.forEach(e=>{let t=this.api.collection.find(e.dataset.value);t&&this.spreadProps(e,this.api.getItemIndicatorProps({item:t}))});let p=this.getElement(`clear-trigger`);p&&this.spreadProps(p,this.api.getClearTriggerProps());let m=this.getElement(`indicator`);m&&this.spreadProps(m,this.api.getIndicatorProps())}};export{o as Select};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Component as e,Machine as t,normalizeProps as n}from"./Client-6Iwe-j89.js";import*as r from"@zag-js/tabs";var i=class extends e{name=`tabs`;initMachine(e){return new t(r.machine,e)}initApi(){return r.connect(this.machine.service,n)}render=()=>{let e=this.getElement(`root`);e&&this.spreadProps(e,this.api.getRootProps());let t=this.getElement(`list`);t&&this.spreadProps(t,this.api.getListProps());let n=this.getElements(`trigger`);n.forEach(e=>{this.spreadProps(e,this.api.getTriggerProps({value:e.dataset.value,disabled:e.getAttribute(`data-disabled`)===`true`}))});let r=this.getElements(`content`);r.forEach(e=>{this.spreadProps(e,this.api.getContentProps({value:e.dataset.value}))});let i=this.getElement(`indicator`);i&&this.spreadProps(i,this.api.getIndicatorProps())}};export{i as Tabs};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Component as e,Machine as t,normalizeProps as n}from"./Client-6Iwe-j89.js";import*as r from"@zag-js/tooltip";var i=class extends e{name=`tooltip`;initMachine(e){return new t(r.machine,{interactive:!0,...e,positioning:{placement:`top`,gutter:6,...e.positioning}})}initApi(){return r.connect(this.machine.service,n)}render(){let e=this.getElement(`trigger`);e&&this.spreadProps(e,this.api.getTriggerProps());let t=this.getElement(`positioner`);t&&this.spreadProps(t,this.api.getPositionerProps());let n=this.getElement(`arrow`);n&&this.spreadProps(n,this.api.getArrowProps());let r=this.getElement(`arrow-tip`);r&&this.spreadProps(r,this.api.getArrowTipProps());let i=this.getElement(`content`);i&&this.spreadProps(i,this.api.getContentProps())}};export{i as Tooltip};
|