@qasa/qds-ui 0.10.0-next.2 → 0.10.0-next.3

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.
@@ -1,6 +1,7 @@
1
1
  export * from './avatar';
2
2
  export * from './button';
3
3
  export * from './divider';
4
+ export * from './dropdown-menu';
4
5
  export * from './heading';
5
6
  export * from './hint-box';
6
7
  export * from './icon';
package/dist/index.d.ts CHANGED
@@ -4,6 +4,7 @@ import { ElementType, ComponentPropsWithoutRef, ReactNode, SVGAttributes, useLay
4
4
  import { Options } from '@emotion/cache';
5
5
  import * as _emotion_react from '@emotion/react';
6
6
  import { CSSObject } from '@emotion/react';
7
+ import * as DropdownPrimitive from '@radix-ui/react-dropdown-menu';
7
8
  import * as _emotion_styled from '@emotion/styled';
8
9
  import { LucideIcon } from 'lucide-react';
9
10
  import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
@@ -2430,6 +2431,122 @@ interface DividerProps extends HTMLQdsProps<'span'>, DividerOptions {
2430
2431
  }
2431
2432
  declare const Divider: react.ForwardRefExoticComponent<DividerProps & react.RefAttributes<HTMLDivElement>>;
2432
2433
 
2434
+ declare type PrimitiveContentProps = DropdownPrimitive.MenuContentProps;
2435
+ interface DropdownMenuContentOptions {
2436
+ /**
2437
+ * Event handler called when focus moves to the trigger after closing.
2438
+ * It can be prevented by calling `event.preventDefault`.
2439
+ */
2440
+ onCloseAutofocus?: PrimitiveContentProps['onCloseAutoFocus'];
2441
+ /**
2442
+ * Event handler called when the escape key is down.
2443
+ * It can be prevented by calling `event.preventDefault`.
2444
+ */
2445
+ onEscapeKeyDown?: PrimitiveContentProps['onEscapeKeyDown'];
2446
+ /**
2447
+ * Event handler called when a pointer event occurs outside the bounds of the component.
2448
+ * It can be prevented by calling `event.preventDefault`.
2449
+ */
2450
+ onPointerDownOutside?: PrimitiveContentProps['onPointerDownOutside'];
2451
+ /**
2452
+ * Event handler called when focus moves outside the bounds of the component.
2453
+ * It can be prevented by calling `event.preventDefault`.
2454
+ */
2455
+ onFocusOutside?: PrimitiveContentProps['onFocusOutside'];
2456
+ /**
2457
+ * Event handler called when an interaction (pointer or focus event) happens outside the bounds of the component.
2458
+ * It can be prevented by calling `event.preventDefault`.
2459
+ */
2460
+ onInteractOutside?: PrimitiveContentProps['onInteractOutside'];
2461
+ /**
2462
+ * The preferred side of the trigger to render against when open.
2463
+ * Will be reversed when collisions occur and `avoidCollisions` is enabled.
2464
+ *
2465
+ * @default "bottom"
2466
+ */
2467
+ side?: PrimitiveContentProps['side'];
2468
+ /**
2469
+ * The distance in pixels from the trigger.
2470
+ *
2471
+ * @default 8
2472
+ */
2473
+ sideOffset?: PrimitiveContentProps['sideOffset'];
2474
+ /**
2475
+ * The preferred alignment against the trigger. May change when collisions occur.
2476
+ *
2477
+ * @default "center"
2478
+ */
2479
+ align?: PrimitiveContentProps['align'];
2480
+ /**
2481
+ * The element used as the collision boundary.
2482
+ * By default this is the viewport, though you can provide additional element(s) to be included in this check.
2483
+ *
2484
+ * @default []
2485
+ */
2486
+ collisionBoundary?: PrimitiveContentProps['collisionBoundary'];
2487
+ /**
2488
+ * Whether to hide the content when the trigger becomes fully occluded.
2489
+ *
2490
+ * @default false
2491
+ */
2492
+ hideWhenDetached?: PrimitiveContentProps['hideWhenDetached'];
2493
+ }
2494
+ interface DropdownMenuContentProps extends HTMLQdsProps<'div'>, DropdownMenuContentOptions {
2495
+ }
2496
+
2497
+ declare type DropdownMenuDividerProps = HTMLQdsProps<'div'>;
2498
+
2499
+ interface DropdownMenuItemOptions {
2500
+ /**
2501
+ * If `true`, the item will be disabled
2502
+ */
2503
+ isDisabled?: boolean;
2504
+ /**
2505
+ * Event handler called when the user selects an item (via mouse or keyboard).
2506
+ * Calling `event.preventDefault` in this handler will prevent the dropdown from closing when selecting that item.
2507
+ */
2508
+ onSelect?: (event: Event) => void;
2509
+ /**
2510
+ * Optional text used for typeahead purposes.
2511
+ * By default the typeahead behavior will use the `.textContent` of the item.
2512
+ * Use this when the content is complex, or you have non-textual content inside.
2513
+ */
2514
+ textValue?: string;
2515
+ /**
2516
+ * Optional icon to display on the left side of the item content.
2517
+ */
2518
+ icon?: ElementType<IconProps>;
2519
+ }
2520
+ interface DropdownMenuItemProps extends Omit<DropdownPrimitive.DropdownMenuItemProps, 'asChild' | keyof DropdownMenuItemOptions>, DropdownMenuItemOptions {
2521
+ }
2522
+
2523
+ declare type DropdownTriggerComponent = ForwardRefComponent<'button'>;
2524
+ declare type DropdownMenuTriggerProps = PropsOf<DropdownTriggerComponent>;
2525
+
2526
+ interface DropdownMenuRootProps {
2527
+ children: ReactNode;
2528
+ /**
2529
+ * If `true` the dropdown menu will be open
2530
+ */
2531
+ isOpen?: boolean;
2532
+ /**
2533
+ * The open state of the submenu when it is initially rendered.
2534
+ * Use when you do not need to control its open state.
2535
+ */
2536
+ defaultOpen?: boolean;
2537
+ /**
2538
+ * Callback invoked open state changes
2539
+ */
2540
+ onOpenChange?: (isOpen: boolean) => void;
2541
+ }
2542
+ declare function DropdownMenuRoot(props: DropdownMenuRootProps): JSX.Element;
2543
+ declare const DropdownMenu: typeof DropdownMenuRoot & {
2544
+ Trigger: ForwardRefComponent<"button", {}>;
2545
+ Content: react.ForwardRefExoticComponent<DropdownMenuContentProps & react.RefAttributes<HTMLDivElement>>;
2546
+ Item: react.ForwardRefExoticComponent<DropdownMenuItemProps & react.RefAttributes<HTMLDivElement>>;
2547
+ Divider: react.ForwardRefExoticComponent<Pick<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof react.HTMLAttributes<HTMLDivElement>> & react.RefAttributes<HTMLDivElement>>;
2548
+ };
2549
+
2433
2550
  declare const getSizeStyles$4: (theme: {
2434
2551
  mediaQueries: {
2435
2552
  readonly smUp: "@media(min-width: 480px)";
@@ -5506,4 +5623,4 @@ declare function useStableId(fixedId?: string | null): string;
5506
5623
  */
5507
5624
  declare const useSafeLayoutEffect: typeof useLayoutEffect;
5508
5625
 
5509
- export { AlertCircleIcon, AlertTriangleIcon, ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpIcon, Avatar, AvatarProps, BellIcon, BellOffIcon, BookmarkIcon, Button, ButtonProps, CalendarIcon, CameraIcon, CheckCircleIcon, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, CreateIconOptions, Divider, DividerProps, ForwardRefComponent, GlobalStyles, GlobeIcon, Heading, HeadingProps, HeartFilledIcon, HeartIcon, HelpCircleIcon, HintBox, HintBoxProps, HintBoxTitleProps, HistoryIcon, HomeIcon, IconButton, IconButtonProps, IconProps, ImageIcon, InputBase, InputBaseOptions, InputBaseProps, IntrinsicElement, Label, LabelProps, Link, LinkProps, ListFilterIcon, ListIcon, LoadingDots, LoadingDotsProps, LogOutIcon, MapIcon, MapPinIcon, MenuIcon, MessageCircleIcon, MinusIcon, MoreHorizontalIcon, MoreVerticalIcon, OwnProps, Paragraph, ParagraphProps, PenIcon, PlusIcon, PropsOf, QdsProvider, RadioCardProps, RadioGroup, RadioGroupLabelProps, RadioGroupProps, SearchIcon, Select, SelectBase, SelectBaseOptions, SelectOptionProps, SelectProps, SettingsIcon, ShareIcon, SlidersIcon, Spacer, SpacerProps, Stack, StackProps, StarFilledIcon, StarIcon, TextField, TextFieldProps, Textarea, TextareaBase, TextareaBaseOptions, TextareaBaseProps, TextareaProps, Theme, ThemeOverrides, TrashIcon, UseBreakpointOptions, UseBreakpointValueProps, UseFormFieldProps, UseImageProps, UserIcon, VariantProps, XCircleIcon, XIcon, createIcon, createLucideIcon, createStyle, createStyleVariants, getFormFieldBaseStyles, overrideTheme, pxToRem, theme, useBreakpoint, useBreakpointValue, useFormField, useImage, useSafeLayoutEffect, useStableId };
5626
+ export { AlertCircleIcon, AlertTriangleIcon, ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpIcon, Avatar, AvatarProps, BellIcon, BellOffIcon, BookmarkIcon, Button, ButtonProps, CalendarIcon, CameraIcon, CheckCircleIcon, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, CreateIconOptions, Divider, DividerProps, DropdownMenu, DropdownMenuContentProps, DropdownMenuDividerProps, DropdownMenuItemProps, DropdownMenuRootProps, DropdownMenuTriggerProps, ForwardRefComponent, GlobalStyles, GlobeIcon, Heading, HeadingProps, HeartFilledIcon, HeartIcon, HelpCircleIcon, HintBox, HintBoxProps, HintBoxTitleProps, HistoryIcon, HomeIcon, IconButton, IconButtonProps, IconProps, ImageIcon, InputBase, InputBaseOptions, InputBaseProps, IntrinsicElement, Label, LabelProps, Link, LinkProps, ListFilterIcon, ListIcon, LoadingDots, LoadingDotsProps, LogOutIcon, MapIcon, MapPinIcon, MenuIcon, MessageCircleIcon, MinusIcon, MoreHorizontalIcon, MoreVerticalIcon, OwnProps, Paragraph, ParagraphProps, PenIcon, PlusIcon, PropsOf, QdsProvider, RadioCardProps, RadioGroup, RadioGroupLabelProps, RadioGroupProps, SearchIcon, Select, SelectBase, SelectBaseOptions, SelectOptionProps, SelectProps, SettingsIcon, ShareIcon, SlidersIcon, Spacer, SpacerProps, Stack, StackProps, StarFilledIcon, StarIcon, TextField, TextFieldProps, Textarea, TextareaBase, TextareaBaseOptions, TextareaBaseProps, TextareaProps, Theme, ThemeOverrides, TrashIcon, UseBreakpointOptions, UseBreakpointValueProps, UseFormFieldProps, UseImageProps, UserIcon, VariantProps, XCircleIcon, XIcon, createIcon, createLucideIcon, createStyle, createStyleVariants, getFormFieldBaseStyles, overrideTheme, pxToRem, theme, useBreakpoint, useBreakpointValue, useFormField, useImage, useSafeLayoutEffect, useStableId };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qasa/qds-ui",
3
- "version": "0.10.0-next.2",
3
+ "version": "0.10.0-next.3",
4
4
  "license": "UNLICENSED",
5
5
  "repository": {
6
6
  "type": "git",