@primer/react 38.24.0-rc.ff9ea71b3 → 38.25.0-rc.89740d738
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 +24 -0
- package/dist/ActionBar/ActionBar-e63def3c.css +2 -0
- package/dist/ActionBar/ActionBar-e63def3c.css.map +1 -0
- package/dist/ActionBar/ActionBar.d.ts +1 -1
- package/dist/ActionBar/ActionBar.d.ts.map +1 -1
- package/dist/ActionBar/ActionBar.js +298 -384
- package/dist/ActionBar/ActionBar.module.css.js +2 -2
- package/dist/ActionBar/index.d.ts +1 -1
- package/dist/ActionList/Heading.js +17 -16
- package/dist/Autocomplete/AutocompleteInput.js +3 -3
- package/dist/Autocomplete/AutocompleteOverlay.js +3 -3
- package/dist/Blankslate/Blankslate.d.ts.map +1 -1
- package/dist/Blankslate/Blankslate.js +6 -0
- package/dist/BranchName/BranchName.js +1 -0
- package/dist/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
- package/dist/Breadcrumbs/Breadcrumbs.js +3 -0
- package/dist/Button/ButtonBase.js +3 -3
- package/dist/ButtonGroup/ButtonGroup.d.ts.map +1 -1
- package/dist/ButtonGroup/ButtonGroup.js +1 -0
- package/dist/Card/{Card-cec366f8.css → Card-d8a02dd9.css} +2 -2
- package/dist/Card/{Card-cec366f8.css.map → Card-d8a02dd9.css.map} +1 -1
- package/dist/Card/Card.d.ts +75 -39
- package/dist/Card/Card.d.ts.map +1 -1
- package/dist/Card/Card.js +260 -160
- package/dist/Card/Card.module.css.js +2 -2
- package/dist/Card/index.d.ts +16 -16
- package/dist/Card/index.d.ts.map +1 -1
- package/dist/Card/index.js +2 -2
- package/dist/Checkbox/Checkbox.d.ts +1 -0
- package/dist/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/Checkbox/Checkbox.js +10 -5
- package/dist/CheckboxGroup/CheckboxGroup.js +1 -0
- package/dist/CircleBadge/CircleBadge.d.ts.map +1 -1
- package/dist/CircleBadge/CircleBadge.js +44 -28
- package/dist/ConfirmationDialog/ConfirmationDialog.d.ts.map +1 -1
- package/dist/ConfirmationDialog/ConfirmationDialog.js +1 -0
- package/dist/CounterLabel/CounterLabel.d.ts +2 -0
- package/dist/CounterLabel/CounterLabel.d.ts.map +1 -1
- package/dist/CounterLabel/CounterLabel.js +25 -90
- package/dist/DataTable/useTable.d.ts.map +1 -1
- package/dist/DataTable/useTable.js +8 -3
- package/dist/Details/Details.d.ts +6 -2
- package/dist/Details/Details.d.ts.map +1 -1
- package/dist/Details/Details.js +31 -22
- package/dist/Dialog/Dialog-b7da369a.css +2 -0
- package/dist/Dialog/Dialog-b7da369a.css.map +1 -0
- package/dist/Dialog/Dialog.d.ts +5 -2
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +34 -11
- package/dist/Dialog/Dialog.module.css.js +1 -1
- package/dist/Flash/Flash.d.ts.map +1 -1
- package/dist/Flash/Flash.js +2 -1
- package/dist/FormControl/FormControl.d.ts.map +1 -1
- package/dist/FormControl/FormControl.js +2 -0
- package/dist/FormControl/FormControlCaption.d.ts.map +1 -1
- package/dist/FormControl/FormControlCaption.js +1 -0
- package/dist/FormControl/FormControlLabel.d.ts.map +1 -1
- package/dist/FormControl/FormControlLabel.js +1 -0
- package/dist/FormControl/FormControlLeadingVisual.d.ts.map +1 -1
- package/dist/FormControl/FormControlLeadingVisual.js +1 -0
- package/dist/FormControl/_FormControlValidation.d.ts.map +1 -1
- package/dist/FormControl/_FormControlValidation.js +1 -0
- package/dist/Header/Header.d.ts.map +1 -1
- package/dist/Header/Header.js +3 -0
- package/dist/Heading/Heading.d.ts.map +1 -1
- package/dist/Heading/Heading.js +4 -3
- package/dist/Hidden/Hidden.d.ts.map +1 -1
- package/dist/Hidden/Hidden.js +1 -0
- package/dist/InlineMessage/InlineMessage.d.ts.map +1 -1
- package/dist/InlineMessage/InlineMessage.js +1 -0
- package/dist/KeybindingHint/KeybindingHint.d.ts.map +1 -1
- package/dist/KeybindingHint/KeybindingHint.js +1 -0
- package/dist/Label/Label.d.ts.map +1 -1
- package/dist/Label/Label.js +2 -1
- package/dist/LabelGroup/LabelGroup.d.ts.map +1 -1
- package/dist/LabelGroup/LabelGroup.js +4 -1
- package/dist/Link/Link.js +3 -3
- package/dist/Overlay/Overlay.d.ts.map +1 -1
- package/dist/Overlay/Overlay.js +20 -19
- package/dist/PageLayout/PageLayout.js +5 -5
- package/dist/PageLayout/usePaneWidth.d.ts.map +1 -1
- package/dist/PageLayout/usePaneWidth.js +12 -6
- package/dist/TextInputWithTokens/TextInputWithTokens.js +91 -90
- package/dist/Timeline/{Timeline-ad31a7fb.css → Timeline-05decc91.css} +2 -2
- package/dist/Timeline/Timeline-05decc91.css.map +1 -0
- package/dist/Timeline/Timeline.module.css.js +1 -1
- package/dist/deprecated/DialogV1/Dialog.js +10 -9
- package/dist/experimental/index.d.ts +1 -1
- package/dist/experimental/index.d.ts.map +1 -1
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroup.d.ts +1 -0
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroup.d.ts.map +1 -1
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroup.js +5 -2
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupCaption.d.ts.map +1 -1
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupCaption.js +3 -1
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupContext.d.ts +1 -0
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupContext.d.ts.map +1 -1
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupLabel.d.ts.map +1 -1
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupLabel.js +3 -1
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupValidation.d.ts.map +1 -1
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupValidation.js +3 -1
- package/dist/internal/components/InputValidation.d.ts +2 -1
- package/dist/internal/components/InputValidation.d.ts.map +1 -1
- package/dist/internal/components/InputValidation.js +64 -33
- package/generated/components.json +59 -10
- package/package.json +1 -1
- package/dist/ActionBar/ActionBar-a41224b2.css +0 -2
- package/dist/ActionBar/ActionBar-a41224b2.css.map +0 -1
- package/dist/Dialog/Dialog-f9bb927a.css +0 -2
- package/dist/Dialog/Dialog-f9bb927a.css.map +0 -1
- package/dist/Timeline/Timeline-ad31a7fb.css.map +0 -1
package/dist/Card/Card.js
CHANGED
|
@@ -1,43 +1,39 @@
|
|
|
1
1
|
import { c } from 'react-compiler-runtime';
|
|
2
2
|
import { clsx } from 'clsx';
|
|
3
|
-
import React, { forwardRef } from 'react';
|
|
3
|
+
import React, { forwardRef, useContext, createContext } from 'react';
|
|
4
4
|
import classes from './Card.module.css.js';
|
|
5
|
-
import {
|
|
5
|
+
import { fixedForwardRef } from '../utils/modern-polymorphic.js';
|
|
6
|
+
import { useId } from '../hooks/useId.js';
|
|
7
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
6
8
|
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
$[4] = t1;
|
|
27
|
-
$[5] = t2;
|
|
28
|
-
} else {
|
|
29
|
-
children = $[1];
|
|
30
|
-
className = $[2];
|
|
31
|
-
rest = $[3];
|
|
32
|
-
t1 = $[4];
|
|
33
|
-
t2 = $[5];
|
|
9
|
+
const CardContext = /*#__PURE__*/createContext({});
|
|
10
|
+
function CardComponent(props, ref) {
|
|
11
|
+
const $ = c(67);
|
|
12
|
+
const {
|
|
13
|
+
children,
|
|
14
|
+
className,
|
|
15
|
+
padding: t0,
|
|
16
|
+
borderRadius: t1,
|
|
17
|
+
as: t2,
|
|
18
|
+
...rest
|
|
19
|
+
} = props;
|
|
20
|
+
const padding = t0 === undefined ? "normal" : t0;
|
|
21
|
+
const borderRadius = t1 === undefined ? "large" : t1;
|
|
22
|
+
const as = t2 === undefined ? "div" : t2;
|
|
23
|
+
const Component = as;
|
|
24
|
+
const generatedId = useId();
|
|
25
|
+
const titleId = as === "section" ? generatedId : undefined;
|
|
26
|
+
if (as === "section" && !("aria-label" in props) && !("aria-labelledby" in props)) {
|
|
27
|
+
rest["aria-labelledby"] = titleId;
|
|
34
28
|
}
|
|
35
|
-
|
|
36
|
-
|
|
29
|
+
let T0;
|
|
30
|
+
let T1;
|
|
37
31
|
let description;
|
|
38
32
|
let heading;
|
|
39
33
|
let menu;
|
|
40
34
|
let metadata;
|
|
35
|
+
let t10;
|
|
36
|
+
let t11;
|
|
41
37
|
let t3;
|
|
42
38
|
let t4;
|
|
43
39
|
let t5;
|
|
@@ -45,8 +41,8 @@ const CardImpl = /*#__PURE__*/forwardRef(function Card(t0, ref) {
|
|
|
45
41
|
let t7;
|
|
46
42
|
let t8;
|
|
47
43
|
let t9;
|
|
48
|
-
if ($[
|
|
49
|
-
|
|
44
|
+
if ($[0] !== Component || $[1] !== borderRadius || $[2] !== children || $[3] !== className || $[4] !== padding || $[5] !== ref || $[6] !== rest || $[7] !== titleId) {
|
|
45
|
+
t11 = Symbol.for("react.early_return_sentinel");
|
|
50
46
|
bb0: {
|
|
51
47
|
let icon = null;
|
|
52
48
|
let image = null;
|
|
@@ -74,7 +70,7 @@ const CardImpl = /*#__PURE__*/forwardRef(function Card(t0, ref) {
|
|
|
74
70
|
if (child.type === CardMetadata) {
|
|
75
71
|
metadata = child;
|
|
76
72
|
} else {
|
|
77
|
-
if (child.type ===
|
|
73
|
+
if (child.type === CardAction) {
|
|
78
74
|
menu = child;
|
|
79
75
|
}
|
|
80
76
|
}
|
|
@@ -84,64 +80,111 @@ const CardImpl = /*#__PURE__*/forwardRef(function Card(t0, ref) {
|
|
|
84
80
|
}
|
|
85
81
|
}
|
|
86
82
|
const hasSlotChildren = icon || image || heading || description || metadata || menu;
|
|
83
|
+
const isEmpty = !hasSlotChildren && childArray.length === 0;
|
|
84
|
+
if (isEmpty) {
|
|
85
|
+
t11 = null;
|
|
86
|
+
break bb0;
|
|
87
|
+
}
|
|
87
88
|
if (!hasSlotChildren) {
|
|
88
|
-
let
|
|
89
|
-
if ($[23] !==
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
89
|
+
let t12;
|
|
90
|
+
if ($[23] !== titleId) {
|
|
91
|
+
t12 = {
|
|
92
|
+
titleId
|
|
93
|
+
};
|
|
94
|
+
$[23] = titleId;
|
|
95
|
+
$[24] = t12;
|
|
93
96
|
} else {
|
|
94
|
-
|
|
97
|
+
t12 = $[24];
|
|
95
98
|
}
|
|
96
|
-
let
|
|
97
|
-
if ($[25] !==
|
|
98
|
-
|
|
99
|
+
let t13;
|
|
100
|
+
if ($[25] !== className) {
|
|
101
|
+
t13 = clsx(classes.Card, className);
|
|
102
|
+
$[25] = className;
|
|
103
|
+
$[26] = t13;
|
|
104
|
+
} else {
|
|
105
|
+
t13 = $[26];
|
|
106
|
+
}
|
|
107
|
+
let t14;
|
|
108
|
+
if ($[27] !== Component || $[28] !== borderRadius || $[29] !== children || $[30] !== padding || $[31] !== ref || $[32] !== rest || $[33] !== t13) {
|
|
109
|
+
t14 = /*#__PURE__*/jsx(Component, {
|
|
99
110
|
ref: ref,
|
|
100
|
-
className:
|
|
111
|
+
className: t13,
|
|
112
|
+
"data-component": "Card",
|
|
101
113
|
"data-padding": padding,
|
|
102
114
|
"data-border-radius": borderRadius,
|
|
103
115
|
...rest,
|
|
104
116
|
children: children
|
|
105
117
|
});
|
|
106
|
-
$[
|
|
107
|
-
$[
|
|
108
|
-
$[
|
|
109
|
-
$[
|
|
110
|
-
$[
|
|
111
|
-
$[
|
|
112
|
-
$[
|
|
118
|
+
$[27] = Component;
|
|
119
|
+
$[28] = borderRadius;
|
|
120
|
+
$[29] = children;
|
|
121
|
+
$[30] = padding;
|
|
122
|
+
$[31] = ref;
|
|
123
|
+
$[32] = rest;
|
|
124
|
+
$[33] = t13;
|
|
125
|
+
$[34] = t14;
|
|
113
126
|
} else {
|
|
114
|
-
|
|
127
|
+
t14 = $[34];
|
|
115
128
|
}
|
|
116
|
-
|
|
129
|
+
let t15;
|
|
130
|
+
if ($[35] !== t12 || $[36] !== t14) {
|
|
131
|
+
t15 = /*#__PURE__*/jsx(CardContext.Provider, {
|
|
132
|
+
value: t12,
|
|
133
|
+
children: t14
|
|
134
|
+
});
|
|
135
|
+
$[35] = t12;
|
|
136
|
+
$[36] = t14;
|
|
137
|
+
$[37] = t15;
|
|
138
|
+
} else {
|
|
139
|
+
t15 = $[37];
|
|
140
|
+
}
|
|
141
|
+
t11 = t15;
|
|
117
142
|
break bb0;
|
|
118
143
|
}
|
|
144
|
+
T1 = CardContext.Provider;
|
|
145
|
+
if ($[38] !== titleId) {
|
|
146
|
+
t10 = {
|
|
147
|
+
titleId
|
|
148
|
+
};
|
|
149
|
+
$[38] = titleId;
|
|
150
|
+
$[39] = t10;
|
|
151
|
+
} else {
|
|
152
|
+
t10 = $[39];
|
|
153
|
+
}
|
|
154
|
+
T0 = Component;
|
|
119
155
|
t3 = ref;
|
|
120
|
-
if ($[
|
|
156
|
+
if ($[40] !== className) {
|
|
121
157
|
t4 = clsx(classes.Card, className);
|
|
122
|
-
$[
|
|
123
|
-
$[
|
|
158
|
+
$[40] = className;
|
|
159
|
+
$[41] = t4;
|
|
124
160
|
} else {
|
|
125
|
-
t4 = $[
|
|
161
|
+
t4 = $[41];
|
|
126
162
|
}
|
|
127
|
-
t5 =
|
|
128
|
-
t6 =
|
|
129
|
-
t7 =
|
|
130
|
-
t8 =
|
|
163
|
+
t5 = "Card";
|
|
164
|
+
t6 = padding;
|
|
165
|
+
t7 = borderRadius;
|
|
166
|
+
t8 = rest;
|
|
167
|
+
t9 = (image || icon) && /*#__PURE__*/jsx("div", {
|
|
131
168
|
className: clsx(classes.CardHeader, image && classes.CardHeaderEdgeToEdge),
|
|
132
169
|
children: image || icon
|
|
133
170
|
});
|
|
134
171
|
}
|
|
135
|
-
$[
|
|
136
|
-
$[
|
|
137
|
-
$[
|
|
138
|
-
$[
|
|
139
|
-
$[
|
|
140
|
-
$[
|
|
141
|
-
$[
|
|
142
|
-
$[
|
|
143
|
-
$[
|
|
144
|
-
$[
|
|
172
|
+
$[0] = Component;
|
|
173
|
+
$[1] = borderRadius;
|
|
174
|
+
$[2] = children;
|
|
175
|
+
$[3] = className;
|
|
176
|
+
$[4] = padding;
|
|
177
|
+
$[5] = ref;
|
|
178
|
+
$[6] = rest;
|
|
179
|
+
$[7] = titleId;
|
|
180
|
+
$[8] = T0;
|
|
181
|
+
$[9] = T1;
|
|
182
|
+
$[10] = description;
|
|
183
|
+
$[11] = heading;
|
|
184
|
+
$[12] = menu;
|
|
185
|
+
$[13] = metadata;
|
|
186
|
+
$[14] = t10;
|
|
187
|
+
$[15] = t11;
|
|
145
188
|
$[16] = t3;
|
|
146
189
|
$[17] = t4;
|
|
147
190
|
$[18] = t5;
|
|
@@ -150,10 +193,14 @@ const CardImpl = /*#__PURE__*/forwardRef(function Card(t0, ref) {
|
|
|
150
193
|
$[21] = t8;
|
|
151
194
|
$[22] = t9;
|
|
152
195
|
} else {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
196
|
+
T0 = $[8];
|
|
197
|
+
T1 = $[9];
|
|
198
|
+
description = $[10];
|
|
199
|
+
heading = $[11];
|
|
200
|
+
menu = $[12];
|
|
201
|
+
metadata = $[13];
|
|
202
|
+
t10 = $[14];
|
|
203
|
+
t11 = $[15];
|
|
157
204
|
t3 = $[16];
|
|
158
205
|
t4 = $[17];
|
|
159
206
|
t5 = $[18];
|
|
@@ -162,80 +209,98 @@ const CardImpl = /*#__PURE__*/forwardRef(function Card(t0, ref) {
|
|
|
162
209
|
t8 = $[21];
|
|
163
210
|
t9 = $[22];
|
|
164
211
|
}
|
|
165
|
-
if (
|
|
166
|
-
return
|
|
212
|
+
if (t11 !== Symbol.for("react.early_return_sentinel")) {
|
|
213
|
+
return t11;
|
|
167
214
|
}
|
|
168
|
-
let
|
|
169
|
-
if ($[
|
|
170
|
-
|
|
215
|
+
let t12;
|
|
216
|
+
if ($[42] !== description || $[43] !== heading) {
|
|
217
|
+
t12 = /*#__PURE__*/jsxs("div", {
|
|
171
218
|
className: classes.CardContent,
|
|
172
219
|
children: [heading, description]
|
|
173
220
|
});
|
|
174
|
-
$[
|
|
175
|
-
$[
|
|
176
|
-
$[
|
|
221
|
+
$[42] = description;
|
|
222
|
+
$[43] = heading;
|
|
223
|
+
$[44] = t12;
|
|
177
224
|
} else {
|
|
178
|
-
|
|
225
|
+
t12 = $[44];
|
|
179
226
|
}
|
|
180
|
-
let
|
|
181
|
-
if ($[
|
|
182
|
-
|
|
227
|
+
let t13;
|
|
228
|
+
if ($[45] !== metadata) {
|
|
229
|
+
t13 = metadata ? /*#__PURE__*/jsx("div", {
|
|
183
230
|
className: classes.CardMetadataContainer,
|
|
184
231
|
children: metadata
|
|
185
232
|
}) : null;
|
|
186
|
-
$[
|
|
187
|
-
$[
|
|
233
|
+
$[45] = metadata;
|
|
234
|
+
$[46] = t13;
|
|
188
235
|
} else {
|
|
189
|
-
|
|
236
|
+
t13 = $[46];
|
|
190
237
|
}
|
|
191
|
-
let
|
|
192
|
-
if ($[
|
|
193
|
-
|
|
238
|
+
let t14;
|
|
239
|
+
if ($[47] !== t12 || $[48] !== t13) {
|
|
240
|
+
t14 = /*#__PURE__*/jsxs("div", {
|
|
194
241
|
className: classes.CardBody,
|
|
195
|
-
children: [
|
|
242
|
+
children: [t12, t13]
|
|
196
243
|
});
|
|
197
|
-
$[
|
|
198
|
-
$[
|
|
199
|
-
$[
|
|
244
|
+
$[47] = t12;
|
|
245
|
+
$[48] = t13;
|
|
246
|
+
$[49] = t14;
|
|
200
247
|
} else {
|
|
201
|
-
|
|
248
|
+
t14 = $[49];
|
|
202
249
|
}
|
|
203
|
-
let
|
|
204
|
-
if ($[
|
|
205
|
-
|
|
206
|
-
className: classes.
|
|
250
|
+
let t15;
|
|
251
|
+
if ($[50] !== menu) {
|
|
252
|
+
t15 = menu ? /*#__PURE__*/jsx("div", {
|
|
253
|
+
className: classes.CardAction,
|
|
207
254
|
children: menu
|
|
208
255
|
}) : null;
|
|
209
|
-
$[
|
|
210
|
-
$[
|
|
256
|
+
$[50] = menu;
|
|
257
|
+
$[51] = t15;
|
|
211
258
|
} else {
|
|
212
|
-
|
|
259
|
+
t15 = $[51];
|
|
213
260
|
}
|
|
214
|
-
let
|
|
215
|
-
if ($[
|
|
216
|
-
|
|
261
|
+
let t16;
|
|
262
|
+
if ($[52] !== T0 || $[53] !== t14 || $[54] !== t15 || $[55] !== t3 || $[56] !== t4 || $[57] !== t5 || $[58] !== t6 || $[59] !== t7 || $[60] !== t8 || $[61] !== t9) {
|
|
263
|
+
t16 = /*#__PURE__*/jsxs(T0, {
|
|
217
264
|
ref: t3,
|
|
218
265
|
className: t4,
|
|
219
|
-
"data-
|
|
220
|
-
"data-
|
|
221
|
-
|
|
222
|
-
|
|
266
|
+
"data-component": t5,
|
|
267
|
+
"data-padding": t6,
|
|
268
|
+
"data-border-radius": t7,
|
|
269
|
+
...t8,
|
|
270
|
+
children: [t9, t14, t15]
|
|
223
271
|
});
|
|
224
|
-
$[
|
|
225
|
-
$[
|
|
226
|
-
$[
|
|
227
|
-
$[
|
|
228
|
-
$[
|
|
229
|
-
$[
|
|
230
|
-
$[
|
|
231
|
-
$[
|
|
232
|
-
$[
|
|
272
|
+
$[52] = T0;
|
|
273
|
+
$[53] = t14;
|
|
274
|
+
$[54] = t15;
|
|
275
|
+
$[55] = t3;
|
|
276
|
+
$[56] = t4;
|
|
277
|
+
$[57] = t5;
|
|
278
|
+
$[58] = t6;
|
|
279
|
+
$[59] = t7;
|
|
280
|
+
$[60] = t8;
|
|
281
|
+
$[61] = t9;
|
|
282
|
+
$[62] = t16;
|
|
233
283
|
} else {
|
|
234
|
-
|
|
284
|
+
t16 = $[62];
|
|
235
285
|
}
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
286
|
+
let t17;
|
|
287
|
+
if ($[63] !== T1 || $[64] !== t10 || $[65] !== t16) {
|
|
288
|
+
t17 = /*#__PURE__*/jsx(T1, {
|
|
289
|
+
value: t10,
|
|
290
|
+
children: t16
|
|
291
|
+
});
|
|
292
|
+
$[63] = T1;
|
|
293
|
+
$[64] = t10;
|
|
294
|
+
$[65] = t16;
|
|
295
|
+
$[66] = t17;
|
|
296
|
+
} else {
|
|
297
|
+
t17 = $[66];
|
|
298
|
+
}
|
|
299
|
+
return t17;
|
|
300
|
+
}
|
|
301
|
+
CardComponent.displayName = 'Card';
|
|
302
|
+
const CardImpl = fixedForwardRef(CardComponent);
|
|
303
|
+
function CardIcon(t0) {
|
|
239
304
|
const $ = c(10);
|
|
240
305
|
const {
|
|
241
306
|
icon: IconComponent,
|
|
@@ -264,6 +329,7 @@ const CardIcon = t0 => {
|
|
|
264
329
|
if ($[4] !== ariaLabel || $[5] !== t1 || $[6] !== t2 || $[7] !== t3 || $[8] !== t4) {
|
|
265
330
|
t5 = /*#__PURE__*/jsx("span", {
|
|
266
331
|
className: t1,
|
|
332
|
+
"data-component": "Card.Icon",
|
|
267
333
|
role: t2,
|
|
268
334
|
"aria-label": ariaLabel,
|
|
269
335
|
"aria-hidden": t3,
|
|
@@ -279,9 +345,9 @@ const CardIcon = t0 => {
|
|
|
279
345
|
t5 = $[9];
|
|
280
346
|
}
|
|
281
347
|
return t5;
|
|
282
|
-
}
|
|
348
|
+
}
|
|
283
349
|
CardIcon.displayName = 'Card.Icon';
|
|
284
|
-
|
|
350
|
+
function CardImage(t0) {
|
|
285
351
|
const $ = c(12);
|
|
286
352
|
let className;
|
|
287
353
|
let rest;
|
|
@@ -317,10 +383,11 @@ const CardImage = t0 => {
|
|
|
317
383
|
let t3;
|
|
318
384
|
if ($[7] !== alt || $[8] !== rest || $[9] !== src || $[10] !== t2) {
|
|
319
385
|
t3 = /*#__PURE__*/jsx("img", {
|
|
386
|
+
...rest,
|
|
320
387
|
src: src,
|
|
321
388
|
alt: alt,
|
|
322
389
|
className: t2,
|
|
323
|
-
|
|
390
|
+
"data-component": "Card.Image"
|
|
324
391
|
});
|
|
325
392
|
$[7] = alt;
|
|
326
393
|
$[8] = rest;
|
|
@@ -331,12 +398,21 @@ const CardImage = t0 => {
|
|
|
331
398
|
t3 = $[11];
|
|
332
399
|
}
|
|
333
400
|
return t3;
|
|
334
|
-
}
|
|
401
|
+
}
|
|
335
402
|
CardImage.displayName = 'Card.Image';
|
|
403
|
+
|
|
404
|
+
/**
|
|
405
|
+
* Heading shown at the top of a Card.
|
|
406
|
+
*
|
|
407
|
+
* When the parent Card uses `as="section"`, the heading's `id` is
|
|
408
|
+
* automatically wired to the section's `aria-labelledby`.
|
|
409
|
+
*/
|
|
336
410
|
const CardHeading = /*#__PURE__*/forwardRef(function CardHeading(t0, ref) {
|
|
337
|
-
|
|
411
|
+
var _id;
|
|
412
|
+
const $ = c(15);
|
|
338
413
|
let children;
|
|
339
414
|
let className;
|
|
415
|
+
let id;
|
|
340
416
|
let rest;
|
|
341
417
|
let t1;
|
|
342
418
|
if ($[0] !== t0) {
|
|
@@ -344,47 +420,58 @@ const CardHeading = /*#__PURE__*/forwardRef(function CardHeading(t0, ref) {
|
|
|
344
420
|
as: t1,
|
|
345
421
|
children,
|
|
346
422
|
className,
|
|
423
|
+
id,
|
|
347
424
|
...rest
|
|
348
425
|
} = t0);
|
|
349
426
|
$[0] = t0;
|
|
350
427
|
$[1] = children;
|
|
351
428
|
$[2] = className;
|
|
352
|
-
$[3] =
|
|
353
|
-
$[4] =
|
|
429
|
+
$[3] = id;
|
|
430
|
+
$[4] = rest;
|
|
431
|
+
$[5] = t1;
|
|
354
432
|
} else {
|
|
355
433
|
children = $[1];
|
|
356
434
|
className = $[2];
|
|
357
|
-
|
|
358
|
-
|
|
435
|
+
id = $[3];
|
|
436
|
+
rest = $[4];
|
|
437
|
+
t1 = $[5];
|
|
359
438
|
}
|
|
360
439
|
const Component = t1 === undefined ? "h3" : t1;
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
440
|
+
const {
|
|
441
|
+
titleId
|
|
442
|
+
} = useContext(CardContext);
|
|
443
|
+
const t2 = (_id = id) !== null && _id !== void 0 ? _id : titleId;
|
|
444
|
+
let t3;
|
|
445
|
+
if ($[6] !== className) {
|
|
446
|
+
t3 = clsx(classes.CardHeading, className);
|
|
447
|
+
$[6] = className;
|
|
448
|
+
$[7] = t3;
|
|
366
449
|
} else {
|
|
367
|
-
|
|
450
|
+
t3 = $[7];
|
|
368
451
|
}
|
|
369
|
-
let
|
|
370
|
-
if ($[
|
|
371
|
-
|
|
372
|
-
ref: ref,
|
|
373
|
-
className: t2,
|
|
452
|
+
let t4;
|
|
453
|
+
if ($[8] !== Component || $[9] !== children || $[10] !== ref || $[11] !== rest || $[12] !== t2 || $[13] !== t3) {
|
|
454
|
+
t4 = /*#__PURE__*/jsx(Component, {
|
|
374
455
|
...rest,
|
|
456
|
+
ref: ref,
|
|
457
|
+
id: t2,
|
|
458
|
+
className: t3,
|
|
459
|
+
"data-component": "Card.Heading",
|
|
375
460
|
children: children
|
|
376
461
|
});
|
|
377
|
-
$[
|
|
378
|
-
$[
|
|
379
|
-
$[
|
|
380
|
-
$[
|
|
381
|
-
$[
|
|
382
|
-
$[
|
|
462
|
+
$[8] = Component;
|
|
463
|
+
$[9] = children;
|
|
464
|
+
$[10] = ref;
|
|
465
|
+
$[11] = rest;
|
|
466
|
+
$[12] = t2;
|
|
467
|
+
$[13] = t3;
|
|
468
|
+
$[14] = t4;
|
|
383
469
|
} else {
|
|
384
|
-
|
|
470
|
+
t4 = $[14];
|
|
385
471
|
}
|
|
386
|
-
return
|
|
472
|
+
return t4;
|
|
387
473
|
});
|
|
474
|
+
CardHeading.displayName = 'Card.Heading';
|
|
388
475
|
const CardDescription = /*#__PURE__*/forwardRef(function CardDescription(t0, ref) {
|
|
389
476
|
const $ = c(11);
|
|
390
477
|
let children;
|
|
@@ -416,9 +503,10 @@ const CardDescription = /*#__PURE__*/forwardRef(function CardDescription(t0, ref
|
|
|
416
503
|
let t2;
|
|
417
504
|
if ($[6] !== children || $[7] !== ref || $[8] !== rest || $[9] !== t1) {
|
|
418
505
|
t2 = /*#__PURE__*/jsx("p", {
|
|
506
|
+
...rest,
|
|
419
507
|
ref: ref,
|
|
420
508
|
className: t1,
|
|
421
|
-
|
|
509
|
+
"data-component": "Card.Description",
|
|
422
510
|
children: children
|
|
423
511
|
});
|
|
424
512
|
$[6] = children;
|
|
@@ -431,14 +519,24 @@ const CardDescription = /*#__PURE__*/forwardRef(function CardDescription(t0, ref
|
|
|
431
519
|
}
|
|
432
520
|
return t2;
|
|
433
521
|
});
|
|
434
|
-
|
|
522
|
+
CardDescription.displayName = 'Card.Description';
|
|
523
|
+
|
|
524
|
+
/**
|
|
525
|
+
* Top-right slot for a single interactive control.
|
|
526
|
+
*
|
|
527
|
+
* Give the control a label that names the card (e.g. `"More options for
|
|
528
|
+
* Project Alpha"`, not just `"More options"`) so users can tell which card
|
|
529
|
+
* the action applies to when several cards are visible.
|
|
530
|
+
*/
|
|
531
|
+
function CardAction(t0) {
|
|
435
532
|
const $ = c(2);
|
|
436
533
|
const {
|
|
437
534
|
children
|
|
438
535
|
} = t0;
|
|
439
536
|
let t1;
|
|
440
537
|
if ($[0] !== children) {
|
|
441
|
-
t1 = /*#__PURE__*/jsx(
|
|
538
|
+
t1 = /*#__PURE__*/jsx("div", {
|
|
539
|
+
"data-component": "Card.Action",
|
|
442
540
|
children: children
|
|
443
541
|
});
|
|
444
542
|
$[0] = children;
|
|
@@ -447,8 +545,8 @@ const CardMenu = t0 => {
|
|
|
447
545
|
t1 = $[1];
|
|
448
546
|
}
|
|
449
547
|
return t1;
|
|
450
|
-
}
|
|
451
|
-
|
|
548
|
+
}
|
|
549
|
+
CardAction.displayName = 'Card.Action';
|
|
452
550
|
const CardMetadata = /*#__PURE__*/forwardRef(function CardMetadata(t0, ref) {
|
|
453
551
|
const $ = c(11);
|
|
454
552
|
let children;
|
|
@@ -480,9 +578,10 @@ const CardMetadata = /*#__PURE__*/forwardRef(function CardMetadata(t0, ref) {
|
|
|
480
578
|
let t2;
|
|
481
579
|
if ($[6] !== children || $[7] !== ref || $[8] !== rest || $[9] !== t1) {
|
|
482
580
|
t2 = /*#__PURE__*/jsx("div", {
|
|
581
|
+
...rest,
|
|
483
582
|
ref: ref,
|
|
484
583
|
className: t1,
|
|
485
|
-
|
|
584
|
+
"data-component": "Card.Metadata",
|
|
486
585
|
children: children
|
|
487
586
|
});
|
|
488
587
|
$[6] = children;
|
|
@@ -495,5 +594,6 @@ const CardMetadata = /*#__PURE__*/forwardRef(function CardMetadata(t0, ref) {
|
|
|
495
594
|
}
|
|
496
595
|
return t2;
|
|
497
596
|
});
|
|
597
|
+
CardMetadata.displayName = 'Card.Metadata';
|
|
498
598
|
|
|
499
|
-
export { CardDescription, CardHeading, CardIcon, CardImage, CardImpl,
|
|
599
|
+
export { CardAction, CardDescription, CardHeading, CardIcon, CardImage, CardImpl, CardMetadata };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import './Card-
|
|
1
|
+
import './Card-d8a02dd9.css';
|
|
2
2
|
|
|
3
|
-
var classes = {"Card":"prc-Card-Card-pYjuL","CardHeader":"prc-Card-CardHeader-P5Qbb","CardHeaderEdgeToEdge":"prc-Card-CardHeaderEdgeToEdge-3yCqT","CardImage":"prc-Card-CardImage-2M8DM","CardIcon":"prc-Card-CardIcon-mIMfj","CardBody":"prc-Card-CardBody-W1o-l","CardContent":"prc-Card-CardContent-omZDS","CardHeading":"prc-Card-CardHeading-3HXyS","CardDescription":"prc-Card-CardDescription-MnJ3F","CardMetadataContainer":"prc-Card-CardMetadataContainer-K-UlH","CardMetadataItem":"prc-Card-CardMetadataItem-ellY9","
|
|
3
|
+
var classes = {"Card":"prc-Card-Card-pYjuL","CardHeader":"prc-Card-CardHeader-P5Qbb","CardHeaderEdgeToEdge":"prc-Card-CardHeaderEdgeToEdge-3yCqT","CardImage":"prc-Card-CardImage-2M8DM","CardIcon":"prc-Card-CardIcon-mIMfj","CardBody":"prc-Card-CardBody-W1o-l","CardContent":"prc-Card-CardContent-omZDS","CardHeading":"prc-Card-CardHeading-3HXyS","CardDescription":"prc-Card-CardDescription-MnJ3F","CardMetadataContainer":"prc-Card-CardMetadataContainer-K-UlH","CardMetadataItem":"prc-Card-CardMetadataItem-ellY9","CardAction":"prc-Card-CardAction-VtI49"};
|
|
4
4
|
|
|
5
5
|
export { classes as default };
|
package/dist/Card/index.d.ts
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { CardIcon, CardImage, CardAction } from './Card';
|
|
2
|
+
import type { CardProps, CardIconProps, CardImageProps, CardHeadingProps, CardDescriptionProps, CardActionProps, CardMetadataProps } from './Card';
|
|
3
|
+
declare const Card: (<As extends "div" | "section">(props: (import("react").ComponentPropsWithRef<import("react").ElementType extends As ? "div" : As> & {
|
|
3
4
|
className?: string;
|
|
4
5
|
padding?: "none" | "condensed" | "normal";
|
|
5
6
|
borderRadius?: "medium" | "large";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
} extends infer T ? T extends import("react").ComponentPropsWithRef<import("react").ElementType extends As ? "div" : As> & {
|
|
9
|
+
className?: string;
|
|
10
|
+
padding?: "none" | "condensed" | "normal";
|
|
11
|
+
borderRadius?: "medium" | "large";
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
} ? T extends unknown ? Omit<T, "as"> : never : never : never) & {
|
|
14
|
+
as?: As | undefined;
|
|
15
|
+
} & import("react").RefAttributes<any>) => React.ReactNode) & {
|
|
16
|
+
Icon: typeof CardIcon;
|
|
17
|
+
Image: typeof CardImage;
|
|
15
18
|
Heading: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "ref"> & {
|
|
16
19
|
as?: "h2" | "h3" | "h4" | "h5" | "h6";
|
|
17
20
|
children: React.ReactNode;
|
|
@@ -19,14 +22,11 @@ declare const Card: import("react").ForwardRefExoticComponent<Omit<import("react
|
|
|
19
22
|
Description: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref"> & {
|
|
20
23
|
children: React.ReactNode;
|
|
21
24
|
} & import("react").RefAttributes<HTMLParagraphElement>>;
|
|
22
|
-
|
|
23
|
-
({ children }: CardMenuProps): import("react").JSX.Element;
|
|
24
|
-
displayName: string;
|
|
25
|
-
};
|
|
25
|
+
Action: typeof CardAction;
|
|
26
26
|
Metadata: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
27
27
|
children: React.ReactNode;
|
|
28
28
|
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
29
29
|
};
|
|
30
30
|
export { Card };
|
|
31
|
-
export type { CardProps, CardIconProps, CardImageProps, CardHeadingProps, CardDescriptionProps,
|
|
31
|
+
export type { CardProps, CardIconProps, CardImageProps, CardHeadingProps, CardDescriptionProps, CardActionProps, CardMetadataProps, };
|
|
32
32
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/Card/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Card/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Card/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,QAAQ,EAAE,SAAS,EAAgC,UAAU,EAAe,MAAM,QAAQ,CAAA;AAC5G,OAAO,KAAK,EACV,SAAS,EACT,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EAClB,MAAM,QAAQ,CAAA;AAEf,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;CAOR,CAAA;AAEF,OAAO,EAAC,IAAI,EAAC,CAAA;AACb,YAAY,EACV,SAAS,EACT,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACpB,eAAe,EACf,iBAAiB,GAClB,CAAA"}
|