@farm-investimentos/front-mfe-components-vue3 0.3.3 → 0.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": "@farm-investimentos/front-mfe-components-vue3",
3
- "version": "0.3.3",
3
+ "version": "0.4.0",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -82,7 +82,7 @@
82
82
  "ts-jest": "^29.0.0",
83
83
  "typescript": "~4.1.5",
84
84
  "vite": "^4.4.9",
85
- "vue": "3.3.10",
85
+ "vue": "3.4.10",
86
86
  "vue-loader": "^16.8.3",
87
87
  "vue-tsc": "^1.8.11",
88
88
  "webpack-cli": "^5.1.4"
@@ -93,4 +93,4 @@
93
93
  "publishConfig": {
94
94
  "@farm-investimentos:registry": "https://registry.npmjs.org"
95
95
  }
96
- }
96
+ }
@@ -1,8 +1,11 @@
1
+ import AlertBox from './AlertBox.vue';
2
+
1
3
  import baseThemeColors from '../../configurations/_theme-colors-base.module.scss';
2
4
  const colors = Object.keys(baseThemeColors);
3
5
 
4
6
  export default {
5
7
  title: 'Feedback/AlertBox',
8
+ component: AlertBox,
6
9
  parameters: {
7
10
  docs: {
8
11
  description: {
@@ -39,89 +39,80 @@
39
39
  :color="color"
40
40
  @click="close"
41
41
  >
42
- <farm-icon variation="darken" size="md" :color="color">close</farm-icon>
42
+ <farm-icon
43
+ variation="darken"
44
+ size="md"
45
+ :color="color"
46
+ >
47
+ close
48
+ </farm-icon>
43
49
  </farm-btn>
44
50
  </div>
45
51
  </transition>
46
52
  </template>
47
53
 
48
- <script lang="ts">
49
- import { ref, PropType } from 'vue';
50
-
51
- import valueWatcher from './valueWatcher';
54
+ <script lang="ts" setup>
55
+ import { PropType } from 'vue';
52
56
 
53
- export default {
57
+ defineOptions({
54
58
  name: 'farm-alertbox',
55
- props: {
56
- /**
57
- * Left Icon?
58
- */
59
- icon: {
60
- type: String,
61
- default: null,
62
- },
63
- /**
64
- * Close icon and option to close AlertBox?
65
- */
66
- dismissable: {
67
- type: Boolean,
68
- default: false,
69
- },
70
- /**
71
- * Dense?
72
- */
73
- dense: {
74
- type: Boolean,
75
- default: false,
76
- },
77
- /**
78
- * Color
79
- */
80
- color: {
81
- type: String as PropType<
82
- | 'primary'
83
- | 'secondary'
84
- | 'secondary-green'
85
- | 'secondary-golden'
86
- | 'neutral'
87
- | 'info'
88
- | 'success'
89
- | 'error'
90
- | 'warning'
91
- | 'success'
92
- | 'extra-1'
93
- | 'extra-2'
94
- >,
95
- default: 'primary',
96
- },
97
- modelValue: {
98
- type: Boolean,
99
- default: true,
100
- },
101
- /**
102
- * Html tag (will be forwarded to farm-typography)
103
- */
104
- tag: {
105
- type: String,
106
- default: 'p',
107
- },
59
+ });
60
+ defineProps({
61
+ /**
62
+ * Left Icon?
63
+ */
64
+ icon: {
65
+ type: String,
66
+ default: null,
108
67
  },
109
- setup(props, { emit }) {
110
- const visible = ref(true);
111
-
112
- function close() {
113
- visible.value = false;
114
- emit('update:modelValue', false);
115
- }
68
+ /**
69
+ * Close icon and option to close AlertBox?
70
+ */
71
+ dismissable: {
72
+ type: Boolean,
73
+ default: false,
74
+ },
75
+ /**
76
+ * Dense?
77
+ */
78
+ dense: {
79
+ type: Boolean,
80
+ default: false,
81
+ },
82
+ /**
83
+ * Color
84
+ */
85
+ color: {
86
+ type: String as PropType<
87
+ | 'primary'
88
+ | 'secondary'
89
+ | 'secondary-green'
90
+ | 'secondary-golden'
91
+ | 'neutral'
92
+ | 'info'
93
+ | 'success'
94
+ | 'error'
95
+ | 'warning'
96
+ | 'success'
97
+ | 'extra-1'
98
+ | 'extra-2'
99
+ >,
100
+ default: 'primary',
101
+ },
102
+ /**
103
+ * Html tag (will be forwarded to farm-typography)
104
+ */
105
+ tag: {
106
+ type: String,
107
+ default: 'p',
108
+ },
109
+ });
116
110
 
117
- valueWatcher(props, visible);
111
+ const visible = defineModel({ type: Boolean, default: true });
118
112
 
119
- return {
120
- visible,
121
- close,
122
- };
123
- },
124
- };
113
+ function close() {
114
+ visible.value = false;
115
+ }
125
116
  </script>
126
117
  <style lang="scss" scoped>
127
118
  @import './AlertBox';
@@ -1,3 +1,4 @@
1
+
1
2
  .datepicker :deep(.v-btn--active) {
2
3
  background: var(--farm-primary-base);
3
4
  }
@@ -1,18 +1,24 @@
1
1
  .dp__main {
2
- font-family: inherit;
2
+ font-family: 'Manrope', sans-serif !important;
3
3
  justify-content: center;
4
4
 
5
5
  :deep(.dp__calendar_row,) {
6
6
  width: calc( 35px * 7);
7
7
  }
8
8
 
9
+ :deep(.dp__month_year_row){
10
+ font-family: 'Manrope', sans-serif !important;
11
+ }
12
+
9
13
  :deep(.dp__calendar_header) {
10
14
  width: calc( 35px * 7);
15
+
11
16
  }
12
17
 
13
18
  :deep(.dp__cell_inner) {
14
19
  font-size: 12px;
15
20
  font-weight: 500;
21
+ font-family: 'Manrope', sans-serif !important;
16
22
  color: var(--farm-neutral-darken);
17
23
  padding: 0;
18
24
  width: 35px;
@@ -60,6 +66,7 @@
60
66
  :deep(.dp__calendar_header) {
61
67
  color: var(--farm-neutral-darken);
62
68
  font-size: 16px;
69
+ font-family: 'Manrope', sans-serif !important;
63
70
  font-weight: 700;
64
71
  margin-top: 16px;
65
72
  }
@@ -6,21 +6,19 @@
6
6
  <slot></slot>
7
7
  </label>
8
8
  </template>
9
- <script lang="ts">
10
-
11
-
12
- export default {
9
+ <script lang="ts" setup>
10
+ defineOptions({
13
11
  name: 'farm-label',
14
- props: {
15
- /**
16
- * Show required indicator
17
- */
18
- required: {
19
- type: Boolean,
20
- default: false,
21
- },
12
+ });
13
+ defineProps({
14
+ /**
15
+ * Show required indicator
16
+ */
17
+ required: {
18
+ type: Boolean,
19
+ default: false,
22
20
  },
23
- };
21
+ });
24
22
  </script>
25
23
  <style lang="scss" scoped>
26
24
  @import 'Label';
@@ -1,10 +1,10 @@
1
1
  @import '../../configurations/variables';
2
2
 
3
- $radius: 5px;
3
+ $radius: 8px;
4
4
 
5
5
  .farm-progressbar {
6
6
  width: 100%;
7
- height: 5px;
7
+ height: 8px;
8
8
  border-radius: $radius;
9
9
  overflow: hidden;
10
10
 
@@ -34,8 +34,7 @@
34
34
  &--extra-decrease {
35
35
  margin: 0 -#{2 * gutter('vuetify')};
36
36
  }
37
-
38
- &--y-grid-gutters > .farm-col {
37
+ &--y-grid-gutters > :deep(.farm-col) {
39
38
  margin-top: 12px;
40
39
  margin-bottom: 12px;
41
40
  }
@@ -76,7 +76,7 @@ export const CssVariables = () => ({
76
76
  bwThemeColorsKeys: Object.keys(bwThemeColors),
77
77
  bwThemeColors: { ...bwThemeColors },
78
78
  backgroundThemeColorsKeys: Object.keys(backgroundThemeColors),
79
- backgroundThemeColors: { ...backgroundThemeColors },
79
+ backgroundThemeColors: { ...backgroundThemeColors },
80
80
  };
81
81
  },
82
82
  template: `<div class="palette-container">
@@ -84,36 +84,36 @@ export const CssVariables = () => ({
84
84
  v-for="key in keys"
85
85
  :key="key"
86
86
  >
87
- <farm-heading :type="5">{{ key }}</farm-heading>
87
+ <farm-heading :type="5">{{ key }}</farm-heading>
88
88
  <span :style="{ backgroundColor: baseThemeColors[key] }">Base <span>--farm-{{ key }}-base</span></span>
89
89
  <span :style="{ backgroundColor: variationThemeColors[key + '-lighten'] }">Lighten<span>--farm-{{ key }}-lighten</span></span>
90
90
  <span :style="{ backgroundColor: variationThemeColors[key + '-darken'], color: 'white' }">Darken: <span>--farm-{{ key }}-darken</span></span>
91
91
  </div>
92
92
 
93
93
  <div>
94
- <farm-heading :type="5">Text</farm-heading>
95
- <span :style="{ color: textThemeColors['text-primary'] }">Primary <span>--farm-text-primary</span></span></span>
94
+ <farm-heading :type="5">Text</farm-heading>
95
+ <span :style="{ color: textThemeColors['text-primary'] }">Primary <span>--farm-text-primary</span></span>
96
96
  <span :style="{ color: textThemeColors['text-secondary'] }">Secondary <span>--farm-text-secondary</span></span>
97
97
  <span :style="{ color: textThemeColors['text-disabled'] }">Disabled <span>--farm-text-disabled</span></span>
98
- </div>
98
+ </div>
99
99
 
100
100
  <div>
101
101
  <farm-heading :type="5">Stroke</farm-heading>
102
- <span :style="{ color: strokeThemeColors['stroke-base'] }">Base <span>--farm-stroke-base</span></span></span>
102
+ <span :style="{ color: strokeThemeColors['stroke-base'] }">Base <span>--farm-stroke-base</span></span>
103
103
  <span :style="{ color: strokeThemeColors['stroke-disabled'] }">Disabled <span>--farm-stroke-disabled</span></span>
104
104
  <span :style="{ color: strokeThemeColors['stroke-divider'] }">Divider <span>--farm-stroke-divider</span></span>
105
- </div>
106
-
105
+ </div>
106
+
107
107
  <div>
108
108
  <farm-heading :type="5">Black & White</farm-heading>
109
- <span v-for="bw in bwThemeColorsKeys" :key="'bw_var_' + bw" :style="{ color: bw !== 'white' ? bwThemeColors[bw] : 'black' }">
109
+ <span v-for="bw in bwThemeColorsKeys" :key="'bw_var1_' + bw" :style="{ color: bw !== 'white' ? bwThemeColors[bw] : 'black' }">
110
110
  {{ bw }} <span>--farm-bw-{{ bw }}</span>
111
111
  </span>
112
112
  </div>
113
113
 
114
114
  <div>
115
115
  <farm-heading :type="5">Background</farm-heading>
116
- <span v-for="bw in backgroundThemeColorsKeys" :key="'bw_var_' + bw" :style="{ backgroundColor: backgroundThemeColors[bw], }">
116
+ <span v-for="bw in backgroundThemeColorsKeys" :key="'bw_var2_' + bw" :style="{ backgroundColor: backgroundThemeColors[bw] }">
117
117
  {{ bw }} <span>--farm-background-{{ bw }}</span>
118
118
  </span>
119
119
  </div>
@@ -1,16 +0,0 @@
1
- import { ref, reactive } from 'vue';
2
-
3
- import valueWatcher from '../valueWatcher';
4
-
5
- describe('valueWatcher', () => {
6
- it('Should change value for visible', done => {
7
- const visible = ref(false);
8
- const mockProps = reactive({ value: false });
9
- valueWatcher(mockProps, visible);
10
- mockProps.value = true;
11
- setTimeout(() => {
12
- expect(visible.value).toBeTruthy();
13
- done();
14
- });
15
- });
16
- });