@farm-investimentos/front-mfe-components 14.2.2 → 15.0.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 (140) hide show
  1. package/dist/front-mfe-components.common.js +1232 -1133
  2. package/dist/front-mfe-components.common.js.map +1 -1
  3. package/dist/front-mfe-components.css +2 -2
  4. package/dist/front-mfe-components.umd.js +1232 -1133
  5. package/dist/front-mfe-components.umd.js.map +1 -1
  6. package/dist/front-mfe-components.umd.min.js +1 -1
  7. package/dist/front-mfe-components.umd.min.js.map +1 -1
  8. package/package.json +1 -1
  9. package/src/components/AlertBox/AlertBox.scss +3 -2
  10. package/src/components/AlertBox/AlertBox.vue +2 -0
  11. package/src/components/Buttons/DefaultButton/DefaultButton.scss +35 -9
  12. package/src/components/Buttons/DefaultButton/DefaultButton.stories.js +4 -4
  13. package/src/components/Buttons/DefaultButton/DefaultButton.vue +2 -0
  14. package/src/components/Card/Card.scss +1 -1
  15. package/src/components/Card/CardComposition.stories.ts +8 -2
  16. package/src/components/Card/CardContent/CardContent.scss +11 -0
  17. package/src/components/Card/CardContent/CardContent.stories.js +11 -0
  18. package/src/components/Card/CardContent/CardContent.vue +9 -1
  19. package/src/components/CardContext/__tests__/CardContext.spec.js +5 -2
  20. package/src/components/Checkbox/Checkbox.scss +2 -2
  21. package/src/components/Checkbox/Checkbox.vue +2 -1
  22. package/src/components/Chip/Chip.scss +15 -15
  23. package/src/components/Chip/Chip.stories.js +13 -13
  24. package/src/components/Chip/Chip.stories.scss +1 -16
  25. package/src/components/Chip/Chip.vue +25 -3
  26. package/src/components/Collapsible/Collapsible.scss +8 -3
  27. package/src/components/Collapsible/Collapsible.stories.js +68 -1
  28. package/src/components/Collapsible/Collapsible.vue +68 -8
  29. package/src/components/ContextMenu/ContextMenu.scss +1 -1
  30. package/src/components/ContextMenu/ContextMenu.stories.js +3 -3
  31. package/src/components/ContextMenu/ContextMenu.vue +14 -2
  32. package/src/components/CopyToClipboard/CopyToClipboard.stories.js +7 -1
  33. package/src/components/CopyToClipboard/CopyToClipboard.vue +15 -3
  34. package/src/components/DataTableEmptyWrapper/DataTableEmptyWrapper.scss +6 -9
  35. package/src/components/DataTableEmptyWrapper/DataTableEmptyWrapper.stories.js +4 -0
  36. package/src/components/DataTableEmptyWrapper/DataTableEmptyWrapper.vue +21 -5
  37. package/src/components/{TextField/__tests__/TextField.spec.js → DataTableEmptyWrapper/__tests__/DataTableEmptyWrapper.spec.js} +3 -3
  38. package/src/components/DataTableHeader/DataTableHeader.scss +10 -12
  39. package/src/components/DataTableHeader/DataTableHeader.vue +5 -4
  40. package/src/components/DataTablePaginator/DataTablePaginator.scss +71 -69
  41. package/src/components/DatePicker/DatePicker.scss +5 -5
  42. package/src/components/DatePicker/vDatePicker.scss +214 -0
  43. package/src/components/DialogFooter/DialogFooter.scss +1 -1
  44. package/src/components/DialogFooter/DialogFooter.stories.js +2 -2
  45. package/src/components/DialogFooter/DialogFooter.vue +1 -1
  46. package/src/components/DialogHeader/DialogHeader.scss +2 -3
  47. package/src/components/DialogHeader/DialogHeader.vue +4 -4
  48. package/src/components/Form/Form.stories.js +1 -1
  49. package/src/components/Icon/Icon.scss +6 -0
  50. package/src/components/Icon/Icon.stories.js +19 -1
  51. package/src/components/Icon/Icon.vue +8 -2
  52. package/src/components/IconBox/IconBox.stories.js +16 -0
  53. package/src/components/IconBox/IconBox.vue +17 -7
  54. package/src/components/IdCaption/IdCaption.vue +27 -13
  55. package/src/components/Label/Label.scss +17 -5
  56. package/src/components/Label/Label.stories.js +0 -1
  57. package/src/components/ListItem/ListItem.scss +5 -3
  58. package/src/components/ListItem/ListItem.vue +2 -0
  59. package/src/components/Logger/LoggerItem/LoggerItem.scss +9 -1
  60. package/src/components/Logger/LoggerItem/LoggerItem.vue +25 -8
  61. package/src/components/Logger/LoggerItem/__tests__/LoggerItem.spec.js +1 -1
  62. package/src/components/MainFilter/MainFilter.stories.js +4 -4
  63. package/src/components/Modal/Modal.scss +3 -3
  64. package/src/components/ModalPromptUser/ModalPromptUser.stories.js +26 -0
  65. package/src/components/ModalPromptUser/ModalPromptUser.vue +10 -0
  66. package/src/components/MultipleFilePicker/MultipleFilePicker.scss +19 -12
  67. package/src/components/MultipleFilePicker/MultipleFilePicker.stories.js +12 -0
  68. package/src/components/MultipleFilePicker/MultipleFilePicker.vue +18 -11
  69. package/src/components/MultipleFilePicker/__tests__/MultipleFilePicker.spec.js +9 -0
  70. package/src/components/ProgressBar/ProgressBar.vue +4 -0
  71. package/src/components/Radio/Radio.scss +18 -4
  72. package/src/components/Radio/Radio.stories.js +2 -1
  73. package/src/components/Radio/Radio.vue +3 -1
  74. package/src/components/ResourceMetaInfo/ResourceMetaInfo.vue +8 -8
  75. package/src/components/Select/Select.scss +4 -0
  76. package/src/components/Select/Select.vue +4 -0
  77. package/src/components/Stepper/StepperHeader/StepperHeader.scss +7 -7
  78. package/src/components/Switcher/Switcher.scss +24 -8
  79. package/src/components/Switcher/Switcher.stories.js +33 -0
  80. package/src/components/Switcher/Switcher.vue +24 -3
  81. package/src/components/TableContextMenu/TableContextMenu.scss +4 -9
  82. package/src/components/TableContextMenu/TableContextMenu.stories.js +2 -0
  83. package/src/components/TableContextMenu/TableContextMenu.vue +3 -3
  84. package/src/components/Tabs/Tabs.scss +21 -10
  85. package/src/components/Tabs/Tabs.vue +45 -24
  86. package/src/components/TextArea/TextArea.scss +7 -3
  87. package/src/components/TextArea/TextArea.vue +1 -0
  88. package/src/components/TextFieldV2/TextFieldV2.scss +8 -4
  89. package/src/components/TextFieldV2/TextFieldV2.vue +1 -0
  90. package/src/components/Tooltip/Tooltip.scss +8 -10
  91. package/src/components/Tooltip/Tooltip.vue +4 -2
  92. package/src/components/Typography/BodyText/BodyText.scss +7 -7
  93. package/src/components/Typography/Caption/Caption.scss +7 -7
  94. package/src/components/Typography/Caption/Caption.stories.js +1 -1
  95. package/src/components/Typography/Caption/Caption.vue +4 -1
  96. package/src/components/Typography/Caption/configurations.ts +3 -2
  97. package/src/components/Typography/Heading/Heading.scss +19 -19
  98. package/src/components/Typography/Heading/configurations.ts +5 -5
  99. package/src/components/Typography/Small/Small.scss +3 -0
  100. package/src/components/Typography/Small/Small.stories.js +34 -0
  101. package/src/components/Typography/Small/Small.vue +47 -0
  102. package/src/components/Typography/Small/__tests__/Small.spec.js +31 -0
  103. package/src/components/Typography/Small/configurations.ts +7 -0
  104. package/src/components/Typography/Subtitle/Subtitle.scss +7 -7
  105. package/src/components/Typography/Typography.scss +10 -0
  106. package/src/components/Typography/Typography.stories.js +15 -2
  107. package/src/components/Typography/Typography.vue +6 -2
  108. package/src/components/Typography/index.ts +2 -1
  109. package/src/components/ValueCaption/ValueCaption.vue +2 -0
  110. package/src/components/layout/Line/Line.scss +15 -0
  111. package/src/components/layout/Line/Line.stories.js +28 -5
  112. package/src/components/layout/Line/Line.vue +37 -3
  113. package/src/configurations/_mixins.scss +1 -1
  114. package/src/configurations/_theme-colors-background.scss +10 -0
  115. package/src/configurations/_theme-colors-bw.scss +10 -0
  116. package/src/configurations/_theme-colors.scss +79 -48
  117. package/src/configurations/_variables.scss +2 -0
  118. package/src/examples/Colors.stories.js +39 -1
  119. package/src/examples/Colors.stories.scss +1 -1
  120. package/src/helpers/index.ts +2 -1
  121. package/src/helpers/isChildOfFixedElement.js +16 -0
  122. package/src/main.ts +0 -3
  123. package/src/scss/Sticky-table.scss +8 -6
  124. package/src/scss/VuejsDialog.scss +58 -51
  125. package/src/scss/cssVariablesGenerator.scss +17 -14
  126. package/src/scss/utils.scss +17 -251
  127. package/src/components/FilePicker/FilePicker.scss +0 -53
  128. package/src/components/FilePicker/FilePicker.stories.js +0 -14
  129. package/src/components/FilePicker/FilePicker.vue +0 -109
  130. package/src/components/FilePicker/__tests__/FilePicker.spec.js +0 -77
  131. package/src/components/FilePicker/index.ts +0 -3
  132. package/src/components/TextField/TextField.scss +0 -43
  133. package/src/components/TextField/TextField.stories.js +0 -104
  134. package/src/components/TextField/TextField.vue +0 -18
  135. package/src/components/TextField/index.ts +0 -4
  136. package/src/scss/ButtonOverrides.scss +0 -73
  137. package/src/scss/DefaultModal.scss +0 -89
  138. package/src/scss/DialogOverrides.scss +0 -94
  139. package/src/scss/FormOverrides.scss +0 -264
  140. package/src/scss/Status-Chip.scss +0 -34
@@ -1,4 +1,6 @@
1
1
  import Switch from './Switcher';
2
+ import baseThemeColors from '../../configurations/_theme-colors-base.scss';
3
+ const colors = Object.keys(baseThemeColors);
2
4
 
3
5
  export default {
4
6
  title: 'Form/Switcher',
@@ -58,3 +60,34 @@ export const OffDisabled = () => ({
58
60
  <farm-switcher v-model="selectedValue" block :disabled="true" />
59
61
  </div>`,
60
62
  });
63
+
64
+ export const Colors = () => ({
65
+ data() {
66
+ return {
67
+ colors,
68
+ selectedValue: true,
69
+ };
70
+ },
71
+ template: `
72
+ <farm-row>
73
+ <farm-col
74
+ cols="12"
75
+ md="3"
76
+ v-for="color in colors"
77
+ :key="'color_' + color"
78
+ >
79
+ <farm-bodytext>{{ color }}</farm-bodytext>
80
+ <farm-switcher
81
+ v-model="selectedValue"
82
+ :color="color"
83
+ />
84
+ <farm-caption>Desabilitado</farm-caption>
85
+ <farm-switcher
86
+ disabled
87
+ v-model="selectedValue"
88
+ :color="color"
89
+ />
90
+ </farm-col>
91
+
92
+ </farm-row>`,
93
+ });
@@ -2,6 +2,7 @@
2
2
  <div
3
3
  :class="{ 'farm-switch': true }"
4
4
  role="checkbox"
5
+ v-bind="$props"
5
6
  @click="toggle"
6
7
  @keydown.space.prevent="toggle"
7
8
  >
@@ -10,11 +11,31 @@
10
11
  </div>
11
12
  </template>
12
13
  <script lang="ts">
13
- import Vue from 'vue';
14
+ import Vue, { PropType } from 'vue';
14
15
 
15
16
  export default Vue.extend({
16
17
  name: 'farm-switcher',
17
18
  props: {
19
+ /**
20
+ * Color
21
+ */
22
+ color: {
23
+ type: String as PropType<
24
+ | 'primary'
25
+ | 'secondary'
26
+ | 'secondary-green'
27
+ | 'secondary-golden'
28
+ | 'neutral'
29
+ | 'info'
30
+ | 'success'
31
+ | 'error'
32
+ | 'warning'
33
+ | 'extra-1'
34
+ | 'extra-2'
35
+ | 'gray'
36
+ >,
37
+ default: 'primary',
38
+ },
18
39
  /**
19
40
  * v-model binding
20
41
  */
@@ -37,8 +58,8 @@ export default Vue.extend({
37
58
  return {
38
59
  'farm-switch--selected': this.value && !this.isDisabled,
39
60
  'farm-switch--idle': !this.value && !this.isDisabled,
40
- 'farm-switch--disabled-on': this.value && this.isDisabled,
41
- 'farm-switch--disabled-off': !this.value && this.isDisabled,
61
+ 'farm-switch--disabled-on': this.value && this.isDisabled,
62
+ 'farm-switch--disabled-off': !this.value && this.isDisabled,
42
63
  };
43
64
  },
44
65
  indicatorStyles() {
@@ -3,12 +3,7 @@
3
3
  pointer-events: none;
4
4
  }
5
5
  }
6
-
7
- .farm-listitem {
8
- padding: auto 8px;
9
-
10
- .farm-icon {
11
- vertical-align: sub;
12
- margin-right: 8px;
13
- }
14
- }
6
+ :deep(.farm-listitem .farm-icon) {
7
+ vertical-align: sub;
8
+ margin-right: 8px;
9
+ }
@@ -50,6 +50,8 @@ export const Multi = () => ({
50
50
  { label: 'Novo', icon: { type: 'open-in-new' } },
51
51
  { label: 'Editar', icon: { color: 'secondary', type: 'open-in-new' } },
52
52
  { label: 'Remover', icon: { color: 'error', type: 'delete' } },
53
+ { label: 'Outro', icon: { color: 'black', type: 'cog' } },
54
+ { label: 'Book', icon: { color: 'gray', type: 'book' } },
53
55
  ],
54
56
  };
55
57
  },
@@ -6,8 +6,8 @@
6
6
  <template v-slot:activator>
7
7
  <farm-btn
8
8
  icon
9
- title="Abrir opções"
10
- color="secondary"
9
+ title="Ver opções"
10
+ color="secondary-green"
11
11
  :disabled="disabled"
12
12
  @click="toggleValue"
13
13
  >
@@ -26,7 +26,7 @@
26
26
  <farm-icon v-if="item.icon" size="sm" :color="item.icon.color || 'primary'">
27
27
  {{ item.icon.type }}
28
28
  </farm-icon>
29
- <farm-caption bold tag="span">{{ item.label }}</farm-caption>
29
+ <farm-caption bold tag="span" :color="item.icon.color || 'primary'">{{ item.label }}</farm-caption>
30
30
  </farm-listitem>
31
31
  </farm-list>
32
32
  </farm-contextmenu>
@@ -1,15 +1,22 @@
1
+ @import '../../configurations/theme-colors';
2
+
1
3
  .tabs {
2
4
  display: flex;
5
+ margin-bottom: -1px;
3
6
 
4
7
  &__tab {
5
- border-bottom: 1px solid var(--farm-gray-lighten);
8
+ border-bottom: 1px solid var(--farm-primary-lighten);
6
9
  cursor: pointer;
7
10
  display: inline-flex;
8
- padding: 16px 24px;
11
+ padding: 18px 24px 14px;
9
12
  height: 54px;
10
-
13
+ transition: all 0.5s ease;
11
14
  &:hover {
12
- background-color: var(--farm-neutral-lighten);
15
+ background-color: transparentize(themeColor('primary', 'base'), 0.86);
16
+
17
+ div.rounded-circle {
18
+ opacity: 0.86;
19
+ }
13
20
  }
14
21
 
15
22
  span {
@@ -17,14 +24,11 @@
17
24
  }
18
25
 
19
26
  &--selected {
20
- border-bottom: 4px solid var(--farm-primary-base);
21
- transition: border-bottom 0.2s ease-in-out;
22
27
 
23
- &:hover {
24
- background-color: var(--farm-primary-lighten);
25
- }
28
+ border-bottom: 4px solid var(--farm-primary-base);
26
29
 
27
30
  span {
31
+ font-size: 14px;
28
32
  font-weight: 500;
29
33
  }
30
34
  }
@@ -47,12 +51,19 @@
47
51
  }
48
52
  }
49
53
 
54
+ .farm-tabs {
55
+ border-bottom: 1px solid var(--farm-primary-lighten);
56
+ }
57
+
58
+
50
59
  div.rounded-circle {
51
60
  background-color: var(--farm-gray-lighten);
52
61
  width: 24px;
53
62
  height: 24px;
63
+ margin-top: -2px;
64
+ margin-left: -2px;
54
65
 
55
66
  &.is-selected {
56
67
  background-color: var(--farm-primary-base);
57
68
  }
58
- }
69
+ }
@@ -1,34 +1,43 @@
1
1
  <template>
2
- <div class="tabs" :class="{ 'tabs--disabled': !allowUserChange }">
3
- <div
4
- v-for="(tab, index) in tabs"
5
- class="tabs__tab"
6
- :key="index"
7
- :class="{ hideCounter: !showCounter, 'tabs__tab--selected': isSelected(index) }"
8
- @click="changeTab(tab, index)"
9
- >
2
+ <div class="farm-tabs">
3
+ <div class="tabs" :class="{ 'tabs--disabled': !allowUserChange }">
10
4
  <div
11
- v-if="showCounter"
12
- class="mr-2 rounded-circle d-inline-flex align-center justify-center white--text"
13
- :class="{ 'is-selected': isSelected(index) }"
5
+ v-for="(tab, index) in tabs"
6
+ class="tabs__tab"
7
+ :key="index"
8
+ :class="{ hideCounter: !showCounter, 'tabs__tab--selected': isSelected(index) }"
9
+ @click="changeTab(tab, index)"
14
10
  >
11
+ <div
12
+ v-if="showCounter"
13
+ class="
14
+ mr-2
15
+ rounded-circle
16
+ d-inline-flex
17
+ align-center
18
+ justify-center
19
+ white--text
20
+ "
21
+ :class="{ 'is-selected': isSelected(index) }"
22
+ >
23
+ <farm-subtitle
24
+ color="white"
25
+ tag="span"
26
+ :type="2"
27
+ :color-variation="isSelected(index) ? 'base' : 'darken'"
28
+ >
29
+ {{ index + 1 }}
30
+ </farm-subtitle>
31
+ </div>
15
32
  <farm-subtitle
16
- color="white"
17
33
  tag="span"
18
34
  :type="2"
35
+ :color="isSelected(index) ? 'primary' : 'gray'"
19
36
  :color-variation="isSelected(index) ? 'base' : 'darken'"
20
37
  >
21
- {{ index + 1 }}
38
+ {{ forceUppercase ? tab.name.toUpperCase() : tab.name }}
22
39
  </farm-subtitle>
23
40
  </div>
24
- <farm-subtitle
25
- tag="span"
26
- :type="2"
27
- :color="isSelected(index) ? 'primary' : 'gray'"
28
- :color-variation="isSelected(index) ? 'base' : 'darken'"
29
- >
30
- {{ tab.name }}
31
- </farm-subtitle>
32
41
  </div>
33
42
  </div>
34
43
  </template>
@@ -37,9 +46,11 @@
37
46
  import Vue from 'vue';
38
47
  export default Vue.extend({
39
48
  name: 'farm-tabs',
40
- data: () => ({
41
- selected: 0,
42
- }),
49
+ data() {
50
+ return {
51
+ selected: 0,
52
+ };
53
+ },
43
54
  props: {
44
55
  tabs: {
45
56
  type: Array,
@@ -58,6 +69,9 @@ export default Vue.extend({
58
69
  type: Boolean,
59
70
  default: true,
60
71
  },
72
+ /**
73
+ * Initial tab selected
74
+ */
61
75
  initialSelect: {
62
76
  type: Number,
63
77
  default: 0,
@@ -66,6 +80,13 @@ export default Vue.extend({
66
80
  type: Boolean,
67
81
  default: true,
68
82
  },
83
+ /**
84
+ * Force uppercase in tab
85
+ */
86
+ forceUppercase: {
87
+ type: Boolean,
88
+ default: true,
89
+ },
69
90
  },
70
91
  methods: {
71
92
  isSelected(index) {
@@ -12,7 +12,7 @@
12
12
  align-items: center;
13
13
  gap: 8px;
14
14
  border: 1px solid;
15
- border-color: var(--farm-gray-lighten);
15
+ border-color: var(--farm-bw-black-10);
16
16
  min-height: 36px;
17
17
  border-radius: 5px;
18
18
  padding: 8px 0 0 8px;
@@ -23,7 +23,7 @@
23
23
  & > textarea {
24
24
  flex: 1;
25
25
  outline: none;
26
- color: var(--farm-text-primary);
26
+ color: var(--farm-bw-black-50);
27
27
  font-size: 12px;
28
28
  font-weight: 400;
29
29
  max-width: 100%;
@@ -31,9 +31,13 @@
31
31
  }
32
32
  }
33
33
 
34
+ &--focused .farm-textarea--textarea {
35
+ border-color: var(--farm-bw-black-30);
36
+ }
37
+
34
38
  &--disabled {
35
39
  textarea {
36
- color: var(--farm-gray-base);
40
+ color: var(--farm-bw-black-30);
37
41
  }
38
42
  }
39
43
 
@@ -9,6 +9,7 @@
9
9
  'farm-textarea--error': hasError,
10
10
  'farm-textarea--disabled': disabled,
11
11
  'farm-textarea--hiddendetails': hideDetails,
12
+ 'farm-textarea--focused': isFocus && !readonly,
12
13
  }"
13
14
  >
14
15
  <div
@@ -12,7 +12,7 @@
12
12
  align-items: center;
13
13
  gap: 8px;
14
14
  border: 1px solid;
15
- border-color: var(--farm-gray-lighten);
15
+ border-color: var(--farm-bw-black-10);
16
16
  height: 36px;
17
17
  border-radius: 5px;
18
18
  padding: 8px;
@@ -26,7 +26,7 @@
26
26
  & > input {
27
27
  flex: 1;
28
28
  outline: none;
29
- color: var(--farm-text-primary);
29
+ color: var(--farm-bw-black-50);
30
30
  font-size: 12px;
31
31
  font-weight: 400;
32
32
  max-width: 100%;
@@ -39,12 +39,16 @@
39
39
  width: 100%;
40
40
  }
41
41
 
42
+ &--focused .farm-textfield--input {
43
+ border-color: var(--farm-bw-black-30);
44
+ }
45
+
42
46
  &--disabled {
43
47
  input {
44
- color: var(--farm-gray-base);
48
+ color: var(--farm-bw-black-30);
45
49
  }
46
50
  .farm-icon {
47
- color: var(--farm-gray-lighten);
51
+ color: var(--farm-bw-black-30);
48
52
  cursor: default;
49
53
  }
50
54
  }
@@ -7,6 +7,7 @@
7
7
  'farm-textfield--touched': isTouched,
8
8
  'farm-textfield--blured': isBlured,
9
9
  'farm-textfield--error': hasError,
10
+ 'farm-textfield--focused': isFocus && !readonly,
10
11
  'farm-textfield--disabled': disabled,
11
12
  'farm-textfield--hiddendetails': hideDetails,
12
13
  'farm-textfield--uppercase': isUppercase,
@@ -8,14 +8,12 @@
8
8
 
9
9
  .farm-tooltip__popup {
10
10
  background-color: rgba(themeColor('primary'), 0.95);
11
-
12
- @each $color in $colors {
13
- @each $color in $theme-colors-list {
14
- &.farm-tooltip--#{$color} {
15
- background-color: rgba(themeColor($color), 0.95);
16
- }
11
+ @each $color in $theme-colors-list {
12
+ &.farm-tooltip--#{$color} {
13
+ background-color: rgba(themeColor($color), 0.95);
17
14
  }
18
15
  }
16
+
19
17
  }
20
18
 
21
19
  .farm-tooltip__popup {
@@ -26,10 +24,10 @@
26
24
  width: 160px;
27
25
  contain: content;
28
26
  color: white;
29
- background-color: themeColor('primary');
30
- border-radius: 4px;
31
- font-family: 'Montserrat', sans-serif !important;
32
- font-size: 14px;
27
+ border-radius: 5px;
28
+ font-family: 'Manrope', sans-serif !important;
29
+ font-size: 12px;
30
+ font-weight: 500px;
33
31
  padding: 8px 12px;
34
32
  display: block;
35
33
 
@@ -33,16 +33,18 @@ export default Vue.extend({
33
33
  type: String as PropType<
34
34
  | 'primary'
35
35
  | 'secondary'
36
+ | 'secondary-green'
37
+ | 'secondary-golden'
36
38
  | 'neutral'
37
39
  | 'info'
38
40
  | 'success'
39
41
  | 'error'
40
42
  | 'warning'
41
- | 'success'
42
43
  | 'extra-1'
43
44
  | 'extra-2'
45
+ | 'gray'
44
46
  >,
45
- default: 'secondary',
47
+ default: 'gray',
46
48
  },
47
49
  /**
48
50
  * Control visibility
@@ -1,8 +1,8 @@
1
1
  .farm-bodytext {
2
- &--1 {
3
- letter-spacing: 0.5px;
4
- }
5
- &--2 {
6
- letter-spacing: 0.25px;
7
- }
8
- }
2
+ &--1 {
3
+ letter-spacing: 0.5px;
4
+ }
5
+ &--2 {
6
+ letter-spacing: 0.5px;
7
+ }
8
+ }
@@ -1,8 +1,8 @@
1
1
  .farm-subtitle {
2
- &--1 {
3
- letter-spacing: 0.4px;
4
- }
5
- &--2 {
6
- letter-spacing: 0.15px;
7
- }
8
- }
2
+ &--1 {
3
+ letter-spacing: 0.5px;
4
+ }
5
+ &--2 {
6
+ letter-spacing: 0.5px;
7
+ }
8
+ }
@@ -19,7 +19,7 @@ export default {
19
19
  export const Primary = () => ({
20
20
  data() {
21
21
  return {
22
- variations: ['regular', 'medium'],
22
+ variations: ['regular', 'medium', 'semiBold'],
23
23
  };
24
24
  },
25
25
  template: `<div>
@@ -22,7 +22,10 @@ export default Vue.extend({
22
22
  /**
23
23
  * Variation of the caption
24
24
  */
25
- variation: { type: String as PropType<'regular' | 'medium'>, default: 'medium' },
25
+ variation: {
26
+ type: String as PropType<'regular' | 'medium' | 'semiBold'>,
27
+ default: 'medium',
28
+ },
26
29
  },
27
30
  setup(props) {
28
31
  const { variation } = toRefs(props);
@@ -1,6 +1,7 @@
1
1
  const Keys = {
2
- 'regular': { weight: 400, size: 'sm' },
3
- 'medium': { weight: 500, size: 'sm' },
2
+ regular: { weight: 400, size: 'sm' },
3
+ medium: { weight: 500, size: 'sm' },
4
+ semiBold: { weight: 600, size: 'sm' },
4
5
  };
5
6
 
6
7
  export { Keys };
@@ -1,20 +1,20 @@
1
1
  .farm-heading-- {
2
- &h1 {
3
- letter-spacing: -1.5px;
4
- }
5
- &h2 {
6
- letter-spacing: -0.5px;
7
- }
8
- &h3 {
9
- letter-spacing: 0;
10
- }
11
- &h4 {
12
- letter-spacing: 0.25px;
13
- }
14
- &h5 {
15
- letter-spacing: 0;
16
- }
17
- &h6 {
18
- letter-spacing: 0.15px;
19
- }
20
- }
2
+ &h1 {
3
+ letter-spacing: 0.5px;
4
+ }
5
+ &h2 {
6
+ letter-spacing: 0.5px;
7
+ }
8
+ &h3 {
9
+ letter-spacing: 0.5px;
10
+ }
11
+ &h4 {
12
+ letter-spacing: 0.75px;
13
+ }
14
+ &h5 {
15
+ letter-spacing: 0.75px;
16
+ }
17
+ &h6 {
18
+ letter-spacing: 0.75px;
19
+ }
20
+ }
@@ -1,9 +1,9 @@
1
1
  const Keys = {
2
- 1: { weight: 300, size: '60px' },
3
- 2: { weight: 300, size: '56px' },
4
- 3: { weight: 400, size: '48px' },
5
- 4: { weight: 400, size: '32px' },
6
- 5: { weight: 400, size: 'xl' },
2
+ 1: { weight: 200, size: '60px' },
3
+ 2: { weight: 300, size: '52px' },
4
+ 3: { weight: 600, size: '44px' },
5
+ 4: { weight: 500, size: '32px' },
6
+ 5: { weight: 600, size: 'xl' },
7
7
  6: { weight: 500, size: 'lg' },
8
8
  };
9
9
 
@@ -0,0 +1,3 @@
1
+ .farm-small {
2
+ letter-spacing: 0.5px;
3
+ }
@@ -0,0 +1,34 @@
1
+ import Small from './Small';
2
+
3
+ export default {
4
+ title: 'Typography/Small',
5
+ component: Small,
6
+ parameters: {
7
+ docs: {
8
+ description: {
9
+ component: `Small<br />
10
+ selector: <em>farm-bodysmall</em><br />
11
+ <span style="color: var(--farm-primary-base);">ready for use</span>
12
+ `,
13
+ },
14
+ },
15
+ viewMode: 'docs',
16
+ },
17
+ };
18
+
19
+ export const Primary = () => ({
20
+ data() {
21
+ return {
22
+ variations: ['regular', 'medium', 'bold'],
23
+ };
24
+ },
25
+ template: `<div >
26
+ <div v-for="variation in variations" :key="variation">
27
+ <farm-bodysmall :variation="variation">
28
+ Small {{ variation }}
29
+ </farm-bodysmall>
30
+ </div>
31
+ </div>`,
32
+ });
33
+
34
+ Primary.storyName = 'Basic';
@@ -0,0 +1,47 @@
1
+ <template>
2
+ <farm-typography
3
+ v-bind="$attrs"
4
+ v-on="$listeners"
5
+ :weight="weight"
6
+ :size="size"
7
+ :key="key"
8
+ :class="{ 'farm-small': true, [`farm-small--${variation}`]: true }"
9
+ >
10
+ <slot></slot>
11
+ </farm-typography>
12
+ </template>
13
+ <script lang="ts">
14
+ import Vue, { computed, ref, watch, toRefs, PropType } from 'vue';
15
+
16
+ import { Keys } from './configurations';
17
+
18
+ export default Vue.extend({
19
+ inheritAttrs: true,
20
+ name: 'farm-bodysmall',
21
+ props: {
22
+ /**
23
+ * Variation of the small
24
+ */
25
+ variation: { type: String as PropType<'regular' | 'medium' | 'bold'>, default: 'medium' },
26
+ },
27
+ setup(props) {
28
+ const { variation } = toRefs(props);
29
+ const key = ref(variation.value);
30
+
31
+ watch(
32
+ () => props,
33
+ () => {
34
+ key.value = variation.value;
35
+ }
36
+ );
37
+
38
+ const config = computed(() => Keys[key.value]);
39
+ const weight = computed(() => config.value.weight);
40
+ const size = computed(() => config.value.size);
41
+ return { weight, size, key, variation };
42
+ },
43
+ });
44
+ </script>
45
+ <style lang="scss" scoped>
46
+ @import 'Small';
47
+ </style>