policyengine-household-wizard 0.1.0 → 0.2.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/README.md +37 -2
- package/dist/WizardReviewList-DhLx8Bla.cjs +1 -0
- package/dist/WizardReviewList-oY1HqmLw.js +354 -0
- package/dist/index-B_OXaS4a.cjs +1 -0
- package/dist/index-DWM0giHt.js +220 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +34 -28
- package/dist/primitives/WizardReviewList.d.ts +3 -2
- package/dist/primitives/WizardReviewList.d.ts.map +1 -1
- package/dist/primitives/index.d.ts +3 -1
- package/dist/primitives/index.d.ts.map +1 -1
- package/dist/primitives/types.d.ts +18 -0
- package/dist/primitives/types.d.ts.map +1 -1
- package/dist/primitives/useWizardStepFocus.d.ts +13 -0
- package/dist/primitives/useWizardStepFocus.d.ts.map +1 -0
- package/dist/primitives/useWizardSteps.d.ts +1 -1
- package/dist/primitives/useWizardSteps.d.ts.map +1 -1
- package/dist/primitives.cjs +1 -1
- package/dist/primitives.js +5 -4
- package/dist/us-household/adapters/v1Payload.d.ts +119 -3
- package/dist/us-household/adapters/v1Payload.d.ts.map +1 -1
- package/dist/us-household/amount.d.ts +8 -0
- package/dist/us-household/amount.d.ts.map +1 -0
- package/dist/us-household/index.d.ts +2 -1
- package/dist/us-household/index.d.ts.map +1 -1
- package/dist/us-household/normalize.d.ts.map +1 -1
- package/dist/us-household/serialize.d.ts.map +1 -1
- package/dist/us-household/tippedOccupations.d.ts +40 -0
- package/dist/us-household/tippedOccupations.d.ts.map +1 -0
- package/dist/us-household/types.d.ts +137 -4
- package/dist/us-household/types.d.ts.map +1 -1
- package/dist/us-household/validate.d.ts.map +1 -1
- package/dist/us-household-adapters.cjs +1 -1
- package/dist/us-household-adapters.js +3 -90
- package/dist/us-household.cjs +1 -1
- package/dist/us-household.js +346 -246
- package/package.json +4 -1
- package/src/primitives/WizardReviewList.tsx +35 -18
- package/src/primitives/index.ts +3 -0
- package/src/primitives/types.ts +20 -0
- package/src/primitives/useWizardStepFocus.ts +42 -0
- package/src/primitives/useWizardSteps.ts +181 -84
- package/src/styles.css +9 -0
- package/src/us-household/adapters/v1Payload.ts +211 -18
- package/src/us-household/amount.ts +10 -0
- package/src/us-household/index.ts +11 -0
- package/src/us-household/normalize.ts +79 -4
- package/src/us-household/serialize.ts +5 -1
- package/src/us-household/tippedOccupations.ts +145 -0
- package/src/us-household/types.ts +143 -4
- package/src/us-household/validate.ts +101 -4
- package/dist/WizardReviewList-De9RTK_4.js +0 -245
- package/dist/WizardReviewList-tfP9LcqU.cjs +0 -1
package/dist/index.js
CHANGED
|
@@ -1,35 +1,41 @@
|
|
|
1
|
-
import { W as t, a as o, b as
|
|
2
|
-
import { DEFAULT_HOUSEHOLD_YEAR as n, US_STATES as
|
|
3
|
-
import {
|
|
1
|
+
import { W as t, a as o, b as s, c as i, u as r, d } from "./WizardReviewList-oY1HqmLw.js";
|
|
2
|
+
import { DEFAULT_HOUSEHOLD_YEAR as n, US_STATES as u, addPerson as C, applyMaritalStatusChange as l, cloneDraft as S, createBlankDraft as c, createPerson as g, deserializeDraft as P, getAdults as T, getCountiesByState as O, getCountyName as D, getDependents as m, getStateFromZip as z, getStateName as f, isComplete as y, isCountyCode as A, isUSStateCode as N, normalizeLegacyDraft as W, removePerson as _, resolveCountyCode as E, serializeDraft as U, updatePerson as v, validate as H } from "./us-household.js";
|
|
3
|
+
import { N as L, T as h, g as x, i as F, a as b, b as B, c as R } from "./index-DWM0giHt.js";
|
|
4
4
|
export {
|
|
5
5
|
n as DEFAULT_HOUSEHOLD_YEAR,
|
|
6
|
-
|
|
6
|
+
L as NOT_A_TIPPED_OCCUPATION,
|
|
7
|
+
h as TIPPED_OCCUPATIONS,
|
|
8
|
+
u as US_STATES,
|
|
7
9
|
t as WizardNavigation,
|
|
8
10
|
o as WizardOptionCard,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
s as WizardProgress,
|
|
12
|
+
i as WizardReviewList,
|
|
13
|
+
C as addPerson,
|
|
14
|
+
l as applyMaritalStatusChange,
|
|
15
|
+
S as cloneDraft,
|
|
16
|
+
c as createBlankDraft,
|
|
17
|
+
g as createPerson,
|
|
18
|
+
P as deserializeDraft,
|
|
19
|
+
T as getAdults,
|
|
20
|
+
O as getCountiesByState,
|
|
19
21
|
D as getCountyName,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
A as
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
m as getDependents,
|
|
23
|
+
z as getStateFromZip,
|
|
24
|
+
f as getStateName,
|
|
25
|
+
x as getTippedOccupation,
|
|
26
|
+
y as isComplete,
|
|
27
|
+
A as isCountyCode,
|
|
28
|
+
F as isTippedOccupationCode,
|
|
29
|
+
N as isUSStateCode,
|
|
30
|
+
W as normalizeLegacyDraft,
|
|
31
|
+
_ as removePerson,
|
|
32
|
+
E as resolveCountyCode,
|
|
29
33
|
U as serializeDraft,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
b as toTippedOccupationCode,
|
|
35
|
+
B as toV1HouseholdPayload,
|
|
36
|
+
R as toV1HouseholdSituation,
|
|
37
|
+
v as updatePerson,
|
|
38
|
+
r as useWizardStepFocus,
|
|
39
|
+
d as useWizardSteps,
|
|
40
|
+
H as validate
|
|
35
41
|
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import type { HTMLAttributes, ReactNode } from 'react';
|
|
1
|
+
import type { HTMLAttributes, MouseEvent, ReactNode } from 'react';
|
|
2
2
|
export interface WizardReviewItem {
|
|
3
3
|
id: string;
|
|
4
4
|
label: ReactNode;
|
|
5
5
|
value: ReactNode;
|
|
6
6
|
missing?: boolean;
|
|
7
|
-
onEdit?: () => void;
|
|
7
|
+
onEdit?: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
8
8
|
editLabel?: ReactNode;
|
|
9
|
+
editAriaLabel?: string;
|
|
9
10
|
}
|
|
10
11
|
export interface WizardReviewListProps extends HTMLAttributes<HTMLDivElement> {
|
|
11
12
|
items: WizardReviewItem[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WizardReviewList.d.ts","sourceRoot":"","sources":["../../src/primitives/WizardReviewList.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"WizardReviewList.d.ts","sourceRoot":"","sources":["../../src/primitives/WizardReviewList.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEnE,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,SAAS,CAAC;IACjB,KAAK,EAAE,SAAS,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IACxD,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,qBAAsB,SAAQ,cAAc,CAAC,cAAc,CAAC;IAC3E,KAAK,EAAE,gBAAgB,EAAE,CAAC;CAC3B;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,KAAK,EACL,SAAS,EACT,GAAG,IAAI,EACR,EAAE,qBAAqB,2CAoEvB"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export { useWizardSteps } from './useWizardSteps';
|
|
2
|
+
export { useWizardStepFocus } from './useWizardStepFocus';
|
|
3
|
+
export type { UseWizardStepFocusOptions } from './useWizardStepFocus';
|
|
2
4
|
export { WizardProgress } from './WizardProgress';
|
|
3
5
|
export type { WizardProgressProps } from './WizardProgress';
|
|
4
6
|
export { WizardOptionCard } from './WizardOptionCard';
|
|
@@ -7,5 +9,5 @@ export { WizardNavigation } from './WizardNavigation';
|
|
|
7
9
|
export type { WizardNavigationProps } from './WizardNavigation';
|
|
8
10
|
export { WizardReviewList } from './WizardReviewList';
|
|
9
11
|
export type { WizardReviewItem, WizardReviewListProps } from './WizardReviewList';
|
|
10
|
-
export type { ResolvedWizardStep, UseWizardStepsOptions, UseWizardStepsResult, WizardStepConfig, } from './types';
|
|
12
|
+
export type { ResolvedWizardStep, UseWizardStepsOptions, UseWizardStepsResult, WizardStepConfig, WizardAdvanceRequest, } from './types';
|
|
11
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/primitives/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAClF,YAAY,EACV,kBAAkB,EAClB,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/primitives/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAClF,YAAY,EACV,kBAAkB,EAClB,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,EAChB,oBAAoB,GACrB,MAAM,SAAS,CAAC"}
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
+
import type { FormEvent, KeyboardEvent } from 'react';
|
|
1
2
|
export interface WizardStepConfig<TState> {
|
|
2
3
|
id: string;
|
|
3
4
|
label: string;
|
|
4
5
|
isComplete?: (state: TState) => boolean;
|
|
5
6
|
isVisible?: (state: TState) => boolean;
|
|
7
|
+
autoAdvance?: boolean;
|
|
8
|
+
}
|
|
9
|
+
/** Create a new object for each explicit selection, alongside its state update. */
|
|
10
|
+
export interface WizardAdvanceRequest {
|
|
11
|
+
stepId: string;
|
|
6
12
|
}
|
|
7
13
|
export interface ResolvedWizardStep {
|
|
8
14
|
id: string;
|
|
@@ -13,6 +19,9 @@ export interface UseWizardStepsOptions<TState> {
|
|
|
13
19
|
state: TState;
|
|
14
20
|
initialStepId?: string;
|
|
15
21
|
onStepChange?: (stepId: string) => void;
|
|
22
|
+
onComplete?: () => void;
|
|
23
|
+
onInvalidStep?: (stepId: string) => void;
|
|
24
|
+
advanceRequest?: WizardAdvanceRequest | null;
|
|
16
25
|
}
|
|
17
26
|
export interface UseWizardStepsResult {
|
|
18
27
|
visibleSteps: ResolvedWizardStep[];
|
|
@@ -22,6 +31,15 @@ export interface UseWizardStepsResult {
|
|
|
22
31
|
isFirstStep: boolean;
|
|
23
32
|
isLastStep: boolean;
|
|
24
33
|
canAdvance: boolean;
|
|
34
|
+
visitedStepIds: string[];
|
|
35
|
+
hasVisitedStep: (stepId: string) => boolean;
|
|
36
|
+
validationStepId: string | null;
|
|
37
|
+
validationAttempt: number;
|
|
38
|
+
clearValidation: () => void;
|
|
39
|
+
validateAll: () => boolean;
|
|
40
|
+
advance: () => void;
|
|
41
|
+
handleSubmit: (event: FormEvent<HTMLFormElement>) => void;
|
|
42
|
+
handleKeyDown: (event: KeyboardEvent<HTMLFormElement>) => void;
|
|
25
43
|
goNext: () => void;
|
|
26
44
|
goBack: () => void;
|
|
27
45
|
goToStep: (stepId: string) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/primitives/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB,CAAC,MAAM;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;IACxC,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/primitives/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtD,MAAM,WAAW,gBAAgB,CAAC,MAAM;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;IACxC,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;IACvC,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,mFAAmF;AACnF,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,qBAAqB,CAAC,MAAM;IAC3C,KAAK,EAAE,aAAa,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC;IAC/C,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,cAAc,CAAC,EAAE,oBAAoB,GAAG,IAAI,CAAC;CAC9C;AAED,MAAM,WAAW,oBAAoB;IACnC,YAAY,EAAE,kBAAkB,EAAE,CAAC;IACnC,WAAW,EAAE,kBAAkB,GAAG,IAAI,CAAC;IACvC,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,OAAO,CAAC;IACrB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC;IAC5C,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,WAAW,EAAE,MAAM,OAAO,CAAC;IAC3B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,YAAY,EAAE,CAAC,KAAK,EAAE,SAAS,CAAC,eAAe,CAAC,KAAK,IAAI,CAAC;IAC1D,aAAa,EAAE,CAAC,KAAK,EAAE,aAAa,CAAC,eAAe,CAAC,KAAK,IAAI,CAAC;IAC/D,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface UseWizardStepFocusOptions {
|
|
2
|
+
stepId: string | null;
|
|
3
|
+
hasError?: boolean;
|
|
4
|
+
errorRevision?: unknown;
|
|
5
|
+
preventScroll?: boolean;
|
|
6
|
+
onStepFocus?: () => void;
|
|
7
|
+
}
|
|
8
|
+
/** Consumers render the targets with tabIndex={-1} and own any scrolling layout. */
|
|
9
|
+
export declare function useWizardStepFocus({ stepId, hasError, errorRevision, preventScroll, onStepFocus, }: UseWizardStepFocusOptions): {
|
|
10
|
+
headingRef: import("react").RefObject<HTMLHeadingElement | null>;
|
|
11
|
+
errorRef: import("react").RefObject<HTMLDivElement | null>;
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=useWizardStepFocus.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useWizardStepFocus.d.ts","sourceRoot":"","sources":["../../src/primitives/useWizardStepFocus.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,yBAAyB;IACxC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;CAC1B;AAED,oFAAoF;AACpF,wBAAgB,kBAAkB,CAAC,EACjC,MAAM,EACN,QAAgB,EAChB,aAAa,EACb,aAAqB,EACrB,WAAW,GACZ,EAAE,yBAAyB;;;EAwB3B"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { UseWizardStepsOptions, UseWizardStepsResult } from './types';
|
|
2
|
-
export declare function useWizardSteps<TState>(
|
|
2
|
+
export declare function useWizardSteps<TState>({ steps, state, initialStepId, onStepChange, onComplete, onInvalidStep, advanceRequest, }: UseWizardStepsOptions<TState>): UseWizardStepsResult;
|
|
3
3
|
//# sourceMappingURL=useWizardSteps.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useWizardSteps.d.ts","sourceRoot":"","sources":["../../src/primitives/useWizardSteps.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,qBAAqB,EACrB,oBAAoB,EAErB,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"useWizardSteps.d.ts","sourceRoot":"","sources":["../../src/primitives/useWizardSteps.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,qBAAqB,EACrB,oBAAoB,EAErB,MAAM,SAAS,CAAC;AAiBjB,wBAAgB,cAAc,CAAC,MAAM,EAAE,EACrC,KAAK,EACL,KAAK,EACL,aAAa,EACb,YAAY,EACZ,UAAU,EACV,aAAa,EACb,cAAc,GACf,EAAE,qBAAqB,CAAC,MAAM,CAAC,GAAG,oBAAoB,CAuNtD"}
|
package/dist/primitives.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./WizardReviewList-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./WizardReviewList-DhLx8Bla.cjs");exports.WizardNavigation=i.WizardNavigation;exports.WizardOptionCard=i.WizardOptionCard;exports.WizardProgress=i.WizardProgress;exports.WizardReviewList=i.WizardReviewList;exports.useWizardStepFocus=i.useWizardStepFocus;exports.useWizardSteps=i.useWizardSteps;
|
package/dist/primitives.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { W as
|
|
1
|
+
import { W as i, a as r, b as d, c as e, u as W, d as o } from "./WizardReviewList-oY1HqmLw.js";
|
|
2
2
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
i as WizardNavigation,
|
|
4
|
+
r as WizardOptionCard,
|
|
5
5
|
d as WizardProgress,
|
|
6
6
|
e as WizardReviewList,
|
|
7
|
-
W as
|
|
7
|
+
W as useWizardStepFocus,
|
|
8
|
+
o as useWizardSteps
|
|
8
9
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { USHouseholdDraft } from '../types';
|
|
1
|
+
import type { USHouseholdDraft, USPersonExpenses, USPersonFlags, USPersonIncomes } from '../types';
|
|
2
2
|
/**
|
|
3
3
|
* The shape of a PolicyEngine US "situation" / household-creation payload at
|
|
4
4
|
* the wire level. Variables are year-keyed; person/group keys are arbitrary
|
|
@@ -48,8 +48,10 @@ export interface ToV1PayloadOptions {
|
|
|
48
48
|
*/
|
|
49
49
|
groupKeyStyle?: 'short' | 'verbose';
|
|
50
50
|
/**
|
|
51
|
-
* If true,
|
|
52
|
-
*
|
|
51
|
+
* If true, puts the first two adults in one marital unit. Off by default for
|
|
52
|
+
* compatibility. With `marital_units: {}`, policyengine-core gives each
|
|
53
|
+
* person their own marital unit, so a married couple gets individual SSI
|
|
54
|
+
* rates instead of the couple rate; pass true for married drafts.
|
|
53
55
|
*/
|
|
54
56
|
includeMaritalUnit?: boolean;
|
|
55
57
|
/**
|
|
@@ -58,6 +60,120 @@ export interface ToV1PayloadOptions {
|
|
|
58
60
|
*/
|
|
59
61
|
label?: string | null;
|
|
60
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* Person flags and the PolicyEngine US variables they set. Exported for tests
|
|
65
|
+
* and tooling; not part of the package entry points. Only true and false are
|
|
66
|
+
* sent; anything else (such as null in a JSON draft) counts as not answered.
|
|
67
|
+
*
|
|
68
|
+
* `is_full_time_student` is computed as `is_full_time_college_student` or
|
|
69
|
+
* `is_in_k12_school`, and the model counts everyone aged 5 to 17 as a K-12
|
|
70
|
+
* student. So `isFullTimeStudent` is sent as full-time college enrollment,
|
|
71
|
+
* and only from `COLLEGE_MIN_AGE`: sending it for a child would make them a
|
|
72
|
+
* college student (for example, for New Jersey's exemption for dependents
|
|
73
|
+
* attending college), and sending the computed total would take K-12 status
|
|
74
|
+
* away from every other child in the household.
|
|
75
|
+
*/
|
|
76
|
+
export declare const FLAG_TO_VARIABLE: Readonly<Record<keyof USPersonFlags, string>>;
|
|
77
|
+
/**
|
|
78
|
+
* The youngest age at which `isFullTimeStudent` is sent. PolicyEngine US's
|
|
79
|
+
* `is_in_k12_school` covers ages 5 to 17, so a full-time student aged 18 or
|
|
80
|
+
* over is taken to be in college. A person with no age is sent the flag,
|
|
81
|
+
* because the model then assumes an adult age.
|
|
82
|
+
*/
|
|
83
|
+
export declare const COLLEGE_MIN_AGE = 18;
|
|
84
|
+
/**
|
|
85
|
+
* An entered 0 in `ssiAmount` is sent as this variable, set to false. It is an
|
|
86
|
+
* input (default true), so it sets that person's SSI to 0 without affecting
|
|
87
|
+
* anyone else. In policyengine-us 1.764.6 only `ssi` reads it. In 2.49.2,
|
|
88
|
+
* the shared state-supplement helper and a county General Relief rule read it
|
|
89
|
+
* too, so a 0 also means no supplement from that helper. Some states compute
|
|
90
|
+
* their own supplement from federal SSI instead: California's is its payment
|
|
91
|
+
* standard less SSI and countable income, so a 0 raises it.
|
|
92
|
+
*/
|
|
93
|
+
export declare const SSI_TAKE_UP_VARIABLE = "takes_up_ssi_if_eligible";
|
|
94
|
+
/**
|
|
95
|
+
* Person income fields and the PolicyEngine US variables they set. Exported
|
|
96
|
+
* for tests and tooling; not part of the package entry points.
|
|
97
|
+
*
|
|
98
|
+
* Where PolicyEngine US defines a variable as the sum of components (`adds`),
|
|
99
|
+
* an input on the total replaces that sum: components sent alongside it are
|
|
100
|
+
* left out of the total and everything computed from it, and components not
|
|
101
|
+
* sent read as zero where rules use them directly. `social_security` adds
|
|
102
|
+
* retirement, disability, survivors, and dependents benefits, so
|
|
103
|
+
* `socialSecurityIncome` sets `social_security_retirement` and `ssdiAmount`
|
|
104
|
+
* sets `social_security_disability`; the model sums them.
|
|
105
|
+
*
|
|
106
|
+
* Likewise `taxable_pension_income` adds public and private pensions, and
|
|
107
|
+
* state rules read those components. `publicPensionIncome` and
|
|
108
|
+
* `privatePensionIncome` set them. A pension of unknown source
|
|
109
|
+
* (`pensionIncome`) is sent as private. Fields that share a variable are
|
|
110
|
+
* summed. Numeric strings are read as numbers and other amounts that are not
|
|
111
|
+
* finite numbers are skipped, so a bad value in one field cannot corrupt a
|
|
112
|
+
* shared sum.
|
|
113
|
+
*
|
|
114
|
+
* `ssi` is computed, so `ssiAmount` follows the household rule above: the
|
|
115
|
+
* amounts are sent as `ssi` for everyone when every person has one, and
|
|
116
|
+
* otherwise the model computes everyone's SSI. `validate()` asks for the
|
|
117
|
+
* missing amounts in that case.
|
|
118
|
+
*
|
|
119
|
+
* Three totals are set directly: `employment_income`, `self_employment_income`
|
|
120
|
+
* and `long_term_capital_gains`. Each adds an input and a behavioral response,
|
|
121
|
+
* and PolicyEngine US's Simulation moves an input on the total onto that
|
|
122
|
+
* component input (`employment_income_before_lsr`,
|
|
123
|
+
* `self_employment_income_before_lsr`, `long_term_capital_gains_before_response`).
|
|
124
|
+
*
|
|
125
|
+
* `tests/us-household/v1PayloadInvariants.test.ts` checks this mapping against
|
|
126
|
+
* the PolicyEngine US variable graph, including the few totals that are safe
|
|
127
|
+
* to set directly.
|
|
128
|
+
*/
|
|
129
|
+
export declare const INCOME_TO_VARIABLE: Readonly<Record<keyof USPersonIncomes, string>>;
|
|
130
|
+
/**
|
|
131
|
+
* Income fields that PolicyEngine US also counts inside another variable, and
|
|
132
|
+
* that variable. Exported for tests and tooling; not part of the package entry
|
|
133
|
+
* points.
|
|
134
|
+
*
|
|
135
|
+
* PolicyEngine US counts tips as part of wages: `employment_income` is wages
|
|
136
|
+
* "including tips and commissions", and income and payroll taxes read it
|
|
137
|
+
* (through `irs_employment_income` and `payroll_tax_gross_wages`). A few rules
|
|
138
|
+
* read `tip_income` on its own: the qualified tips deduction, Georgia's cash
|
|
139
|
+
* tip exclusion, and Washington's long-term care premium (which subtracts it
|
|
140
|
+
* from wages). So `tipIncome` is sent as `tip_income` and also added to
|
|
141
|
+
* `employment_income`; without the second, tips would be deducted but never
|
|
142
|
+
* taxed. One rule departs from this convention: Florida School Readiness
|
|
143
|
+
* adds `tip_income` to `employment_income` and so counts tips twice
|
|
144
|
+
* (PolicyEngine/policyengine-us#10262).
|
|
145
|
+
*/
|
|
146
|
+
export declare const INCOME_ALSO_ADDED_TO: Readonly<Partial<Record<keyof USPersonIncomes, string>>>;
|
|
147
|
+
/**
|
|
148
|
+
* Person expense fields and the PolicyEngine US input variables they set.
|
|
149
|
+
* Exported for tests and tooling; not part of the package entry points.
|
|
150
|
+
*
|
|
151
|
+
* `mortgageInterest` sets `home_mortgage_interest`, the input. PolicyEngine US
|
|
152
|
+
* computes `mortgage_interest` as the sum of deductible and non-deductible
|
|
153
|
+
* interest, and its federal interest deduction reads the input, so an amount
|
|
154
|
+
* sent as `mortgage_interest` changes no federal deduction. (North Carolina,
|
|
155
|
+
* Hawaii and Alabama rules read the computed total, which includes the input.)
|
|
156
|
+
*/
|
|
157
|
+
export declare const EXPENSE_TO_VARIABLE: Readonly<Record<keyof USPersonExpenses, string>>;
|
|
158
|
+
/**
|
|
159
|
+
* `tippedOccupationCode` is sent as this variable, an integer input whose
|
|
160
|
+
* default 0 means no listed occupation. Only listed codes and 0 are sent.
|
|
161
|
+
* Amounts are sent as entered and checked by `validate()`, but an unlisted
|
|
162
|
+
* code is dropped: the model reads any code above 0 as a listed occupation,
|
|
163
|
+
* so a stray one would claim the deduction.
|
|
164
|
+
*/
|
|
165
|
+
export declare const TIPPED_OCCUPATION_VARIABLE = "treasury_tipped_occupation_code";
|
|
166
|
+
/**
|
|
167
|
+
* Build the PolicyEngine API V1 household payload for a draft. Everyone shares
|
|
168
|
+
* one family, tax unit, SPM unit and household. Check the draft with
|
|
169
|
+
* `validate()` first:
|
|
170
|
+
*
|
|
171
|
+
* - A person with no age is sent without one, and PolicyEngine US then uses
|
|
172
|
+
* its default age of 40 (`validate()` requires ages by default).
|
|
173
|
+
* - SSI amounts are sent only when every person has one. If some are
|
|
174
|
+
* missing, the entered amounts are dropped and the model computes
|
|
175
|
+
* everyone's SSI (`validate()` reports `person.ssiAmount.requiredWhenAnyReceives`).
|
|
176
|
+
*/
|
|
61
177
|
export declare function toV1HouseholdPayload(draft: USHouseholdDraft, options?: ToV1PayloadOptions): V1HouseholdEnvelope;
|
|
62
178
|
/**
|
|
63
179
|
* Convenience that returns just the inner `V1HouseholdSituation` — useful for
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"v1Payload.d.ts","sourceRoot":"","sources":["../../../src/us-household/adapters/v1Payload.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"v1Payload.d.ts","sourceRoot":"","sources":["../../../src/us-household/adapters/v1Payload.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An entered amount as a finite number, or `undefined` when nothing usable was
|
|
3
|
+
* entered. Drafts parsed from JSON or forms can carry numeric strings, null,
|
|
4
|
+
* NaN, or Infinity. `validate()` and the V1 adapter both use this, so they
|
|
5
|
+
* agree on which amounts count as entered.
|
|
6
|
+
*/
|
|
7
|
+
export declare function toAmount(value: unknown): number | undefined;
|
|
8
|
+
//# sourceMappingURL=amount.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"amount.d.ts","sourceRoot":"","sources":["../../src/us-household/amount.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAG3D"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
export type { USHouseholdDraft, USMaritalStatus, USPersonDraft, USPersonFlags, USPersonIncomes, USPersonKind, ValidationIssue, ValidationResult, } from './types';
|
|
1
|
+
export type { USHouseholdDraft, USMaritalStatus, USPersonDraft, USPersonExpenses, USPersonFlags, USPersonIncomes, USPersonKind, USPersonOccupation, ValidationIssue, ValidationResult, } from './types';
|
|
2
2
|
export { DEFAULT_HOUSEHOLD_YEAR, createBlankDraft, cloneDraft, createPerson, addPerson, removePerson, updatePerson, getAdults, getDependents, applyMaritalStatusChange, } from './draft';
|
|
3
3
|
export { normalizeLegacyDraft } from './normalize';
|
|
4
4
|
export { validate, isComplete, type ValidateOptions } from './validate';
|
|
5
5
|
export { serializeDraft, deserializeDraft } from './serialize';
|
|
6
6
|
export { US_STATES, isUSStateCode, getStateName, getStateFromZip, type USState, } from './states';
|
|
7
|
+
export { NOT_A_TIPPED_OCCUPATION, TIPPED_OCCUPATIONS, getTippedOccupation, isTippedOccupationCode, toTippedOccupationCode, type TippedOccupation, } from './tippedOccupations';
|
|
7
8
|
export { getCountiesByState, getCountyName, isCountyCode, resolveCountyCode, type County, } from './counties';
|
|
8
9
|
export { toV1HouseholdPayload, toV1HouseholdSituation, type V1HouseholdEnvelope, type V1HouseholdSituation, type V1ValueMap, type V1FieldValue, type V1PersonRecord, type V1GroupRecord, type V1PersonCollection, type V1GroupCollection, type V1EntityRecord, type V1EntityCollection, type ToV1PayloadOptions, } from './adapters/v1Payload';
|
|
9
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/us-household/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,aAAa,EACb,eAAe,EACf,YAAY,EACZ,eAAe,EACf,gBAAgB,GACjB,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,sBAAsB,EACtB,gBAAgB,EAChB,UAAU,EACV,YAAY,EACZ,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,aAAa,EACb,wBAAwB,GACzB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,YAAY,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/D,OAAO,EACL,SAAS,EACT,aAAa,EACb,YAAY,EACZ,eAAe,EACf,KAAK,OAAO,GACb,MAAM,UAAU,CAAC;AAElB,OAAO,EACL,kBAAkB,EAClB,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,KAAK,MAAM,GACZ,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,GACxB,MAAM,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/us-household/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,eAAe,EACf,YAAY,EACZ,kBAAkB,EAClB,eAAe,EACf,gBAAgB,GACjB,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,sBAAsB,EACtB,gBAAgB,EAChB,UAAU,EACV,YAAY,EACZ,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,aAAa,EACb,wBAAwB,GACzB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,YAAY,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/D,OAAO,EACL,SAAS,EACT,aAAa,EACb,YAAY,EACZ,eAAe,EACf,KAAK,OAAO,GACb,MAAM,UAAU,CAAC;AAElB,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,EACtB,sBAAsB,EACtB,KAAK,gBAAgB,GACtB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,kBAAkB,EAClB,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,KAAK,MAAM,GACZ,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,GACxB,MAAM,sBAAsB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../../src/us-household/normalize.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../../src/us-household/normalize.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,gBAAgB,EAIjB,MAAM,SAAS,CAAC;AAmNjB;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,OAAO,EACZ,OAAO,GAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAO,GAC9B,gBAAgB,CAgGlB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serialize.d.ts","sourceRoot":"","sources":["../../src/us-household/serialize.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAiB,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"serialize.d.ts","sourceRoot":"","sources":["../../src/us-household/serialize.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAiB,MAAM,SAAS,CAAC;AAiG/D,wBAAgB,cAAc,CAAC,KAAK,EAAE,gBAAgB,GAAG,MAAM,CAW9D;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,eAAe,GAAG,gBAAgB,CA6ClF"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Treasury Tipped Occupation Codes (TTOCs): the occupations whose tips can
|
|
3
|
+
* qualify for the federal deduction for qualified tips (26 U.S.C. 224) in tax
|
|
4
|
+
* years 2025 through 2028.
|
|
5
|
+
*
|
|
6
|
+
* Source: Table 1 to paragraph (h) of 26 CFR 1.224-1, "Occupations that
|
|
7
|
+
* Customarily and Regularly Received Tips on or Before December 31, 2024",
|
|
8
|
+
* final regulations T.D. 10044, Internal Revenue Bulletin 2026-18
|
|
9
|
+
* (April 27, 2026), https://www.irs.gov/pub/irs-irbs/irb26-18.pdf. The final
|
|
10
|
+
* table lists 71 occupations; it adds 509, 510 and 810 to the proposed
|
|
11
|
+
* regulations' list (IRB 2025-42) and renames 103, 506 and 606. Labels are the
|
|
12
|
+
* table's occupation titles in sentence case.
|
|
13
|
+
*
|
|
14
|
+
* PolicyEngine US reads the code as `treasury_tipped_occupation_code`, where 0
|
|
15
|
+
* means the person did not receive tips in a listed occupation. Its deduction
|
|
16
|
+
* checks only that the code is above 0, so the code itself does not change
|
|
17
|
+
* results; the list lets apps ask the question the law asks.
|
|
18
|
+
*/
|
|
19
|
+
export interface TippedOccupation {
|
|
20
|
+
/** Treasury Tipped Occupation Code. */
|
|
21
|
+
code: number;
|
|
22
|
+
/** Occupation title, in sentence case. */
|
|
23
|
+
label: string;
|
|
24
|
+
/** The table's category heading, in sentence case. */
|
|
25
|
+
category: string;
|
|
26
|
+
}
|
|
27
|
+
/** The code for "no listed occupation", which PolicyEngine US also uses. */
|
|
28
|
+
export declare const NOT_A_TIPPED_OCCUPATION = 0;
|
|
29
|
+
/** Every listed occupation, in code order. */
|
|
30
|
+
export declare const TIPPED_OCCUPATIONS: ReadonlyArray<TippedOccupation>;
|
|
31
|
+
export declare function getTippedOccupation(code: number): TippedOccupation | undefined;
|
|
32
|
+
export declare function isTippedOccupationCode(code: unknown): code is number;
|
|
33
|
+
/**
|
|
34
|
+
* An entered occupation code as a number the V1 adapter sends: a listed code,
|
|
35
|
+
* or 0 for "not a listed occupation". Strings of decimal digits are read as
|
|
36
|
+
* numbers. Anything else, including codes the table does not list, reads as
|
|
37
|
+
* not answered, so a stray value cannot claim the deduction.
|
|
38
|
+
*/
|
|
39
|
+
export declare function toTippedOccupationCode(value: unknown): number | undefined;
|
|
40
|
+
//# sourceMappingURL=tippedOccupations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tippedOccupations.d.ts","sourceRoot":"","sources":["../../src/us-household/tippedOccupations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,MAAM,WAAW,gBAAgB;IAC/B,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,0CAA0C;IAC1C,KAAK,EAAE,MAAM,CAAC;IACd,sDAAsD;IACtD,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,4EAA4E;AAC5E,eAAO,MAAM,uBAAuB,IAAI,CAAC;AAuFzC,8CAA8C;AAC9C,eAAO,MAAM,kBAAkB,EAAE,aAAa,CAAC,gBAAgB,CAE9D,CAAC;AAIF,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB,GAAG,SAAS,CAE9E;AAED,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,MAAM,CAEpE;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAOzE"}
|
|
@@ -1,33 +1,166 @@
|
|
|
1
1
|
export type USMaritalStatus = 'single' | 'married';
|
|
2
|
+
/**
|
|
3
|
+
* `'dependent'` means claimed as a tax dependent by someone in the household;
|
|
4
|
+
* `'adult'` means not claimed. Choose it from the user's answer, not from age.
|
|
5
|
+
* The V1 adapter sends it for every person as `is_tax_unit_dependent`. It puts
|
|
6
|
+
* everyone in one tax unit, where PolicyEngine US makes the two oldest adults
|
|
7
|
+
* head and spouse. Any other adult is then neither head, spouse nor
|
|
8
|
+
* dependent, and their income counts in the unit's gross income.
|
|
9
|
+
*/
|
|
2
10
|
export type USPersonKind = 'adult' | 'dependent';
|
|
3
11
|
/**
|
|
4
12
|
* Person-level fields that the wizard surfaces uniformly across apps. Apps that
|
|
5
|
-
* do not collect a flag should leave it `undefined
|
|
6
|
-
* `
|
|
13
|
+
* do not collect a flag should leave it `undefined`. The V1 adapter sends only
|
|
14
|
+
* `true` and `false`; for these flags `false` and `undefined` give the same
|
|
15
|
+
* model results, and the difference matters to review screens and links.
|
|
7
16
|
*/
|
|
8
17
|
export interface USPersonFlags {
|
|
9
18
|
isDisabled?: boolean;
|
|
10
19
|
isBlind?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Full-time student at any level. PolicyEngine US counts everyone aged 5 to
|
|
22
|
+
* 17 as a K-12 student by age, so the V1 adapter sends this only from age 18,
|
|
23
|
+
* as full-time college enrollment ("is_full_time_college_student"). Rules
|
|
24
|
+
* for college students (for example SNAP's student rule and New Jersey's
|
|
25
|
+
* exemption for dependents attending college) then count that person.
|
|
26
|
+
*/
|
|
11
27
|
isFullTimeStudent?: boolean;
|
|
12
28
|
isPregnant?: boolean;
|
|
13
29
|
needsCare?: boolean;
|
|
14
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
* Annual amounts in dollars. Fields are additive, so an amount belongs in
|
|
33
|
+
* exactly one field. Each field sets its own PolicyEngine US variable, except
|
|
34
|
+
* that `pensionIncome` and `privatePensionIncome` share one and are summed,
|
|
35
|
+
* and `tipIncome` is also added to wages.
|
|
36
|
+
*/
|
|
15
37
|
export interface USPersonIncomes {
|
|
16
|
-
/**
|
|
38
|
+
/**
|
|
39
|
+
* Wages and salaries, not counting tips entered in `tipIncome`;
|
|
40
|
+
* "employment_income" in PolicyEngine US.
|
|
41
|
+
*/
|
|
17
42
|
employmentIncome?: number;
|
|
43
|
+
/**
|
|
44
|
+
* Tips received as an employee; "tip_income" in PolicyEngine US.
|
|
45
|
+
* PolicyEngine US counts tips as part of wages (`employment_income` is
|
|
46
|
+
* wages "including tips and commissions"), and income and payroll taxes
|
|
47
|
+
* read `employment_income`. A few rules read `tip_income` on its own, such
|
|
48
|
+
* as the federal deduction for qualified tips (2025-2028) and Georgia's cash
|
|
49
|
+
* tip exclusion. So the V1 adapter sends these tips both as `tip_income` and
|
|
50
|
+
* added to `employment_income`. Tips can count for the deduction only with a
|
|
51
|
+
* listed `tippedOccupationCode`. A self-employed worker's tips belong in
|
|
52
|
+
* `selfEmploymentIncome`, which the adapter does not send as `tip_income`.
|
|
53
|
+
*/
|
|
54
|
+
tipIncome?: number;
|
|
55
|
+
/** "self_employment_income" in PolicyEngine US. */
|
|
18
56
|
selfEmploymentIncome?: number;
|
|
57
|
+
/**
|
|
58
|
+
* Social Security retirement benefits; "social_security_retirement" in
|
|
59
|
+
* PolicyEngine US. Put SSDI in `ssdiAmount`, not here: the model adds the two
|
|
60
|
+
* to get total Social Security. Survivors or dependents benefits entered here
|
|
61
|
+
* count as retirement benefits.
|
|
62
|
+
*/
|
|
19
63
|
socialSecurityIncome?: number;
|
|
64
|
+
/**
|
|
65
|
+
* Reported Supplemental Security Income; "ssi" in PolicyEngine US. It
|
|
66
|
+
* replaces the model's own SSI calculation, and that works for a whole
|
|
67
|
+
* household only: an `ssi` input for one person would stop the model from
|
|
68
|
+
* computing everyone else's. So the V1 adapter sends amounts only when every
|
|
69
|
+
* person has one, and `validate()` asks for the missing ones. Enter 0 for a
|
|
70
|
+
* person who receives none; a 0 is always sent, as
|
|
71
|
+
* "takes_up_ssi_if_eligible" false. Leave it blank to let the model compute
|
|
72
|
+
* a person's SSI.
|
|
73
|
+
*/
|
|
20
74
|
ssiAmount?: number;
|
|
75
|
+
/** Social Security Disability Insurance; "social_security_disability" in PolicyEngine US. */
|
|
21
76
|
ssdiAmount?: number;
|
|
77
|
+
/**
|
|
78
|
+
* Taxable pension income whose source the user did not give. The V1 adapter
|
|
79
|
+
* adds it to `privatePensionIncome`. Some states' rules in PolicyEngine US
|
|
80
|
+
* apply only to government pensions (for example, Arizona's public pension
|
|
81
|
+
* exclusion and Minnesota's public pension subtraction), so ask for
|
|
82
|
+
* `publicPensionIncome` when the app can. The adapter never sets the
|
|
83
|
+
* `taxable_pension_income` total: that would leave both components at zero,
|
|
84
|
+
* so rules that read either component would see nothing.
|
|
85
|
+
*/
|
|
22
86
|
pensionIncome?: number;
|
|
87
|
+
/**
|
|
88
|
+
* Taxable pension income from a government employer;
|
|
89
|
+
* "taxable_public_pension_income" in PolicyEngine US. PolicyEngine US also
|
|
90
|
+
* has a separate `taxable_federal_pension_income` input, read by West
|
|
91
|
+
* Virginia's public pension subtraction and (from 2.6.14) Indiana's civil
|
|
92
|
+
* service annuity deduction; the adapter does not set it.
|
|
93
|
+
*/
|
|
94
|
+
publicPensionIncome?: number;
|
|
95
|
+
/**
|
|
96
|
+
* Taxable pension income from a non-government employer;
|
|
97
|
+
* "taxable_private_pension_income" in PolicyEngine US.
|
|
98
|
+
*/
|
|
99
|
+
privatePensionIncome?: number;
|
|
100
|
+
/** Qualified dividends; "qualified_dividend_income" in PolicyEngine US. */
|
|
23
101
|
dividendIncome?: number;
|
|
102
|
+
/**
|
|
103
|
+
* Ordinary dividends that are not qualified;
|
|
104
|
+
* "non_qualified_dividend_income" in PolicyEngine US. Form 1099-DIV's
|
|
105
|
+
* ordinary dividends (box 1a) are the sum of this and `dividendIncome`
|
|
106
|
+
* (box 1b).
|
|
107
|
+
*/
|
|
108
|
+
nonQualifiedDividendIncome?: number;
|
|
109
|
+
/**
|
|
110
|
+
* Net gains on assets held one year or less, negative for a net loss;
|
|
111
|
+
* "short_term_capital_gains" in PolicyEngine US.
|
|
112
|
+
*/
|
|
113
|
+
shortTermCapitalGains?: number;
|
|
114
|
+
/**
|
|
115
|
+
* Net gains on assets held more than one year, negative for a net loss;
|
|
116
|
+
* "long_term_capital_gains" in PolicyEngine US. That variable is computed as
|
|
117
|
+
* gains before behavioral responses plus the response, and PolicyEngine US's
|
|
118
|
+
* Simulation moves an input on it onto
|
|
119
|
+
* `long_term_capital_gains_before_response`, as it does for wages.
|
|
120
|
+
*/
|
|
121
|
+
longTermCapitalGains?: number;
|
|
24
122
|
taxableInterestIncome?: number;
|
|
25
123
|
rentalIncome?: number;
|
|
26
124
|
unemploymentCompensation?: number;
|
|
27
125
|
childSupportReceived?: number;
|
|
28
126
|
miscellaneousIncome?: number;
|
|
29
127
|
}
|
|
30
|
-
|
|
128
|
+
/**
|
|
129
|
+
* Annual amounts paid, in dollars, that PolicyEngine US deducts or credits.
|
|
130
|
+
* Each field sets one PolicyEngine US input variable. Federal deductions sum
|
|
131
|
+
* the tax unit's amounts, so an app that asks about a shared expense once can
|
|
132
|
+
* put it on one adult, ideally the one who pays it or owns the home. Some
|
|
133
|
+
* state rules read a person's own amount: Montana caps real estate taxes per
|
|
134
|
+
* person, and homestead or elderly property tax reductions in Kentucky, Ohio,
|
|
135
|
+
* South Carolina, Mississippi and Tennessee read the owner's (Kentucky) or the
|
|
136
|
+
* head's or spouse's real estate taxes.
|
|
137
|
+
*/
|
|
138
|
+
export interface USPersonExpenses {
|
|
139
|
+
/** Gifts of cash to charity; "charitable_cash_donations" in PolicyEngine US. */
|
|
140
|
+
charitableCashDonations?: number;
|
|
141
|
+
/**
|
|
142
|
+
* Interest paid on a home mortgage; "home_mortgage_interest" in PolicyEngine
|
|
143
|
+
* US. Not "mortgage_interest": that is a computed total of deductible and
|
|
144
|
+
* non-deductible interest, and the federal interest deduction ignores an
|
|
145
|
+
* input on it.
|
|
146
|
+
*/
|
|
147
|
+
mortgageInterest?: number;
|
|
148
|
+
/** Real estate (property) taxes paid; "real_estate_taxes" in PolicyEngine US. */
|
|
149
|
+
realEstateTaxes?: number;
|
|
150
|
+
}
|
|
151
|
+
/** Work details that rules read alongside income. */
|
|
152
|
+
export interface USPersonOccupation {
|
|
153
|
+
/**
|
|
154
|
+
* Treasury Tipped Occupation Code for the occupation in which the person
|
|
155
|
+
* received `tipIncome` (see `TIPPED_OCCUPATIONS`), or 0 if it is not a
|
|
156
|
+
* listed occupation; "treasury_tipped_occupation_code" in PolicyEngine US.
|
|
157
|
+
* Only tips from a listed occupation qualify for the federal deduction for
|
|
158
|
+
* qualified tips. Leave it unset if the user was not asked: PolicyEngine US
|
|
159
|
+
* then reads 0, so tips get no deduction.
|
|
160
|
+
*/
|
|
161
|
+
tippedOccupationCode?: number;
|
|
162
|
+
}
|
|
163
|
+
export interface USPersonDraft extends USPersonFlags, USPersonIncomes, USPersonExpenses, USPersonOccupation {
|
|
31
164
|
/** Stable identifier — used as the person key in the API payload. */
|
|
32
165
|
id: string;
|
|
33
166
|
kind: USPersonKind;
|