@zag-js/slider 1.48.0 → 1.49.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,3 +1,3 @@
1
- import { SliderApi, SliderService } from "./slider.types.mjs";
2
1
  import { NormalizeProps, PropTypes } from "@zag-js/types";
2
+ import { SliderApi, SliderService } from "./slider.types.mjs";
3
3
  export declare function connect<T extends PropTypes>(service: SliderService, normalize: NormalizeProps<T>): SliderApi<T>;
@@ -1,3 +1,3 @@
1
- import { SliderApi, SliderService } from "./slider.types.js";
2
1
  import { NormalizeProps, PropTypes } from "@zag-js/types";
2
+ import { SliderApi, SliderService } from "./slider.types.js";
3
3
  export declare function connect<T extends PropTypes>(service: SliderService, normalize: NormalizeProps<T>): SliderApi<T>;
@@ -2,12 +2,12 @@ Object.defineProperties(exports, {
2
2
  __esModule: { value: true },
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
+ let _zag_js_dom_query = require("@zag-js/dom-query");
6
+ let _zag_js_utils = require("@zag-js/utils");
5
7
  const require_slider_anatomy = require("./slider.anatomy.js");
6
8
  const require_slider_dom = require("./slider.dom.js");
7
9
  const require_slider_style = require("./slider.style.js");
8
10
  const require_slider_utils = require("./slider.utils.js");
9
- let _zag_js_dom_query = require("@zag-js/dom-query");
10
- let _zag_js_utils = require("@zag-js/utils");
11
11
  // src/slider.connect.ts
12
12
  function connect(service, normalize) {
13
13
  const { state, send, context, prop, computed, scope } = service;
@@ -1,9 +1,9 @@
1
+ import { ariaAttr, dataAttr, getEventKey, getEventPoint, getEventStepValue, isLeftClick, isModifierKey } from "@zag-js/dom-query";
2
+ import { first, getPercentValue, getValuePercent, last } from "@zag-js/utils";
1
3
  import { parts } from "./slider.anatomy.mjs";
2
4
  import { getControlId, getFirstThumbEl, getHiddenInputId, getLabelId, getMarkerId, getRangeId, getRootId, getThumbId, getTrackId, getValueTextId } from "./slider.dom.mjs";
3
5
  import { getControlStyle, getMarkerGroupStyle, getMarkerStyle, getRangeStyle, getRootStyle, getThumbStyle } from "./slider.style.mjs";
4
6
  import { getRangeAtIndex } from "./slider.utils.mjs";
5
- import { ariaAttr, dataAttr, getEventKey, getEventPoint, getEventStepValue, isLeftClick, isModifierKey } from "@zag-js/dom-query";
6
- import { first, getPercentValue, getValuePercent, last } from "@zag-js/utils";
7
7
  // src/slider.connect.ts
8
8
  function connect(service, normalize) {
9
9
  const { state, send, context, prop, computed, scope } = service;
@@ -1,6 +1,6 @@
1
- import { SliderSchema } from "./slider.types.mjs";
2
1
  import { Params, Scope } from "@zag-js/core";
3
2
  import { Point } from "@zag-js/types";
3
+ import { SliderSchema } from "./slider.types.mjs";
4
4
  export declare const getRootId: (ctx: Scope) => any;
5
5
  export declare const getThumbId: (ctx: Scope, index: number) => any;
6
6
  export declare const getHiddenInputId: (ctx: Scope, index: number) => any;
@@ -1,6 +1,6 @@
1
- import { SliderSchema } from "./slider.types.js";
2
- import { Point } from "@zag-js/types";
3
1
  import { Params, Scope } from "@zag-js/core";
2
+ import { Point } from "@zag-js/types";
3
+ import { SliderSchema } from "./slider.types.js";
4
4
  export declare const getRootId: (ctx: Scope) => any;
5
5
  export declare const getThumbId: (ctx: Scope, index: number) => any;
6
6
  export declare const getHiddenInputId: (ctx: Scope, index: number) => any;
@@ -2,11 +2,11 @@ Object.defineProperties(exports, {
2
2
  __esModule: { value: true },
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
- const require_slider_dom = require("./slider.dom.js");
6
- const require_slider_utils = require("./slider.utils.js");
5
+ let _zag_js_core = require("@zag-js/core");
7
6
  let _zag_js_dom_query = require("@zag-js/dom-query");
8
7
  let _zag_js_utils = require("@zag-js/utils");
9
- let _zag_js_core = require("@zag-js/core");
8
+ const require_slider_dom = require("./slider.dom.js");
9
+ const require_slider_utils = require("./slider.utils.js");
10
10
  // src/slider.machine.ts
11
11
  const isEqualSize = (a, b) => {
12
12
  return a?.width === b?.width && a?.height === b?.height;
@@ -1,8 +1,8 @@
1
- import { dispatchChangeEvent, getHiddenInputEl, getOffsetRect, getPointValue, getRootEl, getThumbEl, getThumbEls } from "./slider.dom.mjs";
2
- import { constrainValue, decrement, getClosestIndex, getRangeAtIndex, increment, normalizeValues, resolveThumbCollision, selectMovableThumb } from "./slider.utils.mjs";
1
+ import { createMachine, memo } from "@zag-js/core";
3
2
  import { raf, resizeObserverBorderBox, setElementValue, trackFormControl, trackPointerMove } from "@zag-js/dom-query";
4
3
  import { callAll, clampValue, getValuePercent, getValueRanges, isEqual, isValueWithinRange, pick, setValueAtIndex, snapValueToStep } from "@zag-js/utils";
5
- import { createMachine, memo } from "@zag-js/core";
4
+ import { dispatchChangeEvent, getHiddenInputEl, getOffsetRect, getPointValue, getRootEl, getThumbEl, getThumbEls } from "./slider.dom.mjs";
5
+ import { constrainValue, decrement, getClosestIndex, getRangeAtIndex, increment, normalizeValues, resolveThumbCollision, selectMovableThumb } from "./slider.utils.mjs";
6
6
  // src/slider.machine.ts
7
7
  const isEqualSize = (a, b) => {
8
8
  return a?.width === b?.width && a?.height === b?.height;
@@ -2,8 +2,8 @@ Object.defineProperties(exports, {
2
2
  __esModule: { value: true },
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
- let _zag_js_utils = require("@zag-js/utils");
6
5
  let _zag_js_types = require("@zag-js/types");
6
+ let _zag_js_utils = require("@zag-js/utils");
7
7
  // src/slider.props.ts
8
8
  const props = (0, _zag_js_types.createProps)()([
9
9
  "aria-label",
@@ -1,5 +1,5 @@
1
- import { createSplitProps } from "@zag-js/utils";
2
1
  import { createProps } from "@zag-js/types";
2
+ import { createSplitProps } from "@zag-js/utils";
3
3
  // src/slider.props.ts
4
4
  const props = createProps()([
5
5
  "aria-label",
@@ -1,6 +1,6 @@
1
- import { SliderSchema } from "./slider.types.mjs";
2
1
  import { Params } from "@zag-js/core";
3
2
  import { Style } from "@zag-js/types";
3
+ import { SliderSchema } from "./slider.types.mjs";
4
4
  type Ctx = Params<SliderSchema>;
5
5
  export declare function getRangeOffsets(params: Pick<Ctx, "prop" | "computed">): {
6
6
  start: string;
@@ -1,6 +1,6 @@
1
- import { SliderSchema } from "./slider.types.js";
2
- import { Style } from "@zag-js/types";
3
1
  import { Params } from "@zag-js/core";
2
+ import { Style } from "@zag-js/types";
3
+ import { SliderSchema } from "./slider.types.js";
4
4
  type Ctx = Params<SliderSchema>;
5
5
  export declare function getRangeOffsets(params: Pick<Ctx, "prop" | "computed">): {
6
6
  start: string;
@@ -1,5 +1,5 @@
1
- import { CommonProperties, DirectionProperty, PropTypes, RequiredBy } from "@zag-js/types";
2
1
  import { EventObject, Machine, Service } from "@zag-js/core";
2
+ import { CommonProperties, DirectionProperty, PropTypes, RequiredBy } from "@zag-js/types";
3
3
  export type ThumbCollisionBehavior = "none" | "push" | "swap";
4
4
  export type ThumbAlignment = "contain" | "center";
5
5
  export interface ValueChangeDetails {
@@ -1,5 +1,5 @@
1
- import { SliderSchema, ThumbCollisionBehavior } from "./slider.types.mjs";
2
1
  import { Params } from "@zag-js/core";
2
+ import { SliderSchema, ThumbCollisionBehavior } from "./slider.types.mjs";
3
3
  type Ctx = Params<SliderSchema>;
4
4
  interface ThumbCollisionResult {
5
5
  values: number[];
@@ -1,5 +1,5 @@
1
- import { SliderSchema, ThumbCollisionBehavior } from "./slider.types.js";
2
1
  import { Params } from "@zag-js/core";
2
+ import { SliderSchema, ThumbCollisionBehavior } from "./slider.types.js";
3
3
  type Ctx = Params<SliderSchema>;
4
4
  interface ThumbCollisionResult {
5
5
  values: number[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zag-js/slider",
3
- "version": "1.48.0",
3
+ "version": "1.49.0",
4
4
  "description": "Core logic for the slider widget implemented as a state machine",
5
5
  "keywords": [
6
6
  "js",
@@ -30,11 +30,11 @@
30
30
  "url": "https://github.com/chakra-ui/zag/issues"
31
31
  },
32
32
  "dependencies": {
33
- "@zag-js/anatomy": "1.48.0",
34
- "@zag-js/core": "1.48.0",
35
- "@zag-js/dom-query": "1.48.0",
36
- "@zag-js/utils": "1.48.0",
37
- "@zag-js/types": "1.48.0"
33
+ "@zag-js/anatomy": "1.49.0",
34
+ "@zag-js/core": "1.49.0",
35
+ "@zag-js/dom-query": "1.49.0",
36
+ "@zag-js/utils": "1.49.0",
37
+ "@zag-js/types": "1.49.0"
38
38
  },
39
39
  "devDependencies": {
40
40
  "clean-package": "2.2.0"