@aphexcms/ui 0.8.5 → 0.8.6
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 +51 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# @aphexcms/ui
|
|
2
|
+
|
|
3
|
+
The shared [shadcn-svelte](https://shadcn-svelte.com) component library behind the [AphexCMS](https://github.com/IcelandicIcecream/aphex) admin.
|
|
4
|
+
|
|
5
|
+
This exists so `cms-core` and first-party plugins render the same controls, and so a plugin author can build a settings panel that looks like the rest of the admin without copying components in. It is a peer dependency of `@aphexcms/cms-core`, not an optional add-on.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pnpm add @aphexcms/ui
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
Each component has its own entry point — there is no root barrel, deliberately, so importing a button doesn't pull the whole library into your chunk:
|
|
16
|
+
|
|
17
|
+
```svelte
|
|
18
|
+
<script lang="ts">
|
|
19
|
+
import { Button } from '@aphexcms/ui/shadcn/button';
|
|
20
|
+
import { Input } from '@aphexcms/ui/shadcn/input';
|
|
21
|
+
import * as Dialog from '@aphexcms/ui/shadcn/dialog';
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<Button variant="outline">Save</Button>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Styling is Tailwind CSS v4 with shared CSS variables. Import them once, in your root stylesheet:
|
|
28
|
+
|
|
29
|
+
```css
|
|
30
|
+
@import '@aphexcms/ui/shadcn/css';
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## What's in it
|
|
34
|
+
|
|
35
|
+
Roughly thirty-five components: the shadcn-svelte set (button, input, select, dialog, dropdown-menu, popover, sidebar, tabs, tooltip, calendar, command, …) plus a few Aphex additions used by the admin — `bubble`, `marker`, `message`, `message-scroller` and `attachment`, which back the in-admin agent's chat surface.
|
|
36
|
+
|
|
37
|
+
`@aphexcms/ui/utils` exports `cn()` and the `WithElementRef` helper type that the components share.
|
|
38
|
+
|
|
39
|
+
## Adding a component
|
|
40
|
+
|
|
41
|
+
In the Aphex monorepo:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
pnpm shadcn <component-name>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
That runs `shadcn-svelte add` against this package and regenerates the export map. Don't hand-edit `exports` — `scripts/generate-exports.js` owns it, and the build regenerates it.
|
|
48
|
+
|
|
49
|
+
## License
|
|
50
|
+
|
|
51
|
+
MIT
|