@session-services/web-elements 0.1.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.
Files changed (40) hide show
  1. package/LICENSE +11 -0
  2. package/README.md +101 -0
  3. package/dist/cjs/app-globals-V2Kpy_OQ.js +5 -0
  4. package/dist/cjs/index-C6e98Atu.js +1529 -0
  5. package/dist/cjs/index.cjs.js +2 -0
  6. package/dist/cjs/loader.cjs.js +13 -0
  7. package/dist/cjs/session-services-elements.cjs.js +25 -0
  8. package/dist/cjs/session-services-ticketing.cjs.entry.js +1953 -0
  9. package/dist/collection/collection-manifest.json +12 -0
  10. package/dist/collection/components/session-services-ticketing/session-services-ticketing.css +879 -0
  11. package/dist/collection/components/session-services-ticketing/session-services-ticketing.js +708 -0
  12. package/dist/collection/index.js +11 -0
  13. package/dist/components/index.d.ts +33 -0
  14. package/dist/components/index.js +1311 -0
  15. package/dist/components/session-services-ticketing.d.ts +11 -0
  16. package/dist/components/session-services-ticketing.js +1995 -0
  17. package/dist/esm/app-globals-DQuL1Twl.js +3 -0
  18. package/dist/esm/index-CeXOR4aK.js +1521 -0
  19. package/dist/esm/index.js +1 -0
  20. package/dist/esm/loader.js +11 -0
  21. package/dist/esm/session-services-elements.js +21 -0
  22. package/dist/esm/session-services-ticketing.entry.js +1951 -0
  23. package/dist/index.cjs.js +1 -0
  24. package/dist/index.js +1 -0
  25. package/dist/session-services-elements/index.esm.js +0 -0
  26. package/dist/session-services-elements/p-9ca1f04b.entry.js +1 -0
  27. package/dist/session-services-elements/p-CeXOR4aK.js +2 -0
  28. package/dist/session-services-elements/p-DQuL1Twl.js +1 -0
  29. package/dist/session-services-elements/session-services-elements.esm.js +1 -0
  30. package/dist/sst-env.d.ts +9 -0
  31. package/dist/types/components/session-services-ticketing/session-services-ticketing.d.ts +64 -0
  32. package/dist/types/components.d.ts +111 -0
  33. package/dist/types/index.d.ts +9 -0
  34. package/dist/types/stencil-public-runtime.d.ts +1799 -0
  35. package/loader/cdn.js +1 -0
  36. package/loader/index.cjs.js +1 -0
  37. package/loader/index.d.ts +24 -0
  38. package/loader/index.es2017.js +1 -0
  39. package/loader/index.js +2 -0
  40. package/package.json +101 -0
package/LICENSE ADDED
@@ -0,0 +1,11 @@
1
+ Copyright (c) 2023 Session Services Pty Ltd. All Rights Reserved.
2
+
3
+ This software and associated documentation files (the "Software") are
4
+ proprietary and confidential. Unauthorized copying, modification,
5
+ distribution, or use of this Software, via any medium, is strictly prohibited.
6
+
7
+ The Software is provided for use solely by authorized licensees in accordance
8
+ with a separate license agreement. No license, express or implied, to any
9
+ intellectual property rights is granted except as explicitly set forth herein.
10
+
11
+ For licensing inquiries, contact: hello@session.services
package/README.md ADDED
@@ -0,0 +1,101 @@
1
+ # @session-services/web-elements
2
+
3
+ Framework-agnostic Web Components for [Session Services](https://session.services) ticketing.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @session-services/web-elements @session-services/sdk
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```typescript
14
+ import { defineCustomElements } from '@session-services/web-elements/loader';
15
+
16
+ // Call once at app startup
17
+ defineCustomElements();
18
+ ```
19
+
20
+ ```html
21
+ <session-services-ticketing
22
+ tenant-id="your-tenant-id"
23
+ event-id="evt_123"
24
+ return-url="https://yoursite.com/order/complete"
25
+ theme="light"
26
+ ></session-services-ticketing>
27
+ ```
28
+
29
+ ## Props
30
+
31
+ | Prop | Type | Required | Default | Description |
32
+ |------|------|----------|---------|-------------|
33
+ | `tenant-id` | `string` | Yes | — | Your Session Services tenant ID |
34
+ | `event-id` | `string` | Yes | — | Event ID to display tickets for |
35
+ | `api-url` | `string` | No | `https://api.session.services` | API endpoint URL |
36
+ | `locale` | `string` | No | `en-US` | Locale for formatting |
37
+ | `return-url` | `string` | No | — | URL to redirect after checkout |
38
+ | `theme` | `'light' \| 'dark' \| 'system'` | No | `system` | Color theme |
39
+ | `enable-analytics` | `boolean` | No | `true` | Enable analytics tracking |
40
+ | `debug-analytics` | `boolean` | No | `false` | Log analytics events to console |
41
+
42
+ ## Events
43
+
44
+ Listen to events using standard DOM event listeners:
45
+
46
+ ```javascript
47
+ const element = document.querySelector('session-services-ticketing');
48
+
49
+ element.addEventListener('cartUpdate', (e) => {
50
+ console.log('Cart updated:', e.detail); // OrderQuote
51
+ });
52
+
53
+ element.addEventListener('checkoutInit', (e) => {
54
+ const { orderId, checkoutUrl } = e.detail;
55
+ window.location.href = checkoutUrl;
56
+ });
57
+
58
+ element.addEventListener('errorOccurred', (e) => {
59
+ console.error('Error:', e.detail.error);
60
+ });
61
+ ```
62
+
63
+ | Event | Detail Type | Description |
64
+ |-------|-------------|-------------|
65
+ | `cartUpdate` | `OrderQuote` | Fired when cart contents change |
66
+ | `checkoutInit` | `{ orderId: string; checkoutUrl: string }` | Fired when checkout begins |
67
+ | `errorOccurred` | `{ error: string }` | Fired on errors |
68
+
69
+ ## Theming
70
+
71
+ Customize appearance with CSS variables:
72
+
73
+ ```html
74
+ <session-services-ticketing
75
+ tenant-id="..."
76
+ event-id="..."
77
+ style="
78
+ --card: #fff;
79
+ --card-foreground: #111827;
80
+ --border: #e5e7eb;
81
+ --primary: #ec4899;
82
+ --primary-foreground: #ffffff;
83
+ --accent: #f472b6;
84
+ --accent-foreground: #0f172a;
85
+ --secondary: #f3f4f6;
86
+ --secondary-foreground: #1f2937;
87
+ --muted-foreground: #6b7280;
88
+ --ring: #f472b6;
89
+ "
90
+ ></session-services-ticketing>
91
+ ```
92
+
93
+ ## Framework Integration
94
+
95
+ Works with any framework - React, Vue, Angular, Svelte, or vanilla HTML.
96
+
97
+ For React, consider using `@session-services/react-elements` for better DX with typed props and event handlers.
98
+
99
+ ## License
100
+
101
+ Proprietary - Copyright (c) 2023 Session Services Pty Ltd. All Rights Reserved.
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+
3
+ const globalScripts = () => {};
4
+
5
+ exports.globalScripts = globalScripts;