@sanity-labs/ui-poc 0.0.1-alpha.15 → 0.0.1-alpha.16

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/dist/index.d.ts CHANGED
@@ -592,6 +592,17 @@ declare type PositionProps = {
592
592
  left?: Responsive<SpaceAuto>
593
593
  }
594
594
 
595
+ /** @public */
596
+ export declare function PressArea<T extends ElementType = 'button'>(
597
+ props: PressAreaProps<T> & Omit<ComponentPropsWithRef<T>, keyof PressAreaProps<T>>,
598
+ ): JSX.Element
599
+
600
+ /** @public */
601
+ declare interface PressAreaProps<T extends React.ElementType> {
602
+ /** Element to render */
603
+ as?: InteractiveAs<T>
604
+ }
605
+
595
606
  /** @beta */
596
607
  export declare function Radio(props: RadioProps): JSX.Element
597
608
 
package/dist/index.js CHANGED
@@ -1431,11 +1431,14 @@ function Tooltip({ placement = "bottom", ...props }) {
1431
1431
  }, [dismissed]);
1432
1432
  const trigger = cloneElement(children, {
1433
1433
  "aria-describedby": id,
1434
- onBlur: (e) => {
1435
- children.props.onBlur?.(e), setDismissed(!1);
1434
+ onMouseEnter: (e) => {
1435
+ setDismissed(!1), children.props.onMouseEnter?.(e);
1436
1436
  },
1437
- onMouseLeave: (e) => {
1438
- children.props.onMouseLeave?.(e), setDismissed(!1);
1437
+ onFocus: (e) => {
1438
+ setDismissed(!1), children.props.onFocus?.(e);
1439
+ },
1440
+ onClick: (e) => {
1441
+ setDismissed(!0), children.props.onClick?.(e);
1439
1442
  },
1440
1443
  style: {
1441
1444
  ...children.props.style,
@@ -1522,6 +1525,24 @@ function VStack(props) {
1522
1525
  }
1523
1526
  );
1524
1527
  }
1528
+ const pressAreaProps = {
1529
+ as: {
1530
+ type: "string"
1531
+ }
1532
+ };
1533
+ function PressArea(props) {
1534
+ const { as, children, className, style, ...rest } = getProps(props, pressAreaProps);
1535
+ return /* @__PURE__ */ jsx(
1536
+ as || "button",
1537
+ {
1538
+ className: classNames("sui-PressArea", "sui-width-full", className),
1539
+ style,
1540
+ "data-ui": "PressArea",
1541
+ ...rest,
1542
+ children
1543
+ }
1544
+ );
1545
+ }
1525
1546
  export {
1526
1547
  Box,
1527
1548
  Button,
@@ -1542,6 +1563,7 @@ export {
1542
1563
  Label,
1543
1564
  Link,
1544
1565
  List,
1566
+ PressArea,
1545
1567
  Radio,
1546
1568
  SkipToContent,
1547
1569
  Spinner,