@protonradio/proton-ui 0.2.1-beta1 → 0.3.1

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.
@@ -4,7 +4,10 @@ import { AriaSelectProps } from 'react-aria';
4
4
  import { AriaTableProps } from 'react-aria';
5
5
  import { ColumnProps } from '@react-stately/table';
6
6
  import { default as default_2 } from 'react';
7
+ import { DOMProps } from '@react-types/shared';
8
+ import { ItemProps } from 'react-stately';
7
9
  import { JSX as JSX_2 } from 'react/jsx-runtime';
10
+ import { JSX as JSX_3 } from 'react';
8
11
  import { OverlayTriggerProps } from 'react-stately';
9
12
  import { OverlayTriggerState } from 'react-stately';
10
13
  import { PressEvent } from 'react-aria';
@@ -17,9 +20,65 @@ import { TableStateProps } from 'react-stately';
17
20
  import { TooltipProps as TooltipProps_2 } from 'react-aria-components';
18
21
  import { TooltipTriggerComponentProps } from 'react-aria-components';
19
22
 
23
+ export declare const Badge: ({ variant, children, ...props }: BadgeProps) => JSX_2.Element;
24
+
25
+ export declare interface BadgeProps extends React.HTMLAttributes<HTMLDivElement> {
26
+ /**
27
+ * The badge's visual aesthetic.
28
+ */
29
+ variant?: BadgeVariant;
30
+ /**
31
+ * The content to display within the badge.
32
+ */
33
+ children: ReactNode;
34
+ }
35
+
20
36
  export declare type BadgeVariant = "success" | "warning" | "danger" | "primary" | "secondary" | "dark" | "transparent";
21
37
 
22
- export declare type BannerVariant = "gray" | "success" | "warning" | "danger";
38
+ export declare const BadgeVariants: {
39
+ readonly SUCCESS: "success";
40
+ readonly WARNING: "warning";
41
+ readonly DANGER: "danger";
42
+ readonly PRIMARY: "primary";
43
+ readonly SECONDARY: "secondary";
44
+ readonly DARK: "dark";
45
+ readonly TRANSPARENT: "transparent";
46
+ };
47
+
48
+ export declare const Banner: {
49
+ ({ variant, icon, children, ...props }: BannerProps): JSX_2.Element;
50
+ Title: ({ children, ...props }: BannerProps) => JSX_2.Element;
51
+ Content: ({ children, ...props }: BannerProps) => JSX_2.Element;
52
+ Colors: Record<BannerVariant, {
53
+ BACKGROUND: string;
54
+ TITLE: string;
55
+ CONTENT: string;
56
+ ICON: string;
57
+ }>;
58
+ };
59
+
60
+ declare interface BannerProps extends React.HTMLAttributes<HTMLDivElement> {
61
+ /**
62
+ * The banners visual aesthetic.
63
+ */
64
+ variant?: BannerVariant;
65
+ /**
66
+ * The icon to display in the banner.
67
+ */
68
+ icon?: ReactNode;
69
+ /**
70
+ * The content to display within the banner.
71
+ */
72
+ children: ReactNode;
73
+ }
74
+
75
+ declare type BannerVariant = "default" | "success" | "warning" | "danger";
76
+
77
+ export declare const BRAND: {
78
+ PRIMARY: string;
79
+ PRIMARY_LIGHT: string;
80
+ SECONDARY: string;
81
+ };
23
82
 
24
83
  export declare function Button({ variant, ...props }: ButtonProps): JSX_2.Element;
25
84
 
@@ -88,6 +147,14 @@ export declare const Cell: <T>(props: ProtonColumnProps<T>) => JSX.Element;
88
147
 
89
148
  export declare const Column: <T>(props: ProtonColumnProps<T>) => JSX.Element;
90
149
 
150
+ export declare const DANGER: {
151
+ SUPER_DARK: string;
152
+ DARK: string;
153
+ MEDIUM: string;
154
+ LIGHT: string;
155
+ SUPER_LIGHT: string;
156
+ };
157
+
91
158
  /**
92
159
  * Intended use in overlay containers such as modals or popovers.
93
160
  */
@@ -102,6 +169,18 @@ export declare const generateThemeCssVariables: (baseColor: RGBArray | null) =>
102
169
 
103
170
  export declare const generateThemedRGBArray: (baseColor: RGBArray | null) => RGBArray;
104
171
 
172
+ export declare const GRAYSCALE: {
173
+ GRAY_SUPER_DARK: string;
174
+ GRAY_DARK: string;
175
+ GRAY_MEDIUM: string;
176
+ GRAY_MEDIUM_LIGHT: string;
177
+ GRAY_LIGHT: string;
178
+ GRAY_LIGHTEST: string;
179
+ GRAY_SUPER_LIGHT: string;
180
+ WHITE: string;
181
+ BORDER: string;
182
+ };
183
+
105
184
  export declare function Icon(props: Omit<IconProps, "svgContent">): JSX_2.Element;
106
185
 
107
186
  declare type IconID = "external-link" | "caret-down";
@@ -149,44 +228,6 @@ declare interface PopoverProps extends Omit<AriaPopoverProps, "popoverRef"> {
149
228
  arrow?: boolean;
150
229
  }
151
230
 
152
- export declare const PROTON_COLORS: {
153
- BRAND: {
154
- PRIMARY: string;
155
- PRIMARY_LIGHT: string;
156
- SECONDARY: string;
157
- };
158
- GRAYSCALE: {
159
- GRAY_SUPER_DARK: string;
160
- GRAY_DARK: string;
161
- GRAY_MEDIUM: string;
162
- GRAY_MEDIUM_LIGHT: string;
163
- GRAY_LIGHT: string;
164
- GRAY_LIGHTEST: string;
165
- GRAY_SUPER_LIGHT: string;
166
- WHITE: string;
167
- BORDER: string;
168
- };
169
- DANGER: {
170
- SUPER_DARK: string;
171
- DARK: string;
172
- MEDIUM: string;
173
- LIGHT: string;
174
- SUPER_LIGHT: string;
175
- };
176
- WARNING: {
177
- DARK: string;
178
- MEDIUM: string;
179
- LIGHT: string;
180
- SUPER_LIGHT: string;
181
- };
182
- SUCCESS: {
183
- DARK: string;
184
- MEDIUM: string;
185
- LIGHT: string;
186
- SUPER_LIGHT: string;
187
- };
188
- };
189
-
190
231
  export declare interface ProtonColumnProps<T> extends ColumnProps<T> {
191
232
  align?: "left" | "center" | "right";
192
233
  }
@@ -199,7 +240,7 @@ export { Section }
199
240
 
200
241
  export declare const Select: {
201
242
  Menu: typeof SelectMenu;
202
- Option: any;
243
+ Option: <T>(props: ItemProps<T>) => JSX_3.Element;
203
244
  };
204
245
 
205
246
  declare function SelectMenu<T extends object>({ label, name, isDisabled, ...props }: SelectProps<T>): JSX_2.Element;
@@ -209,6 +250,13 @@ declare interface SelectProps<T> extends AriaSelectProps<T> {
209
250
  name: string;
210
251
  }
211
252
 
253
+ export declare const SUCCESS: {
254
+ DARK: string;
255
+ MEDIUM: string;
256
+ LIGHT: string;
257
+ SUPER_LIGHT: string;
258
+ };
259
+
212
260
  export declare function Switch(props: SwitchProps): JSX_2.Element;
213
261
 
214
262
  declare interface SwitchProps {
@@ -309,14 +357,21 @@ declare interface TooltipTriggerProps extends TooltipProps, TooltipTriggerCompon
309
357
  * and popover trigger. For examples see Popover.stories.tsx.
310
358
  */
311
359
  export declare function usePopoverTrigger(props?: OverlayTriggerProps): {
312
- buttonProps: any;
313
- overlayProps: any;
360
+ buttonProps: default_2.ButtonHTMLAttributes<HTMLButtonElement>;
361
+ overlayProps: DOMProps;
314
362
  buttonRef: default_2.MutableRefObject<HTMLButtonElement>;
315
- state: any;
363
+ state: OverlayTriggerState;
316
364
  };
317
365
 
318
366
  export declare const useTheme: () => ThemeContextType;
319
367
 
368
+ export declare const WARNING: {
369
+ DARK: string;
370
+ MEDIUM: string;
371
+ LIGHT: string;
372
+ SUPER_LIGHT: string;
373
+ };
374
+
320
375
  export { }
321
376
 
322
377