Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Bug report
description: Report reproducible incorrect behavior
body:
- type: markdown
attributes:
value: Thanks for helping improve React Drag Dismiss. Please include a minimal reproduction.
- type: input
id: version
attributes:
label: Package version
validations:
required: true
- type: textarea
id: reproduction
attributes:
label: Reproduction
description: Link to a minimal repository or sandbox and list exact steps.
validations:
required: true
- type: textarea
id: expected
attributes:
label: Expected behavior
validations:
required: true
- type: textarea
id: actual
attributes:
label: Actual behavior
validations:
required: true
- type: input
id: environment
attributes:
label: Browser, operating system, React version
validations:
required: true
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Security vulnerability
url: https://github.com/NIPE-Solutions/react-drag-dismiss/security/advisories/new
about: Report security issues privately.
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: npm
directory: /
schedule:
interval: weekly
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
10 changes: 10 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
## Summary

Describe the focused change and why it belongs in Drag Dismiss.

## Verification

- [ ] `npm run check`
- [ ] `npm run test:e2e` when interaction behavior changes
- [ ] Documentation updated when the public contract changes
- [ ] No application-state, presence, or generic gesture responsibilities added
29 changes: 29 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: CI
on:
pull_request:
push:
branches: [main]
permissions:
contents: read
jobs:
quality:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version: 24, cache: npm }
- run: npm ci
- run: npm run check
browser:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
browser: [chromium, firefox, webkit]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version: 24, cache: npm }
- run: npm ci
- run: npx playwright install --with-deps ${{ matrix.browser }}
- run: npm run test:e2e -- --project=${{ matrix.browser }}
22 changes: 22 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Release
on:
workflow_dispatch:
permissions:
contents: read
id-token: write
jobs:
publish:
environment: npm
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
{
node-version: 24,
registry-url: 'https://registry.npmjs.org',
cache: npm,
}
- run: npm ci
- run: npm run release:check
- run: npm publish --provenance --access public --tag alpha
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
node_modules/
dist/
dist-website/
coverage/
playwright-report/
test-results/
Expand Down
1 change: 1 addition & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "semi": false, "singleQuote": true, "trailingComma": "all" }
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Changelog

## 0.1.0-alpha.0

- Initial drag-to-dismiss primitive with logical directions, intent arbitration, recent velocity, resistance, interruptible settling, reduced motion, SSR-safe packaging, and documentation.
7 changes: 7 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Code of conduct

We are committed to a welcoming, harassment-free community. Be respectful, assume good intent, accept constructive feedback, and focus discussion on the work.

Unacceptable behavior includes harassment, discrimination, threats, sexualized conduct, and publishing private information. Report concerns privately to NIPE Solutions through the contact details on [nipesolutions.com](https://www.nipesolutions.com).

Project maintainers may remove contributions or participants whose conduct harms the community.
11 changes: 11 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Contributing

Use Node 24 and npm 11. Create a focused branch, add regression coverage for behavior changes, and run:

```bash
npm install
npm run check
npm run test:e2e
```

Keep the package focused on drag-to-dismiss mechanics. Features for data removal, undo, overlays, action rails, sorting, drag-and-drop, or generic gestures are out of scope.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 NIPE Solutions

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
45 changes: 45 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# React Drag Dismiss

Drag-to-dismiss mechanics for arbitrary React content.

Intent detection, velocity, resistance and settling without owning your application state.

```bash
npm install @nipe-solutions/react-drag-dismiss
```

```tsx
import { DragDismiss } from '@nipe-solutions/react-drag-dismiss'
import '@nipe-solutions/react-drag-dismiss/core.css'

;<DragDismiss
directions={['start', 'end']}
onDismiss={({ direction }) => removeItem(id, direction)}
>
<Notification />
</DragDismiss>
```

`start` and `end` follow the nearest `dir` context. `up` and `down` are physical vertical directions. Keep a root's directions on one axis.

The package detects intent and provides motion mechanics. Your application owns removal, unmounting, undo, focus, persistence, and side effects. Always provide an accessible semantic control for required dismissal actions.

Full documentation: [react-drag-dismiss.nipesolutions.com](https://react-drag-dismiss.nipesolutions.com)

Part of [NIPE Open Source](https://opensource.nipesolutions.com).

## Development

Requires Node 24 and npm 11.

```bash
npm install
npm run check
npm run test:e2e
```

See [CONTRIBUTING.md](CONTRIBUTING.md), [SECURITY.md](SECURITY.md), and [docs/REAL_DEVICE_QA.md](docs/REAL_DEVICE_QA.md).

## License

MIT © NIPE Solutions
5 changes: 5 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Security policy

Please report vulnerabilities privately through GitHub Security Advisories for this repository. Do not open a public issue for an undisclosed vulnerability.

Only the latest published prerelease or stable release receives security fixes.
14 changes: 14 additions & 0 deletions docs/REAL_DEVICE_QA.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Real-device QA

This checklist must be completed before a stable release. Automated desktop WebKit does not substitute for physical iOS Safari.

Record device, OS, browser version, date, and result for:

- iPhone Safari
- Android Chrome
- Desktop Chrome
- Desktop Safari

For each environment verify horizontal and vertical dismissal, slow threshold drag, fast flick, pause before release, reversal, cancel, unsupported direction, buttons and links, scrolling, RTL, reduced motion, browser-edge behavior, resize, and repeated gestures.

Status for `0.1.0-alpha.0`: physical iPhone and Android testing pending.
21 changes: 21 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import js from '@eslint/js'
import globals from 'globals'
import tseslint from 'typescript-eslint'

export default tseslint.config(
{
ignores: [
'dist',
'dist-website',
'coverage',
'playwright-report',
'test-results',
],
},
js.configs.recommended,
...tseslint.configs.recommended,
{
files: ['**/*.{ts,tsx,js,mjs}'],
languageOptions: { globals: { ...globals.browser, ...globals.node } },
},
)
Loading
Loading