@ews-admin/global-design-system 1.1.1 → 1.1.2

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/dist/index.js CHANGED
@@ -797,6 +797,95 @@ const Logo = ({ size = "md", showTagline = true, iconOnly = false, variant = "no
797
797
  return (jsxRuntime.jsx("div", { className: cn("flex items-center", sizes[size], className), onClick: onClick, role: onClick ? "button" : undefined, tabIndex: onClick ? 0 : undefined, children: jsxRuntime.jsx("img", { src: logoSrc, alt: "MEDECINE 360 Logo", className: "h-full w-auto object-contain" }) }));
798
798
  };
799
799
 
800
+ const PROMED_THEME = {
801
+ name: "PROMED",
802
+ colors: {
803
+ primary: "#21596C",
804
+ secondary: "#3BA1A1",
805
+ primaryHover: "#1a4756",
806
+ secondaryHover: "#308181",
807
+ primaryLight: "#c0d0d4",
808
+ success: "#059669",
809
+ successHover: "#047857",
810
+ warning: "#d97706",
811
+ warningHover: "#b45309",
812
+ error: "#dc2626",
813
+ errorHover: "#b91c1c",
814
+ },
815
+ };
816
+ const MED_THEME = {
817
+ name: "MED",
818
+ colors: {
819
+ primary: "#3BA1A1", // Teal for patients (calming, trustworthy)
820
+ secondary: "#6B73FF", // Soft purple-blue (suggested secondary for MED)
821
+ primaryHover: "#308181",
822
+ secondaryHover: "#5a61e6",
823
+ primaryLight: "#a8d5d5",
824
+ success: "#059669",
825
+ successHover: "#047857",
826
+ warning: "#d97706",
827
+ warningHover: "#b45309",
828
+ error: "#dc2626",
829
+ errorHover: "#b91c1c",
830
+ },
831
+ };
832
+ const THEMES = {
833
+ PROMED: PROMED_THEME,
834
+ MED: MED_THEME,
835
+ };
836
+
837
+ const ThemeContext = React.createContext(undefined);
838
+ const ThemeProvider = ({ children, defaultTheme = "PROMED", }) => {
839
+ const [theme, setTheme] = React.useState(defaultTheme);
840
+ const [themeConfig, setThemeConfig] = React.useState(THEMES[defaultTheme]);
841
+ // Update theme config when theme changes
842
+ React.useEffect(() => {
843
+ setThemeConfig(THEMES[theme]);
844
+ // Update CSS custom properties
845
+ const root = document.documentElement;
846
+ const colors = THEMES[theme].colors;
847
+ root.style.setProperty("--ews-primary", colors.primary);
848
+ root.style.setProperty("--ews-primary-hover", colors.primaryHover);
849
+ root.style.setProperty("--ews-primary-light", colors.primaryLight);
850
+ root.style.setProperty("--ews-secondary", colors.secondary);
851
+ root.style.setProperty("--ews-secondary-hover", colors.secondaryHover);
852
+ root.style.setProperty("--ews-success", colors.success);
853
+ root.style.setProperty("--ews-success-hover", colors.successHover);
854
+ root.style.setProperty("--ews-warning", colors.warning);
855
+ root.style.setProperty("--ews-warning-hover", colors.warningHover);
856
+ root.style.setProperty("--ews-error", colors.error);
857
+ root.style.setProperty("--ews-error-hover", colors.errorHover);
858
+ }, [theme]);
859
+ const handleSetTheme = (newTheme) => {
860
+ setTheme(newTheme);
861
+ };
862
+ const value = {
863
+ theme,
864
+ setTheme: handleSetTheme,
865
+ themeConfig,
866
+ };
867
+ return (jsxRuntime.jsx(ThemeContext.Provider, { value: value, children: children }));
868
+ };
869
+ const useTheme = () => {
870
+ const context = React.useContext(ThemeContext);
871
+ if (context === undefined) {
872
+ throw new Error("useTheme must be used within a ThemeProvider");
873
+ }
874
+ return context;
875
+ };
876
+
877
+ const ThemeToggle = ({ className }) => {
878
+ const { theme, setTheme } = useTheme();
879
+ const handleThemeChange = (newTheme) => {
880
+ setTheme(newTheme);
881
+ };
882
+ return (jsxRuntime.jsxs("div", { className: `flex items-center space-x-2 ${className || ""}`, children: [jsxRuntime.jsx("span", { className: "text-sm font-medium text-gray-700", children: "Theme:" }), jsxRuntime.jsxs("div", { className: "flex bg-gray-100 rounded-lg p-1", children: [jsxRuntime.jsx("button", { onClick: () => handleThemeChange("PROMED"), className: `px-3 py-1 text-xs font-medium rounded-md transition-colors ${theme === "PROMED"
883
+ ? "bg-ews-primary text-white"
884
+ : "text-gray-600 hover:text-gray-900"}`, children: "PROMED" }), jsxRuntime.jsx("button", { onClick: () => handleThemeChange("MED"), className: `px-3 py-1 text-xs font-medium rounded-md transition-colors ${theme === "MED"
885
+ ? "bg-ews-primary text-white"
886
+ : "text-gray-600 hover:text-gray-900"}`, children: "MED" })] })] }));
887
+ };
888
+
800
889
  const SpecialtySearchAutocomplete = ({ selectedSpecialties = [], onSpecialtiesChange, placeholder = "Search and select medical specialties...", className = "", disabled = false, maxSelections, showSelectedCount = true, }) => {
801
890
  const [specialties, setSpecialties] = React.useState([]);
802
891
  const [isLoading, setIsLoading] = React.useState(false);
@@ -867,6 +956,8 @@ exports.MultiSearchAutocomplete = MultiSearchAutocomplete;
867
956
  exports.Search = Search;
868
957
  exports.SearchAutocomplete = SearchAutocomplete;
869
958
  exports.SpecialtySearchAutocomplete = SpecialtySearchAutocomplete;
959
+ exports.ThemeProvider = ThemeProvider;
960
+ exports.ThemeToggle = ThemeToggle;
870
961
  exports.cn = cn;
871
962
  exports.debounce = debounce;
872
963
  exports.formatCurrency = formatCurrency;
@@ -874,4 +965,5 @@ exports.formatDate = formatDate;
874
965
  exports.generateId = generateId;
875
966
  exports.useDebounce = useDebounce;
876
967
  exports.useDebouncedCallback = useDebouncedCallback;
968
+ exports.useTheme = useTheme;
877
969
  //# sourceMappingURL=index.js.map