feat(button): add icon and loadingIcon prop support

This commit is contained in:
Timothy Yin 2024-11-27 01:26:04 +08:00
parent 1720987c4d
commit 2996866b9a
5 changed files with 72 additions and 429 deletions

View File

@ -91,6 +91,18 @@ props:
Button
::
### Icon
::ComponentPreview
---
props:
icon: tabler:adjustments
size: sm
loading: true
---
Settings
::
### Loading
::ComponentPreview

View File

@ -31,6 +31,7 @@
"test:types": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit"
},
"dependencies": {
"@iconify-json/svg-spinners": "^1.2.1",
"@iconify-json/tabler": "^1.2.8",
"@nuxt/icon": "^1.8.2",
"@nuxt/kit": "^3.14.159",

459
pnpm-lock.yaml generated
View File

@ -12,18 +12,21 @@ importers:
.:
dependencies:
'@iconify-json/svg-spinners':
specifier: ^1.2.1
version: 1.2.1
'@iconify-json/tabler':
specifier: ^1.2.8
version: 1.2.8
'@nuxt/icon':
specifier: ^1.8.2
version: 1.8.2(magicast@0.3.5)(rollup@3.29.5)(vite@5.4.11(@types/node@22.10.0)(terser@5.36.0))(vue@3.5.13(typescript@5.6.3))
version: 1.8.2(magicast@0.3.5)(rollup@4.27.4)(vite@5.4.11(@types/node@22.10.0)(terser@5.36.0))(vue@3.5.13(typescript@5.6.3))
'@nuxt/kit':
specifier: ^3.14.159
version: 3.14.1592(magicast@0.3.5)(rollup@3.29.5)
version: 3.14.1592(magicast@0.3.5)(rollup@4.27.4)
'@nuxtjs/tailwindcss':
specifier: ^6.12.2
version: 6.12.2(magicast@0.3.5)(rollup@3.29.5)
version: 6.12.2(magicast@0.3.5)(rollup@4.27.4)
'@tailwindcss/aspect-ratio':
specifier: ^0.4.2
version: 0.4.2(tailwindcss@3.4.15)
@ -48,19 +51,19 @@ importers:
devDependencies:
'@nuxt/devtools':
specifier: ^1.6.0
version: 1.6.1(rollup@3.29.5)(vite@5.4.11(@types/node@22.10.0)(terser@5.36.0))(vue@3.5.13(typescript@5.6.3))
version: 1.6.1(rollup@4.27.4)(vite@5.4.11(@types/node@22.10.0)(terser@5.36.0))(vue@3.5.13(typescript@5.6.3))
'@nuxt/eslint-config':
specifier: ^0.7.0
version: 0.7.1(@vue/compiler-sfc@3.5.13)(eslint@9.15.0(jiti@2.4.0))(typescript@5.6.3)
'@nuxt/module-builder':
specifier: ^0.8.4
version: 0.8.4(@nuxt/kit@3.14.1592(magicast@0.3.5)(rollup@3.29.5))(nuxi@3.15.0)(typescript@5.6.3)(vue-tsc@2.1.10(typescript@5.6.3))
version: 0.8.4(@nuxt/kit@3.14.1592(magicast@0.3.5)(rollup@4.27.4))(nuxi@3.15.0)(typescript@5.6.3)(vue-tsc@2.1.10(typescript@5.6.3))
'@nuxt/schema':
specifier: ^3.14.159
version: 3.14.1592(magicast@0.3.5)(rollup@3.29.5)
version: 3.14.1592(magicast@0.3.5)(rollup@4.27.4)
'@nuxt/test-utils':
specifier: ^3.14.4
version: 3.14.4(h3@1.13.0)(magicast@0.3.5)(nitropack@2.10.4(typescript@5.6.3))(rollup@3.29.5)(vite@5.4.11(@types/node@22.10.0)(terser@5.36.0))(vitest@2.1.5(@types/node@22.10.0)(terser@5.36.0))(vue-router@4.5.0(vue@3.5.13(typescript@5.6.3)))(vue@3.5.13(typescript@5.6.3))
version: 3.14.4(h3@1.13.0)(magicast@0.3.5)(nitropack@2.10.4(typescript@5.6.3))(rollup@4.27.4)(vite@5.4.11(@types/node@22.10.0)(terser@5.36.0))(vitest@2.1.5(@types/node@22.10.0)(terser@5.36.0))(vue-router@4.4.5(vue@3.5.13(typescript@5.6.3)))(vue@3.5.13(typescript@5.6.3))
'@release-it/conventional-changelog':
specifier: ^9.0.3
version: 9.0.3(conventional-commits-filter@5.0.0)(conventional-commits-parser@6.0.0)(release-it@17.10.0(typescript@5.6.3))
@ -75,7 +78,7 @@ importers:
version: 9.15.0(jiti@2.4.0)
nuxt:
specifier: ^3.14.159
version: 3.14.1592(@parcel/watcher@2.5.0)(@types/node@22.10.0)(eslint@9.15.0(jiti@2.4.0))(ioredis@5.4.1)(magicast@0.3.5)(optionator@0.9.4)(rollup@3.29.5)(terser@5.36.0)(typescript@5.6.3)(vite@5.4.11(@types/node@22.10.0)(terser@5.36.0))(vue-tsc@2.1.10(typescript@5.6.3))
version: 3.14.1592(@parcel/watcher@2.5.0)(@types/node@22.10.0)(eslint@9.15.0(jiti@2.4.0))(ioredis@5.4.1)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.27.4)(terser@5.36.0)(typescript@5.6.3)(vite@5.4.11(@types/node@22.10.0)(terser@5.36.0))(vue-tsc@2.1.10(typescript@5.6.3))
release-it:
specifier: ^17.10.0
version: 17.10.0(typescript@5.6.3)
@ -831,6 +834,9 @@ packages:
'@iarna/toml@2.2.5':
resolution: {integrity: sha512-trnsAYxU3xnS1gPHPyU961coFyLkh4gAD/0zQ5mymY4yOZ+CYvsPqUbOFSw0aDM4y0tV7tiFxL/1XfXPNC6IPg==}
'@iconify-json/svg-spinners@1.2.1':
resolution: {integrity: sha512-QZNA4YzFD2zqdC6nIBJM6WlAGakUCjvMt92Ks1R4XFxkd76Ps3rdiauYWESDRZvNYURAByp2b9cwZarFula65g==}
'@iconify-json/tabler@1.2.8':
resolution: {integrity: sha512-xvi/UKhLiFRnutSo6xuHxvOGmskYEoC2St4WDVsU9WAW1DRG1EkBUk/Zy1TpeSsBKMQfyqtdjjx9Cf4ZezOK2w==}
@ -6509,6 +6515,10 @@ snapshots:
'@iarna/toml@2.2.5': {}
'@iconify-json/svg-spinners@1.2.1':
dependencies:
'@iconify/types': 2.0.0
'@iconify-json/tabler@1.2.8':
dependencies:
'@iconify/types': 2.0.0
@ -6692,17 +6702,6 @@ snapshots:
'@nuxt/devalue@2.0.2': {}
'@nuxt/devtools-kit@1.6.1(magicast@0.3.5)(rollup@3.29.5)(vite@5.4.11(@types/node@22.10.0)(terser@5.36.0))':
dependencies:
'@nuxt/kit': 3.14.1592(magicast@0.3.5)(rollup@3.29.5)
'@nuxt/schema': 3.14.1592(magicast@0.3.5)(rollup@3.29.5)
execa: 7.2.0
vite: 5.4.11(@types/node@22.10.0)(terser@5.36.0)
transitivePeerDependencies:
- magicast
- rollup
- supports-color
'@nuxt/devtools-kit@1.6.1(magicast@0.3.5)(rollup@4.27.4)(vite@5.4.11(@types/node@22.10.0)(terser@5.36.0))':
dependencies:
'@nuxt/kit': 3.14.1592(magicast@0.3.5)(rollup@4.27.4)
@ -6727,53 +6726,6 @@ snapshots:
rc9: 2.1.2
semver: 7.6.3
'@nuxt/devtools@1.6.1(rollup@3.29.5)(vite@5.4.11(@types/node@22.10.0)(terser@5.36.0))(vue@3.5.13(typescript@5.6.3))':
dependencies:
'@antfu/utils': 0.7.10
'@nuxt/devtools-kit': 1.6.1(magicast@0.3.5)(rollup@3.29.5)(vite@5.4.11(@types/node@22.10.0)(terser@5.36.0))
'@nuxt/devtools-wizard': 1.6.1
'@nuxt/kit': 3.14.1592(magicast@0.3.5)(rollup@3.29.5)
'@vue/devtools-core': 7.6.4(vite@5.4.11(@types/node@22.10.0)(terser@5.36.0))(vue@3.5.13(typescript@5.6.3))
'@vue/devtools-kit': 7.6.4
birpc: 0.2.19
consola: 3.2.3
cronstrue: 2.52.0
destr: 2.0.3
error-stack-parser-es: 0.1.5
execa: 7.2.0
fast-npm-meta: 0.2.2
flatted: 3.3.2
get-port-please: 3.1.2
hookable: 5.5.3
image-meta: 0.2.1
is-installed-globally: 1.0.0
launch-editor: 2.9.1
local-pkg: 0.5.1
magicast: 0.3.5
nypm: 0.3.12
ohash: 1.1.4
pathe: 1.1.2
perfect-debounce: 1.0.0
pkg-types: 1.2.1
rc9: 2.1.2
scule: 1.3.0
semver: 7.6.3
simple-git: 3.27.0
sirv: 2.0.4
tinyglobby: 0.2.10
unimport: 3.13.3(rollup@3.29.5)
vite: 5.4.11(@types/node@22.10.0)(terser@5.36.0)
vite-plugin-inspect: 0.8.8(@nuxt/kit@3.14.1592(magicast@0.3.5)(rollup@3.29.5))(rollup@3.29.5)(vite@5.4.11(@types/node@22.10.0)(terser@5.36.0))
vite-plugin-vue-inspector: 5.1.3(vite@5.4.11(@types/node@22.10.0)(terser@5.36.0))
which: 3.0.1
ws: 8.18.0
transitivePeerDependencies:
- bufferutil
- rollup
- supports-color
- utf-8-validate
- vue
'@nuxt/devtools@1.6.1(rollup@4.27.4)(vite@5.4.11(@types/node@22.10.0)(terser@5.36.0))(vue@3.5.13(typescript@5.6.3))':
dependencies:
'@antfu/utils': 0.7.10
@ -6810,7 +6762,7 @@ snapshots:
tinyglobby: 0.2.10
unimport: 3.13.3(rollup@4.27.4)
vite: 5.4.11(@types/node@22.10.0)(terser@5.36.0)
vite-plugin-inspect: 0.8.8(@nuxt/kit@3.14.1592(magicast@0.3.5)(rollup@3.29.5))(rollup@4.27.4)(vite@5.4.11(@types/node@22.10.0)(terser@5.36.0))
vite-plugin-inspect: 0.8.8(@nuxt/kit@3.14.1592(magicast@0.3.5)(rollup@4.27.4))(rollup@4.27.4)(vite@5.4.11(@types/node@22.10.0)(terser@5.36.0))
vite-plugin-vue-inspector: 5.1.3(vite@5.4.11(@types/node@22.10.0)(terser@5.36.0))
which: 3.0.1
ws: 8.18.0
@ -6900,14 +6852,14 @@ snapshots:
- supports-color
- vite
'@nuxt/icon@1.8.2(magicast@0.3.5)(rollup@3.29.5)(vite@5.4.11(@types/node@22.10.0)(terser@5.36.0))(vue@3.5.13(typescript@5.6.3))':
'@nuxt/icon@1.8.2(magicast@0.3.5)(rollup@4.27.4)(vite@5.4.11(@types/node@22.10.0)(terser@5.36.0))(vue@3.5.13(typescript@5.6.3))':
dependencies:
'@iconify/collections': 1.0.487
'@iconify/types': 2.0.0
'@iconify/utils': 2.1.33
'@iconify/vue': 4.2.0-dev.2(vue@3.5.13(typescript@5.6.3))
'@nuxt/devtools-kit': 1.6.1(magicast@0.3.5)(rollup@3.29.5)(vite@5.4.11(@types/node@22.10.0)(terser@5.36.0))
'@nuxt/kit': 3.14.1592(magicast@0.3.5)(rollup@3.29.5)
'@nuxt/devtools-kit': 1.6.1(magicast@0.3.5)(rollup@4.27.4)(vite@5.4.11(@types/node@22.10.0)(terser@5.36.0))
'@nuxt/kit': 3.14.1592(magicast@0.3.5)(rollup@4.27.4)
consola: 3.2.3
local-pkg: 0.5.1
mlly: 1.7.3
@ -6922,33 +6874,6 @@ snapshots:
- vite
- vue
'@nuxt/kit@3.14.1592(magicast@0.3.5)(rollup@3.29.5)':
dependencies:
'@nuxt/schema': 3.14.1592(magicast@0.3.5)(rollup@3.29.5)
c12: 2.0.1(magicast@0.3.5)
consola: 3.2.3
defu: 6.1.4
destr: 2.0.3
globby: 14.0.2
hash-sum: 2.0.0
ignore: 6.0.2
jiti: 2.4.0
klona: 2.0.6
knitwork: 1.1.0
mlly: 1.7.3
pathe: 1.1.2
pkg-types: 1.2.1
scule: 1.3.0
semver: 7.6.3
ufo: 1.5.4
unctx: 2.3.1
unimport: 3.13.3(rollup@3.29.5)
untyped: 1.5.1
transitivePeerDependencies:
- magicast
- rollup
- supports-color
'@nuxt/kit@3.14.1592(magicast@0.3.5)(rollup@4.27.4)':
dependencies:
'@nuxt/schema': 3.14.1592(magicast@0.3.5)(rollup@4.27.4)
@ -6976,9 +6901,9 @@ snapshots:
- rollup
- supports-color
'@nuxt/module-builder@0.8.4(@nuxt/kit@3.14.1592(magicast@0.3.5)(rollup@3.29.5))(nuxi@3.15.0)(typescript@5.6.3)(vue-tsc@2.1.10(typescript@5.6.3))':
'@nuxt/module-builder@0.8.4(@nuxt/kit@3.14.1592(magicast@0.3.5)(rollup@4.27.4))(nuxi@3.15.0)(typescript@5.6.3)(vue-tsc@2.1.10(typescript@5.6.3))':
dependencies:
'@nuxt/kit': 3.14.1592(magicast@0.3.5)(rollup@3.29.5)
'@nuxt/kit': 3.14.1592(magicast@0.3.5)(rollup@4.27.4)
citty: 0.1.6
consola: 3.2.3
defu: 6.1.4
@ -6995,26 +6920,6 @@ snapshots:
- typescript
- vue-tsc
'@nuxt/schema@3.14.1592(magicast@0.3.5)(rollup@3.29.5)':
dependencies:
c12: 2.0.1(magicast@0.3.5)
compatx: 0.1.8
consola: 3.2.3
defu: 6.1.4
hookable: 5.5.3
pathe: 1.1.2
pkg-types: 1.2.1
scule: 1.3.0
std-env: 3.8.0
ufo: 1.5.4
uncrypto: 0.1.3
unimport: 3.13.3(rollup@3.29.5)
untyped: 1.5.1
transitivePeerDependencies:
- magicast
- rollup
- supports-color
'@nuxt/schema@3.14.1592(magicast@0.3.5)(rollup@4.27.4)':
dependencies:
c12: 2.0.1(magicast@0.3.5)
@ -7035,31 +6940,6 @@ snapshots:
- rollup
- supports-color
'@nuxt/telemetry@2.6.0(magicast@0.3.5)(rollup@3.29.5)':
dependencies:
'@nuxt/kit': 3.14.1592(magicast@0.3.5)(rollup@3.29.5)
ci-info: 4.1.0
consola: 3.2.3
create-require: 1.1.1
defu: 6.1.4
destr: 2.0.3
dotenv: 16.4.5
git-url-parse: 15.0.0
is-docker: 3.0.0
jiti: 1.21.6
mri: 1.2.0
nanoid: 5.0.8
ofetch: 1.4.1
package-manager-detector: 0.2.4
parse-git-config: 3.0.0
pathe: 1.1.2
rc9: 2.1.2
std-env: 3.8.0
transitivePeerDependencies:
- magicast
- rollup
- supports-color
'@nuxt/telemetry@2.6.0(magicast@0.3.5)(rollup@4.27.4)':
dependencies:
'@nuxt/kit': 3.14.1592(magicast@0.3.5)(rollup@4.27.4)
@ -7085,10 +6965,10 @@ snapshots:
- rollup
- supports-color
'@nuxt/test-utils@3.14.4(h3@1.13.0)(magicast@0.3.5)(nitropack@2.10.4(typescript@5.6.3))(rollup@3.29.5)(vite@5.4.11(@types/node@22.10.0)(terser@5.36.0))(vitest@2.1.5(@types/node@22.10.0)(terser@5.36.0))(vue-router@4.5.0(vue@3.5.13(typescript@5.6.3)))(vue@3.5.13(typescript@5.6.3))':
'@nuxt/test-utils@3.14.4(h3@1.13.0)(magicast@0.3.5)(nitropack@2.10.4(typescript@5.6.3))(rollup@4.27.4)(vite@5.4.11(@types/node@22.10.0)(terser@5.36.0))(vitest@2.1.5(@types/node@22.10.0)(terser@5.36.0))(vue-router@4.4.5(vue@3.5.13(typescript@5.6.3)))(vue@3.5.13(typescript@5.6.3))':
dependencies:
'@nuxt/kit': 3.14.1592(magicast@0.3.5)(rollup@3.29.5)
'@nuxt/schema': 3.14.1592(magicast@0.3.5)(rollup@3.29.5)
'@nuxt/kit': 3.14.1592(magicast@0.3.5)(rollup@4.27.4)
'@nuxt/schema': 3.14.1592(magicast@0.3.5)(rollup@4.27.4)
c12: 2.0.1(magicast@0.3.5)
consola: 3.2.3
defu: 6.1.4
@ -7112,9 +6992,9 @@ snapshots:
unenv: 1.10.0
unplugin: 1.16.0
vite: 5.4.11(@types/node@22.10.0)(terser@5.36.0)
vitest-environment-nuxt: 1.0.1(h3@1.13.0)(magicast@0.3.5)(nitropack@2.10.4(typescript@5.6.3))(rollup@3.29.5)(vite@5.4.11(@types/node@22.10.0)(terser@5.36.0))(vitest@2.1.5(@types/node@22.10.0)(terser@5.36.0))(vue-router@4.5.0(vue@3.5.13(typescript@5.6.3)))(vue@3.5.13(typescript@5.6.3))
vitest-environment-nuxt: 1.0.1(h3@1.13.0)(magicast@0.3.5)(nitropack@2.10.4(typescript@5.6.3))(rollup@4.27.4)(vite@5.4.11(@types/node@22.10.0)(terser@5.36.0))(vitest@2.1.5(@types/node@22.10.0)(terser@5.36.0))(vue-router@4.4.5(vue@3.5.13(typescript@5.6.3)))(vue@3.5.13(typescript@5.6.3))
vue: 3.5.13(typescript@5.6.3)
vue-router: 4.5.0(vue@3.5.13(typescript@5.6.3))
vue-router: 4.4.5(vue@3.5.13(typescript@5.6.3))
optionalDependencies:
vitest: 2.1.5(@types/node@22.10.0)(terser@5.36.0)
transitivePeerDependencies:
@ -7122,65 +7002,6 @@ snapshots:
- rollup
- supports-color
'@nuxt/vite-builder@3.14.1592(@types/node@22.10.0)(eslint@9.15.0(jiti@2.4.0))(magicast@0.3.5)(optionator@0.9.4)(rollup@3.29.5)(terser@5.36.0)(typescript@5.6.3)(vue-tsc@2.1.10(typescript@5.6.3))(vue@3.5.13(typescript@5.6.3))':
dependencies:
'@nuxt/kit': 3.14.1592(magicast@0.3.5)(rollup@3.29.5)
'@rollup/plugin-replace': 6.0.1(rollup@3.29.5)
'@vitejs/plugin-vue': 5.2.0(vite@5.4.11(@types/node@22.10.0)(terser@5.36.0))(vue@3.5.13(typescript@5.6.3))
'@vitejs/plugin-vue-jsx': 4.1.0(vite@5.4.11(@types/node@22.10.0)(terser@5.36.0))(vue@3.5.13(typescript@5.6.3))
autoprefixer: 10.4.20(postcss@8.4.49)
clear: 0.1.0
consola: 3.2.3
cssnano: 7.0.6(postcss@8.4.49)
defu: 6.1.4
esbuild: 0.24.0
escape-string-regexp: 5.0.0
estree-walker: 3.0.3
externality: 1.0.2
get-port-please: 3.1.2
h3: 1.13.0
jiti: 2.4.0
knitwork: 1.1.0
magic-string: 0.30.13
mlly: 1.7.3
ohash: 1.1.4
pathe: 1.1.2
perfect-debounce: 1.0.0
pkg-types: 1.2.1
postcss: 8.4.49
rollup-plugin-visualizer: 5.12.0(rollup@3.29.5)
std-env: 3.8.0
strip-literal: 2.1.1
ufo: 1.5.4
unenv: 1.10.0
unplugin: 1.16.0
vite: 5.4.11(@types/node@22.10.0)(terser@5.36.0)
vite-node: 2.1.5(@types/node@22.10.0)(terser@5.36.0)
vite-plugin-checker: 0.8.0(eslint@9.15.0(jiti@2.4.0))(optionator@0.9.4)(typescript@5.6.3)(vite@5.4.11(@types/node@22.10.0)(terser@5.36.0))(vue-tsc@2.1.10(typescript@5.6.3))
vue: 3.5.13(typescript@5.6.3)
vue-bundle-renderer: 2.1.1
transitivePeerDependencies:
- '@biomejs/biome'
- '@types/node'
- eslint
- less
- lightningcss
- magicast
- meow
- optionator
- rollup
- sass
- sass-embedded
- stylelint
- stylus
- sugarss
- supports-color
- terser
- typescript
- vls
- vti
- vue-tsc
'@nuxt/vite-builder@3.14.1592(@types/node@22.10.0)(eslint@9.15.0(jiti@2.4.0))(magicast@0.3.5)(optionator@0.9.4)(rollup@4.27.4)(terser@5.36.0)(typescript@5.6.3)(vue-tsc@2.1.10(typescript@5.6.3))(vue@3.5.13(typescript@5.6.3))':
dependencies:
'@nuxt/kit': 3.14.1592(magicast@0.3.5)(rollup@4.27.4)
@ -7294,9 +7115,9 @@ snapshots:
- rollup
- supports-color
'@nuxtjs/tailwindcss@6.12.2(magicast@0.3.5)(rollup@3.29.5)':
'@nuxtjs/tailwindcss@6.12.2(magicast@0.3.5)(rollup@4.27.4)':
dependencies:
'@nuxt/kit': 3.14.1592(magicast@0.3.5)(rollup@3.29.5)
'@nuxt/kit': 3.14.1592(magicast@0.3.5)(rollup@4.27.4)
autoprefixer: 10.4.20(postcss@8.4.49)
consola: 3.2.3
defu: 6.1.4
@ -7578,13 +7399,6 @@ snapshots:
optionalDependencies:
rollup: 3.29.5
'@rollup/plugin-replace@6.0.1(rollup@3.29.5)':
dependencies:
'@rollup/pluginutils': 5.1.3(rollup@3.29.5)
magic-string: 0.30.13
optionalDependencies:
rollup: 3.29.5
'@rollup/plugin-replace@6.0.1(rollup@4.27.4)':
dependencies:
'@rollup/pluginutils': 5.1.3(rollup@4.27.4)
@ -7983,19 +7797,6 @@ snapshots:
path-browserify: 1.0.1
vscode-uri: 3.0.8
'@vue-macros/common@1.15.0(rollup@3.29.5)(vue@3.5.13(typescript@5.6.3))':
dependencies:
'@babel/types': 7.26.0
'@rollup/pluginutils': 5.1.3(rollup@3.29.5)
'@vue/compiler-sfc': 3.5.13
ast-kit: 1.3.1
local-pkg: 0.5.1
magic-string-ast: 0.6.3
optionalDependencies:
vue: 3.5.13(typescript@5.6.3)
transitivePeerDependencies:
- rollup
'@vue-macros/common@1.15.0(rollup@4.27.4)(vue@3.5.13(typescript@5.6.3))':
dependencies:
'@babel/types': 7.26.0
@ -10016,16 +9817,6 @@ snapshots:
parent-module: 1.0.1
resolve-from: 4.0.0
impound@0.2.0(rollup@3.29.5):
dependencies:
'@rollup/pluginutils': 5.1.3(rollup@3.29.5)
mlly: 1.7.3
pathe: 1.1.2
unenv: 1.10.0
unplugin: 1.16.0
transitivePeerDependencies:
- rollup
impound@0.2.0(rollup@4.27.4):
dependencies:
'@rollup/pluginutils': 5.1.3(rollup@4.27.4)
@ -11095,119 +10886,6 @@ snapshots:
- rollup
- supports-color
nuxt@3.14.1592(@parcel/watcher@2.5.0)(@types/node@22.10.0)(eslint@9.15.0(jiti@2.4.0))(ioredis@5.4.1)(magicast@0.3.5)(optionator@0.9.4)(rollup@3.29.5)(terser@5.36.0)(typescript@5.6.3)(vite@5.4.11(@types/node@22.10.0)(terser@5.36.0))(vue-tsc@2.1.10(typescript@5.6.3)):
dependencies:
'@nuxt/devalue': 2.0.2
'@nuxt/devtools': 1.6.1(rollup@3.29.5)(vite@5.4.11(@types/node@22.10.0)(terser@5.36.0))(vue@3.5.13(typescript@5.6.3))
'@nuxt/kit': 3.14.1592(magicast@0.3.5)(rollup@3.29.5)
'@nuxt/schema': 3.14.1592(magicast@0.3.5)(rollup@3.29.5)
'@nuxt/telemetry': 2.6.0(magicast@0.3.5)(rollup@3.29.5)
'@nuxt/vite-builder': 3.14.1592(@types/node@22.10.0)(eslint@9.15.0(jiti@2.4.0))(magicast@0.3.5)(optionator@0.9.4)(rollup@3.29.5)(terser@5.36.0)(typescript@5.6.3)(vue-tsc@2.1.10(typescript@5.6.3))(vue@3.5.13(typescript@5.6.3))
'@unhead/dom': 1.11.11
'@unhead/shared': 1.11.11
'@unhead/ssr': 1.11.11
'@unhead/vue': 1.11.11(vue@3.5.13(typescript@5.6.3))
'@vue/shared': 3.5.13
acorn: 8.14.0
c12: 2.0.1(magicast@0.3.5)
chokidar: 4.0.1
compatx: 0.1.8
consola: 3.2.3
cookie-es: 1.2.2
defu: 6.1.4
destr: 2.0.3
devalue: 5.1.1
errx: 0.1.0
esbuild: 0.24.0
escape-string-regexp: 5.0.0
estree-walker: 3.0.3
globby: 14.0.2
h3: 1.13.0
hookable: 5.5.3
ignore: 6.0.2
impound: 0.2.0(rollup@3.29.5)
jiti: 2.4.0
klona: 2.0.6
knitwork: 1.1.0
magic-string: 0.30.13
mlly: 1.7.3
nanotar: 0.1.1
nitropack: 2.10.4(typescript@5.6.3)
nuxi: 3.15.0
nypm: 0.3.12
ofetch: 1.4.1
ohash: 1.1.4
pathe: 1.1.2
perfect-debounce: 1.0.0
pkg-types: 1.2.1
radix3: 1.1.2
scule: 1.3.0
semver: 7.6.3
std-env: 3.8.0
strip-literal: 2.1.1
tinyglobby: 0.2.10
ufo: 1.5.4
ultrahtml: 1.5.3
uncrypto: 0.1.3
unctx: 2.3.1
unenv: 1.10.0
unhead: 1.11.11
unimport: 3.13.3(rollup@3.29.5)
unplugin: 1.16.0
unplugin-vue-router: 0.10.8(rollup@3.29.5)(vue-router@4.4.5(vue@3.5.13(typescript@5.6.3)))(vue@3.5.13(typescript@5.6.3))
unstorage: 1.13.1(ioredis@5.4.1)
untyped: 1.5.1
vue: 3.5.13(typescript@5.6.3)
vue-bundle-renderer: 2.1.1
vue-devtools-stub: 0.1.0
vue-router: 4.4.5(vue@3.5.13(typescript@5.6.3))
optionalDependencies:
'@parcel/watcher': 2.5.0
'@types/node': 22.10.0
transitivePeerDependencies:
- '@azure/app-configuration'
- '@azure/cosmos'
- '@azure/data-tables'
- '@azure/identity'
- '@azure/keyvault-secrets'
- '@azure/storage-blob'
- '@biomejs/biome'
- '@capacitor/preferences'
- '@electric-sql/pglite'
- '@libsql/client'
- '@netlify/blobs'
- '@planetscale/database'
- '@upstash/redis'
- '@vercel/kv'
- better-sqlite3
- bufferutil
- drizzle-orm
- encoding
- eslint
- idb-keyval
- ioredis
- less
- lightningcss
- magicast
- meow
- mysql2
- optionator
- rollup
- sass
- sass-embedded
- stylelint
- stylus
- sugarss
- supports-color
- terser
- typescript
- utf-8-validate
- vite
- vls
- vti
- vue-tsc
- xml2js
nuxt@3.14.1592(@parcel/watcher@2.5.0)(@types/node@22.10.0)(eslint@9.15.0(jiti@2.4.0))(ioredis@5.4.1)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.27.4)(terser@5.36.0)(typescript@5.6.3)(vite@5.4.11(@types/node@22.10.0)(terser@5.36.0))(vue-tsc@2.1.10(typescript@5.6.3)):
dependencies:
'@nuxt/devalue': 2.0.2
@ -12184,15 +11862,6 @@ snapshots:
optionalDependencies:
'@babel/code-frame': 7.26.2
rollup-plugin-visualizer@5.12.0(rollup@3.29.5):
dependencies:
open: 8.4.2
picomatch: 2.3.1
source-map: 0.7.4
yargs: 17.7.2
optionalDependencies:
rollup: 3.29.5
rollup-plugin-visualizer@5.12.0(rollup@4.27.4):
dependencies:
open: 8.4.2
@ -12827,24 +12496,6 @@ snapshots:
css-tree: 3.0.1
ohash: 1.1.4
unimport@3.13.3(rollup@3.29.5):
dependencies:
'@rollup/pluginutils': 5.1.3(rollup@3.29.5)
acorn: 8.14.0
escape-string-regexp: 5.0.0
estree-walker: 3.0.3
fast-glob: 3.3.2
local-pkg: 0.5.1
magic-string: 0.30.13
mlly: 1.7.3
pathe: 1.1.2
pkg-types: 1.2.1
scule: 1.3.0
strip-literal: 2.1.1
unplugin: 1.16.0
transitivePeerDependencies:
- rollup
unimport@3.13.3(rollup@4.27.4):
dependencies:
'@rollup/pluginutils': 5.1.3(rollup@4.27.4)
@ -12894,28 +12545,6 @@ snapshots:
universalify@2.0.1: {}
unplugin-vue-router@0.10.8(rollup@3.29.5)(vue-router@4.4.5(vue@3.5.13(typescript@5.6.3)))(vue@3.5.13(typescript@5.6.3)):
dependencies:
'@babel/types': 7.26.0
'@rollup/pluginutils': 5.1.3(rollup@3.29.5)
'@vue-macros/common': 1.15.0(rollup@3.29.5)(vue@3.5.13(typescript@5.6.3))
ast-walker-scope: 0.6.2
chokidar: 3.6.0
fast-glob: 3.3.2
json5: 2.2.3
local-pkg: 0.5.1
magic-string: 0.30.13
mlly: 1.7.3
pathe: 1.1.2
scule: 1.3.0
unplugin: 1.16.0
yaml: 2.6.1
optionalDependencies:
vue-router: 4.4.5(vue@3.5.13(typescript@5.6.3))
transitivePeerDependencies:
- rollup
- vue
unplugin-vue-router@0.10.8(rollup@4.27.4)(vue-router@4.4.5(vue@3.5.13(typescript@5.6.3)))(vue@3.5.13(typescript@5.6.3)):
dependencies:
'@babel/types': 7.26.0
@ -13087,25 +12716,7 @@ snapshots:
typescript: 5.6.3
vue-tsc: 2.1.10(typescript@5.6.3)
vite-plugin-inspect@0.8.8(@nuxt/kit@3.14.1592(magicast@0.3.5)(rollup@3.29.5))(rollup@3.29.5)(vite@5.4.11(@types/node@22.10.0)(terser@5.36.0)):
dependencies:
'@antfu/utils': 0.7.10
'@rollup/pluginutils': 5.1.3(rollup@3.29.5)
debug: 4.3.7(supports-color@9.4.0)
error-stack-parser-es: 0.1.5
fs-extra: 11.2.0
open: 10.1.0
perfect-debounce: 1.0.0
picocolors: 1.1.1
sirv: 3.0.0
vite: 5.4.11(@types/node@22.10.0)(terser@5.36.0)
optionalDependencies:
'@nuxt/kit': 3.14.1592(magicast@0.3.5)(rollup@3.29.5)
transitivePeerDependencies:
- rollup
- supports-color
vite-plugin-inspect@0.8.8(@nuxt/kit@3.14.1592(magicast@0.3.5)(rollup@3.29.5))(rollup@4.27.4)(vite@5.4.11(@types/node@22.10.0)(terser@5.36.0)):
vite-plugin-inspect@0.8.8(@nuxt/kit@3.14.1592(magicast@0.3.5)(rollup@4.27.4))(rollup@4.27.4)(vite@5.4.11(@types/node@22.10.0)(terser@5.36.0)):
dependencies:
'@antfu/utils': 0.7.10
'@rollup/pluginutils': 5.1.3(rollup@4.27.4)
@ -13118,7 +12729,7 @@ snapshots:
sirv: 3.0.0
vite: 5.4.11(@types/node@22.10.0)(terser@5.36.0)
optionalDependencies:
'@nuxt/kit': 3.14.1592(magicast@0.3.5)(rollup@3.29.5)
'@nuxt/kit': 3.14.1592(magicast@0.3.5)(rollup@4.27.4)
transitivePeerDependencies:
- rollup
- supports-color
@ -13148,9 +12759,9 @@ snapshots:
fsevents: 2.3.3
terser: 5.36.0
vitest-environment-nuxt@1.0.1(h3@1.13.0)(magicast@0.3.5)(nitropack@2.10.4(typescript@5.6.3))(rollup@3.29.5)(vite@5.4.11(@types/node@22.10.0)(terser@5.36.0))(vitest@2.1.5(@types/node@22.10.0)(terser@5.36.0))(vue-router@4.5.0(vue@3.5.13(typescript@5.6.3)))(vue@3.5.13(typescript@5.6.3)):
vitest-environment-nuxt@1.0.1(h3@1.13.0)(magicast@0.3.5)(nitropack@2.10.4(typescript@5.6.3))(rollup@4.27.4)(vite@5.4.11(@types/node@22.10.0)(terser@5.36.0))(vitest@2.1.5(@types/node@22.10.0)(terser@5.36.0))(vue-router@4.4.5(vue@3.5.13(typescript@5.6.3)))(vue@3.5.13(typescript@5.6.3)):
dependencies:
'@nuxt/test-utils': 3.14.4(h3@1.13.0)(magicast@0.3.5)(nitropack@2.10.4(typescript@5.6.3))(rollup@3.29.5)(vite@5.4.11(@types/node@22.10.0)(terser@5.36.0))(vitest@2.1.5(@types/node@22.10.0)(terser@5.36.0))(vue-router@4.5.0(vue@3.5.13(typescript@5.6.3)))(vue@3.5.13(typescript@5.6.3))
'@nuxt/test-utils': 3.14.4(h3@1.13.0)(magicast@0.3.5)(nitropack@2.10.4(typescript@5.6.3))(rollup@4.27.4)(vite@5.4.11(@types/node@22.10.0)(terser@5.36.0))(vitest@2.1.5(@types/node@22.10.0)(terser@5.36.0))(vue-router@4.4.5(vue@3.5.13(typescript@5.6.3)))(vue@3.5.13(typescript@5.6.3))
transitivePeerDependencies:
- '@cucumber/cucumber'
- '@jest/globals'

View File

@ -10,6 +10,7 @@ import { useRayUI } from '#build/imports'
const config = button
export default defineComponent({
inheritAttrs: false,
props: {
...nuxtLinkProps,
class: {
@ -60,6 +61,10 @@ export default defineComponent({
type: String,
default: () => config.default.loadingIcon,
},
icon: {
type: String,
default: null,
},
ui: {
type: Object as PropType<DeepPartial<typeof config> & { strategy?: Strategy }>,
default: () => ({}),
@ -77,6 +82,7 @@ export default defineComponent({
ui.value.base,
ui.value.font,
ui.value.rounded,
ui.value.gap[props.size],
ui.value.size[props.size],
props.padded && ui.value.padding[props.size],
variant?.replaceAll('{color}', props.color),
@ -84,12 +90,23 @@ export default defineComponent({
), props.class)
})
const iconClass = computed(() => {
return twJoin(
ui.value.icon.base,
ui.value.icon.size[props.size],
)
})
const leadingIconName = computed(() => props.loading ? props.loadingIcon : props.icon)
return {
// eslint-disable-next-line vue/no-dupe-keys
ui,
attrs,
extProps,
buttonClass,
iconClass,
leadingIconName,
}
},
})
@ -98,7 +115,7 @@ export default defineComponent({
<template>
<RayLink type="button" :disabled="disabled || loading" :class="buttonClass" v-bind="{ ...extProps, ...attrs }">
<slot name="leading" :disabled="disabled" :loading="loading">
<IconSpinner v-if="loading" class="mr-1" />
<RayIcon v-if="leadingIconName" :name="leadingIconName" :class="iconClass" />
</slot>
<slot>
<span v-if="label">{{ label }}</span>

View File

@ -1,7 +1,7 @@
import { standard } from '..'
export default {
base: 'focus:outline-none focus-visible:outline-0 disabled:cursor-not-allowed disabled:opacity-70 aria-disabled:cursor-not-allowed aria-disabled:opacity-70 flex-shrink-0 transition',
base: 'focus:outline-none focus-visible:outline-0 disabled:cursor-not-allowed disabled:opacity-70 aria-disabled:cursor-not-allowed aria-disabled:opacity-70 flex-shrink-0 transition text-left break-all line-clamp-1',
rounded: 'rounded-lg',
font: 'font-medium',
block: 'w-full flex justify-center items-center',
@ -15,13 +15,15 @@ export default {
square: {
...standard.square,
},
gap: {
...standard.gap,
},
icon: {
base: 'flex-shrink-0',
loading: 'animate-spin',
size: {
'2xs': 'h-4 w-4',
'xs': 'h-4 w-4',
'sm': 'h-5 w-5',
'sm': 'h-4 w-4',
'md': 'h-5 w-5',
'lg': 'h-5 w-5',
'xl': 'h-6 w-6',
@ -51,6 +53,6 @@ export default {
size: 'sm',
color: 'primary',
variant: 'solid',
loadingIcon: 'loading',
loadingIcon: 'svg-spinners:90-ring-with-bg',
},
}