@globalbrain/sefirot 2.10.0 → 2.12.0

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.
@@ -180,8 +180,11 @@ function updateColWidth(key: string, value: string) {
180
180
  <style scoped lang="postcss">
181
181
  .box {
182
182
  position: relative;
183
- border: 1px solid var(--c-divider-light);
184
- border-radius: 6px;
183
+ border-top: var(--table-border);
184
+ border-right: var(--table-border);
185
+ border-bottom: var(--table-border);
186
+ border-left: var(--table-border);
187
+ border-radius: var(--table-border-radius);
185
188
  width: 100%;
186
189
 
187
190
  .STable.borderless & {
@@ -26,8 +26,8 @@ defineProps<{
26
26
  .value {
27
27
  line-height: 24px;
28
28
  font-family: var(--font-family-number);
29
- font-size: 12px;
30
- font-weight: 500;
29
+ font-size: var(--table-cell-font-size);
30
+ font-weight: var(--table-cell-font-weight);
31
31
  white-space: nowrap;
32
32
  overflow: hidden;
33
33
  text-overflow: ellipsis;
@@ -1,7 +1,8 @@
1
1
  <script setup lang="ts">
2
2
  import { computed } from 'vue'
3
+ import SPill from './SPill.vue'
3
4
 
4
- export type Color = 'info' | 'success' | 'warning' | 'danger' | 'mute'
5
+ export type Color = 'neutral' | 'mute' | 'info' | 'success' | 'warning' | 'danger'
5
6
 
6
7
  const props = defineProps<{
7
8
  value?: any
@@ -22,7 +23,7 @@ const _value = computed(() => {
22
23
 
23
24
  const _color = computed(() => {
24
25
  if (props.color === undefined) {
25
- return null
26
+ return props.color
26
27
  }
27
28
 
28
29
  return typeof props.color === 'string'
@@ -32,54 +33,21 @@ const _color = computed(() => {
32
33
  </script>
33
34
 
34
35
  <template>
35
- <div class="STableCellPill" :class="[_color ?? 'mute']">
36
- <div v-if="_value" class="value">{{ _value }}</div>
36
+ <div class="STableCellPill" :class="[_color ?? 'neutral']">
37
+ <SPill
38
+ v-if="_value"
39
+ size="mini"
40
+ :mode="_color"
41
+ :label="value"
42
+ />
37
43
  </div>
38
44
  </template>
39
45
 
40
46
  <style scoped lang="postcss">
41
47
  .STableCellPill {
42
- padding: 7px 16px 9px;
48
+ display: flex;
49
+ align-items: center;
50
+ padding: 8px 16px;
43
51
  min-height: 40px;
44
52
  }
45
-
46
- .value {
47
- display: inline-block;
48
- border: 1px solid transparent;
49
- border-radius: 14px;
50
- padding: 0 8px;
51
- line-height: 18px;
52
- font-size: 12px;
53
- font-weight: 500;
54
-
55
- .STableCellPill.info & {
56
- border-color: var(--c-info);
57
- color: var(--c-info);
58
- background-color: var(--c-info-bg);
59
- }
60
-
61
- .STableCellPill.success & {
62
- border-color: var(--c-success);
63
- color: var(--c-success);
64
- background-color: var(--c-success-bg);
65
- }
66
-
67
- .STableCellPill.warning & {
68
- border-color: var(--c-warning);
69
- color: var(--c-warning);
70
- background-color: var(--c-warning-bg);
71
- }
72
-
73
- .STableCellPill.danger & {
74
- border-color: var(--c-danger);
75
- color: var(--c-danger);
76
- background-color: var(--c-danger-bg);
77
- }
78
-
79
- .STableCellPill.mute & {
80
- border-color: var(--c-divider);
81
- color: var(--c-text-2);
82
- background-color: var(--c-bg-elv);
83
- }
84
- }
85
53
  </style>
@@ -78,8 +78,8 @@ const _iconColor = computed(() => {
78
78
 
79
79
  .text {
80
80
  line-height: 24px;
81
- font-size: 12px;
82
- font-weight: 500;
81
+ font-size: var(--table-cell-font-size);
82
+ font-weight: var(--table-cell-font-weight);
83
83
  white-space: nowrap;
84
84
  overflow: hidden;
85
85
  text-overflow: ellipsis;
@@ -74,7 +74,7 @@ export interface TableCellPill extends TableCellBase {
74
74
  color?: TableCellPillColor | ((value: any) => TableCellPillColor)
75
75
  }
76
76
 
77
- export type TableCellPillColor = 'info' | 'success' | 'warning' | 'danger' | 'mute'
77
+ export type TableCellPillColor = 'neutral' | 'mute' | 'info' | 'success' | 'warning' | 'danger'
78
78
 
79
79
  export interface TableCellPills extends TableCellBase {
80
80
  type: 'pills'
@@ -0,0 +1,9 @@
1
+ import { ComputedRef, computed } from 'vue'
2
+
3
+ export function computedArray<T = any>(fn: (arr: T[]) => void): ComputedRef<T[]> {
4
+ return computed(() => {
5
+ const arr = [] as T[]
6
+ fn(arr)
7
+ return arr
8
+ })
9
+ }