@tsiky/components-r19 1.1.0 → 1.2.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/package.json +1 -1
- package/src/components/AnnouncementPanel/FlexRowContainer.css +17 -17
- package/src/components/AnnouncementPanel/FlexRowContainer.stories.tsx +329 -329
- package/src/components/AnnouncementPanel/FlexRowContainer.tsx +24 -24
- package/src/components/AnnouncementPanel/ListBox/CounterListBox.css +56 -56
- package/src/components/AnnouncementPanel/ListBox/CounterListBox.stories.tsx +292 -292
- package/src/components/AnnouncementPanel/ListBox/CounterListBox.tsx +106 -106
- package/src/components/AnnouncementPanel/ListBox/SimpleListBox.css +57 -57
- package/src/components/AnnouncementPanel/ListBox/SimpleListBox.stories.tsx +189 -189
- package/src/components/AnnouncementPanel/ListBox/SimpleListBox.tsx +138 -138
- package/src/components/AnnouncementPanel/ListBox/TrendListBox.css +61 -61
- package/src/components/AnnouncementPanel/ListBox/TrendListBox.stories.tsx +257 -257
- package/src/components/AnnouncementPanel/ListBox/TrendListBox.tsx +90 -90
- package/src/components/AnnouncementPanel/ListBox/index.ts +3 -3
- package/src/components/AnnouncementPanel/ListContentContainer.css +23 -23
- package/src/components/AnnouncementPanel/ListContentContainer.stories.tsx +212 -212
- package/src/components/AnnouncementPanel/ListContentContainer.tsx +33 -33
- package/src/components/AnnouncementPanel/index.ts +3 -3
- package/src/components/Charts/area-chart-admission/AreaChartAdmission.tsx +7 -1
- package/src/components/Charts/bar-chart/BarChart.tsx +6 -2
- package/src/components/Charts/boxplot-chart/BoxPlotChart.tsx +114 -114
- package/src/components/Charts/mixed-chart/MixedChart.tsx +1 -1
- package/src/components/Charts/sankey-adaptation/sankey.tsx +70 -70
- package/src/components/DraggableSwitcher/DraggableSwitcherButton.tsx +58 -58
- package/src/components/DraggableSwitcher/context/useDraggableSwitcher.tsx +45 -45
- package/src/components/DraggableSwitcher/index.ts +2 -2
- package/src/components/DynamicInput/input/SelectInput.tsx +75 -75
- package/src/components/DynamicInput/input/assets/SelectInput.module.css +95 -95
- package/src/components/DynamicTable/AdvancedFilters.tsx +196 -196
- package/src/components/DynamicTable/ColumnSorter.tsx +185 -185
- package/src/components/DynamicTable/Pagination.tsx +115 -115
- package/src/components/DynamicTable/TableCell.tsx +38 -30
- package/src/components/DynamicTable/TableHeader.tsx +39 -34
- package/src/components/DynamicTable/TableauDynamique.module.css +79 -33
- package/src/components/DynamicTable/TableauDynamique.tsx +154 -154
- package/src/components/DynamicTable/filters/SelectFilter.tsx +69 -69
- package/src/components/DynamicTable/tools/tableTypes.ts +63 -63
- package/src/components/EntryControl/EntryControl.tsx +117 -117
- package/src/components/Grid/grid.css +285 -285
- package/src/components/MetricsPanel/MetricsPanel.tsx +37 -37
- package/src/components/MetricsPanel/renderers/CompactRenderer.tsx +1 -1
- package/src/components/NavItem/NavItem.tsx +58 -58
- package/src/components/PeriodRange/PeriodRange.module.css +158 -158
- package/src/components/PeriodRange/PeriodRange.tsx +130 -130
- package/src/components/SearchBar/SearchBar.css +40 -40
- package/src/components/TranslationKey/TranslationKey.css +272 -272
- package/src/components/TranslationKey/TranslationKey.tsx +8 -7
|
@@ -1,292 +1,292 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { CounterListBox } from './CounterListBox';
|
|
3
|
-
|
|
4
|
-
const meta: Meta<typeof CounterListBox> = {
|
|
5
|
-
title: 'Components/ListBox/CounterListBox',
|
|
6
|
-
component: CounterListBox,
|
|
7
|
-
parameters: {
|
|
8
|
-
layout: 'centered',
|
|
9
|
-
docs: {
|
|
10
|
-
description: {
|
|
11
|
-
component: 'A list component with circular badges for displaying counters and metrics.',
|
|
12
|
-
},
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
tags: ['autodocs'],
|
|
16
|
-
argTypes: {
|
|
17
|
-
badgeColor: {
|
|
18
|
-
control: 'color',
|
|
19
|
-
description: 'Default badge color',
|
|
20
|
-
},
|
|
21
|
-
badgePadding: {
|
|
22
|
-
control: 'text',
|
|
23
|
-
description: 'Badge padding (e.g., "8px 16px")',
|
|
24
|
-
},
|
|
25
|
-
badgeWidth: {
|
|
26
|
-
control: 'text',
|
|
27
|
-
description: 'Forced badge width (e.g., "40px", "60px")',
|
|
28
|
-
},
|
|
29
|
-
data: {
|
|
30
|
-
control: 'object',
|
|
31
|
-
description: 'Array of strings or [badge, text] tuples',
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export default meta;
|
|
37
|
-
type Story = StoryObj<typeof meta>;
|
|
38
|
-
|
|
39
|
-
export const Default: Story = {
|
|
40
|
-
name: 'Default',
|
|
41
|
-
args: {
|
|
42
|
-
title: 'Statistics',
|
|
43
|
-
data: [
|
|
44
|
-
['15', 'New messages'],
|
|
45
|
-
['42', 'Active users'],
|
|
46
|
-
['128', 'Total visits'],
|
|
47
|
-
['7', 'Pending'],
|
|
48
|
-
],
|
|
49
|
-
badgeColor: '#0ea5e9',
|
|
50
|
-
},
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
export const MixedTypes: Story = {
|
|
54
|
-
name: 'Mixed Types',
|
|
55
|
-
args: {
|
|
56
|
-
title: 'System Dashboard',
|
|
57
|
-
data: [
|
|
58
|
-
['99+', 'Unread notifications'],
|
|
59
|
-
'No action required currently',
|
|
60
|
-
['7', 'Overdue tasks'],
|
|
61
|
-
'All systems functioning normally',
|
|
62
|
-
['3', 'Unresolved alerts'],
|
|
63
|
-
'Maintenance scheduled this weekend',
|
|
64
|
-
],
|
|
65
|
-
badgeColor: '#8b5cf6',
|
|
66
|
-
},
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
export const ColorfulBadges: Story = {
|
|
70
|
-
name: 'Colorful Badges',
|
|
71
|
-
args: {
|
|
72
|
-
title: 'Performance Evaluation',
|
|
73
|
-
data: [
|
|
74
|
-
['A+', 'Excellent'],
|
|
75
|
-
['B', 'Good'],
|
|
76
|
-
['C', 'Average'],
|
|
77
|
-
['D', 'Needs improvement'],
|
|
78
|
-
['F', 'Critical'],
|
|
79
|
-
],
|
|
80
|
-
badgeColor: '#6b7280',
|
|
81
|
-
badgeColors: {
|
|
82
|
-
0: '#10b981',
|
|
83
|
-
1: '#22c55e',
|
|
84
|
-
2: '#f59e0b',
|
|
85
|
-
3: '#f97316',
|
|
86
|
-
4: '#ef4444',
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
export const TicketPriorities: Story = {
|
|
92
|
-
name: 'Ticket Priorities',
|
|
93
|
-
args: {
|
|
94
|
-
title: 'Tickets by Priority',
|
|
95
|
-
data: [
|
|
96
|
-
['5', 'Critical - Immediate intervention required'],
|
|
97
|
-
['12', 'High - Resolution within 24h'],
|
|
98
|
-
['28', 'Medium - Resolution within 48h'],
|
|
99
|
-
['45', 'Low - Resolution within 7 days'],
|
|
100
|
-
],
|
|
101
|
-
badgeColor: '#ef4444',
|
|
102
|
-
badgeColors: {
|
|
103
|
-
0: '#dc2626',
|
|
104
|
-
1: '#f97316',
|
|
105
|
-
2: '#eab308',
|
|
106
|
-
3: '#84cc16',
|
|
107
|
-
},
|
|
108
|
-
lineClasses: {
|
|
109
|
-
0: 'ticket-critical',
|
|
110
|
-
1: 'ticket-high',
|
|
111
|
-
2: 'ticket-medium',
|
|
112
|
-
},
|
|
113
|
-
},
|
|
114
|
-
decorators: [
|
|
115
|
-
(Story) => (
|
|
116
|
-
<>
|
|
117
|
-
<style>
|
|
118
|
-
{`
|
|
119
|
-
.ticket-critical { background-color: #fef2f2; }
|
|
120
|
-
.ticket-high { background-color: #fffbeb; }
|
|
121
|
-
.ticket-medium { background-color: #f0f9ff; }
|
|
122
|
-
`}
|
|
123
|
-
</style>
|
|
124
|
-
<Story />
|
|
125
|
-
</>
|
|
126
|
-
),
|
|
127
|
-
],
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
export const ProgressIndicators: Story = {
|
|
131
|
-
name: 'Progress Indicators',
|
|
132
|
-
args: {
|
|
133
|
-
title: 'Project Progress',
|
|
134
|
-
data: [
|
|
135
|
-
['75%', 'Website - Frontend development'],
|
|
136
|
-
['90%', 'Mobile app - User testing'],
|
|
137
|
-
['50%', 'API backend - Service integration'],
|
|
138
|
-
['25%', 'Documentation - Writing in progress'],
|
|
139
|
-
],
|
|
140
|
-
badgeColor: '#3b82f6',
|
|
141
|
-
badgePadding: '0.5rem 0.75rem',
|
|
142
|
-
},
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
export const RatingSystem: Story = {
|
|
146
|
-
name: 'Rating System',
|
|
147
|
-
args: {
|
|
148
|
-
title: 'Customer Reviews',
|
|
149
|
-
data: [
|
|
150
|
-
['4.8', '⭐ Excellent - Exceptional service'],
|
|
151
|
-
['4.2', '⭐ Very good - Very satisfied'],
|
|
152
|
-
['3.5', '⭐ Average - Could be better'],
|
|
153
|
-
['2.1', '⭐ Poor - Disappointed'],
|
|
154
|
-
],
|
|
155
|
-
badgeColor: '#f59e0b',
|
|
156
|
-
},
|
|
157
|
-
};
|
|
158
|
-
|
|
159
|
-
export const SmallCounters: Story = {
|
|
160
|
-
name: 'Small Counters',
|
|
161
|
-
args: {
|
|
162
|
-
title: 'System Logs',
|
|
163
|
-
data: [
|
|
164
|
-
['1', 'Critical error'],
|
|
165
|
-
['5', 'Warnings'],
|
|
166
|
-
['42', 'Information'],
|
|
167
|
-
['128', 'Debug messages'],
|
|
168
|
-
],
|
|
169
|
-
badgeColor: '#6366f1',
|
|
170
|
-
badgePadding: '0.25rem 0.5rem',
|
|
171
|
-
},
|
|
172
|
-
};
|
|
173
|
-
|
|
174
|
-
export const StatusIndicators: Story = {
|
|
175
|
-
name: 'Status Indicators',
|
|
176
|
-
args: {
|
|
177
|
-
title: 'Server Status',
|
|
178
|
-
data: [
|
|
179
|
-
['🟢', 'Main server - Online'],
|
|
180
|
-
['🟢', 'Database - Online'],
|
|
181
|
-
['🟡', 'Cache - Degraded'],
|
|
182
|
-
['🔴', 'Backup - Offline'],
|
|
183
|
-
['🟢', 'CDN - Online'],
|
|
184
|
-
],
|
|
185
|
-
badgeColor: '#6b7280',
|
|
186
|
-
badgePadding: '0.375rem 0.5rem',
|
|
187
|
-
},
|
|
188
|
-
};
|
|
189
|
-
|
|
190
|
-
export const LargeNumbers: Story = {
|
|
191
|
-
name: 'Large Numbers',
|
|
192
|
-
args: {
|
|
193
|
-
title: 'Global Statistics',
|
|
194
|
-
data: [
|
|
195
|
-
['1.2K', 'Active users'],
|
|
196
|
-
['45.8K', 'Total views'],
|
|
197
|
-
['2.4M', 'Impressions'],
|
|
198
|
-
['156.7K', 'Interactions'],
|
|
199
|
-
],
|
|
200
|
-
badgeColor: '#8b5cf6',
|
|
201
|
-
badgePadding: '0.5rem 0.75rem',
|
|
202
|
-
},
|
|
203
|
-
};
|
|
204
|
-
|
|
205
|
-
export const FixedWidthBadges: Story = {
|
|
206
|
-
name: 'Fixed Width Badges',
|
|
207
|
-
args: {
|
|
208
|
-
title: 'Controlled Width Badges',
|
|
209
|
-
data: [
|
|
210
|
-
['1', 'Single digit'],
|
|
211
|
-
['42', 'Two digits'],
|
|
212
|
-
['999', 'Three digits'],
|
|
213
|
-
['1K', 'Short text'],
|
|
214
|
-
['10K+', 'Longer text'],
|
|
215
|
-
],
|
|
216
|
-
badgeColor: '#8b5cf6',
|
|
217
|
-
badgeWidth: '48px',
|
|
218
|
-
badgePadding: '0.5rem 0.25rem',
|
|
219
|
-
},
|
|
220
|
-
parameters: {
|
|
221
|
-
docs: {
|
|
222
|
-
description: {
|
|
223
|
-
story:
|
|
224
|
-
'Using the `badgeWidth` prop to force a fixed width on all badges, creating perfect alignment.',
|
|
225
|
-
},
|
|
226
|
-
},
|
|
227
|
-
},
|
|
228
|
-
};
|
|
229
|
-
|
|
230
|
-
export const CompactFixedBadges: Story = {
|
|
231
|
-
name: 'Compact Fixed Badges',
|
|
232
|
-
args: {
|
|
233
|
-
title: 'System Metrics',
|
|
234
|
-
data: [
|
|
235
|
-
['CPU', '45%'],
|
|
236
|
-
['RAM', '68%'],
|
|
237
|
-
['SSD', '82%'],
|
|
238
|
-
['NET', '24%'],
|
|
239
|
-
],
|
|
240
|
-
badgeColor: '#06b6d4',
|
|
241
|
-
badgeWidth: '40px',
|
|
242
|
-
badgePadding: '0.375rem',
|
|
243
|
-
},
|
|
244
|
-
};
|
|
245
|
-
|
|
246
|
-
export const UniformBadges: Story = {
|
|
247
|
-
name: 'Uniform Badges',
|
|
248
|
-
args: {
|
|
249
|
-
title: 'Uniform Statistics',
|
|
250
|
-
data: [
|
|
251
|
-
['A+', 'Excellent'],
|
|
252
|
-
['B', 'Good'],
|
|
253
|
-
['C', 'Average'],
|
|
254
|
-
['D', 'Poor'],
|
|
255
|
-
],
|
|
256
|
-
badgeColor: '#f59e0b',
|
|
257
|
-
badgeWidth: '44px',
|
|
258
|
-
badgePadding: '0.375rem 0.25rem',
|
|
259
|
-
badgeColors: {
|
|
260
|
-
0: '#10b981',
|
|
261
|
-
1: '#22c55e',
|
|
262
|
-
2: '#f59e0b',
|
|
263
|
-
3: '#ef4444',
|
|
264
|
-
},
|
|
265
|
-
},
|
|
266
|
-
};
|
|
267
|
-
|
|
268
|
-
export const AdaptiveVsFixed: Story = {
|
|
269
|
-
name: 'Adaptive vs Fixed Comparison',
|
|
270
|
-
args: {
|
|
271
|
-
title: 'Adaptive (without badgeWidth)',
|
|
272
|
-
data: [
|
|
273
|
-
['1', 'Small'],
|
|
274
|
-
['42', 'Medium'],
|
|
275
|
-
['999', 'Large'],
|
|
276
|
-
['1K+', 'Very large'],
|
|
277
|
-
],
|
|
278
|
-
badgeColor: '#0ea5e9',
|
|
279
|
-
},
|
|
280
|
-
render: (args) => (
|
|
281
|
-
<div style={{ display: 'flex', gap: '2rem', alignItems: 'flex-start' }}>
|
|
282
|
-
<div>
|
|
283
|
-
<h4 style={{ marginBottom: '0.5rem' }}>Adaptive (without badgeWidth)</h4>
|
|
284
|
-
<CounterListBox {...args} />
|
|
285
|
-
</div>
|
|
286
|
-
<div>
|
|
287
|
-
<h4 style={{ marginBottom: '0.5rem' }}>Fixed (with badgeWidth="48px")</h4>
|
|
288
|
-
<CounterListBox {...args} badgeWidth='48px' />
|
|
289
|
-
</div>
|
|
290
|
-
</div>
|
|
291
|
-
),
|
|
292
|
-
};
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { CounterListBox } from './CounterListBox';
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof CounterListBox> = {
|
|
5
|
+
title: 'Components/ListBox/CounterListBox',
|
|
6
|
+
component: CounterListBox,
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: 'centered',
|
|
9
|
+
docs: {
|
|
10
|
+
description: {
|
|
11
|
+
component: 'A list component with circular badges for displaying counters and metrics.',
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
tags: ['autodocs'],
|
|
16
|
+
argTypes: {
|
|
17
|
+
badgeColor: {
|
|
18
|
+
control: 'color',
|
|
19
|
+
description: 'Default badge color',
|
|
20
|
+
},
|
|
21
|
+
badgePadding: {
|
|
22
|
+
control: 'text',
|
|
23
|
+
description: 'Badge padding (e.g., "8px 16px")',
|
|
24
|
+
},
|
|
25
|
+
badgeWidth: {
|
|
26
|
+
control: 'text',
|
|
27
|
+
description: 'Forced badge width (e.g., "40px", "60px")',
|
|
28
|
+
},
|
|
29
|
+
data: {
|
|
30
|
+
control: 'object',
|
|
31
|
+
description: 'Array of strings or [badge, text] tuples',
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export default meta;
|
|
37
|
+
type Story = StoryObj<typeof meta>;
|
|
38
|
+
|
|
39
|
+
export const Default: Story = {
|
|
40
|
+
name: 'Default',
|
|
41
|
+
args: {
|
|
42
|
+
title: 'Statistics',
|
|
43
|
+
data: [
|
|
44
|
+
['15', 'New messages'],
|
|
45
|
+
['42', 'Active users'],
|
|
46
|
+
['128', 'Total visits'],
|
|
47
|
+
['7', 'Pending'],
|
|
48
|
+
],
|
|
49
|
+
badgeColor: '#0ea5e9',
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export const MixedTypes: Story = {
|
|
54
|
+
name: 'Mixed Types',
|
|
55
|
+
args: {
|
|
56
|
+
title: 'System Dashboard',
|
|
57
|
+
data: [
|
|
58
|
+
['99+', 'Unread notifications'],
|
|
59
|
+
'No action required currently',
|
|
60
|
+
['7', 'Overdue tasks'],
|
|
61
|
+
'All systems functioning normally',
|
|
62
|
+
['3', 'Unresolved alerts'],
|
|
63
|
+
'Maintenance scheduled this weekend',
|
|
64
|
+
],
|
|
65
|
+
badgeColor: '#8b5cf6',
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export const ColorfulBadges: Story = {
|
|
70
|
+
name: 'Colorful Badges',
|
|
71
|
+
args: {
|
|
72
|
+
title: 'Performance Evaluation',
|
|
73
|
+
data: [
|
|
74
|
+
['A+', 'Excellent'],
|
|
75
|
+
['B', 'Good'],
|
|
76
|
+
['C', 'Average'],
|
|
77
|
+
['D', 'Needs improvement'],
|
|
78
|
+
['F', 'Critical'],
|
|
79
|
+
],
|
|
80
|
+
badgeColor: '#6b7280',
|
|
81
|
+
badgeColors: {
|
|
82
|
+
0: '#10b981',
|
|
83
|
+
1: '#22c55e',
|
|
84
|
+
2: '#f59e0b',
|
|
85
|
+
3: '#f97316',
|
|
86
|
+
4: '#ef4444',
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
export const TicketPriorities: Story = {
|
|
92
|
+
name: 'Ticket Priorities',
|
|
93
|
+
args: {
|
|
94
|
+
title: 'Tickets by Priority',
|
|
95
|
+
data: [
|
|
96
|
+
['5', 'Critical - Immediate intervention required'],
|
|
97
|
+
['12', 'High - Resolution within 24h'],
|
|
98
|
+
['28', 'Medium - Resolution within 48h'],
|
|
99
|
+
['45', 'Low - Resolution within 7 days'],
|
|
100
|
+
],
|
|
101
|
+
badgeColor: '#ef4444',
|
|
102
|
+
badgeColors: {
|
|
103
|
+
0: '#dc2626',
|
|
104
|
+
1: '#f97316',
|
|
105
|
+
2: '#eab308',
|
|
106
|
+
3: '#84cc16',
|
|
107
|
+
},
|
|
108
|
+
lineClasses: {
|
|
109
|
+
0: 'ticket-critical',
|
|
110
|
+
1: 'ticket-high',
|
|
111
|
+
2: 'ticket-medium',
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
decorators: [
|
|
115
|
+
(Story) => (
|
|
116
|
+
<>
|
|
117
|
+
<style>
|
|
118
|
+
{`
|
|
119
|
+
.ticket-critical { background-color: #fef2f2; }
|
|
120
|
+
.ticket-high { background-color: #fffbeb; }
|
|
121
|
+
.ticket-medium { background-color: #f0f9ff; }
|
|
122
|
+
`}
|
|
123
|
+
</style>
|
|
124
|
+
<Story />
|
|
125
|
+
</>
|
|
126
|
+
),
|
|
127
|
+
],
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
export const ProgressIndicators: Story = {
|
|
131
|
+
name: 'Progress Indicators',
|
|
132
|
+
args: {
|
|
133
|
+
title: 'Project Progress',
|
|
134
|
+
data: [
|
|
135
|
+
['75%', 'Website - Frontend development'],
|
|
136
|
+
['90%', 'Mobile app - User testing'],
|
|
137
|
+
['50%', 'API backend - Service integration'],
|
|
138
|
+
['25%', 'Documentation - Writing in progress'],
|
|
139
|
+
],
|
|
140
|
+
badgeColor: '#3b82f6',
|
|
141
|
+
badgePadding: '0.5rem 0.75rem',
|
|
142
|
+
},
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
export const RatingSystem: Story = {
|
|
146
|
+
name: 'Rating System',
|
|
147
|
+
args: {
|
|
148
|
+
title: 'Customer Reviews',
|
|
149
|
+
data: [
|
|
150
|
+
['4.8', '⭐ Excellent - Exceptional service'],
|
|
151
|
+
['4.2', '⭐ Very good - Very satisfied'],
|
|
152
|
+
['3.5', '⭐ Average - Could be better'],
|
|
153
|
+
['2.1', '⭐ Poor - Disappointed'],
|
|
154
|
+
],
|
|
155
|
+
badgeColor: '#f59e0b',
|
|
156
|
+
},
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
export const SmallCounters: Story = {
|
|
160
|
+
name: 'Small Counters',
|
|
161
|
+
args: {
|
|
162
|
+
title: 'System Logs',
|
|
163
|
+
data: [
|
|
164
|
+
['1', 'Critical error'],
|
|
165
|
+
['5', 'Warnings'],
|
|
166
|
+
['42', 'Information'],
|
|
167
|
+
['128', 'Debug messages'],
|
|
168
|
+
],
|
|
169
|
+
badgeColor: '#6366f1',
|
|
170
|
+
badgePadding: '0.25rem 0.5rem',
|
|
171
|
+
},
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
export const StatusIndicators: Story = {
|
|
175
|
+
name: 'Status Indicators',
|
|
176
|
+
args: {
|
|
177
|
+
title: 'Server Status',
|
|
178
|
+
data: [
|
|
179
|
+
['🟢', 'Main server - Online'],
|
|
180
|
+
['🟢', 'Database - Online'],
|
|
181
|
+
['🟡', 'Cache - Degraded'],
|
|
182
|
+
['🔴', 'Backup - Offline'],
|
|
183
|
+
['🟢', 'CDN - Online'],
|
|
184
|
+
],
|
|
185
|
+
badgeColor: '#6b7280',
|
|
186
|
+
badgePadding: '0.375rem 0.5rem',
|
|
187
|
+
},
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
export const LargeNumbers: Story = {
|
|
191
|
+
name: 'Large Numbers',
|
|
192
|
+
args: {
|
|
193
|
+
title: 'Global Statistics',
|
|
194
|
+
data: [
|
|
195
|
+
['1.2K', 'Active users'],
|
|
196
|
+
['45.8K', 'Total views'],
|
|
197
|
+
['2.4M', 'Impressions'],
|
|
198
|
+
['156.7K', 'Interactions'],
|
|
199
|
+
],
|
|
200
|
+
badgeColor: '#8b5cf6',
|
|
201
|
+
badgePadding: '0.5rem 0.75rem',
|
|
202
|
+
},
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
export const FixedWidthBadges: Story = {
|
|
206
|
+
name: 'Fixed Width Badges',
|
|
207
|
+
args: {
|
|
208
|
+
title: 'Controlled Width Badges',
|
|
209
|
+
data: [
|
|
210
|
+
['1', 'Single digit'],
|
|
211
|
+
['42', 'Two digits'],
|
|
212
|
+
['999', 'Three digits'],
|
|
213
|
+
['1K', 'Short text'],
|
|
214
|
+
['10K+', 'Longer text'],
|
|
215
|
+
],
|
|
216
|
+
badgeColor: '#8b5cf6',
|
|
217
|
+
badgeWidth: '48px',
|
|
218
|
+
badgePadding: '0.5rem 0.25rem',
|
|
219
|
+
},
|
|
220
|
+
parameters: {
|
|
221
|
+
docs: {
|
|
222
|
+
description: {
|
|
223
|
+
story:
|
|
224
|
+
'Using the `badgeWidth` prop to force a fixed width on all badges, creating perfect alignment.',
|
|
225
|
+
},
|
|
226
|
+
},
|
|
227
|
+
},
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
export const CompactFixedBadges: Story = {
|
|
231
|
+
name: 'Compact Fixed Badges',
|
|
232
|
+
args: {
|
|
233
|
+
title: 'System Metrics',
|
|
234
|
+
data: [
|
|
235
|
+
['CPU', '45%'],
|
|
236
|
+
['RAM', '68%'],
|
|
237
|
+
['SSD', '82%'],
|
|
238
|
+
['NET', '24%'],
|
|
239
|
+
],
|
|
240
|
+
badgeColor: '#06b6d4',
|
|
241
|
+
badgeWidth: '40px',
|
|
242
|
+
badgePadding: '0.375rem',
|
|
243
|
+
},
|
|
244
|
+
};
|
|
245
|
+
|
|
246
|
+
export const UniformBadges: Story = {
|
|
247
|
+
name: 'Uniform Badges',
|
|
248
|
+
args: {
|
|
249
|
+
title: 'Uniform Statistics',
|
|
250
|
+
data: [
|
|
251
|
+
['A+', 'Excellent'],
|
|
252
|
+
['B', 'Good'],
|
|
253
|
+
['C', 'Average'],
|
|
254
|
+
['D', 'Poor'],
|
|
255
|
+
],
|
|
256
|
+
badgeColor: '#f59e0b',
|
|
257
|
+
badgeWidth: '44px',
|
|
258
|
+
badgePadding: '0.375rem 0.25rem',
|
|
259
|
+
badgeColors: {
|
|
260
|
+
0: '#10b981',
|
|
261
|
+
1: '#22c55e',
|
|
262
|
+
2: '#f59e0b',
|
|
263
|
+
3: '#ef4444',
|
|
264
|
+
},
|
|
265
|
+
},
|
|
266
|
+
};
|
|
267
|
+
|
|
268
|
+
export const AdaptiveVsFixed: Story = {
|
|
269
|
+
name: 'Adaptive vs Fixed Comparison',
|
|
270
|
+
args: {
|
|
271
|
+
title: 'Adaptive (without badgeWidth)',
|
|
272
|
+
data: [
|
|
273
|
+
['1', 'Small'],
|
|
274
|
+
['42', 'Medium'],
|
|
275
|
+
['999', 'Large'],
|
|
276
|
+
['1K+', 'Very large'],
|
|
277
|
+
],
|
|
278
|
+
badgeColor: '#0ea5e9',
|
|
279
|
+
},
|
|
280
|
+
render: (args) => (
|
|
281
|
+
<div style={{ display: 'flex', gap: '2rem', alignItems: 'flex-start' }}>
|
|
282
|
+
<div>
|
|
283
|
+
<h4 style={{ marginBottom: '0.5rem' }}>Adaptive (without badgeWidth)</h4>
|
|
284
|
+
<CounterListBox {...args} />
|
|
285
|
+
</div>
|
|
286
|
+
<div>
|
|
287
|
+
<h4 style={{ marginBottom: '0.5rem' }}>Fixed (with badgeWidth="48px")</h4>
|
|
288
|
+
<CounterListBox {...args} badgeWidth='48px' />
|
|
289
|
+
</div>
|
|
290
|
+
</div>
|
|
291
|
+
),
|
|
292
|
+
};
|