@ews-admin/global-design-system 1.13.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
  */
@@ -33662,6 +33712,11 @@ const ThemeDebugger = ({ className = "", }) => {
33662
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" })] })] })] }));
33663
33713
  };
33664
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
+
33665
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, }) => {
33666
33721
  const [filteredSpecialties, setFilteredSpecialties] = React.useState([]);
33667
33722
  const [isLoading, setIsLoading] = React.useState(false);
@@ -38301,6 +38356,7 @@ exports.Refrigerator = Refrigerator;
38301
38356
  exports.RefrigeratorIcon = Refrigerator;
38302
38357
  exports.Regex = Regex;
38303
38358
  exports.RegexIcon = Regex;
38359
+ exports.RegionSelect = RegionSelect;
38304
38360
  exports.RemoveFormatting = RemoveFormatting;
38305
38361
  exports.RemoveFormattingIcon = RemoveFormatting;
38306
38362
  exports.Repeat = Repeat;
@@ -39316,6 +39372,8 @@ exports.formatNumeric = formatNumeric;
39316
39372
  exports.formatPhoneNumberWithCountryCode = formatPhoneNumberWithCountryCode;
39317
39373
  exports.generateId = generateId;
39318
39374
  exports.getDefaultCountryCode = getDefaultCountryCode;
39375
+ exports.getRegionOptions = getRegionOptions;
39376
+ exports.getRegionsByCountry = getRegionsByCountry;
39319
39377
  exports.icons = index;
39320
39378
  exports.isValidPhoneNumber = isValidPhoneNumber;
39321
39379
  exports.useDebounce = useDebounce;