@dev-crew-berlin/enter-js-utils 0.5.3 → 0.5.4

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 (103) hide show
  1. package/dist/api-client/api-base.js +160 -287
  2. package/dist/api-client/index.js +73 -190
  3. package/dist/lib/api-result.js +9 -13
  4. package/dist/lib/class-names.js +2 -12
  5. package/dist/lib/index.js +1 -2
  6. package/dist/lib/not-undefined.js +2 -3
  7. package/dist/lib/result.js +27 -23
  8. package/dist/lib/theme.js +17 -18
  9. package/dist/models/_helpers.js +64 -65
  10. package/dist/models/access-token.js +9 -6
  11. package/dist/models/attendee.js +109 -100
  12. package/dist/models/checkin-counts.js +7 -3
  13. package/dist/models/checkins.js +61 -69
  14. package/dist/models/event.js +1 -2
  15. package/dist/models/field-group.js +43 -43
  16. package/dist/models/field-value.js +1 -2
  17. package/dist/models/field.js +86 -41
  18. package/dist/models/index.js +1 -2
  19. package/dist/models/instance.js +109 -99
  20. package/dist/models/invite.js +18 -15
  21. package/dist/models/meta-field.js +8 -7
  22. package/dist/models/user.js +10 -9
  23. package/dist/models/variable.js +15 -14
  24. package/dist/ui/button.js +15 -29
  25. package/dist/ui/button.stories.js +17 -27
  26. package/dist/ui/checkin-count-indicator.js +67 -46
  27. package/dist/ui/checkin-count-indicator.stories.js +45 -47
  28. package/dist/ui/companion-info.js +14 -14
  29. package/dist/ui/companion-info.stories.js +59 -50
  30. package/dist/ui/fonts.js +6 -4
  31. package/dist/ui/guest-card.js +39 -30
  32. package/dist/ui/guest-card.stories.js +115 -104
  33. package/dist/ui/index.js +1 -2
  34. package/dist/ui/tag.js +9 -6
  35. package/package.json +7 -34
  36. package/dist/api-client/api-base.d.ts +0 -30
  37. package/dist/api-client/api-base.js.map +0 -1
  38. package/dist/api-client/index.d.ts +0 -75
  39. package/dist/api-client/index.js.map +0 -1
  40. package/dist/lib/api-result.d.ts +0 -25
  41. package/dist/lib/api-result.js.map +0 -1
  42. package/dist/lib/class-names.d.ts +0 -1
  43. package/dist/lib/class-names.js.map +0 -1
  44. package/dist/lib/index.d.ts +0 -5
  45. package/dist/lib/index.js.map +0 -1
  46. package/dist/lib/not-undefined.d.ts +0 -1
  47. package/dist/lib/not-undefined.js.map +0 -1
  48. package/dist/lib/result.d.ts +0 -33
  49. package/dist/lib/result.js.map +0 -1
  50. package/dist/lib/theme.d.ts +0 -18
  51. package/dist/lib/theme.js.map +0 -1
  52. package/dist/models/_helpers.d.ts +0 -23
  53. package/dist/models/_helpers.js.map +0 -1
  54. package/dist/models/access-token.d.ts +0 -11
  55. package/dist/models/access-token.js.map +0 -1
  56. package/dist/models/attendee.d.ts +0 -90
  57. package/dist/models/attendee.js.map +0 -1
  58. package/dist/models/checkin-counts.d.ts +0 -10
  59. package/dist/models/checkin-counts.js.map +0 -1
  60. package/dist/models/checkins.d.ts +0 -40
  61. package/dist/models/checkins.js.map +0 -1
  62. package/dist/models/event.d.ts +0 -40
  63. package/dist/models/event.js.map +0 -1
  64. package/dist/models/field-group.d.ts +0 -484
  65. package/dist/models/field-group.js.map +0 -1
  66. package/dist/models/field-value.d.ts +0 -2
  67. package/dist/models/field-value.js.map +0 -1
  68. package/dist/models/field.d.ts +0 -321
  69. package/dist/models/field.js.map +0 -1
  70. package/dist/models/index.d.ts +0 -14
  71. package/dist/models/index.js.map +0 -1
  72. package/dist/models/instance.d.ts +0 -78
  73. package/dist/models/instance.js.map +0 -1
  74. package/dist/models/invite.d.ts +0 -33
  75. package/dist/models/invite.js.map +0 -1
  76. package/dist/models/meta-field.d.ts +0 -7
  77. package/dist/models/meta-field.js.map +0 -1
  78. package/dist/models/user.d.ts +0 -18
  79. package/dist/models/user.js.map +0 -1
  80. package/dist/models/variable.d.ts +0 -27
  81. package/dist/models/variable.js.map +0 -1
  82. package/dist/ui/button.d.ts +0 -7
  83. package/dist/ui/button.js.map +0 -1
  84. package/dist/ui/button.stories.d.ts +0 -18
  85. package/dist/ui/button.stories.js.map +0 -1
  86. package/dist/ui/checkin-count-indicator.d.ts +0 -15
  87. package/dist/ui/checkin-count-indicator.js.map +0 -1
  88. package/dist/ui/checkin-count-indicator.stories.d.ts +0 -84
  89. package/dist/ui/checkin-count-indicator.stories.js.map +0 -1
  90. package/dist/ui/companion-info.d.ts +0 -15
  91. package/dist/ui/companion-info.js.map +0 -1
  92. package/dist/ui/companion-info.stories.d.ts +0 -44
  93. package/dist/ui/companion-info.stories.js.map +0 -1
  94. package/dist/ui/fonts.d.ts +0 -3
  95. package/dist/ui/fonts.js.map +0 -1
  96. package/dist/ui/guest-card.d.ts +0 -16
  97. package/dist/ui/guest-card.js.map +0 -1
  98. package/dist/ui/guest-card.stories.d.ts +0 -92
  99. package/dist/ui/guest-card.stories.js.map +0 -1
  100. package/dist/ui/index.d.ts +0 -6
  101. package/dist/ui/index.js.map +0 -1
  102. package/dist/ui/tag.d.ts +0 -7
  103. package/dist/ui/tag.js.map +0 -1
@@ -1,64 +1,62 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
1
  import React from 'react';
13
2
  import { CheckinCountIndicator } from './checkin-count-indicator';
14
3
  export default {
15
- title: 'Checkin-Count Indicator',
16
- component: CheckinCountIndicator,
4
+ title: 'Checkin-Count Indicator',
5
+ component: CheckinCountIndicator
6
+ };
7
+ const exampleCheckin = {
8
+ time: new Date('2022-01-01')
17
9
  };
18
- var exampleCheckin = { time: new Date('2022-01-01') };
19
- var Template = function (args) { return (React.createElement(CheckinCountIndicator, __assign({}, args))); };
20
- export var SingleResponse = Template.bind({});
10
+
11
+ const Template = args => /*#__PURE__*/React.createElement(CheckinCountIndicator, args);
12
+
13
+ export const SingleResponse = Template.bind({});
21
14
  SingleResponse.args = {
22
- checkins: [],
23
- response: 'positive-response',
24
- rsvpCount: 1,
15
+ checkins: [],
16
+ response: 'positive-response',
17
+ rsvpCount: 1
18
+ };
19
+ export const Decline = Template.bind({});
20
+ Decline.args = {
21
+ checkins: [],
22
+ response: 'negative-repsone'
25
23
  };
26
- export var Decline = Template.bind({});
27
- Decline.args = { checkins: [], response: 'negative-repsone' };
28
- export var NoResponse = Template.bind({});
29
- NoResponse.args = { checkins: [], response: 'no-response' };
30
- export var MultipleResponses = Template.bind({});
24
+ export const NoResponse = Template.bind({});
25
+ NoResponse.args = {
26
+ checkins: [],
27
+ response: 'no-response'
28
+ };
29
+ export const MultipleResponses = Template.bind({});
31
30
  MultipleResponses.args = {
32
- checkins: [],
33
- response: 'positive-response',
34
- rsvpCount: 16,
31
+ checkins: [],
32
+ response: 'positive-response',
33
+ rsvpCount: 16
35
34
  };
36
- export var CheckinAndResponse = Template.bind({});
35
+ export const CheckinAndResponse = Template.bind({});
37
36
  CheckinAndResponse.args = {
38
- checkins: [exampleCheckin],
39
- response: 'positive-response',
40
- rsvpCount: 1,
37
+ checkins: [exampleCheckin],
38
+ response: 'positive-response',
39
+ rsvpCount: 1
41
40
  };
42
- export var MultipleCheckinsAndResponse = Template.bind({});
41
+ export const MultipleCheckinsAndResponse = Template.bind({});
43
42
  MultipleCheckinsAndResponse.args = {
44
- checkins: [exampleCheckin, exampleCheckin],
45
- response: 'positive-response',
46
- rsvpCount: 1,
43
+ checkins: [exampleCheckin, exampleCheckin],
44
+ response: 'positive-response',
45
+ rsvpCount: 1
47
46
  };
48
- export var CheckinsWithDecline = Template.bind({});
47
+ export const CheckinsWithDecline = Template.bind({});
49
48
  CheckinsWithDecline.args = {
50
- checkins: [exampleCheckin],
51
- response: 'negative-repsone',
49
+ checkins: [exampleCheckin],
50
+ response: 'negative-repsone'
52
51
  };
53
- export var CheckinWithoutResponse = Template.bind({});
52
+ export const CheckinWithoutResponse = Template.bind({});
54
53
  CheckinWithoutResponse.args = {
55
- checkins: [exampleCheckin],
56
- response: 'no-response',
54
+ checkins: [exampleCheckin],
55
+ response: 'no-response'
57
56
  };
58
- export var MultipleCheckins = Template.bind({});
57
+ export const MultipleCheckins = Template.bind({});
59
58
  MultipleCheckins.args = {
60
- checkins: [exampleCheckin, exampleCheckin, exampleCheckin, exampleCheckin],
61
- response: 'positive-response',
62
- rsvpCount: 2,
63
- };
64
- //# sourceMappingURL=checkin-count-indicator.stories.js.map
59
+ checkins: [exampleCheckin, exampleCheckin, exampleCheckin, exampleCheckin],
60
+ response: 'positive-response',
61
+ rsvpCount: 2
62
+ };
@@ -1,17 +1,17 @@
1
+ import _JSXStyle from "styled-jsx/style";
1
2
  import React from 'react';
2
3
  import 'styled-jsx';
3
4
  import { theme } from '../lib';
4
- export var CompanionInfo = function (props) {
5
- if (!props.companionStatus.isCompanion)
6
- return null;
7
- var mainGuest = props.findMainGuest
8
- ? props.findMainGuest(props.companionStatus.mainGuestId)
9
- : undefined;
10
- var mainGuestName = mainGuest ? props.formatName(mainGuest) : undefined;
11
- return (React.createElement("p", { className: 'companion-info' },
12
- mainGuestName ? (React.createElement(React.Fragment, null,
13
- "companion of ",
14
- React.createElement("span", { className: 'companion-name' }, mainGuestName))) : (React.createElement(React.Fragment, null, "companion")),
15
- React.createElement("style", { jsx: true }, "\n .companion-info {\n margin: -0.5em 0 0.4em;\n color: ".concat(theme.colors.enterMediumGrey, ";\n font-family: ").concat(theme.fonts.primary, ";\n }\n\n .companion-name {\n color: ").concat(theme.colors.enterDarkGrey, ";\n }\n "))));
16
- };
17
- //# sourceMappingURL=companion-info.js.map
5
+ export const CompanionInfo = props => {
6
+ if (!props.companionStatus.isCompanion) return null;
7
+ const mainGuest = props.findMainGuest ? props.findMainGuest(props.companionStatus.mainGuestId) : undefined;
8
+ const mainGuestName = mainGuest ? props.formatName(mainGuest) : undefined;
9
+ return /*#__PURE__*/React.createElement("p", {
10
+ className: _JSXStyle.dynamic([["353274210", [theme.colors.enterMediumGrey, theme.fonts.primary, theme.colors.enterDarkGrey]]]) + " " + 'companion-info'
11
+ }, mainGuestName ? /*#__PURE__*/React.createElement(React.Fragment, null, "companion of ", /*#__PURE__*/React.createElement("span", {
12
+ className: _JSXStyle.dynamic([["353274210", [theme.colors.enterMediumGrey, theme.fonts.primary, theme.colors.enterDarkGrey]]]) + " " + 'companion-name'
13
+ }, mainGuestName)) : /*#__PURE__*/React.createElement(React.Fragment, null, "companion"), /*#__PURE__*/React.createElement(_JSXStyle, {
14
+ id: "353274210",
15
+ dynamic: [theme.colors.enterMediumGrey, theme.fonts.primary, theme.colors.enterDarkGrey]
16
+ }, `.companion-info.__jsx-style-dynamic-selector{margin:-0.5em 0 0.4em;color:${theme.colors.enterMediumGrey};font-family:${theme.fonts.primary};}.companion-name.__jsx-style-dynamic-selector{color:${theme.colors.enterDarkGrey};}`));
17
+ };
@@ -1,61 +1,70 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
1
  import React from 'react';
13
2
  import { CompanionInfo } from './companion-info';
14
3
  import { Attendee } from '../models';
15
4
  export default {
16
- title: 'Companion Info',
17
- component: CompanionInfo,
18
- argTypes: { formatName: { type: 'function' } },
5
+ title: 'Companion Info',
6
+ component: CompanionInfo,
7
+ argTypes: {
8
+ formatName: {
9
+ type: 'function'
10
+ }
11
+ }
19
12
  };
20
- var mainGuest = new Attendee({
21
- id: 'my-attendee',
22
- language: 'de',
23
- auth: null,
24
- tags: ['VIP', 'Import-200-02-10'],
25
- time: new Date('2022-01-01'),
26
- rsvp: { default: 1 },
27
- checkin: {},
28
- payment: null,
29
- companions: { isCompanion: false },
30
- userdata: {
31
- name: 'Max Mustermann',
32
- },
33
- metadata: {},
13
+ const mainGuest = new Attendee({
14
+ id: 'my-attendee',
15
+ language: 'de',
16
+ auth: null,
17
+ tags: ['VIP', 'Import-200-02-10'],
18
+ time: new Date('2022-01-01'),
19
+ rsvp: {
20
+ default: 1
21
+ },
22
+ checkin: {},
23
+ payment: null,
24
+ companions: {
25
+ isCompanion: false
26
+ },
27
+ userdata: {
28
+ name: 'Max Mustermann'
29
+ },
30
+ metadata: {}
34
31
  });
35
- var Template = function (args) { return (React.createElement(CompanionInfo, __assign({}, args))); };
36
- export var WithMainGuestFound = Template.bind({});
32
+
33
+ const Template = args => /*#__PURE__*/React.createElement(CompanionInfo, args);
34
+
35
+ export const WithMainGuestFound = Template.bind({});
37
36
  WithMainGuestFound.args = {
38
- companionStatus: { isCompanion: true, mainGuestId: 'my-attendee' },
39
- findMainGuest: function () { return mainGuest; },
40
- formatName: function (attendee) {
41
- var _a, _b;
42
- return (_b = (_a = attendee.userdata.name) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : '';
43
- },
37
+ companionStatus: {
38
+ isCompanion: true,
39
+ mainGuestId: 'my-attendee'
40
+ },
41
+ findMainGuest: () => mainGuest,
42
+
43
+ formatName(attendee) {
44
+ return attendee.userdata.name?.toString() ?? '';
45
+ }
46
+
44
47
  };
45
- export var WithoutMainGuest = Template.bind({});
48
+ export const WithoutMainGuest = Template.bind({});
46
49
  WithoutMainGuest.args = {
47
- companionStatus: { isCompanion: true, mainGuestId: 'my-attendee' },
48
- formatName: function (attendee) {
49
- var _a, _b;
50
- return (_b = (_a = attendee.userdata.name) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : '';
51
- },
50
+ companionStatus: {
51
+ isCompanion: true,
52
+ mainGuestId: 'my-attendee'
53
+ },
54
+
55
+ formatName(attendee) {
56
+ return attendee.userdata.name?.toString() ?? '';
57
+ }
58
+
52
59
  };
53
- export var NotACompanion = Template.bind({});
60
+ export const NotACompanion = Template.bind({});
54
61
  NotACompanion.args = {
55
- companionStatus: { isCompanion: false },
56
- formatName: function (attendee) {
57
- var _a, _b;
58
- return (_b = (_a = attendee.userdata.name) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : '';
59
- },
60
- };
61
- //# sourceMappingURL=companion-info.stories.js.map
62
+ companionStatus: {
63
+ isCompanion: false
64
+ },
65
+
66
+ formatName(attendee) {
67
+ return attendee.userdata.name?.toString() ?? '';
68
+ }
69
+
70
+ };
package/dist/ui/fonts.js CHANGED
@@ -1,6 +1,8 @@
1
+ import _JSXStyle from "styled-jsx/style";
1
2
  import React from 'react';
2
3
  import 'styled-jsx';
3
- export var Fonts = function () {
4
- return (React.createElement("style", { jsx: true, global: true }, "\n @font-face {\n font-family: 'PTSans';\n font-display: swap;\n src: url('/fonts/pt-sans-v12-latin-regular.woff2');\n font-weight: 300;\n font-style: normal;\n }\n @font-face {\n font-family: 'PTSans';\n font-display: swap;\n src: url('/fonts/pt-sans-v12-latin-italic.woff2');\n font-weight: 300;\n font-style: italic;\n }\n @font-face {\n font-family: 'PTSans';\n font-display: swap;\n src: url('/fonts/pt-sans-v12-latin-700.woff2');\n font-weight: 700;\n font-style: normal;\n }\n @font-face {\n font-family: 'PTSans';\n font-display: swap;\n src: url('/fonts/pt-sans-v12-latin-700italic.woff2');\n font-weight: 700;\n font-style: italic;\n }\n @font-face {\n font-family: 'Iosevka';\n src: url('/fonts/iosevka-regular.woff2');\n font-weight: 300;\n font-style: bold;\n }\n @font-face {\n font-family: 'Iosevka';\n src: url('/fonts/iosevka-medium.woff2');\n font-weight: 500;\n font-style: bold;\n }\n @font-face {\n font-family: 'Iosevka';\n src: url('/fonts/iosevka-semibold.woff2');\n font-weight: 600;\n font-style: bold;\n }\n @font-face {\n font-family: 'Iosevka';\n src: url('/fonts/iosevka-bold.woff2');\n font-weight: 700;\n font-style: bold;\n }\n @font-face {\n font-family: 'Iosevka';\n src: url('/fonts/iosevka-heavy.woff2');\n font-weight: 900;\n font-style: bold;\n }\n "));
5
- };
6
- //# sourceMappingURL=fonts.js.map
4
+ export const Fonts = () => {
5
+ return /*#__PURE__*/React.createElement(_JSXStyle, {
6
+ id: "3815458256"
7
+ }, "@font-face{font-family:'PTSans';font-display:swap;src:url('/fonts/pt-sans-v12-latin-regular.woff2');font-weight:300;font-style:normal;}@font-face{font-family:'PTSans';font-display:swap;src:url('/fonts/pt-sans-v12-latin-italic.woff2');font-weight:300;font-style:italic;}@font-face{font-family:'PTSans';font-display:swap;src:url('/fonts/pt-sans-v12-latin-700.woff2');font-weight:700;font-style:normal;}@font-face{font-family:'PTSans';font-display:swap;src:url('/fonts/pt-sans-v12-latin-700italic.woff2');font-weight:700;font-style:italic;}@font-face{font-family:'Iosevka';src:url('/fonts/iosevka-regular.woff2');font-weight:300;font-style:bold;}@font-face{font-family:'Iosevka';src:url('/fonts/iosevka-medium.woff2');font-weight:500;font-style:bold;}@font-face{font-family:'Iosevka';src:url('/fonts/iosevka-semibold.woff2');font-weight:600;font-style:bold;}@font-face{font-family:'Iosevka';src:url('/fonts/iosevka-bold.woff2');font-weight:700;font-style:bold;}@font-face{font-family:'Iosevka';src:url('/fonts/iosevka-heavy.woff2');font-weight:900;font-style:bold;}");
8
+ };
@@ -1,36 +1,45 @@
1
+ import _JSXStyle from "styled-jsx/style";
1
2
  import React from 'react';
2
3
  import 'styled-jsx';
3
4
  import { classNames as cx, theme } from '../lib';
4
5
  import { CheckinCountIndicator } from './checkin-count-indicator';
5
6
  import { CompanionInfo } from './companion-info';
6
7
  import { Tag } from './tag';
7
- export var GuestCard = function (props) {
8
- var _a;
9
- var filterTags = (_a = props.filterTags) !== null && _a !== void 0 ? _a : (function () { return true; });
10
- var tags = (props.attendee.tags || []).filter(filterTags);
11
- var onClick = props.onClick
12
- ? function () {
13
- if (!props.onClick)
14
- return;
15
- props.onClick(props.attendee.id);
16
- }
17
- : undefined;
18
- return (React.createElement("div", { className: cx({
19
- 'guest-card': true,
20
- plain: props.plain,
21
- labeled: props.labelColor !== undefined,
22
- }), onClick: onClick },
23
- React.createElement("div", null,
24
- React.createElement("h2", { className: 'name' }, props.formatName(props.attendee)),
25
- React.createElement(CompanionInfo, { companionStatus: props.attendee.companions, findMainGuest: props.findMainGuest, formatName: props.formatName }),
26
- React.createElement(CheckinCountIndicator, { checkins: props.attendee
27
- .getCheckinsForTag(props.checkinTag)
28
- .getAllCheckins(), response: props.attendee.getResponseForTag(props.checkinTag), rsvpCount: props.attendee.getRsvpCountForTag(props.checkinTag) })),
29
- React.createElement("div", { className: 'tag-list' },
30
- tags.map(function (tag) { return (React.createElement(Tag, { key: tag }, tag)); }),
31
- props.infoText && React.createElement("div", { className: 'info' },
32
- " ",
33
- props.infoText)),
34
- React.createElement("style", { jsx: true }, "\n .guest-card {\n position: relative;\n display: flex;\n justify-content: space-between;\n align-items: start;\n border-radius: 2px;\n border: 1px solid ".concat(theme.colors.enterGrey, ";\n background-color: ").concat(theme.colors.enterBackground, ";\n font-family: ").concat(theme.fonts.primary, ";\n padding: 1.1em 1em 0.9em;\n margin: 1.5em 0;\n user-select: none;\n }\n\n .plain {\n border: none;\n background-color: transparent;\n }\n\n .labeled::before {\n content: '';\n position: absolute;\n top: -1px;\n right: -1px;\n width: 3px;\n height: 100%;\n background-color: ").concat(props.labelColor, ";\n border: 1px solid ").concat(props.labelColor, ";\n border-radius: 0 2px 2px 0;\n }\n\n .name {\n font-size: 1.15em;\n margin: -0.1em 0 0.3em;\n }\n\n .tag-list {\n max-width: 40%;\n text-align: right;\n }\n\n .info {\n display: block;\n width: 100%;\n text-align: right;\n }\n "))));
35
- };
36
- //# sourceMappingURL=guest-card.js.map
8
+ export const GuestCard = props => {
9
+ const filterTags = props.filterTags ?? (() => true);
10
+
11
+ const tags = (props.attendee.tags || []).filter(filterTags);
12
+ const onClick = props.onClick ? () => {
13
+ if (!props.onClick) return;
14
+ props.onClick(props.attendee.id);
15
+ } : undefined;
16
+ return /*#__PURE__*/React.createElement("div", {
17
+ onClick: onClick,
18
+ className: _JSXStyle.dynamic([["2201546649", [theme.colors.enterGrey, theme.colors.enterBackground, theme.fonts.primary, props.labelColor, props.labelColor]]]) + " " + (cx({
19
+ 'guest-card': true,
20
+ plain: props.plain,
21
+ labeled: props.labelColor !== undefined
22
+ }) || "")
23
+ }, /*#__PURE__*/React.createElement("div", {
24
+ className: _JSXStyle.dynamic([["2201546649", [theme.colors.enterGrey, theme.colors.enterBackground, theme.fonts.primary, props.labelColor, props.labelColor]]])
25
+ }, /*#__PURE__*/React.createElement("h2", {
26
+ className: _JSXStyle.dynamic([["2201546649", [theme.colors.enterGrey, theme.colors.enterBackground, theme.fonts.primary, props.labelColor, props.labelColor]]]) + " " + 'name'
27
+ }, props.formatName(props.attendee)), /*#__PURE__*/React.createElement(CompanionInfo, {
28
+ companionStatus: props.attendee.companions,
29
+ findMainGuest: props.findMainGuest,
30
+ formatName: props.formatName
31
+ }), /*#__PURE__*/React.createElement(CheckinCountIndicator, {
32
+ checkins: props.attendee.getCheckinsForTag(props.checkinTag).getAllCheckins(),
33
+ response: props.attendee.getResponseForTag(props.checkinTag),
34
+ rsvpCount: props.attendee.getRsvpCountForTag(props.checkinTag)
35
+ })), /*#__PURE__*/React.createElement("div", {
36
+ className: _JSXStyle.dynamic([["2201546649", [theme.colors.enterGrey, theme.colors.enterBackground, theme.fonts.primary, props.labelColor, props.labelColor]]]) + " " + 'tag-list'
37
+ }, tags.map(tag => /*#__PURE__*/React.createElement(Tag, {
38
+ key: tag
39
+ }, tag)), props.infoText && /*#__PURE__*/React.createElement("div", {
40
+ className: _JSXStyle.dynamic([["2201546649", [theme.colors.enterGrey, theme.colors.enterBackground, theme.fonts.primary, props.labelColor, props.labelColor]]]) + " " + 'info'
41
+ }, " ", props.infoText)), /*#__PURE__*/React.createElement(_JSXStyle, {
42
+ id: "2201546649",
43
+ dynamic: [theme.colors.enterGrey, theme.colors.enterBackground, theme.fonts.primary, props.labelColor, props.labelColor]
44
+ }, `.guest-card.__jsx-style-dynamic-selector{position:relative;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;-webkit-align-items:start;-webkit-box-align:start;-ms-flex-align:start;align-items:start;border-radius:2px;border:1px solid ${theme.colors.enterGrey};background-color:${theme.colors.enterBackground};font-family:${theme.fonts.primary};padding:1.1em 1em 0.9em;margin:1.5em 0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}.plain.__jsx-style-dynamic-selector{border:none;background-color:transparent;}.labeled.__jsx-style-dynamic-selector::before{content:'';position:absolute;top:-1px;right:-1px;width:3px;height:100%;background-color:${props.labelColor};border:1px solid ${props.labelColor};border-radius:0 2px 2px 0;}.name.__jsx-style-dynamic-selector{font-size:1.15em;margin:-0.1em 0 0.3em;}.tag-list.__jsx-style-dynamic-selector{max-width:40%;text-align:right;}.info.__jsx-style-dynamic-selector{display:block;width:100%;text-align:right;}`));
45
+ };
@@ -1,125 +1,136 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
1
  import React from 'react';
13
2
  import { GuestCard } from './guest-card';
14
3
  import { Attendee } from '../models';
15
4
  import { theme } from '../lib';
16
5
  export default {
17
- title: 'Guest Card',
18
- component: GuestCard,
19
- argTypes: { formatName: { type: 'function' } },
6
+ title: 'Guest Card',
7
+ component: GuestCard,
8
+ argTypes: {
9
+ formatName: {
10
+ type: 'function'
11
+ }
12
+ }
20
13
  };
21
- var attendee = new Attendee({
22
- id: 'my-attendee',
23
- language: 'de',
24
- auth: null,
25
- tags: ['VIP', 'Import-200-02-10'],
26
- time: new Date('2022-01-01'),
27
- rsvp: { default: 1 },
28
- checkin: {},
29
- payment: null,
30
- companions: { isCompanion: false },
31
- userdata: {
32
- name: 'Max Mustermann',
33
- },
34
- metadata: {},
14
+ const attendee = new Attendee({
15
+ id: 'my-attendee',
16
+ language: 'de',
17
+ auth: null,
18
+ tags: ['VIP', 'Import-200-02-10'],
19
+ time: new Date('2022-01-01'),
20
+ rsvp: {
21
+ default: 1
22
+ },
23
+ checkin: {},
24
+ payment: null,
25
+ companions: {
26
+ isCompanion: false
27
+ },
28
+ userdata: {
29
+ name: 'Max Mustermann'
30
+ },
31
+ metadata: {}
35
32
  });
36
- var companion = new Attendee({
37
- id: 'my-companion',
38
- language: 'de',
39
- auth: null,
40
- tags: ['VIP', 'Import-200-02-10'],
41
- time: new Date('2022-01-01'),
42
- rsvp: { default: 1 },
43
- checkin: {},
44
- payment: null,
45
- companions: { isCompanion: true, mainGuestId: 'my-attendee' },
46
- userdata: {
47
- name: 'Jhon Doe',
48
- },
49
- metadata: {},
33
+ const companion = new Attendee({
34
+ id: 'my-companion',
35
+ language: 'de',
36
+ auth: null,
37
+ tags: ['VIP', 'Import-200-02-10'],
38
+ time: new Date('2022-01-01'),
39
+ rsvp: {
40
+ default: 1
41
+ },
42
+ checkin: {},
43
+ payment: null,
44
+ companions: {
45
+ isCompanion: true,
46
+ mainGuestId: 'my-attendee'
47
+ },
48
+ userdata: {
49
+ name: 'Jhon Doe'
50
+ },
51
+ metadata: {}
50
52
  });
51
- var Template = function (args) { return (React.createElement(GuestCard, __assign({}, args))); };
52
- export var WithBackground = Template.bind({});
53
+
54
+ const Template = args => /*#__PURE__*/React.createElement(GuestCard, args);
55
+
56
+ export const WithBackground = Template.bind({});
53
57
  WithBackground.args = {
54
- attendee: attendee,
55
- checkinTag: 'default',
56
- formatName: function (attendee) {
57
- var _a, _b;
58
- return (_b = (_a = attendee.userdata.name) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : '';
59
- },
58
+ attendee: attendee,
59
+ checkinTag: 'default',
60
+
61
+ formatName(attendee) {
62
+ return attendee.userdata.name?.toString() ?? '';
63
+ }
64
+
60
65
  };
61
- export var Plain = Template.bind({});
66
+ export const Plain = Template.bind({});
62
67
  Plain.args = {
63
- plain: true,
64
- attendee: attendee,
65
- checkinTag: 'default',
66
- formatName: function (attendee) {
67
- var _a, _b;
68
- return (_b = (_a = attendee.userdata.name) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : '';
69
- },
68
+ plain: true,
69
+ attendee: attendee,
70
+ checkinTag: 'default',
71
+
72
+ formatName(attendee) {
73
+ return attendee.userdata.name?.toString() ?? '';
74
+ }
75
+
70
76
  };
71
- export var FilteredTags = Template.bind({});
77
+ export const FilteredTags = Template.bind({});
72
78
  FilteredTags.args = {
73
- attendee: attendee,
74
- checkinTag: 'default',
75
- filterTags: function (tag) {
76
- var allowedTags = ['VIP'];
77
- return allowedTags.includes(tag);
78
- },
79
- formatName: function (attendee) {
80
- var _a, _b;
81
- return (_b = (_a = attendee.userdata.name) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : '';
82
- },
79
+ attendee: attendee,
80
+ checkinTag: 'default',
81
+
82
+ filterTags(tag) {
83
+ const allowedTags = ['VIP'];
84
+ return allowedTags.includes(tag);
85
+ },
86
+
87
+ formatName(attendee) {
88
+ return attendee.userdata.name?.toString() ?? '';
89
+ }
90
+
83
91
  };
84
- export var WithColorLabel = Template.bind({});
92
+ export const WithColorLabel = Template.bind({});
85
93
  WithColorLabel.args = {
86
- attendee: attendee,
87
- checkinTag: 'default',
88
- labelColor: theme.colors.enterPink,
89
- formatName: function (attendee) {
90
- var _a, _b;
91
- return (_b = (_a = attendee.userdata.name) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : '';
92
- },
94
+ attendee: attendee,
95
+ checkinTag: 'default',
96
+ labelColor: theme.colors.enterPink,
97
+
98
+ formatName(attendee) {
99
+ return attendee.userdata.name?.toString() ?? '';
100
+ }
101
+
93
102
  };
94
- export var WithInfoText = Template.bind({});
103
+ export const WithInfoText = Template.bind({});
95
104
  WithInfoText.args = {
96
- attendee: attendee,
97
- checkinTag: 'default',
98
- infoText: '🥦 Vegetarian',
99
- formatName: function (attendee) {
100
- var _a, _b;
101
- return (_b = (_a = attendee.userdata.name) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : '';
102
- },
105
+ attendee: attendee,
106
+ checkinTag: 'default',
107
+ infoText: '🥦 Vegetarian',
108
+
109
+ formatName(attendee) {
110
+ return attendee.userdata.name?.toString() ?? '';
111
+ }
112
+
103
113
  };
104
- export var WithCompanion = Template.bind({});
114
+ export const WithCompanion = Template.bind({});
105
115
  WithCompanion.args = {
106
- attendee: companion,
107
- checkinTag: 'default',
108
- findMainGuest: function () {
109
- return attendee;
110
- },
111
- formatName: function (attendee) {
112
- var _a, _b;
113
- return (_b = (_a = attendee.userdata.name) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : '';
114
- },
116
+ attendee: companion,
117
+ checkinTag: 'default',
118
+ findMainGuest: () => {
119
+ return attendee;
120
+ },
121
+
122
+ formatName(attendee) {
123
+ return attendee.userdata.name?.toString() ?? '';
124
+ }
125
+
115
126
  };
116
- export var WithCompanionButNoMainGuestInfo = Template.bind({});
127
+ export const WithCompanionButNoMainGuestInfo = Template.bind({});
117
128
  WithCompanionButNoMainGuestInfo.args = {
118
- attendee: companion,
119
- checkinTag: 'default',
120
- formatName: function (attendee) {
121
- var _a, _b;
122
- return (_b = (_a = attendee.userdata.name) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : '';
123
- },
124
- };
125
- //# sourceMappingURL=guest-card.stories.js.map
129
+ attendee: companion,
130
+ checkinTag: 'default',
131
+
132
+ formatName(attendee) {
133
+ return attendee.userdata.name?.toString() ?? '';
134
+ }
135
+
136
+ };
package/dist/ui/index.js CHANGED
@@ -3,5 +3,4 @@ export { CheckinCountIndicator } from './checkin-count-indicator';
3
3
  export { CompanionInfo } from './companion-info';
4
4
  export { Fonts } from './fonts';
5
5
  export { GuestCard } from './guest-card';
6
- export { Tag } from './tag';
7
- //# sourceMappingURL=index.js.map
6
+ export { Tag } from './tag';
package/dist/ui/tag.js CHANGED
@@ -1,9 +1,12 @@
1
+ import _JSXStyle from "styled-jsx/style";
1
2
  import React from 'react';
2
3
  import 'styled-jsx';
3
4
  import { theme } from '../lib';
4
- export var Tag = function (props) {
5
- return (React.createElement("div", { className: 'tag' },
6
- props.children,
7
- React.createElement("style", { jsx: true }, "\n .tag {\n font-family: ".concat(theme.fonts.primary, ";\n font-size: 0.8em;\n color: ").concat(theme.colors.enterDarkGrey, ";\n text-transform: uppercase;\n display: inline-block;\n background-color: transparent;\n border-radius: 2px;\n border: 1px solid ").concat(theme.colors.enterGrey, ";\n padding: 2px 8px;\n margin: 0 0 0.5em 0.5em;\n word-wrap: anywhere;\n }\n "))));
8
- };
9
- //# sourceMappingURL=tag.js.map
5
+ export const Tag = props => {
6
+ return /*#__PURE__*/React.createElement("div", {
7
+ className: _JSXStyle.dynamic([["2407016309", [theme.fonts.primary, theme.colors.enterDarkGrey, theme.colors.enterGrey]]]) + " " + 'tag'
8
+ }, props.children, /*#__PURE__*/React.createElement(_JSXStyle, {
9
+ id: "2407016309",
10
+ dynamic: [theme.fonts.primary, theme.colors.enterDarkGrey, theme.colors.enterGrey]
11
+ }, `.tag.__jsx-style-dynamic-selector{font-family:${theme.fonts.primary};font-size:0.8em;color:${theme.colors.enterDarkGrey};text-transform:uppercase;display:inline-block;background-color:transparent;border-radius:2px;border:1px solid ${theme.colors.enterGrey};padding:2px 8px;margin:0 0 0.5em 0.5em;word-wrap:anywhere;}`));
12
+ };