@lumx/react 4.4.0 → 4.4.1-alpha.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.
Files changed (4) hide show
  1. package/index.d.ts +61 -51
  2. package/index.js +2314 -2282
  3. package/index.js.map +1 -1
  4. package/package.json +6 -6
package/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Kind as Kind$1, HorizontalAlignment as HorizontalAlignment$1, Size as Size$1, ColorPalette as ColorPalette$1, Theme as Theme$1, Orientation as Orientation$1, Alignment as Alignment$1, AspectRatio as AspectRatio$1, ColorWithVariants as ColorWithVariants$1, ColorVariant as ColorVariant$1, Typography as Typography$1, Emphasis as Emphasis$1 } from '@lumx/core/js/constants';
1
+ import { Kind as Kind$1, HorizontalAlignment as HorizontalAlignment$1, ColorPalette as ColorPalette$1, Size as Size$1, Theme as Theme$1, Orientation as Orientation$1, Alignment as Alignment$1, AspectRatio as AspectRatio$1, ColorWithVariants as ColorWithVariants$1, ColorVariant as ColorVariant$1, Typography as Typography$1, Emphasis as Emphasis$1 } from '@lumx/core/js/constants';
2
2
  export * from '@lumx/core/js/constants';
3
3
  import * as _lumx_core_js_types from '@lumx/core/js/types';
4
4
  import { GenericProps as GenericProps$1, HasTheme as HasTheme$1, ValueOf as ValueOf$1, PropsToOverride, HasAriaDisabled as HasAriaDisabled$1, HasCloseMode, HasClassName as HasClassName$1, JSXElement as JSXElement$1, CommonRef as CommonRef$1, Falsy, HeadingElement as HeadingElement$1, HasRequiredLinkHref, HasAriaLabelOrLabelledBy } from '@lumx/core/js/types';
@@ -253,43 +253,12 @@ interface AutocompleteMultipleProps extends AutocompleteProps {
253
253
  */
254
254
  declare const AutocompleteMultiple: Comp<AutocompleteMultipleProps, HTMLDivElement>;
255
255
 
256
- /**
257
- * Avatar sizes.
258
- */
259
- type AvatarSize = Extract<Size$1, 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl'>;
260
- /**
261
- * Defines the props of the component.
262
- */
263
- interface AvatarProps extends GenericProps$1, HasTheme$1 {
264
- /** Action toolbar content. */
265
- actions?: ReactNode;
266
- /** Image alternative text. */
267
- alt: string;
268
- /** Badge. */
269
- badge?: ReactElement;
270
- /** Image URL. */
271
- image: string;
272
- /** Props to pass to the link wrapping the thumbnail. */
273
- linkProps?: React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>;
274
- /** Custom react component for the link (can be used to inject react router Link). */
275
- linkAs?: 'a' | any;
276
- /** On click callback. */
277
- onClick?: MouseEventHandler<HTMLDivElement>;
278
- /** On key press callback. */
279
- onKeyPress?: KeyboardEventHandler<HTMLDivElement>;
280
- /** Size variant. */
281
- size?: AvatarSize;
282
- /** Props to pass to the thumbnail (minus those already set by the Avatar props). */
283
- thumbnailProps?: Omit<ThumbnailProps, 'image' | 'alt' | 'size' | 'theme' | 'align' | 'fillHeight' | 'variant' | 'aspectRatio'>;
256
+ interface HasClassName {
257
+ /**
258
+ * Class name forwarded to the root element of the component.
259
+ */
260
+ className?: string;
284
261
  }
285
- /**
286
- * Avatar component.
287
- *
288
- * @param props Component props.
289
- * @param ref Component ref.
290
- * @return React element.
291
- */
292
- declare const Avatar: Comp<AvatarProps, HTMLDivElement>;
293
262
 
294
263
  /**
295
264
  * Alignments.
@@ -478,13 +447,6 @@ type ColorVariant = ValueOf$1<typeof ColorVariant>;
478
447
  /** ColorPalette with all possible color variant combination */
479
448
  type ColorWithVariants = ColorPalette | Exclude<`${ColorPalette}-${ColorVariant}`, `light-D${number}` | `dark-D${number}`>;
480
449
 
481
- interface HasClassName {
482
- /**
483
- * Class name forwarded to the root element of the component.
484
- */
485
- className?: string;
486
- }
487
-
488
450
  interface HasTheme {
489
451
  /**
490
452
  * Theme adapting the component to light or dark background.
@@ -589,15 +551,23 @@ type FieldSelector<TObject, TValue> = keyof {
589
551
  */
590
552
  type Selector<TObject, TValue = string> = FieldSelector<TObject, TValue> | FunctionSelector<TObject, TValue>;
591
553
 
554
+ /**
555
+ * Avatar sizes.
556
+ */
557
+ type AvatarSize = Extract<Size, 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl'>;
592
558
  /**
593
559
  * Defines the props of the component.
594
560
  */
595
- interface BadgeProps$1 extends HasClassName {
596
- /** Badge content. */
597
- children?: JSXElement;
598
- /** Color variant. */
599
- color?: ColorPalette;
600
- /** reference to the root element */
561
+ interface AvatarProps$1 extends HasTheme, HasClassName {
562
+ /** Action toolbar content. */
563
+ actions?: JSXElement;
564
+ /** Badge. */
565
+ badge?: JSXElement;
566
+ /** Image URL. */
567
+ image: JSXElement;
568
+ /** Size variant. */
569
+ size?: AvatarSize;
570
+ /** Props to pass to the thumbnail (minus those already set by the Avatar props). */
601
571
  ref?: CommonRef;
602
572
  }
603
573
 
@@ -610,6 +580,46 @@ interface BadgeProps$1 extends HasClassName {
610
580
  */
611
581
  type ReactToJSX<Props, OmitProps extends keyof Props = never> = Omit<Props, PropsToOverride | OmitProps>;
612
582
 
583
+ /**
584
+ * Defines the props of the component.
585
+ */
586
+ interface AvatarProps extends GenericProps$1, ReactToJSX<AvatarProps$1, 'actions' | 'badge' | 'image'> {
587
+ /** Action toolbar content. */
588
+ actions?: ReactNode;
589
+ /** Props to pass to the link wrapping the thumbnail. */
590
+ linkProps?: React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>;
591
+ /** Custom react component for the link (can be used to inject react router Link). */
592
+ linkAs?: 'a' | any;
593
+ /** On click callback. */
594
+ onClick?: MouseEventHandler<HTMLDivElement>;
595
+ /** On key press callback. */
596
+ onKeyPress?: KeyboardEventHandler<HTMLDivElement>;
597
+ /** Image alternative text. */
598
+ alt: string;
599
+ /** Props to pass to the thumbnail (minus those already set by the Avatar props). */
600
+ thumbnailProps?: Omit<ThumbnailProps, 'image' | 'alt' | 'size' | 'theme' | 'align' | 'fillHeight' | 'variant' | 'aspectRatio'>;
601
+ }
602
+ /**
603
+ * Avatar component.
604
+ *
605
+ * @param props Component props.
606
+ * @param ref Component ref.
607
+ * @return React element.
608
+ */
609
+ declare const Avatar: Comp<AvatarProps, HTMLDivElement>;
610
+
611
+ /**
612
+ * Defines the props of the component.
613
+ */
614
+ interface BadgeProps$1 extends HasClassName {
615
+ /** Badge content. */
616
+ children?: JSXElement;
617
+ /** Color variant. */
618
+ color?: ColorPalette;
619
+ /** reference to the root element */
620
+ ref?: CommonRef;
621
+ }
622
+
613
623
  /**
614
624
  * Defines the props of the component.
615
625
  */
@@ -1556,7 +1566,7 @@ declare const GenericBlockGapSize: Pick<{
1556
1566
  readonly medium: "medium";
1557
1567
  readonly big: "big";
1558
1568
  readonly huge: "huge";
1559
- }, "medium" | "tiny" | "regular" | "big" | "huge">;
1569
+ }, "tiny" | "regular" | "medium" | "big" | "huge">;
1560
1570
  type GenericBlockGapSize = ValueOf$1<typeof GenericBlockGapSize>;
1561
1571
 
1562
1572
  interface GenericBlockProps extends FlexBoxProps {