@brickclay-org/ui 0.0.2 β†’ 0.0.4

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
@@ -1,795 +1,795 @@
1
- # @brickclay-org/ui
2
-
3
- A comprehensive Angular UI component library featuring a rich collection of customizable, accessible components. Built with modern Angular standards, this library provides everything you need to build beautiful and functional user interfaces.
4
-
5
- ## 🌟 Features
6
-
7
- - πŸ“¦ **Comprehensive Component Library** - Rich set of UI components for common use cases
8
- - β™Ώ **Accessible by Default** - WCAG compliant components with keyboard navigation and screen reader support
9
- - πŸš€ **Angular 20+ Ready** - Built with latest Angular features and standalone components
10
- - πŸ“± **Responsive Design** - Mobile-first components that work on all screen sizes
11
- - 🎯 **Type-Safe** - Full TypeScript support with comprehensive type definitions
12
- - ⚑ **Lightweight** - Tree-shakeable and optimized for performance
13
- - πŸŽ›οΈ **Highly Customizable** - Extensive configuration options for every component
14
-
15
- ## πŸ“š Available Components
16
-
17
- ### Calendar Components
18
-
19
- A powerful calendar suite with advanced date and time selection capabilities. The calendar components support single date selection, date ranges, multiple date selection, and integrated time pickers.
20
-
21
- ### Toggle Component
22
-
23
- A customizable toggle/switch component with support for Angular forms integration via `ngModel` and reactive forms. Features three size variants (small, medium, large), disabled state, and full accessibility support.
24
-
25
- *More components coming soon...*
26
-
27
- ## Installation
28
-
29
- ```bash
30
- npm install @brickclay-org/ui
31
- ```
32
-
33
- ### Peer Dependencies
34
-
35
- This library requires Angular 20.3.0 or higher:
36
-
37
- ```bash
38
- npm install @angular/common@^20.3.0 @angular/core@^20.3.0 moment
39
- ```
40
-
41
- ## Quick Start
42
-
43
- ### Standalone Component Usage (Recommended)
44
-
45
- ```typescript
46
- import { Component } from '@angular/core';
47
- import { CustomCalendarComponent, CalendarSelection } from '@brickclay/ui';
48
-
49
- @Component({
50
- standalone: true,
51
- selector: 'app-my-component',
52
- imports: [CustomCalendarComponent],
53
- template: `
54
- <brickclay-custom-calendar
55
- (selected)="onDateSelected($event)">
56
- </brickclay-custom-calendar>
57
- `
58
- })
59
- export class MyComponent {
60
- onDateSelected(selection: CalendarSelection) {
61
- console.log('Selected:', selection);
62
- }
63
- }
64
- ```
65
-
66
- ### Module-based Usage
67
-
68
- ```typescript
69
- import { NgModule } from '@angular/core';
70
- import { CalendarModule } from '@brickclay/ui';
71
-
72
- @NgModule({
73
- imports: [CalendarModule],
74
- // ...
75
- })
76
- export class AppModule {}
77
- ```
78
-
79
- ## πŸ“… Calendar
80
-
81
- The calendar components provide a complete solution for date and time selection in your Angular applications. All components are standalone and can be imported individually or as part of the `CalendarModule`.
82
-
83
- ### Components Overview
84
-
85
- 1. **CustomCalendarComponent** (`brickclay-custom-calendar`) - Main calendar component with support for single date, date range, and multiple date selection
86
- 2. **ScheduledDatePickerComponent** (`brickclay-scheduled-date-picker`) - Advanced scheduling component with time configuration for events
87
- 3. **TimePickerComponent** (`brickclay-time-picker`) - Standalone time selection component with scrollable pickers
88
-
89
- ### CustomCalendarComponent
90
-
91
- A versatile calendar component that supports single date, date range, and multiple date selection modes.
92
-
93
- #### Basic Example
94
-
95
- ```typescript
96
- import { CustomCalendarComponent, CalendarSelection } from '@brickclay/ui';
97
-
98
- @Component({
99
- template: `
100
- <brickclay-custom-calendar
101
- [singleDatePicker]="false"
102
- [dualCalendar]="true"
103
- [enableTimepicker]="true"
104
- [showRanges]="true"
105
- [placeholder]="'Select date range'"
106
- (selected)="onDateSelected($event)">
107
- </brickclay-custom-calendar>
108
- `
109
- })
110
- export class MyComponent {
111
- onDateSelected(selection: CalendarSelection) {
112
- console.log('Start:', selection.startDate);
113
- console.log('End:', selection.endDate);
114
- }
115
- }
116
- ```
117
-
118
- #### Component Selector
119
-
120
- `<brickclay-custom-calendar>`
121
-
122
- #### Inputs
123
-
124
- | Input | Type | Default | Description |
125
- |-------|------|---------|-------------|
126
- | `enableTimepicker` | `boolean` | `false` | Enable time selection |
127
- | `autoApply` | `boolean` | `false` | Automatically apply selection when date is chosen |
128
- | `closeOnAutoApply` | `boolean` | `false` | Close calendar after auto-apply |
129
- | `showCancel` | `boolean` | `true` | Show cancel button in footer |
130
- | `singleDatePicker` | `boolean` | `false` | Enable single date selection mode |
131
- | `dualCalendar` | `boolean` | `false` | Show two calendars side-by-side |
132
- | `showRanges` | `boolean` | `true` | Show predefined date range buttons |
133
- | `multiDateSelection` | `boolean` | `false` | Enable multiple date selection |
134
- | `inline` | `boolean` | `false` | Always show calendar (no dropdown) |
135
- | `minDate` | `Date` | `undefined` | Minimum selectable date |
136
- | `maxDate` | `Date` | `undefined` | Maximum selectable date |
137
- | `placeholder` | `string` | `'Select date range'` | Input placeholder text |
138
- | `opens` | `'left' \| 'right' \| 'center'` | `'left'` | Dropdown alignment |
139
- | `drop` | `'up' \| 'down'` | `'down'` | Dropdown direction |
140
- | `displayFormat` | `string` | `'MM/DD/YYYY'` | Date display format (moment format) |
141
- | `customRanges` | `Record<string, CalendarRange>` | `undefined` | Custom predefined ranges |
142
- | `selectedValue` | `CalendarSelection \| null` | `null` | Pre-selected date(s) |
143
- | `isDisplayCrossIcon` | `boolean` | `true` | Show/hide clear button |
144
-
145
- #### Outputs
146
-
147
- | Output | Type | Description |
148
- |--------|------|-------------|
149
- | `selected` | `EventEmitter<CalendarSelection>` | Emitted when date selection changes |
150
- | `opened` | `EventEmitter<void>` | Emitted when calendar opens |
151
- | `closed` | `EventEmitter<void>` | Emitted when calendar closes |
152
-
153
- #### Usage Examples
154
-
155
- **Single Date Selection:**
156
-
157
- ```typescript
158
- <brickclay-custom-calendar
159
- [singleDatePicker]="true"
160
- [placeholder]="'Select a date'"
161
- (selected)="onDateSelected($event)">
162
- </brickclay-custom-calendar>
163
- ```
164
-
165
- **Date Range with Time Picker:**
166
-
167
- ```typescript
168
- <brickclay-custom-calendar
169
- [dualCalendar]="true"
170
- [enableTimepicker]="true"
171
- [enableSeconds]="true"
172
- (selected)="onRangeSelected($event)">
173
- </brickclay-custom-calendar>
174
- ```
175
-
176
- **Multiple Date Selection:**
177
-
178
- ```typescript
179
- <brickclay-custom-calendar
180
- [multiDateSelection]="true"
181
- [inline]="true"
182
- (selected)="onMultipleDatesSelected($event)">
183
- </brickclay-custom-calendar>
184
- ```
185
-
186
- **Inline Calendar:**
187
-
188
- ```typescript
189
- <brickclay-custom-calendar
190
- [inline]="true"
191
- [dualCalendar]="false"
192
- [showRanges]="false"
193
- (selected)="onDateSelected($event)">
194
- </brickclay-custom-calendar>
195
- ```
196
-
197
- **Custom Date Ranges:**
198
-
199
- ```typescript
200
- import { CalendarRange } from '@brickclay/ui';
201
-
202
- const customRanges: Record<string, CalendarRange> = {
203
- 'Last Week': {
204
- start: new Date(2024, 0, 1),
205
- end: new Date(2024, 0, 7)
206
- },
207
- 'This Quarter': {
208
- start: new Date(2024, 0, 1),
209
- end: new Date(2024, 2, 31)
210
- }
211
- };
212
-
213
- <brickclay-custom-calendar
214
- [customRanges]="customRanges"
215
- [showRanges]="true"
216
- (selected)="onDateSelected($event)">
217
- </brickclay-custom-calendar>
218
- ```
219
-
220
- **Date Constraints:**
221
-
222
- ```typescript
223
- <brickclay-custom-calendar
224
- [minDate]="new Date(2024, 0, 1)"
225
- [maxDate]="new Date(2024, 11, 31)"
226
- (selected)="onDateSelected($event)">
227
- </brickclay-custom-calendar>
228
- ```
229
-
230
- **Pre-selected Values:**
231
-
232
- ```typescript
233
- export class MyComponent {
234
- selectedValue: CalendarSelection = {
235
- startDate: new Date(2024, 5, 15),
236
- endDate: new Date(2024, 5, 20)
237
- };
238
-
239
- onDateChange() {
240
- this.selectedValue = {
241
- startDate: new Date(),
242
- endDate: new Date()
243
- };
244
- }
245
- }
246
-
247
- <brickclay-custom-calendar
248
- [selectedValue]="selectedValue"
249
- (selected)="onDateSelected($event)">
250
- </brickclay-custom-calendar>
251
- ```
252
-
253
- ### ScheduledDatePickerComponent
254
-
255
- A comprehensive date and time scheduling component with three modes: single date, multiple dates, and date range, each with time configuration.
256
-
257
- #### Basic Example
258
-
259
- ```typescript
260
- import { ScheduledDatePickerComponent, ScheduledDateSelection } from '@brickclay/ui';
261
-
262
- @Component({
263
- template: `
264
- <brickclay-scheduled-date-picker
265
- [timeFormat]="12"
266
- (scheduled)="onScheduled($event)">
267
- </brickclay-scheduled-date-picker>
268
- `
269
- })
270
- export class MyComponent {
271
- onScheduled(selection: ScheduledDateSelection) {
272
- console.log('Mode:', selection.mode);
273
- if (selection.mode === 'single' && selection.singleDate) {
274
- console.log('Start:', selection.singleDate.startDate);
275
- console.log('End:', selection.singleDate.endDate);
276
- console.log('All Day:', selection.singleDate.allDay);
277
- }
278
- }
279
- }
280
- ```
281
-
282
- #### Component Selector
283
-
284
- `<brickclay-scheduled-date-picker>`
285
-
286
- #### Inputs
287
-
288
- | Input | Type | Default | Description |
289
- |-------|------|---------|-------------|
290
- | `timeFormat` | `12 \| 24` | `12` | Time format (12-hour or 24-hour) |
291
- | `enableSeconds` | `boolean` | `false` | Enable seconds in time picker |
292
-
293
- #### Outputs
294
-
295
- | Output | Type | Description |
296
- |--------|------|-------------|
297
- | `scheduled` | `EventEmitter<ScheduledDateSelection>` | Emitted when selection changes |
298
- | `cleared` | `EventEmitter<void>` | Emitted when clear button is clicked |
299
-
300
- #### Features
301
-
302
- - **Single Date Mode**: Select one date with optional start and end times
303
- - **Multiple Dates Mode**: Select multiple dates, each with individual time configuration
304
- - **Date Range Mode**: Select a date range with start and end times
305
- - **All Day Toggle**: Mark dates as all-day events
306
- - **Time Configuration**: Individual time pickers for each date/range
307
-
308
- ### TimePickerComponent
309
-
310
- A standalone time picker component with scrollable hour, minute, and AM/PM selectors.
311
-
312
- #### Basic Example
313
-
314
- ```typescript
315
- import { TimePickerComponent } from '@brickclay/ui';
316
-
317
- @Component({
318
- template: `
319
- <brickclay-time-picker
320
- [value]="selectedTime"
321
- [label]="'Start Time'"
322
- [timeFormat]="12"
323
- (timeChange)="onTimeChange($event)">
324
- </brickclay-time-picker>
325
- `
326
- })
327
- export class MyComponent {
328
- selectedTime = '1:00 AM';
329
-
330
- onTimeChange(time: string) {
331
- this.selectedTime = time;
332
- console.log('New time:', time);
333
- }
334
- }
335
- ```
336
-
337
- #### Component Selector
338
-
339
- `<brickclay-time-picker>`
340
-
341
- #### Inputs
342
-
343
- | Input | Type | Default | Description |
344
- |-------|------|---------|-------------|
345
- | `value` | `string` | `'1:00 AM'` | Current time value (format: "H:MM AM/PM" or "HH:MM") |
346
- | `label` | `string` | `'Time'` | Label text |
347
- | `placeholder` | `string` | `'Select time'` | Placeholder text |
348
- | `position` | `'left' \| 'right'` | `'left'` | Dropdown position |
349
- | `pickerId` | `string` | `''` | Unique identifier for the picker |
350
- | `closePicker` | `number` | `0` | Counter to trigger picker close |
351
- | `timeFormat` | `12 \| 24` | `12` | Time format (12-hour or 24-hour) |
352
- | `showSeconds` | `boolean` | `false` | Show seconds selector |
353
-
354
- #### Outputs
355
-
356
- | Output | Type | Description |
357
- |--------|------|-------------|
358
- | `timeChange` | `EventEmitter<string>` | Emitted when time changes |
359
- | `pickerOpened` | `EventEmitter<string>` | Emitted when picker opens |
360
- | `pickerClosed` | `EventEmitter<string>` | Emitted when picker closes |
361
-
362
- #### Features
363
-
364
- - Scrollable time selectors
365
- - Keyboard navigation support
366
- - 12-hour and 24-hour formats
367
- - Optional seconds support
368
- - Multiple picker coordination (only one open at a time)
369
- - Click outside to close
370
-
371
- #### Time Format Examples
372
-
373
- **12-hour format:**
374
- ```typescript
375
- value="1:00 AM"
376
- value="12:30 PM"
377
- value="11:45 PM"
378
- ```
379
-
380
- **24-hour format:**
381
- ```typescript
382
- value="01:00"
383
- value="13:30"
384
- value="23:45"
385
- ```
386
-
387
- ## πŸ”˜ Toggle
388
-
389
- A versatile toggle/switch component that integrates seamlessly with Angular forms. Supports both template-driven forms (`ngModel`) and reactive forms, with full accessibility features and keyboard navigation.
390
-
391
- ### ToggleComponent
392
-
393
- A standalone toggle component that implements `ControlValueAccessor` for seamless Angular forms integration.
394
-
395
- #### Basic Example
396
-
397
- ```typescript
398
- import { ToggleComponent } from '@brickclay/ui';
399
- import { FormsModule } from '@angular/forms';
400
-
401
- @Component({
402
- template: `
403
- <brickclay-toggle
404
- [(ngModel)]="isEnabled"
405
- [label]="'Enable notifications'"
406
- (change)="onToggleChange($event)">
407
- </brickclay-toggle>
408
- `,
409
- imports: [ToggleComponent, FormsModule]
410
- })
411
- export class MyComponent {
412
- isEnabled = false;
413
-
414
- onToggleChange(value: boolean) {
415
- console.log('Toggle state:', value);
416
- }
417
- }
418
- ```
419
-
420
- #### Component Selector
421
-
422
- `<brickclay-toggle>`
423
-
424
- #### Inputs
425
-
426
- | Input | Type | Default | Description |
427
- |-------|------|---------|-------------|
428
- | `label` | `string` | `''` | Optional label text displayed next to the toggle |
429
- | `disabled` | `boolean` | `false` | Disables the toggle interaction |
430
- | `toggleClass` | `string` | `'toggle-md'` | CSS class for size styling. Options: `'toggle-sm'`, `'toggle-md'`, `'toggle-lg'` |
431
-
432
- #### Outputs
433
-
434
- | Output | Type | Description |
435
- |--------|------|-------------|
436
- | `change` | `EventEmitter<boolean>` | Emitted when toggle state changes (returns new boolean value) |
437
-
438
- #### Features
439
-
440
- - βœ… **Angular Forms Integration** - Full support for `ngModel` and reactive forms
441
- - βœ… **Three Size Variants** - Small (`toggle-sm`), Medium (`toggle-md`), Large (`toggle-lg`)
442
- - βœ… **Accessibility** - ARIA attributes, keyboard navigation, and screen reader support
443
- - βœ… **Disabled State** - Visual and functional disabled state
444
- - βœ… **Customizable Styling** - Custom CSS classes for size and appearance
445
- - βœ… **Event Handling** - `change` event for state change notifications
446
-
447
- #### Usage Examples
448
-
449
- **Basic Toggle with ngModel:**
450
-
451
- ```typescript
452
- import { ToggleComponent } from '@brickclay/ui';
453
- import { FormsModule } from '@angular/forms';
454
-
455
- @Component({
456
- template: `
457
- <brickclay-toggle
458
- [(ngModel)]="isActive"
459
- [label]="'Active Status'">
460
- </brickclay-toggle>
461
- `,
462
- imports: [ToggleComponent, FormsModule]
463
- })
464
- export class MyComponent {
465
- isActive = true;
466
- }
467
- ```
468
-
469
- **Different Sizes:**
470
-
471
- ```typescript
472
- <brickclay-toggle
473
- [(ngModel)]="value1"
474
- [toggleClass]="'toggle-sm'"
475
- [label]="'Small Toggle'">
476
- </brickclay-toggle>
477
-
478
- <brickclay-toggle
479
- [(ngModel)]="value2"
480
- [toggleClass]="'toggle-md'"
481
- [label]="'Medium Toggle'">
482
- </brickclay-toggle>
483
-
484
- <brickclay-toggle
485
- [(ngModel)]="value3"
486
- [toggleClass]="'toggle-lg'"
487
- [label]="'Large Toggle'">
488
- </brickclay-toggle>
489
- ```
490
-
491
- **Disabled State:**
492
-
493
- ```typescript
494
- <brickclay-toggle
495
- [ngModel]="true"
496
- [disabled]="true"
497
- [label]="'Disabled Toggle'">
498
- </brickclay-toggle>
499
- ```
500
-
501
- **With Event Handler:**
502
-
503
- ```typescript
504
- @Component({
505
- template: `
506
- <brickclay-toggle
507
- [(ngModel)]="notificationsEnabled"
508
- [label]="'Email Notifications'"
509
- (change)="onNotificationToggle($event)">
510
- </brickclay-toggle>
511
- `
512
- })
513
- export class MyComponent {
514
- notificationsEnabled = false;
515
-
516
- onNotificationToggle(enabled: boolean) {
517
- if (enabled) {
518
- this.enableNotifications();
519
- } else {
520
- this.disableNotifications();
521
- }
522
- }
523
- }
524
- ```
525
-
526
- **Reactive Forms Integration:**
527
-
528
- ```typescript
529
- import { FormBuilder, FormGroup, ReactiveFormsModule } from '@angular/forms';
530
- import { ToggleComponent } from '@brickclay/ui';
531
-
532
- @Component({
533
- template: `
534
- <form [formGroup]="settingsForm">
535
- <brickclay-toggle
536
- formControlName="darkMode"
537
- [label]="'Dark Mode'">
538
- </brickclay-toggle>
539
-
540
- <brickclay-toggle
541
- formControlName="notifications"
542
- [label]="'Push Notifications'">
543
- </brickclay-toggle>
544
- </form>
545
- `,
546
- imports: [ToggleComponent, ReactiveFormsModule]
547
- })
548
- export class SettingsComponent {
549
- settingsForm: FormGroup;
550
-
551
- constructor(private fb: FormBuilder) {
552
- this.settingsForm = this.fb.group({
553
- darkMode: [false],
554
- notifications: [true]
555
- });
556
- }
557
- }
558
- ```
559
-
560
- **Without Label:**
561
-
562
- ```typescript
563
- <brickclay-toggle
564
- [(ngModel)]="isEnabled"
565
- [toggleClass]="'toggle-md'">
566
- </brickclay-toggle>
567
- ```
568
-
569
- #### Styling
570
-
571
- The toggle component uses CSS classes for size variants:
572
-
573
- - **Small**: `toggle-sm` - Width: 28px (w-7)
574
- - **Medium**: `toggle-md` - Width: 36px (w-9) - Default
575
- - **Large**: `toggle-lg` - Width: 44px (w-11)
576
-
577
- The component includes built-in styles for:
578
- - On state (green background: `#22973F`)
579
- - Off state (gray background: `#BBBDC5`)
580
- - Disabled state (light gray: `#D6D7DC`)
581
- - Hover states
582
- - Focus ring for accessibility
583
- - Smooth transitions
584
-
585
- #### Accessibility
586
-
587
- The toggle component includes:
588
- - `role="switch"` for screen readers
589
- - `aria-checked` attribute that reflects the current state
590
- - Keyboard navigation support
591
- - Focus visible ring for keyboard users
592
- - Disabled state properly communicated to assistive technologies
593
-
594
- ## πŸ“ TypeScript Interfaces
595
-
596
- ### CalendarRange
597
-
598
- ```typescript
599
- interface CalendarRange {
600
- start: Date;
601
- end: Date;
602
- }
603
- ```
604
-
605
- ### CalendarSelection
606
-
607
- ```typescript
608
- interface CalendarSelection {
609
- startDate: Date | null;
610
- endDate: Date | null;
611
- selectedDates?: Date[]; // For multi-date selection
612
- }
613
- ```
614
-
615
- ### TimeConfiguration
616
-
617
- ```typescript
618
- interface TimeConfiguration {
619
- date: Date;
620
- allDay: boolean;
621
- startTime: string; // Format: "HH:mm" or "HH:mm:ss"
622
- endTime: string;
623
- }
624
- ```
625
-
626
- ### ScheduledDateSelection
627
-
628
- ```typescript
629
- interface ScheduledDateSelection {
630
- mode: 'single' | 'multiple' | 'range';
631
- singleDate?: {
632
- startDate: Date;
633
- endDate: Date;
634
- allDay: boolean;
635
- startTime: string;
636
- endTime: string;
637
- };
638
- multipleDates?: TimeConfiguration[];
639
- dateRange?: {
640
- startDate: Date;
641
- endDate: Date;
642
- allDay: boolean;
643
- startTime: string;
644
- endTime: string;
645
- };
646
- }
647
- ```
648
-
649
- ## 🎯 Common Use Cases
650
-
651
- ### Form Integration
652
-
653
- ```typescript
654
- import { FormBuilder, FormGroup, Validators } from '@angular/forms';
655
- import { CustomCalendarComponent } from '@brickclay/ui';
656
-
657
- export class BookingFormComponent {
658
- bookingForm: FormGroup;
659
-
660
- constructor(private fb: FormBuilder) {
661
- this.bookingForm = this.fb.group({
662
- checkIn: [null, Validators.required],
663
- checkOut: [null, Validators.required]
664
- });
665
- }
666
-
667
- onDateSelected(selection: CalendarSelection) {
668
- this.bookingForm.patchValue({
669
- checkIn: selection.startDate,
670
- checkOut: selection.endDate
671
- });
672
- }
673
- }
674
- ```
675
-
676
- ### Reactive Forms
677
-
678
- ```typescript
679
- <brickclay-custom-calendar
680
- [selectedValue]="form.get('dateRange')?.value"
681
- (selected)="form.patchValue({ dateRange: $event })">
682
- </brickclay-custom-calendar>
683
- ```
684
-
685
- ### Date Filtering
686
-
687
- ```typescript
688
- export class DataTableComponent {
689
- filterDates: CalendarSelection = { startDate: null, endDate: null };
690
-
691
- onDateFilter(selection: CalendarSelection) {
692
- this.filterDates = selection;
693
- this.loadFilteredData();
694
- }
695
-
696
- loadFilteredData() {
697
- const filtered = this.data.filter(item => {
698
- if (!this.filterDates.startDate || !this.filterDates.endDate) {
699
- return true;
700
- }
701
- return item.date >= this.filterDates.startDate! &&
702
- item.date <= this.filterDates.endDate!;
703
- });
704
- }
705
- }
706
- ```
707
-
708
- ## πŸ“¦ Assets Configuration
709
-
710
- The calendar components require SVG icons. Configure your `angular.json` to copy assets:
711
-
712
- ```json
713
- {
714
- "glob": "**/*",
715
- "input": "node_modules/@brickclay/ui/assets",
716
- "output": "assets"
717
- }
718
- ```
719
-
720
- Or manually copy assets from:
721
- ```
722
- node_modules/@brickclay/ui/assets/calender/* β†’ your-app/public/assets/calender/
723
- ```
724
-
725
- ## πŸ”§ Service
726
-
727
- ### CalendarManagerService
728
-
729
- A service that manages multiple calendar instances, ensuring only one calendar is open at a time when not in inline mode. Used internally by `CustomCalendarComponent`.
730
-
731
- ## 🌐 Browser Support
732
-
733
- - Chrome (latest)
734
- - Firefox (latest)
735
- - Safari (latest)
736
- - Edge (latest)
737
-
738
- ## πŸ“¦ Dependencies
739
-
740
- - Angular 20.3.0+
741
- - moment (for date formatting)
742
-
743
- ## 🀝 Contributing
744
-
745
- We welcome contributions! Please see our contributing guidelines for more information.
746
-
747
- ## πŸ“„ License
748
-
749
- MIT
750
-
751
- ## πŸ“ž Support
752
-
753
- For issues, feature requests, or contributions, please visit our [GitHub repository](https://github.com/brickclay/ui).
754
-
755
- ## πŸ—ΊοΈ Roadmap
756
-
757
- - [ ] Button components
758
- - [ ] Input components
759
- - [ ] Card components
760
- - [ ] Modal/Dialog components
761
- - [ ] Table components
762
- - [ ] Form components
763
- - [ ] Navigation components
764
- - [ ] Loading/Spinner components
765
- - [ ] Toast/Notification components
766
- - [ ] More calendar features
767
-
768
- ## πŸ“ Changelog
769
-
770
- ### Version 0.0.1
771
-
772
- **Initial Release:**
773
- - βœ… Calendar component suite
774
- - Single date selection
775
- - Date range selection
776
- - Multiple date selection
777
- - Time picker integration
778
- - Inline and dropdown modes
779
- - Dual calendar view
780
- - Custom date ranges
781
- - Date constraints (min/max)
782
- - βœ… Scheduled date picker component
783
- - βœ… Standalone time picker component
784
- - βœ… Toggle/Switch component
785
- - Angular forms integration (ngModel & reactive forms)
786
- - Three size variants (small, medium, large)
787
- - Disabled state support
788
- - Full accessibility features
789
- - Customizable styling
790
- - βœ… TypeScript definitions
791
- - βœ… Comprehensive documentation
792
-
793
- ---
794
-
795
- **Built with ❀️ by the Brickclay team**
1
+ # @brickclay-org/ui
2
+
3
+ A comprehensive Angular UI component library featuring a rich collection of customizable, accessible components. Built with modern Angular standards, this library provides everything you need to build beautiful and functional user interfaces.
4
+
5
+ ## 🌟 Features
6
+
7
+ - πŸ“¦ **Comprehensive Component Library** - Rich set of UI components for common use cases
8
+ - β™Ώ **Accessible by Default** - WCAG compliant components with keyboard navigation and screen reader support
9
+ - πŸš€ **Angular 20+ Ready** - Built with latest Angular features and standalone components
10
+ - πŸ“± **Responsive Design** - Mobile-first components that work on all screen sizes
11
+ - 🎯 **Type-Safe** - Full TypeScript support with comprehensive type definitions
12
+ - ⚑ **Lightweight** - Tree-shakeable and optimized for performance
13
+ - πŸŽ›οΈ **Highly Customizable** - Extensive configuration options for every component
14
+
15
+ ## πŸ“š Available Components
16
+
17
+ ### Calendar Components
18
+
19
+ A powerful calendar suite with advanced date and time selection capabilities. The calendar components support single date selection, date ranges, multiple date selection, and integrated time pickers.
20
+
21
+ ### Toggle Component
22
+
23
+ A customizable toggle/switch component with support for Angular forms integration via `ngModel` and reactive forms. Features three size variants (small, medium, large), disabled state, and full accessibility support.
24
+
25
+ *More components coming soon...*
26
+
27
+ ## Installation
28
+
29
+ ```bash
30
+ npm install @brickclay-org/ui
31
+ ```
32
+
33
+ ### Peer Dependencies
34
+
35
+ This library requires Angular 20.3.0 or higher:
36
+
37
+ ```bash
38
+ npm install @angular/common@^20.3.0 @angular/core@^20.3.0 moment
39
+ ```
40
+
41
+ ## Quick Start
42
+
43
+ ### Standalone Component Usage (Recommended)
44
+
45
+ ```typescript
46
+ import { Component } from '@angular/core';
47
+ import { CustomCalendarComponent, CalendarSelection } from '@brickclay/ui';
48
+
49
+ @Component({
50
+ standalone: true,
51
+ selector: 'app-my-component',
52
+ imports: [CustomCalendarComponent],
53
+ template: `
54
+ <brickclay-custom-calendar
55
+ (selected)="onDateSelected($event)">
56
+ </brickclay-custom-calendar>
57
+ `
58
+ })
59
+ export class MyComponent {
60
+ onDateSelected(selection: CalendarSelection) {
61
+ console.log('Selected:', selection);
62
+ }
63
+ }
64
+ ```
65
+
66
+ ### Module-based Usage
67
+
68
+ ```typescript
69
+ import { NgModule } from '@angular/core';
70
+ import { CalendarModule } from '@brickclay/ui';
71
+
72
+ @NgModule({
73
+ imports: [CalendarModule],
74
+ // ...
75
+ })
76
+ export class AppModule {}
77
+ ```
78
+
79
+ ## πŸ“… Calendar
80
+
81
+ The calendar components provide a complete solution for date and time selection in your Angular applications. All components are standalone and can be imported individually or as part of the `CalendarModule`.
82
+
83
+ ### Components Overview
84
+
85
+ 1. **CustomCalendarComponent** (`brickclay-custom-calendar`) - Main calendar component with support for single date, date range, and multiple date selection
86
+ 2. **ScheduledDatePickerComponent** (`brickclay-scheduled-date-picker`) - Advanced scheduling component with time configuration for events
87
+ 3. **TimePickerComponent** (`brickclay-time-picker`) - Standalone time selection component with scrollable pickers
88
+
89
+ ### CustomCalendarComponent
90
+
91
+ A versatile calendar component that supports single date, date range, and multiple date selection modes.
92
+
93
+ #### Basic Example
94
+
95
+ ```typescript
96
+ import { CustomCalendarComponent, CalendarSelection } from '@brickclay/ui';
97
+
98
+ @Component({
99
+ template: `
100
+ <brickclay-custom-calendar
101
+ [singleDatePicker]="false"
102
+ [dualCalendar]="true"
103
+ [enableTimepicker]="true"
104
+ [showRanges]="true"
105
+ [placeholder]="'Select date range'"
106
+ (selected)="onDateSelected($event)">
107
+ </brickclay-custom-calendar>
108
+ `
109
+ })
110
+ export class MyComponent {
111
+ onDateSelected(selection: CalendarSelection) {
112
+ console.log('Start:', selection.startDate);
113
+ console.log('End:', selection.endDate);
114
+ }
115
+ }
116
+ ```
117
+
118
+ #### Component Selector
119
+
120
+ `<brickclay-custom-calendar>`
121
+
122
+ #### Inputs
123
+
124
+ | Input | Type | Default | Description |
125
+ |-------|------|---------|-------------|
126
+ | `enableTimepicker` | `boolean` | `false` | Enable time selection |
127
+ | `autoApply` | `boolean` | `false` | Automatically apply selection when date is chosen |
128
+ | `closeOnAutoApply` | `boolean` | `false` | Close calendar after auto-apply |
129
+ | `showCancel` | `boolean` | `true` | Show cancel button in footer |
130
+ | `singleDatePicker` | `boolean` | `false` | Enable single date selection mode |
131
+ | `dualCalendar` | `boolean` | `false` | Show two calendars side-by-side |
132
+ | `showRanges` | `boolean` | `true` | Show predefined date range buttons |
133
+ | `multiDateSelection` | `boolean` | `false` | Enable multiple date selection |
134
+ | `inline` | `boolean` | `false` | Always show calendar (no dropdown) |
135
+ | `minDate` | `Date` | `undefined` | Minimum selectable date |
136
+ | `maxDate` | `Date` | `undefined` | Maximum selectable date |
137
+ | `placeholder` | `string` | `'Select date range'` | Input placeholder text |
138
+ | `opens` | `'left' \| 'right' \| 'center'` | `'left'` | Dropdown alignment |
139
+ | `drop` | `'up' \| 'down'` | `'down'` | Dropdown direction |
140
+ | `displayFormat` | `string` | `'MM/DD/YYYY'` | Date display format (moment format) |
141
+ | `customRanges` | `Record<string, CalendarRange>` | `undefined` | Custom predefined ranges |
142
+ | `selectedValue` | `CalendarSelection \| null` | `null` | Pre-selected date(s) |
143
+ | `isDisplayCrossIcon` | `boolean` | `true` | Show/hide clear button |
144
+
145
+ #### Outputs
146
+
147
+ | Output | Type | Description |
148
+ |--------|------|-------------|
149
+ | `selected` | `EventEmitter<CalendarSelection>` | Emitted when date selection changes |
150
+ | `opened` | `EventEmitter<void>` | Emitted when calendar opens |
151
+ | `closed` | `EventEmitter<void>` | Emitted when calendar closes |
152
+
153
+ #### Usage Examples
154
+
155
+ **Single Date Selection:**
156
+
157
+ ```typescript
158
+ <brickclay-custom-calendar
159
+ [singleDatePicker]="true"
160
+ [placeholder]="'Select a date'"
161
+ (selected)="onDateSelected($event)">
162
+ </brickclay-custom-calendar>
163
+ ```
164
+
165
+ **Date Range with Time Picker:**
166
+
167
+ ```typescript
168
+ <brickclay-custom-calendar
169
+ [dualCalendar]="true"
170
+ [enableTimepicker]="true"
171
+ [enableSeconds]="true"
172
+ (selected)="onRangeSelected($event)">
173
+ </brickclay-custom-calendar>
174
+ ```
175
+
176
+ **Multiple Date Selection:**
177
+
178
+ ```typescript
179
+ <brickclay-custom-calendar
180
+ [multiDateSelection]="true"
181
+ [inline]="true"
182
+ (selected)="onMultipleDatesSelected($event)">
183
+ </brickclay-custom-calendar>
184
+ ```
185
+
186
+ **Inline Calendar:**
187
+
188
+ ```typescript
189
+ <brickclay-custom-calendar
190
+ [inline]="true"
191
+ [dualCalendar]="false"
192
+ [showRanges]="false"
193
+ (selected)="onDateSelected($event)">
194
+ </brickclay-custom-calendar>
195
+ ```
196
+
197
+ **Custom Date Ranges:**
198
+
199
+ ```typescript
200
+ import { CalendarRange } from '@brickclay/ui';
201
+
202
+ const customRanges: Record<string, CalendarRange> = {
203
+ 'Last Week': {
204
+ start: new Date(2024, 0, 1),
205
+ end: new Date(2024, 0, 7)
206
+ },
207
+ 'This Quarter': {
208
+ start: new Date(2024, 0, 1),
209
+ end: new Date(2024, 2, 31)
210
+ }
211
+ };
212
+
213
+ <brickclay-custom-calendar
214
+ [customRanges]="customRanges"
215
+ [showRanges]="true"
216
+ (selected)="onDateSelected($event)">
217
+ </brickclay-custom-calendar>
218
+ ```
219
+
220
+ **Date Constraints:**
221
+
222
+ ```typescript
223
+ <brickclay-custom-calendar
224
+ [minDate]="new Date(2024, 0, 1)"
225
+ [maxDate]="new Date(2024, 11, 31)"
226
+ (selected)="onDateSelected($event)">
227
+ </brickclay-custom-calendar>
228
+ ```
229
+
230
+ **Pre-selected Values:**
231
+
232
+ ```typescript
233
+ export class MyComponent {
234
+ selectedValue: CalendarSelection = {
235
+ startDate: new Date(2024, 5, 15),
236
+ endDate: new Date(2024, 5, 20)
237
+ };
238
+
239
+ onDateChange() {
240
+ this.selectedValue = {
241
+ startDate: new Date(),
242
+ endDate: new Date()
243
+ };
244
+ }
245
+ }
246
+
247
+ <brickclay-custom-calendar
248
+ [selectedValue]="selectedValue"
249
+ (selected)="onDateSelected($event)">
250
+ </brickclay-custom-calendar>
251
+ ```
252
+
253
+ ### ScheduledDatePickerComponent
254
+
255
+ A comprehensive date and time scheduling component with three modes: single date, multiple dates, and date range, each with time configuration.
256
+
257
+ #### Basic Example
258
+
259
+ ```typescript
260
+ import { ScheduledDatePickerComponent, ScheduledDateSelection } from '@brickclay/ui';
261
+
262
+ @Component({
263
+ template: `
264
+ <brickclay-scheduled-date-picker
265
+ [timeFormat]="12"
266
+ (scheduled)="onScheduled($event)">
267
+ </brickclay-scheduled-date-picker>
268
+ `
269
+ })
270
+ export class MyComponent {
271
+ onScheduled(selection: ScheduledDateSelection) {
272
+ console.log('Mode:', selection.mode);
273
+ if (selection.mode === 'single' && selection.singleDate) {
274
+ console.log('Start:', selection.singleDate.startDate);
275
+ console.log('End:', selection.singleDate.endDate);
276
+ console.log('All Day:', selection.singleDate.allDay);
277
+ }
278
+ }
279
+ }
280
+ ```
281
+
282
+ #### Component Selector
283
+
284
+ `<brickclay-scheduled-date-picker>`
285
+
286
+ #### Inputs
287
+
288
+ | Input | Type | Default | Description |
289
+ |-------|------|---------|-------------|
290
+ | `timeFormat` | `12 \| 24` | `12` | Time format (12-hour or 24-hour) |
291
+ | `enableSeconds` | `boolean` | `false` | Enable seconds in time picker |
292
+
293
+ #### Outputs
294
+
295
+ | Output | Type | Description |
296
+ |--------|------|-------------|
297
+ | `scheduled` | `EventEmitter<ScheduledDateSelection>` | Emitted when selection changes |
298
+ | `cleared` | `EventEmitter<void>` | Emitted when clear button is clicked |
299
+
300
+ #### Features
301
+
302
+ - **Single Date Mode**: Select one date with optional start and end times
303
+ - **Multiple Dates Mode**: Select multiple dates, each with individual time configuration
304
+ - **Date Range Mode**: Select a date range with start and end times
305
+ - **All Day Toggle**: Mark dates as all-day events
306
+ - **Time Configuration**: Individual time pickers for each date/range
307
+
308
+ ### TimePickerComponent
309
+
310
+ A standalone time picker component with scrollable hour, minute, and AM/PM selectors.
311
+
312
+ #### Basic Example
313
+
314
+ ```typescript
315
+ import { TimePickerComponent } from '@brickclay/ui';
316
+
317
+ @Component({
318
+ template: `
319
+ <brickclay-time-picker
320
+ [value]="selectedTime"
321
+ [label]="'Start Time'"
322
+ [timeFormat]="12"
323
+ (timeChange)="onTimeChange($event)">
324
+ </brickclay-time-picker>
325
+ `
326
+ })
327
+ export class MyComponent {
328
+ selectedTime = '1:00 AM';
329
+
330
+ onTimeChange(time: string) {
331
+ this.selectedTime = time;
332
+ console.log('New time:', time);
333
+ }
334
+ }
335
+ ```
336
+
337
+ #### Component Selector
338
+
339
+ `<brickclay-time-picker>`
340
+
341
+ #### Inputs
342
+
343
+ | Input | Type | Default | Description |
344
+ |-------|------|---------|-------------|
345
+ | `value` | `string` | `'1:00 AM'` | Current time value (format: "H:MM AM/PM" or "HH:MM") |
346
+ | `label` | `string` | `'Time'` | Label text |
347
+ | `placeholder` | `string` | `'Select time'` | Placeholder text |
348
+ | `position` | `'left' \| 'right'` | `'left'` | Dropdown position |
349
+ | `pickerId` | `string` | `''` | Unique identifier for the picker |
350
+ | `closePicker` | `number` | `0` | Counter to trigger picker close |
351
+ | `timeFormat` | `12 \| 24` | `12` | Time format (12-hour or 24-hour) |
352
+ | `showSeconds` | `boolean` | `false` | Show seconds selector |
353
+
354
+ #### Outputs
355
+
356
+ | Output | Type | Description |
357
+ |--------|------|-------------|
358
+ | `timeChange` | `EventEmitter<string>` | Emitted when time changes |
359
+ | `pickerOpened` | `EventEmitter<string>` | Emitted when picker opens |
360
+ | `pickerClosed` | `EventEmitter<string>` | Emitted when picker closes |
361
+
362
+ #### Features
363
+
364
+ - Scrollable time selectors
365
+ - Keyboard navigation support
366
+ - 12-hour and 24-hour formats
367
+ - Optional seconds support
368
+ - Multiple picker coordination (only one open at a time)
369
+ - Click outside to close
370
+
371
+ #### Time Format Examples
372
+
373
+ **12-hour format:**
374
+ ```typescript
375
+ value="1:00 AM"
376
+ value="12:30 PM"
377
+ value="11:45 PM"
378
+ ```
379
+
380
+ **24-hour format:**
381
+ ```typescript
382
+ value="01:00"
383
+ value="13:30"
384
+ value="23:45"
385
+ ```
386
+
387
+ ## πŸ”˜ Toggle
388
+
389
+ A versatile toggle/switch component that integrates seamlessly with Angular forms. Supports both template-driven forms (`ngModel`) and reactive forms, with full accessibility features and keyboard navigation.
390
+
391
+ ### ToggleComponent
392
+
393
+ A standalone toggle component that implements `ControlValueAccessor` for seamless Angular forms integration.
394
+
395
+ #### Basic Example
396
+
397
+ ```typescript
398
+ import { ToggleComponent } from '@brickclay/ui';
399
+ import { FormsModule } from '@angular/forms';
400
+
401
+ @Component({
402
+ template: `
403
+ <brickclay-toggle
404
+ [(ngModel)]="isEnabled"
405
+ [label]="'Enable notifications'"
406
+ (change)="onToggleChange($event)">
407
+ </brickclay-toggle>
408
+ `,
409
+ imports: [ToggleComponent, FormsModule]
410
+ })
411
+ export class MyComponent {
412
+ isEnabled = false;
413
+
414
+ onToggleChange(value: boolean) {
415
+ console.log('Toggle state:', value);
416
+ }
417
+ }
418
+ ```
419
+
420
+ #### Component Selector
421
+
422
+ `<brickclay-toggle>`
423
+
424
+ #### Inputs
425
+
426
+ | Input | Type | Default | Description |
427
+ |-------|------|---------|-------------|
428
+ | `label` | `string` | `''` | Optional label text displayed next to the toggle |
429
+ | `disabled` | `boolean` | `false` | Disables the toggle interaction |
430
+ | `toggleClass` | `string` | `'toggle-md'` | CSS class for size styling. Options: `'toggle-sm'`, `'toggle-md'`, `'toggle-lg'` |
431
+
432
+ #### Outputs
433
+
434
+ | Output | Type | Description |
435
+ |--------|------|-------------|
436
+ | `change` | `EventEmitter<boolean>` | Emitted when toggle state changes (returns new boolean value) |
437
+
438
+ #### Features
439
+
440
+ - βœ… **Angular Forms Integration** - Full support for `ngModel` and reactive forms
441
+ - βœ… **Three Size Variants** - Small (`toggle-sm`), Medium (`toggle-md`), Large (`toggle-lg`)
442
+ - βœ… **Accessibility** - ARIA attributes, keyboard navigation, and screen reader support
443
+ - βœ… **Disabled State** - Visual and functional disabled state
444
+ - βœ… **Customizable Styling** - Custom CSS classes for size and appearance
445
+ - βœ… **Event Handling** - `change` event for state change notifications
446
+
447
+ #### Usage Examples
448
+
449
+ **Basic Toggle with ngModel:**
450
+
451
+ ```typescript
452
+ import { ToggleComponent } from '@brickclay/ui';
453
+ import { FormsModule } from '@angular/forms';
454
+
455
+ @Component({
456
+ template: `
457
+ <brickclay-toggle
458
+ [(ngModel)]="isActive"
459
+ [label]="'Active Status'">
460
+ </brickclay-toggle>
461
+ `,
462
+ imports: [ToggleComponent, FormsModule]
463
+ })
464
+ export class MyComponent {
465
+ isActive = true;
466
+ }
467
+ ```
468
+
469
+ **Different Sizes:**
470
+
471
+ ```typescript
472
+ <brickclay-toggle
473
+ [(ngModel)]="value1"
474
+ [toggleClass]="'toggle-sm'"
475
+ [label]="'Small Toggle'">
476
+ </brickclay-toggle>
477
+
478
+ <brickclay-toggle
479
+ [(ngModel)]="value2"
480
+ [toggleClass]="'toggle-md'"
481
+ [label]="'Medium Toggle'">
482
+ </brickclay-toggle>
483
+
484
+ <brickclay-toggle
485
+ [(ngModel)]="value3"
486
+ [toggleClass]="'toggle-lg'"
487
+ [label]="'Large Toggle'">
488
+ </brickclay-toggle>
489
+ ```
490
+
491
+ **Disabled State:**
492
+
493
+ ```typescript
494
+ <brickclay-toggle
495
+ [ngModel]="true"
496
+ [disabled]="true"
497
+ [label]="'Disabled Toggle'">
498
+ </brickclay-toggle>
499
+ ```
500
+
501
+ **With Event Handler:**
502
+
503
+ ```typescript
504
+ @Component({
505
+ template: `
506
+ <brickclay-toggle
507
+ [(ngModel)]="notificationsEnabled"
508
+ [label]="'Email Notifications'"
509
+ (change)="onNotificationToggle($event)">
510
+ </brickclay-toggle>
511
+ `
512
+ })
513
+ export class MyComponent {
514
+ notificationsEnabled = false;
515
+
516
+ onNotificationToggle(enabled: boolean) {
517
+ if (enabled) {
518
+ this.enableNotifications();
519
+ } else {
520
+ this.disableNotifications();
521
+ }
522
+ }
523
+ }
524
+ ```
525
+
526
+ **Reactive Forms Integration:**
527
+
528
+ ```typescript
529
+ import { FormBuilder, FormGroup, ReactiveFormsModule } from '@angular/forms';
530
+ import { ToggleComponent } from '@brickclay/ui';
531
+
532
+ @Component({
533
+ template: `
534
+ <form [formGroup]="settingsForm">
535
+ <brickclay-toggle
536
+ formControlName="darkMode"
537
+ [label]="'Dark Mode'">
538
+ </brickclay-toggle>
539
+
540
+ <brickclay-toggle
541
+ formControlName="notifications"
542
+ [label]="'Push Notifications'">
543
+ </brickclay-toggle>
544
+ </form>
545
+ `,
546
+ imports: [ToggleComponent, ReactiveFormsModule]
547
+ })
548
+ export class SettingsComponent {
549
+ settingsForm: FormGroup;
550
+
551
+ constructor(private fb: FormBuilder) {
552
+ this.settingsForm = this.fb.group({
553
+ darkMode: [false],
554
+ notifications: [true]
555
+ });
556
+ }
557
+ }
558
+ ```
559
+
560
+ **Without Label:**
561
+
562
+ ```typescript
563
+ <brickclay-toggle
564
+ [(ngModel)]="isEnabled"
565
+ [toggleClass]="'toggle-md'">
566
+ </brickclay-toggle>
567
+ ```
568
+
569
+ #### Styling
570
+
571
+ The toggle component uses CSS classes for size variants:
572
+
573
+ - **Small**: `toggle-sm` - Width: 28px (w-7)
574
+ - **Medium**: `toggle-md` - Width: 36px (w-9) - Default
575
+ - **Large**: `toggle-lg` - Width: 44px (w-11)
576
+
577
+ The component includes built-in styles for:
578
+ - On state (green background: `#22973F`)
579
+ - Off state (gray background: `#BBBDC5`)
580
+ - Disabled state (light gray: `#D6D7DC`)
581
+ - Hover states
582
+ - Focus ring for accessibility
583
+ - Smooth transitions
584
+
585
+ #### Accessibility
586
+
587
+ The toggle component includes:
588
+ - `role="switch"` for screen readers
589
+ - `aria-checked` attribute that reflects the current state
590
+ - Keyboard navigation support
591
+ - Focus visible ring for keyboard users
592
+ - Disabled state properly communicated to assistive technologies
593
+
594
+ ## πŸ“ TypeScript Interfaces
595
+
596
+ ### CalendarRange
597
+
598
+ ```typescript
599
+ interface CalendarRange {
600
+ start: Date;
601
+ end: Date;
602
+ }
603
+ ```
604
+
605
+ ### CalendarSelection
606
+
607
+ ```typescript
608
+ interface CalendarSelection {
609
+ startDate: Date | null;
610
+ endDate: Date | null;
611
+ selectedDates?: Date[]; // For multi-date selection
612
+ }
613
+ ```
614
+
615
+ ### TimeConfiguration
616
+
617
+ ```typescript
618
+ interface TimeConfiguration {
619
+ date: Date;
620
+ allDay: boolean;
621
+ startTime: string; // Format: "HH:mm" or "HH:mm:ss"
622
+ endTime: string;
623
+ }
624
+ ```
625
+
626
+ ### ScheduledDateSelection
627
+
628
+ ```typescript
629
+ interface ScheduledDateSelection {
630
+ mode: 'single' | 'multiple' | 'range';
631
+ singleDate?: {
632
+ startDate: Date;
633
+ endDate: Date;
634
+ allDay: boolean;
635
+ startTime: string;
636
+ endTime: string;
637
+ };
638
+ multipleDates?: TimeConfiguration[];
639
+ dateRange?: {
640
+ startDate: Date;
641
+ endDate: Date;
642
+ allDay: boolean;
643
+ startTime: string;
644
+ endTime: string;
645
+ };
646
+ }
647
+ ```
648
+
649
+ ## 🎯 Common Use Cases
650
+
651
+ ### Form Integration
652
+
653
+ ```typescript
654
+ import { FormBuilder, FormGroup, Validators } from '@angular/forms';
655
+ import { CustomCalendarComponent } from '@brickclay/ui';
656
+
657
+ export class BookingFormComponent {
658
+ bookingForm: FormGroup;
659
+
660
+ constructor(private fb: FormBuilder) {
661
+ this.bookingForm = this.fb.group({
662
+ checkIn: [null, Validators.required],
663
+ checkOut: [null, Validators.required]
664
+ });
665
+ }
666
+
667
+ onDateSelected(selection: CalendarSelection) {
668
+ this.bookingForm.patchValue({
669
+ checkIn: selection.startDate,
670
+ checkOut: selection.endDate
671
+ });
672
+ }
673
+ }
674
+ ```
675
+
676
+ ### Reactive Forms
677
+
678
+ ```typescript
679
+ <brickclay-custom-calendar
680
+ [selectedValue]="form.get('dateRange')?.value"
681
+ (selected)="form.patchValue({ dateRange: $event })">
682
+ </brickclay-custom-calendar>
683
+ ```
684
+
685
+ ### Date Filtering
686
+
687
+ ```typescript
688
+ export class DataTableComponent {
689
+ filterDates: CalendarSelection = { startDate: null, endDate: null };
690
+
691
+ onDateFilter(selection: CalendarSelection) {
692
+ this.filterDates = selection;
693
+ this.loadFilteredData();
694
+ }
695
+
696
+ loadFilteredData() {
697
+ const filtered = this.data.filter(item => {
698
+ if (!this.filterDates.startDate || !this.filterDates.endDate) {
699
+ return true;
700
+ }
701
+ return item.date >= this.filterDates.startDate! &&
702
+ item.date <= this.filterDates.endDate!;
703
+ });
704
+ }
705
+ }
706
+ ```
707
+
708
+ ## πŸ“¦ Assets Configuration
709
+
710
+ The calendar components require SVG icons. Configure your `angular.json` to copy assets:
711
+
712
+ ```json
713
+ {
714
+ "glob": "**/*",
715
+ "input": "node_modules/@brickclay/ui/assets",
716
+ "output": "assets"
717
+ }
718
+ ```
719
+
720
+ Or manually copy assets from:
721
+ ```
722
+ node_modules/@brickclay/ui/assets/calender/* β†’ your-app/public/assets/calender/
723
+ ```
724
+
725
+ ## πŸ”§ Service
726
+
727
+ ### CalendarManagerService
728
+
729
+ A service that manages multiple calendar instances, ensuring only one calendar is open at a time when not in inline mode. Used internally by `CustomCalendarComponent`.
730
+
731
+ ## 🌐 Browser Support
732
+
733
+ - Chrome (latest)
734
+ - Firefox (latest)
735
+ - Safari (latest)
736
+ - Edge (latest)
737
+
738
+ ## πŸ“¦ Dependencies
739
+
740
+ - Angular 20.3.0+
741
+ - moment (for date formatting)
742
+
743
+ ## 🀝 Contributing
744
+
745
+ We welcome contributions! Please see our contributing guidelines for more information.
746
+
747
+ ## πŸ“„ License
748
+
749
+ MIT
750
+
751
+ ## πŸ“ž Support
752
+
753
+ For issues, feature requests, or contributions, please visit our [GitHub repository](https://github.com/brickclay/ui).
754
+
755
+ ## πŸ—ΊοΈ Roadmap
756
+
757
+ - [ ] Button components
758
+ - [ ] Input components
759
+ - [ ] Card components
760
+ - [ ] Modal/Dialog components
761
+ - [ ] Table components
762
+ - [ ] Form components
763
+ - [ ] Navigation components
764
+ - [ ] Loading/Spinner components
765
+ - [ ] Toast/Notification components
766
+ - [ ] More calendar features
767
+
768
+ ## πŸ“ Changelog
769
+
770
+ ### Version 0.0.1
771
+
772
+ **Initial Release:**
773
+ - βœ… Calendar component suite
774
+ - Single date selection
775
+ - Date range selection
776
+ - Multiple date selection
777
+ - Time picker integration
778
+ - Inline and dropdown modes
779
+ - Dual calendar view
780
+ - Custom date ranges
781
+ - Date constraints (min/max)
782
+ - βœ… Scheduled date picker component
783
+ - βœ… Standalone time picker component
784
+ - βœ… Toggle/Switch component
785
+ - Angular forms integration (ngModel & reactive forms)
786
+ - Three size variants (small, medium, large)
787
+ - Disabled state support
788
+ - Full accessibility features
789
+ - Customizable styling
790
+ - βœ… TypeScript definitions
791
+ - βœ… Comprehensive documentation
792
+
793
+ ---
794
+
795
+ **Built with ❀️ by the Brickclay team**