@schematichq/schematic-components 0.3.5 → 0.3.6

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.
@@ -7643,7 +7643,8 @@ function InvoiceResponseDataFromJSONTyped(json, ignoreDiscriminator) {
7643
7643
  paymentMethodExternalId: json["payment_method_external_id"] == null ? void 0 : json["payment_method_external_id"],
7644
7644
  subscriptionExternalId: json["subscription_external_id"] == null ? void 0 : json["subscription_external_id"],
7645
7645
  subtotal: json["subtotal"],
7646
- updatedAt: new Date(json["updated_at"])
7646
+ updatedAt: new Date(json["updated_at"]),
7647
+ url: json["url"] == null ? void 0 : json["url"]
7647
7648
  };
7648
7649
  }
7649
7650
 
@@ -7656,6 +7657,11 @@ function PaymentMethodResponseDataFromJSONTyped(json, ignoreDiscriminator) {
7656
7657
  return json;
7657
7658
  }
7658
7659
  return {
7660
+ accountLast4: json["account_last4"] == null ? void 0 : json["account_last4"],
7661
+ accountName: json["account_name"] == null ? void 0 : json["account_name"],
7662
+ bankName: json["bank_name"] == null ? void 0 : json["bank_name"],
7663
+ billingEmail: json["billing_email"] == null ? void 0 : json["billing_email"],
7664
+ billingName: json["billing_name"] == null ? void 0 : json["billing_name"],
7659
7665
  cardBrand: json["card_brand"] == null ? void 0 : json["card_brand"],
7660
7666
  cardExpMonth: json["card_exp_month"] == null ? void 0 : json["card_exp_month"],
7661
7667
  cardExpYear: json["card_exp_year"] == null ? void 0 : json["card_exp_year"],
@@ -8709,7 +8715,7 @@ var EmbedProvider = ({
8709
8715
  (0, import_react2.useEffect)(() => {
8710
8716
  if (accessToken) {
8711
8717
  const { headers = {} } = apiConfig ?? {};
8712
- headers["X-Schematic-Components-Version"] = "0.3.5";
8718
+ headers["X-Schematic-Components-Version"] = "0.3.6";
8713
8719
  headers["X-Schematic-Session-ID"] = sessionIdRef.current;
8714
8720
  const config = new Configuration({
8715
8721
  ...apiConfig,
@@ -11836,11 +11842,29 @@ function resolveDesignProps6(props) {
11836
11842
  };
11837
11843
  }
11838
11844
  function formatInvoices(invoices) {
11839
- return (invoices || []).map(({ amountDue, dueDate }) => ({
11845
+ return (invoices || []).map(({ amountDue, dueDate, url }) => ({
11840
11846
  ...dueDate && { date: toPrettyDate(dueDate) },
11841
- amount: formatCurrency(amountDue)
11847
+ amount: formatCurrency(amountDue),
11848
+ url
11842
11849
  }));
11843
11850
  }
11851
+ var InvoiceDate = ({ date, fontStyle, url }) => {
11852
+ const theme = nt();
11853
+ const dateText = /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
11854
+ Text,
11855
+ {
11856
+ $font: theme.typography[fontStyle].fontFamily,
11857
+ $size: theme.typography[fontStyle].fontSize,
11858
+ $weight: theme.typography[fontStyle].fontWeight,
11859
+ $color: theme.typography[fontStyle].color,
11860
+ children: date
11861
+ }
11862
+ );
11863
+ if (url) {
11864
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("a", { href: url, target: "_blank", children: dateText });
11865
+ }
11866
+ return dateText;
11867
+ };
11844
11868
  var Invoices = (0, import_react20.forwardRef)(({ className, ...rest }, ref) => {
11845
11869
  const props = resolveDesignProps6(rest);
11846
11870
  const theme = nt();
@@ -11865,16 +11889,14 @@ var Invoices = (0, import_react20.forwardRef)(({ className, ...rest }, ref) => {
11865
11889
  /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Flex, { $flexDirection: "column", $gap: "0.5rem", children: invoices.slice(
11866
11890
  0,
11867
11891
  props.limit.isVisible && props.limit.number || invoices.length
11868
- ).map(({ date, amount }, index) => {
11892
+ ).map(({ date, amount, url }, index) => {
11869
11893
  return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Flex, { $justifyContent: "space-between", children: [
11870
- props.date.isVisible && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
11871
- Text,
11894
+ props.date.isVisible && date && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
11895
+ InvoiceDate,
11872
11896
  {
11873
- $font: theme.typography[props.date.fontStyle].fontFamily,
11874
- $size: theme.typography[props.date.fontStyle].fontSize,
11875
- $weight: theme.typography[props.date.fontStyle].fontWeight,
11876
- $color: theme.typography[props.date.fontStyle].color,
11877
- children: date
11897
+ date,
11898
+ fontStyle: props.date.fontStyle,
11899
+ url
11878
11900
  }
11879
11901
  ),
11880
11902
  props.amount.isVisible && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
@@ -2158,6 +2158,12 @@ declare interface InvoiceResponseData {
2158
2158
  * @memberof InvoiceResponseData
2159
2159
  */
2160
2160
  updatedAt: Date;
2161
+ /**
2162
+ *
2163
+ * @type {string}
2164
+ * @memberof InvoiceResponseData
2165
+ */
2166
+ url?: string | null;
2161
2167
  }
2162
2168
 
2163
2169
  export declare const Invoices: ForwardRefExoticComponent<ElementProps & DesignProps_6 & {
@@ -2300,6 +2306,36 @@ export declare type PaymentMethodProps = DesignProps_5;
2300
2306
  * @interface PaymentMethodResponseData
2301
2307
  */
2302
2308
  declare interface PaymentMethodResponseData {
2309
+ /**
2310
+ *
2311
+ * @type {string}
2312
+ * @memberof PaymentMethodResponseData
2313
+ */
2314
+ accountLast4?: string | null;
2315
+ /**
2316
+ *
2317
+ * @type {string}
2318
+ * @memberof PaymentMethodResponseData
2319
+ */
2320
+ accountName?: string | null;
2321
+ /**
2322
+ *
2323
+ * @type {string}
2324
+ * @memberof PaymentMethodResponseData
2325
+ */
2326
+ bankName?: string | null;
2327
+ /**
2328
+ *
2329
+ * @type {string}
2330
+ * @memberof PaymentMethodResponseData
2331
+ */
2332
+ billingEmail?: string | null;
2333
+ /**
2334
+ *
2335
+ * @type {string}
2336
+ * @memberof PaymentMethodResponseData
2337
+ */
2338
+ billingName?: string | null;
2303
2339
  /**
2304
2340
  *
2305
2341
  * @type {string}
@@ -7607,7 +7607,8 @@ function InvoiceResponseDataFromJSONTyped(json, ignoreDiscriminator) {
7607
7607
  paymentMethodExternalId: json["payment_method_external_id"] == null ? void 0 : json["payment_method_external_id"],
7608
7608
  subscriptionExternalId: json["subscription_external_id"] == null ? void 0 : json["subscription_external_id"],
7609
7609
  subtotal: json["subtotal"],
7610
- updatedAt: new Date(json["updated_at"])
7610
+ updatedAt: new Date(json["updated_at"]),
7611
+ url: json["url"] == null ? void 0 : json["url"]
7611
7612
  };
7612
7613
  }
7613
7614
 
@@ -7620,6 +7621,11 @@ function PaymentMethodResponseDataFromJSONTyped(json, ignoreDiscriminator) {
7620
7621
  return json;
7621
7622
  }
7622
7623
  return {
7624
+ accountLast4: json["account_last4"] == null ? void 0 : json["account_last4"],
7625
+ accountName: json["account_name"] == null ? void 0 : json["account_name"],
7626
+ bankName: json["bank_name"] == null ? void 0 : json["bank_name"],
7627
+ billingEmail: json["billing_email"] == null ? void 0 : json["billing_email"],
7628
+ billingName: json["billing_name"] == null ? void 0 : json["billing_name"],
7623
7629
  cardBrand: json["card_brand"] == null ? void 0 : json["card_brand"],
7624
7630
  cardExpMonth: json["card_exp_month"] == null ? void 0 : json["card_exp_month"],
7625
7631
  cardExpYear: json["card_exp_year"] == null ? void 0 : json["card_exp_year"],
@@ -8673,7 +8679,7 @@ var EmbedProvider = ({
8673
8679
  useEffect(() => {
8674
8680
  if (accessToken) {
8675
8681
  const { headers = {} } = apiConfig ?? {};
8676
- headers["X-Schematic-Components-Version"] = "0.3.5";
8682
+ headers["X-Schematic-Components-Version"] = "0.3.6";
8677
8683
  headers["X-Schematic-Session-ID"] = sessionIdRef.current;
8678
8684
  const config = new Configuration({
8679
8685
  ...apiConfig,
@@ -11800,11 +11806,29 @@ function resolveDesignProps6(props) {
11800
11806
  };
11801
11807
  }
11802
11808
  function formatInvoices(invoices) {
11803
- return (invoices || []).map(({ amountDue, dueDate }) => ({
11809
+ return (invoices || []).map(({ amountDue, dueDate, url }) => ({
11804
11810
  ...dueDate && { date: toPrettyDate(dueDate) },
11805
- amount: formatCurrency(amountDue)
11811
+ amount: formatCurrency(amountDue),
11812
+ url
11806
11813
  }));
11807
11814
  }
11815
+ var InvoiceDate = ({ date, fontStyle, url }) => {
11816
+ const theme = nt();
11817
+ const dateText = /* @__PURE__ */ jsx21(
11818
+ Text,
11819
+ {
11820
+ $font: theme.typography[fontStyle].fontFamily,
11821
+ $size: theme.typography[fontStyle].fontSize,
11822
+ $weight: theme.typography[fontStyle].fontWeight,
11823
+ $color: theme.typography[fontStyle].color,
11824
+ children: date
11825
+ }
11826
+ );
11827
+ if (url) {
11828
+ /* @__PURE__ */ jsx21("a", { href: url, target: "_blank", children: dateText });
11829
+ }
11830
+ return dateText;
11831
+ };
11808
11832
  var Invoices = forwardRef10(({ className, ...rest }, ref) => {
11809
11833
  const props = resolveDesignProps6(rest);
11810
11834
  const theme = nt();
@@ -11829,16 +11853,14 @@ var Invoices = forwardRef10(({ className, ...rest }, ref) => {
11829
11853
  /* @__PURE__ */ jsx21(Flex, { $flexDirection: "column", $gap: "0.5rem", children: invoices.slice(
11830
11854
  0,
11831
11855
  props.limit.isVisible && props.limit.number || invoices.length
11832
- ).map(({ date, amount }, index) => {
11856
+ ).map(({ date, amount, url }, index) => {
11833
11857
  return /* @__PURE__ */ jsxs14(Flex, { $justifyContent: "space-between", children: [
11834
- props.date.isVisible && /* @__PURE__ */ jsx21(
11835
- Text,
11858
+ props.date.isVisible && date && /* @__PURE__ */ jsx21(
11859
+ InvoiceDate,
11836
11860
  {
11837
- $font: theme.typography[props.date.fontStyle].fontFamily,
11838
- $size: theme.typography[props.date.fontStyle].fontSize,
11839
- $weight: theme.typography[props.date.fontStyle].fontWeight,
11840
- $color: theme.typography[props.date.fontStyle].color,
11841
- children: date
11861
+ date,
11862
+ fontStyle: props.date.fontStyle,
11863
+ url
11842
11864
  }
11843
11865
  ),
11844
11866
  props.amount.isVisible && /* @__PURE__ */ jsx21(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@schematichq/schematic-components",
3
- "version": "0.3.5",
3
+ "version": "0.3.6",
4
4
  "main": "dist/schematic-components.cjs.js",
5
5
  "module": "dist/schematic-components.esm.js",
6
6
  "types": "dist/schematic-components.d.ts",