@protonradio/proton-ui 0.6.16 → 0.6.18-beta.1

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
@@ -26,7 +26,7 @@ import { TooltipTriggerComponentProps } from 'react-aria-components';
26
26
  * Renders a list of actions as a focusable menu, or non-focusable children.
27
27
  * @interface ActionMenuProps
28
28
  */
29
- export declare const ActionMenu: ({ isOpen, selectionMode, selectedKeys, disabledKeys, children, showCancel, actions, closeOnNavigation, onSelectionChange, onClose, "data-testid": testId, }: ActionMenuProps) => JSX_2.Element;
29
+ export declare const ActionMenu: ({ id, isOpen, selectionMode, selectedKeys, disabledKeys, children, showCancel, actions, closeOnNavigation, onSelectionChange, onClose, "data-testid": testId, }: ActionMenuProps) => JSX_2.Element;
30
30
 
31
31
  declare interface ActionMenuAction {
32
32
  key: string;
@@ -46,6 +46,7 @@ declare interface ActionMenuProps {
46
46
  showCancel?: boolean;
47
47
  closeOnNavigation?: boolean;
48
48
  actions?: ActionMenuAction[];
49
+ id?: string;
49
50
  onClose?: () => void;
50
51
  onSelectionChange?: (keys: Selection_2) => void;
51
52
  "data-testid"?: string;
@@ -315,7 +316,9 @@ declare interface DialogProps extends AriaDialogProps {
315
316
  children: React.ReactNode;
316
317
  }
317
318
 
318
- declare function generateThemeCssVariables(baseColor: RGBArray | null): Record<Theme, ThemeVariables>;
319
+ export declare const generatePalette: (primaryColor: RGBArray, adjustForLuminance?: boolean) => Palette;
320
+
321
+ declare function generateThemeCssVariables(palette: Palette): Record<Theme, ThemeVariables>;
319
322
 
320
323
  declare const GRAYSCALE: {
321
324
  GRAY_SUPER_DARK: string;
@@ -353,6 +356,32 @@ declare interface IconProps {
353
356
  */
354
357
  export declare const Input: default_2.ForwardRefExoticComponent<BaseInputProps & default_2.RefAttributes<HTMLInputElement>>;
355
358
 
359
+ declare type Palette = {
360
+ BRAND: {
361
+ PRIMARY: string;
362
+ PRIMARY_LIGHT: string;
363
+ SECONDARY: string;
364
+ };
365
+ PRIMARY: {
366
+ PRIMARY_SUPER_DARK: string;
367
+ PRIMARY_DARK: string;
368
+ PRIMARY_MEDIUM: string;
369
+ PRIMARY_MEDIUM_LIGHT: string;
370
+ PRIMARY_LIGHT: string;
371
+ PRIMARY_LIGHTEST: string;
372
+ PRIMARY_SUPER_LIGHT: string;
373
+ };
374
+ SECONDARY: {
375
+ SECONDARY_SUPER_DARK: string;
376
+ SECONDARY_DARK: string;
377
+ SECONDARY_MEDIUM: string;
378
+ SECONDARY_MEDIUM_LIGHT: string;
379
+ SECONDARY_LIGHT: string;
380
+ SECONDARY_LIGHTEST: string;
381
+ SECONDARY_SUPER_LIGHT: string;
382
+ };
383
+ };
384
+
356
385
  /**
357
386
  * Popover is an unstyled popover component that handles positioning. It should be used
358
387
  * with the Dialog component to provide a styled popover.
@@ -387,6 +416,27 @@ export declare interface ProtonColumnProps<T> extends ColumnProps<T> {
387
416
  align?: "left" | "center" | "right";
388
417
  }
389
418
 
419
+ declare interface ResponsiveMenuProps {
420
+ /** The id of the menu */
421
+ menuId?: string;
422
+ /** Custom trigger component. If not provided, defaults to ellipsis icon */
423
+ renderTrigger?: (triggerProps: TriggerProps, isOpen: boolean) => ReactNode;
424
+ /** Size of the trigger icon */
425
+ size?: number;
426
+ /** Array of menu actions/items to display */
427
+ actions: ActionMenuAction[];
428
+ /** Whether the menu is disabled */
429
+ disabled?: boolean;
430
+ /** Callback when menu closes */
431
+ onClose?: () => void;
432
+ /** Test ID for the trigger component */
433
+ testId?: string;
434
+ /** Test ID for the menu */
435
+ menuTestId?: string;
436
+ }
437
+
438
+ export declare function ResponsiveMenuTrigger({ renderTrigger, menuId, size, actions, disabled, onClose, testId: triggerTestId, menuTestId, }: ResponsiveMenuProps): JSX_2.Element;
439
+
390
440
  export declare const ResponsiveSelect: {
391
441
  Menu: typeof ResponsiveSelectMenu;
392
442
  Option: <T>(props: ItemProps<T>) => JSX_3.Element;
@@ -543,8 +593,7 @@ declare interface ThemeContextType {
543
593
  theme: Theme;
544
594
  className: string;
545
595
  style: ReturnType<typeof generateThemeCssVariables>[Theme];
546
- baseColor: RGBArray;
547
- themedRGBArray: RGBArray;
596
+ palette: Palette;
548
597
  }
549
598
 
550
599
  export declare const ThemeProvider: default_2.FC<ThemeProviderProps>;
@@ -552,11 +601,12 @@ export declare const ThemeProvider: default_2.FC<ThemeProviderProps>;
552
601
  declare interface ThemeProviderProps {
553
602
  theme: Theme;
554
603
  children: ReactNode;
555
- baseColor?: RGBArray;
604
+ palette: Palette;
556
605
  }
557
606
 
558
607
  export declare const THEMES: {
559
608
  readonly DARK: "dark";
609
+ readonly CUSTOM_DARK: "custom-dark";
560
610
  readonly LIGHT: "light";
561
611
  };
562
612
 
@@ -564,6 +614,10 @@ declare interface ThemeVariables {
564
614
  "--proton-control__background-color": string;
565
615
  "--proton-control__text-color": string;
566
616
  "--proton-control__border-color": string;
617
+ "--proton-control__shadow-color": string;
618
+ "--proton-color__primary": string;
619
+ "--proton-color__primary-light": string;
620
+ "--proton-color__secondary": string;
567
621
  }
568
622
 
569
623
  export declare function Tooltip({ children, arrow, ...props }: TooltipProps): JSX_2.Element;
@@ -589,6 +643,23 @@ export declare interface TooltipTriggerProps extends TooltipProps, TooltipTrigge
589
643
  disableTriggerClick?: boolean;
590
644
  }
591
645
 
646
+ /**
647
+ * A component that displays either a popover menu or an action menu
648
+ * depending on the screen size when the menu trigger is pressed.
649
+ *
650
+ * @param {ResponsiveMenuProps} props - The props for the ResponsiveMenuTrigger component.
651
+ * @returns {JSX.Element} - The ResponsiveMenuTrigger component.
652
+ */
653
+ declare interface TriggerProps {
654
+ "data-testid"?: string;
655
+ disabled?: boolean;
656
+ ref?: React.RefObject<HTMLButtonElement>;
657
+ onClick?: () => void;
658
+ "aria-label": string;
659
+ }
660
+
661
+ export declare const usePalette: (backgroundImage: string | null) => Palette;
662
+
592
663
  /**
593
664
  * Hook for creating a popover trigger. This hook manages the state and events for the popover
594
665
  * and popover trigger. For examples see Popover.stories.tsx.