Commit 4880202
authored
Fix currency input regex + migrate to storybook/test v9 (#10)
* fix: tighten currency input regex + migrate to storybook/test v9
- Replace permissive regex with two-stage parse: strip non-numeric,
then clamp to valid number format (optional leading minus, single
decimal point). Prevents malformed input like '1.2.3' or '1-2-3'.
- Remove @storybook/test (v8) and @storybook/testing-library,
migrate imports to storybook/test (v9 path). Eliminates SB9
compatibility warning.
- All 51 interaction tests pass.
* fix: hoist regex to module scope + sort imports for biome lint
- Extract regex literals to module-level constants (biome/useTopLevelRegex)
- Fix import ordering in story files (biome/organizeImports)
- All 51 tests still passing
* Add changeset for currency input fix (patch)1 parent 742ec34 commit 4880202
6 files changed
Lines changed: 29 additions & 685 deletions
File tree
- .changeset
- apps/docs
- src/medusa-forms
- packages/medusa-forms/src/controlled
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | 26 | | |
28 | | - | |
29 | 27 | | |
30 | 28 | | |
31 | 29 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | 4 | | |
6 | 5 | | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | 3 | | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
6 | 10 | | |
7 | 11 | | |
8 | 12 | | |
| |||
38 | 42 | | |
39 | 43 | | |
40 | 44 | | |
41 | | - | |
| 45 | + | |
| 46 | + | |
42 | 47 | | |
43 | 48 | | |
44 | 49 | | |
| |||
0 commit comments