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

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.
Files changed (40) hide show
  1. package/package.json +1 -1
  2. package/src/BIMDataComponents/BIMDataCheckbox/BIMDataCheckbox.vue +9 -8
  3. package/src/BIMDataComponents/BIMDataColorSelector/BIMDataColorSelector.css +8 -0
  4. package/src/BIMDataComponents/BIMDataColorSelector/BIMDataColorSelector.vue +12 -1
  5. package/src/BIMDataComponents/BIMDataDropdownList/BIMDataDropdownList.vue +18 -12
  6. package/src/BIMDataComponents/BIMDataDropdownMenu/BIMDataDropdownMenu.vue +10 -5
  7. package/src/BIMDataComponents/BIMDataIcon/Icon.vue +1 -1
  8. package/src/BIMDataComponents/BIMDataInfobox/BIMDataInfobox.vue +18 -7
  9. package/src/BIMDataComponents/BIMDataInput/BIMDataInput.vue +23 -12
  10. package/src/BIMDataComponents/BIMDataList/BIMDataList.vue +2 -2
  11. package/src/BIMDataComponents/BIMDataMenu/BIMDataMenu.css +58 -0
  12. package/src/BIMDataComponents/BIMDataMenu/BIMDataMenu.vue +14 -4
  13. package/src/BIMDataComponents/BIMDataMenuInline/BIMDataMenuInline.css +5 -0
  14. package/src/BIMDataComponents/BIMDataMenuInline/BIMDataMenuInline.vue +16 -6
  15. package/src/BIMDataComponents/BIMDataNavigation/BIMDataNavigation.vue +17 -10
  16. package/src/BIMDataComponents/BIMDataPaginatedList/BIMDataPaginatedList.vue +20 -8
  17. package/src/BIMDataComponents/BIMDataPagination/{_BIMDataPagination.scss → BIMDataPagination.css} +4 -2
  18. package/src/BIMDataComponents/BIMDataPagination/BIMDataPagination.vue +20 -9
  19. package/src/BIMDataComponents/BIMDataRadio/BIMDataRadio.vue +10 -5
  20. package/src/BIMDataComponents/BIMDataSafeZoneInline/{_BIMDataSafeZoneInline.scss → BIMDataSafeZoneInline.css} +2 -2
  21. package/src/BIMDataComponents/BIMDataSafeZoneInline/BIMDataSafeZoneInline.vue +1 -1
  22. package/src/BIMDataComponents/BIMDataSearch/BIMDataSearch.css +1 -1
  23. package/src/BIMDataComponents/BIMDataSearchAutocomplete/BIMDataSearchAutocomplete.css +28 -0
  24. package/src/BIMDataComponents/BIMDataSearchAutocomplete/BIMDataSearchAutocomplete.vue +10 -1
  25. package/src/BIMDataComponents/BIMDataSelect/BIMDataSelect.css +45 -2
  26. package/src/BIMDataComponents/BIMDataSelect/BIMDataSelectMulti.vue +38 -14
  27. package/src/BIMDataComponents/BIMDataSelect/BIMDataSelectSingle.vue +10 -5
  28. package/src/BIMDataComponents/BIMDataSlider/{_BIMDataSlider.scss → BIMDataSlider.css} +39 -2
  29. package/src/BIMDataComponents/BIMDataSlider/BIMDataSlider.vue +13 -2
  30. package/src/BIMDataComponents/BIMDataTable/{_BIMDataTable.scss → BIMDataTable.css} +22 -4
  31. package/src/BIMDataComponents/BIMDataTable/BIMDataTable.vue +22 -17
  32. package/src/BIMDataComponents/BIMDataTable/column-sorting/ColumnSorting.vue +1 -1
  33. package/src/BIMDataComponents/BIMDataTabs/BIMDataTabs.vue +10 -5
  34. package/src/BIMDataComponents/BIMDataText/BIMDataText.css +10 -0
  35. package/src/BIMDataComponents/BIMDataText/BIMDataText.vue +19 -2
  36. package/src/BIMDataComponents/BIMDataTextarea/{_BIMDataTextarea.scss → BIMDataTextarea.css} +20 -9
  37. package/src/BIMDataComponents/BIMDataTextarea/BIMDataTextarea.vue +13 -1
  38. package/src/BIMDataComponents/BIMDataToggle/{_BIMDataToggle.scss → BIMDataToggle.css} +12 -1
  39. package/src/BIMDataComponents/BIMDataToggle/BIMDataToggle.vue +11 -2
  40. package/src/BIMDataComponents/BIMDataTree/BIMDataTree.vue +2 -2
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="bimdata-table">
2
+ <div class="bimdata-table" :class="{ dark: isDark }">
3
3
  <div
4
4
  class="bimdata-table__container"
5
5
  :style="{
@@ -51,7 +51,7 @@
51
51
  class="m-l-6"
52
52
  :class="{
53
53
  active: filters.some(
54
- filter => filter.columnKey === column.id
54
+ filter => filter.columnKey === column.id,
55
55
  ),
56
56
  }"
57
57
  @click="toggleFiltersMenu(column)"
@@ -63,7 +63,7 @@
63
63
  :column="column"
64
64
  :columnData="
65
65
  computedRows.map(
66
- computedRow => computedRow.data[column.id]
66
+ computedRow => computedRow.data[column.id],
67
67
  )
68
68
  "
69
69
  :filters="
@@ -164,7 +164,7 @@
164
164
  </template>
165
165
 
166
166
  <script>
167
- import { computed, ref, watch, shallowReactive } from "vue";
167
+ import { computed, inject, ref, watch, shallowReactive } from "vue";
168
168
  import { useRowSelection } from "./table-row-selection.js";
169
169
  import clickaway from "../../BIMDataDirectives/click-away.js";
170
170
 
@@ -245,9 +245,13 @@ export default {
245
245
  "row-drop",
246
246
  ],
247
247
  setup(props, { emit }) {
248
+ const darkThemeRef = inject("BIMDATA_DESIGN_SYSTEM_DARK_THEME");
249
+ const isDark = computed(() => {
250
+ return darkThemeRef.value;
251
+ });
248
252
  // Compute rows keys based on props values.
249
253
  const computedRows = computed(() =>
250
- props.rows.map((row, i) => ({ key: row[props.rowKey] ?? i, data: row }))
254
+ props.rows.map((row, i) => ({ key: row[props.rowKey] ?? i, data: row })),
251
255
  );
252
256
 
253
257
  const { rowSelection, toggleRowSelection, toggleFullSelection } =
@@ -273,7 +277,7 @@ export default {
273
277
  emit("all-deselected");
274
278
  }
275
279
  },
276
- }
280
+ },
277
281
  );
278
282
 
279
283
  const selectionState = computed(() =>
@@ -281,7 +285,7 @@ export default {
281
285
  ? rowSelection.value.size > 0
282
286
  ? null
283
287
  : false
284
- : rowSelection.value.size > 0
288
+ : rowSelection.value.size > 0,
285
289
  );
286
290
 
287
291
  const toggleRow = row => {
@@ -387,7 +391,7 @@ export default {
387
391
  return sortedRows.value.filter(row => {
388
392
  return filters.value.every(filter => {
389
393
  const column = props.columns.find(
390
- column => column.id === filter.columnKey
394
+ column => column.id === filter.columnKey,
391
395
  );
392
396
  const columnRowData = row.data[filter.columnKey];
393
397
 
@@ -399,17 +403,17 @@ export default {
399
403
  typeof column.filterFunction === "function"
400
404
  ? column.filterFunction(columnRowDataElement)
401
405
  : column.filterKey
402
- ? columnRowDataElement[column.filterKey]
403
- : columnRowDataElement
404
- )
406
+ ? columnRowDataElement[column.filterKey]
407
+ : columnRowDataElement,
408
+ ),
405
409
  );
406
410
  } else {
407
411
  return filter.columnFilters.includes(
408
412
  typeof column.filterFunction === "function"
409
413
  ? column.filterFunction(columnRowData)
410
414
  : column.filterKey
411
- ? columnRowData[column.filterKey]
412
- : columnRowData
415
+ ? columnRowData[column.filterKey]
416
+ : columnRowData,
413
417
  );
414
418
  }
415
419
  });
@@ -421,7 +425,7 @@ export default {
421
425
  */
422
426
  const updateFilters = (column, columnFilters) => {
423
427
  filters.value = filters.value.filter(
424
- filter => filter.columnKey !== column.id
428
+ filter => filter.columnKey !== column.id,
425
429
  );
426
430
  if (columnFilters.length > 0) {
427
431
  filters.value.push({
@@ -442,7 +446,7 @@ export default {
442
446
  () => {
443
447
  pageIndex.value = 0;
444
448
  },
445
- { immediate: true }
449
+ { immediate: true },
446
450
  );
447
451
  // Compute `paginatedRows` according to rows array and pagination settings.
448
452
  watch(
@@ -460,11 +464,12 @@ export default {
460
464
  paginatedRows.value = rowKeys;
461
465
  }
462
466
  },
463
- { immediate: true }
467
+ { immediate: true },
464
468
  );
465
469
 
466
470
  return {
467
471
  // References
472
+ isDark,
468
473
  activeHeadercolumnKey: null,
469
474
  computedRows,
470
475
  paginatedRows,
@@ -494,4 +499,4 @@ export default {
494
499
  };
495
500
  </script>
496
501
 
497
- <style scoped lang="scss" src="./_BIMDataTable.scss"></style>
502
+ <style scoped src="./BIMDataTable.css"></style>
@@ -56,7 +56,7 @@ export default {
56
56
  };
57
57
  </script>
58
58
 
59
- <style scoped lang="scss">
59
+ <style scoped>
60
60
  span {
61
61
  cursor: pointer;
62
62
  }
@@ -10,7 +10,7 @@
10
10
  <ul
11
11
  ref="container"
12
12
  class="bimdata-tabs__container"
13
- :class="{ dark }"
13
+ :class="{ dark: isDark }"
14
14
  :style="{
15
15
  width: containerWidth,
16
16
  minHeight: containerHeight,
@@ -48,6 +48,12 @@ export default {
48
48
  BIMDataButton,
49
49
  BIMDataIconChevron,
50
50
  },
51
+ inject: {
52
+ darkThemeRef: {
53
+ from: "BIMDATA_DESIGN_SYSTEM_DARK_THEME",
54
+ default: () => ({ value: false }),
55
+ },
56
+ },
51
57
  props: {
52
58
  width: {
53
59
  type: [String, Number],
@@ -68,10 +74,6 @@ export default {
68
74
  selected: {
69
75
  type: [String, Number],
70
76
  },
71
- dark: {
72
- type: Boolean,
73
- default: false,
74
- },
75
77
  },
76
78
  emits: ["tab-click", "tab-selected"],
77
79
  data() {
@@ -91,6 +93,9 @@ export default {
91
93
  tabWidth() {
92
94
  return Number.isNaN(+this.tabSize) ? this.tabSize : `${this.tabSize}px`;
93
95
  },
96
+ isDark() {
97
+ return this.darkThemeRef;
98
+ },
94
99
  },
95
100
  watch: {
96
101
  tabs() {
@@ -0,0 +1,10 @@
1
+ .bimdata-text {
2
+ &.dark {
3
+ &.color-primary {
4
+ color: var(--color-primary-lighter);
5
+ }
6
+ &.color-granite-light {
7
+ color: var(--color-white);
8
+ }
9
+ }
10
+ }
@@ -1,11 +1,17 @@
1
1
  <template>
2
- <component :is="component" :style="style" :class="classes">
2
+ <component :is="component" :style="style" :class="classes" class="bimdata-text">
3
3
  <slot></slot>
4
4
  </component>
5
5
  </template>
6
6
 
7
7
  <script>
8
8
  export default {
9
+ inject: {
10
+ darkThemeRef: {
11
+ from: "BIMDATA_DESIGN_SYSTEM_DARK_THEME",
12
+ default: () => ({ value: false }),
13
+ },
14
+ },
9
15
  props: {
10
16
  component: {
11
17
  type: String,
@@ -38,7 +44,13 @@ export default {
38
44
  validator: color =>
39
45
  [
40
46
  "color-primary",
47
+ "color-primary-lighter",
41
48
  "color-secondary",
49
+ "color-secondary-lighter",
50
+ "color-tertiary",
51
+ "color-tertiary-lighter",
52
+ "color-quaternary",
53
+ "color-quaternary-lighter",
42
54
  "color-silver",
43
55
  "color-silver-light",
44
56
  "color-silver-dark",
@@ -54,7 +66,7 @@ export default {
54
66
  },
55
67
  computed: {
56
68
  classes() {
57
- return `${this.color}`;
69
+ return `${this.color} ${this.isDark ? "dark" : ""}`;
58
70
  },
59
71
  style() {
60
72
  return {
@@ -127,6 +139,11 @@ export default {
127
139
  }
128
140
  }
129
141
  },
142
+ isDark() {
143
+ return this.darkThemeRef;
144
+ },
130
145
  },
131
146
  };
132
147
  </script>
148
+
149
+ <style scoped src="./BIMDataText.css"></style>
@@ -1,5 +1,3 @@
1
- @use "../../assets/scss/mixins/_font-size.scss";
2
-
3
1
  textarea:-webkit-autofill {
4
2
  box-shadow: 0 0 0px 1000px var(--color-white) inset;
5
3
  }
@@ -10,9 +8,9 @@ textarea:-webkit-autofill {
10
8
  inline-size: min-content;
11
9
  font-family: var(--primary-font);
12
10
  color: var(--color-primary);
13
- font-size: font-size.calculateEm(15px);
11
+ font-size: 15px;
14
12
  textarea {
15
- padding: 0px;
13
+ padding: 6px;
16
14
  width: 100%;
17
15
  min-width: inherit;
18
16
  max-width: 100%;
@@ -33,7 +31,7 @@ textarea:-webkit-autofill {
33
31
  outline: none;
34
32
  & ~ label {
35
33
  top: -26px;
36
- font-size: font-size.calculateEm(10px);
34
+ font-size: 10px;
37
35
  }
38
36
  & ~ .bar {
39
37
  &:after {
@@ -48,14 +46,14 @@ textarea:-webkit-autofill {
48
46
  label {
49
47
  top: -26px;
50
48
  color: var(--color-primary);
51
- font-size: font-size.calculateEm(10px);
49
+ font-size: 10px;
52
50
  }
53
51
  }
54
52
  label {
55
53
  position: absolute;
56
54
  top: 0;
57
55
  left: 0;
58
- font-size: font-size.calculateEm(12px);
56
+ font-size: 12px;
59
57
  transform: translateY(8px);
60
58
  transition: 0.2s ease all;
61
59
  color: var(--color-granite-light);
@@ -78,11 +76,11 @@ textarea:-webkit-autofill {
78
76
  }
79
77
  .error {
80
78
  color: var(--color-high);
81
- font-size: font-size.calculateEm(11px);
79
+ font-size: 11px;
82
80
  }
83
81
  .success {
84
82
  color: var(--color-success);
85
- font-size: font-size.calculateEm(11px);
83
+ font-size: 11px;
86
84
  }
87
85
  &.error {
88
86
  label {
@@ -108,4 +106,17 @@ textarea:-webkit-autofill {
108
106
  }
109
107
  }
110
108
  }
109
+
110
+ &.dark {
111
+ textarea {
112
+ background-color: var(--color-quaternary);
113
+ color: var(--color-quaternary-lighter);
114
+ }
115
+ label {
116
+ color: var(--color-quaternary-lighter);
117
+ }
118
+ .bar {
119
+ background-color: var(--color-quaternary-lighter);
120
+ }
121
+ }
111
122
  }
@@ -6,6 +6,7 @@
6
6
  (modelValue !== null && modelValue !== '') || placeholder !== null,
7
7
  error,
8
8
  success,
9
+ dark: isDark,
9
10
  }"
10
11
  :style="{ 'min-width': width, 'min-height': height }"
11
12
  >
@@ -33,6 +34,12 @@ export default {
33
34
  prop: "modelValue",
34
35
  event: "update:modelValue",
35
36
  },
37
+ inject: {
38
+ darkThemeRef: {
39
+ from: "BIMDATA_DESIGN_SYSTEM_DARK_THEME",
40
+ default: () => ({ value: false }),
41
+ },
42
+ },
36
43
  props: {
37
44
  name: {
38
45
  type: [String, Number],
@@ -117,7 +124,12 @@ export default {
117
124
  }
118
125
  },
119
126
  },
127
+ computed: {
128
+ isDark() {
129
+ return this.darkThemeRef;
130
+ },
131
+ },
120
132
  };
121
133
  </script>
122
134
 
123
- <style scoped lang="scss" src="./_BIMDataTextarea.scss"></style>
135
+ <style scoped src="./BIMDataTextarea.css"></style>
@@ -44,7 +44,7 @@
44
44
  left: 0;
45
45
  background: var(--color-primary);
46
46
  box-shadow: 0 0 1px var(--color-primary);
47
- transform: translateX(24px - 8px);
47
+ transform: translateX(16px);
48
48
  }
49
49
  }
50
50
  &.disabled {
@@ -69,4 +69,15 @@
69
69
  }
70
70
  }
71
71
  }
72
+
73
+ &.dark {
74
+ &.active {
75
+ .toggle__switch {
76
+ background-color: var(--color-primary-light);
77
+ &::after {
78
+ background: var(--color-tertiary);
79
+ }
80
+ }
81
+ }
82
+ }
72
83
  }
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <label
3
3
  :for="`bimdata-toggle-${uniqueId}`"
4
- :class="{ active: modelValue, disabled }"
4
+ :class="{ active: modelValue, disabled, dark: isDark }"
5
5
  class="toggle__button"
6
6
  >
7
7
  <slot></slot>
@@ -22,6 +22,12 @@ export default {
22
22
  prop: "modelValue",
23
23
  event: "update:modelValue",
24
24
  },
25
+ inject: {
26
+ darkThemeRef: {
27
+ from: "BIMDATA_DESIGN_SYSTEM_DARK_THEME",
28
+ default: () => ({ value: false }),
29
+ },
30
+ },
25
31
  props: {
26
32
  disabled: {
27
33
  type: Boolean,
@@ -47,6 +53,9 @@ export default {
47
53
  this.$emit("update:modelValue", newValue);
48
54
  },
49
55
  },
56
+ isDark() {
57
+ return this.darkThemeRef;
58
+ },
50
59
  },
51
60
  created() {
52
61
  // Math.random is random enough to avoid conflict
@@ -55,4 +64,4 @@ export default {
55
64
  };
56
65
  </script>
57
66
 
58
- <style scoped lang="scss" src="./_BIMDataToggle.scss"></style>
67
+ <style scoped src="./BIMDataToggle.css"></style>
@@ -123,11 +123,11 @@ export default {
123
123
  };
124
124
  </script>
125
125
 
126
- <style scoped lang="scss">
126
+ <style scoped>
127
127
  .bimdata-tree {
128
128
  height: 100%;
129
129
 
130
- &__drop-helper {
130
+ .bimdata-tree__drop-helper {
131
131
  height: 2px;
132
132
  background-color: var(--color-primary);
133
133
  }