@zag-js/slider 0.5.0 → 0.7.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.
@@ -12,7 +12,7 @@ var dom = createScope({
12
12
  getRootId: (ctx) => ctx.ids?.root ?? `slider:${ctx.id}`,
13
13
  getThumbId: (ctx) => ctx.ids?.thumb ?? `slider:${ctx.id}:thumb`,
14
14
  getControlId: (ctx) => ctx.ids?.control ?? `slider:${ctx.id}:control`,
15
- getHiddenInputId: (ctx) => `slider:${ctx.id}:input`,
15
+ getHiddenInputId: (ctx) => ctx.ids?.hiddenInput ?? `slider:${ctx.id}:input`,
16
16
  getOutputId: (ctx) => ctx.ids?.output ?? `slider:${ctx.id}:output`,
17
17
  getTrackId: (ctx) => ctx.ids?.track ?? `slider:${ctx.id}track`,
18
18
  getRangeId: (ctx) => ctx.ids?.track ?? `slider:${ctx.id}:range`,
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-3Y7IIPR5.mjs";
4
4
  import {
5
5
  dom
6
- } from "./chunk-5CWNUPC7.mjs";
6
+ } from "./chunk-QSGM24KV.mjs";
7
7
 
8
8
  // src/slider.connect.ts
9
9
  import { getEventKey, getEventStep, getNativeEvent, isLeftClick, isModifiedEvent } from "@zag-js/dom-event";
@@ -241,9 +241,9 @@ function connect(state, send, normalize) {
241
241
  const markerState = value > state.context.value ? "over-value" : value < state.context.value ? "under-value" : "at-value";
242
242
  return normalize.element({
243
243
  ...parts.marker.attrs,
244
+ id: dom.getMarkerId(state.context, value),
244
245
  role: "presentation",
245
246
  "data-orientation": state.context.orientation,
246
- id: dom.getMarkerId(state.context, value),
247
247
  "data-value": value,
248
248
  "data-disabled": dataAttr(isDisabled),
249
249
  "data-state": markerState,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  dom
3
- } from "./chunk-5CWNUPC7.mjs";
3
+ } from "./chunk-QSGM24KV.mjs";
4
4
  import {
5
5
  constrainValue,
6
6
  decrement,
package/dist/index.js CHANGED
@@ -172,7 +172,7 @@ var dom = (0, import_dom_query.createScope)({
172
172
  getRootId: (ctx) => ctx.ids?.root ?? `slider:${ctx.id}`,
173
173
  getThumbId: (ctx) => ctx.ids?.thumb ?? `slider:${ctx.id}:thumb`,
174
174
  getControlId: (ctx) => ctx.ids?.control ?? `slider:${ctx.id}:control`,
175
- getHiddenInputId: (ctx) => `slider:${ctx.id}:input`,
175
+ getHiddenInputId: (ctx) => ctx.ids?.hiddenInput ?? `slider:${ctx.id}:input`,
176
176
  getOutputId: (ctx) => ctx.ids?.output ?? `slider:${ctx.id}:output`,
177
177
  getTrackId: (ctx) => ctx.ids?.track ?? `slider:${ctx.id}track`,
178
178
  getRangeId: (ctx) => ctx.ids?.track ?? `slider:${ctx.id}:range`,
@@ -438,9 +438,9 @@ function connect(state, send, normalize) {
438
438
  const markerState = value > state.context.value ? "over-value" : value < state.context.value ? "under-value" : "at-value";
439
439
  return normalize.element({
440
440
  ...parts.marker.attrs,
441
+ id: dom.getMarkerId(state.context, value),
441
442
  role: "presentation",
442
443
  "data-orientation": state.context.orientation,
443
- id: dom.getMarkerId(state.context, value),
444
444
  "data-value": value,
445
445
  "data-disabled": (0, import_dom_query2.dataAttr)(isDisabled),
446
446
  "data-state": markerState,
package/dist/index.mjs CHANGED
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  connect
3
- } from "./chunk-XHNKYJMN.mjs";
3
+ } from "./chunk-RALQPAZH.mjs";
4
4
  import {
5
5
  anatomy
6
6
  } from "./chunk-3Y7IIPR5.mjs";
7
7
  import {
8
8
  machine
9
- } from "./chunk-VTUEW45P.mjs";
9
+ } from "./chunk-SG722B5B.mjs";
10
10
  import {
11
11
  dom
12
- } from "./chunk-5CWNUPC7.mjs";
12
+ } from "./chunk-QSGM24KV.mjs";
13
13
  import "./chunk-IJAAAKZQ.mjs";
14
14
  import "./chunk-YGFSMEUO.mjs";
15
15
  export {
@@ -167,7 +167,7 @@ var dom = (0, import_dom_query.createScope)({
167
167
  getRootId: (ctx) => ctx.ids?.root ?? `slider:${ctx.id}`,
168
168
  getThumbId: (ctx) => ctx.ids?.thumb ?? `slider:${ctx.id}:thumb`,
169
169
  getControlId: (ctx) => ctx.ids?.control ?? `slider:${ctx.id}:control`,
170
- getHiddenInputId: (ctx) => `slider:${ctx.id}:input`,
170
+ getHiddenInputId: (ctx) => ctx.ids?.hiddenInput ?? `slider:${ctx.id}:input`,
171
171
  getOutputId: (ctx) => ctx.ids?.output ?? `slider:${ctx.id}:output`,
172
172
  getTrackId: (ctx) => ctx.ids?.track ?? `slider:${ctx.id}track`,
173
173
  getRangeId: (ctx) => ctx.ids?.track ?? `slider:${ctx.id}:range`,
@@ -433,9 +433,9 @@ function connect(state, send, normalize) {
433
433
  const markerState = value > state.context.value ? "over-value" : value < state.context.value ? "under-value" : "at-value";
434
434
  return normalize.element({
435
435
  ...parts.marker.attrs,
436
+ id: dom.getMarkerId(state.context, value),
436
437
  role: "presentation",
437
438
  "data-orientation": state.context.orientation,
438
- id: dom.getMarkerId(state.context, value),
439
439
  "data-value": value,
440
440
  "data-disabled": (0, import_dom_query2.dataAttr)(isDisabled),
441
441
  "data-state": markerState,
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  connect
3
- } from "./chunk-XHNKYJMN.mjs";
3
+ } from "./chunk-RALQPAZH.mjs";
4
4
  import "./chunk-3Y7IIPR5.mjs";
5
- import "./chunk-5CWNUPC7.mjs";
5
+ import "./chunk-QSGM24KV.mjs";
6
6
  import "./chunk-IJAAAKZQ.mjs";
7
7
  export {
8
8
  connect
@@ -146,7 +146,7 @@ var dom = (0, import_dom_query.createScope)({
146
146
  getRootId: (ctx) => ctx.ids?.root ?? `slider:${ctx.id}`,
147
147
  getThumbId: (ctx) => ctx.ids?.thumb ?? `slider:${ctx.id}:thumb`,
148
148
  getControlId: (ctx) => ctx.ids?.control ?? `slider:${ctx.id}:control`,
149
- getHiddenInputId: (ctx) => `slider:${ctx.id}:input`,
149
+ getHiddenInputId: (ctx) => ctx.ids?.hiddenInput ?? `slider:${ctx.id}:input`,
150
150
  getOutputId: (ctx) => ctx.ids?.output ?? `slider:${ctx.id}:output`,
151
151
  getTrackId: (ctx) => ctx.ids?.track ?? `slider:${ctx.id}track`,
152
152
  getRangeId: (ctx) => ctx.ids?.track ?? `slider:${ctx.id}:range`,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  dom
3
- } from "./chunk-5CWNUPC7.mjs";
3
+ } from "./chunk-QSGM24KV.mjs";
4
4
  import "./chunk-IJAAAKZQ.mjs";
5
5
  export {
6
6
  dom
@@ -155,7 +155,7 @@ var dom = (0, import_dom_query.createScope)({
155
155
  getRootId: (ctx) => ctx.ids?.root ?? `slider:${ctx.id}`,
156
156
  getThumbId: (ctx) => ctx.ids?.thumb ?? `slider:${ctx.id}:thumb`,
157
157
  getControlId: (ctx) => ctx.ids?.control ?? `slider:${ctx.id}:control`,
158
- getHiddenInputId: (ctx) => `slider:${ctx.id}:input`,
158
+ getHiddenInputId: (ctx) => ctx.ids?.hiddenInput ?? `slider:${ctx.id}:input`,
159
159
  getOutputId: (ctx) => ctx.ids?.output ?? `slider:${ctx.id}:output`,
160
160
  getTrackId: (ctx) => ctx.ids?.track ?? `slider:${ctx.id}track`,
161
161
  getRangeId: (ctx) => ctx.ids?.track ?? `slider:${ctx.id}:range`,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  machine
3
- } from "./chunk-VTUEW45P.mjs";
4
- import "./chunk-5CWNUPC7.mjs";
3
+ } from "./chunk-SG722B5B.mjs";
4
+ import "./chunk-QSGM24KV.mjs";
5
5
  import "./chunk-IJAAAKZQ.mjs";
6
6
  import "./chunk-YGFSMEUO.mjs";
7
7
  export {
@@ -9,6 +9,7 @@ type ElementIds = Partial<{
9
9
  range: string;
10
10
  label: string;
11
11
  output: string;
12
+ hiddenInput: string;
12
13
  }>;
13
14
  type PublicContext = DirectionProperty & CommonProperties & {
14
15
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zag-js/slider",
3
- "version": "0.5.0",
3
+ "version": "0.7.0",
4
4
  "description": "Core logic for the slider widget implemented as a state machine",
5
5
  "keywords": [
6
6
  "js",
@@ -27,9 +27,9 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@zag-js/anatomy": "0.1.4",
30
- "@zag-js/core": "0.5.0",
30
+ "@zag-js/core": "0.7.0",
31
31
  "@zag-js/dom-query": "0.1.4",
32
- "@zag-js/dom-event": "0.5.0",
32
+ "@zag-js/dom-event": "0.6.0",
33
33
  "@zag-js/form-utils": "0.2.5",
34
34
  "@zag-js/utils": "0.3.4",
35
35
  "@zag-js/element-size": "0.3.2",