@svadmin/ui 0.11.2 → 0.13.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/app.css +244 -4
- package/src/component-registry.svelte.ts +14 -0
- package/src/components/AdminApp.svelte +10 -2
- package/src/components/AnimatedCounter.svelte +46 -0
- package/src/components/AutoTable.svelte +59 -7
- package/src/components/Breadcrumbs.svelte +3 -1
- package/src/components/DraggableHeader.svelte +112 -0
- package/src/components/Header.svelte +40 -8
- package/src/components/InlineEdit.svelte +88 -0
- package/src/components/KeyboardShortcuts.svelte +61 -0
- package/src/components/Layout.svelte +7 -1
- package/src/components/Sidebar.svelte +14 -7
- package/src/components/VirtualTable.svelte +76 -0
- package/src/components/charts/BarChart.svelte +69 -0
- package/src/components/charts/LineChart.svelte +115 -0
- package/src/components/charts/PieChart.svelte +95 -0
- package/src/components/charts/index.ts +3 -0
- package/src/components/stories/BarChart.stories.ts +43 -0
- package/src/components/stories/LineChart.stories.ts +48 -0
- package/src/components/stories/PieChart.stories.ts +41 -0
- package/src/index.ts +8 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/svelte';
|
|
2
|
+
import BarChart from '../charts/BarChart.svelte';
|
|
3
|
+
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'Charts/BarChart',
|
|
6
|
+
component: BarChart,
|
|
7
|
+
tags: ['autodocs'],
|
|
8
|
+
argTypes: {
|
|
9
|
+
height: { control: { type: 'number', min: 100, max: 500 } },
|
|
10
|
+
showValues: { control: 'boolean' },
|
|
11
|
+
},
|
|
12
|
+
} satisfies Meta<BarChart>;
|
|
13
|
+
|
|
14
|
+
export default meta;
|
|
15
|
+
type Story = StoryObj<typeof meta>;
|
|
16
|
+
|
|
17
|
+
export const Default: Story = {
|
|
18
|
+
args: {
|
|
19
|
+
data: [
|
|
20
|
+
{ label: 'Jan', value: 120 },
|
|
21
|
+
{ label: 'Feb', value: 180 },
|
|
22
|
+
{ label: 'Mar', value: 95 },
|
|
23
|
+
{ label: 'Apr', value: 210 },
|
|
24
|
+
{ label: 'May', value: 165 },
|
|
25
|
+
{ label: 'Jun', value: 245 },
|
|
26
|
+
],
|
|
27
|
+
height: 200,
|
|
28
|
+
showValues: true,
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export const CustomColors: Story = {
|
|
33
|
+
args: {
|
|
34
|
+
data: [
|
|
35
|
+
{ label: 'Users', value: 1200, color: '#6366f1' },
|
|
36
|
+
{ label: 'Orders', value: 850, color: '#f59e0b' },
|
|
37
|
+
{ label: 'Revenue', value: 2100, color: '#10b981' },
|
|
38
|
+
{ label: 'Returns', value: 120, color: '#ef4444' },
|
|
39
|
+
],
|
|
40
|
+
height: 250,
|
|
41
|
+
showValues: true,
|
|
42
|
+
},
|
|
43
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/svelte';
|
|
2
|
+
import LineChart from '../charts/LineChart.svelte';
|
|
3
|
+
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'Charts/LineChart',
|
|
6
|
+
component: LineChart,
|
|
7
|
+
tags: ['autodocs'],
|
|
8
|
+
argTypes: {
|
|
9
|
+
height: { control: { type: 'number', min: 100, max: 500 } },
|
|
10
|
+
showDots: { control: 'boolean' },
|
|
11
|
+
fill: { control: 'boolean' },
|
|
12
|
+
},
|
|
13
|
+
} satisfies Meta<LineChart>;
|
|
14
|
+
|
|
15
|
+
export default meta;
|
|
16
|
+
type Story = StoryObj<typeof meta>;
|
|
17
|
+
|
|
18
|
+
export const Default: Story = {
|
|
19
|
+
args: {
|
|
20
|
+
data: [
|
|
21
|
+
{ label: 'Mon', value: 120 },
|
|
22
|
+
{ label: 'Tue', value: 180 },
|
|
23
|
+
{ label: 'Wed', value: 150 },
|
|
24
|
+
{ label: 'Thu', value: 210 },
|
|
25
|
+
{ label: 'Fri', value: 190 },
|
|
26
|
+
{ label: 'Sat', value: 250 },
|
|
27
|
+
{ label: 'Sun', value: 220 },
|
|
28
|
+
],
|
|
29
|
+
height: 200,
|
|
30
|
+
showDots: true,
|
|
31
|
+
fill: true,
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const NoFill: Story = {
|
|
36
|
+
args: {
|
|
37
|
+
data: [
|
|
38
|
+
{ label: 'Q1', value: 3200 },
|
|
39
|
+
{ label: 'Q2', value: 4100 },
|
|
40
|
+
{ label: 'Q3', value: 3800 },
|
|
41
|
+
{ label: 'Q4', value: 5200 },
|
|
42
|
+
],
|
|
43
|
+
height: 250,
|
|
44
|
+
showDots: true,
|
|
45
|
+
fill: false,
|
|
46
|
+
color: '#10b981',
|
|
47
|
+
},
|
|
48
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/svelte';
|
|
2
|
+
import PieChart from '../charts/PieChart.svelte';
|
|
3
|
+
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'Charts/PieChart',
|
|
6
|
+
component: PieChart,
|
|
7
|
+
tags: ['autodocs'],
|
|
8
|
+
argTypes: {
|
|
9
|
+
size: { control: { type: 'number', min: 100, max: 400 } },
|
|
10
|
+
donut: { control: { type: 'number', min: 0, max: 0.8, step: 0.1 } },
|
|
11
|
+
},
|
|
12
|
+
} satisfies Meta<PieChart>;
|
|
13
|
+
|
|
14
|
+
export default meta;
|
|
15
|
+
type Story = StoryObj<typeof meta>;
|
|
16
|
+
|
|
17
|
+
export const Donut: Story = {
|
|
18
|
+
args: {
|
|
19
|
+
data: [
|
|
20
|
+
{ label: 'Desktop', value: 580, color: '#6366f1' },
|
|
21
|
+
{ label: 'Mobile', value: 320, color: '#f59e0b' },
|
|
22
|
+
{ label: 'Tablet', value: 100, color: '#10b981' },
|
|
23
|
+
],
|
|
24
|
+
size: 200,
|
|
25
|
+
donut: 0.6,
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export const Pie: Story = {
|
|
30
|
+
args: {
|
|
31
|
+
data: [
|
|
32
|
+
{ label: 'Chrome', value: 64, color: '#4285f4' },
|
|
33
|
+
{ label: 'Safari', value: 19, color: '#5ac8fa' },
|
|
34
|
+
{ label: 'Firefox', value: 10, color: '#ff7139' },
|
|
35
|
+
{ label: 'Edge', value: 4, color: '#0078d7' },
|
|
36
|
+
{ label: 'Other', value: 3, color: '#a0a0a0' },
|
|
37
|
+
],
|
|
38
|
+
size: 220,
|
|
39
|
+
donut: 0,
|
|
40
|
+
},
|
|
41
|
+
};
|
package/src/index.ts
CHANGED
|
@@ -54,6 +54,14 @@ export { default as CopilotPanel } from "./components/CopilotPanel.svelte";
|
|
|
54
54
|
export { default as InsightCard } from "./components/InsightCard.svelte";
|
|
55
55
|
export { default as AnomalyBadge } from "./components/AnomalyBadge.svelte";
|
|
56
56
|
export { default as VoiceInput } from "./components/VoiceInput.svelte";
|
|
57
|
+
export { default as AnimatedCounter } from "./components/AnimatedCounter.svelte";
|
|
58
|
+
export { default as KeyboardShortcuts } from "./components/KeyboardShortcuts.svelte";
|
|
59
|
+
export { default as InlineEdit } from "./components/InlineEdit.svelte";
|
|
60
|
+
export { default as VirtualTable } from "./components/VirtualTable.svelte";
|
|
61
|
+
export { default as DraggableHeader } from "./components/DraggableHeader.svelte";
|
|
62
|
+
|
|
63
|
+
// Dashboard Charts (zero-dependency SVG)
|
|
64
|
+
export { BarChart, LineChart, PieChart } from './components/charts/index.js';
|
|
57
65
|
// Field display components
|
|
58
66
|
export { default as NumberField } from './components/fields/NumberField.svelte';
|
|
59
67
|
export { default as DateField } from './components/fields/DateField.svelte';
|