@brickclay-org/ui 0.0.24 → 0.0.26
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 +216 -216
- package/fesm2022/brickclay-org-ui.mjs +90 -90
- package/fesm2022/brickclay-org-ui.mjs.map +1 -1
- package/index.d.ts +44 -44
- package/package.json +1 -1
- package/src/lib/select/select.css +128 -0
- package/src/styles.css +1 -1
package/README.md
CHANGED
|
@@ -59,7 +59,7 @@ _More components coming soon..._
|
|
|
59
59
|
## Installation
|
|
60
60
|
|
|
61
61
|
```bash
|
|
62
|
-
npm i @brickclay-org/ui@0.0.
|
|
62
|
+
npm i @brickclay-org/ui@0.0.26
|
|
63
63
|
```
|
|
64
64
|
|
|
65
65
|
### Peer Dependencies
|
|
@@ -106,14 +106,14 @@ This configuration copies the library's assets (SVG icons, etc.) to your applica
|
|
|
106
106
|
|
|
107
107
|
```typescript
|
|
108
108
|
import { Component } from '@angular/core';
|
|
109
|
-
import {
|
|
109
|
+
import { BkCustomCalendar, CalendarSelection } from '@brickclay/ui';
|
|
110
110
|
|
|
111
111
|
@Component({
|
|
112
112
|
standalone: true,
|
|
113
113
|
selector: 'app-my-component',
|
|
114
|
-
imports: [
|
|
114
|
+
imports: [BkCustomCalendar],
|
|
115
115
|
template: `
|
|
116
|
-
<
|
|
116
|
+
<bk-custom-calendar (selected)="onDateSelected($event)"> </bk-custom-calendar>
|
|
117
117
|
`,
|
|
118
118
|
})
|
|
119
119
|
export class MyComponent {
|
|
@@ -142,22 +142,22 @@ The calendar components provide a complete solution for date and time selection
|
|
|
142
142
|
|
|
143
143
|
### Components Overview
|
|
144
144
|
|
|
145
|
-
1. **
|
|
146
|
-
2. **
|
|
147
|
-
3. **
|
|
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
148
|
|
|
149
|
-
###
|
|
149
|
+
### BkCustomCalendar
|
|
150
150
|
|
|
151
151
|
A versatile calendar component that supports single date, date range, and multiple date selection modes.
|
|
152
152
|
|
|
153
153
|
#### Basic Example
|
|
154
154
|
|
|
155
155
|
```typescript
|
|
156
|
-
import {
|
|
156
|
+
import { BkCustomCalendar, CalendarSelection } from '@brickclay/ui';
|
|
157
157
|
|
|
158
158
|
@Component({
|
|
159
159
|
template: `
|
|
160
|
-
<
|
|
160
|
+
<bk-custom-calendar
|
|
161
161
|
[singleDatePicker]="false"
|
|
162
162
|
[dualCalendar]="true"
|
|
163
163
|
[enableTimepicker]="true"
|
|
@@ -165,7 +165,7 @@ import { CustomCalendarComponent, CalendarSelection } from '@brickclay/ui';
|
|
|
165
165
|
[placeholder]="'Select date range'"
|
|
166
166
|
(selected)="onDateSelected($event)"
|
|
167
167
|
>
|
|
168
|
-
</
|
|
168
|
+
</bk-custom-calendar>
|
|
169
169
|
`,
|
|
170
170
|
})
|
|
171
171
|
export class MyComponent {
|
|
@@ -178,7 +178,7 @@ export class MyComponent {
|
|
|
178
178
|
|
|
179
179
|
#### Component Selector
|
|
180
180
|
|
|
181
|
-
`<
|
|
181
|
+
`<bk-custom-calendar>`
|
|
182
182
|
|
|
183
183
|
#### Inputs
|
|
184
184
|
|
|
@@ -216,43 +216,43 @@ export class MyComponent {
|
|
|
216
216
|
**Single Date Selection:**
|
|
217
217
|
|
|
218
218
|
```typescript
|
|
219
|
-
<
|
|
219
|
+
<bk-custom-calendar
|
|
220
220
|
[singleDatePicker]="true"
|
|
221
221
|
[placeholder]="'Select a date'"
|
|
222
222
|
(selected)="onDateSelected($event)">
|
|
223
|
-
</
|
|
223
|
+
</bk-custom-calendar>
|
|
224
224
|
```
|
|
225
225
|
|
|
226
226
|
**Date Range with Time Picker:**
|
|
227
227
|
|
|
228
228
|
```typescript
|
|
229
|
-
<
|
|
229
|
+
<bk-custom-calendar
|
|
230
230
|
[dualCalendar]="true"
|
|
231
231
|
[enableTimepicker]="true"
|
|
232
232
|
[enableSeconds]="true"
|
|
233
233
|
(selected)="onRangeSelected($event)">
|
|
234
|
-
</
|
|
234
|
+
</bk-custom-calendar>
|
|
235
235
|
```
|
|
236
236
|
|
|
237
237
|
**Multiple Date Selection:**
|
|
238
238
|
|
|
239
239
|
```typescript
|
|
240
|
-
<
|
|
240
|
+
<bk-custom-calendar
|
|
241
241
|
[multiDateSelection]="true"
|
|
242
242
|
[inline]="true"
|
|
243
243
|
(selected)="onMultipleDatesSelected($event)">
|
|
244
|
-
</
|
|
244
|
+
</bk-custom-calendar>
|
|
245
245
|
```
|
|
246
246
|
|
|
247
247
|
**Inline Calendar:**
|
|
248
248
|
|
|
249
249
|
```typescript
|
|
250
|
-
<
|
|
250
|
+
<bk-custom-calendar
|
|
251
251
|
[inline]="true"
|
|
252
252
|
[dualCalendar]="false"
|
|
253
253
|
[showRanges]="false"
|
|
254
254
|
(selected)="onDateSelected($event)">
|
|
255
|
-
</
|
|
255
|
+
</bk-custom-calendar>
|
|
256
256
|
```
|
|
257
257
|
|
|
258
258
|
**Custom Date Ranges:**
|
|
@@ -271,21 +271,21 @@ const customRanges: Record<string, CalendarRange> = {
|
|
|
271
271
|
}
|
|
272
272
|
};
|
|
273
273
|
|
|
274
|
-
<
|
|
274
|
+
<bk-custom-calendar
|
|
275
275
|
[customRanges]="customRanges"
|
|
276
276
|
[showRanges]="true"
|
|
277
277
|
(selected)="onDateSelected($event)">
|
|
278
|
-
</
|
|
278
|
+
</bk-custom-calendar>
|
|
279
279
|
```
|
|
280
280
|
|
|
281
281
|
**Date Constraints:**
|
|
282
282
|
|
|
283
283
|
```typescript
|
|
284
|
-
<
|
|
284
|
+
<bk-custom-calendar
|
|
285
285
|
[minDate]="new Date(2024, 0, 1)"
|
|
286
286
|
[maxDate]="new Date(2024, 11, 31)"
|
|
287
287
|
(selected)="onDateSelected($event)">
|
|
288
|
-
</
|
|
288
|
+
</bk-custom-calendar>
|
|
289
289
|
```
|
|
290
290
|
|
|
291
291
|
**Pre-selected Values:**
|
|
@@ -305,25 +305,25 @@ export class MyComponent {
|
|
|
305
305
|
}
|
|
306
306
|
}
|
|
307
307
|
|
|
308
|
-
<
|
|
308
|
+
<bk-custom-calendar
|
|
309
309
|
[selectedValue]="selectedValue"
|
|
310
310
|
(selected)="onDateSelected($event)">
|
|
311
|
-
</
|
|
311
|
+
</bk-custom-calendar>
|
|
312
312
|
```
|
|
313
313
|
|
|
314
|
-
###
|
|
314
|
+
### BkScheduledDatePicker
|
|
315
315
|
|
|
316
316
|
A comprehensive date and time scheduling component with three modes: single date, multiple dates, and date range, each with time configuration.
|
|
317
317
|
|
|
318
318
|
#### Basic Example
|
|
319
319
|
|
|
320
320
|
```typescript
|
|
321
|
-
import {
|
|
321
|
+
import { BkScheduledDatePicker, ScheduledDateSelection } from '@brickclay/ui';
|
|
322
322
|
|
|
323
323
|
@Component({
|
|
324
324
|
template: `
|
|
325
|
-
<
|
|
326
|
-
</
|
|
325
|
+
<bk-scheduled-date-picker [timeFormat]="12" (scheduled)="onScheduled($event)">
|
|
326
|
+
</bk-scheduled-date-picker>
|
|
327
327
|
`,
|
|
328
328
|
})
|
|
329
329
|
export class MyComponent {
|
|
@@ -340,7 +340,7 @@ export class MyComponent {
|
|
|
340
340
|
|
|
341
341
|
#### Component Selector
|
|
342
342
|
|
|
343
|
-
`<
|
|
343
|
+
`<bk-scheduled-date-picker>`
|
|
344
344
|
|
|
345
345
|
#### Inputs
|
|
346
346
|
|
|
@@ -364,24 +364,24 @@ export class MyComponent {
|
|
|
364
364
|
- **All Day Toggle**: Mark dates as all-day events
|
|
365
365
|
- **Time Configuration**: Individual time pickers for each date/range
|
|
366
366
|
|
|
367
|
-
###
|
|
367
|
+
### BkTimePicker
|
|
368
368
|
|
|
369
369
|
A standalone time picker component with scrollable hour, minute, and AM/PM selectors.
|
|
370
370
|
|
|
371
371
|
#### Basic Example
|
|
372
372
|
|
|
373
373
|
```typescript
|
|
374
|
-
import {
|
|
374
|
+
import { BkTimePicker } from '@brickclay/ui';
|
|
375
375
|
|
|
376
376
|
@Component({
|
|
377
377
|
template: `
|
|
378
|
-
<
|
|
378
|
+
<bk-time-picker
|
|
379
379
|
[value]="selectedTime"
|
|
380
380
|
[label]="'Start Time'"
|
|
381
381
|
[timeFormat]="12"
|
|
382
382
|
(timeChange)="onTimeChange($event)"
|
|
383
383
|
>
|
|
384
|
-
</
|
|
384
|
+
</bk-time-picker>
|
|
385
385
|
`,
|
|
386
386
|
})
|
|
387
387
|
export class MyComponent {
|
|
@@ -396,7 +396,7 @@ export class MyComponent {
|
|
|
396
396
|
|
|
397
397
|
#### Component Selector
|
|
398
398
|
|
|
399
|
-
`<
|
|
399
|
+
`<bk-time-picker>`
|
|
400
400
|
|
|
401
401
|
#### Inputs
|
|
402
402
|
|
|
@@ -450,26 +450,26 @@ value = '23:45';
|
|
|
450
450
|
|
|
451
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
452
|
|
|
453
|
-
###
|
|
453
|
+
### BkToggle
|
|
454
454
|
|
|
455
455
|
A standalone toggle component that implements `ControlValueAccessor` for seamless Angular forms integration.
|
|
456
456
|
|
|
457
457
|
#### Basic Example
|
|
458
458
|
|
|
459
459
|
```typescript
|
|
460
|
-
import {
|
|
460
|
+
import { BkToggle } from '@brickclay/ui';
|
|
461
461
|
import { FormsModule } from '@angular/forms';
|
|
462
462
|
|
|
463
463
|
@Component({
|
|
464
464
|
template: `
|
|
465
|
-
<
|
|
465
|
+
<bk-toggle
|
|
466
466
|
[(ngModel)]="isEnabled"
|
|
467
467
|
[label]="'Enable notifications'"
|
|
468
468
|
(change)="onToggleChange($event)"
|
|
469
469
|
>
|
|
470
|
-
</
|
|
470
|
+
</bk-toggle>
|
|
471
471
|
`,
|
|
472
|
-
imports: [
|
|
472
|
+
imports: [BkToggle, FormsModule],
|
|
473
473
|
})
|
|
474
474
|
export class MyComponent {
|
|
475
475
|
isEnabled = false;
|
|
@@ -482,7 +482,7 @@ export class MyComponent {
|
|
|
482
482
|
|
|
483
483
|
#### Component Selector
|
|
484
484
|
|
|
485
|
-
`<
|
|
485
|
+
`<bk-toggle>`
|
|
486
486
|
|
|
487
487
|
#### Inputs
|
|
488
488
|
|
|
@@ -512,14 +512,14 @@ export class MyComponent {
|
|
|
512
512
|
**Basic Toggle with ngModel:**
|
|
513
513
|
|
|
514
514
|
```typescript
|
|
515
|
-
import {
|
|
515
|
+
import { BkToggle } from '@brickclay/ui';
|
|
516
516
|
import { FormsModule } from '@angular/forms';
|
|
517
517
|
|
|
518
518
|
@Component({
|
|
519
519
|
template: `
|
|
520
|
-
<
|
|
520
|
+
<bk-toggle [(ngModel)]="isActive" [label]="'Active Status'"> </bk-toggle>
|
|
521
521
|
`,
|
|
522
|
-
imports: [
|
|
522
|
+
imports: [BkToggle, FormsModule],
|
|
523
523
|
})
|
|
524
524
|
export class MyComponent {
|
|
525
525
|
isActive = true;
|
|
@@ -529,33 +529,33 @@ export class MyComponent {
|
|
|
529
529
|
**Different Sizes:**
|
|
530
530
|
|
|
531
531
|
```typescript
|
|
532
|
-
<
|
|
532
|
+
<bk-toggle
|
|
533
533
|
[(ngModel)]="value1"
|
|
534
534
|
[toggleClass]="'toggle-sm'"
|
|
535
535
|
[label]="'Small Toggle'">
|
|
536
|
-
</
|
|
536
|
+
</bk-toggle>
|
|
537
537
|
|
|
538
|
-
<
|
|
538
|
+
<bk-toggle
|
|
539
539
|
[(ngModel)]="value2"
|
|
540
540
|
[toggleClass]="'toggle-md'"
|
|
541
541
|
[label]="'Medium Toggle'">
|
|
542
|
-
</
|
|
542
|
+
</bk-toggle>
|
|
543
543
|
|
|
544
|
-
<
|
|
544
|
+
<bk-toggle
|
|
545
545
|
[(ngModel)]="value3"
|
|
546
546
|
[toggleClass]="'toggle-lg'"
|
|
547
547
|
[label]="'Large Toggle'">
|
|
548
|
-
</
|
|
548
|
+
</bk-toggle>
|
|
549
549
|
```
|
|
550
550
|
|
|
551
551
|
**Disabled State:**
|
|
552
552
|
|
|
553
553
|
```typescript
|
|
554
|
-
<
|
|
554
|
+
<bk-toggle
|
|
555
555
|
[ngModel]="true"
|
|
556
556
|
[disabled]="true"
|
|
557
557
|
[label]="'Disabled Toggle'">
|
|
558
|
-
</
|
|
558
|
+
</bk-toggle>
|
|
559
559
|
```
|
|
560
560
|
|
|
561
561
|
**With Event Handler:**
|
|
@@ -563,12 +563,12 @@ export class MyComponent {
|
|
|
563
563
|
```typescript
|
|
564
564
|
@Component({
|
|
565
565
|
template: `
|
|
566
|
-
<
|
|
566
|
+
<bk-toggle
|
|
567
567
|
[(ngModel)]="notificationsEnabled"
|
|
568
568
|
[label]="'Email Notifications'"
|
|
569
569
|
(change)="onNotificationToggle($event)"
|
|
570
570
|
>
|
|
571
|
-
</
|
|
571
|
+
</bk-toggle>
|
|
572
572
|
`,
|
|
573
573
|
})
|
|
574
574
|
export class MyComponent {
|
|
@@ -588,18 +588,18 @@ export class MyComponent {
|
|
|
588
588
|
|
|
589
589
|
```typescript
|
|
590
590
|
import { FormBuilder, FormGroup, ReactiveFormsModule } from '@angular/forms';
|
|
591
|
-
import {
|
|
591
|
+
import { BkToggle } from '@brickclay/ui';
|
|
592
592
|
|
|
593
593
|
@Component({
|
|
594
594
|
template: `
|
|
595
595
|
<form [formGroup]="settingsForm">
|
|
596
|
-
<
|
|
596
|
+
<bk-toggle formControlName="darkMode" [label]="'Dark Mode'"> </bk-toggle>
|
|
597
597
|
|
|
598
|
-
<
|
|
599
|
-
</
|
|
598
|
+
<bk-toggle formControlName="notifications" [label]="'Push Notifications'">
|
|
599
|
+
</bk-toggle>
|
|
600
600
|
</form>
|
|
601
601
|
`,
|
|
602
|
-
imports: [
|
|
602
|
+
imports: [BkToggle, ReactiveFormsModule],
|
|
603
603
|
})
|
|
604
604
|
export class SettingsComponent {
|
|
605
605
|
settingsForm: FormGroup;
|
|
@@ -616,10 +616,10 @@ export class SettingsComponent {
|
|
|
616
616
|
**Without Label:**
|
|
617
617
|
|
|
618
618
|
```typescript
|
|
619
|
-
<
|
|
619
|
+
<bk-toggle
|
|
620
620
|
[(ngModel)]="isEnabled"
|
|
621
621
|
[toggleClass]="'toggle-md'">
|
|
622
|
-
</
|
|
622
|
+
</bk-toggle>
|
|
623
623
|
```
|
|
624
624
|
|
|
625
625
|
#### Styling
|
|
@@ -653,26 +653,26 @@ The toggle component includes:
|
|
|
653
653
|
|
|
654
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
655
|
|
|
656
|
-
###
|
|
656
|
+
### BkCheckbox
|
|
657
657
|
|
|
658
658
|
A standalone checkbox component that implements `ControlValueAccessor` for seamless Angular forms integration.
|
|
659
659
|
|
|
660
660
|
#### Basic Example
|
|
661
661
|
|
|
662
662
|
```typescript
|
|
663
|
-
import {
|
|
663
|
+
import { BkCheckbox } from '@brickclay/ui';
|
|
664
664
|
import { FormsModule } from '@angular/forms';
|
|
665
665
|
|
|
666
666
|
@Component({
|
|
667
667
|
template: `
|
|
668
|
-
<
|
|
668
|
+
<bk-checkbox
|
|
669
669
|
[(ngModel)]="isAccepted"
|
|
670
670
|
[label]="'I agree to the terms and conditions'"
|
|
671
671
|
(change)="onCheckboxChange($event)"
|
|
672
672
|
>
|
|
673
|
-
</
|
|
673
|
+
</bk-checkbox>
|
|
674
674
|
`,
|
|
675
|
-
imports: [
|
|
675
|
+
imports: [BkCheckbox, FormsModule],
|
|
676
676
|
})
|
|
677
677
|
export class MyComponent {
|
|
678
678
|
isAccepted = false;
|
|
@@ -685,7 +685,7 @@ export class MyComponent {
|
|
|
685
685
|
|
|
686
686
|
#### Component Selector
|
|
687
687
|
|
|
688
|
-
`<
|
|
688
|
+
`<bk-checkbox>`
|
|
689
689
|
|
|
690
690
|
#### Inputs
|
|
691
691
|
|
|
@@ -717,14 +717,14 @@ export class MyComponent {
|
|
|
717
717
|
**Basic Checkbox with ngModel:**
|
|
718
718
|
|
|
719
719
|
```typescript
|
|
720
|
-
import {
|
|
720
|
+
import { BkCheckbox } from '@brickclay/ui';
|
|
721
721
|
import { FormsModule } from '@angular/forms';
|
|
722
722
|
|
|
723
723
|
@Component({
|
|
724
724
|
template: `
|
|
725
|
-
<
|
|
725
|
+
<bk-checkbox [(ngModel)]="isChecked" [label]="'Accept terms'"> </bk-checkbox>
|
|
726
726
|
`,
|
|
727
|
-
imports: [
|
|
727
|
+
imports: [BkCheckbox, FormsModule],
|
|
728
728
|
})
|
|
729
729
|
export class MyComponent {
|
|
730
730
|
isChecked = false;
|
|
@@ -735,43 +735,43 @@ export class MyComponent {
|
|
|
735
735
|
|
|
736
736
|
```typescript
|
|
737
737
|
<!-- Extra Small checkbox -->
|
|
738
|
-
<
|
|
738
|
+
<bk-checkbox
|
|
739
739
|
[(ngModel)]="value1"
|
|
740
740
|
[checkboxClass]="'xsm'"
|
|
741
741
|
[label]="'Extra Small Checkbox'">
|
|
742
|
-
</
|
|
742
|
+
</bk-checkbox>
|
|
743
743
|
|
|
744
744
|
<!-- Small checkbox -->
|
|
745
|
-
<
|
|
745
|
+
<bk-checkbox
|
|
746
746
|
[(ngModel)]="value2"
|
|
747
747
|
[checkboxClass]="'sm'"
|
|
748
748
|
[label]="'Small Checkbox'">
|
|
749
|
-
</
|
|
749
|
+
</bk-checkbox>
|
|
750
750
|
|
|
751
751
|
<!-- Medium checkbox -->
|
|
752
|
-
<
|
|
752
|
+
<bk-checkbox
|
|
753
753
|
[(ngModel)]="value3"
|
|
754
754
|
[checkboxClass]="'md'"
|
|
755
755
|
[label]="'Medium Checkbox'">
|
|
756
|
-
</
|
|
756
|
+
</bk-checkbox>
|
|
757
757
|
|
|
758
758
|
<!-- Large checkbox with custom label styling -->
|
|
759
|
-
<
|
|
759
|
+
<bk-checkbox
|
|
760
760
|
[(ngModel)]="value4"
|
|
761
761
|
[checkboxClass]="'lg'"
|
|
762
762
|
[labelClass]="'text-lg font-bold'"
|
|
763
763
|
[label]="'Large Checkbox'">
|
|
764
|
-
</
|
|
764
|
+
</bk-checkbox>
|
|
765
765
|
```
|
|
766
766
|
|
|
767
767
|
**Disabled State:**
|
|
768
768
|
|
|
769
769
|
```typescript
|
|
770
|
-
<
|
|
770
|
+
<bk-checkbox
|
|
771
771
|
[ngModel]="true"
|
|
772
772
|
[disabled]="true"
|
|
773
773
|
[label]="'Disabled Checkbox'">
|
|
774
|
-
</
|
|
774
|
+
</bk-checkbox>
|
|
775
775
|
```
|
|
776
776
|
|
|
777
777
|
**With Event Handler:**
|
|
@@ -779,12 +779,12 @@ export class MyComponent {
|
|
|
779
779
|
```typescript
|
|
780
780
|
@Component({
|
|
781
781
|
template: `
|
|
782
|
-
<
|
|
782
|
+
<bk-checkbox
|
|
783
783
|
[(ngModel)]="newsletterSubscribed"
|
|
784
784
|
[label]="'Subscribe to newsletter'"
|
|
785
785
|
(change)="onNewsletterToggle($event)"
|
|
786
786
|
>
|
|
787
|
-
</
|
|
787
|
+
</bk-checkbox>
|
|
788
788
|
`,
|
|
789
789
|
})
|
|
790
790
|
export class MyComponent {
|
|
@@ -804,22 +804,22 @@ export class MyComponent {
|
|
|
804
804
|
|
|
805
805
|
```typescript
|
|
806
806
|
import { FormBuilder, FormGroup, ReactiveFormsModule } from '@angular/forms';
|
|
807
|
-
import {
|
|
807
|
+
import { BkCheckbox } from '@brickclay/ui';
|
|
808
808
|
|
|
809
809
|
@Component({
|
|
810
810
|
template: `
|
|
811
811
|
<form [formGroup]="registrationForm">
|
|
812
|
-
<
|
|
812
|
+
<bk-checkbox
|
|
813
813
|
formControlName="acceptTerms"
|
|
814
814
|
[label]="'I accept the terms and conditions'"
|
|
815
815
|
>
|
|
816
|
-
</
|
|
816
|
+
</bk-checkbox>
|
|
817
817
|
|
|
818
|
-
<
|
|
819
|
-
</
|
|
818
|
+
<bk-checkbox formControlName="receiveUpdates" [label]="'Receive product updates'">
|
|
819
|
+
</bk-checkbox>
|
|
820
820
|
</form>
|
|
821
821
|
`,
|
|
822
|
-
imports: [
|
|
822
|
+
imports: [BkCheckbox, ReactiveFormsModule],
|
|
823
823
|
})
|
|
824
824
|
export class RegistrationComponent {
|
|
825
825
|
registrationForm: FormGroup;
|
|
@@ -836,10 +836,10 @@ export class RegistrationComponent {
|
|
|
836
836
|
**Without Label:**
|
|
837
837
|
|
|
838
838
|
```typescript
|
|
839
|
-
<
|
|
839
|
+
<bk-checkbox
|
|
840
840
|
[(ngModel)]="isSelected"
|
|
841
841
|
[checkboxClass]="'md'">
|
|
842
|
-
</
|
|
842
|
+
</bk-checkbox>
|
|
843
843
|
```
|
|
844
844
|
|
|
845
845
|
**Multiple Checkboxes:**
|
|
@@ -848,13 +848,13 @@ export class RegistrationComponent {
|
|
|
848
848
|
@Component({
|
|
849
849
|
template: `
|
|
850
850
|
<div>
|
|
851
|
-
<
|
|
851
|
+
<bk-checkbox
|
|
852
852
|
*ngFor="let option of options"
|
|
853
853
|
[(ngModel)]="option.selected"
|
|
854
854
|
[label]="option.label"
|
|
855
855
|
(change)="onOptionChange(option)"
|
|
856
856
|
>
|
|
857
|
-
</
|
|
857
|
+
</bk-checkbox>
|
|
858
858
|
</div>
|
|
859
859
|
`,
|
|
860
860
|
})
|
|
@@ -905,30 +905,30 @@ The checkbox component includes:
|
|
|
905
905
|
|
|
906
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
907
|
|
|
908
|
-
###
|
|
908
|
+
### BkRadioButton
|
|
909
909
|
|
|
910
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
911
|
|
|
912
912
|
#### Basic Example
|
|
913
913
|
|
|
914
914
|
```typescript
|
|
915
|
-
import {
|
|
915
|
+
import { BkRadioButton } from '@brickclay/ui';
|
|
916
916
|
import { FormsModule } from '@angular/forms';
|
|
917
917
|
|
|
918
918
|
@Component({
|
|
919
919
|
template: `
|
|
920
|
-
<
|
|
920
|
+
<bk-radio-button
|
|
921
921
|
[(ngModel)]="selectedOption"
|
|
922
922
|
[value]="'option1'"
|
|
923
923
|
[label]="'Option 1'"
|
|
924
924
|
(change)="onRadioChange($event)"
|
|
925
925
|
>
|
|
926
|
-
</
|
|
926
|
+
</bk-radio-button>
|
|
927
927
|
|
|
928
|
-
<
|
|
929
|
-
</
|
|
928
|
+
<bk-radio-button [(ngModel)]="selectedOption" [value]="'option2'" [label]="'Option 2'">
|
|
929
|
+
</bk-radio-button>
|
|
930
930
|
`,
|
|
931
|
-
imports: [
|
|
931
|
+
imports: [BkRadioButton, FormsModule],
|
|
932
932
|
})
|
|
933
933
|
export class MyComponent {
|
|
934
934
|
selectedOption = 'option1';
|
|
@@ -941,7 +941,7 @@ export class MyComponent {
|
|
|
941
941
|
|
|
942
942
|
#### Component Selector
|
|
943
943
|
|
|
944
|
-
`<
|
|
944
|
+
`<bk-radio-button>`
|
|
945
945
|
|
|
946
946
|
#### Inputs
|
|
947
947
|
|
|
@@ -977,25 +977,25 @@ export class MyComponent {
|
|
|
977
977
|
**Basic Radio Group with ngModel:**
|
|
978
978
|
|
|
979
979
|
```typescript
|
|
980
|
-
import {
|
|
980
|
+
import { BkRadioButton } from '@brickclay/ui';
|
|
981
981
|
import { FormsModule } from '@angular/forms';
|
|
982
982
|
|
|
983
983
|
@Component({
|
|
984
984
|
template: `
|
|
985
|
-
<
|
|
985
|
+
<bk-radio-button
|
|
986
986
|
[(ngModel)]="selectedPayment"
|
|
987
987
|
[value]="'credit'"
|
|
988
988
|
[label]="'Credit Card'"
|
|
989
989
|
>
|
|
990
|
-
</
|
|
990
|
+
</bk-radio-button>
|
|
991
991
|
|
|
992
|
-
<
|
|
993
|
-
</
|
|
992
|
+
<bk-radio-button [(ngModel)]="selectedPayment" [value]="'debit'" [label]="'Debit Card'">
|
|
993
|
+
</bk-radio-button>
|
|
994
994
|
|
|
995
|
-
<
|
|
996
|
-
</
|
|
995
|
+
<bk-radio-button [(ngModel)]="selectedPayment" [value]="'paypal'" [label]="'PayPal'">
|
|
996
|
+
</bk-radio-button>
|
|
997
997
|
`,
|
|
998
|
-
imports: [
|
|
998
|
+
imports: [BkRadioButton, FormsModule],
|
|
999
999
|
})
|
|
1000
1000
|
export class MyComponent {
|
|
1001
1001
|
selectedPayment = 'credit';
|
|
@@ -1005,71 +1005,71 @@ export class MyComponent {
|
|
|
1005
1005
|
**Dot Variant (Default):**
|
|
1006
1006
|
|
|
1007
1007
|
```typescript
|
|
1008
|
-
<
|
|
1008
|
+
<bk-radio-button
|
|
1009
1009
|
[(ngModel)]="selectedOption"
|
|
1010
1010
|
[value]="'option1'"
|
|
1011
1011
|
[variant]="'dot'"
|
|
1012
1012
|
[label]="'Option with Dot'">
|
|
1013
|
-
</
|
|
1013
|
+
</bk-radio-button>
|
|
1014
1014
|
```
|
|
1015
1015
|
|
|
1016
1016
|
**Tick Variant:**
|
|
1017
1017
|
|
|
1018
1018
|
```typescript
|
|
1019
|
-
<
|
|
1019
|
+
<bk-radio-button
|
|
1020
1020
|
[(ngModel)]="selectedOption"
|
|
1021
1021
|
[value]="'option2'"
|
|
1022
1022
|
[variant]="'tick'"
|
|
1023
1023
|
[label]="'Option with Tick'">
|
|
1024
|
-
</
|
|
1024
|
+
</bk-radio-button>
|
|
1025
1025
|
```
|
|
1026
1026
|
|
|
1027
1027
|
**Different Sizes:**
|
|
1028
1028
|
|
|
1029
1029
|
```typescript
|
|
1030
1030
|
<!-- Extra Small radio -->
|
|
1031
|
-
<
|
|
1031
|
+
<bk-radio-button
|
|
1032
1032
|
[(ngModel)]="selectedOption"
|
|
1033
1033
|
[value]="'xsm'"
|
|
1034
1034
|
[radioClass]="'xsm'"
|
|
1035
1035
|
[label]="'Extra Small Radio'">
|
|
1036
|
-
</
|
|
1036
|
+
</bk-radio-button>
|
|
1037
1037
|
|
|
1038
1038
|
<!-- Small radio -->
|
|
1039
|
-
<
|
|
1039
|
+
<bk-radio-button
|
|
1040
1040
|
[(ngModel)]="selectedOption"
|
|
1041
1041
|
[value]="'sm'"
|
|
1042
1042
|
[radioClass]="'sm'"
|
|
1043
1043
|
[label]="'Small Radio'">
|
|
1044
|
-
</
|
|
1044
|
+
</bk-radio-button>
|
|
1045
1045
|
|
|
1046
1046
|
<!-- Medium radio -->
|
|
1047
|
-
<
|
|
1047
|
+
<bk-radio-button
|
|
1048
1048
|
[(ngModel)]="selectedOption"
|
|
1049
1049
|
[value]="'md'"
|
|
1050
1050
|
[radioClass]="'md'"
|
|
1051
1051
|
[label]="'Medium Radio'">
|
|
1052
|
-
</
|
|
1052
|
+
</bk-radio-button>
|
|
1053
1053
|
|
|
1054
1054
|
<!-- Large radio with custom label styling -->
|
|
1055
|
-
<
|
|
1055
|
+
<bk-radio-button
|
|
1056
1056
|
[(ngModel)]="selectedOption"
|
|
1057
1057
|
[value]="'lg'"
|
|
1058
1058
|
[radioClass]="'lg'"
|
|
1059
1059
|
[labelClass]="'text-lg font-bold'"
|
|
1060
1060
|
[label]="'Large Radio'">
|
|
1061
|
-
</
|
|
1061
|
+
</bk-radio-button>
|
|
1062
1062
|
```
|
|
1063
1063
|
|
|
1064
1064
|
**Disabled State:**
|
|
1065
1065
|
|
|
1066
1066
|
```typescript
|
|
1067
|
-
<
|
|
1067
|
+
<bk-radio-button
|
|
1068
1068
|
[(ngModel)]="selectedOption"
|
|
1069
1069
|
[value]="'disabled-option'"
|
|
1070
1070
|
[disabled]="true"
|
|
1071
1071
|
[label]="'Disabled Option'">
|
|
1072
|
-
</
|
|
1072
|
+
</bk-radio-button>
|
|
1073
1073
|
```
|
|
1074
1074
|
|
|
1075
1075
|
**With Event Handler:**
|
|
@@ -1077,14 +1077,14 @@ export class MyComponent {
|
|
|
1077
1077
|
```typescript
|
|
1078
1078
|
@Component({
|
|
1079
1079
|
template: `
|
|
1080
|
-
<
|
|
1080
|
+
<bk-radio-button
|
|
1081
1081
|
*ngFor="let option of options"
|
|
1082
1082
|
[(ngModel)]="selectedOption"
|
|
1083
1083
|
[value]="option.value"
|
|
1084
1084
|
[label]="option.label"
|
|
1085
1085
|
(change)="onOptionChange($event)"
|
|
1086
1086
|
>
|
|
1087
|
-
</
|
|
1087
|
+
</bk-radio-button>
|
|
1088
1088
|
`,
|
|
1089
1089
|
})
|
|
1090
1090
|
export class MyComponent {
|
|
@@ -1105,22 +1105,22 @@ export class MyComponent {
|
|
|
1105
1105
|
|
|
1106
1106
|
```typescript
|
|
1107
1107
|
import { FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms';
|
|
1108
|
-
import {
|
|
1108
|
+
import { BkRadioButton } from '@brickclay/ui';
|
|
1109
1109
|
|
|
1110
1110
|
@Component({
|
|
1111
1111
|
template: `
|
|
1112
1112
|
<form [formGroup]="surveyForm">
|
|
1113
|
-
<
|
|
1114
|
-
</
|
|
1113
|
+
<bk-radio-button formControlName="rating" [value]="'excellent'" [label]="'Excellent'">
|
|
1114
|
+
</bk-radio-button>
|
|
1115
1115
|
|
|
1116
|
-
<
|
|
1117
|
-
</
|
|
1116
|
+
<bk-radio-button formControlName="rating" [value]="'good'" [label]="'Good'">
|
|
1117
|
+
</bk-radio-button>
|
|
1118
1118
|
|
|
1119
|
-
<
|
|
1120
|
-
</
|
|
1119
|
+
<bk-radio-button formControlName="rating" [value]="'fair'" [label]="'Fair'">
|
|
1120
|
+
</bk-radio-button>
|
|
1121
1121
|
</form>
|
|
1122
1122
|
`,
|
|
1123
|
-
imports: [
|
|
1123
|
+
imports: [BkRadioButton, ReactiveFormsModule],
|
|
1124
1124
|
})
|
|
1125
1125
|
export class SurveyComponent {
|
|
1126
1126
|
surveyForm: FormGroup;
|
|
@@ -1136,11 +1136,11 @@ export class SurveyComponent {
|
|
|
1136
1136
|
**Without Label:**
|
|
1137
1137
|
|
|
1138
1138
|
```typescript
|
|
1139
|
-
<
|
|
1139
|
+
<bk-radio-button
|
|
1140
1140
|
[(ngModel)]="selectedOption"
|
|
1141
1141
|
[value]="'option1'"
|
|
1142
1142
|
[radioClass]="'md'">
|
|
1143
|
-
</
|
|
1143
|
+
</bk-radio-button>
|
|
1144
1144
|
```
|
|
1145
1145
|
|
|
1146
1146
|
**Dynamic Radio Group:**
|
|
@@ -1149,14 +1149,14 @@ export class SurveyComponent {
|
|
|
1149
1149
|
@Component({
|
|
1150
1150
|
template: `
|
|
1151
1151
|
<div>
|
|
1152
|
-
<
|
|
1152
|
+
<bk-radio-button
|
|
1153
1153
|
*ngFor="let item of items"
|
|
1154
1154
|
[(ngModel)]="selectedItem"
|
|
1155
1155
|
[value]="item.id"
|
|
1156
1156
|
[label]="item.name"
|
|
1157
1157
|
[variant]="item.variant || 'dot'"
|
|
1158
1158
|
>
|
|
1159
|
-
</
|
|
1159
|
+
</bk-radio-button>
|
|
1160
1160
|
</div>
|
|
1161
1161
|
`,
|
|
1162
1162
|
})
|
|
@@ -1210,27 +1210,27 @@ Radio buttons are automatically grouped when they share the same `ngModel` bindi
|
|
|
1210
1210
|
|
|
1211
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
1212
|
|
|
1213
|
-
###
|
|
1213
|
+
### BkPill
|
|
1214
1214
|
|
|
1215
1215
|
A standalone pill component that displays text labels with customizable styling and optional removal functionality.
|
|
1216
1216
|
|
|
1217
1217
|
#### Basic Example
|
|
1218
1218
|
|
|
1219
1219
|
```typescript
|
|
1220
|
-
import {
|
|
1220
|
+
import { BkPill } from '@brickclay/ui';
|
|
1221
1221
|
|
|
1222
1222
|
@Component({
|
|
1223
1223
|
template: `
|
|
1224
|
-
<
|
|
1224
|
+
<bk-pill
|
|
1225
1225
|
[label]="'New Feature'"
|
|
1226
1226
|
[variant]="'Solid'"
|
|
1227
1227
|
[color]="'Primary'"
|
|
1228
1228
|
[size]="'md'"
|
|
1229
1229
|
(clicked)="onPillRemoved($event)"
|
|
1230
1230
|
>
|
|
1231
|
-
</
|
|
1231
|
+
</bk-pill>
|
|
1232
1232
|
`,
|
|
1233
|
-
imports: [
|
|
1233
|
+
imports: [BkPill],
|
|
1234
1234
|
})
|
|
1235
1235
|
export class MyComponent {
|
|
1236
1236
|
onPillRemoved(label: string) {
|
|
@@ -1241,7 +1241,7 @@ export class MyComponent {
|
|
|
1241
1241
|
|
|
1242
1242
|
#### Component Selector
|
|
1243
1243
|
|
|
1244
|
-
`<
|
|
1244
|
+
`<bk-pill>`
|
|
1245
1245
|
|
|
1246
1246
|
#### Inputs
|
|
1247
1247
|
|
|
@@ -1276,13 +1276,13 @@ export class MyComponent {
|
|
|
1276
1276
|
**Basic Pill:**
|
|
1277
1277
|
|
|
1278
1278
|
```typescript
|
|
1279
|
-
import {
|
|
1279
|
+
import { BkPill } from '@brickclay/ui';
|
|
1280
1280
|
|
|
1281
1281
|
@Component({
|
|
1282
1282
|
template: `
|
|
1283
|
-
<
|
|
1283
|
+
<bk-pill [label]="'Status'" [color]="'Success'"> </bk-pill>
|
|
1284
1284
|
`,
|
|
1285
|
-
imports: [
|
|
1285
|
+
imports: [BkPill],
|
|
1286
1286
|
})
|
|
1287
1287
|
export class MyComponent {}
|
|
1288
1288
|
```
|
|
@@ -1291,78 +1291,78 @@ export class MyComponent {}
|
|
|
1291
1291
|
|
|
1292
1292
|
```typescript
|
|
1293
1293
|
<!-- Light variant -->
|
|
1294
|
-
<
|
|
1294
|
+
<bk-pill
|
|
1295
1295
|
[label]="'Light Pill'"
|
|
1296
1296
|
[variant]="'Light'"
|
|
1297
1297
|
[color]="'Primary'">
|
|
1298
|
-
</
|
|
1298
|
+
</bk-pill>
|
|
1299
1299
|
|
|
1300
1300
|
<!-- Solid variant -->
|
|
1301
|
-
<
|
|
1301
|
+
<bk-pill
|
|
1302
1302
|
[label]="'Solid Pill'"
|
|
1303
1303
|
[variant]="'Solid'"
|
|
1304
1304
|
[color]="'Primary'">
|
|
1305
|
-
</
|
|
1305
|
+
</bk-pill>
|
|
1306
1306
|
|
|
1307
1307
|
<!-- Outline variant -->
|
|
1308
|
-
<
|
|
1308
|
+
<bk-pill
|
|
1309
1309
|
[label]="'Outline Pill'"
|
|
1310
1310
|
[variant]="'Outline'"
|
|
1311
1311
|
[color]="'Primary'">
|
|
1312
|
-
</
|
|
1312
|
+
</bk-pill>
|
|
1313
1313
|
|
|
1314
1314
|
<!-- Transparent variant -->
|
|
1315
|
-
<
|
|
1315
|
+
<bk-pill
|
|
1316
1316
|
[label]="'Transparent Pill'"
|
|
1317
1317
|
[variant]="'Transparent'"
|
|
1318
1318
|
[color]="'Primary'">
|
|
1319
|
-
</
|
|
1319
|
+
</bk-pill>
|
|
1320
1320
|
```
|
|
1321
1321
|
|
|
1322
1322
|
**Different Colors:**
|
|
1323
1323
|
|
|
1324
1324
|
```typescript
|
|
1325
|
-
<
|
|
1326
|
-
<
|
|
1327
|
-
<
|
|
1328
|
-
<
|
|
1329
|
-
<
|
|
1330
|
-
<
|
|
1331
|
-
<
|
|
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
1332
|
```
|
|
1333
1333
|
|
|
1334
1334
|
**Different Sizes:**
|
|
1335
1335
|
|
|
1336
1336
|
```typescript
|
|
1337
1337
|
<!-- Extra Small -->
|
|
1338
|
-
<
|
|
1338
|
+
<bk-pill [label]="'XSM'" [size]="'xsm'"> </bk-pill>
|
|
1339
1339
|
|
|
1340
1340
|
<!-- Small -->
|
|
1341
|
-
<
|
|
1341
|
+
<bk-pill [label]="'SM'" [size]="'sm'"> </bk-pill>
|
|
1342
1342
|
|
|
1343
1343
|
<!-- Medium -->
|
|
1344
|
-
<
|
|
1344
|
+
<bk-pill [label]="'MD'" [size]="'md'"> </bk-pill>
|
|
1345
1345
|
|
|
1346
1346
|
<!-- Large -->
|
|
1347
|
-
<
|
|
1347
|
+
<bk-pill [label]="'LG'" [size]="'lg'"> </bk-pill>
|
|
1348
1348
|
```
|
|
1349
1349
|
|
|
1350
1350
|
**With Dot Indicators:**
|
|
1351
1351
|
|
|
1352
1352
|
```typescript
|
|
1353
1353
|
<!-- Dot on left -->
|
|
1354
|
-
<
|
|
1354
|
+
<bk-pill
|
|
1355
1355
|
[label]="'Active'"
|
|
1356
1356
|
[dot]="'left'"
|
|
1357
1357
|
[color]="'Success'">
|
|
1358
|
-
</
|
|
1358
|
+
</bk-pill>
|
|
1359
1359
|
|
|
1360
1360
|
<!-- Dot on right -->
|
|
1361
|
-
<
|
|
1361
|
+
<bk-pill
|
|
1362
1362
|
[label]="'Pending'"
|
|
1363
1363
|
[dot]="'right'"
|
|
1364
1364
|
[color]="'Warning'">
|
|
1365
|
-
</
|
|
1365
|
+
</bk-pill>
|
|
1366
1366
|
```
|
|
1367
1367
|
|
|
1368
1368
|
**Removable Pill:**
|
|
@@ -1370,11 +1370,11 @@ export class MyComponent {}
|
|
|
1370
1370
|
```typescript
|
|
1371
1371
|
@Component({
|
|
1372
1372
|
template: `
|
|
1373
|
-
<
|
|
1373
|
+
<bk-pill
|
|
1374
1374
|
[label]="'Removable Tag'"
|
|
1375
1375
|
[removable]="true"
|
|
1376
1376
|
(clicked)="onRemoveTag($event)">
|
|
1377
|
-
</
|
|
1377
|
+
</bk-pill>
|
|
1378
1378
|
`,
|
|
1379
1379
|
})
|
|
1380
1380
|
export class MyComponent {
|
|
@@ -1391,13 +1391,13 @@ export class MyComponent {
|
|
|
1391
1391
|
@Component({
|
|
1392
1392
|
template: `
|
|
1393
1393
|
<div>
|
|
1394
|
-
<
|
|
1394
|
+
<bk-pill
|
|
1395
1395
|
*ngFor="let tag of tags"
|
|
1396
1396
|
[label]="tag"
|
|
1397
1397
|
[removable]="true"
|
|
1398
1398
|
[color]="getTagColor(tag)"
|
|
1399
1399
|
(clicked)="removeTag(tag)">
|
|
1400
|
-
</
|
|
1400
|
+
</bk-pill>
|
|
1401
1401
|
</div>
|
|
1402
1402
|
`,
|
|
1403
1403
|
})
|
|
@@ -1418,10 +1418,10 @@ export class MyComponent {
|
|
|
1418
1418
|
**With Custom Classes:**
|
|
1419
1419
|
|
|
1420
1420
|
```typescript
|
|
1421
|
-
<
|
|
1421
|
+
<bk-pill
|
|
1422
1422
|
[label]="'Custom Styled'"
|
|
1423
1423
|
[customClass]="'my-custom-class font-bold'">
|
|
1424
|
-
</
|
|
1424
|
+
</bk-pill>
|
|
1425
1425
|
```
|
|
1426
1426
|
|
|
1427
1427
|
#### Styling
|
|
@@ -1453,20 +1453,20 @@ A standalone badge component that displays text labels with customizable styling
|
|
|
1453
1453
|
#### Basic Example
|
|
1454
1454
|
|
|
1455
1455
|
```typescript
|
|
1456
|
-
import {
|
|
1456
|
+
import { BkBadge } from '@brickclay/ui';
|
|
1457
1457
|
|
|
1458
1458
|
@Component({
|
|
1459
1459
|
template: `
|
|
1460
|
-
<
|
|
1460
|
+
<bk-badge
|
|
1461
1461
|
[label]="'New'"
|
|
1462
1462
|
[variant]="'Solid'"
|
|
1463
1463
|
[color]="'Primary'"
|
|
1464
1464
|
[size]="'md'"
|
|
1465
1465
|
(clicked)="onBadgeRemoved($event)"
|
|
1466
1466
|
>
|
|
1467
|
-
</
|
|
1467
|
+
</bk-badge>
|
|
1468
1468
|
`,
|
|
1469
|
-
imports: [
|
|
1469
|
+
imports: [BkBadge],
|
|
1470
1470
|
})
|
|
1471
1471
|
export class MyComponent {
|
|
1472
1472
|
onBadgeRemoved(label: string) {
|
|
@@ -1477,7 +1477,7 @@ export class MyComponent {
|
|
|
1477
1477
|
|
|
1478
1478
|
#### Component Selector
|
|
1479
1479
|
|
|
1480
|
-
`<
|
|
1480
|
+
`<bk-badge>`
|
|
1481
1481
|
|
|
1482
1482
|
#### Inputs
|
|
1483
1483
|
|
|
@@ -1512,13 +1512,13 @@ export class MyComponent {
|
|
|
1512
1512
|
**Basic Badge:**
|
|
1513
1513
|
|
|
1514
1514
|
```typescript
|
|
1515
|
-
import {
|
|
1515
|
+
import { BkBadge } from '@brickclay/ui';
|
|
1516
1516
|
|
|
1517
1517
|
@Component({
|
|
1518
1518
|
template: `
|
|
1519
|
-
<
|
|
1519
|
+
<bk-badge [label]="'New'" [color]="'Success'"> </bk-badge>
|
|
1520
1520
|
`,
|
|
1521
|
-
imports: [
|
|
1521
|
+
imports: [BkBadge],
|
|
1522
1522
|
})
|
|
1523
1523
|
export class MyComponent {}
|
|
1524
1524
|
```
|
|
@@ -1527,78 +1527,78 @@ export class MyComponent {}
|
|
|
1527
1527
|
|
|
1528
1528
|
```typescript
|
|
1529
1529
|
<!-- Light variant -->
|
|
1530
|
-
<
|
|
1530
|
+
<bk-badge
|
|
1531
1531
|
[label]="'Light Badge'"
|
|
1532
1532
|
[variant]="'Light'"
|
|
1533
1533
|
[color]="'Primary'">
|
|
1534
|
-
</
|
|
1534
|
+
</bk-badge>
|
|
1535
1535
|
|
|
1536
1536
|
<!-- Solid variant -->
|
|
1537
|
-
<
|
|
1537
|
+
<bk-badge
|
|
1538
1538
|
[label]="'Solid Badge'"
|
|
1539
1539
|
[variant]="'Solid'"
|
|
1540
1540
|
[color]="'Primary'">
|
|
1541
|
-
</
|
|
1541
|
+
</bk-badge>
|
|
1542
1542
|
|
|
1543
1543
|
<!-- Outline variant -->
|
|
1544
|
-
<
|
|
1544
|
+
<bk-badge
|
|
1545
1545
|
[label]="'Outline Badge'"
|
|
1546
1546
|
[variant]="'Outline'"
|
|
1547
1547
|
[color]="'Primary'">
|
|
1548
|
-
</
|
|
1548
|
+
</bk-badge>
|
|
1549
1549
|
|
|
1550
1550
|
<!-- Transparent variant -->
|
|
1551
|
-
<
|
|
1551
|
+
<bk-badge
|
|
1552
1552
|
[label]="'Transparent Badge'"
|
|
1553
1553
|
[variant]="'Transparent'"
|
|
1554
1554
|
[color]="'Primary'">
|
|
1555
|
-
</
|
|
1555
|
+
</bk-badge>
|
|
1556
1556
|
```
|
|
1557
1557
|
|
|
1558
1558
|
**Different Colors:**
|
|
1559
1559
|
|
|
1560
1560
|
```typescript
|
|
1561
|
-
<
|
|
1562
|
-
<
|
|
1563
|
-
<
|
|
1564
|
-
<
|
|
1565
|
-
<
|
|
1566
|
-
<
|
|
1567
|
-
<
|
|
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
1568
|
```
|
|
1569
1569
|
|
|
1570
1570
|
**Different Sizes:**
|
|
1571
1571
|
|
|
1572
1572
|
```typescript
|
|
1573
1573
|
<!-- Extra Small -->
|
|
1574
|
-
<
|
|
1574
|
+
<bk-badge [label]="'XSM'" [size]="'xsm'"> </bk-badge>
|
|
1575
1575
|
|
|
1576
1576
|
<!-- Small -->
|
|
1577
|
-
<
|
|
1577
|
+
<bk-badge [label]="'SM'" [size]="'sm'"> </bk-badge>
|
|
1578
1578
|
|
|
1579
1579
|
<!-- Medium -->
|
|
1580
|
-
<
|
|
1580
|
+
<bk-badge [label]="'MD'" [size]="'md'"> </bk-badge>
|
|
1581
1581
|
|
|
1582
1582
|
<!-- Large -->
|
|
1583
|
-
<
|
|
1583
|
+
<bk-badge [label]="'LG'" [size]="'lg'"> </bk-badge>
|
|
1584
1584
|
```
|
|
1585
1585
|
|
|
1586
1586
|
**With Dot Indicators:**
|
|
1587
1587
|
|
|
1588
1588
|
```typescript
|
|
1589
1589
|
<!-- Dot on left -->
|
|
1590
|
-
<
|
|
1590
|
+
<bk-badge
|
|
1591
1591
|
[label]="'Active'"
|
|
1592
1592
|
[dot]="'left'"
|
|
1593
1593
|
[color]="'Success'">
|
|
1594
|
-
</
|
|
1594
|
+
</bk-badge>
|
|
1595
1595
|
|
|
1596
1596
|
<!-- Dot on right -->
|
|
1597
|
-
<
|
|
1597
|
+
<bk-badge
|
|
1598
1598
|
[label]="'Pending'"
|
|
1599
1599
|
[dot]="'right'"
|
|
1600
1600
|
[color]="'Warning'">
|
|
1601
|
-
</
|
|
1601
|
+
</bk-badge>
|
|
1602
1602
|
```
|
|
1603
1603
|
|
|
1604
1604
|
**Removable Badge:**
|
|
@@ -1606,11 +1606,11 @@ export class MyComponent {}
|
|
|
1606
1606
|
```typescript
|
|
1607
1607
|
@Component({
|
|
1608
1608
|
template: `
|
|
1609
|
-
<
|
|
1609
|
+
<bk-badge
|
|
1610
1610
|
[label]="'Removable Tag'"
|
|
1611
1611
|
[removable]="true"
|
|
1612
1612
|
(clicked)="onRemoveTag($event)">
|
|
1613
|
-
</
|
|
1613
|
+
</bk-badge>
|
|
1614
1614
|
`,
|
|
1615
1615
|
})
|
|
1616
1616
|
export class MyComponent {
|
|
@@ -1627,13 +1627,13 @@ export class MyComponent {
|
|
|
1627
1627
|
@Component({
|
|
1628
1628
|
template: `
|
|
1629
1629
|
<div>
|
|
1630
|
-
<
|
|
1630
|
+
<bk-badge
|
|
1631
1631
|
*ngFor="let tag of tags"
|
|
1632
1632
|
[label]="tag"
|
|
1633
1633
|
[removable]="true"
|
|
1634
1634
|
[color]="getTagColor(tag)"
|
|
1635
1635
|
(clicked)="removeTag(tag)">
|
|
1636
|
-
</
|
|
1636
|
+
</bk-badge>
|
|
1637
1637
|
</div>
|
|
1638
1638
|
`,
|
|
1639
1639
|
})
|
|
@@ -1654,10 +1654,10 @@ export class MyComponent {
|
|
|
1654
1654
|
**With Custom Classes:**
|
|
1655
1655
|
|
|
1656
1656
|
```typescript
|
|
1657
|
-
<
|
|
1657
|
+
<bk-badge
|
|
1658
1658
|
[label]="'Custom Styled'"
|
|
1659
1659
|
[customClass]="'my-custom-class font-bold'">
|
|
1660
|
-
</
|
|
1660
|
+
</bk-badge>
|
|
1661
1661
|
```
|
|
1662
1662
|
|
|
1663
1663
|
#### Styling
|
|
@@ -1739,7 +1739,7 @@ interface ScheduledDateSelection {
|
|
|
1739
1739
|
|
|
1740
1740
|
```typescript
|
|
1741
1741
|
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
|
1742
|
-
import {
|
|
1742
|
+
import { BkCustomCalendar } from '@brickclay/ui';
|
|
1743
1743
|
|
|
1744
1744
|
export class BookingFormComponent {
|
|
1745
1745
|
bookingForm: FormGroup;
|
|
@@ -1763,10 +1763,10 @@ export class BookingFormComponent {
|
|
|
1763
1763
|
### Reactive Forms
|
|
1764
1764
|
|
|
1765
1765
|
```typescript
|
|
1766
|
-
<
|
|
1766
|
+
<bk-custom-calendar
|
|
1767
1767
|
[selectedValue]="form.get('dateRange')?.value"
|
|
1768
1768
|
(selected)="form.patchValue({ dateRange: $event })">
|
|
1769
|
-
</
|
|
1769
|
+
</bk-custom-calendar>
|
|
1770
1770
|
```
|
|
1771
1771
|
|
|
1772
1772
|
### Date Filtering
|
|
@@ -1813,7 +1813,7 @@ node_modules/@brickclay/ui/assets/calender/* → your-app/public/assets/calender
|
|
|
1813
1813
|
|
|
1814
1814
|
### CalendarManagerService
|
|
1815
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 `
|
|
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
1817
|
|
|
1818
1818
|
## 🌐 Browser Support
|
|
1819
1819
|
|