@zag-js/slider 1.47.0 → 1.48.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.
@@ -1,12 +1,7 @@
1
- import { SliderProps, MarkerProps, ThumbProps } from './slider.types.mjs';
2
- import '@zag-js/core';
3
- import '@zag-js/types';
4
-
5
- declare const props: (keyof SliderProps)[];
6
- declare const splitProps: <Props extends Partial<SliderProps>>(props: Props) => [Partial<SliderProps>, Omit<Props, keyof SliderProps>];
7
- declare const thumbProps: (keyof ThumbProps)[];
8
- declare const splitThumbProps: <Props extends ThumbProps>(props: Props) => [ThumbProps, Omit<Props, keyof ThumbProps>];
9
- declare const markerProps: "value"[];
10
- declare const splitMarkerProps: <Props extends MarkerProps>(props: Props) => [MarkerProps, Omit<Props, "value">];
11
-
12
- export { markerProps, props, splitMarkerProps, splitProps, splitThumbProps, thumbProps };
1
+ import { MarkerProps, SliderProps, ThumbProps } from "./slider.types.mjs";
2
+ export declare const props: (keyof SliderProps)[];
3
+ export declare const splitProps: <Props extends Partial<SliderProps>>(props: Props) => [Partial<SliderProps>, Omit<Props, keyof SliderProps>];
4
+ export declare const thumbProps: (keyof ThumbProps)[];
5
+ export declare const splitThumbProps: <Props extends ThumbProps>(props: Props) => [ThumbProps, Omit<Props, keyof ThumbProps>];
6
+ export declare const markerProps: "value"[];
7
+ export declare const splitMarkerProps: <Props extends MarkerProps>(props: Props) => [MarkerProps, Omit<Props, "value">];
@@ -1,12 +1,7 @@
1
- import { SliderProps, MarkerProps, ThumbProps } from './slider.types.js';
2
- import '@zag-js/core';
3
- import '@zag-js/types';
4
-
5
- declare const props: (keyof SliderProps)[];
6
- declare const splitProps: <Props extends Partial<SliderProps>>(props: Props) => [Partial<SliderProps>, Omit<Props, keyof SliderProps>];
7
- declare const thumbProps: (keyof ThumbProps)[];
8
- declare const splitThumbProps: <Props extends ThumbProps>(props: Props) => [ThumbProps, Omit<Props, keyof ThumbProps>];
9
- declare const markerProps: "value"[];
10
- declare const splitMarkerProps: <Props extends MarkerProps>(props: Props) => [MarkerProps, Omit<Props, "value">];
11
-
12
- export { markerProps, props, splitMarkerProps, splitProps, splitThumbProps, thumbProps };
1
+ import { MarkerProps, SliderProps, ThumbProps } from "./slider.types.js";
2
+ export declare const props: (keyof SliderProps)[];
3
+ export declare const splitProps: <Props extends Partial<SliderProps>>(props: Props) => [Partial<SliderProps>, Omit<Props, keyof SliderProps>];
4
+ export declare const thumbProps: (keyof ThumbProps)[];
5
+ export declare const splitThumbProps: <Props extends ThumbProps>(props: Props) => [ThumbProps, Omit<Props, keyof ThumbProps>];
6
+ export declare const markerProps: "value"[];
7
+ export declare const splitMarkerProps: <Props extends MarkerProps>(props: Props) => [MarkerProps, Omit<Props, "value">];
@@ -1,75 +1,47 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/slider.props.ts
21
- var slider_props_exports = {};
22
- __export(slider_props_exports, {
23
- markerProps: () => markerProps,
24
- props: () => props,
25
- splitMarkerProps: () => splitMarkerProps,
26
- splitProps: () => splitProps,
27
- splitThumbProps: () => splitThumbProps,
28
- thumbProps: () => thumbProps
1
+ Object.defineProperties(exports, {
2
+ __esModule: { value: true },
3
+ [Symbol.toStringTag]: { value: "Module" }
29
4
  });
30
- module.exports = __toCommonJS(slider_props_exports);
31
- var import_types = require("@zag-js/types");
32
- var import_utils = require("@zag-js/utils");
33
- var props = (0, import_types.createProps)()([
34
- "aria-label",
35
- "aria-labelledby",
36
- "dir",
37
- "disabled",
38
- "form",
39
- "getAriaValueText",
40
- "getRootNode",
41
- "id",
42
- "ids",
43
- "invalid",
44
- "largeStep",
45
- "max",
46
- "min",
47
- "minStepsBetweenThumbs",
48
- "name",
49
- "onFocusChange",
50
- "onValueChange",
51
- "onValueChangeEnd",
52
- "orientation",
53
- "origin",
54
- "readOnly",
55
- "step",
56
- "thumbAlignment",
57
- "thumbCollisionBehavior",
58
- "thumbSize",
59
- "value",
60
- "defaultValue"
5
+ let _zag_js_utils = require("@zag-js/utils");
6
+ let _zag_js_types = require("@zag-js/types");
7
+ // src/slider.props.ts
8
+ const props = (0, _zag_js_types.createProps)()([
9
+ "aria-label",
10
+ "aria-labelledby",
11
+ "dir",
12
+ "disabled",
13
+ "form",
14
+ "getAriaValueText",
15
+ "getRootNode",
16
+ "id",
17
+ "ids",
18
+ "invalid",
19
+ "largeStep",
20
+ "max",
21
+ "min",
22
+ "minStepsBetweenThumbs",
23
+ "name",
24
+ "onFocusChange",
25
+ "onValueChange",
26
+ "onValueChangeEnd",
27
+ "orientation",
28
+ "origin",
29
+ "readOnly",
30
+ "step",
31
+ "thumbAlignment",
32
+ "thumbCollisionBehavior",
33
+ "thumbSize",
34
+ "value",
35
+ "defaultValue"
61
36
  ]);
62
- var splitProps = (0, import_utils.createSplitProps)(props);
63
- var thumbProps = (0, import_types.createProps)()(["index", "name"]);
64
- var splitThumbProps = (0, import_utils.createSplitProps)(thumbProps);
65
- var markerProps = (0, import_types.createProps)()(["value"]);
66
- var splitMarkerProps = (0, import_utils.createSplitProps)(markerProps);
67
- // Annotate the CommonJS export names for ESM import in node:
68
- 0 && (module.exports = {
69
- markerProps,
70
- props,
71
- splitMarkerProps,
72
- splitProps,
73
- splitThumbProps,
74
- thumbProps
75
- });
37
+ const splitProps = (0, _zag_js_utils.createSplitProps)(props);
38
+ const thumbProps = (0, _zag_js_types.createProps)()(["index", "name"]);
39
+ const splitThumbProps = (0, _zag_js_utils.createSplitProps)(thumbProps);
40
+ const markerProps = (0, _zag_js_types.createProps)()(["value"]);
41
+ const splitMarkerProps = (0, _zag_js_utils.createSplitProps)(markerProps);
42
+ exports.markerProps = markerProps;
43
+ exports.props = props;
44
+ exports.splitMarkerProps = splitMarkerProps;
45
+ exports.splitProps = splitProps;
46
+ exports.splitThumbProps = splitThumbProps;
47
+ exports.thumbProps = thumbProps;
@@ -1,45 +1,38 @@
1
- // src/slider.props.ts
2
- import { createProps } from "@zag-js/types";
3
1
  import { createSplitProps } from "@zag-js/utils";
4
- var props = createProps()([
5
- "aria-label",
6
- "aria-labelledby",
7
- "dir",
8
- "disabled",
9
- "form",
10
- "getAriaValueText",
11
- "getRootNode",
12
- "id",
13
- "ids",
14
- "invalid",
15
- "largeStep",
16
- "max",
17
- "min",
18
- "minStepsBetweenThumbs",
19
- "name",
20
- "onFocusChange",
21
- "onValueChange",
22
- "onValueChangeEnd",
23
- "orientation",
24
- "origin",
25
- "readOnly",
26
- "step",
27
- "thumbAlignment",
28
- "thumbCollisionBehavior",
29
- "thumbSize",
30
- "value",
31
- "defaultValue"
2
+ import { createProps } from "@zag-js/types";
3
+ // src/slider.props.ts
4
+ const props = createProps()([
5
+ "aria-label",
6
+ "aria-labelledby",
7
+ "dir",
8
+ "disabled",
9
+ "form",
10
+ "getAriaValueText",
11
+ "getRootNode",
12
+ "id",
13
+ "ids",
14
+ "invalid",
15
+ "largeStep",
16
+ "max",
17
+ "min",
18
+ "minStepsBetweenThumbs",
19
+ "name",
20
+ "onFocusChange",
21
+ "onValueChange",
22
+ "onValueChangeEnd",
23
+ "orientation",
24
+ "origin",
25
+ "readOnly",
26
+ "step",
27
+ "thumbAlignment",
28
+ "thumbCollisionBehavior",
29
+ "thumbSize",
30
+ "value",
31
+ "defaultValue"
32
32
  ]);
33
- var splitProps = createSplitProps(props);
34
- var thumbProps = createProps()(["index", "name"]);
35
- var splitThumbProps = createSplitProps(thumbProps);
36
- var markerProps = createProps()(["value"]);
37
- var splitMarkerProps = createSplitProps(markerProps);
38
- export {
39
- markerProps,
40
- props,
41
- splitMarkerProps,
42
- splitProps,
43
- splitThumbProps,
44
- thumbProps
45
- };
33
+ const splitProps = createSplitProps(props);
34
+ const thumbProps = createProps()(["index", "name"]);
35
+ const splitThumbProps = createSplitProps(thumbProps);
36
+ const markerProps = createProps()(["value"]);
37
+ const splitMarkerProps = createSplitProps(markerProps);
38
+ export { markerProps, props, splitMarkerProps, splitProps, splitThumbProps, thumbProps };
@@ -1,19 +1,17 @@
1
- import { Params } from '@zag-js/core';
2
- import { Style } from '@zag-js/types';
3
- import { SliderSchema } from './slider.types.mjs';
4
-
1
+ import { SliderSchema } from "./slider.types.mjs";
2
+ import { Params } from "@zag-js/core";
3
+ import { Style } from "@zag-js/types";
5
4
  type Ctx = Params<SliderSchema>;
6
- declare function getRangeOffsets(params: Pick<Ctx, "prop" | "computed">): {
7
- start: string;
8
- end: string;
5
+ export declare function getRangeOffsets(params: Pick<Ctx, "prop" | "computed">): {
6
+ start: string;
7
+ end: string;
9
8
  };
10
- declare function getRangeStyle(params: Pick<Ctx, "computed">): Style;
11
- declare function getThumbOffset(params: Pick<Ctx, "computed" | "context" | "prop">, value: number): string;
12
- declare function getVisibility(params: Pick<Ctx, "computed" | "prop">): "hidden" | "visible";
13
- declare function getThumbStyle(params: Pick<Ctx, "computed" | "context" | "prop">, index: number): Style;
14
- declare function getControlStyle(): Style;
15
- declare function getRootStyle(params: Pick<Ctx, "context" | "computed" | "prop">): Style;
16
- declare function getMarkerStyle(params: Pick<Ctx, "computed" | "context" | "prop">, value: number): Style;
17
- declare function getMarkerGroupStyle(): Style;
18
-
19
- export { getControlStyle, getMarkerGroupStyle, getMarkerStyle, getRangeOffsets, getRangeStyle, getRootStyle, getThumbOffset, getThumbStyle, getVisibility };
9
+ export declare function getRangeStyle(params: Pick<Ctx, "computed">): Style;
10
+ export declare function getThumbOffset(params: Pick<Ctx, "computed" | "context" | "prop">, value: number): string;
11
+ export declare function getVisibility(params: Pick<Ctx, "computed" | "prop">): "hidden" | "visible";
12
+ export declare function getThumbStyle(params: Pick<Ctx, "computed" | "context" | "prop">, index: number): Style;
13
+ export declare function getControlStyle(): Style;
14
+ export declare function getRootStyle(params: Pick<Ctx, "context" | "computed" | "prop">): Style;
15
+ export declare function getMarkerStyle(params: Pick<Ctx, "computed" | "context" | "prop">, value: number): Style;
16
+ export declare function getMarkerGroupStyle(): Style;
17
+ export {};
@@ -1,19 +1,17 @@
1
- import { Params } from '@zag-js/core';
2
- import { Style } from '@zag-js/types';
3
- import { SliderSchema } from './slider.types.js';
4
-
1
+ import { SliderSchema } from "./slider.types.js";
2
+ import { Style } from "@zag-js/types";
3
+ import { Params } from "@zag-js/core";
5
4
  type Ctx = Params<SliderSchema>;
6
- declare function getRangeOffsets(params: Pick<Ctx, "prop" | "computed">): {
7
- start: string;
8
- end: string;
5
+ export declare function getRangeOffsets(params: Pick<Ctx, "prop" | "computed">): {
6
+ start: string;
7
+ end: string;
9
8
  };
10
- declare function getRangeStyle(params: Pick<Ctx, "computed">): Style;
11
- declare function getThumbOffset(params: Pick<Ctx, "computed" | "context" | "prop">, value: number): string;
12
- declare function getVisibility(params: Pick<Ctx, "computed" | "prop">): "hidden" | "visible";
13
- declare function getThumbStyle(params: Pick<Ctx, "computed" | "context" | "prop">, index: number): Style;
14
- declare function getControlStyle(): Style;
15
- declare function getRootStyle(params: Pick<Ctx, "context" | "computed" | "prop">): Style;
16
- declare function getMarkerStyle(params: Pick<Ctx, "computed" | "context" | "prop">, value: number): Style;
17
- declare function getMarkerGroupStyle(): Style;
18
-
19
- export { getControlStyle, getMarkerGroupStyle, getMarkerStyle, getRangeOffsets, getRangeStyle, getRootStyle, getThumbOffset, getThumbStyle, getVisibility };
9
+ export declare function getRangeStyle(params: Pick<Ctx, "computed">): Style;
10
+ export declare function getThumbOffset(params: Pick<Ctx, "computed" | "context" | "prop">, value: number): string;
11
+ export declare function getVisibility(params: Pick<Ctx, "computed" | "prop">): "hidden" | "visible";
12
+ export declare function getThumbStyle(params: Pick<Ctx, "computed" | "context" | "prop">, index: number): Style;
13
+ export declare function getControlStyle(): Style;
14
+ export declare function getRootStyle(params: Pick<Ctx, "context" | "computed" | "prop">): Style;
15
+ export declare function getMarkerStyle(params: Pick<Ctx, "computed" | "context" | "prop">, value: number): Style;
16
+ export declare function getMarkerGroupStyle(): Style;
17
+ export {};
@@ -1,183 +1,153 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/slider.style.ts
21
- var slider_style_exports = {};
22
- __export(slider_style_exports, {
23
- getControlStyle: () => getControlStyle,
24
- getMarkerGroupStyle: () => getMarkerGroupStyle,
25
- getMarkerStyle: () => getMarkerStyle,
26
- getRangeOffsets: () => getRangeOffsets,
27
- getRangeStyle: () => getRangeStyle,
28
- getRootStyle: () => getRootStyle,
29
- getThumbOffset: () => getThumbOffset,
30
- getThumbStyle: () => getThumbStyle,
31
- getVisibility: () => getVisibility
1
+ Object.defineProperties(exports, {
2
+ __esModule: { value: true },
3
+ [Symbol.toStringTag]: { value: "Module" }
32
4
  });
33
- module.exports = __toCommonJS(slider_style_exports);
34
- var import_utils = require("@zag-js/utils");
5
+ let _zag_js_utils = require("@zag-js/utils");
6
+ // src/slider.style.ts
35
7
  function getBounds(value) {
36
- const firstValue = value[0];
37
- const lastThumb = value[value.length - 1];
38
- return [firstValue, lastThumb];
8
+ return [value[0], value[value.length - 1]];
39
9
  }
40
10
  function getRangeOffsets(params) {
41
- const { prop, computed } = params;
42
- const valuePercent = computed("valuePercent");
43
- const [firstPercent, lastPercent] = getBounds(valuePercent);
44
- if (valuePercent.length === 1) {
45
- if (prop("origin") === "center") {
46
- const isNegative = valuePercent[0] < 50;
47
- const start = isNegative ? `${valuePercent[0]}%` : "50%";
48
- const end = isNegative ? "50%" : `${100 - valuePercent[0]}%`;
49
- return { start, end };
50
- }
51
- if (prop("origin") === "end") {
52
- return { start: `${lastPercent}%`, end: "0%" };
53
- }
54
- return { start: "0%", end: `${100 - lastPercent}%` };
55
- }
56
- return { start: `${firstPercent}%`, end: `${100 - lastPercent}%` };
11
+ const { prop, computed } = params;
12
+ const valuePercent = computed("valuePercent");
13
+ const [firstPercent, lastPercent] = getBounds(valuePercent);
14
+ if (valuePercent.length === 1) {
15
+ if (prop("origin") === "center") {
16
+ const isNegative = valuePercent[0] < 50;
17
+ return {
18
+ start: isNegative ? `${valuePercent[0]}%` : "50%",
19
+ end: isNegative ? "50%" : `${100 - valuePercent[0]}%`
20
+ };
21
+ }
22
+ if (prop("origin") === "end") return {
23
+ start: `${lastPercent}%`,
24
+ end: "0%"
25
+ };
26
+ return {
27
+ start: "0%",
28
+ end: `${100 - lastPercent}%`
29
+ };
30
+ }
31
+ return {
32
+ start: `${firstPercent}%`,
33
+ end: `${100 - lastPercent}%`
34
+ };
57
35
  }
58
36
  function getRangeStyle(params) {
59
- const { computed } = params;
60
- const isVertical = computed("isVertical");
61
- const isRtl = computed("isRtl");
62
- if (isVertical) {
63
- return {
64
- position: "absolute",
65
- bottom: "var(--slider-range-start)",
66
- top: "var(--slider-range-end)"
67
- };
68
- }
69
- return {
70
- position: "absolute",
71
- [isRtl ? "right" : "left"]: "var(--slider-range-start)",
72
- [isRtl ? "left" : "right"]: "var(--slider-range-end)"
73
- };
37
+ const { computed } = params;
38
+ const isVertical = computed("isVertical");
39
+ const isRtl = computed("isRtl");
40
+ if (isVertical) return {
41
+ position: "absolute",
42
+ bottom: "var(--slider-range-start)",
43
+ top: "var(--slider-range-end)"
44
+ };
45
+ return {
46
+ position: "absolute",
47
+ [isRtl ? "right" : "left"]: "var(--slider-range-start)",
48
+ [isRtl ? "left" : "right"]: "var(--slider-range-end)"
49
+ };
74
50
  }
75
51
  function getVerticalThumbOffset(params, value) {
76
- const { context, prop } = params;
77
- const { height = 0 } = context.get("thumbSize") ?? {};
78
- const getValue = (0, import_utils.getValueTransformer)([prop("min"), prop("max")], [-height / 2, height / 2]);
79
- return parseFloat(getValue(value).toFixed(2));
52
+ const { context, prop } = params;
53
+ const { height = 0 } = context.get("thumbSize") ?? {};
54
+ const getValue = (0, _zag_js_utils.getValueTransformer)([prop("min"), prop("max")], [-height / 2, height / 2]);
55
+ return parseFloat(getValue(value).toFixed(2));
80
56
  }
81
57
  function getHorizontalThumbOffset(params, value) {
82
- const { computed, context, prop } = params;
83
- const { width = 0 } = context.get("thumbSize") ?? {};
84
- const isRtl = computed("isRtl");
85
- if (isRtl) {
86
- const getValue2 = (0, import_utils.getValueTransformer)([prop("max"), prop("min")], [-width / 2, width / 2]);
87
- return -1 * parseFloat(getValue2(value).toFixed(2));
88
- }
89
- const getValue = (0, import_utils.getValueTransformer)([prop("min"), prop("max")], [-width / 2, width / 2]);
90
- return parseFloat(getValue(value).toFixed(2));
58
+ const { computed, context, prop } = params;
59
+ const { width = 0 } = context.get("thumbSize") ?? {};
60
+ if (computed("isRtl")) {
61
+ const getValue = (0, _zag_js_utils.getValueTransformer)([prop("max"), prop("min")], [-width / 2, width / 2]);
62
+ return -1 * parseFloat(getValue(value).toFixed(2));
63
+ }
64
+ const getValue = (0, _zag_js_utils.getValueTransformer)([prop("min"), prop("max")], [-width / 2, width / 2]);
65
+ return parseFloat(getValue(value).toFixed(2));
91
66
  }
92
67
  function getOffset(params, percent, value) {
93
- const { computed, prop } = params;
94
- if (prop("thumbAlignment") === "center") return `${percent}%`;
95
- const offset = computed("isVertical") ? getVerticalThumbOffset(params, value) : getHorizontalThumbOffset(params, value);
96
- return `calc(${percent}% - ${offset}px)`;
68
+ const { computed, prop } = params;
69
+ if (prop("thumbAlignment") === "center") return `${percent}%`;
70
+ return `calc(${percent}% - ${computed("isVertical") ? getVerticalThumbOffset(params, value) : getHorizontalThumbOffset(params, value)}px)`;
97
71
  }
98
72
  function getThumbOffset(params, value) {
99
- const { prop } = params;
100
- const percent = (0, import_utils.getValuePercent)(value, prop("min"), prop("max")) * 100;
101
- return getOffset(params, percent, value);
73
+ const { prop } = params;
74
+ return getOffset(params, (0, _zag_js_utils.getValuePercent)(value, prop("min"), prop("max")) * 100, value);
102
75
  }
103
76
  function getVisibility(params) {
104
- const { computed, prop } = params;
105
- let visibility = "visible";
106
- if (prop("thumbAlignment") === "contain" && !computed("hasMeasuredThumbSize")) {
107
- visibility = "hidden";
108
- }
109
- return visibility;
77
+ const { computed, prop } = params;
78
+ let visibility = "visible";
79
+ if (prop("thumbAlignment") === "contain" && !computed("hasMeasuredThumbSize")) visibility = "hidden";
80
+ return visibility;
110
81
  }
111
82
  function getThumbStyle(params, index) {
112
- const { computed, context } = params;
113
- const placementProp = computed("isVertical") ? "bottom" : "insetInlineStart";
114
- const focusedIndex = context.get("focusedIndex");
115
- return {
116
- visibility: getVisibility(params),
117
- position: "absolute",
118
- transform: "var(--slider-thumb-transform)",
119
- [placementProp]: `var(--slider-thumb-offset-${index})`,
120
- zIndex: focusedIndex === index ? 1 : void 0
121
- };
83
+ const { computed, context } = params;
84
+ const placementProp = computed("isVertical") ? "bottom" : "insetInlineStart";
85
+ const focusedIndex = context.get("focusedIndex");
86
+ return {
87
+ visibility: getVisibility(params),
88
+ position: "absolute",
89
+ transform: "var(--slider-thumb-transform)",
90
+ [placementProp]: `var(--slider-thumb-offset-${index})`,
91
+ zIndex: focusedIndex === index ? 1 : void 0
92
+ };
122
93
  }
123
94
  function getControlStyle() {
124
- return {
125
- touchAction: "none",
126
- userSelect: "none",
127
- WebkitUserSelect: "none",
128
- position: "relative"
129
- };
95
+ return {
96
+ touchAction: "none",
97
+ userSelect: "none",
98
+ WebkitUserSelect: "none",
99
+ position: "relative"
100
+ };
130
101
  }
131
102
  function getRootStyle(params) {
132
- const { context, computed } = params;
133
- const isVertical = computed("isVertical");
134
- const isRtl = computed("isRtl");
135
- const range = getRangeOffsets(params);
136
- const thumbSize = context.get("thumbSize");
137
- const offsetStyles = context.get("value").reduce((styles, value, index) => {
138
- const offset = getThumbOffset(params, value);
139
- return { ...styles, [`--slider-thumb-offset-${index}`]: offset };
140
- }, {});
141
- return {
142
- ...offsetStyles,
143
- "--slider-thumb-width": (0, import_utils.toPx)(thumbSize?.width),
144
- "--slider-thumb-height": (0, import_utils.toPx)(thumbSize?.height),
145
- "--slider-thumb-transform": isVertical ? "translateY(50%)" : isRtl ? "translateX(50%)" : "translateX(-50%)",
146
- "--slider-range-start": range.start,
147
- "--slider-range-end": range.end
148
- };
103
+ const { context, computed } = params;
104
+ const isVertical = computed("isVertical");
105
+ const isRtl = computed("isRtl");
106
+ const range = getRangeOffsets(params);
107
+ const thumbSize = context.get("thumbSize");
108
+ return {
109
+ ...context.get("value").reduce((styles, value, index) => {
110
+ const offset = getThumbOffset(params, value);
111
+ return {
112
+ ...styles,
113
+ [`--slider-thumb-offset-${index}`]: offset
114
+ };
115
+ }, {}),
116
+ "--slider-thumb-width": (0, _zag_js_utils.toPx)(thumbSize?.width),
117
+ "--slider-thumb-height": (0, _zag_js_utils.toPx)(thumbSize?.height),
118
+ "--slider-thumb-transform": isVertical ? "translateY(50%)" : isRtl ? "translateX(50%)" : "translateX(-50%)",
119
+ "--slider-range-start": range.start,
120
+ "--slider-range-end": range.end
121
+ };
149
122
  }
150
123
  function getMarkerStyle(params, value) {
151
- const { computed } = params;
152
- const isHorizontal = computed("isHorizontal");
153
- const isRtl = computed("isRtl");
154
- return {
155
- visibility: getVisibility(params),
156
- position: "absolute",
157
- pointerEvents: "none",
158
- [isHorizontal ? "insetInlineStart" : "bottom"]: getThumbOffset(params, value),
159
- translate: "var(--translate-x) var(--translate-y)",
160
- "--translate-x": isHorizontal ? isRtl ? "50%" : "-50%" : "0%",
161
- "--translate-y": !isHorizontal ? "50%" : "0%"
162
- };
124
+ const { computed } = params;
125
+ const isHorizontal = computed("isHorizontal");
126
+ const isRtl = computed("isRtl");
127
+ return {
128
+ visibility: getVisibility(params),
129
+ position: "absolute",
130
+ pointerEvents: "none",
131
+ [isHorizontal ? "insetInlineStart" : "bottom"]: getThumbOffset(params, value),
132
+ translate: "var(--translate-x) var(--translate-y)",
133
+ "--translate-x": isHorizontal ? isRtl ? "50%" : "-50%" : "0%",
134
+ "--translate-y": !isHorizontal ? "50%" : "0%"
135
+ };
163
136
  }
164
137
  function getMarkerGroupStyle() {
165
- return {
166
- userSelect: "none",
167
- WebkitUserSelect: "none",
168
- pointerEvents: "none",
169
- position: "relative"
170
- };
138
+ return {
139
+ userSelect: "none",
140
+ WebkitUserSelect: "none",
141
+ pointerEvents: "none",
142
+ position: "relative"
143
+ };
171
144
  }
172
- // Annotate the CommonJS export names for ESM import in node:
173
- 0 && (module.exports = {
174
- getControlStyle,
175
- getMarkerGroupStyle,
176
- getMarkerStyle,
177
- getRangeOffsets,
178
- getRangeStyle,
179
- getRootStyle,
180
- getThumbOffset,
181
- getThumbStyle,
182
- getVisibility
183
- });
145
+ exports.getControlStyle = getControlStyle;
146
+ exports.getMarkerGroupStyle = getMarkerGroupStyle;
147
+ exports.getMarkerStyle = getMarkerStyle;
148
+ exports.getRangeOffsets = getRangeOffsets;
149
+ exports.getRangeStyle = getRangeStyle;
150
+ exports.getRootStyle = getRootStyle;
151
+ exports.getThumbOffset = getThumbOffset;
152
+ exports.getThumbStyle = getThumbStyle;
153
+ exports.getVisibility = getVisibility;