@xlui/xux-ui 0.1.0 → 0.2.1

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,57 +1,63 @@
1
- {
2
- "name": "@xlui/xux-ui",
3
- "version": "0.1.0",
4
- "description": "VUE3 电商组件库",
5
- "author": "leheya",
6
- "license": "MIT",
7
- "main": "./dist/index.js",
8
- "module": "./dist/index.mjs",
9
- "types": "./dist/index.d.ts",
10
- "exports": {
11
- ".": {
12
- "types": "./dist/index.d.ts",
13
- "import": "./dist/index.mjs",
14
- "require": "./dist/index.js"
15
- },
16
- "./*": {
17
- "types": "./dist/*.d.ts",
18
- "import": "./dist/*.mjs",
19
- "require": "./dist/*.js"
20
- }
21
- },
22
- "files": [
23
- "dist",
24
- "src",
25
- "README.md"
26
- ],
27
- "scripts": {
28
- "dev": "vite build --watch",
29
- "build": "vite build",
30
- "prepublishOnly": "pnpm build"
31
- },
32
- "keywords": [
33
- "vue3",
34
- "vue3-ui",
35
- "components",
36
- "ui-library"
37
- ],
38
- "repository": {
39
- "type": "git",
40
- "url": "https://gitee.com/leheya/xux"
41
- },
42
- "homepage": "https://gitee.com/leheya/xux",
43
- "bugs": {
44
- "url": "https://gitee.com/leheya/xux/issues"
45
- },
46
- "peerDependencies": {
47
- "vue": "^3.3.0"
48
- },
49
- "devDependencies": {
50
- "@vitejs/plugin-vue": "^5.0.3",
51
- "typescript": "^5.3.3",
52
- "vite": "^5.0.11",
53
- "vue": "^3.4.15",
54
- "vue-tsc": "^1.8.27"
55
- }
56
- }
57
-
1
+ {
2
+ "name": "@xlui/xux-ui",
3
+ "version": "0.2.1",
4
+ "description": "VUE3 电商组件库",
5
+ "author": "leheya",
6
+ "license": "MIT",
7
+ "main": "./dist/index.js",
8
+ "module": "./dist/index.mjs",
9
+ "types": "./dist/index.d.ts",
10
+ "exports": {
11
+ ".": {
12
+ "types": "./dist/index.d.ts",
13
+ "import": "./dist/index.mjs",
14
+ "require": "./dist/index.js"
15
+ },
16
+ "./dist/index.css": "./dist/index.css",
17
+ "./style.css": "./dist/index.css",
18
+ "./*": {
19
+ "types": "./dist/*.d.ts",
20
+ "import": "./dist/*.mjs",
21
+ "require": "./dist/*.js"
22
+ }
23
+ },
24
+ "files": [
25
+ "dist",
26
+ "src",
27
+ "README.md"
28
+ ],
29
+ "keywords": [
30
+ "vue3",
31
+ "vue3-ui",
32
+ "components",
33
+ "ui-library",
34
+ "ecommerce",
35
+ "电商组件",
36
+ "ui-components"
37
+ ],
38
+ "repository": {
39
+ "type": "git",
40
+ "url": "https://gitee.com/leheya/xux"
41
+ },
42
+ "homepage": "https://gitee.com/leheya/xux",
43
+ "bugs": {
44
+ "url": "https://gitee.com/leheya/xux/issues"
45
+ },
46
+ "dependencies": {
47
+ "dayjs": "^1.11.10"
48
+ },
49
+ "peerDependencies": {
50
+ "vue": "^3.3.0"
51
+ },
52
+ "devDependencies": {
53
+ "@vitejs/plugin-vue": "^5.0.3",
54
+ "typescript": "^5.3.3",
55
+ "vite": "^5.0.11",
56
+ "vue": "^3.4.15",
57
+ "vue-tsc": "^1.8.27"
58
+ },
59
+ "scripts": {
60
+ "dev": "vite build --watch",
61
+ "build": "vite build"
62
+ }
63
+ }
@@ -12,6 +12,7 @@
12
12
  'is-disabled': disabled || item.disabled
13
13
  }"
14
14
  >
15
+
15
16
  <button
16
17
  @click="toggle(index)"
17
18
  class="accordion-header"
@@ -49,6 +50,7 @@
49
50
  </template>
50
51
 
51
52
  <script setup lang="ts">
53
+
52
54
  import { withDefaults, watch, nextTick, ref } from 'vue'
53
55
 
54
56
  /**
@@ -86,9 +86,9 @@ interface Props {
86
86
  */
87
87
  round?: boolean
88
88
  /**
89
- * 是否为朴素按钮
89
+ * 是否为幽灵按钮(透明背景,只有边框)
90
90
  */
91
- plain?: boolean
91
+ ghost?: boolean
92
92
  }
93
93
 
94
94
  const props = withDefaults(defineProps<Props>(), {
@@ -98,7 +98,7 @@ const props = withDefaults(defineProps<Props>(), {
98
98
  loading: false,
99
99
  block: false,
100
100
  round: false,
101
- plain: false
101
+ ghost: false
102
102
  })
103
103
 
104
104
  const emit = defineEmits<{
@@ -131,7 +131,7 @@ const buttonClass = computed(() => {
131
131
  'x-btn-loading': props.loading,
132
132
  'x-btn-block': props.block,
133
133
  'x-btn-round': props.round,
134
- 'x-btn-plain': props.plain,
134
+ 'x-btn-ghost': props.ghost,
135
135
  }
136
136
  ]
137
137
  })
@@ -340,53 +340,100 @@ function handleMouseDown(event: MouseEvent) {
340
340
  color: var(--x-color-primary, #ff6b35);
341
341
  }
342
342
 
343
- /* 朴素按钮 */
344
- .x-btn-plain.x-btn-primary {
345
- background-color: rgba(26, 26, 26, 0.1);
346
- border-color: var(--x-color-primary-lighter, #ffad8d);
347
- color: white;
343
+ /* 幽灵按钮 - Ghost Button */
344
+ .x-btn-ghost.x-btn-default {
345
+ background-color: transparent;
346
+ background: transparent;
347
+ border-color: var(--x-color-gray-300, #cacaca);
348
+ color: var(--x-color-black, #1a1a1a);
349
+ box-shadow: none;
348
350
  }
349
351
 
350
- .x-btn-plain.x-btn-primary:hover:not(.x-btn-disabled):not(.x-btn-loading) {
351
- background-color: rgba(26, 26, 26, 0.2);
352
- border-color: var(--x-color-primary, #1a1a1a);
353
- color: white;
352
+ .x-btn-ghost.x-btn-default:hover:not(.x-btn-disabled):not(.x-btn-loading) {
353
+ background-color: rgba(26, 26, 26, 0.05);
354
+ background: rgba(26, 26, 26, 0.05);
355
+ border-color: var(--x-color-gray-400, #a0a0a0);
354
356
  }
355
357
 
356
- .x-btn-plain.x-btn-success {
357
- background-color: rgba(16, 185, 129, 0.1);
358
- border-color: var(--x-color-success-lighter, #6ee7b7);
359
- color: white;
358
+ .x-btn-ghost.x-btn-primary {
359
+ background-color: transparent;
360
+ background: transparent;
361
+ border-color: var(--x-color-primary, #ff6b35);
362
+ color: var(--x-color-primary, #ff6b35);
363
+ box-shadow: none;
360
364
  }
361
365
 
362
- .x-btn-plain.x-btn-success:hover:not(.x-btn-disabled):not(.x-btn-loading) {
363
- background-color: rgba(16, 185, 129, 0.2);
366
+ .x-btn-ghost.x-btn-primary:hover:not(.x-btn-disabled):not(.x-btn-loading) {
367
+ background-color: rgba(255, 107, 53, 0.1);
368
+ background: rgba(255, 107, 53, 0.1);
369
+ border-color: var(--x-color-primary, #ff6b35);
370
+ box-shadow: none;
371
+ }
372
+
373
+ .x-btn-ghost.x-btn-success {
374
+ background-color: transparent;
375
+ background: transparent;
364
376
  border-color: var(--x-color-success, #10b981);
365
- color: white;
377
+ color: var(--x-color-success, #10b981);
378
+ box-shadow: none;
366
379
  }
367
380
 
368
- .x-btn-plain.x-btn-warning {
369
- background-color: rgba(245, 158, 11, 0.1);
370
- border-color: var(--x-color-warning-lighter, #fcd34d);
371
- color: white;
381
+ .x-btn-ghost.x-btn-success:hover:not(.x-btn-disabled):not(.x-btn-loading) {
382
+ background-color: rgba(16, 185, 129, 0.1);
383
+ background: rgba(16, 185, 129, 0.1);
384
+ border-color: var(--x-color-success, #10b981);
385
+ box-shadow: none;
372
386
  }
373
387
 
374
- .x-btn-plain.x-btn-warning:hover:not(.x-btn-disabled):not(.x-btn-loading) {
375
- background-color: rgba(245, 158, 11, 0.2);
388
+ .x-btn-ghost.x-btn-warning {
389
+ background-color: transparent;
390
+ background: transparent;
376
391
  border-color: var(--x-color-warning, #f59e0b);
377
- color: white;
392
+ color: var(--x-color-warning, #f59e0b);
393
+ box-shadow: none;
378
394
  }
379
395
 
380
- .x-btn-plain.x-btn-danger {
381
- background-color: rgba(239, 68, 68, 0.1);
382
- border-color: var(--x-color-danger-lighter, #fca5a5);
383
- color: white;
396
+ .x-btn-ghost.x-btn-warning:hover:not(.x-btn-disabled):not(.x-btn-loading) {
397
+ background-color: rgba(245, 158, 11, 0.1);
398
+ background: rgba(245, 158, 11, 0.1);
399
+ border-color: var(--x-color-warning, #f59e0b);
400
+ box-shadow: none;
384
401
  }
385
402
 
386
- .x-btn-plain.x-btn-danger:hover:not(.x-btn-disabled):not(.x-btn-loading) {
387
- background-color: rgba(239, 68, 68, 0.2);
403
+ .x-btn-ghost.x-btn-danger {
404
+ background-color: transparent;
405
+ background: transparent;
388
406
  border-color: var(--x-color-danger, #ef4444);
389
- color: white;
407
+ color: var(--x-color-danger, #ef4444);
408
+ box-shadow: none;
409
+ }
410
+
411
+ .x-btn-ghost.x-btn-danger:hover:not(.x-btn-disabled):not(.x-btn-loading) {
412
+ background-color: rgba(239, 68, 68, 0.1);
413
+ background: rgba(239, 68, 68, 0.1);
414
+ border-color: var(--x-color-danger, #ef4444);
415
+ box-shadow: none;
416
+ }
417
+
418
+ /* 幽灵按钮波纹效果调整 */
419
+ .x-btn-ghost .x-btn-ripple {
420
+ background-color: rgba(0, 0, 0, 0.08);
421
+ }
422
+
423
+ .x-btn-ghost.x-btn-primary .x-btn-ripple {
424
+ background-color: rgba(255, 107, 53, 0.15);
425
+ }
426
+
427
+ .x-btn-ghost.x-btn-success .x-btn-ripple {
428
+ background-color: rgba(16, 185, 129, 0.15);
429
+ }
430
+
431
+ .x-btn-ghost.x-btn-warning .x-btn-ripple {
432
+ background-color: rgba(245, 158, 11, 0.15);
433
+ }
434
+
435
+ .x-btn-ghost.x-btn-danger .x-btn-ripple {
436
+ background-color: rgba(239, 68, 68, 0.15);
390
437
  }
391
438
 
392
439
  /* 圆角按钮 */