@australiangreens/ag-internal-components 0.0.43 → 0.0.45

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.
@@ -1,5 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
- import { NavBarLink } from './types';
2
+ import { NavBarLink, User } from './types';
3
+ import { DomainCode } from '../../../domainCode';
3
4
  export interface NavBarProps {
4
5
  open: boolean;
5
6
  offsetTop?: number;
@@ -32,13 +33,15 @@ export interface NavBarProps {
32
33
  * ```
33
34
  */
34
35
  middle: ReactNode | NavBarLink[];
35
- /** The contents aligned against bottom of view port, user info etc */
36
- bottom?: ReactNode;
36
+ /** User information displayed at bottom of navabar when it is open*/
37
+ user?: User;
38
+ /** Displayed below the user information when available */
39
+ domainCode?: DomainCode;
37
40
  }
38
41
  /**
39
42
  * A styled navigation bar. At this point in time its pretty unopinionated, it
40
43
  * just renders whatever children it is given. The NavBarLightStyledList
41
44
  * component can be used for consistent styling against the background.
42
45
  */
43
- export default function NavBar({ open, offsetTop, widthOpen, widthClosed, 'data-testid': dataTestId, top, middle, bottom, }: NavBarProps): JSX.Element;
46
+ export default function NavBar({ open, offsetTop, widthOpen, widthClosed, 'data-testid': dataTestId, top, middle, user, domainCode, }: NavBarProps): JSX.Element;
44
47
  //# sourceMappingURL=NavBar.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"NavBar.d.ts","sourceRoot":"","sources":["../../../../../src/layouts/AppLayout/NavBar/NavBar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGlC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAOrC,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,OAAO,CAAC;IAEd,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,SAAS,EAAE,MAAM,CAAC;IAElB,WAAW,EAAE,MAAM,CAAC;IAEpB;kBACc;IACd,aAAa,CAAC,EAAE,MAA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,EACH,MAAM,EACN,IAAI,EACJ,UAAU,GACX,EAAE,WAAW,eA4Bb"}
@@ -0,0 +1,19 @@
1
+ import { DomainCode } from '../../../domainCode';
2
+ import { User } from './types';
3
+ export interface UserInfoProps {
4
+ user?: User;
5
+ domainCode?: DomainCode;
6
+ }
7
+ /**
8
+ * If user has a defined name and a valid url for picture, the picture will for
9
+ * the avatar image.
10
+ *
11
+ * If there is a defined name but the picture is invalid or undefined, the
12
+ * intials will be used to generate the avatar image. The colour will be random
13
+ * for different names, but always the same for the same name.
14
+ *
15
+ * If user is undefined or the name is undefined, a generic empty avatar image
16
+ * will be displayed.
17
+ */
18
+ export default function UserInfo({ user, domainCode }: UserInfoProps): JSX.Element;
19
+ //# sourceMappingURL=UserInfo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UserInfo.d.ts","sourceRoot":"","sources":["../../../../../src/layouts/AppLayout/NavBar/UserInfo.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAmB/B,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB;AAED;;;;;;;;;;GAUG;AACH,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,aAAa,eAgCnE"}
@@ -4,4 +4,9 @@ export interface NavBarLink {
4
4
  destPathname: string;
5
5
  icon?: ReactNode;
6
6
  }
7
+ export interface User {
8
+ name?: string;
9
+ /** URL of user's avatar image*/
10
+ picture?: string;
11
+ }
7
12
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/layouts/AppLayout/NavBar/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,SAAS,CAAC;CAElB"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/layouts/AppLayout/NavBar/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,SAAS,CAAC;CAElB;AAED,MAAM,WAAW,IAAI;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,gCAAgC;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB"}
@@ -1,4 +1,4 @@
1
- import { createStore } from 'jotai';
1
+ import { createStore, useAtom, useAtomValue, useSetAtom } from 'jotai';
2
2
  import { PropsWithChildren } from 'react';
3
3
  export declare const atomStore: {
4
4
  get: <Value>(atom: import("jotai").Atom<Value>) => Value;
@@ -96,4 +96,7 @@ export declare const AtomProvider: ({ children, store, }: PropsWithChildren<{
96
96
  dev_restore_atoms?: undefined;
97
97
  } | undefined;
98
98
  }>) => JSX.Element;
99
+ export declare const useLibraryAtom: typeof useAtom;
100
+ export declare const useSetLibraryAtom: typeof useSetAtom;
101
+ export declare const useLibraryAtomValue: typeof useAtomValue;
99
102
  //# sourceMappingURL=AtomProvider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AtomProvider.d.ts","sourceRoot":"","sources":["../../../../src/providers/Atom/AtomProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,WAAW,EAAmB,MAAM,OAAO,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE1C,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAoB,CAAC;AAE3C,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAKxB,CAAC"}
1
+ {"version":3,"file":"AtomProvider.d.ts","sourceRoot":"","sources":["../../../../src/providers/Atom/AtomProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,WAAW,EAAmB,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAClG,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE1C,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAoB,CAAC;AAE3C,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAKxB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,OAAO,OAClB,CAAC;AAEnB,eAAO,MAAM,iBAAiB,EAAE,OAAO,UAEf,CAAC;AAEzB,eAAO,MAAM,mBAAmB,EAAE,OAAO,YAER,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './simpleHashCode';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function simpleHashCode(str: string): number;
2
+ //# sourceMappingURL=simpleHashCode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"simpleHashCode.d.ts","sourceRoot":"","sources":["../../../src/utils/simpleHashCode.ts"],"names":[],"mappings":"AACA,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,UAQzC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@australiangreens/ag-internal-components",
3
3
  "private": false,
4
- "version": "0.0.43",
4
+ "version": "0.0.45",
5
5
  "type": "module",
6
6
  "homepage": "https://github.com/australiangreens/ag-internal-components#readme",
7
7
  "license": "MIT",