@ews-admin/global-design-system 1.1.9 → 1.1.11
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/Input/Input.d.ts.map +1 -1
- package/dist/components/MultiSearchAutocomplete/MultiSearchAutocomplete.d.ts.map +1 -1
- package/dist/index.css +2 -2
- package/dist/index.esm.css +2 -2
- package/dist/index.esm.js +24 -8
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +24 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Input/Input.tsx +56 -0
- package/src/components/MultiSearchAutocomplete/MultiSearchAutocomplete.tsx +13 -11
- package/src/components/Select/Select.tsx +1 -1
- package/src/molecules/SpecialtySearchAutocomplete/SpecialtySearchAutocomplete.tsx +1 -1
- package/src/styles/index.css +32 -0
- package/tailwind.preset.js +23 -23
package/package.json
CHANGED
|
@@ -99,6 +99,62 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>(
|
|
|
99
99
|
lg: "h-6 w-6",
|
|
100
100
|
};
|
|
101
101
|
|
|
102
|
+
const isCheckbox = type === "checkbox";
|
|
103
|
+
|
|
104
|
+
// For checkboxes, render with or without label based on label prop
|
|
105
|
+
if (isCheckbox) {
|
|
106
|
+
if (label) {
|
|
107
|
+
// Render checkbox with built-in label
|
|
108
|
+
return (
|
|
109
|
+
<div className={cn("space-y-1", fullWidth ? "w-full" : "w-auto")}>
|
|
110
|
+
<div className="flex items-start space-x-3">
|
|
111
|
+
<input
|
|
112
|
+
id={inputId}
|
|
113
|
+
type={actualType}
|
|
114
|
+
className={cn(
|
|
115
|
+
"mt-0.5", // Slight top margin to align with first line of text
|
|
116
|
+
className
|
|
117
|
+
)}
|
|
118
|
+
ref={ref}
|
|
119
|
+
{...props}
|
|
120
|
+
/>
|
|
121
|
+
<div className="flex-1">
|
|
122
|
+
<label
|
|
123
|
+
htmlFor={inputId}
|
|
124
|
+
className="block text-sm font-medium cursor-pointer text-ews-gray-700"
|
|
125
|
+
>
|
|
126
|
+
{label}
|
|
127
|
+
{required && <span className="ml-1 text-ews-error">*</span>}
|
|
128
|
+
</label>
|
|
129
|
+
{(error || helperText) && (
|
|
130
|
+
<p
|
|
131
|
+
className={cn(
|
|
132
|
+
"mt-1 text-sm",
|
|
133
|
+
error ? "text-ews-error" : "text-ews-gray-500"
|
|
134
|
+
)}
|
|
135
|
+
>
|
|
136
|
+
{error || helperText}
|
|
137
|
+
</p>
|
|
138
|
+
)}
|
|
139
|
+
</div>
|
|
140
|
+
</div>
|
|
141
|
+
</div>
|
|
142
|
+
);
|
|
143
|
+
} else {
|
|
144
|
+
// Render just the checkbox for external label usage
|
|
145
|
+
return (
|
|
146
|
+
<input
|
|
147
|
+
id={inputId}
|
|
148
|
+
type={actualType}
|
|
149
|
+
className={cn(className)}
|
|
150
|
+
ref={ref}
|
|
151
|
+
{...props}
|
|
152
|
+
/>
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// Default rendering for non-checkbox inputs
|
|
102
158
|
return (
|
|
103
159
|
<div className={cn("space-y-1", fullWidth ? "w-full" : "w-auto")}>
|
|
104
160
|
{label && (
|
|
@@ -181,7 +181,7 @@ export function MultiSearchAutocomplete<T extends SearchableEntity>({
|
|
|
181
181
|
|
|
182
182
|
// Default render functions
|
|
183
183
|
const defaultRenderSelectedItem = (entity: T) => (
|
|
184
|
-
<span className="inline-flex items-center px-3 py-1 text-sm font-medium rounded-full bg-ews-primary/10 text-ews-primary border
|
|
184
|
+
<span className="inline-flex items-center px-3 py-1 text-sm font-medium rounded-full border bg-ews-primary/10 text-ews-primary border-ews-primary/20">
|
|
185
185
|
{getPrimaryText(entity)}
|
|
186
186
|
<button
|
|
187
187
|
type="button"
|
|
@@ -199,8 +199,10 @@ export function MultiSearchAutocomplete<T extends SearchableEntity>({
|
|
|
199
199
|
<div className="flex items-center space-x-3">
|
|
200
200
|
<div
|
|
201
201
|
className={cn(
|
|
202
|
-
"w-5 h-5 border-2
|
|
203
|
-
isSelected
|
|
202
|
+
"flex justify-center items-center w-5 h-5 rounded border-2",
|
|
203
|
+
isSelected
|
|
204
|
+
? "bg-ews-primary border-ews-primary"
|
|
205
|
+
: "border-ews-gray-300"
|
|
204
206
|
)}
|
|
205
207
|
>
|
|
206
208
|
{isSelected && <Check className="w-3 h-3 text-white" />}
|
|
@@ -259,23 +261,23 @@ export function MultiSearchAutocomplete<T extends SearchableEntity>({
|
|
|
259
261
|
|
|
260
262
|
{/* Dropdown */}
|
|
261
263
|
{isOpen && !disabled && (
|
|
262
|
-
<div className="absolute z-10 mt-1 w-full max-h-60 bg-white rounded-lg border border-gray-200 shadow-lg
|
|
264
|
+
<div className="overflow-auto absolute z-10 mt-1 w-full max-h-60 bg-white rounded-lg border border-gray-200 shadow-lg">
|
|
263
265
|
{loading || isSearching ? (
|
|
264
|
-
<div className="px-4 py-3 text-sm text-gray-500
|
|
265
|
-
<div className="
|
|
266
|
+
<div className="flex items-center px-4 py-3 text-sm text-gray-500">
|
|
267
|
+
<div className="mr-2 w-4 h-4 rounded-full border-b-2 animate-spin border-ews-primary"></div>
|
|
266
268
|
{isSearching ? "Searching..." : "Loading..."}
|
|
267
269
|
</div>
|
|
268
270
|
) : searchError ? (
|
|
269
271
|
<div className="px-4 py-3 text-sm text-red-600">
|
|
270
272
|
<div className="flex items-center">
|
|
271
|
-
<X className="w-4 h-4
|
|
273
|
+
<X className="mr-2 w-4 h-4" />
|
|
272
274
|
Error: {searchError}
|
|
273
275
|
</div>
|
|
274
276
|
</div>
|
|
275
277
|
) : error ? (
|
|
276
278
|
<div className="px-4 py-3 text-sm text-red-600">
|
|
277
279
|
<div className="flex items-center">
|
|
278
|
-
<X className="w-4 h-4
|
|
280
|
+
<X className="mr-2 w-4 h-4" />
|
|
279
281
|
{error}
|
|
280
282
|
</div>
|
|
281
283
|
</div>
|
|
@@ -298,10 +300,10 @@ export function MultiSearchAutocomplete<T extends SearchableEntity>({
|
|
|
298
300
|
type="button"
|
|
299
301
|
onClick={() => handleItemToggle(item)}
|
|
300
302
|
className={cn(
|
|
301
|
-
"
|
|
303
|
+
"flex items-center px-4 py-3 w-full text-left transition-colors",
|
|
302
304
|
isSelected
|
|
303
|
-
? "bg-ews-primary/10 text-ews-primary border-
|
|
304
|
-
: "hover:bg-ews-primary/5
|
|
305
|
+
? "border-l-4 bg-ews-primary/10 text-ews-primary border-ews-primary"
|
|
306
|
+
: "text-gray-900 hover:bg-ews-primary/5"
|
|
305
307
|
)}
|
|
306
308
|
>
|
|
307
309
|
{renderListItem
|
|
@@ -375,7 +375,7 @@ const Select = forwardRef<HTMLDivElement, SelectProps>(
|
|
|
375
375
|
htmlFor={selectId}
|
|
376
376
|
className={cn(
|
|
377
377
|
"block text-sm font-medium mb-1",
|
|
378
|
-
|
|
378
|
+
"text-ews-gray-700",
|
|
379
379
|
disabled && "text-ews-gray-400"
|
|
380
380
|
)}
|
|
381
381
|
>
|
|
@@ -145,7 +145,7 @@ export const SpecialtySearchAutocomplete: React.FC<
|
|
|
145
145
|
"w-5 h-5 border-2 rounded flex items-center justify-center",
|
|
146
146
|
isSelected
|
|
147
147
|
? "bg-ews-primary border-ews-primary"
|
|
148
|
-
: "border-gray-300"
|
|
148
|
+
: "border-ews-gray-300"
|
|
149
149
|
)}
|
|
150
150
|
>
|
|
151
151
|
{isSelected && (
|
package/src/styles/index.css
CHANGED
|
@@ -287,4 +287,36 @@ div[tabindex]:focus {
|
|
|
287
287
|
.hover-scale:hover {
|
|
288
288
|
transform: scale(1.02);
|
|
289
289
|
}
|
|
290
|
+
|
|
291
|
+
/* Custom checkbox styling for better control */
|
|
292
|
+
input[type="checkbox"] {
|
|
293
|
+
width: 1rem;
|
|
294
|
+
height: 1rem;
|
|
295
|
+
border-radius: 0.25rem;
|
|
296
|
+
border: 2px solid var(--ews-gray-300);
|
|
297
|
+
background-color: white;
|
|
298
|
+
cursor: pointer;
|
|
299
|
+
transition: all 0.2s ease-in-out;
|
|
300
|
+
accent-color: var(--ews-primary);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
input[type="checkbox"]:hover {
|
|
304
|
+
border-color: var(--ews-primary);
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
input[type="checkbox"]:focus {
|
|
308
|
+
outline: none;
|
|
309
|
+
border-color: var(--ews-primary);
|
|
310
|
+
box-shadow: 0 0 0 2px var(--ews-primary);
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
input[type="checkbox"]:checked {
|
|
314
|
+
background-color: var(--ews-primary);
|
|
315
|
+
border-color: var(--ews-primary);
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
input[type="checkbox"]:disabled {
|
|
319
|
+
opacity: 0.5;
|
|
320
|
+
cursor: not-allowed;
|
|
321
|
+
}
|
|
290
322
|
}
|
package/tailwind.preset.js
CHANGED
|
@@ -4,18 +4,18 @@ module.exports = {
|
|
|
4
4
|
theme: {
|
|
5
5
|
extend: {
|
|
6
6
|
colors: {
|
|
7
|
-
// EWS Theme Colors - These
|
|
8
|
-
"ews-primary": "
|
|
9
|
-
"ews-primary-hover": "
|
|
10
|
-
"ews-primary-light": "
|
|
11
|
-
"ews-secondary": "
|
|
12
|
-
"ews-secondary-hover": "
|
|
13
|
-
"ews-success": "
|
|
14
|
-
"ews-success-hover": "
|
|
15
|
-
"ews-warning": "
|
|
16
|
-
"ews-warning-hover": "
|
|
17
|
-
"ews-error": "
|
|
18
|
-
"ews-error-hover": "
|
|
7
|
+
// EWS Theme Colors - These work with Tailwind opacity modifiers
|
|
8
|
+
"ews-primary": "rgb(33 89 108)",
|
|
9
|
+
"ews-primary-hover": "rgb(26 71 86)",
|
|
10
|
+
"ews-primary-light": "rgb(192 208 212)",
|
|
11
|
+
"ews-secondary": "rgb(59 161 161)",
|
|
12
|
+
"ews-secondary-hover": "rgb(48 129 129)",
|
|
13
|
+
"ews-success": "rgb(5 150 105)",
|
|
14
|
+
"ews-success-hover": "rgb(4 120 87)",
|
|
15
|
+
"ews-warning": "rgb(217 119 6)",
|
|
16
|
+
"ews-warning-hover": "rgb(180 83 9)",
|
|
17
|
+
"ews-error": "rgb(220 38 38)",
|
|
18
|
+
"ews-error-hover": "rgb(185 28 28)",
|
|
19
19
|
|
|
20
20
|
// EWS Gray Scale
|
|
21
21
|
"ews-gray-50": "#f8fafc",
|
|
@@ -36,9 +36,9 @@ module.exports = {
|
|
|
36
36
|
200: "#bae6fd",
|
|
37
37
|
300: "#7dd3fc",
|
|
38
38
|
400: "#38bdf8",
|
|
39
|
-
500: "
|
|
40
|
-
600: "
|
|
41
|
-
700: "
|
|
39
|
+
500: "rgb(33 89 108)",
|
|
40
|
+
600: "rgb(26 71 86)",
|
|
41
|
+
700: "rgb(26 71 86)",
|
|
42
42
|
800: "#0f2d36",
|
|
43
43
|
900: "#0a1f26",
|
|
44
44
|
},
|
|
@@ -48,8 +48,8 @@ module.exports = {
|
|
|
48
48
|
200: "#99f6e4",
|
|
49
49
|
300: "#5eead4",
|
|
50
50
|
400: "#2dd4bf",
|
|
51
|
-
500: "
|
|
52
|
-
600: "
|
|
51
|
+
500: "rgb(59 161 161)",
|
|
52
|
+
600: "rgb(48 129 129)",
|
|
53
53
|
700: "#0f766e",
|
|
54
54
|
800: "#115e59",
|
|
55
55
|
900: "#134e4a",
|
|
@@ -60,8 +60,8 @@ module.exports = {
|
|
|
60
60
|
200: "#bbf7d0",
|
|
61
61
|
300: "#86efac",
|
|
62
62
|
400: "#4ade80",
|
|
63
|
-
500: "
|
|
64
|
-
600: "
|
|
63
|
+
500: "rgb(5 150 105)",
|
|
64
|
+
600: "rgb(4 120 87)",
|
|
65
65
|
700: "#15803d",
|
|
66
66
|
800: "#166534",
|
|
67
67
|
900: "#14532d",
|
|
@@ -72,8 +72,8 @@ module.exports = {
|
|
|
72
72
|
200: "#fde68a",
|
|
73
73
|
300: "#fcd34d",
|
|
74
74
|
400: "#fbbf24",
|
|
75
|
-
500: "
|
|
76
|
-
600: "
|
|
75
|
+
500: "rgb(217 119 6)",
|
|
76
|
+
600: "rgb(180 83 9)",
|
|
77
77
|
700: "#b45309",
|
|
78
78
|
800: "#92400e",
|
|
79
79
|
900: "#78350f",
|
|
@@ -84,8 +84,8 @@ module.exports = {
|
|
|
84
84
|
200: "#fecaca",
|
|
85
85
|
300: "#fca5a5",
|
|
86
86
|
400: "#f87171",
|
|
87
|
-
500: "
|
|
88
|
-
600: "
|
|
87
|
+
500: "rgb(220 38 38)",
|
|
88
|
+
600: "rgb(185 28 28)",
|
|
89
89
|
700: "#b91c1c",
|
|
90
90
|
800: "#991b1b",
|
|
91
91
|
900: "#7f1d1d",
|