@brickclay-org/ui 0.0.57 β†’ 0.0.59

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,1911 +1,1911 @@
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
- ### Checkbox Component
26
-
27
- A fully accessible checkbox component with Angular forms integration. Features customizable styling via CSS classes, disabled state, keyboard navigation, and seamless integration with both template-driven and reactive forms.
28
-
29
- ### Radio Component
30
-
31
- A fully accessible radio button component with Angular forms integration. Features two visual variants (dot and tick), customizable styling, disabled state, keyboard navigation, and seamless integration with both template-driven and reactive forms.
32
-
33
- ### Pill Component
34
-
35
- A versatile pill component for displaying labels, tags, or status indicators. Features multiple variants (Light, Solid, Outline, Transparent), color options, size variants, optional dot indicators, and removable functionality with click events.
36
-
37
- ### Badge Component
38
-
39
- A flexible badge component for displaying labels, tags, or status indicators. Features multiple variants (Light, Solid, Outline, Transparent), color options, size variants, optional dot indicators, and removable functionality with click events.
40
-
41
- ### Button Component
42
-
43
- A versatile button component with support for text labels, icons, loading states, and multiple variants. Features seven size options, two variants (primary/secondary), optional left/right icons, loading spinner, and full customization support.
44
-
45
- ### Icon Button Component
46
-
47
- A compact icon-only button component perfect for toolbars and action buttons. Features seven size options, two variants (primary/secondary), and customizable styling.
48
-
49
- ### Button Group Component
50
-
51
- A button group component for creating toggleable button sets. Supports single and multiple selection modes, with automatic state management and value change events.
52
-
53
- ### Spinner Component
54
-
55
- A loading spinner component for indicating asynchronous operations. Features five size variants, customizable colors, and show/hide control.
56
-
57
- _More components coming soon..._
58
-
59
- ## Installation
60
-
61
- ```bash
62
- npm i @brickclay-org/ui@0.0.26
63
- ```
64
-
65
- ### Peer Dependencies
66
-
67
- This library requires Angular 20.3.0 or higher:
68
-
69
- ```bash
70
- npm install @angular/common@^20.3.0 @angular/core@^20.3.0 moment
71
- ```
72
-
73
- ### Asset Configuration (Required)
74
-
75
- After installing the library, you need to configure your `angular.json` to include the library's assets (icons, etc.). Add the following to your project's `assets` array in the `build` options:
76
-
77
- ```json
78
- {
79
- "projects": {
80
- "your-app-name": {
81
- "architect": {
82
- "build": {
83
- "options": {
84
- "assets": [
85
- "src/favicon.ico",
86
- "src/assets",
87
- {
88
- "glob": "**/*",
89
- "input": "node_modules/@brickclay-org/ui/assets",
90
- "output": "/assets/brickclay-lib/"
91
- }
92
- ]
93
- }
94
- }
95
- }
96
- }
97
- }
98
- }
99
- ```
100
-
101
- This configuration copies the library's assets (SVG icons, etc.) to your application's output folder during build. Without this, the component icons will not display correctly.
102
-
103
- ## Quick Start
104
-
105
- ### Standalone Component Usage (Recommended)
106
-
107
- ```typescript
108
- import { Component } from '@angular/core';
109
- import { BkCustomCalendar, CalendarSelection } from '@brickclay/ui';
110
-
111
- @Component({
112
- standalone: true,
113
- selector: 'app-my-component',
114
- imports: [BkCustomCalendar],
115
- template: `
116
- <bk-custom-calendar (selected)="onDateSelected($event)"> </bk-custom-calendar>
117
- `,
118
- })
119
- export class MyComponent {
120
- onDateSelected(selection: CalendarSelection) {
121
- console.log('Selected:', selection);
122
- }
123
- }
124
- ```
125
-
126
- ### Module-based Usage
127
-
128
- ```typescript
129
- import { NgModule } from '@angular/core';
130
- import { CalendarModule } from '@brickclay/ui';
131
-
132
- @NgModule({
133
- imports: [CalendarModule],
134
- // ...
135
- })
136
- export class AppModule {}
137
- ```
138
-
139
- ## πŸ“… Calendar
140
-
141
- 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`.
142
-
143
- ### Components Overview
144
-
145
- 1. **BkCustomCalendar** (`brickclay-custom-calendar`) - Main calendar component with support for single date, date range, and multiple date selection
146
- 2. **BkScheduledDatePicker** (`brickclay-scheduled-date-picker`) - Advanced scheduling component with time configuration for events
147
- 3. **BkTimePicker** (`brickclay-time-picker`) - Standalone time selection component with scrollable pickers
148
-
149
- ### BkCustomCalendar
150
-
151
- A versatile calendar component that supports single date, date range, and multiple date selection modes.
152
-
153
- #### Basic Example
154
-
155
- ```typescript
156
- import { BkCustomCalendar, CalendarSelection } from '@brickclay/ui';
157
-
158
- @Component({
159
- template: `
160
- <bk-custom-calendar
161
- [singleDatePicker]="false"
162
- [dualCalendar]="true"
163
- [enableTimepicker]="true"
164
- [showRanges]="true"
165
- [placeholder]="'Select date range'"
166
- (selected)="onDateSelected($event)"
167
- >
168
- </bk-custom-calendar>
169
- `,
170
- })
171
- export class MyComponent {
172
- onDateSelected(selection: CalendarSelection) {
173
- console.log('Start:', selection.startDate);
174
- console.log('End:', selection.endDate);
175
- }
176
- }
177
- ```
178
-
179
- #### Component Selector
180
-
181
- `<bk-custom-calendar>`
182
-
183
- #### Inputs
184
-
185
- | Input | Type | Default | Description |
186
- | -------------------- | ------------------------------- | --------------------- | ------------------------------------------------- |
187
- | `enableTimepicker` | `boolean` | `false` | Enable time selection |
188
- | `autoApply` | `boolean` | `false` | Automatically apply selection when date is chosen |
189
- | `closeOnAutoApply` | `boolean` | `false` | Close calendar after auto-apply |
190
- | `showCancel` | `boolean` | `true` | Show cancel button in footer |
191
- | `singleDatePicker` | `boolean` | `false` | Enable single date selection mode |
192
- | `dualCalendar` | `boolean` | `false` | Show two calendars side-by-side |
193
- | `showRanges` | `boolean` | `true` | Show predefined date range buttons |
194
- | `multiDateSelection` | `boolean` | `false` | Enable multiple date selection |
195
- | `inline` | `boolean` | `false` | Always show calendar (no dropdown) |
196
- | `minDate` | `Date` | `undefined` | Minimum selectable date |
197
- | `maxDate` | `Date` | `undefined` | Maximum selectable date |
198
- | `placeholder` | `string` | `'Select date range'` | Input placeholder text |
199
- | `opens` | `'left' \| 'right' \| 'center'` | `'left'` | Dropdown alignment |
200
- | `drop` | `'up' \| 'down'` | `'down'` | Dropdown direction |
201
- | `displayFormat` | `string` | `'MM/DD/YYYY'` | Date display format (moment format) |
202
- | `customRanges` | `Record<string, CalendarRange>` | `undefined` | Custom predefined ranges |
203
- | `selectedValue` | `CalendarSelection \| null` | `null` | Pre-selected date(s) |
204
- | `isDisplayCrossIcon` | `boolean` | `true` | Show/hide clear button |
205
-
206
- #### Outputs
207
-
208
- | Output | Type | Description |
209
- | ---------- | --------------------------------- | ----------------------------------- |
210
- | `selected` | `EventEmitter<CalendarSelection>` | Emitted when date selection changes |
211
- | `opened` | `EventEmitter<void>` | Emitted when calendar opens |
212
- | `closed` | `EventEmitter<void>` | Emitted when calendar closes |
213
-
214
- #### Usage Examples
215
-
216
- **Single Date Selection:**
217
-
218
- ```typescript
219
- <bk-custom-calendar
220
- [singleDatePicker]="true"
221
- [placeholder]="'Select a date'"
222
- (selected)="onDateSelected($event)">
223
- </bk-custom-calendar>
224
- ```
225
-
226
- **Date Range with Time Picker:**
227
-
228
- ```typescript
229
- <bk-custom-calendar
230
- [dualCalendar]="true"
231
- [enableTimepicker]="true"
232
- [enableSeconds]="true"
233
- (selected)="onRangeSelected($event)">
234
- </bk-custom-calendar>
235
- ```
236
-
237
- **Multiple Date Selection:**
238
-
239
- ```typescript
240
- <bk-custom-calendar
241
- [multiDateSelection]="true"
242
- [inline]="true"
243
- (selected)="onMultipleDatesSelected($event)">
244
- </bk-custom-calendar>
245
- ```
246
-
247
- **Inline Calendar:**
248
-
249
- ```typescript
250
- <bk-custom-calendar
251
- [inline]="true"
252
- [dualCalendar]="false"
253
- [showRanges]="false"
254
- (selected)="onDateSelected($event)">
255
- </bk-custom-calendar>
256
- ```
257
-
258
- **Custom Date Ranges:**
259
-
260
- ```typescript
261
- import { CalendarRange } from '@brickclay/ui';
262
-
263
- const customRanges: Record<string, CalendarRange> = {
264
- 'Last Week': {
265
- start: new Date(2024, 0, 1),
266
- end: new Date(2024, 0, 7)
267
- },
268
- 'This Quarter': {
269
- start: new Date(2024, 0, 1),
270
- end: new Date(2024, 2, 31)
271
- }
272
- };
273
-
274
- <bk-custom-calendar
275
- [customRanges]="customRanges"
276
- [showRanges]="true"
277
- (selected)="onDateSelected($event)">
278
- </bk-custom-calendar>
279
- ```
280
-
281
- **Date Constraints:**
282
-
283
- ```typescript
284
- <bk-custom-calendar
285
- [minDate]="new Date(2024, 0, 1)"
286
- [maxDate]="new Date(2024, 11, 31)"
287
- (selected)="onDateSelected($event)">
288
- </bk-custom-calendar>
289
- ```
290
-
291
- **Pre-selected Values:**
292
-
293
- ```typescript
294
- export class MyComponent {
295
- selectedValue: CalendarSelection = {
296
- startDate: new Date(2024, 5, 15),
297
- endDate: new Date(2024, 5, 20)
298
- };
299
-
300
- onDateChange() {
301
- this.selectedValue = {
302
- startDate: new Date(),
303
- endDate: new Date()
304
- };
305
- }
306
- }
307
-
308
- <bk-custom-calendar
309
- [selectedValue]="selectedValue"
310
- (selected)="onDateSelected($event)">
311
- </bk-custom-calendar>
312
- ```
313
-
314
- ### BkScheduledDatePicker
315
-
316
- A comprehensive date and time scheduling component with three modes: single date, multiple dates, and date range, each with time configuration.
317
-
318
- #### Basic Example
319
-
320
- ```typescript
321
- import { BkScheduledDatePicker, ScheduledDateSelection } from '@brickclay/ui';
322
-
323
- @Component({
324
- template: `
325
- <bk-scheduled-date-picker [timeFormat]="12" (scheduled)="onScheduled($event)">
326
- </bk-scheduled-date-picker>
327
- `,
328
- })
329
- export class MyComponent {
330
- onScheduled(selection: ScheduledDateSelection) {
331
- console.log('Mode:', selection.mode);
332
- if (selection.mode === 'single' && selection.singleDate) {
333
- console.log('Start:', selection.singleDate.startDate);
334
- console.log('End:', selection.singleDate.endDate);
335
- console.log('All Day:', selection.singleDate.allDay);
336
- }
337
- }
338
- }
339
- ```
340
-
341
- #### Component Selector
342
-
343
- `<bk-scheduled-date-picker>`
344
-
345
- #### Inputs
346
-
347
- | Input | Type | Default | Description |
348
- | --------------- | ---------- | ------- | -------------------------------- |
349
- | `timeFormat` | `12 \| 24` | `12` | Time format (12-hour or 24-hour) |
350
- | `enableSeconds` | `boolean` | `false` | Enable seconds in time picker |
351
-
352
- #### Outputs
353
-
354
- | Output | Type | Description |
355
- | ----------- | -------------------------------------- | ------------------------------------ |
356
- | `scheduled` | `EventEmitter<ScheduledDateSelection>` | Emitted when selection changes |
357
- | `cleared` | `EventEmitter<void>` | Emitted when clear button is clicked |
358
-
359
- #### Features
360
-
361
- - **Single Date Mode**: Select one date with optional start and end times
362
- - **Multiple Dates Mode**: Select multiple dates, each with individual time configuration
363
- - **Date Range Mode**: Select a date range with start and end times
364
- - **All Day Toggle**: Mark dates as all-day events
365
- - **Time Configuration**: Individual time pickers for each date/range
366
-
367
- ### BkTimePicker
368
-
369
- A standalone time picker component with scrollable hour, minute, and AM/PM selectors.
370
-
371
- #### Basic Example
372
-
373
- ```typescript
374
- import { BkTimePicker } from '@brickclay/ui';
375
-
376
- @Component({
377
- template: `
378
- <bk-time-picker
379
- [value]="selectedTime"
380
- [label]="'Start Time'"
381
- [timeFormat]="12"
382
- (timeChange)="onTimeChange($event)"
383
- >
384
- </bk-time-picker>
385
- `,
386
- })
387
- export class MyComponent {
388
- selectedTime = '1:00 AM';
389
-
390
- onTimeChange(time: string) {
391
- this.selectedTime = time;
392
- console.log('New time:', time);
393
- }
394
- }
395
- ```
396
-
397
- #### Component Selector
398
-
399
- `<bk-time-picker>`
400
-
401
- #### Inputs
402
-
403
- | Input | Type | Default | Description |
404
- | ------------- | ------------------- | --------------- | ---------------------------------------------------- |
405
- | `value` | `string` | `'1:00 AM'` | Current time value (format: "H:MM AM/PM" or "HH:MM") |
406
- | `label` | `string` | `'Time'` | Label text |
407
- | `placeholder` | `string` | `'Select time'` | Placeholder text |
408
- | `position` | `'left' \| 'right'` | `'left'` | Dropdown position |
409
- | `pickerId` | `string` | `''` | Unique identifier for the picker |
410
- | `closePicker` | `number` | `0` | Counter to trigger picker close |
411
- | `timeFormat` | `12 \| 24` | `12` | Time format (12-hour or 24-hour) |
412
- | `showSeconds` | `boolean` | `false` | Show seconds selector |
413
-
414
- #### Outputs
415
-
416
- | Output | Type | Description |
417
- | -------------- | ---------------------- | -------------------------- |
418
- | `timeChange` | `EventEmitter<string>` | Emitted when time changes |
419
- | `pickerOpened` | `EventEmitter<string>` | Emitted when picker opens |
420
- | `pickerClosed` | `EventEmitter<string>` | Emitted when picker closes |
421
-
422
- #### Features
423
-
424
- - Scrollable time selectors
425
- - Keyboard navigation support
426
- - 12-hour and 24-hour formats
427
- - Optional seconds support
428
- - Multiple picker coordination (only one open at a time)
429
- - Click outside to close
430
-
431
- #### Time Format Examples
432
-
433
- **12-hour format:**
434
-
435
- ```typescript
436
- value = '1:00 AM';
437
- value = '12:30 PM';
438
- value = '11:45 PM';
439
- ```
440
-
441
- **24-hour format:**
442
-
443
- ```typescript
444
- value = '01:00';
445
- value = '13:30';
446
- value = '23:45';
447
- ```
448
-
449
- ## πŸ”˜ Toggle
450
-
451
- 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.
452
-
453
- ### BkToggle
454
-
455
- A standalone toggle component that implements `ControlValueAccessor` for seamless Angular forms integration.
456
-
457
- #### Basic Example
458
-
459
- ```typescript
460
- import { BkToggle } from '@brickclay/ui';
461
- import { FormsModule } from '@angular/forms';
462
-
463
- @Component({
464
- template: `
465
- <bk-toggle
466
- [(ngModel)]="isEnabled"
467
- [label]="'Enable notifications'"
468
- (change)="onToggleChange($event)"
469
- >
470
- </bk-toggle>
471
- `,
472
- imports: [BkToggle, FormsModule],
473
- })
474
- export class MyComponent {
475
- isEnabled = false;
476
-
477
- onToggleChange(value: boolean) {
478
- console.log('Toggle state:', value);
479
- }
480
- }
481
- ```
482
-
483
- #### Component Selector
484
-
485
- `<bk-toggle>`
486
-
487
- #### Inputs
488
-
489
- | Input | Type | Default | Description |
490
- | ------------- | --------- | ------------- | -------------------------------------------------------------------------------- |
491
- | `label` | `string` | `''` | Optional label text displayed next to the toggle |
492
- | `disabled` | `boolean` | `false` | Disables the toggle interaction |
493
- | `toggleClass` | `string` | `'toggle-md'` | CSS class for size styling. Options: `'toggle-sm'`, `'toggle-md'`, `'toggle-lg'` |
494
-
495
- #### Outputs
496
-
497
- | Output | Type | Description |
498
- | -------- | ----------------------- | ------------------------------------------------------------- |
499
- | `change` | `EventEmitter<boolean>` | Emitted when toggle state changes (returns new boolean value) |
500
-
501
- #### Features
502
-
503
- - βœ… **Angular Forms Integration** - Full support for `ngModel` and reactive forms
504
- - βœ… **Three Size Variants** - Small (`toggle-sm`), Medium (`toggle-md`), Large (`toggle-lg`)
505
- - βœ… **Accessibility** - ARIA attributes, keyboard navigation, and screen reader support
506
- - βœ… **Disabled State** - Visual and functional disabled state
507
- - βœ… **Customizable Styling** - Custom CSS classes for size and appearance
508
- - βœ… **Event Handling** - `change` event for state change notifications
509
-
510
- #### Usage Examples
511
-
512
- **Basic Toggle with ngModel:**
513
-
514
- ```typescript
515
- import { BkToggle } from '@brickclay/ui';
516
- import { FormsModule } from '@angular/forms';
517
-
518
- @Component({
519
- template: `
520
- <bk-toggle [(ngModel)]="isActive" [label]="'Active Status'"> </bk-toggle>
521
- `,
522
- imports: [BkToggle, FormsModule],
523
- })
524
- export class MyComponent {
525
- isActive = true;
526
- }
527
- ```
528
-
529
- **Different Sizes:**
530
-
531
- ```typescript
532
- <bk-toggle
533
- [(ngModel)]="value1"
534
- [toggleClass]="'toggle-sm'"
535
- [label]="'Small Toggle'">
536
- </bk-toggle>
537
-
538
- <bk-toggle
539
- [(ngModel)]="value2"
540
- [toggleClass]="'toggle-md'"
541
- [label]="'Medium Toggle'">
542
- </bk-toggle>
543
-
544
- <bk-toggle
545
- [(ngModel)]="value3"
546
- [toggleClass]="'toggle-lg'"
547
- [label]="'Large Toggle'">
548
- </bk-toggle>
549
- ```
550
-
551
- **Disabled State:**
552
-
553
- ```typescript
554
- <bk-toggle
555
- [ngModel]="true"
556
- [disabled]="true"
557
- [label]="'Disabled Toggle'">
558
- </bk-toggle>
559
- ```
560
-
561
- **With Event Handler:**
562
-
563
- ```typescript
564
- @Component({
565
- template: `
566
- <bk-toggle
567
- [(ngModel)]="notificationsEnabled"
568
- [label]="'Email Notifications'"
569
- (change)="onNotificationToggle($event)"
570
- >
571
- </bk-toggle>
572
- `,
573
- })
574
- export class MyComponent {
575
- notificationsEnabled = false;
576
-
577
- onNotificationToggle(enabled: boolean) {
578
- if (enabled) {
579
- this.enableNotifications();
580
- } else {
581
- this.disableNotifications();
582
- }
583
- }
584
- }
585
- ```
586
-
587
- **Reactive Forms Integration:**
588
-
589
- ```typescript
590
- import { FormBuilder, FormGroup, ReactiveFormsModule } from '@angular/forms';
591
- import { BkToggle } from '@brickclay/ui';
592
-
593
- @Component({
594
- template: `
595
- <form [formGroup]="settingsForm">
596
- <bk-toggle formControlName="darkMode" [label]="'Dark Mode'"> </bk-toggle>
597
-
598
- <bk-toggle formControlName="notifications" [label]="'Push Notifications'">
599
- </bk-toggle>
600
- </form>
601
- `,
602
- imports: [BkToggle, ReactiveFormsModule],
603
- })
604
- export class SettingsComponent {
605
- settingsForm: FormGroup;
606
-
607
- constructor(private fb: FormBuilder) {
608
- this.settingsForm = this.fb.group({
609
- darkMode: [false],
610
- notifications: [true],
611
- });
612
- }
613
- }
614
- ```
615
-
616
- **Without Label:**
617
-
618
- ```typescript
619
- <bk-toggle
620
- [(ngModel)]="isEnabled"
621
- [toggleClass]="'toggle-md'">
622
- </bk-toggle>
623
- ```
624
-
625
- #### Styling
626
-
627
- The toggle component uses CSS classes for size variants:
628
-
629
- - **Small**: `toggle-sm` - Width: 28px (w-7)
630
- - **Medium**: `toggle-md` - Width: 36px (w-9) - Default
631
- - **Large**: `toggle-lg` - Width: 44px (w-11)
632
-
633
- The component includes built-in styles for:
634
-
635
- - On state (green background: `#22973F`)
636
- - Off state (gray background: `#BBBDC5`)
637
- - Disabled state (light gray: `#D6D7DC`)
638
- - Hover states
639
- - Focus ring for accessibility
640
- - Smooth transitions
641
-
642
- #### Accessibility
643
-
644
- The toggle component includes:
645
-
646
- - `role="switch"` for screen readers
647
- - `aria-checked` attribute that reflects the current state
648
- - Keyboard navigation support
649
- - Focus visible ring for keyboard users
650
- - Disabled state properly communicated to assistive technologies
651
-
652
- ## β˜‘οΈ Checkbox
653
-
654
- A fully accessible checkbox component that integrates seamlessly with Angular forms. Supports both template-driven forms (`ngModel`) and reactive forms, with customizable styling and comprehensive accessibility features.
655
-
656
- ### BkCheckbox
657
-
658
- A standalone checkbox component that implements `ControlValueAccessor` for seamless Angular forms integration.
659
-
660
- #### Basic Example
661
-
662
- ```typescript
663
- import { BkCheckbox } from '@brickclay/ui';
664
- import { FormsModule } from '@angular/forms';
665
-
666
- @Component({
667
- template: `
668
- <bk-checkbox
669
- [(ngModel)]="isAccepted"
670
- [label]="'I agree to the terms and conditions'"
671
- (change)="onCheckboxChange($event)"
672
- >
673
- </bk-checkbox>
674
- `,
675
- imports: [BkCheckbox, FormsModule],
676
- })
677
- export class MyComponent {
678
- isAccepted = false;
679
-
680
- onCheckboxChange(value: boolean) {
681
- console.log('Checkbox state:', value);
682
- }
683
- }
684
- ```
685
-
686
- #### Component Selector
687
-
688
- `<bk-checkbox>`
689
-
690
- #### Inputs
691
-
692
- | Input | Type | Default | Description |
693
- | --------------- | --------- | ------- | -------------------------------------------------------------------- |
694
- | `label` | `string` | `''` | Optional label text displayed next to the checkbox |
695
- | `disabled` | `boolean` | `false` | Disables the checkbox interaction |
696
- | `checkboxClass` | `string` | `''` | CSS class for size styling. Options: `'xsm'`, `'sm'`, `'md'`, `'lg'` |
697
- | `labelClass` | `string` | `''` | Custom CSS classes for the label text |
698
-
699
- #### Outputs
700
-
701
- | Output | Type | Description |
702
- | -------- | ----------------------- | --------------------------------------------------------------- |
703
- | `change` | `EventEmitter<boolean>` | Emitted when checkbox state changes (returns new boolean value) |
704
-
705
- #### Features
706
-
707
- - βœ… **Angular Forms Integration** - Full support for `ngModel` and reactive forms
708
- - βœ… **Four Size Variants** - Extra Small (`xsm`), Small (`sm`), Medium (`md`), Large (`lg`)
709
- - βœ… **Accessibility** - ARIA attributes, keyboard navigation (Enter/Space), and screen reader support
710
- - βœ… **Disabled State** - Visual and functional disabled state
711
- - βœ… **Keyboard Support** - Full keyboard navigation with Enter and Space keys
712
- - βœ… **Focus Management** - Focus visible ring for keyboard users
713
- - βœ… **Event Handling** - `change` event for state change notifications
714
-
715
- #### Usage Examples
716
-
717
- **Basic Checkbox with ngModel:**
718
-
719
- ```typescript
720
- import { BkCheckbox } from '@brickclay/ui';
721
- import { FormsModule } from '@angular/forms';
722
-
723
- @Component({
724
- template: `
725
- <bk-checkbox [(ngModel)]="isChecked" [label]="'Accept terms'"> </bk-checkbox>
726
- `,
727
- imports: [BkCheckbox, FormsModule],
728
- })
729
- export class MyComponent {
730
- isChecked = false;
731
- }
732
- ```
733
-
734
- **Different Sizes:**
735
-
736
- ```typescript
737
- <!-- Extra Small checkbox -->
738
- <bk-checkbox
739
- [(ngModel)]="value1"
740
- [checkboxClass]="'xsm'"
741
- [label]="'Extra Small Checkbox'">
742
- </bk-checkbox>
743
-
744
- <!-- Small checkbox -->
745
- <bk-checkbox
746
- [(ngModel)]="value2"
747
- [checkboxClass]="'sm'"
748
- [label]="'Small Checkbox'">
749
- </bk-checkbox>
750
-
751
- <!-- Medium checkbox -->
752
- <bk-checkbox
753
- [(ngModel)]="value3"
754
- [checkboxClass]="'md'"
755
- [label]="'Medium Checkbox'">
756
- </bk-checkbox>
757
-
758
- <!-- Large checkbox with custom label styling -->
759
- <bk-checkbox
760
- [(ngModel)]="value4"
761
- [checkboxClass]="'lg'"
762
- [labelClass]="'text-lg font-bold'"
763
- [label]="'Large Checkbox'">
764
- </bk-checkbox>
765
- ```
766
-
767
- **Disabled State:**
768
-
769
- ```typescript
770
- <bk-checkbox
771
- [ngModel]="true"
772
- [disabled]="true"
773
- [label]="'Disabled Checkbox'">
774
- </bk-checkbox>
775
- ```
776
-
777
- **With Event Handler:**
778
-
779
- ```typescript
780
- @Component({
781
- template: `
782
- <bk-checkbox
783
- [(ngModel)]="newsletterSubscribed"
784
- [label]="'Subscribe to newsletter'"
785
- (change)="onNewsletterToggle($event)"
786
- >
787
- </bk-checkbox>
788
- `,
789
- })
790
- export class MyComponent {
791
- newsletterSubscribed = false;
792
-
793
- onNewsletterToggle(subscribed: boolean) {
794
- if (subscribed) {
795
- this.subscribeToNewsletter();
796
- } else {
797
- this.unsubscribeFromNewsletter();
798
- }
799
- }
800
- }
801
- ```
802
-
803
- **Reactive Forms Integration:**
804
-
805
- ```typescript
806
- import { FormBuilder, FormGroup, ReactiveFormsModule } from '@angular/forms';
807
- import { BkCheckbox } from '@brickclay/ui';
808
-
809
- @Component({
810
- template: `
811
- <form [formGroup]="registrationForm">
812
- <bk-checkbox
813
- formControlName="acceptTerms"
814
- [label]="'I accept the terms and conditions'"
815
- >
816
- </bk-checkbox>
817
-
818
- <bk-checkbox formControlName="receiveUpdates" [label]="'Receive product updates'">
819
- </bk-checkbox>
820
- </form>
821
- `,
822
- imports: [BkCheckbox, ReactiveFormsModule],
823
- })
824
- export class RegistrationComponent {
825
- registrationForm: FormGroup;
826
-
827
- constructor(private fb: FormBuilder) {
828
- this.registrationForm = this.fb.group({
829
- acceptTerms: [false, Validators.requiredTrue],
830
- receiveUpdates: [false],
831
- });
832
- }
833
- }
834
- ```
835
-
836
- **Without Label:**
837
-
838
- ```typescript
839
- <bk-checkbox
840
- [(ngModel)]="isSelected"
841
- [checkboxClass]="'md'">
842
- </bk-checkbox>
843
- ```
844
-
845
- **Multiple Checkboxes:**
846
-
847
- ```typescript
848
- @Component({
849
- template: `
850
- <div>
851
- <bk-checkbox
852
- *ngFor="let option of options"
853
- [(ngModel)]="option.selected"
854
- [label]="option.label"
855
- (change)="onOptionChange(option)"
856
- >
857
- </bk-checkbox>
858
- </div>
859
- `,
860
- })
861
- export class MyComponent {
862
- options = [
863
- { label: 'Option 1', selected: false },
864
- { label: 'Option 2', selected: false },
865
- { label: 'Option 3', selected: false },
866
- ];
867
-
868
- onOptionChange(option: any) {
869
- console.log(`${option.label} is now ${option.selected ? 'selected' : 'deselected'}`);
870
- }
871
- }
872
- ```
873
-
874
- #### Styling
875
-
876
- The checkbox component supports predefined size classes:
877
-
878
- - **Extra Small**: `xsm` - 14px Γ— 14px
879
- - **Small**: `sm` - 16px Γ— 16px
880
- - **Medium**: `md` - 18px Γ— 18px
881
- - **Large**: `lg` - 20px Γ— 20px
882
-
883
- Use `labelClass` to style the label text (font size, weight, color, etc.)
884
-
885
- The component includes built-in styles for:
886
-
887
- - Checked state (black background with white checkmark/tick icon)
888
- - Unchecked state (white background with gray border)
889
- - Hover states (darker border on hover)
890
- - Disabled states (gray background and border)
891
- - Focus ring for accessibility (blue ring with offset)
892
- - Smooth transitions for state changes
893
-
894
- #### Accessibility
895
-
896
- The checkbox component includes:
897
-
898
- - Keyboard navigation support (Enter and Space keys)
899
- - Focus visible ring for keyboard users
900
- - Proper ARIA attributes
901
- - Disabled state properly communicated to assistive technologies
902
- - Tab navigation support
903
-
904
- ## πŸ”˜ Radio Button
905
-
906
- A fully accessible radio button component that integrates seamlessly with Angular forms. Supports both template-driven forms (`ngModel`) and reactive forms, with two visual variants (dot and tick) and comprehensive accessibility features.
907
-
908
- ### BkRadioButton
909
-
910
- A standalone radio button component that implements `ControlValueAccessor` for seamless Angular forms integration. Radio buttons are used when only one option can be selected from a group.
911
-
912
- #### Basic Example
913
-
914
- ```typescript
915
- import { BkRadioButton } from '@brickclay/ui';
916
- import { FormsModule } from '@angular/forms';
917
-
918
- @Component({
919
- template: `
920
- <bk-radio-button
921
- [(ngModel)]="selectedOption"
922
- [value]="'option1'"
923
- [label]="'Option 1'"
924
- (change)="onRadioChange($event)"
925
- >
926
- </bk-radio-button>
927
-
928
- <bk-radio-button [(ngModel)]="selectedOption" [value]="'option2'" [label]="'Option 2'">
929
- </bk-radio-button>
930
- `,
931
- imports: [BkRadioButton, FormsModule],
932
- })
933
- export class MyComponent {
934
- selectedOption = 'option1';
935
-
936
- onRadioChange(value: any) {
937
- console.log('Selected option:', value);
938
- }
939
- }
940
- ```
941
-
942
- #### Component Selector
943
-
944
- `<bk-radio-button>`
945
-
946
- #### Inputs
947
-
948
- | Input | Type | Default | Description |
949
- | ------------ | ----------------- | ----------- | ------------------------------------------------------------------------- |
950
- | `label` | `string` | `''` | Optional label text displayed next to the radio button |
951
- | `value` | `any` | `undefined` | The value associated with this radio button (required for radio groups) |
952
- | `disabled` | `boolean` | `false` | Disables the radio button interaction |
953
- | `variant` | `'dot' \| 'tick'` | `'dot'` | Visual variant. `'dot'` shows a filled circle, `'tick'` shows a checkmark |
954
- | `radioClass` | `string` | `''` | CSS class for size styling. Options: `'xsm'`, `'sm'`, `'md'`, `'lg'` |
955
- | `labelClass` | `string` | `''` | Custom CSS classes for the label text |
956
-
957
- #### Outputs
958
-
959
- | Output | Type | Description |
960
- | -------- | ------------------- | --------------------------------------------------------- |
961
- | `change` | `EventEmitter<any>` | Emitted when radio button is selected (returns the value) |
962
-
963
- #### Features
964
-
965
- - βœ… **Angular Forms Integration** - Full support for `ngModel` and reactive forms
966
- - βœ… **Two Visual Variants** - Dot (filled circle) and Tick (checkmark) styles
967
- - βœ… **Four Size Variants** - Extra Small (`xsm`), Small (`sm`), Medium (`md`), Large (`lg`)
968
- - βœ… **Radio Groups** - Automatically groups radio buttons with the same `ngModel` binding
969
- - βœ… **Accessibility** - ARIA attributes, keyboard navigation (Enter/Space), and screen reader support
970
- - βœ… **Disabled State** - Visual and functional disabled state
971
- - βœ… **Keyboard Support** - Full keyboard navigation with Enter and Space keys
972
- - βœ… **Focus Management** - Focus visible ring for keyboard users
973
- - βœ… **Event Handling** - `change` event for selection notifications
974
-
975
- #### Usage Examples
976
-
977
- **Basic Radio Group with ngModel:**
978
-
979
- ```typescript
980
- import { BkRadioButton } from '@brickclay/ui';
981
- import { FormsModule } from '@angular/forms';
982
-
983
- @Component({
984
- template: `
985
- <bk-radio-button
986
- [(ngModel)]="selectedPayment"
987
- [value]="'credit'"
988
- [label]="'Credit Card'"
989
- >
990
- </bk-radio-button>
991
-
992
- <bk-radio-button [(ngModel)]="selectedPayment" [value]="'debit'" [label]="'Debit Card'">
993
- </bk-radio-button>
994
-
995
- <bk-radio-button [(ngModel)]="selectedPayment" [value]="'paypal'" [label]="'PayPal'">
996
- </bk-radio-button>
997
- `,
998
- imports: [BkRadioButton, FormsModule],
999
- })
1000
- export class MyComponent {
1001
- selectedPayment = 'credit';
1002
- }
1003
- ```
1004
-
1005
- **Dot Variant (Default):**
1006
-
1007
- ```typescript
1008
- <bk-radio-button
1009
- [(ngModel)]="selectedOption"
1010
- [value]="'option1'"
1011
- [variant]="'dot'"
1012
- [label]="'Option with Dot'">
1013
- </bk-radio-button>
1014
- ```
1015
-
1016
- **Tick Variant:**
1017
-
1018
- ```typescript
1019
- <bk-radio-button
1020
- [(ngModel)]="selectedOption"
1021
- [value]="'option2'"
1022
- [variant]="'tick'"
1023
- [label]="'Option with Tick'">
1024
- </bk-radio-button>
1025
- ```
1026
-
1027
- **Different Sizes:**
1028
-
1029
- ```typescript
1030
- <!-- Extra Small radio -->
1031
- <bk-radio-button
1032
- [(ngModel)]="selectedOption"
1033
- [value]="'xsm'"
1034
- [radioClass]="'xsm'"
1035
- [label]="'Extra Small Radio'">
1036
- </bk-radio-button>
1037
-
1038
- <!-- Small radio -->
1039
- <bk-radio-button
1040
- [(ngModel)]="selectedOption"
1041
- [value]="'sm'"
1042
- [radioClass]="'sm'"
1043
- [label]="'Small Radio'">
1044
- </bk-radio-button>
1045
-
1046
- <!-- Medium radio -->
1047
- <bk-radio-button
1048
- [(ngModel)]="selectedOption"
1049
- [value]="'md'"
1050
- [radioClass]="'md'"
1051
- [label]="'Medium Radio'">
1052
- </bk-radio-button>
1053
-
1054
- <!-- Large radio with custom label styling -->
1055
- <bk-radio-button
1056
- [(ngModel)]="selectedOption"
1057
- [value]="'lg'"
1058
- [radioClass]="'lg'"
1059
- [labelClass]="'text-lg font-bold'"
1060
- [label]="'Large Radio'">
1061
- </bk-radio-button>
1062
- ```
1063
-
1064
- **Disabled State:**
1065
-
1066
- ```typescript
1067
- <bk-radio-button
1068
- [(ngModel)]="selectedOption"
1069
- [value]="'disabled-option'"
1070
- [disabled]="true"
1071
- [label]="'Disabled Option'">
1072
- </bk-radio-button>
1073
- ```
1074
-
1075
- **With Event Handler:**
1076
-
1077
- ```typescript
1078
- @Component({
1079
- template: `
1080
- <bk-radio-button
1081
- *ngFor="let option of options"
1082
- [(ngModel)]="selectedOption"
1083
- [value]="option.value"
1084
- [label]="option.label"
1085
- (change)="onOptionChange($event)"
1086
- >
1087
- </bk-radio-button>
1088
- `,
1089
- })
1090
- export class MyComponent {
1091
- options = [
1092
- { value: 'option1', label: 'Option 1' },
1093
- { value: 'option2', label: 'Option 2' },
1094
- { value: 'option3', label: 'Option 3' },
1095
- ];
1096
- selectedOption = 'option1';
1097
-
1098
- onOptionChange(value: any) {
1099
- console.log('Selected:', value);
1100
- }
1101
- }
1102
- ```
1103
-
1104
- **Reactive Forms Integration:**
1105
-
1106
- ```typescript
1107
- import { FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms';
1108
- import { BkRadioButton } from '@brickclay/ui';
1109
-
1110
- @Component({
1111
- template: `
1112
- <form [formGroup]="surveyForm">
1113
- <bk-radio-button formControlName="rating" [value]="'excellent'" [label]="'Excellent'">
1114
- </bk-radio-button>
1115
-
1116
- <bk-radio-button formControlName="rating" [value]="'good'" [label]="'Good'">
1117
- </bk-radio-button>
1118
-
1119
- <bk-radio-button formControlName="rating" [value]="'fair'" [label]="'Fair'">
1120
- </bk-radio-button>
1121
- </form>
1122
- `,
1123
- imports: [BkRadioButton, ReactiveFormsModule],
1124
- })
1125
- export class SurveyComponent {
1126
- surveyForm: FormGroup;
1127
-
1128
- constructor(private fb: FormBuilder) {
1129
- this.surveyForm = this.fb.group({
1130
- rating: ['good', Validators.required],
1131
- });
1132
- }
1133
- }
1134
- ```
1135
-
1136
- **Without Label:**
1137
-
1138
- ```typescript
1139
- <bk-radio-button
1140
- [(ngModel)]="selectedOption"
1141
- [value]="'option1'"
1142
- [radioClass]="'md'">
1143
- </bk-radio-button>
1144
- ```
1145
-
1146
- **Dynamic Radio Group:**
1147
-
1148
- ```typescript
1149
- @Component({
1150
- template: `
1151
- <div>
1152
- <bk-radio-button
1153
- *ngFor="let item of items"
1154
- [(ngModel)]="selectedItem"
1155
- [value]="item.id"
1156
- [label]="item.name"
1157
- [variant]="item.variant || 'dot'"
1158
- >
1159
- </bk-radio-button>
1160
- </div>
1161
- `,
1162
- })
1163
- export class MyComponent {
1164
- items = [
1165
- { id: 1, name: 'Item 1', variant: 'dot' },
1166
- { id: 2, name: 'Item 2', variant: 'tick' },
1167
- { id: 3, name: 'Item 3', variant: 'dot' },
1168
- ];
1169
- selectedItem = 1;
1170
- }
1171
- ```
1172
-
1173
- #### Styling
1174
-
1175
- The radio button component supports predefined size classes:
1176
-
1177
- - **Extra Small**: `xsm` - 14px Γ— 14px
1178
- - **Small**: `sm` - 16px Γ— 16px
1179
- - **Medium**: `md` - 18px Γ— 18px
1180
- - **Large**: `lg` - 19px Γ— 19px
1181
-
1182
- Use `labelClass` to style the label text (font size, weight, color, etc.)
1183
-
1184
- The component includes built-in styles for:
1185
-
1186
- - **Dot Variant**: Filled circle indicator when selected (size varies by radioClass)
1187
- - **Tick Variant**: Checkmark indicator when selected (size varies by radioClass)
1188
- - Unselected state (white background with gray border)
1189
- - Hover states (darker border on hover)
1190
- - Disabled states (gray background and border)
1191
- - Focus ring for accessibility (blue ring with offset)
1192
- - Smooth transitions for state changes
1193
-
1194
- #### Accessibility
1195
-
1196
- The radio button component includes:
1197
-
1198
- - Keyboard navigation support (Enter and Space keys)
1199
- - Focus visible ring for keyboard users
1200
- - Proper ARIA attributes
1201
- - Disabled state properly communicated to assistive technologies
1202
- - Tab navigation support
1203
- - Radio group semantics for screen readers
1204
-
1205
- #### Radio Groups
1206
-
1207
- Radio buttons are automatically grouped when they share the same `ngModel` binding. Only one radio button in a group can be selected at a time. When a radio button is selected, the previously selected one in the same group is automatically deselected.
1208
-
1209
- ## πŸ’Š Pill
1210
-
1211
- A versatile pill component for displaying labels, tags, or status indicators. Perfect for categorizing content, showing status, or creating removable tag lists. Supports multiple visual variants, color schemes, sizes, and optional dot indicators.
1212
-
1213
- ### BkPill
1214
-
1215
- A standalone pill component that displays text labels with customizable styling and optional removal functionality.
1216
-
1217
- #### Basic Example
1218
-
1219
- ```typescript
1220
- import { BkPill } from '@brickclay/ui';
1221
-
1222
- @Component({
1223
- template: `
1224
- <bk-pill
1225
- [label]="'New Feature'"
1226
- [variant]="'Solid'"
1227
- [color]="'Primary'"
1228
- [size]="'md'"
1229
- (clicked)="onPillRemoved($event)"
1230
- >
1231
- </bk-pill>
1232
- `,
1233
- imports: [BkPill],
1234
- })
1235
- export class MyComponent {
1236
- onPillRemoved(label: string) {
1237
- console.log('Pill removed:', label);
1238
- }
1239
- }
1240
- ```
1241
-
1242
- #### Component Selector
1243
-
1244
- `<bk-pill>`
1245
-
1246
- #### Inputs
1247
-
1248
- | Input | Type | Default | Description |
1249
- | ------------ | --------------------------------------- | --------- | -------------------------------------------------------------------- |
1250
- | `label` | `string` | `''` | The text content displayed in the pill |
1251
- | `variant` | `'Light' \| 'Solid' \| 'Outline' \| 'Transparent'` | `'Light'` | Visual style variant |
1252
- | `color` | `'Gray' \| 'Primary' \| 'Error' \| 'Warning' \| 'Success' \| 'Purple' \| 'Cyan'` | `'Gray'` | Color scheme for the pill |
1253
- | `size` | `'xsm' \| 'sm' \| 'md' \| 'lg'` | `'md'` | Size variant of the pill |
1254
- | `dot` | `'left' \| 'right' \| 'none'` | `'none'` | Position of optional dot indicator (left, right, or none) |
1255
- | `removable` | `boolean` | `false` | Whether to show a remove button |
1256
- | `customClass`| `string` | `''` | Additional CSS classes for custom styling |
1257
-
1258
- #### Outputs
1259
-
1260
- | Output | Type | Description |
1261
- | -------- | ------------------------ | ----------------------------------------------------- |
1262
- | `clicked`| `EventEmitter<string>` | Emitted when the remove button is clicked (returns label) |
1263
-
1264
- #### Features
1265
-
1266
- - βœ… **Multiple Variants** - Light, Solid, Outline, and Transparent styles
1267
- - βœ… **Color Options** - Gray, Primary, Error, Warning, Success, Purple, and Cyan
1268
- - βœ… **Size Variants** - Extra Small (`xsm`), Small (`sm`), Medium (`md`), Large (`lg`)
1269
- - βœ… **Dot Indicators** - Optional dot indicator on left or right side
1270
- - βœ… **Removable** - Optional remove button with click event
1271
- - βœ… **Custom Styling** - Additional CSS classes for custom appearance
1272
- - βœ… **Event Handling** - `clicked` event for remove button interactions
1273
-
1274
- #### Usage Examples
1275
-
1276
- **Basic Pill:**
1277
-
1278
- ```typescript
1279
- import { BkPill } from '@brickclay/ui';
1280
-
1281
- @Component({
1282
- template: `
1283
- <bk-pill [label]="'Status'" [color]="'Success'"> </bk-pill>
1284
- `,
1285
- imports: [BkPill],
1286
- })
1287
- export class MyComponent {}
1288
- ```
1289
-
1290
- **Different Variants:**
1291
-
1292
- ```typescript
1293
- <!-- Light variant -->
1294
- <bk-pill
1295
- [label]="'Light Pill'"
1296
- [variant]="'Light'"
1297
- [color]="'Primary'">
1298
- </bk-pill>
1299
-
1300
- <!-- Solid variant -->
1301
- <bk-pill
1302
- [label]="'Solid Pill'"
1303
- [variant]="'Solid'"
1304
- [color]="'Primary'">
1305
- </bk-pill>
1306
-
1307
- <!-- Outline variant -->
1308
- <bk-pill
1309
- [label]="'Outline Pill'"
1310
- [variant]="'Outline'"
1311
- [color]="'Primary'">
1312
- </bk-pill>
1313
-
1314
- <!-- Transparent variant -->
1315
- <bk-pill
1316
- [label]="'Transparent Pill'"
1317
- [variant]="'Transparent'"
1318
- [color]="'Primary'">
1319
- </bk-pill>
1320
- ```
1321
-
1322
- **Different Colors:**
1323
-
1324
- ```typescript
1325
- <bk-pill [label]="'Gray'" [color]="'Gray'"> </bk-pill>
1326
- <bk-pill [label]="'Primary'" [color]="'Primary'"> </bk-pill>
1327
- <bk-pill [label]="'Error'" [color]="'Error'"> </bk-pill>
1328
- <bk-pill [label]="'Warning'" [color]="'Warning'"> </bk-pill>
1329
- <bk-pill [label]="'Success'" [color]="'Success'"> </bk-pill>
1330
- <bk-pill [label]="'Purple'" [color]="'Purple'"> </bk-pill>
1331
- <bk-pill [label]="'Cyan'" [color]="'Cyan'"> </bk-pill>
1332
- ```
1333
-
1334
- **Different Sizes:**
1335
-
1336
- ```typescript
1337
- <!-- Extra Small -->
1338
- <bk-pill [label]="'XSM'" [size]="'xsm'"> </bk-pill>
1339
-
1340
- <!-- Small -->
1341
- <bk-pill [label]="'SM'" [size]="'sm'"> </bk-pill>
1342
-
1343
- <!-- Medium -->
1344
- <bk-pill [label]="'MD'" [size]="'md'"> </bk-pill>
1345
-
1346
- <!-- Large -->
1347
- <bk-pill [label]="'LG'" [size]="'lg'"> </bk-pill>
1348
- ```
1349
-
1350
- **With Dot Indicators:**
1351
-
1352
- ```typescript
1353
- <!-- Dot on left -->
1354
- <bk-pill
1355
- [label]="'Active'"
1356
- [dot]="'left'"
1357
- [color]="'Success'">
1358
- </bk-pill>
1359
-
1360
- <!-- Dot on right -->
1361
- <bk-pill
1362
- [label]="'Pending'"
1363
- [dot]="'right'"
1364
- [color]="'Warning'">
1365
- </bk-pill>
1366
- ```
1367
-
1368
- **Removable Pill:**
1369
-
1370
- ```typescript
1371
- @Component({
1372
- template: `
1373
- <bk-pill
1374
- [label]="'Removable Tag'"
1375
- [removable]="true"
1376
- (clicked)="onRemoveTag($event)">
1377
- </bk-pill>
1378
- `,
1379
- })
1380
- export class MyComponent {
1381
- onRemoveTag(label: string) {
1382
- console.log('Removed:', label);
1383
- // Remove from list, update state, etc.
1384
- }
1385
- }
1386
- ```
1387
-
1388
- **Dynamic Pill List:**
1389
-
1390
- ```typescript
1391
- @Component({
1392
- template: `
1393
- <div>
1394
- <bk-pill
1395
- *ngFor="let tag of tags"
1396
- [label]="tag"
1397
- [removable]="true"
1398
- [color]="getTagColor(tag)"
1399
- (clicked)="removeTag(tag)">
1400
- </bk-pill>
1401
- </div>
1402
- `,
1403
- })
1404
- export class MyComponent {
1405
- tags = ['Angular', 'TypeScript', 'RxJS', 'NgRx'];
1406
-
1407
- removeTag(tag: string) {
1408
- this.tags = this.tags.filter((t) => t !== tag);
1409
- }
1410
-
1411
- getTagColor(tag: string): 'Primary' | 'Success' | 'Warning' {
1412
- // Custom logic to determine color
1413
- return 'Primary';
1414
- }
1415
- }
1416
- ```
1417
-
1418
- **With Custom Classes:**
1419
-
1420
- ```typescript
1421
- <bk-pill
1422
- [label]="'Custom Styled'"
1423
- [customClass]="'my-custom-class font-bold'">
1424
- </bk-pill>
1425
- ```
1426
-
1427
- #### Styling
1428
-
1429
- The pill component supports predefined size classes:
1430
-
1431
- - **Extra Small**: `xsm`
1432
- - **Small**: `sm`
1433
- - **Medium**: `md` - Default
1434
- - **Large**: `lg`
1435
-
1436
- The component includes built-in styles for:
1437
-
1438
- - All variant styles (Light, Solid, Outline, Transparent)
1439
- - All color schemes (Gray, Primary, Error, Warning, Success, Purple, Cyan)
1440
- - Dot indicators (left and right positions)
1441
- - Remove button styling
1442
- - Hover states
1443
- - Smooth transitions
1444
-
1445
- ## 🏷️ Badge
1446
-
1447
- A flexible badge component for displaying labels, tags, or status indicators. Perfect for categorizing content, showing status, or creating removable tag lists. Supports multiple visual variants, color schemes, sizes, and optional dot indicators.
1448
-
1449
- ### BadgeComponent
1450
-
1451
- A standalone badge component that displays text labels with customizable styling and optional removal functionality.
1452
-
1453
- #### Basic Example
1454
-
1455
- ```typescript
1456
- import { BkBadge } from '@brickclay/ui';
1457
-
1458
- @Component({
1459
- template: `
1460
- <bk-badge
1461
- [label]="'New'"
1462
- [variant]="'Solid'"
1463
- [color]="'Primary'"
1464
- [size]="'md'"
1465
- (clicked)="onBadgeRemoved($event)"
1466
- >
1467
- </bk-badge>
1468
- `,
1469
- imports: [BkBadge],
1470
- })
1471
- export class MyComponent {
1472
- onBadgeRemoved(label: string) {
1473
- console.log('Badge removed:', label);
1474
- }
1475
- }
1476
- ```
1477
-
1478
- #### Component Selector
1479
-
1480
- `<bk-badge>`
1481
-
1482
- #### Inputs
1483
-
1484
- | Input | Type | Default | Description |
1485
- | ------------ | --------------------------------------- | --------- | -------------------------------------------------------------------- |
1486
- | `label` | `string` | `''` | The text content displayed in the badge |
1487
- | `variant` | `'Light' \| 'Solid' \| 'Outline' \| 'Transparent'` | `'Light'` | Visual style variant |
1488
- | `color` | `'Gray' \| 'Primary' \| 'Error' \| 'Warning' \| 'Success' \| 'Purple' \| 'Cyan'` | `'Gray'` | Color scheme for the badge |
1489
- | `size` | `'xsm' \| 'sm' \| 'md' \| 'lg'` | `'md'` | Size variant of the badge |
1490
- | `dot` | `'left' \| 'right' \| 'none'` | `'none'` | Position of optional dot indicator (left, right, or none) |
1491
- | `removable` | `boolean` | `false` | Whether to show a remove button |
1492
- | `customClass`| `string` | `''` | Additional CSS classes for custom styling |
1493
-
1494
- #### Outputs
1495
-
1496
- | Output | Type | Description |
1497
- | -------- | ------------------------ | ----------------------------------------------------- |
1498
- | `clicked`| `EventEmitter<string>` | Emitted when the remove button is clicked (returns label) |
1499
-
1500
- #### Features
1501
-
1502
- - βœ… **Multiple Variants** - Light, Solid, Outline, and Transparent styles
1503
- - βœ… **Color Options** - Gray, Primary, Error, Warning, Success, Purple, and Cyan
1504
- - βœ… **Size Variants** - Extra Small (`xsm`), Small (`sm`), Medium (`md`), Large (`lg`)
1505
- - βœ… **Dot Indicators** - Optional dot indicator on left or right side
1506
- - βœ… **Removable** - Optional remove button with click event
1507
- - βœ… **Custom Styling** - Additional CSS classes for custom appearance
1508
- - βœ… **Event Handling** - `clicked` event for remove button interactions
1509
-
1510
- #### Usage Examples
1511
-
1512
- **Basic Badge:**
1513
-
1514
- ```typescript
1515
- import { BkBadge } from '@brickclay/ui';
1516
-
1517
- @Component({
1518
- template: `
1519
- <bk-badge [label]="'New'" [color]="'Success'"> </bk-badge>
1520
- `,
1521
- imports: [BkBadge],
1522
- })
1523
- export class MyComponent {}
1524
- ```
1525
-
1526
- **Different Variants:**
1527
-
1528
- ```typescript
1529
- <!-- Light variant -->
1530
- <bk-badge
1531
- [label]="'Light Badge'"
1532
- [variant]="'Light'"
1533
- [color]="'Primary'">
1534
- </bk-badge>
1535
-
1536
- <!-- Solid variant -->
1537
- <bk-badge
1538
- [label]="'Solid Badge'"
1539
- [variant]="'Solid'"
1540
- [color]="'Primary'">
1541
- </bk-badge>
1542
-
1543
- <!-- Outline variant -->
1544
- <bk-badge
1545
- [label]="'Outline Badge'"
1546
- [variant]="'Outline'"
1547
- [color]="'Primary'">
1548
- </bk-badge>
1549
-
1550
- <!-- Transparent variant -->
1551
- <bk-badge
1552
- [label]="'Transparent Badge'"
1553
- [variant]="'Transparent'"
1554
- [color]="'Primary'">
1555
- </bk-badge>
1556
- ```
1557
-
1558
- **Different Colors:**
1559
-
1560
- ```typescript
1561
- <bk-badge [label]="'Gray'" [color]="'Gray'"> </bk-badge>
1562
- <bk-badge [label]="'Primary'" [color]="'Primary'"> </bk-badge>
1563
- <bk-badge [label]="'Error'" [color]="'Error'"> </bk-badge>
1564
- <bk-badge [label]="'Warning'" [color]="'Warning'"> </bk-badge>
1565
- <bk-badge [label]="'Success'" [color]="'Success'"> </bk-badge>
1566
- <bk-badge [label]="'Purple'" [color]="'Purple'"> </bk-badge>
1567
- <bk-badge [label]="'Cyan'" [color]="'Cyan'"> </bk-badge>
1568
- ```
1569
-
1570
- **Different Sizes:**
1571
-
1572
- ```typescript
1573
- <!-- Extra Small -->
1574
- <bk-badge [label]="'XSM'" [size]="'xsm'"> </bk-badge>
1575
-
1576
- <!-- Small -->
1577
- <bk-badge [label]="'SM'" [size]="'sm'"> </bk-badge>
1578
-
1579
- <!-- Medium -->
1580
- <bk-badge [label]="'MD'" [size]="'md'"> </bk-badge>
1581
-
1582
- <!-- Large -->
1583
- <bk-badge [label]="'LG'" [size]="'lg'"> </bk-badge>
1584
- ```
1585
-
1586
- **With Dot Indicators:**
1587
-
1588
- ```typescript
1589
- <!-- Dot on left -->
1590
- <bk-badge
1591
- [label]="'Active'"
1592
- [dot]="'left'"
1593
- [color]="'Success'">
1594
- </bk-badge>
1595
-
1596
- <!-- Dot on right -->
1597
- <bk-badge
1598
- [label]="'Pending'"
1599
- [dot]="'right'"
1600
- [color]="'Warning'">
1601
- </bk-badge>
1602
- ```
1603
-
1604
- **Removable Badge:**
1605
-
1606
- ```typescript
1607
- @Component({
1608
- template: `
1609
- <bk-badge
1610
- [label]="'Removable Tag'"
1611
- [removable]="true"
1612
- (clicked)="onRemoveTag($event)">
1613
- </bk-badge>
1614
- `,
1615
- })
1616
- export class MyComponent {
1617
- onRemoveTag(label: string) {
1618
- console.log('Removed:', label);
1619
- // Remove from list, update state, etc.
1620
- }
1621
- }
1622
- ```
1623
-
1624
- **Dynamic Badge List:**
1625
-
1626
- ```typescript
1627
- @Component({
1628
- template: `
1629
- <div>
1630
- <bk-badge
1631
- *ngFor="let tag of tags"
1632
- [label]="tag"
1633
- [removable]="true"
1634
- [color]="getTagColor(tag)"
1635
- (clicked)="removeTag(tag)">
1636
- </bk-badge>
1637
- </div>
1638
- `,
1639
- })
1640
- export class MyComponent {
1641
- tags = ['Angular', 'TypeScript', 'RxJS', 'NgRx'];
1642
-
1643
- removeTag(tag: string) {
1644
- this.tags = this.tags.filter((t) => t !== tag);
1645
- }
1646
-
1647
- getTagColor(tag: string): 'Primary' | 'Success' | 'Warning' {
1648
- // Custom logic to determine color
1649
- return 'Primary';
1650
- }
1651
- }
1652
- ```
1653
-
1654
- **With Custom Classes:**
1655
-
1656
- ```typescript
1657
- <bk-badge
1658
- [label]="'Custom Styled'"
1659
- [customClass]="'my-custom-class font-bold'">
1660
- </bk-badge>
1661
- ```
1662
-
1663
- #### Styling
1664
-
1665
- The badge component supports predefined size classes:
1666
-
1667
- - **Extra Small**: `xsm`
1668
- - **Small**: `sm`
1669
- - **Medium**: `md` - Default
1670
- - **Large**: `lg`
1671
-
1672
- The component includes built-in styles for:
1673
-
1674
- - All variant styles (Light, Solid, Outline, Transparent)
1675
- - All color schemes (Gray, Primary, Error, Warning, Success, Purple, Cyan)
1676
- - Dot indicators (left and right positions)
1677
- - Remove button styling
1678
- - Hover states
1679
- - Smooth transitions
1680
-
1681
- ## πŸ“ TypeScript Interfaces
1682
-
1683
- ### CalendarRange
1684
-
1685
- ```typescript
1686
- interface CalendarRange {
1687
- start: Date;
1688
- end: Date;
1689
- }
1690
- ```
1691
-
1692
- ### CalendarSelection
1693
-
1694
- ```typescript
1695
- interface CalendarSelection {
1696
- startDate: Date | null;
1697
- endDate: Date | null;
1698
- selectedDates?: Date[]; // For multi-date selection
1699
- }
1700
- ```
1701
-
1702
- ### TimeConfiguration
1703
-
1704
- ```typescript
1705
- interface TimeConfiguration {
1706
- date: Date;
1707
- allDay: boolean;
1708
- startTime: string; // Format: "HH:mm" or "HH:mm:ss"
1709
- endTime: string;
1710
- }
1711
- ```
1712
-
1713
- ### ScheduledDateSelection
1714
-
1715
- ```typescript
1716
- interface ScheduledDateSelection {
1717
- mode: 'single' | 'multiple' | 'range';
1718
- singleDate?: {
1719
- startDate: Date;
1720
- endDate: Date;
1721
- allDay: boolean;
1722
- startTime: string;
1723
- endTime: string;
1724
- };
1725
- multipleDates?: TimeConfiguration[];
1726
- dateRange?: {
1727
- startDate: Date;
1728
- endDate: Date;
1729
- allDay: boolean;
1730
- startTime: string;
1731
- endTime: string;
1732
- };
1733
- }
1734
- ```
1735
-
1736
- ## 🎯 Common Use Cases
1737
-
1738
- ### Form Integration
1739
-
1740
- ```typescript
1741
- import { FormBuilder, FormGroup, Validators } from '@angular/forms';
1742
- import { BkCustomCalendar } from '@brickclay/ui';
1743
-
1744
- export class BookingFormComponent {
1745
- bookingForm: FormGroup;
1746
-
1747
- constructor(private fb: FormBuilder) {
1748
- this.bookingForm = this.fb.group({
1749
- checkIn: [null, Validators.required],
1750
- checkOut: [null, Validators.required],
1751
- });
1752
- }
1753
-
1754
- onDateSelected(selection: CalendarSelection) {
1755
- this.bookingForm.patchValue({
1756
- checkIn: selection.startDate,
1757
- checkOut: selection.endDate,
1758
- });
1759
- }
1760
- }
1761
- ```
1762
-
1763
- ### Reactive Forms
1764
-
1765
- ```typescript
1766
- <bk-custom-calendar
1767
- [selectedValue]="form.get('dateRange')?.value"
1768
- (selected)="form.patchValue({ dateRange: $event })">
1769
- </bk-custom-calendar>
1770
- ```
1771
-
1772
- ### Date Filtering
1773
-
1774
- ```typescript
1775
- export class DataTableComponent {
1776
- filterDates: CalendarSelection = { startDate: null, endDate: null };
1777
-
1778
- onDateFilter(selection: CalendarSelection) {
1779
- this.filterDates = selection;
1780
- this.loadFilteredData();
1781
- }
1782
-
1783
- loadFilteredData() {
1784
- const filtered = this.data.filter((item) => {
1785
- if (!this.filterDates.startDate || !this.filterDates.endDate) {
1786
- return true;
1787
- }
1788
- return item.date >= this.filterDates.startDate! && item.date <= this.filterDates.endDate!;
1789
- });
1790
- }
1791
- }
1792
- ```
1793
-
1794
- ## πŸ“¦ Assets Configuration
1795
-
1796
- The calendar components require SVG icons. Configure your `angular.json` to copy assets:
1797
-
1798
- ```json
1799
- {
1800
- "glob": "**/*",
1801
- "input": "node_modules/@brickclay/ui/assets",
1802
- "output": "assets"
1803
- }
1804
- ```
1805
-
1806
- Or manually copy assets from:
1807
-
1808
- ```
1809
- node_modules/@brickclay/ui/assets/calender/* β†’ your-app/public/assets/calender/
1810
- ```
1811
-
1812
- ## πŸ”§ Service
1813
-
1814
- ### CalendarManagerService
1815
-
1816
- A service that manages multiple calendar instances, ensuring only one calendar is open at a time when not in inline mode. Used internally by `BkCustomCalendar`.
1817
-
1818
- ## 🌐 Browser Support
1819
-
1820
- - Chrome (latest)
1821
- - Firefox (latest)
1822
- - Safari (latest)
1823
- - Edge (latest)
1824
-
1825
- ## πŸ“¦ Dependencies
1826
-
1827
- - Angular 20.3.0+
1828
- - moment (for date formatting)
1829
-
1830
- ## 🀝 Contributing
1831
-
1832
- We welcome contributions! Please see our contributing guidelines for more information.
1833
-
1834
- ## πŸ“„ License
1835
-
1836
- MIT
1837
-
1838
- ## πŸ“ž Support
1839
-
1840
- For issues, feature requests, or contributions, please visit our [GitHub repository](https://github.com/brickclay/ui).
1841
-
1842
- ## πŸ—ΊοΈ Roadmap
1843
-
1844
- - [ ] Button components
1845
- - [ ] Input components
1846
- - [ ] Card components
1847
- - [ ] Modal/Dialog components
1848
- - [ ] Table components
1849
- - [ ] Form components
1850
- - [ ] Navigation components
1851
- - [ ] Loading/Spinner components
1852
- - [ ] Toast/Notification components
1853
- - [ ] More calendar features
1854
-
1855
- ## πŸ“ Changelog
1856
-
1857
- ### Version 0.0.1
1858
-
1859
- **Initial Release:**
1860
-
1861
- - βœ… Calendar component suite
1862
- - Single date selection
1863
- - Date range selection
1864
- - Multiple date selection
1865
- - Time picker integration
1866
- - Inline and dropdown modes
1867
- - Dual calendar view
1868
- - Custom date ranges
1869
- - Date constraints (min/max)
1870
- - βœ… Scheduled date picker component
1871
- - βœ… Standalone time picker component
1872
- - βœ… Toggle/Switch component
1873
- - Angular forms integration (ngModel & reactive forms)
1874
- - Three size variants (small, medium, large)
1875
- - Disabled state support
1876
- - Full accessibility features
1877
- - Customizable styling
1878
- - βœ… Checkbox component
1879
- - Angular forms integration (ngModel & reactive forms)
1880
- - Customizable styling via CSS classes
1881
- - Disabled state support
1882
- - Full keyboard navigation support
1883
- - Complete accessibility features
1884
- - βœ… Radio button component
1885
- - Angular forms integration (ngModel & reactive forms)
1886
- - Two visual variants (dot and tick)
1887
- - Radio group support
1888
- - Customizable styling via CSS classes
1889
- - Disabled state support
1890
- - Full keyboard navigation support
1891
- - Complete accessibility features
1892
- - βœ… Pill component
1893
- - Multiple visual variants (Light, Solid, Outline, Transparent)
1894
- - Seven color options (Gray, Primary, Error, Warning, Success, Purple, Cyan)
1895
- - Four size variants (xsm, sm, md, lg)
1896
- - Optional dot indicators (left, right, none)
1897
- - Removable functionality with click events
1898
- - Custom CSS class support
1899
- - βœ… Badge component
1900
- - Multiple visual variants (Light, Solid, Outline, Transparent)
1901
- - Seven color options (Gray, Primary, Error, Warning, Success, Purple, Cyan)
1902
- - Four size variants (xsm, sm, md, lg)
1903
- - Optional dot indicators (left, right, none)
1904
- - Removable functionality with click events
1905
- - Custom CSS class support
1906
- - βœ… TypeScript definitions
1907
- - βœ… Comprehensive documentation
1908
-
1909
- ---
1910
-
1911
- **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
+ ### Checkbox Component
26
+
27
+ A fully accessible checkbox component with Angular forms integration. Features customizable styling via CSS classes, disabled state, keyboard navigation, and seamless integration with both template-driven and reactive forms.
28
+
29
+ ### Radio Component
30
+
31
+ A fully accessible radio button component with Angular forms integration. Features two visual variants (dot and tick), customizable styling, disabled state, keyboard navigation, and seamless integration with both template-driven and reactive forms.
32
+
33
+ ### Pill Component
34
+
35
+ A versatile pill component for displaying labels, tags, or status indicators. Features multiple variants (Light, Solid, Outline, Transparent), color options, size variants, optional dot indicators, and removable functionality with click events.
36
+
37
+ ### Badge Component
38
+
39
+ A flexible badge component for displaying labels, tags, or status indicators. Features multiple variants (Light, Solid, Outline, Transparent), color options, size variants, optional dot indicators, and removable functionality with click events.
40
+
41
+ ### Button Component
42
+
43
+ A versatile button component with support for text labels, icons, loading states, and multiple variants. Features seven size options, two variants (primary/secondary), optional left/right icons, loading spinner, and full customization support.
44
+
45
+ ### Icon Button Component
46
+
47
+ A compact icon-only button component perfect for toolbars and action buttons. Features seven size options, two variants (primary/secondary), and customizable styling.
48
+
49
+ ### Button Group Component
50
+
51
+ A button group component for creating toggleable button sets. Supports single and multiple selection modes, with automatic state management and value change events.
52
+
53
+ ### Spinner Component
54
+
55
+ A loading spinner component for indicating asynchronous operations. Features five size variants, customizable colors, and show/hide control.
56
+
57
+ _More components coming soon..._
58
+
59
+ ## Installation
60
+
61
+ ```bash
62
+ npm i @brickclay-org/ui@0.0.26
63
+ ```
64
+
65
+ ### Peer Dependencies
66
+
67
+ This library requires Angular 20.3.0 or higher:
68
+
69
+ ```bash
70
+ npm install @angular/common@^20.3.0 @angular/core@^20.3.0 moment
71
+ ```
72
+
73
+ ### Asset Configuration (Required)
74
+
75
+ After installing the library, you need to configure your `angular.json` to include the library's assets (icons, etc.). Add the following to your project's `assets` array in the `build` options:
76
+
77
+ ```json
78
+ {
79
+ "projects": {
80
+ "your-app-name": {
81
+ "architect": {
82
+ "build": {
83
+ "options": {
84
+ "assets": [
85
+ "src/favicon.ico",
86
+ "src/assets",
87
+ {
88
+ "glob": "**/*",
89
+ "input": "node_modules/@brickclay-org/ui/assets",
90
+ "output": "/assets/brickclay-lib/"
91
+ }
92
+ ]
93
+ }
94
+ }
95
+ }
96
+ }
97
+ }
98
+ }
99
+ ```
100
+
101
+ This configuration copies the library's assets (SVG icons, etc.) to your application's output folder during build. Without this, the component icons will not display correctly.
102
+
103
+ ## Quick Start
104
+
105
+ ### Standalone Component Usage (Recommended)
106
+
107
+ ```typescript
108
+ import { Component } from '@angular/core';
109
+ import { BkCustomCalendar, CalendarSelection } from '@brickclay/ui';
110
+
111
+ @Component({
112
+ standalone: true,
113
+ selector: 'app-my-component',
114
+ imports: [BkCustomCalendar],
115
+ template: `
116
+ <bk-custom-calendar (selected)="onDateSelected($event)"> </bk-custom-calendar>
117
+ `,
118
+ })
119
+ export class MyComponent {
120
+ onDateSelected(selection: CalendarSelection) {
121
+ console.log('Selected:', selection);
122
+ }
123
+ }
124
+ ```
125
+
126
+ ### Module-based Usage
127
+
128
+ ```typescript
129
+ import { NgModule } from '@angular/core';
130
+ import { CalendarModule } from '@brickclay/ui';
131
+
132
+ @NgModule({
133
+ imports: [CalendarModule],
134
+ // ...
135
+ })
136
+ export class AppModule {}
137
+ ```
138
+
139
+ ## πŸ“… Calendar
140
+
141
+ 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`.
142
+
143
+ ### Components Overview
144
+
145
+ 1. **BkCustomCalendar** (`brickclay-custom-calendar`) - Main calendar component with support for single date, date range, and multiple date selection
146
+ 2. **BkScheduledDatePicker** (`brickclay-scheduled-date-picker`) - Advanced scheduling component with time configuration for events
147
+ 3. **BkTimePicker** (`brickclay-time-picker`) - Standalone time selection component with scrollable pickers
148
+
149
+ ### BkCustomCalendar
150
+
151
+ A versatile calendar component that supports single date, date range, and multiple date selection modes.
152
+
153
+ #### Basic Example
154
+
155
+ ```typescript
156
+ import { BkCustomCalendar, CalendarSelection } from '@brickclay/ui';
157
+
158
+ @Component({
159
+ template: `
160
+ <bk-custom-calendar
161
+ [singleDatePicker]="false"
162
+ [dualCalendar]="true"
163
+ [enableTimepicker]="true"
164
+ [showRanges]="true"
165
+ [placeholder]="'Select date range'"
166
+ (selected)="onDateSelected($event)"
167
+ >
168
+ </bk-custom-calendar>
169
+ `,
170
+ })
171
+ export class MyComponent {
172
+ onDateSelected(selection: CalendarSelection) {
173
+ console.log('Start:', selection.startDate);
174
+ console.log('End:', selection.endDate);
175
+ }
176
+ }
177
+ ```
178
+
179
+ #### Component Selector
180
+
181
+ `<bk-custom-calendar>`
182
+
183
+ #### Inputs
184
+
185
+ | Input | Type | Default | Description |
186
+ | -------------------- | ------------------------------- | --------------------- | ------------------------------------------------- |
187
+ | `enableTimepicker` | `boolean` | `false` | Enable time selection |
188
+ | `autoApply` | `boolean` | `false` | Automatically apply selection when date is chosen |
189
+ | `closeOnAutoApply` | `boolean` | `false` | Close calendar after auto-apply |
190
+ | `showCancel` | `boolean` | `true` | Show cancel button in footer |
191
+ | `singleDatePicker` | `boolean` | `false` | Enable single date selection mode |
192
+ | `dualCalendar` | `boolean` | `false` | Show two calendars side-by-side |
193
+ | `showRanges` | `boolean` | `true` | Show predefined date range buttons |
194
+ | `multiDateSelection` | `boolean` | `false` | Enable multiple date selection |
195
+ | `inline` | `boolean` | `false` | Always show calendar (no dropdown) |
196
+ | `minDate` | `Date` | `undefined` | Minimum selectable date |
197
+ | `maxDate` | `Date` | `undefined` | Maximum selectable date |
198
+ | `placeholder` | `string` | `'Select date range'` | Input placeholder text |
199
+ | `opens` | `'left' \| 'right' \| 'center'` | `'left'` | Dropdown alignment |
200
+ | `drop` | `'up' \| 'down'` | `'down'` | Dropdown direction |
201
+ | `displayFormat` | `string` | `'MM/DD/YYYY'` | Date display format (moment format) |
202
+ | `customRanges` | `Record<string, CalendarRange>` | `undefined` | Custom predefined ranges |
203
+ | `selectedValue` | `CalendarSelection \| null` | `null` | Pre-selected date(s) |
204
+ | `isDisplayCrossIcon` | `boolean` | `true` | Show/hide clear button |
205
+
206
+ #### Outputs
207
+
208
+ | Output | Type | Description |
209
+ | ---------- | --------------------------------- | ----------------------------------- |
210
+ | `selected` | `EventEmitter<CalendarSelection>` | Emitted when date selection changes |
211
+ | `opened` | `EventEmitter<void>` | Emitted when calendar opens |
212
+ | `closed` | `EventEmitter<void>` | Emitted when calendar closes |
213
+
214
+ #### Usage Examples
215
+
216
+ **Single Date Selection:**
217
+
218
+ ```typescript
219
+ <bk-custom-calendar
220
+ [singleDatePicker]="true"
221
+ [placeholder]="'Select a date'"
222
+ (selected)="onDateSelected($event)">
223
+ </bk-custom-calendar>
224
+ ```
225
+
226
+ **Date Range with Time Picker:**
227
+
228
+ ```typescript
229
+ <bk-custom-calendar
230
+ [dualCalendar]="true"
231
+ [enableTimepicker]="true"
232
+ [enableSeconds]="true"
233
+ (selected)="onRangeSelected($event)">
234
+ </bk-custom-calendar>
235
+ ```
236
+
237
+ **Multiple Date Selection:**
238
+
239
+ ```typescript
240
+ <bk-custom-calendar
241
+ [multiDateSelection]="true"
242
+ [inline]="true"
243
+ (selected)="onMultipleDatesSelected($event)">
244
+ </bk-custom-calendar>
245
+ ```
246
+
247
+ **Inline Calendar:**
248
+
249
+ ```typescript
250
+ <bk-custom-calendar
251
+ [inline]="true"
252
+ [dualCalendar]="false"
253
+ [showRanges]="false"
254
+ (selected)="onDateSelected($event)">
255
+ </bk-custom-calendar>
256
+ ```
257
+
258
+ **Custom Date Ranges:**
259
+
260
+ ```typescript
261
+ import { CalendarRange } from '@brickclay/ui';
262
+
263
+ const customRanges: Record<string, CalendarRange> = {
264
+ 'Last Week': {
265
+ start: new Date(2024, 0, 1),
266
+ end: new Date(2024, 0, 7)
267
+ },
268
+ 'This Quarter': {
269
+ start: new Date(2024, 0, 1),
270
+ end: new Date(2024, 2, 31)
271
+ }
272
+ };
273
+
274
+ <bk-custom-calendar
275
+ [customRanges]="customRanges"
276
+ [showRanges]="true"
277
+ (selected)="onDateSelected($event)">
278
+ </bk-custom-calendar>
279
+ ```
280
+
281
+ **Date Constraints:**
282
+
283
+ ```typescript
284
+ <bk-custom-calendar
285
+ [minDate]="new Date(2024, 0, 1)"
286
+ [maxDate]="new Date(2024, 11, 31)"
287
+ (selected)="onDateSelected($event)">
288
+ </bk-custom-calendar>
289
+ ```
290
+
291
+ **Pre-selected Values:**
292
+
293
+ ```typescript
294
+ export class MyComponent {
295
+ selectedValue: CalendarSelection = {
296
+ startDate: new Date(2024, 5, 15),
297
+ endDate: new Date(2024, 5, 20)
298
+ };
299
+
300
+ onDateChange() {
301
+ this.selectedValue = {
302
+ startDate: new Date(),
303
+ endDate: new Date()
304
+ };
305
+ }
306
+ }
307
+
308
+ <bk-custom-calendar
309
+ [selectedValue]="selectedValue"
310
+ (selected)="onDateSelected($event)">
311
+ </bk-custom-calendar>
312
+ ```
313
+
314
+ ### BkScheduledDatePicker
315
+
316
+ A comprehensive date and time scheduling component with three modes: single date, multiple dates, and date range, each with time configuration.
317
+
318
+ #### Basic Example
319
+
320
+ ```typescript
321
+ import { BkScheduledDatePicker, ScheduledDateSelection } from '@brickclay/ui';
322
+
323
+ @Component({
324
+ template: `
325
+ <bk-scheduled-date-picker [timeFormat]="12" (scheduled)="onScheduled($event)">
326
+ </bk-scheduled-date-picker>
327
+ `,
328
+ })
329
+ export class MyComponent {
330
+ onScheduled(selection: ScheduledDateSelection) {
331
+ console.log('Mode:', selection.mode);
332
+ if (selection.mode === 'single' && selection.singleDate) {
333
+ console.log('Start:', selection.singleDate.startDate);
334
+ console.log('End:', selection.singleDate.endDate);
335
+ console.log('All Day:', selection.singleDate.allDay);
336
+ }
337
+ }
338
+ }
339
+ ```
340
+
341
+ #### Component Selector
342
+
343
+ `<bk-scheduled-date-picker>`
344
+
345
+ #### Inputs
346
+
347
+ | Input | Type | Default | Description |
348
+ | --------------- | ---------- | ------- | -------------------------------- |
349
+ | `timeFormat` | `12 \| 24` | `12` | Time format (12-hour or 24-hour) |
350
+ | `enableSeconds` | `boolean` | `false` | Enable seconds in time picker |
351
+
352
+ #### Outputs
353
+
354
+ | Output | Type | Description |
355
+ | ----------- | -------------------------------------- | ------------------------------------ |
356
+ | `scheduled` | `EventEmitter<ScheduledDateSelection>` | Emitted when selection changes |
357
+ | `cleared` | `EventEmitter<void>` | Emitted when clear button is clicked |
358
+
359
+ #### Features
360
+
361
+ - **Single Date Mode**: Select one date with optional start and end times
362
+ - **Multiple Dates Mode**: Select multiple dates, each with individual time configuration
363
+ - **Date Range Mode**: Select a date range with start and end times
364
+ - **All Day Toggle**: Mark dates as all-day events
365
+ - **Time Configuration**: Individual time pickers for each date/range
366
+
367
+ ### BkTimePicker
368
+
369
+ A standalone time picker component with scrollable hour, minute, and AM/PM selectors.
370
+
371
+ #### Basic Example
372
+
373
+ ```typescript
374
+ import { BkTimePicker } from '@brickclay/ui';
375
+
376
+ @Component({
377
+ template: `
378
+ <bk-time-picker
379
+ [value]="selectedTime"
380
+ [label]="'Start Time'"
381
+ [timeFormat]="12"
382
+ (timeChange)="onTimeChange($event)"
383
+ >
384
+ </bk-time-picker>
385
+ `,
386
+ })
387
+ export class MyComponent {
388
+ selectedTime = '1:00 AM';
389
+
390
+ onTimeChange(time: string) {
391
+ this.selectedTime = time;
392
+ console.log('New time:', time);
393
+ }
394
+ }
395
+ ```
396
+
397
+ #### Component Selector
398
+
399
+ `<bk-time-picker>`
400
+
401
+ #### Inputs
402
+
403
+ | Input | Type | Default | Description |
404
+ | ------------- | ------------------- | --------------- | ---------------------------------------------------- |
405
+ | `value` | `string` | `'1:00 AM'` | Current time value (format: "H:MM AM/PM" or "HH:MM") |
406
+ | `label` | `string` | `'Time'` | Label text |
407
+ | `placeholder` | `string` | `'Select time'` | Placeholder text |
408
+ | `position` | `'left' \| 'right'` | `'left'` | Dropdown position |
409
+ | `pickerId` | `string` | `''` | Unique identifier for the picker |
410
+ | `closePicker` | `number` | `0` | Counter to trigger picker close |
411
+ | `timeFormat` | `12 \| 24` | `12` | Time format (12-hour or 24-hour) |
412
+ | `showSeconds` | `boolean` | `false` | Show seconds selector |
413
+
414
+ #### Outputs
415
+
416
+ | Output | Type | Description |
417
+ | -------------- | ---------------------- | -------------------------- |
418
+ | `timeChange` | `EventEmitter<string>` | Emitted when time changes |
419
+ | `pickerOpened` | `EventEmitter<string>` | Emitted when picker opens |
420
+ | `pickerClosed` | `EventEmitter<string>` | Emitted when picker closes |
421
+
422
+ #### Features
423
+
424
+ - Scrollable time selectors
425
+ - Keyboard navigation support
426
+ - 12-hour and 24-hour formats
427
+ - Optional seconds support
428
+ - Multiple picker coordination (only one open at a time)
429
+ - Click outside to close
430
+
431
+ #### Time Format Examples
432
+
433
+ **12-hour format:**
434
+
435
+ ```typescript
436
+ value = '1:00 AM';
437
+ value = '12:30 PM';
438
+ value = '11:45 PM';
439
+ ```
440
+
441
+ **24-hour format:**
442
+
443
+ ```typescript
444
+ value = '01:00';
445
+ value = '13:30';
446
+ value = '23:45';
447
+ ```
448
+
449
+ ## πŸ”˜ Toggle
450
+
451
+ 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.
452
+
453
+ ### BkToggle
454
+
455
+ A standalone toggle component that implements `ControlValueAccessor` for seamless Angular forms integration.
456
+
457
+ #### Basic Example
458
+
459
+ ```typescript
460
+ import { BkToggle } from '@brickclay/ui';
461
+ import { FormsModule } from '@angular/forms';
462
+
463
+ @Component({
464
+ template: `
465
+ <bk-toggle
466
+ [(ngModel)]="isEnabled"
467
+ [label]="'Enable notifications'"
468
+ (change)="onToggleChange($event)"
469
+ >
470
+ </bk-toggle>
471
+ `,
472
+ imports: [BkToggle, FormsModule],
473
+ })
474
+ export class MyComponent {
475
+ isEnabled = false;
476
+
477
+ onToggleChange(value: boolean) {
478
+ console.log('Toggle state:', value);
479
+ }
480
+ }
481
+ ```
482
+
483
+ #### Component Selector
484
+
485
+ `<bk-toggle>`
486
+
487
+ #### Inputs
488
+
489
+ | Input | Type | Default | Description |
490
+ | ------------- | --------- | ------------- | -------------------------------------------------------------------------------- |
491
+ | `label` | `string` | `''` | Optional label text displayed next to the toggle |
492
+ | `disabled` | `boolean` | `false` | Disables the toggle interaction |
493
+ | `toggleClass` | `string` | `'toggle-md'` | CSS class for size styling. Options: `'toggle-sm'`, `'toggle-md'`, `'toggle-lg'` |
494
+
495
+ #### Outputs
496
+
497
+ | Output | Type | Description |
498
+ | -------- | ----------------------- | ------------------------------------------------------------- |
499
+ | `change` | `EventEmitter<boolean>` | Emitted when toggle state changes (returns new boolean value) |
500
+
501
+ #### Features
502
+
503
+ - βœ… **Angular Forms Integration** - Full support for `ngModel` and reactive forms
504
+ - βœ… **Three Size Variants** - Small (`toggle-sm`), Medium (`toggle-md`), Large (`toggle-lg`)
505
+ - βœ… **Accessibility** - ARIA attributes, keyboard navigation, and screen reader support
506
+ - βœ… **Disabled State** - Visual and functional disabled state
507
+ - βœ… **Customizable Styling** - Custom CSS classes for size and appearance
508
+ - βœ… **Event Handling** - `change` event for state change notifications
509
+
510
+ #### Usage Examples
511
+
512
+ **Basic Toggle with ngModel:**
513
+
514
+ ```typescript
515
+ import { BkToggle } from '@brickclay/ui';
516
+ import { FormsModule } from '@angular/forms';
517
+
518
+ @Component({
519
+ template: `
520
+ <bk-toggle [(ngModel)]="isActive" [label]="'Active Status'"> </bk-toggle>
521
+ `,
522
+ imports: [BkToggle, FormsModule],
523
+ })
524
+ export class MyComponent {
525
+ isActive = true;
526
+ }
527
+ ```
528
+
529
+ **Different Sizes:**
530
+
531
+ ```typescript
532
+ <bk-toggle
533
+ [(ngModel)]="value1"
534
+ [toggleClass]="'toggle-sm'"
535
+ [label]="'Small Toggle'">
536
+ </bk-toggle>
537
+
538
+ <bk-toggle
539
+ [(ngModel)]="value2"
540
+ [toggleClass]="'toggle-md'"
541
+ [label]="'Medium Toggle'">
542
+ </bk-toggle>
543
+
544
+ <bk-toggle
545
+ [(ngModel)]="value3"
546
+ [toggleClass]="'toggle-lg'"
547
+ [label]="'Large Toggle'">
548
+ </bk-toggle>
549
+ ```
550
+
551
+ **Disabled State:**
552
+
553
+ ```typescript
554
+ <bk-toggle
555
+ [ngModel]="true"
556
+ [disabled]="true"
557
+ [label]="'Disabled Toggle'">
558
+ </bk-toggle>
559
+ ```
560
+
561
+ **With Event Handler:**
562
+
563
+ ```typescript
564
+ @Component({
565
+ template: `
566
+ <bk-toggle
567
+ [(ngModel)]="notificationsEnabled"
568
+ [label]="'Email Notifications'"
569
+ (change)="onNotificationToggle($event)"
570
+ >
571
+ </bk-toggle>
572
+ `,
573
+ })
574
+ export class MyComponent {
575
+ notificationsEnabled = false;
576
+
577
+ onNotificationToggle(enabled: boolean) {
578
+ if (enabled) {
579
+ this.enableNotifications();
580
+ } else {
581
+ this.disableNotifications();
582
+ }
583
+ }
584
+ }
585
+ ```
586
+
587
+ **Reactive Forms Integration:**
588
+
589
+ ```typescript
590
+ import { FormBuilder, FormGroup, ReactiveFormsModule } from '@angular/forms';
591
+ import { BkToggle } from '@brickclay/ui';
592
+
593
+ @Component({
594
+ template: `
595
+ <form [formGroup]="settingsForm">
596
+ <bk-toggle formControlName="darkMode" [label]="'Dark Mode'"> </bk-toggle>
597
+
598
+ <bk-toggle formControlName="notifications" [label]="'Push Notifications'">
599
+ </bk-toggle>
600
+ </form>
601
+ `,
602
+ imports: [BkToggle, ReactiveFormsModule],
603
+ })
604
+ export class SettingsComponent {
605
+ settingsForm: FormGroup;
606
+
607
+ constructor(private fb: FormBuilder) {
608
+ this.settingsForm = this.fb.group({
609
+ darkMode: [false],
610
+ notifications: [true],
611
+ });
612
+ }
613
+ }
614
+ ```
615
+
616
+ **Without Label:**
617
+
618
+ ```typescript
619
+ <bk-toggle
620
+ [(ngModel)]="isEnabled"
621
+ [toggleClass]="'toggle-md'">
622
+ </bk-toggle>
623
+ ```
624
+
625
+ #### Styling
626
+
627
+ The toggle component uses CSS classes for size variants:
628
+
629
+ - **Small**: `toggle-sm` - Width: 28px (w-7)
630
+ - **Medium**: `toggle-md` - Width: 36px (w-9) - Default
631
+ - **Large**: `toggle-lg` - Width: 44px (w-11)
632
+
633
+ The component includes built-in styles for:
634
+
635
+ - On state (green background: `#22973F`)
636
+ - Off state (gray background: `#BBBDC5`)
637
+ - Disabled state (light gray: `#D6D7DC`)
638
+ - Hover states
639
+ - Focus ring for accessibility
640
+ - Smooth transitions
641
+
642
+ #### Accessibility
643
+
644
+ The toggle component includes:
645
+
646
+ - `role="switch"` for screen readers
647
+ - `aria-checked` attribute that reflects the current state
648
+ - Keyboard navigation support
649
+ - Focus visible ring for keyboard users
650
+ - Disabled state properly communicated to assistive technologies
651
+
652
+ ## β˜‘οΈ Checkbox
653
+
654
+ A fully accessible checkbox component that integrates seamlessly with Angular forms. Supports both template-driven forms (`ngModel`) and reactive forms, with customizable styling and comprehensive accessibility features.
655
+
656
+ ### BkCheckbox
657
+
658
+ A standalone checkbox component that implements `ControlValueAccessor` for seamless Angular forms integration.
659
+
660
+ #### Basic Example
661
+
662
+ ```typescript
663
+ import { BkCheckbox } from '@brickclay/ui';
664
+ import { FormsModule } from '@angular/forms';
665
+
666
+ @Component({
667
+ template: `
668
+ <bk-checkbox
669
+ [(ngModel)]="isAccepted"
670
+ [label]="'I agree to the terms and conditions'"
671
+ (change)="onCheckboxChange($event)"
672
+ >
673
+ </bk-checkbox>
674
+ `,
675
+ imports: [BkCheckbox, FormsModule],
676
+ })
677
+ export class MyComponent {
678
+ isAccepted = false;
679
+
680
+ onCheckboxChange(value: boolean) {
681
+ console.log('Checkbox state:', value);
682
+ }
683
+ }
684
+ ```
685
+
686
+ #### Component Selector
687
+
688
+ `<bk-checkbox>`
689
+
690
+ #### Inputs
691
+
692
+ | Input | Type | Default | Description |
693
+ | --------------- | --------- | ------- | -------------------------------------------------------------------- |
694
+ | `label` | `string` | `''` | Optional label text displayed next to the checkbox |
695
+ | `disabled` | `boolean` | `false` | Disables the checkbox interaction |
696
+ | `checkboxClass` | `string` | `''` | CSS class for size styling. Options: `'xsm'`, `'sm'`, `'md'`, `'lg'` |
697
+ | `labelClass` | `string` | `''` | Custom CSS classes for the label text |
698
+
699
+ #### Outputs
700
+
701
+ | Output | Type | Description |
702
+ | -------- | ----------------------- | --------------------------------------------------------------- |
703
+ | `change` | `EventEmitter<boolean>` | Emitted when checkbox state changes (returns new boolean value) |
704
+
705
+ #### Features
706
+
707
+ - βœ… **Angular Forms Integration** - Full support for `ngModel` and reactive forms
708
+ - βœ… **Four Size Variants** - Extra Small (`xsm`), Small (`sm`), Medium (`md`), Large (`lg`)
709
+ - βœ… **Accessibility** - ARIA attributes, keyboard navigation (Enter/Space), and screen reader support
710
+ - βœ… **Disabled State** - Visual and functional disabled state
711
+ - βœ… **Keyboard Support** - Full keyboard navigation with Enter and Space keys
712
+ - βœ… **Focus Management** - Focus visible ring for keyboard users
713
+ - βœ… **Event Handling** - `change` event for state change notifications
714
+
715
+ #### Usage Examples
716
+
717
+ **Basic Checkbox with ngModel:**
718
+
719
+ ```typescript
720
+ import { BkCheckbox } from '@brickclay/ui';
721
+ import { FormsModule } from '@angular/forms';
722
+
723
+ @Component({
724
+ template: `
725
+ <bk-checkbox [(ngModel)]="isChecked" [label]="'Accept terms'"> </bk-checkbox>
726
+ `,
727
+ imports: [BkCheckbox, FormsModule],
728
+ })
729
+ export class MyComponent {
730
+ isChecked = false;
731
+ }
732
+ ```
733
+
734
+ **Different Sizes:**
735
+
736
+ ```typescript
737
+ <!-- Extra Small checkbox -->
738
+ <bk-checkbox
739
+ [(ngModel)]="value1"
740
+ [checkboxClass]="'xsm'"
741
+ [label]="'Extra Small Checkbox'">
742
+ </bk-checkbox>
743
+
744
+ <!-- Small checkbox -->
745
+ <bk-checkbox
746
+ [(ngModel)]="value2"
747
+ [checkboxClass]="'sm'"
748
+ [label]="'Small Checkbox'">
749
+ </bk-checkbox>
750
+
751
+ <!-- Medium checkbox -->
752
+ <bk-checkbox
753
+ [(ngModel)]="value3"
754
+ [checkboxClass]="'md'"
755
+ [label]="'Medium Checkbox'">
756
+ </bk-checkbox>
757
+
758
+ <!-- Large checkbox with custom label styling -->
759
+ <bk-checkbox
760
+ [(ngModel)]="value4"
761
+ [checkboxClass]="'lg'"
762
+ [labelClass]="'text-lg font-bold'"
763
+ [label]="'Large Checkbox'">
764
+ </bk-checkbox>
765
+ ```
766
+
767
+ **Disabled State:**
768
+
769
+ ```typescript
770
+ <bk-checkbox
771
+ [ngModel]="true"
772
+ [disabled]="true"
773
+ [label]="'Disabled Checkbox'">
774
+ </bk-checkbox>
775
+ ```
776
+
777
+ **With Event Handler:**
778
+
779
+ ```typescript
780
+ @Component({
781
+ template: `
782
+ <bk-checkbox
783
+ [(ngModel)]="newsletterSubscribed"
784
+ [label]="'Subscribe to newsletter'"
785
+ (change)="onNewsletterToggle($event)"
786
+ >
787
+ </bk-checkbox>
788
+ `,
789
+ })
790
+ export class MyComponent {
791
+ newsletterSubscribed = false;
792
+
793
+ onNewsletterToggle(subscribed: boolean) {
794
+ if (subscribed) {
795
+ this.subscribeToNewsletter();
796
+ } else {
797
+ this.unsubscribeFromNewsletter();
798
+ }
799
+ }
800
+ }
801
+ ```
802
+
803
+ **Reactive Forms Integration:**
804
+
805
+ ```typescript
806
+ import { FormBuilder, FormGroup, ReactiveFormsModule } from '@angular/forms';
807
+ import { BkCheckbox } from '@brickclay/ui';
808
+
809
+ @Component({
810
+ template: `
811
+ <form [formGroup]="registrationForm">
812
+ <bk-checkbox
813
+ formControlName="acceptTerms"
814
+ [label]="'I accept the terms and conditions'"
815
+ >
816
+ </bk-checkbox>
817
+
818
+ <bk-checkbox formControlName="receiveUpdates" [label]="'Receive product updates'">
819
+ </bk-checkbox>
820
+ </form>
821
+ `,
822
+ imports: [BkCheckbox, ReactiveFormsModule],
823
+ })
824
+ export class RegistrationComponent {
825
+ registrationForm: FormGroup;
826
+
827
+ constructor(private fb: FormBuilder) {
828
+ this.registrationForm = this.fb.group({
829
+ acceptTerms: [false, Validators.requiredTrue],
830
+ receiveUpdates: [false],
831
+ });
832
+ }
833
+ }
834
+ ```
835
+
836
+ **Without Label:**
837
+
838
+ ```typescript
839
+ <bk-checkbox
840
+ [(ngModel)]="isSelected"
841
+ [checkboxClass]="'md'">
842
+ </bk-checkbox>
843
+ ```
844
+
845
+ **Multiple Checkboxes:**
846
+
847
+ ```typescript
848
+ @Component({
849
+ template: `
850
+ <div>
851
+ <bk-checkbox
852
+ *ngFor="let option of options"
853
+ [(ngModel)]="option.selected"
854
+ [label]="option.label"
855
+ (change)="onOptionChange(option)"
856
+ >
857
+ </bk-checkbox>
858
+ </div>
859
+ `,
860
+ })
861
+ export class MyComponent {
862
+ options = [
863
+ { label: 'Option 1', selected: false },
864
+ { label: 'Option 2', selected: false },
865
+ { label: 'Option 3', selected: false },
866
+ ];
867
+
868
+ onOptionChange(option: any) {
869
+ console.log(`${option.label} is now ${option.selected ? 'selected' : 'deselected'}`);
870
+ }
871
+ }
872
+ ```
873
+
874
+ #### Styling
875
+
876
+ The checkbox component supports predefined size classes:
877
+
878
+ - **Extra Small**: `xsm` - 14px Γ— 14px
879
+ - **Small**: `sm` - 16px Γ— 16px
880
+ - **Medium**: `md` - 18px Γ— 18px
881
+ - **Large**: `lg` - 20px Γ— 20px
882
+
883
+ Use `labelClass` to style the label text (font size, weight, color, etc.)
884
+
885
+ The component includes built-in styles for:
886
+
887
+ - Checked state (black background with white checkmark/tick icon)
888
+ - Unchecked state (white background with gray border)
889
+ - Hover states (darker border on hover)
890
+ - Disabled states (gray background and border)
891
+ - Focus ring for accessibility (blue ring with offset)
892
+ - Smooth transitions for state changes
893
+
894
+ #### Accessibility
895
+
896
+ The checkbox component includes:
897
+
898
+ - Keyboard navigation support (Enter and Space keys)
899
+ - Focus visible ring for keyboard users
900
+ - Proper ARIA attributes
901
+ - Disabled state properly communicated to assistive technologies
902
+ - Tab navigation support
903
+
904
+ ## πŸ”˜ Radio Button
905
+
906
+ A fully accessible radio button component that integrates seamlessly with Angular forms. Supports both template-driven forms (`ngModel`) and reactive forms, with two visual variants (dot and tick) and comprehensive accessibility features.
907
+
908
+ ### BkRadioButton
909
+
910
+ A standalone radio button component that implements `ControlValueAccessor` for seamless Angular forms integration. Radio buttons are used when only one option can be selected from a group.
911
+
912
+ #### Basic Example
913
+
914
+ ```typescript
915
+ import { BkRadioButton } from '@brickclay/ui';
916
+ import { FormsModule } from '@angular/forms';
917
+
918
+ @Component({
919
+ template: `
920
+ <bk-radio-button
921
+ [(ngModel)]="selectedOption"
922
+ [value]="'option1'"
923
+ [label]="'Option 1'"
924
+ (change)="onRadioChange($event)"
925
+ >
926
+ </bk-radio-button>
927
+
928
+ <bk-radio-button [(ngModel)]="selectedOption" [value]="'option2'" [label]="'Option 2'">
929
+ </bk-radio-button>
930
+ `,
931
+ imports: [BkRadioButton, FormsModule],
932
+ })
933
+ export class MyComponent {
934
+ selectedOption = 'option1';
935
+
936
+ onRadioChange(value: any) {
937
+ console.log('Selected option:', value);
938
+ }
939
+ }
940
+ ```
941
+
942
+ #### Component Selector
943
+
944
+ `<bk-radio-button>`
945
+
946
+ #### Inputs
947
+
948
+ | Input | Type | Default | Description |
949
+ | ------------ | ----------------- | ----------- | ------------------------------------------------------------------------- |
950
+ | `label` | `string` | `''` | Optional label text displayed next to the radio button |
951
+ | `value` | `any` | `undefined` | The value associated with this radio button (required for radio groups) |
952
+ | `disabled` | `boolean` | `false` | Disables the radio button interaction |
953
+ | `variant` | `'dot' \| 'tick'` | `'dot'` | Visual variant. `'dot'` shows a filled circle, `'tick'` shows a checkmark |
954
+ | `radioClass` | `string` | `''` | CSS class for size styling. Options: `'xsm'`, `'sm'`, `'md'`, `'lg'` |
955
+ | `labelClass` | `string` | `''` | Custom CSS classes for the label text |
956
+
957
+ #### Outputs
958
+
959
+ | Output | Type | Description |
960
+ | -------- | ------------------- | --------------------------------------------------------- |
961
+ | `change` | `EventEmitter<any>` | Emitted when radio button is selected (returns the value) |
962
+
963
+ #### Features
964
+
965
+ - βœ… **Angular Forms Integration** - Full support for `ngModel` and reactive forms
966
+ - βœ… **Two Visual Variants** - Dot (filled circle) and Tick (checkmark) styles
967
+ - βœ… **Four Size Variants** - Extra Small (`xsm`), Small (`sm`), Medium (`md`), Large (`lg`)
968
+ - βœ… **Radio Groups** - Automatically groups radio buttons with the same `ngModel` binding
969
+ - βœ… **Accessibility** - ARIA attributes, keyboard navigation (Enter/Space), and screen reader support
970
+ - βœ… **Disabled State** - Visual and functional disabled state
971
+ - βœ… **Keyboard Support** - Full keyboard navigation with Enter and Space keys
972
+ - βœ… **Focus Management** - Focus visible ring for keyboard users
973
+ - βœ… **Event Handling** - `change` event for selection notifications
974
+
975
+ #### Usage Examples
976
+
977
+ **Basic Radio Group with ngModel:**
978
+
979
+ ```typescript
980
+ import { BkRadioButton } from '@brickclay/ui';
981
+ import { FormsModule } from '@angular/forms';
982
+
983
+ @Component({
984
+ template: `
985
+ <bk-radio-button
986
+ [(ngModel)]="selectedPayment"
987
+ [value]="'credit'"
988
+ [label]="'Credit Card'"
989
+ >
990
+ </bk-radio-button>
991
+
992
+ <bk-radio-button [(ngModel)]="selectedPayment" [value]="'debit'" [label]="'Debit Card'">
993
+ </bk-radio-button>
994
+
995
+ <bk-radio-button [(ngModel)]="selectedPayment" [value]="'paypal'" [label]="'PayPal'">
996
+ </bk-radio-button>
997
+ `,
998
+ imports: [BkRadioButton, FormsModule],
999
+ })
1000
+ export class MyComponent {
1001
+ selectedPayment = 'credit';
1002
+ }
1003
+ ```
1004
+
1005
+ **Dot Variant (Default):**
1006
+
1007
+ ```typescript
1008
+ <bk-radio-button
1009
+ [(ngModel)]="selectedOption"
1010
+ [value]="'option1'"
1011
+ [variant]="'dot'"
1012
+ [label]="'Option with Dot'">
1013
+ </bk-radio-button>
1014
+ ```
1015
+
1016
+ **Tick Variant:**
1017
+
1018
+ ```typescript
1019
+ <bk-radio-button
1020
+ [(ngModel)]="selectedOption"
1021
+ [value]="'option2'"
1022
+ [variant]="'tick'"
1023
+ [label]="'Option with Tick'">
1024
+ </bk-radio-button>
1025
+ ```
1026
+
1027
+ **Different Sizes:**
1028
+
1029
+ ```typescript
1030
+ <!-- Extra Small radio -->
1031
+ <bk-radio-button
1032
+ [(ngModel)]="selectedOption"
1033
+ [value]="'xsm'"
1034
+ [radioClass]="'xsm'"
1035
+ [label]="'Extra Small Radio'">
1036
+ </bk-radio-button>
1037
+
1038
+ <!-- Small radio -->
1039
+ <bk-radio-button
1040
+ [(ngModel)]="selectedOption"
1041
+ [value]="'sm'"
1042
+ [radioClass]="'sm'"
1043
+ [label]="'Small Radio'">
1044
+ </bk-radio-button>
1045
+
1046
+ <!-- Medium radio -->
1047
+ <bk-radio-button
1048
+ [(ngModel)]="selectedOption"
1049
+ [value]="'md'"
1050
+ [radioClass]="'md'"
1051
+ [label]="'Medium Radio'">
1052
+ </bk-radio-button>
1053
+
1054
+ <!-- Large radio with custom label styling -->
1055
+ <bk-radio-button
1056
+ [(ngModel)]="selectedOption"
1057
+ [value]="'lg'"
1058
+ [radioClass]="'lg'"
1059
+ [labelClass]="'text-lg font-bold'"
1060
+ [label]="'Large Radio'">
1061
+ </bk-radio-button>
1062
+ ```
1063
+
1064
+ **Disabled State:**
1065
+
1066
+ ```typescript
1067
+ <bk-radio-button
1068
+ [(ngModel)]="selectedOption"
1069
+ [value]="'disabled-option'"
1070
+ [disabled]="true"
1071
+ [label]="'Disabled Option'">
1072
+ </bk-radio-button>
1073
+ ```
1074
+
1075
+ **With Event Handler:**
1076
+
1077
+ ```typescript
1078
+ @Component({
1079
+ template: `
1080
+ <bk-radio-button
1081
+ *ngFor="let option of options"
1082
+ [(ngModel)]="selectedOption"
1083
+ [value]="option.value"
1084
+ [label]="option.label"
1085
+ (change)="onOptionChange($event)"
1086
+ >
1087
+ </bk-radio-button>
1088
+ `,
1089
+ })
1090
+ export class MyComponent {
1091
+ options = [
1092
+ { value: 'option1', label: 'Option 1' },
1093
+ { value: 'option2', label: 'Option 2' },
1094
+ { value: 'option3', label: 'Option 3' },
1095
+ ];
1096
+ selectedOption = 'option1';
1097
+
1098
+ onOptionChange(value: any) {
1099
+ console.log('Selected:', value);
1100
+ }
1101
+ }
1102
+ ```
1103
+
1104
+ **Reactive Forms Integration:**
1105
+
1106
+ ```typescript
1107
+ import { FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms';
1108
+ import { BkRadioButton } from '@brickclay/ui';
1109
+
1110
+ @Component({
1111
+ template: `
1112
+ <form [formGroup]="surveyForm">
1113
+ <bk-radio-button formControlName="rating" [value]="'excellent'" [label]="'Excellent'">
1114
+ </bk-radio-button>
1115
+
1116
+ <bk-radio-button formControlName="rating" [value]="'good'" [label]="'Good'">
1117
+ </bk-radio-button>
1118
+
1119
+ <bk-radio-button formControlName="rating" [value]="'fair'" [label]="'Fair'">
1120
+ </bk-radio-button>
1121
+ </form>
1122
+ `,
1123
+ imports: [BkRadioButton, ReactiveFormsModule],
1124
+ })
1125
+ export class SurveyComponent {
1126
+ surveyForm: FormGroup;
1127
+
1128
+ constructor(private fb: FormBuilder) {
1129
+ this.surveyForm = this.fb.group({
1130
+ rating: ['good', Validators.required],
1131
+ });
1132
+ }
1133
+ }
1134
+ ```
1135
+
1136
+ **Without Label:**
1137
+
1138
+ ```typescript
1139
+ <bk-radio-button
1140
+ [(ngModel)]="selectedOption"
1141
+ [value]="'option1'"
1142
+ [radioClass]="'md'">
1143
+ </bk-radio-button>
1144
+ ```
1145
+
1146
+ **Dynamic Radio Group:**
1147
+
1148
+ ```typescript
1149
+ @Component({
1150
+ template: `
1151
+ <div>
1152
+ <bk-radio-button
1153
+ *ngFor="let item of items"
1154
+ [(ngModel)]="selectedItem"
1155
+ [value]="item.id"
1156
+ [label]="item.name"
1157
+ [variant]="item.variant || 'dot'"
1158
+ >
1159
+ </bk-radio-button>
1160
+ </div>
1161
+ `,
1162
+ })
1163
+ export class MyComponent {
1164
+ items = [
1165
+ { id: 1, name: 'Item 1', variant: 'dot' },
1166
+ { id: 2, name: 'Item 2', variant: 'tick' },
1167
+ { id: 3, name: 'Item 3', variant: 'dot' },
1168
+ ];
1169
+ selectedItem = 1;
1170
+ }
1171
+ ```
1172
+
1173
+ #### Styling
1174
+
1175
+ The radio button component supports predefined size classes:
1176
+
1177
+ - **Extra Small**: `xsm` - 14px Γ— 14px
1178
+ - **Small**: `sm` - 16px Γ— 16px
1179
+ - **Medium**: `md` - 18px Γ— 18px
1180
+ - **Large**: `lg` - 19px Γ— 19px
1181
+
1182
+ Use `labelClass` to style the label text (font size, weight, color, etc.)
1183
+
1184
+ The component includes built-in styles for:
1185
+
1186
+ - **Dot Variant**: Filled circle indicator when selected (size varies by radioClass)
1187
+ - **Tick Variant**: Checkmark indicator when selected (size varies by radioClass)
1188
+ - Unselected state (white background with gray border)
1189
+ - Hover states (darker border on hover)
1190
+ - Disabled states (gray background and border)
1191
+ - Focus ring for accessibility (blue ring with offset)
1192
+ - Smooth transitions for state changes
1193
+
1194
+ #### Accessibility
1195
+
1196
+ The radio button component includes:
1197
+
1198
+ - Keyboard navigation support (Enter and Space keys)
1199
+ - Focus visible ring for keyboard users
1200
+ - Proper ARIA attributes
1201
+ - Disabled state properly communicated to assistive technologies
1202
+ - Tab navigation support
1203
+ - Radio group semantics for screen readers
1204
+
1205
+ #### Radio Groups
1206
+
1207
+ Radio buttons are automatically grouped when they share the same `ngModel` binding. Only one radio button in a group can be selected at a time. When a radio button is selected, the previously selected one in the same group is automatically deselected.
1208
+
1209
+ ## πŸ’Š Pill
1210
+
1211
+ A versatile pill component for displaying labels, tags, or status indicators. Perfect for categorizing content, showing status, or creating removable tag lists. Supports multiple visual variants, color schemes, sizes, and optional dot indicators.
1212
+
1213
+ ### BkPill
1214
+
1215
+ A standalone pill component that displays text labels with customizable styling and optional removal functionality.
1216
+
1217
+ #### Basic Example
1218
+
1219
+ ```typescript
1220
+ import { BkPill } from '@brickclay/ui';
1221
+
1222
+ @Component({
1223
+ template: `
1224
+ <bk-pill
1225
+ [label]="'New Feature'"
1226
+ [variant]="'Solid'"
1227
+ [color]="'Primary'"
1228
+ [size]="'md'"
1229
+ (clicked)="onPillRemoved($event)"
1230
+ >
1231
+ </bk-pill>
1232
+ `,
1233
+ imports: [BkPill],
1234
+ })
1235
+ export class MyComponent {
1236
+ onPillRemoved(label: string) {
1237
+ console.log('Pill removed:', label);
1238
+ }
1239
+ }
1240
+ ```
1241
+
1242
+ #### Component Selector
1243
+
1244
+ `<bk-pill>`
1245
+
1246
+ #### Inputs
1247
+
1248
+ | Input | Type | Default | Description |
1249
+ | ------------ | --------------------------------------- | --------- | -------------------------------------------------------------------- |
1250
+ | `label` | `string` | `''` | The text content displayed in the pill |
1251
+ | `variant` | `'Light' \| 'Solid' \| 'Outline' \| 'Transparent'` | `'Light'` | Visual style variant |
1252
+ | `color` | `'Gray' \| 'Primary' \| 'Error' \| 'Warning' \| 'Success' \| 'Purple' \| 'Cyan'` | `'Gray'` | Color scheme for the pill |
1253
+ | `size` | `'xsm' \| 'sm' \| 'md' \| 'lg'` | `'md'` | Size variant of the pill |
1254
+ | `dot` | `'left' \| 'right' \| 'none'` | `'none'` | Position of optional dot indicator (left, right, or none) |
1255
+ | `removable` | `boolean` | `false` | Whether to show a remove button |
1256
+ | `customClass`| `string` | `''` | Additional CSS classes for custom styling |
1257
+
1258
+ #### Outputs
1259
+
1260
+ | Output | Type | Description |
1261
+ | -------- | ------------------------ | ----------------------------------------------------- |
1262
+ | `clicked`| `EventEmitter<string>` | Emitted when the remove button is clicked (returns label) |
1263
+
1264
+ #### Features
1265
+
1266
+ - βœ… **Multiple Variants** - Light, Solid, Outline, and Transparent styles
1267
+ - βœ… **Color Options** - Gray, Primary, Error, Warning, Success, Purple, and Cyan
1268
+ - βœ… **Size Variants** - Extra Small (`xsm`), Small (`sm`), Medium (`md`), Large (`lg`)
1269
+ - βœ… **Dot Indicators** - Optional dot indicator on left or right side
1270
+ - βœ… **Removable** - Optional remove button with click event
1271
+ - βœ… **Custom Styling** - Additional CSS classes for custom appearance
1272
+ - βœ… **Event Handling** - `clicked` event for remove button interactions
1273
+
1274
+ #### Usage Examples
1275
+
1276
+ **Basic Pill:**
1277
+
1278
+ ```typescript
1279
+ import { BkPill } from '@brickclay/ui';
1280
+
1281
+ @Component({
1282
+ template: `
1283
+ <bk-pill [label]="'Status'" [color]="'Success'"> </bk-pill>
1284
+ `,
1285
+ imports: [BkPill],
1286
+ })
1287
+ export class MyComponent {}
1288
+ ```
1289
+
1290
+ **Different Variants:**
1291
+
1292
+ ```typescript
1293
+ <!-- Light variant -->
1294
+ <bk-pill
1295
+ [label]="'Light Pill'"
1296
+ [variant]="'Light'"
1297
+ [color]="'Primary'">
1298
+ </bk-pill>
1299
+
1300
+ <!-- Solid variant -->
1301
+ <bk-pill
1302
+ [label]="'Solid Pill'"
1303
+ [variant]="'Solid'"
1304
+ [color]="'Primary'">
1305
+ </bk-pill>
1306
+
1307
+ <!-- Outline variant -->
1308
+ <bk-pill
1309
+ [label]="'Outline Pill'"
1310
+ [variant]="'Outline'"
1311
+ [color]="'Primary'">
1312
+ </bk-pill>
1313
+
1314
+ <!-- Transparent variant -->
1315
+ <bk-pill
1316
+ [label]="'Transparent Pill'"
1317
+ [variant]="'Transparent'"
1318
+ [color]="'Primary'">
1319
+ </bk-pill>
1320
+ ```
1321
+
1322
+ **Different Colors:**
1323
+
1324
+ ```typescript
1325
+ <bk-pill [label]="'Gray'" [color]="'Gray'"> </bk-pill>
1326
+ <bk-pill [label]="'Primary'" [color]="'Primary'"> </bk-pill>
1327
+ <bk-pill [label]="'Error'" [color]="'Error'"> </bk-pill>
1328
+ <bk-pill [label]="'Warning'" [color]="'Warning'"> </bk-pill>
1329
+ <bk-pill [label]="'Success'" [color]="'Success'"> </bk-pill>
1330
+ <bk-pill [label]="'Purple'" [color]="'Purple'"> </bk-pill>
1331
+ <bk-pill [label]="'Cyan'" [color]="'Cyan'"> </bk-pill>
1332
+ ```
1333
+
1334
+ **Different Sizes:**
1335
+
1336
+ ```typescript
1337
+ <!-- Extra Small -->
1338
+ <bk-pill [label]="'XSM'" [size]="'xsm'"> </bk-pill>
1339
+
1340
+ <!-- Small -->
1341
+ <bk-pill [label]="'SM'" [size]="'sm'"> </bk-pill>
1342
+
1343
+ <!-- Medium -->
1344
+ <bk-pill [label]="'MD'" [size]="'md'"> </bk-pill>
1345
+
1346
+ <!-- Large -->
1347
+ <bk-pill [label]="'LG'" [size]="'lg'"> </bk-pill>
1348
+ ```
1349
+
1350
+ **With Dot Indicators:**
1351
+
1352
+ ```typescript
1353
+ <!-- Dot on left -->
1354
+ <bk-pill
1355
+ [label]="'Active'"
1356
+ [dot]="'left'"
1357
+ [color]="'Success'">
1358
+ </bk-pill>
1359
+
1360
+ <!-- Dot on right -->
1361
+ <bk-pill
1362
+ [label]="'Pending'"
1363
+ [dot]="'right'"
1364
+ [color]="'Warning'">
1365
+ </bk-pill>
1366
+ ```
1367
+
1368
+ **Removable Pill:**
1369
+
1370
+ ```typescript
1371
+ @Component({
1372
+ template: `
1373
+ <bk-pill
1374
+ [label]="'Removable Tag'"
1375
+ [removable]="true"
1376
+ (clicked)="onRemoveTag($event)">
1377
+ </bk-pill>
1378
+ `,
1379
+ })
1380
+ export class MyComponent {
1381
+ onRemoveTag(label: string) {
1382
+ console.log('Removed:', label);
1383
+ // Remove from list, update state, etc.
1384
+ }
1385
+ }
1386
+ ```
1387
+
1388
+ **Dynamic Pill List:**
1389
+
1390
+ ```typescript
1391
+ @Component({
1392
+ template: `
1393
+ <div>
1394
+ <bk-pill
1395
+ *ngFor="let tag of tags"
1396
+ [label]="tag"
1397
+ [removable]="true"
1398
+ [color]="getTagColor(tag)"
1399
+ (clicked)="removeTag(tag)">
1400
+ </bk-pill>
1401
+ </div>
1402
+ `,
1403
+ })
1404
+ export class MyComponent {
1405
+ tags = ['Angular', 'TypeScript', 'RxJS', 'NgRx'];
1406
+
1407
+ removeTag(tag: string) {
1408
+ this.tags = this.tags.filter((t) => t !== tag);
1409
+ }
1410
+
1411
+ getTagColor(tag: string): 'Primary' | 'Success' | 'Warning' {
1412
+ // Custom logic to determine color
1413
+ return 'Primary';
1414
+ }
1415
+ }
1416
+ ```
1417
+
1418
+ **With Custom Classes:**
1419
+
1420
+ ```typescript
1421
+ <bk-pill
1422
+ [label]="'Custom Styled'"
1423
+ [customClass]="'my-custom-class font-bold'">
1424
+ </bk-pill>
1425
+ ```
1426
+
1427
+ #### Styling
1428
+
1429
+ The pill component supports predefined size classes:
1430
+
1431
+ - **Extra Small**: `xsm`
1432
+ - **Small**: `sm`
1433
+ - **Medium**: `md` - Default
1434
+ - **Large**: `lg`
1435
+
1436
+ The component includes built-in styles for:
1437
+
1438
+ - All variant styles (Light, Solid, Outline, Transparent)
1439
+ - All color schemes (Gray, Primary, Error, Warning, Success, Purple, Cyan)
1440
+ - Dot indicators (left and right positions)
1441
+ - Remove button styling
1442
+ - Hover states
1443
+ - Smooth transitions
1444
+
1445
+ ## 🏷️ Badge
1446
+
1447
+ A flexible badge component for displaying labels, tags, or status indicators. Perfect for categorizing content, showing status, or creating removable tag lists. Supports multiple visual variants, color schemes, sizes, and optional dot indicators.
1448
+
1449
+ ### BadgeComponent
1450
+
1451
+ A standalone badge component that displays text labels with customizable styling and optional removal functionality.
1452
+
1453
+ #### Basic Example
1454
+
1455
+ ```typescript
1456
+ import { BkBadge } from '@brickclay/ui';
1457
+
1458
+ @Component({
1459
+ template: `
1460
+ <bk-badge
1461
+ [label]="'New'"
1462
+ [variant]="'Solid'"
1463
+ [color]="'Primary'"
1464
+ [size]="'md'"
1465
+ (clicked)="onBadgeRemoved($event)"
1466
+ >
1467
+ </bk-badge>
1468
+ `,
1469
+ imports: [BkBadge],
1470
+ })
1471
+ export class MyComponent {
1472
+ onBadgeRemoved(label: string) {
1473
+ console.log('Badge removed:', label);
1474
+ }
1475
+ }
1476
+ ```
1477
+
1478
+ #### Component Selector
1479
+
1480
+ `<bk-badge>`
1481
+
1482
+ #### Inputs
1483
+
1484
+ | Input | Type | Default | Description |
1485
+ | ------------ | --------------------------------------- | --------- | -------------------------------------------------------------------- |
1486
+ | `label` | `string` | `''` | The text content displayed in the badge |
1487
+ | `variant` | `'Light' \| 'Solid' \| 'Outline' \| 'Transparent'` | `'Light'` | Visual style variant |
1488
+ | `color` | `'Gray' \| 'Primary' \| 'Error' \| 'Warning' \| 'Success' \| 'Purple' \| 'Cyan'` | `'Gray'` | Color scheme for the badge |
1489
+ | `size` | `'xsm' \| 'sm' \| 'md' \| 'lg'` | `'md'` | Size variant of the badge |
1490
+ | `dot` | `'left' \| 'right' \| 'none'` | `'none'` | Position of optional dot indicator (left, right, or none) |
1491
+ | `removable` | `boolean` | `false` | Whether to show a remove button |
1492
+ | `customClass`| `string` | `''` | Additional CSS classes for custom styling |
1493
+
1494
+ #### Outputs
1495
+
1496
+ | Output | Type | Description |
1497
+ | -------- | ------------------------ | ----------------------------------------------------- |
1498
+ | `clicked`| `EventEmitter<string>` | Emitted when the remove button is clicked (returns label) |
1499
+
1500
+ #### Features
1501
+
1502
+ - βœ… **Multiple Variants** - Light, Solid, Outline, and Transparent styles
1503
+ - βœ… **Color Options** - Gray, Primary, Error, Warning, Success, Purple, and Cyan
1504
+ - βœ… **Size Variants** - Extra Small (`xsm`), Small (`sm`), Medium (`md`), Large (`lg`)
1505
+ - βœ… **Dot Indicators** - Optional dot indicator on left or right side
1506
+ - βœ… **Removable** - Optional remove button with click event
1507
+ - βœ… **Custom Styling** - Additional CSS classes for custom appearance
1508
+ - βœ… **Event Handling** - `clicked` event for remove button interactions
1509
+
1510
+ #### Usage Examples
1511
+
1512
+ **Basic Badge:**
1513
+
1514
+ ```typescript
1515
+ import { BkBadge } from '@brickclay/ui';
1516
+
1517
+ @Component({
1518
+ template: `
1519
+ <bk-badge [label]="'New'" [color]="'Success'"> </bk-badge>
1520
+ `,
1521
+ imports: [BkBadge],
1522
+ })
1523
+ export class MyComponent {}
1524
+ ```
1525
+
1526
+ **Different Variants:**
1527
+
1528
+ ```typescript
1529
+ <!-- Light variant -->
1530
+ <bk-badge
1531
+ [label]="'Light Badge'"
1532
+ [variant]="'Light'"
1533
+ [color]="'Primary'">
1534
+ </bk-badge>
1535
+
1536
+ <!-- Solid variant -->
1537
+ <bk-badge
1538
+ [label]="'Solid Badge'"
1539
+ [variant]="'Solid'"
1540
+ [color]="'Primary'">
1541
+ </bk-badge>
1542
+
1543
+ <!-- Outline variant -->
1544
+ <bk-badge
1545
+ [label]="'Outline Badge'"
1546
+ [variant]="'Outline'"
1547
+ [color]="'Primary'">
1548
+ </bk-badge>
1549
+
1550
+ <!-- Transparent variant -->
1551
+ <bk-badge
1552
+ [label]="'Transparent Badge'"
1553
+ [variant]="'Transparent'"
1554
+ [color]="'Primary'">
1555
+ </bk-badge>
1556
+ ```
1557
+
1558
+ **Different Colors:**
1559
+
1560
+ ```typescript
1561
+ <bk-badge [label]="'Gray'" [color]="'Gray'"> </bk-badge>
1562
+ <bk-badge [label]="'Primary'" [color]="'Primary'"> </bk-badge>
1563
+ <bk-badge [label]="'Error'" [color]="'Error'"> </bk-badge>
1564
+ <bk-badge [label]="'Warning'" [color]="'Warning'"> </bk-badge>
1565
+ <bk-badge [label]="'Success'" [color]="'Success'"> </bk-badge>
1566
+ <bk-badge [label]="'Purple'" [color]="'Purple'"> </bk-badge>
1567
+ <bk-badge [label]="'Cyan'" [color]="'Cyan'"> </bk-badge>
1568
+ ```
1569
+
1570
+ **Different Sizes:**
1571
+
1572
+ ```typescript
1573
+ <!-- Extra Small -->
1574
+ <bk-badge [label]="'XSM'" [size]="'xsm'"> </bk-badge>
1575
+
1576
+ <!-- Small -->
1577
+ <bk-badge [label]="'SM'" [size]="'sm'"> </bk-badge>
1578
+
1579
+ <!-- Medium -->
1580
+ <bk-badge [label]="'MD'" [size]="'md'"> </bk-badge>
1581
+
1582
+ <!-- Large -->
1583
+ <bk-badge [label]="'LG'" [size]="'lg'"> </bk-badge>
1584
+ ```
1585
+
1586
+ **With Dot Indicators:**
1587
+
1588
+ ```typescript
1589
+ <!-- Dot on left -->
1590
+ <bk-badge
1591
+ [label]="'Active'"
1592
+ [dot]="'left'"
1593
+ [color]="'Success'">
1594
+ </bk-badge>
1595
+
1596
+ <!-- Dot on right -->
1597
+ <bk-badge
1598
+ [label]="'Pending'"
1599
+ [dot]="'right'"
1600
+ [color]="'Warning'">
1601
+ </bk-badge>
1602
+ ```
1603
+
1604
+ **Removable Badge:**
1605
+
1606
+ ```typescript
1607
+ @Component({
1608
+ template: `
1609
+ <bk-badge
1610
+ [label]="'Removable Tag'"
1611
+ [removable]="true"
1612
+ (clicked)="onRemoveTag($event)">
1613
+ </bk-badge>
1614
+ `,
1615
+ })
1616
+ export class MyComponent {
1617
+ onRemoveTag(label: string) {
1618
+ console.log('Removed:', label);
1619
+ // Remove from list, update state, etc.
1620
+ }
1621
+ }
1622
+ ```
1623
+
1624
+ **Dynamic Badge List:**
1625
+
1626
+ ```typescript
1627
+ @Component({
1628
+ template: `
1629
+ <div>
1630
+ <bk-badge
1631
+ *ngFor="let tag of tags"
1632
+ [label]="tag"
1633
+ [removable]="true"
1634
+ [color]="getTagColor(tag)"
1635
+ (clicked)="removeTag(tag)">
1636
+ </bk-badge>
1637
+ </div>
1638
+ `,
1639
+ })
1640
+ export class MyComponent {
1641
+ tags = ['Angular', 'TypeScript', 'RxJS', 'NgRx'];
1642
+
1643
+ removeTag(tag: string) {
1644
+ this.tags = this.tags.filter((t) => t !== tag);
1645
+ }
1646
+
1647
+ getTagColor(tag: string): 'Primary' | 'Success' | 'Warning' {
1648
+ // Custom logic to determine color
1649
+ return 'Primary';
1650
+ }
1651
+ }
1652
+ ```
1653
+
1654
+ **With Custom Classes:**
1655
+
1656
+ ```typescript
1657
+ <bk-badge
1658
+ [label]="'Custom Styled'"
1659
+ [customClass]="'my-custom-class font-bold'">
1660
+ </bk-badge>
1661
+ ```
1662
+
1663
+ #### Styling
1664
+
1665
+ The badge component supports predefined size classes:
1666
+
1667
+ - **Extra Small**: `xsm`
1668
+ - **Small**: `sm`
1669
+ - **Medium**: `md` - Default
1670
+ - **Large**: `lg`
1671
+
1672
+ The component includes built-in styles for:
1673
+
1674
+ - All variant styles (Light, Solid, Outline, Transparent)
1675
+ - All color schemes (Gray, Primary, Error, Warning, Success, Purple, Cyan)
1676
+ - Dot indicators (left and right positions)
1677
+ - Remove button styling
1678
+ - Hover states
1679
+ - Smooth transitions
1680
+
1681
+ ## πŸ“ TypeScript Interfaces
1682
+
1683
+ ### CalendarRange
1684
+
1685
+ ```typescript
1686
+ interface CalendarRange {
1687
+ start: Date;
1688
+ end: Date;
1689
+ }
1690
+ ```
1691
+
1692
+ ### CalendarSelection
1693
+
1694
+ ```typescript
1695
+ interface CalendarSelection {
1696
+ startDate: Date | null;
1697
+ endDate: Date | null;
1698
+ selectedDates?: Date[]; // For multi-date selection
1699
+ }
1700
+ ```
1701
+
1702
+ ### TimeConfiguration
1703
+
1704
+ ```typescript
1705
+ interface TimeConfiguration {
1706
+ date: Date;
1707
+ allDay: boolean;
1708
+ startTime: string; // Format: "HH:mm" or "HH:mm:ss"
1709
+ endTime: string;
1710
+ }
1711
+ ```
1712
+
1713
+ ### ScheduledDateSelection
1714
+
1715
+ ```typescript
1716
+ interface ScheduledDateSelection {
1717
+ mode: 'single' | 'multiple' | 'range';
1718
+ singleDate?: {
1719
+ startDate: Date;
1720
+ endDate: Date;
1721
+ allDay: boolean;
1722
+ startTime: string;
1723
+ endTime: string;
1724
+ };
1725
+ multipleDates?: TimeConfiguration[];
1726
+ dateRange?: {
1727
+ startDate: Date;
1728
+ endDate: Date;
1729
+ allDay: boolean;
1730
+ startTime: string;
1731
+ endTime: string;
1732
+ };
1733
+ }
1734
+ ```
1735
+
1736
+ ## 🎯 Common Use Cases
1737
+
1738
+ ### Form Integration
1739
+
1740
+ ```typescript
1741
+ import { FormBuilder, FormGroup, Validators } from '@angular/forms';
1742
+ import { BkCustomCalendar } from '@brickclay/ui';
1743
+
1744
+ export class BookingFormComponent {
1745
+ bookingForm: FormGroup;
1746
+
1747
+ constructor(private fb: FormBuilder) {
1748
+ this.bookingForm = this.fb.group({
1749
+ checkIn: [null, Validators.required],
1750
+ checkOut: [null, Validators.required],
1751
+ });
1752
+ }
1753
+
1754
+ onDateSelected(selection: CalendarSelection) {
1755
+ this.bookingForm.patchValue({
1756
+ checkIn: selection.startDate,
1757
+ checkOut: selection.endDate,
1758
+ });
1759
+ }
1760
+ }
1761
+ ```
1762
+
1763
+ ### Reactive Forms
1764
+
1765
+ ```typescript
1766
+ <bk-custom-calendar
1767
+ [selectedValue]="form.get('dateRange')?.value"
1768
+ (selected)="form.patchValue({ dateRange: $event })">
1769
+ </bk-custom-calendar>
1770
+ ```
1771
+
1772
+ ### Date Filtering
1773
+
1774
+ ```typescript
1775
+ export class DataTableComponent {
1776
+ filterDates: CalendarSelection = { startDate: null, endDate: null };
1777
+
1778
+ onDateFilter(selection: CalendarSelection) {
1779
+ this.filterDates = selection;
1780
+ this.loadFilteredData();
1781
+ }
1782
+
1783
+ loadFilteredData() {
1784
+ const filtered = this.data.filter((item) => {
1785
+ if (!this.filterDates.startDate || !this.filterDates.endDate) {
1786
+ return true;
1787
+ }
1788
+ return item.date >= this.filterDates.startDate! && item.date <= this.filterDates.endDate!;
1789
+ });
1790
+ }
1791
+ }
1792
+ ```
1793
+
1794
+ ## πŸ“¦ Assets Configuration
1795
+
1796
+ The calendar components require SVG icons. Configure your `angular.json` to copy assets:
1797
+
1798
+ ```json
1799
+ {
1800
+ "glob": "**/*",
1801
+ "input": "node_modules/@brickclay/ui/assets",
1802
+ "output": "assets"
1803
+ }
1804
+ ```
1805
+
1806
+ Or manually copy assets from:
1807
+
1808
+ ```
1809
+ node_modules/@brickclay/ui/assets/calender/* β†’ your-app/public/assets/calender/
1810
+ ```
1811
+
1812
+ ## πŸ”§ Service
1813
+
1814
+ ### CalendarManagerService
1815
+
1816
+ A service that manages multiple calendar instances, ensuring only one calendar is open at a time when not in inline mode. Used internally by `BkCustomCalendar`.
1817
+
1818
+ ## 🌐 Browser Support
1819
+
1820
+ - Chrome (latest)
1821
+ - Firefox (latest)
1822
+ - Safari (latest)
1823
+ - Edge (latest)
1824
+
1825
+ ## πŸ“¦ Dependencies
1826
+
1827
+ - Angular 20.3.0+
1828
+ - moment (for date formatting)
1829
+
1830
+ ## 🀝 Contributing
1831
+
1832
+ We welcome contributions! Please see our contributing guidelines for more information.
1833
+
1834
+ ## πŸ“„ License
1835
+
1836
+ MIT
1837
+
1838
+ ## πŸ“ž Support
1839
+
1840
+ For issues, feature requests, or contributions, please visit our [GitHub repository](https://github.com/brickclay/ui).
1841
+
1842
+ ## πŸ—ΊοΈ Roadmap
1843
+
1844
+ - [ ] Button components
1845
+ - [ ] Input components
1846
+ - [ ] Card components
1847
+ - [ ] Modal/Dialog components
1848
+ - [ ] Table components
1849
+ - [ ] Form components
1850
+ - [ ] Navigation components
1851
+ - [ ] Loading/Spinner components
1852
+ - [ ] Toast/Notification components
1853
+ - [ ] More calendar features
1854
+
1855
+ ## πŸ“ Changelog
1856
+
1857
+ ### Version 0.0.1
1858
+
1859
+ **Initial Release:**
1860
+
1861
+ - βœ… Calendar component suite
1862
+ - Single date selection
1863
+ - Date range selection
1864
+ - Multiple date selection
1865
+ - Time picker integration
1866
+ - Inline and dropdown modes
1867
+ - Dual calendar view
1868
+ - Custom date ranges
1869
+ - Date constraints (min/max)
1870
+ - βœ… Scheduled date picker component
1871
+ - βœ… Standalone time picker component
1872
+ - βœ… Toggle/Switch component
1873
+ - Angular forms integration (ngModel & reactive forms)
1874
+ - Three size variants (small, medium, large)
1875
+ - Disabled state support
1876
+ - Full accessibility features
1877
+ - Customizable styling
1878
+ - βœ… Checkbox component
1879
+ - Angular forms integration (ngModel & reactive forms)
1880
+ - Customizable styling via CSS classes
1881
+ - Disabled state support
1882
+ - Full keyboard navigation support
1883
+ - Complete accessibility features
1884
+ - βœ… Radio button component
1885
+ - Angular forms integration (ngModel & reactive forms)
1886
+ - Two visual variants (dot and tick)
1887
+ - Radio group support
1888
+ - Customizable styling via CSS classes
1889
+ - Disabled state support
1890
+ - Full keyboard navigation support
1891
+ - Complete accessibility features
1892
+ - βœ… Pill component
1893
+ - Multiple visual variants (Light, Solid, Outline, Transparent)
1894
+ - Seven color options (Gray, Primary, Error, Warning, Success, Purple, Cyan)
1895
+ - Four size variants (xsm, sm, md, lg)
1896
+ - Optional dot indicators (left, right, none)
1897
+ - Removable functionality with click events
1898
+ - Custom CSS class support
1899
+ - βœ… Badge component
1900
+ - Multiple visual variants (Light, Solid, Outline, Transparent)
1901
+ - Seven color options (Gray, Primary, Error, Warning, Success, Purple, Cyan)
1902
+ - Four size variants (xsm, sm, md, lg)
1903
+ - Optional dot indicators (left, right, none)
1904
+ - Removable functionality with click events
1905
+ - Custom CSS class support
1906
+ - βœ… TypeScript definitions
1907
+ - βœ… Comprehensive documentation
1908
+
1909
+ ---
1910
+
1911
+ **Built with ❀️ by the Brickclay team**