react-science 20.7.0 → 21.1.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.
@@ -0,0 +1,3 @@
1
+ import { z } from 'zod';
2
+ export declare const coerceNumberInput: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
3
+ //# sourceMappingURL=coerce_number_input.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coerce_number_input.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/utils/validation/coerce_number_input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,iBAAiB,wDAG5B,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { z } from 'zod';
2
+ export const coerceNumberInput = z.string().transform((value) => {
3
+ const number = Number(value);
4
+ return Number.isNaN(number) ? 0 : number;
5
+ });
6
+ //# sourceMappingURL=coerce_number_input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coerce_number_input.js","sourceRoot":"","sources":["../../../../../src/components/form/utils/validation/coerce_number_input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE;IAC9D,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC7B,OAAO,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;AAC3C,CAAC,CAAC,CAAC"}
@@ -19,6 +19,7 @@ export * from './form/components/input_groups/index.js';
19
19
  export * from './form/components/input/index.js';
20
20
  export * from './form/components/layout/index.js';
21
21
  export * from './form/context/use_ts_form.js';
22
+ export * from './form/utils/validation/coerce_number_input.ts';
22
23
  export * from './activity_bar/index.js';
23
24
  export * from './activity_panel/index.js';
24
25
  export * from './utils/index.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yCAAyC,CAAC;AACxD,cAAc,yCAAyC,CAAC;AACxD,cAAc,kCAAkC,CAAC;AACjD,cAAc,mCAAmC,CAAC;AAClD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gBAAgB,CAAC;AAC/B,OAAO,KAAK,cAAc,MAAM,4BAA4B,CAAC;AAC7D,cAAc,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yCAAyC,CAAC;AACxD,cAAc,yCAAyC,CAAC;AACxD,cAAc,kCAAkC,CAAC;AACjD,cAAc,mCAAmC,CAAC;AAClD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gDAAgD,CAAC;AAC/D,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gBAAgB,CAAC;AAC/B,OAAO,KAAK,cAAc,MAAM,4BAA4B,CAAC;AAC7D,cAAc,qBAAqB,CAAC"}
@@ -19,6 +19,7 @@ export * from './form/components/input_groups/index.js';
19
19
  export * from './form/components/input/index.js';
20
20
  export * from './form/components/layout/index.js';
21
21
  export * from './form/context/use_ts_form.js';
22
+ export * from "./form/utils/validation/coerce_number_input.js";
22
23
  export * from './activity_bar/index.js';
23
24
  export * from './activity_panel/index.js';
24
25
  export * from './utils/index.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB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1
- export * from './assert.js';
2
1
  export * from './debounce.js';
3
2
  export * from './throttle.js';
4
3
  export * from './svg.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC"}
@@ -1,4 +1,3 @@
1
- export * from './assert.js';
2
1
  export * from './debounce.js';
3
2
  export * from './throttle.js';
4
3
  export * from './svg.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-science",
3
- "version": "20.7.0",
3
+ "version": "21.1.0",
4
4
  "description": "React components to build scientific applications UI",
5
5
  "type": "module",
6
6
  "exports": {
@@ -57,16 +57,16 @@
57
57
  },
58
58
  "dependencies": {
59
59
  "@emotion/styled": "^11.14.1",
60
- "@radix-ui/react-use-controllable-state": "^1.2.3",
61
- "@tanstack/react-form": "^1.33.2",
60
+ "@radix-ui/react-use-controllable-state": "^1.2.6",
61
+ "@tanstack/react-form": "^1.33.3",
62
62
  "@tanstack/react-store": "^0.11.0",
63
63
  "@tanstack/react-table": "^8.21.3",
64
- "@tanstack/react-virtual": "^3.14.6",
64
+ "@tanstack/react-virtual": "^3.14.9",
65
65
  "@zakodium/pdnd-esm": "^1.1.0",
66
- "@zakodium/utils": "^0.4.1",
66
+ "@zakodium/utils": "^0.5.1",
67
67
  "d3-scale-chromatic": "^3.1.0",
68
68
  "react-d3-utils": "^3.1.2",
69
- "react-dropzone": "^17.0.0",
69
+ "react-dropzone": "^20.0.0",
70
70
  "react-full-screen": "^1.1.1",
71
71
  "react-icons": "^5.7.0",
72
72
  "react-inspector": "^9.0.0",
@@ -79,18 +79,18 @@
79
79
  "@blueprintjs/icons": "6.11.0",
80
80
  "@blueprintjs/select": "6.3.0",
81
81
  "@floating-ui/react": "^0.27.20",
82
- "@playwright/experimental-ct-react": "^1.61.1",
83
- "@playwright/test": "^1.61.1",
84
- "@storybook/addon-docs": "^10.5.0",
85
- "@storybook/react-vite": "^10.5.0",
86
- "@tanstack/react-query": "^5.101.2",
82
+ "@playwright/experimental-ct-react": "^1.62.1",
83
+ "@playwright/test": "^1.62.1",
84
+ "@storybook/addon-docs": "^10.5.6",
85
+ "@storybook/react-vite": "^10.5.6",
86
+ "@tanstack/react-query": "^5.101.4",
87
87
  "@types/babel__core": "^7.20.5",
88
88
  "@types/d3-scale-chromatic": "^3.1.0",
89
- "@types/node": "^24.13.3",
89
+ "@types/node": "^26.1.2",
90
90
  "@types/react": "^18.3.31",
91
91
  "@types/react-dom": "^18.3.7",
92
92
  "@types/tinycolor2": "^1.4.6",
93
- "@vitejs/plugin-react": "^6.0.3",
93
+ "@vitejs/plugin-react": "^6.0.5",
94
94
  "@vitest/coverage-v8": "^4.1.10",
95
95
  "@zakodium/tsconfig": "^1.0.5",
96
96
  "biologic-converter": "^1.0.0",
@@ -99,19 +99,19 @@
99
99
  "cross-env": "^10.1.0",
100
100
  "eslint": "^9.39.5",
101
101
  "eslint-config-zakodium": "^20.1.0",
102
- "eslint-plugin-storybook": "^10.5.0",
102
+ "eslint-plugin-storybook": "^10.5.6",
103
103
  "fifo-logger": "2.0.1",
104
104
  "filelist-utils": "^1.11.3",
105
- "immer": "^11.1.11",
105
+ "immer": "^11.1.15",
106
106
  "jcampconverter": "^12.5.2",
107
107
  "ml-gsd": "^14.2.1",
108
- "ml-peak-shape-generator": "^5.2.1",
108
+ "ml-peak-shape-generator": "^5.4.0",
109
109
  "ml-signal-processing": "^2.2.2",
110
- "ml-spectra-processing": "^14.29.2",
111
- "ms-spectrum": "^3.10.1",
110
+ "ml-spectra-processing": "^14.31.0",
111
+ "ms-spectrum": "^3.12.0",
112
112
  "netcdfjs": "^4.0.0",
113
113
  "postcss-styled-syntax": "^0.7.2",
114
- "prettier": "^3.9.5",
114
+ "prettier": "^3.9.6",
115
115
  "react": "18.3.1",
116
116
  "react-dom": "18.3.1",
117
117
  "react-error-boundary": "^6.1.2",
@@ -120,15 +120,15 @@
120
120
  "react-plot": "^3.1.2",
121
121
  "rimraf": "^6.1.3",
122
122
  "spc-parser": "^2.1.0",
123
- "storybook": "^10.5.0",
124
- "stylelint": "^17.14.0",
123
+ "storybook": "^10.5.6",
124
+ "stylelint": "^17.14.1",
125
125
  "stylelint-config-standard": "^40.0.0",
126
126
  "typescript": "^6.0.3",
127
- "vite": "^8.1.4",
127
+ "vite": "^8.2.0",
128
128
  "vitest": "^4.1.10",
129
129
  "wdf-parser": "^1.0.0"
130
130
  },
131
131
  "volta": {
132
- "node": "24.18.0"
132
+ "node": "24.18.1"
133
133
  }
134
134
  }
@@ -0,0 +1,6 @@
1
+ import { z } from 'zod';
2
+
3
+ export const coerceNumberInput = z.string().transform((value) => {
4
+ const number = Number(value);
5
+ return Number.isNaN(number) ? 0 : number;
6
+ });
@@ -19,6 +19,7 @@ export * from './form/components/input_groups/index.js';
19
19
  export * from './form/components/input/index.js';
20
20
  export * from './form/components/layout/index.js';
21
21
  export * from './form/context/use_ts_form.js';
22
+ export * from './form/utils/validation/coerce_number_input.ts';
22
23
  export * from './activity_bar/index.js';
23
24
  export * from './activity_panel/index.js';
24
25
  export * from './utils/index.js';
@@ -1,4 +1,3 @@
1
- export * from './assert.js';
2
1
  export * from './debounce.js';
3
2
  export * from './throttle.js';
4
3
  export * from './svg.js';
@@ -1,17 +0,0 @@
1
- /**
2
- * @param x
3
- * @deprecated Use `assertUnreachable` from `@zakodium/utils`
4
- */
5
- export declare function assertUnreachable(x: never): never;
6
- /**
7
- * @param x
8
- * @deprecated Use `assertNotNullish` from `@zakodium/utils`
9
- */
10
- export declare function assertNotNull<T>(value: T | null | undefined): asserts value is Exclude<T, null | undefined>;
11
- /**
12
- * @param value
13
- * @param message
14
- * @deprecated Use `assert` from `@zakodium/utils`
15
- */
16
- export declare function assert(value: unknown, message?: string): asserts value;
17
- //# sourceMappingURL=assert.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"assert.d.ts","sourceRoot":"","sources":["../../../src/components/utils/assert.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,KAAK,GAAG,KAAK,CAEjD;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAC7B,KAAK,EAAE,CAAC,GAAG,IAAI,GAAG,SAAS,GAC1B,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC,CAO/C;AAED;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAItE"}
@@ -1,30 +0,0 @@
1
- /**
2
- * @param x
3
- * @deprecated Use `assertUnreachable` from `@zakodium/utils`
4
- */
5
- export function assertUnreachable(x) {
6
- throw new Error(`unreachable: ${String(x)}`);
7
- }
8
- /**
9
- * @param x
10
- * @deprecated Use `assertNotNullish` from `@zakodium/utils`
11
- */
12
- export function assertNotNull(value) {
13
- if (value === null) {
14
- throw new Error('unexpected null value');
15
- }
16
- if (value === undefined) {
17
- throw new Error('unexpected undefined value');
18
- }
19
- }
20
- /**
21
- * @param value
22
- * @param message
23
- * @deprecated Use `assert` from `@zakodium/utils`
24
- */
25
- export function assert(value, message) {
26
- if (!value) {
27
- throw new Error(`unreachable${message ? `: ${message}` : ''}`);
28
- }
29
- }
30
- //# sourceMappingURL=assert.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"assert.js","sourceRoot":"","sources":["../../../src/components/utils/assert.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,CAAQ;IACxC,MAAM,IAAI,KAAK,CAAC,gBAAgB,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AAC/C,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,aAAa,CAC3B,KAA2B;IAE3B,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QACnB,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;IAC3C,CAAC;IACD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;IAChD,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,MAAM,CAAC,KAAc,EAAE,OAAgB;IACrD,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,cAAc,OAAO,CAAC,CAAC,CAAC,KAAK,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACjE,CAAC;AACH,CAAC"}
@@ -1,33 +0,0 @@
1
- /**
2
- * @param x
3
- * @deprecated Use `assertUnreachable` from `@zakodium/utils`
4
- */
5
- export function assertUnreachable(x: never): never {
6
- throw new Error(`unreachable: ${String(x)}`);
7
- }
8
-
9
- /**
10
- * @param x
11
- * @deprecated Use `assertNotNullish` from `@zakodium/utils`
12
- */
13
- export function assertNotNull<T>(
14
- value: T | null | undefined,
15
- ): asserts value is Exclude<T, null | undefined> {
16
- if (value === null) {
17
- throw new Error('unexpected null value');
18
- }
19
- if (value === undefined) {
20
- throw new Error('unexpected undefined value');
21
- }
22
- }
23
-
24
- /**
25
- * @param value
26
- * @param message
27
- * @deprecated Use `assert` from `@zakodium/utils`
28
- */
29
- export function assert(value: unknown, message?: string): asserts value {
30
- if (!value) {
31
- throw new Error(`unreachable${message ? `: ${message}` : ''}`);
32
- }
33
- }