@xen-orchestra/web-core 0.4.0 → 0.5.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 (124) hide show
  1. package/lib/assets/css/_colors.pcss +56 -24
  2. package/lib/assets/css/_context.pcss +9 -9
  3. package/lib/assets/css/base.pcss +6 -6
  4. package/lib/components/backup-item/VtsBackupItem.vue +47 -0
  5. package/lib/components/backup-state/{BackupState.vue → VtsBackupState.vue} +4 -4
  6. package/lib/components/{button/ButtonGroup.vue → button-group/VtsButtonGroup.vue} +7 -6
  7. package/lib/components/cell-object/{CellObject.vue → VtsCellObject.vue} +14 -14
  8. package/lib/components/cell-text/{CellText.vue → VtsCellText.vue} +11 -11
  9. package/lib/components/console/{RemoteConsole.vue → VtsRemoteConsole.vue} +12 -18
  10. package/lib/components/donut-chart-with-legend/{DonutChartWithLegend.vue → VtsDonutChartWithLegend.vue} +6 -6
  11. package/lib/components/dropdown/DropdownItem.vue +8 -14
  12. package/lib/components/dropdown/DropdownTitle.vue +3 -3
  13. package/lib/components/icon/VtsIcon.vue +38 -42
  14. package/lib/components/layout/{LayoutSidebar.vue → VtsLayoutSidebar.vue} +31 -30
  15. package/lib/components/legend-group/VtsLegendGroup.vue +44 -0
  16. package/lib/components/{legend/LegendList.vue → legend-list/VtsLegendList.vue} +2 -2
  17. package/lib/components/menu/MenuTrigger.vue +2 -2
  18. package/lib/components/stacked-bar-with-legend/{StackedBarWithLegend.vue → VtsStackedBarWithLegend.vue} +14 -14
  19. package/lib/components/state-hero/VtsComingSoonHero.vue +13 -0
  20. package/lib/components/state-hero/VtsLoadingHero.vue +15 -0
  21. package/lib/components/state-hero/VtsNoDataHero.vue +11 -0
  22. package/lib/components/state-hero/VtsObjectNotFoundHero.vue +13 -0
  23. package/lib/components/state-hero/{StateHero.vue → VtsStateHero.vue} +42 -35
  24. package/lib/components/tab/TabItem.vue +6 -6
  25. package/lib/components/table/ColumnTitle.vue +7 -7
  26. package/lib/components/table/{UiTable.vue → VtsTable.vue} +7 -3
  27. package/lib/components/task/{QuickTaskButton.vue → VtsQuickTaskButton.vue} +8 -7
  28. package/lib/components/task/{QuickTaskList.vue → VtsQuickTaskList.vue} +10 -11
  29. package/lib/components/task/{QuickTaskTabBar.vue → VtsQuickTaskTabBar.vue} +9 -13
  30. package/lib/components/{tooltip/TooltipList.vue → tooltip-list/VtsTooltipList.vue} +2 -3
  31. package/lib/components/tree/{TreeItem.vue → VtsTreeItem.vue} +3 -4
  32. package/lib/components/tree/VtsTreeItemError.vue +18 -0
  33. package/lib/components/tree/{TreeLine.vue → VtsTreeLine.vue} +9 -11
  34. package/lib/components/tree/{TreeList.vue → VtsTreeList.vue} +5 -2
  35. package/lib/components/tree/VtsTreeLoadingItem.vue +61 -0
  36. package/lib/components/ui/account-menu-button/UiAccountMenuButton.vue +64 -0
  37. package/lib/components/ui/actions-title/UiActionsTitle.vue +2 -2
  38. package/lib/components/ui/button/UiButton.vue +532 -0
  39. package/lib/components/ui/button-icon/UiButtonIcon.vue +248 -0
  40. package/lib/components/{UiCard.vue → ui/card/UiCard.vue} +8 -6
  41. package/lib/components/ui/card-numbers/UiCardNumbers.vue +103 -0
  42. package/lib/components/ui/card-subtitle/UiCardSubtitle.vue +24 -0
  43. package/lib/components/ui/card-title/UiCardTitle.vue +56 -0
  44. package/lib/components/ui/checkbox/UiCheckbox.vue +410 -0
  45. package/lib/components/ui/checkbox-group/UiCheckboxGroup.vue +57 -0
  46. package/lib/components/ui/chip/ChipIcon.vue +21 -0
  47. package/lib/components/ui/chip/ChipRemoveIcon.vue +13 -0
  48. package/lib/components/ui/chip/UiChip.vue +135 -0
  49. package/lib/components/{icon/ComplexIcon.vue → ui/complex-icon/UiComplexIcon.vue} +21 -27
  50. package/lib/components/ui/counter/UiCounter.vue +134 -0
  51. package/lib/components/{donut-chart/DonutChart.vue → ui/donut-chart/UiDonutChart.vue} +28 -30
  52. package/lib/components/{head-bar/HeadBar.vue → ui/head-bar/UiHeadBar.vue} +31 -31
  53. package/lib/components/{info/VtsInfo.vue → ui/info/UiInfo.vue} +13 -11
  54. package/lib/components/{input → ui/input}/UiInput.vue +9 -7
  55. package/lib/components/ui/input/UiTextarea.vue +120 -0
  56. package/lib/components/{input/VtsLabel.vue → ui/label/UiLabel.vue} +25 -25
  57. package/lib/components/ui/legend/UiLegend.vue +98 -0
  58. package/lib/components/{LegendTitle.vue → ui/legend-title/UiLegendTitle.vue} +4 -4
  59. package/lib/components/{UiSpinner.vue → ui/loader/UiLoader.vue} +3 -3
  60. package/lib/components/{icon/ObjectIcon.vue → ui/object-icon/UiObjectIcon.vue} +44 -36
  61. package/lib/components/ui/object-link/UiObjectLink.vue +83 -0
  62. package/lib/components/ui/panel/UiPanel.vue +57 -0
  63. package/lib/components/{query-search-bar/QuerySearchBar.vue → ui/query-search-bar/UiQuerySearchBar.vue} +16 -16
  64. package/lib/components/{task/QuickTaskItem.vue → ui/quick-task-item/UiQuickTaskItem.vue} +46 -34
  65. package/lib/components/{task/QuickTaskPanel.vue → ui/quick-task-panel/UiQuickTaskPanel.vue} +8 -7
  66. package/lib/components/ui/radio-button/UiRadioButton.vue +196 -0
  67. package/lib/components/ui/radio-button-group/UiRadioButtonGroup.vue +56 -0
  68. package/lib/components/{stacked-bar → ui/stacked-bar}/StackedBarSegment.vue +23 -26
  69. package/lib/components/{stacked-bar/StackedBar.vue → ui/stacked-bar/UiStackedBar.vue} +6 -6
  70. package/lib/components/ui/table-actions/UiTableActions.vue +46 -0
  71. package/lib/components/ui/tag/UiTag.vue +118 -0
  72. package/lib/components/ui/title/UiTitle.vue +2 -2
  73. package/lib/components/ui/toaster/UiToaster.vue +100 -0
  74. package/lib/components/ui/toggle/UiToggle.vue +117 -0
  75. package/lib/components/{tooltip/TooltipItem.vue → ui/tooltip/UiTooltip.vue} +15 -15
  76. package/lib/components/ui/top-bottom-table/UiTopBottomTable.vue +64 -0
  77. package/lib/components/{tree/TreeItemLabel.vue → ui/tree-item-label/UiTreeItemLabel.vue} +60 -59
  78. package/lib/components/ui/user-link/UiUserLink.vue +76 -0
  79. package/lib/components/ui/user-logo/UiUserLogo.vue +50 -0
  80. package/lib/composables/route-query.composable.md +136 -0
  81. package/lib/composables/table.composable.md +159 -0
  82. package/lib/composables/tree/define-tree.ts +1 -1
  83. package/lib/composables/tree/tree-node-base.ts +6 -6
  84. package/lib/composables/tree.composable.md +536 -0
  85. package/lib/layouts/CoreLayout.vue +8 -6
  86. package/lib/locales/de.json +2 -2
  87. package/lib/locales/en.json +6 -3
  88. package/lib/locales/fa.json +2 -2
  89. package/lib/locales/fr.json +6 -3
  90. package/lib/types/color.type.ts +0 -2
  91. package/lib/types/subscribable-store.type.ts +2 -2
  92. package/lib/utils/create-subscribable-store-context.util.ts +1 -1
  93. package/lib/utils/if-else.utils.md +23 -0
  94. package/lib/utils/if-else.utils.ts +2 -2
  95. package/lib/utils/to-variants.util.md +62 -0
  96. package/package.json +7 -7
  97. package/lib/components/CardNumbers.vue +0 -101
  98. package/lib/components/PowerStateIcon.vue +0 -46
  99. package/lib/components/UiTag.vue +0 -101
  100. package/lib/components/backup-item/BackupItem.vue +0 -40
  101. package/lib/components/button/ButtonIcon.vue +0 -220
  102. package/lib/components/button/UiButton.vue +0 -470
  103. package/lib/components/card/CardSubtitle.vue +0 -24
  104. package/lib/components/card/CardTitle.vue +0 -57
  105. package/lib/components/chip/ChipIcon.vue +0 -30
  106. package/lib/components/chip/ChipRemoveIcon.vue +0 -13
  107. package/lib/components/chip/UiChip.vue +0 -137
  108. package/lib/components/counter/VtsCounter.vue +0 -147
  109. package/lib/components/legend/LegendGroup.vue +0 -44
  110. package/lib/components/legend/LegendItem.vue +0 -86
  111. package/lib/components/object-link/ObjectLink.vue +0 -87
  112. package/lib/components/state-hero/ComingSoonHero.vue +0 -13
  113. package/lib/components/state-hero/LoadingHero.vue +0 -15
  114. package/lib/components/state-hero/NoDataHero.vue +0 -11
  115. package/lib/components/state-hero/ObjectNotFoundHero.vue +0 -13
  116. package/lib/components/tree/TreeItemError.vue +0 -13
  117. package/lib/components/tree/TreeLoadingItem.vue +0 -60
  118. package/lib/components/user/UserLink.vue +0 -72
  119. package/lib/components/user/UserLogo.vue +0 -57
  120. package/lib/types/backup.type.ts +0 -11
  121. package/lib/types/size.type.ts +0 -1
  122. package/lib/types/task.type.ts +0 -13
  123. /package/lib/components/backdrop/{Backdrop.vue → VtsBackdrop.vue} +0 -0
  124. /package/lib/components/divider/{Divider.vue → VtsDivider.vue} +0 -0
@@ -1,6 +1,5 @@
1
- <!-- v1.1 -->
2
1
  <template>
3
- <li class="tree-item">
2
+ <li class="vts-tree-item">
4
3
  <slot />
5
4
  <slot v-if="expanded" name="sublist" />
6
5
  </li>
@@ -15,8 +14,8 @@ const props = defineProps<{
15
14
  }>()
16
15
 
17
16
  defineSlots<{
18
- default: () => void
19
- sublist: () => void
17
+ default(): any
18
+ sublist?(): any
20
19
  }>()
21
20
 
22
21
  const hasChildren = ref(false)
@@ -0,0 +1,18 @@
1
+ <template>
2
+ <li class="vts-tree-item-error typo h6-semi-bold">
3
+ <slot />
4
+ </li>
5
+ </template>
6
+
7
+ <script lang="ts" setup>
8
+ defineSlots<{
9
+ default(): any
10
+ }>()
11
+ </script>
12
+
13
+ <style lang="postcss" scoped>
14
+ .vts-tree-item-error {
15
+ padding-left: 3rem;
16
+ color: var(--color-danger-txt-base);
17
+ }
18
+ </style>
@@ -1,6 +1,5 @@
1
- <!-- v1.1 -->
2
1
  <template>
3
- <div class="tree-line">
2
+ <div class="vts-tree-line">
4
3
  <div :class="{ 'tree-line-half-height': halfHeight }" class="tree-line-vertical" />
5
4
  <div :class="{ right }" class="tree-line-horizontal" />
6
5
  </div>
@@ -14,8 +13,7 @@ defineProps<{
14
13
  </script>
15
14
 
16
15
  <style lang="postcss" scoped>
17
- .tree-line {
18
- --offset: 0.7rem;
16
+ .vts-tree-line {
19
17
  flex: 0 1 1em;
20
18
  align-self: stretch;
21
19
  display: flex;
@@ -24,9 +22,9 @@ defineProps<{
24
22
 
25
23
  .tree-line-vertical {
26
24
  width: 0.1rem;
27
- background: var(--color-normal-txt-base);
28
- height: calc(100% + var(--offset));
29
- transform: translateY(calc(var(--offset) * -1));
25
+ background: var(--color-info-txt-base);
26
+ height: calc(100% + 0.7rem);
27
+ transform: translateY(calc(0.7rem * -1));
30
28
  }
31
29
 
32
30
  .tree-line-horizontal {
@@ -35,16 +33,16 @@ defineProps<{
35
33
  background: transparent;
36
34
 
37
35
  &.right {
38
- background: var(--color-normal-txt-base);
36
+ background: var(--color-info-txt-base);
39
37
  }
40
38
  }
41
39
  }
42
40
 
43
- .tree-item:last-child {
44
- > .tree-item-label {
41
+ .vts-tree-item:last-child {
42
+ > .ui-tree-item-label {
45
43
  .tree-line-half-height {
46
44
  align-self: start;
47
- height: calc(50% + var(--offset));
45
+ height: calc(50% + 0.7rem);
48
46
  }
49
47
  }
50
48
  }
@@ -1,6 +1,5 @@
1
- <!-- v1.1 -->
2
1
  <template>
3
- <ul class="tree-list">
2
+ <ul class="vts-tree-list">
4
3
  <slot />
5
4
  </ul>
6
5
  </template>
@@ -9,6 +8,10 @@
9
8
  import { IK_TREE_LIST_DEPTH } from '@core/utils/injection-keys.util'
10
9
  import { inject, provide } from 'vue'
11
10
 
11
+ defineSlots<{
12
+ default(): any
13
+ }>()
14
+
12
15
  const depth = inject(IK_TREE_LIST_DEPTH, 0)
13
16
  provide(IK_TREE_LIST_DEPTH, depth + 1)
14
17
  </script>
@@ -0,0 +1,61 @@
1
+ <template>
2
+ <li class="vts-tree-loading-item">
3
+ <div class="label-placeholder">
4
+ <div class="link-placeholder">
5
+ <template v-if="depth > 1">
6
+ <VtsTreeLine v-for="i in depth - 1" :key="i" :right="i === depth - 1" full-height />
7
+ </template>
8
+ <VtsIcon :icon accent="current" />
9
+ <div class="loader">&nbsp;</div>
10
+ </div>
11
+ </div>
12
+ </li>
13
+ </template>
14
+
15
+ <script lang="ts" setup>
16
+ import VtsIcon from '@core/components/icon/VtsIcon.vue'
17
+ import VtsTreeLine from '@core/components/tree/VtsTreeLine.vue'
18
+ import { IK_TREE_LIST_DEPTH } from '@core/utils/injection-keys.util'
19
+ import type { IconDefinition } from '@fortawesome/fontawesome-common-types'
20
+ import { inject } from 'vue'
21
+
22
+ defineProps<{
23
+ icon: IconDefinition
24
+ }>()
25
+
26
+ const depth = inject(IK_TREE_LIST_DEPTH, 0)
27
+ </script>
28
+
29
+ <style lang="postcss" scoped>
30
+ .vts-tree-loading-item {
31
+ .label-placeholder {
32
+ display: flex;
33
+ height: 4rem;
34
+ background-color: var(--color-neutral-background-primary);
35
+
36
+ .link-placeholder {
37
+ display: flex;
38
+ align-items: center;
39
+ flex: 1;
40
+ padding: 0 0.8rem;
41
+ gap: 0.4rem;
42
+ }
43
+
44
+ .loader {
45
+ flex: 1;
46
+ animation: pulse alternate 1s infinite;
47
+ background-color: var(--color-info-background-selected);
48
+ }
49
+ }
50
+
51
+ @keyframes pulse {
52
+ 0% {
53
+ opacity: 0.5;
54
+ }
55
+
56
+ 100% {
57
+ opacity: 1;
58
+ }
59
+ }
60
+ }
61
+ </style>
@@ -0,0 +1,64 @@
1
+ <!-- v2 -->
2
+ <template>
3
+ <button :class="{ disabled: isDisabled, selected }" class="ui-account-menu-button" type="button">
4
+ <UiUserLogo class="logo" :size />
5
+ </button>
6
+ </template>
7
+
8
+ <script lang="ts" setup>
9
+ import UiUserLogo from '@core/components/ui/user-logo/UiUserLogo.vue'
10
+ import { useContext } from '@core/composables/context.composable'
11
+ import { DisabledContext } from '@core/context'
12
+
13
+ defineProps<{
14
+ size: 'small' | 'medium'
15
+ selected?: boolean
16
+ }>()
17
+
18
+ const isDisabled = useContext(DisabledContext)
19
+ </script>
20
+
21
+ <style lang="postcss" scoped>
22
+ .ui-account-menu-button {
23
+ padding: 0.4rem;
24
+ border-radius: 0.4rem;
25
+ border-color: transparent;
26
+ background-color: transparent;
27
+
28
+ &:not(.disabled) {
29
+ cursor: pointer;
30
+ }
31
+
32
+ &:hover {
33
+ background-color: var(--color-info-background-hover);
34
+ }
35
+
36
+ &:active {
37
+ background-color: var(--color-info-background-active);
38
+ }
39
+
40
+ &.selected {
41
+ background-color: var(--color-info-background-selected);
42
+ }
43
+
44
+ &:focus-visible {
45
+ outline: none;
46
+
47
+ &::before {
48
+ content: '';
49
+ position: absolute;
50
+ inset: -0.4rem;
51
+ border: 0.2rem solid var(--color-info-txt-base);
52
+ border-radius: 0.4rem;
53
+ }
54
+ }
55
+
56
+ &.disabled {
57
+ background-color: transparent;
58
+
59
+ .logo {
60
+ border-color: var(--color-neutral-txt-secondary);
61
+ }
62
+ }
63
+ }
64
+ </style>
@@ -1,6 +1,6 @@
1
1
  <!-- v2 -->
2
2
  <template>
3
- <span class="actions-title typo p2-regular">
3
+ <span class="ui-actions-title typo p2-regular">
4
4
  <slot />
5
5
  </span>
6
6
  </template>
@@ -12,7 +12,7 @@ defineSlots<{
12
12
  </script>
13
13
 
14
14
  <style scoped lang="postcss">
15
- .actions-title {
15
+ .ui-actions-title {
16
16
  color: var(--color-neutral-txt-secondary);
17
17
  }
18
18
  </style>