@lumx/react 4.5.0 → 4.5.2-alpha.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.
Files changed (4) hide show
  1. package/index.d.ts +51 -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
@@ -594,8 +594,10 @@ type ReactToJSX<Props, OmitProps extends keyof Props = never> = Omit<Props, Prop
594
594
  interface AvatarProps extends GenericProps$1, ReactToJSX<AvatarProps$1, 'actions' | 'badge' | 'image'> {
595
595
  /** Action toolbar content. */
596
596
  actions?: ReactNode;
597
+ /** Image URL. */
598
+ image: string;
597
599
  /** Props to pass to the link wrapping the thumbnail. */
598
- linkProps?: React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>;
600
+ linkProps?: React__default.DetailedHTMLProps<React__default.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>;
599
601
  /** Custom react component for the link (can be used to inject react router Link). */
600
602
  linkAs?: 'a' | any;
601
603
  /** On click callback. */
@@ -1239,7 +1241,7 @@ declare const Placement: {
1239
1241
  readonly LEFT_END: "left-end";
1240
1242
  readonly LEFT_START: "left-start";
1241
1243
  };
1242
- type Placement = ValueOf$1<typeof Placement>;
1244
+ type Placement = ValueOf<typeof Placement>;
1243
1245
  /**
1244
1246
  * Offset of the popover.
1245
1247
  */
@@ -1261,20 +1263,23 @@ declare const FitAnchorWidth: {
1261
1263
  readonly MIN_WIDTH: "minWidth";
1262
1264
  readonly WIDTH: "width";
1263
1265
  };
1264
- type FitAnchorWidth = ValueOf$1<typeof FitAnchorWidth>;
1266
+ type FitAnchorWidth = ValueOf<typeof FitAnchorWidth>;
1265
1267
 
1266
1268
  /**
1267
- * 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.
1268
1275
  */
1269
- interface PopoverProps extends GenericProps$1, HasTheme$1 {
1276
+ interface PopoverProps$1 extends HasClassName, HasTheme {
1270
1277
  /** Reference to the DOM element used to set the position of the popover. */
1271
- anchorRef: React.RefObject<HTMLElement>;
1272
- /** Customize the root element. (Must accept ref forwarding and props forwarding!). */
1273
- as?: React.ElementType;
1278
+ anchorRef?: CommonRef;
1279
+ /** Customize the root element tag. */
1280
+ as?: string;
1274
1281
  /** Element which will act as boundary when opening the popover. */
1275
- boundaryRef?: RefObject<HTMLElement>;
1276
- /** Content. */
1277
- children: ReactNode;
1282
+ boundaryRef?: CommonRef;
1278
1283
  /** Whether a click anywhere out of the popover would close it. */
1279
1284
  closeOnClickAway?: boolean;
1280
1285
  /** Whether an escape key press would close the popover. */
@@ -1291,7 +1296,7 @@ interface PopoverProps extends GenericProps$1, HasTheme$1 {
1291
1296
  /** Shrink popover if even after flipping there is not enough space. */
1292
1297
  fitWithinViewportHeight?: boolean;
1293
1298
  /** Element to focus when opening the popover. */
1294
- focusElement?: RefObject<HTMLElement>;
1299
+ focusElement?: CommonRef;
1295
1300
  /** Whether the focus should go back on the anchor when popover closes and focus is within. */
1296
1301
  focusAnchorOnClose?: boolean;
1297
1302
  /** Whether we put an arrow or not. */
@@ -1300,20 +1305,46 @@ interface PopoverProps extends GenericProps$1, HasTheme$1 {
1300
1305
  isOpen: boolean;
1301
1306
  /** Offset placement relative to anchor. */
1302
1307
  offset?: Offset;
1303
- /** Reference to the parent element that triggered the popover (will get back focus on close or else fallback on the anchor element). */
1304
- parentElement?: RefObject<HTMLElement>;
1308
+ /** Reference to the parent element that triggered the popover. */
1309
+ parentElement?: CommonRef;
1305
1310
  /** Placement relative to anchor. */
1306
1311
  placement?: Placement;
1307
- /** 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. */
1308
1313
  usePortal?: boolean;
1309
1314
  /** The element in which the focus trap should be set. Default to popover. */
1310
- focusTrapZoneElement?: RefObject<HTMLElement>;
1315
+ focusTrapZoneElement?: CommonRef;
1311
1316
  /** Z-axis position. */
1312
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>;
1313
1346
  /** On close callback (on click away or Escape pressed). */
1314
1347
  onClose?(): void;
1315
- /** Whether the popover should trap the focus within itself. Default to false. */
1316
- withFocusTrap?: boolean;
1317
1348
  }
1318
1349
  /**
1319
1350
  * Popover component.
@@ -1574,7 +1605,7 @@ declare const GenericBlockGapSize: Pick<{
1574
1605
  readonly medium: "medium";
1575
1606
  readonly big: "big";
1576
1607
  readonly huge: "huge";
1577
- }, "tiny" | "regular" | "medium" | "big" | "huge">;
1608
+ }, "medium" | "tiny" | "regular" | "big" | "huge">;
1578
1609
  type GenericBlockGapSize = ValueOf$1<typeof GenericBlockGapSize>;
1579
1610
 
1580
1611
  interface GenericBlockProps extends FlexBoxProps {
@@ -2366,7 +2397,7 @@ interface ListItemProps extends GenericProps$1, HasAriaDisabled$1 {
2366
2397
  * Check if the list item is clickable.
2367
2398
  * @return `true` if the list item is clickable; `false` otherwise.
2368
2399
  */
2369
- declare function isClickable({ linkProps, onItemSelected }: Partial<ListItemProps>): boolean;
2400
+ declare function isClickable({ linkAs, linkProps, onItemSelected }: Partial<ListItemProps>): boolean;
2370
2401
  /**
2371
2402
  * ListItem component.
2372
2403
  *