diff --git a/cypress/e2e/external_results_spec/filter.cy.ts b/cypress/e2e/external_results_spec/filter.cy.ts index 3dd18704a46..5a0a8eccab9 100644 --- a/cypress/e2e/external_results_spec/filter.cy.ts +++ b/cypress/e2e/external_results_spec/filter.cy.ts @@ -14,13 +14,10 @@ describe("External Results Filters", () => { }); it("Advance Filter", () => { + cy.clickAndSelectOption("#local_bodies", "Aluva"); cy.get("#local_bodies").click(); - cy.get("[role='option']").should("be.visible"); - cy.contains("[role='option']", "Aluva").click(); - cy.get("#local_bodies").click(); + cy.clickAndSelectOption("#wards", "4"); cy.get("#wards").click(); - cy.get("[role='option']").should("be.visible"); - cy.contains("[role='option']", "4").click(); cy.contains("Apply").click(); }); diff --git a/cypress/e2e/facility_spec/facility_creation.cy.ts b/cypress/e2e/facility_spec/facility_creation.cy.ts index 6401ba7bbbe..a092d23390e 100644 --- a/cypress/e2e/facility_spec/facility_creation.cy.ts +++ b/cypress/e2e/facility_spec/facility_creation.cy.ts @@ -132,6 +132,7 @@ describe("Facility Creation", () => { facilityFeature.forEach((featureText) => { cy.get("[role='option']").contains(featureText).click(); }); + facilityPage.clickfacilityfeatureoption(); facilityPage.fillPincode("682001"); facilityPage.selectStateOnPincode("Kerala"); facilityPage.selectDistrictOnPincode("Ernakulam"); diff --git a/cypress/e2e/patient_spec/patient_logupdate.cy.ts b/cypress/e2e/patient_spec/patient_logupdate.cy.ts index 162ebd7e620..70aa0474650 100644 --- a/cypress/e2e/patient_spec/patient_logupdate.cy.ts +++ b/cypress/e2e/patient_spec/patient_logupdate.cy.ts @@ -47,7 +47,8 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => { patientLogupdate.typePhysicalExamination(physicalExamination); patientLogupdate.selectRoundType("Telemedicine"); patientLogupdate.typeOtherDetails(otherExamination); - patientLogupdate.typeAdditionalSymptoms(additionalSymptoms); + patientLogupdate.selectSymptomsDate("01012024"); + patientLogupdate.typeAndMultiSelectSymptoms("fe", ["Fever"]); patientLogupdate.selectPatientCategory(patientCategory); patientLogupdate.typeSystolic(patientSystolic); patientLogupdate.typeDiastolic(patientDiastolic); @@ -72,7 +73,8 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => { patientLogupdate.clickLogupdate(); patientLogupdate.typePhysicalExamination(physicalExamination); patientLogupdate.typeOtherDetails(otherExamination); - patientLogupdate.typeAdditionalSymptoms(additionalSymptoms); + patientLogupdate.selectSymptomsDate("01012024"); + patientLogupdate.typeAndMultiSelectSymptoms("fe", ["Fever"]); patientLogupdate.selectPatientCategory(patientCategory); patientLogupdate.typeSystolic(patientSystolic); patientLogupdate.typeDiastolic(patientDiastolic); diff --git a/cypress/e2e/patient_spec/patient_prescription.cy.ts b/cypress/e2e/patient_spec/patient_prescription.cy.ts index c7a7cd9aba4..4a27ce14cb2 100644 --- a/cypress/e2e/patient_spec/patient_prescription.cy.ts +++ b/cypress/e2e/patient_spec/patient_prescription.cy.ts @@ -54,7 +54,7 @@ describe("Patient Medicine Administration", () => { cy.verifyAndClickElement("#0", medicineNameOne); cy.submitButton("Discontinue"); patientPrescription.enterDiscontinueReason("Medicine is been discontinued"); - cy.submitButton("Discontinue"); + cy.submitButton("Confirm Discontinue"); cy.verifyNotification("Prescription discontinued"); cy.closeNotification(); // verify the discontinue medicine view diff --git a/cypress/pageobject/Patient/PatientLogupdate.ts b/cypress/pageobject/Patient/PatientLogupdate.ts index ac1bd6a4991..ca238fe115c 100644 --- a/cypress/pageobject/Patient/PatientLogupdate.ts +++ b/cypress/pageobject/Patient/PatientLogupdate.ts @@ -28,10 +28,6 @@ class PatientLogupdate { cy.get("#other_details").click().type(details); } - typeAdditionalSymptoms(symptoms: string) { - cy.searchAndSelectOption("#additional_symptoms", symptoms); - } - typeAndMultiSelectSymptoms(input, symptoms) { cy.typeAndMultiSelectOption("#additional_symptoms", input, symptoms); } diff --git a/cypress/pageobject/Users/ManageUserPage.ts b/cypress/pageobject/Users/ManageUserPage.ts index c4214f29895..c57ecbf172f 100644 --- a/cypress/pageobject/Users/ManageUserPage.ts +++ b/cypress/pageobject/Users/ManageUserPage.ts @@ -41,7 +41,7 @@ export class ManageUserPage { } clickCloseSlideOver() { - cy.get("#close-slide-over").click(); + cy.get("#close-slide-over").click({ force: true }); } clickHomeFacilityIcon() { diff --git a/cypress/pageobject/Users/UserCreation.ts b/cypress/pageobject/Users/UserCreation.ts index 429beff2c22..7503ea3fb07 100644 --- a/cypress/pageobject/Users/UserCreation.ts +++ b/cypress/pageobject/Users/UserCreation.ts @@ -44,6 +44,9 @@ export class UserCreationPage { selectFacility(name: string) { this.typeIntoInputByName("facilities", name); this.selectOptionContainingText(name); + cy.get("input[name='facilities'] + button") + .find("#dropdown-toggle") + .click(); } selectHomeFacility(name: string) { diff --git a/cypress/support/commands.ts b/cypress/support/commands.ts index 45a3cde3245..8c1b60f3d88 100644 --- a/cypress/support/commands.ts +++ b/cypress/support/commands.ts @@ -138,7 +138,7 @@ Cypress.Commands.add( optionArray.forEach((options) => { cy.get("[role='option']").contains(options).click(); }); - cy.get(selector).click(); + cy.get(selector).find("#dropdown-toggle").click(); }); }, ); @@ -153,7 +153,7 @@ Cypress.Commands.add( optionArray.forEach((options) => { cy.get("[role='option']").contains(options).click(); }); - cy.get(selector).click(); + cy.get(selector).find("#dropdown-toggle").click(); }); }, ); diff --git a/package-lock.json b/package-lock.json index ba448d666e4..6b5d147af20 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "@fontsource/inter": "^5.0.18", "@googlemaps/react-wrapper": "^1.1.35", "@googlemaps/typescript-guards": "^2.0.3", - "@headlessui/react": "^1.7.15", + "@headlessui/react": "^2.1.2", "@pnotify/core": "^5.2.0", "@pnotify/mobile": "^5.2.0", "@sentry/browser": "^8.12.0", @@ -2798,6 +2798,59 @@ "node": ">=14" } }, + "node_modules/@floating-ui/core": { + "version": "1.6.6", + "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.6.6.tgz", + "integrity": "sha512-Vkvsw6EcpMHjvZZdMkSY+djMGFbt7CRssW99Ne8tar2WLnZ/l3dbxeTShbLQj+/s35h+Qb4cmnob+EzwtjrXGQ==", + "license": "MIT", + "dependencies": { + "@floating-ui/utils": "^0.2.6" + } + }, + "node_modules/@floating-ui/dom": { + "version": "1.6.9", + "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.6.9.tgz", + "integrity": "sha512-zB1PcI350t4tkm3rvUhSRKa9sT7vH5CrAbQxW+VaPYJXKAO0gsg4CTueL+6Ajp7XzAQC8CW4Jj1Wgqc0sB6oUQ==", + "license": "MIT", + "dependencies": { + "@floating-ui/core": "^1.6.0", + "@floating-ui/utils": "^0.2.6" + } + }, + "node_modules/@floating-ui/react": { + "version": "0.26.21", + "resolved": "https://registry.npmjs.org/@floating-ui/react/-/react-0.26.21.tgz", + "integrity": "sha512-7P5ncDIiYd6RrwpCDbKyFzvabM014QlzlumtDbK3Bck0UueC+Rp8BLS34qcGBcN1pZCTodl4QNnCVmKv4tSxfQ==", + "license": "MIT", + "dependencies": { + "@floating-ui/react-dom": "^2.1.1", + "@floating-ui/utils": "^0.2.6", + "tabbable": "^6.0.0" + }, + "peerDependencies": { + "react": ">=16.8.0", + "react-dom": ">=16.8.0" + } + }, + "node_modules/@floating-ui/react-dom": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@floating-ui/react-dom/-/react-dom-2.1.1.tgz", + "integrity": "sha512-4h84MJt3CHrtG18mGsXuLCHMrug49d7DFkU0RMIyshRveBeyV2hmV/pDaF2Uxtu8kgq5r46llp5E5FQiR0K2Yg==", + "license": "MIT", + "dependencies": { + "@floating-ui/dom": "^1.0.0" + }, + "peerDependencies": { + "react": ">=16.8.0", + "react-dom": ">=16.8.0" + } + }, + "node_modules/@floating-ui/utils": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.6.tgz", + "integrity": "sha512-0KI3zGxIUs1KDR/pjQPdJH4Z8nGBm0yJ5WRoRfdw1Kzeh45jkIfA0rmD0kBF6fKHH+xaH7g8y4jIXyAV5MGK3g==", + "license": "MIT" + }, "node_modules/@fontsource/inter": { "version": "5.0.18", "resolved": "https://registry.npmjs.org/@fontsource/inter/-/inter-5.0.18.tgz", @@ -2828,19 +2881,22 @@ "integrity": "sha512-3iHuO8H0jPehftsMK0kgyJzPYU/g/oiTRw+wu/yltqSZ7wJPt3vfsJHkPiuRpQjbnnWygX+T3mkRGyK/eyZ/lw==" }, "node_modules/@headlessui/react": { - "version": "1.7.18", - "resolved": "https://registry.npmjs.org/@headlessui/react/-/react-1.7.18.tgz", - "integrity": "sha512-4i5DOrzwN4qSgNsL4Si61VMkUcWbcSKueUV7sFhpHzQcSShdlHENE5+QBntMSRvHt8NyoFO2AGG8si9lq+w4zQ==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@headlessui/react/-/react-2.1.2.tgz", + "integrity": "sha512-Kb3hgk9gRNRcTZktBrKdHhF3xFhYkca1Rk6e1/im2ENf83dgN54orMW0uSKTXFnUpZOUFZ+wcY05LlipwgZIFQ==", + "license": "MIT", "dependencies": { - "@tanstack/react-virtual": "^3.0.0-beta.60", - "client-only": "^0.0.1" + "@floating-ui/react": "^0.26.16", + "@react-aria/focus": "^3.17.1", + "@react-aria/interactions": "^3.21.3", + "@tanstack/react-virtual": "^3.8.1" }, "engines": { "node": ">=10" }, "peerDependencies": { - "react": "^16 || ^17 || ^18", - "react-dom": "^16 || ^17 || ^18" + "react": "^18", + "react-dom": "^18" } }, "node_modules/@humanwhocodes/config-array": { @@ -3984,6 +4040,68 @@ } } }, + "node_modules/@react-aria/focus": { + "version": "3.18.1", + "resolved": "https://registry.npmjs.org/@react-aria/focus/-/focus-3.18.1.tgz", + "integrity": "sha512-N0Cy61WCIv+57mbqC7hiZAsB+3rF5n4JKabxUmg/2RTJL6lq7hJ5N4gx75ymKxkN8GnVDwt4pKZah48Wopa5jw==", + "license": "Apache-2.0", + "dependencies": { + "@react-aria/interactions": "^3.22.1", + "@react-aria/utils": "^3.25.1", + "@react-types/shared": "^3.24.1", + "@swc/helpers": "^0.5.0", + "clsx": "^2.0.0" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0" + } + }, + "node_modules/@react-aria/interactions": { + "version": "3.22.1", + "resolved": "https://registry.npmjs.org/@react-aria/interactions/-/interactions-3.22.1.tgz", + "integrity": "sha512-5TLzQaDAQQ5C70yG8GInbO4wIylKY67RfTIIwQPGR/4n5OIjbUD8BOj3NuSsuZ/frUPaBXo1VEBBmSO23fxkjw==", + "license": "Apache-2.0", + "dependencies": { + "@react-aria/ssr": "^3.9.5", + "@react-aria/utils": "^3.25.1", + "@react-types/shared": "^3.24.1", + "@swc/helpers": "^0.5.0" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0" + } + }, + "node_modules/@react-aria/ssr": { + "version": "3.9.5", + "resolved": "https://registry.npmjs.org/@react-aria/ssr/-/ssr-3.9.5.tgz", + "integrity": "sha512-xEwGKoysu+oXulibNUSkXf8itW0npHHTa6c4AyYeZIJyRoegeteYuFpZUBPtIDE8RfHdNsSmE1ssOkxRnwbkuQ==", + "license": "Apache-2.0", + "dependencies": { + "@swc/helpers": "^0.5.0" + }, + "engines": { + "node": ">= 12" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0" + } + }, + "node_modules/@react-aria/utils": { + "version": "3.25.1", + "resolved": "https://registry.npmjs.org/@react-aria/utils/-/utils-3.25.1.tgz", + "integrity": "sha512-5Uj864e7T5+yj78ZfLnfHqmypLiqW2mN+nsdslog2z5ssunTqjolVeM15ootXskjISlZ7MojLpq97kIC4nlnAw==", + "license": "Apache-2.0", + "dependencies": { + "@react-aria/ssr": "^3.9.5", + "@react-stately/utils": "^3.10.2", + "@react-types/shared": "^3.24.1", + "@swc/helpers": "^0.5.0", + "clsx": "^2.0.0" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0" + } + }, "node_modules/@react-dnd/asap": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/@react-dnd/asap/-/asap-5.0.2.tgz", @@ -3999,6 +4117,27 @@ "resolved": "https://registry.npmjs.org/@react-dnd/shallowequal/-/shallowequal-4.0.2.tgz", "integrity": "sha512-/RVXdLvJxLg4QKvMoM5WlwNR9ViO9z8B/qPcc+C0Sa/teJY7QG7kJ441DwzOjMYEY7GmU4dj5EcGHIkKZiQZCA==" }, + "node_modules/@react-stately/utils": { + "version": "3.10.2", + "resolved": "https://registry.npmjs.org/@react-stately/utils/-/utils-3.10.2.tgz", + "integrity": "sha512-fh6OTQtbeQC0ywp6LJuuKs6tKIgFvt/DlIZEcIpGho6/oZG229UnIk6TUekwxnDbumuYyan6D9EgUtEMmT8UIg==", + "license": "Apache-2.0", + "dependencies": { + "@swc/helpers": "^0.5.0" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0" + } + }, + "node_modules/@react-types/shared": { + "version": "3.24.1", + "resolved": "https://registry.npmjs.org/@react-types/shared/-/shared-3.24.1.tgz", + "integrity": "sha512-AUQeGYEm/zDTN6zLzdXolDxz3Jk5dDL7f506F07U8tBwxNNI3WRdhU84G0/AaFikOZzDXhOZDr3MhQMzyE7Ydw==", + "license": "Apache-2.0", + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0" + } + }, "node_modules/@rollup/plugin-babel": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/@rollup/plugin-babel/-/plugin-babel-5.3.1.tgz", @@ -6273,6 +6412,15 @@ "integrity": "sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ==", "dev": true }, + "node_modules/@swc/helpers": { + "version": "0.5.12", + "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.12.tgz", + "integrity": "sha512-KMZNXiGibsW9kvZAO1Pam2JPTDBm+KSHMMHWdsyI/1DbIZjT2A6Gy3hblVXUMEDvUAKq+e0vL0X0o54owWji7g==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.4.0" + } + }, "node_modules/@swc/types": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/@swc/types/-/types-0.1.6.tgz", @@ -6319,11 +6467,12 @@ } }, "node_modules/@tanstack/react-virtual": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@tanstack/react-virtual/-/react-virtual-3.2.0.tgz", - "integrity": "sha512-OEdMByf2hEfDa6XDbGlZN8qO6bTjlNKqjM3im9JG+u3mCL8jALy0T/67oDI001raUUPh1Bdmfn4ZvPOV5knpcg==", + "version": "3.8.4", + "resolved": "https://registry.npmjs.org/@tanstack/react-virtual/-/react-virtual-3.8.4.tgz", + "integrity": "sha512-Dq0VQr3QlTS2qL35g360QaJWBt7tCn/0xw4uZ0dHXPLO1Ak4Z4nVX4vuj1Npg1b/jqNMDToRtR5OIxM2NXRBWg==", + "license": "MIT", "dependencies": { - "@tanstack/virtual-core": "3.2.0" + "@tanstack/virtual-core": "3.8.4" }, "funding": { "type": "github", @@ -6335,9 +6484,10 @@ } }, "node_modules/@tanstack/virtual-core": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@tanstack/virtual-core/-/virtual-core-3.2.0.tgz", - "integrity": "sha512-P5XgYoAw/vfW65byBbJQCw+cagdXDT/qH6wmABiLt4v4YBT2q2vqCOhihe+D1Nt325F/S/0Tkv6C5z0Lv+VBQQ==", + "version": "3.8.4", + "resolved": "https://registry.npmjs.org/@tanstack/virtual-core/-/virtual-core-3.8.4.tgz", + "integrity": "sha512-iO5Ujgw3O1yIxWDe9FgUPNkGjyT657b1WNX52u+Wv1DyBFEpdCdGkuVaky0M3hHFqNWjAmHWTn4wgj9rTr7ZQg==", + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/tannerlinsley" @@ -9081,11 +9231,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/client-only": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/client-only/-/client-only-0.0.1.tgz", - "integrity": "sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==" - }, "node_modules/clone": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", @@ -21880,6 +22025,12 @@ "url": "https://opencollective.com/unts" } }, + "node_modules/tabbable": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/tabbable/-/tabbable-6.2.0.tgz", + "integrity": "sha512-Cat63mxsVJlzYvN51JmVXIgNoUokrIaT2zLclCXjRd8boZ0004U4KCs/sToJ75C6sdlByWxpYnb5Boif1VSFew==", + "license": "MIT" + }, "node_modules/tailwindcss": { "version": "3.4.3", "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.3.tgz", @@ -22411,8 +22562,7 @@ "node_modules/tslib": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", - "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", - "dev": true + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" }, "node_modules/tsutils": { "version": "3.21.0", diff --git a/package.json b/package.json index ccb91dfcbae..2890121d0e8 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "@fontsource/inter": "^5.0.18", "@googlemaps/react-wrapper": "^1.1.35", "@googlemaps/typescript-guards": "^2.0.3", - "@headlessui/react": "^1.7.15", + "@headlessui/react": "^2.1.2", "@pnotify/core": "^5.2.0", "@pnotify/mobile": "^5.2.0", "@sentry/browser": "^8.12.0", diff --git a/src/CAREUI/interactive/SlideOver.tsx b/src/CAREUI/interactive/SlideOver.tsx index 68aa5dc088f..bd38b32137a 100644 --- a/src/CAREUI/interactive/SlideOver.tsx +++ b/src/CAREUI/interactive/SlideOver.tsx @@ -1,5 +1,9 @@ -import { Dialog, Transition } from "@headlessui/react"; -import { Fragment } from "react"; +import { + Dialog, + DialogPanel, + Transition, + TransitionChild, +} from "@headlessui/react"; import { classNames } from "../../Utils/utils"; import CareIcon from "../icons/CareIcon"; @@ -58,15 +62,14 @@ export default function SlideOver({ }; return ( - + {}} > - - - + - {children} )} - - + + - + ); } diff --git a/src/Components/CameraFeed/AssetBedSelect.tsx b/src/Components/CameraFeed/AssetBedSelect.tsx index d9f37d5ed2a..b97675c7b31 100644 --- a/src/Components/CameraFeed/AssetBedSelect.tsx +++ b/src/Components/CameraFeed/AssetBedSelect.tsx @@ -1,6 +1,10 @@ -import { Fragment } from "react"; import { AssetBedModel } from "../Assets/AssetTypes"; -import { Listbox, Transition } from "@headlessui/react"; +import { + Listbox, + ListboxButton, + ListboxOption, + ListboxOptions, +} from "@headlessui/react"; import CareIcon from "../../CAREUI/icons/CareIcon"; import { classNames } from "../../Utils/utils"; import { dropdownOptionClassNames } from "../Form/MultiSelectMenuV2"; @@ -78,7 +82,7 @@ export const CameraPresetDropdown = ( disabled={options.length === 0 || props.disabled} >
- - - + - - {options?.map((obj) => ( - - classNames(dropdownOptionClassNames(args), "px-2 py-1.5") - } - value={obj} - > - {label(obj)} - - ))} - - + {options?.map((obj) => ( + + classNames(dropdownOptionClassNames(args), "px-2 py-1.5") + } + value={obj} + > + {label(obj)} + + ))} +
); diff --git a/src/Components/CameraFeed/CentralLiveMonitoring/LiveMonitoringFilters.tsx b/src/Components/CameraFeed/CentralLiveMonitoring/LiveMonitoringFilters.tsx index 83b3052ddd7..d80b8716d6e 100644 --- a/src/Components/CameraFeed/CentralLiveMonitoring/LiveMonitoringFilters.tsx +++ b/src/Components/CameraFeed/CentralLiveMonitoring/LiveMonitoringFilters.tsx @@ -1,10 +1,14 @@ -import { Popover, Transition } from "@headlessui/react"; +import { + Popover, + PopoverButton, + PopoverPanel, + Transition, +} from "@headlessui/react"; import ButtonV2 from "../../Common/components/ButtonV2"; import { FieldLabel } from "../../Form/FormFields/FormField"; import { LocationSelect } from "../../Common/LocationSelect"; import Pagination from "../../Common/Pagination"; import useFilters from "../../../Common/hooks/useFilters"; -import { Fragment } from "react"; import CareIcon from "../../../CAREUI/icons/CareIcon"; import useSlug from "../../../Common/hooks/useSlug"; import { useTranslation } from "react-i18next"; @@ -26,14 +30,13 @@ const LiveMonitoringFilters = (props: Props) => { return (
- + {t("settings_and_filters")} - + { leaveFrom="opacity-100 translate-y-0" leaveTo="opacity-0 translate-y-1" > - +
@@ -93,7 +96,7 @@ const LiveMonitoringFilters = (props: Props) => {
- + diff --git a/src/Components/CameraFeed/FeedAlert.tsx b/src/Components/CameraFeed/FeedAlert.tsx index 138af509c8c..b907ce72ad2 100644 --- a/src/Components/CameraFeed/FeedAlert.tsx +++ b/src/Components/CameraFeed/FeedAlert.tsx @@ -1,5 +1,5 @@ import { Transition } from "@headlessui/react"; -import { Fragment, useEffect, useState } from "react"; +import { useEffect, useState } from "react"; import CareIcon, { IconName } from "../../CAREUI/icons/CareIcon"; import { classNames } from "../../Utils/utils"; import { StreamStatus } from "./usePlayer"; @@ -45,7 +45,6 @@ export default function FeedAlert({ state }: Props) { return ( = ({ max, outOfLimitsErrorMessage, onChange, - position, + position = "CENTER", disabled, placeholder, isOpen, @@ -248,7 +248,7 @@ const DateInputV2: React.FC = ({ {({ open, close }) => (
- + = ({ className="text-lg text-secondary-600" />
- + {(open || isOpen) && ( - = ({ )}
- + )} )} @@ -484,8 +484,4 @@ const DateInputV2: React.FC = ({ ); }; -DateInputV2.defaultProps = { - position: "CENTER", -}; - export default DateInputV2; diff --git a/src/Components/Common/Dialog.tsx b/src/Components/Common/Dialog.tsx index 68f6d0900b9..07722daf793 100644 --- a/src/Components/Common/Dialog.tsx +++ b/src/Components/Common/Dialog.tsx @@ -1,6 +1,11 @@ -import { Dialog, Transition } from "@headlessui/react"; +import { + Dialog, + DialogPanel, + DialogTitle, + Transition, + TransitionChild, +} from "@headlessui/react"; import { classNames } from "../../Utils/utils"; -import { Fragment } from "react"; type DialogProps = { title: React.ReactNode; @@ -25,10 +30,9 @@ const DialogModal = (props: DialogProps) => { } = props; return (
- + - { leaveTo="opacity-0" >
- +
- { leaveFrom="opacity-100 scale-100" leaveTo="opacity-0 scale-95" > - - @@ -68,10 +71,10 @@ const DialogModal = (props: DialogProps) => {

{props.titleAction} - + {children} - - + +
diff --git a/src/Components/Common/GLocationPicker.tsx b/src/Components/Common/GLocationPicker.tsx index bfe95735127..5119d219e73 100644 --- a/src/Components/Common/GLocationPicker.tsx +++ b/src/Components/Common/GLocationPicker.tsx @@ -5,7 +5,7 @@ import { isLatLngLiteral } from "@googlemaps/typescript-guards"; import Spinner from "./Spinner"; import CareIcon from "../../CAREUI/icons/CareIcon"; import useConfig from "../../Common/hooks/useConfig"; -import { Popover } from "@headlessui/react"; +import { PopoverButton } from "@headlessui/react"; interface GLocationPickerProps { lat: number; @@ -213,7 +213,7 @@ const Map: React.FC = ({ placeholder="Start typing to search" /> {handleOnClose && ( - +
= ({ className="text-2xl text-secondary-800" />
-
+ )} {handleOnSelectCurrentLocation && (
{ return ( - numDays - 10 @@ -160,7 +160,7 @@ function UptimeInfoPopover({ static > - + ); } diff --git a/src/Components/Common/components/HelperComponents.tsx b/src/Components/Common/components/HelperComponents.tsx index 06a9e2d84e2..5100476284e 100644 --- a/src/Components/Common/components/HelperComponents.tsx +++ b/src/Components/Common/components/HelperComponents.tsx @@ -1,5 +1,5 @@ import { Transition, TransitionEvents } from "@headlessui/react"; -import { Fragment, ReactNode } from "react"; +import { ReactNode } from "react"; type DropdownMenuTransitionProps = { show?: boolean | undefined; @@ -13,7 +13,6 @@ export const DropdownTransition = ({ }: DropdownMenuTransitionProps) => ( - @@ -49,14 +48,13 @@ export default function DropdownMenu({ icon="l-angle-down" className={size === "small" ? "text-base" : "text-lg"} /> - - - - <>{props.children} - - + + + + <>{props.children} +
); @@ -85,7 +83,7 @@ export function DropdownItem({ const isAuthorized = useIsAuthorized(authorizeFor); return ( - +
{children}
-
+ ); } diff --git a/src/Components/Facility/CentralNursingStation.tsx b/src/Components/Facility/CentralNursingStation.tsx index 95c15fa295c..178bd2bc25c 100644 --- a/src/Components/Facility/CentralNursingStation.tsx +++ b/src/Components/Facility/CentralNursingStation.tsx @@ -1,5 +1,4 @@ import useFullscreen from "../../Common/hooks/useFullscreen"; -import { Fragment } from "react"; import HL7PatientVitalsMonitor from "../VitalsMonitor/HL7PatientVitalsMonitor"; import useFilters from "../../Common/hooks/useFilters"; import Loading from "../Common/Loading"; @@ -8,7 +7,12 @@ import ButtonV2 from "../Common/components/ButtonV2"; import CareIcon from "../../CAREUI/icons/CareIcon"; import { LocationSelect } from "../Common/LocationSelect"; import Pagination from "../Common/Pagination"; -import { Popover, Transition } from "@headlessui/react"; +import { + Popover, + PopoverButton, + PopoverPanel, + Transition, +} from "@headlessui/react"; import { FieldLabel } from "../Form/FormFields/FormField"; import CheckBoxFormField from "../Form/FormFields/CheckBoxFormField"; import { useTranslation } from "react-i18next"; @@ -79,7 +83,7 @@ export default function CentralNursingStation({ facilityId }: Props) { options={
- + {t("settings_and_filters")} - + - +
@@ -184,7 +187,7 @@ export default function CentralNursingStation({ facilityId }: Props) {
- + diff --git a/src/Components/Facility/Consultations/BedActivityTimeline.tsx b/src/Components/Facility/Consultations/BedActivityTimeline.tsx index c660296918a..3b19b12329a 100644 --- a/src/Components/Facility/Consultations/BedActivityTimeline.tsx +++ b/src/Components/Facility/Consultations/BedActivityTimeline.tsx @@ -8,8 +8,12 @@ import CareIcon from "../../../CAREUI/icons/CareIcon"; import { classNames, formatDateTime, relativeTime } from "../../../Utils/utils"; import { AssetData } from "../../Assets/AssetTypes"; import { CurrentBed } from "../models"; -import { Popover, Transition } from "@headlessui/react"; -import { Fragment } from "react"; +import { + Popover, + PopoverButton, + PopoverPanel, + Transition, +} from "@headlessui/react"; interface AssetDiff { newlyLinkedAssets: AssetData[]; @@ -234,14 +238,13 @@ const BedActivityIButtonPopover = ({ }) => { return ( - + - + - +

updated {relativeTime(bed?.start_date)}

-
+
); diff --git a/src/Components/Facility/Consultations/DailyRoundsFilter.tsx b/src/Components/Facility/Consultations/DailyRoundsFilter.tsx index be643845d8b..ee8dae6bb73 100644 --- a/src/Components/Facility/Consultations/DailyRoundsFilter.tsx +++ b/src/Components/Facility/Consultations/DailyRoundsFilter.tsx @@ -1,6 +1,10 @@ -import { Popover, Transition } from "@headlessui/react"; +import { + Popover, + PopoverButton, + PopoverPanel, + Transition, +} from "@headlessui/react"; import ButtonV2 from "../../Common/components/ButtonV2"; -import { Fragment } from "react"; import { SelectFormField } from "../../Form/FormFields/SelectFormField"; import TextFormField from "../../Form/FormFields/TextFormField"; import CareIcon from "../../../CAREUI/icons/CareIcon"; @@ -40,7 +44,7 @@ export default function DailyRoundsFilter(props: Props) { return (
- + {t("filter")} - + - +
@@ -89,7 +92,7 @@ export default function DailyRoundsFilter(props: Props) { max={dayjs().format("YYYY-MM-DDTHH:mm")} /> - + { @@ -101,8 +104,8 @@ export default function DailyRoundsFilter(props: Props) { > {t("clear")} - - + + props.onApply(filter)} @@ -111,10 +114,10 @@ export default function DailyRoundsFilter(props: Props) { > {t("apply")} - +
- +
diff --git a/src/Components/Facility/FacilityCreate.tsx b/src/Components/Facility/FacilityCreate.tsx index 145bd756de2..337be5703cc 100644 --- a/src/Components/Facility/FacilityCreate.tsx +++ b/src/Components/Facility/FacilityCreate.tsx @@ -17,8 +17,13 @@ import { MultiSelectFormField, SelectFormField, } from "../Form/FormFields/SelectFormField"; -import { Popover, Transition } from "@headlessui/react"; -import { Fragment, lazy, useEffect, useState } from "react"; +import { + Popover, + PopoverButton, + PopoverPanel, + Transition, +} from "@headlessui/react"; +import { lazy, useEffect, useState } from "react"; import Steps, { Step } from "../Common/Steps"; import { getPincodeDetails, @@ -939,7 +944,7 @@ export const FacilityCreate = (props: FacilityProps) => {
<> - + { Select location from map - + { leaveFrom="opacity-100 translate-y-0" leaveTo="opacity-0 translate-y-1" > - + { handleSelectCurrentLocation } /> - + diff --git a/src/Components/Facility/FacilityHome.tsx b/src/Components/Facility/FacilityHome.tsx index e659f660981..1b362d9e4f0 100644 --- a/src/Components/Facility/FacilityHome.tsx +++ b/src/Components/Facility/FacilityHome.tsx @@ -4,7 +4,7 @@ import { NonReadOnlyUsers } from "../../Utils/AuthorizeFor"; import { FacilityModel } from "./models"; import { FACILITY_FEATURE_TYPES, USER_TYPES } from "../../Common/constants"; import DropdownMenu, { DropdownItem } from "../Common/components/Menu"; -import { Fragment, lazy, useState } from "react"; +import { lazy, useState } from "react"; import ButtonV2 from "../Common/components/ButtonV2"; import CareIcon from "../../CAREUI/icons/CareIcon"; @@ -27,7 +27,12 @@ import useQuery from "../../Utils/request/useQuery.js"; import { FacilityHomeTriage } from "./FacilityHomeTriage.js"; import { FacilityBedCapacity } from "./FacilityBedCapacity.js"; import useSlug from "../../Common/hooks/useSlug.js"; -import { Popover, Transition } from "@headlessui/react"; +import { + Popover, + PopoverButton, + PopoverPanel, + Transition, +} from "@headlessui/react"; import { FieldLabel } from "../Form/FormFields/FormField.js"; import { LocationSelect } from "../Common/LocationSelect.js"; import { CameraFeedPermittedUserTypes } from "../../Utils/permissions.js"; @@ -500,7 +505,7 @@ const LiveMonitoringButton = () => { return ( - + { Live Monitoring - + { leaveFrom="opacity-100 translate-y-0" leaveTo="opacity-0 translate-y-1" > - +
@@ -553,7 +557,7 @@ const LiveMonitoringButton = () => {
- + ); diff --git a/src/Components/Form/AutoCompleteAsync.tsx b/src/Components/Form/AutoCompleteAsync.tsx index 4fd9346065d..9b4c1f876e4 100644 --- a/src/Components/Form/AutoCompleteAsync.tsx +++ b/src/Components/Form/AutoCompleteAsync.tsx @@ -1,5 +1,11 @@ import { useEffect, useState, useMemo } from "react"; -import { Combobox } from "@headlessui/react"; +import { + Combobox, + ComboboxButton, + ComboboxInput, + ComboboxOption, + ComboboxOptions, +} from "@headlessui/react"; import { debounce } from "lodash-es"; import { DropdownTransition } from "../Common/components/HelperComponents"; import CareIcon from "../../CAREUI/icons/CareIcon"; @@ -89,7 +95,7 @@ const AutoCompleteAsync = (props: Props) => { >
- { autoComplete="off" /> {!disabled && ( - +
{hasSelection && !loading && !required && (
@@ -135,14 +141,21 @@ const AutoCompleteAsync = (props: Props) => { className="-mb-1.5 animate-spin" /> ) : ( - + )}
- + )}
- + {data?.length === 0 ? (
{query !== "" @@ -151,7 +164,8 @@ const AutoCompleteAsync = (props: Props) => {
) : ( data?.map((item: any) => ( - { )}
)} - + )) )} - + {multiple && selected?.length > 0 && (
diff --git a/src/Components/Form/FormFields/Autocomplete.tsx b/src/Components/Form/FormFields/Autocomplete.tsx index ab7c48b3428..7802a296201 100644 --- a/src/Components/Form/FormFields/Autocomplete.tsx +++ b/src/Components/Form/FormFields/Autocomplete.tsx @@ -1,5 +1,11 @@ import { useEffect, useState } from "react"; -import { Combobox } from "@headlessui/react"; +import { + Combobox, + ComboboxButton, + ComboboxInput, + ComboboxOption, + ComboboxOptions, +} from "@headlessui/react"; import { DropdownTransition } from "../../Common/components/HelperComponents"; import CareIcon from "../../../CAREUI/icons/CareIcon"; import { dropdownOptionClassNames } from "../MultiSelectMenuV2"; @@ -157,12 +163,12 @@ export const Autocomplete = (props: AutocompleteProps) => { > props.onChange(selection.value)} >
- value?.label || ""} @@ -171,7 +177,7 @@ export const Autocomplete = (props: AutocompleteProps) => { autoComplete="off" /> {!props.disabled && ( - +
{value?.icon} @@ -194,15 +200,18 @@ export const Autocomplete = (props: AutocompleteProps) => { {props.isLoading ? ( ) : ( - + )}
-
+ )}
- + {props.minQueryLength && query.length < props.minQueryLength ? (
{`Please enter at least ${props.minQueryLength} characters to search`} @@ -213,14 +222,15 @@ export const Autocomplete = (props: AutocompleteProps) => {
) : ( filteredOptions.map((option, index) => ( - - {({ active }) => ( + {({ focus }) => (
{option.label} @@ -232,7 +242,7 @@ export const Autocomplete = (props: AutocompleteProps) => { "text-sm font-normal", option.disabled ? "text-secondary-700" - : active + : focus ? "text-primary-200" : "text-secondary-700", )} @@ -242,10 +252,10 @@ export const Autocomplete = (props: AutocompleteProps) => { )}
)} - + )) )} - +
diff --git a/src/Components/Form/FormFields/AutocompleteMultiselect.tsx b/src/Components/Form/FormFields/AutocompleteMultiselect.tsx index b4746b7e70c..7fea2d4c6e7 100644 --- a/src/Components/Form/FormFields/AutocompleteMultiselect.tsx +++ b/src/Components/Form/FormFields/AutocompleteMultiselect.tsx @@ -5,7 +5,13 @@ import { } from "../MultiSelectMenuV2"; import { ReactNode, useEffect, useRef, useState } from "react"; import CareIcon from "../../../CAREUI/icons/CareIcon"; -import { Combobox } from "@headlessui/react"; +import { + Combobox, + ComboboxButton, + ComboboxInput, + ComboboxOption, + ComboboxOptions, +} from "@headlessui/react"; import { DropdownTransition } from "../../Common/components/HelperComponents"; import FormField from "./FormField"; import { classNames } from "../../../Utils/utils"; @@ -116,7 +122,7 @@ export const AutocompleteMutliSelect = ( >
- ( autoComplete="off" /> {!props.disabled && ( - @@ -139,10 +145,14 @@ export const AutocompleteMutliSelect = ( {props.isLoading ? ( ) : ( - + )}
- + )}
{value.length !== 0 && ( @@ -161,13 +171,17 @@ export const AutocompleteMutliSelect = ( )} - + {props.isLoading ? ( ) : filteredOptions.length ? ( <> {props.selectAll && ( - ( )}
- + )} {filteredOptions.map((option, index) => ( - ( }} disabled={option.disabled} > - {({ active, selected }) => ( + {({ focus, selected }) => ( <>
{option.label} @@ -206,7 +221,7 @@ export const AutocompleteMutliSelect = ( "text-sm font-normal", option.disabled ? "text-secondary-700" - : active + : focus ? "text-primary-200" : "text-secondary-700", )} @@ -216,7 +231,7 @@ export const AutocompleteMutliSelect = ( )} )} - + ))} ) : ( @@ -225,7 +240,7 @@ export const AutocompleteMutliSelect = ( {query ? "No results" : "Type to search"} )} - +
diff --git a/src/Components/Form/FormFields/PhoneNumberFormField.tsx b/src/Components/Form/FormFields/PhoneNumberFormField.tsx index 6038478f1c5..c46d2690ad3 100644 --- a/src/Components/Form/FormFields/PhoneNumberFormField.tsx +++ b/src/Components/Form/FormFields/PhoneNumberFormField.tsx @@ -16,7 +16,7 @@ import { PhoneNumberType, } from "../FieldValidators"; import CareIcon from "../../../CAREUI/icons/CareIcon"; -import { Popover } from "@headlessui/react"; +import { Popover, PopoverButton, PopoverPanel } from "@headlessui/react"; import { useTranslation } from "react-i18next"; const phoneCodes: Record = phoneCodesJson; @@ -111,7 +111,7 @@ export default function PhoneNumberFormField(props: Props) { {({ open }: { open: boolean }) => { return ( <> - +
{country?.flag ?? "🇮🇳"} @@ -121,7 +121,7 @@ export default function PhoneNumberFormField(props: Props) { className={`text-2xl font-bold ${open && "rotate-180"}`} />
-
+ setError(validate(field.value, "blur"))} /> - + {({ close }) => ( )} - + ); }} diff --git a/src/Components/Form/MultiSelectMenuV2.tsx b/src/Components/Form/MultiSelectMenuV2.tsx index 9ab2f4d55c7..e728260e142 100644 --- a/src/Components/Form/MultiSelectMenuV2.tsx +++ b/src/Components/Form/MultiSelectMenuV2.tsx @@ -1,6 +1,11 @@ import CareIcon from "../../CAREUI/icons/CareIcon"; -import { DropdownTransition } from "../Common/components/HelperComponents"; -import { Listbox } from "@headlessui/react"; +import { + Label, + Listbox, + ListboxButton, + ListboxOption, + ListboxOptions, +} from "@headlessui/react"; import { classNames } from "../../Utils/utils"; import { ReactNode, useRef } from "react"; @@ -87,95 +92,94 @@ const MultiSelectMenuV2 = (props: Props) => { } multiple > - {({ open }) => ( - <> - - {props.placeholder} - -
-
- + +
+
+ +
+
+

+ +

+ + {selectedOptions.length !== 0 && ( +
+ {selectedOptions.map((option, index) => ( + { + const updatedOptions = selectedOptions.filter( + (selectedOption) => + selectedOption.value !== option.value, + ); + props.onChange( + updatedOptions.map((o) => o.value) as any, + ); + }} + /> + ))} +
+ )} +
+ +
+
+
+ + {options.map((option, index) => ( + handleSingleSelect(option)} + disabled={option.disabled} > -
-
-

- -

- - {selectedOptions.length !== 0 && ( -
- {selectedOptions.map((option, index) => ( - { - const updatedOptions = selectedOptions.filter( - (selectedOption) => - selectedOption.value !== option.value, - ); - props.onChange( - updatedOptions.map((o) => o.value) as any, - ); - }} - /> + {({ focus }) => ( +
+
+ {option.label} + {(option.icon || option.isSelected) && + (option.isSelected ? ( + + ) : ( + option.icon ))} -
- )} -
- -
- -
- - - {options.map((option, index) => ( - handleSingleSelect(option)} - disabled={option.disabled} - > - {({ active }) => ( -
-
- {option.label} - {(option.icon || option.isSelected) && - (option.isSelected ? ( - - ) : ( - option.icon - ))} -
- {option.description && ( -

- {option.description} -

+
+ {option.description && ( +

+ > + {option.description} +

)} -
- ))} -
-
-
- - )} +
+ )} + + ))} + +
+
); @@ -211,21 +215,21 @@ export const MultiSelectOptionChip = ({ }; interface OptionRenderPropArg { - active: boolean; + focus: boolean; selected: boolean; disabled: boolean; } export const dropdownOptionClassNames = ({ - active, + focus, selected, disabled, }: OptionRenderPropArg) => { return classNames( "group/option relative w-full cursor-default select-none p-4 text-sm transition-colors duration-75 ease-in-out", - !disabled && active && "bg-primary-500 text-white", - !disabled && !active && selected && "text-primary-500", - !disabled && !active && !selected && "text-secondary-900", + !disabled && focus && "bg-primary-500 text-white", + !disabled && !focus && selected && "text-primary-500", + !disabled && !focus && !selected && "text-secondary-900", disabled && "cursor-not-allowed text-secondary-600", selected ? "font-semibold" : "font-normal", ); diff --git a/src/Components/Form/SelectMenuV2.tsx b/src/Components/Form/SelectMenuV2.tsx index cc09b7f619d..379eb7b7315 100644 --- a/src/Components/Form/SelectMenuV2.tsx +++ b/src/Components/Form/SelectMenuV2.tsx @@ -1,5 +1,10 @@ -import { Listbox } from "@headlessui/react"; -import { DropdownTransition } from "../Common/components/HelperComponents"; +import { + Label, + Listbox, + ListboxButton, + ListboxOption, + ListboxOptions, +} from "@headlessui/react"; import CareIcon from "../../CAREUI/icons/CareIcon"; import { dropdownOptionClassNames } from "./MultiSelectMenuV2"; import { classNames } from "../../Utils/utils"; @@ -88,93 +93,86 @@ const SelectMenuV2 = (props: SelectMenuProps) => { value={value} onChange={(selection: any) => props.onChange(selection.value)} > - {({ open }) => ( - <> - - {props.placeholder} - -
- -
-
- {props.showIconWhenSelected && value?.icon && ( -
- {value.icon} -
- )} -

- {value.selectedLabel} -

-
- {showChevronIcon && ( - + <> + +
+ +
+
+ {props.showIconWhenSelected && value?.icon && ( +
+ {value.icon} +
)} +

+ {value.selectedLabel} +

- - - - )} +
+
); diff --git a/src/Components/Medicine/DiscontinuePrescription.tsx b/src/Components/Medicine/DiscontinuePrescription.tsx index f54ba9974fc..1d2cc5baa94 100644 --- a/src/Components/Medicine/DiscontinuePrescription.tsx +++ b/src/Components/Medicine/DiscontinuePrescription.tsx @@ -22,7 +22,7 @@ export default function DiscontinuePrescription(props: Props) { return ( props.onClose(false)} diff --git a/src/Components/Patient/PatientInfoCard.tsx b/src/Components/Patient/PatientInfoCard.tsx index a507a42f627..005c93521d6 100644 --- a/src/Components/Patient/PatientInfoCard.tsx +++ b/src/Components/Patient/PatientInfoCard.tsx @@ -8,7 +8,7 @@ import { TELEMEDICINE_ACTIONS, } from "../../Common/constants.js"; import { ConsultationModel, PatientCategory } from "../Facility/models.js"; -import { Switch, Menu } from "@headlessui/react"; +import { Switch, MenuItem, Field, Label } from "@headlessui/react"; import { Link, navigate } from "raviger"; import { useState } from "react"; import CareIcon from "../../CAREUI/icons/CareIcon.js"; @@ -738,7 +738,7 @@ export default function PatientInfoCard(props: { {enable_abdm && (patient.abha_number ? ( <> - + {({ close }) => ( <>
)} - + ) : ( - + {({ close }) => (
)} -
+ ))}
{!consultation?.discharge_date && ( - + {({ close }) => ( <> {hasActiveShiftingRequest() ? ( @@ -869,9 +869,9 @@ export default function PatientInfoCard(props: { )} )} - + )} - + {({ close }) => (
)} -
- + + {({ close }) => (
)} -
+
- + { @@ -945,12 +945,12 @@ export default function PatientInfoCard(props: { )} /> - + - + +
diff --git a/src/Components/Scribe/Scribe.tsx b/src/Components/Scribe/Scribe.tsx index f1298bc33c5..c942d130a43 100644 --- a/src/Components/Scribe/Scribe.tsx +++ b/src/Components/Scribe/Scribe.tsx @@ -1,5 +1,5 @@ import React, { useState, useEffect, useRef } from "react"; -import { Popover } from "@headlessui/react"; +import { Popover, PopoverButton, PopoverPanel } from "@headlessui/react"; import ButtonV2 from "../Common/components/ButtonV2"; import CareIcon from "../../CAREUI/icons/CareIcon"; import routes from "../../Redux/api"; @@ -550,7 +550,7 @@ export const Scribe: React.FC = ({ form, onFormUpdate }) => { return ( - + setOpen(!open)} className="rounded py-2 font-bold" @@ -558,9 +558,9 @@ export const Scribe: React.FC = ({ form, onFormUpdate }) => { Voice AutoFill - + {open && ( - +
- + )} ); diff --git a/src/Components/VitalsMonitor/VitalsMonitorAssetPopover.tsx b/src/Components/VitalsMonitor/VitalsMonitorAssetPopover.tsx index c57daf8f324..7ee5bf6c898 100644 --- a/src/Components/VitalsMonitor/VitalsMonitorAssetPopover.tsx +++ b/src/Components/VitalsMonitor/VitalsMonitorAssetPopover.tsx @@ -3,8 +3,12 @@ import { AssetData, assetClassProps } from "../Assets/AssetTypes"; import ButtonV2 from "../Common/components/ButtonV2"; import { navigate } from "raviger"; import { useTranslation } from "react-i18next"; -import { Popover, Transition } from "@headlessui/react"; -import { Fragment } from "react"; +import { + Popover, + PopoverButton, + PopoverPanel, + Transition, +} from "@headlessui/react"; interface VitalsMonitorAssetPopoverProps { asset?: AssetData; @@ -17,14 +21,13 @@ const VitalsMonitorAssetPopover = ({ return ( - + - + - +
- + ); diff --git a/src/Locale/en/Medicine.json b/src/Locale/en/Medicine.json index a04c5caa77a..3e861f2e486 100644 --- a/src/Locale/en/Medicine.json +++ b/src/Locale/en/Medicine.json @@ -39,6 +39,7 @@ "prescription_logs": "Prescription Logs", "modification_caution_note": "No modifications possible once added", "discontinue_caution_note": "Are you sure you want to discontinue this prescription?", + "confirm_discontinue": "Confirm Discontinue", "edit_caution_note": "A new prescription will be added to the consultation with the edited details and the current prescription will be discontinued.", "reason_for_discontinuation": "Reason for discontinuation", "reason_for_edit": "Reason for edit",