@stigg/react-sdk 7.27.0 → 7.28.0
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-P3BWIUOZ.cjs.js → CreditUsageChart-767SG75X.cjs.js} +19 -19
- package/dist/{CreditUsageChart-TQR4YFYZ.esm.js → CreditUsageChart-URN6IPYD.esm.js} +1 -1
- package/dist/{chunk-4YPINBLC.esm.js → chunk-B5FDE2OH.esm.js} +1 -1
- package/dist/{chunk-5K62MKBQ.cjs.js → chunk-LW3LLUI6.cjs.js} +1 -1
- package/dist/stigg-sdk.cjs.js +170 -170
- package/dist/stigg-sdk.esm.js +2 -2
- package/package.json +2 -2
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,A,B,F,G,H as H$1,q,r,k,J,o,l,m,n}from'./chunk-
|
|
1
|
+
import {e,f,i,j,a,g,b,h,c,p,w,u,v,d,x,y,z,A,B,F,G,H as H$1,q,r,k,J,o,l,m,n}from'./chunk-B5FDE2OH.esm.js';export{s as StiggContext,t as StiggProvider,C as useActiveSubscriptions,x as useBooleanEntitlement,K as useCreditUsage,E as useCustomerPortal,A as useEnumEntitlement,z as useMeteredEntitlement,y as useNumericEntitlement,D as usePaywall,u as useStiggContext}from'./chunk-B5FDE2OH.esm.js';import {BillingModel,PaymentCollection,SubscriptionStatus,PricingType,BillingPeriod,SubscriptionScheduleType,ThresholdType,DiscountType,DiscountDurationType,Currency,BillingVendorIdentifier,CreditGrantType,WidgetType,FontWeight,MeterType,EntitlementResetPeriod,TiersMode,Alignment}from'@stigg/js-client-sdk';export*from'@stigg/js-client-sdk';import ii,{forwardRef,lazy,useContext,useMemo,useState,useEffect,useCallback,Suspense,useRef,createElement}from'react';import Pu from'classnames';import Me from'@mui/material/Grid/index.js';import ic from'lodash/compact.js';import {NumericFormat,numericFormatter}from'react-number-format';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import Na from'lodash/isFunction.js';import Rm from'react-spinners/ClipLoader.js';import {css,useTheme}from'@emotion/react';import ho from'dayjs';import Bm from'dayjs/plugin/utc.js';import Am from'dayjs/plugin/relativeTime.js';import Im from'dayjs/plugin/advancedFormat.js';import xo from'lodash/isNil.js';import Nm from'lodash/sum.js';import Zm from'currency-symbol-map';import jm from'@mui/material/InputAdornment/index.js';import Ym,{buttonClasses}from'@mui/material/Button/index.js';import qm from'@mui/material/TextField/index.js';import Cl from'@mui/material/Divider/index.js';import eu from'@mui/material/OutlinedInput/index.js';import tu from'@mui/material/Select/index.js';import ou from'@mui/material/MenuItem/index.js';import ru from'lodash/map.js';import ke from'@mui/material/Box/index.js';import Wu from'react-switch';import ng from'lodash/countBy.js';import ig from'lodash/uniq.js';import Yl from'lodash/sortBy.js';import dg from'lodash/merge.js';import Qe from'react-loading-skeleton';import wg from'lodash/flatMap.js';import Rs from'@mui/material/Tab/index.js';import Bg from'lodash/isEmpty.js';import Lg from'@mui/material/Tabs/index.js';import Ug from'@mui/material/useMediaQuery/index.js';import {ExternalLink,ChevronRight,Info,Minus,Plus,ArrowDown}from'react-feather';import Pf from'@mui/material/Link/index.js';import uf,{tooltipClasses}from'@mui/material/Tooltip/index.js';import wl from'lodash/keyBy.js';import bi from'color';import kf,{linearProgressClasses}from'@mui/material/LinearProgress/index.js';import Hf from'lodash/padStart.js';import Ml from'lodash/isUndefined.js';import {BillingModel as BillingModel$1,BillingPeriod as BillingPeriod$1}from'@stigg/api-client-js/src/generated/sdk.js';import Vn from'lodash/lowerCase.js';import ty from'lodash/range.js';import {produce}from'immer';import dy from'lodash/cloneDeep.js';import py from'lodash/remove.js';import {Elements,useStripe,useElements,AddressElement,PaymentElement}from'@stripe/react-stripe-js';import ch from'@mui/material/StepIcon/index.js';import hx from'lodash/partition.js';import bh from'@mui/material/CircularProgress/index.js';import bx from'@mui/material/Paper/index.js';import Sx from'@mui/material/Alert/index.js';import Ah from'@mui/material/Checkbox/index.js';import Ih from'@mui/material/FormControlLabel/index.js';import Fh from'lodash/isString.js';import hP from'@mui/material/Autocomplete/index.js';import CP 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,SG,SK,SI,ZA,KR,ES,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 ed from'lodash/startCase.js';import td from'lodash/upperCase.js';import UP from'react-lottie';import mx from'@mui/material/IconButton/index.js';import {styled}from'@mui/material/styles/index.js';import Yx from'@mui/material/Radio/index.js';import tb from'@mui/material/Chip/index.js';import RS$1 from'lodash/capitalize.js';import {TableContainer,Table,Divider,TableCell,TableRow,TablePagination,TableBody,TableHead}from'@mui/material';import mS from'@mui/material/TableRow/index.js';function go(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 ie(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 jr(e,t="en-US"){let o={thousandSeparator:t==="en-US"?",":" ",decimalSeparator:".",decimalScale:2,fixedDecimalScale:true};return numericFormatter(String(e),o)}function Dt(e,t=1){if(e<1e6)return ie(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 s=(e/r).toFixed(t);return s.includes(".")&&(s=s.replace(/\.0+$/,"").replace(/(\.\d*[1-9])0+$/,"$1")),`${s}${n}`}return ie(e)||"0"}var dm=e(f)`
|
|
2
2
|
margin: 0;
|
|
3
3
|
`,pm=e.div`
|
|
4
4
|
display: flex;
|
|
@@ -883,7 +883,7 @@ import {e,f,i,j,a,g,b,h,c,p,w,u,v,d,x,y,z,A,B,F,G,H as H$1,q,r,k,J,o,l,m,n}from'
|
|
|
883
883
|
border-radius: 8px;
|
|
884
884
|
border: 1px solid ${({theme:e})=>{var t,o;return (o=(t=e.stigg)==null?void 0:t.palette)==null?void 0:o.outlinedBorder}};
|
|
885
885
|
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}};
|
|
886
|
-
`;function wp({currencyId:e,localization:t,decimalPlaces:o,showUnits:r=true,showSymbol:n=false,onAddCredits:i}){let s=fe(ee),l=u({optional:true}),a$1=l==null?void 0:l.theme,{balance:c,isLoading:u$1,error:f$1}=et({currencyId:e}),{title:p,addCredits:h}=a(a({},F),t),g=jsx(Qb,{className:"stigg-credit-balance-container",children:jsxs(Kb,{className:"stigg-credit-balance-card",children:[jsxs(Lt,{children:[jsx(f,{variant:"h6",color:"primary",className:"stigg-credit-balance-title",children:p}),i&&c&&!f$1&&jsxs(Nt,{type:"button",onClick:()=>i(c),className:"stigg-credit-balance-add-credits-button",children:[jsx(Nr,{className:"stigg-credit-balance-add-credits-icon"}),h]})]}),jsx(kp,{balance:c,isLoading:u$1,error:f$1,decimalPlaces:o,showUnits:r,showSymbol:n})]})});return s?g:jsx(w,{componentTheme:a$1,children:g})}var Xb=lazy(()=>import('./CreditUsageChart-
|
|
886
|
+
`;function wp({currencyId:e,localization:t,decimalPlaces:o,showUnits:r=true,showSymbol:n=false,onAddCredits:i}){let s=fe(ee),l=u({optional:true}),a$1=l==null?void 0:l.theme,{balance:c,isLoading:u$1,error:f$1}=et({currencyId:e}),{title:p,addCredits:h}=a(a({},F),t),g=jsx(Qb,{className:"stigg-credit-balance-container",children:jsxs(Kb,{className:"stigg-credit-balance-card",children:[jsxs(Lt,{children:[jsx(f,{variant:"h6",color:"primary",className:"stigg-credit-balance-title",children:p}),i&&c&&!f$1&&jsxs(Nt,{type:"button",onClick:()=>i(c),className:"stigg-credit-balance-add-credits-button",children:[jsx(Nr,{className:"stigg-credit-balance-add-credits-icon"}),h]})]}),jsx(kp,{balance:c,isLoading:u$1,error:f$1,decimalPlaces:o,showUnits:r,showSymbol:n})]})});return s?g:jsx(w,{componentTheme:a$1,children:g})}var Xb=lazy(()=>import('./CreditUsageChart-URN6IPYD.esm.js').then(e=>({default:e.CreditUsageChart})));function Ap(e){return jsx(Suspense,{fallback:null,children:jsx(Xb,a({},e))})}var jb=(e,t,o)=>o==="primary"?t.palette.primary:e>=100?t.palette.progress.high:e>=75?t.palette.progress.medium:t.palette.progress.low,eS=e.div`
|
|
887
887
|
width: 100%;
|
|
888
888
|
height: 8px;
|
|
889
889
|
background-color: ${({theme:e})=>e.stigg.palette.progress.background};
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "7.
|
|
2
|
+
"version": "7.28.0",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"main": "dist/stigg-sdk.cjs.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
"@emotion/react": "^11.10.5",
|
|
117
117
|
"@emotion/styled": "^11.10.5",
|
|
118
118
|
"@mui/material": "^5.12.0",
|
|
119
|
-
"@stigg/js-client-sdk": "3.
|
|
119
|
+
"@stigg/js-client-sdk": "3.101.0",
|
|
120
120
|
"@stripe/react-stripe-js": "^2.1.1",
|
|
121
121
|
"@stripe/stripe-js": "^1.54.1",
|
|
122
122
|
"chart.js": "^3.8.2",
|