mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-23 16:30:45 +01:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d8b10f3eef | ||
|
|
1071b80b39 | ||
|
|
c5e9a1ef46 | ||
|
|
afe69a570d | ||
|
|
e6ed834cea | ||
|
|
30c5412a6b | ||
|
|
01f56d9553 | ||
|
|
91f273c117 |
@@ -2,6 +2,14 @@
|
|||||||
|
|
||||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||||
|
|
||||||
|
### [0.1.32](https://github.com/nuxtlabs/ui/compare/v0.1.31...v0.1.32) (2023-01-23)
|
||||||
|
|
||||||
|
### [0.1.31](https://github.com/nuxtlabs/ui/compare/v0.1.30...v0.1.31) (2023-01-17)
|
||||||
|
|
||||||
|
### [0.1.30](https://github.com/nuxtlabs/ui/compare/v0.1.29...v0.1.30) (2023-01-17)
|
||||||
|
|
||||||
|
### [0.1.29](https://github.com/nuxtlabs/ui/compare/v0.1.28...v0.1.29) (2023-01-17)
|
||||||
|
|
||||||
### [0.1.28](https://github.com/nuxtlabs/ui/compare/v0.1.27...v0.1.28) (2023-01-13)
|
### [0.1.28](https://github.com/nuxtlabs/ui/compare/v0.1.27...v0.1.28) (2023-01-13)
|
||||||
|
|
||||||
### [0.1.27](https://github.com/nuxtlabs/ui/compare/v0.1.26...v0.1.27) (2023-01-12)
|
### [0.1.27](https://github.com/nuxtlabs/ui/compare/v0.1.26...v0.1.27) (2023-01-12)
|
||||||
|
|||||||
14
package.json
14
package.json
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nuxthq/ui",
|
"name": "@nuxthq/ui",
|
||||||
"version": "0.1.28",
|
"version": "0.1.32",
|
||||||
"repository": "https://github.com/nuxtlabs/ui",
|
"repository": "https://github.com/nuxtlabs/ui",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"exports": {
|
"exports": {
|
||||||
@@ -34,9 +34,9 @@
|
|||||||
"@tailwindcss/aspect-ratio": "^0.4.2",
|
"@tailwindcss/aspect-ratio": "^0.4.2",
|
||||||
"@tailwindcss/forms": "^0.5.3",
|
"@tailwindcss/forms": "^0.5.3",
|
||||||
"@tailwindcss/line-clamp": "^0.4.2",
|
"@tailwindcss/line-clamp": "^0.4.2",
|
||||||
"@tailwindcss/typography": "^0.5.8",
|
"@tailwindcss/typography": "^0.5.9",
|
||||||
"@vueuse/core": "^9.10.0",
|
"@vueuse/core": "^9.11.1",
|
||||||
"@vueuse/integrations": "^9.10.0",
|
"@vueuse/integrations": "^9.11.1",
|
||||||
"defu": "^6.1.1",
|
"defu": "^6.1.1",
|
||||||
"fuse.js": "^6.6.2",
|
"fuse.js": "^6.6.2",
|
||||||
"lodash-es": "^4.17.21",
|
"lodash-es": "^4.17.21",
|
||||||
@@ -46,11 +46,11 @@
|
|||||||
"@nuxt/module-builder": "^0.2.1",
|
"@nuxt/module-builder": "^0.2.1",
|
||||||
"@nuxtjs/eslint-config-typescript": "^12.0.0",
|
"@nuxtjs/eslint-config-typescript": "^12.0.0",
|
||||||
"@types/lodash-es": "^4.17.6",
|
"@types/lodash-es": "^4.17.6",
|
||||||
"eslint": "^8.31.0",
|
"eslint": "^8.32.0",
|
||||||
"nuxt": "^3.0.0",
|
"nuxt": "^3.0.0",
|
||||||
"standard-version": "^9.5.0",
|
"standard-version": "^9.5.0",
|
||||||
"unbuild": "^1.0.2",
|
"unbuild": "^1.1.1",
|
||||||
"vue-tsc": "^1.0.20"
|
"vue-tsc": "^1.0.24"
|
||||||
},
|
},
|
||||||
"build": {
|
"build": {
|
||||||
"externals": [
|
"externals": [
|
||||||
|
|||||||
@@ -7,7 +7,12 @@
|
|||||||
v-bind="buttonProps"
|
v-bind="buttonProps"
|
||||||
>
|
>
|
||||||
<Icon v-if="isLeading && leadingIconName" :name="leadingIconName" :class="leadingIconClass" aria-hidden="true" />
|
<Icon v-if="isLeading && leadingIconName" :name="leadingIconName" :class="leadingIconClass" aria-hidden="true" />
|
||||||
<slot><span :class="truncate ? 'text-left break-all line-clamp-1' : ''">{{ label }}</span></slot>
|
<slot>
|
||||||
|
<span :class="[truncate ? 'text-left break-all line-clamp-1' : '', compact ? 'hidden sm:block' : '']">
|
||||||
|
<span :class="[labelCompact && 'hidden sm:block']">{{ label }}</span>
|
||||||
|
<span v-if="labelCompact" class="sm:hidden">{{ labelCompact }}</span>
|
||||||
|
</span>
|
||||||
|
</slot>
|
||||||
<Icon v-if="isTrailing && trailingIconName" :name="trailingIconName" :class="trailingIconClass" aria-hidden="true" />
|
<Icon v-if="isTrailing && trailingIconName" :name="trailingIconName" :class="trailingIconClass" aria-hidden="true" />
|
||||||
</component>
|
</component>
|
||||||
</template>
|
</template>
|
||||||
@@ -34,6 +39,10 @@ const props = defineProps({
|
|||||||
type: String,
|
type: String,
|
||||||
default: null
|
default: null
|
||||||
},
|
},
|
||||||
|
labelCompact: {
|
||||||
|
type: String,
|
||||||
|
default: null
|
||||||
|
},
|
||||||
loading: {
|
loading: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
@@ -127,6 +136,10 @@ const props = defineProps({
|
|||||||
truncate: {
|
truncate: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
|
},
|
||||||
|
compact: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -164,7 +177,7 @@ const buttonClass = computed(() => {
|
|||||||
return classNames(
|
return classNames(
|
||||||
props.baseClass,
|
props.baseClass,
|
||||||
$ui.button.size[props.size],
|
$ui.button.size[props.size],
|
||||||
$ui.button[isSquare.value ? 'square' : 'spacing'][props.size],
|
$ui.button[isSquare.value ? 'square' : (props.compact ? 'compact' : 'spacing')][props.size],
|
||||||
$ui.button.variant[props.variant],
|
$ui.button.variant[props.variant],
|
||||||
props.block ? 'w-full flex justify-center items-center' : 'inline-flex items-center',
|
props.block ? 'w-full flex justify-center items-center' : 'inline-flex items-center',
|
||||||
props.rounded ? 'rounded-full' : props.roundedClass,
|
props.rounded ? 'rounded-full' : props.roundedClass,
|
||||||
@@ -192,7 +205,7 @@ const leadingIconClass = computed(() => {
|
|||||||
return classNames(
|
return classNames(
|
||||||
props.iconBaseClass,
|
props.iconBaseClass,
|
||||||
$ui.button.icon.size[props.size],
|
$ui.button.icon.size[props.size],
|
||||||
(!!slots.default || !!props.label?.length) && $ui.button.icon.leading.spacing[props.size],
|
(!!slots.default || !!props.label?.length) && $ui.button.icon.leading[props.compact ? 'compactSpacing' : 'spacing'][props.size],
|
||||||
props.leadingIconClass,
|
props.leadingIconClass,
|
||||||
props.loading && 'animate-spin'
|
props.loading && 'animate-spin'
|
||||||
)
|
)
|
||||||
@@ -202,7 +215,7 @@ const trailingIconClass = computed(() => {
|
|||||||
return classNames(
|
return classNames(
|
||||||
props.iconBaseClass,
|
props.iconBaseClass,
|
||||||
$ui.button.icon.size[props.size],
|
$ui.button.icon.size[props.size],
|
||||||
(!!slots.default || !!props.label?.length) && $ui.button.icon.trailing.spacing[props.size],
|
(!!slots.default || !!props.label?.length) && $ui.button.icon.trailing[props.compact ? 'compactSpacing' : 'spacing'][props.size],
|
||||||
props.trailingIconClass,
|
props.trailingIconClass,
|
||||||
props.loading && !isLeading.value && 'animate-spin'
|
props.loading && !isLeading.value && 'animate-spin'
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
v-if="closeIcon"
|
v-if="closeIcon"
|
||||||
:icon="closeIcon"
|
:icon="closeIcon"
|
||||||
variant="transparent"
|
variant="transparent"
|
||||||
class="absolute right-3"
|
class="absolute right-2"
|
||||||
aria-label="close"
|
aria-label="close"
|
||||||
@click="onClear"
|
@click="onClear"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -26,6 +26,14 @@ export default function defaultPreset (variantColors: string[]) {
|
|||||||
lg: 'p-2',
|
lg: 'p-2',
|
||||||
xl: 'p-3'
|
xl: 'p-3'
|
||||||
},
|
},
|
||||||
|
compact: {
|
||||||
|
xxs: 'p-1 sm:px-2',
|
||||||
|
xs: 'p-1.5 sm:px-2.5',
|
||||||
|
sm: 'p-2 sm:px-3',
|
||||||
|
md: 'p-2 sm:px-4',
|
||||||
|
lg: 'p-2 sm:px-4',
|
||||||
|
xl: 'p-3 sm:px-6'
|
||||||
|
},
|
||||||
variant: {
|
variant: {
|
||||||
...variantColors.reduce((acc: any, color: string) => {
|
...variantColors.reduce((acc: any, color: string) => {
|
||||||
acc[color] = `shadow-sm border border-transparent text-white bg-${color}-600 hover:bg-${color}-700 disabled:bg-${color}-600 focus:ring-2 focus:ring-offset-2 focus:ring-${color}-500`
|
acc[color] = `shadow-sm border border-transparent text-white bg-${color}-600 hover:bg-${color}-700 disabled:bg-${color}-600 focus:ring-2 focus:ring-offset-2 focus:ring-${color}-500`
|
||||||
@@ -57,6 +65,14 @@ export default function defaultPreset (variantColors: string[]) {
|
|||||||
md: '-ml-1 mr-2',
|
md: '-ml-1 mr-2',
|
||||||
lg: '-ml-1 mr-3',
|
lg: '-ml-1 mr-3',
|
||||||
xl: '-ml-1 mr-3'
|
xl: '-ml-1 mr-3'
|
||||||
|
},
|
||||||
|
compactSpacing: {
|
||||||
|
xxs: 'sm:-ml-0.5 sm:mr-1',
|
||||||
|
xs: 'sm:-ml-0.5 sm:mr-1.5',
|
||||||
|
sm: 'sm:-ml-0.5 sm:mr-2',
|
||||||
|
md: 'sm:-ml-1 sm:mr-2',
|
||||||
|
lg: 'sm:-ml-1 sm:mr-3',
|
||||||
|
xl: 'sm:-ml-1 sm:mr-3'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
trailing: {
|
trailing: {
|
||||||
@@ -67,6 +83,14 @@ export default function defaultPreset (variantColors: string[]) {
|
|||||||
md: 'ml-2 -mr-1',
|
md: 'ml-2 -mr-1',
|
||||||
lg: 'ml-3 -mr-1',
|
lg: 'ml-3 -mr-1',
|
||||||
xl: 'ml-3 -mr-1'
|
xl: 'ml-3 -mr-1'
|
||||||
|
},
|
||||||
|
compactSpacing: {
|
||||||
|
xxs: 'sm:ml-1 sm:-mr-0.5',
|
||||||
|
xs: 'sm:ml-1.5 sm:-mr-0.5',
|
||||||
|
sm: 'sm:ml-2 sm:-mr-0.5',
|
||||||
|
md: 'sm:ml-2 sm:-mr-1',
|
||||||
|
lg: 'sm:ml-3 sm:-mr-1',
|
||||||
|
xl: 'sm:ml-3 sm:-mr-1'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user