@rufous/ui 0.1.62 → 0.1.64
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 +4 -0
- package/dist/Buttons/addButton.js +1 -0
- package/dist/Buttons/cancelButton.js +1 -0
- package/dist/Buttons/index.cjs +2 -2
- package/dist/Buttons/index.js +3 -2
- package/dist/Buttons/stdButton.js +1 -0
- package/dist/Buttons/submitButton.cjs +2 -2
- package/dist/Buttons/submitButton.js +3 -2
- package/dist/CheckBoxes/CheckBox.cjs +1 -1
- package/dist/CheckBoxes/CheckBox.js +4 -25
- package/dist/Contexts/rufousThemeProvider.cjs +146 -81
- package/dist/Contexts/rufousThemeProvider.js +3 -2
- package/dist/DataGrid/DataGrid.cjs +418 -0
- package/dist/DataGrid/DataGrid.d.cts +8 -0
- package/dist/DataGrid/DataGrid.d.ts +8 -0
- package/dist/DataGrid/DataGrid.js +9 -0
- package/dist/DataGrid/index.cjs +418 -0
- package/dist/DataGrid/index.d.cts +3 -0
- package/dist/DataGrid/index.d.ts +3 -0
- package/dist/DataGrid/index.js +8 -0
- package/dist/{TextFields/FloatingInput.d.cjs → DataGrid/types.cjs} +3 -3
- package/dist/DataGrid/types.d.cts +31 -0
- package/dist/DataGrid/types.d.ts +31 -0
- package/dist/Dialogs/BaseDialog.cjs +18 -10
- package/dist/Dialogs/BaseDialog.css +8356 -163
- package/dist/Dialogs/BaseDialog.d.cts +1 -0
- package/dist/Dialogs/BaseDialog.d.ts +1 -0
- package/dist/Dialogs/BaseDialog.js +51 -43
- package/dist/Dialogs/index.cjs +18 -10
- package/dist/Dialogs/index.css +8356 -163
- package/dist/Dialogs/index.js +51 -43
- package/dist/Editors/RichTextEditor.cjs +29477 -0
- package/dist/Editors/RichTextEditor.css +7179 -0
- package/dist/Editors/RichTextEditor.d.cts +57 -0
- package/dist/Editors/RichTextEditor.d.ts +57 -0
- package/dist/Editors/RichTextEditor.js +9 -0
- package/dist/Editors/index.cjs +29477 -0
- package/dist/Editors/index.css +7179 -0
- package/dist/Editors/index.d.cts +2 -0
- package/dist/Editors/index.d.ts +2 -0
- package/dist/Editors/index.js +8 -0
- package/dist/Progress/circularProgress.cjs +2 -2
- package/dist/Progress/circularProgress.d.cts +3 -3
- package/dist/Progress/circularProgress.d.ts +3 -3
- package/dist/Progress/circularProgress.js +2 -1
- package/dist/TextFields/AddressLookup.cjs +390 -0
- package/dist/TextFields/AddressLookup.d.cts +49 -0
- package/dist/TextFields/AddressLookup.d.ts +49 -0
- package/dist/TextFields/AddressLookup.js +11 -0
- package/dist/TextFields/FloatingInput.cjs +6 -4
- package/dist/TextFields/FloatingInput.d.cts +13 -19
- package/dist/TextFields/FloatingInput.d.ts +13 -19
- package/dist/TextFields/FloatingInput.js +4 -28
- package/dist/chunk-2AJACSJ3.js +8 -0
- package/dist/chunk-3Y6QBRGD.js +8 -0
- package/dist/chunk-4Y7SQ5EP.js +8 -0
- package/dist/chunk-5GK5B3FD.js +8 -0
- package/dist/chunk-5XKFPQLH.js +8 -0
- package/dist/chunk-66HHM7VI.js +468 -0
- package/dist/{chunk-FOZYOE5W.js → chunk-763IHEJ2.js} +1 -1
- package/dist/chunk-77QDKDFI.js +8 -0
- package/dist/{chunk-UZAD2QJD.js → chunk-7II4Q2WY.js} +1 -1
- package/dist/chunk-7KRG7VNW.js +0 -0
- package/dist/chunk-AXSFVJ3H.js +10 -0
- package/dist/chunk-B2LVMM55.js +8 -0
- package/dist/chunk-CSQGNUVU.js +62 -0
- package/dist/{chunk-YRFUVQDN.js → chunk-CTBYVXFP.js} +2 -2
- package/dist/{chunk-UWQSGKVX.js → chunk-CTWVJQJ5.js} +1 -1
- package/dist/chunk-DLJHWFNG.js +18 -0
- package/dist/chunk-EZI3QGYJ.js +8 -0
- package/dist/{chunk-G4CVY5MD.js → chunk-FZCFFVXW.js} +1 -1
- package/dist/{chunk-BH53P2UM.js → chunk-G2GZDPUL.js} +3 -3
- package/dist/chunk-GJGRMMAQ.js +0 -0
- package/dist/chunk-J6E3UO2W.js +402 -0
- package/dist/chunk-JVN6QVET.js +8 -0
- package/dist/chunk-LI4N7JWK.js +39 -0
- package/dist/chunk-MGFGSPHM.js +303 -0
- package/dist/{chunk-AQXTOTWY.js → chunk-P3I6CP2I.js} +19 -11
- package/dist/chunk-Q4DHI3B5.js +8 -0
- package/dist/chunk-QDMNCTXT.js +8 -0
- package/dist/{chunk-EC7M5LL2.js → chunk-QTGVW36I.js} +1 -1
- package/dist/chunk-R4ISYGEP.js +8 -0
- package/dist/chunk-S7BNFVQO.js +156 -0
- package/dist/chunk-UPCMMCPQ.js +34 -0
- package/dist/{chunk-SBX4CHO7.js → chunk-UTBCFDOX.js} +1 -1
- package/dist/chunk-X357WQOT.js +29 -0
- package/dist/{chunk-O3EAZPD3.js → chunk-XCE3QE6Q.js} +1 -1
- package/dist/chunk-XHY3OCAQ.js +8 -0
- package/dist/{chunk-7YKG3WYS.js → chunk-YRLN3TBF.js} +1 -1
- package/dist/chunk-Z7USRFM2.js +8 -0
- package/dist/{chunk-EFIJYBYX.js → chunk-ZLJDOLXZ.js} +1 -1
- package/dist/esm-5T53WHPT.js +27362 -0
- package/dist/icons/activateUserIcon.js +1 -0
- package/dist/icons/archivedIcon.js +1 -0
- package/dist/icons/assignGroupIcon.js +1 -0
- package/dist/icons/closeIcon.js +1 -0
- package/dist/icons/copyIcon.js +1 -0
- package/dist/icons/difficultyAllIcon.cjs +1 -1
- package/dist/icons/difficultyAllIcon.js +2 -1
- package/dist/icons/difficultyEasyIcon.js +1 -0
- package/dist/icons/difficultyHardIcon.js +1 -0
- package/dist/icons/difficultyMediumIcon.js +1 -0
- package/dist/icons/dollarIcon.js +1 -0
- package/dist/icons/downloadIcon.cjs +1 -1
- package/dist/icons/downloadIcon.js +2 -1
- package/dist/icons/downloadPdfIcon.js +1 -0
- package/dist/icons/editChatIcon.cjs +1 -1
- package/dist/icons/editChatIcon.js +2 -1
- package/dist/icons/editIcon.js +1 -0
- package/dist/icons/engagementIcon.cjs +1 -1
- package/dist/icons/engagementIcon.js +2 -1
- package/dist/icons/functionIcon.js +1 -0
- package/dist/icons/helpOutlinedIcon.cjs +1 -1
- package/dist/icons/helpOutlinedIcon.js +2 -1
- package/dist/icons/hierarchyIcon.js +1 -0
- package/dist/icons/inactiveGroupIcon.cjs +1 -1
- package/dist/icons/inactiveGroupIcon.js +2 -1
- package/dist/icons/index.cjs +27 -27
- package/dist/icons/index.js +66 -65
- package/dist/icons/industryIcon.js +1 -0
- package/dist/icons/invoiceIcon.js +1 -0
- package/dist/icons/locationPinIcon.js +1 -0
- package/dist/icons/logsIcon.js +1 -0
- package/dist/icons/minExperienceIcon.js +1 -0
- package/dist/icons/nineDotMenuIcon.js +1 -0
- package/dist/icons/notificationIcon.js +1 -0
- package/dist/icons/projectIcon.cjs +1 -1
- package/dist/icons/projectIcon.js +2 -1
- package/dist/icons/qualificationsIcon.cjs +1 -1
- package/dist/icons/qualificationsIcon.js +2 -1
- package/dist/icons/questionStatusAllIcon.cjs +1 -1
- package/dist/icons/questionStatusAllIcon.js +2 -1
- package/dist/icons/questionStatusPrivateIcon.cjs +1 -1
- package/dist/icons/questionStatusPrivateIcon.js +2 -1
- package/dist/icons/questionStatusPublicIcon.cjs +1 -1
- package/dist/icons/questionStatusPublicIcon.js +2 -1
- package/dist/icons/questionTypeAllIcon.js +1 -0
- package/dist/icons/questionTypeCodingIcon.cjs +1 -1
- package/dist/icons/questionTypeCodingIcon.js +2 -1
- package/dist/icons/questionTypeDescriptiveIcon.cjs +1 -1
- package/dist/icons/questionTypeDescriptiveIcon.js +2 -1
- package/dist/icons/questionTypeMultipleIcon.cjs +1 -1
- package/dist/icons/questionTypeMultipleIcon.js +2 -1
- package/dist/icons/questionTypeSingleIcon.cjs +1 -1
- package/dist/icons/questionTypeSingleIcon.js +2 -1
- package/dist/icons/refreshIcon.js +1 -0
- package/dist/icons/resendInviteIcon.js +1 -0
- package/dist/icons/rolesIcon.js +1 -0
- package/dist/icons/rufousAiIcon.cjs +1 -1
- package/dist/icons/rufousAiIcon.js +2 -1
- package/dist/icons/rufousBirdIcon.js +1 -0
- package/dist/icons/rufousLauncherBird.js +1 -0
- package/dist/icons/sidebarIcon.js +1 -0
- package/dist/icons/softSkillsIcon.cjs +1 -1
- package/dist/icons/softSkillsIcon.js +2 -1
- package/dist/icons/subscribeIcon.cjs +1 -1
- package/dist/icons/subscribeIcon.js +2 -1
- package/dist/icons/suspendUserIcon.cjs +1 -1
- package/dist/icons/suspendUserIcon.js +2 -1
- package/dist/icons/technicalSkillsIcon.js +1 -0
- package/dist/icons/tickIcon.cjs +1 -1
- package/dist/icons/tickIcon.js +2 -1
- package/dist/icons/timerIcon.cjs +1 -1
- package/dist/icons/timerIcon.js +2 -1
- package/dist/icons/trashIcon.js +1 -0
- package/dist/icons/unArchivedIcon.js +1 -0
- package/dist/icons/unsubscribeIcon.cjs +1 -1
- package/dist/icons/unsubscribeIcon.js +2 -1
- package/dist/icons/uploadIcon.cjs +1 -1
- package/dist/icons/uploadIcon.js +2 -1
- package/dist/icons/userAssignIcon.cjs +3 -3
- package/dist/icons/userAssignIcon.js +2 -1
- package/dist/icons/viewIcon.cjs +1 -1
- package/dist/icons/viewIcon.js +2 -1
- package/dist/icons/workItemIcon.js +1 -0
- package/dist/main.cjs +30455 -204
- package/dist/main.css +8356 -163
- package/dist/main.d.cts +7 -0
- package/dist/main.d.ts +7 -0
- package/dist/main.js +99 -73
- package/dist/style.css +1069 -164
- package/dist/styles/address-lookup.css +107 -0
- package/dist/styles/address-lookup.d.cts +2 -0
- package/dist/styles/address-lookup.d.ts +2 -0
- package/dist/styles/button.css +82 -110
- package/dist/styles/checkbox.css +60 -0
- package/dist/styles/checkbox.d.cts +2 -0
- package/dist/styles/checkbox.d.ts +2 -0
- package/dist/styles/datagrid.css +531 -0
- package/dist/styles/datagrid.d.cts +2 -0
- package/dist/styles/datagrid.d.ts +2 -0
- package/dist/styles/dialog.css +78 -51
- package/dist/styles/editor.css +211 -0
- package/dist/styles/editor.d.cts +2 -0
- package/dist/styles/editor.d.ts +2 -0
- package/dist/styles/progress.css +1 -1
- package/dist/utils/constants.cjs +115 -42
- package/dist/utils/constants.d.cts +60 -37
- package/dist/utils/constants.d.ts +60 -37
- package/dist/utils/constants.js +2 -1
- package/package.json +13 -2
- package/dist/TextFields/FloatingInput.d.d.cts +0 -23
- package/dist/TextFields/FloatingInput.d.d.ts +0 -23
- package/dist/chunk-2FHTGYR4.js +0 -83
- package/dist/chunk-5BB3H3YO.js +0 -8
- package/dist/chunk-5I44RDFT.js +0 -8
- package/dist/chunk-5UEJAVFK.js +0 -10
- package/dist/chunk-7WNPZ4B7.js +0 -8
- package/dist/chunk-BCGCLMKA.js +0 -71
- package/dist/chunk-BYJP2WNC.js +0 -18
- package/dist/chunk-DE73YGRW.js +0 -8
- package/dist/chunk-EH3QXE5G.js +0 -8
- package/dist/chunk-FSSJZDI6.js +0 -8
- package/dist/chunk-JYTI2ZBC.js +0 -8
- package/dist/chunk-OCOOSNRU.js +0 -8
- package/dist/chunk-PPNZC5ZQ.js +0 -8
- package/dist/chunk-QA2AYT4A.js +0 -8
- package/dist/chunk-VI32N6SI.js +0 -8
- package/dist/chunk-VIUTE7F5.js +0 -8
- package/dist/chunk-WWAHNTUH.js +0 -8
- package/dist/chunk-ZJYLZ6I6.js +0 -8
- /package/dist/{TextFields/FloatingInput.d.js → DataGrid/types.js} +0 -0
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
|
---
|
package/dist/Buttons/index.cjs
CHANGED
|
@@ -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
|
|
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 =
|
|
75
|
+
var circularProgress_default = CircularProgress;
|
|
76
76
|
|
|
77
77
|
// lib/Buttons/submitButton.tsx
|
|
78
78
|
var SubmitButton = ({
|
package/dist/Buttons/index.js
CHANGED
|
@@ -10,8 +10,9 @@ import {
|
|
|
10
10
|
} from "../chunk-R3GARAVJ.js";
|
|
11
11
|
import {
|
|
12
12
|
submitButton_default
|
|
13
|
-
} from "../chunk-
|
|
14
|
-
import "../chunk-
|
|
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,
|
|
@@ -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
|
|
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 =
|
|
63
|
+
var circularProgress_default = CircularProgress;
|
|
64
64
|
|
|
65
65
|
// lib/Buttons/submitButton.tsx
|
|
66
66
|
var SubmitButton = ({
|
|
@@ -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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
|
};
|
|
@@ -39,16 +39,45 @@ var import_react = __toESM(require("react"), 1);
|
|
|
39
39
|
var APP_THEMES = {
|
|
40
40
|
default: {
|
|
41
41
|
name: "Default",
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
42
|
+
light: {
|
|
43
|
+
primary: "#707070",
|
|
44
|
+
secondary: "#e0e0e0",
|
|
45
|
+
background: "#f5f5f5",
|
|
46
|
+
surface: "#ffffff",
|
|
47
|
+
text: "#2d2d2d",
|
|
48
|
+
textSecondary: "#6f6f6f",
|
|
49
|
+
border: "#dcdcdc",
|
|
50
|
+
hover: "#d4d4d4",
|
|
51
|
+
selection: "#5a5a5a",
|
|
52
|
+
icon: "#707070",
|
|
53
|
+
get customStyles() {
|
|
54
|
+
return {
|
|
55
|
+
iconColor: this.icon,
|
|
56
|
+
primaryColor: this.primary,
|
|
57
|
+
secondaryColor: this.secondary
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
dark: {
|
|
62
|
+
primary: "#94a3b8",
|
|
63
|
+
secondary: "#475569",
|
|
64
|
+
background: "#0f172a",
|
|
65
|
+
surface: "#1e293b",
|
|
66
|
+
text: "#f1f5f9",
|
|
67
|
+
textSecondary: "#94a3b8",
|
|
68
|
+
border: "#334155",
|
|
69
|
+
hover: "#1e293b",
|
|
70
|
+
selection: "#334155",
|
|
71
|
+
icon: "#94a3b8",
|
|
72
|
+
get customStyles() {
|
|
73
|
+
return {
|
|
74
|
+
iconColor: this.icon,
|
|
75
|
+
primaryColor: this.primary,
|
|
76
|
+
secondaryColor: this.secondary
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
// Keep user's extra properties if they were intended for specific components
|
|
52
81
|
button: {
|
|
53
82
|
background: "#707070",
|
|
54
83
|
text: "#ffffff",
|
|
@@ -77,96 +106,132 @@ var APP_THEMES = {
|
|
|
77
106
|
},
|
|
78
107
|
rufous: {
|
|
79
108
|
name: "Rufous",
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
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: {
|
|
109
|
+
light: {
|
|
110
|
+
primary: "#a41b06",
|
|
111
|
+
secondary: "#8b1605",
|
|
97
112
|
background: "#ffffff",
|
|
113
|
+
surface: "#ffffff",
|
|
98
114
|
text: "#2d2d2d",
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
115
|
+
textSecondary: "#666666",
|
|
116
|
+
border: "#e0e0e0",
|
|
117
|
+
hover: "#fff5f5",
|
|
118
|
+
selection: "#fce4ec",
|
|
119
|
+
icon: "#a41b06",
|
|
120
|
+
get customStyles() {
|
|
121
|
+
return {
|
|
122
|
+
iconColor: this.icon,
|
|
123
|
+
primaryColor: this.primary,
|
|
124
|
+
secondaryColor: this.secondary
|
|
125
|
+
};
|
|
126
|
+
}
|
|
111
127
|
},
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
128
|
+
dark: {
|
|
129
|
+
primary: "#dc2626",
|
|
130
|
+
secondary: "#a41b06",
|
|
131
|
+
background: "#121212",
|
|
132
|
+
surface: "#1e1e1e",
|
|
133
|
+
text: "#f5f5f5",
|
|
134
|
+
textSecondary: "#b0b0b0",
|
|
135
|
+
border: "#333333",
|
|
136
|
+
hover: "#2d1a1a",
|
|
137
|
+
selection: "#4a1212",
|
|
138
|
+
icon: "#dc2626",
|
|
139
|
+
get customStyles() {
|
|
140
|
+
return {
|
|
141
|
+
iconColor: this.icon,
|
|
142
|
+
primaryColor: this.primary,
|
|
143
|
+
secondaryColor: this.secondary
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
}
|
|
115
147
|
}
|
|
148
|
+
// slate: {
|
|
149
|
+
// name: "Slate",
|
|
150
|
+
// light: {
|
|
151
|
+
// primary: "#334155",
|
|
152
|
+
// secondary: "#475569",
|
|
153
|
+
// background: "#f8fafc",
|
|
154
|
+
// surface: "#ffffff",
|
|
155
|
+
// text: "#0f172a",
|
|
156
|
+
// textSecondary: "#64748b",
|
|
157
|
+
// border: "#e2e8f0",
|
|
158
|
+
// hover: "#f1f5f9",
|
|
159
|
+
// selection: "#e0f2fe",
|
|
160
|
+
// icon: "#334155",
|
|
161
|
+
// get customStyles() {
|
|
162
|
+
// return {
|
|
163
|
+
// iconColor: this.icon,
|
|
164
|
+
// primaryColor: this.primary,
|
|
165
|
+
// secondaryColor: this.secondary,
|
|
166
|
+
// };
|
|
167
|
+
// },
|
|
168
|
+
// },
|
|
169
|
+
// dark: {
|
|
170
|
+
// primary: "#94a3b8",
|
|
171
|
+
// secondary: "#64748b",
|
|
172
|
+
// background: "#0f172a",
|
|
173
|
+
// surface: "#1e293b",
|
|
174
|
+
// text: "#f1f5f9",
|
|
175
|
+
// textSecondary: "#94a3b8",
|
|
176
|
+
// border: "#334155",
|
|
177
|
+
// hover: "#1e293b",
|
|
178
|
+
// selection: "#0c4a6e",
|
|
179
|
+
// icon: "#94a3b8",
|
|
180
|
+
// get customStyles() {
|
|
181
|
+
// return {
|
|
182
|
+
// iconColor: this.icon,
|
|
183
|
+
// primaryColor: this.primary,
|
|
184
|
+
// secondaryColor: this.secondary,
|
|
185
|
+
// };
|
|
186
|
+
// },
|
|
187
|
+
// },
|
|
188
|
+
// },
|
|
116
189
|
};
|
|
117
190
|
|
|
118
191
|
// lib/Contexts/rufousThemeProvider.tsx
|
|
119
192
|
var RufousThemeContext = (0, import_react.createContext)(null);
|
|
120
193
|
var RufousThemeProvider = ({ children }) => {
|
|
121
|
-
const [
|
|
122
|
-
const [
|
|
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
|
-
};
|
|
194
|
+
const [colorScheme, setColorScheme] = (0, import_react.useState)("rufous");
|
|
195
|
+
const [mode, setMode] = (0, import_react.useState)("light");
|
|
133
196
|
(0, import_react.useEffect)(() => {
|
|
134
|
-
|
|
197
|
+
const savedScheme = localStorage.getItem("colorScheme") || "rufous";
|
|
198
|
+
const savedMode = localStorage.getItem("themeMode") || "light";
|
|
199
|
+
setColorScheme(savedScheme);
|
|
200
|
+
setMode(savedMode);
|
|
135
201
|
}, []);
|
|
136
|
-
const
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
202
|
+
const toggleMode = () => {
|
|
203
|
+
const newMode = mode === "light" ? "dark" : "light";
|
|
204
|
+
setMode(newMode);
|
|
205
|
+
localStorage.setItem("themeMode", newMode);
|
|
206
|
+
};
|
|
207
|
+
const changeScheme = (scheme) => {
|
|
208
|
+
setColorScheme(scheme);
|
|
209
|
+
localStorage.setItem("colorScheme", scheme);
|
|
210
|
+
};
|
|
211
|
+
const saveTheme = () => {
|
|
212
|
+
localStorage.setItem("themeMode", mode);
|
|
213
|
+
localStorage.setItem("colorScheme", colorScheme);
|
|
214
|
+
};
|
|
215
|
+
const updateSettings = (settings) => {
|
|
216
|
+
if (settings.theme) setColorScheme(settings.theme);
|
|
217
|
+
if (settings.mode) setMode(settings.mode);
|
|
147
218
|
};
|
|
148
|
-
const cancelTheme = () => setPreviewThemeKey(committedThemeKey);
|
|
149
219
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
150
220
|
RufousThemeContext.Provider,
|
|
151
221
|
{
|
|
152
222
|
value: {
|
|
153
|
-
|
|
154
|
-
|
|
223
|
+
colorScheme,
|
|
224
|
+
mode,
|
|
225
|
+
toggleMode,
|
|
226
|
+
changeScheme,
|
|
227
|
+
previewTheme: changeScheme,
|
|
155
228
|
saveTheme,
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
settings,
|
|
160
|
-
updateSettings: (v) => setSettings(v)
|
|
229
|
+
updateSettings,
|
|
230
|
+
theme: APP_THEMES[colorScheme][mode],
|
|
231
|
+
themeConfig: APP_THEMES[colorScheme][mode]
|
|
161
232
|
}
|
|
162
233
|
},
|
|
163
|
-
/* @__PURE__ */ import_react.default.createElement(
|
|
164
|
-
"div",
|
|
165
|
-
{
|
|
166
|
-
className: `theme-${previewThemeKey || committedThemeKey || "default"}`
|
|
167
|
-
},
|
|
168
|
-
children
|
|
169
|
-
)
|
|
234
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: `rufous-theme-root scheme-${colorScheme} mode-${mode}` }, children)
|
|
170
235
|
);
|
|
171
236
|
};
|
|
172
237
|
var useRufousTheme = () => (0, import_react.useContext)(RufousThemeContext);
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
RufousThemeProvider,
|
|
3
3
|
useRufousTheme
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-CSQGNUVU.js";
|
|
5
|
+
import "../chunk-S7BNFVQO.js";
|
|
6
|
+
import "../chunk-LI4N7JWK.js";
|
|
6
7
|
export {
|
|
7
8
|
RufousThemeProvider,
|
|
8
9
|
useRufousTheme
|