@avakhula/ui 0.1.13 → 0.1.15

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 (116) hide show
  1. package/.prettierrc.json +0 -0
  2. package/.storybook/intelliboardTheme.js +0 -0
  3. package/.storybook/manager.js +0 -0
  4. package/.storybook/scss-loader.scss +0 -0
  5. package/.storybook/withSource.js +0 -0
  6. package/README.md +0 -0
  7. package/dist/index.js +9028 -7513
  8. package/dist/index.umd.cjs +76 -73
  9. package/dist/style.css +1 -1
  10. package/index.html +0 -0
  11. package/package.json +4 -3
  12. package/src/App.vue +5 -128
  13. package/src/EventEmmiter.js +0 -0
  14. package/src/assets/scss/mixins/dropdown-list-item.scss +13 -1
  15. package/src/assets/scss/mixins.scss +0 -0
  16. package/src/assets/scss/reset.scss +0 -0
  17. package/src/assets/scss/style.scss +0 -0
  18. package/src/assets/scss/typography.scss +0 -0
  19. package/src/components/Alert/Alert.vue +5 -0
  20. package/src/components/Alert/alert.scss +6 -1
  21. package/src/components/Avatar/Avatar.stories.js +5 -1
  22. package/src/components/Avatar/Avatar.vue +25 -2
  23. package/src/components/Avatar/constants.js +6 -0
  24. package/src/components/Badge/Badge.stories.js +0 -0
  25. package/src/components/Breadcrumbs/Breadcrumbs.vue +17 -7
  26. package/src/components/Button/Button.stories.js +0 -0
  27. package/src/components/Button/Button.vue +19 -3
  28. package/src/components/Button/button.scss +5 -0
  29. package/src/components/Button/constants.js +0 -0
  30. package/src/components/ButtonGroup/ButtonGroup.vue +0 -0
  31. package/src/components/Chips/Chips.stories.js +30 -0
  32. package/src/components/Chips/Chips.vue +125 -0
  33. package/src/components/Dropdown/Dropdown.spec.js +0 -0
  34. package/src/components/Dropdown/DropdownDivider.vue +0 -0
  35. package/src/components/Dropdown/DropdownItem.vue +26 -4
  36. package/src/components/Dropdown/DropdownList.vue +0 -0
  37. package/src/components/Dropdown/constants.js +0 -0
  38. package/src/components/Form/CharactersCount.vue +10 -7
  39. package/src/components/Form/Checkbox/Checkbox.vue +25 -11
  40. package/src/components/Form/CheckboxGroup/CheckboxGroup.vue +15 -0
  41. package/src/components/Form/CheckboxGroup/readme.mdx +2 -0
  42. package/src/components/Form/DatePicker/DatePicker.scss +352 -261
  43. package/src/components/Form/DatePicker/DatePicker.vue +72 -17
  44. package/src/components/Form/DatePicker/Icons/chevron-back.js +0 -0
  45. package/src/components/Form/DatePicker/Icons/chevron-forward.js +0 -0
  46. package/src/components/Form/FormGroup/FormGroup.stories.js +0 -0
  47. package/src/components/Form/FormGroup/FormGroup.vue +3 -3
  48. package/src/components/Form/FormGroup/FormGroupSet.stories.js +0 -0
  49. package/src/components/Form/FormGroup/FormGroupSet.vue +0 -0
  50. package/src/components/Form/Input/Input.vue +116 -13
  51. package/src/components/Form/Input/input.scss +61 -2
  52. package/src/components/Form/Label/Label.vue +22 -10
  53. package/src/components/Form/PhoneInput/PhoneInput.vue +26 -12
  54. package/src/components/Form/PhoneInput/phoneInput.scss +38 -6
  55. package/src/components/Form/Radio/Radio.vue +16 -44
  56. package/src/components/Form/Radio/radio.scss +5 -2
  57. package/src/components/Form/TextEditor/TextEditor.vue +117 -22
  58. package/src/components/Form/TextEditor/icons/svg/chevron-down.svg +0 -0
  59. package/src/components/Form/TextEditor/icons/toolbarIcons.js +0 -0
  60. package/src/components/Form/TextEditor/plugins/alphabetList.js +0 -0
  61. package/src/components/Form/TextEditor/textEditor.scss +56 -32
  62. package/src/components/Form/Textarea/Textarea.spec.js +0 -0
  63. package/src/components/Form/Textarea/Textarea.vue +19 -6
  64. package/src/components/Form/Textarea/textarea.scss +30 -2
  65. package/src/components/Icon.vue +0 -0
  66. package/src/components/IconButton/IconButton.scss +11 -0
  67. package/src/components/IconButton/IconButton.stories.js +0 -0
  68. package/src/components/IconButton/IconButton.vue +6 -9
  69. package/src/components/IconButton/constants.js +0 -0
  70. package/src/components/Modal/Modal.vue +42 -9
  71. package/src/components/Pagination/LimitSelector.vue +5 -0
  72. package/src/components/Pagination/Pagination.stories.js +0 -0
  73. package/src/components/Pagination/Pagination.vue +9 -2
  74. package/src/components/Panel/Panel.vue +87 -6
  75. package/src/components/Popover/Popover.stories.js +0 -0
  76. package/src/components/Popover/Popover.vue +47 -19
  77. package/src/components/Popover/popover.scss +27 -7
  78. package/src/components/ProgressBar/ProgressBar.stories.js +0 -0
  79. package/src/components/Sorting/Sorting.vue +24 -26
  80. package/src/components/Sorting/constants.js +0 -0
  81. package/src/components/SplitButton/SplitButton.vue +51 -8
  82. package/src/components/SplitButton/SplitButtonItem.vue +13 -1
  83. package/src/components/SplitButton/constants.js +0 -0
  84. package/src/components/Table/Cells/Cell.vue +0 -0
  85. package/src/components/Table/Cells/CheckboxCell.vue +0 -0
  86. package/src/components/Table/Row.vue +0 -0
  87. package/src/components/Table/Table.stories.js +0 -0
  88. package/src/components/Table/Table.vue +0 -0
  89. package/src/components/Tabs/Tab.vue +4 -0
  90. package/src/components/Tabs/Tabs.vue +5 -0
  91. package/src/components/Tabs/tabs.scss +8 -2
  92. package/src/components/TagPill/TagPill.vue +6 -0
  93. package/src/components/TagPill/constants.js +0 -0
  94. package/src/components/ToggleTip/ToggleTip.stories.js +0 -0
  95. package/src/components/ToggleTip/ToggleTip.vue +0 -0
  96. package/src/components/Tooltip/Tooltip.stories.js +0 -0
  97. package/src/components/Tooltip/Tooltip.vue +1 -1
  98. package/src/components/TreeSelect/Option.vue +48 -16
  99. package/src/components/TreeSelect/Select.vue +101 -39
  100. package/src/components/TreeSelect/mixins/InfinityLoaderMixin.js +40 -0
  101. package/src/components/TreeSelect/scss/option.scss +31 -0
  102. package/src/components/TreeSelect/scss/select.scss +48 -2
  103. package/src/constants/events.js +0 -0
  104. package/src/constants/keyCodes.js +1 -0
  105. package/src/directives/outside/outside.js +0 -0
  106. package/src/directives/tooltip/TooltipController.js +2 -0
  107. package/src/directives/tooltip/textOverflowTooltip.js +3 -1
  108. package/src/directives/tooltip/tooltip.js +15 -0
  109. package/src/helpers/generateUID.js +0 -0
  110. package/src/helpers/getHrefFromID.js +0 -0
  111. package/src/helpers/multiLineOverflows.js +0 -0
  112. package/src/helpers/stripHtml.js +4 -0
  113. package/src/index.js +2 -0
  114. package/src/stories/link.stories.js +0 -0
  115. package/static/Logo.svg +0 -0
  116. package/vite.config.js +0 -0
@@ -30,13 +30,13 @@ $input-hover-error-color: $red-800;
30
30
 
31
31
  // AlphabeticalList list style
32
32
  ol[type="a"] li::before {
33
- content: counter(list-1, lower-alpha) ". ";
33
+ content: counter(list-1, lower-alpha) ". "!important;
34
34
  }
35
35
  ol[type="a"] li {
36
- counter-increment: list-1;
36
+ counter-increment: list-1!important;
37
37
  }
38
38
  ol[type="a"] li {
39
- counter-reset: list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9;
39
+ counter-reset: list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9!important;
40
40
  }
41
41
 
42
42
  .textarea-wrapper {
@@ -197,7 +197,7 @@ ol[type="a"] li {
197
197
  .ib-text-editor {
198
198
  background-color: $blue-100;
199
199
  border-bottom-color: $blue-700;
200
-
200
+
201
201
  & + .toolbar {
202
202
  background-color: $blue-100;
203
203
  }
@@ -235,11 +235,11 @@ ol[type="a"] li {
235
235
 
236
236
  .toolbar {
237
237
  position: absolute;
238
- bottom: 2px;
238
+ bottom: 1.5px;
239
239
  left: 12px;
240
240
  right: 25px;
241
241
  padding-top: 10px;
242
- padding-bottom: 8px;
242
+ padding-bottom: 5px;
243
243
  display: flex;
244
244
  flex-wrap: wrap;
245
245
  margin: 0 -10px;
@@ -249,6 +249,10 @@ ol[type="a"] li {
249
249
  display: flex;
250
250
  padding: 0 10px;
251
251
 
252
+ &__label {
253
+ display: none;
254
+ }
255
+
252
256
  &:last-child {
253
257
  &::before {
254
258
  display: none;
@@ -274,6 +278,24 @@ ol[type="a"] li {
274
278
  }
275
279
  }
276
280
 
281
+ .ql-picker.ql-placeholder {
282
+ width: 118px;
283
+
284
+ .ql-picker-options {
285
+ [data-value='default'] {
286
+ display: none;
287
+ }
288
+ }
289
+ }
290
+
291
+ .ql-picker.ql-placeholder > span.ql-picker-label::before {
292
+ content: 'Placeholders';
293
+ }
294
+
295
+ .ql-picker.ql-placeholder > span.ql-picker-options > span.ql-picker-item::before {
296
+ content: attr(data-label);
297
+ }
298
+
277
299
  // Headings dropdown
278
300
  .ql-snow .ql-picker.ql-header .ql-picker-item {
279
301
  &::before {
@@ -395,37 +417,39 @@ ol[type="a"] li {
395
417
  }
396
418
  }
397
419
 
398
- .ql-picker-options {
399
- left: -2px;
400
- margin-top: 5px !important;
401
- border-radius: 4px;
402
- padding: 6.5px 0;
403
- background-color: $white;
404
- box-shadow: $ib-shadow-4;
420
+ .ql-snow {
421
+ .ql-picker-options {
422
+ left: -2px;
423
+ margin-top: 5px !important;
424
+ border-radius: 4px;
425
+ padding: 6.5px 0;
426
+ background-color: $white;
427
+ box-shadow: $ib-shadow-4;
405
428
 
406
- .ql-picker-item {
407
- height: 36px;
408
- padding: 0px 15px 0px 13px;
409
- display: flex;
410
- align-items: center;
411
- border-left: 2px solid transparent;
412
- transition: border-color 0.3s, background-color 0.3s;
413
- @include focus();
429
+ .ql-picker-item {
430
+ height: 36px;
431
+ padding: 0px 15px 0px 13px;
432
+ display: flex;
433
+ align-items: center;
434
+ border-left: 2px solid transparent;
435
+ transition: border-color 0.3s, background-color 0.3s;
436
+ @include focus();
414
437
 
415
- &:before {
416
- color: $neutral-900;
417
- }
438
+ &:before {
439
+ color: $neutral-900;
440
+ }
418
441
 
419
- &:hover {
420
- background-color: $gray-100;
421
- }
442
+ &:hover {
443
+ background-color: $gray-100;
444
+ }
422
445
 
423
- &.ql-selected {
424
- border-color: $blue-900;
425
- background-color: $gray-100;
446
+ &.ql-selected {
447
+ border-color: $blue-900;
448
+ background-color: $gray-100;
426
449
 
427
- &:hover {
428
- background-color: $blue-50;
450
+ &:hover {
451
+ background-color: $blue-50;
452
+ }
429
453
  }
430
454
  }
431
455
  }
File without changes
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="textarea-wrapper" :class="{ disabled: disabled }">
2
+ <div class="textarea-wrapper" :class="{ disabled: disabled, hasActins: $slots.actions }">
3
3
  <ib-character-count
4
4
  v-if="characterLimit"
5
5
  :character-limit="characterLimit"
@@ -20,6 +20,10 @@
20
20
  :class="classes"
21
21
  :disabled="disabled"
22
22
  ></textarea>
23
+
24
+ <div class="textarea-actions">
25
+ <slot name="actions"></slot>
26
+ </div>
23
27
  </div>
24
28
  </template>
25
29
 
@@ -57,22 +61,30 @@ export default {
57
61
  type: String,
58
62
  default: "",
59
63
  },
64
+ value: {
65
+ type: String,
66
+ default: "",
67
+ },
68
+ },
69
+ watch: {
70
+ value() {
71
+ this.val = this.value;
72
+ },
73
+ val() {
74
+ this.$emit("update:value", this.val);
75
+ },
60
76
  },
61
77
  data() {
62
78
  return {
63
- val: "",
79
+ val: this.value,
64
80
  };
65
81
  },
66
82
  methods: {
67
83
  onInput() {
68
- if (!this.characterOverLimit) {
69
84
  this.$emit("input", this.val);
70
- }
71
85
  },
72
86
  onBlur() {
73
- if (!this.characterOverLimit) {
74
87
  this.$emit("blur", this.val);
75
- }
76
88
  },
77
89
  },
78
90
  computed: {
@@ -93,6 +105,7 @@ export default {
93
105
  IbAlert,
94
106
  IbCharacterCount,
95
107
  },
108
+ emits: ["input", "blur", "update:value"],
96
109
  inheritAttrs: false,
97
110
  };
98
111
  </script>
@@ -14,8 +14,10 @@ $textarea-hover-border-color: $blue-700;
14
14
  $textarea-error-outline-color: $red-800;
15
15
 
16
16
  .textarea-wrapper {
17
- width: fit-content;
17
+ background-color: $textarea-bg;
18
+ width: 100%;
18
19
  position: relative;
20
+ border-radius: 4px 4px 0px 0px;
19
21
 
20
22
  .character-count {
21
23
  position: absolute;
@@ -32,14 +34,35 @@ $textarea-error-outline-color: $red-800;
32
34
  color: $neutral-500;
33
35
  }
34
36
  }
37
+
38
+ &.hasActins {
39
+ textarea {
40
+ padding-bottom: 40px;
41
+ }
42
+ }
43
+
44
+ .textarea-actions {
45
+ background-color: inherit;
46
+ position: absolute;
47
+ bottom: 3px;
48
+ left: 0;
49
+ right: 10px;
50
+ padding: 0 10px 2px 10px;
51
+ transition: background-color 0.3s;
52
+ }
53
+
54
+ &:hover {
55
+ background-color: $textarea-hover-bg;
56
+ }
35
57
  }
36
58
 
37
59
  textarea.ib-textarea {
38
60
  @include Ib-H4-regular;
61
+ width: 100%;
39
62
  height: 80px;
40
63
  min-height: 36px;
41
64
  border: none;
42
- background-color: $textarea-bg;
65
+ background-color: inherit;
43
66
  color: $textarea-text-color;
44
67
  padding: 10px 15px;
45
68
  resize: vertical;
@@ -76,6 +99,11 @@ textarea.ib-textarea {
76
99
  }
77
100
  }
78
101
 
102
+ &:read-only:hover {
103
+ background-color: $textarea-bg;
104
+ color: $textarea-text-color;
105
+ }
106
+
79
107
  &.error {
80
108
  border-radius: 4px;
81
109
  border-bottom-color: transparent;
File without changes
@@ -1,6 +1,10 @@
1
1
  @import "../../assets/scss/variables/colors.scss";
2
2
  @import "../../assets/scss/mixins.scss";
3
3
 
4
+ // Disabled button colors
5
+ $disabled-btn-background: $gray-100;
6
+ $disabled-btn-color: $neutral-500;
7
+
4
8
  .ib-icon-button {
5
9
  padding: 0;
6
10
  display: flex;
@@ -93,6 +97,13 @@
93
97
  color: $blue-900;
94
98
  background-color: $blue-200;
95
99
  }
100
+
101
+ &:disabled {
102
+ background: $disabled-btn-background;
103
+ color: $disabled-btn-color;
104
+ cursor: auto;
105
+ border-color: transparent;
106
+ }
96
107
  }
97
108
  }
98
109
  }
File without changes
@@ -1,8 +1,8 @@
1
1
  <template>
2
2
  <ib-button
3
- @click="onClick"
4
3
  v-bind="attrs"
5
4
  :href="href"
5
+ :to="to"
6
6
  :kind="kind"
7
7
  :disabled="disabled"
8
8
  :prevent-default="preventDefault"
@@ -16,7 +16,6 @@
16
16
  import IbButton from "../Button/Button.vue";
17
17
  import IbTooltip from "../Tooltip/Tooltip.vue";
18
18
  import { iconButtonKindOptions, iconButtonSize } from "./constants.js";
19
- import removeEvents from "../../helpers/removeEvents";
20
19
 
21
20
  export default {
22
21
  name: "IbIconButton",
@@ -45,6 +44,10 @@ export default {
45
44
  type: String,
46
45
  default: "",
47
46
  },
47
+ to: {
48
+ type: [String, Object],
49
+ default: "",
50
+ },
48
51
  helpText: {
49
52
  type: String,
50
53
  default: "",
@@ -63,11 +66,6 @@ export default {
63
66
  tooltipVisible: false,
64
67
  };
65
68
  },
66
- methods: {
67
- onClick(e) {
68
- this.$emit("click", e);
69
- },
70
- },
71
69
  computed: {
72
70
  classes() {
73
71
  const classList = ["ib-icon-button"];
@@ -85,8 +83,7 @@ export default {
85
83
  return classList;
86
84
  },
87
85
  attrs() {
88
- const attrsList = removeEvents({ ...this.$attrs }, ['onClick']);
89
-
86
+ const attrsList = {...this.$attrs};
90
87
  attrsList.class = [...this.classes, attrsList.class];
91
88
 
92
89
  if (this.disabledFocus) {
File without changes
@@ -10,7 +10,7 @@
10
10
  </div>
11
11
 
12
12
  <Teleport to="body">
13
- <div class="modal" :class="classList" v-show="isActive" ref="modal">
13
+ <div :class="classes" v-show="isActive" ref="modal">
14
14
  <div :class="bodyClassList" :style="bodyStyles" v-outside="clickOutside">
15
15
  <ib-icon-button
16
16
  v-if="showCloseButton"
@@ -116,8 +116,10 @@ export default {
116
116
  this.close();
117
117
  }
118
118
  },
119
- onTriggerBlur() {
120
- this.$refs.modal?.querySelector("a, button, [tabindex]")?.focus();
119
+ onTriggerBlur(e) {
120
+ if (!this.$refs.modal?.contains(e.relatedTarget) && this.isActive ) {
121
+ this.$refs.modal?.querySelector("a, button, [tabindex]")?.focus();
122
+ }
121
123
  },
122
124
  open() {
123
125
  this.isActive = true;
@@ -125,16 +127,35 @@ export default {
125
127
  this.$emit("open");
126
128
  },
127
129
  close() {
128
- this.isActive = false;
129
130
  this.$refs.trigger?.querySelector("a, button, [tabindex]")?.focus();
130
131
  document.body.classList.remove("modal-open");
131
132
  this.$emit("close");
132
133
  },
133
134
  setFocusOnModal(e) {
134
- if(!this.$refs.modal?.contains(e.target) && this.isActive) {
135
- this.$refs.modal.querySelector(
136
- "[tabindex], a, button, input, select, textarea"
137
- ).focus();
135
+ if (!this.isActive) return;
136
+
137
+ const openModals = Array.from(
138
+ document.querySelectorAll('.modal.is-active')
139
+ );
140
+
141
+ const topModal = openModals
142
+ .sort((a, b) =>
143
+ +(getComputedStyle(a).zIndex || 0) - +(getComputedStyle(b).zIndex || 0)
144
+ )
145
+ .at(-1);
146
+
147
+ if (topModal !== (this.$refs.modal)) return;
148
+
149
+ if (
150
+ !topModal.contains(e.target) &&
151
+ !topModal.contains(e.relatedTarget)
152
+ ) {
153
+ const focusable = topModal.querySelector(
154
+ `a[href], button:not([disabled]),
155
+ textarea, input:not([type="hidden"]),
156
+ select, [tabindex]:not([tabindex="-1"])`
157
+ );
158
+ focusable?.focus();
138
159
  }
139
160
  },
140
161
  clickOutside(e) {
@@ -153,9 +174,21 @@ export default {
153
174
  }
154
175
  },
155
176
  computed: {
177
+ classes() {
178
+ const classList = ["modal"];
179
+
180
+ if (this.classList.length) {
181
+ classList.push(this.classList);
182
+ }
183
+
184
+ if (this.isActive) {
185
+ classList.push("is-active");
186
+ }
187
+
188
+ return classList;
189
+ },
156
190
  bodyStyles() {
157
191
  const styleList = {};
158
-
159
192
  if (this.size === modalSizes.S) {
160
193
  styleList.width = "380px";
161
194
  styleList.minHeight = "160px";
@@ -4,9 +4,11 @@
4
4
  <ib-select
5
5
  classList="report-limit-selector-select"
6
6
  :value="value"
7
+ :vertical="vertical"
7
8
  :options="prepareOptions"
8
9
  :is-multiple="false"
9
10
  :show-clear-button="false"
11
+ aria-label="Pagination"
10
12
  @input="selectItem"
11
13
  />
12
14
  </div>
@@ -25,6 +27,9 @@ export default {
25
27
  value: {
26
28
  type: Number,
27
29
  },
30
+ vertical: {
31
+ type: String
32
+ },
28
33
  options: {
29
34
  type: Array,
30
35
  default: () => [10, 25, 50, 100],
File without changes
@@ -3,14 +3,15 @@
3
3
  <ib-limit-selector
4
4
  @select="changeLimit"
5
5
  :value="limitValue"
6
+ :vertical="vertical"
6
7
  :label-select="labelSelect"
7
8
  ></ib-limit-selector>
8
9
 
9
10
  <div class="repot-pagination">
10
11
  <template v-if="showPaginationInput">
11
- <ib-label>{{ labelInput }}</ib-label>
12
+ <ib-label for="goToPage">{{ labelInput }}</ib-label>
12
13
  <div class="pagination-input">
13
- <ib-input type="number" :debounce="500" @input="onInput"></ib-input>
14
+ <ib-input id="goToPage" type="number" hide-number-actions :debounce="500" @input="onInput"></ib-input>
14
15
  </div>
15
16
  </template>
16
17
 
@@ -104,6 +105,9 @@ export default {
104
105
  type: Boolean,
105
106
  default: true,
106
107
  },
108
+ vertical: {
109
+ type: String
110
+ }
107
111
  },
108
112
  data() {
109
113
  return {
@@ -117,6 +121,9 @@ export default {
117
121
  current(newVal) {
118
122
  this.onSelect(newVal);
119
123
  },
124
+ limitSelector(newVal) {
125
+ this.limitValue = newVal;
126
+ },
120
127
  limitValue() {
121
128
  this.currentPage = 1;
122
129
  },
@@ -1,13 +1,29 @@
1
1
  <template>
2
- <div class="panel" :class="{ 'panel-error': error }">
2
+ <div class="ib-panel" :class="{ 'panel-error': error }">
3
3
  <div class="panel-head">
4
4
  <div class="head-title">
5
5
  <slot name="title" />
6
6
  </div>
7
- <div class="divider"></div>
7
+
8
+ <div v-show="!hideHeaderDivider" class="divider"></div>
9
+
8
10
  <div class="head-content">
9
11
  <slot name="head-content" />
10
12
  </div>
13
+
14
+ <icon-button
15
+ v-if="showExpandButton"
16
+ :class="{
17
+ 'toggle-visible-button': true,
18
+ 'active': isOpenVal,
19
+ }"
20
+ kind="ghost"
21
+ type="button"
22
+ v-tooltip="expandButtonTooltip"
23
+ @click="isOpenVal = !isOpenVal"
24
+ >
25
+ <icon name="chevron-down-outline" />
26
+ </icon-button>
11
27
  </div>
12
28
  <Transition
13
29
  name="expand"
@@ -15,7 +31,7 @@
15
31
  @after-enter="afterEnter"
16
32
  @leave="leave"
17
33
  >
18
- <div v-show="isOpen" class="panel-body">
34
+ <div v-show="isOpenVal" class="panel-body">
19
35
  <slot name="body"></slot>
20
36
  </div>
21
37
  </Transition>
@@ -23,12 +39,23 @@
23
39
  </template>
24
40
 
25
41
  <script>
42
+ import IconButton from "../IconButton/IconButton.vue";
43
+ import Icon from "../Icon.vue";
26
44
  import expandAnimation from "../../mixins/expandAnimation";
45
+ import { TooltipDirective as Tooltip } from "../../directives/tooltip/tooltip";
27
46
 
28
47
  export default {
29
48
  name: "IbPanel",
30
49
  mixins: [expandAnimation],
31
50
  props: {
51
+ showExpandButton: {
52
+ type: Boolean,
53
+ default: false,
54
+ },
55
+ expandButtonTooltip: {
56
+ type: String,
57
+ default: "",
58
+ },
32
59
  isOpen: {
33
60
  type: Boolean,
34
61
  default: true,
@@ -37,7 +64,32 @@ export default {
37
64
  type: Boolean,
38
65
  default: false,
39
66
  },
67
+ hideHeaderDivider: {
68
+ type: Boolean,
69
+ default: false,
70
+ }
71
+ },
72
+ watch: {
73
+ isOpen() {
74
+ this.isOpenVal = this.isOpen;
75
+ },
76
+ isOpenVal() {
77
+ this.$emit("update:isOpen", this.isOpenVal);
78
+ },
79
+ },
80
+ data() {
81
+ return {
82
+ isOpenVal: this.isOpen,
83
+ };
40
84
  },
85
+ components: {
86
+ IconButton,
87
+ Icon,
88
+ },
89
+ directives: {
90
+ Tooltip,
91
+ },
92
+ emits: ["update:isOpen"],
41
93
  };
42
94
  </script>
43
95
 
@@ -60,9 +112,8 @@ $panel-border-color: $gray-200;
60
112
  $panel-error-outline-color: $red-800;
61
113
  $panel-title-color: $neutral-900;
62
114
  $panel-divider-color: $gray-300;
63
- $description-color: $gray-700;
64
115
 
65
- .panel {
116
+ .ib-panel {
66
117
  border: 1px solid $panel-border-color;
67
118
  border-radius: 4px;
68
119
 
@@ -70,6 +121,20 @@ $description-color: $gray-700;
70
121
  outline: 2px solid $panel-error-outline-color;
71
122
  }
72
123
 
124
+ .toggle-visible-button {
125
+ margin-left: 10px;
126
+
127
+ ion-icon {
128
+ transition: transform 0.5s;
129
+ }
130
+
131
+ &.active {
132
+ ion-icon {
133
+ transform: rotate(180deg);
134
+ }
135
+ }
136
+ }
137
+
73
138
  .panel-head {
74
139
  display: inline-flex;
75
140
  width: 100%;
@@ -91,9 +156,25 @@ $description-color: $gray-700;
91
156
  }
92
157
 
93
158
  .head-content {
159
+ width: 100%;
94
160
  @include Ib-H4-regular;
161
+ }
162
+ }
163
+ }
164
+ </style>
165
+
166
+ <style lang="scss">
167
+ @import "../../assets/scss/variables/colors.scss";
168
+ @import "../../assets/scss/typography.scss";
169
+
170
+ $description-color: $gray-700;
171
+
172
+ .ib-panel {
173
+ .head-content {
174
+ width: 100%;
175
+ @include Ib-H4-regular;
176
+ p {
95
177
  color: $description-color;
96
- width: 100%;
97
178
  }
98
179
  }
99
180
  }
File without changes