@ews-admin/global-design-system 1.1.13 → 1.1.15
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/Button/Button.d.ts +1 -1
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/DropdownMultiSelect/DropdownMultiSelect.d.ts +22 -0
- package/dist/components/DropdownMultiSelect/DropdownMultiSelect.d.ts.map +1 -0
- package/dist/components/DropdownMultiSelect/index.d.ts +3 -0
- package/dist/components/DropdownMultiSelect/index.d.ts.map +1 -0
- package/dist/components/Logo/Logo.d.ts +3 -27
- package/dist/components/Logo/Logo.d.ts.map +1 -1
- package/dist/components/Logo/Logo.types.d.ts +41 -0
- package/dist/components/Logo/Logo.types.d.ts.map +1 -0
- package/dist/components/Logo/index.d.ts +1 -1
- package/dist/components/Logo/index.d.ts.map +1 -1
- package/dist/components/Logo/logoAssets.d.ts +1 -0
- package/dist/components/Logo/logoAssets.d.ts.map +1 -0
- package/dist/components/SearchAutocomplete/SearchAutocomplete.d.ts +1 -1
- package/dist/components/SearchAutocomplete/SearchAutocomplete.d.ts.map +1 -1
- package/dist/components/Select/Select.d.ts +3 -3
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/hooks/useSelectField.d.ts +4 -4
- package/dist/hooks/useSelectField.d.ts.map +1 -1
- package/dist/icons/Icon.d.ts +1 -1
- package/dist/icons/Icon.d.ts.map +1 -1
- package/dist/index.css +2 -2
- package/dist/index.d.ts +54 -18
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.css +2 -2
- package/dist/index.esm.js +184 -22
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +183 -20
- package/dist/index.js.map +1 -1
- package/dist/styles/theme-variables.css +62 -0
- package/dist/utils/index.d.ts +2 -2
- package/dist/utils/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/Button/Button.tsx +4 -1
- package/src/components/DropdownMultiSelect/DropdownMultiSelect.tsx +271 -0
- package/src/components/DropdownMultiSelect/index.ts +2 -0
- package/src/components/Logo/Logo.tsx +65 -45
- package/src/components/Logo/Logo.types.ts +42 -0
- package/src/components/Logo/index.ts +1 -1
- package/src/components/SearchAutocomplete/SearchAutocomplete.tsx +1 -1
- package/src/components/Select/Select.tsx +21 -8
- package/src/hooks/useSelectField.ts +7 -2
- package/src/icons/Icon.tsx +1 -1
- package/src/index.ts +3 -0
- package/src/styles/index.css +0 -32
- package/src/utils/index.ts +5 -3
- package/tailwind.preset.js +23 -23
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Control,
|
|
3
3
|
FieldPath,
|
|
4
|
+
FieldPathValue,
|
|
4
5
|
FieldValues,
|
|
6
|
+
RegisterOptions,
|
|
5
7
|
useController,
|
|
6
8
|
} from "react-hook-form";
|
|
7
9
|
import { SelectOption, SelectProps } from "../components/Select";
|
|
@@ -13,8 +15,11 @@ export interface UseSelectFieldProps<
|
|
|
13
15
|
name: TName;
|
|
14
16
|
control: Control<TFieldValues>;
|
|
15
17
|
options: SelectOption[];
|
|
16
|
-
rules?:
|
|
17
|
-
|
|
18
|
+
rules?: Omit<
|
|
19
|
+
RegisterOptions<TFieldValues, TName>,
|
|
20
|
+
"disabled" | "valueAsNumber" | "valueAsDate" | "setValueAs"
|
|
21
|
+
>;
|
|
22
|
+
defaultValue?: FieldPathValue<TFieldValues, TName>;
|
|
18
23
|
}
|
|
19
24
|
|
|
20
25
|
export function useSelectField<
|
package/src/icons/Icon.tsx
CHANGED
package/src/index.ts
CHANGED
|
@@ -16,6 +16,9 @@ export { MultiSearchAutocomplete } from "./components/MultiSearchAutocomplete";
|
|
|
16
16
|
export { Modal } from "./components/Modal";
|
|
17
17
|
export type { ErrorField, ErrorObject, ModalProps } from "./components/Modal";
|
|
18
18
|
|
|
19
|
+
export { DropdownMultiSelect } from "./components/DropdownMultiSelect";
|
|
20
|
+
export type { DropdownMultiSelectProps } from "./components/DropdownMultiSelect";
|
|
21
|
+
|
|
19
22
|
export { Logo } from "./components/Logo";
|
|
20
23
|
export type { LogoProps } from "./components/Logo";
|
|
21
24
|
|
package/src/styles/index.css
CHANGED
|
@@ -287,36 +287,4 @@ 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
|
-
}
|
|
322
290
|
}
|
package/src/utils/index.ts
CHANGED
|
@@ -52,7 +52,7 @@ export function formatDate(
|
|
|
52
52
|
* @param wait - Wait time in milliseconds
|
|
53
53
|
* @returns Debounced function
|
|
54
54
|
*/
|
|
55
|
-
export function debounce<T extends (...args:
|
|
55
|
+
export function debounce<T extends (...args: unknown[]) => unknown>(
|
|
56
56
|
func: T,
|
|
57
57
|
wait: number
|
|
58
58
|
): (...args: Parameters<T>) => void {
|
|
@@ -83,12 +83,14 @@ export const formatNumeric = (value: string): string => {
|
|
|
83
83
|
|
|
84
84
|
/**
|
|
85
85
|
* Utility function to validate phone numbers
|
|
86
|
-
* Validates phone numbers with 1-
|
|
86
|
+
* Validates phone numbers with 1-17 digits, optionally starting with + symbol
|
|
87
87
|
* @param value - Phone number string to validate
|
|
88
88
|
* @returns Boolean indicating if the phone number is valid
|
|
89
89
|
*/
|
|
90
90
|
export function isValidPhoneNumber(value: string): boolean {
|
|
91
91
|
const trimmedValue = value.trim();
|
|
92
|
-
|
|
92
|
+
// Allow + at the beginning, followed by 1-17 digits
|
|
93
|
+
// Or just 1-17 digits without +
|
|
94
|
+
const phoneRegex = /^(\+\d{1,17}|\d{1,17})$/;
|
|
93
95
|
return phoneRegex.test(trimmedValue);
|
|
94
96
|
}
|
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 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
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: "var(--ews-primary, #21596c)",
|
|
40
|
+
600: "var(--ews-primary-hover, #1a4756)",
|
|
41
|
+
700: "var(--ews-primary-hover, #1a4756)",
|
|
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: "var(--ews-secondary, #3ba1a1)",
|
|
52
|
+
600: "var(--ews-secondary-hover, #308181)",
|
|
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: "var(--ews-success, #059669)",
|
|
64
|
+
600: "var(--ews-success-hover, #047857)",
|
|
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: "var(--ews-warning, #d97706)",
|
|
76
|
+
600: "var(--ews-warning-hover, #b45309)",
|
|
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: "var(--ews-error, #dc2626)",
|
|
88
|
+
600: "var(--ews-error-hover, #b91c1c)",
|
|
89
89
|
700: "#b91c1c",
|
|
90
90
|
800: "#991b1b",
|
|
91
91
|
900: "#7f1d1d",
|