Skip to content

Commit b2d279c

Browse files
authored
Merge pull request #4116 from balancer/release/1.121.0
Release 1.121.0
2 parents 1ecb150 + 70cb734 commit b2d279c

File tree

26 files changed

+947
-389
lines changed

26 files changed

+947
-389
lines changed

package-lock.json

Lines changed: 63 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@balancer/frontend-v2",
3-
"version": "1.120.28",
3+
"version": "1.121.0",
44
"engines": {
55
"node": "=16",
66
"npm": ">=8"
@@ -100,6 +100,8 @@
100100
"bnc-sdk": "^3.7.1",
101101
"buffer": "^6.0.3",
102102
"cac": "^6.7.14",
103+
"class-variance-authority": "^0.7.0",
104+
"clsx": "^2.0.0",
103105
"color": "^4.2.3",
104106
"color.js": "^1.2.0",
105107
"date-fns": "^2.21.1",
@@ -138,6 +140,7 @@
138140
"stylelint-config-tailwindcss": "^0.0.7",
139141
"stylelint-prettier": "^2.0.0",
140142
"tailwind-config-viewer": "^1.7.2",
143+
"tailwind-merge": "^1.14.0",
141144
"tailwindcss": "^3.2.4",
142145
"typescript": "^4.9.4",
143146
"ua-parser-js": "^1.0.35",

src/assets/css/global/animations.css

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,25 @@
112112
.appear-leave-active {
113113
@apply transition-all duration-200 ease-in;
114114
}
115+
116+
/* POP */
117+
.pop-enter-active {
118+
animation: pop 0.5s;
119+
}
120+
121+
.pop-leave-active {
122+
animation: pop 0.25s reverse;
123+
}
124+
@keyframes pop {
125+
0% {
126+
transform: scale(0);
127+
}
128+
129+
50% {
130+
transform: scale(1.1);
131+
}
132+
133+
100% {
134+
transform: scale(1);
135+
}
136+
}

src/components/_global/BalBtn/BalBtn.vue

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ type Props = {
5151
loading?: boolean;
5252
loadingLabel?: string;
5353
disabled?: boolean;
54+
justifyContent?: 'start' | 'center' | 'end' | 'between';
5455
};
5556
5657
const props = withDefaults(defineProps<Props>(), {
@@ -66,6 +67,7 @@ const props = withDefaults(defineProps<Props>(), {
6667
loading: false,
6768
loadingLabel: 'loading...',
6869
disabled: false,
70+
justifyContent: 'center',
6971
});
7072
7173
const sizeClasses = computed(() => {
@@ -185,6 +187,11 @@ const displayClasses = computed(() => {
185187
return 'inline-block';
186188
});
187189
190+
const contentClasses = computed(() => {
191+
if (!props.justifyContent) return 'justify-center';
192+
return `justify-${props.justifyContent}`;
193+
});
194+
188195
const shapeClasses = computed(() => {
189196
if (props.circle || props.rounded) return 'rounded-full';
190197
return 'rounded-lg';
@@ -234,7 +241,7 @@ const iconColor = computed(() => {
234241
{{ loadingLabel }}
235242
</span>
236243
</div>
237-
<div v-else class="content">
244+
<div v-else :class="['content', contentClasses]">
238245
<span v-if="label">
239246
{{ label }}
240247
</span>
@@ -260,6 +267,6 @@ const iconColor = computed(() => {
260267
}
261268
262269
.content {
263-
@apply flex justify-center items-center w-full h-full;
270+
@apply flex items-center w-full h-full;
264271
}
265272
</style>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<script lang="ts" setup>
2+
import { VariantProps, cva } from 'class-variance-authority';
3+
import {
4+
alignItemVariants,
5+
cn,
6+
justifyVariants,
7+
paddingVariants,
8+
widthVariants,
9+
xSpacingVariants,
10+
} from '@/lib/utils/styles';
11+
12+
const variants = cva('flex flex-row', {
13+
variants: {
14+
justify: justifyVariants,
15+
align: alignItemVariants,
16+
spacing: xSpacingVariants,
17+
padd: paddingVariants,
18+
width: widthVariants,
19+
},
20+
});
21+
22+
type Props = VariantProps<typeof variants>;
23+
24+
defineProps<{
25+
justify?: Props['justify'];
26+
align?: Props['align'];
27+
spacing?: Props['spacing'];
28+
padd?: Props['padd'];
29+
width?: Props['width'];
30+
}>();
31+
</script>
32+
33+
<template>
34+
<div :class="cn(variants({ justify, align, spacing, padd, width }))">
35+
<slot />
36+
</div>
37+
</template>

src/components/_global/BalSelectInput/BalSelectInput.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
v-bind="$attrs"
1616
@change="onChange"
1717
>
18-
<option v-if="defaultText" value="" hidden>
18+
<option v-if="defaultText" value selected>
1919
{{ defaultText }}
2020
</option>
2121
<option
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<script lang="ts" setup>
2+
import { VariantProps, cva } from 'class-variance-authority';
3+
import { cn } from '@/lib/utils/styles';
4+
5+
const variants = cva('flex flex-row items-center font-medium rounded-full', {
6+
variants: {
7+
color: {
8+
blue: 'bg-blue-50 dark:bg-blue-900 border border-blue-200 dark:border-blue-600 text-blue-500 dark:text-blue-300',
9+
},
10+
size: {
11+
md: 'shadow-sm text-sm py-1 px-2 space-x-1',
12+
},
13+
},
14+
defaultVariants: {
15+
color: 'blue',
16+
size: 'md',
17+
},
18+
});
19+
20+
type TagVariantProps = VariantProps<typeof variants>;
21+
22+
withDefaults(
23+
defineProps<{
24+
color?: TagVariantProps['color'];
25+
size?: TagVariantProps['size'];
26+
closeable?: boolean;
27+
iconSize?: 'xs' | 'sm' | 'md' | 'lg';
28+
}>(),
29+
{
30+
iconSize: 'xs',
31+
}
32+
);
33+
34+
const emit = defineEmits(['closed']);
35+
</script>
36+
37+
<template>
38+
<BalHStack :class="cn(variants({ color, size }))">
39+
<slot />
40+
<BalIcon
41+
v-if="closeable"
42+
name="x"
43+
:size="iconSize"
44+
class="cursor-pointer"
45+
@click="emit('closed')"
46+
/>
47+
</BalHStack>
48+
</template>

0 commit comments

Comments
 (0)