@imaginario27/air-ui-ds 1.13.2 → 1.13.4

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.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,28 @@ All notable changes to this package are documented in this file.
5
5
  Historical releases were reconstructed from git history (GitHub repository) and npm publish dates.
6
6
  Future releases will include detailed entries generated with Changesets.
7
7
 
8
+ ## 1.13.3 - 2026-05-21
9
+
10
+ Release type: patch.
11
+ Commits found in range: 1.
12
+
13
+ ### Added
14
+
15
+ 1. merge InteractiveRating into Rating and add disabled option to DropdownSelect ([15a4b1c](https://github.com/imaginario27/air-ui/commit/15a4b1c8bdec9f54d5e733c0ab834aba40a1c50b))
16
+
17
+ - Package: @imaginario27/air-ui-ds.
18
+
19
+ ## 1.13.2 - 2026-05-20
20
+
21
+ Release type: patch.
22
+ Commits found in range: 0.
23
+
24
+ ### Changed
25
+
26
+ 1. Historical release reconstructed from npm publish metadata (no package commits found in this publish window).
27
+
28
+ - Package: @imaginario27/air-ui-ds.
29
+
8
30
  ## 1.13.1 - 2026-05-19
9
31
 
10
32
  Release type: patch.
@@ -50,7 +50,10 @@
50
50
  {{ featuredDescription }}
51
51
  </p>
52
52
 
53
- <p :class="['text-sm', styleType === DashboardMetricCardStyle.DEFAULT ? 'text-text-neutral-subtle' : textColorClass]">
53
+ <p
54
+ v-if="description"
55
+ :class="['text-sm', styleType === DashboardMetricCardStyle.DEFAULT ? 'text-text-neutral-subtle' : textColorClass]"
56
+ >
54
57
  {{ description }}
55
58
  </p>
56
59
  </div>
@@ -106,10 +109,7 @@ const props = defineProps({
106
109
  },
107
110
  unit: String as PropType<string>,
108
111
  featuredDescription: String as PropType<string>,
109
- description: {
110
- type: String as PropType<string>,
111
- default: "Metric description",
112
- },
112
+ description: String as PropType<string>,
113
113
  trend: String as PropType<string>,
114
114
  trendDirection: {
115
115
  type: String as PropType<DashboardMetricTrendDirection>,
@@ -1,8 +1,8 @@
1
1
  <template>
2
2
  <Card class="px-0 py-5 shadow-xl">
3
3
  <CardBody class="px-5">
4
- <Rating
5
- :value="ratingValue"
4
+ <Rating
5
+ :modelValue="ratingValue"
6
6
  :color="ratingStarColor"
7
7
  />
8
8
  <p class="text-sm">
@@ -179,6 +179,7 @@
179
179
  :activeStyle="activeStyle"
180
180
  :to="option.to"
181
181
  :isExternal="option.isExternal"
182
+ :disabled="option.disabled"
182
183
  :class="[
183
184
  hasSeparator && index !== filteredOptions.length - 1
184
185
  ? 'border-b border-border-default'
@@ -453,7 +454,7 @@ watch(() => props.modelValue, (newValue) => {
453
454
 
454
455
  // Method
455
456
  const handleOptionClick = (option: SelectOption) => {
456
- if (props.disabled || props.isLoading) return
457
+ if (props.disabled || props.isLoading || option.disabled) return
457
458
 
458
459
  const optionValue = option.value
459
460
 
@@ -6,12 +6,14 @@
6
6
  'flex flex-col',
7
7
  'px-3',
8
8
  'text-sm',
9
- 'hover:cursor-pointer',
10
9
  'w-full',
11
10
  sizeClass,
12
- isSelected && activeStyle === SelectActiveStyle.FILL ?
11
+ disabled
12
+ ? 'cursor-not-allowed opacity-disabled'
13
+ : 'hover:cursor-pointer',
14
+ !disabled && (isSelected && activeStyle === SelectActiveStyle.FILL ?
13
15
  'bg-background-primary-brand-active hover:background-primary-brand-active hover:text-text-neutral-on-filled'
14
- : 'hover:bg-background-neutral-hover-subtle',
16
+ : 'hover:bg-background-neutral-hover-subtle'),
15
17
  ]"
16
18
  @click="emitClick"
17
19
  >
@@ -126,6 +128,10 @@ const props = defineProps({
126
128
  type: Boolean as PropType<boolean>,
127
129
  default: false,
128
130
  },
131
+ disabled: {
132
+ type: Boolean as PropType<boolean>,
133
+ default: false,
134
+ },
129
135
  })
130
136
 
131
137
  // States
@@ -133,7 +139,12 @@ const isImageLoaded = ref(true)
133
139
 
134
140
  // Emits
135
141
  const emit = defineEmits(['click'])
136
- const emitClick = () => {
142
+ const emitClick = (event: MouseEvent) => {
143
+ if (props.disabled) {
144
+ event.preventDefault()
145
+ event.stopPropagation()
146
+ return
147
+ }
137
148
  emit('click')
138
149
  }
139
150
 
@@ -1,60 +1,99 @@
1
- <template>
2
- <div class="flex gap-1">
3
- <RatingItem
4
- v-for="(icon, index) in items"
5
- :key="index"
6
- :icon
7
- :size
8
- :color
9
- />
10
- </div>
11
- </template>
12
-
13
- <script setup lang="ts">
14
- // Props
15
- const props = defineProps({
16
- value: {
17
- type: Number,
18
- default: 0,
19
- },
20
- size: {
21
- type: String as PropType<RatingItemSize>,
22
- default: RatingItemSize.SM,
23
- validator: (value: RatingItemSize) => Object.values(RatingItemSize).includes(value),
24
- },
25
- color: {
26
- type: String as PropType<RatingItemColor>,
27
- default: RatingItemColor.GOLD,
28
- validator: (value: RatingItemColor) => Object.values(RatingItemColor).includes(value),
29
- },
30
- emptyIndicatorIcon: {
31
- type: String as PropType<string>,
32
- default: 'mdi:star-outline'
33
- },
34
- halfIndicatorIcon: {
35
- type: String as PropType<string>,
36
- default: 'mdi:star-half-full'
37
- },
38
- fullIndicatorIcon: {
39
- type: String as PropType<string>,
40
- default: 'mdi:star'
41
- }
42
- })
43
-
44
-
45
- // Computed functions
46
- // Normalize value: clamp between 0 and 5, round to nearest 0.5
47
- const safeValue = computed(() => {
48
- if (!isFinite(props.value) || isNaN(props.value))
49
- return 0
50
-
51
- return Math.min(5, Math.max(0, Math.round(props.value * 2) / 2))
52
- })
53
-
54
- const items = computed(() => getRatingIndicator(
55
- safeValue.value,
56
- props.emptyIndicatorIcon,
57
- props.halfIndicatorIcon,
58
- props.fullIndicatorIcon
59
- ))
60
- </script>
1
+ <template>
2
+ <div
3
+ class="flex gap-1"
4
+ @mouseleave="hoverIndex = null"
5
+ >
6
+ <RatingItem
7
+ v-for="(icon, index) in items"
8
+ :key="index"
9
+ :icon
10
+ :size
11
+ :color
12
+ :isInteractive
13
+ @click="isInteractive && handleClick(index)"
14
+ @mouseenter="isInteractive && onMouseEnter(index)"
15
+ />
16
+ </div>
17
+ </template>
18
+
19
+ <script setup lang="ts">
20
+ // Props
21
+ const props = defineProps({
22
+ modelValue: {
23
+ type: Number,
24
+ default: 0,
25
+ },
26
+ size: {
27
+ type: String as PropType<RatingItemSize>,
28
+ default: RatingItemSize.SM,
29
+ validator: (value: RatingItemSize) => Object.values(RatingItemSize).includes(value),
30
+ },
31
+ color: {
32
+ type: String as PropType<RatingItemColor>,
33
+ default: RatingItemColor.GOLD,
34
+ validator: (value: RatingItemColor) => Object.values(RatingItemColor).includes(value),
35
+ },
36
+ emptyIndicatorIcon: {
37
+ type: String as PropType<string>,
38
+ default: 'mdi:star-outline'
39
+ },
40
+ halfIndicatorIcon: {
41
+ type: String as PropType<string>,
42
+ default: 'mdi:star-half-full'
43
+ },
44
+ fullIndicatorIcon: {
45
+ type: String as PropType<string>,
46
+ default: 'mdi:star'
47
+ },
48
+ isInteractive: {
49
+ type: Boolean,
50
+ default: false
51
+ },
52
+ hoverPreview: {
53
+ type: Boolean,
54
+ default: true
55
+ }
56
+ })
57
+
58
+ // Emits
59
+ const emit = defineEmits(['update:modelValue'])
60
+
61
+ // States
62
+ const hoverIndex = ref<number | null>(null)
63
+
64
+ // Handlers
65
+ const onMouseEnter = (index: number) => {
66
+ if (props.hoverPreview) {
67
+ hoverIndex.value = index
68
+ }
69
+ }
70
+
71
+ const handleClick = (index: number) => {
72
+ const clickedValue = index + 1
73
+
74
+ if (clickedValue === props.modelValue) {
75
+ emit('update:modelValue', 0)
76
+ } else {
77
+ emit('update:modelValue', clickedValue)
78
+ }
79
+ }
80
+
81
+ // Computed functions
82
+ // Normalize value: clamp between 0 and 5, round to nearest 0.5
83
+ const displayValue = computed(() => {
84
+ if (props.isInteractive && props.hoverPreview && hoverIndex.value !== null)
85
+ return hoverIndex.value + 1
86
+
87
+ if (!isFinite(props.modelValue) || isNaN(props.modelValue))
88
+ return 0
89
+
90
+ return Math.min(5, Math.max(0, Math.round(props.modelValue * 2) / 2))
91
+ })
92
+
93
+ const items = computed(() => getRatingIndicator(
94
+ displayValue.value,
95
+ props.emptyIndicatorIcon,
96
+ props.halfIndicatorIcon,
97
+ props.fullIndicatorIcon
98
+ ))
99
+ </script>
@@ -18,6 +18,7 @@ export interface SelectOption {
18
18
  helpText?: string
19
19
  to?: string
20
20
  isExternal?: boolean
21
+ disabled?: boolean
21
22
  }
22
23
 
23
24
  export interface SelectableCardOption {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@imaginario27/air-ui-ds",
3
- "version": "1.13.2",
3
+ "version": "1.13.4",
4
4
  "author": "imaginario27",
5
5
  "type": "module",
6
6
  "homepage": "https://air-ui.netlify.app/",
@@ -1,94 +0,0 @@
1
- <template>
2
- <div
3
- class="flex gap-1"
4
- @mouseleave="hoverIndex = null"
5
- >
6
- <RatingItem
7
- v-for="(icon, index) in items"
8
- :key="index"
9
- :icon="icon"
10
- :size="size"
11
- :color="color"
12
- isInteractive
13
- @click="handleClick(index)"
14
- @mouseenter="onMouseEnter(index)"
15
- />
16
- </div>
17
- </template>
18
-
19
- <script setup lang="ts">
20
- const props = defineProps({
21
- modelValue: {
22
- type: Number,
23
- required: true
24
- },
25
- size: {
26
- type: String as PropType<RatingItemSize>,
27
- default: RatingItemSize.SM,
28
- validator: (value: RatingItemSize) => Object.values(RatingItemSize).includes(value),
29
- },
30
- color: {
31
- type: String as PropType<RatingItemColor>,
32
- default: RatingItemColor.GOLD,
33
- validator: (value: RatingItemColor) => Object.values(RatingItemColor).includes(value),
34
- },
35
- emptyIndicatorIcon: {
36
- type: String as PropType<string>,
37
- default: 'mdi:star-outline'
38
- },
39
- halfIndicatorIcon: {
40
- type: String as PropType<string>,
41
- default: 'mdi:star-half-full'
42
- },
43
- fullIndicatorIcon: {
44
- type: String as PropType<string>,
45
- default: 'mdi:star'
46
- },
47
- hoverPreview: {
48
- type: Boolean,
49
- default: true
50
- }
51
- })
52
-
53
- // States
54
- const hoverIndex = ref<number | null>(null)
55
-
56
- // Emits
57
- const emit = defineEmits(['update:modelValue'])
58
-
59
- // Handlers
60
- const onMouseEnter = (index: number) => {
61
- if (props.hoverPreview) {
62
- hoverIndex.value = index
63
- }
64
- }
65
-
66
- const handleClick = (index: number) => {
67
- const clickedValue = index + 1
68
-
69
- if (clickedValue === props.modelValue) {
70
- emit('update:modelValue', 0)
71
- } else {
72
- emit('update:modelValue', clickedValue)
73
- }
74
- }
75
-
76
- // Computed
77
- // Get the value to render: either hover preview or actual value
78
- const displayValue = computed(() => {
79
- if (props.hoverPreview && hoverIndex.value !== null)
80
- return hoverIndex.value + 1
81
-
82
- if (!isFinite(props.modelValue) || isNaN(props.modelValue))
83
- return 0
84
-
85
- return Math.min(5, Math.max(0, Math.round(props.modelValue * 2) / 2))
86
- })
87
-
88
- const items = computed(() => getRatingIndicator(
89
- displayValue.value,
90
- props.emptyIndicatorIcon,
91
- props.halfIndicatorIcon,
92
- props.fullIndicatorIcon
93
- ))
94
- </script>