@zag-js/number-input 1.46.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.
Files changed (41) hide show
  1. package/dist/cursor.d.mts +8 -10
  2. package/dist/cursor.d.ts +8 -10
  3. package/dist/cursor.js +65 -104
  4. package/dist/cursor.mjs +59 -77
  5. package/dist/index.d.mts +6 -9
  6. package/dist/index.d.ts +6 -9
  7. package/dist/index.js +12 -38
  8. package/dist/index.mjs +2 -7
  9. package/dist/number-input.anatomy.d.mts +2 -6
  10. package/dist/number-input.anatomy.d.ts +2 -6
  11. package/dist/number-input.anatomy.js +8 -42
  12. package/dist/number-input.anatomy.mjs +4 -16
  13. package/dist/number-input.connect.d.mts +3 -8
  14. package/dist/number-input.connect.d.ts +3 -8
  15. package/dist/number-input.connect.js +310 -310
  16. package/dist/number-input.connect.mjs +304 -284
  17. package/dist/number-input.dom.d.mts +28 -32
  18. package/dist/number-input.dom.d.ts +28 -32
  19. package/dist/number-input.dom.js +96 -138
  20. package/dist/number-input.dom.mjs +76 -97
  21. package/dist/number-input.machine.d.mts +2 -8
  22. package/dist/number-input.machine.d.ts +2 -8
  23. package/dist/number-input.machine.js +484 -460
  24. package/dist/number-input.machine.mjs +478 -440
  25. package/dist/number-input.props.d.mts +3 -9
  26. package/dist/number-input.props.d.ts +3 -9
  27. package/dist/number-input.props.js +40 -65
  28. package/dist/number-input.props.mjs +36 -39
  29. package/dist/number-input.translations.d.mts +3 -8
  30. package/dist/number-input.translations.d.ts +3 -8
  31. package/dist/number-input.translations.js +8 -31
  32. package/dist/number-input.translations.mjs +4 -6
  33. package/dist/number-input.types.d.mts +298 -300
  34. package/dist/number-input.types.d.ts +298 -300
  35. package/dist/number-input.types.js +4 -18
  36. package/dist/number-input.types.mjs +1 -0
  37. package/dist/number-input.utils.d.mts +9 -12
  38. package/dist/number-input.utils.d.ts +9 -12
  39. package/dist/number-input.utils.js +28 -57
  40. package/dist/number-input.utils.mjs +20 -28
  41. package/package.json +8 -8
@@ -1,13 +1,10 @@
1
- import { NumberParser } from '@internationalized/number';
2
- import { Params } from '@zag-js/core';
3
- import { NumberInputSchema } from './number-input.types.js';
4
- import '@zag-js/types';
5
-
6
- declare const createFormatter: (locale: string, options?: Intl.NumberFormatOptions) => Intl.NumberFormat;
7
- declare const createParser: (locale: string, options?: Intl.NumberFormatOptions) => NumberParser;
1
+ import { NumberInputSchema } from "./number-input.types.js";
2
+ import { Params } from "@zag-js/core";
3
+ import { NumberParser } from "@internationalized/number";
4
+ export declare const createFormatter: (locale: string, options?: Intl.NumberFormatOptions) => Intl.NumberFormat;
5
+ export declare const createParser: (locale: string, options?: Intl.NumberFormatOptions) => NumberParser;
8
6
  type Ctx = Pick<Params<NumberInputSchema>, "prop" | "computed">;
9
- declare const parseValue: (value: string, params: Ctx) => number;
10
- declare const formatValue: (value: number, params: Ctx) => string;
11
- declare const getDefaultStep: (step: number | undefined, formatOptions: Intl.NumberFormatOptions | undefined) => number;
12
-
13
- export { createFormatter, createParser, formatValue, getDefaultStep, parseValue };
7
+ export declare const parseValue: (value: string, params: Ctx) => number;
8
+ export declare const formatValue: (value: number, params: Ctx) => string;
9
+ export declare const getDefaultStep: (step: number | undefined, formatOptions: Intl.NumberFormatOptions | undefined) => number;
10
+ export {};
@@ -1,63 +1,34 @@
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/number-input.utils.ts
21
- var number_input_utils_exports = {};
22
- __export(number_input_utils_exports, {
23
- createFormatter: () => createFormatter,
24
- createParser: () => createParser,
25
- formatValue: () => formatValue,
26
- getDefaultStep: () => getDefaultStep,
27
- parseValue: () => parseValue
1
+ Object.defineProperties(exports, {
2
+ __esModule: { value: true },
3
+ [Symbol.toStringTag]: { value: "Module" }
28
4
  });
29
- module.exports = __toCommonJS(number_input_utils_exports);
30
- var import_number = require("@internationalized/number");
31
- var createFormatter = (locale, options = {}) => {
32
- return new Intl.NumberFormat(locale, options);
5
+ let _internationalized_number = require("@internationalized/number");
6
+ // src/number-input.utils.ts
7
+ const createFormatter = (locale, options = {}) => {
8
+ return new Intl.NumberFormat(locale, options);
33
9
  };
34
- var createParser = (locale, options = {}) => {
35
- return new import_number.NumberParser(locale, options);
10
+ const createParser = (locale, options = {}) => {
11
+ return new _internationalized_number.NumberParser(locale, options);
36
12
  };
37
- var parseValue = (value, params) => {
38
- const { prop, computed } = params;
39
- if (!prop("formatOptions")) return parseFloat(value);
40
- if (value === "") return Number.NaN;
41
- return computed("parser").parse(value);
13
+ const parseValue = (value, params) => {
14
+ const { prop, computed } = params;
15
+ if (!prop("formatOptions")) return parseFloat(value);
16
+ if (value === "") return NaN;
17
+ return computed("parser").parse(value);
42
18
  };
43
- var formatValue = (value, params) => {
44
- const { prop, computed } = params;
45
- if (Number.isNaN(value)) return "";
46
- if (!prop("formatOptions")) return value.toString();
47
- return computed("formatter").format(value);
19
+ const formatValue = (value, params) => {
20
+ const { prop, computed } = params;
21
+ if (Number.isNaN(value)) return "";
22
+ if (!prop("formatOptions")) return value.toString();
23
+ return computed("formatter").format(value);
48
24
  };
49
- var getDefaultStep = (step, formatOptions) => {
50
- let defaultStep = step !== void 0 && !Number.isNaN(step) ? step : 1;
51
- if (formatOptions?.style === "percent" && (step === void 0 || Number.isNaN(step))) {
52
- defaultStep = 0.01;
53
- }
54
- return defaultStep;
25
+ const getDefaultStep = (step, formatOptions) => {
26
+ let defaultStep = step !== void 0 && !Number.isNaN(step) ? step : 1;
27
+ if (formatOptions?.style === "percent" && (step === void 0 || Number.isNaN(step))) defaultStep = .01;
28
+ return defaultStep;
55
29
  };
56
- // Annotate the CommonJS export names for ESM import in node:
57
- 0 && (module.exports = {
58
- createFormatter,
59
- createParser,
60
- formatValue,
61
- getDefaultStep,
62
- parseValue
63
- });
30
+ exports.createFormatter = createFormatter;
31
+ exports.createParser = createParser;
32
+ exports.formatValue = formatValue;
33
+ exports.getDefaultStep = getDefaultStep;
34
+ exports.parseValue = parseValue;
@@ -1,34 +1,26 @@
1
- // src/number-input.utils.ts
2
1
  import { NumberParser } from "@internationalized/number";
3
- var createFormatter = (locale, options = {}) => {
4
- return new Intl.NumberFormat(locale, options);
5
- };
6
- var createParser = (locale, options = {}) => {
7
- return new NumberParser(locale, options);
2
+ // src/number-input.utils.ts
3
+ const createFormatter = (locale, options = {}) => {
4
+ return new Intl.NumberFormat(locale, options);
8
5
  };
9
- var parseValue = (value, params) => {
10
- const { prop, computed } = params;
11
- if (!prop("formatOptions")) return parseFloat(value);
12
- if (value === "") return Number.NaN;
13
- return computed("parser").parse(value);
6
+ const createParser = (locale, options = {}) => {
7
+ return new NumberParser(locale, options);
14
8
  };
15
- var formatValue = (value, params) => {
16
- const { prop, computed } = params;
17
- if (Number.isNaN(value)) return "";
18
- if (!prop("formatOptions")) return value.toString();
19
- return computed("formatter").format(value);
9
+ const parseValue = (value, params) => {
10
+ const { prop, computed } = params;
11
+ if (!prop("formatOptions")) return parseFloat(value);
12
+ if (value === "") return NaN;
13
+ return computed("parser").parse(value);
20
14
  };
21
- var getDefaultStep = (step, formatOptions) => {
22
- let defaultStep = step !== void 0 && !Number.isNaN(step) ? step : 1;
23
- if (formatOptions?.style === "percent" && (step === void 0 || Number.isNaN(step))) {
24
- defaultStep = 0.01;
25
- }
26
- return defaultStep;
15
+ const formatValue = (value, params) => {
16
+ const { prop, computed } = params;
17
+ if (Number.isNaN(value)) return "";
18
+ if (!prop("formatOptions")) return value.toString();
19
+ return computed("formatter").format(value);
27
20
  };
28
- export {
29
- createFormatter,
30
- createParser,
31
- formatValue,
32
- getDefaultStep,
33
- parseValue
21
+ const getDefaultStep = (step, formatOptions) => {
22
+ let defaultStep = step !== void 0 && !Number.isNaN(step) ? step : 1;
23
+ if (formatOptions?.style === "percent" && (step === void 0 || Number.isNaN(step))) defaultStep = .01;
24
+ return defaultStep;
34
25
  };
26
+ export { createFormatter, createParser, formatValue, getDefaultStep, parseValue };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zag-js/number-input",
3
- "version": "1.46.0",
3
+ "version": "1.48.0",
4
4
  "description": "Core logic for the number-input widget implemented as a state machine",
5
5
  "keywords": [
6
6
  "js",
@@ -30,11 +30,11 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "@internationalized/number": "3.6.9",
33
- "@zag-js/anatomy": "1.46.0",
34
- "@zag-js/core": "1.46.0",
35
- "@zag-js/dom-query": "1.46.0",
36
- "@zag-js/types": "1.46.0",
37
- "@zag-js/utils": "1.46.0"
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/types": "1.48.0",
37
+ "@zag-js/utils": "1.48.0"
38
38
  },
39
39
  "devDependencies": {
40
40
  "clean-package": "2.2.0"
@@ -67,8 +67,8 @@
67
67
  "./package.json": "./package.json"
68
68
  },
69
69
  "scripts": {
70
- "build": "tsup",
71
- "lint": "eslint src",
70
+ "build": "tsdown",
71
+ "lint": "oxlint src",
72
72
  "typecheck": "tsc --noEmit"
73
73
  }
74
74
  }