@brickclay-org/ui 0.0.59 → 0.0.60
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 +1911 -1911
- package/fesm2022/brickclay-org-ui.mjs +181 -9
- package/fesm2022/brickclay-org-ui.mjs.map +1 -1
- package/index.d.ts +55 -12
- package/package.json +1 -1
- package/src/lib/ui-avatar/ui-avatar.css +71 -0
- package/src/styles.css +1 -0
package/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { OnInit, OnDestroy, OnChanges, EventEmitter, ElementRef, SimpleChanges, AfterViewInit, QueryList, ComponentRef, Type, InjectionToken, Renderer2, ApplicationRef, EnvironmentInjector } from '@angular/core';
|
|
3
|
-
import { ControlValueAccessor, NgControl, NgModel } from '@angular/forms';
|
|
2
|
+
import { OnInit, OnDestroy, OnChanges, EventEmitter, ElementRef, SimpleChanges, AfterViewInit, QueryList, ComponentRef, Type, InjectionToken, Renderer2, ApplicationRef, EnvironmentInjector, ChangeDetectorRef } from '@angular/core';
|
|
3
|
+
import { ControlValueAccessor, NgControl, NgModel, Validator, AbstractControl, ValidationErrors } from '@angular/forms';
|
|
4
4
|
import * as rxjs from 'rxjs';
|
|
5
5
|
import { Observable } from 'rxjs';
|
|
6
6
|
import * as i1 from '@angular/common';
|
|
@@ -1593,14 +1593,14 @@ declare class BkValidator implements OnInit {
|
|
|
1593
1593
|
static ɵcmp: i0.ɵɵComponentDeclaration<BkValidator, "bk-validator", never, { "control": { "alias": "control"; "required": false; }; "label": { "alias": "label"; "required": false; }; "errorMessage": { "alias": "errorMessage"; "required": false; }; "showError": { "alias": "showError"; "required": false; }; }, {}, never, never, true, never>;
|
|
1594
1594
|
}
|
|
1595
1595
|
|
|
1596
|
-
type
|
|
1597
|
-
type
|
|
1598
|
-
declare class
|
|
1596
|
+
type BkAvatarSize = 'sm' | 'md' | 'lg' | 'xl';
|
|
1597
|
+
type BkAvatarFallback = 'auto' | 'initials' | 'icon' | 'camera';
|
|
1598
|
+
declare class BkAvatarProfile implements OnDestroy, ControlValueAccessor, Validator {
|
|
1599
1599
|
src: string | null;
|
|
1600
1600
|
alt: string;
|
|
1601
1601
|
name: string;
|
|
1602
|
-
size:
|
|
1603
|
-
fallback:
|
|
1602
|
+
size: BkAvatarSize;
|
|
1603
|
+
fallback: BkAvatarFallback;
|
|
1604
1604
|
/** Whether upload / remove actions are enabled */
|
|
1605
1605
|
editable: boolean;
|
|
1606
1606
|
/** Accepted file MIME types for the file picker */
|
|
@@ -1642,6 +1642,7 @@ declare class AvatarProfile implements OnDestroy, ControlValueAccessor {
|
|
|
1642
1642
|
registerOnChange(fn: (value: string | null) => void): void;
|
|
1643
1643
|
registerOnTouched(fn: () => void): void;
|
|
1644
1644
|
setDisabledState(isDisabled: boolean): void;
|
|
1645
|
+
validate(control: AbstractControl): ValidationErrors | null;
|
|
1645
1646
|
ngOnChanges(changes: SimpleChanges): void;
|
|
1646
1647
|
ngOnDestroy(): void;
|
|
1647
1648
|
onImageError(): void;
|
|
@@ -1649,7 +1650,7 @@ declare class AvatarProfile implements OnDestroy, ControlValueAccessor {
|
|
|
1649
1650
|
get displaySrc(): string | null;
|
|
1650
1651
|
get showInitials(): boolean;
|
|
1651
1652
|
get containerClasses(): string;
|
|
1652
|
-
get sizeClasses():
|
|
1653
|
+
get sizeClasses(): BkAvatarSize[];
|
|
1653
1654
|
get showRemoveButton(): boolean;
|
|
1654
1655
|
onFileSelected(event: Event): void;
|
|
1655
1656
|
/**
|
|
@@ -1662,8 +1663,8 @@ declare class AvatarProfile implements OnDestroy, ControlValueAccessor {
|
|
|
1662
1663
|
private revokePreview;
|
|
1663
1664
|
private isFileTypeValid;
|
|
1664
1665
|
private getInitials;
|
|
1665
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<
|
|
1666
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<
|
|
1666
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BkAvatarProfile, never>;
|
|
1667
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<BkAvatarProfile, "bk-avatar-profile", never, { "src": { "alias": "src"; "required": false; }; "alt": { "alias": "alt"; "required": false; }; "name": { "alias": "name"; "required": false; }; "size": { "alias": "size"; "required": false; }; "fallback": { "alias": "fallback"; "required": false; }; "editable": { "alias": "editable"; "required": false; }; "accept": { "alias": "accept"; "required": false; }; "maxFileSizeKB": { "alias": "maxFileSizeKB"; "required": false; }; "uploadLabel": { "alias": "uploadLabel"; "required": false; }; "hint": { "alias": "hint"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; "removable": { "alias": "removable"; "required": false; }; "label": { "alias": "label"; "required": false; }; "required": { "alias": "required"; "required": false; }; "hasError": { "alias": "hasError"; "required": false; }; "errorMessage": { "alias": "errorMessage"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "fileSelected": "fileSelected"; "removed": "removed"; "fileError": "fileError"; }, never, never, true, never>;
|
|
1667
1668
|
}
|
|
1668
1669
|
|
|
1669
1670
|
/** Generic hierarchical node; works with note types and any similar tree. */
|
|
@@ -1844,5 +1845,47 @@ declare class BkToastr {
|
|
|
1844
1845
|
static ɵcmp: i0.ɵɵComponentDeclaration<BkToastr, "bk-toastr", never, {}, {}, never, never, true, never>;
|
|
1845
1846
|
}
|
|
1846
1847
|
|
|
1847
|
-
|
|
1848
|
-
|
|
1848
|
+
type AvatarSize = 'xsm' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
|
|
1849
|
+
type AvatarVariant = 'gray' | 'colored';
|
|
1850
|
+
type DotStatus = 'active' | 'inactive' | 'notification' | 'none';
|
|
1851
|
+
type DotPosition = 'bottom-right' | 'top-left';
|
|
1852
|
+
type AvatarFallback = 'auto' | 'initials' | 'icon';
|
|
1853
|
+
declare class BkUiAvatar implements OnChanges, ControlValueAccessor {
|
|
1854
|
+
private cdr;
|
|
1855
|
+
constructor(cdr: ChangeDetectorRef);
|
|
1856
|
+
src: string | null;
|
|
1857
|
+
alt: string;
|
|
1858
|
+
name: string;
|
|
1859
|
+
size: AvatarSize;
|
|
1860
|
+
variant: AvatarVariant;
|
|
1861
|
+
fallback: AvatarFallback;
|
|
1862
|
+
dot: DotStatus;
|
|
1863
|
+
dotPosition: DotPosition;
|
|
1864
|
+
/** Emits when the provided image URL fails to load */
|
|
1865
|
+
imageLoadError: EventEmitter<void>;
|
|
1866
|
+
initials: string;
|
|
1867
|
+
imageLoadFailed: boolean;
|
|
1868
|
+
private onChange;
|
|
1869
|
+
private onTouched;
|
|
1870
|
+
/**
|
|
1871
|
+
* Called by the forms system when the model value changes (ngModel / formControl).
|
|
1872
|
+
* Sets the src directly and tells OnPush to re-check the template.
|
|
1873
|
+
*/
|
|
1874
|
+
writeValue(value: string | null): void;
|
|
1875
|
+
registerOnChange(fn: (value: string | null) => void): void;
|
|
1876
|
+
registerOnTouched(fn: () => void): void;
|
|
1877
|
+
setDisabledState(_isDisabled: boolean): void;
|
|
1878
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
1879
|
+
onImageError(): void;
|
|
1880
|
+
get showImage(): boolean;
|
|
1881
|
+
get showInitials(): boolean;
|
|
1882
|
+
get showIcon(): boolean;
|
|
1883
|
+
get containerClasses(): string;
|
|
1884
|
+
get dotClasses(): string;
|
|
1885
|
+
private getInitials;
|
|
1886
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BkUiAvatar, never>;
|
|
1887
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<BkUiAvatar, "bk-ui-avatar", never, { "src": { "alias": "src"; "required": false; }; "alt": { "alias": "alt"; "required": false; }; "name": { "alias": "name"; "required": false; }; "size": { "alias": "size"; "required": false; }; "variant": { "alias": "variant"; "required": false; }; "fallback": { "alias": "fallback"; "required": false; }; "dot": { "alias": "dot"; "required": false; }; "dotPosition": { "alias": "dotPosition"; "required": false; }; }, { "imageLoadError": "imageLoadError"; }, never, never, true, never>;
|
|
1888
|
+
}
|
|
1889
|
+
|
|
1890
|
+
export { BKTooltipDirective, BK_DEFAULT_DIALOG_CONFIG, BK_DIALOG_DATA, BK_DIALOG_GLOBAL_CONFIG, BkAvatarProfile, BkBadge, BkButton, BkButtonGroup, BkCheckbox, BkCustomCalendar, BkDialogActions, BkDialogClose, BkDialogContent, BkDialogModule, BkDialogRef, BkDialogService, BkDialogTitle, BkGrid, BkHierarchicalSelect, BkIconButton, BkInput, BkInputChips, BkPill, BkRadioButton, BkScheduledDatePicker, BkSelect, BkSpinner, BkTabs, BkTextarea, BkTimePicker, BkToastr, BkToastrService, BkToggle, BkUiAvatar, BkValidator, BrickclayIcons, BrickclayLib, CalendarManagerService, CalendarModule, CalendarSelection, getDialogBackdropAnimation, getDialogPanelAnimation };
|
|
1891
|
+
export type { AvatarFallback, AvatarSize, AvatarVariant, BadgeColor, BadgeSize, BadgeVariant, BkAnimationKeyframes, BkAvatarFallback, BkAvatarSize, BkDialogAnimation, BkDialogConfig, BkDialogPosition, BkInputAutoCapitalize, BkInputAutoComplete, BkInputMode, BkInputType, BkTextAreaAutoCapitalize, BkTextAreaAutoComplete, BkTextAreaInputMode, ButtonSize, ButtonVariant, CalendarRange, CountryOption, DotPosition, DotStatus, GroupItem, GroupMode, HierarchicalNode, IconButtonSize, IconButtonVariant, IconOrientation, PillColor, PillSize, PillVariant, ScheduledDateSelection, SortDirection, SpinnerSize, TabItem, TableAction, TableColumn, TimeConfiguration, ToastConfig, ToastMessage, ToastMethodOptions, ToastPosition, ToastSeverity };
|
package/package.json
CHANGED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/* =========================
|
|
2
|
+
Base Avatar
|
|
3
|
+
========================= */
|
|
4
|
+
.avatar {
|
|
5
|
+
@apply relative inline-flex items-center justify-center
|
|
6
|
+
rounded-full flex-shrink-0 select-none
|
|
7
|
+
transition-all duration-200;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.avatar-img {
|
|
11
|
+
@apply w-full h-full object-cover rounded-full;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.avatar-text {
|
|
15
|
+
@apply font-medium;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/* =========================
|
|
19
|
+
Sizes (container + text)
|
|
20
|
+
========================= */
|
|
21
|
+
.xsm { @apply size-6 text-[10px] leading-[14px]; }
|
|
22
|
+
.sm { @apply size-8 text-sm; }
|
|
23
|
+
.md { @apply size-10 text-base; }
|
|
24
|
+
.lg { @apply size-12 text-[18px] leading-[26px]; }
|
|
25
|
+
.xl { @apply size-14 text-xl; }
|
|
26
|
+
.xxl { @apply size-16 text-xl; }
|
|
27
|
+
|
|
28
|
+
/* =========================
|
|
29
|
+
Placeholder Icon Sizes
|
|
30
|
+
========================= */
|
|
31
|
+
.xsm .placeholder-icon { @apply size-4; }
|
|
32
|
+
.sm .placeholder-icon { @apply size-5; }
|
|
33
|
+
.md .placeholder-icon { @apply size-6; }
|
|
34
|
+
.lg .placeholder-icon { @apply size-7; }
|
|
35
|
+
.xl .placeholder-icon,
|
|
36
|
+
.xxl .placeholder-icon { @apply size-8; }
|
|
37
|
+
|
|
38
|
+
/* =========================
|
|
39
|
+
Status Dot (Base)
|
|
40
|
+
========================= */
|
|
41
|
+
.avatar-dot {
|
|
42
|
+
@apply absolute rounded-full block box-content
|
|
43
|
+
border-[1.5px] border-white;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/* Dot size follows avatar size */
|
|
47
|
+
.xsm .avatar-dot { @apply size-1; }
|
|
48
|
+
.sm .avatar-dot { @apply size-1.5; }
|
|
49
|
+
.md .avatar-dot { @apply size-2.5; }
|
|
50
|
+
.lg .avatar-dot { @apply size-3; }
|
|
51
|
+
.xl .avatar-dot { @apply size-[14px]; }
|
|
52
|
+
.xxl .avatar-dot { @apply size-4; }
|
|
53
|
+
|
|
54
|
+
/* =========================
|
|
55
|
+
Dot Variants
|
|
56
|
+
========================= */
|
|
57
|
+
.active {
|
|
58
|
+
@apply bg-[#22973F];
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.inactive {
|
|
62
|
+
@apply bg-gray-300;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.notification {
|
|
66
|
+
@apply bg-[#2E90FA];
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.none {
|
|
70
|
+
@apply hidden;
|
|
71
|
+
}
|
package/src/styles.css
CHANGED