@fileverse/ui 5.1.8-dropdownmenu-1 → 5.1.8-dropdownmenu-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.css +3 -0
- package/dist/index.es.d.ts +130 -0
- package/dist/index.es.js +1139 -1139
- package/package.json +1 -1
package/dist/index.css
CHANGED
|
@@ -3420,6 +3420,9 @@ textarea:is(:-webkit-autofill, :autofill) {
|
|
|
3420
3420
|
.data-\[disabled\]\:color-text-disabled[data-disabled] {
|
|
3421
3421
|
color: hsl(var(--color-text-disabled));
|
|
3422
3422
|
}
|
|
3423
|
+
.data-\[highlighted\]\:color-bg-default-hover[data-highlighted] {
|
|
3424
|
+
background-color: hsl(var(--color-bg-default-hover));
|
|
3425
|
+
}
|
|
3423
3426
|
.data-\[state\=unchecked\]\:color-bg-default-hover[data-state="unchecked"] {
|
|
3424
3427
|
background-color: hsl(var(--color-bg-default-hover));
|
|
3425
3428
|
}
|
package/dist/index.es.d.ts
CHANGED
|
@@ -350,45 +350,175 @@ export declare const DrawerTitle: React_2.ForwardRefExoticComponent<Omit<DialogP
|
|
|
350
350
|
|
|
351
351
|
export declare const DrawerTrigger: React_2.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React_2.RefAttributes<HTMLButtonElement>>;
|
|
352
352
|
|
|
353
|
+
/**
|
|
354
|
+
* `DropdownMenu` — a menu of actions or options shown when a button is
|
|
355
|
+
* activated. Built on Radix UI's DropdownMenu primitive and styled with the
|
|
356
|
+
* Fileverse design system.
|
|
357
|
+
*
|
|
358
|
+
* Composition-first: import the parts you need and assemble them. Every part
|
|
359
|
+
* forwards its `ref` and spreads props onto the underlying Radix primitive, so
|
|
360
|
+
* any Radix prop works without extra wiring.
|
|
361
|
+
*
|
|
362
|
+
* Parts: {@link DropdownMenuTrigger}, {@link DropdownMenuContent},
|
|
363
|
+
* {@link DropdownMenuItem}, {@link DropdownMenuCheckboxItem},
|
|
364
|
+
* {@link DropdownMenuRadioGroup}/{@link DropdownMenuRadioItem},
|
|
365
|
+
* {@link DropdownMenuLabel}, {@link DropdownMenuSeparator},
|
|
366
|
+
* {@link DropdownMenuShortcut}, {@link DropdownMenuGroup},
|
|
367
|
+
* {@link DropdownMenuSub}/{@link DropdownMenuSubTrigger}/{@link DropdownMenuSubContent},
|
|
368
|
+
* {@link DropdownMenuPortal}, {@link DropdownMenuArrow}.
|
|
369
|
+
*
|
|
370
|
+
* @example Basic menu
|
|
371
|
+
* ```tsx
|
|
372
|
+
* <DropdownMenu>
|
|
373
|
+
* <DropdownMenuTrigger asChild>
|
|
374
|
+
* <Button>Open</Button>
|
|
375
|
+
* </DropdownMenuTrigger>
|
|
376
|
+
* <DropdownMenuContent align="start">
|
|
377
|
+
* <DropdownMenuLabel>My Account</DropdownMenuLabel>
|
|
378
|
+
* <DropdownMenuSeparator />
|
|
379
|
+
* <DropdownMenuItem>
|
|
380
|
+
* Profile <DropdownMenuShortcut>⇧⌘P</DropdownMenuShortcut>
|
|
381
|
+
* </DropdownMenuItem>
|
|
382
|
+
* <DropdownMenuItem disabled>Log out</DropdownMenuItem>
|
|
383
|
+
* </DropdownMenuContent>
|
|
384
|
+
* </DropdownMenu>
|
|
385
|
+
* ```
|
|
386
|
+
*
|
|
387
|
+
* @example Checkbox items, a radio group, and a nested sub-menu
|
|
388
|
+
* ```tsx
|
|
389
|
+
* <DropdownMenuContent>
|
|
390
|
+
* <DropdownMenuCheckboxItem checked={show} onCheckedChange={setShow}>
|
|
391
|
+
* Show panel
|
|
392
|
+
* </DropdownMenuCheckboxItem>
|
|
393
|
+
* <DropdownMenuRadioGroup value={pos} onValueChange={setPos}>
|
|
394
|
+
* <DropdownMenuRadioItem value="top">Top</DropdownMenuRadioItem>
|
|
395
|
+
* <DropdownMenuRadioItem value="bottom">Bottom</DropdownMenuRadioItem>
|
|
396
|
+
* </DropdownMenuRadioGroup>
|
|
397
|
+
* <DropdownMenuSub>
|
|
398
|
+
* <DropdownMenuSubTrigger>More</DropdownMenuSubTrigger>
|
|
399
|
+
* <DropdownMenuSubContent>
|
|
400
|
+
* <DropdownMenuItem>Email</DropdownMenuItem>
|
|
401
|
+
* </DropdownMenuSubContent>
|
|
402
|
+
* </DropdownMenuSub>
|
|
403
|
+
* </DropdownMenuContent>
|
|
404
|
+
* ```
|
|
405
|
+
*
|
|
406
|
+
* @see Storybook — https://fileverse-ui.vercel.app/?path=/docs/components-dropdownmenu--docs
|
|
407
|
+
* @see Radix primitive — https://www.radix-ui.com/primitives/docs/components/dropdown-menu
|
|
408
|
+
*
|
|
409
|
+
* @remarks
|
|
410
|
+
* The root. Manages open state and must wrap the trigger and content. Pass
|
|
411
|
+
* `open` / `onOpenChange` to control it, or `defaultOpen` for the uncontrolled
|
|
412
|
+
* case.
|
|
413
|
+
*/
|
|
353
414
|
export declare const DropdownMenu: React_2.FC<DropdownMenuPrimitive.DropdownMenuProps>;
|
|
354
415
|
|
|
416
|
+
/**
|
|
417
|
+
* Optional arrow pointing at the trigger. Not rendered by default — drop it
|
|
418
|
+
* inside {@link DropdownMenuContent} to opt in.
|
|
419
|
+
*/
|
|
355
420
|
export declare const DropdownMenuArrow: React_2.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuArrowProps & React_2.RefAttributes<SVGSVGElement>>;
|
|
356
421
|
|
|
422
|
+
/**
|
|
423
|
+
* A toggleable item with a check indicator. Controlled via `checked` /
|
|
424
|
+
* `onCheckedChange`; `checked` also accepts `"indeterminate"`.
|
|
425
|
+
*/
|
|
357
426
|
export declare const DropdownMenuCheckboxItem: React_2.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuCheckboxItemProps & React_2.RefAttributes<HTMLDivElement>, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
|
|
358
427
|
|
|
428
|
+
/**
|
|
429
|
+
* Floating panel that holds the menu's items. Portaled automatically.
|
|
430
|
+
* Position it with `side` / `align` / `sideOffset` (defaults to `4`).
|
|
431
|
+
*/
|
|
359
432
|
export declare const DropdownMenuContent: React_2.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuContentProps & React_2.RefAttributes<HTMLDivElement>, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
|
|
360
433
|
|
|
434
|
+
/**
|
|
435
|
+
* Groups related {@link DropdownMenuItem}s for semantics/accessibility. Pair
|
|
436
|
+
* with a {@link DropdownMenuLabel} to title the group.
|
|
437
|
+
*/
|
|
361
438
|
export declare const DropdownMenuGroup: React_2.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuGroupProps & React_2.RefAttributes<HTMLDivElement>>;
|
|
362
439
|
|
|
440
|
+
/**
|
|
441
|
+
* A selectable action. Wire up `onSelect`, set `disabled`, or use `inset` to
|
|
442
|
+
* align its label with sibling checkbox/radio items.
|
|
443
|
+
*/
|
|
363
444
|
export declare const DropdownMenuItem: React_2.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuItemProps & React_2.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
364
445
|
inset?: boolean;
|
|
365
446
|
} & React_2.RefAttributes<HTMLDivElement>>;
|
|
366
447
|
|
|
448
|
+
/**
|
|
449
|
+
* Non-interactive heading for a section of items. Use `inset` to align it with
|
|
450
|
+
* sibling checkbox/radio items.
|
|
451
|
+
*/
|
|
367
452
|
export declare const DropdownMenuLabel: React_2.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuLabelProps & React_2.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
368
453
|
inset?: boolean;
|
|
369
454
|
} & React_2.RefAttributes<HTMLDivElement>>;
|
|
370
455
|
|
|
456
|
+
/**
|
|
457
|
+
* Renders menu content into a portal. {@link DropdownMenuContent} already
|
|
458
|
+
* portals its children, so reach for this only when you need to control the
|
|
459
|
+
* portal container yourself.
|
|
460
|
+
*/
|
|
371
461
|
export declare const DropdownMenuPortal: React_2.FC<DropdownMenuPrimitive.DropdownMenuPortalProps>;
|
|
372
462
|
|
|
463
|
+
/**
|
|
464
|
+
* Wraps {@link DropdownMenuRadioItem}s so only one can be selected at a time.
|
|
465
|
+
* Controlled via `value` / `onValueChange`.
|
|
466
|
+
*/
|
|
373
467
|
export declare const DropdownMenuRadioGroup: React_2.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuRadioGroupProps & React_2.RefAttributes<HTMLDivElement>>;
|
|
374
468
|
|
|
469
|
+
/**
|
|
470
|
+
* A single-choice item with a dot indicator. Must live inside a
|
|
471
|
+
* {@link DropdownMenuRadioGroup}; identified by its `value`.
|
|
472
|
+
*/
|
|
375
473
|
export declare const DropdownMenuRadioItem: React_2.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuRadioItemProps & React_2.RefAttributes<HTMLDivElement>, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
|
|
376
474
|
|
|
475
|
+
/** Thin horizontal divider between groups of items. */
|
|
377
476
|
export declare const DropdownMenuSeparator: React_2.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSeparatorProps & React_2.RefAttributes<HTMLDivElement>, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
|
|
378
477
|
|
|
478
|
+
/**
|
|
479
|
+
* Right-aligned, muted hint for a keyboard shortcut. Purely presentational —
|
|
480
|
+
* render it as the trailing child of a {@link DropdownMenuItem}. It does not
|
|
481
|
+
* register the shortcut.
|
|
482
|
+
*
|
|
483
|
+
* @example
|
|
484
|
+
* ```tsx
|
|
485
|
+
* <DropdownMenuItem>Save <DropdownMenuShortcut>⌘S</DropdownMenuShortcut></DropdownMenuItem>
|
|
486
|
+
* ```
|
|
487
|
+
*/
|
|
379
488
|
export declare const DropdownMenuShortcut: {
|
|
380
489
|
({ className, ...props }: React_2.HTMLAttributes<HTMLSpanElement>): JSX_2.Element;
|
|
381
490
|
displayName: string;
|
|
382
491
|
};
|
|
383
492
|
|
|
493
|
+
/**
|
|
494
|
+
* Wraps a {@link DropdownMenuSubTrigger} and a {@link DropdownMenuSubContent}
|
|
495
|
+
* to create a nested sub-menu.
|
|
496
|
+
*/
|
|
384
497
|
export declare const DropdownMenuSub: React_2.FC<DropdownMenuPrimitive.DropdownMenuSubProps>;
|
|
385
498
|
|
|
499
|
+
/** Floating panel that holds a sub-menu's items. Belongs inside {@link DropdownMenuSub}. */
|
|
386
500
|
export declare const DropdownMenuSubContent: React_2.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubContentProps & React_2.RefAttributes<HTMLDivElement>, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
|
|
387
501
|
|
|
502
|
+
/**
|
|
503
|
+
* Trigger row inside {@link DropdownMenuContent} that opens a nested sub-menu.
|
|
504
|
+
* Shows a trailing chevron. Set `inset` to align its label with sibling
|
|
505
|
+
* checkbox/radio items.
|
|
506
|
+
*/
|
|
388
507
|
export declare const DropdownMenuSubTrigger: React_2.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubTriggerProps & React_2.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
389
508
|
inset?: boolean;
|
|
390
509
|
} & React_2.RefAttributes<HTMLDivElement>>;
|
|
391
510
|
|
|
511
|
+
/**
|
|
512
|
+
* Button that opens the menu. Use `asChild` to render your own element (e.g.
|
|
513
|
+
* `Button` / `IconButton`) as the trigger instead of the default `<button>`.
|
|
514
|
+
*
|
|
515
|
+
* @example
|
|
516
|
+
* ```tsx
|
|
517
|
+
* <DropdownMenuTrigger asChild>
|
|
518
|
+
* <Button>Open</Button>
|
|
519
|
+
* </DropdownMenuTrigger>
|
|
520
|
+
* ```
|
|
521
|
+
*/
|
|
392
522
|
export declare const DropdownMenuTrigger: React_2.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuTriggerProps & React_2.RefAttributes<HTMLButtonElement>>;
|
|
393
523
|
|
|
394
524
|
export declare const DynamicAlert: ({ title, description, variant, icon, className, iconClassName, ...props }: DynamicAlertProps) => JSX_2.Element;
|