@leonardaustin/ui 0.31.0 → 0.32.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.
- package/README.md +2 -0
- package/dist/components/app-shell/Sidebar.js +125 -123
- package/dist/components/app-shell/ThemeMenu.js +44 -42
- package/dist/config/theme.js +49 -7
- package/dist/core.css +120 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +117 -116
- package/dist/providers/SettingsContext.d.ts +1 -1
- package/dist/providers/SettingsProvider.js +4 -2
- package/dist/providers/ThemeContext.d.ts +2 -2
- package/dist/providers/accentColors.d.ts +3 -1
- package/dist/providers/accentColors.js +20 -6
- package/dist/providers/themeClasses.js +2 -0
- package/dist/styles.css +254 -1
- package/dist/themes/studio-dark.css +68 -0
- package/dist/themes/studio-light.css +68 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -21,119 +21,120 @@ import { useAnchoredPopup as R } from "./hooks/useAnchoredPopup.js";
|
|
|
21
21
|
import { useDismiss as z } from "./hooks/useDismiss.js";
|
|
22
22
|
import { SettingsContext as B } from "./providers/SettingsContext.js";
|
|
23
23
|
import { useSettings as V } from "./hooks/useSettings.js";
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
64
|
-
import {
|
|
65
|
-
import {
|
|
66
|
-
import {
|
|
67
|
-
import {
|
|
68
|
-
import {
|
|
69
|
-
import {
|
|
70
|
-
import {
|
|
71
|
-
import {
|
|
72
|
-
import {
|
|
73
|
-
import {
|
|
74
|
-
import {
|
|
75
|
-
import {
|
|
76
|
-
import {
|
|
77
|
-
import {
|
|
78
|
-
import {
|
|
79
|
-
import {
|
|
80
|
-
import {
|
|
81
|
-
import {
|
|
82
|
-
import {
|
|
83
|
-
import {
|
|
84
|
-
import {
|
|
85
|
-
import {
|
|
86
|
-
import {
|
|
87
|
-
import {
|
|
88
|
-
import {
|
|
89
|
-
import {
|
|
90
|
-
import {
|
|
91
|
-
import {
|
|
92
|
-
import {
|
|
93
|
-
import {
|
|
94
|
-
import {
|
|
95
|
-
import {
|
|
96
|
-
import {
|
|
97
|
-
import {
|
|
98
|
-
import {
|
|
99
|
-
import {
|
|
100
|
-
import {
|
|
101
|
-
import {
|
|
102
|
-
import {
|
|
103
|
-
import {
|
|
104
|
-
import {
|
|
105
|
-
import {
|
|
106
|
-
import {
|
|
107
|
-
import {
|
|
108
|
-
import {
|
|
109
|
-
import {
|
|
110
|
-
import {
|
|
111
|
-
import {
|
|
112
|
-
import {
|
|
113
|
-
import {
|
|
114
|
-
import {
|
|
115
|
-
import {
|
|
116
|
-
import {
|
|
117
|
-
import {
|
|
118
|
-
import {
|
|
119
|
-
import {
|
|
120
|
-
import {
|
|
121
|
-
import {
|
|
122
|
-
import {
|
|
123
|
-
import {
|
|
124
|
-
import {
|
|
125
|
-
import {
|
|
126
|
-
import {
|
|
127
|
-
import {
|
|
128
|
-
import {
|
|
129
|
-
import {
|
|
130
|
-
import {
|
|
131
|
-
import {
|
|
132
|
-
import {
|
|
133
|
-
import {
|
|
134
|
-
import {
|
|
135
|
-
import {
|
|
136
|
-
import {
|
|
137
|
-
import {
|
|
138
|
-
import {
|
|
139
|
-
|
|
24
|
+
import { usesThemeAccent as H } from "./providers/accentColors.js";
|
|
25
|
+
import { Avatar as U } from "./components/ui/Avatar.js";
|
|
26
|
+
import { isTone as W, semanticTones as G, toneClasses as K, toneColor as q, tones as J } from "./lib/tones.js";
|
|
27
|
+
import { ToastProvider as Y, useToast as X } from "./components/ui/Toast.js";
|
|
28
|
+
import { Sidebar as Z } from "./components/app-shell/Sidebar.js";
|
|
29
|
+
import { Breadcrumbs as Q } from "./components/app-shell/Breadcrumbs.js";
|
|
30
|
+
import { useApplyTheme as $ } from "./hooks/useApplyTheme.js";
|
|
31
|
+
import { useControlSize as ee } from "./providers/ControlSizeContext.js";
|
|
32
|
+
import { Button as te } from "./components/ui/Button.js";
|
|
33
|
+
import { SectionHeader as ne } from "./components/ui/SectionHeader.js";
|
|
34
|
+
import { usePopover as re } from "./hooks/usePopover.js";
|
|
35
|
+
import { SelectDropdown as ie } from "./components/ui/SelectDropdown.js";
|
|
36
|
+
import { Slider as ae } from "./components/ui/Slider.js";
|
|
37
|
+
import { ThemePreview as oe } from "./components/ui/ThemePreview.js";
|
|
38
|
+
import { Toggle as se } from "./components/ui/Toggle.js";
|
|
39
|
+
import { THEME_MENU_EVENT as ce, openThemeMenu as le } from "./components/app-shell/themeMenuEvents.js";
|
|
40
|
+
import { ThemeMenu as ue } from "./components/app-shell/ThemeMenu.js";
|
|
41
|
+
import { TopBar as de } from "./components/app-shell/TopBar.js";
|
|
42
|
+
import { AppShell as fe } from "./components/app-shell/AppShell.js";
|
|
43
|
+
import { AuthLayout as pe } from "./components/app-shell/AuthLayout.js";
|
|
44
|
+
import { BackLink as me } from "./components/app-shell/BackLink.js";
|
|
45
|
+
import { Checkbox as he } from "./components/ui/Checkbox.js";
|
|
46
|
+
import { FilterButton as ge } from "./components/ui/FilterButton.js";
|
|
47
|
+
import { ColumnPicker as _e } from "./components/tables/ColumnPicker.js";
|
|
48
|
+
import { Pagination as ve } from "./components/tables/Pagination.js";
|
|
49
|
+
import { sortRows as ye } from "./components/tables/sortRows.js";
|
|
50
|
+
import { ResourceTable as be } from "./components/tables/ResourceTable.js";
|
|
51
|
+
import { Disclosure as xe } from "./components/ui/Disclosure.js";
|
|
52
|
+
import { Accordion as Se } from "./components/ui/Accordion.js";
|
|
53
|
+
import { Alert as Ce } from "./components/ui/Alert.js";
|
|
54
|
+
import { AudioPlayer as we } from "./components/ui/AudioPlayer.js";
|
|
55
|
+
import { AuthCard as Te } from "./components/ui/AuthCard.js";
|
|
56
|
+
import { AuthorByline as Ee } from "./components/ui/AuthorByline.js";
|
|
57
|
+
import { Badge as De } from "./components/ui/Badge.js";
|
|
58
|
+
import { badgeColors as Oe } from "./components/ui/badgeColors.js";
|
|
59
|
+
import { addDays as ke, addMinutes as Ae, addMonths as je, calendarDateFromParts as Me, calendarDateParts as Ne, createCalendarDateMath as Pe, dateAtMinutes as Fe, differenceInDays as Ie, expandAvailabilityRules as Le, formatRangeTitle as Re, formatTime as ze, formatTimeOfDay as Be, formatTimeRange as Ve, fromDateKey as He, getActiveResourceIds as Ue, getViewRange as We, getVisibleDays as Ge, isAllDayLike as Ke, isSameDay as qe, isTimeGridView as Je, layoutOverlaps as Ye, minutesOfDay as Xe, parseTime as Ze, rangesOverlap as Qe, shiftDate as $e, snapDate as et, snapMinutes as tt, startOfDay as nt, startOfMonth as rt, startOfWeek as it, toDateKey as at } from "./lib/calendar.js";
|
|
60
|
+
import { DEFAULT_CALENDAR_LABELS as ot } from "./components/ui/calendar/types.js";
|
|
61
|
+
import { RadioPill as st } from "./components/ui/RadioPill.js";
|
|
62
|
+
import { Calendar as ct } from "./components/ui/Calendar.js";
|
|
63
|
+
import { CalendarGrid as lt } from "./components/ui/CalendarGrid.js";
|
|
64
|
+
import { Card as ut } from "./components/ui/Card.js";
|
|
65
|
+
import { CodeInput as dt } from "./components/ui/CodeInput.js";
|
|
66
|
+
import { Combobox as ft } from "./components/ui/Combobox.js";
|
|
67
|
+
import { CopyButton as pt } from "./components/ui/CopyButton.js";
|
|
68
|
+
import { DangerZone as mt } from "./components/ui/DangerZone.js";
|
|
69
|
+
import { DatePicker as ht } from "./components/ui/DatePicker.js";
|
|
70
|
+
import { DateRangePicker as gt } from "./components/ui/DateRangePicker.js";
|
|
71
|
+
import { DateTimePicker as _t } from "./components/ui/DateTimePicker.js";
|
|
72
|
+
import { DetailPanel as vt } from "./components/ui/DetailPanel.js";
|
|
73
|
+
import { Dialog as yt } from "./components/ui/Dialog.js";
|
|
74
|
+
import { DialogActions as bt } from "./components/ui/DialogActions.js";
|
|
75
|
+
import { DividerLabel as xt } from "./components/ui/DividerLabel.js";
|
|
76
|
+
import { DropdownMenu as St } from "./components/ui/DropdownMenu.js";
|
|
77
|
+
import { EmptyState as Ct } from "./components/ui/EmptyState.js";
|
|
78
|
+
import { ErrorBoundary as wt } from "./components/ui/ErrorBoundary.js";
|
|
79
|
+
import { FilterDropdown as Tt } from "./components/ui/FilterDropdown.js";
|
|
80
|
+
import { Kbd as Et } from "./components/ui/Kbd.js";
|
|
81
|
+
import { LoadingSpinner as Dt } from "./components/ui/LoadingSpinner.js";
|
|
82
|
+
import { ListItemLink as Ot } from "./components/ui/ListItemLink.js";
|
|
83
|
+
import { MessageBubble as kt } from "./components/ui/MessageBubble.js";
|
|
84
|
+
import { MetadataGrid as At } from "./components/ui/MetadataGrid.js";
|
|
85
|
+
import { MetricCard as jt } from "./components/ui/MetricCard.js";
|
|
86
|
+
import { OAuthButton as Mt } from "./components/ui/OAuthButton.js";
|
|
87
|
+
import { OverlineLabel as Nt } from "./components/ui/OverlineLabel.js";
|
|
88
|
+
import { PageHeader as Pt } from "./components/ui/PageHeader.js";
|
|
89
|
+
import { PageSection as Ft } from "./components/ui/PageSection.js";
|
|
90
|
+
import { PaginationBar as It } from "./components/ui/PaginationBar.js";
|
|
91
|
+
import { PasswordInput as Lt } from "./components/ui/PasswordInput.js";
|
|
92
|
+
import { defaultPasswordRequirements as Rt, meetsPasswordRequirements as zt } from "./lib/passwordRequirements.js";
|
|
93
|
+
import { PasswordRequirements as Bt } from "./components/ui/PasswordRequirements.js";
|
|
94
|
+
import { Popover as Vt } from "./components/ui/Popover.js";
|
|
95
|
+
import { ProfileHeader as Ht } from "./components/ui/ProfileHeader.js";
|
|
96
|
+
import { ProseContent as Ut } from "./components/ui/ProseContent.js";
|
|
97
|
+
import { QrCapacityError as Wt, encodeQrCode as Gt } from "./lib/qrCode.js";
|
|
98
|
+
import { QrCode as Kt } from "./components/ui/QrCode.js";
|
|
99
|
+
import { ReorderList as qt } from "./components/ui/ReorderList.js";
|
|
100
|
+
import { SearchInput as Jt } from "./components/ui/SearchInput.js";
|
|
101
|
+
import { Select as Yt } from "./components/ui/Select.js";
|
|
102
|
+
import { SettingRow as Xt } from "./components/ui/SettingRow.js";
|
|
103
|
+
import { SideSheet as Zt } from "./components/ui/SideSheet.js";
|
|
104
|
+
import { SplitPaneLayout as Qt } from "./components/ui/SplitPaneLayout.js";
|
|
105
|
+
import { StatusDot as $t } from "./components/ui/StatusDot.js";
|
|
106
|
+
import { StepProgress as en } from "./components/ui/StepProgress.js";
|
|
107
|
+
import { Tabs as tn } from "./components/ui/Tabs.js";
|
|
108
|
+
import { Textarea as nn } from "./components/ui/Textarea.js";
|
|
109
|
+
import { TextInput as rn } from "./components/ui/TextInput.js";
|
|
110
|
+
import { TimeInput as an } from "./components/ui/TimeInput.js";
|
|
111
|
+
import { Timeline as on } from "./components/ui/Timeline.js";
|
|
112
|
+
import { TranscriptLine as sn } from "./components/ui/TranscriptLine.js";
|
|
113
|
+
import { Tooltip as cn } from "./components/ui/Tooltip.js";
|
|
114
|
+
import { Toolbar as ln } from "./components/ui/Toolbar.js";
|
|
115
|
+
import { UploadDropzone as un } from "./components/ui/UploadDropzone.js";
|
|
116
|
+
import { ThemeContext as dn } from "./providers/ThemeContext.js";
|
|
117
|
+
import { useTheme as fn } from "./hooks/useTheme.js";
|
|
118
|
+
import { formatDateLong as pn, formatDateShort as mn, formatRelative as hn } from "./lib/formatDate.js";
|
|
119
|
+
import { SettingsProvider as gn } from "./providers/SettingsProvider.js";
|
|
120
|
+
import { ThemeProvider as _n } from "./providers/ThemeProvider.js";
|
|
121
|
+
import { FieldError as vn, FieldHint as yn, FormField as bn } from "./components/ui/FormField.js";
|
|
122
|
+
import { Fieldset as xn } from "./components/ui/Fieldset.js";
|
|
123
|
+
import { Radio as Sn } from "./components/ui/Radio.js";
|
|
124
|
+
import { AttachmentItem as Cn, AttachmentList as wn } from "./components/ui/AttachmentList.js";
|
|
125
|
+
import { DatePartsInput as Tn } from "./components/ui/DatePartsInput.js";
|
|
126
|
+
import { Skeleton as En } from "./components/ui/Skeleton.js";
|
|
127
|
+
import { NavTabs as Dn } from "./components/ui/NavTabs.js";
|
|
128
|
+
import { CharacterCount as On } from "./components/ui/CharacterCount.js";
|
|
129
|
+
import { ControlSizeProvider as kn } from "./providers/ControlSizeProvider.js";
|
|
130
|
+
import { ProgressBar as An } from "./components/ui/ProgressBar.js";
|
|
131
|
+
import { Stack as jn } from "./components/ui/Stack.js";
|
|
132
|
+
import { Inline as Mn } from "./components/ui/Inline.js";
|
|
133
|
+
import { Grid as Nn } from "./components/ui/Grid.js";
|
|
134
|
+
import { GridItem as Pn } from "./components/ui/GridItem.js";
|
|
135
|
+
import { MainAsideLayout as Fn } from "./components/ui/MainAsideLayout.js";
|
|
136
|
+
import { ActionLink as In } from "./components/ui/ActionLink.js";
|
|
137
|
+
import { Icon as Ln } from "./components/ui/Icon.js";
|
|
138
|
+
import { Text as Rn } from "./components/ui/Text.js";
|
|
139
|
+
import { Meter as zn } from "./components/ui/Meter.js";
|
|
140
|
+
export { Se as Accordion, In as ActionLink, Ce as Alert, fe as AppShell, t as AreaChart, Cn as AttachmentItem, wn as AttachmentList, we as AudioPlayer, Te as AuthCard, pe as AuthLayout, Ee as AuthorByline, U as Avatar, me as BackLink, De as Badge, n as BarChart, x as BottomNav, Q as Breadcrumbs, te as Button, C as COMMAND_PALETTE_EVENT, ct as Calendar, lt as CalendarGrid, ut as Card, On as CharacterCount, he as Checkbox, dt as CodeInput, _e as ColumnPicker, ft as Combobox, D as CommandPalette, kn as ControlSizeProvider, pt as CopyButton, ot as DEFAULT_CALENDAR_LABELS, w as DEFAULT_COMMAND_PALETTE_SHORTCUT, mt as DangerZone, Tn as DatePartsInput, ht as DatePicker, gt as DateRangePicker, _t as DateTimePicker, vt as DetailPanel, yt as Dialog, bt as DialogActions, xe as Disclosure, xt as DividerLabel, r as DonutChart, St as DropdownMenu, Ct as EmptyState, wt as ErrorBoundary, vn as FieldError, yn as FieldHint, xn as Fieldset, ge as FilterButton, Tt as FilterDropdown, bn as FormField, Nn as Grid, Pn as GridItem, f as Heatmap, Ln as Icon, Mn as Inline, Et as Kbd, Ot as ListItemLink, Dt as LoadingSpinner, Fn as MainAsideLayout, kt as MessageBubble, At as MetadataGrid, zn as Meter, jt as MetricCard, A as MobileDrawer, Dn as NavTabs, Mt as OAuthButton, Nt as OverlineLabel, Pt as PageHeader, Ft as PageSection, ve as Pagination, It as PaginationBar, Lt as PasswordInput, Bt as PasswordRequirements, Vt as Popover, O as PortalContainerContext, Ht as ProfileHeader, An as ProgressBar, Ut as ProseContent, Wt as QrCapacityError, Kt as QrCode, p as RadarChart, m as RadialBarChart, Sn as Radio, st as RadioPill, qt as ReorderList, be as ResourceTable, Jt as SearchInput, ne as SectionHeader, Yt as Select, ie as SelectDropdown, Xt as SettingRow, B as SettingsContext, gn as SettingsProvider, Zt as SideSheet, Z as Sidebar, En as Skeleton, ae as Slider, h as SparkLine, Qt as SplitPaneLayout, jn as Stack, g as StackedBarChart, $t as StatusDot, en as StepProgress, ce as THEME_MENU_EVENT, i as Table, a as TableBody, o as TableCell, s as TableEmptyRow, c as TableFoot, l as TableHead, u as TableHeaderCell, d as TableRow, tn as Tabs, Rn as Text, rn as TextInput, nn as Textarea, dn as ThemeContext, ue as ThemeMenu, oe as ThemePreview, _n as ThemeProvider, an as TimeInput, on as Timeline, Y as ToastProvider, se as Toggle, ln as Toolbar, cn as Tooltip, de as TopBar, sn as TranscriptLine, un as UploadDropzone, _ as VerticalBarChart, j as accentItems, ke as addDays, Ae as addMinutes, je as addMonths, Oe as badgeColors, Me as calendarDateFromParts, Ne as calendarDateParts, e as cn, Pe as createCalendarDateMath, M as darkThemes, Fe as dateAtMinutes, Rt as defaultPasswordRequirements, Ie as differenceInDays, Gt as encodeQrCode, Le as expandAvailabilityRules, N as fontOptions, pn as formatDateLong, mn as formatDateShort, Re as formatRangeTitle, hn as formatRelative, ze as formatTime, Be as formatTimeOfDay, Ve as formatTimeRange, He as fromDateKey, Ue as getActiveResourceIds, We as getViewRange, Ge as getVisibleDays, v as handleAppShellNavigate, Ke as isAllDayLike, y as isAppShellPathActive, P as isLightTheme, qe as isSameDay, Je as isTimeGridView, W as isTone, Ye as layoutOverlaps, F as lightThemes, T as matchesCommandPaletteShortcut, zt as meetsPasswordRequirements, Xe as minutesOfDay, b as navigateToPath, E as openCommandPalette, le as openThemeMenu, Ze as parseTime, Qe as rangesOverlap, G as semanticTones, $e as shiftDate, et as snapDate, tt as snapMinutes, ye as sortRows, nt as startOfDay, rt as startOfMonth, it as startOfWeek, I as themeDefaults, L as themeItems, at as toDateKey, K as toneClasses, q as toneColor, J as tones, R as useAnchoredPopup, $ as useApplyTheme, ee as useControlSize, z as useDismiss, S as useFocusTrap, re as usePopover, k as usePortalContainer, V as useSettings, fn as useTheme, X as useToast, H as usesThemeAccent };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { DarkTheme, LightTheme, Theme } from "./ThemeContext";
|
|
2
2
|
export type ColorMode = "light" | "dark" | "system";
|
|
3
3
|
export type AccentColor = "purple" | "blue" | "green" | "teal" | "orange" | "red" | "pink" | "indigo";
|
|
4
|
-
export type FontFamily = "archivo-expanded" | "inter" | "jetbrains-mono" | "pt-serif" | "system";
|
|
4
|
+
export type FontFamily = "archivo-expanded" | "inter" | "jetbrains-mono" | "pt-serif" | "native" | "system-mono" | "system";
|
|
5
5
|
export interface SettingsContextValue {
|
|
6
6
|
fontSize: number;
|
|
7
7
|
setFontSize: (size: number) => void;
|
|
@@ -10,6 +10,8 @@ var d = {
|
|
|
10
10
|
inter: "\"Inter\", system-ui, -apple-system, BlinkMacSystemFont, sans-serif",
|
|
11
11
|
"jetbrains-mono": "\"JetBrains Mono\", Menlo, Monaco, Consolas, monospace",
|
|
12
12
|
"pt-serif": "\"PT Serif\", Georgia, ui-serif, Cambria, \"Times New Roman\", Times, serif",
|
|
13
|
+
native: "-apple-system, BlinkMacSystemFont, \"SF Pro Text\", system-ui, sans-serif",
|
|
14
|
+
"system-mono": "\"SF Mono\", ui-monospace, Menlo, monospace",
|
|
13
15
|
system: "system-ui, -apple-system, BlinkMacSystemFont, sans-serif"
|
|
14
16
|
}, f = "leonardaustin-ui-settings", p = new Set(Object.keys(n)), m = new Set(Object.keys(d)), h = new Set([
|
|
15
17
|
"light",
|
|
@@ -116,8 +118,8 @@ function S({ children: e, storageKey: t = f, initialSettings: i, forcedTheme: p
|
|
|
116
118
|
});
|
|
117
119
|
}, [t]);
|
|
118
120
|
s(() => {
|
|
119
|
-
a(document.documentElement.style, m.accentColor);
|
|
120
|
-
}, [m.accentColor]), s(() => {
|
|
121
|
+
a(document.documentElement.style, m.accentColor, v);
|
|
122
|
+
}, [m.accentColor, v]), s(() => {
|
|
121
123
|
document.documentElement.classList.toggle("reduced-motion", m.reducedMotion);
|
|
122
124
|
}, [m.reducedMotion]), s(() => {
|
|
123
125
|
let e = document.documentElement, t = S.borderRadius;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export type DarkTheme = "dark" | "monokai" | "solarized" | "cyberBrutalDark" | "glassDark";
|
|
2
|
-
export type LightTheme = "light" | "lightInverted" | "cyberBrutalLight" | "hashiTheme" | "glassLight";
|
|
1
|
+
export type DarkTheme = "dark" | "monokai" | "solarized" | "cyberBrutalDark" | "glassDark" | "studioDark";
|
|
2
|
+
export type LightTheme = "light" | "lightInverted" | "cyberBrutalLight" | "hashiTheme" | "glassLight" | "studioLight";
|
|
3
3
|
export type Theme = DarkTheme | LightTheme;
|
|
4
4
|
export interface ThemeContextValue {
|
|
5
5
|
theme: Theme;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import type { AccentColor } from "./SettingsContext";
|
|
2
|
+
import type { Theme } from "./ThemeContext";
|
|
2
3
|
export declare const VALID_ACCENTS: Set<string>;
|
|
3
|
-
export declare function
|
|
4
|
+
export declare function usesThemeAccent(theme?: Theme): theme is "studioDark" | "studioLight";
|
|
5
|
+
export declare function applyAccentColors(style: CSSStyleDeclaration, accent: AccentColor, theme?: Theme): void;
|
|
@@ -65,11 +65,25 @@ var e = {
|
|
|
65
65
|
subtle: "rgba(99,102,241,0.08)"
|
|
66
66
|
}
|
|
67
67
|
}, t = new Set(Object.keys(e));
|
|
68
|
-
function n(
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
68
|
+
function n(e) {
|
|
69
|
+
return e === "studioLight" || e === "studioDark";
|
|
70
|
+
}
|
|
71
|
+
function r(t, r, i) {
|
|
72
|
+
if (n(i)) {
|
|
73
|
+
for (let e of [
|
|
74
|
+
"--accent",
|
|
75
|
+
"--text-on-accent",
|
|
76
|
+
"--accent-hover",
|
|
77
|
+
"--accent-active",
|
|
78
|
+
"--accent-muted",
|
|
79
|
+
"--accent-subtle"
|
|
80
|
+
]) t.removeProperty(e);
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
let a = e[r];
|
|
84
|
+
t.setProperty("--accent", a.base), t.setProperty("--text-on-accent", a.onAccent);
|
|
85
|
+
let o = a.onAccent === "#ffffff";
|
|
86
|
+
t.setProperty("--accent-hover", o ? a.hover : `var(--glass-accent-hover, ${a.hover})`), t.setProperty("--accent-active", o ? a.active : `var(--glass-accent-active, ${a.active})`), t.setProperty("--accent-muted", a.muted), t.setProperty("--accent-subtle", a.subtle);
|
|
73
87
|
}
|
|
74
88
|
//#endregion
|
|
75
|
-
export { t as VALID_ACCENTS,
|
|
89
|
+
export { t as VALID_ACCENTS, r as applyAccentColors, n as usesThemeAccent };
|
|
@@ -8,7 +8,9 @@ var e = {
|
|
|
8
8
|
cyberBrutalDark: ["theme-cyber-brutal-dark"],
|
|
9
9
|
cyberBrutalLight: ["theme-cyber-brutal-light"],
|
|
10
10
|
hashiTheme: ["theme-hashi"],
|
|
11
|
+
studioDark: ["theme-studio-dark"],
|
|
11
12
|
glassDark: ["theme-glass", "theme-glass-dark"],
|
|
13
|
+
studioLight: ["theme-studio-light"],
|
|
12
14
|
glassLight: ["theme-glass", "theme-glass-light"]
|
|
13
15
|
}, t = [...new Set(Object.values(e).flat())];
|
|
14
16
|
function n(n, r) {
|