@protonradio/proton-ui 0.10.13-beta.6 → 0.10.13
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.cjs.js +1 -1
- package/dist/constants.es.js +1 -1
- package/dist/index.cjs.js +13 -12
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +38 -21
- package/dist/index.es.js +3966 -3673
- package/dist/index.es.js.map +1 -1
- package/dist/{palettes-z3K7XIpT.mjs → palettes-BDp2VnQU.mjs} +2 -2
- package/dist/palettes-BDp2VnQU.mjs.map +1 -0
- package/dist/palettes-BZQ9UVED.js +2 -0
- package/dist/palettes-BZQ9UVED.js.map +1 -0
- package/dist/style.css +1 -1
- package/dist/utils-DdC7qBKJ.js +2 -0
- package/dist/utils-DdC7qBKJ.js.map +1 -0
- package/dist/{utils-vY_RWAmK.mjs → utils-OggAvvvN.mjs} +135 -149
- package/dist/utils-OggAvvvN.mjs.map +1 -0
- package/dist/utils.cjs.js +1 -1
- package/dist/utils.d.ts +8 -4
- package/dist/utils.es.js +5 -4
- package/package.json +1 -1
- package/dist/palettes-DUXikaiS.js +0 -2
- package/dist/palettes-DUXikaiS.js.map +0 -1
- package/dist/palettes-z3K7XIpT.mjs.map +0 -1
- package/dist/utils-C9pal-xj.js +0 -2
- package/dist/utils-C9pal-xj.js.map +0 -1
- package/dist/utils-vY_RWAmK.mjs.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
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';
|
|
4
5
|
import { ColumnProps } from '@react-stately/table';
|
|
5
6
|
import { default as default_2 } from 'react';
|
|
6
7
|
import { DOMProps } from '@react-types/shared';
|
|
7
8
|
import { ForwardRefExoticComponent } from 'react';
|
|
9
|
+
import { ItemProps } from 'react-stately';
|
|
8
10
|
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
11
|
+
import { JSX as JSX_3 } from 'react';
|
|
9
12
|
import { OverlayTriggerProps } from 'react-stately';
|
|
10
13
|
import { OverlayTriggerState } from 'react-stately';
|
|
11
14
|
import { PressEvent } from 'react-aria';
|
|
@@ -182,7 +185,7 @@ declare interface BaseInputProps {
|
|
|
182
185
|
name: string;
|
|
183
186
|
/**
|
|
184
187
|
* The placeholder text to display when the input is empty.
|
|
185
|
-
* @note
|
|
188
|
+
* @note Placeholder takes precedence over label, if both are provided.
|
|
186
189
|
* @external https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/placeholder
|
|
187
190
|
*/
|
|
188
191
|
placeholder?: string;
|
|
@@ -332,7 +335,7 @@ declare interface DialogProps extends AriaDialogProps {
|
|
|
332
335
|
*
|
|
333
336
|
* @interface ElevationProps
|
|
334
337
|
*/
|
|
335
|
-
export declare const Elevation: ({ children, hasPrimaryGradient, "data-testid": dataTestId, }: ElevationProps) => JSX_2.Element;
|
|
338
|
+
export declare const Elevation: ({ children, hasPrimaryGradient, backgroundGradientDirection, "data-testid": dataTestId, }: ElevationProps) => JSX_2.Element;
|
|
336
339
|
|
|
337
340
|
declare interface ElevationProps {
|
|
338
341
|
/**
|
|
@@ -345,6 +348,10 @@ declare interface ElevationProps {
|
|
|
345
348
|
* @default false
|
|
346
349
|
*/
|
|
347
350
|
hasPrimaryGradient?: boolean;
|
|
351
|
+
/**
|
|
352
|
+
* The direction of the background gradient.
|
|
353
|
+
*/
|
|
354
|
+
backgroundGradientDirection?: "left" | "right";
|
|
348
355
|
/**
|
|
349
356
|
* The data-testid attribute for testing purposes.
|
|
350
357
|
*/
|
|
@@ -401,8 +408,6 @@ declare interface ImageBackgroundProps {
|
|
|
401
408
|
*/
|
|
402
409
|
export declare const Input: default_2.ForwardRefExoticComponent<BaseInputProps & default_2.RefAttributes<HTMLInputElement>>;
|
|
403
410
|
|
|
404
|
-
export declare function MenuTrigger({ renderTrigger, menuId, size, actions, disabled, onClose, testId: triggerTestId, menuTestId, }: ResponsiveMenuProps): JSX_2.Element;
|
|
405
|
-
|
|
406
411
|
export declare const Modal: (({ isOpen, onClose, title, subtitle, body, children, isOverlay, "data-testid": dataTestId, }: ModalProps) => JSX_2.Element) & {
|
|
407
412
|
Title: ({ children }: {
|
|
408
413
|
children: React.ReactNode;
|
|
@@ -564,6 +569,20 @@ declare interface ResponsiveMenuProps {
|
|
|
564
569
|
menuTestId?: string;
|
|
565
570
|
}
|
|
566
571
|
|
|
572
|
+
export declare function ResponsiveMenuTrigger({ renderTrigger, menuId, size, actions, disabled, onClose, testId: triggerTestId, menuTestId, }: ResponsiveMenuProps): JSX_2.Element;
|
|
573
|
+
|
|
574
|
+
export declare const ResponsiveSelect: {
|
|
575
|
+
Menu: typeof ResponsiveSelectMenu;
|
|
576
|
+
Option: <T>(props: ItemProps<T>) => JSX_3.Element;
|
|
577
|
+
};
|
|
578
|
+
|
|
579
|
+
/**
|
|
580
|
+
* A dropdown select menu that opens a Popover, or an ActionMenu on mobile.
|
|
581
|
+
* Supports controlled and uncontrolled modes.
|
|
582
|
+
* @interface SelectProps
|
|
583
|
+
*/
|
|
584
|
+
declare function ResponsiveSelectMenu<T extends object>({ label, name, isDisabled, disabledKeys, selectedKey, onSelectionChange, onOpen, onClose, items, "data-testid": testId, children, }: SelectProps<T>): JSX_2.Element;
|
|
585
|
+
|
|
567
586
|
export declare const Row: <T = object>(props: ProtonRowProps<T>) => JSX.Element;
|
|
568
587
|
|
|
569
588
|
/**
|
|
@@ -613,23 +632,19 @@ export { Section }
|
|
|
613
632
|
|
|
614
633
|
export declare const Select: {
|
|
615
634
|
Menu: typeof SelectMenu;
|
|
635
|
+
Option: <T>(props: ItemProps<T>) => JSX_3.Element;
|
|
616
636
|
};
|
|
617
637
|
|
|
618
|
-
declare interface SelectItem {
|
|
619
|
-
key: string;
|
|
620
|
-
label: string;
|
|
621
|
-
to?: string;
|
|
622
|
-
onAction?: (key: string) => void;
|
|
623
|
-
}
|
|
624
|
-
|
|
625
638
|
/**
|
|
626
|
-
* A dropdown select menu that opens a popover
|
|
627
|
-
*
|
|
639
|
+
* A dropdown select menu that opens a popover. Supports controlled and uncontrolled modes.
|
|
640
|
+
* @interface SelectProps
|
|
628
641
|
*/
|
|
629
|
-
declare function SelectMenu({ label, name, isDisabled, disabledKeys, selectedKey, onSelectionChange, onOpen, onClose, items, "data-testid": testId, }: SelectProps): JSX_2.Element;
|
|
642
|
+
declare function SelectMenu<T extends object>({ label, name, isDisabled, disabledKeys, selectedKey, onSelectionChange, onOpen, onClose, items, "data-testid": testId, children, }: SelectProps<T>): JSX_2.Element;
|
|
630
643
|
|
|
631
|
-
declare interface SelectProps {
|
|
632
|
-
/** The name of the select field
|
|
644
|
+
declare interface SelectProps<T> {
|
|
645
|
+
/** The name of the select field
|
|
646
|
+
* @external https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#name
|
|
647
|
+
*/
|
|
633
648
|
name: string;
|
|
634
649
|
/** Label to display above the select
|
|
635
650
|
* @external https://developer.mozilla.org/en-US/docs/Web/HTML/Element/label#text
|
|
@@ -640,21 +655,23 @@ declare interface SelectProps {
|
|
|
640
655
|
/** Array of keys that should be disabled
|
|
641
656
|
* @example ["Thing 1", "Thing 2"]
|
|
642
657
|
*/
|
|
643
|
-
disabledKeys?: string[];
|
|
658
|
+
disabledKeys?: (string | number)[];
|
|
644
659
|
/** Currently selected key */
|
|
645
|
-
selectedKey?: string;
|
|
660
|
+
selectedKey?: string | number;
|
|
646
661
|
/** Callback fired when selection changes */
|
|
647
|
-
onSelectionChange?: (key: string) => void;
|
|
662
|
+
onSelectionChange?: (key: string | number) => void;
|
|
648
663
|
/** Callback fired when the menu opens */
|
|
649
664
|
onOpen?: () => void;
|
|
650
665
|
/** Callback fired when the menu closes */
|
|
651
666
|
onClose?: () => void;
|
|
652
667
|
/** Array of items to display
|
|
653
|
-
* @example [{
|
|
668
|
+
* @example [{ name: "thing 1", label: "Thing 1" }, { name: "thing 2", label: "Thing 2" }]
|
|
654
669
|
*/
|
|
655
|
-
items
|
|
670
|
+
items?: T[];
|
|
656
671
|
/** Test ID for the select */
|
|
657
672
|
"data-testid"?: string;
|
|
673
|
+
/** Children elements or render function */
|
|
674
|
+
children: CollectionChildren<T>;
|
|
658
675
|
}
|
|
659
676
|
|
|
660
677
|
export declare function Switch(props: SwitchProps): JSX_2.Element;
|