@sybilion/uilib 1.2.24 → 1.3.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.
Files changed (136) hide show
  1. package/dist/esm/components/ui/Chart/Chart.js +1 -0
  2. package/dist/esm/components/ui/Chart/components/BaseChartWrapper.js +7 -32
  3. package/dist/esm/components/ui/Chart/components/ChartEmptyState/ChartEmptyState.js +21 -0
  4. package/dist/esm/components/ui/Chart/components/ChartEmptyState/ChartEmptyState.styl.js +7 -0
  5. package/dist/esm/components/ui/Chart/tools/chartPlotGeometry.js +65 -0
  6. package/dist/esm/components/ui/ChartAreaInteractive/ChartAreaInteractive.helpers.js +37 -1
  7. package/dist/esm/components/ui/ChartAreaInteractive/ChartAreaInteractive.js +5 -2
  8. package/dist/esm/components/ui/ChartAreaInteractive/TimeRangeBrushLayer.js +205 -0
  9. package/dist/esm/components/ui/ChartAreaInteractive/TimeRangeBrushLayer.styl.js +7 -0
  10. package/dist/esm/components/ui/ChartAreaInteractive/TimeRangeBrushLayout.helpers.js +37 -0
  11. package/dist/esm/components/ui/ChartAreaInteractive/overlays/IntervalsOverlay/IntervalsOverlay.hooks.js +1 -0
  12. package/dist/esm/components/ui/ChartAreaInteractive/overlays/PinOverlay/PinOverlay.js +7 -60
  13. package/dist/esm/components/ui/ChartAreaInteractive/overlays/PinOverlay/PinOverlay.styl.js +2 -2
  14. package/dist/esm/components/ui/ChartAreaInteractive/overlays/ThresholdsOverlay/ThresholdsOverlay.hooks.js +1 -0
  15. package/dist/esm/components/ui/ChartAreaInteractive/overlays/useChartYRange.js +2 -4
  16. package/dist/esm/components/ui/Chat/ChatSheet/ChatSelector.js +1 -1
  17. package/dist/esm/components/ui/Chat/ChatSheet/ChatSelector.styl.js +1 -1
  18. package/dist/esm/components/ui/DropdownMenu/DropdownMenu.js +4 -4
  19. package/dist/esm/components/ui/TimeRangeControls/TimeRangeControls.js +7 -2
  20. package/dist/esm/components/ui/WorldMap/WorldMap.js +11 -0
  21. package/dist/esm/components/ui/WorldMap/WorldMap.styl.js +7 -0
  22. package/dist/esm/components/ui/WorldMap/map.svg.js +3 -0
  23. package/dist/esm/components/widgets/DriverCard/DriverCard.js +89 -0
  24. package/dist/esm/components/widgets/DriverCard/DriverCard.styl.js +7 -0
  25. package/dist/esm/components/widgets/DriverCard/DriverPerformanceChart.js +79 -0
  26. package/dist/esm/components/widgets/DriverCard/DriverPerformanceChart.styl.js +7 -0
  27. package/dist/esm/components/widgets/DriverCard/driverPerformanceChartData.js +50 -0
  28. package/dist/esm/components/widgets/DriverMap/DriverIcon/DriverIcon.constants.json.js +6 -0
  29. package/dist/esm/components/widgets/DriverMap/DriverIcon/DriverIcon.js +21 -0
  30. package/dist/esm/components/widgets/DriverMap/DriverIcon/DriverIcon.styl.js +7 -0
  31. package/dist/esm/components/widgets/DriverMap/DriverMap.helpers.js +107 -0
  32. package/dist/esm/components/widgets/DriverMap/DriverMap.js +129 -0
  33. package/dist/esm/components/widgets/DriverMap/DriverMap.styl.js +7 -0
  34. package/dist/esm/components/widgets/DriverMap/driverCategoryIcon.js +194 -0
  35. package/dist/esm/components/widgets/DriverMap/driverMapGeography.js +345 -0
  36. package/dist/esm/components/widgets/DriverMap/driverMapSelection.js +17 -0
  37. package/dist/esm/hooks/index.js +1 -0
  38. package/dist/esm/hooks/useEvent.js +0 -2
  39. package/dist/esm/index.js +7 -0
  40. package/dist/esm/types/src/components/ui/Chart/Chart.d.ts +1 -0
  41. package/dist/esm/types/src/components/ui/Chart/components/BaseChartWrapper.d.ts +2 -1
  42. package/dist/esm/types/src/components/ui/Chart/components/ChartEmptyState/ChartEmptyState.d.ts +14 -0
  43. package/dist/esm/types/src/components/ui/Chart/tools/chartPlotGeometry.d.ts +30 -0
  44. package/dist/esm/types/src/components/ui/ChartAreaInteractive/ChartAreaInteractive.d.ts +1 -1
  45. package/dist/esm/types/src/components/ui/ChartAreaInteractive/ChartAreaInteractive.helpers.d.ts +11 -2
  46. package/dist/esm/types/src/components/ui/ChartAreaInteractive/ChartAreaInteractive.types.d.ts +2 -2
  47. package/dist/esm/types/src/components/ui/ChartAreaInteractive/TimeRangeBrushLayer.d.ts +15 -0
  48. package/dist/esm/types/src/components/ui/ChartAreaInteractive/TimeRangeBrushLayout.helpers.d.ts +14 -0
  49. package/dist/esm/types/src/components/ui/ChartAreaInteractive/overlays/PinOverlay/PinOverlay.d.ts +1 -1
  50. package/dist/esm/types/src/components/ui/DropdownMenu/DropdownMenu.d.ts +2 -2
  51. package/dist/esm/types/src/components/ui/Page/PageColumns/PageColumns.d.ts +1 -1
  52. package/dist/esm/types/src/components/ui/TimeRangeControls/TimeRangeControls.d.ts +5 -7
  53. package/dist/esm/types/src/components/ui/WorldMap/WorldMap.d.ts +4 -0
  54. package/dist/esm/types/src/components/ui/WorldMap/index.d.ts +2 -0
  55. package/dist/esm/types/src/components/widgets/DriverCard/DriverCard.d.ts +9 -0
  56. package/dist/esm/types/src/components/widgets/DriverCard/DriverPerformanceChart.d.ts +5 -0
  57. package/dist/esm/types/src/components/widgets/DriverCard/driverPerformanceChartData.d.ts +7 -0
  58. package/dist/esm/types/src/components/widgets/DriverCard/index.d.ts +1 -0
  59. package/dist/esm/types/src/components/widgets/DriverMap/DriverIcon/DriverIcon.d.ts +17 -0
  60. package/dist/esm/types/src/components/widgets/DriverMap/DriverMap.d.ts +8 -0
  61. package/dist/esm/types/src/components/widgets/DriverMap/DriverMap.helpers.d.ts +21 -0
  62. package/dist/esm/types/src/components/widgets/DriverMap/driverCategoryIcon.d.ts +1 -0
  63. package/dist/esm/types/src/components/widgets/DriverMap/driverMapGeography.d.ts +80 -0
  64. package/dist/esm/types/src/components/widgets/DriverMap/driverMapSelection.d.ts +3 -0
  65. package/dist/esm/types/src/components/widgets/DriverMap/index.d.ts +6 -0
  66. package/dist/esm/types/src/docs/pages/DriverMapPage.d.ts +1 -0
  67. package/dist/esm/types/src/docs/pages/PageColumnsPage.d.ts +1 -0
  68. package/dist/esm/types/src/docs/pages/WorldMapPage.d.ts +1 -0
  69. package/dist/esm/types/src/docs/registry.d.ts +1 -1
  70. package/dist/esm/types/src/hooks/index.d.ts +1 -0
  71. package/dist/esm/types/src/index.d.ts +3 -0
  72. package/package.json +1 -1
  73. package/src/components/ui/Chart/Chart.tsx +5 -0
  74. package/src/components/ui/Chart/components/BaseChartWrapper.tsx +8 -41
  75. package/src/components/ui/Chart/components/ChartEmptyState/ChartEmptyState.styl +60 -0
  76. package/src/components/ui/Chart/components/ChartEmptyState/ChartEmptyState.styl.d.ts +15 -0
  77. package/src/components/ui/Chart/components/ChartEmptyState/ChartEmptyState.tsx +66 -0
  78. package/src/components/ui/Chart/tools/chartPlotGeometry.ts +89 -0
  79. package/src/components/ui/ChartAreaInteractive/ChartAreaInteractive.helpers.ts +44 -2
  80. package/src/components/ui/ChartAreaInteractive/ChartAreaInteractive.tsx +14 -1
  81. package/src/components/ui/ChartAreaInteractive/ChartAreaInteractive.types.ts +2 -3
  82. package/src/components/ui/ChartAreaInteractive/TimeRangeBrushLayer.styl +21 -0
  83. package/src/components/ui/ChartAreaInteractive/TimeRangeBrushLayer.styl.d.ts +9 -0
  84. package/src/components/ui/ChartAreaInteractive/TimeRangeBrushLayer.tsx +285 -0
  85. package/src/components/ui/ChartAreaInteractive/TimeRangeBrushLayout.helpers.ts +55 -0
  86. package/src/components/ui/ChartAreaInteractive/overlays/IntervalsOverlay/IntervalsOverlay.hooks.ts +1 -0
  87. package/src/components/ui/ChartAreaInteractive/overlays/PinOverlay/PinOverlay.styl +2 -7
  88. package/src/components/ui/ChartAreaInteractive/overlays/PinOverlay/PinOverlay.styl.d.ts +0 -1
  89. package/src/components/ui/ChartAreaInteractive/overlays/PinOverlay/PinOverlay.tsx +7 -71
  90. package/src/components/ui/ChartAreaInteractive/overlays/ThresholdsOverlay/ThresholdsOverlay.hooks.ts +1 -0
  91. package/src/components/ui/ChartAreaInteractive/overlays/useChartYRange.ts +2 -3
  92. package/src/components/ui/Chat/ChatSheet/ChatSelector.styl +3 -1
  93. package/src/components/ui/Chat/ChatSheet/ChatSelector.tsx +1 -1
  94. package/src/components/ui/DropdownMenu/DropdownMenu.tsx +4 -0
  95. package/src/components/ui/Page/PageColumns/PageColumns.tsx +1 -1
  96. package/src/components/ui/TimeRangeControls/TimeRangeControls.tsx +16 -17
  97. package/src/components/ui/WorldMap/WorldMap.styl +11 -0
  98. package/src/components/ui/WorldMap/WorldMap.styl.d.ts +7 -0
  99. package/src/components/ui/WorldMap/WorldMap.tsx +22 -0
  100. package/src/components/ui/WorldMap/index.ts +2 -0
  101. package/src/components/ui/WorldMap/map.svg +4337 -0
  102. package/src/components/ui/WorldMap/mapAspect.mixin.styl +3 -0
  103. package/src/components/ui/WorldMap/mapAspect.mixin.styl.d.ts +2 -0
  104. package/src/components/widgets/DriverCard/DriverCard.styl +169 -0
  105. package/src/components/widgets/DriverCard/DriverCard.styl.d.ts +40 -0
  106. package/src/components/widgets/DriverCard/DriverCard.tsx +219 -0
  107. package/src/components/widgets/DriverCard/DriverPerformanceChart.styl +43 -0
  108. package/src/components/widgets/DriverCard/DriverPerformanceChart.styl.d.ts +13 -0
  109. package/src/components/widgets/DriverCard/DriverPerformanceChart.tsx +150 -0
  110. package/src/components/widgets/DriverCard/driverPerformanceChartData.ts +64 -0
  111. package/src/components/widgets/DriverCard/index.ts +1 -0
  112. package/src/components/widgets/DriverMap/DriverIcon/DriverIcon.constants.json +3 -0
  113. package/src/components/widgets/DriverMap/DriverIcon/DriverIcon.styl +125 -0
  114. package/src/components/widgets/DriverMap/DriverIcon/DriverIcon.styl.d.ts +22 -0
  115. package/src/components/widgets/DriverMap/DriverIcon/DriverIcon.tsx +79 -0
  116. package/src/components/widgets/DriverMap/DriverMap.helpers.ts +164 -0
  117. package/src/components/widgets/DriverMap/DriverMap.styl +50 -0
  118. package/src/components/widgets/DriverMap/DriverMap.styl.d.ts +12 -0
  119. package/src/components/widgets/DriverMap/DriverMap.tsx +212 -0
  120. package/src/components/widgets/DriverMap/driverCategoryIcon.tsx +277 -0
  121. package/src/components/widgets/DriverMap/driverMapGeography.ts +478 -0
  122. package/src/components/widgets/DriverMap/driverMapSelection.ts +23 -0
  123. package/src/components/widgets/DriverMap/index.ts +16 -0
  124. package/src/docs/config/webpack.config.js +25 -9
  125. package/src/docs/pages/ChartAreaInteractivePage.tsx +2 -3
  126. package/src/docs/pages/DriverMapPage.tsx +268 -0
  127. package/src/docs/pages/PageColumnsPage.tsx +92 -0
  128. package/src/docs/pages/TimeRangeControlsPage.tsx +2 -3
  129. package/src/docs/pages/TooltipPage.tsx +14 -10
  130. package/src/docs/pages/WorldMapPage.styl +14 -0
  131. package/src/docs/pages/WorldMapPage.styl.d.ts +8 -0
  132. package/src/docs/pages/WorldMapPage.tsx +26 -0
  133. package/src/docs/registry.ts +18 -5
  134. package/src/hooks/index.ts +1 -0
  135. package/src/hooks/useEvent.ts +0 -2
  136. package/src/index.ts +3 -0
@@ -0,0 +1,277 @@
1
+ import {
2
+ ChartBarIcon,
3
+ ChartLineIcon,
4
+ CurrencyDollarIcon,
5
+ DatabaseIcon,
6
+ FactoryIcon,
7
+ FlaskIcon,
8
+ ForkKnifeIcon,
9
+ GlobeIcon,
10
+ HardHatIcon,
11
+ HeartIcon,
12
+ HouseIcon,
13
+ IdentificationCardIcon,
14
+ LightningIcon,
15
+ ShoppingCartIcon,
16
+ TShirtIcon,
17
+ ThermometerIcon,
18
+ TreeIcon,
19
+ TruckIcon,
20
+ UsersIcon,
21
+ WalletIcon,
22
+ WrenchIcon,
23
+ } from '@phosphor-icons/react';
24
+
25
+ // Icon mapping based on category
26
+ export const getCategoryIcon = (category: string | undefined | null) => {
27
+ if (!category) {
28
+ return <ChartBarIcon className="h-full w-full" />;
29
+ }
30
+ const categoryLower = category.toLowerCase();
31
+
32
+ // Housing & Real Estate
33
+ if (
34
+ categoryLower.includes('housing') ||
35
+ categoryLower.includes('real estate') ||
36
+ categoryLower.includes('residential') ||
37
+ categoryLower.includes('property')
38
+ )
39
+ return <HouseIcon className="h-full w-full" />;
40
+
41
+ // Construction & Infrastructure
42
+ if (
43
+ categoryLower.includes('construction') ||
44
+ categoryLower.includes('infrastructure') ||
45
+ categoryLower.includes('building') ||
46
+ categoryLower.includes('development') ||
47
+ categoryLower.includes('engineering') ||
48
+ categoryLower.includes('contracting')
49
+ )
50
+ return <HardHatIcon className="h-full w-full" />;
51
+
52
+ // Climate & Environment
53
+ if (
54
+ categoryLower.includes('climate') ||
55
+ categoryLower.includes('weather') ||
56
+ categoryLower.includes('environment') ||
57
+ categoryLower.includes('temperature') ||
58
+ categoryLower.includes('global warming') ||
59
+ categoryLower.includes('pollution') ||
60
+ categoryLower.includes('sustainability') ||
61
+ categoryLower.includes('green')
62
+ )
63
+ return <ThermometerIcon className="h-full w-full" />;
64
+
65
+ // Supply Chain & Trade
66
+ if (
67
+ categoryLower.includes('supply') ||
68
+ categoryLower.includes('trade') ||
69
+ categoryLower.includes('logistics') ||
70
+ categoryLower.includes('transport')
71
+ )
72
+ return <TruckIcon className="h-full w-full" />;
73
+
74
+ // Energy & Power
75
+ if (
76
+ categoryLower.includes('energy') ||
77
+ categoryLower.includes('power') ||
78
+ categoryLower.includes('electricity')
79
+ )
80
+ return <LightningIcon className="h-full w-full" />;
81
+
82
+ // Labor Market & Employment
83
+ if (
84
+ categoryLower.includes('labour') ||
85
+ categoryLower.includes('employment') ||
86
+ categoryLower.includes('jobs') ||
87
+ categoryLower.includes('hiring') ||
88
+ categoryLower.includes('unemployment') ||
89
+ categoryLower.includes('wages') ||
90
+ categoryLower.includes('salary') ||
91
+ categoryLower.includes('job market') ||
92
+ categoryLower.includes('workforce')
93
+ )
94
+ return <IdentificationCardIcon className="h-full w-full" />;
95
+
96
+ // Workforce & Human Resources
97
+ if (
98
+ categoryLower.includes('workforce') ||
99
+ categoryLower.includes('hr') ||
100
+ categoryLower.includes('human resources') ||
101
+ categoryLower.includes('personnel') ||
102
+ categoryLower.includes('staffing') ||
103
+ categoryLower.includes('talent') ||
104
+ categoryLower.includes('recruitment')
105
+ )
106
+ return <UsersIcon className="h-full w-full" />;
107
+
108
+ // Manufacturing & Production
109
+ if (
110
+ categoryLower.includes('volume') ||
111
+ categoryLower.includes('production') ||
112
+ categoryLower.includes('manufacturing') ||
113
+ categoryLower.includes('industry')
114
+ )
115
+ return <FactoryIcon className="h-full w-full" />;
116
+
117
+ // Finance & Economics
118
+ if (
119
+ categoryLower.includes('price') ||
120
+ categoryLower.includes('inflation') ||
121
+ categoryLower.includes('finance') ||
122
+ categoryLower.includes('economy') ||
123
+ categoryLower.includes('gdp')
124
+ )
125
+ return <CurrencyDollarIcon className="h-full w-full" />;
126
+
127
+ // Data & Analytics
128
+ if (
129
+ categoryLower.includes('data') ||
130
+ categoryLower.includes('analytics') ||
131
+ categoryLower.includes('statistics')
132
+ )
133
+ return <DatabaseIcon className="h-full w-full" />;
134
+
135
+ // Global & International
136
+ if (
137
+ categoryLower.includes('global') ||
138
+ categoryLower.includes('international') ||
139
+ categoryLower.includes('world')
140
+ )
141
+ return <GlobeIcon className="h-full w-full" />;
142
+
143
+ // Chemicals & Pharmaceuticals
144
+ if (
145
+ categoryLower.includes('chemical') ||
146
+ categoryLower.includes('pharmaceutical') ||
147
+ categoryLower.includes('medicine') ||
148
+ categoryLower.includes('drug') ||
149
+ categoryLower.includes('compound')
150
+ )
151
+ return <FlaskIcon className="h-full w-full" />;
152
+
153
+ // Food & Agriculture
154
+ if (
155
+ categoryLower.includes('food') ||
156
+ categoryLower.includes('processed') ||
157
+ categoryLower.includes('agriculture') ||
158
+ categoryLower.includes('farming') ||
159
+ categoryLower.includes('crop') ||
160
+ categoryLower.includes('grain') ||
161
+ categoryLower.includes('dairy') ||
162
+ categoryLower.includes('meat')
163
+ )
164
+ return <ForkKnifeIcon className="h-full w-full" />;
165
+
166
+ // Income & Wealth
167
+ if (
168
+ categoryLower.includes('income') ||
169
+ categoryLower.includes('wealth') ||
170
+ categoryLower.includes('salary') ||
171
+ categoryLower.includes('wage') ||
172
+ categoryLower.includes('earnings') ||
173
+ categoryLower.includes('revenue')
174
+ )
175
+ return <WalletIcon className="h-full w-full" />;
176
+
177
+ // Consumption & Retail
178
+ if (
179
+ categoryLower.includes('consumption') ||
180
+ categoryLower.includes('retail') ||
181
+ categoryLower.includes('shopping') ||
182
+ categoryLower.includes('spending') ||
183
+ categoryLower.includes('purchases') ||
184
+ categoryLower.includes('demand')
185
+ )
186
+ return <ShoppingCartIcon className="h-full w-full" />;
187
+
188
+ // Living Conditions & Quality of Life
189
+ if (
190
+ categoryLower.includes('living') ||
191
+ categoryLower.includes('quality') ||
192
+ categoryLower.includes('wellbeing') ||
193
+ categoryLower.includes('health') ||
194
+ categoryLower.includes('social') ||
195
+ categoryLower.includes('welfare') ||
196
+ categoryLower.includes('happiness')
197
+ )
198
+ return <HeartIcon className="h-full w-full" />;
199
+
200
+ // Minerals & Mining
201
+ if (
202
+ categoryLower.includes('mineral') ||
203
+ categoryLower.includes('mining') ||
204
+ categoryLower.includes('ore') ||
205
+ categoryLower.includes('metal') ||
206
+ categoryLower.includes('coal') ||
207
+ categoryLower.includes('gold') ||
208
+ categoryLower.includes('copper') ||
209
+ categoryLower.includes('iron') ||
210
+ categoryLower.includes('aluminum') ||
211
+ categoryLower.includes('lithium')
212
+ )
213
+ return <TreeIcon className="h-full w-full" />;
214
+
215
+ // Textiles & Fibers
216
+ if (
217
+ categoryLower.includes('textile') ||
218
+ categoryLower.includes('fiber') ||
219
+ categoryLower.includes('fabric') ||
220
+ categoryLower.includes('cloth') ||
221
+ categoryLower.includes('cotton') ||
222
+ categoryLower.includes('wool') ||
223
+ categoryLower.includes('silk') ||
224
+ categoryLower.includes('synthetic') ||
225
+ categoryLower.includes('garment') ||
226
+ categoryLower.includes('apparel')
227
+ )
228
+ return <TShirtIcon className="h-full w-full" />;
229
+
230
+ // Crafts & Artisan
231
+ if (
232
+ categoryLower.includes('craft') ||
233
+ categoryLower.includes('artisan') ||
234
+ categoryLower.includes('handmade') ||
235
+ categoryLower.includes('artistic') ||
236
+ categoryLower.includes('creative') ||
237
+ categoryLower.includes('design') ||
238
+ categoryLower.includes('pottery') ||
239
+ categoryLower.includes('woodwork') ||
240
+ categoryLower.includes('jewelry')
241
+ )
242
+ return <WrenchIcon className="h-full w-full" />;
243
+
244
+ // Population & Demographics
245
+ if (
246
+ categoryLower.includes('population') ||
247
+ categoryLower.includes('demographic') ||
248
+ categoryLower.includes('census') ||
249
+ categoryLower.includes('birth') ||
250
+ categoryLower.includes('death') ||
251
+ categoryLower.includes('migration') ||
252
+ categoryLower.includes('immigration') ||
253
+ categoryLower.includes('age') ||
254
+ categoryLower.includes('gender') ||
255
+ categoryLower.includes('ethnicity')
256
+ )
257
+ return <UsersIcon className="h-full w-full" />;
258
+
259
+ // Market Indices & Trading
260
+ if (
261
+ categoryLower.includes('market') ||
262
+ categoryLower.includes('index') ||
263
+ categoryLower.includes('indices') ||
264
+ categoryLower.includes('trading') ||
265
+ categoryLower.includes('stock') ||
266
+ categoryLower.includes('equity') ||
267
+ categoryLower.includes('s&p') ||
268
+ categoryLower.includes('nasdaq') ||
269
+ categoryLower.includes('dow') ||
270
+ categoryLower.includes('ftse') ||
271
+ categoryLower.includes('candlestick')
272
+ )
273
+ return <ChartLineIcon className="h-full w-full" />;
274
+
275
+ // Default fallback
276
+ return <ChartBarIcon className="h-full w-full" />;
277
+ };