@schematichq/schematic-components 0.4.9 → 0.4.10

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.
@@ -12824,7 +12824,7 @@ var EmbedProvider = ({
12824
12824
  (0, import_react11.useEffect)(() => {
12825
12825
  if (accessToken) {
12826
12826
  const { headers = {} } = apiConfig ?? {};
12827
- headers["X-Schematic-Components-Version"] = "0.4.9";
12827
+ headers["X-Schematic-Components-Version"] = "0.4.10";
12828
12828
  headers["X-Schematic-Session-ID"] = sessionIdRef.current;
12829
12829
  const config = new Configuration({
12830
12830
  ...apiConfig,
@@ -18231,13 +18231,11 @@ function resolveDesignProps2(props) {
18231
18231
  }
18232
18232
  };
18233
18233
  }
18234
- function formatInvoices(invoices) {
18235
- return (invoices || []).filter(
18236
- ({ url, amountDue, amountPaid }) => url && (amountDue === 0 || amountPaid > 0)
18237
- ).sort((a2, b2) => a2.dueDate && b2.dueDate ? +b2.dueDate - +a2.dueDate : 1).map(({ amountDue, dueDate, url, currency }) => ({
18238
- ...dueDate && { date: toPrettyDate(dueDate) },
18234
+ function formatInvoices(invoices = []) {
18235
+ return invoices.filter(({ amountDue, amountPaid }) => amountDue === 0 || amountPaid > 0).sort((a2, b2) => a2.dueDate && b2.dueDate ? +b2.dueDate - +a2.dueDate : 1).map(({ amountDue, dueDate, url, currency }) => ({
18239
18236
  amount: formatCurrency(amountDue, currency),
18240
- url
18237
+ ...dueDate && { date: toPrettyDate(dueDate) },
18238
+ ...url && { url }
18241
18239
  }));
18242
18240
  }
18243
18241
  var InvoiceDate = ({ date, fontStyle, url }) => {
@@ -19468,7 +19466,7 @@ var PricingTable = (0, import_react37.forwardRef)(({ children, className, ...res
19468
19466
  $display: "grid",
19469
19467
  $gridTemplateColumns: "repeat(auto-fill, minmax(320px, 1fr))",
19470
19468
  $gap: "1rem",
19471
- children: plans.map((plan, index) => {
19469
+ children: plans.map((plan, index, self2) => {
19472
19470
  const isActivePlan = plan.current && data.company?.plan?.planPeriod === selectedPeriod;
19473
19471
  const count = entitlementCounts[plan.id];
19474
19472
  let isExpanded = false;
@@ -19574,6 +19572,18 @@ var PricingTable = (0, import_react37.forwardRef)(({ children, className, ...res
19574
19572
  $padding: `${0.75 * cardPadding}rem ${cardPadding}rem 0`,
19575
19573
  children: [
19576
19574
  props.plans.showEntitlements && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Flex, { $flexDirection: "column", $gap: "1rem", $flexGrow: "1", children: [
19575
+ props.plans.showInclusionText && index > 0 && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Box, { $marginBottom: "1.5rem", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
19576
+ Text,
19577
+ {
19578
+ $font: theme.typography.text.fontFamily,
19579
+ $size: theme.typography.text.fontSize,
19580
+ $weight: theme.typography.text.fontWeight,
19581
+ $color: theme.typography.text.color,
19582
+ children: t2("Everything in", {
19583
+ plan: self2[index - 1].name
19584
+ })
19585
+ }
19586
+ ) }),
19577
19587
  plan.entitlements.reduce((acc, entitlement) => {
19578
19588
  let price;
19579
19589
  let currency;
@@ -3145,11 +3145,11 @@ declare interface InvoiceResponseData {
3145
3145
  }
3146
3146
 
3147
3147
  export declare const Invoices: ForwardRefExoticComponent<ElementProps & RecursivePartial<DesignProps_2> & {
3148
- data?: ListInvoicesResponse["data"];
3148
+ data?: InvoiceResponseData[];
3149
3149
  } & HTMLAttributes<HTMLDivElement> & RefAttributes<HTMLDivElement | null>>;
3150
3150
 
3151
3151
  export declare type InvoicesProps = DesignProps_2 & {
3152
- data?: ListInvoicesResponse["data"];
3152
+ data?: InvoiceResponseData[];
3153
3153
  };
3154
3154
 
3155
3155
  declare type Json = any;
@@ -12776,7 +12776,7 @@ var EmbedProvider = ({
12776
12776
  useEffect2(() => {
12777
12777
  if (accessToken) {
12778
12778
  const { headers = {} } = apiConfig ?? {};
12779
- headers["X-Schematic-Components-Version"] = "0.4.9";
12779
+ headers["X-Schematic-Components-Version"] = "0.4.10";
12780
12780
  headers["X-Schematic-Session-ID"] = sessionIdRef.current;
12781
12781
  const config = new Configuration({
12782
12782
  ...apiConfig,
@@ -18197,13 +18197,11 @@ function resolveDesignProps2(props) {
18197
18197
  }
18198
18198
  };
18199
18199
  }
18200
- function formatInvoices(invoices) {
18201
- return (invoices || []).filter(
18202
- ({ url, amountDue, amountPaid }) => url && (amountDue === 0 || amountPaid > 0)
18203
- ).sort((a2, b2) => a2.dueDate && b2.dueDate ? +b2.dueDate - +a2.dueDate : 1).map(({ amountDue, dueDate, url, currency }) => ({
18204
- ...dueDate && { date: toPrettyDate(dueDate) },
18200
+ function formatInvoices(invoices = []) {
18201
+ return invoices.filter(({ amountDue, amountPaid }) => amountDue === 0 || amountPaid > 0).sort((a2, b2) => a2.dueDate && b2.dueDate ? +b2.dueDate - +a2.dueDate : 1).map(({ amountDue, dueDate, url, currency }) => ({
18205
18202
  amount: formatCurrency(amountDue, currency),
18206
- url
18203
+ ...dueDate && { date: toPrettyDate(dueDate) },
18204
+ ...url && { url }
18207
18205
  }));
18208
18206
  }
18209
18207
  var InvoiceDate = ({ date, fontStyle, url }) => {
@@ -19441,7 +19439,7 @@ var PricingTable = forwardRef12(({ children, className, ...rest }, ref) => {
19441
19439
  $display: "grid",
19442
19440
  $gridTemplateColumns: "repeat(auto-fill, minmax(320px, 1fr))",
19443
19441
  $gap: "1rem",
19444
- children: plans.map((plan, index) => {
19442
+ children: plans.map((plan, index, self2) => {
19445
19443
  const isActivePlan = plan.current && data.company?.plan?.planPeriod === selectedPeriod;
19446
19444
  const count = entitlementCounts[plan.id];
19447
19445
  let isExpanded = false;
@@ -19547,6 +19545,18 @@ var PricingTable = forwardRef12(({ children, className, ...rest }, ref) => {
19547
19545
  $padding: `${0.75 * cardPadding}rem ${cardPadding}rem 0`,
19548
19546
  children: [
19549
19547
  props.plans.showEntitlements && /* @__PURE__ */ jsxs26(Flex, { $flexDirection: "column", $gap: "1rem", $flexGrow: "1", children: [
19548
+ props.plans.showInclusionText && index > 0 && /* @__PURE__ */ jsx32(Box, { $marginBottom: "1.5rem", children: /* @__PURE__ */ jsx32(
19549
+ Text,
19550
+ {
19551
+ $font: theme.typography.text.fontFamily,
19552
+ $size: theme.typography.text.fontSize,
19553
+ $weight: theme.typography.text.fontWeight,
19554
+ $color: theme.typography.text.color,
19555
+ children: t2("Everything in", {
19556
+ plan: self2[index - 1].name
19557
+ })
19558
+ }
19559
+ ) }),
19550
19560
  plan.entitlements.reduce((acc, entitlement) => {
19551
19561
  let price;
19552
19562
  let currency;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@schematichq/schematic-components",
3
- "version": "0.4.9",
3
+ "version": "0.4.10",
4
4
  "main": "dist/schematic-components.cjs.js",
5
5
  "module": "dist/schematic-components.esm.js",
6
6
  "types": "dist/schematic-components.d.ts",
@@ -30,7 +30,7 @@
30
30
  "tsc": "npx tsc"
31
31
  },
32
32
  "dependencies": {
33
- "@stripe/stripe-js": "^5.8.0",
33
+ "@stripe/stripe-js": "^5.9.2",
34
34
  "classnames": "^2.5.1",
35
35
  "i18next": "^24.2.2",
36
36
  "lodash": "^4.17.21",