tuiuiu.js 1.0.4 → 1.0.6-next.4ff3fbc
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/dist/app/render-loop.d.ts +2 -0
- package/dist/app/render-loop.d.ts.map +1 -1
- package/dist/app/render-loop.js +14 -3
- package/dist/app/render-loop.js.map +1 -1
- package/dist/atoms/button.d.ts +1 -1
- package/dist/atoms/button.d.ts.map +1 -1
- package/dist/atoms/button.js +13 -11
- package/dist/atoms/button.js.map +1 -1
- package/dist/atoms/progress-bar.d.ts.map +1 -1
- package/dist/atoms/progress-bar.js +15 -12
- package/dist/atoms/progress-bar.js.map +1 -1
- package/dist/atoms/scrollbar.d.ts +30 -0
- package/dist/atoms/scrollbar.d.ts.map +1 -0
- package/dist/atoms/scrollbar.js +46 -0
- package/dist/atoms/scrollbar.js.map +1 -0
- package/dist/atoms/slider.js +6 -6
- package/dist/atoms/slider.js.map +1 -1
- package/dist/atoms/spinner.d.ts.map +1 -1
- package/dist/atoms/spinner.js +3 -2
- package/dist/atoms/spinner.js.map +1 -1
- package/dist/atoms/switch.d.ts.map +1 -1
- package/dist/atoms/switch.js +3 -2
- package/dist/atoms/switch.js.map +1 -1
- package/dist/atoms/text-input.d.ts.map +1 -1
- package/dist/atoms/text-input.js +6 -5
- package/dist/atoms/text-input.js.map +1 -1
- package/dist/atoms/timer.d.ts +1 -1
- package/dist/atoms/timer.js +4 -4
- package/dist/atoms/timer.js.map +1 -1
- package/dist/atoms/tooltip.d.ts +4 -4
- package/dist/atoms/tooltip.js +19 -19
- package/dist/atoms/tooltip.js.map +1 -1
- package/dist/core/delta-render.d.ts.map +1 -1
- package/dist/core/delta-render.js +17 -12
- package/dist/core/delta-render.js.map +1 -1
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +15 -3
- package/dist/core/index.js.map +1 -1
- package/dist/core/renderer.d.ts +4 -2
- package/dist/core/renderer.d.ts.map +1 -1
- package/dist/core/renderer.js +70 -43
- package/dist/core/renderer.js.map +1 -1
- package/dist/core/theme-loader.d.ts +89 -0
- package/dist/core/theme-loader.d.ts.map +1 -0
- package/dist/core/theme-loader.js +228 -0
- package/dist/core/theme-loader.js.map +1 -0
- package/dist/core/theme-types.d.ts +577 -0
- package/dist/core/theme-types.d.ts.map +1 -0
- package/dist/core/theme-types.js +13 -0
- package/dist/core/theme-types.js.map +1 -0
- package/dist/core/theme.d.ts +155 -236
- package/dist/core/theme.d.ts.map +1 -1
- package/dist/core/theme.js +418 -709
- package/dist/core/theme.js.map +1 -1
- package/dist/design-system/core/renderer.d.ts +14 -3
- package/dist/design-system/core/renderer.d.ts.map +1 -1
- package/dist/design-system/core/renderer.js +77 -38
- package/dist/design-system/core/renderer.js.map +1 -1
- package/dist/design-system/feedback/badge.d.ts +2 -8
- package/dist/design-system/feedback/badge.d.ts.map +1 -1
- package/dist/design-system/feedback/badge.js +32 -8
- package/dist/design-system/feedback/badge.js.map +1 -1
- package/dist/design-system/feedback/progress-bar.d.ts.map +1 -1
- package/dist/design-system/feedback/progress-bar.js +15 -12
- package/dist/design-system/feedback/progress-bar.js.map +1 -1
- package/dist/design-system/feedback/spinner.d.ts.map +1 -1
- package/dist/design-system/feedback/spinner.js +4 -3
- package/dist/design-system/feedback/spinner.js.map +1 -1
- package/dist/design-system/feedback/timer.js +3 -3
- package/dist/design-system/feedback/timer.js.map +1 -1
- package/dist/design-system/layout/app.js +6 -6
- package/dist/design-system/layout/app.js.map +1 -1
- package/dist/design-system/navigation/file-manager.js +15 -15
- package/dist/design-system/navigation/file-manager.js.map +1 -1
- package/dist/design-system/visual/big-text.js +6 -6
- package/dist/design-system/visual/big-text.js.map +1 -1
- package/dist/design-system/visual/digits.js +7 -7
- package/dist/design-system/visual/digits.js.map +1 -1
- package/dist/design-system/visual/splash-screen.d.ts.map +1 -1
- package/dist/design-system/visual/splash-screen.js +23 -17
- package/dist/design-system/visual/splash-screen.js.map +1 -1
- package/dist/design-system/visual/tooltip.js +16 -16
- package/dist/design-system/visual/tooltip.js.map +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/types.d.ts +2 -0
- package/dist/hooks/types.d.ts.map +1 -1
- package/dist/hooks/use-app.d.ts +5 -0
- package/dist/hooks/use-app.d.ts.map +1 -1
- package/dist/hooks/use-app.js +10 -0
- package/dist/hooks/use-app.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -3
- package/dist/index.js.map +1 -1
- package/dist/mcp/docs-data.d.ts.map +1 -1
- package/dist/mcp/docs-data.js +625 -28
- package/dist/mcp/docs-data.js.map +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/molecules/autocomplete.js +10 -10
- package/dist/molecules/autocomplete.js.map +1 -1
- package/dist/molecules/calendar.d.ts.map +1 -1
- package/dist/molecules/calendar.js +13 -12
- package/dist/molecules/calendar.js.map +1 -1
- package/dist/molecules/code-block.js +21 -21
- package/dist/molecules/code-block.js.map +1 -1
- package/dist/molecules/collapsible.d.ts +9 -5
- package/dist/molecules/collapsible.d.ts.map +1 -1
- package/dist/molecules/collapsible.js +39 -7
- package/dist/molecules/collapsible.js.map +1 -1
- package/dist/molecules/data-viz/bar-chart.js +8 -8
- package/dist/molecules/data-viz/bar-chart.js.map +1 -1
- package/dist/molecules/data-viz/gauge.d.ts.map +1 -1
- package/dist/molecules/data-viz/gauge.js +17 -17
- package/dist/molecules/data-viz/gauge.js.map +1 -1
- package/dist/molecules/data-viz/heatmap.js +11 -11
- package/dist/molecules/data-viz/heatmap.js.map +1 -1
- package/dist/molecules/data-viz/legend.js +3 -3
- package/dist/molecules/data-viz/legend.js.map +1 -1
- package/dist/molecules/data-viz/line-chart.js +4 -4
- package/dist/molecules/data-viz/line-chart.js.map +1 -1
- package/dist/molecules/data-viz/sparkline.js +1 -1
- package/dist/molecules/data-viz/sparkline.js.map +1 -1
- package/dist/molecules/markdown.js +23 -23
- package/dist/molecules/markdown.js.map +1 -1
- package/dist/molecules/multi-select.js +9 -9
- package/dist/molecules/multi-select.js.map +1 -1
- package/dist/molecules/radio-group.js +8 -8
- package/dist/molecules/radio-group.js.map +1 -1
- package/dist/molecules/select.d.ts.map +1 -1
- package/dist/molecules/select.js +15 -13
- package/dist/molecules/select.js.map +1 -1
- package/dist/molecules/table.js +3 -3
- package/dist/molecules/table.js.map +1 -1
- package/dist/molecules/tabs.d.ts +6 -2
- package/dist/molecules/tabs.d.ts.map +1 -1
- package/dist/molecules/tabs.js +25 -13
- package/dist/molecules/tabs.js.map +1 -1
- package/dist/molecules/tree.js +5 -5
- package/dist/molecules/tree.js.map +1 -1
- package/dist/organisms/command-palette.d.ts.map +1 -1
- package/dist/organisms/command-palette.js +19 -17
- package/dist/organisms/command-palette.js.map +1 -1
- package/dist/organisms/data-table.js +5 -5
- package/dist/organisms/data-table.js.map +1 -1
- package/dist/organisms/file-browser.js +15 -15
- package/dist/organisms/file-browser.js.map +1 -1
- package/dist/organisms/index.d.ts +2 -1
- package/dist/organisms/index.d.ts.map +1 -1
- package/dist/organisms/index.js +13 -1
- package/dist/organisms/index.js.map +1 -1
- package/dist/organisms/modal.d.ts +46 -0
- package/dist/organisms/modal.d.ts.map +1 -1
- package/dist/organisms/modal.js +110 -29
- package/dist/organisms/modal.js.map +1 -1
- package/dist/organisms/scroll-area.js +6 -6
- package/dist/organisms/scroll-area.js.map +1 -1
- package/dist/organisms/scroll-list.d.ts +168 -0
- package/dist/organisms/scroll-list.d.ts.map +1 -0
- package/dist/organisms/scroll-list.js +338 -0
- package/dist/organisms/scroll-list.js.map +1 -0
- package/dist/organisms/split-panel.d.ts.map +1 -1
- package/dist/organisms/split-panel.js +7 -4
- package/dist/organisms/split-panel.js.map +1 -1
- package/dist/primitives/divider.d.ts.map +1 -1
- package/dist/primitives/divider.js +4 -3
- package/dist/primitives/divider.js.map +1 -1
- package/dist/primitives/index.d.ts +1 -0
- package/dist/primitives/index.d.ts.map +1 -1
- package/dist/primitives/index.js +1 -0
- package/dist/primitives/index.js.map +1 -1
- package/dist/primitives/nodes.d.ts.map +1 -1
- package/dist/primitives/nodes.js +5 -3
- package/dist/primitives/nodes.js.map +1 -1
- package/dist/primitives/scroll.d.ts +127 -0
- package/dist/primitives/scroll.d.ts.map +1 -0
- package/dist/primitives/scroll.js +202 -0
- package/dist/primitives/scroll.js.map +1 -0
- package/dist/storybook/app.d.ts.map +1 -1
- package/dist/storybook/app.js +218 -84
- package/dist/storybook/app.js.map +1 -1
- package/dist/storybook/components/compare-view.d.ts.map +1 -1
- package/dist/storybook/components/compare-view.js +25 -19
- package/dist/storybook/components/compare-view.js.map +1 -1
- package/dist/storybook/components/hotkeys-panel.d.ts +12 -0
- package/dist/storybook/components/hotkeys-panel.d.ts.map +1 -0
- package/dist/storybook/components/hotkeys-panel.js +44 -0
- package/dist/storybook/components/hotkeys-panel.js.map +1 -0
- package/dist/storybook/components/index.d.ts +6 -0
- package/dist/storybook/components/index.d.ts.map +1 -1
- package/dist/storybook/components/index.js +9 -0
- package/dist/storybook/components/index.js.map +1 -1
- package/dist/storybook/components/log-viewer.d.ts +9 -4
- package/dist/storybook/components/log-viewer.d.ts.map +1 -1
- package/dist/storybook/components/log-viewer.js +97 -35
- package/dist/storybook/components/log-viewer.js.map +1 -1
- package/dist/storybook/components/navbar.d.ts +17 -0
- package/dist/storybook/components/navbar.d.ts.map +1 -0
- package/dist/storybook/components/navbar.js +52 -0
- package/dist/storybook/components/navbar.js.map +1 -0
- package/dist/storybook/components/pressed-keys.d.ts +29 -0
- package/dist/storybook/components/pressed-keys.d.ts.map +1 -0
- package/dist/storybook/components/pressed-keys.js +148 -0
- package/dist/storybook/components/pressed-keys.js.map +1 -0
- package/dist/storybook/components/preview.d.ts.map +1 -1
- package/dist/storybook/components/preview.js +44 -34
- package/dist/storybook/components/preview.js.map +1 -1
- package/dist/storybook/components/search-bar.d.ts +29 -0
- package/dist/storybook/components/search-bar.d.ts.map +1 -0
- package/dist/storybook/components/search-bar.js +101 -0
- package/dist/storybook/components/search-bar.js.map +1 -0
- package/dist/storybook/components/sidebar.d.ts.map +1 -1
- package/dist/storybook/components/sidebar.js +27 -21
- package/dist/storybook/components/sidebar.js.map +1 -1
- package/dist/storybook/components/status-bar.d.ts +22 -0
- package/dist/storybook/components/status-bar.d.ts.map +1 -0
- package/dist/storybook/components/status-bar.js +64 -0
- package/dist/storybook/components/status-bar.js.map +1 -0
- package/dist/storybook/store.d.ts +13 -1
- package/dist/storybook/store.d.ts.map +1 -1
- package/dist/storybook/store.js +21 -1
- package/dist/storybook/store.js.map +1 -1
- package/dist/storybook/stories/apps/index.d.ts.map +1 -1
- package/dist/storybook/stories/apps/index.js +82 -147
- package/dist/storybook/stories/apps/index.js.map +1 -1
- package/dist/storybook/stories/atoms/index.d.ts.map +1 -1
- package/dist/storybook/stories/atoms/index.js +57 -52
- package/dist/storybook/stories/atoms/index.js.map +1 -1
- package/dist/storybook/stories/molecules/index.d.ts +16 -0
- package/dist/storybook/stories/molecules/index.d.ts.map +1 -1
- package/dist/storybook/stories/molecules/index.js +299 -91
- package/dist/storybook/stories/molecules/index.js.map +1 -1
- package/dist/storybook/stories/organisms/index.d.ts.map +1 -1
- package/dist/storybook/stories/organisms/index.js +207 -120
- package/dist/storybook/stories/organisms/index.js.map +1 -1
- package/dist/templates/app.d.ts +28 -23
- package/dist/templates/app.d.ts.map +1 -1
- package/dist/templates/app.js +104 -17
- package/dist/templates/app.js.map +1 -1
- package/dist/themes/catppuccin.theme.d.ts +8 -0
- package/dist/themes/catppuccin.theme.d.ts.map +1 -0
- package/dist/themes/catppuccin.theme.js +538 -0
- package/dist/themes/catppuccin.theme.js.map +1 -0
- package/dist/themes/dark.theme.d.ts +8 -0
- package/dist/themes/dark.theme.d.ts.map +1 -0
- package/dist/themes/dark.theme.js +502 -0
- package/dist/themes/dark.theme.js.map +1 -0
- package/dist/themes/dracula.theme.d.ts +8 -0
- package/dist/themes/dracula.theme.d.ts.map +1 -0
- package/dist/themes/dracula.theme.js +518 -0
- package/dist/themes/dracula.theme.js.map +1 -0
- package/dist/themes/gruvbox.theme.d.ts +8 -0
- package/dist/themes/gruvbox.theme.d.ts.map +1 -0
- package/dist/themes/gruvbox.theme.js +529 -0
- package/dist/themes/gruvbox.theme.js.map +1 -0
- package/dist/themes/high-contrast-dark.theme.d.ts +8 -0
- package/dist/themes/high-contrast-dark.theme.d.ts.map +1 -0
- package/dist/themes/high-contrast-dark.theme.js +503 -0
- package/dist/themes/high-contrast-dark.theme.js.map +1 -0
- package/dist/themes/index.d.ts +58 -0
- package/dist/themes/index.d.ts.map +1 -0
- package/dist/themes/index.js +75 -0
- package/dist/themes/index.js.map +1 -0
- package/dist/themes/light.theme.d.ts +8 -0
- package/dist/themes/light.theme.d.ts.map +1 -0
- package/dist/themes/light.theme.js +502 -0
- package/dist/themes/light.theme.js.map +1 -0
- package/dist/themes/monochrome.theme.d.ts +8 -0
- package/dist/themes/monochrome.theme.d.ts.map +1 -0
- package/dist/themes/monochrome.theme.js +503 -0
- package/dist/themes/monochrome.theme.js.map +1 -0
- package/dist/themes/monokai.theme.d.ts +8 -0
- package/dist/themes/monokai.theme.d.ts.map +1 -0
- package/dist/themes/monokai.theme.js +518 -0
- package/dist/themes/monokai.theme.js.map +1 -0
- package/dist/themes/nord.theme.d.ts +8 -0
- package/dist/themes/nord.theme.d.ts.map +1 -0
- package/dist/themes/nord.theme.js +527 -0
- package/dist/themes/nord.theme.js.map +1 -0
- package/dist/themes/solarized-dark.theme.d.ts +8 -0
- package/dist/themes/solarized-dark.theme.d.ts.map +1 -0
- package/dist/themes/solarized-dark.theme.js +525 -0
- package/dist/themes/solarized-dark.theme.js.map +1 -0
- package/dist/themes/tokyo-night.theme.d.ts +8 -0
- package/dist/themes/tokyo-night.theme.d.ts.map +1 -0
- package/dist/themes/tokyo-night.theme.js +529 -0
- package/dist/themes/tokyo-night.theme.js.map +1 -0
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/dist/core/theme.d.ts
CHANGED
|
@@ -1,299 +1,218 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Theme System - Context-based theming for Tuiuiu
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* -
|
|
9
|
-
* - Semantic colors with foreground variants
|
|
10
|
-
* - Auto-theming support for components
|
|
4
|
+
* Clean, unified theme API with:
|
|
5
|
+
* - Direct theme structure access (no conversion layer)
|
|
6
|
+
* - Signal-based reactive theme switching
|
|
7
|
+
* - Component tokens for consistent styling
|
|
8
|
+
* - Background/foreground hierarchy for visual depth
|
|
11
9
|
*/
|
|
12
10
|
import { type ColorShade } from './colors.js';
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
/** Accent color for highlights */
|
|
39
|
-
accent: string;
|
|
40
|
-
/** Accent text color */
|
|
41
|
-
accentForeground: string;
|
|
42
|
-
/** Destructive/danger color */
|
|
43
|
-
destructive: string;
|
|
44
|
-
/** Destructive text color */
|
|
45
|
-
destructiveForeground: string;
|
|
46
|
-
/** Border color */
|
|
47
|
-
border: string;
|
|
48
|
-
/** Input border/background color */
|
|
49
|
-
input: string;
|
|
50
|
-
/** Focus ring color */
|
|
51
|
-
ring: string;
|
|
52
|
-
/** Success state color */
|
|
53
|
-
success: string;
|
|
54
|
-
/** Success text color */
|
|
55
|
-
successForeground: string;
|
|
56
|
-
/** Warning state color */
|
|
57
|
-
warning: string;
|
|
58
|
-
/** Warning text color */
|
|
59
|
-
warningForeground: string;
|
|
60
|
-
/** Error state color */
|
|
61
|
-
error: string;
|
|
62
|
-
/** Error text color */
|
|
63
|
-
errorForeground: string;
|
|
64
|
-
/** Info state color */
|
|
65
|
-
info: string;
|
|
66
|
-
/** Info text color */
|
|
67
|
-
infoForeground: string;
|
|
68
|
-
}
|
|
69
|
-
export interface ThemeSpacing {
|
|
70
|
-
/** Extra small spacing (1 char) */
|
|
71
|
-
xs: number;
|
|
72
|
-
/** Small spacing (2 chars) */
|
|
73
|
-
sm: number;
|
|
74
|
-
/** Medium spacing (4 chars) */
|
|
75
|
-
md: number;
|
|
76
|
-
/** Large spacing (8 chars) */
|
|
77
|
-
lg: number;
|
|
78
|
-
/** Extra large spacing (16 chars) */
|
|
79
|
-
xl: number;
|
|
80
|
-
}
|
|
81
|
-
export type BorderRadius = 'none' | 'sm' | 'md' | 'lg';
|
|
82
|
-
export interface Theme {
|
|
83
|
-
/** Theme name identifier */
|
|
84
|
-
name: string;
|
|
85
|
-
/** Color palette */
|
|
86
|
-
colors: ThemeColors;
|
|
87
|
-
/** Spacing scale */
|
|
88
|
-
spacing: ThemeSpacing;
|
|
89
|
-
/** Default border radius style */
|
|
90
|
-
borderRadius: BorderRadius;
|
|
91
|
-
}
|
|
11
|
+
import type { Theme, ThemeMode, ThemePalette, ThemeBackground, ThemeForeground, ThemeAccent, ThemeStates, ThemeBorders, ThemeOpacity, ComponentTokens, ComponentName, BorderRadius } from './theme-types.js';
|
|
12
|
+
export type { Theme, ThemeMode, ThemePalette, ThemeBackground, ThemeForeground, ThemeAccent, ThemeStates, ThemeBorders, ThemeOpacity, ComponentTokens, ComponentName, ColorScale, ShadeValue, BorderRadius, ForegroundInverse, StateToken, FocusState, DisabledState, SelectedState, ButtonTokens, ButtonVariantTokens, PanelTokens, MenuTokens, MenuItemTokens, TabsTokens, TabTokens, DropdownTokens, DropdownItemTokens, InputTokens, CheckboxTokens, RadioTokens, TooltipTokens, ModalTokens, BadgeTokens, BadgeVariantTokens, ListTokens, ListItemTokens, } from './theme-types.js';
|
|
13
|
+
export { getShade } from './theme-types.js';
|
|
14
|
+
import { darkTheme } from '../themes/dark.theme.js';
|
|
15
|
+
import { lightTheme } from '../themes/light.theme.js';
|
|
16
|
+
import { monokaiTheme } from '../themes/monokai.theme.js';
|
|
17
|
+
import { draculaTheme } from '../themes/dracula.theme.js';
|
|
18
|
+
import { nordTheme } from '../themes/nord.theme.js';
|
|
19
|
+
import { solarizedDarkTheme } from '../themes/solarized-dark.theme.js';
|
|
20
|
+
import { gruvboxTheme } from '../themes/gruvbox.theme.js';
|
|
21
|
+
import { tokyoNightTheme } from '../themes/tokyo-night.theme.js';
|
|
22
|
+
import { catppuccinTheme } from '../themes/catppuccin.theme.js';
|
|
23
|
+
import { highContrastDarkTheme } from '../themes/high-contrast-dark.theme.js';
|
|
24
|
+
import { monochromeTheme } from '../themes/monochrome.theme.js';
|
|
25
|
+
export { darkTheme, lightTheme, monokaiTheme, draculaTheme, nordTheme, solarizedDarkTheme, gruvboxTheme, tokyoNightTheme, catppuccinTheme, highContrastDarkTheme, monochromeTheme, };
|
|
26
|
+
/**
|
|
27
|
+
* Get the current theme (reactive).
|
|
28
|
+
*
|
|
29
|
+
* Use destructuring to access specific parts:
|
|
30
|
+
* ```typescript
|
|
31
|
+
* const { palette, background, foreground, components } = useTheme()
|
|
32
|
+
* const buttonBg = components.button.primary.bg
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export declare function useTheme(): Theme;
|
|
92
36
|
/**
|
|
93
|
-
*
|
|
37
|
+
* Get the current theme without tracking (for use outside effects).
|
|
94
38
|
*/
|
|
95
|
-
export declare
|
|
39
|
+
export declare function getTheme(): Theme;
|
|
96
40
|
/**
|
|
97
|
-
*
|
|
41
|
+
* Get the current theme mode ('dark' or 'light').
|
|
98
42
|
*/
|
|
99
|
-
export declare
|
|
43
|
+
export declare function useThemeMode(): ThemeMode;
|
|
100
44
|
/**
|
|
101
|
-
*
|
|
45
|
+
* Check if current theme is dark mode.
|
|
102
46
|
*/
|
|
103
|
-
export declare
|
|
47
|
+
export declare function useIsDark(): boolean;
|
|
104
48
|
/**
|
|
105
|
-
*
|
|
49
|
+
* Get component tokens for a specific component.
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```typescript
|
|
53
|
+
* const buttonTokens = useComponentTokens('button')
|
|
54
|
+
* const { primary, secondary, outline, ghost } = buttonTokens
|
|
55
|
+
* ```
|
|
106
56
|
*/
|
|
107
|
-
export declare
|
|
57
|
+
export declare function useComponentTokens<K extends ComponentName>(component: K): ComponentTokens[K];
|
|
108
58
|
/**
|
|
109
|
-
*
|
|
59
|
+
* Set the global theme.
|
|
110
60
|
*/
|
|
111
|
-
export declare
|
|
61
|
+
export declare function setTheme(theme: Theme): void;
|
|
112
62
|
/**
|
|
113
|
-
*
|
|
63
|
+
* Push a theme onto the stack (for nested themes).
|
|
114
64
|
*/
|
|
115
|
-
export declare
|
|
65
|
+
export declare function pushTheme(theme: Theme): void;
|
|
116
66
|
/**
|
|
117
|
-
*
|
|
67
|
+
* Pop a theme from the stack.
|
|
118
68
|
*/
|
|
119
|
-
export declare
|
|
69
|
+
export declare function popTheme(): void;
|
|
120
70
|
/**
|
|
121
|
-
*
|
|
71
|
+
* All built-in themes.
|
|
122
72
|
*/
|
|
123
|
-
export declare const
|
|
73
|
+
export declare const themes: {
|
|
74
|
+
readonly dark: Theme;
|
|
75
|
+
readonly light: Theme;
|
|
76
|
+
readonly monokai: Theme;
|
|
77
|
+
readonly dracula: Theme;
|
|
78
|
+
readonly nord: Theme;
|
|
79
|
+
readonly solarizedDark: Theme;
|
|
80
|
+
readonly gruvbox: Theme;
|
|
81
|
+
readonly tokyoNight: Theme;
|
|
82
|
+
readonly catppuccin: Theme;
|
|
83
|
+
readonly highContrastDark: Theme;
|
|
84
|
+
readonly monochrome: Theme;
|
|
85
|
+
};
|
|
86
|
+
/** Theme name type */
|
|
87
|
+
export type ThemeName = keyof typeof themes;
|
|
88
|
+
/** All theme names for cycling */
|
|
89
|
+
export declare const themeNames: ThemeName[];
|
|
124
90
|
/**
|
|
125
|
-
*
|
|
91
|
+
* Get a theme by name.
|
|
126
92
|
*/
|
|
127
|
-
export declare
|
|
93
|
+
export declare function getThemeByName(name: ThemeName): Theme;
|
|
128
94
|
/**
|
|
129
|
-
*
|
|
95
|
+
* Get next theme in cycle.
|
|
130
96
|
*/
|
|
131
|
-
export declare
|
|
97
|
+
export declare function getNextTheme(current: Theme): Theme;
|
|
132
98
|
/**
|
|
133
|
-
*
|
|
99
|
+
* Get previous theme in cycle.
|
|
134
100
|
*/
|
|
135
|
-
export declare
|
|
101
|
+
export declare function getPreviousTheme(current: Theme): Theme;
|
|
136
102
|
/**
|
|
137
|
-
*
|
|
103
|
+
* Create a custom theme by extending an existing theme.
|
|
104
|
+
*
|
|
105
|
+
* For deep customization, use `mergeThemes` from theme-loader.
|
|
138
106
|
*/
|
|
139
|
-
export declare function
|
|
107
|
+
export declare function createTheme(base: Theme, overrides: Partial<Theme>): Theme;
|
|
140
108
|
/**
|
|
141
|
-
*
|
|
109
|
+
* Map border radius to actual characters.
|
|
142
110
|
*/
|
|
143
|
-
export declare function
|
|
111
|
+
export declare function getBorderRadiusChars(radius: BorderRadius): {
|
|
112
|
+
tl: string;
|
|
113
|
+
tr: string;
|
|
114
|
+
bl: string;
|
|
115
|
+
br: string;
|
|
116
|
+
};
|
|
144
117
|
/**
|
|
145
|
-
*
|
|
118
|
+
* Get the best contrasting text color (white or black) for a given background.
|
|
119
|
+
* Uses WCAG luminance formula for accessibility.
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* ```typescript
|
|
123
|
+
* getContrastColor('#3b82f6') // 'white' (blue is dark)
|
|
124
|
+
* getContrastColor('#fbbf24') // 'black' (amber is light)
|
|
125
|
+
* ```
|
|
146
126
|
*/
|
|
147
|
-
export declare function
|
|
127
|
+
export declare function getContrastColor(color: string): 'white' | 'black';
|
|
148
128
|
/**
|
|
149
|
-
*
|
|
129
|
+
* Get a Tailwind color by name and shade.
|
|
130
|
+
*
|
|
131
|
+
* @example
|
|
132
|
+
* ```typescript
|
|
133
|
+
* getColor('blue', 500) // '#3b82f6'
|
|
134
|
+
* getColor('gray', 100) // '#f3f4f6'
|
|
135
|
+
* ```
|
|
150
136
|
*/
|
|
151
|
-
export declare function
|
|
137
|
+
export declare function getColor(name: string, shade?: ColorShade): string;
|
|
152
138
|
/**
|
|
153
|
-
*
|
|
139
|
+
* Get a darker shade of a color.
|
|
140
|
+
*
|
|
141
|
+
* @param name Color name from colors.ts
|
|
142
|
+
* @param steps Number of shade steps to darken (1 = +100)
|
|
154
143
|
*/
|
|
155
|
-
export declare function
|
|
144
|
+
export declare function getDarker(name: string, steps?: number): string;
|
|
156
145
|
/**
|
|
157
|
-
*
|
|
146
|
+
* Get a lighter shade of a color.
|
|
147
|
+
*
|
|
148
|
+
* @param name Color name from colors.ts
|
|
149
|
+
* @param steps Number of shade steps to lighten (1 = -100)
|
|
158
150
|
*/
|
|
159
|
-
export declare function
|
|
151
|
+
export declare function getLighter(name: string, steps?: number): string;
|
|
160
152
|
/**
|
|
161
|
-
*
|
|
153
|
+
* Detect system color scheme preference.
|
|
154
|
+
* Checks COLORFGBG environment variable.
|
|
162
155
|
*/
|
|
163
|
-
export declare function
|
|
156
|
+
export declare function detectColorScheme(): ThemeMode;
|
|
164
157
|
/**
|
|
165
|
-
*
|
|
158
|
+
* Auto-select theme based on system preference.
|
|
166
159
|
*/
|
|
167
|
-
export
|
|
160
|
+
export declare function useSystemTheme(): void;
|
|
168
161
|
/**
|
|
169
|
-
*
|
|
170
|
-
* Use this for buttons, badges, navbars, and any filled components.
|
|
162
|
+
* Shorthand for common theme access patterns.
|
|
171
163
|
*
|
|
172
164
|
* @example
|
|
173
|
-
*
|
|
174
|
-
*
|
|
175
|
-
*
|
|
176
|
-
* )
|
|
177
|
-
*
|
|
178
|
-
* @example
|
|
179
|
-
* // Destructuring in component
|
|
180
|
-
* const colors = themeColorPair('success');
|
|
181
|
-
* Badge({ backgroundColor: colors.bg, color: colors.fg }, 'OK')
|
|
165
|
+
* ```typescript
|
|
166
|
+
* const { bg, fg, palette, components } = th()
|
|
167
|
+
* ```
|
|
182
168
|
*/
|
|
183
|
-
export declare function
|
|
184
|
-
bg: string;
|
|
185
|
-
fg: string;
|
|
186
|
-
};
|
|
169
|
+
export declare function th(): Theme;
|
|
187
170
|
/**
|
|
188
|
-
* Get
|
|
171
|
+
* Get background colors from current theme.
|
|
189
172
|
*/
|
|
190
|
-
export declare function
|
|
173
|
+
export declare function useBg(): ThemeBackground;
|
|
191
174
|
/**
|
|
192
|
-
* Get
|
|
193
|
-
* Uses WCAG luminance formula for accessibility.
|
|
194
|
-
*
|
|
195
|
-
* @example
|
|
196
|
-
* getContrastColor('#3b82f6') // 'white' (blue is dark)
|
|
197
|
-
* getContrastColor('#fbbf24') // 'black' (amber is light)
|
|
198
|
-
* getContrastColor('cyan') // 'black' (cyan is light)
|
|
199
|
-
*
|
|
200
|
-
* @example
|
|
201
|
-
* // With custom component
|
|
202
|
-
* const bg = '#ff6b6b';
|
|
203
|
-
* Box({ backgroundColor: bg },
|
|
204
|
-
* Text({ color: getContrastColor(bg) }, 'Hello')
|
|
205
|
-
* )
|
|
175
|
+
* Get foreground colors from current theme.
|
|
206
176
|
*/
|
|
207
|
-
export declare function
|
|
177
|
+
export declare function useFg(): ThemeForeground;
|
|
208
178
|
/**
|
|
209
|
-
*
|
|
179
|
+
* Get palette from current theme.
|
|
210
180
|
*/
|
|
211
|
-
export declare function
|
|
212
|
-
tl: string;
|
|
213
|
-
tr: string;
|
|
214
|
-
bl: string;
|
|
215
|
-
br: string;
|
|
216
|
-
};
|
|
181
|
+
export declare function usePalette(): ThemePalette;
|
|
217
182
|
/**
|
|
218
|
-
*
|
|
219
|
-
*
|
|
220
|
-
* Supports multiple formats:
|
|
221
|
-
* - Semantic names: 'primary', 'secondary', 'destructive', etc.
|
|
222
|
-
* - Tailwind format: 'blue-500', 'gray-100', 'red-600'
|
|
223
|
-
* - Color name only: 'blue', 'red' (uses shade 500)
|
|
224
|
-
* - Hex values: '#3b82f6', '#fff'
|
|
225
|
-
* - RGB values: 'rgb(59, 130, 246)'
|
|
226
|
-
*
|
|
227
|
-
* @example
|
|
228
|
-
* resolveColor('primary') // Theme's primary color
|
|
229
|
-
* resolveColor('blue-500') // '#3b82f6'
|
|
230
|
-
* resolveColor('blue') // '#3b82f6' (shade 500)
|
|
231
|
-
* resolveColor('#ff0000') // '#ff0000' (passed through)
|
|
183
|
+
* Get accent colors from current theme.
|
|
232
184
|
*/
|
|
233
|
-
export declare function
|
|
185
|
+
export declare function useAccents(): ThemeAccent;
|
|
234
186
|
/**
|
|
235
|
-
*
|
|
236
|
-
* Note: In terminal context, this checks COLORFGBG or similar env vars
|
|
187
|
+
* Get state colors from current theme.
|
|
237
188
|
*/
|
|
238
|
-
export declare function
|
|
189
|
+
export declare function useStates(): ThemeStates;
|
|
239
190
|
/**
|
|
240
|
-
*
|
|
191
|
+
* Get border colors from current theme.
|
|
241
192
|
*/
|
|
242
|
-
export declare function
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
monochrome: Theme;
|
|
248
|
-
monokai: Theme;
|
|
249
|
-
dracula: Theme;
|
|
250
|
-
nord: Theme;
|
|
251
|
-
solarizedDark: Theme;
|
|
252
|
-
gruvbox: Theme;
|
|
253
|
-
tokyoNight: Theme;
|
|
254
|
-
catppuccin: Theme;
|
|
255
|
-
};
|
|
256
|
-
/** All theme names for cycling */
|
|
257
|
-
export declare const themeNames: (keyof typeof themes)[];
|
|
258
|
-
/** Get next theme in cycle */
|
|
259
|
-
export declare function getNextTheme(current: Theme): Theme;
|
|
193
|
+
export declare function useBorders(): ThemeBorders;
|
|
194
|
+
/**
|
|
195
|
+
* Get opacity values from current theme.
|
|
196
|
+
*/
|
|
197
|
+
export declare function useOpacity(): ThemeOpacity;
|
|
260
198
|
/**
|
|
261
|
-
*
|
|
199
|
+
* Resolve a color value to a hex string.
|
|
200
|
+
*
|
|
201
|
+
* Handles:
|
|
202
|
+
* - ANSI color names (returned as-is for the renderer)
|
|
203
|
+
* - Semantic theme colors (primary, success, foreground, etc.)
|
|
204
|
+
* - Hex colors (#rrggbb)
|
|
205
|
+
* - RGB colors (rgb(r,g,b))
|
|
206
|
+
* - Palette colors (blue-500)
|
|
262
207
|
*
|
|
263
208
|
* @example
|
|
264
|
-
*
|
|
265
|
-
*
|
|
266
|
-
*
|
|
267
|
-
*
|
|
268
|
-
*
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
*/
|
|
274
|
-
color: (name: string, shade?: ColorShade) => string;
|
|
275
|
-
/**
|
|
276
|
-
* Get a color from the current theme
|
|
277
|
-
*/
|
|
278
|
-
theme: (key: keyof ThemeColors) => string;
|
|
279
|
-
/**
|
|
280
|
-
* Get a darker shade of a color (moves towards 950)
|
|
281
|
-
* @param name Color name
|
|
282
|
-
* @param steps Number of shade steps to darken (1 = +100)
|
|
283
|
-
*/
|
|
284
|
-
darker: (name: string, steps?: number) => string;
|
|
285
|
-
/**
|
|
286
|
-
* Get a lighter shade of a color (moves towards 50)
|
|
287
|
-
* @param name Color name
|
|
288
|
-
* @param steps Number of shade steps to lighten (1 = -100)
|
|
289
|
-
*/
|
|
290
|
-
lighter: (name: string, steps?: number) => string;
|
|
291
|
-
/**
|
|
292
|
-
* Get a shade relative to a base shade
|
|
293
|
-
* @param name Color name
|
|
294
|
-
* @param baseShade Starting shade
|
|
295
|
-
* @param offset Offset from base (+100, -200, etc.)
|
|
296
|
-
*/
|
|
297
|
-
shade: (name: string, baseShade: ColorShade, offset: number) => string;
|
|
298
|
-
};
|
|
209
|
+
* ```typescript
|
|
210
|
+
* resolveColor('primary') // '#3b82f6' (from theme)
|
|
211
|
+
* resolveColor('foreground') // '#f8fafc' (from theme)
|
|
212
|
+
* resolveColor('#ff6600') // '#ff6600' (passthrough)
|
|
213
|
+
* resolveColor('blue-500') // '#3b82f6' (from colors.ts)
|
|
214
|
+
* resolveColor('red') // 'red' (ANSI color, passthrough)
|
|
215
|
+
* ```
|
|
216
|
+
*/
|
|
217
|
+
export declare function resolveColor(color: string): string;
|
|
299
218
|
//# sourceMappingURL=theme.d.ts.map
|
package/dist/core/theme.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/core/theme.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/core/theme.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAA6B,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AACzE,OAAO,KAAK,EACV,KAAK,EACL,SAAS,EACT,YAAY,EACZ,eAAe,EACf,eAAe,EACf,WAAW,EACX,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,aAAa,EAGb,YAAY,EACb,MAAM,kBAAkB,CAAC;AAG1B,YAAY,EACV,KAAK,EACL,SAAS,EACT,YAAY,EACZ,eAAe,EACf,eAAe,EACf,WAAW,EACX,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,aAAa,EACb,UAAU,EACV,UAAU,EACV,YAAY,EACZ,iBAAiB,EACjB,UAAU,EACV,UAAU,EACV,aAAa,EACb,aAAa,EACb,YAAY,EACZ,mBAAmB,EACnB,WAAW,EACX,UAAU,EACV,cAAc,EACd,UAAU,EACV,SAAS,EACT,cAAc,EACd,kBAAkB,EAClB,WAAW,EACX,cAAc,EACd,WAAW,EACX,aAAa,EACb,WAAW,EACX,WAAW,EACX,kBAAkB,EAClB,UAAU,EACV,cAAc,GACf,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,C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