@ews-admin/global-design-system 1.11.0 → 1.13.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.
@@ -20,13 +20,10 @@ export declare function cn(...inputs: ClassValue[]): string;
20
20
  * @returns Formatted currency string
21
21
  */
22
22
  export declare function formatCurrency(amount: number, currency?: string): string;
23
- /**
24
- * Utility function to format date
25
- * @param date - Date to format
26
- * @param options - Intl.DateTimeFormat options
27
- * @returns Formatted date string
28
- */
29
- export declare function formatDate(date: Date | string | number, options?: Intl.DateTimeFormatOptions): string;
23
+ export interface FormatDateOptions extends Intl.DateTimeFormatOptions {
24
+ locale?: string | string[];
25
+ }
26
+ export declare function formatDate(date: Date | string | number, options?: FormatDateOptions): string;
30
27
  /**
31
28
  * Utility function to debounce function calls
32
29
  * @param func - Function to debounce
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,UAAU,EAAE,MAAM,MAAM,CAAC;AAE7C,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EACL,aAAa,EACb,iCAAiC,EACjC,gCAAgC,EAChC,qBAAqB,GACtB,MAAM,SAAS,CAAC;AACjB,YAAY,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AACzE,YAAY,EACV,SAAS,EACT,kBAAkB,EAClB,WAAW,GACZ,MAAM,cAAc,CAAC;AAEtB;;GAEG;AACH,eAAO,MAAM,QAAQ,QAAQ,CAAC;AAE9B;;;;GAIG;AACH,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,UAEzC;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,SAAW,GAAG,MAAM,CAK1E;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CACxB,IAAI,EAAE,IAAI,GA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3
+ "version": "1.13.0",
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",
@@ -71,7 +71,7 @@
71
71
  "build-storybook": "storybook build",
72
72
  "test": "jest",
73
73
  "lint": "eslint src --ext .ts,.tsx",
74
- "type-check": "tsc --noEmit",
74
+ "typecheck": "tsc --noEmit",
75
75
  "publish:patch": "pnpm version patch && pnpm publish --access public",
76
76
  "publish:minor": "pnpm version minor && pnpm publish --access public",
77
77
  "publish:major": "pnpm version major && pnpm publish --access public",
@@ -39,7 +39,21 @@ export interface ModalProps {
39
39
  /**
40
40
  * Modal size/width
41
41
  */
42
- size?: "sm" | "md" | "lg" | "xl" | "2xl" | "full";
42
+ size?:
43
+ | "sm"
44
+ | "md"
45
+ | "lg"
46
+ | "xl"
47
+ | "2xl"
48
+ | "3xl"
49
+ | "4xl"
50
+ | "5xl"
51
+ | "6xl"
52
+ | "7xl"
53
+ | "8xl"
54
+ | "9xl"
55
+ | "10xl"
56
+ | "full";
43
57
  /**
44
58
  * Primary action button text
45
59
  */
@@ -159,6 +173,14 @@ const Modal = ({
159
173
  lg: "max-w-lg",
160
174
  xl: "max-w-xl",
161
175
  "2xl": "max-w-2xl",
176
+ "3xl": "max-w-3xl",
177
+ "4xl": "max-w-4xl",
178
+ "5xl": "max-w-5xl",
179
+ "6xl": "max-w-6xl",
180
+ "7xl": "max-w-7xl",
181
+ "8xl": "max-w-8xl",
182
+ "9xl": "max-w-9xl",
183
+ "10xl": "max-w-10xl",
162
184
  full: "max-w-full",
163
185
  };
164
186
  return sizeMap[size] || sizeMap.md;
@@ -185,7 +207,7 @@ const Modal = ({
185
207
  "duration-200 animate-in fade-in-0 zoom-in-95",
186
208
  getSizeClasses(),
187
209
  "mx-4",
188
- className
210
+ className,
189
211
  )}
190
212
  role="dialog"
191
213
  aria-modal="true"
@@ -195,7 +217,7 @@ const Modal = ({
195
217
  <div
196
218
  className={cn(
197
219
  "flex items-center justify-between p-6 border-b",
198
- variantStyles.borderColor
220
+ variantStyles.borderColor,
199
221
  )}
200
222
  >
201
223
  <div className="flex items-center space-x-3">
package/src/index.ts CHANGED
@@ -53,6 +53,7 @@ export {
53
53
  extractCountryCodeFromPhoneNumber,
54
54
  formatCurrency,
55
55
  formatDate,
56
+ type FormatDateOptions,
56
57
  formatNumeric,
57
58
  formatPhoneNumberWithCountryCode,
58
59
  generateId,
@@ -41,22 +41,21 @@ export function formatCurrency(amount: number, currency = CURRENCY): string {
41
41
  }).format(amount);
42
42
  }
43
43
 
44
- /**
45
- * Utility function to format date
46
- * @param date - Date to format
47
- * @param options - Intl.DateTimeFormat options
48
- * @returns Formatted date string
49
- */
44
+ export interface FormatDateOptions extends Intl.DateTimeFormatOptions {
45
+ locale?: string | string[];
46
+ }
47
+
50
48
  export function formatDate(
51
49
  date: Date | string | number,
52
- options?: Intl.DateTimeFormatOptions
50
+ options?: FormatDateOptions
53
51
  ): string {
52
+ const { locale = "en-US", ...intlOptions } = options ?? {};
54
53
  const dateObj = new Date(date);
55
- return new Intl.DateTimeFormat("en-US", {
54
+ return new Intl.DateTimeFormat(locale, {
56
55
  year: "numeric",
57
56
  month: "long",
58
57
  day: "numeric",
59
- ...options,
58
+ ...intlOptions,
60
59
  }).format(dateObj);
61
60
  }
62
61