@polymarbot/nuxt-layer-shadcn-ui 0.3.6 → 0.3.8

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.
@@ -1 +1,2 @@
1
- @import './z-index.css';
1
+ @import './z-index.css';
2
+ @import './overlay.css';
@@ -0,0 +1,19 @@
1
+ /* =========================================================================
2
+ * Portal-rendered overlays — visual overrides
3
+ * -------------------------------------------------------------------------
4
+ * Reka UI portals (Dialog, Sheet) render their overlays OUTSIDE each
5
+ * component's DOM scope, so styling must use non-scoped selectors. Shared
6
+ * here so Modal and Drawer keep a consistent translucent blur backdrop.
7
+ * ========================================================================= */
8
+
9
+ [data-slot='dialog-overlay'],
10
+ [data-slot='sheet-overlay'] {
11
+ background-color: rgba(252, 252, 252, 0.3);
12
+ backdrop-filter: blur(2px);
13
+ -webkit-backdrop-filter: blur(2px);
14
+ }
15
+
16
+ .dark [data-slot='dialog-overlay'],
17
+ .dark [data-slot='sheet-overlay'] {
18
+ background-color: rgba(25, 25, 25, 0.3);
19
+ }
@@ -14,7 +14,8 @@
14
14
  [data-slot='dialog-overlay'],
15
15
  [data-slot='dialog-content'],
16
16
  [data-slot='sheet-overlay'],
17
- [data-slot='sheet-content'] {
17
+ [data-slot='sheet-content'],
18
+ [data-slot='sidebar'][data-mobile='true'] {
18
19
  z-index: 200;
19
20
  }
20
21
 
@@ -15,6 +15,7 @@ const meta = {
15
15
  confirmDisabled: { control: 'boolean' },
16
16
  showCancel: { control: 'boolean' },
17
17
  showClose: { control: 'boolean' },
18
+ closeOnClickOutside: { control: 'boolean' },
18
19
  hideHeader: { control: 'boolean' },
19
20
  hideFooter: { control: 'boolean' },
20
21
  side: { control: 'select', options: sides },
@@ -29,6 +30,7 @@ const meta = {
29
30
  confirmDisabled: false,
30
31
  showCancel: true,
31
32
  showClose: true,
33
+ closeOnClickOutside: false,
32
34
  hideHeader: false,
33
35
  hideFooter: false,
34
36
  side: 'right',
@@ -12,6 +12,7 @@ import type { DrawerProps } from './types'
12
12
 
13
13
  const props = withDefaults(defineProps<DrawerProps>(), {
14
14
  showClose: true,
15
+ closeOnClickOutside: false,
15
16
  side: 'right',
16
17
  title: undefined,
17
18
  description: undefined,
@@ -64,6 +65,10 @@ function onCancel () {
64
65
  emit('update:visible', false)
65
66
  }
66
67
 
68
+ function onPointerDownOutside (event: Event) {
69
+ if (!props.closeOnClickOutside) event.preventDefault()
70
+ }
71
+
67
72
  const contentClass = computed(() =>
68
73
  cn('bg-popover gap-0 p-0 flex flex-col', props.class),
69
74
  )
@@ -74,7 +79,7 @@ const contentClass = computed(() =>
74
79
  <SheetContent
75
80
  :side="side"
76
81
  :class="contentClass"
77
- @pointerDownOutside.prevent
82
+ @pointerDownOutside="onPointerDownOutside"
78
83
  @closeAutoFocus="emit('closed')"
79
84
  >
80
85
  <!-- Header -->
@@ -173,17 +178,6 @@ const contentClass = computed(() =>
173
178
  </template>
174
179
 
175
180
  <style>
176
- /* Translucent blur backdrop. SheetOverlay is rendered inside DialogPortal
177
- (outside component scope), so use a non-scoped style. */
178
- [data-slot='sheet-overlay'] {
179
- background-color: rgba(252, 252, 252, 0.3);
180
- backdrop-filter: blur(2px);
181
- -webkit-backdrop-filter: blur(2px);
182
- }
183
- .dark [data-slot='sheet-overlay'] {
184
- background-color: rgba(25, 25, 25, 0.3);
185
- }
186
-
187
181
  /* Hide SheetContent's hardcoded built-in close button (no data-slot);
188
182
  we render our own SheetClose above with loading-aware disable. */
189
183
  [data-slot='sheet-content'] > button:not([data-slot]) {
@@ -9,6 +9,7 @@ export interface DrawerProps {
9
9
  confirmDisabled?: boolean
10
10
  showCancel?: boolean
11
11
  showClose?: boolean
12
+ closeOnClickOutside?: boolean
12
13
  hideHeader?: boolean
13
14
  hideFooter?: boolean
14
15
  side?: DrawerSide
@@ -15,6 +15,7 @@ const meta = {
15
15
  confirmDisabled: { control: 'boolean' },
16
16
  showCancel: { control: 'boolean' },
17
17
  showClose: { control: 'boolean' },
18
+ closeOnClickOutside: { control: 'boolean' },
18
19
  hideHeader: { control: 'boolean' },
19
20
  hideFooter: { control: 'boolean' },
20
21
  alignCenter: { control: 'boolean' },
@@ -30,6 +31,7 @@ const meta = {
30
31
  confirmDisabled: false,
31
32
  showCancel: true,
32
33
  showClose: true,
34
+ closeOnClickOutside: false,
33
35
  hideHeader: false,
34
36
  hideFooter: false,
35
37
  alignCenter: false,
@@ -12,6 +12,7 @@ import type { ModalProps } from './types'
12
12
 
13
13
  const props = withDefaults(defineProps<ModalProps>(), {
14
14
  showClose: true,
15
+ closeOnClickOutside: false,
15
16
  title: undefined,
16
17
  description: undefined,
17
18
  confirmText: undefined,
@@ -65,6 +66,10 @@ function onCancel () {
65
66
  emit('update:visible', false)
66
67
  }
67
68
 
69
+ function onPointerDownOutside (event: Event) {
70
+ if (!props.closeOnClickOutside) event.preventDefault()
71
+ }
72
+
68
73
  const contentClass = computed(() =>
69
74
  cn(
70
75
  'bg-popover gap-0 py-0',
@@ -79,7 +84,7 @@ const contentClass = computed(() =>
79
84
  <DialogContent
80
85
  :class="contentClass"
81
86
  :showCloseButton="false"
82
- @pointerDownOutside.prevent
87
+ @pointerDownOutside="onPointerDownOutside"
83
88
  @closeAutoFocus="emit('closed')"
84
89
  >
85
90
  <!-- Header -->
@@ -183,16 +188,3 @@ const contentClass = computed(() =>
183
188
  </DialogContent>
184
189
  </Dialog>
185
190
  </template>
186
-
187
- <style>
188
- /* Translucent blur backdrop. DialogOverlay is rendered inside DialogPortal
189
- (outside component scope), so use a non-scoped style. */
190
- [data-slot='dialog-overlay'] {
191
- background-color: rgba(252, 252, 252, 0.3);
192
- backdrop-filter: blur(2px);
193
- -webkit-backdrop-filter: blur(2px);
194
- }
195
- .dark [data-slot='dialog-overlay'] {
196
- background-color: rgba(25, 25, 25, 0.3);
197
- }
198
- </style>
@@ -8,6 +8,7 @@ export interface ModalProps {
8
8
  confirmDisabled?: boolean
9
9
  showCancel?: boolean
10
10
  showClose?: boolean
11
+ closeOnClickOutside?: boolean
11
12
  hideHeader?: boolean
12
13
  hideFooter?: boolean
13
14
  alignCenter?: boolean
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@polymarbot/nuxt-layer-shadcn-ui",
3
- "version": "0.3.6",
3
+ "version": "0.3.8",
4
4
  "description": "Nuxt layer providing shadcn-vue based UI components",
5
5
  "type": "module",
6
6
  "main": "./nuxt.config.ts",
@@ -42,5 +42,5 @@
42
42
  "vue-i18n": "^11",
43
43
  "vue-router": "^4 || ^5"
44
44
  },
45
- "gitHead": "1cab3200649169317e33b3677a1ad906b6ba4683"
45
+ "gitHead": "3377868984c2e309b5be71fa54f5f6f354b4ffa6"
46
46
  }