@ews-admin/global-design-system 1.18.0 → 1.21.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ews-admin/global-design-system",
3
- "version": "1.18.0",
3
+ "version": "1.21.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",
@@ -0,0 +1,77 @@
1
+ import React from "react";
2
+ import { AlertTriangle, X } from "lucide-react";
3
+
4
+ /**
5
+ * The banner is purely presentational: the caller decides when to render it
6
+ * (e.g. due date within 7 days or overdue) and provides already-translated
7
+ * labels.
8
+ */
9
+ export interface PaymentDueBannerProps {
10
+ title: string;
11
+ subtitle?: string;
12
+ /** Extra warning line shown under the subtitle (e.g. discount loss). */
13
+ warning?: string;
14
+ ctaLabel: string;
15
+ onCtaClick: () => void;
16
+ /** When omitted, the dismiss button is not rendered. */
17
+ onDismiss?: () => void;
18
+ dismissLabel?: string;
19
+ }
20
+
21
+ /**
22
+ * Full-width payment reminder banner (red gradient) used above the app
23
+ * content when a licence payment is due soon or overdue.
24
+ */
25
+ const PaymentDueBanner: React.FC<PaymentDueBannerProps> = ({
26
+ title,
27
+ subtitle,
28
+ warning,
29
+ ctaLabel,
30
+ onCtaClick,
31
+ onDismiss,
32
+ dismissLabel = "Close",
33
+ }) => (
34
+ <div
35
+ data-testid="payment-banner"
36
+ className="overflow-hidden bg-gradient-to-r from-red-600 to-red-700 shadow-lg"
37
+ >
38
+ <div className="px-6 py-8 sm:px-8">
39
+ <div className="flex flex-col space-y-6 sm:flex-row sm:items-center sm:justify-between sm:space-y-0">
40
+ {/* Left: icon + text */}
41
+ <div className="flex items-center space-x-4">
42
+ <AlertTriangle className="w-8 h-8 text-white shrink-0" />
43
+ <div className="flex-1 min-w-0">
44
+ <h3 className="text-2xl font-bold text-white">{title}</h3>
45
+ {subtitle && (
46
+ <p className="mt-2 text-base text-red-100">{subtitle}</p>
47
+ )}
48
+ {warning && (
49
+ <p className="mt-1 text-sm font-medium text-red-200">{warning}</p>
50
+ )}
51
+ </div>
52
+ </div>
53
+
54
+ {/* Right: actions */}
55
+ <div className="flex flex-col flex-shrink-0 gap-3 sm:flex-row sm:gap-4 sm:items-center">
56
+ <button
57
+ onClick={onCtaClick}
58
+ className="w-full px-8 py-3 text-base font-semibold text-red-600 bg-white rounded-lg shadow-sm transition-all duration-200 sm:w-auto hover:bg-red-50 hover:shadow-md"
59
+ >
60
+ {ctaLabel}
61
+ </button>
62
+ {onDismiss && (
63
+ <button
64
+ onClick={onDismiss}
65
+ className="self-start p-2 rounded-full transition-colors bg-white/10 hover:bg-white/20 sm:self-auto"
66
+ aria-label={dismissLabel}
67
+ >
68
+ <X className="w-5 h-5 text-white" />
69
+ </button>
70
+ )}
71
+ </div>
72
+ </div>
73
+ </div>
74
+ </div>
75
+ );
76
+
77
+ export { PaymentDueBanner };
@@ -0,0 +1,2 @@
1
+ export { PaymentDueBanner } from "./PaymentDueBanner";
2
+ export type { PaymentDueBannerProps } from "./PaymentDueBanner";
package/src/index.ts CHANGED
@@ -49,6 +49,9 @@ export type { TagProps } from "./components/Tag";
49
49
  export { TagList } from "./components/TagList";
50
50
  export type { TagListProps } from "./components/TagList";
51
51
 
52
+ export { PaymentDueBanner } from "./components/PaymentDueBanner";
53
+ export type { PaymentDueBannerProps } from "./components/PaymentDueBanner";
54
+
52
55
  // Molecules
53
56
  export { SpecialtySearchAutocomplete } from "./molecules";
54
57
  export type { Specialty, SpecialtySearchAutocompleteProps } from "./molecules";
@@ -49,7 +49,7 @@ function buildUrls(environment: Environment): Omit<EnvConfig, "env"> {
49
49
  return {
50
50
  bffUrl: `https://${prefix}api.${domain}/bff/api/v1`,
51
51
  loginBffUrl: `https://${prefix}api.${domain}/login-bff/api/v1`,
52
- appUrl: `https://${prefix}app.${domain}`,
52
+ appUrl: environment === "prod" ? `https://${prefix}${domain}` : `https://${prefix}app.${domain}`,
53
53
  loginUrl: `https://${prefix}login.${domain}`,
54
54
  dashboardUrl: `https://${prefix}dashboard.${domain}`,
55
55
  adminUrl: `https://${prefix}admin.${domain}`,