@weni/unnnic-system 1.16.25-develop.0 → 1.16.26-develop.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": "@weni/unnnic-system",
3
- "version": "1.16.25-develop.0",
3
+ "version": "1.16.26-develop.0",
4
4
  "main": "./dist/unnnic.common.js",
5
5
  "files": [
6
6
  "dist/*",
@@ -41,14 +41,6 @@ export default {
41
41
  type: String,
42
42
  default: '',
43
43
  },
44
- hasIconLeft: {
45
- type: Boolean,
46
- default: null,
47
- },
48
- hasIconRight: {
49
- type: Boolean,
50
- default: null,
51
- },
52
44
  nativeType: {
53
45
  type: String,
54
46
  default: 'text',
@@ -83,10 +75,6 @@ export default {
83
75
  'input',
84
76
  `size-${this.size}`,
85
77
  this.type,
86
- {
87
- 'has-icon-left': this.hasIconLeft,
88
- 'has-icon-right': this.hasIconRight,
89
- },
90
78
  ];
91
79
  },
92
80
  },
@@ -98,7 +86,11 @@ export default {
98
86
 
99
87
  .input {
100
88
  background: $unnnic-color-neutral-snow;
101
- border: $unnnic-border-width-thinner solid $unnnic-color-neutral-soft;
89
+ border: none;
90
+ outline-style: solid;
91
+ outline-color: $unnnic-color-neutral-soft;
92
+ outline-width: $unnnic-border-width-thinner;
93
+ outline-offset: -$unnnic-border-width-thinner;
102
94
  border-radius: $unnnic-border-radius-sm;
103
95
  color: $unnnic-color-neutral-dark;
104
96
  caret-color: $unnnic-color-neutral-cleanest;
@@ -112,55 +104,26 @@ export default {
112
104
  font-size: $unnnic-font-size-body-gt;
113
105
  line-height: $unnnic-font-size-body-gt + $unnnic-line-height-medium;
114
106
  padding: $unnnic-squish-xs;
115
-
116
- &.has-icon {
117
- &-left {
118
- padding-left: calc(#{$unnnic-inline-sm} + #{$unnnic-icon-size-sm} + #{$unnnic-inline-xs});
119
- }
120
-
121
- &-right {
122
- padding-right: calc(
123
- #{$unnnic-inline-sm} + #{$unnnic-icon-size-sm} + #{$unnnic-inline-xs}
124
- );
125
- }
126
- }
127
107
  }
128
108
 
129
109
  &-sm {
130
110
  font-size: $unnnic-font-size-body-md;
131
111
  line-height: $unnnic-font-size-body-md + $unnnic-line-height-medium;
132
112
  padding: $unnnic-squish-nano;
133
-
134
- &.has-icon {
135
- &-left {
136
- padding-left: calc(#{$unnnic-inline-sm} + #{$unnnic-icon-size-xs} + #{$unnnic-inline-xs});
137
- }
138
-
139
- &-right {
140
- padding-right: calc(
141
- #{$unnnic-inline-sm} + #{$unnnic-icon-size-xs} + #{$unnnic-inline-xs}
142
- );
143
- }
144
- }
145
113
  }
146
114
  }
147
115
 
148
116
  &:focus {
149
- border-color: $unnnic-color-neutral-cleanest;
150
- outline: none;
151
- &::placeholder {
152
- color: $unnnic-color-neutral-clean;
153
- opacity: 1; /* Firefox */
154
- }
117
+ outline-color: $unnnic-color-neutral-clean;
155
118
  }
156
119
 
157
120
  &.error {
158
- border: $unnnic-border-width-thinner solid $unnnic-color-feedback-red;
121
+ outline-color: $unnnic-color-feedback-red;
159
122
  color: $unnnic-color-feedback-red;
160
123
  }
161
124
 
162
125
  &::placeholder {
163
- color: $unnnic-color-neutral-clean;
126
+ color: $unnnic-color-neutral-cleanest;
164
127
  opacity: 1; /* Firefox */
165
128
  }
166
129
 
@@ -171,8 +134,10 @@ export default {
171
134
  }
172
135
 
173
136
  &:disabled {
174
- border: 1px solid transparent;
175
- background-color: $unnnic-color-neutral-light;
137
+ outline-color: $unnnic-color-neutral-cleanest;
138
+ background-color: $unnnic-color-neutral-lightest;
139
+ cursor: not-allowed;
140
+ color: $unnnic-color-neutral-cleanest;
176
141
 
177
142
  &::placeholder {
178
143
  color: $unnnic-color-neutral-cleanest;
@@ -1,24 +1,28 @@
1
1
  <template>
2
- <div :style="{ position: 'relative' }">
2
+ <div
3
+ :class="['text-input', `size--${size}`, {
4
+ 'has-icon-left': !!iconLeft,
5
+ 'has-icon-right': !!iconRight
6
+ }]"
7
+ >
3
8
  <base-input
4
9
  ref="base-input"
5
10
  :value="value"
6
11
  v-bind="attributes"
7
- :hasIconLeft="!!iconLeft"
8
- :hasIconRight="!!iconRight"
9
12
  :native-type="nativeType === 'password' && showPassword ? 'text' : nativeType"
10
13
  :type="type"
11
14
  :size="size"
12
15
  v-on="inputListeners"
13
16
  @focus="onFocus"
14
17
  @blur="onBlur"
18
+ class="input-itself"
15
19
  />
16
20
 
17
21
  <unnnic-icon
18
22
  v-if="iconLeft"
19
23
  :scheme="iconScheme"
20
24
  :icon="iconLeft"
21
- :size="iconSize"
25
+ size="sm"
22
26
  :clickable="iconLeftClickable"
23
27
  @click="onIconLeftClick"
24
28
  class="icon-left"
@@ -28,7 +32,7 @@
28
32
  v-if="iconRightSvg"
29
33
  :scheme="iconScheme"
30
34
  :icon="iconRightSvg"
31
- :size="iconSize"
35
+ size="sm"
32
36
  :clickable="iconRightClickable || allowTogglePassword"
33
37
  @click="onIconRightClick"
34
38
  class="icon-right"
@@ -114,14 +118,14 @@ export default {
114
118
  return 'feedback-red';
115
119
  }
116
120
 
117
- if (this.value || this.isFocused) {
118
- return 'neutral-dark';
119
- }
120
-
121
121
  if (this.isDisabled) {
122
122
  return 'neutral-cleanest';
123
123
  }
124
124
 
125
+ if (this.value || this.isFocused) {
126
+ return 'neutral-dark';
127
+ }
128
+
125
129
  if (this.hasCloudyColor) {
126
130
  return 'neutral-cloudy';
127
131
  }
@@ -140,11 +144,6 @@ export default {
140
144
  attributes() {
141
145
  return { ...this.$attrs, ...this.$attrs['v-bind'], ...this.$props };
142
146
  },
143
- iconSize() {
144
- if (this.size === 'md') return 'sm';
145
- if (this.size === 'sm') return 'xs';
146
- return 'sm';
147
- },
148
147
  },
149
148
  methods: {
150
149
  focus() {
@@ -179,16 +178,39 @@ export default {
179
178
  @import '../../assets/scss/unnnic.scss';
180
179
 
181
180
  .icon {
181
+ &-left, &-right {
182
+ pointer-events: none;
183
+ }
184
+
182
185
  &-left {
183
186
  position: absolute;
184
- transform: translateY(100%);
187
+ top: $unnnic-spacing-ant + 0.1875 * $unnnic-font-size;
185
188
  left: $unnnic-inline-sm;
186
189
  }
187
190
 
188
191
  &-right {
189
192
  position: absolute;
190
- transform: translateY(100%);
193
+ top: $unnnic-spacing-ant + 0.1875 * $unnnic-font-size;
191
194
  right: $unnnic-inline-sm;
192
195
  }
193
196
  }
197
+ .text-input {
198
+ position: relative;
199
+
200
+ &.size--md, &.size--sm {
201
+ &.has-icon-left .input-itself {
202
+ padding-left: $unnnic-spacing-sm + $unnnic-icon-size-sm + $unnnic-spacing-xs;
203
+ }
204
+
205
+ &.has-icon-right .input-itself {
206
+ padding-right: $unnnic-spacing-sm + $unnnic-icon-size-sm + $unnnic-spacing-xs;
207
+ }
208
+ }
209
+
210
+ &.size--sm {
211
+ .icon-left, .icon-right {
212
+ top: $unnnic-spacing-xs + 0.125 * $unnnic-font-size;
213
+ }
214
+ }
215
+ }
194
216
  </style>