@zag-js/slider 1.22.0 → 1.23.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.
package/dist/index.js CHANGED
@@ -615,9 +615,10 @@ var machine = core.createMachine({
615
615
  isDisabled: ({ context, prop }) => !!prop("disabled") || context.get("fieldsetDisabled"),
616
616
  isInteractive: ({ prop, computed }) => !(prop("readOnly") || computed("isDisabled")),
617
617
  hasMeasuredThumbSize: ({ context }) => context.get("thumbSize") != null,
618
- valuePercent({ context, prop }) {
619
- return context.get("value").map((value) => 100 * utils.getValuePercent(value, prop("min"), prop("max")));
620
- }
618
+ valuePercent: core.memo(
619
+ ({ context, prop }) => [context.get("value"), prop("min"), prop("max")],
620
+ ([value, min, max]) => value.map((value2) => 100 * utils.getValuePercent(value2, min, max))
621
+ )
621
622
  },
622
623
  watch({ track, action, context }) {
623
624
  track([() => context.hash("value")], () => {
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { createAnatomy } from '@zag-js/anatomy';
2
2
  import { raf, setElementValue, trackElementRect, queryAll, trackPointerMove, trackFormControl, getRelativePoint, dispatchInputValueEvent, dataAttr, isLeftClick, isModifierKey, getEventPoint, ariaAttr, getEventStep, getEventKey } from '@zag-js/dom-query';
3
3
  import { setValueAtIndex, pick, getValuePercent, isEqual, createSplitProps, snapValueToStep, clampValue, getValueRanges, getNextStepValue, getPreviousStepValue, getPercentValue, getClosestValueIndex, isValueWithinRange, first, last, toPx, getValueTransformer } from '@zag-js/utils';
4
- import { createMachine } from '@zag-js/core';
4
+ import { createMachine, memo } from '@zag-js/core';
5
5
  import { createProps } from '@zag-js/types';
6
6
 
7
7
  // src/slider.anatomy.ts
@@ -613,9 +613,10 @@ var machine = createMachine({
613
613
  isDisabled: ({ context, prop }) => !!prop("disabled") || context.get("fieldsetDisabled"),
614
614
  isInteractive: ({ prop, computed }) => !(prop("readOnly") || computed("isDisabled")),
615
615
  hasMeasuredThumbSize: ({ context }) => context.get("thumbSize") != null,
616
- valuePercent({ context, prop }) {
617
- return context.get("value").map((value) => 100 * getValuePercent(value, prop("min"), prop("max")));
618
- }
616
+ valuePercent: memo(
617
+ ({ context, prop }) => [context.get("value"), prop("min"), prop("max")],
618
+ ([value, min, max]) => value.map((value2) => 100 * getValuePercent(value2, min, max))
619
+ )
619
620
  },
620
621
  watch({ track, action, context }) {
621
622
  track([() => context.hash("value")], () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zag-js/slider",
3
- "version": "1.22.0",
3
+ "version": "1.23.0",
4
4
  "description": "Core logic for the slider widget implemented as a state machine",
5
5
  "keywords": [
6
6
  "js",
@@ -27,11 +27,11 @@
27
27
  "url": "https://github.com/chakra-ui/zag/issues"
28
28
  },
29
29
  "dependencies": {
30
- "@zag-js/anatomy": "1.22.0",
31
- "@zag-js/core": "1.22.0",
32
- "@zag-js/dom-query": "1.22.0",
33
- "@zag-js/utils": "1.22.0",
34
- "@zag-js/types": "1.22.0"
30
+ "@zag-js/anatomy": "1.23.0",
31
+ "@zag-js/core": "1.23.0",
32
+ "@zag-js/dom-query": "1.23.0",
33
+ "@zag-js/utils": "1.23.0",
34
+ "@zag-js/types": "1.23.0"
35
35
  },
36
36
  "devDependencies": {
37
37
  "clean-package": "2.2.0"