design-system-next 1.2.21 → 1.2.22
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/design-system-next.js +784 -766
- package/dist/design-system-next.js.gz +0 -0
- package/dist/main.css +1 -1
- package/dist/main.css.gz +0 -0
- package/package.json +1 -1
- package/src/App.vue +232 -26
- package/src/assets/styles/tailwind.css +6 -0
- package/src/components/avatar/avatar.ts +14 -3
- package/src/components/avatar/avatar.vue +5 -5
- package/src/components/avatar/use-avatar.ts +18 -15
- package/src/components/table/table.ts +2 -2
- package/src/components/table/table.vue +9 -4
|
@@ -3,26 +3,29 @@ import type { AvatarPropTypes } from './avatar';
|
|
|
3
3
|
|
|
4
4
|
import classNames from 'classnames';
|
|
5
5
|
export const useAvatar = (props: AvatarPropTypes) => {
|
|
6
|
-
const { size } = toRefs(props);
|
|
6
|
+
const { size, color } = toRefs(props);
|
|
7
7
|
const avatarClassses = computed(() => {
|
|
8
|
-
return classNames(' relative inline-block'
|
|
8
|
+
return classNames(' relative inline-block rounded-full', {
|
|
9
|
+
'background-color-surface': color.value === 'primary',
|
|
10
|
+
'background-color': color.value === 'secondary',
|
|
11
|
+
});
|
|
9
12
|
});
|
|
10
13
|
|
|
11
14
|
const avatarImageClassses = computed(() => {
|
|
12
|
-
return classNames('
|
|
13
|
-
'
|
|
14
|
-
'
|
|
15
|
-
'
|
|
16
|
-
'
|
|
17
|
-
'
|
|
18
|
-
'
|
|
19
|
-
'
|
|
15
|
+
return classNames('rounded-full object-cover flex items-center justify-center overflow-hidden', {
|
|
16
|
+
'h-20 min-w-20': size.value === '2xl',
|
|
17
|
+
'h-14 min-w-14': size.value === 'xl',
|
|
18
|
+
'h-10 min-w-10': size.value === 'lg',
|
|
19
|
+
'h-9 min-w-9': size.value === 'md',
|
|
20
|
+
'h-6 min-w-6': size.value === 'sm',
|
|
21
|
+
'h-5 min-w-5': size.value === 'xs',
|
|
22
|
+
'h-4 min-w-4': size.value === '2xs',
|
|
20
23
|
});
|
|
21
24
|
});
|
|
22
25
|
|
|
23
26
|
const initialClassses = computed(() => {
|
|
24
27
|
return classNames(
|
|
25
|
-
' rounded-full
|
|
28
|
+
' rounded-full border-color-weak border border-solid items-center flex justify-center heading-xs text-color-strong',
|
|
26
29
|
{
|
|
27
30
|
' h-20 min-w-20': size.value === '2xl',
|
|
28
31
|
' h-14 min-w-14 body-lg-regular-medium': size.value === 'xl',
|
|
@@ -57,11 +60,11 @@ export const useAvatar = (props: AvatarPropTypes) => {
|
|
|
57
60
|
});
|
|
58
61
|
|
|
59
62
|
const getAvatarSize = computed(() => {
|
|
60
|
-
if (['2xl'].includes(size.value)) return { notif: 'big',
|
|
61
|
-
if (['xl', 'lg'].includes(size.value)) return { notif: 'big',
|
|
62
|
-
if (['md', 'sm'].includes(size.value)) return { notif: 'small',
|
|
63
|
+
if (['2xl'].includes(size.value)) return { notif: 'big', badge: 'big' };
|
|
64
|
+
if (['xl', 'lg'].includes(size.value)) return { notif: 'big', badge: 'tiny' };
|
|
65
|
+
if (['md', 'sm'].includes(size.value)) return { notif: 'small', badge: 'tiny' };
|
|
63
66
|
|
|
64
|
-
return { notif: 'tiny',
|
|
67
|
+
return { notif: 'tiny', badge: 'tiny' };
|
|
65
68
|
});
|
|
66
69
|
|
|
67
70
|
return {
|
|
@@ -36,16 +36,21 @@
|
|
|
36
36
|
<!-- for action Button -->
|
|
37
37
|
<th
|
|
38
38
|
v-if="action"
|
|
39
|
-
class="
|
|
40
|
-
|
|
39
|
+
class="background-color-surface text-color-strong font-size-100 font-line-height-100 font-letter-spacing-normal sticky top-0 z-10 border-none px-size-spacing-2xs py-size-spacing-3xs text-start font-medium uppercase"
|
|
40
|
+
>
|
|
41
|
+
<slot
|
|
42
|
+
name="action-name"
|
|
43
|
+
class="background-color-surface text-color-strong font-size-100 font-line-height-100 font-letter-spacing-normal uppercase"
|
|
44
|
+
/>
|
|
45
|
+
</th>
|
|
41
46
|
</tr>
|
|
42
47
|
</thead>
|
|
43
48
|
<tbody v-if="sortedData.length > 0">
|
|
44
49
|
<tr v-for="(item, keyIndex) in sortedData" :key="keyIndex" class="hover:background-color-hover min-h-[60px]">
|
|
45
50
|
<td v-for="(column, headerKey) in headers" :key="headerKey" class="border-b px-6 py-3">
|
|
46
|
-
<div class="flex flex-row items-center gap-2">
|
|
51
|
+
<div v-if="sortedData[keyIndex][column.field]" class="flex flex-row items-center gap-2">
|
|
47
52
|
<spr-avatar
|
|
48
|
-
v-if="column.hasAvatar"
|
|
53
|
+
v-if="column.hasAvatar && sortedData[keyIndex][column.field].image"
|
|
49
54
|
size="lg"
|
|
50
55
|
:src="sortedData[keyIndex][column.field].image"
|
|
51
56
|
alt="User Avatar"
|