reshaped 2.11.6 → 2.11.8

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.
@@ -1 +1 @@
1
- @layer rs.reset{.root{background:none;border:0;color:inherit;display:inline-block;font-size:inherit;font-weight:inherit;line-height:inherit;margin:0;padding:0;text-align:initial;text-decoration:none;vertical-align:top;-webkit-tap-highlight-color:transparent}.root:focus{outline:none;z-index:var(--rs-z-index-raised)}[role=button].root,button.root{cursor:pointer;user-select:none}.root.--disabled,.root[disabled]{cursor:not-allowed}.root.--disabled:active,.root[disabled]:active{transform:none}.--full-width{width:100%}[data-rs-keyboard] .root:focus{box-shadow:var(--rs-focus-shadow)}[data-rs-keyboard] .root.--inset:focus{box-shadow:var(--rs-focus-inset-shadow)}[data-rs-keyboard] .root.--radius-inherit:focus{box-shadow:none}[data-rs-keyboard] .root.--radius-inherit:focus>*{box-shadow:var(--rs-focus-shadow)}[data-rs-keyboard] .root.--radius-inherit.--inset:focus>*{box-shadow:var(--rs-focus-inset-shadow)}}
1
+ @layer rs.reset{.root{background:none;border:0;color:inherit;display:inline-block;font-size:inherit;font-weight:inherit;line-height:inherit;margin:0;padding:0;position:relative;text-align:initial;text-decoration:none;vertical-align:top;-webkit-tap-highlight-color:transparent}}.root:focus{outline:none}.root:focus-visible{box-shadow:var(--rs-focus-shadow);outline:none;z-index:var(--rs-z-index-raised)}.root.--inset:focus{box-shadow:var(--rs-focus-inset-shadow)}.root.--radius-inherit:focus-visible{box-shadow:none}.root.--radius-inherit:focus-visible>*{box-shadow:var(--rs-focus-shadow)}.root.--radius-inherit.--inset:focus-visible>*{box-shadow:var(--rs-focus-inset-shadow)}[role=button].root,button.root{cursor:pointer;user-select:none}.root.--disabled,.root[disabled]{cursor:not-allowed}.root.--disabled:active,.root[disabled]:active{transform:none}.root.--full-width{width:100%}
@@ -17,3 +17,4 @@ export declare const width: () => import("react").JSX.Element;
17
17
  export declare const variant: () => import("react").JSX.Element;
18
18
  export declare const padding: () => import("react").JSX.Element;
19
19
  export declare const triggerType: () => import("react").JSX.Element;
20
+ export declare const edgeCases: () => import("react").JSX.Element;
@@ -12,6 +12,7 @@ var __rest = (this && this.__rest) || function (s, e) {
12
12
  import { Example } from "../../../utilities/storybook/index.js";
13
13
  import View from "../../View/index.js";
14
14
  import Popover from "../index.js";
15
+ import Tooltip from "../../Tooltip/index.js";
15
16
  import Button from "../../Button/index.js";
16
17
  export default {
17
18
  title: "Components/Popover",
@@ -104,3 +105,22 @@ export const triggerType = () => (<Example>
104
105
  <Demo triggerType="hover"/>
105
106
  </Example.Item>
106
107
  </Example>);
108
+ export const edgeCases = () => (<Example>
109
+ <Example.Item title="Popover with tooltip">
110
+ <Tooltip position="top" text="Hello">
111
+ {(tooltipAttributes) => (<Popover position="bottom">
112
+ <Popover.Trigger>
113
+ {(attributes) => (<Button attributes={Object.assign(Object.assign({}, attributes), tooltipAttributes)}>
114
+ Open
115
+ </Button>)}
116
+ </Popover.Trigger>
117
+ <Popover.Content>
118
+ <View gap={2} align="start">
119
+ Popover content
120
+ <Button onClick={() => { }}>Button</Button>
121
+ </View>
122
+ </Popover.Content>
123
+ </Popover>)}
124
+ </Tooltip>
125
+ </Example.Item>
126
+ </Example>);
@@ -15,8 +15,10 @@ import { checkTransitions } from "../../../utilities/animation.js";
15
15
  import { Provider, useFlyoutContext } from "./Flyout.context.js";
16
16
  const FlyoutRoot = (props) => {
17
17
  const { triggerType = "click", onOpen, onClose, children, forcePosition, trapFocusMode, width, disableHideAnimation, contentGap, contentClassName, contentAttributes, position: passedPosition, active: passedActive, id: passedId, instanceRef, } = props;
18
+ const parentFlyoutContext = useFlyoutContext();
18
19
  const [isRTL] = useRTL();
19
- const triggerElRef = React.useRef(null);
20
+ const internalTriggerElRef = React.useRef(null);
21
+ const triggerElRef = (parentFlyoutContext === null || parentFlyoutContext === void 0 ? void 0 : parentFlyoutContext.triggerElRef) || internalTriggerElRef;
20
22
  const flyoutElRef = React.useRef(null);
21
23
  const id = useElementId(passedId);
22
24
  const timerRef = React.useRef();
@@ -31,7 +33,6 @@ const FlyoutRoot = (props) => {
31
33
  defaultActive: passedActive,
32
34
  forcePosition,
33
35
  });
34
- const parentFlyoutContext = useFlyoutContext();
35
36
  const { status, updatePosition, render, hide, remove } = flyout;
36
37
  // Don't create dismissible queue for hover flyout because they close all together on mouseout
37
38
  const isDismissible = useIsDismissible(triggerType !== "hover" && status !== "idle", flyoutElRef, triggerElRef);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "reshaped",
3
3
  "description": "Professionally crafted design system in React & Figma for building products of any scale and complexity",
4
- "version": "2.11.6",
4
+ "version": "2.11.8",
5
5
  "license": "MIT",
6
6
  "email": "hello@reshaped.so",
7
7
  "homepage": "https://reshaped.so",