@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.
- package/dist/components/CraftBook/CraftingTooltip.d.ts +13 -0
- package/dist/components/CraftBook/components/CraftBookHeader.d.ts +9 -0
- package/dist/components/CraftBook/components/CraftBookPagination.d.ts +0 -0
- package/dist/components/CraftBook/components/CraftBookSearch.d.ts +0 -0
- package/dist/components/CraftBook/hooks/useCraftBookFilters.d.ts +9 -0
- package/dist/components/CraftBook/hooks/useFilteredItems.d.ts +9 -0
- package/dist/components/CraftBook/hooks/usePagination.d.ts +13 -0
- package/dist/components/CraftBook/hooks/useResponsiveSize.d.ts +6 -0
- package/dist/components/CraftBook/utils/modifyString.d.ts +1 -0
- package/dist/components/shared/Pagination/Pagination.d.ts +9 -0
- package/dist/components/shared/SearchBar/SearchBar.d.ts +10 -0
- package/dist/hooks/useLocalStorage.d.ts +1 -0
- package/dist/long-bow.cjs.development.js +448 -293
- package/dist/long-bow.cjs.development.js.map +1 -1
- package/dist/long-bow.cjs.production.min.js +1 -1
- package/dist/long-bow.cjs.production.min.js.map +1 -1
- package/dist/long-bow.esm.js +448 -294
- package/dist/long-bow.esm.js.map +1 -1
- package/dist/stories/Features/craftbook/CraftBook.stories.d.ts +2 -0
- package/package.json +1 -1
- package/src/components/CraftBook/CraftBook.tsx +281 -138
- package/src/components/CraftBook/CraftingRecipe.tsx +97 -97
- package/src/components/CraftBook/CraftingTooltip.tsx +137 -0
- package/src/components/CraftBook/components/CraftBookHeader.tsx +81 -0
- package/src/components/CraftBook/components/CraftBookPagination.tsx +1 -0
- package/src/components/CraftBook/components/CraftBookSearch.tsx +1 -0
- package/src/components/CraftBook/hooks/useCraftBookFilters.ts +39 -0
- package/src/components/CraftBook/hooks/useFilteredItems.ts +39 -0
- package/src/components/CraftBook/hooks/usePagination.ts +39 -0
- package/src/components/CraftBook/hooks/useResponsiveSize.ts +50 -0
- package/src/components/CraftBook/utils/modifyString.ts +11 -0
- package/src/components/shared/Pagination/Pagination.tsx +69 -0
- package/src/components/shared/SearchBar/SearchBar.tsx +52 -0
- package/src/hooks/useLocalStorage.ts +44 -0
- 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 {};
|
|
File without changes
|
|
File without changes
|
|
@@ -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 @@
|
|
|
1
|
+
export declare const modifyString: (str: string) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useLocalStorage<T>(key: string, initialValue: T): readonly [T, (value: T | ((val: T) => T)) => void];
|