@saasmakers/ui 1.4.54 → 1.4.55

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.
@@ -7,9 +7,6 @@ const props = withDefaults(defineProps<BaseCard>(), {
7
7
  clickable: true,
8
8
  color: 'gray',
9
9
  description: '',
10
- details: '',
11
- detailsIcon: undefined,
12
- direction: 'horizontal',
13
10
  disabled: false,
14
11
  emoji: undefined,
15
12
  hasBackground: true,
@@ -18,6 +15,7 @@ const props = withDefaults(defineProps<BaseCard>(), {
18
15
  id: undefined,
19
16
  image: '',
20
17
  isSelected: false,
18
+ orientation: 'horizontal',
21
19
  size: 'base',
22
20
  title: undefined,
23
21
  titleIcon: undefined,
@@ -30,7 +28,6 @@ const emit = defineEmits<{
30
28
 
31
29
  defineSlots<{
32
30
  default?: () => VNode[]
33
- detailsLeft?: () => VNode[]
34
31
  innerBoxLeft?: () => VNode[]
35
32
  innerBoxRight?: () => VNode[]
36
33
  outerBoxLeft?: () => VNode[]
@@ -66,8 +63,10 @@ function onClick(event: MouseEvent) {
66
63
  'cursor-pointer': isClickable,
67
64
  'pointer-events-none': disabled,
68
65
  'opacity-50': disabled,
69
- 'border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 shadow-sm p-1.5 pr-2.5': hasBackground && size === 'base',
70
- 'border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 shadow-sm p-2.5 pr-4': hasBackground && size === 'lg',
66
+ 'border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 shadow-sm p-1.5 pr-2.5': hasBackground && size === 'base' && orientation === 'horizontal',
67
+ 'border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 shadow-sm p-2.5 pr-4': hasBackground && size === 'lg' && orientation === 'horizontal',
68
+ 'border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 shadow-sm p-3': hasBackground && size === 'base' && orientation === 'vertical',
69
+ 'border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 shadow-sm p-4': hasBackground && size === 'lg' && orientation === 'vertical',
71
70
  'hover:border-gray-300 dark:hover:border-gray-700': hasBackground && isClickable,
72
71
  'rounded-xl': hasBackground,
73
72
  }"
@@ -77,8 +76,8 @@ function onClick(event: MouseEvent) {
77
76
  <div
78
77
  class="flex overflow-hidden"
79
78
  :class="{
80
- 'flex-row items-center text-left': direction === 'horizontal',
81
- 'flex-col text-center': direction === 'vertical',
79
+ 'flex-row items-center text-left': orientation === 'horizontal',
80
+ 'flex-col items-center text-center': orientation === 'vertical',
82
81
  }"
83
82
  >
84
83
  <span class="flex justify-center">
@@ -89,24 +88,31 @@ function onClick(event: MouseEvent) {
89
88
  class="relative z-10 flex items-center justify-center flex-initial"
90
89
  :class="{
91
90
  'border shadow-inner': !avatar && !image,
92
- 'rounded-lg': !avatar && !image,
91
+ 'rounded-lg': !avatar && !image && orientation === 'horizontal',
92
+ 'rounded-full': !avatar && !image && orientation === 'vertical',
93
93
  'border-gray-200 dark:border-gray-800 bg-gray-100 dark:bg-gray-900': !avatar && !image,
94
- 'mr-2': direction === 'horizontal' && size === 'base',
95
- 'mr-3': direction === 'horizontal' && size === 'lg',
96
- 'mb-1': direction === 'vertical' && size === 'base',
97
- 'mb-1.5': direction === 'vertical' && size === 'lg',
98
- 'h-9 w-9': size === 'base',
99
- 'h-11 w-11': size === 'lg',
94
+ 'mr-2': orientation === 'horizontal' && size === 'base',
95
+ 'mr-3': orientation === 'horizontal' && size === 'lg',
96
+ 'mb-2': orientation === 'vertical' && size === 'base',
97
+ 'mb-3': orientation === 'vertical' && size === 'lg',
98
+ 'h-9 w-9': size === 'base' && orientation === 'horizontal',
99
+ 'h-11 w-11': size === 'lg' && orientation === 'horizontal',
100
+ 'h-20 w-20': size === 'base' && orientation === 'vertical',
101
+ 'h-24 w-24': size === 'lg' && orientation === 'vertical',
100
102
  }"
101
103
  >
102
104
  <slot name="innerBoxLeft" />
103
105
 
104
106
  <BaseAvatar
105
107
  v-if="avatar"
106
- class="rounded-lg flex-initial"
108
+ class="flex-initial"
107
109
  :class="{
108
- 'h-10 w-10': size === 'base',
109
- 'h-12 w-12': size === 'lg',
110
+ 'rounded-lg': orientation === 'horizontal',
111
+ 'rounded-full': orientation === 'vertical',
112
+ 'h-10 w-10': size === 'base' && orientation === 'horizontal',
113
+ 'h-12 w-12': size === 'lg' && orientation === 'horizontal',
114
+ 'h-20 w-20': size === 'base' && orientation === 'vertical',
115
+ 'h-24 w-24': size === 'lg' && orientation === 'vertical',
110
116
  }"
111
117
  :src="avatar"
112
118
  />
@@ -131,10 +137,15 @@ function onClick(event: MouseEvent) {
131
137
 
132
138
  <img
133
139
  v-else-if="image"
134
- class="rounded-lg object-cover shadow-sm drag-none flex-initial"
140
+ class="object-cover shadow-sm transition-[filter] duration-300 drag-none flex-initial"
135
141
  :class="{
136
- 'h-9 w-9': size === 'base',
137
- 'h-11 w-11': size === 'lg',
142
+ 'rounded-lg': orientation === 'horizontal',
143
+ 'rounded-full': orientation === 'vertical',
144
+ 'h-9 w-9': size === 'base' && orientation === 'horizontal',
145
+ 'h-11 w-11': size === 'lg' && orientation === 'horizontal',
146
+ 'h-20 w-20': size === 'base' && orientation === 'vertical',
147
+ 'h-24 w-24': size === 'lg' && orientation === 'vertical',
148
+ 'grayscale': disabled,
138
149
  }"
139
150
  :alt="title"
140
151
  loading="lazy"
@@ -148,11 +159,13 @@ function onClick(event: MouseEvent) {
148
159
  </span>
149
160
 
150
161
  <div
151
- class="min-w-0 flex flex-1 flex-col justify-center leading-snug"
162
+ class="min-w-0 flex flex-col justify-center leading-snug"
152
163
  :class="{
153
- 'mr-4': direction === 'horizontal' && size === 'base',
154
- 'mr-5': direction === 'horizontal' && size === 'lg',
155
- 'items-center': direction === 'vertical',
164
+ 'flex-1': orientation === 'horizontal',
165
+ 'w-full': orientation === 'vertical',
166
+ 'mr-4': orientation === 'horizontal' && size === 'base',
167
+ 'mr-5': orientation === 'horizontal' && size === 'lg',
168
+ 'items-center': orientation === 'vertical',
156
169
  }"
157
170
  >
158
171
  <div
@@ -160,6 +173,8 @@ function onClick(event: MouseEvent) {
160
173
  :class="{
161
174
  'gap-0': size === 'base',
162
175
  'gap-0.5': size === 'lg',
176
+ 'gap-1': orientation === 'vertical' && size === 'base',
177
+ 'gap-1.5': orientation === 'vertical' && size === 'lg',
163
178
  }"
164
179
  >
165
180
  <BaseIcon
@@ -169,7 +184,7 @@ function onClick(event: MouseEvent) {
169
184
  :icon="titleIcon"
170
185
  :size="size === 'lg' ? 'base' : 'sm'"
171
186
  :text="title"
172
- truncate
187
+ :truncate="orientation === 'horizontal'"
173
188
  />
174
189
 
175
190
  <BaseText
@@ -180,18 +195,6 @@ function onClick(event: MouseEvent) {
180
195
  :text="description"
181
196
  />
182
197
  </div>
183
-
184
- <div class="flex items-center">
185
- <slot name="detailsLeft" />
186
-
187
- <BaseIcon
188
- v-if="details"
189
- class="mt-0.5 whitespace-nowrap text-gray-700 font-semibold tracking-tighter dark:text-gray-300"
190
- :icon="detailsIcon"
191
- :size="size === 'lg' ? 'xs' : '2xs'"
192
- :text="details"
193
- />
194
- </div>
195
198
  </div>
196
199
 
197
200
  <BaseIcon
@@ -206,7 +209,7 @@ function onClick(event: MouseEvent) {
206
209
  />
207
210
 
208
211
  <BaseIcon
209
- v-else-if="to || hasChevron"
212
+ v-else-if="orientation === 'horizontal' && (to || hasChevron)"
210
213
  class="self-center text-gray-500 flex-initial dark:text-gray-500"
211
214
  :class="{
212
215
  'group-hover:text-gray-900 dark:group-hover:text-gray-100': isClickable,
@@ -28,7 +28,7 @@ const { t } = useI18n()
28
28
  const { getIcon } = useLayerIcons()
29
29
 
30
30
  const isClickable = computed(() => {
31
- return props.clickable || props.to
31
+ return props.clickable || props.to || props.confirmation
32
32
  })
33
33
 
34
34
  const statusIcon = computed<string | undefined>(() => {
@@ -80,10 +80,6 @@ const finalColor = computed(() => {
80
80
  })
81
81
 
82
82
  function onClick(event: MouseEvent) {
83
- if (!isClickable.value) {
84
- return
85
- }
86
-
87
83
  if (props.confirmation) {
88
84
  if (confirming.value) {
89
85
  emit('confirm', event)
@@ -4,7 +4,7 @@ import type { FieldTabs, FieldTabsAction } from '../../types/fields'
4
4
 
5
5
  withDefaults(defineProps<Omit<FieldTabs, 'modelValue'>>(), {
6
6
  disabled: false,
7
- minimizeOnMobile: false,
7
+ orientation: 'horizontal',
8
8
  size: 'base',
9
9
  tabs: undefined,
10
10
  theme: 'rounded',
@@ -45,12 +45,12 @@ function onTabClick(event: MouseEvent, tabValue: string) {
45
45
  :is="tab.to ? NuxtLinkLocale : 'div'"
46
46
  v-for="tab in tabs"
47
47
  :key="tab.value"
48
- class="flex cursor-pointer items-center justify-center text-xs"
48
+ class="flex flex-1 cursor-pointer items-center justify-center text-xs"
49
49
  :class="{
50
+ 'flex-col sm:flex-row': orientation === 'responsive',
51
+ 'flex-col': orientation === 'vertical',
50
52
  'text-gray-900 dark:text-gray-100': isTabActive(tab.value),
51
53
  'text-gray-700 dark:text-gray-300 hover:text-gray-900 dark:hover:text-gray-100': !isTabActive(tab.value) && !disabled,
52
- 'flex-1': !minimizeOnMobile || !isTabActive(tab.value),
53
- 'flex-2 sm:flex-1': minimizeOnMobile && isTabActive(tab.value),
54
54
  'py-1.5 px-2.5': size === 'xs' && theme === 'rounded',
55
55
  'py-2 px-3': size === 'sm' && theme === 'rounded',
56
56
  'py-2.5 px-3.5': size === 'base' && theme === 'rounded' || size === 'xs' && theme === 'border',
@@ -69,14 +69,22 @@ function onTabClick(event: MouseEvent, tabValue: string) {
69
69
  >
70
70
  <BaseIcon
71
71
  v-if="tab.icon"
72
- class="mr-1.5 flex-initial"
72
+ class="flex-initial"
73
+ :class="{
74
+ 'mb-1 sm:mb-0 sm:mr-1.5': orientation === 'responsive',
75
+ 'mr-1.5': orientation === 'horizontal',
76
+ 'mb-1': orientation === 'vertical',
77
+ }"
73
78
  :color="isTabActive(tab.value) ? tab.activeColor : 'black'"
74
79
  :icon="tab.icon"
75
80
  />
76
81
 
77
82
  <span
78
- class="flex-initial"
79
- :class="{ 'hidden sm:inline': minimizeOnMobile && !isTabActive(tab.value) }"
83
+ class="whitespace-nowrap flex-initial"
84
+ :class="{
85
+ 'text-2xs sm:text-xs': orientation === 'responsive',
86
+ 'text-2xs': orientation === 'vertical',
87
+ }"
80
88
  >
81
89
  {{ tab.label }}
82
90
  </span>
@@ -77,9 +77,6 @@ export interface BaseCard {
77
77
  clickable?: boolean
78
78
  color?: BaseColor
79
79
  description?: string
80
- details?: string
81
- detailsIcon?: string
82
- direction?: BaseCardDirection
83
80
  disabled?: boolean
84
81
  emoji?: string
85
82
  hasBackground?: boolean
@@ -88,13 +85,14 @@ export interface BaseCard {
88
85
  id?: number | string
89
86
  image?: string
90
87
  isSelected?: boolean
88
+ orientation?: BaseCardOrientation
91
89
  size?: BaseCardSize
92
90
  title?: string
93
91
  titleIcon?: string
94
92
  to?: RouteLocationNamedI18n
95
93
  }
96
94
 
97
- export type BaseCardDirection = 'horizontal' | 'vertical'
95
+ export type BaseCardOrientation = 'horizontal' | 'vertical'
98
96
 
99
97
  export type BaseCardSize = 'base' | 'lg'
100
98
 
@@ -167,8 +167,8 @@ export type FieldStatus
167
167
 
168
168
  export interface FieldTabs {
169
169
  disabled?: boolean
170
- minimizeOnMobile?: boolean
171
170
  modelValue: string
171
+ orientation?: FieldTabsOrientation
172
172
  size?: FieldSize
173
173
  tabs: FieldTabsTab[]
174
174
  theme?: FieldTabsTheme
@@ -176,6 +176,8 @@ export interface FieldTabs {
176
176
 
177
177
  export type FieldTabsAction = 'added' | 'removed'
178
178
 
179
+ export type FieldTabsOrientation = 'horizontal' | 'responsive' | 'vertical'
180
+
179
181
  export interface FieldTabsTab {
180
182
  activeColor?: BaseColor
181
183
  icon?: string
@@ -13,7 +13,7 @@ declare global {
13
13
  type BaseButtonSize = import('./bases').BaseButtonSize
14
14
  type BaseButtonType = import('./bases').BaseButtonType
15
15
  type BaseCard = import('./bases').BaseCard
16
- type BaseCardDirection = import('./bases').BaseCardDirection
16
+ type BaseCardOrientation = import('./bases').BaseCardOrientation
17
17
  type BaseCardSize = import('./bases').BaseCardSize
18
18
  type BaseCharacter = import('./bases').BaseCharacter
19
19
  type BaseCharacterCharacter = import('./bases').BaseCharacterCharacter
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saasmakers/ui",
3
- "version": "1.4.54",
3
+ "version": "1.4.55",
4
4
  "private": false,
5
5
  "description": "Reusable Nuxt UI components for SaaS Makers projects",
6
6
  "license": "MIT",