@shipengine/alchemy 5.3.0 → 5.4.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.
@@ -23,8 +23,7 @@ export type AlchemyProviderProps = {
23
23
  onError?: AlchemyErrorHandler;
24
24
  /** Scope of the Alchemy Provider. Can be null to not specify a specific element */
25
25
  scope?: string | null;
26
- scopeTheme?: boolean;
27
26
  themeConfig?: CustomThemeData;
28
27
  } & ShipEngineAPIConfig;
29
- export declare const AlchemyProvider: ({ baseURL, cdnURL, container, children, getToken, locale: localeProp, onError, scope, scopeTheme, themeConfig, onApiError, headers, defaultQueryClientOptions, }: AlchemyProviderProps) => import("@emotion/react/jsx-runtime").JSX.Element;
28
+ export declare const AlchemyProvider: ({ baseURL, cdnURL, container, children, getToken, locale: localeProp, onError, scope, themeConfig, onApiError, headers, defaultQueryClientOptions, }: AlchemyProviderProps) => import("@emotion/react/jsx-runtime").JSX.Element;
30
29
  export declare const useAlchemy: () => AlchemyContextValue;
package/index.js CHANGED
@@ -10511,7 +10511,18 @@ const fallbackTheme = {
10511
10511
  light: '#d3d3d3',
10512
10512
  ultraLight: '#f4f4f4',
10513
10513
  megaLight: '#fafafa',
10514
- dark: '#373737'
10514
+ dark: '#373737',
10515
+ 25: '#F7F7F8',
10516
+ 50: '#f1f2f3',
10517
+ 100: '#e4e5e7',
10518
+ 200: '#cfd1d3',
10519
+ 300: '#afb3b6',
10520
+ 400: '#8d9196',
10521
+ 500: '#71767a',
10522
+ 600: '#56595d',
10523
+ 700: '#424548',
10524
+ 800: '#27292a',
10525
+ 900: '#0f0f10'
10515
10526
  },
10516
10527
  black: '#000',
10517
10528
  white: '#fff',
@@ -10717,6 +10728,8 @@ class Theme {
10717
10728
  this.breakPoints = merge$2(fallbackTheme.breakPoints, breakPoints);
10718
10729
  this.iconSize = merge$2(fallbackTheme.iconSize, iconSize);
10719
10730
  this.palette = merge$2(fallbackTheme.palette, palette);
10731
+ // Adds backwards compatibility with old grays naming
10732
+ this.palette.gray = mergeGrays(fallbackTheme.palette.gray, palette.gray);
10720
10733
  this.spacingBase = spacingBase || fallbackTheme.spacingBase;
10721
10734
  this.typography = merge$2(fallbackTheme.typography, typography);
10722
10735
  this.card = merge$2(fallbackTheme.card, card);
@@ -10781,6 +10794,17 @@ class Theme {
10781
10794
  };
10782
10795
  getLineHeight = (fontSizePx, lineHeightPx) => this.removePx(lineHeightPx) / this.removePx(fontSizePx);
10783
10796
  }
10797
+ function mergeGrays(fallbackGray, gray) {
10798
+ return {
10799
+ ...fallbackGray,
10800
+ ...gray,
10801
+ 50: (gray === null || gray === void 0 ? void 0 : gray[50]) || (gray === null || gray === void 0 ? void 0 : gray.megaLight) || fallbackGray.megaLight,
10802
+ 100: (gray === null || gray === void 0 ? void 0 : gray[100]) || (gray === null || gray === void 0 ? void 0 : gray.ultraLight) || fallbackGray.ultraLight,
10803
+ 200: (gray === null || gray === void 0 ? void 0 : gray[200]) || (gray === null || gray === void 0 ? void 0 : gray.light) || fallbackGray.light,
10804
+ 600: (gray === null || gray === void 0 ? void 0 : gray[600]) || (gray === null || gray === void 0 ? void 0 : gray.main) || fallbackGray.main,
10805
+ 900: (gray === null || gray === void 0 ? void 0 : gray[900]) || (gray === null || gray === void 0 ? void 0 : gray.dark) || fallbackGray.dark
10806
+ };
10807
+ }
10784
10808
 
10785
10809
  var AccountBillingPlanChangeType = /* @__PURE__ */ ((AccountBillingPlanChangeType2) => {
10786
10810
  AccountBillingPlanChangeType2["Downgrade"] = "Downgrade";
@@ -37067,7 +37091,6 @@ const AlchemyProvider = ({
37067
37091
  locale: localeProp,
37068
37092
  onError = _default,
37069
37093
  scope = "lmnt",
37070
- scopeTheme = false,
37071
37094
  themeConfig,
37072
37095
  onApiError,
37073
37096
  headers,
@@ -37092,7 +37115,7 @@ const AlchemyProvider = ({
37092
37115
  reference: scope || void 0,
37093
37116
  cdnUrl: cdnURL,
37094
37117
  resolveIcon,
37095
- theme: scopeTheme ? { [giger.THEME_ID]: theme } : theme,
37118
+ theme,
37096
37119
  children: /* @__PURE__ */ jsx(
37097
37120
  ShipEngine,
37098
37121
  {
package/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { createContext, forwardRef, useContext, createElement as createElement$1, Fragment, useState, useEffect, useCallback, useMemo, useRef } from 'react';
3
3
  import { jsx as jsx$1 } from 'react/jsx-runtime';
4
- import { GigerProvider, THEME_ID, GigerTestProvider, DefaultPortalRefProvider } from '@shipengine/giger';
4
+ import { GigerProvider, GigerTestProvider, DefaultPortalRefProvider } from '@shipengine/giger';
5
5
  import { QueryClient, QueryClientProvider, useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
6
6
  import { CacheProvider } from '@emotion/react';
7
7
  import { I18nextProvider } from 'react-i18next';
@@ -10489,7 +10489,18 @@ const fallbackTheme = {
10489
10489
  light: '#d3d3d3',
10490
10490
  ultraLight: '#f4f4f4',
10491
10491
  megaLight: '#fafafa',
10492
- dark: '#373737'
10492
+ dark: '#373737',
10493
+ 25: '#F7F7F8',
10494
+ 50: '#f1f2f3',
10495
+ 100: '#e4e5e7',
10496
+ 200: '#cfd1d3',
10497
+ 300: '#afb3b6',
10498
+ 400: '#8d9196',
10499
+ 500: '#71767a',
10500
+ 600: '#56595d',
10501
+ 700: '#424548',
10502
+ 800: '#27292a',
10503
+ 900: '#0f0f10'
10493
10504
  },
10494
10505
  black: '#000',
10495
10506
  white: '#fff',
@@ -10695,6 +10706,8 @@ class Theme {
10695
10706
  this.breakPoints = merge$2(fallbackTheme.breakPoints, breakPoints);
10696
10707
  this.iconSize = merge$2(fallbackTheme.iconSize, iconSize);
10697
10708
  this.palette = merge$2(fallbackTheme.palette, palette);
10709
+ // Adds backwards compatibility with old grays naming
10710
+ this.palette.gray = mergeGrays(fallbackTheme.palette.gray, palette.gray);
10698
10711
  this.spacingBase = spacingBase || fallbackTheme.spacingBase;
10699
10712
  this.typography = merge$2(fallbackTheme.typography, typography);
10700
10713
  this.card = merge$2(fallbackTheme.card, card);
@@ -10759,6 +10772,17 @@ class Theme {
10759
10772
  };
10760
10773
  getLineHeight = (fontSizePx, lineHeightPx) => this.removePx(lineHeightPx) / this.removePx(fontSizePx);
10761
10774
  }
10775
+ function mergeGrays(fallbackGray, gray) {
10776
+ return {
10777
+ ...fallbackGray,
10778
+ ...gray,
10779
+ 50: (gray === null || gray === void 0 ? void 0 : gray[50]) || (gray === null || gray === void 0 ? void 0 : gray.megaLight) || fallbackGray.megaLight,
10780
+ 100: (gray === null || gray === void 0 ? void 0 : gray[100]) || (gray === null || gray === void 0 ? void 0 : gray.ultraLight) || fallbackGray.ultraLight,
10781
+ 200: (gray === null || gray === void 0 ? void 0 : gray[200]) || (gray === null || gray === void 0 ? void 0 : gray.light) || fallbackGray.light,
10782
+ 600: (gray === null || gray === void 0 ? void 0 : gray[600]) || (gray === null || gray === void 0 ? void 0 : gray.main) || fallbackGray.main,
10783
+ 900: (gray === null || gray === void 0 ? void 0 : gray[900]) || (gray === null || gray === void 0 ? void 0 : gray.dark) || fallbackGray.dark
10784
+ };
10785
+ }
10762
10786
 
10763
10787
  var AccountBillingPlanChangeType = /* @__PURE__ */ ((AccountBillingPlanChangeType2) => {
10764
10788
  AccountBillingPlanChangeType2["Downgrade"] = "Downgrade";
@@ -37045,7 +37069,6 @@ const AlchemyProvider = ({
37045
37069
  locale: localeProp,
37046
37070
  onError = _default,
37047
37071
  scope = "lmnt",
37048
- scopeTheme = false,
37049
37072
  themeConfig,
37050
37073
  onApiError,
37051
37074
  headers,
@@ -37070,7 +37093,7 @@ const AlchemyProvider = ({
37070
37093
  reference: scope || void 0,
37071
37094
  cdnUrl: cdnURL,
37072
37095
  resolveIcon,
37073
- theme: scopeTheme ? { [THEME_ID]: theme } : theme,
37096
+ theme,
37074
37097
  children: /* @__PURE__ */ jsx(
37075
37098
  ShipEngine,
37076
37099
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shipengine/alchemy",
3
- "version": "5.3.0",
3
+ "version": "5.4.0",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "exports": {
@@ -18,7 +18,7 @@
18
18
  },
19
19
  "peerDependencies": {
20
20
  "@emotion/react": "11.x",
21
- "@shipengine/giger": "1.x.x",
21
+ "@shipengine/giger": ">=1.10.x",
22
22
  "@tanstack/react-query": "4.x",
23
23
  "react": "17.x || 18.x",
24
24
  "react-dom": "17.x || 18.x",