@ews-admin/global-design-system 1.12.0 → 1.14.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/dist/index.js CHANGED
@@ -61,6 +61,56 @@ function createEnvConfig(env, overrides) {
61
61
  };
62
62
  }
63
63
 
64
+ exports.SupportedCountry = void 0;
65
+ (function (SupportedCountry) {
66
+ SupportedCountry["SENEGAL"] = "SENEGAL";
67
+ SupportedCountry["CHAD"] = "CHAD";
68
+ })(exports.SupportedCountry || (exports.SupportedCountry = {}));
69
+ const REGIONS_BY_COUNTRY = {
70
+ [exports.SupportedCountry.SENEGAL]: [
71
+ "Dakar",
72
+ "Thiès",
73
+ "Saint-Louis",
74
+ "Louga",
75
+ "Fatick",
76
+ "Tambacounda",
77
+ "Kolda",
78
+ "Ziguinchor",
79
+ "Matam",
80
+ "Kédougou",
81
+ "Sédhiou",
82
+ "Diourbel",
83
+ ],
84
+ [exports.SupportedCountry.CHAD]: [
85
+ "N'Djamena",
86
+ "Moundou",
87
+ "Sarh",
88
+ "Abéché",
89
+ "Doba",
90
+ "Pala",
91
+ "Am Timan",
92
+ "Mongo",
93
+ "Faya-Largeau",
94
+ ],
95
+ };
96
+ /**
97
+ * Returns the list of regions for a given country.
98
+ * Matching is case-insensitive; defaults to Senegal when country is unknown.
99
+ */
100
+ function getRegionsByCountry(country) {
101
+ const key = country?.toUpperCase();
102
+ return REGIONS_BY_COUNTRY[key] ?? REGIONS_BY_COUNTRY[exports.SupportedCountry.SENEGAL];
103
+ }
104
+ /**
105
+ * Returns regions as SelectOption-compatible objects { value, label }.
106
+ */
107
+ function getRegionOptions(country) {
108
+ return getRegionsByCountry(country).map((region) => ({
109
+ value: region,
110
+ label: region,
111
+ }));
112
+ }
113
+
64
114
  /**
65
115
  * Available country codes supported by the platform
66
116
  */
@@ -33239,6 +33289,14 @@ const Modal = ({ isOpen, onClose, title, children, variant = "info", size = "md"
33239
33289
  lg: "max-w-lg",
33240
33290
  xl: "max-w-xl",
33241
33291
  "2xl": "max-w-2xl",
33292
+ "3xl": "max-w-3xl",
33293
+ "4xl": "max-w-4xl",
33294
+ "5xl": "max-w-5xl",
33295
+ "6xl": "max-w-6xl",
33296
+ "7xl": "max-w-7xl",
33297
+ "8xl": "max-w-8xl",
33298
+ "9xl": "max-w-9xl",
33299
+ "10xl": "max-w-10xl",
33242
33300
  full: "max-w-full",
33243
33301
  };
33244
33302
  return sizeMap[size] || sizeMap.md;
@@ -33654,6 +33712,11 @@ const ThemeDebugger = ({ className = "", }) => {
33654
33712
  : "bg-gray-200 text-gray-700"}`, children: "MED" })] }), jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-2 mt-4", children: [jsxRuntime.jsx("div", { className: "bg-ews-primary text-white p-2 rounded text-center", children: "Primary" }), jsxRuntime.jsx("div", { className: "bg-ews-secondary text-white p-2 rounded text-center", children: "Secondary" }), jsxRuntime.jsx("div", { className: "bg-ews-success text-white p-2 rounded text-center", children: "Success" }), jsxRuntime.jsx("div", { className: "bg-ews-warning text-white p-2 rounded text-center", children: "Warning" })] })] })] }));
33655
33713
  };
33656
33714
 
33715
+ function RegionSelect({ country = exports.SupportedCountry.SENEGAL, value, onChange, label, placeholder = "Select a region", error, isError, disabled, required, containerClassName, }) {
33716
+ const options = getRegionOptions(country);
33717
+ return (jsxRuntime.jsx(Select, { options: options, value: value, onChange: (val) => onChange?.(val), label: label, placeholder: placeholder, error: error, isError: isError, disabled: disabled, required: required, searchable: true, containerClassName: containerClassName }));
33718
+ }
33719
+
33657
33720
  const SpecialtySearchAutocomplete = ({ selectedSpecialties = [], onSpecialtiesChange, specialties: availableSpecialties, placeholder = "Search and select medical specialties...", className = "", disabled = false, maxSelections, showSelectedCount = true, title = "Medical Specialties", label = "Select Specialties", getSelectedCountText, }) => {
33658
33721
  const [filteredSpecialties, setFilteredSpecialties] = React.useState([]);
33659
33722
  const [isLoading, setIsLoading] = React.useState(false);
@@ -38293,6 +38356,7 @@ exports.Refrigerator = Refrigerator;
38293
38356
  exports.RefrigeratorIcon = Refrigerator;
38294
38357
  exports.Regex = Regex;
38295
38358
  exports.RegexIcon = Regex;
38359
+ exports.RegionSelect = RegionSelect;
38296
38360
  exports.RemoveFormatting = RemoveFormatting;
38297
38361
  exports.RemoveFormattingIcon = RemoveFormatting;
38298
38362
  exports.Repeat = Repeat;
@@ -39308,6 +39372,8 @@ exports.formatNumeric = formatNumeric;
39308
39372
  exports.formatPhoneNumberWithCountryCode = formatPhoneNumberWithCountryCode;
39309
39373
  exports.generateId = generateId;
39310
39374
  exports.getDefaultCountryCode = getDefaultCountryCode;
39375
+ exports.getRegionOptions = getRegionOptions;
39376
+ exports.getRegionsByCountry = getRegionsByCountry;
39311
39377
  exports.icons = index;
39312
39378
  exports.isValidPhoneNumber = isValidPhoneNumber;
39313
39379
  exports.useDebounce = useDebounce;