@saasmakers/ui 2.0.44 → 2.0.46

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.
@@ -100,6 +100,19 @@ const selectedOption = computed(() => {
100
100
  })
101
101
  })
102
102
 
103
+ const textSize = computed<BaseSize>(() => {
104
+ switch (props.size) {
105
+ case 'base':
106
+ return 'sm'
107
+ case 'lg':
108
+ return 'base'
109
+ case 'sm':
110
+ return 'xs'
111
+ default:
112
+ return 'sm'
113
+ }
114
+ })
115
+
103
116
  watch(opened, (isOpened) => {
104
117
  if (isOpened && props.searchable) {
105
118
  nextTick(() => {
@@ -266,6 +279,7 @@ function selectOption(event: MouseEvent, value: string) {
266
279
  :class="{ 'mr-2': !hideLabel && !square }"
267
280
  :color="selectedOption.iconColor"
268
281
  :icon="selectedOption.icon"
282
+ :size="textSize"
269
283
  />
270
284
 
271
285
  <span
@@ -351,7 +365,7 @@ function selectOption(event: MouseEvent, value: string) {
351
365
  class="pointer-events-none"
352
366
  color="gray"
353
367
  :icon="getLayerIcon('infoCircle')"
354
- :size="size"
368
+ :size="textSize"
355
369
  :text="t('noResults')"
356
370
  />
357
371
  </div>
@@ -371,7 +385,10 @@ function selectOption(event: MouseEvent, value: string) {
371
385
  :key="option.value"
372
386
  class="flex cursor-pointer items-center outline-none"
373
387
  :class="{
374
- 'base-border-b p-3 hover:bg-gray-100 dark:hover:bg-gray-800 last:border-b-0': computedColumns.length < 2,
388
+ 'base-border-b px-3 hover:bg-gray-100 dark:hover:bg-gray-800 last:border-b-0': computedColumns.length < 2,
389
+ 'h-10': size === 'sm' && computedColumns.length < 2,
390
+ 'h-12': size === 'base' && computedColumns.length < 2,
391
+ 'h-14': size === 'lg' && computedColumns.length < 2,
375
392
  'px-2 py-1 hover:bg-gray-100 dark:hover:bg-gray-800 last:mb-2': computedColumns.length >= 2,
376
393
  'font-medium underline': option.value === selectedOption?.value,
377
394
  'text-gray-900 dark:text-gray-100': option.value === selectedOption?.value,
@@ -401,7 +418,7 @@ function selectOption(event: MouseEvent, value: string) {
401
418
  class="pointer-events-none mr-2 flex-initial"
402
419
  :color="option.iconColor"
403
420
  :icon="option.icon"
404
- :size="size"
421
+ :size="textSize"
405
422
  :text="option.text"
406
423
  />
407
424
  </div>
@@ -74,6 +74,7 @@ export default function useToast() {
74
74
  }
75
75
 
76
76
  toasts.value.push(toast)
77
+
77
78
  scheduleDismiss(toast.id, {
78
79
  durationMs: params.durationMs,
79
80
  hasAction: !!params.action,
@@ -106,6 +107,17 @@ function closeToast(toastId: string) {
106
107
  toasts.value = toasts.value.filter(item => item.id !== toastId)
107
108
  }
108
109
 
110
+ function getDismissDuration(params: {
111
+ durationMs?: number
112
+ hasAction: boolean
113
+ }): number {
114
+ if (params.durationMs !== undefined) {
115
+ return params.durationMs
116
+ }
117
+
118
+ return (params.hasAction ? 8 : 5) * 1000
119
+ }
120
+
109
121
  function getFingerprint(params: {
110
122
  actionLabel?: BaseTextText
111
123
  emoji?: string
@@ -130,17 +142,6 @@ function getFingerprint(params: {
130
142
  return parts.join(':')
131
143
  }
132
144
 
133
- function getDismissDuration(params: {
134
- durationMs?: number
135
- hasAction: boolean
136
- }): number {
137
- if (params.durationMs !== undefined) {
138
- return params.durationMs
139
- }
140
-
141
- return (params.hasAction ? 8 : 5) * 1000
142
- }
143
-
144
145
  function scheduleDismiss(toastId: string, params: {
145
146
  durationMs?: number
146
147
  hasAction: boolean
package/nuxt.config.ts CHANGED
@@ -140,13 +140,6 @@ export default defineNuxtConfig({
140
140
  },
141
141
 
142
142
  unocss: {
143
- content: {
144
- // Force consumers to scan layer classes even when resolved from node_modules,
145
- // otherwise transition utilities used only here are purged during their prod build.
146
- filesystem: [
147
- path.join(currentDir, 'app/**/*.{vue,ts}'),
148
- ],
149
- },
150
143
  nuxtLayers: true,
151
144
  presets: uno.presets,
152
145
  rules: uno.rules,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saasmakers/ui",
3
- "version": "2.0.44",
3
+ "version": "2.0.46",
4
4
  "private": false,
5
5
  "description": "Reusable Nuxt UI components for SaaS Makers projects",
6
6
  "license": "MIT",