pixelplay 1.1.4 → 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
@@ -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: