@protonradio/proton-ui 0.2.0 → 0.3.0

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.
@@ -1,13 +1,16 @@
1
1
  import { AriaDialogProps } from 'react-aria';
2
- import type { AriaPopoverProps } from 'react-aria';
2
+ import { AriaPopoverProps } from 'react-aria';
3
3
  import { AriaSelectProps } from 'react-aria';
4
4
  import { AriaTableProps } from 'react-aria';
5
5
  import { ColumnProps } from '@react-stately/table';
6
+ import { default as default_2 } from 'react';
7
+ import { DOMProps } from '@react-types/shared';
8
+ import { ItemProps } from 'react-stately';
6
9
  import { JSX as JSX_2 } from 'react/jsx-runtime';
10
+ import { JSX as JSX_3 } from 'react';
7
11
  import { OverlayTriggerProps } from 'react-stately';
8
12
  import { OverlayTriggerState } from 'react-stately';
9
13
  import { PressEvent } from 'react-aria';
10
- import { default as React_2 } from 'react';
11
14
  import { ReactNode } from 'react';
12
15
  import { Row } from '@react-stately/table';
13
16
  import { Section } from '@react-stately/table';
@@ -17,14 +20,33 @@ 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
 
20
- export declare function Button(props: ButtonProps): JSX_2.Element;
21
-
22
- export declare namespace Button {
23
- var defaultProps: {
24
- variant: string;
25
- };
23
+ export declare interface BadgeProps extends React.HTMLAttributes<HTMLDivElement> {
24
+ /**
25
+ * The badge's visual aesthetic.
26
+ */
27
+ variant?: BadgeVariant;
28
+ /**
29
+ * Should the button be non-interactive?
30
+ */
31
+ isDisabled?: boolean;
32
+ /**
33
+ * The content to display within the badge.
34
+ */
35
+ children: ReactNode;
26
36
  }
27
37
 
38
+ export declare type BadgeVariant = "success" | "warning" | "danger" | "primary" | "secondary" | "light" | "transparent";
39
+
40
+ export declare type BannerVariant = "default" | "success" | "warning" | "danger";
41
+
42
+ export declare const BRAND: {
43
+ PRIMARY: string;
44
+ PRIMARY_LIGHT: string;
45
+ SECONDARY: string;
46
+ };
47
+
48
+ export declare function Button({ variant, ...props }: ButtonProps): JSX_2.Element;
49
+
28
50
  export declare function ButtonGroup(props: ButtonGroupProps): JSX_2.Element;
29
51
 
30
52
  export declare namespace ButtonGroup {
@@ -86,9 +108,17 @@ declare interface ButtonProps {
86
108
  children?: React.ReactNode;
87
109
  }
88
110
 
89
- export declare const Cell: <T>(props: ProtonColumnProps<T>) => JSX_2.Element;
111
+ export declare const Cell: <T>(props: ProtonColumnProps<T>) => JSX.Element;
90
112
 
91
- export declare const Column: <T>(props: ProtonColumnProps<T>) => JSX_2.Element;
113
+ export declare const Column: <T>(props: ProtonColumnProps<T>) => JSX.Element;
114
+
115
+ export declare const DANGER: {
116
+ SUPER_DARK: string;
117
+ DARK: string;
118
+ MEDIUM: string;
119
+ LIGHT: string;
120
+ SUPER_LIGHT: string;
121
+ };
92
122
 
93
123
  /**
94
124
  * Intended use in overlay containers such as modals or popovers.
@@ -104,6 +134,18 @@ export declare const generateThemeCssVariables: (baseColor: RGBArray | null) =>
104
134
 
105
135
  export declare const generateThemedRGBArray: (baseColor: RGBArray | null) => RGBArray;
106
136
 
137
+ export declare const GRAYSCALE: {
138
+ GRAY_SUPER_DARK: string;
139
+ GRAY_DARK: string;
140
+ GRAY_MEDIUM: string;
141
+ GRAY_MEDIUM_LIGHT: string;
142
+ GRAY_LIGHT: string;
143
+ GRAY_LIGHTEST: string;
144
+ GRAY_SUPER_LIGHT: string;
145
+ WHITE: string;
146
+ BORDER: string;
147
+ };
148
+
107
149
  export declare function Icon(props: Omit<IconProps, "svgContent">): JSX_2.Element;
108
150
 
109
151
  declare type IconID = "external-link" | "caret-down";
@@ -136,7 +178,7 @@ declare interface PopoverProps extends Omit<AriaPopoverProps, "popoverRef"> {
136
178
  /**
137
179
  * Content to display within the popover.
138
180
  */
139
- children: React_2.ReactNode;
181
+ children: default_2.ReactNode;
140
182
  /**
141
183
  * The `isOpen` state of the popover and the methods to toggle it.
142
184
  */
@@ -144,7 +186,7 @@ declare interface PopoverProps extends Omit<AriaPopoverProps, "popoverRef"> {
144
186
  /**
145
187
  * Can optionally forward the ref to the popover.
146
188
  */
147
- popoverRef?: React_2.RefObject<HTMLDivElement>;
189
+ popoverRef?: default_2.RefObject<HTMLDivElement>;
148
190
  /**
149
191
  * Whether to show an arrow on the popover.
150
192
  */
@@ -163,7 +205,7 @@ export { Section }
163
205
 
164
206
  export declare const Select: {
165
207
  Menu: typeof SelectMenu;
166
- Option: any;
208
+ Option: <T>(props: ItemProps<T>) => JSX_3.Element;
167
209
  };
168
210
 
169
211
  declare function SelectMenu<T extends object>({ label, name, isDisabled, ...props }: SelectProps<T>): JSX_2.Element;
@@ -173,14 +215,14 @@ declare interface SelectProps<T> extends AriaSelectProps<T> {
173
215
  name: string;
174
216
  }
175
217
 
176
- export declare function Switch(props: SwitchProps): JSX_2.Element;
218
+ export declare const SUCCESS: {
219
+ DARK: string;
220
+ MEDIUM: string;
221
+ LIGHT: string;
222
+ SUPER_LIGHT: string;
223
+ };
177
224
 
178
- export declare namespace Switch {
179
- var defaultProps: {
180
- defaultOn: boolean;
181
- isDisabled: boolean;
182
- };
183
- }
225
+ export declare function Switch(props: SwitchProps): JSX_2.Element;
184
226
 
185
227
  declare interface SwitchProps {
186
228
  /**
@@ -233,7 +275,7 @@ declare interface ThemeContextType {
233
275
  themedRGBArray: RGBArray;
234
276
  }
235
277
 
236
- export declare const ThemeProvider: React_2.FC<ThemeProviderProps>;
278
+ export declare const ThemeProvider: default_2.FC<ThemeProviderProps>;
237
279
 
238
280
  declare interface ThemeProviderProps {
239
281
  theme: Theme;
@@ -247,9 +289,9 @@ export declare const THEMES: {
247
289
  };
248
290
 
249
291
  export declare interface ThemeVariables {
250
- "--proton-control-background": string;
251
- "--proton-text-color": string;
252
- "--proton-control-border": string;
292
+ "--proton-control__background-color": string;
293
+ "--proton-control__text-color": string;
294
+ "--proton-control__border-color": string;
253
295
  }
254
296
 
255
297
  export declare function Tooltip({ children, arrow, ...props }: TooltipProps): JSX_2.Element;
@@ -280,12 +322,25 @@ declare interface TooltipTriggerProps extends TooltipProps, TooltipTriggerCompon
280
322
  * and popover trigger. For examples see Popover.stories.tsx.
281
323
  */
282
324
  export declare function usePopoverTrigger(props?: OverlayTriggerProps): {
283
- buttonProps: any;
284
- overlayProps: any;
285
- buttonRef: React_2.MutableRefObject<HTMLButtonElement>;
286
- state: any;
325
+ buttonProps: default_2.ButtonHTMLAttributes<HTMLButtonElement>;
326
+ overlayProps: DOMProps;
327
+ buttonRef: default_2.MutableRefObject<HTMLButtonElement>;
328
+ state: OverlayTriggerState;
287
329
  };
288
330
 
289
331
  export declare const useTheme: () => ThemeContextType;
290
332
 
333
+ export declare const WARNING: {
334
+ DARK: string;
335
+ MEDIUM: string;
336
+ LIGHT: string;
337
+ SUPER_LIGHT: string;
338
+ };
339
+
291
340
  export { }
341
+
342
+
343
+ declare namespace ButtonGroup {
344
+ var Option: (props: ButtonGroupOptionProps) => import("react/jsx-runtime").JSX.Element;
345
+ }
346
+