main repo

This commit is contained in:
Basilosaurusrex
2025-11-24 18:09:40 +01:00
parent b636ee5e70
commit f027651f9b
34146 changed files with 4436636 additions and 0 deletions

21
node_modules/sonner/LICENSE.md generated vendored Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2023 Emil Kowalski
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.

33
node_modules/sonner/README.md generated vendored Normal file
View File

@@ -0,0 +1,33 @@
https://github.com/vallezw/sonner/assets/50796600/59b95cb7-9068-4f3e-8469-0b35d9de5cf0
[Sonner](https://sonner.emilkowal.ski/) is an opinionated toast component for React. You can read more about why and how it was built [here](https://emilkowal.ski/ui/building-a-toast-component).
## Usage
To start using the library, install it in your project:
```bash
npm install sonner
```
Add `<Toaster />` to your app, it will be the place where all your toasts will be rendered.
After that you can use `toast()` from anywhere in your app.
```jsx
import { Toaster, toast } from 'sonner';
// ...
function App() {
return (
<div>
<Toaster />
<button onClick={() => toast('My first toast')}>Give me a toast</button>
</div>
);
}
```
## Documentation
Find the full API reference in the [documentation](https://sonner.emilkowal.ski/getting-started).

141
node_modules/sonner/dist/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,141 @@
import React from 'react';
type ToastTypes = 'normal' | 'action' | 'success' | 'info' | 'warning' | 'error' | 'loading' | 'default';
type PromiseT<Data = any> = Promise<Data> | (() => Promise<Data>);
type PromiseTResult<Data = any> = string | React.ReactNode | ((data: Data) => React.ReactNode | string | Promise<React.ReactNode | string>);
type PromiseExternalToast = Omit<ExternalToast, 'description'>;
type PromiseData<ToastData = any> = PromiseExternalToast & {
loading?: string | React.ReactNode;
success?: PromiseTResult<ToastData>;
error?: PromiseTResult;
description?: PromiseTResult;
finally?: () => void | Promise<void>;
};
interface ToastClassnames {
toast?: string;
title?: string;
description?: string;
loader?: string;
closeButton?: string;
cancelButton?: string;
actionButton?: string;
success?: string;
error?: string;
info?: string;
warning?: string;
loading?: string;
default?: string;
content?: string;
icon?: string;
}
interface ToastIcons {
success?: React.ReactNode;
info?: React.ReactNode;
warning?: React.ReactNode;
error?: React.ReactNode;
loading?: React.ReactNode;
}
interface Action {
label: React.ReactNode;
onClick: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
actionButtonStyle?: React.CSSProperties;
}
interface ToastT {
id: number | string;
title?: string | React.ReactNode;
type?: ToastTypes;
icon?: React.ReactNode;
jsx?: React.ReactNode;
richColors?: boolean;
invert?: boolean;
closeButton?: boolean;
dismissible?: boolean;
description?: React.ReactNode;
duration?: number;
delete?: boolean;
important?: boolean;
action?: Action | React.ReactNode;
cancel?: Action | React.ReactNode;
onDismiss?: (toast: ToastT) => void;
onAutoClose?: (toast: ToastT) => void;
promise?: PromiseT;
cancelButtonStyle?: React.CSSProperties;
actionButtonStyle?: React.CSSProperties;
style?: React.CSSProperties;
unstyled?: boolean;
className?: string;
classNames?: ToastClassnames;
descriptionClassName?: string;
position?: Position;
}
type Position = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'top-center' | 'bottom-center';
interface ToastOptions {
className?: string;
closeButton?: boolean;
descriptionClassName?: string;
style?: React.CSSProperties;
cancelButtonStyle?: React.CSSProperties;
actionButtonStyle?: React.CSSProperties;
duration?: number;
unstyled?: boolean;
classNames?: ToastClassnames;
}
type CnFunction = (...classes: Array<string | undefined>) => string;
interface ToasterProps {
invert?: boolean;
theme?: 'light' | 'dark' | 'system';
position?: Position;
hotkey?: string[];
richColors?: boolean;
expand?: boolean;
duration?: number;
gap?: number;
visibleToasts?: number;
closeButton?: boolean;
toastOptions?: ToastOptions;
className?: string;
style?: React.CSSProperties;
offset?: string | number;
dir?: 'rtl' | 'ltr' | 'auto';
/**
* @deprecated Please use the `icons` prop instead:
* ```jsx
* <Toaster
* icons={{ loading: <LoadingIcon /> }}
* />
* ```
*/
loadingIcon?: React.ReactNode;
icons?: ToastIcons;
containerAriaLabel?: string;
pauseWhenPageIsHidden?: boolean;
cn?: CnFunction;
}
interface ToastToDismiss {
id: number | string;
dismiss: boolean;
}
type ExternalToast = Omit<ToastT, 'id' | 'type' | 'title' | 'jsx' | 'delete' | 'promise'> & {
id?: number | string;
};
declare const toast: ((message: string | React.ReactNode, data?: ExternalToast) => string | number) & {
success: (message: string | React.ReactNode, data?: ExternalToast) => string | number;
info: (message: string | React.ReactNode, data?: ExternalToast) => string | number;
warning: (message: string | React.ReactNode, data?: ExternalToast) => string | number;
error: (message: string | React.ReactNode, data?: ExternalToast) => string | number;
custom: (jsx: (id: number | string) => React.ReactElement, data?: ExternalToast) => string | number;
message: (message: string | React.ReactNode, data?: ExternalToast) => string | number;
promise: <ToastData>(promise: PromiseT<ToastData>, data?: PromiseData<ToastData>) => string | number;
dismiss: (id?: number | string) => string | number;
loading: (message: string | React.ReactNode, data?: ExternalToast) => string | number;
} & {
getHistory: () => (ToastT | ToastToDismiss)[];
};
declare function useSonner(): {
toasts: ToastT[];
};
declare const Toaster: (props: ToasterProps) => JSX.Element;
export { ExternalToast, ToastT, Toaster, ToasterProps, toast, useSonner };

3
node_modules/sonner/dist/index.js generated vendored Normal file

File diff suppressed because one or more lines are too long

1
node_modules/sonner/dist/index.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

3
node_modules/sonner/dist/index.mjs generated vendored Normal file

File diff suppressed because one or more lines are too long

1
node_modules/sonner/dist/index.mjs.map generated vendored Normal file

File diff suppressed because one or more lines are too long

55
node_modules/sonner/package.json generated vendored Normal file
View File

@@ -0,0 +1,55 @@
{
"name": "sonner",
"version": "1.5.0",
"description": "An opinionated toast component for React.",
"exports": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.js"
},
"types": "./dist/index.d.ts",
"files": [
"dist"
],
"scripts": {
"build": "tsup src/index.tsx",
"dev": "tsup src/index.tsx --watch",
"dev:website": "turbo run dev --filter=website...",
"dev:test": "turbo run dev --filter=test...",
"format": "prettier --write .",
"test": "playwright test"
},
"keywords": [
"react",
"notifications",
"toast",
"snackbar",
"message"
],
"author": "Emil Kowalski <e@emilkowal.ski>",
"license": "MIT",
"homepage": "https://sonner.emilkowal.ski/",
"repository": {
"type": "git",
"url": "git+https://github.com/emilkowalski/sonner.git"
},
"bugs": {
"url": "https://github.com/emilkowalski/sonner/issues"
},
"devDependencies": {
"@playwright/test": "^1.30.0",
"@types/node": "^18.11.13",
"@types/react": "^18.0.26",
"prettier": "^2.8.4",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"tsup": "^6.4.0",
"turbo": "1.6",
"typescript": "^4.8.4"
},
"peerDependencies": {
"react": "^18.0.0",
"react-dom": "^18.0.0"
},
"packageManager": "pnpm@8.12.1"
}