@astryxdesign/core 0.4.7-canary.7a9ff42 → 0.4.7-canary.8a055df
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/Avatar/Avatar.d.ts.map +1 -1
- package/dist/Avatar/Avatar.js +10 -15
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +4 -5
- package/dist/PowerSearch/PowerSearch.d.ts +2 -2
- package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.js +1 -3
- package/dist/PowerSearch/PowerSearchEditPopover.d.ts +1 -3
- package/dist/PowerSearch/PowerSearchEditPopover.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchEditPopover.js +0 -8
- package/dist/PowerSearch/PowerSearchValueEditor.d.ts +1 -3
- package/dist/PowerSearch/PowerSearchValueEditor.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchValueEditor.js +9 -19
- package/dist/SideNav/SideNavHeading.d.ts.map +1 -1
- package/dist/SideNav/SideNavHeading.js +5 -6
- package/dist/TabList/TabMenu.d.ts.map +1 -1
- package/dist/TabList/TabMenu.js +2 -3
- package/dist/TopNav/TopNavHeading.d.ts.map +1 -1
- package/dist/TopNav/TopNavHeading.js +2 -3
- package/dist/TopNav/TopNavMenu.d.ts.map +1 -1
- package/dist/TopNav/TopNavMenu.js +3 -4
- package/package.json +2 -2
- package/src/Avatar/Avatar.test.tsx +0 -17
- package/src/Avatar/Avatar.tsx +38 -61
- package/src/Button/Button.test.tsx +0 -13
- package/src/Button/Button.tsx +4 -5
- package/src/PowerSearch/PowerSearch.doc.mjs +0 -16
- package/src/PowerSearch/PowerSearch.test.tsx +1 -71
- package/src/PowerSearch/PowerSearch.tsx +1 -4
- package/src/PowerSearch/PowerSearchEditPopover.tsx +0 -12
- package/src/PowerSearch/PowerSearchValueEditor.test.tsx +1 -47
- package/src/PowerSearch/PowerSearchValueEditor.tsx +0 -15
- package/src/SideNav/SideNavHeading.tsx +10 -10
- package/src/TabList/TabMenu.tsx +2 -3
- package/src/TopNav/TopNavHeading.tsx +2 -3
- package/src/TopNav/TopNavMenu.tsx +3 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../src/Avatar/Avatar.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../src/Avatar/Avatar.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAA4C,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAChF,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAqB5C,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,eAAe,CAAC;AA4BrD;;;;;;GAMG;AACH,KAAK,eAAe,GAAG,KAAK,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEzD;;GAEG;AACH,KAAK,iBAAiB,GACpB,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;AAEzE;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,eAAe,GAAG,iBAAiB,CAAC;AAE7D;;GAEG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAgBpD;AAgID,MAAM,WAAW,WAAY,SAAQ,SAAS,CAAC,cAAc,CAAC;IAC5D,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC3B;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,EAAE,CAAC,EAAE,iBAAiB,CAAC;IACvB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;CAChD;AAwHD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,MAAM,CAAC,EACrB,GAAG,EACH,aAAa,EAAE,MAAM,EACrB,WAAW,EACX,IAAI,EACJ,IAAW,EACX,GAAG,EACH,MAAM,EACN,OAAc,EACd,IAAI,EACJ,EAAE,EACF,MAAM,EACN,GAAG,EACH,OAAO,EACP,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,KAAK,EACT,EAAE,WAAW,+BAmUb;yBAtVe,MAAM"}
|
package/dist/Avatar/Avatar.js
CHANGED
|
@@ -18,15 +18,14 @@
|
|
|
18
18
|
*
|
|
19
19
|
* Last synced props: alt, fallbackSrc, name, size, src, status, href, as, target, rel, onClick
|
|
20
20
|
*/
|
|
21
|
-
import { isValidElement,
|
|
21
|
+
import { isValidElement, useMemo, useRef, useState } from 'react';
|
|
22
22
|
import * as stylex from '@stylexjs/stylex';
|
|
23
23
|
import "../theme/tokens.stylex.js";
|
|
24
24
|
import { colorVars, typographyVars, fontWeightVars, radiusVars } from "../theme/tokens.stylex.js";
|
|
25
25
|
import { AvatarSizeContext } from "./AvatarSizeContext.js";
|
|
26
26
|
import { AvatarStatusLabelContext } from "./AvatarStatusLabelContext.js";
|
|
27
27
|
import { useAvatarGroup } from "../AvatarGroup/AvatarGroupContext.js";
|
|
28
|
-
import { mergeProps } from "../utils/index.js";
|
|
29
|
-
import { useMergedRefs } from "../hooks/useMergedRefs.js";
|
|
28
|
+
import { mergeProps, mergeRefs } from "../utils/index.js";
|
|
30
29
|
import { themeProps } from "../utils/themeProps.js";
|
|
31
30
|
import { firstCharacter } from "../utils/characters.js";
|
|
32
31
|
import { focusOutlineProps } from "../utils/focusOutline.stylex.js";
|
|
@@ -445,15 +444,11 @@ export function Avatar({
|
|
|
445
444
|
label: undefined,
|
|
446
445
|
update: null
|
|
447
446
|
});
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
'aria-label': consumerAriaLabel,
|
|
451
|
-
role: consumerRole
|
|
452
|
-
} = props;
|
|
453
|
-
// Recompose the name after React has written any relevant prop changes.
|
|
447
|
+
// A fresh callback ref every render, so React reattaches it on every commit
|
|
448
|
+
// and the name is recomposed after React has written this render's props.
|
|
454
449
|
// `update` covers the other direction: a label that changes while the avatar
|
|
455
450
|
// itself does not re-render.
|
|
456
|
-
const nameRef =
|
|
451
|
+
const nameRef = element => {
|
|
457
452
|
if (element == null) {
|
|
458
453
|
return;
|
|
459
454
|
}
|
|
@@ -462,16 +457,16 @@ export function Avatar({
|
|
|
462
457
|
const composed = composeAccessibleName(t, nameLabel, meaningful(target.label) ?? getStatusLabel(status));
|
|
463
458
|
// A consumer's own ARIA wins here exactly as it does in render, where
|
|
464
459
|
// the derived props spread before `{...props}`.
|
|
465
|
-
if (
|
|
460
|
+
if (props['aria-label'] == null) {
|
|
466
461
|
setAttributeOrRemove(element, 'aria-label', composed);
|
|
467
462
|
}
|
|
468
463
|
// An `<a>`/`<button>` root carries its own role and must not be hidden,
|
|
469
464
|
// so only the name transfers there.
|
|
470
465
|
if (!isInteractive) {
|
|
471
|
-
if (
|
|
466
|
+
if (props.role == null) {
|
|
472
467
|
element.setAttribute('role', composed ? 'img' : 'presentation');
|
|
473
468
|
}
|
|
474
|
-
if (
|
|
469
|
+
if (props['aria-hidden'] == null) {
|
|
475
470
|
setAttributeOrRemove(element, 'aria-hidden', composed ? undefined : 'true');
|
|
476
471
|
}
|
|
477
472
|
}
|
|
@@ -480,8 +475,8 @@ export function Avatar({
|
|
|
480
475
|
return () => {
|
|
481
476
|
target.update = null;
|
|
482
477
|
};
|
|
483
|
-
}
|
|
484
|
-
const rootRef =
|
|
478
|
+
};
|
|
479
|
+
const rootRef = mergeRefs(ref, showTooltip ? tooltipHook.ref : undefined, nameRef);
|
|
485
480
|
|
|
486
481
|
// The inner visuals are identical across the static and interactive variants.
|
|
487
482
|
const visualContent = /*#__PURE__*/_jsxs(_Fragment, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/Button/Button.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAwB,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAC5D,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAC,SAAS,EAAE,SAAS,EAAC,MAAM,gBAAgB,CAAC;AACzD,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/Button/Button.tsx"],"names":[],"mappings":"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"}
|
package/dist/Button/Button.js
CHANGED
|
@@ -27,8 +27,7 @@ import { VisuallyHidden } from "../VisuallyHidden/index.js";
|
|
|
27
27
|
import { EDGE_COMP_ATTR } from "../Layout/edgeCompensation.stylex.js";
|
|
28
28
|
import { useSize } from "../SizeContext/SizeContext.js";
|
|
29
29
|
import { useButtonGroup } from "../ButtonGroup/ButtonGroupContext.js";
|
|
30
|
-
import { mergeProps } from "../utils/index.js";
|
|
31
|
-
import { useMergedRefs } from "../hooks/useMergedRefs.js";
|
|
30
|
+
import { mergeProps, mergeRefs } from "../utils/index.js";
|
|
32
31
|
import { useLinkComponent } from "../Link/useLinkComponent.js";
|
|
33
32
|
import { themeProps } from "../utils/themeProps.js";
|
|
34
33
|
import { focusOutlineProps } from "../utils/focusOutline.stylex.js";
|
|
@@ -504,9 +503,9 @@ export function Button({
|
|
|
504
503
|
} : null;
|
|
505
504
|
|
|
506
505
|
// Merge the consumer ref with the tooltip hook's trigger ref so both point at
|
|
507
|
-
// the same element.
|
|
508
|
-
//
|
|
509
|
-
const mergedButtonRef =
|
|
506
|
+
// the same element. mergeRefs tolerates undefined, so this is a no-op for the
|
|
507
|
+
// tooltip side when no tooltip is set.
|
|
508
|
+
const mergedButtonRef = mergeRefs(ref, tooltip != null ? tooltipHook.ref : undefined);
|
|
510
509
|
let element;
|
|
511
510
|
if (renderAsLink) {
|
|
512
511
|
element = /*#__PURE__*/_jsx(LinkComponent, {
|
|
@@ -69,7 +69,7 @@ export interface PowerSearchProps extends Omit<BaseProps<HTMLElement>, 'onChange
|
|
|
69
69
|
menuWidth?: number;
|
|
70
70
|
/** Max display length for filter token values. @default 40 */
|
|
71
71
|
maxTokenLength?: number;
|
|
72
|
-
/** Max
|
|
72
|
+
/** Max items in operator dropdown. */
|
|
73
73
|
maxOperatorMenuItems?: number;
|
|
74
74
|
/** Label for the save button in edit popover. @default 'Apply' */
|
|
75
75
|
popoverSaveButtonLabel?: string;
|
|
@@ -172,7 +172,7 @@ export interface PowerSearchProps extends Omit<BaseProps<HTMLElement>, 'onChange
|
|
|
172
172
|
* };
|
|
173
173
|
* ```
|
|
174
174
|
*/
|
|
175
|
-
export declare function PowerSearch({ config: configProp, filters, onChange, label: labelFromProps, isLabelHidden, placeholder: placeholderFromProps, hasAutoFocus, hasClear, isReadOnly, isDisabled, disabledMessage, startIcon, onFocus, onBlur, status, statusVariant, maxTokenLength,
|
|
175
|
+
export declare function PowerSearch({ config: configProp, filters, onChange, label: labelFromProps, isLabelHidden, placeholder: placeholderFromProps, hasAutoFocus, hasClear, isReadOnly, isDisabled, disabledMessage, startIcon, onFocus, onBlur, status, statusVariant, maxTokenLength, popoverSaveButtonLabel: popoverSaveButtonLabelFromProps, timezoneID, tokenOverflowBehavior, endContent, resultCount, ref, handleRef, size: sizeProp, 'data-testid': testId, xstyle, className, style, components: componentOverrides, }: PowerSearchProps): React.JSX.Element;
|
|
176
176
|
export declare namespace PowerSearch {
|
|
177
177
|
var displayName: string;
|
|
178
178
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PowerSearch.d.ts","sourceRoot":"","sources":["../../src/PowerSearch/PowerSearch.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,EAOZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,EAGL,KAAK,yBAAyB,EAC/B,MAAM,cAAc,CAAC;AAMtB,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAC;AAEtC,OAAO,KAAK,EAAC,WAAW,EAAE,kBAAkB,EAAC,MAAM,UAAU,CAAC;AAuB9D,OAAO,KAAK,EACV,iBAAiB,EACjB,iBAAiB,EAIjB,qBAAqB,EACrB,iBAAiB,EAIjB,qBAAqB,EACtB,MAAM,SAAS,CAAC;AAgRjB,MAAM,MAAM,eAAe,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEjD,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAC5C,SAAS,CAAC,WAAW,CAAC,EACtB,UAAU,CACX;IACC,yEAAyE;IACzE,MAAM,EAAE,iBAAiB,CAAC;IAC1B,gCAAgC;IAChC,OAAO,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAC;IAC1C,kCAAkC;IAClC,QAAQ,EAAE,CACR,OAAO,EAAE,aAAa,CAAC,iBAAiB,CAAC,EACzC,UAAU,EAAE,qBAAqB,EACjC,KAAK,EAAE,MAAM,KACV,IAAI,CAAC;IACV,0CAA0C;IAC1C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6CAA6C;IAC7C,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,6CAA6C;IAC7C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0CAA0C;IAC1C,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,uCAAuC;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,qDAAqD;IACrD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,oDAAoD;IACpD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;;;;;OAQG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IACjC,6DAA6D;IAC7D,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;IACxC,yDAAyD;IACzD,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;IACvC,yBAAyB;IACzB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,kBAAkB,CAAC;IACnC,mCAAmC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8DAA8D;IAC9D,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,
|
|
1
|
+
{"version":3,"file":"PowerSearch.d.ts","sourceRoot":"","sources":["../../src/PowerSearch/PowerSearch.tsx"],"names":[],"mappings":"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"}
|
|
@@ -379,7 +379,6 @@ export function PowerSearch({
|
|
|
379
379
|
status,
|
|
380
380
|
statusVariant = 'attached',
|
|
381
381
|
maxTokenLength = 40,
|
|
382
|
-
maxOperatorMenuItems,
|
|
383
382
|
popoverSaveButtonLabel: popoverSaveButtonLabelFromProps,
|
|
384
383
|
timezoneID,
|
|
385
384
|
tokenOverflowBehavior,
|
|
@@ -703,10 +702,9 @@ export function PowerSearch({
|
|
|
703
702
|
onSave: handlePopoverSave,
|
|
704
703
|
onCancel: handlePopoverCancel,
|
|
705
704
|
saveButtonLabel: popoverSaveButtonLabel,
|
|
706
|
-
maxMenuItems: maxOperatorMenuItems,
|
|
707
705
|
isReadOnly: isReadOnly
|
|
708
706
|
}, popoverKey);
|
|
709
|
-
}, [popoverPartialFilter, popoverState, EditorOverride, configProp, config, handlePopoverSave, handlePopoverCancel, popoverSaveButtonLabel,
|
|
707
|
+
}, [popoverPartialFilter, popoverState, EditorOverride, configProp, config, handlePopoverSave, handlePopoverCancel, popoverSaveButtonLabel, isReadOnly]);
|
|
710
708
|
|
|
711
709
|
// Plain-text form of the result count, shared by the visible label and the
|
|
712
710
|
// screen-reader announcement so the two never drift. The ICU plural handles
|
|
@@ -22,10 +22,8 @@ export interface PowerSearchEditPopoverProps {
|
|
|
22
22
|
onCancel: () => void;
|
|
23
23
|
/** Label for the save button. @default 'Apply' */
|
|
24
24
|
saveButtonLabel?: string;
|
|
25
|
-
/** Max suggestions in string and entity value typeaheads. */
|
|
26
|
-
maxMenuItems?: number;
|
|
27
25
|
/** Whether the filter is read-only. */
|
|
28
26
|
isReadOnly?: boolean;
|
|
29
27
|
}
|
|
30
|
-
export declare function PowerSearchEditPopover({ config, filter: initialFilter, mode, onSave, onCancel, saveButtonLabel: saveButtonLabelFromProps,
|
|
28
|
+
export declare function PowerSearchEditPopover({ config, filter: initialFilter, mode, onSave, onCancel, saveButtonLabel: saveButtonLabelFromProps, isReadOnly, }: PowerSearchEditPopoverProps): React.JSX.Element;
|
|
31
29
|
//# sourceMappingURL=PowerSearchEditPopover.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PowerSearchEditPopover.d.ts","sourceRoot":"","sources":["../../src/PowerSearch/PowerSearchEditPopover.tsx"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AAEH,OAAO,KAA0D,MAAM,OAAO,CAAC;AAY/E,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EACV,iBAAiB,EACjB,aAAa,EAGd,MAAM,SAAS,CAAC;AA+DjB,MAAM,WAAW,2BAA2B;IAC1C,MAAM,EAAE,cAAc,CAAC;IACvB,uCAAuC;IACvC,MAAM,EAAE,aAAa,CAAC;IACtB,qDAAqD;IACrD,IAAI,EAAE,QAAQ,GAAG,MAAM,CAAC;IACxB,6EAA6E;IAC7E,MAAM,EAAE,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI,KAAK,IAAI,CAAC;IACnD,wDAAwD;IACxD,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,kDAAkD;IAClD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,
|
|
1
|
+
{"version":3,"file":"PowerSearchEditPopover.d.ts","sourceRoot":"","sources":["../../src/PowerSearch/PowerSearchEditPopover.tsx"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AAEH,OAAO,KAA0D,MAAM,OAAO,CAAC;AAY/E,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EACV,iBAAiB,EACjB,aAAa,EAGd,MAAM,SAAS,CAAC;AA+DjB,MAAM,WAAW,2BAA2B;IAC1C,MAAM,EAAE,cAAc,CAAC;IACvB,uCAAuC;IACvC,MAAM,EAAE,aAAa,CAAC;IACtB,qDAAqD;IACrD,IAAI,EAAE,QAAQ,GAAG,MAAM,CAAC;IACxB,6EAA6E;IAC7E,MAAM,EAAE,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI,KAAK,IAAI,CAAC;IACnD,wDAAwD;IACxD,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,kDAAkD;IAClD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,uCAAuC;IACvC,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AA8eD,wBAAgB,sBAAsB,CAAC,EACrC,MAAM,EACN,MAAM,EAAE,aAAa,EACrB,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,eAAe,EAAE,wBAAwB,EACzC,UAAkB,GACnB,EAAE,2BAA2B,qBAwR7B"}
|
|
@@ -142,7 +142,6 @@ function NestedSubFilterRow({
|
|
|
142
142
|
config,
|
|
143
143
|
subFilter,
|
|
144
144
|
onChange,
|
|
145
|
-
maxMenuItems,
|
|
146
145
|
isReadOnly
|
|
147
146
|
}) {
|
|
148
147
|
const t = useTranslator();
|
|
@@ -227,7 +226,6 @@ function NestedSubFilterRow({
|
|
|
227
226
|
filterValue: subFilter.value,
|
|
228
227
|
onChange: handleValueChange,
|
|
229
228
|
config: config,
|
|
230
|
-
maxMenuItems: maxMenuItems,
|
|
231
229
|
isDisabled: isReadOnly
|
|
232
230
|
})
|
|
233
231
|
})]
|
|
@@ -244,7 +242,6 @@ function NestedEditor({
|
|
|
244
242
|
operatorOptions,
|
|
245
243
|
onOperatorChange,
|
|
246
244
|
onPartialFilterChange,
|
|
247
|
-
maxMenuItems,
|
|
248
245
|
isReadOnly
|
|
249
246
|
}) {
|
|
250
247
|
const t = useTranslator();
|
|
@@ -328,7 +325,6 @@ function NestedEditor({
|
|
|
328
325
|
config: config,
|
|
329
326
|
subFilter: sf,
|
|
330
327
|
onChange: updated => handleUpdate(itemPath, updated),
|
|
331
|
-
maxMenuItems: maxMenuItems,
|
|
332
328
|
isReadOnly: isReadOnly
|
|
333
329
|
}),
|
|
334
330
|
isExpanded: true,
|
|
@@ -353,7 +349,6 @@ function NestedEditor({
|
|
|
353
349
|
config: config,
|
|
354
350
|
subFilter: sf,
|
|
355
351
|
onChange: updated => handleUpdate(itemPath, updated),
|
|
356
|
-
maxMenuItems: maxMenuItems,
|
|
357
352
|
isReadOnly: isReadOnly
|
|
358
353
|
}),
|
|
359
354
|
endContent: !isReadOnly ? /*#__PURE__*/_jsx(Button, {
|
|
@@ -425,7 +420,6 @@ export function PowerSearchEditPopover({
|
|
|
425
420
|
onSave,
|
|
426
421
|
onCancel,
|
|
427
422
|
saveButtonLabel: saveButtonLabelFromProps,
|
|
428
|
-
maxMenuItems,
|
|
429
423
|
isReadOnly = false
|
|
430
424
|
}) {
|
|
431
425
|
const t = useTranslator();
|
|
@@ -578,7 +572,6 @@ export function PowerSearchEditPopover({
|
|
|
578
572
|
operatorOptions: operatorOptions,
|
|
579
573
|
onOperatorChange: handleOperatorChange,
|
|
580
574
|
onPartialFilterChange: setPartialFilter,
|
|
581
|
-
maxMenuItems: maxMenuItems,
|
|
582
575
|
isReadOnly: isReadOnly
|
|
583
576
|
})]
|
|
584
577
|
})
|
|
@@ -662,7 +655,6 @@ export function PowerSearchEditPopover({
|
|
|
662
655
|
onChange: handleValueChange,
|
|
663
656
|
onEnter: handleSave,
|
|
664
657
|
config: config,
|
|
665
|
-
maxMenuItems: maxMenuItems,
|
|
666
658
|
isDisabled: isReadOnly
|
|
667
659
|
})
|
|
668
660
|
})]
|
|
@@ -16,10 +16,8 @@ export interface PowerSearchValueEditorProps {
|
|
|
16
16
|
onChange: (value: FilterValue, shouldSave?: boolean) => void;
|
|
17
17
|
onEnter?: () => void;
|
|
18
18
|
config: InternalConfig;
|
|
19
|
-
/** Max suggestions in string and entity value typeaheads. */
|
|
20
|
-
maxMenuItems?: number;
|
|
21
19
|
isDisabled?: boolean;
|
|
22
20
|
timezoneID?: string;
|
|
23
21
|
}
|
|
24
|
-
export declare function PowerSearchValueEditor({ operatorValue, filterValue, onChange, onEnter,
|
|
22
|
+
export declare function PowerSearchValueEditor({ operatorValue, filterValue, onChange, onEnter, isDisabled, }: PowerSearchValueEditorProps): React.JSX.Element | null;
|
|
25
23
|
//# sourceMappingURL=PowerSearchValueEditor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PowerSearchValueEditor.d.ts","sourceRoot":"","sources":["../../src/PowerSearch/PowerSearchValueEditor.tsx"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AAEH,OAAO,KAA6B,MAAM,OAAO,CAAC;AAClD,OAAO,KAAK,EACV,aAAa,EACb,WAAW,EAGZ,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,qBAAqB,CAAC;AAexD,MAAM,WAAW,2BAA2B;IAC1C,aAAa,EAAE,aAAa,CAAC;IAC7B,WAAW,EAAE,WAAW,GAAG,SAAS,CAAC;IACrC,QAAQ,EAAE,CAAC,KAAK,EAAE,WAAW,EAAE,UAAU,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7D,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,EAAE,cAAc,CAAC;IACvB,
|
|
1
|
+
{"version":3,"file":"PowerSearchValueEditor.d.ts","sourceRoot":"","sources":["../../src/PowerSearch/PowerSearchValueEditor.tsx"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AAEH,OAAO,KAA6B,MAAM,OAAO,CAAC;AAClD,OAAO,KAAK,EACV,aAAa,EACb,WAAW,EAGZ,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,qBAAqB,CAAC;AAexD,MAAM,WAAW,2BAA2B;IAC1C,aAAa,EAAE,aAAa,CAAC;IAC7B,WAAW,EAAE,WAAW,GAAG,SAAS,CAAC;IACrC,QAAQ,EAAE,CAAC,KAAK,EAAE,WAAW,EAAE,UAAU,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7D,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,EAAE,cAAc,CAAC;IACvB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAwkBD,wBAAgB,sBAAsB,CAAC,EACrC,aAAa,EACb,WAAW,EACX,QAAQ,EACR,OAAO,EACP,UAAU,GACX,EAAE,2BAA2B,4BA0H7B"}
|
|
@@ -52,8 +52,7 @@ function StringEditor({
|
|
|
52
52
|
operatorValue,
|
|
53
53
|
filterValue,
|
|
54
54
|
onChange,
|
|
55
|
-
onEnter: _onEnter
|
|
56
|
-
maxMenuItems
|
|
55
|
+
onEnter: _onEnter
|
|
57
56
|
}) {
|
|
58
57
|
const t = useTranslator();
|
|
59
58
|
const currentValue = filterValue?.type === 'string' ? filterValue.value : '';
|
|
@@ -84,8 +83,7 @@ function StringEditor({
|
|
|
84
83
|
}
|
|
85
84
|
},
|
|
86
85
|
placeholder: t('@astryx.powersearch.valueEditor.searchPlaceholder'),
|
|
87
|
-
debounceMs: 150
|
|
88
|
-
maxMenuItems: maxMenuItems
|
|
86
|
+
debounceMs: 150
|
|
89
87
|
});
|
|
90
88
|
}
|
|
91
89
|
return /*#__PURE__*/_jsx(TextInput, {
|
|
@@ -104,8 +102,7 @@ function StringEditor({
|
|
|
104
102
|
function StringListEditor({
|
|
105
103
|
operatorValue,
|
|
106
104
|
filterValue,
|
|
107
|
-
onChange
|
|
108
|
-
maxMenuItems
|
|
105
|
+
onChange
|
|
109
106
|
}) {
|
|
110
107
|
const t = useTranslator();
|
|
111
108
|
const currentValue = useMemo(() => {
|
|
@@ -144,8 +141,7 @@ function StringListEditor({
|
|
|
144
141
|
},
|
|
145
142
|
placeholder: t('@astryx.powersearch.valueEditor.addValuesPlaceholder'),
|
|
146
143
|
debounceMs: operatorValue.searchSource ? 150 : 0,
|
|
147
|
-
hasCreate: hasCreate
|
|
148
|
-
maxMenuItems: maxMenuItems
|
|
144
|
+
hasCreate: hasCreate
|
|
149
145
|
});
|
|
150
146
|
}
|
|
151
147
|
function IntegerEditor({
|
|
@@ -434,8 +430,7 @@ function EnumListEditor({
|
|
|
434
430
|
function EntityListEditor({
|
|
435
431
|
operatorValue,
|
|
436
432
|
filterValue,
|
|
437
|
-
onChange
|
|
438
|
-
maxMenuItems
|
|
433
|
+
onChange
|
|
439
434
|
}) {
|
|
440
435
|
const t = useTranslator();
|
|
441
436
|
const source = useMemo(() => {
|
|
@@ -484,8 +479,7 @@ function EntityListEditor({
|
|
|
484
479
|
},
|
|
485
480
|
renderItem: operatorValue.renderItem,
|
|
486
481
|
placeholder: t('@astryx.powersearch.valueEditor.searchPlaceholder'),
|
|
487
|
-
debounceMs: operatorValue.searchSource ? 150 : 0
|
|
488
|
-
maxMenuItems: maxMenuItems
|
|
482
|
+
debounceMs: operatorValue.searchSource ? 150 : 0
|
|
489
483
|
});
|
|
490
484
|
}
|
|
491
485
|
function CustomEditor({
|
|
@@ -521,7 +515,6 @@ export function PowerSearchValueEditor({
|
|
|
521
515
|
filterValue,
|
|
522
516
|
onChange,
|
|
523
517
|
onEnter,
|
|
524
|
-
maxMenuItems,
|
|
525
518
|
isDisabled
|
|
526
519
|
}) {
|
|
527
520
|
switch (operatorValue.type) {
|
|
@@ -532,15 +525,13 @@ export function PowerSearchValueEditor({
|
|
|
532
525
|
operatorValue: operatorValue,
|
|
533
526
|
filterValue: filterValue,
|
|
534
527
|
onChange: onChange,
|
|
535
|
-
onEnter: onEnter
|
|
536
|
-
maxMenuItems: maxMenuItems
|
|
528
|
+
onEnter: onEnter
|
|
537
529
|
});
|
|
538
530
|
case 'string_list':
|
|
539
531
|
return /*#__PURE__*/_jsx(StringListEditor, {
|
|
540
532
|
operatorValue: operatorValue,
|
|
541
533
|
filterValue: filterValue,
|
|
542
|
-
onChange: onChange
|
|
543
|
-
maxMenuItems: maxMenuItems
|
|
534
|
+
onChange: onChange
|
|
544
535
|
});
|
|
545
536
|
case 'integer':
|
|
546
537
|
return /*#__PURE__*/_jsx(IntegerEditor, {
|
|
@@ -594,8 +585,7 @@ export function PowerSearchValueEditor({
|
|
|
594
585
|
return /*#__PURE__*/_jsx(EntityListEditor, {
|
|
595
586
|
operatorValue: operatorValue,
|
|
596
587
|
filterValue: filterValue,
|
|
597
|
-
onChange: onChange
|
|
598
|
-
maxMenuItems: maxMenuItems
|
|
588
|
+
onChange: onChange
|
|
599
589
|
});
|
|
600
590
|
case 'custom':
|
|
601
591
|
return /*#__PURE__*/_jsx(CustomEditor, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SideNavHeading.d.ts","sourceRoot":"","sources":["../../src/SideNav/SideNavHeading.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAkB,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAoBtD,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"SideNavHeading.d.ts","sourceRoot":"","sources":["../../src/SideNav/SideNavHeading.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAkB,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAoBtD,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAErD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AA0N5C,MAAM,WAAW,mBAAoB,SAAQ,SAAS,CAAC,cAAc,CAAC;IACpE,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;;;OAIG;IACH,EAAE,CAAC,EAAE,iBAAiB,CAAC;IACvB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,SAAS,CAAC;IAC7B;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAQD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,cAAc,CAAC,EAC7B,EAAE,EACF,IAAI,EACJ,OAAO,EACP,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,IAAI,EACJ,MAAM,EACN,SAAS,EACT,KAAK,EACL,aAAa,EAAE,MAAM,EACrB,GAAG,EACH,GAAG,KAAK,EACT,EAAE,mBAAmB,sCAwfrB;yBAzgBe,cAAc"}
|
|
@@ -33,8 +33,7 @@ import { navItemStyles } from "../NavItem/navItemStyles.stylex.js";
|
|
|
33
33
|
import { focusOutlineProps } from "../utils/focusOutline.stylex.js";
|
|
34
34
|
import { useSideNavCollapse } from "./SideNavCollapseContext.js";
|
|
35
35
|
import { useLinkComponent } from "../Link/useLinkComponent.js";
|
|
36
|
-
import { mergeProps } from "../utils/index.js";
|
|
37
|
-
import { useMergedRefs } from "../hooks/useMergedRefs.js";
|
|
36
|
+
import { mergeProps, mergeRefs } from "../utils/index.js";
|
|
38
37
|
import { useMenuHover } from "../hooks/useMenuHover.js";
|
|
39
38
|
import { NavHeadingCloseContext } from "../NavMenu/NavMenuContext.js";
|
|
40
39
|
import { themeProps } from "../utils/themeProps.js";
|
|
@@ -268,10 +267,7 @@ export function SideNavHeading({
|
|
|
268
267
|
// setTriggerEl belongs on the chevron button, not this root: it is the
|
|
269
268
|
// focus-restore target and a <div> cannot take focus. triggerRef stays here
|
|
270
269
|
// because the panel anchors to the whole heading.
|
|
271
|
-
const setRef =
|
|
272
|
-
const collapsedSetRef = useMergedRefs(collapsedItemRef, ref,
|
|
273
|
-
// Collapsed, this button is the trigger, so it takes both roles.
|
|
274
|
-
menu ? popover.triggerRef : undefined, menu ? setTriggerEl : undefined);
|
|
270
|
+
const setRef = mergeRefs(rootRef, ref, menu ? popover.triggerRef : undefined);
|
|
275
271
|
|
|
276
272
|
// In collapsed mode: hide if no icon, show icon-only if has icon
|
|
277
273
|
if (isCollapsed && !icon) {
|
|
@@ -284,6 +280,9 @@ export function SideNavHeading({
|
|
|
284
280
|
},
|
|
285
281
|
children: icon
|
|
286
282
|
});
|
|
283
|
+
const collapsedSetRef = mergeRefs(collapsedItemRef, ref,
|
|
284
|
+
// Collapsed, this button is the trigger, so it takes both roles.
|
|
285
|
+
menu ? popover.triggerRef : undefined, menu ? setTriggerEl : undefined);
|
|
287
286
|
let collapsedElement;
|
|
288
287
|
if (headingHref) {
|
|
289
288
|
collapsedElement = /*#__PURE__*/_jsx(LinkComponent, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabMenu.d.ts","sourceRoot":"","sources":["../../src/TabList/TabMenu.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,EAA6B,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAGxE,OAAO,EAAiB,KAAK,QAAQ,EAAC,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"TabMenu.d.ts","sourceRoot":"","sources":["../../src/TabList/TabMenu.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,EAA6B,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAGxE,OAAO,EAAiB,KAAK,QAAQ,EAAC,MAAM,SAAS,CAAC;AAmBtD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAG5C,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;CAC7B;AAED,MAAM,WAAW,YAAa,SAAQ,IAAI,CACxC,SAAS,CAAC,iBAAiB,CAAC,EAC5B,QAAQ,GAAG,WAAW,GAAG,OAAO,CACjC;IACC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IACnC;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,OAAO,EAAE,aAAa,EAAE,CAAC;CAC1B;AA+KD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,OAAO,CAAC,EACtB,GAAG,EACH,KAAK,EACL,OAAO,EACP,MAAM,EACN,SAAS,EACT,KAAK,GACN,EAAE,YAAY,qBA4Ld;yBAnMe,OAAO"}
|
package/dist/TabList/TabMenu.js
CHANGED
|
@@ -28,8 +28,7 @@ import { useListFocus } from "../hooks/useListFocus.js";
|
|
|
28
28
|
import { useTabListContext } from "./TabListContext.js";
|
|
29
29
|
import "./tab.markers.stylex.js";
|
|
30
30
|
import { tabScope } from "./tab.markers.stylex.js";
|
|
31
|
-
import { mergeProps } from "../utils/index.js";
|
|
32
|
-
import { useMergedRefs } from "../hooks/useMergedRefs.js";
|
|
31
|
+
import { mergeProps, mergeRefs } from "../utils/index.js";
|
|
33
32
|
import { themeProps } from "../utils/themeProps.js";
|
|
34
33
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
35
34
|
// =============================================================================
|
|
@@ -228,7 +227,7 @@ export function TabMenu({
|
|
|
228
227
|
tabListCtx.onChange(value);
|
|
229
228
|
popover.hide();
|
|
230
229
|
}, [tabListCtx, popover]);
|
|
231
|
-
const setButtonRef =
|
|
230
|
+
const setButtonRef = mergeRefs(popover.triggerRef, buttonRef, ref);
|
|
232
231
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
233
232
|
children: [/*#__PURE__*/_jsxs("button", {
|
|
234
233
|
ref: setButtonRef,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TopNavHeading.d.ts","sourceRoot":"","sources":["../../src/TopNav/TopNavHeading.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAkB,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAatD,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"TopNavHeading.d.ts","sourceRoot":"","sources":["../../src/TopNav/TopNavHeading.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAkB,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAatD,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAErD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AA0L5C,MAAM,WAAW,kBAAmB,SAAQ,SAAS,CAAC,WAAW,CAAC;IAChE,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAC7B;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,gBAAgB,CAAC,EAAE,SAAS,CAAC;IAC7B;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;;;OAIG;IACH,EAAE,CAAC,EAAE,iBAAiB,CAAC;CACxB;AAMD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,aAAa,CAAC,EAC5B,EAAE,EACF,IAAI,EACJ,SAAS,EACT,OAAO,EACP,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,IAAI,EACJ,MAAM,EACN,SAAS,EACT,KAAK,EACL,aAAa,EAAE,MAAM,EACrB,GAAG,EACH,GAAG,KAAK,EACT,EAAE,kBAAkB,+BAwYpB;yBA1Ze,aAAa"}
|
|
@@ -27,8 +27,7 @@ import { usePopover } from "../Popover/usePopover.js";
|
|
|
27
27
|
import { Link } from "../Link/index.js";
|
|
28
28
|
import { Icon } from "../Icon/index.js";
|
|
29
29
|
import { useLinkComponent } from "../Link/useLinkComponent.js";
|
|
30
|
-
import { mergeProps } from "../utils/index.js";
|
|
31
|
-
import { useMergedRefs } from "../hooks/useMergedRefs.js";
|
|
30
|
+
import { mergeProps, mergeRefs } from "../utils/index.js";
|
|
32
31
|
import { useMenuHover } from "../hooks/useMenuHover.js";
|
|
33
32
|
import { NavHeadingCloseContext } from "../NavMenu/NavMenuContext.js";
|
|
34
33
|
import { themeProps } from "../utils/themeProps.js";
|
|
@@ -179,7 +178,7 @@ export function TopNavHeading({
|
|
|
179
178
|
// setTriggerEl belongs on the chevron button, not this root: it is the
|
|
180
179
|
// focus-restore target and a <div> cannot take focus. triggerRef stays here
|
|
181
180
|
// because the panel anchors to the whole heading.
|
|
182
|
-
const setRef =
|
|
181
|
+
const setRef = mergeRefs(rootRef, ref, menu ? popover.triggerRef : undefined);
|
|
183
182
|
const showChevron = !!menu;
|
|
184
183
|
const hasAnyHref = !!(headingHref || superheadingHref || subheadingHref);
|
|
185
184
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TopNavMenu.d.ts","sourceRoot":"","sources":["../../src/TopNav/TopNavMenu.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,EAKZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"TopNavMenu.d.ts","sourceRoot":"","sources":["../../src/TopNav/TopNavMenu.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,EAKZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAQf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAoM5C;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IAEjB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAMD,MAAM,WAAW,eAAgB,SAAQ,SAAS,CAAC,iBAAiB,CAAC;IACnE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IACnC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,KAAK,EAAE,kBAAkB,EAAE,CAAC;IAE5B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAMD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,wBAAgB,UAAU,CAAC,EACzB,GAAG,EACH,KAAK,EACL,KAAK,EACL,KAAW,EACX,SAAe,GAChB,EAAE,eAAe,4BA4OjB;yBAlPe,UAAU"}
|
|
@@ -22,8 +22,7 @@ import { useMenuHover } from "../hooks/useMenuHover.js";
|
|
|
22
22
|
import { useListFocus } from "../hooks/useListFocus.js";
|
|
23
23
|
import { useTypeahead } from "../hooks/useTypeahead.js";
|
|
24
24
|
import { Icon } from "../Icon/index.js";
|
|
25
|
-
import { mergeProps } from "../utils/index.js";
|
|
26
|
-
import { useMergedRefs } from "../hooks/useMergedRefs.js";
|
|
25
|
+
import { mergeProps, mergeRefs } from "../utils/index.js";
|
|
27
26
|
import { navItemStyles } from "../NavItem/navItemStyles.stylex.js";
|
|
28
27
|
import { useTopNavSlot } from "./TopNavContext.js";
|
|
29
28
|
import { useTopNavRenderMode } from "./TopNavRenderContext.js";
|
|
@@ -211,7 +210,7 @@ export function TopNavMenu({
|
|
|
211
210
|
// it from light dismiss.
|
|
212
211
|
popoverId: popover.id
|
|
213
212
|
});
|
|
214
|
-
const setTriggerRef =
|
|
213
|
+
const setTriggerRef = mergeRefs(triggerButtonRef, popover.triggerRef, setTriggerEl, ref);
|
|
215
214
|
|
|
216
215
|
// The desktop popup is a composite menu widget per the APG menu pattern:
|
|
217
216
|
// a single roving tab stop with ArrowUp/ArrowDown traversal (wrapping),
|
|
@@ -260,7 +259,7 @@ export function TopNavMenu({
|
|
|
260
259
|
|
|
261
260
|
// Menu container carries both the hover hook's ref (for its open/close
|
|
262
261
|
// focus management) and the list-focus ref (for roving tabindex/typeahead).
|
|
263
|
-
const setMenuRef =
|
|
262
|
+
const setMenuRef = mergeRefs(menuRef, listRef);
|
|
264
263
|
|
|
265
264
|
// Mobile bar: hide menus entirely
|
|
266
265
|
if (renderMode === 'mobile-bar') {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astryxdesign/core",
|
|
3
|
-
"version": "0.4.7-canary.
|
|
3
|
+
"version": "0.4.7-canary.8a055df",
|
|
4
4
|
"displayName": "Astryx Core",
|
|
5
5
|
"description": "The component library. Accessible, themeable React components with built-in spacing, dark mode, and StyleX styling.",
|
|
6
6
|
"author": "Meta Open Source",
|
|
@@ -661,7 +661,7 @@
|
|
|
661
661
|
"react-dom": ">=19.0.0"
|
|
662
662
|
},
|
|
663
663
|
"devDependencies": {
|
|
664
|
-
"@astryxdesign/cli": "0.4.7-canary.
|
|
664
|
+
"@astryxdesign/cli": "0.4.7-canary.8a055df",
|
|
665
665
|
"@babel/cli": "^8.0.4",
|
|
666
666
|
"@babel/core": "^7.29.7",
|
|
667
667
|
"@babel/preset-react": "^8.0.1",
|
|
@@ -569,23 +569,6 @@ describe('Avatar', () => {
|
|
|
569
569
|
render(<Avatar name="Ada Lovelace" ref={ref} data-testid="a" />);
|
|
570
570
|
expect(ref.current).toBe(screen.getByTestId('a'));
|
|
571
571
|
});
|
|
572
|
-
|
|
573
|
-
it('keeps its merged ref attached across unrelated rerenders', () => {
|
|
574
|
-
const ref = vi.fn();
|
|
575
|
-
const {rerender} = render(
|
|
576
|
-
<Avatar name="Ada Lovelace" size="sm" tooltip={false} ref={ref} />,
|
|
577
|
-
);
|
|
578
|
-
const avatar = screen.getByRole('img', {name: 'Ada Lovelace'});
|
|
579
|
-
expect(ref).toHaveBeenLastCalledWith(avatar);
|
|
580
|
-
ref.mockClear();
|
|
581
|
-
|
|
582
|
-
rerender(
|
|
583
|
-
<Avatar name="Ada Lovelace" size="lg" tooltip={false} ref={ref} />,
|
|
584
|
-
);
|
|
585
|
-
|
|
586
|
-
expect(ref).not.toHaveBeenCalled();
|
|
587
|
-
expect(screen.getByRole('img', {name: 'Ada Lovelace'})).toBe(avatar);
|
|
588
|
-
});
|
|
589
572
|
});
|
|
590
573
|
});
|
|
591
574
|
|
package/src/Avatar/Avatar.tsx
CHANGED
|
@@ -19,14 +19,7 @@
|
|
|
19
19
|
* Last synced props: alt, fallbackSrc, name, size, src, status, href, as, target, rel, onClick
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
|
-
import {
|
|
23
|
-
isValidElement,
|
|
24
|
-
useCallback,
|
|
25
|
-
useMemo,
|
|
26
|
-
useRef,
|
|
27
|
-
useState,
|
|
28
|
-
type ReactNode,
|
|
29
|
-
} from 'react';
|
|
22
|
+
import {isValidElement, useMemo, useRef, useState, type ReactNode} from 'react';
|
|
30
23
|
import type {BaseProps} from '../BaseProps';
|
|
31
24
|
import * as stylex from '@stylexjs/stylex';
|
|
32
25
|
import {
|
|
@@ -41,8 +34,7 @@ import {
|
|
|
41
34
|
type AvatarStatusLabelTarget,
|
|
42
35
|
} from './AvatarStatusLabelContext';
|
|
43
36
|
import {useAvatarGroup} from '../AvatarGroup/AvatarGroupContext';
|
|
44
|
-
import {mergeProps} from '../utils';
|
|
45
|
-
import {useMergedRefs} from '../hooks/useMergedRefs';
|
|
37
|
+
import {mergeProps, mergeRefs} from '../utils';
|
|
46
38
|
import {themeProps} from '../utils/themeProps';
|
|
47
39
|
import {firstCharacter} from '../utils/characters';
|
|
48
40
|
import {focusOutlineProps} from '../utils/focusOutline.stylex';
|
|
@@ -616,62 +608,47 @@ export function Avatar({
|
|
|
616
608
|
label: undefined,
|
|
617
609
|
update: null,
|
|
618
610
|
});
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
'aria-label': consumerAriaLabel,
|
|
622
|
-
role: consumerRole,
|
|
623
|
-
} = props;
|
|
624
|
-
// Recompose the name after React has written any relevant prop changes.
|
|
611
|
+
// A fresh callback ref every render, so React reattaches it on every commit
|
|
612
|
+
// and the name is recomposed after React has written this render's props.
|
|
625
613
|
// `update` covers the other direction: a label that changes while the avatar
|
|
626
614
|
// itself does not re-render.
|
|
627
|
-
const nameRef =
|
|
628
|
-
(element
|
|
629
|
-
|
|
630
|
-
|
|
615
|
+
const nameRef = (element: HTMLElement | null) => {
|
|
616
|
+
if (element == null) {
|
|
617
|
+
return;
|
|
618
|
+
}
|
|
619
|
+
const target = statusLabelRef.current;
|
|
620
|
+
target.update = () => {
|
|
621
|
+
const composed = composeAccessibleName(
|
|
622
|
+
t,
|
|
623
|
+
nameLabel,
|
|
624
|
+
meaningful(target.label) ?? getStatusLabel(status),
|
|
625
|
+
);
|
|
626
|
+
// A consumer's own ARIA wins here exactly as it does in render, where
|
|
627
|
+
// the derived props spread before `{...props}`.
|
|
628
|
+
if (props['aria-label'] == null) {
|
|
629
|
+
setAttributeOrRemove(element, 'aria-label', composed);
|
|
631
630
|
}
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
meaningful(target.label) ?? getStatusLabel(status),
|
|
638
|
-
);
|
|
639
|
-
// A consumer's own ARIA wins here exactly as it does in render, where
|
|
640
|
-
// the derived props spread before `{...props}`.
|
|
641
|
-
if (consumerAriaLabel == null) {
|
|
642
|
-
setAttributeOrRemove(element, 'aria-label', composed);
|
|
631
|
+
// An `<a>`/`<button>` root carries its own role and must not be hidden,
|
|
632
|
+
// so only the name transfers there.
|
|
633
|
+
if (!isInteractive) {
|
|
634
|
+
if (props.role == null) {
|
|
635
|
+
element.setAttribute('role', composed ? 'img' : 'presentation');
|
|
643
636
|
}
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
if (consumerAriaHidden == null) {
|
|
651
|
-
setAttributeOrRemove(
|
|
652
|
-
element,
|
|
653
|
-
'aria-hidden',
|
|
654
|
-
composed ? undefined : 'true',
|
|
655
|
-
);
|
|
656
|
-
}
|
|
637
|
+
if (props['aria-hidden'] == null) {
|
|
638
|
+
setAttributeOrRemove(
|
|
639
|
+
element,
|
|
640
|
+
'aria-hidden',
|
|
641
|
+
composed ? undefined : 'true',
|
|
642
|
+
);
|
|
657
643
|
}
|
|
658
|
-
}
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
}
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
consumerAriaLabel,
|
|
667
|
-
consumerRole,
|
|
668
|
-
isInteractive,
|
|
669
|
-
nameLabel,
|
|
670
|
-
status,
|
|
671
|
-
t,
|
|
672
|
-
],
|
|
673
|
-
);
|
|
674
|
-
const rootRef = useMergedRefs(
|
|
644
|
+
}
|
|
645
|
+
};
|
|
646
|
+
target.update();
|
|
647
|
+
return () => {
|
|
648
|
+
target.update = null;
|
|
649
|
+
};
|
|
650
|
+
};
|
|
651
|
+
const rootRef = mergeRefs(
|
|
675
652
|
ref,
|
|
676
653
|
showTooltip ? tooltipHook.ref : undefined,
|
|
677
654
|
nameRef,
|
|
@@ -151,19 +151,6 @@ describe('Button', () => {
|
|
|
151
151
|
expect(ref).toHaveBeenCalledWith(expect.any(HTMLButtonElement));
|
|
152
152
|
});
|
|
153
153
|
|
|
154
|
-
it('keeps its merged ref attached across unrelated rerenders', () => {
|
|
155
|
-
const ref = vi.fn();
|
|
156
|
-
const {rerender} = render(<Button label="Test" ref={ref} />);
|
|
157
|
-
const button = screen.getByRole('button');
|
|
158
|
-
expect(ref).toHaveBeenLastCalledWith(button);
|
|
159
|
-
ref.mockClear();
|
|
160
|
-
|
|
161
|
-
rerender(<Button label="Test" variant="primary" ref={ref} />);
|
|
162
|
-
|
|
163
|
-
expect(ref).not.toHaveBeenCalled();
|
|
164
|
-
expect(screen.getByRole('button')).toBe(button);
|
|
165
|
-
});
|
|
166
|
-
|
|
167
154
|
// endContent tests
|
|
168
155
|
it('renders endContent after label', () => {
|
|
169
156
|
render(
|
package/src/Button/Button.tsx
CHANGED
|
@@ -42,8 +42,7 @@ import {VisuallyHidden} from '../VisuallyHidden';
|
|
|
42
42
|
import {EDGE_COMP_ATTR} from '../Layout/edgeCompensation.stylex';
|
|
43
43
|
import {useSize} from '../SizeContext/SizeContext';
|
|
44
44
|
import {useButtonGroup} from '../ButtonGroup/ButtonGroupContext';
|
|
45
|
-
import {mergeProps} from '../utils';
|
|
46
|
-
import {useMergedRefs} from '../hooks/useMergedRefs';
|
|
45
|
+
import {mergeProps, mergeRefs} from '../utils';
|
|
47
46
|
import {useLinkComponent} from '../Link/useLinkComponent';
|
|
48
47
|
import type {LinkComponentType} from '../Link/types';
|
|
49
48
|
import {themeProps} from '../utils/themeProps';
|
|
@@ -758,9 +757,9 @@ export function Button({
|
|
|
758
757
|
: null;
|
|
759
758
|
|
|
760
759
|
// Merge the consumer ref with the tooltip hook's trigger ref so both point at
|
|
761
|
-
// the same element.
|
|
762
|
-
//
|
|
763
|
-
const mergedButtonRef =
|
|
760
|
+
// the same element. mergeRefs tolerates undefined, so this is a no-op for the
|
|
761
|
+
// tooltip side when no tooltip is set.
|
|
762
|
+
const mergedButtonRef = mergeRefs(
|
|
764
763
|
ref,
|
|
765
764
|
tooltip != null ? tooltipHook.ref : undefined,
|
|
766
765
|
);
|
|
@@ -103,13 +103,6 @@ export const docs = {
|
|
|
103
103
|
description: 'Max character length for filter value display in tokens.',
|
|
104
104
|
default: '40',
|
|
105
105
|
},
|
|
106
|
-
{
|
|
107
|
-
name: 'maxOperatorMenuItems',
|
|
108
|
-
type: 'number',
|
|
109
|
-
description:
|
|
110
|
-
'Maximum suggestions shown in string and entity value typeaheads. Does not affect the main field search menu or enum value menus.',
|
|
111
|
-
default: '10',
|
|
112
|
-
},
|
|
113
106
|
{
|
|
114
107
|
name: 'popoverSaveButtonLabel',
|
|
115
108
|
type: 'string',
|
|
@@ -301,13 +294,6 @@ export const docsZh = {
|
|
|
301
294
|
description: '令牌中过滤器值显示的最大字符长度。',
|
|
302
295
|
default: '40',
|
|
303
296
|
},
|
|
304
|
-
{
|
|
305
|
-
name: 'maxOperatorMenuItems',
|
|
306
|
-
type: 'number',
|
|
307
|
-
description:
|
|
308
|
-
'字符串和实体值预输入菜单中显示的最大建议数。不影响主字段搜索菜单或枚举值菜单。',
|
|
309
|
-
default: '10',
|
|
310
|
-
},
|
|
311
297
|
{
|
|
312
298
|
name: 'popoverSaveButtonLabel',
|
|
313
299
|
type: 'string',
|
|
@@ -388,8 +374,6 @@ export const docsDense = {
|
|
|
388
374
|
startIcon: 'Icon at input start, before filter tokens. Forwarded to internal Tokenizer.',
|
|
389
375
|
statusVariant: 'How status message is placed: attached overlaps below input; detached floats below w/ spacing.',
|
|
390
376
|
maxTokenLength: 'Max char length for filter value display in tokens.',
|
|
391
|
-
maxOperatorMenuItems:
|
|
392
|
-
'Max suggestions in string/entity value typeaheads; excludes main field search + enum menus.',
|
|
393
377
|
popoverSaveButtonLabel: 'Label for save button in edit popover.',
|
|
394
378
|
timezoneID: 'Timezone ID for date formatting (e.g. "America/New_York").',
|
|
395
379
|
handleRef: 'Imperative handle w/ focusTypeahead() + blurTypeahead() methods.',
|
|
@@ -11,14 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
import {useState} from 'react';
|
|
13
13
|
import {describe, it, expect, vi, beforeAll, afterAll, afterEach} from 'vitest';
|
|
14
|
-
import {
|
|
15
|
-
render,
|
|
16
|
-
screen,
|
|
17
|
-
act,
|
|
18
|
-
fireEvent,
|
|
19
|
-
waitFor,
|
|
20
|
-
within,
|
|
21
|
-
} from '@testing-library/react';
|
|
14
|
+
import {render, screen, act, fireEvent, waitFor} from '@testing-library/react';
|
|
22
15
|
import userEvent from '@testing-library/user-event';
|
|
23
16
|
import {PowerSearch} from './PowerSearch';
|
|
24
17
|
import {__resetLiveRegionsForTest} from '../hooks/useAnnounce';
|
|
@@ -499,66 +492,3 @@ describe('PowerSearch statusVariant forwarding', () => {
|
|
|
499
492
|
);
|
|
500
493
|
});
|
|
501
494
|
});
|
|
502
|
-
|
|
503
|
-
describe('maxOperatorMenuItems', () => {
|
|
504
|
-
it('caps entity suggestions after selecting a field', async () => {
|
|
505
|
-
const people = Array.from({length: 6}, (_, index) => ({
|
|
506
|
-
id: `person-${index}`,
|
|
507
|
-
label: `Person ${index}`,
|
|
508
|
-
}));
|
|
509
|
-
const config: PowerSearchConfig = {
|
|
510
|
-
name: 'PeopleSearch',
|
|
511
|
-
fields: [
|
|
512
|
-
{
|
|
513
|
-
key: 'person',
|
|
514
|
-
label: 'Person',
|
|
515
|
-
defaultOperator: 'is_any_of',
|
|
516
|
-
operators: [
|
|
517
|
-
{
|
|
518
|
-
key: 'is_any_of',
|
|
519
|
-
label: 'is any of',
|
|
520
|
-
value: {
|
|
521
|
-
type: 'entity_list',
|
|
522
|
-
searchSource: {
|
|
523
|
-
search: query =>
|
|
524
|
-
people.filter(person => person.label.includes(query)),
|
|
525
|
-
bootstrap: () => people,
|
|
526
|
-
},
|
|
527
|
-
},
|
|
528
|
-
},
|
|
529
|
-
],
|
|
530
|
-
},
|
|
531
|
-
],
|
|
532
|
-
};
|
|
533
|
-
const user = userEvent.setup();
|
|
534
|
-
render(
|
|
535
|
-
<PowerSearch
|
|
536
|
-
config={config}
|
|
537
|
-
filters={[
|
|
538
|
-
{
|
|
539
|
-
field: 'person',
|
|
540
|
-
operator: 'is_any_of',
|
|
541
|
-
value: {type: 'entity_list', value: [people[0]]},
|
|
542
|
-
},
|
|
543
|
-
]}
|
|
544
|
-
onChange={() => {}}
|
|
545
|
-
maxOperatorMenuItems={2}
|
|
546
|
-
/>,
|
|
547
|
-
);
|
|
548
|
-
|
|
549
|
-
await user.click(screen.getByRole('button', {name: 'Person: is any of'}));
|
|
550
|
-
const inputs = screen.getAllByRole('combobox', {hidden: true});
|
|
551
|
-
const valueInput = inputs[inputs.length - 1];
|
|
552
|
-
await user.type(valueInput, 'Person');
|
|
553
|
-
|
|
554
|
-
const listboxID = valueInput.getAttribute('aria-controls');
|
|
555
|
-
expect(listboxID).not.toBeNull();
|
|
556
|
-
const listbox = document.getElementById(listboxID!);
|
|
557
|
-
expect(listbox).not.toBeNull();
|
|
558
|
-
await waitFor(() => {
|
|
559
|
-
expect(
|
|
560
|
-
within(listbox!).getAllByRole('option', {hidden: true}),
|
|
561
|
-
).toHaveLength(2);
|
|
562
|
-
});
|
|
563
|
-
});
|
|
564
|
-
});
|
|
@@ -406,7 +406,7 @@ export interface PowerSearchProps extends Omit<
|
|
|
406
406
|
menuWidth?: number;
|
|
407
407
|
/** Max display length for filter token values. @default 40 */
|
|
408
408
|
maxTokenLength?: number;
|
|
409
|
-
/** Max
|
|
409
|
+
/** Max items in operator dropdown. */
|
|
410
410
|
maxOperatorMenuItems?: number;
|
|
411
411
|
/** Label for the save button in edit popover. @default 'Apply' */
|
|
412
412
|
popoverSaveButtonLabel?: string;
|
|
@@ -548,7 +548,6 @@ export function PowerSearch({
|
|
|
548
548
|
status,
|
|
549
549
|
statusVariant = 'attached',
|
|
550
550
|
maxTokenLength = 40,
|
|
551
|
-
maxOperatorMenuItems,
|
|
552
551
|
popoverSaveButtonLabel: popoverSaveButtonLabelFromProps,
|
|
553
552
|
timezoneID,
|
|
554
553
|
tokenOverflowBehavior,
|
|
@@ -968,7 +967,6 @@ export function PowerSearch({
|
|
|
968
967
|
onSave={handlePopoverSave}
|
|
969
968
|
onCancel={handlePopoverCancel}
|
|
970
969
|
saveButtonLabel={popoverSaveButtonLabel}
|
|
971
|
-
maxMenuItems={maxOperatorMenuItems}
|
|
972
970
|
isReadOnly={isReadOnly}
|
|
973
971
|
/>
|
|
974
972
|
);
|
|
@@ -981,7 +979,6 @@ export function PowerSearch({
|
|
|
981
979
|
handlePopoverSave,
|
|
982
980
|
handlePopoverCancel,
|
|
983
981
|
popoverSaveButtonLabel,
|
|
984
|
-
maxOperatorMenuItems,
|
|
985
982
|
isReadOnly,
|
|
986
983
|
]);
|
|
987
984
|
|
|
@@ -105,8 +105,6 @@ export interface PowerSearchEditPopoverProps {
|
|
|
105
105
|
onCancel: () => void;
|
|
106
106
|
/** Label for the save button. @default 'Apply' */
|
|
107
107
|
saveButtonLabel?: string;
|
|
108
|
-
/** Max suggestions in string and entity value typeaheads. */
|
|
109
|
-
maxMenuItems?: number;
|
|
110
108
|
/** Whether the filter is read-only. */
|
|
111
109
|
isReadOnly?: boolean;
|
|
112
110
|
}
|
|
@@ -249,7 +247,6 @@ interface NestedSubFilterRowProps {
|
|
|
249
247
|
config: InternalConfig;
|
|
250
248
|
subFilter: EditablePartialFilter;
|
|
251
249
|
onChange: (subFilter: EditablePartialFilter) => void;
|
|
252
|
-
maxMenuItems?: number;
|
|
253
250
|
isReadOnly: boolean;
|
|
254
251
|
}
|
|
255
252
|
|
|
@@ -257,7 +254,6 @@ function NestedSubFilterRow({
|
|
|
257
254
|
config,
|
|
258
255
|
subFilter,
|
|
259
256
|
onChange,
|
|
260
|
-
maxMenuItems,
|
|
261
257
|
isReadOnly,
|
|
262
258
|
}: NestedSubFilterRowProps) {
|
|
263
259
|
const t = useTranslator();
|
|
@@ -360,7 +356,6 @@ function NestedSubFilterRow({
|
|
|
360
356
|
filterValue={subFilter.value}
|
|
361
357
|
onChange={handleValueChange}
|
|
362
358
|
config={config}
|
|
363
|
-
maxMenuItems={maxMenuItems}
|
|
364
359
|
isDisabled={isReadOnly}
|
|
365
360
|
/>
|
|
366
361
|
</div>
|
|
@@ -379,7 +374,6 @@ interface NestedEditorProps {
|
|
|
379
374
|
operatorOptions: {value: string; label: string}[];
|
|
380
375
|
onOperatorChange: (operatorKey: string) => void;
|
|
381
376
|
onPartialFilterChange: (filter: PartialFilter) => void;
|
|
382
|
-
maxMenuItems?: number;
|
|
383
377
|
isReadOnly: boolean;
|
|
384
378
|
}
|
|
385
379
|
|
|
@@ -389,7 +383,6 @@ function NestedEditor({
|
|
|
389
383
|
operatorOptions,
|
|
390
384
|
onOperatorChange,
|
|
391
385
|
onPartialFilterChange,
|
|
392
|
-
maxMenuItems,
|
|
393
386
|
isReadOnly,
|
|
394
387
|
}: NestedEditorProps) {
|
|
395
388
|
const t = useTranslator();
|
|
@@ -511,7 +504,6 @@ function NestedEditor({
|
|
|
511
504
|
config={config}
|
|
512
505
|
subFilter={sf}
|
|
513
506
|
onChange={updated => handleUpdate(itemPath, updated)}
|
|
514
|
-
maxMenuItems={maxMenuItems}
|
|
515
507
|
isReadOnly={isReadOnly}
|
|
516
508
|
/>
|
|
517
509
|
),
|
|
@@ -538,7 +530,6 @@ function NestedEditor({
|
|
|
538
530
|
config={config}
|
|
539
531
|
subFilter={sf}
|
|
540
532
|
onChange={updated => handleUpdate(itemPath, updated)}
|
|
541
|
-
maxMenuItems={maxMenuItems}
|
|
542
533
|
isReadOnly={isReadOnly}
|
|
543
534
|
/>
|
|
544
535
|
),
|
|
@@ -617,7 +608,6 @@ export function PowerSearchEditPopover({
|
|
|
617
608
|
onSave,
|
|
618
609
|
onCancel,
|
|
619
610
|
saveButtonLabel: saveButtonLabelFromProps,
|
|
620
|
-
maxMenuItems,
|
|
621
611
|
isReadOnly = false,
|
|
622
612
|
}: PowerSearchEditPopoverProps) {
|
|
623
613
|
const t = useTranslator();
|
|
@@ -787,7 +777,6 @@ export function PowerSearchEditPopover({
|
|
|
787
777
|
operatorOptions={operatorOptions}
|
|
788
778
|
onOperatorChange={handleOperatorChange}
|
|
789
779
|
onPartialFilterChange={setPartialFilter}
|
|
790
|
-
maxMenuItems={maxMenuItems}
|
|
791
780
|
isReadOnly={isReadOnly}
|
|
792
781
|
/>
|
|
793
782
|
</VStack>
|
|
@@ -861,7 +850,6 @@ export function PowerSearchEditPopover({
|
|
|
861
850
|
onChange={handleValueChange}
|
|
862
851
|
onEnter={handleSave}
|
|
863
852
|
config={config}
|
|
864
|
-
maxMenuItems={maxMenuItems}
|
|
865
853
|
isDisabled={isReadOnly}
|
|
866
854
|
/>
|
|
867
855
|
</div>
|
|
@@ -10,11 +10,7 @@
|
|
|
10
10
|
import {describe, it, expect, vi, beforeAll, afterAll} from 'vitest';
|
|
11
11
|
import {render, screen, fireEvent, act} from '@testing-library/react';
|
|
12
12
|
import {PowerSearchValueEditor} from './PowerSearchValueEditor';
|
|
13
|
-
import type {
|
|
14
|
-
FilterValueEntityList,
|
|
15
|
-
OperatorValue,
|
|
16
|
-
PowerSearchEntity,
|
|
17
|
-
} from './types';
|
|
13
|
+
import type {FilterValueEntityList, PowerSearchEntity} from './types';
|
|
18
14
|
import type {InternalConfig} from './useInternalConfig';
|
|
19
15
|
import type {SearchableItem, SearchSource} from '../Typeahead/types';
|
|
20
16
|
|
|
@@ -408,45 +404,3 @@ describe('StringListEditor (#1107)', () => {
|
|
|
408
404
|
expect(screen.getByRole('combobox')).toBeInTheDocument();
|
|
409
405
|
});
|
|
410
406
|
});
|
|
411
|
-
|
|
412
|
-
describe('maxMenuItems', () => {
|
|
413
|
-
const source = createSearchSource(
|
|
414
|
-
Array.from({length: 6}, (_, index) => ({
|
|
415
|
-
id: `option-${index}`,
|
|
416
|
-
label: `Option ${index}`,
|
|
417
|
-
})),
|
|
418
|
-
);
|
|
419
|
-
|
|
420
|
-
async function expectCapped(operatorValue: OperatorValue) {
|
|
421
|
-
render(
|
|
422
|
-
<PowerSearchValueEditor
|
|
423
|
-
operatorValue={operatorValue}
|
|
424
|
-
filterValue={undefined}
|
|
425
|
-
onChange={vi.fn()}
|
|
426
|
-
config={stubConfig}
|
|
427
|
-
maxMenuItems={2}
|
|
428
|
-
/>,
|
|
429
|
-
);
|
|
430
|
-
|
|
431
|
-
await act(async () => {
|
|
432
|
-
fireEvent.change(screen.getByRole('combobox'), {
|
|
433
|
-
target: {value: 'Option'},
|
|
434
|
-
});
|
|
435
|
-
await new Promise(resolve => setTimeout(resolve, 200));
|
|
436
|
-
});
|
|
437
|
-
|
|
438
|
-
expect(screen.getAllByRole('option', {hidden: true})).toHaveLength(2);
|
|
439
|
-
}
|
|
440
|
-
|
|
441
|
-
it('caps string suggestions', async () => {
|
|
442
|
-
await expectCapped({type: 'string', searchSource: source});
|
|
443
|
-
});
|
|
444
|
-
|
|
445
|
-
it('caps string-list suggestions', async () => {
|
|
446
|
-
await expectCapped({type: 'string_list', searchSource: source});
|
|
447
|
-
});
|
|
448
|
-
|
|
449
|
-
it('caps entity-list suggestions', async () => {
|
|
450
|
-
await expectCapped({type: 'entity_list', searchSource: source});
|
|
451
|
-
});
|
|
452
|
-
});
|
|
@@ -40,8 +40,6 @@ export interface PowerSearchValueEditorProps {
|
|
|
40
40
|
onChange: (value: FilterValue, shouldSave?: boolean) => void;
|
|
41
41
|
onEnter?: () => void;
|
|
42
42
|
config: InternalConfig;
|
|
43
|
-
/** Max suggestions in string and entity value typeaheads. */
|
|
44
|
-
maxMenuItems?: number;
|
|
45
43
|
isDisabled?: boolean;
|
|
46
44
|
timezoneID?: string;
|
|
47
45
|
}
|
|
@@ -82,13 +80,11 @@ function StringEditor({
|
|
|
82
80
|
filterValue,
|
|
83
81
|
onChange,
|
|
84
82
|
onEnter: _onEnter,
|
|
85
|
-
maxMenuItems,
|
|
86
83
|
}: {
|
|
87
84
|
operatorValue: OperatorValue & {type: 'string'};
|
|
88
85
|
filterValue: FilterValue | undefined;
|
|
89
86
|
onChange: (value: FilterValue, shouldSave?: boolean) => void;
|
|
90
87
|
onEnter?: () => void;
|
|
91
|
-
maxMenuItems?: number;
|
|
92
88
|
}) {
|
|
93
89
|
const t = useTranslator();
|
|
94
90
|
const currentValue = filterValue?.type === 'string' ? filterValue.value : '';
|
|
@@ -115,7 +111,6 @@ function StringEditor({
|
|
|
115
111
|
}}
|
|
116
112
|
placeholder={t('@astryx.powersearch.valueEditor.searchPlaceholder')}
|
|
117
113
|
debounceMs={150}
|
|
118
|
-
maxMenuItems={maxMenuItems}
|
|
119
114
|
/>
|
|
120
115
|
);
|
|
121
116
|
}
|
|
@@ -137,12 +132,10 @@ function StringListEditor({
|
|
|
137
132
|
operatorValue,
|
|
138
133
|
filterValue,
|
|
139
134
|
onChange,
|
|
140
|
-
maxMenuItems,
|
|
141
135
|
}: {
|
|
142
136
|
operatorValue: OperatorValue & {type: 'string_list'};
|
|
143
137
|
filterValue: FilterValue | undefined;
|
|
144
138
|
onChange: (value: FilterValue) => void;
|
|
145
|
-
maxMenuItems?: number;
|
|
146
139
|
}) {
|
|
147
140
|
const t = useTranslator();
|
|
148
141
|
const currentValue: SearchableItem[] = useMemo(() => {
|
|
@@ -183,7 +176,6 @@ function StringListEditor({
|
|
|
183
176
|
placeholder={t('@astryx.powersearch.valueEditor.addValuesPlaceholder')}
|
|
184
177
|
debounceMs={operatorValue.searchSource ? 150 : 0}
|
|
185
178
|
hasCreate={hasCreate}
|
|
186
|
-
maxMenuItems={maxMenuItems}
|
|
187
179
|
/>
|
|
188
180
|
);
|
|
189
181
|
}
|
|
@@ -545,12 +537,10 @@ function EntityListEditor({
|
|
|
545
537
|
operatorValue,
|
|
546
538
|
filterValue,
|
|
547
539
|
onChange,
|
|
548
|
-
maxMenuItems,
|
|
549
540
|
}: {
|
|
550
541
|
operatorValue: OperatorValue & {type: 'entity_list'};
|
|
551
542
|
filterValue: FilterValue | undefined;
|
|
552
543
|
onChange: (value: FilterValue) => void;
|
|
553
|
-
maxMenuItems?: number;
|
|
554
544
|
}) {
|
|
555
545
|
const t = useTranslator();
|
|
556
546
|
const source = useMemo<SearchSource<SearchableItem>>(() => {
|
|
@@ -598,7 +588,6 @@ function EntityListEditor({
|
|
|
598
588
|
renderItem={operatorValue.renderItem}
|
|
599
589
|
placeholder={t('@astryx.powersearch.valueEditor.searchPlaceholder')}
|
|
600
590
|
debounceMs={operatorValue.searchSource ? 150 : 0}
|
|
601
|
-
maxMenuItems={maxMenuItems}
|
|
602
591
|
/>
|
|
603
592
|
);
|
|
604
593
|
}
|
|
@@ -642,7 +631,6 @@ export function PowerSearchValueEditor({
|
|
|
642
631
|
filterValue,
|
|
643
632
|
onChange,
|
|
644
633
|
onEnter,
|
|
645
|
-
maxMenuItems,
|
|
646
634
|
isDisabled,
|
|
647
635
|
}: PowerSearchValueEditorProps) {
|
|
648
636
|
switch (operatorValue.type) {
|
|
@@ -656,7 +644,6 @@ export function PowerSearchValueEditor({
|
|
|
656
644
|
filterValue={filterValue}
|
|
657
645
|
onChange={onChange}
|
|
658
646
|
onEnter={onEnter}
|
|
659
|
-
maxMenuItems={maxMenuItems}
|
|
660
647
|
/>
|
|
661
648
|
);
|
|
662
649
|
|
|
@@ -666,7 +653,6 @@ export function PowerSearchValueEditor({
|
|
|
666
653
|
operatorValue={operatorValue}
|
|
667
654
|
filterValue={filterValue}
|
|
668
655
|
onChange={onChange}
|
|
669
|
-
maxMenuItems={maxMenuItems}
|
|
670
656
|
/>
|
|
671
657
|
);
|
|
672
658
|
|
|
@@ -748,7 +734,6 @@ export function PowerSearchValueEditor({
|
|
|
748
734
|
operatorValue={operatorValue}
|
|
749
735
|
filterValue={filterValue}
|
|
750
736
|
onChange={onChange}
|
|
751
|
-
maxMenuItems={maxMenuItems}
|
|
752
737
|
/>
|
|
753
738
|
);
|
|
754
739
|
|
|
@@ -40,8 +40,7 @@ import {focusOutlineProps} from '../utils/focusOutline.stylex';
|
|
|
40
40
|
import {useSideNavCollapse} from './SideNavCollapseContext';
|
|
41
41
|
import {useLinkComponent} from '../Link/useLinkComponent';
|
|
42
42
|
import type {LinkComponentType} from '../Link/types';
|
|
43
|
-
import {mergeProps} from '../utils';
|
|
44
|
-
import {useMergedRefs} from '../hooks/useMergedRefs';
|
|
43
|
+
import {mergeProps, mergeRefs} from '../utils';
|
|
45
44
|
import type {BaseProps} from '../BaseProps';
|
|
46
45
|
import {useMenuHover} from '../hooks/useMenuHover';
|
|
47
46
|
import {NavHeadingCloseContext} from '../NavMenu/NavMenuContext';
|
|
@@ -400,18 +399,11 @@ export function SideNavHeading({
|
|
|
400
399
|
// setTriggerEl belongs on the chevron button, not this root: it is the
|
|
401
400
|
// focus-restore target and a <div> cannot take focus. triggerRef stays here
|
|
402
401
|
// because the panel anchors to the whole heading.
|
|
403
|
-
const setRef =
|
|
402
|
+
const setRef = mergeRefs<HTMLDivElement>(
|
|
404
403
|
rootRef,
|
|
405
404
|
ref,
|
|
406
405
|
menu ? popover.triggerRef : undefined,
|
|
407
406
|
);
|
|
408
|
-
const collapsedSetRef = useMergedRefs<HTMLElement>(
|
|
409
|
-
collapsedItemRef,
|
|
410
|
-
ref,
|
|
411
|
-
// Collapsed, this button is the trigger, so it takes both roles.
|
|
412
|
-
menu ? popover.triggerRef : undefined,
|
|
413
|
-
menu ? setTriggerEl : undefined,
|
|
414
|
-
);
|
|
415
407
|
|
|
416
408
|
// In collapsed mode: hide if no icon, show icon-only if has icon
|
|
417
409
|
if (isCollapsed && !icon) {
|
|
@@ -420,6 +412,14 @@ export function SideNavHeading({
|
|
|
420
412
|
if (isCollapsed && icon) {
|
|
421
413
|
const collapsedIcon = <span {...stylex.props(styles.icon)}>{icon}</span>;
|
|
422
414
|
|
|
415
|
+
const collapsedSetRef = mergeRefs<HTMLElement>(
|
|
416
|
+
collapsedItemRef,
|
|
417
|
+
ref,
|
|
418
|
+
// Collapsed, this button is the trigger, so it takes both roles.
|
|
419
|
+
menu ? popover.triggerRef : undefined,
|
|
420
|
+
menu ? setTriggerEl : undefined,
|
|
421
|
+
);
|
|
422
|
+
|
|
423
423
|
let collapsedElement: ReactNode;
|
|
424
424
|
|
|
425
425
|
if (headingHref) {
|
package/src/TabList/TabMenu.tsx
CHANGED
|
@@ -37,8 +37,7 @@ import {useListFocus} from '../hooks/useListFocus';
|
|
|
37
37
|
import {useTabListContext} from './TabListContext';
|
|
38
38
|
import type {TabListSize} from './TabListContext';
|
|
39
39
|
import {tabScope} from './tab.markers.stylex';
|
|
40
|
-
import {mergeProps} from '../utils';
|
|
41
|
-
import {useMergedRefs} from '../hooks/useMergedRefs';
|
|
40
|
+
import {mergeProps, mergeRefs} from '../utils';
|
|
42
41
|
import type {BaseProps} from '../BaseProps';
|
|
43
42
|
import {themeProps} from '../utils/themeProps';
|
|
44
43
|
|
|
@@ -337,7 +336,7 @@ export function TabMenu({
|
|
|
337
336
|
[tabListCtx, popover],
|
|
338
337
|
);
|
|
339
338
|
|
|
340
|
-
const setButtonRef =
|
|
339
|
+
const setButtonRef = mergeRefs<HTMLButtonElement>(
|
|
341
340
|
popover.triggerRef,
|
|
342
341
|
buttonRef,
|
|
343
342
|
ref,
|
|
@@ -34,8 +34,7 @@ import {Link} from '../Link';
|
|
|
34
34
|
import {Icon} from '../Icon';
|
|
35
35
|
import {useLinkComponent} from '../Link/useLinkComponent';
|
|
36
36
|
import type {LinkComponentType} from '../Link/types';
|
|
37
|
-
import {mergeProps} from '../utils';
|
|
38
|
-
import {useMergedRefs} from '../hooks/useMergedRefs';
|
|
37
|
+
import {mergeProps, mergeRefs} from '../utils';
|
|
39
38
|
import type {BaseProps} from '../BaseProps';
|
|
40
39
|
import {useMenuHover} from '../hooks/useMenuHover';
|
|
41
40
|
import {NavHeadingCloseContext} from '../NavMenu/NavMenuContext';
|
|
@@ -364,7 +363,7 @@ export function TopNavHeading({
|
|
|
364
363
|
// setTriggerEl belongs on the chevron button, not this root: it is the
|
|
365
364
|
// focus-restore target and a <div> cannot take focus. triggerRef stays here
|
|
366
365
|
// because the panel anchors to the whole heading.
|
|
367
|
-
const setRef =
|
|
366
|
+
const setRef = mergeRefs<HTMLElement>(
|
|
368
367
|
rootRef,
|
|
369
368
|
ref,
|
|
370
369
|
menu ? popover.triggerRef : undefined,
|
|
@@ -29,8 +29,7 @@ import {useMenuHover} from '../hooks/useMenuHover';
|
|
|
29
29
|
import {useListFocus} from '../hooks/useListFocus';
|
|
30
30
|
import {useTypeahead} from '../hooks/useTypeahead';
|
|
31
31
|
import {Icon} from '../Icon';
|
|
32
|
-
import {mergeProps} from '../utils';
|
|
33
|
-
import {useMergedRefs} from '../hooks/useMergedRefs';
|
|
32
|
+
import {mergeProps, mergeRefs} from '../utils';
|
|
34
33
|
import type {BaseProps} from '../BaseProps';
|
|
35
34
|
import {navItemStyles} from '../NavItem/navItemStyles.stylex';
|
|
36
35
|
import {useTopNavSlot} from './TopNavContext';
|
|
@@ -362,7 +361,7 @@ export function TopNavMenu({
|
|
|
362
361
|
popoverId: popover.id,
|
|
363
362
|
});
|
|
364
363
|
|
|
365
|
-
const setTriggerRef =
|
|
364
|
+
const setTriggerRef = mergeRefs<HTMLButtonElement>(
|
|
366
365
|
triggerButtonRef,
|
|
367
366
|
popover.triggerRef,
|
|
368
367
|
setTriggerEl,
|
|
@@ -427,7 +426,7 @@ export function TopNavMenu({
|
|
|
427
426
|
|
|
428
427
|
// Menu container carries both the hover hook's ref (for its open/close
|
|
429
428
|
// focus management) and the list-focus ref (for roving tabindex/typeahead).
|
|
430
|
-
const setMenuRef =
|
|
429
|
+
const setMenuRef = mergeRefs<HTMLDivElement>(menuRef, listRef);
|
|
431
430
|
|
|
432
431
|
// Mobile bar: hide menus entirely
|
|
433
432
|
if (renderMode === 'mobile-bar') {
|