@ews-admin/global-design-system 1.1.1 → 1.1.5
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/components/ThemeToggle/ThemeToggle.d.ts +6 -0
- package/dist/components/ThemeToggle/ThemeToggle.d.ts.map +1 -0
- package/dist/components/ThemeToggle/index.d.ts +3 -0
- package/dist/components/ThemeToggle/index.d.ts.map +1 -0
- package/dist/icons/DoctorIcon.d.ts +4 -0
- package/dist/icons/DoctorIcon.d.ts.map +1 -0
- package/dist/icons/Icon.d.ts +18 -0
- package/dist/icons/Icon.d.ts.map +1 -1
- package/dist/icons/PatientIcon.d.ts +4 -0
- package/dist/icons/PatientIcon.d.ts.map +1 -0
- package/dist/icons/UserIcon.d.ts +4 -0
- package/dist/icons/UserIcon.d.ts.map +1 -0
- package/dist/icons/index.d.ts +4 -1
- package/dist/icons/index.d.ts.map +1 -1
- package/dist/index.css +3 -2
- package/dist/index.d.ts +62 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.css +3 -2
- package/dist/index.esm.js +156 -20
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +160 -18
- package/dist/index.js.map +1 -1
- package/dist/theme/ThemeProvider.d.ts +10 -0
- package/dist/theme/ThemeProvider.d.ts.map +1 -0
- package/dist/theme/themeConfig.d.ts +8 -0
- package/dist/theme/themeConfig.d.ts.map +1 -0
- package/dist/types/theme.d.ts +23 -0
- package/dist/types/theme.d.ts.map +1 -0
- package/package.json +7 -3
- package/src/components/ThemeToggle/ThemeToggle.tsx +43 -0
- package/src/components/ThemeToggle/index.ts +2 -0
- package/src/icons/DoctorIcon.tsx +14 -0
- package/src/icons/Icon.tsx +20 -0
- package/src/icons/PatientIcon.tsx +12 -0
- package/src/icons/UserIcon.tsx +12 -0
- package/src/icons/index.ts +6 -1
- package/src/index.ts +17 -2
- package/src/styles/index.css +162 -8
- package/src/styles/theme-variables.css +47 -0
- package/src/theme/ThemeProvider.tsx +69 -0
- package/src/theme/themeConfig.ts +40 -0
- package/src/types/theme.ts +24 -0
- package/tailwind.preset.js +166 -0
package/dist/index.js
CHANGED
|
@@ -207,11 +207,11 @@ const createLucideIcon = (iconName, iconNode) => {
|
|
|
207
207
|
*/
|
|
208
208
|
|
|
209
209
|
|
|
210
|
-
const __iconNode$
|
|
210
|
+
const __iconNode$b = [
|
|
211
211
|
["path", { d: "M5 12h14", key: "1ays0h" }],
|
|
212
212
|
["path", { d: "m12 5 7 7-7 7", key: "xquz4c" }]
|
|
213
213
|
];
|
|
214
|
-
const ArrowRight = createLucideIcon("arrow-right", __iconNode$
|
|
214
|
+
const ArrowRight = createLucideIcon("arrow-right", __iconNode$b);
|
|
215
215
|
|
|
216
216
|
/**
|
|
217
217
|
* @license lucide-react v0.544.0 - ISC
|
|
@@ -221,8 +221,8 @@ const ArrowRight = createLucideIcon("arrow-right", __iconNode$9);
|
|
|
221
221
|
*/
|
|
222
222
|
|
|
223
223
|
|
|
224
|
-
const __iconNode$
|
|
225
|
-
const Check = createLucideIcon("check", __iconNode$
|
|
224
|
+
const __iconNode$a = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
|
|
225
|
+
const Check = createLucideIcon("check", __iconNode$a);
|
|
226
226
|
|
|
227
227
|
/**
|
|
228
228
|
* @license lucide-react v0.544.0 - ISC
|
|
@@ -232,12 +232,12 @@ const Check = createLucideIcon("check", __iconNode$8);
|
|
|
232
232
|
*/
|
|
233
233
|
|
|
234
234
|
|
|
235
|
-
const __iconNode$
|
|
235
|
+
const __iconNode$9 = [
|
|
236
236
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
237
237
|
["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
|
|
238
238
|
["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }]
|
|
239
239
|
];
|
|
240
|
-
const CircleAlert = createLucideIcon("circle-alert", __iconNode$
|
|
240
|
+
const CircleAlert = createLucideIcon("circle-alert", __iconNode$9);
|
|
241
241
|
|
|
242
242
|
/**
|
|
243
243
|
* @license lucide-react v0.544.0 - ISC
|
|
@@ -247,11 +247,11 @@ const CircleAlert = createLucideIcon("circle-alert", __iconNode$7);
|
|
|
247
247
|
*/
|
|
248
248
|
|
|
249
249
|
|
|
250
|
-
const __iconNode$
|
|
250
|
+
const __iconNode$8 = [
|
|
251
251
|
["path", { d: "M21.801 10A10 10 0 1 1 17 3.335", key: "yps3ct" }],
|
|
252
252
|
["path", { d: "m9 11 3 3L22 4", key: "1pflzl" }]
|
|
253
253
|
];
|
|
254
|
-
const CircleCheckBig = createLucideIcon("circle-check-big", __iconNode$
|
|
254
|
+
const CircleCheckBig = createLucideIcon("circle-check-big", __iconNode$8);
|
|
255
255
|
|
|
256
256
|
/**
|
|
257
257
|
* @license lucide-react v0.544.0 - ISC
|
|
@@ -261,7 +261,7 @@ const CircleCheckBig = createLucideIcon("circle-check-big", __iconNode$6);
|
|
|
261
261
|
*/
|
|
262
262
|
|
|
263
263
|
|
|
264
|
-
const __iconNode$
|
|
264
|
+
const __iconNode$7 = [
|
|
265
265
|
[
|
|
266
266
|
"path",
|
|
267
267
|
{
|
|
@@ -279,7 +279,7 @@ const __iconNode$5 = [
|
|
|
279
279
|
],
|
|
280
280
|
["path", { d: "m2 2 20 20", key: "1ooewy" }]
|
|
281
281
|
];
|
|
282
|
-
const EyeOff = createLucideIcon("eye-off", __iconNode$
|
|
282
|
+
const EyeOff = createLucideIcon("eye-off", __iconNode$7);
|
|
283
283
|
|
|
284
284
|
/**
|
|
285
285
|
* @license lucide-react v0.544.0 - ISC
|
|
@@ -289,7 +289,7 @@ const EyeOff = createLucideIcon("eye-off", __iconNode$5);
|
|
|
289
289
|
*/
|
|
290
290
|
|
|
291
291
|
|
|
292
|
-
const __iconNode$
|
|
292
|
+
const __iconNode$6 = [
|
|
293
293
|
[
|
|
294
294
|
"path",
|
|
295
295
|
{
|
|
@@ -299,7 +299,7 @@ const __iconNode$4 = [
|
|
|
299
299
|
],
|
|
300
300
|
["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
|
|
301
301
|
];
|
|
302
|
-
const Eye = createLucideIcon("eye", __iconNode$
|
|
302
|
+
const Eye = createLucideIcon("eye", __iconNode$6);
|
|
303
303
|
|
|
304
304
|
/**
|
|
305
305
|
* @license lucide-react v0.544.0 - ISC
|
|
@@ -309,11 +309,30 @@ const Eye = createLucideIcon("eye", __iconNode$4);
|
|
|
309
309
|
*/
|
|
310
310
|
|
|
311
311
|
|
|
312
|
-
const __iconNode$
|
|
312
|
+
const __iconNode$5 = [
|
|
313
|
+
[
|
|
314
|
+
"path",
|
|
315
|
+
{
|
|
316
|
+
d: "M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",
|
|
317
|
+
key: "mvr1a0"
|
|
318
|
+
}
|
|
319
|
+
]
|
|
320
|
+
];
|
|
321
|
+
const Heart = createLucideIcon("heart", __iconNode$5);
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
* @license lucide-react v0.544.0 - ISC
|
|
325
|
+
*
|
|
326
|
+
* This source code is licensed under the ISC license.
|
|
327
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
328
|
+
*/
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
const __iconNode$4 = [
|
|
313
332
|
["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
|
|
314
333
|
["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
|
|
315
334
|
];
|
|
316
|
-
const Search = createLucideIcon("search", __iconNode$
|
|
335
|
+
const Search = createLucideIcon("search", __iconNode$4);
|
|
317
336
|
|
|
318
337
|
/**
|
|
319
338
|
* @license lucide-react v0.544.0 - ISC
|
|
@@ -323,14 +342,14 @@ const Search = createLucideIcon("search", __iconNode$3);
|
|
|
323
342
|
*/
|
|
324
343
|
|
|
325
344
|
|
|
326
|
-
const __iconNode$
|
|
345
|
+
const __iconNode$3 = [
|
|
327
346
|
["path", { d: "M11 2v2", key: "1539x4" }],
|
|
328
347
|
["path", { d: "M5 2v2", key: "1yf1q8" }],
|
|
329
348
|
["path", { d: "M5 3H4a2 2 0 0 0-2 2v4a6 6 0 0 0 12 0V5a2 2 0 0 0-2-2h-1", key: "rb5t3r" }],
|
|
330
349
|
["path", { d: "M8 15a6 6 0 0 0 12 0v-3", key: "x18d4x" }],
|
|
331
350
|
["circle", { cx: "20", cy: "10", r: "2", key: "ts1r5v" }]
|
|
332
351
|
];
|
|
333
|
-
const Stethoscope = createLucideIcon("stethoscope", __iconNode$
|
|
352
|
+
const Stethoscope = createLucideIcon("stethoscope", __iconNode$3);
|
|
334
353
|
|
|
335
354
|
/**
|
|
336
355
|
* @license lucide-react v0.544.0 - ISC
|
|
@@ -340,7 +359,7 @@ const Stethoscope = createLucideIcon("stethoscope", __iconNode$2);
|
|
|
340
359
|
*/
|
|
341
360
|
|
|
342
361
|
|
|
343
|
-
const __iconNode$
|
|
362
|
+
const __iconNode$2 = [
|
|
344
363
|
[
|
|
345
364
|
"path",
|
|
346
365
|
{
|
|
@@ -351,7 +370,21 @@ const __iconNode$1 = [
|
|
|
351
370
|
["path", { d: "M12 9v4", key: "juzpu7" }],
|
|
352
371
|
["path", { d: "M12 17h.01", key: "p32p05" }]
|
|
353
372
|
];
|
|
354
|
-
const TriangleAlert = createLucideIcon("triangle-alert", __iconNode$
|
|
373
|
+
const TriangleAlert = createLucideIcon("triangle-alert", __iconNode$2);
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* @license lucide-react v0.544.0 - ISC
|
|
377
|
+
*
|
|
378
|
+
* This source code is licensed under the ISC license.
|
|
379
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
380
|
+
*/
|
|
381
|
+
|
|
382
|
+
|
|
383
|
+
const __iconNode$1 = [
|
|
384
|
+
["path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2", key: "975kel" }],
|
|
385
|
+
["circle", { cx: "12", cy: "7", r: "4", key: "17ys0d" }]
|
|
386
|
+
];
|
|
387
|
+
const User = createLucideIcon("user", __iconNode$1);
|
|
355
388
|
|
|
356
389
|
/**
|
|
357
390
|
* @license lucide-react v0.544.0 - ISC
|
|
@@ -379,6 +412,18 @@ const Icon = React.forwardRef(({ size = "md", icon: IconComponent, className, ..
|
|
|
379
412
|
});
|
|
380
413
|
Icon.displayName = "Icon";
|
|
381
414
|
|
|
415
|
+
const DoctorIcon = ({ size = 24, color = "currentColor", className = "", ...props }) => {
|
|
416
|
+
return (jsxRuntime.jsx(Stethoscope, { size: size, color: color, className: className, ...props }));
|
|
417
|
+
};
|
|
418
|
+
|
|
419
|
+
const PatientIcon = ({ size = 24, color = "currentColor", className = "", ...props }) => {
|
|
420
|
+
return jsxRuntime.jsx(Heart, { size: size, color: color, className: className, ...props });
|
|
421
|
+
};
|
|
422
|
+
|
|
423
|
+
const UserIcon = ({ size = 24, color = "currentColor", className = "", ...props }) => {
|
|
424
|
+
return jsxRuntime.jsx(User, { size: size, color: color, className: className, ...props });
|
|
425
|
+
};
|
|
426
|
+
|
|
382
427
|
const Input = React.forwardRef(({ className, variant = "default", size = "md", label, helperText, error, leftIcon, rightIcon, fullWidth = false, showPasswordToggle = false, id, type = "text", ...props }, ref) => {
|
|
383
428
|
const inputId = id || `input-${Math.random().toString(36).substr(2, 9)}`;
|
|
384
429
|
const hasError = Boolean(error);
|
|
@@ -797,6 +842,97 @@ const Logo = ({ size = "md", showTagline = true, iconOnly = false, variant = "no
|
|
|
797
842
|
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
843
|
};
|
|
799
844
|
|
|
845
|
+
const PROMED_THEME = {
|
|
846
|
+
name: "PROMED",
|
|
847
|
+
colors: {
|
|
848
|
+
primary: "#21596C",
|
|
849
|
+
secondary: "#3BA1A1",
|
|
850
|
+
primaryHover: "#1a4756",
|
|
851
|
+
secondaryHover: "#308181",
|
|
852
|
+
primaryLight: "#c0d0d4",
|
|
853
|
+
success: "#059669",
|
|
854
|
+
successHover: "#047857",
|
|
855
|
+
warning: "#d97706",
|
|
856
|
+
warningHover: "#b45309",
|
|
857
|
+
error: "#dc2626",
|
|
858
|
+
errorHover: "#b91c1c",
|
|
859
|
+
},
|
|
860
|
+
};
|
|
861
|
+
const MED_THEME = {
|
|
862
|
+
name: "MED",
|
|
863
|
+
colors: {
|
|
864
|
+
primary: "#3BA1A1", // Teal for patients (calming, trustworthy)
|
|
865
|
+
secondary: "#6B73FF", // Soft purple-blue (suggested secondary for MED)
|
|
866
|
+
primaryHover: "#308181",
|
|
867
|
+
secondaryHover: "#5a61e6",
|
|
868
|
+
primaryLight: "#a8d5d5",
|
|
869
|
+
success: "#059669",
|
|
870
|
+
successHover: "#047857",
|
|
871
|
+
warning: "#d97706",
|
|
872
|
+
warningHover: "#b45309",
|
|
873
|
+
error: "#dc2626",
|
|
874
|
+
errorHover: "#b91c1c",
|
|
875
|
+
},
|
|
876
|
+
};
|
|
877
|
+
const THEMES = {
|
|
878
|
+
PROMED: PROMED_THEME,
|
|
879
|
+
MED: MED_THEME,
|
|
880
|
+
};
|
|
881
|
+
|
|
882
|
+
const ThemeContext = React.createContext(undefined);
|
|
883
|
+
const ThemeProvider = ({ children, defaultTheme = "PROMED", }) => {
|
|
884
|
+
const [theme, setTheme] = React.useState(defaultTheme);
|
|
885
|
+
const [themeConfig, setThemeConfig] = React.useState(THEMES[defaultTheme]);
|
|
886
|
+
// Update theme config when theme changes
|
|
887
|
+
React.useEffect(() => {
|
|
888
|
+
setThemeConfig(THEMES[theme]);
|
|
889
|
+
// Update data-theme attribute for CSS variable switching
|
|
890
|
+
const root = document.documentElement;
|
|
891
|
+
root.setAttribute("data-theme", theme);
|
|
892
|
+
// Also update CSS custom properties for backward compatibility
|
|
893
|
+
const colors = THEMES[theme].colors;
|
|
894
|
+
root.style.setProperty("--ews-primary", colors.primary);
|
|
895
|
+
root.style.setProperty("--ews-primary-hover", colors.primaryHover);
|
|
896
|
+
root.style.setProperty("--ews-primary-light", colors.primaryLight);
|
|
897
|
+
root.style.setProperty("--ews-secondary", colors.secondary);
|
|
898
|
+
root.style.setProperty("--ews-secondary-hover", colors.secondaryHover);
|
|
899
|
+
root.style.setProperty("--ews-success", colors.success);
|
|
900
|
+
root.style.setProperty("--ews-success-hover", colors.successHover);
|
|
901
|
+
root.style.setProperty("--ews-warning", colors.warning);
|
|
902
|
+
root.style.setProperty("--ews-warning-hover", colors.warningHover);
|
|
903
|
+
root.style.setProperty("--ews-error", colors.error);
|
|
904
|
+
root.style.setProperty("--ews-error-hover", colors.errorHover);
|
|
905
|
+
}, [theme]);
|
|
906
|
+
const handleSetTheme = (newTheme) => {
|
|
907
|
+
setTheme(newTheme);
|
|
908
|
+
};
|
|
909
|
+
const value = {
|
|
910
|
+
theme,
|
|
911
|
+
setTheme: handleSetTheme,
|
|
912
|
+
themeConfig,
|
|
913
|
+
};
|
|
914
|
+
return (jsxRuntime.jsx(ThemeContext.Provider, { value: value, children: children }));
|
|
915
|
+
};
|
|
916
|
+
const useTheme = () => {
|
|
917
|
+
const context = React.useContext(ThemeContext);
|
|
918
|
+
if (context === undefined) {
|
|
919
|
+
throw new Error("useTheme must be used within a ThemeProvider");
|
|
920
|
+
}
|
|
921
|
+
return context;
|
|
922
|
+
};
|
|
923
|
+
|
|
924
|
+
const ThemeToggle = ({ className }) => {
|
|
925
|
+
const { theme, setTheme } = useTheme();
|
|
926
|
+
const handleThemeChange = (newTheme) => {
|
|
927
|
+
setTheme(newTheme);
|
|
928
|
+
};
|
|
929
|
+
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"
|
|
930
|
+
? "bg-ews-primary text-white"
|
|
931
|
+
: "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"
|
|
932
|
+
? "bg-ews-primary text-white"
|
|
933
|
+
: "text-gray-600 hover:text-gray-900"}`, children: "MED" })] })] }));
|
|
934
|
+
};
|
|
935
|
+
|
|
800
936
|
const SpecialtySearchAutocomplete = ({ selectedSpecialties = [], onSpecialtiesChange, placeholder = "Search and select medical specialties...", className = "", disabled = false, maxSelections, showSelectedCount = true, }) => {
|
|
801
937
|
const [specialties, setSpecialties] = React.useState([]);
|
|
802
938
|
const [isLoading, setIsLoading] = React.useState(false);
|
|
@@ -859,14 +995,19 @@ const SpecialtySearchAutocomplete = ({ selectedSpecialties = [], onSpecialtiesCh
|
|
|
859
995
|
exports.ArrowRight = ArrowRight;
|
|
860
996
|
exports.Button = Button;
|
|
861
997
|
exports.Check = Check;
|
|
998
|
+
exports.DoctorIcon = DoctorIcon;
|
|
862
999
|
exports.Icon = Icon;
|
|
863
1000
|
exports.Input = Input;
|
|
864
1001
|
exports.Logo = Logo;
|
|
865
1002
|
exports.Modal = Modal;
|
|
866
1003
|
exports.MultiSearchAutocomplete = MultiSearchAutocomplete;
|
|
1004
|
+
exports.PatientIcon = PatientIcon;
|
|
867
1005
|
exports.Search = Search;
|
|
868
1006
|
exports.SearchAutocomplete = SearchAutocomplete;
|
|
869
1007
|
exports.SpecialtySearchAutocomplete = SpecialtySearchAutocomplete;
|
|
1008
|
+
exports.ThemeProvider = ThemeProvider;
|
|
1009
|
+
exports.ThemeToggle = ThemeToggle;
|
|
1010
|
+
exports.UserIcon = UserIcon;
|
|
870
1011
|
exports.cn = cn;
|
|
871
1012
|
exports.debounce = debounce;
|
|
872
1013
|
exports.formatCurrency = formatCurrency;
|
|
@@ -874,4 +1015,5 @@ exports.formatDate = formatDate;
|
|
|
874
1015
|
exports.generateId = generateId;
|
|
875
1016
|
exports.useDebounce = useDebounce;
|
|
876
1017
|
exports.useDebouncedCallback = useDebouncedCallback;
|
|
1018
|
+
exports.useTheme = useTheme;
|
|
877
1019
|
//# sourceMappingURL=index.js.map
|