From c2a0c48a389ca7af64fc0e501ee559ce74ffa4f9 Mon Sep 17 00:00:00 2001 From: Mike Dial Date: Fri, 28 Jun 2024 13:54:58 -0400 Subject: [PATCH 1/5] fix(appk zz state): zz for appk --- src/services/ui/src/features/submission/app-k/consts.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/services/ui/src/features/submission/app-k/consts.ts b/src/services/ui/src/features/submission/app-k/consts.ts index eda8381dd..371b4672d 100644 --- a/src/services/ui/src/features/submission/app-k/consts.ts +++ b/src/services/ui/src/features/submission/app-k/consts.ts @@ -58,6 +58,7 @@ export const OPTIONS_STATE = [ { label: "West Virginia", value: "WV" }, { label: "Wisconsin", value: "WI" }, { label: "Wyoming", value: "WY" }, + { label: "ZZ Test Date", value: "ZZ" }, ]; export const FORM = z.object({ From be044feee4c247b3a32ff44b231067e6c3e7311f Mon Sep 17 00:00:00 2001 From: Mike Dial Date: Fri, 28 Jun 2024 14:00:04 -0400 Subject: [PATCH 2/5] fix(update zz name): Date to Data --- src/services/ui/src/features/submission/app-k/consts.ts | 2 +- src/services/ui/src/hooks/useLabelMappings.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/services/ui/src/features/submission/app-k/consts.ts b/src/services/ui/src/features/submission/app-k/consts.ts index 371b4672d..c18851edd 100644 --- a/src/services/ui/src/features/submission/app-k/consts.ts +++ b/src/services/ui/src/features/submission/app-k/consts.ts @@ -58,7 +58,7 @@ export const OPTIONS_STATE = [ { label: "West Virginia", value: "WV" }, { label: "Wisconsin", value: "WI" }, { label: "Wyoming", value: "WY" }, - { label: "ZZ Test Date", value: "ZZ" }, + { label: "ZZ Test Data", value: "ZZ" }, ]; export const FORM = z.object({ diff --git a/src/services/ui/src/hooks/useLabelMappings.ts b/src/services/ui/src/hooks/useLabelMappings.ts index d7e2a3b79..5ba128c27 100644 --- a/src/services/ui/src/hooks/useLabelMappings.ts +++ b/src/services/ui/src/hooks/useLabelMappings.ts @@ -64,7 +64,7 @@ export const STATES = { KS: "Kansas, KS", MP: "Northern Mariana Islands, MP", WY: "Wyoming, WY", - ZZ: "ZZ Test Date, ZZ", + ZZ: "ZZ Test Data, ZZ", }; export const useLabelMapping = () => { From 6729201149d6aa3f5be30731f26856cbb163085d Mon Sep 17 00:00:00 2001 From: James Dinh Date: Mon, 1 Jul 2024 09:14:44 -0700 Subject: [PATCH 3/5] feat(g1): add g1 form to our webforms list * completed form * Update index.spec.ts * add subhead logic * Update v202401.ts --- src/packages/shared-types/forms.ts | 1 + src/services/api/webforms/G1/index.ts | 1 + src/services/api/webforms/G1/v202401.ts | 462 ++++++++++++++++++ src/services/api/webforms/index.ts | 4 + src/services/ui/e2e/tests/a11y/index.spec.ts | 1 + .../ui/src/components/RHF/Document.tsx | 5 + src/services/ui/tailwind.config.js | 2 +- 7 files changed, 475 insertions(+), 1 deletion(-) create mode 100644 src/services/api/webforms/G1/index.ts create mode 100644 src/services/api/webforms/G1/v202401.ts diff --git a/src/packages/shared-types/forms.ts b/src/packages/shared-types/forms.ts index 07b92772e..f600c1050 100644 --- a/src/packages/shared-types/forms.ts +++ b/src/packages/shared-types/forms.ts @@ -16,6 +16,7 @@ import { export interface FormSchema { header: string; + subheader?: string; formId: string; sections: Section[]; } diff --git a/src/services/api/webforms/G1/index.ts b/src/services/api/webforms/G1/index.ts new file mode 100644 index 000000000..e5cf77f4f --- /dev/null +++ b/src/services/api/webforms/G1/index.ts @@ -0,0 +1 @@ +export * from "./v202401"; diff --git a/src/services/api/webforms/G1/v202401.ts b/src/services/api/webforms/G1/v202401.ts new file mode 100644 index 000000000..19a286756 --- /dev/null +++ b/src/services/api/webforms/G1/v202401.ts @@ -0,0 +1,462 @@ +import { FormSchema } from "shared-types"; + +export const v202401: FormSchema = { + header: "Premiums and cost sharing G1: Cost-sharing requirements", + subheader: "1916 | 1916A | 42 CFR 447.50 through 447.57 (excluding 447.55)", + formId: "g1", + sections: [ + { + title: "Overview", + sectionId: "overview", + form: [ + { + slots: [ + { + name: "state-charge-cost-sharing", + rhf: "Select", + rules: { required: "* Required" }, + label: + "Does the state charge cost sharing (deductibles, coinsurance, or copayments) to individuals covered under Medicaid?", + labelClassName: "font-bold text-black", + props: { + className: "w-[125px]", + options: [ + { + value: "yes", + label: "Yes", + }, + { + value: "no", + label: "No", + }, + ], + }, + }, + { + name: "assures-admin-cost-share", + rhf: "Checkbox", + rules: { required: "* Required" }, + props: { + options: [ + { + value: "accordance_with_sections_1916_and_1916a", + label: + "The state assures that it administers cost sharing in accordance with Sections 1916 and 1916A of the Social Security Act and 42 CFR 447.50 through 447.57 (excluding 447.55).", + }, + ], + }, + }, + ], + }, + ], + }, + + { + title: "General provisions", + sectionId: "general-provis", + form: [ + { + slots: [ + { + rhf: "Checkbox", + name: "cost-shar-less-than-agency-pays", + rules: { + required: "* Required", + }, + props: { + options: [ + { + label: + "The cost-sharing amounts established by the state for services are always less than the amounts the agency pays for the service.", + value: "true", + }, + ], + }, + }, + { + rhf: "Checkbox", + name: "no-prov-may-deny-based-on-pay-cost-except-by-state", + rules: { + required: "* Required", + }, + props: { + options: [ + { + label: + "No provider may deny services to an eligible individual based on the individual’s inability to pay cost sharing, except as elected by the state in accordance with 42 CFR 447.52(e)(1).", + value: "true", + }, + ], + }, + }, + { + rhf: "Checkbox", + name: "mcos-provides-chargers-in-accordance-with-specified-in-state-plan", + rules: { + required: "* Required", + }, + props: { + options: [ + { + label: + "Contracts with managed care organizations (MCOs) provide that any cost-sharing charges the MCO imposes on Medicaid enrollees are in accordance with the cost sharing specified in the state plan and the requirements of 42 CFR 447.50 through 447.57.", + value: "true", + }, + ], + }, + }, + { + rhf: "Checkbox", + name: "state-process-to-inform-cost-shar-for-item-or-serv", + label: + "What is the state’s process to inform providers whether cost sharing for a specific item or service may be imposed on a beneficiary and whether the provider requires the beneficiary to pay the cost-sharing charge as a condition for receiving the item or service?", + labelClassName: "font-bold text-black", + rules: { + required: "* Required", + }, + props: { + options: [ + { + label: + "The state includes an indicator in the Medicaid Management Information System (MMIS).", + value: "includes_indicator_in_mmis", + }, + { + label: + "The state includes an indicator in the Eligibility and Enrollment system.", + value: "includes_indicator_in_eligi_enroll_system", + }, + { + label: + "The state includes an indicator in the Eligibility Verification system.", + value: "includes_indicator_in_eligi_verfi_system", + }, + { + label: + "The state includes an indicator on the Medicaid card, which the beneficiary presents to the provider.", + value: "includes_indicator_in_medicaid_card", + }, + { + label: "Other process", + value: "other", + slots: [ + { + name: "other-process-describe", + rhf: "Textarea", + label: "Describe", + labelClassName: "font-bold", + rules: { + required: "* Required", + }, + }, + ], + }, + ], + }, + }, + ], + }, + ], + }, + { + title: + "Cost sharing for non-emergency services provided in a hospital emergency department", + sectionId: "cost-shar-for-non-emergency", + form: [ + { + slots: [ + { + name: "state-charge-cost-shar-for-non-emergen-in-hospital", + rhf: "Select", + rules: { required: "* Required" }, + label: + "Does the state impose cost sharing for non-emergency services provided in a hospital emergency department?", + labelClassName: "font-bold text-black", + props: { + className: "w-[125px]", + options: [ + { + value: "yes", + label: "Yes", + }, + { + value: "no", + label: "No", + }, + ], + }, + }, + + { + name: "ensures-provide-non-emergenc-impose-cost-shar", + rhf: "Checkbox", + rules: { required: "* Required" }, + props: { + options: [ + { + value: "true", + styledLabel: [ + { + text: "The state ensures that before providing non-emergency services and imposing cost sharing for such services, the hospitals providing care:", + type: "default", + classname: "block", + }, + { + text: "• Conduct an appropriate medical screening under 42 CFR 489.24, Subpart G to determine that the individual does not need emergency services", + type: "default", + classname: "block py-1", + }, + { + text: "• Inform the individual of the amount of his or her cost-sharing obligation for non-emergency services provided in the emergency department", + type: "default", + classname: "block py-1", + }, + { + text: "• Provide the individual with the name and location of an available and accessible alternative non-emergency services provider", + type: "default", + classname: "block py-1", + }, + { + text: "• Determine that the alternative provider can provide services to the individual in a timely manner with the imposition of a lesser cost-sharing amount or no cost sharing if the individual is otherwise exempt from cost sharing", + type: "default", + classname: "block py-1", + }, + { + text: "• Provide a referral to coordinate scheduling for treatment by the alternative provider", + type: "default", + classname: "block py-1", + }, + ], + }, + ], + }, + }, + { + name: "assures-process-identi-hospital-service-as-non-emergenc", + rhf: "Checkbox", + rules: { required: "* Required" }, + props: { + options: [ + { + value: "true", + label: + "The state assures it has a process in place to identify hospital emergency department services as non-emergency for the purpose of imposing cost sharing. This process does not limit a hospital's obligations for screening and stabilizing treatment of an emergency medical condition under Section 1867 of the Act or modify any obligations under either state or federal standards relating to the application of a prudent-layperson standard for payment or coverage of emergency medical services by any MCO.", + }, + ], + }, + }, + { + name: "assures-describe", + rhf: "Textarea", + rules: { required: "* Required" }, + label: "Describe the process.", + labelClassName: "font-bold text-black", + formItemClassName: "pl-9", + }, + ], + }, + ], + }, + { + title: "Cost sharing for drugs", + sectionId: "cost-shar-for-drugs", + form: [ + { + slots: [ + { + name: "state-charge-cost-shar-to-individ-under-medicaid", + rhf: "Select", + rules: { required: "* Required" }, + label: + "Does the state charge cost sharing (deductibles, coinsurance, or copayments) to individuals covered under Medicaid?", + labelClassName: "font-bold text-black", + props: { + className: "w-[125px]", + options: [ + { + value: "yes", + label: "Yes", + }, + { + value: "no", + label: "No", + }, + ], + }, + }, + { + name: "state-estab-differ-cost-shar-for-prefer-and-non-prefer", + rhf: "Select", + rules: { required: "* Required" }, + label: + "Has the state established differential cost sharing for preferred and non-preferred drugs?", + labelClassName: "font-bold text-black", + props: { + className: "w-[125px]", + options: [ + { + value: "yes", + label: "Yes", + }, + { + value: "no", + label: "No", + }, + ], + }, + }, + + { + name: "state-identifies-which-drugs-are-non-pref", + rhf: "Checkbox", + rules: { required: "* Required" }, + dependency: { + conditions: [ + { + name: "g1_cost-shar-for-drugs_state-estab-differ-cost-shar-for-prefer-and-non-prefer", + type: "expectedValue", + expectedValue: "yes", + }, + ], + effect: { type: "show" }, + }, + formItemClassName: "ml-[0.6rem] px-4 border-l-4 border-l-primary", + props: { + options: [ + { + value: "true", + label: + "The state identifies which drugs are considered non-preferred.", + }, + ], + }, + }, + + { + name: "assures-timely-process-limit-cost-shar-imposed", + rhf: "Checkbox", + rules: { required: "* Required" }, + formItemClassName: + "ml-[0.6rem] px-4 border-l-4 border-l-primary", + dependency: { + conditions: [ + { + name: "g1_cost-shar-for-drugs_state-estab-differ-cost-shar-for-prefer-and-non-prefer", + type: "expectedValue", + expectedValue: "yes", + }, + ], + effect: { type: "show" }, + }, + props: { + options: [ + { + value: "true", + label: + "The state assures it has a timely process in place to limit cost sharing to the amount imposed for a preferred drug in the case of a non-preferred drug within a therapeutically equivalent or similar class of drugs if the individual's prescribing provider determines that a preferred drug for treatment of the same condition will either be less effective for the individual or will have adverse effects for the individual, or both. In such cases, reimbursement to the pharmacy is based on the appropriate cost-sharing amount.", + }, + ], + }, + }, + + { + name: "all-drugs-consider-preferred-drugs", + rhf: "Checkbox", + rules: { required: "* Required" }, + formItemClassName: + "ml-[0.6rem] px-4 my-2 border-l-4 border-l-primary", + dependency: { + conditions: [ + { + name: "g1_cost-shar-for-drugs_state-estab-differ-cost-shar-for-prefer-and-non-prefer", + type: "expectedValue", + expectedValue: "no", + }, + ], + effect: { type: "show" }, + }, + props: { + options: [ + { + value: "true", + label: "All drugs will be considered preferred drugs.", + }, + ], + }, + }, + ], + }, + ], + }, + + { + title: "Beneficiary and public notice requirements", + sectionId: "benefi-public-notice-req", + form: [ + { + slots: [ + { + name: "consistent-with-42-cfr-447-57", + rhf: "Checkbox", + rules: { required: "* Required" }, + props: { + options: [ + { + value: "true", + styledLabel: [ + { + text: "Consistent with 42 CFR 447.57, the state makes available a public schedule describing current cost-sharing requirements in a manner that ensures that affected applicants, beneficiaries, and providers are likely to have access to the notice.", + type: "default", + classname: "block", + }, + { + text: "• Prior to submitting a state plan amendment (SPA) that establishes or substantially modifies existing cost-sharing amounts or policies, the state provides the public with advance notice of the SPA, specifying the amount of cost sharing and who is subject to the charges. The state also provides reasonable opportunity for stakeholder comment.", + type: "default", + classname: "block py-1", + }, + { + text: "• Documentation demonstrating that the notice requirements have been met is submitted with the SPA.", + type: "default", + classname: "block py-1", + }, + { + text: "• The state provides an opportunity for additional public notice if cost sharing is substantially modified during the SPA approval process.", + type: "default", + classname: "block py-1", + }, + ], + }, + ], + }, + }, + ], + }, + ], + }, + + { + title: "Additional information", + sectionId: "addtnl-info", + form: [ + { + description: "Other relevant information (optional)", + slots: [ + { + name: "description", + rhf: "Textarea", + rules: { + pattern: { + value: /^\S(.*\S)?$/, + message: "Must not have leading or trailing whitespace.", + }, + }, + props: { + className: "min-h-[114px]", + }, + }, + ], + }, + ], + }, + ], +}; diff --git a/src/services/api/webforms/index.ts b/src/services/api/webforms/index.ts index 2d8adcb50..bfd2b82d9 100644 --- a/src/services/api/webforms/index.ts +++ b/src/services/api/webforms/index.ts @@ -11,6 +11,7 @@ import * as ABP7 from "./ABP7"; import * as ABP9 from "./ABP9"; import * as ABP10 from "./ABP10"; import * as ABP11 from "./ABP11"; +import * as G1 from "./G1"; import { FormSchema } from "shared-types"; export const webformVersions: Record> = { @@ -54,4 +55,7 @@ export const webformVersions: Record> = { ABP11: { v202401: ABP11.v202401, }, + G1: { + v202401: G1.v202401, + }, }; diff --git a/src/services/ui/e2e/tests/a11y/index.spec.ts b/src/services/ui/e2e/tests/a11y/index.spec.ts index 4c67ce7d4..824cd3344 100644 --- a/src/services/ui/e2e/tests/a11y/index.spec.ts +++ b/src/services/ui/e2e/tests/a11y/index.spec.ts @@ -49,6 +49,7 @@ test.describe("test a11y on static routes", () => { const webformRoutes = [ "/guides/abp", + "/webform/g1/202401", "/webform/abp11/202401", "/webform/abp10/202401", "/webform/abp9/202401", diff --git a/src/services/ui/src/components/RHF/Document.tsx b/src/services/ui/src/components/RHF/Document.tsx index 37e29c0db..1c4d3793d 100644 --- a/src/services/ui/src/components/RHF/Document.tsx +++ b/src/services/ui/src/components/RHF/Document.tsx @@ -14,6 +14,11 @@ export const RHFDocument = (props: {

{props.document.header}

+ {props.document.subheader && ( +

+ {props.document.subheader} +

+ )} {props.document.sections.map((SEC, index) => ( Date: Mon, 1 Jul 2024 09:38:04 -0700 Subject: [PATCH 4/5] fix: (Abp2c fix): abpc2 requested changes from HCD (#598) * Update v202401.ts * Update v202401.ts * testing * iteratting * Update tailwind.config.js --- src/services/api/webforms/ABP2C/v202401.ts | 4 ++++ src/services/ui/tailwind.config.js | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/services/api/webforms/ABP2C/v202401.ts b/src/services/api/webforms/ABP2C/v202401.ts index 1b89574d3..f72d016a6 100644 --- a/src/services/api/webforms/ABP2C/v202401.ts +++ b/src/services/api/webforms/ABP2C/v202401.ts @@ -285,6 +285,7 @@ export const v202401: FormSchema = { }, label: "Describe the process for processing requests.", labelClassName: "font-bold text-black", + formItemClassName: "pl-8", }, ], }, @@ -302,6 +303,9 @@ export const v202401: FormSchema = { label: "Other information about enrollment assurances for mandatory participants (optional)", labelClassName: "font-bold text-black", + props: { + className: "min-h-[114px]", + }, rules: { pattern: { value: /^\S(.*\S)?$/, diff --git a/src/services/ui/tailwind.config.js b/src/services/ui/tailwind.config.js index cd5c5d253..4c389cb8e 100644 --- a/src/services/ui/tailwind.config.js +++ b/src/services/ui/tailwind.config.js @@ -3,7 +3,7 @@ import defaultTheme from "tailwindcss/defaultTheme"; export default { darkMode: ["class"], - content: ["./src/**/*.{ts,tsx}", "./index.html", "../api/webforms/**/*.{js,ts,jsx,tsx}"], + content: ["./src/**/*.{ts,tsx}", "./index.html","../api/webforms/**/*.{js,ts,jsx,tsx}"], theme: { fontFamily: { serif: ["Merriweather", "serif"], From b42d55c51744362e030a12646483ca97700614c2 Mon Sep 17 00:00:00 2001 From: James Dinh Date: Mon, 1 Jul 2024 10:37:11 -0700 Subject: [PATCH 5/5] fix(abp1-fixes): add hcd feedback to ABP1 * add all abp1 v2 changes * add horizontal radio button logic * add clear data button * add parent ID into RHF slot * Update SlotField.tsx * add logic to show hide incremental amount * Update textarea.tsx * Update v202402.ts * add px changes * Update v202402.ts * Update tailwind.config.js * add additional prop classname * Update v202402.ts * cleanup --- src/packages/shared-types/forms.ts | 1 + src/packages/shared-types/inputs.ts | 1 + src/services/api/webforms/ABP1/v202402.ts | 592 ++++++++++-------- .../ui/src/components/Inputs/button.tsx | 2 +- .../ui/src/components/Inputs/input.tsx | 10 +- src/services/ui/src/components/RHF/Slot.tsx | 14 +- .../ui/src/components/RHF/SlotField.tsx | 5 +- .../src/components/RHF/dependencyWrapper.tsx | 6 +- .../ui/src/features/webforms/WebFormBody.tsx | 2 +- 9 files changed, 347 insertions(+), 286 deletions(-) diff --git a/src/packages/shared-types/forms.ts b/src/packages/shared-types/forms.ts index f600c1050..1810f5081 100644 --- a/src/packages/shared-types/forms.ts +++ b/src/packages/shared-types/forms.ts @@ -33,6 +33,7 @@ export type RHFSlotProps = { descriptionClassName?: string; dependency?: DependencyRule; rules?: RegisterOptions; + horizontalLayout?: boolean; } & { [K in keyof RHFComponentMap]: { rhf: K; diff --git a/src/packages/shared-types/inputs.ts b/src/packages/shared-types/inputs.ts index 23164f1df..7d839f281 100644 --- a/src/packages/shared-types/inputs.ts +++ b/src/packages/shared-types/inputs.ts @@ -18,6 +18,7 @@ export type DatePickerProps = { export interface InputProps extends React.InputHTMLAttributes { icon?: string; + iconRight?: boolean; } export type RadioProps = React.ComponentPropsWithoutRef< diff --git a/src/services/api/webforms/ABP1/v202402.ts b/src/services/api/webforms/ABP1/v202402.ts index 4aecbb886..874ff24d1 100644 --- a/src/services/api/webforms/ABP1/v202402.ts +++ b/src/services/api/webforms/ABP1/v202402.ts @@ -17,6 +17,9 @@ export const v202402: FormSchema = { name: "abp-pop-name", label: "ABP package name", labelClassName: "font-bold", + props: { + className: "w-[355px]", + }, rules: { required: "* Required", pattern: { @@ -24,7 +27,6 @@ export const v202402: FormSchema = { message: "Must not have leading or trailing whitespace.", }, }, - props: { placeholder: "enter name" }, }, ], }, @@ -51,222 +53,224 @@ export const v202402: FormSchema = { className: "w-[300px]", options: [ { - label: "Parents and Other Caretaker Relatives", - value: "parents_caretaker_relatives", + label: "Adult", + value: "adult", }, { - label: "Transitional Medical Assistance", - value: "transitional_medical_assist", + label: + "Aged, blind, and disabled individuals in 209(b) states", + value: "aged_blind_disabled_individuals_209b_states", }, { label: - "Extended Medicaid Due to Spousal Support Collections", - value: "extend_medicaid_spousal_support_collect", + "Aged, blind, or disabled individuals eligible for but not receiving cash", + value: + "aged_blind_disabled_eligible_but_not_receiving_cash", }, { - label: "Pregnant Women", - value: "pregnant_women", + label: "Blind or disabled individuals eligible in 1937", + value: "blind_disabled_eligible_1973", }, { - label: "Deemed Newborns", - value: "deemed_newborns", + label: + "Certain individuals needing treatment for breast or cervical cancer", + value: + "individuals_need_treatment_for_breasts_cervical_cancer", }, { - label: "Infants and Children under Age 19", - value: "infants_children_under_19", + label: "Children with non-IV-E adoption assistance", + value: "children_non-IV-E_adoption_assistance", }, { label: - "Children with Title IV-E Adoption Assistance, Foster Care or Guardianship Care", + "Children with Title IV-E adoption assistance, foster care, or guardianship care", value: "children_title_IV-E_adoption_assist_foster_guardianship_care", }, { - label: "Former Foster Care Children", - value: "former_foster_children", + label: "Deemed newborns", + value: "deemed_newborns", }, { - label: "Adult Group", - value: "adult_group", + label: "Disabled adult children", + value: "disabled_adult_children", }, { - label: "SSI Beneficiaries", - value: "ssi_beneficiaries", + label: + "Disabled widows and widowers ineligible for SSI due to early receipt of Social Security", + value: + "disabled_widows_ineligible_SSI_due_to_early_receipt_social_security", }, { label: - "Aged, Blind and Disabled Individuals in 209(b) States", - value: "aged_blind_disabled_individuals_209b_states", + "Disabled widows and widowers ineligible for SSI due to increase in OASDI", + value: + "disabled_widows_ineligible_SSI_due_to_increase_OASDI", }, { label: - "Individuals Receiving Mandatory State Supplements", - value: - "individuals_receiving_mandatory_state_supplements", + "Extended Medicaid due to spousal support collections", + value: "extend_medicaid_spousal_support_collect", }, { - label: "Individuals Who Are Essential Spouses", - value: "essential_spouses", + label: + "Family Opportunity Act children with disabilities", + value: "family_opportunity_act_children_disabilities", }, { - label: "Institutionalized Individuals Eligible in 1973", - value: "institutionalized_eligible_1973", + label: "Former foster care children", + value: "former_foster_children", }, { - label: "Blind or Disabled Individuals Eligible in 1937", - value: "blind_disabled_eligible_1937", + label: "Independent foster care adolescents", + value: "independent_foster_care_adolescents", }, { label: - "Individuals Who Lost Eligibility for SSI/SSP Due to an Increase in OASDI Benefits in 1972", - value: - "lost_eligibility_SSI_SSP_increase_in_OASDI_benefits_1972", + "Individuals eligible for cash except for institutionalization", + value: "eligible_cash_except_for_institutionalization", }, { label: - "Individuals Eligible for SSI/SSP but for OASDI COLA increases since April, 1977", + "Individuals eligible for SSI/SSP but for OASDI COLA increases since April 1977", value: "eligible_SSI_SSP_but_for_OASDI_COLA_increases_April_1977", }, { label: - "Disabled Widows and Widowers Ineligible for SSI due to Increase in OASDI", + "Individuals receiving home and community-based services under institutional rules", value: - "disabled_widows_ineligible_SSI_due_to_increase_OASDI", + "receiving_home_community_services_under_inst_rule", + }, + { + label: "Individuals receiving hospice care", + value: "hospice_care", }, { label: - "Disabled Widows and Widowers Ineligible for SSI due to Early Receipt of Social Security", + "Individuals receiving mandatory state supplements", value: - "disabled_widows_ineligible_SSI_due_to_early_receipt_social_security", + "individuals_receiving_mandatory_state_supplements", }, { - label: "Working Disabled under 1619(b)", - value: "working_disabled_under_1619b", + label: "Individuals who are essential spouses", + value: "essential_spouses", }, { - label: "Disabled Adult Children", - value: "disabled_adult_children", + label: + "Individuals who lost eligibility for SSI/SSP due to an increase in OASDI benefits in 1972", + value: + "lost_eligibility_SSI_SSP_increase_in_OASDI_benefits_1972", }, { - label: - "Optional Coverage of Parents and Other Caretaker Relatives", - value: "opt_coverage_parents_other_caretaker_relatives", + label: "Individuals with tuberculosis", + value: "tuberculosis", }, { - label: - "Reasonable Classifications of Individuals under Age 21", - value: "reasonable_class_under_21", + label: "Infants and children under age 19", + value: "infants_children_under_19", }, { - label: "Children with Non-IV-E Adoption Assistance", - value: "children_Non-IV-E_adoption_assistance", + label: + "Institutionalized individuals continuously eligible since 1973", + value: "institutionalized_eligible_1973", }, { - label: "Independent Foster Care Adolescents", - value: "independent_foster_care_adolescents", + label: + "Institutionalized individuals eligible under a special income level", + value: "inst_eligible_under_special_income_level", }, { - label: "Optional Targeted Low Income Children", - value: "opt_targeted_low_income_children", + label: "Medically needy aged, blind, or disabled", + value: "med_needy_aged_blind_disabled", }, { label: - "Certain Individuals Needing Treatment for Breast or Cervical Cancer", + "Medically needy blind or disabled individuals eligible in 1973", value: - "individuals_need_treatment_for_breasts_cervical_cancer", + "med_needy_aged_blind_disabled_individuals_eligible_in_1973", }, { - label: "Individuals with Tuberculosis", - value: "tuberculosis", + label: "Medically needy children age 18 through 20", + value: "med_needy_age_18_through_20", }, { - label: - "Aged, Blind or Disabled Individuals Eligible for but Not Receiving Cash", - value: - "aged_blind_disabled_eligible_but_not_receiving_cash", + label: "Medically needy children under age 18", + value: "med_needy_children_under_18", }, { - label: - "Individuals Eligible for Cash except for Institutionalization", - value: "eligible_cash_except_for_institutionalization", + label: "Medically needy parents and other caretakers", + value: "med_needy_parents_caretakers", + }, + { + label: "Medically needy pregnant women", + value: "med_needy_pregnant_women", }, { label: - "Individuals Receiving Home and Community Based Services under Institutional Rules", - value: - "receiving_home_community_services_under_inst_rule", + "Optional coverage of parents and other caretaker relatives", + value: "opt_coverage_parents_other_caretaker_relatives", }, { label: - "Optional State Supplement - 1634 States and SSI Criteria States with 1616 Agreements", + "Optional state supplement - 1634 states and SSI criteria states with 1616 agreements", value: "opt_state_supp_1634_states_SSI_criteria_states_1616_agreements", }, { label: - "Optional State Supplement - 209(b) States and SSI Criteria States without 1616 Agreements", + "Optional state supplement - 209(b) states and SSI criteria states without 1616 agreements", value: "opt_state_supp_209b_states_SSI_criteria_states_without_1616_agreements", }, { - label: - "Institutionalized Individuals Eligible under a Special Income Level", - value: "inst_eligible_under_special_income_level", + label: "Optional targeted low-income children", + value: "opt_targ_low_income_children", }, { - label: "Individuals Receiving Hospice Care", - value: "hospice_care", - }, - { - label: "Qualified Disabled Children under Age 19 ", - value: "qualified_disabled_children_under_19", - }, - { - label: "Poverty Level Aged or Disabled", - value: "poverty_level_aged_disabled", + label: "Parents and other caretaker relatives", + value: "parents_caretaker_relatives", }, { - label: "Work Incentives Eligibility Group", - value: "work_incentives_eligibility_group", + label: "Poverty-level aged or disabled", + value: "poverty_level_aged_or_disabled", }, { - label: "Ticket to Work Basic Group", - value: "ticket_work_basic_group", + label: "Pregnant women", + value: "pregnant_women", }, { - label: "Ticket to Work Medical Improvements Group", - value: "ticket_work_medical_imp_group", + label: "Qualified disabled children under age 19", + value: "qualified_disabled_children_under_19", }, { label: - "Family Opportunity Act Children with Disabilities", - value: "family_opportunity_act_children_disabilities", + "Reasonable classifications of individuals under age 21", + value: "reasonable_class_under_21", }, { - label: "Medically Needy Pregnant Women", - value: "med_needy_pregnant_women", + label: "SSI beneficiaries", + value: "ssi_beneficiaries", }, { - label: "Medically Needy Children under Age 18", - value: "med_needy_children_under_18", + label: "Ticket to Work basic", + value: "ticket_work_basic", }, { - label: "Medically Needy Children Age 18 through 20", - value: "med_needy_age_18_through_20", + label: "Ticket to Work medical improvements", + value: "ticket_work_medical_imp_group", }, { - label: "Medically Needy Parents and Other Caretakers", - value: "med_needy_parents_caretakers", + label: "Transitional medical assistance", + value: "transitional_medical_assist", }, { - label: "Medically Needy Aged, Blind or Disabled", - value: "med_needy_aged_blind_disabled", + label: "Work incentives", + value: "work_incentives", }, { - label: - "Medically Needy Blind or Disabled Individuals Eligible in 1973", - value: "med_needy_blind_disabled_eligible_1973", + label: "Working disabled under 1619(b)", + value: "working_disabled_under_1619b", }, ], }, @@ -405,6 +409,8 @@ export const v202402: FormSchema = { rhf: "Input", props: { icon: "%", + iconRight: true, + className: "w-[229px]", }, rules: { pattern: { @@ -433,6 +439,8 @@ export const v202402: FormSchema = { labelClassName: "font-bold", props: { icon: "%", + iconRight: true, + className: "w-[229px]", }, rules: { pattern: { @@ -456,6 +464,8 @@ export const v202402: FormSchema = { labelClassName: "font-bold", props: { icon: "%", + iconRight: true, + className: "w-[229px]", }, rules: { pattern: { @@ -510,20 +520,18 @@ export const v202402: FormSchema = { name: "income-def-specific-state", props: { appendText: - "Add Standard", + "Add standard", }, fields: [ { rhf: "Input", label: "Household size", + name: "house-size", labelClassName: "font-bold", - name: "house-size", props: { - placeholder: - "enter size", className: - "w-[300px]", + "w-[150px]", }, rules: { pattern: { @@ -544,8 +552,6 @@ export const v202402: FormSchema = { props: { className: "w-[200px]", - placeholder: - "enter amount", icon: "$", }, rules: { @@ -561,50 +567,57 @@ export const v202402: FormSchema = { }, ], }, - ], - }, - { - slots: [ { - rhf: "Checkbox", + rhf: "Radio", name: "is-increment-amount", + label: + "Is there an additional incremental amount?", + labelClassName: + "font-bold mt-3", + horizontalLayout: true, + props: { options: [ { - label: - "There is an additional incremental amount.", - optionlabelClassName: - "font-bold", + label: "Yes", value: "yes", - form: [ - { - slots: [ - { - rhf: "Input", - label: - "Incremental amount", - labelClassName: - "font-bold", - name: "increment-amount", - props: { - icon: "$", - }, - rules: { - pattern: { - value: - /^\d*(?:\.\d{1,2})?$/, - message: - "Must be all numbers, no commas. e.g. 1234.56", - }, - required: - "* Required", - }, - }, - ], - }, - ], + }, + { + label: "No", + value: "no", + }, + ], + }, + }, + { + rhf: "Input", + label: "Incremental amount", + name: "increment-amount", + labelClassName: "font-bold", + props: { + icon: "$", + className: "w-[200px]", + }, + dependency: { + conditions: [ + { + name: "abp1_target-criteria_is-increment-amount", + type: "expectedValue", + expectedValue: "yes", }, ], + effect: { + type: "show", + }, + }, + rules: { + pattern: { + value: + /^\d*(?:\.\d{1,2})?$/, + message: + "Must be all numbers, no commas. e.g. 1234.56", + }, + required: "* Required", }, }, ], @@ -621,9 +634,9 @@ export const v202402: FormSchema = { rhf: "FieldGroup", name: "income-def-specific-statewide-group-region", props: { - appendText: "Add Region", + appendText: "Add region", removeText: - "Remove Region", + "Remove region", }, fields: [ { @@ -676,10 +689,8 @@ export const v202402: FormSchema = { "font-bold", name: "house-size", props: { - placeholder: - "enter size", className: - "w-[300px]", + "w-[150px]", }, rules: { pattern: { @@ -701,8 +712,6 @@ export const v202402: FormSchema = { props: { className: "w-[200px]", - placeholder: - "enter amount", icon: "$", }, rules: { @@ -719,48 +728,63 @@ export const v202402: FormSchema = { ], }, { - rhf: "Checkbox", + rhf: "Radio", name: "is-increment-amount", + label: + "Is there an additional incremental amount?", + labelClassName: + "font-bold mt-3", + horizontalLayout: true, + props: { options: [ { - label: - "There is an additional incremental amount.", - optionlabelClassName: - "font-bold", + label: "Yes", value: "yes", - form: [ - { - slots: [ - { - rhf: "Input", - label: - "Incremental amount", - labelClassName: - "font-bold", - name: "increment-amount", - props: { - icon: "$", - }, - rules: { - pattern: - { - value: - /^\d*(?:\.\d{1,2})?$/, - message: - "Must be all numbers, no commas. e.g. 1234.56", - }, - required: - "* Required", - }, - }, - ], - }, - ], + }, + { + label: "No", + value: "no", }, ], }, }, + { + rhf: "Input", + label: + "Incremental amount", + name: "increment-amount", + labelClassName: + "font-bold", + props: { + icon: "$", + className: + "w-[200px]", + }, + dependency: { + conditions: [ + { + name: "is-increment-amount", + type: "expectedValue", + expectedValue: + "yes", + }, + ], + effect: { + type: "show", + }, + }, + rules: { + pattern: { + value: + /^\d*(?:\.\d{1,2})?$/, + message: + "Must be all numbers, no commas. e.g. 1234.56", + }, + required: + "* Required", + }, + }, ], }, ], @@ -780,7 +804,7 @@ export const v202402: FormSchema = { name: "liv-arrange", props: { appendText: - "Add Living Arrangement", + "Add living arrangement", removeText: "Remove living arrangement", }, @@ -836,10 +860,8 @@ export const v202402: FormSchema = { "font-bold", name: "house-size", props: { - placeholder: - "enter size", className: - "w-[300px]", + "w-[150px]", }, rules: { pattern: { @@ -861,8 +883,6 @@ export const v202402: FormSchema = { props: { className: "w-[200px]", - placeholder: - "enter amount", icon: "$", }, rules: { @@ -879,46 +899,62 @@ export const v202402: FormSchema = { ], }, { - rhf: "Checkbox", + rhf: "Radio", name: "is-increment-amount", + label: + "Is there an additional incremental amount?", + labelClassName: + "font-bold mt-3", + horizontalLayout: true, + props: { options: [ { - label: - "There is an additional incremental amount.", - optionlabelClassName: - "font-bold", + label: "Yes", value: "yes", - form: [ - { - slots: [ - { - rhf: "Input", - label: - "Incremental amount", - labelClassName: - "font-bold", - name: "incremental_amount", - props: { - icon: "$", - }, - rules: { - pattern: - { - value: - /^\d*(?:\.\d{1,2})?$/, - message: - "Must be all numbers, no commas. e.g. 1234.56", - }, - required: - "* Required", - }, - }, - ], - }, - ], + }, + { + label: "No", + value: "no", + }, + ], + }, + }, + + { + rhf: "Input", + label: + "Incremental amount", + name: "increment-amount", + labelClassName: + "font-bold", + props: { + icon: "$", + className: + "w-[200px]", + }, + dependency: { + conditions: [ + { + name: "is-increment-amount", + type: "expectedValue", + expectedValue: + "yes", }, ], + effect: { + type: "show", + }, + }, + rules: { + pattern: { + value: + /^\d*(?:\.\d{1,2})?$/, + message: + "Must be all numbers, no commas. e.g. 1234.56", + }, + required: + "* Required", }, }, ], @@ -937,7 +973,7 @@ export const v202402: FormSchema = { slots: [ { rhf: "FieldGroup", - name: "add-some-other-way", + name: "add-other-way", props: { appendText: "Add other way", @@ -991,14 +1027,12 @@ export const v202402: FormSchema = { rhf: "Input", label: "Household size", + name: "house-size", labelClassName: "font-bold", - name: "house-size", props: { - placeholder: - "enter size", className: - "w-[300px]", + "w-[150px]", }, rules: { pattern: { @@ -1020,8 +1054,6 @@ export const v202402: FormSchema = { props: { className: "w-[200px]", - placeholder: - "enter amount", icon: "$", }, rules: { @@ -1038,48 +1070,63 @@ export const v202402: FormSchema = { ], }, { - rhf: "Checkbox", + rhf: "Radio", name: "is-increment-amount", + label: + "Is there an additional incremental amount?", + labelClassName: + "font-bold mt-3", + horizontalLayout: true, + props: { options: [ { - label: - "There is an additional incremental amount.", - optionlabelClassName: - "font-bold", + label: "Yes", value: "yes", - form: [ - { - slots: [ - { - rhf: "Input", - label: - "Incremental amount", - labelClassName: - "font-bold", - name: "increment-amount", - props: { - icon: "$", - }, - rules: { - pattern: - { - value: - /^\d*(?:\.\d{1,2})?$/, - message: - "Must be all numbers, no commas. e.g. 1234.56", - }, - required: - "* Required", - }, - }, - ], - }, - ], + }, + { + label: "No", + value: "no", }, ], }, }, + { + rhf: "Input", + label: + "Incremental amount", + name: "increment-amount", + labelClassName: + "font-bold", + props: { + icon: "$", + className: + "w-[200px]", + }, + dependency: { + conditions: [ + { + name: "is-increment-amount", + type: "expectedValue", + expectedValue: + "yes", + }, + ], + effect: { + type: "show", + }, + }, + rules: { + pattern: { + value: + /^\d*(?:\.\d{1,2})?$/, + message: + "Must be all numbers, no commas. e.g. 1234.56", + }, + required: + "* Required", + }, + }, ], }, ], @@ -1100,8 +1147,7 @@ export const v202402: FormSchema = { }, { value: "health", - label: - "Disease, condition, diagnosis, or disorder (check all that apply)", + label: "Disease, condition, diagnosis, or disorder", slots: [ { rhf: "Checkbox", @@ -1206,7 +1252,7 @@ export const v202402: FormSchema = { ], }, { - title: "Geographic Area", + title: "Geographic area", sectionId: "geo-area", form: [ { @@ -1354,12 +1400,14 @@ export const v202402: FormSchema = { sectionId: "additional-info", form: [ { - description: - "Any other information the state/territory wishes to provide about the population (optional)", + description: "Other information about the population (optional)", slots: [ { name: "description", rhf: "Textarea", + props: { + className: "min-h-[114px]", + }, rules: { pattern: { value: /^\S(.*\S)?$/, diff --git a/src/services/ui/src/components/Inputs/button.tsx b/src/services/ui/src/components/Inputs/button.tsx index 64bab3ce9..c7dc73e74 100644 --- a/src/services/ui/src/components/Inputs/button.tsx +++ b/src/services/ui/src/components/Inputs/button.tsx @@ -6,7 +6,7 @@ import { cn } from "@/utils"; import { Loader2 } from "lucide-react"; const buttonVariants = cva( - "inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", + "inline-flex items-center justify-center rounded-md text-base font-bold ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", { variants: { variant: { diff --git a/src/services/ui/src/components/Inputs/input.tsx b/src/services/ui/src/components/Inputs/input.tsx index 11d97b8ae..dbe043b4f 100644 --- a/src/services/ui/src/components/Inputs/input.tsx +++ b/src/services/ui/src/components/Inputs/input.tsx @@ -3,18 +3,20 @@ import { cn } from "@/utils"; import { InputProps } from "shared-types"; const Input = React.forwardRef( - ({ className, icon, ...props }, ref) => { + ({ className, icon, iconRight, ...props }, ref) => { return ( -
+
{icon && ( - + {icon} )} {(label || styledLabel) && ( @@ -55,7 +58,12 @@ export const RHFSlot = < )} - + {description && !descriptionAbove && ( diff --git a/src/services/ui/src/components/RHF/SlotField.tsx b/src/services/ui/src/components/RHF/SlotField.tsx index 2c82891b1..22c3f0f0b 100644 --- a/src/services/ui/src/components/RHF/SlotField.tsx +++ b/src/services/ui/src/components/RHF/SlotField.tsx @@ -52,6 +52,7 @@ export const SlotField = ({ parentId, fields, name, + horizontalLayout, }: SlotFieldProps) => { switch (rhf) { case "Input": @@ -211,7 +212,7 @@ export const SlotField = ({ {(props as RHFComponentMap["Radio"]).options.map((OPT) => { return ( @@ -275,7 +276,7 @@ export const OptChildren = ({ control={control} name={parentId + SLOT.name} {...(SLOT.rules && { rules: SLOT.rules })} - render={RHFSlot({ ...SLOT, parentId, control })} + render={RHFSlot({ ...SLOT, control, parentId })} />
))} diff --git a/src/services/ui/src/components/RHF/dependencyWrapper.tsx b/src/services/ui/src/components/RHF/dependencyWrapper.tsx index e2234fb87..929017de8 100644 --- a/src/services/ui/src/components/RHF/dependencyWrapper.tsx +++ b/src/services/ui/src/components/RHF/dependencyWrapper.tsx @@ -4,7 +4,7 @@ import { DependencyRule, DependencyWrapperProps } from "shared-types"; const checkTriggeringValue = ( dependentValue: unknown[], - dependency?: DependencyRule + dependency?: DependencyRule, ) => { return !!dependency?.conditions?.every((d, i) => { switch (d.type) { @@ -27,7 +27,7 @@ const checkTriggeringValue = ( }; export const DependencyWrapper = ( - props: PropsWithChildren + props: PropsWithChildren, ) => { // Check for dependencies which won't exist outside of forms if ( @@ -51,7 +51,7 @@ const DependencyWrapperHandler = ({ const { watch, setValue } = useFormContext(); const [wasSetLast, setWasSetLast] = useState(false); const dependentValues = watch( - dependency?.conditions?.map((c) => c.name) ?? [] + dependency?.conditions?.map((c) => c.name) ?? [], ); const isTriggered = dependency && checkTriggeringValue(dependentValues, dependency); diff --git a/src/services/ui/src/features/webforms/WebFormBody.tsx b/src/services/ui/src/features/webforms/WebFormBody.tsx index 6af2337fb..256639725 100644 --- a/src/services/ui/src/features/webforms/WebFormBody.tsx +++ b/src/services/ui/src/features/webforms/WebFormBody.tsx @@ -83,7 +83,7 @@ const ClearDataButton: FC<{ reset: () => void }> = ({ reset }) => { if (clearDataButton) { return ( ); }