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