@schematichq/schematic-components 2.16.1 → 2.16.2

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.
@@ -13371,7 +13371,7 @@ var reducer = (state, action) => {
13371
13371
  // src/context/EmbedProvider.tsx
13372
13372
  var import_jsx_runtime3 = require("react/jsx-runtime");
13373
13373
  var getCustomHeaders = (sessionId) => ({
13374
- "X-Schematic-Components-Version": "2.16.1",
13374
+ "X-Schematic-Components-Version": "2.16.2",
13375
13375
  "X-Schematic-Session-ID": sessionId
13376
13376
  });
13377
13377
  var normalizeCurrencyFilter = (filter2) => {
@@ -13938,6 +13938,9 @@ function useAvailableCurrenciesWithInvalid() {
13938
13938
  }
13939
13939
  function useSubscriptionCurrency() {
13940
13940
  const { data } = useEmbed();
13941
+ if (data?.subscription?.isInitial) {
13942
+ return void 0;
13943
+ }
13941
13944
  return data?.subscription?.currency?.toUpperCase();
13942
13945
  }
13943
13946
 
@@ -12476,7 +12476,9 @@ export declare function useRequest<TData>(fn: () => Promise<{
12476
12476
  /**
12477
12477
  * Returns the currency of the company's active subscription, if any.
12478
12478
  * Stripe does not allow mixing currencies on a subscription, so when
12479
- * this is set the currency selector should be locked.
12479
+ * this is set the currency selector should be locked. The initial (free,
12480
+ * $0) plan is exempt: its subscription can be switched at checkout, so
12481
+ * we treat it as having no locked currency.
12480
12482
  */
12481
12483
  export declare function useSubscriptionCurrency(): string | undefined;
12482
12484
 
@@ -13282,7 +13282,7 @@ var reducer = (state, action) => {
13282
13282
  // src/context/EmbedProvider.tsx
13283
13283
  import { jsx as jsx2, jsxs } from "react/jsx-runtime";
13284
13284
  var getCustomHeaders = (sessionId) => ({
13285
- "X-Schematic-Components-Version": "2.16.1",
13285
+ "X-Schematic-Components-Version": "2.16.2",
13286
13286
  "X-Schematic-Session-ID": sessionId
13287
13287
  });
13288
13288
  var normalizeCurrencyFilter = (filter2) => {
@@ -13849,6 +13849,9 @@ function useAvailableCurrenciesWithInvalid() {
13849
13849
  }
13850
13850
  function useSubscriptionCurrency() {
13851
13851
  const { data } = useEmbed();
13852
+ if (data?.subscription?.isInitial) {
13853
+ return void 0;
13854
+ }
13852
13855
  return data?.subscription?.currency?.toUpperCase();
13853
13856
  }
13854
13857
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@schematichq/schematic-components",
3
- "version": "2.16.1",
3
+ "version": "2.16.2",
4
4
  "main": "dist/schematic-components.cjs.js",
5
5
  "module": "dist/schematic-components.esm.js",
6
6
  "types": "dist/schematic-components.d.ts",
@@ -65,7 +65,7 @@
65
65
  "eslint-plugin-react": "^7.37.5",
66
66
  "eslint-plugin-react-hooks": "^7.1.1",
67
67
  "globals": "^17.6.0",
68
- "happy-dom": "^20.10.4",
68
+ "happy-dom": "^20.10.5",
69
69
  "jsdom": "^29.1.1",
70
70
  "msw": "^2.14.6",
71
71
  "prettier": "^3.8.4",