@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.
- package/dist/api-client/api-base.js +160 -287
- package/dist/api-client/index.js +73 -190
- package/dist/lib/api-result.js +9 -13
- package/dist/lib/class-names.js +2 -12
- package/dist/lib/index.js +1 -2
- package/dist/lib/not-undefined.js +2 -3
- package/dist/lib/result.js +27 -23
- package/dist/lib/theme.js +17 -18
- package/dist/models/_helpers.js +64 -65
- package/dist/models/access-token.js +9 -6
- package/dist/models/attendee.js +109 -100
- package/dist/models/checkin-counts.js +7 -3
- package/dist/models/checkins.js +61 -69
- package/dist/models/event.js +1 -2
- package/dist/models/field-group.js +43 -43
- package/dist/models/field-value.js +1 -2
- package/dist/models/field.js +86 -41
- package/dist/models/index.js +1 -2
- package/dist/models/instance.js +109 -99
- package/dist/models/invite.js +18 -15
- package/dist/models/meta-field.js +8 -7
- package/dist/models/user.js +10 -9
- package/dist/models/variable.js +15 -14
- package/dist/ui/button.js +15 -29
- package/dist/ui/button.stories.js +17 -27
- package/dist/ui/checkin-count-indicator.js +67 -46
- package/dist/ui/checkin-count-indicator.stories.js +45 -47
- package/dist/ui/companion-info.js +14 -14
- package/dist/ui/companion-info.stories.js +59 -50
- package/dist/ui/fonts.js +6 -4
- package/dist/ui/guest-card.js +39 -30
- package/dist/ui/guest-card.stories.js +115 -104
- package/dist/ui/index.js +1 -2
- package/dist/ui/tag.js +9 -6
- package/package.json +7 -34
- package/dist/api-client/api-base.d.ts +0 -30
- package/dist/api-client/api-base.js.map +0 -1
- package/dist/api-client/index.d.ts +0 -75
- package/dist/api-client/index.js.map +0 -1
- package/dist/lib/api-result.d.ts +0 -25
- package/dist/lib/api-result.js.map +0 -1
- package/dist/lib/class-names.d.ts +0 -1
- package/dist/lib/class-names.js.map +0 -1
- package/dist/lib/index.d.ts +0 -5
- package/dist/lib/index.js.map +0 -1
- package/dist/lib/not-undefined.d.ts +0 -1
- package/dist/lib/not-undefined.js.map +0 -1
- package/dist/lib/result.d.ts +0 -33
- package/dist/lib/result.js.map +0 -1
- package/dist/lib/theme.d.ts +0 -18
- package/dist/lib/theme.js.map +0 -1
- package/dist/models/_helpers.d.ts +0 -23
- package/dist/models/_helpers.js.map +0 -1
- package/dist/models/access-token.d.ts +0 -11
- package/dist/models/access-token.js.map +0 -1
- package/dist/models/attendee.d.ts +0 -90
- package/dist/models/attendee.js.map +0 -1
- package/dist/models/checkin-counts.d.ts +0 -10
- package/dist/models/checkin-counts.js.map +0 -1
- package/dist/models/checkins.d.ts +0 -40
- package/dist/models/checkins.js.map +0 -1
- package/dist/models/event.d.ts +0 -40
- package/dist/models/event.js.map +0 -1
- package/dist/models/field-group.d.ts +0 -484
- package/dist/models/field-group.js.map +0 -1
- package/dist/models/field-value.d.ts +0 -2
- package/dist/models/field-value.js.map +0 -1
- package/dist/models/field.d.ts +0 -321
- package/dist/models/field.js.map +0 -1
- package/dist/models/index.d.ts +0 -14
- package/dist/models/index.js.map +0 -1
- package/dist/models/instance.d.ts +0 -78
- package/dist/models/instance.js.map +0 -1
- package/dist/models/invite.d.ts +0 -33
- package/dist/models/invite.js.map +0 -1
- package/dist/models/meta-field.d.ts +0 -7
- package/dist/models/meta-field.js.map +0 -1
- package/dist/models/user.d.ts +0 -18
- package/dist/models/user.js.map +0 -1
- package/dist/models/variable.d.ts +0 -27
- package/dist/models/variable.js.map +0 -1
- package/dist/ui/button.d.ts +0 -7
- package/dist/ui/button.js.map +0 -1
- package/dist/ui/button.stories.d.ts +0 -18
- package/dist/ui/button.stories.js.map +0 -1
- package/dist/ui/checkin-count-indicator.d.ts +0 -15
- package/dist/ui/checkin-count-indicator.js.map +0 -1
- package/dist/ui/checkin-count-indicator.stories.d.ts +0 -84
- package/dist/ui/checkin-count-indicator.stories.js.map +0 -1
- package/dist/ui/companion-info.d.ts +0 -15
- package/dist/ui/companion-info.js.map +0 -1
- package/dist/ui/companion-info.stories.d.ts +0 -44
- package/dist/ui/companion-info.stories.js.map +0 -1
- package/dist/ui/fonts.d.ts +0 -3
- package/dist/ui/fonts.js.map +0 -1
- package/dist/ui/guest-card.d.ts +0 -16
- package/dist/ui/guest-card.js.map +0 -1
- package/dist/ui/guest-card.stories.d.ts +0 -92
- package/dist/ui/guest-card.stories.js.map +0 -1
- package/dist/ui/index.d.ts +0 -6
- package/dist/ui/index.js.map +0 -1
- package/dist/ui/tag.d.ts +0 -7
- 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
|
-
|
|
16
|
-
|
|
4
|
+
title: 'Checkin-Count Indicator',
|
|
5
|
+
component: CheckinCountIndicator
|
|
6
|
+
};
|
|
7
|
+
const exampleCheckin = {
|
|
8
|
+
time: new Date('2022-01-01')
|
|
17
9
|
};
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
10
|
+
|
|
11
|
+
const Template = args => /*#__PURE__*/React.createElement(CheckinCountIndicator, args);
|
|
12
|
+
|
|
13
|
+
export const SingleResponse = Template.bind({});
|
|
21
14
|
SingleResponse.args = {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
checkins: [],
|
|
32
|
+
response: 'positive-response',
|
|
33
|
+
rsvpCount: 16
|
|
35
34
|
};
|
|
36
|
-
export
|
|
35
|
+
export const CheckinAndResponse = Template.bind({});
|
|
37
36
|
CheckinAndResponse.args = {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
checkins: [exampleCheckin],
|
|
38
|
+
response: 'positive-response',
|
|
39
|
+
rsvpCount: 1
|
|
41
40
|
};
|
|
42
|
-
export
|
|
41
|
+
export const MultipleCheckinsAndResponse = Template.bind({});
|
|
43
42
|
MultipleCheckinsAndResponse.args = {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
checkins: [exampleCheckin, exampleCheckin],
|
|
44
|
+
response: 'positive-response',
|
|
45
|
+
rsvpCount: 1
|
|
47
46
|
};
|
|
48
|
-
export
|
|
47
|
+
export const CheckinsWithDecline = Template.bind({});
|
|
49
48
|
CheckinsWithDecline.args = {
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
checkins: [exampleCheckin],
|
|
50
|
+
response: 'negative-repsone'
|
|
52
51
|
};
|
|
53
|
-
export
|
|
52
|
+
export const CheckinWithoutResponse = Template.bind({});
|
|
54
53
|
CheckinWithoutResponse.args = {
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
checkins: [exampleCheckin],
|
|
55
|
+
response: 'no-response'
|
|
57
56
|
};
|
|
58
|
-
export
|
|
57
|
+
export const MultipleCheckins = Template.bind({});
|
|
59
58
|
MultipleCheckins.args = {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
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
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
|
|
17
|
-
|
|
18
|
-
|
|
5
|
+
title: 'Companion Info',
|
|
6
|
+
component: CompanionInfo,
|
|
7
|
+
argTypes: {
|
|
8
|
+
formatName: {
|
|
9
|
+
type: 'function'
|
|
10
|
+
}
|
|
11
|
+
}
|
|
19
12
|
};
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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
|
-
|
|
36
|
-
|
|
32
|
+
|
|
33
|
+
const Template = args => /*#__PURE__*/React.createElement(CompanionInfo, args);
|
|
34
|
+
|
|
35
|
+
export const WithMainGuestFound = Template.bind({});
|
|
37
36
|
WithMainGuestFound.args = {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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
|
|
48
|
+
export const WithoutMainGuest = Template.bind({});
|
|
46
49
|
WithoutMainGuest.args = {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
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
|
|
60
|
+
export const NotACompanion = Template.bind({});
|
|
54
61
|
NotACompanion.args = {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
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
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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
|
+
};
|
package/dist/ui/guest-card.js
CHANGED
|
@@ -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
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
-
|
|
18
|
-
|
|
19
|
-
|
|
6
|
+
title: 'Guest Card',
|
|
7
|
+
component: GuestCard,
|
|
8
|
+
argTypes: {
|
|
9
|
+
formatName: {
|
|
10
|
+
type: 'function'
|
|
11
|
+
}
|
|
12
|
+
}
|
|
20
13
|
};
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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
|
-
|
|
52
|
-
|
|
53
|
+
|
|
54
|
+
const Template = args => /*#__PURE__*/React.createElement(GuestCard, args);
|
|
55
|
+
|
|
56
|
+
export const WithBackground = Template.bind({});
|
|
53
57
|
WithBackground.args = {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
attendee: attendee,
|
|
59
|
+
checkinTag: 'default',
|
|
60
|
+
|
|
61
|
+
formatName(attendee) {
|
|
62
|
+
return attendee.userdata.name?.toString() ?? '';
|
|
63
|
+
}
|
|
64
|
+
|
|
60
65
|
};
|
|
61
|
-
export
|
|
66
|
+
export const Plain = Template.bind({});
|
|
62
67
|
Plain.args = {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
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
|
|
77
|
+
export const FilteredTags = Template.bind({});
|
|
72
78
|
FilteredTags.args = {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
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
|
|
92
|
+
export const WithColorLabel = Template.bind({});
|
|
85
93
|
WithColorLabel.args = {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
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
|
|
103
|
+
export const WithInfoText = Template.bind({});
|
|
95
104
|
WithInfoText.args = {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
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
|
|
114
|
+
export const WithCompanion = Template.bind({});
|
|
105
115
|
WithCompanion.args = {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
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
|
|
127
|
+
export const WithCompanionButNoMainGuestInfo = Template.bind({});
|
|
117
128
|
WithCompanionButNoMainGuestInfo.args = {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
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
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
+
};
|