@globalbrain/sefirot 3.2.1 → 3.4.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.
- package/lib/components/SCard.vue +15 -1
- package/lib/components/SInputDropdownItemAvatar.vue +1 -1
- package/lib/components/SInputDropdownItemText.vue +1 -1
- package/lib/components/SPill.vue +39 -19
- package/lib/components/SSheet.vue +1 -1
- package/lib/components/SSheetFooter.vue +1 -1
- package/lib/components/SSnackbar.vue +1 -1
- package/lib/components/SState.vue +27 -17
- package/lib/components/SStep.vue +1 -1
- package/lib/components/STable.vue +48 -1
- package/lib/components/STableCell.vue +0 -1
- package/lib/components/STableCellActions.vue +14 -14
- package/lib/components/STableColumn.vue +1 -1
- package/lib/components/STableFooter.vue +1 -1
- package/lib/components/STableHeaderMenu.vue +1 -1
- package/lib/components/STableItem.vue +4 -1
- package/lib/components/SW.vue +3 -0
- package/lib/composables/Table.ts +2 -1
- package/lib/styles/bootstrap.css +1 -0
- package/lib/styles/utilities.css +3 -0
- package/lib/styles/variables.css +27 -15
- package/lib/support/Text.ts +25 -0
- package/lib/types/shims.d.ts +6 -2
- package/package.json +50 -54
- package/lib/types/vue-shims.d.ts +0 -7
package/lib/components/SCard.vue
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { computed } from 'vue'
|
|
3
3
|
import { provideCardState } from '../composables/Card'
|
|
4
4
|
|
|
5
|
-
export type Size = 'small' | 'medium' | 'large'
|
|
5
|
+
export type Size = 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge'
|
|
6
6
|
export type Mode = 'neutral' | 'info' | 'success' | 'warning' | 'danger'
|
|
7
7
|
|
|
8
8
|
const props = defineProps<{
|
|
@@ -83,6 +83,20 @@ const classes = computed(() => [
|
|
|
83
83
|
max-width: 768px;
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
|
+
|
|
87
|
+
&.xlarge {
|
|
88
|
+
@media (min-width: 1056px) {
|
|
89
|
+
margin: 48px auto 128px;
|
|
90
|
+
max-width: 960px;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
&.xxlarge {
|
|
95
|
+
@media (min-width: 1248px) {
|
|
96
|
+
margin: 48px auto 128px;
|
|
97
|
+
max-width: 1152px;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
86
100
|
}
|
|
87
101
|
|
|
88
102
|
.SModal.fade-enter-from > .SCard,
|
|
@@ -36,7 +36,7 @@ defineEmits<{
|
|
|
36
36
|
<style lang="postcss" scoped>
|
|
37
37
|
.SInputDropdownItemAvatar {
|
|
38
38
|
display: flex;
|
|
39
|
-
border: 1px solid var(--c-divider
|
|
39
|
+
border: 1px solid var(--c-divider);
|
|
40
40
|
border-radius: 14px;
|
|
41
41
|
padding: 0 12px 0 0;
|
|
42
42
|
background-color: var(--c-bg-mute);
|
|
@@ -29,7 +29,7 @@ defineEmits<{
|
|
|
29
29
|
<style lang="postcss" scoped>
|
|
30
30
|
.SInputDropdownItemText {
|
|
31
31
|
display: flex;
|
|
32
|
-
border: 1px solid var(--c-divider
|
|
32
|
+
border: 1px solid var(--c-divider);
|
|
33
33
|
border-radius: 14px;
|
|
34
34
|
padding: 0 12px;
|
|
35
35
|
background-color: var(--c-bg-mute);
|
package/lib/components/SPill.vue
CHANGED
|
@@ -3,15 +3,18 @@ import { computed } from 'vue'
|
|
|
3
3
|
|
|
4
4
|
export type Size = 'mini' | 'small' | 'medium' | 'large'
|
|
5
5
|
export type Type = 'dimm' | 'fill'
|
|
6
|
-
export type Mode = '
|
|
6
|
+
export type Mode = 'default' | 'mute' | 'neutral' | 'info' | 'success' | 'warning' | 'danger'
|
|
7
7
|
|
|
8
8
|
const props = defineProps<{
|
|
9
|
-
|
|
9
|
+
as?: string
|
|
10
10
|
size?: Size
|
|
11
11
|
type?: Type
|
|
12
12
|
mode?: Mode
|
|
13
13
|
label?: string
|
|
14
14
|
clickable?: boolean
|
|
15
|
+
|
|
16
|
+
// @deprecated Use `as` instead.
|
|
17
|
+
tag?: string
|
|
15
18
|
}>()
|
|
16
19
|
|
|
17
20
|
const emit = defineEmits<{
|
|
@@ -21,14 +24,13 @@ const emit = defineEmits<{
|
|
|
21
24
|
const classes = computed(() => [
|
|
22
25
|
props.size ?? 'small',
|
|
23
26
|
props.type ?? 'dimm',
|
|
24
|
-
props.mode ?? '
|
|
27
|
+
props.mode ?? 'default',
|
|
25
28
|
{ clickable: props.clickable }
|
|
26
29
|
])
|
|
27
30
|
|
|
28
31
|
const computedTag = computed(() => {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
: props.clickable ? 'button' : 'span'
|
|
32
|
+
const as = props.as ?? props.tag
|
|
33
|
+
return as || (props.clickable ? 'button' : 'span')
|
|
32
34
|
})
|
|
33
35
|
|
|
34
36
|
function onClick() {
|
|
@@ -82,17 +84,17 @@ function onClick() {
|
|
|
82
84
|
border-radius: 16px;
|
|
83
85
|
padding: 0 12px;
|
|
84
86
|
line-height: 30px;
|
|
85
|
-
font-size:
|
|
87
|
+
font-size: 14px;
|
|
86
88
|
}
|
|
87
89
|
|
|
88
90
|
.SPill.dimm {
|
|
89
|
-
&.
|
|
90
|
-
border-color: var(--pill-dimm-
|
|
91
|
-
color: var(--pill-dimm-
|
|
92
|
-
background-color: var(--pill-dimm-
|
|
91
|
+
&.default {
|
|
92
|
+
border-color: var(--pill-dimm-default-border-color);
|
|
93
|
+
color: var(--pill-dimm-default-text-color);
|
|
94
|
+
background-color: var(--pill-dimm-default-bg-color);
|
|
93
95
|
|
|
94
|
-
&.clickable:hover { background-color: var(--pill-dimm-
|
|
95
|
-
&.clickable:active { background-color: var(--pill-dimm-
|
|
96
|
+
&.clickable:hover { background-color: var(--pill-dimm-default-hover-bg-color); }
|
|
97
|
+
&.clickable:active { background-color: var(--pill-dimm-default-active-bg-color); }
|
|
96
98
|
}
|
|
97
99
|
|
|
98
100
|
&.mute {
|
|
@@ -104,6 +106,15 @@ function onClick() {
|
|
|
104
106
|
&.clickable:active { background-color: var(--pill-dimm-mute-active-bg-color); }
|
|
105
107
|
}
|
|
106
108
|
|
|
109
|
+
&.neutral {
|
|
110
|
+
border-color: var(--pill-dimm-neutral-border-color);
|
|
111
|
+
color: var(--pill-dimm-neutral-text-color);
|
|
112
|
+
background-color: var(--pill-dimm-neutral-bg-color);
|
|
113
|
+
|
|
114
|
+
&.clickable:hover { background-color: var(--pill-dimm-neutral-hover-bg-color); }
|
|
115
|
+
&.clickable:active { background-color: var(--pill-dimm-neutral-active-bg-color); }
|
|
116
|
+
}
|
|
117
|
+
|
|
107
118
|
&.info {
|
|
108
119
|
border-color: var(--pill-dimm-info-border-color);
|
|
109
120
|
color: var(--pill-dimm-info-text-color);
|
|
@@ -142,13 +153,13 @@ function onClick() {
|
|
|
142
153
|
}
|
|
143
154
|
|
|
144
155
|
.SPill.fill {
|
|
145
|
-
&.
|
|
146
|
-
border-color: var(--pill-fill-
|
|
147
|
-
color: var(--pill-fill-
|
|
148
|
-
background-color: var(--pill-fill-
|
|
156
|
+
&.default {
|
|
157
|
+
border-color: var(--pill-fill-default-border-color);
|
|
158
|
+
color: var(--pill-fill-default-text-color);
|
|
159
|
+
background-color: var(--pill-fill-default-bg-color);
|
|
149
160
|
|
|
150
|
-
&.clickable:hover { background-color: var(--pill-fill-
|
|
151
|
-
&.clickable:active { background-color: var(--pill-fill-
|
|
161
|
+
&.clickable:hover { background-color: var(--pill-fill-default-hover-bg-color); }
|
|
162
|
+
&.clickable:active { background-color: var(--pill-fill-default-active-bg-color); }
|
|
152
163
|
}
|
|
153
164
|
|
|
154
165
|
&.mute {
|
|
@@ -160,6 +171,15 @@ function onClick() {
|
|
|
160
171
|
&.clickable:active { background-color: var(--pill-fill-mute-active-bg-color); }
|
|
161
172
|
}
|
|
162
173
|
|
|
174
|
+
&.neutral {
|
|
175
|
+
border-color: var(--pill-fill-neutral-border-color);
|
|
176
|
+
color: var(--pill-fill-neutral-text-color);
|
|
177
|
+
background-color: var(--pill-fill-neutral-bg-color);
|
|
178
|
+
|
|
179
|
+
&.clickable:hover { background-color: var(--pill-fill-neutral-hover-bg-color); }
|
|
180
|
+
&.clickable:active { background-color: var(--pill-fill-neutral-active-bg-color); }
|
|
181
|
+
}
|
|
182
|
+
|
|
163
183
|
&.info {
|
|
164
184
|
border-color: var(--pill-fill-info-border-color);
|
|
165
185
|
color: var(--pill-fill-info-text-color);
|
|
@@ -31,7 +31,7 @@ defineEmits<{
|
|
|
31
31
|
<style scoped lang="postcss">
|
|
32
32
|
.SSheet {
|
|
33
33
|
position: relative;
|
|
34
|
-
border: 1px solid var(--c-divider
|
|
34
|
+
border: 1px solid var(--c-divider);
|
|
35
35
|
border-radius: 16px;
|
|
36
36
|
background-color: var(--c-bg);
|
|
37
37
|
transition: opacity 0.25s, transform 0.25s;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { computed } from 'vue'
|
|
3
3
|
|
|
4
4
|
export type Size = 'mini' | 'small' | 'medium' | 'large'
|
|
5
|
-
export type Mode = 'neutral' | 'mute' | 'info' | 'success' | 'warning' | 'danger'
|
|
5
|
+
export type Mode = 'default' | 'neutral' | 'mute' | 'info' | 'success' | 'warning' | 'danger'
|
|
6
6
|
|
|
7
7
|
const props = defineProps<{
|
|
8
8
|
as?: string
|
|
@@ -13,7 +13,7 @@ const props = defineProps<{
|
|
|
13
13
|
|
|
14
14
|
const classes = computed(() => [
|
|
15
15
|
props.size ?? 'small',
|
|
16
|
-
props.mode ?? '
|
|
16
|
+
props.mode ?? 'default'
|
|
17
17
|
])
|
|
18
18
|
</script>
|
|
19
19
|
|
|
@@ -29,7 +29,6 @@ const classes = computed(() => [
|
|
|
29
29
|
display: inline-flex;
|
|
30
30
|
align-items: center;
|
|
31
31
|
border: 1px solid var(--c-border-mute-1);
|
|
32
|
-
border-radius: 6px;
|
|
33
32
|
font-weight: 500;
|
|
34
33
|
white-space: nowrap;
|
|
35
34
|
background-color: var(--c-bg-mute-1);
|
|
@@ -37,11 +36,11 @@ const classes = computed(() => [
|
|
|
37
36
|
|
|
38
37
|
.SState.mini {
|
|
39
38
|
gap: 6px;
|
|
39
|
+
border-radius: 10px;
|
|
40
40
|
padding: 0 6px;
|
|
41
41
|
height: 20px;
|
|
42
42
|
|
|
43
43
|
.indicator {
|
|
44
|
-
border-radius: 2px;
|
|
45
44
|
width: 8px;
|
|
46
45
|
height: 8px;
|
|
47
46
|
}
|
|
@@ -52,12 +51,12 @@ const classes = computed(() => [
|
|
|
52
51
|
}
|
|
53
52
|
|
|
54
53
|
.SState.small {
|
|
55
|
-
gap:
|
|
54
|
+
gap: 6px;
|
|
55
|
+
border-radius: 12px;
|
|
56
56
|
padding: 0 8px;
|
|
57
57
|
height: 24px;
|
|
58
58
|
|
|
59
59
|
.indicator {
|
|
60
|
-
border-radius: 3px;
|
|
61
60
|
width: 10px;
|
|
62
61
|
height: 10px;
|
|
63
62
|
}
|
|
@@ -68,12 +67,12 @@ const classes = computed(() => [
|
|
|
68
67
|
}
|
|
69
68
|
|
|
70
69
|
.SState.medium {
|
|
71
|
-
gap:
|
|
70
|
+
gap: 6px;
|
|
71
|
+
border-radius: 14px;
|
|
72
72
|
padding: 0 8px;
|
|
73
73
|
height: 28px;
|
|
74
74
|
|
|
75
75
|
.indicator {
|
|
76
|
-
border-radius: 3px;
|
|
77
76
|
width: 10px;
|
|
78
77
|
height: 10px;
|
|
79
78
|
}
|
|
@@ -84,12 +83,12 @@ const classes = computed(() => [
|
|
|
84
83
|
}
|
|
85
84
|
|
|
86
85
|
.SState.large {
|
|
87
|
-
gap:
|
|
86
|
+
gap: 8px;
|
|
87
|
+
border-radius: 16px;
|
|
88
88
|
padding: 0 10px;
|
|
89
89
|
height: 32px;
|
|
90
90
|
|
|
91
91
|
.indicator {
|
|
92
|
-
border-radius: 4px;
|
|
93
92
|
width: 12px;
|
|
94
93
|
height: 12px;
|
|
95
94
|
}
|
|
@@ -99,28 +98,38 @@ const classes = computed(() => [
|
|
|
99
98
|
}
|
|
100
99
|
}
|
|
101
100
|
|
|
102
|
-
.SState.
|
|
103
|
-
.
|
|
101
|
+
.SState.default {
|
|
102
|
+
.label { color: var(--c-text-1); }
|
|
103
|
+
.indicator { background-color: var(--c-fg-gray-1); }
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
-
.SState.mute
|
|
106
|
+
.SState.mute {
|
|
107
107
|
.label { color: var(--c-text-2); }
|
|
108
108
|
.indicator { background-color: var(--c-fg-gray-1); }
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
-
.SState.
|
|
111
|
+
.SState.neutral {
|
|
112
|
+
.label { color: var(--c-text-1); }
|
|
113
|
+
.indicator { background-color: var(--c-neutral-1); }
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.SState.info {
|
|
117
|
+
.label { color: var(--c-text-1); }
|
|
112
118
|
.indicator { background-color: var(--c-fg-info-1); }
|
|
113
119
|
}
|
|
114
120
|
|
|
115
|
-
.SState.success
|
|
121
|
+
.SState.success {
|
|
122
|
+
.label { color: var(--c-text-1); }
|
|
116
123
|
.indicator { background-color: var(--c-fg-success-1); }
|
|
117
124
|
}
|
|
118
125
|
|
|
119
|
-
.SState.warning
|
|
126
|
+
.SState.warning {
|
|
127
|
+
.label { color: var(--c-text-1); }
|
|
120
128
|
.indicator { background-color: var(--c-fg-warning-1); }
|
|
121
129
|
}
|
|
122
130
|
|
|
123
|
-
.SState.danger
|
|
131
|
+
.SState.danger {
|
|
132
|
+
.label { color: var(--c-text-1); }
|
|
124
133
|
.indicator { background-color: var(--c-fg-danger-1); }
|
|
125
134
|
}
|
|
126
135
|
|
|
@@ -130,6 +139,7 @@ const classes = computed(() => [
|
|
|
130
139
|
|
|
131
140
|
.indicator {
|
|
132
141
|
display: block;
|
|
142
|
+
border-radius: 50%;
|
|
133
143
|
transition: background-color 0.25s;
|
|
134
144
|
}
|
|
135
145
|
</style>
|
package/lib/components/SStep.vue
CHANGED
|
@@ -92,7 +92,7 @@ defineProps({
|
|
|
92
92
|
height: 2px;
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
.bar.mute { background-color: var(--c-divider
|
|
95
|
+
.bar.mute { background-color: var(--c-divider); }
|
|
96
96
|
.bar.active { background-color: var(--c-success); }
|
|
97
97
|
.bar.failed { background-color: var(--c-danger); }
|
|
98
98
|
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
watch
|
|
13
13
|
} from 'vue'
|
|
14
14
|
import { type Table } from '../composables/Table'
|
|
15
|
+
import { getTextWidth } from '../support/Text'
|
|
15
16
|
import SInputCheckbox from './SInputCheckbox.vue'
|
|
16
17
|
import SSpinner from './SSpinner.vue'
|
|
17
18
|
import STableCell from './STableCell.vue'
|
|
@@ -204,6 +205,52 @@ useResizeObserver(block, ([entry]) => {
|
|
|
204
205
|
|
|
205
206
|
const resizeObserver = useResizeObserver(head, handleResize)
|
|
206
207
|
|
|
208
|
+
const font = typeof document !== 'undefined'
|
|
209
|
+
? `500 12px ${getComputedStyle(document.body).fontFamily}`
|
|
210
|
+
: '500 12px Inter'
|
|
211
|
+
|
|
212
|
+
const actionsColumnWidth = computed(() => {
|
|
213
|
+
const { cell } = unref(props.options.columns).actions ?? {}
|
|
214
|
+
|
|
215
|
+
if (
|
|
216
|
+
typeof document === 'undefined'
|
|
217
|
+
|| !cell
|
|
218
|
+
|| typeof cell === 'function'
|
|
219
|
+
|| cell.type !== 'actions'
|
|
220
|
+
) {
|
|
221
|
+
return undefined
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
const { actions } = cell
|
|
225
|
+
|
|
226
|
+
const widths = actions.map(({ icon, label }) => {
|
|
227
|
+
// has only icon
|
|
228
|
+
if (icon && !label) {
|
|
229
|
+
return 1 /* border */ + 5 /* padding */ + 16 /* icon */ + 5 /* padding */ + 1 /* border */
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
// has only label
|
|
233
|
+
if (label && !icon) {
|
|
234
|
+
return 1 /* border */ + 12 /* padding */ + getTextWidth(label, font) + 12 /* padding */ + 1 /* border */
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
// has both icon and label
|
|
238
|
+
if (icon && label) {
|
|
239
|
+
return 1 /* border */ + 8 /* padding */ + 16 /* icon */ + 4 /* padding */ + getTextWidth(label, font) + 10 /* padding */ + 1 /* border */
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
return 0
|
|
243
|
+
})
|
|
244
|
+
|
|
245
|
+
return 8 /* padding */ + widths.reduce((a, b) => a + b, 0) + 8 /* padding */
|
|
246
|
+
})
|
|
247
|
+
|
|
248
|
+
watch(actionsColumnWidth, (newValue) => {
|
|
249
|
+
if (newValue) {
|
|
250
|
+
updateColWidth('actions', `${newValue}px`)
|
|
251
|
+
}
|
|
252
|
+
}, { immediate: true, flush: 'post' })
|
|
253
|
+
|
|
207
254
|
function stopObserving() {
|
|
208
255
|
const orders = ordersToShow.value
|
|
209
256
|
const lastOrder
|
|
@@ -496,7 +543,7 @@ function updateSelected(selected: unknown[]) {
|
|
|
496
543
|
|
|
497
544
|
:deep(.row) {
|
|
498
545
|
display: flex;
|
|
499
|
-
border-bottom: 1px solid var(--c-
|
|
546
|
+
border-bottom: 1px solid var(--c-gutter);
|
|
500
547
|
}
|
|
501
548
|
|
|
502
549
|
:deep(.row.last),
|
|
@@ -3,7 +3,6 @@ import { type TableCellAction } from '../composables/Table'
|
|
|
3
3
|
import SButton from './SButton.vue'
|
|
4
4
|
|
|
5
5
|
defineProps<{
|
|
6
|
-
value: any
|
|
7
6
|
record: any
|
|
8
7
|
actions: TableCellAction[]
|
|
9
8
|
}>()
|
|
@@ -11,18 +10,19 @@ defineProps<{
|
|
|
11
10
|
|
|
12
11
|
<template>
|
|
13
12
|
<div class="STableCellActions">
|
|
14
|
-
<
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
13
|
+
<template v-for="(action, i) in actions" :key="i">
|
|
14
|
+
<SButton
|
|
15
|
+
v-if="action.show == null || action.show(record)"
|
|
16
|
+
size="mini"
|
|
17
|
+
type="text"
|
|
18
|
+
:mode="action.mode ?? 'mute'"
|
|
19
|
+
:icon="action.icon"
|
|
20
|
+
:icon-mode="action.iconMode"
|
|
21
|
+
:label="action.label"
|
|
22
|
+
:label-mode="action.labelMode"
|
|
23
|
+
@click="action.onClick(record)"
|
|
24
|
+
/>
|
|
25
|
+
</template>
|
|
26
26
|
</div>
|
|
27
27
|
</template>
|
|
28
28
|
|
|
@@ -31,8 +31,8 @@ defineProps<{
|
|
|
31
31
|
min-height: 40px;
|
|
32
32
|
display: flex;
|
|
33
33
|
align-items: center;
|
|
34
|
-
justify-content: center;
|
|
35
34
|
flex-wrap: nowrap;
|
|
36
35
|
flex-direction: row;
|
|
36
|
+
padding: 0 8px;
|
|
37
37
|
}
|
|
38
38
|
</style>
|
|
@@ -56,7 +56,7 @@ const hasNext = computed(() => {
|
|
|
56
56
|
|
|
57
57
|
<style scoped lang="postcss">
|
|
58
58
|
.STableFooter {
|
|
59
|
-
border-top: 1px solid var(--c-
|
|
59
|
+
border-top: 1px solid var(--c-gutter);
|
|
60
60
|
border-radius: 0 0 calc(var(--table-border-radius) - 1px) calc(var(--table-border-radius) - 1px);
|
|
61
61
|
padding-right: var(--table-padding-right);
|
|
62
62
|
padding-left: var(--table-padding-left);
|
|
@@ -26,10 +26,13 @@ const classes = computed(() => [
|
|
|
26
26
|
.STableItem {
|
|
27
27
|
position: var(--table-col-position, relative);
|
|
28
28
|
left: var(--table-col-left, 0);
|
|
29
|
+
right: var(--table-col-right, auto);
|
|
29
30
|
z-index: var(--table-col-z-index, auto);
|
|
30
31
|
flex-shrink: 0;
|
|
31
32
|
flex-grow: 1;
|
|
32
|
-
border-
|
|
33
|
+
border-left: var(--table-col-border-left, 0) solid var(--c-gutter);
|
|
34
|
+
border-right: 1px solid var(--c-gutter);
|
|
35
|
+
margin-left: calc(var(--table-col-border-left, 0) * -1);
|
|
33
36
|
min-width: var(--table-col-width);
|
|
34
37
|
max-width: var(--table-col-width);
|
|
35
38
|
|
package/lib/composables/Table.ts
CHANGED
package/lib/styles/bootstrap.css
CHANGED
package/lib/styles/variables.css
CHANGED
|
@@ -441,7 +441,7 @@
|
|
|
441
441
|
--button-fill-mute-active-border-color: var(--c-border-mute-3);
|
|
442
442
|
--button-fill-mute-active-text-color: var(--c-text-2);
|
|
443
443
|
--button-fill-mute-active-bg-color: var(--c-bg-mute-3);
|
|
444
|
-
--button-fill-mute-disabled-border-color: var(--c-
|
|
444
|
+
--button-fill-mute-disabled-border-color: var(--c-border-mute-1);
|
|
445
445
|
--button-fill-mute-disabled-text-color: var(--c-text-3);
|
|
446
446
|
--button-fill-mute-disabled-content-color: var(--c-text-3);
|
|
447
447
|
--button-fill-mute-disabled-bg-color: var(--c-bg-mute-1);
|
|
@@ -508,11 +508,11 @@
|
|
|
508
508
|
--button-fill-info-disabled-border-color: var(--c-border-info-1);
|
|
509
509
|
--button-fill-info-disabled-text-color: var(--c-white-a3);
|
|
510
510
|
--button-fill-info-disabled-content-color: var(--c-white-a3);
|
|
511
|
-
--button-fill-info-disabled-bg-color: var(--c-
|
|
511
|
+
--button-fill-info-disabled-bg-color: var(--c-blue-8);
|
|
512
512
|
|
|
513
513
|
--button-fill-success-border-color: var(--c-border-success-1);
|
|
514
514
|
--button-fill-success-text-color: var(--c-white-1);
|
|
515
|
-
--button-fill-success-content-color: var(--c-
|
|
515
|
+
--button-fill-success-content-color: var(--c-white-1);
|
|
516
516
|
--button-fill-success-bg-color: var(--c-bg-success-1);
|
|
517
517
|
--button-fill-success-loader-color: var(--c-white);
|
|
518
518
|
--button-fill-success-hover-border-color: var(--c-border-success-2);
|
|
@@ -524,7 +524,7 @@
|
|
|
524
524
|
--button-fill-success-disabled-border-color: var(--c-border-success-1);
|
|
525
525
|
--button-fill-success-disabled-text-color: var(--c-white-a3);
|
|
526
526
|
--button-fill-success-disabled-content-color: var(--c-white-a3);
|
|
527
|
-
--button-fill-success-disabled-bg-color: var(--c-
|
|
527
|
+
--button-fill-success-disabled-bg-color: var(--c-green-8);
|
|
528
528
|
|
|
529
529
|
--button-fill-warning-border-color: var(--c-border-mute-1);
|
|
530
530
|
--button-fill-warning-text-color: var(--c-text-warning-1);
|
|
@@ -717,11 +717,11 @@
|
|
|
717
717
|
* -------------------------------------------------------------------------- */
|
|
718
718
|
|
|
719
719
|
:root {
|
|
720
|
-
--pill-dimm-
|
|
721
|
-
--pill-dimm-
|
|
722
|
-
--pill-dimm-
|
|
723
|
-
--pill-dimm-
|
|
724
|
-
--pill-dimm-
|
|
720
|
+
--pill-dimm-default-border-color: var(--c-border-mute-1);
|
|
721
|
+
--pill-dimm-default-text-color: var(--c-text-1);
|
|
722
|
+
--pill-dimm-default-bg-color: var(--c-bg-mute-1);
|
|
723
|
+
--pill-dimm-default-hover-bg-color: var(--c-bg-mute-2);
|
|
724
|
+
--pill-dimm-default-active-bg-color: var(--c-bg-mute-3);
|
|
725
725
|
|
|
726
726
|
--pill-dimm-mute-border-color: var(--c-border-mute-1);
|
|
727
727
|
--pill-dimm-mute-text-color: var(--c-text-2);
|
|
@@ -729,6 +729,12 @@
|
|
|
729
729
|
--pill-dimm-mute-hover-bg-color: var(--c-bg-mute-2);
|
|
730
730
|
--pill-dimm-mute-active-bg-color: var(--c-bg-mute-3);
|
|
731
731
|
|
|
732
|
+
--pill-dimm-neutral-border-color: var(--c-neutral-1);
|
|
733
|
+
--pill-dimm-neutral-text-color: var(--c-text-inverse-1);
|
|
734
|
+
--pill-dimm-neutral-bg-color: var(--c-neutral-1);
|
|
735
|
+
--pill-dimm-neutral-hover-bg-color: var(--c-neutral-2);
|
|
736
|
+
--pill-dimm-neutral-active-bg-color: var(--c-neutral-3);
|
|
737
|
+
|
|
732
738
|
--pill-dimm-info-border-color: var(--c-border-info-1);
|
|
733
739
|
--pill-dimm-info-text-color: var(--c-text-info-1);
|
|
734
740
|
--pill-dimm-info-bg-color: var(--c-bg-info-dimm-a1);
|
|
@@ -753,11 +759,11 @@
|
|
|
753
759
|
--pill-dimm-danger-hover-bg-color: var(--c-bg-danger-dimm-a2);
|
|
754
760
|
--pill-dimm-danger-active-bg-color: var(--c-bg-danger-dimm-a2);
|
|
755
761
|
|
|
756
|
-
--pill-fill-
|
|
757
|
-
--pill-fill-
|
|
758
|
-
--pill-fill-
|
|
759
|
-
--pill-fill-
|
|
760
|
-
--pill-fill-
|
|
762
|
+
--pill-fill-default-border-color: transparent;
|
|
763
|
+
--pill-fill-default-text-color: var(--c-text-1);
|
|
764
|
+
--pill-fill-default-bg-color: var(--c-bg-mute-1);
|
|
765
|
+
--pill-fill-default-hover-bg-color: var(--c-bg-mute-2);
|
|
766
|
+
--pill-fill-default-active-bg-color: var(--c-bg-mute-3);
|
|
761
767
|
|
|
762
768
|
--pill-fill-mute-border-color: transparent;
|
|
763
769
|
--pill-fill-mute-text-color: var(--c-text-2);
|
|
@@ -765,6 +771,12 @@
|
|
|
765
771
|
--pill-fill-mute-hover-bg-color: var(--c-bg-mute-2);
|
|
766
772
|
--pill-fill-mute-active-bg-color: var(--c-bg-mute-3);
|
|
767
773
|
|
|
774
|
+
--pill-fill-neutral-border-color: transparent;
|
|
775
|
+
--pill-fill-neutral-text-color: var(--c-text-inverse-1);
|
|
776
|
+
--pill-fill-neutral-bg-color: var(--c-neutral-1);
|
|
777
|
+
--pill-fill-neutral-hover-bg-color: var(--c-neutral-2);
|
|
778
|
+
--pill-fill-neutral-active-bg-color: var(--c-neutral-3);
|
|
779
|
+
|
|
768
780
|
--pill-fill-info-border-color: transparent;
|
|
769
781
|
--pill-fill-info-text-color: var(--c-white-1);
|
|
770
782
|
--pill-fill-info-bg-color: var(--c-bg-info-1);
|
|
@@ -814,7 +826,7 @@
|
|
|
814
826
|
* -------------------------------------------------------------------------- */
|
|
815
827
|
|
|
816
828
|
:root {
|
|
817
|
-
--table-border: 1px solid var(--c-divider
|
|
829
|
+
--table-border: 1px solid var(--c-divider);
|
|
818
830
|
--table-border-top: var(--table-border);
|
|
819
831
|
--table-border-right: var(--table-border);
|
|
820
832
|
--table-border-bottom: var(--table-border);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// Adapted from https://stackoverflow.com/a/21015393/11613622
|
|
2
|
+
|
|
3
|
+
let _canvas: HTMLCanvasElement
|
|
4
|
+
|
|
5
|
+
export function getTextWidth(text: string, font: string): number
|
|
6
|
+
export function getTextWidth(text: string, el: HTMLElement): number
|
|
7
|
+
|
|
8
|
+
export function getTextWidth(text: string, fontOrEl: string | HTMLElement): number {
|
|
9
|
+
const canvas = _canvas || (_canvas = document.createElement('canvas'))
|
|
10
|
+
const context = canvas.getContext('2d')!
|
|
11
|
+
context.font = typeof fontOrEl === 'string' ? fontOrEl : getCanvasFont(fontOrEl)
|
|
12
|
+
const metrics = context.measureText(text)
|
|
13
|
+
|
|
14
|
+
return metrics.width
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function getCanvasFont(el: HTMLElement) {
|
|
18
|
+
const {
|
|
19
|
+
fontWeight = 'normal',
|
|
20
|
+
fontSize = '16px',
|
|
21
|
+
fontFamily = 'Times New Roman'
|
|
22
|
+
} = getComputedStyle(el)
|
|
23
|
+
|
|
24
|
+
return `${fontWeight} ${fontSize} ${fontFamily}`
|
|
25
|
+
}
|
package/lib/types/shims.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@globalbrain/sefirot",
|
|
3
|
-
"version": "3.
|
|
4
|
-
"packageManager": "pnpm@8.
|
|
3
|
+
"version": "3.4.0",
|
|
4
|
+
"packageManager": "pnpm@8.10.4",
|
|
5
5
|
"description": "Vue Components for Global Brain Design System.",
|
|
6
6
|
"author": "Kia Ishii <ka.ishii@globalbrains.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -20,26 +20,42 @@
|
|
|
20
20
|
"files": [
|
|
21
21
|
"lib"
|
|
22
22
|
],
|
|
23
|
+
"scripts": {
|
|
24
|
+
"docs": "vitepress dev docs --port 4000",
|
|
25
|
+
"docs:build": "vitepress build docs",
|
|
26
|
+
"docs:preview": "vitepress serve docs --port 3000",
|
|
27
|
+
"story": "histoire dev --port 3000",
|
|
28
|
+
"story:build": "histoire build",
|
|
29
|
+
"story:preview": "histoire preview --port 3000",
|
|
30
|
+
"type": "vue-tsc --noEmit",
|
|
31
|
+
"lint": "eslint --fix .",
|
|
32
|
+
"lint:fail": "eslint .",
|
|
33
|
+
"vitest": "vitest",
|
|
34
|
+
"coverage": "vitest run --coverage",
|
|
35
|
+
"test": "pnpm run type && pnpm run lint && pnpm run coverage",
|
|
36
|
+
"test:fail": "pnpm run type && pnpm run lint:fail && pnpm run coverage",
|
|
37
|
+
"release": "release-it"
|
|
38
|
+
},
|
|
23
39
|
"peerDependencies": {
|
|
24
40
|
"@iconify-icons/ph": "^1.2.5",
|
|
25
41
|
"@iconify/vue": "^4.1.1",
|
|
26
|
-
"@tanstack/vue-virtual": "3.0.0-beta.
|
|
27
|
-
"@types/body-scroll-lock": "^3.1.
|
|
28
|
-
"@types/lodash-es": "^4.17.
|
|
29
|
-
"@types/markdown-it": "^13.0.
|
|
42
|
+
"@tanstack/vue-virtual": "3.0.0-beta.62",
|
|
43
|
+
"@types/body-scroll-lock": "^3.1.2",
|
|
44
|
+
"@types/lodash-es": "^4.17.11",
|
|
45
|
+
"@types/markdown-it": "^13.0.6",
|
|
30
46
|
"@vuelidate/core": "^2.0.3",
|
|
31
47
|
"@vuelidate/validators": "^2.0.4",
|
|
32
|
-
"@vueuse/core": "^10.
|
|
48
|
+
"@vueuse/core": "^10.6.1",
|
|
33
49
|
"body-scroll-lock": "4.0.0-beta.0",
|
|
34
|
-
"fuse.js": "^
|
|
50
|
+
"fuse.js": "^7.0.0",
|
|
35
51
|
"lodash-es": "^4.17.21",
|
|
36
52
|
"markdown-it": "^13.0.2",
|
|
37
53
|
"normalize.css": "^8.0.1",
|
|
38
|
-
"pinia": "^2.1.
|
|
54
|
+
"pinia": "^2.1.7",
|
|
39
55
|
"postcss": "^8.4.31",
|
|
40
56
|
"postcss-nested": "^6.0.1",
|
|
41
|
-
"v-calendar": "^3.1.
|
|
42
|
-
"vue": "^3.3.
|
|
57
|
+
"v-calendar": "^3.1.2",
|
|
58
|
+
"vue": "^3.3.8",
|
|
43
59
|
"vue-router": "^4.2.5"
|
|
44
60
|
},
|
|
45
61
|
"dependencies": {
|
|
@@ -47,60 +63,40 @@
|
|
|
47
63
|
},
|
|
48
64
|
"devDependencies": {
|
|
49
65
|
"@globalbrain/eslint-config": "^1.5.2",
|
|
50
|
-
"@histoire/plugin-vue": "^0.17.
|
|
66
|
+
"@histoire/plugin-vue": "^0.17.5",
|
|
51
67
|
"@iconify-icons/ph": "^1.2.5",
|
|
52
68
|
"@iconify/vue": "^4.1.1",
|
|
53
|
-
"@
|
|
54
|
-
"@
|
|
55
|
-
"@types/
|
|
56
|
-
"@types/
|
|
57
|
-
"@types/
|
|
58
|
-
"@
|
|
59
|
-
"@
|
|
69
|
+
"@release-it/conventional-changelog": "^8.0.1",
|
|
70
|
+
"@tanstack/vue-virtual": "3.0.0-beta.62",
|
|
71
|
+
"@types/body-scroll-lock": "^3.1.2",
|
|
72
|
+
"@types/lodash-es": "^4.17.11",
|
|
73
|
+
"@types/markdown-it": "^13.0.6",
|
|
74
|
+
"@types/node": "^20.9.0",
|
|
75
|
+
"@vitejs/plugin-vue": "^4.4.1",
|
|
76
|
+
"@vitest/coverage-v8": "^1.0.0-beta.4",
|
|
60
77
|
"@vue/test-utils": "^2.4.1",
|
|
61
78
|
"@vuelidate/core": "^2.0.3",
|
|
62
79
|
"@vuelidate/validators": "^2.0.4",
|
|
63
|
-
"@vueuse/core": "^10.
|
|
80
|
+
"@vueuse/core": "^10.6.1",
|
|
64
81
|
"body-scroll-lock": "4.0.0-beta.0",
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"execa": "^5.1.1",
|
|
70
|
-
"fuse.js": "^6.6.2",
|
|
71
|
-
"happy-dom": "^12.9.0",
|
|
72
|
-
"histoire": "^0.17.2",
|
|
82
|
+
"eslint": "^8.53.0",
|
|
83
|
+
"fuse.js": "^7.0.0",
|
|
84
|
+
"happy-dom": "^12.10.3",
|
|
85
|
+
"histoire": "^0.17.5",
|
|
73
86
|
"lodash-es": "^4.17.21",
|
|
74
87
|
"markdown-it": "^13.0.2",
|
|
75
88
|
"normalize.css": "^8.0.1",
|
|
76
|
-
"pinia": "^2.1.
|
|
89
|
+
"pinia": "^2.1.7",
|
|
77
90
|
"postcss": "^8.4.31",
|
|
78
91
|
"postcss-nested": "^6.0.1",
|
|
79
|
-
"
|
|
92
|
+
"release-it": "^17.0.0",
|
|
80
93
|
"typescript": "~5.2.2",
|
|
81
|
-
"v-calendar": "^3.1.
|
|
82
|
-
"vite": "^4.
|
|
83
|
-
"vitepress": "1.0.0-rc.
|
|
84
|
-
"vitest": "^0.
|
|
85
|
-
"vue": "^3.3.
|
|
94
|
+
"v-calendar": "^3.1.2",
|
|
95
|
+
"vite": "^4.5.0",
|
|
96
|
+
"vitepress": "1.0.0-rc.25",
|
|
97
|
+
"vitest": "^1.0.0-beta.4",
|
|
98
|
+
"vue": "^3.3.8",
|
|
86
99
|
"vue-router": "^4.2.5",
|
|
87
|
-
"vue-tsc": "^1.8.
|
|
88
|
-
},
|
|
89
|
-
"scripts": {
|
|
90
|
-
"docs": "vitepress dev docs --port 4000",
|
|
91
|
-
"docs:build": "vitepress build docs",
|
|
92
|
-
"docs:preview": "vitepress serve docs --port 3000",
|
|
93
|
-
"story": "histoire dev --port 3000",
|
|
94
|
-
"story:build": "histoire build",
|
|
95
|
-
"story:preview": "histoire preview --port 3000",
|
|
96
|
-
"type": "vue-tsc --noEmit",
|
|
97
|
-
"lint": "eslint --fix .",
|
|
98
|
-
"lint:fail": "eslint .",
|
|
99
|
-
"vitest": "vitest",
|
|
100
|
-
"coverage": "vitest run --coverage",
|
|
101
|
-
"test": "pnpm run type && pnpm run lint && pnpm run coverage",
|
|
102
|
-
"test:fail": "pnpm run type && pnpm run lint:fail && pnpm run coverage",
|
|
103
|
-
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s",
|
|
104
|
-
"release": "node scripts/release.js"
|
|
100
|
+
"vue-tsc": "^1.8.22"
|
|
105
101
|
}
|
|
106
|
-
}
|
|
102
|
+
}
|