@byuhbll/components 5.0.1 → 5.0.3-beta.0

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.
@@ -0,0 +1,139 @@
1
+ import { EventEmitter } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export type ButtonType = 'primary' | 'secondary' | 'transparent';
4
+ /**
5
+ * Interface representing all input properties for the ButtonComponent.
6
+ * Use this when a parent component needs to accept button configuration as a parameter.
7
+ *
8
+ * @example
9
+ * ```typescript
10
+ * export class ParentComponent {
11
+ * @Input() buttonConfig: ButtonInputs = {
12
+ * buttonType: 'primary',
13
+ * title: 'Click Me',
14
+ * disabled: false
15
+ * };
16
+ * }
17
+ * ```
18
+ */
19
+ export interface ButtonInputs {
20
+ /**
21
+ * The visual style of the button
22
+ * @default 'primary'
23
+ */
24
+ buttonType?: ButtonType;
25
+ /**
26
+ * The text content displayed on the button
27
+ * @optional
28
+ */
29
+ title?: string;
30
+ /**
31
+ * Path to an icon image displayed before the title
32
+ * @optional
33
+ */
34
+ iconBefore?: string;
35
+ /**
36
+ * Path to an icon image displayed after the title
37
+ * @optional
38
+ */
39
+ iconAfter?: string;
40
+ /**
41
+ * Alternative text for icon accessibility
42
+ * @optional
43
+ */
44
+ iconAlt?: string;
45
+ /**
46
+ * Whether the button is disabled
47
+ * @default false
48
+ */
49
+ disabled?: boolean;
50
+ /**
51
+ * Whether the button should have thin padding
52
+ * @default false
53
+ */
54
+ isThin?: boolean;
55
+ }
56
+ /**
57
+ * A flexible, reusable button component that supports multiple button types
58
+ * and various content combinations (icon before, title, icon after).
59
+ *
60
+ * @example
61
+ * ```html
62
+ * <!-- Primary button with icon and title -->
63
+ * <app-hbll-button-custom-component
64
+ * buttonType="primary"
65
+ * title="Copy Citation"
66
+ * iconBefore="../../assets/copy.svg"
67
+ * iconAlt="Copy icon"
68
+ * (buttonClick)="copyCitation()">
69
+ * </app-hbll-button-custom-component>
70
+ *
71
+ * <!-- Secondary button with title only -->
72
+ * <app-hbll-button-custom-component
73
+ * buttonType="secondary"
74
+ * title="Cancel"
75
+ * (buttonClick)="cancelAction()">
76
+ * </app-hbll-button-custom-component>
77
+ *
78
+ * <!-- Transparent button with icon after title -->
79
+ * <app-hbll-button-custom-component
80
+ * buttonType="transparent"
81
+ * title="Download"
82
+ * iconAfter="../../assets/download.svg"
83
+ * iconAlt="Download icon"
84
+ * (buttonClick)="downloadFile()">
85
+ * </app-hbll-button-custom-component>
86
+ *
87
+ * <!-- Thin button with reduced padding -->
88
+ * <app-hbll-button-custom-component
89
+ * buttonType="primary"
90
+ * title="Submit"
91
+ * [isThin]="true"
92
+ * (buttonClick)="submitForm()">
93
+ * </app-hbll-button-custom-component>
94
+ * ```
95
+ */
96
+ export declare class ButtonComponent {
97
+ /**
98
+ * The visual style of the button
99
+ * @default 'primary'
100
+ */
101
+ buttonType: ButtonType;
102
+ /**
103
+ * The text content displayed on the button
104
+ * @optional
105
+ */
106
+ title?: string;
107
+ /**
108
+ * Path to an icon image displayed before the title
109
+ * @optional
110
+ */
111
+ iconBefore?: string;
112
+ /**
113
+ * Path to an icon image displayed after the title
114
+ * @optional
115
+ */
116
+ iconAfter?: string;
117
+ /**
118
+ * Alternative text for icon accessibility
119
+ * @optional
120
+ */
121
+ iconAlt?: string;
122
+ /**
123
+ * Whether the button is disabled
124
+ * @default false
125
+ */
126
+ disabled: boolean;
127
+ /**
128
+ * Whether the button should have thin padding
129
+ * @default false
130
+ */
131
+ isThin: boolean;
132
+ /**
133
+ * Event emitted when the button is clicked or activated via keyboard
134
+ */
135
+ buttonClick: EventEmitter<void>;
136
+ onButtonClick(): void;
137
+ static ɵfac: i0.ɵɵFactoryDeclaration<ButtonComponent, never>;
138
+ static ɵcmp: i0.ɵɵComponentDeclaration<ButtonComponent, "lib-button", never, { "buttonType": { "alias": "buttonType"; "required": false; }; "title": { "alias": "title"; "required": false; }; "iconBefore": { "alias": "iconBefore"; "required": false; }; "iconAfter": { "alias": "iconAfter"; "required": false; }; "iconAlt": { "alias": "iconAlt"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "isThin": { "alias": "isThin"; "required": false; }; }, { "buttonClick": "buttonClick"; }, never, never, true, never>;
139
+ }
@@ -0,0 +1,17 @@
1
+ import { EventEmitter, OnInit, OnChanges, SimpleChanges } from '@angular/core';
2
+ import { ButtonConfig } from '../subatomic-components/button-group-item/button-group-item.component';
3
+ import * as i0 from "@angular/core";
4
+ export declare class ButtonGroupComponent implements OnInit, OnChanges {
5
+ buttons: ButtonConfig[];
6
+ initialActiveId?: string;
7
+ disabled: boolean;
8
+ activeButtonChange: EventEmitter<string>;
9
+ activeButtonId: import("@angular/core").WritableSignal<string>;
10
+ ngOnInit(): void;
11
+ ngOnChanges(changes: SimpleChanges): void;
12
+ private initializeActiveButton;
13
+ onButtonClick(buttonId: string): void;
14
+ isButtonActive(buttonId: string): boolean;
15
+ static ɵfac: i0.ɵɵFactoryDeclaration<ButtonGroupComponent, never>;
16
+ static ɵcmp: i0.ɵɵComponentDeclaration<ButtonGroupComponent, "lib-button-group", never, { "buttons": { "alias": "buttons"; "required": true; }; "initialActiveId": { "alias": "initialActiveId"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "activeButtonChange": "activeButtonChange"; }, never, never, true, never>;
17
+ }
@@ -1,8 +1,8 @@
1
- import { EventEmitter, Signal } from '@angular/core';
1
+ import { EventEmitter, Signal, OnInit, OnDestroy } from '@angular/core';
2
2
  import { TokenPayload } from '../models/token-payload';
3
3
  import { JwtPayload } from 'jwt-decode';
4
4
  import * as i0 from "@angular/core";
5
- export declare class HeaderWithImpersonationComponent {
5
+ export declare class HeaderWithImpersonationComponent implements OnInit, OnDestroy {
6
6
  accessTokenPayload: import("@angular/core").InputSignal<TokenPayload>;
7
7
  oidcBaseUri: import("@angular/core").InputSignal<string>;
8
8
  oidcDefaultIdp: import("@angular/core").InputSignal<string>;
@@ -17,6 +17,23 @@ export declare class HeaderWithImpersonationComponent {
17
17
  protected showImpersonateButton: Signal<boolean>;
18
18
  protected showImpersonationModal: boolean;
19
19
  private isImpersonating;
20
+ private activityEvents;
21
+ private inactivityTimerId;
22
+ private inactivityTimeoutMs;
23
+ private debounceTimerId;
24
+ private debounceDelayMs;
25
+ private trackingActive;
26
+ private injector;
27
+ ngOnInit(): void;
28
+ ngOnDestroy(): void;
29
+ /** Begin listening and start countdown */
30
+ private startInactivityTracking;
31
+ /** Remove listeners and clear timers */
32
+ private stopInactivityTracking;
33
+ /** Reset the inactivity countdown (no-op if not impersonating) */
34
+ private resetInactivityTimer;
35
+ /** Debounce activity to avoid hammering resets during event storms */
36
+ private debouncedResetTimer;
20
37
  static ɵfac: i0.ɵɵFactoryDeclaration<HeaderWithImpersonationComponent, never>;
21
38
  static ɵcmp: i0.ɵɵComponentDeclaration<HeaderWithImpersonationComponent, "lib-header-with-impersonation", never, { "accessTokenPayload": { "alias": "accessTokenPayload"; "required": true; "isSignal": true; }; "oidcBaseUri": { "alias": "oidcBaseUri"; "required": false; "isSignal": true; }; "oidcDefaultIdp": { "alias": "oidcDefaultIdp"; "required": false; "isSignal": true; }; "mainSiteBaseUrl": { "alias": "mainSiteBaseUrl"; "required": false; "isSignal": true; }; "personBaseUri": { "alias": "personBaseUri"; "required": false; "isSignal": true; }; "myAccountApiBaseUri": { "alias": "myAccountApiBaseUri"; "required": false; "isSignal": true; }; }, { "login": "login"; "logout": "logout"; "endImpersonation": "endImpersonation"; }, never, never, true, never>;
22
39
  }
@@ -0,0 +1,18 @@
1
+ import { EventEmitter } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export interface ButtonConfig {
4
+ id: string;
5
+ title?: string;
6
+ isActive: boolean;
7
+ icon?: string;
8
+ iconAlt?: string;
9
+ }
10
+ export declare class ButtonGroupItemComponent {
11
+ button: ButtonConfig;
12
+ isActive: boolean;
13
+ disabled: boolean;
14
+ buttonClick: EventEmitter<string>;
15
+ onClick(): void;
16
+ static ɵfac: i0.ɵɵFactoryDeclaration<ButtonGroupItemComponent, never>;
17
+ static ɵcmp: i0.ɵɵComponentDeclaration<ButtonGroupItemComponent, "lib-button-group-item", never, { "button": { "alias": "button"; "required": true; }; "isActive": { "alias": "isActive"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "buttonClick": "buttonClick"; }, never, never, true, never>;
18
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@byuhbll/components",
3
- "version": "5.0.1",
3
+ "version": "5.0.3-beta.0",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^18.0.0",
6
6
  "@angular/core": "^18.0.0"
package/public-api.d.ts CHANGED
@@ -13,3 +13,5 @@ export * from './lib/snackbar/snackbar.component';
13
13
  export { getUserStatusFromRoles } from './lib/contact-utils';
14
14
  export { ADVANCED_SEARCH_QUALIFIER_MAP, ADVANCED_SEARCH_FIELD_MAP, ADVANCED_SEARCH_OPTIONS, } from './lib/ss-search-bar/constants';
15
15
  export * from './lib/status-button/status-button.component';
16
+ export * from './lib/button/button';
17
+ export * from './lib/button-group/button-group.component';