@namelivia/vue-components 4.3.1 → 4.4.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@namelivia/vue-components",
3
- "version": "4.3.1",
3
+ "version": "4.4.0",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.esm.js",
6
6
  "scripts": {
@@ -0,0 +1,22 @@
1
+ import Temperature from './Temperature.vue'
2
+
3
+ describe('<Temperature />', () => {
4
+
5
+ it('should properly render', () => {
6
+ cy.mount(Temperature, {
7
+ props: {
8
+ title: "Current temperature",
9
+ min: 19.10,
10
+ avg: 26.02,
11
+ max: 33.21
12
+ }
13
+ })
14
+ cy.contains('Current temperature').should('be.visible');
15
+
16
+ cy.contains('19.10 ℃').should('be.visible');
17
+ cy.contains('26.02 ℃').should('be.visible');
18
+ cy.contains('33.21 ℃').should('be.visible');
19
+
20
+ })
21
+
22
+ })
@@ -0,0 +1,15 @@
1
+ import Temperature from './Temperature.vue';
2
+
3
+ export default {
4
+ title: 'Temperature',
5
+ component: Temperature,
6
+ tags: ['autodocs'],
7
+ }
8
+ export const Default = {
9
+ args: {
10
+ title: "Current temperature",
11
+ min: 19.10,
12
+ avg: 26.02,
13
+ max: 33.21
14
+ },
15
+ };
@@ -0,0 +1,59 @@
1
+ <template lang="pug">
2
+ .wrapper
3
+ .title
4
+ | {{title}}
5
+ .avg
6
+ | {{avgFormatted}} ℃
7
+ .minmax
8
+ .min
9
+ | {{minFormatted}} ℃
10
+ .separator
11
+ | —
12
+ .max
13
+ | {{maxFormatted}} ℃
14
+ </template>
15
+ <script lang="js">
16
+ import { defineComponent } from 'vue'
17
+ export default defineComponent({
18
+ name: "Temperature",
19
+ props: {
20
+ title: String,
21
+ min: Number,
22
+ max: Number,
23
+ avg: Number
24
+ },
25
+ computed: {
26
+ minFormatted() {
27
+ return this.min.toFixed(2);
28
+ },
29
+ avgFormatted() {
30
+ return this.avg.toFixed(2);
31
+ },
32
+ maxFormatted() {
33
+ return this.max.toFixed(2);
34
+ },
35
+ },
36
+ })
37
+ </script>
38
+ <style scoped>
39
+ .wrapper {
40
+ flex-direction: column;
41
+ display: inline-flex;
42
+ }
43
+ .avg {
44
+ display: flex;
45
+ font-size: var(--font-size-xlarge);
46
+ justify-content: center;
47
+ }
48
+ .title {
49
+ display: flex;
50
+ font-size: var(--font-size-base);
51
+ justify-content: center;
52
+ }
53
+ .minmax {
54
+ display: flex;
55
+ flex-direction: row;
56
+ justify-content: space-between;
57
+ font-size: var(--font-size-base);
58
+ }
59
+ </style>
package/src/index.js CHANGED
@@ -7,6 +7,7 @@ export { default as Navbar } from './Navbar/Navbar.vue'
7
7
  export { default as StyledTable } from './StyledTable/StyledTable.vue'
8
8
  export { default as Pagination } from './Pagination/Pagination.vue'
9
9
  export { default as Badge } from './Badge/Badge.vue'
10
+ export { default as Temperature } from './Temperature/Temperature.vue'
10
11
  export { default as Modal } from './Modal/Modal.vue'
11
12
  export { default as Spinner } from './Spinner/Spinner.vue'
12
13
  export { default as RangeView } from './RangeView/RangeView.vue'
package/styles/index.css CHANGED
@@ -102,7 +102,7 @@
102
102
  --border-radius-round: 50%;
103
103
  /* CONTAINER */
104
104
  --container-max-width: 1200px;
105
- --container-marging: 0 auto;
105
+ --container-margin: 0 auto;
106
106
  /* NAVBAR */
107
107
  --color-navbar-background: hsl(210, 7%, 21%);
108
108
  --color-navbar-text: hsl(0, 0%, 100%);