@gsk_poc/untitled-ui-base 0.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.
Files changed (89) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +44 -0
  3. package/components/application/app-navigation/base-components/featured-cards.demo.tsx +86 -0
  4. package/components/application/app-navigation/base-components/featured-cards.story.tsx +49 -0
  5. package/components/application/app-navigation/header-navigation.demo.tsx +59 -0
  6. package/components/application/app-navigation/header-navigation.story.tsx +23 -0
  7. package/components/application/app-navigation/sidebar-navigation.demo.tsx +409 -0
  8. package/components/application/app-navigation/sidebar-navigation.story.tsx +47 -0
  9. package/components/application/carousel/carousel.demo.tsx +107 -0
  10. package/components/application/carousel/carousel.story.tsx +21 -0
  11. package/components/application/charts/activity-gauges.demo.tsx +251 -0
  12. package/components/application/charts/activity-gauges.story.tsx +27 -0
  13. package/components/application/charts/bar-charts.demo.tsx +506 -0
  14. package/components/application/charts/bar-charts.story.tsx +36 -0
  15. package/components/application/charts/line-charts.demo.tsx +604 -0
  16. package/components/application/charts/line-charts.story.tsx +43 -0
  17. package/components/application/charts/pie-charts.demo.tsx +193 -0
  18. package/components/application/charts/pie-charts.story.tsx +30 -0
  19. package/components/application/charts/progress-circles.demo.tsx +110 -0
  20. package/components/application/charts/progress-circles.story.tsx +33 -0
  21. package/components/application/charts/radar-charts.demo.tsx +203 -0
  22. package/components/application/charts/radar-charts.story.tsx +18 -0
  23. package/components/application/date-picker/date-picker.demo.tsx +217 -0
  24. package/components/application/date-picker/date-picker.story.tsx +44 -0
  25. package/components/application/file-upload/file-upload.demo.tsx +292 -0
  26. package/components/application/file-upload/file-upload.story.tsx +70 -0
  27. package/components/application/loading-indicator/loading-indicator.demo.tsx +73 -0
  28. package/components/application/loading-indicator/loading-indicator.story.tsx +22 -0
  29. package/components/application/pagination/pagination.demo.tsx +104 -0
  30. package/components/application/pagination/pagination.story.tsx +54 -0
  31. package/components/application/table/table.demo.tsx +1038 -0
  32. package/components/application/table/table.story.tsx +119 -0
  33. package/components/application/tabs/tabs.demo.tsx +322 -0
  34. package/components/application/tabs/tabs.story.tsx +43 -0
  35. package/components/base/avatar/avatar.demo.tsx +865 -0
  36. package/components/base/avatar/avatar.story.tsx +27 -0
  37. package/components/base/badges/badge-groups.demo.tsx +357 -0
  38. package/components/base/badges/badge-groups.story.tsx +25 -0
  39. package/components/base/badges/badges.demo.tsx +497 -0
  40. package/components/base/badges/badges.story.tsx +83 -0
  41. package/components/base/button-group/button-group.demo.tsx +131 -0
  42. package/components/base/button-group/button-group.story.tsx +16 -0
  43. package/components/base/buttons/app-store-buttons.demo.tsx +129 -0
  44. package/components/base/buttons/app-store-buttons.story.tsx +13 -0
  45. package/components/base/buttons/buttons.demo.tsx +1022 -0
  46. package/components/base/buttons/buttons.story.tsx +42 -0
  47. package/components/base/buttons/social-buttons.demo.tsx +432 -0
  48. package/components/base/buttons/social-buttons.story.tsx +20 -0
  49. package/components/base/checkbox/checkbox.demo.tsx +62 -0
  50. package/components/base/checkbox/checkbox.story.tsx +18 -0
  51. package/components/base/dropdown/dropdown.demo.tsx +137 -0
  52. package/components/base/dropdown/dropdown.story.tsx +22 -0
  53. package/components/base/input/inputs.demo.tsx +758 -0
  54. package/components/base/input/inputs.story.tsx +52 -0
  55. package/components/base/pin-input/pin-input.demo.tsx +126 -0
  56. package/components/base/pin-input/pin-input.story.tsx +22 -0
  57. package/components/base/progress-indicators/progress-indicators.demo.tsx +54 -0
  58. package/components/base/progress-indicators/progress-indicators.story.tsx +57 -0
  59. package/components/base/radio-buttons/radio-buttons.demo.tsx +77 -0
  60. package/components/base/radio-buttons/radio-buttons.story.tsx +19 -0
  61. package/components/base/select/select.demo.tsx +936 -0
  62. package/components/base/select/select.story.tsx +43 -0
  63. package/components/base/slider/slider.demo.tsx +19 -0
  64. package/components/base/slider/slider.story.tsx +26 -0
  65. package/components/base/tags/tags.demo.tsx +341 -0
  66. package/components/base/tags/tags.story.tsx +28 -0
  67. package/components/base/textarea/textarea.demo.tsx +25 -0
  68. package/components/base/textarea/textarea.story.tsx +15 -0
  69. package/components/base/toggle/toggle.demo.tsx +76 -0
  70. package/components/base/toggle/toggle.story.tsx +23 -0
  71. package/components/base/tooltip/tooltip.demo.tsx +125 -0
  72. package/components/base/tooltip/tooltip.story.tsx +21 -0
  73. package/components/foundations/featured-icon/featured-icon.demo.tsx +160 -0
  74. package/components/foundations/featured-icon/featured-icon.story.tsx +25 -0
  75. package/components/shared-assets/credit-card/credit-card.demo.tsx +106 -0
  76. package/components/shared-assets/credit-card/credit-card.story.tsx +41 -0
  77. package/dist/index.d.mts +1417 -0
  78. package/dist/index.d.ts +1417 -0
  79. package/dist/index.js +10435 -0
  80. package/dist/index.js.map +1 -0
  81. package/dist/index.mjs +10345 -0
  82. package/dist/index.mjs.map +1 -0
  83. package/package.json +126 -0
  84. package/styles/globals.css +65 -0
  85. package/styles/theme.css +430 -0
  86. package/styles/tokens-mapped.css +233 -0
  87. package/styles/tokens.css +807 -0
  88. package/styles/typography.css +430 -0
  89. package/tokens/design-tokens.dtcg.json +3515 -0
@@ -0,0 +1,604 @@
1
+ "use client";
2
+
3
+ import { Area, AreaChart, CartesianGrid, Label, Legend, ResponsiveContainer, Tooltip, XAxis, YAxis } from "recharts";
4
+ import { ChartLegendContent, ChartTooltipContent } from "@/components/application/charts/charts-base";
5
+ import { useBreakpoint } from "@/hooks/use-breakpoint";
6
+ import { cx } from "@/utils/cx";
7
+
8
+ const lineData = [
9
+ // collapse-start
10
+ {
11
+ date: new Date(2025, 0, 1),
12
+ A: 600,
13
+ B: 400,
14
+ C: 100,
15
+ },
16
+ {
17
+ date: new Date(2025, 1, 1),
18
+ A: 620,
19
+ B: 405,
20
+ C: 160,
21
+ },
22
+ {
23
+ date: new Date(2025, 2, 1),
24
+ A: 630,
25
+ B: 400,
26
+ C: 170,
27
+ },
28
+ {
29
+ date: new Date(2025, 3, 1),
30
+ A: 650,
31
+ B: 410,
32
+ C: 190,
33
+ },
34
+ {
35
+ date: new Date(2025, 4, 1),
36
+ A: 600,
37
+ B: 320,
38
+ C: 200,
39
+ },
40
+ {
41
+ date: new Date(2025, 5, 1),
42
+ A: 650,
43
+ B: 430,
44
+ C: 230,
45
+ },
46
+ {
47
+ date: new Date(2025, 6, 1),
48
+ A: 620,
49
+ B: 400,
50
+ C: 200,
51
+ },
52
+ {
53
+ date: new Date(2025, 7, 1),
54
+ A: 750,
55
+ B: 540,
56
+ C: 300,
57
+ },
58
+ {
59
+ date: new Date(2025, 8, 1),
60
+ A: 780,
61
+ B: 490,
62
+ C: 390,
63
+ },
64
+ {
65
+ date: new Date(2025, 9, 1),
66
+ A: 750,
67
+ B: 450,
68
+ C: 300,
69
+ },
70
+ {
71
+ date: new Date(2025, 10, 1),
72
+ A: 780,
73
+ B: 480,
74
+ C: 340,
75
+ },
76
+ {
77
+ date: new Date(2025, 11, 1),
78
+ A: 820,
79
+ B: 500,
80
+ C: 450,
81
+ },
82
+ // collapse-end
83
+ ];
84
+
85
+ export const LineChart01 = () => {
86
+ const isDesktop = useBreakpoint("lg");
87
+
88
+ const colors: Record<string, string> = {
89
+ A: "text-utility-brand-600",
90
+ B: "text-utility-brand-400",
91
+ C: "text-utility-brand-700",
92
+ };
93
+
94
+ return (
95
+ <div className="flex h-60 flex-col gap-2">
96
+ <ResponsiveContainer className="h-full">
97
+ <AreaChart
98
+ data={lineData}
99
+ className="text-tertiary [&_.recharts-text]:text-xs"
100
+ margin={{
101
+ top: isDesktop ? 12 : 6,
102
+ bottom: isDesktop ? 16 : 0,
103
+ }}
104
+ >
105
+ <defs>
106
+ <linearGradient id="gradient" x1="0" y1="0" x2="0" y2="1">
107
+ <stop offset="5%" stopColor="currentColor" className="text-utility-brand-700" stopOpacity="0.7" />
108
+ <stop offset="95%" stopColor="currentColor" className="text-utility-brand-700" stopOpacity="0" />
109
+ </linearGradient>
110
+ </defs>
111
+
112
+ <CartesianGrid vertical={false} stroke="currentColor" className="text-utility-gray-100" />
113
+
114
+ <Legend
115
+ align="right"
116
+ verticalAlign="top"
117
+ layout={isDesktop ? "vertical" : "horizontal"}
118
+ content={<ChartLegendContent className="-translate-y-2" />}
119
+ />
120
+
121
+ <XAxis
122
+ fill="currentColor"
123
+ axisLine={false}
124
+ tickLine={false}
125
+ interval="preserveStartEnd"
126
+ dataKey="date"
127
+ tickFormatter={(value) => value.toLocaleDateString(undefined, { month: "short" })}
128
+ padding={{ left: 10, right: 10 }}
129
+ >
130
+ {isDesktop && (
131
+ <Label fill="currentColor" className="!text-xs font-medium max-lg:hidden" position="bottom">
132
+ Month
133
+ </Label>
134
+ )}
135
+ </XAxis>
136
+
137
+ <YAxis
138
+ fill="currentColor"
139
+ axisLine={false}
140
+ tickLine={false}
141
+ interval="preserveStartEnd"
142
+ tickFormatter={(value) => Number(value).toLocaleString()}
143
+ >
144
+ <Label
145
+ value="Active users"
146
+ fill="currentColor"
147
+ className="!text-xs font-medium"
148
+ style={{ textAnchor: "middle" }}
149
+ angle={-90}
150
+ position="insideLeft"
151
+ />
152
+ </YAxis>
153
+
154
+ <Tooltip
155
+ content={<ChartTooltipContent />}
156
+ formatter={(value) => Number(value).toLocaleString()}
157
+ labelFormatter={(value) => value.toLocaleDateString(undefined, { month: "short", year: "numeric" })}
158
+ cursor={{
159
+ className: "stroke-utility-brand-600 stroke-2",
160
+ }}
161
+ />
162
+
163
+ <Area
164
+ isAnimationActive={false}
165
+ className={cx(colors["A"], "[&_.recharts-area-area]:translate-y-1.5 [&_.recharts-area-area]:[clip-path:inset(0_0_6px_0)]")}
166
+ dataKey="A"
167
+ name="Series 1"
168
+ type="monotone"
169
+ stroke="currentColor"
170
+ strokeWidth={2}
171
+ fill="url(#gradient)"
172
+ fillOpacity={0.1}
173
+ activeDot={{
174
+ className: "fill-bg-primary stroke-utility-brand-600 stroke-2",
175
+ }}
176
+ />
177
+
178
+ <Area
179
+ isAnimationActive={false}
180
+ className={cx(colors["B"], "[&_.recharts-area-area]:translate-y-1.5 [&_.recharts-area-area]:[clip-path:inset(0_0_6px_0)]")}
181
+ dataKey="B"
182
+ name="Series 2"
183
+ type="monotone"
184
+ stroke="currentColor"
185
+ strokeWidth={2}
186
+ fill="none"
187
+ activeDot={{
188
+ className: "fill-bg-primary stroke-utility-brand-600 stroke-2",
189
+ }}
190
+ />
191
+
192
+ <Area
193
+ isAnimationActive={false}
194
+ className={cx(colors["C"], "[&_.recharts-area-area]:translate-y-1.5 [&_.recharts-area-area]:[clip-path:inset(0_0_6px_0)]")}
195
+ dataKey="C"
196
+ name="Series 3"
197
+ type="monotone"
198
+ stroke="currentColor"
199
+ strokeWidth={2}
200
+ fill="none"
201
+ activeDot={{
202
+ className: "fill-bg-primary stroke-utility-brand-600 stroke-2",
203
+ }}
204
+ />
205
+ </AreaChart>
206
+ </ResponsiveContainer>
207
+ </div>
208
+ );
209
+ };
210
+
211
+ export const LineChart02 = () => {
212
+ const isDesktop = useBreakpoint("lg");
213
+
214
+ const colors: Record<string, string> = {
215
+ A: "text-utility-brand-600",
216
+ B: "text-utility-brand-400",
217
+ C: "text-utility-brand-700",
218
+ };
219
+
220
+ return (
221
+ <div className="flex h-60 flex-col gap-2">
222
+ <ResponsiveContainer className="h-full">
223
+ <AreaChart
224
+ data={lineData}
225
+ className="text-tertiary [&_.recharts-text]:text-xs"
226
+ margin={{
227
+ left: 5,
228
+ right: 5,
229
+ top: isDesktop ? 12 : 6,
230
+ bottom: isDesktop ? 16 : 0,
231
+ }}
232
+ >
233
+ <defs>
234
+ <linearGradient id="gradient" x1="0" y1="0" x2="0" y2="1">
235
+ <stop offset="5%" stopColor="currentColor" className="text-utility-brand-700" stopOpacity="0.7" />
236
+ <stop offset="95%" stopColor="currentColor" className="text-utility-brand-700" stopOpacity="0" />
237
+ </linearGradient>
238
+ </defs>
239
+
240
+ <CartesianGrid vertical={false} stroke="currentColor" className="text-utility-gray-100" />
241
+
242
+ <Legend
243
+ verticalAlign="top"
244
+ align="right"
245
+ layout={isDesktop ? "vertical" : "horizontal"}
246
+ content={<ChartLegendContent className="-translate-y-2" />}
247
+ />
248
+
249
+ <XAxis
250
+ fill="currentColor"
251
+ axisLine={false}
252
+ tickLine={false}
253
+ interval="preserveStartEnd"
254
+ dataKey="date"
255
+ tickFormatter={(value) => value.toLocaleDateString(undefined, { month: "short" })}
256
+ padding={{ left: 10, right: 10 }}
257
+ >
258
+ {isDesktop && (
259
+ <Label fill="currentColor" className="!text-xs font-medium max-lg:hidden" position="bottom">
260
+ Month
261
+ </Label>
262
+ )}
263
+ </XAxis>
264
+
265
+ <YAxis
266
+ fill="currentColor"
267
+ axisLine={false}
268
+ tickLine={false}
269
+ interval="preserveStartEnd"
270
+ tickFormatter={(value) => Number(value).toLocaleString()}
271
+ >
272
+ <Label
273
+ value="Active users"
274
+ fill="currentColor"
275
+ className="!text-xs font-medium"
276
+ style={{ textAnchor: "middle" }}
277
+ angle={-90}
278
+ position="insideLeft"
279
+ />
280
+ </YAxis>
281
+
282
+ <Tooltip
283
+ content={<ChartTooltipContent />}
284
+ formatter={(value) => Number(value).toLocaleString()}
285
+ labelFormatter={(value) => value.toLocaleDateString(undefined, { month: "short", year: "numeric" })}
286
+ cursor={{
287
+ className: "stroke-utility-brand-600 stroke-2",
288
+ }}
289
+ />
290
+
291
+ <Area
292
+ isAnimationActive={false}
293
+ className={cx(colors["A"], "[&_.recharts-area-area]:translate-y-1.5 [&_.recharts-area-area]:[clip-path:inset(0_0_6px_0)]")}
294
+ dataKey="A"
295
+ name="Series 1"
296
+ type="monotone"
297
+ stroke="currentColor"
298
+ strokeWidth={2}
299
+ fill="url(#gradient)"
300
+ fillOpacity={0.1}
301
+ activeDot={{
302
+ className: "fill-bg-primary stroke-utility-brand-600 stroke-2",
303
+ }}
304
+ />
305
+
306
+ <Area
307
+ isAnimationActive={false}
308
+ className={cx(colors["B"], "[&_.recharts-area-area]:translate-y-1.5 [&_.recharts-area-area]:[clip-path:inset(0_0_6px_0)]")}
309
+ dataKey="B"
310
+ name="Series 2"
311
+ type="monotone"
312
+ stroke="currentColor"
313
+ strokeWidth={2}
314
+ fill="none"
315
+ strokeDasharray="0.1 8"
316
+ strokeLinecap="round"
317
+ activeDot={{
318
+ className: "fill-bg-primary stroke-utility-brand-600 stroke-2",
319
+ }}
320
+ />
321
+
322
+ <Area
323
+ isAnimationActive={false}
324
+ className={cx(colors["C"], "[&_.recharts-area-area]:translate-y-1.5 [&_.recharts-area-area]:[clip-path:inset(0_0_6px_0)]")}
325
+ dataKey="C"
326
+ name="Series 3"
327
+ type="monotone"
328
+ stroke="currentColor"
329
+ strokeWidth={2}
330
+ fill="none"
331
+ strokeDasharray="0.1 8"
332
+ strokeLinecap="round"
333
+ activeDot={{
334
+ className: "fill-bg-primary stroke-utility-brand-600 stroke-2",
335
+ }}
336
+ />
337
+ </AreaChart>
338
+ </ResponsiveContainer>
339
+ </div>
340
+ );
341
+ };
342
+
343
+ export const LineChart03 = () => {
344
+ const isDesktop = useBreakpoint("lg");
345
+
346
+ const colors: Record<string, string> = {
347
+ A: "text-utility-brand-600",
348
+ B: "text-utility-brand-400",
349
+ C: "text-utility-brand-700",
350
+ };
351
+
352
+ return (
353
+ <div className="flex h-60 flex-col gap-2">
354
+ <ResponsiveContainer className="h-full">
355
+ <AreaChart
356
+ data={lineData}
357
+ className="text-tertiary [&_.recharts-text]:text-xs"
358
+ margin={{
359
+ left: 5,
360
+ right: 5,
361
+ top: isDesktop ? 12 : 6,
362
+ bottom: isDesktop ? 16 : 0,
363
+ }}
364
+ >
365
+ <defs>
366
+ <linearGradient id="gradient" x1="0" y1="0" x2="0" y2="1">
367
+ <stop offset="0%" stopColor="currentColor" className="text-utility-gray-500" stopOpacity="0.8" />
368
+ <stop offset="80%" stopColor="currentColor" className="text-utility-gray-500" stopOpacity="0" />
369
+ </linearGradient>
370
+
371
+ <pattern id="verticalLines" width="8" height="100%" fill="url(#gradient)" patternUnits="userSpaceOnUse">
372
+ <line x1="0" y1="0" x2="0" y2="100%" stroke="currentColor" className="text-utility-gray-200" strokeWidth="1.5" />
373
+ <rect width="100%" height="100%" fill="url(#gradient)" fillOpacity={0.15} />
374
+ </pattern>
375
+ </defs>
376
+
377
+ <CartesianGrid vertical={false} stroke="currentColor" className="text-utility-gray-100" />
378
+
379
+ <Legend
380
+ verticalAlign="top"
381
+ align="right"
382
+ layout={isDesktop ? "vertical" : "horizontal"}
383
+ content={<ChartLegendContent className="-translate-y-2" />}
384
+ />
385
+
386
+ <XAxis
387
+ fill="currentColor"
388
+ axisLine={false}
389
+ tickLine={false}
390
+ tickMargin={10}
391
+ interval="preserveStartEnd"
392
+ dataKey="date"
393
+ padding={{ left: 10, right: 10 }}
394
+ tickFormatter={(value) => value.toLocaleDateString(undefined, { month: "short" })}
395
+ >
396
+ {isDesktop && (
397
+ <Label fill="currentColor" className="!text-xs font-medium max-lg:hidden" position="bottom">
398
+ Month
399
+ </Label>
400
+ )}
401
+ </XAxis>
402
+
403
+ <YAxis
404
+ fill="currentColor"
405
+ axisLine={false}
406
+ tickLine={false}
407
+ interval="preserveStartEnd"
408
+ tickFormatter={(value) => Number(value).toLocaleString()}
409
+ >
410
+ <Label
411
+ value="Active users"
412
+ fill="currentColor"
413
+ className="!text-xs font-medium"
414
+ style={{ textAnchor: "middle" }}
415
+ angle={-90}
416
+ position="insideLeft"
417
+ />
418
+ </YAxis>
419
+
420
+ <Tooltip
421
+ content={<ChartTooltipContent />}
422
+ formatter={(value) => Number(value).toLocaleString()}
423
+ labelFormatter={(value) => value.toLocaleDateString(undefined, { month: "short", year: "numeric" })}
424
+ cursor={{
425
+ className: "stroke-utility-brand-600 stroke-2",
426
+ }}
427
+ />
428
+
429
+ <Area
430
+ isAnimationActive={false}
431
+ className={cx(colors["A"], "[&_.recharts-area-area]:translate-y-1.5 [&_.recharts-area-area]:[clip-path:inset(0_0_6px_0)]")}
432
+ dataKey="A"
433
+ name="Series 1"
434
+ type="monotone"
435
+ stroke="currentColor"
436
+ strokeWidth={2}
437
+ fill="url(#verticalLines)"
438
+ fillOpacity={1}
439
+ activeDot={{
440
+ className: "fill-bg-primary stroke-utility-brand-600 stroke-2",
441
+ }}
442
+ />
443
+
444
+ <Area
445
+ isAnimationActive={false}
446
+ className={cx(colors["B"], "[&_.recharts-area-area]:translate-y-1.5 [&_.recharts-area-area]:[clip-path:inset(0_0_6px_0)]")}
447
+ dataKey="B"
448
+ name="Series 2"
449
+ type="monotone"
450
+ stroke="currentColor"
451
+ strokeWidth={2}
452
+ fill="none"
453
+ activeDot={{
454
+ className: "fill-bg-primary stroke-utility-brand-600 stroke-2",
455
+ }}
456
+ />
457
+
458
+ <Area
459
+ isAnimationActive={false}
460
+ className={cx(colors["C"], "[&_.recharts-area-area]:translate-y-1.5 [&_.recharts-area-area]:[clip-path:inset(0_0_6px_0)]")}
461
+ dataKey="C"
462
+ name="Series 3"
463
+ type="monotone"
464
+ stroke="currentColor"
465
+ strokeWidth={2}
466
+ fill="none"
467
+ activeDot={{
468
+ className: "fill-bg-primary stroke-utility-brand-600 stroke-2",
469
+ }}
470
+ />
471
+ </AreaChart>
472
+ </ResponsiveContainer>
473
+ </div>
474
+ );
475
+ };
476
+
477
+ export const LineChart04 = () => {
478
+ const isDesktop = useBreakpoint("lg");
479
+
480
+ const colors: Record<string, string> = {
481
+ A: "text-utility-brand-600",
482
+ B: "text-utility-gray-500",
483
+ C: "text-utility-gray-400",
484
+ };
485
+
486
+ return (
487
+ <div className="flex h-60 flex-col gap-2">
488
+ <ResponsiveContainer className="h-full">
489
+ <AreaChart
490
+ data={lineData}
491
+ className="text-tertiary [&_.recharts-text]:text-xs"
492
+ margin={{
493
+ left: 5,
494
+ right: 5,
495
+ top: isDesktop ? 12 : 6,
496
+ bottom: isDesktop ? 16 : 0,
497
+ }}
498
+ >
499
+ <defs>
500
+ <linearGradient id="gradient" x1="0" y1="0" x2="0" y2="1">
501
+ <stop offset="5%" stopColor="currentColor" className="text-utility-gray-500" stopOpacity="0.7" />
502
+ <stop offset="95%" stopColor="currentColor" className="text-utility-gray-500" stopOpacity="0" />
503
+ </linearGradient>
504
+ </defs>
505
+
506
+ <CartesianGrid vertical={false} stroke="currentColor" className="text-utility-gray-100" />
507
+
508
+ <Legend
509
+ verticalAlign="top"
510
+ align="right"
511
+ layout={isDesktop ? "vertical" : "horizontal"}
512
+ content={<ChartLegendContent className="-translate-y-2" />}
513
+ />
514
+
515
+ <XAxis
516
+ fill="currentColor"
517
+ axisLine={false}
518
+ tickLine={false}
519
+ tickMargin={10}
520
+ interval="preserveStartEnd"
521
+ dataKey="date"
522
+ tickFormatter={(value) => value.toLocaleDateString(undefined, { month: "short" })}
523
+ padding={{ left: 10, right: 10 }}
524
+ >
525
+ {isDesktop && (
526
+ <Label fill="currentColor" className="!text-xs font-medium max-lg:hidden" position="bottom">
527
+ Month
528
+ </Label>
529
+ )}
530
+ </XAxis>
531
+
532
+ <YAxis
533
+ fill="currentColor"
534
+ axisLine={false}
535
+ tickLine={false}
536
+ interval="preserveStartEnd"
537
+ tickFormatter={(value) => Number(value).toLocaleString()}
538
+ >
539
+ <Label
540
+ value="Active users"
541
+ fill="currentColor"
542
+ className="!text-xs font-medium"
543
+ style={{ textAnchor: "middle" }}
544
+ angle={-90}
545
+ position="insideLeft"
546
+ />
547
+ </YAxis>
548
+
549
+ <Tooltip
550
+ content={<ChartTooltipContent />}
551
+ formatter={(value) => Number(value).toLocaleString()}
552
+ labelFormatter={(value) => value.toLocaleDateString(undefined, { month: "short", year: "numeric" })}
553
+ cursor={{
554
+ className: "stroke-utility-brand-600 stroke-2",
555
+ }}
556
+ />
557
+
558
+ <Area
559
+ isAnimationActive={false}
560
+ className={cx(colors["A"], "[&_.recharts-area-area]:translate-y-1.5 [&_.recharts-area-area]:[clip-path:inset(0_0_6px_0)]")}
561
+ dataKey="A"
562
+ name="Series 1"
563
+ type="monotone"
564
+ stroke="currentColor"
565
+ strokeWidth={2}
566
+ fill="url(#gradient)"
567
+ fillOpacity={0.1}
568
+ activeDot={{
569
+ className: "fill-bg-primary stroke-utility-brand-600 stroke-2",
570
+ }}
571
+ />
572
+
573
+ <Area
574
+ isAnimationActive={false}
575
+ className={cx(colors["B"], "[&_.recharts-area-area]:translate-y-1.5 [&_.recharts-area-area]:[clip-path:inset(0_0_6px_0)]")}
576
+ dataKey="B"
577
+ name="Series 2"
578
+ type="monotone"
579
+ stroke="currentColor"
580
+ strokeWidth={2}
581
+ fill="none"
582
+ activeDot={{
583
+ className: "fill-bg-primary stroke-utility-brand-600 stroke-2",
584
+ }}
585
+ />
586
+
587
+ <Area
588
+ isAnimationActive={false}
589
+ className={cx(colors["C"], "[&_.recharts-area-area]:translate-y-1.5 [&_.recharts-area-area]:[clip-path:inset(0_0_6px_0)]")}
590
+ dataKey="C"
591
+ name="Series 3"
592
+ type="monotone"
593
+ stroke="currentColor"
594
+ strokeWidth={2}
595
+ fill="none"
596
+ activeDot={{
597
+ className: "fill-bg-primary stroke-utility-brand-600 stroke-2",
598
+ }}
599
+ />
600
+ </AreaChart>
601
+ </ResponsiveContainer>
602
+ </div>
603
+ );
604
+ };
@@ -0,0 +1,43 @@
1
+ import type { FC } from "react";
2
+ import * as Charts from "./line-charts.demo";
3
+
4
+ export default {
5
+ title: "Application/Charts",
6
+ decorators: [
7
+ (Story: FC) => (
8
+ <div className="flex min-h-screen items-center justify-center bg-primary py-8">
9
+ <div className="flex w-full items-center justify-center">
10
+ <Story />
11
+ </div>
12
+ </div>
13
+ ),
14
+ ],
15
+ };
16
+
17
+ export const LineChart01 = () => (
18
+ <div className="w-full max-w-5xl">
19
+ <Charts.LineChart01 />
20
+ </div>
21
+ );
22
+ LineChart01.storyName = "Line chart 01";
23
+
24
+ export const LineChart02 = () => (
25
+ <div className="w-full max-w-5xl">
26
+ <Charts.LineChart02 />
27
+ </div>
28
+ );
29
+ LineChart02.storyName = "Line chart 02";
30
+
31
+ export const LineChart03 = () => (
32
+ <div className="w-full max-w-5xl">
33
+ <Charts.LineChart03 />
34
+ </div>
35
+ );
36
+ LineChart03.storyName = "Line chart 03";
37
+
38
+ export const LineChart04 = () => (
39
+ <div className="w-full max-w-5xl">
40
+ <Charts.LineChart04 />
41
+ </div>
42
+ );
43
+ LineChart04.storyName = "Line chart 04";