@dev-crew-berlin/enter-js-utils 0.4.1 → 0.5.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.
Files changed (44) hide show
  1. package/README.md +63 -2
  2. package/api-client.d.ts +1 -0
  3. package/api-client.js +1 -0
  4. package/dist/lib/class-names.d.ts +1 -0
  5. package/dist/lib/class-names.js +13 -0
  6. package/dist/lib/class-names.js.map +1 -0
  7. package/dist/lib/index.d.ts +1 -0
  8. package/dist/lib/index.js +1 -0
  9. package/dist/lib/index.js.map +1 -1
  10. package/dist/lib/theme.js +1 -1
  11. package/dist/models/field-group.d.ts +161 -481
  12. package/dist/models/field-group.js +1 -1
  13. package/dist/models/field-group.js.map +1 -1
  14. package/dist/models/field.d.ts +116 -348
  15. package/dist/models/field.js +5 -5
  16. package/dist/models/field.js.map +1 -1
  17. package/dist/ui/button.d.ts +7 -0
  18. package/dist/ui/button.js +32 -0
  19. package/dist/ui/button.js.map +1 -0
  20. package/dist/ui/button.stories.d.ts +18 -0
  21. package/dist/ui/button.stories.js +38 -0
  22. package/dist/ui/button.stories.js.map +1 -0
  23. package/dist/ui/checkin-count-indicator.d.ts +0 -1
  24. package/dist/ui/checkin-count-indicator.stories.js +1 -1
  25. package/dist/ui/checkin-count-indicator.stories.js.map +1 -1
  26. package/dist/ui/companion-info.d.ts +15 -0
  27. package/dist/ui/companion-info.js +17 -0
  28. package/dist/ui/companion-info.js.map +1 -0
  29. package/dist/ui/companion-info.stories.d.ts +44 -0
  30. package/dist/ui/companion-info.stories.js +61 -0
  31. package/dist/ui/companion-info.stories.js.map +1 -0
  32. package/dist/ui/fonts.d.ts +3 -0
  33. package/dist/ui/fonts.js +6 -0
  34. package/dist/ui/fonts.js.map +1 -0
  35. package/dist/ui/guest-card.d.ts +16 -0
  36. package/dist/ui/guest-card.js +36 -0
  37. package/dist/ui/guest-card.js.map +1 -0
  38. package/dist/ui/guest-card.stories.d.ts +92 -0
  39. package/dist/ui/guest-card.stories.js +125 -0
  40. package/dist/ui/guest-card.stories.js.map +1 -0
  41. package/dist/ui/tag.d.ts +7 -0
  42. package/dist/ui/tag.js +10 -0
  43. package/dist/ui/tag.js.map +1 -0
  44. package/package.json +1 -1
package/README.md CHANGED
@@ -1,11 +1,72 @@
1
1
  # js utils
2
2
 
3
- ## lib
3
+ ## install
4
+
5
+ ```bash
6
+ npm install @dev-crew-berlin/enter-js-utils
7
+ ```
8
+
9
+ ## packages
10
+
11
+ ### lib
4
12
 
5
13
  Some common helper functions and types.
6
14
  This also contains the dcb colors.
7
15
 
8
- ## ui
16
+ ### ui
9
17
 
10
18
  react ui components for enter and dcb apps.
11
19
  see: https://js-utils-main.mrdcb.vercel.app
20
+
21
+ ### api-client
22
+
23
+ typed js client for the enter api.
24
+
25
+ ```typescript
26
+ import EnterAPIClient from '@dev-crew-berlin/enter-js-utils/api-client'
27
+
28
+ const url = 'https://enter.events/api/v1'
29
+
30
+ async function apiExample() {
31
+ // fetch access Token
32
+ const accessToken = await EnterAPIClient.fetchAccessToken({
33
+ url: url,
34
+ user: 'me',
35
+ password: 'xxx',
36
+ deviceName: 'my-device',
37
+ })
38
+
39
+ const credentials = {
40
+ accessToken: accessToken,
41
+ url: url,
42
+ }
43
+
44
+ // create api instance
45
+ const api = new EnterAPIClient({
46
+ credentials: credentials,
47
+ onLogout: (reason?: string) => {
48
+ deleteCredetials()
49
+ },
50
+ })
51
+
52
+ const instances = await api.getInstanceList()
53
+ const attendees = await api.getAttendeeList({ instanceId: instances[0].id })
54
+ }
55
+ ```
56
+
57
+ ## models
58
+
59
+ The models retured from the api-client.
60
+
61
+ ## publish
62
+
63
+ This package is automatically published to npm for each new tag starting with `v*`.
64
+ So you can run:
65
+
66
+ ```bash
67
+ npm version patch # one of major | minor | patch or just write the version like v1.0.0
68
+ git push --follow-tags
69
+ ```
70
+
71
+ You could also create the tag manually.
72
+ If the version in the git tag and `package.json` differ the git tag is used.
package/api-client.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export * from './dist/api-client/index.js'
2
+ export { default as default } from './dist/api-client/index.js'
package/api-client.js CHANGED
@@ -1 +1,2 @@
1
1
  export * from './dist/api-client/index.js'
2
+ export { default as default } from './dist/api-client/index.js'
@@ -0,0 +1 @@
1
+ export declare function classNames(classNames: Record<string, boolean | undefined | null>): string;
@@ -0,0 +1,13 @@
1
+ export function classNames(classNames) {
2
+ return Object.entries(classNames)
3
+ .filter(function (_a) {
4
+ var isActive = _a[1];
5
+ return isActive === true;
6
+ })
7
+ .map(function (_a) {
8
+ var className = _a[0];
9
+ return className;
10
+ })
11
+ .join(' ');
12
+ }
13
+ //# sourceMappingURL=class-names.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"class-names.js","sourceRoot":"","sources":["../../src/lib/class-names.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,UAAU,CACxB,UAAsD;IAEtD,OAAO,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC;SAC9B,MAAM,CAAC,UAAC,EAAY;YAAT,QAAQ,QAAA;QAAM,OAAA,QAAQ,KAAK,IAAI;IAAjB,CAAiB,CAAC;SAC3C,GAAG,CAAC,UAAC,EAAW;YAAV,SAAS,QAAA;QAAM,OAAA,SAAS;IAAT,CAAS,CAAC;SAC/B,IAAI,CAAC,GAAG,CAAC,CAAA;AACd,CAAC"}
@@ -2,3 +2,4 @@ export * from './result';
2
2
  export * as theme from './theme';
3
3
  export * from './not-undefined';
4
4
  export * from './api-result';
5
+ export * from './class-names';
package/dist/lib/index.js CHANGED
@@ -2,4 +2,5 @@ export * from './result';
2
2
  export * as theme from './theme';
3
3
  export * from './not-undefined';
4
4
  export * from './api-result';
5
+ export * from './class-names';
5
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,OAAO,KAAK,KAAK,MAAM,SAAS,CAAA;AAChC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,cAAc,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,OAAO,KAAK,KAAK,MAAM,SAAS,CAAA;AAChC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,cAAc,CAAA;AAC5B,cAAc,eAAe,CAAA"}
package/dist/lib/theme.js CHANGED
@@ -14,6 +14,6 @@ export var colors = {
14
14
  };
15
15
  export var fonts = {
16
16
  primary: 'PTSans, sans-serif',
17
- secondary: 'Iosevka monospaced',
17
+ secondary: 'Iosevka, monospace',
18
18
  };
19
19
  //# sourceMappingURL=theme.js.map