@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
|
@@ -18,7 +18,39 @@ export interface DonationAmount {
|
|
|
18
18
|
* If not provided, the formatted currency will be used
|
|
19
19
|
*/
|
|
20
20
|
label?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Second line under the amount, e.g. `'+$0.56 donation'` on a round-up
|
|
23
|
+
* offer. Rendered by the `tile` and `pos` variants only; the `pill`
|
|
24
|
+
* variant has no room for it.
|
|
25
|
+
*/
|
|
26
|
+
sublabel?: string;
|
|
21
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* How the presets and the custom input are drawn.
|
|
30
|
+
*
|
|
31
|
+
* - `pill` (default): HeroUI bordered pill buttons; the selected one fills
|
|
32
|
+
* with the brand colour. The original look, unchanged.
|
|
33
|
+
* - `tile`: the Quick Donation / Quick Membership amount grid. Rectangular
|
|
34
|
+
* 12px tiles on the `pos-field` hairline; the selected tile takes a brand
|
|
35
|
+
* border, a 9% brand tint and brand digits.
|
|
36
|
+
* - `pos`: the register's donation modal and round-up offer. 14px chips on
|
|
37
|
+
* the `pos-line` hairline that auto-fit the row (min 96px), 19px digits
|
|
38
|
+
* that stay ink when selected over a 5% brand tint, an optional sublabel,
|
|
39
|
+
* and a visible label over the custom input.
|
|
40
|
+
*/
|
|
41
|
+
export type DonationAmountsVariant = 'pill' | 'tile' | 'pos';
|
|
42
|
+
/**
|
|
43
|
+
* Where the `tile` variant puts the custom amount field.
|
|
44
|
+
*
|
|
45
|
+
* - `below` (default): a row of its own under the preset grid.
|
|
46
|
+
* - `inline`: the last item of the preset row, the Quick entry amount row
|
|
47
|
+
* (`Main.dc.html`, `QMDonation.dc.html`). Tiles share the row evenly and
|
|
48
|
+
* the field takes twice a tile's share; the row wraps, so in a narrow
|
|
49
|
+
* column the field drops to a full-width line of its own. Tiles and field
|
|
50
|
+
* are both 48px tall, and the currency symbol sits beside the digits on the
|
|
51
|
+
* side the locale puts it, so the field shows "$ Other amount".
|
|
52
|
+
*/
|
|
53
|
+
export type DonationAmountsCustomAmountPlacement = 'below' | 'inline';
|
|
22
54
|
/**
|
|
23
55
|
* Selected donation value (can be preset or custom)
|
|
24
56
|
*/
|
|
@@ -57,6 +89,27 @@ export interface DonationLabels {
|
|
|
57
89
|
* @default 'Add Donation'
|
|
58
90
|
*/
|
|
59
91
|
addDonationButton?: string;
|
|
92
|
+
/**
|
|
93
|
+
* Small uppercase heading above the presets ("Round up your total").
|
|
94
|
+
* `tile` and `pos` variants only.
|
|
95
|
+
*/
|
|
96
|
+
eyebrow?: string;
|
|
97
|
+
/**
|
|
98
|
+
* Muted line under the eyebrow or title ("Current total $19.44").
|
|
99
|
+
* `tile` and `pos` variants only.
|
|
100
|
+
*/
|
|
101
|
+
caption?: string;
|
|
102
|
+
/**
|
|
103
|
+
* Visible label over the custom amount input ("Custom amount"). When set
|
|
104
|
+
* it also names the input, so `customAmountAriaLabel` is not needed.
|
|
105
|
+
* `tile` and `pos` variants only.
|
|
106
|
+
*/
|
|
107
|
+
customAmountLabel?: string;
|
|
108
|
+
/**
|
|
109
|
+
* Accessible name of the preset group when no `title` is shown.
|
|
110
|
+
* @default 'Suggested amounts'
|
|
111
|
+
*/
|
|
112
|
+
presetsAriaLabel?: string;
|
|
60
113
|
}
|
|
61
114
|
/**
|
|
62
115
|
* Props for DonationAmounts component
|
|
@@ -145,10 +198,35 @@ export interface DonationAmountsProps {
|
|
|
145
198
|
*/
|
|
146
199
|
inputVariant?: 'flat' | 'bordered' | 'faded' | 'underlined';
|
|
147
200
|
/**
|
|
148
|
-
* Size of the custom amount input and add button
|
|
201
|
+
* Size of the custom amount input and add button. In `tile` and `pos`,
|
|
202
|
+
* `md` is the mockup's field; the presets keep their size in every variant.
|
|
149
203
|
* @default 'md'
|
|
150
204
|
*/
|
|
151
205
|
size?: 'sm' | 'md' | 'lg';
|
|
206
|
+
/**
|
|
207
|
+
* Visual variant. See {@link DonationAmountsVariant}.
|
|
208
|
+
* @default 'pill'
|
|
209
|
+
*/
|
|
210
|
+
variant?: DonationAmountsVariant;
|
|
211
|
+
/**
|
|
212
|
+
* Where the custom amount field sits. See
|
|
213
|
+
* {@link DonationAmountsCustomAmountPlacement}. `tile` variant only.
|
|
214
|
+
*
|
|
215
|
+
* `inline` lays the presets out as one wrapping row, so `mobileColumns`
|
|
216
|
+
* and `desktopColumns` do not apply, and it has no room for
|
|
217
|
+
* `labels.customAmountLabel` above the field: when set, that label names
|
|
218
|
+
* the field instead. The preset group then holds the field too, so name it
|
|
219
|
+
* for the whole amount (`labels.title` or `labels.presetsAriaLabel`).
|
|
220
|
+
* @default 'below'
|
|
221
|
+
*/
|
|
222
|
+
customAmountPlacement?: DonationAmountsCustomAmountPlacement;
|
|
223
|
+
/**
|
|
224
|
+
* Marks the title as required with a danger asterisk (`tile` and `pos`
|
|
225
|
+
* variants). The asterisk is decorative; announce the requirement through
|
|
226
|
+
* the form's own validation.
|
|
227
|
+
* @default false
|
|
228
|
+
*/
|
|
229
|
+
isRequired?: boolean;
|
|
152
230
|
/**
|
|
153
231
|
* Additional CSS classes
|
|
154
232
|
*/
|
|
@@ -6,13 +6,33 @@
|
|
|
6
6
|
* @param amount - The amount to format
|
|
7
7
|
* @param locale - The locale to use for formatting (e.g., 'en-US', 'es-ES')
|
|
8
8
|
* @param currency - The currency code (ISO 4217, e.g., 'USD', 'EUR')
|
|
9
|
+
* @param trimZeroCents - Drop the fraction of a whole amount ("$25" rather than
|
|
10
|
+
* "$25.00"). Default `true`; `false` keeps the currency's own digits, as a
|
|
11
|
+
* register price does.
|
|
9
12
|
* @returns Formatted currency string
|
|
10
13
|
*
|
|
11
14
|
* @example
|
|
12
|
-
* formatCurrency(1000, 'en-US', 'USD') // "$1,000
|
|
13
|
-
* formatCurrency(1000, 'es-ES', 'EUR') // "
|
|
15
|
+
* formatCurrency(1000, 'en-US', 'USD') // "$1,000"
|
|
16
|
+
* formatCurrency(1000.5, 'es-ES', 'EUR') // "1000,5 €"
|
|
17
|
+
* formatCurrency(5, 'en-US', 'USD', false) // "$5.00"
|
|
14
18
|
*/
|
|
15
|
-
export declare function formatCurrency(amount: number, locale?: string, currency?: string): string;
|
|
19
|
+
export declare function formatCurrency(amount: number, locale?: string, currency?: string, trimZeroCents?: boolean): string;
|
|
20
|
+
/**
|
|
21
|
+
* What a field that draws the currency symbol beside the digits needs: the
|
|
22
|
+
* symbol, the side of the digits `locale` puts it on ("$" before in en-US,
|
|
23
|
+
* "$" after in fr-CA), and number formatting with the currency's own fraction
|
|
24
|
+
* digits but no symbol, so the field never shows it twice.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* currencyAffix('en-US', 'USD') // { symbol: '$', position: 'start', formatOptions: { ..., minimumFractionDigits: 2 } }
|
|
28
|
+
* currencyAffix('fr-FR', 'EUR') // { symbol: '€', position: 'end', ... }
|
|
29
|
+
* currencyAffix('ja-JP', 'JPY') // { symbol: '¥', position: 'start', formatOptions: { ..., maximumFractionDigits: 0 } }
|
|
30
|
+
*/
|
|
31
|
+
export declare function currencyAffix(locale?: string, currency?: string): {
|
|
32
|
+
symbol: string;
|
|
33
|
+
position: 'start' | 'end';
|
|
34
|
+
formatOptions: Intl.NumberFormatOptions;
|
|
35
|
+
};
|
|
16
36
|
/**
|
|
17
37
|
* Parses a currency string to a number
|
|
18
38
|
* @param value - The currency string to parse
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { EntityListProps, EntityListSkeletonProps } from './types';
|
|
3
|
+
export declare const EntityList: React.FC<EntityListProps>;
|
|
4
|
+
/**
|
|
5
|
+
* The list in skeleton form, at the same row height so nothing shifts when the
|
|
6
|
+
* rows arrive. The placeholder rows are hidden from assistive tech; `label` is
|
|
7
|
+
* announced once through a `role="status"` region instead.
|
|
8
|
+
*
|
|
9
|
+
* The root is `aria-busy`: the area is loading. `role="status"` stays on the
|
|
10
|
+
* label, not on the root, so the live region itself is never busy, which would
|
|
11
|
+
* let a screen reader hold its announcement back.
|
|
12
|
+
*
|
|
13
|
+
* The bars are the DS `Skeleton`, so their shimmer stops under reduced motion.
|
|
14
|
+
*/
|
|
15
|
+
export declare const EntityListSkeleton: React.FC<EntityListSkeletonProps>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { EntityRow } from './EntityRow';
|
|
2
|
+
export { EntityList, EntityListSkeleton } from './EntityList';
|
|
3
|
+
export type { EntityRowProps, EntityRowSize, EntityRowVariant, EntityRowTag, EntityRowTagTone, EntityRowLeading, EntityRowAction, EntityListProps, EntityListSkeletonProps, } from './types';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* "Chidi Okafor" → "CO", "Ana María de la Cruz" → "AC", "Cher" → "C".
|
|
3
|
+
* First and last word, so a long name does not spell an acronym the way
|
|
4
|
+
* HeroUI's default (every word's initial) does. Empty → "—".
|
|
5
|
+
*/
|
|
6
|
+
export declare function initialsFromName(name: string): string;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { EntityListProps, EntityRowSize, EntityRowTagTone, EntityRowVariant } from './types';
|
|
2
|
+
export declare const entityRowClass: {
|
|
3
|
+
readonly base: "relative flex w-full items-center gap-2 transition-colors";
|
|
4
|
+
readonly content: "flex min-w-0 flex-1 items-center gap-3 text-left";
|
|
5
|
+
/**
|
|
6
|
+
* The press target is a HeroUI `Button` (or `Link`) stretched over the row
|
|
7
|
+
* by its `::after`. Its base classes have to be undone for that to work:
|
|
8
|
+
* `relative` would make the button the overlay's containing block,
|
|
9
|
+
* `transform-gpu` would too, `overflow-hidden` clips the overlay,
|
|
10
|
+
* `min-w-max` and `whitespace-nowrap` defeat truncation, and the focus
|
|
11
|
+
* outline is moved from the button to the overlay so it rings the row.
|
|
12
|
+
*/
|
|
13
|
+
readonly pressTarget: string;
|
|
14
|
+
readonly text: "flex min-w-0 flex-col";
|
|
15
|
+
readonly titleLine: "flex min-w-0 items-center gap-2";
|
|
16
|
+
readonly title: "truncate font-medium text-default-900";
|
|
17
|
+
readonly subtitle: "truncate text-default-600";
|
|
18
|
+
readonly tags: "flex shrink-0 items-center gap-1";
|
|
19
|
+
/** Lifted above the stretched overlay so each stays its own control. */
|
|
20
|
+
readonly side: "relative z-10 flex shrink-0 items-center gap-1";
|
|
21
|
+
readonly chevron: "flex shrink-0 text-default-500";
|
|
22
|
+
readonly menuTrigger: "text-default-600";
|
|
23
|
+
/** The menu otherwise grows to its longest line; a description wraps instead. */
|
|
24
|
+
readonly menuWithDescriptions: "max-w-xs";
|
|
25
|
+
/**
|
|
26
|
+
* HeroUI truncates a string description; a reason cut short is no reason.
|
|
27
|
+
* default-600 like the row's subtitle, sized by the same per-size token.
|
|
28
|
+
*/
|
|
29
|
+
readonly menuItemDescription: "whitespace-normal text-default-600";
|
|
30
|
+
/**
|
|
31
|
+
* A disabled item with a description. HeroUI dims the whole item, which
|
|
32
|
+
* would take the description to about 2:1, and opacity cannot be undone by
|
|
33
|
+
* a child. So the item stays opaque and the label and icon are dimmed.
|
|
34
|
+
*/
|
|
35
|
+
readonly menuItemDisabledWithDescription: "opacity-100";
|
|
36
|
+
readonly menuItemDimmed: "opacity-disabled";
|
|
37
|
+
readonly menuItemDimmedIcon: "flex shrink-0 opacity-disabled";
|
|
38
|
+
readonly avatar: "shrink-0 bg-default-200 text-default-700";
|
|
39
|
+
readonly dangerItem: "text-danger";
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Text overrides for flat chips whose HeroUI tone measures under 4.5:1 on the
|
|
43
|
+
* plain row's hover tint (default-100): primary 4.39:1 and warning 4.03:1 at
|
|
44
|
+
* their `-700` text. One step darker clears it; the others already do.
|
|
45
|
+
*/
|
|
46
|
+
export declare const entityRowTagToneClass: Record<EntityRowTagTone, string | undefined>;
|
|
47
|
+
export declare const entityRowVariantClass: Record<EntityRowVariant, {
|
|
48
|
+
row: string;
|
|
49
|
+
hover: string;
|
|
50
|
+
overlay: string;
|
|
51
|
+
}>;
|
|
52
|
+
export declare const entityRowSizeClass: Record<EntityRowSize, {
|
|
53
|
+
row: string;
|
|
54
|
+
content: string;
|
|
55
|
+
title: string;
|
|
56
|
+
subtitle: string;
|
|
57
|
+
avatar: 'sm' | 'md';
|
|
58
|
+
control: 'md' | 'lg';
|
|
59
|
+
}>;
|
|
60
|
+
export declare const entityRowMenuItemClass: Record<EntityRowSize, string | undefined>;
|
|
61
|
+
export declare const entityListGapClass: Record<NonNullable<EntityListProps['gap']>, string>;
|
|
62
|
+
export declare const entityListClass = "m-0 flex list-none flex-col p-0";
|
|
63
|
+
export declare const entityListSkeletonClass: {
|
|
64
|
+
readonly row: "flex items-center gap-3 px-2";
|
|
65
|
+
readonly avatar: {
|
|
66
|
+
readonly md: "size-8 shrink-0 rounded-full";
|
|
67
|
+
readonly lg: "size-10 shrink-0 rounded-full";
|
|
68
|
+
};
|
|
69
|
+
readonly lines: "flex flex-col gap-2";
|
|
70
|
+
readonly title: "h-4 rounded-md";
|
|
71
|
+
readonly subtitle: "h-3 w-44 rounded-md";
|
|
72
|
+
/** Varied so the placeholder does not read as a ruled grid. */
|
|
73
|
+
readonly titleWidths: readonly ["w-32", "w-28", "w-36", "w-24", "w-40", "w-28"];
|
|
74
|
+
};
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { ElementType, ReactNode } from 'react';
|
|
2
|
+
/** `md` is a desk row (48px), `lg` a touch row (56px). */
|
|
3
|
+
export type EntityRowSize = 'md' | 'lg';
|
|
4
|
+
/** `plain` sits in a list and tints on hover; `bordered` is a standalone hairline card. */
|
|
5
|
+
export type EntityRowVariant = 'plain' | 'bordered';
|
|
6
|
+
export type EntityRowTagTone = 'default' | 'primary' | 'success' | 'warning' | 'danger';
|
|
7
|
+
export interface EntityRowTag {
|
|
8
|
+
key: string;
|
|
9
|
+
label: ReactNode;
|
|
10
|
+
/** Maps to the HeroUI `Chip` color, always `variant="flat"`. */
|
|
11
|
+
tone?: EntityRowTagTone;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* What the row leads with. Always decorative (`aria-hidden`): the title is the
|
|
15
|
+
* row's name. Precedence: `src`, then `icon`, then initials (`initials`, else
|
|
16
|
+
* derived from `name`, else from a string `title`).
|
|
17
|
+
*/
|
|
18
|
+
export interface EntityRowLeading {
|
|
19
|
+
/** Image URL. */
|
|
20
|
+
src?: string;
|
|
21
|
+
/** An icon tile instead of initials (a household, an organization). */
|
|
22
|
+
icon?: ReactNode;
|
|
23
|
+
/** Explicit initials, used verbatim. */
|
|
24
|
+
initials?: string;
|
|
25
|
+
/** Source for derived initials when the title is not the person's name. */
|
|
26
|
+
name?: string;
|
|
27
|
+
/** `circle` for people (default), `square` for a tile. */
|
|
28
|
+
shape?: 'circle' | 'square';
|
|
29
|
+
}
|
|
30
|
+
export interface EntityRowAction {
|
|
31
|
+
key: string;
|
|
32
|
+
label: string;
|
|
33
|
+
icon?: ReactNode;
|
|
34
|
+
tone?: 'default' | 'danger';
|
|
35
|
+
isDisabled?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Second line under the label, typically why a disabled action is
|
|
38
|
+
* unavailable. It stays readable on a disabled item. react-aria never
|
|
39
|
+
* focuses a disabled item, so the descriptions of disabled actions also
|
|
40
|
+
* describe the `⋯` trigger (`aria-describedby`).
|
|
41
|
+
*/
|
|
42
|
+
description?: string;
|
|
43
|
+
onAction: () => void;
|
|
44
|
+
/** Defaults to `<row testid>-menu-<key>`. */
|
|
45
|
+
'data-testid'?: string;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Actions and their label travel together: an overflow trigger is icon-only,
|
|
49
|
+
* so without a label it is announced as "button" and nothing else.
|
|
50
|
+
*/
|
|
51
|
+
type EntityRowActionsProps = {
|
|
52
|
+
actions?: undefined;
|
|
53
|
+
actionsLabel?: undefined;
|
|
54
|
+
} | {
|
|
55
|
+
/** Overflow menu items. An empty array renders no trigger. */
|
|
56
|
+
actions: EntityRowAction[];
|
|
57
|
+
/**
|
|
58
|
+
* Accessible name of the `⋯` trigger and of the menu. Include the
|
|
59
|
+
* subject: "Actions for Chidi Okafor", not "Actions" — a list of
|
|
60
|
+
* these otherwise reads as a column of identical buttons.
|
|
61
|
+
*/
|
|
62
|
+
actionsLabel: string;
|
|
63
|
+
};
|
|
64
|
+
interface EntityRowBaseProps {
|
|
65
|
+
/** The row's accessible name. */
|
|
66
|
+
title: ReactNode;
|
|
67
|
+
/** Second line (contact details, a count, "View household"). */
|
|
68
|
+
subtitle?: ReactNode;
|
|
69
|
+
leading?: EntityRowLeading;
|
|
70
|
+
/** Chips beside the title. */
|
|
71
|
+
tags?: EntityRowTag[];
|
|
72
|
+
/**
|
|
73
|
+
* Makes the whole row a button. The press target is stretched over the
|
|
74
|
+
* row; `trailing` and the actions menu stay their own controls.
|
|
75
|
+
*/
|
|
76
|
+
onPress?: () => void;
|
|
77
|
+
/** Makes the whole row a link (wins over `onPress` for semantics; both fire). */
|
|
78
|
+
href?: string;
|
|
79
|
+
/** Router link component for `href` (Next.js `Link`, React Router `Link`). */
|
|
80
|
+
linkAs?: ElementType;
|
|
81
|
+
/** e.g. `'dialog'` when the row opens a picker. Only for button rows. */
|
|
82
|
+
'aria-haspopup'?: 'dialog' | 'menu' | 'listbox' | true;
|
|
83
|
+
/** Explicit control between the text and the menu ("Select", "Add"). */
|
|
84
|
+
trailing?: ReactNode;
|
|
85
|
+
/** Trailing chevron: the row leads somewhere. */
|
|
86
|
+
showChevron?: boolean;
|
|
87
|
+
/** Overrides the default chevron glyph. */
|
|
88
|
+
chevronIcon?: ReactNode;
|
|
89
|
+
/** Overrides the default `⋯` glyph. */
|
|
90
|
+
actionsIcon?: ReactNode;
|
|
91
|
+
/** Defaults from `DensityProvider`: `touch` → `lg`, otherwise `md`. */
|
|
92
|
+
size?: EntityRowSize;
|
|
93
|
+
variant?: EntityRowVariant;
|
|
94
|
+
/** Disables the press target and the actions trigger (not `trailing`, which the host owns). */
|
|
95
|
+
isDisabled?: boolean;
|
|
96
|
+
/** Container element. Defaults to `li` inside `EntityList`, `div` elsewhere. */
|
|
97
|
+
as?: 'li' | 'div';
|
|
98
|
+
className?: string;
|
|
99
|
+
/**
|
|
100
|
+
* Row container. Derived: `-trigger` (press target), `-menu-trigger`,
|
|
101
|
+
* `-menu`, `-menu-<key>`.
|
|
102
|
+
*/
|
|
103
|
+
'data-testid'?: string;
|
|
104
|
+
}
|
|
105
|
+
export type EntityRowProps = EntityRowBaseProps & EntityRowActionsProps;
|
|
106
|
+
export interface EntityListProps {
|
|
107
|
+
children: ReactNode;
|
|
108
|
+
/** Name the list: `aria-label` or `aria-labelledby` (one is required by a11y review). */
|
|
109
|
+
'aria-label'?: string;
|
|
110
|
+
'aria-labelledby'?: string;
|
|
111
|
+
/** Spacing between rows; `bordered` rows read better apart. */
|
|
112
|
+
gap?: 'none' | 'sm' | 'md';
|
|
113
|
+
className?: string;
|
|
114
|
+
'data-testid'?: string;
|
|
115
|
+
}
|
|
116
|
+
export interface EntityListSkeletonProps {
|
|
117
|
+
/** Announced to assistive tech while the rows load ("Loading contacts"). */
|
|
118
|
+
label: string;
|
|
119
|
+
rows?: number;
|
|
120
|
+
/** Defaults from `DensityProvider`, like `EntityRow`. */
|
|
121
|
+
size?: EntityRowSize;
|
|
122
|
+
className?: string;
|
|
123
|
+
'data-testid'?: string;
|
|
124
|
+
}
|
|
125
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { JSX } from 'react';
|
|
2
|
+
import { ExpandableTableProps } from './types';
|
|
3
|
+
export declare function ExpandableTable<Row>({ ariaLabel, columns, rows, getRowKey, getRowLabel, renderCell, renderExpanded, renderExpandedActions, getRowActions, rowNeedsFix, expandedKeys, defaultExpandedKeys, onExpandedChange, labels, emptyContent, className, 'data-testid': dataTestId, }: ExpandableTableProps<Row>): JSX.Element;
|
|
4
|
+
export declare namespace ExpandableTable {
|
|
5
|
+
var displayName: string;
|
|
6
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { ExpandableTableBreakpoint } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* warning-50 (`#FFFBEB`), the prototype's pale amber row. Not `--warn-fill`
|
|
4
|
+
* (warning-100): on that, the `--sub` text a row's second line uses drops to
|
|
5
|
+
* 4.35:1. On this one `--sub` holds 4.67:1 and `--warn` 4.85:1, pinned in the
|
|
6
|
+
* tests.
|
|
7
|
+
*/
|
|
8
|
+
export declare const NEEDS_FIX_ROW_TINT: "#fffbeb";
|
|
9
|
+
/** The toggle's chevron: down while closed, up while open. */
|
|
10
|
+
export declare const EXPANDABLE_TABLE_CHEVRON_ICON = "solar:alt-arrow-down-outline";
|
|
11
|
+
/** Before the open panel's title. */
|
|
12
|
+
export declare const EXPANDABLE_TABLE_PANEL_ICON = "solar:pen-2-outline";
|
|
13
|
+
/** `hidden <bp>:table-cell` per breakpoint, written out so Tailwind sees every class. */
|
|
14
|
+
export declare const expandableTableHideBelowClass: Record<ExpandableTableBreakpoint, string>;
|
|
15
|
+
export declare const expandableTableClass: {
|
|
16
|
+
/** The `VerticalSteps` card; scrolls sideways rather than overflow the page. */
|
|
17
|
+
readonly root: "w-full overflow-x-auto rounded-2xl border border-acct-border bg-acct-surface";
|
|
18
|
+
readonly table: "w-full";
|
|
19
|
+
readonly th: "text-left text-[11px] font-semibold uppercase tracking-[.04em] text-acct-sub px-4 pt-4 pb-3 whitespace-nowrap bg-transparent";
|
|
20
|
+
readonly alignRight: "text-right";
|
|
21
|
+
/** Shrinks to the toggle and the icon buttons. */
|
|
22
|
+
readonly thActions: "w-px";
|
|
23
|
+
readonly row: "border-t border-acct-hair transition-colors duration-150 hover:bg-acct-page data-[hover=true]:bg-acct-page";
|
|
24
|
+
readonly rowOpen: "bg-acct-page hover:bg-acct-page";
|
|
25
|
+
/** The admin cell had HeroUI's padding under it; a native cell needs its own (12px). */
|
|
26
|
+
readonly td: import('tailwind-variants').CnReturn;
|
|
27
|
+
readonly tdActions: "w-px whitespace-nowrap py-2 pl-2 pr-3 align-middle";
|
|
28
|
+
readonly actions: "flex items-center justify-end gap-0.5";
|
|
29
|
+
readonly toggle: "gap-1.5 text-acct-ink2 data-[hover=true]:bg-acct-hair";
|
|
30
|
+
readonly toggleOpen: "bg-acct-surface shadow-sm ring-1 ring-acct-border data-[hover=true]:bg-acct-surface";
|
|
31
|
+
readonly chevron: "size-4 shrink-0 transition-transform duration-150 motion-reduce:transition-none [html[data-pos-reduce-motion=true]_&]:transition-none";
|
|
32
|
+
readonly chevronOpen: "rotate-180";
|
|
33
|
+
/** The open panel's row: same tint as the open summary line, no hairline between them. */
|
|
34
|
+
readonly panelRow: "bg-acct-page";
|
|
35
|
+
readonly panelCell: "px-4 pb-4 pt-0";
|
|
36
|
+
readonly panel: "rounded-xl border border-acct-border bg-acct-surface p-4 shadow-sm";
|
|
37
|
+
/** 12px uppercase in `--sub` (4.83:1 on white). */
|
|
38
|
+
readonly panelTitle: "mb-4 flex items-center gap-1.5 border-b border-acct-hair pb-3 text-xs font-semibold uppercase tracking-wide text-acct-sub";
|
|
39
|
+
readonly panelTitleIcon: "size-3.5 shrink-0";
|
|
40
|
+
readonly panelFooter: "mt-4 flex flex-wrap items-center justify-end gap-2 border-t border-acct-hair pt-3";
|
|
41
|
+
readonly done: "border-acct-border bg-acct-surface";
|
|
42
|
+
readonly empty: "px-4 py-10 text-center text-sm text-acct-sub";
|
|
43
|
+
};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { RowAction } from '../RowActions';
|
|
3
|
+
/** A breakpoint below which a column (header and cells) is not drawn. */
|
|
4
|
+
export type ExpandableTableBreakpoint = 'sm' | 'md' | 'lg';
|
|
5
|
+
export interface ExpandableTableColumn {
|
|
6
|
+
/** Stable id. `renderCell` receives it to know which cell it is drawing. */
|
|
7
|
+
key: string;
|
|
8
|
+
/** Header text. */
|
|
9
|
+
label: ReactNode;
|
|
10
|
+
/** `'right'` for numbers (price); `'left'` by default. */
|
|
11
|
+
align?: 'left' | 'right';
|
|
12
|
+
/** Width hint for the column: px number or any CSS length. Omit to size to content. */
|
|
13
|
+
width?: number | string;
|
|
14
|
+
/** Not drawn below this breakpoint, so a narrow screen keeps the columns that matter. */
|
|
15
|
+
hideBelow?: ExpandableTableBreakpoint;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Every string the table draws or speaks, translated by the host. No English
|
|
19
|
+
* lives in the component.
|
|
20
|
+
*/
|
|
21
|
+
export interface ExpandableTableLabels {
|
|
22
|
+
/** Visible text of each row's toggle ("Quick edit"). */
|
|
23
|
+
toggle: string;
|
|
24
|
+
/**
|
|
25
|
+
* Accessible name of one row's toggle, and of the panel it opens:
|
|
26
|
+
* `(rowLabel) => \`Quick edit ${rowLabel}\``. Keep `toggle` inside it, so
|
|
27
|
+
* voice control can say what it sees (WCAG 2.5.3).
|
|
28
|
+
*/
|
|
29
|
+
toggleRow: (rowLabel: string) => string;
|
|
30
|
+
/** Header of the controls column, read by screen readers only ("Actions"). */
|
|
31
|
+
actions: string;
|
|
32
|
+
/** The button at the foot of an open panel that closes it ("Done"). */
|
|
33
|
+
done: string;
|
|
34
|
+
/** Small heading at the top of an open panel ("Quick edit"). Omit for none. */
|
|
35
|
+
panelTitle?: ReactNode;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Why a row closed or opened. `toggle` is the row's own button; the rest only
|
|
39
|
+
* close: `done` is the Done button or `close()`, `enter` is Enter in a
|
|
40
|
+
* single-line field, `escape` is Escape anywhere in the panel. Changes apply
|
|
41
|
+
* as the host's fields change, so none of them reverts anything; a host that
|
|
42
|
+
* keeps a draft can discard it on `escape`.
|
|
43
|
+
*/
|
|
44
|
+
export type ExpandableTableReason = 'toggle' | 'done' | 'enter' | 'escape';
|
|
45
|
+
export interface ExpandableTableExpandedChange {
|
|
46
|
+
/** The row that opened or closed. */
|
|
47
|
+
key: string;
|
|
48
|
+
expanded: boolean;
|
|
49
|
+
reason: ExpandableTableReason;
|
|
50
|
+
}
|
|
51
|
+
/** What `renderExpanded` and `renderExpandedActions` get besides the row. */
|
|
52
|
+
export interface ExpandableTableRowContext {
|
|
53
|
+
rowIndex: number;
|
|
54
|
+
/** Closes this row's panel and returns focus to its toggle (reason `done`). */
|
|
55
|
+
close: () => void;
|
|
56
|
+
}
|
|
57
|
+
export interface ExpandableTableProps<Row> {
|
|
58
|
+
/** Accessible name of the table ("Ticket types"). */
|
|
59
|
+
ariaLabel: string;
|
|
60
|
+
columns: ExpandableTableColumn[];
|
|
61
|
+
rows: Row[];
|
|
62
|
+
/** Stable, unique id of a row: keys its group, its test ids and the open set. */
|
|
63
|
+
getRowKey: (row: Row) => string;
|
|
64
|
+
/** Short name of a row ("Adult"), used in the accessible names of its controls. */
|
|
65
|
+
getRowLabel: (row: Row) => string;
|
|
66
|
+
/** One cell of the summary line. */
|
|
67
|
+
renderCell: (row: Row, columnKey: string, rowIndex: number) => ReactNode;
|
|
68
|
+
/** The fields an open row shows under its summary line (the Quick edit form). */
|
|
69
|
+
renderExpanded: (row: Row, context: ExpandableTableRowContext) => ReactNode;
|
|
70
|
+
/** Buttons at the foot of an open row, before Done ("More details"). */
|
|
71
|
+
renderExpandedActions?: (row: Row, context: ExpandableTableRowContext) => ReactNode;
|
|
72
|
+
/**
|
|
73
|
+
* Icon buttons after the toggle, drawn by `RowActions` (Duplicate, All
|
|
74
|
+
* details, Delete). Name each with its subject: "Duplicate Adult".
|
|
75
|
+
*/
|
|
76
|
+
getRowActions?: (row: Row, rowIndex: number) => RowAction[];
|
|
77
|
+
/**
|
|
78
|
+
* Rows that need a fix get a pale warning tint (warning-50) while closed,
|
|
79
|
+
* and `data-needs-fix="true"`. The tint is a cue, not the message: say what
|
|
80
|
+
* is missing in a cell, as text.
|
|
81
|
+
*/
|
|
82
|
+
rowNeedsFix?: (row: Row) => boolean;
|
|
83
|
+
/** Open rows, controlled. Several can be open at once. */
|
|
84
|
+
expandedKeys?: Iterable<string>;
|
|
85
|
+
/** Open rows at first render, uncontrolled. */
|
|
86
|
+
defaultExpandedKeys?: Iterable<string>;
|
|
87
|
+
/** Every open or close, with the new open set and which row changed why. */
|
|
88
|
+
onExpandedChange?: (keys: Set<string>, change: ExpandableTableExpandedChange) => void;
|
|
89
|
+
labels: ExpandableTableLabels;
|
|
90
|
+
/** Shown in place of the rows when there are none. */
|
|
91
|
+
emptyContent?: ReactNode;
|
|
92
|
+
className?: string;
|
|
93
|
+
/**
|
|
94
|
+
* Root test id (default `expandable-table`). Per row: `-row-<key>` (with
|
|
95
|
+
* `data-expanded` and `data-needs-fix`), `-toggle-<key>`, `-panel-<key>`,
|
|
96
|
+
* `-done-<key>` and `-actions-<key>` (each action `-actions-<key>-<action>`).
|
|
97
|
+
*/
|
|
98
|
+
'data-testid'?: string;
|
|
99
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { JSX } from 'react';
|
|
2
2
|
import { EmptyStateProps, ErrorStateProps, FeedbackStateProps, LoadingStateProps, SuccessStateProps } from './type';
|
|
3
|
-
export declare function FeedbackState(
|
|
3
|
+
export declare function FeedbackState(props: FeedbackStateProps): JSX.Element;
|
|
4
4
|
export declare namespace FeedbackState {
|
|
5
5
|
var displayName: string;
|
|
6
6
|
}
|
|
@@ -20,6 +20,8 @@ export interface FeedbackStateClassNames {
|
|
|
20
20
|
spinner?: string;
|
|
21
21
|
title?: string;
|
|
22
22
|
description?: string;
|
|
23
|
+
/** The `ErrorState` reference code line. */
|
|
24
|
+
referenceCode?: string;
|
|
23
25
|
actions?: string;
|
|
24
26
|
}
|
|
25
27
|
export interface FeedbackStateProps {
|
|
@@ -50,6 +52,14 @@ export interface FeedbackStateProps {
|
|
|
50
52
|
'data-testid'?: string;
|
|
51
53
|
}
|
|
52
54
|
export type EmptyStateProps = Omit<FeedbackStateProps, 'variant'>;
|
|
53
|
-
export
|
|
55
|
+
export interface ErrorStateProps extends Omit<FeedbackStateProps, 'variant'> {
|
|
56
|
+
/**
|
|
57
|
+
* Support code for this failure, e.g. `"FR-QE-900"`, shown on a small line under the description
|
|
58
|
+
* so a user can quote it from a screenshot. Nothing is rendered without it.
|
|
59
|
+
*/
|
|
60
|
+
referenceCode?: string;
|
|
61
|
+
/** Text before the code. Defaults to `"Reference code:"`; the caller owns i18n. */
|
|
62
|
+
referenceCodeLabel?: string;
|
|
63
|
+
}
|
|
54
64
|
export type LoadingStateProps = Omit<FeedbackStateProps, 'variant'>;
|
|
55
65
|
export type SuccessStateProps = Omit<FeedbackStateProps, 'variant'>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const filterSelectClass: {
|
|
2
|
+
readonly base: "relative inline-grid min-w-[var(--filter-select-min)] max-w-max shrink grow basis-[var(--filter-select-min)] grid-cols-[minmax(0,1fr)] [--filter-select-min:6rem]";
|
|
3
|
+
readonly baseActive: "[--filter-select-min:8rem]";
|
|
4
|
+
readonly cell: "[grid-area:1/1]";
|
|
5
|
+
readonly sizer: "invisible h-0 max-w-[20rem] overflow-hidden whitespace-nowrap border-x-2 border-transparent pl-2 pr-[2.0625rem] text-[0.875rem]";
|
|
6
|
+
readonly sizerActive: "pr-[3.4375rem] font-semibold";
|
|
7
|
+
readonly select: "w-full [contain:inline-size]";
|
|
8
|
+
readonly trigger: "h-[2.375rem] min-h-[2.375rem] rounded-[0.625rem] border-medium border-pos-field bg-white px-2 shadow-none data-[hover=true]:border-default-300 data-[focus=true]:border-primary data-[open=true]:border-primary data-[focus-visible=true]:ring-2 data-[focus-visible=true]:ring-primary data-[focus-visible=true]:ring-offset-1";
|
|
9
|
+
readonly triggerActive: "!border-acct-rust-border !bg-acct-rust-fill pr-[1.875rem]";
|
|
10
|
+
readonly value: "text-[0.875rem] !text-default-900";
|
|
11
|
+
readonly valueActive: "font-semibold !text-primary-600";
|
|
12
|
+
readonly iconActive: "!text-primary-600";
|
|
13
|
+
readonly clear: "absolute right-[1.875rem] top-1/2 z-20 inline-flex size-[1.25rem] -translate-y-1/2 items-center justify-center rounded-md text-primary-600 outline-none hover:bg-white/70 focus-visible:outline focus-visible:outline-2 focus-visible:outline-primary";
|
|
14
|
+
readonly clearIcon: "size-[0.8125rem]";
|
|
15
|
+
readonly optionTitle: "whitespace-normal break-words";
|
|
16
|
+
};
|
|
17
|
+
export declare const filterSelectGroupClass = "grid shrink grow basis-0 grid-flow-col auto-cols-auto gap-2.5 [--filter-select-cap:16rem] max-w-[calc(var(--filter-select-count)*var(--filter-select-cap)+(var(--filter-select-count)-1)*0.625rem)] [&>[data-slot=filter-select]]:max-w-none";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface FilterSelectOption {
|
|
3
|
+
value: string;
|
|
4
|
+
label: string;
|
|
5
|
+
}
|
|
6
|
+
export interface FilterSelectProps {
|
|
7
|
+
label: string;
|
|
8
|
+
value: string | null;
|
|
9
|
+
options: FilterSelectOption[];
|
|
10
|
+
onChange: (value: string | null) => void;
|
|
11
|
+
clearLabel: string;
|
|
12
|
+
minWidth?: number;
|
|
13
|
+
'data-testid'?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface FilterSelectGroupProps {
|
|
16
|
+
children: ReactNode;
|
|
17
|
+
className?: string;
|
|
18
|
+
'data-testid'?: string;
|
|
19
|
+
}
|