@adamosuiteservices/ui 2.13.2 → 2.13.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/dist/components/ui/slider/slider.d.ts +5 -2
  2. package/dist/slider.cjs +6 -7
  3. package/dist/slider.js +191 -177
  4. package/docs/AI-GUIDE.md +321 -321
  5. package/docs/components/layout/sidebar.md +399 -399
  6. package/docs/components/layout/toaster.md +436 -436
  7. package/docs/components/ui/accordion-rounded.md +584 -584
  8. package/docs/components/ui/accordion.md +269 -269
  9. package/docs/components/ui/calendar.md +1159 -1159
  10. package/docs/components/ui/card.md +1455 -1455
  11. package/docs/components/ui/checkbox.md +292 -292
  12. package/docs/components/ui/collapsible.md +323 -323
  13. package/docs/components/ui/dialog.md +628 -628
  14. package/docs/components/ui/field.md +706 -706
  15. package/docs/components/ui/hover-card.md +446 -446
  16. package/docs/components/ui/kbd.md +434 -434
  17. package/docs/components/ui/label.md +359 -359
  18. package/docs/components/ui/pagination.md +650 -650
  19. package/docs/components/ui/popover.md +536 -536
  20. package/docs/components/ui/progress.md +182 -182
  21. package/docs/components/ui/radio-group.md +311 -311
  22. package/docs/components/ui/separator.md +214 -214
  23. package/docs/components/ui/sheet.md +174 -174
  24. package/docs/components/ui/skeleton.md +140 -140
  25. package/docs/components/ui/slider.md +460 -341
  26. package/docs/components/ui/spinner.md +170 -170
  27. package/docs/components/ui/switch.md +408 -408
  28. package/docs/components/ui/tabs-underline.md +106 -106
  29. package/docs/components/ui/tabs.md +122 -122
  30. package/docs/components/ui/textarea.md +243 -243
  31. package/docs/components/ui/toggle.md +237 -237
  32. package/docs/components/ui/tooltip.md +317 -317
  33. package/docs/components/ui/typography.md +320 -320
  34. package/package.json +1 -1
@@ -1,7 +1,10 @@
1
1
  import { Theme } from '../../../types/theme.type';
2
2
  import * as SliderPrimitive from "@radix-ui/react-slider";
3
3
  import * as React from "react";
4
- declare function Slider({ className, defaultValue, value, min, max, theme, ...props }: React.ComponentProps<typeof SliderPrimitive.Root> & {
4
+ type SliderColorProp = "full" | [string, string];
5
+ type SliderProps = React.ComponentProps<typeof SliderPrimitive.Root> & {
5
6
  theme?: Theme;
6
- }): import("react/jsx-runtime").JSX.Element;
7
+ color?: SliderColorProp;
8
+ };
9
+ declare function Slider({ className, defaultValue, value, min, max, theme, color, ...props }: SliderProps): import("react/jsx-runtime").JSX.Element;
7
10
  export { Slider };
package/dist/slider.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=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:r=100,step:d=1,orientation:i="horizontal",disabled:a=!1,minStepsBetweenThumbs:u=0,defaultValue:S=[o],value:h,onValueChange:s=()=>{},onValueCommit:m=()=>{},inverted:v=!1,form:w,...g}=e,p=l.useRef(new Set),f=l.useRef(0),b=i==="horizontal"?ge:ve,[x=[],M]=P.useControllableState({prop:h,defaultProp:S,onChange:R=>{[...p.current][f.current]?.focus(),s(R)}}),B=l.useRef(x);function k(R){const E=ye(x,R);A(R,E)}function de(R){A(R,f.current)}function le(){const R=B.current[f.current];x[f.current]!==R&&m(x)}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,r]);M((D=[])=>{const y=we(D,K,E);if(De(y,u*d)){f.current=y.indexOf(K);const U=String(y)!==String(D);return U&&z&&m(y),U?y:D}else return D})}return c.jsxRuntimeExports.jsx(he,{scope:e.__scopeSlider,name:n,disabled:a,min:o,max:r,valueIndexToChangeRef:f,thumbs:p.current,values:x,orientation:i,form:w,children:c.jsxRuntimeExports.jsx(V.Provider,{scope:e.__scopeSlider,children:c.jsxRuntimeExports.jsx(V.Slot,{scope:e.__scopeSlider,children:c.jsxRuntimeExports.jsx(b,{"aria-disabled":a,"data-disabled":a?"":void 0,...g,ref:t,onPointerDown:P.composeEventHandlers(g.onPointerDown,()=>{a||(B.current=x)}),min:o,max:r,inverted:v,onSlideStart:a?void 0:k,onSlideMove:a?void 0:de,onSlideEnd:a?void 0:le,onHomeKeyDown:()=>!a&&A(o,0,{commit:!0}),onEndKeyDown:()=>!a&&A(r,x.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=x[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:r,inverted:d,onSlideStart:i,onSlideMove:a,onSlideEnd:u,onStepKeyDown:S,...h}=e,[s,m]=l.useState(null),v=_.useComposedRefs(t,b=>m(b)),w=l.useRef(void 0),g=Y.useDirection(r),p=g==="ltr",f=p&&!d||!p&&d;function j(b){const x=w.current||s.getBoundingClientRect(),M=[0,x.width],k=q(M,f?[n,o]:[o,n]);return w.current=x,k(b-x.left)}return c.jsxRuntimeExports.jsx(Z,{scope:e.__scopeSlider,startEdge:f?"left":"right",endEdge:f?"right":"left",direction:f?1:-1,size:"width",children:c.jsxRuntimeExports.jsx(te,{dir:g,"data-orientation":"horizontal",...h,ref:v,style:{...h.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:b=>{const x=j(b.clientX);i?.(x)},onSlideMove:b=>{const x=j(b.clientX);a?.(x)},onSlideEnd:()=>{w.current=void 0,u?.()},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:r,onSlideStart:d,onSlideMove:i,onSlideEnd:a,onStepKeyDown:u,...S}=e,h=l.useRef(null),s=_.useComposedRefs(t,h),m=l.useRef(void 0),v=!r;function w(g){const p=m.current||h.current.getBoundingClientRect(),f=[0,p.height],b=q(f,v?[o,n]:[n,o]);return m.current=p,b(g-p.top)}return c.jsxRuntimeExports.jsx(Z,{scope:e.__scopeSlider,startEdge:v?"bottom":"top",endEdge:v?"top":"bottom",size:"height",direction:v?1:-1,children:c.jsxRuntimeExports.jsx(te,{"data-orientation":"vertical",...S,ref:s,style:{...S.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:g=>{const p=w(g.clientY);d?.(p)},onSlideMove:g=>{const p=w(g.clientY);i?.(p)},onSlideEnd:()=>{m.current=void 0,a?.()},onStepKeyDown:g=>{const f=W[v?"from-bottom":"from-top"].includes(g.key);u?.({event:g,direction:f?-1:1})}})})}),te=l.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:o,onSlideMove:r,onSlideEnd:d,onHomeKeyDown:i,onEndKeyDown:a,onStepKeyDown:u,...S}=e,h=T(C,n);return c.jsxRuntimeExports.jsx(I.Primitive.span,{...S,ref:t,onKeyDown:P.composeEventHandlers(e.onKeyDown,s=>{s.key==="Home"?(i(s),s.preventDefault()):s.key==="End"?(a(s),s.preventDefault()):X.concat(G).includes(s.key)&&(u(s),s.preventDefault())}),onPointerDown:P.composeEventHandlers(e.onPointerDown,s=>{const m=s.target;m.setPointerCapture(s.pointerId),s.preventDefault(),h.thumbs.has(m)?m.focus():o(s)}),onPointerMove:P.composeEventHandlers(e.onPointerMove,s=>{s.target.hasPointerCapture(s.pointerId)&&r(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,r=T(ne,n);return c.jsxRuntimeExports.jsx(I.Primitive.span,{"data-disabled":r.disabled?"":void 0,"data-orientation":r.orientation,...o,ref:t})});oe.displayName=ne;var O="SliderRange",re=l.forwardRef((e,t)=>{const{__scopeSlider:n,...o}=e,r=T(O,n),d=ee(O,n),i=l.useRef(null),a=_.useComposedRefs(t,i),u=r.values.length,S=r.values.map(m=>ae(m,r.min,r.max)),h=u>1?Math.min(...S):0,s=100-Math.max(...S);return c.jsxRuntimeExports.jsx(I.Primitive.span,{"data-orientation":r.orientation,"data-disabled":r.disabled?"":void 0,...o,ref:a,style:{...e.style,[d.startEdge]:h+"%",[d.endEdge]:s+"%"}})});re.displayName=O;var $="SliderThumb",ie=l.forwardRef((e,t)=>{const n=xe(e.__scopeSlider),[o,r]=l.useState(null),d=_.useComposedRefs(t,a=>r(a)),i=l.useMemo(()=>o?n().findIndex(a=>a.ref.current===o):-1,[n,o]);return c.jsxRuntimeExports.jsx(be,{...e,ref:d,index:i})}),be=l.forwardRef((e,t)=>{const{__scopeSlider:n,index:o,name:r,...d}=e,i=T($,n),a=ee($,n),[u,S]=l.useState(null),h=_.useComposedRefs(t,j=>S(j)),s=u?i.form||!!u.closest("form"):!0,m=fe.useSize(u),v=i.values[o],w=v===void 0?0:ae(v,i.min,i.max),g=Ee(o,i.values.length),p=m?.[a.size],f=p?Pe(p,w,a.direction):0;return l.useEffect(()=>{if(u)return i.thumbs.add(u),()=>{i.thumbs.delete(u)}},[u,i.thumbs]),c.jsxRuntimeExports.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[a.startEdge]:`calc(${w}% + ${f}px)`},children:[c.jsxRuntimeExports.jsx(V.ItemSlot,{scope:e.__scopeSlider,children:c.jsxRuntimeExports.jsx(I.Primitive.span,{role:"slider","aria-label":e["aria-label"]||g,"aria-valuemin":i.min,"aria-valuenow":v,"aria-valuemax":i.max,"aria-orientation":i.orientation,"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,tabIndex:i.disabled?void 0:0,...d,ref:h,style:v===void 0?{display:"none"}:e.style,onFocus:P.composeEventHandlers(e.onFocus,()=>{i.valueIndexToChangeRef.current=o})})}),s&&c.jsxRuntimeExports.jsx(se,{name:r??(i.name?i.name+(i.values.length>1?"[]":""):void 0),form:i.form,value:v},o)]})});ie.displayName=$;var Re="RadioBubbleInput",se=l.forwardRef(({__scopeSlider:e,value:t,...n},o)=>{const r=l.useRef(null),d=_.useComposedRefs(r,o),i=me.usePrevious(t);return l.useEffect(()=>{const a=r.current;if(!a)return;const u=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(u,"value").set;if(i!==t&&h){const s=new Event("input",{bubbles:!0});h.call(a,t),a.dispatchEvent(s)}},[i,t]),c.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((r,d)=>r-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(r=>Math.abs(r-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:r=100,theme:d,...i}){const a=l.useMemo(()=>Array.isArray(n)?n:Array.isArray(t)?t:[o,r],[n,t,o,r]);return c.jsxRuntimeExports.jsxs(Me,{"data-slot":"slider","data-theme":d,defaultValue:t,value:n,min:o,max:r,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,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(`
2
2
  adm:relative adm:flex adm:w-full adm:touch-none adm:items-center
3
3
  adm:select-none
4
4
  adm:data-[disabled]:opacity-50
@@ -6,22 +6,21 @@
6
6
  adm:data-[orientation=vertical]:min-h-44
7
7
  adm:data-[orientation=vertical]:w-auto
8
8
  adm:data-[orientation=vertical]:flex-col
9
- `,e),...i,children:[c.jsxRuntimeExports.jsx(Ae,{"data-slot":"slider-track",className:N.cn(`
9
+ `,e),...a,children:[u.jsxRuntimeExports.jsx(Ae,{"data-slot":"slider-track",className:N.cn(`
10
10
  adm:relative adm:grow adm:overflow-hidden adm:rounded-full
11
- adm:bg-muted
12
11
  adm:data-[orientation=horizontal]:h-1.5
13
12
  adm:data-[orientation=horizontal]:w-full
14
13
  adm:data-[orientation=vertical]:h-full
15
14
  adm:data-[orientation=vertical]:w-1.5
16
- `),children:c.jsxRuntimeExports.jsx(Ke,{"data-slot":"slider-range",className:N.cn(`
17
- adm:absolute adm:bg-primary
15
+ `,r?"":"adm:bg-muted"),style:r?S:void 0,children:u.jsxRuntimeExports.jsx(Ke,{"data-slot":"slider-range",className:N.cn(`
16
+ adm:absolute
18
17
  adm:data-[orientation=horizontal]:h-full
19
18
  adm:data-[orientation=vertical]:w-full
20
- `)})}),Array.from({length:a.length},(u,S)=>c.jsxRuntimeExports.jsx(Ie,{"data-slot":"slider-thumb",className:`
19
+ `,r?"adm:bg-transparent":"adm:bg-primary")})}),Array.from({length:c.length},(p,s)=>u.jsxRuntimeExports.jsx(Ie,{"data-slot":"slider-thumb",className:`
21
20
  adm:block adm:size-4 adm:shrink-0 adm:rounded-full adm:border
22
21
  adm:border-primary adm:bg-white adm:shadow-sm adm:ring-ring/50
23
22
  adm:transition-[color,box-shadow]
24
23
  adm:hover:ring-4
25
24
  adm:focus-visible:ring-4 adm:focus-visible:outline-hidden
26
25
  adm:disabled:pointer-events-none adm:disabled:opacity-50
27
- `},S))]})}exports.Slider=Te;
26
+ `},s))]})}exports.Slider=Te;