oddsgate-ds 1.0.203 → 1.0.204

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,4 +1,12 @@
1
1
  import React from 'react';
2
- import { GlossaryProps } from './Glossary.interface';
2
+ type GlossaryProps = {
3
+ searchTerm: string;
4
+ setSearchTerm: (term: string) => void;
5
+ selectedCategory: string | null;
6
+ setSelectedCategory: (cat: string | null) => void;
7
+ categoryData: Record<string, string[]>;
8
+ displayedCategories: string[];
9
+ placeholder?: string;
10
+ };
3
11
  export declare const Glossary: React.FC<GlossaryProps>;
4
12
  export default Glossary;
package/dist/types.d.ts CHANGED
@@ -720,28 +720,15 @@ type IProductsSlider = {
720
720
 
721
721
  declare const ProductsSlider: ({ content, style, className, }: IProductsSlider) => React__default.JSX.Element;
722
722
 
723
- type GlossaryItem = {
724
- title: string;
725
- categories: {
726
- name: string;
727
- items: {
728
- slug: string;
729
- name: string;
730
- }[];
731
- }[];
732
- };
733
723
  type GlossaryProps = {
734
- items: GlossaryItem[];
735
- categories: {
736
- name: string;
737
- items: {
738
- slug: string;
739
- name: string;
740
- }[];
741
- }[];
724
+ searchTerm: string;
725
+ setSearchTerm: (term: string) => void;
726
+ selectedCategory: string | null;
727
+ setSelectedCategory: (cat: string | null) => void;
728
+ categoryData: Record<string, string[]>;
729
+ displayedCategories: string[];
742
730
  placeholder?: string;
743
731
  };
744
-
745
732
  declare const Glossary: React__default.FC<GlossaryProps>;
746
733
 
747
734
  declare const iconsList: string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oddsgate-ds",
3
- "version": "1.0.203",
3
+ "version": "1.0.204",
4
4
  "description": "Miew theme component library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -1,37 +1,31 @@
1
- import React, { useState } from 'react'
1
+ import React from 'react'
2
2
  import { StyledGlossary, StyledGlossaryCategories } from './Glossary.themes'
3
3
 
4
4
  import SearchBar from '@/components/molecules/SearchBar/SearchBar.component'
5
5
  import GlossaryCategoryIndex from '@/components/molecules/CategoryIndex/CategoryIndex.component'
6
6
  import CategoriesWrapper from '@/components/molecules/CategoriesWrapper/CategoriesWrapper.component'
7
- import { GlossaryProps } from './Glossary.interface'
7
+
8
+ type GlossaryProps = {
9
+ searchTerm: string
10
+ setSearchTerm: (term: string) => void
11
+ selectedCategory: string | null
12
+ setSelectedCategory: (cat: string | null) => void
13
+ categoryData: Record<string, string[]>
14
+ displayedCategories: string[]
15
+ placeholder?: string
16
+ }
8
17
 
9
18
  export const Glossary: React.FC<GlossaryProps> = ({
10
- items,
11
- categories,
19
+ searchTerm,
20
+ setSearchTerm,
21
+ selectedCategory,
22
+ setSelectedCategory,
23
+ categoryData,
24
+ displayedCategories,
12
25
  placeholder
13
26
  }) => {
14
- const [searchTerm, setSearchTerm] = useState('')
15
- const [selectedCategory, setSelectedCategory] = useState<string | null>(null)
16
-
17
- const categoryData: Record<string, string[]> = {}
18
- categories[0].items.forEach(cat => {
19
- categoryData[cat.name] = []
20
- })
21
- items.forEach(item => {
22
- item.categories[0].items.forEach(cat => {
23
- if (categoryData[cat.name]) {
24
- categoryData[cat.name].push(item.title)
25
- }
26
- })
27
- })
28
-
29
27
  const categoryNames = Object.keys(categoryData)
30
28
 
31
- const displayedCategories = selectedCategory
32
- ? [selectedCategory]
33
- : categoryNames
34
-
35
29
  return (
36
30
  <StyledGlossary>
37
31
  <SearchBar