@documental-xyz/core 0.1.0
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/README.md +424 -0
- package/integration.ts +113 -0
- package/package.json +83 -0
- package/src/admin/admin.astro +29 -0
- package/src/assets/scripts/App.js +70 -0
- package/src/assets/scripts/EnteringAnimations.js +34 -0
- package/src/assets/scripts/MapBoxHandler.js +680 -0
- package/src/assets/scripts/ScrollProgressionBar.js +24 -0
- package/src/assets/scripts/utils/ScrollObserver.js +166 -0
- package/src/assets/styles/config/_breakpoints.scss +37 -0
- package/src/assets/styles/config/_colors.scss +8 -0
- package/src/assets/styles/config/_config.scss +5 -0
- package/src/assets/styles/config/_functions.scss +90 -0
- package/src/assets/styles/config/_grrr.configs.scss +7 -0
- package/src/assets/styles/config/_mixins.scss +207 -0
- package/src/assets/styles/config/_type.scss +175 -0
- package/src/assets/styles/config/_vars.scss +16 -0
- package/src/assets/styles/globals/_content.scss +47 -0
- package/src/assets/styles/globals/_grrr.scss +18 -0
- package/src/assets/styles/globals/_html.scss +25 -0
- package/src/assets/styles/globals/_lists.scss +19 -0
- package/src/assets/styles/globals/_map-anchors.scss +32 -0
- package/src/assets/styles/globals/_reset.scss +240 -0
- package/src/assets/styles/globals/_reveal-animations.scss +104 -0
- package/src/assets/styles/globals/_root.scss +6 -0
- package/src/assets/styles/globals/_scroll-progression-bar.scss +8 -0
- package/src/assets/styles/main.scss +17 -0
- package/src/assets/styles/utils/.gitkeep +0 -0
- package/src/assets/styles/utils/grrr/_grrr.scss +433 -0
- package/src/assets/styles/utils/list-styles/_list-styles.scss +190 -0
- package/src/components/AnimationToggle.astro +19 -0
- package/src/components/BigNumbers.astro +83 -0
- package/src/components/Button.astro +49 -0
- package/src/components/Caption.astro +15 -0
- package/src/components/Card.astro +68 -0
- package/src/components/Cards.astro +66 -0
- package/src/components/CardsCall.astro +125 -0
- package/src/components/ChartBar.astro +217 -0
- package/src/components/ChartPercentage.astro +137 -0
- package/src/components/Column.astro +54 -0
- package/src/components/ColumnSticky.astro +129 -0
- package/src/components/Columns.astro +139 -0
- package/src/components/Compare.astro +266 -0
- package/src/components/Cta.astro +242 -0
- package/src/components/Gallery.astro +594 -0
- package/src/components/Group.astro +140 -0
- package/src/components/HtmlEmbed.astro +98 -0
- package/src/components/ImageBlock.astro +134 -0
- package/src/components/InnerColumns.astro +54 -0
- package/src/components/LogosGroup.astro +102 -0
- package/src/components/Map.astro +321 -0
- package/src/components/MapBox.astro +96 -0
- package/src/components/MapView.astro +30 -0
- package/src/components/Menu.astro +278 -0
- package/src/components/Pullquote.astro +46 -0
- package/src/components/Slider.astro +223 -0
- package/src/components/Spacer.astro +25 -0
- package/src/components/Text.astro +173 -0
- package/src/components/TextPlaceholder.astro +98 -0
- package/src/components/Timeline.astro +73 -0
- package/src/components/TimelineBullet.astro +67 -0
- package/src/components/VideoEmbed.astro +99 -0
- package/src/content/loader.ts +29 -0
- package/src/content/pages/alter-ameacada.md +80 -0
- package/src/content/pages/expulsions.md +1447 -0
- package/src/content/pages/home.md +346 -0
- package/src/content/pages/nhanderekoa-studio-autonoma.md +3113 -0
- package/src/content/pages/nhanderekoa-terra-ind/303/255gena-jaragu/303/241.md +3806 -0
- package/src/content/pages/nova-landing-page.md +546 -0
- package/src/content/pages/territ/303/263rios-de-exce/303/247/303/243o.md +2199 -0
- package/src/content/pages/teste-alter-do-chao.md +955 -0
- package/src/content/pages/teste-layout.md +1484 -0
- package/src/content/pages/thiago.md +93 -0
- package/src/content/schema/blog.ts +11 -0
- package/src/content/schema/geostorys.ts +13 -0
- package/src/content/schema/index.ts +3 -0
- package/src/content/schema/pages.ts +494 -0
- package/src/content.config.ts +49 -0
- package/src/env.d.ts +1 -0
- package/src/integration/override-aliases.ts +67 -0
- package/src/layouts/components/ButtonLayout.astro +8 -0
- package/src/layouts/components/CardLayout.astro +8 -0
- package/src/layouts/components/CardsCallLayout.astro +26 -0
- package/src/layouts/components/CardsLayout.astro +14 -0
- package/src/layouts/components/ChartBarLayout.astro +21 -0
- package/src/layouts/components/ChartPercentageLayout.astro +17 -0
- package/src/layouts/components/ColumnLayout.astro +11 -0
- package/src/layouts/components/ColumnStickyLayout.astro +10 -0
- package/src/layouts/components/ColumnsLayout.astro +13 -0
- package/src/layouts/components/CompareLayout.astro +22 -0
- package/src/layouts/components/CtaLayout.astro +91 -0
- package/src/layouts/components/GalleryLayout.astro +24 -0
- package/src/layouts/components/GroupLayout.astro +53 -0
- package/src/layouts/components/HtmlEmbedLayout.astro +18 -0
- package/src/layouts/components/ImageBlockLayout.astro +20 -0
- package/src/layouts/components/InnerColumnsLayout.astro +14 -0
- package/src/layouts/components/LogosGroupLayout.astro +22 -0
- package/src/layouts/components/MapLayout.astro +41 -0
- package/src/layouts/components/MapViewLayout.astro +8 -0
- package/src/layouts/components/MapboxLayout.astro +248 -0
- package/src/layouts/components/PullquoteLayout.astro +13 -0
- package/src/layouts/components/SliderLayout.astro +18 -0
- package/src/layouts/components/SpacerLayout.astro +8 -0
- package/src/layouts/components/TextLayout.astro +17 -0
- package/src/layouts/components/TextPlaceholderLayout.astro +7 -0
- package/src/layouts/components/TimelineBulletLayout.astro +14 -0
- package/src/layouts/components/TimelineLayout.astro +10 -0
- package/src/layouts/components/VideoEmbedLayout.astro +28 -0
- package/src/layouts/pages/Layout.astro +90 -0
- package/src/layouts/pages/PageLayout.astro +200 -0
- package/src/lib/collections.ts +1 -0
- package/src/routes/[slug].astro +17 -0
- package/src/routes/index.astro +5 -0
- package/src/vite/yaml-merge-plugin.ts +234 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
---
|
|
2
|
+
import Caption from "./Caption.astro";
|
|
3
|
+
const { alignment = "caption-bottom", items } = Astro.props;
|
|
4
|
+
//alignment recebe caption-bottom ou caption-top
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
<div class:list={["big-numbers", `big-numbers--${alignment}`]}>
|
|
8
|
+
<div class="big-numbers__holder">
|
|
9
|
+
{
|
|
10
|
+
items &&
|
|
11
|
+
items.map((item) => (
|
|
12
|
+
//item.number
|
|
13
|
+
//item.caption
|
|
14
|
+
<div class="big-numbers__item reveal--fadeInLeft">
|
|
15
|
+
{item?.number && (
|
|
16
|
+
<span class="big-numbers__number">{item.number}</span>
|
|
17
|
+
)}
|
|
18
|
+
{item?.caption && <Caption>{item.caption}</Caption>}
|
|
19
|
+
</div>
|
|
20
|
+
))
|
|
21
|
+
}
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
<style lang="scss">
|
|
25
|
+
@use "../assets/styles/config/config" as *;
|
|
26
|
+
@use "../assets/styles/utils/grrr/grrr" as *;
|
|
27
|
+
@use "../assets/styles/globals/grrr" as *;
|
|
28
|
+
|
|
29
|
+
.big-numbers {
|
|
30
|
+
$self: &;
|
|
31
|
+
color: var(--clr-text);
|
|
32
|
+
@extend %grrr--board;
|
|
33
|
+
display: block;
|
|
34
|
+
|
|
35
|
+
&:not(:first-child),
|
|
36
|
+
:global(+ *:not(.column)),
|
|
37
|
+
:global(.animation-disabled:not(:first-child) >) & {
|
|
38
|
+
margin-top: var(--mt-m);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&__holder {
|
|
42
|
+
display: grid;
|
|
43
|
+
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
|
|
44
|
+
row-gap: 48px;
|
|
45
|
+
column-gap: var(--atnl-gutter);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&__item {
|
|
49
|
+
display: flex;
|
|
50
|
+
flex-direction: column;
|
|
51
|
+
gap: 12px;
|
|
52
|
+
border-top: 5px solid currentColor;
|
|
53
|
+
padding-top: 16px;
|
|
54
|
+
|
|
55
|
+
#{$self}--caption-top & {
|
|
56
|
+
flex-direction: column-reverse;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
&__number {
|
|
61
|
+
@include type('d-xs');
|
|
62
|
+
font-weight: 500;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
:global(.caption) {
|
|
66
|
+
margin-top: 0;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
:global(.group__content) > & {
|
|
70
|
+
@extend %grrr--board;
|
|
71
|
+
|
|
72
|
+
#{$self}__holder {
|
|
73
|
+
grid-column: board-full;
|
|
74
|
+
|
|
75
|
+
@include media-break-up(l) {
|
|
76
|
+
display: grid;
|
|
77
|
+
grid-template-columns: repeat(3, 1fr);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
</style>
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
const { link, icon, size } = Astro.props;
|
|
3
|
+
// link: objeto do link com {url:..., target:..., text:... }
|
|
4
|
+
// icon: html span do ícone escolhido da biblioteca do material symbols ex: "<span class="material-symbols-outlined">arrow_right_alt</span>}"
|
|
5
|
+
// size: "wide" ou null
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
<a
|
|
9
|
+
class:list={["reveal--fadeInLeft", "button", size === "wide" && "button--wide"]}
|
|
10
|
+
target={link.target}
|
|
11
|
+
href={link.url}
|
|
12
|
+
>
|
|
13
|
+
{link.text}
|
|
14
|
+
{icon ? <Fragment set:html={icon} /> : <span class="material-symbols-outlined">arrow_right_alt</span>}
|
|
15
|
+
</a>
|
|
16
|
+
|
|
17
|
+
<style lang="scss">
|
|
18
|
+
@use "../assets/styles/config/config" as *;
|
|
19
|
+
|
|
20
|
+
.button {
|
|
21
|
+
@include type('c-m');
|
|
22
|
+
font-weight: 600;
|
|
23
|
+
width: fit-content;
|
|
24
|
+
color: var(--clr-txt);
|
|
25
|
+
border: 2px solid var(--clr-txt);
|
|
26
|
+
border-radius: 4px;
|
|
27
|
+
display: flex;
|
|
28
|
+
align-items: center;
|
|
29
|
+
justify-content: center;
|
|
30
|
+
gap: 8px;
|
|
31
|
+
padding: 8px 60px;
|
|
32
|
+
transition: .3s ease;
|
|
33
|
+
|
|
34
|
+
:global(+ .button) {
|
|
35
|
+
margin-top: 16px;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&:hover {
|
|
39
|
+
background-color: var(--clr-txt);
|
|
40
|
+
color: var(--clr-bg);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&--wide {
|
|
44
|
+
width: 100%;
|
|
45
|
+
justify-content: space-between;
|
|
46
|
+
padding: 16px;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
</style>
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
---
|
|
2
|
+
import Button from "./Button.astro";
|
|
3
|
+
const { link, title, text, icon, index } = Astro.props;
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<div class="card reveal--fadeInLeft">
|
|
7
|
+
{icon && <div class="card__icon reveal--fadeInLeft" set:html={icon} />}
|
|
8
|
+
{title && <span class="card__title reveal--fadeInLeft">{title}</span>}
|
|
9
|
+
{text && <p class="card__text reveal--fadeInLeft">{text}</p>}
|
|
10
|
+
{link && <Button link={link} />}
|
|
11
|
+
</div>
|
|
12
|
+
|
|
13
|
+
<style lang="scss">
|
|
14
|
+
@use "../assets/styles/config/config" as *;
|
|
15
|
+
|
|
16
|
+
.card {
|
|
17
|
+
width: 100%;
|
|
18
|
+
color: var(--clr-txt);
|
|
19
|
+
border: 2px solid currentColor;
|
|
20
|
+
border-radius: 4px;
|
|
21
|
+
padding: 20px;
|
|
22
|
+
display: flex;
|
|
23
|
+
flex-direction: column;
|
|
24
|
+
|
|
25
|
+
&__icon {
|
|
26
|
+
:global(span) {
|
|
27
|
+
font-size: 26px;
|
|
28
|
+
display: block;
|
|
29
|
+
width: fit-content;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
+ * {
|
|
33
|
+
margin-top: 10px;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&__title {
|
|
38
|
+
@include type('h-xs');
|
|
39
|
+
display: block;
|
|
40
|
+
|
|
41
|
+
+ * {
|
|
42
|
+
margin-top: 15px;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&__text {
|
|
47
|
+
@include type('b-s');
|
|
48
|
+
:global(+ *) {
|
|
49
|
+
margin-top: 20px;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
:global(.button) {
|
|
54
|
+
@include type('c-s');
|
|
55
|
+
line-height: 1;
|
|
56
|
+
font-weight: 600;
|
|
57
|
+
margin-bottom: 4px;
|
|
58
|
+
padding: 2px 2px 0px 5px;
|
|
59
|
+
gap: 3px;
|
|
60
|
+
display: block;
|
|
61
|
+
|
|
62
|
+
:global(span) {
|
|
63
|
+
vertical-align: middle;
|
|
64
|
+
display: inline-block;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
</style>
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
---
|
|
2
|
+
import Card from "./Card.astro";
|
|
3
|
+
|
|
4
|
+
const { cards } = Astro.props;
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
<div class="cards">
|
|
8
|
+
<div class="cards__holder">
|
|
9
|
+
{
|
|
10
|
+
cards &&
|
|
11
|
+
cards.map((data) => (
|
|
12
|
+
<Card
|
|
13
|
+
icon={data.icon}
|
|
14
|
+
title={data.title}
|
|
15
|
+
text={data.text}
|
|
16
|
+
link={data.link}
|
|
17
|
+
/>
|
|
18
|
+
))
|
|
19
|
+
}
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
<style lang="scss">
|
|
24
|
+
@use "../assets/styles/config/config" as *;
|
|
25
|
+
@use "../assets/styles/utils/grrr/grrr" as *;
|
|
26
|
+
|
|
27
|
+
.cards {
|
|
28
|
+
$self: &;
|
|
29
|
+
width: 100%;
|
|
30
|
+
|
|
31
|
+
&:not(:first-child),
|
|
32
|
+
& :global(+ *:not(.column)),
|
|
33
|
+
:global(.animation-disabled:not(:first-child) > ) & {
|
|
34
|
+
margin-top: var(--mt-m);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@include media-break-up(m) {
|
|
38
|
+
flex-direction: row;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
:global(.text > * +) & {
|
|
42
|
+
margin-top: var(--mt-m);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
:global(.group__content >) &,
|
|
46
|
+
:global(.group__content > .animation-disabled >) & {
|
|
47
|
+
padding-top: var(--mt-l);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&__holder {
|
|
51
|
+
display: grid;
|
|
52
|
+
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
|
|
53
|
+
gap: var(--atnl-gutter);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
:global(.group__content >) &,
|
|
57
|
+
:global(.group__content > .animation-disabled >) & {
|
|
58
|
+
@extend %grrr--board;
|
|
59
|
+
#{$self}__holder {
|
|
60
|
+
grid-column: board-full;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
</style>
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { Image } from 'astro:assets';
|
|
3
|
+
import Caption from "./Caption.astro";
|
|
4
|
+
|
|
5
|
+
const { cards } = Astro.props;
|
|
6
|
+
// cards recebe um array com os objetos de cada, com os itens:
|
|
7
|
+
// img: objeto da imagem { src, alt }
|
|
8
|
+
// title: string
|
|
9
|
+
// text: string
|
|
10
|
+
// link: objeto do link {url:..., target:..., title:... }
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
<div class="cards-call">
|
|
14
|
+
<div class="cards-call__holder">
|
|
15
|
+
{
|
|
16
|
+
cards &&
|
|
17
|
+
cards.map((data, index) => (
|
|
18
|
+
<a
|
|
19
|
+
class="cards-call__item reveal--fadeInUp"
|
|
20
|
+
href={data.link.url}
|
|
21
|
+
title={data.link.title ? data.link.title : data?.title}
|
|
22
|
+
target={data.link?.target}
|
|
23
|
+
style={`animation-delay:${0.3 * index}s`}
|
|
24
|
+
>
|
|
25
|
+
<div class="cards-call__thumb">
|
|
26
|
+
{data.img.src && (
|
|
27
|
+
<Image
|
|
28
|
+
src={data.img.src}
|
|
29
|
+
alt={data.img.alt ? data.img.alt : data?.title}
|
|
30
|
+
width={data.img.width}
|
|
31
|
+
height={data.img.height}
|
|
32
|
+
/>
|
|
33
|
+
)}
|
|
34
|
+
</div>
|
|
35
|
+
{data.title && <span class="cards-call__title">{data.title}</span>}
|
|
36
|
+
{data.text && (
|
|
37
|
+
<div class="card-caption">
|
|
38
|
+
<Caption>{data.text}</Caption>
|
|
39
|
+
</div>
|
|
40
|
+
)}
|
|
41
|
+
</a>
|
|
42
|
+
))
|
|
43
|
+
}
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
|
|
47
|
+
<style lang="scss">
|
|
48
|
+
@use "../assets/styles/config/config" as *;
|
|
49
|
+
@use "../assets/styles/utils/grrr/grrr" as *;
|
|
50
|
+
|
|
51
|
+
.cards-call {
|
|
52
|
+
$self: &;
|
|
53
|
+
|
|
54
|
+
&:not(:first-child),
|
|
55
|
+
& :global(+ *:not(.column)),
|
|
56
|
+
:global(.animation-disabled:not(:first-child) >) & {
|
|
57
|
+
margin-top: var(--atnl-gutter);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
:global(.group__content) > &,
|
|
61
|
+
:global(.group__content > .animation-disabled) > & {
|
|
62
|
+
@extend %grrr--board;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&__holder {
|
|
66
|
+
display: grid;
|
|
67
|
+
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
|
|
68
|
+
gap: var(--atnl-gutter);
|
|
69
|
+
|
|
70
|
+
:global(.group__content) > #{$self} &,
|
|
71
|
+
:global(.group__content > .animation-disabled) > #{$self} & {
|
|
72
|
+
grid-column: board-full;
|
|
73
|
+
|
|
74
|
+
@include media-break-up(l) {
|
|
75
|
+
grid-column: board-start 1 / board-end 12;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
@include media-break-up(x) {
|
|
79
|
+
grid-column: board-start 2 / board-end 11;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
a {
|
|
85
|
+
display: flex;
|
|
86
|
+
flex-direction: column;
|
|
87
|
+
gap: 12px;
|
|
88
|
+
|
|
89
|
+
&:hover {
|
|
90
|
+
img {
|
|
91
|
+
opacity: .8;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
&__item {
|
|
97
|
+
container-name: card-grid;
|
|
98
|
+
container-type: inline-size;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
&__thumb {
|
|
102
|
+
background-color: var(--clr-txt);
|
|
103
|
+
|
|
104
|
+
img {
|
|
105
|
+
width: 100%;
|
|
106
|
+
height: auto;
|
|
107
|
+
aspect-ratio: 1 / .6;
|
|
108
|
+
transition: .3s ease;
|
|
109
|
+
display: block;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
&__title {
|
|
114
|
+
@include type("h-s");
|
|
115
|
+
|
|
116
|
+
@container card-grid (width < 350px) {
|
|
117
|
+
@include type("h-xs");
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
:global(.caption) {
|
|
122
|
+
margin-top: 0;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
</style>
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
---
|
|
2
|
+
import Caption from "./Caption.astro";
|
|
3
|
+
const { title, notes, type, values } = Astro.props;
|
|
4
|
+
|
|
5
|
+
function addNumberPercentToValues(values) {
|
|
6
|
+
// Ensure values is always a valid array
|
|
7
|
+
if (!values || !Array.isArray(values) || values.length === 0) {
|
|
8
|
+
return [];
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const numbers = values.map(value => value.number)
|
|
12
|
+
const largest = Math.max(...numbers);
|
|
13
|
+
|
|
14
|
+
return values.map((value) => {
|
|
15
|
+
return {
|
|
16
|
+
...value,
|
|
17
|
+
number: type === 'proportion' ? value.number + '%' : value.number,
|
|
18
|
+
numberPercent: value.number / largest * 100
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const chartValues = addNumberPercentToValues(values);
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
<div class:list={["chart-bar reveal--fadeInUp", type && `chart-bar--${type}`]}>
|
|
28
|
+
<div class="chart-bar__holder">
|
|
29
|
+
|
|
30
|
+
<span class="chart-bar__title">{title}</span>
|
|
31
|
+
|
|
32
|
+
<div class="chart-bar__values">
|
|
33
|
+
<div class="chart-bar__bars">
|
|
34
|
+
{
|
|
35
|
+
chartValues &&
|
|
36
|
+
chartValues.map((data, index) => (
|
|
37
|
+
//valores:
|
|
38
|
+
//data.color
|
|
39
|
+
//data.number
|
|
40
|
+
//data.numberPercent
|
|
41
|
+
//data.label
|
|
42
|
+
<div
|
|
43
|
+
class="chart-bar__item"
|
|
44
|
+
style={`--clr-chart:${data.color}; --data-perc:${data.numberPercent}%; --index:${index};`}
|
|
45
|
+
>
|
|
46
|
+
<span class="chart-bar__label">{data.label}</span>
|
|
47
|
+
<div class="chart-bar__bar">
|
|
48
|
+
<span class="chart-bar__number">{data.number}</span>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
))
|
|
52
|
+
}
|
|
53
|
+
</div>
|
|
54
|
+
<div class="chart-bar__ghost-values">
|
|
55
|
+
{
|
|
56
|
+
chartValues &&
|
|
57
|
+
chartValues.map((data) => (
|
|
58
|
+
<span class="chart-bar__number">{data.number}</span>
|
|
59
|
+
))
|
|
60
|
+
}
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
|
|
64
|
+
<div class="chart-bar__notes">
|
|
65
|
+
<Caption>{notes}</Caption>
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
</div>
|
|
69
|
+
|
|
70
|
+
<style lang="scss">
|
|
71
|
+
@use "../assets/styles/config/config" as *;
|
|
72
|
+
@use "../assets/styles/globals/grrr" as *;
|
|
73
|
+
|
|
74
|
+
:global(.animation-disabled:has(.chart-bar) + *) {
|
|
75
|
+
margin-top: var(--mt-m);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.chart-bar {
|
|
79
|
+
$self: &;
|
|
80
|
+
overflow: hidden;
|
|
81
|
+
|
|
82
|
+
&:not(:first-child),
|
|
83
|
+
& :global(+ *:not(.column)),
|
|
84
|
+
:global(.animation-disabled:not(:first-child) > ) & {
|
|
85
|
+
margin-top: var(--mt-m);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
:global(.group__content >) &,
|
|
89
|
+
:global(.group__content > .animation-disabled >) & {
|
|
90
|
+
@extend %grrr--board;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
&__holder {
|
|
94
|
+
:global(.group__content > .chart-bar) &,
|
|
95
|
+
:global(.group__content > .animation-disabled > .chart-bar) & {
|
|
96
|
+
grid-column: content;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
&__title {
|
|
101
|
+
@include type("h-m");
|
|
102
|
+
display: block;
|
|
103
|
+
margin-bottom: 40px;
|
|
104
|
+
|
|
105
|
+
:global(.columns--33-66 .columns__column-1) &,
|
|
106
|
+
:global(.columns--66-33 .columns__column-2) & {
|
|
107
|
+
@include type("h-xs");
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
&__values {
|
|
112
|
+
display: flex;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
&__number {
|
|
116
|
+
@include type("h-xs");
|
|
117
|
+
display: block;
|
|
118
|
+
position: absolute;
|
|
119
|
+
top: 50%;
|
|
120
|
+
left: var(--data-perc);
|
|
121
|
+
transform: translate(0, -50%);
|
|
122
|
+
opacity: 0;
|
|
123
|
+
transition: 1s ease calc(.3s * (var(--index) + 1));
|
|
124
|
+
|
|
125
|
+
#{$self}--proportion & {
|
|
126
|
+
width: 4ch;
|
|
127
|
+
text-align: right;
|
|
128
|
+
left: 100%;
|
|
129
|
+
}
|
|
130
|
+
:global(.animation-disabled) &,
|
|
131
|
+
#{$self}.reveal & {
|
|
132
|
+
opacity: 1;
|
|
133
|
+
transform: translate(10px, -50%);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
&__bars {
|
|
138
|
+
flex: 1;
|
|
139
|
+
padding-right: 10px;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
&__ghost-values {
|
|
143
|
+
opacity: 0;
|
|
144
|
+
visibility: hidden;
|
|
145
|
+
pointer-events: none;
|
|
146
|
+
|
|
147
|
+
> span {
|
|
148
|
+
position: static;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
&__item {
|
|
153
|
+
+ .chart-bar__item {
|
|
154
|
+
margin-top: 24px;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
&__label {
|
|
159
|
+
@include type("h-xs");
|
|
160
|
+
font-weight: 400;
|
|
161
|
+
display: block;
|
|
162
|
+
margin-bottom: 10px;
|
|
163
|
+
|
|
164
|
+
:global(.columns--33-66 .columns__column-1) &,
|
|
165
|
+
:global(.columns--66-33 .columns__column-2) & {
|
|
166
|
+
@include type("c-m");
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
&__bar {
|
|
171
|
+
width: 100%;
|
|
172
|
+
height: 20px;
|
|
173
|
+
position: relative;
|
|
174
|
+
|
|
175
|
+
&::after {
|
|
176
|
+
content: "";
|
|
177
|
+
width: 0;
|
|
178
|
+
height: 100%;
|
|
179
|
+
display: block;
|
|
180
|
+
background-color: var(--clr-chart, #000);
|
|
181
|
+
position: absolute;
|
|
182
|
+
top: 0;
|
|
183
|
+
left: 0;
|
|
184
|
+
transition: 1s ease-in calc(1s * (var(--index) * .2));
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
#{$self}--proportion & {
|
|
188
|
+
&::before {
|
|
189
|
+
content: "";
|
|
190
|
+
width: 100%;
|
|
191
|
+
height: 100%;
|
|
192
|
+
display: block;
|
|
193
|
+
background-color: color-mix(
|
|
194
|
+
in srgb,
|
|
195
|
+
var(--clr-chart, #000) 60%,
|
|
196
|
+
#ffffff 40%
|
|
197
|
+
);
|
|
198
|
+
position: absolute;
|
|
199
|
+
top: 0;
|
|
200
|
+
left: 0;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
:global(.animation-disabled) &::after,
|
|
205
|
+
#{$self}.reveal &::after {
|
|
206
|
+
width: var(--data-perc);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
&__notes {
|
|
211
|
+
margin-top: 40px;
|
|
212
|
+
display: block;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
</style>
|