@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.
Files changed (43) hide show
  1. package/dist/components/ThemeToggle/ThemeToggle.d.ts +6 -0
  2. package/dist/components/ThemeToggle/ThemeToggle.d.ts.map +1 -0
  3. package/dist/components/ThemeToggle/index.d.ts +3 -0
  4. package/dist/components/ThemeToggle/index.d.ts.map +1 -0
  5. package/dist/icons/DoctorIcon.d.ts +4 -0
  6. package/dist/icons/DoctorIcon.d.ts.map +1 -0
  7. package/dist/icons/Icon.d.ts +18 -0
  8. package/dist/icons/Icon.d.ts.map +1 -1
  9. package/dist/icons/PatientIcon.d.ts +4 -0
  10. package/dist/icons/PatientIcon.d.ts.map +1 -0
  11. package/dist/icons/UserIcon.d.ts +4 -0
  12. package/dist/icons/UserIcon.d.ts.map +1 -0
  13. package/dist/icons/index.d.ts +4 -1
  14. package/dist/icons/index.d.ts.map +1 -1
  15. package/dist/index.css +3 -2
  16. package/dist/index.d.ts +62 -3
  17. package/dist/index.d.ts.map +1 -1
  18. package/dist/index.esm.css +3 -2
  19. package/dist/index.esm.js +156 -20
  20. package/dist/index.esm.js.map +1 -1
  21. package/dist/index.js +160 -18
  22. package/dist/index.js.map +1 -1
  23. package/dist/theme/ThemeProvider.d.ts +10 -0
  24. package/dist/theme/ThemeProvider.d.ts.map +1 -0
  25. package/dist/theme/themeConfig.d.ts +8 -0
  26. package/dist/theme/themeConfig.d.ts.map +1 -0
  27. package/dist/types/theme.d.ts +23 -0
  28. package/dist/types/theme.d.ts.map +1 -0
  29. package/package.json +7 -3
  30. package/src/components/ThemeToggle/ThemeToggle.tsx +43 -0
  31. package/src/components/ThemeToggle/index.ts +2 -0
  32. package/src/icons/DoctorIcon.tsx +14 -0
  33. package/src/icons/Icon.tsx +20 -0
  34. package/src/icons/PatientIcon.tsx +12 -0
  35. package/src/icons/UserIcon.tsx +12 -0
  36. package/src/icons/index.ts +6 -1
  37. package/src/index.ts +17 -2
  38. package/src/styles/index.css +162 -8
  39. package/src/styles/theme-variables.css +47 -0
  40. package/src/theme/ThemeProvider.tsx +69 -0
  41. package/src/theme/themeConfig.ts +40 -0
  42. package/src/types/theme.ts +24 -0
  43. package/tailwind.preset.js +166 -0
package/dist/index.esm.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
- import React, { forwardRef, createElement, useState, useEffect, useRef, useCallback } from 'react';
2
+ import React, { forwardRef, createElement, useState, useEffect, useRef, useCallback, createContext, useContext } from 'react';
3
3
 
4
4
  function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
5
5
 
@@ -205,11 +205,11 @@ const createLucideIcon = (iconName, iconNode) => {
205
205
  */
206
206
 
207
207
 
208
- const __iconNode$9 = [
208
+ const __iconNode$b = [
209
209
  ["path", { d: "M5 12h14", key: "1ays0h" }],
210
210
  ["path", { d: "m12 5 7 7-7 7", key: "xquz4c" }]
211
211
  ];
212
- const ArrowRight = createLucideIcon("arrow-right", __iconNode$9);
212
+ const ArrowRight = createLucideIcon("arrow-right", __iconNode$b);
213
213
 
214
214
  /**
215
215
  * @license lucide-react v0.544.0 - ISC
@@ -219,8 +219,8 @@ const ArrowRight = createLucideIcon("arrow-right", __iconNode$9);
219
219
  */
220
220
 
221
221
 
222
- const __iconNode$8 = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
223
- const Check = createLucideIcon("check", __iconNode$8);
222
+ const __iconNode$a = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
223
+ const Check = createLucideIcon("check", __iconNode$a);
224
224
 
225
225
  /**
226
226
  * @license lucide-react v0.544.0 - ISC
@@ -230,12 +230,12 @@ const Check = createLucideIcon("check", __iconNode$8);
230
230
  */
231
231
 
232
232
 
233
- const __iconNode$7 = [
233
+ const __iconNode$9 = [
234
234
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
235
235
  ["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
236
236
  ["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }]
237
237
  ];
238
- const CircleAlert = createLucideIcon("circle-alert", __iconNode$7);
238
+ const CircleAlert = createLucideIcon("circle-alert", __iconNode$9);
239
239
 
240
240
  /**
241
241
  * @license lucide-react v0.544.0 - ISC
@@ -245,11 +245,11 @@ const CircleAlert = createLucideIcon("circle-alert", __iconNode$7);
245
245
  */
246
246
 
247
247
 
248
- const __iconNode$6 = [
248
+ const __iconNode$8 = [
249
249
  ["path", { d: "M21.801 10A10 10 0 1 1 17 3.335", key: "yps3ct" }],
250
250
  ["path", { d: "m9 11 3 3L22 4", key: "1pflzl" }]
251
251
  ];
252
- const CircleCheckBig = createLucideIcon("circle-check-big", __iconNode$6);
252
+ const CircleCheckBig = createLucideIcon("circle-check-big", __iconNode$8);
253
253
 
254
254
  /**
255
255
  * @license lucide-react v0.544.0 - ISC
@@ -259,7 +259,7 @@ const CircleCheckBig = createLucideIcon("circle-check-big", __iconNode$6);
259
259
  */
260
260
 
261
261
 
262
- const __iconNode$5 = [
262
+ const __iconNode$7 = [
263
263
  [
264
264
  "path",
265
265
  {
@@ -277,7 +277,7 @@ const __iconNode$5 = [
277
277
  ],
278
278
  ["path", { d: "m2 2 20 20", key: "1ooewy" }]
279
279
  ];
280
- const EyeOff = createLucideIcon("eye-off", __iconNode$5);
280
+ const EyeOff = createLucideIcon("eye-off", __iconNode$7);
281
281
 
282
282
  /**
283
283
  * @license lucide-react v0.544.0 - ISC
@@ -287,7 +287,7 @@ const EyeOff = createLucideIcon("eye-off", __iconNode$5);
287
287
  */
288
288
 
289
289
 
290
- const __iconNode$4 = [
290
+ const __iconNode$6 = [
291
291
  [
292
292
  "path",
293
293
  {
@@ -297,7 +297,7 @@ const __iconNode$4 = [
297
297
  ],
298
298
  ["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
299
299
  ];
300
- const Eye = createLucideIcon("eye", __iconNode$4);
300
+ const Eye = createLucideIcon("eye", __iconNode$6);
301
301
 
302
302
  /**
303
303
  * @license lucide-react v0.544.0 - ISC
@@ -307,11 +307,30 @@ const Eye = createLucideIcon("eye", __iconNode$4);
307
307
  */
308
308
 
309
309
 
310
- const __iconNode$3 = [
310
+ const __iconNode$5 = [
311
+ [
312
+ "path",
313
+ {
314
+ 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",
315
+ key: "mvr1a0"
316
+ }
317
+ ]
318
+ ];
319
+ const Heart = createLucideIcon("heart", __iconNode$5);
320
+
321
+ /**
322
+ * @license lucide-react v0.544.0 - ISC
323
+ *
324
+ * This source code is licensed under the ISC license.
325
+ * See the LICENSE file in the root directory of this source tree.
326
+ */
327
+
328
+
329
+ const __iconNode$4 = [
311
330
  ["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
312
331
  ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
313
332
  ];
314
- const Search = createLucideIcon("search", __iconNode$3);
333
+ const Search = createLucideIcon("search", __iconNode$4);
315
334
 
316
335
  /**
317
336
  * @license lucide-react v0.544.0 - ISC
@@ -321,14 +340,14 @@ const Search = createLucideIcon("search", __iconNode$3);
321
340
  */
322
341
 
323
342
 
324
- const __iconNode$2 = [
343
+ const __iconNode$3 = [
325
344
  ["path", { d: "M11 2v2", key: "1539x4" }],
326
345
  ["path", { d: "M5 2v2", key: "1yf1q8" }],
327
346
  ["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" }],
328
347
  ["path", { d: "M8 15a6 6 0 0 0 12 0v-3", key: "x18d4x" }],
329
348
  ["circle", { cx: "20", cy: "10", r: "2", key: "ts1r5v" }]
330
349
  ];
331
- const Stethoscope = createLucideIcon("stethoscope", __iconNode$2);
350
+ const Stethoscope = createLucideIcon("stethoscope", __iconNode$3);
332
351
 
333
352
  /**
334
353
  * @license lucide-react v0.544.0 - ISC
@@ -338,7 +357,7 @@ const Stethoscope = createLucideIcon("stethoscope", __iconNode$2);
338
357
  */
339
358
 
340
359
 
341
- const __iconNode$1 = [
360
+ const __iconNode$2 = [
342
361
  [
343
362
  "path",
344
363
  {
@@ -349,7 +368,21 @@ const __iconNode$1 = [
349
368
  ["path", { d: "M12 9v4", key: "juzpu7" }],
350
369
  ["path", { d: "M12 17h.01", key: "p32p05" }]
351
370
  ];
352
- const TriangleAlert = createLucideIcon("triangle-alert", __iconNode$1);
371
+ const TriangleAlert = createLucideIcon("triangle-alert", __iconNode$2);
372
+
373
+ /**
374
+ * @license lucide-react v0.544.0 - ISC
375
+ *
376
+ * This source code is licensed under the ISC license.
377
+ * See the LICENSE file in the root directory of this source tree.
378
+ */
379
+
380
+
381
+ const __iconNode$1 = [
382
+ ["path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2", key: "975kel" }],
383
+ ["circle", { cx: "12", cy: "7", r: "4", key: "17ys0d" }]
384
+ ];
385
+ const User = createLucideIcon("user", __iconNode$1);
353
386
 
354
387
  /**
355
388
  * @license lucide-react v0.544.0 - ISC
@@ -377,6 +410,18 @@ const Icon = React.forwardRef(({ size = "md", icon: IconComponent, className, ..
377
410
  });
378
411
  Icon.displayName = "Icon";
379
412
 
413
+ const DoctorIcon = ({ size = 24, color = "currentColor", className = "", ...props }) => {
414
+ return (jsx(Stethoscope, { size: size, color: color, className: className, ...props }));
415
+ };
416
+
417
+ const PatientIcon = ({ size = 24, color = "currentColor", className = "", ...props }) => {
418
+ return jsx(Heart, { size: size, color: color, className: className, ...props });
419
+ };
420
+
421
+ const UserIcon = ({ size = 24, color = "currentColor", className = "", ...props }) => {
422
+ return jsx(User, { size: size, color: color, className: className, ...props });
423
+ };
424
+
380
425
  const Input = React.forwardRef(({ className, variant = "default", size = "md", label, helperText, error, leftIcon, rightIcon, fullWidth = false, showPasswordToggle = false, id, type = "text", ...props }, ref) => {
381
426
  const inputId = id || `input-${Math.random().toString(36).substr(2, 9)}`;
382
427
  const hasError = Boolean(error);
@@ -795,6 +840,97 @@ const Logo = ({ size = "md", showTagline = true, iconOnly = false, variant = "no
795
840
  return (jsx("div", { className: cn("flex items-center", sizes[size], className), onClick: onClick, role: onClick ? "button" : undefined, tabIndex: onClick ? 0 : undefined, children: jsx("img", { src: logoSrc, alt: "MEDECINE 360 Logo", className: "h-full w-auto object-contain" }) }));
796
841
  };
797
842
 
843
+ const PROMED_THEME = {
844
+ name: "PROMED",
845
+ colors: {
846
+ primary: "#21596C",
847
+ secondary: "#3BA1A1",
848
+ primaryHover: "#1a4756",
849
+ secondaryHover: "#308181",
850
+ primaryLight: "#c0d0d4",
851
+ success: "#059669",
852
+ successHover: "#047857",
853
+ warning: "#d97706",
854
+ warningHover: "#b45309",
855
+ error: "#dc2626",
856
+ errorHover: "#b91c1c",
857
+ },
858
+ };
859
+ const MED_THEME = {
860
+ name: "MED",
861
+ colors: {
862
+ primary: "#3BA1A1", // Teal for patients (calming, trustworthy)
863
+ secondary: "#6B73FF", // Soft purple-blue (suggested secondary for MED)
864
+ primaryHover: "#308181",
865
+ secondaryHover: "#5a61e6",
866
+ primaryLight: "#a8d5d5",
867
+ success: "#059669",
868
+ successHover: "#047857",
869
+ warning: "#d97706",
870
+ warningHover: "#b45309",
871
+ error: "#dc2626",
872
+ errorHover: "#b91c1c",
873
+ },
874
+ };
875
+ const THEMES = {
876
+ PROMED: PROMED_THEME,
877
+ MED: MED_THEME,
878
+ };
879
+
880
+ const ThemeContext = createContext(undefined);
881
+ const ThemeProvider = ({ children, defaultTheme = "PROMED", }) => {
882
+ const [theme, setTheme] = useState(defaultTheme);
883
+ const [themeConfig, setThemeConfig] = useState(THEMES[defaultTheme]);
884
+ // Update theme config when theme changes
885
+ useEffect(() => {
886
+ setThemeConfig(THEMES[theme]);
887
+ // Update data-theme attribute for CSS variable switching
888
+ const root = document.documentElement;
889
+ root.setAttribute("data-theme", theme);
890
+ // Also update CSS custom properties for backward compatibility
891
+ const colors = THEMES[theme].colors;
892
+ root.style.setProperty("--ews-primary", colors.primary);
893
+ root.style.setProperty("--ews-primary-hover", colors.primaryHover);
894
+ root.style.setProperty("--ews-primary-light", colors.primaryLight);
895
+ root.style.setProperty("--ews-secondary", colors.secondary);
896
+ root.style.setProperty("--ews-secondary-hover", colors.secondaryHover);
897
+ root.style.setProperty("--ews-success", colors.success);
898
+ root.style.setProperty("--ews-success-hover", colors.successHover);
899
+ root.style.setProperty("--ews-warning", colors.warning);
900
+ root.style.setProperty("--ews-warning-hover", colors.warningHover);
901
+ root.style.setProperty("--ews-error", colors.error);
902
+ root.style.setProperty("--ews-error-hover", colors.errorHover);
903
+ }, [theme]);
904
+ const handleSetTheme = (newTheme) => {
905
+ setTheme(newTheme);
906
+ };
907
+ const value = {
908
+ theme,
909
+ setTheme: handleSetTheme,
910
+ themeConfig,
911
+ };
912
+ return (jsx(ThemeContext.Provider, { value: value, children: children }));
913
+ };
914
+ const useTheme = () => {
915
+ const context = useContext(ThemeContext);
916
+ if (context === undefined) {
917
+ throw new Error("useTheme must be used within a ThemeProvider");
918
+ }
919
+ return context;
920
+ };
921
+
922
+ const ThemeToggle = ({ className }) => {
923
+ const { theme, setTheme } = useTheme();
924
+ const handleThemeChange = (newTheme) => {
925
+ setTheme(newTheme);
926
+ };
927
+ return (jsxs("div", { className: `flex items-center space-x-2 ${className || ""}`, children: [jsx("span", { className: "text-sm font-medium text-gray-700", children: "Theme:" }), jsxs("div", { className: "flex bg-gray-100 rounded-lg p-1", children: [jsx("button", { onClick: () => handleThemeChange("PROMED"), className: `px-3 py-1 text-xs font-medium rounded-md transition-colors ${theme === "PROMED"
928
+ ? "bg-ews-primary text-white"
929
+ : "text-gray-600 hover:text-gray-900"}`, children: "PROMED" }), jsx("button", { onClick: () => handleThemeChange("MED"), className: `px-3 py-1 text-xs font-medium rounded-md transition-colors ${theme === "MED"
930
+ ? "bg-ews-primary text-white"
931
+ : "text-gray-600 hover:text-gray-900"}`, children: "MED" })] })] }));
932
+ };
933
+
798
934
  const SpecialtySearchAutocomplete = ({ selectedSpecialties = [], onSpecialtiesChange, placeholder = "Search and select medical specialties...", className = "", disabled = false, maxSelections, showSelectedCount = true, }) => {
799
935
  const [specialties, setSpecialties] = useState([]);
800
936
  const [isLoading, setIsLoading] = useState(false);
@@ -854,5 +990,5 @@ const SpecialtySearchAutocomplete = ({ selectedSpecialties = [], onSpecialtiesCh
854
990
  : "border-gray-300"), children: isSelected && (jsx("svg", { className: "w-3 h-3 text-white", fill: "currentColor", viewBox: "0 0 20 20", children: jsx("path", { fillRule: "evenodd", d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z", clipRule: "evenodd" }) })) }), jsxs("div", { className: "flex flex-col", children: [jsx("span", { className: cn("font-medium", isSelected ? "text-ews-primary" : "text-gray-900"), children: specialty.label }), jsx("span", { className: cn("text-sm", isSelected ? "text-ews-primary/70" : "text-gray-500"), children: specialty.code })] })] })) }), showSelectedCount && selectedSpecialties.length > 0 && (jsxs("div", { className: "flex items-center justify-between text-sm text-gray-600", children: [jsxs("span", { children: [selectedSpecialties.length, " specialty", selectedSpecialties.length !== 1 ? "ies" : "", " selected"] }), maxSelections && (jsxs("span", { className: "text-gray-400", children: [selectedSpecialties.length, "/", maxSelections] }))] }))] }));
855
991
  };
856
992
 
857
- export { ArrowRight, Button, Check, Icon, Input, Logo, Modal, MultiSearchAutocomplete, Search, SearchAutocomplete, SpecialtySearchAutocomplete, cn, debounce, formatCurrency, formatDate, generateId, useDebounce, useDebouncedCallback };
993
+ export { ArrowRight, Button, Check, DoctorIcon, Icon, Input, Logo, Modal, MultiSearchAutocomplete, PatientIcon, Search, SearchAutocomplete, SpecialtySearchAutocomplete, ThemeProvider, ThemeToggle, UserIcon, cn, debounce, formatCurrency, formatDate, generateId, useDebounce, useDebouncedCallback, useTheme };
858
994
  //# sourceMappingURL=index.esm.js.map