add preset & rebuild

Signed-off-by: Hadi <[email protected]>
This commit is contained in:
Hadi
2026-09-03 16:45:05 +02:00
parent 6d858380c7
commit 280507f7e0
34 changed files with 110 additions and 81 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
// @bun // @bun
import { import {
theme theme
} from "./chunk-57mam43k.js"; } from "./chunk-x7m82z3z.js";
// src/components/Modal.tsx // src/components/Modal.tsx
import { createComponent as _$createComponent } from "@opentui/solid"; import { createComponent as _$createComponent } from "@opentui/solid";
+1 -1
View File
@@ -1,7 +1,7 @@
// @bun // @bun
import { import {
theme theme
} from "./chunk-57mam43k.js"; } from "./chunk-x7m82z3z.js";
// src/components/ProgressBar.tsx // src/components/ProgressBar.tsx
import { effect as _$effect } from "@opentui/solid"; import { effect as _$effect } from "@opentui/solid";
+1 -1
View File
@@ -1,7 +1,7 @@
// @bun // @bun
import { import {
theme theme
} from "./chunk-57mam43k.js"; } from "./chunk-x7m82z3z.js";
import { import {
dismiss, dismiss,
notifications notifications
+1 -1
View File
@@ -1,7 +1,7 @@
// @bun // @bun
import { import {
theme theme
} from "./chunk-57mam43k.js"; } from "./chunk-x7m82z3z.js";
// src/components/Badge.tsx // src/components/Badge.tsx
import { insert as _$insert } from "@opentui/solid"; import { insert as _$insert } from "@opentui/solid";
+1 -1
View File
@@ -1,7 +1,7 @@
// @bun // @bun
import { import {
Modal Modal
} from "./chunk-4j2gzwtd.js"; } from "./chunk-3t6nhsa8.js";
import { import {
helpOpen, helpOpen,
toggleHelp toggleHelp
+5 -1
View File
@@ -34,7 +34,11 @@ function buildPresets(theme) {
focusedBorderColor: theme.primary, focusedBorderColor: theme.primary,
backgroundColor: theme.background backgroundColor: theme.background
}; };
return { select, tabSelect, input, textarea: input, box }; const slider = {
backgroundColor: theme.subtleBg,
foregroundColor: theme.primary
};
return { select, tabSelect, input, textarea: input, box, slider };
} }
export { buildPresets }; export { buildPresets };
+1 -1
View File
@@ -1,7 +1,7 @@
// @bun // @bun
import { import {
theme theme
} from "./chunk-57mam43k.js"; } from "./chunk-x7m82z3z.js";
// src/components/SignalBars.tsx // src/components/SignalBars.tsx
import { effect as _$effect } from "@opentui/solid"; import { effect as _$effect } from "@opentui/solid";
+1 -1
View File
@@ -1,7 +1,7 @@
// @bun // @bun
import { import {
theme theme
} from "./chunk-57mam43k.js"; } from "./chunk-x7m82z3z.js";
// src/components/MinSizeGuard.tsx // src/components/MinSizeGuard.tsx
import { createComponent as _$createComponent } from "@opentui/solid"; import { createComponent as _$createComponent } from "@opentui/solid";
+1 -1
View File
@@ -1,7 +1,7 @@
// @bun // @bun
import { import {
theme theme
} from "./chunk-57mam43k.js"; } from "./chunk-x7m82z3z.js";
// src/components/Tabs.tsx // src/components/Tabs.tsx
import { effect as _$effect } from "@opentui/solid"; import { effect as _$effect } from "@opentui/solid";
+1 -1
View File
@@ -2,7 +2,7 @@
import { import {
presets, presets,
theme theme
} from "./chunk-57mam43k.js"; } from "./chunk-x7m82z3z.js";
// src/components/Sidebar.tsx // src/components/Sidebar.tsx
import { use as _$use } from "@opentui/solid"; import { use as _$use } from "@opentui/solid";
+2 -2
View File
@@ -1,10 +1,10 @@
// @bun // @bun
import { import {
Badge Badge
} from "./chunk-wasbecqm.js"; } from "./chunk-bscbaa87.js";
import { import {
theme theme
} from "./chunk-57mam43k.js"; } from "./chunk-x7m82z3z.js";
// src/components/Toggle.tsx // src/components/Toggle.tsx
import { setProp as _$setProp } from "@opentui/solid"; import { setProp as _$setProp } from "@opentui/solid";
+1 -1
View File
@@ -1,7 +1,7 @@
// @bun // @bun
import { import {
theme theme
} from "./chunk-57mam43k.js"; } from "./chunk-x7m82z3z.js";
// src/components/HelpBar.tsx // src/components/HelpBar.tsx
import { createTextNode as _$createTextNode } from "@opentui/solid"; import { createTextNode as _$createTextNode } from "@opentui/solid";
+3 -3
View File
@@ -1,7 +1,4 @@
// @bun // @bun
import {
buildPresets
} from "./chunk-ergc99dh.js";
import { import {
configPath, configPath,
readYamlFile readYamlFile
@@ -11,6 +8,9 @@ import {
normalizeColors, normalizeColors,
resolveBorderStyle resolveBorderStyle
} from "./chunk-hcq62p48.js"; } from "./chunk-hcq62p48.js";
import {
buildPresets
} from "./chunk-cnhhssmz.js";
// src/index.ts // src/index.ts
import { join } from "path"; import { join } from "path";
+1 -1
View File
@@ -1,7 +1,7 @@
// @bun // @bun
import { import {
theme theme
} from "./chunk-57mam43k.js"; } from "./chunk-x7m82z3z.js";
// src/components/Box.tsx // src/components/Box.tsx
import { spread as _$spread } from "@opentui/solid"; import { spread as _$spread } from "@opentui/solid";
+3 -3
View File
@@ -1,11 +1,11 @@
// @bun // @bun
import { import {
Badge Badge
} from "../chunk-wasbecqm.js"; } from "../chunk-bscbaa87.js";
import"../chunk-57mam43k.js"; import"../chunk-x7m82z3z.js";
import"../chunk-ergc99dh.js";
import"../chunk-7f8jagy5.js"; import"../chunk-7f8jagy5.js";
import"../chunk-hcq62p48.js"; import"../chunk-hcq62p48.js";
import"../chunk-cnhhssmz.js";
export { export {
Badge Badge
}; };
+3 -3
View File
@@ -1,11 +1,11 @@
// @bun // @bun
import { import {
Box Box
} from "../chunk-n96bgmbh.js"; } from "../chunk-ynqvwj4d.js";
import"../chunk-57mam43k.js"; import"../chunk-x7m82z3z.js";
import"../chunk-ergc99dh.js";
import"../chunk-7f8jagy5.js"; import"../chunk-7f8jagy5.js";
import"../chunk-hcq62p48.js"; import"../chunk-hcq62p48.js";
import"../chunk-cnhhssmz.js";
export { export {
Box Box
}; };
+3 -3
View File
@@ -1,11 +1,11 @@
// @bun // @bun
import { import {
HelpBar HelpBar
} from "../chunk-dv2w3sfk.js"; } from "../chunk-rvq53a2a.js";
import"../chunk-57mam43k.js"; import"../chunk-x7m82z3z.js";
import"../chunk-ergc99dh.js";
import"../chunk-7f8jagy5.js"; import"../chunk-7f8jagy5.js";
import"../chunk-hcq62p48.js"; import"../chunk-hcq62p48.js";
import"../chunk-cnhhssmz.js";
export { export {
HelpBar HelpBar
}; };
+4 -4
View File
@@ -1,12 +1,12 @@
// @bun // @bun
import { import {
HelpModal HelpModal
} from "../chunk-2n7bvge9.js"; } from "../chunk-c7bjgk8c.js";
import"../chunk-4j2gzwtd.js"; import"../chunk-3t6nhsa8.js";
import"../chunk-57mam43k.js"; import"../chunk-x7m82z3z.js";
import"../chunk-ergc99dh.js";
import"../chunk-7f8jagy5.js"; import"../chunk-7f8jagy5.js";
import"../chunk-hcq62p48.js"; import"../chunk-hcq62p48.js";
import"../chunk-cnhhssmz.js";
import"../chunk-cyvpvpws.js"; import"../chunk-cyvpvpws.js";
export { export {
HelpModal HelpModal
+3 -3
View File
@@ -1,11 +1,11 @@
// @bun // @bun
import { import {
MinSizeGuard MinSizeGuard
} from "../chunk-nr74cgcr.js"; } from "../chunk-eta27h3c.js";
import"../chunk-57mam43k.js"; import"../chunk-x7m82z3z.js";
import"../chunk-ergc99dh.js";
import"../chunk-7f8jagy5.js"; import"../chunk-7f8jagy5.js";
import"../chunk-hcq62p48.js"; import"../chunk-hcq62p48.js";
import"../chunk-cnhhssmz.js";
export { export {
MinSizeGuard MinSizeGuard
}; };
+3 -3
View File
@@ -1,11 +1,11 @@
// @bun // @bun
import { import {
Modal Modal
} from "../chunk-4j2gzwtd.js"; } from "../chunk-3t6nhsa8.js";
import"../chunk-57mam43k.js"; import"../chunk-x7m82z3z.js";
import"../chunk-ergc99dh.js";
import"../chunk-7f8jagy5.js"; import"../chunk-7f8jagy5.js";
import"../chunk-hcq62p48.js"; import"../chunk-hcq62p48.js";
import"../chunk-cnhhssmz.js";
export { export {
Modal Modal
}; };
+3 -3
View File
@@ -1,11 +1,11 @@
// @bun // @bun
import { import {
NotificationHost NotificationHost
} from "../chunk-g7p0f33m.js"; } from "../chunk-b0h95a6q.js";
import"../chunk-57mam43k.js"; import"../chunk-x7m82z3z.js";
import"../chunk-ergc99dh.js";
import"../chunk-7f8jagy5.js"; import"../chunk-7f8jagy5.js";
import"../chunk-hcq62p48.js"; import"../chunk-hcq62p48.js";
import"../chunk-cnhhssmz.js";
import"../chunk-y6txxzxk.js"; import"../chunk-y6txxzxk.js";
export { export {
NotificationHost NotificationHost
+3 -3
View File
@@ -1,11 +1,11 @@
// @bun // @bun
import { import {
ProgressBar ProgressBar
} from "../chunk-ae0jkf2z.js"; } from "../chunk-5m64a9kb.js";
import"../chunk-57mam43k.js"; import"../chunk-x7m82z3z.js";
import"../chunk-ergc99dh.js";
import"../chunk-7f8jagy5.js"; import"../chunk-7f8jagy5.js";
import"../chunk-hcq62p48.js"; import"../chunk-hcq62p48.js";
import"../chunk-cnhhssmz.js";
export { export {
ProgressBar ProgressBar
}; };
+3 -3
View File
@@ -1,11 +1,11 @@
// @bun // @bun
import { import {
Sidebar Sidebar
} from "../chunk-vve1k0ax.js"; } from "../chunk-hj94kpbg.js";
import"../chunk-57mam43k.js"; import"../chunk-x7m82z3z.js";
import"../chunk-ergc99dh.js";
import"../chunk-7f8jagy5.js"; import"../chunk-7f8jagy5.js";
import"../chunk-hcq62p48.js"; import"../chunk-hcq62p48.js";
import"../chunk-cnhhssmz.js";
export { export {
Sidebar Sidebar
}; };
+3 -3
View File
@@ -1,11 +1,11 @@
// @bun // @bun
import { import {
SignalBars SignalBars
} from "../chunk-xab9ag99.js"; } from "../chunk-dctn29v0.js";
import"../chunk-57mam43k.js"; import"../chunk-x7m82z3z.js";
import"../chunk-ergc99dh.js";
import"../chunk-7f8jagy5.js"; import"../chunk-7f8jagy5.js";
import"../chunk-hcq62p48.js"; import"../chunk-hcq62p48.js";
import"../chunk-cnhhssmz.js";
export { export {
SignalBars SignalBars
}; };
+2 -2
View File
@@ -1,10 +1,10 @@
// @bun // @bun
import { import {
theme theme
} from "../chunk-57mam43k.js"; } from "../chunk-x7m82z3z.js";
import"../chunk-ergc99dh.js";
import"../chunk-7f8jagy5.js"; import"../chunk-7f8jagy5.js";
import"../chunk-hcq62p48.js"; import"../chunk-hcq62p48.js";
import"../chunk-cnhhssmz.js";
// src/components/Spinner.tsx // src/components/Spinner.tsx
import { setProp as _$setProp } from "@opentui/solid"; import { setProp as _$setProp } from "@opentui/solid";
+3 -3
View File
@@ -2,11 +2,11 @@
import { import {
Tabs, Tabs,
stepTabValue stepTabValue
} from "../chunk-jb965p47.js"; } from "../chunk-ev4wvhd2.js";
import"../chunk-57mam43k.js"; import"../chunk-x7m82z3z.js";
import"../chunk-ergc99dh.js";
import"../chunk-7f8jagy5.js"; import"../chunk-7f8jagy5.js";
import"../chunk-hcq62p48.js"; import"../chunk-hcq62p48.js";
import"../chunk-cnhhssmz.js";
export { export {
stepTabValue, stepTabValue,
Tabs Tabs
+4 -4
View File
@@ -1,12 +1,12 @@
// @bun // @bun
import { import {
Toggle Toggle
} from "../chunk-j29ydjfr.js"; } from "../chunk-mezyz219.js";
import"../chunk-wasbecqm.js"; import"../chunk-bscbaa87.js";
import"../chunk-57mam43k.js"; import"../chunk-x7m82z3z.js";
import"../chunk-ergc99dh.js";
import"../chunk-7f8jagy5.js"; import"../chunk-7f8jagy5.js";
import"../chunk-hcq62p48.js"; import"../chunk-hcq62p48.js";
import"../chunk-cnhhssmz.js";
export { export {
Toggle Toggle
}; };
+5 -5
View File
@@ -1,15 +1,15 @@
// @bun // @bun
import { import {
HelpModal HelpModal
} from "../chunk-2n7bvge9.js"; } from "../chunk-c7bjgk8c.js";
import"../chunk-4j2gzwtd.js"; import"../chunk-3t6nhsa8.js";
import { import {
HelpBar HelpBar
} from "../chunk-dv2w3sfk.js"; } from "../chunk-rvq53a2a.js";
import"../chunk-57mam43k.js"; import"../chunk-x7m82z3z.js";
import"../chunk-ergc99dh.js";
import"../chunk-7f8jagy5.js"; import"../chunk-7f8jagy5.js";
import"../chunk-hcq62p48.js"; import"../chunk-hcq62p48.js";
import"../chunk-cnhhssmz.js";
import"../chunk-cyvpvpws.js"; import"../chunk-cyvpvpws.js";
export { export {
HelpModal, HelpModal,
+12 -12
View File
@@ -1,39 +1,39 @@
// @bun // @bun
import { import {
Box Box
} from "../chunk-n96bgmbh.js"; } from "../chunk-ynqvwj4d.js";
import { import {
NotificationHost NotificationHost
} from "../chunk-g7p0f33m.js"; } from "../chunk-b0h95a6q.js";
import { import {
Toggle Toggle
} from "../chunk-j29ydjfr.js"; } from "../chunk-mezyz219.js";
import { import {
MinSizeGuard MinSizeGuard
} from "../chunk-nr74cgcr.js"; } from "../chunk-eta27h3c.js";
import { import {
Sidebar Sidebar
} from "../chunk-vve1k0ax.js"; } from "../chunk-hj94kpbg.js";
import { import {
Tabs, Tabs,
stepTabValue stepTabValue
} from "../chunk-jb965p47.js"; } from "../chunk-ev4wvhd2.js";
import { import {
Modal Modal
} from "../chunk-4j2gzwtd.js"; } from "../chunk-3t6nhsa8.js";
import { import {
Badge Badge
} from "../chunk-wasbecqm.js"; } from "../chunk-bscbaa87.js";
import { import {
ProgressBar ProgressBar
} from "../chunk-ae0jkf2z.js"; } from "../chunk-5m64a9kb.js";
import { import {
SignalBars SignalBars
} from "../chunk-xab9ag99.js"; } from "../chunk-dctn29v0.js";
import"../chunk-57mam43k.js"; import"../chunk-x7m82z3z.js";
import"../chunk-ergc99dh.js";
import"../chunk-7f8jagy5.js"; import"../chunk-7f8jagy5.js";
import"../chunk-hcq62p48.js"; import"../chunk-hcq62p48.js";
import"../chunk-cnhhssmz.js";
import"../chunk-y6txxzxk.js"; import"../chunk-y6txxzxk.js";
export { export {
stepTabValue, stepTabValue,
+2 -2
View File
@@ -2,12 +2,12 @@
import { import {
presets, presets,
theme theme
} from "./chunk-57mam43k.js"; } from "./chunk-x7m82z3z.js";
import"./chunk-ergc99dh.js";
import { import {
configPath configPath
} from "./chunk-7f8jagy5.js"; } from "./chunk-7f8jagy5.js";
import"./chunk-hcq62p48.js"; import"./chunk-hcq62p48.js";
import"./chunk-cnhhssmz.js";
export { export {
theme, theme,
presets, presets,
+1 -1
View File
@@ -1,7 +1,7 @@
// @bun // @bun
import { import {
buildPresets buildPresets
} from "./chunk-ergc99dh.js"; } from "./chunk-cnhhssmz.js";
export { export {
buildPresets buildPresets
}; };
+4 -2
View File
@@ -2,10 +2,10 @@
import { import {
presets, presets,
theme theme
} from "./chunk-57mam43k.js"; } from "./chunk-x7m82z3z.js";
import"./chunk-ergc99dh.js";
import"./chunk-7f8jagy5.js"; import"./chunk-7f8jagy5.js";
import"./chunk-hcq62p48.js"; import"./chunk-hcq62p48.js";
import"./chunk-cnhhssmz.js";
// src/solid.ts // src/solid.ts
import { extend } from "@opentui/solid"; import { extend } from "@opentui/solid";
@@ -14,6 +14,7 @@ import {
BoxRenderable, BoxRenderable,
InputRenderable, InputRenderable,
SelectRenderable, SelectRenderable,
SliderRenderable,
TabSelectRenderable, TabSelectRenderable,
TextareaRenderable, TextareaRenderable,
TextRenderable TextRenderable
@@ -38,6 +39,7 @@ extend({
tab_select: withThemeDefaults(TabSelectRenderable, presets.tabSelect), tab_select: withThemeDefaults(TabSelectRenderable, presets.tabSelect),
input: withThemeDefaults(InputRenderable, presets.input), input: withThemeDefaults(InputRenderable, presets.input),
textarea: withThemeDefaults(TextareaRenderable, presets.textarea), textarea: withThemeDefaults(TextareaRenderable, presets.textarea),
slider: withThemeDefaults(SliderRenderable, presets.slider),
text: withThemeDefaults(TextRenderable, { fg: theme.text }), text: withThemeDefaults(TextRenderable, { fg: theme.text }),
ascii_font: withThemeDefaults(ASCIIFontRenderable, { color: theme.primary }) ascii_font: withThemeDefaults(ASCIIFontRenderable, { color: theme.primary })
}); });
+12 -1
View File
@@ -37,12 +37,18 @@ export interface BoxPreset {
backgroundColor: string; backgroundColor: string;
} }
export interface SliderPreset {
backgroundColor: string;
foregroundColor: string;
}
export interface Presets { export interface Presets {
select: SelectPreset; select: SelectPreset;
tabSelect: TabSelectPreset; tabSelect: TabSelectPreset;
input: InputPreset; input: InputPreset;
textarea: InputPreset; textarea: InputPreset;
box: BoxPreset; box: BoxPreset;
slider: SliderPreset;
} }
export function buildPresets(theme: Theme): Presets { export function buildPresets(theme: Theme): Presets {
@@ -83,5 +89,10 @@ export function buildPresets(theme: Theme): Presets {
backgroundColor: theme.background, backgroundColor: theme.background,
}; };
return { select, tabSelect, input, textarea: input, box }; const slider: SliderPreset = {
backgroundColor: theme.subtleBg,
foregroundColor: theme.primary,
};
return { select, tabSelect, input, textarea: input, box, slider };
} }
+13 -1
View File
@@ -4,15 +4,26 @@ import {
BoxRenderable, BoxRenderable,
InputRenderable, InputRenderable,
SelectRenderable, SelectRenderable,
SliderRenderable,
TabSelectRenderable, TabSelectRenderable,
TextareaRenderable, TextareaRenderable,
TextRenderable, TextRenderable,
} from "@opentui/core"; } from "@opentui/core";
import { presets, theme } from "./index.ts"; import { presets, theme } from "./index.ts";
declare module "@opentui/solid" {
interface OpenTUIComponents {
slider: typeof SliderRenderable;
}
}
type AnyCtor = new (...args: any[]) => any; type AnyCtor = new (...args: any[]) => any;
function withThemeDefaults<T extends AnyCtor>(Ctor: T, defaults: object, after?: (instance: any) => void): T { function withThemeDefaults<T extends AnyCtor>(
Ctor: T,
defaults: object,
after?: (instance: any) => void,
): T {
class Themed extends Ctor { class Themed extends Ctor {
constructor(...args: any[]) { constructor(...args: any[]) {
super(...args); super(...args);
@@ -34,6 +45,7 @@ extend({
tab_select: withThemeDefaults(TabSelectRenderable, presets.tabSelect), tab_select: withThemeDefaults(TabSelectRenderable, presets.tabSelect),
input: withThemeDefaults(InputRenderable, presets.input), input: withThemeDefaults(InputRenderable, presets.input),
textarea: withThemeDefaults(TextareaRenderable, presets.textarea), textarea: withThemeDefaults(TextareaRenderable, presets.textarea),
slider: withThemeDefaults(SliderRenderable, presets.slider),
text: withThemeDefaults(TextRenderable, { fg: theme.text }), text: withThemeDefaults(TextRenderable, { fg: theme.text }),
ascii_font: withThemeDefaults(ASCIIFontRenderable, { color: theme.primary }), ascii_font: withThemeDefaults(ASCIIFontRenderable, { color: theme.primary }),
}); });