lucent-ui 0.18.1 → 0.19.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/index.cjs +95 -38
- package/dist/index.d.ts +55 -0
- package/dist/index.js +2150 -1617
- package/dist-server/src/components/molecules/Toast/Toast.manifest.js +233 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -582,6 +582,8 @@ export declare interface DesignPreset {
|
|
|
582
582
|
shadow: ShadowPreset;
|
|
583
583
|
}
|
|
584
584
|
|
|
585
|
+
declare type DismissFn = (id: string) => void;
|
|
586
|
+
|
|
585
587
|
export declare function Divider({ orientation, label, spacing, style }: DividerProps): JSX_2.Element;
|
|
586
588
|
|
|
587
589
|
export declare const DividerManifest: ComponentManifest;
|
|
@@ -1392,6 +1394,57 @@ export declare interface TimelineProps {
|
|
|
1392
1394
|
style?: CSSProperties;
|
|
1393
1395
|
}
|
|
1394
1396
|
|
|
1397
|
+
export declare interface ToastAction {
|
|
1398
|
+
label: string;
|
|
1399
|
+
onClick: () => void;
|
|
1400
|
+
/** Render as an underlined link or a bordered button. Default `'button'`. */
|
|
1401
|
+
style?: ToastActionStyle;
|
|
1402
|
+
}
|
|
1403
|
+
|
|
1404
|
+
export declare type ToastActionStyle = 'link' | 'button';
|
|
1405
|
+
|
|
1406
|
+
declare interface ToastContextValue {
|
|
1407
|
+
toast: ToastFn;
|
|
1408
|
+
dismiss: DismissFn;
|
|
1409
|
+
}
|
|
1410
|
+
|
|
1411
|
+
declare type ToastFn = (options: ToastOptions) => string;
|
|
1412
|
+
|
|
1413
|
+
export declare const ToastManifest: ComponentManifest;
|
|
1414
|
+
|
|
1415
|
+
export declare interface ToastOptions {
|
|
1416
|
+
/** Primary message line. */
|
|
1417
|
+
title: string;
|
|
1418
|
+
/** Optional secondary description (supports multi-line). */
|
|
1419
|
+
description?: string;
|
|
1420
|
+
/** Visual variant — drives icon, border color, and tint. */
|
|
1421
|
+
variant?: ToastVariant;
|
|
1422
|
+
/** Auto-dismiss duration in ms. Pass `Infinity` to disable. Default 5000. */
|
|
1423
|
+
duration?: number;
|
|
1424
|
+
/** Action button or link rendered inline. */
|
|
1425
|
+
action?: ToastAction;
|
|
1426
|
+
/** Optional custom icon. */
|
|
1427
|
+
icon?: ReactNode;
|
|
1428
|
+
}
|
|
1429
|
+
|
|
1430
|
+
export declare type ToastPosition = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
|
|
1431
|
+
|
|
1432
|
+
export declare function ToastProvider({ children, position, duration: defaultDuration, max, portalContainer, }: ToastProviderProps): JSX_2.Element;
|
|
1433
|
+
|
|
1434
|
+
export declare interface ToastProviderProps {
|
|
1435
|
+
children: ReactNode;
|
|
1436
|
+
/** Default position for all toasts. Default `'bottom-right'`. */
|
|
1437
|
+
position?: ToastPosition;
|
|
1438
|
+
/** Default auto-dismiss duration in ms. Default `5000`. */
|
|
1439
|
+
duration?: number;
|
|
1440
|
+
/** Max visible toasts at once. Default `5`. */
|
|
1441
|
+
max?: number;
|
|
1442
|
+
/** Portal container element. Default `document.body`. */
|
|
1443
|
+
portalContainer?: HTMLElement;
|
|
1444
|
+
}
|
|
1445
|
+
|
|
1446
|
+
export declare type ToastVariant = 'default' | 'success' | 'warning' | 'danger' | 'info';
|
|
1447
|
+
|
|
1395
1448
|
export declare function Toggle({ label, size, checked, defaultChecked, contained, helperText, align, disabled, id, onChange, style, ...rest }: ToggleProps): JSX_2.Element;
|
|
1396
1449
|
|
|
1397
1450
|
export declare const ToggleManifest: ComponentManifest;
|
|
@@ -1471,6 +1524,8 @@ export declare interface UsageExample {
|
|
|
1471
1524
|
*/
|
|
1472
1525
|
export declare function useLucent(): LucentContextValue;
|
|
1473
1526
|
|
|
1527
|
+
export declare function useToast(): ToastContextValue;
|
|
1528
|
+
|
|
1474
1529
|
/**
|
|
1475
1530
|
* Validates a ComponentManifest object at runtime.
|
|
1476
1531
|
* Returns a result object — does not throw.
|