@spavn/ui 0.0.2 → 0.1.0

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.
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@spavn/ui",
3
- "version": "0.0.2",
3
+ "version": "0.1.0",
4
4
  "description": "Spavn UI - Vue 3 component library with depth-first design",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.js",
8
8
  "types": "./dist/index.d.ts",
9
9
  "bin": {
10
- "spavn-ui": "./cli/dist/index.js",
11
- "spavn-mcp": "./mcp-server/dist/index.js"
10
+ "spavn-ui": "./cli/index.js",
11
+ "spavn-mcp": "./mcp-server/index.js"
12
12
  },
13
13
  "exports": {
14
14
  ".": {
@@ -21,12 +21,12 @@
21
21
  },
22
22
  "./theme.css": "./src/theme.css",
23
23
  "./cli": {
24
- "import": "./cli/dist/index.js",
25
- "types": "./cli/dist/index.d.ts"
24
+ "import": "./cli/index.js",
25
+ "types": "./cli/index.d.ts"
26
26
  },
27
27
  "./mcp-server": {
28
- "import": "./mcp-server/dist/index.js",
29
- "types": "./mcp-server/dist/index.d.ts"
28
+ "import": "./mcp-server/index.js",
29
+ "types": "./mcp-server/index.d.ts"
30
30
  }
31
31
  },
32
32
  "files": [
@@ -1,9 +1,10 @@
1
1
  <script setup lang="ts">
2
+ import { computed } from 'vue'
2
3
  import { cn } from '@/lib/utils'
3
4
 
4
5
  interface Props {
5
6
  class?: string
6
- elevation?: 0 | 1 | 2 | 3
7
+ elevation?: 0 | 1 | 2 | 3 | '0' | '1' | '2' | '3'
7
8
  interactive?: boolean
8
9
  direction?: 'vertical' | 'horizontal'
9
10
  variant?: 'elevated' | 'outlined' | 'filled' | 'ghost'
@@ -16,13 +17,15 @@ const props = withDefaults(defineProps<Props>(), {
16
17
  variant: 'elevated',
17
18
  })
18
19
 
19
- const elevationClasses = {
20
+ const elevationClasses: Record<number, string> = {
20
21
  0: 'shadow-none',
21
22
  1: 'shadow-depth-1',
22
23
  2: 'shadow-depth-2',
23
24
  3: 'shadow-depth-3',
24
25
  }
25
26
 
27
+ const normalizedElevation = computed(() => Number(props.elevation) as 0 | 1 | 2 | 3)
28
+
26
29
  const variantClasses = {
27
30
  elevated: 'border bg-card text-card-foreground',
28
31
  outlined: 'border bg-transparent text-card-foreground shadow-none',
@@ -37,7 +40,7 @@ const variantClasses = {
37
40
  cn(
38
41
  'rounded-lg',
39
42
  variantClasses[variant],
40
- variant === 'elevated' && elevationClasses[elevation],
43
+ variant === 'elevated' && elevationClasses[normalizedElevation],
41
44
  direction === 'horizontal' && 'flex flex-row',
42
45
  interactive && 'transition-elevation hover:shadow-depth-2 cursor-pointer',
43
46
  props.class