@byuhbll/components 5.2.0-beta.0 → 5.2.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,66 @@
1
+ import { EventEmitter } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export type ButtonType = 'primary' | 'secondary' | 'transparent';
4
+ export interface ButtonInputs {
5
+ buttonType?: ButtonType;
6
+ title?: string;
7
+ iconBefore?: string;
8
+ iconAfter?: string;
9
+ disabled?: boolean;
10
+ isThin?: boolean;
11
+ ariaLabel?: string;
12
+ }
13
+ /**
14
+ * A flexible, reusable button component that supports multiple button types
15
+ * and various content combinations (icon before, title, icon after).
16
+ *
17
+ * @example
18
+ * ```html
19
+ * <!-- Primary button with icon and title -->
20
+ * <lib-button
21
+ * buttonType="primary"
22
+ * title="Copy Citation"
23
+ * iconBefore="content_copy"
24
+ * (buttonClick)="copyCitation()">
25
+ * </lib-button>
26
+ *
27
+ * <!-- Secondary button with title only -->
28
+ * <lib-button
29
+ * buttonType="secondary"
30
+ * title="Cancel"
31
+ * (buttonClick)="cancelAction()">
32
+ * </lib-button>
33
+ *
34
+ * <!-- Transparent button with icon after title -->
35
+ * <lib-button
36
+ * buttonType="transparent"
37
+ * title="Download"
38
+ * iconAfter="download"
39
+ * (buttonClick)="downloadFile()">
40
+ * </lib-button>
41
+ *
42
+ * <!-- Thin button -->
43
+ * <lib-button
44
+ * buttonType="primary"
45
+ * title="Submit"
46
+ * [isThin]="true"
47
+ * (buttonClick)="submitForm()">
48
+ * </lib-button>
49
+ * ```
50
+ */
51
+ export declare class ButtonComponent {
52
+ buttonType: ButtonType;
53
+ title?: string;
54
+ iconBefore?: string;
55
+ iconAfter?: string;
56
+ disabled: boolean;
57
+ isThin: boolean;
58
+ ariaLabel?: string;
59
+ buttonClick: EventEmitter<void>;
60
+ /**
61
+ * Handles button click events and emits the buttonClick event if the button is not disabled.
62
+ */
63
+ onButtonClick(): void;
64
+ static ɵfac: i0.ɵɵFactoryDeclaration<ButtonComponent, never>;
65
+ 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; }; "disabled": { "alias": "disabled"; "required": false; }; "isThin": { "alias": "isThin"; "required": false; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; }; }, { "buttonClick": "buttonClick"; }, never, never, true, never>;
66
+ }
@@ -0,0 +1,46 @@
1
+ import { EventEmitter, QueryList, AfterContentInit, OnDestroy } from '@angular/core';
2
+ import { ButtonGroupItemComponent } from '../subatomic-components/button-group-item/button-group-item.component';
3
+ import * as i0 from "@angular/core";
4
+ export declare class ButtonGroupComponent implements AfterContentInit, OnDestroy {
5
+ initialActiveId?: string;
6
+ activeButtonChange: EventEmitter<string>;
7
+ buttonItems: QueryList<ButtonGroupItemComponent>;
8
+ private elementRef;
9
+ protected activeButtonId: import("@angular/core").WritableSignal<string>;
10
+ private subscriptions;
11
+ /**
12
+ * Angular lifecycle hook called after content projection is initialized.
13
+ * Sets up the initial active button and subscribes to button click events from all button items.
14
+ */
15
+ ngAfterContentInit(): void;
16
+ /**
17
+ * Initializes custom element children when used as web components.
18
+ */
19
+ private initializeCustomElements;
20
+ /**
21
+ * Sets the active state on a custom element by toggling the active class on its button.
22
+ */
23
+ private setActiveState;
24
+ /**
25
+ * Handles click events for custom element children.
26
+ */
27
+ private handleCustomElementClick;
28
+ /**
29
+ * Angular lifecycle hook called when the component is destroyed.
30
+ * Cleans up all subscriptions to prevent memory leaks.
31
+ */
32
+ ngOnDestroy(): void;
33
+ /**
34
+ * Initializes the active button state based on the initialActiveId input.
35
+ * Sets the active state on the matching button item if an initial ID is provided.
36
+ */
37
+ private initializeActiveButton;
38
+ /**
39
+ * Handles button click events from child button items.
40
+ * Updates the active button state and emits the activeButtonChange event.
41
+ * @param buttonId - The ID of the clicked button
42
+ */
43
+ onButtonClick(buttonId: string): void;
44
+ static ɵfac: i0.ɵɵFactoryDeclaration<ButtonGroupComponent, never>;
45
+ static ɵcmp: i0.ɵɵComponentDeclaration<ButtonGroupComponent, "lib-button-group", never, { "initialActiveId": { "alias": "initialActiveId"; "required": false; }; }, { "activeButtonChange": "activeButtonChange"; }, ["buttonItems"], ["*"], true, never>;
46
+ }
@@ -3,7 +3,7 @@ import { Subject } from 'rxjs';
3
3
  import { TokenPayload } from '../models/token-payload';
4
4
  import * as i0 from "@angular/core";
5
5
  export declare const defaultOidcBaseUri = "https://keycloak.lib.byu.edu/";
6
- export declare const defaultOidcDefaultIdp = "byu-realm";
6
+ export declare const defaultOidcDefaultIdp = "ces";
7
7
  export declare class ImpersonateUserPipe implements PipeTransform {
8
8
  transform(user: ImpersonateSearchResult): string;
9
9
  static ɵfac: i0.ɵɵFactoryDeclaration<ImpersonateUserPipe, never>;
@@ -8,8 +8,6 @@ export declare class SimpleSearchComponent implements OnInit, OnDestroy {
8
8
  private inputTooltip;
9
9
  private subscription;
10
10
  private _config;
11
- private draftQuery;
12
- private isPatching;
13
11
  set config(config: SearchConfig);
14
12
  get config(): SearchConfig;
15
13
  simpleSearch: EventEmitter<SearchConfig>;
@@ -0,0 +1,18 @@
1
+ import { EventEmitter } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class ButtonGroupItemComponent {
4
+ id: string;
5
+ title?: string;
6
+ icon?: string;
7
+ ariaLabel?: string;
8
+ disabled: boolean;
9
+ position?: 'first' | 'last' | 'middle';
10
+ buttonClick: EventEmitter<string>;
11
+ isActive: boolean;
12
+ /**
13
+ * Handles the button click event and emits the button's ID to the parent component.
14
+ */
15
+ onClick(): void;
16
+ static ɵfac: i0.ɵɵFactoryDeclaration<ButtonGroupItemComponent, never>;
17
+ static ɵcmp: i0.ɵɵComponentDeclaration<ButtonGroupItemComponent, "lib-button-group-item", never, { "id": { "alias": "id"; "required": true; }; "title": { "alias": "title"; "required": false; }; "icon": { "alias": "icon"; "required": false; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "position": { "alias": "position"; "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.2.0-beta.0",
3
+ "version": "5.2.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,6 @@ 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.component';
17
+ export * from './lib/button-group/button-group.component';
18
+ export * from './lib/subatomic-components/button-group-item/button-group-item.component';