@hakistack/ng-daisyui 0.0.0-stage → 0.3.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.
Files changed (41) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +396 -2
  3. package/fesm2022/hakistack-ng-daisyui-document_wasm_glue-CRZHWh0J.mjs +318 -0
  4. package/fesm2022/hakistack-ng-daisyui-document_wasm_glue-CRZHWh0J.mjs.map +1 -0
  5. package/fesm2022/hakistack-ng-daisyui-document_wasm_inline-CuQGC5OT.mjs +6 -0
  6. package/fesm2022/hakistack-ng-daisyui-document_wasm_inline-CuQGC5OT.mjs.map +1 -0
  7. package/fesm2022/hakistack-ng-daisyui-engine_wasm_glue-ClEcb6yJ.mjs +1328 -0
  8. package/fesm2022/hakistack-ng-daisyui-engine_wasm_glue-ClEcb6yJ.mjs.map +1 -0
  9. package/fesm2022/hakistack-ng-daisyui-engine_wasm_inline-DkzGyhGY.mjs +6 -0
  10. package/fesm2022/hakistack-ng-daisyui-engine_wasm_inline-DkzGyhGY.mjs.map +1 -0
  11. package/fesm2022/hakistack-ng-daisyui-image_wasm_glue-Vmd-rsMW.mjs +244 -0
  12. package/fesm2022/hakistack-ng-daisyui-image_wasm_glue-Vmd-rsMW.mjs.map +1 -0
  13. package/fesm2022/hakistack-ng-daisyui-image_wasm_inline-B5FgTetP.mjs +6 -0
  14. package/fesm2022/hakistack-ng-daisyui-image_wasm_inline-B5FgTetP.mjs.map +1 -0
  15. package/fesm2022/hakistack-ng-daisyui-pdfium_worker_inline-DP_6q4MH.mjs +7 -0
  16. package/fesm2022/hakistack-ng-daisyui-pdfium_worker_inline-DP_6q4MH.mjs.map +1 -0
  17. package/fesm2022/hakistack-ng-daisyui.mjs +50204 -0
  18. package/fesm2022/hakistack-ng-daisyui.mjs.map +1 -0
  19. package/package.json +127 -4
  20. package/plugin.cjs +279 -0
  21. package/plugin.mjs +279 -0
  22. package/schematics/collection.json +15 -0
  23. package/schematics/migrate-table-columns/index.js +70 -0
  24. package/schematics/migrate-table-columns/index.js.map +1 -0
  25. package/schematics/migrate-table-columns/migrate-source.js +0 -0
  26. package/schematics/migrate-table-columns/migrate-source.js.map +1 -0
  27. package/schematics/migrate-table-columns/schema.js +3 -0
  28. package/schematics/migrate-table-columns/schema.js.map +1 -0
  29. package/schematics/migrate-table-columns/schema.json +13 -0
  30. package/schematics/ng-add/index.js +265 -0
  31. package/schematics/ng-add/index.js.map +1 -0
  32. package/schematics/ng-add/schema.js +3 -0
  33. package/schematics/ng-add/schema.js.map +1 -0
  34. package/schematics/ng-add/schema.json +38 -0
  35. package/styles-v4.css +6867 -0
  36. package/styles.css +400 -0
  37. package/themes/daisyui-v4.css +80 -0
  38. package/themes/daisyui-v5.css +62 -0
  39. package/themes/kaizen-light.css +63 -0
  40. package/themes/kaizen.css +63 -0
  41. package/types/hakistack-ng-daisyui.d.ts +15693 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Hakistack
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,397 @@
1
- # Temporary Holding Version
1
+ # @hakistack/ng-daisyui
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Reusable Angular UI components built with DaisyUI v5 and Tailwind CSS v4.
4
+
5
+ > **Note:** Primary support is **Tailwind v4 + DaisyUI v5**. A legacy **Tailwind v3 + DaisyUI v4** path is available from the same package via subpath imports (`@hakistack/ng-daisyui/themes/daisyui-v4.css` + `@hakistack/ng-daisyui/themes/daisyui-v4-preset`). `ng add` will prompt you to pick.
6
+
7
+ ## Installation
8
+
9
+ ### Recommended: `ng add`
10
+
11
+ ```bash
12
+ ng add @hakistack/ng-daisyui
13
+ ```
14
+
15
+ You'll be prompted to pick a toolchain:
16
+
17
+ **Tailwind v4 + DaisyUI v5 (recommended)** — `--target v5`
18
+ - Adds `@angular/cdk` + `@angular/aria` to `dependencies`
19
+ - Adds `tailwindcss` + `@tailwindcss/postcss` + `daisyui` to `devDependencies`
20
+ - Ensures `styles.css` contains (in order):
21
+ ```css
22
+ @import "tailwindcss";
23
+ @plugin "daisyui";
24
+ @import "@hakistack/ng-daisyui";
25
+ ```
26
+
27
+ **Tailwind v3 + DaisyUI v4 (legacy)** — `--target v4-legacy`
28
+ - Adds `@angular/cdk` + `@angular/aria` to `dependencies`
29
+ - Adds `tailwindcss@^3`, `daisyui@^4`, `postcss`, `autoprefixer` to `devDependencies`
30
+ - Scaffolds `tailwind.config.js` (extending `@hakistack/ng-daisyui/themes/daisyui-v4-preset`) and `postcss.config.js`
31
+ - Ensures `styles.css` contains `@import "@hakistack/ng-daisyui/themes/daisyui-v4.css"` plus the classic `@tailwind base/components/utilities` directives
32
+
33
+ Flags: `--target <v5|v4-legacy>`, `--skip-install`, `--skip-style-import`, `--project <name>`.
34
+
35
+ ### Manual install
36
+
37
+ ```bash
38
+ npm install @hakistack/ng-daisyui
39
+ ```
40
+
41
+ Tailwind and DaisyUI are set up at the consumer level; `@angular/cdk` and `@angular/aria` share Angular's injector and must be installed alongside the library:
42
+
43
+ ```bash
44
+ npm install tailwindcss@^4.0.0 daisyui@^5.0.0 @angular/cdk @angular/aria
45
+ ```
46
+
47
+ Runtime deps used internally (`@lucide/angular`, `fuse.js`, `motion`, `libphonenumber-js`) are installed automatically with the library.
48
+
49
+ ### Configure Tailwind CSS
50
+
51
+ Add the library import to your `styles.css`:
52
+
53
+ ```css
54
+ @import 'tailwindcss';
55
+ @plugin 'daisyui';
56
+ @import "@hakistack/ng-daisyui";
57
+ ```
58
+
59
+ This single import provides all required CSS class safelists and component styles.
60
+
61
+ ## Components
62
+
63
+ ### DynamicFormComponent
64
+
65
+ Dynamic form builder with wizard/stepper support, auto-save, and conditional logic.
66
+
67
+ ```typescript
68
+ import { DynamicFormComponent, createForm, field } from '@hakistack/ng-daisyui';
69
+
70
+ @Component({
71
+ imports: [DynamicFormComponent],
72
+ template: `
73
+ <hk-dynamic-form [config]="form.config()" />
74
+ <button (click)="form.submit()" class="btn btn-primary">Submit</button>
75
+ <button (click)="form.reset()" class="btn">Reset</button>
76
+ `
77
+ })
78
+ export class MyComponent {
79
+ readonly form = createForm({
80
+ title: 'User Registration',
81
+ fields: [
82
+ field.text('firstName', 'First Name', { required: true }),
83
+ field.email('email', 'Email', { required: true }),
84
+ field.password('password', 'Password', { validation: { minLength: 8 } }),
85
+ field.select('country', ['USA', 'Canada', 'Mexico'], 'Country'),
86
+ ],
87
+ onSubmit: (data) => this.handleSubmit(data),
88
+ });
89
+ }
90
+ ```
91
+
92
+ #### Layout Options
93
+
94
+ ```typescript
95
+ // Vertical (default) - fields stacked
96
+ createForm({
97
+ layout: 'vertical',
98
+ gap: 'md', // 'sm' | 'md' | 'lg'
99
+ fields: [...]
100
+ });
101
+
102
+ // Horizontal - label beside input
103
+ createForm({
104
+ layout: 'horizontal',
105
+ labelWidth: 'md', // 'sm' | 'md' | 'lg' | 'xl'
106
+ fields: [...]
107
+ });
108
+
109
+ // Grid - responsive columns
110
+ createForm({
111
+ layout: 'grid',
112
+ gridColumns: 3,
113
+ fields: [
114
+ field.text('name', 'Name', { colSpan: 2 }), // Span 2 columns
115
+ field.text('code', 'Code'), // Span 1 column
116
+ // Responsive colSpan
117
+ field.text('address', 'Address', { colSpan: { default: 12, md: 6, lg: 4 } }),
118
+ ]
119
+ });
120
+
121
+ // Field widths for non-grid layouts
122
+ createForm({
123
+ layout: 'vertical',
124
+ fields: [
125
+ field.text('name', 'Name', { width: 'full' }),
126
+ field.text('city', 'City', { width: '1/2' }),
127
+ field.text('state', 'State', { width: '1/4' }),
128
+ field.text('zip', 'ZIP', { width: '1/4' }),
129
+ ]
130
+ });
131
+ ```
132
+
133
+ ### TableComponent
134
+
135
+ Advanced data table with sorting, filtering, pagination, and column visibility.
136
+
137
+ ```typescript
138
+ import { TableComponent, createTable } from '@hakistack/ng-daisyui';
139
+
140
+ @Component({
141
+ imports: [TableComponent],
142
+ template: `<hk-table [data]="users()" [config]="tableConfig" />`
143
+ })
144
+ export class MyComponent {
145
+ readonly tableConfig = createTable<User>({
146
+ visible: ['name', 'email', 'role'],
147
+ formatters: {
148
+ createdAt: ['date', { format: 'short' }],
149
+ },
150
+ hasActions: true,
151
+ actions: [
152
+ { type: 'edit', label: 'Edit', action: (row) => this.edit(row) },
153
+ { type: 'delete', label: 'Delete', action: (row) => this.delete(row) },
154
+ ],
155
+ });
156
+ }
157
+ ```
158
+
159
+ ### SelectComponent
160
+
161
+ Enhanced select dropdown with search and virtual scrolling.
162
+
163
+ ```typescript
164
+ import { SelectComponent } from '@hakistack/ng-daisyui';
165
+
166
+ @Component({
167
+ imports: [SelectComponent],
168
+ template: `
169
+ <hk-select
170
+ [options]="countries"
171
+ [enableSearch]="true"
172
+ placeholder="Select country"
173
+ (selectionChange)="onSelect($event)"
174
+ />
175
+ `
176
+ })
177
+ ```
178
+
179
+ ### DatepickerComponent
180
+
181
+ Date and date range picker with keyboard navigation.
182
+
183
+ ```typescript
184
+ import { DatepickerComponent } from '@hakistack/ng-daisyui';
185
+
186
+ @Component({
187
+ imports: [DatepickerComponent],
188
+ template: `
189
+ <hk-datepicker
190
+ [range]="true"
191
+ placeholder="Select dates"
192
+ (selectionChange)="onDateChange($event)"
193
+ />
194
+ `
195
+ })
196
+ ```
197
+
198
+ ### StepperComponent
199
+
200
+ Multi-step wizard navigation (extends CDK Stepper).
201
+
202
+ ### TabGroupComponent / TabPanelComponent
203
+
204
+ Accessible tab navigation with icons.
205
+
206
+ ```typescript
207
+ import { TabGroupComponent, TabPanelComponent } from '@hakistack/ng-daisyui';
208
+
209
+ @Component({
210
+ imports: [TabGroupComponent, TabPanelComponent],
211
+ template: `
212
+ <hk-tab-group [(selectedTab)]="activeTab">
213
+ <hk-tab-panel value="details" label="Details" icon="FileText">
214
+ <ng-template>Details content</ng-template>
215
+ </hk-tab-panel>
216
+ <hk-tab-panel value="settings" label="Settings" icon="Settings">
217
+ <ng-template>Settings content</ng-template>
218
+ </hk-tab-panel>
219
+ </hk-tab-group>
220
+ `
221
+ })
222
+ ```
223
+
224
+ ### ToastService
225
+
226
+ Toast notifications with stacking and progress bars.
227
+
228
+ **Setup** - Add `provideToast()` to your app config:
229
+
230
+ ```typescript
231
+ // app.config.ts
232
+ import { provideToast } from '@hakistack/ng-daisyui';
233
+
234
+ export const appConfig: ApplicationConfig = {
235
+ providers: [
236
+ provideToast(),
237
+ // or with custom config:
238
+ provideToast({ position: 'top-end', maxToasts: 3 }),
239
+ ],
240
+ };
241
+ ```
242
+
243
+ **Usage:**
244
+
245
+ ```typescript
246
+ import { ToastService } from '@hakistack/ng-daisyui';
247
+
248
+ @Component({...})
249
+ export class MyComponent {
250
+ private toastService = inject(ToastService);
251
+
252
+ showSuccess() {
253
+ this.toastService.success('Saved!', 'Your changes have been saved.');
254
+ }
255
+
256
+ showError() {
257
+ this.toastService.error('Error', 'Something went wrong.');
258
+ }
259
+ }
260
+ ```
261
+
262
+ ### DialogService
263
+
264
+ CDK-based modal dialogs with DaisyUI styling and animations.
265
+
266
+ ```typescript
267
+ import { DialogService } from '@hakistack/ng-daisyui';
268
+
269
+ @Component({...})
270
+ export class MyComponent {
271
+ private dialogService = inject(DialogService);
272
+
273
+ openDialog() {
274
+ // Open with wrapper (card + animation)
275
+ const ref = this.dialogService.open(MyDialogComponent, {
276
+ data: { userId: 123 },
277
+ disableClose: true,
278
+ });
279
+
280
+ ref.closed.subscribe(result => {
281
+ console.log('Dialog closed with:', result);
282
+ });
283
+ }
284
+
285
+ openRawDialog() {
286
+ // Open without wrapper (full control)
287
+ const ref = this.dialogService.openRaw(MyCustomComponent, {
288
+ data: { mode: 'edit' },
289
+ width: '600px',
290
+ });
291
+ }
292
+ }
293
+ ```
294
+
295
+ **In your dialog component:**
296
+
297
+ ```typescript
298
+ import { DIALOG_DATA, DialogRef } from '@angular/cdk/dialog';
299
+
300
+ @Component({...})
301
+ export class MyDialogComponent {
302
+ private data = inject(DIALOG_DATA);
303
+ private dialogRef = inject(DialogRef);
304
+
305
+ close(result?: any) {
306
+ this.dialogRef.close(result);
307
+ }
308
+ }
309
+ ```
310
+
311
+ ### Lucide Icons
312
+
313
+ Uses `@lucide/angular` v1.7+ directly. Import per-icon directives for static usage, or `LucideDynamicIcon` for runtime icon selection.
314
+
315
+ ```typescript
316
+ import { LucideUser, LucideSettings, LucideDynamicIcon } from '@lucide/angular';
317
+
318
+ @Component({
319
+ imports: [LucideUser, LucideSettings, LucideDynamicIcon],
320
+ template: `
321
+ <svg lucideUser [size]="24"></svg>
322
+ <svg lucideSettings color="red"></svg>
323
+ <svg [lucideIcon]="iconName()" [size]="20"></svg>
324
+ `,
325
+ })
326
+ ```
327
+
328
+ For string-name lookup, register icons in your app config:
329
+
330
+ ```typescript
331
+ import { provideLucideIcons, provideLucideConfig, LucideUser } from '@lucide/angular';
332
+
333
+ export const appConfig: ApplicationConfig = {
334
+ providers: [
335
+ provideLucideIcons(LucideUser /* , ... */),
336
+ provideLucideConfig({ size: 20, strokeWidth: 1.75 }),
337
+ ],
338
+ };
339
+ ```
340
+
341
+ ## Services
342
+
343
+ - **FormStateService** - Auto-save form state management
344
+ - **PipeRegistryService** - Custom pipe registry for table formatters
345
+ - **AccessibilityService** - Accessibility utilities
346
+ - **DialogService** - CDK-based modal dialogs
347
+ - **ToastService** - Toast notifications
348
+
349
+ ## Directives
350
+
351
+ - **AutoFocusDirective** - Auto-focus input elements
352
+ - **MotionAnimateDirective** - Motion.js animation wrapper
353
+ - **MotionHoverDirective** - Hover animations
354
+ - **MotionScrollDirective** - Scroll-triggered animations
355
+
356
+ ## Building
357
+
358
+ ```bash
359
+ npm run build
360
+ ```
361
+
362
+ ## Installation (Private Package)
363
+
364
+ ### From Private Registry
365
+
366
+ 1. Create `.npmrc` in your consuming project:
367
+
368
+ ```text
369
+ @hakistack:registry=https://hakistack-registry.fly.dev
370
+ ```
371
+
372
+ 2. Login (one-time):
373
+
374
+ ```bash
375
+ npm login --registry=https://hakistack-registry.fly.dev
376
+ ```
377
+
378
+ 3. Install:
379
+
380
+ ```bash
381
+ npm install @hakistack/ng-daisyui
382
+ ```
383
+
384
+ ### Local Development (npm link)
385
+
386
+ ```bash
387
+ # In the library workspace
388
+ npm run build
389
+ npm run publish:local
390
+
391
+ # In your consuming project
392
+ npm link @hakistack/ng-daisyui
393
+ ```
394
+
395
+ ## License
396
+
397
+ UNLICENSED - Private package