@veevarts/design-system 2.0.0-alpha.6 → 2.0.0-alpha.61
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 +82 -0
- package/dist/assistant.cjs +1 -0
- package/dist/assistant.d.ts +10 -0
- package/dist/assistant.js +790 -0
- package/dist/components/DatePicker/DatePicker.d.ts +9 -2
- package/dist/components/DatePicker/defaults.d.ts +28 -0
- package/dist/components/DatePicker/index.d.ts +1 -0
- package/dist/components/Drawer/Drawer.d.ts +17 -0
- package/dist/components/Drawer/index.d.ts +2 -0
- package/dist/components/Modal/CloseButton.d.ts +18 -0
- package/dist/components/Modal/Modal.d.ts +15 -0
- package/dist/components/Modal/index.d.ts +2 -0
- package/dist/components/Modal/useLabelledCloseButton.d.ts +13 -0
- package/dist/components/Select/Select.d.ts +10 -0
- package/dist/components/Skeleton/Skeleton.d.ts +37 -0
- package/dist/components/Skeleton/index.d.ts +2 -0
- package/dist/components/Table/Table.d.ts +7 -0
- package/dist/components/Table/index.d.ts +2 -0
- package/dist/components/index.d.ts +9 -1
- package/dist/hasContent-BCRxiry-.js +1200 -0
- package/dist/hasContent-JfCtoDIu.cjs +1 -0
- package/dist/index.cjs +9 -9
- package/dist/index.d.ts +6 -0
- package/dist/index.js +11013 -7145
- package/dist/patterns/ActivityTimeline/ActivityTimeline.d.ts +3 -0
- package/dist/patterns/ActivityTimeline/index.d.ts +2 -0
- package/dist/patterns/ActivityTimeline/styles.d.ts +15 -0
- package/dist/patterns/ActivityTimeline/types.d.ts +15 -0
- package/dist/patterns/AdminTable/AdminTable.d.ts +1 -0
- package/dist/patterns/AdminTable/styles.d.ts +8 -1
- package/dist/patterns/AdminTextField/AdminTextField.d.ts +4 -44
- package/dist/patterns/AdminTextField/index.d.ts +2 -2
- package/dist/patterns/AdminTextField/styles.d.ts +29 -0
- package/dist/patterns/AdminTextField/types.d.ts +78 -0
- package/dist/patterns/AdminToolbar/AdminToolbar.d.ts +13 -2
- package/dist/patterns/AdminToolbar/index.d.ts +1 -0
- package/dist/patterns/AdminToolbar/styles.d.ts +49 -0
- package/dist/patterns/AdminToolbar/types.d.ts +2 -0
- package/dist/patterns/AmountList/AmountList.d.ts +3 -0
- package/dist/patterns/AmountList/index.d.ts +2 -0
- package/dist/patterns/AmountList/styles.d.ts +23 -0
- package/dist/patterns/AmountList/types.d.ts +26 -0
- package/dist/patterns/AssistantActivity/AssistantActivity.d.ts +15 -0
- package/dist/patterns/AssistantActivity/formatAssistantDuration.d.ts +10 -0
- package/dist/patterns/AssistantActivity/index.d.ts +3 -0
- package/dist/patterns/AssistantActivity/styles.d.ts +31 -0
- package/dist/patterns/AssistantActivity/types.d.ts +42 -0
- package/dist/patterns/AssistantComposer/AssistantComposer.d.ts +15 -0
- package/dist/patterns/AssistantComposer/index.d.ts +2 -0
- package/dist/patterns/AssistantComposer/styles.d.ts +33 -0
- package/dist/patterns/AssistantComposer/types.d.ts +62 -0
- package/dist/patterns/AssistantMessage/AssistantMessage.d.ts +17 -0
- package/dist/patterns/AssistantMessage/index.d.ts +2 -0
- package/dist/patterns/AssistantMessage/styles.d.ts +45 -0
- package/dist/patterns/AssistantMessage/types.d.ts +84 -0
- package/dist/patterns/AssistantNotice/AssistantNotice.d.ts +18 -0
- package/dist/patterns/AssistantNotice/index.d.ts +2 -0
- package/dist/patterns/AssistantNotice/styles.d.ts +49 -0
- package/dist/patterns/AssistantNotice/types.d.ts +58 -0
- package/dist/patterns/CardList/CardList.d.ts +3 -0
- package/dist/patterns/CardList/index.d.ts +2 -0
- package/dist/patterns/CardList/styles.d.ts +20 -0
- package/dist/patterns/CardList/types.d.ts +20 -0
- package/dist/patterns/CardStack/CardStack.d.ts +7 -0
- package/dist/patterns/CardStack/index.d.ts +2 -0
- package/dist/patterns/CardStack/styles.d.ts +2 -0
- package/dist/patterns/CashTenderForm/types.d.ts +6 -0
- package/dist/patterns/CellText/CellText.d.ts +16 -0
- package/dist/patterns/CellText/index.d.ts +2 -0
- package/dist/patterns/CellText/styles.d.ts +7 -0
- package/dist/patterns/DiscardGuard/DiscardGuard.d.ts +23 -0
- package/dist/patterns/DiscardGuard/context.d.ts +25 -0
- package/dist/patterns/DiscardGuard/index.d.ts +6 -0
- package/dist/patterns/DiscardGuard/useDiscardGuard.d.ts +38 -0
- package/dist/patterns/DonationAmounts/index.d.ts +1 -1
- package/dist/patterns/DonationAmounts/styles.d.ts +51 -0
- package/dist/patterns/DonationAmounts/types.d.ts +79 -1
- package/dist/patterns/DonationAmounts/utils/currency.d.ts +23 -3
- package/dist/patterns/EntityRow/EntityList.d.ts +15 -0
- package/dist/patterns/EntityRow/EntityRow.d.ts +3 -0
- package/dist/patterns/EntityRow/context.d.ts +2 -0
- package/dist/patterns/EntityRow/icons.d.ts +3 -0
- package/dist/patterns/EntityRow/index.d.ts +3 -0
- package/dist/patterns/EntityRow/initials.d.ts +6 -0
- package/dist/patterns/EntityRow/styles.d.ts +74 -0
- package/dist/patterns/EntityRow/types.d.ts +125 -0
- package/dist/patterns/ExpandableTable/ExpandableTable.d.ts +6 -0
- package/dist/patterns/ExpandableTable/index.d.ts +2 -0
- package/dist/patterns/ExpandableTable/styles.d.ts +43 -0
- package/dist/patterns/ExpandableTable/types.d.ts +99 -0
- package/dist/patterns/FeedbackState/FeedbackState.d.ts +1 -1
- package/dist/patterns/FeedbackState/type.d.ts +11 -1
- package/dist/patterns/FilterSelect/FilterSelect.d.ts +3 -0
- package/dist/patterns/FilterSelect/FilterSelectGroup.d.ts +3 -0
- package/dist/patterns/FilterSelect/index.d.ts +3 -0
- package/dist/patterns/FilterSelect/styles.d.ts +17 -0
- package/dist/patterns/FilterSelect/types.d.ts +19 -0
- package/dist/patterns/InlineConfirm/InlineConfirm.d.ts +38 -0
- package/dist/patterns/InlineConfirm/index.d.ts +2 -0
- package/dist/patterns/InlineConfirm/styles.d.ts +16 -0
- package/dist/patterns/InstallmentFundAssignment/InstallmentFundAssignment.d.ts +1 -1
- package/dist/patterns/InstallmentFundAssignment/types.d.ts +3 -0
- package/dist/patterns/InstallmentSchedule/InstallmentSchedule.d.ts +1 -1
- package/dist/patterns/InstallmentSchedule/InstallmentTable.d.ts +1 -1
- package/dist/patterns/InstallmentSchedule/index.d.ts +1 -1
- package/dist/patterns/InstallmentSchedule/types.d.ts +62 -3
- package/dist/patterns/InstallmentSchedule/utils.d.ts +33 -0
- package/dist/patterns/KeyValueChip/KeyValueChip.d.ts +1 -0
- package/dist/patterns/KeyValueRows/KeyValueRows.d.ts +13 -0
- package/dist/patterns/KeyValueRows/index.d.ts +2 -0
- package/dist/patterns/KeyValueRows/styles.d.ts +8 -0
- package/dist/patterns/LineItemRows/LineItemRows.d.ts +17 -0
- package/dist/patterns/LineItemRows/index.d.ts +2 -0
- package/dist/patterns/LineItemRows/styles.d.ts +13 -0
- package/dist/patterns/ListPanel/ListPanel.d.ts +2 -0
- package/dist/patterns/LoadMoreFooter/LoadMoreFooter.d.ts +3 -0
- package/dist/patterns/LoadMoreFooter/index.d.ts +2 -0
- package/dist/patterns/LoadMoreFooter/styles.d.ts +7 -0
- package/dist/patterns/LoadMoreFooter/types.d.ts +10 -0
- package/dist/patterns/MetaCard/types.d.ts +2 -0
- package/dist/patterns/ModalPanels/ModalPanels.d.ts +35 -0
- package/dist/patterns/ModalPanels/context.d.ts +20 -0
- package/dist/patterns/ModalPanels/focus.d.ts +44 -0
- package/dist/patterns/ModalPanels/index.d.ts +6 -0
- package/dist/patterns/ModalPanels/styles.d.ts +13 -0
- package/dist/patterns/ModalPanels/useModalPanels.d.ts +30 -0
- package/dist/patterns/NeedsFixDot/NeedsFixDot.d.ts +16 -0
- package/dist/patterns/NeedsFixDot/firstNeedsFixKey.d.ts +18 -0
- package/dist/patterns/NeedsFixDot/index.d.ts +4 -0
- package/dist/patterns/NeedsFixDot/styles.d.ts +20 -0
- package/dist/patterns/Notice/Notice.d.ts +16 -0
- package/dist/patterns/Notice/index.d.ts +2 -0
- package/dist/patterns/Notice/styles.d.ts +35 -0
- package/dist/patterns/Notice/type.d.ts +39 -0
- package/dist/patterns/OutcomeView/index.d.ts +1 -1
- package/dist/patterns/OutcomeView/types.d.ts +110 -3
- package/dist/patterns/PageHeader/PageHeader.d.ts +1 -0
- package/dist/patterns/PaginationSummary/PaginationSummary.d.ts +12 -0
- package/dist/patterns/PaginationSummary/index.d.ts +1 -1
- package/dist/patterns/PaymentSubAmountInput/PaymentSubAmountInput.d.ts +2 -0
- package/dist/patterns/PillTabs/PillTabs.d.ts +3 -0
- package/dist/patterns/PillTabs/ids.d.ts +9 -0
- package/dist/patterns/PillTabs/index.d.ts +3 -0
- package/dist/patterns/PillTabs/styles.d.ts +20 -0
- package/dist/patterns/PillTabs/types.d.ts +21 -0
- package/dist/patterns/{CatalogItemCard → Programs/CatalogItemCard}/type.d.ts +1 -1
- package/dist/patterns/{EventDetails → Programs/EventDetails}/EventDetails.d.ts +3 -1
- package/dist/patterns/{OfferCard → Programs/OfferCard}/OfferCard.d.ts +1 -1
- package/dist/patterns/{OfferCard → Programs/OfferCard}/types.d.ts +7 -0
- package/dist/patterns/Programs/ProgramListItem/ProgramListItem.d.ts +17 -0
- package/dist/patterns/Programs/ProgramListItem/index.d.ts +2 -0
- package/dist/patterns/Programs/index.d.ts +5 -0
- package/dist/patterns/ReasonSelect/types.d.ts +1 -0
- package/dist/patterns/RecordCard/RecordCard.d.ts +3 -0
- package/dist/patterns/RecordCard/index.d.ts +2 -0
- package/dist/patterns/RecordCard/styles.d.ts +16 -0
- package/dist/patterns/RecordCard/types.d.ts +22 -0
- package/dist/patterns/RecordHeader/RecordHeader.d.ts +3 -0
- package/dist/patterns/RecordHeader/index.d.ts +2 -0
- package/dist/patterns/RecordHeader/styles.d.ts +43 -0
- package/dist/patterns/RecordHeader/types.d.ts +30 -0
- package/dist/patterns/RecordLayout/RecordLayout.d.ts +3 -0
- package/dist/patterns/RecordLayout/index.d.ts +2 -0
- package/dist/patterns/RecordLayout/styles.d.ts +8 -0
- package/dist/patterns/RecordLayout/types.d.ts +6 -0
- package/dist/patterns/RecordTotals/RecordTotals.d.ts +19 -0
- package/dist/patterns/RecordTotals/index.d.ts +2 -0
- package/dist/patterns/RecordTotals/styles.d.ts +19 -0
- package/dist/patterns/RefundMethodCards/RefundMethodCards.d.ts +4 -0
- package/dist/patterns/RefundMethodCards/index.d.ts +2 -0
- package/dist/patterns/RefundMethodCards/styles.d.ts +59 -0
- package/dist/patterns/RefundMethodCards/types.d.ts +72 -0
- package/dist/patterns/RefundProgressList/RefundProgressList.d.ts +4 -0
- package/dist/patterns/RefundProgressList/index.d.ts +2 -0
- package/dist/patterns/RefundProgressList/styles.d.ts +44 -0
- package/dist/patterns/RefundProgressList/types.d.ts +37 -0
- package/dist/patterns/RelatedRecordList/RelatedRecordList.d.ts +3 -0
- package/dist/patterns/RelatedRecordList/index.d.ts +2 -0
- package/dist/patterns/RelatedRecordList/styles.d.ts +19 -0
- package/dist/patterns/RelatedRecordList/types.d.ts +17 -0
- package/dist/patterns/ScrollToLatest/ScrollToLatest.d.ts +18 -0
- package/dist/patterns/ScrollToLatest/index.d.ts +2 -0
- package/dist/patterns/ScrollToLatest/styles.d.ts +11 -0
- package/dist/patterns/ScrollToLatest/types.d.ts +36 -0
- package/dist/patterns/SessionExpiredCard/SessionExpiredCard.d.ts +14 -0
- package/dist/patterns/SessionExpiredCard/index.d.ts +2 -0
- package/dist/patterns/SessionExpiredCard/type.d.ts +6 -0
- package/dist/patterns/SplitPaymentSummary/index.d.ts +1 -1
- package/dist/patterns/SplitPaymentSummary/types.d.ts +18 -0
- package/dist/patterns/StatTiles/StatTiles.d.ts +3 -0
- package/dist/patterns/StatTiles/index.d.ts +2 -0
- package/dist/patterns/StatTiles/styles.d.ts +8 -0
- package/dist/patterns/StatTiles/types.d.ts +12 -0
- package/dist/patterns/StatusChip/StatusChip.d.ts +3 -3
- package/dist/patterns/StepProgress/StepProgress.d.ts +4 -0
- package/dist/patterns/StepProgress/index.d.ts +2 -0
- package/dist/patterns/StepProgress/styles.d.ts +29 -0
- package/dist/patterns/StepProgress/types.d.ts +43 -0
- package/dist/patterns/Summary/components/ActionBar.d.ts +2 -0
- package/dist/patterns/Summary/components/GrandTotalRow.d.ts +1 -0
- package/dist/patterns/Summary/components/ItemRow.d.ts +1 -0
- package/dist/patterns/Summary/components/SummaryBody.d.ts +4 -1
- package/dist/patterns/Summary/components/TotalsLineRow.d.ts +3 -2
- package/dist/patterns/Summary/types.d.ts +51 -9
- package/dist/patterns/TableSkeleton/TableSkeleton.d.ts +1 -0
- package/dist/patterns/TileSelect/TileSelect.d.ts +2 -37
- package/dist/patterns/TileSelect/index.d.ts +1 -1
- package/dist/patterns/TileSelect/styles.d.ts +56 -0
- package/dist/patterns/TileSelect/types.d.ts +140 -0
- package/dist/patterns/TimeField/TimeField.d.ts +6 -0
- package/dist/patterns/TimeField/index.d.ts +3 -0
- package/dist/patterns/TimeField/time.d.ts +40 -0
- package/dist/patterns/TimeField/types.d.ts +77 -0
- package/dist/patterns/ToolbarButton/ToolbarButton.d.ts +2 -0
- package/dist/patterns/UnderlineTabs/UnderlineTabs.d.ts +40 -1
- package/dist/patterns/UnderlineTabs/index.d.ts +1 -1
- package/dist/patterns/UnderlineTabs/styles.d.ts +21 -0
- package/dist/patterns/VerticalSteps/StepPager.d.ts +6 -0
- package/dist/patterns/VerticalSteps/StepsReadiness.d.ts +15 -0
- package/dist/patterns/VerticalSteps/VerticalSteps.d.ts +6 -0
- package/dist/patterns/VerticalSteps/index.d.ts +4 -0
- package/dist/patterns/VerticalSteps/styles.d.ts +54 -0
- package/dist/patterns/VerticalSteps/types.d.ts +100 -0
- package/dist/patterns/WizardShell/index.d.ts +1 -1
- package/dist/patterns/WizardShell/types.d.ts +9 -1
- package/dist/patterns/grid-columns.d.ts +1 -1
- package/dist/patterns/index.d.ts +79 -19
- package/dist/patterns/shared/hasContent.d.ts +2 -0
- package/dist/patterns/shared/index.d.ts +1 -0
- package/dist/patterns/shared/motion.d.ts +6 -0
- package/dist/patterns/shared/recordTone.d.ts +9 -0
- package/dist/patterns/shared/rem.d.ts +4 -0
- package/dist/patterns/shared/useContainerWidth.d.ts +6 -0
- package/dist/patterns/shared/useDecimalDraft.d.ts +33 -0
- package/dist/patterns/shared/usePrefillEdits.d.ts +7 -0
- package/dist/providers/DensityProvider.d.ts +7 -0
- package/dist/providers/HeroUIProvider.d.ts +20 -1
- package/dist/providers/ToastProvider.d.ts +21 -0
- package/dist/providers/close-label-context.d.ts +18 -0
- package/dist/providers/density.d.ts +17 -0
- package/dist/providers/index.d.ts +6 -0
- package/dist/tailwind/index.cjs +107 -5
- package/dist/tailwind/index.d.ts +61 -0
- package/dist/tailwind/index.mjs +104 -5
- package/dist/test/ReducedMotion.d.ts +4 -0
- package/dist/test/RootFontSize.d.ts +5 -0
- package/dist/test/backdrop.d.ts +12 -0
- package/dist/test/container-width.d.ts +14 -0
- package/dist/test/contrast.d.ts +1 -0
- package/dist/test/px-class-names.d.ts +1 -0
- package/dist/test/px-classes.d.ts +3 -0
- package/dist/test/reducedMotionCss.d.ts +40 -0
- package/dist/test/root-font-size.d.ts +8 -0
- package/dist/tokens/assistant-surface.d.ts +66 -0
- package/dist/tokens/index.d.ts +2 -0
- package/dist/tokens/pos-surface.d.ts +23 -4
- package/package.json +22 -3
- /package/dist/patterns/{CatalogItemCard → Programs/CatalogItemCard}/CatalogItemCard.d.ts +0 -0
- /package/dist/patterns/{CatalogItemCard → Programs/CatalogItemCard}/index.d.ts +0 -0
- /package/dist/patterns/{EventDetails → Programs/EventDetails}/index.d.ts +0 -0
- /package/dist/patterns/{OfferCard → Programs/OfferCard}/examples/CustomQuantitySelectorExample.d.ts +0 -0
- /package/dist/patterns/{OfferCard → Programs/OfferCard}/examples/ListWithEurosCurrencyExample.d.ts +0 -0
- /package/dist/patterns/{OfferCard → Programs/OfferCard}/examples/ListWithoutAnimationExample.d.ts +0 -0
- /package/dist/patterns/{OfferCard → Programs/OfferCard}/examples/index.d.ts +0 -0
- /package/dist/patterns/{OfferCard → Programs/OfferCard}/index.d.ts +0 -0
- /package/dist/patterns/{OfferCard → Programs/OfferCard}/utils/animations.d.ts +0 -0
- /package/dist/patterns/{OfferCard → Programs/OfferCard}/utils/currency.d.ts +0 -0
- /package/dist/patterns/{OfferCard → Programs/OfferCard}/utils/index.d.ts +0 -0
- /package/dist/patterns/{OfferCard → Programs/OfferCard}/utils/offers.d.ts +0 -0
- /package/dist/patterns/{OfferCard → Programs/OfferCard}/variants/OfferCardEmpty.d.ts +0 -0
- /package/dist/patterns/{OfferCard → Programs/OfferCard}/variants/OfferCardError.d.ts +0 -0
- /package/dist/patterns/{OfferCard → Programs/OfferCard}/variants/OfferCardList.d.ts +0 -0
- /package/dist/patterns/{OfferCard → Programs/OfferCard}/variants/OfferCardSkeleton.d.ts +0 -0
- /package/dist/patterns/{OfferCard → Programs/OfferCard}/variants/index.d.ts +0 -0
- /package/dist/patterns/{SessionTimeline → Programs/SessionTimeline}/SessionTimeline.d.ts +0 -0
- /package/dist/patterns/{SessionTimeline → Programs/SessionTimeline}/index.d.ts +0 -0
- /package/dist/patterns/{SessionTimeline → Programs/SessionTimeline}/type.d.ts +0 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export type InlineConfirmVariant = 'danger' | 'warning';
|
|
3
|
+
export type InlineConfirmSize = 'sm' | 'md' | 'lg';
|
|
4
|
+
export interface InlineConfirmProps {
|
|
5
|
+
/** The question. Also the accessible name of the alertdialog. */
|
|
6
|
+
message: React.ReactNode;
|
|
7
|
+
/** Optional consequences. Becomes `aria-describedby`. */
|
|
8
|
+
description?: React.ReactNode;
|
|
9
|
+
/** Label for the confirm action. Carry the verb ("Remove"), not "OK". */
|
|
10
|
+
confirmLabel: string;
|
|
11
|
+
/** Label for the cancel action. Default `'Cancel'`. */
|
|
12
|
+
cancelLabel?: string;
|
|
13
|
+
onConfirm: () => void;
|
|
14
|
+
/** Fires from the Cancel button and from Escape. */
|
|
15
|
+
onCancel: () => void;
|
|
16
|
+
/** Drives the surface tone and the confirm colour. Default `'danger'`. */
|
|
17
|
+
variant?: InlineConfirmVariant;
|
|
18
|
+
/** Spinner on confirm; Cancel and Escape locked. Default `false`. */
|
|
19
|
+
isPending?: boolean;
|
|
20
|
+
/** Which button receives focus on mount. Default `'cancel'`. */
|
|
21
|
+
initialFocus?: 'cancel' | 'confirm';
|
|
22
|
+
/** Stop Escape from reaching ancestors (e.g. an enclosing Modal). Default `true`. */
|
|
23
|
+
containEscape?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Button size: `'sm'` 32px (default), `'md'` 40px, `'lg'` 48px for a touch
|
|
26
|
+
* register.
|
|
27
|
+
*/
|
|
28
|
+
size?: InlineConfirmSize;
|
|
29
|
+
/**
|
|
30
|
+
* `'li'` wraps the box in a list item, for swapping it in place of a row of
|
|
31
|
+
* a `ul`/`ol`. Default `'div'`.
|
|
32
|
+
*/
|
|
33
|
+
as?: 'li' | 'div';
|
|
34
|
+
className?: string;
|
|
35
|
+
/** Root test id; the buttons get `<id>-confirm` and `<id>-cancel`. */
|
|
36
|
+
'data-testid'?: string;
|
|
37
|
+
}
|
|
38
|
+
export declare const InlineConfirm: React.FC<InlineConfirmProps>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { InlineConfirmVariant } from './InlineConfirm';
|
|
2
|
+
export declare const inlineConfirmClass: {
|
|
3
|
+
/** The `li` that keeps list semantics when the box replaces a row. */
|
|
4
|
+
readonly item: "list-none";
|
|
5
|
+
/**
|
|
6
|
+
* The alertdialog itself. It only takes focus programmatically, while pending,
|
|
7
|
+
* and then shows the system focus ring when the user is on the keyboard.
|
|
8
|
+
*/
|
|
9
|
+
readonly box: "outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus";
|
|
10
|
+
readonly body: "gap-3 px-4 py-3";
|
|
11
|
+
readonly text: "flex min-w-0 flex-col gap-1";
|
|
12
|
+
readonly message: "text-sm text-gray-900 [overflow-wrap:anywhere]";
|
|
13
|
+
readonly description: "text-sm text-gray-600 [overflow-wrap:anywhere]";
|
|
14
|
+
readonly actions: "flex flex-wrap items-center gap-2";
|
|
15
|
+
};
|
|
16
|
+
export declare const inlineConfirmSurface: Record<InlineConfirmVariant, string>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { JSX } from 'react';
|
|
2
2
|
import { InstallmentFundAssignmentProps } from './types';
|
|
3
|
-
export declare function InstallmentFundAssignment({ assignments, funds, labels: customLabels, classNames, isSaving, hasSavedAssignments, isFundPickerOpen, activeAssignmentId, modalPortalContainer, footer, onAssignmentsChange, onOpenFundPicker, onCloseFundPicker, onCollapseChange, onSave, }: InstallmentFundAssignmentProps): JSX.Element;
|
|
3
|
+
export declare function InstallmentFundAssignment({ assignments, funds, labels: customLabels, classNames, isSaving, hasSavedAssignments, showSavedIndicator, isCollapsed, isFundPickerOpen, activeAssignmentId, modalPortalContainer, footer, onAssignmentsChange, onOpenFundPicker, onCloseFundPicker, onCollapseChange, onSave, }: InstallmentFundAssignmentProps): JSX.Element;
|
|
@@ -14,6 +14,7 @@ export type InstallmentFundAssignmentEntry = {
|
|
|
14
14
|
};
|
|
15
15
|
export type InstallmentFundAssignmentLabels = {
|
|
16
16
|
title?: string;
|
|
17
|
+
saved?: string;
|
|
17
18
|
singleFund?: string;
|
|
18
19
|
splitFunds?: string;
|
|
19
20
|
saveAssignment?: string;
|
|
@@ -55,6 +56,8 @@ export type InstallmentFundAssignmentProps = {
|
|
|
55
56
|
classNames?: InstallmentFundAssignmentClassNames;
|
|
56
57
|
isSaving?: boolean;
|
|
57
58
|
hasSavedAssignments?: boolean;
|
|
59
|
+
showSavedIndicator?: boolean;
|
|
60
|
+
isCollapsed?: boolean;
|
|
58
61
|
isFundPickerOpen?: boolean;
|
|
59
62
|
activeAssignmentId?: string | null;
|
|
60
63
|
modalPortalContainer?: Element;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { JSX } from 'react';
|
|
2
2
|
import { InstallmentScheduleProps } from './types';
|
|
3
|
-
export declare function InstallmentSchedule({ mode: controlledMode, donationAmount, currency, locale, installments, automaticSettings, defaultTab, showTitle, showCard, showSavePayment, showTabs, inputs, startDate, labels: customLabels, classNames, isSaving, isModeSwitchDisabled, onModeChange, onAutomaticSettingsChange, onInstallmentsChange, onSave, }: InstallmentScheduleProps): JSX.Element;
|
|
3
|
+
export declare function InstallmentSchedule({ mode: controlledMode, donationAmount, currency, locale, installments, automaticSettings, defaultTab, showTitle, showCard, showSavePayment, showTabs, inputs, startDate, firstInstallmentDateOverride, labels: customLabels, classNames, isSaving, showSavedIndicator, isModeSwitchDisabled, onModeChange, onAutomaticSettingsChange, onInstallmentsChange, onSave, onCancel, }: InstallmentScheduleProps): JSX.Element;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { JSX } from 'react';
|
|
2
2
|
import { InstallmentTableProps } from './types';
|
|
3
|
-
export declare function InstallmentTable({ installments, currency, locale, showTitle, showCard, showEditPayment, showDelete, payNowHiddenStatuses, labels: customLabels, isSaving, onEditInstallments, onPayInstallment, onDeleteInstallment, }: InstallmentTableProps): JSX.Element;
|
|
3
|
+
export declare function InstallmentTable({ installments, currency, locale, showTitle, showCard, showEditPayment, showDelete, payNowHiddenStatuses, showSavedIndicator, labels: customLabels, isSaving, onEditInstallments, onPayInstallment, onDeleteInstallment, }: InstallmentTableProps): JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { InstallmentSchedule } from './InstallmentSchedule';
|
|
2
2
|
export { InstallmentScheduleSkeleton } from './InstallmentScheduleSkeleton';
|
|
3
3
|
export { InstallmentTable } from './InstallmentTable';
|
|
4
|
-
export { generateAutomaticInstallments } from './utils';
|
|
4
|
+
export { applyFirstInstallmentDateOverride, generateAutomaticInstallments } from './utils';
|
|
5
5
|
export type { AutomaticScheduleSettings, InstallmentFrequency, InstallmentScheduleInput, InstallmentTableLabels, InstallmentTableProps, InstallmentScheduleClassNames, InstallmentScheduleLabels, InstallmentScheduleMode, InstallmentScheduleProps, InstallmentStatus, ScheduledInstallment, } from './types';
|
|
@@ -1,12 +1,34 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
export type InstallmentScheduleMode = 'automatic' | 'manual';
|
|
3
3
|
export type InstallmentFrequency = 'weekly' | 'monthly' | 'quarterly' | 'annual';
|
|
4
|
-
export type InstallmentStatus = '
|
|
4
|
+
export type InstallmentStatus = 'scheduled' | 'paid' | 'payment_due' | 'overdue' | 'failed' | 'refunded' | 'partially_refunded' | 'disputed' | 'canceled' | 'processing' | 'pending_confirmation';
|
|
5
5
|
export type ScheduledInstallment = {
|
|
6
6
|
id: string;
|
|
7
|
+
name?: string | null;
|
|
7
8
|
dueDate: string;
|
|
8
9
|
amount: number;
|
|
9
10
|
status?: InstallmentStatus | (string & {});
|
|
11
|
+
/**
|
|
12
|
+
* When the installment was actually paid: a calendar date (`YYYY-MM-DD`)
|
|
13
|
+
* or an ISO timestamp (shown in the viewer's timezone). Named after the
|
|
14
|
+
* field the commitments API already returns for this, so installments
|
|
15
|
+
* passed straight through from the API carry it without any mapping.
|
|
16
|
+
* `InstallmentTable` shows it on rows whose payment happened (`paid`,
|
|
17
|
+
* `partially_refunded`, `refunded`) and on no other status; omit it to
|
|
18
|
+
* show none.
|
|
19
|
+
*/
|
|
20
|
+
fulfilledAt?: string | null;
|
|
21
|
+
/**
|
|
22
|
+
* FR-1422 — how much of the installment was refunded, in the same units as
|
|
23
|
+
* `amount` (a major-unit number: `50` is $50.00). `InstallmentTable`
|
|
24
|
+
* formats it with its own `currency` and `locale` and shows it as
|
|
25
|
+
* "Refunded $50.00" under the amount of a `partially_refunded` row.
|
|
26
|
+
*
|
|
27
|
+
* Ignored on every other status: a `refunded` row gave the whole amount
|
|
28
|
+
* back, so its amount and badge already say it. Also ignored when missing,
|
|
29
|
+
* zero or negative, so a row never reads "Refunded $0.00".
|
|
30
|
+
*/
|
|
31
|
+
refundedAmount?: number | null;
|
|
10
32
|
};
|
|
11
33
|
export type AutomaticScheduleSettings = {
|
|
12
34
|
numberOfInstallments: number;
|
|
@@ -16,11 +38,13 @@ export type AutomaticScheduleSettings = {
|
|
|
16
38
|
export type InstallmentScheduleInput = keyof AutomaticScheduleSettings | 'dayOfMonth';
|
|
17
39
|
export type InstallmentScheduleLabels = {
|
|
18
40
|
title?: string;
|
|
41
|
+
saved?: string;
|
|
19
42
|
automaticMode?: string;
|
|
20
43
|
manualMode?: string;
|
|
21
44
|
createInstallments?: string;
|
|
22
45
|
generateSchedule?: string;
|
|
23
46
|
saveInstallments?: string;
|
|
47
|
+
cancelEdit?: string;
|
|
24
48
|
addInstallment?: string;
|
|
25
49
|
emptyAutomatic?: string;
|
|
26
50
|
emptyManual?: string;
|
|
@@ -45,6 +69,8 @@ export type InstallmentScheduleLabels = {
|
|
|
45
69
|
totalIncreaseConfirmationCancel?: string;
|
|
46
70
|
totalIncreaseConfirmationConfirm?: string;
|
|
47
71
|
dateOrderError?: string;
|
|
72
|
+
/** Inline error on a manual row whose payment date was cleared or left incomplete. */
|
|
73
|
+
dueDateRequiredError?: string;
|
|
48
74
|
amountGreaterThanZeroError?: string;
|
|
49
75
|
};
|
|
50
76
|
export type InstallmentScheduleClassNames = {
|
|
@@ -71,23 +97,54 @@ export type InstallmentScheduleProps = {
|
|
|
71
97
|
showTabs?: boolean;
|
|
72
98
|
inputs?: InstallmentScheduleInput[];
|
|
73
99
|
startDate?: string;
|
|
100
|
+
/**
|
|
101
|
+
* Automatic mode only. Dates installment #1 on this day instead of the day
|
|
102
|
+
* the generated cadence would put it on. Installments #2..N keep the
|
|
103
|
+
* generated cadence untouched.
|
|
104
|
+
*
|
|
105
|
+
* For flows where the first charge happens when the plan is COMMITTED
|
|
106
|
+
* while the schedule anchors on a later term start: a plan created today
|
|
107
|
+
* with a term starting next month charges #1 today, then follows the term.
|
|
108
|
+
* Without this the first charge silently moves to the term start, and the
|
|
109
|
+
* schedule on screen stops matching the one that gets persisted.
|
|
110
|
+
*
|
|
111
|
+
* Ignored in manual mode, where the host already owns every date, and
|
|
112
|
+
* ignored when `firstInstallmentDate` is one of `inputs` — there the user
|
|
113
|
+
* picks that date themselves and the schedule must agree with the field.
|
|
114
|
+
*/
|
|
115
|
+
firstInstallmentDateOverride?: string;
|
|
74
116
|
labels?: InstallmentScheduleLabels;
|
|
75
117
|
classNames?: InstallmentScheduleClassNames;
|
|
76
118
|
isSaving?: boolean;
|
|
119
|
+
showSavedIndicator?: boolean;
|
|
77
120
|
isModeSwitchDisabled?: boolean;
|
|
78
121
|
onModeChange?: (mode: InstallmentScheduleMode) => void;
|
|
79
122
|
onAutomaticSettingsChange: (settings: AutomaticScheduleSettings) => void;
|
|
80
123
|
onInstallmentsChange: (installments: ScheduledInstallment[]) => void;
|
|
81
124
|
onSave?: () => void;
|
|
125
|
+
onCancel?: () => void;
|
|
82
126
|
};
|
|
83
127
|
export type InstallmentTableLabels = {
|
|
84
128
|
title?: string;
|
|
129
|
+
saved?: string;
|
|
85
130
|
searchLabel?: string;
|
|
86
131
|
searchPlaceholder?: string;
|
|
87
132
|
editInstallments?: string;
|
|
88
133
|
installmentId?: string;
|
|
89
134
|
amount?: string;
|
|
90
135
|
scheduledDate?: string;
|
|
136
|
+
/**
|
|
137
|
+
* Prefix of the paid date shown under the scheduled date of a row whose
|
|
138
|
+
* payment happened: "Paid on Jun 3, 2026".
|
|
139
|
+
*/
|
|
140
|
+
paidOn?: string;
|
|
141
|
+
/** FR-1422 — text of the `partially_refunded` status badge. Defaults to "Partially refunded". */
|
|
142
|
+
partiallyRefunded?: string;
|
|
143
|
+
/**
|
|
144
|
+
* FR-1422 — prefix of the refunded amount shown under the amount of a
|
|
145
|
+
* `partially_refunded` row: "Refunded $50.00". Defaults to "Refunded".
|
|
146
|
+
*/
|
|
147
|
+
refundedAmount?: string;
|
|
91
148
|
status?: string;
|
|
92
149
|
actions?: string;
|
|
93
150
|
payNow?: string;
|
|
@@ -117,10 +174,12 @@ export type InstallmentTableProps = {
|
|
|
117
174
|
/**
|
|
118
175
|
* FR-1619 — statuses for which the Pay Now button is NOT rendered on a row.
|
|
119
176
|
* Typed with the `InstallmentStatus` union so consumers get compile-time
|
|
120
|
-
* safety on status keys.
|
|
121
|
-
*
|
|
177
|
+
* safety on status keys. A Pay Now button that IS rendered is still
|
|
178
|
+
* disabled on a row whose payment already happened (`paid`,
|
|
179
|
+
* `partially_refunded`, `refunded`). Defaults to `[]`.
|
|
122
180
|
*/
|
|
123
181
|
payNowHiddenStatuses?: InstallmentStatus[];
|
|
182
|
+
showSavedIndicator?: boolean;
|
|
124
183
|
labels?: InstallmentTableLabels;
|
|
125
184
|
isSaving?: boolean;
|
|
126
185
|
onEditInstallments: () => void;
|
|
@@ -1,3 +1,36 @@
|
|
|
1
1
|
import { AutomaticScheduleSettings, ScheduledInstallment } from './types';
|
|
2
2
|
export declare function generateAutomaticInstallments(donationAmount: number, settings: AutomaticScheduleSettings): ScheduledInstallment[];
|
|
3
3
|
export declare function getInvalidDateRowIds(installments: ScheduledInstallment[]): Set<string>;
|
|
4
|
+
export type ManualRowErrors = {
|
|
5
|
+
/** Rows with no due date: the date picker reports a cleared or incomplete date as `''`. */
|
|
6
|
+
missingDateRows: Set<string>;
|
|
7
|
+
/** Rows dated after the next row. */
|
|
8
|
+
invalidDateRows: Set<string>;
|
|
9
|
+
/** Rows whose amount is not greater than zero. */
|
|
10
|
+
invalidAmountRows: Set<string>;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Every inline error a manual schedule can show, computed once so the rows
|
|
14
|
+
* that render the messages and the Save button that must refuse them can
|
|
15
|
+
* never disagree.
|
|
16
|
+
*/
|
|
17
|
+
export declare function getManualRowErrors(installments: ScheduledInstallment[]): ManualRowErrors;
|
|
18
|
+
export declare function hasManualRowErrors(errors: ManualRowErrors): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Re-dates installment #1 without touching the rest of the schedule.
|
|
21
|
+
*
|
|
22
|
+
* The generator produces one uniform cadence from a single anchor, which
|
|
23
|
+
* cannot express "charge #1 today, then follow the term start". This applies
|
|
24
|
+
* that shape on top: only the first date moves, and only when an override is
|
|
25
|
+
* given and it actually differs.
|
|
26
|
+
*
|
|
27
|
+
* Amounts are never touched — the first-installment rounding remainder stays
|
|
28
|
+
* where the generator put it.
|
|
29
|
+
*/
|
|
30
|
+
export declare function applyFirstInstallmentDateOverride(installments: ScheduledInstallment[], firstInstallmentDateOverride?: string): ScheduledInstallment[];
|
|
31
|
+
/**
|
|
32
|
+
* Whether the installment's payment already happened: it was paid, and may
|
|
33
|
+
* since have been refunded in part or in full. Such a row is a record of money
|
|
34
|
+
* that moved, so it cannot be paid again, edited or deleted.
|
|
35
|
+
*/
|
|
36
|
+
export declare function isSettledInstallment(status: ScheduledInstallment['status']): boolean;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface KeyValueRow {
|
|
3
|
+
id?: string;
|
|
4
|
+
label: React.ReactNode;
|
|
5
|
+
value: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export type KeyValueRowsDensity = 'regular' | 'compact';
|
|
8
|
+
export interface KeyValueRowsProps {
|
|
9
|
+
rows: KeyValueRow[];
|
|
10
|
+
density?: KeyValueRowsDensity;
|
|
11
|
+
'data-testid'?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const KeyValueRows: React.FC<KeyValueRowsProps>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { KeyValueRowsDensity } from './KeyValueRows';
|
|
2
|
+
export declare const keyValueRowsClass: {
|
|
3
|
+
readonly list: "m-0 divide-y divide-pos-hair";
|
|
4
|
+
readonly row: "flex items-baseline gap-3";
|
|
5
|
+
readonly label: "min-w-0 text-[0.84375rem] text-default-500";
|
|
6
|
+
readonly value: "m-0 ml-auto flex min-w-0 flex-wrap justify-end gap-[0.3125rem] text-right text-[0.875rem] text-default-900 [overflow-wrap:anywhere]";
|
|
7
|
+
};
|
|
8
|
+
export declare const keyValueRowPadding: Record<KeyValueRowsDensity, string>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface LineItemRow {
|
|
3
|
+
id: string;
|
|
4
|
+
name: React.ReactNode;
|
|
5
|
+
details?: React.ReactNode[];
|
|
6
|
+
amount: React.ReactNode;
|
|
7
|
+
originalAmount?: React.ReactNode;
|
|
8
|
+
chip?: React.ReactNode;
|
|
9
|
+
tone?: 'violet';
|
|
10
|
+
}
|
|
11
|
+
export interface LineItemRowsProps {
|
|
12
|
+
items: LineItemRow[];
|
|
13
|
+
ariaLabel?: string;
|
|
14
|
+
originalAmountLabel?: string;
|
|
15
|
+
'data-testid'?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare const LineItemRows: React.FC<LineItemRowsProps>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const lineItemRowsClass: {
|
|
2
|
+
readonly list: "m-0 list-none p-0";
|
|
3
|
+
readonly row: "flex items-start gap-[0.875rem] border-t border-pos-hair px-5 py-3";
|
|
4
|
+
readonly body: "min-w-0 flex-1";
|
|
5
|
+
readonly name: "text-[0.90625rem] font-semibold text-default-900 [overflow-wrap:anywhere] [text-wrap:pretty]";
|
|
6
|
+
readonly details: "mt-[0.3125rem] flex flex-wrap items-center gap-[0.4375rem] text-[0.8125rem] text-default-500";
|
|
7
|
+
readonly separator: "text-default-400";
|
|
8
|
+
readonly detail: "tabular-nums";
|
|
9
|
+
readonly trailing: "flex shrink-0 flex-col items-end gap-1.5 text-right";
|
|
10
|
+
readonly amounts: "inline-flex items-baseline gap-2";
|
|
11
|
+
readonly original: "text-[0.8125rem] tabular-nums text-default-500 line-through";
|
|
12
|
+
readonly amount: "whitespace-nowrap text-[0.9375rem] font-bold tabular-nums text-default-900";
|
|
13
|
+
};
|
|
@@ -38,6 +38,8 @@ export interface ListPanelProps {
|
|
|
38
38
|
emptyContent?: React.ReactNode;
|
|
39
39
|
/** The table/list rendered when none of the async states apply. */
|
|
40
40
|
children?: React.ReactNode;
|
|
41
|
+
toolbar?: React.ReactNode;
|
|
42
|
+
variant?: 'default' | 'framed';
|
|
41
43
|
className?: string;
|
|
42
44
|
classNames?: ListPanelClassNames;
|
|
43
45
|
'data-testid'?: string;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const loadMoreFooterClass: {
|
|
2
|
+
readonly base: "flex flex-wrap items-center justify-center gap-2.5 border-t border-pos-hair px-5 py-[0.875rem] text-[0.84375rem] text-default-500";
|
|
3
|
+
readonly idle: "w-full";
|
|
4
|
+
readonly sentinel: "h-px w-full";
|
|
5
|
+
readonly spinner: "inline-flex";
|
|
6
|
+
readonly error: "text-pos-danger";
|
|
7
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type LoadMoreStatus = 'idle' | 'loading' | 'error' | 'end';
|
|
2
|
+
export interface LoadMoreFooterProps {
|
|
3
|
+
status: LoadMoreStatus;
|
|
4
|
+
onLoadMore: () => void;
|
|
5
|
+
loadingLabel: string;
|
|
6
|
+
errorLabel: string;
|
|
7
|
+
retryLabel: string;
|
|
8
|
+
endLabel?: string;
|
|
9
|
+
'data-testid'?: string;
|
|
10
|
+
}
|
|
@@ -9,6 +9,8 @@ export interface MetaCardRowProps {
|
|
|
9
9
|
label: string;
|
|
10
10
|
/** Associates the caption with the control it labels. */
|
|
11
11
|
htmlFor?: string;
|
|
12
|
+
/** Marks the caption with a red asterisk; pair it with the control's own required state. */
|
|
13
|
+
required?: boolean;
|
|
12
14
|
children: ReactNode;
|
|
13
15
|
className?: string;
|
|
14
16
|
'data-testid'?: string;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ModalPanelEntry, ModalPanelsController } from './useModalPanels';
|
|
3
|
+
export interface ModalPanelsProps<TPanel> {
|
|
4
|
+
/** The stack from `useModalPanels()`. */
|
|
5
|
+
panels: ModalPanelsController<TPanel>;
|
|
6
|
+
/** Renders one panel. Called for every entry on the stack; only the top one is shown. */
|
|
7
|
+
children: (panel: TPanel, entry: ModalPanelEntry<TPanel>) => React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export declare function ModalPanels<TPanel>({ panels, children }: ModalPanelsProps<TPanel>): React.ReactElement;
|
|
10
|
+
export interface ModalPanelHeaderProps {
|
|
11
|
+
/** Panel title, rendered as an `h2`. */
|
|
12
|
+
title: React.ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* Where Back goes. Default: the panel beneath, from the stack. Either way
|
|
15
|
+
* it goes through the discard guard, scoped to this panel.
|
|
16
|
+
*/
|
|
17
|
+
onBack?: () => void;
|
|
18
|
+
/** Back's accessible name. Default `'Back'`. */
|
|
19
|
+
backLabel?: string;
|
|
20
|
+
isBackDisabled?: boolean;
|
|
21
|
+
/** Back button size: `'md'` 40px, `'lg'` 48px (touch registers). Default `'md'`. */
|
|
22
|
+
size?: 'md' | 'lg';
|
|
23
|
+
/** Content at the end of the header, before the modal's close button. */
|
|
24
|
+
actions?: React.ReactNode;
|
|
25
|
+
className?: string;
|
|
26
|
+
/** Root test id; derives `-back` and `-title`. Default `'modal-panel-header'`. */
|
|
27
|
+
'data-testid'?: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Back + title for a panel pushed over the first one. Back is navigation, not
|
|
31
|
+
* one of the footer's decisions, so it lives top-left where it never moves.
|
|
32
|
+
* It is shown when there is somewhere to go back to (or `onBack` is given),
|
|
33
|
+
* and it is the element focus lands on when the panel opens.
|
|
34
|
+
*/
|
|
35
|
+
export declare const ModalPanelHeader: React.FC<ModalPanelHeaderProps>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface ModalPanelContextValue {
|
|
2
|
+
isActive: boolean;
|
|
3
|
+
canGoBack: boolean;
|
|
4
|
+
back: () => void;
|
|
5
|
+
setEntryFocus: (node: HTMLElement | null) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const ModalPanelContext: import('react').Context<ModalPanelContextValue | null>;
|
|
8
|
+
export interface ModalPanelState {
|
|
9
|
+
/** True for the panel on screen. */
|
|
10
|
+
isActive: boolean;
|
|
11
|
+
/** True when a panel lies beneath this one. */
|
|
12
|
+
canGoBack: boolean;
|
|
13
|
+
/** Returns to the panel beneath — asking first if this panel holds unsaved input. */
|
|
14
|
+
back: () => void;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The enclosing panel, for controls other than the header's Back — a footer
|
|
18
|
+
* Cancel, say. Outside `ModalPanels` it reports a lone, active panel.
|
|
19
|
+
*/
|
|
20
|
+
export declare function useModalPanel(): ModalPanelState;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/** First element in `container` a Tab press would reach, skipping anything inside a hidden or inert subtree. */
|
|
2
|
+
export declare function firstTabbable(container: HTMLElement): HTMLElement | null;
|
|
3
|
+
/** Still in `container` and still able to take focus — not removed, disabled or hidden since it was recorded. */
|
|
4
|
+
export declare function canStillFocus(element: HTMLElement | null, container: HTMLElement): element is HTMLElement;
|
|
5
|
+
/**
|
|
6
|
+
* A popup (menu, listbox) currently open from a trigger inside `container`,
|
|
7
|
+
* found through the trigger's own ARIA wiring: `aria-expanded="true"` plus
|
|
8
|
+
* `aria-controls` naming the popup.
|
|
9
|
+
*
|
|
10
|
+
* Only POPUPS: the trigger declares `aria-haspopup`, or the element it
|
|
11
|
+
* controls has a popup role. An expanded accordion or disclosure carries the
|
|
12
|
+
* same `aria-expanded` + `aria-controls` pair, but its region is page content
|
|
13
|
+
* that cannot take focus; treating it as a popup sent focus nowhere.
|
|
14
|
+
*/
|
|
15
|
+
export declare function openPopupFrom(container: HTMLElement): HTMLElement | null;
|
|
16
|
+
/**
|
|
17
|
+
* Fired by react-aria's `FocusScope` on the element it is about to restore
|
|
18
|
+
* focus to when an overlay (a menu, a select, a dialog) unmounts; cancelable,
|
|
19
|
+
* and bubbles from that element. It is react-aria's own seam for redirecting a
|
|
20
|
+
* restore, and the reason no timer is needed here (see the file header).
|
|
21
|
+
*/
|
|
22
|
+
export declare const FOCUS_RESTORE_EVENT = "react-aria-focus-scope-restore";
|
|
23
|
+
/** DOM handles per panel key, and which panel is on screen. Plain bookkeeping; never read during render. */
|
|
24
|
+
export declare class PanelFocusMemory {
|
|
25
|
+
private readonly panels;
|
|
26
|
+
private active;
|
|
27
|
+
setContainer(key: string, node: HTMLElement | null): void;
|
|
28
|
+
setEntry(key: string, node: HTMLElement | null): void;
|
|
29
|
+
remember(key: string, node: HTMLElement): void;
|
|
30
|
+
/** The panel now on screen, and whether the operator came back to it (vs. opened it). */
|
|
31
|
+
setActive(key: string, isReturn: boolean): void;
|
|
32
|
+
/**
|
|
33
|
+
* Puts focus in the panel on screen, unless it is already there. Returning:
|
|
34
|
+
* the element that last had focus in it — the opener of the panel just left.
|
|
35
|
+
* Entering, or when that element is gone: Back, then the first tabbable element.
|
|
36
|
+
*/
|
|
37
|
+
focusActive(): void;
|
|
38
|
+
/**
|
|
39
|
+
* Focus was dropped by an overlay closing over a hidden panel. If the
|
|
40
|
+
* operator has since opened a menu or select in the panel on screen, that
|
|
41
|
+
* is where they are; otherwise it is the panel's own target.
|
|
42
|
+
*/
|
|
43
|
+
recoverFocus(): void;
|
|
44
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { ModalPanels, ModalPanelHeader } from './ModalPanels';
|
|
2
|
+
export type { ModalPanelsProps, ModalPanelHeaderProps } from './ModalPanels';
|
|
3
|
+
export { useModalPanel } from './context';
|
|
4
|
+
export type { ModalPanelState } from './context';
|
|
5
|
+
export { useModalPanels } from './useModalPanels';
|
|
6
|
+
export type { ModalPanelsController, ModalPanelEntry } from './useModalPanels';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ModalPanelHeader slots. The header mirrors HeroUI's `ModalHeader` slot
|
|
3
|
+
* (`flex py-4 px-6 flex-initial text-large font-semibold`) so a panel header
|
|
4
|
+
* and the first panel's `ModalHeader` line up when they swap.
|
|
5
|
+
*
|
|
6
|
+
* `pl-4`, not `px-6`: the Back button's hit area is wider than its 20px glyph,
|
|
7
|
+
* so starting it 16px in puts the arrow on the 24px content edge. `pr-12`
|
|
8
|
+
* leaves the corner to HeroUI's absolutely-positioned close button.
|
|
9
|
+
*/
|
|
10
|
+
export declare const modalPanelHeaderClass = "flex flex-initial items-center gap-2 py-4 pl-4 pr-12 text-large font-semibold";
|
|
11
|
+
export declare const modalPanelTitleClass = "min-w-0 flex-1 truncate text-large font-semibold";
|
|
12
|
+
export declare const modalPanelActionsClass = "flex shrink-0 items-center gap-2";
|
|
13
|
+
export declare const modalPanelBackIconClass = "size-5";
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** One panel on the stack. `key` is unique per visit, so pushing the same panel twice mounts it twice. */
|
|
2
|
+
export interface ModalPanelEntry<TPanel> {
|
|
3
|
+
readonly key: string;
|
|
4
|
+
readonly panel: TPanel;
|
|
5
|
+
}
|
|
6
|
+
export interface ModalPanelsController<TPanel> {
|
|
7
|
+
/** The panel on top — the one on screen. */
|
|
8
|
+
readonly current: TPanel;
|
|
9
|
+
/** Bottom to top. Every entry stays mounted; only the last one is shown. */
|
|
10
|
+
readonly entries: readonly ModalPanelEntry<TPanel>[];
|
|
11
|
+
/** True when there is a panel beneath the current one. */
|
|
12
|
+
readonly canGoBack: boolean;
|
|
13
|
+
/** Opens `panel` on top; Back returns to the one showing now. */
|
|
14
|
+
push: (panel: TPanel) => void;
|
|
15
|
+
/** Returns to the panel beneath. No-op on the first panel. */
|
|
16
|
+
back: () => void;
|
|
17
|
+
/** Swaps the top panel for `panel` (e.g. a saved form for its detail); Back skips the old one. */
|
|
18
|
+
replace: (panel: TPanel) => void;
|
|
19
|
+
/** Starts over with a single fresh panel — `initial` unless another is given. */
|
|
20
|
+
reset: (panel?: TPanel) => void;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The back-stack behind `ModalPanels`: which panel is on screen, and where Back
|
|
24
|
+
* goes from it. Back goes where the operator came from because the stack
|
|
25
|
+
* remembers it — no per-panel "return to" flags to keep in step.
|
|
26
|
+
*
|
|
27
|
+
* Owned by the component that owns the modal, so it outlives the modal's
|
|
28
|
+
* content; call `reset()` when the modal closes to start the next visit fresh.
|
|
29
|
+
*/
|
|
30
|
+
export declare function useModalPanels<TPanel>(initial: TPanel): ModalPanelsController<TPanel>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { JSX } from 'react';
|
|
2
|
+
export interface NeedsFixDotProps {
|
|
3
|
+
/**
|
|
4
|
+
* Read out in place of the dot ("Needs a fix"). Required: without it the
|
|
5
|
+
* state is color alone. It follows the label it sits beside, so include any
|
|
6
|
+
* punctuation your language wants between the two.
|
|
7
|
+
*/
|
|
8
|
+
label: string;
|
|
9
|
+
className?: string;
|
|
10
|
+
/** Root test id. The visible dot is `${data-testid}-mark`. */
|
|
11
|
+
'data-testid'?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function NeedsFixDot({ label, className, 'data-testid': dataTestId, }: NeedsFixDotProps): JSX.Element;
|
|
14
|
+
export declare namespace NeedsFixDot {
|
|
15
|
+
var displayName: string;
|
|
16
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** The shape `firstNeedsFixKey` reads: an `UnderlineTabItem`, or any keyed item. */
|
|
2
|
+
export interface NeedsFixItem<K extends string = string> {
|
|
3
|
+
key: K;
|
|
4
|
+
needsFix?: boolean;
|
|
5
|
+
isDisabled?: boolean;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* The key a details panel should open on: the first item that needs a fix and
|
|
9
|
+
* can be selected, else `fallback`.
|
|
10
|
+
*
|
|
11
|
+
* A pure helper rather than tab behaviour, because only the host knows when
|
|
12
|
+
* the panel "opens" — moving to the next record keeps the tab the user is on.
|
|
13
|
+
*
|
|
14
|
+
* ```ts
|
|
15
|
+
* if (justOpened) setTab(firstNeedsFixKey(tabs, 'general'));
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare function firstNeedsFixKey<K extends string>(items: ReadonlyArray<NeedsFixItem<K>>, fallback: K): K;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The needs-fix dot's appearance, in one place.
|
|
3
|
+
*
|
|
4
|
+
* The color is inline, read from `adminSurfaceTokens`, not a Tailwind class:
|
|
5
|
+
* the dot carries meaning, so it must survive a consumer whose Tailwind
|
|
6
|
+
* `content` globs miss this package. Same reasoning as `VerticalSteps`'
|
|
7
|
+
* status tones and `StatusChip`'s `DOT_TONE`.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* `--warn` (warning-700), the tone `VerticalSteps` paints a step that needs a
|
|
11
|
+
* fix with. The prototype's amber-500 measures 2.15:1 on white, under the 3:1
|
|
12
|
+
* WCAG 1.4.11 asks of a graphic a sighted user reads state from; warning-700
|
|
13
|
+
* measures 5.02:1.
|
|
14
|
+
*/
|
|
15
|
+
export declare const NEEDS_FIX_DOT_COLOR: string;
|
|
16
|
+
export declare const needsFixDotClass: {
|
|
17
|
+
readonly root: "inline-flex shrink-0 items-center";
|
|
18
|
+
/** 6px, the prototype's `size-1.5`, in rem so a root font size change scales it. */
|
|
19
|
+
readonly dot: "block size-1.5 shrink-0 rounded-full";
|
|
20
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { JSX } from 'react';
|
|
2
|
+
import { NoticeProps } from './type';
|
|
3
|
+
/**
|
|
4
|
+
* An inline message with a severity: the DS answer to HeroUI's
|
|
5
|
+
* `Alert variant="flat" isClosable={false}` repeated per call, and to the
|
|
6
|
+
* hand-rolled red lines and boxes of the POS.
|
|
7
|
+
*
|
|
8
|
+
* Danger and warning are `role="alert"` (assertive), info and success
|
|
9
|
+
* `role="status"` (polite). Copy comes in as props; the caller owns i18n.
|
|
10
|
+
* The only motion is the dismiss button's press feedback, which is dropped
|
|
11
|
+
* when the OS or the POS asks for reduced motion.
|
|
12
|
+
*/
|
|
13
|
+
export declare function Notice({ tone, variant, title, description, actions, onDismiss, dismissLabel, role, className, 'data-testid': dataTestId, }: NoticeProps): JSX.Element;
|
|
14
|
+
export declare namespace Notice {
|
|
15
|
+
var displayName: string;
|
|
16
|
+
}
|