@avakhula/ui 0.0.78 → 0.0.79

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": "@avakhula/ui",
3
- "version": "0.0.78",
3
+ "version": "0.0.79",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.umd.cjs",
6
6
  "source": "src/index.js",
@@ -14,7 +14,7 @@ $input-hover-color: $neutral-900;
14
14
  $input-hover-bg: $blue-200;
15
15
  $input-hover-border-color: $blue-700;
16
16
  $input-hover-placeholder-color: $neutral-600;
17
- $input-hover-error-color: $red-800;
17
+ $input-border-error-color: $red-800;
18
18
 
19
19
  .ib-input-wrapper {
20
20
  position: relative;
@@ -123,7 +123,7 @@ $input-hover-error-color: $red-800;
123
123
  &.ib-error {
124
124
  border-radius: 4px;
125
125
  border-color: transparent;
126
- @include outline(-2px, $input-hover-error-color);
126
+ @include outline(-2px, $input-border-error-color);
127
127
  }
128
128
  }
129
129
  }
@@ -73,6 +73,9 @@ export default {
73
73
  emptyMessage: {
74
74
  control: { type: "text" },
75
75
  },
76
+ errorMessage: {
77
+ control: { type: "text" },
78
+ },
76
79
  allOptions: {
77
80
  control: { type: "boolean" },
78
81
  },
@@ -1,4 +1,8 @@
1
1
  <template>
2
+ <ib-alert class="tree-select-error" v-if="errorMessage">
3
+ {{ errorMessage }}
4
+ </ib-alert>
5
+
2
6
  <div class="tree-select">
3
7
  <ib-dropdown
4
8
  :disabled="isLoading"
@@ -22,6 +26,7 @@
22
26
  :class="{
23
27
  'tree-choice-opened': isOpened,
24
28
  'has-clear-button': !showClearButton,
29
+ 'tree-choice-error': errorMessage,
25
30
  }"
26
31
  >
27
32
  <template v-if="htmlOptionTitle">
@@ -232,6 +237,7 @@ import generateUID from "../../helpers/generateUID";
232
237
  import IbDropdown from "../Dropdown/Dropdown.vue";
233
238
  import IbIcon from "../Icon.vue";
234
239
  import IbIconButton from "../IconButton/IconButton.vue";
240
+ import IbAlert from "../Alert/Alert.vue";
235
241
  import List from "../List.vue";
236
242
 
237
243
  export default {
@@ -359,6 +365,10 @@ export default {
359
365
  type: String,
360
366
  default: "",
361
367
  },
368
+ errorMessage: {
369
+ type: String,
370
+ default: "",
371
+ },
362
372
  allOptions: {
363
373
  type: Boolean,
364
374
  default: true,
@@ -938,6 +948,7 @@ export default {
938
948
  },
939
949
  },
940
950
  components: {
951
+ IbAlert,
941
952
  IbIconButton,
942
953
  IbIcon,
943
954
  IbDropdown,
@@ -17,10 +17,22 @@ $choice-hover-icon-color: $blue-700;
17
17
  $choice-opened-bg: $blue-50;
18
18
  $choice-opened-border-color: $blue-900;
19
19
  $choice-opened-icon-color: $blue-900;
20
-
20
+ $choice-border-error-color: $red-800;
21
21
  $tree-search-border-color: $gray-600;
22
+
23
+ .tree-select-error {
24
+ margin-bottom: 5px;
25
+ }
26
+
22
27
  .tree-select {
28
+ width: 100%;
29
+
30
+ .ib-dropdown {
31
+ width: 100%;
32
+ }
33
+
23
34
  .dropdown-trigger {
35
+ width: inherit;
24
36
  display: inline-block;
25
37
  position: relative;
26
38
 
@@ -60,7 +72,6 @@ $tree-search-border-color: $gray-600;
60
72
  background-color: $choice-bg;
61
73
  color: $choice-text-color;
62
74
  border-radius: 4px 4px 0 0;
63
- width: 280px;
64
75
  display: flex;
65
76
  align-items: center;
66
77
  justify-content: space-between;
@@ -92,6 +103,12 @@ $tree-search-border-color: $gray-600;
92
103
  color: $choice-opened-icon-color;
93
104
  }
94
105
  }
106
+
107
+ &.tree-choice-error {
108
+ border-radius: 4px;
109
+ border-color: transparent;
110
+ @include outline(-2px, $choice-border-error-color);
111
+ }
95
112
  }
96
113
 
97
114
  .button-clear {