@rufous/ui 0.2.0-beta.0 → 0.2.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # @rufous/ui
2
2
 
3
+ > [!CAUTION]
4
+ > **Stability: Experimental / Beta**
5
+ > This package is currently in early development. Breaking changes, bugs, and API updates are expected. We recommend using it in non-critical environments until a stable `1.0.0` version is released.
6
+
3
7
  A lightweight React UI component library with theming, buttons, inputs, dialogs, progress and a rich icon set.
4
8
 
5
9
  ---
@@ -26,7 +26,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  ));
27
27
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
28
 
29
- // lib/CheckBoxes/CheckBox.jsx
29
+ // lib/CheckBoxes/CheckBox.tsx
30
30
  var CheckBox_exports = {};
31
31
  __export(CheckBox_exports, {
32
32
  Checkbox: () => Checkbox
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Checkbox
3
- } from "../chunk-X357WQOT.js";
3
+ } from "../chunk-NEGQXBQV.js";
4
4
  import "../chunk-LI4N7JWK.js";
5
5
  export {
6
6
  Checkbox
@@ -49,7 +49,14 @@ var APP_THEMES = {
49
49
  border: "#e0e0e0",
50
50
  hover: "#fff5f5",
51
51
  selection: "#fce4ec",
52
- icon: "#a41b06"
52
+ icon: "#a41b06",
53
+ get customStyles() {
54
+ return {
55
+ iconColor: this.icon,
56
+ primaryColor: this.primary,
57
+ secondaryColor: this.secondary
58
+ };
59
+ }
53
60
  },
54
61
  dark: {
55
62
  primary: "#dc2626",
@@ -61,7 +68,14 @@ var APP_THEMES = {
61
68
  border: "#333333",
62
69
  hover: "#2d1a1a",
63
70
  selection: "#4a1212",
64
- icon: "#dc2626"
71
+ icon: "#dc2626",
72
+ get customStyles() {
73
+ return {
74
+ iconColor: this.icon,
75
+ primaryColor: this.primary,
76
+ secondaryColor: this.secondary
77
+ };
78
+ }
65
79
  }
66
80
  },
67
81
  slate: {
@@ -76,7 +90,14 @@ var APP_THEMES = {
76
90
  border: "#e2e8f0",
77
91
  hover: "#f1f5f9",
78
92
  selection: "#e0f2fe",
79
- icon: "#334155"
93
+ icon: "#334155",
94
+ get customStyles() {
95
+ return {
96
+ iconColor: this.icon,
97
+ primaryColor: this.primary,
98
+ secondaryColor: this.secondary
99
+ };
100
+ }
80
101
  },
81
102
  dark: {
82
103
  primary: "#94a3b8",
@@ -88,7 +109,14 @@ var APP_THEMES = {
88
109
  border: "#334155",
89
110
  hover: "#1e293b",
90
111
  selection: "#0c4a6e",
91
- icon: "#94a3b8"
112
+ icon: "#94a3b8",
113
+ get customStyles() {
114
+ return {
115
+ iconColor: this.icon,
116
+ primaryColor: this.primary,
117
+ secondaryColor: this.secondary
118
+ };
119
+ }
92
120
  }
93
121
  }
94
122
  };
@@ -107,26 +135,45 @@ var RufousThemeProvider = ({ children }) => {
107
135
  const themeVars = (0, import_react.useMemo)(() => {
108
136
  const config = APP_THEMES[colorScheme][mode];
109
137
  return {
138
+ "--rufous-primary-color": config.primary,
139
+ "--rufous-secondary-color": config.secondary,
140
+ "--rufous-background-color": config.background,
141
+ "--rufous-surface-color": config.surface,
142
+ "--rufous-text-color": config.text,
143
+ "--rufous-text-secondary": config.textSecondary,
144
+ "--rufous-border-color": config.border,
145
+ "--rufous-hover-color": config.hover,
146
+ "--rufous-selection-color": config.selection,
147
+ "--rufous-icon-color": config.icon,
148
+ // Keep legacy variables for backward compatibility during transition
110
149
  "--primary-color": config.primary,
111
- "--secondary-color": config.secondary,
112
150
  "--background-color": config.background,
113
- "--surface-color": config.surface,
114
151
  "--text-color": config.text,
115
- "--text-secondary": config.textSecondary,
116
152
  "--border-color": config.border,
117
- "--hover-color": config.hover,
118
- "--selection-color": config.selection,
119
- "--icon-color": config.icon
153
+ "--surface-color": config.surface
120
154
  };
121
155
  }, [colorScheme, mode]);
122
156
  const toggleMode = () => {
123
157
  const newMode = mode === "light" ? "dark" : "light";
124
158
  setMode(newMode);
125
- localStorage.setItem("themeMode", newMode);
126
159
  };
127
160
  const changeScheme = (scheme) => {
128
- setColorScheme(scheme);
129
- localStorage.setItem("colorScheme", scheme);
161
+ if (APP_THEMES[scheme]) {
162
+ setColorScheme(scheme);
163
+ }
164
+ };
165
+ const saveTheme = () => {
166
+ localStorage.setItem("colorScheme", colorScheme);
167
+ localStorage.setItem("themeMode", mode);
168
+ };
169
+ const updateSettings = (settings) => {
170
+ if (!settings) return;
171
+ if (settings.theme && APP_THEMES[settings.theme]) {
172
+ setColorScheme(settings.theme);
173
+ }
174
+ if (settings.mode) {
175
+ setMode(settings.mode);
176
+ }
130
177
  };
131
178
  return /* @__PURE__ */ import_react.default.createElement(
132
179
  RufousThemeContext.Provider,
@@ -136,6 +183,11 @@ var RufousThemeProvider = ({ children }) => {
136
183
  mode,
137
184
  toggleMode,
138
185
  changeScheme,
186
+ previewTheme: changeScheme,
187
+ updateSettings,
188
+ saveTheme,
189
+ theme: APP_THEMES[colorScheme][mode],
190
+ // Direct access to current theme config
139
191
  themeConfig: APP_THEMES[colorScheme][mode]
140
192
  }
141
193
  },
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  RufousThemeProvider,
3
3
  useRufousTheme
4
- } from "../chunk-WNZLBFLQ.js";
5
- import "../chunk-QGXXOQJF.js";
4
+ } from "../chunk-HMG3FW2Q.js";
5
+ import "../chunk-YXPBXCY5.js";
6
6
  import "../chunk-LI4N7JWK.js";
7
7
  export {
8
8
  RufousThemeProvider,