oddsgate-ds 1.0.59 → 1.0.60

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 (28) hide show
  1. package/dist/cjs/index.js +5 -5
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/cjs/types/components/molecules/Card/Card.interface.d.ts +1 -0
  4. package/dist/cjs/types/components/molecules/NewsCard/NewsCard.stories.d.ts +1 -0
  5. package/dist/cjs/types/styles/variables.d.ts +1 -0
  6. package/dist/esm/index.js +5 -5
  7. package/dist/esm/index.js.map +1 -1
  8. package/dist/esm/types/components/molecules/Card/Card.interface.d.ts +1 -0
  9. package/dist/esm/types/components/molecules/NewsCard/NewsCard.stories.d.ts +1 -0
  10. package/dist/esm/types/styles/variables.d.ts +1 -0
  11. package/dist/types.d.ts +4 -0
  12. package/package.json +1 -1
  13. package/src/components/molecules/BlogCard/BlogCard.component.tsx +4 -1
  14. package/src/components/molecules/Card/Card.component.tsx +1 -1
  15. package/src/components/molecules/Card/Card.interface.ts +1 -0
  16. package/src/components/molecules/Card/Card.theme.ts +2 -1
  17. package/src/components/molecules/EventsCard/EventsCard.component.tsx +1 -1
  18. package/src/components/molecules/EventsCard/EventsCard.stories.tsx +1 -0
  19. package/src/components/molecules/EventsCard/EventsCard.theme.ts +1 -7
  20. package/src/components/molecules/NewsCard/NewsCard.component.tsx +4 -4
  21. package/src/components/molecules/NewsCard/NewsCard.stories.tsx +10 -0
  22. package/src/components/molecules/NewsCard/NewsCard.theme.ts +33 -0
  23. package/src/components/molecules/ShareModal/ShareModal.theme.ts +1 -1
  24. package/src/components/organisms/Slider/Slider.theme.ts +7 -11
  25. package/src/stories/Documentation/Colors.stories.tsx +14 -1
  26. package/src/styles/Global.ts +5 -0
  27. package/src/styles/utilities.ts +7 -0
  28. package/src/styles/variables.ts +8 -2
@@ -1,6 +1,7 @@
1
1
  import { CSSProperties } from 'react';
2
2
  export type ICard = {
3
3
  variant?: string;
4
+ $variant?: string;
4
5
  imageElement?: React.ReactElement;
5
6
  className?: string;
6
7
  style?: CSSProperties;
@@ -3,3 +3,4 @@ import { INewsCard } from './NewsCard.interface';
3
3
  declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react").ReactRenderer, import("@storybook/types").Args>;
4
4
  export default _default;
5
5
  export declare const Simple: StoryObj<INewsCard>;
6
+ export declare const Featured: StoryObj<INewsCard>;
@@ -17,6 +17,7 @@ export type IBreakpoints = {
17
17
  $xxl?: string;
18
18
  };
19
19
  export declare const colors: Record<string, string>;
20
+ export declare const gradients: Record<string, string>;
20
21
  export declare const spaces: Record<string, string>;
21
22
  export declare const spacesNegative: Record<string, string>;
22
23
  export declare const typography: Record<string, Record<string, unknown>>;
package/dist/types.d.ts CHANGED
@@ -22,6 +22,7 @@ type IBreakpoints = {
22
22
  $xxl?: string;
23
23
  };
24
24
  declare const colors: Record<string, string>;
25
+ declare const gradients: Record<string, string>;
25
26
  declare const spaces: Record<string, string>;
26
27
  declare const spacesNegative: Record<string, string>;
27
28
  declare const typography: Record<string, Record<string, unknown>>;
@@ -42,6 +43,7 @@ declare const variables_colors: typeof colors;
42
43
  declare const variables_desktop_width: typeof desktop_width;
43
44
  declare const variables_easeOutExpo: typeof easeOutExpo;
44
45
  declare const variables_fontName: typeof fontName;
46
+ declare const variables_gradients: typeof gradients;
45
47
  declare const variables_grid_conf: typeof grid_conf;
46
48
  declare const variables_gutter: typeof gutter;
47
49
  declare const variables_mobileMedia: typeof mobileMedia;
@@ -63,6 +65,7 @@ declare namespace variables {
63
65
  variables_desktop_width as desktop_width,
64
66
  variables_easeOutExpo as easeOutExpo,
65
67
  variables_fontName as fontName,
68
+ variables_gradients as gradients,
66
69
  variables_grid_conf as grid_conf,
67
70
  variables_gutter as gutter,
68
71
  variables_mobileMedia as mobileMedia,
@@ -481,6 +484,7 @@ declare const IconTitle: ({ label, icon, imageElement, className, style, childre
481
484
 
482
485
  type ICard = {
483
486
  variant?: string;
487
+ $variant?: string;
484
488
  imageElement?: React.ReactElement;
485
489
  className?: string;
486
490
  style?: CSSProperties;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oddsgate-ds",
3
- "version": "1.0.59",
3
+ "version": "1.0.60",
4
4
  "description": "Miew theme component library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -31,8 +31,11 @@ const BlogCard = ({
31
31
  <Heading tag={'h3'} size={'h4'} className={'fw-bold textEllipsis'}>
32
32
  {title}
33
33
  </Heading>
34
+ <Heading tag={'span'} size={'captions'} className={'textEllipsis mt-2'}>
35
+ {description}
36
+ </Heading>
34
37
  {date && (
35
- <RichText tag={'p'} className="fw-bold text-uppercase mt-6">
38
+ <RichText tag={'p'} className="fw-bold mt-3">
36
39
  {date}
37
40
  </RichText>
38
41
  )}
@@ -5,7 +5,7 @@ import React from 'react';
5
5
 
6
6
  const Card = ({ variant, imageElement, children, className, style, ...props }: ICard) => {
7
7
  return (
8
- <StyledFigure variant={variant} className={className} style={style}>
8
+ <StyledFigure $variant={variant} className={className} style={style}>
9
9
  {imageElement}
10
10
  <StyledFigcaption>{children}</StyledFigcaption>
11
11
  </StyledFigure>
@@ -2,6 +2,7 @@ import { CSSProperties } from 'react';
2
2
 
3
3
  export type ICard = {
4
4
  variant?: string
5
+ $variant?: string
5
6
  imageElement?: React.ReactElement
6
7
  className?: string
7
8
  style?: CSSProperties
@@ -1,6 +1,7 @@
1
1
  import styled, { css } from 'styled-components';
2
2
 
3
3
  import { ICard } from './Card.interface';
4
+ import { radius } from '@/styles/variables';
4
5
 
5
6
  export const StyledFigure = styled.figure<ICard>`
6
7
  position: relative;
@@ -8,7 +9,7 @@ export const StyledFigure = styled.figure<ICard>`
8
9
  margin-bottom: 1rem;
9
10
 
10
11
  picture{
11
- border-radius: 12px;
12
+ border-radius: ${radius.md};
12
13
  overflow:hidden;
13
14
 
14
15
  & img{
@@ -24,7 +24,7 @@ const EventsCard = ({
24
24
  }
25
25
  >
26
26
  {category && <Chip variant='dark' className='mb-5'>{category}</Chip>}
27
- <Heading tag={'span'} size={'h4'} className={'fw-bold textEllipsis'}>
27
+ <Heading tag={'h3'} size={'h4'} className={'fw-bold textEllipsis'}>
28
28
  {title}
29
29
  </Heading>
30
30
  {date && (
@@ -34,3 +34,4 @@ export const Simple: StoryObj<IEventsCard> = {
34
34
  linkElement: <a href="#" className="linker"></a>
35
35
  }
36
36
  }
37
+
@@ -5,9 +5,7 @@ import Card from '../Card/Card.component';
5
5
  import { IEventsCard } from './EventsCard.interface';
6
6
 
7
7
  export const StyledEventsCard = styled(Card) <IEventsCard>`
8
- padding: 8px;
9
- border-radius: 1.6rem;
10
- transition: all 0.3s;
8
+ padding: 0;
11
9
 
12
10
  picture{
13
11
  border-radius: 100%;
@@ -20,11 +18,7 @@ export const StyledEventsCard = styled(Card) <IEventsCard>`
20
18
 
21
19
 
22
20
  &:hover{
23
- background-color: ${colors.third10};
24
21
 
25
- & figcaption{
26
- color: ${colors.secondary50};
27
- }
28
22
  }
29
23
  `;
30
24
 
@@ -18,19 +18,19 @@ const NewsCard = ({
18
18
  }: INewsCard) => {
19
19
  return (
20
20
  <StyledNewsCard
21
- variant={variant}
21
+ $variant={variant}
22
22
  imageElement={
23
23
  <ImageWrapper aspectRatioHeight={63}>{imageElement}</ImageWrapper>
24
24
  }
25
25
  >
26
26
  {category && <Chip variant='light' className='mb-5'>{category}</Chip>}
27
- <Heading tag={'h3'} size={'h4'} className={'fw-bold textEllipsis'}>
27
+ <Heading tag={'h3'} size={variant === "featured" ? "h3" : 'h4'} className={'fw-bold textEllipsis'}>
28
28
  {title}
29
29
  </Heading>
30
30
  {date && (
31
- <RichText tag={'p'} className="text-end fw-bold mt-6">
31
+ <Heading tag={'span'} size={variant === "featured" ? "h5" : 'texts'} className={'fw-bold mt-3'}>
32
32
  {date}
33
- </RichText>
33
+ </Heading>
34
34
  )}
35
35
 
36
36
  {linkElement}
@@ -32,3 +32,13 @@ export const Simple: StoryObj<INewsCard> = {
32
32
  linkElement: <a href="#" className="linker"></a>
33
33
  }
34
34
  }
35
+
36
+ export const Featured: StoryObj<INewsCard> = {
37
+ render: args => (
38
+ <NewsCard {...args} style={{ maxWidth: '620px' }}></NewsCard>
39
+ ),
40
+ args: {
41
+ ...Simple.args,
42
+ variant: "featured"
43
+ }
44
+ }
@@ -23,6 +23,39 @@ export const StyledNewsCard = styled(Card) <INewsCard>`
23
23
 
24
24
  }
25
25
 
26
+ ${(props) => {
27
+ switch (props.$variant) {
28
+ case "primary": default:
29
+ return css`
30
+
31
+
32
+ `;
33
+ case "featured":
34
+ return css`
35
+ @media only screen and (min-width: ${responsiveMedia}) {
36
+
37
+ display: flex;
38
+ align-items:center;
39
+ flex-flow: row-reverse;
40
+
41
+ ${StyledChip}{
42
+ position: relative;
43
+ top: 0;
44
+ left: 0;
45
+ }
46
+
47
+ & picture{
48
+ width: 45%;
49
+ }
50
+ & figcaption{
51
+ width: 55%;
52
+ padding:1.6rem;
53
+ }
54
+ }
55
+ `;
56
+ }
57
+ }}
58
+
26
59
 
27
60
  &:hover{
28
61
  & figcaption{
@@ -49,7 +49,7 @@ export const StyledInput = styled.div<IShareModal>`
49
49
  position: relative;
50
50
  background: ${colors.white};
51
51
  border: 1px solid ${colors.primary20};
52
- border-radius: 6px;
52
+ border-radius: ${radius.sm};
53
53
  padding: ${spaces[2]} ${spaces[3]};
54
54
  cursor: pointer;
55
55
 
@@ -56,16 +56,12 @@ export const StyledSlider = styled.div<ISlider>`
56
56
  }
57
57
 
58
58
  .blaze-controls{
59
- position:absolute;
60
- top: auto;
61
- bottom: 1.2rem;
62
- left: 0;
63
-
64
59
  display:flex;
65
60
  align-items:center;
66
61
  justify-content: center;
67
62
  gap:16px;
68
63
  width: 100%;
64
+ margin-top:1rem;
69
65
  }
70
66
 
71
67
  /* pagination buttons */
@@ -75,10 +71,10 @@ export const StyledSlider = styled.div<ISlider>`
75
71
  gap:10px;
76
72
 
77
73
  button{
78
- width:32px;
79
- height:5px;
80
- background:${colors.primary20};
81
- border-radius:5px;
74
+ width:14px;
75
+ height:14px;
76
+ background:${colors.third10};
77
+ border-radius:100%;
82
78
  font-size: 0;
83
79
  padding:0;
84
80
  transition:all 0.3s ease;
@@ -88,10 +84,10 @@ export const StyledSlider = styled.div<ISlider>`
88
84
  cursor:pointer;
89
85
 
90
86
  &.hover{
91
- opacity: 0.6;
87
+ background-color: ${colors.primary50}
92
88
  }
93
89
  &.active{
94
- opacity: 0.6;
90
+ background-color: ${colors.primary50}
95
91
  }
96
92
  }
97
93
  }
@@ -1,8 +1,8 @@
1
1
  import type { Meta, StoryObj } from '@storybook/react'
2
+ import { colors, gradients } from '@/styles/variables'
2
3
 
3
4
  import Flex from '@/components/atoms/Flex'
4
5
  import React from 'react'
5
- import { colors } from '@/styles/variables'
6
6
 
7
7
  export default {
8
8
  title: 'Documentation/Colors',
@@ -26,6 +26,19 @@ export const Colors: StoryObj = {
26
26
  <span>{color}</span>
27
27
  </div>
28
28
  ))}
29
+ {gradients &&
30
+ Object.keys(gradients).map((gradient, i) => (
31
+ <div
32
+ key={`gradient-${i}`}
33
+ style={{
34
+ background: `var(--gradient-${gradient})`,
35
+ width: '100px',
36
+ height: '75px'
37
+ }}
38
+ >
39
+ <span>{gradient}</span>
40
+ </div>
41
+ ))}
29
42
  </Flex>
30
43
  </div>
31
44
  ),
@@ -3,6 +3,7 @@ import {
3
3
  colors,
4
4
  desktop_width,
5
5
  fontName,
6
+ gradients,
6
7
  mobile_width,
7
8
  radius,
8
9
  responsiveMedia,
@@ -28,6 +29,10 @@ const GlobalStyles = createGlobalStyle`
28
29
  (color, i) => `--color-${color}: ${Object.values(colors)[i]};`
29
30
  )}
30
31
 
32
+ ${Object.keys(gradients).map(
33
+ (gradient, i) => `--gradient-${gradient}: ${Object.values(gradients)[i]};`
34
+ )}
35
+
31
36
  ${Object.keys(typography).map(
32
37
  (typo, i) => `--fontSize-${typo}: ${Object.values(typography)[i].size};`
33
38
  )}
@@ -1,5 +1,6 @@
1
1
  import {
2
2
  colors,
3
+ gradients,
3
4
  grid_conf,
4
5
  radius,
5
6
  responsiveMedia,
@@ -288,6 +289,12 @@ export const utilities: {
288
289
  values: colors,
289
290
  important: true,
290
291
  },
292
+ "gradient": {
293
+ property: "background",
294
+ class: "gradient",
295
+ values: gradients,
296
+ important: true,
297
+ },
291
298
  "bg": {
292
299
  property: "background-color",
293
300
  class: "bg",
@@ -52,6 +52,12 @@ export const colors = <Record<string, string>>{
52
52
  error: '#E91101',
53
53
  };
54
54
 
55
+ export const gradients = <Record<string, string>>{
56
+ // Defaults
57
+ primary: 'linear-gradient(to bottom, var(--color-secondary50) 0%, var(--color-secondary50) 50%, var(--color-third50) 50%, var(--color-third50) 100%)',
58
+ };
59
+
60
+
55
61
  export const spaces = <Record<string, string>>{
56
62
  0: '0',
57
63
  1: pxToRem(4),
@@ -130,8 +136,8 @@ export const typography = <Record<string, Record<string, unknown>>>{
130
136
  };
131
137
 
132
138
  export const radius = <Record<string, string>>{
133
- sm: '6px',
134
- md: '10px',
139
+ sm: '12px',
140
+ md: '24px',
135
141
  lg: '48px',
136
142
  rounded: '100px',
137
143
  }