@ews-admin/global-design-system 1.1.2 → 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/package.json CHANGED
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "name": "@ews-admin/global-design-system",
3
- "version": "1.1.2",
3
+ "version": "1.1.5",
4
4
  "description": "EWS Global Design System - Reusable components for EWS applications",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "files": [
9
9
  "dist",
10
- "src"
10
+ "src",
11
+ "tailwind.preset.js"
11
12
  ],
12
13
  "keywords": [
13
14
  "design-system",
@@ -80,6 +81,9 @@
80
81
  "version:major": "pnpm version major",
81
82
  "view": "pnpm view @ews-admin/global-design-system",
82
83
  "clean": "rm -rf dist",
83
- "rebuild": "pnpm clean && pnpm build"
84
+ "rebuild": "pnpm clean && pnpm build",
85
+ "link": "pnpm build && pnpm link --global",
86
+ "unlink": "pnpm unlink --global",
87
+ "dev:watch": "pnpm build && pnpm dev"
84
88
  }
85
89
  }
@@ -0,0 +1,14 @@
1
+ import { Stethoscope } from "lucide-react";
2
+ import React from "react";
3
+ import { SimpleIconProps } from "./Icon";
4
+
5
+ export const DoctorIcon: React.FC<SimpleIconProps> = ({
6
+ size = 24,
7
+ color = "currentColor",
8
+ className = "",
9
+ ...props
10
+ }) => {
11
+ return (
12
+ <Stethoscope size={size} color={color} className={className} {...props} />
13
+ );
14
+ };
@@ -12,6 +12,26 @@ export interface IconProps extends Omit<LucideProps, "size"> {
12
12
  icon: React.ComponentType<LucideProps>;
13
13
  }
14
14
 
15
+ // Simple icon props for individual icon components
16
+ export interface SimpleIconProps {
17
+ /**
18
+ * Icon size in pixels
19
+ */
20
+ size?: number;
21
+ /**
22
+ * Icon color (can be hex, rgb, or Tailwind class)
23
+ */
24
+ color?: string;
25
+ /**
26
+ * Additional CSS classes (supports Tailwind classes)
27
+ */
28
+ className?: string;
29
+ /**
30
+ * Other props passed to the underlying icon
31
+ */
32
+ [key: string]: any;
33
+ }
34
+
15
35
  const Icon = React.forwardRef<SVGSVGElement, IconProps>(
16
36
  ({ size = "md", icon: IconComponent, className, ...props }, ref) => {
17
37
  const sizes = {
@@ -0,0 +1,12 @@
1
+ import { Heart } from "lucide-react";
2
+ import React from "react";
3
+ import { SimpleIconProps } from "./Icon";
4
+
5
+ export const PatientIcon: React.FC<SimpleIconProps> = ({
6
+ size = 24,
7
+ color = "currentColor",
8
+ className = "",
9
+ ...props
10
+ }) => {
11
+ return <Heart size={size} color={color} className={className} {...props} />;
12
+ };
@@ -0,0 +1,12 @@
1
+ import { User } from "lucide-react";
2
+ import React from "react";
3
+ import { SimpleIconProps } from "./Icon";
4
+
5
+ export const UserIcon: React.FC<SimpleIconProps> = ({
6
+ size = 24,
7
+ color = "currentColor",
8
+ className = "",
9
+ ...props
10
+ }) => {
11
+ return <User size={size} color={color} className={className} {...props} />;
12
+ };
@@ -38,4 +38,9 @@ export {
38
38
 
39
39
  // Keep our custom Icon component for backward compatibility
40
40
  export { Icon } from "./Icon";
41
- export type { IconProps } from "./Icon";
41
+ export type { IconProps, SimpleIconProps } from "./Icon";
42
+
43
+ // Custom EWS Icons
44
+ export { DoctorIcon } from "./DoctorIcon";
45
+ export { PatientIcon } from "./PatientIcon";
46
+ export { UserIcon } from "./UserIcon";
package/src/index.ts CHANGED
@@ -24,8 +24,16 @@ export { SpecialtySearchAutocomplete } from "./molecules";
24
24
  export type { Specialty, SpecialtySearchAutocompleteProps } from "./molecules";
25
25
 
26
26
  // Icons
27
- export { ArrowRight, Check, Icon, Search } from "./icons";
28
- export type { IconProps } from "./icons";
27
+ export {
28
+ ArrowRight,
29
+ Check,
30
+ DoctorIcon,
31
+ Icon,
32
+ PatientIcon,
33
+ Search,
34
+ UserIcon,
35
+ } from "./icons";
36
+ export type { IconProps, SimpleIconProps } from "./icons";
29
37
 
30
38
  // Utils
31
39
  export { cn, debounce, formatCurrency, formatDate, generateId } from "./utils";
@@ -1,4 +1,5 @@
1
1
  /* EWS Global Design System - Base Styles */
2
+ @import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap");
2
3
  @tailwind base;
3
4
  @tailwind components;
4
5
  @tailwind utilities;
@@ -73,15 +74,14 @@
73
74
  }
74
75
 
75
76
  /* Reset and Base Styles */
76
- * {
77
- box-sizing: border-box;
78
- }
77
+ @layer base {
78
+ html {
79
+ font-family: "Inter", system-ui, sans-serif;
80
+ }
79
81
 
80
- body {
81
- font-family: var(--ews-font-sans);
82
- line-height: 1.5;
83
- color: var(--ews-gray-900);
84
- background-color: var(--ews-white);
82
+ body {
83
+ @apply bg-neutral-50 text-neutral-900;
84
+ }
85
85
  }
86
86
 
87
87
  /* Utility Classes */
@@ -96,3 +96,157 @@ body {
96
96
  white-space: nowrap;
97
97
  border: 0;
98
98
  }
99
+ @layer base {
100
+ html {
101
+ font-family: "Inter", system-ui, sans-serif;
102
+ }
103
+
104
+ body {
105
+ @apply bg-neutral-50 text-neutral-900;
106
+ }
107
+ }
108
+ @layer utilities {
109
+ /* Custom shadow utilities */
110
+ .shadow-soft {
111
+ box-shadow: 0 2px 15px -3px rgba(0, 0, 0, 0.07),
112
+ 0 10px 20px -2px rgba(0, 0, 0, 0.04);
113
+ }
114
+
115
+ .shadow-medium {
116
+ box-shadow: 0 4px 25px -5px rgba(0, 0, 0, 0.1),
117
+ 0 10px 10px -5px rgba(0, 0, 0, 0.04);
118
+ }
119
+
120
+ .shadow-large {
121
+ box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.15),
122
+ 0 2px 10px -2px rgba(0, 0, 0, 0.05);
123
+ }
124
+ }
125
+
126
+ @layer components {
127
+ /* Custom scrollbar */
128
+ ::-webkit-scrollbar {
129
+ width: 6px;
130
+ }
131
+ ::-webkit-scrollbar-track {
132
+ @apply bg-neutral-100;
133
+ }
134
+
135
+ ::-webkit-scrollbar-thumb {
136
+ @apply rounded-full bg-neutral-300;
137
+ }
138
+
139
+ ::-webkit-scrollbar-thumb:hover {
140
+ @apply bg-neutral-400;
141
+ }
142
+
143
+ /* Card base styles */
144
+ .card-base {
145
+ @apply bg-white rounded-xl border shadow-soft border-neutral-200;
146
+ }
147
+
148
+ /* Sidebar navigation styles */
149
+ .sidebar-item {
150
+ @apply relative transition-all duration-200;
151
+ }
152
+
153
+ .sidebar-item-active {
154
+ @apply border-l-4 shadow-sm bg-primary-50 text-primary-700 border-l-primary-500;
155
+ }
156
+
157
+ .sidebar-item-hover {
158
+ @apply hover:bg-neutral-50 hover:text-neutral-900 hover:border-l-4 hover:border-l-neutral-300;
159
+ }
160
+
161
+ .sidebar-item-icon {
162
+ @apply transition-colors duration-200;
163
+ }
164
+
165
+ .sidebar-item-icon-active {
166
+ @apply text-primary-600;
167
+ }
168
+
169
+ .sidebar-item-icon-inactive {
170
+ @apply text-neutral-500;
171
+ }
172
+
173
+ /* Dashboard animations */
174
+ @keyframes fadeIn {
175
+ from {
176
+ opacity: 0;
177
+ transform: translateY(20px);
178
+ }
179
+ to {
180
+ opacity: 1;
181
+ transform: translateY(0);
182
+ }
183
+ }
184
+
185
+ @keyframes slideInFromLeft {
186
+ from {
187
+ opacity: 0;
188
+ transform: translateX(-20px);
189
+ }
190
+ to {
191
+ opacity: 1;
192
+ transform: translateX(0);
193
+ }
194
+ }
195
+
196
+ @keyframes slideInFromRight {
197
+ from {
198
+ opacity: 0;
199
+ transform: translateX(20px);
200
+ }
201
+ to {
202
+ opacity: 1;
203
+ transform: translateX(0);
204
+ }
205
+ }
206
+
207
+ @keyframes scaleIn {
208
+ from {
209
+ opacity: 0;
210
+ transform: scale(0.9);
211
+ }
212
+ to {
213
+ opacity: 1;
214
+ transform: scale(1);
215
+ }
216
+ }
217
+
218
+ .animate-fadeIn {
219
+ animation: fadeIn 0.6s ease-out;
220
+ }
221
+
222
+ .animate-slideInLeft {
223
+ animation: slideInFromLeft 0.6s ease-out;
224
+ }
225
+
226
+ .animate-slideInRight {
227
+ animation: slideInFromRight 0.6s ease-out;
228
+ }
229
+
230
+ .animate-scaleIn {
231
+ animation: scaleIn 0.6s ease-out;
232
+ }
233
+
234
+ /* Hover animations */
235
+ .hover-lift {
236
+ transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
237
+ }
238
+
239
+ .hover-lift:hover {
240
+ transform: translateY(-2px);
241
+ box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1),
242
+ 0 10px 10px -5px rgba(0, 0, 0, 0.04);
243
+ }
244
+
245
+ .hover-scale {
246
+ transition: transform 0.2s ease-out;
247
+ }
248
+
249
+ .hover-scale:hover {
250
+ transform: scale(1.02);
251
+ }
252
+ }
@@ -0,0 +1,47 @@
1
+ /* EWS Design System - Theme CSS Variables */
2
+ /* This file should be imported in consuming applications */
3
+
4
+ :root {
5
+ /* PROMED Theme (Default) - Professional theme for doctors/managers */
6
+ --ews-primary: #21596c;
7
+ --ews-primary-hover: #1a4756;
8
+ --ews-primary-light: #c0d0d4;
9
+ --ews-secondary: #3ba1a1;
10
+ --ews-secondary-hover: #308181;
11
+ --ews-success: #059669;
12
+ --ews-success-hover: #047857;
13
+ --ews-warning: #d97706;
14
+ --ews-warning-hover: #b45309;
15
+ --ews-error: #dc2626;
16
+ --ews-error-hover: #b91c1c;
17
+ }
18
+
19
+ /* MED Theme - Patient-friendly theme */
20
+ [data-theme="MED"] {
21
+ --ews-primary: #3ba1a1;
22
+ --ews-primary-hover: #308181;
23
+ --ews-primary-light: #a8d5d5;
24
+ --ews-secondary: #6b73ff;
25
+ --ews-secondary-hover: #5a61e6;
26
+ --ews-success: #059669;
27
+ --ews-success-hover: #047857;
28
+ --ews-warning: #d97706;
29
+ --ews-warning-hover: #b45309;
30
+ --ews-error: #dc2626;
31
+ --ews-error-hover: #b91c1c;
32
+ }
33
+
34
+ /* PROMED Theme - Professional theme */
35
+ [data-theme="PROMED"] {
36
+ --ews-primary: #21596c;
37
+ --ews-primary-hover: #1a4756;
38
+ --ews-primary-light: #c0d0d4;
39
+ --ews-secondary: #3ba1a1;
40
+ --ews-secondary-hover: #308181;
41
+ --ews-success: #059669;
42
+ --ews-success-hover: #047857;
43
+ --ews-warning: #d97706;
44
+ --ews-warning-hover: #b45309;
45
+ --ews-error: #dc2626;
46
+ --ews-error-hover: #b91c1c;
47
+ }
@@ -26,10 +26,12 @@ export const ThemeProvider: React.FC<ThemeProviderProps> = ({
26
26
  useEffect(() => {
27
27
  setThemeConfig(THEMES[theme]);
28
28
 
29
- // Update CSS custom properties
29
+ // Update data-theme attribute for CSS variable switching
30
30
  const root = document.documentElement;
31
- const colors = THEMES[theme].colors;
31
+ root.setAttribute("data-theme", theme);
32
32
 
33
+ // Also update CSS custom properties for backward compatibility
34
+ const colors = THEMES[theme].colors;
33
35
  root.style.setProperty("--ews-primary", colors.primary);
34
36
  root.style.setProperty("--ews-primary-hover", colors.primaryHover);
35
37
  root.style.setProperty("--ews-primary-light", colors.primaryLight);
@@ -0,0 +1,166 @@
1
+ /** @type {import('tailwindcss').Config} */
2
+ module.exports = {
3
+ content: [],
4
+ theme: {
5
+ extend: {
6
+ colors: {
7
+ // EWS Theme Colors - These will be available as CSS variables
8
+ "ews-primary": "var(--ews-primary, #21596c)",
9
+ "ews-primary-hover": "var(--ews-primary-hover, #1a4756)",
10
+ "ews-primary-light": "var(--ews-primary-light, #c0d0d4)",
11
+ "ews-secondary": "var(--ews-secondary, #3ba1a1)",
12
+ "ews-secondary-hover": "var(--ews-secondary-hover, #308181)",
13
+ "ews-success": "var(--ews-success, #059669)",
14
+ "ews-success-hover": "var(--ews-success-hover, #047857)",
15
+ "ews-warning": "var(--ews-warning, #d97706)",
16
+ "ews-warning-hover": "var(--ews-warning-hover, #b45309)",
17
+ "ews-error": "var(--ews-error, #dc2626)",
18
+ "ews-error-hover": "var(--ews-error-hover, #b91c1c)",
19
+
20
+ // EWS Gray Scale
21
+ "ews-gray-50": "#f8fafc",
22
+ "ews-gray-100": "#f1f5f9",
23
+ "ews-gray-200": "#e2e8f0",
24
+ "ews-gray-300": "#cbd5e1",
25
+ "ews-gray-400": "#94a3b8",
26
+ "ews-gray-500": "#64748b",
27
+ "ews-gray-600": "#475569",
28
+ "ews-gray-700": "#334155",
29
+ "ews-gray-800": "#1e293b",
30
+ "ews-gray-900": "#0f172a",
31
+
32
+ // Standard Tailwind color scales for compatibility
33
+ primary: {
34
+ 50: "#f0f9ff",
35
+ 100: "#e0f2fe",
36
+ 200: "#bae6fd",
37
+ 300: "#7dd3fc",
38
+ 400: "#38bdf8",
39
+ 500: "var(--ews-primary, #21596c)",
40
+ 600: "var(--ews-primary-hover, #1a4756)",
41
+ 700: "var(--ews-primary-hover, #1a4756)",
42
+ 800: "#0f2d36",
43
+ 900: "#0a1f26",
44
+ },
45
+ secondary: {
46
+ 50: "#f0fdfa",
47
+ 100: "#ccfbf1",
48
+ 200: "#99f6e4",
49
+ 300: "#5eead4",
50
+ 400: "#2dd4bf",
51
+ 500: "var(--ews-secondary, #3ba1a1)",
52
+ 600: "var(--ews-secondary-hover, #308181)",
53
+ 700: "#0f766e",
54
+ 800: "#115e59",
55
+ 900: "#134e4a",
56
+ },
57
+ success: {
58
+ 50: "#f0fdf4",
59
+ 100: "#dcfce7",
60
+ 200: "#bbf7d0",
61
+ 300: "#86efac",
62
+ 400: "#4ade80",
63
+ 500: "var(--ews-success, #059669)",
64
+ 600: "var(--ews-success-hover, #047857)",
65
+ 700: "#15803d",
66
+ 800: "#166534",
67
+ 900: "#14532d",
68
+ },
69
+ warning: {
70
+ 50: "#fffbeb",
71
+ 100: "#fef3c7",
72
+ 200: "#fde68a",
73
+ 300: "#fcd34d",
74
+ 400: "#fbbf24",
75
+ 500: "var(--ews-warning, #d97706)",
76
+ 600: "var(--ews-warning-hover, #b45309)",
77
+ 700: "#b45309",
78
+ 800: "#92400e",
79
+ 900: "#78350f",
80
+ },
81
+ error: {
82
+ 50: "#fef2f2",
83
+ 100: "#fee2e2",
84
+ 200: "#fecaca",
85
+ 300: "#fca5a5",
86
+ 400: "#f87171",
87
+ 500: "var(--ews-error, #dc2626)",
88
+ 600: "var(--ews-error-hover, #b91c1c)",
89
+ 700: "#b91c1c",
90
+ 800: "#991b1b",
91
+ 900: "#7f1d1d",
92
+ },
93
+ neutral: {
94
+ 50: "#f8fafc",
95
+ 100: "#f1f5f9",
96
+ 200: "#e2e8f0",
97
+ 300: "#cbd5e1",
98
+ 400: "#94a3b8",
99
+ 500: "#64748b",
100
+ 600: "#475569",
101
+ 700: "#334155",
102
+ 800: "#1e293b",
103
+ 900: "#0f172a",
104
+ },
105
+ },
106
+ fontFamily: {
107
+ // Add EWS font families if needed
108
+ sans: ["Inter", "system-ui", "sans-serif"],
109
+ },
110
+ spacing: {
111
+ // Add EWS specific spacing if needed
112
+ },
113
+ borderRadius: {
114
+ // Add EWS specific border radius if needed
115
+ },
116
+ boxShadow: {
117
+ // Standard Tailwind shadows
118
+ sm: "0 1px 2px 0 rgba(0, 0, 0, 0.05)",
119
+ md: "0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",
120
+ lg: "0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",
121
+ xl: "0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)",
122
+ "2xl": "0 25px 50px -12px rgba(0, 0, 0, 0.25)",
123
+ inner: "inset 0 2px 4px 0 rgba(0, 0, 0, 0.06)",
124
+ none: "0 0 #0000",
125
+
126
+ // EWS specific shadows
127
+ "ews-sm": "0 1px 2px 0 rgba(0, 0, 0, 0.05)",
128
+ "ews-md":
129
+ "0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",
130
+ "ews-lg":
131
+ "0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",
132
+ soft: "0 2px 15px -3px rgba(0, 0, 0, 0.07), 0 10px 20px -2px rgba(0, 0, 0, 0.04)",
133
+ medium:
134
+ "0 4px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)",
135
+ large:
136
+ "0 10px 40px -10px rgba(0, 0, 0, 0.15), 0 2px 10px -2px rgba(0, 0, 0, 0.05)",
137
+ },
138
+ },
139
+ },
140
+ plugins: [
141
+ // Add any EWS specific plugins here
142
+ function ({ addUtilities }) {
143
+ const newUtilities = {
144
+ ".ews-text-primary": {
145
+ color: "var(--ews-primary)",
146
+ },
147
+ ".ews-text-secondary": {
148
+ color: "var(--ews-secondary)",
149
+ },
150
+ ".ews-bg-primary": {
151
+ backgroundColor: "var(--ews-primary)",
152
+ },
153
+ ".ews-bg-secondary": {
154
+ backgroundColor: "var(--ews-secondary)",
155
+ },
156
+ ".ews-border-primary": {
157
+ borderColor: "var(--ews-primary)",
158
+ },
159
+ ".ews-border-secondary": {
160
+ borderColor: "var(--ews-secondary)",
161
+ },
162
+ };
163
+ addUtilities(newUtilities);
164
+ },
165
+ ],
166
+ };