Skip to content

Commit

Permalink
feature: v2 (#7)
Browse files Browse the repository at this point in the history
* wip: design v2

* fix: slug logic

* fix: deletes unnused file

* wip: simplified the styles and design and added self regulating focus management

* wip: removed some extra css vars

* wip: changed variable name to be inline with hook

* wip: improved demo comments

* wip: ads docs

* fix: reduced motion example

* fix: export in package

* fix: slug prop name, modal position

* feature: adds changeset

* fix: moves version back and automate

* wip: removes animation

* fix: removes overflow and unnused gh workflow

* fix: package versioning

* fix: release script

* fix: codeowners
  • Loading branch information
marlonmarcello authored Nov 28, 2023
1 parent cc0f57e commit 4512c52
Show file tree
Hide file tree
Showing 56 changed files with 6,992 additions and 2,233 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
16 changes: 16 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": [
"@changesets/changelog-github",
{
"repo": "wethegit/react-modal"
}
],
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
20 changes: 20 additions & 0 deletions .changeset/giant-lies-help.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
"@wethegit/react-modal": major
---

# V2

## Breaking changes

Seriously, everything.

## Why

The old design of the modal was good but it had an achilles heel, it used an internal context to handle the transition and syncing that with the state which caused:

1. Actions to be tied to a context, adding custom components to close the modal for example was a bit annoying
2. Animation and state were too tightly coupled and not exposed for further customization

## What's new

The modal is now a controlled component, you can control the state of the modal from outside using the hook `useModal` which also exposes the state so you can use further customize the Modal and even the child components.
23 changes: 18 additions & 5 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,28 @@
"env": { "browser": true, "es2020": true },
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"plugin:react/jsx-runtime",
"plugin:react-hooks/recommended",
"prettier"
],
"parserOptions": { "ecmaVersion": "latest", "sourceType": "module" },
"settings": { "react": { "version": "18.2" }, "jest": { "version": 26 } },
"plugins": ["react-refresh"],
"settings": { "react": { "version": "17.2" }, "jest": { "version": 26 } },
"plugins": ["@typescript-eslint", "react-refresh"],
"parser": "@typescript-eslint/parser",
"rules": {
"react-refresh/only-export-components": "off"
}
"react-refresh/only-export-components": 0,
"react/react-in-jsx-scope": 0,
"react/prop-types": [2, { "ignore": ["className"] }],
"@typescript-eslint/no-non-null-assertion": 0
},
"ignorePatterns": [
"node_modules/",
"dist/",
"**/*.{css, scss}",
".eslintrc.*",
"dist/",
".stylelintrc.js",
"vite.config.ts"
]
}
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @wethegit/reviewers
21 changes: 21 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!--
Use the following format as PR title:
[docs/hooks] fix/release/feature/patch: title of pr
-->

## Description

A **brief** description of the feature or bug, just to make the developer reviewing your work more familiar.

## Solution

A **brief** summary of why you fixed/created something the way you did and any known limitations because of this (i.e. browser support).

## Additional Notes

Any additional notes or information that should be made or highlighted.

## Screenshots

Screenshots/videos showcasing your updates - if applicable.
29 changes: 29 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Lint

on:
pull_request:
types: [opened, edited, reopened, synchronize]

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3

- name: Setup Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18

- name: Install Dependencies
run: npm ci

- name: Lint
run: npm run lint



22 changes: 0 additions & 22 deletions .github/workflows/publish-package.yml

This file was deleted.

41 changes: 41 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Release

on:
push:
branches:
- main

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
release:
permissions:
contents: write # to create release (changesets/action)
issues: write # to post issue comments (changesets/action)
pull-requests: write # to create pull request (changesets/action)
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3

- name: Setup Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18

- name: Install Dependencies
run: npm ci

- name: Lint
run: npm run lint

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
version: npm run version
publish: npm run release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
7 changes: 5 additions & 2 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
.github
.husky
.vscode
src
types
.eslintrc
.nvmrc
.prettierignore
.prettierrc
.stylelintrc
index.html
vite.config.js
src
tsconfig.json
vite.config.js
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.14.2
v18.16.0
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
.husky
.vscode
node_modules
dist
dist
README.md
1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
},
"eslint.format.enable": true,
"eslint.nodePath": "",
"eslint.packageManager": "npm",
"files.associations": {
"*.js": "javascriptreact",
"*.jsx": "javascriptreact",
Expand Down
Loading

0 comments on commit 4512c52

Please sign in to comment.