@primer/react 0.0.0-20260407070343 → 0.0.0-20260407180202

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/dist/Card/Card.js DELETED
@@ -1,471 +0,0 @@
1
- import { c } from 'react-compiler-runtime';
2
- import { clsx } from 'clsx';
3
- import React, { forwardRef } from 'react';
4
- import classes from './Card.module.css.js';
5
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
6
-
7
- const CardImpl = /*#__PURE__*/forwardRef(function Card(t0, ref) {
8
- const $ = c(43);
9
- let children;
10
- let className;
11
- let rest;
12
- if ($[0] !== t0) {
13
- ({
14
- children,
15
- className,
16
- ...rest
17
- } = t0);
18
- $[0] = t0;
19
- $[1] = children;
20
- $[2] = className;
21
- $[3] = rest;
22
- } else {
23
- children = $[1];
24
- className = $[2];
25
- rest = $[3];
26
- }
27
- let description;
28
- let heading;
29
- let menu;
30
- let metadata;
31
- let t1;
32
- let t2;
33
- let t3;
34
- let t4;
35
- let t5;
36
- if ($[4] !== children || $[5] !== className || $[6] !== ref || $[7] !== rest) {
37
- t5 = Symbol.for("react.early_return_sentinel");
38
- bb0: {
39
- let icon = null;
40
- let image = null;
41
- heading = null;
42
- description = null;
43
- metadata = null;
44
- menu = null;
45
- const childArray = React.Children.toArray(children);
46
- for (const child of childArray) {
47
- if (! /*#__PURE__*/React.isValidElement(child)) {
48
- continue;
49
- }
50
- if (child.type === CardIcon) {
51
- icon = child;
52
- } else {
53
- if (child.type === CardImage) {
54
- image = child;
55
- } else {
56
- if (child.type === CardHeading) {
57
- heading = child;
58
- } else {
59
- if (child.type === CardDescription) {
60
- description = child;
61
- } else {
62
- if (child.type === CardMetadata) {
63
- metadata = child;
64
- } else {
65
- if (child.type === CardMenu) {
66
- menu = child;
67
- }
68
- }
69
- }
70
- }
71
- }
72
- }
73
- }
74
- const hasSlotChildren = icon || image || heading || description || metadata || menu;
75
- if (!hasSlotChildren) {
76
- let t6;
77
- if ($[17] !== className) {
78
- t6 = clsx(classes.Card, className);
79
- $[17] = className;
80
- $[18] = t6;
81
- } else {
82
- t6 = $[18];
83
- }
84
- let t7;
85
- if ($[19] !== children || $[20] !== ref || $[21] !== rest || $[22] !== t6) {
86
- t7 = /*#__PURE__*/jsx("div", {
87
- ref: ref,
88
- className: t6,
89
- ...rest,
90
- children: children
91
- });
92
- $[19] = children;
93
- $[20] = ref;
94
- $[21] = rest;
95
- $[22] = t6;
96
- $[23] = t7;
97
- } else {
98
- t7 = $[23];
99
- }
100
- t5 = t7;
101
- break bb0;
102
- }
103
- t1 = ref;
104
- if ($[24] !== className) {
105
- t2 = clsx(classes.Card, className);
106
- $[24] = className;
107
- $[25] = t2;
108
- } else {
109
- t2 = $[25];
110
- }
111
- t3 = rest;
112
- t4 = (image || icon) && /*#__PURE__*/jsx("div", {
113
- className: clsx(classes.CardHeader, image && classes.CardHeaderEdgeToEdge),
114
- children: image || icon
115
- });
116
- }
117
- $[4] = children;
118
- $[5] = className;
119
- $[6] = ref;
120
- $[7] = rest;
121
- $[8] = description;
122
- $[9] = heading;
123
- $[10] = menu;
124
- $[11] = metadata;
125
- $[12] = t1;
126
- $[13] = t2;
127
- $[14] = t3;
128
- $[15] = t4;
129
- $[16] = t5;
130
- } else {
131
- description = $[8];
132
- heading = $[9];
133
- menu = $[10];
134
- metadata = $[11];
135
- t1 = $[12];
136
- t2 = $[13];
137
- t3 = $[14];
138
- t4 = $[15];
139
- t5 = $[16];
140
- }
141
- if (t5 !== Symbol.for("react.early_return_sentinel")) {
142
- return t5;
143
- }
144
- let t6;
145
- if ($[26] !== description || $[27] !== heading) {
146
- t6 = /*#__PURE__*/jsxs("div", {
147
- className: classes.CardContent,
148
- children: [heading, description]
149
- });
150
- $[26] = description;
151
- $[27] = heading;
152
- $[28] = t6;
153
- } else {
154
- t6 = $[28];
155
- }
156
- let t7;
157
- if ($[29] !== metadata) {
158
- t7 = metadata ? /*#__PURE__*/jsx("div", {
159
- className: classes.CardMetadataContainer,
160
- children: metadata
161
- }) : null;
162
- $[29] = metadata;
163
- $[30] = t7;
164
- } else {
165
- t7 = $[30];
166
- }
167
- let t8;
168
- if ($[31] !== t6 || $[32] !== t7) {
169
- t8 = /*#__PURE__*/jsxs("div", {
170
- className: classes.CardBody,
171
- children: [t6, t7]
172
- });
173
- $[31] = t6;
174
- $[32] = t7;
175
- $[33] = t8;
176
- } else {
177
- t8 = $[33];
178
- }
179
- let t9;
180
- if ($[34] !== menu) {
181
- t9 = menu ? /*#__PURE__*/jsx("div", {
182
- className: classes.CardMenu,
183
- children: menu
184
- }) : null;
185
- $[34] = menu;
186
- $[35] = t9;
187
- } else {
188
- t9 = $[35];
189
- }
190
- let t10;
191
- if ($[36] !== t1 || $[37] !== t2 || $[38] !== t3 || $[39] !== t4 || $[40] !== t8 || $[41] !== t9) {
192
- t10 = /*#__PURE__*/jsxs("div", {
193
- ref: t1,
194
- className: t2,
195
- ...t3,
196
- children: [t4, t8, t9]
197
- });
198
- $[36] = t1;
199
- $[37] = t2;
200
- $[38] = t3;
201
- $[39] = t4;
202
- $[40] = t8;
203
- $[41] = t9;
204
- $[42] = t10;
205
- } else {
206
- t10 = $[42];
207
- }
208
- return t10;
209
- });
210
- const CardIcon = t0 => {
211
- const $ = c(10);
212
- const {
213
- icon: IconComponent,
214
- "aria-label": ariaLabel,
215
- className
216
- } = t0;
217
- let t1;
218
- if ($[0] !== className) {
219
- t1 = clsx(classes.CardIcon, className);
220
- $[0] = className;
221
- $[1] = t1;
222
- } else {
223
- t1 = $[1];
224
- }
225
- const t2 = ariaLabel ? "img" : undefined;
226
- const t3 = !ariaLabel;
227
- let t4;
228
- if ($[2] !== IconComponent) {
229
- t4 = /*#__PURE__*/jsx(IconComponent, {});
230
- $[2] = IconComponent;
231
- $[3] = t4;
232
- } else {
233
- t4 = $[3];
234
- }
235
- let t5;
236
- if ($[4] !== ariaLabel || $[5] !== t1 || $[6] !== t2 || $[7] !== t3 || $[8] !== t4) {
237
- t5 = /*#__PURE__*/jsx("span", {
238
- className: t1,
239
- role: t2,
240
- "aria-label": ariaLabel,
241
- "aria-hidden": t3,
242
- children: t4
243
- });
244
- $[4] = ariaLabel;
245
- $[5] = t1;
246
- $[6] = t2;
247
- $[7] = t3;
248
- $[8] = t4;
249
- $[9] = t5;
250
- } else {
251
- t5 = $[9];
252
- }
253
- return t5;
254
- };
255
- CardIcon.displayName = 'Card.Icon';
256
- const CardImage = t0 => {
257
- const $ = c(12);
258
- let className;
259
- let rest;
260
- let src;
261
- let t1;
262
- if ($[0] !== t0) {
263
- ({
264
- src,
265
- alt: t1,
266
- className,
267
- ...rest
268
- } = t0);
269
- $[0] = t0;
270
- $[1] = className;
271
- $[2] = rest;
272
- $[3] = src;
273
- $[4] = t1;
274
- } else {
275
- className = $[1];
276
- rest = $[2];
277
- src = $[3];
278
- t1 = $[4];
279
- }
280
- const alt = t1 === undefined ? "" : t1;
281
- let t2;
282
- if ($[5] !== className) {
283
- t2 = clsx(classes.CardImage, className);
284
- $[5] = className;
285
- $[6] = t2;
286
- } else {
287
- t2 = $[6];
288
- }
289
- let t3;
290
- if ($[7] !== alt || $[8] !== rest || $[9] !== src || $[10] !== t2) {
291
- t3 = /*#__PURE__*/jsx("img", {
292
- src: src,
293
- alt: alt,
294
- className: t2,
295
- ...rest
296
- });
297
- $[7] = alt;
298
- $[8] = rest;
299
- $[9] = src;
300
- $[10] = t2;
301
- $[11] = t3;
302
- } else {
303
- t3 = $[11];
304
- }
305
- return t3;
306
- };
307
- CardImage.displayName = 'Card.Image';
308
- const CardHeading = /*#__PURE__*/forwardRef(function CardHeading(t0, ref) {
309
- const $ = c(13);
310
- let children;
311
- let className;
312
- let rest;
313
- let t1;
314
- if ($[0] !== t0) {
315
- ({
316
- as: t1,
317
- children,
318
- className,
319
- ...rest
320
- } = t0);
321
- $[0] = t0;
322
- $[1] = children;
323
- $[2] = className;
324
- $[3] = rest;
325
- $[4] = t1;
326
- } else {
327
- children = $[1];
328
- className = $[2];
329
- rest = $[3];
330
- t1 = $[4];
331
- }
332
- const Component = t1 === undefined ? "h3" : t1;
333
- let t2;
334
- if ($[5] !== className) {
335
- t2 = clsx(classes.CardHeading, className);
336
- $[5] = className;
337
- $[6] = t2;
338
- } else {
339
- t2 = $[6];
340
- }
341
- let t3;
342
- if ($[7] !== Component || $[8] !== children || $[9] !== ref || $[10] !== rest || $[11] !== t2) {
343
- t3 = /*#__PURE__*/jsx(Component, {
344
- ref: ref,
345
- className: t2,
346
- ...rest,
347
- children: children
348
- });
349
- $[7] = Component;
350
- $[8] = children;
351
- $[9] = ref;
352
- $[10] = rest;
353
- $[11] = t2;
354
- $[12] = t3;
355
- } else {
356
- t3 = $[12];
357
- }
358
- return t3;
359
- });
360
- const CardDescription = /*#__PURE__*/forwardRef(function CardDescription(t0, ref) {
361
- const $ = c(11);
362
- let children;
363
- let className;
364
- let rest;
365
- if ($[0] !== t0) {
366
- ({
367
- children,
368
- className,
369
- ...rest
370
- } = t0);
371
- $[0] = t0;
372
- $[1] = children;
373
- $[2] = className;
374
- $[3] = rest;
375
- } else {
376
- children = $[1];
377
- className = $[2];
378
- rest = $[3];
379
- }
380
- let t1;
381
- if ($[4] !== className) {
382
- t1 = clsx(classes.CardDescription, className);
383
- $[4] = className;
384
- $[5] = t1;
385
- } else {
386
- t1 = $[5];
387
- }
388
- let t2;
389
- if ($[6] !== children || $[7] !== ref || $[8] !== rest || $[9] !== t1) {
390
- t2 = /*#__PURE__*/jsx("p", {
391
- ref: ref,
392
- className: t1,
393
- ...rest,
394
- children: children
395
- });
396
- $[6] = children;
397
- $[7] = ref;
398
- $[8] = rest;
399
- $[9] = t1;
400
- $[10] = t2;
401
- } else {
402
- t2 = $[10];
403
- }
404
- return t2;
405
- });
406
- const CardMenu = t0 => {
407
- const $ = c(2);
408
- const {
409
- children
410
- } = t0;
411
- let t1;
412
- if ($[0] !== children) {
413
- t1 = /*#__PURE__*/jsx(Fragment, {
414
- children: children
415
- });
416
- $[0] = children;
417
- $[1] = t1;
418
- } else {
419
- t1 = $[1];
420
- }
421
- return t1;
422
- };
423
- CardMenu.displayName = 'Card.Menu';
424
- const CardMetadata = /*#__PURE__*/forwardRef(function CardMetadata(t0, ref) {
425
- const $ = c(11);
426
- let children;
427
- let className;
428
- let rest;
429
- if ($[0] !== t0) {
430
- ({
431
- children,
432
- className,
433
- ...rest
434
- } = t0);
435
- $[0] = t0;
436
- $[1] = children;
437
- $[2] = className;
438
- $[3] = rest;
439
- } else {
440
- children = $[1];
441
- className = $[2];
442
- rest = $[3];
443
- }
444
- let t1;
445
- if ($[4] !== className) {
446
- t1 = clsx(classes.CardMetadataItem, className);
447
- $[4] = className;
448
- $[5] = t1;
449
- } else {
450
- t1 = $[5];
451
- }
452
- let t2;
453
- if ($[6] !== children || $[7] !== ref || $[8] !== rest || $[9] !== t1) {
454
- t2 = /*#__PURE__*/jsx("div", {
455
- ref: ref,
456
- className: t1,
457
- ...rest,
458
- children: children
459
- });
460
- $[6] = children;
461
- $[7] = ref;
462
- $[8] = rest;
463
- $[9] = t1;
464
- $[10] = t2;
465
- } else {
466
- t2 = $[10];
467
- }
468
- return t2;
469
- });
470
-
471
- export { CardDescription, CardHeading, CardIcon, CardImage, CardImpl, CardMenu, CardMetadata };
@@ -1,5 +0,0 @@
1
- import './Card-a82e0918.css';
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","CardMenu":"prc-Card-CardMenu-1b3uS"};
4
-
5
- export { classes as default };
@@ -1,30 +0,0 @@
1
- import type { CardProps, CardIconProps, CardImageProps, CardHeadingProps, CardDescriptionProps, CardMenuProps, CardMetadataProps } from './Card';
2
- declare const Card: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
3
- className?: string;
4
- } & import("react").RefAttributes<HTMLDivElement>> & {
5
- Icon: {
6
- ({ icon: IconComponent, "aria-label": ariaLabel, className }: CardIconProps): import("react").JSX.Element;
7
- displayName: string;
8
- };
9
- Image: {
10
- ({ src, alt, className, ...rest }: CardImageProps): import("react").JSX.Element;
11
- displayName: string;
12
- };
13
- Heading: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "ref"> & {
14
- as?: "h2" | "h3" | "h4" | "h5" | "h6";
15
- children: React.ReactNode;
16
- } & import("react").RefAttributes<HTMLHeadingElement>>;
17
- Description: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref"> & {
18
- children: React.ReactNode;
19
- } & import("react").RefAttributes<HTMLParagraphElement>>;
20
- Menu: {
21
- ({ children }: CardMenuProps): import("react").JSX.Element;
22
- displayName: string;
23
- };
24
- Metadata: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
25
- children: React.ReactNode;
26
- } & import("react").RefAttributes<HTMLDivElement>>;
27
- };
28
- export { Card };
29
- export type { CardProps, CardIconProps, CardImageProps, CardHeadingProps, CardDescriptionProps, CardMenuProps, CardMetadataProps, };
30
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Card/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,SAAS,EACT,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACpB,aAAa,EACb,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,aAAa,EACb,iBAAiB,GAClB,CAAA"}
@@ -1,12 +0,0 @@
1
- import { CardImpl, CardMetadata, CardMenu, CardDescription, CardHeading, CardImage, CardIcon } from './Card.js';
2
-
3
- const Card = Object.assign(CardImpl, {
4
- Icon: CardIcon,
5
- Image: CardImage,
6
- Heading: CardHeading,
7
- Description: CardDescription,
8
- Menu: CardMenu,
9
- Metadata: CardMetadata
10
- });
11
-
12
- export { Card };