@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
package/README.md
CHANGED
|
@@ -183,6 +183,45 @@ import { DatePicker } from '@veevarts/design-system';
|
|
|
183
183
|
|
|
184
184
|
For `mode="datetime"`, the design system does not convert timezones. The consuming app must pass the value already prepared in the business timezone it wants to present. The component hides timezone labels by default.
|
|
185
185
|
|
|
186
|
+
`Modal`, `Drawer` and `Table` are also thin wrappers over HeroUI's: every HeroUI prop, ref and the generic `TableProps<Row>` type still work, and they add the accessibility defaults below.
|
|
187
|
+
|
|
188
|
+
**Translatable close button (`Modal`, `Drawer`).** HeroUI hard-codes `aria-label="Close"` on the corner close button. Set `closeLabel` to localize it, either once on `HeroUIProvider` or per overlay. Resolution order: the `closeLabel` prop, then the `closeLabel` of the nearest `HeroUIProvider`, then HeroUI's default `"Close"` (its own button, untouched). A `closeButton` you pass is yours and is not relabelled; `hideCloseButton` still hides the button.
|
|
189
|
+
|
|
190
|
+
```tsx
|
|
191
|
+
<HeroUIProvider closeLabel="Fermer">
|
|
192
|
+
<Modal isOpen={isOpen} onOpenChange={setOpen} closeLabel="Fermer la fenêtre">
|
|
193
|
+
{/* ... */}
|
|
194
|
+
</Modal>
|
|
195
|
+
</HeroUIProvider>
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
**React Aria locale (`HeroUIProvider`).** Set `locale` (BCP 47, e.g. `"fr-FR"`) so the strings React Aria renders follow the app's language: the hidden "Dismiss" buttons of every overlay, date and number formatting. Without it HeroUI uses `"en-US"`. `closeLabel` stays separate because HeroUI's close button text is not a React Aria string.
|
|
199
|
+
|
|
200
|
+
```tsx
|
|
201
|
+
<HeroUIProvider locale="fr-FR" closeLabel="Fermer">
|
|
202
|
+
{/* ... */}
|
|
203
|
+
</HeroUIProvider>
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
**Reduced motion (`HeroUIProvider`).** `reducedMotion` defaults to `"user"`: overlays, toasts and every other framer-motion animation follow the OS "reduce motion" setting. HeroUI's own default is `"never"`, which animates regardless. Pass `"always"` to drop them for an app-level preference, or `"never"` to opt out.
|
|
207
|
+
|
|
208
|
+
```tsx
|
|
209
|
+
<HeroUIProvider reducedMotion={posPrefersStill ? 'always' : 'user'}>
|
|
210
|
+
{/* ... */}
|
|
211
|
+
</HeroUIProvider>
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
**Readable toasts (`ToastProvider`).** The `ToastProvider` exported here wraps HeroUI's: same props, same `addToast` queue. Titles wrap instead of truncating to one line, and the animation is off when the OS or the POS (`data-pos-reduce-motion`) asks for reduced motion, unless you pass `disableAnimation`. A `toastProps.classNames.title` you pass is merged after the default. HeroUI replaces the provider `classNames` with a per-toast `addToast({ classNames })` as a whole object, so a per-toast `classNames` without a `title` key truncates that toast again.
|
|
215
|
+
|
|
216
|
+
```tsx
|
|
217
|
+
<HeroUIProvider>
|
|
218
|
+
<ToastProvider placement="top-right" />
|
|
219
|
+
{/* addToast({ title, description }) anywhere below */}
|
|
220
|
+
</HeroUIProvider>
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
**Table header contrast (`Table`).** Column headers default to `text-default-600` (`text-default-700` on a hovered sortable column) so 12px header text clears 4.5:1 (WCAG 1.4.3). Your classes win: a `classNames.th` color on the table, or a `className` on a `TableColumn`, replaces the default.
|
|
224
|
+
|
|
186
225
|
For complete HeroUI documentation, visit: [HeroUI Storybook](https://storybook.heroui.com/)
|
|
187
226
|
|
|
188
227
|
### Configure Tailwind CSS
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { DrawerProps as HeroUIDrawerProps } from '@heroui/react';
|
|
2
|
+
export type DrawerProps = HeroUIDrawerProps & {
|
|
3
|
+
/**
|
|
4
|
+
* Accessible name of the corner close button, e.g. `"Fermer"`. HeroUI hard-codes `"Close"`.
|
|
5
|
+
*
|
|
6
|
+
* Falls back to the `closeLabel` of `HeroUIProvider`; with neither, HeroUI's own button is rendered
|
|
7
|
+
* untouched. It names the default button only: a `closeButton` you pass is yours, and
|
|
8
|
+
* `hideCloseButton` still hides the button.
|
|
9
|
+
*/
|
|
10
|
+
closeLabel?: string;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* HeroUI `Drawer` with a translatable close button (WCAG 3.1.2, 4.1.2). Every HeroUI prop is kept.
|
|
14
|
+
* HeroUI's Drawer renders its Modal underneath and forwards `closeButton` / `hideCloseButton` to it
|
|
15
|
+
* (@heroui/drawer chunk-VASKIHQC.mjs), so it takes the same fix as the DS `Modal`.
|
|
16
|
+
*/
|
|
17
|
+
export declare const Drawer: import('react').ForwardRefExoticComponent<Omit<DrawerProps, "ref"> & import('react').RefAttributes<HTMLElement>>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export interface CloseButtonProps extends ComponentPropsWithoutRef<'button'> {
|
|
3
|
+
/** The accessible name. Applied after everything HeroUI passes, so its literal "Close" never wins. */
|
|
4
|
+
label: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* The corner close button of a DS `Modal` / `Drawer` that carries a translated name.
|
|
8
|
+
*
|
|
9
|
+
* Not for direct use: HeroUI `cloneElement`s the `closeButton` it is given and passes its own props last
|
|
10
|
+
* (@heroui/modal chunk-NWAOTABO.mjs, `cloneElement(closeButton, getCloseButtonProps())`): the slot
|
|
11
|
+
* className, `role`, `tabIndex`, `data-focus-visible`, the react-aria press handlers and
|
|
12
|
+
* `aria-label: "Close"`. This component spreads all of that onto a `<button>` and sets `aria-label` last.
|
|
13
|
+
*
|
|
14
|
+
* The X is HeroUI's own default close icon, copied so the button renders identically: the SVG of
|
|
15
|
+
* `CloseIcon` in @heroui/shared-icons (dist/chunk-3JRSRN3Z.mjs, src/close.tsx, v2.1.10). It is not
|
|
16
|
+
* imported because `@heroui/shared-icons` is a transitive dependency of `@heroui/react`, not a DS one.
|
|
17
|
+
*/
|
|
18
|
+
export declare function CloseButton({ label, ...heroUIProps }: CloseButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ModalProps as HeroUIModalProps } from '@heroui/react';
|
|
2
|
+
export type ModalProps = HeroUIModalProps & {
|
|
3
|
+
/**
|
|
4
|
+
* Accessible name of the corner close button, e.g. `"Fermer"`. HeroUI hard-codes `"Close"`.
|
|
5
|
+
*
|
|
6
|
+
* Falls back to the `closeLabel` of `HeroUIProvider`; with neither, HeroUI's own button is rendered
|
|
7
|
+
* untouched. It names the default button only: a `closeButton` you pass is yours, and
|
|
8
|
+
* `hideCloseButton` still hides the button.
|
|
9
|
+
*/
|
|
10
|
+
closeLabel?: string;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* HeroUI `Modal` with a translatable close button (WCAG 3.1.2, 4.1.2). Every HeroUI prop is kept.
|
|
14
|
+
*/
|
|
15
|
+
export declare const Modal: import('react').ForwardRefExoticComponent<Omit<ModalProps, "ref"> & import('react').RefAttributes<HTMLElement>>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The `closeButton` to hand to HeroUI's Modal / Drawer.
|
|
4
|
+
*
|
|
5
|
+
* - A caller-supplied element is returned as is (HeroUI clones it and decides its props).
|
|
6
|
+
* - Otherwise, when a label resolves (the `closeLabel` prop, then the `HeroUIProvider` value; a blank one
|
|
7
|
+
* counts as unset), a `CloseButton` carrying it.
|
|
8
|
+
* - Otherwise `undefined`: nothing is injected and HeroUI renders its own button, `aria-label="Close"`
|
|
9
|
+
* included. `null` / `false` mean "no element supplied" here, as they do for HeroUI.
|
|
10
|
+
*
|
|
11
|
+
* `hideCloseButton` is not read here: it stays a HeroUI prop and still decides whether any of this renders.
|
|
12
|
+
*/
|
|
13
|
+
export declare function useLabelledCloseButton(closeLabel: string | undefined, closeButton: ReactNode): ReactNode;
|
|
@@ -3,6 +3,16 @@ type HeroSelectProps<T extends object = object> = HeroUISelectProps<T>;
|
|
|
3
3
|
export type SelectPopoverProps = NonNullable<HeroSelectProps['popoverProps']> & {
|
|
4
4
|
disableDialogFocus?: boolean;
|
|
5
5
|
portalContainer?: Element;
|
|
6
|
+
/**
|
|
7
|
+
* Marks the popover root as a react-aria top layer. The Modal aria-hides every node added outside
|
|
8
|
+
* its dialog, and the list is portaled next to the dialog, so without the marker the open list is
|
|
9
|
+
* hidden from assistive tech (WCAG 4.1.2).
|
|
10
|
+
* - `undefined` (default): set to `'true'` only when the Select renders inside a dialog.
|
|
11
|
+
* - `'true'`: always set to `'true'`, inside or outside a dialog.
|
|
12
|
+
* - `'false'`: opt out. The attribute is not passed to HeroUI at all, because react-aria's focus
|
|
13
|
+
* and outside-click checks match its presence, so a rendered `'false'` would still count there.
|
|
14
|
+
*/
|
|
15
|
+
'data-react-aria-top-layer'?: 'true' | 'false';
|
|
6
16
|
};
|
|
7
17
|
export type SelectProps<T extends object = object> = Omit<HeroSelectProps<T>, 'popoverProps'> & {
|
|
8
18
|
popoverProps?: SelectPopoverProps;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TableProps as HeroUITableProps } from '@heroui/react';
|
|
2
|
+
/**
|
|
3
|
+
* HeroUI's full Table props: every slot in `classNames`, selection, sorting, `ref`, render-function children.
|
|
4
|
+
* Generic over the row type exactly like HeroUI's, so a consumer's `TableProps<Row>` keeps compiling.
|
|
5
|
+
*/
|
|
6
|
+
export type TableProps<T = object> = HeroUITableProps<T>;
|
|
7
|
+
export declare const Table: import('react').ForwardRefExoticComponent<Omit<import('@heroui/system').MergeWithAs<Omit<import('react').DetailedHTMLProps<import('react').TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>, "ref">, Omit<Omit<any, "ref">, never>, HeroUITableProps<object>, import('@heroui/system').As<any>>, "ref"> & import('react').RefAttributes<HTMLElement>>;
|
|
@@ -17,7 +17,13 @@ export { Button } from './Button';
|
|
|
17
17
|
export type { ButtonProps } from './Button';
|
|
18
18
|
export { DatePicker } from './DatePicker';
|
|
19
19
|
export type { DatePickerProps } from './DatePicker';
|
|
20
|
+
export { Drawer } from './Drawer';
|
|
21
|
+
export type { DrawerProps } from './Drawer';
|
|
22
|
+
export { Modal } from './Modal';
|
|
23
|
+
export type { ModalProps } from './Modal';
|
|
20
24
|
export { Select } from './Select';
|
|
21
25
|
export type { SelectProps } from './Select';
|
|
26
|
+
export { Table } from './Table';
|
|
27
|
+
export type { TableProps } from './Table';
|
|
22
28
|
export { RedeemCodeInput } from './RedeemCodeInput';
|
|
23
29
|
export type { RedeemCodeInputProps, RedeemCodeInputState } from './RedeemCodeInput';
|