@fileverse/ui 5.1.7 → 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 CHANGED
@@ -1676,6 +1676,9 @@ video {
1676
1676
  .h-14 {
1677
1677
  height: 3.5rem;
1678
1678
  }
1679
+ .h-2 {
1680
+ height: 0.5rem;
1681
+ }
1679
1682
  .h-3 {
1680
1683
  height: 0.75rem;
1681
1684
  }
@@ -1840,6 +1843,9 @@ video {
1840
1843
  .w-16 {
1841
1844
  width: 4rem;
1842
1845
  }
1846
+ .w-2 {
1847
+ width: 0.5rem;
1848
+ }
1843
1849
  .w-20 {
1844
1850
  width: 5rem;
1845
1851
  }
@@ -1867,6 +1873,9 @@ video {
1867
1873
  .w-52 {
1868
1874
  width: 13rem;
1869
1875
  }
1876
+ .w-56 {
1877
+ width: 14rem;
1878
+ }
1870
1879
  .w-6 {
1871
1880
  width: 1.5rem;
1872
1881
  }
@@ -2571,6 +2580,9 @@ video {
2571
2580
  .bg-none {
2572
2581
  background-image: none;
2573
2582
  }
2583
+ .fill-current {
2584
+ fill: currentColor;
2585
+ }
2574
2586
  .stroke-\[hsl\(var\(--color-bg-default\)\)\] {
2575
2587
  stroke: hsl(var(--color-bg-default));
2576
2588
  }
@@ -2729,9 +2741,15 @@ video {
2729
2741
  .pl-6 {
2730
2742
  padding-left: 1.5rem;
2731
2743
  }
2744
+ .pl-8 {
2745
+ padding-left: 2rem;
2746
+ }
2732
2747
  .pr-10 {
2733
2748
  padding-right: 2.5rem;
2734
2749
  }
2750
+ .pr-2 {
2751
+ padding-right: 0.5rem;
2752
+ }
2735
2753
  .pr-3 {
2736
2754
  padding-right: 0.75rem;
2737
2755
  }
@@ -3402,6 +3420,9 @@ textarea:is(:-webkit-autofill, :autofill) {
3402
3420
  .data-\[disabled\]\:color-text-disabled[data-disabled] {
3403
3421
  color: hsl(var(--color-text-disabled));
3404
3422
  }
3423
+ .data-\[highlighted\]\:color-bg-default-hover[data-highlighted] {
3424
+ background-color: hsl(var(--color-bg-default-hover));
3425
+ }
3405
3426
  .data-\[state\=unchecked\]\:color-bg-default-hover[data-state="unchecked"] {
3406
3427
  background-color: hsl(var(--color-bg-default-hover));
3407
3428
  }
@@ -7,6 +7,7 @@ import { default as default_2 } from 'react';
7
7
  import * as DialogPrimitive from '@radix-ui/react-dialog';
8
8
  import { DialogProps } from '@radix-ui/react-dialog';
9
9
  import { Drawer as Drawer_2 } from 'vaul';
10
+ import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
10
11
  import { EmojiClickData } from 'emoji-picker-react';
11
12
  import { default as EmojiPicker } from 'emoji-picker-react';
12
13
  import { EmojiStyle } from 'emoji-picker-react';
@@ -349,6 +350,177 @@ export declare const DrawerTitle: React_2.ForwardRefExoticComponent<Omit<DialogP
349
350
 
350
351
  export declare const DrawerTrigger: React_2.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React_2.RefAttributes<HTMLButtonElement>>;
351
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
+ */
414
+ export declare const DropdownMenu: React_2.FC<DropdownMenuPrimitive.DropdownMenuProps>;
415
+
416
+ /**
417
+ * Optional arrow pointing at the trigger. Not rendered by default — drop it
418
+ * inside {@link DropdownMenuContent} to opt in.
419
+ */
420
+ export declare const DropdownMenuArrow: React_2.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuArrowProps & React_2.RefAttributes<SVGSVGElement>>;
421
+
422
+ /**
423
+ * A toggleable item with a check indicator. Controlled via `checked` /
424
+ * `onCheckedChange`; `checked` also accepts `"indeterminate"`.
425
+ */
426
+ export declare const DropdownMenuCheckboxItem: React_2.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuCheckboxItemProps & React_2.RefAttributes<HTMLDivElement>, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
427
+
428
+ /**
429
+ * Floating panel that holds the menu's items. Portaled automatically.
430
+ * Position it with `side` / `align` / `sideOffset` (defaults to `4`).
431
+ */
432
+ export declare const DropdownMenuContent: React_2.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuContentProps & React_2.RefAttributes<HTMLDivElement>, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
433
+
434
+ /**
435
+ * Groups related {@link DropdownMenuItem}s for semantics/accessibility. Pair
436
+ * with a {@link DropdownMenuLabel} to title the group.
437
+ */
438
+ export declare const DropdownMenuGroup: React_2.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuGroupProps & React_2.RefAttributes<HTMLDivElement>>;
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
+ */
444
+ export declare const DropdownMenuItem: React_2.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuItemProps & React_2.RefAttributes<HTMLDivElement>, "ref"> & {
445
+ inset?: boolean;
446
+ } & React_2.RefAttributes<HTMLDivElement>>;
447
+
448
+ /**
449
+ * Non-interactive heading for a section of items. Use `inset` to align it with
450
+ * sibling checkbox/radio items.
451
+ */
452
+ export declare const DropdownMenuLabel: React_2.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuLabelProps & React_2.RefAttributes<HTMLDivElement>, "ref"> & {
453
+ inset?: boolean;
454
+ } & React_2.RefAttributes<HTMLDivElement>>;
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
+ */
461
+ export declare const DropdownMenuPortal: React_2.FC<DropdownMenuPrimitive.DropdownMenuPortalProps>;
462
+
463
+ /**
464
+ * Wraps {@link DropdownMenuRadioItem}s so only one can be selected at a time.
465
+ * Controlled via `value` / `onValueChange`.
466
+ */
467
+ export declare const DropdownMenuRadioGroup: React_2.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuRadioGroupProps & React_2.RefAttributes<HTMLDivElement>>;
468
+
469
+ /**
470
+ * A single-choice item with a dot indicator. Must live inside a
471
+ * {@link DropdownMenuRadioGroup}; identified by its `value`.
472
+ */
473
+ export declare const DropdownMenuRadioItem: React_2.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuRadioItemProps & React_2.RefAttributes<HTMLDivElement>, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
474
+
475
+ /** Thin horizontal divider between groups of items. */
476
+ export declare const DropdownMenuSeparator: React_2.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSeparatorProps & React_2.RefAttributes<HTMLDivElement>, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
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
+ */
488
+ export declare const DropdownMenuShortcut: {
489
+ ({ className, ...props }: React_2.HTMLAttributes<HTMLSpanElement>): JSX_2.Element;
490
+ displayName: string;
491
+ };
492
+
493
+ /**
494
+ * Wraps a {@link DropdownMenuSubTrigger} and a {@link DropdownMenuSubContent}
495
+ * to create a nested sub-menu.
496
+ */
497
+ export declare const DropdownMenuSub: React_2.FC<DropdownMenuPrimitive.DropdownMenuSubProps>;
498
+
499
+ /** Floating panel that holds a sub-menu's items. Belongs inside {@link DropdownMenuSub}. */
500
+ export declare const DropdownMenuSubContent: React_2.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubContentProps & React_2.RefAttributes<HTMLDivElement>, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
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
+ */
507
+ export declare const DropdownMenuSubTrigger: React_2.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubTriggerProps & React_2.RefAttributes<HTMLDivElement>, "ref"> & {
508
+ inset?: boolean;
509
+ } & React_2.RefAttributes<HTMLDivElement>>;
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
+ */
522
+ export declare const DropdownMenuTrigger: React_2.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuTriggerProps & React_2.RefAttributes<HTMLButtonElement>>;
523
+
352
524
  export declare const DynamicAlert: ({ title, description, variant, icon, className, iconClassName, ...props }: DynamicAlertProps) => JSX_2.Element;
353
525
 
354
526
  export declare interface DynamicAlertProps {
@@ -1026,6 +1198,7 @@ export declare const Tooltip: React_2.ForwardRefExoticComponent<TooltipProps & R
1026
1198
  export declare interface TooltipProps extends React_2.HTMLAttributes<HTMLElement>, VariantProps<typeof tooltipVariants> {
1027
1199
  text: string | React_2.ReactNode;
1028
1200
  sideOffset?: number;
1201
+ asTriggerChild?: boolean;
1029
1202
  open?: boolean;
1030
1203
  }
1031
1204