@byuhbll/components 4.0.0-alpha.4 → 4.0.0-alpha.6

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 (33) hide show
  1. package/esm2022/lib/animations/animations.mjs +19 -1
  2. package/esm2022/lib/expand-collapse/expand-collapse.component.mjs +31 -0
  3. package/esm2022/lib/hbll-checkbox/hbll-checkbox.component.mjs +6 -8
  4. package/esm2022/lib/hbll-header/hbll-header.component.mjs +76 -31
  5. package/esm2022/lib/hbll-header/impersonate-modal/impersonate-modal.component.mjs +188 -0
  6. package/esm2022/lib/hbll-header/models/library-hours.mjs +2 -0
  7. package/esm2022/lib/hbll-header/models/token-payload.mjs +2 -0
  8. package/esm2022/lib/hbll-header/nav-bar/nav-bar.component.mjs +307 -0
  9. package/esm2022/lib/hbll-header/nav-bar-dropdown/nav-bar-dropdown.component.mjs +29 -0
  10. package/esm2022/lib/hbll-header/pipes/library-hours.pipe.mjs +31 -0
  11. package/esm2022/lib/ss-search-bar/advanced-search/advanced-search.component.mjs +3 -3
  12. package/esm2022/lib/ss-search-bar/ss-search-bar.component.mjs +3 -3
  13. package/esm2022/lib/utils.mjs +8 -0
  14. package/fesm2022/byuhbll-components.mjs +677 -63
  15. package/fesm2022/byuhbll-components.mjs.map +1 -1
  16. package/lib/animations/animations.d.ts +1 -0
  17. package/lib/expand-collapse/expand-collapse.component.d.ts +10 -0
  18. package/lib/hbll-checkbox/hbll-checkbox.component.d.ts +2 -2
  19. package/lib/hbll-header/hbll-header.component.d.ts +28 -29
  20. package/lib/hbll-header/impersonate-modal/impersonate-modal.component.d.ts +58 -0
  21. package/lib/hbll-header/models/library-hours.d.ts +10 -0
  22. package/lib/hbll-header/models/token-payload.d.ts +3 -0
  23. package/lib/hbll-header/nav-bar/nav-bar.component.d.ts +28 -0
  24. package/lib/hbll-header/nav-bar-dropdown/nav-bar-dropdown.component.d.ts +12 -0
  25. package/lib/hbll-header/pipes/library-hours.pipe.d.ts +7 -0
  26. package/lib/utils.d.ts +5 -0
  27. package/package.json +4 -1
  28. package/styles/scss/_mixins.scss +1 -1
  29. package/styles/scss/_vars.scss +6 -0
  30. package/styles/scss/base.scss +38 -5
  31. package/styles/scss/cta-btn.scss +2 -2
  32. package/styles/scss/pill-btn.scss +2 -2
  33. package/styles/scss/spinner.scss +20 -0
@@ -2,3 +2,4 @@ export declare const libHbllExpandCollapse: import("@angular/animations").Animat
2
2
  export declare const libHbllFadeInOut: import("@angular/animations").AnimationTriggerMetadata;
3
3
  export declare const libHbllFadeIn: import("@angular/animations").AnimationTriggerMetadata;
4
4
  export declare const libHbllFadeOut: import("@angular/animations").AnimationTriggerMetadata;
5
+ export declare const libHbllSlideInOutRightLeft: import("@angular/animations").AnimationTriggerMetadata;
@@ -0,0 +1,10 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class ExpandCollapseComponent {
3
+ private contentRef;
4
+ private _isExpanded;
5
+ set isExpanded(isExpanded: boolean);
6
+ get isExpanded(): boolean;
7
+ protected heightOfContent: number;
8
+ static ɵfac: i0.ɵɵFactoryDeclaration<ExpandCollapseComponent, never>;
9
+ static ɵcmp: i0.ɵɵComponentDeclaration<ExpandCollapseComponent, "lib-expand-collapse", never, { "isExpanded": { "alias": "isExpanded"; "required": true; }; }, {}, never, ["*"], true, never>;
10
+ }
@@ -1,6 +1,6 @@
1
1
  import * as i0 from "@angular/core";
2
2
  export declare class HbllCheckboxComponent {
3
- isChecked: boolean;
3
+ isChecked: import("@angular/core").InputSignal<boolean>;
4
4
  static ɵfac: i0.ɵɵFactoryDeclaration<HbllCheckboxComponent, never>;
5
- static ɵcmp: i0.ɵɵComponentDeclaration<HbllCheckboxComponent, "lib-hbll-checkbox", never, { "isChecked": { "alias": "isChecked"; "required": false; }; }, {}, never, never, true, never>;
5
+ static ɵcmp: i0.ɵɵComponentDeclaration<HbllCheckboxComponent, "lib-hbll-checkbox", never, { "isChecked": { "alias": "isChecked"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
6
6
  }
@@ -1,40 +1,39 @@
1
- import { AfterViewInit, EventEmitter, PipeTransform } from '@angular/core';
1
+ import { AfterViewInit, ElementRef, EventEmitter, Signal } from '@angular/core';
2
+ import { JwtPayload } from 'jwt-decode';
3
+ import { TokenPayload } from './models/token-payload';
4
+ import { LibraryHours } from './models/library-hours';
2
5
  import * as i0 from "@angular/core";
3
- interface LibraryHours {
4
- date: string;
5
- is_closed: boolean;
6
- open_time: string;
7
- close_time: string;
8
- has_exception: boolean;
9
- exception_title: string;
10
- exception_message: string;
11
- is_currently_open: boolean;
12
- }
13
- export declare class LibraryHoursDatePipe implements PipeTransform {
14
- transform(date: string, time: string): Date;
15
- static ɵfac: i0.ɵɵFactoryDeclaration<LibraryHoursDatePipe, never>;
16
- static ɵpipe: i0.ɵɵPipeDeclaration<LibraryHoursDatePipe, "libraryHoursDate", true>;
17
- }
18
- /**
19
- * Header component built to be exported as a custom element.
20
- * This component uses icons provided by Google Material.
21
- * The link to these icons should be included once in the \<head> of your base html.
22
- *
23
- * When a non-empty string `name` is provided to this component, the user is considered logged in.
24
- * Two outputs/events are accessible: `login` and `logout`.
25
- */
6
+ export declare const LIBRARY_HOURS_API_URL = "https://apps.lib.byu.edu/libraryhours/api/hours";
26
7
  export declare class HbllHeaderComponent implements AfterViewInit {
27
8
  private readonly r2;
28
9
  private readonly http;
29
- protected name: import("@angular/core").InputSignal<string>;
10
+ private readonly bo;
11
+ header: ElementRef;
12
+ accessTokenPayload: import("@angular/core").InputSignal<TokenPayload>;
13
+ oidcBaseUri: import("@angular/core").InputSignal<string>;
14
+ oidcDefaultIdp: import("@angular/core").InputSignal<string>;
30
15
  login: EventEmitter<void>;
31
16
  logout: EventEmitter<void>;
17
+ endImpersonation: EventEmitter<void>;
18
+ private formatDateForHours;
32
19
  private accountInfoEl;
33
- protected isLoggedIn: import("@angular/core").Signal<boolean>;
34
- protected libraryHours: import("@angular/core").Signal<LibraryHours | undefined>;
20
+ private hoursEl;
21
+ protected parsedToken: Signal<JwtPayload & Record<string, any>>;
22
+ protected isLoggedIn: Signal<boolean>;
23
+ protected isImpersonating: Signal<boolean>;
24
+ protected showImpersonateButton: Signal<any>;
25
+ protected name: Signal<any>;
26
+ protected libraryHours: Signal<LibraryHours | undefined>;
27
+ protected hoursExceptions$: import("rxjs").Observable<LibraryHours[]>;
35
28
  protected showAccountDropdown: boolean;
29
+ protected showLibraryHours: boolean;
30
+ protected mobileSidebarHeight: number;
31
+ protected showNavBar: boolean;
32
+ protected showImpersonationModal: boolean;
33
+ protected isScreenSmall: Signal<boolean | undefined>;
36
34
  ngAfterViewInit(): void;
35
+ private onResize;
36
+ private setMobileSidebarHeight;
37
37
  static ɵfac: i0.ɵɵFactoryDeclaration<HbllHeaderComponent, never>;
38
- static ɵcmp: i0.ɵɵComponentDeclaration<HbllHeaderComponent, "lib-hbll-header", never, { "name": { "alias": "name"; "required": false; "isSignal": true; }; }, { "login": "login"; "logout": "logout"; }, never, never, true, never>;
38
+ static ɵcmp: i0.ɵɵComponentDeclaration<HbllHeaderComponent, "lib-hbll-header", never, { "accessTokenPayload": { "alias": "accessTokenPayload"; "required": false; "isSignal": true; }; "oidcBaseUri": { "alias": "oidcBaseUri"; "required": false; "isSignal": true; }; "oidcDefaultIdp": { "alias": "oidcDefaultIdp"; "required": false; "isSignal": true; }; }, { "login": "login"; "logout": "logout"; "endImpersonation": "endImpersonation"; }, never, never, true, never>;
39
39
  }
40
- export {};
@@ -0,0 +1,58 @@
1
+ import { EventEmitter, OnDestroy, PipeTransform } from '@angular/core';
2
+ import { Subject } from 'rxjs';
3
+ import { TokenPayload } from '../models/token-payload';
4
+ import * as i0 from "@angular/core";
5
+ export declare class ImpersonateUserPipe implements PipeTransform {
6
+ transform(user: ImpersonateSearchResult): string;
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<ImpersonateUserPipe, never>;
8
+ static ɵpipe: i0.ɵɵPipeDeclaration<ImpersonateUserPipe, "impersonateUser", true>;
9
+ }
10
+ export interface ImpersonateSearchResult {
11
+ netId: string;
12
+ institution: string;
13
+ username: string;
14
+ name: string;
15
+ preferredName: string;
16
+ givenName: string;
17
+ surname: string;
18
+ restricted: boolean;
19
+ }
20
+ export declare class ImpersonateModalComponent implements OnDestroy {
21
+ private readonly http;
22
+ private readonly fb;
23
+ private readonly eref;
24
+ set showModal(open: boolean);
25
+ oidcBaseUri: import("@angular/core").InputSignal<string>;
26
+ oidcDefaultIdp: import("@angular/core").InputSignal<string>;
27
+ accessTokenPayload: import("@angular/core").InputSignal<TokenPayload>;
28
+ dismiss: EventEmitter<void>;
29
+ init: EventEmitter<void>;
30
+ protected isOpen: boolean;
31
+ protected hasError: boolean;
32
+ protected form: import("@angular/forms").FormGroup<{
33
+ search: import("@angular/forms").FormControl<string | null>;
34
+ }>;
35
+ protected selectedUsername?: string;
36
+ protected loading: boolean;
37
+ protected handleSearchSubject: Subject<boolean>;
38
+ protected results: import("@angular/core").Signal<ImpersonateSearchResult[] | null | undefined>;
39
+ private subs;
40
+ outsideClick(event: MouseEvent): void;
41
+ handleKeyDown: (event: KeyboardEvent) => void;
42
+ ngOnDestroy(): void;
43
+ /** Redirect to Keycloak impersonate page, which will redirect back
44
+ * after impersonation begins.
45
+ */
46
+ protected startImpersonation: (username?: string) => void;
47
+ protected handleSelectUser: (event: Event) => void;
48
+ protected clearSearch: () => void;
49
+ protected close: () => void;
50
+ protected handleFormSubmit: (event: SubmitEvent) => void;
51
+ protected handleSearchKeyPress: (event: KeyboardEvent) => void;
52
+ protected handleResultKeyPress: (event: KeyboardEvent) => void;
53
+ /** Search Keycloak users using a generic search query. */
54
+ private searchUsers;
55
+ private replaceUrl;
56
+ static ɵfac: i0.ɵɵFactoryDeclaration<ImpersonateModalComponent, never>;
57
+ static ɵcmp: i0.ɵɵComponentDeclaration<ImpersonateModalComponent, "lib-impersonate-modal", never, { "showModal": { "alias": "showModal"; "required": false; }; "oidcBaseUri": { "alias": "oidcBaseUri"; "required": true; "isSignal": true; }; "oidcDefaultIdp": { "alias": "oidcDefaultIdp"; "required": true; "isSignal": true; }; "accessTokenPayload": { "alias": "accessTokenPayload"; "required": true; "isSignal": true; }; }, { "dismiss": "dismiss"; "init": "init"; }, never, never, true, never>;
58
+ }
@@ -0,0 +1,10 @@
1
+ export interface LibraryHours {
2
+ date: string;
3
+ is_closed: boolean;
4
+ open_time: string;
5
+ close_time: string;
6
+ has_exception: boolean;
7
+ exception_title: string;
8
+ exception_message: string;
9
+ is_currently_open: boolean;
10
+ }
@@ -0,0 +1,3 @@
1
+ export interface TokenPayload {
2
+ token: string;
3
+ }
@@ -0,0 +1,28 @@
1
+ import { NavBarDropdownComponent } from '../nav-bar-dropdown/nav-bar-dropdown.component';
2
+ import * as i0 from "@angular/core";
3
+ type NavInfo = {
4
+ title: string;
5
+ mainSection?: Section;
6
+ otherSections: Section[];
7
+ };
8
+ type Section = {
9
+ title: string;
10
+ links: Link[];
11
+ auxiliaryLink?: Link;
12
+ };
13
+ type Link = {
14
+ label: string;
15
+ url: string;
16
+ icon?: string;
17
+ };
18
+ export declare class NavBarComponent {
19
+ private bo;
20
+ height: import("@angular/core").InputSignal<number | null>;
21
+ dropdownComps: NavBarDropdownComponent[];
22
+ protected handleDropdownOpenEvent: (title: string) => void;
23
+ protected isScreenSmall: import("@angular/core").Signal<boolean | undefined>;
24
+ protected navInfos: NavInfo[];
25
+ static ɵfac: i0.ɵɵFactoryDeclaration<NavBarComponent, never>;
26
+ static ɵcmp: i0.ɵɵComponentDeclaration<NavBarComponent, "lib-nav-bar", never, { "height": { "alias": "height"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
27
+ }
28
+ export {};
@@ -0,0 +1,12 @@
1
+ import { EventEmitter } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class NavBarDropdownComponent {
4
+ title: import("@angular/core").InputSignal<string>;
5
+ isSmallScreen: import("@angular/core").InputSignal<boolean>;
6
+ openEvent: EventEmitter<string>;
7
+ closeDropdown: () => boolean;
8
+ protected isOpen: boolean;
9
+ protected handleClick: () => void;
10
+ static ɵfac: i0.ɵɵFactoryDeclaration<NavBarDropdownComponent, never>;
11
+ static ɵcmp: i0.ɵɵComponentDeclaration<NavBarDropdownComponent, "lib-nav-bar-dropdown", never, { "title": { "alias": "title"; "required": true; "isSignal": true; }; "isSmallScreen": { "alias": "isSmallScreen"; "required": false; "isSignal": true; }; }, { "openEvent": "openEvent"; }, never, ["*"], true, never>;
12
+ }
@@ -0,0 +1,7 @@
1
+ import { PipeTransform } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class LibraryHoursPipe implements PipeTransform {
4
+ transform(date: string, time: string): string | null;
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<LibraryHoursPipe, never>;
6
+ static ɵpipe: i0.ɵɵPipeDeclaration<LibraryHoursPipe, "libraryHours", true>;
7
+ }
package/lib/utils.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ import { BreakpointObserver } from '@angular/cdk/layout';
2
+ /**
3
+ * Signal that represents if the screen is small.
4
+ */
5
+ export declare const isScreenSmallSignal: (bo: BreakpointObserver) => import("@angular/core").Signal<boolean | undefined>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@byuhbll/components",
3
- "version": "4.0.0-alpha.4",
3
+ "version": "4.0.0-alpha.6",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^18.0.0",
6
6
  "@angular/core": "^18.0.0"
@@ -25,6 +25,9 @@
25
25
  "./pill-btn": {
26
26
  "sass": "./styles/scss/pill-btn.scss"
27
27
  },
28
+ "./spinner": {
29
+ "sass": "./styles/scss/spinner.scss"
30
+ },
28
31
  "./package.json": {
29
32
  "default": "./package.json"
30
33
  },
@@ -1,4 +1,4 @@
1
- @use './_vars';
1
+ @use 'vars';
2
2
 
3
3
  %hbll-input-field {
4
4
  appearance: none;
@@ -3,6 +3,12 @@ $royal-blue: #0047ba;
3
3
 
4
4
  $primary-blue: #3a6093;
5
5
 
6
+ $primary-green: #207215;
7
+ $success-green: #1dce7b;
8
+
9
+ $impersonate-purple: #ca7ad1cc;
10
+ $impersonate-purple--hover: #ca7ad1;
11
+
6
12
  $interactive-blue: #4070b0;
7
13
  $interactive-blue--hover: #6892ca;
8
14
 
@@ -1,4 +1,4 @@
1
- @use './_vars.scss';
1
+ @use './vars';
2
2
 
3
3
  $sourceSansProVersion: '1.0.0';
4
4
  $icomoonVersion: '1.0.1';
@@ -170,6 +170,17 @@ section {
170
170
  body {
171
171
  background: white;
172
172
  line-height: 1.5;
173
+ font-size: 1.6rem;
174
+ font-family:
175
+ Source Sans Pro,
176
+ Helvetica Neue,
177
+ Helvetica,
178
+ Arial,
179
+ sans-serif;
180
+ }
181
+
182
+ html {
183
+ font-size: 62.5%;
173
184
  }
174
185
 
175
186
  table {
@@ -203,8 +214,14 @@ q {
203
214
  quotes: '' '';
204
215
  }
205
216
 
206
- a {
217
+ a,
218
+ button {
219
+ border: none;
220
+ background: none;
221
+ font-family: inherit;
222
+ font-size: inherit;
207
223
  text-decoration: none;
224
+ cursor: pointer;
208
225
  }
209
226
 
210
227
  a img {
@@ -218,8 +235,24 @@ ul {
218
235
  *,
219
236
  *::before,
220
237
  *::after {
221
- -moz-box-sizing: border-box;
222
- -ms-box-sizing: border-box;
223
- -webkit-box-sizing: border-box;
224
238
  box-sizing: border-box;
225
239
  }
240
+
241
+ /* Change site size on bigger browser sizes */
242
+ @media screen and (min-width: 1400px) {
243
+ html {
244
+ font-size: 70%;
245
+ }
246
+ }
247
+
248
+ @media screen and (min-width: 1720px) {
249
+ html {
250
+ font-size: 75%;
251
+ }
252
+ }
253
+
254
+ @media screen and (min-width: 2000px) {
255
+ html {
256
+ font-size: 80%;
257
+ }
258
+ }
@@ -1,5 +1,5 @@
1
- @use './_vars';
2
- @use './_mixins';
1
+ @use './vars';
2
+ @use './mixins';
3
3
 
4
4
  .cta-btn--components {
5
5
  @extend %hbll-base-btn;
@@ -1,5 +1,5 @@
1
- @use './_vars';
2
- @use './_mixins';
1
+ @use './vars';
2
+ @use './mixins';
3
3
 
4
4
  .pill-btn--components {
5
5
  @extend %hbll-base-btn;
@@ -0,0 +1,20 @@
1
+ @use 'vars';
2
+
3
+ .lib-spinner {
4
+ border: 0.3em solid #dfe9f7;
5
+ border-top: 0.3em solid vars.$interactive-blue;
6
+ border-radius: 100%;
7
+ width: 30px;
8
+ height: 30px;
9
+ animation: loadingSpinnerAnimate 1s ease infinite;
10
+ position: relative;
11
+ }
12
+
13
+ @keyframes loadingSpinnerAnimate {
14
+ 0% {
15
+ transform: rotate(0deg);
16
+ }
17
+ 100% {
18
+ transform: rotate(360deg);
19
+ }
20
+ }