@umituz/web-design-system 6.1.0 → 6.1.1
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/web-design-system",
|
|
3
|
-
"version": "6.1.
|
|
3
|
+
"version": "6.1.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Web Design System - Tailwind v4 authored, precompiled CSS shipped. Atomic Design components (Atoms, Molecules, Organisms, Templates) for React applications.",
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
"./atoms": "./src/presentation/atoms/index.ts",
|
|
16
16
|
"./bridge.css": "./src/styles/bridge.css",
|
|
17
17
|
"./charts": "./src/presentation/organisms/charts/index.ts",
|
|
18
|
+
"./charts.css": "./src/styles/charts.css",
|
|
18
19
|
"./constants": "./src/infrastructure/constants/index.ts",
|
|
19
20
|
"./hooks": "./src/presentation/hooks/index.ts",
|
|
20
21
|
"./molecules": "./src/presentation/molecules/index.ts",
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { renderToString } from 'react-dom/server';
|
|
3
|
+
import {
|
|
4
|
+
BarChart,
|
|
5
|
+
Donut,
|
|
6
|
+
LineChart,
|
|
7
|
+
ActivityHeatmap,
|
|
8
|
+
ChartCard,
|
|
9
|
+
HBars,
|
|
10
|
+
Sparkline,
|
|
11
|
+
} from '../../presentation/organisms/charts';
|
|
12
|
+
|
|
13
|
+
describe('charts server rendering', () => {
|
|
14
|
+
it('renders every chart primitive to static markup', () => {
|
|
15
|
+
const html = [
|
|
16
|
+
renderToString(
|
|
17
|
+
<ChartCard title="T" tip={null}>
|
|
18
|
+
<span>body</span>
|
|
19
|
+
</ChartCard>,
|
|
20
|
+
),
|
|
21
|
+
renderToString(<BarChart labels={['a', 'b']} series={[{ label: 'A', values: [1, 2] }]} />),
|
|
22
|
+
renderToString(
|
|
23
|
+
<BarChart
|
|
24
|
+
labels={['a']}
|
|
25
|
+
stacking="stacked"
|
|
26
|
+
series={[
|
|
27
|
+
{ label: 'A', values: [2] },
|
|
28
|
+
{ label: 'B', values: [2] },
|
|
29
|
+
]}
|
|
30
|
+
/>,
|
|
31
|
+
),
|
|
32
|
+
renderToString(<Donut segments={[{ label: 'A', value: 1 }]} centerValue="1" />),
|
|
33
|
+
renderToString(
|
|
34
|
+
<LineChart
|
|
35
|
+
labels={['a', 'b']}
|
|
36
|
+
series={[{ label: 'A', values: [1, 2], areaFill: 'gradient' }]}
|
|
37
|
+
/>,
|
|
38
|
+
),
|
|
39
|
+
renderToString(<ActivityHeatmap cells={[{ day: '2026-01-01', value: 3 }]} />),
|
|
40
|
+
renderToString(<Sparkline data={[1, 2]} />),
|
|
41
|
+
renderToString(<HBars rows={[{ label: 'A', value: 1 }]} />),
|
|
42
|
+
].join('');
|
|
43
|
+
expect(html).toContain('udb-chartcard');
|
|
44
|
+
expect(html).toContain('udb-barchart__bars--stacked');
|
|
45
|
+
expect(html).toContain('udb-donut');
|
|
46
|
+
expect(html).toContain('udb-linechart');
|
|
47
|
+
expect(html).toContain('linearGradient');
|
|
48
|
+
expect(html).toContain('udb-heatmap__cell--l');
|
|
49
|
+
expect(html).toContain('udb-hbars');
|
|
50
|
+
});
|
|
51
|
+
});
|
package/src/styles/app.css
CHANGED