@protonradio/proton-ui 0.10.1 → 0.10.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.
package/dist/index.d.ts CHANGED
@@ -5,6 +5,7 @@ import { CollectionChildren } from '@react-types/shared';
5
5
  import { ColumnProps } from '@react-stately/table';
6
6
  import { default as default_2 } from 'react';
7
7
  import { DOMProps } from '@react-types/shared';
8
+ import { ForwardRefExoticComponent } from 'react';
8
9
  import { ItemProps } from 'react-stately';
9
10
  import { JSX as JSX_2 } from 'react/jsx-runtime';
10
11
  import { JSX as JSX_3 } from 'react';
@@ -12,6 +13,7 @@ import { OverlayTriggerProps } from 'react-stately';
12
13
  import { OverlayTriggerState } from 'react-stately';
13
14
  import { PressEvent } from 'react-aria';
14
15
  import { ReactNode } from 'react';
16
+ import { RefAttributes } from 'react';
15
17
  import { RowProps } from '@react-stately/table';
16
18
  import { Section } from '@react-stately/table';
17
19
  import { Selection as Selection_2 } from 'react-stately';
@@ -26,7 +28,7 @@ import { TooltipTriggerComponentProps } from 'react-aria-components';
26
28
  * Renders a list of actions as a focusable menu, or non-focusable children.
27
29
  * @interface ActionMenuProps
28
30
  */
29
- export declare const ActionMenu: ({ isOpen, selectionMode, selectedKeys, disabledKeys, children, showCancel, actions, closeOnNavigation, onSelectionChange, onClose, "data-testid": testId, }: ActionMenuProps) => JSX_2.Element;
31
+ export declare const ActionMenu: ({ isOpen, selectionMode, selectedKeys, disabledKeys, children, beforeActions, afterActions, showCancel, cancelButtonText, actions, closeOnNavigation, onSelectionChange, onClose, "data-testid": testId, }: ActionMenuProps) => JSX_2.Element;
30
32
 
31
33
  declare interface ActionMenuAction {
32
34
  key: string;
@@ -43,7 +45,14 @@ declare interface ActionMenuProps {
43
45
  children?: ReactNode | ((props: {
44
46
  close: () => void;
45
47
  }) => ReactNode);
48
+ beforeActions?: ReactNode | ((props: {
49
+ close: () => void;
50
+ }) => ReactNode);
51
+ afterActions?: ReactNode | ((props: {
52
+ close: () => void;
53
+ }) => ReactNode);
46
54
  showCancel?: boolean;
55
+ cancelButtonText?: string;
47
56
  closeOnNavigation?: boolean;
48
57
  actions?: ActionMenuAction[];
49
58
  id?: string;
@@ -199,12 +208,6 @@ declare interface BaseInputProps {
199
208
  value?: string;
200
209
  }
201
210
 
202
- declare const BRAND: {
203
- PRIMARY: string;
204
- PRIMARY_LIGHT: string;
205
- SECONDARY: string;
206
- };
207
-
208
211
  /**
209
212
  * A customizable button component that can render as either a button or anchor element
210
213
  * @interface ButtonProps
@@ -288,51 +291,8 @@ export declare type ButtonVariant = "primary" | "secondary" | "success" | "dange
288
291
 
289
292
  export declare const Cell: <T>(props: ProtonColumnProps<T>) => JSX.Element;
290
293
 
291
- export declare namespace COLORS {
292
- export {
293
- BRAND,
294
- GRAYSCALE,
295
- SECONDARY,
296
- DANGER,
297
- WARNING,
298
- SUCCESS,
299
- DARK_GRAYSCALE,
300
- DARK_SECONDARY
301
- }
302
- }
303
-
304
294
  export declare const Column: <T>(props: ProtonColumnProps<T>) => JSX.Element;
305
295
 
306
- declare const DANGER: {
307
- SUPER_DARK: string;
308
- DARK: string;
309
- MEDIUM: string;
310
- LIGHT: string;
311
- SUPER_LIGHT: string;
312
- };
313
-
314
- declare const DARK_GRAYSCALE: {
315
- GRAY_SUPER_DARK: string;
316
- GRAY_DARK: string;
317
- GRAY_MEDIUM: string;
318
- GRAY_MEDIUM_LIGHT: string;
319
- GRAY_LIGHT: string;
320
- GRAY_LIGHTEST: string;
321
- GRAY_SUPER_LIGHT: string;
322
- WHITE: string;
323
- BORDER: string;
324
- };
325
-
326
- declare const DARK_SECONDARY: {
327
- SECONDARY_SUPER_DARK: string;
328
- SECONDARY_DARK: string;
329
- SECONDARY_MEDIUM: string;
330
- SECONDARY_MEDIUM_LIGHT: string;
331
- SECONDARY_LIGHT: string;
332
- SECONDARY_LIGHTEST: string;
333
- SECONDARY_SUPER_LIGHT: string;
334
- };
335
-
336
296
  /**
337
297
  * Intended use in overlay containers such as modals or popovers.
338
298
  */
@@ -343,18 +303,6 @@ declare interface DialogProps extends AriaDialogProps {
343
303
  children: React.ReactNode;
344
304
  }
345
305
 
346
- declare const GRAYSCALE: {
347
- GRAY_SUPER_DARK: string;
348
- GRAY_DARK: string;
349
- GRAY_MEDIUM: string;
350
- GRAY_MEDIUM_LIGHT: string;
351
- GRAY_LIGHT: string;
352
- GRAY_LIGHTEST: string;
353
- GRAY_SUPER_LIGHT: string;
354
- WHITE: string;
355
- BORDER: string;
356
- };
357
-
358
306
  export declare function Icon(props: Omit<IconProps, "svgContent">): JSX_2.Element;
359
307
 
360
308
  declare type IconID = "external-link" | "caret-down";
@@ -405,6 +353,54 @@ declare interface ImageBackgroundProps {
405
353
  */
406
354
  export declare const Input: default_2.ForwardRefExoticComponent<BaseInputProps & default_2.RefAttributes<HTMLInputElement>>;
407
355
 
356
+ export declare const Modal: (({ isOpen, onClose, title, subtitle, body, children, isOverlay, }: ModalProps) => JSX_2.Element) & {
357
+ Title: ({ children }: {
358
+ children: React.ReactNode;
359
+ }) => JSX_2.Element;
360
+ Subtitle: ({ children }: {
361
+ children: React.ReactNode;
362
+ }) => JSX_2.Element;
363
+ Body: ({ children }: {
364
+ children: React.ReactNode;
365
+ }) => JSX_2.Element;
366
+ Action: (props: ButtonProps) => JSX_2.Element;
367
+ Actions: ({ children }: {
368
+ children: React.ReactNode;
369
+ }) => JSX_2.Element;
370
+ };
371
+
372
+ declare interface ModalProps {
373
+ /**
374
+ * Controls the visibility of the modal
375
+ * */
376
+ isOpen: boolean;
377
+ /**
378
+ * Callback function when modal is closed
379
+ * */
380
+ onClose: () => void;
381
+ /**
382
+ * Whether to show the modal with an overlay background.
383
+ * @default true
384
+ * */
385
+ isOverlay?: boolean;
386
+ /**
387
+ * Optional title text for the modal header
388
+ * */
389
+ title?: string;
390
+ /**
391
+ * Optional subtitle text below the modal title
392
+ * */
393
+ subtitle?: string;
394
+ /**
395
+ * Optional body text content for the modal
396
+ * */
397
+ body?: string;
398
+ /**
399
+ * Content to render inside the modal
400
+ * */
401
+ children: React.ReactNode;
402
+ }
403
+
408
404
  declare type Palette = {
409
405
  BASE_COLOR: string;
410
406
  BRAND: {
@@ -534,21 +530,21 @@ export declare const Row: <T = object>(props: ProtonRowProps<T>) => JSX.Element;
534
530
  * Base Overlay component for creating modal-like backgrounds.
535
531
  * @interface ScreenOverlayProps
536
532
  */
537
- export declare function ScreenOverlay({ fadeIn, fadeOut, onClose, children, }: ScreenOverlayProps): JSX_2.Element;
533
+ export declare const ScreenOverlay: ForwardRefExoticComponent<Omit<ScreenOverlayProps, "ref"> & RefAttributes<HTMLDivElement>>;
538
534
 
539
535
  declare interface ScreenOverlayProps {
540
536
  /**
541
537
  * Whether to fade in the overlay.
542
538
  */
543
539
  fadeIn?: boolean;
544
- /**
545
- * Whether to fade out the overlay. Fade out triggers on click.
546
- */
547
- fadeOut?: boolean;
548
540
  /**
549
541
  * Callback function to handle events (click or ESC key).
550
542
  */
551
543
  onClose?: () => void;
544
+ /**
545
+ * Ref to the overlay element.
546
+ */
547
+ ref?: React.RefObject<HTMLDivElement>;
552
548
  /**
553
549
  * Children to render inside the overlay.
554
550
  */
@@ -573,17 +569,6 @@ declare interface SearchInputProps extends Omit<BaseInputProps, "prefix" | "suff
573
569
  value?: string;
574
570
  }
575
571
 
576
- declare const SECONDARY: {
577
- SUPER_DARK: string;
578
- DARK: string;
579
- MEDIUM: string;
580
- MEDIUM_LIGHT: string;
581
- LIGHT: string;
582
- LIGHTEST: string;
583
- SUPER_LIGHT: string;
584
- WHITE: string;
585
- };
586
-
587
572
  export { Section }
588
573
 
589
574
  export declare const Select: {
@@ -630,13 +615,6 @@ declare interface SelectProps<T> {
630
615
  children: CollectionChildren<T>;
631
616
  }
632
617
 
633
- declare const SUCCESS: {
634
- DARK: string;
635
- MEDIUM: string;
636
- LIGHT: string;
637
- SUPER_LIGHT: string;
638
- };
639
-
640
618
  export declare function Switch(props: SwitchProps): JSX_2.Element;
641
619
 
642
620
  declare interface SwitchProps {
@@ -758,7 +736,7 @@ declare interface ThemeProviderProps {
758
736
  palette?: Palette;
759
737
  }
760
738
 
761
- export declare const THEMES: {
739
+ declare const THEMES: {
762
740
  readonly DARK: "dark";
763
741
  readonly CUSTOM_DARK: "custom-dark";
764
742
  readonly LIGHT: "light";
@@ -766,6 +744,7 @@ export declare const THEMES: {
766
744
 
767
745
  declare interface ThemeVariables {
768
746
  "--proton-control__background-color": string;
747
+ "--proton-control__background-color-light": string;
769
748
  "--proton-control__text-color": string;
770
749
  "--proton-control__border-color": string;
771
750
  "--proton-control__shadow-color": string;
@@ -869,13 +848,6 @@ export declare function usePopoverTrigger(props?: OverlayTriggerProps): {
869
848
 
870
849
  export declare const useTheme: () => ThemeContextType;
871
850
 
872
- declare const WARNING: {
873
- DARK: string;
874
- MEDIUM: string;
875
- LIGHT: string;
876
- SUPER_LIGHT: string;
877
- };
878
-
879
851
  /**
880
852
  * A waveform visualization component that displays audio data with interactive features.
881
853
  *