@adamosuiteservices/ui 2.13.3 → 2.13.4

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.
@@ -4,7 +4,7 @@ import * as React from "react";
4
4
  type SliderColorProp = "full" | [string, string];
5
5
  type SliderProps = React.ComponentProps<typeof SliderPrimitive.Root> & {
6
6
  theme?: Theme;
7
- color?: SliderColorProp;
7
+ colorSlide?: SliderColorProp;
8
8
  };
9
- declare function Slider({ className, defaultValue, value, min, max, theme, color, ...props }: SliderProps): import("react/jsx-runtime").JSX.Element;
9
+ declare function Slider({ className, defaultValue, value, min, max, theme, colorSlide: color, ...props }: SliderProps): import("react/jsx-runtime").JSX.Element;
10
10
  export { Slider };
package/dist/slider.cjs CHANGED
@@ -1,7 +1,7 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./jsx-runtime-BB_1_6y_.cjs"),ce=require("react"),F=require("./index-C8ni3LLa.cjs"),P=require("./index-BWaO7kQK.cjs"),_=require("./index-_XxjJPRD.cjs"),ue=require("./index-cwZN7ZY3.cjs"),Y=require("./index-Da298sEl.cjs"),me=require("./index-DYxWvftI.cjs"),fe=require("./index-bSPhqlcX.cjs"),I=require("./index-CocSS1YK.cjs"),N=require("./index-DoxiiusW.cjs");function pe(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const l=pe(ce);var X=["PageUp","PageDown"],G=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],W={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},C="Slider",[V,xe,he]=Y.createCollection(C),[J]=ue.createContextScope(C,[he]),[Se,T]=J(C),Q=l.forwardRef((e,t)=>{const{name:n,min:o=0,max:i=100,step:d=1,orientation:r="horizontal",disabled:a=!1,minStepsBetweenThumbs:c=0,defaultValue:S=[o],value:p,onValueChange:s=()=>{},onValueCommit:m=()=>{},inverted:v=!1,form:w,...g}=e,x=l.useRef(new Set),f=l.useRef(0),b=r==="horizontal"?ge:ve,[h=[],M]=P.useControllableState({prop:p,defaultProp:S,onChange:R=>{[...x.current][f.current]?.focus(),s(R)}}),k=l.useRef(h);function B(R){const E=ye(h,R);A(R,E)}function de(R){A(R,f.current)}function le(){const R=k.current[f.current];h[f.current]!==R&&m(h)}function A(R,E,{commit:z}={commit:!1}){const L=_e(d),H=Ce(Math.round((R-o)/d)*d+o,L),K=F.clamp(H,[o,i]);M((D=[])=>{const y=we(D,K,E);if(De(y,c*d)){f.current=y.indexOf(K);const U=String(y)!==String(D);return U&&z&&m(y),U?y:D}else return D})}return u.jsxRuntimeExports.jsx(Se,{scope:e.__scopeSlider,name:n,disabled:a,min:o,max:i,valueIndexToChangeRef:f,thumbs:x.current,values:h,orientation:r,form:w,children:u.jsxRuntimeExports.jsx(V.Provider,{scope:e.__scopeSlider,children:u.jsxRuntimeExports.jsx(V.Slot,{scope:e.__scopeSlider,children:u.jsxRuntimeExports.jsx(b,{"aria-disabled":a,"data-disabled":a?"":void 0,...g,ref:t,onPointerDown:P.composeEventHandlers(g.onPointerDown,()=>{a||(k.current=h)}),min:o,max:i,inverted:v,onSlideStart:a?void 0:B,onSlideMove:a?void 0:de,onSlideEnd:a?void 0:le,onHomeKeyDown:()=>!a&&A(o,0,{commit:!0}),onEndKeyDown:()=>!a&&A(i,h.length-1,{commit:!0}),onStepKeyDown:({event:R,direction:E})=>{if(!a){const H=X.includes(R.key)||R.shiftKey&&G.includes(R.key)?10:1,K=f.current,D=h[K],y=d*H*E;A(D+y,K,{commit:!0})}}})})})})});Q.displayName=C;var[Z,ee]=J(C,{startEdge:"left",endEdge:"right",size:"width",direction:1}),ge=l.forwardRef((e,t)=>{const{min:n,max:o,dir:i,inverted:d,onSlideStart:r,onSlideMove:a,onSlideEnd:c,onStepKeyDown:S,...p}=e,[s,m]=l.useState(null),v=_.useComposedRefs(t,b=>m(b)),w=l.useRef(void 0),g=Y.useDirection(i),x=g==="ltr",f=x&&!d||!x&&d;function j(b){const h=w.current||s.getBoundingClientRect(),M=[0,h.width],B=q(M,f?[n,o]:[o,n]);return w.current=h,B(b-h.left)}return u.jsxRuntimeExports.jsx(Z,{scope:e.__scopeSlider,startEdge:f?"left":"right",endEdge:f?"right":"left",direction:f?1:-1,size:"width",children:u.jsxRuntimeExports.jsx(te,{dir:g,"data-orientation":"horizontal",...p,ref:v,style:{...p.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:b=>{const h=j(b.clientX);r?.(h)},onSlideMove:b=>{const h=j(b.clientX);a?.(h)},onSlideEnd:()=>{w.current=void 0,c?.()},onStepKeyDown:b=>{const M=W[f?"from-left":"from-right"].includes(b.key);S?.({event:b,direction:M?-1:1})}})})}),ve=l.forwardRef((e,t)=>{const{min:n,max:o,inverted:i,onSlideStart:d,onSlideMove:r,onSlideEnd:a,onStepKeyDown:c,...S}=e,p=l.useRef(null),s=_.useComposedRefs(t,p),m=l.useRef(void 0),v=!i;function w(g){const x=m.current||p.current.getBoundingClientRect(),f=[0,x.height],b=q(f,v?[o,n]:[n,o]);return m.current=x,b(g-x.top)}return u.jsxRuntimeExports.jsx(Z,{scope:e.__scopeSlider,startEdge:v?"bottom":"top",endEdge:v?"top":"bottom",size:"height",direction:v?1:-1,children:u.jsxRuntimeExports.jsx(te,{"data-orientation":"vertical",...S,ref:s,style:{...S.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:g=>{const x=w(g.clientY);d?.(x)},onSlideMove:g=>{const x=w(g.clientY);r?.(x)},onSlideEnd:()=>{m.current=void 0,a?.()},onStepKeyDown:g=>{const f=W[v?"from-bottom":"from-top"].includes(g.key);c?.({event:g,direction:f?-1:1})}})})}),te=l.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:o,onSlideMove:i,onSlideEnd:d,onHomeKeyDown:r,onEndKeyDown:a,onStepKeyDown:c,...S}=e,p=T(C,n);return u.jsxRuntimeExports.jsx(I.Primitive.span,{...S,ref:t,onKeyDown:P.composeEventHandlers(e.onKeyDown,s=>{s.key==="Home"?(r(s),s.preventDefault()):s.key==="End"?(a(s),s.preventDefault()):X.concat(G).includes(s.key)&&(c(s),s.preventDefault())}),onPointerDown:P.composeEventHandlers(e.onPointerDown,s=>{const m=s.target;m.setPointerCapture(s.pointerId),s.preventDefault(),p.thumbs.has(m)?m.focus():o(s)}),onPointerMove:P.composeEventHandlers(e.onPointerMove,s=>{s.target.hasPointerCapture(s.pointerId)&&i(s)}),onPointerUp:P.composeEventHandlers(e.onPointerUp,s=>{const m=s.target;m.hasPointerCapture(s.pointerId)&&(m.releasePointerCapture(s.pointerId),d(s))})})}),ne="SliderTrack",oe=l.forwardRef((e,t)=>{const{__scopeSlider:n,...o}=e,i=T(ne,n);return u.jsxRuntimeExports.jsx(I.Primitive.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...o,ref:t})});oe.displayName=ne;var O="SliderRange",re=l.forwardRef((e,t)=>{const{__scopeSlider:n,...o}=e,i=T(O,n),d=ee(O,n),r=l.useRef(null),a=_.useComposedRefs(t,r),c=i.values.length,S=i.values.map(m=>ae(m,i.min,i.max)),p=c>1?Math.min(...S):0,s=100-Math.max(...S);return u.jsxRuntimeExports.jsx(I.Primitive.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...o,ref:a,style:{...e.style,[d.startEdge]:p+"%",[d.endEdge]:s+"%"}})});re.displayName=O;var $="SliderThumb",ie=l.forwardRef((e,t)=>{const n=xe(e.__scopeSlider),[o,i]=l.useState(null),d=_.useComposedRefs(t,a=>i(a)),r=l.useMemo(()=>o?n().findIndex(a=>a.ref.current===o):-1,[n,o]);return u.jsxRuntimeExports.jsx(be,{...e,ref:d,index:r})}),be=l.forwardRef((e,t)=>{const{__scopeSlider:n,index:o,name:i,...d}=e,r=T($,n),a=ee($,n),[c,S]=l.useState(null),p=_.useComposedRefs(t,j=>S(j)),s=c?r.form||!!c.closest("form"):!0,m=fe.useSize(c),v=r.values[o],w=v===void 0?0:ae(v,r.min,r.max),g=Ee(o,r.values.length),x=m?.[a.size],f=x?Pe(x,w,a.direction):0;return l.useEffect(()=>{if(c)return r.thumbs.add(c),()=>{r.thumbs.delete(c)}},[c,r.thumbs]),u.jsxRuntimeExports.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[a.startEdge]:`calc(${w}% + ${f}px)`},children:[u.jsxRuntimeExports.jsx(V.ItemSlot,{scope:e.__scopeSlider,children:u.jsxRuntimeExports.jsx(I.Primitive.span,{role:"slider","aria-label":e["aria-label"]||g,"aria-valuemin":r.min,"aria-valuenow":v,"aria-valuemax":r.max,"aria-orientation":r.orientation,"data-orientation":r.orientation,"data-disabled":r.disabled?"":void 0,tabIndex:r.disabled?void 0:0,...d,ref:p,style:v===void 0?{display:"none"}:e.style,onFocus:P.composeEventHandlers(e.onFocus,()=>{r.valueIndexToChangeRef.current=o})})}),s&&u.jsxRuntimeExports.jsx(se,{name:i??(r.name?r.name+(r.values.length>1?"[]":""):void 0),form:r.form,value:v},o)]})});ie.displayName=$;var Re="RadioBubbleInput",se=l.forwardRef(({__scopeSlider:e,value:t,...n},o)=>{const i=l.useRef(null),d=_.useComposedRefs(i,o),r=me.usePrevious(t);return l.useEffect(()=>{const a=i.current;if(!a)return;const c=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(c,"value").set;if(r!==t&&p){const s=new Event("input",{bubbles:!0});p.call(a,t),a.dispatchEvent(s)}},[r,t]),u.jsxRuntimeExports.jsx(I.Primitive.input,{style:{display:"none"},...n,ref:d,defaultValue:t})});se.displayName=Re;function we(e=[],t,n){const o=[...e];return o[n]=t,o.sort((i,d)=>i-d)}function ae(e,t,n){const d=100/(n-t)*(e-t);return F.clamp(d,[0,100])}function Ee(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function ye(e,t){if(e.length===1)return 0;const n=e.map(i=>Math.abs(i-t)),o=Math.min(...n);return n.indexOf(o)}function Pe(e,t,n){const o=e/2,d=q([0,50],[0,o]);return(o-d(t)*n)*n}function je(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function De(e,t){if(t>0){const n=je(e);return Math.min(...n)>=t}return!0}function q(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const o=(t[1]-t[0])/(e[1]-e[0]);return t[0]+o*(n-e[0])}}function _e(e){return(String(e).split(".")[1]||"").length}function Ce(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var Me=Q,Ae=oe,Ke=re,Ie=ie;function Te({className:e,defaultValue:t,value:n,min:o=0,max:i=100,theme:d,color:r,...a}){const c=l.useMemo(()=>Array.isArray(n)?n:Array.isArray(t)?t:[o,i],[n,t,o,i]),S=l.useMemo(()=>{if(r){if(r==="full")return{background:"linear-gradient(to right, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff0000)"};if(Array.isArray(r)&&r.length===2)return{background:`linear-gradient(to right, ${r[0]}, ${r[1]})`}}},[r]);return u.jsxRuntimeExports.jsxs(Me,{"data-slot":"slider","data-theme":d,defaultValue:t,value:n,min:o,max:i,className:N.cn(`
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./jsx-runtime-BB_1_6y_.cjs"),ce=require("react"),F=require("./index-C8ni3LLa.cjs"),P=require("./index-BWaO7kQK.cjs"),_=require("./index-_XxjJPRD.cjs"),ue=require("./index-cwZN7ZY3.cjs"),Y=require("./index-Da298sEl.cjs"),me=require("./index-DYxWvftI.cjs"),fe=require("./index-bSPhqlcX.cjs"),I=require("./index-CocSS1YK.cjs"),N=require("./index-DoxiiusW.cjs");function pe(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const l=pe(ce);var X=["PageUp","PageDown"],G=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],W={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},C="Slider",[V,xe,Se]=Y.createCollection(C),[J]=ue.createContextScope(C,[Se]),[he,T]=J(C),Q=l.forwardRef((e,t)=>{const{name:n,min:o=0,max:i=100,step:d=1,orientation:r="horizontal",disabled:a=!1,minStepsBetweenThumbs:c=0,defaultValue:h=[o],value:p,onValueChange:s=()=>{},onValueCommit:m=()=>{},inverted:v=!1,form:w,...g}=e,x=l.useRef(new Set),f=l.useRef(0),b=r==="horizontal"?ge:ve,[S=[],M]=P.useControllableState({prop:p,defaultProp:h,onChange:R=>{[...x.current][f.current]?.focus(),s(R)}}),k=l.useRef(S);function B(R){const E=ye(S,R);A(R,E)}function de(R){A(R,f.current)}function le(){const R=k.current[f.current];S[f.current]!==R&&m(S)}function A(R,E,{commit:z}={commit:!1}){const L=_e(d),H=Ce(Math.round((R-o)/d)*d+o,L),K=F.clamp(H,[o,i]);M((D=[])=>{const y=we(D,K,E);if(De(y,c*d)){f.current=y.indexOf(K);const U=String(y)!==String(D);return U&&z&&m(y),U?y:D}else return D})}return u.jsxRuntimeExports.jsx(he,{scope:e.__scopeSlider,name:n,disabled:a,min:o,max:i,valueIndexToChangeRef:f,thumbs:x.current,values:S,orientation:r,form:w,children:u.jsxRuntimeExports.jsx(V.Provider,{scope:e.__scopeSlider,children:u.jsxRuntimeExports.jsx(V.Slot,{scope:e.__scopeSlider,children:u.jsxRuntimeExports.jsx(b,{"aria-disabled":a,"data-disabled":a?"":void 0,...g,ref:t,onPointerDown:P.composeEventHandlers(g.onPointerDown,()=>{a||(k.current=S)}),min:o,max:i,inverted:v,onSlideStart:a?void 0:B,onSlideMove:a?void 0:de,onSlideEnd:a?void 0:le,onHomeKeyDown:()=>!a&&A(o,0,{commit:!0}),onEndKeyDown:()=>!a&&A(i,S.length-1,{commit:!0}),onStepKeyDown:({event:R,direction:E})=>{if(!a){const H=X.includes(R.key)||R.shiftKey&&G.includes(R.key)?10:1,K=f.current,D=S[K],y=d*H*E;A(D+y,K,{commit:!0})}}})})})})});Q.displayName=C;var[Z,ee]=J(C,{startEdge:"left",endEdge:"right",size:"width",direction:1}),ge=l.forwardRef((e,t)=>{const{min:n,max:o,dir:i,inverted:d,onSlideStart:r,onSlideMove:a,onSlideEnd:c,onStepKeyDown:h,...p}=e,[s,m]=l.useState(null),v=_.useComposedRefs(t,b=>m(b)),w=l.useRef(void 0),g=Y.useDirection(i),x=g==="ltr",f=x&&!d||!x&&d;function j(b){const S=w.current||s.getBoundingClientRect(),M=[0,S.width],B=q(M,f?[n,o]:[o,n]);return w.current=S,B(b-S.left)}return u.jsxRuntimeExports.jsx(Z,{scope:e.__scopeSlider,startEdge:f?"left":"right",endEdge:f?"right":"left",direction:f?1:-1,size:"width",children:u.jsxRuntimeExports.jsx(te,{dir:g,"data-orientation":"horizontal",...p,ref:v,style:{...p.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:b=>{const S=j(b.clientX);r?.(S)},onSlideMove:b=>{const S=j(b.clientX);a?.(S)},onSlideEnd:()=>{w.current=void 0,c?.()},onStepKeyDown:b=>{const M=W[f?"from-left":"from-right"].includes(b.key);h?.({event:b,direction:M?-1:1})}})})}),ve=l.forwardRef((e,t)=>{const{min:n,max:o,inverted:i,onSlideStart:d,onSlideMove:r,onSlideEnd:a,onStepKeyDown:c,...h}=e,p=l.useRef(null),s=_.useComposedRefs(t,p),m=l.useRef(void 0),v=!i;function w(g){const x=m.current||p.current.getBoundingClientRect(),f=[0,x.height],b=q(f,v?[o,n]:[n,o]);return m.current=x,b(g-x.top)}return u.jsxRuntimeExports.jsx(Z,{scope:e.__scopeSlider,startEdge:v?"bottom":"top",endEdge:v?"top":"bottom",size:"height",direction:v?1:-1,children:u.jsxRuntimeExports.jsx(te,{"data-orientation":"vertical",...h,ref:s,style:{...h.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:g=>{const x=w(g.clientY);d?.(x)},onSlideMove:g=>{const x=w(g.clientY);r?.(x)},onSlideEnd:()=>{m.current=void 0,a?.()},onStepKeyDown:g=>{const f=W[v?"from-bottom":"from-top"].includes(g.key);c?.({event:g,direction:f?-1:1})}})})}),te=l.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:o,onSlideMove:i,onSlideEnd:d,onHomeKeyDown:r,onEndKeyDown:a,onStepKeyDown:c,...h}=e,p=T(C,n);return u.jsxRuntimeExports.jsx(I.Primitive.span,{...h,ref:t,onKeyDown:P.composeEventHandlers(e.onKeyDown,s=>{s.key==="Home"?(r(s),s.preventDefault()):s.key==="End"?(a(s),s.preventDefault()):X.concat(G).includes(s.key)&&(c(s),s.preventDefault())}),onPointerDown:P.composeEventHandlers(e.onPointerDown,s=>{const m=s.target;m.setPointerCapture(s.pointerId),s.preventDefault(),p.thumbs.has(m)?m.focus():o(s)}),onPointerMove:P.composeEventHandlers(e.onPointerMove,s=>{s.target.hasPointerCapture(s.pointerId)&&i(s)}),onPointerUp:P.composeEventHandlers(e.onPointerUp,s=>{const m=s.target;m.hasPointerCapture(s.pointerId)&&(m.releasePointerCapture(s.pointerId),d(s))})})}),ne="SliderTrack",oe=l.forwardRef((e,t)=>{const{__scopeSlider:n,...o}=e,i=T(ne,n);return u.jsxRuntimeExports.jsx(I.Primitive.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...o,ref:t})});oe.displayName=ne;var O="SliderRange",re=l.forwardRef((e,t)=>{const{__scopeSlider:n,...o}=e,i=T(O,n),d=ee(O,n),r=l.useRef(null),a=_.useComposedRefs(t,r),c=i.values.length,h=i.values.map(m=>ae(m,i.min,i.max)),p=c>1?Math.min(...h):0,s=100-Math.max(...h);return u.jsxRuntimeExports.jsx(I.Primitive.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...o,ref:a,style:{...e.style,[d.startEdge]:p+"%",[d.endEdge]:s+"%"}})});re.displayName=O;var $="SliderThumb",ie=l.forwardRef((e,t)=>{const n=xe(e.__scopeSlider),[o,i]=l.useState(null),d=_.useComposedRefs(t,a=>i(a)),r=l.useMemo(()=>o?n().findIndex(a=>a.ref.current===o):-1,[n,o]);return u.jsxRuntimeExports.jsx(be,{...e,ref:d,index:r})}),be=l.forwardRef((e,t)=>{const{__scopeSlider:n,index:o,name:i,...d}=e,r=T($,n),a=ee($,n),[c,h]=l.useState(null),p=_.useComposedRefs(t,j=>h(j)),s=c?r.form||!!c.closest("form"):!0,m=fe.useSize(c),v=r.values[o],w=v===void 0?0:ae(v,r.min,r.max),g=Ee(o,r.values.length),x=m?.[a.size],f=x?Pe(x,w,a.direction):0;return l.useEffect(()=>{if(c)return r.thumbs.add(c),()=>{r.thumbs.delete(c)}},[c,r.thumbs]),u.jsxRuntimeExports.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[a.startEdge]:`calc(${w}% + ${f}px)`},children:[u.jsxRuntimeExports.jsx(V.ItemSlot,{scope:e.__scopeSlider,children:u.jsxRuntimeExports.jsx(I.Primitive.span,{role:"slider","aria-label":e["aria-label"]||g,"aria-valuemin":r.min,"aria-valuenow":v,"aria-valuemax":r.max,"aria-orientation":r.orientation,"data-orientation":r.orientation,"data-disabled":r.disabled?"":void 0,tabIndex:r.disabled?void 0:0,...d,ref:p,style:v===void 0?{display:"none"}:e.style,onFocus:P.composeEventHandlers(e.onFocus,()=>{r.valueIndexToChangeRef.current=o})})}),s&&u.jsxRuntimeExports.jsx(se,{name:i??(r.name?r.name+(r.values.length>1?"[]":""):void 0),form:r.form,value:v},o)]})});ie.displayName=$;var Re="RadioBubbleInput",se=l.forwardRef(({__scopeSlider:e,value:t,...n},o)=>{const i=l.useRef(null),d=_.useComposedRefs(i,o),r=me.usePrevious(t);return l.useEffect(()=>{const a=i.current;if(!a)return;const c=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(c,"value").set;if(r!==t&&p){const s=new Event("input",{bubbles:!0});p.call(a,t),a.dispatchEvent(s)}},[r,t]),u.jsxRuntimeExports.jsx(I.Primitive.input,{style:{display:"none"},...n,ref:d,defaultValue:t})});se.displayName=Re;function we(e=[],t,n){const o=[...e];return o[n]=t,o.sort((i,d)=>i-d)}function ae(e,t,n){const d=100/(n-t)*(e-t);return F.clamp(d,[0,100])}function Ee(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function ye(e,t){if(e.length===1)return 0;const n=e.map(i=>Math.abs(i-t)),o=Math.min(...n);return n.indexOf(o)}function Pe(e,t,n){const o=e/2,d=q([0,50],[0,o]);return(o-d(t)*n)*n}function je(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function De(e,t){if(t>0){const n=je(e);return Math.min(...n)>=t}return!0}function q(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const o=(t[1]-t[0])/(e[1]-e[0]);return t[0]+o*(n-e[0])}}function _e(e){return(String(e).split(".")[1]||"").length}function Ce(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var Me=Q,Ae=oe,Ke=re,Ie=ie;function Te({className:e,defaultValue:t,value:n,min:o=0,max:i=100,theme:d,colorSlide:r,...a}){const c=l.useMemo(()=>Array.isArray(n)?n:Array.isArray(t)?t:[o,i],[n,t,o,i]),h=l.useMemo(()=>{if(r){if(r==="full")return{background:"linear-gradient(to right, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff0000)"};if(Array.isArray(r)&&r.length===2)return{background:`linear-gradient(to right, ${r[0]}, ${r[1]})`}}},[r]);return u.jsxRuntimeExports.jsxs(Me,{"data-slot":"slider","data-theme":d,defaultValue:t,value:n,min:o,max:i,className:N.cn(`
2
2
  adm:relative adm:flex adm:w-full adm:touch-none adm:items-center
3
3
  adm:select-none
4
- adm:data-[disabled]:opacity-50
4
+ adm:data-disabled:opacity-50
5
5
  adm:data-[orientation=vertical]:h-full
6
6
  adm:data-[orientation=vertical]:min-h-44
7
7
  adm:data-[orientation=vertical]:w-auto
@@ -12,7 +12,7 @@
12
12
  adm:data-[orientation=horizontal]:w-full
13
13
  adm:data-[orientation=vertical]:h-full
14
14
  adm:data-[orientation=vertical]:w-1.5
15
- `,r?"":"adm:bg-muted"),style:r?S:void 0,children:u.jsxRuntimeExports.jsx(Ke,{"data-slot":"slider-range",className:N.cn(`
15
+ `,r?"":"adm:bg-muted"),style:r?h:void 0,children:u.jsxRuntimeExports.jsx(Ke,{"data-slot":"slider-range",className:N.cn(`
16
16
  adm:absolute
17
17
  adm:data-[orientation=horizontal]:h-full
18
18
  adm:data-[orientation=vertical]:w-full
package/dist/slider.js CHANGED
@@ -431,7 +431,7 @@ function Fe({
431
431
  min: o = 0,
432
432
  max: i = 100,
433
433
  theme: d,
434
- color: r,
434
+ colorSlide: r,
435
435
  ...s
436
436
  }) {
437
437
  const c = l.useMemo(
@@ -462,7 +462,7 @@ function Fe({
462
462
  `
463
463
  adm:relative adm:flex adm:w-full adm:touch-none adm:items-center
464
464
  adm:select-none
465
- adm:data-[disabled]:opacity-50
465
+ adm:data-disabled:opacity-50
466
466
  adm:data-[orientation=vertical]:h-full
467
467
  adm:data-[orientation=vertical]:min-h-44
468
468
  adm:data-[orientation=vertical]:w-auto