@ews-admin/global-design-system 1.0.0
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/README.md +195 -0
- package/dist/components/Button/Button.d.ts +30 -0
- package/dist/components/Button/Button.d.ts.map +1 -0
- package/dist/components/Button/index.d.ts +3 -0
- package/dist/components/Button/index.d.ts.map +1 -0
- package/dist/components/Input/Input.d.ts +38 -0
- package/dist/components/Input/Input.d.ts.map +1 -0
- package/dist/components/Input/index.d.ts +3 -0
- package/dist/components/Input/index.d.ts.map +1 -0
- package/dist/icons/ArrowRight.d.ts +4 -0
- package/dist/icons/ArrowRight.d.ts.map +1 -0
- package/dist/icons/Check.d.ts +4 -0
- package/dist/icons/Check.d.ts.map +1 -0
- package/dist/icons/Icon.d.ts +14 -0
- package/dist/icons/Icon.d.ts.map +1 -0
- package/dist/icons/Search.d.ts +4 -0
- package/dist/icons/Search.d.ts.map +1 -0
- package/dist/icons/index.d.ts +6 -0
- package/dist/icons/index.d.ts.map +1 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +121 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.esm.css +1 -0
- package/dist/index.esm.js +124 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.js +136 -0
- package/dist/index.js.map +1 -0
- package/dist/utils/index.d.ts +35 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/package.json +70 -0
- package/src/components/Button/Button.tsx +117 -0
- package/src/components/Button/index.ts +2 -0
- package/src/components/Input/Input.tsx +145 -0
- package/src/components/Input/index.ts +2 -0
- package/src/icons/ArrowRight.tsx +9 -0
- package/src/icons/Check.tsx +8 -0
- package/src/icons/Icon.tsx +40 -0
- package/src/icons/Search.tsx +9 -0
- package/src/icons/index.ts +5 -0
- package/src/index.ts +16 -0
- package/src/styles/index.css +95 -0
- package/src/utils/index.ts +68 -0
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/* EWS Global Design System - Base Styles */
|
|
2
|
+
|
|
3
|
+
:root {
|
|
4
|
+
/* Colors */
|
|
5
|
+
--ews-primary: #2563eb;
|
|
6
|
+
--ews-primary-hover: #1d4ed8;
|
|
7
|
+
--ews-primary-light: #dbeafe;
|
|
8
|
+
--ews-secondary: #64748b;
|
|
9
|
+
--ews-secondary-hover: #475569;
|
|
10
|
+
--ews-success: #059669;
|
|
11
|
+
--ews-success-hover: #047857;
|
|
12
|
+
--ews-warning: #d97706;
|
|
13
|
+
--ews-warning-hover: #b45309;
|
|
14
|
+
--ews-error: #dc2626;
|
|
15
|
+
--ews-error-hover: #b91c1c;
|
|
16
|
+
|
|
17
|
+
/* Neutral Colors */
|
|
18
|
+
--ews-white: #ffffff;
|
|
19
|
+
--ews-gray-50: #f8fafc;
|
|
20
|
+
--ews-gray-100: #f1f5f9;
|
|
21
|
+
--ews-gray-200: #e2e8f0;
|
|
22
|
+
--ews-gray-300: #cbd5e1;
|
|
23
|
+
--ews-gray-400: #94a3b8;
|
|
24
|
+
--ews-gray-500: #64748b;
|
|
25
|
+
--ews-gray-600: #475569;
|
|
26
|
+
--ews-gray-700: #334155;
|
|
27
|
+
--ews-gray-800: #1e293b;
|
|
28
|
+
--ews-gray-900: #0f172a;
|
|
29
|
+
|
|
30
|
+
/* Spacing */
|
|
31
|
+
--ews-space-1: 0.25rem;
|
|
32
|
+
--ews-space-2: 0.5rem;
|
|
33
|
+
--ews-space-3: 0.75rem;
|
|
34
|
+
--ews-space-4: 1rem;
|
|
35
|
+
--ews-space-5: 1.25rem;
|
|
36
|
+
--ews-space-6: 1.5rem;
|
|
37
|
+
--ews-space-8: 2rem;
|
|
38
|
+
--ews-space-10: 2.5rem;
|
|
39
|
+
--ews-space-12: 3rem;
|
|
40
|
+
|
|
41
|
+
/* Border Radius */
|
|
42
|
+
--ews-radius-sm: 0.25rem;
|
|
43
|
+
--ews-radius-md: 0.375rem;
|
|
44
|
+
--ews-radius-lg: 0.5rem;
|
|
45
|
+
--ews-radius-xl: 0.75rem;
|
|
46
|
+
|
|
47
|
+
/* Typography */
|
|
48
|
+
--ews-font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto",
|
|
49
|
+
"Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
|
|
50
|
+
sans-serif;
|
|
51
|
+
--ews-font-mono: "SF Mono", "Monaco", "Inconsolata", "Roboto Mono",
|
|
52
|
+
"Oxygen Mono", "Ubuntu Monospace", "Source Code Pro", "Fira Code",
|
|
53
|
+
"Droid Sans Mono", "Courier New", monospace;
|
|
54
|
+
|
|
55
|
+
/* Font Sizes */
|
|
56
|
+
--ews-text-xs: 0.75rem;
|
|
57
|
+
--ews-text-sm: 0.875rem;
|
|
58
|
+
--ews-text-base: 1rem;
|
|
59
|
+
--ews-text-lg: 1.125rem;
|
|
60
|
+
--ews-text-xl: 1.25rem;
|
|
61
|
+
--ews-text-2xl: 1.5rem;
|
|
62
|
+
--ews-text-3xl: 1.875rem;
|
|
63
|
+
|
|
64
|
+
/* Shadows */
|
|
65
|
+
--ews-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
|
|
66
|
+
--ews-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1),
|
|
67
|
+
0 2px 4px -2px rgb(0 0 0 / 0.1);
|
|
68
|
+
--ews-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1),
|
|
69
|
+
0 4px 6px -4px rgb(0 0 0 / 0.1);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/* Reset and Base Styles */
|
|
73
|
+
* {
|
|
74
|
+
box-sizing: border-box;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
body {
|
|
78
|
+
font-family: var(--ews-font-sans);
|
|
79
|
+
line-height: 1.5;
|
|
80
|
+
color: var(--ews-gray-900);
|
|
81
|
+
background-color: var(--ews-white);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/* Utility Classes */
|
|
85
|
+
.ews-sr-only {
|
|
86
|
+
position: absolute;
|
|
87
|
+
width: 1px;
|
|
88
|
+
height: 1px;
|
|
89
|
+
padding: 0;
|
|
90
|
+
margin: -1px;
|
|
91
|
+
overflow: hidden;
|
|
92
|
+
clip: rect(0, 0, 0, 0);
|
|
93
|
+
white-space: nowrap;
|
|
94
|
+
border: 0;
|
|
95
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { clsx, type ClassValue } from "clsx";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Utility function to merge class names
|
|
5
|
+
* @param inputs - Class values to merge
|
|
6
|
+
* @returns Merged class string
|
|
7
|
+
*/
|
|
8
|
+
export function cn(...inputs: ClassValue[]) {
|
|
9
|
+
return clsx(inputs);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Utility function to format currency
|
|
14
|
+
* @param amount - Amount to format
|
|
15
|
+
* @param currency - Currency code (default: 'USD')
|
|
16
|
+
* @returns Formatted currency string
|
|
17
|
+
*/
|
|
18
|
+
export function formatCurrency(amount: number, currency = "USD"): string {
|
|
19
|
+
return new Intl.NumberFormat("en-US", {
|
|
20
|
+
style: "currency",
|
|
21
|
+
currency,
|
|
22
|
+
}).format(amount);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Utility function to format date
|
|
27
|
+
* @param date - Date to format
|
|
28
|
+
* @param options - Intl.DateTimeFormat options
|
|
29
|
+
* @returns Formatted date string
|
|
30
|
+
*/
|
|
31
|
+
export function formatDate(
|
|
32
|
+
date: Date | string | number,
|
|
33
|
+
options?: Intl.DateTimeFormatOptions
|
|
34
|
+
): string {
|
|
35
|
+
const dateObj = new Date(date);
|
|
36
|
+
return new Intl.DateTimeFormat("en-US", {
|
|
37
|
+
year: "numeric",
|
|
38
|
+
month: "long",
|
|
39
|
+
day: "numeric",
|
|
40
|
+
...options,
|
|
41
|
+
}).format(dateObj);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Utility function to debounce function calls
|
|
46
|
+
* @param func - Function to debounce
|
|
47
|
+
* @param wait - Wait time in milliseconds
|
|
48
|
+
* @returns Debounced function
|
|
49
|
+
*/
|
|
50
|
+
export function debounce<T extends (...args: any[]) => any>(
|
|
51
|
+
func: T,
|
|
52
|
+
wait: number
|
|
53
|
+
): (...args: Parameters<T>) => void {
|
|
54
|
+
let timeout: ReturnType<typeof setTimeout>;
|
|
55
|
+
return (...args: Parameters<T>) => {
|
|
56
|
+
clearTimeout(timeout);
|
|
57
|
+
timeout = setTimeout(() => func(...args), wait);
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Utility function to generate unique ID
|
|
63
|
+
* @param prefix - Optional prefix for the ID
|
|
64
|
+
* @returns Unique ID string
|
|
65
|
+
*/
|
|
66
|
+
export function generateId(prefix = "ews"): string {
|
|
67
|
+
return `${prefix}-${Math.random().toString(36).substr(2, 9)}`;
|
|
68
|
+
}
|