@veevarts/design-system 2.21.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.
@@ -1,6 +1,14 @@
1
1
  import { ReactNode } from 'react';
2
2
  interface HeroUIProviderProps {
3
3
  children: ReactNode;
4
+ /**
5
+ * App-wide accessible name for the corner close button of every DS `Modal` and `Drawer`, e.g. `"Fermer"`.
6
+ * HeroUI hard-codes `"Close"`, so a localized app sets this once instead of on each overlay.
7
+ *
8
+ * A `closeLabel` on a `Modal` / `Drawer` wins over it. A nested provider without one inherits the
9
+ * outer provider's. With none anywhere, HeroUI's own button is rendered untouched.
10
+ */
11
+ closeLabel?: string;
4
12
  }
5
- export declare function HeroUIProvider({ children }: HeroUIProviderProps): import("react/jsx-runtime").JSX.Element;
13
+ export declare function HeroUIProvider({ children, closeLabel }: HeroUIProviderProps): import("react/jsx-runtime").JSX.Element;
6
14
  export {};
@@ -0,0 +1,18 @@
1
+ /**
2
+ * The app-wide default accessible name of an overlay's corner close button.
3
+ *
4
+ * HeroUI renders that button with the literal `aria-label="Close"`, so a French
5
+ * or Spanish screen announces English. `HeroUIProvider` carries a translated
6
+ * label here and the DS `Modal` / `Drawer` read it.
7
+ *
8
+ * A leaf file on purpose: `providers/` and `components/` never import each
9
+ * other. Both import this context, and neither imports the other's barrel.
10
+ * Split from `HeroUIProvider.tsx` so that file exports a component only (fast
11
+ * refresh), as `density.ts` does for the density context.
12
+ *
13
+ * `undefined` means "no app-wide label": the overlay keeps HeroUI's own button
14
+ * and its `"Close"` name untouched.
15
+ */
16
+ export declare const CloseLabelContext: import('react').Context<string | undefined>;
17
+ /** The label of the nearest `HeroUIProvider` that set `closeLabel`; `undefined` outside one. */
18
+ export declare function useCloseLabel(): string | undefined;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@veevarts/design-system",
3
3
  "private": false,
4
- "version": "2.21.0",
4
+ "version": "2.22.0",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",