@shipengine/alchemy 2.0.1 → 2.1.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.
@@ -10,6 +10,7 @@ export type AlchemyContextValue = {
10
10
  brandName: BrandName;
11
11
  cdnURL: string;
12
12
  getToken: ShipEngineProps["getToken"];
13
+ locale?: string;
13
14
  onError: AlchemyErrorHandler;
14
15
  scope: string;
15
16
  theme: Theme;
@@ -32,9 +33,10 @@ export interface AlchemyProviderProps {
32
33
  cdnURL?: string;
33
34
  children: React.ReactNode;
34
35
  getToken: ShipEngineProps["getToken"];
36
+ locale?: string;
35
37
  onError?: AlchemyErrorHandler;
36
38
  scope?: string;
37
39
  }
38
- export declare const AlchemyProvider: ({ baseURL, brandName, cdnURL, children, getToken, onError, scope, }: AlchemyProviderProps) => import("@emotion/react/jsx-runtime").JSX.Element | null;
40
+ export declare const AlchemyProvider: ({ baseURL, brandName, cdnURL, children, getToken, locale, onError, scope, }: AlchemyProviderProps) => import("@emotion/react/jsx-runtime").JSX.Element | null;
39
41
  export declare const useAlchemy: () => AlchemyContextValue;
40
42
  export {};
package/index.js CHANGED
@@ -9574,6 +9574,7 @@ const AlchemyProvider = ({
9574
9574
  cdnURL = "/",
9575
9575
  children,
9576
9576
  getToken,
9577
+ locale = ((_a) => (_a = navigator == null ? void 0 : navigator.language) != null ? _a : "en-US")(),
9577
9578
  onError = _default,
9578
9579
  scope = "lmnt"
9579
9580
  }) => {
@@ -9583,7 +9584,7 @@ const AlchemyProvider = ({
9583
9584
  const iconCache = React.useMemo(giger.createIconCache, []);
9584
9585
  if (!theme)
9585
9586
  return null;
9586
- const contextValue = { baseURL, brandName, cdnURL, getToken, onError, scope, theme };
9587
+ const contextValue = { baseURL, brandName, cdnURL, getToken, locale, onError, scope, theme };
9587
9588
  return /* @__PURE__ */ jsx(AlchemyContext.Provider, { value: contextValue, children: renderAlchemyProviders(__spreadProps$1(__spreadValues$2({}, contextValue), { children, fontStyles, iconCache, resolveIcon })) });
9588
9589
  };
9589
9590
  const useAlchemy = () => {
package/index.mjs CHANGED
@@ -9552,6 +9552,7 @@ const AlchemyProvider = ({
9552
9552
  cdnURL = "/",
9553
9553
  children,
9554
9554
  getToken,
9555
+ locale = ((_a) => (_a = navigator == null ? void 0 : navigator.language) != null ? _a : "en-US")(),
9555
9556
  onError = _default,
9556
9557
  scope = "lmnt"
9557
9558
  }) => {
@@ -9561,7 +9562,7 @@ const AlchemyProvider = ({
9561
9562
  const iconCache = useMemo(createIconCache, []);
9562
9563
  if (!theme)
9563
9564
  return null;
9564
- const contextValue = { baseURL, brandName, cdnURL, getToken, onError, scope, theme };
9565
+ const contextValue = { baseURL, brandName, cdnURL, getToken, locale, onError, scope, theme };
9565
9566
  return /* @__PURE__ */ jsx(AlchemyContext.Provider, { value: contextValue, children: renderAlchemyProviders(__spreadProps$1(__spreadValues$2({}, contextValue), { children, fontStyles, iconCache, resolveIcon })) });
9566
9567
  };
9567
9568
  const useAlchemy = () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shipengine/alchemy",
3
- "version": "2.0.1",
3
+ "version": "2.1.0",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "exports": {