@conduction/nextcloud-vue 0.1.0-beta.1 → 0.1.0-beta.10

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 (197) hide show
  1. package/README.md +226 -0
  2. package/css/index.css +5 -0
  3. package/dist/nextcloud-vue.cjs +67614 -0
  4. package/dist/nextcloud-vue.cjs.js +76311 -5905
  5. package/dist/nextcloud-vue.cjs.js.map +1 -1
  6. package/dist/nextcloud-vue.cjs.map +1 -0
  7. package/dist/nextcloud-vue.css +3279 -203
  8. package/dist/nextcloud-vue.esm.js +76240 -5882
  9. package/dist/nextcloud-vue.esm.js.map +1 -1
  10. package/package.json +89 -63
  11. package/src/components/CnActionsBar/CnActionsBar.vue +254 -0
  12. package/src/components/CnActionsBar/index.js +1 -0
  13. package/src/components/CnAdvancedFormDialog/CnAdvancedFormDialog.vue +569 -0
  14. package/src/components/CnAdvancedFormDialog/CnDataTab.vue +217 -0
  15. package/src/components/CnAdvancedFormDialog/CnMetadataTab.vue +121 -0
  16. package/src/components/CnAdvancedFormDialog/CnPropertiesTab.vue +422 -0
  17. package/src/components/CnAdvancedFormDialog/CnPropertyValueCell.vue +247 -0
  18. package/src/components/CnAdvancedFormDialog/index.js +1 -0
  19. package/src/components/CnCard/CnCard.vue +415 -0
  20. package/src/components/CnCard/index.js +1 -0
  21. package/src/components/CnCardGrid/CnCardGrid.vue +23 -20
  22. package/src/components/CnCardGrid/index.js +1 -1
  23. package/src/components/CnCellRenderer/index.js +1 -1
  24. package/src/components/CnChartWidget/CnChartWidget.vue +318 -0
  25. package/src/components/CnChartWidget/index.js +1 -0
  26. package/src/components/CnConfigurationCard/index.js +1 -1
  27. package/src/components/CnContextMenu/CnContextMenu.vue +142 -0
  28. package/src/components/CnContextMenu/index.js +1 -0
  29. package/src/components/CnCopyDialog/CnCopyDialog.vue +257 -0
  30. package/src/components/CnCopyDialog/index.js +1 -0
  31. package/src/components/CnDashboardGrid/CnDashboardGrid.vue +229 -0
  32. package/src/components/CnDashboardGrid/index.js +1 -0
  33. package/src/components/CnDashboardPage/CnDashboardPage.vue +396 -0
  34. package/src/components/CnDashboardPage/index.js +1 -0
  35. package/src/components/CnDataTable/CnDataTable.vue +24 -16
  36. package/src/components/CnDataTable/index.js +1 -1
  37. package/src/components/CnDeleteDialog/CnDeleteDialog.vue +177 -0
  38. package/src/components/CnDeleteDialog/index.js +1 -0
  39. package/src/components/CnDetailCard/CnDetailCard.vue +225 -0
  40. package/src/components/CnDetailCard/index.js +1 -0
  41. package/src/components/CnDetailGrid/CnDetailGrid.vue +254 -0
  42. package/src/components/CnDetailGrid/index.js +1 -0
  43. package/src/components/CnDetailPage/CnDetailPage.vue +431 -0
  44. package/src/components/CnDetailPage/index.js +1 -0
  45. package/src/components/CnFacetSidebar/CnFacetSidebar.vue +12 -2
  46. package/src/components/CnFacetSidebar/index.js +1 -1
  47. package/src/components/CnFilterBar/index.js +1 -1
  48. package/src/components/CnFormDialog/CnFormDialog.vue +934 -0
  49. package/src/components/CnFormDialog/index.js +1 -0
  50. package/src/components/CnIcon/CnIcon.vue +89 -0
  51. package/src/components/CnIcon/index.js +1 -0
  52. package/src/components/CnIndexPage/CnIndexPage.vue +589 -291
  53. package/src/components/CnIndexPage/index.js +1 -1
  54. package/src/components/CnIndexSidebar/CnIndexSidebar.vue +535 -0
  55. package/src/components/CnIndexSidebar/index.js +1 -0
  56. package/src/components/CnInfoWidget/CnInfoWidget.vue +219 -0
  57. package/src/components/CnInfoWidget/index.js +1 -0
  58. package/src/components/CnItemCard/CnItemCard.vue +134 -0
  59. package/src/components/CnItemCard/index.js +1 -0
  60. package/src/components/CnJsonViewer/CnJsonViewer.vue +283 -0
  61. package/src/components/CnJsonViewer/index.js +1 -0
  62. package/src/components/CnKpiGrid/CnKpiGrid.vue +5 -1
  63. package/src/components/CnKpiGrid/index.js +1 -1
  64. package/src/components/CnMassActionBar/CnMassActionBar.vue +6 -5
  65. package/src/components/CnMassActionBar/index.js +1 -1
  66. package/src/components/CnMassCopyDialog/CnMassCopyDialog.vue +16 -9
  67. package/src/components/CnMassCopyDialog/index.js +1 -1
  68. package/src/components/CnMassDeleteDialog/CnMassDeleteDialog.vue +16 -9
  69. package/src/components/CnMassDeleteDialog/index.js +1 -1
  70. package/src/components/CnMassExportDialog/CnMassExportDialog.vue +8 -7
  71. package/src/components/CnMassExportDialog/index.js +1 -1
  72. package/src/components/CnMassImportDialog/CnMassImportDialog.vue +20 -17
  73. package/src/components/CnMassImportDialog/index.js +1 -1
  74. package/src/components/CnNoteCard/CnNoteCard.vue +149 -0
  75. package/src/components/CnNoteCard/index.js +1 -0
  76. package/src/components/CnNotesCard/CnNotesCard.vue +415 -0
  77. package/src/components/CnNotesCard/index.js +1 -0
  78. package/src/components/CnObjectCard/CnObjectCard.vue +3 -1
  79. package/src/components/CnObjectCard/index.js +1 -1
  80. package/src/components/CnObjectDataWidget/CnObjectDataWidget.vue +853 -0
  81. package/src/components/CnObjectDataWidget/index.js +1 -0
  82. package/src/components/CnObjectMetadataWidget/CnObjectMetadataWidget.vue +288 -0
  83. package/src/components/CnObjectMetadataWidget/index.js +1 -0
  84. package/src/components/CnObjectSidebar/CnAuditTrailTab.vue +368 -0
  85. package/src/components/CnObjectSidebar/CnFilesTab.vue +286 -0
  86. package/src/components/CnObjectSidebar/CnNotesTab.vue +249 -0
  87. package/src/components/CnObjectSidebar/CnObjectSidebar.vue +254 -0
  88. package/src/components/CnObjectSidebar/CnTagsTab.vue +258 -0
  89. package/src/components/CnObjectSidebar/CnTasksTab.vue +482 -0
  90. package/src/components/CnObjectSidebar/index.js +6 -0
  91. package/src/components/CnPageHeader/CnPageHeader.vue +61 -0
  92. package/src/components/CnPageHeader/index.js +1 -0
  93. package/src/components/CnPagination/CnPagination.vue +7 -6
  94. package/src/components/CnPagination/index.js +1 -1
  95. package/src/components/CnProgressBar/CnProgressBar.vue +262 -0
  96. package/src/components/CnProgressBar/index.js +1 -0
  97. package/src/components/CnRegisterMapping/CnRegisterMapping.vue +792 -0
  98. package/src/components/CnRegisterMapping/index.js +1 -0
  99. package/src/components/CnRowActions/CnRowActions.vue +25 -3
  100. package/src/components/CnRowActions/index.js +1 -1
  101. package/src/components/CnSchemaFormDialog/CnSchemaConfigurationTab.vue +226 -0
  102. package/src/components/CnSchemaFormDialog/CnSchemaFormDialog.vue +787 -0
  103. package/src/components/CnSchemaFormDialog/CnSchemaPropertiesTab.vue +305 -0
  104. package/src/components/CnSchemaFormDialog/CnSchemaPropertyActions.vue +1398 -0
  105. package/src/components/CnSchemaFormDialog/CnSchemaSecurityTab.vue +236 -0
  106. package/src/components/CnSchemaFormDialog/index.js +1 -0
  107. package/src/components/CnSettingsCard/index.js +1 -1
  108. package/src/components/CnSettingsSection/index.js +1 -1
  109. package/src/components/CnStatsBlock/CnStatsBlock.vue +89 -19
  110. package/src/components/CnStatsBlock/index.js +1 -1
  111. package/src/components/CnStatsPanel/CnStatsPanel.vue +320 -0
  112. package/src/components/CnStatsPanel/index.js +1 -0
  113. package/src/components/CnStatusBadge/CnStatusBadge.vue +15 -2
  114. package/src/components/CnStatusBadge/index.js +1 -1
  115. package/src/components/CnTabbedFormDialog/CnTabbedFormDialog.vue +544 -0
  116. package/src/components/CnTabbedFormDialog/index.js +1 -0
  117. package/src/components/CnTableWidget/CnTableWidget.vue +332 -0
  118. package/src/components/CnTableWidget/index.js +1 -0
  119. package/src/components/CnTasksCard/CnTasksCard.vue +373 -0
  120. package/src/components/CnTasksCard/index.js +1 -0
  121. package/src/components/CnTileWidget/CnTileWidget.vue +159 -0
  122. package/src/components/CnTileWidget/index.js +1 -0
  123. package/src/components/CnTimelineStages/CnTimelineStages.vue +292 -0
  124. package/src/components/CnTimelineStages/index.js +1 -0
  125. package/src/components/CnUserActionMenu/CnUserActionMenu.vue +435 -0
  126. package/src/components/CnUserActionMenu/index.js +1 -0
  127. package/src/components/CnVersionInfoCard/index.js +1 -1
  128. package/src/components/CnWidgetRenderer/CnWidgetRenderer.vue +180 -0
  129. package/src/components/CnWidgetRenderer/index.js +1 -0
  130. package/src/components/CnWidgetWrapper/CnWidgetWrapper.vue +246 -0
  131. package/src/components/CnWidgetWrapper/index.js +1 -0
  132. package/src/components/index.js +57 -25
  133. package/src/composables/index.js +5 -3
  134. package/src/composables/useContextMenu.js +126 -0
  135. package/src/composables/useDashboardView.js +286 -0
  136. package/src/composables/useDetailView.js +290 -132
  137. package/src/composables/useListView.js +364 -153
  138. package/src/composables/useSubResource.js +142 -142
  139. package/src/constants/metadata.js +30 -0
  140. package/src/css/CnSchemaFormDialog.css +546 -0
  141. package/src/css/__sample_nextcloud_tokens.css +110 -0
  142. package/src/css/actions-bar.css +54 -0
  143. package/src/css/badge.css +83 -51
  144. package/src/css/card.css +129 -128
  145. package/src/css/context-menu.css +20 -0
  146. package/src/css/dashboard.css +70 -0
  147. package/src/css/detail-page.css +235 -0
  148. package/src/css/detail.css +68 -68
  149. package/src/css/index-page.css +44 -0
  150. package/src/css/index-sidebar.css +193 -0
  151. package/src/css/index.css +17 -8
  152. package/src/css/layout.css +90 -90
  153. package/src/css/page-header.css +35 -0
  154. package/src/css/pagination.css +72 -72
  155. package/src/css/table.css +142 -143
  156. package/src/css/timeline-stages.css +220 -0
  157. package/src/css/utilities.css +46 -46
  158. package/src/index.js +91 -50
  159. package/src/mixins/gridLayout.js +118 -0
  160. package/src/store/createCrudStore.js +360 -0
  161. package/src/store/createSubResourcePlugin.js +125 -135
  162. package/src/store/index.js +4 -3
  163. package/src/store/plugins/auditTrails.js +357 -17
  164. package/src/store/plugins/files.js +250 -186
  165. package/src/store/plugins/index.js +7 -4
  166. package/src/store/plugins/lifecycle.js +180 -180
  167. package/src/store/plugins/registerMapping.js +195 -0
  168. package/src/store/plugins/relations.js +68 -68
  169. package/src/store/plugins/search.js +385 -0
  170. package/src/store/plugins/selection.js +104 -0
  171. package/src/store/useObjectStore.js +823 -625
  172. package/src/types/auditTrail.d.ts +32 -32
  173. package/src/types/file.d.ts +23 -23
  174. package/src/types/index.d.ts +35 -35
  175. package/src/types/notification.d.ts +36 -36
  176. package/src/types/object.d.ts +40 -40
  177. package/src/types/organisation.d.ts +41 -41
  178. package/src/types/register.d.ts +25 -25
  179. package/src/types/schema.d.ts +39 -39
  180. package/src/types/shared.d.ts +79 -79
  181. package/src/types/source.d.ts +14 -14
  182. package/src/types/task.d.ts +31 -31
  183. package/src/utils/errors.js +96 -96
  184. package/src/utils/getTheme.js +9 -0
  185. package/src/utils/headers.js +80 -44
  186. package/src/utils/id.js +13 -0
  187. package/src/utils/index.js +4 -3
  188. package/src/utils/schema.js +422 -287
  189. package/src/utils/widgetVisibility.js +162 -0
  190. package/src/components/CnDetailViewLayout/CnDetailViewLayout.vue +0 -88
  191. package/src/components/CnDetailViewLayout/index.js +0 -1
  192. package/src/components/CnEmptyState/CnEmptyState.vue +0 -78
  193. package/src/components/CnEmptyState/index.js +0 -1
  194. package/src/components/CnListViewLayout/CnListViewLayout.vue +0 -80
  195. package/src/components/CnListViewLayout/index.js +0 -1
  196. package/src/components/CnViewModeToggle/CnViewModeToggle.vue +0 -77
  197. package/src/components/CnViewModeToggle/index.js +0 -1
@@ -0,0 +1,320 @@
1
+ <template>
2
+ <div class="cn-stats-panel">
3
+ <!-- Header slot for filters/selectors -->
4
+ <div v-if="$slots.header" class="cn-stats-panel__header">
5
+ <slot name="header" />
6
+ </div>
7
+
8
+ <!-- Global loading state -->
9
+ <div v-if="loading" class="cn-stats-panel__loading">
10
+ <NcLoadingIcon :size="20" />
11
+ <span>{{ loadingLabel }}</span>
12
+ </div>
13
+
14
+ <!-- Sections -->
15
+ <template v-else>
16
+ <div
17
+ v-for="section in sections"
18
+ :key="section.id"
19
+ class="cn-stats-panel__section">
20
+ <!-- Section title -->
21
+ <h4 v-if="section.title" class="cn-stats-panel__section-title">
22
+ {{ section.title }}
23
+ </h4>
24
+
25
+ <!-- Section-level loading -->
26
+ <div v-if="section.loading" class="cn-stats-panel__loading">
27
+ <NcLoadingIcon :size="20" />
28
+ <span>{{ loadingLabel }}</span>
29
+ </div>
30
+
31
+ <!-- Empty section -->
32
+ <div v-else-if="!section.items || !section.items.length" class="cn-stats-panel__empty">
33
+ {{ section.emptyLabel || emptyLabel }}
34
+ </div>
35
+
36
+ <!-- Stats section -->
37
+ <template v-else-if="section.type === 'stats'">
38
+ <slot :name="'section-' + section.id" :section="section">
39
+ <!-- Stack layout -->
40
+ <div v-if="section.layout === 'stack'" class="cn-stats-panel__stack">
41
+ <CnStatsBlock
42
+ v-for="(item, index) in section.items"
43
+ :key="index"
44
+ :title="item.title"
45
+ :count="item.count"
46
+ :count-label="item.countLabel"
47
+ :variant="item.variant || 'default'"
48
+ :icon="isComponentIcon(item.icon) ? item.icon : null"
49
+ :icon-size="item.iconSize || 24"
50
+ :horizontal="item.horizontal !== undefined ? item.horizontal : true"
51
+ :show-zero-count="item.showZeroCount !== undefined ? item.showZeroCount : true"
52
+ :breakdown="item.breakdown || null"
53
+ :route="item.route || null"
54
+ :clickable="item.clickable || false"
55
+ :loading="item.loading || false"
56
+ @click="$emit('stat-click', { section: section.id, item, index })">
57
+ <template v-if="typeof item.icon === 'string'" #icon>
58
+ <CnIcon :name="item.icon" :size="item.iconSize || 24" />
59
+ </template>
60
+ </CnStatsBlock>
61
+ </div>
62
+
63
+ <!-- Grid layout -->
64
+ <CnKpiGrid
65
+ v-else-if="section.layout === 'grid'"
66
+ grid-class="remove-margin"
67
+ :columns="section.columns || 2">
68
+ <CnStatsBlock
69
+ v-for="(item, index) in section.items"
70
+ :key="index"
71
+ :title="item.title"
72
+ :count="item.count"
73
+ :count-label="item.countLabel"
74
+ :variant="item.variant || 'default'"
75
+ :icon="isComponentIcon(item.icon) ? item.icon : null"
76
+ :icon-size="item.iconSize || 24"
77
+ :horizontal="item.horizontal !== undefined ? item.horizontal : false"
78
+ :show-zero-count="item.showZeroCount !== undefined ? item.showZeroCount : true"
79
+ :breakdown="item.breakdown || null"
80
+ :route="item.route || null"
81
+ :clickable="item.clickable || false"
82
+ :loading="item.loading || false"
83
+ @click="$emit('stat-click', { section: section.id, item, index })">
84
+ <template v-if="typeof item.icon === 'string'" #icon>
85
+ <CnIcon :name="item.icon" :size="item.iconSize || 24" />
86
+ </template>
87
+ </CnStatsBlock>
88
+ </CnKpiGrid>
89
+ </slot>
90
+ </template>
91
+
92
+ <!-- Progress section -->
93
+ <template v-else-if="section.type === 'progress'">
94
+ <slot :name="'section-' + section.id" :section="section">
95
+ <CnProgressBar
96
+ :items="section.items"
97
+ :variant="section.variant || 'primary'"
98
+ :bar-height="section.barHeight || 8"
99
+ :rounded="section.rounded !== undefined ? section.rounded : true"
100
+ :show-percentage="section.showPercentage || false" />
101
+ </slot>
102
+ </template>
103
+
104
+ <!-- List section -->
105
+ <template v-else-if="section.type === 'list'">
106
+ <slot :name="'section-' + section.id" :section="section">
107
+ <div class="cn-stats-panel__list">
108
+ <NcListItem
109
+ v-for="item in section.items"
110
+ :key="item.key"
111
+ :name="item.name"
112
+ :bold="item.bold || false"
113
+ @click="$emit('list-click', { section: section.id, item })">
114
+ <template #icon>
115
+ <slot :name="'item-icon-' + section.id" :item="item">
116
+ <CnIcon
117
+ v-if="typeof item.icon === 'string'"
118
+ :name="item.icon"
119
+ :size="item.iconSize || 32" />
120
+ <component
121
+ :is="item.icon"
122
+ v-else-if="item.icon"
123
+ :size="item.iconSize || 32" />
124
+ </slot>
125
+ </template>
126
+ <template #subname>
127
+ <slot :name="'item-subname-' + section.id" :item="item">
128
+ {{ item.subname }}
129
+ </slot>
130
+ </template>
131
+ </NcListItem>
132
+ </div>
133
+ </slot>
134
+ </template>
135
+ </div>
136
+ </template>
137
+
138
+ <!-- Footer slot -->
139
+ <div v-if="$slots.footer" class="cn-stats-panel__footer">
140
+ <slot name="footer" />
141
+ </div>
142
+ </div>
143
+ </template>
144
+
145
+ <script>
146
+ import { NcLoadingIcon, NcListItem } from '@nextcloud/vue'
147
+ import { CnStatsBlock } from '../CnStatsBlock/index.js'
148
+ import { CnKpiGrid } from '../CnKpiGrid/index.js'
149
+ import { CnIcon } from '../CnIcon/index.js'
150
+ import { CnProgressBar } from '../CnProgressBar/index.js'
151
+
152
+ /**
153
+ * CnStatsPanel — Configurable statistics panel with sections of stat blocks and list items.
154
+ *
155
+ * Renders statistics content from a declarative sections array. Each section can be
156
+ * either a 'stats' section (renders CnStatsBlocks in stack or grid layout) or a
157
+ * 'list' section (renders NcListItems). Suitable for sidebar tabs, dashboard widgets,
158
+ * or any panel that displays statistics.
159
+ *
160
+ * @example Stats stack (vertical)
161
+ * <CnStatsPanel :sections="[{
162
+ * type: 'stats',
163
+ * id: 'totals',
164
+ * title: 'System Totals',
165
+ * layout: 'stack',
166
+ * items: [
167
+ * { title: 'Objects', count: 42, countLabel: 'objects', variant: 'primary', icon: PackageIcon },
168
+ * { title: 'Files', count: 128, countLabel: 'files', icon: FileIcon },
169
+ * ],
170
+ * }]" />
171
+ *
172
+ * @example Stats grid (2-column)
173
+ * <CnStatsPanel :sections="[{
174
+ * type: 'stats',
175
+ * id: 'operations',
176
+ * title: 'Operations',
177
+ * layout: 'grid',
178
+ * columns: 2,
179
+ * items: [
180
+ * { title: 'Create', count: 10, countLabel: 'ops', variant: 'success', icon: PlusIcon },
181
+ * { title: 'Delete', count: 3, countLabel: 'ops', variant: 'error', icon: DeleteIcon },
182
+ * ],
183
+ * }]" />
184
+ *
185
+ * @example List section
186
+ * <CnStatsPanel :sections="[{
187
+ * type: 'list',
188
+ * id: 'topObjects',
189
+ * title: 'Most Active',
190
+ * items: [
191
+ * { key: '1', name: 'Object A', subname: '42 entries', icon: CogIcon },
192
+ * ],
193
+ * }]" />
194
+ *
195
+ * @example With header slot for filters
196
+ * <CnStatsPanel :sections="sections">
197
+ * <template #header>
198
+ * <NcSelect v-bind="registerOptions" />
199
+ * </template>
200
+ * </CnStatsPanel>
201
+ */
202
+ export default {
203
+ name: 'CnStatsPanel',
204
+
205
+ components: {
206
+ NcLoadingIcon,
207
+ NcListItem,
208
+ CnStatsBlock,
209
+ CnKpiGrid,
210
+ CnIcon,
211
+ CnProgressBar,
212
+ },
213
+
214
+ props: {
215
+ /**
216
+ * Array of section definitions to render.
217
+ * Each section has a `type` of 'stats', 'list', or 'progress'.
218
+ *
219
+ * Stats sections: `{ type: 'stats', id, title, layout: 'stack'|'grid', columns?, loading?, items: StatItem[] }`
220
+ * List sections: `{ type: 'list', id, title, loading?, items: ListItem[] }`
221
+ * Progress sections: `{ type: 'progress', id, title, variant?, barHeight?, rounded?, showPercentage?, loading?, items: ProgressItem[] }`
222
+ *
223
+ * StatItem: `{ title, count, countLabel, variant?, icon?, iconSize?, horizontal?, showZeroCount?, breakdown?, route?, clickable?, loading? }`
224
+ * ListItem: `{ key, name, subname?, bold?, icon?, iconSize? }`
225
+ * ProgressItem: `{ key?, label, count?, percentage?, variant?, tooltip? }`
226
+ */
227
+ sections: {
228
+ type: Array,
229
+ default: () => [],
230
+ },
231
+
232
+ /** Whether the entire panel is in a loading state */
233
+ loading: {
234
+ type: Boolean,
235
+ default: false,
236
+ },
237
+
238
+ /** Label shown during loading state */
239
+ loadingLabel: {
240
+ type: String,
241
+ default: 'Loading...',
242
+ },
243
+
244
+ /** Default text shown when a section has no items. Can be overridden per section via `section.emptyLabel`. */
245
+ emptyLabel: {
246
+ type: String,
247
+ default: 'No data available',
248
+ },
249
+ },
250
+
251
+ emits: ['stat-click', 'list-click', 'progress-click'],
252
+
253
+ methods: {
254
+ /**
255
+ * Check if an icon value is a component reference (not a string name).
256
+ * @param {*} icon - Icon value to check
257
+ * @return {boolean}
258
+ */
259
+ isComponentIcon(icon) {
260
+ return icon != null && typeof icon !== 'string'
261
+ },
262
+ },
263
+ }
264
+ </script>
265
+
266
+ <style scoped>
267
+ .cn-stats-panel__section {
268
+ padding: 12px 0;
269
+ border-bottom: 1px solid var(--color-border);
270
+ }
271
+
272
+ .remove-margin {
273
+ margin: 0;
274
+ }
275
+
276
+ .cn-stats-panel__section:last-child {
277
+ border-bottom: none;
278
+ }
279
+
280
+ .cn-stats-panel__section-title {
281
+ color: var(--color-text-maxcontrast);
282
+ font-size: 14px;
283
+ font-weight: bold;
284
+ padding: 0 16px;
285
+ margin: 0 0 12px 0;
286
+ }
287
+
288
+ .cn-stats-panel__stack {
289
+ display: flex;
290
+ flex-direction: column;
291
+ gap: 12px;
292
+ }
293
+
294
+ .cn-stats-panel__loading {
295
+ display: flex;
296
+ align-items: center;
297
+ gap: 8px;
298
+ padding: 0 16px;
299
+ color: var(--color-text-maxcontrast);
300
+ }
301
+
302
+ .cn-stats-panel__empty {
303
+ padding: 0 16px;
304
+ color: var(--color-text-maxcontrast);
305
+ font-style: italic;
306
+ }
307
+
308
+ .cn-stats-panel__header {
309
+ padding-bottom: 12px;
310
+ border-bottom: 1px solid var(--color-border);
311
+ }
312
+
313
+ .cn-stats-panel__footer {
314
+ padding-top: 12px;
315
+ }
316
+
317
+ .cn-stats-panel__list {
318
+ margin-top: 4px;
319
+ }
320
+ </style>
@@ -0,0 +1 @@
1
+ export { default as CnStatsPanel } from './CnStatsPanel.vue'
@@ -2,7 +2,10 @@
2
2
  <span
3
3
  class="cn-status-badge"
4
4
  :class="badgeClasses">
5
- <slot>{{ label }}</slot>
5
+ <slot>
6
+ <slot name="icon" />
7
+ {{ label }}
8
+ </slot>
6
9
  </span>
7
10
  </template>
8
11
 
@@ -46,6 +49,14 @@ export default {
46
49
  default: 'medium',
47
50
  validator: (v) => ['small', 'medium'].includes(v),
48
51
  },
52
+ /**
53
+ * Use solid background with white text instead of light background with colored text.
54
+ * Useful when the badge is placed on a colored background (e.g., an active card).
55
+ */
56
+ solid: {
57
+ type: Boolean,
58
+ default: false,
59
+ },
49
60
  /**
50
61
  * Map of label values to variants. When provided, the variant is resolved
51
62
  * from this map using the label (case-insensitive). Falls back to the variant prop.
@@ -61,7 +72,8 @@ export default {
61
72
  resolvedVariant() {
62
73
  if (this.colorMap && this.label) {
63
74
  const key = this.label.toLowerCase()
64
- return this.colorMap[key] || this.variant
75
+ const normalizedColorMap = Object.fromEntries(Object.entries(this.colorMap).map(([k, v]) => [k.toLowerCase(), v]))
76
+ return normalizedColorMap[key] || this.variant
65
77
  }
66
78
  return this.variant
67
79
  },
@@ -70,6 +82,7 @@ export default {
70
82
  return {
71
83
  ['cn-status-badge--' + this.resolvedVariant]: true,
72
84
  'cn-status-badge--small': this.size === 'small',
85
+ 'cn-status-badge--solid': this.solid,
73
86
  }
74
87
  },
75
88
  },
@@ -1 +1 @@
1
- export { default as CnStatusBadge } from './CnStatusBadge.vue'
1
+ export { default as CnStatusBadge } from './CnStatusBadge.vue'