@xenide-io/the-old-ui-theme 0.2.9 → 0.3.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/README.md +1 -1
- package/dist/chunk-5HSOBJ4F.mjs +5968 -0
- package/dist/index-BgG8Homu.d.mts +1461 -0
- package/dist/index-BgG8Homu.d.ts +1461 -0
- package/dist/index.d.mts +206 -100
- package/dist/index.d.ts +206 -100
- package/dist/index.js +4275 -1455
- package/dist/index.mjs +689 -735
- package/dist/tailwind-preset.js +7 -0
- package/dist/tailwind-preset.mjs +7 -0
- package/dist/ui.d.mts +3 -2
- package/dist/ui.d.ts +3 -2
- package/dist/ui.js +3449 -701
- package/dist/ui.mjs +106 -3
- package/package.json +20 -16
- package/src/app/globals.css +1953 -266
- package/src/components/charts/index.ts +9 -8
- package/src/components/charts/quill/BarChart.tsx +85 -0
- package/src/components/charts/quill/FunnelChart.tsx +49 -0
- package/src/components/charts/quill/InsightShell.tsx +27 -0
- package/src/components/charts/quill/MetricCard.tsx +44 -0
- package/src/components/charts/quill/PieChart.tsx +81 -0
- package/src/components/charts/quill/Sparkline.tsx +57 -0
- package/src/components/charts/quill/TimeSeriesLineChart.tsx +62 -0
- package/src/components/charts/quill/index.ts +9 -0
- package/src/components/icons/IconBase.tsx +20 -12
- package/src/components/icons/createIconBase.tsx +12 -7
- package/src/components/icons/icons.tsx +210 -18
- package/src/components/icons/index.ts +3 -0
- package/src/components/icons/lemon-brand-icons.tsx +16 -0
- package/src/components/icons/lemon-category-icons.tsx +72 -0
- package/src/components/icons/lemon-icons.tsx +57 -0
- package/src/components/sections/AlertShowcase.tsx +2 -1
- package/src/components/sections/BadgeShowcase.tsx +1 -1
- package/src/components/sections/ButtonShowcase.tsx +6 -10
- package/src/components/sections/CardShowcase.tsx +22 -6
- package/src/components/sections/DropdownShowcase.tsx +4 -6
- package/src/components/sections/FilterChipsShowcase.tsx +74 -26
- package/src/components/sections/FormShowcase.tsx +2 -1
- package/src/components/sections/IconShowcase.tsx +195 -212
- package/src/components/sections/KbdShowcase.tsx +47 -21
- package/src/components/sections/ModalShowcase.tsx +7 -6
- package/src/components/sections/NewComponentsShowcase.tsx +1052 -0
- package/src/components/sections/ProductLayoutsShowcase.tsx +78 -0
- package/src/components/sections/ProgressShowcase.tsx +50 -53
- package/src/components/sections/QuillChartShowcase.tsx +92 -0
- package/src/components/sections/QuillDashboardShowcase.tsx +149 -0
- package/src/components/sections/SidebarShowcase.tsx +151 -0
- package/src/components/sections/SwapShowcase.tsx +13 -5
- package/src/components/sections/TableShowcase.tsx +2 -0
- package/src/components/sections/TooltipShowcase.tsx +19 -25
- package/src/components/ui/Alert.tsx +28 -19
- package/src/components/ui/AlertDialog.tsx +62 -0
- package/src/components/ui/AppLayout.tsx +27 -0
- package/src/components/ui/AuthLayout.tsx +58 -0
- package/src/components/ui/Autocomplete.tsx +106 -0
- package/src/components/ui/Badge.tsx +10 -5
- package/src/components/ui/Banner.tsx +63 -0
- package/src/components/ui/Button.tsx +22 -12
- package/src/components/ui/ButtonChrome.tsx +1 -1
- package/src/components/ui/ButtonGroup.tsx +16 -0
- package/src/components/ui/Calendar.tsx +6 -7
- package/src/components/ui/Card.tsx +21 -11
- package/src/components/ui/Chip.tsx +46 -0
- package/src/components/ui/Collapsible.tsx +46 -0
- package/src/components/ui/CollapsibleSection.tsx +11 -11
- package/src/components/ui/Combobox.tsx +119 -0
- package/src/components/ui/ContextMenu.tsx +81 -0
- package/src/components/ui/DataTable.tsx +133 -0
- package/src/components/ui/DatePicker.tsx +96 -0
- package/src/components/ui/Dialog.tsx +75 -0
- package/src/components/ui/Divider.tsx +39 -0
- package/src/components/ui/Dot.tsx +32 -0
- package/src/components/ui/DropdownMenu.tsx +189 -65
- package/src/components/ui/FilterBar.tsx +165 -0
- package/src/components/ui/FilterChips.tsx +65 -35
- package/src/components/ui/FilterControls.tsx +30 -0
- package/src/components/ui/FormField.tsx +69 -0
- package/src/components/ui/Input.tsx +166 -140
- package/src/components/ui/InputGroup.tsx +16 -0
- package/src/components/ui/Kbd.tsx +88 -13
- package/src/components/ui/Lettermark.tsx +47 -0
- package/src/components/ui/Link.tsx +32 -0
- package/src/components/ui/Loader.tsx +96 -0
- package/src/components/ui/LoadingBar.tsx +25 -0
- package/src/components/ui/Menubar.tsx +66 -0
- package/src/components/ui/Metric.tsx +34 -0
- package/src/components/ui/Modal.tsx +66 -36
- package/src/components/ui/NumberField.tsx +76 -0
- package/src/components/ui/Popover.tsx +73 -0
- package/src/components/ui/ProgressCircle.tsx +63 -0
- package/src/components/ui/Resizable.tsx +71 -0
- package/src/components/ui/Row.tsx +51 -0
- package/src/components/ui/ScrollArea.tsx +54 -0
- package/src/components/ui/SettingsLayout.tsx +94 -0
- package/src/components/ui/ShowcaseWrapper.tsx +4 -16
- package/src/components/ui/Sidebar.tsx +77 -0
- package/src/components/ui/Snack.tsx +48 -0
- package/src/components/ui/Spinner.tsx +30 -0
- package/src/components/ui/Splotch.tsx +33 -0
- package/src/components/ui/Stepper.tsx +5 -6
- package/src/components/ui/Table.tsx +2 -0
- package/src/components/ui/Tag.tsx +65 -0
- package/src/components/ui/Toggle.tsx +62 -0
- package/src/components/ui/Tooltip.test.tsx +58 -0
- package/src/components/ui/Tooltip.tsx +211 -0
- package/src/components/ui/Widget.tsx +31 -0
- package/src/components/ui/first-slice.test.tsx +98 -0
- package/src/components/ui/index.ts +335 -22
- package/src/components/ui/interaction-primitives.test.tsx +77 -0
- package/src/components/ui/kbd-icons.test.tsx +90 -0
- package/src/components/ui/product-patterns.test.tsx +77 -0
- package/src/styles/themes.css +411 -1
- package/tailwind-preset.ts +7 -0
- package/dist/chunk-SHF57J7U.mjs +0 -2910
- package/dist/index-CmS6hcUk.d.mts +0 -753
- package/dist/index-CmS6hcUk.d.ts +0 -753
- package/src/components/charts/ph-insight-charts.tsx +0 -162
- package/src/components/dashboard/DashboardFiltersBar.tsx +0 -19
- package/src/components/dashboard/DashboardGrid.tsx +0 -23
- package/src/components/dashboard/DashboardInsightPlaceholder.tsx +0 -37
- package/src/components/dashboard/DashboardKpiCard.tsx +0 -25
- package/src/components/dashboard/DashboardToolbar.tsx +0 -23
- package/src/components/dashboard/DashboardWell.tsx +0 -10
- package/src/components/dashboard/InsightMiniCard.tsx +0 -26
- package/src/components/dashboard/InsightShell.tsx +0 -37
- package/src/components/dashboard/InsightShellHeader.tsx +0 -22
- package/src/components/dashboard/MiniTrendBars.tsx +0 -51
- package/src/components/dashboard/index.ts +0 -31
- package/src/components/dashboard/types.ts +0 -9
- package/src/components/sections/ChartShowcase.tsx +0 -190
- package/src/components/sections/DashboardShowcase.tsx +0 -191
- package/src/components/sections/StatShowcase.tsx +0 -129
package/dist/index.mjs
CHANGED
|
@@ -1,124 +1,317 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import {
|
|
2
3
|
Accordion,
|
|
3
4
|
Alert,
|
|
5
|
+
AlertDialog,
|
|
6
|
+
AppLayout,
|
|
7
|
+
AuthCard,
|
|
8
|
+
AuthDivider,
|
|
9
|
+
AuthLayout,
|
|
10
|
+
Autocomplete,
|
|
4
11
|
Avatar,
|
|
5
12
|
AvatarGroup,
|
|
6
13
|
Badge,
|
|
14
|
+
Banner,
|
|
7
15
|
Breadcrumbs,
|
|
8
16
|
Button,
|
|
9
17
|
ButtonChrome,
|
|
18
|
+
ButtonGroup,
|
|
19
|
+
CANONICAL_ICONS,
|
|
10
20
|
Calendar,
|
|
11
21
|
Caption,
|
|
12
22
|
Card,
|
|
13
23
|
ChatBubble,
|
|
14
24
|
Checkbox,
|
|
25
|
+
Chip,
|
|
15
26
|
CodeBlock,
|
|
27
|
+
Collapsible,
|
|
16
28
|
CollapsibleSection,
|
|
29
|
+
Combobox,
|
|
17
30
|
CommandPalette,
|
|
18
31
|
ComponentDocs,
|
|
32
|
+
ContextMenu,
|
|
19
33
|
DEFAULT_THEME_ID,
|
|
34
|
+
DataTable,
|
|
35
|
+
DatePicker,
|
|
36
|
+
Dialog,
|
|
20
37
|
Display,
|
|
38
|
+
Divider,
|
|
39
|
+
Dot,
|
|
21
40
|
Drawer,
|
|
22
41
|
DropdownButton,
|
|
23
42
|
DropdownItem,
|
|
24
43
|
DropdownMenu,
|
|
44
|
+
DropdownRadioGroup,
|
|
45
|
+
DropdownRadioItem,
|
|
25
46
|
EmptyState,
|
|
26
47
|
FileUpload,
|
|
48
|
+
FilterBar,
|
|
27
49
|
FilterChips,
|
|
50
|
+
FilterControls,
|
|
51
|
+
FilterMenu,
|
|
52
|
+
FormField,
|
|
28
53
|
H1,
|
|
29
54
|
H2,
|
|
30
55
|
H3,
|
|
31
56
|
H4,
|
|
32
57
|
H5,
|
|
33
58
|
HoverCard,
|
|
59
|
+
Icon123,
|
|
60
|
+
IconAI,
|
|
61
|
+
IconAction,
|
|
34
62
|
IconActivity,
|
|
63
|
+
IconAdsClick,
|
|
64
|
+
IconAndroidOS,
|
|
65
|
+
IconAppleIOS,
|
|
66
|
+
IconArchive,
|
|
35
67
|
IconAreaChart,
|
|
36
68
|
IconArrowDown,
|
|
37
69
|
IconArrowUp,
|
|
70
|
+
IconAtSign,
|
|
71
|
+
IconBadge,
|
|
38
72
|
IconBase,
|
|
39
73
|
IconBell,
|
|
40
74
|
IconBellOff,
|
|
75
|
+
IconBinary,
|
|
76
|
+
IconBlank,
|
|
77
|
+
IconBold,
|
|
41
78
|
IconBolt,
|
|
79
|
+
IconBook,
|
|
80
|
+
IconBookmarkBorder,
|
|
42
81
|
IconBox,
|
|
82
|
+
IconBranch,
|
|
83
|
+
IconBug,
|
|
43
84
|
IconByName,
|
|
85
|
+
IconCalculate,
|
|
86
|
+
IconCalendar,
|
|
87
|
+
IconCalendarDay,
|
|
44
88
|
IconCancel,
|
|
89
|
+
IconCart,
|
|
90
|
+
IconChat,
|
|
45
91
|
IconCheck,
|
|
46
92
|
IconCheckCircle,
|
|
93
|
+
IconCheckboxChecked,
|
|
47
94
|
IconChevronDown,
|
|
48
95
|
IconChevronLeft,
|
|
49
96
|
IconChevronRight,
|
|
97
|
+
IconChrome,
|
|
50
98
|
IconClipboardEdit,
|
|
99
|
+
IconClock,
|
|
51
100
|
IconClose,
|
|
101
|
+
IconCloud,
|
|
102
|
+
IconCodePreview,
|
|
103
|
+
IconCoffee,
|
|
52
104
|
IconCohort,
|
|
105
|
+
IconCommandCursor,
|
|
106
|
+
IconConfetti,
|
|
53
107
|
IconCopy,
|
|
108
|
+
IconCrown,
|
|
54
109
|
IconCumulativeChart,
|
|
110
|
+
IconDataReel,
|
|
55
111
|
IconDatabase,
|
|
112
|
+
IconDevices,
|
|
113
|
+
IconDocument,
|
|
56
114
|
IconDownload,
|
|
115
|
+
IconDownloadCloud,
|
|
116
|
+
IconDragHandle,
|
|
57
117
|
IconEdit,
|
|
58
118
|
IconErrorOutline,
|
|
119
|
+
IconEvent,
|
|
120
|
+
IconEventStream,
|
|
59
121
|
IconExclamation,
|
|
122
|
+
IconExperimentSplit,
|
|
123
|
+
IconExternalLink,
|
|
124
|
+
IconEye,
|
|
125
|
+
IconEyeHidden,
|
|
126
|
+
IconFacebook,
|
|
127
|
+
IconFeatureGate,
|
|
128
|
+
IconFeedback,
|
|
129
|
+
IconFile,
|
|
130
|
+
IconFilter,
|
|
131
|
+
IconFingerprint,
|
|
132
|
+
IconFirefox,
|
|
60
133
|
IconFlag,
|
|
61
134
|
IconFlare,
|
|
62
135
|
IconFlask,
|
|
136
|
+
IconFolder,
|
|
137
|
+
IconForward,
|
|
138
|
+
IconFullScreen,
|
|
139
|
+
IconFunnelHorizontal,
|
|
140
|
+
IconFunnelVertical,
|
|
141
|
+
IconGear,
|
|
142
|
+
IconGhost,
|
|
63
143
|
IconGift,
|
|
144
|
+
IconGitlab,
|
|
145
|
+
IconGlobe,
|
|
146
|
+
IconGoogle,
|
|
64
147
|
IconGridView,
|
|
148
|
+
IconGroupedEvents,
|
|
149
|
+
IconGroups,
|
|
65
150
|
IconHandClick,
|
|
151
|
+
IconHash,
|
|
152
|
+
IconHeadphones,
|
|
153
|
+
IconHeart,
|
|
154
|
+
IconHeatmap,
|
|
66
155
|
IconHome,
|
|
156
|
+
IconHomeFilled,
|
|
157
|
+
IconHourglass,
|
|
158
|
+
IconImage,
|
|
159
|
+
IconInbox,
|
|
160
|
+
IconInfo,
|
|
161
|
+
IconInfoFilled,
|
|
162
|
+
IconInsightBoard,
|
|
163
|
+
IconItalic,
|
|
164
|
+
IconKey,
|
|
165
|
+
IconKeyFilled,
|
|
166
|
+
IconLaptop,
|
|
67
167
|
IconLayers,
|
|
168
|
+
IconLayout,
|
|
169
|
+
IconLifeBuoy,
|
|
170
|
+
IconLightBulb,
|
|
171
|
+
IconLink,
|
|
172
|
+
IconLinkBreak,
|
|
173
|
+
IconLinux,
|
|
68
174
|
IconListView,
|
|
175
|
+
IconLocation,
|
|
176
|
+
IconLock,
|
|
69
177
|
IconLogout,
|
|
178
|
+
IconMacOS,
|
|
70
179
|
IconMail,
|
|
180
|
+
IconMap,
|
|
181
|
+
IconMapPin,
|
|
182
|
+
IconMaximize,
|
|
183
|
+
IconMegaphone,
|
|
184
|
+
IconMenu,
|
|
185
|
+
IconMic,
|
|
186
|
+
IconMicrosoftTeams,
|
|
187
|
+
IconMinimize,
|
|
188
|
+
IconMinus,
|
|
189
|
+
IconMonitor,
|
|
71
190
|
IconMoon,
|
|
191
|
+
IconMoonFilled,
|
|
192
|
+
IconMoreHorizontal,
|
|
193
|
+
IconMoreVertical,
|
|
194
|
+
IconMusic,
|
|
195
|
+
IconNavigation,
|
|
196
|
+
IconNodeJS,
|
|
197
|
+
IconOffline,
|
|
198
|
+
IconOldWindow,
|
|
199
|
+
IconOpenInApp,
|
|
200
|
+
IconOpenInNew,
|
|
201
|
+
IconPalette,
|
|
72
202
|
IconPanelRight,
|
|
203
|
+
IconPaperclip,
|
|
204
|
+
IconPauseCircle,
|
|
205
|
+
IconPeople,
|
|
206
|
+
IconPercent,
|
|
73
207
|
IconPerson,
|
|
208
|
+
IconPhone,
|
|
209
|
+
IconPin,
|
|
74
210
|
IconPlayCircle,
|
|
75
211
|
IconPlus,
|
|
76
212
|
IconPremium,
|
|
213
|
+
IconPreview,
|
|
214
|
+
IconPrinter,
|
|
77
215
|
IconQueryEditor,
|
|
216
|
+
IconQueryStack,
|
|
217
|
+
IconQuestionAnswer,
|
|
78
218
|
IconRadar,
|
|
219
|
+
IconRadioButtonUnchecked,
|
|
79
220
|
IconRecording,
|
|
221
|
+
IconRedo,
|
|
222
|
+
IconRefresh,
|
|
223
|
+
IconReplay,
|
|
224
|
+
IconReplayFrame,
|
|
225
|
+
IconReply,
|
|
226
|
+
IconReport,
|
|
80
227
|
IconRobot,
|
|
81
228
|
IconRocket,
|
|
229
|
+
IconSafari,
|
|
82
230
|
IconSave,
|
|
83
231
|
IconSearch,
|
|
232
|
+
IconSelectAll,
|
|
84
233
|
IconSelectEvents,
|
|
85
234
|
IconShoppingCart,
|
|
235
|
+
IconSkipBackward,
|
|
236
|
+
IconSkipEnd,
|
|
237
|
+
IconSkipStart,
|
|
238
|
+
IconSlack,
|
|
239
|
+
IconSlackExternal,
|
|
86
240
|
IconSpinner,
|
|
241
|
+
IconStamphog,
|
|
87
242
|
IconStar,
|
|
243
|
+
IconStore,
|
|
88
244
|
IconSubArrowRight,
|
|
245
|
+
IconSubtitles,
|
|
246
|
+
IconSubtitlesOff,
|
|
89
247
|
IconSun,
|
|
248
|
+
IconSurveyCard,
|
|
90
249
|
IconSurveys,
|
|
250
|
+
IconSwapHoriz,
|
|
91
251
|
IconSync,
|
|
92
252
|
IconTableChart,
|
|
93
253
|
IconTerminal,
|
|
254
|
+
IconTextSize,
|
|
94
255
|
IconToggle,
|
|
95
256
|
IconTrash,
|
|
257
|
+
IconTrendingDown,
|
|
258
|
+
IconTrendingFlat,
|
|
259
|
+
IconTrendingFlatDown,
|
|
96
260
|
IconTuning,
|
|
261
|
+
IconUnverifiedEvent,
|
|
97
262
|
IconUpload,
|
|
263
|
+
IconVerifiedEvent,
|
|
264
|
+
IconVerticalAlignCenter,
|
|
98
265
|
IconVolume,
|
|
99
266
|
IconVolumeOff,
|
|
267
|
+
IconWeb,
|
|
268
|
+
IconWindows,
|
|
100
269
|
Indicator,
|
|
101
270
|
Input,
|
|
271
|
+
InputGroup,
|
|
102
272
|
Kbd,
|
|
103
273
|
Label,
|
|
104
274
|
Lead,
|
|
275
|
+
Lettermark,
|
|
276
|
+
Link,
|
|
277
|
+
Loader,
|
|
278
|
+
LoadingBar,
|
|
279
|
+
LoadingState,
|
|
280
|
+
Menubar,
|
|
281
|
+
Metric,
|
|
105
282
|
Modal,
|
|
106
283
|
Mono,
|
|
284
|
+
NumberField,
|
|
285
|
+
OLD_UI_ICONS,
|
|
107
286
|
Overline,
|
|
108
287
|
P,
|
|
109
288
|
PH_ICONS,
|
|
289
|
+
PH_ICON_ALIASES,
|
|
110
290
|
Pagination,
|
|
111
291
|
Panel,
|
|
292
|
+
Popover,
|
|
112
293
|
Progress,
|
|
294
|
+
ProgressCircle,
|
|
113
295
|
Radio,
|
|
114
296
|
Range,
|
|
115
297
|
Rating,
|
|
298
|
+
Resizable,
|
|
299
|
+
Row,
|
|
300
|
+
ScrollArea,
|
|
116
301
|
SearchGroup,
|
|
117
302
|
SearchInput,
|
|
118
303
|
SegmentedControl,
|
|
119
304
|
Select,
|
|
305
|
+
SettingsLayout,
|
|
306
|
+
SettingsNav,
|
|
120
307
|
ShowcaseWrapper,
|
|
308
|
+
Sidebar,
|
|
309
|
+
Skeleton,
|
|
121
310
|
Small,
|
|
311
|
+
Snack,
|
|
312
|
+
SortMenu,
|
|
313
|
+
Spinner,
|
|
314
|
+
Splotch,
|
|
122
315
|
Stat,
|
|
123
316
|
Stepper,
|
|
124
317
|
THEMES,
|
|
@@ -126,6 +319,7 @@ import {
|
|
|
126
319
|
THEME_INIT_SCRIPT,
|
|
127
320
|
Table,
|
|
128
321
|
Tabs,
|
|
322
|
+
Tag,
|
|
129
323
|
Terminal,
|
|
130
324
|
Textarea,
|
|
131
325
|
ThemeDomSync,
|
|
@@ -135,6 +329,11 @@ import {
|
|
|
135
329
|
Toast,
|
|
136
330
|
ToastStack,
|
|
137
331
|
Toggle,
|
|
332
|
+
ToggleButton,
|
|
333
|
+
ToggleGroup,
|
|
334
|
+
Tooltip,
|
|
335
|
+
TooltipProvider,
|
|
336
|
+
Widget,
|
|
138
337
|
cn,
|
|
139
338
|
createIconBase,
|
|
140
339
|
createIconBasePath,
|
|
@@ -142,467 +341,18 @@ import {
|
|
|
142
341
|
isThemeId,
|
|
143
342
|
persistTheme,
|
|
144
343
|
readStoredTheme
|
|
145
|
-
} from "./chunk-
|
|
344
|
+
} from "./chunk-5HSOBJ4F.mjs";
|
|
146
345
|
import {
|
|
147
|
-
__objRest,
|
|
148
346
|
__spreadProps,
|
|
149
347
|
__spreadValues
|
|
150
348
|
} from "./chunk-FWCSY2DS.mjs";
|
|
151
349
|
|
|
152
|
-
// src/components/charts/
|
|
153
|
-
import {
|
|
154
|
-
|
|
155
|
-
// src/lib/chart/register-chartjs.ts
|
|
156
|
-
import {
|
|
157
|
-
ArcElement,
|
|
158
|
-
BarController,
|
|
159
|
-
BarElement,
|
|
160
|
-
CategoryScale,
|
|
161
|
-
Chart as ChartJS,
|
|
162
|
-
DoughnutController,
|
|
163
|
-
Legend,
|
|
164
|
-
LinearScale,
|
|
165
|
-
PolarAreaController,
|
|
166
|
-
RadialLinearScale,
|
|
167
|
-
Title,
|
|
168
|
-
Tooltip
|
|
169
|
-
} from "chart.js";
|
|
170
|
-
function synchroniseChartJsFontFamily() {
|
|
171
|
-
if (typeof document === "undefined") {
|
|
172
|
-
return;
|
|
173
|
-
}
|
|
174
|
-
const family = window.getComputedStyle(document.body).fontFamily;
|
|
175
|
-
const trimmed = family == null ? void 0 : family.trim();
|
|
176
|
-
if (trimmed) {
|
|
177
|
-
ChartJS.defaults.font.family = trimmed;
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
ChartJS.register(
|
|
181
|
-
CategoryScale,
|
|
182
|
-
LinearScale,
|
|
183
|
-
RadialLinearScale,
|
|
184
|
-
BarController,
|
|
185
|
-
BarElement,
|
|
186
|
-
DoughnutController,
|
|
187
|
-
PolarAreaController,
|
|
188
|
-
ArcElement,
|
|
189
|
-
Title,
|
|
190
|
-
Tooltip,
|
|
191
|
-
Legend
|
|
192
|
-
);
|
|
193
|
-
synchroniseChartJsFontFamily();
|
|
194
|
-
|
|
195
|
-
// src/components/charts/ph-insight-charts.tsx
|
|
196
|
-
import { Bar, Doughnut, PolarArea } from "react-chartjs-2";
|
|
197
|
-
|
|
198
|
-
// src/lib/chart/with-alpha.ts
|
|
199
|
-
function withAlpha(color, alpha) {
|
|
200
|
-
const trimmed = color.trim();
|
|
201
|
-
const hex8 = trimmed.match(/^#([\da-f]{8})$/i);
|
|
202
|
-
if (hex8 == null ? void 0 : hex8[1]) {
|
|
203
|
-
const n = hex8[1];
|
|
204
|
-
const r = parseInt(n.slice(0, 2), 16);
|
|
205
|
-
const g = parseInt(n.slice(2, 4), 16);
|
|
206
|
-
const b = parseInt(n.slice(4, 6), 16);
|
|
207
|
-
return `rgba(${r}, ${g}, ${b}, ${alpha})`;
|
|
208
|
-
}
|
|
209
|
-
const hexLong = trimmed.match(/^#([\da-f]{6})$/i);
|
|
210
|
-
if (hexLong == null ? void 0 : hexLong[1]) {
|
|
211
|
-
const n = hexLong[1];
|
|
212
|
-
const r = parseInt(n.slice(0, 2), 16);
|
|
213
|
-
const g = parseInt(n.slice(2, 4), 16);
|
|
214
|
-
const b = parseInt(n.slice(4, 6), 16);
|
|
215
|
-
return `rgba(${r}, ${g}, ${b}, ${alpha})`;
|
|
216
|
-
}
|
|
217
|
-
const hexShort = trimmed.match(/^#([\da-f]{3})$/i);
|
|
218
|
-
if (hexShort == null ? void 0 : hexShort[1]) {
|
|
219
|
-
const [, h] = hexShort;
|
|
220
|
-
const r = parseInt(h[0] + h[0], 16);
|
|
221
|
-
const g = parseInt(h[1] + h[1], 16);
|
|
222
|
-
const b = parseInt(h[2] + h[2], 16);
|
|
223
|
-
return `rgba(${r}, ${g}, ${b}, ${alpha})`;
|
|
224
|
-
}
|
|
225
|
-
return trimmed;
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
// src/lib/chart/ph-chart-options.ts
|
|
229
|
-
function readAppRadiusPx() {
|
|
230
|
-
if (typeof document === "undefined") {
|
|
231
|
-
return 6;
|
|
232
|
-
}
|
|
233
|
-
const raw = getComputedStyle(document.documentElement).getPropertyValue("--ph-radius-app").trim();
|
|
234
|
-
const n = Number.parseFloat(raw);
|
|
235
|
-
if (!Number.isFinite(n)) {
|
|
236
|
-
return 6;
|
|
237
|
-
}
|
|
238
|
-
return raw.endsWith("rem") ? n * 16 : n;
|
|
239
|
-
}
|
|
240
|
-
function buildInsightLegend(tokens) {
|
|
241
|
-
return {
|
|
242
|
-
display: true,
|
|
243
|
-
position: "bottom",
|
|
244
|
-
labels: {
|
|
245
|
-
color: tokens.text,
|
|
246
|
-
boxWidth: 10,
|
|
247
|
-
boxHeight: 10,
|
|
248
|
-
padding: 14,
|
|
249
|
-
usePointStyle: true,
|
|
250
|
-
font: { size: 12 }
|
|
251
|
-
}
|
|
252
|
-
};
|
|
253
|
-
}
|
|
254
|
-
function buildInsightTooltipLine(tokens) {
|
|
255
|
-
return {
|
|
256
|
-
backgroundColor: tokens.surface,
|
|
257
|
-
titleColor: tokens.text,
|
|
258
|
-
bodyColor: tokens.textMuted,
|
|
259
|
-
borderColor: tokens.borderStrong,
|
|
260
|
-
borderWidth: 1,
|
|
261
|
-
padding: 12,
|
|
262
|
-
cornerRadius: readAppRadiusPx(),
|
|
263
|
-
displayColors: true,
|
|
264
|
-
caretPadding: 8,
|
|
265
|
-
titleSpacing: 6,
|
|
266
|
-
bodySpacing: 6,
|
|
267
|
-
multiKeyBackground: tokens.surface
|
|
268
|
-
};
|
|
269
|
-
}
|
|
270
|
-
function buildInsightTooltipBar(tokens) {
|
|
271
|
-
return buildInsightTooltipLine(tokens);
|
|
272
|
-
}
|
|
273
|
-
function radialLegend(tokens) {
|
|
274
|
-
return {
|
|
275
|
-
display: true,
|
|
276
|
-
position: "bottom",
|
|
277
|
-
labels: {
|
|
278
|
-
color: tokens.text,
|
|
279
|
-
boxWidth: 10,
|
|
280
|
-
boxHeight: 10,
|
|
281
|
-
padding: 14,
|
|
282
|
-
usePointStyle: true,
|
|
283
|
-
font: { size: 12 }
|
|
284
|
-
}
|
|
285
|
-
};
|
|
286
|
-
}
|
|
287
|
-
function radialInsightTooltip(tokens) {
|
|
288
|
-
return {
|
|
289
|
-
backgroundColor: tokens.surface,
|
|
290
|
-
titleColor: tokens.text,
|
|
291
|
-
bodyColor: tokens.textMuted,
|
|
292
|
-
borderColor: tokens.borderStrong,
|
|
293
|
-
borderWidth: 1,
|
|
294
|
-
padding: 12,
|
|
295
|
-
cornerRadius: readAppRadiusPx(),
|
|
296
|
-
displayColors: true,
|
|
297
|
-
caretPadding: 8,
|
|
298
|
-
titleSpacing: 6,
|
|
299
|
-
bodySpacing: 6,
|
|
300
|
-
multiKeyBackground: tokens.surface
|
|
301
|
-
};
|
|
302
|
-
}
|
|
303
|
-
function buildVerticalBarDemo(tokens) {
|
|
304
|
-
return {
|
|
305
|
-
type: "bar",
|
|
306
|
-
data: {
|
|
307
|
-
labels: ["Chrome", "Safari", "Firefox", "Edge", "Other"],
|
|
308
|
-
datasets: [
|
|
309
|
-
{
|
|
310
|
-
label: "Unique users",
|
|
311
|
-
data: [18400, 12100, 4200, 3100, 900],
|
|
312
|
-
backgroundColor: withAlpha(tokens.series[0], 0.85),
|
|
313
|
-
borderColor: tokens.borderStrong,
|
|
314
|
-
borderWidth: 1,
|
|
315
|
-
borderRadius: 4
|
|
316
|
-
}
|
|
317
|
-
]
|
|
318
|
-
},
|
|
319
|
-
options: {
|
|
320
|
-
responsive: true,
|
|
321
|
-
maintainAspectRatio: false,
|
|
322
|
-
plugins: {
|
|
323
|
-
legend: { display: false },
|
|
324
|
-
tooltip: buildInsightTooltipBar(tokens)
|
|
325
|
-
},
|
|
326
|
-
scales: {
|
|
327
|
-
x: {
|
|
328
|
-
border: { display: false },
|
|
329
|
-
ticks: { color: tokens.textMuted, font: { size: 11 } },
|
|
330
|
-
grid: { display: false }
|
|
331
|
-
},
|
|
332
|
-
y: {
|
|
333
|
-
beginAtZero: true,
|
|
334
|
-
border: { display: false },
|
|
335
|
-
ticks: { color: tokens.textMuted, font: { size: 11 } },
|
|
336
|
-
grid: { color: tokens.grid }
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
};
|
|
341
|
-
}
|
|
342
|
-
function buildHorizontalBarDemo(tokens) {
|
|
343
|
-
return {
|
|
344
|
-
type: "bar",
|
|
345
|
-
data: {
|
|
346
|
-
labels: [
|
|
347
|
-
"/project/settings",
|
|
348
|
-
"/insights/new",
|
|
349
|
-
"/feature-flags",
|
|
350
|
-
"/dashboard",
|
|
351
|
-
"/session-replay"
|
|
352
|
-
],
|
|
353
|
-
datasets: [
|
|
354
|
-
{
|
|
355
|
-
label: "Pageviews",
|
|
356
|
-
data: [12800, 9400, 7200, 6100, 4300],
|
|
357
|
-
backgroundColor: [
|
|
358
|
-
withAlpha(tokens.series[0], 0.85),
|
|
359
|
-
withAlpha(tokens.series[1], 0.85),
|
|
360
|
-
withAlpha(tokens.series[2], 0.85),
|
|
361
|
-
withAlpha(tokens.series[3], 0.85),
|
|
362
|
-
withAlpha(tokens.series[4], 0.85)
|
|
363
|
-
],
|
|
364
|
-
borderWidth: 0,
|
|
365
|
-
borderRadius: 4
|
|
366
|
-
}
|
|
367
|
-
]
|
|
368
|
-
},
|
|
369
|
-
options: {
|
|
370
|
-
indexAxis: "y",
|
|
371
|
-
responsive: true,
|
|
372
|
-
maintainAspectRatio: false,
|
|
373
|
-
plugins: {
|
|
374
|
-
legend: { display: false },
|
|
375
|
-
tooltip: buildInsightTooltipBar(tokens)
|
|
376
|
-
},
|
|
377
|
-
scales: {
|
|
378
|
-
x: {
|
|
379
|
-
beginAtZero: true,
|
|
380
|
-
border: { display: false },
|
|
381
|
-
grid: { color: tokens.grid },
|
|
382
|
-
ticks: { color: tokens.textMuted, font: { size: 11 } }
|
|
383
|
-
},
|
|
384
|
-
y: {
|
|
385
|
-
border: { display: false },
|
|
386
|
-
grid: { display: false },
|
|
387
|
-
ticks: { color: tokens.textMuted, font: { size: 11 } }
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
};
|
|
392
|
-
}
|
|
393
|
-
function buildStackedBarDemo(tokens) {
|
|
394
|
-
return {
|
|
395
|
-
type: "bar",
|
|
396
|
-
data: {
|
|
397
|
-
labels: ["US", "GB", "DE", "AU", "IN"],
|
|
398
|
-
datasets: [
|
|
399
|
-
{
|
|
400
|
-
label: "Direct",
|
|
401
|
-
data: [120, 98, 45, 40, 210],
|
|
402
|
-
backgroundColor: withAlpha(tokens.series[0], 0.92),
|
|
403
|
-
borderRadius: 4
|
|
404
|
-
},
|
|
405
|
-
{
|
|
406
|
-
label: "Organic search",
|
|
407
|
-
data: [80, 72, 38, 30, 160],
|
|
408
|
-
backgroundColor: withAlpha(tokens.series[1], 0.92),
|
|
409
|
-
borderRadius: 4
|
|
410
|
-
},
|
|
411
|
-
{
|
|
412
|
-
label: "Referral",
|
|
413
|
-
data: [44, 22, 18, 12, 90],
|
|
414
|
-
backgroundColor: withAlpha(tokens.series[2], 0.92),
|
|
415
|
-
borderRadius: 4
|
|
416
|
-
}
|
|
417
|
-
]
|
|
418
|
-
},
|
|
419
|
-
options: {
|
|
420
|
-
responsive: true,
|
|
421
|
-
maintainAspectRatio: false,
|
|
422
|
-
plugins: {
|
|
423
|
-
legend: buildInsightLegend(tokens),
|
|
424
|
-
tooltip: buildInsightTooltipBar(tokens)
|
|
425
|
-
},
|
|
426
|
-
scales: {
|
|
427
|
-
x: {
|
|
428
|
-
stacked: true,
|
|
429
|
-
border: { display: false },
|
|
430
|
-
grid: { display: false },
|
|
431
|
-
ticks: { color: tokens.textMuted, font: { size: 11 } }
|
|
432
|
-
},
|
|
433
|
-
y: {
|
|
434
|
-
stacked: true,
|
|
435
|
-
beginAtZero: true,
|
|
436
|
-
border: { display: false },
|
|
437
|
-
grid: { color: tokens.grid },
|
|
438
|
-
ticks: { color: tokens.textMuted, font: { size: 11 } }
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
|
-
};
|
|
443
|
-
}
|
|
444
|
-
function buildDoughnutDemo(tokens) {
|
|
445
|
-
return {
|
|
446
|
-
type: "doughnut",
|
|
447
|
-
data: {
|
|
448
|
-
labels: ["Direct", "Organic search", "Referral", "Paid", "Other"],
|
|
449
|
-
datasets: [
|
|
450
|
-
{
|
|
451
|
-
label: "Channel mix",
|
|
452
|
-
data: [42, 28, 14, 10, 6],
|
|
453
|
-
backgroundColor: [
|
|
454
|
-
withAlpha(tokens.series[0], 0.88),
|
|
455
|
-
withAlpha(tokens.series[1], 0.88),
|
|
456
|
-
withAlpha(tokens.series[2], 0.88),
|
|
457
|
-
withAlpha(tokens.series[3], 0.88),
|
|
458
|
-
withAlpha(tokens.series[4], 0.88)
|
|
459
|
-
],
|
|
460
|
-
borderColor: tokens.surface,
|
|
461
|
-
borderWidth: 2,
|
|
462
|
-
hoverOffset: 6
|
|
463
|
-
}
|
|
464
|
-
]
|
|
465
|
-
},
|
|
466
|
-
options: {
|
|
467
|
-
responsive: true,
|
|
468
|
-
maintainAspectRatio: false,
|
|
469
|
-
cutout: "62%",
|
|
470
|
-
plugins: {
|
|
471
|
-
legend: radialLegend(tokens),
|
|
472
|
-
tooltip: radialInsightTooltip(tokens)
|
|
473
|
-
}
|
|
474
|
-
}
|
|
475
|
-
};
|
|
476
|
-
}
|
|
477
|
-
function buildPolarAreaDemo(tokens) {
|
|
478
|
-
return {
|
|
479
|
-
type: "polarArea",
|
|
480
|
-
data: {
|
|
481
|
-
labels: ["Chrome", "Safari", "Firefox", "Edge", "Other"],
|
|
482
|
-
datasets: [
|
|
483
|
-
{
|
|
484
|
-
label: "Browser share",
|
|
485
|
-
data: [52, 24, 12, 8, 4],
|
|
486
|
-
backgroundColor: [
|
|
487
|
-
withAlpha(tokens.series[0], 0.72),
|
|
488
|
-
withAlpha(tokens.series[1], 0.72),
|
|
489
|
-
withAlpha(tokens.series[2], 0.72),
|
|
490
|
-
withAlpha(tokens.series[3], 0.72),
|
|
491
|
-
withAlpha(tokens.series[4], 0.72)
|
|
492
|
-
],
|
|
493
|
-
borderWidth: 1,
|
|
494
|
-
borderColor: tokens.surface
|
|
495
|
-
}
|
|
496
|
-
]
|
|
497
|
-
},
|
|
498
|
-
options: {
|
|
499
|
-
responsive: true,
|
|
500
|
-
maintainAspectRatio: false,
|
|
501
|
-
scales: {
|
|
502
|
-
r: {
|
|
503
|
-
ticks: {
|
|
504
|
-
color: tokens.textMuted,
|
|
505
|
-
backdropColor: tokens.surface,
|
|
506
|
-
font: { size: 10 }
|
|
507
|
-
},
|
|
508
|
-
grid: {
|
|
509
|
-
color: tokens.grid
|
|
510
|
-
},
|
|
511
|
-
angleLines: {
|
|
512
|
-
color: tokens.grid
|
|
513
|
-
},
|
|
514
|
-
pointLabels: {
|
|
515
|
-
color: tokens.textMuted,
|
|
516
|
-
font: { size: 11 }
|
|
517
|
-
}
|
|
518
|
-
}
|
|
519
|
-
},
|
|
520
|
-
plugins: {
|
|
521
|
-
legend: {
|
|
522
|
-
display: false
|
|
523
|
-
},
|
|
524
|
-
tooltip: radialInsightTooltip(tokens)
|
|
525
|
-
}
|
|
526
|
-
}
|
|
527
|
-
};
|
|
528
|
-
}
|
|
529
|
-
|
|
530
|
-
// src/lib/chart/use-ph-chart-tokens.ts
|
|
531
|
-
import { useEffect, useRef, useState } from "react";
|
|
532
|
-
|
|
533
|
-
// src/lib/chart/ph-chart-tokens.ts
|
|
534
|
-
var FALLBACK_CHART_TOKENS = {
|
|
535
|
-
series: ["#1d4aff", "#621da6", "#42827e", "#ce0e74", "#f14f58", "#529a0a", "#fe729e"],
|
|
536
|
-
grid: "hsl(78 13% 85%)",
|
|
537
|
-
text: "hsl(0 0% 25%)",
|
|
538
|
-
textMuted: "hsl(0 0% 42%)",
|
|
539
|
-
surface: "#ffffff",
|
|
540
|
-
borderStrong: "hsl(69 8% 65%)",
|
|
541
|
-
accent: "hsl(19deg 100% 48%)"
|
|
542
|
-
};
|
|
543
|
-
function readCssVar(el, key) {
|
|
544
|
-
return getComputedStyle(el).getPropertyValue(key).trim();
|
|
545
|
-
}
|
|
546
|
-
function readChartTokens(root) {
|
|
547
|
-
if (typeof document === "undefined") {
|
|
548
|
-
return FALLBACK_CHART_TOKENS;
|
|
549
|
-
}
|
|
550
|
-
const el = root != null ? root : document.documentElement;
|
|
551
|
-
const series = [1, 2, 3, 4, 5, 6, 7].map((index) => {
|
|
552
|
-
const raw = readCssVar(el, `--ph-data-${index}`);
|
|
553
|
-
return raw !== "" ? raw : FALLBACK_CHART_TOKENS.series[index - 1];
|
|
554
|
-
});
|
|
555
|
-
const grid = readCssVar(el, "--ph-border") || FALLBACK_CHART_TOKENS.grid;
|
|
556
|
-
const text = readCssVar(el, "--ph-text-secondary") || FALLBACK_CHART_TOKENS.text;
|
|
557
|
-
const textMuted = readCssVar(el, "--ph-text-tertiary") || FALLBACK_CHART_TOKENS.textMuted;
|
|
558
|
-
const surface = readCssVar(el, "--ph-surface") || FALLBACK_CHART_TOKENS.surface;
|
|
559
|
-
const borderStrong = readCssVar(el, "--ph-border-strong") || FALLBACK_CHART_TOKENS.borderStrong;
|
|
560
|
-
const accent = readCssVar(el, "--ph-accent") || FALLBACK_CHART_TOKENS.accent;
|
|
561
|
-
return { series, grid, text, textMuted, surface, borderStrong, accent };
|
|
562
|
-
}
|
|
563
|
-
|
|
564
|
-
// src/lib/chart/use-ph-chart-tokens.ts
|
|
565
|
-
function tokensEqual(a, b) {
|
|
566
|
-
if (a.series.length !== b.series.length) return false;
|
|
567
|
-
for (let i = 0; i < a.series.length; i++) {
|
|
568
|
-
if (a.series[i] !== b.series[i]) return false;
|
|
569
|
-
}
|
|
570
|
-
return a.grid === b.grid && a.text === b.text && a.textMuted === b.textMuted && a.surface === b.surface && a.borderStrong === b.borderStrong && a.accent === b.accent;
|
|
571
|
-
}
|
|
572
|
-
function useChartTokens() {
|
|
573
|
-
const [tokens, setTokens] = useState(FALLBACK_CHART_TOKENS);
|
|
574
|
-
const tokensRef = useRef(FALLBACK_CHART_TOKENS);
|
|
575
|
-
useEffect(() => {
|
|
576
|
-
const root = document.documentElement;
|
|
577
|
-
const refresh = () => {
|
|
578
|
-
const next = readChartTokens(root);
|
|
579
|
-
if (!tokensEqual(tokensRef.current, next)) {
|
|
580
|
-
tokensRef.current = next;
|
|
581
|
-
setTokens(next);
|
|
582
|
-
}
|
|
583
|
-
};
|
|
584
|
-
refresh();
|
|
585
|
-
const observer = new MutationObserver(refresh);
|
|
586
|
-
observer.observe(root, { attributes: true, attributeFilter: ["data-theme"] });
|
|
587
|
-
return () => observer.disconnect();
|
|
588
|
-
}, []);
|
|
589
|
-
return tokens;
|
|
590
|
-
}
|
|
591
|
-
|
|
592
|
-
// src/lib/hog-charts-lite/build-theme.ts
|
|
593
|
-
function buildHogChartTheme(tokens) {
|
|
594
|
-
return {
|
|
595
|
-
colors: tokens.series.slice(),
|
|
596
|
-
backgroundColor: tokens.surface,
|
|
597
|
-
axisColor: tokens.textMuted,
|
|
598
|
-
gridColor: tokens.grid,
|
|
599
|
-
crosshairColor: tokens.borderStrong
|
|
600
|
-
};
|
|
601
|
-
}
|
|
350
|
+
// src/components/charts/quill/TimeSeriesLineChart.tsx
|
|
351
|
+
import { useMemo as useMemo2 } from "react";
|
|
602
352
|
|
|
603
353
|
// src/lib/hog-charts-lite/CanvasTrendLineChart.tsx
|
|
604
354
|
import { scaleLinear, scalePoint } from "d3-scale";
|
|
605
|
-
import { useCallback, useEffect
|
|
355
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
606
356
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
607
357
|
var HOG_LITE_DEFAULT_MARGINS = { top: 16, right: 16, bottom: 32, left: 48 };
|
|
608
358
|
function resolveDisplayedSeries(series, palette) {
|
|
@@ -657,11 +407,11 @@ function CanvasTrendLineChart({
|
|
|
657
407
|
showCrosshair = true,
|
|
658
408
|
className = ""
|
|
659
409
|
}) {
|
|
660
|
-
const containerRef =
|
|
661
|
-
const canvasRef =
|
|
662
|
-
const [size, setSize] =
|
|
663
|
-
const [hoverIndex, setHoverIndex] =
|
|
664
|
-
|
|
410
|
+
const containerRef = useRef(null);
|
|
411
|
+
const canvasRef = useRef(null);
|
|
412
|
+
const [size, setSize] = useState({ width: 0, height: 0 });
|
|
413
|
+
const [hoverIndex, setHoverIndex] = useState(null);
|
|
414
|
+
useEffect(() => {
|
|
665
415
|
const el = containerRef.current;
|
|
666
416
|
if (!el) {
|
|
667
417
|
return;
|
|
@@ -848,7 +598,7 @@ function CanvasTrendLineChart({
|
|
|
848
598
|
}
|
|
849
599
|
}
|
|
850
600
|
}, [hoverIndex, labels, resolved, showCrosshair, showGrid, size.height, size.width, theme]);
|
|
851
|
-
|
|
601
|
+
useEffect(() => {
|
|
852
602
|
draw();
|
|
853
603
|
}, [draw]);
|
|
854
604
|
const onMouseMove = (event) => {
|
|
@@ -932,430 +682,627 @@ function CanvasTrendLineChart({
|
|
|
932
682
|
] });
|
|
933
683
|
}
|
|
934
684
|
|
|
935
|
-
// src/
|
|
936
|
-
import {
|
|
937
|
-
var
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
685
|
+
// src/lib/chart/use-ph-chart-tokens.ts
|
|
686
|
+
import { useEffect as useEffect2, useState as useState2 } from "react";
|
|
687
|
+
var DEFAULT_TOKENS = {
|
|
688
|
+
series: ["#1d4aff", "#621da6", "#42827e", "#ce0e74", "#f14f58", "#529a0a", "#fe729e"],
|
|
689
|
+
muted: "hsl(220 9% 90%)",
|
|
690
|
+
surface: "#ffffff"
|
|
691
|
+
};
|
|
692
|
+
function readTokens() {
|
|
693
|
+
if (typeof document === "undefined") return DEFAULT_TOKENS;
|
|
694
|
+
const style = getComputedStyle(document.documentElement);
|
|
695
|
+
const read = (key, fallback) => style.getPropertyValue(key).trim() || fallback;
|
|
696
|
+
return {
|
|
697
|
+
series: [
|
|
698
|
+
read("--ph-data-1", DEFAULT_TOKENS.series[0]),
|
|
699
|
+
read("--ph-data-2", DEFAULT_TOKENS.series[1]),
|
|
700
|
+
read("--ph-data-3", DEFAULT_TOKENS.series[2]),
|
|
701
|
+
read("--ph-data-4", DEFAULT_TOKENS.series[3]),
|
|
702
|
+
read("--ph-data-5", DEFAULT_TOKENS.series[4]),
|
|
703
|
+
read("--ph-data-6", DEFAULT_TOKENS.series[5]),
|
|
704
|
+
read("--ph-data-7", DEFAULT_TOKENS.series[6])
|
|
705
|
+
],
|
|
706
|
+
muted: read("--ph-muted", DEFAULT_TOKENS.muted),
|
|
707
|
+
surface: read("--ph-surface", DEFAULT_TOKENS.surface)
|
|
708
|
+
};
|
|
709
|
+
}
|
|
710
|
+
function useChartTokens() {
|
|
711
|
+
const [tokens, setTokens] = useState2(DEFAULT_TOKENS);
|
|
712
|
+
useEffect2(() => {
|
|
713
|
+
setTokens(readTokens());
|
|
714
|
+
}, []);
|
|
715
|
+
return tokens;
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
// src/lib/hog-charts-lite/build-theme.ts
|
|
719
|
+
function buildHogChartTheme(tokens) {
|
|
720
|
+
return {
|
|
721
|
+
colors: tokens.series.slice(),
|
|
722
|
+
backgroundColor: tokens.surface,
|
|
723
|
+
axisColor: tokens.textMuted,
|
|
724
|
+
gridColor: tokens.grid,
|
|
725
|
+
crosshairColor: tokens.borderStrong
|
|
726
|
+
};
|
|
942
727
|
}
|
|
943
|
-
|
|
728
|
+
|
|
729
|
+
// src/components/charts/quill/TimeSeriesLineChart.tsx
|
|
730
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
731
|
+
function TimeSeriesLineChart({
|
|
732
|
+
series,
|
|
733
|
+
labels,
|
|
734
|
+
className,
|
|
735
|
+
showGrid = true,
|
|
736
|
+
showCrosshair = true,
|
|
737
|
+
height = 280
|
|
738
|
+
}) {
|
|
739
|
+
const tokens = useChartTokens();
|
|
740
|
+
const theme = useMemo2(() => buildHogChartTheme(tokens), [tokens]);
|
|
741
|
+
const resolved = useMemo2(
|
|
742
|
+
() => series.map((s, i) => {
|
|
743
|
+
var _a;
|
|
744
|
+
return {
|
|
745
|
+
key: s.key,
|
|
746
|
+
label: s.label,
|
|
747
|
+
data: s.data,
|
|
748
|
+
color: (_a = s.color) != null ? _a : tokens.series[i % tokens.series.length]
|
|
749
|
+
};
|
|
750
|
+
}),
|
|
751
|
+
[series, tokens.series]
|
|
752
|
+
);
|
|
944
753
|
return /* @__PURE__ */ jsx2(
|
|
945
754
|
"div",
|
|
946
755
|
{
|
|
947
|
-
className:
|
|
948
|
-
|
|
756
|
+
className: cn("relative w-full", className),
|
|
757
|
+
style: { height, minHeight: 220 },
|
|
758
|
+
children: /* @__PURE__ */ jsx2(
|
|
759
|
+
CanvasTrendLineChart,
|
|
760
|
+
{
|
|
761
|
+
labels,
|
|
762
|
+
series: resolved,
|
|
763
|
+
theme,
|
|
764
|
+
showGrid,
|
|
765
|
+
showCrosshair,
|
|
766
|
+
className: "h-full min-h-[220px]"
|
|
767
|
+
}
|
|
768
|
+
)
|
|
949
769
|
}
|
|
950
770
|
);
|
|
951
771
|
}
|
|
952
|
-
|
|
953
|
-
|
|
772
|
+
|
|
773
|
+
// src/components/charts/quill/BarChart.tsx
|
|
774
|
+
import { useMemo as useMemo3 } from "react";
|
|
775
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
776
|
+
function BarChart({ series, labels, className, height = 280 }) {
|
|
954
777
|
const tokens = useChartTokens();
|
|
955
|
-
const
|
|
956
|
-
const
|
|
957
|
-
|
|
778
|
+
const groupCount = labels.length;
|
|
779
|
+
const barCount = series.length;
|
|
780
|
+
const { maxVal, chartData } = useMemo3(() => {
|
|
781
|
+
let mx = 0;
|
|
782
|
+
const flat = series.flatMap((s) => s.data);
|
|
783
|
+
for (const v of flat) if (v > mx) mx = v;
|
|
784
|
+
return {
|
|
785
|
+
maxVal: mx || 1,
|
|
786
|
+
chartData: series.map((s, i) => {
|
|
787
|
+
var _a;
|
|
788
|
+
return {
|
|
789
|
+
label: s.label,
|
|
790
|
+
color: (_a = s.color) != null ? _a : tokens.series[i % tokens.series.length],
|
|
791
|
+
values: s.data
|
|
792
|
+
};
|
|
793
|
+
})
|
|
794
|
+
};
|
|
795
|
+
}, [series, tokens.series]);
|
|
796
|
+
const padding = { top: 16, right: 8, bottom: 24, left: 8 };
|
|
797
|
+
const innerW = 400 - padding.left - padding.right;
|
|
798
|
+
const innerH = height - padding.top - padding.bottom;
|
|
799
|
+
const groupW = innerW / groupCount;
|
|
800
|
+
const barW = Math.max(4, groupW * 0.7 / barCount);
|
|
801
|
+
const gap = groupW * 0.15;
|
|
802
|
+
return /* @__PURE__ */ jsx3("div", { className: cn("relative w-full", className), style: { height }, children: /* @__PURE__ */ jsxs2("svg", { viewBox: `0 0 400 ${height}`, className: "h-full w-full", preserveAspectRatio: "xMidYMid meet", suppressHydrationWarning: true, children: [
|
|
803
|
+
chartData.map(
|
|
804
|
+
(bar, bi) => bar.values.map((v, li) => {
|
|
805
|
+
const x = padding.left + li * groupW + gap / 2 + bi * barW;
|
|
806
|
+
const barH = v / maxVal * (innerH - 4);
|
|
807
|
+
const y = padding.top + innerH - barH;
|
|
808
|
+
return /* @__PURE__ */ jsx3(
|
|
809
|
+
"rect",
|
|
810
|
+
{
|
|
811
|
+
x,
|
|
812
|
+
y,
|
|
813
|
+
width: barW,
|
|
814
|
+
height: barH,
|
|
815
|
+
fill: bar.color,
|
|
816
|
+
rx: 2,
|
|
817
|
+
children: /* @__PURE__ */ jsx3("title", { children: `${bar.label}: ${v}` })
|
|
818
|
+
},
|
|
819
|
+
`${bi}-${li}`
|
|
820
|
+
);
|
|
821
|
+
})
|
|
822
|
+
),
|
|
823
|
+
labels.map((l, i) => /* @__PURE__ */ jsx3(
|
|
824
|
+
"text",
|
|
958
825
|
{
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
826
|
+
x: padding.left + i * groupW + groupW / 2,
|
|
827
|
+
y: height - 4,
|
|
828
|
+
textAnchor: "middle",
|
|
829
|
+
className: "fill-ph-mutedtext",
|
|
830
|
+
fontSize: "10",
|
|
831
|
+
children: l
|
|
964
832
|
},
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
data: [920, 990, 940, 1040, 1012, 540, 510],
|
|
969
|
-
color: tokens.series[1],
|
|
970
|
-
stroke: { pattern: [5, 5] }
|
|
971
|
-
}
|
|
972
|
-
],
|
|
973
|
-
[tokens.series]
|
|
974
|
-
);
|
|
975
|
-
if (!mounted) {
|
|
976
|
-
return /* @__PURE__ */ jsx2(ChartSkeleton, {});
|
|
977
|
-
}
|
|
978
|
-
return /* @__PURE__ */ jsx2("div", { className: "relative h-[280px] w-full min-h-[220px]", children: /* @__PURE__ */ jsx2(
|
|
979
|
-
CanvasTrendLineChart,
|
|
980
|
-
{
|
|
981
|
-
labels: DEMO_LABELS,
|
|
982
|
-
series,
|
|
983
|
-
theme,
|
|
984
|
-
showGrid: true,
|
|
985
|
-
showCrosshair: true,
|
|
986
|
-
className: "h-full min-h-[220px]"
|
|
987
|
-
}
|
|
988
|
-
) });
|
|
989
|
-
}
|
|
990
|
-
function InsightVerticalBarChart() {
|
|
991
|
-
const mounted = useClientMounted();
|
|
992
|
-
const tokens = useChartTokens();
|
|
993
|
-
const config = useMemo2(() => buildVerticalBarDemo(tokens), [tokens]);
|
|
994
|
-
if (!mounted) {
|
|
995
|
-
return /* @__PURE__ */ jsx2(ChartSkeleton, {});
|
|
996
|
-
}
|
|
997
|
-
return /* @__PURE__ */ jsx2("div", { className: "relative h-[280px] w-full min-h-[220px]", children: /* @__PURE__ */ jsx2(Bar, { data: config.data, options: config.options, redraw: false }) });
|
|
998
|
-
}
|
|
999
|
-
function InsightHorizontalBarChart() {
|
|
1000
|
-
const mounted = useClientMounted();
|
|
1001
|
-
const tokens = useChartTokens();
|
|
1002
|
-
const config = useMemo2(() => buildHorizontalBarDemo(tokens), [tokens]);
|
|
1003
|
-
if (!mounted) {
|
|
1004
|
-
return /* @__PURE__ */ jsx2(ChartSkeleton, { className: "h-[320px]" });
|
|
1005
|
-
}
|
|
1006
|
-
return /* @__PURE__ */ jsx2("div", { className: "relative h-[320px] w-full min-h-[260px]", children: /* @__PURE__ */ jsx2(Bar, { data: config.data, options: config.options, redraw: false }) });
|
|
1007
|
-
}
|
|
1008
|
-
function InsightStackedBarChart() {
|
|
1009
|
-
const mounted = useClientMounted();
|
|
1010
|
-
const tokens = useChartTokens();
|
|
1011
|
-
const config = useMemo2(() => buildStackedBarDemo(tokens), [tokens]);
|
|
1012
|
-
if (!mounted) {
|
|
1013
|
-
return /* @__PURE__ */ jsx2(ChartSkeleton, { className: "h-[300px]" });
|
|
1014
|
-
}
|
|
1015
|
-
return /* @__PURE__ */ jsx2("div", { className: "relative h-[300px] w-full min-h-[240px]", children: /* @__PURE__ */ jsx2(Bar, { data: config.data, options: config.options, redraw: false }) });
|
|
1016
|
-
}
|
|
1017
|
-
function InsightDoughnutChart() {
|
|
1018
|
-
const mounted = useClientMounted();
|
|
1019
|
-
const tokens = useChartTokens();
|
|
1020
|
-
const config = useMemo2(() => buildDoughnutDemo(tokens), [tokens]);
|
|
1021
|
-
if (!mounted) {
|
|
1022
|
-
return /* @__PURE__ */ jsx2(ChartSkeleton, { className: "h-[260px]" });
|
|
1023
|
-
}
|
|
1024
|
-
return /* @__PURE__ */ jsx2("div", { className: "relative mx-auto h-[260px] w-full max-w-[280px] min-h-[220px]", children: /* @__PURE__ */ jsx2(Doughnut, { data: config.data, options: config.options, redraw: false }) });
|
|
1025
|
-
}
|
|
1026
|
-
function InsightPolarAreaChart() {
|
|
1027
|
-
const mounted = useClientMounted();
|
|
1028
|
-
const tokens = useChartTokens();
|
|
1029
|
-
const config = useMemo2(() => buildPolarAreaDemo(tokens), [tokens]);
|
|
1030
|
-
if (!mounted) {
|
|
1031
|
-
return /* @__PURE__ */ jsx2(ChartSkeleton, { className: "h-[280px]" });
|
|
1032
|
-
}
|
|
1033
|
-
return /* @__PURE__ */ jsx2("div", { className: "relative mx-auto h-[280px] w-full max-w-[320px] min-h-[240px]", children: /* @__PURE__ */ jsx2(PolarArea, { data: config.data, options: config.options, redraw: false }) });
|
|
833
|
+
l
|
|
834
|
+
))
|
|
835
|
+
] }) });
|
|
1034
836
|
}
|
|
1035
837
|
|
|
1036
|
-
// src/components/
|
|
1037
|
-
import {
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
}
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
838
|
+
// src/components/charts/quill/PieChart.tsx
|
|
839
|
+
import { useMemo as useMemo4 } from "react";
|
|
840
|
+
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
841
|
+
function PieChart({ slices, className, size = 200 }) {
|
|
842
|
+
const tokens = useChartTokens();
|
|
843
|
+
const { total, segments } = useMemo4(() => {
|
|
844
|
+
const t = slices.reduce((s, sl) => s + Math.max(0, sl.value), 0);
|
|
845
|
+
let cum = 0;
|
|
846
|
+
const segs = slices.map((sl, i) => {
|
|
847
|
+
var _a;
|
|
848
|
+
const start = cum;
|
|
849
|
+
const val = Math.max(0, sl.value);
|
|
850
|
+
cum += val;
|
|
851
|
+
return __spreadProps(__spreadValues({}, sl), {
|
|
852
|
+
color: (_a = sl.color) != null ? _a : tokens.series[i % tokens.series.length],
|
|
853
|
+
startAngle: start / t * 360,
|
|
854
|
+
endAngle: cum / t * 360,
|
|
855
|
+
pct: t > 0 ? val / t * 100 : 0
|
|
856
|
+
});
|
|
857
|
+
});
|
|
858
|
+
return { total: t, segments: segs };
|
|
859
|
+
}, [slices, tokens.series]);
|
|
860
|
+
const cx = size / 2;
|
|
861
|
+
const cy = size / 2;
|
|
862
|
+
const r = size * 0.38;
|
|
863
|
+
const ir = r * 0.6;
|
|
864
|
+
const polarToCart = (angleDeg, radius) => {
|
|
865
|
+
const rad = (angleDeg - 90) * Math.PI / 180;
|
|
866
|
+
return { x: cx + radius * Math.cos(rad), y: cy + radius * Math.sin(rad) };
|
|
867
|
+
};
|
|
868
|
+
const describeArc = (start, end) => {
|
|
869
|
+
if (end - start >= 359.9) {
|
|
870
|
+
const p1 = polarToCart(start, r);
|
|
871
|
+
const p2 = polarToCart(start + 179.9, r);
|
|
872
|
+
const p3 = polarToCart(start + 359.9, r);
|
|
873
|
+
return `M${p1.x},${p1.y} A${r},${r} 0 0,1 ${p2.x},${p2.y} A${r},${r} 0 0,1 ${p3.x},${p3.y} Z`;
|
|
874
|
+
}
|
|
875
|
+
const s = polarToCart(start, r);
|
|
876
|
+
const e = polarToCart(end, r);
|
|
877
|
+
const si = polarToCart(start, ir);
|
|
878
|
+
const ei = polarToCart(end, ir);
|
|
879
|
+
const large = end - start > 180 ? 1 : 0;
|
|
880
|
+
return `M${s.x},${s.y} A${r},${r} 0 ${large},1 ${e.x},${e.y} L${ei.x},${ei.y} A${ir},${ir} 0 ${large},0 ${si.x},${si.y} Z`;
|
|
881
|
+
};
|
|
882
|
+
return /* @__PURE__ */ jsxs3("div", { className: cn("relative", className), style: { width: size, height: size }, children: [
|
|
883
|
+
/* @__PURE__ */ jsxs3("svg", { viewBox: `0 0 ${size} ${size}`, className: "h-full w-full", suppressHydrationWarning: true, children: [
|
|
884
|
+
segments.map((s) => /* @__PURE__ */ jsx4("path", { d: describeArc(s.startAngle, s.endAngle), fill: s.color, children: /* @__PURE__ */ jsx4("title", { children: `${s.label}: ${s.pct.toFixed(1)}%` }) }, s.key)),
|
|
885
|
+
/* @__PURE__ */ jsx4("circle", { cx, cy, r: ir, fill: "var(--ph-surface)" })
|
|
1050
886
|
] }),
|
|
1051
|
-
|
|
887
|
+
/* @__PURE__ */ jsx4("div", { className: "absolute inset-0 flex items-center justify-center pointer-events-none", children: /* @__PURE__ */ jsx4("span", { className: "text-lg font-bold text-ph-ink tabular-nums", children: slices.length }) })
|
|
1052
888
|
] });
|
|
1053
889
|
}
|
|
1054
890
|
|
|
1055
|
-
// src/components/
|
|
891
|
+
// src/components/charts/quill/Sparkline.tsx
|
|
892
|
+
import { useMemo as useMemo5 } from "react";
|
|
1056
893
|
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
"
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
)
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
}
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
var _b = _a, { label, value, footer, icon, className, children } = _b, props = __objRest(_b, ["label", "value", "footer", "icon", "className", "children"]);
|
|
1092
|
-
return /* @__PURE__ */ jsxs3("article", __spreadProps(__spreadValues({ className: cn("ph-stat", className) }, props), { children: [
|
|
1093
|
-
icon != null ? /* @__PURE__ */ jsx7("div", { className: "mb-2 [&>svg]:h-7 [&>svg]:w-7", children: icon }) : null,
|
|
1094
|
-
/* @__PURE__ */ jsx7("div", { className: "ph-stat-label", children: label }),
|
|
1095
|
-
/* @__PURE__ */ jsx7("div", { className: "ph-stat-val", children: value }),
|
|
1096
|
-
footer != null ? /* @__PURE__ */ jsx7("p", { className: "mt-1 text-xs text-ph-subtle", children: footer }) : null,
|
|
1097
|
-
children
|
|
1098
|
-
] }));
|
|
1099
|
-
}
|
|
1100
|
-
|
|
1101
|
-
// src/components/dashboard/DashboardInsightPlaceholder.tsx
|
|
1102
|
-
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
1103
|
-
function DashboardInsightPlaceholder(_a) {
|
|
1104
|
-
var _b = _a, {
|
|
1105
|
-
label = "Add insight",
|
|
1106
|
-
className,
|
|
1107
|
-
children,
|
|
1108
|
-
type = "button"
|
|
1109
|
-
} = _b, props = __objRest(_b, [
|
|
1110
|
-
"label",
|
|
1111
|
-
"className",
|
|
1112
|
-
"children",
|
|
1113
|
-
"type"
|
|
1114
|
-
]);
|
|
1115
|
-
return /* @__PURE__ */ jsx8(
|
|
1116
|
-
"button",
|
|
1117
|
-
__spreadProps(__spreadValues({
|
|
1118
|
-
type,
|
|
1119
|
-
"aria-label": label,
|
|
1120
|
-
className: cn(
|
|
1121
|
-
"ph-dashboard-placeholder group text-left outline-none transition",
|
|
1122
|
-
"focus-visible:ring-2 focus-visible:ring-ph-brand focus-visible:ring-offset-2",
|
|
1123
|
-
className
|
|
1124
|
-
)
|
|
1125
|
-
}, props), {
|
|
1126
|
-
children: children != null ? children : /* @__PURE__ */ jsx8("span", { className: "font-medium text-ph-subtle group-hover:text-ph-ink", children: label })
|
|
1127
|
-
})
|
|
894
|
+
function Sparkline({
|
|
895
|
+
data,
|
|
896
|
+
color,
|
|
897
|
+
className,
|
|
898
|
+
width = 80,
|
|
899
|
+
height = 32,
|
|
900
|
+
strokeWidth = 2
|
|
901
|
+
}) {
|
|
902
|
+
const tokens = useChartTokens();
|
|
903
|
+
const resolvedColor = color != null ? color : tokens.series[0];
|
|
904
|
+
const path = useMemo5(() => {
|
|
905
|
+
if (data.length < 2) return "";
|
|
906
|
+
const min = Math.min(...data);
|
|
907
|
+
const max = Math.max(...data);
|
|
908
|
+
const range = max - min || 1;
|
|
909
|
+
const xStep = width / (data.length - 1);
|
|
910
|
+
return data.map((v, i) => {
|
|
911
|
+
const x = i * xStep;
|
|
912
|
+
const y = height - (v - min) / range * (height - 4) - 2;
|
|
913
|
+
return `${i === 0 ? "M" : "L"}${x},${y}`;
|
|
914
|
+
}).join(" ");
|
|
915
|
+
}, [data, width, height]);
|
|
916
|
+
if (data.length < 2) return null;
|
|
917
|
+
return /* @__PURE__ */ jsx5(
|
|
918
|
+
"svg",
|
|
919
|
+
{
|
|
920
|
+
className: cn("shrink-0", className),
|
|
921
|
+
width,
|
|
922
|
+
height,
|
|
923
|
+
viewBox: `0 0 ${width} ${height}`,
|
|
924
|
+
"aria-hidden": true,
|
|
925
|
+
suppressHydrationWarning: true,
|
|
926
|
+
children: /* @__PURE__ */ jsx5("path", { d: path, fill: "none", stroke: resolvedColor, strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" })
|
|
927
|
+
}
|
|
1128
928
|
);
|
|
1129
929
|
}
|
|
1130
930
|
|
|
1131
|
-
// src/components/
|
|
1132
|
-
import { jsx as
|
|
1133
|
-
function
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
"children
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
style: { background: ribbon },
|
|
1152
|
-
"aria-hidden": true
|
|
1153
|
-
}
|
|
1154
|
-
) : null,
|
|
1155
|
-
/* @__PURE__ */ jsx9("div", { className: cn("flex min-w-0 flex-1 flex-col gap-3 p-4", bodyClassName), children })
|
|
1156
|
-
] }));
|
|
1157
|
-
}
|
|
1158
|
-
|
|
1159
|
-
// src/components/dashboard/InsightShellHeader.tsx
|
|
1160
|
-
import { jsx as jsx10, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1161
|
-
function InsightShellHeader({ title, subtitle, actions, className }) {
|
|
1162
|
-
return /* @__PURE__ */ jsxs5("header", { className: cn("flex gap-3", actions != null ? "items-start justify-between" : "", className), children: [
|
|
1163
|
-
/* @__PURE__ */ jsxs5("div", { className: "min-w-0 flex-1", children: [
|
|
1164
|
-
/* @__PURE__ */ jsx10("h4", { className: "font-semibold leading-snug text-ph-ink", children: title }),
|
|
1165
|
-
subtitle != null ? /* @__PURE__ */ jsx10("p", { className: "mt-0.5 text-xs text-ph-mutedtext", children: subtitle }) : null
|
|
931
|
+
// src/components/charts/quill/MetricCard.tsx
|
|
932
|
+
import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
933
|
+
function MetricCard({
|
|
934
|
+
value,
|
|
935
|
+
label,
|
|
936
|
+
change,
|
|
937
|
+
sparklineData,
|
|
938
|
+
icon,
|
|
939
|
+
className
|
|
940
|
+
}) {
|
|
941
|
+
var _a;
|
|
942
|
+
return /* @__PURE__ */ jsxs4("div", { className: cn("ph-metric", className), children: [
|
|
943
|
+
/* @__PURE__ */ jsxs4("div", { className: "ph-metric__header", children: [
|
|
944
|
+
icon && /* @__PURE__ */ jsx6("span", { className: "ph-metric__icon", children: icon }),
|
|
945
|
+
/* @__PURE__ */ jsx6("span", { className: "ph-metric__label", children: label }),
|
|
946
|
+
change && /* @__PURE__ */ jsxs4(Badge, { variant: ((_a = change.positive) != null ? _a : change.value >= 0) ? "success" : "danger", children: [
|
|
947
|
+
change.value >= 0 ? "+" : "",
|
|
948
|
+
change.value,
|
|
949
|
+
"%"
|
|
950
|
+
] })
|
|
1166
951
|
] }),
|
|
1167
|
-
|
|
952
|
+
/* @__PURE__ */ jsx6("div", { className: "ph-metric__value", children: value }),
|
|
953
|
+
sparklineData && sparklineData.length > 0 && /* @__PURE__ */ jsx6("div", { className: "mt-2", children: /* @__PURE__ */ jsx6(Sparkline, { data: sparklineData }) })
|
|
1168
954
|
] });
|
|
1169
955
|
}
|
|
1170
956
|
|
|
1171
|
-
// src/components/
|
|
1172
|
-
import {
|
|
1173
|
-
|
|
1174
|
-
function
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
})
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
957
|
+
// src/components/charts/quill/FunnelChart.tsx
|
|
958
|
+
import { useMemo as useMemo6 } from "react";
|
|
959
|
+
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
960
|
+
function FunnelChart({ steps, className }) {
|
|
961
|
+
const tokens = useChartTokens();
|
|
962
|
+
const maxCount = useMemo6(() => Math.max(...steps.map((s) => s.count)), [steps]);
|
|
963
|
+
return /* @__PURE__ */ jsx7("div", { className: cn("space-y-2", className), suppressHydrationWarning: true, children: steps.map((step, i) => {
|
|
964
|
+
const pct = step.count / maxCount * 100;
|
|
965
|
+
const prev = i > 0 ? steps[i - 1].count : step.count;
|
|
966
|
+
const dropoff = prev > 0 ? (prev - step.count) / prev * 100 : 0;
|
|
967
|
+
return /* @__PURE__ */ jsxs5("div", { className: "space-y-1", children: [
|
|
968
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex items-center justify-between text-sm", children: [
|
|
969
|
+
/* @__PURE__ */ jsx7("span", { className: "font-medium text-ph-ink", children: step.label }),
|
|
970
|
+
/* @__PURE__ */ jsx7("span", { className: "tabular-nums text-ph-subtle", children: step.count.toLocaleString() })
|
|
971
|
+
] }),
|
|
972
|
+
/* @__PURE__ */ jsx7("div", { className: "relative h-8 overflow-hidden rounded-md", style: { background: tokens.muted }, children: /* @__PURE__ */ jsx7(
|
|
973
|
+
"div",
|
|
974
|
+
{
|
|
975
|
+
className: "h-full rounded-md transition-all duration-500",
|
|
976
|
+
style: { width: `${pct}%`, background: i === 0 ? tokens.series[0] : tokens.series[i % tokens.series.length] }
|
|
977
|
+
}
|
|
978
|
+
) }),
|
|
979
|
+
i > 0 && dropoff > 0 && /* @__PURE__ */ jsxs5("p", { className: "text-xs text-ph-danger", children: [
|
|
980
|
+
"-",
|
|
981
|
+
dropoff.toFixed(1),
|
|
982
|
+
"% dropoff"
|
|
983
|
+
] })
|
|
984
|
+
] }, step.label);
|
|
1199
985
|
}) });
|
|
1200
986
|
}
|
|
1201
|
-
|
|
1202
|
-
// src/components/dashboard/InsightMiniCard.tsx
|
|
1203
|
-
import { jsx as jsx12, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1204
|
-
function InsightMiniCard(_a) {
|
|
1205
|
-
var _b = _a, {
|
|
1206
|
-
title,
|
|
1207
|
-
subtitle,
|
|
1208
|
-
heights,
|
|
1209
|
-
ribbonColour
|
|
1210
|
-
} = _b, shellProps = __objRest(_b, [
|
|
1211
|
-
"title",
|
|
1212
|
-
"subtitle",
|
|
1213
|
-
"heights",
|
|
1214
|
-
"ribbonColour"
|
|
1215
|
-
]);
|
|
1216
|
-
return /* @__PURE__ */ jsxs6(InsightShell, __spreadProps(__spreadValues({ ribbonColour }, shellProps), { children: [
|
|
1217
|
-
/* @__PURE__ */ jsx12(InsightShellHeader, { title, subtitle }),
|
|
1218
|
-
/* @__PURE__ */ jsx12(MiniTrendBars, { heights })
|
|
1219
|
-
] }));
|
|
1220
|
-
}
|
|
1221
987
|
export {
|
|
1222
988
|
Accordion,
|
|
1223
989
|
Alert,
|
|
990
|
+
AlertDialog,
|
|
991
|
+
AppLayout,
|
|
992
|
+
AuthCard,
|
|
993
|
+
AuthDivider,
|
|
994
|
+
AuthLayout,
|
|
995
|
+
Autocomplete,
|
|
1224
996
|
Avatar,
|
|
1225
997
|
AvatarGroup,
|
|
1226
998
|
Badge,
|
|
999
|
+
Banner,
|
|
1000
|
+
BarChart,
|
|
1227
1001
|
Breadcrumbs,
|
|
1228
1002
|
Button,
|
|
1229
1003
|
ButtonChrome,
|
|
1004
|
+
ButtonGroup,
|
|
1005
|
+
CANONICAL_ICONS,
|
|
1230
1006
|
Calendar,
|
|
1231
1007
|
Caption,
|
|
1232
1008
|
Card,
|
|
1233
1009
|
ChatBubble,
|
|
1234
1010
|
Checkbox,
|
|
1011
|
+
Chip,
|
|
1235
1012
|
CodeBlock,
|
|
1013
|
+
Collapsible,
|
|
1236
1014
|
CollapsibleSection,
|
|
1015
|
+
Combobox,
|
|
1237
1016
|
CommandPalette,
|
|
1238
1017
|
ComponentDocs,
|
|
1018
|
+
ContextMenu,
|
|
1239
1019
|
DEFAULT_THEME_ID,
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
DashboardKpiCard,
|
|
1244
|
-
DashboardToolbar,
|
|
1245
|
-
DashboardWell,
|
|
1020
|
+
DataTable,
|
|
1021
|
+
DatePicker,
|
|
1022
|
+
Dialog,
|
|
1246
1023
|
Display,
|
|
1024
|
+
Divider,
|
|
1025
|
+
Dot,
|
|
1247
1026
|
Drawer,
|
|
1248
1027
|
DropdownButton,
|
|
1249
1028
|
DropdownItem,
|
|
1250
1029
|
DropdownMenu,
|
|
1030
|
+
DropdownRadioGroup,
|
|
1031
|
+
DropdownRadioItem,
|
|
1251
1032
|
EmptyState,
|
|
1252
1033
|
FileUpload,
|
|
1034
|
+
FilterBar,
|
|
1253
1035
|
FilterChips,
|
|
1036
|
+
FilterControls,
|
|
1037
|
+
FilterMenu,
|
|
1038
|
+
FormField,
|
|
1039
|
+
FunnelChart,
|
|
1254
1040
|
H1,
|
|
1255
1041
|
H2,
|
|
1256
1042
|
H3,
|
|
1257
1043
|
H4,
|
|
1258
1044
|
H5,
|
|
1259
|
-
HogTrendLineChart,
|
|
1260
1045
|
HoverCard,
|
|
1261
1046
|
IconBase as Icon,
|
|
1047
|
+
Icon123,
|
|
1048
|
+
IconAI,
|
|
1049
|
+
IconAction,
|
|
1262
1050
|
IconActivity,
|
|
1051
|
+
IconAdsClick,
|
|
1052
|
+
IconAndroidOS,
|
|
1053
|
+
IconAppleIOS,
|
|
1054
|
+
IconArchive,
|
|
1263
1055
|
IconAreaChart,
|
|
1264
1056
|
IconArrowDown,
|
|
1265
1057
|
IconArrowUp,
|
|
1058
|
+
IconAtSign,
|
|
1059
|
+
IconBadge,
|
|
1266
1060
|
IconBase,
|
|
1267
1061
|
IconBell,
|
|
1268
1062
|
IconBellOff,
|
|
1063
|
+
IconBinary,
|
|
1064
|
+
IconBlank,
|
|
1065
|
+
IconBold,
|
|
1269
1066
|
IconBolt,
|
|
1067
|
+
IconBook,
|
|
1068
|
+
IconBookmarkBorder,
|
|
1270
1069
|
IconBox,
|
|
1070
|
+
IconBranch,
|
|
1071
|
+
IconBug,
|
|
1271
1072
|
IconByName,
|
|
1073
|
+
IconCalculate,
|
|
1074
|
+
IconCalendar,
|
|
1075
|
+
IconCalendarDay,
|
|
1272
1076
|
IconCancel,
|
|
1077
|
+
IconCart,
|
|
1078
|
+
IconChat,
|
|
1273
1079
|
IconCheck,
|
|
1274
1080
|
IconCheckCircle,
|
|
1081
|
+
IconCheckboxChecked,
|
|
1275
1082
|
IconChevronDown,
|
|
1276
1083
|
IconChevronLeft,
|
|
1277
1084
|
IconChevronRight,
|
|
1085
|
+
IconChrome,
|
|
1278
1086
|
IconClipboardEdit,
|
|
1087
|
+
IconClock,
|
|
1279
1088
|
IconClose,
|
|
1089
|
+
IconCloud,
|
|
1090
|
+
IconCodePreview,
|
|
1091
|
+
IconCoffee,
|
|
1280
1092
|
IconCohort,
|
|
1093
|
+
IconCommandCursor,
|
|
1094
|
+
IconConfetti,
|
|
1281
1095
|
IconCopy,
|
|
1096
|
+
IconCrown,
|
|
1282
1097
|
IconCumulativeChart,
|
|
1098
|
+
IconDataReel,
|
|
1283
1099
|
IconDatabase,
|
|
1100
|
+
IconDevices,
|
|
1101
|
+
IconDocument,
|
|
1284
1102
|
IconDownload,
|
|
1103
|
+
IconDownloadCloud,
|
|
1104
|
+
IconDragHandle,
|
|
1285
1105
|
IconEdit,
|
|
1286
1106
|
IconErrorOutline,
|
|
1107
|
+
IconEvent,
|
|
1108
|
+
IconEventStream,
|
|
1287
1109
|
IconExclamation,
|
|
1110
|
+
IconExperimentSplit,
|
|
1111
|
+
IconExternalLink,
|
|
1112
|
+
IconEye,
|
|
1113
|
+
IconEyeHidden,
|
|
1114
|
+
IconFacebook,
|
|
1115
|
+
IconFeatureGate,
|
|
1116
|
+
IconFeedback,
|
|
1117
|
+
IconFile,
|
|
1118
|
+
IconFilter,
|
|
1119
|
+
IconFingerprint,
|
|
1120
|
+
IconFirefox,
|
|
1288
1121
|
IconFlag,
|
|
1289
1122
|
IconFlare,
|
|
1290
1123
|
IconFlask,
|
|
1124
|
+
IconFolder,
|
|
1125
|
+
IconForward,
|
|
1126
|
+
IconFullScreen,
|
|
1127
|
+
IconFunnelHorizontal,
|
|
1128
|
+
IconFunnelVertical,
|
|
1129
|
+
IconGear,
|
|
1130
|
+
IconGhost,
|
|
1291
1131
|
IconGift,
|
|
1132
|
+
IconGitlab,
|
|
1133
|
+
IconGlobe,
|
|
1134
|
+
IconGoogle,
|
|
1292
1135
|
IconGridView,
|
|
1136
|
+
IconGroupedEvents,
|
|
1137
|
+
IconGroups,
|
|
1293
1138
|
IconHandClick,
|
|
1139
|
+
IconHash,
|
|
1140
|
+
IconHeadphones,
|
|
1141
|
+
IconHeart,
|
|
1142
|
+
IconHeatmap,
|
|
1294
1143
|
IconHome,
|
|
1144
|
+
IconHomeFilled,
|
|
1145
|
+
IconHourglass,
|
|
1146
|
+
IconImage,
|
|
1147
|
+
IconInbox,
|
|
1148
|
+
IconInfo,
|
|
1149
|
+
IconInfoFilled,
|
|
1150
|
+
IconInsightBoard,
|
|
1151
|
+
IconItalic,
|
|
1152
|
+
IconKey,
|
|
1153
|
+
IconKeyFilled,
|
|
1154
|
+
IconLaptop,
|
|
1295
1155
|
IconLayers,
|
|
1156
|
+
IconLayout,
|
|
1157
|
+
IconLifeBuoy,
|
|
1158
|
+
IconLightBulb,
|
|
1159
|
+
IconLink,
|
|
1160
|
+
IconLinkBreak,
|
|
1161
|
+
IconLinux,
|
|
1296
1162
|
IconListView,
|
|
1163
|
+
IconLocation,
|
|
1164
|
+
IconLock,
|
|
1297
1165
|
IconLogout,
|
|
1166
|
+
IconMacOS,
|
|
1298
1167
|
IconMail,
|
|
1168
|
+
IconMap,
|
|
1169
|
+
IconMapPin,
|
|
1170
|
+
IconMaximize,
|
|
1171
|
+
IconMegaphone,
|
|
1172
|
+
IconMenu,
|
|
1173
|
+
IconMic,
|
|
1174
|
+
IconMicrosoftTeams,
|
|
1175
|
+
IconMinimize,
|
|
1176
|
+
IconMinus,
|
|
1177
|
+
IconMonitor,
|
|
1299
1178
|
IconMoon,
|
|
1179
|
+
IconMoonFilled,
|
|
1180
|
+
IconMoreHorizontal,
|
|
1181
|
+
IconMoreVertical,
|
|
1182
|
+
IconMusic,
|
|
1183
|
+
IconNavigation,
|
|
1184
|
+
IconNodeJS,
|
|
1185
|
+
IconOffline,
|
|
1186
|
+
IconOldWindow,
|
|
1187
|
+
IconOpenInApp,
|
|
1188
|
+
IconOpenInNew,
|
|
1189
|
+
IconPalette,
|
|
1300
1190
|
IconPanelRight,
|
|
1191
|
+
IconPaperclip,
|
|
1192
|
+
IconPauseCircle,
|
|
1193
|
+
IconPeople,
|
|
1194
|
+
IconPercent,
|
|
1301
1195
|
IconPerson,
|
|
1196
|
+
IconPhone,
|
|
1197
|
+
IconPin,
|
|
1302
1198
|
IconPlayCircle,
|
|
1303
1199
|
IconPlus,
|
|
1304
1200
|
IconPremium,
|
|
1201
|
+
IconPreview,
|
|
1202
|
+
IconPrinter,
|
|
1305
1203
|
IconQueryEditor,
|
|
1204
|
+
IconQueryStack,
|
|
1205
|
+
IconQuestionAnswer,
|
|
1306
1206
|
IconRadar,
|
|
1207
|
+
IconRadioButtonUnchecked,
|
|
1307
1208
|
IconRecording,
|
|
1209
|
+
IconRedo,
|
|
1210
|
+
IconRefresh,
|
|
1211
|
+
IconReplay,
|
|
1212
|
+
IconReplayFrame,
|
|
1213
|
+
IconReply,
|
|
1214
|
+
IconReport,
|
|
1308
1215
|
IconRobot,
|
|
1309
1216
|
IconRocket,
|
|
1217
|
+
IconSafari,
|
|
1310
1218
|
IconSave,
|
|
1311
1219
|
IconSearch,
|
|
1220
|
+
IconSelectAll,
|
|
1312
1221
|
IconSelectEvents,
|
|
1313
1222
|
IconShoppingCart,
|
|
1223
|
+
IconSkipBackward,
|
|
1224
|
+
IconSkipEnd,
|
|
1225
|
+
IconSkipStart,
|
|
1226
|
+
IconSlack,
|
|
1227
|
+
IconSlackExternal,
|
|
1314
1228
|
IconSpinner,
|
|
1229
|
+
IconStamphog,
|
|
1315
1230
|
IconStar,
|
|
1231
|
+
IconStore,
|
|
1316
1232
|
IconSubArrowRight,
|
|
1233
|
+
IconSubtitles,
|
|
1234
|
+
IconSubtitlesOff,
|
|
1317
1235
|
IconSun,
|
|
1236
|
+
IconSurveyCard,
|
|
1318
1237
|
IconSurveys,
|
|
1238
|
+
IconSwapHoriz,
|
|
1319
1239
|
IconSync,
|
|
1320
1240
|
IconTableChart,
|
|
1321
1241
|
IconTerminal,
|
|
1242
|
+
IconTextSize,
|
|
1322
1243
|
IconToggle,
|
|
1323
1244
|
IconTrash,
|
|
1245
|
+
IconTrendingDown,
|
|
1246
|
+
IconTrendingFlat,
|
|
1247
|
+
IconTrendingFlatDown,
|
|
1324
1248
|
IconTuning,
|
|
1249
|
+
IconUnverifiedEvent,
|
|
1325
1250
|
IconUpload,
|
|
1251
|
+
IconVerifiedEvent,
|
|
1252
|
+
IconVerticalAlignCenter,
|
|
1326
1253
|
IconVolume,
|
|
1327
1254
|
IconVolumeOff,
|
|
1255
|
+
IconWeb,
|
|
1256
|
+
IconWindows,
|
|
1328
1257
|
Indicator,
|
|
1329
1258
|
Input,
|
|
1330
|
-
|
|
1331
|
-
InsightHorizontalBarChart,
|
|
1332
|
-
InsightMiniCard,
|
|
1333
|
-
InsightPolarAreaChart,
|
|
1334
|
-
InsightShell,
|
|
1335
|
-
InsightShellHeader,
|
|
1336
|
-
InsightStackedBarChart,
|
|
1337
|
-
InsightVerticalBarChart,
|
|
1259
|
+
InputGroup,
|
|
1338
1260
|
Kbd,
|
|
1339
1261
|
Label,
|
|
1340
1262
|
Lead,
|
|
1341
|
-
|
|
1263
|
+
Lettermark,
|
|
1264
|
+
Link,
|
|
1265
|
+
Loader,
|
|
1266
|
+
LoadingBar,
|
|
1267
|
+
LoadingState,
|
|
1268
|
+
Menubar,
|
|
1269
|
+
Metric,
|
|
1270
|
+
MetricCard,
|
|
1342
1271
|
Modal,
|
|
1343
1272
|
Mono,
|
|
1273
|
+
NumberField,
|
|
1274
|
+
OLD_UI_ICONS,
|
|
1344
1275
|
Overline,
|
|
1345
1276
|
P,
|
|
1346
1277
|
PH_ICONS,
|
|
1278
|
+
PH_ICON_ALIASES,
|
|
1347
1279
|
Pagination,
|
|
1348
1280
|
Panel,
|
|
1281
|
+
PieChart,
|
|
1282
|
+
Popover,
|
|
1349
1283
|
Progress,
|
|
1284
|
+
ProgressCircle,
|
|
1350
1285
|
Radio,
|
|
1351
1286
|
Range,
|
|
1352
1287
|
Rating,
|
|
1288
|
+
Resizable,
|
|
1289
|
+
Row,
|
|
1290
|
+
ScrollArea,
|
|
1353
1291
|
SearchGroup,
|
|
1354
1292
|
SearchInput,
|
|
1355
1293
|
SegmentedControl,
|
|
1356
1294
|
Select,
|
|
1295
|
+
SettingsLayout,
|
|
1296
|
+
SettingsNav,
|
|
1357
1297
|
ShowcaseWrapper,
|
|
1298
|
+
Sidebar,
|
|
1299
|
+
Skeleton,
|
|
1358
1300
|
Small,
|
|
1301
|
+
Snack,
|
|
1302
|
+
SortMenu,
|
|
1303
|
+
Sparkline,
|
|
1304
|
+
Spinner,
|
|
1305
|
+
Splotch,
|
|
1359
1306
|
Stat,
|
|
1360
1307
|
Stepper,
|
|
1361
1308
|
THEMES,
|
|
@@ -1363,15 +1310,22 @@ export {
|
|
|
1363
1310
|
THEME_INIT_SCRIPT,
|
|
1364
1311
|
Table,
|
|
1365
1312
|
Tabs,
|
|
1313
|
+
Tag,
|
|
1366
1314
|
Terminal,
|
|
1367
1315
|
Textarea,
|
|
1368
1316
|
ThemeDomSync,
|
|
1369
1317
|
ThemeManager,
|
|
1370
1318
|
ThemeSwitcher,
|
|
1319
|
+
TimeSeriesLineChart,
|
|
1371
1320
|
Timeline,
|
|
1372
1321
|
Toast,
|
|
1373
1322
|
ToastStack,
|
|
1374
1323
|
Toggle,
|
|
1324
|
+
ToggleButton,
|
|
1325
|
+
ToggleGroup,
|
|
1326
|
+
Tooltip,
|
|
1327
|
+
TooltipProvider,
|
|
1328
|
+
Widget,
|
|
1375
1329
|
createIconBase,
|
|
1376
1330
|
createIconBasePath,
|
|
1377
1331
|
getTheme,
|