@stigg/react-sdk 8.10.0 → 8.10.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.
- package/dist/{CreditUsageChart-QOD7VBEC.cjs.js → CreditUsageChart-K3F5B2BG.cjs.js} +20 -20
- package/dist/{CreditUsageChart-E5VZBECB.esm.js → CreditUsageChart-PHUNXK2H.esm.js} +6 -6
- package/dist/{chunk-RC4RDDOF.cjs.js → chunk-2FMVMEMY.cjs.js} +6 -6
- package/dist/{chunk-YEUWNJPT.esm.js → chunk-IAEVV3CC.esm.js} +5 -5
- package/dist/stigg-sdk.cjs.js +170 -170
- package/dist/stigg-sdk.esm.js +2 -2
- package/package.json +3 -4
package/dist/stigg-sdk.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {e,f,i,j,a,g,b,h,c,p,w,u,v,d,x,y,z,B,G,A,H as H$1,C,I,q,r,K,o,l,m,n,k}from'./chunk-
|
|
1
|
+
import {e,f,i,j,a,g,b,h,c,p,w,u,v,d,x,y,z,B,G,A,H as H$1,C,I,q,r,K,o,l,m,n,k}from'./chunk-IAEVV3CC.esm.js';export{s as StiggContext,t as StiggProvider,D as useActiveSubscriptions,x as useBooleanEntitlement,A as useCreditEntitlement,L as useCreditUsage,F as useCustomerPortal,B as useEnumEntitlement,z as useMeteredEntitlement,y as useNumericEntitlement,E as usePaywall,u as useStiggContext}from'./chunk-IAEVV3CC.esm.js';import {BillingModel,PaymentCollection,SubscriptionStatus,PricingType,BillingPeriod,SubscriptionScheduleType,ThresholdType,DiscountType,DiscountDurationType,Currency,BillingVendorIdentifier,CreditGrantType,WidgetType,BillingCadence,FontWeight,MeterType,EntitlementResetPeriod,TiersMode,Alignment,CreditCadence,SubscriptionProrationBehavior,SubscriptionBillingCycleAnchor}from'@stigg/js-client-sdk';export*from'@stigg/js-client-sdk';import hi,{forwardRef,lazy,useContext,useMemo,useState,useEffect,Suspense,useCallback,useRef,createElement}from'react';import Wu from'classnames';import Re from'@mui/material/Grid/index.js';import Pc from'lodash/compact.js';import {NumericFormat,numericFormatter}from'react-number-format';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import Za from'lodash/isFunction.js';import Fo from'lodash/isNil.js';import iu from'react-spinners/ClipLoader.js';import {css,useTheme}from'@emotion/react';import Bo from'dayjs';import Km from'dayjs/plugin/utc.js';import qm from'dayjs/plugin/relativeTime.js';import Jm from'dayjs/plugin/advancedFormat.js';import ou from'lodash/sum.js';import yu from'currency-symbol-map';import wu from'@mui/material/InputAdornment/index.js';import Pu,{buttonClasses}from'@mui/material/Button/index.js';import Su from'@mui/material/TextField/index.js';import Nl from'@mui/material/Divider/index.js';import Bu from'@mui/material/OutlinedInput/index.js';import Au from'@mui/material/Select/index.js';import Iu from'@mui/material/MenuItem/index.js';import Fu from'lodash/map.js';import ke from'@mui/material/Box/index.js';import hg from'react-switch';import Eg from'lodash/countBy.js';import vg from'lodash/uniq.js';import sc from'lodash/sortBy.js';import Ug from'lodash/merge.js';import Xe from'react-loading-skeleton';import Jg from'lodash/flatMap.js';import Ks from'@mui/material/Tab/index.js';import Xg from'lodash/isEmpty.js';import nf from'@mui/material/Tabs/index.js';import cf from'@mui/material/useMediaQuery/index.js';import {ExternalLink,ChevronRight,Info,Minus,Plus,ArrowDown}from'react-feather';import Wf from'@mui/material/Link/index.js';import $f,{tooltipClasses}from'@mui/material/Tooltip/index.js';import $l from'lodash/keyBy.js';import Ni from'color';import qf,{linearProgressClasses}from'@mui/material/LinearProgress/index.js';import fy from'lodash/padStart.js';import Ql from'lodash/isUndefined.js';import {BillingModel as BillingModel$1,BillingPeriod as BillingPeriod$1}from'@stigg/api-client-js/src/generated/sdk';import jn from'lodash/lowerCase.js';import Ay from'lodash/range.js';import {produce}from'immer';import Uy from'lodash/cloneDeep.js';import _y from'lodash/remove.js';import {Elements,useStripe,useElements,AddressElement,PaymentElement}from'@stripe/react-stripe-js';import $h from'@mui/material/StepIcon/index.js';import Zx from'lodash/partition.js';import Jh from'@mui/material/CircularProgress/index.js';import qx from'@mui/material/Paper/index.js';import Jx from'@mui/material/Alert/index.js';import rC from'@mui/material/Checkbox/index.js';import nC from'@mui/material/FormControlLabel/index.js';import iC from'lodash/isString.js';import YP from'@mui/material/Autocomplete/index.js';import QP from'@mui/material/Collapse/index.js';import {AL,AD,AO,AR,AM,AW,AU,AT,AZ,BS as BS$1,BH,BD,BB,BY,BE,BJ,BO,BA,BR,BG,BF,KH,CM,CA,CV,CL,CN,CO,CD,CR,HR,CY,CZ,DK,DO,EC,EG,SV,EE,ET,EU,FI,FR,GE,DE,GR,GN,HK,HU,IS as IS$1,IN,ID,IE,IL,IT,JP as JP$1,KZ,KE,KG,LA,LV,LI,LT,LU,MY,MT,MR,MX,MD,ME,MA,NP,NL,NZ,NG,MK,NO,OM,PE,PH,PL,PT,RO,RU,SA,SN,RS as RS$1,SG,SK,SI,ZA,KR,ES as ES$1,SR,SE,CH,TW,TJ,TZ,TH,TR,UG,UA,AE,GB,US,UY,UZ,VE,VN,ZM,ZW}from'country-flag-icons/react/3x2';import fd from'lodash/startCase.js';import yd from'lodash/upperCase.js';import mx from'react-lottie';import Vx from'@mui/material/IconButton/index.js';import {styled}from'@mui/material/styles/index.js';import Sb from'@mui/material/Radio/index.js';import vb from'@mui/material/Chip/index.js';import {TableContainer,Table,Divider,TableCell,TableRow,TablePagination,TableBody,TableHead}from'@mui/material';import DS from'@mui/material/TableRow/index.js';function So(e,t,o){let r=o?` ${o}`:"";return (!e||e===1)&&t?`Up to ${t}${r}`:e&&e>1&&t?`${e}-${t}${r}`:e&&e>1?`Minimum ${e}${r}`:""}function se(e,t="en-US"){if(e==null)return;let o={thousandSeparator:t==="en-US"?",":" ",decimalSeparator:".",decimalScale:0,fixedDecimalScale:true};return numericFormatter(String(Math.round(e)),o)}function pn(e,t="en-US"){let o={thousandSeparator:t==="en-US"?",":" ",decimalSeparator:".",decimalScale:2,fixedDecimalScale:true};return numericFormatter(String(e),o)}function Gt(e,t=1){if(e<1e6)return se(e)||"0";let o=[{value:1e12,suffix:"T"},{value:1e9,suffix:"B"},{value:1e6,suffix:"M"}];for(let{value:r,suffix:n}of o)if(e>=r){let a=(e/r).toFixed(t);return a.includes(".")&&(a=a.replace(/\.0+$/,"").replace(/(\.\d*[1-9])0+$/,"$1")),`${a}${n}`}return se(e)||"0"}var Am=e(f)`
|
|
2
2
|
margin: 0;
|
|
3
3
|
`,Im=e.div`
|
|
4
4
|
display: flex;
|
|
@@ -885,7 +885,7 @@ import {e,f,i,j,a,g,b,h,c,p,w,u,v,d,x,y,z,B,G,A,H as H$1,C,I,q,r,K,o,l,m,n,k}fro
|
|
|
885
885
|
border-radius: 8px;
|
|
886
886
|
border: 1px solid ${({theme:e})=>{var t,o;return (o=(t=e.stigg)==null?void 0:t.palette)==null?void 0:o.outlinedBorder}};
|
|
887
887
|
background-color: ${({theme:e})=>{var t,o;return (o=(t=e==null?void 0:e.stigg)==null?void 0:t.palette)==null?void 0:o.backgroundPaper}};
|
|
888
|
-
`;function Gp({currencyId:e,localization:t,decimalPlaces:o,showUnits:r=true,onAddCredits:n}){let i=he(ee),a$1=u({optional:true}),l=a$1==null?void 0:a$1.theme,{title:s,addCredits:c,formatResetPeriod:u$1}=a(a({},G),t),f$1=A({currencyId:e}),y=jsx(bS,{className:"stigg-credit-balance-container",children:jsxs(SS,{className:"stigg-credit-balance-card",children:[jsxs(Rt,{children:[jsx(f,{variant:"h6",color:"primary",className:"stigg-credit-balance-title",children:s}),n&&!f$1.isFallback&&jsxs(Ut,{type:"button",onClick:()=>n(f$1),className:"stigg-credit-balance-add-credits-button",children:[jsx(Hr,{className:"stigg-credit-balance-add-credits-icon"}),c]})]}),jsx($p,{entitlement:f$1,decimalPlaces:o,showUnits:r,formatResetPeriod:u$1})]})});return i?y:jsx(w,{componentTheme:l,children:y})}var wS=lazy(()=>import('./CreditUsageChart-
|
|
888
|
+
`;function Gp({currencyId:e,localization:t,decimalPlaces:o,showUnits:r=true,onAddCredits:n}){let i=he(ee),a$1=u({optional:true}),l=a$1==null?void 0:a$1.theme,{title:s,addCredits:c,formatResetPeriod:u$1}=a(a({},G),t),f$1=A({currencyId:e}),y=jsx(bS,{className:"stigg-credit-balance-container",children:jsxs(SS,{className:"stigg-credit-balance-card",children:[jsxs(Rt,{children:[jsx(f,{variant:"h6",color:"primary",className:"stigg-credit-balance-title",children:s}),n&&!f$1.isFallback&&jsxs(Ut,{type:"button",onClick:()=>n(f$1),className:"stigg-credit-balance-add-credits-button",children:[jsx(Hr,{className:"stigg-credit-balance-add-credits-icon"}),c]})]}),jsx($p,{entitlement:f$1,decimalPlaces:o,showUnits:r,formatResetPeriod:u$1})]})});return i?y:jsx(w,{componentTheme:l,children:y})}var wS=lazy(()=>import('./CreditUsageChart-PHUNXK2H.esm.js').then(e=>({default:e.CreditUsageChart})));function zp(e){return jsx(Suspense,{fallback:null,children:jsx(wS,a({},e))})}var BS=(e,t,o)=>o==="primary"?t.palette.primary:e>=100?t.palette.progress.high:e>=75?t.palette.progress.medium:t.palette.progress.low,AS=e.div`
|
|
889
889
|
width: 100%;
|
|
890
890
|
height: 8px;
|
|
891
891
|
background-color: ${({theme:e})=>e.stigg.palette.progress.background};
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "8.10.
|
|
2
|
+
"version": "8.10.2",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"main": "dist/stigg-sdk.cjs.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
@@ -62,10 +62,8 @@
|
|
|
62
62
|
"@size-limit/preset-small-lib": "^7.0.8",
|
|
63
63
|
"@storybook/addon-docs": "^9.1.5",
|
|
64
64
|
"@storybook/addon-links": "9.1.5",
|
|
65
|
-
"@storybook/blocks": "^8.6.14",
|
|
66
|
-
"@storybook/react": "9.1.5",
|
|
67
65
|
"@storybook/react-vite": "^9.1.5",
|
|
68
|
-
"@
|
|
66
|
+
"@testing-library/dom": "^10.4.0",
|
|
69
67
|
"@testing-library/react": "^16.3.2",
|
|
70
68
|
"@types/color": "^3.0.3",
|
|
71
69
|
"@types/lodash": "^4.17.20",
|
|
@@ -79,6 +77,7 @@
|
|
|
79
77
|
"eslint-plugin-react-refresh": "^0.4.20",
|
|
80
78
|
"jiti": "^2.6.1",
|
|
81
79
|
"jsdom": "^26.1.0",
|
|
80
|
+
"msw": "^2.12.10",
|
|
82
81
|
"postcss": "^8.4.24",
|
|
83
82
|
"react": "^18.0.0",
|
|
84
83
|
"react-dom": "^18.0.0",
|