@edsis/angular 0.0.2 → 21.0.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 +74 -178
- package/fesm2022/edsis-angular-sdk-access.mjs +1365 -0
- package/fesm2022/edsis-angular-sdk-access.mjs.map +1 -0
- package/fesm2022/edsis-angular-sdk-approval.mjs +1259 -0
- package/fesm2022/edsis-angular-sdk-approval.mjs.map +1 -0
- package/fesm2022/edsis-angular-sdk-auth.mjs +254 -0
- package/fesm2022/edsis-angular-sdk-auth.mjs.map +1 -0
- package/fesm2022/edsis-angular-sdk-employee.mjs +284 -0
- package/fesm2022/edsis-angular-sdk-employee.mjs.map +1 -0
- package/fesm2022/edsis-angular-sdk-health.mjs +96 -0
- package/fesm2022/edsis-angular-sdk-health.mjs.map +1 -0
- package/fesm2022/edsis-angular-sdk-shared.mjs +2740 -0
- package/fesm2022/edsis-angular-sdk-shared.mjs.map +1 -0
- package/fesm2022/edsis-angular-sdk-storage.mjs +288 -0
- package/fesm2022/edsis-angular-sdk-storage.mjs.map +1 -0
- package/fesm2022/edsis-angular-sdk-user.mjs +489 -0
- package/fesm2022/edsis-angular-sdk-user.mjs.map +1 -0
- package/fesm2022/edsis-angular-sdk.mjs +75 -0
- package/fesm2022/edsis-angular-sdk.mjs.map +1 -0
- package/fesm2022/edsis-angular.mjs +0 -5707
- package/fesm2022/edsis-angular.mjs.map +1 -1
- package/package.json +47 -46
- package/types/edsis-angular-sdk-access.d.ts +547 -0
- package/types/edsis-angular-sdk-approval.d.ts +638 -0
- package/types/edsis-angular-sdk-auth.d.ts +128 -0
- package/types/edsis-angular-sdk-employee.d.ts +159 -0
- package/types/edsis-angular-sdk-health.d.ts +35 -0
- package/types/edsis-angular-sdk-shared.d.ts +176 -0
- package/types/edsis-angular-sdk-storage.d.ts +102 -0
- package/types/edsis-angular-sdk-user.d.ts +189 -0
- package/types/edsis-angular-sdk.d.ts +26 -0
- package/types/edsis-angular.d.ts +1 -824
- package/src/lib/styles/USAGE.md +0 -238
- package/src/lib/styles/container.css +0 -38
- package/src/lib/styles/fonts/commit-mono/CommitMonoVariable.woff2 +0 -0
- package/src/lib/styles/fonts/commit-mono/commit-mono.css +0 -2
- package/src/lib/styles/fonts/inter/InterVariable-Italic.woff2 +0 -0
- package/src/lib/styles/fonts/inter/InterVariable.woff2 +0 -0
- package/src/lib/styles/fonts/inter/inter.css +0 -2
- package/src/lib/styles/icons/README.md +0 -313
- package/src/lib/styles/icons/lucide.svg +0 -9768
- package/src/lib/styles/icons/material-symbols.css +0 -48
- package/src/lib/styles/main.css +0 -24
- package/src/lib/styles/tailwind/component/card.css +0 -7
- package/src/lib/styles/tailwind/tailwind.css +0 -144
- package/src/lib/styles/theme.css +0 -406
package/src/lib/styles/USAGE.md
DELETED
|
@@ -1,238 +0,0 @@
|
|
|
1
|
-
# Style System Usage Guide
|
|
2
|
-
|
|
3
|
-
This library provides a comprehensive style system with themes, fonts, icons, and Tailwind CSS integration.
|
|
4
|
-
|
|
5
|
-
## 📦 Installation in Your App
|
|
6
|
-
|
|
7
|
-
## Workspace Rule For Local Apps
|
|
8
|
-
|
|
9
|
-
For applications inside this repository, every app under `projects/application/**/src/styles.css` must import the shared library stylesheet instead of creating a separate Tailwind entry.
|
|
10
|
-
|
|
11
|
-
Use this command to generate a new app and wire its `styles.css` to the library automatically:
|
|
12
|
-
|
|
13
|
-
```bash
|
|
14
|
-
npm run generate:app -- --name my-app --prefix my --project-root projects/application/mfe/my-app
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
If you need to resync existing apps manually, run:
|
|
18
|
-
|
|
19
|
-
```bash
|
|
20
|
-
npm run setup:app-styles
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
The shared Tailwind entry scans all source files under `projects/application/**/*.{html,ts,js}`, so new apps are included automatically as long as their `styles.css` imports the library `main.css`.
|
|
24
|
-
|
|
25
|
-
### 1. Import the Main Stylesheet
|
|
26
|
-
|
|
27
|
-
Add this to your application's `styles.css` or main style file:
|
|
28
|
-
|
|
29
|
-
```css
|
|
30
|
-
/* Import all library styles */
|
|
31
|
-
@import '@edsis/angular/styles/main.css';
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
Or import in your `angular.json`:
|
|
35
|
-
|
|
36
|
-
```json
|
|
37
|
-
{
|
|
38
|
-
"projects": {
|
|
39
|
-
"your-app": {
|
|
40
|
-
"architect": {
|
|
41
|
-
"build": {
|
|
42
|
-
"options": {
|
|
43
|
-
"styles": ["node_modules/@edsis/angular/styles/main.css", "src/styles.css"]
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
### 2. What's Included
|
|
53
|
-
|
|
54
|
-
The `main.css` includes:
|
|
55
|
-
|
|
56
|
-
- ✅ Theme system with 15+ color schemes (light & dark)
|
|
57
|
-
- ✅ Inter font (sans-serif)
|
|
58
|
-
- ✅ CommitMono font (monospace)
|
|
59
|
-
- ✅ Lucide icons (SVG sprite)
|
|
60
|
-
- ✅ Tailwind CSS v4 with custom design tokens
|
|
61
|
-
- ✅ Container layouts (boxed/full-width)
|
|
62
|
-
- ✅ Appearance modes (default/glass)
|
|
63
|
-
|
|
64
|
-
## 🎨 Using Color Schemes
|
|
65
|
-
|
|
66
|
-
Apply color schemes using the `data-scheme` attribute:
|
|
67
|
-
|
|
68
|
-
```html
|
|
69
|
-
<html data-scheme="blue">
|
|
70
|
-
<!-- Your app -->
|
|
71
|
-
</html>
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
Available schemes:
|
|
75
|
-
|
|
76
|
-
- `default` (zinc - default)
|
|
77
|
-
- `red`, `rose`, `orange`, `green`, `blue`, `yellow`, `violet`
|
|
78
|
-
- `slate`, `gray`, `stone`, `neutral`
|
|
79
|
-
|
|
80
|
-
### Dark Mode
|
|
81
|
-
|
|
82
|
-
Add the `dark` class to enable dark theme:
|
|
83
|
-
|
|
84
|
-
```html
|
|
85
|
-
<html data-scheme="blue" class="dark">
|
|
86
|
-
<!-- Dark mode with blue scheme -->
|
|
87
|
-
</html>
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
## 🖼️ Container Layouts
|
|
91
|
-
|
|
92
|
-
Control content width using `data-container`:
|
|
93
|
-
|
|
94
|
-
```html
|
|
95
|
-
<!-- Boxed layout (default) -->
|
|
96
|
-
<html data-container="boxed">
|
|
97
|
-
<!-- Your app -->
|
|
98
|
-
</html>
|
|
99
|
-
|
|
100
|
-
<!-- Full width layout -->
|
|
101
|
-
<html data-container="full">
|
|
102
|
-
<!-- Your app -->
|
|
103
|
-
</html>
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
## ✨ Layout Behavior
|
|
107
|
-
|
|
108
|
-
Sticky header/footer behavior is built in by default. You only need to set the container and layout attributes.
|
|
109
|
-
|
|
110
|
-
## 🔤 Typography
|
|
111
|
-
|
|
112
|
-
Fonts are automatically loaded:
|
|
113
|
-
|
|
114
|
-
```css
|
|
115
|
-
/* Use Inter for body text */
|
|
116
|
-
body {
|
|
117
|
-
font-family: var(--font-sans);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
/* Use CommitMono for code */
|
|
121
|
-
code {
|
|
122
|
-
font-family: var(--font-mono);
|
|
123
|
-
}
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
## 🎯 Lucide Icons
|
|
127
|
-
|
|
128
|
-
Icons are available as SVG sprite at:
|
|
129
|
-
|
|
130
|
-
- Path: `@edsis/angular/styles/icons/lucide.svg`
|
|
131
|
-
- Usage with Angular:
|
|
132
|
-
|
|
133
|
-
```html
|
|
134
|
-
<!-- Use lucide icons -->
|
|
135
|
-
<svg class="w-6 h-6">
|
|
136
|
-
<use href="node_modules/@edsis/angular/styles/icons/lucide.svg#home"></use>
|
|
137
|
-
</svg>
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
## 🎨 Tailwind CSS
|
|
141
|
-
|
|
142
|
-
All Tailwind utilities are available with custom design tokens:
|
|
143
|
-
|
|
144
|
-
```html
|
|
145
|
-
<div class="bg-background text-foreground border border-border rounded-lg p-4">
|
|
146
|
-
<h1 class="text-2xl font-semibold text-primary">Hello World</h1>
|
|
147
|
-
</div>
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
### Custom Design Tokens
|
|
151
|
-
|
|
152
|
-
- Colors: Use theme-aware colors like `bg-primary`, `text-foreground`, `border-border`
|
|
153
|
-
- Spacing: Standard Tailwind spacing scale
|
|
154
|
-
- Typography: Custom font weights (normal: 450, medium: 550, semibold: 650, bold: 700)
|
|
155
|
-
|
|
156
|
-
## 📁 Partial Imports (Advanced)
|
|
157
|
-
|
|
158
|
-
If you only need specific parts:
|
|
159
|
-
|
|
160
|
-
```css
|
|
161
|
-
/* Import only theme colors */
|
|
162
|
-
@import '@edsis/angular/styles/theme.css';
|
|
163
|
-
|
|
164
|
-
/* Import only fonts */
|
|
165
|
-
@import '@edsis/angular/styles/fonts/inter/inter.css';
|
|
166
|
-
@import '@edsis/angular/styles/fonts/commit-mono/commit-mono.css';
|
|
167
|
-
|
|
168
|
-
/* Import only Tailwind */
|
|
169
|
-
@import '@edsis/angular/styles/tailwind/tailwind.css';
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
## 🚀 Example Setup
|
|
173
|
-
|
|
174
|
-
**angular.json:**
|
|
175
|
-
|
|
176
|
-
```json
|
|
177
|
-
{
|
|
178
|
-
"styles": ["node_modules/@edsis/angular/styles/main.css", "src/styles.css"]
|
|
179
|
-
}
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
**index.html:**
|
|
183
|
-
|
|
184
|
-
```html
|
|
185
|
-
<!DOCTYPE html>
|
|
186
|
-
<html lang="en" data-theme="light" data-scheme="blue" data-container="boxed" data-layout="vertical">
|
|
187
|
-
<head>
|
|
188
|
-
<meta charset="utf-8" />
|
|
189
|
-
<title>My App</title>
|
|
190
|
-
</head>
|
|
191
|
-
<body class="font-sans antialiased">
|
|
192
|
-
<app-root></app-root>
|
|
193
|
-
</body>
|
|
194
|
-
</html>
|
|
195
|
-
```
|
|
196
|
-
|
|
197
|
-
**Component:**
|
|
198
|
-
|
|
199
|
-
```typescript
|
|
200
|
-
@Component({
|
|
201
|
-
selector: 'app-root',
|
|
202
|
-
template: `
|
|
203
|
-
<div class="min-h-screen bg-background text-foreground">
|
|
204
|
-
<header class="border-b border-border p-4">
|
|
205
|
-
<h1 class="text-2xl font-semibold text-primary">My App</h1>
|
|
206
|
-
</header>
|
|
207
|
-
<main class="p-4">
|
|
208
|
-
<div class="card">
|
|
209
|
-
<p class="text-muted-foreground">Welcome to the app</p>
|
|
210
|
-
</div>
|
|
211
|
-
</main>
|
|
212
|
-
</div>
|
|
213
|
-
`,
|
|
214
|
-
})
|
|
215
|
-
export class AppComponent {}
|
|
216
|
-
```
|
|
217
|
-
|
|
218
|
-
## 🔄 Dynamic Theme Switching
|
|
219
|
-
|
|
220
|
-
Switch themes dynamically in TypeScript:
|
|
221
|
-
|
|
222
|
-
```typescript
|
|
223
|
-
// Use the built-in defaults explicitly
|
|
224
|
-
document.documentElement.setAttribute('data-theme', 'light');
|
|
225
|
-
|
|
226
|
-
// Change color scheme
|
|
227
|
-
document.documentElement.setAttribute('data-scheme', 'blue');
|
|
228
|
-
|
|
229
|
-
// Change container
|
|
230
|
-
document.documentElement.setAttribute('data-container', 'boxed');
|
|
231
|
-
|
|
232
|
-
// Change layout
|
|
233
|
-
document.documentElement.setAttribute('data-layout', 'vertical');
|
|
234
|
-
```
|
|
235
|
-
|
|
236
|
-
## 📚 More Information
|
|
237
|
-
|
|
238
|
-
See `/styles/README.md` for technical details about the theme structure.
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
header {
|
|
2
|
-
@apply shrink-0 sticky top-0 z-10 bg-background border-b border-border;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
main {
|
|
6
|
-
@apply flex-1 overflow-y-auto;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
footer {
|
|
10
|
-
@apply shrink-0 sticky bottom-0 z-10 bg-background border-t border-border;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
aside {
|
|
14
|
-
/* Keep flat aside styling */
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
[data-container='boxed'] .layout {
|
|
18
|
-
@apply p-16!;
|
|
19
|
-
background-color: var(--muted);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.dark[data-container='boxed'] .layout,
|
|
23
|
-
.dark [data-container='boxed'] .layout,
|
|
24
|
-
[data-theme='dark'][data-container='boxed'] .layout,
|
|
25
|
-
[data-theme='dark'] [data-container='boxed'] .layout {
|
|
26
|
-
background-color: color-mix(in oklab, var(--background) 76%, black 24%);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
@media (prefers-color-scheme: dark) {
|
|
30
|
-
[data-theme='system'][data-container='boxed'] .layout,
|
|
31
|
-
[data-theme='system'] [data-container='boxed'] .layout {
|
|
32
|
-
background-color: color-mix(in oklab, var(--background) 76%, black 24%);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
[data-container='boxed'] .layout-content {
|
|
37
|
-
@apply max-w-7xl! mx-auto! rounded-layout border border-border shadow-xs;
|
|
38
|
-
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,313 +0,0 @@
|
|
|
1
|
-
# Lucide Icons Usage Guide
|
|
2
|
-
|
|
3
|
-
Legacy sprite guide for `lucide.svg`.
|
|
4
|
-
|
|
5
|
-
Runtime icons in `@edsis/angular` now use `@lucide/angular` v1 and `LucideDynamicIcon`, so application
|
|
6
|
-
navigation and the shared `<icon>` component no longer require copying `lucide.svg` into app assets.
|
|
7
|
-
|
|
8
|
-
Keep this guide only if you still need the old sprite file for direct manual `<use href="...">` SVG usage.
|
|
9
|
-
|
|
10
|
-
## 📍 Icon Location
|
|
11
|
-
|
|
12
|
-
The Lucide SVG sprite is located at:
|
|
13
|
-
|
|
14
|
-
```text
|
|
15
|
-
projects/library/angular/src/lib/styles/icons/lucide.svg
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
## 🚀 Setup in Your Application
|
|
19
|
-
|
|
20
|
-
To use Lucide icons in your Angular application:
|
|
21
|
-
|
|
22
|
-
### Option 1: Copy via angular.json Assets (Recommended)
|
|
23
|
-
|
|
24
|
-
1. Add the shared sprite to your application's asset pipeline:
|
|
25
|
-
|
|
26
|
-
```json
|
|
27
|
-
"assets": [
|
|
28
|
-
{
|
|
29
|
-
"glob": "**/*",
|
|
30
|
-
"input": "projects/your-app/public"
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
"glob": "lucide.svg",
|
|
34
|
-
"input": "projects/library/angular/src/lib/styles/icons"
|
|
35
|
-
}
|
|
36
|
-
]
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
1. Reference icons using the public path:
|
|
40
|
-
|
|
41
|
-
```html
|
|
42
|
-
<svg class="w-6 h-6">
|
|
43
|
-
<use href="lucide.svg#icon-name"></use>
|
|
44
|
-
</svg>
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
### Option 2: Copy to Public Folder Manually
|
|
48
|
-
|
|
49
|
-
1. Copy `lucide.svg` to your application's public folder:
|
|
50
|
-
|
|
51
|
-
```bash
|
|
52
|
-
cp projects/library/angular/src/lib/styles/icons/lucide.svg projects/your-app/public/lucide.svg
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
1. Reference icons using the public path shown above.
|
|
56
|
-
|
|
57
|
-
### Option 3: Import from node_modules
|
|
58
|
-
|
|
59
|
-
After building the library, reference from node_modules:
|
|
60
|
-
|
|
61
|
-
```html
|
|
62
|
-
<svg class="w-6 h-6">
|
|
63
|
-
<use href="node_modules/@edsis/angular/styles/icons/lucide.svg#icon-name"></use>
|
|
64
|
-
</svg>
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
## 🎨 How to Use Icons
|
|
68
|
-
|
|
69
|
-
### Basic Usage
|
|
70
|
-
|
|
71
|
-
Use the SVG `<use>` element to reference icons from the sprite:
|
|
72
|
-
|
|
73
|
-
```html
|
|
74
|
-
<svg class="w-6 h-6" aria-hidden="true">
|
|
75
|
-
<use href="lucide.svg#icon-name"></use>
|
|
76
|
-
</svg>
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
### With Angular Property Binding
|
|
80
|
-
|
|
81
|
-
```html
|
|
82
|
-
<svg class="w-6 h-6" [attr.aria-label]="iconName">
|
|
83
|
-
<use [attr.href]="'lucide.svg#' + iconName"></use>
|
|
84
|
-
</svg>
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
### Dynamic Icons
|
|
88
|
-
|
|
89
|
-
```typescript
|
|
90
|
-
// In component
|
|
91
|
-
protected currentIcon = signal('heart');
|
|
92
|
-
|
|
93
|
-
// In template
|
|
94
|
-
<svg class="w-6 h-6">
|
|
95
|
-
<use [attr.href]="'lucide.svg#' + currentIcon()"></use>
|
|
96
|
-
</svg>
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
### Conditional Icons
|
|
100
|
-
|
|
101
|
-
```html
|
|
102
|
-
<svg class="w-4 h-4">
|
|
103
|
-
<use [attr.href]="'lucide.svg#' + (isOpen() ? 'chevron-up' : 'chevron-down')"></use>
|
|
104
|
-
</svg>
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
## 🎯 Common Icon Names
|
|
108
|
-
|
|
109
|
-
Here are some commonly used icons:
|
|
110
|
-
|
|
111
|
-
### Navigation & UI
|
|
112
|
-
|
|
113
|
-
- `home`, `menu`, `x`, `chevron-left`, `chevron-right`, `chevron-up`, `chevron-down`
|
|
114
|
-
- `arrow-left`, `arrow-right`, `arrow-up`, `arrow-down`
|
|
115
|
-
- `more-horizontal`, `more-vertical`
|
|
116
|
-
|
|
117
|
-
### Actions
|
|
118
|
-
|
|
119
|
-
- `plus`, `minus`, `edit`, `trash`, `trash-2`, `copy`, `save`
|
|
120
|
-
- `search`, `filter`, `settings`, `refresh-cw`, `rotate-ccw`
|
|
121
|
-
- `upload`, `download`, `share`, `external-link`
|
|
122
|
-
|
|
123
|
-
### Status & Feedback
|
|
124
|
-
|
|
125
|
-
- `check`, `check-circle`, `x-circle`, `alert-circle`, `info`
|
|
126
|
-
- `alert-triangle`, `help-circle`, `loader`
|
|
127
|
-
|
|
128
|
-
### Media & Content
|
|
129
|
-
|
|
130
|
-
- `image`, `file`, `folder`, `file-text`, `video`, `music`
|
|
131
|
-
- `camera`, `mic`, `volume`, `volume-x`
|
|
132
|
-
|
|
133
|
-
### Communication
|
|
134
|
-
|
|
135
|
-
- `mail`, `message-circle`, `message-square`, `bell`, `phone`
|
|
136
|
-
- `send`, `inbox`, `at-sign`
|
|
137
|
-
|
|
138
|
-
### User & Social
|
|
139
|
-
|
|
140
|
-
- `user`, `users`, `user-plus`, `user-minus`, `user-check`
|
|
141
|
-
- `heart`, `star`, `thumbs-up`, `thumbs-down`, `smile`
|
|
142
|
-
|
|
143
|
-
### Theme
|
|
144
|
-
|
|
145
|
-
- `sun`, `moon`, `monitor`, `smartphone`, `tablet`
|
|
146
|
-
|
|
147
|
-
### Special
|
|
148
|
-
|
|
149
|
-
- `sparkles`, `zap`, `trending-up`, `trending-down`
|
|
150
|
-
- `circle`, `square`, `triangle`, `hexagon`
|
|
151
|
-
|
|
152
|
-
## 🎨 Styling Icons
|
|
153
|
-
|
|
154
|
-
### Size Classes (Tailwind)
|
|
155
|
-
|
|
156
|
-
```html
|
|
157
|
-
<!-- Small -->
|
|
158
|
-
<svg class="w-4 h-4">...</svg>
|
|
159
|
-
|
|
160
|
-
<!-- Medium -->
|
|
161
|
-
<svg class="w-5 h-5">...</svg>
|
|
162
|
-
|
|
163
|
-
<!-- Large -->
|
|
164
|
-
<svg class="w-6 h-6">...</svg>
|
|
165
|
-
|
|
166
|
-
<!-- Extra Large -->
|
|
167
|
-
<svg class="w-8 h-8">...</svg>
|
|
168
|
-
```
|
|
169
|
-
|
|
170
|
-
### Colors
|
|
171
|
-
|
|
172
|
-
Icons inherit the text color by default:
|
|
173
|
-
|
|
174
|
-
```html
|
|
175
|
-
<!-- Uses current text color -->
|
|
176
|
-
<svg class="w-6 h-6 text-primary">...</svg>
|
|
177
|
-
|
|
178
|
-
<!-- Success color -->
|
|
179
|
-
<svg class="w-6 h-6 text-success">...</svg>
|
|
180
|
-
|
|
181
|
-
<!-- Destructive color -->
|
|
182
|
-
<svg class="w-6 h-6 text-destructive">...</svg>
|
|
183
|
-
|
|
184
|
-
<!-- Muted color -->
|
|
185
|
-
<svg class="w-6 h-6 text-muted-foreground">...</svg>
|
|
186
|
-
```
|
|
187
|
-
|
|
188
|
-
### Stroke Width
|
|
189
|
-
|
|
190
|
-
Lucide icons use `stroke-width: 2` by default. You can customize:
|
|
191
|
-
|
|
192
|
-
```html
|
|
193
|
-
<svg class="w-6 h-6" style="stroke-width: 1.5">...</svg>
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
## 🧩 Example Components
|
|
197
|
-
|
|
198
|
-
### Icon Button Component
|
|
199
|
-
|
|
200
|
-
```typescript
|
|
201
|
-
@Component({
|
|
202
|
-
selector: 'app-icon-button',
|
|
203
|
-
template: `
|
|
204
|
-
<button [class]="'inline-flex items-center gap-2 px-4 py-2 rounded-md ' + variant()">
|
|
205
|
-
<svg class="w-4 h-4" aria-hidden="true">
|
|
206
|
-
<use [attr.href]="'lucide.svg#' + icon()"></use>
|
|
207
|
-
</svg>
|
|
208
|
-
<ng-content />
|
|
209
|
-
</button>
|
|
210
|
-
`,
|
|
211
|
-
})
|
|
212
|
-
export class IconButton {
|
|
213
|
-
icon = input.required<string>();
|
|
214
|
-
variant = input('bg-primary text-primary-foreground');
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
// Usage:
|
|
218
|
-
// <app-icon-button icon="save">Save</app-icon-button>
|
|
219
|
-
```
|
|
220
|
-
|
|
221
|
-
### Icon Only Button
|
|
222
|
-
|
|
223
|
-
```html
|
|
224
|
-
<button
|
|
225
|
-
type="button"
|
|
226
|
-
class="inline-flex items-center justify-center w-10 h-10 rounded-md border border-input hover:bg-accent"
|
|
227
|
-
aria-label="Settings"
|
|
228
|
-
>
|
|
229
|
-
<svg class="w-5 h-5" aria-hidden="true">
|
|
230
|
-
<use href="lucide.svg#settings"></use>
|
|
231
|
-
</svg>
|
|
232
|
-
</button>
|
|
233
|
-
```
|
|
234
|
-
|
|
235
|
-
### Icon with Text
|
|
236
|
-
|
|
237
|
-
```html
|
|
238
|
-
<div class="inline-flex items-center gap-2">
|
|
239
|
-
<svg class="w-5 h-5 text-success" aria-hidden="true">
|
|
240
|
-
<use href="lucide.svg#check-circle"></use>
|
|
241
|
-
</svg>
|
|
242
|
-
<span>Task completed</span>
|
|
243
|
-
</div>
|
|
244
|
-
```
|
|
245
|
-
|
|
246
|
-
## ♿ Accessibility
|
|
247
|
-
|
|
248
|
-
### When icon is decorative (has text)
|
|
249
|
-
|
|
250
|
-
```html
|
|
251
|
-
<button>
|
|
252
|
-
<svg class="w-4 h-4" aria-hidden="true">
|
|
253
|
-
<use href="lucide.svg#save"></use>
|
|
254
|
-
</svg>
|
|
255
|
-
Save
|
|
256
|
-
</button>
|
|
257
|
-
```
|
|
258
|
-
|
|
259
|
-
### When icon is meaningful (icon-only)
|
|
260
|
-
|
|
261
|
-
```html
|
|
262
|
-
<button aria-label="Close dialog">
|
|
263
|
-
<svg class="w-4 h-4">
|
|
264
|
-
<use href="lucide.svg#x"></use>
|
|
265
|
-
</svg>
|
|
266
|
-
</button>
|
|
267
|
-
```
|
|
268
|
-
|
|
269
|
-
## 📚 Full Icon List
|
|
270
|
-
|
|
271
|
-
For a complete list of available icons, visit:
|
|
272
|
-
|
|
273
|
-
- [Lucide Icons Website](https://lucide.dev/icons/)
|
|
274
|
-
- Browse the `lucide.svg` file directly
|
|
275
|
-
|
|
276
|
-
## 💡 Tips
|
|
277
|
-
|
|
278
|
-
1. **Always set width and height** to prevent layout shift
|
|
279
|
-
2. **Use aria-hidden="true"** when icon is decorative
|
|
280
|
-
3. **Provide aria-label** when icon is the only content
|
|
281
|
-
4. **Use consistent sizing** across your application
|
|
282
|
-
5. **Icons inherit currentColor** by default
|
|
283
|
-
6. **Combine with Tailwind utilities** for quick styling
|
|
284
|
-
|
|
285
|
-
## 🔄 Updating Icons
|
|
286
|
-
|
|
287
|
-
To update the Lucide icon sprite to the latest version:
|
|
288
|
-
|
|
289
|
-
1. Install or update `lucide-static` package:
|
|
290
|
-
|
|
291
|
-
```bash
|
|
292
|
-
npm install --save-dev lucide-static@latest
|
|
293
|
-
```
|
|
294
|
-
|
|
295
|
-
1. Copy the sprite to library:
|
|
296
|
-
|
|
297
|
-
```bash
|
|
298
|
-
cp node_modules/lucide-static/sprite.svg projects/library/angular/src/lib/styles/icons/lucide.svg
|
|
299
|
-
```
|
|
300
|
-
|
|
301
|
-
1. Ensure your application copies the sprite from the library via `angular.json` assets, or copy it manually if needed:
|
|
302
|
-
|
|
303
|
-
```bash
|
|
304
|
-
cp projects/library/angular/src/lib/styles/icons/lucide.svg projects/your-app/public/lucide.svg
|
|
305
|
-
```
|
|
306
|
-
|
|
307
|
-
1. Rebuild the library:
|
|
308
|
-
|
|
309
|
-
```bash
|
|
310
|
-
npm run build library
|
|
311
|
-
```
|
|
312
|
-
|
|
313
|
-
**Current version:** lucide-static v0.545.0 (1000+ icons)
|