@bimdata/design-system 3.0.0-beta.1 → 3.0.0-beta.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bimdata/design-system",
3
- "version": "3.0.0-beta.1",
3
+ "version": "3.0.0-beta.2",
4
4
  "type": "module",
5
5
  "main": "./src/BIMDataComponents/index.js",
6
6
  "module": "./src/BIMDataComponents/index.js",
@@ -27,14 +27,14 @@
27
27
  "@vitejs/plugin-vue": "^6.0.0",
28
28
  "conventional-changelog-eslint": "^6.0.0",
29
29
  "eslint": "^9.31.0",
30
- "eslint-config-prettier": "^10.1.5",
31
- "eslint-plugin-prettier": "^5.5.1",
30
+ "eslint-config-prettier": "^10.1.8",
31
+ "eslint-plugin-prettier": "^5.5.3",
32
32
  "eslint-plugin-vue": "^10.3.0",
33
33
  "prettier": "^3.6.2",
34
34
  "prismjs": "^1.30.0",
35
35
  "sass-embedded": "^1.89.2",
36
36
  "semantic-release": "^24.2.7",
37
- "vite": "^7.0.4",
37
+ "vite": "^7.0.5",
38
38
  "vue": "^3.5.17",
39
39
  "vue-router": "^4.5.1",
40
40
  "vue3-clipboard": "^1.0.0"
@@ -0,0 +1,93 @@
1
+ <template>
2
+ <div
3
+ class="bimdata-avatar"
4
+ :class="`bimdata-avatar--${user.profile_picture ? 'silver-light' : color}`"
5
+ :style="{
6
+ width: `${size}px`,
7
+ height: `${size}px`,
8
+ fontSize: `${initialsSize ?? +size * 0.382}px`,
9
+ }"
10
+ >
11
+ <template v-if="user.profile_picture">
12
+ <img :src="user.profile_picture" />
13
+ </template>
14
+ <template v-else-if="initials">
15
+ {{ initials }}
16
+ </template>
17
+ <template v-else>
18
+ <BIMDataIconUser size="xs" />
19
+ </template>
20
+ </div>
21
+ </template>
22
+
23
+ <script>
24
+ import { computed } from "vue";
25
+ import BIMDataIconUser from "../BIMDataIcon/BIMDataIconStandalone/BIMDataIconUser.vue";
26
+
27
+ export default {
28
+ props: {
29
+ user: {
30
+ type: Object,
31
+ required: true,
32
+ },
33
+ size: {
34
+ type: [Number, String],
35
+ default: 32,
36
+ validate: (value) => value >= 32,
37
+ },
38
+ initialsSize: {
39
+ type: [Number, String],
40
+ },
41
+ color: {
42
+ type: String,
43
+ default: "primary",
44
+ validate: (value) => ["primary", "secondary", "silver-light"].includes(value),
45
+ },
46
+ },
47
+ setup(props) {
48
+ const initials = computed(() =>
49
+ (
50
+ `${props.user.firstname?.[0] ?? ""}` +
51
+ `${props.user.lastname?.[0] ?? ""}`
52
+ ).toUpperCase()
53
+ );
54
+
55
+ return {
56
+ initials,
57
+ };
58
+ },
59
+ };
60
+ </script>
61
+
62
+ <style scoped>
63
+ .bimdata-avatar {
64
+ min-width: 32px;
65
+ min-height: 32px;
66
+
67
+ display: flex;
68
+ justify-content: center;
69
+ align-items: center;
70
+ border-radius: 50%;
71
+ overflow: hidden;
72
+
73
+ img {
74
+ width: 100%;
75
+ height: 100%;
76
+ }
77
+ }
78
+
79
+ .bimdata-avatar--primary {
80
+ background-color: var(--color-primary);
81
+ color: var(--color-silver-light);
82
+ }
83
+
84
+ .bimdata-avatar--secondary {
85
+ background-color: var(--color-secondary);
86
+ color: var(--color-primary);
87
+ }
88
+
89
+ .bimdata-avatar--silver-light {
90
+ background-color: var(--color-silver-light);
91
+ color: var(--color-primary);
92
+ }
93
+ </style>
@@ -7,6 +7,7 @@ import "../assets/css/utilities/_list.css";
7
7
  import "../assets/css/utilities/_spacing.css";
8
8
  import "../assets/css/utilities/_text.css";
9
9
 
10
+ export { default as BIMDataAvatar } from "./BIMDataAvatar/BIMDataAvatar.vue";
10
11
  export { default as BIMDataBigSpinner } from "./BIMDataBigSpinner/BIMDataBigSpinner.vue";
11
12
  export { default as BIMDataButton } from "./BIMDataButton/BIMDataButton.vue";
12
13
  export { default as BIMDataCard } from "./BIMDataCard/BIMDataCard.vue";