few-ticket-widget 1.0.2 → 1.0.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 (2) hide show
  1. package/README.md +74 -47
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,11 +1,11 @@
1
1
  # 🎟️ Ticket Widget
2
2
 
3
- A lightweight, embeddable ticket checkout widget that works in:
3
+ A lightweight, embeddable ticket checkout widget for fewticket that works in:
4
4
 
5
- - ✅ React (JavaScript & TypeScript)
6
- - ✅ Plain HTML / Vanilla JavaScript
7
- - ✅ Any framework (Next.js, Vue, Angular, etc.)
8
- - ✅ CDN embeds (no build tools required)
5
+ - ✅ React (JavaScript & TypeScript)
6
+ - ✅ Plain HTML / Vanilla JavaScript
7
+ - ✅ Any framework (Next.js, Vue, Angular, etc.)
8
+ - ✅ CDN embeds (no build tools required)
9
9
 
10
10
  Perfect for event platforms, ticketing systems, and white-label integrations.
11
11
 
@@ -13,60 +13,73 @@ Perfect for event platforms, ticketing systems, and white-label integrations.
13
13
 
14
14
  ## ✨ Features
15
15
 
16
- - Inline iframe checkout (no popups)
17
- - Dynamic event slugs
18
- - Light / Dark themes
19
- - React component + Vanilla JS API
20
- - TypeScript support with full typings
21
- - CDN-ready for non-React websites
16
+ - Inline iframe checkout (no popups)
17
+ - Dynamic event slugs
18
+ - Light / Dark themes
19
+ - React component + Vanilla JS API
20
+ - TypeScript support with full typings
21
+ - CDN-ready for non-React websites
22
22
 
23
23
  ---
24
24
 
25
- ## 📦 Installation (React / npm)
25
+ ## 📦 Installation
26
26
 
27
27
  ```bash
28
+ # Using npm
28
29
  npm install few-ticket-widget
29
30
 
30
- or
31
+ # Using yarn
32
+ yarn add few-ticket-widget
33
+ ```
31
34
 
32
- yarn add ticket-widge
35
+ ---
33
36
 
34
- React Usage
37
+ ## ⚛️ React Usage
35
38
 
39
+ ```jsx
36
40
  import TicketWidget from 'ticket-widget';
37
41
 
38
- <TicketWidget
39
- eventSlug="groove-&-chill-with-ayode"
40
- theme="dark"
41
- height={700}
42
- baseUrl="https://yourdomain.com"
43
- />;
44
-
45
-
42
+ function App() {
43
+ return (
44
+ <TicketWidget
45
+ eventSlug="groove-&-chill-with-ayode"
46
+ theme="dark"
47
+ height={700}
48
+ baseUrl="https://yourdomain.com"
49
+ />
50
+ );
51
+ }
52
+ ```
53
+
54
+ ### Props
55
+
56
+ | Prop | Type | Required | Default | Description |
57
+ |-----------|----------------------|----------|---------|----------------------------|
58
+ | eventSlug | string | ✅ Yes | — | Unique event identifier |
59
+ | theme | 'light' \| 'dark' | No | light | Widget theme |
60
+ | width | string \| number | No | 100% | Widget width |
61
+ | height | number | No | 700 | Widget height |
62
+ | baseUrl | string | No | — | Checkout base URL |
46
63
 
47
- Props
48
- Prop Type Required Default Description
49
- eventSlug string ✅ Yes — Unique event identifier
50
- theme 'light' | 'dark' No light Widget theme
51
- width string | number No 100% Widget width
52
- height number No 700 Widget height
53
- baseUrl string No — Checkout base URL
64
+ ---
54
65
 
66
+ ## 🌍 Plain HTML / Vanilla JavaScript Usage
55
67
 
68
+ ### Step 1: Add container
56
69
 
57
- 🌍 Plain HTML / Vanilla JavaScript Usage
58
- Step 1: Add container
59
- html
70
+ ```html
71
+ <div id="ticket-widget"></div>
72
+ ```
60
73
 
74
+ ### Step 2: Load widget script (CDN)
61
75
 
62
- <div id="ticket-widget"></div>
63
- Step 2: Load widget script (CDN)
64
- html
65
- e
76
+ ```html
66
77
  <script src="https://cdn.jsdelivr.net/npm/ticket-widget/dist/embed-ticket-widget.js"></script>
67
- Step 3: Initialize widget
68
- html
78
+ ```
79
+
80
+ ### Step 3: Initialize widget
69
81
 
82
+ ```html
70
83
  <script>
71
84
  TicketWidget.create({
72
85
  id: 'ticket-widget',
@@ -76,25 +89,39 @@ html
76
89
  baseUrl: 'https://yourdomain.com'
77
90
  });
78
91
  </script>
79
- 🧠 TypeScript Support
92
+ ```
93
+
94
+ ---
95
+
96
+ ## 🧠 TypeScript Support
97
+
80
98
  This package ships with built-in TypeScript definitions.
81
99
 
82
- React (TypeScript)
100
+ ### React (TypeScript)
83
101
 
102
+ ```tsx
84
103
  import TicketWidget from 'ticket-widget';
85
104
 
86
105
  <TicketWidget eventSlug="my-event" theme="dark" />;
87
- Vanilla TypeScript
88
- ts
89
- Copy code
106
+ ```
107
+
108
+ ### Vanilla TypeScript
109
+
110
+ ```ts
90
111
  window.TicketWidget.create({
91
112
  id: 'ticket',
92
113
  eventSlug: 'my-event'
93
114
  });
115
+ ```
116
+
94
117
  TypeScript users get autocomplete, type safety, and IntelliSense out of the box.
95
118
 
96
- 🌐 CDN URLs
119
+ ---
120
+
121
+ ## 🌐 CDN URLs
122
+
97
123
  You may use either CDN:
98
124
 
99
- https://cdn.jsdelivr.net/npm/ticket-widget/dist/embed-ticket-widget.js
100
- https://unpkg.com/ticket-widget/dist/embed-ticket-widget.js
125
+ - [https://cdn.jsdelivr.net/npm/ticket-widget/dist/embed-ticket-widget.js](https://cdn.jsdelivr.net/npm/ticket-widget/dist/embed-ticket-widget.js)
126
+ - [https://unpkg.com/ticket-widget/dist/embed-ticket-widget.js](https://unpkg.com/ticket-widget/dist/embed-ticket-widget.js)
127
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "few-ticket-widget",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "main": "dist/react-ticket-widget.js",
5
5
  "files": [
6
6
  "dist"