@schematichq/schematic-components 2.22.1-rc.3 → 2.22.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.
@@ -13642,10 +13642,13 @@ function getSubscriptionDiscount(discounts, subscriptionTotal, subscriptionCurre
13642
13642
  return {
13643
13643
  duration: discount.duration,
13644
13644
  durationInMonths: discount.durationInMonths ?? void 0,
13645
- discountedPrice: formatCurrency(
13646
- discountedTotal,
13647
- subscriptionCurrency ?? void 0
13648
- )
13645
+ // A percent discount can leave fractional minor units (e.g. 40% off
13646
+ // $19.99); format at the currency's standard precision so they round
13647
+ // away instead of rendering (e.g. "$11.994").
13648
+ discountedPrice: formatCurrency(discountedTotal, {
13649
+ currency: subscriptionCurrency ?? void 0,
13650
+ testSignificantDigits: false
13651
+ })
13649
13652
  };
13650
13653
  }
13651
13654
  function getBillingPreviewText({
@@ -14384,7 +14387,7 @@ var reducer = (state, action) => {
14384
14387
  // src/context/EmbedProvider.tsx
14385
14388
  var import_jsx_runtime3 = require("react/jsx-runtime");
14386
14389
  var getCustomHeaders = (sessionId) => ({
14387
- "X-Schematic-Components-Version": "2.22.1-rc.3",
14390
+ "X-Schematic-Components-Version": "2.22.2",
14388
14391
  "X-Schematic-Session-ID": sessionId
14389
14392
  });
14390
14393
  var normalizeCurrencyFilter = (filter2) => {
@@ -22176,8 +22179,14 @@ var SubscriptionSidebar = (0, import_react45.forwardRef)(
22176
22179
  /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Box, { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Text, { children: formatCurrency(
22177
22180
  // Prefer the discount Stripe applied; derive from
22178
22181
  // `percentOff` only for API responses that predate it.
22182
+ // The derived value can carry fractional minor units
22183
+ // (e.g. 40% of $19.99), so round to the currency's
22184
+ // standard precision rather than rendering them.
22179
22185
  discountAmount > 0 ? discountAmount : newCharges / 100 * percentOff,
22180
- selectedPlanCurrency
22186
+ {
22187
+ currency: selectedPlanCurrency,
22188
+ testSignificantDigits: false
22189
+ }
22181
22190
  ) }) })
22182
22191
  ]
22183
22192
  }
@@ -13552,10 +13552,13 @@ function getSubscriptionDiscount(discounts, subscriptionTotal, subscriptionCurre
13552
13552
  return {
13553
13553
  duration: discount.duration,
13554
13554
  durationInMonths: discount.durationInMonths ?? void 0,
13555
- discountedPrice: formatCurrency(
13556
- discountedTotal,
13557
- subscriptionCurrency ?? void 0
13558
- )
13555
+ // A percent discount can leave fractional minor units (e.g. 40% off
13556
+ // $19.99); format at the currency's standard precision so they round
13557
+ // away instead of rendering (e.g. "$11.994").
13558
+ discountedPrice: formatCurrency(discountedTotal, {
13559
+ currency: subscriptionCurrency ?? void 0,
13560
+ testSignificantDigits: false
13561
+ })
13559
13562
  };
13560
13563
  }
13561
13564
  function getBillingPreviewText({
@@ -14294,7 +14297,7 @@ var reducer = (state, action) => {
14294
14297
  // src/context/EmbedProvider.tsx
14295
14298
  import { jsx as jsx2, jsxs } from "react/jsx-runtime";
14296
14299
  var getCustomHeaders = (sessionId) => ({
14297
- "X-Schematic-Components-Version": "2.22.1-rc.3",
14300
+ "X-Schematic-Components-Version": "2.22.2",
14298
14301
  "X-Schematic-Session-ID": sessionId
14299
14302
  });
14300
14303
  var normalizeCurrencyFilter = (filter2) => {
@@ -22117,8 +22120,14 @@ var SubscriptionSidebar = forwardRef7(
22117
22120
  /* @__PURE__ */ jsx41(Box, { children: /* @__PURE__ */ jsx41(Text, { children: formatCurrency(
22118
22121
  // Prefer the discount Stripe applied; derive from
22119
22122
  // `percentOff` only for API responses that predate it.
22123
+ // The derived value can carry fractional minor units
22124
+ // (e.g. 40% of $19.99), so round to the currency's
22125
+ // standard precision rather than rendering them.
22120
22126
  discountAmount > 0 ? discountAmount : newCharges / 100 * percentOff,
22121
- selectedPlanCurrency
22127
+ {
22128
+ currency: selectedPlanCurrency,
22129
+ testSignificantDigits: false
22130
+ }
22122
22131
  ) }) })
22123
22132
  ]
22124
22133
  }
@@ -13998,10 +13998,13 @@ function getSubscriptionDiscount(discounts, subscriptionTotal, subscriptionCurre
13998
13998
  return {
13999
13999
  duration: discount.duration,
14000
14000
  durationInMonths: discount.durationInMonths ?? void 0,
14001
- discountedPrice: formatCurrency(
14002
- discountedTotal,
14003
- subscriptionCurrency ?? void 0
14004
- )
14001
+ // A percent discount can leave fractional minor units (e.g. 40% off
14002
+ // $19.99); format at the currency's standard precision so they round
14003
+ // away instead of rendering (e.g. "$11.994").
14004
+ discountedPrice: formatCurrency(discountedTotal, {
14005
+ currency: subscriptionCurrency ?? void 0,
14006
+ testSignificantDigits: false
14007
+ })
14005
14008
  };
14006
14009
  }
14007
14010
  function getBillingPreviewText({
@@ -14741,7 +14744,7 @@ var reducer = (state, action) => {
14741
14744
  // src/context/EmbedProvider.tsx
14742
14745
  var import_jsx_runtime3 = require("react/jsx-runtime");
14743
14746
  var getCustomHeaders = (sessionId) => ({
14744
- "X-Schematic-Components-Version": "2.22.1-rc.3",
14747
+ "X-Schematic-Components-Version": "2.22.2",
14745
14748
  "X-Schematic-Session-ID": sessionId
14746
14749
  });
14747
14750
  var normalizeCurrencyFilter = (filter) => {
@@ -22552,8 +22555,14 @@ var SubscriptionSidebar = (0, import_react44.forwardRef)(
22552
22555
  /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Box, { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Text, { children: formatCurrency(
22553
22556
  // Prefer the discount Stripe applied; derive from
22554
22557
  // `percentOff` only for API responses that predate it.
22558
+ // The derived value can carry fractional minor units
22559
+ // (e.g. 40% of $19.99), so round to the currency's
22560
+ // standard precision rather than rendering them.
22555
22561
  discountAmount > 0 ? discountAmount : newCharges / 100 * percentOff,
22556
- selectedPlanCurrency
22562
+ {
22563
+ currency: selectedPlanCurrency,
22564
+ testSignificantDigits: false
22565
+ }
22557
22566
  ) }) })
22558
22567
  ]
22559
22568
  }
@@ -13677,10 +13677,13 @@ function getSubscriptionDiscount(discounts, subscriptionTotal, subscriptionCurre
13677
13677
  return {
13678
13678
  duration: discount.duration,
13679
13679
  durationInMonths: discount.durationInMonths ?? void 0,
13680
- discountedPrice: formatCurrency(
13681
- discountedTotal,
13682
- subscriptionCurrency ?? void 0
13683
- )
13680
+ // A percent discount can leave fractional minor units (e.g. 40% off
13681
+ // $19.99); format at the currency's standard precision so they round
13682
+ // away instead of rendering (e.g. "$11.994").
13683
+ discountedPrice: formatCurrency(discountedTotal, {
13684
+ currency: subscriptionCurrency ?? void 0,
13685
+ testSignificantDigits: false
13686
+ })
13684
13687
  };
13685
13688
  }
13686
13689
  function getBillingPreviewText({
@@ -14419,7 +14422,7 @@ var reducer = (state, action) => {
14419
14422
  // src/context/EmbedProvider.tsx
14420
14423
  import { jsx as jsx2, jsxs } from "react/jsx-runtime";
14421
14424
  var getCustomHeaders = (sessionId) => ({
14422
- "X-Schematic-Components-Version": "2.22.1-rc.3",
14425
+ "X-Schematic-Components-Version": "2.22.2",
14423
14426
  "X-Schematic-Session-ID": sessionId
14424
14427
  });
14425
14428
  var normalizeCurrencyFilter = (filter2) => {
@@ -22242,8 +22245,14 @@ var SubscriptionSidebar = forwardRef7(
22242
22245
  /* @__PURE__ */ jsx41(Box, { children: /* @__PURE__ */ jsx41(Text, { children: formatCurrency(
22243
22246
  // Prefer the discount Stripe applied; derive from
22244
22247
  // `percentOff` only for API responses that predate it.
22248
+ // The derived value can carry fractional minor units
22249
+ // (e.g. 40% of $19.99), so round to the currency's
22250
+ // standard precision rather than rendering them.
22245
22251
  discountAmount > 0 ? discountAmount : newCharges / 100 * percentOff,
22246
- selectedPlanCurrency
22252
+ {
22253
+ currency: selectedPlanCurrency,
22254
+ testSignificantDigits: false
22255
+ }
22247
22256
  ) }) })
22248
22257
  ]
22249
22258
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@schematichq/schematic-components",
3
- "version": "2.22.1-rc.3",
3
+ "version": "2.22.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",
@@ -80,7 +80,7 @@
80
80
  "@types/react-dom": "^19.2.4",
81
81
  "@vitest/browser": "^4.1.10",
82
82
  "esbuild": "^0.28.1",
83
- "eslint": "^10.8.0",
83
+ "eslint": "^10.8.1",
84
84
  "eslint-import-resolver-typescript": "^4.4.5",
85
85
  "eslint-plugin-import-x": "^4.17.1",
86
86
  "eslint-plugin-react": "^7.37.5",