@primer/react 38.22.0-rc.e78d46560 → 38.22.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.
- package/CHANGELOG.md +5 -1
- package/dist/ActionBar/ActionBar-a41224b2.css +2 -0
- package/dist/ActionBar/ActionBar-a41224b2.css.map +1 -0
- package/dist/ActionBar/ActionBar.d.ts +1 -1
- package/dist/ActionBar/ActionBar.d.ts.map +1 -1
- package/dist/ActionBar/ActionBar.js +379 -292
- package/dist/ActionBar/ActionBar.module.css.js +2 -2
- package/dist/ActionBar/index.d.ts +1 -1
- package/dist/ActionList/index.d.ts +4 -0
- package/dist/ActionList/index.d.ts.map +1 -1
- package/dist/ActionList/index.js +3 -1
- package/dist/AnchoredOverlay/AnchoredOverlay.d.ts.map +1 -1
- package/dist/AnchoredOverlay/AnchoredOverlay.js +67 -62
- package/dist/Breadcrumbs/Breadcrumbs.js +1 -1
- package/dist/FeatureFlags/DefaultFeatureFlags.d.ts.map +1 -1
- package/dist/FeatureFlags/DefaultFeatureFlags.js +1 -2
- package/dist/FilteredActionList/FilteredActionList.d.ts.map +1 -1
- package/dist/FilteredActionList/FilteredActionList.js +13 -33
- package/dist/FilteredActionList/FilteredActionListInput.d.ts +15 -0
- package/dist/FilteredActionList/FilteredActionListInput.d.ts.map +1 -0
- package/dist/FilteredActionList/FilteredActionListInput.js +119 -0
- package/dist/FilteredActionList/index.d.ts +9 -1
- package/dist/FilteredActionList/index.d.ts.map +1 -1
- package/dist/FilteredActionList/index.js +11 -0
- package/dist/SelectPanel/SelectPanel.d.ts +1 -0
- package/dist/SelectPanel/SelectPanel.d.ts.map +1 -1
- package/dist/SelectPanel/SelectPanel.js +3 -2
- package/dist/SelectPanel/index.d.ts +1 -0
- package/dist/SelectPanel/index.d.ts.map +1 -1
- package/dist/experimental/index.d.ts +2 -2
- package/dist/experimental/index.d.ts.map +1 -1
- package/dist/experimental/index.js +2 -1
- package/dist/hooks/useAnchoredPosition.d.ts +1 -0
- package/dist/hooks/useAnchoredPosition.d.ts.map +1 -1
- package/dist/hooks/useAnchoredPosition.js +8 -4
- package/dist/hooks/useResizeObserver.d.ts +1 -1
- package/dist/hooks/useResizeObserver.d.ts.map +1 -1
- package/dist/hooks/useResizeObserver.js +5 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/package.json +1 -1
- package/dist/ActionBar/ActionBar-3f7b52a3.css +0 -2
- package/dist/ActionBar/ActionBar-3f7b52a3.css.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import './ActionBar-
|
|
1
|
+
import './ActionBar-a41224b2.css';
|
|
2
2
|
|
|
3
|
-
var styles = {"List":"prc-ActionBar-List-9uz46","
|
|
3
|
+
var styles = {"List":"prc-ActionBar-List-9uz46","Divider":"prc-ActionBar-Divider-6V8yH","Nav":"prc-ActionBar-Nav-9spON","Group":"prc-ActionBar-Group-peNCk"};
|
|
4
4
|
|
|
5
5
|
export { styles as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export type { ActionBarProps, ActionBarMenuProps, ActionBarMenuItemProps } from './ActionBar';
|
|
2
2
|
declare const ActionBar: import("react").FC<import("react").PropsWithChildren<import("./ActionBar").ActionBarProps>> & {
|
|
3
3
|
IconButton: import("react").ForwardRefExoticComponent<import("./ActionBar").ActionBarIconButtonProps & import("react").RefAttributes<unknown>>;
|
|
4
|
-
Divider: () => import("react").JSX.Element;
|
|
4
|
+
Divider: () => import("react").JSX.Element | null;
|
|
5
5
|
Group: import("react").ForwardRefExoticComponent<{
|
|
6
6
|
children?: import("react").ReactNode | undefined;
|
|
7
7
|
} & import("react").RefAttributes<unknown>>;
|
|
@@ -119,6 +119,10 @@ export declare const ActionList: (<As extends React.ElementType = "ul">(props: (
|
|
|
119
119
|
TrailingVisual: import("../utils/types").FCWithSlotMarker<import("react").PropsWithChildren<import("./Visuals").VisualProps>>;
|
|
120
120
|
/** Heading for an `ActionList`. */
|
|
121
121
|
Heading: import("../utils/polymorphic").ForwardRefComponent<"h1" | "h2" | "h3" | "h4" | "h5" | "h6", import("./Heading").ActionListHeadingProps>;
|
|
122
|
+
/** Context for `ActionList.Group` to propagate selectionVariant and other group-level props. */
|
|
123
|
+
GroupContext: import("react").Context<Pick<import("./Group").ActionListGroupProps, "selectionVariant"> & {
|
|
124
|
+
groupHeadingId: string | undefined;
|
|
125
|
+
}>;
|
|
122
126
|
/** Heading for `ActionList.Group` */
|
|
123
127
|
GroupHeading: import("../utils/types").FCWithSlotMarker<import("react").PropsWithChildren<import("./Group").ActionListGroupHeadingProps>>;
|
|
124
128
|
/** Secondary action */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ActionList/index.ts"],"names":[],"mappings":"AAUA,YAAY,EAAC,eAAe,EAAC,MAAM,UAAU,CAAA;AAC7C,YAAY,EAAC,oBAAoB,EAAE,2BAA2B,EAAC,MAAM,SAAS,CAAA;AAC9E,YAAY,EAAC,mBAAmB,EAAC,MAAM,UAAU,CAAA;AACjD,YAAY,EAAC,uBAAuB,EAAC,MAAM,YAAY,CAAA;AACvD,YAAY,EAAC,sBAAsB,EAAC,MAAM,WAAW,CAAA;AACrD,YAAY,EAAC,0BAA0B,EAAC,MAAM,eAAe,CAAA;AAC7D,YAAY,EAAC,4BAA4B,EAAE,6BAA6B,EAAC,MAAM,WAAW,CAAA;AAC1F,YAAY,EAAC,sBAAsB,EAAC,MAAM,WAAW,CAAA;AACrD,YAAY,EAAC,6BAA6B,EAAC,MAAM,kBAAkB,CAAA;AAEnE;;GAEG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;IACrB,mDAAmD;;IAGnD,yCAAyC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAGzC,+DAA+D;;;;;;;;;;;;;;;;;;;;;;;;;;IAG/D,iEAAiE;;IAGjE,4EAA4E;;IAG5E,uDAAuD;;IAGvD,sDAAsD;;IAGtD,mCAAmC;;IAGnC,qCAAqC;;IAGrC,uBAAuB;;CAEvB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ActionList/index.ts"],"names":[],"mappings":"AAUA,YAAY,EAAC,eAAe,EAAC,MAAM,UAAU,CAAA;AAC7C,YAAY,EAAC,oBAAoB,EAAE,2BAA2B,EAAC,MAAM,SAAS,CAAA;AAC9E,YAAY,EAAC,mBAAmB,EAAC,MAAM,UAAU,CAAA;AACjD,YAAY,EAAC,uBAAuB,EAAC,MAAM,YAAY,CAAA;AACvD,YAAY,EAAC,sBAAsB,EAAC,MAAM,WAAW,CAAA;AACrD,YAAY,EAAC,0BAA0B,EAAC,MAAM,eAAe,CAAA;AAC7D,YAAY,EAAC,4BAA4B,EAAE,6BAA6B,EAAC,MAAM,WAAW,CAAA;AAC1F,YAAY,EAAC,sBAAsB,EAAC,MAAM,WAAW,CAAA;AACrD,YAAY,EAAC,6BAA6B,EAAC,MAAM,kBAAkB,CAAA;AAEnE;;GAEG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;IACrB,mDAAmD;;IAGnD,yCAAyC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAGzC,+DAA+D;;;;;;;;;;;;;;;;;;;;;;;;;;IAG/D,iEAAiE;;IAGjE,4EAA4E;;IAG5E,uDAAuD;;IAGvD,sDAAsD;;IAGtD,mCAAmC;;IAGnC,gGAAgG;;;;IAGhG,qCAAqC;;IAGrC,uBAAuB;;CAEvB,CAAA"}
|
package/dist/ActionList/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { List } from './List.js';
|
|
2
|
-
import { GroupHeading, Group } from './Group.js';
|
|
2
|
+
import { GroupHeading, GroupContext, Group } from './Group.js';
|
|
3
3
|
import { Item } from './Item.js';
|
|
4
4
|
import { LinkItem } from './LinkItem.js';
|
|
5
5
|
import { Divider } from './Divider.js';
|
|
@@ -28,6 +28,8 @@ const ActionList = Object.assign(List, {
|
|
|
28
28
|
TrailingVisual,
|
|
29
29
|
/** Heading for an `ActionList`. */
|
|
30
30
|
Heading,
|
|
31
|
+
/** Context for `ActionList.Group` to propagate selectionVariant and other group-level props. */
|
|
32
|
+
GroupContext,
|
|
31
33
|
/** Heading for `ActionList.Group` */
|
|
32
34
|
GroupHeading,
|
|
33
35
|
/** Secondary action */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnchoredOverlay.d.ts","sourceRoot":"","sources":["../../src/AnchoredOverlay/AnchoredOverlay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,
|
|
1
|
+
{"version":3,"file":"AnchoredOverlay.d.ts","sourceRoot":"","sources":["../../src/AnchoredOverlay/AnchoredOverlay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAmC,KAAK,GAAG,EAAC,MAAM,OAAO,CAAA;AAChE,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,YAAY,CAAA;AAE5C,OAAO,KAAK,EAAC,qBAAqB,EAAC,MAAM,uBAAuB,CAAA;AAEhE,OAAO,KAAK,EAAC,qBAAqB,EAAC,MAAM,uBAAuB,CAAA;AAIhE,OAAO,KAAK,EAAC,cAAc,EAAE,gBAAgB,EAAC,MAAM,mBAAmB,CAAA;AACvE,OAAO,EAAC,KAAK,eAAe,EAAC,MAAM,6BAA6B,CAAA;AAChE,OAAO,EAAa,KAAK,eAAe,EAAC,MAAM,WAAW,CAAA;AAO1D,UAAU,8BAA8B;IACtC;;;OAGG;IACH,YAAY,EAAE,CAAC,CAAC,SAAS,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,YAAY,GAAG,iBAAiB,CAAC,EAChG,KAAK,EAAE,CAAC,KACL,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AE,eAAe,CAAC,UAAU,EAAE,UAAU,GAAG,YAAY,CAAC,CAAA;IAChE;;OAEG;IACH,gBAAgB,CAAC,EAAE,CAAC,EAAC,QAAQ,EAAC,EAAE;QAAC,QAAQ,EAAE,cAAc,CAAA;KAAC,KAAK,IAAI,CAAA;IACnE;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAA;IAC3C;;;OAGG;IACH,QAAQ,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAA;CAChC;AAED,MAAM,MAAM,oBAAoB,GAAG,wBAAwB,GACzD,CAAC,8BAA8B,GAAG,iCAAiC,CAAC,GACpE,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,OAAO,GAAG,MAAM,GAAG,cAAc,GAAG,iBAAiB,GAAG,mBAAmB,CAAC,CAAC,CAAA;AAS9G;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,oBAAoB,CAAC,CA2PnF,CAAA"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import useIsomorphicLayoutEffect from '../utils/useIsomorphicLayoutEffect.js';
|
|
1
|
+
import { useState, useCallback, useEffect } from 'react';
|
|
3
2
|
import { useFocusTrap } from '../hooks/useFocusTrap.js';
|
|
4
3
|
import { useFocusZone } from '../hooks/useFocusZone.js';
|
|
5
4
|
import { useId } from '../hooks/useId.js';
|
|
@@ -52,13 +51,20 @@ const AnchoredOverlay = ({
|
|
|
52
51
|
renderAs = 'portal'
|
|
53
52
|
}) => {
|
|
54
53
|
const cssAnchorPositioningFlag = useFeatureFlag('primer_react_css_anchor_positioning');
|
|
55
|
-
|
|
56
|
-
//
|
|
57
|
-
const
|
|
54
|
+
// Lazy initial state so feature detection runs once per mount on the client.
|
|
55
|
+
// Guarded for SSR where `document` is undefined.
|
|
56
|
+
const [supportsNativeCSSAnchorPositioning] = useState(() => typeof document !== 'undefined' && 'anchorName' in document.documentElement.style);
|
|
57
|
+
const cssAnchorPositioning = cssAnchorPositioningFlag && supportsNativeCSSAnchorPositioning;
|
|
58
58
|
// Only use Popover API when both CSS anchor positioning is enabled AND renderAs is true
|
|
59
59
|
const shouldRenderAsPopover = cssAnchorPositioning && renderAs === 'popover';
|
|
60
60
|
const anchorRef = useProvidedRefOrCreate(externalAnchorRef);
|
|
61
|
+
const [anchorElement, setAnchorElement] = useState(null);
|
|
62
|
+
// eslint-disable-next-line react-hooks/refs
|
|
63
|
+
if (anchorRef.current !== anchorElement) {
|
|
64
|
+
setAnchorElement(anchorRef.current);
|
|
65
|
+
}
|
|
61
66
|
const [overlayRef, updateOverlayRef] = useRenderForcingRef();
|
|
67
|
+
const [overlayElement, setOverlayElement] = useState(null);
|
|
62
68
|
const anchorId = useId(externalAnchorId);
|
|
63
69
|
const onClickOutside = useCallback(() => onClose === null || onClose === void 0 ? void 0 : onClose('click-outside'), [onClose]);
|
|
64
70
|
const onEscape = useCallback(() => onClose === null || onClose === void 0 ? void 0 : onClose('escape'), [onClose]);
|
|
@@ -70,14 +76,14 @@ const AnchoredOverlay = ({
|
|
|
70
76
|
}
|
|
71
77
|
}
|
|
72
78
|
}, [open, onOpen]);
|
|
73
|
-
const onAnchorClick = useCallback(
|
|
74
|
-
if (
|
|
79
|
+
const onAnchorClick = useCallback(event => {
|
|
80
|
+
if (event.defaultPrevented || event.button !== 0) {
|
|
75
81
|
return;
|
|
76
82
|
}
|
|
77
83
|
// Prevent the browser's native popovertarget toggle so React
|
|
78
84
|
// stays the single source of truth for popover visibility.
|
|
79
85
|
if (cssAnchorPositioning) {
|
|
80
|
-
|
|
86
|
+
event.preventDefault();
|
|
81
87
|
}
|
|
82
88
|
if (!open) {
|
|
83
89
|
onOpen === null || onOpen === void 0 ? void 0 : onOpen('anchor-click');
|
|
@@ -93,7 +99,7 @@ const AnchoredOverlay = ({
|
|
|
93
99
|
}
|
|
94
100
|
};
|
|
95
101
|
const {
|
|
96
|
-
position
|
|
102
|
+
position
|
|
97
103
|
} = useAnchoredPosition({
|
|
98
104
|
anchorElementRef: anchorRef,
|
|
99
105
|
floatingElementRef: overlayRef,
|
|
@@ -103,13 +109,13 @@ const AnchoredOverlay = ({
|
|
|
103
109
|
alignmentOffset,
|
|
104
110
|
anchorOffset,
|
|
105
111
|
displayInViewport,
|
|
106
|
-
onPositionChange: positionChange
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
112
|
+
onPositionChange: positionChange,
|
|
113
|
+
// When native CSS anchor positioning is active, skip JS-based position
|
|
114
|
+
// computation, scroll listeners, and resize observers since the browser
|
|
115
|
+
// handles repositioning natively.
|
|
116
|
+
enabled: !cssAnchorPositioning
|
|
117
|
+
}, [overlayElement]);
|
|
110
118
|
useEffect(() => {
|
|
111
|
-
supportsNativeCSSAnchorPositioning.current = 'anchorName' in document.documentElement.style;
|
|
112
|
-
|
|
113
119
|
// ensure overlay ref gets cleared when closed, so position can reset between closing/re-opening
|
|
114
120
|
if (!open && overlayRef.current) {
|
|
115
121
|
updateOverlayRef(null);
|
|
@@ -117,64 +123,62 @@ const AnchoredOverlay = ({
|
|
|
117
123
|
}, [open, overlayRef, updateOverlayRef]);
|
|
118
124
|
useFocusZone({
|
|
119
125
|
containerRef: overlayRef,
|
|
120
|
-
disabled: !open || !
|
|
126
|
+
disabled: !open || !position && !cssAnchorPositioning,
|
|
121
127
|
...focusZoneSettings
|
|
122
128
|
});
|
|
123
129
|
useFocusTrap({
|
|
124
130
|
containerRef: overlayRef,
|
|
125
|
-
disabled: !open || !
|
|
131
|
+
disabled: !open || !position && !cssAnchorPositioning,
|
|
126
132
|
...focusTrapSettings
|
|
127
133
|
});
|
|
128
134
|
const popoverId = useId();
|
|
129
135
|
const id = popoverId.replaceAll(':', '_'); // popoverId can contain colons which are invalid in CSS custom property names, so we replace them with underscores
|
|
130
136
|
|
|
131
137
|
useEffect(() => {
|
|
132
|
-
if (!cssAnchorPositioning || !
|
|
133
|
-
const anchor = anchorRef.current;
|
|
134
|
-
const overlay = overlayRef.current;
|
|
135
|
-
anchor.style.setProperty('anchor-name', `--anchored-overlay-anchor-${id}`);
|
|
136
|
-
return () => {
|
|
137
|
-
anchor.style.removeProperty('anchor-name');
|
|
138
|
-
if (overlay) {
|
|
139
|
-
overlay.style.removeProperty('position-anchor');
|
|
140
|
-
}
|
|
141
|
-
};
|
|
142
|
-
// eslint-disable-next-line react-hooks/refs
|
|
143
|
-
}, [cssAnchorPositioning, anchorRef, overlayRef, id, open]);
|
|
144
|
-
|
|
145
|
-
// Track the overlay element so we can re-run the effect when it changes.
|
|
146
|
-
// The overlay unmounts when closed, so each open creates a new DOM node -
|
|
147
|
-
// that needs showPopover() called.
|
|
148
|
-
// eslint-disable-next-line react-hooks/refs
|
|
149
|
-
const overlayElement = overlayRef.current;
|
|
150
|
-
useIsomorphicLayoutEffect(() => {
|
|
151
|
-
// Read ref inside effect to get the value after child refs are attached
|
|
138
|
+
if (!cssAnchorPositioning || !anchorElement) return;
|
|
152
139
|
const currentOverlay = overlayRef.current;
|
|
153
|
-
if (!cssAnchorPositioning || !open || !currentOverlay) return;
|
|
154
|
-
currentOverlay.style.setProperty('position-anchor', `--anchored-overlay-anchor-${id}`);
|
|
155
|
-
const anchorElement = anchorRef.current;
|
|
156
|
-
if (anchorElement) {
|
|
157
|
-
const overlayWidth = width ? parseInt(widthMap[width]) : null;
|
|
158
|
-
const result = getDefaultPosition(anchorElement, overlayWidth);
|
|
159
|
-
currentOverlay.setAttribute('data-align', result.horizontal);
|
|
160
140
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
141
|
+
// Link the anchor and the overlay (when present) via CSS anchor positioning.
|
|
142
|
+
anchorElement.style.setProperty('anchor-name', `--anchored-overlay-anchor-${id}`);
|
|
143
|
+
let pendingPositionFrame = null;
|
|
144
|
+
if (open && currentOverlay) {
|
|
145
|
+
currentOverlay.style.setProperty('position-anchor', `--anchored-overlay-anchor-${id}`);
|
|
146
|
+
|
|
147
|
+
// Defer the getBoundingClientRect read into a `requestAnimationFrame` so the style write above
|
|
148
|
+
// does not force a synchronous layout.
|
|
149
|
+
pendingPositionFrame = requestAnimationFrame(() => {
|
|
150
|
+
pendingPositionFrame = null;
|
|
151
|
+
const overlayWidth = width ? parseInt(widthMap[width]) : null;
|
|
152
|
+
const result = getDefaultPosition(anchorElement, overlayWidth);
|
|
153
|
+
currentOverlay.setAttribute('data-align', result.horizontal);
|
|
154
|
+
|
|
155
|
+
// Apply offset only when viewport is too narrow
|
|
156
|
+
const offset = result.horizontal === 'left' ? result.leftOffset : result.rightOffset;
|
|
157
|
+
currentOverlay.style.setProperty(`--anchored-overlay-anchor-offset-${result.horizontal}`, `${offset || 0}px`);
|
|
158
|
+
});
|
|
165
159
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
160
|
+
// Only call showPopover when shouldRenderAsPopover is enabled
|
|
161
|
+
if (shouldRenderAsPopover) {
|
|
162
|
+
try {
|
|
163
|
+
if (!currentOverlay.matches(':popover-open')) {
|
|
164
|
+
currentOverlay.showPopover();
|
|
165
|
+
}
|
|
166
|
+
} catch {
|
|
167
|
+
// Ignore if popover is already showing or not supported
|
|
171
168
|
}
|
|
172
|
-
} catch {
|
|
173
|
-
// Ignore if popover is already showing or not supported
|
|
174
169
|
}
|
|
175
170
|
}
|
|
176
|
-
|
|
177
|
-
|
|
171
|
+
return () => {
|
|
172
|
+
if (pendingPositionFrame !== null) cancelAnimationFrame(pendingPositionFrame);
|
|
173
|
+
anchorElement.style.removeProperty('anchor-name');
|
|
174
|
+
// The overlay may no longer be in the DOM at this point, so we need to check for its presence before trying to update it.
|
|
175
|
+
if (currentOverlay) {
|
|
176
|
+
currentOverlay.style.removeProperty('position-anchor');
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
// overlayRef is a stable ref object; including it in deps is unnecessary.
|
|
180
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
181
|
+
}, [cssAnchorPositioning, shouldRenderAsPopover, open, anchorElement, overlayElement, id, width]);
|
|
178
182
|
const showXIcon = onClose && variant.narrow === 'fullscreen' && displayCloseButton;
|
|
179
183
|
const XButtonAriaLabelledBy = closeButtonProps['aria-labelledby'];
|
|
180
184
|
const XButtonAriaLabel = closeButtonProps['aria-label'];
|
|
@@ -203,13 +207,13 @@ const AnchoredOverlay = ({
|
|
|
203
207
|
ignoreClickRefs: [anchorRef],
|
|
204
208
|
onEscape: onEscape,
|
|
205
209
|
role: "none",
|
|
206
|
-
visibility: cssAnchorPositioning ||
|
|
210
|
+
visibility: cssAnchorPositioning || position ? 'visible' : 'hidden',
|
|
207
211
|
height: height,
|
|
208
212
|
width: width,
|
|
209
|
-
top: cssAnchorPositioning ? undefined : (
|
|
210
|
-
left: cssAnchorPositioning ? undefined : (
|
|
213
|
+
top: cssAnchorPositioning ? undefined : (position === null || position === void 0 ? void 0 : position.top) || 0,
|
|
214
|
+
left: cssAnchorPositioning ? undefined : (position === null || position === void 0 ? void 0 : position.left) || 0,
|
|
211
215
|
responsiveVariant: variant.narrow === 'fullscreen' ? 'fullscreen' : undefined,
|
|
212
|
-
anchorSide: cssAnchorPositioning ? undefined :
|
|
216
|
+
anchorSide: cssAnchorPositioning ? undefined : position === null || position === void 0 ? void 0 : position.anchorSide,
|
|
213
217
|
className: clsx(className, overlayClassName, cssAnchorPositioning ? classes.AnchoredOverlay : undefined),
|
|
214
218
|
preventOverflow: preventOverflow,
|
|
215
219
|
"data-component": "AnchoredOverlay",
|
|
@@ -226,9 +230,10 @@ const AnchoredOverlay = ({
|
|
|
226
230
|
assignRef(overlayProps.ref, node);
|
|
227
231
|
}
|
|
228
232
|
updateOverlayRef(node);
|
|
233
|
+
setOverlayElement(node);
|
|
229
234
|
},
|
|
230
235
|
"data-anchor-position": cssAnchorPositioning,
|
|
231
|
-
"data-side": cssAnchorPositioning ? side :
|
|
236
|
+
"data-side": cssAnchorPositioning ? side : position === null || position === void 0 ? void 0 : position.anchorSide,
|
|
232
237
|
children: [showXIcon ? /*#__PURE__*/jsx("div", {
|
|
233
238
|
className: classes.ResponsiveCloseButtonContainer,
|
|
234
239
|
children: /*#__PURE__*/jsx(IconButton, {
|
|
@@ -255,7 +255,7 @@ function Breadcrumbs({
|
|
|
255
255
|
let MIN_VISIBLE_ITEMS = 4;
|
|
256
256
|
if (!eHideRoot) {
|
|
257
257
|
MIN_VISIBLE_ITEMS = 3;
|
|
258
|
-
} else if (isNarrow) {
|
|
258
|
+
} else if (isNarrow && childArray.length > 2) {
|
|
259
259
|
MIN_VISIBLE_ITEMS = 1;
|
|
260
260
|
}
|
|
261
261
|
const calculateVisibleItemsWidth = w => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultFeatureFlags.d.ts","sourceRoot":"","sources":["../../src/FeatureFlags/DefaultFeatureFlags.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAAgB,EAAC,MAAM,oBAAoB,CAAA;AAEnD,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"DefaultFeatureFlags.d.ts","sourceRoot":"","sources":["../../src/FeatureFlags/DefaultFeatureFlags.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAAgB,EAAC,MAAM,oBAAoB,CAAA;AAEnD,eAAO,MAAM,mBAAmB,kBAI9B,CAAA"}
|
|
@@ -3,8 +3,7 @@ import { FeatureFlagScope } from './FeatureFlagScope.js';
|
|
|
3
3
|
const DefaultFeatureFlags = FeatureFlagScope.create({
|
|
4
4
|
primer_react_css_anchor_positioning: false,
|
|
5
5
|
primer_react_select_panel_fullscreen_on_narrow: false,
|
|
6
|
-
primer_react_select_panel_order_selected_at_top: false
|
|
7
|
-
primer_react_select_panel_remove_active_descendant: false
|
|
6
|
+
primer_react_select_panel_order_selected_at_top: false
|
|
8
7
|
});
|
|
9
8
|
|
|
10
9
|
export { DefaultFeatureFlags };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilteredActionList.d.ts","sourceRoot":"","sources":["../../src/FilteredActionList/FilteredActionList.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAuB,GAAG,EAAC,MAAM,OAAO,CAAA;AACpD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"FilteredActionList.d.ts","sourceRoot":"","sources":["../../src/FilteredActionList/FilteredActionList.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAuB,GAAG,EAAC,MAAM,OAAO,CAAA;AACpD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,cAAc,CAAA;AAChD,OAAO,EAAa,KAAK,eAAe,EAAC,MAAM,eAAe,CAAA;AAC9D,OAAO,KAAK,EAAC,gBAAgB,EAAE,aAAa,EAA0B,MAAM,IAAI,CAAA;AAOhF,OAAO,KAAK,EAAC,6BAA6B,EAAC,MAAM,6BAA6B,CAAA;AAa9E,MAAM,WAAW,uBAAwB,SAAQ,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,MAAM,aAAa,CAAC,CAAC,EAAE,aAAa;IAClH,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,WAAW,CAAC,EAAE,6BAA6B,CAAA;IAC3C,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,GAAG,IAAI,KAAK,IAAI,CAAA;IACtF,yBAAyB,CAAC,EAAE,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAA;IAC7D,iBAAiB,CAAC,EAA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IG;IACH,cAAc,CAAC,EAAE,cAAc,CAAA;IAC/B;;;;;;;;;;;;;OAaG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB;AAED,wBAAgB,kBAAkB,CAAC,EACjC,OAAe,EACf,eAAe,EACf,WAAW,EAAE,mBAAmB,EAChC,WAAwD,EACxD,cAAc,EACd,yBAAyB,EACzB,iBAAiB,EACjB,KAAK,EACL,cAAc,EACd,QAAQ,EAAE,gBAAgB,EAC1B,kBAAkB,EAAE,0BAA0B,EAC9C,aAAa,EACb,gBAAgB,EAChB,OAAO,EACP,WAAW,EACX,SAAS,EACT,gBAAgB,EAChB,oBAA2B,EAC3B,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,gBAAyB,EACzB,uBAA6C,EAC7C,yBAAyB,EACzB,oBAA4B,EAC5B,eAAuB,EACvB,sBAAsB,EACtB,cAAc,EACd,WAAmB,EACnB,GAAG,SAAS,EACb,EAAE,uBAAuB,GAAG,GAAG,CAAC,OAAO,CA4avC;yBA3ce,kBAAkB"}
|
|
@@ -14,8 +14,8 @@ import { isValidElementType } from 'react-is';
|
|
|
14
14
|
import { useAnnouncements } from './useAnnouncements.js';
|
|
15
15
|
import { clsx } from 'clsx';
|
|
16
16
|
import { useVirtualizer } from '@tanstack/react-virtual';
|
|
17
|
+
import { FilteredActionListInput } from './FilteredActionListInput.js';
|
|
17
18
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
18
|
-
import TextInput from '../TextInput/TextInput.js';
|
|
19
19
|
import { VisuallyHidden } from '../VisuallyHidden/VisuallyHidden.js';
|
|
20
20
|
import Checkbox from '../Checkbox/Checkbox.js';
|
|
21
21
|
|
|
@@ -379,43 +379,23 @@ function FilteredActionList({
|
|
|
379
379
|
return actionListContent;
|
|
380
380
|
}
|
|
381
381
|
}
|
|
382
|
-
const {
|
|
383
|
-
className: textInputClassName,
|
|
384
|
-
...restTextInputProps
|
|
385
|
-
} = textInputProps || {};
|
|
386
382
|
return /*#__PURE__*/jsxs("div", {
|
|
387
383
|
ref: inputAndListContainerRef,
|
|
388
384
|
className: clsx(className, classes.Root),
|
|
389
385
|
"data-testid": "filtered-action-list",
|
|
390
386
|
"data-component": "FilteredActionList",
|
|
391
|
-
children: [/*#__PURE__*/jsx(
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
,
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
onKeyPress: onInputKeyPress,
|
|
404
|
-
onKeyDown: usingRovingTabindex ? onInputKeyDown : () => {},
|
|
405
|
-
placeholder: placeholderText,
|
|
406
|
-
role: "combobox",
|
|
407
|
-
"aria-expanded": "true",
|
|
408
|
-
"aria-autocomplete": "list",
|
|
409
|
-
"aria-controls": listId,
|
|
410
|
-
"aria-label": placeholderText,
|
|
411
|
-
"aria-describedby": inputDescriptionTextId,
|
|
412
|
-
loaderPosition: 'leading',
|
|
413
|
-
loading: loading && !loadingType.appearsInBody,
|
|
414
|
-
className: clsx(textInputClassName, {
|
|
415
|
-
[classes.FullScreenTextInput]: fullScreenOnNarrow
|
|
416
|
-
}),
|
|
417
|
-
...restTextInputProps
|
|
418
|
-
})
|
|
387
|
+
children: [/*#__PURE__*/jsx(FilteredActionListInput, {
|
|
388
|
+
inputRef: inputRef,
|
|
389
|
+
value: filterValue,
|
|
390
|
+
onInputChange: onInputChange,
|
|
391
|
+
onInputKeyPress: onInputKeyPress,
|
|
392
|
+
onInputKeyDown: usingRovingTabindex ? onInputKeyDown : undefined,
|
|
393
|
+
placeholderText: placeholderText,
|
|
394
|
+
listId: listId,
|
|
395
|
+
inputDescriptionTextId: inputDescriptionTextId,
|
|
396
|
+
loading: loading && !loadingType.appearsInBody,
|
|
397
|
+
fullScreenOnNarrow: fullScreenOnNarrow,
|
|
398
|
+
...textInputProps
|
|
419
399
|
}), /*#__PURE__*/jsx(VisuallyHidden, {
|
|
420
400
|
id: inputDescriptionTextId,
|
|
421
401
|
children: "Items will be filtered as you type"
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { TextInputProps } from '../TextInput';
|
|
3
|
+
export interface FilteredActionListInputProps extends Partial<Omit<TextInputProps, 'onChange' | 'onKeyDown'>> {
|
|
4
|
+
inputRef: React.RefObject<HTMLInputElement | null>;
|
|
5
|
+
onInputChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
6
|
+
onInputKeyPress?: React.KeyboardEventHandler<HTMLInputElement>;
|
|
7
|
+
onInputKeyDown?: React.KeyboardEventHandler<HTMLInputElement>;
|
|
8
|
+
placeholderText?: string;
|
|
9
|
+
listId: string;
|
|
10
|
+
inputDescriptionTextId: string;
|
|
11
|
+
loading: boolean;
|
|
12
|
+
fullScreenOnNarrow?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare function FilteredActionListInput({ inputRef, value, onInputChange, onInputKeyPress, onInputKeyDown, placeholderText, listId, inputDescriptionTextId, loading, fullScreenOnNarrow, className, ...restTextInputProps }: FilteredActionListInputProps): React.JSX.Element;
|
|
15
|
+
//# sourceMappingURL=FilteredActionListInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilteredActionListInput.d.ts","sourceRoot":"","sources":["../../src/FilteredActionList/FilteredActionListInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,cAAc,CAAA;AAGhD,MAAM,WAAW,4BAA6B,SAAQ,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,UAAU,GAAG,WAAW,CAAC,CAAC;IAC3G,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAA;IAClD,aAAa,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAA;IAChE,eAAe,CAAC,EAAE,KAAK,CAAC,oBAAoB,CAAC,gBAAgB,CAAC,CAAA;IAC9D,cAAc,CAAC,EAAE,KAAK,CAAC,oBAAoB,CAAC,gBAAgB,CAAC,CAAA;IAC7D,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,MAAM,EAAE,MAAM,CAAA;IACd,sBAAsB,EAAE,MAAM,CAAA;IAC9B,OAAO,EAAE,OAAO,CAAA;IAChB,kBAAkB,CAAC,EAAE,OAAO,CAAA;CAC7B;AAED,wBAAgB,uBAAuB,CAAC,EACtC,QAAQ,EACR,KAAK,EACL,aAAa,EACb,eAAe,EACf,cAAc,EACd,eAAe,EACf,MAAM,EACN,sBAAsB,EACtB,OAAO,EACP,kBAAkB,EAClB,SAAS,EACT,GAAG,kBAAkB,EACtB,EAAE,4BAA4B,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CA2BlD"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { c } from 'react-compiler-runtime';
|
|
2
|
+
import { clsx } from 'clsx';
|
|
3
|
+
import classes from './FilteredActionList.module.css.js';
|
|
4
|
+
import { jsx } from 'react/jsx-runtime';
|
|
5
|
+
import TextInput from '../TextInput/TextInput.js';
|
|
6
|
+
|
|
7
|
+
function FilteredActionListInput(t0) {
|
|
8
|
+
const $ = c(28);
|
|
9
|
+
let className;
|
|
10
|
+
let fullScreenOnNarrow;
|
|
11
|
+
let inputDescriptionTextId;
|
|
12
|
+
let inputRef;
|
|
13
|
+
let listId;
|
|
14
|
+
let loading;
|
|
15
|
+
let onInputChange;
|
|
16
|
+
let onInputKeyDown;
|
|
17
|
+
let onInputKeyPress;
|
|
18
|
+
let placeholderText;
|
|
19
|
+
let restTextInputProps;
|
|
20
|
+
let value;
|
|
21
|
+
if ($[0] !== t0) {
|
|
22
|
+
({
|
|
23
|
+
inputRef,
|
|
24
|
+
value,
|
|
25
|
+
onInputChange,
|
|
26
|
+
onInputKeyPress,
|
|
27
|
+
onInputKeyDown,
|
|
28
|
+
placeholderText,
|
|
29
|
+
listId,
|
|
30
|
+
inputDescriptionTextId,
|
|
31
|
+
loading,
|
|
32
|
+
fullScreenOnNarrow,
|
|
33
|
+
className,
|
|
34
|
+
...restTextInputProps
|
|
35
|
+
} = t0);
|
|
36
|
+
$[0] = t0;
|
|
37
|
+
$[1] = className;
|
|
38
|
+
$[2] = fullScreenOnNarrow;
|
|
39
|
+
$[3] = inputDescriptionTextId;
|
|
40
|
+
$[4] = inputRef;
|
|
41
|
+
$[5] = listId;
|
|
42
|
+
$[6] = loading;
|
|
43
|
+
$[7] = onInputChange;
|
|
44
|
+
$[8] = onInputKeyDown;
|
|
45
|
+
$[9] = onInputKeyPress;
|
|
46
|
+
$[10] = placeholderText;
|
|
47
|
+
$[11] = restTextInputProps;
|
|
48
|
+
$[12] = value;
|
|
49
|
+
} else {
|
|
50
|
+
className = $[1];
|
|
51
|
+
fullScreenOnNarrow = $[2];
|
|
52
|
+
inputDescriptionTextId = $[3];
|
|
53
|
+
inputRef = $[4];
|
|
54
|
+
listId = $[5];
|
|
55
|
+
loading = $[6];
|
|
56
|
+
onInputChange = $[7];
|
|
57
|
+
onInputKeyDown = $[8];
|
|
58
|
+
onInputKeyPress = $[9];
|
|
59
|
+
placeholderText = $[10];
|
|
60
|
+
restTextInputProps = $[11];
|
|
61
|
+
value = $[12];
|
|
62
|
+
}
|
|
63
|
+
let t1;
|
|
64
|
+
if ($[13] !== className || $[14] !== fullScreenOnNarrow) {
|
|
65
|
+
t1 = clsx(className, {
|
|
66
|
+
[classes.FullScreenTextInput]: fullScreenOnNarrow
|
|
67
|
+
});
|
|
68
|
+
$[13] = className;
|
|
69
|
+
$[14] = fullScreenOnNarrow;
|
|
70
|
+
$[15] = t1;
|
|
71
|
+
} else {
|
|
72
|
+
t1 = $[15];
|
|
73
|
+
}
|
|
74
|
+
let t2;
|
|
75
|
+
if ($[16] !== inputDescriptionTextId || $[17] !== inputRef || $[18] !== listId || $[19] !== loading || $[20] !== onInputChange || $[21] !== onInputKeyDown || $[22] !== onInputKeyPress || $[23] !== placeholderText || $[24] !== restTextInputProps || $[25] !== t1 || $[26] !== value) {
|
|
76
|
+
t2 = /*#__PURE__*/jsx("div", {
|
|
77
|
+
className: classes.Header,
|
|
78
|
+
"data-component": "FilteredActionList.Header",
|
|
79
|
+
children: /*#__PURE__*/jsx(TextInput, {
|
|
80
|
+
ref: inputRef,
|
|
81
|
+
block: true,
|
|
82
|
+
width: "auto",
|
|
83
|
+
color: "fg.default",
|
|
84
|
+
value: value,
|
|
85
|
+
onChange: onInputChange,
|
|
86
|
+
onKeyPress: onInputKeyPress,
|
|
87
|
+
onKeyDown: onInputKeyDown,
|
|
88
|
+
placeholder: placeholderText,
|
|
89
|
+
role: "combobox",
|
|
90
|
+
"aria-expanded": "true",
|
|
91
|
+
"aria-autocomplete": "list",
|
|
92
|
+
"aria-controls": listId,
|
|
93
|
+
"aria-label": placeholderText,
|
|
94
|
+
"aria-describedby": inputDescriptionTextId,
|
|
95
|
+
loaderPosition: "leading",
|
|
96
|
+
loading: loading,
|
|
97
|
+
className: t1,
|
|
98
|
+
...restTextInputProps
|
|
99
|
+
})
|
|
100
|
+
});
|
|
101
|
+
$[16] = inputDescriptionTextId;
|
|
102
|
+
$[17] = inputRef;
|
|
103
|
+
$[18] = listId;
|
|
104
|
+
$[19] = loading;
|
|
105
|
+
$[20] = onInputChange;
|
|
106
|
+
$[21] = onInputKeyDown;
|
|
107
|
+
$[22] = onInputKeyPress;
|
|
108
|
+
$[23] = placeholderText;
|
|
109
|
+
$[24] = restTextInputProps;
|
|
110
|
+
$[25] = t1;
|
|
111
|
+
$[26] = value;
|
|
112
|
+
$[27] = t2;
|
|
113
|
+
} else {
|
|
114
|
+
t2 = $[27];
|
|
115
|
+
}
|
|
116
|
+
return t2;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export { FilteredActionListInput };
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
import { FilteredActionList as FilteredList } from './FilteredActionList';
|
|
2
|
+
import { FilteredActionListInput } from './FilteredActionListInput';
|
|
3
|
+
import { FilteredActionListBodyLoader } from './FilteredActionListLoaders';
|
|
2
4
|
export type { FilteredActionListProps } from './FilteredActionList';
|
|
5
|
+
export type { FilteredActionListInputProps } from './FilteredActionListInput';
|
|
6
|
+
export { FilteredActionListLoadingTypes } from './FilteredActionListLoaders';
|
|
3
7
|
export type { FilteredActionListItemProps as ItemProps, ItemInput, GroupedListProps, ListPropsBase, RenderItemFn, } from './types';
|
|
8
|
+
export declare const FilteredActionList: typeof FilteredList & {
|
|
9
|
+
BodyLoader: typeof FilteredActionListBodyLoader;
|
|
10
|
+
Input: typeof FilteredActionListInput;
|
|
11
|
+
};
|
|
4
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/FilteredActionList/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/FilteredActionList/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kBAAkB,IAAI,YAAY,EAAC,MAAM,sBAAsB,CAAA;AACvE,OAAO,EAAC,uBAAuB,EAAC,MAAM,2BAA2B,CAAA;AACjE,OAAO,EAAC,4BAA4B,EAAC,MAAM,6BAA6B,CAAA;AAExE,YAAY,EAAC,uBAAuB,EAAC,MAAM,sBAAsB,CAAA;AACjE,YAAY,EAAC,4BAA4B,EAAC,MAAM,2BAA2B,CAAA;AAC3E,OAAO,EAAC,8BAA8B,EAAC,MAAM,6BAA6B,CAAA;AAE1E,YAAY,EACV,2BAA2B,IAAI,SAAS,EACxC,SAAS,EACT,gBAAgB,EAChB,aAAa,EACb,YAAY,GACb,MAAM,SAAS,CAAA;AAEhB,eAAO,MAAM,kBAAkB;;;CAG7B,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FilteredActionList as FilteredActionList$1 } from './FilteredActionList.js';
|
|
2
|
+
import { FilteredActionListInput } from './FilteredActionListInput.js';
|
|
3
|
+
import { FilteredActionListBodyLoader } from './FilteredActionListLoaders.js';
|
|
4
|
+
export { FilteredActionListLoadingTypes } from './FilteredActionListLoaders.js';
|
|
5
|
+
|
|
6
|
+
const FilteredActionList = Object.assign(FilteredActionList$1, {
|
|
7
|
+
BodyLoader: FilteredActionListBodyLoader,
|
|
8
|
+
Input: FilteredActionListInput
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export { FilteredActionList };
|
|
@@ -88,6 +88,7 @@ export declare const SelectPanel: typeof Panel & {
|
|
|
88
88
|
inactive?: boolean;
|
|
89
89
|
labelWrap?: boolean;
|
|
90
90
|
} & React.ButtonHTMLAttributes<HTMLButtonElement>>;
|
|
91
|
+
Message: React.FC<import("./SelectPanelMessage").SelectPanelMessageProps>;
|
|
91
92
|
};
|
|
92
93
|
export {};
|
|
93
94
|
//# sourceMappingURL=SelectPanel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectPanel.d.ts","sourceRoot":"","sources":["../../src/SelectPanel/SelectPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAsC,KAAK,SAAS,EAAC,MAAM,wBAAwB,CAAA;AAC1F,OAAO,KAAK,EAAE,EAAoD,KAAK,GAAG,EAAC,MAAM,OAAO,CAAA;AACxF,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,oBAAoB,CAAA;AAE5D,OAAO,KAAK,EAAC,iCAAiC,EAAC,MAAM,oCAAoC,CAAA;AACzF,OAAO,KAAK,EAAC,uBAAuB,EAAC,MAAM,uBAAuB,CAAA;AAGlE,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,YAAY,CAAA;AAE5C,OAAO,KAAK,EAAY,SAAS,EAAC,MAAM,IAAI,CAAA;AAiB5C,OAAO,KA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mBAAmB,EAChC,cAAc,EAAE,sBAAsB,EACtC,KAAK,EACL,MAAM,EACN,cAAc,EACd,YAAY,EACZ,OAAO,EACP,kBAA8B,EAC9B,SAAS,EACT,MAAM,EACN,KAAK,EACL,EAAE,EACF,OAAO,EACP,MAAM,EACN,QAAQ,EACR,OAAoB,EACpB,eAAe,EACf,wBAA+B,EAC/B,yBAAyB,EACzB,KAAK,EACL,aAAqB,EACrB,sBAAsB,EACtB,WAAW,EACX,iBAAiB,EACjB,GAAG,SAAS,EACb,EAAE,gBAAgB,GAAG,GAAG,CAAC,OAAO,CA0zBhC;AAED,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAM1C,CAAA;AAED,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,GAAG,WAAW,CAM1D,CAAA;AAED,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;CAKtB,CAAA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { SearchIcon, XIcon, TriangleDownIcon } from '@primer/octicons-react';
|
|
2
2
|
import React, { useState, useRef, useEffect, useCallback, useMemo } from 'react';
|
|
3
|
+
import { FilteredActionList } from '../FilteredActionList/index.js';
|
|
3
4
|
import { SelectPanelMessage } from './SelectPanelMessage.js';
|
|
4
5
|
import { IconButton } from '../Button/IconButton.js';
|
|
5
6
|
import { LinkButton } from '../Button/LinkButton.js';
|
|
@@ -21,7 +22,6 @@ import { useFeatureFlag } from '../FeatureFlags/useFeatureFlag.js';
|
|
|
21
22
|
import { useProvidedRefOrCreate } from '../hooks/useProvidedRefOrCreate.js';
|
|
22
23
|
import { AnchoredOverlay } from '../AnchoredOverlay/AnchoredOverlay.js';
|
|
23
24
|
import Heading from '../Heading/Heading.js';
|
|
24
|
-
import { FilteredActionList } from '../FilteredActionList/FilteredActionList.js';
|
|
25
25
|
|
|
26
26
|
const SHORT_DELAY_MS = 500;
|
|
27
27
|
const LONG_DELAY_MS = 1000;
|
|
@@ -846,7 +846,8 @@ SecondaryLink.displayName = "SecondaryLink";
|
|
|
846
846
|
const SelectPanel = Object.assign(Panel, {
|
|
847
847
|
__SLOT__: Symbol('SelectPanel'),
|
|
848
848
|
SecondaryActionButton: SecondaryButton,
|
|
849
|
-
SecondaryActionLink: SecondaryLink
|
|
849
|
+
SecondaryActionLink: SecondaryLink,
|
|
850
|
+
Message: SelectPanelMessage
|
|
850
851
|
});
|
|
851
852
|
|
|
852
853
|
export { SelectPanel };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { SelectPanel } from './SelectPanel';
|
|
2
|
+
export { SelectPanelMessage } from './SelectPanelMessage';
|
|
2
3
|
export type { SelectPanelProps } from './SelectPanel';
|
|
3
4
|
export type { ItemProps, ItemInput, GroupedListProps, ListPropsBase } from '../FilteredActionList';
|
|
4
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/SelectPanel/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAA;AACzC,YAAY,EAAC,gBAAgB,EAAC,MAAM,eAAe,CAAA;AAEnD,YAAY,EAAC,SAAS,EAAE,SAAS,EAAE,gBAAgB,EAAE,aAAa,EAAC,MAAM,uBAAuB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/SelectPanel/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAA;AACzC,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAA;AACvD,YAAY,EAAC,gBAAgB,EAAC,MAAM,eAAe,CAAA;AAEnD,YAAY,EAAC,SAAS,EAAE,SAAS,EAAE,gBAAgB,EAAE,aAAa,EAAC,MAAM,uBAAuB,CAAA"}
|