@rpg-engine/long-bow 0.7.91 → 0.7.92

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.
Files changed (35) hide show
  1. package/dist/components/CraftBook/CraftingTooltip.d.ts +13 -0
  2. package/dist/components/CraftBook/components/CraftBookHeader.d.ts +9 -0
  3. package/dist/components/CraftBook/components/CraftBookPagination.d.ts +0 -0
  4. package/dist/components/CraftBook/components/CraftBookSearch.d.ts +0 -0
  5. package/dist/components/CraftBook/hooks/useCraftBookFilters.d.ts +9 -0
  6. package/dist/components/CraftBook/hooks/useFilteredItems.d.ts +9 -0
  7. package/dist/components/CraftBook/hooks/usePagination.d.ts +13 -0
  8. package/dist/components/CraftBook/hooks/useResponsiveSize.d.ts +6 -0
  9. package/dist/components/CraftBook/utils/modifyString.d.ts +1 -0
  10. package/dist/components/shared/Pagination/Pagination.d.ts +9 -0
  11. package/dist/components/shared/SearchBar/SearchBar.d.ts +10 -0
  12. package/dist/hooks/useLocalStorage.d.ts +1 -0
  13. package/dist/long-bow.cjs.development.js +448 -293
  14. package/dist/long-bow.cjs.development.js.map +1 -1
  15. package/dist/long-bow.cjs.production.min.js +1 -1
  16. package/dist/long-bow.cjs.production.min.js.map +1 -1
  17. package/dist/long-bow.esm.js +448 -294
  18. package/dist/long-bow.esm.js.map +1 -1
  19. package/dist/stories/Features/craftbook/CraftBook.stories.d.ts +2 -0
  20. package/package.json +1 -1
  21. package/src/components/CraftBook/CraftBook.tsx +281 -138
  22. package/src/components/CraftBook/CraftingRecipe.tsx +97 -97
  23. package/src/components/CraftBook/CraftingTooltip.tsx +137 -0
  24. package/src/components/CraftBook/components/CraftBookHeader.tsx +81 -0
  25. package/src/components/CraftBook/components/CraftBookPagination.tsx +1 -0
  26. package/src/components/CraftBook/components/CraftBookSearch.tsx +1 -0
  27. package/src/components/CraftBook/hooks/useCraftBookFilters.ts +39 -0
  28. package/src/components/CraftBook/hooks/useFilteredItems.ts +39 -0
  29. package/src/components/CraftBook/hooks/usePagination.ts +39 -0
  30. package/src/components/CraftBook/hooks/useResponsiveSize.ts +50 -0
  31. package/src/components/CraftBook/utils/modifyString.ts +11 -0
  32. package/src/components/shared/Pagination/Pagination.tsx +69 -0
  33. package/src/components/shared/SearchBar/SearchBar.tsx +52 -0
  34. package/src/hooks/useLocalStorage.ts +44 -0
  35. package/src/stories/Features/craftbook/CraftBook.stories.tsx +41 -1
@@ -0,0 +1,13 @@
1
+ import { ICraftableItem, IItemContainer, ISkill } from '@rpg-engine/shared';
2
+ import React from 'react';
3
+ interface ICraftingTooltipProps {
4
+ x: number;
5
+ y: number;
6
+ recipe: ICraftableItem;
7
+ inventory?: IItemContainer | null;
8
+ skills?: ISkill | null;
9
+ atlasIMG: any;
10
+ atlasJSON: any;
11
+ }
12
+ export declare const CraftingTooltip: React.FC<ICraftingTooltipProps>;
13
+ export {};
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { IOptionsProps } from '../../Dropdown';
3
+ interface CraftBookHeaderProps {
4
+ categoryOptions: IOptionsProps[];
5
+ onCategoryChange: (value: string) => void;
6
+ onSearchToggle: () => void;
7
+ }
8
+ export declare const CraftBookHeader: React.FC<CraftBookHeaderProps>;
9
+ export {};
@@ -0,0 +1,9 @@
1
+ import { ICraftableItem } from '@rpg-engine/shared';
2
+ interface UseCraftBookFiltersProps {
3
+ items: ICraftableItem[];
4
+ searchTerm: string;
5
+ selectedType: string;
6
+ pinnedItems: string[];
7
+ }
8
+ export declare const useCraftBookFilters: ({ items, searchTerm, selectedType, pinnedItems, }: UseCraftBookFiltersProps) => ICraftableItem[];
9
+ export {};
@@ -0,0 +1,9 @@
1
+ import { ICraftableItem } from '@rpg-engine/shared';
2
+ interface UseFilteredItemsProps {
3
+ items: ICraftableItem[];
4
+ searchTerm: string;
5
+ selectedType: string;
6
+ pinnedItems: string[];
7
+ }
8
+ export declare const useFilteredItems: ({ items, searchTerm, selectedType, pinnedItems, }: UseFilteredItemsProps) => ICraftableItem[];
9
+ export {};
@@ -0,0 +1,13 @@
1
+ interface UsePaginationProps<T> {
2
+ items: T[];
3
+ itemsPerPage: number;
4
+ dependencies?: any[];
5
+ }
6
+ interface UsePaginationReturn<T> {
7
+ currentPage: number;
8
+ setCurrentPage: (page: number) => void;
9
+ paginatedItems: T[];
10
+ totalPages: number;
11
+ }
12
+ export declare const usePagination: <T>({ items, itemsPerPage, dependencies, }: UsePaginationProps<T>) => UsePaginationReturn<T>;
13
+ export {};
@@ -0,0 +1,6 @@
1
+ interface Size {
2
+ width: string;
3
+ height: string;
4
+ }
5
+ export declare const useResponsiveSize: (scale?: number | undefined) => Size | undefined;
6
+ export {};
@@ -0,0 +1 @@
1
+ export declare const modifyString: (str: string) => string;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ interface PaginationProps {
3
+ currentPage: number;
4
+ totalPages: number;
5
+ onPageChange: (page: number) => void;
6
+ className?: string;
7
+ }
8
+ export declare const Pagination: React.FC<PaginationProps>;
9
+ export {};
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ interface SearchBarProps {
3
+ value: string;
4
+ onChange: (value: string) => void;
5
+ placeholder?: string;
6
+ className?: string;
7
+ autoFocus?: boolean;
8
+ }
9
+ export declare const SearchBar: React.FC<SearchBarProps>;
10
+ export {};
@@ -0,0 +1 @@
1
+ export declare function useLocalStorage<T>(key: string, initialValue: T): readonly [T, (value: T | ((val: T) => T)) => void];