@xen-orchestra/web-core 0.27.0 → 0.29.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 (81) hide show
  1. package/lib/components/card/VtsCardRowKeyValue.vue +1 -0
  2. package/lib/components/cell-object/VtsCellObject.vue +1 -2
  3. package/lib/components/console/VtsActionsConsole.vue +3 -9
  4. package/lib/components/copy-button/VtsCopyButton.vue +1 -3
  5. package/lib/components/dropdown/DropdownTitle.vue +3 -3
  6. package/lib/components/icon/VtsIcon.vue +32 -76
  7. package/lib/components/input-wrapper/VtsInputWrapper.vue +2 -2
  8. package/lib/components/layout/VtsLayoutSidebar.vue +1 -2
  9. package/lib/components/menu/MenuItem.vue +4 -5
  10. package/lib/components/menu/MenuTrigger.vue +3 -3
  11. package/lib/components/object-icon/VtsObjectIcon.vue +2 -2
  12. package/lib/components/progress-bar/VtsProgressBar.vue +54 -0
  13. package/lib/components/progress-bar-group/VtsProgressBarGroup.vue +76 -0
  14. package/lib/components/resources/VtsResource.vue +3 -3
  15. package/lib/components/select/VtsSelect.vue +4 -5
  16. package/lib/components/table/ColumnTitle.vue +11 -12
  17. package/lib/components/task/VtsQuickTaskButton.vue +1 -2
  18. package/lib/components/tree/VtsTreeLoadingItem.vue +3 -3
  19. package/lib/components/ui/alarm-item/UiAlarmItem.vue +1 -2
  20. package/lib/components/ui/alert/UiAlert.vue +14 -13
  21. package/lib/components/ui/button/UiButton.vue +4 -5
  22. package/lib/components/ui/button-icon/UiButtonIcon.vue +3 -3
  23. package/lib/components/ui/checkbox/UiCheckbox.vue +2 -9
  24. package/lib/components/ui/chip/ChipIcon.vue +3 -3
  25. package/lib/components/ui/chip/ChipRemoveIcon.vue +1 -2
  26. package/lib/components/ui/chip/UiChip.vue +2 -2
  27. package/lib/components/ui/circle-progress-bar/UiCircleProgressBar.vue +7 -4
  28. package/lib/components/ui/data-ruler/UiDataRuler.vue +54 -6
  29. package/lib/components/ui/donut-chart/UiDonutChart.vue +30 -17
  30. package/lib/components/ui/dropdown/UiDropdown.vue +5 -7
  31. package/lib/components/ui/dropdown-button/UiDropdownButton.vue +4 -5
  32. package/lib/components/ui/head-bar/UiHeadBar.vue +6 -11
  33. package/lib/components/ui/info/UiInfo.vue +14 -20
  34. package/lib/components/ui/input/UiInput.vue +6 -7
  35. package/lib/components/ui/label/UiLabel.vue +3 -3
  36. package/lib/components/ui/legend/UiLegend.vue +3 -3
  37. package/lib/components/ui/legend-title/UiLegendTitle.vue +7 -3
  38. package/lib/components/ui/link/UiLink.vue +4 -5
  39. package/lib/components/ui/log-entry-viewer/UiLogEntryViewer.vue +6 -2
  40. package/lib/components/ui/object-link/UiObjectLink.vue +4 -4
  41. package/lib/components/ui/progress-bar/UiProgressBar.vue +14 -70
  42. package/lib/components/ui/query-search-bar/UiQuerySearchBar.vue +3 -4
  43. package/lib/components/ui/quick-task-item/UiQuickTaskItem.vue +3 -4
  44. package/lib/components/ui/radio-button/UiRadioButton.vue +1 -2
  45. package/lib/components/ui/table-pagination/PaginationButton.vue +2 -25
  46. package/lib/components/ui/table-pagination/UiTablePagination.vue +41 -20
  47. package/lib/components/ui/tag/UiTag.vue +3 -3
  48. package/lib/components/ui/text-area/UiTextarea.vue +2 -2
  49. package/lib/components/ui/toaster/UiToaster.vue +15 -13
  50. package/lib/components/ui/tree-item-label/UiTreeItemLabel.vue +4 -5
  51. package/lib/composables/pagination.composable.ts +5 -0
  52. package/lib/i18n.ts +4 -0
  53. package/lib/icons/fa-icons.ts +48 -2
  54. package/lib/icons/index.ts +4 -0
  55. package/lib/icons/legacy-icons.ts +10 -0
  56. package/lib/icons/object-icons.ts +1 -1
  57. package/lib/layouts/CoreLayout.vue +1 -2
  58. package/lib/locales/cs.json +29 -10
  59. package/lib/locales/de.json +70 -7
  60. package/lib/locales/en.json +23 -0
  61. package/lib/locales/es.json +3 -3
  62. package/lib/locales/fr.json +23 -0
  63. package/lib/locales/it.json +17 -5
  64. package/lib/locales/nl.json +28 -10
  65. package/lib/locales/pt_BR.json +67 -0
  66. package/lib/locales/sv.json +17 -0
  67. package/lib/packages/icon/DisplayIcon.vue +1 -0
  68. package/lib/packages/progress/README.md +62 -0
  69. package/lib/packages/progress/types.ts +19 -0
  70. package/lib/packages/progress/use-progress-group.ts +68 -0
  71. package/lib/packages/progress/use-progress.ts +22 -0
  72. package/lib/packages/threshold/README.md +30 -0
  73. package/lib/packages/threshold/type.ts +3 -0
  74. package/lib/packages/threshold/use-threshold.ts +19 -0
  75. package/lib/types/object-icon.type.ts +0 -40
  76. package/lib/utils/progress.util.ts +72 -0
  77. package/lib/utils/size.util.ts +6 -0
  78. package/package.json +1 -1
  79. package/lib/components/icon/NewVtsIcon.vue +0 -49
  80. package/lib/components/ui/complex-icon/UiComplexIcon.vue +0 -45
  81. package/lib/components/ui/object-icon/UiObjectIcon.vue +0 -251
@@ -5,7 +5,7 @@
5
5
  <div class="label-percent typo-body-regular text-ellipsis">
6
6
  <UiButtonIcon
7
7
  v-if="description"
8
- :icon="isDescriptionVisible ? faAngleDown : faAngleRight"
8
+ :icon="isDescriptionVisible ? 'fa:angle-down' : 'fa:angle-right'"
9
9
  size="small"
10
10
  accent="brand"
11
11
  :target-scale="2"
@@ -38,7 +38,6 @@ import UiButtonIcon from '@core/components/ui/button-icon/UiButtonIcon.vue'
38
38
  import { useTimeAgo } from '@core/composables/locale-time-ago.composable.ts'
39
39
  import { vTooltip } from '@core/directives/tooltip.directive'
40
40
  import { toVariants } from '@core/utils/to-variants.util'
41
- import { faAngleDown, faAngleRight } from '@fortawesome/free-solid-svg-icons'
42
41
  import { useToggle } from '@vueuse/core'
43
42
  import { computed } from 'vue'
44
43
  import { useI18n } from 'vue-i18n'
@@ -2,7 +2,7 @@
2
2
  <template>
3
3
  <div :class="toVariants({ accent })" class="ui-alert">
4
4
  <div class="content">
5
- <VtsIcon class="information-icon" :accent :icon="faCircle" :overlay-icon="icon" />
5
+ <VtsIcon class="information-icon" :name="icon" size="current" />
6
6
  <div class="alert typo-body-regular-small">
7
7
  <div>
8
8
  <slot />
@@ -14,7 +14,7 @@
14
14
  <UiButtonIcon
15
15
  v-if="close"
16
16
  class="close-button"
17
- :icon="faXmark"
17
+ icon="fa:xmark"
18
18
  accent="brand"
19
19
  size="medium"
20
20
  @click="emit('close')"
@@ -26,10 +26,9 @@
26
26
  <script setup lang="ts">
27
27
  import VtsIcon from '@core/components/icon/VtsIcon.vue'
28
28
  import UiButtonIcon from '@core/components/ui/button-icon/UiButtonIcon.vue'
29
+ import type { IconName } from '@core/icons'
30
+ import { useMapper } from '@core/packages/mapper'
29
31
  import { toVariants } from '@core/utils/to-variants.util'
30
- import type { IconDefinition } from '@fortawesome/fontawesome-common-types'
31
- import { faCheck, faCircle, faExclamation, faInfo, faXmark } from '@fortawesome/free-solid-svg-icons'
32
- import { computed } from 'vue'
33
32
 
34
33
  type AlertAccent = 'info' | 'success' | 'warning' | 'danger'
35
34
 
@@ -47,14 +46,16 @@ const slots = defineSlots<{
47
46
  description?(): any
48
47
  }>()
49
48
 
50
- const iconByAccent: Record<AlertAccent, IconDefinition> = {
51
- info: faInfo,
52
- success: faCheck,
53
- warning: faExclamation,
54
- danger: faXmark,
55
- }
56
-
57
- const icon = computed(() => iconByAccent[accent])
49
+ const icon = useMapper<AlertAccent, IconName>(
50
+ () => accent,
51
+ {
52
+ info: 'legacy:status:info',
53
+ success: 'legacy:status:success',
54
+ warning: 'legacy:status:warning',
55
+ danger: 'legacy:status:danger',
56
+ },
57
+ 'info'
58
+ )
58
59
  </script>
59
60
 
60
61
  <style scoped lang="postcss">
@@ -1,18 +1,17 @@
1
1
  <!-- v6 -->
2
2
  <template>
3
3
  <button :class="classNames" :disabled="busy || isDisabled || lockIcon" class="ui-button" type="button">
4
- <VtsIcon :busy :icon="leftIcon" accent="current" class="icon" fixed-width />
4
+ <VtsIcon :busy :name="leftIcon" class="icon" size="current" />
5
5
  <slot />
6
- <VtsIcon v-if="lockIcon" :icon="faLock" accent="current" class="icon" fixed-width />
6
+ <VtsIcon v-if="lockIcon" name="fa:lock" size="medium" class="icon" />
7
7
  </button>
8
8
  </template>
9
9
 
10
10
  <script lang="ts" setup>
11
11
  import VtsIcon from '@core/components/icon/VtsIcon.vue'
12
12
  import { useDisabled } from '@core/composables/disabled.composable'
13
+ import type { IconName } from '@core/icons'
13
14
  import { toVariants } from '@core/utils/to-variants.util'
14
- import type { IconDefinition } from '@fortawesome/fontawesome-common-types'
15
- import { faLock } from '@fortawesome/free-solid-svg-icons'
16
15
  import { computed } from 'vue'
17
16
 
18
17
  type ButtonVariant = 'primary' | 'secondary' | 'tertiary'
@@ -26,7 +25,7 @@ const { accent, variant, size, disabled, busy, lockIcon } = defineProps<{
26
25
  busy?: boolean
27
26
  disabled?: boolean
28
27
  lockIcon?: boolean
29
- leftIcon?: IconDefinition
28
+ leftIcon?: IconName
30
29
  }>()
31
30
 
32
31
  defineSlots<{
@@ -2,15 +2,15 @@
2
2
  <!-- TODO: Add complex icon -->
3
3
  <template>
4
4
  <button :class="classNames" :disabled class="ui-button-icon" type="button">
5
- <VtsIcon :icon accent="current" />
5
+ <VtsIcon :name="icon" size="medium" />
6
6
  <span v-if="dot" class="dot" />
7
7
  </button>
8
8
  </template>
9
9
 
10
10
  <script lang="ts" setup>
11
11
  import VtsIcon from '@core/components/icon/VtsIcon.vue'
12
+ import type { IconName } from '@core/icons'
12
13
  import { toVariants } from '@core/utils/to-variants.util'
13
- import type { IconDefinition } from '@fortawesome/fontawesome-common-types'
14
14
  import { computed } from 'vue'
15
15
 
16
16
  type ButtonIconAccent = 'brand' | 'warning' | 'danger'
@@ -23,7 +23,7 @@ const {
23
23
  selected,
24
24
  targetScale = 1,
25
25
  } = defineProps<{
26
- icon: IconDefinition
26
+ icon: IconName
27
27
  size: ButtonSize
28
28
  accent: ButtonIconAccent
29
29
  disabled?: boolean
@@ -10,7 +10,7 @@
10
10
  v-bind="attrs"
11
11
  />
12
12
  <span class="fake-checkbox">
13
- <VtsIcon :icon accent="current" class="icon" />
13
+ <VtsIcon :name="icon" size="medium" class="icon" />
14
14
  </span>
15
15
  <span v-if="slots.default" class="typo-body-regular">
16
16
  <slot />
@@ -26,7 +26,6 @@ import VtsIcon from '@core/components/icon/VtsIcon.vue'
26
26
  import UiInfo from '@core/components/ui/info/UiInfo.vue'
27
27
  import { useDisabled } from '@core/composables/disabled.composable'
28
28
  import { toVariants } from '@core/utils/to-variants.util'
29
- import { faCheck, faMinus } from '@fortawesome/free-solid-svg-icons'
30
29
  import { computed, type LabelHTMLAttributes, useAttrs } from 'vue'
31
30
 
32
31
  type CheckboxAccent = 'brand' | 'warning' | 'danger'
@@ -57,13 +56,7 @@ const classNames = computed(() => [
57
56
 
58
57
  const isIndeterminate = computed(() => checkboxModel.value === undefined)
59
58
 
60
- const icon = computed(() => {
61
- if (isIndeterminate.value) {
62
- return faMinus
63
- }
64
-
65
- return faCheck
66
- })
59
+ const icon = computed(() => (isIndeterminate.value ? 'fa:minus' : 'fa:check'))
67
60
 
68
61
  const attrs = useAttrs()
69
62
  </script>
@@ -1,13 +1,13 @@
1
1
  <template>
2
- <VtsIcon :class="{ muted: disabled }" accent="current" :icon class="chip-icon" fixed-width />
2
+ <VtsIcon :class="{ muted: disabled }" :name="icon" size="medium" class="chip-icon" />
3
3
  </template>
4
4
 
5
5
  <script lang="ts" setup>
6
6
  import VtsIcon from '@core/components/icon/VtsIcon.vue'
7
- import type { IconDefinition } from '@fortawesome/fontawesome-common-types'
7
+ import type { IconName } from '@core/icons'
8
8
 
9
9
  defineProps<{
10
- icon?: IconDefinition
10
+ icon?: IconName
11
11
  disabled?: boolean
12
12
  }>()
13
13
  </script>
@@ -1,11 +1,10 @@
1
1
  <template>
2
- <UiButtonIcon :accent="buttonAccent" :icon="faXmark" size="small" />
2
+ <UiButtonIcon :accent="buttonAccent" icon="fa:xmark" size="small" />
3
3
  </template>
4
4
 
5
5
  <script lang="ts" setup>
6
6
  import UiButtonIcon from '@core/components/ui/button-icon/UiButtonIcon.vue'
7
7
  import type { ChipAccent } from '@core/components/ui/chip/UiChip.vue'
8
- import { faXmark } from '@fortawesome/free-solid-svg-icons'
9
8
  import { computed } from 'vue'
10
9
 
11
10
  const { accent } = defineProps<{
@@ -12,15 +12,15 @@
12
12
  <script lang="ts" setup>
13
13
  import ChipIcon from '@core/components/ui/chip/ChipIcon.vue'
14
14
  import ChipRemoveIcon from '@core/components/ui/chip/ChipRemoveIcon.vue'
15
+ import type { IconName } from '@core/icons'
15
16
  import { toVariants } from '@core/utils/to-variants.util'
16
- import type { IconDefinition } from '@fortawesome/fontawesome-common-types'
17
17
  import { computed } from 'vue'
18
18
 
19
19
  export type ChipAccent = 'info' | 'success' | 'warning' | 'danger'
20
20
 
21
21
  const props = defineProps<{
22
22
  accent: ChipAccent
23
- icon?: IconDefinition
23
+ icon?: IconName
24
24
  disabled?: boolean
25
25
  }>()
26
26
 
@@ -18,7 +18,7 @@
18
18
  />
19
19
  </svg>
20
20
  <div v-if="size !== 'extra-small'" class="overlay">
21
- <VtsIcon v-if="isComplete" class="icon" :icon :accent="iconAccent" />
21
+ <VtsIcon v-if="isComplete" class="icon" :name="icon" size="medium" />
22
22
  <span v-else>{{ percentValue }}</span>
23
23
  </div>
24
24
  </div>
@@ -26,8 +26,8 @@
26
26
 
27
27
  <script setup lang="ts">
28
28
  import VtsIcon from '@core/components/icon/VtsIcon.vue'
29
+ import type { IconName } from '@core/icons'
29
30
  import { toVariants } from '@core/utils/to-variants.util.ts'
30
- import { faCheck, faExclamation } from '@fortawesome/free-solid-svg-icons'
31
31
  import { useClamp, useMax } from '@vueuse/math'
32
32
  import { computed } from 'vue'
33
33
  import { useI18n } from 'vue-i18n'
@@ -90,8 +90,7 @@ const dashOffset = computed(() => {
90
90
 
91
91
  const percentValue = computed(() => n(valuePercent.value / 100, 'percent'))
92
92
 
93
- const iconAccent = computed(() => (isCompleteWithSuccess.value ? 'success' : accent))
94
- const icon = computed(() => (accent === 'warning' || accent === 'danger' ? faExclamation : faCheck))
93
+ const icon = computed<IconName>(() => (accent === 'warning' || accent === 'danger' ? 'fa:exclamation' : 'fa:check'))
95
94
 
96
95
  const className = computed(() => [
97
96
  fontClass.value,
@@ -125,6 +124,10 @@ const className = computed(() => [
125
124
  .success {
126
125
  stroke: var(--color-success-item-base);
127
126
  }
127
+
128
+ .icon {
129
+ color: var(--color-success-item-base);
130
+ }
128
131
  }
129
132
 
130
133
  &.accent--warning {
@@ -1,24 +1,72 @@
1
1
  <!-- v1 -->
2
2
  <template>
3
3
  <div class="ui-data-ruler typo-body-regular-small">
4
- <span>{{ t('n-percent', 0) }}</span>
5
- <span>{{ t('n-percent', 50) }}</span>
6
- <span>{{ t('n-percent', 100) }}</span>
4
+ <span>{{ n(0, 'percent') }}</span>
5
+ <span>{{ n(max / 200, 'percent') }}</span>
6
+ <span class="max">
7
+ <VtsIcon
8
+ v-if="warning?.accent || warning?.tooltip"
9
+ v-tooltip="warning.tooltip ?? false"
10
+ :class="warning.accent ?? 'warning'"
11
+ class="icon"
12
+ name="fa:exclamation-circle"
13
+ size="small"
14
+ />
15
+ {{ n(max / 100, 'percent') }}</span
16
+ >
7
17
  </div>
8
18
  </template>
9
19
 
10
20
  <script lang="ts" setup>
21
+ import VtsIcon from '@core/components/icon/VtsIcon.vue'
22
+ import { vTooltip } from '@core/directives/tooltip.directive.ts'
11
23
  import { useI18n } from 'vue-i18n'
12
24
 
13
- const { t } = useI18n()
25
+ const { max = 100 } = defineProps<{
26
+ max?: number
27
+ warning?: {
28
+ accent?: 'info' | 'warning' | 'danger'
29
+ tooltip?: string
30
+ }
31
+ }>()
32
+
33
+ const { n } = useI18n()
14
34
  </script>
15
35
 
16
36
  <style lang="postcss" scoped>
17
37
  .ui-data-ruler {
18
- display: flex;
38
+ display: grid;
39
+ grid-template-columns: 1fr auto 1fr;
19
40
  align-items: center;
20
- justify-content: space-between;
21
41
  gap: 1rem;
22
42
  color: var(--color-neutral-txt-secondary);
43
+
44
+ .icon {
45
+ &.warning {
46
+ color: var(--color-warning-item-base);
47
+ }
48
+
49
+ &.danger {
50
+ color: var(--color-danger-item-base);
51
+ }
52
+ }
53
+
54
+ .max {
55
+ display: flex;
56
+ align-items: center;
57
+ gap: 0.8rem;
58
+ }
59
+
60
+ & > span:first-child {
61
+ justify-self: start;
62
+ }
63
+
64
+ & > span:nth-child(2) {
65
+ justify-self: center;
66
+ }
67
+
68
+ & > span:last-child {
69
+ justify-self: end;
70
+ }
23
71
  }
24
72
  </style>
@@ -1,25 +1,27 @@
1
1
  <!-- v3 -->
2
2
  <template>
3
- <svg class="ui-donut-chart" viewBox="0 0 100 100">
4
- <circle class="segment accent--muted" cx="50" cy="50" r="40" />
5
- <circle
6
- v-for="(segment, index) in computedSegments"
7
- :key="index"
8
- :class="`accent--${segment.accent}`"
9
- :stroke-dasharray="`${segment.percent} ${circumference - segment.percent}`"
10
- :stroke-dashoffset="segment.offset"
11
- class="segment"
12
- cx="50"
13
- cy="50"
14
- r="40"
15
- />
16
- <VtsIcon :icon accent="current" height="24" width="24" x="38" y="38" />
17
- </svg>
3
+ <div class="ui-donut-chart">
4
+ <VtsIcon v-if="icon" :name="icon" size="medium" class="chart-icon" />
5
+ <svg viewBox="0 0 100 100">
6
+ <circle class="segment accent--muted" cx="50" cy="50" r="40" />
7
+ <circle
8
+ v-for="(segment, index) in computedSegments"
9
+ :key="index"
10
+ :class="`accent--${segment.accent}`"
11
+ :stroke-dasharray="`${segment.percent} ${circumference - segment.percent}`"
12
+ :stroke-dashoffset="segment.offset"
13
+ class="segment"
14
+ cx="50"
15
+ cy="50"
16
+ r="40"
17
+ />
18
+ </svg>
19
+ </div>
18
20
  </template>
19
21
 
20
22
  <script lang="ts" setup>
21
23
  import VtsIcon from '@core/components/icon/VtsIcon.vue'
22
- import type { IconDefinition } from '@fortawesome/fontawesome-common-types'
24
+ import type { IconName } from '@core/icons'
23
25
  import { computed } from 'vue'
24
26
 
25
27
  export type DonutSegmentAccent = 'neutral' | 'info' | 'success' | 'warning' | 'danger' | 'muted'
@@ -31,7 +33,7 @@ export type DonutSegment = {
31
33
 
32
34
  export type DonutChartProps = {
33
35
  segments: DonutSegment[]
34
- icon?: IconDefinition
36
+ icon?: IconName
35
37
  }
36
38
 
37
39
  const props = defineProps<DonutChartProps>()
@@ -59,9 +61,20 @@ const computedSegments = computed(() => {
59
61
 
60
62
  <style lang="postcss" scoped>
61
63
  .ui-donut-chart {
64
+ display: grid;
65
+ place-items: center;
62
66
  width: 100px;
63
67
  height: 100px;
64
68
 
69
+ .chart-icon {
70
+ grid-area: 1 / 1;
71
+ z-index: 1;
72
+ }
73
+
74
+ svg {
75
+ grid-area: 1 / 1;
76
+ }
77
+
65
78
  .segment {
66
79
  stroke-width: 10;
67
80
  fill: transparent;
@@ -3,7 +3,7 @@
3
3
  <div v-tooltip="{ selector: '.text-ellipsis' }" :class="className" class="ui-dropdown">
4
4
  <UiCheckbox v-if="checkbox" :disabled :model-value="selected" accent="brand" />
5
5
  <slot name="icon">
6
- <VtsIcon :icon accent="current" />
6
+ <VtsIcon :name="icon" size="medium" />
7
7
  </slot>
8
8
  <div class="text-ellipsis typo-body-bold-small">
9
9
  <slot />
@@ -11,10 +11,9 @@
11
11
  <div v-if="info" class="info typo-body-regular-small">{{ info }}</div>
12
12
  <VtsIcon
13
13
  v-if="subMenuIcon || locked"
14
- :accent="disabled ? 'current' : 'brand'"
15
- :icon="locked ? faLock : faAngleRight"
14
+ :name="locked ? 'fa:lock' : 'fa:angle-right'"
15
+ size="medium"
16
16
  class="right-icon"
17
- fixed-width
18
17
  />
19
18
  </div>
20
19
  </template>
@@ -23,9 +22,8 @@
23
22
  import VtsIcon from '@core/components/icon/VtsIcon.vue'
24
23
  import UiCheckbox from '@core/components/ui/checkbox/UiCheckbox.vue'
25
24
  import { vTooltip } from '@core/directives/tooltip.directive'
25
+ import type { IconName } from '@core/icons'
26
26
  import { toVariants } from '@core/utils/to-variants.util'
27
- import type { IconDefinition } from '@fortawesome/fontawesome-common-types'
28
- import { faAngleRight, faLock } from '@fortawesome/free-solid-svg-icons'
29
27
  import { computed } from 'vue'
30
28
 
31
29
  export type DropdownAccent = 'normal' | 'brand' | 'success' | 'warning' | 'danger'
@@ -44,7 +42,7 @@ const {
44
42
  hover?: boolean
45
43
  checkbox?: boolean
46
44
  subMenuIcon?: boolean
47
- icon?: IconDefinition
45
+ icon?: IconName
48
46
  info?: string
49
47
  }>()
50
48
 
@@ -1,24 +1,23 @@
1
1
  <!-- v5 -->
2
2
  <template>
3
3
  <button :class="{ selected }" :disabled="isDisabled" class="ui-dropdown-item" type="button">
4
- <VtsIcon :icon accent="current" class="left-icon" fixed-width />
4
+ <VtsIcon :name="icon" size="medium" />
5
5
  <span class="typo-action-button label">
6
6
  <slot />
7
7
  </span>
8
- <VtsIcon :icon="faAngleDown" accent="current" class="right-icon" fixed-width />
8
+ <VtsIcon name="fa:angle-down" size="medium" />
9
9
  </button>
10
10
  </template>
11
11
 
12
12
  <script lang="ts" setup>
13
13
  import VtsIcon from '@core/components/icon/VtsIcon.vue'
14
14
  import { useDisabled } from '@core/composables/disabled.composable'
15
- import type { IconDefinition } from '@fortawesome/fontawesome-common-types'
16
- import { faAngleDown } from '@fortawesome/free-solid-svg-icons'
15
+ import type { IconName } from '@core/icons'
17
16
 
18
17
  const { disabled, selected, icon } = defineProps<{
19
18
  disabled?: boolean
20
19
  selected?: boolean
21
- icon?: IconDefinition
20
+ icon?: IconName
22
21
  }>()
23
22
 
24
23
  const isDisabled = useDisabled(() => disabled)
@@ -2,11 +2,9 @@
2
2
  <template>
3
3
  <div class="ui-head-bar">
4
4
  <div class="label-wrapper">
5
- <span v-if="slots.icon || icon" class="icon">
6
- <slot name="icon">
7
- <VtsIcon :icon accent="current" />
8
- </slot>
9
- </span>
5
+ <slot name="icon">
6
+ <VtsIcon :name="icon" size="medium" />
7
+ </slot>
10
8
  <h4 v-tooltip class="typo-h4 label text-ellipsis">
11
9
  <slot />
12
10
  </h4>
@@ -23,10 +21,10 @@
23
21
  <script lang="ts" setup>
24
22
  import VtsIcon from '@core/components/icon/VtsIcon.vue'
25
23
  import { vTooltip } from '@core/directives/tooltip.directive'
26
- import type { IconDefinition } from '@fortawesome/fontawesome-common-types'
24
+ import type { IconName } from '@core/icons'
27
25
 
28
26
  defineProps<{
29
- icon?: IconDefinition
27
+ icon?: IconName
30
28
  }>()
31
29
 
32
30
  const slots = defineSlots<{
@@ -39,6 +37,7 @@ const slots = defineSlots<{
39
37
 
40
38
  <style lang="postcss" scoped>
41
39
  .ui-head-bar {
40
+ min-height: 5.6rem;
42
41
  padding: 0.8rem 1.6rem;
43
42
  display: flex;
44
43
  gap: 1.6rem;
@@ -57,10 +56,6 @@ const slots = defineSlots<{
57
56
  color: var(--color-neutral-txt-primary);
58
57
  }
59
58
 
60
- .icon {
61
- font-size: 2.4rem;
62
- }
63
-
64
59
  .status {
65
60
  color: var(--color-neutral-txt-secondary);
66
61
  display: flex;
@@ -1,7 +1,7 @@
1
1
  <!-- v4 -->
2
2
  <template>
3
3
  <div class="ui-info">
4
- <VtsIcon :accent class="icon" :icon="faCircle" :overlay-icon="icon" />
4
+ <VtsIcon class="icon" :name="icon" size="medium" />
5
5
  <p v-tooltip="!wrap" class="typo-body-regular-small" :class="{ 'text-ellipsis': !wrap }">
6
6
  <slot />
7
7
  </p>
@@ -11,16 +11,8 @@
11
11
  <script lang="ts" setup>
12
12
  import VtsIcon from '@core/components/icon/VtsIcon.vue'
13
13
  import { vTooltip } from '@core/directives/tooltip.directive'
14
- import {
15
- faCheck,
16
- faCircle,
17
- faExclamation,
18
- faInfo,
19
- faMinus,
20
- faXmark,
21
- type IconDefinition,
22
- } from '@fortawesome/free-solid-svg-icons'
23
- import { computed } from 'vue'
14
+ import type { IconName } from '@core/icons'
15
+ import { useMapper } from '@core/packages/mapper'
24
16
 
25
17
  export type InfoAccent = 'info' | 'success' | 'warning' | 'danger' | 'muted'
26
18
 
@@ -33,15 +25,17 @@ defineSlots<{
33
25
  default(): any
34
26
  }>()
35
27
 
36
- const iconByAccent: Record<InfoAccent, IconDefinition> = {
37
- info: faInfo,
38
- success: faCheck,
39
- warning: faExclamation,
40
- danger: faXmark,
41
- muted: faMinus,
42
- }
43
-
44
- const icon = computed(() => iconByAccent[accent])
28
+ const icon = useMapper<InfoAccent, IconName>(
29
+ () => accent,
30
+ {
31
+ info: 'legacy:status:info',
32
+ success: 'legacy:status:success',
33
+ warning: 'legacy:status:warning',
34
+ danger: 'legacy:status:danger',
35
+ muted: 'legacy:status:muted',
36
+ },
37
+ 'muted'
38
+ )
45
39
  </script>
46
40
 
47
41
  <style lang="postcss" scoped>
@@ -1,7 +1,7 @@
1
1
  <!-- v5 -->
2
2
  <template>
3
3
  <div :class="toVariants({ accent, disabled })" class="ui-input" @click.self="focus()">
4
- <VtsIcon :icon accent="current" class="left-icon" />
4
+ <VtsIcon :name="icon" size="medium" class="left-icon" />
5
5
  <input
6
6
  :id="wrapperController?.id ?? id"
7
7
  ref="inputRef"
@@ -14,14 +14,14 @@
14
14
  />
15
15
  <UiButtonIcon
16
16
  v-if="!disabled && modelValue && clearable"
17
- :icon="faXmark"
17
+ icon="fa:xmark"
18
18
  :target-scale="1.6"
19
19
  accent="brand"
20
20
  size="small"
21
21
  @click="clear()"
22
22
  />
23
23
  <slot v-if="slots['right-icon'] || rightIcon" name="right-icon">
24
- <VtsIcon :icon="rightIcon" accent="current" class="right-icon" />
24
+ <VtsIcon :name="rightIcon" size="medium" class="right-icon" />
25
25
  </slot>
26
26
  </div>
27
27
  </template>
@@ -30,11 +30,10 @@
30
30
  import VtsIcon from '@core/components/icon/VtsIcon.vue'
31
31
  import UiButtonIcon from '@core/components/ui/button-icon/UiButtonIcon.vue'
32
32
  import type { LabelAccent } from '@core/components/ui/label/UiLabel.vue'
33
+ import type { IconName } from '@core/icons'
33
34
  import { useMapper } from '@core/packages/mapper/use-mapper.ts'
34
35
  import { IK_INPUT_WRAPPER_CONTROLLER } from '@core/utils/injection-keys.util'
35
36
  import { toVariants } from '@core/utils/to-variants.util'
36
- import type { IconDefinition } from '@fortawesome/fontawesome-common-types'
37
- import { faXmark } from '@fortawesome/free-solid-svg-icons'
38
37
  import { inject, ref, useAttrs, watchEffect } from 'vue'
39
38
 
40
39
  type InputAccent = 'brand' | 'warning' | 'danger'
@@ -55,8 +54,8 @@ const {
55
54
  required?: boolean
56
55
  disabled?: boolean
57
56
  type?: InputType
58
- icon?: IconDefinition
59
- rightIcon?: IconDefinition
57
+ icon?: IconName
58
+ rightIcon?: IconName
60
59
  clearable?: boolean
61
60
  }>()
62
61
 
@@ -1,7 +1,7 @@
1
1
  <!-- v1 -->
2
2
  <template>
3
3
  <div :class="toVariants({ accent })" class="ui-label">
4
- <VtsIcon accent="current" :icon class="icon" />
4
+ <VtsIcon :name="icon" size="medium" class="icon" />
5
5
  <label :for="htmlFor" :class="{ required }" class="typo-caption label">
6
6
  <slot />
7
7
  </label>
@@ -12,8 +12,8 @@
12
12
  <script lang="ts" setup>
13
13
  import VtsIcon from '@core/components/icon/VtsIcon.vue'
14
14
  import UiLink from '@core/components/ui/link/UiLink.vue'
15
+ import type { IconName } from '@core/icons'
15
16
  import { toVariants } from '@core/utils/to-variants.util'
16
- import type { IconDefinition } from '@fortawesome/fontawesome-common-types'
17
17
  import { useI18n } from 'vue-i18n'
18
18
 
19
19
  export type LabelAccent = 'neutral' | 'warning' | 'danger'
@@ -21,7 +21,7 @@ export type LabelAccent = 'neutral' | 'warning' | 'danger'
21
21
  const { for: htmlFor } = defineProps<{
22
22
  accent: LabelAccent
23
23
  for?: string
24
- icon?: IconDefinition
24
+ icon?: IconName
25
25
  required?: boolean
26
26
  href?: string
27
27
  }>()