@veevarts/design-system 2.20.0 → 2.22.0
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 +14 -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/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 +5 -5
- package/dist/index.js +5034 -4482
- 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/WizardShell/index.d.ts +1 -1
- package/dist/patterns/WizardShell/types.d.ts +9 -1
- package/dist/patterns/index.d.ts +5 -1
- package/dist/providers/HeroUIProvider.d.ts +9 -1
- package/dist/providers/close-label-context.d.ts +18 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -183,6 +183,20 @@ 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
|
+
**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.
|
|
199
|
+
|
|
186
200
|
For complete HeroUI documentation, visit: [HeroUI Storybook](https://storybook.heroui.com/)
|
|
187
201
|
|
|
188
202
|
### 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;
|
|
@@ -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';
|