@primer/react 0.0.0-20260408170654 → 0.0.0-20260408182140

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