@polymarbot/nuxt-layer-shadcn-ui 0.5.2 → 0.5.3

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.
@@ -6,7 +6,7 @@ defineProps<BadgeProps>()
6
6
  </script>
7
7
 
8
8
  <template>
9
- <ShadcnBadge>
9
+ <ShadcnBadge :variant="variant">
10
10
  <slot />
11
11
  </ShadcnBadge>
12
12
  </template>
@@ -1,5 +1,7 @@
1
1
  import type { BadgeVariants } from '../../shadcn/badge'
2
2
 
3
- export type BadgeVariant = NonNullable<BadgeVariants['variant']>
3
+ export type BadgeVariant = BadgeVariants['variant']
4
4
 
5
- export interface BadgeProps extends /* @vue-ignore */ BadgeVariants {}
5
+ export interface BadgeProps {
6
+ variant?: BadgeVariant
7
+ }
@@ -4,9 +4,13 @@ import WebLink from '@polymarbot/nuxt-layer-shadcn-ui/app/components/ui/WebLink/
4
4
  import type { ButtonProps } from './types'
5
5
 
6
6
  const props = defineProps<ButtonProps>()
7
- const mergedClass = computed(() => cn('cursor-pointer', props.rounded && `
8
- rounded-full
9
- `, props.class))
7
+ const isTransparentHover = computed(() => props.variant === 'outline' || props.variant === 'ghost')
8
+ const mergedClass = computed(() => cn(
9
+ 'cursor-pointer',
10
+ isTransparentHover.value && 'hover:bg-accent/50',
11
+ props.rounded && 'rounded-full',
12
+ props.class,
13
+ ))
10
14
 
11
15
  const isLink = computed(() => !!props.href || !!props.to)
12
16
  const hasIcon = computed(() => !!$slots.icon || !!props.icon)
@@ -19,6 +23,8 @@ const $slots = defineSlots<{
19
23
 
20
24
  <template>
21
25
  <ShadcnButton
26
+ :variant="variant"
27
+ :size="size"
22
28
  :class="mergedClass"
23
29
  :asChild="isLink"
24
30
  :type="isLink ? undefined : 'button'"
@@ -1,10 +1,12 @@
1
1
  import type { ButtonVariants } from '../../shadcn/button'
2
2
  import type { RouteLocationRaw } from 'vue-router'
3
3
 
4
- export type ButtonVariant = NonNullable<ButtonVariants['variant']>
5
- export type ButtonSize = NonNullable<ButtonVariants['size']>
4
+ export type ButtonVariant = ButtonVariants['variant']
5
+ export type ButtonSize = ButtonVariants['size']
6
6
 
7
- export interface ButtonProps extends /* @vue-ignore */ ButtonVariants {
7
+ export interface ButtonProps {
8
+ variant?: ButtonVariant
9
+ size?: ButtonSize
8
10
  loading?: boolean
9
11
  disabled?: boolean
10
12
  rounded?: boolean
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@polymarbot/nuxt-layer-shadcn-ui",
3
- "version": "0.5.2",
3
+ "version": "0.5.3",
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": "1cee179e4b0678c75dd8293d0274ec2afb8d9143"
45
+ "gitHead": "79d1ad5f798390469ac3cdfa7aed7ddc530a6c1e"
46
46
  }