@datametria/vue-components 2.3.0 → 2.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/README.md +625 -594
- package/dist/index.es.js +1962 -1887
- package/dist/index.umd.js +6 -6
- package/dist/src/components/DatametriaForm.vue.d.ts +1 -1
- package/dist/src/components/DatametriaInput.vue.d.ts +9 -1
- package/dist/src/components/DatametriaSelect.vue.d.ts +10 -1
- package/dist/vue-components.css +1 -1
- package/package.json +103 -105
- package/src/components/DatametriaAlert.vue +151 -133
- package/src/components/DatametriaAutocomplete.vue +250 -229
- package/src/components/DatametriaAvatar.vue +256 -238
- package/src/components/DatametriaBadge.vue +101 -96
- package/src/components/DatametriaBreadcrumb.vue +132 -128
- package/src/components/DatametriaButton.vue +191 -173
- package/src/components/DatametriaCard.vue +84 -66
- package/src/components/DatametriaCheckbox.vue +197 -193
- package/src/components/DatametriaCheckboxGroup.vue +56 -38
- package/src/components/DatametriaChip.vue +159 -141
- package/src/components/DatametriaContainer.vue +70 -52
- package/src/components/DatametriaDataTable.vue +318 -300
- package/src/components/DatametriaDatePicker.vue +396 -378
- package/src/components/DatametriaDialog.vue +297 -293
- package/src/components/DatametriaDivider.vue +105 -98
- package/src/components/DatametriaDropdown.vue +356 -350
- package/src/components/DatametriaEmpty.vue +155 -151
- package/src/components/DatametriaFileUpload.vue +413 -395
- package/src/components/DatametriaFloatingBar.vue +144 -126
- package/src/components/DatametriaForm.vue +174 -156
- package/src/components/DatametriaFormItem.vue +183 -179
- package/src/components/DatametriaGrid.vue +55 -37
- package/src/components/DatametriaInput.vue +314 -263
- package/src/components/DatametriaMenu.vue +618 -600
- package/src/components/DatametriaModal.vue +147 -129
- package/src/components/DatametriaNavbar.vue +277 -223
- package/src/components/DatametriaPagination.vue +375 -371
- package/src/components/DatametriaPasswordInput.vue +444 -426
- package/src/components/DatametriaPopconfirm.vue +240 -234
- package/src/components/DatametriaProgress.vue +228 -224
- package/src/components/DatametriaRadio.vue +151 -147
- package/src/components/DatametriaRadioGroup.vue +55 -37
- package/src/components/DatametriaResult.vue +135 -131
- package/src/components/DatametriaSelect.vue +311 -211
- package/src/components/DatametriaSidebar.vue +294 -222
- package/src/components/DatametriaSkeleton.vue +257 -234
- package/src/components/DatametriaSlider.vue +409 -391
- package/src/components/DatametriaSortableTable.vue +820 -802
- package/src/components/DatametriaSpinner.vue +114 -110
- package/src/components/DatametriaSteps.vue +318 -312
- package/src/components/DatametriaSwitch.vue +146 -142
- package/src/components/DatametriaTabPane.vue +94 -76
- package/src/components/DatametriaTable.vue +118 -100
- package/src/components/DatametriaTabs.vue +315 -297
- package/src/components/DatametriaTextarea.vue +213 -195
- package/src/components/DatametriaTimePicker.vue +317 -299
- package/src/components/DatametriaToast.vue +176 -176
- package/src/components/DatametriaTooltip.vue +421 -400
- package/src/components/DatametriaTree.vue +126 -122
- package/src/components/DatametriaTreeNode.vue +176 -172
- package/src/components/DatametriaUpload.vue +379 -361
- package/src/components/__tests__/DatametriaAlert.test.js +35 -35
- package/src/components/__tests__/DatametriaAlert.test.ts +190 -190
- package/src/components/__tests__/DatametriaAvatar.test.ts +151 -151
- package/src/components/__tests__/DatametriaBadge.test.js +29 -29
- package/src/components/__tests__/DatametriaBadge.test.ts +167 -167
- package/src/components/__tests__/DatametriaBreadcrumb.test.ts +187 -0
- package/src/components/__tests__/DatametriaButton.test.js +30 -30
- package/src/components/__tests__/DatametriaButton.test.ts +283 -283
- package/src/components/__tests__/DatametriaCard.test.ts +201 -201
- package/src/components/__tests__/DatametriaCheckbox.test.ts +204 -0
- package/src/components/__tests__/DatametriaChip.test.js +38 -38
- package/src/components/__tests__/DatametriaContainer.test.ts +52 -52
- package/src/components/__tests__/DatametriaDialog.test.ts +338 -0
- package/src/components/__tests__/DatametriaDivider.test.ts +54 -54
- package/src/components/__tests__/DatametriaDropdown.test.ts +357 -0
- package/src/components/__tests__/DatametriaEmpty.test.ts +261 -0
- package/src/components/__tests__/DatametriaFileUpload.test.ts +290 -290
- package/src/components/__tests__/DatametriaFloatingBar.test.ts +137 -137
- package/src/components/__tests__/DatametriaForm.test.ts +96 -0
- package/src/components/__tests__/DatametriaFormItem.test.ts +58 -0
- package/src/components/__tests__/DatametriaGrid.test.ts +31 -31
- package/src/components/__tests__/DatametriaInput.test.ts +72 -72
- package/src/components/__tests__/DatametriaMenu.test.ts +366 -366
- package/src/components/__tests__/DatametriaModal.test.ts +86 -86
- package/src/components/__tests__/DatametriaNavbar.test.js +48 -48
- package/src/components/__tests__/DatametriaNavbar.test.ts +203 -203
- package/src/components/__tests__/DatametriaPasswordInput.test.js +305 -305
- package/src/components/__tests__/DatametriaRadio.test.ts +195 -0
- package/src/components/__tests__/DatametriaSelect.test.ts +77 -77
- package/src/components/__tests__/DatametriaSidebar.test.ts +169 -169
- package/src/components/__tests__/DatametriaSlider.test.ts +261 -261
- package/src/components/__tests__/DatametriaSortableTable.test.js +168 -168
- package/src/components/__tests__/DatametriaSpinner.test.ts +156 -156
- package/src/components/__tests__/DatametriaSteps.test.ts +211 -0
- package/src/components/__tests__/DatametriaSwitch.test.ts +129 -0
- package/src/components/__tests__/DatametriaTabPane.test.ts +205 -0
- package/src/components/__tests__/DatametriaTable.test.ts +97 -97
- package/src/components/__tests__/DatametriaTabs.test.ts +232 -232
- package/src/components/__tests__/DatametriaToast.test.js +48 -48
- package/src/components/__tests__/DatametriaToast.test.ts +99 -99
- package/src/components/__tests__/DatametriaTree.test.ts +376 -0
- package/src/components/__tests__/index.test.ts +48 -0
- package/src/composables/useAccessibilityScale.ts +94 -94
- package/src/composables/useBreakpoints.ts +82 -82
- package/src/composables/useHapticFeedback.ts +439 -439
- package/src/composables/useRipple.ts +218 -218
- package/src/composables/useTheme.ts +5 -1
- package/src/index.ts +84 -84
- package/src/stories/Variants.stories.js +95 -95
- package/src/styles/design-tokens.css +623 -623
- package/src/theme/ThemeProvider.vue +96 -96
- package/src/theme/__tests__/ThemeProvider.test.ts +208 -208
- package/src/theme/__tests__/constants.test.ts +31 -31
- package/src/theme/__tests__/presets.test.ts +166 -166
- package/src/theme/__tests__/tokens.test.ts +155 -155
- package/src/theme/__tests__/types.test.ts +153 -153
- package/src/theme/__tests__/useTheme.test.ts +146 -146
- package/src/theme/constants.ts +14 -14
- package/src/theme/index.ts +12 -12
- package/src/theme/presets/datametria.ts +94 -94
- package/src/theme/presets/default.ts +94 -94
- package/src/theme/presets/index.ts +8 -8
- package/src/theme/tokens/colors.ts +28 -28
- package/src/theme/tokens/index.ts +47 -47
- package/src/theme/tokens/spacing.ts +21 -21
- package/src/theme/tokens/typography.ts +35 -35
- package/src/theme/types.ts +111 -111
- package/src/theme/useTheme.ts +28 -28
- package/src/types/index.ts +55 -55
|
@@ -1,153 +1,157 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="datametria-empty" role="status" aria-live="polite">
|
|
3
|
-
<div class="datametria-empty__image">
|
|
4
|
-
<slot name="image">
|
|
5
|
-
<svg
|
|
6
|
-
v-if="imageType === 'no-data'"
|
|
7
|
-
class="datametria-empty__svg"
|
|
8
|
-
viewBox="0 0 200 200"
|
|
9
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
10
|
-
>
|
|
11
|
-
<circle cx="100" cy="100" r="80" fill="#f0f0f0" />
|
|
12
|
-
<path d="M70 90 Q100 70 130 90" stroke="#999" stroke-width="3" fill="none" />
|
|
13
|
-
<circle cx="80" cy="85" r="8" fill="#999" />
|
|
14
|
-
<circle cx="120" cy="85" r="8" fill="#999" />
|
|
15
|
-
<path d="M70 130 Q100 150 130 130" stroke="#999" stroke-width="3" fill="none" />
|
|
16
|
-
</svg>
|
|
17
|
-
<svg
|
|
18
|
-
v-else-if="imageType === 'no-results'"
|
|
19
|
-
class="datametria-empty__svg"
|
|
20
|
-
viewBox="0 0 200 200"
|
|
21
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
22
|
-
>
|
|
23
|
-
<circle cx="80" cy="80" r="50" fill="none" stroke="#999" stroke-width="4" />
|
|
24
|
-
<line x1="120" y1="120" x2="160" y2="160" stroke="#999" stroke-width="4" stroke-linecap="round" />
|
|
25
|
-
<line x1="60" y1="60" x2="100" y2="100" stroke="#e74c3c" stroke-width="3" />
|
|
26
|
-
<line x1="100" y1="60" x2="60" y2="100" stroke="#e74c3c" stroke-width="3" />
|
|
27
|
-
</svg>
|
|
28
|
-
<svg
|
|
29
|
-
v-else-if="imageType === 'error'"
|
|
30
|
-
class="datametria-empty__svg"
|
|
31
|
-
viewBox="0 0 200 200"
|
|
32
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
33
|
-
>
|
|
34
|
-
<circle cx="100" cy="100" r="80" fill="#fee" stroke="#e74c3c" stroke-width="3" />
|
|
35
|
-
<line x1="70" y1="70" x2="130" y2="130" stroke="#e74c3c" stroke-width="4" stroke-linecap="round" />
|
|
36
|
-
<line x1="130" y1="70" x2="70" y2="130" stroke="#e74c3c" stroke-width="4" stroke-linecap="round" />
|
|
37
|
-
</svg>
|
|
38
|
-
<img
|
|
39
|
-
v-else-if="image"
|
|
40
|
-
:src="image"
|
|
41
|
-
:alt="imageAlt"
|
|
42
|
-
class="datametria-empty__custom-image"
|
|
43
|
-
/>
|
|
44
|
-
</slot>
|
|
45
|
-
</div>
|
|
46
|
-
|
|
47
|
-
<div class="datametria-empty__description">
|
|
48
|
-
<slot name="description">
|
|
49
|
-
<p v-if="description" class="datametria-empty__text">{{ description }}</p>
|
|
50
|
-
</slot>
|
|
51
|
-
</div>
|
|
52
|
-
|
|
53
|
-
<div v-if="$slots.default" class="datametria-empty__actions">
|
|
54
|
-
<slot></slot>
|
|
55
|
-
</div>
|
|
56
|
-
</div>
|
|
57
|
-
</template>
|
|
58
|
-
|
|
59
|
-
<script setup lang="ts">
|
|
60
|
-
import { computed } from 'vue'
|
|
61
|
-
|
|
62
|
-
interface Props {
|
|
63
|
-
description?: string
|
|
64
|
-
image?: string
|
|
65
|
-
imageAlt?: string
|
|
66
|
-
imageType?: 'no-data' | 'no-results' | 'error'
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
const props = withDefaults(defineProps<Props>(), {
|
|
70
|
-
description: '',
|
|
71
|
-
image: '',
|
|
72
|
-
imageAlt: 'Empty state',
|
|
73
|
-
imageType: 'no-data'
|
|
74
|
-
})
|
|
75
|
-
|
|
76
|
-
const imageType = computed(() => {
|
|
77
|
-
if (props.image) return null
|
|
78
|
-
return props.imageType
|
|
79
|
-
})
|
|
80
|
-
</script>
|
|
81
|
-
|
|
82
|
-
<style scoped>
|
|
83
|
-
.datametria-empty {
|
|
84
|
-
display: flex;
|
|
85
|
-
flex-direction: column;
|
|
86
|
-
align-items: center;
|
|
87
|
-
justify-content: center;
|
|
88
|
-
padding: var(--dm-spacing-xl, 48px) var(--dm-spacing-lg, 24px);
|
|
89
|
-
text-align: center;
|
|
90
|
-
min-height: 300px;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
.datametria-empty__image {
|
|
94
|
-
margin-bottom: var(--dm-spacing-lg, 24px);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
.datametria-empty__svg {
|
|
98
|
-
width: 200px;
|
|
99
|
-
height: 200px;
|
|
100
|
-
opacity: 0.8;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
.datametria-empty__custom-image {
|
|
104
|
-
max-width: 200px;
|
|
105
|
-
max-height: 200px;
|
|
106
|
-
object-fit: contain;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
.datametria-empty__description {
|
|
110
|
-
margin-bottom: var(--dm-spacing-md, 16px);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
.datametria-empty__text {
|
|
114
|
-
color: var(--dm-color-text-secondary, #666);
|
|
115
|
-
font-size: var(--dm-font-size-base, 14px);
|
|
116
|
-
line-height: 1.6;
|
|
117
|
-
margin: 0;
|
|
118
|
-
max-width: 400px;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
.datametria-empty__actions {
|
|
122
|
-
margin-top: var(--dm-spacing-md, 16px);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
@media (prefers-color-scheme: dark) {
|
|
126
|
-
.datametria-empty__text {
|
|
127
|
-
color: var(--dm-color-text-secondary-dark, #999);
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
.datametria-empty__svg circle[fill="#f0f0f0"] {
|
|
131
|
-
fill: #2a2a2a;
|
|
1
|
+
<template>
|
|
2
|
+
<div class="datametria-empty" role="status" aria-live="polite">
|
|
3
|
+
<div class="datametria-empty__image">
|
|
4
|
+
<slot name="image">
|
|
5
|
+
<svg
|
|
6
|
+
v-if="imageType === 'no-data'"
|
|
7
|
+
class="datametria-empty__svg"
|
|
8
|
+
viewBox="0 0 200 200"
|
|
9
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
10
|
+
>
|
|
11
|
+
<circle cx="100" cy="100" r="80" fill="#f0f0f0" />
|
|
12
|
+
<path d="M70 90 Q100 70 130 90" stroke="#999" stroke-width="3" fill="none" />
|
|
13
|
+
<circle cx="80" cy="85" r="8" fill="#999" />
|
|
14
|
+
<circle cx="120" cy="85" r="8" fill="#999" />
|
|
15
|
+
<path d="M70 130 Q100 150 130 130" stroke="#999" stroke-width="3" fill="none" />
|
|
16
|
+
</svg>
|
|
17
|
+
<svg
|
|
18
|
+
v-else-if="imageType === 'no-results'"
|
|
19
|
+
class="datametria-empty__svg"
|
|
20
|
+
viewBox="0 0 200 200"
|
|
21
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
22
|
+
>
|
|
23
|
+
<circle cx="80" cy="80" r="50" fill="none" stroke="#999" stroke-width="4" />
|
|
24
|
+
<line x1="120" y1="120" x2="160" y2="160" stroke="#999" stroke-width="4" stroke-linecap="round" />
|
|
25
|
+
<line x1="60" y1="60" x2="100" y2="100" stroke="#e74c3c" stroke-width="3" />
|
|
26
|
+
<line x1="100" y1="60" x2="60" y2="100" stroke="#e74c3c" stroke-width="3" />
|
|
27
|
+
</svg>
|
|
28
|
+
<svg
|
|
29
|
+
v-else-if="imageType === 'error'"
|
|
30
|
+
class="datametria-empty__svg"
|
|
31
|
+
viewBox="0 0 200 200"
|
|
32
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
33
|
+
>
|
|
34
|
+
<circle cx="100" cy="100" r="80" fill="#fee" stroke="#e74c3c" stroke-width="3" />
|
|
35
|
+
<line x1="70" y1="70" x2="130" y2="130" stroke="#e74c3c" stroke-width="4" stroke-linecap="round" />
|
|
36
|
+
<line x1="130" y1="70" x2="70" y2="130" stroke="#e74c3c" stroke-width="4" stroke-linecap="round" />
|
|
37
|
+
</svg>
|
|
38
|
+
<img
|
|
39
|
+
v-else-if="image"
|
|
40
|
+
:src="image"
|
|
41
|
+
:alt="imageAlt"
|
|
42
|
+
class="datametria-empty__custom-image"
|
|
43
|
+
/>
|
|
44
|
+
</slot>
|
|
45
|
+
</div>
|
|
46
|
+
|
|
47
|
+
<div class="datametria-empty__description">
|
|
48
|
+
<slot name="description">
|
|
49
|
+
<p v-if="description" class="datametria-empty__text">{{ description }}</p>
|
|
50
|
+
</slot>
|
|
51
|
+
</div>
|
|
52
|
+
|
|
53
|
+
<div v-if="$slots.default" class="datametria-empty__actions">
|
|
54
|
+
<slot></slot>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
</template>
|
|
58
|
+
|
|
59
|
+
<script setup lang="ts">
|
|
60
|
+
import { computed } from 'vue'
|
|
61
|
+
|
|
62
|
+
interface Props {
|
|
63
|
+
description?: string
|
|
64
|
+
image?: string
|
|
65
|
+
imageAlt?: string
|
|
66
|
+
imageType?: 'no-data' | 'no-results' | 'error'
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
70
|
+
description: '',
|
|
71
|
+
image: '',
|
|
72
|
+
imageAlt: 'Empty state',
|
|
73
|
+
imageType: 'no-data'
|
|
74
|
+
})
|
|
75
|
+
|
|
76
|
+
const imageType = computed(() => {
|
|
77
|
+
if (props.image) return null
|
|
78
|
+
return props.imageType
|
|
79
|
+
})
|
|
80
|
+
</script>
|
|
81
|
+
|
|
82
|
+
<style scoped>
|
|
83
|
+
.datametria-empty {
|
|
84
|
+
display: flex;
|
|
85
|
+
flex-direction: column;
|
|
86
|
+
align-items: center;
|
|
87
|
+
justify-content: center;
|
|
88
|
+
padding: var(--dm-spacing-xl, 48px) var(--dm-spacing-lg, 24px);
|
|
89
|
+
text-align: center;
|
|
90
|
+
min-height: 300px;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.datametria-empty__image {
|
|
94
|
+
margin-bottom: var(--dm-spacing-lg, 24px);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.datametria-empty__svg {
|
|
98
|
+
width: 200px;
|
|
99
|
+
height: 200px;
|
|
100
|
+
opacity: 0.8;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.datametria-empty__custom-image {
|
|
104
|
+
max-width: 200px;
|
|
105
|
+
max-height: 200px;
|
|
106
|
+
object-fit: contain;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.datametria-empty__description {
|
|
110
|
+
margin-bottom: var(--dm-spacing-md, 16px);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.datametria-empty__text {
|
|
114
|
+
color: var(--dm-color-text-secondary, #666);
|
|
115
|
+
font-size: var(--dm-font-size-base, 14px);
|
|
116
|
+
line-height: 1.6;
|
|
117
|
+
margin: 0;
|
|
118
|
+
max-width: 400px;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.datametria-empty__actions {
|
|
122
|
+
margin-top: var(--dm-spacing-md, 16px);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
@media (prefers-color-scheme: dark) {
|
|
126
|
+
.datametria-empty__text {
|
|
127
|
+
color: var(--dm-color-text-secondary-dark, #999);
|
|
132
128
|
}
|
|
133
129
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
|
|
130
|
+
[data-theme="dark"] .datametria-empty__text {
|
|
131
|
+
color: var(--dm-color-text-secondary-dark, #999);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.datametria-empty__svg circle[fill="#f0f0f0"] {
|
|
135
|
+
fill: #2a2a2a;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.datametria-empty__svg circle[fill="#fee"] {
|
|
139
|
+
fill: #3a2020;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
@media (max-width: 768px) {
|
|
144
|
+
.datametria-empty {
|
|
145
|
+
padding: var(--dm-spacing-lg, 24px) var(--dm-spacing-md, 16px);
|
|
146
|
+
min-height: 250px;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.datametria-empty__svg,
|
|
150
|
+
.datametria-empty__custom-image {
|
|
151
|
+
width: 150px;
|
|
152
|
+
height: 150px;
|
|
153
|
+
max-width: 150px;
|
|
154
|
+
max-height: 150px;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
</style>
|