@saasmakers/ui 2.0.14 → 2.0.16

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.
@@ -15,7 +15,6 @@ const props = withDefaults(defineProps<BaseButton>(), {
15
15
  light: false,
16
16
  loading: false,
17
17
  reverse: false,
18
- rounded: 'md',
19
18
  size: 'base',
20
19
  text: '',
21
20
  to: undefined,
@@ -64,12 +63,8 @@ function onClick(event: MouseEvent) {
64
63
  'w-full': fullWidth,
65
64
  'bg-transparent shadow-none': light,
66
65
  'shadow-sm': !light,
67
- 'rounded-none': rounded === 'none' && !circular,
68
- 'rounded-sm': rounded === 'sm' && !circular,
69
- 'rounded': rounded === 'base' && !circular,
70
- 'rounded-md': rounded === 'md' && !circular,
71
- 'rounded-lg': rounded === 'lg' && !circular,
72
- 'rounded-full': rounded === 'full' || circular,
66
+ 'rounded-lg': !circular,
67
+ 'rounded-full': circular,
73
68
  'h-6 w-6': size === '2xs' && circular,
74
69
  'h-8 w-8': size === 'xs' && circular && !confirming,
75
70
  'h-10 w-10': size === 'sm' && circular && !confirming,
@@ -79,21 +74,21 @@ function onClick(event: MouseEvent) {
79
74
  'border-gray-900 dark:border-gray-100 bg-gray-900 dark:bg-gray-100 text-white dark:text-black': color === 'black' && !light,
80
75
  'hover:bg-black dark:hover:bg-white hover:text-white dark:hover:text-black': color === 'black' && !light && !disabled && !loading,
81
76
  'border-gray-900 dark:border-gray-100 text-gray-900 dark:text-gray-100': color === 'black' && light,
82
- 'border-gray-700 dark:border-gray-300 bg-gray-700 dark:bg-gray-300 text-white dark:text-black': color === 'gray' && !light,
83
- 'hover:bg-gray-800 dark:hover:bg-gray-200': color === 'gray' && !light && !disabled && !loading,
84
- 'border-gray-700 dark:border-gray-300 text-gray-700 dark:text-gray-300': color === 'gray' && light,
85
- 'border-green-700 dark:border-green-300 bg-green-700 dark:bg-green-300 text-white dark:text-black': color === 'green' && !light,
86
- 'hover:bg-green-800 dark:hover:bg-green-200': color === 'green' && !light && !disabled && !loading,
87
- 'border-green-700 dark:border-green-300 text-green-700 dark:text-green-300': color === 'green' && light,
88
- 'border-indigo-700 dark:border-indigo-300 bg-indigo-700 dark:bg-indigo-300 text-white dark:text-black': color === 'indigo' && !light,
89
- 'hover:bg-indigo-800 dark:hover:bg-indigo-200': color === 'indigo' && !light && !disabled && !loading,
90
- 'border-indigo-700 dark:border-indigo-300 text-indigo-700 dark:text-indigo-300': color === 'indigo' && light,
91
- 'border-orange-700 dark:border-orange-300 bg-orange-700 dark:bg-orange-300 text-white dark:text-black': color === 'orange' && !light,
92
- 'hover:bg-orange-800 dark:hover:bg-orange-200': color === 'orange' && !light && !disabled && !loading,
93
- 'border-orange-700 dark:border-orange-300 text-orange-700 dark:text-orange-300': color === 'orange' && light,
94
- 'border-red-700 dark:border-red-300 bg-red-700 dark:bg-red-300 text-white dark:text-black': color === 'red' && !light,
95
- 'hover:bg-red-800 dark:hover:bg-red-200': color === 'red' && !light && !disabled && !loading,
96
- 'border-red-700 dark:border-red-300 text-red-700 dark:text-red-300': color === 'red' && light,
77
+ 'border-gray-800 dark:border-gray-200 bg-gray-800 dark:bg-gray-200 text-white dark:text-black': color === 'gray' && !light,
78
+ 'hover:bg-gray-900 dark:hover:bg-gray-100': color === 'gray' && !light && !disabled && !loading,
79
+ 'border-gray-800 dark:border-gray-200 text-gray-800 dark:text-gray-200': color === 'gray' && light,
80
+ 'border-green-800 dark:border-green-200 bg-green-800 dark:bg-green-200 text-white dark:text-black': color === 'green' && !light,
81
+ 'hover:bg-green-900 dark:hover:bg-green-100': color === 'green' && !light && !disabled && !loading,
82
+ 'border-green-800 dark:border-green-200 text-green-800 dark:text-green-200': color === 'green' && light,
83
+ 'border-indigo-800 dark:border-indigo-200 bg-indigo-800 dark:bg-indigo-200 text-white dark:text-black': color === 'indigo' && !light,
84
+ 'hover:bg-indigo-900 dark:hover:bg-indigo-100': color === 'indigo' && !light && !disabled && !loading,
85
+ 'border-indigo-800 dark:border-indigo-200 text-indigo-800 dark:text-indigo-200': color === 'indigo' && light,
86
+ 'border-orange-800 dark:border-orange-200 bg-orange-800 dark:bg-orange-200 text-white dark:text-black': color === 'orange' && !light,
87
+ 'hover:bg-orange-900 dark:hover:bg-orange-100': color === 'orange' && !light && !disabled && !loading,
88
+ 'border-orange-800 dark:border-orange-200 text-orange-800 dark:text-orange-200': color === 'orange' && light,
89
+ 'border-red-800 dark:border-red-200 bg-red-800 dark:bg-red-200 text-white dark:text-black': color === 'red' && !light,
90
+ 'hover:bg-red-900 dark:hover:bg-red-100': color === 'red' && !light && !disabled && !loading,
91
+ 'border-red-800 dark:border-red-200 text-red-800 dark:text-red-200': color === 'red' && light,
97
92
  'border-gray-300 dark:border-gray-700 bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100': color === 'white' && !light,
98
93
  'hover:bg-white dark:hover:bg-gray-900': color === 'white' && !light && !disabled && !loading,
99
94
  'border-white dark:border-gray-900 text-white dark:text-black': color === 'white' && light,
@@ -87,7 +87,6 @@ function onOpenFilePicker() {
87
87
  'rounded-lg border border-gray-200 shadow-sm dark:border-gray-800': border === 'full',
88
88
  'border-b border-gray-200 dark:border-gray-800': border === 'bottom',
89
89
  'border-0': border === 'none',
90
- 'text-2xs h-8': size === 'xs',
91
90
  'text-xs h-10': size === 'sm',
92
91
  'text-sm h-12': size === 'base',
93
92
  'text-base h-14': size === 'lg',
@@ -104,14 +103,13 @@ function onOpenFilePicker() {
104
103
  v-if="loading"
105
104
  class="flex shrink-0 items-center justify-center"
106
105
  :class="{
107
- 'h-7 w-7': size === 'xs',
108
106
  'h-8 w-8': size === 'sm',
109
107
  'h-9 w-9': size === 'base',
110
108
  'h-10 w-10': size === 'lg',
111
109
  }"
112
110
  >
113
111
  <BaseSpinner
114
- :size="size === 'xs' ? 'sm' : size === 'sm' ? 'base' : size === 'base' ? 'lg' : 'xl'"
112
+ :size="size === 'sm' ? 'base' : size === 'base' ? 'lg' : 'xl'"
115
113
  />
116
114
  </div>
117
115
 
@@ -120,7 +118,6 @@ function onOpenFilePicker() {
120
118
  :border-width="2"
121
119
  class="shrink-0"
122
120
  :class="{
123
- 'h-7 w-7': size === 'xs',
124
121
  'h-8 w-8': size === 'sm',
125
122
  'h-9 w-9': size === 'base',
126
123
  'h-10 w-10': size === 'lg',
@@ -131,7 +128,7 @@ function onOpenFilePicker() {
131
128
 
132
129
  <BaseText
133
130
  class="min-w-0 flex-1 text-gray-900 dark:text-gray-100"
134
- :size="({ base: 'sm', lg: 'base', sm: 'xs', xs: '2xs' } as const)[size]"
131
+ :size="({ base: 'sm', lg: 'base', sm: 'xs' } as const)[size]"
135
132
  :text="loading ? t('actionLoading') : (action || t('action'))"
136
133
  />
137
134
  </div>
@@ -52,7 +52,6 @@ const modelValue = defineModel<FieldCheckbox['modelValue']>({ default: false })
52
52
  'border-gray-300 dark:border-gray-600': !modelValue,
53
53
  'group-hover:border-gray-400 dark:group-hover:border-gray-500': !disabled && !modelValue,
54
54
  'group-hover:border-indigo-700 dark:group-hover:border-indigo-300': !disabled && modelValue,
55
- 'h-3.5 w-3.5': size === 'xs',
56
55
  'h-4 w-4': size === 'sm',
57
56
  'h-4.5 w-4.5': size === 'base',
58
57
  'h-5 w-5': size === 'lg',
@@ -64,7 +63,6 @@ const modelValue = defineModel<FieldCheckbox['modelValue']>({ default: false })
64
63
  :name="getLayerIcon('check')"
65
64
  class="shrink-0 text-gray-900 dark:text-white"
66
65
  :class="{
67
- 'size-2': size === 'xs',
68
66
  'size-2.5': size === 'sm',
69
67
  'size-3': size === 'base',
70
68
  'size-3.5': size === 'lg',
@@ -46,10 +46,8 @@ const id = useId()
46
46
  const modelValue = defineModel<FieldInput['modelValue']>({ default: '' })
47
47
  const input = ref<HTMLInputElement>()
48
48
  const showPassword = ref(false)
49
- const { isDesktopBrowser } = useDevice()
50
-
51
49
  onMounted(() => {
52
- if (props.autofocus && input.value && isDesktopBrowser.value) {
50
+ if (props.autofocus && input.value) {
53
51
  input.value.focus()
54
52
  }
55
53
  })
@@ -166,7 +164,6 @@ defineExpose({ focus })
166
164
  <div
167
165
  class="flex items-center"
168
166
  :class="{
169
- 'h-8': size === 'xs',
170
167
  'h-10': size === 'sm',
171
168
  'h-12': size === 'base',
172
169
  'h-14': size === 'lg',
@@ -200,7 +197,6 @@ defineExpose({ focus })
200
197
  'px-10': border === 'bottom' && type !== 'password',
201
198
  'border-0 p-0': border === 'none' && type !== 'password',
202
199
  'border-0 pr-9': border === 'none' && type === 'password',
203
- 'text-2xs': size === 'xs',
204
200
  'text-xs': size === 'sm',
205
201
  'text-sm': size === 'base',
206
202
  'text-base': size === 'lg',
@@ -29,8 +29,6 @@ const textSize = computed<BaseSize>(() => {
29
29
  return 'base'
30
30
  case 'sm':
31
31
  return 'xs'
32
- case 'xs':
33
- return '2xs'
34
32
  default:
35
33
  return 'sm'
36
34
  }
@@ -71,11 +69,9 @@ function onKeyDown(event: KeyboardEvent) {
71
69
  'text-gray-500 dark:text-gray-500 line-through': lineThrough,
72
70
  'hover:text-black dark:hover:text-white': isClickable && !lineThrough,
73
71
  'w-0 truncate': truncate,
74
- 'mb-1.5': size === 'xs' && hasMarginBottom,
75
72
  'mb-2': size === 'sm' && hasMarginBottom,
76
73
  'mb-2.5': size === 'base' && hasMarginBottom,
77
74
  'mb-3': size === 'lg' && hasMarginBottom,
78
- 'ml-1': size === 'xs' && hasMarginLeft,
79
75
  'ml-1.5': size === 'sm' && hasMarginLeft,
80
76
  'ml-2': size === 'base' && hasMarginLeft,
81
77
  'ml-2.5': size === 'lg' && hasMarginLeft,
@@ -127,8 +127,6 @@ const textSize = computed<BaseSize>(() => {
127
127
  return 'sm'
128
128
  case 'sm':
129
129
  return 'xs'
130
- case 'xs':
131
- return '2xs'
132
130
  default:
133
131
  return 'xs'
134
132
  }
@@ -141,7 +139,6 @@ const textSize = computed<BaseSize>(() => {
141
139
  class="text-left tracking-tighter"
142
140
  :class="{
143
141
  'field-disabled': disabled,
144
- 'mt-2': size === 'xs',
145
142
  'mt-2.5': size === 'sm',
146
143
  'mt-3': size === 'base',
147
144
  'mt-3.5': size === 'lg',
@@ -221,7 +221,6 @@ function selectOption(event: MouseEvent, value: string) {
221
221
  'hover:border-gray-300 dark:hover:border-gray-700': !opened && !disabled,
222
222
  'focus-visible:border-gray-400 dark:focus-visible:border-gray-600': !disabled,
223
223
  'px-3': padding,
224
- 'text-2xs h-8': size === 'xs',
225
224
  'text-xs h-10': size === 'sm',
226
225
  'text-sm h-12': size === 'base',
227
226
  'text-base h-14': size === 'lg',
@@ -280,11 +279,11 @@ function selectOption(event: MouseEvent, value: string) {
280
279
  class="options min-w-xs overflow-y-auto border border-gray-400 rounded-lg bg-white text-gray-600 font-medium dark:border-gray-600 dark:bg-gray-900 dark:text-gray-400"
281
280
  :class="{
282
281
  'md:min-w-xl p-1 pb-0': computedColumns.length >= 2,
283
- 'mt-8': ['xs', 'sm'].includes(size) && !padding && direction === 'bottom',
284
- 'mt-10': ((['xs', 'sm'].includes(size) && padding) || (size === 'base' && !padding)) && direction === 'bottom',
282
+ 'mt-8': size === 'sm' && !padding && direction === 'bottom',
283
+ 'mt-10': ((size === 'sm' && padding) || (size === 'base' && !padding)) && direction === 'bottom',
285
284
  'mt-12': size === 'base' && padding && direction === 'bottom',
286
- 'mb-8': ['xs', 'sm'].includes(size) && !padding && direction === 'top',
287
- 'mb-10': ((['xs', 'sm'].includes(size) && padding) || (size === 'base' && !padding)) && direction === 'top',
285
+ 'mb-8': size === 'sm' && !padding && direction === 'top',
286
+ 'mb-10': ((size === 'sm' && padding) || (size === 'base' && !padding)) && direction === 'top',
288
287
  'mb-12': size === 'base' && padding && direction === 'top',
289
288
  'max-h-xs': maxHeight === 'xs',
290
289
  'max-h-sm': maxHeight === 'sm',
@@ -38,7 +38,7 @@ function onTabClick(event: MouseEvent, tabValue: string) {
38
38
  :class="{
39
39
  'field-disabled': disabled,
40
40
  'gap-0 border-b border-gray-300 dark:border-gray-700 bg-gray-100 dark:bg-gray-900': theme === 'border',
41
- 'gap-2 rounded-lg bg-gray-200 dark:bg-gray-800 p-0.5 sm:p-1': theme === 'rounded',
41
+ 'gap-2 rounded-lg bg-gray-200 dark:bg-gray-800 p-0.5': theme === 'rounded',
42
42
  }"
43
43
  >
44
44
  <component
@@ -51,15 +51,13 @@ function onTabClick(event: MouseEvent, tabValue: string) {
51
51
  'flex-col': orientation === 'vertical',
52
52
  'text-gray-900 dark:text-gray-100': isTabActive(tab.value),
53
53
  'text-gray-700 dark:text-gray-300 hover:text-gray-900 dark:hover:text-gray-100': !isTabActive(tab.value) && !disabled,
54
- 'py-1 px-2.5 sm:py-1.5': size === 'xs' && theme === 'rounded' && orientation === 'responsive',
55
- 'py-1.5 px-3 sm:py-2': size === 'sm' && theme === 'rounded' && orientation === 'responsive',
56
- 'py-2 px-3.5 sm:py-2.5': (size === 'base' && theme === 'rounded' || size === 'xs' && theme === 'border') && orientation === 'responsive',
57
- 'py-2.5 px-4 sm:py-3': (size === 'lg' && theme === 'rounded' || size === 'sm' && theme === 'border') && orientation === 'responsive',
58
- 'py-3 px-4.5 sm:py-3.5': size === 'base' && theme === 'border' && orientation === 'responsive',
59
- 'py-3.5 px-5 sm:py-4': size === 'lg' && theme === 'border' && orientation === 'responsive',
60
- 'py-1.5 px-2.5': size === 'xs' && theme === 'rounded' && orientation !== 'responsive',
54
+ 'py-1 px-3 sm:py-2': size === 'sm' && theme === 'rounded' && orientation === 'responsive',
55
+ 'py-1.5 px-3.5 sm:py-2.5': size === 'base' && theme === 'rounded' && orientation === 'responsive',
56
+ 'py-2 px-4 sm:py-3': (size === 'lg' && theme === 'rounded' || size === 'sm' && theme === 'border') && orientation === 'responsive',
57
+ 'py-2.5 px-4.5 sm:py-3.5': size === 'base' && theme === 'border' && orientation === 'responsive',
58
+ 'py-3 px-5 sm:py-4': size === 'lg' && theme === 'border' && orientation === 'responsive',
61
59
  'py-2 px-3': size === 'sm' && theme === 'rounded' && orientation !== 'responsive',
62
- 'py-2.5 px-3.5': (size === 'base' && theme === 'rounded' || size === 'xs' && theme === 'border') && orientation !== 'responsive',
60
+ 'py-2.5 px-3.5': size === 'base' && theme === 'rounded' && orientation !== 'responsive',
63
61
  'py-3 px-4': (size === 'lg' && theme === 'rounded' || size === 'sm' && theme === 'border') && orientation !== 'responsive',
64
62
  'py-3.5 px-4.5': size === 'base' && theme === 'border' && orientation !== 'responsive',
65
63
  'py-4 px-5': size === 'lg' && theme === 'border' && orientation !== 'responsive',
@@ -30,10 +30,8 @@ const emit = defineEmits<{
30
30
  const id = useId()
31
31
  const modelValue = defineModel<FieldTextarea['modelValue']>({ default: '' })
32
32
  const textarea = ref<HTMLTextAreaElement>()
33
- const { isDesktopBrowser } = useDevice()
34
-
35
33
  onMounted(() => {
36
- if (props.autofocus && textarea.value && isDesktopBrowser.value) {
34
+ if (props.autofocus && textarea.value) {
37
35
  textarea.value.focus()
38
36
  }
39
37
  })
@@ -81,7 +79,6 @@ function onFieldClick(event: MouseEvent) {
81
79
  'border shadow-sm border-gray-200 dark:border-gray-800': border,
82
80
  'hover:border-gray-300 dark:hover:border-gray-700 focus:border-gray-400 dark:focus:border-gray-600': border && !disabled,
83
81
  'border-0': !border,
84
- 'text-2xs': size === 'xs',
85
82
  'text-xs': size === 'sm',
86
83
  'text-sm': size === 'base',
87
84
  'text-base': size === 'lg',
@@ -61,7 +61,6 @@ function onFieldBlur(event: FocusEvent) {
61
61
  'focus-within:border-gray-400 hover:border-gray-300 dark:focus-within:border-gray-600 dark:hover:border-gray-700': !disabled,
62
62
  'bg-gray-100 dark:bg-gray-900': background === 'gray',
63
63
  'bg-white dark:bg-gray-900': background === 'white',
64
- 'text-2xs h-8': size === 'xs',
65
64
  'text-xs h-10': size === 'sm',
66
65
  'text-sm h-12': size === 'base',
67
66
  'text-base h-14': size === 'lg',
@@ -60,22 +60,12 @@ export interface BaseButton {
60
60
  light?: boolean
61
61
  loading?: boolean
62
62
  reverse?: boolean
63
- rounded?: BaseButtonRounded
64
63
  size?: BaseButtonSize
65
64
  text?: BaseTextText
66
65
  to?: RouteLocationNamedI18n
67
66
  type?: BaseButtonType
68
67
  }
69
68
 
70
- export type BaseButtonRounded
71
- = | 'base'
72
- | 'full'
73
- | 'lg'
74
- | 'md'
75
- | 'none'
76
- | 'sm'
77
- | 'xl'
78
-
79
69
  export type BaseButtonSize
80
70
  = | '2xs'
81
71
  | 'base'
@@ -155,7 +155,7 @@ export interface FieldSelectOption {
155
155
  value: string
156
156
  }
157
157
 
158
- export type FieldSize = 'base' | 'lg' | 'sm' | 'xs'
158
+ export type FieldSize = 'base' | 'lg' | 'sm'
159
159
 
160
160
  export type FieldStatus
161
161
  = | 'default'
@@ -24,7 +24,6 @@ declare global {
24
24
  type BaseBordered = import('./bases').BaseBordered
25
25
  type BaseBorderedColor = import('./bases').BaseBorderedColor
26
26
  type BaseButton = import('./bases').BaseButton
27
- type BaseButtonRounded = import('./bases').BaseButtonRounded
28
27
  type BaseButtonSize = import('./bases').BaseButtonSize
29
28
  type BaseButtonType = import('./bases').BaseButtonType
30
29
  type BaseCard = import('./bases').BaseCard
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saasmakers/ui",
3
- "version": "2.0.14",
3
+ "version": "2.0.16",
4
4
  "private": false,
5
5
  "description": "Reusable Nuxt UI components for SaaS Makers projects",
6
6
  "license": "MIT",
@@ -60,8 +60,8 @@
60
60
  "devDependencies": {
61
61
  "nuxt": "4.3.1",
62
62
  "typescript": "5.9.3",
63
- "@saasmakers/apps-helpers": "0.1.0",
64
- "@saasmakers/shared": "0.2.8"
63
+ "@saasmakers/shared": "0.2.8",
64
+ "@saasmakers/apps-helpers": "0.1.0"
65
65
  },
66
66
  "peerDependencies": {
67
67
  "@saasmakers/apps-helpers": "^0.1.0",