@brickclay-org/ui 0.0.39 → 0.0.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/ASSETS_SETUP.md +59 -0
  2. package/ng-package.json +29 -0
  3. package/package.json +15 -26
  4. package/src/lib/assets/icons.ts +8 -0
  5. package/src/lib/badge/badge.html +24 -0
  6. package/src/lib/badge/badge.ts +42 -0
  7. package/src/lib/brickclay-lib.spec.ts +23 -0
  8. package/src/lib/brickclay-lib.ts +15 -0
  9. package/src/lib/button-group/button-group.html +12 -0
  10. package/src/lib/button-group/button-group.ts +73 -0
  11. package/src/lib/calender/calendar.module.ts +35 -0
  12. package/src/lib/calender/components/custom-calendar/custom-calendar.component.css +698 -0
  13. package/src/lib/calender/components/custom-calendar/custom-calendar.component.html +230 -0
  14. package/src/lib/calender/components/custom-calendar/custom-calendar.component.spec.ts +23 -0
  15. package/src/lib/calender/components/custom-calendar/custom-calendar.component.ts +1554 -0
  16. package/src/lib/calender/components/scheduled-date-picker/scheduled-date-picker.component.css +373 -0
  17. package/src/lib/calender/components/scheduled-date-picker/scheduled-date-picker.component.html +210 -0
  18. package/src/lib/calender/components/scheduled-date-picker/scheduled-date-picker.component.ts +361 -0
  19. package/src/lib/calender/components/time-picker/time-picker.component.css +174 -0
  20. package/src/lib/calender/components/time-picker/time-picker.component.html +60 -0
  21. package/src/lib/calender/components/time-picker/time-picker.component.ts +283 -0
  22. package/src/lib/calender/services/calendar-manager.service.ts +45 -0
  23. package/src/lib/checkbox/checkbox.html +42 -0
  24. package/src/lib/checkbox/checkbox.ts +67 -0
  25. package/src/lib/chips/chips.html +74 -0
  26. package/src/lib/chips/chips.ts +222 -0
  27. package/src/lib/grid/components/grid/grid.html +97 -0
  28. package/src/lib/grid/components/grid/grid.ts +139 -0
  29. package/src/lib/grid/models/grid.model.ts +20 -0
  30. package/src/lib/input/input.html +127 -0
  31. package/src/lib/input/input.ts +394 -0
  32. package/src/lib/pill/pill.html +24 -0
  33. package/src/lib/pill/pill.ts +39 -0
  34. package/src/lib/radio/radio.html +58 -0
  35. package/src/lib/radio/radio.ts +72 -0
  36. package/src/lib/select/select.html +111 -0
  37. package/src/lib/select/select.ts +401 -0
  38. package/src/lib/spinner/spinner.html +5 -0
  39. package/src/lib/spinner/spinner.ts +22 -0
  40. package/src/lib/tabs/tabs.html +28 -0
  41. package/src/lib/tabs/tabs.ts +48 -0
  42. package/src/lib/textarea/textarea.html +80 -0
  43. package/src/lib/textarea/textarea.ts +172 -0
  44. package/src/lib/toggle/toggle.html +24 -0
  45. package/src/lib/toggle/toggle.ts +62 -0
  46. package/src/lib/ui-button/ui-button.html +25 -0
  47. package/src/lib/ui-button/ui-button.ts +55 -0
  48. package/src/lib/ui-icon-button/ui-icon-button.html +7 -0
  49. package/src/lib/ui-icon-button/ui-icon-button.ts +38 -0
  50. package/src/public-api.ts +43 -0
  51. package/tsconfig.lib.json +19 -0
  52. package/tsconfig.lib.prod.json +11 -0
  53. package/tsconfig.spec.json +15 -0
  54. package/fesm2022/brickclay-org-ui.mjs +0 -4035
  55. package/fesm2022/brickclay-org-ui.mjs.map +0 -1
  56. package/index.d.ts +0 -857
@@ -0,0 +1,172 @@
1
+ import { Component, EventEmitter, Input, Optional, Output, Self } from '@angular/core';
2
+ import { ControlValueAccessor, FormsModule, NgControl } from '@angular/forms';
3
+ import { CommonModule } from '@angular/common';
4
+ export type BkTextAreaAutoComplete =
5
+ | 'on'
6
+ | 'off'
7
+ | 'name'
8
+ | 'honorific-prefix'
9
+ | 'given-name'
10
+ | 'additional-name'
11
+ | 'family-name'
12
+ | 'honorific-suffix'
13
+ | 'nickname'
14
+ | 'email'
15
+ | 'username'
16
+ | 'new-password'
17
+ | 'current-password'
18
+ | 'organization-title'
19
+ | 'organization'
20
+ | 'street-address'
21
+ | 'address-line1'
22
+ | 'address-line2'
23
+ | 'address-line3'
24
+ | 'address-level4'
25
+ | 'address-level3'
26
+ | 'address-level2'
27
+ | 'address-level1'
28
+ | 'country'
29
+ | 'country-name'
30
+ | 'postal-code'
31
+ | 'cc-name'
32
+ | 'cc-given-name'
33
+ | 'cc-additional-name'
34
+ | 'cc-family-name'
35
+ | 'cc-number'
36
+ | 'cc-exp'
37
+ | 'cc-exp-month'
38
+ | 'cc-exp-year'
39
+ | 'cc-csc'
40
+ | 'cc-type'
41
+ | 'transaction-currency'
42
+ | 'transaction-amount'
43
+ | 'language'
44
+ | 'bday'
45
+ | 'bday-day'
46
+ | 'bday-month'
47
+ | 'bday-year'
48
+ | 'sex'
49
+ | 'tel'
50
+ | 'tel-country-code'
51
+ | 'tel-national'
52
+ | 'tel-area-code'
53
+ | 'tel-local'
54
+ | 'tel-extension'
55
+ | 'impp'
56
+ | 'url'
57
+ | 'photo';
58
+
59
+ export type BkTextAreaAutoCapitalize =
60
+ | 'off'
61
+ | 'none'
62
+ | 'on'
63
+ | 'sentences'
64
+ | 'words'
65
+ | 'characters';
66
+
67
+ export type BkTextAreaInputMode =
68
+ | 'none'
69
+ | 'text'
70
+ | 'tel'
71
+ | 'url'
72
+ | 'email'
73
+ | 'numeric'
74
+ | 'decimal'
75
+ | 'search';
76
+ @Component({
77
+ selector: 'bk-textarea',
78
+ standalone: true,
79
+ imports: [CommonModule, FormsModule],
80
+ templateUrl: './textarea.html'
81
+ })
82
+ export class BkTextarea implements ControlValueAccessor {
83
+ @Input() autoComplete : BkTextAreaAutoComplete = 'off';
84
+ @Input() name!: string;
85
+ @Input() id!: string;
86
+ @Input() label: string = '';
87
+ @Input() placeholder: string = '';
88
+ @Input() rows: number = 4;
89
+ @Input() hint: string = '';
90
+ @Input() required: boolean = false;
91
+ @Input() maxlength: number | null = null;
92
+ @Input() minlength: number | null = null;
93
+ @Input() hasError: boolean | null = false;
94
+ @Input() disabled: boolean = false;
95
+ @Input() errorMessage: string = '';
96
+ @Input() tabIndex: number | null = null;
97
+ @Input() readOnly: boolean = false;
98
+ @Input() autoCapitalize: BkTextAreaAutoCapitalize | null = null;
99
+ @Input() inputMode: BkTextAreaInputMode | null = null;
100
+ @Output() input = new EventEmitter<Event>();
101
+ @Output() change = new EventEmitter<Event>();
102
+ @Output() blur = new EventEmitter<Event>();
103
+ @Output() focus = new EventEmitter<Event>();
104
+ value: string = '';
105
+
106
+
107
+ // --- ControlValueAccessor ---
108
+ onChange = (_: any) => {};
109
+ onTouched = () => {};
110
+
111
+ constructor(@Optional() @Self() private ngControl: NgControl) {
112
+ if (this.ngControl) {
113
+ this.ngControl.valueAccessor = this;
114
+ }
115
+ }
116
+
117
+
118
+
119
+ // --- Expose FormControl state ---
120
+ get control(): any {
121
+ return this.ngControl?.control;
122
+ }
123
+
124
+ get touched(): boolean {
125
+ return this.control?.touched;
126
+ }
127
+
128
+ get dirty(): boolean {
129
+ return this.control?.dirty;
130
+ }
131
+
132
+ get errors(): any {
133
+ return this.control?.errors;
134
+ }
135
+
136
+
137
+
138
+
139
+ handleFocus(event: Event): void {
140
+ this.focus.emit(event);
141
+ }
142
+
143
+ handleBlur(event:Event): void {
144
+ this.onTouched();
145
+ this.blur.emit(event);
146
+ }
147
+ handleInput(event: Event): void {
148
+ const val = (event.target as HTMLInputElement).value;
149
+ this.value = val; // update CVA value
150
+ this.onChange(val); // propagate to parent form
151
+ this.input.emit(event); // emit raw event
152
+ }
153
+
154
+ handleChange(event: Event) {
155
+ this.change.emit(event); // emit raw change event
156
+ }
157
+
158
+
159
+ writeValue(value: any): void {
160
+ this.value = value ?? '';
161
+ }
162
+
163
+ registerOnChange(fn: any): void {
164
+ this.onChange = fn;
165
+ }
166
+
167
+ registerOnTouched(fn: any): void {
168
+ this.onTouched = fn;
169
+ }
170
+
171
+
172
+ }
@@ -0,0 +1,24 @@
1
+ <div class="inline-flex items-center gap-2 cursor-pointer" (click)="toggle()">
2
+ <button
3
+ type="button"
4
+ role="switch"
5
+ [attr.aria-checked]="isChecked"
6
+ [disabled]="disabled"
7
+ class="toggle-base"
8
+ [ngClass]="toggleClass"
9
+ [class.toggle-on]="isChecked"
10
+ [class.toggle-off]="!isChecked"
11
+ [class.toggle-disabled]="disabled"
12
+ >
13
+ <span
14
+ class="toggle-knob"
15
+ [class.knob-on]="isChecked"
16
+ [class.knob-off]="!isChecked"
17
+ ></span>
18
+ </button>
19
+ @if (label){
20
+ <span class="text-sm font-medium text-[#1B223A] select-none" [class.opacity-70]="disabled">
21
+ {{ label }}
22
+ </span>
23
+ }
24
+ </div>
@@ -0,0 +1,62 @@
1
+ import { Component, Input, Output, EventEmitter, forwardRef, ViewEncapsulation } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+ import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
4
+
5
+ @Component({
6
+ selector: 'bk-toggle',
7
+ standalone: true,
8
+ imports: [CommonModule],
9
+ encapsulation:ViewEncapsulation.None,
10
+ templateUrl: './toggle.html',
11
+ styleUrls: ['./toggle.css'],
12
+ providers: [
13
+ {
14
+ provide: NG_VALUE_ACCESSOR,
15
+ useExisting: forwardRef(() => BkToggle),
16
+ multi: true
17
+ }
18
+ ]
19
+ })
20
+ export class BkToggle implements ControlValueAccessor {
21
+
22
+ @Input() label: string = '';
23
+ @Input() disabled: boolean = false;
24
+ @Input() toggleClass: string = 'toggle-md';
25
+
26
+ @Output() change = new EventEmitter<boolean>();
27
+
28
+ isChecked: boolean = false;
29
+
30
+ // CVA callbacks (placeholders)
31
+ onChange = (_: boolean) => {};
32
+ onTouched = () => {};
33
+
34
+ toggle() {
35
+ if (this.disabled) return;
36
+
37
+ this.isChecked = !this.isChecked;
38
+ this.onChange(this.isChecked); // Notify Forms API
39
+ this.onTouched(); // Notify Validation API
40
+ this.change.emit(this.isChecked); // Notify standard event listeners
41
+ }
42
+
43
+ // Called by Angular to write value to the view
44
+ writeValue(value: boolean): void {
45
+ this.isChecked = value;
46
+ }
47
+
48
+ // Called by Angular to register the function to call when changed
49
+ registerOnChange(fn: any): void {
50
+ this.onChange = fn;
51
+ }
52
+
53
+ // Called by Angular to register the function to call when touched
54
+ registerOnTouched(fn: any): void {
55
+ this.onTouched = fn;
56
+ }
57
+
58
+ // Called by Angular when the disabled state changes
59
+ setDisabledState(isDisabled: boolean): void {
60
+ this.disabled = isDisabled;
61
+ }
62
+ }
@@ -0,0 +1,25 @@
1
+ <button
2
+ [attr.type]="type"
3
+ [class]="buttonClasses"
4
+ [disabled]="disabled || loading"
5
+ (click)="onClick($event)"
6
+ >
7
+ @if (leftIcon) {
8
+ <img [src]="leftIcon" [alt]="iconAlt" class="icon shrink-0" />
9
+ }
10
+
11
+ @if (label) {
12
+ <span [class]="textClass">
13
+ {{ label }}
14
+ </span>
15
+ }
16
+ @if (loading) {
17
+ <span [class]="spinnerClass" class="spinner"></span>
18
+ }
19
+
20
+
21
+ @if (rightIcon) {
22
+ <img [src]="rightIcon" [alt]="iconAlt" class="icon shrink-0" />
23
+ }
24
+
25
+ </button>
@@ -0,0 +1,55 @@
1
+ import { Component, EventEmitter, Input, Output } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+
4
+ export type ButtonSize = 'xxsm' | 'xsm' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
5
+ export type ButtonVariant = 'primary' | 'secondary';
6
+
7
+ @Component({
8
+ selector: 'bk-button',
9
+ standalone: true,
10
+ imports: [CommonModule],
11
+ templateUrl: './ui-button.html',
12
+ styleUrl: './ui-button.css',
13
+ })
14
+ export class BkButton {
15
+ // --- Inputs ---
16
+
17
+ // 1. Style & Size Inputs
18
+ @Input() variant: ButtonVariant = 'primary';
19
+ @Input() size: ButtonSize = 'md';
20
+
21
+ // 2. Content Inputs
22
+ @Input() label: string = ''; // Pass text directly
23
+ @Input() leftIcon?: string;
24
+ @Input() rightIcon?: string;
25
+ @Input() iconAlt: string = 'icon';
26
+
27
+ // 3. State & Config
28
+ @Input() type: 'button' | 'submit' | 'reset' = 'button';
29
+ @Input() loading: boolean = false;
30
+ @Input() disabled: boolean = false;
31
+
32
+ // 4. Customization (Optional overrides)
33
+ @Input() buttonClass: string = ''; // Append extra classes if needed
34
+ @Input() textClass: string = '';
35
+ @Input() spinnerClass: string = '';
36
+
37
+ // --- Outputs ---
38
+ @Output() clicked = new EventEmitter<boolean>();
39
+
40
+ // --- Logic ---
41
+ onClick(event: Event) {
42
+ if (!this.disabled && !this.loading) {
43
+ this.clicked.emit(true);
44
+ }
45
+ }
46
+
47
+ // Generate the class string based on Inputs
48
+ get buttonClasses(): string {
49
+ const variantClass = this.variant === 'primary' ? 'btn-primary' : 'btn-secondary';
50
+
51
+ // Combine: Variant + Size + Custom Classes
52
+ // Note: The size name (e.g., 'sm') matches your CSS class name exactly
53
+ return `btn ${variantClass} ${this.size} ${this.buttonClass}`;
54
+ }
55
+ }
@@ -0,0 +1,7 @@
1
+ <button
2
+ [class]="buttonClasses"
3
+ [disabled]="disabled"
4
+ (click)="onClick($event)"
5
+ >
6
+ <img [src]="icon" [alt]="alt" class="icon" />
7
+ </button>
@@ -0,0 +1,38 @@
1
+ import { Component, EventEmitter, Input, Output } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+
4
+ export type IconButtonSize = 'xxsm' | 'xsm' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
5
+ export type IconButtonVariant = 'primary' | 'secondary';
6
+
7
+ @Component({
8
+ selector: 'bk-icon-button',
9
+ standalone: true,
10
+ imports: [CommonModule],
11
+ templateUrl: './ui-icon-button.html',
12
+ styleUrl: './ui-icon-button.css',
13
+ })
14
+ export class BkIconButton {
15
+ // --- Inputs ---
16
+ @Input() icon!: string; // Required icon path
17
+ @Input() alt: string = 'icon';
18
+ @Input() variant: IconButtonVariant = 'primary';
19
+ @Input() size: IconButtonSize = 'md';
20
+
21
+ @Input() disabled: boolean = false;
22
+
23
+ // Custom classes
24
+ @Input() buttonClass: string = '';
25
+
26
+ @Output() clicked = new EventEmitter<boolean>();
27
+
28
+ onClick(event: Event) {
29
+ if (!this.disabled) {
30
+ this.clicked.emit(true);
31
+ }
32
+ }
33
+
34
+ get buttonClasses(): string {
35
+ // Maps inputs to CSS classes: .btn-icon .primary .md
36
+ return `btn-icon ${this.variant} ${this.size} ${this.buttonClass}`;
37
+ }
38
+ }
@@ -0,0 +1,43 @@
1
+ /*
2
+ * Public API Surface of brickclay-lib
3
+ */
4
+
5
+ //Icons
6
+ export * from './lib/assets/icons'
7
+ //Library
8
+ export * from './lib/brickclay-lib';
9
+ //Calender
10
+ export * from './lib/calender/components/custom-calendar/custom-calendar.component';
11
+ export * from './lib/calender/components/scheduled-date-picker/scheduled-date-picker.component';
12
+ export * from './lib/calender/components/time-picker/time-picker.component';
13
+ export * from './lib/calender/calendar.module';
14
+ export * from './lib/calender/services/calendar-manager.service';
15
+ //Toggle
16
+ export * from './lib/toggle/toggle';
17
+ //CheckBox
18
+ export * from './lib/checkbox/checkbox';
19
+ //Radio-Button
20
+ export * from './lib/radio/radio'
21
+ //Pill
22
+ export * from './lib/pill/pill'
23
+ //Badge
24
+ export * from './lib/badge/badge'
25
+ //Spinner
26
+ export * from './lib/spinner/spinner'
27
+ //Button
28
+ export * from './lib/ui-button/ui-button'
29
+ export * from './lib/ui-icon-button/ui-icon-button'
30
+ export * from './lib/button-group/button-group'
31
+ //Text-Area
32
+ export * from './lib/textarea/textarea'
33
+ //Table
34
+ export * from './lib/grid/components/grid/grid';
35
+ export * from './lib/grid/models/grid.model';
36
+ //Single Select
37
+ export * from './lib/select/select';
38
+ //Input
39
+ export * from './lib/input/input';
40
+ //Input-Chips
41
+ export * from './lib/chips/chips';
42
+ //Tabs
43
+ export * from './lib/tabs/tabs';
@@ -0,0 +1,19 @@
1
+ /* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
2
+ /* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
3
+ {
4
+ "extends": "../../tsconfig.json",
5
+ "compilerOptions": {
6
+ "outDir": "../../out-tsc/lib",
7
+ "declaration": true,
8
+ "declarationMap": true,
9
+ "inlineSources": true,
10
+ "sourceMap": true,
11
+ "types": []
12
+ },
13
+ "include": [
14
+ "src/**/*.ts"
15
+ ],
16
+ "exclude": [
17
+ "**/*.spec.ts"
18
+ ]
19
+ }
@@ -0,0 +1,11 @@
1
+ /* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
2
+ /* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
3
+ {
4
+ "extends": "./tsconfig.lib.json",
5
+ "compilerOptions": {
6
+ "declarationMap": false
7
+ },
8
+ "angularCompilerOptions": {
9
+ "compilationMode": "partial"
10
+ }
11
+ }
@@ -0,0 +1,15 @@
1
+ /* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
2
+ /* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
3
+ {
4
+ "extends": "../../tsconfig.json",
5
+ "compilerOptions": {
6
+ "outDir": "../../out-tsc/spec",
7
+ "types": [
8
+ "jasmine"
9
+ ]
10
+ },
11
+ "include": [
12
+ "src/**/*.d.ts",
13
+ "src/**/*.spec.ts"
14
+ ]
15
+ }