@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,251 @@
1
+ "use client";
2
+
3
+ import { Legend, PolarAngleAxis, RadialBar, RadialBarChart, ResponsiveContainer, Tooltip } from "recharts";
4
+ import { ChartLegendContent, ChartTooltipContent } from "@/components/application/charts/charts-base";
5
+ import { cx } from "@/utils/cx";
6
+
7
+ const radialData = [
8
+ // collapse-start
9
+ {
10
+ name: "Series 3",
11
+ value: 660,
12
+ className: "text-utility-brand-400",
13
+ },
14
+ {
15
+ name: "Series 2",
16
+ value: 774,
17
+ className: "text-utility-brand-600",
18
+ },
19
+ {
20
+ name: "Series 1",
21
+ value: 866,
22
+ className: "text-utility-brand-700",
23
+ },
24
+ // collapse-end
25
+ ];
26
+
27
+ interface ActivityGaugeProps {
28
+ title?: string;
29
+ subtitle?: string;
30
+ data?: {
31
+ name: string;
32
+ value: number;
33
+ className?: string;
34
+ }[];
35
+ }
36
+
37
+ export const ActivityGaugeXs = ({ title = "1,000", subtitle = "Active users", data = radialData }: ActivityGaugeProps) => {
38
+ return (
39
+ <ResponsiveContainer height={220}>
40
+ <RadialBarChart
41
+ data={data}
42
+ accessibilityLayer
43
+ innerRadius={52}
44
+ outerRadius={86}
45
+ // This is needed to start the chart at the top and go clockwise
46
+ startAngle={90}
47
+ endAngle={360 + 90}
48
+ className="font-medium text-tertiary [&_.recharts-polar-grid]:text-utility-gray-100 [&_.recharts-text]:text-sm"
49
+ margin={{
50
+ left: 0,
51
+ right: 0,
52
+ top: 0,
53
+ bottom: 0,
54
+ }}
55
+ >
56
+ <PolarAngleAxis tick={false} domain={[0, 1000]} type="number" reversed />
57
+
58
+ <Legend verticalAlign="bottom" align="center" layout="horizontal" content={<ChartLegendContent />} />
59
+
60
+ <Tooltip content={<ChartTooltipContent isRadialChart />} />
61
+
62
+ <RadialBar
63
+ isAnimationActive={false}
64
+ dataKey="value"
65
+ cornerRadius={99}
66
+ fill="currentColor"
67
+ background={{
68
+ className: "fill-utility-gray-100",
69
+ }}
70
+ />
71
+
72
+ {(title || subtitle) && (
73
+ <text x="50%" y="50%" textAnchor="middle" dominantBaseline="middle">
74
+ {subtitle && (
75
+ <tspan x="50%" dy={title ? "-1.175em" : "1%"} className={cx("fill-current text-tertiary", "text-xs font-medium")}>
76
+ {subtitle}
77
+ </tspan>
78
+ )}
79
+ {title && (
80
+ <tspan x="50%" dy={subtitle ? "1.25em" : "1%"} className={cx("fill-current text-primary", "text-xl font-semibold")}>
81
+ {title}
82
+ </tspan>
83
+ )}
84
+ </text>
85
+ )}
86
+ </RadialBarChart>
87
+ </ResponsiveContainer>
88
+ );
89
+ };
90
+
91
+ export const ActivityGaugeSm = ({ title = "1,000", subtitle = "Active users", data = radialData }: ActivityGaugeProps) => {
92
+ return (
93
+ <ResponsiveContainer height={268}>
94
+ <RadialBarChart
95
+ data={data}
96
+ accessibilityLayer
97
+ innerRadius={61}
98
+ outerRadius={110}
99
+ // This is needed to start the chart at the top and go clockwise
100
+ startAngle={90}
101
+ endAngle={360 + 90}
102
+ className="font-medium text-tertiary [&_.recharts-polar-grid]:text-utility-gray-100 [&_.recharts-text]:text-sm"
103
+ margin={{
104
+ left: 0,
105
+ right: 0,
106
+ top: 0,
107
+ bottom: 0,
108
+ }}
109
+ >
110
+ <PolarAngleAxis tick={false} domain={[0, 1000]} type="number" reversed />
111
+
112
+ <Legend verticalAlign="bottom" align="center" layout="horizontal" content={<ChartLegendContent />} />
113
+
114
+ <Tooltip content={<ChartTooltipContent isRadialChart />} />
115
+
116
+ <RadialBar
117
+ isAnimationActive={false}
118
+ dataKey="value"
119
+ cornerRadius={99}
120
+ fill="currentColor"
121
+ background={{
122
+ className: "fill-utility-gray-100",
123
+ }}
124
+ />
125
+
126
+ {(title || subtitle) && (
127
+ <text x="50%" y="50%" textAnchor="middle" dominantBaseline="middle">
128
+ {subtitle && (
129
+ <tspan x="50%" dy={title ? "-1.35em" : "1%"} className={cx("fill-current text-tertiary", "text-xs font-medium")}>
130
+ {subtitle}
131
+ </tspan>
132
+ )}
133
+ {title && (
134
+ <tspan x="50%" dy={subtitle ? "1.15em" : "1%"} className={cx("fill-current text-primary", "text-display-xs font-semibold")}>
135
+ {title}
136
+ </tspan>
137
+ )}
138
+ </text>
139
+ )}
140
+ </RadialBarChart>
141
+ </ResponsiveContainer>
142
+ );
143
+ };
144
+
145
+ export const ActivityGaugeMd = ({ title = "1,000", subtitle = "Active users", data = radialData }: ActivityGaugeProps) => {
146
+ return (
147
+ <ResponsiveContainer height={312}>
148
+ <RadialBarChart
149
+ data={data}
150
+ accessibilityLayer
151
+ innerRadius={74}
152
+ outerRadius={132}
153
+ // This is needed to start the chart at the top and go clockwise
154
+ startAngle={90}
155
+ endAngle={360 + 90}
156
+ className="font-medium text-tertiary [&_.recharts-polar-grid]:text-utility-gray-100 [&_.recharts-text]:text-sm"
157
+ margin={{
158
+ left: 0,
159
+ right: 0,
160
+ top: 0,
161
+ bottom: 0,
162
+ }}
163
+ >
164
+ <PolarAngleAxis tick={false} domain={[0, 1000]} type="number" reversed />
165
+
166
+ <Legend verticalAlign="bottom" align="center" layout="horizontal" content={<ChartLegendContent />} />
167
+
168
+ <Tooltip content={<ChartTooltipContent isRadialChart />} />
169
+
170
+ <RadialBar
171
+ isAnimationActive={false}
172
+ dataKey="value"
173
+ cornerRadius={99}
174
+ fill="currentColor"
175
+ background={{
176
+ className: "fill-utility-gray-100",
177
+ }}
178
+ />
179
+
180
+ {(title || subtitle) && (
181
+ <text x="50%" y="50%" textAnchor="middle" dominantBaseline="middle">
182
+ {subtitle && (
183
+ <tspan x="50%" dy={title ? "-1.45em" : "1%"} className={cx("fill-current text-tertiary", "text-sm font-medium")}>
184
+ {subtitle}
185
+ </tspan>
186
+ )}
187
+ {title && (
188
+ <tspan x="50%" dy={subtitle ? "1.075em" : "1%"} className={cx("fill-current text-primary", "text-display-sm font-semibold")}>
189
+ {title}
190
+ </tspan>
191
+ )}
192
+ </text>
193
+ )}
194
+ </RadialBarChart>
195
+ </ResponsiveContainer>
196
+ );
197
+ };
198
+
199
+ export const ActivityGaugeLg = ({ title = "1,000", subtitle = "Active users", data = radialData }: ActivityGaugeProps) => {
200
+ return (
201
+ <ResponsiveContainer height={356}>
202
+ <RadialBarChart
203
+ data={data}
204
+ accessibilityLayer
205
+ innerRadius={84}
206
+ outerRadius={154}
207
+ // This is needed to start the chart at the top and go clockwise
208
+ startAngle={90}
209
+ endAngle={360 + 90}
210
+ className="font-medium text-tertiary [&_.recharts-polar-grid]:text-utility-gray-100 [&_.recharts-text]:text-sm"
211
+ margin={{
212
+ left: 0,
213
+ right: 0,
214
+ top: 0,
215
+ bottom: 0,
216
+ }}
217
+ >
218
+ <PolarAngleAxis tick={false} domain={[0, 1000]} type="number" reversed />
219
+
220
+ <Legend verticalAlign="bottom" align="center" layout="horizontal" content={<ChartLegendContent />} />
221
+
222
+ <Tooltip content={<ChartTooltipContent isRadialChart />} />
223
+
224
+ <RadialBar
225
+ isAnimationActive={false}
226
+ dataKey="value"
227
+ cornerRadius={99}
228
+ fill="currentColor"
229
+ background={{
230
+ className: "fill-utility-gray-100",
231
+ }}
232
+ />
233
+
234
+ {(title || subtitle) && (
235
+ <text x="50%" y="50%" textAnchor="middle" dominantBaseline="middle">
236
+ {subtitle && (
237
+ <tspan x="50%" dy={title ? "-1.4em" : "1%"} className={cx("fill-current text-tertiary", "text-sm font-medium")}>
238
+ {subtitle}
239
+ </tspan>
240
+ )}
241
+ {title && (
242
+ <tspan x="50%" dy={subtitle ? "1em" : "1%"} className={cx("fill-current text-primary", "text-display-md font-semibold")}>
243
+ {title}
244
+ </tspan>
245
+ )}
246
+ </text>
247
+ )}
248
+ </RadialBarChart>
249
+ </ResponsiveContainer>
250
+ );
251
+ };
@@ -0,0 +1,27 @@
1
+ import type { FC } from "react";
2
+ import * as Charts from "./activity-gauges.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 ActivityGaugeXs = () => <Charts.ActivityGaugeXs />;
18
+ ActivityGaugeXs.storyName = "Activity gauge xs";
19
+
20
+ export const ActivityGaugeSm = () => <Charts.ActivityGaugeSm />;
21
+ ActivityGaugeSm.storyName = "Activity gauge sm";
22
+
23
+ export const ActivityGaugeMd = () => <Charts.ActivityGaugeMd />;
24
+ ActivityGaugeMd.storyName = "Activity gauge md";
25
+
26
+ export const ActivityGaugeLg = () => <Charts.ActivityGaugeLg />;
27
+ ActivityGaugeLg.storyName = "Activity gauge lg";