@gouvfr-lasuite/ui-kit 0.16.1 → 0.16.2

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/dist/index.d.ts CHANGED
@@ -4,6 +4,7 @@ import { CunninghamProvider as CunninghamProvider_2 } from '@openfun/cunningham-
4
4
  import { CursorProps } from 'react-arborist';
5
5
  import { default as default_2 } from 'react';
6
6
  import { Dispatch } from 'react';
7
+ import { HTMLAttributes } from 'react';
7
8
  import { JSX } from 'react/jsx-runtime';
8
9
  import { Key } from 'react-stately';
9
10
  import { LabelHTMLAttributes } from 'react';
@@ -59,6 +60,15 @@ export declare type AvatarProps = {
59
60
  forceColor?: string;
60
61
  };
61
62
 
63
+ export declare const Badge: ({ children, uppercased, type, className, ...props }: PropsWithChildren<BadgeProps>) => JSX.Element;
64
+
65
+ declare type BadgeProps = HTMLAttributes<HTMLDivElement> & {
66
+ uppercased?: boolean;
67
+ type?: BadgeType;
68
+ };
69
+
70
+ declare type BadgeType = "accent" | "neutral" | "danger" | "success" | "warning" | "info";
71
+
62
72
  export declare type BaseTreeViewData<T> = {
63
73
  id: string;
64
74
  childrenCount?: number;
@@ -1274,6 +1284,27 @@ export declare type TreeViewProps<T> = {
1274
1284
 
1275
1285
  export declare const TreeViewSeparator: ({ top, left }: CursorProps) => JSX.Element;
1276
1286
 
1287
+ /**
1288
+ * useArrowRoving
1289
+ *
1290
+ * Hook to manage keyboard navigation with ArrowLeft / ArrowRight inside a toolbar of actions.
1291
+ * - ArrowLeft / ArrowRight → move focus between buttons in the same container (roving focus).
1292
+ * - Enter → still activate the focused button normally, except right after roving
1293
+ * where the hook suppresses the "phantom click" (to avoid triggering actions by mistake).
1294
+ *
1295
+ * Usage:
1296
+ * const actionsRef = useRef<HTMLDivElement | null>(null);
1297
+ * useArrowRoving(actionsRef.current);
1298
+ *
1299
+ * return (
1300
+ * <div ref={actionsRef}>
1301
+ * <button>Option 1</button>
1302
+ * <button>Option 2</button>
1303
+ * </div>
1304
+ * );
1305
+ */
1306
+ export declare function useArrowRoving(container: HTMLElement | null): void;
1307
+
1277
1308
  /**
1278
1309
  * Hook for using custom translations with type safety.
1279
1310
  *