@spark-ui/slider
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -6,2 +6,8 @@ # Change Log | ||
## [1.0.3](https://github.com/adevinta/spark/compare/@spark-ui/slider@1.0.2...@spark-ui/slider@1.0.3) (2023-11-10) | ||
### Bug Fixes | ||
- **slider:** focus and focus-styles management ([50a47e3](https://github.com/adevinta/spark/commit/50a47e34d6f8eb2b0039bc280b18f4339ca2c867)) | ||
## [1.0.2](https://github.com/adevinta/spark/compare/@spark-ui/slider@1.0.1...@spark-ui/slider@1.0.2) (2023-10-20) | ||
@@ -8,0 +14,0 @@ |
@@ -1,1 +0,1 @@ | ||
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react"),p=require("@radix-ui/react-slider"),c=require("class-variance-authority");function f(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const t=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,t.get?t:{enumerable:!0,get:()=>e[r]})}}return n.default=e,Object.freeze(n)}const o=f(p),v=c.cva(["flex relative h-sz-24 items-center","touch-none select-none","spark-disabled:cursor-not-allowed spark-disabled:opacity-dim-3"]),b=a.createContext({}),g=()=>a.useContext(b),m=a.forwardRef(({asChild:e=!1,intent:n="basic",shape:r="square",children:t,className:s,...i},h)=>a.createElement(b.Provider,{value:{intent:n,shape:r}},a.createElement(o.Root,{ref:h,"data-spark-component":"slider",asChild:e,className:v({className:s}),dir:"ltr",orientation:"horizontal",inverted:!1,minStepsBetweenThumbs:0,...i},t)));m.displayName="Slider";const N=c.cva(["block h-sz-24 w-sz-24 rounded-full cursor-pointer","hover:ring-4 u-shadow-border-transition","outline-none","focus-visible:u-ring","spark-disabled:hover:ring-0 spark-disabled:cursor-not-allowed"],{variants:{intent:{main:["bg-main hover:ring-main-container"],support:["bg-support hover:ring-support-container"],accent:["bg-accent hover:ring-accent-container"],basic:["bg-basic hover:ring-basic-container"],info:["bg-info hover:ring-info-container"],neutral:["bg-neutral hover:ring-neutral-container"],success:["bg-success hover:ring-success-container"],alert:["bg-alert hover:ring-alert-container"],error:["bg-error hover:ring-error-container"]}},defaultVariants:{intent:"basic"}}),l=a.forwardRef(({asChild:e=!1,className:n,...r},t)=>{const{intent:s}=g();return a.createElement(o.Thumb,{ref:t,asChild:e,className:N({intent:s,className:n}),...r})});l.displayName="Slider.Thumb";const y=c.cva(["relative grow h-sz-4 bg-on-background/dim-4"],{variants:{shape:{rounded:"rounded-sm",square:"rounded-none"}},defaultVariants:{shape:"square"}}),S=c.cva(["absolute h-full"],{variants:{intent:{main:["bg-main"],support:["bg-support"],accent:["bg-accent"],basic:["bg-basic"],info:["bg-info"],neutral:["bg-neutral"],success:["bg-success"],alert:["bg-alert"],error:["bg-error"]},shape:{rounded:"rounded-sm",square:"rounded-none"}},defaultVariants:{intent:"basic",shape:"square"}}),d=a.forwardRef(({asChild:e=!1,className:n,...r},t)=>{const{intent:s,shape:i}=g();return a.createElement(o.Track,{ref:t,asChild:e,className:y({shape:i}),...r},a.createElement(o.Range,{className:S({intent:s,shape:i,className:n})}))});d.displayName="Slider.Track";const u=Object.assign(m,{Thumb:l,Track:d});u.displayName="Slider",l.displayName="Slider.Thumb",d.displayName="Slider.Track",exports.Slider=u; | ||
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react"),w=require("@radix-ui/react-slider"),u=require("class-variance-authority");function S(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,s.get?s:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const l=S(w),k=u.cva(["flex relative h-sz-24 items-center","touch-none select-none","spark-disabled:cursor-not-allowed spark-disabled:opacity-dim-3"]),h=r.createContext({}),f=()=>r.useContext(h),v=r.forwardRef(({asChild:e=!1,intent:t="basic",shape:n="square",children:s,className:o,...i},d)=>r.createElement(h.Provider,{value:{intent:t,shape:n}},r.createElement(l.Root,{ref:d,"data-spark-component":"slider",asChild:e,className:k({className:o}),dir:"ltr",orientation:"horizontal",inverted:!1,minStepsBetweenThumbs:0,...i},s)));v.displayName="Slider";const T=u.cva(["block h-sz-24 w-sz-24 rounded-full cursor-pointer","hover:ring-4 u-shadow-border-transition","outline-none","focus-visible:u-ring","data-[interaction=pointerdown]:focus-visible:!ring-0","spark-disabled:hover:ring-0 spark-disabled:cursor-not-allowed"],{variants:{intent:{main:["bg-main hover:ring-main-container"],support:["bg-support hover:ring-support-container"],accent:["bg-accent hover:ring-accent-container"],basic:["bg-basic hover:ring-basic-container"],info:["bg-info hover:ring-info-container"],neutral:["bg-neutral hover:ring-neutral-container"],success:["bg-success hover:ring-success-container"],alert:["bg-alert hover:ring-alert-container"],error:["bg-error hover:ring-error-container"]}},defaultVariants:{intent:"basic"}}),g=r.forwardRef(({asChild:e=!1,className:t,onPointerDown:n,onKeyDown:s,onBlur:o,...i},d)=>{const{intent:y}=f(),N=r.useRef(null),c=d||N,b=a=>{typeof c!="function"&&c.current&&(c.current.dataset.interaction=a.type)};return r.createElement(l.Thumb,{ref:c,asChild:e,onPointerDown:a=>{b(a),n?.(a)},onKeyDown:a=>{b(a),s?.(a)},onBlur:a=>{b(a),o?.(a)},className:T({intent:y,className:t}),...i})});g.displayName="Slider.Thumb";const q=u.cva(["relative grow h-sz-4 bg-on-background/dim-4"],{variants:{shape:{rounded:"rounded-sm",square:"rounded-none"}},defaultVariants:{shape:"square"}}),C=u.cva(["absolute h-full"],{variants:{intent:{main:["bg-main"],support:["bg-support"],accent:["bg-accent"],basic:["bg-basic"],info:["bg-info"],neutral:["bg-neutral"],success:["bg-success"],alert:["bg-alert"],error:["bg-error"]},shape:{rounded:"rounded-sm",square:"rounded-none"}},defaultVariants:{intent:"basic",shape:"square"}}),p=r.forwardRef(({asChild:e=!1,className:t,...n},s)=>{const{intent:o,shape:i}=f();return r.createElement(l.Track,{ref:s,asChild:e,className:q({shape:i}),...n},r.createElement(l.Range,{className:C({intent:o,shape:i,className:t})}))});p.displayName="Slider.Track";const m=Object.assign(v,{Thumb:g,Track:p});m.displayName="Slider",g.displayName="Slider.Thumb",p.displayName="Slider.Track",exports.Slider=m; |
@@ -9,2 +9,2 @@ import * as RadixSlider from '@radix-ui/react-slider'; | ||
} | ||
export declare const SliderThumb: import("react").ForwardRefExoticComponent<SliderThumbProps & import("react").RefAttributes<HTMLDivElement>>; | ||
export declare const SliderThumb: import("react").ForwardRefExoticComponent<SliderThumbProps & import("react").RefAttributes<HTMLSpanElement>>; |
{ | ||
"name": "@spark-ui/slider", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "An input where the user selects a value from within a given range.", | ||
@@ -52,3 +52,3 @@ "publishConfig": { | ||
"license": "MIT", | ||
"gitHead": "6228075e4fa413761dc67987a4f3255ff2b63697" | ||
"gitHead": "ad744046008927c7317124a9f5e8453125aabb2b" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
23341
477