oddsgate-ds 1.0.208 → 1.0.210

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,5 +1,7 @@
1
- /// <reference types="react" />
2
1
  export interface CategoriesWrapperProps {
3
2
  category: string;
4
- categoryItems: React.ReactNode[];
3
+ categoryItems: {
4
+ title: string;
5
+ slug: string;
6
+ }[];
5
7
  }
@@ -1,14 +1,4 @@
1
1
  import React from 'react';
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
- noResults?: boolean;
11
- backToTopButton?: boolean;
12
- };
2
+ import { GlossaryProps } from './Glossary.interface';
13
3
  export declare const Glossary: React.FC<GlossaryProps>;
14
4
  export default Glossary;
@@ -18,5 +18,18 @@ 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;
21
34
  };
22
35
  export {};
package/dist/types.d.ts CHANGED
@@ -720,17 +720,41 @@ 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
+ };
723
733
  type GlossaryProps = {
734
+ items: GlossaryItem[];
735
+ categories: {
736
+ name: string;
737
+ items: {
738
+ slug: string;
739
+ name: string;
740
+ }[];
741
+ }[];
742
+ placeholder?: string;
724
743
  searchTerm: string;
725
744
  setSearchTerm: (term: string) => void;
726
745
  selectedCategory: string | null;
727
746
  setSelectedCategory: (cat: string | null) => void;
728
- categoryData: Record<string, string[]>;
747
+ categoryData: Record<string, {
748
+ title: string;
749
+ slug: string;
750
+ }[]>;
729
751
  displayedCategories: string[];
730
- placeholder?: string;
731
752
  noResults?: boolean;
732
753
  backToTopButton?: boolean;
754
+ noResultsText?: string;
755
+ tryAnotherLetterText?: string;
733
756
  };
757
+
734
758
  declare const Glossary: React__default.FC<GlossaryProps>;
735
759
 
736
760
  declare const iconsList: string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oddsgate-ds",
3
- "version": "1.0.208",
3
+ "version": "1.0.210",
4
4
  "description": "Miew theme component library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -24,7 +24,9 @@ const CategoriesWrapper: React.FC<CategoriesWrapperProps> = ({
24
24
  <StyledCategoryContent>
25
25
  {categoryItems.map((item, index) => (
26
26
  <StyledCategoryItem key={index}>
27
- <Button variant="text">{item}</Button>
27
+ <Button as="a" href={item.slug} variant="text">
28
+ {item.title}
29
+ </Button>
28
30
  </StyledCategoryItem>
29
31
  ))}
30
32
  </StyledCategoryContent>
@@ -34,4 +36,4 @@ const CategoriesWrapper: React.FC<CategoriesWrapperProps> = ({
34
36
  )
35
37
  }
36
38
 
37
- export default CategoriesWrapper;
39
+ export default CategoriesWrapper
@@ -1,4 +1,4 @@
1
1
  export interface CategoriesWrapperProps {
2
2
  category: string
3
- categoryItems: React.ReactNode[]
4
- }
3
+ categoryItems: { title: string; slug: string }[]
4
+ }
@@ -1,4 +1,4 @@
1
- import { colors } from '@/styles/variables'
1
+ import { colors, responsiveMedia } from '@/styles/variables'
2
2
  import styled from 'styled-components'
3
3
 
4
4
  export const StyledCategoryWrapper = styled.div`
@@ -12,8 +12,11 @@ export const StyledCategorySeparator = styled.div`
12
12
  align-items: center;
13
13
  width: 100%;
14
14
  gap: 0.75rem;
15
- font-size: 3rem;
15
+ font-size: 48px;
16
16
  font-weight: 700;
17
+ @media (max-width: ${responsiveMedia}) {
18
+ font-size: 32px;
19
+ }
17
20
  `
18
21
  export const StyledCategorySeparatorLine = styled.div`
19
22
  flex-grow: 1;
@@ -30,10 +33,16 @@ export const StyledCategoryContent = styled.div`
30
33
  `
31
34
  export const StyledCategoryItem = styled.div`
32
35
  & > button {
33
- height: 2.125rem;
34
- padding: 0.625rem 2.5rem;
35
- font-size: 1.5rem;
36
+ height: 34px;
37
+ padding: 10px 40px;
38
+ font-size: 24px;
36
39
  font-weight: 700;
37
40
  text-transform: none;
41
+
42
+ @media (max-width: ${responsiveMedia}) {
43
+ height: 28px;
44
+ font-size: 20px;
45
+ padding: 5px 20px;
46
+ }
38
47
  }
39
48
  `
@@ -10,11 +10,10 @@ const CategoryIndex: React.FC<CategoryIndexProps> = ({
10
10
  onChange,
11
11
  selectedCategory
12
12
  }) => {
13
- const allCategories = ['#', ...categories]
14
13
 
15
14
  return (
16
15
  <StyledGlossaryCategoryIndex>
17
- {allCategories.map(category => (
16
+ {categories.map(category => (
18
17
  <StyledGlossaryCategoryIndexItem
19
18
  onClick={() => onChange(category)}
20
19
  isSelected={
@@ -1,4 +1,4 @@
1
- import { colors } from '@/styles/variables'
1
+ import { colors, responsiveMedia } from '@/styles/variables'
2
2
  import styled from 'styled-components'
3
3
 
4
4
  type ItemProps = {
@@ -23,5 +23,8 @@ export const StyledGlossaryCategoryIndexItem = styled.div<ItemProps>`
23
23
  box-sizing: border-box;
24
24
  color: ${colors.gray20};
25
25
  font-weight: 700;
26
- font-size: 1.5rem;
26
+ font-size: 24px;
27
+ @media (max-width: ${responsiveMedia}) {
28
+ font-size: 20px;
29
+ }
27
30
  `
@@ -16,7 +16,7 @@ export const SearchInput = styled.input`
16
16
  border-radius: 62.5rem;
17
17
  border: none;
18
18
  background: ${colors.gray20};
19
- font-size: 0.9375rem;
19
+ font-size: 15px;
20
20
  color: ${colors.hellobar};
21
21
  &::placeholder {
22
22
  color: ${colors.hellobar};
@@ -13,18 +13,8 @@ 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'
16
17
 
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, string[]>
23
- displayedCategories: string[]
24
- placeholder?: string
25
- noResults?: boolean
26
- backToTopButton?: boolean
27
- }
28
18
 
29
19
  export const Glossary: React.FC<GlossaryProps> = ({
30
20
  searchTerm,
@@ -35,7 +25,9 @@ export const Glossary: React.FC<GlossaryProps> = ({
35
25
  displayedCategories,
36
26
  placeholder,
37
27
  noResults,
38
- backToTopButton
28
+ backToTopButton,
29
+ noResultsText,
30
+ tryAnotherLetterText
39
31
  }) => {
40
32
  const categoryNames = Object.keys(categoryData)
41
33
 
@@ -56,31 +48,39 @@ export const Glossary: React.FC<GlossaryProps> = ({
56
48
  />
57
49
  {noResults ? (
58
50
  <StyledNoResultsContainer>
59
- <StyledNoResultsTitle>No results found!</StyledNoResultsTitle>
60
- <StyledNoResultsSubtitle>Try another term</StyledNoResultsSubtitle>
51
+ <StyledNoResultsTitle>{noResultsText}</StyledNoResultsTitle>
52
+ <StyledNoResultsSubtitle>{tryAnotherLetterText}</StyledNoResultsSubtitle>
61
53
  </StyledNoResultsContainer>
62
54
  ) : (
63
- <StyledGlossaryCategories>
64
- {displayedCategories.map(category => (
65
- <CategoriesWrapper
66
- key={category}
67
- category={category}
68
- categoryItems={categoryData[category]}
69
- />
70
- ))}
71
- </StyledGlossaryCategories>
55
+ <>
56
+ <StyledGlossaryCategories>
57
+ {displayedCategories.map(category => (
58
+ <CategoriesWrapper
59
+ key={category}
60
+ category={category}
61
+ categoryItems={categoryData[category]}
62
+ />
63
+ ))}
64
+ </StyledGlossaryCategories>
65
+ <StyledBackButtonContainer>
66
+ <Button
67
+ variant="text"
68
+ onClick={() => {
69
+ window.scrollTo({ top: 0, behavior: 'smooth' })
70
+ }}
71
+ rightIcon={
72
+ <Icon
73
+ icon="icon-arrowDown"
74
+ className="ml-12"
75
+ style={{ width: '14px' }}
76
+ />
77
+ }
78
+ >
79
+ {backToTopButton}
80
+ </Button>
81
+ </StyledBackButtonContainer>
82
+ </>
72
83
  )}
73
- <StyledBackButtonContainer>
74
- <Button
75
- variant="text"
76
- onClick={() => {
77
- window.scrollTo({ top: 0, behavior: 'smooth' })
78
- }}
79
- rightIcon={<Icon icon="icon-arrowDown" className='ml-12' style={{width: '14px' }}/>}
80
- >
81
- {backToTopButton}
82
- </Button>
83
- </StyledBackButtonContainer>
84
84
  </StyledGlossary>
85
85
  )
86
86
  }
@@ -7,4 +7,14 @@ 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
10
20
  }
@@ -1,4 +1,4 @@
1
- import { colors, typography } from '@/styles/variables'
1
+ import { colors, responsiveMedia, typography } from '@/styles/variables'
2
2
  import styled from 'styled-components'
3
3
 
4
4
  export const StyledGlossary = styled.div`
@@ -20,8 +20,12 @@ export const StyledNoResultsContainer = styled.div`
20
20
  flex-direction: column;
21
21
  align-items: center;
22
22
  justify-content: center;
23
- margin-top: 6rem;
24
- margin-bottom: 6rem;
23
+ margin-top: 96px;
24
+ margin-bottom: 120px;
25
+ @media (max-width: ${responsiveMedia}) {
26
+ margin-top: 64x;
27
+ margin-bottom: 80px;
28
+ }
25
29
  `
26
30
  export const StyledNoResultsTitle = styled.h1`
27
31
  color: ${colors.primary50};
@@ -34,10 +38,10 @@ export const StyledNoResultsTitle = styled.h1`
34
38
  `
35
39
  export const StyledNoResultsSubtitle = styled.h4`
36
40
  color: ${colors.gray20};
37
- font-size: 2.25rem;
41
+ font-size: 36px;
38
42
  font-weight: 700;
39
- @media (max-width: 600px) {
40
- font-size: 1.5rem;
43
+ @media (max-width: ${responsiveMedia}) {
44
+ font-size: 24px;
41
45
  }
42
46
  `
43
47
  export const StyledBackButtonContainer = styled.div`