@moser-inc/moser-labs-custom-elements 2.5.8 → 3.0.1

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/README.md CHANGED
@@ -5,7 +5,7 @@ This package contains a collection of custom elements that can be used in any we
5
5
  ## Installation
6
6
 
7
7
  ```bash
8
- npm i @moser-inc/moser-labs-custom-elements
8
+ npm i @moser-inc/moser-labs-custom-elements @moser-inc/moser-labs-themes
9
9
  ```
10
10
 
11
11
  ## Usage
@@ -13,6 +13,7 @@ npm i @moser-inc/moser-labs-custom-elements
13
13
  For these custom elements to function properly, you must first authenticate the user with Keycloak before calling the provided `registerCustomElements` function, passing the Keycloak instance to it.
14
14
 
15
15
  ```ts
16
+ import Labs from '@moser-inc/moser-labs-themes/labs';
16
17
  import Keycloak from 'keycloak-js';
17
18
  import { registerCustomElements } from '@moser-inc/moser-labs-custom-elements';
18
19
 
@@ -21,7 +22,10 @@ const keycloak = new Keycloak('/keycloak.json');
21
22
  keycloak.init({ onLoad: 'login-required' }).then((isAuthenticated) => {
22
23
  if (!isAuthenticated) return;
23
24
 
24
- registerCustomElements({ keycloak });
25
+ registerCustomElements({
26
+ preset: Labs,
27
+ keycloak,
28
+ });
25
29
  });
26
30
  ```
27
31
 
@@ -30,7 +34,11 @@ keycloak.init({ onLoad: 'login-required' }).then((isAuthenticated) => {
30
34
  In order for the custom elements to use the correct instance for calling API endpoints and getting profile pictures, pass the `apiUri` option to `registerCustomElements`, using an environment variable for it to be dynamic between staging and production. It defaults to using `window.location.origin`.
31
35
 
32
36
  ```ts
33
- registerCustomElements({ keycloak, apiUri: import.meta.env.VITE_API_URI });
37
+ registerCustomElements({
38
+ preset: Labs,
39
+ keycloak,
40
+ apiUri: import.meta.env.VITE_API_URI,
41
+ });
34
42
  ```
35
43
 
36
44
  ## External