@weni/unnnic-system 3.2.5-alpha.0 → 3.2.5-alpha.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 (115) hide show
  1. package/dist/components/Accordion/Accordion.vue.d.ts +1 -1
  2. package/dist/components/Alert/Alert.vue.d.ts +5 -5
  3. package/dist/components/Alert/Version1dot1.vue.d.ts +2 -2
  4. package/dist/components/AudioRecorder/AudioHandler.vue.d.ts +1 -1
  5. package/dist/components/AudioRecorder/AudioPlayer.vue.d.ts +1 -1
  6. package/dist/components/AudioRecorder/AudioRecorder.vue.d.ts +3 -3
  7. package/dist/components/AvatarIcon/AvatarIcon.vue.d.ts +2 -2
  8. package/dist/components/Banner/Banner.vue.d.ts +1 -1
  9. package/dist/components/Banner/InfoBanner.vue.d.ts +1 -1
  10. package/dist/components/Breadcrumb/Breadcrumb.vue.d.ts +1 -1
  11. package/dist/components/Button/Button.vue.d.ts +2 -2
  12. package/dist/components/Button/ButtonIcon.vue.d.ts +1 -1
  13. package/dist/components/Card/AccountCard.vue.d.ts +3 -3
  14. package/dist/components/Card/BlankCard.vue.d.ts +1 -1
  15. package/dist/components/Card/Card.vue.d.ts +20 -20
  16. package/dist/components/Card/CardCompany.vue.d.ts +7 -7
  17. package/dist/components/Card/CardData.vue.d.ts +1 -1
  18. package/dist/components/Card/CardStatusesContainer.vue.d.ts +3 -3
  19. package/dist/components/Card/ContentCard.vue.d.ts +2 -2
  20. package/dist/components/Card/DashCard.vue.d.ts +4 -4
  21. package/dist/components/Card/DefaultCard.vue.d.ts +1 -1
  22. package/dist/components/Card/MarketplaceCard.vue.d.ts +2 -2
  23. package/dist/components/Card/SimpleCard.vue.d.ts +2 -2
  24. package/dist/components/Card/StatusCard.vue.d.ts +2 -2
  25. package/dist/components/Card/TitleCard.vue.d.ts +1 -1
  26. package/dist/components/CardImage/CardImage.vue.d.ts +7 -7
  27. package/dist/components/CardInformation/CardInformation.vue.d.ts +3 -3
  28. package/dist/components/CardProject/CardProject.vue.d.ts +2 -2
  29. package/dist/components/Carousel/Carousel.vue.d.ts +10 -10
  30. package/dist/components/Carousel/TagCarousel.vue.d.ts +8 -8
  31. package/dist/components/ChartBar/ChartBar.vue.d.ts +7 -7
  32. package/dist/components/ChatText/ChatText.vue.d.ts +1 -1
  33. package/dist/components/ChatsContact/ChatsContact.vue.d.ts +14 -14
  34. package/dist/components/ChatsDashboardTagLive/ChatsDashboardTagLive.vue.d.ts +1 -1
  35. package/dist/components/ChatsHeader/ChatsHeader.vue.d.ts +1 -1
  36. package/dist/components/ChatsHeader/ChatsHeader.vue.d.ts.map +1 -1
  37. package/dist/components/ChatsMessage/ChatsMessage.vue.d.ts +4 -4
  38. package/dist/components/ChatsMessage/ChatsMessageStatusBackdrop.vue.d.ts +2 -2
  39. package/dist/components/ChatsNavbar/ChatsNavbar.vue.d.ts +1 -1
  40. package/dist/components/ChatsUserAvatar/ChatsUserAvatar.vue.d.ts +2 -2
  41. package/dist/components/Checkbox/Checkbox.vue.d.ts +3 -3
  42. package/dist/components/Comment/Comment.vue.d.ts +1 -1
  43. package/dist/components/DataArea/DataArea.vue.d.ts +1 -1
  44. package/dist/components/DataTable/index.vue.d.ts +1 -1
  45. package/dist/components/DataTable/index.vue.d.ts.map +1 -1
  46. package/dist/components/DateFilter/DateFilter.vue.d.ts +182 -27
  47. package/dist/components/DatePicker/DatePicker.vue.d.ts +6 -6
  48. package/dist/components/Drawer/Drawer.vue.d.ts +7 -7
  49. package/dist/components/Dropdown/LanguageSelect.vue.d.ts +3 -3
  50. package/dist/components/Flag.vue.d.ts +2 -2
  51. package/dist/components/FormElement/FormElement.vue.d.ts +38 -32
  52. package/dist/components/FormElement/FormElement.vue.d.ts.map +1 -1
  53. package/dist/components/Icon/types.d.ts +1 -1
  54. package/dist/components/Icon/types.d.ts.map +1 -1
  55. package/dist/components/Icon.vue.d.ts +1 -1
  56. package/dist/components/Icon.vue.d.ts.map +1 -1
  57. package/dist/components/IconLoading/IconLoading.vue.d.ts +1 -1
  58. package/dist/components/ImportCard/ImportCard.vue.d.ts +7 -7
  59. package/dist/components/Input/BaseInput.vue.d.ts +10 -1
  60. package/dist/components/Input/BaseInput.vue.d.ts.map +1 -1
  61. package/dist/components/Input/Input.vue.d.ts +182 -27
  62. package/dist/components/Input/Input.vue.d.ts.map +1 -1
  63. package/dist/components/Input/TextInput.vue.d.ts +31 -13
  64. package/dist/components/InputDatePicker/InputDatePicker.vue.d.ts +189 -34
  65. package/dist/components/InputNext/InputNext.vue.d.ts +3 -3
  66. package/dist/components/Modal/Modal.vue.d.ts +2 -2
  67. package/dist/components/ModalDialog/ModalDialog.vue.d.ts +9 -9
  68. package/dist/components/ModalNext/ModalNext.vue.d.ts +189 -34
  69. package/dist/components/ModalUpload/ModalUpload.vue.d.ts +14 -14
  70. package/dist/components/MultiSelect/MultiSelect.vue.d.ts +7 -7
  71. package/dist/components/Pagination/Pagination.vue.d.ts +6 -6
  72. package/dist/components/ProgressBar/ProgressBar.vue.d.ts +1 -1
  73. package/dist/components/Radio/Radio.vue.d.ts +2 -2
  74. package/dist/components/SelectSmart/SelectSmart.vue.d.ts +44 -26
  75. package/dist/components/SelectSmart/SelectSmartMultipleHeader.vue.d.ts +7 -7
  76. package/dist/components/SelectSmart/SelectSmartOption.vue.d.ts +4 -4
  77. package/dist/components/SelectTime/index.vue.d.ts +31 -13
  78. package/dist/components/Slider/Slider.vue.d.ts +1 -1
  79. package/dist/components/StarRating/StarRating.vue.d.ts +1 -1
  80. package/dist/components/Switch/Switch.vue.d.ts +2 -2
  81. package/dist/components/Tab/Tab.vue.d.ts +1 -1
  82. package/dist/components/TableNext/TableBodyCell.vue.d.ts +2 -2
  83. package/dist/components/TableNext/TablePagination.vue.d.ts +6 -6
  84. package/dist/components/TabsExpanded/TabsExpanded.vue.d.ts +1 -1
  85. package/dist/components/Tag/BrandTag.vue.d.ts +2 -2
  86. package/dist/components/Tag/DefaultTag.vue.d.ts +2 -2
  87. package/dist/components/Tag/IndicatorTag.vue.d.ts +1 -1
  88. package/dist/components/Tag/Tag.vue.d.ts +7 -7
  89. package/dist/components/TextArea/TextArea.vue.d.ts +38 -32
  90. package/dist/components/TextArea/TextArea.vue.d.ts.map +1 -1
  91. package/dist/components/Tour/Tour.vue.d.ts +6 -6
  92. package/dist/components/Tour/TourPopover.vue.d.ts +6 -6
  93. package/dist/components/UploadArea/UploadArea.vue.d.ts +7 -7
  94. package/dist/components/index.d.ts +2016 -752
  95. package/dist/components/index.d.ts.map +1 -1
  96. package/dist/{es-e4a6e990.mjs → es-dc7f4ae0.mjs} +1 -1
  97. package/dist/{index-de083a7a.mjs → index-93c6d4e1.mjs} +3582 -3554
  98. package/dist/{pt-br-229e5ab3.mjs → pt-br-6c72f1f4.mjs} +1 -1
  99. package/dist/style.css +1 -1
  100. package/dist/unnnic.mjs +1 -1
  101. package/dist/unnnic.umd.js +31 -31
  102. package/package.json +1 -1
  103. package/src/components/FormElement/FormElement.vue +50 -90
  104. package/src/components/Icon/types.ts +7 -0
  105. package/src/components/Icon.vue +7 -0
  106. package/src/components/Input/BaseInput.vue +10 -12
  107. package/src/components/Input/Input.scss +17 -20
  108. package/src/components/Input/Input.vue +86 -28
  109. package/src/components/Input/TextInput.vue +27 -35
  110. package/src/components/Input/__test__/TextInput.spec.js +5 -5
  111. package/src/components/Input/__test__/__snapshots__/Input.spec.js.snap +12 -3
  112. package/src/components/Input/__test__/__snapshots__/TextInput.spec.js.snap +1 -1
  113. package/src/components/TextArea/TextArea.vue +14 -9
  114. package/src/components/TextArea/__test__/__snapshots__/TextArea.spec.js.snap +7 -2
  115. package/src/stories/Input.stories.js +17 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@weni/unnnic-system",
3
- "version": "3.2.5-alpha.0",
3
+ "version": "3.2.5-alpha.1",
4
4
  "type": "commonjs",
5
5
  "files": [
6
6
  "dist",
@@ -17,51 +17,28 @@
17
17
 
18
18
  <slot></slot>
19
19
 
20
- <p
21
- v-if="shouldShowErrorSection"
22
- class="unnnic-form-element__error"
23
- >
24
- <template v-if="error !== true">
25
- <UnnnicIcon
26
- size="sm"
27
- icon="warning"
28
- scheme="aux-red-500"
29
- />
30
-
31
- {{ fullySanitize(error) }}
32
- </template>
33
-
34
- <span
35
- v-if="!!$slots.rightMessage"
36
- class="unnnic-form-element__right-message"
37
- >
38
- <slot name="rightMessage"></slot>
39
- </span>
40
- </p>
41
-
42
- <p
43
- v-if="message || !!$slots.rightMessage"
44
- class="unnnic-form-element__message"
45
- >
46
- {{ fullySanitize(message) }}
47
-
48
- <span
49
- v-if="!shouldShowErrorSection && !!$slots.rightMessage"
50
- class="unnnic-form-element__right-message"
51
- >
20
+ <section class="unnnic-form-element__hints-container">
21
+ <section class="unnnic-form-element__message-container">
22
+ <p
23
+ v-if="message"
24
+ class="unnnic-form-element__message"
25
+ >
26
+ {{ fullySanitize(message) }}
27
+ </p>
28
+ <p v-if="!!error.length" class="unnnic-form-element__message error">
29
+ {{ Array.isArray(error) ? error.join(', ') : error }}
30
+ </p>
31
+ </section>
32
+ <p v-if="!!$slots.rightMessage">
52
33
  <slot name="rightMessage"></slot>
53
- </span>
54
- </p>
34
+ </p>
35
+ </section>
55
36
  </section>
56
37
  </template>
57
38
 
58
39
  <script>
59
- import UnnnicIcon from '../../components/Icon.vue';
60
40
  import { fullySanitize } from '../../utils/sanitize';
61
41
  export default {
62
- components: {
63
- UnnnicIcon,
64
- },
65
42
 
66
43
  props: {
67
44
  size: {
@@ -70,28 +47,18 @@ export default {
70
47
  validator: (size) => ['md', 'sm'].includes(size),
71
48
  },
72
49
 
73
- label: String,
50
+ label: { type: String, default: '' },
74
51
 
75
- fixedLabel: Boolean,
52
+ fixedLabel: { type: Boolean, default: false },
76
53
 
77
54
  error: {
78
55
  type: [Boolean, String],
79
56
  default: false,
80
57
  },
81
58
 
82
- message: String,
83
-
84
- disabled: Boolean,
85
- },
59
+ message: { type: String, default: '' },
86
60
 
87
- data() {
88
- return {};
89
- },
90
-
91
- computed: {
92
- shouldShowErrorSection() {
93
- return this.error && (this.error !== true || !!this.$slots.rightMessage);
94
- },
61
+ disabled: { type: Boolean, default: false },
95
62
  },
96
63
  methods: {
97
64
  fullySanitize,
@@ -102,75 +69,68 @@ export default {
102
69
  <style lang="scss" scoped>
103
70
  @use '@/assets/scss/unnnic' as *;
104
71
 
72
+ * {
73
+ margin: $unnnic-space-0;
74
+ padding: $unnnic-space-0;
75
+ box-sizing: border-box;
76
+ }
77
+
105
78
  .unnnic-form-element {
106
79
  &__label {
107
- margin: 0;
108
- margin-bottom: $unnnic-spacing-nano;
109
-
80
+ font: $unnnic-font-body;
110
81
  color: $unnnic-color-neutral-cloudy;
111
- font-family: $unnnic-font-family-secondary;
112
- font-weight: $unnnic-font-weight-regular;
113
- font-size: $unnnic-font-size-body-gt;
114
- line-height: $unnnic-font-size-body-gt + $unnnic-line-height-md;
115
-
116
- $label-bottom-spacing: 3px;
82
+ margin-bottom: $unnnic-space-1;
83
+ display: flex;
84
+ align-items: center;
85
+ gap: $unnnic-space-2;
117
86
 
118
87
  &--fixed {
119
- margin-top: -$unnnic-font-size-body-gt - $unnnic-line-height-md +
120
- $label-bottom-spacing;
88
+ margin-top: -$unnnic-font-size-body-gt - $unnnic-space-2 +
89
+ $unnnic-space-1;
121
90
  }
122
91
 
123
92
  &--fixed {
124
- margin-bottom: 0;
93
+ margin-bottom: $unnnic-space-0;
125
94
  position: absolute;
126
- padding: 0 $unnnic-spacing-nano;
127
- margin-left: $unnnic-spacing-xs;
95
+ padding: $unnnic-space-0 $unnnic-space-1;
96
+ margin-left: $unnnic-space-2;
128
97
 
129
98
  &:after {
130
99
  content: ' ';
131
100
  position: absolute;
132
- left: 0;
133
- bottom: $label-bottom-spacing - $unnnic-border-width-thinner;
101
+ left: $unnnic-space-0;
102
+ bottom: $unnnic-space-1 - $unnnic-border-width-thinner;
134
103
  width: 100%;
135
104
  height: $unnnic-border-width-thinner;
136
- background-color: $unnnic-color-neutral-white;
105
+ background-color: $unnnic-color-white;
137
106
  }
138
107
  }
139
108
  }
140
109
 
141
- &__error,
142
110
  &__message {
143
- margin: 0;
144
- margin-top: $unnnic-spacing-stack-nano;
145
-
146
- color: $unnnic-color-neutral-cloudy;
147
- font-family: $unnnic-font-family-secondary;
148
- font-weight: $unnnic-font-weight-regular;
149
- font-size: $unnnic-font-size-body-md;
150
- line-height: $unnnic-font-size-body-md + $unnnic-line-height-md;
111
+ &.error {
112
+ color: $unnnic-color-fg-critical;
113
+ }
151
114
  }
152
115
 
153
- &__message {
116
+ &__hints-container {
154
117
  display: flex;
155
- column-gap: $unnnic-spacing-nano;
156
- }
157
-
158
- &__right-message {
159
- margin-left: auto;
118
+ justify-content: space-between;
119
+ margin-top: $unnnic-space-1;
120
+ font: $unnnic-font-caption-2;
121
+ color: $unnnic-color-fg-base;
160
122
  }
161
123
 
162
- &__error {
124
+ &__message-container {
163
125
  display: flex;
164
- column-gap: $unnnic-spacing-nano;
165
- align-items: center;
166
-
167
- color: $unnnic-color-aux-red-500;
126
+ flex-direction: column;
127
+ gap: $unnnic-space-1;
168
128
  }
169
129
 
130
+
170
131
  &--disabled .unnnic-form-element__label,
171
132
  &--disabled .unnnic-form-element__message {
172
133
  user-select: none;
173
- color: $unnnic-color-neutral-cleanest;
174
134
  }
175
135
  }
176
136
  </style>
@@ -62,6 +62,13 @@ export type SchemeColor =
62
62
  | 'aux-yellow-500'
63
63
  | 'aux-yellow-700'
64
64
  | 'aux-yellow-900'
65
+ | 'fg-base'
66
+ | 'fg-emphasized'
67
+ | 'fg-muted'
68
+ | 'fg-critical'
69
+ | 'fg-success'
70
+ | 'fg-warning'
71
+ | 'fg-info'
65
72
  | 'floweditor-blue'
66
73
  | 'floweditor-purple'
67
74
  | 'floweditor-wine'
@@ -159,6 +159,13 @@ $scheme-colors:
159
159
  'aux-yellow-500' $unnnic-color-aux-yellow-500,
160
160
  'aux-yellow-700' $unnnic-color-aux-yellow-700,
161
161
  'aux-yellow-900' $unnnic-color-aux-yellow-900,
162
+ 'fg-base' $unnnic-color-fg-base,
163
+ 'fg-emphasized' $unnnic-color-fg-emphasized,
164
+ 'fg-muted' $unnnic-color-fg-muted,
165
+ 'fg-critical' $unnnic-color-fg-critical,
166
+ 'fg-success' $unnnic-color-fg-success,
167
+ 'fg-warning' $unnnic-color-fg-warning,
168
+ 'fg-info' $unnnic-color-fg-info,
162
169
  'floweditor-blue' $unnnic-color-floweditor-blue,
163
170
  'floweditor-purple' $unnnic-color-floweditor-purple,
164
171
  'floweditor-wine' $unnnic-color-floweditor-wine,
@@ -7,13 +7,13 @@
7
7
  :class="classes"
8
8
  :type="nativeType"
9
9
  />
10
-
11
10
  <input
12
11
  v-else
13
12
  v-bind="attributes"
14
13
  :value="fullySanitize(modelValue)"
15
14
  :class="classes"
16
15
  :type="nativeType"
16
+ :maxlength="maxlength"
17
17
  />
18
18
  </template>
19
19
 
@@ -49,6 +49,10 @@ export default {
49
49
  },
50
50
  hasIconLeft: Boolean,
51
51
  hasIconRight: Boolean,
52
+ maxlength: {
53
+ type: Number,
54
+ default: null,
55
+ },
52
56
  },
53
57
  emits: ['update:modelValue'],
54
58
  data() {
@@ -96,27 +100,21 @@ export default {
96
100
  &.size {
97
101
  &-md {
98
102
  @include input-md-font;
99
-
100
- padding: ($unnnic-spacing-ant - $unnnic-border-width-thinner)
101
- ($unnnic-spacing-sm - $unnnic-border-width-thinner);
103
+ padding: $unnnic-space-3 $unnnic-space-4;
102
104
  }
103
105
 
104
106
  &-sm {
105
107
  @include input-sm-font;
106
-
107
- padding: $unnnic-spacing-xs
108
- ($unnnic-spacing-sm - $unnnic-border-width-thinner);
108
+ padding: $unnnic-space-2 $unnnic-space-4;
109
109
  }
110
110
  }
111
111
 
112
112
  &.input--has-icon-left {
113
- padding-left: $unnnic-spacing-sm + $unnnic-icon-size-sm + $unnnic-spacing-xs -
114
- $unnnic-border-width-thinner;
113
+ padding-left: $unnnic-space-10;
115
114
  }
116
115
 
117
116
  &.input--has-icon-right {
118
- padding-right: $unnnic-spacing-sm + $unnnic-icon-size-sm +
119
- $unnnic-spacing-xs - $unnnic-border-width-thinner;
117
+ padding-right: $unnnic-space-10;
120
118
  }
121
119
 
122
120
  &.error {
@@ -126,7 +124,7 @@ export default {
126
124
  &:-ms-input-placeholder,
127
125
  &::-ms-input-placeholder {
128
126
  /* Internet Explorer 10-11 */
129
- color: $unnnic-color-brand-sec;
127
+ color: $unnnic-color-fg-muted;
130
128
  }
131
129
  }
132
130
  </style>
@@ -1,43 +1,40 @@
1
1
  @use '@/assets/scss/unnnic' as *;
2
2
 
3
3
  @mixin input-base {
4
- background: $unnnic-color-neutral-white;
5
- border: $unnnic-border-width-thinner solid $unnnic-color-neutral-clean;
4
+ background: $unnnic-color-white;
5
+ border: $unnnic-border-width-thinner solid $unnnic-color-border-base;
6
6
  outline: none;
7
- border-radius: $unnnic-border-radius-sm;
8
- color: $unnnic-color-neutral-darkest;
9
- caret-color: $unnnic-color-neutral-clean;
10
- font-weight: $unnnic-font-weight-regular;
11
- font-family: $unnnic-font-family-secondary;
7
+ border-radius: $unnnic-radius-2;
8
+ color: $unnnic-color-fg-emphasized;
9
+ caret-color: $unnnic-color-fg-muted;
10
+ font: $unnnic-font-body;
12
11
 
13
12
  &:focus {
14
- border-color: $unnnic-color-weni-600;
13
+ border-color: $unnnic-color-border-active;
15
14
  }
16
15
 
17
16
  &::placeholder {
18
- color: $unnnic-color-neutral-cleanest;
19
- opacity: 1; /* Firefox */
17
+ color: $unnnic-color-fg-muted;
18
+ opacity: 1;
19
+ /* Firefox */
20
20
  }
21
21
 
22
22
  &:disabled {
23
- border-color: $unnnic-color-neutral-cleanest;
24
- background-color: $unnnic-color-neutral-lightest;
23
+ border-color: $unnnic-color-border-muted;
24
+ background-color: $unnnic-color-bg-muted;
25
25
  cursor: not-allowed;
26
- color: $unnnic-color-neutral-cleanest;
26
+ color: $unnnic-color-fg-muted;
27
27
  }
28
28
  }
29
29
 
30
30
  @mixin input-sm-font {
31
- font-size: $unnnic-font-size-body-md;
32
- line-height: $unnnic-font-size-body-md + $unnnic-line-height-medium;
31
+ font: $unnnic-font-body;
33
32
  }
34
33
 
35
34
  @mixin input-md-font {
36
- font-size: $unnnic-font-size-body-gt;
37
- line-height: $unnnic-font-size-body-gt + $unnnic-line-height-medium;
35
+ font: $unnnic-font-body;
38
36
  }
39
37
 
40
38
  @mixin input-error {
41
- border-color: $unnnic-color-aux-red-500;
42
- color: $unnnic-color-aux-red-500;
43
- }
39
+ border-color: $unnnic-color-border-critical;
40
+ }
@@ -6,13 +6,18 @@
6
6
  >
7
7
  <slot name="label" />
8
8
  </p>
9
-
10
- <p
9
+ <section
11
10
  v-else-if="label"
12
11
  class="unnnic-form__label"
13
12
  >
14
- {{ fullySanitize(label) }}
15
- </p>
13
+ <p>
14
+ {{ fullySanitize(label) }}
15
+ </p>
16
+ <UnnnicToolTip v-if="tooltip" enabled :text="tooltip">
17
+ <UnnnicIcon icon="help" size="sm" scheme="fg-base" />
18
+ </UnnnicToolTip>
19
+ </section>
20
+
16
21
 
17
22
  <TextInput
18
23
  v-bind="$attrs"
@@ -28,24 +33,38 @@
28
33
  :size="size"
29
34
  :mask="mask"
30
35
  :nativeType="nativeType"
36
+ :maxlength="maxlength"
37
+ :disabled="disabled"
31
38
  />
32
39
 
33
- <p
34
- v-if="message"
35
- class="unnnic-form__message"
36
- >
37
- {{ fullySanitize(message) }}
38
- </p>
40
+ <section class="unnnic-form__hints-container">
41
+ <section class="unnnic-form__message-container">
42
+ <p
43
+ v-if="message"
44
+ class="unnnic-form__message"
45
+ >
46
+ {{ fullySanitize(message) }}
47
+ </p>
48
+ <p v-if="!!errors.length" class="unnnic-form__message error">
49
+ {{ Array.isArray(errors) ? errors.join(', ') : errors }}
50
+ </p>
51
+ </section>
52
+ <p v-if="maxlength && showMaxlengthCounter">
53
+ {{ (val || '').length }} / {{ maxlength }}
54
+ </p>
55
+ </section>
39
56
  </div>
40
57
  </template>
41
58
 
42
59
  <script>
43
60
  import { fullySanitize } from '../../utils/sanitize';
44
61
  import TextInput from './TextInput.vue';
62
+ import UnnnicToolTip from '../ToolTip/ToolTip.vue';
63
+ import UnnnicIcon from '../Icon.vue';
45
64
 
46
65
  export default {
47
66
  name: 'UnnnicInput',
48
- components: { TextInput },
67
+ components: { TextInput, UnnnicToolTip, UnnnicIcon },
49
68
  props: {
50
69
  placeholder: {
51
70
  type: String,
@@ -68,19 +87,23 @@ export default {
68
87
  },
69
88
  message: {
70
89
  type: String,
71
- default: null,
90
+ default: '',
91
+ },
92
+ errors: {
93
+ type: [String, Array],
94
+ default: '',
72
95
  },
73
96
  label: {
74
97
  type: String,
75
- default: null,
98
+ default: '',
76
99
  },
77
100
  iconLeft: {
78
101
  type: String,
79
- default: null,
102
+ default: '',
80
103
  },
81
104
  iconRight: {
82
105
  type: String,
83
- default: null,
106
+ default: '',
84
107
  },
85
108
  allowTogglePassword: {
86
109
  type: Boolean,
@@ -88,11 +111,11 @@ export default {
88
111
  },
89
112
  iconLeftClickable: {
90
113
  type: Boolean,
91
- default: null,
114
+ default: false,
92
115
  },
93
116
  iconRightClickable: {
94
117
  type: Boolean,
95
- default: null,
118
+ default: false,
96
119
  },
97
120
  hasCloudyColor: {
98
121
  type: Boolean,
@@ -106,6 +129,22 @@ export default {
106
129
  type: [String, Array],
107
130
  default: '',
108
131
  },
132
+ tooltip: {
133
+ type: String,
134
+ default: '',
135
+ },
136
+ maxlength: {
137
+ type: [Number, null],
138
+ default: null,
139
+ },
140
+ showMaxlengthCounter: {
141
+ type: Boolean,
142
+ default: false,
143
+ },
144
+ disabled: {
145
+ type: Boolean,
146
+ default: false,
147
+ },
109
148
  },
110
149
  emits: ['update:modelValue'],
111
150
  data() {
@@ -138,27 +177,46 @@ export default {
138
177
  <style lang="scss" scoped>
139
178
  @use '@/assets/scss/unnnic' as *;
140
179
 
180
+ * {
181
+ margin: 0;
182
+ padding: 0;
183
+ box-sizing: border-box;
184
+ }
185
+
141
186
  .unnnic-form {
142
- font-family: $unnnic-font-family-secondary;
143
187
  position: relative;
144
188
 
145
189
  &__message {
146
- font-size: $unnnic-font-size-body-md;
147
- margin: $unnnic-spacing-stack-nano 0;
148
- color: $unnnic-color-feedback-red;
190
+ &.error {
191
+ color: $unnnic-color-fg-critical;
192
+ }
149
193
  }
150
194
 
151
195
  &__label {
152
- font-weight: $unnnic-font-weight-regular;
153
- line-height: $unnnic-font-size-body-gt + $unnnic-line-height-medium;
154
- font-size: $unnnic-font-size-body-gt;
196
+ font: $unnnic-font-body;
155
197
  color: $unnnic-color-neutral-cloudy;
156
- margin: $unnnic-spacing-stack-xs 0;
198
+ margin-bottom: $unnnic-space-1;
199
+ display: flex;
200
+ align-items: center;
201
+ gap: $unnnic-space-2;
202
+
203
+ :deep(.unnnic-tooltip) {
204
+ display: flex;
205
+ }
206
+ }
207
+
208
+ &__hints-container {
209
+ display: flex;
210
+ justify-content: space-between;
211
+ margin-top: $unnnic-space-1;
212
+ font: $unnnic-font-caption-2;
213
+ color: $unnnic-color-fg-base;
157
214
  }
158
215
 
159
- &.sm &__label {
160
- font-size: $unnnic-font-size-body-md;
161
- line-height: $unnnic-font-size-body-md + $unnnic-line-height-medium;
216
+ &__message-container {
217
+ display: flex;
218
+ flex-direction: column;
219
+ gap: $unnnic-space-1;
162
220
  }
163
221
  }
164
222
  </style>