@getmicdrop/svelte-components 2.8.0 → 2.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,44 @@
1
+ export default SuperLogin;
2
+ type SuperLogin = {
3
+ $on?(type: string, callback: (e: any) => void): () => void;
4
+ $set?(props: Partial<$$ComponentProps>): void;
5
+ };
6
+ declare const SuperLogin: import("svelte").Component<{
7
+ apiBaseUrl?: string;
8
+ logoSrc?: string;
9
+ logoAlt?: string;
10
+ initialView?: string;
11
+ isFirstTime?: boolean;
12
+ userEmail?: string;
13
+ firstName?: string;
14
+ portalType?: string;
15
+ defaultRedirectPath?: string;
16
+ setupRedirectPath?: string;
17
+ tosUrl?: string;
18
+ onLoginSuccess?: Function;
19
+ onAccountSelect?: Function;
20
+ onNavigate?: Function;
21
+ onExternalNavigate?: Function;
22
+ showDarkModeToggle?: boolean;
23
+ searchParams?: string;
24
+ }, {}, "">;
25
+ type $$ComponentProps = {
26
+ apiBaseUrl?: string;
27
+ logoSrc?: string;
28
+ logoAlt?: string;
29
+ initialView?: string;
30
+ isFirstTime?: boolean;
31
+ userEmail?: string;
32
+ firstName?: string;
33
+ portalType?: string;
34
+ defaultRedirectPath?: string;
35
+ setupRedirectPath?: string;
36
+ tosUrl?: string;
37
+ onLoginSuccess?: Function;
38
+ onAccountSelect?: Function;
39
+ onNavigate?: Function;
40
+ onExternalNavigate?: Function;
41
+ showDarkModeToggle?: boolean;
42
+ searchParams?: string;
43
+ };
44
+ //# sourceMappingURL=SuperLogin.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SuperLogin.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/SuperLogin/SuperLogin.svelte.js"],"names":[],"mappings":";;;;;AAy9BA;iBA76BkC,MAAM;cAAY,MAAM;cAAY,MAAM;kBAAgB,MAAM;kBAAgB,OAAO;gBAAc,MAAM;gBAAc,MAAM;iBAAe,MAAM;0BAAwB,MAAM;wBAAsB,MAAM;aAAW,MAAM;;;;;yBAAoI,OAAO;mBAAiB,MAAM;WA66B1W;wBA76BtC;IAAE,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,cAAc,CAAC,WAAW;IAAC,eAAe,CAAC,WAAW;IAAC,UAAU,CAAC,WAAW;IAAC,kBAAkB,CAAC,WAAW;IAAC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE"}
@@ -0,0 +1,2 @@
1
+ export { default as SuperLogin } from "./SuperLogin.svelte";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/components/SuperLogin/index.js"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ export { default as SuperLogin } from './SuperLogin.svelte';
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Validation Constants
3
+ *
4
+ * Shared validation rules and defaults for event, ticket, and promo code validation.
5
+ * Used by micdrop-frontend, venue-calendar-npm, and other apps.
6
+ *
7
+ * @example
8
+ * import { MIN_EVENT_DURATION_MINS, DEFAULT_EVENT_DURATION_MINS } from '@getmicdrop/svelte-components';
9
+ */
10
+ /** Minimum event duration in minutes (validation constraint) */
11
+ export const MIN_EVENT_DURATION_MINS: 15;
12
+ /** Maximum event duration in minutes (24 hours) */
13
+ export const MAX_EVENT_DURATION_MINS: 1440;
14
+ /** Default event duration in minutes (used when auto-filling end time) */
15
+ export const DEFAULT_EVENT_DURATION_MINS: 90;
16
+ /** Default time doors open before event start in minutes (used when auto-filling) */
17
+ export const DEFAULT_DOORS_BEFORE_START_MINS: 30;
18
+ /** Maximum tickets per order limit */
19
+ export const MAX_TICKETS_PER_ORDER: 100;
20
+ /** Minimum tickets per order limit */
21
+ export const MIN_TICKETS_PER_ORDER: 0;
22
+ /** Maximum percentage discount */
23
+ export const MAX_PERCENTAGE_DISCOUNT: 100;
24
+ export namespace ErrorCodes {
25
+ let EVENT_DURATION_TOO_SHORT: string;
26
+ let EVENT_DURATION_TOO_LONG: string;
27
+ let EVENT_END_BEFORE_START: string;
28
+ let EVENT_DOORS_SAME_AS_START: string;
29
+ let EVENT_DOORS_TOO_CLOSE: string;
30
+ let EVENT_INVALID_TIME_FORMAT: string;
31
+ let PRICE_REQUIRED: string;
32
+ let PRICE_MUST_BE_POSITIVE: string;
33
+ let PRICE_INVALID_FORMAT: string;
34
+ let QUANTITY_REQUIRED: string;
35
+ let QUANTITY_MUST_BE_POSITIVE: string;
36
+ let QUANTITY_INVALID_FORMAT: string;
37
+ let MIN_TICKETS_REQUIRED: string;
38
+ let MIN_TICKETS_EXCEEDS_MAX_ALLOWED: string;
39
+ let MAX_TICKETS_EXCEEDS_MAX_ALLOWED: string;
40
+ let MIN_EXCEEDS_MAX: string;
41
+ let SALES_BEGIN_AFTER_EVENT_END: string;
42
+ let SALES_END_AFTER_EVENT_END: string;
43
+ let SALES_END_BEFORE_BEGIN: string;
44
+ let CAPACITY_EXCEEDED: string;
45
+ let PROMO_NAME_REQUIRED: string;
46
+ let PROMO_NAME_COLLISION: string;
47
+ let PROMO_END_BEFORE_START: string;
48
+ let PROMO_DISCOUNT_REQUIRED: string;
49
+ let PROMO_BOTH_DISCOUNT_TYPES: string;
50
+ let PROMO_PERCENT_EXCEEDS_100: string;
51
+ let PROMO_LIMIT_REQUIRED: string;
52
+ let PROMO_EXTENDS_PAST_EVENT: string;
53
+ let SALES_CLOSE_TO_EVENT: string;
54
+ }
55
+ //# sourceMappingURL=validation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/lib/constants/validation.js"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH,gEAAgE;AAChE,sCAAuC,EAAE,CAAC;AAE1C,mDAAmD;AACnD,sCAAuC,IAAI,CAAC;AAE5C,0EAA0E;AAC1E,0CAA2C,EAAE,CAAC;AAE9C,qFAAqF;AACrF,8CAA+C,EAAE,CAAC;AAMlD,sCAAsC;AACtC,oCAAqC,GAAG,CAAC;AAEzC,sCAAsC;AACtC,oCAAqC,CAAC,CAAC;AAMvC,kCAAkC;AAClC,sCAAuC,GAAG,CAAC"}
@@ -0,0 +1,91 @@
1
+ /**
2
+ * Validation Constants
3
+ *
4
+ * Shared validation rules and defaults for event, ticket, and promo code validation.
5
+ * Used by micdrop-frontend, venue-calendar-npm, and other apps.
6
+ *
7
+ * @example
8
+ * import { MIN_EVENT_DURATION_MINS, DEFAULT_EVENT_DURATION_MINS } from '@getmicdrop/svelte-components';
9
+ */
10
+
11
+ // ============================================================================
12
+ // Event Time Constants
13
+ // ============================================================================
14
+
15
+ /** Minimum event duration in minutes (validation constraint) */
16
+ export const MIN_EVENT_DURATION_MINS = 15;
17
+
18
+ /** Maximum event duration in minutes (24 hours) */
19
+ export const MAX_EVENT_DURATION_MINS = 1440;
20
+
21
+ /** Default event duration in minutes (used when auto-filling end time) */
22
+ export const DEFAULT_EVENT_DURATION_MINS = 90;
23
+
24
+ /** Default time doors open before event start in minutes (used when auto-filling) */
25
+ export const DEFAULT_DOORS_BEFORE_START_MINS = 30;
26
+
27
+ // ============================================================================
28
+ // Ticket Constants
29
+ // ============================================================================
30
+
31
+ /** Maximum tickets per order limit */
32
+ export const MAX_TICKETS_PER_ORDER = 100;
33
+
34
+ /** Minimum tickets per order limit */
35
+ export const MIN_TICKETS_PER_ORDER = 0;
36
+
37
+ // ============================================================================
38
+ // Promo Code Constants
39
+ // ============================================================================
40
+
41
+ /** Maximum percentage discount */
42
+ export const MAX_PERCENTAGE_DISCOUNT = 100;
43
+
44
+ // ============================================================================
45
+ // Error Codes
46
+ // ============================================================================
47
+
48
+ export const ErrorCodes = {
49
+ // Event errors
50
+ EVENT_DURATION_TOO_SHORT: 'EVENT_DURATION_TOO_SHORT',
51
+ EVENT_DURATION_TOO_LONG: 'EVENT_DURATION_TOO_LONG',
52
+ EVENT_END_BEFORE_START: 'EVENT_END_BEFORE_START',
53
+ EVENT_DOORS_SAME_AS_START: 'EVENT_DOORS_SAME_AS_START',
54
+ EVENT_DOORS_TOO_CLOSE: 'EVENT_DOORS_TOO_CLOSE',
55
+ EVENT_INVALID_TIME_FORMAT: 'EVENT_INVALID_TIME_FORMAT',
56
+
57
+ // Price/quantity errors
58
+ PRICE_REQUIRED: 'PRICE_REQUIRED',
59
+ PRICE_MUST_BE_POSITIVE: 'PRICE_MUST_BE_POSITIVE',
60
+ PRICE_INVALID_FORMAT: 'PRICE_INVALID_FORMAT',
61
+ QUANTITY_REQUIRED: 'QUANTITY_REQUIRED',
62
+ QUANTITY_MUST_BE_POSITIVE: 'QUANTITY_MUST_BE_POSITIVE',
63
+ QUANTITY_INVALID_FORMAT: 'QUANTITY_INVALID_FORMAT',
64
+
65
+ // Ticket limit errors
66
+ MIN_TICKETS_REQUIRED: 'MIN_TICKETS_REQUIRED',
67
+ MIN_TICKETS_EXCEEDS_MAX_ALLOWED: 'MIN_TICKETS_EXCEEDS_MAX_ALLOWED',
68
+ MAX_TICKETS_EXCEEDS_MAX_ALLOWED: 'MAX_TICKETS_EXCEEDS_MAX_ALLOWED',
69
+ MIN_EXCEEDS_MAX: 'MIN_EXCEEDS_MAX',
70
+
71
+ // Sales window errors
72
+ SALES_BEGIN_AFTER_EVENT_END: 'SALES_BEGIN_AFTER_EVENT_END',
73
+ SALES_END_AFTER_EVENT_END: 'SALES_END_AFTER_EVENT_END',
74
+ SALES_END_BEFORE_BEGIN: 'SALES_END_BEFORE_BEGIN',
75
+
76
+ // Capacity errors
77
+ CAPACITY_EXCEEDED: 'CAPACITY_EXCEEDED',
78
+
79
+ // Promo code errors
80
+ PROMO_NAME_REQUIRED: 'PROMO_NAME_REQUIRED',
81
+ PROMO_NAME_COLLISION: 'PROMO_NAME_COLLISION',
82
+ PROMO_END_BEFORE_START: 'PROMO_END_BEFORE_START',
83
+ PROMO_DISCOUNT_REQUIRED: 'PROMO_DISCOUNT_REQUIRED',
84
+ PROMO_BOTH_DISCOUNT_TYPES: 'PROMO_BOTH_DISCOUNT_TYPES',
85
+ PROMO_PERCENT_EXCEEDS_100: 'PROMO_PERCENT_EXCEEDS_100',
86
+ PROMO_LIMIT_REQUIRED: 'PROMO_LIMIT_REQUIRED',
87
+
88
+ // Warning codes
89
+ PROMO_EXTENDS_PAST_EVENT: 'PROMO_EXTENDS_PAST_EVENT',
90
+ SALES_CLOSE_TO_EVENT: 'SALES_CLOSE_TO_EVENT',
91
+ };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=validation.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation.spec.d.ts","sourceRoot":"","sources":["../../src/lib/constants/validation.spec.js"],"names":[],"mappings":""}
@@ -0,0 +1,64 @@
1
+ import { describe, it, expect } from 'vitest';
2
+ import {
3
+ MIN_EVENT_DURATION_MINS,
4
+ MAX_EVENT_DURATION_MINS,
5
+ DEFAULT_EVENT_DURATION_MINS,
6
+ DEFAULT_DOORS_BEFORE_START_MINS,
7
+ MAX_TICKETS_PER_ORDER,
8
+ MIN_TICKETS_PER_ORDER,
9
+ MAX_PERCENTAGE_DISCOUNT,
10
+ ErrorCodes,
11
+ } from './validation.js';
12
+
13
+ describe('validation constants', () => {
14
+ describe('event time constants', () => {
15
+ it('exports MIN_EVENT_DURATION_MINS as 15', () => {
16
+ expect(MIN_EVENT_DURATION_MINS).toBe(15);
17
+ });
18
+
19
+ it('exports MAX_EVENT_DURATION_MINS as 1440 (24 hours)', () => {
20
+ expect(MAX_EVENT_DURATION_MINS).toBe(1440);
21
+ });
22
+
23
+ it('exports DEFAULT_EVENT_DURATION_MINS as 90', () => {
24
+ expect(DEFAULT_EVENT_DURATION_MINS).toBe(90);
25
+ });
26
+
27
+ it('exports DEFAULT_DOORS_BEFORE_START_MINS as 30', () => {
28
+ expect(DEFAULT_DOORS_BEFORE_START_MINS).toBe(30);
29
+ });
30
+ });
31
+
32
+ describe('ticket constants', () => {
33
+ it('exports MAX_TICKETS_PER_ORDER as 100', () => {
34
+ expect(MAX_TICKETS_PER_ORDER).toBe(100);
35
+ });
36
+
37
+ it('exports MIN_TICKETS_PER_ORDER as 0', () => {
38
+ expect(MIN_TICKETS_PER_ORDER).toBe(0);
39
+ });
40
+ });
41
+
42
+ describe('promo code constants', () => {
43
+ it('exports MAX_PERCENTAGE_DISCOUNT as 100', () => {
44
+ expect(MAX_PERCENTAGE_DISCOUNT).toBe(100);
45
+ });
46
+ });
47
+
48
+ describe('error codes', () => {
49
+ it('exports ErrorCodes object with event errors', () => {
50
+ expect(ErrorCodes.EVENT_DURATION_TOO_SHORT).toBe('EVENT_DURATION_TOO_SHORT');
51
+ expect(ErrorCodes.EVENT_END_BEFORE_START).toBe('EVENT_END_BEFORE_START');
52
+ });
53
+
54
+ it('exports ErrorCodes object with ticket errors', () => {
55
+ expect(ErrorCodes.PRICE_REQUIRED).toBe('PRICE_REQUIRED');
56
+ expect(ErrorCodes.QUANTITY_REQUIRED).toBe('QUANTITY_REQUIRED');
57
+ });
58
+
59
+ it('exports ErrorCodes object with promo errors', () => {
60
+ expect(ErrorCodes.PROMO_NAME_REQUIRED).toBe('PROMO_NAME_REQUIRED');
61
+ expect(ErrorCodes.PROMO_PERCENT_EXCEEDS_100).toBe('PROMO_PERCENT_EXCEEDS_100');
62
+ });
63
+ });
64
+ });
package/dist/index.d.ts CHANGED
@@ -84,6 +84,7 @@ export { default as AboutShow } from "./components/AboutShow/AboutShow.svelte";
84
84
  export { default as FAQs } from "./components/FAQs/FAQs.svelte";
85
85
  export { default as ShowTimeCard } from "./components/ShowTimeCard/ShowTimeCard.svelte";
86
86
  export { default as PasswordStrengthIndicator } from "./components/PasswordStrengthIndicator/PasswordStrengthIndicator.svelte";
87
+ export { default as SuperLogin } from "./components/SuperLogin/SuperLogin.svelte";
87
88
  export { default as StatusIndicator } from "./components/StatusIndicator/StatusIndicator.svelte";
88
89
  export { default as ModalShowInfo } from "./components/pages/performers/ModalShowInfo.svelte";
89
90
  export { default as PageBackButton } from "./components/pages/performers/PageBackButton.svelte";
@@ -102,5 +103,6 @@ export { default as TabNavigation } from "./components/pages/shows/TabNavigation
102
103
  export * from "./config.js";
103
104
  export * from "./telemetry.js";
104
105
  export * from "./constants/formOptions.js";
106
+ export * from "./constants/validation.js";
105
107
  export { default as MiniMonthCalendar, default as Calendar } from "./components/Calendar/MiniMonthCalendar.svelte";
106
108
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -111,6 +111,9 @@ export { default as ShowTimeCard } from './components/ShowTimeCard/ShowTimeCard.
111
111
  // Password Strength Indicator
112
112
  export { default as PasswordStrengthIndicator } from './components/PasswordStrengthIndicator/PasswordStrengthIndicator.svelte';
113
113
 
114
+ // SuperLogin - Unified login component
115
+ export { default as SuperLogin } from './components/SuperLogin/SuperLogin.svelte';
116
+
114
117
  // Status Indicator
115
118
  export { default as StatusIndicator } from './components/StatusIndicator/StatusIndicator.svelte';
116
119
 
@@ -140,3 +143,4 @@ export { default as TabNavigation } from './components/pages/shows/TabNavigation
140
143
  export * from './config.js';
141
144
  export * from './telemetry.js';
142
145
  export * from './constants/formOptions.js';
146
+ export * from './constants/validation.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getmicdrop/svelte-components",
3
- "version": "2.8.0",
3
+ "version": "2.8.1",
4
4
  "description": "Shared component library for Micdrop applications",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",