@zag-js/slider 0.2.0 → 0.2.1
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.d.ts +1 -1
- package/dist/index.js +15 -1
- package/dist/index.mjs +15 -1
- package/package.json +3 -2
package/dist/index.d.ts
CHANGED
|
@@ -227,6 +227,6 @@ declare function connect<T extends PropTypes>(state: State, send: Send, normaliz
|
|
|
227
227
|
}): T["element"];
|
|
228
228
|
};
|
|
229
229
|
|
|
230
|
-
declare function machine(
|
|
230
|
+
declare function machine(userContext: UserDefinedContext): _zag_js_core.Machine<MachineContext, MachineState, _zag_js_core.StateMachine.AnyEventObject>;
|
|
231
231
|
|
|
232
232
|
export { UserDefinedContext as Context, connect, machine, dom as unstable__dom };
|
package/dist/index.js
CHANGED
|
@@ -868,7 +868,21 @@ function connect(state2, send, normalize) {
|
|
|
868
868
|
// src/slider.machine.ts
|
|
869
869
|
var import_core = require("@zag-js/core");
|
|
870
870
|
var import_element_size = require("@zag-js/element-size");
|
|
871
|
-
|
|
871
|
+
|
|
872
|
+
// ../../utilities/core/dist/index.mjs
|
|
873
|
+
var isArray2 = (v) => Array.isArray(v);
|
|
874
|
+
var isObject2 = (v) => !(v == null || typeof v !== "object" || isArray2(v));
|
|
875
|
+
function compact(obj) {
|
|
876
|
+
if (obj === void 0)
|
|
877
|
+
return obj;
|
|
878
|
+
return Object.fromEntries(
|
|
879
|
+
Object.entries(obj).filter(([, value]) => value !== void 0).map(([key, value]) => [key, isObject2(value) ? compact(value) : value])
|
|
880
|
+
);
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
// src/slider.machine.ts
|
|
884
|
+
function machine(userContext) {
|
|
885
|
+
const ctx = compact(userContext);
|
|
872
886
|
return (0, import_core.createMachine)(
|
|
873
887
|
{
|
|
874
888
|
id: "slider",
|
package/dist/index.mjs
CHANGED
|
@@ -840,7 +840,21 @@ function connect(state2, send, normalize) {
|
|
|
840
840
|
// src/slider.machine.ts
|
|
841
841
|
import { createMachine } from "@zag-js/core";
|
|
842
842
|
import { trackElementSize } from "@zag-js/element-size";
|
|
843
|
-
|
|
843
|
+
|
|
844
|
+
// ../../utilities/core/dist/index.mjs
|
|
845
|
+
var isArray2 = (v) => Array.isArray(v);
|
|
846
|
+
var isObject2 = (v) => !(v == null || typeof v !== "object" || isArray2(v));
|
|
847
|
+
function compact(obj) {
|
|
848
|
+
if (obj === void 0)
|
|
849
|
+
return obj;
|
|
850
|
+
return Object.fromEntries(
|
|
851
|
+
Object.entries(obj).filter(([, value]) => value !== void 0).map(([key, value]) => [key, isObject2(value) ? compact(value) : value])
|
|
852
|
+
);
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
// src/slider.machine.ts
|
|
856
|
+
function machine(userContext) {
|
|
857
|
+
const ctx = compact(userContext);
|
|
844
858
|
return createMachine(
|
|
845
859
|
{
|
|
846
860
|
id: "slider",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zag-js/slider",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Core logic for the slider widget implemented as a state machine",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -29,13 +29,14 @@
|
|
|
29
29
|
"url": "https://github.com/chakra-ui/zag/issues"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@zag-js/core": "0.2.
|
|
32
|
+
"@zag-js/core": "0.2.1",
|
|
33
33
|
"@zag-js/element-size": "0.3.0",
|
|
34
34
|
"@zag-js/types": "0.3.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@zag-js/dom-utils": "0.2.0",
|
|
38
38
|
"@zag-js/form-utils": "0.2.0",
|
|
39
|
+
"@zag-js/utils": "0.3.0",
|
|
39
40
|
"@zag-js/number-utils": "0.2.0"
|
|
40
41
|
},
|
|
41
42
|
"scripts": {
|