oddsgate-ds 1.0.215 → 1.0.217
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/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/organisms/Glossary/Glossary.component.d.ts +1 -15
- package/dist/cjs/types/components/organisms/Glossary/Glossary.interface.d.ts +13 -17
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/organisms/Glossary/Glossary.component.d.ts +1 -15
- package/dist/esm/types/components/organisms/Glossary/Glossary.interface.d.ts +13 -17
- package/dist/types.d.ts +10 -6
- package/package.json +1 -1
- package/src/components/organisms/Glossary/Glossary.component.tsx +7 -15
- package/src/components/organisms/Glossary/Glossary.interface.ts +14 -4
- package/src/components/organisms/Glossary/Glossary.stories.tsx +0 -5
|
@@ -1,18 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
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
|
-
placeholder?: string;
|
|
12
|
-
noResults?: boolean;
|
|
13
|
-
backToTopButton?: boolean;
|
|
14
|
-
noResultsText?: string;
|
|
15
|
-
tryAnotherLetterText?: string;
|
|
16
|
-
};
|
|
2
|
+
import { GlossaryProps } from './Glossary.interface';
|
|
17
3
|
export declare const Glossary: React.FC<GlossaryProps>;
|
|
18
4
|
export default Glossary;
|
|
@@ -1,22 +1,18 @@
|
|
|
1
|
-
type GlossaryItem = {
|
|
1
|
+
export type GlossaryItem = {
|
|
2
2
|
title: string;
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
name: string;
|
|
8
|
-
}[];
|
|
9
|
-
}[];
|
|
3
|
+
slug: string;
|
|
4
|
+
};
|
|
5
|
+
export type GlossaryCategoryData = {
|
|
6
|
+
[category: string]: GlossaryItem[];
|
|
10
7
|
};
|
|
11
8
|
export type GlossaryProps = {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
name: string;
|
|
18
|
-
}[];
|
|
19
|
-
}[];
|
|
9
|
+
searchTerm: string;
|
|
10
|
+
setSearchTerm: (term: string) => void;
|
|
11
|
+
selectedCategory: string | null;
|
|
12
|
+
setSelectedCategory: (cat: string | null) => void;
|
|
13
|
+
categoryData: GlossaryCategoryData;
|
|
20
14
|
placeholder?: string;
|
|
15
|
+
backToTopButton?: string;
|
|
16
|
+
noResultsText?: string;
|
|
17
|
+
tryAnotherLetterText?: string;
|
|
21
18
|
};
|
|
22
|
-
export {};
|
package/dist/types.d.ts
CHANGED
|
@@ -746,21 +746,25 @@ type IProductsSlider = {
|
|
|
746
746
|
|
|
747
747
|
declare const ProductsSlider: ({ content, style, className, }: IProductsSlider) => React__default.JSX.Element;
|
|
748
748
|
|
|
749
|
+
type GlossaryItem = {
|
|
750
|
+
title: string;
|
|
751
|
+
slug: string;
|
|
752
|
+
};
|
|
753
|
+
type GlossaryCategoryData = {
|
|
754
|
+
[category: string]: GlossaryItem[];
|
|
755
|
+
};
|
|
749
756
|
type GlossaryProps = {
|
|
750
757
|
searchTerm: string;
|
|
751
758
|
setSearchTerm: (term: string) => void;
|
|
752
759
|
selectedCategory: string | null;
|
|
753
760
|
setSelectedCategory: (cat: string | null) => void;
|
|
754
|
-
categoryData:
|
|
755
|
-
title: string;
|
|
756
|
-
slug: string;
|
|
757
|
-
}[]>;
|
|
761
|
+
categoryData: GlossaryCategoryData;
|
|
758
762
|
placeholder?: string;
|
|
759
|
-
|
|
760
|
-
backToTopButton?: boolean;
|
|
763
|
+
backToTopButton?: string;
|
|
761
764
|
noResultsText?: string;
|
|
762
765
|
tryAnotherLetterText?: string;
|
|
763
766
|
};
|
|
767
|
+
|
|
764
768
|
declare const Glossary: React__default.FC<GlossaryProps>;
|
|
765
769
|
|
|
766
770
|
declare const iconsList: string[];
|
package/package.json
CHANGED
|
@@ -7,25 +7,12 @@ import {
|
|
|
7
7
|
StyledNoResultsSubtitle,
|
|
8
8
|
StyledNoResultsTitle
|
|
9
9
|
} from './Glossary.themes'
|
|
10
|
-
|
|
11
10
|
import SearchBar from '@/components/molecules/SearchBar/SearchBar.component'
|
|
12
11
|
import GlossaryCategoryIndex from '@/components/molecules/CategoryIndex/CategoryIndex.component'
|
|
13
12
|
import CategoriesWrapper from '@/components/molecules/CategoriesWrapper/CategoriesWrapper.component'
|
|
14
13
|
import Button from '@/components/atoms/Button'
|
|
15
14
|
import Icon from '@/components/atoms/Icon'
|
|
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
|
-
placeholder?: string
|
|
24
|
-
noResults?: boolean
|
|
25
|
-
backToTopButton?: boolean
|
|
26
|
-
noResultsText?: string
|
|
27
|
-
tryAnotherLetterText?: string
|
|
28
|
-
}
|
|
15
|
+
import { GlossaryProps } from './Glossary.interface'
|
|
29
16
|
|
|
30
17
|
export const Glossary: React.FC<GlossaryProps> = ({
|
|
31
18
|
searchTerm,
|
|
@@ -34,12 +21,17 @@ export const Glossary: React.FC<GlossaryProps> = ({
|
|
|
34
21
|
setSelectedCategory,
|
|
35
22
|
categoryData,
|
|
36
23
|
placeholder,
|
|
37
|
-
noResults,
|
|
38
24
|
backToTopButton,
|
|
39
25
|
noResultsText,
|
|
40
26
|
tryAnotherLetterText
|
|
41
27
|
}) => {
|
|
28
|
+
|
|
42
29
|
const categoryNames = Object.keys(categoryData)
|
|
30
|
+
|
|
31
|
+
const noResults = categoryNames.every(
|
|
32
|
+
category => !categoryData[category] || categoryData[category].length === 0
|
|
33
|
+
)
|
|
34
|
+
|
|
43
35
|
return (
|
|
44
36
|
<StyledGlossary>
|
|
45
37
|
<SearchBar
|
|
@@ -1,10 +1,20 @@
|
|
|
1
|
-
type GlossaryItem = {
|
|
1
|
+
export type GlossaryItem = {
|
|
2
2
|
title: string
|
|
3
|
-
|
|
3
|
+
slug: string
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export type GlossaryCategoryData = {
|
|
7
|
+
[category: string]: GlossaryItem[]
|
|
4
8
|
}
|
|
5
9
|
|
|
6
10
|
export type GlossaryProps = {
|
|
7
|
-
|
|
8
|
-
|
|
11
|
+
searchTerm: string
|
|
12
|
+
setSearchTerm: (term: string) => void
|
|
13
|
+
selectedCategory: string | null
|
|
14
|
+
setSelectedCategory: (cat: string | null) => void
|
|
15
|
+
categoryData: GlossaryCategoryData
|
|
9
16
|
placeholder?: string
|
|
17
|
+
backToTopButton?: string
|
|
18
|
+
noResultsText?: string
|
|
19
|
+
tryAnotherLetterText?: string
|
|
10
20
|
}
|
|
@@ -72,9 +72,6 @@ const Template = (args: any) => {
|
|
|
72
72
|
})
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
// Determine if there are no results
|
|
76
|
-
const noResults = Object.keys(filteredCategoryData).length === 0
|
|
77
|
-
|
|
78
75
|
return (
|
|
79
76
|
<Glossary
|
|
80
77
|
{...args}
|
|
@@ -83,7 +80,6 @@ const Template = (args: any) => {
|
|
|
83
80
|
selectedCategory={selectedCategory}
|
|
84
81
|
setSelectedCategory={setSelectedCategory}
|
|
85
82
|
categoryData={filteredCategoryData}
|
|
86
|
-
noResults={noResults}
|
|
87
83
|
/>
|
|
88
84
|
)
|
|
89
85
|
}
|
|
@@ -92,7 +88,6 @@ export const Default: StoryObj = {
|
|
|
92
88
|
render: Template,
|
|
93
89
|
args: {
|
|
94
90
|
placeholder: 'Search glossary...',
|
|
95
|
-
noResults: false,
|
|
96
91
|
backToTopButton: 'Back to top',
|
|
97
92
|
noResultsText: 'No results found',
|
|
98
93
|
tryAnotherLetterText: 'Try another letter'
|