@protonradio/proton-ui 0.6.17 → 0.6.18-beta.10
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/colors-BdogYmJi.js +2 -0
- package/dist/colors-BdogYmJi.js.map +1 -0
- package/dist/colors-Dwh4VIMR.mjs +47 -0
- package/dist/colors-Dwh4VIMR.mjs.map +1 -0
- package/dist/constants.cjs.js +1 -1
- package/dist/constants.cjs.js.map +1 -1
- package/dist/constants.d.ts +1 -0
- package/dist/constants.es.js +37 -4
- package/dist/constants.es.js.map +1 -1
- package/dist/index.cjs.js +26 -11
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +72 -7
- package/dist/index.es.js +3268 -9935
- package/dist/index.es.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/utils-Cs9qWW9j.js +2 -0
- package/dist/utils-Cs9qWW9j.js.map +1 -0
- package/dist/utils-D71CUDBU.mjs +115 -0
- package/dist/utils-D71CUDBU.mjs.map +1 -0
- package/dist/utils.cjs.js +1 -1
- package/dist/utils.cjs.js.map +1 -1
- package/dist/utils.d.ts +72 -10
- package/dist/utils.es.js +10 -32
- package/dist/utils.es.js.map +1 -1
- package/package.json +2 -1
- package/dist/index-BCAZu2vD.mjs +0 -80
- package/dist/index-BCAZu2vD.mjs.map +0 -1
- package/dist/index-Dcfu6hWE.js +0 -2
- package/dist/index-Dcfu6hWE.js.map +0 -1
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,7 @@ declare interface DialogProps extends AriaDialogProps {
|
|
|
315
316
|
children: React.ReactNode;
|
|
316
317
|
}
|
|
317
318
|
|
|
318
|
-
declare function generateThemeCssVariables(
|
|
319
|
+
declare function generateThemeCssVariables(palette: Palette): Record<Theme, ThemeVariables>;
|
|
319
320
|
|
|
320
321
|
declare const GRAYSCALE: {
|
|
321
322
|
GRAY_SUPER_DARK: string;
|
|
@@ -353,6 +354,32 @@ declare interface IconProps {
|
|
|
353
354
|
*/
|
|
354
355
|
export declare const Input: default_2.ForwardRefExoticComponent<BaseInputProps & default_2.RefAttributes<HTMLInputElement>>;
|
|
355
356
|
|
|
357
|
+
declare type Palette = {
|
|
358
|
+
BRAND: {
|
|
359
|
+
PRIMARY: string;
|
|
360
|
+
PRIMARY_LIGHT: string;
|
|
361
|
+
SECONDARY: string;
|
|
362
|
+
};
|
|
363
|
+
PRIMARY: {
|
|
364
|
+
PRIMARY_SUPER_DARK: string;
|
|
365
|
+
PRIMARY_DARK: string;
|
|
366
|
+
PRIMARY_MEDIUM: string;
|
|
367
|
+
PRIMARY_MEDIUM_LIGHT: string;
|
|
368
|
+
PRIMARY_LIGHT: string;
|
|
369
|
+
PRIMARY_LIGHTEST: string;
|
|
370
|
+
PRIMARY_SUPER_LIGHT: string;
|
|
371
|
+
};
|
|
372
|
+
SECONDARY: {
|
|
373
|
+
SECONDARY_SUPER_DARK: string;
|
|
374
|
+
SECONDARY_DARK: string;
|
|
375
|
+
SECONDARY_MEDIUM: string;
|
|
376
|
+
SECONDARY_MEDIUM_LIGHT: string;
|
|
377
|
+
SECONDARY_LIGHT: string;
|
|
378
|
+
SECONDARY_LIGHTEST: string;
|
|
379
|
+
SECONDARY_SUPER_LIGHT: string;
|
|
380
|
+
};
|
|
381
|
+
};
|
|
382
|
+
|
|
356
383
|
/**
|
|
357
384
|
* Popover is an unstyled popover component that handles positioning. It should be used
|
|
358
385
|
* with the Dialog component to provide a styled popover.
|
|
@@ -387,6 +414,27 @@ export declare interface ProtonColumnProps<T> extends ColumnProps<T> {
|
|
|
387
414
|
align?: "left" | "center" | "right";
|
|
388
415
|
}
|
|
389
416
|
|
|
417
|
+
declare interface ResponsiveMenuProps {
|
|
418
|
+
/** The id of the menu */
|
|
419
|
+
menuId?: string;
|
|
420
|
+
/** Custom trigger component. If not provided, defaults to ellipsis icon */
|
|
421
|
+
renderTrigger?: (triggerProps: TriggerProps, isOpen: boolean) => ReactNode;
|
|
422
|
+
/** Size of the trigger icon */
|
|
423
|
+
size?: number;
|
|
424
|
+
/** Array of menu actions/items to display */
|
|
425
|
+
actions: ActionMenuAction[];
|
|
426
|
+
/** Whether the menu is disabled */
|
|
427
|
+
disabled?: boolean;
|
|
428
|
+
/** Callback when menu closes */
|
|
429
|
+
onClose?: () => void;
|
|
430
|
+
/** Test ID for the trigger component */
|
|
431
|
+
testId?: string;
|
|
432
|
+
/** Test ID for the menu */
|
|
433
|
+
menuTestId?: string;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
export declare function ResponsiveMenuTrigger({ renderTrigger, menuId, size, actions, disabled, onClose, testId: triggerTestId, menuTestId, }: ResponsiveMenuProps): JSX_2.Element;
|
|
437
|
+
|
|
390
438
|
export declare const ResponsiveSelect: {
|
|
391
439
|
Menu: typeof ResponsiveSelectMenu;
|
|
392
440
|
Option: <T>(props: ItemProps<T>) => JSX_3.Element;
|
|
@@ -399,8 +447,6 @@ export declare const ResponsiveSelect: {
|
|
|
399
447
|
*/
|
|
400
448
|
declare function ResponsiveSelectMenu<T extends object>({ label, name, isDisabled, disabledKeys, selectedKey, onSelectionChange, onOpen, onClose, items, "data-testid": testId, children, }: SelectProps<T>): JSX_2.Element;
|
|
401
449
|
|
|
402
|
-
declare type RGBArray = [number, number, number];
|
|
403
|
-
|
|
404
450
|
export { Row }
|
|
405
451
|
|
|
406
452
|
/**
|
|
@@ -543,8 +589,7 @@ declare interface ThemeContextType {
|
|
|
543
589
|
theme: Theme;
|
|
544
590
|
className: string;
|
|
545
591
|
style: ReturnType<typeof generateThemeCssVariables>[Theme];
|
|
546
|
-
|
|
547
|
-
themedRGBArray: RGBArray;
|
|
592
|
+
palette: Palette;
|
|
548
593
|
}
|
|
549
594
|
|
|
550
595
|
export declare const ThemeProvider: default_2.FC<ThemeProviderProps>;
|
|
@@ -552,11 +597,12 @@ export declare const ThemeProvider: default_2.FC<ThemeProviderProps>;
|
|
|
552
597
|
declare interface ThemeProviderProps {
|
|
553
598
|
theme: Theme;
|
|
554
599
|
children: ReactNode;
|
|
555
|
-
|
|
600
|
+
palette: Palette;
|
|
556
601
|
}
|
|
557
602
|
|
|
558
603
|
export declare const THEMES: {
|
|
559
604
|
readonly DARK: "dark";
|
|
605
|
+
readonly CUSTOM_DARK: "custom-dark";
|
|
560
606
|
readonly LIGHT: "light";
|
|
561
607
|
};
|
|
562
608
|
|
|
@@ -564,6 +610,10 @@ declare interface ThemeVariables {
|
|
|
564
610
|
"--proton-control__background-color": string;
|
|
565
611
|
"--proton-control__text-color": string;
|
|
566
612
|
"--proton-control__border-color": string;
|
|
613
|
+
"--proton-control__shadow-color": string;
|
|
614
|
+
"--proton-color__primary": string;
|
|
615
|
+
"--proton-color__primary-light": string;
|
|
616
|
+
"--proton-color__secondary": string;
|
|
567
617
|
}
|
|
568
618
|
|
|
569
619
|
export declare function Tooltip({ children, arrow, ...props }: TooltipProps): JSX_2.Element;
|
|
@@ -589,6 +639,21 @@ export declare interface TooltipTriggerProps extends TooltipProps, TooltipTrigge
|
|
|
589
639
|
disableTriggerClick?: boolean;
|
|
590
640
|
}
|
|
591
641
|
|
|
642
|
+
/**
|
|
643
|
+
* A component that displays either a popover menu or an action menu
|
|
644
|
+
* depending on the screen size when the menu trigger is pressed.
|
|
645
|
+
*
|
|
646
|
+
* @param {ResponsiveMenuProps} props - The props for the ResponsiveMenuTrigger component.
|
|
647
|
+
* @returns {JSX.Element} - The ResponsiveMenuTrigger component.
|
|
648
|
+
*/
|
|
649
|
+
declare interface TriggerProps {
|
|
650
|
+
"data-testid"?: string;
|
|
651
|
+
disabled?: boolean;
|
|
652
|
+
ref?: React.RefObject<HTMLButtonElement>;
|
|
653
|
+
onClick?: () => void;
|
|
654
|
+
"aria-label": string;
|
|
655
|
+
}
|
|
656
|
+
|
|
592
657
|
/**
|
|
593
658
|
* Hook for creating a popover trigger. This hook manages the state and events for the popover
|
|
594
659
|
* and popover trigger. For examples see Popover.stories.tsx.
|