zikade 0.1.0 → 0.1.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.
@@ -1,8 +1,7 @@
1
1
  import React, { ReactNode } from "react";
2
- import { createZikade } from "./createZikade";
3
2
  import type { LocaleTranslations } from "./types";
4
3
  type ZikadeContextType<T extends LocaleTranslations> = {
5
- zikade: ReturnType<typeof createZikade<T>>;
4
+ zikade: any;
6
5
  currentLocale: keyof T;
7
6
  setLanguage: (locale: keyof T) => void;
8
7
  };
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { createContext, useState, useMemo } from "react";
3
- import { createZikade } from "./createZikade"; // <-- corrected import
3
+ import { createZikade } from "./createZikade";
4
4
  const ZikadeContext = createContext(undefined);
5
5
  export function ZikadeProvider({ translations, defaultLocale, children }) {
6
6
  const [currentLocale, setCurrentLocale] = useState(defaultLocale);
@@ -12,7 +12,7 @@ export function ZikadeProvider({ translations, defaultLocale, children }) {
12
12
  const contextValue = useMemo(() => ({
13
13
  zikade,
14
14
  currentLocale,
15
- setLanguage: setCurrentLocale // <-- cast here
15
+ setLanguage: setCurrentLocale
16
16
  }), [zikade, currentLocale]);
17
17
  return _jsx(ZikadeContext.Provider, { value: contextValue, children: children });
18
18
  }
@@ -1,4 +1,4 @@
1
- import type { LocaleTranslations } from "./types.ts";
2
- export declare function useZikade<T extends LocaleTranslations>(): ReturnType<any> & {
1
+ import type { LocaleTranslations } from "./types";
2
+ export declare function useZikade<T extends LocaleTranslations>(): T[keyof T] & {
3
3
  setLanguage: (locale: keyof T) => void;
4
4
  };
package/dist/useZikade.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { useContext } from "react";
2
- import { ZikadeContext } from "../src/ZikadeProvider.js";
2
+ import { ZikadeContext } from "./ZikadeProvider";
3
3
  export function useZikade() {
4
4
  const context = useContext(ZikadeContext);
5
5
  if (!context)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zikade",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "author": "Sven_Guettner",
5
5
  "description": "Type-safe, React-compatible internationalization library",
6
6
  "main": "dist/index.js",