@sozialhelden/ui 1.0.2 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +85 -1
- package/dist/index.d.ts +48 -1
- package/dist/index.js +1291 -1677
- package/package.json +16 -11
- package/src/style.css +120 -0
package/README.md
CHANGED
|
@@ -1 +1,85 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @sozialhelden/ui
|
|
2
|
+
|
|
3
|
+
> UI components shared by different sozialhelden projects.
|
|
4
|
+
|
|
5
|
+
Check the [Storybook](https://sozialhelden.github.io/ui/) for an overview of the available components.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
Make sure you have Tailwind CSS installed in your project. If you don't have it yet, you should install and set it up first: https://tailwindcss.com/docs/installation/using-vite
|
|
10
|
+
|
|
11
|
+
Then install the library:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm i --save @sozialhelden/ui
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Add the following to your main CSS file, make sure to adapt the path to the `@sozialhelden/ui` package if necessary:
|
|
18
|
+
|
|
19
|
+
```css
|
|
20
|
+
@import "tailwindcss";
|
|
21
|
+
@import "tw-animate-css";
|
|
22
|
+
@import "@sozialhelden/ui/style.css";
|
|
23
|
+
|
|
24
|
+
@source "../../node_modules/@sozialhelden/ui";
|
|
25
|
+
```
|
|
26
|
+
## Usage
|
|
27
|
+
|
|
28
|
+
Check the [Storybook](https://sozialhelden.github.io/ui/) for an overview of the available components.
|
|
29
|
+
|
|
30
|
+
Now you can use tailwind classes and the components provided by the `@sozialhelden/ui` package in your project, for example:
|
|
31
|
+
|
|
32
|
+
```tsx
|
|
33
|
+
import { Button } from "@sozialhelden/ui";
|
|
34
|
+
|
|
35
|
+
export function App() {
|
|
36
|
+
return (
|
|
37
|
+
<div className="p-4 bg-red-200">
|
|
38
|
+
<Button>Click me!</Button>
|
|
39
|
+
</div>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Development setup
|
|
45
|
+
|
|
46
|
+
Install dependencies:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
npm ci
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Run the storybook dev-server:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
npm run dev
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Build a production version of the library and storybook:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
npm run build
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Run linter/formatters:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
# Run linter
|
|
68
|
+
npm run lint
|
|
69
|
+
|
|
70
|
+
# Run linter and automatically fix fixable issues
|
|
71
|
+
npm run lint:fix
|
|
72
|
+
|
|
73
|
+
# Run formatter
|
|
74
|
+
npm run format
|
|
75
|
+
|
|
76
|
+
# Run formatter and automatically fix fixable issues
|
|
77
|
+
npm run format:fix
|
|
78
|
+
|
|
79
|
+
# Run typecheck
|
|
80
|
+
npm run typecheck
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## License
|
|
84
|
+
|
|
85
|
+
MIT
|
package/dist/index.d.ts
CHANGED
|
@@ -1 +1,48 @@
|
|
|
1
|
-
|
|
1
|
+
import { ClassProp } from 'class-variance-authority/types';
|
|
2
|
+
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
3
|
+
import { JSX } from 'react/jsx-runtime';
|
|
4
|
+
import type * as React_2 from 'react';
|
|
5
|
+
import { VariantProps } from 'class-variance-authority';
|
|
6
|
+
|
|
7
|
+
export declare function Alert({ className, variant, ...props }: React_2.ComponentProps<"div"> & VariantProps<typeof alertVariants>): JSX.Element;
|
|
8
|
+
|
|
9
|
+
export declare function AlertDescription({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
|
|
10
|
+
|
|
11
|
+
export declare function AlertTitle({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
|
|
12
|
+
|
|
13
|
+
declare const alertVariants: (props?: ({
|
|
14
|
+
variant?: "default" | "destructive" | null | undefined;
|
|
15
|
+
} & ClassProp) | undefined) => string;
|
|
16
|
+
|
|
17
|
+
export declare function Button({ className, variant, size, asChild, ...props }: React_2.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
|
|
18
|
+
asChild?: boolean;
|
|
19
|
+
}): JSX.Element;
|
|
20
|
+
|
|
21
|
+
export declare const buttonVariants: (props?: ({
|
|
22
|
+
variant?: "default" | "destructive" | "link" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
23
|
+
size?: "default" | "sm" | "lg" | "icon" | null | undefined;
|
|
24
|
+
} & ClassProp) | undefined) => string;
|
|
25
|
+
|
|
26
|
+
export declare function Dialog({ ...props }: React_2.ComponentProps<typeof DialogPrimitive.Root>): JSX.Element;
|
|
27
|
+
|
|
28
|
+
export declare function DialogClose({ ...props }: React_2.ComponentProps<typeof DialogPrimitive.Close>): JSX.Element;
|
|
29
|
+
|
|
30
|
+
export declare function DialogContent({ className, children, showCloseButton, ...props }: React_2.ComponentProps<typeof DialogPrimitive.Content> & {
|
|
31
|
+
showCloseButton?: boolean;
|
|
32
|
+
}): JSX.Element;
|
|
33
|
+
|
|
34
|
+
export declare function DialogDescription({ className, ...props }: React_2.ComponentProps<typeof DialogPrimitive.Description>): JSX.Element;
|
|
35
|
+
|
|
36
|
+
export declare function DialogFooter({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
|
|
37
|
+
|
|
38
|
+
export declare function DialogHeader({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
|
|
39
|
+
|
|
40
|
+
export declare function DialogOverlay({ className, ...props }: React_2.ComponentProps<typeof DialogPrimitive.Overlay>): JSX.Element;
|
|
41
|
+
|
|
42
|
+
export declare function DialogPortal({ ...props }: React_2.ComponentProps<typeof DialogPrimitive.Portal>): JSX.Element;
|
|
43
|
+
|
|
44
|
+
export declare function DialogTitle({ className, ...props }: React_2.ComponentProps<typeof DialogPrimitive.Title>): JSX.Element;
|
|
45
|
+
|
|
46
|
+
export declare function DialogTrigger({ ...props }: React_2.ComponentProps<typeof DialogPrimitive.Trigger>): JSX.Element;
|
|
47
|
+
|
|
48
|
+
export { }
|