lucent-ui 0.18.0 → 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.d.ts CHANGED
@@ -277,7 +277,7 @@ export declare interface ColorPalette {
277
277
  dark: ThemeAnchors;
278
278
  }
279
279
 
280
- export declare function ColorPicker({ value, onChange, label, size, inline, disabled, presetGroups, id, style, }: ColorPickerProps): JSX_2.Element;
280
+ export declare function ColorPicker({ value, onChange, label, size, inline, disabled, presetGroups, portalContainer, id, style, }: ColorPickerProps): JSX_2.Element;
281
281
 
282
282
  export declare namespace ColorPicker {
283
283
  var displayName: string;
@@ -293,6 +293,8 @@ export declare interface ColorPickerProps {
293
293
  inline?: boolean;
294
294
  disabled?: boolean;
295
295
  presetGroups?: ColorPresetGroup[];
296
+ /** DOM element to portal the popover into. Defaults to document.body. Use this to preserve CSS custom property inheritance for per-section theming. */
297
+ portalContainer?: HTMLElement | null;
296
298
  id?: string;
297
299
  style?: CSSProperties;
298
300
  }
@@ -580,6 +582,8 @@ export declare interface DesignPreset {
580
582
  shadow: ShadowPreset;
581
583
  }
582
584
 
585
+ declare type DismissFn = (id: string) => void;
586
+
583
587
  export declare function Divider({ orientation, label, spacing, style }: DividerProps): JSX_2.Element;
584
588
 
585
589
  export declare const DividerManifest: ComponentManifest;
@@ -772,7 +776,7 @@ export declare function makeLibraryCSS(tokens: LucentTokens, selector?: string):
772
776
 
773
777
  export declare const MANIFEST_SPEC_VERSION = "1.0";
774
778
 
775
- export declare function Menu({ trigger, children, placement, size, open: controlledOpen, onOpenChange, style, }: MenuProps): JSX_2.Element;
779
+ export declare function Menu({ trigger, children, placement, size, open: controlledOpen, onOpenChange, portalContainer, style, }: MenuProps): JSX_2.Element;
776
780
 
777
781
  export declare function MenuGroup({ label, children, style }: MenuGroupProps): JSX_2.Element;
778
782
 
@@ -821,6 +825,8 @@ export declare interface MenuProps {
821
825
  open?: boolean;
822
826
  /** Callback when open state changes. */
823
827
  onOpenChange?: (open: boolean) => void;
828
+ /** DOM element to portal the popover into. Defaults to document.body. Use this to preserve CSS custom property inheritance for per-section theming. */
829
+ portalContainer?: HTMLElement | null;
824
830
  /** Style overrides for the popover panel. */
825
831
  style?: CSSProperties;
826
832
  }
@@ -1388,6 +1394,57 @@ export declare interface TimelineProps {
1388
1394
  style?: CSSProperties;
1389
1395
  }
1390
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
+
1391
1448
  export declare function Toggle({ label, size, checked, defaultChecked, contained, helperText, align, disabled, id, onChange, style, ...rest }: ToggleProps): JSX_2.Element;
1392
1449
 
1393
1450
  export declare const ToggleManifest: ComponentManifest;
@@ -1467,6 +1524,8 @@ export declare interface UsageExample {
1467
1524
  */
1468
1525
  export declare function useLucent(): LucentContextValue;
1469
1526
 
1527
+ export declare function useToast(): ToastContextValue;
1528
+
1470
1529
  /**
1471
1530
  * Validates a ComponentManifest object at runtime.
1472
1531
  * Returns a result object — does not throw.