@devix-tecnologia/timeline-vue 1.0.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.
Files changed (60) hide show
  1. package/README.md +18 -0
  2. package/dist/style.css +1 -0
  3. package/dist/timeline-vue.es.js +557 -0
  4. package/dist/types/components/timeline/atomos/AvatarTimeline.vue.d.ts +17 -0
  5. package/dist/types/components/timeline/atomos/BoxData.vue.d.ts +23 -0
  6. package/dist/types/components/timeline/atomos/Destaque.vue.d.ts +11 -0
  7. package/dist/types/components/timeline/atomos/Hora.vue.d.ts +24 -0
  8. package/dist/types/components/timeline/atomos/IconeCategoria.vue.d.ts +57 -0
  9. package/dist/types/components/timeline/atomos/IconeStatus.vue.d.ts +17 -0
  10. package/dist/types/components/timeline/atomos/SubtituloEvento.vue.d.ts +13 -0
  11. package/dist/types/components/timeline/atomos/TituloEvento.vue.d.ts +13 -0
  12. package/dist/types/components/timeline/index.d.ts +3 -0
  13. package/dist/types/components/timeline/moleculas/DescricaoEvento.vue.d.ts +21 -0
  14. package/dist/types/components/timeline/moleculas/EventoTimeline.vue.d.ts +18 -0
  15. package/dist/types/components/timeline/moleculas/HoraEvento.vue.d.ts +19 -0
  16. package/dist/types/components/timeline/moleculas/PerfilTimeline.vue.d.ts +39 -0
  17. package/dist/types/components/timeline/moleculas/SeparadorPeriodo.vue.d.ts +24 -0
  18. package/dist/types/components/timeline/moleculas/Topo.vue.d.ts +3 -0
  19. package/dist/types/components/timeline/organismos/Timeline.mock.d.ts +3 -0
  20. package/dist/types/components/timeline/organismos/Timeline.vue.d.ts +40 -0
  21. package/dist/types/components/timeline/type.d.ts +23 -0
  22. package/dist/types/index.d.ts +5 -0
  23. package/dist/vite.svg +1 -0
  24. package/package.json +53 -0
  25. package/src/assets/vue.svg +1 -0
  26. package/src/components/timeline/atomos/AvatarTimeline.stories.ts +32 -0
  27. package/src/components/timeline/atomos/AvatarTimeline.vue +51 -0
  28. package/src/components/timeline/atomos/BoxData.stories.ts +41 -0
  29. package/src/components/timeline/atomos/BoxData.vue +57 -0
  30. package/src/components/timeline/atomos/Destaque.stories.ts +24 -0
  31. package/src/components/timeline/atomos/Destaque.vue +39 -0
  32. package/src/components/timeline/atomos/Hora.stories.ts +36 -0
  33. package/src/components/timeline/atomos/Hora.vue +53 -0
  34. package/src/components/timeline/atomos/IconeCategoria.stories.ts +60 -0
  35. package/src/components/timeline/atomos/IconeCategoria.vue +110 -0
  36. package/src/components/timeline/atomos/IconeStatus.stories.ts +38 -0
  37. package/src/components/timeline/atomos/IconeStatus.vue +72 -0
  38. package/src/components/timeline/atomos/SubtituloEvento.stories.ts +24 -0
  39. package/src/components/timeline/atomos/SubtituloEvento.vue +33 -0
  40. package/src/components/timeline/atomos/TituloEvento.stories.ts +24 -0
  41. package/src/components/timeline/atomos/TituloEvento.vue +32 -0
  42. package/src/components/timeline/index.ts +7 -0
  43. package/src/components/timeline/moleculas/DescricaoEvento.stories.ts +31 -0
  44. package/src/components/timeline/moleculas/DescricaoEvento.vue +59 -0
  45. package/src/components/timeline/moleculas/EventoTimeline.stories.ts +94 -0
  46. package/src/components/timeline/moleculas/EventoTimeline.vue +102 -0
  47. package/src/components/timeline/moleculas/HoraEvento.stories.ts +37 -0
  48. package/src/components/timeline/moleculas/HoraEvento.vue +73 -0
  49. package/src/components/timeline/moleculas/PerfilTimeline.stories.ts +40 -0
  50. package/src/components/timeline/moleculas/PerfilTimeline.vue +103 -0
  51. package/src/components/timeline/moleculas/SeparadorPeriodo.stories.ts +42 -0
  52. package/src/components/timeline/moleculas/SeparadorPeriodo.vue +101 -0
  53. package/src/components/timeline/moleculas/Topo.vue +38 -0
  54. package/src/components/timeline/organismos/Timeline.mock.ts +281 -0
  55. package/src/components/timeline/organismos/Timeline.stories.ts +31 -0
  56. package/src/components/timeline/organismos/Timeline.vue +188 -0
  57. package/src/components/timeline/type.ts +30 -0
  58. package/src/global.css +98 -0
  59. package/src/index.ts +16 -0
  60. package/src/vite-env.d.ts +1 -0
@@ -0,0 +1,102 @@
1
+ <template>
2
+ <article
3
+ class="eventoTimeline"
4
+ :class="[
5
+ dadosEvento.valor.status,
6
+ 'criticidade-' + dadosEvento.valor.criticidade,
7
+ eventoSelecionado,
8
+ ]"
9
+ >
10
+ <IconeStatus :status="dadosEvento.valor.status" />
11
+ <HoraEvento
12
+ :horaPrevista="dadosEvento.valor.previsto"
13
+ :horaRealizada="dadosEvento.valor.realizado"
14
+ />
15
+ <IconeCategoria
16
+ :iconeCategoria="dadosEvento.valor.categoria.icone"
17
+ :categoria="dadosEvento.valor.categoria.nome"
18
+ />
19
+ <DescricaoEvento
20
+ :titulo="dadosEvento.valor.titulo"
21
+ :subtitulo="dadosEvento.valor.subtitulo"
22
+ />
23
+ <Destaque :destaque="dadosEvento.valor.destaque" />
24
+ </article>
25
+ </template>
26
+ <script lang="ts">
27
+ import { defineComponent, computed } from "vue";
28
+ import IconeCategoria from "../atomos/IconeCategoria.vue";
29
+ import IconeStatus from "../atomos/IconeStatus.vue";
30
+ import DescricaoEvento from "./DescricaoEvento.vue";
31
+ import HoraEvento from "./HoraEvento.vue";
32
+ import Destaque from "../atomos/Destaque.vue";
33
+
34
+ export default defineComponent({
35
+ props: {
36
+ dadosEvento: {
37
+ required: true,
38
+ type: Object,
39
+ },
40
+ },
41
+ components: {
42
+ IconeStatus,
43
+ IconeCategoria,
44
+ HoraEvento,
45
+ DescricaoEvento,
46
+ Destaque,
47
+ },
48
+ setup(props) {
49
+ return {
50
+ eventoSelecionado: computed(() => ({
51
+ atual: props.dadosEvento.atual == true,
52
+ padrao: props.dadosEvento.atual == false,
53
+ })),
54
+ };
55
+ },
56
+ });
57
+ </script>
58
+ <style scoped>
59
+ /* BOX DO EVENTO */
60
+
61
+ .eventoTimeline {
62
+ position: relative;
63
+ width: 100%;
64
+ border-radius: 1rem;
65
+ }
66
+
67
+ .eventoTimeline:hover {
68
+ background: #f9f9f9;
69
+ }
70
+
71
+ .atual {
72
+ background: var(--cor-selecao);
73
+ }
74
+
75
+ .atual:hover {
76
+ background: var(--cor-selecao);
77
+ }
78
+
79
+ /* box com as informações */
80
+
81
+ .eventoTimeline:before {
82
+ content: "";
83
+ background: var(--cor-linha);
84
+ display: block;
85
+ position: absolute;
86
+ width: 2px;
87
+ top: 0;
88
+ height: 1.5rem;
89
+ left: 11.7rem;
90
+ }
91
+
92
+ .eventoTimeline:after {
93
+ content: "";
94
+ background: var(--cor-linha);
95
+ display: block;
96
+ position: absolute;
97
+ width: 2px;
98
+ top: 5.1rem;
99
+ bottom: 0;
100
+ left: 11.7rem;
101
+ }
102
+ </style>
@@ -0,0 +1,37 @@
1
+ import HoraEvento from './HoraEvento.vue';
2
+ import { Meta, StoryFn } from '@storybook/vue3';
3
+
4
+ export default {
5
+ title: 'Devix/Timeline/Moleculas/HoraEvento',
6
+ component: HoraEvento,
7
+ argTypes: {
8
+ // aparencia: {
9
+ // control: { type: 'select' },
10
+ // options: ['padrao', 'riscada'],
11
+ // },
12
+ },
13
+ } as Meta<typeof HoraEvento>;
14
+
15
+ const horaMock = '2023-12-10T11:00Z';
16
+
17
+ const Template: StoryFn<typeof HoraEvento> = (args) => ({
18
+ components: { HoraEvento: HoraEvento },
19
+ setup() {
20
+ return { args };
21
+ },
22
+ template: '<HoraEvento v-bind="args" />',
23
+ });
24
+
25
+ export const Padrao = Template.bind({});
26
+ Padrao.args = {
27
+ horaPrevista: horaMock,
28
+ horaRealizada: '',
29
+ // aparencia: 'padrao',
30
+ };
31
+
32
+ export const Atrasado = Template.bind({});
33
+ Atrasado.args = {
34
+ horaPrevista: horaMock,
35
+ horaRealizada: '2023-12-10T12:00Z',
36
+ // aparencia: 'riscada',
37
+ };
@@ -0,0 +1,73 @@
1
+ <template>
2
+ <div class="areaHora">
3
+ <div class="horaEvento">
4
+ <Hora
5
+ v-if="horaRealizada"
6
+ class="horaRealizada texto-grande"
7
+ :hora="horaRealizada"
8
+ style="padding-top: 0.3rem"
9
+ />
10
+ <Hora
11
+ v-if="horaRealizada"
12
+ class="horaPlanejada texto-pequeno"
13
+ :hora="horaPrevista"
14
+ />
15
+
16
+ <Hora
17
+ v-else
18
+ class="horaRealizada texto-grande"
19
+ :hora="horaPrevista"
20
+ style="padding-top: 1.2rem"
21
+ />
22
+ </div>
23
+ </div>
24
+ </template>
25
+ <script lang="ts">
26
+ import { defineComponent } from 'vue';
27
+ import Hora from '../atomos/Hora.vue';
28
+
29
+ export default defineComponent({
30
+ props: {
31
+ horaPrevista: {
32
+ type: Date,
33
+ required: true,
34
+ },
35
+ horaRealizada: {
36
+ type: Date,
37
+ },
38
+ // aparencia: {
39
+ // type: String,
40
+ // },
41
+ },
42
+ components: { Hora },
43
+ setup() {
44
+ return {};
45
+ },
46
+ });
47
+ </script>
48
+ <style scoped>
49
+ .realizado .horaEvento,
50
+ .cancelado .horaEvento,
51
+ .adiado .horaEvento {
52
+ opacity: 0.4;
53
+ }
54
+ .areaHora {
55
+ width: 4.5rem;
56
+ display: table-cell;
57
+ vertical-align: top;
58
+ text-align: right;
59
+ padding: 1.4rem 0;
60
+ }
61
+ .horaEvento {
62
+ line-height: 1.4rem;
63
+ text-align: right;
64
+ display: flex;
65
+ flex-direction: column;
66
+ }
67
+ .horaRealizada {
68
+ font-weight: 500;
69
+ }
70
+ .horaPlanejada {
71
+ text-decoration: line-through;
72
+ }
73
+ </style>
@@ -0,0 +1,40 @@
1
+ import PerfilTimeline from "./PerfilTimeline.vue";
2
+ import { Meta, StoryFn } from "@storybook/vue3";
3
+
4
+ export default {
5
+ title: "Devix/Timeline/Moleculas/PerfilTimeline",
6
+ component: PerfilTimeline,
7
+ argTypes: {},
8
+ } as Meta<typeof PerfilTimeline>;
9
+
10
+ const avatar =
11
+ "https://images.unsplash.com/photo-1526080652727-5b77f74eacd2?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1752&q=80";
12
+
13
+ const Template: StoryFn<typeof PerfilTimeline> = (args) => ({
14
+ components: { PerfilTimeline: PerfilTimeline },
15
+ setup() {
16
+ return { args };
17
+ },
18
+ template: '<PerfilTimeline v-bind="args" style="position: relative" />',
19
+ });
20
+
21
+ export const ComImagem = Template.bind({});
22
+ ComImagem.args = {
23
+ imagemPerfil: avatar,
24
+ nomePerfil: "Dona Maria",
25
+ iconePerfil: "",
26
+ };
27
+
28
+ export const ComIcone = Template.bind({});
29
+ ComIcone.args = {
30
+ imagemPerfil: "",
31
+ nomePerfil: "Dona Maria",
32
+ iconePerfil: "person",
33
+ };
34
+
35
+ export const ApenasTitulo = Template.bind({});
36
+ ApenasTitulo.args = {
37
+ imagemPerfil: "",
38
+ nomePerfil: "Dona Maria",
39
+ iconePerfil: "",
40
+ };
@@ -0,0 +1,103 @@
1
+ <template>
2
+ <div
3
+ class="perfilTimeline"
4
+ ref="elementoFixo"
5
+ :style="style"
6
+ :class="{ fixed: isFixed }"
7
+ >
8
+ <!-- :class="{ fixed: isFixed }" -->
9
+ <AvatarTimeline v-if="imagemPerfil" :imagem="imagemPerfil" />
10
+ <AvatarTimeline v-else-if="iconePerfil" :icone="iconePerfil" />
11
+ <h2 class="nome">{{ nomePerfil }}</h2>
12
+ </div>
13
+ </template>
14
+
15
+ <script lang="ts">
16
+ import {
17
+ defineComponent,
18
+ ref,
19
+ onMounted,
20
+ onUnmounted,
21
+ reactive,
22
+ computed,
23
+ } from "vue";
24
+ import AvatarTimeline from "../atomos/AvatarTimeline.vue";
25
+
26
+ export default defineComponent({
27
+ components: { AvatarTimeline },
28
+ props: {
29
+ imagemPerfil: {
30
+ type: String,
31
+ },
32
+ nomePerfil: {
33
+ type: String,
34
+ },
35
+ iconePerfil: {
36
+ type: String,
37
+ },
38
+ backgroundColor: {
39
+ type: String,
40
+ default: "var(--cor-primaria)",
41
+ },
42
+ },
43
+ setup(props) {
44
+ props = reactive(props);
45
+ // passando o background por props no style
46
+ const style = computed(() => ({
47
+ backgroundColor: props.backgroundColor,
48
+ }));
49
+ // fixando o box no topo da página
50
+ const elementoFixo = ref<HTMLElement | null>(null);
51
+ const isFixed = ref(false);
52
+
53
+ const handleScroll = () => {
54
+ if (elementoFixo.value) {
55
+ const scrollTop =
56
+ window.pageYOffset || document.documentElement.scrollTop;
57
+ const offset = elementoFixo.value.offsetTop;
58
+ isFixed.value = scrollTop > offset;
59
+ }
60
+ };
61
+
62
+ onMounted(() => {
63
+ window.addEventListener("scroll", handleScroll);
64
+ });
65
+ onUnmounted(() => {
66
+ window.removeEventListener("scroll", handleScroll);
67
+ });
68
+
69
+ return {
70
+ style,
71
+ elementoFixo,
72
+ isFixed,
73
+ };
74
+ },
75
+ });
76
+ </script>
77
+
78
+ <style scoped>
79
+ .perfilTimeline {
80
+ background: var(--cor-primaria);
81
+ padding: 1.4rem;
82
+ display: flex;
83
+ flex-direction: row;
84
+ justify-content: center;
85
+ align-items: center;
86
+ gap: 1.4rem;
87
+ z-index: 999;
88
+ width: 100%;
89
+ min-height: 8rem;
90
+ transition: all 0.3s;
91
+ }
92
+
93
+ .nome {
94
+ color: var(--cor-secundaria);
95
+ }
96
+
97
+ .fixed {
98
+ position: fixed;
99
+ top: 0;
100
+ left: 0;
101
+ transition: all 0.3s;
102
+ }
103
+ </style>
@@ -0,0 +1,42 @@
1
+ import SeparadorPeriodo from './SeparadorPeriodo.vue';
2
+ import { Meta, StoryFn } from '@storybook/vue3';
3
+
4
+ export default {
5
+ title: 'Devix/Timeline/Moleculas/SeparadorPeriodo',
6
+ component: SeparadorPeriodo,
7
+ argTypes: {
8
+ aparencia: {
9
+ control: { type: 'select' },
10
+ options: ['padrao', 'escuro', 'claro'],
11
+ },
12
+ },
13
+ } as Meta<typeof SeparadorPeriodo>;
14
+
15
+ const Template: StoryFn<typeof SeparadorPeriodo> = (args) => ({
16
+ components: { SeparadorPeriodo: SeparadorPeriodo },
17
+ setup() {
18
+ return { args };
19
+ },
20
+ template: '<SeparadorPeriodo v-bind="args" />',
21
+ });
22
+
23
+ export const Padrao = Template.bind({});
24
+ Padrao.args = {
25
+ dataSeparador: '01',
26
+ mesNome: 'Janeiro',
27
+ aparencia: 'padrao',
28
+ };
29
+
30
+ export const Escuro = Template.bind({});
31
+ Escuro.args = {
32
+ dataSeparador: '01',
33
+ mesNome: 'Janeiro',
34
+ aparencia: 'escuro',
35
+ };
36
+
37
+ export const Claro = Template.bind({});
38
+ Claro.args = {
39
+ dataSeparador: '01',
40
+ mesNome: 'Janeiro',
41
+ aparencia: 'claro',
42
+ };
@@ -0,0 +1,101 @@
1
+ <template>
2
+ <div class="separadorPeriodo">
3
+ <div class="areaData">
4
+ <BoxData :dataNumero="dia" :aparencia="aparencia" />
5
+ </div>
6
+ <h3 class="titulo" :class="aparencia">{{ mes }} de {{ ano }}</h3>
7
+ </div>
8
+ </template>
9
+
10
+ <script lang="ts">
11
+ import { defineComponent } from "vue";
12
+ import BoxData from "../atomos/BoxData.vue";
13
+
14
+ export default defineComponent({
15
+ name: "SeparadorPeriodo",
16
+ props: {
17
+ dataSeparador: {
18
+ required: true,
19
+ type: String,
20
+ },
21
+ aparencia: {
22
+ type: String,
23
+ },
24
+ },
25
+ components: { BoxData },
26
+ setup(props) {
27
+ const numeroMes = [
28
+ "janeiro",
29
+ "fevereiro",
30
+ "março",
31
+ "abril",
32
+ "maio",
33
+ "junho",
34
+ "julho",
35
+ "agosto",
36
+ "setembro",
37
+ "outubro",
38
+ "novembro",
39
+ "dezembro",
40
+ ];
41
+
42
+ // eslint-disable-next-line vue/no-setup-props-destructure
43
+ const dataRecebida = props.dataSeparador;
44
+ const data = new Date(dataRecebida);
45
+ const ano = data.getFullYear();
46
+ const mes = numeroMes[data.getMonth()];
47
+ const dia = data.getDate();
48
+ return { dataRecebida, ano, mes, dia };
49
+ },
50
+ });
51
+ </script>
52
+
53
+ <style scoped>
54
+ /* SEPARADOR */
55
+
56
+ .separadorPeriodo {
57
+ display: table-row;
58
+ width: 100%;
59
+ position: relative;
60
+ background: #fff;
61
+ }
62
+
63
+ .areaData {
64
+ display: table-cell;
65
+ padding: 2.8rem 1.4rem;
66
+ padding-left: 10.1rem;
67
+ position: relative;
68
+ }
69
+
70
+ .areaData:before {
71
+ content: "";
72
+ background: var(--cor-linha);
73
+ display: block;
74
+ position: absolute;
75
+ width: 2px;
76
+ height: 2.5rem;
77
+ top: 0;
78
+ left: 11.7rem;
79
+ }
80
+
81
+ .areaData:after {
82
+ content: "";
83
+ background: var(--cor-linha);
84
+ display: block;
85
+ position: absolute;
86
+ width: 2px;
87
+ height: 2.5rem;
88
+ bottom: 0;
89
+ left: 11.7rem;
90
+ }
91
+
92
+ .separadorPeriodo .titulo {
93
+ text-transform: uppercase;
94
+ padding-bottom: 3.45rem;
95
+ color: var(--cor-texto);
96
+ }
97
+
98
+ .separadorPeriodo .titulo.claro {
99
+ color: var(--cor-apoio);
100
+ }
101
+ </style>
@@ -0,0 +1,38 @@
1
+ <template>
2
+ <div class="topo">
3
+ <div class="Topo">
4
+ <!-- iconeSeta -->
5
+ <span class="material-symbols-outlined"> arrow_back </span>
6
+ <!-- titulo -->
7
+ <h2 class="titulo">Linha do tempo</h2>
8
+ <!-- menu -->
9
+ <span class="material-symbols-outlined"> more_vert </span>
10
+ </div>
11
+ </div>
12
+ </template>
13
+
14
+ <script lang="ts">
15
+ import { defineComponent } from 'vue';
16
+
17
+ export default defineComponent({
18
+ setup() {
19
+ return {};
20
+ },
21
+ });
22
+ </script>
23
+
24
+ <style scoped>
25
+ /* CABEÇALHO */
26
+ .material-symbols-outlined {
27
+ font-size: 2.6rem;
28
+ }
29
+ .Topo {
30
+ background: var(--cor-secundaria);
31
+ padding: 1.4rem;
32
+ color: var(--cor-terciaria);
33
+ display: flex;
34
+ flex-direction: row;
35
+ justify-content: space-between;
36
+ align-items: center;
37
+ }
38
+ </style>