@ramme-io/ui 5.3.1 → 5.5.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/bin/ramme-ui.mjs +18 -6
- package/dist/components/ai/cardState.d.ts +7 -10
- package/dist/components/data-display/DataTable.d.ts +5 -0
- package/dist/components/data-display/DataTable.js +31 -29
- package/dist/components/data-display/_DataTableCards.js +31 -31
- package/dist/components/forms/SegmentedControl.js +14 -9
- package/dist/components/layout/AppShell.js +32 -32
- package/dist/components/layout/AppShell.print.test.d.ts +1 -0
- package/dist/components/ui/Avatar.d.ts +35 -6
- package/dist/components/ui/Avatar.js +54 -20
- package/dist/components/ui/Badge.d.ts +1 -1
- package/dist/components/ui/Icon.js +21 -11
- package/dist/contexts/ThemeContext.d.ts +6 -0
- package/dist/contexts/ThemeContext.js +90 -73
- package/dist/index.css +1 -1
- package/dist/index.js +117 -114
- package/dist/lib/hooks/useChartTheme.d.ts +21 -0
- package/dist/lib/hooks/useChartTheme.js +39 -22
- package/dist/lib/theme/ThemeGenerator.contrast.test.d.ts +1 -0
- package/dist/lib/theme/ThemeGenerator.logic.js +68 -67
- package/dist/lib/theme/themeUtils.d.ts +19 -3
- package/dist/lib/theme/themeUtils.js +96 -62
- package/dist/print-palette.test.d.ts +1 -0
- package/dist/wizardManifest.js +39 -7
- package/package.json +2 -2
- package/src/wizardManifest.ts +39 -7
- package/tailwind.preset.js +1 -0
package/dist/index.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
/* empty css */
|
|
2
2
|
import { wizardManifest as t } from "./wizardManifest.js";
|
|
3
|
-
import { AUTO_REGISTRY as
|
|
3
|
+
import { AUTO_REGISTRY as a } from "./component-registry.js";
|
|
4
4
|
import { mockChartData as f, mockTableData as x } from "./data/mockData.js";
|
|
5
5
|
import { Loader as n } from "./blocks/ai/Loader.js";
|
|
6
6
|
import { Actions as T, Suggestion as s } from "./blocks/ai/Actions.js";
|
|
7
7
|
import { PromptInput as h } from "./blocks/ai/PromptInput.js";
|
|
8
|
-
import { Message as
|
|
9
|
-
import { Conversation as
|
|
8
|
+
import { Message as c } from "./blocks/ai/Message.js";
|
|
9
|
+
import { Conversation as u } from "./blocks/ai/Conversation.js";
|
|
10
10
|
import { ChatFAB as b } from "./blocks/ai/ChatFAB.js";
|
|
11
|
-
import { AIChatThread as
|
|
11
|
+
import { AIChatThread as I } from "./components/ai/AIChatThread/AIChatThread.js";
|
|
12
12
|
import { KeyInjectionOverlay as A } from "./components/ai/KeyInjectionOverlay.js";
|
|
13
|
-
import { TAY_DREAMBOAT_THEME as
|
|
13
|
+
import { TAY_DREAMBOAT_THEME as E, ThemeProvider as L, availableThemes as B, useTheme as M } from "./contexts/ThemeContext.js";
|
|
14
14
|
import { AuthLayout as F } from "./components/auth/AuthLayout.js";
|
|
15
|
-
import { LoginPage as
|
|
16
|
-
import { SignupPage as
|
|
15
|
+
import { LoginPage as _ } from "./components/auth/LoginPage.js";
|
|
16
|
+
import { SignupPage as O } from "./components/auth/SignupPage.js";
|
|
17
17
|
import { DataTable as H } from "./components/data-display/DataTable.js";
|
|
18
|
-
import { ActivityFeed as
|
|
18
|
+
import { ActivityFeed as G } from "./components/data-display/ActivityFeed.js";
|
|
19
19
|
import { Table as N } from "./components/data-display/Table.js";
|
|
20
20
|
import { Gallery as Y } from "./components/data-display/Gallery.js";
|
|
21
21
|
import { AreaChart as Q } from "./components/data-display/AreaChart.js";
|
|
@@ -25,23 +25,23 @@ import { LineChart as Z } from "./components/data-display/LineChart.js";
|
|
|
25
25
|
import { PieChart as rr } from "./components/data-display/PieChart.js";
|
|
26
26
|
import { ScatterChart as er } from "./components/data-display/ScatterChart.js";
|
|
27
27
|
import { CodeBlock as mr } from "./components/data-display/CodeBlock.js";
|
|
28
|
-
import { StatCard as
|
|
28
|
+
import { StatCard as pr } from "./components/data-display/StatCard.js";
|
|
29
29
|
import { KpiGrid as xr } from "./components/data-display/KpiGrid.js";
|
|
30
30
|
import { StatusBadge as nr } from "./components/data-display/StatusBadge.js";
|
|
31
31
|
import { DocumentScanView as Tr } from "./components/data-display/DocumentScanView.js";
|
|
32
32
|
import { Alert as dr } from "./components/feedback/Alert.js";
|
|
33
33
|
import { EmptyState as Sr } from "./components/feedback/EmptyState.js";
|
|
34
|
-
import { Skeleton as
|
|
35
|
-
import { Plan as
|
|
34
|
+
import { Skeleton as gr } from "./components/feedback/Skeleton.js";
|
|
35
|
+
import { Plan as Cr } from "./components/feedback/Plan.js";
|
|
36
36
|
import { TippyTooltip as Dr } from "./components/feedback/TippyTooltip.js";
|
|
37
|
-
import { Toast as
|
|
38
|
-
import { ToastProvider as
|
|
39
|
-
import { Label as
|
|
37
|
+
import { Toast as Pr } from "./components/feedback/Toast.js";
|
|
38
|
+
import { ToastProvider as Rr, useToast as Er } from "./components/feedback/ToastProvider.js";
|
|
39
|
+
import { Label as Br } from "./components/forms/Label.js";
|
|
40
40
|
import { ButtonGroup as vr } from "./components/forms/ButtonGroup.js";
|
|
41
41
|
import { Checkbox as yr } from "./components/forms/Checkbox.js";
|
|
42
|
-
import { ComboBox as
|
|
42
|
+
import { ComboBox as wr } from "./components/forms/ComboBox.js";
|
|
43
43
|
import { DatePicker as kr } from "./components/forms/DatePicker.js";
|
|
44
|
-
import { FileUpload as
|
|
44
|
+
import { FileUpload as Vr } from "./components/forms/FileUpload.js";
|
|
45
45
|
import { FormTemplate as Kr } from "./components/forms/FormTemplate.js";
|
|
46
46
|
import { Input as Ur } from "./components/forms/Input.js";
|
|
47
47
|
import { MultiSelect as zr } from "./components/forms/MultiSelect.js";
|
|
@@ -51,20 +51,20 @@ import { SegmentedControl as Jr } from "./components/forms/SegmentedControl.js";
|
|
|
51
51
|
import { Select as $r } from "./components/forms/Select.js";
|
|
52
52
|
import { FontSelect as oo } from "./components/forms/FontSelect.js";
|
|
53
53
|
import { Textarea as to } from "./components/forms/Textarea.js";
|
|
54
|
-
import { ToggleSwitch as
|
|
54
|
+
import { ToggleSwitch as ao, ToggleSwitch as po } from "./components/forms/ToggleSwitch.js";
|
|
55
55
|
import { useDataFetch as xo } from "./lib/hooks/useDataFetch.js";
|
|
56
56
|
import { useChartTheme as no } from "./lib/hooks/useChartTheme.js";
|
|
57
57
|
import { MOBILE_BREAKPOINT_PX as To, MOBILE_BREAKPOINT_QUERY as so, useIsMobile as ho, useMediaQuery as So } from "./lib/hooks/useMediaQuery.js";
|
|
58
|
-
import { useBodyScrollLock as
|
|
59
|
-
import { DISMISS_THRESHOLD as
|
|
60
|
-
import { useDialogFocus as
|
|
61
|
-
import { CircularDial as
|
|
58
|
+
import { useBodyScrollLock as go } from "./lib/hooks/useBodyScrollLock.js";
|
|
59
|
+
import { DISMISS_THRESHOLD as Co, DRAG_SLOP as bo, FLICK_VELOCITY as Do, settleTo as Io, useSheetGesture as Po } from "./lib/hooks/useSheetGesture.js";
|
|
60
|
+
import { useDialogFocus as Ro } from "./lib/hooks/useDialogFocus.js";
|
|
61
|
+
import { CircularDial as Lo } from "./components/hardware/CircularDial.js";
|
|
62
62
|
import { HardwareCommandButton as Mo } from "./components/hardware/HardwareCommandButton.js";
|
|
63
63
|
import { Sparkline as Fo } from "./components/hardware/Sparkline.js";
|
|
64
|
-
import { EdgeInsightTerminal as
|
|
65
|
-
import { DeviceCard as
|
|
64
|
+
import { EdgeInsightTerminal as _o } from "./components/hardware/EdgeInsightTerminal.js";
|
|
65
|
+
import { DeviceCard as Oo } from "./blocks/iot/DeviceCard.js";
|
|
66
66
|
import { WaterPumpControl as Ho } from "./blocks/iot/WaterPumpControl.js";
|
|
67
|
-
import { TelemetryLog as
|
|
67
|
+
import { TelemetryLog as Go } from "./blocks/iot/TelemetryLog.js";
|
|
68
68
|
import { DataCard as No } from "./components/molecular/DataCard.js";
|
|
69
69
|
import { StateMatrix as Yo } from "./components/molecular/StateMatrix.js";
|
|
70
70
|
import { ConnectorOverlay as Qo } from "./components/molecular/ConnectorOverlay.js";
|
|
@@ -74,18 +74,18 @@ import { DetailDrawer as Zo } from "./components/layout/DetailDrawer.js";
|
|
|
74
74
|
import { RammeInspectorTrigger as re } from "./components/layout/RammeInspectorTrigger.js";
|
|
75
75
|
import { AboutRamme as ee } from "./components/layout/AboutRamme.js";
|
|
76
76
|
import { Header as me } from "./components/layout/Header.js";
|
|
77
|
-
import { Toolbar as
|
|
77
|
+
import { Toolbar as pe } from "./components/layout/Toolbar.js";
|
|
78
78
|
import { FilterPanel as xe } from "./components/layout/FilterPanel.js";
|
|
79
79
|
import { Statusbar as ne } from "./components/layout/Statusbar.js";
|
|
80
80
|
import { Accordion as Te, AccordionItem as se } from "./components/layout/Accordion.js";
|
|
81
|
-
import { Card as he, CardContent as Se, CardDescription as
|
|
82
|
-
import { Drawer as
|
|
81
|
+
import { Card as he, CardContent as Se, CardDescription as ce, CardFooter as ge, CardHeader as ue, CardLabel as Ce, CardTitle as be } from "./components/layout/Card.js";
|
|
82
|
+
import { Drawer as Ie } from "./components/layout/Drawer.js";
|
|
83
83
|
import { Sheet as Ae } from "./components/layout/Sheet.js";
|
|
84
|
-
import { DefinitionDescription as
|
|
84
|
+
import { DefinitionDescription as Ee, DefinitionList as Le, DefinitionTerm as Be, List as Me, ListItem as ve } from "./components/layout/List.js";
|
|
85
85
|
import { Modal as ye } from "./components/layout/Modal.js";
|
|
86
|
-
import { Sidebar as
|
|
86
|
+
import { Sidebar as we } from "./components/layout/Sidebar.js";
|
|
87
87
|
import { ActionBar as ke } from "./components/layout/ActionBar.js";
|
|
88
|
-
import { PageContainer as
|
|
88
|
+
import { PageContainer as Ve } from "./components/layout/PageContainer.js";
|
|
89
89
|
import { PageHeader as Ke } from "./components/layout/PageHeader.js";
|
|
90
90
|
import { SectionHeader as Ue } from "./components/layout/SectionHeader.js";
|
|
91
91
|
import { ButtonItem as ze, UserNav as Qe } from "./components/layout/UserNav.js";
|
|
@@ -93,42 +93,42 @@ import { CollectionLayout as je } from "./components/layout/CollectionLayout.js"
|
|
|
93
93
|
import { DenseMetricRibbon as qe } from "./components/layout/DenseMetricRibbon.js";
|
|
94
94
|
import { BreadcrumbItem as Ze, Breadcrumbs as $e } from "./components/navigation/Breadcrumbs.js";
|
|
95
95
|
import { Menu as ot, MenuDivider as et, MenuItem as tt } from "./components/navigation/Menu.js";
|
|
96
|
-
import { MobileNav as
|
|
96
|
+
import { MobileNav as at } from "./components/navigation/MobileNav.js";
|
|
97
97
|
import { Pagination as ft } from "./components/navigation/Pagination.js";
|
|
98
98
|
import { Stepper as it } from "./components/navigation/Stepper.js";
|
|
99
99
|
import { TabPanel as lt, Tabs as Tt } from "./components/navigation/Tabs.js";
|
|
100
100
|
import { Avatar as dt } from "./components/ui/Avatar.js";
|
|
101
|
-
import { Badge as St, badgeVariants as
|
|
102
|
-
import { Button as
|
|
101
|
+
import { Badge as St, badgeVariants as ct } from "./components/ui/Badge.js";
|
|
102
|
+
import { Button as ut, buttonVariants as Ct } from "./components/ui/Button.js";
|
|
103
103
|
import { Icon as Dt } from "./components/ui/Icon.js";
|
|
104
|
-
import { BrandLogo as
|
|
105
|
-
import { cn as
|
|
106
|
-
import { formatValue as
|
|
104
|
+
import { BrandLogo as Pt } from "./components/ui/BrandLogo.js";
|
|
105
|
+
import { cn as Rt } from "./utils/cn.js";
|
|
106
|
+
import { formatValue as Lt } from "./lib/formatters.js";
|
|
107
107
|
import { ThemeSynthesizer as Mt } from "./components/theme/ThemeSynthesizer.js";
|
|
108
108
|
import { AestheticProfileGrid as Ft } from "./components/theme/AestheticProfileGrid.js";
|
|
109
|
-
import { FineTuningControls as
|
|
110
|
-
import { PaletteSwatch as
|
|
111
|
-
import { ThemeSettings as
|
|
109
|
+
import { FineTuningControls as _t } from "./components/theme/FineTuningControls.js";
|
|
110
|
+
import { PaletteSwatch as Ot, ThemeLivePreview as kt } from "./components/theme/ThemeLivePreview.js";
|
|
111
|
+
import { ThemeSettings as Vt } from "./components/theme/ThemeSettings.js";
|
|
112
112
|
import { ThemeLab as Kt } from "./components/theme/ThemeLab.js";
|
|
113
113
|
import { AESTHETIC_PROFILES as Ut, generateFromProfile as Yt, generateFromPrompt as zt, generateRandom as Qt, hslToCssString as Wt, hslToRgb as jt, hslToRgbString as Xt, lightToDark as qt, paletteToRgbVars as Jt } from "./lib/theme/ThemeGenerator.logic.js";
|
|
114
|
-
import {
|
|
115
|
-
import { generateThemeFromPrompt as
|
|
116
|
-
import { TelemetryGraph as
|
|
117
|
-
import { ShowroomContainer as
|
|
118
|
-
import { ShowroomSidebar as
|
|
119
|
-
import { ShowroomCanvas as
|
|
120
|
-
import { SkuBadge as
|
|
121
|
-
import { resolvePreview as
|
|
114
|
+
import { DERIVED_THEME_VARS as $t, THEME_TOKEN_VARS as rm, applyThemeToDom as om, contrastRatio as em, generateRandomTheme as tm, getContrastColor as mm, hexToRgbTriplet as am, isCustomTheme as pm, loadGoogleFont as fm, randomRgb as xm, relativeLuminance as im, tokensToVars as nm } from "./lib/theme/themeUtils.js";
|
|
115
|
+
import { generateThemeFromPrompt as Tm } from "./lib/theme/themeAgent.js";
|
|
116
|
+
import { TelemetryGraph as dm } from "./components/ai/TelemetryGraph/TelemetryGraph.js";
|
|
117
|
+
import { ShowroomContainer as Sm } from "./components/showroom/ShowroomContainer.js";
|
|
118
|
+
import { ShowroomSidebar as gm } from "./components/showroom/ShowroomSidebar.js";
|
|
119
|
+
import { ShowroomCanvas as Cm } from "./components/showroom/ShowroomCanvas.js";
|
|
120
|
+
import { SkuBadge as Dm } from "./components/showroom/SkuBadge.js";
|
|
121
|
+
import { resolvePreview as Pm } from "./components/showroom/ShowroomRenderer.js";
|
|
122
122
|
export {
|
|
123
123
|
Ut as AESTHETIC_PROFILES,
|
|
124
|
-
|
|
125
|
-
|
|
124
|
+
I as AIChatThread,
|
|
125
|
+
a as AUTO_REGISTRY,
|
|
126
126
|
ee as AboutRamme,
|
|
127
127
|
Te as Accordion,
|
|
128
128
|
se as AccordionItem,
|
|
129
129
|
ke as ActionBar,
|
|
130
130
|
T as Actions,
|
|
131
|
-
|
|
131
|
+
G as ActivityFeed,
|
|
132
132
|
Ft as AestheticProfileGrid,
|
|
133
133
|
dr as Alert,
|
|
134
134
|
jo as AppShell,
|
|
@@ -137,47 +137,48 @@ export {
|
|
|
137
137
|
dt as Avatar,
|
|
138
138
|
St as Badge,
|
|
139
139
|
j as BarChart,
|
|
140
|
-
|
|
140
|
+
Pt as BrandLogo,
|
|
141
141
|
Ze as BreadcrumbItem,
|
|
142
142
|
$e as Breadcrumbs,
|
|
143
|
-
|
|
143
|
+
ut as Button,
|
|
144
144
|
vr as ButtonGroup,
|
|
145
145
|
ze as ButtonItem,
|
|
146
146
|
he as Card,
|
|
147
147
|
Se as CardContent,
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
148
|
+
ce as CardDescription,
|
|
149
|
+
ge as CardFooter,
|
|
150
|
+
ue as CardHeader,
|
|
151
|
+
Ce as CardLabel,
|
|
152
152
|
be as CardTitle,
|
|
153
153
|
q as ChartWithTable,
|
|
154
154
|
b as ChatFAB,
|
|
155
155
|
yr as Checkbox,
|
|
156
|
-
|
|
156
|
+
Lo as CircularDial,
|
|
157
157
|
mr as CodeBlock,
|
|
158
158
|
je as CollectionLayout,
|
|
159
|
-
|
|
159
|
+
wr as ComboBox,
|
|
160
160
|
Qo as ConnectorOverlay,
|
|
161
|
-
|
|
162
|
-
|
|
161
|
+
u as Conversation,
|
|
162
|
+
$t as DERIVED_THEME_VARS,
|
|
163
|
+
Co as DISMISS_THRESHOLD,
|
|
163
164
|
bo as DRAG_SLOP,
|
|
164
165
|
No as DataCard,
|
|
165
166
|
H as DataTable,
|
|
166
167
|
kr as DatePicker,
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
168
|
+
Ee as DefinitionDescription,
|
|
169
|
+
Le as DefinitionList,
|
|
170
|
+
Be as DefinitionTerm,
|
|
170
171
|
qe as DenseMetricRibbon,
|
|
171
172
|
Zo as DetailDrawer,
|
|
172
|
-
|
|
173
|
+
Oo as DeviceCard,
|
|
173
174
|
Tr as DocumentScanView,
|
|
174
|
-
|
|
175
|
-
|
|
175
|
+
Ie as Drawer,
|
|
176
|
+
_o as EdgeInsightTerminal,
|
|
176
177
|
Sr as EmptyState,
|
|
177
178
|
Do as FLICK_VELOCITY,
|
|
178
|
-
|
|
179
|
+
Vr as FileUpload,
|
|
179
180
|
xe as FilterPanel,
|
|
180
|
-
|
|
181
|
+
_t as FineTuningControls,
|
|
181
182
|
oo as FontSelect,
|
|
182
183
|
Kr as FormTemplate,
|
|
183
184
|
Y as Gallery,
|
|
@@ -187,27 +188,27 @@ export {
|
|
|
187
188
|
Ur as Input,
|
|
188
189
|
A as KeyInjectionOverlay,
|
|
189
190
|
xr as KpiGrid,
|
|
190
|
-
|
|
191
|
+
Br as Label,
|
|
191
192
|
Z as LineChart,
|
|
192
193
|
Me as List,
|
|
193
194
|
ve as ListItem,
|
|
194
195
|
n as Loader,
|
|
195
|
-
|
|
196
|
+
_ as LoginPage,
|
|
196
197
|
To as MOBILE_BREAKPOINT_PX,
|
|
197
198
|
so as MOBILE_BREAKPOINT_QUERY,
|
|
198
199
|
ot as Menu,
|
|
199
200
|
et as MenuDivider,
|
|
200
201
|
tt as MenuItem,
|
|
201
|
-
|
|
202
|
-
|
|
202
|
+
c as Message,
|
|
203
|
+
at as MobileNav,
|
|
203
204
|
ye as Modal,
|
|
204
205
|
zr as MultiSelect,
|
|
205
|
-
|
|
206
|
+
Ve as PageContainer,
|
|
206
207
|
Ke as PageHeader,
|
|
207
208
|
ft as Pagination,
|
|
208
|
-
|
|
209
|
+
Ot as PaletteSwatch,
|
|
209
210
|
rr as PieChart,
|
|
210
|
-
|
|
211
|
+
Cr as Plan,
|
|
211
212
|
h as PromptInput,
|
|
212
213
|
Wr as Radio,
|
|
213
214
|
re as RammeInspectorTrigger,
|
|
@@ -218,75 +219,77 @@ export {
|
|
|
218
219
|
$r as Select,
|
|
219
220
|
qo as SettingsContainer,
|
|
220
221
|
Ae as Sheet,
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
222
|
+
Cm as ShowroomCanvas,
|
|
223
|
+
Sm as ShowroomContainer,
|
|
224
|
+
gm as ShowroomSidebar,
|
|
225
|
+
we as Sidebar,
|
|
226
|
+
O as SignupPage,
|
|
227
|
+
gr as Skeleton,
|
|
228
|
+
Dm as SkuBadge,
|
|
228
229
|
Fo as Sparkline,
|
|
229
|
-
|
|
230
|
+
pr as StatCard,
|
|
230
231
|
Yo as StateMatrix,
|
|
231
232
|
nr as StatusBadge,
|
|
232
233
|
ne as Statusbar,
|
|
233
234
|
it as Stepper,
|
|
234
235
|
s as Suggestion,
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
236
|
+
ao as Switch,
|
|
237
|
+
E as TAY_DREAMBOAT_THEME,
|
|
238
|
+
rm as THEME_TOKEN_VARS,
|
|
238
239
|
lt as TabPanel,
|
|
239
240
|
N as Table,
|
|
240
241
|
Tt as Tabs,
|
|
241
|
-
|
|
242
|
-
|
|
242
|
+
dm as TelemetryGraph,
|
|
243
|
+
Go as TelemetryLog,
|
|
243
244
|
to as Textarea,
|
|
244
245
|
Kt as ThemeLab,
|
|
245
246
|
kt as ThemeLivePreview,
|
|
246
|
-
|
|
247
|
-
|
|
247
|
+
L as ThemeProvider,
|
|
248
|
+
Vt as ThemeSettings,
|
|
248
249
|
Mt as ThemeSynthesizer,
|
|
249
250
|
Dr as TippyTooltip,
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
251
|
+
Pr as Toast,
|
|
252
|
+
Rr as ToastProvider,
|
|
253
|
+
po as ToggleSwitch,
|
|
254
|
+
pe as Toolbar,
|
|
254
255
|
Qe as UserNav,
|
|
255
256
|
Ho as WaterPumpControl,
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
257
|
+
om as applyThemeToDom,
|
|
258
|
+
B as availableThemes,
|
|
259
|
+
ct as badgeVariants,
|
|
260
|
+
Ct as buttonVariants,
|
|
261
|
+
Rt as cn,
|
|
262
|
+
em as contrastRatio,
|
|
263
|
+
Lt as formatValue,
|
|
262
264
|
Yt as generateFromProfile,
|
|
263
265
|
zt as generateFromPrompt,
|
|
264
266
|
Qt as generateRandom,
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
267
|
+
tm as generateRandomTheme,
|
|
268
|
+
Tm as generateThemeFromPrompt,
|
|
269
|
+
mm as getContrastColor,
|
|
270
|
+
am as hexToRgbTriplet,
|
|
269
271
|
Wt as hslToCssString,
|
|
270
272
|
jt as hslToRgb,
|
|
271
273
|
Xt as hslToRgbString,
|
|
272
|
-
|
|
274
|
+
pm as isCustomTheme,
|
|
273
275
|
qt as lightToDark,
|
|
274
|
-
|
|
276
|
+
fm as loadGoogleFont,
|
|
275
277
|
f as mockChartData,
|
|
276
278
|
x as mockTableData,
|
|
277
279
|
Jt as paletteToRgbVars,
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
280
|
+
xm as randomRgb,
|
|
281
|
+
im as relativeLuminance,
|
|
282
|
+
Pm as resolvePreview,
|
|
283
|
+
Io as settleTo,
|
|
284
|
+
nm as tokensToVars,
|
|
285
|
+
go as useBodyScrollLock,
|
|
283
286
|
no as useChartTheme,
|
|
284
287
|
xo as useDataFetch,
|
|
285
|
-
|
|
288
|
+
Ro as useDialogFocus,
|
|
286
289
|
ho as useIsMobile,
|
|
287
290
|
So as useMediaQuery,
|
|
288
|
-
|
|
291
|
+
Po as useSheetGesture,
|
|
289
292
|
M as useTheme,
|
|
290
|
-
|
|
293
|
+
Er as useToast,
|
|
291
294
|
t as wizardManifest
|
|
292
295
|
};
|
|
@@ -8,9 +8,30 @@ interface ChartTheme {
|
|
|
8
8
|
*/
|
|
9
9
|
accentColor: string;
|
|
10
10
|
gridColor: string;
|
|
11
|
+
/** The page background: a plot filled with it sits a shade apart from the card around it, in every theme. */
|
|
12
|
+
backgroundColor: string;
|
|
11
13
|
tooltipBg: string;
|
|
12
14
|
cursorColor: string;
|
|
13
15
|
palette: string[];
|
|
16
|
+
/**
|
|
17
|
+
* The theme's status colours, for zones drawn behind a series (a leverage
|
|
18
|
+
* chart's net-cash to heavy-debt bands). The same tokens as bg-success,
|
|
19
|
+
* bg-warning and bg-destructive, so a chart agrees with the table beside it.
|
|
20
|
+
*/
|
|
21
|
+
status: {
|
|
22
|
+
success: string;
|
|
23
|
+
warning: string;
|
|
24
|
+
danger: string;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* A figure's direction: up or in the black, down or in the red. The same
|
|
28
|
+
* tokens as text-gain-strong and text-loss-strong, and apart from status on
|
|
29
|
+
* purpose: a loss is not an error (AGENTS.md, Semantic styling).
|
|
30
|
+
*/
|
|
31
|
+
direction: {
|
|
32
|
+
gain: string;
|
|
33
|
+
loss: string;
|
|
34
|
+
};
|
|
14
35
|
}
|
|
15
36
|
export declare const useChartTheme: () => ChartTheme;
|
|
16
37
|
export {};
|
|
@@ -1,38 +1,55 @@
|
|
|
1
|
-
import { useState as
|
|
2
|
-
import { useTheme as
|
|
1
|
+
import { useState as l, useEffect as i, useRef as u, useLayoutEffect as b } from "react";
|
|
2
|
+
import { useTheme as m } from "../../contexts/ThemeContext.js";
|
|
3
3
|
const g = [
|
|
4
4
|
"rgb(13, 110, 253)",
|
|
5
5
|
"rgb(23, 162, 184)",
|
|
6
6
|
"rgb(102, 16, 242)",
|
|
7
7
|
"rgb(255, 193, 7)",
|
|
8
8
|
"rgb(220, 53, 69)"
|
|
9
|
-
],
|
|
10
|
-
const
|
|
11
|
-
return
|
|
12
|
-
},
|
|
13
|
-
const
|
|
9
|
+
], t = (r) => {
|
|
10
|
+
const e = r.trim().split(/\s+/);
|
|
11
|
+
return e.length === 3 ? `rgb(${e[0]}, ${e[1]}, ${e[2]})` : `rgb(${r.trim()})`;
|
|
12
|
+
}, n = () => {
|
|
13
|
+
const r = (o) => getComputedStyle(document.documentElement).getPropertyValue(o).trim(), e = r("--app-chart-palette"), c = e ? e.split(",").map(t).filter((o) => /^rgb\(\d+,\s*\d+,\s*\d+\)$/.test(o)) : [], a = c.length >= 2 ? c : g;
|
|
14
|
+
return {
|
|
15
|
+
textColor: t(r("--app-text-color")),
|
|
16
|
+
accentColor: t(r("--app-chart-accent")),
|
|
17
|
+
gridColor: t(r("--app-chart-grid-color")),
|
|
18
|
+
backgroundColor: t(r("--app-bg-color") || "248 249 250"),
|
|
19
|
+
tooltipBg: t(r("--app-card-bg-color")),
|
|
20
|
+
cursorColor: `rgba(${r("--app-bg-color").trim().replace(/\s+/g, ", ")}, 0.5)`,
|
|
21
|
+
palette: a,
|
|
22
|
+
status: {
|
|
23
|
+
success: t(r("--app-success-color") || "21 128 61"),
|
|
24
|
+
warning: t(r("--app-warning-color") || "180 83 9"),
|
|
25
|
+
danger: t(r("--app-danger-color") || "220 53 69")
|
|
26
|
+
},
|
|
27
|
+
direction: {
|
|
28
|
+
gain: t(r("--app-gain-color") || "21 128 61"),
|
|
29
|
+
loss: t(r("--app-loss-color") || "194 65 12")
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
}, C = () => {
|
|
33
|
+
const { theme: r, customTheme: e, isPrinting: c } = m(), [a, o] = l({
|
|
14
34
|
textColor: "rgb(33, 37, 41)",
|
|
15
35
|
accentColor: "rgb(245, 158, 11)",
|
|
16
36
|
gridColor: "rgb(233, 236, 239)",
|
|
37
|
+
backgroundColor: "rgb(248, 249, 250)",
|
|
17
38
|
tooltipBg: "rgb(255, 255, 255)",
|
|
18
39
|
cursorColor: "rgba(0, 0, 0, 0.1)",
|
|
19
|
-
palette: g
|
|
40
|
+
palette: g,
|
|
41
|
+
status: { success: "rgb(21, 128, 61)", warning: "rgb(180, 83, 9)", danger: "rgb(220, 53, 69)" },
|
|
42
|
+
direction: { gain: "rgb(21, 128, 61)", loss: "rgb(194, 65, 12)" }
|
|
20
43
|
});
|
|
21
|
-
|
|
22
|
-
const
|
|
23
|
-
const c = r("--app-chart-palette"), a = c ? c.split(",").map(e).filter((n) => /^rgb\(\d+,\s*\d+,\s*\d+\)$/.test(n)) : [], m = a.length >= 2 ? a : g;
|
|
24
|
-
l({
|
|
25
|
-
textColor: e(r("--app-text-color")),
|
|
26
|
-
accentColor: e(r("--app-chart-accent")),
|
|
27
|
-
gridColor: e(r("--app-chart-grid-color")),
|
|
28
|
-
tooltipBg: e(r("--app-card-bg-color")),
|
|
29
|
-
cursorColor: `rgba(${r("--app-bg-color").trim().replace(/\s+/g, ", ")}, 0.5)`,
|
|
30
|
-
palette: m
|
|
31
|
-
});
|
|
32
|
-
}, 10);
|
|
44
|
+
i(() => {
|
|
45
|
+
const p = setTimeout(() => o(n()), 10);
|
|
33
46
|
return () => clearTimeout(p);
|
|
34
|
-
}, [
|
|
47
|
+
}, [r, e]);
|
|
48
|
+
const s = u(!1);
|
|
49
|
+
return b(() => {
|
|
50
|
+
!c && !s.current || (s.current = !0, o(n()));
|
|
51
|
+
}, [c]), a;
|
|
35
52
|
};
|
|
36
53
|
export {
|
|
37
|
-
|
|
54
|
+
C as useChartTheme
|
|
38
55
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|