@gusto/embedded-react-sdk 0.52.0 → 0.52.2
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/CHANGELOG.md +32 -0
- package/dist/components/Base/Base.d.ts +2 -0
- package/dist/components/Base/Base.js.map +1 -1
- package/dist/components/Common/PaginationControl/PaginationControlTypes.d.ts +4 -1
- package/dist/components/Common/UI/Breadcrumbs/BreadcrumbsTypes.d.ts +1 -1
- package/dist/components/Common/UI/Breadcrumbs/BreadcrumbsTypes.js.map +1 -1
- package/dist/components/Common/UI/CheckboxGroup/CheckboxGroupTypes.d.ts +1 -1
- package/dist/components/Common/UI/CheckboxGroup/CheckboxGroupTypes.js.map +1 -1
- package/dist/components/Common/UI/ComboBox/ComboBoxTypes.d.ts +2 -2
- package/dist/components/Common/UI/DateRangePicker/DateRangePickerTypes.d.ts +3 -2
- package/dist/components/Common/UI/DescriptionList/DescriptionListTypes.d.ts +1 -1
- package/dist/components/Common/UI/DescriptionList/DescriptionListTypes.js.map +1 -1
- package/dist/components/Common/UI/Menu/MenuTypes.d.ts +3 -3
- package/dist/components/Common/UI/Menu/MenuTypes.js.map +1 -1
- package/dist/components/Common/UI/MultiSelectComboBox/MultiSelectComboBoxTypes.d.ts +2 -2
- package/dist/components/Common/UI/RadioGroup/RadioGroupTypes.d.ts +2 -2
- package/dist/components/Common/UI/RadioGroup/RadioGroupTypes.js.map +1 -1
- package/dist/components/Common/UI/Select/SelectTypes.d.ts +2 -2
- package/dist/components/Common/UI/Table/TableTypes.d.ts +4 -4
- package/dist/components/Common/UI/Table/TableTypes.js.map +1 -1
- package/dist/components/Common/UI/Tabs/TabsTypes.d.ts +2 -2
- package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/fields.js +4 -4
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/fields.js +5 -5
- package/dist/components/Company/StateTaxes/stateTaxesStateMachine.d.ts +0 -1
- package/dist/components/Company/StateTaxes/stateTaxesStateMachine.js +12 -14
- package/dist/components/Company/StateTaxes/stateTaxesStateMachine.js.map +1 -1
- package/dist/components/Contractor/Address/Address.js +83 -75
- package/dist/components/Contractor/Address/Address.js.map +1 -1
- package/dist/components/Contractor/ContractorList/index.d.ts +2 -1
- package/dist/components/Contractor/ContractorList/index.js +112 -99
- package/dist/components/Contractor/ContractorList/index.js.map +1 -1
- package/dist/components/Contractor/Documents/SignatureForm/SignatureForm.js +170 -123
- package/dist/components/Contractor/Documents/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Contractor/Documents/SignatureForm/SignatureForm.module.scss.js +12 -0
- package/dist/components/Contractor/Documents/SignatureForm/SignatureForm.module.scss.js.map +1 -0
- package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/fields.js +44 -43
- package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/fields.js.map +1 -1
- package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/useContractorSignatureForm.js +91 -88
- package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/useContractorSignatureForm.js.map +1 -1
- package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/w9Fields.d.ts +0 -33
- package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/w9Fields.js +77 -86
- package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/w9Fields.js.map +1 -1
- package/dist/components/Contractor/OnboardingFlow/OnboardingFlow.d.ts +1 -1
- package/dist/components/Contractor/OnboardingFlow/OnboardingFlow.js.map +1 -1
- package/dist/components/Contractor/OnboardingFlow/OnboardingFlowComponents.d.ts +2 -0
- package/dist/components/Contractor/OnboardingFlow/OnboardingFlowComponents.js.map +1 -1
- package/dist/components/Contractor/OnboardingFlow/onboardingStateMachine.js +150 -80
- package/dist/components/Contractor/OnboardingFlow/onboardingStateMachine.js.map +1 -1
- package/dist/components/Contractor/OnboardingFlow/onboardingStateMachine.test.d.ts +1 -0
- package/dist/components/Contractor/PaymentMethod/shared/useContractorBankAccountForm/fields.js +1 -1
- package/dist/components/Contractor/Profile/BusinessSelfOnboardingProfile.js +19 -18
- package/dist/components/Contractor/Profile/BusinessSelfOnboardingProfile.js.map +1 -1
- package/dist/components/Contractor/Profile/ContractorProfile.d.ts +1 -1
- package/dist/components/Contractor/Profile/ContractorProfile.js +121 -111
- package/dist/components/Contractor/Profile/ContractorProfile.js.map +1 -1
- package/dist/components/Contractor/Profile/IndividualSelfOnboardingProfile.js +27 -26
- package/dist/components/Contractor/Profile/IndividualSelfOnboardingProfile.js.map +1 -1
- package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/fields.js +16 -16
- package/dist/components/Contractor/Submit/Submit.js +127 -67
- package/dist/components/Contractor/Submit/Submit.js.map +1 -1
- package/dist/components/Contractor/shared/useContractorHasSignedW9.d.ts +8 -0
- package/dist/components/Contractor/shared/useContractorHasSignedW9.js +10 -0
- package/dist/components/Contractor/shared/useContractorHasSignedW9.js.map +1 -0
- package/dist/components/Employee/Compensation/shared/useCompensationForm/fields.js +4 -4
- package/dist/components/Employee/Compensation/shared/useJobForm/fields.js +6 -6
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/fields.js +8 -8
- package/dist/components/Employee/Deductions/shared/useDeductionForm/fields.js +4 -4
- package/dist/components/Employee/Documents/shared/useSignEmployeeForm/fields.js +1 -1
- package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/fields.js +4 -4
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/fields.js +1 -1
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/splitFieldFactory.js +4 -4
- package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/fields.js +8 -8
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/fields.js +5 -5
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/useCurrentHomeAddressForm.d.ts +1 -0
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/useCurrentHomeAddressForm.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/fields.js +4 -4
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/useCurrentWorkAddressForm.d.ts +1 -0
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/useCurrentWorkAddressForm.js.map +1 -1
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fieldComponents.js +8 -8
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fields.d.ts +2 -2
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fields.js.map +1 -1
- package/dist/components/index.d.ts +40 -0
- package/dist/contexts/ComponentAdapter/useComponentContext.d.ts +1 -1
- package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
- package/dist/contexts/GustoProvider/GustoProvider.d.ts +1 -0
- package/dist/contexts/GustoProvider/GustoProvider.js.map +1 -1
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.d.ts +1 -0
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/dist/contexts/ThemeProvider/types.d.ts +2 -2
- package/dist/i18n/en/Contractor.Address.json.js +22 -20
- package/dist/i18n/en/Contractor.Address.json.js.map +1 -1
- package/dist/i18n/en/Contractor.ContractorList.json.js +22 -20
- package/dist/i18n/en/Contractor.ContractorList.json.js.map +1 -1
- package/dist/i18n/en/Contractor.Profile.json.js +13 -11
- package/dist/i18n/en/Contractor.Profile.json.js.map +1 -1
- package/dist/i18n/en/Contractor.SignatureForm.json.js +5 -5
- package/dist/i18n/en/Contractor.Submit.json.js +11 -11
- package/dist/i18n/types.d.ts +29 -9
- package/dist/index.d.ts +6 -3
- package/dist/models/WA_RISK_CODES.d.ts +1 -0
- package/dist/models/WA_RISK_CODES.js.map +1 -1
- package/dist/partner-hook-utils/composeErrorHandler.d.ts +4 -0
- package/dist/partner-hook-utils/composeErrorHandler.js.map +1 -1
- package/dist/partner-hook-utils/form/SDKFormProvider.d.ts +1 -0
- package/dist/partner-hook-utils/form/SDKFormProvider.js.map +1 -1
- package/dist/partner-hook-utils/form/composeSubmitHandler.d.ts +4 -0
- package/dist/partner-hook-utils/form/composeSubmitHandler.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/CheckboxHookField.d.ts +1 -0
- package/dist/partner-hook-utils/form/fields/CheckboxHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/DatePickerHookField.d.ts +1 -0
- package/dist/partner-hook-utils/form/fields/DatePickerHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/NumberInputHookField.d.ts +1 -0
- package/dist/partner-hook-utils/form/fields/NumberInputHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/RadioGroupHookField.d.ts +1 -0
- package/dist/partner-hook-utils/form/fields/RadioGroupHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/SelectHookField.d.ts +1 -0
- package/dist/partner-hook-utils/form/fields/SelectHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/SwitchHookField.d.ts +1 -0
- package/dist/partner-hook-utils/form/fields/SwitchHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/TextInputHookField.d.ts +1 -0
- package/dist/partner-hook-utils/form/fields/TextInputHookField.js.map +1 -1
- package/dist/partner-hook-utils/types.d.ts +9 -0
- package/dist/shared/constants.d.ts +10 -0
- package/dist/shared/constants.js +7 -6
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/Helpers.d.ts +2 -0
- package/dist/types/hooks.d.ts +1 -0
- package/dist/types/observability.d.ts +1 -0
- package/docs/guides/endpoint-inventory.json +17 -28
- package/package.json +16 -16
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.52.2](https://github.com/Gusto/embedded-react-sdk/compare/v0.52.1...v0.52.2) (2026-07-17)
|
|
4
|
+
|
|
5
|
+
### Features & Enhancements
|
|
6
|
+
|
|
7
|
+
- The contractor W-9 signature form now shows an on-file SSN/EIN as a masked, disabled field with a "Change SSN"/"Change EIN" button, rather than exposing it as an editable value. ([#2406](https://github.com/Gusto/embedded-react-sdk/issues/2406))
|
|
8
|
+
- While a contractor is mid self-onboarding, the admin's contractor list menu no longer offers "Edit" — only "Cancel self-onboarding" and "Delete" — so the admin must cancel self-onboarding to regain edit access. ([#2407](https://github.com/Gusto/embedded-react-sdk/issues/2407))
|
|
9
|
+
- Admins editing a contractor's profile or address now see a warning when the contractor already has a signed W-9 on file, since the edit will require collecting an updated, signed W-9. ([#2394](https://github.com/Gusto/embedded-react-sdk/issues/2394))
|
|
10
|
+
|
|
11
|
+
### Fixes
|
|
12
|
+
|
|
13
|
+
- Fix `StateTaxes` getting stuck on the list view after clicking "Continue" — state rows are now still editable afterward instead of becoming permanently inert. ([#2416](https://github.com/Gusto/embedded-react-sdk/issues/2416))
|
|
14
|
+
|
|
15
|
+
### Chores & Maintenance
|
|
16
|
+
|
|
17
|
+
- Bump dev dependencies (`@typescript-eslint/parser`, `typescript-eslint`, `eslint-plugin-storybook`, `fuse.js`, `tsx`)
|
|
18
|
+
|
|
19
|
+
## [0.52.1](https://github.com/Gusto/embedded-react-sdk/compare/v0.52.0...v0.52.1) (2026-07-14)
|
|
20
|
+
|
|
21
|
+
### Features & Enhancements
|
|
22
|
+
|
|
23
|
+
- Contractor self-onboarding now mirrors the employee self-onboarding experience, giving contractors a guided flow to complete their own profile, address, and signature steps. ([#2385](https://github.com/Gusto/embedded-react-sdk/issues/2385))
|
|
24
|
+
- The Contractor `Submit` step now lets contractors download their signed W-9. ([#2392](https://github.com/Gusto/embedded-react-sdk/issues/2392))
|
|
25
|
+
|
|
26
|
+
### Fixes
|
|
27
|
+
|
|
28
|
+
- The contractor new hire report is now only triggered during the initial onboarding pass, so re-editing an already-onboarded contractor no longer re-files the report. ([#2386](https://github.com/Gusto/embedded-react-sdk/issues/2386))
|
|
29
|
+
|
|
30
|
+
### Chores & Maintenance
|
|
31
|
+
|
|
32
|
+
- Bump dev dependencies (`storybook` and its addons to 10.5.0, `eslint`, `@eslint/js`, `@typescript-eslint/rule-tester`, `@typescript-eslint/utils`)
|
|
33
|
+
- Bump dependencies (`dompurify`)
|
|
34
|
+
|
|
3
35
|
## [0.52.0](https://github.com/Gusto/embedded-react-sdk/compare/v0.51.2...v0.52.0) (2026-07-10)
|
|
4
36
|
|
|
5
37
|
### ⚠ Breaking Changes
|
|
@@ -9,6 +9,7 @@ import { SDKError } from '../../types/sdkError';
|
|
|
9
9
|
*
|
|
10
10
|
* @typeParam TResourceKey - The i18n resource namespace key whose dictionary entries can be overridden.
|
|
11
11
|
* @public
|
|
12
|
+
* @page blocks
|
|
12
13
|
*/
|
|
13
14
|
export interface CommonComponentInterface<TResourceKey extends keyof Resources = keyof Resources> {
|
|
14
15
|
/** Optional child content rendered inside the component's layout. */
|
|
@@ -37,6 +38,7 @@ export interface CommonComponentInterface<TResourceKey extends keyof Resources =
|
|
|
37
38
|
*
|
|
38
39
|
* @typeParam TResourceKey - The i18n resource namespace key whose dictionary entries can be overridden.
|
|
39
40
|
* @public
|
|
41
|
+
* @page blocks
|
|
40
42
|
*/
|
|
41
43
|
export interface BaseComponentInterface<TResourceKey extends keyof Resources = keyof Resources> extends CommonComponentInterface<TResourceKey> {
|
|
42
44
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Base.js","sources":["../../../src/components/Base/Base.tsx"],"sourcesContent":["import type { ReactNode, JSX, ErrorInfo } from 'react'\nimport { Suspense, useEffect, useRef } from 'react'\nimport type { FallbackProps } from 'react-error-boundary'\nimport { ErrorBoundary } from 'react-error-boundary'\nimport { useTranslation } from 'react-i18next'\nimport { QueryErrorResetBoundary } from '@tanstack/react-query'\nimport { FadeIn } from '../Common/FadeIn/FadeIn'\nimport { BaseContext, type OnEventType } from './useBase'\nimport { useBaseSubmit } from './useBaseSubmit'\nimport { componentEvents, type EventType } from '@/shared/constants'\nimport { InternalError } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport type { ResourceDictionary, Resources } from '@/types/Helpers'\nimport { useLoadingIndicator } from '@/contexts/LoadingIndicatorProvider/useLoadingIndicator'\nimport type { LoadingIndicatorContextProps } from '@/contexts/LoadingIndicatorProvider/useLoadingIndicator'\nimport { useObservability } from '@/contexts/ObservabilityProvider/useObservability'\nimport { normalizeToSDKError, type SDKError } from '@/types/sdkError'\n\n/**\n * Props common to all SDK feature components, including children, an optional className, default form values, and an i18n resource dictionary override.\n *\n * @typeParam TResourceKey - The i18n resource namespace key whose dictionary entries can be overridden.\n * @public\n */\nexport interface CommonComponentInterface<TResourceKey extends keyof Resources = keyof Resources> {\n /** Optional child content rendered inside the component's layout. */\n children?: ReactNode\n /** CSS class name applied to the component's root element. */\n className?: string\n /**\n * Initial values pre-populated into the component's form fields before the user interacts.\n * The exact shape depends on the specific component — refer to each component's own props type.\n */\n defaultValues?: unknown\n /**\n * Overrides for the component's i18n strings. Supply a partial object whose keys match the\n * component's resource namespace — any omitted keys fall back to SDK defaults.\n * See the [Translation guide](https://docs.gusto.com/embedded-payroll/docs/translation) for details.\n */\n dictionary?: ResourceDictionary<TResourceKey>\n}\n\n/**\n * Props for SDK feature components that participate in the standard error/loading/observability surface.\n *\n * @remarks\n * Extends {@link CommonComponentInterface} with the `onEvent` callback that emits component events\n * and optional overrides for the error-boundary fallback and loading indicator. This is the prop\n * shape mixed into every public SDK feature component.\n *\n * @typeParam TResourceKey - The i18n resource namespace key whose dictionary entries can be overridden.\n * @public\n */\nexport interface BaseComponentInterface<\n TResourceKey extends keyof Resources = keyof Resources,\n> extends CommonComponentInterface<TResourceKey> {\n /**\n * Custom React component rendered in place of the component when an unhandled error is caught\n * by the component-level error boundary. Receives `error` and `resetErrorBoundary` as props.\n * Defaults to the SDK's built-in `InternalError` fallback.\n */\n FallbackComponent?: (props: FallbackProps) => JSX.Element\n /**\n * Custom loading indicator rendered while the component's async data is fetching.\n * Overrides the indicator configured on `GustoProvider` for this component instance only.\n */\n LoaderComponent?: ({ children }: { children?: ReactNode }) => JSX.Element\n /**\n * Callback invoked each time the component emits an event — user interactions, successful API\n * responses, step transitions, or errors. Receives the event type constant and an optional\n * payload whose shape varies by event. See the [Event Handling guide](https://docs.gusto.com/embedded-payroll/docs/event-handling)\n * and each component's event table for the full list of emitted events.\n */\n onEvent: OnEventType<EventType, unknown>\n}\n\n/**\n * Keys unique to the BaseComponentInterface\n *\n * @internal\n */\nexport type BaseComponentKeys = Exclude<\n keyof BaseComponentInterface,\n keyof CommonComponentInterface\n>\n\ninterface InternalBaseComponentProps {\n componentName?: string\n}\n\n/**\n * Wraps SDK feature components with the standard error boundary, suspense fallback, form-submission handler, and observability wiring.\n *\n * @remarks\n * Provides a {@link BaseContext} value to descendants exposing `error`, `setError`, `onEvent`, and\n * `baseSubmitHandler`, then renders children inside {@link BaseBoundaries} and {@link BaseLayout}.\n * Errors caught by the React error boundary are normalized, emitted to observability, and re-emitted\n * via `onEvent`.\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `componentEvents.ERROR` | Emitted when an unhandled rendering error is caught by the component's error boundary | The raw error value caught by the boundary |\n *\n * @typeParam TResourceKey - The i18n resource namespace key whose dictionary entries can be overridden.\n * @param props - Component props extending {@link BaseComponentInterface}.\n * @returns A React element wrapping `children` with the SDK's standard error, loading, and event-emission surface.\n * @internal\n */\nexport const BaseComponent = <TResourceKey extends keyof Resources = keyof Resources>({\n children,\n FallbackComponent = InternalError,\n LoaderComponent: LoadingIndicatorFromProps,\n onEvent,\n componentName,\n}: BaseComponentInterface<TResourceKey> & InternalBaseComponentProps) => {\n const { error, baseSubmitHandler, setError } = useBaseSubmit(componentName)\n const { observability } = useObservability()\n\n const { LoadingIndicator: LoadingIndicatorFromContext } = useLoadingIndicator()\n const LoaderComponent = LoadingIndicatorFromProps ?? LoadingIndicatorFromContext\n\n const onErrorBoundaryError = (boundaryError: unknown, errorInfo: ErrorInfo) => {\n onEvent(componentEvents.ERROR, boundaryError)\n\n const sdkError = normalizeToSDKError(boundaryError)\n\n observability?.onError?.({\n ...sdkError,\n timestamp: Date.now(),\n componentName,\n componentStack: errorInfo.componentStack ?? undefined,\n })\n }\n\n return (\n <BaseContext.Provider\n value={{\n error,\n setError,\n onEvent,\n baseSubmitHandler,\n LoadingIndicator: LoaderComponent,\n componentName,\n }}\n >\n <BaseBoundaries\n FallbackComponent={FallbackComponent}\n onErrorBoundaryError={onErrorBoundaryError}\n componentName={componentName}\n >\n <BaseLayout error={error}>{children}</BaseLayout>\n </BaseBoundaries>\n </BaseContext.Provider>\n )\n}\n\n/** @internal */\nexport interface BaseLayoutProps {\n children?: ReactNode\n error?: SDKError | SDKError[] | null\n isLoading?: boolean\n}\n\nfunction SingleErrorContent({ error }: { error: SDKError }) {\n const Components = useComponentContext()\n const { t } = useTranslation()\n const hasFieldErrors = error.fieldErrors.length > 0\n\n return (\n <Components.Alert label={t('status.errorEncountered')} status=\"error\">\n {hasFieldErrors && (\n <Components.UnorderedList\n items={error.fieldErrors\n .filter(fieldError => fieldError.message)\n .map(fieldError => (\n <span key={fieldError.field}>{fieldError.message}</span>\n ))}\n />\n )}\n {!hasFieldErrors && error.category === 'validation_error' && (\n <Components.Text as=\"pre\">\n {error.raw &&\n typeof error.raw === 'object' &&\n 'pretty' in error.raw &&\n typeof (error.raw as { pretty: unknown }).pretty === 'function'\n ? (error.raw as { pretty: () => string }).pretty()\n : error.message}\n </Components.Text>\n )}\n {!hasFieldErrors && error.category !== 'validation_error' && (\n <Components.Text>{error.message || t('errors.unknownError')}</Components.Text>\n )}\n </Components.Alert>\n )\n}\n\nfunction MultipleErrorsContent({ errors }: { errors: SDKError[] }) {\n const Components = useComponentContext()\n const { t } = useTranslation()\n\n return (\n <Components.Alert label={t('status.multipleErrorsEncountered')} status=\"error\">\n <Components.UnorderedList\n items={errors\n .filter(error => error.message || error.fieldErrors.length > 0)\n .map((error, index) => {\n const visibleFieldErrors = error.fieldErrors.filter(fieldError => fieldError.message)\n\n if (visibleFieldErrors.length === 0) {\n return <span key={index}>{error.message || t('errors.unknownError')}</span>\n }\n\n return (\n <span key={index}>\n {error.message || t('errors.unknownError')}\n <Components.UnorderedList\n items={visibleFieldErrors.map(fieldError => (\n <span key={fieldError.field}>{fieldError.message}</span>\n ))}\n />\n </span>\n )\n })}\n />\n </Components.Alert>\n )\n}\n\n/**\n * Renders the standard SDK layout with normalized error display, suspense-aware loading state, and the children content.\n *\n * @remarks\n * When `isLoading` is true and there are no errors, renders the configured loading indicator.\n * Otherwise renders a fade-in wrapper that displays a single error alert, an aggregated alert when\n * multiple errors are present, or no alert when errors are absent. Field-level errors are rendered\n * as a list, validation errors as preformatted Zod output, and all other errors as a generic\n * message — see {@link https://github.com/Gusto/embedded-react-sdk/blob/main/docs/integration-guide/error-handling.md | the Error Handling guide}.\n *\n * @param props - Component props matching {@link BaseLayoutProps}.\n * @returns A React element with the SDK's standard error rendering and loading behavior wrapped around `children`.\n * @internal\n */\nexport const BaseLayout = ({ children, error, isLoading }: BaseLayoutProps) => {\n const { LoadingIndicator } = useLoadingIndicator()\n\n const errors = Array.isArray(error) ? error : error ? [error] : []\n const hasErrors = errors.length > 0\n\n if (isLoading && !hasErrors) {\n return <LoadingIndicator />\n }\n\n const [firstError] = errors\n\n return (\n <FadeIn>\n {errors.length > 1 && <MultipleErrorsContent errors={errors} />}\n {errors.length === 1 && firstError && <SingleErrorContent error={firstError} />}\n {children}\n </FadeIn>\n )\n}\n\ninterface LoaderWithMetricsProps {\n LoaderComponent: LoadingIndicatorContextProps['LoadingIndicator']\n observability: ReturnType<typeof useObservability>['observability']\n componentName?: string\n}\n\nconst LoaderWithMetrics = ({\n LoaderComponent,\n observability,\n componentName,\n}: LoaderWithMetricsProps) => {\n const loadingStartTime = useRef(Date.now())\n const observabilityRef = useRef(observability)\n const componentNameRef = useRef(componentName)\n\n useEffect(() => {\n observabilityRef.current = observability\n componentNameRef.current = componentName\n }, [observability, componentName])\n\n useEffect(() => {\n return () => {\n const duration = Date.now() - loadingStartTime.current\n observabilityRef.current?.onMetric?.({\n name: 'sdk.component.loading_duration',\n value: duration,\n unit: 'ms',\n tags: componentNameRef.current ? { component: componentNameRef.current } : undefined,\n timestamp: Date.now(),\n })\n }\n }, [])\n\n return <LoaderComponent />\n}\n\nfunction SuspenseFallback({ componentName }: { componentName?: string }) {\n const { LoadingIndicator } = useLoadingIndicator()\n const { observability } = useObservability()\n return (\n <LoaderWithMetrics\n LoaderComponent={LoadingIndicator}\n observability={observability}\n componentName={componentName}\n />\n )\n}\n\n/** @internal */\nexport interface BaseBoundariesProps {\n children?: ReactNode\n FallbackComponent?: (props: FallbackProps) => JSX.Element\n onErrorBoundaryError?: (error: unknown, info: ErrorInfo) => void\n componentName?: string\n}\n\n/**\n * Composes the SDK's React error boundary, TanStack Query reset boundary, and Suspense fallback around children.\n *\n * @remarks\n * Resetting the error boundary also resets any TanStack Query errors so suspended queries refetch\n * cleanly. While children suspend, a metrics-instrumented loading indicator is rendered that emits\n * an `sdk.component.loading_duration` observability metric on unmount.\n *\n * @param props - Component props matching {@link BaseBoundariesProps}.\n * @returns A React element wrapping `children` with the SDK's error and suspense boundaries.\n * @internal\n */\nexport const BaseBoundaries = ({\n children,\n FallbackComponent = InternalError,\n onErrorBoundaryError,\n componentName,\n}: BaseBoundariesProps) => {\n return (\n <QueryErrorResetBoundary>\n {({ reset: resetQueries }) => (\n <ErrorBoundary\n FallbackComponent={FallbackComponent}\n onReset={resetQueries}\n onError={onErrorBoundaryError}\n >\n <Suspense fallback={<SuspenseFallback componentName={componentName} />}>\n {children}\n </Suspense>\n </ErrorBoundary>\n )}\n </QueryErrorResetBoundary>\n )\n}\n"],"names":["BaseComponent","children","FallbackComponent","InternalError","LoadingIndicatorFromProps","onEvent","componentName","error","baseSubmitHandler","setError","useBaseSubmit","observability","useObservability","LoadingIndicatorFromContext","useLoadingIndicator","LoaderComponent","onErrorBoundaryError","boundaryError","errorInfo","componentEvents","sdkError","normalizeToSDKError","jsx","BaseContext","BaseBoundaries","BaseLayout","SingleErrorContent","Components","useComponentContext","t","useTranslation","hasFieldErrors","jsxs","fieldError","MultipleErrorsContent","errors","index","visibleFieldErrors","isLoading","LoadingIndicator","hasErrors","firstError","FadeIn","LoaderWithMetrics","loadingStartTime","useRef","observabilityRef","componentNameRef","useEffect","duration","SuspenseFallback","QueryErrorResetBoundary","resetQueries","ErrorBoundary","Suspense"],"mappings":";;;;;;;;;;;;;;AA6GO,MAAMA,IAAgB,CAAyD;AAAA,EACpF,UAAAC;AAAA,EACA,mBAAAC,IAAoBC;AAAA,EACpB,iBAAiBC;AAAA,EACjB,SAAAC;AAAA,EACA,eAAAC;AACF,MAAyE;AACvE,QAAM,EAAE,OAAAC,GAAO,mBAAAC,GAAmB,UAAAC,EAAA,IAAaC,EAAcJ,CAAa,GACpE,EAAE,eAAAK,EAAA,IAAkBC,EAAA,GAEpB,EAAE,kBAAkBC,EAAA,IAAgCC,EAAA,GACpDC,IAAkBX,KAA6BS,GAE/CG,IAAuB,CAACC,GAAwBC,MAAyB;AAC7E,IAAAb,EAAQc,EAAgB,OAAOF,CAAa;AAE5C,UAAMG,IAAWC,EAAoBJ,CAAa;AAElD,IAAAN,GAAe,UAAU;AAAA,MACvB,GAAGS;AAAA,MACH,WAAW,KAAK,IAAA;AAAA,MAChB,eAAAd;AAAA,MACA,gBAAgBY,EAAU,kBAAkB;AAAA,IAAA,CAC7C;AAAA,EACH;AAEA,SACE,gBAAAI;AAAA,IAACC,EAAY;AAAA,IAAZ;AAAA,MACC,OAAO;AAAA,QACL,OAAAhB;AAAA,QACA,UAAAE;AAAA,QACA,SAAAJ;AAAA,QACA,mBAAAG;AAAA,QACA,kBAAkBO;AAAA,QAClB,eAAAT;AAAA,MAAA;AAAA,MAGF,UAAA,gBAAAgB;AAAA,QAACE;AAAA,QAAA;AAAA,UACC,mBAAAtB;AAAA,UACA,sBAAAc;AAAA,UACA,eAAAV;AAAA,UAEA,UAAA,gBAAAgB,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":["../../../src/components/Base/Base.tsx"],"sourcesContent":["import type { ReactNode, JSX, ErrorInfo } from 'react'\nimport { Suspense, useEffect, useRef } from 'react'\nimport type { FallbackProps } from 'react-error-boundary'\nimport { ErrorBoundary } from 'react-error-boundary'\nimport { useTranslation } from 'react-i18next'\nimport { QueryErrorResetBoundary } from '@tanstack/react-query'\nimport { FadeIn } from '../Common/FadeIn/FadeIn'\nimport { BaseContext, type OnEventType } from './useBase'\nimport { useBaseSubmit } from './useBaseSubmit'\nimport { componentEvents, type EventType } from '@/shared/constants'\nimport { InternalError } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport type { ResourceDictionary, Resources } from '@/types/Helpers'\nimport { useLoadingIndicator } from '@/contexts/LoadingIndicatorProvider/useLoadingIndicator'\nimport type { LoadingIndicatorContextProps } from '@/contexts/LoadingIndicatorProvider/useLoadingIndicator'\nimport { useObservability } from '@/contexts/ObservabilityProvider/useObservability'\nimport { normalizeToSDKError, type SDKError } from '@/types/sdkError'\n\n/**\n * Props common to all SDK feature components, including children, an optional className, default form values, and an i18n resource dictionary override.\n *\n * @typeParam TResourceKey - The i18n resource namespace key whose dictionary entries can be overridden.\n * @public\n * @page blocks\n */\nexport interface CommonComponentInterface<TResourceKey extends keyof Resources = keyof Resources> {\n /** Optional child content rendered inside the component's layout. */\n children?: ReactNode\n /** CSS class name applied to the component's root element. */\n className?: string\n /**\n * Initial values pre-populated into the component's form fields before the user interacts.\n * The exact shape depends on the specific component — refer to each component's own props type.\n */\n defaultValues?: unknown\n /**\n * Overrides for the component's i18n strings. Supply a partial object whose keys match the\n * component's resource namespace — any omitted keys fall back to SDK defaults.\n * See the [Translation guide](https://docs.gusto.com/embedded-payroll/docs/translation) for details.\n */\n dictionary?: ResourceDictionary<TResourceKey>\n}\n\n/**\n * Props for SDK feature components that participate in the standard error/loading/observability surface.\n *\n * @remarks\n * Extends {@link CommonComponentInterface} with the `onEvent` callback that emits component events\n * and optional overrides for the error-boundary fallback and loading indicator. This is the prop\n * shape mixed into every public SDK feature component.\n *\n * @typeParam TResourceKey - The i18n resource namespace key whose dictionary entries can be overridden.\n * @public\n * @page blocks\n */\nexport interface BaseComponentInterface<\n TResourceKey extends keyof Resources = keyof Resources,\n> extends CommonComponentInterface<TResourceKey> {\n /**\n * Custom React component rendered in place of the component when an unhandled error is caught\n * by the component-level error boundary. Receives `error` and `resetErrorBoundary` as props.\n * Defaults to the SDK's built-in `InternalError` fallback.\n */\n FallbackComponent?: (props: FallbackProps) => JSX.Element\n /**\n * Custom loading indicator rendered while the component's async data is fetching.\n * Overrides the indicator configured on `GustoProvider` for this component instance only.\n */\n LoaderComponent?: ({ children }: { children?: ReactNode }) => JSX.Element\n /**\n * Callback invoked each time the component emits an event — user interactions, successful API\n * responses, step transitions, or errors. Receives the event type constant and an optional\n * payload whose shape varies by event. See the [Event Handling guide](https://docs.gusto.com/embedded-payroll/docs/event-handling)\n * and each component's event table for the full list of emitted events.\n */\n onEvent: OnEventType<EventType, unknown>\n}\n\n/**\n * Keys unique to the BaseComponentInterface\n *\n * @internal\n */\nexport type BaseComponentKeys = Exclude<\n keyof BaseComponentInterface,\n keyof CommonComponentInterface\n>\n\ninterface InternalBaseComponentProps {\n componentName?: string\n}\n\n/**\n * Wraps SDK feature components with the standard error boundary, suspense fallback, form-submission handler, and observability wiring.\n *\n * @remarks\n * Provides a {@link BaseContext} value to descendants exposing `error`, `setError`, `onEvent`, and\n * `baseSubmitHandler`, then renders children inside {@link BaseBoundaries} and {@link BaseLayout}.\n * Errors caught by the React error boundary are normalized, emitted to observability, and re-emitted\n * via `onEvent`.\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `componentEvents.ERROR` | Emitted when an unhandled rendering error is caught by the component's error boundary | The raw error value caught by the boundary |\n *\n * @typeParam TResourceKey - The i18n resource namespace key whose dictionary entries can be overridden.\n * @param props - Component props extending {@link BaseComponentInterface}.\n * @returns A React element wrapping `children` with the SDK's standard error, loading, and event-emission surface.\n * @internal\n */\nexport const BaseComponent = <TResourceKey extends keyof Resources = keyof Resources>({\n children,\n FallbackComponent = InternalError,\n LoaderComponent: LoadingIndicatorFromProps,\n onEvent,\n componentName,\n}: BaseComponentInterface<TResourceKey> & InternalBaseComponentProps) => {\n const { error, baseSubmitHandler, setError } = useBaseSubmit(componentName)\n const { observability } = useObservability()\n\n const { LoadingIndicator: LoadingIndicatorFromContext } = useLoadingIndicator()\n const LoaderComponent = LoadingIndicatorFromProps ?? LoadingIndicatorFromContext\n\n const onErrorBoundaryError = (boundaryError: unknown, errorInfo: ErrorInfo) => {\n onEvent(componentEvents.ERROR, boundaryError)\n\n const sdkError = normalizeToSDKError(boundaryError)\n\n observability?.onError?.({\n ...sdkError,\n timestamp: Date.now(),\n componentName,\n componentStack: errorInfo.componentStack ?? undefined,\n })\n }\n\n return (\n <BaseContext.Provider\n value={{\n error,\n setError,\n onEvent,\n baseSubmitHandler,\n LoadingIndicator: LoaderComponent,\n componentName,\n }}\n >\n <BaseBoundaries\n FallbackComponent={FallbackComponent}\n onErrorBoundaryError={onErrorBoundaryError}\n componentName={componentName}\n >\n <BaseLayout error={error}>{children}</BaseLayout>\n </BaseBoundaries>\n </BaseContext.Provider>\n )\n}\n\n/** @internal */\nexport interface BaseLayoutProps {\n children?: ReactNode\n error?: SDKError | SDKError[] | null\n isLoading?: boolean\n}\n\nfunction SingleErrorContent({ error }: { error: SDKError }) {\n const Components = useComponentContext()\n const { t } = useTranslation()\n const hasFieldErrors = error.fieldErrors.length > 0\n\n return (\n <Components.Alert label={t('status.errorEncountered')} status=\"error\">\n {hasFieldErrors && (\n <Components.UnorderedList\n items={error.fieldErrors\n .filter(fieldError => fieldError.message)\n .map(fieldError => (\n <span key={fieldError.field}>{fieldError.message}</span>\n ))}\n />\n )}\n {!hasFieldErrors && error.category === 'validation_error' && (\n <Components.Text as=\"pre\">\n {error.raw &&\n typeof error.raw === 'object' &&\n 'pretty' in error.raw &&\n typeof (error.raw as { pretty: unknown }).pretty === 'function'\n ? (error.raw as { pretty: () => string }).pretty()\n : error.message}\n </Components.Text>\n )}\n {!hasFieldErrors && error.category !== 'validation_error' && (\n <Components.Text>{error.message || t('errors.unknownError')}</Components.Text>\n )}\n </Components.Alert>\n )\n}\n\nfunction MultipleErrorsContent({ errors }: { errors: SDKError[] }) {\n const Components = useComponentContext()\n const { t } = useTranslation()\n\n return (\n <Components.Alert label={t('status.multipleErrorsEncountered')} status=\"error\">\n <Components.UnorderedList\n items={errors\n .filter(error => error.message || error.fieldErrors.length > 0)\n .map((error, index) => {\n const visibleFieldErrors = error.fieldErrors.filter(fieldError => fieldError.message)\n\n if (visibleFieldErrors.length === 0) {\n return <span key={index}>{error.message || t('errors.unknownError')}</span>\n }\n\n return (\n <span key={index}>\n {error.message || t('errors.unknownError')}\n <Components.UnorderedList\n items={visibleFieldErrors.map(fieldError => (\n <span key={fieldError.field}>{fieldError.message}</span>\n ))}\n />\n </span>\n )\n })}\n />\n </Components.Alert>\n )\n}\n\n/**\n * Renders the standard SDK layout with normalized error display, suspense-aware loading state, and the children content.\n *\n * @remarks\n * When `isLoading` is true and there are no errors, renders the configured loading indicator.\n * Otherwise renders a fade-in wrapper that displays a single error alert, an aggregated alert when\n * multiple errors are present, or no alert when errors are absent. Field-level errors are rendered\n * as a list, validation errors as preformatted Zod output, and all other errors as a generic\n * message — see {@link https://github.com/Gusto/embedded-react-sdk/blob/main/docs/integration-guide/error-handling.md | the Error Handling guide}.\n *\n * @param props - Component props matching {@link BaseLayoutProps}.\n * @returns A React element with the SDK's standard error rendering and loading behavior wrapped around `children`.\n * @internal\n */\nexport const BaseLayout = ({ children, error, isLoading }: BaseLayoutProps) => {\n const { LoadingIndicator } = useLoadingIndicator()\n\n const errors = Array.isArray(error) ? error : error ? [error] : []\n const hasErrors = errors.length > 0\n\n if (isLoading && !hasErrors) {\n return <LoadingIndicator />\n }\n\n const [firstError] = errors\n\n return (\n <FadeIn>\n {errors.length > 1 && <MultipleErrorsContent errors={errors} />}\n {errors.length === 1 && firstError && <SingleErrorContent error={firstError} />}\n {children}\n </FadeIn>\n )\n}\n\ninterface LoaderWithMetricsProps {\n LoaderComponent: LoadingIndicatorContextProps['LoadingIndicator']\n observability: ReturnType<typeof useObservability>['observability']\n componentName?: string\n}\n\nconst LoaderWithMetrics = ({\n LoaderComponent,\n observability,\n componentName,\n}: LoaderWithMetricsProps) => {\n const loadingStartTime = useRef(Date.now())\n const observabilityRef = useRef(observability)\n const componentNameRef = useRef(componentName)\n\n useEffect(() => {\n observabilityRef.current = observability\n componentNameRef.current = componentName\n }, [observability, componentName])\n\n useEffect(() => {\n return () => {\n const duration = Date.now() - loadingStartTime.current\n observabilityRef.current?.onMetric?.({\n name: 'sdk.component.loading_duration',\n value: duration,\n unit: 'ms',\n tags: componentNameRef.current ? { component: componentNameRef.current } : undefined,\n timestamp: Date.now(),\n })\n }\n }, [])\n\n return <LoaderComponent />\n}\n\nfunction SuspenseFallback({ componentName }: { componentName?: string }) {\n const { LoadingIndicator } = useLoadingIndicator()\n const { observability } = useObservability()\n return (\n <LoaderWithMetrics\n LoaderComponent={LoadingIndicator}\n observability={observability}\n componentName={componentName}\n />\n )\n}\n\n/** @internal */\nexport interface BaseBoundariesProps {\n children?: ReactNode\n FallbackComponent?: (props: FallbackProps) => JSX.Element\n onErrorBoundaryError?: (error: unknown, info: ErrorInfo) => void\n componentName?: string\n}\n\n/**\n * Composes the SDK's React error boundary, TanStack Query reset boundary, and Suspense fallback around children.\n *\n * @remarks\n * Resetting the error boundary also resets any TanStack Query errors so suspended queries refetch\n * cleanly. While children suspend, a metrics-instrumented loading indicator is rendered that emits\n * an `sdk.component.loading_duration` observability metric on unmount.\n *\n * @param props - Component props matching {@link BaseBoundariesProps}.\n * @returns A React element wrapping `children` with the SDK's error and suspense boundaries.\n * @internal\n */\nexport const BaseBoundaries = ({\n children,\n FallbackComponent = InternalError,\n onErrorBoundaryError,\n componentName,\n}: BaseBoundariesProps) => {\n return (\n <QueryErrorResetBoundary>\n {({ reset: resetQueries }) => (\n <ErrorBoundary\n FallbackComponent={FallbackComponent}\n onReset={resetQueries}\n onError={onErrorBoundaryError}\n >\n <Suspense fallback={<SuspenseFallback componentName={componentName} />}>\n {children}\n </Suspense>\n </ErrorBoundary>\n )}\n </QueryErrorResetBoundary>\n )\n}\n"],"names":["BaseComponent","children","FallbackComponent","InternalError","LoadingIndicatorFromProps","onEvent","componentName","error","baseSubmitHandler","setError","useBaseSubmit","observability","useObservability","LoadingIndicatorFromContext","useLoadingIndicator","LoaderComponent","onErrorBoundaryError","boundaryError","errorInfo","componentEvents","sdkError","normalizeToSDKError","jsx","BaseContext","BaseBoundaries","BaseLayout","SingleErrorContent","Components","useComponentContext","t","useTranslation","hasFieldErrors","jsxs","fieldError","MultipleErrorsContent","errors","index","visibleFieldErrors","isLoading","LoadingIndicator","hasErrors","firstError","FadeIn","LoaderWithMetrics","loadingStartTime","useRef","observabilityRef","componentNameRef","useEffect","duration","SuspenseFallback","QueryErrorResetBoundary","resetQueries","ErrorBoundary","Suspense"],"mappings":";;;;;;;;;;;;;;AA+GO,MAAMA,IAAgB,CAAyD;AAAA,EACpF,UAAAC;AAAA,EACA,mBAAAC,IAAoBC;AAAA,EACpB,iBAAiBC;AAAA,EACjB,SAAAC;AAAA,EACA,eAAAC;AACF,MAAyE;AACvE,QAAM,EAAE,OAAAC,GAAO,mBAAAC,GAAmB,UAAAC,EAAA,IAAaC,EAAcJ,CAAa,GACpE,EAAE,eAAAK,EAAA,IAAkBC,EAAA,GAEpB,EAAE,kBAAkBC,EAAA,IAAgCC,EAAA,GACpDC,IAAkBX,KAA6BS,GAE/CG,IAAuB,CAACC,GAAwBC,MAAyB;AAC7E,IAAAb,EAAQc,EAAgB,OAAOF,CAAa;AAE5C,UAAMG,IAAWC,EAAoBJ,CAAa;AAElD,IAAAN,GAAe,UAAU;AAAA,MACvB,GAAGS;AAAA,MACH,WAAW,KAAK,IAAA;AAAA,MAChB,eAAAd;AAA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AC;AAAA,EAC7B,UAAAvB;AAAA,EACA,mBAAAC,IAAoBC;AAAA,EACpB,sBAAAa;AAAA,EACA,eAAAV;AACF,wBAEK6C,GAAA,EACE,UAAA,CAAC,EAAE,OAAOC,QACT,gBAAA9B;AAAA,EAAC+B;AAAA,EAAA;AAAA,IACC,mBAAAnD;AAAA,IACA,SAASkD;AAAA,IACT,SAASpC;AAAA,IAET,4BAACsC,GAAA,EAAS,4BAAWJ,GAAA,EAAiB,eAAA5C,GAA8B,GACjE,UAAAL,EAAA,CACH;AAAA,EAAA;AAAA,GAGN;"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* Allowed page-size values a {@link PaginationControlProps | PaginationControl} offers for
|
|
3
|
+
* how many items to show per page.
|
|
4
|
+
*
|
|
2
5
|
* @public
|
|
3
|
-
* @
|
|
6
|
+
* @childOf {@link PaginationControlProps}
|
|
4
7
|
*/
|
|
5
8
|
export type PaginationItemsPerPage = 5 | 10 | 25 | 50;
|
|
6
9
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BreadcrumbsTypes.js","sources":["../../../../../src/components/Common/UI/Breadcrumbs/BreadcrumbsTypes.ts"],"sourcesContent":["import type { ReactNode } from 'react'\n\n/**\n * Single entry in a {@link BreadcrumbsProps | Breadcrumbs} trail.\n *\n * @public\n * @
|
|
1
|
+
{"version":3,"file":"BreadcrumbsTypes.js","sources":["../../../../../src/components/Common/UI/Breadcrumbs/BreadcrumbsTypes.ts"],"sourcesContent":["import type { ReactNode } from 'react'\n\n/**\n * Single entry in a {@link BreadcrumbsProps | Breadcrumbs} trail.\n *\n * @public\n * @childOf {@link BreadcrumbsProps}\n */\nexport interface Breadcrumb {\n /**\n * Unique identifier for the breadcrumb. Matches against `currentBreadcrumbId` and is passed to `onClick`.\n */\n id: string\n /**\n * Display content rendered for the breadcrumb.\n */\n label: ReactNode\n /**\n * When false, the breadcrumb is rendered as plain text even if onClick is provided.\n * Defaults to true.\n */\n isClickable?: boolean\n}\n/**\n * Props your `Breadcrumbs` implementation must accept from the component adapter.\n * Renders a navigation breadcrumb trail showing the user's position in a multi-step flow.\n *\n * @public\n * @group Component props\n */\nexport interface BreadcrumbsProps {\n /**\n * Array of breadcrumbs\n */\n breadcrumbs: Breadcrumb[]\n /**\n * Current breadcrumb id\n */\n currentBreadcrumbId?: string\n /**\n * Accessibility label for the breadcrumbs\n *\n * @defaultValue `'Breadcrumbs'`\n */\n 'aria-label'?: string\n /**\n * Additional CSS class name for the breadcrumbs container\n */\n className?: string\n /**\n * Event handler for breadcrumb navigation\n */\n onClick?: (id: string) => void\n /**\n * Passed to the breadcrumbs when the container size is small (640px and below)\n * At this size, the breadcrumb typically does not have sufficient size to render\n * completely. In our implementation, we switch to a condensed mobile version of\n * the breadcrumbs\n *\n * @defaultValue `false`\n */\n isSmallContainer?: boolean\n}\n\n/**\n * Default prop values for Breadcrumbs component.\n *\n * @internal\n */\nexport const BreadcrumbsDefaults = {\n isSmallContainer: false,\n 'aria-label': 'Breadcrumbs',\n} as const satisfies Partial<BreadcrumbsProps>\n"],"names":["BreadcrumbsDefaults"],"mappings":"AAqEO,MAAMA,IAAsB;AAAA,EACjC,kBAAkB;AAAA,EAClB,cAAc;AAChB;"}
|
|
@@ -4,7 +4,7 @@ import { SharedFieldLayoutProps } from '../../FieldLayout/FieldLayoutTypes';
|
|
|
4
4
|
* Option entry rendered as a single checkbox within a {@link CheckboxGroupProps | CheckboxGroup}.
|
|
5
5
|
*
|
|
6
6
|
* @public
|
|
7
|
-
* @
|
|
7
|
+
* @childOf {@link CheckboxGroupProps}
|
|
8
8
|
*/
|
|
9
9
|
export interface CheckboxGroupOption {
|
|
10
10
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxGroupTypes.js","sources":["../../../../../src/components/Common/UI/CheckboxGroup/CheckboxGroupTypes.ts"],"sourcesContent":["import type { FieldsetHTMLAttributes, Ref } from 'react'\nimport type { SharedFieldLayoutProps } from '@/components/Common/FieldLayout/FieldLayoutTypes'\n\n/**\n * Option entry rendered as a single checkbox within a {@link CheckboxGroupProps | CheckboxGroup}.\n *\n * @public\n * @
|
|
1
|
+
{"version":3,"file":"CheckboxGroupTypes.js","sources":["../../../../../src/components/Common/UI/CheckboxGroup/CheckboxGroupTypes.ts"],"sourcesContent":["import type { FieldsetHTMLAttributes, Ref } from 'react'\nimport type { SharedFieldLayoutProps } from '@/components/Common/FieldLayout/FieldLayoutTypes'\n\n/**\n * Option entry rendered as a single checkbox within a {@link CheckboxGroupProps | CheckboxGroup}.\n *\n * @public\n * @childOf {@link CheckboxGroupProps}\n */\nexport interface CheckboxGroupOption {\n /**\n * Label text or content for the checkbox option\n */\n label: React.ReactNode\n /**\n * Value of the option that will be passed to onChange\n */\n value: string\n /**\n * Disables this specific checkbox option\n */\n isDisabled?: boolean\n /**\n * Optional description text for the checkbox option\n */\n description?: React.ReactNode\n}\n\n/**\n * Props your `CheckboxGroup` implementation must accept from the component adapter.\n * Renders a form field wrapping multiple `<input type=\"checkbox\" />` elements with a label, optional description, and error message.\n *\n * @public\n * @group Component props\n */\nexport interface CheckboxGroupProps\n extends SharedFieldLayoutProps, Pick<FieldsetHTMLAttributes<HTMLFieldSetElement>, 'className'> {\n /**\n * Indicates if the checkbox group is in an invalid state\n *\n * @defaultValue `false`\n */\n isInvalid?: boolean\n /**\n * Disables all checkbox options in the group\n *\n * @defaultValue `false`\n */\n isDisabled?: boolean\n /**\n * Array of checkbox options to display\n */\n options: Array<CheckboxGroupOption>\n /**\n * Array of currently selected values\n */\n value?: string[]\n /**\n * Callback when selection changes\n */\n onChange?: (value: string[]) => void\n /**\n * React ref for the first checkbox input element\n */\n inputRef?: Ref<HTMLInputElement>\n}\n\n/**\n * Default prop values for the CheckboxGroup component.\n *\n * @internal\n */\nexport const CheckboxGroupDefaults = {\n isRequired: false,\n isInvalid: false,\n isDisabled: false,\n shouldVisuallyHideLabel: false,\n} as const satisfies Partial<CheckboxGroupProps>\n"],"names":["CheckboxGroupDefaults"],"mappings":"AAwEO,MAAMA,IAAwB;AAAA,EACnC,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,yBAAyB;AAC3B;"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { InputHTMLAttributes, Ref } from 'react';
|
|
2
2
|
import { SharedFieldLayoutProps } from '../../FieldLayout/FieldLayoutTypes';
|
|
3
3
|
/**
|
|
4
|
-
* Option entry for the ComboBox dropdown list.
|
|
4
|
+
* Option entry for the {@link ComboBoxProps | ComboBox} dropdown list.
|
|
5
5
|
*
|
|
6
6
|
* @public
|
|
7
|
-
* @
|
|
7
|
+
* @childOf {@link ComboBoxProps}
|
|
8
8
|
*/
|
|
9
9
|
export interface ComboBoxOption {
|
|
10
10
|
/**
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Inclusive start/end pair representing a selected
|
|
2
|
+
* Inclusive start/end pair representing a date range selected in a
|
|
3
|
+
* {@link DateRangePickerProps | DateRangePicker}.
|
|
3
4
|
*
|
|
4
5
|
* @public
|
|
5
|
-
* @
|
|
6
|
+
* @childOf {@link DateRangePickerProps}
|
|
6
7
|
*/
|
|
7
8
|
export interface DateRange {
|
|
8
9
|
/**
|
|
@@ -3,7 +3,7 @@ import { ReactNode } from 'react';
|
|
|
3
3
|
* Single term/description pair rendered as a row within a {@link DescriptionListProps | DescriptionList}.
|
|
4
4
|
*
|
|
5
5
|
* @public
|
|
6
|
-
* @
|
|
6
|
+
* @childOf {@link DescriptionListProps}
|
|
7
7
|
*/
|
|
8
8
|
export interface DescriptionListItem {
|
|
9
9
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DescriptionListTypes.js","sources":["../../../../../src/components/Common/UI/DescriptionList/DescriptionListTypes.ts"],"sourcesContent":["import type { ReactNode } from 'react'\n\n/**\n * Single term/description pair rendered as a row within a {@link DescriptionListProps | DescriptionList}.\n *\n * @public\n * @
|
|
1
|
+
{"version":3,"file":"DescriptionListTypes.js","sources":["../../../../../src/components/Common/UI/DescriptionList/DescriptionListTypes.ts"],"sourcesContent":["import type { ReactNode } from 'react'\n\n/**\n * Single term/description pair rendered as a row within a {@link DescriptionListProps | DescriptionList}.\n *\n * @public\n * @childOf {@link DescriptionListProps}\n */\nexport interface DescriptionListItem {\n /**\n * Term content (the `<dt>`). Pass an array to render multiple `<dt>` elements for the same description.\n */\n term: ReactNode | ReactNode[]\n /**\n * Description content (the `<dd>`). Pass an array to render multiple `<dd>` elements for the same term.\n */\n description: ReactNode | ReactNode[]\n}\n\n/**\n * Props your `DescriptionList` implementation must accept from the component adapter.\n * Renders an HTML `<dl>` of term/description pairs in either a stacked or horizontal layout.\n *\n * @public\n * @group Component props\n */\nexport interface DescriptionListProps {\n /**\n * Term/description pairs to render in order.\n */\n items: DescriptionListItem[]\n /**\n * Visual arrangement of each term/description pair. Defaults to `'stacked'`.\n *\n * @defaultValue `'stacked'`\n */\n layout?: 'stacked' | 'horizontal'\n /**\n * Whether to render dividers between rows. Defaults to `true`.\n *\n * @defaultValue `true`\n */\n showSeparators?: boolean\n /**\n * Additional class name applied to the root `<dl>`.\n */\n className?: string\n}\n\n/**\n * Default prop values for the DescriptionList component.\n *\n * @internal\n */\nexport const DescriptionListDefaults = {\n layout: 'stacked',\n showSeparators: true,\n} as const satisfies Partial<DescriptionListProps>\n"],"names":["DescriptionListDefaults"],"mappings":"AAsDO,MAAMA,IAA0B;AAAA,EACrC,QAAQ;AAAA,EACR,gBAAgB;AAClB;"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ReactNode, RefObject } from 'react';
|
|
2
2
|
import { DataAttributes } from '../../../../types/Helpers';
|
|
3
3
|
/**
|
|
4
|
-
* Action entry your
|
|
5
|
-
* from the component adapter.
|
|
4
|
+
* Action entry your {@link MenuProps | Menu} implementation must accept for each entry in its
|
|
5
|
+
* `items` array from the component adapter.
|
|
6
6
|
*
|
|
7
7
|
* @public
|
|
8
|
-
* @
|
|
8
|
+
* @childOf {@link MenuProps}
|
|
9
9
|
*/
|
|
10
10
|
export interface MenuItem extends DataAttributes {
|
|
11
11
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuTypes.js","sources":["../../../../../src/components/Common/UI/Menu/MenuTypes.ts"],"sourcesContent":["import type { ReactNode, RefObject } from 'react'\nimport type { DataAttributes } from '@/types/Helpers'\n\n/**\n * Action entry your
|
|
1
|
+
{"version":3,"file":"MenuTypes.js","sources":["../../../../../src/components/Common/UI/Menu/MenuTypes.ts"],"sourcesContent":["import type { ReactNode, RefObject } from 'react'\nimport type { DataAttributes } from '@/types/Helpers'\n\n/**\n * Action entry your {@link MenuProps | Menu} implementation must accept for each entry in its\n * `items` array from the component adapter.\n *\n * @public\n * @childOf {@link MenuProps}\n */\nexport interface MenuItem extends DataAttributes {\n /**\n * Text label for the menu item\n */\n label: string\n /**\n * Optional icon to display before the label\n */\n icon?: ReactNode\n /**\n * Callback function when the menu item is clicked\n */\n onClick: () => void\n /**\n * Disables the menu item and prevents interaction\n */\n isDisabled?: boolean\n /**\n * Optional URL to navigate to when clicked\n */\n href?: string\n}\n\n/**\n * Props your `Menu` implementation must accept from the component adapter.\n * Renders a popover menu of actions anchored to a trigger element.\n *\n * @public\n * @group Component props\n */\nexport interface MenuProps extends DataAttributes {\n /**\n * Reference to the element that triggers the menu\n */\n triggerRef?: RefObject<Element | null>\n /**\n * Array of menu items to display\n */\n items?: MenuItem[]\n /**\n * Controls whether the menu is currently open\n *\n * @defaultValue `false`\n */\n isOpen?: boolean\n /**\n * Callback when the menu is closed\n */\n onClose?: () => void\n /**\n * Accessible label describing the menu's purpose\n */\n 'aria-label': string\n /**\n * Element to use as the portal container for the menu popover.\n * Overrides the default SDK root container from context.\n */\n portalContainer?: HTMLElement\n /**\n * Controls the placement of the menu popover relative to the trigger\n *\n * @defaultValue `'bottom start'`\n */\n placement?:\n 'top' | 'top start' | 'top end' | 'bottom' | 'bottom start' | 'bottom end' | 'left' | 'right'\n}\n\n/**\n * Default prop values for the {@link Menu} component.\n *\n * @internal\n */\nexport const MenuDefaults = {\n isOpen: false,\n placement: 'bottom start',\n} as const satisfies Partial<MenuProps>\n"],"names":["MenuDefaults"],"mappings":"AAkFO,MAAMA,IAAe;AAAA,EAC1B,QAAQ;AAAA,EACR,WAAW;AACb;"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { InputHTMLAttributes, Ref } from 'react';
|
|
2
2
|
import { SharedFieldLayoutProps } from '../../FieldLayout/FieldLayoutTypes';
|
|
3
3
|
/**
|
|
4
|
-
* Option entry for a
|
|
4
|
+
* Option entry for a {@link MultiSelectComboBoxProps | MultiSelectComboBox} dropdown list.
|
|
5
5
|
*
|
|
6
6
|
* @public
|
|
7
|
-
* @
|
|
7
|
+
* @childOf {@link MultiSelectComboBoxProps}
|
|
8
8
|
*/
|
|
9
9
|
export interface MultiSelectComboBoxOption {
|
|
10
10
|
/**
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { FieldsetHTMLAttributes, Ref } from 'react';
|
|
2
2
|
import { SharedFieldLayoutProps } from '../../FieldLayout/FieldLayoutTypes';
|
|
3
3
|
/**
|
|
4
|
-
* Option entry your
|
|
4
|
+
* Option entry your {@link RadioGroupProps | RadioGroup} implementation receives in the `options` array when rendering each radio button.
|
|
5
5
|
*
|
|
6
6
|
* @public
|
|
7
|
-
* @
|
|
7
|
+
* @childOf {@link RadioGroupProps}
|
|
8
8
|
*/
|
|
9
9
|
export interface RadioGroupOption {
|
|
10
10
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioGroupTypes.js","sources":["../../../../../src/components/Common/UI/RadioGroup/RadioGroupTypes.ts"],"sourcesContent":["import type { FieldsetHTMLAttributes, Ref } from 'react'\nimport type { SharedFieldLayoutProps } from '@/components/Common/FieldLayout/FieldLayoutTypes'\n\n/**\n * Option entry your
|
|
1
|
+
{"version":3,"file":"RadioGroupTypes.js","sources":["../../../../../src/components/Common/UI/RadioGroup/RadioGroupTypes.ts"],"sourcesContent":["import type { FieldsetHTMLAttributes, Ref } from 'react'\nimport type { SharedFieldLayoutProps } from '@/components/Common/FieldLayout/FieldLayoutTypes'\n\n/**\n * Option entry your {@link RadioGroupProps | RadioGroup} implementation receives in the `options` array when rendering each radio button.\n *\n * @public\n * @childOf {@link RadioGroupProps}\n */\nexport interface RadioGroupOption {\n /**\n * Label text or content for the radio option\n */\n label: React.ReactNode\n /**\n * Value of the option that will be passed to onChange\n */\n value: string\n /**\n * Disables this specific radio option\n */\n isDisabled?: boolean\n /**\n * Optional description text for the radio option\n */\n description?: React.ReactNode\n}\n\n/**\n * Props your `RadioGroup` implementation must accept from the component adapter.\n * Renders a form field wrapping multiple `<input type=\"radio\" />` elements with a label, optional description, and error message.\n *\n * @public\n * @group Component props\n */\nexport interface RadioGroupProps\n extends SharedFieldLayoutProps, Pick<FieldsetHTMLAttributes<HTMLFieldSetElement>, 'className'> {\n /**\n * Indicates that the field has an error\n *\n * @defaultValue `false`\n */\n isInvalid?: boolean\n /**\n * Disables all radio options in the group\n *\n * @defaultValue `false`\n */\n isDisabled?: boolean\n /**\n * Array of radio options to display\n */\n options: Array<RadioGroupOption>\n /**\n * Currently selected value\n */\n value?: string | null\n /**\n * Initially selected value\n */\n defaultValue?: string\n /**\n * Callback when selection changes\n */\n onChange?: (value: string) => void\n /**\n * React ref for the first radio input element\n */\n inputRef?: Ref<HTMLInputElement>\n}\n\n/**\n * Default prop values for the RadioGroup component.\n *\n * @internal\n */\nexport const RadioGroupDefaults = {\n isRequired: false,\n isInvalid: false,\n isDisabled: false,\n shouldVisuallyHideLabel: false,\n} as const satisfies Partial<RadioGroupProps>\n"],"names":["RadioGroupDefaults"],"mappings":"AA4EO,MAAMA,IAAqB;AAAA,EAChC,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,yBAAyB;AAC3B;"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Ref, SelectHTMLAttributes } from 'react';
|
|
2
2
|
import { SharedFieldLayoutProps } from '../../FieldLayout/FieldLayoutTypes';
|
|
3
3
|
/**
|
|
4
|
-
* Option entry your
|
|
4
|
+
* Option entry your {@link SelectProps | Select} implementation receives in the `options` array when rendering each item in the dropdown.
|
|
5
5
|
*
|
|
6
6
|
* @public
|
|
7
|
-
* @
|
|
7
|
+
* @childOf {@link SelectProps}
|
|
8
8
|
*/
|
|
9
9
|
export interface SelectOption {
|
|
10
10
|
/**
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ReactNode, TableHTMLAttributes } from 'react';
|
|
2
2
|
/**
|
|
3
|
-
* Shape of a single cell your
|
|
3
|
+
* Shape of a single cell your {@link TableProps | Table} implementation receives for headers, rows, and footers.
|
|
4
4
|
*
|
|
5
5
|
* @public
|
|
6
|
-
* @
|
|
6
|
+
* @childOf {@link TableProps}
|
|
7
7
|
*/
|
|
8
8
|
export interface TableData {
|
|
9
9
|
/**
|
|
@@ -16,10 +16,10 @@ export interface TableData {
|
|
|
16
16
|
content: ReactNode;
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
|
-
* Shape of a single row your
|
|
19
|
+
* Shape of a single row your {@link TableProps | Table} implementation receives, containing an ordered list of cells.
|
|
20
20
|
*
|
|
21
21
|
* @public
|
|
22
|
-
* @
|
|
22
|
+
* @childOf {@link TableProps}
|
|
23
23
|
*/
|
|
24
24
|
export interface TableRow {
|
|
25
25
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableTypes.js","sources":["../../../../../src/components/Common/UI/Table/TableTypes.ts"],"sourcesContent":["import type { ReactNode, TableHTMLAttributes } from 'react'\n\n/**\n * Shape of a single cell your
|
|
1
|
+
{"version":3,"file":"TableTypes.js","sources":["../../../../../src/components/Common/UI/Table/TableTypes.ts"],"sourcesContent":["import type { ReactNode, TableHTMLAttributes } from 'react'\n\n/**\n * Shape of a single cell your {@link TableProps | Table} implementation receives for headers, rows, and footers.\n *\n * @public\n * @childOf {@link TableProps}\n */\nexport interface TableData {\n /**\n * Unique identifier for the table cell\n */\n key: string\n /**\n * Content to be displayed in the table cell\n */\n content: ReactNode\n}\n\n/**\n * Shape of a single row your {@link TableProps | Table} implementation receives, containing an ordered list of cells.\n *\n * @public\n * @childOf {@link TableProps}\n */\nexport interface TableRow {\n /**\n * Unique identifier for the table row\n */\n key: string\n /**\n * Array of cells to be displayed in the row\n */\n data: TableData[]\n}\n\n/**\n * Props your `Table` implementation must accept from the component adapter.\n * Renders a table with column headers, body rows, an optional footer row, and an optional empty state.\n *\n * @public\n * @group Component props\n */\nexport interface TableProps extends Pick<\n TableHTMLAttributes<HTMLTableElement>,\n 'className' | 'aria-label' | 'id' | 'role' | 'aria-labelledby' | 'aria-describedby'\n> {\n /**\n * Array of header cells for the table\n */\n headers: TableData[]\n /**\n * Array of rows to be displayed in the table\n */\n rows: TableRow[]\n /**\n * Array of footer cells for the table\n */\n footer?: TableData[]\n /**\n * Content to display when the table has no rows\n */\n emptyState?: ReactNode\n /**\n * Removes borders and background for use inside a Box component\n *\n * @defaultValue `false`\n */\n isWithinBox?: boolean\n /**\n * Whether the first column contains checkboxes (affects which column gets leading variant)\n *\n * @defaultValue `false`\n */\n hasCheckboxColumn?: boolean\n}\n\n/**\n * Default prop values for the Table component.\n *\n * @internal\n */\nexport const TableDefaults = {\n isWithinBox: false,\n hasCheckboxColumn: false,\n} as const satisfies Partial<TableProps>\n"],"names":["TableDefaults"],"mappings":"AAkFO,MAAMA,IAAgB;AAAA,EAC3B,aAAa;AAAA,EACb,mBAAmB;AACrB;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
/**
|
|
3
|
-
* Shape of a single tab configuration your
|
|
3
|
+
* Shape of a single tab configuration your {@link TabsProps | Tabs} implementation receives in its `tabs` prop.
|
|
4
4
|
*
|
|
5
5
|
* @public
|
|
6
|
-
* @
|
|
6
|
+
* @childOf {@link TabsProps}
|
|
7
7
|
*/
|
|
8
8
|
export interface TabProps {
|
|
9
9
|
/**
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { TextInputHookField as e } from "../../../../../partner-hook-utils/form/fields/TextInputHookField.js";
|
|
3
|
+
import { CheckboxHookField as i } from "../../../../../partner-hook-utils/form/fields/CheckboxHookField.js";
|
|
4
4
|
function u(r) {
|
|
5
|
-
return /* @__PURE__ */ o(
|
|
5
|
+
return /* @__PURE__ */ o(e, { ...r, name: "signature" });
|
|
6
6
|
}
|
|
7
7
|
function f(r) {
|
|
8
|
-
return /* @__PURE__ */ o(
|
|
8
|
+
return /* @__PURE__ */ o(i, { ...r, name: "confirmSignature" });
|
|
9
9
|
}
|
|
10
10
|
export {
|
|
11
11
|
f as ConfirmSignatureField,
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { TextInputHookField as t } from "../../../../../partner-hook-utils/form/fields/TextInputHookField.js";
|
|
3
|
+
import { SelectHookField as i } from "../../../../../partner-hook-utils/form/fields/SelectHookField.js";
|
|
2
4
|
import { NumberInputHookField as n } from "../../../../../partner-hook-utils/form/fields/NumberInputHookField.js";
|
|
3
5
|
import { DatePickerHookField as r } from "../../../../../partner-hook-utils/form/fields/DatePickerHookField.js";
|
|
4
|
-
import { RadioGroupHookField as
|
|
5
|
-
import { SelectHookField as i } from "../../../../../partner-hook-utils/form/fields/SelectHookField.js";
|
|
6
|
-
import { TextInputHookField as m } from "../../../../../partner-hook-utils/form/fields/TextInputHookField.js";
|
|
6
|
+
import { RadioGroupHookField as m } from "../../../../../partner-hook-utils/form/fields/RadioGroupHookField.js";
|
|
7
7
|
function F(e) {
|
|
8
|
-
return /* @__PURE__ */ o(
|
|
8
|
+
return /* @__PURE__ */ o(t, { ...e, name: "customName" });
|
|
9
9
|
}
|
|
10
10
|
function p(e) {
|
|
11
11
|
return /* @__PURE__ */ o(i, { ...e, name: "frequency" });
|
|
12
12
|
}
|
|
13
13
|
function y(e) {
|
|
14
|
-
return /* @__PURE__ */ o(
|
|
14
|
+
return /* @__PURE__ */ o(m, { ...e, name: "customTwicePerMonth" });
|
|
15
15
|
}
|
|
16
16
|
function P(e) {
|
|
17
17
|
return /* @__PURE__ */ o(r, { ...e, name: "anchorPayDate" });
|
|
@@ -1,26 +1,25 @@
|
|
|
1
|
-
import { state as
|
|
1
|
+
import { state as T, transition as e, reduce as a } from "robot3";
|
|
2
2
|
import { StateTaxesListContextual as n, StateTaxesFormContextual as i } from "./StateTaxesComponents.js";
|
|
3
|
-
import { componentEvents as
|
|
3
|
+
import { componentEvents as o } from "../../../shared/constants.js";
|
|
4
4
|
const S = {
|
|
5
|
-
viewStateTaxes:
|
|
5
|
+
viewStateTaxes: T(
|
|
6
6
|
e(
|
|
7
|
-
|
|
7
|
+
o.COMPANY_STATE_TAX_EDIT,
|
|
8
8
|
"editStateTaxes",
|
|
9
|
-
|
|
9
|
+
a(
|
|
10
10
|
(t, s) => ({
|
|
11
11
|
...t,
|
|
12
12
|
component: i,
|
|
13
13
|
state: s.payload.state
|
|
14
14
|
})
|
|
15
15
|
)
|
|
16
|
-
)
|
|
17
|
-
e(a.COMPANY_STATE_TAX_DONE, "done")
|
|
16
|
+
)
|
|
18
17
|
),
|
|
19
|
-
editStateTaxes:
|
|
18
|
+
editStateTaxes: T(
|
|
20
19
|
e(
|
|
21
|
-
|
|
20
|
+
o.COMPANY_STATE_TAX_UPDATED,
|
|
22
21
|
"viewStateTaxes",
|
|
23
|
-
|
|
22
|
+
a(
|
|
24
23
|
(t, s) => ({
|
|
25
24
|
...t,
|
|
26
25
|
component: n,
|
|
@@ -29,16 +28,15 @@ const S = {
|
|
|
29
28
|
)
|
|
30
29
|
),
|
|
31
30
|
e(
|
|
32
|
-
|
|
31
|
+
o.CANCEL,
|
|
33
32
|
"viewStateTaxes",
|
|
34
|
-
|
|
33
|
+
a((t) => ({
|
|
35
34
|
...t,
|
|
36
35
|
component: n,
|
|
37
36
|
state: void 0
|
|
38
37
|
}))
|
|
39
38
|
)
|
|
40
|
-
)
|
|
41
|
-
done: o()
|
|
39
|
+
)
|
|
42
40
|
};
|
|
43
41
|
export {
|
|
44
42
|
S as stateTaxesStateMachine
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stateTaxesStateMachine.js","sources":["../../../../src/components/Company/StateTaxes/stateTaxesStateMachine.tsx"],"sourcesContent":["import { reduce, state,
|
|
1
|
+
{"version":3,"file":"stateTaxesStateMachine.js","sources":["../../../../src/components/Company/StateTaxes/stateTaxesStateMachine.tsx"],"sourcesContent":["import { reduce, state, transition } from 'robot3'\nimport type { ComponentType } from 'react'\nimport type { StateTaxesContextInterface } from './StateTaxesComponents'\nimport { StateTaxesFormContextual, StateTaxesListContextual } from './StateTaxesComponents'\nimport { componentEvents } from '@/shared/constants'\nimport type { MachineEventType, MachineTransition } from '@/types/Helpers'\n\ntype EventPayloads = {\n [componentEvents.COMPANY_STATE_TAX_UPDATED]: undefined\n [componentEvents.COMPANY_STATE_TAX_EDIT]: { state: string }\n}\n\n/** @internal */\nexport const stateTaxesStateMachine = {\n viewStateTaxes: state<MachineTransition>(\n transition(\n componentEvents.COMPANY_STATE_TAX_EDIT,\n 'editStateTaxes',\n reduce(\n (\n ctx: StateTaxesContextInterface,\n ev: MachineEventType<EventPayloads, typeof componentEvents.COMPANY_STATE_TAX_EDIT>,\n ): StateTaxesContextInterface => ({\n ...ctx,\n component: StateTaxesFormContextual as ComponentType,\n state: ev.payload.state,\n }),\n ),\n ),\n ),\n editStateTaxes: state<MachineTransition>(\n transition(\n componentEvents.COMPANY_STATE_TAX_UPDATED,\n 'viewStateTaxes',\n reduce(\n (\n ctx: StateTaxesContextInterface,\n ev: MachineEventType<EventPayloads, typeof componentEvents.COMPANY_STATE_TAX_UPDATED>,\n ): StateTaxesContextInterface => ({\n ...ctx,\n component: StateTaxesListContextual as ComponentType,\n state: undefined,\n }),\n ),\n ),\n transition(\n componentEvents.CANCEL,\n 'viewStateTaxes',\n reduce((ctx: StateTaxesContextInterface): StateTaxesContextInterface => ({\n ...ctx,\n component: StateTaxesListContextual as ComponentType,\n state: undefined,\n })),\n ),\n ),\n}\n"],"names":["stateTaxesStateMachine","state","transition","componentEvents","reduce","ctx","ev","StateTaxesFormContextual","StateTaxesListContextual"],"mappings":";;;AAaO,MAAMA,IAAyB;AAAA,EACpC,gBAAgBC;AAAA,IACdC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC;AAAA,QACE,CACEC,GACAC,OACgC;AAAA,UAChC,GAAGD;AAAA,UACH,WAAWE;AAAA,UACX,OAAOD,EAAG,QAAQ;AAAA,QAAA;AAAA,MACpB;AAAA,IACF;AAAA,EACF;AAAA,EAEF,gBAAgBL;AAAA,IACdC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC;AAAA,QACE,CACEC,GACAC,OACgC;AAAA,UAChC,GAAGD;AAAA,UACH,WAAWG;AAAA,UACX,OAAO;AAAA,QAAA;AAAA,MACT;AAAA,IACF;AAAA,IAEFN;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC,EAAO,CAACC,OAAiE;AAAA,QACvE,GAAGA;AAAA,QACH,WAAWG;AAAA,QACX,OAAO;AAAA,MAAA,EACP;AAAA,IAAA;AAAA,EACJ;AAEJ;"}
|