@atlaskit/top-layer 0.16.0 → 0.18.0

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.
Files changed (141) hide show
  1. package/AGENTS.md +113 -0
  2. package/CHANGELOG.md +14 -0
  3. package/README.md +4 -4
  4. package/animations/package.json +1 -8
  5. package/dialog/package.json +1 -8
  6. package/dialog-scroll-lock/package.json +1 -8
  7. package/dist/cjs/animations/presets.js +96 -9
  8. package/dist/cjs/dialog/dialog-content.js +12 -30
  9. package/dist/cjs/entry-points/animations.js +12 -0
  10. package/dist/cjs/internal/set-style.js +5 -5
  11. package/dist/cjs/internal/slot.js +1 -1
  12. package/dist/cjs/internal/use-anchor-position-at-point.js +8 -8
  13. package/dist/cjs/internal/use-anchor-position.js +19 -40
  14. package/dist/cjs/internal/use-animated-visibility.js +31 -61
  15. package/dist/cjs/internal/use-initial-focus.js +9 -13
  16. package/dist/cjs/internal/use-width-from-anchor.js +6 -6
  17. package/dist/cjs/popover/popover.js +30 -58
  18. package/dist/cjs/popover-surface/popover-surface.js +4 -3
  19. package/dist/cjs/testing/polyfill.js +9 -9
  20. package/dist/cjs/use-simple-light-dismiss/index.js +3 -3
  21. package/dist/es2019/animations/presets.js +145 -2
  22. package/dist/es2019/dialog/dialog-content.js +12 -30
  23. package/dist/es2019/entry-points/animations.js +1 -1
  24. package/dist/es2019/internal/set-style.js +5 -5
  25. package/dist/es2019/internal/slot.js +1 -1
  26. package/dist/es2019/internal/use-anchor-position-at-point.js +8 -8
  27. package/dist/es2019/internal/use-anchor-position.js +19 -40
  28. package/dist/es2019/internal/use-animated-visibility.js +31 -61
  29. package/dist/es2019/internal/use-initial-focus.js +9 -13
  30. package/dist/es2019/internal/use-width-from-anchor.js +6 -6
  31. package/dist/es2019/popover/popover.js +30 -58
  32. package/dist/es2019/popover-surface/popover-surface.js +1 -1
  33. package/dist/es2019/testing/polyfill.js +7 -11
  34. package/dist/es2019/use-simple-light-dismiss/index.js +3 -3
  35. package/dist/esm/animations/presets.js +93 -9
  36. package/dist/esm/dialog/dialog-content.js +12 -30
  37. package/dist/esm/entry-points/animations.js +1 -1
  38. package/dist/esm/internal/set-style.js +5 -5
  39. package/dist/esm/internal/slot.js +1 -1
  40. package/dist/esm/internal/use-anchor-position-at-point.js +8 -8
  41. package/dist/esm/internal/use-anchor-position.js +19 -40
  42. package/dist/esm/internal/use-animated-visibility.js +31 -61
  43. package/dist/esm/internal/use-initial-focus.js +9 -13
  44. package/dist/esm/internal/use-width-from-anchor.js +6 -6
  45. package/dist/esm/popover/popover.js +30 -58
  46. package/dist/esm/popover-surface/popover-surface.js +1 -1
  47. package/dist/esm/testing/polyfill.js +9 -9
  48. package/dist/esm/use-simple-light-dismiss/index.js +3 -3
  49. package/dist/types/animations/presets.d.ts +16 -0
  50. package/dist/types/entry-points/animations.d.ts +1 -1
  51. package/dist/types/internal/set-style.d.ts +2 -2
  52. package/dist/types/internal/slot.d.ts +2 -2
  53. package/dist/types/internal/use-anchor-position-at-point.d.ts +2 -2
  54. package/dist/types/internal/use-anchor-position.d.ts +0 -4
  55. package/dist/types/internal/use-initial-focus.d.ts +1 -1
  56. package/dist/types/popover/types.d.ts +5 -7
  57. package/dist/types/popover-surface/popover-surface.d.ts +2 -2
  58. package/focus/package.json +1 -8
  59. package/get-aria-for-trigger/package.json +1 -8
  60. package/open-layer-observer/package.json +1 -8
  61. package/package.json +3 -3
  62. package/placement-map/package.json +1 -8
  63. package/popover/package.json +1 -8
  64. package/popover-surface/package.json +1 -8
  65. package/testing/polyfill/package.json +1 -8
  66. package/testing/to-be-visible/package.json +1 -8
  67. package/use-anchor-position/package.json +1 -8
  68. package/use-anchor-position-at-point/package.json +1 -8
  69. package/use-arrow-navigation/package.json +1 -8
  70. package/use-popover-id/package.json +1 -8
  71. package/use-simple-light-dismiss/package.json +1 -8
  72. package/use-width-from-anchor/package.json +1 -8
  73. package/dist/types-ts4.5/animations/presets.d.ts +0 -94
  74. package/dist/types-ts4.5/animations/types.d.ts +0 -38
  75. package/dist/types-ts4.5/dialog/create-close-event.d.ts +0 -23
  76. package/dist/types-ts4.5/dialog/dialog-content.d.ts +0 -24
  77. package/dist/types-ts4.5/dialog/index.d.ts +0 -3
  78. package/dist/types-ts4.5/dialog/types.d.ts +0 -126
  79. package/dist/types-ts4.5/dialog-scroll-lock/index.d.ts +0 -40
  80. package/dist/types-ts4.5/entry-points/animations.d.ts +0 -2
  81. package/dist/types-ts4.5/entry-points/dialog-scroll-lock.d.ts +0 -1
  82. package/dist/types-ts4.5/entry-points/dialog.d.ts +0 -2
  83. package/dist/types-ts4.5/entry-points/focus.d.ts +0 -4
  84. package/dist/types-ts4.5/entry-points/get-aria-for-trigger.d.ts +0 -1
  85. package/dist/types-ts4.5/entry-points/open-layer-observer.d.ts +0 -5
  86. package/dist/types-ts4.5/entry-points/placement-map.d.ts +0 -3
  87. package/dist/types-ts4.5/entry-points/popover-surface.d.ts +0 -2
  88. package/dist/types-ts4.5/entry-points/popover.d.ts +0 -2
  89. package/dist/types-ts4.5/entry-points/use-anchor-position-at-point.d.ts +0 -1
  90. package/dist/types-ts4.5/entry-points/use-anchor-position.d.ts +0 -1
  91. package/dist/types-ts4.5/entry-points/use-arrow-navigation.d.ts +0 -3
  92. package/dist/types-ts4.5/entry-points/use-popover-id.d.ts +0 -11
  93. package/dist/types-ts4.5/entry-points/use-simple-light-dismiss.d.ts +0 -2
  94. package/dist/types-ts4.5/entry-points/use-width-from-anchor.d.ts +0 -1
  95. package/dist/types-ts4.5/focus/get-first-focusable.d.ts +0 -8
  96. package/dist/types-ts4.5/focus/get-focusables.d.ts +0 -13
  97. package/dist/types-ts4.5/focus/get-last-focusable.d.ts +0 -8
  98. package/dist/types-ts4.5/focus/get-next-focusable.d.ts +0 -13
  99. package/dist/types-ts4.5/focus/is-in-same-layer.d.ts +0 -8
  100. package/dist/types-ts4.5/focus/is-nested-layer-focused.d.ts +0 -8
  101. package/dist/types-ts4.5/focus/selectors.d.ts +0 -4
  102. package/dist/types-ts4.5/focus/types.d.ts +0 -5
  103. package/dist/types-ts4.5/index.d.ts +0 -0
  104. package/dist/types-ts4.5/internal/anchor-positioning-fallback.d.ts +0 -26
  105. package/dist/types-ts4.5/internal/combine.d.ts +0 -14
  106. package/dist/types-ts4.5/internal/ensure-preset-styles.d.ts +0 -6
  107. package/dist/types-ts4.5/internal/get-aria-for-trigger.d.ts +0 -93
  108. package/dist/types-ts4.5/internal/placement-to-position-area.d.ts +0 -21
  109. package/dist/types-ts4.5/internal/placement-to-try-fallbacks.d.ts +0 -36
  110. package/dist/types-ts4.5/internal/reduced-motion.d.ts +0 -14
  111. package/dist/types-ts4.5/internal/resolve-css-length-to-pixels.d.ts +0 -20
  112. package/dist/types-ts4.5/internal/resolve-css-length.d.ts +0 -8
  113. package/dist/types-ts4.5/internal/resolve-placement.d.ts +0 -58
  114. package/dist/types-ts4.5/internal/role-to-aria-has-popup.d.ts +0 -13
  115. package/dist/types-ts4.5/internal/role-types.d.ts +0 -71
  116. package/dist/types-ts4.5/internal/set-style.d.ts +0 -11
  117. package/dist/types-ts4.5/internal/should-focus-into-popover.d.ts +0 -8
  118. package/dist/types-ts4.5/internal/slot.d.ts +0 -29
  119. package/dist/types-ts4.5/internal/use-anchor-position-at-point.d.ts +0 -67
  120. package/dist/types-ts4.5/internal/use-anchor-position.d.ts +0 -91
  121. package/dist/types-ts4.5/internal/use-animated-visibility.d.ts +0 -109
  122. package/dist/types-ts4.5/internal/use-animation-preset.d.ts +0 -11
  123. package/dist/types-ts4.5/internal/use-focus-wrap.d.ts +0 -25
  124. package/dist/types-ts4.5/internal/use-initial-focus.d.ts +0 -73
  125. package/dist/types-ts4.5/internal/use-preset-styles.d.ts +0 -15
  126. package/dist/types-ts4.5/internal/use-width-from-anchor.d.ts +0 -21
  127. package/dist/types-ts4.5/placement-map/index.d.ts +0 -51
  128. package/dist/types-ts4.5/placement-map/legacy-placements.d.ts +0 -27
  129. package/dist/types-ts4.5/placement-map/placement-mapping.d.ts +0 -13
  130. package/dist/types-ts4.5/popover/create-close-event.d.ts +0 -25
  131. package/dist/types-ts4.5/popover/index.d.ts +0 -3
  132. package/dist/types-ts4.5/popover/popover.d.ts +0 -17
  133. package/dist/types-ts4.5/popover/types.d.ts +0 -193
  134. package/dist/types-ts4.5/popover-surface/index.d.ts +0 -2
  135. package/dist/types-ts4.5/popover-surface/popover-surface.d.ts +0 -21
  136. package/dist/types-ts4.5/testing/polyfill.d.ts +0 -25
  137. package/dist/types-ts4.5/testing/to-be-visible.d.ts +0 -23
  138. package/dist/types-ts4.5/use-arrow-navigation/index.d.ts +0 -3
  139. package/dist/types-ts4.5/use-arrow-navigation/is-at-current-menu-level.d.ts +0 -48
  140. package/dist/types-ts4.5/use-arrow-navigation/use-arrow-navigation.d.ts +0 -102
  141. package/dist/types-ts4.5/use-simple-light-dismiss/index.d.ts +0 -45
@@ -1,2 +1,2 @@
1
- export { slideAndFade, fade, scaleAndFade, dialogSlideUpAndFade, dialogFade, } from '../animations/presets';
1
+ export { dialogMotion, popupMotion, slideAndFade, fade, scaleAndFade, dialogSlideUpAndFade, dialogFade, } from '../animations/presets';
2
2
  export type { TAnimationPreset } from '../animations/types';
@@ -2,8 +2,8 @@
2
2
  * Sets inline styles on an element and returns a cleanup function that
3
3
  * restores the prior inline values (so we do not stomp consumer styles).
4
4
  */
5
- export declare function setStyle({ el, styles, }: {
6
- el: HTMLElement;
5
+ export declare function setStyle({ element, styles, }: {
6
+ element: HTMLElement;
7
7
  styles: Array<{
8
8
  property: string;
9
9
  value: string;
@@ -2,7 +2,7 @@ import { type ForwardRefExoticComponent, type ReactNode, type RefAttributes } fr
2
2
  /**
3
3
  * Extra DOM/event props are passed through to the cloned child.
4
4
  */
5
- export type SlotProps = {
5
+ export type TSlotProps = {
6
6
  children: ReactNode;
7
7
  } & Record<string, unknown>;
8
8
  /**
@@ -26,4 +26,4 @@ export type SlotProps = {
26
26
  * </Slot>
27
27
  * ```
28
28
  */
29
- export declare const Slot: ForwardRefExoticComponent<SlotProps & RefAttributes<HTMLElement>>;
29
+ export declare const Slot: ForwardRefExoticComponent<TSlotProps & RefAttributes<HTMLElement>>;
@@ -5,7 +5,7 @@ import { type TPlacementOptions } from './resolve-placement';
5
5
  * anchor should be placed.
6
6
  *
7
7
  * Axis-named (`x`/`y`) rather than edge-named (`left`/`top`) so the
8
- * shape is unambiguous in RTL writing modes — there is no ambiguity
8
+ * shape is unambiguous in RTL writing modes - there is no ambiguity
9
9
  * about whether a coordinate is logical (`inline-start`/`block-start`)
10
10
  * or physical (`left`/`top`). Viewport coordinates are always
11
11
  * physical, so we name them with the physical axis labels.
@@ -48,7 +48,7 @@ export declare function useAnchorPositionAtPoint({ popoverRef, placement, getPoi
48
48
  * Called once per activation (every `isEnabled: false → true`
49
49
  * transition); the result is latched and not re-read.
50
50
  *
51
- * Return `null` to signal "no point yet" — the hook stays in a
51
+ * Return `null` to signal "no point yet" - the hook stays in a
52
52
  * no-DOM state so another positioning strategy can own the popover.
53
53
  *
54
54
  * Read from a ref, so it does not need to be memoized.
@@ -29,10 +29,6 @@ import { type TPlacementOptions } from '../internal/resolve-placement';
29
29
  * When not supported, it falls back to JavaScript-based positioning using
30
30
  * `position: fixed` with measured coordinates, re-running on scroll (capture)
31
31
  * and resize events.
32
- *
33
- * `placement` may be a fresh inline object on every render: a structural
34
- * comparison is used internally so re-runs are skipped when the resolved
35
- * placement shape is unchanged.
36
32
  */
37
33
  export declare function useAnchorPosition({ anchorRef, popoverRef, placement, forceFallbackPositioning, isEnabled, isOpen, }: {
38
34
  /**
@@ -30,7 +30,7 @@ import { type TPhase } from './use-animated-visibility';
30
30
  * `<dialog>.close()`. If the consumer reopens before the exit transition
31
31
  * has settled, the phase machine jumps `exiting → entering` without
32
32
  * passing through `closed`, so without this branch the popup would be
33
- * visible again with focus stranded on the trigger — a keyboard usability
33
+ * visible again with focus stranded on the trigger - a keyboard usability
34
34
  * gap for menu/dialog/listbox roles.
35
35
  *
36
36
  * Note: there is a rare programmatic path where a consumer flips `isOpen`
@@ -15,12 +15,10 @@ export type TPopoverCloseReason = 'escape' | 'light-dismiss' | 'programmatic';
15
15
  /**
16
16
  * Flat (non-discriminated) props accepted by the Popover component internally.
17
17
  *
18
- * TypeScript limitation: when PopupContent destructures props from a
19
- * discriminated union (role, label, labelledBy) and re-passes them individually
20
- * to Popover, TypeScript cannot prove the individual fields still satisfy the
21
- * union constraint. This flat type accepts all role/label combinations without
22
- * the union, since ARIA correctness is enforced at the TPopupContentProps
23
- * boundary where consumers interact.
18
+ * Used by wrappers like `PopupContent` that destructure props from a
19
+ * discriminated union and re-pass the individual fields: TypeScript cannot
20
+ * prove the fields still satisfy the union. ARIA correctness is enforced at
21
+ * the `TPopupContentProps` boundary where consumers interact.
24
22
  */
25
23
  export type TPopoverForwardedProps = TPopoverBaseProps & {
26
24
  mode?: 'auto' | 'hint' | 'manual';
@@ -65,7 +63,7 @@ type TPopoverBaseProps = {
65
63
  * animation plays (via `allow-discrete`) before the popover becomes logically closed.
66
64
  * Otherwise hides instantly.
67
65
  *
68
- * The consumer does not conditionally render the `Popover` — visibility is driven
66
+ * The consumer does not conditionally render the `Popover` - visibility is driven
69
67
  * by this prop.
70
68
  *
71
69
  * **Lifecycle observable to consumers:**
@@ -2,7 +2,7 @@
2
2
  * @jsxRuntime classic
3
3
  * @jsx jsx
4
4
  */
5
- import React, { type ReactNode } from 'react';
5
+ import { type ReactNode } from 'react';
6
6
  export type TPopoverSurfaceProps = {
7
7
  children: ReactNode;
8
8
  };
@@ -18,4 +18,4 @@ export type TPopoverSurfaceProps = {
18
18
  * `Popover` instead. `PopoverSurface` is the no-config "give me the default
19
19
  * ADS overlay look" surface, nothing more.
20
20
  */
21
- export declare function PopoverSurface({ children }: TPopoverSurfaceProps): React.ReactElement;
21
+ export declare function PopoverSurface({ children }: TPopoverSurfaceProps): ReactNode;
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "*.compiled.css"
8
8
  ],
9
- "types": "../dist/types/entry-points/focus.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../dist/types-ts4.5/entry-points/focus.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../dist/types/entry-points/focus.d.ts"
17
10
  }
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "*.compiled.css"
8
8
  ],
9
- "types": "../dist/types/entry-points/get-aria-for-trigger.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../dist/types-ts4.5/entry-points/get-aria-for-trigger.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../dist/types/entry-points/get-aria-for-trigger.d.ts"
17
10
  }
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "*.compiled.css"
8
8
  ],
9
- "types": "../dist/types/entry-points/open-layer-observer.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../dist/types-ts4.5/entry-points/open-layer-observer.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../dist/types/entry-points/open-layer-observer.d.ts"
17
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/top-layer",
3
- "version": "0.16.0",
3
+ "version": "0.18.0",
4
4
  "description": "Low-level layering primitives based on popover and dialog",
5
5
  "homepage": "https://atlassian.design/components/top-layer",
6
6
  "repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
@@ -38,7 +38,7 @@
38
38
  "@atlaskit/css": "^0.19.0",
39
39
  "@atlaskit/ds-lib": "^7.0.0",
40
40
  "@atlaskit/layering": "^3.8.0",
41
- "@atlaskit/tokens": "^13.3.0",
41
+ "@atlaskit/tokens": "^13.4.0",
42
42
  "@babel/runtime": "^7.0.0",
43
43
  "@compiled/react": "^0.20.0",
44
44
  "bind-event-listener": "^3.0.0",
@@ -53,7 +53,7 @@
53
53
  "@af/visual-regression": "workspace:^",
54
54
  "@atlaskit/button": "^23.11.0",
55
55
  "@atlaskit/heading": "^5.4.0",
56
- "@atlaskit/lozenge": "^13.8.0",
56
+ "@atlaskit/lozenge": "^13.9.0",
57
57
  "@atlaskit/primitives": "^19.0.0",
58
58
  "@atlaskit/ssr": "workspace:^",
59
59
  "@atlaskit/textfield": "^8.3.0",
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "*.compiled.css"
8
8
  ],
9
- "types": "../dist/types/entry-points/placement-map.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../dist/types-ts4.5/entry-points/placement-map.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../dist/types/entry-points/placement-map.d.ts"
17
10
  }
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "*.compiled.css"
8
8
  ],
9
- "types": "../dist/types/entry-points/popover.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../dist/types-ts4.5/entry-points/popover.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../dist/types/entry-points/popover.d.ts"
17
10
  }
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "*.compiled.css"
8
8
  ],
9
- "types": "../dist/types/entry-points/popover-surface.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../dist/types-ts4.5/entry-points/popover-surface.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../dist/types/entry-points/popover-surface.d.ts"
17
10
  }
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "*.compiled.css"
8
8
  ],
9
- "types": "../../dist/types/testing/polyfill.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../../dist/types-ts4.5/testing/polyfill.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../../dist/types/testing/polyfill.d.ts"
17
10
  }
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "*.compiled.css"
8
8
  ],
9
- "types": "../../dist/types/testing/to-be-visible.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../../dist/types-ts4.5/testing/to-be-visible.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../../dist/types/testing/to-be-visible.d.ts"
17
10
  }
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "*.compiled.css"
8
8
  ],
9
- "types": "../dist/types/entry-points/use-anchor-position.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../dist/types-ts4.5/entry-points/use-anchor-position.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../dist/types/entry-points/use-anchor-position.d.ts"
17
10
  }
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "*.compiled.css"
8
8
  ],
9
- "types": "../dist/types/entry-points/use-anchor-position-at-point.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../dist/types-ts4.5/entry-points/use-anchor-position-at-point.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../dist/types/entry-points/use-anchor-position-at-point.d.ts"
17
10
  }
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "*.compiled.css"
8
8
  ],
9
- "types": "../dist/types/entry-points/use-arrow-navigation.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../dist/types-ts4.5/entry-points/use-arrow-navigation.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../dist/types/entry-points/use-arrow-navigation.d.ts"
17
10
  }
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "*.compiled.css"
8
8
  ],
9
- "types": "../dist/types/entry-points/use-popover-id.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../dist/types-ts4.5/entry-points/use-popover-id.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../dist/types/entry-points/use-popover-id.d.ts"
17
10
  }
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "*.compiled.css"
8
8
  ],
9
- "types": "../dist/types/entry-points/use-simple-light-dismiss.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../dist/types-ts4.5/entry-points/use-simple-light-dismiss.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../dist/types/entry-points/use-simple-light-dismiss.d.ts"
17
10
  }
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "*.compiled.css"
8
8
  ],
9
- "types": "../dist/types/entry-points/use-width-from-anchor.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../dist/types-ts4.5/entry-points/use-width-from-anchor.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../dist/types/entry-points/use-width-from-anchor.d.ts"
17
10
  }
@@ -1,94 +0,0 @@
1
- import { type TAnimationPreset } from './types';
2
- type TSlideAndFadeOptions = {
3
- /**
4
- * Slide distance in pixels. Defaults to `4`.
5
- */
6
- distance?: number;
7
- };
8
- /**
9
- * Directional slide + opacity animation.
10
- *
11
- * The popover slides in from the direction opposite its placement edge
12
- * (e.g. a `block-end` popover slides down from above).
13
- *
14
- * @param options.distance - Slide distance in pixels. Defaults to `4`.
15
- *
16
- * @example
17
- * ```tsx
18
- * import { slideAndFade } from '@atlaskit/top-layer/animations';
19
- *
20
- * // Default 4px slide (tooltip)
21
- * <Popover animate={slideAndFade()} />
22
- *
23
- * // Custom 8px slide (popup / dropdown)
24
- * <Popover animate={slideAndFade({ distance: 8 })} />
25
- * ```
26
- */
27
- export declare function slideAndFade(options?: TSlideAndFadeOptions): TAnimationPreset;
28
- /**
29
- * Simple opacity transition, no transform.
30
- *
31
- * Suitable for popup dialogs or content that does not need directional motion.
32
- *
33
- * @example
34
- * ```tsx
35
- * import { fade } from '@atlaskit/top-layer/animations';
36
- *
37
- * <Popover animate={fade()} />
38
- * ```
39
- */
40
- export declare function fade(): TAnimationPreset;
41
- /**
42
- * Scale from 0.95 + opacity transition.
43
- *
44
- * Suitable for menus, dropdowns, and select options.
45
- *
46
- * @example
47
- * ```tsx
48
- * import { scaleAndFade } from '@atlaskit/top-layer/animations';
49
- *
50
- * <Popover animate={scaleAndFade()} />
51
- * ```
52
- */
53
- export declare function scaleAndFade(): TAnimationPreset;
54
- type TDialogSlideUpAndFadeOptions = {
55
- /**
56
- * Slide distance in pixels. Defaults to `12`.
57
- */
58
- distance?: number;
59
- };
60
- /**
61
- * Slide up + opacity animation for dialogs.
62
- *
63
- * Entry slides up from below; exit slides up and out (asymmetric).
64
- * Includes backdrop fade animation.
65
- *
66
- * @param options.distance - Slide distance in pixels. Defaults to `12`.
67
- *
68
- * @example
69
- * ```tsx
70
- * import { dialogSlideUpAndFade } from '@atlaskit/top-layer/animations';
71
- *
72
- * const animation = dialogSlideUpAndFade();
73
- * <Dialog animate={animation} isOpen={isOpen} onClose={handleClose} label="...">
74
- * ...
75
- * </Dialog>
76
- * ```
77
- */
78
- export declare function dialogSlideUpAndFade(options?: TDialogSlideUpAndFadeOptions): TAnimationPreset;
79
- /**
80
- * Simple opacity transition for dialogs, no transform.
81
- *
82
- * Includes backdrop fade animation.
83
- *
84
- * @example
85
- * ```tsx
86
- * import { dialogFade } from '@atlaskit/top-layer/animations';
87
- *
88
- * <Dialog animate={dialogFade()} isOpen={isOpen} onClose={handleClose} label="...">
89
- * ...
90
- * </Dialog>
91
- * ```
92
- */
93
- export declare function dialogFade(): TAnimationPreset;
94
- export {};
@@ -1,38 +0,0 @@
1
- import type { TPlacementOptions } from '../internal/resolve-placement';
2
- /**
3
- * A self-contained animation preset for top-layer elements (popovers and dialogs).
4
- *
5
- * Contains the CSS rules (injected once into `<head>`), a data-attribute name
6
- * for CSS targeting, optional per-placement custom properties, and the exit
7
- * duration used for a `transitionend` fallback timeout.
8
- *
9
- * Entry animation uses `@starting-style`.
10
- * Exit animation uses `allow-discrete` on `display`/`overlay` to keep the
11
- * element visible in the top layer while CSS transitions play.
12
- */
13
- export type TAnimationPreset = {
14
- /**
15
- * CSS to inject once into `document.head`, scoped via a data attribute
16
- * (e.g. `[data-ds-popover-{name}]` or `[data-ds-dialog-{name}]`).
17
- */
18
- css: string;
19
- /**
20
- * Data attribute suffix for CSS targeting (e.g. `'slide-and-fade'`).
21
- */
22
- name: string;
23
- /**
24
- * Per-placement CSS custom properties (e.g. directional offset for
25
- * `slideAndFade`). Only used by popover presets that vary by placement.
26
- */
27
- getProperties?: (args: {
28
- placement: TPlacementOptions;
29
- }) => Record<string, string>;
30
- /**
31
- * Entry duration in ms (for `transitionend` fallback timeout on open).
32
- */
33
- enterDurationMs: number;
34
- /**
35
- * Exit duration in ms (for `transitionend` fallback timeout on close).
36
- */
37
- exitDurationMs: number;
38
- };
@@ -1,23 +0,0 @@
1
- import type { TDialogCloseReason } from './types';
2
- /**
3
- * Creates a synthetic DOM event from a `TDialogCloseReason`.
4
- *
5
- * Useful when bridging the Dialog primitive's `onClose({ reason })` callback
6
- * to a legacy API that expects a `KeyboardEvent` or `MouseEvent` - for example,
7
- * `@atlaskit/modal-dialog`'s `onClose(event, analyticsEvent)` contract.
8
- *
9
- * - `'escape'` → `KeyboardEvent('keydown', { key: 'Escape' })`
10
- * - `'overlay-click'` → `MouseEvent('click')`
11
- *
12
- * @example
13
- * ```tsx
14
- * import { createCloseEvent, type TDialogCloseReason } from '@atlaskit/top-layer/dialog';
15
- *
16
- * function onDialogClose({ reason }: { reason: TDialogCloseReason }) {
17
- * legacyOnClose(createCloseEvent({ reason }));
18
- * }
19
- * ```
20
- */
21
- export declare function createCloseEvent({ reason, }: {
22
- reason: TDialogCloseReason;
23
- }): KeyboardEvent | MouseEvent;
@@ -1,24 +0,0 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
- import React from 'react';
6
- import { type TDialogProps } from './types';
7
- /**
8
- * Low-level `<dialog>` primitive. No visual opinions - no width, height,
9
- * background, border-radius, or layout. Consumers provide their own styling.
10
- *
11
- * Visibility is controlled declaratively via `isOpen`:
12
- * - `isOpen={true}` calls `.showModal()` (entry animation via `@starting-style`)
13
- * - `isOpen={false}` calls `.close()` (exit animation via `allow-discrete`)
14
- *
15
- * Handles native `cancel` event (Escape) and backdrop click detection.
16
- *
17
- * Close flow: we never call `dialog.close()` from event handlers. We always call
18
- * `onClose`; the consumer decides whether to set `isOpen={false}`.
19
- *
20
- * Accessibility: render at least one focusable element (typically a close
21
- * button) when `isOpen` becomes `true`. Tab is always trapped inside the
22
- * dialog, so keyboard users need somewhere to land.
23
- */
24
- export declare const Dialog: React.ForwardRefExoticComponent<TDialogProps & React.RefAttributes<HTMLDialogElement>>;
@@ -1,3 +0,0 @@
1
- export { createCloseEvent } from './create-close-event';
2
- export { Dialog } from './dialog-content';
3
- export type { TDialogCloseReason, TDialogProps } from './types';