@sanity/ui 1.1.0 → 1.2.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.
@@ -72,6 +72,7 @@ export const _raf = cjs._raf;
72
72
  export const _raf2 = cjs._raf2;
73
73
  export const _responsive = cjs._responsive;
74
74
  export const attemptFocus = cjs.attemptFocus;
75
+ export const containsOrEqualsElement = cjs.containsOrEqualsElement;
75
76
  export const createColorTheme = cjs.createColorTheme;
76
77
  export const focusFirstDescendant = cjs.focusFirstDescendant;
77
78
  export const focusLastDescendant = cjs.focusLastDescendant;
package/dist/index.d.ts CHANGED
@@ -3519,6 +3519,11 @@ export declare const Container: ForwardRefExoticComponent<
3519
3519
  */
3520
3520
  export declare interface ContainerProps extends BoxProps, ResponsiveWidthProps {}
3521
3521
 
3522
+ /**
3523
+ * @internal
3524
+ */
3525
+ export declare function containsOrEqualsElement(element: HTMLElement, node: Node): boolean
3526
+
3522
3527
  /**
3523
3528
  * @public
3524
3529
  */
@@ -3934,6 +3939,8 @@ export declare interface DialogProps extends ResponsivePaddingProps, ResponsiveW
3934
3939
  footer?: React.ReactNode
3935
3940
  header?: React.ReactNode
3936
3941
  id: string
3942
+ /** A callback that fires when the dialog becomes the top layer when it was not the top layer before. */
3943
+ onActivate?: LayerProps['onActivate']
3937
3944
  onClickOutside?: () => void
3938
3945
  onClose?: () => void
3939
3946
  portal?: string
@@ -7680,13 +7687,12 @@ export declare const Layer: ForwardRefExoticComponent<
7680
7687
  RefAttributes<HTMLDivElement>
7681
7688
  >
7682
7689
 
7683
- /**
7684
- * @public
7685
- */
7690
+ /** @public */
7686
7691
  export declare interface LayerContextValue {
7687
7692
  version: 0.0
7688
7693
  isTopLayer: boolean
7689
- registerChild: () => () => void
7694
+ level?: number
7695
+ registerChild: (childLevel?: number) => () => void
7690
7696
  size: number
7691
7697
  zIndex: number
7692
7698
  }
@@ -7696,6 +7702,8 @@ export declare interface LayerContextValue {
7696
7702
  */
7697
7703
  export declare interface LayerProps {
7698
7704
  as?: React.ElementType | keyof JSX.IntrinsicElements
7705
+ /** A callback that fires when the layer becomes the top layer when it was not the top layer before. */
7706
+ onActivate?: (props: {activeElement: HTMLElement | null}) => void
7699
7707
  zOffset?: number | number[]
7700
7708
  }
7701
7709