@wistia/vhs 2.77.2-beta.ff244103.1cc81bb → 2.77.2
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ComponentPropsWithoutRef, JSX } from 'react';
|
|
2
|
-
type
|
|
3
|
-
export type SliderProps =
|
|
2
|
+
type ComponentPropsWithoutRefWithoutDefaultValue = Omit<ComponentPropsWithoutRef<'div'>, 'defaultValue' | 'onChange'>;
|
|
3
|
+
export type SliderProps = ComponentPropsWithoutRefWithoutDefaultValue & {
|
|
4
4
|
/**
|
|
5
5
|
* aria-label for screen-readers to apply to the thumbs. Use an array for more than one thumb.
|
|
6
6
|
* The length of the array must match the number of thumbs in the value array.
|
|
@@ -29,7 +29,7 @@ export type SliderProps = ComponentPropsWithoutRefWithoutOnChange & {
|
|
|
29
29
|
* Don't pass a default value if the slider is controlled (i.e. if you already
|
|
30
30
|
* use the `value` prop).
|
|
31
31
|
*/
|
|
32
|
-
|
|
32
|
+
defaultValue?: number[] | number | undefined;
|
|
33
33
|
/**
|
|
34
34
|
* If `true` the thumbs can't be moved.
|
|
35
35
|
*/
|
|
@@ -53,12 +53,12 @@ export type SliderProps = ComponentPropsWithoutRefWithoutOnChange & {
|
|
|
53
53
|
*/
|
|
54
54
|
step?: number;
|
|
55
55
|
/**
|
|
56
|
-
* Like '
|
|
56
|
+
* Like 'defaultValue' but for controlled components.
|
|
57
57
|
*/
|
|
58
58
|
value?: number[] | number;
|
|
59
59
|
};
|
|
60
60
|
export declare const Slider: {
|
|
61
|
-
({ ariaLabel, ariaLabelledby, ariaValuetext, disabled,
|
|
61
|
+
({ ariaLabel, ariaLabelledby, ariaValuetext, disabled, defaultValue, max, min, onChange, step, value, "data-testid": passedDataTestId, ...otherProps }: SliderProps): JSX.Element;
|
|
62
62
|
displayName: string;
|
|
63
63
|
};
|
|
64
64
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Slider.d.ts","sourceRoot":"","sources":["../../../src/components/Slider/Slider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,GAAG,EAAoC,MAAM,OAAO,CAAC;AAyF7F,KAAK,
|
|
1
|
+
{"version":3,"file":"Slider.d.ts","sourceRoot":"","sources":["../../../src/components/Slider/Slider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,GAAG,EAAoC,MAAM,OAAO,CAAC;AAyF7F,KAAK,2CAA2C,GAAG,IAAI,CACrD,wBAAwB,CAAC,KAAK,CAAC,EAC/B,cAAc,GAAG,UAAU,CAC5B,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,2CAA2C,GAAG;IACtE;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,CAAC;IAC1C;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,CAAC;IAC/C;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,CAAC;IACvE;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;;;;;;OASG;IACH,YAAY,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,CAAC;IAC7C;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC;IACtD;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,MAAM;4JAahB,WAAW,GAAG,GAAG,CAAC,OAAO;;CAmF3B,CAAC"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/vhs v2.77.2
|
|
3
|
+
* @license @wistia/vhs v2.77.2
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2021-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -2787,7 +2787,7 @@
|
|
|
2787
2787
|
background: ${({$isFilledTrack:e,theme:t})=>e?t.color.brandBlue500:t.color.grey400};
|
|
2788
2788
|
border-radius: 999px;
|
|
2789
2789
|
height: ${hI};
|
|
2790
|
-
`,j7=({ariaLabel:e,ariaLabelledby:t,ariaValuetext:r,disabled:n=!1,
|
|
2790
|
+
`,j7=({ariaLabel:e,ariaLabelledby:t,ariaValuetext:r,disabled:n=!1,defaultValue:o=0,max:a=100,min:s=0,onChange:l,step:u=1,value:c,"data-testid":p,...d})=>{be(e)||be(t)||console.warn("VHS Slider: Sliders are required to have an accessible name. Add a label using the ariaLabel or ariaLabelledby prop.");let h=F(p)?p:"vhs-slider";return(0,Ll.jsx)(Mne,{...d,"data-testid":h,disabled:n,children:(0,Ll.jsx)(H7,{ariaLabel:ut(e)||zl(e)?e:void 0,ariaLabelledby:ut(t)||zl(t)?t:void 0,ariaValuetext:Hn(r)?g=>r(g):r,defaultValue:D0(o)||zl(o)?o:void 0,disabled:n,marks:u,max:a,min:s,onChange:l,renderMark:g=>{let{key:v,...m}=g;return(0,Ll.jsx)("span",{...m,"data-testid":`${h}-mark-${g.key+s}`},v)},renderThumb:(g,v)=>{let{key:m,...b}=g;return(0,Ll.jsx)(Ine,{...b,"data-testid":`${h}-thumb-${v.index}`},m)},renderTrack:(g,v)=>{let{key:m,...b}=g;return(0,Ll.jsx)(Vne,{...b,$isFilledTrack:kne(v),"data-testid":`${h}-track-${v.index}`},m)},step:u,value:D0(c)||zl(c)?c:void 0})})};j7.displayName="Slider_VHS";i();i();var gI=require("react"),vI=V(require("styled-components")),yI=require("react/jsx-runtime"),Nne=vI.default.div`
|
|
2791
2791
|
display: flex;
|
|
2792
2792
|
flex-direction: ${({$direction:e})=>e==="horizontal"?"row":"column"};
|
|
2793
2793
|
gap: ${({$gap:e,theme:t})=>t.spacing[e]};
|