@xen-orchestra/web-core 0.4.0 → 0.6.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 (132) 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/assets/error.svg +375 -0
  5. package/lib/assets/no-selection.svg +70 -0
  6. package/lib/components/backup-item/VtsBackupItem.vue +47 -0
  7. package/lib/components/backup-state/{BackupState.vue → VtsBackupState.vue} +4 -4
  8. package/lib/components/{button/ButtonGroup.vue → button-group/VtsButtonGroup.vue} +7 -6
  9. package/lib/components/cell-object/{CellObject.vue → VtsCellObject.vue} +14 -14
  10. package/lib/components/cell-text/{CellText.vue → VtsCellText.vue} +11 -11
  11. package/lib/components/console/VtsActionsConsole.vue +67 -0
  12. package/lib/components/console/VtsClipboardConsole.vue +38 -0
  13. package/lib/components/console/VtsLayoutConsole.vue +40 -0
  14. package/lib/components/console/{RemoteConsole.vue → VtsRemoteConsole.vue} +14 -17
  15. package/lib/components/donut-chart-with-legend/{DonutChartWithLegend.vue → VtsDonutChartWithLegend.vue} +6 -6
  16. package/lib/components/dropdown/DropdownItem.vue +8 -14
  17. package/lib/components/dropdown/DropdownTitle.vue +3 -3
  18. package/lib/components/icon/VtsIcon.vue +38 -42
  19. package/lib/components/layout/{LayoutSidebar.vue → VtsLayoutSidebar.vue} +31 -30
  20. package/lib/components/legend-group/VtsLegendGroup.vue +44 -0
  21. package/lib/components/{legend/LegendList.vue → legend-list/VtsLegendList.vue} +2 -2
  22. package/lib/components/menu/MenuTrigger.vue +2 -2
  23. package/lib/components/stacked-bar-with-legend/{StackedBarWithLegend.vue → VtsStackedBarWithLegend.vue} +14 -14
  24. package/lib/components/state-hero/VtsComingSoonHero.vue +13 -0
  25. package/lib/components/state-hero/VtsLoadingHero.vue +15 -0
  26. package/lib/components/state-hero/VtsNoDataHero.vue +11 -0
  27. package/lib/components/state-hero/VtsObjectNotFoundHero.vue +13 -0
  28. package/lib/components/state-hero/VtsStateHero.vue +117 -0
  29. package/lib/components/tab/TabItem.vue +6 -6
  30. package/lib/components/table/ColumnTitle.vue +7 -7
  31. package/lib/components/table/{UiTable.vue → VtsTable.vue} +7 -3
  32. package/lib/components/task/{QuickTaskButton.vue → VtsQuickTaskButton.vue} +8 -7
  33. package/lib/components/task/{QuickTaskList.vue → VtsQuickTaskList.vue} +10 -11
  34. package/lib/components/task/{QuickTaskTabBar.vue → VtsQuickTaskTabBar.vue} +9 -13
  35. package/lib/components/{tooltip/TooltipList.vue → tooltip-list/VtsTooltipList.vue} +2 -3
  36. package/lib/components/tree/{TreeItem.vue → VtsTreeItem.vue} +3 -4
  37. package/lib/components/tree/VtsTreeItemError.vue +18 -0
  38. package/lib/components/tree/{TreeLine.vue → VtsTreeLine.vue} +9 -11
  39. package/lib/components/tree/{TreeList.vue → VtsTreeList.vue} +5 -2
  40. package/lib/components/tree/VtsTreeLoadingItem.vue +61 -0
  41. package/lib/components/ui/account-menu-button/UiAccountMenuButton.vue +64 -0
  42. package/lib/components/ui/actions-title/UiActionsTitle.vue +2 -2
  43. package/lib/components/ui/button/UiButton.vue +532 -0
  44. package/lib/components/ui/button-icon/UiButtonIcon.vue +248 -0
  45. package/lib/components/{UiCard.vue → ui/card/UiCard.vue} +8 -6
  46. package/lib/components/ui/card-numbers/UiCardNumbers.vue +103 -0
  47. package/lib/components/ui/card-subtitle/UiCardSubtitle.vue +24 -0
  48. package/lib/components/ui/card-title/UiCardTitle.vue +56 -0
  49. package/lib/components/ui/checkbox/UiCheckbox.vue +410 -0
  50. package/lib/components/ui/checkbox-group/UiCheckboxGroup.vue +57 -0
  51. package/lib/components/ui/chip/ChipIcon.vue +21 -0
  52. package/lib/components/ui/chip/ChipRemoveIcon.vue +13 -0
  53. package/lib/components/ui/chip/UiChip.vue +135 -0
  54. package/lib/components/{icon/ComplexIcon.vue → ui/complex-icon/UiComplexIcon.vue} +21 -27
  55. package/lib/components/ui/counter/UiCounter.vue +134 -0
  56. package/lib/components/{donut-chart/DonutChart.vue → ui/donut-chart/UiDonutChart.vue} +28 -30
  57. package/lib/components/{head-bar/HeadBar.vue → ui/head-bar/UiHeadBar.vue} +31 -31
  58. package/lib/components/{info/VtsInfo.vue → ui/info/UiInfo.vue} +13 -11
  59. package/lib/components/{input → ui/input}/UiInput.vue +9 -7
  60. package/lib/components/ui/input/UiTextarea.vue +120 -0
  61. package/lib/components/{input/VtsLabel.vue → ui/label/UiLabel.vue} +25 -25
  62. package/lib/components/ui/legend/UiLegend.vue +98 -0
  63. package/lib/components/{LegendTitle.vue → ui/legend-title/UiLegendTitle.vue} +4 -4
  64. package/lib/components/{UiSpinner.vue → ui/loader/UiLoader.vue} +3 -3
  65. package/lib/components/{icon/ObjectIcon.vue → ui/object-icon/UiObjectIcon.vue} +44 -36
  66. package/lib/components/ui/object-link/UiObjectLink.vue +83 -0
  67. package/lib/components/ui/panel/UiPanel.vue +57 -0
  68. package/lib/components/{query-search-bar/QuerySearchBar.vue → ui/query-search-bar/UiQuerySearchBar.vue} +16 -16
  69. package/lib/components/{task/QuickTaskItem.vue → ui/quick-task-item/UiQuickTaskItem.vue} +46 -34
  70. package/lib/components/{task/QuickTaskPanel.vue → ui/quick-task-panel/UiQuickTaskPanel.vue} +8 -7
  71. package/lib/components/ui/radio-button/UiRadioButton.vue +196 -0
  72. package/lib/components/ui/radio-button-group/UiRadioButtonGroup.vue +56 -0
  73. package/lib/components/{stacked-bar → ui/stacked-bar}/StackedBarSegment.vue +23 -26
  74. package/lib/components/{stacked-bar/StackedBar.vue → ui/stacked-bar/UiStackedBar.vue} +6 -6
  75. package/lib/components/ui/table-actions/UiTableActions.vue +46 -0
  76. package/lib/components/ui/tag/UiTag.vue +118 -0
  77. package/lib/components/ui/title/UiTitle.vue +2 -2
  78. package/lib/components/ui/toaster/UiToaster.vue +100 -0
  79. package/lib/components/ui/toggle/UiToggle.vue +117 -0
  80. package/lib/components/{tooltip/TooltipItem.vue → ui/tooltip/UiTooltip.vue} +15 -15
  81. package/lib/components/ui/top-bottom-table/UiTopBottomTable.vue +64 -0
  82. package/lib/components/{tree/TreeItemLabel.vue → ui/tree-item-label/UiTreeItemLabel.vue} +60 -59
  83. package/lib/components/ui/user-link/UiUserLink.vue +76 -0
  84. package/lib/components/ui/user-logo/UiUserLogo.vue +50 -0
  85. package/lib/composables/route-query.composable.md +136 -0
  86. package/lib/composables/table.composable.md +159 -0
  87. package/lib/composables/tree/define-tree.ts +1 -1
  88. package/lib/composables/tree/tree-node-base.ts +6 -6
  89. package/lib/composables/tree.composable.md +536 -0
  90. package/lib/i18n.ts +4 -0
  91. package/lib/layouts/CoreLayout.vue +8 -6
  92. package/lib/locales/cs.json +76 -0
  93. package/lib/locales/de.json +5 -2
  94. package/lib/locales/en.json +14 -3
  95. package/lib/locales/fa.json +5 -2
  96. package/lib/locales/fr.json +14 -3
  97. package/lib/types/color.type.ts +0 -2
  98. package/lib/types/subscribable-store.type.ts +2 -2
  99. package/lib/utils/create-subscribable-store-context.util.ts +1 -1
  100. package/lib/utils/if-else.utils.md +23 -0
  101. package/lib/utils/if-else.utils.ts +2 -2
  102. package/lib/utils/to-variants.util.md +62 -0
  103. package/package.json +7 -7
  104. package/lib/components/CardNumbers.vue +0 -101
  105. package/lib/components/PowerStateIcon.vue +0 -46
  106. package/lib/components/UiTag.vue +0 -101
  107. package/lib/components/backup-item/BackupItem.vue +0 -40
  108. package/lib/components/button/ButtonIcon.vue +0 -220
  109. package/lib/components/button/UiButton.vue +0 -470
  110. package/lib/components/card/CardSubtitle.vue +0 -24
  111. package/lib/components/card/CardTitle.vue +0 -57
  112. package/lib/components/chip/ChipIcon.vue +0 -30
  113. package/lib/components/chip/ChipRemoveIcon.vue +0 -13
  114. package/lib/components/chip/UiChip.vue +0 -137
  115. package/lib/components/counter/VtsCounter.vue +0 -147
  116. package/lib/components/legend/LegendGroup.vue +0 -44
  117. package/lib/components/legend/LegendItem.vue +0 -86
  118. package/lib/components/object-link/ObjectLink.vue +0 -87
  119. package/lib/components/state-hero/ComingSoonHero.vue +0 -13
  120. package/lib/components/state-hero/LoadingHero.vue +0 -15
  121. package/lib/components/state-hero/NoDataHero.vue +0 -11
  122. package/lib/components/state-hero/ObjectNotFoundHero.vue +0 -13
  123. package/lib/components/state-hero/StateHero.vue +0 -74
  124. package/lib/components/tree/TreeItemError.vue +0 -13
  125. package/lib/components/tree/TreeLoadingItem.vue +0 -60
  126. package/lib/components/user/UserLink.vue +0 -72
  127. package/lib/components/user/UserLogo.vue +0 -57
  128. package/lib/types/backup.type.ts +0 -11
  129. package/lib/types/size.type.ts +0 -1
  130. package/lib/types/task.type.ts +0 -13
  131. /package/lib/components/backdrop/{Backdrop.vue → VtsBackdrop.vue} +0 -0
  132. /package/lib/components/divider/{Divider.vue → VtsDivider.vue} +0 -0
@@ -1,74 +0,0 @@
1
- <template>
2
- <div :class="type" class="state-hero">
3
- <UiSpinner v-if="busy" class="spinner" />
4
- <img v-else-if="imageSrc" :src="imageSrc" alt="" class="image" />
5
- <p v-if="$slots.default" :class="typoClass" class="typo text">
6
- <slot />
7
- </p>
8
- </div>
9
- </template>
10
-
11
- <script lang="ts" setup>
12
- import UiSpinner from '@core/components/UiSpinner.vue'
13
- import { computed } from 'vue'
14
-
15
- export type StateHeroType = 'page' | 'card'
16
-
17
- const props = defineProps<{
18
- type: StateHeroType
19
- busy?: boolean
20
- image?: 'no-result' | 'under-construction' | 'no-data' // TODO: 'offline' | 'not-found' | 'all-good' | 'all-done' | 'error'
21
- }>()
22
-
23
- const typoClass = computed(() => (props.type === 'page' ? 'h2-black' : 'h4-medium'))
24
-
25
- const imageSrc = computed(() => {
26
- if (!props.image) {
27
- return undefined
28
- }
29
-
30
- return new URL(`../../assets/${props.image}.svg`, import.meta.url).href
31
- })
32
- </script>
33
-
34
- <style lang="postcss" scoped>
35
- .state-hero {
36
- &.page {
37
- --image-width: 90%;
38
- --image-max-height: none;
39
- --spinner-size: 10rem;
40
- --gap: 8.2rem;
41
- }
42
-
43
- &.card {
44
- --image-width: 70%;
45
- --image-max-height: 20rem;
46
- --spinner-size: 6rem;
47
- --gap: 2rem;
48
- }
49
- }
50
-
51
- .state-hero {
52
- flex: 1;
53
- display: flex;
54
- flex-direction: column;
55
- align-items: center;
56
- justify-content: center;
57
- gap: var(--gap);
58
- }
59
-
60
- .image {
61
- width: var(--image-width);
62
- max-width: 55rem;
63
- max-height: var(--image-max-height);
64
- }
65
-
66
- .spinner {
67
- color: var(--color-normal-txt-base);
68
- font-size: var(--spinner-size);
69
- }
70
-
71
- .text {
72
- color: var(--color-normal-txt-base);
73
- }
74
- </style>
@@ -1,13 +0,0 @@
1
- <!-- v1.1 -->
2
- <template>
3
- <li class="tree-item-error typo h6-semi-bold">
4
- <slot />
5
- </li>
6
- </template>
7
-
8
- <style lang="postcss" scoped>
9
- .tree-item-error {
10
- padding-left: 3rem;
11
- color: var(--color-danger-txt-base);
12
- }
13
- </style>
@@ -1,60 +0,0 @@
1
- <!-- v1.1 -->
2
- <template>
3
- <li class="tree-loading-item">
4
- <div class="tree-loading-item-label-placeholder">
5
- <div class="link-placeholder">
6
- <template v-if="depth > 1">
7
- <TreeLine v-for="i in depth - 1" :key="i" :right="i === depth - 1" full-height />
8
- </template>
9
- <VtsIcon :icon accent="current" />
10
- <div class="loader">&nbsp;</div>
11
- </div>
12
- </div>
13
- </li>
14
- </template>
15
-
16
- <script lang="ts" setup>
17
- import VtsIcon from '@core/components/icon/VtsIcon.vue'
18
- import TreeLine from '@core/components/tree/TreeLine.vue'
19
- import { IK_TREE_LIST_DEPTH } from '@core/utils/injection-keys.util'
20
- import type { IconDefinition } from '@fortawesome/fontawesome-common-types'
21
- import { inject } from 'vue'
22
-
23
- defineProps<{
24
- icon: IconDefinition
25
- }>()
26
-
27
- const depth = inject(IK_TREE_LIST_DEPTH, 0)
28
- </script>
29
-
30
- <style lang="postcss" scoped>
31
- .tree-loading-item-label-placeholder {
32
- display: flex;
33
- height: 4rem;
34
- background-color: var(--color-neutral-background-primary);
35
- }
36
-
37
- .link-placeholder {
38
- display: flex;
39
- align-items: center;
40
- flex: 1;
41
- padding: 0 0.8rem;
42
- gap: 0.4rem;
43
- }
44
-
45
- .loader {
46
- flex: 1;
47
- animation: pulse alternate 1s infinite;
48
- background-color: var(--color-normal-background-selected);
49
- }
50
-
51
- @keyframes pulse {
52
- 0% {
53
- opacity: 0.5;
54
- }
55
-
56
- 100% {
57
- opacity: 1;
58
- }
59
- }
60
- </style>
@@ -1,72 +0,0 @@
1
- <!-- v1.0 -->
2
- <template>
3
- <RouterLink v-if="route && !disabled" :to="route" class="user-link is-link typo p3-medium">
4
- <UserLogo class="logo" />
5
- {{ username }}
6
- </RouterLink>
7
- <span v-else :class="{ disabled }" class="user-link typo p3-medium">
8
- <UserLogo class="logo" />
9
- {{ username }}
10
- </span>
11
- </template>
12
-
13
- <script lang="ts" setup>
14
- import UserLogo from '@core/components/user/UserLogo.vue'
15
- import { type RouteLocationRaw } from 'vue-router'
16
-
17
- defineProps<{
18
- route?: RouteLocationRaw
19
- disabled?: boolean
20
- username: string
21
- }>()
22
- </script>
23
-
24
- <style lang="postcss" scoped>
25
- /* COLOR VARIANTS */
26
- .user-link {
27
- --color: var(--color-normal-txt-base);
28
- --border-color: var(--color-normal-txt-base);
29
-
30
- &.is-link {
31
- &:is(:hover, .hover, :focus-visible) {
32
- --color: var(--color-normal-txt-hover);
33
- --border-color: var(--color-normal-txt-hover);
34
- }
35
-
36
- &:is(:active, .pressed) {
37
- --color: var(--color-normal-txt-active);
38
- --border-color: var(--color-normal-txt-active);
39
- }
40
- }
41
-
42
- &.disabled {
43
- --color: var(--color-neutral-txt-secondary);
44
- --border-color: var(--color-neutral-txt-secondary);
45
- }
46
- }
47
-
48
- /* IMPLEMENTATION */
49
- .user-link {
50
- display: inline-flex;
51
- align-items: center;
52
- color: var(--color);
53
- gap: 0.8rem;
54
- border-top: 1px solid transparent;
55
- border-bottom: 1px solid var(--border-color);
56
- line-height: 0;
57
-
58
- &.disabled {
59
- cursor: not-allowed;
60
- }
61
-
62
- &.is-link {
63
- text-decoration: none;
64
- }
65
-
66
- .logo {
67
- /* Override the default color of UserLogo,
68
- to apply hover, active and disabled styles */
69
- --border-color: inherit;
70
- }
71
- }
72
- </style>
@@ -1,57 +0,0 @@
1
- <!-- v1.0 -->
2
- <template>
3
- <span :class="size" class="user-logo" />
4
- </template>
5
-
6
- <script lang="ts" setup>
7
- import type { UserLogoSize } from '@core/types/size.type'
8
-
9
- withDefaults(
10
- defineProps<{
11
- size?: UserLogoSize
12
- }>(),
13
- { size: 'extra-small' }
14
- )
15
- </script>
16
-
17
- <style lang="postcss" scoped>
18
- /* COLOR VARIANTS */
19
- .user-logo {
20
- --border-color: var(--color-normal-txt-base);
21
- }
22
-
23
- /* SIZE VARIANTS */
24
- .user-logo {
25
- &.extra-small {
26
- --size: 1.6rem;
27
- --border-size: 0.1rem;
28
- --background-position: -0.8rem -0.493rem;
29
- --background-size: 2.88rem;
30
- }
31
-
32
- &.small {
33
- --size: 2.4rem;
34
- --border-size: 0.1rem;
35
- --background-position: -1.2rem -0.739rem;
36
- --background-size: 4.32rem;
37
- }
38
-
39
- &.medium {
40
- --size: 4rem;
41
- --border-size: 0.2rem;
42
- --background-position: -2rem -1.232rem;
43
- --background-size: 7.2rem;
44
- }
45
- }
46
-
47
- /* IMPLEMENTATION */
48
- .user-logo {
49
- display: block;
50
- width: var(--size);
51
- height: var(--size);
52
- background: var(--color-neutral-txt-primary) url('../../assets/user.png') no-repeat var(--background-position) /
53
- var(--background-size);
54
- border: var(--border-size) solid var(--border-color);
55
- border-radius: 20rem;
56
- }
57
- </style>
@@ -1,11 +0,0 @@
1
- import type { RouteLocationRaw } from 'vue-router'
2
-
3
- export type BackupState = 'success' | 'failure' | 'partial'
4
-
5
- export type BackupStates = BackupState[]
6
-
7
- export type Backup = {
8
- label: string
9
- route?: RouteLocationRaw
10
- states: BackupStates
11
- }
@@ -1 +0,0 @@
1
- export type UserLogoSize = 'extra-small' | 'small' | 'medium'
@@ -1,13 +0,0 @@
1
- export type TaskStatus = 'pending' | 'success' | 'failure'
2
-
3
- export type TaskTab = TaskStatus | 'all'
4
-
5
- export type Task = {
6
- id: string | number
7
- name: string
8
- status: TaskStatus
9
- tag?: string
10
- start?: number
11
- end?: number
12
- subtasks?: Task[]
13
- }