@cohostvip/cohost-react 0.1.15 → 0.1.17

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.
@@ -1 +1 @@
1
- {"version":3,"file":"CohostEventContext.d.ts","sourceRoot":"","sources":["../../src/context/CohostEventContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EACH,YAAY,EACZ,MAAM,EACT,MAAM,wBAAwB,CAAC;AAGhC,MAAM,MAAM,wBAAwB,GAAG;IACnC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC7B,GAAG,CACM;IACE,0FAA0F;IAC1F,KAAK,EAAE,YAAY,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB,GACC;IACE,gEAAgE;IAChE,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;CACnB,CACJ,CAAC;AAEN,MAAM,MAAM,sBAAsB,GAAG;IACjC,KAAK,EAAE,SAAS,GAAG,SAAS,GAAG,iBAAiB,GAAG,OAAO,CAAC;IAE3D;;OAEG;IACH,KAAK,CAAC,EAAE,YAAY,CAAC;IAErB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;CAC7B,CAAA;AAID,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAwElE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,QAAO,sBAIjC,CAAC"}
1
+ {"version":3,"file":"CohostEventContext.d.ts","sourceRoot":"","sources":["../../src/context/CohostEventContext.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EACH,YAAY,EACZ,MAAM,EACT,MAAM,wBAAwB,CAAC;AAGhC,MAAM,MAAM,wBAAwB,GAAG;IACnC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC7B,GAAG,CACM;IACE,0FAA0F;IAC1F,KAAK,EAAE,YAAY,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB,GACC;IACE,gEAAgE;IAChE,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;CACnB,CACJ,CAAC;AAEN,MAAM,MAAM,sBAAsB,GAAG;IACjC,KAAK,EAAE,SAAS,GAAG,SAAS,GAAG,iBAAiB,GAAG,OAAO,CAAC;IAE3D;;OAEG;IACH,KAAK,CAAC,EAAE,YAAY,CAAC;IAErB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;CAC7B,CAAA;AAID,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAwElE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,QAAO,sBAIjC,CAAC"}
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { jsx as _jsx } from "react/jsx-runtime";
2
3
  import * as React from 'react';
3
4
  import { createContext, useContext } from 'react';
package/dist/index.d.ts CHANGED
@@ -5,4 +5,5 @@ export { PaymentElementProvider, usePaymentElement } from './context/PaymentElem
5
5
  export { CohostStartCheckoutProvider } from './provider/CohostStartCheckoutProvider';
6
6
  export { CreditCardInformation } from './lib/tokenizers/types';
7
7
  export { useCohost } from './hooks/useCohost';
8
+ export { formatCurrency } from './lib/utils';
8
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACnH,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnF,OAAO,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACnF,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAC5F,OAAO,EAAE,2BAA2B,EAAE,MAAM,wCAAwC,CAAC;AACrF,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACnH,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnF,OAAO,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACnF,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAC5F,OAAO,EAAE,2BAA2B,EAAE,MAAM,wCAAwC,CAAC;AACrF,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC"}
package/dist/index.js CHANGED
@@ -4,3 +4,4 @@ export { CohostProvider } from './context/CohostContext';
4
4
  export { PaymentElementProvider, usePaymentElement } from './context/PaymentElementContext';
5
5
  export { CohostStartCheckoutProvider } from './provider/CohostStartCheckoutProvider';
6
6
  export { useCohost } from './hooks/useCohost';
7
+ export { formatCurrency } from './lib/utils';
@@ -0,0 +1,2 @@
1
+ export declare const formatCurrency: (value: string) => string;
2
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/lib/utils.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,GAAI,OAAO,MAAM,KAAG,MAW9C,CAAA"}
@@ -0,0 +1,10 @@
1
+ export const formatCurrency = (value) => {
2
+ const [currency, amount] = value.split(',');
3
+ const formatter = new Intl.NumberFormat('en-US', {
4
+ style: 'currency',
5
+ currency: currency.trim(),
6
+ minimumFractionDigits: 0,
7
+ maximumFractionDigits: 2,
8
+ });
9
+ return formatter.format(parseFloat(amount) / 100);
10
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cohostvip/cohost-react",
3
- "version": "0.1.15",
3
+ "version": "0.1.17",
4
4
  "description": "React bindings for the Cohost API",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -27,7 +27,7 @@
27
27
  "react-dom": "^18.0.0 || ^19.0.0"
28
28
  },
29
29
  "dependencies": {
30
- "@cohostvip/cohost-node": "^0.1.15"
30
+ "@cohostvip/cohost-node": "^0.1.16"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@testing-library/jest-dom": "6.6.3",
@@ -64,4 +64,4 @@
64
64
  "sdk",
65
65
  "typescript"
66
66
  ]
67
- }
67
+ }