@dev-crew-berlin/enter-js-utils 0.80.1 → 0.81.0
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.d.ts +6 -6
- package/dist/generated/api-schema.d.ts +6 -6
- package/dist/lib/api-result.d.ts +5 -5
- package/dist/lib/csrf.d.ts +1 -1
- package/dist/lib/headers.d.ts +6 -7
- package/dist/lib/result.d.ts +7 -7
- package/dist/lib/tokens.d.ts +4 -4
- package/dist/models/attendee.d.ts +2 -2
- package/dist/models/attendee.js +4 -10
- package/dist/models/branch.d.ts +2 -1
- package/dist/models/branch.js +7 -0
- package/dist/models/checkin-counter.d.ts +1 -1
- package/dist/models/checkin-counts.d.ts +1 -1
- package/dist/models/checkin.d.ts +2 -2
- package/dist/models/checkins.d.ts +2 -2
- package/dist/models/email.d.ts +1 -1
- package/dist/models/event.d.ts +11 -11
- package/dist/models/field-group.d.ts +3 -3
- package/dist/models/field-value.d.ts +1 -1
- package/dist/models/field.d.ts +12 -12
- package/dist/models/instance.d.ts +1 -1
- package/dist/models/instance.js +1 -1
- package/dist/models/permission.d.ts +1 -1
- package/dist/models/rsvp.d.ts +2 -2
- package/dist/models/user.d.ts +1 -1
- package/dist/models/variable.d.ts +1 -1
- package/dist/ui/button.d.ts +1 -1
- package/dist/ui/button.stories.d.ts +1 -1
- package/dist/ui/checkin-count-indicator.d.ts +2 -2
- package/dist/ui/checkin-count-indicator.stories.d.ts +1 -1
- package/dist/ui/checkin-progress-bar.d.ts +1 -1
- package/dist/ui/checkin-progress-bar.stories.d.ts +1 -1
- package/dist/ui/companion-info.d.ts +1 -1
- package/dist/ui/companion-info.stories.d.ts +1 -1
- package/dist/ui/enter-logo.d.ts +1 -1
- package/dist/ui/enter-logo.stories.d.ts +1 -1
- package/dist/ui/form-elements/input.d.ts +1 -1
- package/dist/ui/form-elements/input.js +3 -2
- package/dist/ui/form-elements/input.stories.d.ts +1 -1
- package/dist/ui/form-elements/label.d.ts +1 -1
- package/dist/ui/form-elements/label.stories.d.ts +1 -1
- package/dist/ui/form-elements/search-input.d.ts +1 -1
- package/dist/ui/form-elements/search-input.stories.d.ts +1 -1
- package/dist/ui/form-elements/segmented-control.d.ts +1 -1
- package/dist/ui/form-elements/segmented-control.stories.d.ts +1 -1
- package/dist/ui/form-elements/select.d.ts +11 -0
- package/dist/ui/form-elements/select.js +37 -0
- package/dist/ui/form-elements/select.stories.d.ts +8 -0
- package/dist/ui/form-elements/select.stories.js +30 -0
- package/dist/ui/guest-card.d.ts +1 -1
- package/dist/ui/guest-card.stories.d.ts +1 -1
- package/dist/ui/icons/add-guest-icon.d.ts +1 -1
- package/dist/ui/icons/add-guest-icon.stories.d.ts +1 -1
- package/dist/ui/icons/caret-icon.d.ts +1 -1
- package/dist/ui/icons/caret-icon.stories.d.ts +1 -1
- package/dist/ui/icons/filter-icon.d.ts +1 -1
- package/dist/ui/icons/filter-icon.stories.d.ts +1 -1
- package/dist/ui/icons/search-icon.d.ts +1 -1
- package/dist/ui/icons/search-icon.stories.d.ts +1 -1
- package/dist/ui/icons/settings-icon.d.ts +1 -1
- package/dist/ui/icons/settings-icon.stories.d.ts +1 -1
- package/dist/ui/icons/sort-list-icon.d.ts +1 -1
- package/dist/ui/icons/sort-list-icon.stories.d.ts +1 -1
- package/dist/ui/index.d.ts +1 -0
- package/dist/ui/index.js +1 -0
- package/dist/ui/tag.d.ts +1 -1
- package/dist/ui/tag.stories.d.ts +1 -1
- package/package.json +2 -2
|
@@ -4,20 +4,20 @@ export interface APICredentials {
|
|
|
4
4
|
accessToken: string;
|
|
5
5
|
url: string;
|
|
6
6
|
}
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
type HTTPMethod = 'get' | 'post' | 'put' | 'patch' | 'delete';
|
|
8
|
+
type JSONRes = {
|
|
9
9
|
content: {
|
|
10
10
|
'application/json': unknown;
|
|
11
11
|
};
|
|
12
12
|
};
|
|
13
|
-
|
|
13
|
+
type ResJSON<Code extends number> = {
|
|
14
14
|
responses: Record<Code, JSONRes>;
|
|
15
15
|
};
|
|
16
|
-
|
|
17
|
-
export
|
|
16
|
+
type ResponseType<Path extends keyof paths, Method extends HTTPMethod> = paths[Path] extends Record<Method, ResJSON<200>> ? paths[Path][Method]['responses'][200]['content']['application/json'] : paths[Path] extends Record<Method, ResJSON<204>> ? paths[Path][Method]['responses'][204]['content']['application/json'] : never;
|
|
17
|
+
export type RequestBody<Path extends keyof paths, Method extends HTTPMethod> = paths[Path] extends Record<Method, {
|
|
18
18
|
requestBody: JSONRes;
|
|
19
19
|
}> ? paths[Path][Method]['requestBody']['content']['application/json'] : never;
|
|
20
|
-
export
|
|
20
|
+
export type FetchOptions = {
|
|
21
21
|
cache?: 'force-cache' | 'no-store';
|
|
22
22
|
next?: {
|
|
23
23
|
revalidate: false | 0 | number;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* This file was auto-generated by openapi-typescript.
|
|
3
3
|
* Do not make direct changes to the file.
|
|
4
4
|
*/
|
|
5
|
-
export
|
|
5
|
+
export type paths = {
|
|
6
6
|
"/health": {
|
|
7
7
|
/**
|
|
8
8
|
* Healthcheck
|
|
@@ -90,8 +90,8 @@ export declare type paths = {
|
|
|
90
90
|
post: operations["generate_signed_registration_token_instances__instance_name__registration_registration_token_post"];
|
|
91
91
|
};
|
|
92
92
|
};
|
|
93
|
-
export
|
|
94
|
-
export
|
|
93
|
+
export type webhooks = Record<string, never>;
|
|
94
|
+
export type components = {
|
|
95
95
|
schemas: {
|
|
96
96
|
/**
|
|
97
97
|
* AttendeeAuthCodeRequested
|
|
@@ -2818,9 +2818,9 @@ export declare type components = {
|
|
|
2818
2818
|
headers: never;
|
|
2819
2819
|
pathItems: never;
|
|
2820
2820
|
};
|
|
2821
|
-
export
|
|
2822
|
-
export
|
|
2823
|
-
export
|
|
2821
|
+
export type $defs = Record<string, never>;
|
|
2822
|
+
export type external = Record<string, never>;
|
|
2823
|
+
export type operations = {
|
|
2824
2824
|
/**
|
|
2825
2825
|
* Healthcheck
|
|
2826
2826
|
* @description healthcheck to see if api server is running
|
package/dist/lib/api-result.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { Result } from './result';
|
|
2
|
-
export
|
|
2
|
+
export type NetworkError = {
|
|
3
3
|
type: 'network-error';
|
|
4
4
|
endpoint: string;
|
|
5
5
|
message: string;
|
|
6
6
|
};
|
|
7
|
-
export
|
|
7
|
+
export type HTTPError = {
|
|
8
8
|
type: 'http-error';
|
|
9
9
|
endpoint: string;
|
|
10
10
|
statusCode: number;
|
|
11
11
|
message: string | null;
|
|
12
12
|
};
|
|
13
|
-
export
|
|
13
|
+
export type ClientError = {
|
|
14
14
|
type: 'client-error';
|
|
15
15
|
message: string;
|
|
16
16
|
};
|
|
17
|
-
export
|
|
18
|
-
export
|
|
17
|
+
export type APIError = NetworkError | HTTPError | ClientError;
|
|
18
|
+
export type APIResult<Model> = Result<APIError[], Model>;
|
package/dist/lib/csrf.d.ts
CHANGED
package/dist/lib/headers.d.ts
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import { IncomingMessage, ServerResponse } from 'http';
|
|
3
|
-
export
|
|
2
|
+
export type CookieOptions = {
|
|
4
3
|
sameSite?: 'lax' | 'strict' | 'none';
|
|
5
4
|
path?: string;
|
|
6
5
|
};
|
|
7
|
-
export
|
|
6
|
+
export type RequestCookie = {
|
|
8
7
|
name: string;
|
|
9
8
|
value: string;
|
|
10
9
|
};
|
|
11
|
-
export
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
export
|
|
10
|
+
export type CookieGetter = (name: string) => RequestCookie | undefined;
|
|
11
|
+
export type CookieSetter = (name: string, value: string, options?: CookieOptions) => void;
|
|
12
|
+
export type CookieRemover = (name: string) => void;
|
|
13
|
+
export type HeaderGetter = (name: string) => string | null;
|
|
15
14
|
export declare function nodeCookies(request: {
|
|
16
15
|
cookies: Partial<{
|
|
17
16
|
[key: string]: string;
|
package/dist/lib/result.d.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type Failure<Reason> = {
|
|
2
2
|
success: false;
|
|
3
3
|
error: Reason;
|
|
4
4
|
};
|
|
5
|
-
export
|
|
5
|
+
export type Success<Payload> = {
|
|
6
6
|
success: true;
|
|
7
7
|
data: Payload;
|
|
8
8
|
};
|
|
9
|
-
export
|
|
9
|
+
export type Result<Reason, Payload> = Failure<Reason> | Success<Payload>;
|
|
10
10
|
export declare function success<Payload>(data: Payload): Success<Payload>;
|
|
11
11
|
export declare function failure<Reason>(reason: Reason): Failure<Reason>;
|
|
12
12
|
export declare function asSuccess<Payload>(result: Result<unknown, Payload>): Success<Payload> | undefined;
|
|
13
13
|
export declare function asFailure<Reason>(result: Result<Reason, unknown>): Failure<Reason> | undefined;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
type UnwrapSuccess<T> = T extends Success<infer Payload> ? Payload : never;
|
|
15
|
+
type UnwrapFailure<T> = T extends Failure<infer Reason> ? Reason : never;
|
|
16
|
+
type UnwrapArray<T> = T extends (infer R)[] ? R : never;
|
|
17
|
+
type MergedSuccesses<T> = {
|
|
18
18
|
[K in keyof T]: UnwrapSuccess<T[K]>;
|
|
19
19
|
};
|
|
20
20
|
/**
|
package/dist/lib/tokens.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { CookieGetter, CookieRemover, CookieSetter } from './headers';
|
|
2
2
|
import { Result } from './result';
|
|
3
|
-
export
|
|
3
|
+
export type TokenOptions = {
|
|
4
4
|
jwtSecret: string;
|
|
5
5
|
instanceName: string;
|
|
6
6
|
};
|
|
7
7
|
export declare const tokenValidationErrorCodes: readonly ["token_missing", "token_invalid", "token_expired", "security_question_check_failed"];
|
|
8
|
-
export
|
|
9
|
-
export
|
|
8
|
+
export type TokenValidationError = typeof tokenValidationErrorCodes[number];
|
|
9
|
+
export type RegistrationTokenOptions = {
|
|
10
10
|
registrationTokenCookieName?: string;
|
|
11
11
|
};
|
|
12
|
-
export
|
|
12
|
+
export type RegistrationToken = {
|
|
13
13
|
attendeeId: string;
|
|
14
14
|
sessionType: string;
|
|
15
15
|
flags: {
|
|
@@ -3,8 +3,8 @@ import { Checkin } from './checkin';
|
|
|
3
3
|
import { Checkins } from './checkins';
|
|
4
4
|
import { FieldValue } from './field-value';
|
|
5
5
|
import { Rsvp } from './rsvp';
|
|
6
|
-
export
|
|
7
|
-
|
|
6
|
+
export type AttendeeJSON = components['schemas']['PublicAttendee-Output'];
|
|
7
|
+
type AttendeeJSONInput = components['schemas']['PublicAttendee-Input'];
|
|
8
8
|
export declare class Attendee {
|
|
9
9
|
id: string;
|
|
10
10
|
userdata: Map<string, FieldValue>;
|
package/dist/models/attendee.js
CHANGED
|
@@ -57,10 +57,10 @@ export class Attendee {
|
|
|
57
57
|
// so we implement it here again by hand
|
|
58
58
|
|
|
59
59
|
// convert each checkin to its json representation
|
|
60
|
-
const checkin = Object.fromEntries(
|
|
60
|
+
const checkin = Object.fromEntries(this.checkin.entries().map(([checkinTag, checkin]) => [checkinTag, checkin.toJSON()]));
|
|
61
61
|
|
|
62
62
|
// convert each rsvp to its json representation
|
|
63
|
-
const rsvp = Object.fromEntries(
|
|
63
|
+
const rsvp = Object.fromEntries(this.rsvp.entries().map(([checkinTag, rsvp]) => [checkinTag, rsvp ? rsvp.toJSON() : null]));
|
|
64
64
|
return {
|
|
65
65
|
...this,
|
|
66
66
|
time: this.time?.toISOString(),
|
|
@@ -110,10 +110,7 @@ export class Attendee {
|
|
|
110
110
|
newCheckins.checkins = [args.checkin];
|
|
111
111
|
const mergedCheckins = exsitingCheckins.merge(newCheckins);
|
|
112
112
|
const newAttendee = new Attendee(this.toJSON());
|
|
113
|
-
newAttendee.checkin
|
|
114
|
-
...this.checkin,
|
|
115
|
-
[args.branchName]: mergedCheckins
|
|
116
|
-
};
|
|
113
|
+
newAttendee.checkin.set(args.branchName, mergedCheckins);
|
|
117
114
|
return newAttendee;
|
|
118
115
|
}
|
|
119
116
|
deleteCheckinForBranch(args) {
|
|
@@ -124,10 +121,7 @@ export class Attendee {
|
|
|
124
121
|
});
|
|
125
122
|
const mergedCheckins = exsitingCheckins.merge(deletedCheckins);
|
|
126
123
|
const newAttendee = new Attendee(this.toJSON());
|
|
127
|
-
newAttendee.checkin
|
|
128
|
-
...this.checkin,
|
|
129
|
-
[args.branchName]: mergedCheckins
|
|
130
|
-
};
|
|
124
|
+
newAttendee.checkin.set(args.branchName, mergedCheckins);
|
|
131
125
|
return newAttendee;
|
|
132
126
|
}
|
|
133
127
|
getFieldValueString(fieldKey) {
|
package/dist/models/branch.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { components } from '../generated/api-schema';
|
|
2
2
|
import { CheckinCounter } from './checkin-counter';
|
|
3
|
-
export
|
|
3
|
+
export type BranchJSON = components['schemas']['Branch'];
|
|
4
4
|
export declare class Branch {
|
|
5
5
|
title: string;
|
|
6
6
|
guestlistLabel: string;
|
|
7
7
|
checkinCounters: Map<string, CheckinCounter>;
|
|
8
8
|
constructor(json: BranchJSON);
|
|
9
|
+
toJSON(): BranchJSON;
|
|
9
10
|
}
|
package/dist/models/branch.js
CHANGED
|
@@ -4,4 +4,11 @@ export class Branch {
|
|
|
4
4
|
this.guestlistLabel = json.guestlistLabel;
|
|
5
5
|
this.checkinCounters = new Map(Object.entries(json.checkinCounters));
|
|
6
6
|
}
|
|
7
|
+
toJSON() {
|
|
8
|
+
return {
|
|
9
|
+
title: this.title,
|
|
10
|
+
guestlistLabel: this.guestlistLabel,
|
|
11
|
+
checkinCounters: Object.fromEntries(this.checkinCounters)
|
|
12
|
+
};
|
|
13
|
+
}
|
|
7
14
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { components } from '../generated/api-schema';
|
|
2
|
-
export
|
|
2
|
+
export type CheckinCounter = components['schemas']['CheckinCounter'];
|
package/dist/models/checkin.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { components } from '../generated/api-schema';
|
|
2
|
-
export
|
|
3
|
-
|
|
2
|
+
export type CheckinJSON = components['schemas']['Checkin-Output'];
|
|
3
|
+
type CheckinJSONInput = components['schemas']['Checkin-Input'];
|
|
4
4
|
export declare class Checkin {
|
|
5
5
|
id: string;
|
|
6
6
|
time: Date;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { components } from '../generated/api-schema';
|
|
2
2
|
import { Checkin } from './checkin';
|
|
3
|
-
export
|
|
4
|
-
|
|
3
|
+
export type CheckinsJSON = components['schemas']['Checkins-Output'];
|
|
4
|
+
type CheckinsJSONInput = components['schemas']['Checkins-Input'];
|
|
5
5
|
export declare class Checkins {
|
|
6
6
|
checkins: Checkin[];
|
|
7
7
|
deleted: Set<string>;
|
package/dist/models/email.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { components } from '../generated/api-schema';
|
|
2
|
-
export
|
|
2
|
+
export type Email = components['schemas']['PublicEmail'];
|
package/dist/models/event.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { components } from '../generated/api-schema';
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
export
|
|
2
|
+
export type AttendeeCreatedEvent = components['schemas']['AttendeeCreatedEvent'];
|
|
3
|
+
export type AttendeeUpdatedEvent = components['schemas']['AttendeeUpdatedEvent'];
|
|
4
|
+
export type AttendeeRespondedEvent = components['schemas']['AttendeeRespondedEvent'];
|
|
5
|
+
export type AttendeeDeletedEvent = components['schemas']['AttendeeDeletedEvent'];
|
|
6
|
+
export type AttendeeAuthCodeRequestedEvent = components['schemas']['AttendeeAuthCodeRequested'];
|
|
7
|
+
export type EmailUnsubscribedEvent = components['schemas']['EmailUnsubscribedEvent'];
|
|
8
|
+
export type EmailStatusUpdatedEvent = components['schemas']['EmailStatusUpdatedEvent'];
|
|
9
|
+
export type CheckinCreatedEvent = components['schemas']['CheckinCreatedEvent'];
|
|
10
|
+
export type CheckinDeletedEvent = components['schemas']['CheckinDeletedEvent'];
|
|
11
|
+
export type PaymentPaidEvent = components['schemas']['PaymentPaidEvent'];
|
|
12
|
+
export type Event = components['schemas']['RootModel_list_Annotated_Union_AttendeeCreatedEvent__AttendeeUpdatedEvent__AttendeeRespondedEvent__AttendeeAuthCodeRequested__EmailStatusUpdatedEvent__EmailUnsubscribedEvent__AttendeeDeletedEvent__CheckinCreatedEvent__CheckinDeletedEvent__PaymentPaidEvent___FieldInfo_annotation_NoneType__required_True__discriminator__event_____'][number];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { components } from '../generated/api-schema';
|
|
2
2
|
import { Field } from './field';
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
3
|
+
export type Dictionary<T> = Record<string, T>;
|
|
4
|
+
export type FieldGroupJSON = components['schemas']['FieldGroup-Output'];
|
|
5
|
+
export type FieldGroup = Omit<FieldGroupJSON, 'questions'>;
|
|
6
6
|
export declare class FieldGroups {
|
|
7
7
|
private _groups;
|
|
8
8
|
get groups(): Map<string, FieldGroup>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { components } from '../generated/api-schema';
|
|
2
|
-
export
|
|
2
|
+
export type FieldValue = components['schemas']['PublicAttendee-Output']['userdata'][string];
|
package/dist/models/field.d.ts
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
import { components } from '../generated/api-schema';
|
|
2
|
-
export
|
|
2
|
+
export type StaticField = components['schemas']['StaticField-Output'] & {
|
|
3
3
|
group: string;
|
|
4
4
|
};
|
|
5
|
-
export
|
|
5
|
+
export type TextField = components['schemas']['TextField-Output'] & {
|
|
6
6
|
group: string;
|
|
7
7
|
};
|
|
8
|
-
export
|
|
8
|
+
export type LongtextField = components['schemas']['LongtextField-Output'] & {
|
|
9
9
|
group: string;
|
|
10
10
|
};
|
|
11
|
-
export
|
|
11
|
+
export type EmailField = components['schemas']['EmailField-Output'] & {
|
|
12
12
|
group: string;
|
|
13
13
|
};
|
|
14
|
-
export
|
|
14
|
+
export type NumberField = components['schemas']['NumberField-Output'] & {
|
|
15
15
|
group: string;
|
|
16
16
|
};
|
|
17
|
-
export
|
|
17
|
+
export type CheckboxField = components['schemas']['CheckboxGroupField-Output'] & {
|
|
18
18
|
group: string;
|
|
19
19
|
};
|
|
20
|
-
export
|
|
20
|
+
export type ToggleField = components['schemas']['CheckboxField-Output'] & {
|
|
21
21
|
group: string;
|
|
22
22
|
};
|
|
23
|
-
export
|
|
23
|
+
export type RadioField = components['schemas']['RadioButtonGroupField-Output'] & {
|
|
24
24
|
group: string;
|
|
25
25
|
};
|
|
26
|
-
export
|
|
26
|
+
export type SelectField = components['schemas']['DropdownField-Output'] & {
|
|
27
27
|
group: string;
|
|
28
28
|
};
|
|
29
|
-
export
|
|
29
|
+
export type CodeField = components['schemas']['CodeField-Output'] & {
|
|
30
30
|
group: string;
|
|
31
31
|
};
|
|
32
|
-
export
|
|
32
|
+
export type DateField = components['schemas']['DateField-Output'] & {
|
|
33
33
|
group: string;
|
|
34
34
|
};
|
|
35
|
-
export
|
|
35
|
+
export type Field = components['schemas']['FieldGroup-Output']['questions'][number] & {
|
|
36
36
|
group: string;
|
|
37
37
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { components } from '../generated/api-schema';
|
|
2
2
|
import { Attendee } from './attendee';
|
|
3
3
|
import { Branch } from './branch';
|
|
4
|
-
export
|
|
4
|
+
export type InstanceJSON = components['schemas']['PublicInstance'];
|
|
5
5
|
export declare class Instance {
|
|
6
6
|
name: string;
|
|
7
7
|
title: string;
|
package/dist/models/instance.js
CHANGED
|
@@ -20,7 +20,7 @@ export class Instance {
|
|
|
20
20
|
}
|
|
21
21
|
toJSON() {
|
|
22
22
|
// convert each branch to its json representation
|
|
23
|
-
const branches = Object.fromEntries(
|
|
23
|
+
const branches = Object.fromEntries(this.branches.entries().map(([branchName, branch]) => [branchName, branch.toJSON()]));
|
|
24
24
|
return {
|
|
25
25
|
name: this.name,
|
|
26
26
|
title: this.title,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { components } from '../generated/api-schema';
|
|
2
|
-
export
|
|
2
|
+
export type Permission = components['schemas']['PublicUser']['permissions'][string][number];
|
package/dist/models/rsvp.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { components } from '../generated/api-schema';
|
|
2
|
-
export
|
|
3
|
-
export
|
|
2
|
+
export type RsvpJSON = components['schemas']['RSVP-Output'];
|
|
3
|
+
export type RsvpJSONInput = components['schemas']['RSVP-Input'];
|
|
4
4
|
export declare class Rsvp {
|
|
5
5
|
tieBreaker: string;
|
|
6
6
|
time: Date | null;
|
package/dist/models/user.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { components } from '../generated/api-schema';
|
|
2
|
-
export
|
|
2
|
+
export type User = components['schemas']['PublicUser'];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { components } from '../generated/api-schema';
|
|
2
|
-
export
|
|
2
|
+
export type Variable = components['schemas']['Variable-Output'];
|
package/dist/ui/button.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ButtonHTMLAttributes, FunctionComponent } from 'react';
|
|
2
2
|
import 'styled-jsx';
|
|
3
|
-
|
|
3
|
+
type Props = Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'className' | 'color'> & {
|
|
4
4
|
appearance?: 'default' | 'primary' | 'danger' | 'green';
|
|
5
5
|
borderless?: boolean;
|
|
6
6
|
fullWidth?: boolean;
|
|
@@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react';
|
|
|
2
2
|
import { Button } from './button';
|
|
3
3
|
declare const meta: Meta<typeof Button>;
|
|
4
4
|
export default meta;
|
|
5
|
-
|
|
5
|
+
type Story = StoryObj<typeof Button>;
|
|
6
6
|
export declare const Basic: Story;
|
|
7
7
|
export declare const FullWidth: Story;
|
|
8
8
|
export declare const Primary: Story;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { FunctionComponent } from 'react';
|
|
2
2
|
import 'styled-jsx';
|
|
3
|
-
export
|
|
3
|
+
export type Checkin = {
|
|
4
4
|
time: Date;
|
|
5
5
|
};
|
|
6
|
-
|
|
6
|
+
type Props = {
|
|
7
7
|
checkins: Checkin[];
|
|
8
8
|
response: 'positive-response';
|
|
9
9
|
rsvpCount: number;
|
|
@@ -2,7 +2,7 @@ import { Meta, StoryObj } from '@storybook/react';
|
|
|
2
2
|
import { CheckinCountIndicator } from './checkin-count-indicator';
|
|
3
3
|
declare const meta: Meta<typeof CheckinCountIndicator>;
|
|
4
4
|
export default meta;
|
|
5
|
-
|
|
5
|
+
type Story = StoryObj<typeof CheckinCountIndicator>;
|
|
6
6
|
export declare const SingleResponse: Story;
|
|
7
7
|
export declare const Decline: Story;
|
|
8
8
|
export declare const NoResponse: Story;
|
|
@@ -2,7 +2,7 @@ import { Meta, StoryObj } from '@storybook/react';
|
|
|
2
2
|
import { CheckinProgressBar } from './checkin-progress-bar';
|
|
3
3
|
declare const meta: Meta<typeof CheckinProgressBar>;
|
|
4
4
|
export default meta;
|
|
5
|
-
|
|
5
|
+
type Story = StoryObj<typeof CheckinProgressBar>;
|
|
6
6
|
export declare const Basic: Story;
|
|
7
7
|
export declare const WithoutTagName: Story;
|
|
8
8
|
export declare const NoCheckins: Story;
|
|
@@ -2,7 +2,7 @@ import { Meta, StoryObj } from '@storybook/react';
|
|
|
2
2
|
import { CompanionInfo } from './companion-info';
|
|
3
3
|
declare const meta: Meta<typeof CompanionInfo>;
|
|
4
4
|
export default meta;
|
|
5
|
-
|
|
5
|
+
type Story = StoryObj<typeof CompanionInfo>;
|
|
6
6
|
export declare const WithMainGuestFound: Story;
|
|
7
7
|
export declare const WithoutMainGuest: Story;
|
|
8
8
|
export declare const NotACompanion: Story;
|
package/dist/ui/enter-logo.d.ts
CHANGED
|
@@ -2,6 +2,6 @@ import { Meta, StoryObj } from '@storybook/react';
|
|
|
2
2
|
import { EnterLogo } from './enter-logo';
|
|
3
3
|
declare const meta: Meta<typeof EnterLogo>;
|
|
4
4
|
export default meta;
|
|
5
|
-
|
|
5
|
+
type Story = StoryObj<typeof EnterLogo>;
|
|
6
6
|
export declare const Basic: Story;
|
|
7
7
|
export declare const White: Story;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import _JSXStyle from "styled-jsx/style";
|
|
2
2
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
|
-
import React from 'react';
|
|
3
|
+
import React, { useId } from 'react';
|
|
4
4
|
import { colors, fonts } from '../../lib/theme';
|
|
5
5
|
import { Label } from './label';
|
|
6
6
|
export const Input = ({
|
|
7
7
|
label,
|
|
8
8
|
...props
|
|
9
9
|
}) => {
|
|
10
|
-
const
|
|
10
|
+
const _id = useId();
|
|
11
|
+
const id = props.id ?? _id;
|
|
11
12
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Label, {
|
|
12
13
|
htmlFor: id
|
|
13
14
|
}, label), /*#__PURE__*/React.createElement("input", _extends({}, props, {
|
|
@@ -2,7 +2,7 @@ import { Meta, StoryObj } from '@storybook/react';
|
|
|
2
2
|
import { Input } from './input';
|
|
3
3
|
declare const meta: Meta<typeof Input>;
|
|
4
4
|
export default meta;
|
|
5
|
-
|
|
5
|
+
type Story = StoryObj<typeof Input>;
|
|
6
6
|
export declare const Basic: Story;
|
|
7
7
|
export declare const NumberInput: Story;
|
|
8
8
|
export declare const WithValue: Story;
|
|
@@ -2,5 +2,5 @@ import { Meta, StoryObj } from '@storybook/react';
|
|
|
2
2
|
import { Label } from './label';
|
|
3
3
|
declare const meta: Meta<typeof Label>;
|
|
4
4
|
export default meta;
|
|
5
|
-
|
|
5
|
+
type Story = StoryObj<typeof Label>;
|
|
6
6
|
export declare const Basic: Story;
|
|
@@ -2,6 +2,6 @@ import { Meta, StoryObj } from '@storybook/react';
|
|
|
2
2
|
import { SearchInput } from './search-input';
|
|
3
3
|
declare const meta: Meta<typeof SearchInput>;
|
|
4
4
|
export default meta;
|
|
5
|
-
|
|
5
|
+
type Story = StoryObj<typeof SearchInput>;
|
|
6
6
|
export declare const Basic: Story;
|
|
7
7
|
export declare const WhiteText: Story;
|
|
@@ -2,5 +2,5 @@ import { Meta, StoryObj } from '@storybook/react';
|
|
|
2
2
|
import { SegmentedControl } from './segmented-control';
|
|
3
3
|
declare const meta: Meta<typeof SegmentedControl>;
|
|
4
4
|
export default meta;
|
|
5
|
-
|
|
5
|
+
type Story = StoryObj<typeof SegmentedControl>;
|
|
6
6
|
export declare const Basic: Story;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React, { SelectHTMLAttributes } from 'react';
|
|
2
|
+
type Props<Option> = Omit<SelectHTMLAttributes<HTMLSelectElement>, 'onChange' | 'value'> & {
|
|
3
|
+
label: string;
|
|
4
|
+
value?: Option;
|
|
5
|
+
options: Option[];
|
|
6
|
+
onChange: (option: Option) => void;
|
|
7
|
+
optionFormat?: (option: Option) => string;
|
|
8
|
+
optionDisabled?: (option: Option) => boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare function Select<Option extends string>({ optionFormat, optionDisabled, ...props }: Props<Option>): React.JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import _JSXStyle from "styled-jsx/style";
|
|
2
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
|
+
import React, { useId } from 'react';
|
|
4
|
+
import { colors, fonts } from '../../lib/theme';
|
|
5
|
+
import { Label } from './label';
|
|
6
|
+
export function Select({
|
|
7
|
+
optionFormat = option => option,
|
|
8
|
+
optionDisabled = () => false,
|
|
9
|
+
...props
|
|
10
|
+
}) {
|
|
11
|
+
const {
|
|
12
|
+
options,
|
|
13
|
+
value,
|
|
14
|
+
onChange,
|
|
15
|
+
...inputProps
|
|
16
|
+
} = props;
|
|
17
|
+
const _id = useId();
|
|
18
|
+
const id = props.id ?? _id;
|
|
19
|
+
const uriEncodedChevronSVG = encodeURIComponent(`<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 50' ><polygon fill='${colors.enterBackground}' points='0,0 100,0 50,50'/></svg>`);
|
|
20
|
+
const chevronSVGImageURL = `data:image/svg+xml,${uriEncodedChevronSVG}`;
|
|
21
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Label, {
|
|
22
|
+
htmlFor: id
|
|
23
|
+
}, props.label), /*#__PURE__*/React.createElement("select", _extends({}, inputProps, {
|
|
24
|
+
id: id,
|
|
25
|
+
value: value,
|
|
26
|
+
onChange: e => onChange(e.target.value),
|
|
27
|
+
className: _JSXStyle.dynamic([["2093301006", [fonts.primary, colors.enterDarkGrey, colors.enterMediumGrey, chevronSVGImageURL, colors.enterRed]]]) + " " + (inputProps && inputProps.className != null && inputProps.className || "")
|
|
28
|
+
}), options.map(option => /*#__PURE__*/React.createElement("option", {
|
|
29
|
+
key: option,
|
|
30
|
+
value: option,
|
|
31
|
+
disabled: optionDisabled(option),
|
|
32
|
+
className: _JSXStyle.dynamic([["2093301006", [fonts.primary, colors.enterDarkGrey, colors.enterMediumGrey, chevronSVGImageURL, colors.enterRed]]])
|
|
33
|
+
}, optionFormat(option)))), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
34
|
+
id: "2093301006",
|
|
35
|
+
dynamic: [fonts.primary, colors.enterDarkGrey, colors.enterMediumGrey, chevronSVGImageURL, colors.enterRed]
|
|
36
|
+
}, `select.__jsx-style-dynamic-selector{font-family:${fonts.primary};font-size:1.1em;display:block;width:100%;padding:0.2em 0;margin-bottom:1.1em;border:none;outline:none;background-color:transparent;color:${colors.enterDarkGrey};border-bottom:1px solid ${colors.enterMediumGrey};border-radius:0;-webkit-transition:border-color 0.2s;transition:border-color 0.2s;background:url('${chevronSVGImageURL}');background-repeat:no-repeat;background-position:right 0.5em center;background-size:12px;}select.__jsx-style-dynamic-selector:focus{border-color:1px solid ${colors.enterRed};}`));
|
|
37
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Select } from './select';
|
|
3
|
+
declare const meta: Meta<typeof Select>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Select>;
|
|
6
|
+
export declare const Basic: Story;
|
|
7
|
+
export declare const WithPleaseSelect: Story;
|
|
8
|
+
export declare const WithCustomFormat: Story;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Select } from './select';
|
|
2
|
+
const meta = {
|
|
3
|
+
title: 'Form Elements/Select',
|
|
4
|
+
component: Select
|
|
5
|
+
};
|
|
6
|
+
export default meta;
|
|
7
|
+
export const Basic = {
|
|
8
|
+
args: {
|
|
9
|
+
label: 'Select',
|
|
10
|
+
options: ['One', 'Two'],
|
|
11
|
+
onClick: () => undefined
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
export const WithPleaseSelect = {
|
|
15
|
+
args: {
|
|
16
|
+
label: 'Select',
|
|
17
|
+
options: ['Please Select', 'One', 'Two'],
|
|
18
|
+
value: 'Please Select',
|
|
19
|
+
optionDisabled: option => option === 'Please Select',
|
|
20
|
+
onClick: () => undefined
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
export const WithCustomFormat = {
|
|
24
|
+
args: {
|
|
25
|
+
label: 'Select',
|
|
26
|
+
options: ['one', 'two'],
|
|
27
|
+
optionFormat: option => option.toUpperCase(),
|
|
28
|
+
onClick: () => undefined
|
|
29
|
+
}
|
|
30
|
+
};
|
package/dist/ui/guest-card.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { Meta, StoryObj } from '@storybook/react';
|
|
|
2
2
|
import { GuestCard } from './guest-card';
|
|
3
3
|
declare const meta: Meta<typeof GuestCard>;
|
|
4
4
|
export default meta;
|
|
5
|
-
|
|
5
|
+
type Story = StoryObj<typeof GuestCard>;
|
|
6
6
|
export declare const WithBackground: Story;
|
|
7
7
|
export declare const Plain: Story;
|
|
8
8
|
export declare const Dense: Story;
|
|
@@ -2,6 +2,6 @@ import { Meta, StoryObj } from '@storybook/react';
|
|
|
2
2
|
import { AddGuestIcon } from './add-guest-icon';
|
|
3
3
|
declare const meta: Meta<typeof AddGuestIcon>;
|
|
4
4
|
export default meta;
|
|
5
|
-
|
|
5
|
+
type Story = StoryObj<typeof AddGuestIcon>;
|
|
6
6
|
export declare const Basic: Story;
|
|
7
7
|
export declare const White: Story;
|
|
@@ -2,6 +2,6 @@ import { Meta, StoryObj } from '@storybook/react';
|
|
|
2
2
|
import { CaretIcon } from './caret-icon';
|
|
3
3
|
declare const meta: Meta<typeof CaretIcon>;
|
|
4
4
|
export default meta;
|
|
5
|
-
|
|
5
|
+
type Story = StoryObj<typeof CaretIcon>;
|
|
6
6
|
export declare const Basic: Story;
|
|
7
7
|
export declare const White: Story;
|
|
@@ -2,6 +2,6 @@ import { Meta, StoryObj } from '@storybook/react';
|
|
|
2
2
|
import { FilterIcon } from './filter-icon';
|
|
3
3
|
declare const meta: Meta<typeof FilterIcon>;
|
|
4
4
|
export default meta;
|
|
5
|
-
|
|
5
|
+
type Story = StoryObj<typeof FilterIcon>;
|
|
6
6
|
export declare const Basic: Story;
|
|
7
7
|
export declare const White: Story;
|
|
@@ -2,6 +2,6 @@ import { Meta, StoryObj } from '@storybook/react';
|
|
|
2
2
|
import { SearchIcon } from './search-icon';
|
|
3
3
|
declare const meta: Meta<typeof SearchIcon>;
|
|
4
4
|
export default meta;
|
|
5
|
-
|
|
5
|
+
type Story = StoryObj<typeof SearchIcon>;
|
|
6
6
|
export declare const Basic: Story;
|
|
7
7
|
export declare const White: Story;
|
|
@@ -2,6 +2,6 @@ import { Meta, StoryObj } from '@storybook/react';
|
|
|
2
2
|
import { SettingsIcon } from './settings-icon';
|
|
3
3
|
declare const meta: Meta<typeof SettingsIcon>;
|
|
4
4
|
export default meta;
|
|
5
|
-
|
|
5
|
+
type Story = StoryObj<typeof SettingsIcon>;
|
|
6
6
|
export declare const Basic: Story;
|
|
7
7
|
export declare const White: Story;
|
|
@@ -2,6 +2,6 @@ import { Meta, StoryObj } from '@storybook/react';
|
|
|
2
2
|
import { SortListIcon } from './sort-list-icon';
|
|
3
3
|
declare const meta: Meta<typeof SortListIcon>;
|
|
4
4
|
export default meta;
|
|
5
|
-
|
|
5
|
+
type Story = StoryObj<typeof SortListIcon>;
|
|
6
6
|
export declare const Basic: Story;
|
|
7
7
|
export declare const White: Story;
|
package/dist/ui/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export { Input } from './form-elements/input';
|
|
|
2
2
|
export { Label } from './form-elements/label';
|
|
3
3
|
export { SearchInput } from './form-elements/search-input';
|
|
4
4
|
export { SegmentedControl } from './form-elements/segmented-control';
|
|
5
|
+
export { Select } from './form-elements/select';
|
|
5
6
|
export { AddGuestIcon } from './icons/add-guest-icon';
|
|
6
7
|
export { CaretIcon } from './icons/caret-icon';
|
|
7
8
|
export { FilterIcon } from './icons/filter-icon';
|
package/dist/ui/index.js
CHANGED
|
@@ -2,6 +2,7 @@ export { Input } from './form-elements/input';
|
|
|
2
2
|
export { Label } from './form-elements/label';
|
|
3
3
|
export { SearchInput } from './form-elements/search-input';
|
|
4
4
|
export { SegmentedControl } from './form-elements/segmented-control';
|
|
5
|
+
export { Select } from './form-elements/select';
|
|
5
6
|
export { AddGuestIcon } from './icons/add-guest-icon';
|
|
6
7
|
export { CaretIcon } from './icons/caret-icon';
|
|
7
8
|
export { FilterIcon } from './icons/filter-icon';
|
package/dist/ui/tag.d.ts
CHANGED
package/dist/ui/tag.stories.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dev-crew-berlin/enter-js-utils",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.81.0",
|
|
4
4
|
"description": "utils such as vaildation and other helpers to work with data from the enter app",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"prettier": "^2.6.2",
|
|
68
68
|
"react": "^18.3.1",
|
|
69
69
|
"react-dom": "^18.3.1",
|
|
70
|
-
"typescript": "^
|
|
70
|
+
"typescript": "^5.6.3"
|
|
71
71
|
},
|
|
72
72
|
"peerDependencies": {
|
|
73
73
|
"react": "^18.1.0",
|