pixelplay 1.2.0 → 1.2.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.
package/dist/server.d.mts CHANGED
@@ -184,6 +184,7 @@ type ThemeTokens = {
184
184
  };
185
185
  declare const lightTheme: ThemeTokens;
186
186
  declare const darkTheme: ThemeTokens;
187
+
187
188
  /**
188
189
  * Generates a `<style>` block with CSS custom properties for every design
189
190
  * theme × light/dark mode. The first theme (inkwell) is output as `:root` / `.dark`.
@@ -193,30 +194,26 @@ declare const darkTheme: ThemeTokens;
193
194
  declare function generateThemeCSS(): string;
194
195
 
195
196
  /**
196
- * PixelPlay UI License validation via Polar.sh customer-portal API.
197
- *
198
- * Behaviour:
199
- * - Development (`next dev`): console warning if no key, components work fine.
200
- * - Production build (`next build`): validates key against Polar API.
201
- * Build fails if the key is missing, invalid, or revoked.
197
+ * PixelPlay UI - License validation (optional).
202
198
  *
203
- * This uses the public customer-portal endpoint (no auth token required).
199
+ * The npm package is free to use. License keys are optional and used
200
+ * for analytics/support tracking only. Builds never fail due to missing keys.
204
201
  */
205
202
  interface InitOptions {
206
- /** The customer's license key (from PIXELPLAY_LICENSE_KEY env var) */
203
+ /** Optional license key for analytics/support tracking */
207
204
  licenseKey?: string;
208
205
  }
209
206
  /**
210
- * Initialise PixelPlay and validate the license key.
207
+ * Initialise PixelPlay (optional).
211
208
  *
212
- * Call this once at the top of your root layout (server component):
209
+ * Call this once at the top of your root layout if you want to register
210
+ * your license key for support tracking:
213
211
  * ```ts
214
212
  * import { initPixelPlay } from "pixelplay/server";
215
213
  * initPixelPlay({ licenseKey: process.env.PIXELPLAY_LICENSE_KEY });
216
214
  * ```
217
215
  *
218
- * In development: logs a warning if no key components still work.
219
- * In production builds: validates the key and fails the build if invalid.
216
+ * Without a key, components work normally in all environments.
220
217
  */
221
218
  declare function initPixelPlay(options?: InitOptions): Promise<void>;
222
219
 
package/dist/server.d.ts CHANGED
@@ -184,6 +184,7 @@ type ThemeTokens = {
184
184
  };
185
185
  declare const lightTheme: ThemeTokens;
186
186
  declare const darkTheme: ThemeTokens;
187
+
187
188
  /**
188
189
  * Generates a `<style>` block with CSS custom properties for every design
189
190
  * theme × light/dark mode. The first theme (inkwell) is output as `:root` / `.dark`.
@@ -193,30 +194,26 @@ declare const darkTheme: ThemeTokens;
193
194
  declare function generateThemeCSS(): string;
194
195
 
195
196
  /**
196
- * PixelPlay UI License validation via Polar.sh customer-portal API.
197
- *
198
- * Behaviour:
199
- * - Development (`next dev`): console warning if no key, components work fine.
200
- * - Production build (`next build`): validates key against Polar API.
201
- * Build fails if the key is missing, invalid, or revoked.
197
+ * PixelPlay UI - License validation (optional).
202
198
  *
203
- * This uses the public customer-portal endpoint (no auth token required).
199
+ * The npm package is free to use. License keys are optional and used
200
+ * for analytics/support tracking only. Builds never fail due to missing keys.
204
201
  */
205
202
  interface InitOptions {
206
- /** The customer's license key (from PIXELPLAY_LICENSE_KEY env var) */
203
+ /** Optional license key for analytics/support tracking */
207
204
  licenseKey?: string;
208
205
  }
209
206
  /**
210
- * Initialise PixelPlay and validate the license key.
207
+ * Initialise PixelPlay (optional).
211
208
  *
212
- * Call this once at the top of your root layout (server component):
209
+ * Call this once at the top of your root layout if you want to register
210
+ * your license key for support tracking:
213
211
  * ```ts
214
212
  * import { initPixelPlay } from "pixelplay/server";
215
213
  * initPixelPlay({ licenseKey: process.env.PIXELPLAY_LICENSE_KEY });
216
214
  * ```
217
215
  *
218
- * In development: logs a warning if no key components still work.
219
- * In production builds: validates the key and fails the build if invalid.
216
+ * Without a key, components work normally in all environments.
220
217
  */
221
218
  declare function initPixelPlay(options?: InitOptions): Promise<void>;
222
219
 
package/dist/server.js CHANGED
@@ -43,10 +43,10 @@ var colors = {
43
43
  500: "#9E77ED",
44
44
  600: "#7F56D9",
45
45
  700: "#6941C6",
46
- 800: "#53389E",
47
- 900: "#42307D",
48
- 950: "#26145A",
49
- 975: "#160C34"
46
+ 800: "#42307D",
47
+ 900: "#26145A",
48
+ 950: "#160C34",
49
+ 975: "#0B061A"
50
50
  },
51
51
  error: {
52
52
  25: "#FFFBFA",
@@ -58,10 +58,10 @@ var colors = {
58
58
  500: "#F04438",
59
59
  600: "#D92D20",
60
60
  700: "#B42318",
61
- 800: "#912018",
62
- 900: "#7A271A",
63
- 950: "#4C1108",
64
- 975: "#2B0904"
61
+ 800: "#7A271A",
62
+ 900: "#4C1108",
63
+ 950: "#2B0904",
64
+ 975: "#160502"
65
65
  },
66
66
  warning: {
67
67
  25: "#FFFCF5",
@@ -73,10 +73,10 @@ var colors = {
73
73
  500: "#F79009",
74
74
  600: "#DC6803",
75
75
  700: "#B54708",
76
- 800: "#93370D",
77
- 900: "#7A2E0E",
78
- 950: "#491A06",
79
- 975: "#291003"
76
+ 800: "#7A2E0E",
77
+ 900: "#491A06",
78
+ 950: "#291003",
79
+ 975: "#150802"
80
80
  },
81
81
  success: {
82
82
  25: "#F6FEF9",
@@ -88,10 +88,10 @@ var colors = {
88
88
  500: "#12B76A",
89
89
  600: "#039855",
90
90
  700: "#027A48",
91
- 800: "#05603A",
92
- 900: "#054F31",
93
- 950: "#03301E",
94
- 975: "#021C11"
91
+ 800: "#054F31",
92
+ 900: "#03301E",
93
+ 950: "#021C11",
94
+ 975: "#010E09"
95
95
  },
96
96
  // ── Neutrals ──────────────────────────────────────────────────────────────
97
97
  gray: {
@@ -165,10 +165,10 @@ var colors = {
165
165
  500: "#EF4444",
166
166
  600: "#DC2626",
167
167
  700: "#B91C1C",
168
- 800: "#991B1B",
169
- 900: "#7F1D1D",
170
- 950: "#4C1111",
171
- 975: "#2B0909"
168
+ 800: "#7F1D1D",
169
+ 900: "#4C1111",
170
+ 950: "#2B0909",
171
+ 975: "#160505"
172
172
  },
173
173
  orange: {
174
174
  25: "#FFFAF5",
@@ -180,10 +180,10 @@ var colors = {
180
180
  500: "#FB6514",
181
181
  600: "#EC4A0A",
182
182
  700: "#C4320A",
183
- 800: "#9C2A10",
184
- 900: "#7E2410",
185
- 950: "#4C1509",
186
- 975: "#2B0C05"
183
+ 800: "#7E2410",
184
+ 900: "#4C1509",
185
+ 950: "#2B0C05",
186
+ 975: "#160603"
187
187
  },
188
188
  amber: {
189
189
  25: "#FFFDF5",
@@ -195,10 +195,10 @@ var colors = {
195
195
  500: "#F59E0B",
196
196
  600: "#D97706",
197
197
  700: "#B45309",
198
- 800: "#92400E",
199
- 900: "#78350F",
200
- 950: "#471E07",
201
- 975: "#280F03"
198
+ 800: "#78350F",
199
+ 900: "#471E07",
200
+ 950: "#280F03",
201
+ 975: "#140802"
202
202
  },
203
203
  yellow: {
204
204
  25: "#FEFEF2",
@@ -210,10 +210,10 @@ var colors = {
210
210
  500: "#EAB308",
211
211
  600: "#CA8A04",
212
212
  700: "#A16207",
213
- 800: "#854D0E",
214
- 900: "#713F12",
215
- 950: "#44250A",
216
- 975: "#261505"
213
+ 800: "#713F12",
214
+ 900: "#44250A",
215
+ 950: "#261505",
216
+ 975: "#130B03"
217
217
  },
218
218
  // ── Greens ────────────────────────────────────────────────────────────────
219
219
  lime: {
@@ -226,10 +226,10 @@ var colors = {
226
226
  500: "#84CC16",
227
227
  600: "#65A30D",
228
228
  700: "#4D7C0F",
229
- 800: "#3F6212",
230
- 900: "#365314",
231
- 950: "#20320C",
232
- 975: "#121C06"
229
+ 800: "#365314",
230
+ 900: "#20320C",
231
+ 950: "#121C06",
232
+ 975: "#090E03"
233
233
  },
234
234
  green: {
235
235
  25: "#F2FDF5",
@@ -241,10 +241,10 @@ var colors = {
241
241
  500: "#22C55E",
242
242
  600: "#16A34A",
243
243
  700: "#15803D",
244
- 800: "#166534",
245
- 900: "#14532D",
246
- 950: "#0C321B",
247
- 975: "#061C0F"
244
+ 800: "#14532D",
245
+ 900: "#0C321B",
246
+ 950: "#061C0F",
247
+ 975: "#030E08"
248
248
  },
249
249
  emerald: {
250
250
  25: "#F3FDF8",
@@ -256,10 +256,10 @@ var colors = {
256
256
  500: "#10B981",
257
257
  600: "#059669",
258
258
  700: "#047857",
259
- 800: "#065F46",
260
- 900: "#064E3B",
261
- 950: "#032F23",
262
- 975: "#021A13"
259
+ 800: "#064E3B",
260
+ 900: "#032F23",
261
+ 950: "#021A13",
262
+ 975: "#010D0A"
263
263
  },
264
264
  teal: {
265
265
  25: "#F0FCFB",
@@ -271,10 +271,10 @@ var colors = {
271
271
  500: "#14B8A6",
272
272
  600: "#0D9488",
273
273
  700: "#0F766E",
274
- 800: "#115E59",
275
- 900: "#134E4A",
276
- 950: "#0A302E",
277
- 975: "#061C1A"
274
+ 800: "#134E4A",
275
+ 900: "#0A302E",
276
+ 950: "#061C1A",
277
+ 975: "#030E0D"
278
278
  },
279
279
  // ── Blues ─────────────────────────────────────────────────────────────────
280
280
  cyan: {
@@ -287,10 +287,10 @@ var colors = {
287
287
  500: "#06B6D4",
288
288
  600: "#0891B2",
289
289
  700: "#0E7490",
290
- 800: "#155E75",
291
- 900: "#164E63",
292
- 950: "#0C2F3C",
293
- 975: "#071A22"
290
+ 800: "#164E63",
291
+ 900: "#0C2F3C",
292
+ 950: "#071A22",
293
+ 975: "#040D11"
294
294
  },
295
295
  blueLight: {
296
296
  25: "#F5FBFF",
@@ -302,10 +302,10 @@ var colors = {
302
302
  500: "#0BA5EC",
303
303
  600: "#0086C9",
304
304
  700: "#026AA2",
305
- 800: "#065986",
306
- 900: "#0B4A6F",
307
- 950: "#062C43",
308
- 975: "#031826"
305
+ 800: "#0B4A6F",
306
+ 900: "#062C43",
307
+ 950: "#031826",
308
+ 975: "#020C13"
309
309
  },
310
310
  blue: {
311
311
  25: "#F5FAFF",
@@ -317,10 +317,10 @@ var colors = {
317
317
  500: "#2E90FA",
318
318
  600: "#1570EF",
319
319
  700: "#175CD3",
320
- 800: "#1849A9",
321
- 900: "#194185",
322
- 950: "#0E2669",
323
- 975: "#08153B"
320
+ 800: "#194185",
321
+ 900: "#0E2669",
322
+ 950: "#08153B",
323
+ 975: "#040B1E"
324
324
  },
325
325
  blueGray: {
326
326
  25: "#FCFCFD",
@@ -348,10 +348,10 @@ var colors = {
348
348
  500: "#6172F3",
349
349
  600: "#444CE7",
350
350
  700: "#3538CD",
351
- 800: "#2D31A6",
352
- 900: "#2D3282",
353
- 950: "#1B1F52",
354
- 975: "#10122F"
351
+ 800: "#2D3282",
352
+ 900: "#1B1F52",
353
+ 950: "#10122F",
354
+ 975: "#080918"
355
355
  },
356
356
  violet: {
357
357
  25: "#FAFAFF",
@@ -363,10 +363,10 @@ var colors = {
363
363
  500: "#8B5CF6",
364
364
  600: "#7C3AED",
365
365
  700: "#6D28D9",
366
- 800: "#5B21B6",
367
- 900: "#4C1D95",
368
- 950: "#2D1159",
369
- 975: "#190932"
366
+ 800: "#4C1D95",
367
+ 900: "#2D1159",
368
+ 950: "#190932",
369
+ 975: "#0D0519"
370
370
  },
371
371
  purple: {
372
372
  25: "#FAFAFF",
@@ -378,10 +378,10 @@ var colors = {
378
378
  500: "#7A5AF8",
379
379
  600: "#6938EF",
380
380
  700: "#5925DC",
381
- 800: "#4A1FB8",
382
- 900: "#3E1C96",
383
- 950: "#25105A",
384
- 975: "#140932"
381
+ 800: "#3E1C96",
382
+ 900: "#25105A",
383
+ 950: "#140932",
384
+ 975: "#0A0519"
385
385
  },
386
386
  fuchsia: {
387
387
  25: "#FEF8FF",
@@ -393,10 +393,10 @@ var colors = {
393
393
  500: "#D946EF",
394
394
  600: "#C026D3",
395
395
  700: "#A21CAF",
396
- 800: "#86198F",
397
- 900: "#701A75",
398
- 950: "#430F46",
399
- 975: "#250827"
396
+ 800: "#701A75",
397
+ 900: "#430F46",
398
+ 950: "#250827",
399
+ 975: "#130414"
400
400
  },
401
401
  pink: {
402
402
  25: "#FEF6FB",
@@ -408,10 +408,10 @@ var colors = {
408
408
  500: "#EE46BC",
409
409
  600: "#DD2590",
410
410
  700: "#C11574",
411
- 800: "#9E165F",
412
- 900: "#851651",
413
- 950: "#4F0C30",
414
- 975: "#2C071A"
411
+ 800: "#851651",
412
+ 900: "#4F0C30",
413
+ 950: "#2C071A",
414
+ 975: "#16040D"
415
415
  },
416
416
  rose: {
417
417
  25: "#FFF5F6",
@@ -423,10 +423,10 @@ var colors = {
423
423
  500: "#F63D68",
424
424
  600: "#E31B54",
425
425
  700: "#C01048",
426
- 800: "#A11043",
427
- 900: "#89123E",
428
- 950: "#520A25",
429
- 975: "#2E0514"
426
+ 800: "#89123E",
427
+ 900: "#520A25",
428
+ 950: "#2E0514",
429
+ 975: "#17030A"
430
430
  }
431
431
  };
432
432
  var textScale = {
@@ -684,6 +684,7 @@ var rosewoodTheme = {
684
684
  label: "Rosewood",
685
685
  description: "Elegant fashion & retail",
686
686
  swatch: colors.rose[200],
687
+ personality: "soft",
687
688
  light: rosewoodLightTheme,
688
689
  dark: rosewoodDarkTheme,
689
690
  globals: {
@@ -726,7 +727,20 @@ var rosewoodTheme = {
726
727
  "--shadow-md": "0 4px 16px -2px rgba(68,44,46,0.06)",
727
728
  "--shadow-lg": "0 8px 28px -4px rgba(68,44,46,0.06)",
728
729
  "--shadow-xl": "0 16px 44px -6px rgba(68,44,46,0.06)",
729
- "--shadow-2xl": "0 24px 60px -8px rgba(68,44,46,0.06)"
730
+ "--shadow-2xl": "0 24px 60px -8px rgba(68,44,46,0.06)",
731
+ // ── Spacing tokens ──
732
+ "--spacing-page-x": "1rem",
733
+ "--spacing-page-y": "1.5rem",
734
+ "--spacing-card-x": "1.25rem",
735
+ "--spacing-card-y": "1rem",
736
+ "--spacing-section-gap": "1.5rem",
737
+ "--spacing-row-gap": "1rem",
738
+ "--spacing-col-gap": "1rem",
739
+ "--spacing-header-h": "3.5rem",
740
+ "--spacing-sidebar-w": "17.25rem",
741
+ "--spacing-filter-bar-x": "1rem",
742
+ "--spacing-filter-bar-y": "0.75rem",
743
+ "--spacing-aside-w": "20rem"
730
744
  }
731
745
  };
732
746
 
@@ -965,6 +979,7 @@ var botanicaTheme = {
965
979
  label: "Botanica",
966
980
  description: "Nature-inspired cooking & lifestyle",
967
981
  swatch: colors.emerald[700],
982
+ personality: "balanced",
968
983
  light: botanicaLightTheme,
969
984
  dark: botanicaDarkTheme,
970
985
  globals: {
@@ -1007,7 +1022,20 @@ var botanicaTheme = {
1007
1022
  "--shadow-md": "0 3px 10px -2px rgba(26,58,42,0.10)",
1008
1023
  "--shadow-lg": "0 6px 20px -4px rgba(26,58,42,0.12)",
1009
1024
  "--shadow-xl": "0 12px 32px -6px rgba(26,58,42,0.12)",
1010
- "--shadow-2xl": "0 20px 48px -8px rgba(26,58,42,0.14)"
1025
+ "--shadow-2xl": "0 20px 48px -8px rgba(26,58,42,0.14)",
1026
+ // ── Spacing tokens ──
1027
+ "--spacing-page-x": "1rem",
1028
+ "--spacing-page-y": "1.5rem",
1029
+ "--spacing-card-x": "1.5rem",
1030
+ "--spacing-card-y": "1.25rem",
1031
+ "--spacing-section-gap": "1.5rem",
1032
+ "--spacing-row-gap": "1rem",
1033
+ "--spacing-col-gap": "1rem",
1034
+ "--spacing-header-h": "3.5rem",
1035
+ "--spacing-sidebar-w": "17.25rem",
1036
+ "--spacing-filter-bar-x": "1rem",
1037
+ "--spacing-filter-bar-y": "0.75rem",
1038
+ "--spacing-aside-w": "20rem"
1011
1039
  }
1012
1040
  };
1013
1041
 
@@ -1246,6 +1274,7 @@ var inkwellTheme = {
1246
1274
  label: "Inkwell",
1247
1275
  description: "Bold editorial & news",
1248
1276
  swatch: colors.violet[600],
1277
+ personality: "sharp",
1249
1278
  light: inkwellLightTheme,
1250
1279
  dark: inkwellDarkTheme,
1251
1280
  globals: {
@@ -1288,7 +1317,20 @@ var inkwellTheme = {
1288
1317
  "--shadow-md": "0 2px 6px -1px rgba(0,0,0,0.20)",
1289
1318
  "--shadow-lg": "0 4px 12px -2px rgba(0,0,0,0.22)",
1290
1319
  "--shadow-xl": "0 8px 24px -4px rgba(0,0,0,0.22)",
1291
- "--shadow-2xl": "0 12px 36px -6px rgba(0,0,0,0.24)"
1320
+ "--shadow-2xl": "0 12px 36px -6px rgba(0,0,0,0.24)",
1321
+ // ── Spacing tokens ──
1322
+ "--spacing-page-x": "1rem",
1323
+ "--spacing-page-y": "1.5rem",
1324
+ "--spacing-card-x": "1.25rem",
1325
+ "--spacing-card-y": "1rem",
1326
+ "--spacing-section-gap": "1.5rem",
1327
+ "--spacing-row-gap": "1rem",
1328
+ "--spacing-col-gap": "1rem",
1329
+ "--spacing-header-h": "3.5rem",
1330
+ "--spacing-sidebar-w": "17.25rem",
1331
+ "--spacing-filter-bar-x": "1rem",
1332
+ "--spacing-filter-bar-y": "0.75rem",
1333
+ "--spacing-aside-w": "20rem"
1292
1334
  }
1293
1335
  };
1294
1336
 
@@ -1587,26 +1629,13 @@ async function initPixelPlay(options) {
1587
1629
  if (initialised) return;
1588
1630
  initialised = true;
1589
1631
  const key = options == null ? void 0 : options.licenseKey;
1590
- const isProduction = process.env.NODE_ENV === "production";
1591
1632
  if (!key) {
1592
- if (isProduction) {
1593
- throw new Error(
1594
- "\n\n\u{1F6AB} PixelPlay UI \u2014 Build failed: No license key provided.\n Set PIXELPLAY_LICENSE_KEY in your environment variables.\n Purchase a license at https://dennisisaac.com/ui-kit/pricing\n"
1595
- );
1596
- }
1597
- console.warn(
1598
- "\n\u26A0\uFE0F PixelPlay UI \u2014 No license key provided.\n Components will work in development, but production builds require a valid key.\n Purchase a license at https://dennisisaac.com/ui-kit/pricing\n"
1599
- );
1600
- return;
1601
- }
1602
- if (!isProduction) {
1603
- validateKey(key, false).catch(() => {
1604
- });
1605
1633
  return;
1606
1634
  }
1607
- await validateKey(key, true);
1635
+ validateKey(key).catch(() => {
1636
+ });
1608
1637
  }
1609
- async function validateKey(key, throwOnError) {
1638
+ async function validateKey(key) {
1610
1639
  try {
1611
1640
  const res = await fetch(VALIDATE_URL, {
1612
1641
  method: "POST",
@@ -1617,29 +1646,20 @@ async function validateKey(key, throwOnError) {
1617
1646
  })
1618
1647
  });
1619
1648
  if (!res.ok) {
1620
- const status = res.status;
1621
- if (status === 404 || status === 422) {
1622
- const msg = "\n\u{1F6AB} PixelPlay UI \u2014 Invalid license key.\n The provided PIXELPLAY_LICENSE_KEY could not be validated.\n Please check your key or purchase a license at\n https://dennisisaac.com/ui-kit/pricing\n";
1623
- if (throwOnError) throw new Error(msg);
1624
- console.warn("\u26A0\uFE0F " + msg);
1625
- return;
1649
+ if (res.status === 404 || res.status === 422) {
1650
+ console.info(
1651
+ "[PixelPlay] License key could not be validated. Components will still work normally."
1652
+ );
1626
1653
  }
1627
1654
  return;
1628
1655
  }
1629
1656
  const data = await res.json();
1630
1657
  if (data.status === "revoked" || data.status === "disabled") {
1631
- const msg = `
1632
- \u{1F6AB} PixelPlay UI \u2014 License key has been ${data.status}.
1633
- Please contact support or purchase a new license at
1634
- https://dennisisaac.com/ui-kit/pricing
1635
- `;
1636
- if (throwOnError) throw new Error(msg);
1637
- console.warn("\u26A0\uFE0F " + msg);
1638
- }
1639
- } catch (err) {
1640
- if (err instanceof Error && err.message.includes("PixelPlay UI")) {
1641
- throw err;
1658
+ console.info(
1659
+ `[PixelPlay] License key has been ${data.status}. Components will still work normally.`
1660
+ );
1642
1661
  }
1662
+ } catch (e) {
1643
1663
  }
1644
1664
  }
1645
1665
  // Annotate the CommonJS export names for ESM import in node: