oddsgate-ds 1.0.215 → 1.0.216

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.
@@ -9,7 +9,6 @@ type GlossaryProps = {
9
9
  slug: string;
10
10
  }[]>;
11
11
  placeholder?: string;
12
- noResults?: boolean;
13
12
  backToTopButton?: boolean;
14
13
  noResultsText?: string;
15
14
  tryAnotherLetterText?: string;
package/dist/types.d.ts CHANGED
@@ -756,7 +756,6 @@ type GlossaryProps = {
756
756
  slug: string;
757
757
  }[]>;
758
758
  placeholder?: string;
759
- noResults?: boolean;
760
759
  backToTopButton?: boolean;
761
760
  noResultsText?: string;
762
761
  tryAnotherLetterText?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oddsgate-ds",
3
- "version": "1.0.215",
3
+ "version": "1.0.216",
4
4
  "description": "Miew theme component library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -21,7 +21,6 @@ type GlossaryProps = {
21
21
  setSelectedCategory: (cat: string | null) => void
22
22
  categoryData: Record<string, { title: string; slug: string }[]>
23
23
  placeholder?: string
24
- noResults?: boolean
25
24
  backToTopButton?: boolean
26
25
  noResultsText?: string
27
26
  tryAnotherLetterText?: string
@@ -34,12 +33,17 @@ export const Glossary: React.FC<GlossaryProps> = ({
34
33
  setSelectedCategory,
35
34
  categoryData,
36
35
  placeholder,
37
- noResults,
38
36
  backToTopButton,
39
37
  noResultsText,
40
38
  tryAnotherLetterText
41
39
  }) => {
40
+
42
41
  const categoryNames = Object.keys(categoryData)
42
+
43
+ const noResults = categoryNames.every(
44
+ category => !categoryData[category] || categoryData[category].length === 0
45
+ )
46
+
43
47
  return (
44
48
  <StyledGlossary>
45
49
  <SearchBar
@@ -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'