@protonradio/proton-ui 0.10.13-beta.3 → 0.10.13-beta.6

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.d.ts CHANGED
@@ -1,14 +1,11 @@
1
1
  import { AriaDialogProps } from 'react-aria';
2
2
  import { AriaPopoverProps } from 'react-aria';
3
3
  import { AriaTableProps } from 'react-aria';
4
- import { CollectionChildren } from '@react-types/shared';
5
4
  import { ColumnProps } from '@react-stately/table';
6
5
  import { default as default_2 } from 'react';
7
6
  import { DOMProps } from '@react-types/shared';
8
7
  import { ForwardRefExoticComponent } from 'react';
9
- import { ItemProps } from 'react-stately';
10
8
  import { JSX as JSX_2 } from 'react/jsx-runtime';
11
- import { JSX as JSX_3 } from 'react';
12
9
  import { OverlayTriggerProps } from 'react-stately';
13
10
  import { OverlayTriggerState } from 'react-stately';
14
11
  import { PressEvent } from 'react-aria';
@@ -404,6 +401,8 @@ declare interface ImageBackgroundProps {
404
401
  */
405
402
  export declare const Input: default_2.ForwardRefExoticComponent<BaseInputProps & default_2.RefAttributes<HTMLInputElement>>;
406
403
 
404
+ export declare function MenuTrigger({ renderTrigger, menuId, size, actions, disabled, onClose, testId: triggerTestId, menuTestId, }: ResponsiveMenuProps): JSX_2.Element;
405
+
407
406
  export declare const Modal: (({ isOpen, onClose, title, subtitle, body, children, isOverlay, "data-testid": dataTestId, }: ModalProps) => JSX_2.Element) & {
408
407
  Title: ({ children }: {
409
408
  children: React.ReactNode;
@@ -565,20 +564,6 @@ declare interface ResponsiveMenuProps {
565
564
  menuTestId?: string;
566
565
  }
567
566
 
568
- export declare function ResponsiveMenuTrigger({ renderTrigger, menuId, size, actions, disabled, onClose, testId: triggerTestId, menuTestId, }: ResponsiveMenuProps): JSX_2.Element;
569
-
570
- export declare const ResponsiveSelect: {
571
- Menu: typeof ResponsiveSelectMenu;
572
- Option: <T>(props: ItemProps<T>) => JSX_3.Element;
573
- };
574
-
575
- /**
576
- * A dropdown select menu that opens a Popover, or an ActionMenu on mobile.
577
- * Supports controlled and uncontrolled modes.
578
- * @interface SelectProps
579
- */
580
- declare function ResponsiveSelectMenu({ label, name, isDisabled, disabledKeys, selectedKey, onSelectionChange, onOpen, onClose, items, "data-testid": testId, children, }: SelectProps<ActionMenuAction>): JSX_2.Element;
581
-
582
567
  export declare const Row: <T = object>(props: ProtonRowProps<T>) => JSX.Element;
583
568
 
584
569
  /**
@@ -628,19 +613,23 @@ export { Section }
628
613
 
629
614
  export declare const Select: {
630
615
  Menu: typeof SelectMenu;
631
- Option: <T>(props: ItemProps<T>) => JSX_3.Element;
632
616
  };
633
617
 
618
+ declare interface SelectItem {
619
+ key: string;
620
+ label: string;
621
+ to?: string;
622
+ onAction?: (key: string) => void;
623
+ }
624
+
634
625
  /**
635
- * A dropdown select menu that opens a popover. Supports controlled and uncontrolled modes.
636
- * @interface SelectProps
626
+ * A dropdown select menu that opens a popover on desktop and an action menu on mobile.
627
+ * Supports controlled and uncontrolled modes.
637
628
  */
638
- declare function SelectMenu<T extends object>({ label, name, isDisabled, disabledKeys, selectedKey, onSelectionChange, onOpen, onClose, items, "data-testid": testId, children, }: SelectProps<T>): JSX_2.Element;
629
+ declare function SelectMenu({ label, name, isDisabled, disabledKeys, selectedKey, onSelectionChange, onOpen, onClose, items, "data-testid": testId, }: SelectProps): JSX_2.Element;
639
630
 
640
- declare interface SelectProps<T> {
641
- /** The name of the select field
642
- * @external https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#name
643
- */
631
+ declare interface SelectProps {
632
+ /** The name of the select field */
644
633
  name: string;
645
634
  /** Label to display above the select
646
635
  * @external https://developer.mozilla.org/en-US/docs/Web/HTML/Element/label#text
@@ -651,23 +640,21 @@ declare interface SelectProps<T> {
651
640
  /** Array of keys that should be disabled
652
641
  * @example ["Thing 1", "Thing 2"]
653
642
  */
654
- disabledKeys?: (string | number)[];
643
+ disabledKeys?: string[];
655
644
  /** Currently selected key */
656
- selectedKey?: string | number;
645
+ selectedKey?: string;
657
646
  /** Callback fired when selection changes */
658
- onSelectionChange?: (key: string | number) => void;
647
+ onSelectionChange?: (key: string) => void;
659
648
  /** Callback fired when the menu opens */
660
649
  onOpen?: () => void;
661
650
  /** Callback fired when the menu closes */
662
651
  onClose?: () => void;
663
652
  /** Array of items to display
664
- * @example [{ name: "thing 1", label: "Thing 1" }, { name: "thing 2", label: "Thing 2" }]
653
+ * @example [{ key: "thing-1", label: "Thing 1" }, { key: "thing-2", label: "Thing 2" }]
665
654
  */
666
- items?: T[];
655
+ items: SelectItem[];
667
656
  /** Test ID for the select */
668
657
  "data-testid"?: string;
669
- /** Children elements or render function */
670
- children: CollectionChildren<T>;
671
658
  }
672
659
 
673
660
  export declare function Switch(props: SwitchProps): JSX_2.Element;