@veevarts/design-system 2.1.0-beta.2 → 2.1.0-beta.22
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 +39 -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/Table/Table.d.ts +7 -0
- package/dist/components/Table/index.d.ts +2 -0
- package/dist/components/index.d.ts +6 -0
- package/dist/index.cjs +8 -8
- package/dist/index.d.ts +4 -0
- package/dist/index.js +10705 -6282
- 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 +6 -0
- 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/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 +32 -0
- package/dist/patterns/DonationAmounts/types.d.ts +55 -1
- package/dist/patterns/DonationAmounts/utils/currency.d.ts +7 -3
- package/dist/patterns/EntityRow/EntityList.d.ts +9 -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/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/InstallmentSchedule/types.d.ts +29 -5
- package/dist/patterns/InstallmentSchedule/utils.d.ts +6 -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/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/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/ToolbarButton/ToolbarButton.d.ts +2 -0
- package/dist/patterns/UnderlineTabs/UnderlineTabs.d.ts +20 -1
- package/dist/patterns/UnderlineTabs/index.d.ts +1 -1
- package/dist/patterns/UnderlineTabs/styles.d.ts +10 -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 +73 -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 +16 -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 +25 -1
- package/dist/tailwind/index.d.ts +39 -0
- package/dist/tailwind/index.mjs +25 -1
- package/dist/test/ReducedMotion.d.ts +4 -0
- package/dist/test/RootFontSize.d.ts +5 -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/root-font-size.d.ts +8 -0
- package/dist/tokens/pos-surface.d.ts +23 -4
- package/package.json +2 -2
- /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,15 @@
|
|
|
1
|
+
export declare const activityTimelineClass: {
|
|
2
|
+
readonly list: "m-0 list-none p-0 pl-0.5";
|
|
3
|
+
readonly event: "flex gap-3.5";
|
|
4
|
+
readonly eventSpaced: "pb-4";
|
|
5
|
+
readonly rail: "flex flex-none flex-col items-center";
|
|
6
|
+
readonly dot: "mt-[0.3125rem] size-2.5 rounded-full";
|
|
7
|
+
readonly connector: "mt-1 w-[1.5px] flex-1 bg-pos-hair";
|
|
8
|
+
readonly body: "min-w-0 flex-1 pb-0.5";
|
|
9
|
+
readonly head: "flex min-w-0 flex-wrap items-baseline gap-x-3";
|
|
10
|
+
readonly title: "min-w-0 text-[0.90625rem] font-semibold text-default-900 [overflow-wrap:anywhere]";
|
|
11
|
+
readonly timestamp: "ml-auto min-w-0 max-w-full text-[0.8125rem] tabular-nums text-default-500 [overflow-wrap:anywhere]";
|
|
12
|
+
readonly detail: "mt-[0.1875rem] min-w-0 text-[0.84375rem] leading-[1.5] text-default-500 [overflow-wrap:anywhere]";
|
|
13
|
+
readonly actor: "mt-[0.1875rem] min-w-0 text-[0.78125rem] text-default-500 [overflow-wrap:anywhere]";
|
|
14
|
+
readonly empty: "text-[0.875rem] text-default-500";
|
|
15
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { RecordTone } from '../shared/recordTone';
|
|
3
|
+
export interface ActivityTimelineEvent {
|
|
4
|
+
id: string;
|
|
5
|
+
tone: RecordTone;
|
|
6
|
+
title: ReactNode;
|
|
7
|
+
timestamp: ReactNode;
|
|
8
|
+
detail?: ReactNode;
|
|
9
|
+
actor?: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
export interface ActivityTimelineProps {
|
|
12
|
+
events: ActivityTimelineEvent[];
|
|
13
|
+
emptyContent?: ReactNode;
|
|
14
|
+
'data-testid'?: string;
|
|
15
|
+
}
|
|
@@ -35,6 +35,7 @@ export interface AdminTableProps {
|
|
|
35
35
|
footer?: React.ReactNode;
|
|
36
36
|
/** Accessible name. Required: a table with no name is unnavigable by screen reader. */
|
|
37
37
|
ariaLabel: string;
|
|
38
|
+
variant?: 'default' | 'framed';
|
|
38
39
|
className?: string;
|
|
39
40
|
classNames?: AdminTableClassNames;
|
|
40
41
|
'data-testid'?: string;
|
|
@@ -42,3 +42,9 @@ export declare const adminRowClass = "border-t border-acct-hair transition-color
|
|
|
42
42
|
export declare const adminTableClass = "w-full";
|
|
43
43
|
/** The strip under the table where a pager sits. */
|
|
44
44
|
export declare const adminTableFooterClass = "border-t border-acct-border px-5 py-3.5";
|
|
45
|
+
export declare const adminTableFramedClass: {
|
|
46
|
+
readonly base: "overflow-x-auto";
|
|
47
|
+
readonly th: "h-auto whitespace-nowrap border-b border-pos-hair bg-transparent px-4 py-[0.875rem] text-left text-[0.6875rem] font-semibold uppercase leading-[1.5] tracking-[.055em] text-default-500 first:rounded-none last:rounded-none last:pr-3";
|
|
48
|
+
readonly tr: "border-t border-pos-hair transition-colors duration-[120ms] first:border-t-0 data-[focus-visible=true]:outline-offset-[-2px] [tbody>&]:hover:bg-default-50 [tbody>&]:data-[hover=true]:bg-default-50 motion-reduce:transition-none [html[data-pos-reduce-motion=true]_&]:transition-none";
|
|
49
|
+
readonly td: "h-[3.875rem] px-4 data-[focus-visible=true]:outline-offset-[-2px] py-[0.625rem] align-middle text-[0.875rem] text-default-900 last:pr-3";
|
|
50
|
+
};
|
|
@@ -1,53 +1,13 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
+
import { AdminFieldLabelProps, AdminTextFieldProps } from './types';
|
|
2
3
|
/**
|
|
3
4
|
* The uppercase field label, standalone — for a control this component does
|
|
4
5
|
* not cover (a checkbox group, a read-only preview) that should still be
|
|
5
6
|
* captioned like every other admin field. `suffix` is the lighter tail:
|
|
6
7
|
* "· optional", "· auto-generated, immutable".
|
|
7
|
-
*/
|
|
8
|
-
export declare const AdminFieldLabel: React.FC<{
|
|
9
|
-
children: React.ReactNode;
|
|
10
|
-
suffix?: React.ReactNode;
|
|
11
|
-
className?: string;
|
|
12
|
-
'data-testid'?: string;
|
|
13
|
-
}>;
|
|
14
|
-
interface AdminTextFieldBase {
|
|
15
|
-
/** Uppercase label above the control. Omit only when an adjacent element already names it. */
|
|
16
|
-
label?: React.ReactNode;
|
|
17
|
-
/** Lighter annotation after the label (e.g. `· optional`). Ignored without a label. */
|
|
18
|
-
labelSuffix?: React.ReactNode;
|
|
19
|
-
value: string;
|
|
20
|
-
placeholder?: string;
|
|
21
|
-
disabled?: boolean;
|
|
22
|
-
/** Monospace face without the read-only treatment, for codes the user types. */
|
|
23
|
-
mono?: boolean;
|
|
24
|
-
/** Claim initial focus. Only for the first field of a dialog, never on a page. */
|
|
25
|
-
autoFocus?: boolean;
|
|
26
|
-
/** Small helper or error text under the control. */
|
|
27
|
-
hint?: React.ReactNode;
|
|
28
|
-
/** Renders the hint as an error and marks the control invalid. */
|
|
29
|
-
invalid?: boolean;
|
|
30
|
-
className?: string;
|
|
31
|
-
'data-testid'?: string;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* `onChange` is REQUIRED unless the field is read-only.
|
|
35
|
-
*
|
|
36
|
-
* This is a controlled input: given a `value` and no handler, React pins it and
|
|
37
|
-
* typing does nothing — a field that looks editable, accepts focus, and silently
|
|
38
|
-
* discards every keystroke. That is indistinguishable from a bug at a glance,
|
|
39
|
-
* and it is what happens by accident when someone renders one to show a value.
|
|
40
8
|
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
* and announces it correctly.
|
|
9
|
+
* `isRequired` adds a visible `*` and the screen-reader `requiredLabel`;
|
|
10
|
+
* `help` adds an ⓘ that opens it in a popover, kept outside the label text.
|
|
44
11
|
*/
|
|
45
|
-
export
|
|
46
|
-
readOnly: true;
|
|
47
|
-
onChange?: never;
|
|
48
|
-
} | {
|
|
49
|
-
readOnly?: false;
|
|
50
|
-
onChange: (value: string) => void;
|
|
51
|
-
});
|
|
12
|
+
export declare const AdminFieldLabel: React.FC<AdminFieldLabelProps>;
|
|
52
13
|
export declare const AdminTextField: React.FC<AdminTextFieldProps>;
|
|
53
|
-
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { AdminFieldLabel, AdminTextField } from './AdminTextField';
|
|
2
|
-
export type { AdminTextFieldProps } from './
|
|
3
|
-
export { adminFieldErrorClass, adminFieldHintClass, adminFieldLabelClass, adminFieldLabelSuffixClass, adminInputClass, adminInputReadOnlyClass, adminInputWrapperClass, } from './styles';
|
|
2
|
+
export type { AdminTextFieldProps, AdminFieldLabelProps, AdminFieldRequiredProps, AdminFieldHelpProps } from './types';
|
|
3
|
+
export { adminFieldErrorClass, adminFieldHelpButtonClass, adminFieldHelpContentClass, adminFieldHelpIconClass, adminFieldHintClass, adminFieldLabelClass, adminFieldLabelNoAutoMarkClass, adminFieldLabelRowClass, adminFieldLabelSuffixClass, adminFieldRequiredClass, adminInputClass, adminInputReadOnlyClass, adminInputWrapperClass, } from './styles';
|
|
@@ -22,6 +22,35 @@ export declare const adminFieldLabelClass = "text-[11px] font-semibold uppercase
|
|
|
22
22
|
* aside, not as part of the field's name.
|
|
23
23
|
*/
|
|
24
24
|
export declare const adminFieldLabelSuffixClass = "font-normal normal-case tracking-normal";
|
|
25
|
+
/**
|
|
26
|
+
* The visible `*` of a required field. `after:content-none` switches off the
|
|
27
|
+
* `*` HeroUI's own `isRequired` paints into its label slot, so there is one
|
|
28
|
+
* mark, the one carrying the screen-reader word.
|
|
29
|
+
*/
|
|
30
|
+
export declare const adminFieldRequiredClass = "ms-0.5 text-acct-danger";
|
|
31
|
+
/**
|
|
32
|
+
* The label row a field with `help` draws itself, in place of HeroUI's.
|
|
33
|
+
* HeroUI pushes its box down by `font-size-small + 10px` (24px) to make room
|
|
34
|
+
* for its outside label; this row takes the same height from the same
|
|
35
|
+
* variable, so a field with help and one without line up in a form row.
|
|
36
|
+
* `min-h` rather than `h`, so a label that wraps grows the row instead of
|
|
37
|
+
* running into the box.
|
|
38
|
+
*
|
|
39
|
+
* `text-foreground` because that is the color HeroUI's label actually renders
|
|
40
|
+
* in above the box (`group-data-[filled-within=true]:text-foreground` beats
|
|
41
|
+
* the `text-acct-muted` it is given), measured at `rgb(17, 24, 28)`.
|
|
42
|
+
*/
|
|
43
|
+
export declare const adminFieldLabelRowClass = "mb-0 min-h-[calc(var(--heroui-font-size-small)_+_10px)] text-foreground";
|
|
44
|
+
/** Added to HeroUI's `label` slot so its `isRequired` mark does not double ours. */
|
|
45
|
+
export declare const adminFieldLabelNoAutoMarkClass = "after:content-none";
|
|
46
|
+
/**
|
|
47
|
+
* The ⓘ that opens a field's help: a 24px round hit target (WCAG 2.5.8) whose
|
|
48
|
+
* negative margin keeps the 11px label row from growing to fit it.
|
|
49
|
+
*/
|
|
50
|
+
export declare const adminFieldHelpButtonClass = "ms-0.5 -my-1.5 size-6 min-w-6 align-middle text-acct-sub data-[hover=true]:bg-acct-page data-[hover=true]:text-acct-ink";
|
|
51
|
+
export declare const adminFieldHelpIconClass = "size-4";
|
|
52
|
+
/** The popover the ⓘ opens. Body copy, so sentence case and ink. */
|
|
53
|
+
export declare const adminFieldHelpContentClass = "max-w-xs rounded-xl px-3 py-2 text-xs leading-normal text-acct-ink2";
|
|
25
54
|
/**
|
|
26
55
|
* The 38px box — HeroUI's `inputWrapper` slot, which carries the border and
|
|
27
56
|
* background (the `input` slot is the bare field).
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The required mark. Plain optional props rather than a union that forces
|
|
4
|
+
* `requiredLabel` with `isRequired`: a union collapses under
|
|
5
|
+
* `Omit<AdminTextFieldProps, …>`, so every wrapper that forwards props would
|
|
6
|
+
* stop compiling.
|
|
7
|
+
*/
|
|
8
|
+
export interface AdminFieldRequiredProps {
|
|
9
|
+
/** Adds a visible `*` after the label (and its suffix). */
|
|
10
|
+
isRequired?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* The word screen readers hear for the `*` ("required", "obligatoire").
|
|
13
|
+
* Pass it with `isRequired`: the `*` itself is hidden from them.
|
|
14
|
+
*/
|
|
15
|
+
requiredLabel?: string;
|
|
16
|
+
}
|
|
17
|
+
/** Help on demand: an ⓘ button after the label that opens it in a popover. */
|
|
18
|
+
export interface AdminFieldHelpProps {
|
|
19
|
+
help?: React.ReactNode;
|
|
20
|
+
/** Accessible name of the ⓘ ("About timezone"). Without it the ⓘ is named by the label text. */
|
|
21
|
+
helpLabel?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface AdminFieldLabelProps extends AdminFieldRequiredProps, AdminFieldHelpProps {
|
|
24
|
+
children: React.ReactNode;
|
|
25
|
+
/** The lighter tail: "· optional", "· auto-generated, immutable". */
|
|
26
|
+
suffix?: React.ReactNode;
|
|
27
|
+
/**
|
|
28
|
+
* `id` of the control this captions. The text then renders as a real
|
|
29
|
+
* `<label>`, so clicking it focuses the control. The ⓘ stays outside it.
|
|
30
|
+
*/
|
|
31
|
+
htmlFor?: string;
|
|
32
|
+
/** `id` of the text element, for a group to point `aria-labelledby` at. */
|
|
33
|
+
id?: string;
|
|
34
|
+
className?: string;
|
|
35
|
+
'data-testid'?: string;
|
|
36
|
+
}
|
|
37
|
+
export interface AdminTextFieldBase extends AdminFieldRequiredProps, AdminFieldHelpProps {
|
|
38
|
+
/** Uppercase label above the control. Omit only when an adjacent element already names it. */
|
|
39
|
+
label?: React.ReactNode;
|
|
40
|
+
/** Lighter annotation after the label (e.g. `· optional`). Ignored without a label. */
|
|
41
|
+
labelSuffix?: React.ReactNode;
|
|
42
|
+
value: string;
|
|
43
|
+
placeholder?: string;
|
|
44
|
+
disabled?: boolean;
|
|
45
|
+
/** Monospace face without the read-only treatment, for codes the user types. */
|
|
46
|
+
mono?: boolean;
|
|
47
|
+
/** Claim initial focus. Only for the first field of a dialog, never on a page. */
|
|
48
|
+
autoFocus?: boolean;
|
|
49
|
+
/** Small helper or error text under the control. */
|
|
50
|
+
hint?: React.ReactNode;
|
|
51
|
+
/** Renders the hint as an error and marks the control invalid. */
|
|
52
|
+
invalid?: boolean;
|
|
53
|
+
className?: string;
|
|
54
|
+
'data-testid'?: string;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* `onChange` is REQUIRED unless the field is read-only.
|
|
58
|
+
*
|
|
59
|
+
* This is a controlled input: given a `value` and no handler, React pins it and
|
|
60
|
+
* typing does nothing — a field that looks editable, accepts focus, and silently
|
|
61
|
+
* discards every keystroke. That is indistinguishable from a bug at a glance,
|
|
62
|
+
* and it is what happens by accident when someone renders one to show a value.
|
|
63
|
+
*
|
|
64
|
+
* Showing a value without accepting edits is a real case, so it stays possible;
|
|
65
|
+
* it just has to be said, with `readOnly`, which also renders it as system-owned
|
|
66
|
+
* and announces it correctly.
|
|
67
|
+
*
|
|
68
|
+
* `isRequired` / `help` behave as on {@link AdminFieldLabelProps}, and are
|
|
69
|
+
* ignored without a `label`. `isRequired` also marks the input
|
|
70
|
+
* `aria-required`, without the browser's own `required` validation.
|
|
71
|
+
*/
|
|
72
|
+
export type AdminTextFieldProps = AdminTextFieldBase & ({
|
|
73
|
+
readOnly: true;
|
|
74
|
+
onChange?: never;
|
|
75
|
+
} | {
|
|
76
|
+
readOnly?: false;
|
|
77
|
+
onChange: (value: string) => void;
|
|
78
|
+
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
+
import { AdminToolbarSearchWidth, AdminToolbarSize } from './types';
|
|
2
3
|
export interface AdminToolbarProps {
|
|
3
4
|
searchValue: string;
|
|
4
5
|
onSearchChange: (value: string) => void;
|
|
@@ -8,12 +9,22 @@ export interface AdminToolbarProps {
|
|
|
8
9
|
searchPlaceholder?: string;
|
|
9
10
|
/** Leading glyph inside the search box. */
|
|
10
11
|
searchIcon?: React.ReactNode;
|
|
12
|
+
/** Shows a clear button inside the search box while it holds text. Off by default. */
|
|
13
|
+
searchClearable?: boolean;
|
|
14
|
+
/** The clear button's accessible name. `'Clear search'` by default; pass a translation. */
|
|
15
|
+
clearLabel?: string;
|
|
11
16
|
/** Filters, sort pickers, a toggle — laid out after the search box. */
|
|
12
17
|
children?: React.ReactNode;
|
|
13
18
|
/** Pushed to the far right, for a primary action. */
|
|
14
19
|
trailing?: React.ReactNode;
|
|
15
|
-
/**
|
|
16
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Search box width. `'md'` (280px; 250px framed) by default, `'lg'` (360px)
|
|
22
|
+
* for wide tables, `'fill'` to grow into the space the row leaves.
|
|
23
|
+
*/
|
|
24
|
+
searchWidth?: AdminToolbarSearchWidth;
|
|
25
|
+
/** `'lg'` is the 48px touch field with 16px text; `'md'` (default) keeps each variant's own height. */
|
|
26
|
+
size?: AdminToolbarSize;
|
|
27
|
+
variant?: 'default' | 'framed';
|
|
17
28
|
className?: string;
|
|
18
29
|
'data-testid'?: string;
|
|
19
30
|
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { AdminToolbarSearchWidth, AdminToolbarSize } from './types';
|
|
2
|
+
/** The default variant: a pixel-port of the accounting mockups, so its values stay in px. */
|
|
3
|
+
export declare const DEFAULT_CLASS: {
|
|
4
|
+
readonly base: "flex flex-wrap items-center gap-3 mb-4";
|
|
5
|
+
readonly trailing: "ml-auto";
|
|
6
|
+
readonly icon: "flex text-acct-muted";
|
|
7
|
+
readonly inputWrapper: string;
|
|
8
|
+
readonly input: "text-[13.5px] text-acct-ink";
|
|
9
|
+
};
|
|
10
|
+
export declare const DEFAULT_SEARCH_WIDTH: Record<AdminToolbarSearchWidth, string>;
|
|
11
|
+
export declare const FRAMED_WIDE_REM = 48;
|
|
12
|
+
export declare const FRAMED_CLASS: {
|
|
13
|
+
readonly base: "flex flex-wrap items-center gap-2.5 border-b border-pos-hair px-4 py-[0.875rem]";
|
|
14
|
+
readonly narrow: "[&_[data-slot=filter-select-group]]:flex [&_[data-slot=filter-select-group]]:flex-wrap [&_[data-slot=filter-select-group]]:!max-w-none [&_[data-slot=filter-select]]:!max-w-none [&_[data-slot=filter-select]]:!min-w-[calc(50%-0.3125rem)] [&_[data-slot=filter-select]]:grow [&_[data-slot=filter-select]]:basis-[calc(50%-0.3125rem)]";
|
|
15
|
+
readonly searchWide: "ml-auto";
|
|
16
|
+
/** Fill wins over the narrow rule: it already takes the row, and keeps a trailing action beside it until 12.5rem. */
|
|
17
|
+
readonly searchFill: "min-w-[12.5rem] flex-1";
|
|
18
|
+
readonly searchNarrow: "basis-full";
|
|
19
|
+
readonly inputBaseNarrow: "w-full";
|
|
20
|
+
readonly inputWrapper: "h-[2.375rem] min-h-[2.375rem] !h-[2.375rem] rounded-[0.625rem] border border-pos-field bg-white pl-3 pr-3 shadow-none data-[hover=true]:border-pos-field group-data-[focus=true]:border-primary";
|
|
21
|
+
readonly innerWrapper: "gap-[0.3125rem]";
|
|
22
|
+
readonly input: "text-ellipsis text-[0.875rem] text-default-900 data-[has-start-content=true]:ps-0.5";
|
|
23
|
+
readonly icon: "flex text-default-400 [&_svg]:size-4";
|
|
24
|
+
};
|
|
25
|
+
export declare const FRAMED_SEARCH_WIDTH: Record<AdminToolbarSearchWidth, string>;
|
|
26
|
+
/**
|
|
27
|
+
* `lg` is the POS register's touch row: a 48px field with 16px text and a 20px
|
|
28
|
+
* glyph, in rem so the text-size setting scales it. Merged after either
|
|
29
|
+
* variant's own classes, so it overrides their height and type only.
|
|
30
|
+
*/
|
|
31
|
+
export declare const LG_CLASS: {
|
|
32
|
+
readonly inputWrapper: "h-12 min-h-12 !h-12";
|
|
33
|
+
readonly input: "text-base";
|
|
34
|
+
readonly icon: "[&_svg]:size-5";
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* The clear control: a DS `Button`, so it is in the tab order and takes a
|
|
38
|
+
* translated name, unlike HeroUI's `isClearable` (tabIndex -1, English label).
|
|
39
|
+
* 32px inside the 38–40px fields, 44px inside the 48px one.
|
|
40
|
+
*/
|
|
41
|
+
export declare const CLEAR_CLASS: {
|
|
42
|
+
readonly button: "shrink-0 text-default-500";
|
|
43
|
+
/** The browser's own search "x" would sit beside ours. */
|
|
44
|
+
readonly input: "[&::-webkit-search-cancel-button]:appearance-none";
|
|
45
|
+
};
|
|
46
|
+
export declare const CLEAR_SIZE_CLASS: Record<AdminToolbarSize, {
|
|
47
|
+
button: string;
|
|
48
|
+
icon: string;
|
|
49
|
+
}>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare const amountListClass: {
|
|
2
|
+
readonly base: "w-full";
|
|
3
|
+
readonly list: "m-0 list-none p-0";
|
|
4
|
+
readonly item: "border-t border-pos-hair";
|
|
5
|
+
readonly row: "flex w-full items-start gap-3 px-5 py-3 text-left";
|
|
6
|
+
readonly rowInteractive: "cursor-pointer outline-none transition-colors hover:bg-default-50 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-primary motion-reduce:transition-none [html[data-pos-reduce-motion=true]_&]:transition-none";
|
|
7
|
+
readonly dot: "mt-[0.4375rem] size-[0.4375rem] shrink-0 rounded-full";
|
|
8
|
+
readonly body: "flex min-w-0 flex-1 flex-col";
|
|
9
|
+
readonly title: "text-[0.875rem] font-semibold text-default-900 [overflow-wrap:anywhere] [text-wrap:pretty]";
|
|
10
|
+
readonly meta: "mt-1 flex min-w-0 flex-wrap items-center gap-[0.4375rem] text-[0.78125rem] text-default-500";
|
|
11
|
+
readonly reference: "min-w-0 font-normal text-primary [overflow-wrap:anywhere]";
|
|
12
|
+
readonly separator: "text-default-400";
|
|
13
|
+
readonly timestamp: "tabular-nums";
|
|
14
|
+
readonly detail: "mt-[0.1875rem] text-[0.78125rem] text-default-500 [overflow-wrap:anywhere] [text-wrap:pretty]";
|
|
15
|
+
readonly trailing: "max-w-[45%] min-w-min shrink-0 text-right text-[0.90625rem]";
|
|
16
|
+
readonly amount: "whitespace-nowrap text-[0.90625rem] font-bold tabular-nums text-default-900";
|
|
17
|
+
readonly note: "text-[0.78125rem] italic text-default-500 [overflow-wrap:anywhere]";
|
|
18
|
+
readonly footer: "flex items-baseline gap-3 border-t border-pos-line bg-pos-page px-5 py-[0.8125rem]";
|
|
19
|
+
readonly footerLabel: "min-w-0 text-[0.875rem] font-bold text-default-900 [overflow-wrap:anywhere]";
|
|
20
|
+
readonly footerAmount: "ml-auto whitespace-nowrap text-[1rem] font-bold tabular-nums text-default-900";
|
|
21
|
+
readonly footerNote: "border-t border-pos-hair px-5 py-[0.8125rem] text-[0.78125rem] leading-[1.6] text-default-500";
|
|
22
|
+
readonly empty: "px-5 pb-5 pt-[0.875rem] text-[0.875rem] text-default-500";
|
|
23
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { RecordTone } from '../shared/recordTone';
|
|
3
|
+
export interface AmountListRow {
|
|
4
|
+
id: string;
|
|
5
|
+
tone: RecordTone;
|
|
6
|
+
title: ReactNode;
|
|
7
|
+
reference?: ReactNode;
|
|
8
|
+
timestamp?: ReactNode;
|
|
9
|
+
detail?: ReactNode;
|
|
10
|
+
amount?: ReactNode;
|
|
11
|
+
amountTone?: 'positive' | 'negative' | 'neutral';
|
|
12
|
+
note?: ReactNode;
|
|
13
|
+
noteTone?: 'muted' | 'warn';
|
|
14
|
+
}
|
|
15
|
+
export interface AmountListProps {
|
|
16
|
+
rows: AmountListRow[];
|
|
17
|
+
footer?: {
|
|
18
|
+
label: ReactNode;
|
|
19
|
+
amount: ReactNode;
|
|
20
|
+
amountTone?: 'positive' | 'negative' | 'neutral';
|
|
21
|
+
note?: ReactNode;
|
|
22
|
+
};
|
|
23
|
+
emptyContent?: ReactNode;
|
|
24
|
+
onSelect?: (id: string) => void;
|
|
25
|
+
'data-testid'?: string;
|
|
26
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare const cardListClass: {
|
|
2
|
+
readonly base: "w-full";
|
|
3
|
+
readonly list: "m-0 list-none p-0";
|
|
4
|
+
readonly item: "relative border-b border-pos-hair last:border-b-0";
|
|
5
|
+
readonly card: "block w-full px-4 py-[0.875rem] text-left";
|
|
6
|
+
readonly cardInteractive: "cursor-pointer outline-none transition-colors hover:bg-default-50 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-primary motion-reduce:transition-none [html[data-pos-reduce-motion=true]_&]:transition-none";
|
|
7
|
+
readonly headline: "flex items-baseline gap-2.5";
|
|
8
|
+
readonly headlineWithActions: "pr-[3.25rem]";
|
|
9
|
+
readonly title: "min-w-0 text-[0.90625rem] font-semibold text-primary [overflow-wrap:anywhere]";
|
|
10
|
+
readonly amount: "ml-auto shrink-0 whitespace-nowrap text-[0.9375rem] font-bold tabular-nums text-default-900";
|
|
11
|
+
readonly actions: "absolute right-4 top-[0.1875rem] z-[1]";
|
|
12
|
+
readonly chips: "mt-[0.5625rem] flex flex-wrap gap-1.5";
|
|
13
|
+
readonly chipsLine: "mt-[0.5625rem] flex items-center gap-2.5";
|
|
14
|
+
readonly chipsInline: "flex min-w-0 flex-wrap gap-1.5";
|
|
15
|
+
readonly rows: "mt-[0.5625rem] block";
|
|
16
|
+
readonly row: "flex items-baseline gap-3 py-[0.1875rem] text-[0.8125rem]";
|
|
17
|
+
readonly rowLabel: "shrink-0 text-default-500";
|
|
18
|
+
readonly rowValue: "ml-auto min-w-0 text-right text-default-700 [overflow-wrap:anywhere]";
|
|
19
|
+
readonly skeletonRow: "border-b border-pos-hair p-4 last:border-b-0";
|
|
20
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface CardListItem {
|
|
3
|
+
id: string;
|
|
4
|
+
title: ReactNode;
|
|
5
|
+
amount?: ReactNode;
|
|
6
|
+
chips?: ReactNode;
|
|
7
|
+
rows?: Array<{
|
|
8
|
+
label: string;
|
|
9
|
+
value: ReactNode;
|
|
10
|
+
}>;
|
|
11
|
+
actions?: ReactNode;
|
|
12
|
+
}
|
|
13
|
+
export interface CardListProps {
|
|
14
|
+
items: CardListItem[];
|
|
15
|
+
ariaLabel: string;
|
|
16
|
+
onSelect?: (id: string) => void;
|
|
17
|
+
loading?: boolean;
|
|
18
|
+
skeletonCount?: number;
|
|
19
|
+
'data-testid'?: string;
|
|
20
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export type CardStackLayout = 'stack' | 'grid';
|
|
3
|
+
export interface CardStackProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
layout?: CardStackLayout;
|
|
5
|
+
'data-testid'?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const CardStack: React.FC<CardStackProps>;
|
|
@@ -29,6 +29,10 @@ export interface CashTenderLabels {
|
|
|
29
29
|
* `{due}` is replaced with the formatted due amount.
|
|
30
30
|
*/
|
|
31
31
|
insufficientMessageTemplate?: string;
|
|
32
|
+
exactAmountLabel?: string;
|
|
33
|
+
exactAmountAriaTemplate?: string;
|
|
34
|
+
quickAmountsLabel?: string;
|
|
35
|
+
quickAmountAriaTemplate?: string;
|
|
32
36
|
}
|
|
33
37
|
export interface CashTenderFormProps {
|
|
34
38
|
/**
|
|
@@ -70,6 +74,8 @@ export interface CashTenderFormProps {
|
|
|
70
74
|
* the guard is value-based. Omit for no cap.
|
|
71
75
|
*/
|
|
72
76
|
maxAmount?: number;
|
|
77
|
+
quickAmounts?: readonly number[];
|
|
78
|
+
showExactAmount?: boolean;
|
|
73
79
|
/**
|
|
74
80
|
* Auto-focus the Cash Received field when this component mounts.
|
|
75
81
|
* Pair with `key={...}` from the host to re-trigger focus on every
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { SignedAmountTone } from '../shared/recordTone';
|
|
3
|
+
export type CellTextVariant = 'text' | 'reference' | 'amount';
|
|
4
|
+
export interface CellTextProps {
|
|
5
|
+
variant?: CellTextVariant;
|
|
6
|
+
tone?: SignedAmountTone;
|
|
7
|
+
secondary?: React.ReactNode;
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
'data-testid'?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const CellText: React.FC<CellTextProps>;
|
|
12
|
+
export interface ChipStackProps {
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
'data-testid'?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare const ChipStack: React.FC<ChipStackProps>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CellTextVariant } from './CellText';
|
|
2
|
+
export declare const cellTextClass: {
|
|
3
|
+
readonly base: "whitespace-nowrap text-[0.875rem]";
|
|
4
|
+
readonly secondary: "text-default-500";
|
|
5
|
+
readonly chipStack: "inline-flex flex-col items-start gap-[0.3125rem]";
|
|
6
|
+
};
|
|
7
|
+
export declare const cellTextVariantClass: Record<CellTextVariant, string>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { DiscardGuardController } from './useDiscardGuard';
|
|
3
|
+
/** @internal Used by `ModalPanels` to make each panel its own guard scope. */
|
|
4
|
+
export declare const DiscardGuardScope: React.FC<{
|
|
5
|
+
scope: string;
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
}>;
|
|
8
|
+
export interface DiscardGuardProps {
|
|
9
|
+
/** The controller from `useDiscardGuard()`. */
|
|
10
|
+
guard: DiscardGuardController;
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
/** Confirmation heading. Default `'Discard changes?'`. */
|
|
13
|
+
title?: string;
|
|
14
|
+
/** What is lost by confirming. Default `'What you entered will be lost.'`. */
|
|
15
|
+
description?: React.ReactNode;
|
|
16
|
+
/** Confirm (discard) label. Default `'Discard'`. */
|
|
17
|
+
confirmLabel?: string;
|
|
18
|
+
/** Label of the action that returns to the form. Default `'Keep editing'`. */
|
|
19
|
+
keepEditingLabel?: string;
|
|
20
|
+
/** Root test id of the confirmation; derives `-confirm` and `-dismiss`. Default `'discard-guard'`. */
|
|
21
|
+
'data-testid'?: string;
|
|
22
|
+
}
|
|
23
|
+
export declare const DiscardGuard: React.FC<DiscardGuardProps>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { DirtyReport, Leave } from './useDiscardGuard';
|
|
2
|
+
export interface DiscardGuardContextValue {
|
|
3
|
+
guardScope: (scope: string | null, leave: Leave) => void;
|
|
4
|
+
bypass: (leave: Leave) => void;
|
|
5
|
+
report: (id: string, report: DirtyReport) => void;
|
|
6
|
+
unreport: (id: string) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare const DiscardGuardContext: import('react').Context<DiscardGuardContextValue>;
|
|
9
|
+
/** The scope a reporter or a Back press belongs to. `ModalPanels` sets one per panel. */
|
|
10
|
+
export declare const DiscardScopeContext: import('react').Context<string | null>;
|
|
11
|
+
/**
|
|
12
|
+
* Call from a form while it is mounted. Unmounting withdraws the report, so a
|
|
13
|
+
* form that is gone never holds an exit hostage.
|
|
14
|
+
*/
|
|
15
|
+
export declare function useReportUnsavedChanges(isDirty: boolean): void;
|
|
16
|
+
export interface DiscardGuardActions {
|
|
17
|
+
/** Leave the whole surface: asks when any form is dirty. */
|
|
18
|
+
guard: (leave: Leave) => void;
|
|
19
|
+
/** Leave without asking — the input was saved. */
|
|
20
|
+
bypass: (leave: Leave) => void;
|
|
21
|
+
}
|
|
22
|
+
/** The guard's exits, for components rendered inside `<DiscardGuard>`. */
|
|
23
|
+
export declare function useDiscardGuardActions(): DiscardGuardActions;
|
|
24
|
+
/** @internal Back inside a panel: asks only when that panel holds unsaved input. */
|
|
25
|
+
export declare function useScopedDiscardGuard(): (leave: Leave) => void;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { DiscardGuard } from './DiscardGuard';
|
|
2
|
+
export type { DiscardGuardProps } from './DiscardGuard';
|
|
3
|
+
export { useDiscardGuard } from './useDiscardGuard';
|
|
4
|
+
export type { DiscardGuardController } from './useDiscardGuard';
|
|
5
|
+
export { useDiscardGuardActions, useReportUnsavedChanges } from './context';
|
|
6
|
+
export type { DiscardGuardActions } from './context';
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export type Leave = () => void;
|
|
2
|
+
/** One mounted reporter: which scope (panel) it belongs to and whether it holds unsaved input. */
|
|
3
|
+
export interface DirtyReport {
|
|
4
|
+
scope: string | null;
|
|
5
|
+
isDirty: boolean;
|
|
6
|
+
}
|
|
7
|
+
interface PendingLeave {
|
|
8
|
+
leave: Leave;
|
|
9
|
+
}
|
|
10
|
+
/** Wiring `<DiscardGuard>` reads; not part of the consumer contract. */
|
|
11
|
+
interface DiscardGuardInternals {
|
|
12
|
+
pending: PendingLeave | null;
|
|
13
|
+
/** Bumped on confirm so the dialog unmounts in the same commit as the exit (see the file header). */
|
|
14
|
+
confirmKey: number;
|
|
15
|
+
confirm: () => void;
|
|
16
|
+
keepEditing: () => void;
|
|
17
|
+
report: (id: string, report: DirtyReport) => void;
|
|
18
|
+
unreport: (id: string) => void;
|
|
19
|
+
guardScope: (scope: string | null, leave: Leave) => void;
|
|
20
|
+
}
|
|
21
|
+
export interface DiscardGuardController {
|
|
22
|
+
/** True while any mounted form reports unsaved input. */
|
|
23
|
+
readonly isDirty: boolean;
|
|
24
|
+
/** Runs `leave` now, or after the operator confirms when a form is dirty. */
|
|
25
|
+
guard: (leave: Leave) => void;
|
|
26
|
+
/** Runs `leave` without asking — for exits that keep the input, like a successful save. */
|
|
27
|
+
bypass: (leave: Leave) => void;
|
|
28
|
+
/**
|
|
29
|
+
* Wraps a modal's `onOpenChange` so its close button, Escape and outside
|
|
30
|
+
* click go through `guard`. Opening passes straight through.
|
|
31
|
+
*/
|
|
32
|
+
guardOpenChange: (onOpenChange: (open: boolean) => void) => (open: boolean) => void;
|
|
33
|
+
/** @internal Read by `<DiscardGuard>`. */
|
|
34
|
+
readonly internals: DiscardGuardInternals;
|
|
35
|
+
}
|
|
36
|
+
/** Creates the guard. Call it in the component that owns the modal. */
|
|
37
|
+
export declare function useDiscardGuard(): DiscardGuardController;
|
|
38
|
+
export {};
|
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* Ensures exclusive selection (preset OR custom).
|
|
6
6
|
*/
|
|
7
7
|
export { DonationAmounts } from './DonationAmounts';
|
|
8
|
-
export type { DonationAmount, SelectedDonation, DonationLabels, DonationAmountsProps } from './types';
|
|
8
|
+
export type { DonationAmount, SelectedDonation, DonationLabels, DonationAmountsProps, DonationAmountsVariant, } from './types';
|
|
9
9
|
export { formatCurrency, parseCurrency } from './utils/currency';
|