asma-ui-core 3.118.0 → 3.120.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.
@@ -1,10 +1,10 @@
1
1
  import { tabbableWithin as p } from "../helpers/focusable.js";
2
2
  import { useEffect as d, useRef as y } from "react";
3
- var E = (c, i, s) => {
4
- const f = y(s);
3
+ var E = (c, i, u) => {
4
+ const f = y(u);
5
5
  d(() => {
6
- f.current = s;
7
- }, [s]), d(() => {
6
+ f.current = u;
7
+ }, [u]), d(() => {
8
8
  if (!c) return;
9
9
  const t = i.current;
10
10
  if (!t) return;
@@ -17,14 +17,14 @@ var E = (c, i, s) => {
17
17
  f.current?.();
18
18
  return;
19
19
  }
20
- if (e.key !== "Tab") return;
20
+ if (e.key !== "Tab" || e.defaultPrevented) return;
21
21
  const r = p(t);
22
22
  if (r.length === 0) {
23
23
  e.preventDefault();
24
24
  return;
25
25
  }
26
- const u = r[0], m = r[r.length - 1], o = document.activeElement;
27
- e.shiftKey && (o === u || o === t) ? (e.preventDefault(), m?.focus()) : (!e.shiftKey && o === m || !e.shiftKey && o === t) && (e.preventDefault(), u?.focus());
26
+ const s = r[0], m = r[r.length - 1], o = document.activeElement;
27
+ e.shiftKey && (o === s || o === t) ? (e.preventDefault(), m?.focus()) : (!e.shiftKey && o === m || !e.shiftKey && o === t) && (e.preventDefault(), s?.focus());
28
28
  };
29
29
  return document.addEventListener("keydown", l), () => {
30
30
  cancelAnimationFrame(b), document.removeEventListener("keydown", l), a === null ? t.removeAttribute("tabindex") : t.setAttribute("tabindex", a), requestAnimationFrame(() => {
@@ -5,11 +5,14 @@ import { StyledButtonProps } from '../../inputs/button';
5
5
  * Figma's `Parent=Filter` dot at top-right when `filterIsActive`.
6
6
  *
7
7
  * Custom props:
8
- * @param filterIsActive - needed to determine whether or not to show the dot in the top right corner indicating some changes were made
8
+ * @param filterIsActive - shows the dot in the top right corner indicating some changes were made
9
+ * @param activeCount - the number of filter controls that differ from the page default (the page computes it); shown as `Filter (N)`, dot when N > 0
9
10
  * @param hideLabel - icon-only mode. When omitted, follows the surrounding DynamicToolbar layout (filterIconOnly).
10
11
  */
11
12
  interface StyledFilterMenuProps {
12
- filterIsActive: boolean;
13
+ /** Ignored when `activeCount` is given. */
14
+ filterIsActive?: boolean;
15
+ activeCount?: number;
13
16
  label?: string;
14
17
  hideLabel?: boolean;
15
18
  }
@@ -8,13 +8,16 @@ import { StyledPopoverProps } from '../popover';
8
8
  * dot at top-right. No own styling beyond that dot; all visuals come from the aligned primitives.
9
9
  *
10
10
  * Custom props:
11
- * @param filterIsActive - needed to determine whether or not to show the dot in the top right corner indicating some changes were made
11
+ * @param filterIsActive - shows the dot in the top right corner indicating some changes were made
12
+ * @param activeCount - the number of filter controls that differ from the page default (the page computes it); shown as `Filter (N)`, dot when N > 0
12
13
  * @param popoverContent
13
14
  * @param hideLabel - icon-only mode. When omitted, follows the surrounding DynamicToolbar layout (filterIconOnly).
14
15
  */
15
16
  interface StyledFilterMenuProps {
16
17
  dataTest: string;
17
- filterIsActive: boolean;
18
+ /** Ignored when `activeCount` is given. */
19
+ filterIsActive?: boolean;
20
+ activeCount?: number;
18
21
  popoverContent: ((props: {
19
22
  isOpen: boolean;
20
23
  onClose: () => void;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * The Filter trigger's text, which is also its accessible name when the label is hidden.
3
+ *
4
+ * `activeCount`: the number of filter controls that differ from the page default (the page computes it).
5
+ *
6
+ * @see asma-modules/_docs/ux/specs/spec-design-system-popover.md:100 — Filter trigger label
7
+ * @see asma-modules/_docs/ux/patterns/pattern-filter-default-state.md:70 — what counts as changed
8
+ */
9
+ export declare const filterButtonText: (label: string | undefined, activeCount: number | undefined) => string;
10
+ /** `activeCount`, when given, alone decides the dot; `filterIsActive` serves callers without a count. */
11
+ export declare const isFilterDotShown: (filterIsActive: boolean | undefined, activeCount: number | undefined) => boolean;
@@ -9,13 +9,18 @@ import { ReactNode } from 'react';
9
9
  * 40px body padding) needs the full 472px of the frame — with a border only 470px remain and the
10
10
  * pair wraps. Figma's stroke takes no width from autolayout, and the inset shadow matches that.
11
11
  *
12
+ * The ring is not on this surface itself: an element's own inset shadow paints beneath its
13
+ * children, so the Close button's hover fill in the top-right corner covered it. `PopoverAnatomy`
14
+ * draws it as its last, absolutely positioned layer (`SURFACE_EDGE_CLASSNAME`), above the content.
15
+ * `relative` makes the surface that layer's containing block where no floating position is set.
16
+ *
12
17
  * `box-border` is load-bearing, not noise: this package builds Tailwind with `preflight: false`, so
13
18
  * without it `box-sizing` falls back to `content-box` and a 472px max-width renders 474.
14
19
  *
15
20
  * Positioning (`z-index`, the floating transform, the top-layer props) deliberately stays with the
16
21
  * caller, so the Gallery story can render the same surface statically in a grid.
17
22
  */
18
- export declare const POPOVER_SURFACE_CLASSNAME = "box-border flex flex-col overflow-hidden rounded-lg bg-white text-delta-700 outline-none shadow-[inset_0_0_0_1px_var(--colors-delta-300),0px_4px_40px_0px_#22213366]";
23
+ export declare const POPOVER_SURFACE_CLASSNAME = "relative box-border flex flex-col overflow-hidden rounded-lg bg-white text-delta-700 outline-none shadow-[0px_4px_40px_0px_#22213366]";
19
24
  export interface PopoverAnatomyProps {
20
25
  dataTest: string;
21
26
  title?: ReactNode;
@@ -60,6 +60,18 @@ export interface PopoverSheetProps {
60
60
  onOpenChange?: (isOpen: boolean) => void;
61
61
  /** @figmaProp none — style escape hatch, applied to the surface */
62
62
  className?: string;
63
+ /**
64
+ * Which trigger edge the surface lines up with. `auto` picks once per open: `end` when the
65
+ * trigger's centre is in the right half of the viewport, otherwise `start`.
66
+ * @figmaProp none — behavioral
67
+ */
68
+ align?: 'start' | 'end' | 'auto';
69
+ /**
70
+ * CSS selectors for overlays rendered outside React (e.g. DevExtreme's `.dx-overlay-wrapper`).
71
+ * Pressing or focusing inside them counts as inside the surface.
72
+ * @figmaProp none — behavioral
73
+ */
74
+ ignoreOutside?: string[];
63
75
  }
64
76
  /**
65
77
  * ASMA Design System **Popover** (ASMA-8183) — an anchored overlay with the DS surface, an optional
@@ -83,4 +95,4 @@ export interface PopoverSheetProps {
83
95
  * Separate from {@link StyledPopover}, which stays as the MUI-parity positioning primitive its eight
84
96
  * internal consumers still depend on; those migrate here gradually.
85
97
  */
86
- export declare const PopoverSheet: ({ dataTest, renderTrigger, variant, title, children, viewResultsAction, resetAction, footerActions, resultCount, closeLabel, ariaLabel, onOpenChange, className, }: PopoverSheetProps) => JSX.Element;
98
+ export declare const PopoverSheet: ({ dataTest, renderTrigger, variant, title, children, viewResultsAction, resetAction, footerActions, resultCount, closeLabel, ariaLabel, onOpenChange, className, align, ignoreOutside, }: PopoverSheetProps) => JSX.Element;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "3.118.0",
6
+ "version": "3.120.0",
7
7
  "type": "module",
8
8
  "sideEffects": [
9
9
  "**/*.css",