@xen-orchestra/web-core 0.58.0 → 0.60.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 (226) hide show
  1. package/lib/assets/css/_colors.pcss +1 -1
  2. package/lib/components/card/VtsCardRowKeyValue.vue +1 -1
  3. package/lib/components/cell-object/VtsCellObject.vue +1 -1
  4. package/lib/components/cell-text/VtsCellText.vue +1 -1
  5. package/lib/components/console/VtsActionsConsole.vue +1 -1
  6. package/lib/components/console/VtsClipboardConsole.vue +1 -1
  7. package/lib/components/console/VtsLayoutConsole.vue +1 -1
  8. package/lib/components/console/VtsRemoteConsole.vue +1 -1
  9. package/lib/components/copy-button/VtsCopyButton.vue +1 -1
  10. package/lib/components/delete-button/VtsDeleteButton.vue +1 -1
  11. package/lib/components/icon/VtsIcon.vue +1 -1
  12. package/lib/components/input-wrapper/VtsInputWrapper.vue +3 -3
  13. package/lib/components/key-value-pair/VtsKeyValuePair.vue +1 -1
  14. package/lib/components/layout/VtsContentSidePanel.vue +2 -2
  15. package/lib/components/linear-chart/VtsLinearChart.vue +1 -1
  16. package/lib/components/menu/MenuItem.vue +2 -2
  17. package/lib/components/menu/MenuList.vue +2 -2
  18. package/lib/components/menu/MenuSeparator.vue +1 -1
  19. package/lib/components/modal/VtsActionModal.vue +57 -13
  20. package/lib/components/modal/VtsBlockedModal.vue +7 -7
  21. package/lib/components/modal/VtsDeleteModal.vue +20 -15
  22. package/lib/components/modal/VtsErrorModal.vue +10 -6
  23. package/lib/components/object-icon/VtsObjectIcon.vue +3 -1
  24. package/lib/components/panel/VtsPanel.vue +1 -1
  25. package/lib/components/panel/VtsSidePanel.vue +3 -3
  26. package/lib/components/query-builder/VtsQueryBuilder.vue +3 -3
  27. package/lib/components/query-builder/VtsQueryBuilderButton.vue +17 -11
  28. package/lib/components/query-builder/VtsQueryBuilderFilter.vue +1 -1
  29. package/lib/components/query-builder/VtsQueryBuilderGroup.vue +1 -1
  30. package/lib/components/query-builder/VtsQueryBuilderModal.vue +13 -8
  31. package/lib/components/query-builder/VtsQueryBuilderRow.vue +1 -1
  32. package/lib/components/relative-time/VtsRelativeTime.vue +2 -2
  33. package/lib/components/space-card/VtsSpaceCard.vue +11 -7
  34. package/lib/components/sr-connection-modal/VtsSrConnectionModal.vue +77 -0
  35. package/lib/components/stacked-bar-with-legend/VtsStackedBarWithLegend.vue +1 -1
  36. package/lib/components/state-hero/VtsStateHero.vue +1 -1
  37. package/lib/components/status/VtsStatus.vue +1 -1
  38. package/lib/components/tab/TabItem.vue +2 -2
  39. package/lib/components/tab/TabList.vue +1 -1
  40. package/lib/components/table/VtsTable.vue +3 -3
  41. package/lib/components/table/cells/VtsCollapsedListCell.vue +1 -1
  42. package/lib/components/table/cells/VtsLinkCell.vue +2 -2
  43. package/lib/components/table/cells/VtsStatusCell.vue +3 -3
  44. package/lib/components/table/cells/VtsTagCell.vue +2 -2
  45. package/lib/components/table/cells/VtsTextCell.vue +1 -1
  46. package/lib/components/tag/VtsTag.vue +1 -1
  47. package/lib/components/task/VtsQuickTaskButton.vue +1 -1
  48. package/lib/components/task/VtsQuickTaskTabBar.vue +1 -1
  49. package/lib/components/tooltip-list/VtsTooltipList.vue +1 -1
  50. package/lib/components/tree/VtsTreeList.vue +1 -1
  51. package/lib/components/tree/VtsTreeLoadingItem.vue +1 -1
  52. package/lib/components/ui/account-menu-button/UiAccountMenuButton.vue +1 -1
  53. package/lib/components/ui/alarm-item/UiAlarmItem.vue +2 -2
  54. package/lib/components/ui/alert/UiAlert.vue +1 -1
  55. package/lib/components/ui/button/UiButton.vue +2 -2
  56. package/lib/components/ui/button-icon/UiButtonIcon.vue +1 -1
  57. package/lib/components/ui/card-numbers/UiCardNumbers.vue +1 -1
  58. package/lib/components/ui/checkbox/UiCheckbox.vue +201 -189
  59. package/lib/components/ui/chip/UiChip.vue +1 -1
  60. package/lib/components/ui/counter/UiCounter.vue +1 -1
  61. package/lib/components/ui/drawer/UiDrawer.vue +37 -54
  62. package/lib/components/ui/dropdown/UiDropdown.vue +2 -2
  63. package/lib/components/ui/dropdown-button/UiDropdownButton.vue +1 -1
  64. package/lib/components/ui/head-bar/UiHeadBar.vue +1 -1
  65. package/lib/components/ui/info/UiInfo.vue +1 -1
  66. package/lib/components/ui/input/UiInput.vue +2 -2
  67. package/lib/components/ui/label/UiLabel.vue +1 -1
  68. package/lib/components/ui/legend/UiLegend.vue +2 -2
  69. package/lib/components/ui/legend-title/UiLegendTitle.vue +1 -1
  70. package/lib/components/ui/link/UiLink.vue +2 -2
  71. package/lib/components/ui/loader/UiLoader.vue +1 -1
  72. package/lib/components/ui/modal/UiModal.vue +17 -5
  73. package/lib/components/ui/object-link/UiObjectLink.vue +1 -1
  74. package/lib/components/ui/panel-card/UiPanelCard.vue +20 -0
  75. package/lib/components/ui/progress-bar/UiProgressBar.vue +1 -1
  76. package/lib/components/ui/query-search-bar/UiQuerySearchBar.vue +2 -2
  77. package/lib/components/ui/quick-task-panel/UiQuickTaskPanel.vue +1 -1
  78. package/lib/components/ui/radio-button/UiRadioButton.vue +2 -2
  79. package/lib/components/ui/stacked-bar/StackedBarSegment.vue +2 -2
  80. package/lib/components/ui/stacked-bar/UiStackedBar.vue +1 -1
  81. package/lib/components/ui/tag/UiTag.vue +1 -1
  82. package/lib/components/ui/task-item/UiTaskItem.vue +1 -1
  83. package/lib/components/ui/text-area/UiTextarea.vue +1 -1
  84. package/lib/components/ui/toaster/UiToaster.vue +1 -1
  85. package/lib/components/ui/toggle/UiToggle.vue +1 -1
  86. package/lib/components/ui/tooltip/UiTooltip.vue +2 -2
  87. package/lib/components/ui/tree-item-label/UiTreeItemLabel.vue +6 -2
  88. package/lib/components/ui/user-link/UiUserLink.vue +1 -1
  89. package/lib/components/ui/user-logo/UiUserLogo.vue +1 -1
  90. package/lib/components/{vif-connection-toggle-modal/VtsVifConnectionToggleModal.vue → vif-connection-modal/VtsVifConnectionModal.vue} +15 -10
  91. package/lib/composables/chart-theme.composable.ts +1 -1
  92. package/lib/composables/context.composable.ts +1 -1
  93. package/lib/composables/default-tab.composable.ts +1 -1
  94. package/lib/composables/disabled.composable.ts +1 -1
  95. package/lib/composables/hide-route-query.composable.ts +1 -1
  96. package/lib/composables/link-component.composable.ts +1 -1
  97. package/lib/composables/modals/use-action-modal.ts +11 -0
  98. package/lib/composables/modals/use-blocked-modal.ts +10 -0
  99. package/lib/composables/modals/use-delete-modal.ts +11 -0
  100. package/lib/composables/pagination.composable.ts +2 -2
  101. package/lib/composables/route-query/types.ts +1 -1
  102. package/lib/composables/route-query.composable.ts +5 -5
  103. package/lib/composables/sort-route-query.composable.ts +1 -1
  104. package/lib/composables/tab-list.composable.ts +1 -1
  105. package/lib/composables/table/create-base-definition.ts +1 -1
  106. package/lib/composables/table/create-define-column.ts +6 -6
  107. package/lib/composables/table/create-sorting-definition.ts +2 -2
  108. package/lib/composables/table/create-visibility-definition.ts +2 -2
  109. package/lib/composables/table/type.ts +1 -1
  110. package/lib/composables/table.composable.ts +4 -4
  111. package/lib/composables/tree-filter.composable.ts +1 -1
  112. package/lib/directives/tooltip.directive.ts +2 -2
  113. package/lib/i18n.ts +4 -0
  114. package/lib/icons/index.ts +1 -1
  115. package/lib/locales/ar.json +1 -0
  116. package/lib/locales/cs.json +54 -6
  117. package/lib/locales/de.json +0 -2
  118. package/lib/locales/en.json +91 -9
  119. package/lib/locales/es.json +0 -1
  120. package/lib/locales/fi.json +20 -1
  121. package/lib/locales/fr.json +95 -13
  122. package/lib/locales/nb-NO.json +0 -1
  123. package/lib/locales/nl.json +81 -6
  124. package/lib/locales/pt-BR.json +1 -1
  125. package/lib/locales/pt.json +0 -1
  126. package/lib/locales/sk.json +54 -6
  127. package/lib/locales/sv.json +38 -2
  128. package/lib/locales/zh-Hans.json +0 -4
  129. package/lib/packages/form-select/use-form-select-controller.ts +1 -1
  130. package/lib/packages/job/define-job.ts +5 -5
  131. package/lib/packages/job/index.ts +4 -4
  132. package/lib/packages/job/use-job-store.ts +2 -2
  133. package/lib/packages/menu/action.ts +1 -1
  134. package/lib/packages/menu/context.ts +1 -1
  135. package/lib/packages/menu/index.ts +10 -10
  136. package/lib/packages/menu/job.ts +3 -3
  137. package/lib/packages/menu/link.ts +1 -1
  138. package/lib/packages/menu/router-link.ts +1 -1
  139. package/lib/packages/menu/toggle-target.ts +1 -1
  140. package/lib/packages/query-builder/group/build-root-group.ts +1 -1
  141. package/lib/packages/query-builder/node/handle-comparison-node.ts +1 -1
  142. package/lib/packages/query-builder/node/handle-glob-pattern-node.ts +1 -1
  143. package/lib/packages/query-builder/node/handle-group-node.ts +2 -2
  144. package/lib/packages/query-builder/node/handle-node.ts +8 -8
  145. package/lib/packages/query-builder/node/handle-null-node.ts +1 -1
  146. package/lib/packages/query-builder/node/handle-property-group-node.ts +2 -2
  147. package/lib/packages/query-builder/node/handle-property-node.ts +8 -8
  148. package/lib/packages/query-builder/node/handle-regexp-node.ts +1 -1
  149. package/lib/packages/query-builder/node/handle-string-or-number-node.ts +2 -2
  150. package/lib/packages/query-builder/node/handle-truthy-property-node.ts +1 -1
  151. package/lib/packages/query-builder/use-query-builder.ts +2 -2
  152. package/lib/packages/remote-resource/define-remote-resource.ts +1 -1
  153. package/lib/packages/threshold/use-threshold.ts +1 -1
  154. package/lib/packages/tree/branch-definition.ts +2 -2
  155. package/lib/packages/tree/branch.ts +8 -2
  156. package/lib/packages/tree/build-nodes.ts +3 -3
  157. package/lib/packages/tree/define-branch.ts +2 -2
  158. package/lib/packages/tree/define-leaf.ts +2 -2
  159. package/lib/packages/tree/define-tree.ts +3 -3
  160. package/lib/packages/tree/leaf-definition.ts +1 -1
  161. package/lib/packages/tree/leaf.ts +2 -2
  162. package/lib/packages/tree/tree-node-base.ts +2 -2
  163. package/lib/packages/tree/tree-node-definition-base.ts +1 -1
  164. package/lib/packages/tree/types.ts +6 -6
  165. package/lib/packages/tree/use-tree.ts +2 -2
  166. package/lib/stores/panel.store.ts +1 -1
  167. package/lib/stores/tooltip.store.ts +2 -2
  168. package/lib/tables/column-definitions/action-column.ts +2 -2
  169. package/lib/tables/column-definitions/button-column.ts +3 -3
  170. package/lib/tables/column-definitions/button-icon-column.ts +2 -2
  171. package/lib/tables/column-definitions/date-column.ts +3 -3
  172. package/lib/tables/column-definitions/info-column.ts +3 -3
  173. package/lib/tables/column-definitions/input-column.ts +3 -3
  174. package/lib/tables/column-definitions/link-column.ts +2 -2
  175. package/lib/tables/column-definitions/literal-column.ts +3 -3
  176. package/lib/tables/column-definitions/number-column.ts +2 -2
  177. package/lib/tables/column-definitions/percent-column.ts +2 -2
  178. package/lib/tables/column-definitions/progress-bar-column.ts +2 -2
  179. package/lib/tables/column-definitions/select-column.ts +2 -2
  180. package/lib/tables/column-definitions/status-column.ts +2 -2
  181. package/lib/tables/column-definitions/tag-column.ts +3 -3
  182. package/lib/tables/column-sets/backup-issue-columns.ts +1 -1
  183. package/lib/tables/column-sets/backup-job-columns.ts +1 -1
  184. package/lib/tables/column-sets/backup-job-schedule-columns.ts +1 -1
  185. package/lib/tables/column-sets/backup-log-columns.ts +1 -1
  186. package/lib/tables/column-sets/host-columns.ts +3 -3
  187. package/lib/tables/column-sets/network-columns.ts +2 -2
  188. package/lib/tables/column-sets/pif-columns.ts +2 -2
  189. package/lib/tables/column-sets/server-columns.ts +1 -1
  190. package/lib/tables/column-sets/sr-columns.ts +3 -3
  191. package/lib/tables/column-sets/vdi-columns.ts +2 -0
  192. package/lib/tables/column-sets/vif-columns.ts +1 -1
  193. package/lib/tables/column-sets/vif-network-columns.ts +1 -1
  194. package/lib/tables/column-sets/vm-backup-archive-columns.ts +3 -3
  195. package/lib/tables/column-sets/vm-backup-run-colums.ts +2 -2
  196. package/lib/tables/column-sets/vm-columns.ts +1 -1
  197. package/lib/types/object.type.ts +11 -1
  198. package/lib/utils/create-subscribable-store-context.util.ts +2 -2
  199. package/lib/utils/download-bugtools.utils.ts +1 -1
  200. package/lib/utils/if-else.utils.ts +2 -2
  201. package/lib/utils/injection-keys.util.ts +0 -2
  202. package/lib/utils/progress.util.ts +1 -1
  203. package/lib/utils/to-array.utils.ts +1 -1
  204. package/package.json +1 -1
  205. package/lib/components/drawer/VtsDrawer.vue +0 -89
  206. package/lib/components/drawer/VtsDrawerButton.vue +0 -22
  207. package/lib/components/drawer/VtsDrawerCancelButton.vue +0 -33
  208. package/lib/components/drawer/VtsDrawerConfirmButton.vue +0 -32
  209. package/lib/components/drawer/VtsDrawerList.vue +0 -34
  210. package/lib/components/modal/VtsModal.vue +0 -82
  211. package/lib/components/modal/VtsModalButton.vue +0 -35
  212. package/lib/components/modal/VtsModalCancelButton.vue +0 -37
  213. package/lib/components/modal/VtsModalConfirmButton.vue +0 -21
  214. package/lib/components/modal/VtsModalList.vue +0 -34
  215. package/lib/packages/drawer/DrawerProvider.vue +0 -17
  216. package/lib/packages/drawer/README.md +0 -189
  217. package/lib/packages/drawer/create-drawer-opener.ts +0 -119
  218. package/lib/packages/drawer/drawer.store.ts +0 -22
  219. package/lib/packages/drawer/types.ts +0 -93
  220. package/lib/packages/drawer/use-drawer.ts +0 -53
  221. package/lib/packages/modal/ModalProvider.vue +0 -17
  222. package/lib/packages/modal/README.md +0 -253
  223. package/lib/packages/modal/create-modal-opener.ts +0 -106
  224. package/lib/packages/modal/modal.store.ts +0 -22
  225. package/lib/packages/modal/types.ts +0 -91
  226. package/lib/packages/modal/use-modal.ts +0 -53
@@ -1,31 +1,36 @@
1
- <!-- v5 -->
1
+ <!-- v8 -->
2
2
  <template>
3
- <label :class="classNames" class="ui-checkbox" v-bind="wrapperAttrs">
4
- <input
5
- v-model="checkboxModel"
6
- :class="{ indeterminate: isIndeterminate }"
7
- :disabled="isDisabled"
8
- class="input"
9
- type="checkbox"
10
- v-bind="attrs"
11
- />
12
- <span class="fake-checkbox">
13
- <VtsIcon :name="icon" size="medium" class="icon" />
14
- </span>
15
- <span v-if="slots.default" class="typo-body-regular">
16
- <slot />
17
- </span>
18
- </label>
19
- <UiInfo v-if="slots.info" :accent="accent === 'brand' ? 'info' : accent">
20
- <slot name="info" />
21
- </UiInfo>
3
+ <div class="ui-checkbox">
4
+ <label :class="classNames" class="checkbox-label" v-bind="wrapperAttrs">
5
+ <input
6
+ v-model="checkboxModel"
7
+ :class="{ indeterminate: isIndeterminate }"
8
+ :disabled="isDisabled"
9
+ class="input"
10
+ type="checkbox"
11
+ v-bind="attrs"
12
+ />
13
+ <span class="fake-checkbox">
14
+ <VtsIcon :name="icon" size="medium" class="icon" />
15
+ </span>
16
+ <span v-if="slots.default" class="typo-body-regular">
17
+ <slot />
18
+ </span>
19
+ </label>
20
+ <UiInfo v-if="slots.info" accent="info">
21
+ <slot name="info" />
22
+ </UiInfo>
23
+ <UiInfo v-if="slots.message && accent !== 'brand'" :accent>
24
+ <slot name="message" />
25
+ </UiInfo>
26
+ </div>
22
27
  </template>
23
28
 
24
29
  <script lang="ts" setup>
25
30
  import VtsIcon from '@core/components/icon/VtsIcon.vue'
26
31
  import UiInfo from '@core/components/ui/info/UiInfo.vue'
27
- import { useDisabled } from '@core/composables/disabled.composable'
28
- import { toVariants } from '@core/utils/to-variants.util'
32
+ import { useDisabled } from '@core/composables/disabled.composable.ts'
33
+ import { toVariants } from '@core/utils/to-variants.util.ts'
29
34
  import { computed, type LabelHTMLAttributes, useAttrs } from 'vue'
30
35
 
31
36
  type CheckboxAccent = 'brand' | 'warning' | 'danger'
@@ -43,6 +48,7 @@ const checkboxModel = defineModel<boolean | undefined | string[]>({ default: und
43
48
  const slots = defineSlots<{
44
49
  default?(): any
45
50
  info?(): any
51
+ message?(): any
46
52
  }>()
47
53
 
48
54
  const isDisabled = useDisabled(() => disabled)
@@ -63,234 +69,240 @@ const attrs = useAttrs()
63
69
 
64
70
  <style lang="postcss" scoped>
65
71
  .ui-checkbox {
66
- display: inline-flex;
67
- align-items: center;
68
- gap: 0.8rem;
72
+ display: flex;
73
+ flex-direction: column;
74
+ gap: 0.4rem;
69
75
 
70
- .fake-checkbox {
76
+ .checkbox-label {
71
77
  display: inline-flex;
72
78
  align-items: center;
73
- justify-content: center;
74
- height: 1.6rem;
75
- width: 1.6rem;
76
- transition:
77
- background-color 0.125s ease-in-out,
78
- border-color 0.125s ease-in-out;
79
- border: 0.2rem solid transparent;
80
- border-radius: 0.2rem;
81
- flex-shrink: 0;
82
-
83
- .icon {
84
- font-size: 0.75rem;
85
- color: var(--color-info-txt-item);
86
- transition: opacity 0.125s ease-in-out;
79
+ gap: 0.4rem;
80
+
81
+ .fake-checkbox {
82
+ display: inline-flex;
83
+ align-items: center;
84
+ justify-content: center;
85
+ height: 1.6rem;
86
+ width: 1.6rem;
87
+ transition:
88
+ background-color 0.125s ease-in-out,
89
+ border-color 0.125s ease-in-out;
90
+ border: 0.2rem solid transparent;
91
+ border-radius: 0.2rem;
92
+ flex-shrink: 0;
93
+
94
+ .icon {
95
+ font-size: 0.75rem;
96
+ color: var(--color-neutral-background-primary);
97
+ transition: opacity 0.125s ease-in-out;
98
+ }
87
99
  }
88
- }
89
100
 
90
- .input {
91
- font-size: inherit;
92
- position: absolute;
93
- pointer-events: none;
94
- opacity: 0;
101
+ .input {
102
+ font-size: inherit;
103
+ position: absolute;
104
+ pointer-events: none;
105
+ opacity: 0;
95
106
 
96
- &.indeterminate + .fake-checkbox > .icon {
97
- opacity: 1;
98
- color: var(--color-info-txt-item);
99
- }
107
+ &.indeterminate + .fake-checkbox > .icon {
108
+ opacity: 1;
109
+ color: var(--color-neutral-background-primary);
110
+ }
100
111
 
101
- & + .fake-checkbox > .icon {
102
- opacity: 0;
103
- }
112
+ & + .fake-checkbox > .icon {
113
+ opacity: 0;
114
+ }
104
115
 
105
- &:checked + .fake-checkbox > .icon {
106
- opacity: 1;
107
- }
116
+ &:checked + .fake-checkbox > .icon {
117
+ opacity: 1;
118
+ }
108
119
 
109
- &:focus-visible + .fake-checkbox {
110
- outline: none;
120
+ &:focus-visible + .fake-checkbox {
121
+ outline: none;
111
122
 
112
- &::before {
113
- content: '';
114
- position: absolute;
115
- inset: -0.5rem;
116
- border-radius: 0.4rem;
117
- border-width: 0.2rem;
118
- border-style: solid;
123
+ &::before {
124
+ content: '';
125
+ position: absolute;
126
+ inset: -0.5rem;
127
+ border-radius: 0.4rem;
128
+ border-width: 0.2rem;
129
+ border-style: solid;
130
+ }
119
131
  }
120
132
  }
121
- }
122
133
 
123
- &.accent--brand {
124
- .input:not(:disabled) {
125
- & + .fake-checkbox {
126
- border-color: var(--color-brand-item-base);
127
- }
134
+ &.accent--brand {
135
+ .input:not(:disabled) {
136
+ & + .fake-checkbox {
137
+ border-color: var(--color-brand-txt-base);
138
+ }
128
139
 
129
- &.indeterminate + .fake-checkbox {
130
- background-color: var(--color-brand-item-base);
140
+ &.indeterminate + .fake-checkbox {
141
+ background-color: var(--color-brand-txt-base);
142
+
143
+ &:hover {
144
+ border-color: transparent;
145
+ background-color: var(--color-brand-txt-hover);
146
+ }
131
147
 
132
- &:hover {
148
+ &:active {
149
+ background-color: var(--color-brand-txt-active);
150
+ }
151
+ }
152
+
153
+ &.indeterminate:hover + .fake-checkbox {
133
154
  border-color: transparent;
134
- background-color: var(--color-brand-item-hover);
155
+ background-color: var(--color-brand-txt-hover);
135
156
  }
136
157
 
137
- &:active {
138
- background-color: var(--color-brand-item-active);
158
+ &:hover + .fake-checkbox {
159
+ border-color: var(--color-brand-txt-hover);
139
160
  }
140
- }
141
161
 
142
- &.indeterminate:hover + .fake-checkbox {
143
- border-color: transparent;
144
- background-color: var(--color-brand-item-hover);
145
- }
162
+ &:focus-visible + .fake-checkbox::before {
163
+ border: 0.2rem solid var(--color-brand-txt-base);
164
+ }
146
165
 
147
- &:hover + .fake-checkbox {
148
- border-color: var(--color-brand-item-hover);
149
- }
166
+ &:active + .fake-checkbox {
167
+ border-color: var(--color-brand-txt-active);
168
+ }
150
169
 
151
- &:focus-visible + .fake-checkbox::before {
152
- border: 0.2rem solid var(--color-brand-txt-base);
153
- }
170
+ &:checked + .fake-checkbox {
171
+ border-color: transparent;
172
+ background-color: var(--color-brand-txt-base);
173
+ }
154
174
 
155
- &:active + .fake-checkbox {
156
- border-color: var(--color-brand-item-active);
157
- }
175
+ &:checked:hover + .fake-checkbox {
176
+ background-color: var(--color-brand-txt-hover);
177
+ }
158
178
 
159
- &:checked + .fake-checkbox {
160
- border-color: transparent;
161
- background-color: var(--color-brand-item-base);
179
+ &:checked:active + .fake-checkbox {
180
+ background-color: var(--color-brand-txt-active);
181
+ }
162
182
  }
183
+ }
163
184
 
164
- &:checked:hover + .fake-checkbox {
165
- background-color: var(--color-brand-item-hover);
166
- }
185
+ &.accent--warning {
186
+ .input:not(:disabled) {
187
+ & + .fake-checkbox {
188
+ border-color: var(--color-warning-txt-base);
189
+ }
167
190
 
168
- &:checked:active + .fake-checkbox {
169
- background-color: var(--color-brand-item-active);
170
- }
171
- }
172
- }
191
+ &.indeterminate + .fake-checkbox {
192
+ background-color: var(--color-warning-txt-base);
173
193
 
174
- &.accent--warning {
175
- .input:not(:disabled) {
176
- & + .fake-checkbox {
177
- border-color: var(--color-warning-item-base);
178
- }
194
+ &:hover {
195
+ border-color: transparent;
196
+ background-color: var(--color-warning-txt-hover);
197
+ }
179
198
 
180
- &.indeterminate + .fake-checkbox {
181
- background-color: var(--color-warning-item-base);
199
+ &:active {
200
+ background-color: var(--color-warning-txt-active);
201
+ }
202
+ }
182
203
 
183
- &:hover {
204
+ &.indeterminate:hover + .fake-checkbox {
184
205
  border-color: transparent;
185
- background-color: var(--color-warning-item-hover);
206
+ background-color: var(--color-warning-txt-hover);
186
207
  }
187
208
 
188
- &:active {
189
- background-color: var(--color-warning-item-active);
209
+ &:hover + .fake-checkbox {
210
+ border-color: var(--color-warning-txt-hover);
190
211
  }
191
- }
192
-
193
- &.indeterminate:hover + .fake-checkbox {
194
- border-color: transparent;
195
- background-color: var(--color-warning-item-hover);
196
- }
197
212
 
198
- &:hover + .fake-checkbox {
199
- border-color: var(--color-warning-item-hover);
200
- }
201
-
202
- &:focus-visible + .fake-checkbox::before {
203
- border: 0.2rem solid var(--color-brand-txt-base);
204
- }
213
+ &:focus-visible + .fake-checkbox::before {
214
+ border: 0.2rem solid var(--color-brand-txt-base);
215
+ }
205
216
 
206
- &:active + .fake-checkbox {
207
- border-color: var(--color-warning-item-active);
208
- }
217
+ &:active + .fake-checkbox {
218
+ border-color: var(--color-warning-txt-active);
219
+ }
209
220
 
210
- &:checked + .fake-checkbox {
211
- border-color: transparent;
212
- background-color: var(--color-warning-item-base);
213
- }
221
+ &:checked + .fake-checkbox {
222
+ border-color: transparent;
223
+ background-color: var(--color-warning-txt-base);
224
+ }
214
225
 
215
- &:checked:hover + .fake-checkbox {
216
- background-color: var(--color-warning-item-hover);
217
- }
226
+ &:checked:hover + .fake-checkbox {
227
+ background-color: var(--color-warning-txt-hover);
228
+ }
218
229
 
219
- &:checked:active + .fake-checkbox {
220
- background-color: var(--color-warning-item-active);
230
+ &:checked:active + .fake-checkbox {
231
+ background-color: var(--color-warning-txt-active);
232
+ }
221
233
  }
222
234
  }
223
- }
224
235
 
225
- &.accent--danger {
226
- .input:not(:disabled) {
227
- & + .fake-checkbox {
228
- border-color: var(--color-danger-item-base);
236
+ &.accent--danger {
237
+ .input:not(:disabled) {
238
+ & + .fake-checkbox {
239
+ border-color: var(--color-danger-txt-base);
229
240
 
230
- > .icon {
231
- color: var(--color-danger-txt-item);
241
+ > .icon {
242
+ color: var(--color-danger-txt-item);
243
+ }
232
244
  }
233
- }
234
245
 
235
- &.indeterminate + .fake-checkbox {
236
- background-color: var(--color-danger-item-base);
246
+ &.indeterminate + .fake-checkbox {
247
+ background-color: var(--color-danger-txt-base);
237
248
 
238
- &:hover {
239
- border-color: transparent;
240
- background-color: var(--color-danger-item-hover);
241
- }
249
+ &:hover {
250
+ border-color: transparent;
251
+ background-color: var(--color-danger-txt-hover);
252
+ }
242
253
 
243
- &:active {
244
- background-color: var(--color-danger-item-active);
254
+ &:active {
255
+ background-color: var(--color-danger-txt-active);
256
+ }
245
257
  }
246
- }
247
258
 
248
- &.indeterminate:hover + .fake-checkbox {
249
- border-color: transparent;
250
- background-color: var(--color-danger-item-hover);
251
- }
259
+ &.indeterminate:hover + .fake-checkbox {
260
+ border-color: transparent;
261
+ background-color: var(--color-danger-txt-hover);
262
+ }
252
263
 
253
- &:hover + .fake-checkbox {
254
- border-color: var(--color-danger-item-hover);
255
- }
264
+ &:hover + .fake-checkbox {
265
+ border-color: var(--color-danger-txt-hover);
266
+ }
256
267
 
257
- &:focus-visible + .fake-checkbox::before {
258
- border: 0.2rem solid var(--color-brand-txt-base);
259
- }
268
+ &:focus-visible + .fake-checkbox::before {
269
+ border: 0.2rem solid var(--color-brand-txt-base);
270
+ }
260
271
 
261
- &:active + .fake-checkbox {
262
- border-color: var(--color-danger-item-active);
263
- }
272
+ &:active + .fake-checkbox {
273
+ border-color: var(--color-danger-txt-active);
274
+ }
264
275
 
265
- &:checked + .fake-checkbox {
266
- border-color: transparent;
267
- background-color: var(--color-danger-item-base);
268
- }
276
+ &:checked + .fake-checkbox {
277
+ border-color: transparent;
278
+ background-color: var(--color-danger-txt-base);
279
+ }
269
280
 
270
- &:checked:hover + .fake-checkbox {
271
- background-color: var(--color-danger-item-hover);
272
- }
281
+ &:checked:hover + .fake-checkbox {
282
+ background-color: var(--color-danger-txt-hover);
283
+ }
273
284
 
274
- &:checked:active + .fake-checkbox {
275
- background-color: var(--color-danger-item-active);
285
+ &:checked:active + .fake-checkbox {
286
+ background-color: var(--color-danger-txt-active);
287
+ }
276
288
  }
277
289
  }
278
- }
279
290
 
280
- .input:disabled {
281
- & + .fake-checkbox {
282
- cursor: not-allowed;
283
- border-color: var(--color-neutral-txt-secondary);
291
+ .input:disabled {
292
+ & + .fake-checkbox {
293
+ cursor: not-allowed;
294
+ border-color: var(--color-neutral-txt-secondary);
284
295
 
285
- > .icon {
286
- color: var(--color-neutral-background-disabled);
296
+ > .icon {
297
+ color: var(--color-neutral-background-disabled);
298
+ }
287
299
  }
288
- }
289
300
 
290
- &:checked + .fake-checkbox,
291
- &.indeterminate + .fake-checkbox {
292
- border-color: transparent;
293
- background-color: var(--color-neutral-txt-secondary);
301
+ &:checked + .fake-checkbox,
302
+ &.indeterminate + .fake-checkbox {
303
+ border-color: transparent;
304
+ background-color: var(--color-neutral-txt-secondary);
305
+ }
294
306
  }
295
307
  }
296
308
  }
@@ -12,7 +12,7 @@
12
12
 
13
13
  <script lang="ts" setup>
14
14
  import VtsIcon from '@core/components/icon/VtsIcon.vue'
15
- import { toVariants } from '@core/utils/to-variants.util'
15
+ import { toVariants } from '@core/utils/to-variants.util.ts'
16
16
  import { computed } from 'vue'
17
17
 
18
18
  export type ChipAccent = 'info' | 'success' | 'warning' | 'danger'
@@ -6,7 +6,7 @@
6
6
  </template>
7
7
 
8
8
  <script lang="ts" setup>
9
- import { toVariants } from '@core/utils/to-variants.util'
9
+ import { toVariants } from '@core/utils/to-variants.util.ts'
10
10
  import { computed } from 'vue'
11
11
 
12
12
  type CounterAccent = 'brand' | 'neutral' | 'info' | 'success' | 'warning' | 'danger' | 'muted'
@@ -1,46 +1,50 @@
1
1
  <template>
2
- <Transition name="drawer" @after-leave="emit('afterLeave')">
3
- <div v-if="isOpen" class="ui-drawer" aria-modal="true" role="dialog" @click.self="isDismissible && emit('dismiss')">
4
- <aside class="drawer">
5
- <div class="header">
6
- <div v-if="slots.title || title !== undefined" class="typo-h4">
7
- <slot name="title">
8
- {{ title }}
9
- </slot>
10
- </div>
11
- <UiButtonIcon
12
- v-if="isDismissible"
13
- :target-scale="2"
14
- icon="action:close-cancel-clear"
15
- accent="brand"
16
- size="small"
17
- @click="emit('dismiss')"
18
- />
2
+ <form class="ui-drawer" @click.self="emit('dismiss')" @submit.prevent="emit('confirm')">
3
+ <aside
4
+ :aria-labelledby="slots.title || title !== undefined ? titleId : undefined"
5
+ aria-modal="true"
6
+ class="drawer"
7
+ role="dialog"
8
+ >
9
+ <div class="header">
10
+ <div v-if="slots.title || title !== undefined" :id="titleId" class="typo-h4">
11
+ <slot name="title">
12
+ {{ title }}
13
+ </slot>
19
14
  </div>
20
- <div class="content">
21
- <slot name="content" />
22
- </div>
23
- <VtsButtonGroup v-if="slots.buttons" no-stack class="buttons">
24
- <slot name="buttons" />
25
- </VtsButtonGroup>
26
- </aside>
27
- </div>
28
- </Transition>
15
+ <UiButtonIcon
16
+ v-if="onDismiss"
17
+ :target-scale="2"
18
+ icon="action:close-cancel-clear"
19
+ accent="brand"
20
+ size="small"
21
+ @click="emit('dismiss')"
22
+ />
23
+ </div>
24
+ <div class="content">
25
+ <slot name="content" />
26
+ </div>
27
+ <VtsButtonGroup v-if="slots.buttons" no-stack class="buttons">
28
+ <slot name="buttons" />
29
+ </VtsButtonGroup>
30
+ </aside>
31
+ </form>
29
32
  </template>
30
33
 
31
34
  <script lang="ts" setup>
32
35
  import VtsButtonGroup from '@core/components/button-group/VtsButtonGroup.vue'
33
36
  import UiButtonIcon from '@core/components/ui/button-icon/UiButtonIcon.vue'
37
+ import { useOverlayEscape } from '@core/packages/overlay/use-overlay-escape.ts'
38
+ import { useId } from 'vue'
34
39
 
35
40
  defineProps<{
36
- isOpen: boolean
37
- isDismissible?: boolean
38
41
  title?: string
42
+ onDismiss?: () => any
39
43
  }>()
40
44
 
41
45
  const emit = defineEmits<{
46
+ confirm: []
42
47
  dismiss: []
43
- afterLeave: []
44
48
  }>()
45
49
 
46
50
  const slots = defineSlots<{
@@ -48,34 +52,13 @@ const slots = defineSlots<{
48
52
  title?(): any
49
53
  buttons?(): any
50
54
  }>()
51
- </script>
52
55
 
53
- <style lang="postcss" scoped>
54
- /* Slide-in from right */
55
- .drawer-enter-active.ui-drawer,
56
- .drawer-leave-active.ui-drawer {
57
- transition: opacity 0.3s ease;
58
- }
56
+ useOverlayEscape(() => emit('dismiss'))
59
57
 
60
- .drawer-enter-active .drawer,
61
- .drawer-leave-active .drawer {
62
- transition: transform 0.3s ease;
63
- }
64
-
65
- .drawer-enter-from.ui-drawer,
66
- .drawer-leave-to.ui-drawer {
67
- opacity: 0;
68
- }
69
-
70
- .drawer-enter-from .drawer,
71
- .drawer-leave-to .drawer {
72
- transform: translateX(100%);
73
-
74
- &:dir(rtl) {
75
- transform: translateX(-100%);
76
- }
77
- }
58
+ const titleId = useId()
59
+ </script>
78
60
 
61
+ <style lang="postcss" scoped>
79
62
  .ui-drawer {
80
63
  position: fixed;
81
64
  display: flex;
@@ -21,9 +21,9 @@
21
21
  <script lang="ts" setup>
22
22
  import VtsIcon from '@core/components/icon/VtsIcon.vue'
23
23
  import UiCheckbox from '@core/components/ui/checkbox/UiCheckbox.vue'
24
- import { vTooltip } from '@core/directives/tooltip.directive'
24
+ import { vTooltip } from '@core/directives/tooltip.directive.ts'
25
25
  import type { IconName } from '@core/icons'
26
- import { toVariants } from '@core/utils/to-variants.util'
26
+ import { toVariants } from '@core/utils/to-variants.util.ts'
27
27
  import { computed } from 'vue'
28
28
 
29
29
  export type DropdownAccent = 'normal' | 'brand' | 'success' | 'warning' | 'danger'
@@ -11,7 +11,7 @@
11
11
 
12
12
  <script lang="ts" setup>
13
13
  import VtsIcon from '@core/components/icon/VtsIcon.vue'
14
- import { useDisabled } from '@core/composables/disabled.composable'
14
+ import { useDisabled } from '@core/composables/disabled.composable.ts'
15
15
  import type { IconName } from '@core/icons'
16
16
 
17
17
  const { disabled, selected, icon } = defineProps<{
@@ -20,7 +20,7 @@
20
20
 
21
21
  <script lang="ts" setup>
22
22
  import VtsIcon from '@core/components/icon/VtsIcon.vue'
23
- import { vTooltip } from '@core/directives/tooltip.directive'
23
+ import { vTooltip } from '@core/directives/tooltip.directive.ts'
24
24
  import type { IconName } from '@core/icons'
25
25
 
26
26
  defineProps<{
@@ -10,7 +10,7 @@
10
10
 
11
11
  <script lang="ts" setup>
12
12
  import VtsIcon from '@core/components/icon/VtsIcon.vue'
13
- import { vTooltip } from '@core/directives/tooltip.directive'
13
+ import { vTooltip } from '@core/directives/tooltip.directive.ts'
14
14
  import type { IconName } from '@core/icons'
15
15
  import { useMapper } from '@core/packages/mapper'
16
16