@growth-angels/ds-core 1.5.4 → 1.6.1
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,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
export const Container = (props) => {
|
|
3
|
-
const { size, children, style, padding, margin, stretch } = props;
|
|
3
|
+
const { size, children, style, padding, margin, stretch, id } = props;
|
|
4
4
|
const classes = [
|
|
5
5
|
"ga-ds-container",
|
|
6
6
|
`ga-ds-container--${size}`,
|
|
@@ -9,5 +9,5 @@ export const Container = (props) => {
|
|
|
9
9
|
...(stretch ? [`ga-ds-container-stretch--${stretch}`] : []),
|
|
10
10
|
...(props.extraClassNames || []),
|
|
11
11
|
];
|
|
12
|
-
return (_jsx("div", { className: classes.join(" "), style: style, children: children }));
|
|
12
|
+
return (_jsx("div", { className: classes.join(" "), style: style, ...(id ? { id } : {}), children: children }));
|
|
13
13
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { WordpressDefault } from "../../global.types";
|
|
2
2
|
export type ContainerSize = 'large' | 'medium' | 'small' | 'full';
|
|
3
3
|
export type ContainerStretch = 'right' | 'left';
|
|
4
|
-
export interface ContainerProps extends WordpressDefault {
|
|
4
|
+
export interface ContainerProps extends WordpressDefault, React.HTMLAttributes<HTMLDivElement> {
|
|
5
5
|
size: ContainerSize;
|
|
6
6
|
stretch?: ContainerStretch;
|
|
7
7
|
children: React.ReactNode | React.ReactNode[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@growth-angels/ds-core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.1",
|
|
4
4
|
"description": "Design system by Growth Angels",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"private": false,
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"build-storybook": "storybook build"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@growth-angels/foundation": "1.
|
|
36
|
+
"@growth-angels/foundation": "1.1.1"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"react": ">=18"
|
package/src/atoms/Text/Text.scss
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
@use "@growth-angels/foundation/config" as *;
|
|
2
|
+
@use "sass:map";
|
|
3
|
+
|
|
1
4
|
.ga-ds-text {
|
|
2
5
|
font-size: var(--font-size, 1.6rem);
|
|
3
6
|
}
|
|
@@ -19,15 +22,31 @@
|
|
|
19
22
|
text-align: right;
|
|
20
23
|
}
|
|
21
24
|
|
|
22
|
-
$sizes: (
|
|
25
|
+
$sizes: map.get($fonts, "sizes");
|
|
23
26
|
|
|
24
27
|
@each $size in $sizes {
|
|
25
28
|
.ga-ds-text--size-#{$size} {
|
|
26
|
-
|
|
29
|
+
@if $size == 72 {
|
|
30
|
+
font-size: calc(11.2rem - clamp(4rem, 2.8732rem + 3.0047vw, calc(#{$size} / 10 * 1rem)));
|
|
31
|
+
}
|
|
32
|
+
@if $size == 56 {
|
|
33
|
+
font-size: calc(9.6rem - clamp(4rem, 3.4366rem + 1.5023vw, calc(#{$size} / 10 * 1rem)));
|
|
34
|
+
}
|
|
35
|
+
@if $size == 48 {
|
|
36
|
+
font-size: calc(8.4rem - clamp(3.6rem, 3.1775rem + 1.1268vw, calc(#{$size} / 10 * 1rem)));
|
|
37
|
+
}
|
|
38
|
+
@if $size == 40 {
|
|
39
|
+
font-size: calc(7.2rem - clamp(3.2rem, 2.9183rem + 0.7512vw, calc(#{$size} / 10 * 1rem)));
|
|
40
|
+
}
|
|
41
|
+
@if $size == 32 {
|
|
42
|
+
font-size: calc(6rem - clamp(2.8rem, 2.6592rem + 0.3756vw, calc(#{$size} / 10 * 1rem)));
|
|
43
|
+
} @else {
|
|
44
|
+
font-size: calc(#{$size} / 10 * 1rem);
|
|
45
|
+
}
|
|
27
46
|
}
|
|
28
47
|
}
|
|
29
48
|
|
|
30
|
-
$weights: (
|
|
49
|
+
$weights: map.get($fonts, "weights");
|
|
31
50
|
@each $weight in $weights {
|
|
32
51
|
.ga-ds-text--weight-#{$weight} {
|
|
33
52
|
font-weight: #{$weight};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ContainerProps } from "./Container.types"
|
|
2
2
|
|
|
3
3
|
export const Container = (props: ContainerProps) => {
|
|
4
|
-
const { size, children, style, padding, margin, stretch } = props
|
|
4
|
+
const { size, children, style, padding, margin, stretch, id } = props
|
|
5
5
|
const classes = [
|
|
6
6
|
"ga-ds-container",
|
|
7
7
|
`ga-ds-container--${size}`,
|
|
@@ -10,8 +10,9 @@ export const Container = (props: ContainerProps) => {
|
|
|
10
10
|
...(stretch ? [`ga-ds-container-stretch--${stretch}`] : []),
|
|
11
11
|
...(props.extraClassNames || []),
|
|
12
12
|
]
|
|
13
|
+
|
|
13
14
|
return (
|
|
14
|
-
<div className={classes.join(" ")} style={style}>
|
|
15
|
+
<div className={classes.join(" ")} style={style} {...(id ? { id } : {})}>
|
|
15
16
|
{children}
|
|
16
17
|
</div>
|
|
17
18
|
)
|
|
@@ -3,7 +3,7 @@ import { WordpressDefault } from "../../global.types";
|
|
|
3
3
|
export type ContainerSize = 'large' | 'medium' | 'small' | 'full';
|
|
4
4
|
export type ContainerStretch = 'right' | 'left'
|
|
5
5
|
|
|
6
|
-
export interface ContainerProps extends WordpressDefault {
|
|
6
|
+
export interface ContainerProps extends WordpressDefault, React.HTMLAttributes<HTMLDivElement> {
|
|
7
7
|
size: ContainerSize;
|
|
8
8
|
stretch?:ContainerStretch
|
|
9
9
|
children: React.ReactNode | React.ReactNode[];
|