@billy_mcdowell/prmn-angular-v3 0.0.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 +242 -0
- package/fesm2022/billy_mcdowell-prmn-angular-v3.mjs +9744 -0
- package/fesm2022/billy_mcdowell-prmn-angular-v3.mjs.map +1 -0
- package/index.d.ts +2790 -0
- package/package.json +24 -0
package/README.md
ADDED
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
# PRMN Angular UI Library
|
|
2
|
+
|
|
3
|
+
Reusable, themeable UI primitives for Angular, built on top of `@spartan-ng/brain` and Tailwind CSS.
|
|
4
|
+
|
|
5
|
+
> This README explains how to consume the `ui` library **from an external Angular application**, not how to develop the library itself.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Package name
|
|
10
|
+
|
|
11
|
+
The library is published from the `projects/ui` workspace library.
|
|
12
|
+
In the examples below, we assume the npm package name is `ui`:
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install ui
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
If you publish under a different name (for example `@your-org/ui`), adjust the import paths accordingly.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Prerequisites
|
|
23
|
+
|
|
24
|
+
- **Angular**: `^20.3.0` (standalone components recommended)
|
|
25
|
+
- **Node / package manager**: Node 18+ with npm, pnpm, or yarn
|
|
26
|
+
- **CSS tooling**:
|
|
27
|
+
- `tailwindcss@^4`
|
|
28
|
+
- `@tailwindcss/postcss`
|
|
29
|
+
- **UI dependencies used by this library** (install them in your app):
|
|
30
|
+
- `@spartan-ng/brain`
|
|
31
|
+
- `@ng-icons/core`, `@ng-icons/lucide` (for icons)
|
|
32
|
+
- `embla-carousel-angular` (for carousel components)
|
|
33
|
+
- `ngx-sonner` (for toast notifications)
|
|
34
|
+
|
|
35
|
+
You may not need all of these for every project, but they are used across components exported by this library.
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## 1. Install the library and peer dependencies
|
|
40
|
+
|
|
41
|
+
From your Angular application:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
npm install ui @spartan-ng/brain @ng-icons/core @ng-icons/lucide embla-carousel-angular ngx-sonner tailwindcss @tailwindcss/postcss
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
If you are using pnpm or yarn, use the equivalent command.
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## 2. Configure Tailwind CSS 4 + PostCSS
|
|
52
|
+
|
|
53
|
+
Create (or update) `postcss.config.json` in the root of your Angular app:
|
|
54
|
+
|
|
55
|
+
```json
|
|
56
|
+
{
|
|
57
|
+
"plugins": {
|
|
58
|
+
"@tailwindcss/postcss": {}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Tailwind 4 uses this PostCSS plugin to process the special `@import "tailwindcss";` directive that the library’s styles rely on.
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## 3. Import the styles in your global stylesheet
|
|
68
|
+
|
|
69
|
+
In your app’s global stylesheet (for example `src/styles.css`), add the following:
|
|
70
|
+
|
|
71
|
+
```css
|
|
72
|
+
@import "tailwindcss";
|
|
73
|
+
@import "@spartan-ng/brain/hlm-tailwind-preset.css";
|
|
74
|
+
|
|
75
|
+
/* Theme tokens & base styles matching this UI library.
|
|
76
|
+
You can start with these values and tweak colors/typography as needed. */
|
|
77
|
+
:root {
|
|
78
|
+
--background: #ffffff;
|
|
79
|
+
--foreground: #1d2327;
|
|
80
|
+
--card: #ffffff;
|
|
81
|
+
--card-foreground: #1d2327;
|
|
82
|
+
--popover: #ffffff;
|
|
83
|
+
--popover-foreground: #1d2327;
|
|
84
|
+
--primary: #21016b;
|
|
85
|
+
--primary-foreground: #ffffff;
|
|
86
|
+
--secondary: #4e5a62;
|
|
87
|
+
--secondary-foreground: #ffffff;
|
|
88
|
+
--muted: #f3f5f6;
|
|
89
|
+
--muted-foreground: #5f6c75;
|
|
90
|
+
--accent: #f78e1e;
|
|
91
|
+
--accent-foreground: #121516;
|
|
92
|
+
--destructive: #cb2420;
|
|
93
|
+
--destructive-foreground: #ffffff;
|
|
94
|
+
--border: #b8c0c6;
|
|
95
|
+
--input: #b8c0c6;
|
|
96
|
+
--ring: #5f6c75;
|
|
97
|
+
--sidebar: #f3f5f6;
|
|
98
|
+
--sidebar-foreground: #1d2327;
|
|
99
|
+
--sidebar-primary: #21016b;
|
|
100
|
+
--sidebar-primary-foreground: #ffffff;
|
|
101
|
+
--sidebar-accent: #f78e1e;
|
|
102
|
+
--sidebar-accent-foreground: #121516;
|
|
103
|
+
--sidebar-border: #b8c0c6;
|
|
104
|
+
--sidebar-ring: #5f6c75;
|
|
105
|
+
--font-sans: Libre Franklin, ui-sans-serif, sans-serif, system-ui;
|
|
106
|
+
--font-serif: Merriweather, ui-serif, serif;
|
|
107
|
+
--font-mono: Open Sans, ui-sans-serif, sans-serif, system-ui;
|
|
108
|
+
--radius: 0.125rem;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.dark {
|
|
112
|
+
--background: #1d2327;
|
|
113
|
+
--foreground: #ffffff;
|
|
114
|
+
--card: #1d2327;
|
|
115
|
+
--card-foreground: #ffffff;
|
|
116
|
+
--popover: #1d2327;
|
|
117
|
+
--popover-foreground: #ffffff;
|
|
118
|
+
--primary: #21016b;
|
|
119
|
+
--primary-foreground: #ffffff;
|
|
120
|
+
--secondary: #4e5a62;
|
|
121
|
+
--secondary-foreground: #ffffff;
|
|
122
|
+
--muted: #424d55;
|
|
123
|
+
--muted-foreground: #5f6c75;
|
|
124
|
+
--accent: #f78e1e;
|
|
125
|
+
--accent-foreground: #121516;
|
|
126
|
+
--destructive: #cb2420;
|
|
127
|
+
--destructive-foreground: #ffffff;
|
|
128
|
+
--border: #5f6c75;
|
|
129
|
+
--input: #424d55;
|
|
130
|
+
--ring: #5f6c75;
|
|
131
|
+
--sidebar: #1d2327;
|
|
132
|
+
--sidebar-foreground: #ffffff;
|
|
133
|
+
--sidebar-primary: #21016b;
|
|
134
|
+
--sidebar-primary-foreground: #ffffff;
|
|
135
|
+
--sidebar-accent: #f78e1e;
|
|
136
|
+
--sidebar-accent-foreground: #121516;
|
|
137
|
+
--sidebar-border: #5f6c75;
|
|
138
|
+
--sidebar-ring: #5f6c75;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
@layer base {
|
|
142
|
+
* {
|
|
143
|
+
@apply border-border outline-ring/50;
|
|
144
|
+
}
|
|
145
|
+
body {
|
|
146
|
+
@apply bg-background text-foreground;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
Notes:
|
|
152
|
+
|
|
153
|
+
- The color/spacing/font variables above are the same design tokens used by this library (you can customize them as needed).
|
|
154
|
+
- Ensure your `index.html` (or root layout) toggles a `.dark` class on the `<html>` or `<body>` element if you want dark mode.
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
## 4. Import and use components
|
|
159
|
+
|
|
160
|
+
All public components/directives are exported from the library’s public API (`src/public-api.ts`), which is what consumers import from the npm package.
|
|
161
|
+
|
|
162
|
+
### Example: Button
|
|
163
|
+
|
|
164
|
+
```ts
|
|
165
|
+
// app/example/example.component.ts
|
|
166
|
+
import { Component } from '@angular/core';
|
|
167
|
+
import { HlmButton } from 'ui'; // or '@your-org/ui'
|
|
168
|
+
|
|
169
|
+
@Component({
|
|
170
|
+
standalone: true,
|
|
171
|
+
selector: 'app-example',
|
|
172
|
+
imports: [HlmButton],
|
|
173
|
+
template: `
|
|
174
|
+
<button hlmBtn variant="default">
|
|
175
|
+
Primary button
|
|
176
|
+
</button>
|
|
177
|
+
`,
|
|
178
|
+
})
|
|
179
|
+
export class ExampleComponent {}
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
You can also use the convenience import group where available (for example, `HlmButtonImports`):
|
|
183
|
+
|
|
184
|
+
```ts
|
|
185
|
+
import { HlmButtonImports } from 'ui';
|
|
186
|
+
|
|
187
|
+
@Component({
|
|
188
|
+
standalone: true,
|
|
189
|
+
selector: 'app-example',
|
|
190
|
+
imports: [...HlmButtonImports],
|
|
191
|
+
template: `<button hlmBtn>Click me</button>`,
|
|
192
|
+
})
|
|
193
|
+
export class ExampleComponent {}
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
### Other components
|
|
197
|
+
|
|
198
|
+
The library exposes many primitives, for example:
|
|
199
|
+
|
|
200
|
+
- Accordion, Alert, Dialog, Dropdown Menu
|
|
201
|
+
- Button, Badge, Avatar, Breadcrumb
|
|
202
|
+
- Form elements (`Input`, `Textarea`, `Checkbox`, `RadioGroup`, `Switch`, `Select`, `NativeSelect`, etc.)
|
|
203
|
+
- Layout and navigation (`Sidebar`, `NavigationMenu`, `Tabs`, `Pagination`, `Collapsible`, `ScrollArea`, `Resizable`)
|
|
204
|
+
- Feedback components (`AlertDialog`, `Popover`, `Tooltip`, `Sonner` toasts, `Skeleton`, `Spinner`, `Progress`)
|
|
205
|
+
- Typography utilities (`hlmH1`–`hlmH4`, `hlmP`, `hlmLead`, etc.)
|
|
206
|
+
|
|
207
|
+
Each feature is exported from the root package (for example `import { HlmInput } from 'ui';`).
|
|
208
|
+
When in doubt, check the library’s `public-api.ts` for the full list of exports.
|
|
209
|
+
|
|
210
|
+
---
|
|
211
|
+
|
|
212
|
+
## 5. Running your app
|
|
213
|
+
|
|
214
|
+
After installation and setup:
|
|
215
|
+
|
|
216
|
+
```bash
|
|
217
|
+
npm run build # build your Angular app
|
|
218
|
+
npm start # or ng serve
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
You should now see the components rendered with the design system styles from this library.
|
|
222
|
+
|
|
223
|
+
---
|
|
224
|
+
|
|
225
|
+
## Local development / Storybook (optional)
|
|
226
|
+
|
|
227
|
+
If you are working in this monorepo:
|
|
228
|
+
|
|
229
|
+
- **Build the library**:
|
|
230
|
+
|
|
231
|
+
```bash
|
|
232
|
+
npm run build:ui
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
- **Run Storybook for the UI library**:
|
|
236
|
+
|
|
237
|
+
```bash
|
|
238
|
+
npm run storybook
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
These commands are for contributors to this repo; external consumers only need the steps in sections 1–4.
|
|
242
|
+
|