@lumx/react 4.4.1-alpha.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.
- package/index.d.ts +61 -51
- package/index.js +186 -170
- package/index.js.map +1 -1
- package/package.json +3 -3
package/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Kind as Kind$1, HorizontalAlignment as HorizontalAlignment$1,
|
|
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
|
-
|
|
258
|
-
|
|
259
|
-
|
|
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
|
|
596
|
-
/**
|
|
597
|
-
|
|
598
|
-
/**
|
|
599
|
-
|
|
600
|
-
/**
|
|
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
|
-
}, "
|
|
1569
|
+
}, "tiny" | "regular" | "medium" | "big" | "huge">;
|
|
1560
1570
|
type GenericBlockGapSize = ValueOf$1<typeof GenericBlockGapSize>;
|
|
1561
1571
|
|
|
1562
1572
|
interface GenericBlockProps extends FlexBoxProps {
|
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Kind as Kind$1, Size as Size$1, ColorPalette as ColorPalette$1, Emphasis as Emphasis$1, Theme as Theme$1, AspectRatio as AspectRatio$1,
|
|
1
|
+
import { Kind as Kind$1, Size as Size$1, ColorPalette as ColorPalette$1, Emphasis as Emphasis$1, ColorVariant, Theme as Theme$1, AspectRatio as AspectRatio$1, DIALOG_TRANSITION_DURATION, Orientation as Orientation$1, Alignment, NOTIFICATION_TRANSITION_DURATION, TOOLTIP_LONG_PRESS_DELAY, TOOLTIP_HOVER_DELAY } from '@lumx/core/js/constants';
|
|
2
2
|
export * from '@lumx/core/js/constants';
|
|
3
3
|
export * from '@lumx/core/js/types';
|
|
4
4
|
import * as React from 'react';
|
|
@@ -553,149 +553,6 @@ AutocompleteMultiple.displayName = COMPONENT_NAME$1i;
|
|
|
553
553
|
AutocompleteMultiple.className = CLASSNAME$1h;
|
|
554
554
|
AutocompleteMultiple.defaultProps = DEFAULT_PROPS$18;
|
|
555
555
|
|
|
556
|
-
/**
|
|
557
|
-
* Component display name.
|
|
558
|
-
*/
|
|
559
|
-
const COMPONENT_NAME$1h = 'Avatar';
|
|
560
|
-
|
|
561
|
-
/**
|
|
562
|
-
* Component default class name and class prefix.
|
|
563
|
-
*/
|
|
564
|
-
const CLASSNAME$1g = 'lumx-avatar';
|
|
565
|
-
const {
|
|
566
|
-
block: block$13,
|
|
567
|
-
element: element$N
|
|
568
|
-
} = classNames.bem(CLASSNAME$1g);
|
|
569
|
-
|
|
570
|
-
/**
|
|
571
|
-
* Component default props.
|
|
572
|
-
*/
|
|
573
|
-
const DEFAULT_PROPS$17 = {
|
|
574
|
-
size: Size$1.m
|
|
575
|
-
};
|
|
576
|
-
|
|
577
|
-
/**
|
|
578
|
-
* Avatar component.
|
|
579
|
-
*
|
|
580
|
-
* @param props Component props.
|
|
581
|
-
* @param ref Component ref.
|
|
582
|
-
* @return React element.
|
|
583
|
-
*/
|
|
584
|
-
const Avatar = forwardRef((props, ref) => {
|
|
585
|
-
const defaultTheme = useTheme() || Theme$1.light;
|
|
586
|
-
const {
|
|
587
|
-
actions,
|
|
588
|
-
alt,
|
|
589
|
-
badge,
|
|
590
|
-
className,
|
|
591
|
-
image,
|
|
592
|
-
linkProps,
|
|
593
|
-
linkAs,
|
|
594
|
-
onClick,
|
|
595
|
-
onKeyPress,
|
|
596
|
-
size = DEFAULT_PROPS$17.size,
|
|
597
|
-
theme = defaultTheme,
|
|
598
|
-
thumbnailProps,
|
|
599
|
-
...forwardedProps
|
|
600
|
-
} = props;
|
|
601
|
-
return /*#__PURE__*/jsxs("div", {
|
|
602
|
-
ref: ref,
|
|
603
|
-
...forwardedProps,
|
|
604
|
-
className: classNames.join(className, block$13({
|
|
605
|
-
[`size-${size}`]: Boolean(size),
|
|
606
|
-
[`theme-${theme}`]: Boolean(theme)
|
|
607
|
-
})),
|
|
608
|
-
children: [/*#__PURE__*/jsx(Thumbnail, {
|
|
609
|
-
linkProps: linkProps,
|
|
610
|
-
linkAs: linkAs,
|
|
611
|
-
className: element$N('thumbnail'),
|
|
612
|
-
onClick: onClick,
|
|
613
|
-
onKeyPress: onKeyPress,
|
|
614
|
-
...thumbnailProps,
|
|
615
|
-
aspectRatio: AspectRatio$1.square,
|
|
616
|
-
size: size,
|
|
617
|
-
image: image,
|
|
618
|
-
alt: alt,
|
|
619
|
-
theme: theme
|
|
620
|
-
}), actions && /*#__PURE__*/jsx("div", {
|
|
621
|
-
className: element$N('actions'),
|
|
622
|
-
children: actions
|
|
623
|
-
}), badge && /*#__PURE__*/jsx("div", {
|
|
624
|
-
className: element$N('badge'),
|
|
625
|
-
children: badge
|
|
626
|
-
})]
|
|
627
|
-
});
|
|
628
|
-
});
|
|
629
|
-
Avatar.displayName = COMPONENT_NAME$1h;
|
|
630
|
-
Avatar.className = CLASSNAME$1g;
|
|
631
|
-
Avatar.defaultProps = DEFAULT_PROPS$17;
|
|
632
|
-
|
|
633
|
-
/**
|
|
634
|
-
* Alignments.
|
|
635
|
-
*/
|
|
636
|
-
const Theme = {
|
|
637
|
-
light: 'light',
|
|
638
|
-
dark: 'dark'
|
|
639
|
-
};
|
|
640
|
-
const Size = {
|
|
641
|
-
xxs: 'xxs',
|
|
642
|
-
xs: 'xs',
|
|
643
|
-
s: 's',
|
|
644
|
-
m: 'm',
|
|
645
|
-
xl: 'xl',
|
|
646
|
-
xxl: 'xxl'};
|
|
647
|
-
const Orientation = {
|
|
648
|
-
horizontal: 'horizontal'};
|
|
649
|
-
const Emphasis = {
|
|
650
|
-
low: 'low',
|
|
651
|
-
high: 'high'
|
|
652
|
-
};
|
|
653
|
-
/**
|
|
654
|
-
* List of typographies that can't be customized.
|
|
655
|
-
*/
|
|
656
|
-
const TypographyInterface = {
|
|
657
|
-
overline: 'overline',
|
|
658
|
-
caption: 'caption',
|
|
659
|
-
body1: 'body1',
|
|
660
|
-
body2: 'body2',
|
|
661
|
-
subtitle1: 'subtitle1',
|
|
662
|
-
subtitle2: 'subtitle2',
|
|
663
|
-
title: 'title',
|
|
664
|
-
headline: 'headline',
|
|
665
|
-
display1: 'display1'
|
|
666
|
-
};
|
|
667
|
-
/**
|
|
668
|
-
* List of all typographies.
|
|
669
|
-
*/
|
|
670
|
-
const Typography = {
|
|
671
|
-
...TypographyInterface};
|
|
672
|
-
/**
|
|
673
|
-
* All available aspect ratios.
|
|
674
|
-
*/
|
|
675
|
-
const AspectRatio = {
|
|
676
|
-
/** Intrinsic content ratio. */
|
|
677
|
-
original: 'original'};
|
|
678
|
-
/**
|
|
679
|
-
* Semantic info about the purpose of the component
|
|
680
|
-
*/
|
|
681
|
-
const Kind = {
|
|
682
|
-
info: 'info',
|
|
683
|
-
success: 'success',
|
|
684
|
-
warning: 'warning',
|
|
685
|
-
error: 'error'
|
|
686
|
-
};
|
|
687
|
-
/**
|
|
688
|
-
* See SCSS variable $lumx-color-palette
|
|
689
|
-
*/
|
|
690
|
-
const ColorPalette = {
|
|
691
|
-
primary: 'primary',
|
|
692
|
-
blue: 'blue',
|
|
693
|
-
dark: 'dark',
|
|
694
|
-
green: 'green',
|
|
695
|
-
yellow: 'yellow',
|
|
696
|
-
red: 'red',
|
|
697
|
-
light: 'light'};
|
|
698
|
-
|
|
699
556
|
function getDefaultExportFromCjs (x) {
|
|
700
557
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
701
558
|
}
|
|
@@ -856,7 +713,7 @@ function modifier$1(baseName, modifiers) {
|
|
|
856
713
|
* block('button', { active: true, disabled: false }); // 'button button--active'
|
|
857
714
|
*/
|
|
858
715
|
|
|
859
|
-
function block$
|
|
716
|
+
function block$13(baseName, modifiersOrAdditionalClasses, additionalClasses) {
|
|
860
717
|
let modifiers;
|
|
861
718
|
let classes;
|
|
862
719
|
if (Array.isArray(modifiersOrAdditionalClasses)) {
|
|
@@ -891,11 +748,11 @@ function block$12(baseName, modifiersOrAdditionalClasses, additionalClasses) {
|
|
|
891
748
|
* element('my-button', 'icon', { active: true }); // 'my-button__icon my-button__icon--active'
|
|
892
749
|
*/
|
|
893
750
|
|
|
894
|
-
function element$
|
|
751
|
+
function element$N(baseClass, elem, modifiersOrAdditionalClasses, additionalClasses) {
|
|
895
752
|
if (Array.isArray(modifiersOrAdditionalClasses)) {
|
|
896
|
-
return block$
|
|
753
|
+
return block$13(`${baseClass}__${elem}`, modifiersOrAdditionalClasses);
|
|
897
754
|
}
|
|
898
|
-
return block$
|
|
755
|
+
return block$13(`${baseClass}__${elem}`, modifiersOrAdditionalClasses, additionalClasses);
|
|
899
756
|
}
|
|
900
757
|
|
|
901
758
|
/**
|
|
@@ -904,15 +761,15 @@ function element$M(baseClass, elem, modifiersOrAdditionalClasses, additionalClas
|
|
|
904
761
|
function bem(baseName) {
|
|
905
762
|
function blockFn(modifiersOrAdditionalClasses, additionalClasses) {
|
|
906
763
|
if (Array.isArray(modifiersOrAdditionalClasses)) {
|
|
907
|
-
return block$
|
|
764
|
+
return block$13(baseName, modifiersOrAdditionalClasses);
|
|
908
765
|
}
|
|
909
|
-
return block$
|
|
766
|
+
return block$13(baseName, modifiersOrAdditionalClasses, additionalClasses);
|
|
910
767
|
}
|
|
911
768
|
function elementFn(elem, modifiersOrAdditionalClasses, additionalClasses) {
|
|
912
769
|
if (Array.isArray(modifiersOrAdditionalClasses)) {
|
|
913
|
-
return element$
|
|
770
|
+
return element$N(baseName, elem, modifiersOrAdditionalClasses);
|
|
914
771
|
}
|
|
915
|
-
return element$
|
|
772
|
+
return element$N(baseName, elem, modifiersOrAdditionalClasses, additionalClasses);
|
|
916
773
|
}
|
|
917
774
|
return {
|
|
918
775
|
block: blockFn,
|
|
@@ -921,6 +778,179 @@ function bem(baseName) {
|
|
|
921
778
|
};
|
|
922
779
|
}
|
|
923
780
|
|
|
781
|
+
/**
|
|
782
|
+
* Alignments.
|
|
783
|
+
*/
|
|
784
|
+
const Theme = {
|
|
785
|
+
light: 'light',
|
|
786
|
+
dark: 'dark'
|
|
787
|
+
};
|
|
788
|
+
const Size = {
|
|
789
|
+
xxs: 'xxs',
|
|
790
|
+
xs: 'xs',
|
|
791
|
+
s: 's',
|
|
792
|
+
m: 'm',
|
|
793
|
+
xl: 'xl',
|
|
794
|
+
xxl: 'xxl'};
|
|
795
|
+
const Orientation = {
|
|
796
|
+
horizontal: 'horizontal'};
|
|
797
|
+
const Emphasis = {
|
|
798
|
+
low: 'low',
|
|
799
|
+
high: 'high'
|
|
800
|
+
};
|
|
801
|
+
/**
|
|
802
|
+
* List of typographies that can't be customized.
|
|
803
|
+
*/
|
|
804
|
+
const TypographyInterface = {
|
|
805
|
+
overline: 'overline',
|
|
806
|
+
caption: 'caption',
|
|
807
|
+
body1: 'body1',
|
|
808
|
+
body2: 'body2',
|
|
809
|
+
subtitle1: 'subtitle1',
|
|
810
|
+
subtitle2: 'subtitle2',
|
|
811
|
+
title: 'title',
|
|
812
|
+
headline: 'headline',
|
|
813
|
+
display1: 'display1'
|
|
814
|
+
};
|
|
815
|
+
/**
|
|
816
|
+
* List of all typographies.
|
|
817
|
+
*/
|
|
818
|
+
const Typography = {
|
|
819
|
+
...TypographyInterface};
|
|
820
|
+
/**
|
|
821
|
+
* All available aspect ratios.
|
|
822
|
+
*/
|
|
823
|
+
const AspectRatio = {
|
|
824
|
+
/** Intrinsic content ratio. */
|
|
825
|
+
original: 'original'};
|
|
826
|
+
/**
|
|
827
|
+
* Semantic info about the purpose of the component
|
|
828
|
+
*/
|
|
829
|
+
const Kind = {
|
|
830
|
+
info: 'info',
|
|
831
|
+
success: 'success',
|
|
832
|
+
warning: 'warning',
|
|
833
|
+
error: 'error'
|
|
834
|
+
};
|
|
835
|
+
/**
|
|
836
|
+
* See SCSS variable $lumx-color-palette
|
|
837
|
+
*/
|
|
838
|
+
const ColorPalette = {
|
|
839
|
+
primary: 'primary',
|
|
840
|
+
blue: 'blue',
|
|
841
|
+
dark: 'dark',
|
|
842
|
+
green: 'green',
|
|
843
|
+
yellow: 'yellow',
|
|
844
|
+
red: 'red',
|
|
845
|
+
light: 'light'};
|
|
846
|
+
|
|
847
|
+
/**
|
|
848
|
+
* Component display name.
|
|
849
|
+
*/
|
|
850
|
+
const COMPONENT_NAME$1h = 'Avatar';
|
|
851
|
+
|
|
852
|
+
/**
|
|
853
|
+
* Component default class name and class prefix.
|
|
854
|
+
*/
|
|
855
|
+
const CLASSNAME$1g = 'lumx-avatar';
|
|
856
|
+
const {
|
|
857
|
+
block: block$12,
|
|
858
|
+
element: element$M
|
|
859
|
+
} = bem(CLASSNAME$1g);
|
|
860
|
+
|
|
861
|
+
/**
|
|
862
|
+
* Component default props.
|
|
863
|
+
*/
|
|
864
|
+
const DEFAULT_PROPS$17 = {
|
|
865
|
+
size: Size.m
|
|
866
|
+
};
|
|
867
|
+
|
|
868
|
+
/**
|
|
869
|
+
* Avatar component.
|
|
870
|
+
*
|
|
871
|
+
* @param props Component props.
|
|
872
|
+
* @param ref Component ref.
|
|
873
|
+
* @return React element.
|
|
874
|
+
*/
|
|
875
|
+
const Avatar$1 = props => {
|
|
876
|
+
const {
|
|
877
|
+
actions,
|
|
878
|
+
badge,
|
|
879
|
+
className,
|
|
880
|
+
image,
|
|
881
|
+
size = DEFAULT_PROPS$17.size,
|
|
882
|
+
theme,
|
|
883
|
+
ref,
|
|
884
|
+
...forwardedProps
|
|
885
|
+
} = props;
|
|
886
|
+
return /*#__PURE__*/jsxs("div", {
|
|
887
|
+
ref: ref,
|
|
888
|
+
...forwardedProps,
|
|
889
|
+
className: classnames(className, block$12({
|
|
890
|
+
[`size-${size}`]: Boolean(size),
|
|
891
|
+
[`theme-${theme}`]: Boolean(theme)
|
|
892
|
+
})),
|
|
893
|
+
children: [image, actions && /*#__PURE__*/jsx("div", {
|
|
894
|
+
className: element$M('actions'),
|
|
895
|
+
children: actions
|
|
896
|
+
}), badge && /*#__PURE__*/jsx("div", {
|
|
897
|
+
className: element$M('badge'),
|
|
898
|
+
children: badge
|
|
899
|
+
})]
|
|
900
|
+
});
|
|
901
|
+
};
|
|
902
|
+
|
|
903
|
+
/**
|
|
904
|
+
* Avatar component.
|
|
905
|
+
*
|
|
906
|
+
* @param props Component props.
|
|
907
|
+
* @param ref Component ref.
|
|
908
|
+
* @return React element.
|
|
909
|
+
*/
|
|
910
|
+
const Avatar = forwardRef((props, ref) => {
|
|
911
|
+
const defaultTheme = useTheme() || Theme$1.light;
|
|
912
|
+
const {
|
|
913
|
+
actions,
|
|
914
|
+
alt,
|
|
915
|
+
badge,
|
|
916
|
+
className,
|
|
917
|
+
image,
|
|
918
|
+
linkProps,
|
|
919
|
+
linkAs,
|
|
920
|
+
onClick,
|
|
921
|
+
onKeyPress,
|
|
922
|
+
size = DEFAULT_PROPS$17.size,
|
|
923
|
+
theme = defaultTheme,
|
|
924
|
+
thumbnailProps,
|
|
925
|
+
...forwardedProps
|
|
926
|
+
} = props;
|
|
927
|
+
return Avatar$1({
|
|
928
|
+
...forwardedProps,
|
|
929
|
+
className,
|
|
930
|
+
theme,
|
|
931
|
+
ref,
|
|
932
|
+
actions,
|
|
933
|
+
badge,
|
|
934
|
+
size,
|
|
935
|
+
image: /*#__PURE__*/jsx(Thumbnail, {
|
|
936
|
+
linkProps: linkProps,
|
|
937
|
+
linkAs: linkAs,
|
|
938
|
+
className: element$M('thumbnail'),
|
|
939
|
+
onClick: onClick,
|
|
940
|
+
onKeyPress: onKeyPress,
|
|
941
|
+
...thumbnailProps,
|
|
942
|
+
aspectRatio: AspectRatio$1.square,
|
|
943
|
+
size: size,
|
|
944
|
+
image: image,
|
|
945
|
+
alt: alt,
|
|
946
|
+
theme: theme
|
|
947
|
+
})
|
|
948
|
+
});
|
|
949
|
+
});
|
|
950
|
+
Avatar.displayName = COMPONENT_NAME$1h;
|
|
951
|
+
Avatar.className = CLASSNAME$1g;
|
|
952
|
+
Avatar.defaultProps = DEFAULT_PROPS$17;
|
|
953
|
+
|
|
924
954
|
/**
|
|
925
955
|
* Component display name.
|
|
926
956
|
*/
|
|
@@ -6352,7 +6382,7 @@ function usePopoverStyle({
|
|
|
6352
6382
|
}
|
|
6353
6383
|
|
|
6354
6384
|
// Arrow middleware
|
|
6355
|
-
if (hasArrow) {
|
|
6385
|
+
if (hasArrow && arrowElement) {
|
|
6356
6386
|
mw.push(arrow({
|
|
6357
6387
|
element: arrowElement,
|
|
6358
6388
|
padding: ARROW_SIZE$1 / 2
|
|
@@ -6395,10 +6425,6 @@ function usePopoverStyle({
|
|
|
6395
6425
|
zIndex
|
|
6396
6426
|
};
|
|
6397
6427
|
}, [style, floatingStyles, zIndex]);
|
|
6398
|
-
|
|
6399
|
-
// Stable setter wrapping useState setter (already stable but typed for consistency)
|
|
6400
|
-
const setPopperElementCallback = useCallback(el => setPopperElement(el), []);
|
|
6401
|
-
const setArrowElementCallback = useCallback(el => setArrowElement(el), []);
|
|
6402
6428
|
return {
|
|
6403
6429
|
styles: {
|
|
6404
6430
|
arrow: arrowStyles,
|
|
@@ -6406,8 +6432,8 @@ function usePopoverStyle({
|
|
|
6406
6432
|
},
|
|
6407
6433
|
isPositioned,
|
|
6408
6434
|
position: position,
|
|
6409
|
-
setArrowElement
|
|
6410
|
-
setPopperElement
|
|
6435
|
+
setArrowElement,
|
|
6436
|
+
setPopperElement,
|
|
6411
6437
|
popperElement
|
|
6412
6438
|
};
|
|
6413
6439
|
}
|
|
@@ -6508,7 +6534,6 @@ const _InnerPopover = forwardRef((props, ref) => {
|
|
|
6508
6534
|
[`theme-${theme}`]: Boolean(theme),
|
|
6509
6535
|
[`elevation-${adjustedElevation}`]: Boolean(adjustedElevation),
|
|
6510
6536
|
[`position-${position}`]: Boolean(position)
|
|
6511
|
-
//'is-initializing': !isPositioned,
|
|
6512
6537
|
})),
|
|
6513
6538
|
style: styles.popover,
|
|
6514
6539
|
"data-popper-placement": position,
|
|
@@ -15048,9 +15073,7 @@ const Tooltip = forwardRef((props, ref) => {
|
|
|
15048
15073
|
const [anchorElement, setAnchorElement] = useState(null);
|
|
15049
15074
|
const {
|
|
15050
15075
|
floatingStyles,
|
|
15051
|
-
placement: resolvedPlacement
|
|
15052
|
-
isPositioned,
|
|
15053
|
-
update
|
|
15076
|
+
placement: resolvedPlacement
|
|
15054
15077
|
} = useFloating({
|
|
15055
15078
|
placement: placement,
|
|
15056
15079
|
whileElementsMounted: autoUpdate,
|
|
@@ -15076,12 +15099,6 @@ const Tooltip = forwardRef((props, ref) => {
|
|
|
15076
15099
|
label,
|
|
15077
15100
|
ariaLinkMode: ariaLinkMode
|
|
15078
15101
|
});
|
|
15079
|
-
|
|
15080
|
-
// Update on open
|
|
15081
|
-
// React.useEffect(() => {
|
|
15082
|
-
// if (isOpen || popperElement) update?.();
|
|
15083
|
-
// }, [isOpen, update, popperElement]);
|
|
15084
|
-
|
|
15085
15102
|
const labelLines = label ? label.split('\n') : [];
|
|
15086
15103
|
const tooltipRef = useMergeRefs(ref, setPopperElement, onPopperMount);
|
|
15087
15104
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
@@ -15095,7 +15112,6 @@ const Tooltip = forwardRef((props, ref) => {
|
|
|
15095
15112
|
role: "tooltip",
|
|
15096
15113
|
className: classNames.join(className, block$2({
|
|
15097
15114
|
[`position-${position}`]: Boolean(position)
|
|
15098
|
-
//'is-initializing': !isPositioned,
|
|
15099
15115
|
}), isHidden && classNames.visuallyHidden()),
|
|
15100
15116
|
style: {
|
|
15101
15117
|
...(isHidden ? undefined : floatingStyles),
|