@primer/react 0.0.0-20260324194419 → 0.0.0-20260324200237
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 +4 -2
- package/dist/ActionList/List.d.ts.map +1 -1
- package/dist/ActionList/List.js +41 -41
- package/dist/AnchoredOverlay/AnchoredOverlay.d.ts.map +1 -1
- package/dist/AnchoredOverlay/AnchoredOverlay.js +13 -3
- package/dist/ButtonGroup/ButtonGroup.d.ts.map +1 -1
- package/dist/ButtonGroup/ButtonGroup.js +23 -23
- package/dist/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/Checkbox/Checkbox.js +5 -5
- package/dist/Dialog/{Dialog-2de477b3.css → Dialog-b577691f.css} +2 -2
- package/dist/Dialog/Dialog-b577691f.css.map +1 -0
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +35 -6
- package/dist/Dialog/Dialog.module.css.js +1 -1
- package/dist/FilteredActionList/FilteredActionList.d.ts.map +1 -1
- package/dist/FilteredActionList/FilteredActionList.js +8 -8
- package/dist/PageHeader/PageHeader.d.ts.map +1 -1
- package/dist/PageHeader/PageHeader.js +31 -30
- package/dist/TextInput/TextInput.d.ts.map +1 -1
- package/dist/TextInput/TextInput.js +6 -5
- package/dist/TooltipV2/Tooltip.d.ts.map +1 -1
- package/dist/TooltipV2/Tooltip.js +4 -4
- package/dist/experimental/Tabs/Tabs.d.ts +1 -1
- package/dist/experimental/Tabs/Tabs.d.ts.map +1 -1
- package/dist/experimental/Tabs/Tabs.js +16 -16
- package/dist/hooks/useMergedRefs.d.ts +5 -5
- package/dist/hooks/useMergedRefs.d.ts.map +1 -1
- package/dist/hooks/useMergedRefs.js +5 -11
- package/dist/hooks/useProvidedRefOrCreate.d.ts +10 -7
- package/dist/hooks/useProvidedRefOrCreate.d.ts.map +1 -1
- package/dist/hooks/useProvidedRefOrCreate.js +10 -10
- package/package.json +1 -1
- package/dist/Dialog/Dialog-2de477b3.css.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# @primer/react
|
|
2
2
|
|
|
3
|
-
## 0.0.0-
|
|
3
|
+
## 0.0.0-20260324200237
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
7
7
|
- [#7658](https://github.com/primer/react/pull/7658) [`259fdff`](https://github.com/primer/react/commit/259fdff67550e328b851129a78e87413ddb07229) Thanks [@hussam-i-am](https://github.com/hussam-i-am)! - fix(polymorphic): Improve prop passthrough for ActionList.LinkItem and Breadcrumbs.Item
|
|
8
8
|
|
|
9
|
-
- [#7672](https://github.com/primer/react/pull/7672) [`
|
|
9
|
+
- [#7672](https://github.com/primer/react/pull/7672) [`77735f9`](https://github.com/primer/react/commit/77735f975c71b267130899fc1fd7b47bcb5f062d) Thanks [@iansan5653](https://github.com/iansan5653)! - - New: Exposes new `useMergedRefs` hook that can merge two refs into a single combined ref
|
|
10
10
|
|
|
11
11
|
- Deprecates `useRefObjectAsForwardedRef`; see doc comment for migration instructions
|
|
12
12
|
- Deprecates `useProvidedRefOrCreate`; see doc comment for migration instructions
|
|
@@ -19,6 +19,8 @@
|
|
|
19
19
|
|
|
20
20
|
- [#7510](https://github.com/primer/react/pull/7510) [`8fa988b`](https://github.com/primer/react/commit/8fa988ba613117874657af722ef6de768b0e0eb8) Thanks [@francinelucca](https://github.com/francinelucca)! - chore: ensure max-height does not surpass viewport height in Overlay, ActionMenu under feature flag
|
|
21
21
|
|
|
22
|
+
- [#7683](https://github.com/primer/react/pull/7683) [`c16f377`](https://github.com/primer/react/commit/c16f37743527cadf58cc92ee7b6931d46d6252eb) Thanks [@liuliu-dev](https://github.com/liuliu-dev)! - Dialog: dynamically switch footer button layout based on available height.
|
|
23
|
+
|
|
22
24
|
- [#7682](https://github.com/primer/react/pull/7682) [`8aed331`](https://github.com/primer/react/commit/8aed331f9dcb8c51d86bf531f7e331a6ccd23d9a) Thanks [@llastflowers](https://github.com/llastflowers)! - Update CheckboxOrRadioGroup.tsx to add `required` announcement
|
|
23
25
|
|
|
24
26
|
## 38.16.0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"List.d.ts","sourceRoot":"","sources":["../../src/ActionList/List.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"List.d.ts","sourceRoot":"","sources":["../../src/ActionList/List.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiB,MAAM,OAAO,CAAA;AAuFrC,QAAA,MAAM,IAAI,GA3Ea,EAAE,SAAS,KAAK,CAAC,WAAW;;;;;;;;;;;;;;;;;;;;oDA2ER,CAAA;AAI3C,OAAO,EAAC,IAAI,EAAC,CAAA"}
|
package/dist/ActionList/List.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c } from 'react-compiler-runtime';
|
|
2
|
-
import React
|
|
2
|
+
import React from 'react';
|
|
3
3
|
import { fixedForwardRef } from '../utils/modern-polymorphic.js';
|
|
4
4
|
import { ActionListContainerContext } from './ActionListContainerContext.js';
|
|
5
5
|
import { useSlots } from '../hooks/useSlots.js';
|
|
@@ -10,12 +10,12 @@ import { useFocusZone } from '../hooks/useFocusZone.js';
|
|
|
10
10
|
import { clsx } from 'clsx';
|
|
11
11
|
import classes from './ActionList.module.css.js';
|
|
12
12
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
13
|
-
import {
|
|
13
|
+
import { useProvidedRefOrCreate } from '../hooks/useProvidedRefOrCreate.js';
|
|
14
14
|
import { FocusKeys } from '@primer/behaviors';
|
|
15
15
|
|
|
16
16
|
const UnwrappedList = (props, forwardedRef) => {
|
|
17
17
|
var _slots$heading$props$;
|
|
18
|
-
const $ = c(
|
|
18
|
+
const $ = c(37);
|
|
19
19
|
let className;
|
|
20
20
|
let restProps;
|
|
21
21
|
let role;
|
|
@@ -78,8 +78,7 @@ const UnwrappedList = (props, forwardedRef) => {
|
|
|
78
78
|
} = React.useContext(ActionListContainerContext);
|
|
79
79
|
const ariaLabelledBy = slots.heading ? (_slots$heading$props$ = slots.heading.props.id) !== null && _slots$heading$props$ !== void 0 ? _slots$heading$props$ : headingId : listLabelledBy;
|
|
80
80
|
const listRole = role || listRoleFromContainer;
|
|
81
|
-
const listRef =
|
|
82
|
-
const mergedRef = useMergedRefs(forwardedRef, listRef);
|
|
81
|
+
const listRef = useProvidedRefOrCreate(forwardedRef);
|
|
83
82
|
let enableFocusZone = false;
|
|
84
83
|
if (enableFocusZoneFromContainer !== undefined) {
|
|
85
84
|
enableFocusZone = enableFocusZoneFromContainer;
|
|
@@ -98,23 +97,24 @@ const UnwrappedList = (props, forwardedRef) => {
|
|
|
98
97
|
const t5 = !enableFocusZone;
|
|
99
98
|
const t6 = listRole === "menu" || container === "SelectPanel" || container === "FilteredActionList" ? "wrap" : undefined;
|
|
100
99
|
let t7;
|
|
101
|
-
if ($[11] !==
|
|
100
|
+
if ($[11] !== listRef || $[12] !== t5 || $[13] !== t6) {
|
|
102
101
|
t7 = {
|
|
103
102
|
disabled: t5,
|
|
104
103
|
containerRef: listRef,
|
|
105
104
|
bindKeys: FocusKeys.ArrowVertical | FocusKeys.HomeAndEnd | FocusKeys.PageUpDown,
|
|
106
105
|
focusOutBehavior: t6
|
|
107
106
|
};
|
|
108
|
-
$[11] =
|
|
109
|
-
$[12] =
|
|
110
|
-
$[13] =
|
|
107
|
+
$[11] = listRef;
|
|
108
|
+
$[12] = t5;
|
|
109
|
+
$[13] = t6;
|
|
110
|
+
$[14] = t7;
|
|
111
111
|
} else {
|
|
112
|
-
t7 = $[
|
|
112
|
+
t7 = $[14];
|
|
113
113
|
}
|
|
114
114
|
useFocusZone(t7);
|
|
115
115
|
const t8 = selectionVariant || containerSelectionVariant;
|
|
116
116
|
let t9;
|
|
117
|
-
if ($[
|
|
117
|
+
if ($[15] !== headingId || $[16] !== listRole || $[17] !== showDividers || $[18] !== t8 || $[19] !== variant) {
|
|
118
118
|
t9 = {
|
|
119
119
|
variant,
|
|
120
120
|
selectionVariant: t8,
|
|
@@ -122,62 +122,62 @@ const UnwrappedList = (props, forwardedRef) => {
|
|
|
122
122
|
role: listRole,
|
|
123
123
|
headingId
|
|
124
124
|
};
|
|
125
|
-
$[
|
|
126
|
-
$[
|
|
127
|
-
$[
|
|
128
|
-
$[
|
|
129
|
-
$[
|
|
130
|
-
$[
|
|
125
|
+
$[15] = headingId;
|
|
126
|
+
$[16] = listRole;
|
|
127
|
+
$[17] = showDividers;
|
|
128
|
+
$[18] = t8;
|
|
129
|
+
$[19] = variant;
|
|
130
|
+
$[20] = t9;
|
|
131
131
|
} else {
|
|
132
|
-
t9 = $[
|
|
132
|
+
t9 = $[20];
|
|
133
133
|
}
|
|
134
134
|
const listContextValue = t9;
|
|
135
135
|
const t10 = slots.heading;
|
|
136
136
|
let t11;
|
|
137
|
-
if ($[
|
|
137
|
+
if ($[21] !== className) {
|
|
138
138
|
t11 = clsx(classes.ActionList, className);
|
|
139
|
-
$[
|
|
140
|
-
$[
|
|
139
|
+
$[21] = className;
|
|
140
|
+
$[22] = t11;
|
|
141
141
|
} else {
|
|
142
|
-
t11 = $[
|
|
142
|
+
t11 = $[22];
|
|
143
143
|
}
|
|
144
144
|
let t12;
|
|
145
|
-
if ($[
|
|
145
|
+
if ($[23] !== Component || $[24] !== ariaLabelledBy || $[25] !== childrenWithoutSlots || $[26] !== listRef || $[27] !== listRole || $[28] !== restProps || $[29] !== showDividers || $[30] !== t11 || $[31] !== variant) {
|
|
146
146
|
t12 = /*#__PURE__*/jsx(Component, {
|
|
147
147
|
className: t11,
|
|
148
148
|
role: listRole,
|
|
149
149
|
"aria-labelledby": ariaLabelledBy,
|
|
150
|
-
ref:
|
|
150
|
+
ref: listRef,
|
|
151
151
|
"data-dividers": showDividers,
|
|
152
152
|
"data-variant": variant,
|
|
153
153
|
...restProps,
|
|
154
154
|
children: childrenWithoutSlots
|
|
155
155
|
});
|
|
156
|
-
$[
|
|
157
|
-
$[
|
|
158
|
-
$[
|
|
159
|
-
$[
|
|
160
|
-
$[
|
|
161
|
-
$[
|
|
162
|
-
$[
|
|
163
|
-
$[
|
|
164
|
-
$[
|
|
165
|
-
$[
|
|
156
|
+
$[23] = Component;
|
|
157
|
+
$[24] = ariaLabelledBy;
|
|
158
|
+
$[25] = childrenWithoutSlots;
|
|
159
|
+
$[26] = listRef;
|
|
160
|
+
$[27] = listRole;
|
|
161
|
+
$[28] = restProps;
|
|
162
|
+
$[29] = showDividers;
|
|
163
|
+
$[30] = t11;
|
|
164
|
+
$[31] = variant;
|
|
165
|
+
$[32] = t12;
|
|
166
166
|
} else {
|
|
167
|
-
t12 = $[
|
|
167
|
+
t12 = $[32];
|
|
168
168
|
}
|
|
169
169
|
let t13;
|
|
170
|
-
if ($[
|
|
170
|
+
if ($[33] !== listContextValue || $[34] !== slots.heading || $[35] !== t12) {
|
|
171
171
|
t13 = /*#__PURE__*/jsxs(ListContext.Provider, {
|
|
172
172
|
value: listContextValue,
|
|
173
173
|
children: [t10, t12]
|
|
174
174
|
});
|
|
175
|
-
$[
|
|
176
|
-
$[
|
|
177
|
-
$[
|
|
178
|
-
$[
|
|
175
|
+
$[33] = listContextValue;
|
|
176
|
+
$[34] = slots.heading;
|
|
177
|
+
$[35] = t12;
|
|
178
|
+
$[36] = t13;
|
|
179
179
|
} else {
|
|
180
|
-
t13 = $[
|
|
180
|
+
t13 = $[36];
|
|
181
181
|
}
|
|
182
182
|
return t13;
|
|
183
183
|
};
|
|
@@ -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,EAAiC,KAAK,GAAG,EAAC,MAAM,OAAO,CAAA;AAC9D,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,YAAY,CAAA;AAE5C,OAAO,KAAK,EAAC,qBAAqB,E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 -10,7 +10,6 @@ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
|
10
10
|
import { useFeatureFlag } from '../FeatureFlags/useFeatureFlag.js';
|
|
11
11
|
import { useProvidedRefOrCreate } from '../hooks/useProvidedRefOrCreate.js';
|
|
12
12
|
import { useRenderForcingRef } from '../hooks/useRenderForcingRef.js';
|
|
13
|
-
import { useMergedRefs } from '../hooks/useMergedRefs.js';
|
|
14
13
|
import { useAnchoredPosition } from '../hooks/useAnchoredPosition.js';
|
|
15
14
|
import Overlay from '../Overlay/Overlay.js';
|
|
16
15
|
|
|
@@ -63,7 +62,6 @@ const AnchoredOverlay = ({
|
|
|
63
62
|
const cssAnchorPositioning = useFeatureFlag('primer_react_css_anchor_positioning');
|
|
64
63
|
const anchorRef = useProvidedRefOrCreate(externalAnchorRef);
|
|
65
64
|
const [overlayRef, updateOverlayRef] = useRenderForcingRef();
|
|
66
|
-
const mergedOverlayRef = useMergedRefs(updateOverlayRef, overlayProps === null || overlayProps === void 0 ? void 0 : overlayProps.ref);
|
|
67
65
|
const anchorId = useId(externalAnchorId);
|
|
68
66
|
const onClickOutside = useCallback(() => onClose === null || onClose === void 0 ? void 0 : onClose('click-outside'), [onClose]);
|
|
69
67
|
const onEscape = useCallback(() => onClose === null || onClose === void 0 ? void 0 : onClose('escape'), [onClose]);
|
|
@@ -162,7 +160,12 @@ const AnchoredOverlay = ({
|
|
|
162
160
|
preventOverflow: preventOverflow,
|
|
163
161
|
"data-component": "AnchoredOverlay",
|
|
164
162
|
...restOverlayProps,
|
|
165
|
-
ref:
|
|
163
|
+
ref: node => {
|
|
164
|
+
if (overlayProps !== null && overlayProps !== void 0 && overlayProps.ref) {
|
|
165
|
+
assignRef(overlayProps.ref, node);
|
|
166
|
+
}
|
|
167
|
+
updateOverlayRef(node);
|
|
168
|
+
},
|
|
166
169
|
"data-anchor-position": cssAnchorPositioning,
|
|
167
170
|
"data-side": cssAnchorPositioning ? side : position_0 === null || position_0 === void 0 ? void 0 : position_0.anchorSide,
|
|
168
171
|
children: [showXIcon ? /*#__PURE__*/jsx("div", {
|
|
@@ -195,6 +198,13 @@ const AnchoredOverlay = ({
|
|
|
195
198
|
}
|
|
196
199
|
return innerContent;
|
|
197
200
|
};
|
|
201
|
+
function assignRef(ref, value) {
|
|
202
|
+
if (typeof ref === 'function') {
|
|
203
|
+
ref(value);
|
|
204
|
+
} else if (ref) {
|
|
205
|
+
ref.current = value;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
198
208
|
AnchoredOverlay.displayName = 'AnchoredOverlay';
|
|
199
209
|
|
|
200
210
|
export { AnchoredOverlay };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonGroup.d.ts","sourceRoot":"","sources":["../../src/ButtonGroup/ButtonGroup.tsx"],"names":[],"mappings":"AAAA,OAAc,
|
|
1
|
+
{"version":3,"file":"ButtonGroup.d.ts","sourceRoot":"","sources":["../../src/ButtonGroup/ButtonGroup.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAC,KAAK,iBAAiB,EAAC,MAAM,OAAO,CAAA;AAKnD,OAAO,KAAK,EAAC,mBAAmB,IAAI,8BAA8B,EAAC,MAAM,sBAAsB,CAAA;AAE/F,MAAM,MAAM,gBAAgB,GAAG,iBAAiB,CAAC;IAC/C,4BAA4B;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,sCAAsC;IACtC,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAC,CAAA;AAEF,QAAA,MAAM,WAAW,EAoBX,8BAA8B,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAA;AAI7D,eAAe,WAAW,CAAA"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { c } from 'react-compiler-runtime';
|
|
2
|
-
import React
|
|
2
|
+
import React from 'react';
|
|
3
3
|
import classes from './ButtonGroup.module.css.js';
|
|
4
4
|
import { clsx } from 'clsx';
|
|
5
5
|
import { useFocusZone } from '../hooks/useFocusZone.js';
|
|
6
6
|
import { jsx } from 'react/jsx-runtime';
|
|
7
|
-
import {
|
|
7
|
+
import { useProvidedRefOrCreate } from '../hooks/useProvidedRefOrCreate.js';
|
|
8
8
|
import { FocusKeys } from '@primer/behaviors';
|
|
9
9
|
|
|
10
10
|
const ButtonGroup = /*#__PURE__*/React.forwardRef(function ButtonGroup(t0, forwardRef) {
|
|
11
|
-
const $ = c(
|
|
11
|
+
const $ = c(20);
|
|
12
12
|
let children;
|
|
13
13
|
let className;
|
|
14
14
|
let rest;
|
|
@@ -45,49 +45,49 @@ const ButtonGroup = /*#__PURE__*/React.forwardRef(function ButtonGroup(t0, forwa
|
|
|
45
45
|
t2 = $[7];
|
|
46
46
|
}
|
|
47
47
|
const buttons = t2;
|
|
48
|
-
const buttonRef =
|
|
49
|
-
const mergedRef = useMergedRefs(buttonRef, forwardRef);
|
|
48
|
+
const buttonRef = useProvidedRefOrCreate(forwardRef);
|
|
50
49
|
const t3 = role !== "toolbar";
|
|
51
50
|
let t4;
|
|
52
|
-
if ($[8] !== t3) {
|
|
51
|
+
if ($[8] !== buttonRef || $[9] !== t3) {
|
|
53
52
|
t4 = {
|
|
54
53
|
containerRef: buttonRef,
|
|
55
54
|
disabled: t3,
|
|
56
55
|
bindKeys: FocusKeys.ArrowHorizontal,
|
|
57
56
|
focusOutBehavior: "wrap"
|
|
58
57
|
};
|
|
59
|
-
$[8] =
|
|
60
|
-
$[9] =
|
|
58
|
+
$[8] = buttonRef;
|
|
59
|
+
$[9] = t3;
|
|
60
|
+
$[10] = t4;
|
|
61
61
|
} else {
|
|
62
|
-
t4 = $[
|
|
62
|
+
t4 = $[10];
|
|
63
63
|
}
|
|
64
64
|
useFocusZone(t4);
|
|
65
65
|
let t5;
|
|
66
|
-
if ($[
|
|
66
|
+
if ($[11] !== className) {
|
|
67
67
|
t5 = clsx(className, classes.ButtonGroup);
|
|
68
|
-
$[
|
|
69
|
-
$[
|
|
68
|
+
$[11] = className;
|
|
69
|
+
$[12] = t5;
|
|
70
70
|
} else {
|
|
71
|
-
t5 = $[
|
|
71
|
+
t5 = $[12];
|
|
72
72
|
}
|
|
73
73
|
let t6;
|
|
74
|
-
if ($[
|
|
74
|
+
if ($[13] !== BaseComponent || $[14] !== buttonRef || $[15] !== buttons || $[16] !== rest || $[17] !== role || $[18] !== t5) {
|
|
75
75
|
t6 = /*#__PURE__*/jsx(BaseComponent, {
|
|
76
|
-
ref:
|
|
76
|
+
ref: buttonRef,
|
|
77
77
|
className: t5,
|
|
78
78
|
role: role,
|
|
79
79
|
...rest,
|
|
80
80
|
children: buttons
|
|
81
81
|
});
|
|
82
|
-
$[
|
|
83
|
-
$[
|
|
84
|
-
$[
|
|
85
|
-
$[
|
|
86
|
-
$[
|
|
87
|
-
$[
|
|
88
|
-
$[
|
|
82
|
+
$[13] = BaseComponent;
|
|
83
|
+
$[14] = buttonRef;
|
|
84
|
+
$[15] = buttons;
|
|
85
|
+
$[16] = rest;
|
|
86
|
+
$[17] = role;
|
|
87
|
+
$[18] = t5;
|
|
88
|
+
$[19] = t6;
|
|
89
89
|
} else {
|
|
90
|
-
t6 = $[
|
|
90
|
+
t6 = $[19];
|
|
91
91
|
}
|
|
92
92
|
return t6;
|
|
93
93
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../src/Checkbox/Checkbox.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../src/Checkbox/Checkbox.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAiD,KAAK,mBAAmB,EAAoB,MAAM,OAAO,CAAA;AAExH,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,qCAAqC,CAAA;AAI7E,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,gBAAgB,CAAA;AAElD,MAAM,MAAM,aAAa,GAAG;IAC1B;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,GAAG,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAA;IACvC;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,gBAAgB,CAAC,EAAE,oBAAoB,CAAA;IACvC;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,GAAG,OAAO,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC,CAAA;AAE3D;;GAEG;AACH,QAAA,MAAM,QAAQ,qGAgDb,CAAA;wBAK0B,cAAc,CAAC,OAAO,QAAQ,CAAC;AAA1D,wBAA0D"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { clsx } from 'clsx';
|
|
2
|
-
import React, {
|
|
2
|
+
import React, { useContext, useEffect } from 'react';
|
|
3
3
|
import useIsomorphicLayoutEffect from '../utils/useIsomorphicLayoutEffect.js';
|
|
4
4
|
import { CheckboxGroupContext } from '../CheckboxGroup/CheckboxGroupContext.js';
|
|
5
5
|
import classes from './Checkbox.module.css.js';
|
|
6
6
|
import sharedClasses from './shared.module.css.js';
|
|
7
7
|
import { jsx } from 'react/jsx-runtime';
|
|
8
|
-
import {
|
|
8
|
+
import { useProvidedRefOrCreate } from '../hooks/useProvidedRefOrCreate.js';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* An accessible, native checkbox component
|
|
@@ -24,8 +24,7 @@ const Checkbox = /*#__PURE__*/React.forwardRef(({
|
|
|
24
24
|
}, ref
|
|
25
25
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
26
26
|
) => {
|
|
27
|
-
const checkboxRef =
|
|
28
|
-
const mergedRef = useMergedRefs(checkboxRef, ref);
|
|
27
|
+
const checkboxRef = useProvidedRefOrCreate(ref);
|
|
29
28
|
const checkboxGroupContext = useContext(CheckboxGroupContext);
|
|
30
29
|
const handleOnChange = e => {
|
|
31
30
|
checkboxGroupContext.onChange && checkboxGroupContext.onChange(e);
|
|
@@ -34,7 +33,7 @@ const Checkbox = /*#__PURE__*/React.forwardRef(({
|
|
|
34
33
|
const inputProps = {
|
|
35
34
|
type: 'checkbox',
|
|
36
35
|
disabled,
|
|
37
|
-
ref:
|
|
36
|
+
ref: checkboxRef,
|
|
38
37
|
checked: indeterminate ? false : checked,
|
|
39
38
|
defaultChecked,
|
|
40
39
|
required,
|
|
@@ -63,6 +62,7 @@ const Checkbox = /*#__PURE__*/React.forwardRef(({
|
|
|
63
62
|
checkbox.setAttribute('aria-checked', checkbox.checked ? 'true' : 'false');
|
|
64
63
|
}
|
|
65
64
|
});
|
|
65
|
+
// @ts-expect-error inputProp needs a non nullable ref
|
|
66
66
|
return /*#__PURE__*/jsx("input", {
|
|
67
67
|
...inputProps,
|
|
68
68
|
className: clsx(className, sharedClasses.Input, classes.Checkbox)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
@property --prc-dialog-scrollgutter{initial-value:0;inherits:false;syntax:"<length>"}@keyframes prc-Dialog-dialog-backdrop-appear-tCG2K{0%{opacity:0}to{opacity:1}}@keyframes prc-Dialog-Overlay--motion-scaleFade-mE6-C{0%{opacity:0;transform:scale(.5)}to{opacity:1;transform:scale(1)}}@keyframes prc-Dialog-Overlay--motion-slideUp-tPElO{0%{transform:translateY(100%)}}@keyframes prc-Dialog-Overlay--motion-slideInRight-BR-CZ{0%{transform:translateX(-100%)}}@keyframes prc-Dialog-Overlay--motion-slideInLeft-ISmQZ{0%{transform:translateX(100%)}}@keyframes prc-Dialog-detect-scroll-b3i8Q{0%,to{--can-scroll:1}}.prc-Dialog-Backdrop-5Nt2U{animation:prc-Dialog-dialog-backdrop-appear-tCG2K .2s cubic-bezier(.33,1,.68,1);background-color:var(--overlay-backdrop-bgColor,var(--color-overlay-backdrop));bottom:0;display:flex;left:0;position:fixed;right:0;top:0}.prc-Dialog-Backdrop-5Nt2U,.prc-Dialog-Backdrop-5Nt2U[data-position-regular=center]{align-items:center;justify-content:center}.prc-Dialog-Backdrop-5Nt2U[data-position-regular=left]{align-items:center;justify-content:flex-start}.prc-Dialog-Backdrop-5Nt2U[data-position-regular=right]{align-items:center;justify-content:flex-end}.prc-Dialog-Backdrop-5Nt2U[data-align=top]:where(:not([data-position-regular=left]):not([data-position-regular=right])){align-items:flex-start}.prc-Dialog-Backdrop-5Nt2U[data-align=center]:where(:not([data-position-regular=left]):not([data-position-regular=right])){align-items:center}.prc-Dialog-Backdrop-5Nt2U[data-align=bottom]:where(:not([data-position-regular=left]):not([data-position-regular=right])){align-items:flex-end}@media (max-width:767px){.prc-Dialog-Backdrop-5Nt2U[data-position-narrow=center]{align-items:center;justify-content:center}.prc-Dialog-Backdrop-5Nt2U[data-position-narrow=center][data-align=top]{align-items:flex-start}.prc-Dialog-Backdrop-5Nt2U[data-position-narrow=center][data-align=center]{align-items:center}.prc-Dialog-Backdrop-5Nt2U[data-position-narrow=center][data-align=bottom]{align-items:flex-end}.prc-Dialog-Backdrop-5Nt2U[data-position-narrow=bottom]{align-items:end;justify-content:center}}.prc-Dialog-Dialog-G8cDF{background-color:var(--overlay-bgColor,var(--color-canvas-overlay));border-radius:var(--borderRadius-large,.75rem);border-radius:var(--borderRadius-large,var(--borderRadius-large,.75rem));box-shadow:var(--shadow-floating-small,var(--color-overlay-shadow));display:flex;flex-direction:column;height:auto;max-height:calc(100dvh - 64px);max-width:calc(100dvw - 64px);min-width:296px;opacity:1;width:640px}.prc-Dialog-Dialog-G8cDF:where([data-width=small]){width:296px}.prc-Dialog-Dialog-G8cDF:where([data-width=medium]){width:320px}.prc-Dialog-Dialog-G8cDF:where([data-width=large]){width:480px}.prc-Dialog-Dialog-G8cDF:where([data-height=small]){height:480px}.prc-Dialog-Dialog-G8cDF:where([data-height=large]){height:640px}@media screen and (prefers-reduced-motion:no-preference){.prc-Dialog-Dialog-G8cDF{animation:prc-Dialog-Overlay--motion-scaleFade-mE6-C .2s cubic-bezier(.33,1,.68,1) 1ms 1 normal none running}}.prc-Dialog-Dialog-G8cDF[data-position-regular=center]{border-radius:var(--borderRadius-large,var(--borderRadius-large,.75rem))}@media screen and (prefers-reduced-motion:no-preference){.prc-Dialog-Dialog-G8cDF[data-position-regular=center]{animation:prc-Dialog-Overlay--motion-scaleFade-mE6-C .2s cubic-bezier(.33,1,.68,1) 1ms 1 normal none running}}.prc-Dialog-Dialog-G8cDF[data-position-regular=center][data-align=top]{margin-top:var(--base-size-64,4rem)}.prc-Dialog-Dialog-G8cDF[data-position-regular=center][data-align=bottom]{margin-bottom:var(--base-size-64,4rem)}.prc-Dialog-Dialog-G8cDF[data-position-regular=left]{border-radius:var(--borderRadius-large,var(--borderRadius-large,.75rem));border-bottom-left-radius:0;border-top-left-radius:0;height:100dvh;max-height:unset}@media screen and (prefers-reduced-motion:no-preference){.prc-Dialog-Dialog-G8cDF[data-position-regular=left]{animation:prc-Dialog-Overlay--motion-slideInRight-BR-CZ .25s cubic-bezier(.33,1,.68,1) 1ms 1 normal none running}}.prc-Dialog-Dialog-G8cDF[data-position-regular=right]{border-radius:var(--borderRadius-large,var(--borderRadius-large,.75rem));border-bottom-right-radius:0;border-top-right-radius:0;height:100dvh;max-height:unset}@media screen and (prefers-reduced-motion:no-preference){.prc-Dialog-Dialog-G8cDF[data-position-regular=right]{animation:prc-Dialog-Overlay--motion-slideInLeft-ISmQZ .25s cubic-bezier(.33,1,.68,1) 0s 1 normal none running}}@media (max-width:767px){.prc-Dialog-Dialog-G8cDF[data-position-narrow=center]{border-radius:var(--borderRadius-large,var(--borderRadius-large,.75rem));height:auto;width:640px}.prc-Dialog-Dialog-G8cDF[data-position-narrow=center]:where([data-width=small]){width:296px}.prc-Dialog-Dialog-G8cDF[data-position-narrow=center]:where([data-width=medium]){width:320px}.prc-Dialog-Dialog-G8cDF[data-position-narrow=center]:where([data-width=large]){width:480px}.prc-Dialog-Dialog-G8cDF[data-position-narrow=center]:where([data-height=small]){height:480px}.prc-Dialog-Dialog-G8cDF[data-position-narrow=center]:where([data-height=large]){height:640px}@media (max-height:280px){.prc-Dialog-Dialog-G8cDF{max-height:calc(100dvh - 12px);max-width:calc(100dvw - 12px)}}.prc-Dialog-Dialog-G8cDF[data-position-narrow=bottom]{border-radius:var(--borderRadius-large,var(--borderRadius-large,.75rem));border-bottom-left-radius:0;border-bottom-right-radius:0;height:auto;max-height:calc(100dvh - 64px);max-width:100dvw;width:100dvw}.prc-Dialog-Dialog-G8cDF[data-position-narrow=bottom][data-align]{margin-bottom:0;margin-top:0}@media screen and (prefers-reduced-motion:no-preference){.prc-Dialog-Dialog-G8cDF[data-position-narrow=bottom]{animation:prc-Dialog-Overlay--motion-slideUp-tPElO .25s cubic-bezier(.33,1,.68,1) 1ms 1 normal none running}}.prc-Dialog-Dialog-G8cDF[data-position-narrow=fullscreen]{border-radius:unset!important;flex-grow:1;height:100%;max-height:100dvh;max-width:100dvw;width:100%}.prc-Dialog-Dialog-G8cDF[data-position-narrow=fullscreen][data-align]{margin-bottom:0;margin-top:0}@media screen and (prefers-reduced-motion:no-preference){.prc-Dialog-Dialog-G8cDF[data-position-narrow=fullscreen]{animation:prc-Dialog-Overlay--motion-scaleFade-mE6-C .2s cubic-bezier(.33,1,.68,1) 1ms 1 normal none running}}}body:not([data-dialog-scroll-optimized]):has(.prc-Dialog-Dialog-G8cDF.prc-Dialog-DisableScroll-UkWFM){overflow:hidden!important;padding-right:var(--prc-dialog-scrollgutter)!important}body[data-dialog-scroll-disabled]{overflow:hidden!important;padding-right:var(--prc-dialog-scrollgutter)!important}.prc-Dialog-DialogOverflowWrapper-JvHzz{flex-grow:1}.prc-Dialog-Dialog-G8cDF[data-has-footer]{--can-scroll:0}.prc-Dialog-Dialog-G8cDF[data-has-footer] .prc-Dialog-DialogOverflowWrapper-JvHzz{animation:prc-Dialog-detect-scroll-b3i8Q;border-bottom:var(--borderWidth-default,.0625rem) solid var(--borderColor-default,var(--color-border-default));animation-timeline:scroll(self)}@supports (animation-timeline:scroll(self)){.prc-Dialog-Dialog-G8cDF[data-has-footer] .prc-Dialog-DialogOverflowWrapper-JvHzz{border-bottom:calc(var(--borderWidth-thin,.0625rem)*var(--can-scroll)) solid var(--borderColor-default,var(--color-border-default))}}.prc-Dialog-Header-f7Me-{box-shadow:0 1px 0 var(--borderColor-default,var(--color-border-default));flex-shrink:0;max-height:35vh;overflow-y:auto;padding:var(--base-size-8,.5rem);z-index:1}.prc-Dialog-HeaderInner-H-fFY{display:flex}.prc-Dialog-HeaderContent-mjAsn{display:flex;flex-direction:column;flex-grow:1;padding-block:var(--base-size-6,.375rem);padding-inline:var(--base-size-8,.5rem)}.prc-Dialog-Title-M-iPn{font-size:var(--text-body-size-medium,.875rem);font-weight:var(--text-title-weight-large,600);margin:0}.prc-Dialog-Subtitle-aBFSq{color:var(--fgColor-muted,var(--color-fg-muted));font-size:var(--text-body-size-small,.75rem);font-weight:var(--base-text-weight-normal,400);margin:0;margin-top:var(--base-size-4,.25rem)}.prc-Dialog-Body-bB903{flex-grow:1;overflow:auto}.prc-Dialog-Body-bB903,.prc-Dialog-Footer-PMeQk{padding:var(--base-size-16,1rem)}.prc-Dialog-Footer-PMeQk{display:flex;flex-flow:wrap;flex-shrink:0;gap:var(--base-size-8,.5rem);justify-content:flex-end;z-index:1}
|
|
2
|
-
/*# sourceMappingURL=Dialog-
|
|
1
|
+
@property --prc-dialog-scrollgutter{initial-value:0;inherits:false;syntax:"<length>"}@keyframes prc-Dialog-dialog-backdrop-appear-tCG2K{0%{opacity:0}to{opacity:1}}@keyframes prc-Dialog-Overlay--motion-scaleFade-mE6-C{0%{opacity:0;transform:scale(.5)}to{opacity:1;transform:scale(1)}}@keyframes prc-Dialog-Overlay--motion-slideUp-tPElO{0%{transform:translateY(100%)}}@keyframes prc-Dialog-Overlay--motion-slideInRight-BR-CZ{0%{transform:translateX(-100%)}}@keyframes prc-Dialog-Overlay--motion-slideInLeft-ISmQZ{0%{transform:translateX(100%)}}@keyframes prc-Dialog-detect-scroll-b3i8Q{0%,to{--can-scroll:1}}.prc-Dialog-Backdrop-5Nt2U{animation:prc-Dialog-dialog-backdrop-appear-tCG2K .2s cubic-bezier(.33,1,.68,1);background-color:var(--overlay-backdrop-bgColor,var(--color-overlay-backdrop));bottom:0;display:flex;left:0;position:fixed;right:0;top:0}.prc-Dialog-Backdrop-5Nt2U,.prc-Dialog-Backdrop-5Nt2U[data-position-regular=center]{align-items:center;justify-content:center}.prc-Dialog-Backdrop-5Nt2U[data-position-regular=left]{align-items:center;justify-content:flex-start}.prc-Dialog-Backdrop-5Nt2U[data-position-regular=right]{align-items:center;justify-content:flex-end}.prc-Dialog-Backdrop-5Nt2U[data-align=top]:where(:not([data-position-regular=left]):not([data-position-regular=right])){align-items:flex-start}.prc-Dialog-Backdrop-5Nt2U[data-align=center]:where(:not([data-position-regular=left]):not([data-position-regular=right])){align-items:center}.prc-Dialog-Backdrop-5Nt2U[data-align=bottom]:where(:not([data-position-regular=left]):not([data-position-regular=right])){align-items:flex-end}@media (max-width:767px){.prc-Dialog-Backdrop-5Nt2U[data-position-narrow=center]{align-items:center;justify-content:center}.prc-Dialog-Backdrop-5Nt2U[data-position-narrow=center][data-align=top]{align-items:flex-start}.prc-Dialog-Backdrop-5Nt2U[data-position-narrow=center][data-align=center]{align-items:center}.prc-Dialog-Backdrop-5Nt2U[data-position-narrow=center][data-align=bottom]{align-items:flex-end}.prc-Dialog-Backdrop-5Nt2U[data-position-narrow=bottom]{align-items:end;justify-content:center}}.prc-Dialog-Dialog-G8cDF{background-color:var(--overlay-bgColor,var(--color-canvas-overlay));border-radius:var(--borderRadius-large,.75rem);border-radius:var(--borderRadius-large,var(--borderRadius-large,.75rem));box-shadow:var(--shadow-floating-small,var(--color-overlay-shadow));display:flex;flex-direction:column;height:auto;max-height:calc(100dvh - 64px);max-width:calc(100dvw - 64px);min-width:296px;opacity:1;width:640px}.prc-Dialog-Dialog-G8cDF:where([data-width=small]){width:296px}.prc-Dialog-Dialog-G8cDF:where([data-width=medium]){width:320px}.prc-Dialog-Dialog-G8cDF:where([data-width=large]){width:480px}.prc-Dialog-Dialog-G8cDF:where([data-height=small]){height:480px}.prc-Dialog-Dialog-G8cDF:where([data-height=large]){height:640px}@media screen and (prefers-reduced-motion:no-preference){.prc-Dialog-Dialog-G8cDF{animation:prc-Dialog-Overlay--motion-scaleFade-mE6-C .2s cubic-bezier(.33,1,.68,1) 1ms 1 normal none running}}.prc-Dialog-Dialog-G8cDF[data-position-regular=center]{border-radius:var(--borderRadius-large,var(--borderRadius-large,.75rem))}@media screen and (prefers-reduced-motion:no-preference){.prc-Dialog-Dialog-G8cDF[data-position-regular=center]{animation:prc-Dialog-Overlay--motion-scaleFade-mE6-C .2s cubic-bezier(.33,1,.68,1) 1ms 1 normal none running}}.prc-Dialog-Dialog-G8cDF[data-position-regular=center][data-align=top]{margin-top:var(--base-size-64,4rem)}.prc-Dialog-Dialog-G8cDF[data-position-regular=center][data-align=bottom]{margin-bottom:var(--base-size-64,4rem)}.prc-Dialog-Dialog-G8cDF[data-position-regular=left]{border-radius:var(--borderRadius-large,var(--borderRadius-large,.75rem));border-bottom-left-radius:0;border-top-left-radius:0;height:100dvh;max-height:unset}@media screen and (prefers-reduced-motion:no-preference){.prc-Dialog-Dialog-G8cDF[data-position-regular=left]{animation:prc-Dialog-Overlay--motion-slideInRight-BR-CZ .25s cubic-bezier(.33,1,.68,1) 1ms 1 normal none running}}.prc-Dialog-Dialog-G8cDF[data-position-regular=right]{border-radius:var(--borderRadius-large,var(--borderRadius-large,.75rem));border-bottom-right-radius:0;border-top-right-radius:0;height:100dvh;max-height:unset}@media screen and (prefers-reduced-motion:no-preference){.prc-Dialog-Dialog-G8cDF[data-position-regular=right]{animation:prc-Dialog-Overlay--motion-slideInLeft-ISmQZ .25s cubic-bezier(.33,1,.68,1) 0s 1 normal none running}}@media (max-width:767px){.prc-Dialog-Dialog-G8cDF[data-position-narrow=center]{border-radius:var(--borderRadius-large,var(--borderRadius-large,.75rem));height:auto;width:640px}.prc-Dialog-Dialog-G8cDF[data-position-narrow=center]:where([data-width=small]){width:296px}.prc-Dialog-Dialog-G8cDF[data-position-narrow=center]:where([data-width=medium]){width:320px}.prc-Dialog-Dialog-G8cDF[data-position-narrow=center]:where([data-width=large]){width:480px}.prc-Dialog-Dialog-G8cDF[data-position-narrow=center]:where([data-height=small]){height:480px}.prc-Dialog-Dialog-G8cDF[data-position-narrow=center]:where([data-height=large]){height:640px}@media (max-height:280px){.prc-Dialog-Dialog-G8cDF{max-height:calc(100dvh - 12px);max-width:calc(100dvw - 12px)}}.prc-Dialog-Dialog-G8cDF[data-position-narrow=bottom]{border-radius:var(--borderRadius-large,var(--borderRadius-large,.75rem));border-bottom-left-radius:0;border-bottom-right-radius:0;height:auto;max-height:calc(100dvh - 64px);max-width:100dvw;width:100dvw}.prc-Dialog-Dialog-G8cDF[data-position-narrow=bottom][data-align]{margin-bottom:0;margin-top:0}@media screen and (prefers-reduced-motion:no-preference){.prc-Dialog-Dialog-G8cDF[data-position-narrow=bottom]{animation:prc-Dialog-Overlay--motion-slideUp-tPElO .25s cubic-bezier(.33,1,.68,1) 1ms 1 normal none running}}.prc-Dialog-Dialog-G8cDF[data-position-narrow=fullscreen]{border-radius:unset!important;flex-grow:1;height:100%;max-height:100dvh;max-width:100dvw;width:100%}.prc-Dialog-Dialog-G8cDF[data-position-narrow=fullscreen][data-align]{margin-bottom:0;margin-top:0}@media screen and (prefers-reduced-motion:no-preference){.prc-Dialog-Dialog-G8cDF[data-position-narrow=fullscreen]{animation:prc-Dialog-Overlay--motion-scaleFade-mE6-C .2s cubic-bezier(.33,1,.68,1) 1ms 1 normal none running}}}body:not([data-dialog-scroll-optimized]):has(.prc-Dialog-Dialog-G8cDF.prc-Dialog-DisableScroll-UkWFM){overflow:hidden!important;padding-right:var(--prc-dialog-scrollgutter)!important}body[data-dialog-scroll-disabled]{overflow:hidden!important;padding-right:var(--prc-dialog-scrollgutter)!important}.prc-Dialog-DialogOverflowWrapper-JvHzz{flex-grow:1}.prc-Dialog-Dialog-G8cDF[data-has-footer]{--can-scroll:0}.prc-Dialog-Dialog-G8cDF[data-has-footer] .prc-Dialog-DialogOverflowWrapper-JvHzz{animation:prc-Dialog-detect-scroll-b3i8Q;border-bottom:var(--borderWidth-default,.0625rem) solid var(--borderColor-default,var(--color-border-default));animation-timeline:scroll(self)}@supports (animation-timeline:scroll(self)){.prc-Dialog-Dialog-G8cDF[data-has-footer] .prc-Dialog-DialogOverflowWrapper-JvHzz{border-bottom:calc(var(--borderWidth-thin,.0625rem)*var(--can-scroll)) solid var(--borderColor-default,var(--color-border-default))}}.prc-Dialog-Header-f7Me-{box-shadow:0 1px 0 var(--borderColor-default,var(--color-border-default));flex-shrink:0;max-height:35vh;overflow-y:auto;padding:var(--base-size-8,.5rem);z-index:1}.prc-Dialog-HeaderInner-H-fFY{display:flex}.prc-Dialog-HeaderContent-mjAsn{display:flex;flex-direction:column;flex-grow:1;padding-block:var(--base-size-6,.375rem);padding-inline:var(--base-size-8,.5rem)}.prc-Dialog-Title-M-iPn{font-size:var(--text-body-size-medium,.875rem);font-weight:var(--text-title-weight-large,600);margin:0}.prc-Dialog-Subtitle-aBFSq{color:var(--fgColor-muted,var(--color-fg-muted));font-size:var(--text-body-size-small,.75rem);font-weight:var(--base-text-weight-normal,400);margin:0;margin-top:var(--base-size-4,.25rem)}.prc-Dialog-Body-bB903{flex-grow:1;overflow:auto}.prc-Dialog-Body-bB903,.prc-Dialog-Footer-PMeQk{padding:var(--base-size-16,1rem)}.prc-Dialog-Footer-PMeQk{display:flex;flex-flow:wrap;flex-shrink:0;gap:var(--base-size-8,.5rem);justify-content:flex-end;z-index:1}.prc-Dialog-Dialog-G8cDF[data-footer-button-layout=scroll] .prc-Dialog-Footer-PMeQk{flex-direction:row;flex-wrap:nowrap;justify-content:unset;overflow-x:scroll}
|
|
2
|
+
/*# sourceMappingURL=Dialog-b577691f.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/Dialog/Dialog.module.css.js"],"names":[],"mappings":"AAOA,oCACE,eAAgB,CAChB,cAAe,CACf,iBACF,CAEA,mDACE,GACE,SACF,CAEA,GACE,SACF,CACF,CAEA,sDACE,GACE,SAAU,CACV,mBACF,CAEA,GACE,SAAU,CACV,kBACF,CACF,CAEA,oDACE,GACE,0BACF,CACF,CAEA,yDACE,GACE,2BACF,CACF,CAEA,wDACE,GACE,0BACF,CACF,CAGA,0CACE,MAEE,cACF,CACF,CAEA,2BAQE,+EAAsE,CADtE,8EAAiD,CAHjD,QAAS,CAET,YAAa,CADb,MAAO,CAJP,cAAe,CAEf,OAAQ,CADR,KAkEF,CAxDE,oFAHA,kBAAmB,CACnB,sBAKA,CAEA,uDACE,kBAAmB,CACnB,0BACF,CAEA,wDACE,kBAAmB,CACnB,wBACF,CAME,wHACE,sBACF,CAEA,2HACE,kBACF,CAEA,2HACE,oBACF,CAGF,yBACE,wDACE,kBAAmB,CACnB,sBAcF,CAXE,wEACE,sBACF,CAEA,2EACE,kBACF,CAEA,2EACE,oBACF,CAGF,wDACE,eAAgB,CAChB,sBACF,CACF,CAGF,yBASE,mEAAwC,CACxC,8CAAwC,CACxC,wEAAmE,CACnE,mEAAwC,CAXxC,YAAa,CAOb,qBAAsB,CAFtB,WAAY,CACZ,8BAA+B,CAF/B,6BAA8B,CAD9B,eAAgB,CAShB,SAAU,CAVV,WAuJF,CA3IE,mDACE,WACF,CAEA,oDACE,WACF,CAEA,mDAEE,WACF,CAEA,oDACE,YACF,CAEA,oDACE,YACF,CAEA,yDApCF,yBAqCI,4GAqHJ,CApHE,CAEA,uDACE,wEAcF,CAZE,yDAHF,uDAII,4GAWJ,CAVE,CAGA,uEACE,mCACF,CAEA,0EACE,sCACF,CAGF,qDAGE,wEAAmE,CAEnE,2BAA4B,CAD5B,wBAAyB,CAHzB,aAAc,CACd,gBAQF,CAHE,yDAPF,qDAQI,gHAEJ,CADE,CAG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,4BAAuB,CAFvB,wBAAyB,CAHzB,SAOF,CAEA,oFAGE,kBAAmB,CAFnB,gBAAiB,CAGjB,qBAAsB,CAFtB,iBAGF","file":"Dialog-b577691f.css","sourcesContent":["/* The --prc-dialog-scrollgutter property is used only on the body element to\n * simulate scrollbar-gutter:stable. This property is not and should not\n * be used elsewhere in the DOM. There is a performance penalty to\n * setting inherited properties which can cause a large style recalc to\n * occur, so it benefits us to prevent inheritance for this property.\n * See https://web.dev/blog/at-property-performance\n */\n@property --prc-dialog-scrollgutter {\n initial-value: 0;\n inherits: false;\n syntax: '<length>';\n}\n\n@keyframes dialog-backdrop-appear {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n@keyframes Overlay--motion-scaleFade {\n 0% {\n opacity: 0;\n transform: scale(0.5);\n }\n\n 100% {\n opacity: 1;\n transform: scale(1);\n }\n}\n\n@keyframes Overlay--motion-slideUp {\n from {\n transform: translateY(100%);\n }\n}\n\n@keyframes Overlay--motion-slideInRight {\n from {\n transform: translateX(-100%);\n }\n}\n\n@keyframes Overlay--motion-slideInLeft {\n from {\n transform: translateX(100%);\n }\n}\n\n/* Used to determine whether there should be a border between the body and footer */\n@keyframes detect-scroll {\n from,\n to {\n --can-scroll: 1;\n }\n}\n\n.Backdrop {\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n display: flex;\n background-color: var(--overlay-backdrop-bgColor);\n animation: dialog-backdrop-appear 200ms cubic-bezier(0.33, 1, 0.68, 1);\n align-items: center;\n justify-content: center;\n\n &[data-position-regular='center'] {\n align-items: center;\n justify-content: center;\n }\n\n &[data-position-regular='left'] {\n align-items: center;\n justify-content: flex-start;\n }\n\n &[data-position-regular='right'] {\n align-items: center;\n justify-content: flex-end;\n }\n\n /* align only applies when regular position is center (or absent).\n * :where() zeroes out the :not() specificity so narrow-position rules (coming later)\n * always win when data-position-narrow is bottom or fullscreen. */\n &:where(:not([data-position-regular='left']):not([data-position-regular='right'])) {\n &[data-align='top'] {\n align-items: flex-start;\n }\n\n &[data-align='center'] {\n align-items: center;\n }\n\n &[data-align='bottom'] {\n align-items: flex-end;\n }\n }\n\n @media (max-width: 767px) {\n &[data-position-narrow='center'] {\n align-items: center;\n justify-content: center;\n\n /* align still applies when narrow position is center */\n &[data-align='top'] {\n align-items: flex-start;\n }\n\n &[data-align='center'] {\n align-items: center;\n }\n\n &[data-align='bottom'] {\n align-items: flex-end;\n }\n }\n\n &[data-position-narrow='bottom'] {\n align-items: end;\n justify-content: center;\n }\n }\n}\n\n.Dialog {\n display: flex;\n /* stylelint-disable-next-line primer/responsive-widths */\n width: 640px;\n min-width: 296px;\n max-width: calc(100dvw - 64px);\n height: auto;\n max-height: calc(100dvh - 64px);\n flex-direction: column;\n background-color: var(--overlay-bgColor);\n border-radius: var(--borderRadius-large);\n border-radius: var(--borderRadius-large, var(--borderRadius-large));\n box-shadow: var(--shadow-floating-small);\n opacity: 1;\n\n &:where([data-width='small']) {\n width: 296px;\n }\n\n &:where([data-width='medium']) {\n width: 320px;\n }\n\n &:where([data-width='large']) {\n /* stylelint-disable-next-line primer/responsive-widths */\n width: 480px;\n }\n\n &:where([data-height='small']) {\n height: 480px;\n }\n\n &:where([data-height='large']) {\n height: 640px;\n }\n\n @media screen and (prefers-reduced-motion: no-preference) {\n animation: Overlay--motion-scaleFade 0.2s cubic-bezier(0.33, 1, 0.68, 1) 1ms 1 normal none running;\n }\n\n &[data-position-regular='center'] {\n border-radius: var(--borderRadius-large, var(--borderRadius-large));\n\n @media screen and (prefers-reduced-motion: no-preference) {\n animation: Overlay--motion-scaleFade 0.2s cubic-bezier(0.33, 1, 0.68, 1) 1ms 1 normal none running;\n }\n\n /* align margins only apply when regular position is center */\n &[data-align='top'] {\n margin-top: var(--base-size-64);\n }\n\n &[data-align='bottom'] {\n margin-bottom: var(--base-size-64);\n }\n }\n\n &[data-position-regular='left'] {\n height: 100dvh;\n max-height: unset;\n border-radius: var(--borderRadius-large, var(--borderRadius-large));\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n\n @media screen and (prefers-reduced-motion: no-preference) {\n animation: Overlay--motion-slideInRight 0.25s cubic-bezier(0.33, 1, 0.68, 1) 1ms 1 normal none running;\n }\n }\n\n &[data-position-regular='right'] {\n height: 100dvh;\n max-height: unset;\n border-radius: var(--borderRadius-large, var(--borderRadius-large));\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n\n @media screen and (prefers-reduced-motion: no-preference) {\n animation: Overlay--motion-slideInLeft 0.25s cubic-bezier(0.33, 1, 0.68, 1) 0s 1 normal none running;\n }\n }\n\n @media (max-width: 767px) {\n &[data-position-narrow='center'] {\n /* stylelint-disable-next-line primer/responsive-widths */\n width: 640px;\n height: auto;\n border-radius: var(--borderRadius-large, var(--borderRadius-large));\n\n &:where([data-width='small']) {\n width: 296px;\n }\n\n &:where([data-width='medium']) {\n width: 320px;\n }\n\n &:where([data-width='large']) {\n /* stylelint-disable-next-line primer/responsive-widths */\n width: 480px;\n }\n\n &:where([data-height='small']) {\n height: 480px;\n }\n\n &:where([data-height='large']) {\n height: 640px;\n }\n }\n\n @media (max-height: 280px) {\n max-height: calc(100dvh - 12px);\n max-width: calc(100dvw - 12px);\n }\n\n &[data-position-narrow='bottom'] {\n width: 100dvw;\n max-width: 100dvw;\n height: auto;\n max-height: calc(100dvh - 64px);\n border-radius: var(--borderRadius-large, var(--borderRadius-large));\n border-bottom-right-radius: 0;\n border-bottom-left-radius: 0;\n\n /* reset align margins since position wins at narrow */\n &[data-align] {\n margin-top: 0;\n margin-bottom: 0;\n }\n\n @media screen and (prefers-reduced-motion: no-preference) {\n animation: Overlay--motion-slideUp 0.25s cubic-bezier(0.33, 1, 0.68, 1) 1ms 1 normal none running;\n }\n }\n\n &[data-position-narrow='fullscreen'] {\n width: 100%;\n max-width: 100dvw;\n height: 100%;\n max-height: 100dvh;\n border-radius: unset !important;\n flex-grow: 1;\n\n /* reset align margins since fullscreen wins at narrow */\n &[data-align] {\n margin-top: 0;\n margin-bottom: 0;\n }\n\n @media screen and (prefers-reduced-motion: no-preference) {\n animation: Overlay--motion-scaleFade 0.2s cubic-bezier(0.33, 1, 0.68, 1) 1ms 1 normal none running;\n }\n }\n }\n}\n\n/* DisableScroll class is added to Dialog when scroll should be disabled on body */\n.DisableScroll {\n /* This class is used as a selector target for the legacy :has() CSS selector */\n}\n\n/*\n * LEGACY: Scoped :has() selector with negation guard\n * Only evaluates when data-dialog-scroll-optimized is NOT present on body.\n * When the attribute IS present (flag ON), browser skips :has() evaluation\n * because the :not() check fails first (O(1) attribute lookup).\n */\n/* stylelint-disable-next-line selector-no-qualifying-type */\nbody:not([data-dialog-scroll-optimized]):has(.Dialog.DisableScroll) {\n /* stylelint-disable-next-line primer/spacing */\n padding-right: var(--prc-dialog-scrollgutter) !important;\n overflow: hidden !important;\n}\n\n/*\n * PERFORMANCE OPTIMIZATION: Direct attribute on body - O(1) lookup\n * Active when primer_react_css_has_selector_perf flag is ON\n */\n/* stylelint-disable-next-line selector-no-qualifying-type */\nbody[data-dialog-scroll-disabled] {\n /* stylelint-disable-next-line primer/spacing */\n padding-right: var(--prc-dialog-scrollgutter) !important;\n overflow: hidden !important;\n}\n\n.DialogOverflowWrapper {\n flex-grow: 1;\n}\n\n/*\nAdd a border between the body and footer if:\n- the dialog has a footer\n- the dialog has a body that can scroll\n- the browser supports the `animation-timeline` property and its `scroll()` function\n*/\n.Dialog[data-has-footer] {\n --can-scroll: 0;\n\n .DialogOverflowWrapper {\n /* If the browser does not support the `animation-timeline` property, always show a border */\n border-bottom: var(--borderWidth-default) solid var(--borderColor-default);\n animation: detect-scroll;\n animation-timeline: scroll(self);\n\n @supports (animation-timeline: scroll(self)) {\n border-bottom: calc(var(--borderWidth-thin) * var(--can-scroll)) solid var(--borderColor-default);\n }\n }\n}\n\n.Header {\n z-index: 1;\n max-height: 35vh;\n padding: var(--base-size-8);\n overflow-y: auto;\n /* stylelint-disable-next-line primer/box-shadow */\n box-shadow: 0 1px 0 var(--borderColor-default);\n flex-shrink: 0;\n}\n\n.HeaderInner {\n display: flex;\n}\n\n.HeaderContent {\n display: flex;\n padding-inline: var(--base-size-8);\n padding-block: var(--base-size-6);\n flex-direction: column;\n flex-grow: 1;\n}\n\n.Title {\n margin: 0; /* override default margin */\n font-size: var(--text-body-size-medium);\n font-weight: var(--text-title-weight-large);\n}\n\n.Subtitle {\n margin: 0; /* override default margin */\n margin-top: var(--base-size-4);\n font-size: var(--text-body-size-small);\n font-weight: var(--base-text-weight-normal);\n color: var(--fgColor-muted);\n}\n\n.Body {\n padding: var(--base-size-16);\n overflow: auto;\n flex-grow: 1;\n}\n\n.Footer {\n z-index: 1;\n display: flex;\n flex-flow: wrap;\n justify-content: flex-end;\n padding: var(--base-size-16);\n gap: var(--base-size-8);\n flex-shrink: 0;\n}\n\n.Dialog[data-footer-button-layout='scroll'] .Footer {\n flex-wrap: nowrap;\n overflow-x: scroll;\n flex-direction: row;\n justify-content: unset;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../src/Dialog/Dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsE,MAAM,OAAO,CAAA;AAC1F,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,WAAW,CAAA;AAW1C,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,6BAA6B,CAAA;AAChE,OAAO,KAAK,EAAC,mBAAmB,IAAI,8BAA8B,EAAC,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../src/Dialog/Dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsE,MAAM,OAAO,CAAA;AAC1F,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,WAAW,CAAA;AAW1C,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,6BAA6B,CAAA;AAChE,OAAO,KAAK,EAAC,mBAAmB,IAAI,8BAA8B,EAAC,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E,YAAY,CAAA;IAErB;;OAEG;IACH,QAAQ,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,eAAe,CAAC,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,YAAY,GAAG,QAAQ,CAAC,CAAA;IAE/G;;;;;OAKG;IACH,KAAK,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAA;IAEnC;;;OAGG;IACH,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAA;IAEpD;;OAEG;IACH,eAAe,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAA;IAErD;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,iBAAkB,SAAQ,WAAW;IACpD;;;OAGG;IACH,aAAa,EAAE,MAAM,CAAA;IAErB;;;OAGG;IACH,mBAAmB,EAAE,MAAM,CAAA;CAC5B;AAGD,QAAA,MAAM,SAAS;;;;CAIL,CAAA;AAGV,QAAA,MAAM,QAAQ;;;;;CAKJ,CAAA;AAEV,MAAM,MAAM,WAAW,GAAG,MAAM,OAAO,QAAQ,CAAA;AAC/C,MAAM,MAAM,YAAY,GAAG,MAAM,OAAO,SAAS,CAAA;AAiDjD,eAAO,MAAM,aAAa,mCAAqD,CAAA;AAyR/E,eAAO,MAAM,MAAM;;;;;;;;;;iBAhEuC,iBAAiB,EAAE;;;iBAkCf,MAAM,IAAI;;CAuCtE,CAAA"}
|
package/dist/Dialog/Dialog.js
CHANGED
|
@@ -11,10 +11,11 @@ import { useId } from '../hooks/useId.js';
|
|
|
11
11
|
import classes from './Dialog.module.css.js';
|
|
12
12
|
import { clsx } from 'clsx';
|
|
13
13
|
import { useSlots } from '../hooks/useSlots.js';
|
|
14
|
+
import { useResizeObserver } from '../hooks/useResizeObserver.js';
|
|
14
15
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
15
16
|
import { useOnEscapePress } from '../hooks/useOnEscapePress.js';
|
|
16
17
|
import { ScrollableRegion } from '../ScrollableRegion/ScrollableRegion.js';
|
|
17
|
-
import {
|
|
18
|
+
import { useProvidedRefOrCreate } from '../hooks/useProvidedRefOrCreate.js';
|
|
18
19
|
|
|
19
20
|
const DefaultHeader = ({
|
|
20
21
|
dialogLabelId,
|
|
@@ -74,6 +75,8 @@ const defaultPosition = {
|
|
|
74
75
|
regular: 'center'
|
|
75
76
|
};
|
|
76
77
|
const defaultFooterButtons = [];
|
|
78
|
+
// Minimum room needed for body content before forcing footer buttons into horizontal scroll.
|
|
79
|
+
const MIN_BODY_HEIGHT = 48;
|
|
77
80
|
|
|
78
81
|
// useful to determine whether we're inside a Dialog from a nested component
|
|
79
82
|
const DialogContext = /*#__PURE__*/React.createContext(undefined);
|
|
@@ -108,6 +111,7 @@ const _Dialog = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
|
|
|
108
111
|
}
|
|
109
112
|
}
|
|
110
113
|
const [lastMouseDownIsBackdrop, setLastMouseDownIsBackdrop] = useState(false);
|
|
114
|
+
const [footerButtonLayout, setFooterButtonLayout] = useState('wrap');
|
|
111
115
|
const defaultedProps = {
|
|
112
116
|
...props,
|
|
113
117
|
title,
|
|
@@ -170,6 +174,29 @@ const _Dialog = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
|
|
|
170
174
|
children: childrenWithoutSlots
|
|
171
175
|
});
|
|
172
176
|
const footer = (_slots$footer = slots.footer) !== null && _slots$footer !== void 0 ? _slots$footer : (renderFooter !== null && renderFooter !== void 0 ? renderFooter : DefaultFooter)(defaultedProps);
|
|
177
|
+
const hasFooter = footer != null;
|
|
178
|
+
const updateFooterButtonLayout = useCallback(() => {
|
|
179
|
+
if (!hasFooter) {
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
const dialogElement = dialogRef.current;
|
|
183
|
+
if (!(dialogElement instanceof HTMLElement)) {
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
const bodyWrapper = dialogElement.querySelector(`.${classes.DialogOverflowWrapper}`);
|
|
187
|
+
if (!(bodyWrapper instanceof HTMLElement)) {
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
// We temporarily force "wrap" the footer layout so that the browser can calculate the body height -
|
|
192
|
+
// when the footer is wrapping. This is instantaneous with what we set below (`dialogElement.setAttribute('data-footer-button-layout', newLayout)`).
|
|
193
|
+
dialogElement.setAttribute('data-footer-button-layout', 'wrap');
|
|
194
|
+
const bodyHeight = bodyWrapper.clientHeight;
|
|
195
|
+
const newLayout = bodyHeight >= MIN_BODY_HEIGHT ? 'wrap' : 'scroll';
|
|
196
|
+
dialogElement.setAttribute('data-footer-button-layout', newLayout);
|
|
197
|
+
setFooterButtonLayout(newLayout);
|
|
198
|
+
}, [hasFooter]);
|
|
199
|
+
useResizeObserver(updateFooterButtonLayout, backdropRef);
|
|
173
200
|
const positionDataAttributes = typeof position === 'string' ? {
|
|
174
201
|
'data-position-regular': position
|
|
175
202
|
} : Object.fromEntries(Object.entries(position).map(([key, value]) => {
|
|
@@ -201,7 +228,8 @@ const _Dialog = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
|
|
|
201
228
|
}),
|
|
202
229
|
"data-width": width,
|
|
203
230
|
"data-height": height,
|
|
204
|
-
"data-has-footer":
|
|
231
|
+
"data-has-footer": hasFooter ? '' : undefined,
|
|
232
|
+
"data-footer-button-layout": hasFooter ? footerButtonLayout : undefined,
|
|
205
233
|
className: clsx(className, classes.Dialog),
|
|
206
234
|
style: style,
|
|
207
235
|
children: [header, /*#__PURE__*/jsx(ScrollableRegion, {
|
|
@@ -274,8 +302,7 @@ const Buttons = ({
|
|
|
274
302
|
buttons
|
|
275
303
|
}) => {
|
|
276
304
|
var _buttons$find;
|
|
277
|
-
const autoFocusRef =
|
|
278
|
-
const mergedRef = useMergedRefs(autoFocusRef, (_buttons$find = buttons.find(button => button.autoFocus)) === null || _buttons$find === void 0 ? void 0 : _buttons$find.ref);
|
|
305
|
+
const autoFocusRef = useProvidedRefOrCreate((_buttons$find = buttons.find(button => button.autoFocus)) === null || _buttons$find === void 0 ? void 0 : _buttons$find.ref);
|
|
279
306
|
let autoFocusCount = 0;
|
|
280
307
|
const [hasRendered, setHasRendered] = useState(0);
|
|
281
308
|
useEffect(() => {
|
|
@@ -298,8 +325,10 @@ const Buttons = ({
|
|
|
298
325
|
return /*#__PURE__*/jsx(ButtonComponent, {
|
|
299
326
|
...buttonProps,
|
|
300
327
|
// 'normal' value is equivalent to 'default', this is used for backwards compatibility
|
|
301
|
-
variant: buttonType === 'normal' ? 'default' : buttonType
|
|
302
|
-
|
|
328
|
+
variant: buttonType === 'normal' ? 'default' : buttonType
|
|
329
|
+
// @ts-expect-error it needs a non nullable ref
|
|
330
|
+
,
|
|
331
|
+
ref: autoFocus && autoFocusCount === 0 ? (autoFocusCount++, autoFocusRef) : null,
|
|
303
332
|
children: content
|
|
304
333
|
}, index);
|
|
305
334
|
})
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import './Dialog-
|
|
1
|
+
import './Dialog-b577691f.css';
|
|
2
2
|
|
|
3
3
|
var classes = {"Backdrop":"prc-Dialog-Backdrop-5Nt2U","dialog-backdrop-appear":"prc-Dialog-dialog-backdrop-appear-tCG2K","Dialog":"prc-Dialog-Dialog-G8cDF","Overlay--motion-scaleFade":"prc-Dialog-Overlay--motion-scaleFade-mE6-C","Overlay--motion-slideInRight":"prc-Dialog-Overlay--motion-slideInRight-BR-CZ","Overlay--motion-slideInLeft":"prc-Dialog-Overlay--motion-slideInLeft-ISmQZ","Overlay--motion-slideUp":"prc-Dialog-Overlay--motion-slideUp-tPElO","DisableScroll":"prc-Dialog-DisableScroll-UkWFM","DialogOverflowWrapper":"prc-Dialog-DialogOverflowWrapper-JvHzz","detect-scroll":"prc-Dialog-detect-scroll-b3i8Q","Header":"prc-Dialog-Header-f7Me-","HeaderInner":"prc-Dialog-HeaderInner-H-fFY","HeaderContent":"prc-Dialog-HeaderContent-mjAsn","Title":"prc-Dialog-Title-M-iPn","Subtitle":"prc-Dialog-Subtitle-aBFSq","Body":"prc-Dialog-Body-bB903","Footer":"prc-Dialog-Footer-PMeQk"};
|
|
4
4
|
|
|
@@ -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;AAEhD,OAAO,EAAa,KAAK,eAAe,EAAC,MAAM,eAAe,CAAA;AAC9D,OAAO,KAAK,EAAC,gBAAgB,EAAE,aAAa,EAA0B,MAAM,IAAI,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;AAEhD,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;AAY9E,MAAM,WAAW,uBAAwB,SAAQ,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,MAAM,aAAa,CAAC,CAAC,EAAE,aAAa;IAClH,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,WAA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,EAC5C,wBAAwB,EAAE,WAAW,GAAG,SAAS,EACjD,iBAAiB,EAAE,OAAO,KACvB,IAAI,CAAA;IACT;;;;;;;;;;;;;;;;;;OAkBG;IACH,uBAAuB,CAAC,EAAE,iBAAiB,GAAG,mBAAmB,CAAA;IACjE;;OAEG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB;;;OAGG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAA;IAChC;;;;OAIG;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,CA8avC;yBA7ce,kBAAkB"}
|
|
@@ -4,6 +4,7 @@ import { useCallback, useRef, useState, useEffect, useMemo, forwardRef } from 'r
|
|
|
4
4
|
import { ActionList } from '../ActionList/index.js';
|
|
5
5
|
import { useFocusZone } from '../hooks/useFocusZone.js';
|
|
6
6
|
import { useId } from '../hooks/useId.js';
|
|
7
|
+
import { useProvidedRefOrCreate } from '../hooks/useProvidedRefOrCreate.js';
|
|
7
8
|
import { useProvidedStateOrCreate } from '../hooks/useProvidedStateOrCreate.js';
|
|
8
9
|
import useScrollFlash from '../hooks/useScrollFlash.js';
|
|
9
10
|
import { FilteredActionListLoadingTypes, FilteredActionListBodyLoader } from './FilteredActionListLoaders.js';
|
|
@@ -14,7 +15,6 @@ import { useAnnouncements } from './useAnnouncements.js';
|
|
|
14
15
|
import { clsx } from 'clsx';
|
|
15
16
|
import { useVirtualizer } from '@tanstack/react-virtual';
|
|
16
17
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
17
|
-
import { useMergedRefs } from '../hooks/useMergedRefs.js';
|
|
18
18
|
import TextInput from '../TextInput/TextInput.js';
|
|
19
19
|
import { VisuallyHidden } from '../VisuallyHidden/VisuallyHidden.js';
|
|
20
20
|
import Checkbox from '../Checkbox/Checkbox.js';
|
|
@@ -73,10 +73,8 @@ function FilteredActionList({
|
|
|
73
73
|
}, [onFilterChange, setInternalFilterValue]);
|
|
74
74
|
const inputAndListContainerRef = useRef(null);
|
|
75
75
|
const listRef = useRef(null);
|
|
76
|
-
const scrollContainerRef =
|
|
77
|
-
const
|
|
78
|
-
const inputRef = useRef(null);
|
|
79
|
-
const combinedInputRef = useMergedRefs(inputRef, providedInputRef);
|
|
76
|
+
const scrollContainerRef = useProvidedRefOrCreate(providedScrollContainerRef);
|
|
77
|
+
const inputRef = useProvidedRefOrCreate(providedInputRef);
|
|
80
78
|
const usingRovingTabindex = _PrivateFocusManagement === 'roving-tabindex';
|
|
81
79
|
const [listContainerElement, setListContainerElement] = useState(null);
|
|
82
80
|
const activeDescendantRef = useRef();
|
|
@@ -389,8 +387,10 @@ function FilteredActionList({
|
|
|
389
387
|
"data-testid": "filtered-action-list",
|
|
390
388
|
children: [/*#__PURE__*/jsx("div", {
|
|
391
389
|
className: classes.Header,
|
|
392
|
-
children: /*#__PURE__*/jsx(TextInput
|
|
393
|
-
|
|
390
|
+
children: /*#__PURE__*/jsx(TextInput
|
|
391
|
+
// @ts-expect-error it needs a non nullable ref
|
|
392
|
+
, {
|
|
393
|
+
ref: inputRef,
|
|
394
394
|
block: true,
|
|
395
395
|
width: "auto",
|
|
396
396
|
color: "fg.default",
|
|
@@ -429,7 +429,7 @@ function FilteredActionList({
|
|
|
429
429
|
children: selectAllLabelText
|
|
430
430
|
})]
|
|
431
431
|
}), /*#__PURE__*/jsx("div", {
|
|
432
|
-
ref:
|
|
432
|
+
ref: scrollContainerRef,
|
|
433
433
|
className: classes.Container,
|
|
434
434
|
children: getBodyContent()
|
|
435
435
|
})]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageHeader.d.ts","sourceRoot":"","sources":["../../src/PageHeader/PageHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"PageHeader.d.ts","sourceRoot":"","sources":["../../src/PageHeader/PageHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAA;AACtC,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,6BAA6B,CAAA;AAIhE,OAAO,KAAK,EAAC,SAAS,IAAI,aAAa,EAAC,MAAM,SAAS,CAAA;AAIvD,OAAO,KAAK,EAAC,mBAAmB,IAAI,8BAA8B,EAAC,MAAM,sBAAsB,CAAA;AAI/F,OAAO,KAAK,EAAC,QAAQ,EAAE,gBAAgB,EAAC,MAAM,gBAAgB,CAAA;AAO9D,MAAM,MAAM,iBAAiB,GAAG;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,MAAM,CAAC,EAAE,OAAO,GAAG,eAAe,CAAC,OAAO,CAAC,CAAA;CAC5C,CAAA;AAkBD,MAAM,MAAM,eAAe,GAAG;IAC5B,YAAY,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,YAAY,CAAC,CAAA;IACjD,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,GAAG,QAAQ,GAAG,KAAK,CAAA;IACzC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,CAAC,EAAE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from 'react-compiler-runtime';
|
|
2
|
-
import React, {
|
|
2
|
+
import React, { useEffect } from 'react';
|
|
3
3
|
import { isResponsiveValue } from '../hooks/useResponsiveValue.js';
|
|
4
4
|
import { ArrowLeftIcon } from '@primer/octicons-react';
|
|
5
5
|
import { getResponsiveAttributes } from '../internal/utils/getResponsiveAttributes.js';
|
|
@@ -9,7 +9,7 @@ import { clsx } from 'clsx';
|
|
|
9
9
|
import classes from './PageHeader.module.css.js';
|
|
10
10
|
import { isSlot } from '../utils/is-slot.js';
|
|
11
11
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
12
|
-
import {
|
|
12
|
+
import { useProvidedRefOrCreate } from '../hooks/useProvidedRefOrCreate.js';
|
|
13
13
|
import Heading from '../Heading/Heading.js';
|
|
14
14
|
import Link from '../Link/Link.js';
|
|
15
15
|
|
|
@@ -31,7 +31,7 @@ const hiddenOnNarrow = {
|
|
|
31
31
|
// -----------------------------------------------------------------------------
|
|
32
32
|
|
|
33
33
|
const Root = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
|
|
34
|
-
const $ = c(
|
|
34
|
+
const $ = c(14);
|
|
35
35
|
const {
|
|
36
36
|
children,
|
|
37
37
|
className,
|
|
@@ -41,12 +41,11 @@ const Root = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
|
|
|
41
41
|
hasBorder
|
|
42
42
|
} = t0;
|
|
43
43
|
const BaseComponent = t1 === undefined ? "div" : t1;
|
|
44
|
-
const rootRef =
|
|
45
|
-
const mergedRef = useMergedRefs(rootRef, forwardedRef);
|
|
44
|
+
const rootRef = useProvidedRefOrCreate(forwardedRef);
|
|
46
45
|
const isInteractive = _temp;
|
|
47
46
|
let t2;
|
|
48
47
|
let t3;
|
|
49
|
-
if ($[0] !== children) {
|
|
48
|
+
if ($[0] !== children || $[1] !== rootRef) {
|
|
50
49
|
t2 = function validateInteractiveElementsInTitle() {
|
|
51
50
|
if (!(process.env.NODE_ENV !== "production")) {
|
|
52
51
|
return;
|
|
@@ -73,42 +72,43 @@ const Root = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
|
|
|
73
72
|
};
|
|
74
73
|
t3 = [children, rootRef];
|
|
75
74
|
$[0] = children;
|
|
76
|
-
$[1] =
|
|
77
|
-
$[2] =
|
|
75
|
+
$[1] = rootRef;
|
|
76
|
+
$[2] = t2;
|
|
77
|
+
$[3] = t3;
|
|
78
78
|
} else {
|
|
79
|
-
t2 = $[
|
|
80
|
-
t3 = $[
|
|
79
|
+
t2 = $[2];
|
|
80
|
+
t3 = $[3];
|
|
81
81
|
}
|
|
82
82
|
useEffect(t2, t3);
|
|
83
83
|
let t4;
|
|
84
|
-
if ($[
|
|
84
|
+
if ($[4] !== className) {
|
|
85
85
|
t4 = clsx(classes.PageHeader, className);
|
|
86
|
-
$[
|
|
87
|
-
$[
|
|
86
|
+
$[4] = className;
|
|
87
|
+
$[5] = t4;
|
|
88
88
|
} else {
|
|
89
|
-
t4 = $[
|
|
89
|
+
t4 = $[5];
|
|
90
90
|
}
|
|
91
91
|
const t5 = hasBorder ? "true" : undefined;
|
|
92
92
|
let t6;
|
|
93
|
-
if ($[
|
|
93
|
+
if ($[6] !== BaseComponent || $[7] !== ariaLabel || $[8] !== children || $[9] !== role || $[10] !== rootRef || $[11] !== t4 || $[12] !== t5) {
|
|
94
94
|
t6 = /*#__PURE__*/jsx(BaseComponent, {
|
|
95
|
-
ref:
|
|
95
|
+
ref: rootRef,
|
|
96
96
|
className: t4,
|
|
97
97
|
"data-has-border": t5,
|
|
98
98
|
"aria-label": ariaLabel,
|
|
99
99
|
role: role,
|
|
100
100
|
children: children
|
|
101
101
|
});
|
|
102
|
-
$[
|
|
103
|
-
$[
|
|
104
|
-
$[
|
|
105
|
-
$[8] = mergedRef;
|
|
102
|
+
$[6] = BaseComponent;
|
|
103
|
+
$[7] = ariaLabel;
|
|
104
|
+
$[8] = children;
|
|
106
105
|
$[9] = role;
|
|
107
|
-
$[10] =
|
|
108
|
-
$[11] =
|
|
109
|
-
$[12] =
|
|
106
|
+
$[10] = rootRef;
|
|
107
|
+
$[11] = t4;
|
|
108
|
+
$[12] = t5;
|
|
109
|
+
$[13] = t6;
|
|
110
110
|
} else {
|
|
111
|
-
t6 = $[
|
|
111
|
+
t6 = $[13];
|
|
112
112
|
}
|
|
113
113
|
return t6;
|
|
114
114
|
});
|
|
@@ -334,6 +334,7 @@ const TitleArea = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
|
|
|
334
334
|
} = t0;
|
|
335
335
|
const hidden = t1 === undefined ? false : t1;
|
|
336
336
|
const variant = t2 === undefined ? "medium" : t2;
|
|
337
|
+
const titleAreaRef = useProvidedRefOrCreate(forwardedRef);
|
|
337
338
|
let t3;
|
|
338
339
|
if ($[0] !== className) {
|
|
339
340
|
t3 = clsx(classes.TitleArea, className);
|
|
@@ -359,20 +360,20 @@ const TitleArea = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
|
|
|
359
360
|
t5 = $[5];
|
|
360
361
|
}
|
|
361
362
|
let t6;
|
|
362
|
-
if ($[6] !== children || $[7] !==
|
|
363
|
+
if ($[6] !== children || $[7] !== t3 || $[8] !== t4 || $[9] !== t5 || $[10] !== titleAreaRef) {
|
|
363
364
|
t6 = /*#__PURE__*/jsx("div", {
|
|
364
365
|
className: t3,
|
|
365
|
-
ref:
|
|
366
|
+
ref: titleAreaRef,
|
|
366
367
|
"data-component": "TitleArea",
|
|
367
368
|
...t4,
|
|
368
369
|
...t5,
|
|
369
370
|
children: children
|
|
370
371
|
});
|
|
371
372
|
$[6] = children;
|
|
372
|
-
$[7] =
|
|
373
|
-
$[8] =
|
|
374
|
-
$[9] =
|
|
375
|
-
$[10] =
|
|
373
|
+
$[7] = t3;
|
|
374
|
+
$[8] = t4;
|
|
375
|
+
$[9] = t5;
|
|
376
|
+
$[10] = titleAreaRef;
|
|
376
377
|
$[11] = t6;
|
|
377
378
|
} else {
|
|
378
379
|
t6 = $[11];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextInput.d.ts","sourceRoot":"","sources":["../../src/TextInput/TextInput.tsx"],"names":[],"mappings":"AACA,OAAO,KAAwD,MAAM,OAAO,CAAA;AAE5E,OAAO,KAAK,EAAC,mBAAmB,IAAI,8BAA8B,EAAC,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"TextInput.d.ts","sourceRoot":"","sources":["../../src/TextInput/TextInput.tsx"],"names":[],"mappings":"AACA,OAAO,KAAwD,MAAM,OAAO,CAAA;AAE5E,OAAO,KAAK,EAAC,mBAAmB,IAAI,8BAA8B,EAAC,MAAM,sBAAsB,CAAA;AAO/F,OAAO,KAAK,EAAC,KAAK,EAAC,MAAM,gBAAgB,CAAA;AACzC,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,yCAAyC,CAAA;AAQ/E,MAAM,MAAM,4BAA4B,GAAG;IACzC,uEAAuE;IACvE,IAAI,CAAC,EAAE,KAAK,CAAC,WAAW,CAAA;IACxB,2DAA2D;IAC3D,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB;;;;;QAKI;IACJ,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,UAAU,CAAA;IAChD,0DAA0D;IAC1D,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;;OAEG;IACH,aAAa,CAAC,EAAE,KAAK,CAAC,WAAW,GAAG,KAAK,CAAC,SAAS,CAAA;IACnD;;OAEG;IACH,cAAc,CAAC,EAAE,KAAK,CAAC,WAAW,GAAG,KAAK,CAAC,SAAS,CAAA;IACpD;;OAEG;IACH,cAAc,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC,CAAA;IACvE;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB,GAAG,OAAO,CACT,IAAI,CACF,kBAAkB,EAChB,OAAO,GACP,UAAU,GACV,UAAU,GACV,WAAW,GACX,OAAO,GACP,UAAU,GACV,UAAU,GACV,SAAS,GACT,MAAM,GACN,kBAAkB,CACrB,CACF,CAAA;AAED,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,KAAK,CAAC,wBAAwB,CAAC,OAAO,CAAC,EAAE,4BAA4B,CAAC,CAAA;;;;;;;;;;;AA+PzG,wBAGE"}
|
|
@@ -10,7 +10,7 @@ import UnstyledTextInput from '../internal/components/UnstyledTextInput.js';
|
|
|
10
10
|
import VisuallyHidden from '../_VisuallyHidden.js';
|
|
11
11
|
import { CharacterCounter } from '../utils/character-counter.js';
|
|
12
12
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
13
|
-
import {
|
|
13
|
+
import { useProvidedRefOrCreate } from '../hooks/useProvidedRefOrCreate.js';
|
|
14
14
|
import Text from '../Text/Text.js';
|
|
15
15
|
|
|
16
16
|
// using forwardRef is important so that other components can autofocus the input
|
|
@@ -46,8 +46,7 @@ const TextInput = /*#__PURE__*/React.forwardRef(({
|
|
|
46
46
|
...inputProps
|
|
47
47
|
}, ref) => {
|
|
48
48
|
const [isInputFocused, setIsInputFocused] = useState(false);
|
|
49
|
-
const inputRef =
|
|
50
|
-
const mergedRef = useMergedRefs(inputRef, ref);
|
|
49
|
+
const inputRef = useProvidedRefOrCreate(ref);
|
|
51
50
|
const [characterCount, setCharacterCount] = useState('');
|
|
52
51
|
const [isOverLimit, setIsOverLimit] = useState(false);
|
|
53
52
|
const [screenReaderMessage, setScreenReaderMessage] = useState('');
|
|
@@ -171,8 +170,10 @@ const TextInput = /*#__PURE__*/React.forwardRef(({
|
|
|
171
170
|
hasLoadingIndicator: typeof loading === 'boolean',
|
|
172
171
|
id: leadingVisualId,
|
|
173
172
|
children: typeof LeadingVisual !== 'string' && isValidElementType(LeadingVisual) ? /*#__PURE__*/jsx(LeadingVisual, {}) : LeadingVisual
|
|
174
|
-
}), /*#__PURE__*/jsx(UnstyledTextInput
|
|
175
|
-
|
|
173
|
+
}), /*#__PURE__*/jsx(UnstyledTextInput
|
|
174
|
+
// @ts-expect-error it needs a non nullable ref
|
|
175
|
+
, {
|
|
176
|
+
ref: inputRef,
|
|
176
177
|
disabled: disabled,
|
|
177
178
|
onFocus: handleInputFocus,
|
|
178
179
|
onBlur: handleInputBlur,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../src/TooltipV2/Tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../src/TooltipV2/Tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAiD,KAAK,yBAAyB,EAAC,MAAM,OAAO,CAAA;AAS3G,OAAO,EAAoD,KAAK,mBAAmB,EAAC,MAAM,mBAAmB,CAAA;AAG7G,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,gBAAgB,CAAA;AAE9C,MAAM,MAAM,gBAAgB,GAAG,IAAI,GAAG,GAAG,GAAG,IAAI,GAAG,GAAG,GAAG,IAAI,GAAG,GAAG,GAAG,IAAI,GAAG,GAAG,CAAA;AAChF,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC,iBAAiB,CAAC;IACjD,SAAS,CAAC,EAAE,gBAAgB,CAAA;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,OAAO,GAAG,aAAa,CAAA;IAC9B,cAAc,CAAC,EAAE,mBAAmB,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,CAAA;IACjF;;;;;OAKG;IACH,KAAK,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAA;IACnC;;;;;;;;OAQG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAA;CACjC,CAAC,GACA,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,CAAA;AAiEnC,eAAO,MAAM,cAAc;gBAAoC,MAAM;EAAM,CAAA;AAI3E,eAAO,MAAM,OAAO,EAAE,yBAAyB,CAC7C,KAAK,CAAC,eAAe,CAAC,YAAY,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,WAAW,CAAC,CACvE,GACC,UAiSD,CAAA"}
|
|
@@ -9,7 +9,7 @@ import VisuallyHidden from '../_VisuallyHidden.js';
|
|
|
9
9
|
import useSafeTimeout from '../hooks/useSafeTimeout.js';
|
|
10
10
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
11
11
|
import { useId } from '../hooks/useId.js';
|
|
12
|
-
import {
|
|
12
|
+
import { useProvidedRefOrCreate } from '../hooks/useProvidedRefOrCreate.js';
|
|
13
13
|
import { useOnEscapePress } from '../hooks/useOnEscapePress.js';
|
|
14
14
|
import { useIsMacOS } from '../hooks/useIsMacOS.js';
|
|
15
15
|
import { getAccessibleKeybindingHintString, KeybindingHint } from '../KeybindingHint/KeybindingHint.js';
|
|
@@ -91,8 +91,7 @@ const Tooltip = /*#__PURE__*/React.forwardRef(({
|
|
|
91
91
|
}, forwardedRef) => {
|
|
92
92
|
const tooltipId = useId(id);
|
|
93
93
|
const child = Children.only(children);
|
|
94
|
-
const triggerRef =
|
|
95
|
-
const mergedTriggerRef = useMergedRefs(triggerRef, forwardedRef);
|
|
94
|
+
const triggerRef = useProvidedRefOrCreate(forwardedRef);
|
|
96
95
|
const tooltipElRef = useRef(null);
|
|
97
96
|
const [calculatedDirection, setCalculatedDirection] = useState(direction);
|
|
98
97
|
const [isPopoverOpen, setIsPopoverOpen] = useState(false);
|
|
@@ -208,7 +207,8 @@ const Tooltip = /*#__PURE__*/React.forwardRef(({
|
|
|
208
207
|
/*#__PURE__*/
|
|
209
208
|
// eslint-disable-next-line react-hooks/refs
|
|
210
209
|
React.cloneElement(child, {
|
|
211
|
-
ref
|
|
210
|
+
// @ts-expect-error it needs a non nullable ref
|
|
211
|
+
ref: triggerRef,
|
|
212
212
|
// If it is a type description, we use tooltip to describe the trigger
|
|
213
213
|
'aria-describedby': (() => {
|
|
214
214
|
// If tooltip is not a description type, keep the original aria-describedby
|
|
@@ -66,7 +66,7 @@ declare function useTabList<T extends HTMLElement>(props: TabListProps & {
|
|
|
66
66
|
'aria-orientation': AriaAttributes['aria-orientation'];
|
|
67
67
|
'aria-label': AriaAttributes['aria-label'];
|
|
68
68
|
'aria-labelledby': AriaAttributes['aria-labelledby'];
|
|
69
|
-
ref: React.
|
|
69
|
+
ref: React.RefObject<T | null>;
|
|
70
70
|
role: 'tablist';
|
|
71
71
|
};
|
|
72
72
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.d.ts","sourceRoot":"","sources":["../../../src/experimental/Tabs/Tabs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"Tabs.d.ts","sourceRoot":"","sources":["../../../src/experimental/Tabs/Tabs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAKZ,KAAK,cAAc,EAEnB,KAAK,iBAAiB,EACvB,MAAM,OAAO,CAAA;AAKd;;GAEG;AACH,KAAK,mBAAmB,GAAG;IACzB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;IAEb;;;OAGG;IACH,YAAY,CAAC,EAAE,KAAK,CAAA;IAEpB;;OAEG;IACH,aAAa,EAAE,CAAC,EAAC,KAAK,EAAC,EAAE;QAAC,KAAK,EAAE,MAAM,CAAA;KAAC,KAAK,IAAI,CAAA;CAClD,CAAA;AAED;;GAEG;AACH,KAAK,qBAAqB,GAAG;IAC3B;;OAEG;IACH,YAAY,EAAE,MAAM,CAAA;IAEpB;;;OAGG;IACH,KAAK,CAAC,EAAE,KAAK,CAAA;IAEb;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,EAAC,KAAK,EAAC,EAAE;QAAC,KAAK,EAAE,MAAM,CAAA;KAAC,KAAK,IAAI,CAAA;CACnD,CAAA;AAED,KAAK,SAAS,GAAG,iBAAiB,CAAC,mBAAmB,GA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
3
3
|
import useIsomorphicLayoutEffect from '../../utils/useIsomorphicLayoutEffect.js';
|
|
4
4
|
import { useControllableState } from '../../hooks/useControllableState.js';
|
|
5
5
|
import { jsx } from 'react/jsx-runtime';
|
|
6
|
-
import {
|
|
6
|
+
import { useProvidedRefOrCreate } from '../../hooks/useProvidedRefOrCreate.js';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* The Tabs component provides the base structure for a tabbed interface, without providing any formal requirement on DOM structure or styling.
|
|
@@ -87,16 +87,15 @@ function Tabs(props) {
|
|
|
87
87
|
return t5;
|
|
88
88
|
}
|
|
89
89
|
function useTabList(props) {
|
|
90
|
-
const $ = c(
|
|
90
|
+
const $ = c(9);
|
|
91
91
|
const {
|
|
92
92
|
"aria-label": ariaLabel,
|
|
93
93
|
"aria-labelledby": ariaLabelledby,
|
|
94
94
|
"aria-orientation": ariaOrientation
|
|
95
95
|
} = props;
|
|
96
|
-
const ref =
|
|
97
|
-
const mergedRef = useMergedRefs(ref, props.ref);
|
|
96
|
+
const ref = useProvidedRefOrCreate(props.ref);
|
|
98
97
|
let t0;
|
|
99
|
-
if ($[0] !== ariaOrientation) {
|
|
98
|
+
if ($[0] !== ariaOrientation || $[1] !== ref) {
|
|
100
99
|
t0 = event => {
|
|
101
100
|
const {
|
|
102
101
|
current: tablist
|
|
@@ -143,17 +142,18 @@ function useTabList(props) {
|
|
|
143
142
|
}
|
|
144
143
|
};
|
|
145
144
|
$[0] = ariaOrientation;
|
|
146
|
-
$[1] =
|
|
145
|
+
$[1] = ref;
|
|
146
|
+
$[2] = t0;
|
|
147
147
|
} else {
|
|
148
|
-
t0 = $[
|
|
148
|
+
t0 = $[2];
|
|
149
149
|
}
|
|
150
150
|
const onKeyDown = t0;
|
|
151
151
|
const t1 = ariaOrientation !== null && ariaOrientation !== void 0 ? ariaOrientation : "horizontal";
|
|
152
152
|
let t2;
|
|
153
|
-
if ($[
|
|
153
|
+
if ($[3] !== ariaLabel || $[4] !== ariaLabelledby || $[5] !== onKeyDown || $[6] !== ref || $[7] !== t1) {
|
|
154
154
|
t2 = {
|
|
155
155
|
tabListProps: {
|
|
156
|
-
ref
|
|
156
|
+
ref,
|
|
157
157
|
"aria-label": ariaLabel,
|
|
158
158
|
"aria-labelledby": ariaLabelledby,
|
|
159
159
|
"aria-orientation": t1,
|
|
@@ -161,14 +161,14 @@ function useTabList(props) {
|
|
|
161
161
|
onKeyDown
|
|
162
162
|
}
|
|
163
163
|
};
|
|
164
|
-
$[
|
|
165
|
-
$[
|
|
166
|
-
$[4] = mergedRef;
|
|
164
|
+
$[3] = ariaLabel;
|
|
165
|
+
$[4] = ariaLabelledby;
|
|
167
166
|
$[5] = onKeyDown;
|
|
168
|
-
$[6] =
|
|
169
|
-
$[7] =
|
|
167
|
+
$[6] = ref;
|
|
168
|
+
$[7] = t1;
|
|
169
|
+
$[8] = t2;
|
|
170
170
|
} else {
|
|
171
|
-
t2 = $[
|
|
171
|
+
t2 = $[8];
|
|
172
172
|
}
|
|
173
173
|
return t2;
|
|
174
174
|
}
|
|
@@ -15,21 +15,21 @@ 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 combinedRef = useMergedRefs(forwardedRef, ref)
|
|
19
19
|
*
|
|
20
|
-
* return <button ref={
|
|
20
|
+
* return <button ref={combinedRef} />
|
|
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 combinedRef = useMergedRefs(externalRef, ref)
|
|
28
28
|
*
|
|
29
|
-
* return <button ref={
|
|
29
|
+
* return <button ref={combinedRef} />
|
|
30
30
|
* }
|
|
31
31
|
*/
|
|
32
|
-
export declare function useMergedRefs<T>(refA: Ref<T | null>, refB: Ref<T | null>): (value: T | null) => (
|
|
32
|
+
export declare function useMergedRefs<T>(refA: Ref<T | null>, refB: Ref<T | null>): (value: T | null) => () => void;
|
|
33
33
|
type CleanupFunction = () => void;
|
|
34
34
|
/**
|
|
35
35
|
* React 19 supports callback refs that can return a cleanup function. If a cleanup function is returned, the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMergedRefs.d.ts","sourceRoot":"","sources":["../../src/hooks/useMergedRefs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,YAAY,EAAE,GAAG,IAAI,WAAW,EAAmB,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"useMergedRefs.d.ts","sourceRoot":"","sources":["../../src/hooks/useMergedRefs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,YAAY,EAAE,GAAG,IAAI,WAAW,EAAmB,MAAM,OAAO,CAAA;AAG7E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,WAE7D,CAAC,GAAG,IAAI,gBAiBnB;AAED,KAAK,eAAe,GAAG,MAAM,IAAI,CAAA;AAEjC;;;GAGG;AAEH,KAAK,kBAAkB,CAAC,CAAC,IAAI;IAC3B,cAAc,CAAC,QAAQ,EAAE,CAAC,GAAG,IAAI,GAAG,eAAe,CAAA;CACpD,CAAC,gBAAgB,CAAC,CAAA;AAEnB;;;;;;;GAOG;AACH,KAAK,GAAG,CAAC,CAAC,IAAI,YAAY,CAAC,CAAC,CAAC,GAAG,kBAAkB,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,GAAG,SAAS,CAAA"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { c } from 'react-compiler-runtime';
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
var _version$split$;
|
|
5
|
-
const majorReactVersion = parseInt((_version$split$ = version.split('.')[0]) !== null && _version$split$ !== void 0 ? _version$split$ : '18', 10);
|
|
2
|
+
import 'react';
|
|
6
3
|
|
|
7
4
|
/**
|
|
8
5
|
* Combine two refs of matching type (typically an external or forwarded ref and an internal `useRef` object or
|
|
@@ -20,18 +17,18 @@ const majorReactVersion = parseInt((_version$split$ = version.split('.')[0]) !==
|
|
|
20
17
|
* // React 18
|
|
21
18
|
* const Example = forwardRef<HTMLButtonElement, {}>((props, forwardedRef) => {
|
|
22
19
|
* const ref = useRef<HTMLButtonElement>(null)
|
|
23
|
-
* const
|
|
20
|
+
* const combinedRef = useMergedRefs(forwardedRef, ref)
|
|
24
21
|
*
|
|
25
|
-
* return <button ref={
|
|
22
|
+
* return <button ref={combinedRef} />
|
|
26
23
|
* })
|
|
27
24
|
*
|
|
28
25
|
* @example
|
|
29
26
|
* // React 19
|
|
30
27
|
* const Example = ({ref: externalRef}: {ref?: Ref<HTMLButtonElement>}) => {
|
|
31
28
|
* const ref = useRef<HTMLButtonElement>(null)
|
|
32
|
-
* const
|
|
29
|
+
* const combinedRef = useMergedRefs(externalRef, ref)
|
|
33
30
|
*
|
|
34
|
-
* return <button ref={
|
|
31
|
+
* return <button ref={combinedRef} />
|
|
35
32
|
* }
|
|
36
33
|
*/
|
|
37
34
|
function useMergedRefs(refA, refB) {
|
|
@@ -41,9 +38,6 @@ function useMergedRefs(refA, refB) {
|
|
|
41
38
|
t0 = value => {
|
|
42
39
|
const cleanupA = setRef(refA, value);
|
|
43
40
|
const cleanupB = setRef(refB, value);
|
|
44
|
-
if (majorReactVersion <= 18) {
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
41
|
return () => {
|
|
48
42
|
if (cleanupA) {
|
|
49
43
|
cleanupA();
|
|
@@ -7,14 +7,17 @@ import React from 'react';
|
|
|
7
7
|
* @param providedRef The ref to use - if undefined, will use the ref from a call to React.useRef
|
|
8
8
|
* @type TRef The type of the RefObject which should be created.
|
|
9
9
|
*
|
|
10
|
-
* @
|
|
11
|
-
*
|
|
12
|
-
* {@linkcode useMergedRefs} instead.
|
|
10
|
+
* @deprecated This hook is incompatible with forwarded callback refs. Prefer `useMergedRefs` with an internally
|
|
11
|
+
* created ref instead.
|
|
13
12
|
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
13
|
+
* ```diff
|
|
14
|
+
* - const ref = useProvidedRefOrCreate(forwardedRef as RefObject<...>)
|
|
15
|
+
* + const ref = useRef(null)
|
|
16
|
+
* + const mergedRef = useMergedRefs(forwardedRef, ref)
|
|
17
|
+
*
|
|
18
|
+
* - return <div ref={ref} />
|
|
19
|
+
* + return <div ref={mergedRef} />
|
|
20
|
+
* ```
|
|
18
21
|
*/
|
|
19
22
|
export declare function useProvidedRefOrCreate<TRef>(providedRef?: React.RefObject<TRef | null>): React.RefObject<TRef | null>;
|
|
20
23
|
//# sourceMappingURL=useProvidedRefOrCreate.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useProvidedRefOrCreate.d.ts","sourceRoot":"","sources":["../../src/hooks/useProvidedRefOrCreate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"useProvidedRefOrCreate.d.ts","sourceRoot":"","sources":["../../src/hooks/useProvidedRefOrCreate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,KAAK,CAAC,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC,CAGrH"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
// used in doc comment
|
|
4
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
5
|
-
|
|
6
3
|
/**
|
|
7
4
|
* There are some situations where we only want to create a new ref if one is not provided to a component
|
|
8
5
|
* or hook as a prop. However, due to the `rules-of-hooks`, we cannot conditionally make a call to `React.useRef`
|
|
@@ -11,14 +8,17 @@ import React from 'react';
|
|
|
11
8
|
* @param providedRef The ref to use - if undefined, will use the ref from a call to React.useRef
|
|
12
9
|
* @type TRef The type of the RefObject which should be created.
|
|
13
10
|
*
|
|
14
|
-
* @
|
|
15
|
-
*
|
|
16
|
-
*
|
|
11
|
+
* @deprecated This hook is incompatible with forwarded callback refs. Prefer `useMergedRefs` with an internally
|
|
12
|
+
* created ref instead.
|
|
13
|
+
*
|
|
14
|
+
* ```diff
|
|
15
|
+
* - const ref = useProvidedRefOrCreate(forwardedRef as RefObject<...>)
|
|
16
|
+
* + const ref = useRef(null)
|
|
17
|
+
* + const mergedRef = useMergedRefs(forwardedRef, ref)
|
|
17
18
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* internal element.
|
|
19
|
+
* - return <div ref={ref} />
|
|
20
|
+
* + return <div ref={mergedRef} />
|
|
21
|
+
* ```
|
|
22
22
|
*/
|
|
23
23
|
function useProvidedRefOrCreate(providedRef) {
|
|
24
24
|
const createdRef = React.useRef(null);
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/Dialog/Dialog.module.css.js"],"names":[],"mappings":"AAOA,oCACE,eAAgB,CAChB,cAAe,CACf,iBACF,CAEA,mDACE,GACE,SACF,CAEA,GACE,SACF,CACF,CAEA,sDACE,GACE,SAAU,CACV,mBACF,CAEA,GACE,SAAU,CACV,kBACF,CACF,CAEA,oDACE,GACE,0BACF,CACF,CAEA,yDACE,GACE,2BAC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A+B,CAC/B,6BA0CN,CAzCI,CAEA,sDAKE,wEAAmE,CAEnE,2BAA4B,CAD5B,4BAA6B,CAH7B,WAAY,CACZ,8BAA+B,CAF/B,gBAAiB,CADjB,YAiBF,CARE,kEAEE,eAAgB,CADhB,YAEF,CAEA,yDAfF,sDAgBI,2GAEJ,CADE,CAGF,0DAKE,6BAA+B,CAC/B,WAAY,CAHZ,WAAY,CACZ,iBAAkB,CAFlB,gBAAiB,CADjB,UAgBF,CARE,sEAEE,eAAgB,CADhB,YAEF,CAEA,yDAdF,0DAeI,4GAEJ,CADE,CAEJ,CAeF,sGAGE,yBAA2B,CAD3B,sDAEF,CAOA,kCAGE,yBAA2B,CAD3B,sDAEF,CAEA,wCACE,WACF,CAQA,0CACE,cAYF,CAVE,kFAGE,wCAAwB,CADxB,8GAA0E,CAE1E,+BAKF,CAHE,4CANF,kFAOI,mIAEJ,CADE,CAIJ,yBAME,yEAA8C,CAC9C,aAAc,CALd,eAAgB,CAEhB,eAAgB,CADhB,gCAA2B,CAF3B,SAOF,CAEA,8BACE,YACF,CAEA,gCACE,YAAa,CAGb,qBAAsB,CACtB,WAAY,CAFZ,wCAAiC,CADjC,uCAIF,CAEA,wBAEE,8CAAuC,CACvC,8CAA2C,CAF3C,QAGF,CAEA,2BAKE,gDAA2B,CAF3B,4CAAsC,CACtC,8CAA2C,CAH3C,QAAS,CACT,oCAIF,CAEA,uBAGE,WAAY,CADZ,aAEF,CAEA,gDALE,gCAoBF,CAfA,yBAEE,YAAa,CACb,cAAe,CAIf,aAAc,CADd,4BAAuB,CAFvB,wBAAyB,CAHzB,SAcF,CANE,0BATF,yBAYI,kBAAmB,CAFnB,gBAAiB,CAGjB,qBAAsB,CAFtB,iBAIJ,CADE","file":"Dialog-2de477b3.css","sourcesContent":["/* The --prc-dialog-scrollgutter property is used only on the body element to\n * simulate scrollbar-gutter:stable. This property is not and should not\n * be used elsewhere in the DOM. There is a performance penalty to\n * setting inherited properties which can cause a large style recalc to\n * occur, so it benefits us to prevent inheritance for this property.\n * See https://web.dev/blog/at-property-performance\n */\n@property --prc-dialog-scrollgutter {\n initial-value: 0;\n inherits: false;\n syntax: '<length>';\n}\n\n@keyframes dialog-backdrop-appear {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n@keyframes Overlay--motion-scaleFade {\n 0% {\n opacity: 0;\n transform: scale(0.5);\n }\n\n 100% {\n opacity: 1;\n transform: scale(1);\n }\n}\n\n@keyframes Overlay--motion-slideUp {\n from {\n transform: translateY(100%);\n }\n}\n\n@keyframes Overlay--motion-slideInRight {\n from {\n transform: translateX(-100%);\n }\n}\n\n@keyframes Overlay--motion-slideInLeft {\n from {\n transform: translateX(100%);\n }\n}\n\n/* Used to determine whether there should be a border between the body and footer */\n@keyframes detect-scroll {\n from,\n to {\n --can-scroll: 1;\n }\n}\n\n.Backdrop {\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n display: flex;\n background-color: var(--overlay-backdrop-bgColor);\n animation: dialog-backdrop-appear 200ms cubic-bezier(0.33, 1, 0.68, 1);\n align-items: center;\n justify-content: center;\n\n &[data-position-regular='center'] {\n align-items: center;\n justify-content: center;\n }\n\n &[data-position-regular='left'] {\n align-items: center;\n justify-content: flex-start;\n }\n\n &[data-position-regular='right'] {\n align-items: center;\n justify-content: flex-end;\n }\n\n /* align only applies when regular position is center (or absent).\n * :where() zeroes out the :not() specificity so narrow-position rules (coming later)\n * always win when data-position-narrow is bottom or fullscreen. */\n &:where(:not([data-position-regular='left']):not([data-position-regular='right'])) {\n &[data-align='top'] {\n align-items: flex-start;\n }\n\n &[data-align='center'] {\n align-items: center;\n }\n\n &[data-align='bottom'] {\n align-items: flex-end;\n }\n }\n\n @media (max-width: 767px) {\n &[data-position-narrow='center'] {\n align-items: center;\n justify-content: center;\n\n /* align still applies when narrow position is center */\n &[data-align='top'] {\n align-items: flex-start;\n }\n\n &[data-align='center'] {\n align-items: center;\n }\n\n &[data-align='bottom'] {\n align-items: flex-end;\n }\n }\n\n &[data-position-narrow='bottom'] {\n align-items: end;\n justify-content: center;\n }\n }\n}\n\n.Dialog {\n display: flex;\n /* stylelint-disable-next-line primer/responsive-widths */\n width: 640px;\n min-width: 296px;\n max-width: calc(100dvw - 64px);\n height: auto;\n max-height: calc(100dvh - 64px);\n flex-direction: column;\n background-color: var(--overlay-bgColor);\n border-radius: var(--borderRadius-large);\n border-radius: var(--borderRadius-large, var(--borderRadius-large));\n box-shadow: var(--shadow-floating-small);\n opacity: 1;\n\n &:where([data-width='small']) {\n width: 296px;\n }\n\n &:where([data-width='medium']) {\n width: 320px;\n }\n\n &:where([data-width='large']) {\n /* stylelint-disable-next-line primer/responsive-widths */\n width: 480px;\n }\n\n &:where([data-height='small']) {\n height: 480px;\n }\n\n &:where([data-height='large']) {\n height: 640px;\n }\n\n @media screen and (prefers-reduced-motion: no-preference) {\n animation: Overlay--motion-scaleFade 0.2s cubic-bezier(0.33, 1, 0.68, 1) 1ms 1 normal none running;\n }\n\n &[data-position-regular='center'] {\n border-radius: var(--borderRadius-large, var(--borderRadius-large));\n\n @media screen and (prefers-reduced-motion: no-preference) {\n animation: Overlay--motion-scaleFade 0.2s cubic-bezier(0.33, 1, 0.68, 1) 1ms 1 normal none running;\n }\n\n /* align margins only apply when regular position is center */\n &[data-align='top'] {\n margin-top: var(--base-size-64);\n }\n\n &[data-align='bottom'] {\n margin-bottom: var(--base-size-64);\n }\n }\n\n &[data-position-regular='left'] {\n height: 100dvh;\n max-height: unset;\n border-radius: var(--borderRadius-large, var(--borderRadius-large));\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n\n @media screen and (prefers-reduced-motion: no-preference) {\n animation: Overlay--motion-slideInRight 0.25s cubic-bezier(0.33, 1, 0.68, 1) 1ms 1 normal none running;\n }\n }\n\n &[data-position-regular='right'] {\n height: 100dvh;\n max-height: unset;\n border-radius: var(--borderRadius-large, var(--borderRadius-large));\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n\n @media screen and (prefers-reduced-motion: no-preference) {\n animation: Overlay--motion-slideInLeft 0.25s cubic-bezier(0.33, 1, 0.68, 1) 0s 1 normal none running;\n }\n }\n\n @media (max-width: 767px) {\n &[data-position-narrow='center'] {\n /* stylelint-disable-next-line primer/responsive-widths */\n width: 640px;\n height: auto;\n border-radius: var(--borderRadius-large, var(--borderRadius-large));\n\n &:where([data-width='small']) {\n width: 296px;\n }\n\n &:where([data-width='medium']) {\n width: 320px;\n }\n\n &:where([data-width='large']) {\n /* stylelint-disable-next-line primer/responsive-widths */\n width: 480px;\n }\n\n &:where([data-height='small']) {\n height: 480px;\n }\n\n &:where([data-height='large']) {\n height: 640px;\n }\n }\n\n @media (max-height: 280px) {\n max-height: calc(100dvh - 12px);\n max-width: calc(100dvw - 12px);\n }\n\n &[data-position-narrow='bottom'] {\n width: 100dvw;\n max-width: 100dvw;\n height: auto;\n max-height: calc(100dvh - 64px);\n border-radius: var(--borderRadius-large, var(--borderRadius-large));\n border-bottom-right-radius: 0;\n border-bottom-left-radius: 0;\n\n /* reset align margins since position wins at narrow */\n &[data-align] {\n margin-top: 0;\n margin-bottom: 0;\n }\n\n @media screen and (prefers-reduced-motion: no-preference) {\n animation: Overlay--motion-slideUp 0.25s cubic-bezier(0.33, 1, 0.68, 1) 1ms 1 normal none running;\n }\n }\n\n &[data-position-narrow='fullscreen'] {\n width: 100%;\n max-width: 100dvw;\n height: 100%;\n max-height: 100dvh;\n border-radius: unset !important;\n flex-grow: 1;\n\n /* reset align margins since fullscreen wins at narrow */\n &[data-align] {\n margin-top: 0;\n margin-bottom: 0;\n }\n\n @media screen and (prefers-reduced-motion: no-preference) {\n animation: Overlay--motion-scaleFade 0.2s cubic-bezier(0.33, 1, 0.68, 1) 1ms 1 normal none running;\n }\n }\n }\n}\n\n/* DisableScroll class is added to Dialog when scroll should be disabled on body */\n.DisableScroll {\n /* This class is used as a selector target for the legacy :has() CSS selector */\n}\n\n/*\n * LEGACY: Scoped :has() selector with negation guard\n * Only evaluates when data-dialog-scroll-optimized is NOT present on body.\n * When the attribute IS present (flag ON), browser skips :has() evaluation\n * because the :not() check fails first (O(1) attribute lookup).\n */\n/* stylelint-disable-next-line selector-no-qualifying-type */\nbody:not([data-dialog-scroll-optimized]):has(.Dialog.DisableScroll) {\n /* stylelint-disable-next-line primer/spacing */\n padding-right: var(--prc-dialog-scrollgutter) !important;\n overflow: hidden !important;\n}\n\n/*\n * PERFORMANCE OPTIMIZATION: Direct attribute on body - O(1) lookup\n * Active when primer_react_css_has_selector_perf flag is ON\n */\n/* stylelint-disable-next-line selector-no-qualifying-type */\nbody[data-dialog-scroll-disabled] {\n /* stylelint-disable-next-line primer/spacing */\n padding-right: var(--prc-dialog-scrollgutter) !important;\n overflow: hidden !important;\n}\n\n.DialogOverflowWrapper {\n flex-grow: 1;\n}\n\n/*\nAdd a border between the body and footer if:\n- the dialog has a footer\n- the dialog has a body that can scroll\n- the browser supports the `animation-timeline` property and its `scroll()` function\n*/\n.Dialog[data-has-footer] {\n --can-scroll: 0;\n\n .DialogOverflowWrapper {\n /* If the browser does not support the `animation-timeline` property, always show a border */\n border-bottom: var(--borderWidth-default) solid var(--borderColor-default);\n animation: detect-scroll;\n animation-timeline: scroll(self);\n\n @supports (animation-timeline: scroll(self)) {\n border-bottom: calc(var(--borderWidth-thin) * var(--can-scroll)) solid var(--borderColor-default);\n }\n }\n}\n\n.Header {\n z-index: 1;\n max-height: 35vh;\n padding: var(--base-size-8);\n overflow-y: auto;\n /* stylelint-disable-next-line primer/box-shadow */\n box-shadow: 0 1px 0 var(--borderColor-default);\n flex-shrink: 0;\n}\n\n.HeaderInner {\n display: flex;\n}\n\n.HeaderContent {\n display: flex;\n padding-inline: var(--base-size-8);\n padding-block: var(--base-size-6);\n flex-direction: column;\n flex-grow: 1;\n}\n\n.Title {\n margin: 0; /* override default margin */\n font-size: var(--text-body-size-medium);\n font-weight: var(--text-title-weight-large);\n}\n\n.Subtitle {\n margin: 0; /* override default margin */\n margin-top: var(--base-size-4);\n font-size: var(--text-body-size-small);\n font-weight: var(--base-text-weight-normal);\n color: var(--fgColor-muted);\n}\n\n.Body {\n padding: var(--base-size-16);\n overflow: auto;\n flex-grow: 1;\n}\n\n.Footer {\n z-index: 1;\n display: flex;\n flex-flow: wrap;\n justify-content: flex-end;\n padding: var(--base-size-16);\n gap: var(--base-size-8);\n flex-shrink: 0;\n\n @media (max-height: 325px) {\n flex-wrap: nowrap;\n overflow-x: scroll;\n flex-direction: row;\n justify-content: unset;\n }\n}\n"]}
|