oddsgate-ds 1.0.220 → 1.0.221

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oddsgate-ds",
3
- "version": "1.0.220",
3
+ "version": "1.0.221",
4
4
  "description": "Miew theme component library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -10,14 +10,23 @@ const CategoryIndex: React.FC<CategoryIndexProps> = ({
10
10
  onChange,
11
11
  selectedCategory
12
12
  }) => {
13
+ // Find the numeric/symbol category - could be "0-9", "123", "#", etc.
14
+ const numericCategory = categories.find(
15
+ cat => /^[0-9#]/.test(cat) || cat === '0-9' || cat === '123'
16
+ )
17
+
13
18
  return (
14
19
  <StyledGlossaryCategoryIndex>
15
20
  {categories.map(category => (
16
21
  <StyledGlossaryCategoryIndexItem
17
- onClick={() => onChange(category)}
22
+ onClick={() =>
23
+ onChange(
24
+ category === '#' && numericCategory ? numericCategory : category
25
+ )
26
+ }
18
27
  isSelected={
19
28
  category === '#'
20
- ? selectedCategory === categories[0]
29
+ ? !!numericCategory && selectedCategory === numericCategory
21
30
  : selectedCategory === category
22
31
  }
23
32
  key={`category-${category}`}
@@ -3,6 +3,13 @@ import { Meta, StoryObj } from '@storybook/react'
3
3
  import Glossary from './Glossary.component'
4
4
 
5
5
  const categories = [
6
+ {
7
+ name: '#',
8
+ items: [
9
+ { name: '123', slug: '123' },
10
+ { name: '321', slug: '321' }
11
+ ]
12
+ },
6
13
  {
7
14
  name: 'A',
8
15
  items: [
@@ -16,7 +23,7 @@ const categories = [
16
23
  { name: 'Banana', slug: 'banana' },
17
24
  { name: 'Blueberry', slug: 'blueberry' }
18
25
  ]
19
- }
26
+ },
20
27
  ]
21
28
 
22
29
  // Helper to build categoryData from categories