@brickclay-org/ui 0.0.49 → 0.0.50

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/index.d.ts CHANGED
@@ -1553,5 +1553,72 @@ declare class BkValidator implements OnInit {
1553
1553
  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>;
1554
1554
  }
1555
1555
 
1556
- export { BKTooltipDirective, BkBadge, BkButton, BkButtonGroup, BkCheckbox, BkCustomCalendar, BkDialogActions, BkDialogClose, BkDialogContent, BkDialogModule, BkDialogTitle, BkGrid, BkIconButton, BkInput, BkInputChips, BkPill, BkRadioButton, BkScheduledDatePicker, BkSelect, BkSpinner, BkTabs, BkTextarea, BkTimePicker, BkToggle, BkValidator, BrickclayIcons, BrickclayLib, CalendarManagerService, CalendarModule, DEFAULT_DIALOG_CONFIG, DIALOG_DATA, DIALOG_GLOBAL_CONFIG, DialogRef, DialogService, getDialogBackdropAnimation, getDialogPanelAnimation };
1557
- export type { AnimationKeyframes, BadgeColor, BadgeSize, BadgeVariant, BkInputAutoCapitalize, BkInputAutoComplete, BkInputMode, BkInputType, BkTextAreaAutoCapitalize, BkTextAreaAutoComplete, BkTextAreaInputMode, ButtonSize, ButtonVariant, CalendarRange, CalendarSelection, CountryOption, DialogAnimation, DialogConfig, DialogPosition, GroupItem, GroupMode, IconButtonSize, IconButtonVariant, IconOrientation, PillColor, PillSize, PillVariant, ScheduledDateSelection, SortDirection, SpinnerSize, TabItem, TableAction, TableColumn, TimeConfiguration };
1556
+ type AvatarSize = 'sm' | 'md' | 'lg' | 'xl';
1557
+ type AvatarFallback = 'auto' | 'initials' | 'icon' | 'camera';
1558
+ declare class AvatarProfile implements OnDestroy, ControlValueAccessor {
1559
+ src: string | null;
1560
+ alt: string;
1561
+ name: string;
1562
+ size: AvatarSize;
1563
+ fallback: AvatarFallback;
1564
+ /** Whether upload / remove actions are enabled */
1565
+ editable: boolean;
1566
+ /** Accepted file MIME types for the file picker */
1567
+ accept: string;
1568
+ /** Max file size in KB (0 = no limit) */
1569
+ maxFileSizeKB: number;
1570
+ /** Label shown on the upload button */
1571
+ uploadLabel: string;
1572
+ /** Hint text shown below the upload button */
1573
+ hint: string;
1574
+ /** External loading state (e.g. while uploading) */
1575
+ loading: boolean;
1576
+ /** Whether the remove badge is shown when an image is present */
1577
+ removable: boolean;
1578
+ /** Label displayed above the avatar */
1579
+ label: string;
1580
+ /** Whether the field is required (shows asterisk) */
1581
+ required: boolean;
1582
+ /** External error state flag */
1583
+ hasError: boolean;
1584
+ /** Error message to display when hasError is true */
1585
+ errorMessage: string;
1586
+ /** Disabled state (also set via CVA setDisabledState) */
1587
+ disabled: boolean;
1588
+ /** Emits the selected File after validation passes */
1589
+ fileSelected: EventEmitter<any>;
1590
+ /** Emits when the user clicks the remove badge */
1591
+ removed: EventEmitter<void>;
1592
+ /** Emits a human-readable error string on validation failure */
1593
+ fileError: EventEmitter<string>;
1594
+ initials: string;
1595
+ imageLoadFailed: boolean;
1596
+ /** Local blob URL for instant preview before server upload completes */
1597
+ private previewUrl;
1598
+ private onChange;
1599
+ private onTouched;
1600
+ writeValue(value: string | null): void;
1601
+ registerOnChange(fn: (value: string | null) => void): void;
1602
+ registerOnTouched(fn: () => void): void;
1603
+ setDisabledState(isDisabled: boolean): void;
1604
+ ngOnChanges(changes: SimpleChanges): void;
1605
+ ngOnDestroy(): void;
1606
+ onImageError(): void;
1607
+ /** The URL the template should display — local preview takes priority over the server src */
1608
+ get displaySrc(): string | null;
1609
+ get showInitials(): boolean;
1610
+ get containerClasses(): string;
1611
+ get sizeClasses(): AvatarSize[];
1612
+ get showRemoveButton(): boolean;
1613
+ onFileSelected(event: Event): void;
1614
+ onRemove(): void;
1615
+ /** Revoke the previous object URL to free memory */
1616
+ private revokePreview;
1617
+ private isFileTypeValid;
1618
+ private getInitials;
1619
+ static ɵfac: i0.ɵɵFactoryDeclaration<AvatarProfile, never>;
1620
+ static ɵcmp: i0.ɵɵComponentDeclaration<AvatarProfile, "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>;
1621
+ }
1622
+
1623
+ export { AvatarProfile, BKTooltipDirective, BkBadge, BkButton, BkButtonGroup, BkCheckbox, BkCustomCalendar, BkDialogActions, BkDialogClose, BkDialogContent, BkDialogModule, BkDialogTitle, BkGrid, BkIconButton, BkInput, BkInputChips, BkPill, BkRadioButton, BkScheduledDatePicker, BkSelect, BkSpinner, BkTabs, BkTextarea, BkTimePicker, BkToggle, BkValidator, BrickclayIcons, BrickclayLib, CalendarManagerService, CalendarModule, DEFAULT_DIALOG_CONFIG, DIALOG_DATA, DIALOG_GLOBAL_CONFIG, DialogRef, DialogService, getDialogBackdropAnimation, getDialogPanelAnimation };
1624
+ export type { AnimationKeyframes, AvatarFallback, AvatarSize, BadgeColor, BadgeSize, BadgeVariant, BkInputAutoCapitalize, BkInputAutoComplete, BkInputMode, BkInputType, BkTextAreaAutoCapitalize, BkTextAreaAutoComplete, BkTextAreaInputMode, ButtonSize, ButtonVariant, CalendarRange, CalendarSelection, CountryOption, DialogAnimation, DialogConfig, DialogPosition, GroupItem, GroupMode, IconButtonSize, IconButtonVariant, IconOrientation, PillColor, PillSize, PillVariant, ScheduledDateSelection, SortDirection, SpinnerSize, TabItem, TableAction, TableColumn, TimeConfiguration };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brickclay-org/ui",
3
- "version": "0.0.49",
3
+ "version": "0.0.50",
4
4
  "schematics": "./schematics/collection.json",
5
5
  "ng-add": {
6
6
  "save": "dependencies"
@@ -0,0 +1,80 @@
1
+ /* =========================
2
+ Container
3
+ ========================= */
4
+ .avatar-profile-container {
5
+ @apply flex flex-col gap-1.5;
6
+ }
7
+
8
+ /* =========================
9
+ Label
10
+ ========================= */
11
+ .avatar-profile-label {
12
+ @apply text-sm font-medium text-[#141414];
13
+ }
14
+
15
+ .avatar-profile-label-required {
16
+ @apply text-[#E7000B] ml-0.5;
17
+ }
18
+
19
+ /* =========================
20
+ Error message
21
+ ========================= */
22
+ .avatar-profile-error {
23
+ @apply text-xs text-[#E7000B] font-normal;
24
+ }
25
+
26
+ /* =========================
27
+ Base Avatar
28
+ ========================= */
29
+ .avatar-profile {
30
+ @apply relative inline-flex items-center justify-center
31
+ rounded-full flex-shrink-0 select-none shadow-lg
32
+ transition-all duration-200 border-[3px] border-white bg-[#F9FAFA];
33
+ }
34
+
35
+ .avatar-profile .avatar-img {
36
+ @apply w-full h-full object-cover rounded-full;
37
+ }
38
+ .upload-button { @apply font-medium text-[#6B7080] border border-[#E3E3E7] rounded shadow-sm;}
39
+ .sm .upload-button { @apply text-[12px] leading-[18px] px-2 py-3;}
40
+ .md .upload-button { @apply text-[14px] leading-[20px] px-[10px] py-2.5;}
41
+ .lg .upload-button { @apply text-[16px] leading-[24px] px-[18px] py-2.5;}
42
+ .xl .upload-button { @apply text-[16px] leading-[24px] px-5 py-3;}
43
+
44
+ .profile-size { @apply font-medium text-[#6B7080];}
45
+ .sm .profile-size { @apply text-[10px] leading-[14px];}
46
+ .md .profile-size { @apply text-[12px] leading-[18px] ;}
47
+ .lg .profile-size { @apply text-[14px] leading-[20px];}
48
+ .xl .profile-size { @apply text-[16px] leading-[24px] ;}
49
+
50
+
51
+ .avatar-profile.sm .avatar-text { @apply font-medium text-[30px] leading-[38px];}
52
+ .avatar-profile.md .avatar-text { @apply font-medium text-[36px] leading-[44px];}
53
+ .avatar-profile.lg .avatar-text { @apply font-medium text-[45px] leading-[55px];}
54
+ .avatar-profile.xl .avatar-text { @apply font-medium text-[60px] leading-[72px];}
55
+
56
+ /* =========================
57
+ Sizes (container + text)
58
+ ========================= */
59
+ .avatar-profile{ @apply font-medium text-[#6B7080];}
60
+ .avatar-profile.sm { @apply size-[72px] text-sm; }
61
+ .avatar-profile.md { @apply size-[96px] text-base; }
62
+ .avatar-profile.lg { @apply size-[120px] text-[18px] leading-[26px]; }
63
+ .avatar-profile.xl { @apply size-[160px] text-xl; }
64
+
65
+ /* =========================
66
+ Placeholder Icon Sizes
67
+ ========================= */
68
+ .avatar-profile.sm .placeholder-icon { @apply size-[28px]; }
69
+ .avatar-profile.md .placeholder-icon { @apply size-[42px]; }
70
+ .avatar-profile.lg .placeholder-icon { @apply size-[52px]; }
71
+ .avatar-profile.xl .placeholder-icon { @apply size-[65px]; }
72
+
73
+ /* =========================
74
+ Remove Badge
75
+ ========================= */
76
+ .remove-badge {
77
+ @apply absolute top-0 right-0 w-5 h-5 bg-white rounded-full shadow-md
78
+ flex items-center justify-center cursor-pointer
79
+ hover:bg-gray-50 transition z-20 border-0 p-0;
80
+ }
package/src/styles.css CHANGED
@@ -16,3 +16,4 @@
16
16
  @import './lib/tabs/tabs.css';
17
17
  @import './lib/dialog/dialog-container.css';
18
18
  @import './lib/tooltip/tooltip-directive.css';
19
+ @import './lib/avatar-profile/avatar-profile.css';