@namelivia/vue-components 4.5.1 → 4.6.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.
Files changed (43) hide show
  1. package/dist/index.esm.js +860 -931
  2. package/dist/index.esm.js.map +1 -1
  3. package/dist/index.js +865 -936
  4. package/dist/index.js.map +1 -1
  5. package/package.json +1 -1
  6. package/src/Badge/Badge.vue +3 -7
  7. package/src/Buttons/DangerButton/DangerButton.vue +5 -13
  8. package/src/Buttons/RegularButton/RegularButton.vue +24 -28
  9. package/src/Buttons/ResetButton/ResetButton.vue +3 -7
  10. package/src/Buttons/SecondaryButton/SecondaryButton.vue +5 -13
  11. package/src/Buttons/SubmitButton/SubmitButton.vue +4 -12
  12. package/src/Card/Card.vue +13 -19
  13. package/src/Card/CardBody.vue +4 -9
  14. package/src/Card/CardImage.vue +17 -24
  15. package/src/CardGrid/CardGrid.vue +2 -5
  16. package/src/Container/Container.vue +2 -5
  17. package/src/Icons/CalendarIcon/CalendarIcon.vue +10 -13
  18. package/src/Icons/CreateIcon/CreateIcon.vue +10 -13
  19. package/src/Icons/DropIcon/DropIcon.vue +10 -13
  20. package/src/Icons/SaveIcon/SaveIcon.vue +10 -13
  21. package/src/Icons/SkullIcon/SkullIcon.vue +10 -13
  22. package/src/Inputs/CheckBoxInput/CheckBoxInput.vue +9 -27
  23. package/src/Inputs/ImageInput/ImageInput.vue +10 -30
  24. package/src/Inputs/NumberInput/NumberInput.vue +12 -37
  25. package/src/Inputs/ResizeImageUpload/ResizeImageUpload.vue +28 -50
  26. package/src/Inputs/Selector/Selector.vue +27 -52
  27. package/src/Inputs/TextInput/TextInput.vue +10 -31
  28. package/src/Loading/Loading.vue +3 -7
  29. package/src/Modal/Modal.vue +9 -16
  30. package/src/Navbar/MobileMenuButton.vue +5 -17
  31. package/src/Navbar/MobileNavigationLink.vue +9 -27
  32. package/src/Navbar/MobileNavigationLinks.vue +6 -19
  33. package/src/Navbar/Navbar.vue +22 -53
  34. package/src/Navbar/NavbarTitle.vue +7 -19
  35. package/src/Navbar/NavigationLink.vue +9 -27
  36. package/src/Navbar/NavigationLinks.vue +5 -15
  37. package/src/Navbar/RightContent.vue +9 -24
  38. package/src/Pagination/Pagination.vue +8 -14
  39. package/src/RangeView/RangeView.vue +3 -7
  40. package/src/SectionTitle/SectionTitle.vue +5 -9
  41. package/src/Spinner/Spinner.vue +2 -5
  42. package/src/StyledTable/StyledTable.vue +2 -5
  43. package/src/Temperature/Temperature.vue +11 -22
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@namelivia/vue-components",
3
- "version": "4.5.1",
3
+ "version": "4.6.0",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.esm.js",
6
6
  "peerDependencies": {
@@ -2,13 +2,9 @@
2
2
  span(class="badge")
3
3
  | {{text}}
4
4
  </template>
5
- <script lang="js">
6
- import { defineComponent } from 'vue'
7
- export default defineComponent({
8
- name: "Badge",
9
- props: {
10
- text: String,
11
- },
5
+ <script setup>
6
+ defineProps({
7
+ text: String,
12
8
  })
13
9
  </script>
14
10
  <style scoped>
@@ -3,20 +3,12 @@ button(v-on:click="onClick" class="danger-button")
3
3
  | {{text}}
4
4
  </template>
5
5
 
6
- <script lang="js">
7
- import { defineComponent } from 'vue';
8
- export default defineComponent({
9
- name: "DangerButton",
10
- props: {
11
- text: String,
12
- },
13
- emits: ['click'],
14
- methods: {
15
- onClick(evt) {
16
- this.$emit('click', evt);
17
- },
18
- },
6
+ <script setup>
7
+ defineProps({
8
+ text: String,
19
9
  });
10
+ const emit = defineEmits(['click']);
11
+ const onClick = (evt) => emit('click', evt);
20
12
  </script>
21
13
 
22
14
  <style scoped>
@@ -3,36 +3,33 @@ button(v-on:click="onClick" :class="cssClass" :disabled="loading")
3
3
  | {{ loading ? textWhileLoading : text }}
4
4
  </template>
5
5
 
6
- <script lang="js">
7
- import { defineComponent } from 'vue';
8
- export default defineComponent({
9
- name: "RegularButton",
10
- props: {
11
- text: String,
12
- loading: {
13
- type: Boolean,
14
- default: false,
15
- },
16
- textWhileLoading: {
17
- type: String,
18
- default: '...',
19
- },
20
- },
21
- emits: ['click'],
22
- computed: {
23
- cssClass: function () {
24
- if (this.loading) {
25
- return 'regular-button loading';
26
- }
27
- return 'regular-button'
28
- },
6
+ <script setup>
7
+ import { computed } from 'vue';
8
+
9
+ const props = defineProps({
10
+ text: String,
11
+ loading: {
12
+ type: Boolean,
13
+ default: false,
29
14
  },
30
- methods: {
31
- onClick(evt) {
32
- this.$emit('click', evt);
33
- },
15
+ textWhileLoading: {
16
+ type: String,
17
+ default: '...',
34
18
  },
35
19
  });
20
+
21
+ const emit = defineEmits(['click']);
22
+
23
+ const cssClass = computed(() => {
24
+ if (props.loading) {
25
+ return 'regular-button loading';
26
+ }
27
+ return 'regular-button';
28
+ });
29
+
30
+ const onClick = (evt) => {
31
+ emit('click', evt);
32
+ };
36
33
  </script>
37
34
 
38
35
  <style scoped>
@@ -60,4 +57,3 @@ export default defineComponent({
60
57
  background-color: var(--color-regular-disabled);
61
58
  }
62
59
  </style>
63
-
@@ -3,13 +3,9 @@ button(type="reset" class="reset-button")
3
3
  | {{text}}
4
4
  </template>
5
5
 
6
- <script lang="js">
7
- import { defineComponent } from 'vue';
8
- export default defineComponent({
9
- name: "ResetButton",
10
- props: {
11
- text: String,
12
- },
6
+ <script setup>
7
+ defineProps({
8
+ text: String,
13
9
  });
14
10
  </script>
15
11
 
@@ -3,20 +3,12 @@ button(v-on:click="onClick" class="secondary-button")
3
3
  | {{text}}
4
4
  </template>
5
5
 
6
- <script lang="js">
7
- import { defineComponent } from 'vue';
8
- export default defineComponent({
9
- name: "SecondaryButton",
10
- props: {
11
- text: String,
12
- },
13
- emits: ['click'],
14
- methods: {
15
- onClick(evt) {
16
- this.$emit('click', evt);
17
- },
18
- },
6
+ <script setup>
7
+ defineProps({
8
+ text: String,
19
9
  });
10
+ const emit = defineEmits(['click']);
11
+ const onClick = (evt) => emit('click', evt);
20
12
  </script>
21
13
 
22
14
  <style scoped>
@@ -7,18 +7,10 @@ button(
7
7
  | {{text}}
8
8
  </template>
9
9
 
10
- <script lang="js">
11
- import { defineComponent } from 'vue';
12
- export default defineComponent({
13
- name: "SubmitButton",
14
- props: {
15
- text: {
16
- type: String,
17
- },
18
- disabled: {
19
- type: Boolean,
20
- },
21
- },
10
+ <script setup>
11
+ defineProps({
12
+ text: String,
13
+ disabled: Boolean,
22
14
  });
23
15
  </script>
24
16
 
package/src/Card/Card.vue CHANGED
@@ -5,26 +5,20 @@ div(v-if="!dismissed" class="card-container")
5
5
  card-body(:title="title")
6
6
  slot
7
7
  </template>
8
- <script lang="js">
9
- import { default as CardImage } from './CardImage.vue'
10
- import { default as CardBody } from './CardBody.vue'
11
- import { defineComponent } from 'vue'
12
- export default defineComponent({
13
- name: "Card",
14
- props: {
15
- image: String,
16
- title: String,
17
- dismissed: {
18
- type: Boolean,
19
- default: false,
20
- },
21
- },
22
- components: {
23
- CardImage,
24
- CardBody,
8
+ <script setup>
9
+ import CardImage from './CardImage.vue'
10
+ import CardBody from './CardBody.vue'
11
+
12
+ defineProps({
13
+ image: String,
14
+ title: String,
15
+ dismissed: {
16
+ type: Boolean,
17
+ default: false,
25
18
  },
26
- emits: ['width']
27
- })
19
+ });
20
+
21
+ defineEmits(['width']);
28
22
  </script>
29
23
  <style scoped>
30
24
  .card-container {
@@ -5,14 +5,10 @@ div(class="card-body")
5
5
  p(class="card-text")
6
6
  slot
7
7
  </template>
8
- <script lang="js">
9
- import { defineComponent } from 'vue'
10
- export default defineComponent({
11
- name: "CardBody",
12
- props: {
13
- title: String,
14
- },
15
- })
8
+ <script setup>
9
+ defineProps({
10
+ title: String,
11
+ });
16
12
  </script>
17
13
  <style scoped>
18
14
  .card-body {
@@ -30,4 +26,3 @@ export default defineComponent({
30
26
  font-size: var(--font-size-base);
31
27
  }
32
28
  </style>
33
-
@@ -2,32 +2,25 @@
2
2
  img(:src="src" :alt="alt" ref="image")
3
3
  </template>
4
4
 
5
- <script lang="js">
6
- import { defineComponent } from 'vue'
7
- export default defineComponent({
8
- name: "CardImage",
9
- props: {
10
- src: String,
11
- alt: String,
12
- },
13
- data: function () {
14
- return {
15
- imageWidth: 0,
16
- }
17
- },
18
- methods: {
19
- calculateWidth() {
20
- return this.$refs.image.clientWidth
21
- },
22
- },
23
- emits: ['width'],
24
- mounted: function () {
25
- this.$emit('width', this.calculateWidth())
26
- },
27
- })
5
+ <script setup>
6
+ import { ref, onMounted } from 'vue';
7
+
8
+ defineProps({
9
+ src: String,
10
+ alt: String,
11
+ });
12
+
13
+ const emit = defineEmits(['width']);
14
+ const image = ref(null);
15
+
16
+ const calculateWidth = () => image.value.clientWidth;
17
+
18
+ onMounted(() => {
19
+ emit('width', calculateWidth());
20
+ });
28
21
  </script>
29
22
  <style scoped>
30
23
  img {
31
24
  width: 100%;
32
25
  }
33
- </style
26
+ </style>
@@ -2,11 +2,8 @@
2
2
  div(class="card-grid")
3
3
  slot
4
4
  </template>
5
- <script lang="js">
6
- import { defineComponent } from 'vue';
7
- export default defineComponent({
8
- name: "CardGrid"
9
- });
5
+ <script setup>
6
+ // No logic needed
10
7
  </script>
11
8
  <style scoped>
12
9
  .card-grid {
@@ -3,11 +3,8 @@ div(class="container")
3
3
  slot
4
4
  </template>
5
5
 
6
- <script lang="js">
7
- import { defineComponent } from 'vue';
8
- export default defineComponent({
9
- name: "Container"
10
- });
6
+ <script setup>
7
+ // No logic needed
11
8
  </script>
12
9
 
13
10
  <style scoped>
@@ -2,18 +2,15 @@
2
2
  <svg xmlns="http://www.w3.org/2000/svg" :width="size" :height="size" viewBox="0 0 24 24" fill="none" :stroke="color" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-calendar-icon lucide-calendar"><path d="M8 2v4"/><path d="M16 2v4"/><rect width="18" height="18" x="3" y="4" rx="2"/><path d="M3 10h18"/></svg>
3
3
  </template>
4
4
 
5
- <script>
6
- export default {
7
- name: 'CalendarIcon',
8
- props: {
9
- size: {
10
- type: [Number, String],
11
- default: 24
12
- },
13
- color: {
14
- type: String,
15
- default: 'currentColor'
16
- }
5
+ <script setup>
6
+ defineProps({
7
+ size: {
8
+ type: [Number, String],
9
+ default: 24
10
+ },
11
+ color: {
12
+ type: String,
13
+ default: 'currentColor'
17
14
  }
18
- }
15
+ });
19
16
  </script>
@@ -2,18 +2,15 @@
2
2
  <svg xmlns="http://www.w3.org/2000/svg" :width="size" :height="size" viewBox="0 0 24 24" fill="none" :stroke="color" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-badge-plus-icon lucide-badge-plus"><path d="M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z"/><line x1="12" x2="12" y1="8" y2="16"/><line x1="8" x2="16" y1="12" y2="12"/></svg>
3
3
  </template>
4
4
 
5
- <script>
6
- export default {
7
- name: 'CreateIcon',
8
- props: {
9
- size: {
10
- type: [Number, String],
11
- default: 24
12
- },
13
- color: {
14
- type: String,
15
- default: 'currentColor'
16
- }
5
+ <script setup>
6
+ defineProps({
7
+ size: {
8
+ type: [Number, String],
9
+ default: 24
10
+ },
11
+ color: {
12
+ type: String,
13
+ default: 'currentColor'
17
14
  }
18
- }
15
+ });
19
16
  </script>
@@ -16,18 +16,15 @@
16
16
  </svg>
17
17
  </template>
18
18
 
19
- <script>
20
- export default {
21
- name: 'DropIcon',
22
- props: {
23
- size: {
24
- type: [Number, String],
25
- default: 24
26
- },
27
- color: {
28
- type: String,
29
- default: 'currentColor'
30
- }
19
+ <script setup>
20
+ defineProps({
21
+ size: {
22
+ type: [Number, String],
23
+ default: 24
24
+ },
25
+ color: {
26
+ type: String,
27
+ default: 'currentColor'
31
28
  }
32
- }
29
+ });
33
30
  </script>
@@ -2,18 +2,15 @@
2
2
  <svg xmlns="http://www.w3.org/2000/svg" :width="size" :height="size" viewBox="0 0 24 24" fill="none" :stroke="color" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-save-icon lucide-save"><path d="M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z"/><path d="M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7"/><path d="M7 3v4a1 1 0 0 0 1 1h7"/></svg>
3
3
  </template>
4
4
 
5
- <script>
6
- export default {
7
- name: 'SaveIcon',
8
- props: {
9
- size: {
10
- type: [Number, String],
11
- default: 24
12
- },
13
- color: {
14
- type: String,
15
- default: 'currentColor'
16
- }
5
+ <script setup>
6
+ defineProps({
7
+ size: {
8
+ type: [Number, String],
9
+ default: 24
10
+ },
11
+ color: {
12
+ type: String,
13
+ default: 'currentColor'
17
14
  }
18
- }
15
+ });
19
16
  </script>
@@ -2,18 +2,15 @@
2
2
  <svg xmlns="http://www.w3.org/2000/svg" :width="size" :height="size" viewBox="0 0 24 24" fill="none" :stroke="color" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-skull-icon lucide-skull"><path d="m12.5 17-.5-1-.5 1h1z"/><path d="M15 22a1 1 0 0 0 1-1v-1a2 2 0 0 0 1.56-3.25 8 8 0 1 0-11.12 0A2 2 0 0 0 8 20v1a1 1 0 0 0 1 1z"/><circle cx="15" cy="12" r="1"/><circle cx="9" cy="12" r="1"/></svg>
3
3
  </template>
4
4
 
5
- <script>
6
- export default {
7
- name: 'SkullIcon',
8
- props: {
9
- size: {
10
- type: [Number, String],
11
- default: 24
12
- },
13
- color: {
14
- type: String,
15
- default: 'currentColor'
16
- }
5
+ <script setup>
6
+ defineProps({
7
+ size: {
8
+ type: [Number, String],
9
+ default: 24
10
+ },
11
+ color: {
12
+ type: String,
13
+ default: 'currentColor'
17
14
  }
18
- }
15
+ });
19
16
  </script>
@@ -12,34 +12,16 @@ div(class="checkbox-container")
12
12
  label(class="checkbox-label" :for="id") {{ label }}
13
13
  </template>
14
14
 
15
- <script lang="js">
16
- import { defineComponent } from 'vue';
17
- export default defineComponent({
18
- name: "CheckBoxInput",
19
- props: {
20
- id: {
21
- type: String,
22
- },
23
- required: {
24
- type: Boolean,
25
- },
26
- placeholder: {
27
- type: String,
28
- },
29
- label: {
30
- type: String,
31
- },
32
- checked: {
33
- type: Boolean,
34
- },
35
- },
36
- emits: ['update'],
37
- methods: {
38
- onInput(event) {
39
- this.$emit('update', event.target.value);
40
- },
41
- },
15
+ <script setup>
16
+ defineProps({
17
+ id: String,
18
+ required: Boolean,
19
+ placeholder: String,
20
+ label: String,
21
+ checked: Boolean,
42
22
  });
23
+ const emit = defineEmits(['update']);
24
+ const onInput = (event) => emit('update', event.target.value);
43
25
  </script>
44
26
 
45
27
  <style scoped>
@@ -16,37 +16,17 @@
16
16
  )
17
17
  </template>
18
18
 
19
- <script>
20
- import { defineComponent } from 'vue';
21
- export default defineComponent({
22
- name: "ImageInput",
23
- props: {
24
- id: {
25
- type: String,
26
- },
27
- required: {
28
- type: Boolean,
29
- },
30
- placeholder: {
31
- type: String,
32
- },
33
- dropPlaceholder: {
34
- type: String,
35
- },
36
- label: {
37
- type: String,
38
- },
39
- file: {
40
- type: Object,
41
- },
42
- },
43
- emits: ['update'],
44
- methods: {
45
- onInput(event) {
46
- this.$emit('update', event.target.files[0]);
47
- },
48
- },
19
+ <script setup>
20
+ defineProps({
21
+ id: String,
22
+ required: Boolean,
23
+ placeholder: String,
24
+ dropPlaceholder: String,
25
+ label: String,
26
+ file: Object,
49
27
  });
28
+ const emit = defineEmits(['update']);
29
+ const onInput = (event) => emit('update', event.target.files[0]);
50
30
  </script>
51
31
 
52
32
  <style scoped>
@@ -17,43 +17,19 @@ div(class="number-input-container")
17
17
  )
18
18
  </template>
19
19
 
20
- <script lang="js">
21
- import { defineComponent } from 'vue';
22
- export default defineComponent({
23
- name: "NumberInput",
24
- props: {
25
- id: {
26
- type: String,
27
- },
28
- required: {
29
- type: Boolean,
30
- },
31
- disabled: {
32
- type: Boolean,
33
- },
34
- placeholder: {
35
- type: String,
36
- },
37
- label: {
38
- type: String,
39
- },
40
- amount: {
41
- type: Number,
42
- },
43
- min: {
44
- type: String,
45
- },
46
- step: {
47
- type: String,
48
- },
49
- },
50
- emits: ['update'],
51
- methods: {
52
- onInput(event) {
53
- this.$emit('update', event.target.value);
54
- },
55
- },
20
+ <script setup>
21
+ defineProps({
22
+ id: String,
23
+ required: Boolean,
24
+ disabled: Boolean,
25
+ placeholder: String,
26
+ label: String,
27
+ amount: Number,
28
+ min: String,
29
+ step: String,
56
30
  });
31
+ const emit = defineEmits(['update']);
32
+ const onInput = (event) => emit('update', event.target.value);
57
33
  </script>
58
34
 
59
35
  <style scoped>
@@ -92,4 +68,3 @@ export default defineComponent({
92
68
  cursor: not-allowed;
93
69
  }
94
70
  </style>
95
-