@lumx/react 4.5.1 → 4.5.2-alpha.1

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 (4) hide show
  1. package/index.d.ts +49 -20
  2. package/index.js +317 -331
  3. package/index.js.map +1 -1
  4. package/package.json +4 -3
package/index.d.ts CHANGED
@@ -755,7 +755,7 @@ interface ButtonProps extends GenericProps$1, ReactToJSX<ButtonProps$1> {
755
755
  * @param ref Component ref.
756
756
  * @return React element.
757
757
  */
758
- declare const Button: Comp<ButtonProps, HTMLButtonElement | HTMLAnchorElement>;
758
+ declare const Button: Comp<ButtonProps, HTMLAnchorElement | HTMLButtonElement>;
759
759
 
760
760
  interface IconButtonProps$1 extends BaseButtonProps {
761
761
  /**
@@ -1241,7 +1241,7 @@ declare const Placement: {
1241
1241
  readonly LEFT_END: "left-end";
1242
1242
  readonly LEFT_START: "left-start";
1243
1243
  };
1244
- type Placement = ValueOf$1<typeof Placement>;
1244
+ type Placement = ValueOf<typeof Placement>;
1245
1245
  /**
1246
1246
  * Offset of the popover.
1247
1247
  */
@@ -1263,20 +1263,23 @@ declare const FitAnchorWidth: {
1263
1263
  readonly MIN_WIDTH: "minWidth";
1264
1264
  readonly WIDTH: "width";
1265
1265
  };
1266
- type FitAnchorWidth = ValueOf$1<typeof FitAnchorWidth>;
1266
+ type FitAnchorWidth = ValueOf<typeof FitAnchorWidth>;
1267
1267
 
1268
1268
  /**
1269
- * Defines the props of the component.
1269
+ * Shared popover props used by both React and Vue wrappers.
1270
+ *
1271
+ * Framework-specific props (ref types, children, callbacks) are added by each wrapper.
1272
+ * The `anchorRef`, `boundaryRef`, `focusElement`, `parentElement`, `focusTrapZoneElement`
1273
+ * are typed as `any` here because React uses `RefObject<HTMLElement>` while Vue uses
1274
+ * raw `HTMLElement` — each framework narrows the type in its own props definition.
1270
1275
  */
1271
- interface PopoverProps extends GenericProps$1, HasTheme$1 {
1276
+ interface PopoverProps$1 extends HasClassName, HasTheme {
1272
1277
  /** Reference to the DOM element used to set the position of the popover. */
1273
- anchorRef: React.RefObject<HTMLElement>;
1274
- /** Customize the root element. (Must accept ref forwarding and props forwarding!). */
1275
- as?: React.ElementType;
1278
+ anchorRef?: CommonRef;
1279
+ /** Customize the root element tag. */
1280
+ as?: string;
1276
1281
  /** Element which will act as boundary when opening the popover. */
1277
- boundaryRef?: RefObject<HTMLElement>;
1278
- /** Content. */
1279
- children: ReactNode;
1282
+ boundaryRef?: CommonRef;
1280
1283
  /** Whether a click anywhere out of the popover would close it. */
1281
1284
  closeOnClickAway?: boolean;
1282
1285
  /** Whether an escape key press would close the popover. */
@@ -1293,7 +1296,7 @@ interface PopoverProps extends GenericProps$1, HasTheme$1 {
1293
1296
  /** Shrink popover if even after flipping there is not enough space. */
1294
1297
  fitWithinViewportHeight?: boolean;
1295
1298
  /** Element to focus when opening the popover. */
1296
- focusElement?: RefObject<HTMLElement>;
1299
+ focusElement?: CommonRef;
1297
1300
  /** Whether the focus should go back on the anchor when popover closes and focus is within. */
1298
1301
  focusAnchorOnClose?: boolean;
1299
1302
  /** Whether we put an arrow or not. */
@@ -1302,20 +1305,46 @@ interface PopoverProps extends GenericProps$1, HasTheme$1 {
1302
1305
  isOpen: boolean;
1303
1306
  /** Offset placement relative to anchor. */
1304
1307
  offset?: Offset;
1305
- /** Reference to the parent element that triggered the popover (will get back focus on close or else fallback on the anchor element). */
1306
- parentElement?: RefObject<HTMLElement>;
1308
+ /** Reference to the parent element that triggered the popover. */
1309
+ parentElement?: CommonRef;
1307
1310
  /** Placement relative to anchor. */
1308
1311
  placement?: Placement;
1309
- /** Whether the popover should be rendered into a DOM node that exists outside the DOM hierarchy of the parent component. */
1312
+ /** Whether the popover should be rendered into a portal. */
1310
1313
  usePortal?: boolean;
1311
1314
  /** The element in which the focus trap should be set. Default to popover. */
1312
- focusTrapZoneElement?: RefObject<HTMLElement>;
1315
+ focusTrapZoneElement?: CommonRef;
1313
1316
  /** Z-axis position. */
1314
1317
  zIndex?: number;
1318
+ /** Whether the popover should trap the focus within itself. */
1319
+ withFocusTrap?: boolean;
1320
+ /** On close callback (on click away or Escape pressed). Framework wrappers provide their own type. */
1321
+ handleClose?(): void;
1322
+ }
1323
+
1324
+ /**
1325
+ * Defines the props of the component.
1326
+ * Extends core PopoverProps, overriding ref-typed props with React-specific `RefObject` types
1327
+ * and replacing `handleClose` with the React-idiomatic `onClose` callback.
1328
+ */
1329
+ interface PopoverProps extends GenericProps$1, ReactToJSX<PopoverProps$1, 'anchorRef' | 'as' | 'boundaryRef' | 'focusElement' | 'parentElement' | 'focusTrapZoneElement' | 'className'> {
1330
+ /** Reference to the DOM element used to set the position of the popover. */
1331
+ anchorRef: RefObject<HTMLElement>;
1332
+ /** Customize the root element. (Must accept ref forwarding and props forwarding!). */
1333
+ as?: React.ElementType;
1334
+ /** Element which will act as boundary when opening the popover. */
1335
+ boundaryRef?: RefObject<HTMLElement>;
1336
+ /** Content. */
1337
+ children: ReactNode;
1338
+ /** Element to focus when opening the popover. */
1339
+ focusElement?: RefObject<HTMLElement>;
1340
+ /** Reference to the parent element that triggered the popover (will get back focus on close or else fallback on the anchor element). */
1341
+ parentElement?: RefObject<HTMLElement>;
1342
+ /** Whether the popover should be rendered into a DOM node that exists outside the DOM hierarchy of the parent component. */
1343
+ usePortal?: boolean;
1344
+ /** The element in which the focus trap should be set. Default to popover. */
1345
+ focusTrapZoneElement?: RefObject<HTMLElement>;
1315
1346
  /** On close callback (on click away or Escape pressed). */
1316
1347
  onClose?(): void;
1317
- /** Whether the popover should trap the focus within itself. Default to false. */
1318
- withFocusTrap?: boolean;
1319
1348
  }
1320
1349
  /**
1321
1350
  * Popover component.
@@ -2261,7 +2290,7 @@ interface LinkProps extends GenericProps$1, ReactToJSX<LinkProps$1> {
2261
2290
  * @param ref Component ref.
2262
2291
  * @return React element.
2263
2292
  */
2264
- declare const Link: Comp<LinkProps, HTMLButtonElement | HTMLAnchorElement>;
2293
+ declare const Link: Comp<LinkProps, HTMLAnchorElement | HTMLButtonElement>;
2265
2294
 
2266
2295
  /**
2267
2296
  * Defines the props of the component.
@@ -2368,7 +2397,7 @@ interface ListItemProps extends GenericProps$1, HasAriaDisabled$1 {
2368
2397
  * Check if the list item is clickable.
2369
2398
  * @return `true` if the list item is clickable; `false` otherwise.
2370
2399
  */
2371
- declare function isClickable({ linkProps, onItemSelected }: Partial<ListItemProps>): boolean;
2400
+ declare function isClickable({ linkAs, linkProps, onItemSelected }: Partial<ListItemProps>): boolean;
2372
2401
  /**
2373
2402
  * ListItem component.
2374
2403
  *