@redsift/popovers 7.7.0 → 7.8.1

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
@@ -123,7 +123,7 @@ The component should stricly follow the following structure:
123
123
  ```ts
124
124
  import React, { forwardRef, RefObject, useRef } from 'react';
125
125
  import classNames from 'classnames';
126
- import { Comp } from '~/types';
126
+ import { Comp } from '../../types';
127
127
  import { StyledBadge } from './styles';
128
128
  import { BadgeProps } from './types';
129
129
 
package/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import React$1, { Ref, ReactElement, Dispatch, SetStateAction, ReactNode, ComponentProps } from 'react';
1
+ import React$1, { Ref, ReactElement, ComponentProps, Dispatch, SetStateAction, ReactNode } from 'react';
2
2
  import * as _floating_ui_react from '@floating-ui/react';
3
3
  import { ClearWaitingQueueParams } from 'react-toastify';
4
4
 
@@ -228,13 +228,46 @@ interface ContainerProps extends Omit<FlexLayoutProps, 'inline'>, Omit<GridLayou
228
228
  display?: 'block' | 'inline' | 'inline-block' | 'flex' | 'inline-flex' | 'grid' | 'inline-grid' | 'inherit';
229
229
  }
230
230
 
231
+ /**
232
+ * Component variant.
233
+ */
234
+ declare const HeadingVariant: {
235
+ readonly h1: "h1";
236
+ readonly h2: "h2";
237
+ readonly h3: "h3";
238
+ readonly h4: "h4";
239
+ readonly h5: "h5";
240
+ readonly body: "body";
241
+ };
242
+ type HeadingVariant = ValueOf<typeof HeadingVariant>;
243
+ declare const HeadingComponent: {
244
+ readonly h1: "h1";
245
+ readonly h2: "h2";
246
+ readonly h3: "h3";
247
+ readonly h4: "h4";
248
+ readonly h5: "h5";
249
+ readonly span: "span";
250
+ };
251
+ type HeadingComponent = ValueOf<typeof HeadingComponent>;
252
+ /**
253
+ * Component props.
254
+ */
255
+ interface HeadingProps extends ComponentProps<'span'>, StylingProps {
256
+ /** The actual component rendered in the DOM. */
257
+ as: HeadingComponent;
258
+ /** Whether the text will truncate with a text overflow ellipsis or wrap. */
259
+ noWrap?: boolean;
260
+ /** The component the Heading will look like. */
261
+ variant?: HeadingVariant;
262
+ }
263
+
231
264
  declare function useDialog({ defaultOpen, hasCloseButton, initialFocus, isOpen: propsIsOpen, onOpen, size, }: Omit<DialogProps, 'children'>): {
232
265
  labelId: string | undefined;
233
266
  descriptionId: string | undefined;
234
267
  setLabelId: React$1.Dispatch<React$1.SetStateAction<string | undefined>>;
235
268
  setDescriptionId: React$1.Dispatch<React$1.SetStateAction<string | undefined>>;
236
269
  hasCloseButton: boolean | undefined;
237
- initialFocus: number | React$1.MutableRefObject<HTMLElement | null> | "header" | "body" | "actions" | undefined;
270
+ initialFocus: number | "body" | "header" | React$1.MutableRefObject<HTMLElement | null> | "actions" | undefined;
238
271
  size: DialogSize | undefined;
239
272
  headerRef: React$1.MutableRefObject<null>;
240
273
  bodyRef: React$1.MutableRefObject<null>;
@@ -249,10 +282,10 @@ declare function useDialog({ defaultOpen, hasCloseButton, initialFocus, isOpen:
249
282
  floating: (node: HTMLElement | null) => void;
250
283
  positionReference: (node: _floating_ui_react.ReferenceType | null) => void;
251
284
  context: {
252
- placement: _floating_ui_react.Placement;
253
- strategy: _floating_ui_react.Strategy;
254
285
  x: number | null;
255
286
  y: number | null;
287
+ placement: _floating_ui_react.Placement;
288
+ strategy: _floating_ui_react.Strategy;
256
289
  middlewareData: _floating_ui_react.MiddlewareData;
257
290
  update: () => void;
258
291
  reference: (node: _floating_ui_react.ReferenceType | null) => void;
@@ -348,39 +381,6 @@ type StyledDialogContentBodyProps = DialogContentBodyProps & {
348
381
  */
349
382
  declare const DialogContentBody: Comp<DialogContentBodyProps, HTMLDivElement>;
350
383
 
351
- /**
352
- * Component variant.
353
- */
354
- declare const HeadingVariant: {
355
- readonly h1: "h1";
356
- readonly h2: "h2";
357
- readonly h3: "h3";
358
- readonly h4: "h4";
359
- readonly h5: "h5";
360
- readonly body: "body";
361
- };
362
- type HeadingVariant = ValueOf<typeof HeadingVariant>;
363
- declare const HeadingComponent: {
364
- readonly h1: "h1";
365
- readonly h2: "h2";
366
- readonly h3: "h3";
367
- readonly h4: "h4";
368
- readonly h5: "h5";
369
- readonly span: "span";
370
- };
371
- type HeadingComponent = ValueOf<typeof HeadingComponent>;
372
- /**
373
- * Component props.
374
- */
375
- interface HeadingProps extends ComponentProps<'span'>, StylingProps {
376
- /** The actual component rendered in the DOM. */
377
- as: HeadingComponent;
378
- /** Whether the text will truncate with a text overflow ellipsis or wrap. */
379
- noWrap?: boolean;
380
- /** The component the Heading will look like. */
381
- variant?: HeadingVariant;
382
- }
383
-
384
384
  /**
385
385
  * Component props.
386
386
  */
@@ -461,7 +461,7 @@ declare const useDialogContext: () => {
461
461
  setLabelId: React$1.Dispatch<React$1.SetStateAction<string | undefined>>;
462
462
  setDescriptionId: React$1.Dispatch<React$1.SetStateAction<string | undefined>>;
463
463
  hasCloseButton: boolean | undefined;
464
- initialFocus: number | React$1.MutableRefObject<HTMLElement | null> | "header" | "body" | "actions" | undefined;
464
+ initialFocus: number | "body" | "header" | React$1.MutableRefObject<HTMLElement | null> | "actions" | undefined;
465
465
  size: DialogSize | undefined;
466
466
  headerRef: React$1.MutableRefObject<null>;
467
467
  bodyRef: React$1.MutableRefObject<null>;
@@ -476,10 +476,10 @@ declare const useDialogContext: () => {
476
476
  floating: (node: HTMLElement | null) => void;
477
477
  positionReference: (node: _floating_ui_react.ReferenceType | null) => void;
478
478
  context: {
479
- placement: undefined;
480
- strategy: undefined;
481
479
  x: number | null;
482
480
  y: number | null;
481
+ placement: undefined;
482
+ strategy: undefined;
483
483
  middlewareData: undefined;
484
484
  update: () => void;
485
485
  reference: (node: _floating_ui_react.ReferenceType | null) => void;
@@ -518,10 +518,10 @@ declare function usePopover({ defaultOpen, placement, isModal, isOpen: propsIsOp
518
518
  floating: (node: HTMLElement | null) => void;
519
519
  positionReference: (node: _floating_ui_react.ReferenceType | null) => void;
520
520
  context: {
521
- placement: _floating_ui_react.Placement;
522
- strategy: _floating_ui_react.Strategy;
523
521
  x: number | null;
524
522
  y: number | null;
523
+ placement: _floating_ui_react.Placement;
524
+ strategy: _floating_ui_react.Strategy;
525
525
  middlewareData: _floating_ui_react.MiddlewareData;
526
526
  update: () => void;
527
527
  reference: (node: _floating_ui_react.ReferenceType | null) => void;
@@ -644,10 +644,10 @@ declare const usePopoverContext: () => {
644
644
  floating: (node: HTMLElement | null) => void;
645
645
  positionReference: (node: _floating_ui_react.ReferenceType | null) => void;
646
646
  context: {
647
- placement: undefined;
648
- strategy: undefined;
649
647
  x: number | null;
650
648
  y: number | null;
649
+ placement: undefined;
650
+ strategy: undefined;
651
651
  middlewareData: undefined;
652
652
  update: () => void;
653
653
  reference: (node: _floating_ui_react.ReferenceType | null) => void;
@@ -805,10 +805,10 @@ declare function useTooltip({ defaultOpen, delay, placement, isOpen: propsIsOpen
805
805
  floating: (node: HTMLElement | null) => void;
806
806
  positionReference: (node: _floating_ui_react.ReferenceType | null) => void;
807
807
  context: {
808
- placement: _floating_ui_react.Placement;
809
- strategy: _floating_ui_react.Strategy;
810
808
  x: number | null;
811
809
  y: number | null;
810
+ placement: _floating_ui_react.Placement;
811
+ strategy: _floating_ui_react.Strategy;
812
812
  middlewareData: _floating_ui_react.MiddlewareData;
813
813
  update: () => void;
814
814
  reference: (node: _floating_ui_react.ReferenceType | null) => void;
@@ -936,10 +936,10 @@ declare const useTooltipContext: () => {
936
936
  floating: (node: HTMLElement | null) => void;
937
937
  positionReference: (node: _floating_ui_react.ReferenceType | null) => void;
938
938
  context: {
939
- placement: undefined;
940
- strategy: undefined;
941
939
  x: number | null;
942
940
  y: number | null;
941
+ placement: undefined;
942
+ strategy: undefined;
943
943
  middlewareData: undefined;
944
944
  update: () => void;
945
945
  reference: (node: _floating_ui_react.ReferenceType | null) => void;