@dev-crew-berlin/enter-js-utils 0.14.1 → 0.14.3
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/models/attendee.d.ts +3 -0
- package/dist/models/attendee.js +3 -1
- package/dist/models/field-group.d.ts +16 -16
- package/dist/models/field-group.js +5 -5
- package/dist/ui/companion-info.stories.js +2 -1
- package/dist/ui/guest-card.stories.js +4 -2
- package/dist/ui/icons/settings-icon.d.ts +6 -0
- package/dist/ui/icons/settings-icon.js +16 -0
- package/dist/ui/icons/settings-icon.stories.d.ts +12 -0
- package/dist/ui/icons/settings-icon.stories.js +20 -0
- package/dist/ui/index.d.ts +1 -0
- package/dist/ui/index.js +1 -0
- package/package.json +1 -1
|
@@ -24,6 +24,7 @@ export declare type AttendeeJSON = {
|
|
|
24
24
|
amount: number;
|
|
25
25
|
testmode: boolean;
|
|
26
26
|
} | null;
|
|
27
|
+
deleted: boolean;
|
|
27
28
|
};
|
|
28
29
|
export declare class Attendee {
|
|
29
30
|
id: string;
|
|
@@ -47,6 +48,7 @@ export declare class Attendee {
|
|
|
47
48
|
amount: number;
|
|
48
49
|
testmode: boolean;
|
|
49
50
|
} | null;
|
|
51
|
+
deleted: boolean;
|
|
50
52
|
constructor(rawAttendee: RawAttendee);
|
|
51
53
|
getRsvpCountForTag(checkinTag: string): number;
|
|
52
54
|
getResponseForTag(checkinTag: string): 'no-response' | 'negative-repsone' | 'positive-response';
|
|
@@ -86,6 +88,7 @@ export declare const rawAttendee: import("fefe").Validator<import("fefe").Object
|
|
|
86
88
|
amount: import("fefe").Validator<number, import("fefe").LeafError>;
|
|
87
89
|
testmode: import("fefe").Validator<boolean, import("fefe").LeafError>;
|
|
88
90
|
}> | null, import("fefe").FefeError>;
|
|
91
|
+
deleted: import("fefe").Validator<boolean, import("fefe").FefeError>;
|
|
89
92
|
}>, import("fefe").FefeError>;
|
|
90
93
|
declare type RawAttendee = ValidatorReturnType<typeof rawAttendee>;
|
|
91
94
|
export declare const parseAttendee: (value: unknown) => APIResult<Attendee>;
|
package/dist/models/attendee.js
CHANGED
|
@@ -16,6 +16,7 @@ export class Attendee {
|
|
|
16
16
|
this.checkin = rawAttendee.checkin;
|
|
17
17
|
this.companions = rawAttendee.companions;
|
|
18
18
|
this.payment = rawAttendee.payment;
|
|
19
|
+
this.deleted = rawAttendee.deleted;
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
getRsvpCountForTag(checkinTag) {
|
|
@@ -101,7 +102,8 @@ export const rawAttendee = object({
|
|
|
101
102
|
integer: true
|
|
102
103
|
}),
|
|
103
104
|
testmode: boolean()
|
|
104
|
-
})), null)
|
|
105
|
+
})), null),
|
|
106
|
+
deleted: defaultTo(boolean(), false)
|
|
105
107
|
}, {
|
|
106
108
|
allowExcessProperties: true
|
|
107
109
|
});
|
|
@@ -11,10 +11,10 @@ export declare class FieldGroups {
|
|
|
11
11
|
getLabelForField(fieldKey: string, language: string): string;
|
|
12
12
|
}
|
|
13
13
|
export declare const fieldGroup: import("fefe").Validator<import("fefe").ObjectResult<{
|
|
14
|
-
title: import("fefe").Validator<string | Dictionary<string
|
|
14
|
+
title: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError> & {
|
|
15
15
|
optional: true;
|
|
16
16
|
};
|
|
17
|
-
class: import("fefe").Validator<string, import("fefe").FefeError> & {
|
|
17
|
+
class: import("fefe").Validator<string | null, import("fefe").FefeError> & {
|
|
18
18
|
optional: true;
|
|
19
19
|
};
|
|
20
20
|
questions: import("fefe").Validator<(import("fefe").ObjectResult<{
|
|
@@ -112,18 +112,18 @@ export declare const fieldGroup: import("fefe").Validator<import("fefe").ObjectR
|
|
|
112
112
|
class: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
113
113
|
type: import("fefe").Validator<"dropdown", import("fefe").LeafError>;
|
|
114
114
|
}>)[], import("fefe").FefeError>;
|
|
115
|
-
info: import("fefe").Validator<string | Dictionary<string
|
|
115
|
+
info: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError> & {
|
|
116
116
|
optional: true;
|
|
117
117
|
};
|
|
118
|
-
if: import("fefe").Validator<string, import("fefe").FefeError> & {
|
|
118
|
+
if: import("fefe").Validator<string | null, import("fefe").FefeError> & {
|
|
119
119
|
optional: true;
|
|
120
120
|
};
|
|
121
121
|
}>, import("fefe").FefeError>;
|
|
122
122
|
declare const rawFieldGroupList: import("fefe").Validator<import("fefe").ObjectResult<{
|
|
123
|
-
title: import("fefe").Validator<string | Dictionary<string
|
|
123
|
+
title: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError> & {
|
|
124
124
|
optional: true;
|
|
125
125
|
};
|
|
126
|
-
class: import("fefe").Validator<string, import("fefe").FefeError> & {
|
|
126
|
+
class: import("fefe").Validator<string | null, import("fefe").FefeError> & {
|
|
127
127
|
optional: true;
|
|
128
128
|
};
|
|
129
129
|
questions: import("fefe").Validator<(import("fefe").ObjectResult<{
|
|
@@ -221,18 +221,18 @@ declare const rawFieldGroupList: import("fefe").Validator<import("fefe").ObjectR
|
|
|
221
221
|
class: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
222
222
|
type: import("fefe").Validator<"dropdown", import("fefe").LeafError>;
|
|
223
223
|
}>)[], import("fefe").FefeError>;
|
|
224
|
-
info: import("fefe").Validator<string | Dictionary<string
|
|
224
|
+
info: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError> & {
|
|
225
225
|
optional: true;
|
|
226
226
|
};
|
|
227
|
-
if: import("fefe").Validator<string, import("fefe").FefeError> & {
|
|
227
|
+
if: import("fefe").Validator<string | null, import("fefe").FefeError> & {
|
|
228
228
|
optional: true;
|
|
229
229
|
};
|
|
230
230
|
}>[], import("fefe").FefeError>;
|
|
231
231
|
export declare const parseFieldGroup: import("../lib").APIValidator<import("fefe").ObjectResult<{
|
|
232
|
-
title: import("fefe").Validator<string | Dictionary<string
|
|
232
|
+
title: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError> & {
|
|
233
233
|
optional: true;
|
|
234
234
|
};
|
|
235
|
-
class: import("fefe").Validator<string, import("fefe").FefeError> & {
|
|
235
|
+
class: import("fefe").Validator<string | null, import("fefe").FefeError> & {
|
|
236
236
|
optional: true;
|
|
237
237
|
};
|
|
238
238
|
questions: import("fefe").Validator<(import("fefe").ObjectResult<{
|
|
@@ -330,18 +330,18 @@ export declare const parseFieldGroup: import("../lib").APIValidator<import("fefe
|
|
|
330
330
|
class: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
331
331
|
type: import("fefe").Validator<"dropdown", import("fefe").LeafError>;
|
|
332
332
|
}>)[], import("fefe").FefeError>;
|
|
333
|
-
info: import("fefe").Validator<string | Dictionary<string
|
|
333
|
+
info: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError> & {
|
|
334
334
|
optional: true;
|
|
335
335
|
};
|
|
336
|
-
if: import("fefe").Validator<string, import("fefe").FefeError> & {
|
|
336
|
+
if: import("fefe").Validator<string | null, import("fefe").FefeError> & {
|
|
337
337
|
optional: true;
|
|
338
338
|
};
|
|
339
339
|
}>>;
|
|
340
340
|
export declare const parseRawFieldGroupList: import("../lib").APIValidator<import("fefe").ObjectResult<{
|
|
341
|
-
title: import("fefe").Validator<string | Dictionary<string
|
|
341
|
+
title: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError> & {
|
|
342
342
|
optional: true;
|
|
343
343
|
};
|
|
344
|
-
class: import("fefe").Validator<string, import("fefe").FefeError> & {
|
|
344
|
+
class: import("fefe").Validator<string | null, import("fefe").FefeError> & {
|
|
345
345
|
optional: true;
|
|
346
346
|
};
|
|
347
347
|
questions: import("fefe").Validator<(import("fefe").ObjectResult<{
|
|
@@ -439,10 +439,10 @@ export declare const parseRawFieldGroupList: import("../lib").APIValidator<impor
|
|
|
439
439
|
class: import("fefe").Validator<string | null, import("fefe").FefeError>;
|
|
440
440
|
type: import("fefe").Validator<"dropdown", import("fefe").LeafError>;
|
|
441
441
|
}>)[], import("fefe").FefeError>;
|
|
442
|
-
info: import("fefe").Validator<string | Dictionary<string
|
|
442
|
+
info: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError> & {
|
|
443
443
|
optional: true;
|
|
444
444
|
};
|
|
445
|
-
if: import("fefe").Validator<string, import("fefe").FefeError> & {
|
|
445
|
+
if: import("fefe").Validator<string | null, import("fefe").FefeError> & {
|
|
446
446
|
optional: true;
|
|
447
447
|
};
|
|
448
448
|
}>[]>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { array, object, string, optional, union } from 'fefe';
|
|
2
2
|
import { apiValidator, success } from '../lib';
|
|
3
3
|
import { field } from './field';
|
|
4
|
-
import { dictionary } from './_helpers';
|
|
4
|
+
import { dictionary, maybe } from './_helpers';
|
|
5
5
|
export class FieldGroups {
|
|
6
6
|
constructor(rawFieldGroupList) {
|
|
7
7
|
this.groups = rawFieldGroupList;
|
|
@@ -28,11 +28,11 @@ export class FieldGroups {
|
|
|
28
28
|
|
|
29
29
|
}
|
|
30
30
|
export const fieldGroup = object({
|
|
31
|
-
title: optional(union(string(), dictionary(string()))),
|
|
32
|
-
class: optional(string()),
|
|
31
|
+
title: optional(maybe(union(string(), dictionary(string())))),
|
|
32
|
+
class: optional(maybe(string())),
|
|
33
33
|
questions: array(field),
|
|
34
|
-
info: optional(union(string(), dictionary(string()))),
|
|
35
|
-
if: optional(string())
|
|
34
|
+
info: optional(maybe(union(string(), dictionary(string())))),
|
|
35
|
+
if: optional(maybe(string()))
|
|
36
36
|
}, {
|
|
37
37
|
allowExcessProperties: true
|
|
38
38
|
});
|
|
@@ -28,7 +28,8 @@ const attendee = new Attendee({
|
|
|
28
28
|
userdata: {
|
|
29
29
|
name: 'Max Mustermann'
|
|
30
30
|
},
|
|
31
|
-
metadata: {}
|
|
31
|
+
metadata: {},
|
|
32
|
+
deleted: false
|
|
32
33
|
});
|
|
33
34
|
const companion = new Attendee({
|
|
34
35
|
id: 'my-companion',
|
|
@@ -48,7 +49,8 @@ const companion = new Attendee({
|
|
|
48
49
|
userdata: {
|
|
49
50
|
name: 'Jhon Doe'
|
|
50
51
|
},
|
|
51
|
-
metadata: {}
|
|
52
|
+
metadata: {},
|
|
53
|
+
deleted: false
|
|
52
54
|
});
|
|
53
55
|
|
|
54
56
|
const Template = args => /*#__PURE__*/React.createElement(GuestCard, args);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { colors } from '../../lib/theme';
|
|
3
|
+
export const SettingsIcon = ({
|
|
4
|
+
color = colors.enterDarkGrey
|
|
5
|
+
}) => {
|
|
6
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
7
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
8
|
+
width: "100%",
|
|
9
|
+
height: "auto",
|
|
10
|
+
viewBox: "0 0 19 20"
|
|
11
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
12
|
+
fill: color,
|
|
13
|
+
fillRule: "evenodd",
|
|
14
|
+
d: "M17.168 10.226c0 1.105.619 1.989 1.812 2.74-.177.619-.442 1.237-.751 1.856-1.06-.265-2.077.088-3.093 1.016-.796.884-1.06 1.9-.751 3.093-.619.265-1.238.574-1.9.795-.707-1.237-1.724-1.855-3.005-1.855s-2.298.618-3.005 1.855c-.662-.22-1.281-.53-1.9-.795.31-1.237.045-2.253-.75-3.093-.796-.795-1.857-1.06-3.094-.751A30.225 30.225 0 0 1-.02 13.23c1.237-.795 1.856-1.812 1.856-3.005 0-1.104-.619-2.032-1.856-2.783.31-.884.574-1.503.751-1.856 1.149.265 2.165-.088 3.093-1.016.796-.84 1.06-1.856.751-3.093.663-.31 1.282-.575 1.9-.752C7.182 1.92 8.2 2.538 9.48 2.538s2.298-.619 3.005-1.812c.618.177 1.237.442 1.9.752-.31 1.193-.045 2.209.75 3.093 1.017.928 2.033 1.281 3.094 1.016.31.618.574 1.237.751 1.856-1.193.75-1.812 1.679-1.812 2.783m-7.688 4.11c1.149 0 2.12-.398 2.916-1.193.796-.796 1.193-1.768 1.193-2.917 0-1.148-.397-2.12-1.193-2.96-.795-.795-1.767-1.193-2.916-1.193s-2.12.398-2.916 1.193c-.796.84-1.193 1.812-1.193 2.96 0 1.15.397 2.121 1.193 2.917.795.795 1.767 1.193 2.916 1.193"
|
|
15
|
+
}));
|
|
16
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
3
|
+
declare const _default: ComponentMeta<React.FunctionComponent<{
|
|
4
|
+
color?: string | undefined;
|
|
5
|
+
}>>;
|
|
6
|
+
export default _default;
|
|
7
|
+
export declare const Basic: ComponentStory<React.FunctionComponent<{
|
|
8
|
+
color?: string | undefined;
|
|
9
|
+
}>>;
|
|
10
|
+
export declare const White: ComponentStory<React.FunctionComponent<{
|
|
11
|
+
color?: string | undefined;
|
|
12
|
+
}>>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SettingsIcon } from './settings-icon';
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Icons/Settings',
|
|
5
|
+
component: SettingsIcon
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
const Template = args => /*#__PURE__*/React.createElement(SettingsIcon, args);
|
|
9
|
+
|
|
10
|
+
export const Basic = Template.bind({});
|
|
11
|
+
Basic.args = {};
|
|
12
|
+
export const White = Template.bind({});
|
|
13
|
+
White.parameters = {
|
|
14
|
+
backgrounds: {
|
|
15
|
+
default: 'dark'
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
White.args = {
|
|
19
|
+
color: '#fff'
|
|
20
|
+
};
|
package/dist/ui/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { Input } from './form-elements/input';
|
|
2
2
|
export { Label } from './form-elements/label';
|
|
3
3
|
export { SegmentedControl } from './form-elements/segmented-control';
|
|
4
|
+
export { SettingsIcon } from './icons/settings-icon';
|
|
4
5
|
export { Button } from './button';
|
|
5
6
|
export { CheckinCountIndicator } from './checkin-count-indicator';
|
|
6
7
|
export { CheckinProgressBar } from './checkin-progress-bar';
|
package/dist/ui/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { Input } from './form-elements/input';
|
|
2
2
|
export { Label } from './form-elements/label';
|
|
3
3
|
export { SegmentedControl } from './form-elements/segmented-control';
|
|
4
|
+
export { SettingsIcon } from './icons/settings-icon';
|
|
4
5
|
export { Button } from './button';
|
|
5
6
|
export { CheckinCountIndicator } from './checkin-count-indicator';
|
|
6
7
|
export { CheckinProgressBar } from './checkin-progress-bar';
|