nuance-ui 0.1.42 → 0.1.44
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/dist/module.json +1 -1
- package/dist/runtime/components/button/button.d.vue.ts +1 -0
- package/dist/runtime/components/button/button.module.css +1 -1
- package/dist/runtime/components/button/button.vue +6 -3
- package/dist/runtime/components/button/button.vue.d.ts +1 -0
- package/dist/runtime/components/files/file-upload-button.vue +5 -2
- package/dist/runtime/components/link/link-button.vue +1 -0
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -3,6 +3,7 @@ import type { HTMLAttributes } from 'vue';
|
|
|
3
3
|
import type { BoxProps } from '../box.vue.js';
|
|
4
4
|
export interface ButtonProps extends BoxProps {
|
|
5
5
|
size?: NuanceSize | `compact-${NuanceSize}`;
|
|
6
|
+
spacing?: NuanceSize | string;
|
|
6
7
|
variant?: 'filled' | 'light' | 'outline' | 'subtle' | 'default' | 'gradient' | 'gradient-outline';
|
|
7
8
|
gradient?: NuanceGradient;
|
|
8
9
|
loading?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.root{--button-height-xs:rem(30px);--button-height-sm:rem(36px);--button-height-md:rem(42px);--button-height-lg:rem(50px);--button-height-xl:rem(60px);--button-height-compact-xs:rem(22px);--button-height-compact-sm:rem(26px);--button-height-compact-md:rem(30px);--button-height-compact-lg:rem(34px);--button-height-compact-xl:rem(40px);--button-padding-x-xs:rem(14px);--button-padding-x-sm:rem(18px);--button-padding-x-md:rem(22px);--button-padding-x-lg:rem(26px);--button-padding-x-xl:rem(32px);--button-padding-x-compact-xs:rem(7px);--button-padding-x-compact-sm:rem(8px);--button-padding-x-compact-md:rem(10px);--button-padding-x-compact-lg:rem(12px);--button-padding-x-compact-xl:rem(14px);--button-height:var(--button-height-sm);--button-padding-x:var(--button-padding-x-sm);--button-color:var(--color-white);--button-fz:var(--font-size-sm);--button-bg:var(--color-primary-filled);--button-radius:var(--radius-default);--button-hover:var(--color-primary-filled-hover);--button-section-size:calc(var(--button-height) - 0.25rem);background:var(--button-bg);border:var(--button-bd,rem(1px) solid transparent);border-radius:var(--button-radius);color:var(--button-color,var(--color-white));cursor:pointer;display:inline-block;font-size:var(--button-fz);font-weight:600;height:var(--button-height,var(--button-height-sm));line-height:1;overflow:hidden;padding-inline:var(--button-padding-x,var(--button-padding-x-sm));position:relative;text-align:center;transition:background-color .2s ease-in,color .2s ease-in;-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:middle;width:auto}.root:where([data-with-left-section]){padding-inline-start:0}.root:where([data-with-right-section]){padding-inline-end:0}.root:where([data-variant=gradient-outline]){background-clip:padding-box,border-box;background-origin:border-box}.root:where(:disabled:not([data-loading])){background:var(--color-disabled);border:1px solid transparent;color:var(--color-disabled);cursor:not-allowed;transform:none}.root:before{border-radius:var(--button-radius,var(--radius-default));content:"";filter:blur(12px);inset:-1px;opacity:0;pointer-events:none;position:absolute;transform:translateY(-100%);transition:transform .15s ease,opacity .1s ease;@mixin where-light{background:var(--color-gray-1);color:var(--color-gray-5)}@mixin where-dark{background:var(--color-dark-6);color:var(--color-dark-3)}}.root:where([data-loading]){cursor:not-allowed;transform:none}.root:where([data-loading]):before{opacity:1;transform:translateY(0)}.root:where([data-loading]) .inner{opacity:0;transform:translateY(100%)}.root:hover:where(:not([data-loading],:disabled)){background:var(--button-hover);color:var(--button-color)}.root:hover:where(:not([data-loading],:disabled)):where([data-variant=gradient-outline]){color:#fff}.inner{gap:var(--spacing
|
|
1
|
+
.root{--button-height-xs:rem(30px);--button-height-sm:rem(36px);--button-height-md:rem(42px);--button-height-lg:rem(50px);--button-height-xl:rem(60px);--button-height-compact-xs:rem(22px);--button-height-compact-sm:rem(26px);--button-height-compact-md:rem(30px);--button-height-compact-lg:rem(34px);--button-height-compact-xl:rem(40px);--button-padding-x-xs:rem(14px);--button-padding-x-sm:rem(18px);--button-padding-x-md:rem(22px);--button-padding-x-lg:rem(26px);--button-padding-x-xl:rem(32px);--button-padding-x-compact-xs:rem(7px);--button-padding-x-compact-sm:rem(8px);--button-padding-x-compact-md:rem(10px);--button-padding-x-compact-lg:rem(12px);--button-padding-x-compact-xl:rem(14px);--button-height:var(--button-height-sm);--button-padding-x:var(--button-padding-x-sm);--button-color:var(--color-white);--button-fz:var(--font-size-sm);--button-bg:var(--color-primary-filled);--button-radius:var(--radius-default);--button-hover:var(--color-primary-filled-hover);--button-spacing:0;--button-section-size:calc(var(--button-height) - 0.25rem);background:var(--button-bg);border:var(--button-bd,rem(1px) solid transparent);border-radius:var(--button-radius);color:var(--button-color,var(--color-white));cursor:pointer;display:inline-block;font-size:var(--button-fz);font-weight:600;height:var(--button-height,var(--button-height-sm));line-height:1;overflow:hidden;padding-inline:var(--button-padding-x,var(--button-padding-x-sm));position:relative;text-align:center;transition:background-color .2s ease-in,color .2s ease-in;-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:middle;width:auto}.root:where([data-with-left-section]){padding-inline-start:0}.root:where([data-with-right-section]){padding-inline-end:0}.root:where([data-variant=gradient-outline]){background-clip:padding-box,border-box;background-origin:border-box}.root:where(:disabled:not([data-loading])){background:var(--color-disabled);border:1px solid transparent;color:var(--color-disabled);cursor:not-allowed;transform:none}.root:before{border-radius:var(--button-radius,var(--radius-default));content:"";filter:blur(12px);inset:-1px;opacity:0;pointer-events:none;position:absolute;transform:translateY(-100%);transition:transform .15s ease,opacity .1s ease;@mixin where-light{background:var(--color-gray-1);color:var(--color-gray-5)}@mixin where-dark{background:var(--color-dark-6);color:var(--color-dark-3)}}.root:where([data-loading]){cursor:not-allowed;transform:none}.root:where([data-loading]):before{opacity:1;transform:translateY(0)}.root:where([data-loading]) .inner{opacity:0;transform:translateY(100%)}.root:hover:where(:not([data-loading],:disabled)){background:var(--button-hover);color:var(--button-color)}.root:hover:where(:not([data-loading],:disabled)):where([data-variant=gradient-outline]){color:#fff}.inner{gap:var(--button-spacing);justify-content:center;overflow:visible;transition:transform .15s ease,opacity .1s ease;width:100%}.inner,.label{align-items:center;display:flex;height:100%}.label{flex:1;opacity:1;overflow:hidden;white-space:nowrap}.label:where([data-loading]){opacity:.2}.section{--section-pointer-events:none;align-items:center;display:flex;height:100%;justify-content:center;pointer-events:var(--section-pointer-events);width:var(--button-section-size)}.loader{left:calc(50% - var(--loader-size)/2);position:absolute;top:calc(50% - var(--loader-size)/2)}.group{--button-border-width:1px;display:flex}.group :where(.root):focus{position:relative;z-index:1}.group[data-orientation=horizontal]{flex-direction:row}.group[data-orientation=horizontal] .root:not(:only-child):first-child{border-end-end-radius:0;border-inline-end-width:calc(var(--button-border-width)/2);border-start-end-radius:0}.group[data-orientation=horizontal] .root:not(:only-child):last-child{border-end-start-radius:0;border-inline-start-width:calc(var(--button-border-width)/2);border-start-start-radius:0}.group[data-orientation=horizontal] .root:not(:only-child):not(:first-child):not(:last-child){border-inline-width:calc(var(--button-border-width)/2);border-radius:0}.group[data-orientation=vertical]{flex-direction:column}.group[data-orientation=vertical] .root:not(:only-child):first-child{border-bottom-width:calc(var(--button-border-width)/2);border-end-end-radius:0;border-end-start-radius:0}.group[data-orientation=vertical] .root:not(:only-child):last-child{border-start-end-radius:0;border-start-start-radius:0;border-top-width:calc(var(--button-border-width)/2)}.group[data-orientation=vertical] .root:not(:only-child):not(:first-child):not(:last-child){border-bottom-width:calc(var(--button-border-width)/2);border-radius:0;border-top-width:calc(var(--button-border-width)/2)}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { useStyleResolver } from "@nui/composals";
|
|
3
|
-
import { createVariantColorResolver, getFontSize, getRadius, getSize } from "@nui/utils";
|
|
3
|
+
import { createVariantColorResolver, getFontSize, getRadius, getSize, getSpacing } from "@nui/utils";
|
|
4
4
|
import { computed } from "vue";
|
|
5
5
|
import Box from "../box.vue";
|
|
6
6
|
import Loader from "../loader/loader.vue";
|
|
7
7
|
import css from "./button.module.css";
|
|
8
8
|
const {
|
|
9
9
|
color,
|
|
10
|
-
size
|
|
10
|
+
size,
|
|
11
11
|
variant = "default",
|
|
12
|
+
spacing,
|
|
12
13
|
gradient,
|
|
13
14
|
loading,
|
|
14
15
|
classes,
|
|
@@ -21,6 +22,7 @@ const {
|
|
|
21
22
|
mod: _mod
|
|
22
23
|
} = defineProps({
|
|
23
24
|
size: { type: null, required: false },
|
|
25
|
+
spacing: { type: String, required: false },
|
|
24
26
|
variant: { type: String, required: false },
|
|
25
27
|
gradient: { type: Object, required: false },
|
|
26
28
|
loading: { type: Boolean, required: false },
|
|
@@ -51,7 +53,8 @@ const style = computed(() => useStyleResolver((theme) => {
|
|
|
51
53
|
"--button-hover": hover,
|
|
52
54
|
"--button-color": text,
|
|
53
55
|
"--button-bd": border,
|
|
54
|
-
"--button-radius": getRadius(radius)
|
|
56
|
+
"--button-radius": getRadius(radius),
|
|
57
|
+
"--button-spacing": getSpacing(spacing)
|
|
55
58
|
},
|
|
56
59
|
leftSection: {
|
|
57
60
|
"--section-pointer-events": leftSectionPE
|
|
@@ -3,6 +3,7 @@ import type { HTMLAttributes } from 'vue';
|
|
|
3
3
|
import type { BoxProps } from '../box.vue.js';
|
|
4
4
|
export interface ButtonProps extends BoxProps {
|
|
5
5
|
size?: NuanceSize | `compact-${NuanceSize}`;
|
|
6
|
+
spacing?: NuanceSize | string;
|
|
6
7
|
variant?: 'filled' | 'light' | 'outline' | 'subtle' | 'default' | 'gradient' | 'gradient-outline';
|
|
7
8
|
gradient?: NuanceGradient;
|
|
8
9
|
loading?: boolean;
|
|
@@ -16,6 +16,7 @@ const {
|
|
|
16
16
|
reset: { type: null, required: false },
|
|
17
17
|
directory: { type: null, required: false },
|
|
18
18
|
size: { type: null, required: false },
|
|
19
|
+
spacing: { type: String, required: false },
|
|
19
20
|
variant: { type: String, required: false },
|
|
20
21
|
gradient: { type: Object, required: false },
|
|
21
22
|
loading: { type: Boolean, required: false },
|
|
@@ -59,9 +60,11 @@ defineExpose({ files, reset });
|
|
|
59
60
|
</script>
|
|
60
61
|
|
|
61
62
|
<template>
|
|
62
|
-
<Button
|
|
63
|
+
<Button v-bind='props' @click='open'>
|
|
63
64
|
<template #leftSection>
|
|
64
|
-
<slot name='leftSection'
|
|
65
|
+
<slot name='leftSection'>
|
|
66
|
+
<Icon :name='icon' />
|
|
67
|
+
</slot>
|
|
65
68
|
</template>
|
|
66
69
|
<template v-if='!!$slots.rightSection' #rightSection>
|
|
67
70
|
<slot name='rightSection' />
|
|
@@ -18,6 +18,7 @@ const props = defineProps({
|
|
|
18
18
|
viewTransition: { type: Boolean, required: false },
|
|
19
19
|
replace: { type: Boolean, required: false },
|
|
20
20
|
size: { type: null, required: false },
|
|
21
|
+
spacing: { type: String, required: false },
|
|
21
22
|
variant: { type: String, required: false },
|
|
22
23
|
gradient: { type: Object, required: false },
|
|
23
24
|
loading: { type: Boolean, required: false },
|