@rufous/ui 0.1.62 → 0.2.0-beta.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.
Files changed (217) hide show
  1. package/dist/Buttons/addButton.js +1 -0
  2. package/dist/Buttons/cancelButton.js +1 -0
  3. package/dist/Buttons/index.cjs +2 -2
  4. package/dist/Buttons/index.js +3 -2
  5. package/dist/Buttons/stdButton.js +1 -0
  6. package/dist/Buttons/submitButton.cjs +2 -2
  7. package/dist/Buttons/submitButton.js +3 -2
  8. package/dist/CheckBoxes/CheckBox.cjs +1 -1
  9. package/dist/CheckBoxes/CheckBox.js +4 -25
  10. package/dist/Contexts/rufousThemeProvider.cjs +81 -101
  11. package/dist/Contexts/rufousThemeProvider.js +3 -2
  12. package/dist/DataGrid/DataGrid.cjs +418 -0
  13. package/dist/DataGrid/DataGrid.d.cts +8 -0
  14. package/dist/DataGrid/DataGrid.d.ts +8 -0
  15. package/dist/DataGrid/DataGrid.js +9 -0
  16. package/dist/DataGrid/index.cjs +418 -0
  17. package/dist/DataGrid/index.d.cts +3 -0
  18. package/dist/DataGrid/index.d.ts +3 -0
  19. package/dist/DataGrid/index.js +8 -0
  20. package/dist/{TextFields/FloatingInput.d.cjs → DataGrid/types.cjs} +3 -3
  21. package/dist/DataGrid/types.d.cts +31 -0
  22. package/dist/DataGrid/types.d.ts +31 -0
  23. package/dist/Dialogs/BaseDialog.cjs +18 -10
  24. package/dist/Dialogs/BaseDialog.css +8248 -163
  25. package/dist/Dialogs/BaseDialog.d.cts +1 -0
  26. package/dist/Dialogs/BaseDialog.d.ts +1 -0
  27. package/dist/Dialogs/BaseDialog.js +52 -45
  28. package/dist/Dialogs/index.cjs +18 -10
  29. package/dist/Dialogs/index.css +8248 -163
  30. package/dist/Dialogs/index.js +52 -45
  31. package/dist/Editors/RichTextEditor.cjs +29477 -0
  32. package/dist/Editors/RichTextEditor.css +7179 -0
  33. package/dist/Editors/RichTextEditor.d.cts +57 -0
  34. package/dist/Editors/RichTextEditor.d.ts +57 -0
  35. package/dist/Editors/RichTextEditor.js +9 -0
  36. package/dist/Editors/index.cjs +29477 -0
  37. package/dist/Editors/index.css +7179 -0
  38. package/dist/Editors/index.d.cts +2 -0
  39. package/dist/Editors/index.d.ts +2 -0
  40. package/dist/Editors/index.js +8 -0
  41. package/dist/Progress/circularProgress.cjs +2 -2
  42. package/dist/Progress/circularProgress.d.cts +3 -3
  43. package/dist/Progress/circularProgress.d.ts +3 -3
  44. package/dist/Progress/circularProgress.js +2 -1
  45. package/dist/TextFields/AddressLookup.cjs +390 -0
  46. package/dist/TextFields/AddressLookup.d.cts +49 -0
  47. package/dist/TextFields/AddressLookup.d.ts +49 -0
  48. package/dist/TextFields/AddressLookup.js +304 -0
  49. package/dist/TextFields/FloatingInput.cjs +6 -4
  50. package/dist/TextFields/FloatingInput.d.cts +13 -19
  51. package/dist/TextFields/FloatingInput.d.ts +13 -19
  52. package/dist/TextFields/FloatingInput.js +4 -28
  53. package/dist/chunk-2AJACSJ3.js +8 -0
  54. package/dist/chunk-3Y6QBRGD.js +8 -0
  55. package/dist/chunk-4Y7SQ5EP.js +8 -0
  56. package/dist/chunk-5GK5B3FD.js +8 -0
  57. package/dist/chunk-5XKFPQLH.js +8 -0
  58. package/dist/chunk-66HHM7VI.js +468 -0
  59. package/dist/{chunk-FOZYOE5W.js → chunk-763IHEJ2.js} +1 -1
  60. package/dist/chunk-77QDKDFI.js +8 -0
  61. package/dist/{chunk-UZAD2QJD.js → chunk-7II4Q2WY.js} +1 -1
  62. package/dist/chunk-7KRG7VNW.js +0 -0
  63. package/dist/chunk-AXSFVJ3H.js +10 -0
  64. package/dist/chunk-B2LVMM55.js +8 -0
  65. package/dist/{chunk-YRFUVQDN.js → chunk-CTBYVXFP.js} +2 -2
  66. package/dist/{chunk-UWQSGKVX.js → chunk-CTWVJQJ5.js} +1 -1
  67. package/dist/chunk-DLJHWFNG.js +18 -0
  68. package/dist/chunk-EZI3QGYJ.js +8 -0
  69. package/dist/{chunk-G4CVY5MD.js → chunk-FZCFFVXW.js} +1 -1
  70. package/dist/{chunk-BH53P2UM.js → chunk-G2GZDPUL.js} +3 -3
  71. package/dist/chunk-GJGRMMAQ.js +0 -0
  72. package/dist/chunk-J6E3UO2W.js +402 -0
  73. package/dist/chunk-JVN6QVET.js +8 -0
  74. package/dist/chunk-LI4N7JWK.js +39 -0
  75. package/dist/chunk-Q4DHI3B5.js +8 -0
  76. package/dist/chunk-QDMNCTXT.js +8 -0
  77. package/dist/chunk-QGXXOQJF.js +61 -0
  78. package/dist/{chunk-EC7M5LL2.js → chunk-QTGVW36I.js} +1 -1
  79. package/dist/chunk-R4ISYGEP.js +8 -0
  80. package/dist/{chunk-AQXTOTWY.js → chunk-TYTZEAV5.js} +19 -11
  81. package/dist/chunk-UPCMMCPQ.js +34 -0
  82. package/dist/{chunk-SBX4CHO7.js → chunk-UTBCFDOX.js} +1 -1
  83. package/dist/chunk-WNZLBFLQ.js +73 -0
  84. package/dist/chunk-X357WQOT.js +29 -0
  85. package/dist/{chunk-O3EAZPD3.js → chunk-XCE3QE6Q.js} +1 -1
  86. package/dist/chunk-XHY3OCAQ.js +8 -0
  87. package/dist/{chunk-7YKG3WYS.js → chunk-YRLN3TBF.js} +1 -1
  88. package/dist/chunk-Z7USRFM2.js +8 -0
  89. package/dist/{chunk-EFIJYBYX.js → chunk-ZLJDOLXZ.js} +1 -1
  90. package/dist/esm-5T53WHPT.js +27362 -0
  91. package/dist/icons/activateUserIcon.js +1 -0
  92. package/dist/icons/archivedIcon.js +1 -0
  93. package/dist/icons/assignGroupIcon.js +1 -0
  94. package/dist/icons/closeIcon.js +1 -0
  95. package/dist/icons/copyIcon.js +1 -0
  96. package/dist/icons/difficultyAllIcon.cjs +1 -1
  97. package/dist/icons/difficultyAllIcon.js +2 -1
  98. package/dist/icons/difficultyEasyIcon.js +1 -0
  99. package/dist/icons/difficultyHardIcon.js +1 -0
  100. package/dist/icons/difficultyMediumIcon.js +1 -0
  101. package/dist/icons/dollarIcon.js +1 -0
  102. package/dist/icons/downloadIcon.cjs +1 -1
  103. package/dist/icons/downloadIcon.js +2 -1
  104. package/dist/icons/downloadPdfIcon.js +1 -0
  105. package/dist/icons/editChatIcon.cjs +1 -1
  106. package/dist/icons/editChatIcon.js +2 -1
  107. package/dist/icons/editIcon.js +1 -0
  108. package/dist/icons/engagementIcon.cjs +1 -1
  109. package/dist/icons/engagementIcon.js +2 -1
  110. package/dist/icons/functionIcon.js +1 -0
  111. package/dist/icons/helpOutlinedIcon.cjs +1 -1
  112. package/dist/icons/helpOutlinedIcon.js +2 -1
  113. package/dist/icons/hierarchyIcon.js +1 -0
  114. package/dist/icons/inactiveGroupIcon.cjs +1 -1
  115. package/dist/icons/inactiveGroupIcon.js +2 -1
  116. package/dist/icons/index.cjs +27 -27
  117. package/dist/icons/index.js +77 -76
  118. package/dist/icons/industryIcon.js +1 -0
  119. package/dist/icons/invoiceIcon.js +1 -0
  120. package/dist/icons/locationPinIcon.js +1 -0
  121. package/dist/icons/logsIcon.js +1 -0
  122. package/dist/icons/minExperienceIcon.js +1 -0
  123. package/dist/icons/nineDotMenuIcon.js +1 -0
  124. package/dist/icons/notificationIcon.js +1 -0
  125. package/dist/icons/projectIcon.cjs +1 -1
  126. package/dist/icons/projectIcon.js +2 -1
  127. package/dist/icons/qualificationsIcon.cjs +1 -1
  128. package/dist/icons/qualificationsIcon.js +2 -1
  129. package/dist/icons/questionStatusAllIcon.cjs +1 -1
  130. package/dist/icons/questionStatusAllIcon.js +2 -1
  131. package/dist/icons/questionStatusPrivateIcon.cjs +1 -1
  132. package/dist/icons/questionStatusPrivateIcon.js +2 -1
  133. package/dist/icons/questionStatusPublicIcon.cjs +1 -1
  134. package/dist/icons/questionStatusPublicIcon.js +2 -1
  135. package/dist/icons/questionTypeAllIcon.js +1 -0
  136. package/dist/icons/questionTypeCodingIcon.cjs +1 -1
  137. package/dist/icons/questionTypeCodingIcon.js +2 -1
  138. package/dist/icons/questionTypeDescriptiveIcon.cjs +1 -1
  139. package/dist/icons/questionTypeDescriptiveIcon.js +2 -1
  140. package/dist/icons/questionTypeMultipleIcon.cjs +1 -1
  141. package/dist/icons/questionTypeMultipleIcon.js +2 -1
  142. package/dist/icons/questionTypeSingleIcon.cjs +1 -1
  143. package/dist/icons/questionTypeSingleIcon.js +2 -1
  144. package/dist/icons/refreshIcon.js +1 -0
  145. package/dist/icons/resendInviteIcon.js +1 -0
  146. package/dist/icons/rolesIcon.js +1 -0
  147. package/dist/icons/rufousAiIcon.cjs +1 -1
  148. package/dist/icons/rufousAiIcon.js +2 -1
  149. package/dist/icons/rufousBirdIcon.js +1 -0
  150. package/dist/icons/rufousLauncherBird.js +1 -0
  151. package/dist/icons/sidebarIcon.js +1 -0
  152. package/dist/icons/softSkillsIcon.cjs +1 -1
  153. package/dist/icons/softSkillsIcon.js +2 -1
  154. package/dist/icons/subscribeIcon.cjs +1 -1
  155. package/dist/icons/subscribeIcon.js +2 -1
  156. package/dist/icons/suspendUserIcon.cjs +1 -1
  157. package/dist/icons/suspendUserIcon.js +2 -1
  158. package/dist/icons/technicalSkillsIcon.js +1 -0
  159. package/dist/icons/tickIcon.cjs +1 -1
  160. package/dist/icons/tickIcon.js +2 -1
  161. package/dist/icons/timerIcon.cjs +1 -1
  162. package/dist/icons/timerIcon.js +2 -1
  163. package/dist/icons/trashIcon.js +1 -0
  164. package/dist/icons/unArchivedIcon.js +1 -0
  165. package/dist/icons/unsubscribeIcon.cjs +1 -1
  166. package/dist/icons/unsubscribeIcon.js +2 -1
  167. package/dist/icons/uploadIcon.cjs +1 -1
  168. package/dist/icons/uploadIcon.js +2 -1
  169. package/dist/icons/userAssignIcon.cjs +3 -3
  170. package/dist/icons/userAssignIcon.js +2 -1
  171. package/dist/icons/viewIcon.cjs +1 -1
  172. package/dist/icons/viewIcon.js +2 -1
  173. package/dist/icons/workItemIcon.js +1 -0
  174. package/dist/main.cjs +30100 -226
  175. package/dist/main.css +8248 -163
  176. package/dist/main.d.cts +6 -0
  177. package/dist/main.d.ts +6 -0
  178. package/dist/main.js +106 -84
  179. package/dist/style.css +1069 -164
  180. package/dist/styles/button.css +82 -110
  181. package/dist/styles/checkbox.css +60 -0
  182. package/dist/styles/checkbox.d.cts +2 -0
  183. package/dist/styles/checkbox.d.ts +2 -0
  184. package/dist/styles/datagrid.css +531 -0
  185. package/dist/styles/datagrid.d.cts +2 -0
  186. package/dist/styles/datagrid.d.ts +2 -0
  187. package/dist/styles/dialog.css +78 -51
  188. package/dist/styles/editor.css +211 -0
  189. package/dist/styles/editor.d.cts +2 -0
  190. package/dist/styles/editor.d.ts +2 -0
  191. package/dist/styles/progress.css +1 -1
  192. package/dist/utils/constants.cjs +47 -69
  193. package/dist/utils/constants.d.cts +34 -56
  194. package/dist/utils/constants.d.ts +34 -56
  195. package/dist/utils/constants.js +2 -1
  196. package/package.json +13 -2
  197. package/dist/TextFields/FloatingInput.d.d.cts +0 -23
  198. package/dist/TextFields/FloatingInput.d.d.ts +0 -23
  199. package/dist/chunk-2FHTGYR4.js +0 -83
  200. package/dist/chunk-5BB3H3YO.js +0 -8
  201. package/dist/chunk-5I44RDFT.js +0 -8
  202. package/dist/chunk-5UEJAVFK.js +0 -10
  203. package/dist/chunk-7WNPZ4B7.js +0 -8
  204. package/dist/chunk-BCGCLMKA.js +0 -71
  205. package/dist/chunk-BYJP2WNC.js +0 -18
  206. package/dist/chunk-DE73YGRW.js +0 -8
  207. package/dist/chunk-EH3QXE5G.js +0 -8
  208. package/dist/chunk-FSSJZDI6.js +0 -8
  209. package/dist/chunk-JYTI2ZBC.js +0 -8
  210. package/dist/chunk-OCOOSNRU.js +0 -8
  211. package/dist/chunk-PPNZC5ZQ.js +0 -8
  212. package/dist/chunk-QA2AYT4A.js +0 -8
  213. package/dist/chunk-VI32N6SI.js +0 -8
  214. package/dist/chunk-VIUTE7F5.js +0 -8
  215. package/dist/chunk-WWAHNTUH.js +0 -8
  216. package/dist/chunk-ZJYLZ6I6.js +0 -8
  217. /package/dist/{TextFields/FloatingInput.d.js → DataGrid/types.js} +0 -0
@@ -1,6 +1,7 @@
1
1
  import {
2
2
  addButton_default
3
3
  } from "../chunk-U7SARO5B.js";
4
+ import "../chunk-LI4N7JWK.js";
4
5
  export {
5
6
  addButton_default as default
6
7
  };
@@ -1,6 +1,7 @@
1
1
  import {
2
2
  cancelButton_default
3
3
  } from "../chunk-BMMDUQDJ.js";
4
+ import "../chunk-LI4N7JWK.js";
4
5
  export {
5
6
  cancelButton_default as default
6
7
  };
@@ -48,7 +48,7 @@ var React3 = __toESM(require("react"), 1);
48
48
 
49
49
  // lib/Progress/circularProgress.tsx
50
50
  var React2 = __toESM(require("react"), 1);
51
- var CircularProgess = ({
51
+ var CircularProgress = ({
52
52
  size = 50,
53
53
  color = "#a81c08",
54
54
  ...props
@@ -72,7 +72,7 @@ var CircularProgess = ({
72
72
  ))
73
73
  );
74
74
  };
75
- var circularProgress_default = CircularProgess;
75
+ var circularProgress_default = CircularProgress;
76
76
 
77
77
  // lib/Buttons/submitButton.tsx
78
78
  var SubmitButton = ({
@@ -10,8 +10,9 @@ import {
10
10
  } from "../chunk-R3GARAVJ.js";
11
11
  import {
12
12
  submitButton_default
13
- } from "../chunk-7YKG3WYS.js";
14
- import "../chunk-YRFUVQDN.js";
13
+ } from "../chunk-YRLN3TBF.js";
14
+ import "../chunk-CTBYVXFP.js";
15
+ import "../chunk-LI4N7JWK.js";
15
16
  export {
16
17
  addButton_default as AddButton,
17
18
  cancelButton_default as CancelButton,
@@ -1,6 +1,7 @@
1
1
  import {
2
2
  stdButton_default
3
3
  } from "../chunk-R3GARAVJ.js";
4
+ import "../chunk-LI4N7JWK.js";
4
5
  export {
5
6
  stdButton_default as default
6
7
  };
@@ -36,7 +36,7 @@ var React2 = __toESM(require("react"), 1);
36
36
 
37
37
  // lib/Progress/circularProgress.tsx
38
38
  var React = __toESM(require("react"), 1);
39
- var CircularProgess = ({
39
+ var CircularProgress = ({
40
40
  size = 50,
41
41
  color = "#a81c08",
42
42
  ...props
@@ -60,7 +60,7 @@ var CircularProgess = ({
60
60
  ))
61
61
  );
62
62
  };
63
- var circularProgress_default = CircularProgess;
63
+ var circularProgress_default = CircularProgress;
64
64
 
65
65
  // lib/Buttons/submitButton.tsx
66
66
  var SubmitButton = ({
@@ -1,7 +1,8 @@
1
1
  import {
2
2
  submitButton_default
3
- } from "../chunk-7YKG3WYS.js";
4
- import "../chunk-YRFUVQDN.js";
3
+ } from "../chunk-YRLN3TBF.js";
4
+ import "../chunk-CTBYVXFP.js";
5
+ import "../chunk-LI4N7JWK.js";
5
6
  export {
6
7
  submitButton_default as default
7
8
  };
@@ -43,7 +43,7 @@ var Checkbox = ({
43
43
  style
44
44
  }) => {
45
45
  const handleChange = (e) => {
46
- onChange(e.target.checked);
46
+ if (onChange) onChange(e.target.checked);
47
47
  };
48
48
  return /* @__PURE__ */ import_react.default.createElement("div", { className: "checkbox-wrapper-13" }, /* @__PURE__ */ import_react.default.createElement("label", { className: `${className}`, style }, /* @__PURE__ */ import_react.default.createElement(
49
49
  "input",
@@ -1,28 +1,7 @@
1
- // lib/CheckBoxes/CheckBox.jsx
2
- import React from "react";
3
- var Checkbox = ({
4
- id,
5
- label,
6
- checked,
7
- onChange,
8
- disabled = false,
9
- className = "",
10
- style
11
- }) => {
12
- const handleChange = (e) => {
13
- onChange(e.target.checked);
14
- };
15
- return /* @__PURE__ */ React.createElement("div", { className: "checkbox-wrapper-13" }, /* @__PURE__ */ React.createElement("label", { className: `${className}`, style }, /* @__PURE__ */ React.createElement(
16
- "input",
17
- {
18
- id,
19
- type: "checkbox",
20
- checked,
21
- onChange: handleChange,
22
- disabled
23
- }
24
- ), label && /* @__PURE__ */ React.createElement("span", { className: "checkbox-label" }, label)));
25
- };
1
+ import {
2
+ Checkbox
3
+ } from "../chunk-X357WQOT.js";
4
+ import "../chunk-LI4N7JWK.js";
26
5
  export {
27
6
  Checkbox
28
7
  };
@@ -37,133 +37,113 @@ var import_react = __toESM(require("react"), 1);
37
37
 
38
38
  // lib/utils/constants.ts
39
39
  var APP_THEMES = {
40
- default: {
41
- name: "Default",
42
- primaryColor: "#707070",
43
- secondaryColor: "#e0e0e0",
44
- backgroundColor: "#f5f5f5",
45
- surfaceColor: "#ffffff",
46
- iconColor: "#707070",
47
- textColor: "#2d2d2d",
48
- textSecondaryColor: "#6f6f6f",
49
- borderColor: "#dcdcdc",
50
- hoverColor: "#d4d4d4",
51
- activeColor: "#5a5a5a",
52
- button: {
53
- background: "#707070",
54
- text: "#ffffff",
55
- hoverBackground: "#5f5f5f",
56
- disabledBackground: "#cfcfcf"
57
- },
58
- input: {
59
- background: "#ffffff",
60
- text: "#2d2d2d",
61
- border: "#ccc",
62
- placeholder: "#999",
63
- focusBorder: "#707070"
64
- },
65
- card: {
66
- background: "#ffffff",
67
- shadow: "0 1px 3px rgba(0,0,0,0.1)"
68
- },
69
- sidebar: {
70
- background: "#e8e8e8",
71
- text: "#2d2d2d",
72
- hover: "#dcdcdc"
73
- },
74
- success: "#4CAF50",
75
- warning: "#FFC107",
76
- error: "#F44336"
77
- },
78
40
  rufous: {
79
41
  name: "Rufous",
80
- primaryColor: "#a81c08",
81
- secondaryColor: "#f7d4cc",
82
- backgroundColor: "#fff8f7",
83
- surfaceColor: "#fff",
84
- iconColor: "#a81c08",
85
- textColor: "#2d2d2d",
86
- textSecondaryColor: "#6f6f6f",
87
- borderColor: "#e5e5e5",
88
- hoverColor: "#f3c2b9",
89
- activeColor: "#c01708",
90
- button: {
91
- background: "#a81c08",
92
- text: "#ffffff",
93
- hoverBackground: "#8f1907",
94
- disabledBackground: "#f4cccc"
95
- },
96
- input: {
42
+ light: {
43
+ primary: "#a41b06",
44
+ secondary: "#8b1605",
97
45
  background: "#ffffff",
46
+ surface: "#ffffff",
98
47
  text: "#2d2d2d",
99
- border: "#ccc",
100
- placeholder: "#999",
101
- focusBorder: "#a81c08"
48
+ textSecondary: "#666666",
49
+ border: "#e0e0e0",
50
+ hover: "#fff5f5",
51
+ selection: "#fce4ec",
52
+ icon: "#a41b06"
102
53
  },
103
- card: {
104
- background: "#ffffff",
105
- shadow: "0 1px 3px rgba(0,0,0,0.1)"
106
- },
107
- sidebar: {
108
- background: "#fff0ed",
109
- text: "#2d2d2d",
110
- hover: "#f5e0dc"
54
+ dark: {
55
+ primary: "#dc2626",
56
+ secondary: "#a41b06",
57
+ background: "#121212",
58
+ surface: "#1e1e1e",
59
+ text: "#f5f5f5",
60
+ textSecondary: "#b0b0b0",
61
+ border: "#333333",
62
+ hover: "#2d1a1a",
63
+ selection: "#4a1212",
64
+ icon: "#dc2626"
65
+ }
66
+ },
67
+ slate: {
68
+ name: "Slate",
69
+ light: {
70
+ primary: "#334155",
71
+ secondary: "#475569",
72
+ background: "#f8fafc",
73
+ surface: "#ffffff",
74
+ text: "#0f172a",
75
+ textSecondary: "#64748b",
76
+ border: "#e2e8f0",
77
+ hover: "#f1f5f9",
78
+ selection: "#e0f2fe",
79
+ icon: "#334155"
111
80
  },
112
- success: "#4CAF50",
113
- warning: "#FFC107",
114
- error: "#F44336"
81
+ dark: {
82
+ primary: "#94a3b8",
83
+ secondary: "#64748b",
84
+ background: "#0f172a",
85
+ surface: "#1e293b",
86
+ text: "#f1f5f9",
87
+ textSecondary: "#94a3b8",
88
+ border: "#334155",
89
+ hover: "#1e293b",
90
+ selection: "#0c4a6e",
91
+ icon: "#94a3b8"
92
+ }
115
93
  }
116
94
  };
117
95
 
118
96
  // lib/Contexts/rufousThemeProvider.tsx
119
97
  var RufousThemeContext = (0, import_react.createContext)(null);
120
98
  var RufousThemeProvider = ({ children }) => {
121
- const [committedThemeKey, setCommittedThemeKey] = (0, import_react.useState)("default");
122
- const [previewThemeKey, setPreviewThemeKey] = (0, import_react.useState)("default");
123
- const [settings, setSettings] = (0, import_react.useState)(null);
124
- const getGeneralSettings = async () => {
125
- try {
126
- const theme = localStorage.getItem("theme") || "default";
127
- setCommittedThemeKey(theme);
128
- setPreviewThemeKey(theme);
129
- } catch (err) {
130
- console.error("Error fetching general settings:", err);
131
- }
132
- };
99
+ const [colorScheme, setColorScheme] = (0, import_react.useState)("rufous");
100
+ const [mode, setMode] = (0, import_react.useState)("light");
133
101
  (0, import_react.useEffect)(() => {
134
- getGeneralSettings();
102
+ const savedScheme = localStorage.getItem("colorScheme") || "rufous";
103
+ const savedMode = localStorage.getItem("themeMode") || "light";
104
+ setColorScheme(savedScheme);
105
+ setMode(savedMode);
135
106
  }, []);
136
- const fullTheme = (0, import_react.useMemo)(() => {
107
+ const themeVars = (0, import_react.useMemo)(() => {
108
+ const config = APP_THEMES[colorScheme][mode];
137
109
  return {
138
- themeKey: previewThemeKey || settings.theme,
139
- customStyles: APP_THEMES[previewThemeKey || settings.theme]
110
+ "--primary-color": config.primary,
111
+ "--secondary-color": config.secondary,
112
+ "--background-color": config.background,
113
+ "--surface-color": config.surface,
114
+ "--text-color": config.text,
115
+ "--text-secondary": config.textSecondary,
116
+ "--border-color": config.border,
117
+ "--hover-color": config.hover,
118
+ "--selection-color": config.selection,
119
+ "--icon-color": config.icon
140
120
  };
141
- }, [previewThemeKey, settings]);
142
- const previewTheme = (key) => setPreviewThemeKey(key);
143
- const saveTheme = (inputKey) => {
144
- const key = inputKey || previewThemeKey || settings.theme;
145
- localStorage.setItem("theme", key);
146
- setCommittedThemeKey(key);
121
+ }, [colorScheme, mode]);
122
+ const toggleMode = () => {
123
+ const newMode = mode === "light" ? "dark" : "light";
124
+ setMode(newMode);
125
+ localStorage.setItem("themeMode", newMode);
126
+ };
127
+ const changeScheme = (scheme) => {
128
+ setColorScheme(scheme);
129
+ localStorage.setItem("colorScheme", scheme);
147
130
  };
148
- const cancelTheme = () => setPreviewThemeKey(committedThemeKey);
149
131
  return /* @__PURE__ */ import_react.default.createElement(
150
132
  RufousThemeContext.Provider,
151
133
  {
152
134
  value: {
153
- theme: fullTheme,
154
- previewTheme,
155
- saveTheme,
156
- cancelTheme,
157
- currentThemeKey: previewThemeKey,
158
- committedThemeKey,
159
- settings,
160
- updateSettings: (v) => setSettings(v)
135
+ colorScheme,
136
+ mode,
137
+ toggleMode,
138
+ changeScheme,
139
+ themeConfig: APP_THEMES[colorScheme][mode]
161
140
  }
162
141
  },
163
142
  /* @__PURE__ */ import_react.default.createElement(
164
143
  "div",
165
144
  {
166
- className: `theme-${previewThemeKey || committedThemeKey || "default"}`
145
+ className: `rufous-theme-root scheme-${colorScheme} mode-${mode}`,
146
+ style: themeVars
167
147
  },
168
148
  children
169
149
  )
@@ -1,8 +1,9 @@
1
1
  import {
2
2
  RufousThemeProvider,
3
3
  useRufousTheme
4
- } from "../chunk-BCGCLMKA.js";
5
- import "../chunk-2FHTGYR4.js";
4
+ } from "../chunk-WNZLBFLQ.js";
5
+ import "../chunk-QGXXOQJF.js";
6
+ import "../chunk-LI4N7JWK.js";
6
7
  export {
7
8
  RufousThemeProvider,
8
9
  useRufousTheme