@saasmakers/ui 2.0.72 → 2.0.74

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.
@@ -79,8 +79,8 @@ function onClick(event: MouseEvent) {
79
79
  'cursor-wait': loading,
80
80
  'cursor-pointer': !loading,
81
81
  'w-full': fullWidth,
82
- 'bg-transparent shadow-none': light,
83
- 'shadow-sm': !light,
82
+ 'bg-transparent shadow-none': light && color !== 'gray',
83
+ 'shadow-sm': !light || color === 'gray',
84
84
  'rounded-lg': shape !== 'circle',
85
85
  'rounded-full': shape === 'circle',
86
86
  'h-10 w-10': size === 'sm' && hasFixedSize && !confirming,
@@ -91,7 +91,8 @@ function onClick(event: MouseEvent) {
91
91
  'border-gray-900 dark:border-gray-100 text-gray-900 dark:text-gray-100': color === 'black' && light,
92
92
  'border-gray-800 dark:border-gray-200 bg-gray-800 dark:bg-gray-200 text-white dark:text-black': color === 'gray' && !light,
93
93
  'hover:bg-gray-900 dark:hover:bg-gray-100': color === 'gray' && !light && !disabled && !loading,
94
- 'border-gray-800 dark:border-gray-200 text-gray-800 dark:text-gray-200': color === 'gray' && light,
94
+ 'border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100': color === 'gray' && light,
95
+ 'hover:border-gray-300 dark:hover:border-gray-700': color === 'gray' && light && !disabled && !loading,
95
96
  'border-green-800 dark:border-green-200 bg-green-800 dark:bg-green-200 text-white dark:text-black': color === 'green' && !light,
96
97
  'hover:bg-green-900 dark:hover:bg-green-100': color === 'green' && !light && !disabled && !loading,
97
98
  'border-green-800 dark:border-green-200 text-green-800 dark:text-green-200': color === 'green' && light,
@@ -107,7 +108,7 @@ function onClick(event: MouseEvent) {
107
108
  'border-gray-300 dark:border-gray-700 bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100': color === 'white' && !light,
108
109
  'hover:bg-white dark:hover:bg-gray-900': color === 'white' && !light && !disabled && !loading,
109
110
  'border-white dark:border-gray-900 text-white dark:text-black': color === 'white' && light,
110
- 'hover:border-black dark:hover:border-white hover:text-black dark:hover:text-white': color !== 'white' && light && !disabled && !loading,
111
+ 'hover:border-black dark:hover:border-white hover:text-black dark:hover:text-white': color !== 'gray' && color !== 'white' && light && !disabled && !loading,
111
112
  'hover:bg-white dark:hover:bg-gray-900 hover:text-gray-800 dark:hover:text-gray-200': color === 'white' && light && !disabled && !loading,
112
113
  'h-10 px-5': size === 'sm' && (!hasFixedSize || confirming),
113
114
  'h-12 px-6': size === 'base' && (!hasFixedSize || confirming),
@@ -1,7 +1,10 @@
1
1
  <script lang="ts" setup>
2
2
  import type { LayoutBottomSheet } from '../../types/layout'
3
3
 
4
- const props = withDefaults(defineProps<LayoutBottomSheet>(), { 'aria-label': undefined })
4
+ const props = withDefaults(defineProps<LayoutBottomSheet>(), {
5
+ 'aria-label': undefined,
6
+ 'closeOnBackdrop': true,
7
+ })
5
8
 
6
9
  defineSlots<{
7
10
  default?: () => VNode[]
@@ -29,6 +32,12 @@ const closeThreshold = computed(() => {
29
32
  return (panelRef.value?.offsetHeight ?? 320) * closeThresholdRatio
30
33
  })
31
34
 
35
+ function onBackdropClick() {
36
+ if (props.closeOnBackdrop) {
37
+ onClose()
38
+ }
39
+ }
40
+
32
41
  function onClose() {
33
42
  visible.value = false
34
43
  }
@@ -182,7 +191,7 @@ watch(visible, (isVisible) => {
182
191
  :drag-transition="!drag.isDragging && (drag.closing || drag.offset > 0)"
183
192
  :opacity="drag.closing ? 0 : drag.offset > 0 ? Math.max(0, 1 - drag.offset / (panelRef?.offsetHeight ?? 320)) : undefined"
184
193
  :transitionless="drag.isDragging"
185
- @click="onClose"
194
+ @click="onBackdropClick"
186
195
  />
187
196
 
188
197
  <ClientOnly>
@@ -12,6 +12,7 @@ export interface LayoutBackdrop {
12
12
 
13
13
  export interface LayoutBottomSheet {
14
14
  'aria-label'?: string
15
+ 'closeOnBackdrop'?: boolean
15
16
  }
16
17
 
17
18
  export interface LayoutModal {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saasmakers/ui",
3
- "version": "2.0.72",
3
+ "version": "2.0.74",
4
4
  "private": false,
5
5
  "description": "Reusable Nuxt UI components for SaaS Makers projects",
6
6
  "license": "MIT",