|
2 | 2 |
|
3 | 3 | A controlled form components library for Medusa Admin and Medusa UI applications.
|
4 | 4 |
|
5 |
| -Checkout our [Storybook Documentation](https://lambda-curry.github.io/medusa-forms/?path=/docs/0-1-hello-world-start-here--docs) to see the components in action and get started. |
6 |
| - |
7 |
| -## Features |
8 |
| - |
9 |
| -- **Controlled Components**: All form components are controlled and work seamlessly with react-hook-form |
10 |
| -- **Medusa UI Integration**: Built specifically for Medusa Admin and Medusa UI design system |
11 |
| -- **TypeScript Support**: Full TypeScript support with proper type definitions |
12 |
| -- **Storybook Documentation**: Comprehensive documentation and examples |
13 |
| - |
14 |
| -## Components |
15 |
| - |
16 |
| -- `ControlledInput` - Text input with validation |
17 |
| -- `ControlledTextArea` - Multi-line text input |
18 |
| -- `ControlledSelect` - Dropdown selection |
19 |
| -- `ControlledCheckbox` - Checkbox input |
20 |
| -- `ControlledDatePicker` - Date selection |
21 |
| -- `ControlledCurrencyInput` - Currency input with formatting |
22 |
| - |
23 | 5 | ## Getting Started
|
24 | 6 |
|
25 |
| -Step 1: Install dependencies |
26 |
| - |
27 |
| -```bash |
28 |
| -yarn install |
29 |
| -``` |
30 |
| - |
31 |
| -Step 2: Start Storybook |
32 |
| - |
33 |
| -```bash |
34 |
| -yarn storybook |
35 |
| -``` |
36 |
| - |
37 |
| -## Development |
38 |
| - |
39 |
| -### PR Previews |
40 |
| - |
41 |
| -When you create a pull request, a preview of the Storybook documentation will be automatically deployed. You can find the link to the preview in the PR comments. This allows you to review changes to the documentation and components before merging. |
42 |
| - |
43 |
| -Preview URLs follow this format: |
44 |
| -``` |
45 |
| -https://lambda-curry.github.io/medusa-forms/pr-preview/pr-[PR_NUMBER]/ |
46 |
| -``` |
47 |
| - |
48 |
| -#### How PR Previews Work |
49 |
| - |
50 |
| -The PR preview system: |
51 |
| -1. Builds the Storybook documentation for each PR |
52 |
| -2. Deploys it to a PR-specific directory on the `gh-pages` branch |
53 |
| -3. Adds a comment to the PR with a link to the preview |
54 |
| -4. **Automatically updates the preview when you push new changes to the PR** |
55 |
| -5. Cleans up the preview when the PR is closed |
56 |
| - |
57 |
| -#### GitHub Environment Setup |
58 |
| - |
59 |
| -For PR previews to work properly, you need to set up a GitHub environment: |
60 |
| - |
61 |
| -1. Go to your repository settings |
62 |
| -2. Navigate to "Environments" |
63 |
| -3. Create a new environment named `pr-preview` |
64 |
| -4. Configure environment protection rules as needed: |
65 |
| - - You can require reviewers to approve deployment |
66 |
| - - You can limit deployment to specific branches |
67 |
| - - You can add wait timers before deployment |
68 |
| - |
69 |
| -The main branch will continue to deploy to the `github-pages` environment. |
70 |
| - |
71 |
| -#### Troubleshooting PR Previews |
72 |
| - |
73 |
| -If you encounter a 404 error when accessing the PR preview: |
74 |
| - |
75 |
| -1. Make sure the PR build has completed successfully by checking the GitHub Actions tab |
76 |
| -2. Verify that the repository has GitHub Pages enabled and configured to deploy from the `gh-pages` branch |
77 |
| -3. Check that the PR preview comment contains the correct URL |
78 |
| -4. Ensure the PR has been approved for deployment if environment protection rules are enabled |
79 |
| -5. Try clearing your browser cache or using an incognito window |
80 |
| - |
81 |
| -The PR preview is deployed to the `gh-pages` branch in a directory structure like: |
82 |
| -``` |
83 |
| -/pr-preview/pr-[PR_NUMBER]/ |
84 |
| -``` |
| 7 | +This repository is being set up. Please check back soon for the complete implementation. |
85 | 8 |
|
0 commit comments