@ews-admin/global-design-system 1.1.7 → 1.1.9

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 (42) hide show
  1. package/dist/assets/doctor.png +0 -0
  2. package/dist/assets/favicon.ico +0 -0
  3. package/dist/assets/logo.png +0 -0
  4. package/dist/assets/logoAssets.d.ts +11 -0
  5. package/dist/assets/logoAssets.d.ts.map +1 -0
  6. package/dist/assets/logoWhite.png +0 -0
  7. package/dist/assets/patient.png +0 -0
  8. package/dist/components/DoctorForm/DoctorForm.d.ts +11 -0
  9. package/dist/components/DoctorForm/DoctorForm.d.ts.map +1 -0
  10. package/dist/components/DoctorForm/index.d.ts +3 -0
  11. package/dist/components/DoctorForm/index.d.ts.map +1 -0
  12. package/dist/components/Input/Input.d.ts +4 -0
  13. package/dist/components/Input/Input.d.ts.map +1 -1
  14. package/dist/components/Logo/Logo.d.ts +1 -1
  15. package/dist/components/Logo/Logo.d.ts.map +1 -1
  16. package/dist/components/Modal/Modal.d.ts +3 -3
  17. package/dist/components/Modal/Modal.d.ts.map +1 -1
  18. package/dist/components/Select/Select.d.ts.map +1 -1
  19. package/dist/index.css +2 -2
  20. package/dist/index.d.ts +8 -4
  21. package/dist/index.esm.css +2 -2
  22. package/dist/index.esm.js +9 -7
  23. package/dist/index.esm.js.map +1 -1
  24. package/dist/index.js +9 -7
  25. package/dist/index.js.map +1 -1
  26. package/dist/public/doctor.png +0 -0
  27. package/dist/public/favicon.ico +0 -0
  28. package/dist/public/image/doctor.png +0 -0
  29. package/dist/public/image/logo.png +0 -0
  30. package/dist/public/image/logoWhite.png +0 -0
  31. package/dist/public/image/patient.png +0 -0
  32. package/dist/public/logo.png +0 -0
  33. package/dist/public/logoWhite.png +0 -0
  34. package/dist/public/patient.png +0 -0
  35. package/dist/types/doctor.d.ts +144 -0
  36. package/dist/types/doctor.d.ts.map +1 -0
  37. package/package.json +5 -4
  38. package/src/components/Input/Input.tsx +10 -4
  39. package/src/components/Logo/Logo.tsx +7 -5
  40. package/src/components/Modal/Modal.tsx +10 -10
  41. package/src/components/Select/Select.tsx +5 -2
  42. package/src/styles/index.css +0 -11
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,144 @@
1
+ export interface Coordinates {
2
+ lng: number;
3
+ lat: number;
4
+ }
5
+ export interface Location {
6
+ country: string;
7
+ address: string;
8
+ city: string;
9
+ state: string;
10
+ zip: string;
11
+ isPrimary: boolean;
12
+ residency: "HOME" | "OFFICE" | "CLINIC" | "HOSPITAL";
13
+ coordinates: Coordinates;
14
+ }
15
+ export interface Specialty {
16
+ code: string;
17
+ label: string;
18
+ }
19
+ export interface ProvidedService {
20
+ code: "CLINIC" | "ONLINE" | "HOME_VISIT" | "EMERGENCY";
21
+ price: number;
22
+ }
23
+ export interface CreateDoctorPayload {
24
+ firstName: string;
25
+ lastName: string;
26
+ refNumber: string;
27
+ civility: "MAN" | "WOMAN" | "OTHER";
28
+ email: string;
29
+ password: string;
30
+ roleName: "DOCTOR";
31
+ photoUrl?: string;
32
+ phoneNumber: string;
33
+ paymentPhoneNumber?: string;
34
+ healthcareFacilityIds: number[];
35
+ preferredNotificationMethods: ("EMAIL" | "SMS" | "PUSH")[];
36
+ dateOfBirth: string;
37
+ careerStartYear: string;
38
+ hospitalName?: string;
39
+ diplomas?: string;
40
+ activated: boolean;
41
+ providedServices: ProvidedService[];
42
+ specialties: Specialty[];
43
+ locations: Location[];
44
+ }
45
+ export interface DoctorFormData {
46
+ firstName: string;
47
+ lastName: string;
48
+ refNumber: string;
49
+ civility: "MAN" | "WOMAN" | "OTHER";
50
+ email: string;
51
+ password: string;
52
+ confirmPassword: string;
53
+ phoneNumber: string;
54
+ paymentPhoneNumber: string;
55
+ dateOfBirth: string;
56
+ photoUrl: string;
57
+ careerStartYear: string;
58
+ hospitalName: string;
59
+ diplomas: string;
60
+ activated: boolean;
61
+ healthcareFacilityIds: number[];
62
+ preferredNotificationMethods: ("EMAIL" | "SMS" | "PUSH")[];
63
+ providedServices: ProvidedService[];
64
+ specialties: Specialty[];
65
+ locations: Location[];
66
+ }
67
+ export declare const CIVILITY_OPTIONS: readonly [{
68
+ readonly value: "MAN";
69
+ readonly label: "Mr.";
70
+ }, {
71
+ readonly value: "WOMAN";
72
+ readonly label: "Ms.";
73
+ }, {
74
+ readonly value: "OTHER";
75
+ readonly label: "Other";
76
+ }];
77
+ export declare const NOTIFICATION_METHOD_OPTIONS: readonly [{
78
+ readonly value: "EMAIL";
79
+ readonly label: "Email";
80
+ }, {
81
+ readonly value: "SMS";
82
+ readonly label: "SMS";
83
+ }, {
84
+ readonly value: "PUSH";
85
+ readonly label: "Push Notification";
86
+ }];
87
+ export declare const RESIDENCY_OPTIONS: readonly [{
88
+ readonly value: "HOME";
89
+ readonly label: "Home";
90
+ }, {
91
+ readonly value: "OFFICE";
92
+ readonly label: "Office";
93
+ }, {
94
+ readonly value: "CLINIC";
95
+ readonly label: "Clinic";
96
+ }, {
97
+ readonly value: "HOSPITAL";
98
+ readonly label: "Hospital";
99
+ }];
100
+ export declare const SERVICE_TYPE_OPTIONS: readonly [{
101
+ readonly value: "CLINIC";
102
+ readonly label: "Clinic Visit";
103
+ }, {
104
+ readonly value: "ONLINE";
105
+ readonly label: "Online Consultation";
106
+ }, {
107
+ readonly value: "HOME_VISIT";
108
+ readonly label: "Home Visit";
109
+ }, {
110
+ readonly value: "EMERGENCY";
111
+ readonly label: "Emergency";
112
+ }];
113
+ export declare const SPECIALTY_OPTIONS: readonly [{
114
+ readonly value: "STOMATOLOGY";
115
+ readonly label: "Stomatology";
116
+ }, {
117
+ readonly value: "NEPHROLOGY";
118
+ readonly label: "Nephrology";
119
+ }, {
120
+ readonly value: "CARDIOLOGY";
121
+ readonly label: "Cardiology";
122
+ }, {
123
+ readonly value: "DERMATOLOGY";
124
+ readonly label: "Dermatology";
125
+ }, {
126
+ readonly value: "NEUROLOGY";
127
+ readonly label: "Neurology";
128
+ }, {
129
+ readonly value: "PEDIATRICS";
130
+ readonly label: "Pediatrics";
131
+ }, {
132
+ readonly value: "GYNECOLOGY";
133
+ readonly label: "Gynecology";
134
+ }, {
135
+ readonly value: "ORTHOPEDICS";
136
+ readonly label: "Orthopedics";
137
+ }, {
138
+ readonly value: "OPHTHALMOLOGY";
139
+ readonly label: "Ophthalmology";
140
+ }, {
141
+ readonly value: "PSYCHIATRY";
142
+ readonly label: "Psychiatry";
143
+ }];
144
+ //# sourceMappingURL=doctor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/types/doctor.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,QAAQ;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,CAAC;IACrD,WAAW,EAAE,WAAW,CAAC;CAC1B;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,YAAY,GAAG,WAAW,CAAC;IACvD,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,KAAK,GAAG,OAAO,GAAG,OAAO,CAAC;IACpC,KAAK,EAAE,MAAM,CAAC;I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pC,WAAW,EAAE,SAAS,EAAE,CAAC;IAGzB,SAAS,EAAE,QAAQ,EAAE,CAAC;CACvB;AAGD,eAAO,MAAM,gBAAgB;;;;;;;;;EAInB,CAAC;AAEX,eAAO,MAAM,2BAA2B;;;;;;;;;EAI9B,CAAC;AAEX,eAAO,MAAM,iBAAiB;;;;;;;;;;;;EAKpB,CAAC;AAEX,eAAO,MAAM,oBAAoB;;;;;;;;;;;;EAKvB,CAAC;AAGX,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWpB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ews-admin/global-design-system",
3
- "version": "1.1.7",
3
+ "version": "1.1.9",
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",
@@ -20,8 +20,8 @@
20
20
  "author": "EWS - Erco Web Solutions",
21
21
  "license": "MIT",
22
22
  "peerDependencies": {
23
- "react": ">=16.8.0",
24
- "react-dom": ">=16.8.0"
23
+ "react": "^18.2.0",
24
+ "react-dom": "^18.2.0"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@babel/core": "^7.23.0",
@@ -63,7 +63,8 @@
63
63
  "clsx": "^2.0.0",
64
64
  "lucide-react": "^0.544.0",
65
65
  "react": "^18.2.0",
66
- "react-dom": "^18.2.0"
66
+ "react-dom": "^18.2.0",
67
+ "react-hook-form": "^7.63.0"
67
68
  },
68
69
  "scripts": {
69
70
  "build": "rollup -c",
@@ -40,6 +40,10 @@ export interface InputProps
40
40
  * Whether to show password toggle for password inputs
41
41
  */
42
42
  showPasswordToggle?: boolean;
43
+ /**
44
+ * Whether the input is required (shows red asterisk)
45
+ */
46
+ required?: boolean;
43
47
  }
44
48
 
45
49
  const Input = React.forwardRef<HTMLInputElement, InputProps>(
@@ -55,6 +59,7 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>(
55
59
  rightIcon,
56
60
  fullWidth = false,
57
61
  showPasswordToggle = false,
62
+ required = false,
58
63
  id,
59
64
  type = "text",
60
65
  ...props
@@ -102,11 +107,12 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>(
102
107
  className="block text-sm font-medium text-ews-gray-700"
103
108
  >
104
109
  {label}
110
+ {required && <span className="ml-1 text-ews-error">*</span>}
105
111
  </label>
106
112
  )}
107
113
  <div className="relative">
108
114
  {leftIcon && (
109
- <div className="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
115
+ <div className="flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none">
110
116
  <span className={cn("text-ews-gray-400", iconSizes[size])}>
111
117
  {leftIcon}
112
118
  </span>
@@ -127,7 +133,7 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>(
127
133
  {...props}
128
134
  />
129
135
  {rightIcon && !shouldShowPasswordToggle && (
130
- <div className="absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none">
136
+ <div className="flex absolute inset-y-0 right-0 items-center pr-3 pointer-events-none">
131
137
  <span className={cn("text-ews-gray-400", iconSizes[size])}>
132
138
  {rightIcon}
133
139
  </span>
@@ -136,13 +142,13 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>(
136
142
  {shouldShowPasswordToggle && (
137
143
  <button
138
144
  type="button"
139
- className="absolute inset-y-0 right-0 pr-3 flex items-center"
145
+ className="flex absolute inset-y-0 right-0 items-center pr-3"
140
146
  onClick={() => setShowPassword(!showPassword)}
141
147
  tabIndex={-1}
142
148
  >
143
149
  <span
144
150
  className={cn(
145
- "text-ews-gray-400 hover:text-ews-gray-600 transition-colors",
151
+ "transition-colors text-ews-gray-400 hover:text-ews-gray-600",
146
152
  iconSizes[size]
147
153
  )}
148
154
  >
@@ -16,7 +16,7 @@ export interface LogoProps {
16
16
  /**
17
17
  * Logo variant - normal, white, or favicon
18
18
  */
19
- variant?: "normal" | "white" | "favicon";
19
+ variant?: "normal" | "white" | "fullWhite" | "favicon";
20
20
  /**
21
21
  * Custom className
22
22
  */
@@ -54,10 +54,12 @@ const Logo = ({
54
54
  const logoSrc = iconOnly
55
55
  ? "/favicon.ico"
56
56
  : variant === "white"
57
- ? "/image/logoWhite.png"
58
- : variant === "favicon"
59
- ? "/favicon.ico"
60
- : "/image/logo.png";
57
+ ? "/image/logoWhite.png"
58
+ : variant === "fullWhite"
59
+ ? "/image/logoFullWhite.png"
60
+ : variant === "favicon"
61
+ ? "/favicon.ico"
62
+ : "/image/logo.png";
61
63
 
62
64
  if (iconOnly) {
63
65
  return (
@@ -6,13 +6,13 @@ import { Button } from "../Button/Button";
6
6
  export interface ErrorField {
7
7
  name: string;
8
8
  message: string;
9
- path: string;
9
+ path?: string;
10
10
  }
11
11
 
12
12
  export interface ErrorObject {
13
13
  code: string;
14
14
  message: string;
15
- fields: ErrorField[];
15
+ fields?: ErrorField[];
16
16
  }
17
17
 
18
18
  export interface ModalProps {
@@ -31,7 +31,7 @@ export interface ModalProps {
31
31
  /**
32
32
  * Modal content/description
33
33
  */
34
- children: React.ReactNode;
34
+ children?: React.ReactNode;
35
35
  /**
36
36
  * Modal variant
37
37
  */
@@ -154,18 +154,18 @@ const Modal = ({
154
154
  };
155
155
 
156
156
  return (
157
- <div className="fixed inset-0 z-50 flex items-center justify-center">
157
+ <div className="flex fixed inset-0 z-50 justify-center items-center">
158
158
  {/* Backdrop */}
159
159
  <div
160
- className="absolute inset-0 bg-black/50 backdrop-blur-sm"
160
+ className="absolute inset-0 backdrop-blur-sm bg-black/50"
161
161
  onClick={handleOverlayClick}
162
162
  />
163
163
 
164
164
  {/* Modal */}
165
165
  <div
166
166
  className={cn(
167
- "relative w-full max-w-md mx-4 bg-white rounded-lg shadow-xl transform transition-all",
168
- "animate-in fade-in-0 zoom-in-95 duration-200",
167
+ "relative mx-4 w-full max-w-md bg-white rounded-lg shadow-xl transition-all transform",
168
+ "duration-200 animate-in fade-in-0 zoom-in-95",
169
169
  className
170
170
  )}
171
171
  role="dialog"
@@ -192,7 +192,7 @@ const Modal = ({
192
192
  </div>
193
193
  <button
194
194
  onClick={onClose}
195
- className="p-1 text-gray-400 hover:text-gray-600 transition-colors"
195
+ className="p-1 text-gray-400 transition-colors hover:text-gray-600"
196
196
  aria-label="Close modal"
197
197
  >
198
198
  <X className="w-5 h-5" />
@@ -201,7 +201,7 @@ const Modal = ({
201
201
 
202
202
  {/* Content */}
203
203
  <div className={cn("p-6", contentClassName)}>
204
- <div className="text-gray-700 leading-relaxed">
204
+ <div className="leading-relaxed text-gray-700">
205
205
  {error && variant === "error" ? (
206
206
  <div className="space-y-3">
207
207
  <p>{error.message}</p>
@@ -228,7 +228,7 @@ const Modal = ({
228
228
 
229
229
  {/* Actions */}
230
230
  {(primaryAction || secondaryAction) && (
231
- <div className="flex items-center justify-end space-x-3 p-6 pt-0">
231
+ <div className="flex justify-end items-center p-6 pt-0 space-x-3">
232
232
  {secondaryAction && (
233
233
  <Button
234
234
  variant="ghost"
@@ -1,6 +1,7 @@
1
1
  import { ChevronDown, Search, X } from "lucide-react";
2
2
  import React, { forwardRef, useEffect, useId, useRef, useState } from "react";
3
3
  import { cn } from "../../utils";
4
+ import { Input } from "../Input";
4
5
 
5
6
  export interface SelectOption<T = any> {
6
7
  value: T;
@@ -478,13 +479,15 @@ const Select = forwardRef<HTMLDivElement, SelectProps>(
478
479
  <div className="p-2 border-b border-ews-gray-200">
479
480
  <div className="relative">
480
481
  <Search className="absolute left-3 top-1/2 w-4 h-4 transform -translate-y-1/2 text-ews-gray-400" />
481
- <input
482
+ <Input
482
483
  ref={inputRef}
483
484
  type="text"
484
485
  value={searchTerm}
485
486
  onChange={(e) => setSearchTerm(e.target.value)}
486
487
  placeholder="Search options..."
487
- className="py-2 pr-3 pl-9 w-full text-sm rounded-md border border-ews-gray-300 focus:outline-none focus:ring-2 focus:ring-offset-0 focus:ring-ews-primary/20 focus:border-ews-primary"
488
+ leftIcon={
489
+ <Search className="w-4 h-4 text-ews-gray-400" />
490
+ }
488
491
  />
489
492
  </div>
490
493
  </div>
@@ -4,11 +4,6 @@
4
4
  @tailwind components;
5
5
  @tailwind utilities;
6
6
 
7
- /* Override browser default focus styles */
8
- *:focus {
9
- outline: none !important;
10
- }
11
-
12
7
  /* Ensure custom focus styles for all interactive elements */
13
8
  button:focus,
14
9
  input:focus,
@@ -40,12 +35,6 @@ textarea:focus,
40
35
  box-shadow: 0 0 0 2px var(--ews-primary) !important;
41
36
  }
42
37
 
43
- /* Override any browser default blue focus */
44
- *:focus {
45
- outline: none !important;
46
- box-shadow: none !important;
47
- }
48
-
49
38
  /* Specific override for div elements with tabindex */
50
39
  div[tabindex]:focus {
51
40
  outline: none !important;