@enonic/ui 0.41.1 → 0.42.0
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
CHANGED
|
@@ -54,47 +54,45 @@ yarn add @enonic/ui preact @radix-ui/react-slot focus-trap-react
|
|
|
54
54
|
|
|
55
55
|
## Usage
|
|
56
56
|
|
|
57
|
-
### Import Components
|
|
58
|
-
|
|
59
|
-
```tsx
|
|
60
|
-
import { Button, Input } from '@enonic/ui';
|
|
61
|
-
|
|
62
|
-
function App() {
|
|
63
|
-
return (
|
|
64
|
-
<div>
|
|
65
|
-
<Button variant='primary' size='md'>
|
|
66
|
-
Click Me
|
|
67
|
-
</Button>
|
|
68
|
-
<Input placeholder='Enter text...' />
|
|
69
|
-
</div>
|
|
70
|
-
);
|
|
71
|
-
}
|
|
72
|
-
```
|
|
73
|
-
|
|
74
57
|
### Styles
|
|
75
58
|
|
|
59
|
+
> **Important**: Components render unstyled without CSS setup. Choose one of the paths below before importing components.
|
|
60
|
+
|
|
76
61
|
#### Tailwind CSS
|
|
77
62
|
|
|
78
|
-
If your project uses Tailwind CSS,
|
|
63
|
+
If your project uses Tailwind CSS, import the preset in your main CSS file:
|
|
79
64
|
|
|
80
65
|
```css
|
|
81
|
-
/* Import Tailwind CSS */
|
|
82
66
|
@import 'tailwindcss';
|
|
83
|
-
/* Required by some components that use animations */
|
|
84
67
|
@import 'tw-animate-css';
|
|
85
|
-
|
|
86
|
-
/* Preset styles (includes tokens, base, and utilities) */
|
|
87
68
|
@import '@enonic/ui/preset.css';
|
|
88
69
|
```
|
|
89
70
|
|
|
90
71
|
#### CSS Only
|
|
91
72
|
|
|
92
|
-
If
|
|
73
|
+
If your project does not use Tailwind CSS, import the pre-built stylesheet instead:
|
|
93
74
|
|
|
94
75
|
```css
|
|
95
76
|
@import '@enonic/ui/style.css';
|
|
96
77
|
```
|
|
97
78
|
|
|
79
|
+
### Import Components
|
|
80
|
+
|
|
81
|
+
```tsx
|
|
82
|
+
import { Button, Input } from '@enonic/ui';
|
|
83
|
+
|
|
84
|
+
function App() {
|
|
85
|
+
return (
|
|
86
|
+
<div>
|
|
87
|
+
<Button variant='primary' size='md'>
|
|
88
|
+
Click Me
|
|
89
|
+
</Button>
|
|
90
|
+
<Input placeholder='Enter text...' />
|
|
91
|
+
</div>
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
98
96
|
## Peer Dependencies
|
|
99
97
|
|
|
100
98
|
This library requires one of the following frameworks:
|
|
@@ -60,7 +60,7 @@ export type DialogFooterProps = {
|
|
|
60
60
|
export type DialogDefaultHeaderProps = {
|
|
61
61
|
title: string;
|
|
62
62
|
titleId?: string;
|
|
63
|
-
description?:
|
|
63
|
+
description?: ReactNode;
|
|
64
64
|
descriptionId?: string;
|
|
65
65
|
withClose?: boolean;
|
|
66
66
|
} & ComponentPropsWithoutRef<typeof DialogHeader>;
|
|
@@ -68,7 +68,7 @@ export type DialogStepHeaderProps = {
|
|
|
68
68
|
step: string;
|
|
69
69
|
title: string;
|
|
70
70
|
titleId?: string;
|
|
71
|
-
description?:
|
|
71
|
+
description?: ReactNode;
|
|
72
72
|
descriptionId?: string;
|
|
73
73
|
helper?: string;
|
|
74
74
|
withClose?: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ComponentPropsWithoutRef, ReactElement } from 'react';
|
|
1
|
+
import { ComponentPropsWithoutRef, ReactElement, ReactNode } from 'react';
|
|
2
2
|
export type InputProps = {
|
|
3
3
|
label?: string;
|
|
4
|
-
description?:
|
|
4
|
+
description?: ReactNode;
|
|
5
5
|
error?: string;
|
|
6
6
|
startAddon?: string | ReactElement;
|
|
7
7
|
endAddon?: string | ReactElement;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ComponentPropsWithoutRef } from 'react';
|
|
1
|
+
import { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
2
|
export type TextAreaProps = {
|
|
3
3
|
label?: string;
|
|
4
|
-
description?:
|
|
4
|
+
description?: ReactNode;
|
|
5
5
|
error?: string;
|
|
6
6
|
disabled?: boolean;
|
|
7
7
|
readOnly?: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@enonic/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.42.0",
|
|
4
4
|
"description": "Enonic UI Component Library",
|
|
5
5
|
"author": "Enonic",
|
|
6
6
|
"license": "MIT",
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"typescript",
|
|
26
26
|
"tailwind"
|
|
27
27
|
],
|
|
28
|
+
"style": "dist/styles/style.css",
|
|
28
29
|
"type": "module",
|
|
29
30
|
"main": "dist/enonic-ui.cjs",
|
|
30
31
|
"module": "dist/enonic-ui.es.js",
|
|
@@ -59,7 +60,8 @@
|
|
|
59
60
|
"preact": ">=10.0.0",
|
|
60
61
|
"react": "^19.0.0",
|
|
61
62
|
"react-dom": "^19.0.0",
|
|
62
|
-
"react-virtuoso": "^4.0.0"
|
|
63
|
+
"react-virtuoso": "^4.0.0",
|
|
64
|
+
"tw-animate-css": "^1.0.0"
|
|
63
65
|
},
|
|
64
66
|
"peerDependenciesMeta": {
|
|
65
67
|
"preact": {
|
|
@@ -73,6 +75,9 @@
|
|
|
73
75
|
},
|
|
74
76
|
"react-virtuoso": {
|
|
75
77
|
"optional": true
|
|
78
|
+
},
|
|
79
|
+
"tw-animate-css": {
|
|
80
|
+
"optional": true
|
|
76
81
|
}
|
|
77
82
|
},
|
|
78
83
|
"devDependencies": {
|