@bayonai/mui-design 0.2.1 → 1.0.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.
@@ -17,4 +17,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  __exportStar(require("./components/IconTooltipButton.js"), exports);
19
19
  __exportStar(require("./components/BayonFlowVisual.js"), exports);
20
+ __exportStar(require("./components/BayonThemeModeToggle.js"), exports);
20
21
  __exportStar(require("./providers/BayonThemeProvider.js"), exports);
@@ -35,10 +35,10 @@ const defaultItems = [
35
35
  function BayonFlowVisual({ items = defaultItems, caption = 'idea -> AI system design -> production app', sx, ...props }) {
36
36
  return ((0, jsx_runtime_1.jsxs)(Box_1.default, { "aria-hidden": "true", sx: mergeSx({
37
37
  minHeight: { xs: 320, md: 520 },
38
- border: '1px solid rgba(248, 250, 252, 0.22)',
38
+ border: '1px solid var(--bayon-border-strong)',
39
39
  borderRadius: 2,
40
- bgcolor: 'rgba(15, 23, 42, 0.78)',
41
- boxShadow: '0 34px 110px rgba(2, 6, 23, 0.48), inset 0 1px 0 rgba(248, 250, 252, 0.12)',
40
+ bgcolor: 'var(--bayon-panel-solid)',
41
+ boxShadow: '0 34px 110px rgba(2, 6, 23, 0.48), inset 0 1px 0 var(--bayon-border)',
42
42
  p: { xs: 3, md: 4 },
43
43
  display: 'grid',
44
44
  gridTemplateRows: 'auto 1fr auto',
@@ -72,8 +72,8 @@ function BayonFlowVisual({ items = defaultItems, caption = 'idea -> AI system de
72
72
  },
73
73
  }, children: items.map((item, index) => ((0, jsx_runtime_1.jsxs)(Box_1.default, { sx: {
74
74
  borderRadius: 2,
75
- border: '1px solid rgba(248, 250, 252, 0.16)',
76
- bgcolor: index === 2 ? 'rgba(253, 224, 71, 0.12)' : 'rgba(248, 250, 252, 0.08)',
75
+ border: '1px solid var(--bayon-border)',
76
+ bgcolor: index === 2 ? 'rgba(253, 224, 71, 0.12)' : 'var(--bayon-grid-line)',
77
77
  p: 2.5,
78
78
  display: 'flex',
79
79
  flexDirection: 'column',
@@ -83,5 +83,5 @@ function BayonFlowVisual({ items = defaultItems, caption = 'idea -> AI system de
83
83
  '@media (prefers-reduced-motion: reduce)': {
84
84
  animation: 'none',
85
85
  },
86
- }, children: [(0, jsx_runtime_1.jsx)(Typography_1.default, { sx: { color: item.color, fontWeight: 800, fontSize: '0.8rem', textTransform: 'uppercase' }, children: item.label }), (0, jsx_runtime_1.jsx)(Typography_1.default, { sx: { color: '#F8FAFC', fontWeight: 700, fontSize: { xs: '1rem', md: '1.18rem' } }, children: item.value })] }, `${String(item.label)}-${index}`))) }), (0, jsx_runtime_1.jsx)(Typography_1.default, { sx: { color: 'rgba(248, 250, 252, 0.72)', fontSize: '0.95rem' }, children: caption })] }));
86
+ }, children: [(0, jsx_runtime_1.jsx)(Typography_1.default, { sx: { color: item.color, fontWeight: 800, fontSize: '0.8rem', textTransform: 'uppercase' }, children: item.label }), (0, jsx_runtime_1.jsx)(Typography_1.default, { sx: { color: 'var(--bayon-fg)', fontWeight: 700, fontSize: { xs: '1rem', md: '1.18rem' } }, children: item.value })] }, `${String(item.label)}-${index}`))) }), (0, jsx_runtime_1.jsx)(Typography_1.default, { sx: { color: 'var(--bayon-muted)', fontSize: '0.95rem' }, children: caption })] }));
87
87
  }
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ "use client";
3
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4
+ return (mod && mod.__esModule) ? mod : { "default": mod };
5
+ };
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.BayonThemeModeToggle = BayonThemeModeToggle;
8
+ const jsx_runtime_1 = require("react/jsx-runtime");
9
+ const DarkMode_1 = __importDefault(require("@mui/icons-material/DarkMode"));
10
+ const LightMode_1 = __importDefault(require("@mui/icons-material/LightMode"));
11
+ const BayonThemeProvider_js_1 = require("../providers/BayonThemeProvider.js");
12
+ const IconTooltipButton_js_1 = require("./IconTooltipButton.js");
13
+ function mergeSx(...items) {
14
+ return items.flat().filter(Boolean);
15
+ }
16
+ function BayonThemeModeToggle({ sx }) {
17
+ const { mode, toggleMode } = (0, BayonThemeProvider_js_1.useBayonThemeMode)();
18
+ const nextMode = mode === 'dark' ? 'light' : 'dark';
19
+ return ((0, jsx_runtime_1.jsx)(IconTooltipButton_js_1.IconTooltipButton, { label: `Switch to ${nextMode} mode`, onClick: toggleMode, sx: mergeSx({
20
+ color: 'var(--bayon-fg)',
21
+ border: '1px solid var(--bayon-border)',
22
+ bgcolor: 'var(--bayon-panel)',
23
+ transition: 'border-color 180ms ease, background-color 180ms ease, color 180ms ease',
24
+ '&:hover': {
25
+ bgcolor: 'rgba(45, 212, 191, 0.12)',
26
+ borderColor: 'var(--bayon-link-hover)',
27
+ color: 'var(--bayon-link-hover)',
28
+ },
29
+ '&:focus-visible': {
30
+ outline: '2px solid rgba(45, 212, 191, 0.52)',
31
+ outlineOffset: 3,
32
+ },
33
+ }, sx), children: mode === 'dark' ? (0, jsx_runtime_1.jsx)(LightMode_1.default, { fontSize: "small" }) : (0, jsx_runtime_1.jsx)(DarkMode_1.default, { fontSize: "small" }) }));
34
+ }
@@ -40,9 +40,9 @@ function BayonCtaPanel({ sx, ...props }) {
40
40
  function BayonContentBox({ sx, ...props }) {
41
41
  return ((0, jsx_runtime_1.jsx)(Box_1.default, { sx: mergeSx({
42
42
  p: { xs: 3, md: 4 },
43
- border: '1px solid rgba(248, 250, 252, 0.14)',
43
+ border: '1px solid var(--bayon-border)',
44
44
  borderRadius: 2,
45
- bgcolor: 'rgba(248, 250, 252, 0.06)',
45
+ bgcolor: 'var(--bayon-panel)',
46
46
  }, sx), ...props }));
47
47
  }
48
48
  function BayonMethodBox({ accentColor = '#2DD4BF', sx, ...props }) {
@@ -57,21 +57,21 @@ function BayonProjectCard({ category, status, title, body, actions, children, ho
57
57
  minHeight: 290,
58
58
  display: 'flex',
59
59
  flexDirection: 'column',
60
- }, sx), ...props, children: [category && ((0, jsx_runtime_1.jsx)(Typography_1.default, { sx: { color: '#2DD4BF', fontWeight: 800, fontSize: '0.82rem', textTransform: 'uppercase', mb: 1.5 }, children: category })), title && ((0, jsx_runtime_1.jsx)(Typography_1.default, { variant: "h5", sx: { color: '#FFFFFF', mb: 2 }, children: title })), body && (0, jsx_runtime_1.jsx)(Typography_1.default, { sx: { color: 'rgba(248, 250, 252, 0.74)', lineHeight: 1.75, mb: 3 }, children: body }), children, status && (0, jsx_runtime_1.jsx)(Typography_1.default, { sx: { color: '#FDE047', fontWeight: 700, mt: 'auto' }, children: status }), actions] }));
60
+ }, sx), ...props, children: [category && ((0, jsx_runtime_1.jsx)(Typography_1.default, { sx: { color: '#2DD4BF', fontWeight: 800, fontSize: '0.82rem', textTransform: 'uppercase', mb: 1.5 }, children: category })), title && ((0, jsx_runtime_1.jsx)(Typography_1.default, { variant: "h5", sx: { color: 'var(--bayon-heading)', mb: 2 }, children: title })), body && (0, jsx_runtime_1.jsx)(Typography_1.default, { sx: { color: 'var(--bayon-muted)', lineHeight: 1.75, mb: 3 }, children: body }), children, status && (0, jsx_runtime_1.jsx)(Typography_1.default, { sx: { color: '#FDE047', fontWeight: 700, mt: 'auto' }, children: status }), actions] }));
61
61
  }
62
62
  function BayonPillarCard({ accentColor = '#2DD4BF', eyebrow, title, body, actions, children, sx, ...props }) {
63
63
  return ((0, jsx_runtime_1.jsxs)(Box_1.default, { sx: mergeSx({
64
64
  p: { xs: 3, md: 5 },
65
- border: '1px solid rgba(248, 250, 252, 0.14)',
65
+ border: '1px solid var(--bayon-border)',
66
66
  borderRadius: 2,
67
- bgcolor: 'rgba(248, 250, 252, 0.06)',
68
- boxShadow: '0 28px 80px rgba(2, 6, 23, 0.24)',
67
+ bgcolor: 'var(--bayon-panel)',
68
+ boxShadow: 'var(--bayon-panel-shadow)',
69
69
  transition: 'transform 180ms ease, border-color 180ms ease',
70
70
  '&:hover': {
71
71
  transform: 'translateY(-5px)',
72
72
  borderColor: accentColor,
73
73
  },
74
- }, sx), ...props, children: [eyebrow && ((0, jsx_runtime_1.jsx)(Typography_1.default, { sx: { color: accentColor, fontSize: '0.82rem', fontWeight: 800, textTransform: 'uppercase', mb: 1.5 }, children: eyebrow })), title && ((0, jsx_runtime_1.jsx)(Typography_1.default, { variant: "h3", sx: { color: '#FFFFFF', mb: 2 }, children: title })), body && (0, jsx_runtime_1.jsx)(Typography_1.default, { sx: { color: 'rgba(248, 250, 252, 0.74)', lineHeight: 1.75 }, children: body }), children, actions] }));
74
+ }, sx), ...props, children: [eyebrow && ((0, jsx_runtime_1.jsx)(Typography_1.default, { sx: { color: accentColor, fontSize: '0.82rem', fontWeight: 800, textTransform: 'uppercase', mb: 1.5 }, children: eyebrow })), title && ((0, jsx_runtime_1.jsx)(Typography_1.default, { variant: "h3", sx: { color: 'var(--bayon-heading)', mb: 2 }, children: title })), body && (0, jsx_runtime_1.jsx)(Typography_1.default, { sx: { color: 'var(--bayon-muted)', lineHeight: 1.75 }, children: body }), children, actions] }));
75
75
  }
76
76
  function BayonTechChip({ label, children, sx, ...props }) {
77
77
  return ((0, jsx_runtime_1.jsx)(Box_1.default, { sx: mergeSx({
@@ -37,6 +37,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
37
37
  return (mod && mod.__esModule) ? mod : { "default": mod };
38
38
  };
39
39
  Object.defineProperty(exports, "__esModule", { value: true });
40
+ exports.useBayonThemeMode = useBayonThemeMode;
40
41
  exports.BayonThemeProvider = BayonThemeProvider;
41
42
  const jsx_runtime_1 = require("react/jsx-runtime");
42
43
  const React = __importStar(require("react"));
@@ -47,6 +48,22 @@ const styles_1 = require("@mui/material/styles");
47
48
  const createBayonTheme_js_1 = require("../theme/createBayonTheme.js");
48
49
  const createBayonEmotionCache_js_1 = require("../utils/createBayonEmotionCache.js");
49
50
  const clientSideEmotionCache = (0, createBayonEmotionCache_js_1.createBayonEmotionCache)();
51
+ const defaultStorageKey = 'bayon-theme-mode';
52
+ const BayonThemeModeContext = React.createContext(undefined);
53
+ function readStoredMode(storageKey, defaultMode) {
54
+ if (typeof window === 'undefined') {
55
+ return defaultMode;
56
+ }
57
+ const storedMode = window.localStorage.getItem(storageKey);
58
+ return storedMode === 'light' || storedMode === 'dark' ? storedMode : defaultMode;
59
+ }
60
+ function useBayonThemeMode() {
61
+ const context = React.useContext(BayonThemeModeContext);
62
+ if (!context) {
63
+ throw new Error('useBayonThemeMode must be used inside BayonThemeProvider.');
64
+ }
65
+ return context;
66
+ }
50
67
  class BayonThemeErrorBoundary extends React.Component {
51
68
  constructor(props) {
52
69
  super(props);
@@ -71,12 +88,34 @@ class BayonThemeErrorBoundary extends React.Component {
71
88
  return this.props.children;
72
89
  }
73
90
  }
74
- function BayonThemeProvider({ children, emotionCache = clientSideEmotionCache, disableEmotionCacheProvider = false, theme = createBayonTheme_js_1.bayonDarkTheme, enableErrorBoundary = true, }) {
91
+ function BayonThemeProvider({ children, emotionCache = clientSideEmotionCache, disableEmotionCacheProvider = false, theme, defaultMode = 'dark', storageKey = defaultStorageKey, enableErrorBoundary = true, }) {
92
+ const [mode, setModeState] = React.useState(defaultMode);
93
+ const setMode = React.useCallback((nextMode) => {
94
+ setModeState(nextMode);
95
+ if (typeof window !== 'undefined') {
96
+ window.localStorage.setItem(storageKey, nextMode);
97
+ }
98
+ }, [storageKey]);
99
+ const toggleMode = React.useCallback(() => {
100
+ setMode(mode === 'dark' ? 'light' : 'dark');
101
+ }, [mode, setMode]);
102
+ const activeTheme = React.useMemo(() => theme !== null && theme !== void 0 ? theme : (0, createBayonTheme_js_1.createBayonTheme)({ mode }), [mode, theme]);
103
+ const modeContextValue = React.useMemo(() => ({
104
+ mode,
105
+ setMode,
106
+ toggleMode,
107
+ }), [mode, setMode, toggleMode]);
108
+ React.useEffect(() => {
109
+ const storedMode = readStoredMode(storageKey, defaultMode);
110
+ if (storedMode !== mode) {
111
+ setModeState(storedMode);
112
+ }
113
+ }, [defaultMode, mode, storageKey]);
75
114
  React.useEffect(() => {
76
- document.documentElement.setAttribute('data-theme', 'dark');
77
- }, []);
115
+ document.documentElement.setAttribute('data-theme', mode);
116
+ }, [mode]);
78
117
  const content = enableErrorBoundary ? ((0, jsx_runtime_1.jsx)(BayonThemeErrorBoundary, { children: children })) : (children);
79
- const themedContent = ((0, jsx_runtime_1.jsxs)(styles_1.ThemeProvider, { theme: theme, children: [(0, jsx_runtime_1.jsx)(CssBaseline_1.default, { enableColorScheme: true }), content] }));
118
+ const themedContent = ((0, jsx_runtime_1.jsx)(styles_1.ThemeProvider, { theme: activeTheme, children: (0, jsx_runtime_1.jsxs)(BayonThemeModeContext.Provider, { value: modeContextValue, children: [(0, jsx_runtime_1.jsx)(CssBaseline_1.default, { enableColorScheme: true }), content] }) }));
80
119
  if (disableEmotionCacheProvider) {
81
120
  return themedContent;
82
121
  }
@@ -3,12 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.outlineButtonSx = exports.tealButtonSx = exports.mutedTextSx = exports.eyebrowSx = exports.darkCtaSx = exports.darkPanelHoverSx = exports.accentPanelSx = exports.darkPanelSx = exports.heroBodySx = exports.heroTitleSx = exports.heroStackSx = exports.heroContainerSx = exports.gradientHeroSx = exports.pageShellSx = void 0;
4
4
  const palette_js_1 = require("../theme/palette.js");
5
5
  exports.pageShellSx = {
6
- bgcolor: palette_js_1.bayonAccent.night,
7
- color: palette_js_1.bayonAccent.foreground,
6
+ bgcolor: 'var(--bayon-bg)',
7
+ color: 'var(--bayon-fg)',
8
8
  };
9
9
  exports.gradientHeroSx = {
10
- bgcolor: palette_js_1.bayonAccent.night,
11
- color: palette_js_1.bayonAccent.foreground,
10
+ bgcolor: 'var(--bayon-bg)',
11
+ color: 'var(--bayon-fg)',
12
12
  py: { xs: 8, md: 11 },
13
13
  position: 'relative',
14
14
  overflow: 'hidden',
@@ -16,7 +16,7 @@ exports.gradientHeroSx = {
16
16
  content: '""',
17
17
  position: 'absolute',
18
18
  inset: 0,
19
- background: 'linear-gradient(120deg, rgba(45, 212, 191, 0.2), transparent 34%), linear-gradient(55deg, transparent 48%, rgba(253, 224, 71, 0.14), transparent 70%), linear-gradient(150deg, transparent 40%, rgba(255, 107, 107, 0.16))',
19
+ background: 'linear-gradient(120deg, var(--bayon-hero-teal), transparent 34%), linear-gradient(55deg, transparent 48%, var(--bayon-hero-yellow), transparent 70%), linear-gradient(150deg, transparent 40%, var(--bayon-hero-coral))',
20
20
  pointerEvents: 'none',
21
21
  },
22
22
  };
@@ -28,20 +28,20 @@ exports.heroStackSx = {
28
28
  position: 'relative',
29
29
  };
30
30
  exports.heroTitleSx = {
31
- color: '#FFFFFF',
31
+ color: 'var(--bayon-heading)',
32
32
  fontSize: { xs: '2.75rem', md: '4.75rem' },
33
33
  lineHeight: 1,
34
34
  };
35
35
  exports.heroBodySx = {
36
- color: 'rgba(248, 250, 252, 0.78)',
36
+ color: 'var(--bayon-muted-strong)',
37
37
  fontSize: { xs: '1.1rem', md: '1.3rem' },
38
38
  lineHeight: 1.65,
39
39
  };
40
40
  exports.darkPanelSx = {
41
- bgcolor: 'rgba(248, 250, 252, 0.06)',
42
- border: '1px solid rgba(248, 250, 252, 0.14)',
41
+ bgcolor: 'var(--bayon-panel)',
42
+ border: '1px solid var(--bayon-border)',
43
43
  borderRadius: 2,
44
- boxShadow: '0 28px 80px rgba(2, 6, 23, 0.24)',
44
+ boxShadow: 'var(--bayon-panel-shadow)',
45
45
  };
46
46
  exports.accentPanelSx = {
47
47
  ...exports.darkPanelSx,
@@ -69,13 +69,13 @@ exports.darkPanelHoverSx = {
69
69
  '&:hover': {
70
70
  transform: 'translateY(-5px)',
71
71
  borderColor: 'rgba(45, 212, 191, 0.65)',
72
- bgcolor: 'rgba(248, 250, 252, 0.08)',
72
+ bgcolor: 'var(--bayon-panel-hover)',
73
73
  },
74
74
  };
75
75
  exports.darkCtaSx = {
76
- bgcolor: palette_js_1.bayonAccent.panel,
77
- color: palette_js_1.bayonAccent.foreground,
78
- border: '1px solid rgba(248, 250, 252, 0.14)',
76
+ bgcolor: 'var(--bayon-panel-solid)',
77
+ color: 'var(--bayon-fg)',
78
+ border: '1px solid var(--bayon-border)',
79
79
  borderRadius: 2,
80
80
  };
81
81
  exports.eyebrowSx = {
@@ -85,7 +85,7 @@ exports.eyebrowSx = {
85
85
  textTransform: 'uppercase',
86
86
  };
87
87
  exports.mutedTextSx = {
88
- color: 'rgba(248, 250, 252, 0.74)',
88
+ color: 'var(--bayon-muted)',
89
89
  lineHeight: 1.75,
90
90
  };
91
91
  exports.tealButtonSx = {
@@ -94,8 +94,8 @@ exports.tealButtonSx = {
94
94
  '&:hover': { bgcolor: palette_js_1.bayonAccent.tealLight },
95
95
  };
96
96
  exports.outlineButtonSx = {
97
- borderColor: 'rgba(248, 250, 252, 0.28)',
98
- color: palette_js_1.bayonAccent.foreground,
97
+ borderColor: 'var(--bayon-border-strong)',
98
+ color: 'var(--bayon-fg)',
99
99
  '&:hover': {
100
100
  borderColor: palette_js_1.bayonAccent.teal,
101
101
  bgcolor: 'rgba(45, 212, 191, 0.1)',
@@ -3,6 +3,66 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.bayonComponents = void 0;
4
4
  const shadows_js_1 = require("./shadows.js");
5
5
  exports.bayonComponents = {
6
+ MuiCssBaseline: {
7
+ styleOverrides: {
8
+ ':root, html[data-theme="dark"]': {
9
+ '--bayon-bg': '#0B1020',
10
+ '--bayon-bg-soft': '#111827',
11
+ '--bayon-fg': '#F8FAFC',
12
+ '--bayon-heading': '#FFFFFF',
13
+ '--bayon-muted': 'rgba(248, 250, 252, 0.74)',
14
+ '--bayon-muted-strong': 'rgba(248, 250, 252, 0.82)',
15
+ '--bayon-border': 'rgba(248, 250, 252, 0.14)',
16
+ '--bayon-border-strong': 'rgba(248, 250, 252, 0.28)',
17
+ '--bayon-panel': 'rgba(248, 250, 252, 0.06)',
18
+ '--bayon-panel-hover': 'rgba(248, 250, 252, 0.08)',
19
+ '--bayon-panel-solid': '#111827',
20
+ '--bayon-panel-shadow': '0 28px 80px rgba(2, 6, 23, 0.24)',
21
+ '--bayon-grid-line': 'rgba(248, 250, 252, 0.08)',
22
+ '--bayon-hero-teal': 'rgba(45, 212, 191, 0.2)',
23
+ '--bayon-hero-blue': 'rgba(96, 165, 250, 0.18)',
24
+ '--bayon-hero-yellow': 'rgba(253, 224, 71, 0.14)',
25
+ '--bayon-hero-coral': 'rgba(255, 107, 107, 0.16)',
26
+ '--bayon-link': '#A7F3D0',
27
+ '--bayon-link-hover': '#2DD4BF',
28
+ colorScheme: 'dark',
29
+ },
30
+ 'html[data-theme="light"]': {
31
+ '--bayon-bg': '#F7FAFC',
32
+ '--bayon-bg-soft': '#EAF2F7',
33
+ '--bayon-fg': '#10242A',
34
+ '--bayon-heading': '#08181D',
35
+ '--bayon-muted': 'rgba(16, 36, 42, 0.74)',
36
+ '--bayon-muted-strong': 'rgba(16, 36, 42, 0.84)',
37
+ '--bayon-border': 'rgba(15, 51, 61, 0.14)',
38
+ '--bayon-border-strong': 'rgba(15, 51, 61, 0.26)',
39
+ '--bayon-panel': 'rgba(255, 255, 255, 0.74)',
40
+ '--bayon-panel-hover': 'rgba(255, 255, 255, 0.9)',
41
+ '--bayon-panel-solid': '#FFFFFF',
42
+ '--bayon-panel-shadow': '0 18px 52px rgba(20, 63, 74, 0.13)',
43
+ '--bayon-grid-line': 'rgba(15, 51, 61, 0.08)',
44
+ '--bayon-hero-teal': 'rgba(20, 184, 166, 0.18)',
45
+ '--bayon-hero-blue': 'rgba(37, 99, 235, 0.13)',
46
+ '--bayon-hero-yellow': 'rgba(202, 138, 4, 0.12)',
47
+ '--bayon-hero-coral': 'rgba(225, 83, 83, 0.13)',
48
+ '--bayon-link': '#0F766E',
49
+ '--bayon-link-hover': '#0D9488',
50
+ colorScheme: 'light',
51
+ },
52
+ 'html, body': {
53
+ backgroundColor: 'var(--bayon-bg)',
54
+ color: 'var(--bayon-fg)',
55
+ },
56
+ 'body': {
57
+ transition: 'background-color 180ms ease, color 180ms ease',
58
+ },
59
+ '@media (prefers-reduced-motion: reduce)': {
60
+ body: {
61
+ transition: 'none',
62
+ },
63
+ },
64
+ },
65
+ },
6
66
  MuiButtonBase: {
7
67
  defaultProps: {
8
68
  disableRipple: true,
@@ -20,5 +20,26 @@ function createBayonTheme(options = {}) {
20
20
  };
21
21
  return (0, styles_1.responsiveFontSizes)((0, styles_1.createTheme)(baseTheme, overrides));
22
22
  }
23
- exports.bayonTheme = createBayonTheme();
24
- exports.bayonDarkTheme = createBayonTheme({ mode: 'dark' });
23
+ function createLazyBayonTheme(options = {}) {
24
+ let theme;
25
+ const getTheme = () => {
26
+ theme !== null && theme !== void 0 ? theme : (theme = createBayonTheme(options));
27
+ return theme;
28
+ };
29
+ return new Proxy({}, {
30
+ get(_target, prop) {
31
+ return getTheme()[prop];
32
+ },
33
+ getOwnPropertyDescriptor(_target, prop) {
34
+ return Object.getOwnPropertyDescriptor(getTheme(), prop);
35
+ },
36
+ has(_target, prop) {
37
+ return prop in getTheme();
38
+ },
39
+ ownKeys() {
40
+ return Reflect.ownKeys(getTheme());
41
+ },
42
+ });
43
+ }
44
+ exports.bayonTheme = createLazyBayonTheme();
45
+ exports.bayonDarkTheme = createLazyBayonTheme({ mode: 'dark' });
@@ -1,4 +1,5 @@
1
1
  "use client";
2
2
  export * from './components/IconTooltipButton.js';
3
3
  export * from './components/BayonFlowVisual.js';
4
+ export * from './components/BayonThemeModeToggle.js';
4
5
  export * from './providers/BayonThemeProvider.js';
@@ -29,10 +29,10 @@ const defaultItems = [
29
29
  export function BayonFlowVisual({ items = defaultItems, caption = 'idea -> AI system design -> production app', sx, ...props }) {
30
30
  return (_jsxs(Box, { "aria-hidden": "true", sx: mergeSx({
31
31
  minHeight: { xs: 320, md: 520 },
32
- border: '1px solid rgba(248, 250, 252, 0.22)',
32
+ border: '1px solid var(--bayon-border-strong)',
33
33
  borderRadius: 2,
34
- bgcolor: 'rgba(15, 23, 42, 0.78)',
35
- boxShadow: '0 34px 110px rgba(2, 6, 23, 0.48), inset 0 1px 0 rgba(248, 250, 252, 0.12)',
34
+ bgcolor: 'var(--bayon-panel-solid)',
35
+ boxShadow: '0 34px 110px rgba(2, 6, 23, 0.48), inset 0 1px 0 var(--bayon-border)',
36
36
  p: { xs: 3, md: 4 },
37
37
  display: 'grid',
38
38
  gridTemplateRows: 'auto 1fr auto',
@@ -66,8 +66,8 @@ export function BayonFlowVisual({ items = defaultItems, caption = 'idea -> AI sy
66
66
  },
67
67
  }, children: items.map((item, index) => (_jsxs(Box, { sx: {
68
68
  borderRadius: 2,
69
- border: '1px solid rgba(248, 250, 252, 0.16)',
70
- bgcolor: index === 2 ? 'rgba(253, 224, 71, 0.12)' : 'rgba(248, 250, 252, 0.08)',
69
+ border: '1px solid var(--bayon-border)',
70
+ bgcolor: index === 2 ? 'rgba(253, 224, 71, 0.12)' : 'var(--bayon-grid-line)',
71
71
  p: 2.5,
72
72
  display: 'flex',
73
73
  flexDirection: 'column',
@@ -77,5 +77,5 @@ export function BayonFlowVisual({ items = defaultItems, caption = 'idea -> AI sy
77
77
  '@media (prefers-reduced-motion: reduce)': {
78
78
  animation: 'none',
79
79
  },
80
- }, children: [_jsx(Typography, { sx: { color: item.color, fontWeight: 800, fontSize: '0.8rem', textTransform: 'uppercase' }, children: item.label }), _jsx(Typography, { sx: { color: '#F8FAFC', fontWeight: 700, fontSize: { xs: '1rem', md: '1.18rem' } }, children: item.value })] }, `${String(item.label)}-${index}`))) }), _jsx(Typography, { sx: { color: 'rgba(248, 250, 252, 0.72)', fontSize: '0.95rem' }, children: caption })] }));
80
+ }, children: [_jsx(Typography, { sx: { color: item.color, fontWeight: 800, fontSize: '0.8rem', textTransform: 'uppercase' }, children: item.label }), _jsx(Typography, { sx: { color: 'var(--bayon-fg)', fontWeight: 700, fontSize: { xs: '1rem', md: '1.18rem' } }, children: item.value })] }, `${String(item.label)}-${index}`))) }), _jsx(Typography, { sx: { color: 'var(--bayon-muted)', fontSize: '0.95rem' }, children: caption })] }));
81
81
  }
@@ -0,0 +1,28 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import DarkModeIcon from '@mui/icons-material/DarkMode';
4
+ import LightModeIcon from '@mui/icons-material/LightMode';
5
+ import { useBayonThemeMode } from '../providers/BayonThemeProvider.js';
6
+ import { IconTooltipButton } from './IconTooltipButton.js';
7
+ function mergeSx(...items) {
8
+ return items.flat().filter(Boolean);
9
+ }
10
+ export function BayonThemeModeToggle({ sx }) {
11
+ const { mode, toggleMode } = useBayonThemeMode();
12
+ const nextMode = mode === 'dark' ? 'light' : 'dark';
13
+ return (_jsx(IconTooltipButton, { label: `Switch to ${nextMode} mode`, onClick: toggleMode, sx: mergeSx({
14
+ color: 'var(--bayon-fg)',
15
+ border: '1px solid var(--bayon-border)',
16
+ bgcolor: 'var(--bayon-panel)',
17
+ transition: 'border-color 180ms ease, background-color 180ms ease, color 180ms ease',
18
+ '&:hover': {
19
+ bgcolor: 'rgba(45, 212, 191, 0.12)',
20
+ borderColor: 'var(--bayon-link-hover)',
21
+ color: 'var(--bayon-link-hover)',
22
+ },
23
+ '&:focus-visible': {
24
+ outline: '2px solid rgba(45, 212, 191, 0.52)',
25
+ outlineOffset: 3,
26
+ },
27
+ }, sx), children: mode === 'dark' ? _jsx(LightModeIcon, { fontSize: "small" }) : _jsx(DarkModeIcon, { fontSize: "small" }) }));
28
+ }
@@ -24,9 +24,9 @@ export function BayonCtaPanel({ sx, ...props }) {
24
24
  export function BayonContentBox({ sx, ...props }) {
25
25
  return (_jsx(Box, { sx: mergeSx({
26
26
  p: { xs: 3, md: 4 },
27
- border: '1px solid rgba(248, 250, 252, 0.14)',
27
+ border: '1px solid var(--bayon-border)',
28
28
  borderRadius: 2,
29
- bgcolor: 'rgba(248, 250, 252, 0.06)',
29
+ bgcolor: 'var(--bayon-panel)',
30
30
  }, sx), ...props }));
31
31
  }
32
32
  export function BayonMethodBox({ accentColor = '#2DD4BF', sx, ...props }) {
@@ -41,21 +41,21 @@ export function BayonProjectCard({ category, status, title, body, actions, child
41
41
  minHeight: 290,
42
42
  display: 'flex',
43
43
  flexDirection: 'column',
44
- }, sx), ...props, children: [category && (_jsx(Typography, { sx: { color: '#2DD4BF', fontWeight: 800, fontSize: '0.82rem', textTransform: 'uppercase', mb: 1.5 }, children: category })), title && (_jsx(Typography, { variant: "h5", sx: { color: '#FFFFFF', mb: 2 }, children: title })), body && _jsx(Typography, { sx: { color: 'rgba(248, 250, 252, 0.74)', lineHeight: 1.75, mb: 3 }, children: body }), children, status && _jsx(Typography, { sx: { color: '#FDE047', fontWeight: 700, mt: 'auto' }, children: status }), actions] }));
44
+ }, sx), ...props, children: [category && (_jsx(Typography, { sx: { color: '#2DD4BF', fontWeight: 800, fontSize: '0.82rem', textTransform: 'uppercase', mb: 1.5 }, children: category })), title && (_jsx(Typography, { variant: "h5", sx: { color: 'var(--bayon-heading)', mb: 2 }, children: title })), body && _jsx(Typography, { sx: { color: 'var(--bayon-muted)', lineHeight: 1.75, mb: 3 }, children: body }), children, status && _jsx(Typography, { sx: { color: '#FDE047', fontWeight: 700, mt: 'auto' }, children: status }), actions] }));
45
45
  }
46
46
  export function BayonPillarCard({ accentColor = '#2DD4BF', eyebrow, title, body, actions, children, sx, ...props }) {
47
47
  return (_jsxs(Box, { sx: mergeSx({
48
48
  p: { xs: 3, md: 5 },
49
- border: '1px solid rgba(248, 250, 252, 0.14)',
49
+ border: '1px solid var(--bayon-border)',
50
50
  borderRadius: 2,
51
- bgcolor: 'rgba(248, 250, 252, 0.06)',
52
- boxShadow: '0 28px 80px rgba(2, 6, 23, 0.24)',
51
+ bgcolor: 'var(--bayon-panel)',
52
+ boxShadow: 'var(--bayon-panel-shadow)',
53
53
  transition: 'transform 180ms ease, border-color 180ms ease',
54
54
  '&:hover': {
55
55
  transform: 'translateY(-5px)',
56
56
  borderColor: accentColor,
57
57
  },
58
- }, sx), ...props, children: [eyebrow && (_jsx(Typography, { sx: { color: accentColor, fontSize: '0.82rem', fontWeight: 800, textTransform: 'uppercase', mb: 1.5 }, children: eyebrow })), title && (_jsx(Typography, { variant: "h3", sx: { color: '#FFFFFF', mb: 2 }, children: title })), body && _jsx(Typography, { sx: { color: 'rgba(248, 250, 252, 0.74)', lineHeight: 1.75 }, children: body }), children, actions] }));
58
+ }, sx), ...props, children: [eyebrow && (_jsx(Typography, { sx: { color: accentColor, fontSize: '0.82rem', fontWeight: 800, textTransform: 'uppercase', mb: 1.5 }, children: eyebrow })), title && (_jsx(Typography, { variant: "h3", sx: { color: 'var(--bayon-heading)', mb: 2 }, children: title })), body && _jsx(Typography, { sx: { color: 'var(--bayon-muted)', lineHeight: 1.75 }, children: body }), children, actions] }));
59
59
  }
60
60
  export function BayonTechChip({ label, children, sx, ...props }) {
61
61
  return (_jsx(Box, { sx: mergeSx({
@@ -5,9 +5,25 @@ import { CacheProvider } from '@emotion/react';
5
5
  import Box from '@mui/material/Box';
6
6
  import CssBaseline from '@mui/material/CssBaseline';
7
7
  import { ThemeProvider } from '@mui/material/styles';
8
- import { bayonDarkTheme } from '../theme/createBayonTheme.js';
8
+ import { createBayonTheme } from '../theme/createBayonTheme.js';
9
9
  import { createBayonEmotionCache } from '../utils/createBayonEmotionCache.js';
10
10
  const clientSideEmotionCache = createBayonEmotionCache();
11
+ const defaultStorageKey = 'bayon-theme-mode';
12
+ const BayonThemeModeContext = React.createContext(undefined);
13
+ function readStoredMode(storageKey, defaultMode) {
14
+ if (typeof window === 'undefined') {
15
+ return defaultMode;
16
+ }
17
+ const storedMode = window.localStorage.getItem(storageKey);
18
+ return storedMode === 'light' || storedMode === 'dark' ? storedMode : defaultMode;
19
+ }
20
+ export function useBayonThemeMode() {
21
+ const context = React.useContext(BayonThemeModeContext);
22
+ if (!context) {
23
+ throw new Error('useBayonThemeMode must be used inside BayonThemeProvider.');
24
+ }
25
+ return context;
26
+ }
11
27
  class BayonThemeErrorBoundary extends React.Component {
12
28
  constructor(props) {
13
29
  super(props);
@@ -32,12 +48,34 @@ class BayonThemeErrorBoundary extends React.Component {
32
48
  return this.props.children;
33
49
  }
34
50
  }
35
- export function BayonThemeProvider({ children, emotionCache = clientSideEmotionCache, disableEmotionCacheProvider = false, theme = bayonDarkTheme, enableErrorBoundary = true, }) {
51
+ export function BayonThemeProvider({ children, emotionCache = clientSideEmotionCache, disableEmotionCacheProvider = false, theme, defaultMode = 'dark', storageKey = defaultStorageKey, enableErrorBoundary = true, }) {
52
+ const [mode, setModeState] = React.useState(defaultMode);
53
+ const setMode = React.useCallback((nextMode) => {
54
+ setModeState(nextMode);
55
+ if (typeof window !== 'undefined') {
56
+ window.localStorage.setItem(storageKey, nextMode);
57
+ }
58
+ }, [storageKey]);
59
+ const toggleMode = React.useCallback(() => {
60
+ setMode(mode === 'dark' ? 'light' : 'dark');
61
+ }, [mode, setMode]);
62
+ const activeTheme = React.useMemo(() => theme !== null && theme !== void 0 ? theme : createBayonTheme({ mode }), [mode, theme]);
63
+ const modeContextValue = React.useMemo(() => ({
64
+ mode,
65
+ setMode,
66
+ toggleMode,
67
+ }), [mode, setMode, toggleMode]);
68
+ React.useEffect(() => {
69
+ const storedMode = readStoredMode(storageKey, defaultMode);
70
+ if (storedMode !== mode) {
71
+ setModeState(storedMode);
72
+ }
73
+ }, [defaultMode, mode, storageKey]);
36
74
  React.useEffect(() => {
37
- document.documentElement.setAttribute('data-theme', 'dark');
38
- }, []);
75
+ document.documentElement.setAttribute('data-theme', mode);
76
+ }, [mode]);
39
77
  const content = enableErrorBoundary ? (_jsx(BayonThemeErrorBoundary, { children: children })) : (children);
40
- const themedContent = (_jsxs(ThemeProvider, { theme: theme, children: [_jsx(CssBaseline, { enableColorScheme: true }), content] }));
78
+ const themedContent = (_jsx(ThemeProvider, { theme: activeTheme, children: _jsxs(BayonThemeModeContext.Provider, { value: modeContextValue, children: [_jsx(CssBaseline, { enableColorScheme: true }), content] }) }));
41
79
  if (disableEmotionCacheProvider) {
42
80
  return themedContent;
43
81
  }
@@ -1,11 +1,11 @@
1
1
  import { bayonAccent } from '../theme/palette.js';
2
2
  export const pageShellSx = {
3
- bgcolor: bayonAccent.night,
4
- color: bayonAccent.foreground,
3
+ bgcolor: 'var(--bayon-bg)',
4
+ color: 'var(--bayon-fg)',
5
5
  };
6
6
  export const gradientHeroSx = {
7
- bgcolor: bayonAccent.night,
8
- color: bayonAccent.foreground,
7
+ bgcolor: 'var(--bayon-bg)',
8
+ color: 'var(--bayon-fg)',
9
9
  py: { xs: 8, md: 11 },
10
10
  position: 'relative',
11
11
  overflow: 'hidden',
@@ -13,7 +13,7 @@ export const gradientHeroSx = {
13
13
  content: '""',
14
14
  position: 'absolute',
15
15
  inset: 0,
16
- background: 'linear-gradient(120deg, rgba(45, 212, 191, 0.2), transparent 34%), linear-gradient(55deg, transparent 48%, rgba(253, 224, 71, 0.14), transparent 70%), linear-gradient(150deg, transparent 40%, rgba(255, 107, 107, 0.16))',
16
+ background: 'linear-gradient(120deg, var(--bayon-hero-teal), transparent 34%), linear-gradient(55deg, transparent 48%, var(--bayon-hero-yellow), transparent 70%), linear-gradient(150deg, transparent 40%, var(--bayon-hero-coral))',
17
17
  pointerEvents: 'none',
18
18
  },
19
19
  };
@@ -25,20 +25,20 @@ export const heroStackSx = {
25
25
  position: 'relative',
26
26
  };
27
27
  export const heroTitleSx = {
28
- color: '#FFFFFF',
28
+ color: 'var(--bayon-heading)',
29
29
  fontSize: { xs: '2.75rem', md: '4.75rem' },
30
30
  lineHeight: 1,
31
31
  };
32
32
  export const heroBodySx = {
33
- color: 'rgba(248, 250, 252, 0.78)',
33
+ color: 'var(--bayon-muted-strong)',
34
34
  fontSize: { xs: '1.1rem', md: '1.3rem' },
35
35
  lineHeight: 1.65,
36
36
  };
37
37
  export const darkPanelSx = {
38
- bgcolor: 'rgba(248, 250, 252, 0.06)',
39
- border: '1px solid rgba(248, 250, 252, 0.14)',
38
+ bgcolor: 'var(--bayon-panel)',
39
+ border: '1px solid var(--bayon-border)',
40
40
  borderRadius: 2,
41
- boxShadow: '0 28px 80px rgba(2, 6, 23, 0.24)',
41
+ boxShadow: 'var(--bayon-panel-shadow)',
42
42
  };
43
43
  export const accentPanelSx = {
44
44
  ...darkPanelSx,
@@ -66,13 +66,13 @@ export const darkPanelHoverSx = {
66
66
  '&:hover': {
67
67
  transform: 'translateY(-5px)',
68
68
  borderColor: 'rgba(45, 212, 191, 0.65)',
69
- bgcolor: 'rgba(248, 250, 252, 0.08)',
69
+ bgcolor: 'var(--bayon-panel-hover)',
70
70
  },
71
71
  };
72
72
  export const darkCtaSx = {
73
- bgcolor: bayonAccent.panel,
74
- color: bayonAccent.foreground,
75
- border: '1px solid rgba(248, 250, 252, 0.14)',
73
+ bgcolor: 'var(--bayon-panel-solid)',
74
+ color: 'var(--bayon-fg)',
75
+ border: '1px solid var(--bayon-border)',
76
76
  borderRadius: 2,
77
77
  };
78
78
  export const eyebrowSx = {
@@ -82,7 +82,7 @@ export const eyebrowSx = {
82
82
  textTransform: 'uppercase',
83
83
  };
84
84
  export const mutedTextSx = {
85
- color: 'rgba(248, 250, 252, 0.74)',
85
+ color: 'var(--bayon-muted)',
86
86
  lineHeight: 1.75,
87
87
  };
88
88
  export const tealButtonSx = {
@@ -91,8 +91,8 @@ export const tealButtonSx = {
91
91
  '&:hover': { bgcolor: bayonAccent.tealLight },
92
92
  };
93
93
  export const outlineButtonSx = {
94
- borderColor: 'rgba(248, 250, 252, 0.28)',
95
- color: bayonAccent.foreground,
94
+ borderColor: 'var(--bayon-border-strong)',
95
+ color: 'var(--bayon-fg)',
96
96
  '&:hover': {
97
97
  borderColor: bayonAccent.teal,
98
98
  bgcolor: 'rgba(45, 212, 191, 0.1)',
@@ -1,5 +1,65 @@
1
1
  import { bayonShadows } from './shadows.js';
2
2
  export const bayonComponents = {
3
+ MuiCssBaseline: {
4
+ styleOverrides: {
5
+ ':root, html[data-theme="dark"]': {
6
+ '--bayon-bg': '#0B1020',
7
+ '--bayon-bg-soft': '#111827',
8
+ '--bayon-fg': '#F8FAFC',
9
+ '--bayon-heading': '#FFFFFF',
10
+ '--bayon-muted': 'rgba(248, 250, 252, 0.74)',
11
+ '--bayon-muted-strong': 'rgba(248, 250, 252, 0.82)',
12
+ '--bayon-border': 'rgba(248, 250, 252, 0.14)',
13
+ '--bayon-border-strong': 'rgba(248, 250, 252, 0.28)',
14
+ '--bayon-panel': 'rgba(248, 250, 252, 0.06)',
15
+ '--bayon-panel-hover': 'rgba(248, 250, 252, 0.08)',
16
+ '--bayon-panel-solid': '#111827',
17
+ '--bayon-panel-shadow': '0 28px 80px rgba(2, 6, 23, 0.24)',
18
+ '--bayon-grid-line': 'rgba(248, 250, 252, 0.08)',
19
+ '--bayon-hero-teal': 'rgba(45, 212, 191, 0.2)',
20
+ '--bayon-hero-blue': 'rgba(96, 165, 250, 0.18)',
21
+ '--bayon-hero-yellow': 'rgba(253, 224, 71, 0.14)',
22
+ '--bayon-hero-coral': 'rgba(255, 107, 107, 0.16)',
23
+ '--bayon-link': '#A7F3D0',
24
+ '--bayon-link-hover': '#2DD4BF',
25
+ colorScheme: 'dark',
26
+ },
27
+ 'html[data-theme="light"]': {
28
+ '--bayon-bg': '#F7FAFC',
29
+ '--bayon-bg-soft': '#EAF2F7',
30
+ '--bayon-fg': '#10242A',
31
+ '--bayon-heading': '#08181D',
32
+ '--bayon-muted': 'rgba(16, 36, 42, 0.74)',
33
+ '--bayon-muted-strong': 'rgba(16, 36, 42, 0.84)',
34
+ '--bayon-border': 'rgba(15, 51, 61, 0.14)',
35
+ '--bayon-border-strong': 'rgba(15, 51, 61, 0.26)',
36
+ '--bayon-panel': 'rgba(255, 255, 255, 0.74)',
37
+ '--bayon-panel-hover': 'rgba(255, 255, 255, 0.9)',
38
+ '--bayon-panel-solid': '#FFFFFF',
39
+ '--bayon-panel-shadow': '0 18px 52px rgba(20, 63, 74, 0.13)',
40
+ '--bayon-grid-line': 'rgba(15, 51, 61, 0.08)',
41
+ '--bayon-hero-teal': 'rgba(20, 184, 166, 0.18)',
42
+ '--bayon-hero-blue': 'rgba(37, 99, 235, 0.13)',
43
+ '--bayon-hero-yellow': 'rgba(202, 138, 4, 0.12)',
44
+ '--bayon-hero-coral': 'rgba(225, 83, 83, 0.13)',
45
+ '--bayon-link': '#0F766E',
46
+ '--bayon-link-hover': '#0D9488',
47
+ colorScheme: 'light',
48
+ },
49
+ 'html, body': {
50
+ backgroundColor: 'var(--bayon-bg)',
51
+ color: 'var(--bayon-fg)',
52
+ },
53
+ 'body': {
54
+ transition: 'background-color 180ms ease, color 180ms ease',
55
+ },
56
+ '@media (prefers-reduced-motion: reduce)': {
57
+ body: {
58
+ transition: 'none',
59
+ },
60
+ },
61
+ },
62
+ },
3
63
  MuiButtonBase: {
4
64
  defaultProps: {
5
65
  disableRipple: true,
@@ -16,5 +16,26 @@ export function createBayonTheme(options = {}) {
16
16
  };
17
17
  return responsiveFontSizes(createTheme(baseTheme, overrides));
18
18
  }
19
- export const bayonTheme = createBayonTheme();
20
- export const bayonDarkTheme = createBayonTheme({ mode: 'dark' });
19
+ function createLazyBayonTheme(options = {}) {
20
+ let theme;
21
+ const getTheme = () => {
22
+ theme !== null && theme !== void 0 ? theme : (theme = createBayonTheme(options));
23
+ return theme;
24
+ };
25
+ return new Proxy({}, {
26
+ get(_target, prop) {
27
+ return getTheme()[prop];
28
+ },
29
+ getOwnPropertyDescriptor(_target, prop) {
30
+ return Object.getOwnPropertyDescriptor(getTheme(), prop);
31
+ },
32
+ has(_target, prop) {
33
+ return prop in getTheme();
34
+ },
35
+ ownKeys() {
36
+ return Reflect.ownKeys(getTheme());
37
+ },
38
+ });
39
+ }
40
+ export const bayonTheme = createLazyBayonTheme();
41
+ export const bayonDarkTheme = createLazyBayonTheme({ mode: 'dark' });
@@ -1,3 +1,4 @@
1
1
  export * from './components/IconTooltipButton.js';
2
2
  export * from './components/BayonFlowVisual.js';
3
+ export * from './components/BayonThemeModeToggle.js';
3
4
  export * from './providers/BayonThemeProvider.js';
@@ -0,0 +1,6 @@
1
+ import * as React from 'react';
2
+ import type { SxProps, Theme } from '@mui/material/styles';
3
+ export interface BayonThemeModeToggleProps {
4
+ sx?: SxProps<Theme>;
5
+ }
6
+ export declare function BayonThemeModeToggle({ sx }: BayonThemeModeToggleProps): React.JSX.Element;
@@ -1,11 +1,20 @@
1
1
  import * as React from 'react';
2
2
  import { type EmotionCache } from '@emotion/react';
3
3
  import { ThemeProvider } from '@mui/material/styles';
4
+ export type BayonThemeMode = 'light' | 'dark';
5
+ export interface BayonThemeModeContextValue {
6
+ mode: BayonThemeMode;
7
+ setMode: (mode: BayonThemeMode) => void;
8
+ toggleMode: () => void;
9
+ }
4
10
  export interface BayonThemeProviderProps {
5
11
  children: React.ReactNode;
6
12
  emotionCache?: EmotionCache;
7
13
  disableEmotionCacheProvider?: boolean;
8
14
  theme?: Parameters<typeof ThemeProvider>[0]['theme'];
15
+ defaultMode?: BayonThemeMode;
16
+ storageKey?: string;
9
17
  enableErrorBoundary?: boolean;
10
18
  }
11
- export declare function BayonThemeProvider({ children, emotionCache, disableEmotionCacheProvider, theme, enableErrorBoundary, }: BayonThemeProviderProps): React.JSX.Element;
19
+ export declare function useBayonThemeMode(): BayonThemeModeContextValue;
20
+ export declare function BayonThemeProvider({ children, emotionCache, disableEmotionCacheProvider, theme, defaultMode, storageKey, enableErrorBoundary, }: BayonThemeProviderProps): React.JSX.Element;
package/package.json CHANGED
@@ -1,48 +1,48 @@
1
- {
2
- "name": "@bayonai/mui-design",
3
- "version": "0.2.1",
4
- "description": "Shared Bayon AI Material UI theme, style recipes, and reusable design components.",
5
- "license": "UNLICENSED",
6
- "type": "module",
7
- "main": "./dist/cjs/index.js",
8
- "module": "./dist/esm/index.js",
9
- "types": "./dist/types/index.d.ts",
10
- "exports": {
11
- ".": {
12
- "types": "./dist/types/index.d.ts",
13
- "import": "./dist/esm/index.js",
14
- "require": "./dist/cjs/index.js"
15
- },
16
- "./client": {
17
- "types": "./dist/types/client.d.ts",
18
- "import": "./dist/esm/client.js",
19
- "require": "./dist/cjs/client.js"
20
- }
21
- },
22
- "files": [
23
- "dist",
24
- "README.md",
25
- "CHANGELOG.md"
26
- ],
27
- "publishConfig": {
28
- "access": "public"
29
- },
30
- "scripts": {
31
- "clean": "node -e \"require('fs').rmSync('dist', { recursive: true, force: true })\"",
32
- "build": "npm run clean && tsc -p tsconfig.esm.json && tsc -p tsconfig.cjs.json && tsc -p tsconfig.types.json && node scripts/rename-cjs.cjs",
33
- "typecheck": "tsc -p tsconfig.types.json --noEmit"
34
- },
35
- "peerDependencies": {
36
- "@emotion/cache": "^11.14.0",
37
- "@emotion/react": "^11.14.0",
38
- "@emotion/styled": "^11.14.0",
39
- "@mui/icons-material": "^9.1.0",
40
- "@mui/material": "^9.1.0",
41
- "@mui/material-pigment-css": "^9.1.0",
42
- "react": "^19.0.0",
43
- "react-dom": "^19.0.0"
44
- },
45
- "devDependencies": {
46
- "typescript": "^5"
47
- }
48
- }
1
+ {
2
+ "name": "@bayonai/mui-design",
3
+ "version": "1.0.0",
4
+ "description": "Shared Bayon AI Material UI theme, style recipes, and reusable design components.",
5
+ "license": "UNLICENSED",
6
+ "type": "module",
7
+ "main": "./dist/cjs/index.js",
8
+ "module": "./dist/esm/index.js",
9
+ "types": "./dist/types/index.d.ts",
10
+ "exports": {
11
+ ".": {
12
+ "types": "./dist/types/index.d.ts",
13
+ "import": "./dist/esm/index.js",
14
+ "require": "./dist/cjs/index.js"
15
+ },
16
+ "./client": {
17
+ "types": "./dist/types/client.d.ts",
18
+ "import": "./dist/esm/client.js",
19
+ "require": "./dist/cjs/client.js"
20
+ }
21
+ },
22
+ "files": [
23
+ "dist",
24
+ "README.md",
25
+ "CHANGELOG.md"
26
+ ],
27
+ "publishConfig": {
28
+ "access": "public"
29
+ },
30
+ "scripts": {
31
+ "clean": "node -e \"require('fs').rmSync('dist', { recursive: true, force: true })\"",
32
+ "build": "npm run clean && tsc -p tsconfig.esm.json && tsc -p tsconfig.cjs.json && tsc -p tsconfig.types.json && node scripts/rename-cjs.cjs",
33
+ "typecheck": "tsc -p tsconfig.types.json --noEmit"
34
+ },
35
+ "peerDependencies": {
36
+ "@emotion/cache": "^11.14.0",
37
+ "@emotion/react": "^11.14.0",
38
+ "@emotion/styled": "^11.14.0",
39
+ "@mui/icons-material": "^9.1.0",
40
+ "@mui/material": "^9.1.0",
41
+ "@mui/material-pigment-css": "^9.1.0",
42
+ "react": "^19.0.0",
43
+ "react-dom": "^19.0.0"
44
+ },
45
+ "devDependencies": {
46
+ "typescript": "^5"
47
+ }
48
+ }