@lumx/react 3.11.1-alpha.2 → 3.11.1-alpha.4
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 +2 -4
- package/index.js +6 -15
- package/index.js.map +1 -1
- package/package.json +3 -3
- package/src/components/button/Button.tsx +3 -3
- package/src/components/button/ButtonRoot.tsx +0 -2
- package/src/components/popover/Popover.stories.tsx +5 -9
- package/src/components/popover/Popover.tsx +3 -1
- package/src/components/popover/usePopoverStyle.tsx +2 -14
package/index.d.ts
CHANGED
|
@@ -603,8 +603,6 @@ interface BaseButtonProps extends GenericProps, Pick<AriaAttributes, 'aria-expan
|
|
|
603
603
|
type?: HTMLButtonProps['type'];
|
|
604
604
|
/** Custom react component for the link (can be used to inject react router Link). */
|
|
605
605
|
linkAs?: 'a' | any;
|
|
606
|
-
/** Children */
|
|
607
|
-
children?: React.ReactNode;
|
|
608
606
|
}
|
|
609
607
|
|
|
610
608
|
/**
|
|
@@ -620,14 +618,14 @@ declare const ButtonEmphasis: {
|
|
|
620
618
|
* Defines the props of the component.
|
|
621
619
|
*/
|
|
622
620
|
interface ButtonProps extends BaseButtonProps {
|
|
623
|
-
/** Button content. */
|
|
624
|
-
children?: ReactNode;
|
|
625
621
|
/** Left icon (SVG path). */
|
|
626
622
|
leftIcon?: string;
|
|
627
623
|
/** Right icon (SVG path). */
|
|
628
624
|
rightIcon?: string;
|
|
629
625
|
/** When `true`, the button gets as large as possible. */
|
|
630
626
|
fullWidth?: boolean;
|
|
627
|
+
/** Children */
|
|
628
|
+
children?: React.ReactNode;
|
|
631
629
|
}
|
|
632
630
|
/**
|
|
633
631
|
* Button component.
|
package/index.js
CHANGED
|
@@ -4584,19 +4584,10 @@ function usePopoverStyle(_ref5) {
|
|
|
4584
4584
|
if (!update || !popperElement || !anchorElement || !(WINDOW !== null && WINDOW !== void 0 && WINDOW.ResizeObserver)) {
|
|
4585
4585
|
return undefined;
|
|
4586
4586
|
}
|
|
4587
|
-
|
|
4588
|
-
// Only update once per frame
|
|
4589
|
-
let frame;
|
|
4590
|
-
function limitedUpdate() {
|
|
4591
|
-
if (frame) return;
|
|
4592
|
-
frame = requestAnimationFrame(() => {
|
|
4593
|
-
update === null || update === void 0 ? void 0 : update();
|
|
4594
|
-
frame = undefined;
|
|
4595
|
-
});
|
|
4596
|
-
}
|
|
4587
|
+
update();
|
|
4597
4588
|
|
|
4598
4589
|
// On anchor or popover resize
|
|
4599
|
-
const resizeObserver = new ResizeObserver(
|
|
4590
|
+
const resizeObserver = new ResizeObserver(update);
|
|
4600
4591
|
resizeObserver.observe(anchorElement);
|
|
4601
4592
|
resizeObserver.observe(popperElement);
|
|
4602
4593
|
return () => {
|
|
@@ -4611,9 +4602,6 @@ function usePopoverStyle(_ref5) {
|
|
|
4611
4602
|
if (fitWithinViewportHeight && !newStyles.maxHeight) {
|
|
4612
4603
|
newStyles.maxHeight = (WINDOW === null || WINDOW === void 0 ? void 0 : WINDOW.innerHeight) || (DOCUMENT === null || DOCUMENT === void 0 ? void 0 : DOCUMENT.documentElement.clientHeight);
|
|
4613
4604
|
}
|
|
4614
|
-
|
|
4615
|
-
// Do not show the popover while it's not properly placed
|
|
4616
|
-
if (!newStyles.transform) newStyles.opacity = 0;
|
|
4617
4605
|
return newStyles;
|
|
4618
4606
|
}, [style, styles.popper, zIndex, fitWithinViewportHeight]);
|
|
4619
4607
|
return {
|
|
@@ -4664,6 +4652,7 @@ const renderPopover = (children, usePortal) => {
|
|
|
4664
4652
|
|
|
4665
4653
|
// Inner component (must be wrapped before export)
|
|
4666
4654
|
const _InnerPopover = forwardRef((props, ref) => {
|
|
4655
|
+
var _styles$popover;
|
|
4667
4656
|
const {
|
|
4668
4657
|
anchorRef,
|
|
4669
4658
|
as: Component = 'div',
|
|
@@ -4731,7 +4720,9 @@ const _InnerPopover = forwardRef((props, ref) => {
|
|
|
4731
4720
|
theme,
|
|
4732
4721
|
elevation: Math.min(elevation || 0, 5),
|
|
4733
4722
|
position
|
|
4734
|
-
})
|
|
4723
|
+
}),
|
|
4724
|
+
// Do not show the popover while it's not properly placed
|
|
4725
|
+
!((_styles$popover = styles.popover) !== null && _styles$popover !== void 0 && _styles$popover.transform) ? VISUALLY_HIDDEN : undefined),
|
|
4735
4726
|
style: styles.popover
|
|
4736
4727
|
}, attributes.popper), unmountSentinel, /*#__PURE__*/React__default.createElement(ClickAwayProvider, {
|
|
4737
4728
|
callback: closeOnClickAway && onClose,
|