@veevarts/design-system 2.1.0-beta.15 → 2.1.0-beta.17

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.
Files changed (58) hide show
  1. package/README.md +14 -0
  2. package/dist/components/Drawer/Drawer.d.ts +17 -0
  3. package/dist/components/Drawer/index.d.ts +2 -0
  4. package/dist/components/Modal/CloseButton.d.ts +18 -0
  5. package/dist/components/Modal/Modal.d.ts +15 -0
  6. package/dist/components/Modal/index.d.ts +2 -0
  7. package/dist/components/Modal/useLabelledCloseButton.d.ts +13 -0
  8. package/dist/components/Table/Table.d.ts +7 -0
  9. package/dist/components/Table/index.d.ts +2 -0
  10. package/dist/components/index.d.ts +6 -0
  11. package/dist/index.cjs +5 -5
  12. package/dist/index.js +6239 -5010
  13. package/dist/patterns/AdminToolbar/styles.d.ts +1 -1
  14. package/dist/patterns/CashTenderForm/types.d.ts +6 -0
  15. package/dist/patterns/DonationAmounts/index.d.ts +1 -1
  16. package/dist/patterns/DonationAmounts/styles.d.ts +32 -0
  17. package/dist/patterns/DonationAmounts/types.d.ts +55 -1
  18. package/dist/patterns/DonationAmounts/utils/currency.d.ts +7 -3
  19. package/dist/patterns/FilterSelect/FilterSelectGroup.d.ts +3 -0
  20. package/dist/patterns/FilterSelect/index.d.ts +2 -1
  21. package/dist/patterns/FilterSelect/styles.d.ts +2 -0
  22. package/dist/patterns/FilterSelect/types.d.ts +6 -0
  23. package/dist/patterns/MetaCard/types.d.ts +2 -0
  24. package/dist/patterns/ModalPanels/focus.d.ts +5 -0
  25. package/dist/patterns/OutcomeView/index.d.ts +1 -1
  26. package/dist/patterns/OutcomeView/types.d.ts +110 -3
  27. package/dist/patterns/ReasonSelect/types.d.ts +1 -0
  28. package/dist/patterns/RefundMethodCards/RefundMethodCards.d.ts +4 -0
  29. package/dist/patterns/RefundMethodCards/index.d.ts +2 -0
  30. package/dist/patterns/RefundMethodCards/styles.d.ts +59 -0
  31. package/dist/patterns/RefundMethodCards/types.d.ts +72 -0
  32. package/dist/patterns/RefundProgressList/RefundProgressList.d.ts +4 -0
  33. package/dist/patterns/RefundProgressList/index.d.ts +2 -0
  34. package/dist/patterns/RefundProgressList/styles.d.ts +44 -0
  35. package/dist/patterns/RefundProgressList/types.d.ts +37 -0
  36. package/dist/patterns/StepProgress/StepProgress.d.ts +4 -0
  37. package/dist/patterns/StepProgress/index.d.ts +2 -0
  38. package/dist/patterns/StepProgress/styles.d.ts +29 -0
  39. package/dist/patterns/StepProgress/types.d.ts +43 -0
  40. package/dist/patterns/Summary/types.d.ts +11 -0
  41. package/dist/patterns/TileSelect/TileSelect.d.ts +13 -0
  42. package/dist/patterns/TileSelect/index.d.ts +1 -1
  43. package/dist/patterns/TileSelect/styles.d.ts +14 -0
  44. package/dist/patterns/UnderlineTabs/UnderlineTabs.d.ts +20 -1
  45. package/dist/patterns/UnderlineTabs/index.d.ts +1 -1
  46. package/dist/patterns/UnderlineTabs/styles.d.ts +10 -0
  47. package/dist/patterns/WizardShell/index.d.ts +1 -1
  48. package/dist/patterns/WizardShell/types.d.ts +9 -1
  49. package/dist/patterns/index.d.ts +13 -7
  50. package/dist/patterns/shared/usePrefillEdits.d.ts +7 -0
  51. package/dist/providers/HeroUIProvider.d.ts +9 -1
  52. package/dist/providers/close-label-context.d.ts +18 -0
  53. package/dist/tailwind/index.cjs +8 -0
  54. package/dist/tailwind/index.mjs +8 -0
  55. package/dist/test/px-class-names.d.ts +1 -0
  56. package/dist/test/px-classes.d.ts +2 -1
  57. package/dist/tokens/pos-surface.d.ts +16 -4
  58. 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,2 @@
1
+ export { Drawer } from './Drawer';
2
+ export type { DrawerProps } from './Drawer';
@@ -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,2 @@
1
+ export { Modal } from './Modal';
2
+ export type { ModalProps } from './Modal';
@@ -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>>;
@@ -0,0 +1,2 @@
1
+ export { Table } from './Table';
2
+ export type { TableProps } from './Table';
@@ -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';