@protonradio/proton-ui 0.5.3 → 0.6.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.
- package/dist/proton-ui.es.d.ts +97 -5
- package/dist/proton-ui.es.js +2797 -2640
- package/dist/proton-ui.es.js.map +1 -1
- package/dist/proton-ui.umd.js +8 -8
- package/dist/proton-ui.umd.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/proton-ui.es.d.ts
CHANGED
|
@@ -20,6 +20,14 @@ 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
|
+
/**
|
|
24
|
+
* Converts an RGB array to a CSS string representation.
|
|
25
|
+
* @param rgb - The RGB array to convert.
|
|
26
|
+
* @param opacity - Optional opacity value.
|
|
27
|
+
* @returns A CSS string representation of the RGB array, using `rgb()`, or `rgba()` if an opacity value is provided.
|
|
28
|
+
*/
|
|
29
|
+
export declare const arrayToRgbString: (rgb: RGBArray, opacity?: number) => string;
|
|
30
|
+
|
|
23
31
|
export declare const Badge: ({ variant, children, ...props }: BadgeProps) => JSX_2.Element;
|
|
24
32
|
|
|
25
33
|
export declare interface BadgeProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
@@ -111,7 +119,11 @@ export declare const BRAND: {
|
|
|
111
119
|
SECONDARY: string;
|
|
112
120
|
};
|
|
113
121
|
|
|
114
|
-
|
|
122
|
+
/**
|
|
123
|
+
* A customizable button component that can render as either a button or anchor element
|
|
124
|
+
* @interface ButtonProps
|
|
125
|
+
*/
|
|
126
|
+
export declare function Button({ variant, href, onPress, type, isDisabled, "data-testid": testId, children, }: ButtonProps): JSX_2.Element;
|
|
115
127
|
|
|
116
128
|
export declare function ButtonGroup(props: ButtonGroupProps): JSX_2.Element;
|
|
117
129
|
|
|
@@ -151,9 +163,6 @@ declare interface ButtonGroupProps {
|
|
|
151
163
|
children?: React.ReactNode;
|
|
152
164
|
}
|
|
153
165
|
|
|
154
|
-
/** Properties for the Button component
|
|
155
|
-
* @interface ButtonProps
|
|
156
|
-
*/
|
|
157
166
|
declare interface ButtonProps {
|
|
158
167
|
/** The button's visual aesthetic
|
|
159
168
|
* @param {ButtonVariant} variant
|
|
@@ -178,7 +187,7 @@ declare interface ButtonProps {
|
|
|
178
187
|
/** The test ID for the button
|
|
179
188
|
* @param {string} dataTestId
|
|
180
189
|
*/
|
|
181
|
-
|
|
190
|
+
"data-testid"?: string;
|
|
182
191
|
/** The content to display within the button
|
|
183
192
|
* @param {React.ReactNode} children
|
|
184
193
|
*/
|
|
@@ -191,6 +200,8 @@ export declare const Cell: <T>(props: ProtonColumnProps<T>) => JSX.Element;
|
|
|
191
200
|
|
|
192
201
|
export declare const Column: <T>(props: ProtonColumnProps<T>) => JSX.Element;
|
|
193
202
|
|
|
203
|
+
export declare function csx(...classnames: unknown[]): string;
|
|
204
|
+
|
|
194
205
|
export declare const DANGER: {
|
|
195
206
|
SUPER_DARK: string;
|
|
196
207
|
DARK: string;
|
|
@@ -225,6 +236,19 @@ export declare const GRAYSCALE: {
|
|
|
225
236
|
BORDER: string;
|
|
226
237
|
};
|
|
227
238
|
|
|
239
|
+
/**
|
|
240
|
+
* Handles internal navigation clicks by preventing default browser behavior and
|
|
241
|
+
* programmatically updating the URL and history state.
|
|
242
|
+
*
|
|
243
|
+
* @param e - The click event from the anchor element
|
|
244
|
+
* @param to - The destination path to navigate to
|
|
245
|
+
*
|
|
246
|
+
* @remarks
|
|
247
|
+
* - Converts relative paths to absolute by prepending "/" if needed
|
|
248
|
+
* - Updates browser history using pushState and dispatches a popstate event
|
|
249
|
+
*/
|
|
250
|
+
export declare const handleInternalNavigation: (e: React.MouseEvent<HTMLAnchorElement>, to: string) => void;
|
|
251
|
+
|
|
228
252
|
export declare function Icon(props: Omit<IconProps, "svgContent">): JSX_2.Element;
|
|
229
253
|
|
|
230
254
|
declare type IconID = "external-link" | "caret-down";
|
|
@@ -244,6 +268,19 @@ declare interface IconProps {
|
|
|
244
268
|
color?: string;
|
|
245
269
|
}
|
|
246
270
|
|
|
271
|
+
/**
|
|
272
|
+
* [isUrlExternal] - determine if passed absolute url is external to the current domain.
|
|
273
|
+
*/
|
|
274
|
+
export declare const isUrlExternal: (url: any) => boolean;
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* Lightens an RGB color by a specified factor.
|
|
278
|
+
* @param rgb - The RGB color array to lighten.
|
|
279
|
+
* @param factor - The factor between 0 (darker) - 1 (lighter) by which to transform the color.
|
|
280
|
+
* @returns The lightened RGB color array, RGB values are clamped to 42 (dark) - 179 (light).
|
|
281
|
+
*/
|
|
282
|
+
export declare const lightenRGBColor: (rgb: RGBArray, factor: number) => RGBArray;
|
|
283
|
+
|
|
247
284
|
export declare function Popover({ children, state, arrow, offset, ...props }: PopoverProps): JSX_2.Element;
|
|
248
285
|
|
|
249
286
|
/**
|
|
@@ -437,6 +474,61 @@ export declare const WARNING: {
|
|
|
437
474
|
SUPER_LIGHT: string;
|
|
438
475
|
};
|
|
439
476
|
|
|
477
|
+
/**
|
|
478
|
+
* A waveform visualization component that displays audio data with interactive features.
|
|
479
|
+
*
|
|
480
|
+
* @component
|
|
481
|
+
* @interface WaveformProps
|
|
482
|
+
*
|
|
483
|
+
* @returns {JSX.Element} A waveform visualization with optional timestamps and interactive features
|
|
484
|
+
*/
|
|
485
|
+
export declare function Waveform({ data: waveformData, resolution, startDuration, endDuration, currentTime, showTimestamps, totalDuration, onClick, timestampColor: timestampColorProp, "data-testid": testId, }: WaveformProps): JSX_2.Element;
|
|
486
|
+
|
|
487
|
+
declare interface WaveformProps {
|
|
488
|
+
/**
|
|
489
|
+
* Array of normalized amplitude values (0-1) representing the waveform.
|
|
490
|
+
* If not provided, uses a sample sine wave.
|
|
491
|
+
*/
|
|
492
|
+
data?: number[];
|
|
493
|
+
/**
|
|
494
|
+
* Total duration of the audio in seconds.
|
|
495
|
+
*/
|
|
496
|
+
totalDuration: number;
|
|
497
|
+
/**
|
|
498
|
+
* Current playback position in seconds.
|
|
499
|
+
*/
|
|
500
|
+
currentTime?: number;
|
|
501
|
+
/**
|
|
502
|
+
* Width in pixels of each waveform bar.
|
|
503
|
+
*/
|
|
504
|
+
resolution?: number;
|
|
505
|
+
/**
|
|
506
|
+
* Start time to display from in seconds.
|
|
507
|
+
*/
|
|
508
|
+
startDuration?: number;
|
|
509
|
+
/**
|
|
510
|
+
* End time to display until in seconds.
|
|
511
|
+
*/
|
|
512
|
+
endDuration?: number;
|
|
513
|
+
/**
|
|
514
|
+
* Whether to show timestamp markers.
|
|
515
|
+
*/
|
|
516
|
+
showTimestamps?: boolean;
|
|
517
|
+
/**
|
|
518
|
+
* Click handler that receives the clicked position (0-1) and event.
|
|
519
|
+
*/
|
|
520
|
+
onClick?: (position: number, e: React.MouseEvent<HTMLDivElement>) => void;
|
|
521
|
+
/**
|
|
522
|
+
* Custom color for timestamp text backgrounds.
|
|
523
|
+
* Will use theme color by default.
|
|
524
|
+
*/
|
|
525
|
+
timestampColor?: string;
|
|
526
|
+
/**
|
|
527
|
+
* Test ID for testing purposes.
|
|
528
|
+
*/
|
|
529
|
+
"data-testid"?: string;
|
|
530
|
+
}
|
|
531
|
+
|
|
440
532
|
export { }
|
|
441
533
|
|
|
442
534
|
|