@primer/react 38.19.0-rc.f3b0d9cc2 → 38.19.0-rc.f678a3d2b
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 -2
- package/dist/ActionBar/ActionBar.js +3 -3
- package/dist/ActionList/Heading.js +17 -16
- package/dist/ActionList/Item.js +169 -171
- package/dist/AnchoredOverlay/AnchoredOverlay.js +1 -1
- package/dist/Autocomplete/AutocompleteInput.js +3 -3
- package/dist/Autocomplete/AutocompleteOverlay.js +3 -3
- package/dist/Button/ButtonBase.d.ts.map +1 -1
- package/dist/Button/ButtonBase.js +3 -4
- package/dist/Dialog/Dialog.js +3 -3
- package/dist/Heading/Heading.js +3 -3
- package/dist/Link/Link.d.ts.map +1 -1
- package/dist/Link/Link.js +3 -4
- package/dist/Overlay/Overlay.js +21 -20
- package/dist/PageLayout/PageLayout.js +5 -5
- package/dist/Stack/Stack-58c33984.css +2 -0
- package/dist/Stack/Stack-58c33984.css.map +1 -0
- package/dist/Stack/Stack.d.ts +12 -2
- package/dist/Stack/Stack.d.ts.map +1 -1
- package/dist/Stack/Stack.js +89 -61
- package/dist/Stack/Stack.module.css.js +1 -1
- package/dist/TextInputWithTokens/TextInputWithTokens.js +91 -90
- package/dist/deprecated/DialogV1/Dialog.js +10 -9
- package/dist/hooks/useAnchoredPosition.d.ts.map +1 -1
- package/dist/hooks/useAnchoredPosition.js +47 -0
- package/dist/hooks/useMergedRefs.d.ts +4 -4
- package/dist/hooks/useMergedRefs.js +4 -4
- package/generated/components.json +24 -2
- package/package.json +1 -1
- package/dist/Stack/Stack-9e7b935d.css +0 -2
- package/dist/Stack/Stack-9e7b935d.css.map +0 -1
|
@@ -3,7 +3,7 @@ import { FocusKeys } from '@primer/behaviors';
|
|
|
3
3
|
import { isFocusable } from '@primer/behaviors/utils';
|
|
4
4
|
import React, { useRef, useState } from 'react';
|
|
5
5
|
import { isValidElementType } from 'react-is';
|
|
6
|
-
import {
|
|
6
|
+
import { useMergedRefs } from '../hooks/useMergedRefs.js';
|
|
7
7
|
import { useFocusZone } from '../hooks/useFocusZone.js';
|
|
8
8
|
import { useId } from '../hooks/useId.js';
|
|
9
9
|
import Token from '../Token/Token.js';
|
|
@@ -25,7 +25,7 @@ const overflowCountClassMap = {
|
|
|
25
25
|
|
|
26
26
|
// using forwardRef is important so that other components (ex. Autocomplete) can use the ref
|
|
27
27
|
function TextInputWithTokensInnerComponent(t0, forwardedRef) {
|
|
28
|
-
const $ = c(
|
|
28
|
+
const $ = c(152);
|
|
29
29
|
let IconComponent;
|
|
30
30
|
let LeadingVisual;
|
|
31
31
|
let TrailingVisual;
|
|
@@ -165,7 +165,7 @@ function TextInputWithTokensInnerComponent(t0, forwardedRef) {
|
|
|
165
165
|
}
|
|
166
166
|
const ref = useRef(null);
|
|
167
167
|
const selectedValuesDescriptionId = useId();
|
|
168
|
-
|
|
168
|
+
const mergedRef = useMergedRefs(forwardedRef, ref);
|
|
169
169
|
const [selectedTokenIndex, setSelectedTokenIndex] = useState();
|
|
170
170
|
const [tokensAreTruncated, setTokensAreTruncated] = useState(Boolean(visibleTokenCount));
|
|
171
171
|
let t6;
|
|
@@ -455,9 +455,9 @@ function TextInputWithTokensInnerComponent(t0, forwardedRef) {
|
|
|
455
455
|
const t32 = validationStatus === "error" ? "true" : "false";
|
|
456
456
|
const t33 = ariaDescribedBy || undefined;
|
|
457
457
|
let t34;
|
|
458
|
-
if ($[80] !== disabled || $[81] !== handleInputBlur || $[82] !== handleInputFocus || $[83] !== handleInputKeyDown || $[84] !== inputPropsRest || $[85] !==
|
|
458
|
+
if ($[80] !== disabled || $[81] !== handleInputBlur || $[82] !== handleInputFocus || $[83] !== handleInputKeyDown || $[84] !== inputPropsRest || $[85] !== mergedRef || $[86] !== role || $[87] !== t32 || $[88] !== t33) {
|
|
459
459
|
t34 = /*#__PURE__*/jsx(UnstyledTextInput, {
|
|
460
|
-
ref:
|
|
460
|
+
ref: mergedRef,
|
|
461
461
|
disabled: disabled,
|
|
462
462
|
onFocus: handleInputFocus,
|
|
463
463
|
onBlur: handleInputBlur,
|
|
@@ -474,42 +474,43 @@ function TextInputWithTokensInnerComponent(t0, forwardedRef) {
|
|
|
474
474
|
$[82] = handleInputFocus;
|
|
475
475
|
$[83] = handleInputKeyDown;
|
|
476
476
|
$[84] = inputPropsRest;
|
|
477
|
-
$[85] =
|
|
478
|
-
$[86] =
|
|
479
|
-
$[87] =
|
|
480
|
-
$[88] =
|
|
477
|
+
$[85] = mergedRef;
|
|
478
|
+
$[86] = role;
|
|
479
|
+
$[87] = t32;
|
|
480
|
+
$[88] = t33;
|
|
481
|
+
$[89] = t34;
|
|
481
482
|
} else {
|
|
482
|
-
t34 = $[
|
|
483
|
+
t34 = $[89];
|
|
483
484
|
}
|
|
484
485
|
let t35;
|
|
485
|
-
if ($[
|
|
486
|
+
if ($[90] !== selectedValuesDescription || $[91] !== selectedValuesDescriptionId || $[92] !== shouldExposeSelectedValuesDescription) {
|
|
486
487
|
t35 = shouldExposeSelectedValuesDescription ? /*#__PURE__*/jsx(VisuallyHidden, {
|
|
487
488
|
id: selectedValuesDescriptionId,
|
|
488
489
|
children: selectedValuesDescription
|
|
489
490
|
}) : null;
|
|
490
|
-
$[
|
|
491
|
-
$[
|
|
492
|
-
$[
|
|
493
|
-
$[
|
|
491
|
+
$[90] = selectedValuesDescription;
|
|
492
|
+
$[91] = selectedValuesDescriptionId;
|
|
493
|
+
$[92] = shouldExposeSelectedValuesDescription;
|
|
494
|
+
$[93] = t35;
|
|
494
495
|
} else {
|
|
495
|
-
t35 = $[
|
|
496
|
+
t35 = $[93];
|
|
496
497
|
}
|
|
497
498
|
let t36;
|
|
498
|
-
if ($[
|
|
499
|
+
if ($[94] !== t34 || $[95] !== t35) {
|
|
499
500
|
t36 = /*#__PURE__*/jsxs("div", {
|
|
500
501
|
className: styles.InputWrapper,
|
|
501
502
|
children: [t34, t35]
|
|
502
503
|
});
|
|
503
|
-
$[
|
|
504
|
-
$[
|
|
505
|
-
$[
|
|
504
|
+
$[94] = t34;
|
|
505
|
+
$[95] = t35;
|
|
506
|
+
$[96] = t36;
|
|
506
507
|
} else {
|
|
507
|
-
t36 = $[
|
|
508
|
+
t36 = $[96];
|
|
508
509
|
}
|
|
509
510
|
let t37;
|
|
510
|
-
if ($[
|
|
511
|
+
if ($[97] !== TokenComponent || $[98] !== disabled || $[99] !== handleTokenBlur || $[100] !== handleTokenFocus || $[101] !== handleTokenRemove || $[102] !== hideTokenRemoveButtons || $[103] !== selectedTokenIndex || $[104] !== size || $[105] !== visibleTokens) {
|
|
511
512
|
let t38;
|
|
512
|
-
if ($[
|
|
513
|
+
if ($[107] !== TokenComponent || $[108] !== disabled || $[109] !== handleTokenBlur || $[110] !== handleTokenFocus || $[111] !== handleTokenRemove || $[112] !== hideTokenRemoveButtons || $[113] !== selectedTokenIndex || $[114] !== size) {
|
|
513
514
|
t38 = (t39, i) => {
|
|
514
515
|
const {
|
|
515
516
|
id,
|
|
@@ -531,89 +532,89 @@ function TextInputWithTokensInnerComponent(t0, forwardedRef) {
|
|
|
531
532
|
...tokenRest
|
|
532
533
|
}, id);
|
|
533
534
|
};
|
|
534
|
-
$[
|
|
535
|
-
$[
|
|
536
|
-
$[
|
|
537
|
-
$[
|
|
538
|
-
$[
|
|
539
|
-
$[
|
|
540
|
-
$[
|
|
541
|
-
$[
|
|
542
|
-
$[
|
|
535
|
+
$[107] = TokenComponent;
|
|
536
|
+
$[108] = disabled;
|
|
537
|
+
$[109] = handleTokenBlur;
|
|
538
|
+
$[110] = handleTokenFocus;
|
|
539
|
+
$[111] = handleTokenRemove;
|
|
540
|
+
$[112] = hideTokenRemoveButtons;
|
|
541
|
+
$[113] = selectedTokenIndex;
|
|
542
|
+
$[114] = size;
|
|
543
|
+
$[115] = t38;
|
|
543
544
|
} else {
|
|
544
|
-
t38 = $[
|
|
545
|
+
t38 = $[115];
|
|
545
546
|
}
|
|
546
547
|
t37 = visibleTokens.map(t38);
|
|
547
|
-
$[
|
|
548
|
-
$[
|
|
549
|
-
$[
|
|
550
|
-
$[
|
|
551
|
-
$[
|
|
552
|
-
$[
|
|
553
|
-
$[
|
|
554
|
-
$[
|
|
555
|
-
$[
|
|
556
|
-
$[
|
|
548
|
+
$[97] = TokenComponent;
|
|
549
|
+
$[98] = disabled;
|
|
550
|
+
$[99] = handleTokenBlur;
|
|
551
|
+
$[100] = handleTokenFocus;
|
|
552
|
+
$[101] = handleTokenRemove;
|
|
553
|
+
$[102] = hideTokenRemoveButtons;
|
|
554
|
+
$[103] = selectedTokenIndex;
|
|
555
|
+
$[104] = size;
|
|
556
|
+
$[105] = visibleTokens;
|
|
557
|
+
$[106] = t37;
|
|
557
558
|
} else {
|
|
558
|
-
t37 = $[
|
|
559
|
+
t37 = $[106];
|
|
559
560
|
}
|
|
560
561
|
let t38;
|
|
561
|
-
if ($[
|
|
562
|
+
if ($[116] !== size || $[117] !== tokens.length || $[118] !== tokensAreTruncated || $[119] !== visibleTokens.length) {
|
|
562
563
|
t38 = tokensAreTruncated && tokens.length - visibleTokens.length ? /*#__PURE__*/jsxs(Text, {
|
|
563
564
|
className: overflowCountClassMap[size],
|
|
564
565
|
children: ["+", tokens.length - visibleTokens.length]
|
|
565
566
|
}) : null;
|
|
566
|
-
$[
|
|
567
|
-
$[
|
|
568
|
-
$[
|
|
569
|
-
$[
|
|
570
|
-
$[
|
|
567
|
+
$[116] = size;
|
|
568
|
+
$[117] = tokens.length;
|
|
569
|
+
$[118] = tokensAreTruncated;
|
|
570
|
+
$[119] = visibleTokens.length;
|
|
571
|
+
$[120] = t38;
|
|
571
572
|
} else {
|
|
572
|
-
t38 = $[
|
|
573
|
+
t38 = $[120];
|
|
573
574
|
}
|
|
574
575
|
let t39;
|
|
575
|
-
if ($[
|
|
576
|
+
if ($[121] !== preventTokenWrapping || $[122] !== t31 || $[123] !== t36 || $[124] !== t37 || $[125] !== t38) {
|
|
576
577
|
t39 = /*#__PURE__*/jsxs("div", {
|
|
577
578
|
ref: t31,
|
|
578
579
|
className: styles.Container,
|
|
579
580
|
"data-prevent-token-wrapping": preventTokenWrapping,
|
|
580
581
|
children: [t36, t37, t38]
|
|
581
582
|
});
|
|
582
|
-
$[
|
|
583
|
-
$[
|
|
584
|
-
$[
|
|
585
|
-
$[
|
|
586
|
-
$[
|
|
587
|
-
$[
|
|
583
|
+
$[121] = preventTokenWrapping;
|
|
584
|
+
$[122] = t31;
|
|
585
|
+
$[123] = t36;
|
|
586
|
+
$[124] = t37;
|
|
587
|
+
$[125] = t38;
|
|
588
|
+
$[126] = t39;
|
|
588
589
|
} else {
|
|
589
|
-
t39 = $[
|
|
590
|
+
t39 = $[126];
|
|
590
591
|
}
|
|
591
592
|
const t40 = typeof loading === "boolean";
|
|
592
593
|
let t41;
|
|
593
|
-
if ($[
|
|
594
|
+
if ($[127] !== TrailingVisual) {
|
|
594
595
|
t41 = typeof TrailingVisual !== "string" && isValidElementType(TrailingVisual) ? /*#__PURE__*/jsx(TrailingVisual, {}) : TrailingVisual;
|
|
595
|
-
$[
|
|
596
|
-
$[
|
|
596
|
+
$[127] = TrailingVisual;
|
|
597
|
+
$[128] = t41;
|
|
597
598
|
} else {
|
|
598
|
-
t41 = $[
|
|
599
|
+
t41 = $[128];
|
|
599
600
|
}
|
|
600
601
|
let t42;
|
|
601
|
-
if ($[
|
|
602
|
+
if ($[129] !== showTrailingLoadingIndicator || $[130] !== t40 || $[131] !== t41) {
|
|
602
603
|
t42 = /*#__PURE__*/jsx(TextInputInnerVisualSlot, {
|
|
603
604
|
hasLoadingIndicator: t40,
|
|
604
605
|
visualPosition: "trailing",
|
|
605
606
|
showLoadingIndicator: showTrailingLoadingIndicator,
|
|
606
607
|
children: t41
|
|
607
608
|
});
|
|
608
|
-
$[
|
|
609
|
-
$[
|
|
610
|
-
$[
|
|
611
|
-
$[
|
|
609
|
+
$[129] = showTrailingLoadingIndicator;
|
|
610
|
+
$[130] = t40;
|
|
611
|
+
$[131] = t41;
|
|
612
|
+
$[132] = t42;
|
|
612
613
|
} else {
|
|
613
|
-
t42 = $[
|
|
614
|
+
t42 = $[132];
|
|
614
615
|
}
|
|
615
616
|
let t43;
|
|
616
|
-
if ($[
|
|
617
|
+
if ($[133] !== block || $[134] !== contrast || $[135] !== disabled || $[136] !== maxWidthProp || $[137] !== minWidthProp || $[138] !== t21 || $[139] !== t22 || $[140] !== t23 || $[141] !== t24 || $[142] !== t25 || $[143] !== t26 || $[144] !== t27 || $[145] !== t30 || $[146] !== t39 || $[147] !== t42 || $[148] !== validationStatus || $[149] !== variantProp || $[150] !== widthProp) {
|
|
617
618
|
t43 = /*#__PURE__*/jsxs(TextInputWrapper, {
|
|
618
619
|
block: block,
|
|
619
620
|
contrast: contrast,
|
|
@@ -632,27 +633,27 @@ function TextInputWithTokensInnerComponent(t0, forwardedRef) {
|
|
|
632
633
|
style: t26,
|
|
633
634
|
children: [t27, t30, t39, t42]
|
|
634
635
|
});
|
|
635
|
-
$[
|
|
636
|
-
$[
|
|
637
|
-
$[
|
|
638
|
-
$[
|
|
639
|
-
$[
|
|
640
|
-
$[
|
|
641
|
-
$[
|
|
642
|
-
$[
|
|
643
|
-
$[
|
|
644
|
-
$[
|
|
645
|
-
$[
|
|
646
|
-
$[
|
|
647
|
-
$[
|
|
648
|
-
$[
|
|
649
|
-
$[
|
|
650
|
-
$[
|
|
651
|
-
$[
|
|
652
|
-
$[
|
|
653
|
-
$[
|
|
636
|
+
$[133] = block;
|
|
637
|
+
$[134] = contrast;
|
|
638
|
+
$[135] = disabled;
|
|
639
|
+
$[136] = maxWidthProp;
|
|
640
|
+
$[137] = minWidthProp;
|
|
641
|
+
$[138] = t21;
|
|
642
|
+
$[139] = t22;
|
|
643
|
+
$[140] = t23;
|
|
644
|
+
$[141] = t24;
|
|
645
|
+
$[142] = t25;
|
|
646
|
+
$[143] = t26;
|
|
647
|
+
$[144] = t27;
|
|
648
|
+
$[145] = t30;
|
|
649
|
+
$[146] = t39;
|
|
650
|
+
$[147] = t42;
|
|
651
|
+
$[148] = validationStatus;
|
|
652
|
+
$[149] = variantProp;
|
|
653
|
+
$[150] = widthProp;
|
|
654
|
+
$[151] = t43;
|
|
654
655
|
} else {
|
|
655
|
-
t43 = $[
|
|
656
|
+
t43 = $[151];
|
|
656
657
|
}
|
|
657
658
|
return t43;
|
|
658
659
|
}
|
|
@@ -2,7 +2,7 @@ import { c } from 'react-compiler-runtime';
|
|
|
2
2
|
import React, { forwardRef, useRef } from 'react';
|
|
3
3
|
import { IconButton } from '../../Button/IconButton.js';
|
|
4
4
|
import useDialog from '../../hooks/useDialog.js';
|
|
5
|
-
import {
|
|
5
|
+
import { useMergedRefs } from '../../hooks/useMergedRefs.js';
|
|
6
6
|
import { XIcon } from '@primer/octicons-react';
|
|
7
7
|
import { clsx } from 'clsx';
|
|
8
8
|
import classes from './Dialog.module.css.js';
|
|
@@ -78,7 +78,7 @@ function _temp(ch) {
|
|
|
78
78
|
return typeof ch === "string";
|
|
79
79
|
}
|
|
80
80
|
const Dialog = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
|
|
81
|
-
const $ = c(
|
|
81
|
+
const $ = c(26);
|
|
82
82
|
let children;
|
|
83
83
|
let className;
|
|
84
84
|
let initialFocusRef;
|
|
@@ -121,7 +121,7 @@ const Dialog = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
|
|
|
121
121
|
const Component = t2 === undefined ? "div" : t2;
|
|
122
122
|
const overlayRef = useRef(null);
|
|
123
123
|
const modalRef = useRef(null);
|
|
124
|
-
|
|
124
|
+
const mergedRef = useMergedRefs(forwardedRef, modalRef);
|
|
125
125
|
const closeButtonRef = useRef(null);
|
|
126
126
|
let t3;
|
|
127
127
|
if ($[9] !== onDismiss || $[10] !== returnFocusRef) {
|
|
@@ -161,14 +161,14 @@ const Dialog = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
|
|
|
161
161
|
getDialogProps
|
|
162
162
|
} = useDialog(t4);
|
|
163
163
|
let t5;
|
|
164
|
-
if ($[17] !== Component || $[18] !== children || $[19] !== className || $[20] !== getDialogProps || $[21] !== isOpen || $[22] !==
|
|
164
|
+
if ($[17] !== Component || $[18] !== children || $[19] !== className || $[20] !== getDialogProps || $[21] !== isOpen || $[22] !== mergedRef || $[23] !== onCloseClick || $[24] !== props) {
|
|
165
165
|
t5 = isOpen ? /*#__PURE__*/jsxs(Fragment, {
|
|
166
166
|
children: [/*#__PURE__*/jsx("span", {
|
|
167
167
|
className: classes.Overlay,
|
|
168
168
|
ref: overlayRef
|
|
169
169
|
}), /*#__PURE__*/jsxs(Component, {
|
|
170
170
|
tabIndex: -1,
|
|
171
|
-
ref:
|
|
171
|
+
ref: mergedRef,
|
|
172
172
|
role: "dialog",
|
|
173
173
|
"aria-modal": "true",
|
|
174
174
|
...props,
|
|
@@ -190,11 +190,12 @@ const Dialog = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
|
|
|
190
190
|
$[19] = className;
|
|
191
191
|
$[20] = getDialogProps;
|
|
192
192
|
$[21] = isOpen;
|
|
193
|
-
$[22] =
|
|
194
|
-
$[23] =
|
|
195
|
-
$[24] =
|
|
193
|
+
$[22] = mergedRef;
|
|
194
|
+
$[23] = onCloseClick;
|
|
195
|
+
$[24] = props;
|
|
196
|
+
$[25] = t5;
|
|
196
197
|
} else {
|
|
197
|
-
t5 = $[
|
|
198
|
+
t5 = $[25];
|
|
198
199
|
}
|
|
199
200
|
return t5;
|
|
200
201
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAnchoredPosition.d.ts","sourceRoot":"","sources":["../../src/hooks/useAnchoredPosition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAC,cAAc,EAAE,gBAAgB,EAAC,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"useAnchoredPosition.d.ts","sourceRoot":"","sources":["../../src/hooks/useAnchoredPosition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAC,cAAc,EAAE,gBAAgB,EAAC,MAAM,mBAAmB,CAAA;AA0BvE,MAAM,WAAW,4BAA6B,SAAQ,OAAO,CAAC,gBAAgB,CAAC;IAC7E,kBAAkB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,OAAO,GAAG,IAAI,CAAC,CAAA;IACpD,gBAAgB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,OAAO,GAAG,IAAI,CAAC,CAAA;IAClD,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,cAAc,GAAG,SAAS,KAAK,IAAI,CAAA;CAClE;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,CAAC,EAAE,4BAA4B,EACvC,YAAY,GAAE,KAAK,CAAC,cAAmB,GACtC;IACD,kBAAkB,EAAE,KAAK,CAAC,SAAS,CAAC,OAAO,GAAG,IAAI,CAAC,CAAA;IACnD,gBAAgB,EAAE,KAAK,CAAC,SAAS,CAAC,OAAO,GAAG,IAAI,CAAC,CAAA;IACjD,QAAQ,EAAE,cAAc,GAAG,SAAS,CAAA;CACrC,CA4GA"}
|
|
@@ -4,6 +4,26 @@ import { useProvidedRefOrCreate } from './useProvidedRefOrCreate.js';
|
|
|
4
4
|
import { useResizeObserver } from './useResizeObserver.js';
|
|
5
5
|
import useIsomorphicLayoutEffect from '../utils/useIsomorphicLayoutEffect.js';
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Returns all scrollable ancestor elements of the given element, plus the window.
|
|
9
|
+
* An element is scrollable if its computed overflow/overflow-x/overflow-y is
|
|
10
|
+
* 'auto', 'scroll', or 'overlay'.
|
|
11
|
+
*/
|
|
12
|
+
function getScrollableAncestors(element) {
|
|
13
|
+
const scrollables = [];
|
|
14
|
+
let current = element.parentElement;
|
|
15
|
+
while (current) {
|
|
16
|
+
const style = getComputedStyle(current);
|
|
17
|
+
const overflowY = style.overflowY;
|
|
18
|
+
const overflowX = style.overflowX;
|
|
19
|
+
if (/auto|scroll|overlay/.test(overflowY) || /auto|scroll|overlay/.test(overflowX)) {
|
|
20
|
+
scrollables.push(current);
|
|
21
|
+
}
|
|
22
|
+
current = current.parentElement;
|
|
23
|
+
}
|
|
24
|
+
scrollables.push(window);
|
|
25
|
+
return scrollables;
|
|
26
|
+
}
|
|
7
27
|
/**
|
|
8
28
|
* Calculates the top and left values for an absolutely-positioned floating element
|
|
9
29
|
* to be anchored to some anchor element. Returns refs for the floating element
|
|
@@ -76,6 +96,33 @@ function useAnchoredPosition(settings, dependencies = []) {
|
|
|
76
96
|
useResizeObserver(updatePosition); // watches for changes in window size
|
|
77
97
|
useResizeObserver(updatePosition, floatingElementRef); // watches for changes in floating element size
|
|
78
98
|
|
|
99
|
+
// Recalculate position when any scrollable ancestor of the anchor scrolls.
|
|
100
|
+
// Uses requestAnimationFrame to avoid layout thrashing during scroll.
|
|
101
|
+
React.useEffect(() => {
|
|
102
|
+
const anchorEl = anchorElementRef.current;
|
|
103
|
+
if (!anchorEl) return;
|
|
104
|
+
let rafId = null;
|
|
105
|
+
const handleScroll = () => {
|
|
106
|
+
if (rafId !== null) return;
|
|
107
|
+
rafId = requestAnimationFrame(() => {
|
|
108
|
+
rafId = null;
|
|
109
|
+
updatePosition();
|
|
110
|
+
});
|
|
111
|
+
};
|
|
112
|
+
const scrollables = getScrollableAncestors(anchorEl);
|
|
113
|
+
for (const scrollable of scrollables) {
|
|
114
|
+
// eslint-disable-next-line github/prefer-observers -- IntersectionObserver cannot detect continuous scroll position changes needed for repositioning
|
|
115
|
+
scrollable.addEventListener('scroll', handleScroll);
|
|
116
|
+
}
|
|
117
|
+
return () => {
|
|
118
|
+
for (const scrollable of scrollables) {
|
|
119
|
+
scrollable.removeEventListener('scroll', handleScroll);
|
|
120
|
+
}
|
|
121
|
+
if (rafId !== null) {
|
|
122
|
+
cancelAnimationFrame(rafId);
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
}, [anchorElementRef, updatePosition]);
|
|
79
126
|
return {
|
|
80
127
|
floatingElementRef,
|
|
81
128
|
anchorElementRef,
|
|
@@ -15,18 +15,18 @@ import type { ForwardedRef, Ref as StandardRef } from 'react';
|
|
|
15
15
|
* // React 18
|
|
16
16
|
* const Example = forwardRef<HTMLButtonElement, {}>((props, forwardedRef) => {
|
|
17
17
|
* const ref = useRef<HTMLButtonElement>(null)
|
|
18
|
-
* const
|
|
18
|
+
* const mergedRef = useMergedRefs(forwardedRef, ref)
|
|
19
19
|
*
|
|
20
|
-
* return <button ref={
|
|
20
|
+
* return <button ref={mergedRef} />
|
|
21
21
|
* })
|
|
22
22
|
*
|
|
23
23
|
* @example
|
|
24
24
|
* // React 19
|
|
25
25
|
* const Example = ({ref: externalRef}: {ref?: Ref<HTMLButtonElement>}) => {
|
|
26
26
|
* const ref = useRef<HTMLButtonElement>(null)
|
|
27
|
-
* const
|
|
27
|
+
* const mergedRef = useMergedRefs(externalRef, ref)
|
|
28
28
|
*
|
|
29
|
-
* return <button ref={
|
|
29
|
+
* return <button ref={mergedRef} />
|
|
30
30
|
* }
|
|
31
31
|
*/
|
|
32
32
|
export declare function useMergedRefs<T>(refA: Ref<T | null>, refB: Ref<T | null>): (value: T | null) => () => void;
|
|
@@ -17,18 +17,18 @@ import 'react';
|
|
|
17
17
|
* // React 18
|
|
18
18
|
* const Example = forwardRef<HTMLButtonElement, {}>((props, forwardedRef) => {
|
|
19
19
|
* const ref = useRef<HTMLButtonElement>(null)
|
|
20
|
-
* const
|
|
20
|
+
* const mergedRef = useMergedRefs(forwardedRef, ref)
|
|
21
21
|
*
|
|
22
|
-
* return <button ref={
|
|
22
|
+
* return <button ref={mergedRef} />
|
|
23
23
|
* })
|
|
24
24
|
*
|
|
25
25
|
* @example
|
|
26
26
|
* // React 19
|
|
27
27
|
* const Example = ({ref: externalRef}: {ref?: Ref<HTMLButtonElement>}) => {
|
|
28
28
|
* const ref = useRef<HTMLButtonElement>(null)
|
|
29
|
-
* const
|
|
29
|
+
* const mergedRef = useMergedRefs(externalRef, ref)
|
|
30
30
|
*
|
|
31
|
-
* return <button ref={
|
|
31
|
+
* return <button ref={mergedRef} />
|
|
32
32
|
* }
|
|
33
33
|
*/
|
|
34
34
|
function useMergedRefs(refA, refB) {
|
|
@@ -7009,6 +7009,18 @@
|
|
|
7009
7009
|
"id": "components-stack--default",
|
|
7010
7010
|
"code": "() => (\n <Stack>\n <div\n style={{\n background: 'var(--display-lemon-bgColor-muted)',\n borderRadius: 'var(--borderRadius-medium)',\n padding: 'var(--base-size-8)',\n }}\n >\n First\n </div>\n <div\n style={{\n background: 'var(--display-olive-bgColor-muted)',\n borderRadius: 'var(--borderRadius-medium)',\n padding: 'var(--base-size-8)',\n }}\n >\n Second\n </div>\n <div\n style={{\n background: 'var(--display-lime-bgColor-muted)',\n borderRadius: 'var(--borderRadius-medium)',\n padding: 'var(--base-size-8)',\n }}\n >\n Third\n </div>\n </Stack>\n)"
|
|
7011
7011
|
},
|
|
7012
|
+
{
|
|
7013
|
+
"id": "components-stack-features--gap-scale",
|
|
7014
|
+
"code": "() => (\n <Stack gap=\"spacious\">\n {(\n ['none', 'tight', 'condensed', 'cozy', 'normal', 'spacious'] as const\n ).map((gap) => (\n <Stack key={gap}>\n <span\n style={{\n fontSize: 'var(--text-body-size-small)',\n color: 'var(--fgColor-muted)',\n }}\n >\n gap="{gap}"\n </span>\n <Stack direction=\"horizontal\" gap={gap}>\n <Placeholder label=\"A\" />\n <Placeholder label=\"B\" />\n <Placeholder label=\"C\" />\n </Stack>\n </Stack>\n ))}\n </Stack>\n)"
|
|
7015
|
+
},
|
|
7016
|
+
{
|
|
7017
|
+
"id": "components-stack-features--directional-padding",
|
|
7018
|
+
"code": "() => (\n <Stack gap=\"normal\">\n <Stack\n padding=\"normal\"\n style={{\n backgroundColor: 'var(--bgColor-muted)',\n }}\n >\n <Placeholder label='padding=\"normal\" (all sides)' />\n </Stack>\n <Stack\n padding=\"normal\"\n paddingInline=\"spacious\"\n style={{\n backgroundColor: 'var(--bgColor-muted)',\n }}\n >\n <Placeholder label='padding=\"normal\" paddingInline=\"spacious\"' />\n </Stack>\n <Stack\n paddingBlock=\"condensed\"\n paddingInline=\"spacious\"\n style={{\n backgroundColor: 'var(--bgColor-muted)',\n }}\n >\n <Placeholder label='paddingBlock=\"condensed\" paddingInline=\"spacious\"' />\n </Stack>\n </Stack>\n)"
|
|
7019
|
+
},
|
|
7020
|
+
{
|
|
7021
|
+
"id": "components-stack-features--padding-scale",
|
|
7022
|
+
"code": "() => (\n <Stack gap=\"spacious\">\n {(\n ['none', 'tight', 'condensed', 'cozy', 'normal', 'spacious'] as const\n ).map((padding) => (\n <Stack key={padding}>\n <span\n style={{\n fontSize: 'var(--text-body-size-small)',\n color: 'var(--fgColor-muted)',\n }}\n >\n padding="{padding}"\n </span>\n <Stack\n padding={padding}\n style={{\n backgroundColor: 'var(--bgColor-muted)',\n }}\n >\n <Placeholder label=\"Content\" />\n </Stack>\n </Stack>\n ))}\n </Stack>\n)"
|
|
7023
|
+
},
|
|
7012
7024
|
{
|
|
7013
7025
|
"id": "components-stack-features--shrinking-stack-items",
|
|
7014
7026
|
"code": "() => (\n <div\n style={{\n maxWidth: '200px',\n padding: 'var(--base-size-8)',\n }}\n >\n <Stack direction=\"horizontal\" gap=\"condensed\">\n <Stack.Item shrink={false}>\n <ShieldLockIcon size=\"small\" />\n </Stack.Item>\n <Stack.Item>\n This stack has the leading icon set to prevent shrinking\n </Stack.Item>\n </Stack>\n <Stack direction=\"horizontal\" gap=\"condensed\">\n <Stack.Item shrink={true}>\n <ShieldLockIcon size=\"small\" />\n </Stack.Item>\n <Stack.Item>\n This stack item does not have the icon set to prevent shrinking\n </Stack.Item>\n </Stack>\n </div>\n)"
|
|
@@ -7018,7 +7030,7 @@
|
|
|
7018
7030
|
"props": [
|
|
7019
7031
|
{
|
|
7020
7032
|
"name": "gap",
|
|
7021
|
-
"type": "'none' | 'condensed' | 'normal' | 'spacious' | ResponsiveValue<'none' | 'condensed' | 'normal' | 'spacious'>",
|
|
7033
|
+
"type": "'none' | 'tight' | 'condensed' | 'cozy' | 'normal' | 'spacious' | ResponsiveValue<'none' | 'tight' | 'condensed' | 'cozy' | 'normal' | 'spacious'>",
|
|
7022
7034
|
"description": "Specify the gap between children elements in the stack."
|
|
7023
7035
|
},
|
|
7024
7036
|
{
|
|
@@ -7043,9 +7055,19 @@
|
|
|
7043
7055
|
},
|
|
7044
7056
|
{
|
|
7045
7057
|
"name": "padding",
|
|
7046
|
-
"type": "'none' | 'condensed' | 'normal' | 'spacious' | ResponsiveValue<'none' | 'condensed' | 'normal' | 'spacious'>",
|
|
7058
|
+
"type": "'none' | 'tight' | 'condensed' | 'cozy' | 'normal' | 'spacious' | ResponsiveValue<'none' | 'tight' | 'condensed' | 'cozy' | 'normal' | 'spacious'>",
|
|
7047
7059
|
"description": "Specify the padding of the stack container."
|
|
7048
7060
|
},
|
|
7061
|
+
{
|
|
7062
|
+
"name": "paddingBlock",
|
|
7063
|
+
"type": "'none' | 'tight' | 'condensed' | 'cozy' | 'normal' | 'spacious' | ResponsiveValue<'none' | 'tight' | 'condensed' | 'cozy' | 'normal' | 'spacious'>",
|
|
7064
|
+
"description": "Specify the block (vertical) padding of the stack container. Overrides the block axis of padding when both are set."
|
|
7065
|
+
},
|
|
7066
|
+
{
|
|
7067
|
+
"name": "paddingInline",
|
|
7068
|
+
"type": "'none' | 'tight' | 'condensed' | 'cozy' | 'normal' | 'spacious' | ResponsiveValue<'none' | 'tight' | 'condensed' | 'cozy' | 'normal' | 'spacious'>",
|
|
7069
|
+
"description": "Specify the inline (horizontal) padding of the stack container. Overrides the inline axis of padding when both are set."
|
|
7070
|
+
},
|
|
7049
7071
|
{
|
|
7050
7072
|
"name": "className",
|
|
7051
7073
|
"type": "string"
|
package/package.json
CHANGED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
.prc-Stack-Stack-UQ9k6{align-content:flex-start;align-items:stretch;display:flex;flex-flow:column;gap:var(--stack-gap,var(--stack-gap-normal,1rem))}.prc-Stack-Stack-UQ9k6[data-padding-narrow=none],.prc-Stack-Stack-UQ9k6[data-padding=none]{padding:0}.prc-Stack-Stack-UQ9k6[data-padding-narrow=condensed],.prc-Stack-Stack-UQ9k6[data-padding=condensed]{padding:var(--stack-padding-condensed,.5rem)}.prc-Stack-Stack-UQ9k6[data-padding-narrow=normal],.prc-Stack-Stack-UQ9k6[data-padding=normal]{padding:var(--stack-padding-normal,1rem)}.prc-Stack-Stack-UQ9k6[data-padding-narrow=spacious],.prc-Stack-Stack-UQ9k6[data-padding=spacious]{padding:var(--stack-padding-spacious,1.5rem)}.prc-Stack-Stack-UQ9k6[data-direction-narrow=horizontal],.prc-Stack-Stack-UQ9k6[data-direction=horizontal]{flex-flow:row}.prc-Stack-Stack-UQ9k6[data-direction-narrow=vertical],.prc-Stack-Stack-UQ9k6[data-direction=vertical]{flex-flow:column}.prc-Stack-Stack-UQ9k6[data-gap-narrow=none],.prc-Stack-Stack-UQ9k6[data-gap=none]{--stack-gap:0}.prc-Stack-Stack-UQ9k6[data-gap-narrow=condensed],.prc-Stack-Stack-UQ9k6[data-gap=condensed]{--stack-gap:var(--stack-gap-condensed,0.5rem)}.prc-Stack-Stack-UQ9k6[data-gap-narrow=normal],.prc-Stack-Stack-UQ9k6[data-gap=normal]{--stack-gap:var(--stack-gap-normal,1rem)}.prc-Stack-Stack-UQ9k6[data-gap-narrow=spacious],.prc-Stack-Stack-UQ9k6[data-gap=spacious]{--stack-gap:var(--stack-gap-spacious,1.5rem)}.prc-Stack-Stack-UQ9k6[data-align-narrow=start],.prc-Stack-Stack-UQ9k6[data-align=start]{align-items:flex-start}.prc-Stack-Stack-UQ9k6[data-align-narrow=center],.prc-Stack-Stack-UQ9k6[data-align=center]{align-items:center}.prc-Stack-Stack-UQ9k6[data-align-narrow=end],.prc-Stack-Stack-UQ9k6[data-align=end]{align-items:flex-end}.prc-Stack-Stack-UQ9k6[data-align-narrow=baseline],.prc-Stack-Stack-UQ9k6[data-align=baseline]{align-items:baseline}.prc-Stack-Stack-UQ9k6[data-justify-narrow=start],.prc-Stack-Stack-UQ9k6[data-justify=start]{justify-content:flex-start}.prc-Stack-Stack-UQ9k6[data-justify-narrow=center],.prc-Stack-Stack-UQ9k6[data-justify=center]{justify-content:center}.prc-Stack-Stack-UQ9k6[data-justify-narrow=end],.prc-Stack-Stack-UQ9k6[data-justify=end]{justify-content:flex-end}.prc-Stack-Stack-UQ9k6[data-justify-narrow=space-between],.prc-Stack-Stack-UQ9k6[data-justify=space-between]{justify-content:space-between}.prc-Stack-Stack-UQ9k6[data-justify-narrow=space-evenly],.prc-Stack-Stack-UQ9k6[data-justify=space-evenly]{justify-content:space-evenly}.prc-Stack-Stack-UQ9k6[data-wrap-narrow=wrap],.prc-Stack-Stack-UQ9k6[data-wrap=wrap]{flex-wrap:wrap}.prc-Stack-Stack-UQ9k6[data-wrap-narrow=nowrap],.prc-Stack-Stack-UQ9k6[data-wrap=nowrap]{flex-wrap:nowrap}@media (min-width:48rem){.prc-Stack-Stack-UQ9k6[data-padding-regular=none]{padding:0}.prc-Stack-Stack-UQ9k6[data-padding-regular=condensed]{padding:var(--stack-padding-condensed,.5rem)}.prc-Stack-Stack-UQ9k6[data-padding-regular=normal]{padding:var(--stack-padding-normal,1rem)}.prc-Stack-Stack-UQ9k6[data-padding-regular=spacious]{padding:var(--stack-padding-spacious,1.5rem)}.prc-Stack-Stack-UQ9k6[data-direction-regular=horizontal]{flex-flow:row}.prc-Stack-Stack-UQ9k6[data-direction-regular=vertical]{flex-flow:column}.prc-Stack-Stack-UQ9k6[data-gap-regular=none]{--stack-gap:0}.prc-Stack-Stack-UQ9k6[data-gap-regular=condensed]{--stack-gap:var(--stack-gap-condensed,0.5rem)}.prc-Stack-Stack-UQ9k6[data-gap-regular=normal]{--stack-gap:var(--stack-gap-normal,1rem)}.prc-Stack-Stack-UQ9k6[data-gap-regular=spacious]{--stack-gap:var(--stack-gap-spacious,1.5rem)}.prc-Stack-Stack-UQ9k6[data-align-regular=start]{align-items:flex-start}.prc-Stack-Stack-UQ9k6[data-align-regular=center]{align-items:center}.prc-Stack-Stack-UQ9k6[data-align-regular=end]{align-items:flex-end}.prc-Stack-Stack-UQ9k6[data-align-regular=baseline]{align-items:baseline}.prc-Stack-Stack-UQ9k6[data-justify-regular=start]{justify-content:flex-start}.prc-Stack-Stack-UQ9k6[data-justify-regular=center]{justify-content:center}.prc-Stack-Stack-UQ9k6[data-justify-regular=end]{justify-content:flex-end}.prc-Stack-Stack-UQ9k6[data-justify-regular=space-between]{justify-content:space-between}.prc-Stack-Stack-UQ9k6[data-justify-regular=space-evenly]{justify-content:space-evenly}.prc-Stack-Stack-UQ9k6[data-wrap-regular=wrap]{flex-wrap:wrap}.prc-Stack-Stack-UQ9k6[data-wrap-regular=nowrap]{flex-wrap:nowrap}}@media (min-width:87.5rem){.prc-Stack-Stack-UQ9k6[data-padding-wide=none]{padding:0}.prc-Stack-Stack-UQ9k6[data-padding-wide=condensed]{padding:var(--stack-padding-condensed,.5rem)}.prc-Stack-Stack-UQ9k6[data-padding-wide=normal]{padding:var(--stack-padding-normal,1rem)}.prc-Stack-Stack-UQ9k6[data-padding-wide=spacious]{padding:var(--stack-padding-spacious,1.5rem)}.prc-Stack-Stack-UQ9k6[data-direction-wide=horizontal]{flex-flow:row}.prc-Stack-Stack-UQ9k6[data-direction-wide=vertical]{flex-flow:column}.prc-Stack-Stack-UQ9k6[data-gap-wide=none]{--stack-gap:0}.prc-Stack-Stack-UQ9k6[data-gap-wide=condensed]{--stack-gap:var(--stack-gap-condensed,0.5rem)}.prc-Stack-Stack-UQ9k6[data-gap-wide=normal]{--stack-gap:var(--stack-gap-normal,1rem)}.prc-Stack-Stack-UQ9k6[data-gap-wide=spacious]{--stack-gap:var(--stack-gap-spacious,1.5rem)}.prc-Stack-Stack-UQ9k6[data-align-wide=start]{align-items:flex-start}.prc-Stack-Stack-UQ9k6[data-align-wide=center]{align-items:center}.prc-Stack-Stack-UQ9k6[data-align-wide=end]{align-items:flex-end}.prc-Stack-Stack-UQ9k6[data-align-wide=baseline]{align-items:baseline}.prc-Stack-Stack-UQ9k6[data-justify-wide=start]{justify-content:flex-start}.prc-Stack-Stack-UQ9k6[data-justify-wide=center]{justify-content:center}.prc-Stack-Stack-UQ9k6[data-justify-wide=end]{justify-content:flex-end}.prc-Stack-Stack-UQ9k6[data-justify-wide=space-between]{justify-content:space-between}.prc-Stack-Stack-UQ9k6[data-justify-wide=space-evenly]{justify-content:space-evenly}.prc-Stack-Stack-UQ9k6[data-wrap-wide=wrap]{flex-wrap:wrap}.prc-Stack-Stack-UQ9k6[data-wrap-wide=nowrap]{flex-wrap:nowrap}}.prc-Stack-StackItem-TzbLx{flex:0 1 auto;min-inline-size:0}.prc-Stack-StackItem-TzbLx[data-shrink-narrow=false],.prc-Stack-StackItem-TzbLx[data-shrink=false]{flex-shrink:0}.prc-Stack-StackItem-TzbLx[data-grow-narrow=true],.prc-Stack-StackItem-TzbLx[data-grow=true]{flex-grow:1}@media (min-width:48rem){.prc-Stack-StackItem-TzbLx[data-grow-regular=true]{flex-grow:1}.prc-Stack-StackItem-TzbLx[data-grow-regular=false]{flex-grow:0}.prc-Stack-StackItem-TzbLx[data-shrink-regular=true]{flex-shrink:1}.prc-Stack-StackItem-TzbLx[data-shrink-regular=false]{flex-shrink:0}}@media (min-width:87.5rem){.prc-Stack-StackItem-TzbLx[data-grow-wide=true]{flex-grow:1}.prc-Stack-StackItem-TzbLx[data-grow-wide=false]{flex-grow:0}.prc-Stack-StackItem-TzbLx[data-shrink-wide=true]{flex-shrink:1}.prc-Stack-StackItem-TzbLx[data-shrink-wide=false]{flex-shrink:0}}
|
|
2
|
-
/*# sourceMappingURL=Stack-9e7b935d.css.map */
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/Stack/Stack.module.css.js"],"names":[],"mappings":"AAAA,uBAIE,wBAAyB,CADzB,mBAAoB,CAFpB,YAAa,CACb,gBAAiB,CAGjB,iDA+RF,CA7RE,2FAEE,SACF,CAEA,qGAGE,4CACF,CAEA,+FAGE,wCACF,CAEA,mGAGE,4CACF,CAEA,2GAEE,aACF,CAEA,uGAEE,gBACF,CAEA,mFAEE,aACF,CAEA,6FAEE,6CACF,CAEA,uFAEE,wCACF,CAEA,2FAEE,4CACF,CAEA,yFAEE,sBACF,CAEA,2FAEE,kBACF,CAEA,qFAEE,oBACF,CAEA,+FAEE,oBACF,CAEA,6FAEE,0BACF,CAEA,+FAEE,sBACF,CAEA,yFAEE,wBACF,CAEA,6GAEE,6BACF,CAEA,2GAEE,4BACF,CAEA,qFAEE,cACF,CAEA,yFAEE,gBACF,CAEA,yBACE,kDACE,SACF,CAEA,uDAEE,4CACF,CAEA,oDAEE,wCACF,CAEA,sDAEE,4CACF,CAEA,0DACE,aACF,CAEA,wDACE,gBACF,CAEA,8CACE,aACF,CAEA,mDACE,6CACF,CAEA,gDACE,wCACF,CAEA,kDACE,4CACF,CAEA,iDACE,sBACF,CAEA,kDACE,kBACF,CAEA,+CACE,oBACF,CAEA,oDACE,oBACF,CAEA,mDACE,0BACF,CAEA,oDACE,sBACF,CAEA,iDACE,wBACF,CAEA,2DACE,6BACF,CAEA,0DACE,4BACF,CAEA,+CACE,cACF,CAEA,iDACE,gBACF,CACF,CAEA,2BACE,+CACE,SACF,CAEA,oDAEE,4CACF,CAEA,iDAEE,wCACF,CAEA,mDAEE,4CACF,CAEA,uDACE,aACF,CAEA,qDACE,gBACF,CAEA,2CACE,aACF,CAEA,gDACE,6CACF,CAEA,6CACE,wCACF,CAEA,+CACE,4CACF,CAEA,8CACE,sBACF,CAEA,+CACE,kBACF,CAEA,4CACE,oBACF,CAEA,iDACE,oBACF,CAEA,gDACE,0BACF,CAEA,iDACE,sBACF,CAEA,8CACE,wBACF,CAEA,wDACE,6BACF,CAEA,uDACE,4BACF,CAEA,4CACE,cACF,CAEA,8CACE,gBACF,CACF,CAGF,2BACE,aAAc,CACd,iBA+CF,CA7CE,mGAEE,aACF,CAEA,6FAEE,WACF,CAEA,yBACE,mDACE,WACF,CAEA,oDACE,WACF,CAEA,qDACE,aACF,CAEA,sDACE,aACF,CACF,CAEA,2BACE,gDACE,WACF,CAEA,iDACE,WACF,CAEA,kDACE,aACF,CAEA,mDACE,aACF,CACF","file":"Stack-9e7b935d.css","sourcesContent":[".Stack {\n display: flex;\n flex-flow: column;\n align-items: stretch;\n align-content: flex-start;\n gap: var(--stack-gap, var(--stack-gap-normal));\n\n &[data-padding='none'],\n &[data-padding-narrow='none'] {\n padding: 0;\n }\n\n &[data-padding='condensed'],\n &[data-padding-narrow='condensed'] {\n /* stylelint-disable-next-line primer/spacing */\n padding: var(--stack-padding-condensed);\n }\n\n &[data-padding='normal'],\n &[data-padding-narrow='normal'] {\n /* stylelint-disable-next-line primer/spacing */\n padding: var(--stack-padding-normal);\n }\n\n &[data-padding='spacious'],\n &[data-padding-narrow='spacious'] {\n /* stylelint-disable-next-line primer/spacing */\n padding: var(--stack-padding-spacious);\n }\n\n &[data-direction='horizontal'],\n &[data-direction-narrow='horizontal'] {\n flex-flow: row;\n }\n\n &[data-direction='vertical'],\n &[data-direction-narrow='vertical'] {\n flex-flow: column;\n }\n\n &[data-gap='none'],\n &[data-gap-narrow='none'] {\n --stack-gap: 0;\n }\n\n &[data-gap='condensed'],\n &[data-gap-narrow='condensed'] {\n --stack-gap: var(--stack-gap-condensed);\n }\n\n &[data-gap='normal'],\n &[data-gap-narrow='normal'] {\n --stack-gap: var(--stack-gap-normal);\n }\n\n &[data-gap='spacious'],\n &[data-gap-narrow='spacious'] {\n --stack-gap: var(--stack-gap-spacious);\n }\n\n &[data-align='start'],\n &[data-align-narrow='start'] {\n align-items: flex-start;\n }\n\n &[data-align='center'],\n &[data-align-narrow='center'] {\n align-items: center;\n }\n\n &[data-align='end'],\n &[data-align-narrow='end'] {\n align-items: flex-end;\n }\n\n &[data-align='baseline'],\n &[data-align-narrow='baseline'] {\n align-items: baseline;\n }\n\n &[data-justify='start'],\n &[data-justify-narrow='start'] {\n justify-content: flex-start;\n }\n\n &[data-justify='center'],\n &[data-justify-narrow='center'] {\n justify-content: center;\n }\n\n &[data-justify='end'],\n &[data-justify-narrow='end'] {\n justify-content: flex-end;\n }\n\n &[data-justify='space-between'],\n &[data-justify-narrow='space-between'] {\n justify-content: space-between;\n }\n\n &[data-justify='space-evenly'],\n &[data-justify-narrow='space-evenly'] {\n justify-content: space-evenly;\n }\n\n &[data-wrap='wrap'],\n &[data-wrap-narrow='wrap'] {\n flex-wrap: wrap;\n }\n\n &[data-wrap='nowrap'],\n &[data-wrap-narrow='nowrap'] {\n flex-wrap: nowrap;\n }\n\n @media (--viewportRange-regular) {\n &[data-padding-regular='none'] {\n padding: 0;\n }\n\n &[data-padding-regular='condensed'] {\n /* stylelint-disable-next-line primer/spacing */\n padding: var(--stack-padding-condensed);\n }\n\n &[data-padding-regular='normal'] {\n /* stylelint-disable-next-line primer/spacing */\n padding: var(--stack-padding-normal);\n }\n\n &[data-padding-regular='spacious'] {\n /* stylelint-disable-next-line primer/spacing */\n padding: var(--stack-padding-spacious);\n }\n\n &[data-direction-regular='horizontal'] {\n flex-flow: row;\n }\n\n &[data-direction-regular='vertical'] {\n flex-flow: column;\n }\n\n &[data-gap-regular='none'] {\n --stack-gap: 0;\n }\n\n &[data-gap-regular='condensed'] {\n --stack-gap: var(--stack-gap-condensed);\n }\n\n &[data-gap-regular='normal'] {\n --stack-gap: var(--stack-gap-normal);\n }\n\n &[data-gap-regular='spacious'] {\n --stack-gap: var(--stack-gap-spacious);\n }\n\n &[data-align-regular='start'] {\n align-items: flex-start;\n }\n\n &[data-align-regular='center'] {\n align-items: center;\n }\n\n &[data-align-regular='end'] {\n align-items: flex-end;\n }\n\n &[data-align-regular='baseline'] {\n align-items: baseline;\n }\n\n &[data-justify-regular='start'] {\n justify-content: flex-start;\n }\n\n &[data-justify-regular='center'] {\n justify-content: center;\n }\n\n &[data-justify-regular='end'] {\n justify-content: flex-end;\n }\n\n &[data-justify-regular='space-between'] {\n justify-content: space-between;\n }\n\n &[data-justify-regular='space-evenly'] {\n justify-content: space-evenly;\n }\n\n &[data-wrap-regular='wrap'] {\n flex-wrap: wrap;\n }\n\n &[data-wrap-regular='nowrap'] {\n flex-wrap: nowrap;\n }\n }\n\n @media (--viewportRange-wide) {\n &[data-padding-wide='none'] {\n padding: 0;\n }\n\n &[data-padding-wide='condensed'] {\n /* stylelint-disable-next-line primer/spacing */\n padding: var(--stack-padding-condensed);\n }\n\n &[data-padding-wide='normal'] {\n /* stylelint-disable-next-line primer/spacing */\n padding: var(--stack-padding-normal);\n }\n\n &[data-padding-wide='spacious'] {\n /* stylelint-disable-next-line primer/spacing */\n padding: var(--stack-padding-spacious);\n }\n\n &[data-direction-wide='horizontal'] {\n flex-flow: row;\n }\n\n &[data-direction-wide='vertical'] {\n flex-flow: column;\n }\n\n &[data-gap-wide='none'] {\n --stack-gap: 0;\n }\n\n &[data-gap-wide='condensed'] {\n --stack-gap: var(--stack-gap-condensed);\n }\n\n &[data-gap-wide='normal'] {\n --stack-gap: var(--stack-gap-normal);\n }\n\n &[data-gap-wide='spacious'] {\n --stack-gap: var(--stack-gap-spacious);\n }\n\n &[data-align-wide='start'] {\n align-items: flex-start;\n }\n\n &[data-align-wide='center'] {\n align-items: center;\n }\n\n &[data-align-wide='end'] {\n align-items: flex-end;\n }\n\n &[data-align-wide='baseline'] {\n align-items: baseline;\n }\n\n &[data-justify-wide='start'] {\n justify-content: flex-start;\n }\n\n &[data-justify-wide='center'] {\n justify-content: center;\n }\n\n &[data-justify-wide='end'] {\n justify-content: flex-end;\n }\n\n &[data-justify-wide='space-between'] {\n justify-content: space-between;\n }\n\n &[data-justify-wide='space-evenly'] {\n justify-content: space-evenly;\n }\n\n &[data-wrap-wide='wrap'] {\n flex-wrap: wrap;\n }\n\n &[data-wrap-wide='nowrap'] {\n flex-wrap: nowrap;\n }\n }\n}\n\n.StackItem {\n flex: 0 1 auto;\n min-inline-size: 0;\n\n &[data-shrink='false'],\n &[data-shrink-narrow='false'] {\n flex-shrink: 0;\n }\n\n &[data-grow='true'],\n &[data-grow-narrow='true'] {\n flex-grow: 1;\n }\n\n @media (--viewportRange-regular) {\n &[data-grow-regular='true'] {\n flex-grow: 1;\n }\n\n &[data-grow-regular='false'] {\n flex-grow: 0;\n }\n\n &[data-shrink-regular='true'] {\n flex-shrink: 1;\n }\n\n &[data-shrink-regular='false'] {\n flex-shrink: 0;\n }\n }\n\n @media (--viewportRange-wide) {\n &[data-grow-wide='true'] {\n flex-grow: 1;\n }\n\n &[data-grow-wide='false'] {\n flex-grow: 0;\n }\n\n &[data-shrink-wide='true'] {\n flex-shrink: 1;\n }\n\n &[data-shrink-wide='false'] {\n flex-shrink: 0;\n }\n }\n}\n"]}
|