@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,57 +0,0 @@
1
- <!-- v1.0 -->
2
- <template>
3
- <div class="card-title">
4
- <div class="main-content">
5
- <div class="title typo h6-medium">
6
- <slot />
7
- </div>
8
-
9
- <div v-if="$slots.info" class="info typo h7-semi-bold">
10
- <slot name="info" />
11
- </div>
12
- </div>
13
- <p v-if="$slots.description" class="description typo p3-regular">
14
- <slot name="description" />
15
- </p>
16
- </div>
17
- </template>
18
-
19
- <script lang="ts" setup>
20
- defineSlots<{
21
- default: () => void
22
- info: () => void
23
- description: () => void
24
- }>()
25
- </script>
26
-
27
- <style lang="postcss" scoped>
28
- .card-title {
29
- display: flex;
30
- flex-direction: column;
31
- }
32
-
33
- .main-content {
34
- display: flex;
35
- gap: 1.6rem;
36
- align-items: center;
37
- }
38
-
39
- .title {
40
- display: flex;
41
- align-items: center;
42
- gap: 1.6rem;
43
- color: var(--color-neutral-txt-primary);
44
- }
45
-
46
- .info {
47
- margin-left: auto;
48
- display: flex;
49
- align-items: center;
50
- gap: 0.8rem;
51
- color: var(--color-normal-txt-base);
52
- }
53
-
54
- .description {
55
- color: var(--color-neutral-txt-secondary);
56
- }
57
- </style>
@@ -1,30 +0,0 @@
1
- <template>
2
- <!-- TODO: replace with correct color typing when available -->
3
- <VtsIcon :class="{ disabled }" :accent="color === 'normal' ? 'brand' : color" :icon class="chip-icon" fixed-width />
4
- </template>
5
-
6
- <script lang="ts" setup>
7
- import VtsIcon from '@core/components/icon/VtsIcon.vue'
8
- import type { Color } from '@core/types/color.type'
9
- import type { IconDefinition } from '@fortawesome/fontawesome-common-types'
10
-
11
- defineProps<{
12
- color: Color
13
- icon?: IconDefinition
14
- disabled?: boolean
15
- }>()
16
- </script>
17
-
18
- <style lang="postcss" scoped>
19
- .chip-icon {
20
- color: var(--color-neutral-txt-secondary);
21
-
22
- &.disabled {
23
- color: var(--color-normal-txt-item);
24
-
25
- &.info {
26
- color: var(--color-neutral-txt-secondary);
27
- }
28
- }
29
- }
30
- </style>
@@ -1,13 +0,0 @@
1
- <template>
2
- <ButtonIcon :color :icon="faXmark" class="chip-remove-icon" size="small" />
3
- </template>
4
-
5
- <script lang="ts" setup>
6
- import ButtonIcon from '@core/components/button/ButtonIcon.vue'
7
- import type { Color } from '@core/types/color.type'
8
- import { faXmark } from '@fortawesome/free-solid-svg-icons'
9
-
10
- defineProps<{
11
- color: Color
12
- }>()
13
- </script>
@@ -1,137 +0,0 @@
1
- <!-- v1.1 -->
2
- <template>
3
- <span :class="[color, { disabled }]" class="ui-chip typo p3-regular" @click="emit('edit')">
4
- <ChipIcon :color :disabled :icon />
5
- <span class="content text-ellipsis">
6
- <slot />
7
- </span>
8
- <ChipRemoveIcon v-if="!disabled" :color @click.stop="emit('remove')" />
9
- </span>
10
- </template>
11
-
12
- <script lang="ts" setup>
13
- import ChipIcon from '@core/components/chip/ChipIcon.vue'
14
- import ChipRemoveIcon from '@core/components/chip/ChipRemoveIcon.vue'
15
- import type { Color } from '@core/types/color.type'
16
- import type { IconDefinition } from '@fortawesome/fontawesome-common-types'
17
-
18
- withDefaults(
19
- defineProps<{
20
- icon?: IconDefinition
21
- color?: Color
22
- disabled?: boolean
23
- }>(),
24
- { color: 'normal' }
25
- )
26
-
27
- const emit = defineEmits<{
28
- edit: []
29
- remove: []
30
- }>()
31
- </script>
32
-
33
- <style lang="postcss" scoped>
34
- /* COLOR VARIANTS */
35
- .ui-chip {
36
- --color: var(--color-neutral-txt-primary);
37
-
38
- &.disabled {
39
- --color: var(--color-normal-txt-item);
40
-
41
- &.info {
42
- --color: var(--color-neutral-txt-secondary);
43
- }
44
- }
45
- }
46
-
47
- /* BACKGROUND COLOR VARIANTS */
48
- .ui-chip {
49
- &.info {
50
- --background-color: var(--color-normal-background-selected);
51
-
52
- &:is(:hover, .hover, :focus-visible) {
53
- --background-color: var(--color-normal-background-hover);
54
- }
55
-
56
- &:is(:active, .pressed) {
57
- --background-color: var(--color-normal-background-active);
58
- }
59
-
60
- &.disabled {
61
- --background-color: var(--color-neutral-background-secondary);
62
- }
63
- }
64
-
65
- &.success {
66
- --background-color: var(--color-success-background-selected);
67
-
68
- &:is(:hover, .hover, :focus-visible) {
69
- --background-color: var(--color-success-background-hover);
70
- }
71
-
72
- &:is(:active, .pressed) {
73
- --background-color: var(--color-success-background-active);
74
- }
75
-
76
- &.disabled {
77
- --background-color: var(--color-success-item-disabled);
78
- }
79
- }
80
-
81
- &.warning {
82
- --background-color: var(--color-warning-background-selected);
83
-
84
- &:is(:hover, .hover, :focus-visible) {
85
- --background-color: var(--color-warning-background-hover);
86
- }
87
-
88
- &:is(:active, .pressed) {
89
- --background-color: var(--color-warning-background-active);
90
- }
91
-
92
- &.disabled {
93
- --background-color: var(--color-warning-item-disabled);
94
- }
95
- }
96
-
97
- &:is(.danger, .error) {
98
- --background-color: var(--color-danger-background-selected);
99
-
100
- &:is(:hover, .hover, :focus-visible) {
101
- --background-color: var(--color-danger-background-hover);
102
- }
103
-
104
- &:is(:active, .pressed) {
105
- --background-color: var(--color-danger-background-active);
106
- }
107
-
108
- &.disabled {
109
- --background-color: var(--color-danger-item-disabled);
110
- }
111
- }
112
- }
113
-
114
- /* IMPLEMENTATION */
115
- .ui-chip {
116
- display: flex;
117
- align-items: center;
118
- gap: 0.8rem;
119
- padding: 0.4rem 0.8rem;
120
- border-radius: 10rem;
121
- color: var(--color);
122
- background-color: var(--background-color);
123
- cursor: pointer;
124
- min-height: 2.4rem;
125
- vertical-align: middle;
126
- white-space: nowrap;
127
- min-width: 0;
128
-
129
- &.disabled {
130
- pointer-events: none;
131
- }
132
-
133
- .content {
134
- line-height: 1.6rem;
135
- }
136
- }
137
- </style>
@@ -1,147 +0,0 @@
1
- <!-- v2 -->
2
- <template>
3
- <span :class="classNames" class="vts-counter">
4
- <span class="inner">{{ value }}</span>
5
- </span>
6
- </template>
7
-
8
- <script lang="ts" setup>
9
- import { toVariants } from '@core/utils/to-variants.util'
10
- import { computed } from 'vue'
11
-
12
- type CounterAccent = 'brand' | 'neutral' | 'success' | 'warning' | 'danger' | 'muted'
13
- type CounterVariant = 'primary' | 'secondary'
14
- type CounterSize = 'small' | 'medium'
15
-
16
- const props = defineProps<{
17
- value: number | string
18
- accent: CounterAccent
19
- variant: CounterVariant
20
- size: CounterSize
21
- }>()
22
-
23
- const typoClasses = {
24
- small: 'typo p4-semi-bold',
25
- medium: 'typo p1-medium',
26
- }
27
-
28
- const classNames = computed(() => {
29
- return [
30
- typoClasses[props.size],
31
- toVariants({
32
- accent: props.accent,
33
- variant: props.variant,
34
- size: props.size,
35
- }),
36
- ]
37
- })
38
- </script>
39
-
40
- <style lang="postcss" scoped>
41
- /*
42
- VARIANT + ACCENT
43
- --vts-counter--background-color
44
- --vts-counter--color
45
- */
46
- .vts-counter {
47
- &.variant--primary {
48
- &.accent--brand {
49
- --vts-counter--background-color: var(--color-normal-item-base);
50
- --vts-counter--color: var(--color-normal-txt-item);
51
- }
52
-
53
- &.accent--neutral {
54
- --vts-counter--background-color: var(--color-neutral-txt-primary);
55
- --vts-counter--color: var(--color-neutral-background-primary);
56
- }
57
-
58
- &.accent--success {
59
- --vts-counter--background-color: var(--color-success-item-base);
60
- --vts-counter--color: var(--color-success-txt-item);
61
- }
62
-
63
- &.accent--warning {
64
- --vts-counter--background-color: var(--color-warning-item-base);
65
- --vts-counter--color: var(--color-warning-txt-item);
66
- }
67
-
68
- &.accent--danger {
69
- --vts-counter--background-color: var(--color-danger-item-base);
70
- --vts-counter--color: var(--color-danger-txt-item);
71
- }
72
-
73
- &.accent--muted {
74
- --vts-counter--background-color: var(--color-neutral-background-disabled);
75
- --vts-counter--color: var(--color-neutral-txt-secondary);
76
- }
77
- }
78
-
79
- &.variant--secondary {
80
- &.accent--brand {
81
- --vts-counter--background-color: var(--color-normal-background-selected);
82
- --vts-counter--color: var(--color-normal-txt-base);
83
- }
84
-
85
- &.accent--neutral {
86
- --vts-counter--background-color: var(--color-neutral-background-secondary);
87
- --vts-counter--color: var(--color-neutral-txt-secondary);
88
- }
89
-
90
- &.accent--success {
91
- --vts-counter--background-color: var(--color-success-background-selected);
92
- --vts-counter--color: var(--color-success-txt-base);
93
- }
94
-
95
- &.accent--warning {
96
- --vts-counter--background-color: var(--color-warning-background-selected);
97
- --vts-counter--color: var(--color-warning-txt-base);
98
- }
99
-
100
- &.accent--danger {
101
- --vts-counter--background-color: var(--color-danger-background-selected);
102
- --vts-counter--color: var(--color-danger-txt-base);
103
- }
104
-
105
- &.accent--muted {
106
- --vts-counter--background-color: var(--color-neutral-background-secondary);
107
- --vts-counter--color: var(--color-neutral-txt-secondary);
108
- }
109
- }
110
- }
111
-
112
- /*
113
- SIZE
114
- --vts-counter--height
115
- --vts-counter--padding
116
- */
117
- .vts-counter {
118
- &.size--small {
119
- --vts-counter--height: 1.5rem;
120
- --vts-counter--padding: 0 0.4rem;
121
- }
122
-
123
- &.size--medium {
124
- --vts-counter--height: 2.4rem;
125
- --vts-counter--padding: 0 0.6rem;
126
- }
127
- }
128
-
129
- /* IMPLEMENTATION */
130
- .vts-counter {
131
- display: inline-flex;
132
- align-items: center;
133
- justify-content: center;
134
- vertical-align: middle;
135
- text-transform: lowercase;
136
- color: var(--vts-counter--color);
137
- height: var(--vts-counter--height);
138
- min-width: var(--vts-counter--height);
139
- padding: var(--vts-counter--padding);
140
- background-color: var(--vts-counter--background-color);
141
- border-radius: calc(var(--vts-counter--height) / 2);
142
-
143
- .inner {
144
- line-height: 0;
145
- }
146
- }
147
- </style>
@@ -1,44 +0,0 @@
1
- <template>
2
- <div class="legend-group">
3
- <LegendTitle v-if="title" :icon="title.icon" :icon-tooltip="title.iconTooltip">
4
- {{ title.label }}
5
- </LegendTitle>
6
- <LegendList class="list">
7
- <LegendItem
8
- v-for="item in items"
9
- :key="item.label"
10
- :color="item.color"
11
- :tooltip="item.tooltip"
12
- :unit="item.unit"
13
- :value="item.value"
14
- >
15
- {{ item.label }}
16
- </LegendItem>
17
- </LegendList>
18
- </div>
19
- </template>
20
-
21
- <script lang="ts" setup>
22
- import LegendItem, { type LegendItemProps } from '@core/components/legend/LegendItem.vue'
23
- import LegendList from '@core/components/legend/LegendList.vue'
24
- import LegendTitle, { type LegendTitleProps } from '@core/components/LegendTitle.vue'
25
-
26
- export type LegendGroupProps = {
27
- items: (LegendItemProps & { label: string })[]
28
- title?: LegendTitleProps & { label: string }
29
- }
30
-
31
- defineProps<LegendGroupProps>()
32
- </script>
33
-
34
- <style lang="postcss" scoped>
35
- .legend-group {
36
- display: flex;
37
- flex-direction: column;
38
- gap: 0.8rem;
39
- }
40
-
41
- .list {
42
- padding-left: 1.6rem;
43
- }
44
- </style>
@@ -1,86 +0,0 @@
1
- <!-- v1.0 -->
2
- <template>
3
- <li :class="color" class="legend-item">
4
- <VtsIcon :icon="faCircle" accent="brand" class="circle-icon" />
5
- <span class="label typo p3-regular"><slot /></span>
6
- <VtsIcon v-if="tooltip" v-tooltip="tooltip" :icon="faCircleInfo" class="tooltip-icon" accent="brand" />
7
- <span v-if="valueLabel" class="value-and-unit typo c3-semi-bold">{{ valueLabel }}</span>
8
- </li>
9
- </template>
10
-
11
- <script lang="ts" setup>
12
- import VtsIcon from '@core/components/icon/VtsIcon.vue'
13
- import { vTooltip } from '@core/directives/tooltip.directive'
14
- import { faCircle, faCircleInfo } from '@fortawesome/free-solid-svg-icons'
15
- import { computed } from 'vue'
16
-
17
- export type LegendItemColor = 'primary' | 'secondary' | 'success' | 'warning' | 'danger' | 'disabled'
18
-
19
- export type LegendItemProps = {
20
- color: LegendItemColor
21
- value?: number
22
- unit?: string
23
- tooltip?: string
24
- }
25
-
26
- const props = defineProps<LegendItemProps>()
27
-
28
- defineSlots<{
29
- default(): void
30
- }>()
31
-
32
- const valueLabel = computed(() => [props.value, props.unit].join(' ').trim())
33
- </script>
34
-
35
- <style lang="postcss" scoped>
36
- /* COLOR VARIANTS */
37
- .legend-item {
38
- &.primary {
39
- --circle-color: var(--color-normal-item-base);
40
- }
41
-
42
- &.secondary {
43
- --circle-color: var(--color-neutral-txt-primary);
44
- }
45
-
46
- &.success {
47
- --circle-color: var(--color-success-item-base);
48
- }
49
-
50
- &.warning {
51
- --circle-color: var(--color-warning-item-base);
52
- }
53
-
54
- &.danger {
55
- --circle-color: var(--color-danger-item-base);
56
- }
57
-
58
- &.disabled {
59
- --circle-color: var(--color-neutral-background-disabled);
60
- }
61
- }
62
-
63
- /* IMPLEMENTATION */
64
- .legend-item {
65
- display: flex;
66
- align-items: center;
67
- gap: 0.8rem;
68
- }
69
-
70
- .circle-icon {
71
- font-size: 0.8rem;
72
- color: var(--circle-color);
73
- }
74
-
75
- .tooltip-icon {
76
- font-size: 1.2rem;
77
- }
78
-
79
- .label {
80
- color: var(--color-neutral-txt-primary);
81
- }
82
-
83
- .value-and-unit {
84
- color: var(--color-neutral-txt-secondary);
85
- }
86
- </style>
@@ -1,87 +0,0 @@
1
- <!-- v1.0 -->
2
- <template>
3
- <RouterLink v-if="route && !disabled" :to="route" class="object-link is-link typo p3-medium">
4
- <span class="icon">
5
- <slot name="icon">
6
- <VtsIcon :icon accent="current" />
7
- </slot>
8
- </span>
9
- <span v-tooltip class="content text-ellipsis">
10
- <slot />
11
- </span>
12
- </RouterLink>
13
- <span v-else :class="{ disabled }" class="object-link typo p3-medium">
14
- <span class="icon">
15
- <slot name="icon">
16
- <VtsIcon :icon accent="current" />
17
- </slot>
18
- </span>
19
- <slot />
20
- </span>
21
- </template>
22
-
23
- <script lang="ts" setup>
24
- import VtsIcon from '@core/components/icon/VtsIcon.vue'
25
- import { vTooltip } from '@core/directives/tooltip.directive'
26
- import type { IconDefinition } from '@fortawesome/fontawesome-common-types'
27
- import { type RouteLocationRaw } from 'vue-router'
28
-
29
- defineProps<{
30
- route?: RouteLocationRaw
31
- disabled?: boolean
32
- icon?: IconDefinition
33
- }>()
34
-
35
- defineSlots<{
36
- default: () => any
37
- icon: () => any
38
- }>()
39
- </script>
40
-
41
- <style lang="postcss" scoped>
42
- /* COLOR VARIANTS */
43
- .object-link {
44
- --color: var(--color-normal-txt-base);
45
- --border-color: var(--color-normal-txt-base);
46
-
47
- &.is-link {
48
- &:is(:hover, .hover, :focus-visible) {
49
- --color: var(--color-normal-txt-hover);
50
- --border-color: var(--color-normal-txt-hover);
51
- }
52
-
53
- &:is(:active, .pressed) {
54
- --color: var(--color-normal-txt-active);
55
- --border-color: var(--color-normal-txt-active);
56
- }
57
- }
58
-
59
- &.disabled {
60
- --color: var(--color-neutral-txt-secondary);
61
- --border-color: var(--color-neutral-txt-secondary);
62
- }
63
- }
64
-
65
- /* IMPLEMENTATION */
66
- .object-link {
67
- display: flex;
68
- min-width: 0;
69
- align-items: center;
70
- color: var(--color);
71
- gap: 1rem;
72
- border-top: 0.1rem solid transparent;
73
- border-bottom: 0.1rem solid var(--border-color);
74
- line-height: 1;
75
- padding-block: 0.5rem;
76
- text-decoration: none;
77
-
78
- &.disabled {
79
- cursor: not-allowed;
80
- }
81
- }
82
-
83
- .icon {
84
- color: var(--color-neutral-txt-primary);
85
- font-size: 0.8rem;
86
- }
87
- </style>
@@ -1,13 +0,0 @@
1
- <template>
2
- <StateHero :type class="coming-soon-hero" image="under-construction">
3
- {{ $t('coming-soon') }}
4
- </StateHero>
5
- </template>
6
-
7
- <script lang="ts" setup>
8
- import StateHero, { type StateHeroType } from '@core/components/state-hero/StateHero.vue'
9
-
10
- defineProps<{
11
- type: StateHeroType
12
- }>()
13
- </script>
@@ -1,15 +0,0 @@
1
- <template>
2
- <StateHero v-if="!disabled" :type busy class="loading-hero">
3
- {{ $t('loading-in-progress') }}
4
- </StateHero>
5
- <slot v-else />
6
- </template>
7
-
8
- <script lang="ts" setup>
9
- import StateHero, { type StateHeroType } from '@core/components/state-hero/StateHero.vue'
10
-
11
- defineProps<{
12
- type: StateHeroType
13
- disabled?: boolean
14
- }>()
15
- </script>
@@ -1,11 +0,0 @@
1
- <template>
2
- <StateHero class="no-data-hero" image="no-data" :type>{{ $t('no-data') }}</StateHero>
3
- </template>
4
-
5
- <script lang="ts" setup>
6
- import StateHero, { type StateHeroType } from '@core/components/state-hero/StateHero.vue'
7
-
8
- defineProps<{
9
- type: StateHeroType
10
- }>()
11
- </script>
@@ -1,13 +0,0 @@
1
- <template>
2
- <StateHero class="object-not-found-hero" image="no-result" type="page">
3
- {{ $t('object-not-found', { id }) }}
4
- </StateHero>
5
- </template>
6
-
7
- <script lang="ts" setup>
8
- import StateHero from '@core/components/state-hero/StateHero.vue'
9
-
10
- defineProps<{
11
- id: string
12
- }>()
13
- </script>