oddsgate-ds 1.0.210 → 1.0.212

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 (27) hide show
  1. package/dist/cjs/index.js +1 -1
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/cjs/types/components/molecules/CategoriesWrapper/index.d.ts +1 -0
  4. package/dist/cjs/types/components/molecules/CategoryIndex/index.d.ts +1 -0
  5. package/dist/cjs/types/components/molecules/SearchBar/index.d.ts +1 -0
  6. package/dist/cjs/types/components/organisms/Glossary/Glossary.component.d.ts +16 -1
  7. package/dist/cjs/types/components/organisms/Glossary/Glossary.interface.d.ts +0 -13
  8. package/dist/cjs/types/index.d.ts +3 -0
  9. package/dist/esm/index.js +1 -1
  10. package/dist/esm/index.js.map +1 -1
  11. package/dist/esm/types/components/molecules/CategoriesWrapper/index.d.ts +1 -0
  12. package/dist/esm/types/components/molecules/CategoryIndex/index.d.ts +1 -0
  13. package/dist/esm/types/components/molecules/SearchBar/index.d.ts +1 -0
  14. package/dist/esm/types/components/organisms/Glossary/Glossary.component.d.ts +16 -1
  15. package/dist/esm/types/components/organisms/Glossary/Glossary.interface.d.ts +0 -13
  16. package/dist/esm/types/index.d.ts +3 -0
  17. package/dist/types.d.ts +28 -21
  18. package/package.json +1 -1
  19. package/src/components/molecules/CategoriesWrapper/CategoriesWrapper.component.tsx +1 -1
  20. package/src/components/molecules/CategoriesWrapper/CategoriesWrapper.interface.ts +1 -1
  21. package/src/components/molecules/CategoriesWrapper/index.ts +1 -0
  22. package/src/components/molecules/CategoryIndex/index.ts +1 -0
  23. package/src/components/molecules/SearchBar/index.ts +1 -0
  24. package/src/components/organisms/Glossary/Glossary.component.tsx +15 -4
  25. package/src/components/organisms/Glossary/Glossary.interface.ts +0 -10
  26. package/src/components/organisms/Glossary/Glossary.stories.tsx +10 -2
  27. package/src/index.ts +3 -0
@@ -0,0 +1 @@
1
+ export { default } from './CategoriesWrapper.component';
@@ -0,0 +1 @@
1
+ export { default } from './CategoryIndex.component';
@@ -0,0 +1 @@
1
+ export { default } from './SearchBar.component';
@@ -1,4 +1,19 @@
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, {
8
+ title: string;
9
+ slug: string;
10
+ }[]>;
11
+ displayedCategories: string[];
12
+ placeholder?: string;
13
+ noResults?: boolean;
14
+ backToTopButton?: boolean;
15
+ noResultsText?: string;
16
+ tryAnotherLetterText?: string;
17
+ };
3
18
  export declare const Glossary: React.FC<GlossaryProps>;
4
19
  export default Glossary;
@@ -18,18 +18,5 @@ export type GlossaryProps = {
18
18
  }[];
19
19
  }[];
20
20
  placeholder?: string;
21
- searchTerm: string;
22
- setSearchTerm: (term: string) => void;
23
- selectedCategory: string | null;
24
- setSelectedCategory: (cat: string | null) => void;
25
- categoryData: Record<string, {
26
- title: string;
27
- slug: string;
28
- }[]>;
29
- displayedCategories: string[];
30
- noResults?: boolean;
31
- backToTopButton?: boolean;
32
- noResultsText?: string;
33
- tryAnotherLetterText?: string;
34
21
  };
35
22
  export {};
@@ -25,6 +25,9 @@ export { default as LegalLinks } from './components/atoms/LegalLinks';
25
25
  export { default as Marquee } from './components/atoms/Marquee';
26
26
  export { default as CardMarquee } from './components/atoms/CardMarquee';
27
27
  export { default as AwardBadge } from './components/atoms/AwardBadge';
28
+ export { default as SearchBar } from './components/molecules/SearchBar';
29
+ export { default as CategoriesWrapper } from './components/molecules/CategoriesWrapper';
30
+ export { default as CategoryIndex } from './components/molecules/CategoryIndex';
28
31
  export { default as PortalComponent } from './components/common/PortalComponent';
29
32
  export { Accordion as Accordion } from './components/molecules/Accordion';
30
33
  export { AccordionItem as AccordionItem } from './components/molecules/Accordion';
package/dist/types.d.ts CHANGED
@@ -432,6 +432,32 @@ interface IAwardBadge {
432
432
  */
433
433
  declare const AwardBadge: ({ label, variant, }: IAwardBadge) => React__default.JSX.Element;
434
434
 
435
+ interface SearchBarProps {
436
+ value: string;
437
+ onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
438
+ placeholder?: string;
439
+ }
440
+
441
+ declare const SearchBar: React__default.FC<SearchBarProps>;
442
+
443
+ interface CategoriesWrapperProps {
444
+ category: string;
445
+ categoryItems: {
446
+ title: string;
447
+ slug: string;
448
+ }[];
449
+ }
450
+
451
+ declare const CategoriesWrapper: React__default.FC<CategoriesWrapperProps>;
452
+
453
+ interface CategoryIndexProps {
454
+ categories: string[];
455
+ onChange: (category: string | null) => void;
456
+ selectedCategory: string | null;
457
+ }
458
+
459
+ declare const CategoryIndex: React__default.FC<CategoryIndexProps>;
460
+
435
461
  type PortalComponentProps = {
436
462
  wrapperId: string;
437
463
  children?: React.ReactNode;
@@ -720,26 +746,7 @@ type IProductsSlider = {
720
746
 
721
747
  declare const ProductsSlider: ({ content, style, className, }: IProductsSlider) => React__default.JSX.Element;
722
748
 
723
- type GlossaryItem = {
724
- title: string;
725
- categories: {
726
- name: string;
727
- items: {
728
- slug: string;
729
- name: string;
730
- }[];
731
- }[];
732
- };
733
749
  type GlossaryProps = {
734
- items: GlossaryItem[];
735
- categories: {
736
- name: string;
737
- items: {
738
- slug: string;
739
- name: string;
740
- }[];
741
- }[];
742
- placeholder?: string;
743
750
  searchTerm: string;
744
751
  setSearchTerm: (term: string) => void;
745
752
  selectedCategory: string | null;
@@ -749,12 +756,12 @@ type GlossaryProps = {
749
756
  slug: string;
750
757
  }[]>;
751
758
  displayedCategories: string[];
759
+ placeholder?: string;
752
760
  noResults?: boolean;
753
761
  backToTopButton?: boolean;
754
762
  noResultsText?: string;
755
763
  tryAnotherLetterText?: string;
756
764
  };
757
-
758
765
  declare const Glossary: React__default.FC<GlossaryProps>;
759
766
 
760
767
  declare const iconsList: string[];
@@ -769,4 +776,4 @@ declare function useMediaMatch(query?: string): boolean;
769
776
 
770
777
  declare const debounce: (callback: any, wait: number) => (...args: any) => void;
771
778
 
772
- export { Accordion, AccordionItem, AwardBadge, AwardCard, BlogCard, Button, CardMarquee, CareersCard, CheckRadioField, Chip, CircularSlider, CloseButton, Column, Counter, Cover, Dropdown, DropdownItem, EmptyState, EventsCard, Flex, FormField, GlobalStyles, Glossary, Heading, Icon, IconBox, IconTitle, ImageWrapper, LegalLinks, LicenseCard, Loader, LogosCard, Marquee, Modal, NewsCard, OffCanvas, PortalComponent, ProductCard, ProductsSlider, Quote, RichText, Row, ScrollingNav, Separator, ShareModal, Slider, SocialLinks, Spacer, Tabs, TeamCard, Video, VideoEmbed, clickOutSideToClose, debounce, iconsList, isTouchDevice, useMediaMatch, variables };
779
+ export { Accordion, AccordionItem, AwardBadge, AwardCard, BlogCard, Button, CardMarquee, CareersCard, CategoriesWrapper, CategoryIndex, CheckRadioField, Chip, CircularSlider, CloseButton, Column, Counter, Cover, Dropdown, DropdownItem, EmptyState, EventsCard, Flex, FormField, GlobalStyles, Glossary, Heading, Icon, IconBox, IconTitle, ImageWrapper, LegalLinks, LicenseCard, Loader, LogosCard, Marquee, Modal, NewsCard, OffCanvas, PortalComponent, ProductCard, ProductsSlider, Quote, RichText, Row, ScrollingNav, SearchBar, Separator, ShareModal, Slider, SocialLinks, Spacer, Tabs, TeamCard, Video, VideoEmbed, clickOutSideToClose, debounce, iconsList, isTouchDevice, useMediaMatch, variables };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oddsgate-ds",
3
- "version": "1.0.210",
3
+ "version": "1.0.212",
4
4
  "description": "Miew theme component library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -24,7 +24,7 @@ const CategoriesWrapper: React.FC<CategoriesWrapperProps> = ({
24
24
  <StyledCategoryContent>
25
25
  {categoryItems.map((item, index) => (
26
26
  <StyledCategoryItem key={index}>
27
- <Button as="a" href={item.slug} variant="text">
27
+ <Button href={item.slug} variant="text">
28
28
  {item.title}
29
29
  </Button>
30
30
  </StyledCategoryItem>
@@ -1,4 +1,4 @@
1
1
  export interface CategoriesWrapperProps {
2
2
  category: string
3
3
  categoryItems: { title: string; slug: string }[]
4
- }
4
+ }
@@ -0,0 +1 @@
1
+ export { default } from './CategoriesWrapper.component'
@@ -0,0 +1 @@
1
+ export { default } from './CategoryIndex.component'
@@ -0,0 +1 @@
1
+ export { default } from './SearchBar.component'
@@ -13,8 +13,20 @@ import GlossaryCategoryIndex from '@/components/molecules/CategoryIndex/Category
13
13
  import CategoriesWrapper from '@/components/molecules/CategoriesWrapper/CategoriesWrapper.component'
14
14
  import Button from '@/components/atoms/Button'
15
15
  import Icon from '@/components/atoms/Icon'
16
- import { GlossaryProps } from './Glossary.interface'
17
16
 
17
+ type GlossaryProps = {
18
+ searchTerm: string
19
+ setSearchTerm: (term: string) => void
20
+ selectedCategory: string | null
21
+ setSelectedCategory: (cat: string | null) => void
22
+ categoryData: Record<string, { title: string; slug: string }[]>
23
+ displayedCategories: string[]
24
+ placeholder?: string
25
+ noResults?: boolean
26
+ backToTopButton?: boolean
27
+ noResultsText?: string
28
+ tryAnotherLetterText?: string
29
+ }
18
30
 
19
31
  export const Glossary: React.FC<GlossaryProps> = ({
20
32
  searchTerm,
@@ -22,7 +34,6 @@ export const Glossary: React.FC<GlossaryProps> = ({
22
34
  selectedCategory,
23
35
  setSelectedCategory,
24
36
  categoryData,
25
- displayedCategories,
26
37
  placeholder,
27
38
  noResults,
28
39
  backToTopButton,
@@ -30,7 +41,7 @@ export const Glossary: React.FC<GlossaryProps> = ({
30
41
  tryAnotherLetterText
31
42
  }) => {
32
43
  const categoryNames = Object.keys(categoryData)
33
-
44
+ console.log("categoryData", categoryData)
34
45
  return (
35
46
  <StyledGlossary>
36
47
  <SearchBar
@@ -54,7 +65,7 @@ export const Glossary: React.FC<GlossaryProps> = ({
54
65
  ) : (
55
66
  <>
56
67
  <StyledGlossaryCategories>
57
- {displayedCategories.map(category => (
68
+ {categoryNames.map(category => (
58
69
  <CategoriesWrapper
59
70
  key={category}
60
71
  category={category}
@@ -7,14 +7,4 @@ export type GlossaryProps = {
7
7
  items: GlossaryItem[]
8
8
  categories: { name: string; items: { slug: string; name: string }[] }[]
9
9
  placeholder?: string
10
- searchTerm: string
11
- setSearchTerm: (term: string) => void
12
- selectedCategory: string | null
13
- setSelectedCategory: (cat: string | null) => void
14
- categoryData: Record<string, { title: string; slug: string }[]>
15
- displayedCategories: string[]
16
- noResults?: boolean
17
- backToTopButton?: boolean
18
- noResultsText?: string
19
- tryAnotherLetterText?: string
20
10
  }
@@ -144,8 +144,13 @@ interface BuildCategoryDataCategory {
144
144
  items: BuildCategoryDataItem[]
145
145
  }
146
146
 
147
+ interface CategoryDataItem {
148
+ title: string
149
+ slug: string
150
+ }
151
+
147
152
  interface CategoryData {
148
- [categoryName: string]: string[]
153
+ [categoryName: string]: CategoryDataItem[]
149
154
  }
150
155
 
151
156
  function buildCategoryData(
@@ -154,7 +159,10 @@ function buildCategoryData(
154
159
  ): CategoryData {
155
160
  const data: CategoryData = {}
156
161
  categories.forEach((cat: BuildCategoryDataCategory) => {
157
- data[cat.name] = cat.items.map((item: BuildCategoryDataItem) => item.name)
162
+ data[cat.name] = cat.items.map((item: BuildCategoryDataItem) => ({
163
+ title: item.name,
164
+ slug: item.slug
165
+ }))
158
166
  })
159
167
  return data
160
168
  }
package/src/index.ts CHANGED
@@ -27,6 +27,9 @@ export { default as LegalLinks } from './components/atoms/LegalLinks'
27
27
  export { default as Marquee } from './components/atoms/Marquee'
28
28
  export { default as CardMarquee } from './components/atoms/CardMarquee'
29
29
  export { default as AwardBadge } from './components/atoms/AwardBadge'
30
+ export { default as SearchBar } from './components/molecules/SearchBar'
31
+ export { default as CategoriesWrapper } from './components/molecules/CategoriesWrapper'
32
+ export { default as CategoryIndex } from './components/molecules/CategoryIndex'
30
33
 
31
34
  //common
32
35
  export { default as PortalComponent } from './components/common/PortalComponent'