@primer/react 38.46.0-rc.cd17f5851 → 38.46.0-rc.e10581db0
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 +10 -0
- package/dist/ActionList/LinkItem.js +97 -30
- package/dist/Breadcrumbs/{Breadcrumbs-16d81430.css → Breadcrumbs-6c9aadcf.css} +2 -2
- package/dist/Breadcrumbs/Breadcrumbs-6c9aadcf.css.map +1 -0
- package/dist/Breadcrumbs/Breadcrumbs.js +403 -392
- package/dist/Breadcrumbs/Breadcrumbs.module.css.js +1 -1
- package/dist/Card/Card-0e84ee3c.css +2 -0
- package/dist/Card/Card-0e84ee3c.css.map +1 -0
- package/dist/Card/Card.d.ts +13 -3
- package/dist/Card/Card.js +286 -161
- package/dist/Card/Card.module.css.js +2 -1
- package/dist/Card/index.d.ts +13 -3
- package/dist/Card/index.js +3 -1
- package/dist/TreeView/TreeView.js +29 -15
- package/dist/TreeView/useTreeRovingTabIndex.js +155 -0
- package/dist/experimental/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/generated/components.json +82 -3
- package/package.json +8 -8
- package/dist/Breadcrumbs/Breadcrumbs-16d81430.css.map +0 -1
- package/dist/Card/Card-59b77d05.css +0 -2
- package/dist/Card/Card-59b77d05.css.map +0 -1
|
@@ -18,7 +18,8 @@ import { ActionList } from "../ActionList/index.js";
|
|
|
18
18
|
import TreeView_module_css_default from "./TreeView.module.css.js";
|
|
19
19
|
import { useControllableState } from "../hooks/useControllableState.js";
|
|
20
20
|
import { getAccessibleName } from "./shared.js";
|
|
21
|
-
import { getFirstChildElement
|
|
21
|
+
import { getFirstChildElement } from "./useRovingTabIndex.js";
|
|
22
|
+
import { useTreeRovingTabIndex } from "./useTreeRovingTabIndex.js";
|
|
22
23
|
import { useTypeahead } from "./useTypeahead.js";
|
|
23
24
|
import { SkeletonAvatar } from "../SkeletonAvatar/SkeletonAvatar.js";
|
|
24
25
|
import { SkeletonText } from "../SkeletonText/SkeletonText.js";
|
|
@@ -28,9 +29,11 @@ import { clsx } from "clsx";
|
|
|
28
29
|
import { ChevronDownIcon, ChevronRightIcon, FileDirectoryFillIcon, FileDirectoryOpenFillIcon } from "@primer/octicons-react";
|
|
29
30
|
//#region src/TreeView/TreeView.tsx
|
|
30
31
|
const RootContext = /*#__PURE__*/ React.createContext({
|
|
32
|
+
isWithinTree: false,
|
|
31
33
|
announceUpdate: () => {},
|
|
32
34
|
expandedStateCache: { current: /* @__PURE__ */ new Map() },
|
|
33
|
-
scrollElementIntoView: () => {}
|
|
35
|
+
scrollElementIntoView: () => {},
|
|
36
|
+
trailingActionShortcutText: ""
|
|
34
37
|
});
|
|
35
38
|
const ItemContext = /*#__PURE__*/ React.createContext({
|
|
36
39
|
itemId: "",
|
|
@@ -41,7 +44,9 @@ const ItemContext = /*#__PURE__*/ React.createContext({
|
|
|
41
44
|
setIsExpanded: () => {},
|
|
42
45
|
leadingVisualId: "",
|
|
43
46
|
trailingVisualId: "",
|
|
44
|
-
trailingActionId: ""
|
|
47
|
+
trailingActionId: "",
|
|
48
|
+
subTreeAriaLabel: void 0,
|
|
49
|
+
subTreeAriaLabelledBy: void 0
|
|
45
50
|
});
|
|
46
51
|
const LoadingPlaceholderContext = /*#__PURE__*/ React.createContext(false);
|
|
47
52
|
const TOGGLE_ICON_SIZE = 12;
|
|
@@ -64,7 +69,7 @@ const Root = ({ "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, chil
|
|
|
64
69
|
document.removeEventListener("mouseup", onMouseUp);
|
|
65
70
|
};
|
|
66
71
|
}, []);
|
|
67
|
-
|
|
72
|
+
useTreeRovingTabIndex({
|
|
68
73
|
containerRef,
|
|
69
74
|
mouseDownRef
|
|
70
75
|
});
|
|
@@ -94,11 +99,15 @@ const Root = ({ "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, chil
|
|
|
94
99
|
}, []);
|
|
95
100
|
const expandedStateCache = React.useRef(null);
|
|
96
101
|
if (expandedStateCache.current === null) expandedStateCache.current = /* @__PURE__ */ new Map();
|
|
102
|
+
const platform = usePlatform();
|
|
103
|
+
const trailingActionShortcutText = React.useMemo(() => getTrailingActionShortcutText(platform), [platform]);
|
|
97
104
|
return /* @__PURE__ */ jsx(RootContext.Provider, {
|
|
98
105
|
value: {
|
|
106
|
+
isWithinTree: true,
|
|
99
107
|
announceUpdate,
|
|
100
108
|
expandedStateCache,
|
|
101
|
-
scrollElementIntoView
|
|
109
|
+
scrollElementIntoView,
|
|
110
|
+
trailingActionShortcutText
|
|
102
111
|
},
|
|
103
112
|
children: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(VisuallyHidden, { children: /* @__PURE__ */ jsx(AriaStatus, {
|
|
104
113
|
announceOnShow: true,
|
|
@@ -126,7 +135,7 @@ const ItemImpl = fixedForwardRef(({ id: itemId, containIntrinsicSize, current: i
|
|
|
126
135
|
leadingVisual: LeadingVisual,
|
|
127
136
|
trailingVisual: TrailingVisual
|
|
128
137
|
});
|
|
129
|
-
const { expandedStateCache, scrollElementIntoView } = React.useContext(RootContext);
|
|
138
|
+
const { isWithinTree, expandedStateCache, scrollElementIntoView, trailingActionShortcutText } = React.useContext(RootContext);
|
|
130
139
|
const labelId = useId$1();
|
|
131
140
|
const leadingVisualId = useId$1();
|
|
132
141
|
const trailingVisualId = useId$1();
|
|
@@ -146,7 +155,7 @@ const ItemImpl = fixedForwardRef(({ id: itemId, containIntrinsicSize, current: i
|
|
|
146
155
|
const [isSubTreeEmpty, setIsSubTreeEmpty] = React.useState(!hasSubTree);
|
|
147
156
|
const [actionCommandPressed, setActionCommandPressed] = React.useState(false);
|
|
148
157
|
const [isFocused, setIsFocused] = React.useState(false);
|
|
149
|
-
const
|
|
158
|
+
const [initialTabIndex] = React.useState(!isWithinTree || isCurrentItem ? 0 : -1);
|
|
150
159
|
const setIsExpandedWithCache = React.useCallback((newIsExpanded) => {
|
|
151
160
|
var _expandedStateCache$c3;
|
|
152
161
|
setIsExpanded(newIsExpanded);
|
|
@@ -200,12 +209,11 @@ const ItemImpl = fixedForwardRef(({ id: itemId, containIntrinsicSize, current: i
|
|
|
200
209
|
activateActionsDialog
|
|
201
210
|
]);
|
|
202
211
|
const ariaDescribedByIds = [slots.leadingVisual ? leadingVisualId : null, slots.trailingVisual ? trailingVisualId : null].filter(Boolean);
|
|
203
|
-
const trailingActionShortcutText = `Press (${getAccessibleKeybindingHintString(`Shift+${platform === "apple" ? "Meta" : "Control"}+U`, platform)}) for more actions.`;
|
|
204
212
|
const itemElement = /* @__PURE__ */ jsxs(ItemElement, {
|
|
205
213
|
...restProps,
|
|
206
214
|
className: clsx("PRIVATE_TreeView-item", className, TreeView_module_css_default.TreeViewItem),
|
|
207
215
|
ref,
|
|
208
|
-
tabIndex:
|
|
216
|
+
tabIndex: initialTabIndex,
|
|
209
217
|
id: itemId,
|
|
210
218
|
role: "treeitem",
|
|
211
219
|
"aria-label": secondaryActions ? ariaLabel ? `${ariaLabel}. ${trailingActionShortcutText}` : void 0 : ariaLabel,
|
|
@@ -288,7 +296,9 @@ const ItemImpl = fixedForwardRef(({ id: itemId, containIntrinsicSize, current: i
|
|
|
288
296
|
setIsExpanded: setIsExpandedWithCache,
|
|
289
297
|
leadingVisualId,
|
|
290
298
|
trailingVisualId,
|
|
291
|
-
trailingActionId
|
|
299
|
+
trailingActionId,
|
|
300
|
+
subTreeAriaLabel: ariaLabel,
|
|
301
|
+
subTreeAriaLabelledBy: ariaLabel ? void 0 : ariaLabelledby || labelId
|
|
292
302
|
},
|
|
293
303
|
children: isPolymorphic ? /* @__PURE__ */ jsx("li", {
|
|
294
304
|
role: "none",
|
|
@@ -297,6 +307,9 @@ const ItemImpl = fixedForwardRef(({ id: itemId, containIntrinsicSize, current: i
|
|
|
297
307
|
});
|
|
298
308
|
});
|
|
299
309
|
const Item = Object.assign(ItemImpl, { displayName: "TreeView.Item" });
|
|
310
|
+
function getTrailingActionShortcutText(platform) {
|
|
311
|
+
return `Press (${getAccessibleKeybindingHintString(`Shift+${platform === "apple" ? "Meta" : "Control"}+U`, platform)}) for more actions.`;
|
|
312
|
+
}
|
|
300
313
|
/** Lines to indicate the depth of an item in a TreeView */
|
|
301
314
|
const LevelIndicatorLines = ({ level }) => {
|
|
302
315
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -309,11 +322,10 @@ const LevelIndicatorLines = ({ level }) => {
|
|
|
309
322
|
};
|
|
310
323
|
const SubTree = ({ count, state, children, "aria-label": ariaLabel }) => {
|
|
311
324
|
const { announceUpdate } = React.useContext(RootContext);
|
|
312
|
-
const { itemId, isExpanded, isSubTreeEmpty, setIsSubTreeEmpty } = React.useContext(ItemContext);
|
|
325
|
+
const { itemId, isExpanded, isSubTreeEmpty, setIsSubTreeEmpty, subTreeAriaLabel, subTreeAriaLabelledBy } = React.useContext(ItemContext);
|
|
313
326
|
const loadingItemRef = React.useRef(null);
|
|
314
327
|
const ref = React.useRef(null);
|
|
315
328
|
const [loadingFocused, setLoadingFocused] = React.useState(false);
|
|
316
|
-
const [subTreeLabel, setSubTreeLabel] = React.useState("");
|
|
317
329
|
const previousState = usePreviousValue(state);
|
|
318
330
|
const { safeSetTimeout } = useSafeTimeout();
|
|
319
331
|
React.useEffect(() => {
|
|
@@ -328,10 +340,11 @@ const SubTree = ({ count, state, children, "aria-label": ariaLabel }) => {
|
|
|
328
340
|
children
|
|
329
341
|
]);
|
|
330
342
|
React.useEffect(() => {
|
|
343
|
+
const isDoneLoading = previousState === "loading" && state === "done";
|
|
344
|
+
if (!isDoneLoading && state !== "loading") return;
|
|
331
345
|
const parentElement = document.getElementById(itemId);
|
|
332
346
|
if (!parentElement) return;
|
|
333
|
-
|
|
334
|
-
if (previousState === "loading" && state === "done") {
|
|
347
|
+
if (isDoneLoading) {
|
|
335
348
|
var _ref$current;
|
|
336
349
|
const parentName = getAccessibleName(parentElement);
|
|
337
350
|
if ((_ref$current = ref.current) !== null && _ref$current !== void 0 && _ref$current.childElementCount) announceUpdate(`${parentName} content loaded`);
|
|
@@ -385,7 +398,8 @@ const SubTree = ({ count, state, children, "aria-label": ariaLabel }) => {
|
|
|
385
398
|
margin: 0
|
|
386
399
|
},
|
|
387
400
|
ref,
|
|
388
|
-
"aria-label": ariaLabel ||
|
|
401
|
+
"aria-label": ariaLabel || subTreeAriaLabel,
|
|
402
|
+
"aria-labelledby": ariaLabel || subTreeAriaLabel ? void 0 : subTreeAriaLabelledBy,
|
|
389
403
|
children: [state === "loading" ? /* @__PURE__ */ jsx(LoadingItem, {
|
|
390
404
|
ref: loadingItemRef,
|
|
391
405
|
count
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { c } from "../utils/react-compiler-runtime.js";
|
|
2
|
+
import { getNextFocusableElement } from "./useRovingTabIndex.js";
|
|
3
|
+
import { useEffect } from "react";
|
|
4
|
+
import { isEditableElement } from "@primer/behaviors/utils";
|
|
5
|
+
//#region src/TreeView/useTreeRovingTabIndex.ts
|
|
6
|
+
const TREE_ITEM = "[role=\"treeitem\"]";
|
|
7
|
+
const CURRENT_TREE_ITEM = `${TREE_ITEM}[aria-current]:not([aria-current="false"])`;
|
|
8
|
+
const TABBABLE_TREE_ITEM = `${TREE_ITEM}[tabindex="0"]`;
|
|
9
|
+
const NESTED_TABBABLE = [
|
|
10
|
+
"a[href]",
|
|
11
|
+
"area[href]",
|
|
12
|
+
"button",
|
|
13
|
+
"input:not([type=\"hidden\"])",
|
|
14
|
+
"select",
|
|
15
|
+
"textarea",
|
|
16
|
+
"iframe",
|
|
17
|
+
"summary",
|
|
18
|
+
"audio[controls]",
|
|
19
|
+
"video[controls]",
|
|
20
|
+
"[contenteditable]:not([contenteditable=\"false\"])",
|
|
21
|
+
"[tabindex]"
|
|
22
|
+
].map((selector) => `${selector}:not(${TREE_ITEM}):not([tabindex="-1"])`).join(",");
|
|
23
|
+
const NAVIGATION_KEYS = /* @__PURE__ */ new Set([
|
|
24
|
+
"ArrowUp",
|
|
25
|
+
"ArrowDown",
|
|
26
|
+
"ArrowLeft",
|
|
27
|
+
"ArrowRight",
|
|
28
|
+
"Home",
|
|
29
|
+
"End",
|
|
30
|
+
"PageUp",
|
|
31
|
+
"PageDown",
|
|
32
|
+
"Backspace"
|
|
33
|
+
]);
|
|
34
|
+
/**
|
|
35
|
+
* Roving tabindex and arrow key navigation for `TreeView`.
|
|
36
|
+
*
|
|
37
|
+
* Items render `tabIndex={-1}` (or `0` for the item that is current when it mounts), so this hook
|
|
38
|
+
* only has to pick one tab stop, keep it in sync with focus, and take nested controls out of the
|
|
39
|
+
* tab order. It doesn't rewrite every treeitem on mount, which is what made `useFocusZone`
|
|
40
|
+
* expensive for large trees.
|
|
41
|
+
*/
|
|
42
|
+
function useTreeRovingTabIndex(t0) {
|
|
43
|
+
const $ = c(5);
|
|
44
|
+
const { containerRef, mouseDownRef, preventScroll: t1 } = t0;
|
|
45
|
+
const preventScroll = t1 === void 0 ? true : t1;
|
|
46
|
+
let t2;
|
|
47
|
+
let t3;
|
|
48
|
+
if ($[0] !== containerRef || $[1] !== mouseDownRef || $[2] !== preventScroll) {
|
|
49
|
+
t2 = () => {
|
|
50
|
+
const root = containerRef.current;
|
|
51
|
+
if (!root) return;
|
|
52
|
+
const container = root;
|
|
53
|
+
let tabStop = null;
|
|
54
|
+
const setTabStop = function setTabStop(element) {
|
|
55
|
+
var _tabStop;
|
|
56
|
+
if (element === tabStop) return;
|
|
57
|
+
(_tabStop = tabStop) === null || _tabStop === void 0 || _tabStop.setAttribute("tabindex", "-1");
|
|
58
|
+
element === null || element === void 0 || element.setAttribute("tabindex", "0");
|
|
59
|
+
tabStop = element;
|
|
60
|
+
};
|
|
61
|
+
const getPreferredItem = function getPreferredItem(t4) {
|
|
62
|
+
var _ref, _container$querySelec;
|
|
63
|
+
const candidate = t4 === void 0 ? null : t4;
|
|
64
|
+
return (_ref = (_container$querySelec = container.querySelector(CURRENT_TREE_ITEM)) !== null && _container$querySelec !== void 0 ? _container$querySelec : candidate) !== null && _ref !== void 0 ? _ref : container.querySelector(TREE_ITEM);
|
|
65
|
+
};
|
|
66
|
+
const removeElementFromTabOrder = function removeElementFromTabOrder(element_0) {
|
|
67
|
+
if (element_0.matches(NESTED_TABBABLE) || element_0 !== tabStop && element_0.matches(TABBABLE_TREE_ITEM)) element_0.setAttribute("tabindex", "-1");
|
|
68
|
+
};
|
|
69
|
+
const removeFromTabOrder = function removeFromTabOrder(root_0) {
|
|
70
|
+
removeElementFromTabOrder(root_0);
|
|
71
|
+
for (const element_1 of root_0.querySelectorAll(NESTED_TABBABLE)) element_1.setAttribute("tabindex", "-1");
|
|
72
|
+
for (const element_2 of root_0.querySelectorAll(TABBABLE_TREE_ITEM)) if (element_2 !== tabStop) element_2.setAttribute("tabindex", "-1");
|
|
73
|
+
};
|
|
74
|
+
const activeElement = document.activeElement;
|
|
75
|
+
setTabStop(getPreferredItem(activeElement instanceof HTMLElement && container.contains(activeElement) && activeElement.getAttribute("role") === "treeitem" ? activeElement : null));
|
|
76
|
+
removeFromTabOrder(container);
|
|
77
|
+
const observer = new MutationObserver((mutations) => {
|
|
78
|
+
for (const mutation of mutations) {
|
|
79
|
+
if (mutation.type === "attributes") {
|
|
80
|
+
if (mutation.target instanceof Element) removeElementFromTabOrder(mutation.target);
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
for (const node of mutation.addedNodes) if (node instanceof Element) removeFromTabOrder(node);
|
|
84
|
+
}
|
|
85
|
+
if (!tabStop || !container.contains(tabStop)) {
|
|
86
|
+
tabStop = null;
|
|
87
|
+
setTabStop(getPreferredItem());
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
observer.observe(container, {
|
|
91
|
+
childList: true,
|
|
92
|
+
subtree: true,
|
|
93
|
+
attributeFilter: [
|
|
94
|
+
"href",
|
|
95
|
+
"tabindex",
|
|
96
|
+
"contenteditable",
|
|
97
|
+
"controls"
|
|
98
|
+
]
|
|
99
|
+
});
|
|
100
|
+
const onFocusIn = function onFocusIn(event) {
|
|
101
|
+
const target = event.target;
|
|
102
|
+
if (!(target instanceof HTMLElement)) return;
|
|
103
|
+
const isTreeItem = target.getAttribute("role") === "treeitem";
|
|
104
|
+
const from = event.relatedTarget;
|
|
105
|
+
if (from instanceof Element && !container.contains(from) && !(mouseDownRef !== null && mouseDownRef !== void 0 && mouseDownRef.current)) {
|
|
106
|
+
const preferred = getPreferredItem(isTreeItem ? target : null);
|
|
107
|
+
if (preferred && preferred !== target) {
|
|
108
|
+
preferred.focus({ preventScroll });
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
if (isTreeItem) setTabStop(target);
|
|
113
|
+
};
|
|
114
|
+
const onKeyDown = function onKeyDown(event_0) {
|
|
115
|
+
var _getNextFocusableElem;
|
|
116
|
+
if (event_0.defaultPrevented || !NAVIGATION_KEYS.has(event_0.key)) return;
|
|
117
|
+
if ((event_0.key === "ArrowLeft" || event_0.key === "ArrowRight") && (event_0.altKey || event_0.metaKey)) return;
|
|
118
|
+
const from_0 = document.activeElement;
|
|
119
|
+
if (!(from_0 instanceof HTMLElement)) return;
|
|
120
|
+
try {
|
|
121
|
+
if (from_0.closest("dialog:modal")) return;
|
|
122
|
+
} catch {}
|
|
123
|
+
if (from_0.getAttribute("role") !== "treeitem") {
|
|
124
|
+
if (!isEditableElement(from_0)) event_0.preventDefault();
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
((_getNextFocusableElem = getNextFocusableElement(from_0, event_0)) !== null && _getNextFocusableElem !== void 0 ? _getNextFocusableElem : from_0).focus({ preventScroll });
|
|
128
|
+
event_0.preventDefault();
|
|
129
|
+
};
|
|
130
|
+
container.addEventListener("focusin", onFocusIn);
|
|
131
|
+
container.addEventListener("keydown", onKeyDown);
|
|
132
|
+
return () => {
|
|
133
|
+
observer.disconnect();
|
|
134
|
+
container.removeEventListener("focusin", onFocusIn);
|
|
135
|
+
container.removeEventListener("keydown", onKeyDown);
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
t3 = [
|
|
139
|
+
containerRef,
|
|
140
|
+
mouseDownRef,
|
|
141
|
+
preventScroll
|
|
142
|
+
];
|
|
143
|
+
$[0] = containerRef;
|
|
144
|
+
$[1] = mouseDownRef;
|
|
145
|
+
$[2] = preventScroll;
|
|
146
|
+
$[3] = t2;
|
|
147
|
+
$[4] = t3;
|
|
148
|
+
} else {
|
|
149
|
+
t2 = $[3];
|
|
150
|
+
t3 = $[4];
|
|
151
|
+
}
|
|
152
|
+
useEffect(t2, t3);
|
|
153
|
+
}
|
|
154
|
+
//#endregion
|
|
155
|
+
export { useTreeRovingTabIndex };
|
|
@@ -25,7 +25,7 @@ import { ActionsProps, PageHeader, PageHeaderProps, TitleProps } from "../PageHe
|
|
|
25
25
|
import { SkeletonBox, SkeletonBoxProps } from "../Skeleton/SkeletonBox.js";
|
|
26
26
|
import { BlankslateProps } from "../Blankslate/Blankslate.js";
|
|
27
27
|
import { Blankslate as BlankslateContainer } from "../Blankslate/index.js";
|
|
28
|
-
import { CardActionProps as ActionProps, CardDescriptionProps as DescriptionProps, CardHeadingProps as HeadingProps, CardIconProps as IconProps, CardImageProps as ImageProps, CardMetadataProps as MetadataProps, CardProps } from "../Card/Card.js";
|
|
28
|
+
import { CardActionProps as ActionProps, CardButtonProps as ButtonProps, CardDescriptionProps as DescriptionProps, CardHeadingProps as HeadingProps, CardIconProps as IconProps, CardImageProps as ImageProps, CardLinkProps as LinkProps, CardMetadataProps as MetadataProps, CardProps } from "../Card/Card.js";
|
|
29
29
|
import { Card } from "../Card/index.js";
|
|
30
30
|
import { TableBulkActionsProps } from "../DataTable/TableBulkActions.js";
|
|
31
31
|
import { DataTable, DataTableBulkActionsContext, DataTableProps } from "../DataTable/DataTable.js";
|
|
@@ -52,4 +52,4 @@ import { useTabPanel } from "./Tabs/useTabPanel.js";
|
|
|
52
52
|
import { TopicTagProps } from "../TopicTag/TopicTag.js";
|
|
53
53
|
import { TopicTagGroupProps } from "../TopicTag/TopicTagGroup.js";
|
|
54
54
|
import { TopicTag } from "../TopicTag/index.js";
|
|
55
|
-
export { ActionBar, type ActionBarButtonProps, type ActionBarMenuItemProps, type ActionBarMenuProps, type ActionBarProps, Announce, type AnnounceProps, AriaAlert, type AriaAlertProps, AriaStatus, type AriaStatusProps, BlankslateContainer as Blankslate, type BlankslateProps, ButtonBase, type ButtonBaseProps, Card, type ActionProps as CardActionProps, type DescriptionProps as CardDescriptionProps, type HeadingProps as CardHeadingProps, type IconProps as CardIconProps, type ImageProps as CardImageProps, type MetadataProps as CardMetadataProps, type CardProps, type CellAlignment, type Column, type ColumnWidth, DataTable, type DataTableBulkActionsContext, type DataTableData, type DataTableProps, type DataTableRowGroup, type DataTableRowId, DefaultFeatureFlags, Dialog, type DialogButtonProps, type DialogHeaderProps, type DialogHeight, type DialogProps, type DialogWidth, FeatureFlags, type FeatureFlagsProps, FilteredActionList, type FilteredActionListInputProps, FilteredActionListLoadingTypes, type FilteredActionListProps, Hidden, type HiddenProps, InlineMessage, type InlineMessageProps, IssueLabel, type IssueLabelProps, KeybindingHint, type KeybindingHintProps, NavList, type NavListDividerProps, type NavListGroupProps, type NavListItemProps, type NavListLeadingVisualProps, type NavListProps, type NavListSubNavProps, type NavListTrailingVisualProps, type ObjectPaths, PageHeader, type ActionsProps as PageHeaderActionsProps, type PageHeaderProps, type TitleProps as PageHeaderTitleProps, ScrollableRegion, type ScrollableRegionProps, SelectPanel, type SelectPanelMessageProps, type SelectPanelProps, type SelectPanelSecondaryActionProps, SkeletonAvatar, type SkeletonAvatarProps, SkeletonBox, type SkeletonBoxProps, SkeletonText, type SkeletonTextProps, SlotConfig, Stack, type StackItemProps, type StackProps, type TabListProps, type TabPanelProps, type TabProps, Table, type TableActionsProps, type TableBodyProps, type TableBulkActionsProps, type TableCellProps, type TableContainerProps, type TableGroupProps, type TableHeadProps, type TableHeaderProps, type TableProps, type TableRowProps, type TableRowSelectionProps, type TableSelectionHeaderProps, type TableSubtitleProps, type TableTitleProps, Tabs, type TabsProps, type TitleProps, Tooltip, type TooltipProps, TopicTag, type TopicTagGroupProps, type TopicTagProps, _default as UnderlinePanels, type PanelProps as UnderlinePanelsPanelProps, type UnderlinePanelsProps, type TabProps$1 as UnderlinePanelsTabProps, type UniqueRow, createColumnHelper, getAccessibleKeybindingHintString, useFeatureFlag, useOverflow, useSlots, useTab, useTabList, useTabPanel };
|
|
55
|
+
export { ActionBar, type ActionBarButtonProps, type ActionBarMenuItemProps, type ActionBarMenuProps, type ActionBarProps, Announce, type AnnounceProps, AriaAlert, type AriaAlertProps, AriaStatus, type AriaStatusProps, BlankslateContainer as Blankslate, type BlankslateProps, ButtonBase, type ButtonBaseProps, Card, type ActionProps as CardActionProps, type ButtonProps as CardButtonProps, type DescriptionProps as CardDescriptionProps, type HeadingProps as CardHeadingProps, type IconProps as CardIconProps, type ImageProps as CardImageProps, type LinkProps as CardLinkProps, type MetadataProps as CardMetadataProps, type CardProps, type CellAlignment, type Column, type ColumnWidth, DataTable, type DataTableBulkActionsContext, type DataTableData, type DataTableProps, type DataTableRowGroup, type DataTableRowId, DefaultFeatureFlags, Dialog, type DialogButtonProps, type DialogHeaderProps, type DialogHeight, type DialogProps, type DialogWidth, FeatureFlags, type FeatureFlagsProps, FilteredActionList, type FilteredActionListInputProps, FilteredActionListLoadingTypes, type FilteredActionListProps, Hidden, type HiddenProps, InlineMessage, type InlineMessageProps, IssueLabel, type IssueLabelProps, KeybindingHint, type KeybindingHintProps, NavList, type NavListDividerProps, type NavListGroupProps, type NavListItemProps, type NavListLeadingVisualProps, type NavListProps, type NavListSubNavProps, type NavListTrailingVisualProps, type ObjectPaths, PageHeader, type ActionsProps as PageHeaderActionsProps, type PageHeaderProps, type TitleProps as PageHeaderTitleProps, ScrollableRegion, type ScrollableRegionProps, SelectPanel, type SelectPanelMessageProps, type SelectPanelProps, type SelectPanelSecondaryActionProps, SkeletonAvatar, type SkeletonAvatarProps, SkeletonBox, type SkeletonBoxProps, SkeletonText, type SkeletonTextProps, SlotConfig, Stack, type StackItemProps, type StackProps, type TabListProps, type TabPanelProps, type TabProps, Table, type TableActionsProps, type TableBodyProps, type TableBulkActionsProps, type TableCellProps, type TableContainerProps, type TableGroupProps, type TableHeadProps, type TableHeaderProps, type TableProps, type TableRowProps, type TableRowSelectionProps, type TableSelectionHeaderProps, type TableSubtitleProps, type TableTitleProps, Tabs, type TabsProps, type TitleProps, Tooltip, type TooltipProps, TopicTag, type TopicTagGroupProps, type TopicTagProps, _default as UnderlinePanels, type PanelProps as UnderlinePanelsPanelProps, type UnderlinePanelsProps, type TabProps$1 as UnderlinePanelsTabProps, type UniqueRow, createColumnHelper, getAccessibleKeybindingHintString, useFeatureFlag, useOverflow, useSlots, useTab, useTabList, useTabPanel };
|
package/dist/index.js
CHANGED
|
@@ -59,7 +59,6 @@ import Avatar from "./Avatar/Avatar.js";
|
|
|
59
59
|
import AvatarStack from "./AvatarStack/AvatarStack.js";
|
|
60
60
|
import { Banner } from "./Banner/index.js";
|
|
61
61
|
import BranchName_default from "./BranchName/BranchName.js";
|
|
62
|
-
import Details from "./Details/Details.js";
|
|
63
62
|
import Breadcrumbs_default, { Breadcrumb } from "./Breadcrumbs/Breadcrumbs.js";
|
|
64
63
|
import ButtonGroup from "./ButtonGroup/ButtonGroup.js";
|
|
65
64
|
import { Stack } from "./Stack/index.js";
|
|
@@ -74,6 +73,7 @@ import Textarea from "./Textarea/Textarea.js";
|
|
|
74
73
|
import FormControl_default from "./FormControl/FormControl.js";
|
|
75
74
|
import CheckboxGroup_default from "./CheckboxGroup/CheckboxGroup.js";
|
|
76
75
|
import CircleBadge_default from "./CircleBadge/CircleBadge.js";
|
|
76
|
+
import Details from "./Details/Details.js";
|
|
77
77
|
import Flash from "./Flash/Flash.js";
|
|
78
78
|
import Header_default from "./Header/Header.js";
|
|
79
79
|
import Label_default from "./Label/index.js";
|
|
@@ -2192,6 +2192,22 @@
|
|
|
2192
2192
|
"id": "experimental-components-card-features--with-image",
|
|
2193
2193
|
"code": "() => {\n return (\n <Card>\n <Card.Image src=\"https://github.com/octocat.png\" alt=\"Octocat\" />\n <Card.Heading>Card with Image</Card.Heading>\n <Card.Description>\n This card uses an edge-to-edge image instead of an icon.\n </Card.Description>\n </Card>\n )\n}"
|
|
2194
2194
|
},
|
|
2195
|
+
{
|
|
2196
|
+
"id": "experimental-components-card-features--compact",
|
|
2197
|
+
"code": "() => {\n return (\n <Card layout=\"compact\">\n <Card.Icon icon={RepoIcon} />\n <Card.Heading>primer/react</Card.Heading>\n <Card.Description>\n The compact layout uses tighter spacing, an icon without a background\n container, and a smaller title.\n </Card.Description>\n <Card.Metadata>\n <StarIcon size={16} />\n 1.2k stars\n </Card.Metadata>\n </Card>\n )\n}"
|
|
2198
|
+
},
|
|
2199
|
+
{
|
|
2200
|
+
"id": "experimental-components-card-features--with-link",
|
|
2201
|
+
"code": "({ fullCardHitArea }) => (\n <Card shadow={false} padding=\"regular\">\n <Card.Icon icon={RepoIcon} />\n <Card.Heading>\n <Card.Link href=\"#primer-react\" fullCardHitArea={fullCardHitArea}>\n primer/react\n </Card.Link>\n </Card.Heading>\n <Card.Description>\n Use fullCardHitArea to make the entire card a link. The Star action\n remains separate.\n </Card.Description>\n <Card.Metadata>\n <Button leadingVisual={StarIcon} size=\"small\">\n Star <VisuallyHidden>primer/react</VisuallyHidden>\n </Button>\n </Card.Metadata>\n <Card.Action>\n <IconButton\n icon={KebabHorizontalIcon}\n aria-label=\"More options for primer/react\"\n variant=\"invisible\"\n />\n </Card.Action>\n </Card>\n)"
|
|
2202
|
+
},
|
|
2203
|
+
{
|
|
2204
|
+
"id": "experimental-components-card-features--with-button",
|
|
2205
|
+
"code": "({ fullCardHitArea }) => {\n const [opened, setOpened] = useState(false)\n return (\n <div className={classes.CardList}>\n <Card layout=\"compact\" padding=\"regular\" shadow={false}>\n <Card.Icon icon={RepoIcon} />\n <Card.Heading>\n <Card.Button\n onClick={() => setOpened(true)}\n fullCardHitArea={fullCardHitArea}\n >\n Open repository details\n </Card.Button>\n </Card.Heading>\n <Card.Description>\n Use a button for an action that does not navigate to another page.\n </Card.Description>\n </Card>\n <Card>\n <Card.Heading>\n <Card.Button disabled fullCardHitArea={fullCardHitArea}>\n Repository details unavailable\n </Card.Button>\n </Card.Heading>\n <Card.Description>\n A disabled primary action cannot be activated.\n </Card.Description>\n </Card>\n {opened && (\n <section aria-label=\"Repository details\">\n <h3>primer/react</h3>\n <p>{\"React components for GitHub's Primer Design System.\"}</p>\n <Button onClick={() => setOpened(false)}>\n Close repository details\n </Button>\n </section>\n )}\n </div>\n )\n}"
|
|
2206
|
+
},
|
|
2207
|
+
{
|
|
2208
|
+
"id": "experimental-components-card-features--custom-content",
|
|
2209
|
+
"code": "() => {\n const [pinned, setPinned] = useState<string[]>([])\n return (\n <div className={classes.EqualHeightGrid}>\n {[\n 'primer/react',\n 'primer/primitives-with-a-long-unbroken-repository-name',\n ].map((name, index) => (\n <Card key={name} padding=\"regular\" borderRadius=\"medium\" shadow={false}>\n <div className={classes.ComposedBody}>\n <div className={classes.ComposedHeader}>\n <Card.Heading className={classes.ComposedHeading}>\n <Card.Link href={`#${name}`} fullCardHitArea>\n {name}\n </Card.Link>\n </Card.Heading>\n <IconButton\n icon={PinIcon}\n variant=\"invisible\"\n size=\"small\"\n aria-label={`Pin ${name}`}\n aria-pressed={pinned.includes(name)}\n onClick={() =>\n setPinned((value) =>\n value.includes(name)\n ? value.filter((item) => item !== name)\n : [...value, name],\n )\n }\n />\n </div>\n <Card.Description>\n {index === 0\n ? 'React components.'\n : 'Design tokens for color, spacing, typography, and motion, shared across GitHub interfaces.'}\n </Card.Description>\n <div className={classes.ComposedFooter}>\n <Button size=\"small\" leadingVisual={StarIcon}>\n Star <VisuallyHidden>{name}</VisuallyHidden>\n </Button>\n <ActionMenu>\n <ActionMenu.Anchor>\n <IconButton\n icon={KebabHorizontalIcon}\n variant=\"invisible\"\n size=\"small\"\n aria-label={`More options for ${name}`}\n />\n </ActionMenu.Anchor>\n <ActionMenu.Overlay>\n <ActionList>\n <ActionList.LinkItem href={`#settings-${name}`}>\n Repository settings\n </ActionList.LinkItem>\n </ActionList>\n </ActionMenu.Overlay>\n </ActionMenu>\n </div>\n </div>\n </Card>\n ))}\n </div>\n )\n}"
|
|
2210
|
+
},
|
|
2195
2211
|
{
|
|
2196
2212
|
"id": "experimental-components-card-features--with-metadata",
|
|
2197
2213
|
"code": "() => {\n return (\n <Card>\n <Card.Icon icon={RepoIcon} />\n <Card.Heading>primer/react</Card.Heading>\n <Card.Description>\n {\n \"GitHub's design system implemented as React components for building consistent user interfaces.\"\n }\n </Card.Description>\n <Card.Metadata>\n <StarIcon size={16} />\n 1.2k stars\n </Card.Metadata>\n </Card>\n )\n}"
|
|
@@ -2218,7 +2234,7 @@
|
|
|
2218
2234
|
"name": "children",
|
|
2219
2235
|
"type": "React.ReactNode",
|
|
2220
2236
|
"required": true,
|
|
2221
|
-
"description": "The contents of the card. Provide either `Card.*` subcomponents (for example `Card.Heading`, `Card.Description`, `Card.Metadata`) or
|
|
2237
|
+
"description": "The contents of the card. Provide either direct `Card.*` subcomponents (for example `Card.Heading`, `Card.Description`, `Card.Metadata`) for the predefined layout or a custom wrapper for free-form composition. A custom wrapper fills the available card height, allowing a flex-column body with margin-top: auto on footer actions. Grid parents stretch cards by default; when cards are wrapped in list items, consumers must also make the cards fill those items. A card with no children will not render."
|
|
2222
2238
|
},
|
|
2223
2239
|
{
|
|
2224
2240
|
"name": "className",
|
|
@@ -2227,9 +2243,21 @@
|
|
|
2227
2243
|
},
|
|
2228
2244
|
{
|
|
2229
2245
|
"name": "padding",
|
|
2230
|
-
"type": "'none' | 'condensed' | 'normal'",
|
|
2246
|
+
"type": "'none' | 'condensed' | 'regular' | 'spacious' | 'normal'",
|
|
2231
2247
|
"defaultValue": "'normal'",
|
|
2232
|
-
"description": "
|
|
2248
|
+
"description": "Internal padding: none is 0px, condensed is 8px, regular is 16px, and spacious is 24px in either layout. The default normal padding remains 24px in the default layout and 16px in compact layout for compatibility."
|
|
2249
|
+
},
|
|
2250
|
+
{
|
|
2251
|
+
"name": "shadow",
|
|
2252
|
+
"type": "boolean",
|
|
2253
|
+
"defaultValue": "true",
|
|
2254
|
+
"description": "Whether to show the Card shadow. Set to false for a bordered, shadowless card in dense dashboards."
|
|
2255
|
+
},
|
|
2256
|
+
{
|
|
2257
|
+
"name": "layout",
|
|
2258
|
+
"type": "'default' | 'compact'",
|
|
2259
|
+
"defaultValue": "'default'",
|
|
2260
|
+
"description": "Compact layout places the icon beside the content, removes its background container, and uses a smaller heading and tighter spacing."
|
|
2233
2261
|
},
|
|
2234
2262
|
{
|
|
2235
2263
|
"name": "borderRadius",
|
|
@@ -2287,6 +2315,57 @@
|
|
|
2287
2315
|
}
|
|
2288
2316
|
]
|
|
2289
2317
|
},
|
|
2318
|
+
{
|
|
2319
|
+
"name": "Card.Link",
|
|
2320
|
+
"props": [
|
|
2321
|
+
{
|
|
2322
|
+
"name": "fullCardHitArea",
|
|
2323
|
+
"type": "boolean",
|
|
2324
|
+
"defaultValue": "false",
|
|
2325
|
+
"description": "Expand the link's hit area over the entire card, with card-wide hover and keyboard focus indicators. By default, only the link itself is clickable and receives a focus ring."
|
|
2326
|
+
},
|
|
2327
|
+
{
|
|
2328
|
+
"name": "href",
|
|
2329
|
+
"type": "string",
|
|
2330
|
+
"required": true,
|
|
2331
|
+
"description": "Navigation destination. Place Card.Link inside Card.Heading. The native link supplies keyboard activation, modifier-click, and browser context menus. Set fullCardHitArea to extend its hit area over the card; use only one expanded Card.Link or Card.Button per card. Do not nest interactive controls inside the link. Secondary native controls can be placed in Card.Action, Card.Metadata, or custom headers and footers; Card layers them above the expanded hit area. When fullCardHitArea is enabled, keep wrappers between the link and Card unpositioned, and note that other card text cannot be selected with a pointer. Leave fullCardHitArea disabled when text selection is needed."
|
|
2332
|
+
},
|
|
2333
|
+
{
|
|
2334
|
+
"name": "children",
|
|
2335
|
+
"type": "React.ReactNode",
|
|
2336
|
+
"required": true,
|
|
2337
|
+
"description": "Descriptive link text, used as the accessible name rather than the entire card contents. Accepts native anchor attributes and forwards its ref to the anchor."
|
|
2338
|
+
}
|
|
2339
|
+
]
|
|
2340
|
+
},
|
|
2341
|
+
{
|
|
2342
|
+
"name": "Card.Button",
|
|
2343
|
+
"props": [
|
|
2344
|
+
{
|
|
2345
|
+
"name": "fullCardHitArea",
|
|
2346
|
+
"type": "boolean",
|
|
2347
|
+
"defaultValue": "false",
|
|
2348
|
+
"description": "Expand the button's hit area over the entire card, with card-wide hover and keyboard focus indicators. By default, only the button itself is clickable and receives a focus ring."
|
|
2349
|
+
},
|
|
2350
|
+
{
|
|
2351
|
+
"name": "children",
|
|
2352
|
+
"type": "React.ReactNode",
|
|
2353
|
+
"required": true,
|
|
2354
|
+
"description": "Descriptive action text. Place Card.Button inside Card.Heading for an action that does not navigate. The native button supplies Enter/Space activation and disabled behavior. Consumers provide the accessible name and onClick handler. Set fullCardHitArea for a whole-card action; use only one expanded Card.Link or Card.Button per card. Put secondary controls outside the button, in Card.Action, Card.Metadata, or custom headers and footers. When fullCardHitArea is enabled, keep wrappers between the button and Card unpositioned. Accepts native button attributes and forwards its ref to the button."
|
|
2355
|
+
},
|
|
2356
|
+
{
|
|
2357
|
+
"name": "type",
|
|
2358
|
+
"type": "'button' | 'submit' | 'reset'",
|
|
2359
|
+
"defaultValue": "'button'",
|
|
2360
|
+
"description": "Native button type. Defaults to button to avoid accidentally submitting a surrounding form."
|
|
2361
|
+
},
|
|
2362
|
+
{
|
|
2363
|
+
"name": "disabled",
|
|
2364
|
+
"type": "boolean",
|
|
2365
|
+
"description": "Disables the button, including its expanded hit area when fullCardHitArea is enabled, and removes it from the tab order. Secondary controls remain independent."
|
|
2366
|
+
}
|
|
2367
|
+
]
|
|
2368
|
+
},
|
|
2290
2369
|
{
|
|
2291
2370
|
"name": "Card.Description",
|
|
2292
2371
|
"props": [
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@primer/react",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "38.46.0-rc.
|
|
4
|
+
"version": "38.46.0-rc.e10581db0",
|
|
5
5
|
"description": "An implementation of GitHub's Primer Design System using React",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"module": "./dist/index.js",
|
|
@@ -109,12 +109,12 @@
|
|
|
109
109
|
"@primer/doc-gen": "^0.0.1",
|
|
110
110
|
"@primer/react-compiler-check": "^0.0.0",
|
|
111
111
|
"@rolldown/plugin-babel": "^0.2.4",
|
|
112
|
-
"@storybook/addon-a11y": "10.
|
|
113
|
-
"@storybook/addon-docs": "10.
|
|
114
|
-
"@storybook/addon-links": "10.
|
|
115
|
-
"@storybook/addon-mcp": "^
|
|
116
|
-
"@storybook/icons": "^2.
|
|
117
|
-
"@storybook/react-vite": "10.
|
|
112
|
+
"@storybook/addon-a11y": "10.6.2",
|
|
113
|
+
"@storybook/addon-docs": "10.6.2",
|
|
114
|
+
"@storybook/addon-links": "10.6.2",
|
|
115
|
+
"@storybook/addon-mcp": "^10.6.2",
|
|
116
|
+
"@storybook/icons": "^2.2.0",
|
|
117
|
+
"@storybook/react-vite": "10.6.2",
|
|
118
118
|
"@testing-library/dom": "^10.4.0",
|
|
119
119
|
"@testing-library/jest-dom": "^6.4.5",
|
|
120
120
|
"@testing-library/react": "^16.3.0",
|
|
@@ -169,7 +169,7 @@
|
|
|
169
169
|
"rolldown-plugin-dts": "^0.26.0",
|
|
170
170
|
"rolldown-plugin-import-css": "^0.0.0",
|
|
171
171
|
"rolldown-plugin-preserve-directives": "^0.0.0",
|
|
172
|
-
"storybook": "10.
|
|
172
|
+
"storybook": "10.6.6",
|
|
173
173
|
"terser": "5.36.0",
|
|
174
174
|
"ts-toolbelt": "9.6.0",
|
|
175
175
|
"tsx": "4.20.3",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/Breadcrumbs/Breadcrumbs.module.css.js","../../postcss-preset-primer/src/mixins/focusOutline.css"],"names":[],"mappings":"AAAA,uCACE,YAAa,CACb,6BAA8B,CAC9B,UACF,CAEA,uCAGE,eAAgB,CADhB,YAAa,CADb,cAGF,CAIE,kIAEE,YAAa,CACb,kBAAmB,CAFnB,kBAGF,CAGF,qCAGE,iBAAkB,CAFlB,kCAA2B,CAC3B,YAAa,CAEb,sBAAuB,CAEvB,wBAAiB,CAAjB,gBAAiB,CADjB,kBAEF,CAEA,mCAGE,eAuBF,CArBE,4EAJA,oBAAqB,CACrB,8CAaA,CAVA,yCAQE,oDAA8C,CAF9C,UAAW,CAJX,WAAa,CAEb,aAAe,CAKf,2CACF,CAEA,+CACE,aACF,CAGE,oDACE,YACF,CAIJ,4BACE,oBAAqB,CACrB,8CAOF,CALE,0CACE,gDAAwC,CC5D1C,eAAgB,CAFhB,8EAAgC,CAChC,kBDgEA,CAIA,kDACE,iCAA0B,CAC1B,4BAAqB,CAArB,oBAeF,CAZI,4EACE,iCAA0B,CAA1B,yBACF,CAGF,gEACE,4BAAqB,CAArB,oBACF,CAEA,gEACE,oCACF,CAKF,oDAKE,gDAAyC,CAJzC,oCAA6B,CAG7B,uCAAiC,CADjC,yCAAkC,CADlC,4BAAqB,CAArB,oBAaF,CARE,0DACE,6DAAoD,CACpD,4BAAqB,CAArB,oBACF,CAEA,kEACE,gDACF,CAIJ,uCAGE,kBAAmB,CAFnB,mBAAoB,CAGpB,iBAAkB,CAFlB,qBAAsB,CAKtB,eAAgB,CAFhB,cAAe,CACf,kBAmDF,CA7CE,2DACE,kBACF,CAEA,mDACE,aACF,CAGE,uFACE,YACF,CAGF,0EAEE,oBAAqB,CADrB,iBAWF,CARE,kFAEE,cAAe,CADf,eAMF,CAHE,0GACE,YACF,CAIJ,0EAKE,4CAAwC,CADxC,8CAAwC,CADxC,4GAAwC,CAIxC,gBAAiB,CACjB,0CAAqC,CAFrC,2CAAsC,CAGtC,eAAgB,CARhB,iBAAkB,CAUlB,0EAA4D,CAT5D,SAcF,CAHE,8CAbF,0EAcI,4EAEJ,CADE","file":"Breadcrumbs-16d81430.css","sourcesContent":[".BreadcrumbsBase {\n display: flex;\n justify-content: space-between;\n width: 100%;\n}\n\n.BreadcrumbsList {\n padding-left: 0;\n margin-top: 0;\n margin-bottom: 0;\n}\n\n[data-overflow='menu'],\n[data-overflow='menu-with-root'] {\n & .BreadcrumbsList {\n white-space: nowrap;\n display: flex;\n flex-direction: row;\n }\n}\n\n.ItemSeparator {\n color: var(--fgColor-muted);\n display: flex;\n align-self: center;\n justify-content: center;\n white-space: nowrap;\n user-select: none;\n}\n\n.ItemWrapper {\n display: inline-block;\n font-size: var(--text-body-size-medium);\n list-style: none;\n\n &::after {\n display: inline-block;\n height: 0.8em;\n /* stylelint-disable-next-line primer/spacing */\n margin: 0 0.5em;\n font-size: var(--text-body-size-medium);\n content: '';\n /* stylelint-disable-next-line primer/borders, primer/colors */\n border-right: 0.1em solid var(--fgColor-muted);\n transform: rotate(15deg) translateY(0.0625em);\n }\n\n &:first-child {\n margin-left: 0;\n }\n\n &:last-child {\n &::after {\n content: none;\n }\n }\n}\n\n.Item {\n display: inline-block;\n font-size: var(--text-body-size-medium);\n\n &:focus-visible {\n border-radius: var(--borderRadius-small);\n\n @mixin focusOutline 2px;\n }\n}\n\n[data-variant='normal'] {\n & .Item {\n color: var(--fgColor-link);\n text-decoration: none;\n\n &:not([aria-current]) {\n &:hover {\n text-decoration: underline;\n }\n }\n\n &:focus-visible {\n text-decoration: none;\n }\n\n &[aria-current] {\n color: var(--fgColor-default);\n }\n }\n}\n\n[data-variant='spacious'] {\n & .Item {\n color: var(--fgColor-default);\n text-decoration: none;\n padding-inline: var(--base-size-6);\n padding-block: var(--base-size-4);\n border-radius: var(--borderRadius-medium);\n\n &:hover {\n background: var(--control-transparent-bgColor-hover);\n text-decoration: none;\n }\n\n &[aria-current] {\n font-weight: var(--base-text-weight-semibold);\n }\n }\n}\n\n.BreadcrumbsItem {\n display: inline-grid;\n grid-auto-flow: column;\n align-items: center;\n flex: 0 99999 auto;\n min-width: auto;\n white-space: nowrap;\n list-style: none;\n\n /* allow menu items to wrap line */\n /* The overflow-menu item is marked in React (`data-overflow-menu`) instead of using\n `:has(.MenuOverlay)`, avoiding Safari's `:has()` invalidation cost. */\n &[data-overflow-menu] {\n white-space: normal;\n }\n\n &:first-child {\n margin-left: 0;\n }\n\n &:last-child {\n .ItemSeparator {\n display: none;\n }\n }\n\n .MenuDetails {\n position: relative;\n display: inline-block;\n\n & summary {\n list-style: none;\n cursor: pointer;\n\n &::-webkit-details-marker {\n display: none;\n }\n }\n }\n\n .MenuOverlay {\n position: absolute;\n z-index: 1;\n box-shadow: var(--shadow-floating-small);\n border-radius: var(--borderRadius-large);\n background-color: var(--overlay-bgColor);\n min-width: var(--overlay-width-xsmall);\n max-height: 100vh;\n max-width: var(--overlay-width-small);\n overflow: hidden;\n /* stylelint-disable-next-line primer/spacing */\n top: calc(var(--overlay-offset) + var(--control-small-size));\n\n @media (prefers-reduced-motion: no-preference) {\n animation: overlay-appear 200ms cubic-bezier(0.33, 1, 0.68, 1);\n }\n }\n}\n","@define-mixin focusOutline $outlineOffset: -2px, $outlineColor: var(--focus-outline-color, var(--focus-outlineColor)) {\n outline: 2px solid $outlineColor;\n outline-offset: $outlineOffset;\n box-shadow: none;\n}\n"]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
.prc-Card-Card-pYjuL{background-color:var(--bgColor-default,#fff);border:var(--borderWidth-thin,.0625rem) solid var(--borderColor-default,#d1d9e0);box-shadow:var(--shadow-resting-small,0 1px 1px 0 #1f23280a,0 1px 2px 0 #1f232808);display:grid;gap:var(--stack-gap-normal,1rem);grid-auto-rows:max-content auto;overflow:hidden;position:relative}.prc-Card-Card-pYjuL[data-border-radius=large]{border-radius:var(--borderRadius-large,.75rem)}.prc-Card-Card-pYjuL[data-border-radius=medium]{border-radius:var(--borderRadius-medium,.375rem)}.prc-Card-Card-pYjuL[data-padding=normal]{padding:var(--stack-padding-spacious,1.5rem)}.prc-Card-Card-pYjuL[data-padding=condensed]{padding:var(--stack-padding-condensed,.5rem)}.prc-Card-Card-pYjuL[data-padding=none]{padding:0}.prc-Card-Card-pYjuL[data-layout=compact]{align-items:flex-start;display:flex;gap:var(--stack-gap-condensed,.5rem)}.prc-Card-Card-pYjuL[data-layout=compact][data-padding=normal]{padding:var(--stack-padding-normal,1rem)}.prc-Card-CardHeader-P5Qbb{display:block;height:auto;width:100%}.prc-Card-Card-pYjuL:where([data-layout=compact]) .prc-Card-CardHeader-P5Qbb{flex:0 0 auto;width:auto}.prc-Card-CardHeaderEdgeToEdge-3yCqT{margin-left:calc(var(--stack-padding-spacious,1.5rem)*-1);margin-right:calc(var(--stack-padding-spacious,1.5rem)*-1);margin-top:calc(var(--stack-padding-spacious,1.5rem)*-1);width:calc(100% + var(--stack-padding-spacious,1.5rem)*2)}.prc-Card-CardImage-2M8DM{display:block;height:auto;width:100%}.prc-Card-CardIcon-mIMfj{align-items:center;color:var(--fgColor-muted,#59636e);display:flex;justify-content:flex-start}.prc-Card-Card-pYjuL:where([data-layout=default]) .prc-Card-CardIcon-mIMfj{background-color:var(--bgColor-muted,#f6f8fa);border-radius:var(--borderRadius-medium,.375rem);height:var(--base-size-32,2rem);justify-content:center;width:var(--base-size-32,2rem)}.prc-Card-CardBody-W1o-l{display:grid;gap:var(--stack-gap-normal,1rem)}.prc-Card-Card-pYjuL:where([data-layout=compact]) .prc-Card-CardBody-W1o-l{flex:1 1 auto}.prc-Card-CardContent-omZDS{display:grid;gap:var(--stack-gap-condensed,.5rem)}.prc-Card-CardHeading-3HXyS{color:var(--fgColor-default,#1f2328);font:var(--text-title-shorthand-small,600 1rem/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji");margin:0}.prc-Card-Card-pYjuL:where([data-layout=compact]) .prc-Card-CardHeading-3HXyS{font-size:var(--text-body-size-medium,.875rem);position:relative;top:calc(var(--base-size-4,.25rem)*-1)}.prc-Card-CardDescription-MnJ3F{margin:0}.prc-Card-CardDescription-MnJ3F,.prc-Card-CardMetadataContainer-K-UlH{color:var(--fgColor-muted,#59636e);font:var(--text-body-shorthand-medium,400 .875rem/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji")}.prc-Card-CardMetadataContainer-K-UlH{align-items:center;display:flex;gap:var(--stack-gap-normal,1rem)}.prc-Card-CardMetadataItem-ellY9{align-items:center;display:flex;font:var(--text-body-shorthand-small,400 .75rem/1.625 -apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji");gap:var(--stack-gap-condensed,.5rem)}.prc-Card-CardAction-VtI49{position:absolute;right:var(--base-size-16,1rem);top:var(--base-size-16,1rem);z-index:1}
|
|
2
|
-
/*# sourceMappingURL=Card-59b77d05.css.map */
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/Card/Card.module.css.js"],"names":[],"mappings":"AAAA,qBAOE,4CAAwC,CAFxC,gFAAgE,CAChE,kFAAuC,CALvC,YAAa,CAOb,gCAA4B,CAJ5B,+BAAgC,CADhC,eAAgB,CADhB,iBAwCF,CAhCE,+CACE,8CACF,CAEA,gDACE,gDACF,CAEA,0CAEE,4CACF,CAEA,6CAEE,4CACF,CAEA,wCACE,SACF,CAEA,0CAEE,sBAAuB,CADvB,YAAa,CAEb,oCACF,CAEA,+DAEE,wCACF,CAGF,2BACE,aAAc,CAEd,WAAY,CADZ,UAOF,CAJE,6EACE,aAAc,CACd,UACF,CAGF,qCAIE,yDAAqD,CADrD,0DAAsD,CADtD,wDAAoD,CAGpD,yDAEF,CAEA,0BACE,aAAc,CAEd,WAAY,CADZ,UAEF,CAEA,yBAEE,kBAAmB,CAEnB,kCAA2B,CAH3B,YAAa,CAEb,0BAUF,CAPE,2EAKE,6CAAsC,CADtC,gDAAyC,CADzC,+BAA2B,CAF3B,sBAAuB,CACvB,8BAIF,CAGF,yBACE,YAAa,CACb,gCAKF,CAHE,2EACE,aACF,CAGF,4BACE,YAAa,CACb,oCACF,CAEA,4BAEE,oCAA6B,CAD7B,2KAAuC,CAEvC,QAOF,CALE,8EAGE,8CAAuC,CAFvC,iBAAkB,CAClB,sCAEF,CAGF,gCAGE,QACF,CAEA,sEAJE,kCAA2B,CAD3B,8KAWF,CANA,sCAEE,kBAAmB,CADnB,YAAa,CAEb,gCAGF,CAEA,iCAEE,kBAAmB,CADnB,YAAa,CAGb,8KAAsC,CADtC,oCAEF,CAEA,2BACE,iBAAkB,CAElB,8BAA0B,CAD1B,4BAAwB,CAExB,SACF","file":"Card-59b77d05.css","sourcesContent":[".Card {\n display: grid;\n position: relative;\n overflow: hidden;\n grid-auto-rows: max-content auto;\n border: var(--borderWidth-thin) solid var(--borderColor-default);\n box-shadow: var(--shadow-resting-small);\n background-color: var(--bgColor-default);\n gap: var(--stack-gap-normal);\n\n &[data-border-radius='large'] {\n border-radius: var(--borderRadius-large);\n }\n\n &[data-border-radius='medium'] {\n border-radius: var(--borderRadius-medium);\n }\n\n &[data-padding='normal'] {\n /* stylelint-disable-next-line primer/spacing */\n padding: var(--stack-padding-spacious);\n }\n\n &[data-padding='condensed'] {\n /* stylelint-disable-next-line primer/spacing */\n padding: var(--stack-padding-condensed);\n }\n\n &[data-padding='none'] {\n padding: 0;\n }\n\n &[data-layout='compact'] {\n display: flex;\n align-items: flex-start;\n gap: var(--stack-gap-condensed);\n }\n\n &[data-layout='compact'][data-padding='normal'] {\n /* stylelint-disable-next-line primer/spacing */\n padding: var(--stack-padding-normal);\n }\n}\n\n.CardHeader {\n display: block;\n width: 100%;\n height: auto;\n\n .Card:where([data-layout='compact']) & {\n flex: 0 0 auto;\n width: auto;\n }\n}\n\n.CardHeaderEdgeToEdge {\n /* stylelint-disable primer/spacing */\n margin-top: calc(-1 * var(--stack-padding-spacious));\n margin-right: calc(-1 * var(--stack-padding-spacious));\n margin-left: calc(-1 * var(--stack-padding-spacious));\n width: calc(100% + 2 * var(--stack-padding-spacious));\n /* stylelint-enable primer/spacing */\n}\n\n.CardImage {\n display: block;\n width: 100%;\n height: auto;\n}\n\n.CardIcon {\n display: flex;\n align-items: center;\n justify-content: flex-start;\n color: var(--fgColor-muted);\n\n .Card:where([data-layout='default']) & {\n justify-content: center;\n width: var(--base-size-32);\n height: var(--base-size-32);\n border-radius: var(--borderRadius-medium);\n background-color: var(--bgColor-muted);\n }\n}\n\n.CardBody {\n display: grid;\n gap: var(--stack-gap-normal);\n\n .Card:where([data-layout='compact']) & {\n flex: 1 1 auto;\n }\n}\n\n.CardContent {\n display: grid;\n gap: var(--stack-gap-condensed);\n}\n\n.CardHeading {\n font: var(--text-title-shorthand-small);\n color: var(--fgColor-default);\n margin: 0;\n\n .Card:where([data-layout='compact']) & {\n position: relative;\n top: calc(-1 * var(--base-size-4));\n font-size: var(--text-body-size-medium);\n }\n}\n\n.CardDescription {\n font: var(--text-body-shorthand-medium);\n color: var(--fgColor-muted);\n margin: 0;\n}\n\n.CardMetadataContainer {\n display: flex;\n align-items: center;\n gap: var(--stack-gap-normal);\n font: var(--text-body-shorthand-medium);\n color: var(--fgColor-muted);\n}\n\n.CardMetadataItem {\n display: flex;\n align-items: center;\n gap: var(--stack-gap-condensed);\n font: var(--text-body-shorthand-small);\n}\n\n.CardAction {\n position: absolute;\n top: var(--base-size-16);\n right: var(--base-size-16);\n z-index: 1;\n}\n"]}
|