@protonradio/proton-ui 0.6.3 → 0.6.4
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/constants.d.ts +5 -0
- package/dist/index.cjs.js +10 -10
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +108 -4
- package/dist/index.es.js +2986 -2833
- package/dist/index.es.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/utils.d.ts +5 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AriaDialogProps } from 'react-aria';
|
|
2
2
|
import { AriaPopoverProps } from 'react-aria';
|
|
3
|
-
import { AriaSelectProps } from 'react-aria';
|
|
4
3
|
import { AriaTableProps } from 'react-aria';
|
|
4
|
+
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';
|
|
@@ -20,6 +20,61 @@ import { TableStateProps } from 'react-stately';
|
|
|
20
20
|
import { TooltipProps as TooltipProps_2 } from 'react-aria-components';
|
|
21
21
|
import { TooltipTriggerComponentProps } from 'react-aria-components';
|
|
22
22
|
|
|
23
|
+
export declare function ActionMenu({ children, closeOnNavigation, isDisabled, showCancel, isOpen, close, "data-testId": testId, }: ActionMenuProps): JSX_2.Element;
|
|
24
|
+
|
|
25
|
+
export declare namespace ActionMenu {
|
|
26
|
+
var Item: ({ name, to }: ActionMenuItemProps) => JSX_2.Element;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
declare interface ActionMenuItemProps {
|
|
30
|
+
name: string | ReactNode;
|
|
31
|
+
to?: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* @interface ActionMenuProps
|
|
36
|
+
* @description Props interface for the ActionMenu component
|
|
37
|
+
*/
|
|
38
|
+
declare interface ActionMenuProps extends ActionMenuToggleState {
|
|
39
|
+
/**
|
|
40
|
+
* @param {ReactNode | function} children - Content to be rendered inside the menu, can be components or render function
|
|
41
|
+
*/
|
|
42
|
+
children?: ReactNode | ((props: {
|
|
43
|
+
close: () => void;
|
|
44
|
+
}) => ReactNode);
|
|
45
|
+
/**
|
|
46
|
+
* @param {boolean} isDisabled - Prevents the menu from closing
|
|
47
|
+
*/
|
|
48
|
+
isDisabled?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* @param {boolean} showCancel - Shows the cancel button
|
|
51
|
+
*/
|
|
52
|
+
showCancel?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* @param {string} data-testId - Test ID for the menu container
|
|
55
|
+
*/
|
|
56
|
+
"data-testId"?: string;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* @interface ActionMenuToggleState
|
|
61
|
+
* @description State interface for controlling the ActionMenu's open/close behavior
|
|
62
|
+
*/
|
|
63
|
+
declare interface ActionMenuToggleState {
|
|
64
|
+
/**
|
|
65
|
+
* @param {boolean} isOpen - Controls whether the menu is displayed
|
|
66
|
+
*/
|
|
67
|
+
isOpen: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* @param {() => void} close - Closes the menu
|
|
70
|
+
*/
|
|
71
|
+
close: () => void;
|
|
72
|
+
/**
|
|
73
|
+
* @param {boolean} closeOnNavigation - Automatically closes when route changes
|
|
74
|
+
*/
|
|
75
|
+
closeOnNavigation?: boolean;
|
|
76
|
+
}
|
|
77
|
+
|
|
23
78
|
export declare const Badge: ({ variant, children, ...props }: BadgeProps) => JSX_2.Element;
|
|
24
79
|
|
|
25
80
|
export declare interface BadgeProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
@@ -296,11 +351,55 @@ export declare const Select: {
|
|
|
296
351
|
Option: <T>(props: ItemProps<T>) => JSX_3.Element;
|
|
297
352
|
};
|
|
298
353
|
|
|
299
|
-
|
|
354
|
+
/**
|
|
355
|
+
* A Dropdown select menu that opens a Popover, or an ActionMenu on mobile.
|
|
356
|
+
* Supports controlled and uncontrolled modes, and urlSearchParam syncing.
|
|
357
|
+
* @interface SelectProps
|
|
358
|
+
*/
|
|
359
|
+
declare function SelectMenu<T extends object>({ label, name, isDisabled, disabledKeys, selectedKey, onSelectionChange, items, "data-testid": testId, children, }: SelectProps<T>): JSX_2.Element;
|
|
300
360
|
|
|
301
|
-
declare interface SelectProps<T>
|
|
302
|
-
|
|
361
|
+
declare interface SelectProps<T> {
|
|
362
|
+
/** The name of the select field
|
|
363
|
+
* @external https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#name
|
|
364
|
+
* @prop {string} name
|
|
365
|
+
*/
|
|
303
366
|
name: string;
|
|
367
|
+
/** Label to display above the select
|
|
368
|
+
* @external https://developer.mozilla.org/en-US/docs/Web/HTML/Element/label#text
|
|
369
|
+
* @prop {string} label
|
|
370
|
+
*/
|
|
371
|
+
label?: string;
|
|
372
|
+
/** Whether the select is disabled
|
|
373
|
+
* @prop {boolean} isDisabled
|
|
374
|
+
*/
|
|
375
|
+
isDisabled?: boolean;
|
|
376
|
+
/** Array of keys that should be disabled
|
|
377
|
+
* @example ["Thing 1", "Thing 2"]
|
|
378
|
+
* @prop {string[] | number[]} disabledKeys
|
|
379
|
+
*/
|
|
380
|
+
disabledKeys?: (string | number)[];
|
|
381
|
+
/** Currently selected key
|
|
382
|
+
* @prop {string | number} selectedKey
|
|
383
|
+
*/
|
|
384
|
+
selectedKey?: string | number;
|
|
385
|
+
/** Callback fired when selection changes
|
|
386
|
+
* @prop {(key: string | number) => void} onSelectionChange
|
|
387
|
+
*/
|
|
388
|
+
onSelectionChange?: (key: string | number) => void;
|
|
389
|
+
/** Array of items to display
|
|
390
|
+
* @example [{ name: "thing 1", label: "Thing 1" }, { name: "thing 2", label: "Thing 2" }]
|
|
391
|
+
* @prop {object[]} items
|
|
392
|
+
*/
|
|
393
|
+
items?: T[];
|
|
394
|
+
/**
|
|
395
|
+
* Test ID for the select
|
|
396
|
+
* @prop {string} data-testid
|
|
397
|
+
*/
|
|
398
|
+
"data-testid"?: string;
|
|
399
|
+
/** Children elements or render function
|
|
400
|
+
* @prop {CollectionChildren<T>} children
|
|
401
|
+
*/
|
|
402
|
+
children: CollectionChildren<T>;
|
|
304
403
|
}
|
|
305
404
|
|
|
306
405
|
declare const SUCCESS: {
|
|
@@ -502,3 +601,8 @@ export { }
|
|
|
502
601
|
declare namespace ButtonGroup {
|
|
503
602
|
var Option: (props: ButtonGroupOptionProps) => import("react/jsx-runtime").JSX.Element;
|
|
504
603
|
}
|
|
604
|
+
|
|
605
|
+
|
|
606
|
+
declare namespace ActionMenu {
|
|
607
|
+
var Item: ({ name, to }: ActionMenuItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
608
|
+
}
|