Skip to content

Commit

Permalink
Modernization and Migration of InputWithExamples to NumericInput fold…
Browse files Browse the repository at this point in the history
…er (#2121)

## Summary:
This PR is part of the Numeric Input Project work. It is being landed onto the `feature/numeric-dx-refactor` branch. 

This PR contains the following changes:
1. Moves the InputWithExamples component to the NumericInput folder
2. Modernizes InputWithExamples to be a functional component 
3. Addition of some comments 

Video Example of Snapshot Testing:

https://github.com/user-attachments/assets/ca917778-50b0-46d2-89d8-dad95d1dadf2



Issue: LEMS-2785

## Test plan:
- Ensure all tests pass 
- Manual testing with PR Snapshot in upstream consumer 
- Landing onto feature branch that will see full QA regression pass before deployment

Author: SonicScrewdriver

Reviewers: SonicScrewdriver, mark-fitzgerald

Required Reviewers:

Approved By: mark-fitzgerald

Checks: ✅ Publish npm snapshot (ubuntu-latest, 20.x), ✅ Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ✅ Lint, Typecheck, Format, and Test (ubuntu-latest, 20.x), ✅ Check builds for changes in size (ubuntu-latest, 20.x), ✅ Publish Storybook to Chromatic (ubuntu-latest, 20.x), ✅ Cypress (ubuntu-latest, 20.x)

Pull Request URL: #2121
  • Loading branch information
SonicScrewdriver committed Jan 30, 2025
1 parent 4ca8c00 commit 9bfbe9e
Show file tree
Hide file tree
Showing 7 changed files with 210 additions and 223 deletions.
6 changes: 6 additions & 0 deletions .changeset/rich-flowers-prove.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@khanacademy/math-input": minor
"@khanacademy/perseus": minor
---

Modernization and Migration of InputWithExamples to NumericInput folder
213 changes: 0 additions & 213 deletions packages/perseus/src/components/input-with-examples.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion packages/perseus/src/widgets/input-number/input-number.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import * as React from "react";
import _ from "underscore";

import {PerseusI18nContext} from "../../components/i18n-context";
import InputWithExamples from "../../components/input-with-examples";
import SimpleKeypadInput from "../../components/simple-keypad-input";
import {ApiOptions} from "../../perseus-api";
import {getPromptJSON as _getPromptJSON} from "../../widget-ai-utils/input-number/input-number-ai-utils";
import InputWithExamples from "../numeric-input/input-with-examples";

import type {PerseusStrings} from "../../strings";
import type {Path, Widget, WidgetExports, WidgetProps} from "../../types";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {action} from "@storybook/addon-actions";

import InputWithExamples from "../input-with-examples";
import InputWithExamples from "./input-with-examples";

import type {Meta, StoryObj} from "@storybook/react";

Expand Down
Loading

0 comments on commit 9bfbe9e

Please sign in to comment.