Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
import React, { ReactElement } from "react";
import { Link } from "gatsby";
import { Content } from "@onegeo/gatsby-theme-onegeo";
import { Stats } from "@onegeo/gatsby-theme-onegeo";
function button(): ReactElement {
return (
<Content>
<div className="prose">
<Link to="/doc/core">Retour</Link>
<h1>Stats</h1>
<h2>Props</h2>
<div className="mockup-code">
<pre>
<code>
{`interface Props {
children?: React.ReactNode;
className?: string;
icon?: JSX.Element;
title?: string;
value?: string;
desc?: string;
iconColor?: string;
valueColor?: string;
descColor?: string;
}`}
</code>
</pre>
</div>
<h2>Example</h2>
</div>
<div className="flex gap-6 m-4">
<h2>Simple stat :</h2>
<Stats title="Simple stat" value="99,9" desc="Without icon" />
<Stats
title="Simple stat"
value="99,9"
desc="With icon"
icon={
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
className="inline-block w-8 h-8 stroke-current"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
d="M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z"
></path>
</svg>
}
/>
</div>
<div className="flex gap-6 m-4">
<h2>Stat with background color :</h2>
<Stats
className="bg-primary text-primary-content"
title="Simple stat"
value="99,9"
desc="With bg color"
/>
<Stats
className="bg-secondary text-secondary-content"
title="Simple stat"
value="99,9"
desc="With bg color"
/>
</div>
<div className="flex gap-6 m-4">
<h2>Stat with colored value :</h2>
<Stats
title="Simple stat"
value="99,9"
desc="Colored value"
valueColor="text-primary"
/>
<Stats
title="Simple stat"
value="99,9"
desc="Colored value"
valueColor="text-secondary"
/>
</div>
<div className="flex gap-6 m-4">
<h2>Stat with colored description :</h2>
<Stats
title="Simple stat"
value="99,9"
desc="Colored description"
descColor="text-primary"
/>
<Stats
title="Simple stat"
value="99,9"
desc="Colored description"
descColor="text-secondary"
/>
</div>
<div className="flex gap-6 m-4">
<h2>Stat with colored icon :</h2>
<Stats
title="Simple stat"
value="99,9"
desc="Colored icon"
iconColor="text-primary"
icon={
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
className="inline-block w-8 h-8 stroke-current"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
d="M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z"
></path>
</svg>
}
/>
<Stats
title="Simple stat"
value="99,9"
desc="Colored icon"
iconColor="text-secondary"
icon={
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
className="inline-block w-8 h-8 stroke-current"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
d="M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z"
></path>
</svg>
}
/>
</div>
<div className="flex gap-6 m-4">
<h2>Stat with element :</h2>
<Stats title="Simple stat" value="99,9" desc="With element">
<a href="https://daisyui.com/components/button/" className="btn btn-sm btn-success">Button</a>