@redsift/popovers 9.6.0 → 10.0.0-alpha.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/CONTRIBUTING.md CHANGED
@@ -311,7 +311,7 @@ export const StyledBadge = styled.div<StyledBadgeProps>`
311
311
  $color
312
312
  ? css`
313
313
  color: var(--redsift-color-neutral-white);
314
- background-color: var(--redsift-color-${$color}-primary);
314
+ background-color: var(--redsift-color-presentation-color-${$color}-standard);
315
315
  `
316
316
  : ''}
317
317
  `;
@@ -381,7 +381,7 @@ To display a prop table, use the `PropsTable` component as following:
381
381
  To display a demo, first create a demo (a simple `tsx` file) in the demo folder (`apps/website/demo/`) inside a subfolder with the name of the component (i.e. `apps/website/demo/button/coloring` for a coloring demo of the `Button` component). Then use the `DemoBlock` as following:
382
382
 
383
383
  ```ts
384
- <DemoBlock path="button/coloring" />
384
+ <DemoBlock withThemeSwitcher path="button/coloring" />
385
385
  ```
386
386
 
387
387
  To display simple code, use the `CodeBlock` as following:
package/index.d.ts CHANGED
@@ -2,10 +2,10 @@ import * as _floating_ui_react from '@floating-ui/react';
2
2
  export { FloatingPortal, useMergeRefs } from '@floating-ui/react';
3
3
  import React$1, { Dispatch, SetStateAction, ReactNode, ComponentProps } from 'react';
4
4
  import * as _redsift_design_system from '@redsift/design-system';
5
- import { ValueOf, ContainerProps, Comp, HeadingProps, IconProps, StylingProps, SpacingProps, SizingProps, InternalSpacingProps } from '@redsift/design-system';
5
+ import { ValueOf, Theme, ContainerProps, Comp, HeadingProps, IconProps, StylingProps, SpacingProps, SizingProps, InternalSpacingProps } from '@redsift/design-system';
6
6
  import * as _floating_ui_core from '@floating-ui/core';
7
7
  import * as styled_components from 'styled-components';
8
- import { ClearWaitingQueueParams } from 'react-toastify';
8
+ import { Theme as Theme$1, ClearWaitingQueueParams } from 'react-toastify';
9
9
 
10
10
  declare function useDialog({ defaultOpen, hasCloseButton, initialFocus, isOpen: propsIsOpen, onOpen, size, }: Omit<DialogProps, 'children'>): {
11
11
  labelId: string | undefined;
@@ -100,6 +100,8 @@ interface DialogProps {
100
100
  size?: DialogSize | {
101
101
  width: string;
102
102
  };
103
+ /** Theme. */
104
+ theme?: Theme;
103
105
  }
104
106
  type StyledDialogProps = DialogProps;
105
107
 
@@ -109,6 +111,8 @@ declare const DialogContext: React$1.Context<DialogState>;
109
111
  * Component props.
110
112
  */
111
113
  interface DialogContentActionsProps extends ComponentProps<'div'>, ContainerProps {
114
+ /** Theme. */
115
+ theme?: Theme;
112
116
  }
113
117
  type StyledDialogContentActionsProps = DialogContentActionsProps;
114
118
 
@@ -121,6 +125,8 @@ declare const DialogContentActions: Comp<DialogContentActionsProps, HTMLDivEleme
121
125
  * Component props.
122
126
  */
123
127
  interface DialogContentBodyProps extends ComponentProps<'div'>, ContainerProps {
128
+ /** Theme. */
129
+ theme?: Theme;
124
130
  }
125
131
  type StyledDialogContentBodyProps = DialogContentBodyProps & {
126
132
  $marginTop: number;
@@ -151,6 +157,8 @@ interface DialogContentHeaderProps extends ComponentProps<'div'> {
151
157
  iconProps?: Omit<IconProps, 'ref' | 'icon'>;
152
158
  /** Whether the card is loading or not. */
153
159
  isLoading?: boolean;
160
+ /** Theme. */
161
+ theme?: Theme;
154
162
  }
155
163
  type StyledDialogContentHeaderProps = DialogContentHeaderProps;
156
164
 
@@ -163,9 +171,12 @@ declare const DialogContentHeader: Comp<DialogContentHeaderProps, HTMLDivElement
163
171
  * Component props.
164
172
  */
165
173
  interface DialogContentProps extends ComponentProps<'div'> {
174
+ /** Theme. */
175
+ theme?: Theme;
166
176
  }
167
177
  type StyledDialogContentProps = DialogContentProps & {
168
178
  $width: string;
179
+ $theme: Theme;
169
180
  };
170
181
 
171
182
  declare const sizeToDimension: (size: DialogSize | {
@@ -362,6 +373,8 @@ interface PopoverProps {
362
373
  };
363
374
  /** Role to apply to the popover. */
364
375
  role?: 'dialog' | 'menu' | 'listbox';
376
+ /** Theme. */
377
+ theme?: Theme;
365
378
  }
366
379
  type StyledPopoverProps = PopoverProps;
367
380
 
@@ -371,13 +384,19 @@ declare const PopoverContext: React$1.Context<PopoverState>;
371
384
  * Component props.
372
385
  */
373
386
  interface PopoverContentProps extends ComponentProps<'div'>, ContainerProps {
387
+ /** Theme. */
388
+ theme?: Theme;
374
389
  }
375
- type StyledPopoverContentProps = PopoverContentProps;
390
+ type StyledPopoverContentProps = PopoverContentProps & {
391
+ $theme: Theme;
392
+ };
376
393
 
377
394
  /**
378
395
  * Component style.
379
396
  */
380
- declare const StyledPopoverContent: styled_components.StyledComponent<"div", any, PopoverContentProps, never>;
397
+ declare const StyledPopoverContent: styled_components.StyledComponent<"div", any, PopoverContentProps & {
398
+ $theme: Theme;
399
+ }, never>;
381
400
 
382
401
  /**
383
402
  * The PopoverContent component.
@@ -477,12 +496,15 @@ interface ToastProps extends Omit<ComponentProps<'div'>, 'id' | 'style'>, Spacin
477
496
  closeButton?: boolean | ReactNode;
478
497
  /** Title. */
479
498
  title?: string;
499
+ /** Theme. */
500
+ theme?: Theme;
480
501
  /** Variant */
481
502
  variant?: ToastVariant;
482
503
  }
483
504
  type StyledToastProps = Omit<ToastProps, 'variant' | 'id'> & {
484
505
  $hasTitle: boolean;
485
506
  $variant: ToastProps['variant'];
507
+ $theme: Theme;
486
508
  };
487
509
 
488
510
  /**
@@ -514,6 +536,8 @@ interface ToastContainerProps {
514
536
  placement?: ToastPlacement;
515
537
  /** Supports right to left content. */
516
538
  rtl?: boolean;
539
+ /** Theme. */
540
+ theme?: Theme$1;
517
541
  }
518
542
  type StyledToastContainerProps = ToastContainerProps & {};
519
543
  interface ToastOptions {
@@ -656,6 +680,8 @@ interface TooltipProps {
656
680
  onOpen?: (open: boolean) => void;
657
681
  /** Id to the tooltip content. */
658
682
  tooltipId?: string;
683
+ /** Theme. */
684
+ theme?: Theme;
659
685
  }
660
686
  type StyledTooltipProps = TooltipProps;
661
687
 
@@ -665,9 +691,12 @@ declare const TooltipContext: React$1.Context<TooltipState>;
665
691
  * Component props.
666
692
  */
667
693
  interface TooltipContentProps extends ComponentProps<'div'>, Omit<ContainerProps, keyof InternalSpacingProps> {
694
+ /** Theme. */
695
+ theme?: Theme;
668
696
  }
669
697
  type StyledTooltipContentProps = TooltipContentProps & {
670
698
  $placement: TooltipPlacement;
699
+ $theme: Theme;
671
700
  };
672
701
 
673
702
  /**