oddsgate-ds 1.0.156 → 1.0.158
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 +5 -5
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/atoms/Spacer/Spacer.component.d.ts +1 -1
- package/dist/cjs/types/components/atoms/Spacer/Spacer.interface.d.ts +10 -0
- package/dist/cjs/types/components/atoms/Spacer/Spacer.theme.d.ts +2 -2
- package/dist/cjs/types/components/atoms/SpacerOld/Spacer.component.d.ts +4 -0
- package/dist/cjs/types/components/atoms/SpacerOld/Spacer.interface.d.ts +10 -0
- package/dist/cjs/types/components/atoms/SpacerOld/Spacer.theme.d.ts +3 -0
- package/dist/cjs/types/components/atoms/SpacerOld/index.d.ts +1 -0
- package/dist/esm/index.js +5 -5
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/atoms/Spacer/Spacer.component.d.ts +1 -1
- package/dist/esm/types/components/atoms/Spacer/Spacer.interface.d.ts +10 -0
- package/dist/esm/types/components/atoms/Spacer/Spacer.theme.d.ts +2 -2
- package/dist/esm/types/components/atoms/SpacerOld/Spacer.component.d.ts +4 -0
- package/dist/esm/types/components/atoms/SpacerOld/Spacer.interface.d.ts +10 -0
- package/dist/esm/types/components/atoms/SpacerOld/Spacer.theme.d.ts +3 -0
- package/dist/esm/types/components/atoms/SpacerOld/index.d.ts +1 -0
- package/dist/types.d.ts +5 -1
- package/package.json +1 -1
- package/src/components/atoms/Spacer/Spacer.component.tsx +20 -13
- package/src/components/atoms/Spacer/Spacer.interface.ts +14 -1
- package/src/components/atoms/Spacer/Spacer.stories.tsx +86 -15
- package/src/components/atoms/Spacer/Spacer.theme.ts +30 -4
- package/src/components/atoms/SpacerOld/Spacer.component.tsx +27 -0
- package/src/components/atoms/SpacerOld/Spacer.interface.ts +11 -0
- package/src/components/atoms/SpacerOld/Spacer.stories.tsx +28 -0
- package/src/components/atoms/SpacerOld/Spacer.theme.ts +7 -0
- package/src/components/atoms/SpacerOld/index.ts +1 -0
- package/src/components/organisms/Tabs/Tabs.theme.ts +1 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ISpacer } from './Spacer.interface';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
declare const Spacer: ({ id, color, customHeight, height, className,
|
|
3
|
+
declare const Spacer: ({ id, color, customHeight, customHeightTablet, customHeightMobile, height, className, gradient }: ISpacer) => React.JSX.Element;
|
|
4
4
|
export default Spacer;
|
|
@@ -2,9 +2,19 @@ import { CSSProperties } from 'react';
|
|
|
2
2
|
import { spaces } from '@/styles/variables';
|
|
3
3
|
export type ISpacer = {
|
|
4
4
|
id?: string;
|
|
5
|
+
anchor?: string;
|
|
5
6
|
color?: string;
|
|
6
7
|
height?: keyof typeof spaces | string | number;
|
|
7
8
|
customHeight?: string;
|
|
9
|
+
customHeightTablet?: string;
|
|
10
|
+
customHeightMobile?: string;
|
|
8
11
|
className?: string;
|
|
9
12
|
style?: CSSProperties;
|
|
13
|
+
gradient?: string;
|
|
14
|
+
};
|
|
15
|
+
export type ISCSpacer = {
|
|
16
|
+
$color: ISpacer['color'];
|
|
17
|
+
$height: ISpacer['height'];
|
|
18
|
+
$customHeightTablet: ISpacer['customHeightTablet'];
|
|
19
|
+
$customHeightMobile: ISpacer['customHeightMobile'];
|
|
10
20
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
export declare const StyledSpacer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>,
|
|
2
|
+
import { ISCSpacer } from "./Spacer.interface";
|
|
3
|
+
export declare const StyledSpacer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, ISCSpacer>> & string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
import { spaces } from '@/styles/variables';
|
|
3
|
+
export type ISpacer = {
|
|
4
|
+
id?: string;
|
|
5
|
+
color?: string;
|
|
6
|
+
height?: keyof typeof spaces | string | number;
|
|
7
|
+
customHeight?: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
style?: CSSProperties;
|
|
10
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ISpacer } from './Spacer.interface';
|
|
3
|
+
export declare const StyledSpacer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, ISpacer>> & string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./Spacer.component";
|
package/dist/types.d.ts
CHANGED
|
@@ -162,14 +162,18 @@ declare const Button: ({ id, as, children, variant, mode, outlined, leftIcon, ri
|
|
|
162
162
|
|
|
163
163
|
type ISpacer = {
|
|
164
164
|
id?: string;
|
|
165
|
+
anchor?: string;
|
|
165
166
|
color?: string;
|
|
166
167
|
height?: keyof typeof spaces$1 | string | number;
|
|
167
168
|
customHeight?: string;
|
|
169
|
+
customHeightTablet?: string;
|
|
170
|
+
customHeightMobile?: string;
|
|
168
171
|
className?: string;
|
|
169
172
|
style?: CSSProperties;
|
|
173
|
+
gradient?: string;
|
|
170
174
|
};
|
|
171
175
|
|
|
172
|
-
declare const Spacer: ({ id, color, customHeight, height, className,
|
|
176
|
+
declare const Spacer: ({ id, color, customHeight, customHeightTablet, customHeightMobile, height, className, gradient }: ISpacer) => React__default.JSX.Element;
|
|
173
177
|
|
|
174
178
|
type ISeparator = {
|
|
175
179
|
color?: string;
|
package/package.json
CHANGED
|
@@ -1,27 +1,34 @@
|
|
|
1
|
-
import { ISpacer } from './Spacer.interface'
|
|
2
|
-
import React from 'react'
|
|
3
|
-
import { StyledSpacer } from './Spacer.theme'
|
|
1
|
+
import { ISpacer } from './Spacer.interface';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { StyledSpacer } from './Spacer.theme';
|
|
4
4
|
|
|
5
5
|
const Spacer = ({
|
|
6
6
|
id,
|
|
7
|
-
color,
|
|
7
|
+
color = 'transparent',
|
|
8
8
|
customHeight,
|
|
9
|
+
customHeightTablet,
|
|
10
|
+
customHeightMobile,
|
|
9
11
|
height,
|
|
10
12
|
className,
|
|
11
|
-
|
|
13
|
+
gradient
|
|
14
|
+
|
|
12
15
|
}: ISpacer) => {
|
|
16
|
+
|
|
17
|
+
const actualHeight = customHeight ?? `var(--space-${String(height)})`;
|
|
18
|
+
const actualHeightTablet = customHeightTablet ?? actualHeight;
|
|
19
|
+
const actualHeightMobile = customHeightMobile ?? actualHeight;
|
|
20
|
+
|
|
13
21
|
return (
|
|
14
22
|
<StyledSpacer
|
|
15
23
|
id={id}
|
|
24
|
+
$color={ gradient ? gradient : color}
|
|
25
|
+
$height={actualHeight}
|
|
26
|
+
$customHeightTablet={actualHeightTablet}
|
|
27
|
+
$customHeightMobile={actualHeightMobile}
|
|
16
28
|
className={className}
|
|
17
|
-
style={{
|
|
18
|
-
backgroundColor: color ? color : ``,
|
|
19
|
-
height: customHeight ? customHeight : `var(--space-${String(height)})`
|
|
20
|
-
}}
|
|
21
29
|
aria-hidden="true"
|
|
22
|
-
{...props}
|
|
23
30
|
/>
|
|
24
|
-
)
|
|
25
|
-
}
|
|
31
|
+
);
|
|
32
|
+
};
|
|
26
33
|
|
|
27
|
-
export default Spacer
|
|
34
|
+
export default Spacer;
|
|
@@ -3,9 +3,22 @@ import { spaces } from '@/styles/variables';
|
|
|
3
3
|
|
|
4
4
|
export type ISpacer = {
|
|
5
5
|
id?: string
|
|
6
|
+
anchor?: string
|
|
6
7
|
color?: string
|
|
7
8
|
height?: keyof typeof spaces | string | number
|
|
8
9
|
customHeight?: string
|
|
10
|
+
customHeightTablet?: string
|
|
11
|
+
customHeightMobile?: string
|
|
9
12
|
className?: string;
|
|
10
|
-
style?: CSSProperties
|
|
13
|
+
style?: CSSProperties;
|
|
14
|
+
gradient?: string;
|
|
11
15
|
}
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
export type ISCSpacer = {
|
|
20
|
+
$color: ISpacer['color'];
|
|
21
|
+
$height: ISpacer['height'];
|
|
22
|
+
$customHeightTablet: ISpacer['customHeightTablet'];
|
|
23
|
+
$customHeightMobile: ISpacer['customHeightMobile'];
|
|
24
|
+
};
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
import React from 'react'
|
|
5
|
-
import Spacer from '../Spacer/Spacer.component'
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import Spacer from '../Spacer/Spacer.component';
|
|
6
4
|
|
|
7
5
|
// More on default export: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
8
6
|
export default {
|
|
@@ -10,19 +8,92 @@ export default {
|
|
|
10
8
|
component: Spacer,
|
|
11
9
|
tags: ['autodocs'],
|
|
12
10
|
argTypes: {
|
|
11
|
+
color: {
|
|
12
|
+
control: 'color',
|
|
13
|
+
description: 'Background color of the spacer',
|
|
14
|
+
table: {
|
|
15
|
+
type: { summary: 'string' },
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
gradient: {
|
|
19
|
+
control: 'select',
|
|
20
|
+
description: 'Background gradient of the spacer',
|
|
21
|
+
options: {
|
|
22
|
+
none: '',
|
|
23
|
+
Gradient: "linear-gradient(to right, #6776F7 0%, #FDBFFE 28%, #FC4D11 64%, #FFFD1C 100%)",
|
|
24
|
+
InvertedGradient: "linear-gradient(to left, #6776F7 0%, #FDBFFE 28%, #FC4D11 64%, #FFFD1C 100%)",
|
|
25
|
+
}
|
|
26
|
+
},
|
|
13
27
|
height: {
|
|
14
|
-
control: 'text'
|
|
28
|
+
control: 'text',
|
|
29
|
+
description: 'Default height of the spacer',
|
|
30
|
+
table: {
|
|
31
|
+
type: { summary: 'string' },
|
|
32
|
+
},
|
|
15
33
|
},
|
|
16
|
-
|
|
17
|
-
control: '
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
34
|
+
customHeight: {
|
|
35
|
+
control: 'text',
|
|
36
|
+
description: 'Custom height of the spacer',
|
|
37
|
+
table: {
|
|
38
|
+
type: { summary: 'string' },
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
customHeightTablet: {
|
|
42
|
+
control: 'text',
|
|
43
|
+
description: 'Custom height for tablets',
|
|
44
|
+
table: {
|
|
45
|
+
type: { summary: 'string' },
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
customHeightMobile: {
|
|
49
|
+
control: 'text',
|
|
50
|
+
description: 'Custom height for mobile devices',
|
|
51
|
+
table: {
|
|
52
|
+
type: { summary: 'string' },
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
}
|
|
21
57
|
|
|
22
|
-
export const Simple: StoryObj<
|
|
58
|
+
export const Simple: StoryObj<typeof Spacer> = {
|
|
23
59
|
render: args => <Spacer {...args} />,
|
|
24
60
|
args: {
|
|
61
|
+
color: '#000',
|
|
62
|
+
height: '20px',
|
|
25
63
|
customHeight: '50px',
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
64
|
+
customHeightTablet: '40px',
|
|
65
|
+
customHeightMobile: '30px',
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
export const Gradient: StoryObj<typeof Spacer> = {
|
|
69
|
+
render: args => <Spacer {...args} />,
|
|
70
|
+
args: {
|
|
71
|
+
color: 'linear-gradient(to right, #6776F7 0%, #FDBFFE 28%, #FC4D11 64%, #FFFD1C 100%)',
|
|
72
|
+
height: '20px',
|
|
73
|
+
customHeight: '50px',
|
|
74
|
+
customHeightTablet: '40px',
|
|
75
|
+
customHeightMobile: '30px',
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export const WithDifferentHeights: StoryObj<typeof Spacer> = {
|
|
80
|
+
render: args => <Spacer {...args} />,
|
|
81
|
+
args: {
|
|
82
|
+
color: '#f00',
|
|
83
|
+
height: '30px',
|
|
84
|
+
customHeight: '60px',
|
|
85
|
+
customHeightTablet: "500px",
|
|
86
|
+
customHeightMobile: '500px',
|
|
87
|
+
},
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export const CustomColorAndHeight: StoryObj<typeof Spacer> = {
|
|
91
|
+
render: args => <Spacer {...args} />,
|
|
92
|
+
args: {
|
|
93
|
+
color: '#00f',
|
|
94
|
+
height: '10px',
|
|
95
|
+
customHeight: '20px',
|
|
96
|
+
customHeightTablet: '15px',
|
|
97
|
+
customHeightMobile: '10px',
|
|
98
|
+
},
|
|
99
|
+
};
|
|
@@ -1,7 +1,33 @@
|
|
|
1
|
-
import styled, { css } from
|
|
1
|
+
import styled, { css } from "styled-components";
|
|
2
|
+
import { ISCSpacer } from "./Spacer.interface";
|
|
3
|
+
import { variables } from "@/index";
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
export const StyledSpacer = styled.div<ISCSpacer>`
|
|
6
|
+
${({ $color }) =>
|
|
7
|
+
$color &&
|
|
8
|
+
css`
|
|
9
|
+
background: ${$color};
|
|
10
|
+
`}
|
|
4
11
|
|
|
5
|
-
|
|
6
|
-
|
|
12
|
+
${({ $height }) =>
|
|
13
|
+
css`
|
|
14
|
+
height: ${$height};
|
|
15
|
+
`}
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
${({ $customHeightTablet }) =>
|
|
19
|
+
$customHeightTablet &&
|
|
20
|
+
css`
|
|
21
|
+
@media (max-width: ${variables.desktop_width}px) {
|
|
22
|
+
height: ${$customHeightTablet};
|
|
23
|
+
}
|
|
24
|
+
`}
|
|
25
|
+
|
|
26
|
+
${({ $customHeightMobile }) =>
|
|
27
|
+
$customHeightMobile &&
|
|
28
|
+
css`
|
|
29
|
+
@media (max-width: ${variables.tablet_width}px) {
|
|
30
|
+
height: ${$customHeightMobile};
|
|
31
|
+
}
|
|
32
|
+
`}
|
|
7
33
|
`;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ISpacer } from './Spacer.interface'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
import { StyledSpacer } from './Spacer.theme'
|
|
4
|
+
|
|
5
|
+
const Spacer = ({
|
|
6
|
+
id,
|
|
7
|
+
color,
|
|
8
|
+
customHeight,
|
|
9
|
+
height,
|
|
10
|
+
className,
|
|
11
|
+
...props
|
|
12
|
+
}: ISpacer) => {
|
|
13
|
+
return (
|
|
14
|
+
<StyledSpacer
|
|
15
|
+
id={id}
|
|
16
|
+
className={className}
|
|
17
|
+
style={{
|
|
18
|
+
backgroundColor: color ? color : ``,
|
|
19
|
+
height: customHeight ? customHeight : `var(--space-${String(height)})`
|
|
20
|
+
}}
|
|
21
|
+
aria-hidden="true"
|
|
22
|
+
{...props}
|
|
23
|
+
/>
|
|
24
|
+
)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export default Spacer
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
import { spaces } from '@/styles/variables';
|
|
3
|
+
|
|
4
|
+
export type ISpacer = {
|
|
5
|
+
id?: string
|
|
6
|
+
color?: string
|
|
7
|
+
height?: keyof typeof spaces | string | number
|
|
8
|
+
customHeight?: string
|
|
9
|
+
className?: string;
|
|
10
|
+
style?: CSSProperties
|
|
11
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
+
|
|
3
|
+
import { ISpacer } from '../Spacer/Spacer.interface'
|
|
4
|
+
import React from 'react'
|
|
5
|
+
import Spacer from '../Spacer/Spacer.component'
|
|
6
|
+
|
|
7
|
+
// More on default export: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
8
|
+
export default {
|
|
9
|
+
title: 'Components/Spacer',
|
|
10
|
+
component: Spacer,
|
|
11
|
+
tags: ['autodocs'],
|
|
12
|
+
argTypes: {
|
|
13
|
+
height: {
|
|
14
|
+
control: 'text'
|
|
15
|
+
},
|
|
16
|
+
color: {
|
|
17
|
+
control: 'color'
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
} as Meta
|
|
21
|
+
|
|
22
|
+
export const Simple: StoryObj<ISpacer> = {
|
|
23
|
+
render: args => <Spacer {...args} />,
|
|
24
|
+
args: {
|
|
25
|
+
customHeight: '50px',
|
|
26
|
+
color: '#000'
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./Spacer.component";
|