@primer/react 0.0.0-20260522135914 → 0.0.0-20260522145907
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 +1 -7
- package/dist/Card/{Card-d8a02dd9.css → Card-cec366f8.css} +2 -2
- package/dist/Card/{Card-d8a02dd9.css.map → Card-cec366f8.css.map} +1 -1
- package/dist/Card/Card.d.ts +39 -75
- package/dist/Card/Card.d.ts.map +1 -1
- package/dist/Card/Card.js +160 -260
- 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/experimental/index.d.ts +1 -1
- package/dist/experimental/index.d.ts.map +1 -1
- package/dist/hooks/useMergedRefs.d.ts +1 -1
- package/dist/hooks/useMergedRefs.d.ts.map +1 -1
- package/dist/hooks/useMergedRefs.js +0 -13
- package/dist/utils/environment.d.ts +1 -4
- package/dist/utils/environment.d.ts.map +1 -1
- package/dist/utils/environment.js +2 -17
- package/generated/components.json +8 -57
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
# @primer/react
|
|
2
2
|
|
|
3
|
-
## 0.0.0-
|
|
4
|
-
|
|
5
|
-
### Minor Changes
|
|
6
|
-
|
|
7
|
-
- [#7852](https://github.com/primer/react/pull/7852) [`5504680`](https://github.com/primer/react/commit/5504680614bacc2ce3eecaaa55d10887e6fb152d) Thanks [@liuliu-dev](https://github.com/liuliu-dev)! - Card: Add `data-component` attributes to `Card` and its subcomponents (`Icon`, `Image`, `Heading`, `Description`, `Metadata`, `Menu`). Add an `as` prop (`'div' | 'section'`) so standalone Cards can render as a labelled region landmark; `as="section"` requires `aria-label` or `aria-labelledby`. `Card` now requires `children`. Also improves docs and stories.
|
|
3
|
+
## 0.0.0-20260522145907
|
|
8
4
|
|
|
9
5
|
### Patch Changes
|
|
10
6
|
|
|
11
|
-
- [#7843](https://github.com/primer/react/pull/7843) [`1600cf5`](https://github.com/primer/react/commit/1600cf5e5318e626b6daa18fa2bf065a65ef3387) Thanks [@joshblack](https://github.com/joshblack)! - Update useMergedRefs so that in React 18 no warning is emitted
|
|
12
|
-
|
|
13
7
|
- Fake entry to force publishing
|
|
14
8
|
|
|
15
9
|
## 38.24.0
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
.prc-Card-Card-pYjuL{background-color:var(--bgColor-default,#fff);border:var(--borderWidth-thin,.0625rem) solid var(--borderColor-default,#d1d9e0);box-shadow:var(--shadow-resting-small,0 1px 1px 0 #1f23280a,0 1px 2px 0 #1f232808);display:grid;gap:var(--stack-gap-normal,1rem);grid-auto-rows:max-content auto;overflow:hidden;position:relative}.prc-Card-Card-pYjuL[data-border-radius=large]{border-radius:var(--borderRadius-large,.75rem)}.prc-Card-Card-pYjuL[data-border-radius=medium]{border-radius:var(--borderRadius-medium,.375rem)}.prc-Card-Card-pYjuL[data-padding=normal]{padding:var(--stack-padding-spacious,1.5rem)}.prc-Card-Card-pYjuL[data-padding=condensed]{padding:var(--stack-padding-condensed,.5rem)}.prc-Card-Card-pYjuL[data-padding=none]{padding:0}.prc-Card-CardHeader-P5Qbb{display:block;height:auto;width:100%}.prc-Card-CardHeaderEdgeToEdge-3yCqT{margin-left:calc(var(--stack-padding-spacious,1.5rem)*-1);margin-right:calc(var(--stack-padding-spacious,1.5rem)*-1);margin-top:calc(var(--stack-padding-spacious,1.5rem)*-1);width:calc(100% + var(--stack-padding-spacious,1.5rem)*2)}.prc-Card-CardImage-2M8DM{display:block;height:auto;width:100%}.prc-Card-CardIcon-mIMfj{align-items:center;background-color:var(--bgColor-muted,#f6f8fa);border-radius:var(--borderRadius-medium,.375rem);color:var(--fgColor-muted,#59636e);display:flex;height:var(--base-size-32,2rem);justify-content:center;width:var(--base-size-32,2rem)}.prc-Card-CardBody-W1o-l{display:grid;gap:var(--stack-gap-normal,1rem)}.prc-Card-CardContent-omZDS{display:grid;gap:var(--stack-gap-condensed,.5rem)}.prc-Card-CardHeading-3HXyS{color:var(--fgColor-default,#1f2328);font:var(--text-title-shorthand-small,600 1rem/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji");margin:0}.prc-Card-CardDescription-MnJ3F{margin:0}.prc-Card-CardDescription-MnJ3F,.prc-Card-CardMetadataContainer-K-UlH{color:var(--fgColor-muted,#59636e);font:var(--text-body-shorthand-medium,400 .875rem/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji")}.prc-Card-CardMetadataContainer-K-UlH{align-items:center;display:flex;gap:var(--stack-gap-normal,1rem)}.prc-Card-CardMetadataItem-ellY9{align-items:center;display:flex;font:var(--text-body-shorthand-small,400 .75rem/1.625 -apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji");gap:var(--stack-gap-condensed,.5rem)}.prc-Card-
|
|
2
|
-
/*# sourceMappingURL=Card-
|
|
1
|
+
.prc-Card-Card-pYjuL{background-color:var(--bgColor-default,#fff);border:var(--borderWidth-thin,.0625rem) solid var(--borderColor-default,#d1d9e0);box-shadow:var(--shadow-resting-small,0 1px 1px 0 #1f23280a,0 1px 2px 0 #1f232808);display:grid;gap:var(--stack-gap-normal,1rem);grid-auto-rows:max-content auto;overflow:hidden;position:relative}.prc-Card-Card-pYjuL[data-border-radius=large]{border-radius:var(--borderRadius-large,.75rem)}.prc-Card-Card-pYjuL[data-border-radius=medium]{border-radius:var(--borderRadius-medium,.375rem)}.prc-Card-Card-pYjuL[data-padding=normal]{padding:var(--stack-padding-spacious,1.5rem)}.prc-Card-Card-pYjuL[data-padding=condensed]{padding:var(--stack-padding-condensed,.5rem)}.prc-Card-Card-pYjuL[data-padding=none]{padding:0}.prc-Card-CardHeader-P5Qbb{display:block;height:auto;width:100%}.prc-Card-CardHeaderEdgeToEdge-3yCqT{margin-left:calc(var(--stack-padding-spacious,1.5rem)*-1);margin-right:calc(var(--stack-padding-spacious,1.5rem)*-1);margin-top:calc(var(--stack-padding-spacious,1.5rem)*-1);width:calc(100% + var(--stack-padding-spacious,1.5rem)*2)}.prc-Card-CardImage-2M8DM{display:block;height:auto;width:100%}.prc-Card-CardIcon-mIMfj{align-items:center;background-color:var(--bgColor-muted,#f6f8fa);border-radius:var(--borderRadius-medium,.375rem);color:var(--fgColor-muted,#59636e);display:flex;height:var(--base-size-32,2rem);justify-content:center;width:var(--base-size-32,2rem)}.prc-Card-CardBody-W1o-l{display:grid;gap:var(--stack-gap-normal,1rem)}.prc-Card-CardContent-omZDS{display:grid;gap:var(--stack-gap-condensed,.5rem)}.prc-Card-CardHeading-3HXyS{color:var(--fgColor-default,#1f2328);font:var(--text-title-shorthand-small,600 1rem/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji");margin:0}.prc-Card-CardDescription-MnJ3F{margin:0}.prc-Card-CardDescription-MnJ3F,.prc-Card-CardMetadataContainer-K-UlH{color:var(--fgColor-muted,#59636e);font:var(--text-body-shorthand-medium,400 .875rem/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji")}.prc-Card-CardMetadataContainer-K-UlH{align-items:center;display:flex;gap:var(--stack-gap-normal,1rem)}.prc-Card-CardMetadataItem-ellY9{align-items:center;display:flex;font:var(--text-body-shorthand-small,400 .75rem/1.625 -apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji");gap:var(--stack-gap-condensed,.5rem)}.prc-Card-CardMenu-1b3uS{position:absolute;right:var(--base-size-16,1rem);top:var(--base-size-16,1rem);z-index:1}
|
|
2
|
+
/*# sourceMappingURL=Card-cec366f8.css.map */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/Card/Card.module.css.js"],"names":[],"mappings":"AAAA,qBAOE,4CAAwC,CAFxC,gFAAgE,CAChE,kFAAuC,CALvC,YAAa,CAOb,gCAA4B,CAJ5B,+BAAgC,CADhC,eAAgB,CADhB,iBA6BF,CArBE,+CACE,8CACF,CAEA,gDACE,gDACF,CAEA,0CAEE,4CACF,CAEA,6CAEE,4CACF,CAEA,wCACE,SACF,CAGF,2BACE,aAAc,CAEd,WAAY,CADZ,UAEF,CAEA,qCAIE,yDAAqD,CADrD,0DAAsD,CADtD,wDAAoD,CAGpD,yDAEF,CAEA,0BACE,aAAc,CAEd,WAAY,CADZ,UAEF,CAEA,yBAEE,kBAAmB,CAKnB,6CAAsC,CADtC,gDAAyC,CAEzC,kCAA2B,CAP3B,YAAa,CAIb,+BAA2B,CAF3B,sBAAuB,CACvB,8BAKF,CAEA,yBACE,YAAa,CACb,gCACF,CAEA,4BACE,YAAa,CACb,oCACF,CAEA,4BAEE,oCAA6B,CAD7B,2KAAuC,CAEvC,QACF,CAEA,gCAGE,QACF,CAEA,sEAJE,kCAA2B,CAD3B,8KAWF,CANA,sCAEE,kBAAmB,CADnB,YAAa,CAEb,gCAGF,CAEA,iCAEE,kBAAmB,CADnB,YAAa,CAGb,8KAAsC,CADtC,oCAEF,CAEA,
|
|
1
|
+
{"version":3,"sources":["../src/Card/Card.module.css.js"],"names":[],"mappings":"AAAA,qBAOE,4CAAwC,CAFxC,gFAAgE,CAChE,kFAAuC,CALvC,YAAa,CAOb,gCAA4B,CAJ5B,+BAAgC,CADhC,eAAgB,CADhB,iBA6BF,CArBE,+CACE,8CACF,CAEA,gDACE,gDACF,CAEA,0CAEE,4CACF,CAEA,6CAEE,4CACF,CAEA,wCACE,SACF,CAGF,2BACE,aAAc,CAEd,WAAY,CADZ,UAEF,CAEA,qCAIE,yDAAqD,CADrD,0DAAsD,CADtD,wDAAoD,CAGpD,yDAEF,CAEA,0BACE,aAAc,CAEd,WAAY,CADZ,UAEF,CAEA,yBAEE,kBAAmB,CAKnB,6CAAsC,CADtC,gDAAyC,CAEzC,kCAA2B,CAP3B,YAAa,CAIb,+BAA2B,CAF3B,sBAAuB,CACvB,8BAKF,CAEA,yBACE,YAAa,CACb,gCACF,CAEA,4BACE,YAAa,CACb,oCACF,CAEA,4BAEE,oCAA6B,CAD7B,2KAAuC,CAEvC,QACF,CAEA,gCAGE,QACF,CAEA,sEAJE,kCAA2B,CAD3B,8KAWF,CANA,sCAEE,kBAAmB,CADnB,YAAa,CAEb,gCAGF,CAEA,iCAEE,kBAAmB,CADnB,YAAa,CAGb,8KAAsC,CADtC,oCAEF,CAEA,yBACE,iBAAkB,CAElB,8BAA0B,CAD1B,4BAAwB,CAExB,SACF","file":"Card-cec366f8.css","sourcesContent":[".Card {\n display: grid;\n position: relative;\n overflow: hidden;\n grid-auto-rows: max-content auto;\n border: var(--borderWidth-thin) solid var(--borderColor-default);\n box-shadow: var(--shadow-resting-small);\n background-color: var(--bgColor-default);\n gap: var(--stack-gap-normal);\n\n &[data-border-radius='large'] {\n border-radius: var(--borderRadius-large);\n }\n\n &[data-border-radius='medium'] {\n border-radius: var(--borderRadius-medium);\n }\n\n &[data-padding='normal'] {\n /* stylelint-disable-next-line primer/spacing */\n padding: var(--stack-padding-spacious);\n }\n\n &[data-padding='condensed'] {\n /* stylelint-disable-next-line primer/spacing */\n padding: var(--stack-padding-condensed);\n }\n\n &[data-padding='none'] {\n padding: 0;\n }\n}\n\n.CardHeader {\n display: block;\n width: 100%;\n height: auto;\n}\n\n.CardHeaderEdgeToEdge {\n /* stylelint-disable primer/spacing */\n margin-top: calc(-1 * var(--stack-padding-spacious));\n margin-right: calc(-1 * var(--stack-padding-spacious));\n margin-left: calc(-1 * var(--stack-padding-spacious));\n width: calc(100% + 2 * var(--stack-padding-spacious));\n /* stylelint-enable primer/spacing */\n}\n\n.CardImage {\n display: block;\n width: 100%;\n height: auto;\n}\n\n.CardIcon {\n display: flex;\n align-items: center;\n justify-content: center;\n width: var(--base-size-32);\n height: var(--base-size-32);\n border-radius: var(--borderRadius-medium);\n background-color: var(--bgColor-muted);\n color: var(--fgColor-muted);\n}\n\n.CardBody {\n display: grid;\n gap: var(--stack-gap-normal);\n}\n\n.CardContent {\n display: grid;\n gap: var(--stack-gap-condensed);\n}\n\n.CardHeading {\n font: var(--text-title-shorthand-small);\n color: var(--fgColor-default);\n margin: 0;\n}\n\n.CardDescription {\n font: var(--text-body-shorthand-medium);\n color: var(--fgColor-muted);\n margin: 0;\n}\n\n.CardMetadataContainer {\n display: flex;\n align-items: center;\n gap: var(--stack-gap-normal);\n font: var(--text-body-shorthand-medium);\n color: var(--fgColor-muted);\n}\n\n.CardMetadataItem {\n display: flex;\n align-items: center;\n gap: var(--stack-gap-condensed);\n font: var(--text-body-shorthand-small);\n}\n\n.CardMenu {\n position: absolute;\n top: var(--base-size-16);\n right: var(--base-size-16);\n z-index: 1;\n}\n"]}
|
package/dist/Card/Card.d.ts
CHANGED
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
export type CardProps = React.ComponentPropsWithoutRef<'div'> & {
|
|
3
|
+
/**
|
|
4
|
+
* Provide an optional className to add to the outermost element rendered by
|
|
5
|
+
* the Card
|
|
6
|
+
*/
|
|
6
7
|
className?: string;
|
|
7
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* Controls the internal padding of the Card.
|
|
10
|
+
* @default 'normal'
|
|
11
|
+
*/
|
|
8
12
|
padding?: 'none' | 'condensed' | 'normal';
|
|
9
|
-
/** Border radius. @default 'large' */
|
|
10
|
-
borderRadius?: 'medium' | 'large';
|
|
11
13
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
+
* Controls the border radius of the Card.
|
|
15
|
+
* @default 'large'
|
|
14
16
|
*/
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
+
borderRadius?: 'medium' | 'large';
|
|
18
|
+
};
|
|
17
19
|
type HeadingLevel = 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
18
20
|
type HeadingProps = React.ComponentPropsWithoutRef<'h3'> & {
|
|
19
21
|
/**
|
|
@@ -23,9 +25,6 @@ type HeadingProps = React.ComponentPropsWithoutRef<'h3'> & {
|
|
|
23
25
|
children: React.ReactNode;
|
|
24
26
|
};
|
|
25
27
|
type DescriptionProps = React.ComponentPropsWithoutRef<'p'> & {
|
|
26
|
-
/**
|
|
27
|
-
* Card description. Rendered as a `<p>`, so keep it to flowing text.
|
|
28
|
-
*/
|
|
29
28
|
children: React.ReactNode;
|
|
30
29
|
};
|
|
31
30
|
type IconProps = {
|
|
@@ -49,58 +48,37 @@ type ImageProps = React.ComponentPropsWithoutRef<'img'> & {
|
|
|
49
48
|
*/
|
|
50
49
|
alt?: string;
|
|
51
50
|
};
|
|
52
|
-
type
|
|
53
|
-
/** Interactive control for the top-right corner of the card. */
|
|
51
|
+
type MenuProps = {
|
|
54
52
|
children: React.ReactNode;
|
|
55
53
|
};
|
|
56
54
|
type MetadataProps = React.ComponentPropsWithoutRef<'div'> & {
|
|
57
|
-
/**
|
|
58
|
-
* Metadata row at the bottom of the card. Any content works: text, icons,
|
|
59
|
-
* a `Label`, an `Octicon`.
|
|
60
|
-
*/
|
|
61
55
|
children: React.ReactNode;
|
|
62
56
|
};
|
|
63
|
-
declare const CardImpl: <
|
|
64
|
-
/** Optional className for the root element. */
|
|
65
|
-
className?: string;
|
|
66
|
-
/** Internal padding. @default 'normal' */
|
|
67
|
-
padding?: "none" | "condensed" | "normal";
|
|
68
|
-
/** Border radius. @default 'large' */
|
|
69
|
-
borderRadius?: "medium" | "large";
|
|
57
|
+
declare const CardImpl: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
70
58
|
/**
|
|
71
|
-
*
|
|
72
|
-
*
|
|
59
|
+
* Provide an optional className to add to the outermost element rendered by
|
|
60
|
+
* the Card
|
|
73
61
|
*/
|
|
74
|
-
children: React.ReactNode;
|
|
75
|
-
} extends infer T ? T extends React.ComponentPropsWithRef<React.ElementType extends As ? "div" : As> & {
|
|
76
|
-
/** Optional className for the root element. */
|
|
77
62
|
className?: string;
|
|
78
|
-
/**
|
|
63
|
+
/**
|
|
64
|
+
* Controls the internal padding of the Card.
|
|
65
|
+
* @default 'normal'
|
|
66
|
+
*/
|
|
79
67
|
padding?: "none" | "condensed" | "normal";
|
|
80
|
-
/** Border radius. @default 'large' */
|
|
81
|
-
borderRadius?: "medium" | "large";
|
|
82
68
|
/**
|
|
83
|
-
*
|
|
84
|
-
*
|
|
69
|
+
* Controls the border radius of the Card.
|
|
70
|
+
* @default 'large'
|
|
85
71
|
*/
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
var displayName: string;
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Heading shown at the top of a Card.
|
|
100
|
-
*
|
|
101
|
-
* When the parent Card uses `as="section"`, the heading's `id` is
|
|
102
|
-
* automatically wired to the section's `aria-labelledby`.
|
|
103
|
-
*/
|
|
72
|
+
borderRadius?: "medium" | "large";
|
|
73
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
74
|
+
declare const CardIcon: {
|
|
75
|
+
({ icon: IconComponent, "aria-label": ariaLabel, className }: IconProps): React.JSX.Element;
|
|
76
|
+
displayName: string;
|
|
77
|
+
};
|
|
78
|
+
declare const CardImage: {
|
|
79
|
+
({ src, alt, className, ...rest }: ImageProps): React.JSX.Element;
|
|
80
|
+
displayName: string;
|
|
81
|
+
};
|
|
104
82
|
declare const CardHeading: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "ref"> & {
|
|
105
83
|
/**
|
|
106
84
|
* The heading level to render. Defaults to 'h3'.
|
|
@@ -109,34 +87,20 @@ declare const CardHeading: React.ForwardRefExoticComponent<Omit<React.DetailedHT
|
|
|
109
87
|
children: React.ReactNode;
|
|
110
88
|
} & React.RefAttributes<HTMLHeadingElement>>;
|
|
111
89
|
declare const CardDescription: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref"> & {
|
|
112
|
-
/**
|
|
113
|
-
* Card description. Rendered as a `<p>`, so keep it to flowing text.
|
|
114
|
-
*/
|
|
115
90
|
children: React.ReactNode;
|
|
116
91
|
} & React.RefAttributes<HTMLParagraphElement>>;
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
* Project Alpha"`, not just `"More options"`) so users can tell which card
|
|
122
|
-
* the action applies to when several cards are visible.
|
|
123
|
-
*/
|
|
124
|
-
declare function CardAction({ children }: ActionProps): React.JSX.Element;
|
|
125
|
-
declare namespace CardAction {
|
|
126
|
-
var displayName: string;
|
|
127
|
-
}
|
|
92
|
+
declare const CardMenu: {
|
|
93
|
+
({ children }: MenuProps): React.JSX.Element;
|
|
94
|
+
displayName: string;
|
|
95
|
+
};
|
|
128
96
|
declare const CardMetadata: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
129
|
-
/**
|
|
130
|
-
* Metadata row at the bottom of the card. Any content works: text, icons,
|
|
131
|
-
* a `Label`, an `Octicon`.
|
|
132
|
-
*/
|
|
133
97
|
children: React.ReactNode;
|
|
134
98
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
135
|
-
export { CardImpl, CardIcon, CardImage, CardHeading, CardDescription,
|
|
99
|
+
export { CardImpl, CardIcon, CardImage, CardHeading, CardDescription, CardMenu, CardMetadata };
|
|
136
100
|
export type { HeadingProps as CardHeadingProps };
|
|
137
101
|
export type { DescriptionProps as CardDescriptionProps };
|
|
138
102
|
export type { IconProps as CardIconProps };
|
|
139
103
|
export type { ImageProps as CardImageProps };
|
|
140
|
-
export type {
|
|
104
|
+
export type { MenuProps as CardMenuProps };
|
|
141
105
|
export type { MetadataProps as CardMetadataProps };
|
|
142
106
|
//# sourceMappingURL=Card.d.ts.map
|
package/dist/Card/Card.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../src/Card/Card.tsx"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../src/Card/Card.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmB,MAAM,OAAO,CAAA;AAGvC,MAAM,MAAM,SAAS,GAAG,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,GAAG;IAC9D;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,QAAQ,CAAA;IAEzC;;;OAGG;IACH,YAAY,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAA;CAClC,CAAA;AAED,KAAK,YAAY,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;AAEpD,KAAK,YAAY,GAAG,KAAK,CAAC,wBAAwB,CAAC,IAAI,CAAC,GAAG;IACzD;;OAEG;IACH,EAAE,CAAC,EAAE,YAAY,CAAA;IACjB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B,CAAA;AAED,KAAK,gBAAgB,GAAG,KAAK,CAAC,wBAAwB,CAAC,GAAG,CAAC,GAAG;IAC5D,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B,CAAA;AAED,KAAK,SAAS,GAAG;IACf;;OAEG;IACH,IAAI,EAAE,KAAK,CAAC,WAAW,CAAA;IACvB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,KAAK,UAAU,GAAG,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,GAAG;IACxD;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;IACX;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,CAAA;AAED,KAAK,SAAS,GAAG;IACf,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B,CAAA;AAED,KAAK,aAAa,GAAG,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,GAAG;IAC3D,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B,CAAA;AAED,QAAA,MAAM,QAAQ;IAhEZ;;;OAGG;gBACS,MAAM;IAElB;;;OAGG;cACO,MAAM,GAAG,WAAW,GAAG,QAAQ;IAEzC;;;OAGG;mBACY,QAAQ,GAAG,OAAO;wCAoHjC,CAAA;AAEF,QAAA,MAAM,QAAQ;kEAA+D,SAAS;;CAWrF,CAAA;AAID,QAAA,MAAM,SAAS;uCAAyC,UAAU;;CAEjE,CAAA;AAID,QAAA,MAAM,WAAW;IArIf;;OAEG;SACE,YAAY;cACP,KAAK,CAAC,SAAS;4CA0IzB,CAAA;AAEF,QAAA,MAAM,eAAe;cAxIT,KAAK,CAAC,SAAS;8CAiJzB,CAAA;AAEF,QAAA,MAAM,QAAQ;mBAAgB,SAAS;;CAEtC,CAAA;AAID,QAAA,MAAM,YAAY;cA1HN,KAAK,CAAC,SAAS;wCAmIzB,CAAA;AAEF,OAAO,EAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,eAAe,EAAE,QAAQ,EAAE,YAAY,EAAC,CAAA;AAC5F,YAAY,EAAC,YAAY,IAAI,gBAAgB,EAAC,CAAA;AAC9C,YAAY,EAAC,gBAAgB,IAAI,oBAAoB,EAAC,CAAA;AACtD,YAAY,EAAC,SAAS,IAAI,aAAa,EAAC,CAAA;AACxC,YAAY,EAAC,UAAU,IAAI,cAAc,EAAC,CAAA;AAC1C,YAAY,EAAC,SAAS,IAAI,aAAa,EAAC,CAAA;AACxC,YAAY,EAAC,aAAa,IAAI,iBAAiB,EAAC,CAAA"}
|
package/dist/Card/Card.js
CHANGED
|
@@ -1,39 +1,43 @@
|
|
|
1
1
|
import { c } from 'react-compiler-runtime';
|
|
2
2
|
import { clsx } from 'clsx';
|
|
3
|
-
import React, { forwardRef
|
|
3
|
+
import React, { forwardRef } from 'react';
|
|
4
4
|
import classes from './Card.module.css.js';
|
|
5
|
-
import {
|
|
6
|
-
import { useId } from '../hooks/useId.js';
|
|
7
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
5
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
8
6
|
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
7
|
+
const CardImpl = /*#__PURE__*/forwardRef(function Card(t0, ref) {
|
|
8
|
+
const $ = c(53);
|
|
9
|
+
let children;
|
|
10
|
+
let className;
|
|
11
|
+
let rest;
|
|
12
|
+
let t1;
|
|
13
|
+
let t2;
|
|
14
|
+
if ($[0] !== t0) {
|
|
15
|
+
({
|
|
16
|
+
children,
|
|
17
|
+
className,
|
|
18
|
+
padding: t1,
|
|
19
|
+
borderRadius: t2,
|
|
20
|
+
...rest
|
|
21
|
+
} = t0);
|
|
22
|
+
$[0] = t0;
|
|
23
|
+
$[1] = children;
|
|
24
|
+
$[2] = className;
|
|
25
|
+
$[3] = rest;
|
|
26
|
+
$[4] = t1;
|
|
27
|
+
$[5] = t2;
|
|
28
|
+
} else {
|
|
29
|
+
children = $[1];
|
|
30
|
+
className = $[2];
|
|
31
|
+
rest = $[3];
|
|
32
|
+
t1 = $[4];
|
|
33
|
+
t2 = $[5];
|
|
28
34
|
}
|
|
29
|
-
|
|
30
|
-
|
|
35
|
+
const padding = t1 === undefined ? "normal" : t1;
|
|
36
|
+
const borderRadius = t2 === undefined ? "large" : t2;
|
|
31
37
|
let description;
|
|
32
38
|
let heading;
|
|
33
39
|
let menu;
|
|
34
40
|
let metadata;
|
|
35
|
-
let t10;
|
|
36
|
-
let t11;
|
|
37
41
|
let t3;
|
|
38
42
|
let t4;
|
|
39
43
|
let t5;
|
|
@@ -41,8 +45,8 @@ function CardComponent(props, ref) {
|
|
|
41
45
|
let t7;
|
|
42
46
|
let t8;
|
|
43
47
|
let t9;
|
|
44
|
-
if ($[
|
|
45
|
-
|
|
48
|
+
if ($[6] !== borderRadius || $[7] !== children || $[8] !== className || $[9] !== padding || $[10] !== ref || $[11] !== rest) {
|
|
49
|
+
t9 = Symbol.for("react.early_return_sentinel");
|
|
46
50
|
bb0: {
|
|
47
51
|
let icon = null;
|
|
48
52
|
let image = null;
|
|
@@ -70,7 +74,7 @@ function CardComponent(props, ref) {
|
|
|
70
74
|
if (child.type === CardMetadata) {
|
|
71
75
|
metadata = child;
|
|
72
76
|
} else {
|
|
73
|
-
if (child.type ===
|
|
77
|
+
if (child.type === CardMenu) {
|
|
74
78
|
menu = child;
|
|
75
79
|
}
|
|
76
80
|
}
|
|
@@ -80,111 +84,64 @@ function CardComponent(props, ref) {
|
|
|
80
84
|
}
|
|
81
85
|
}
|
|
82
86
|
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
|
-
}
|
|
88
87
|
if (!hasSlotChildren) {
|
|
89
|
-
let
|
|
90
|
-
if ($[23] !==
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
$[23] = titleId;
|
|
95
|
-
$[24] = t12;
|
|
88
|
+
let t10;
|
|
89
|
+
if ($[23] !== className) {
|
|
90
|
+
t10 = clsx(classes.Card, className);
|
|
91
|
+
$[23] = className;
|
|
92
|
+
$[24] = t10;
|
|
96
93
|
} else {
|
|
97
|
-
|
|
94
|
+
t10 = $[24];
|
|
98
95
|
}
|
|
99
|
-
let
|
|
100
|
-
if ($[25] !==
|
|
101
|
-
|
|
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, {
|
|
96
|
+
let t11;
|
|
97
|
+
if ($[25] !== borderRadius || $[26] !== children || $[27] !== padding || $[28] !== ref || $[29] !== rest || $[30] !== t10) {
|
|
98
|
+
t11 = /*#__PURE__*/jsx("div", {
|
|
110
99
|
ref: ref,
|
|
111
|
-
className:
|
|
112
|
-
"data-component": "Card",
|
|
100
|
+
className: t10,
|
|
113
101
|
"data-padding": padding,
|
|
114
102
|
"data-border-radius": borderRadius,
|
|
115
103
|
...rest,
|
|
116
104
|
children: children
|
|
117
105
|
});
|
|
118
|
-
$[
|
|
119
|
-
$[
|
|
120
|
-
$[
|
|
121
|
-
$[
|
|
122
|
-
$[
|
|
123
|
-
$[
|
|
124
|
-
$[
|
|
125
|
-
$[34] = t14;
|
|
106
|
+
$[25] = borderRadius;
|
|
107
|
+
$[26] = children;
|
|
108
|
+
$[27] = padding;
|
|
109
|
+
$[28] = ref;
|
|
110
|
+
$[29] = rest;
|
|
111
|
+
$[30] = t10;
|
|
112
|
+
$[31] = t11;
|
|
126
113
|
} else {
|
|
127
|
-
|
|
114
|
+
t11 = $[31];
|
|
128
115
|
}
|
|
129
|
-
|
|
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;
|
|
116
|
+
t9 = t11;
|
|
142
117
|
break bb0;
|
|
143
118
|
}
|
|
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;
|
|
155
119
|
t3 = ref;
|
|
156
|
-
if ($[
|
|
120
|
+
if ($[32] !== className) {
|
|
157
121
|
t4 = clsx(classes.Card, className);
|
|
158
|
-
$[
|
|
159
|
-
$[
|
|
122
|
+
$[32] = className;
|
|
123
|
+
$[33] = t4;
|
|
160
124
|
} else {
|
|
161
|
-
t4 = $[
|
|
125
|
+
t4 = $[33];
|
|
162
126
|
}
|
|
163
|
-
t5 =
|
|
164
|
-
t6 =
|
|
165
|
-
t7 =
|
|
166
|
-
t8 =
|
|
167
|
-
t9 = (image || icon) && /*#__PURE__*/jsx("div", {
|
|
127
|
+
t5 = padding;
|
|
128
|
+
t6 = borderRadius;
|
|
129
|
+
t7 = rest;
|
|
130
|
+
t8 = (image || icon) && /*#__PURE__*/jsx("div", {
|
|
168
131
|
className: clsx(classes.CardHeader, image && classes.CardHeaderEdgeToEdge),
|
|
169
132
|
children: image || icon
|
|
170
133
|
});
|
|
171
134
|
}
|
|
172
|
-
$[
|
|
173
|
-
$[
|
|
174
|
-
$[
|
|
175
|
-
$[
|
|
176
|
-
$[
|
|
177
|
-
$[
|
|
178
|
-
$[
|
|
179
|
-
$[
|
|
180
|
-
$[
|
|
181
|
-
$[
|
|
182
|
-
$[10] = description;
|
|
183
|
-
$[11] = heading;
|
|
184
|
-
$[12] = menu;
|
|
185
|
-
$[13] = metadata;
|
|
186
|
-
$[14] = t10;
|
|
187
|
-
$[15] = t11;
|
|
135
|
+
$[6] = borderRadius;
|
|
136
|
+
$[7] = children;
|
|
137
|
+
$[8] = className;
|
|
138
|
+
$[9] = padding;
|
|
139
|
+
$[10] = ref;
|
|
140
|
+
$[11] = rest;
|
|
141
|
+
$[12] = description;
|
|
142
|
+
$[13] = heading;
|
|
143
|
+
$[14] = menu;
|
|
144
|
+
$[15] = metadata;
|
|
188
145
|
$[16] = t3;
|
|
189
146
|
$[17] = t4;
|
|
190
147
|
$[18] = t5;
|
|
@@ -193,14 +150,10 @@ function CardComponent(props, ref) {
|
|
|
193
150
|
$[21] = t8;
|
|
194
151
|
$[22] = t9;
|
|
195
152
|
} else {
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
menu = $[12];
|
|
201
|
-
metadata = $[13];
|
|
202
|
-
t10 = $[14];
|
|
203
|
-
t11 = $[15];
|
|
153
|
+
description = $[12];
|
|
154
|
+
heading = $[13];
|
|
155
|
+
menu = $[14];
|
|
156
|
+
metadata = $[15];
|
|
204
157
|
t3 = $[16];
|
|
205
158
|
t4 = $[17];
|
|
206
159
|
t5 = $[18];
|
|
@@ -209,98 +162,80 @@ function CardComponent(props, ref) {
|
|
|
209
162
|
t8 = $[21];
|
|
210
163
|
t9 = $[22];
|
|
211
164
|
}
|
|
212
|
-
if (
|
|
213
|
-
return
|
|
165
|
+
if (t9 !== Symbol.for("react.early_return_sentinel")) {
|
|
166
|
+
return t9;
|
|
214
167
|
}
|
|
215
|
-
let
|
|
216
|
-
if ($[
|
|
217
|
-
|
|
168
|
+
let t10;
|
|
169
|
+
if ($[34] !== description || $[35] !== heading) {
|
|
170
|
+
t10 = /*#__PURE__*/jsxs("div", {
|
|
218
171
|
className: classes.CardContent,
|
|
219
172
|
children: [heading, description]
|
|
220
173
|
});
|
|
221
|
-
$[
|
|
222
|
-
$[
|
|
223
|
-
$[
|
|
174
|
+
$[34] = description;
|
|
175
|
+
$[35] = heading;
|
|
176
|
+
$[36] = t10;
|
|
224
177
|
} else {
|
|
225
|
-
|
|
178
|
+
t10 = $[36];
|
|
226
179
|
}
|
|
227
|
-
let
|
|
228
|
-
if ($[
|
|
229
|
-
|
|
180
|
+
let t11;
|
|
181
|
+
if ($[37] !== metadata) {
|
|
182
|
+
t11 = metadata ? /*#__PURE__*/jsx("div", {
|
|
230
183
|
className: classes.CardMetadataContainer,
|
|
231
184
|
children: metadata
|
|
232
185
|
}) : null;
|
|
233
|
-
$[
|
|
234
|
-
$[
|
|
186
|
+
$[37] = metadata;
|
|
187
|
+
$[38] = t11;
|
|
235
188
|
} else {
|
|
236
|
-
|
|
189
|
+
t11 = $[38];
|
|
237
190
|
}
|
|
238
|
-
let
|
|
239
|
-
if ($[
|
|
240
|
-
|
|
191
|
+
let t12;
|
|
192
|
+
if ($[39] !== t10 || $[40] !== t11) {
|
|
193
|
+
t12 = /*#__PURE__*/jsxs("div", {
|
|
241
194
|
className: classes.CardBody,
|
|
242
|
-
children: [
|
|
195
|
+
children: [t10, t11]
|
|
243
196
|
});
|
|
244
|
-
$[
|
|
245
|
-
$[
|
|
246
|
-
$[
|
|
197
|
+
$[39] = t10;
|
|
198
|
+
$[40] = t11;
|
|
199
|
+
$[41] = t12;
|
|
247
200
|
} else {
|
|
248
|
-
|
|
201
|
+
t12 = $[41];
|
|
249
202
|
}
|
|
250
|
-
let
|
|
251
|
-
if ($[
|
|
252
|
-
|
|
253
|
-
className: classes.
|
|
203
|
+
let t13;
|
|
204
|
+
if ($[42] !== menu) {
|
|
205
|
+
t13 = menu ? /*#__PURE__*/jsx("div", {
|
|
206
|
+
className: classes.CardMenu,
|
|
254
207
|
children: menu
|
|
255
208
|
}) : null;
|
|
256
|
-
$[
|
|
257
|
-
$[
|
|
209
|
+
$[42] = menu;
|
|
210
|
+
$[43] = t13;
|
|
258
211
|
} else {
|
|
259
|
-
|
|
212
|
+
t13 = $[43];
|
|
260
213
|
}
|
|
261
|
-
let
|
|
262
|
-
if ($[
|
|
263
|
-
|
|
214
|
+
let t14;
|
|
215
|
+
if ($[44] !== t12 || $[45] !== t13 || $[46] !== t3 || $[47] !== t4 || $[48] !== t5 || $[49] !== t6 || $[50] !== t7 || $[51] !== t8) {
|
|
216
|
+
t14 = /*#__PURE__*/jsxs("div", {
|
|
264
217
|
ref: t3,
|
|
265
218
|
className: t4,
|
|
266
|
-
"data-
|
|
267
|
-
"data-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
children: [t9, t14, t15]
|
|
219
|
+
"data-padding": t5,
|
|
220
|
+
"data-border-radius": t6,
|
|
221
|
+
...t7,
|
|
222
|
+
children: [t8, t12, t13]
|
|
271
223
|
});
|
|
272
|
-
$[
|
|
273
|
-
$[
|
|
274
|
-
$[
|
|
275
|
-
$[
|
|
276
|
-
$[
|
|
277
|
-
$[
|
|
278
|
-
$[
|
|
279
|
-
$[
|
|
280
|
-
$[
|
|
281
|
-
$[61] = t9;
|
|
282
|
-
$[62] = t16;
|
|
283
|
-
} else {
|
|
284
|
-
t16 = $[62];
|
|
285
|
-
}
|
|
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;
|
|
224
|
+
$[44] = t12;
|
|
225
|
+
$[45] = t13;
|
|
226
|
+
$[46] = t3;
|
|
227
|
+
$[47] = t4;
|
|
228
|
+
$[48] = t5;
|
|
229
|
+
$[49] = t6;
|
|
230
|
+
$[50] = t7;
|
|
231
|
+
$[51] = t8;
|
|
232
|
+
$[52] = t14;
|
|
296
233
|
} else {
|
|
297
|
-
|
|
234
|
+
t14 = $[52];
|
|
298
235
|
}
|
|
299
|
-
return
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
const CardImpl = fixedForwardRef(CardComponent);
|
|
303
|
-
function CardIcon(t0) {
|
|
236
|
+
return t14;
|
|
237
|
+
});
|
|
238
|
+
const CardIcon = t0 => {
|
|
304
239
|
const $ = c(10);
|
|
305
240
|
const {
|
|
306
241
|
icon: IconComponent,
|
|
@@ -329,7 +264,6 @@ function CardIcon(t0) {
|
|
|
329
264
|
if ($[4] !== ariaLabel || $[5] !== t1 || $[6] !== t2 || $[7] !== t3 || $[8] !== t4) {
|
|
330
265
|
t5 = /*#__PURE__*/jsx("span", {
|
|
331
266
|
className: t1,
|
|
332
|
-
"data-component": "Card.Icon",
|
|
333
267
|
role: t2,
|
|
334
268
|
"aria-label": ariaLabel,
|
|
335
269
|
"aria-hidden": t3,
|
|
@@ -345,9 +279,9 @@ function CardIcon(t0) {
|
|
|
345
279
|
t5 = $[9];
|
|
346
280
|
}
|
|
347
281
|
return t5;
|
|
348
|
-
}
|
|
282
|
+
};
|
|
349
283
|
CardIcon.displayName = 'Card.Icon';
|
|
350
|
-
|
|
284
|
+
const CardImage = t0 => {
|
|
351
285
|
const $ = c(12);
|
|
352
286
|
let className;
|
|
353
287
|
let rest;
|
|
@@ -383,11 +317,10 @@ function CardImage(t0) {
|
|
|
383
317
|
let t3;
|
|
384
318
|
if ($[7] !== alt || $[8] !== rest || $[9] !== src || $[10] !== t2) {
|
|
385
319
|
t3 = /*#__PURE__*/jsx("img", {
|
|
386
|
-
...rest,
|
|
387
320
|
src: src,
|
|
388
321
|
alt: alt,
|
|
389
322
|
className: t2,
|
|
390
|
-
|
|
323
|
+
...rest
|
|
391
324
|
});
|
|
392
325
|
$[7] = alt;
|
|
393
326
|
$[8] = rest;
|
|
@@ -398,21 +331,12 @@ function CardImage(t0) {
|
|
|
398
331
|
t3 = $[11];
|
|
399
332
|
}
|
|
400
333
|
return t3;
|
|
401
|
-
}
|
|
334
|
+
};
|
|
402
335
|
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
|
-
*/
|
|
410
336
|
const CardHeading = /*#__PURE__*/forwardRef(function CardHeading(t0, ref) {
|
|
411
|
-
|
|
412
|
-
const $ = c(15);
|
|
337
|
+
const $ = c(13);
|
|
413
338
|
let children;
|
|
414
339
|
let className;
|
|
415
|
-
let id;
|
|
416
340
|
let rest;
|
|
417
341
|
let t1;
|
|
418
342
|
if ($[0] !== t0) {
|
|
@@ -420,58 +344,47 @@ const CardHeading = /*#__PURE__*/forwardRef(function CardHeading(t0, ref) {
|
|
|
420
344
|
as: t1,
|
|
421
345
|
children,
|
|
422
346
|
className,
|
|
423
|
-
id,
|
|
424
347
|
...rest
|
|
425
348
|
} = t0);
|
|
426
349
|
$[0] = t0;
|
|
427
350
|
$[1] = children;
|
|
428
351
|
$[2] = className;
|
|
429
|
-
$[3] =
|
|
430
|
-
$[4] =
|
|
431
|
-
$[5] = t1;
|
|
352
|
+
$[3] = rest;
|
|
353
|
+
$[4] = t1;
|
|
432
354
|
} else {
|
|
433
355
|
children = $[1];
|
|
434
356
|
className = $[2];
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
t1 = $[5];
|
|
357
|
+
rest = $[3];
|
|
358
|
+
t1 = $[4];
|
|
438
359
|
}
|
|
439
360
|
const Component = t1 === undefined ? "h3" : t1;
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
if ($[6] !== className) {
|
|
446
|
-
t3 = clsx(classes.CardHeading, className);
|
|
447
|
-
$[6] = className;
|
|
448
|
-
$[7] = t3;
|
|
361
|
+
let t2;
|
|
362
|
+
if ($[5] !== className) {
|
|
363
|
+
t2 = clsx(classes.CardHeading, className);
|
|
364
|
+
$[5] = className;
|
|
365
|
+
$[6] = t2;
|
|
449
366
|
} else {
|
|
450
|
-
|
|
367
|
+
t2 = $[6];
|
|
451
368
|
}
|
|
452
|
-
let
|
|
453
|
-
if ($[
|
|
454
|
-
|
|
455
|
-
...rest,
|
|
369
|
+
let t3;
|
|
370
|
+
if ($[7] !== Component || $[8] !== children || $[9] !== ref || $[10] !== rest || $[11] !== t2) {
|
|
371
|
+
t3 = /*#__PURE__*/jsx(Component, {
|
|
456
372
|
ref: ref,
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
"data-component": "Card.Heading",
|
|
373
|
+
className: t2,
|
|
374
|
+
...rest,
|
|
460
375
|
children: children
|
|
461
376
|
});
|
|
462
|
-
$[
|
|
463
|
-
$[
|
|
464
|
-
$[
|
|
465
|
-
$[
|
|
466
|
-
$[
|
|
467
|
-
$[
|
|
468
|
-
$[14] = t4;
|
|
377
|
+
$[7] = Component;
|
|
378
|
+
$[8] = children;
|
|
379
|
+
$[9] = ref;
|
|
380
|
+
$[10] = rest;
|
|
381
|
+
$[11] = t2;
|
|
382
|
+
$[12] = t3;
|
|
469
383
|
} else {
|
|
470
|
-
|
|
384
|
+
t3 = $[12];
|
|
471
385
|
}
|
|
472
|
-
return
|
|
386
|
+
return t3;
|
|
473
387
|
});
|
|
474
|
-
CardHeading.displayName = 'Card.Heading';
|
|
475
388
|
const CardDescription = /*#__PURE__*/forwardRef(function CardDescription(t0, ref) {
|
|
476
389
|
const $ = c(11);
|
|
477
390
|
let children;
|
|
@@ -503,10 +416,9 @@ const CardDescription = /*#__PURE__*/forwardRef(function CardDescription(t0, ref
|
|
|
503
416
|
let t2;
|
|
504
417
|
if ($[6] !== children || $[7] !== ref || $[8] !== rest || $[9] !== t1) {
|
|
505
418
|
t2 = /*#__PURE__*/jsx("p", {
|
|
506
|
-
...rest,
|
|
507
419
|
ref: ref,
|
|
508
420
|
className: t1,
|
|
509
|
-
|
|
421
|
+
...rest,
|
|
510
422
|
children: children
|
|
511
423
|
});
|
|
512
424
|
$[6] = children;
|
|
@@ -519,24 +431,14 @@ const CardDescription = /*#__PURE__*/forwardRef(function CardDescription(t0, ref
|
|
|
519
431
|
}
|
|
520
432
|
return t2;
|
|
521
433
|
});
|
|
522
|
-
|
|
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) {
|
|
434
|
+
const CardMenu = t0 => {
|
|
532
435
|
const $ = c(2);
|
|
533
436
|
const {
|
|
534
437
|
children
|
|
535
438
|
} = t0;
|
|
536
439
|
let t1;
|
|
537
440
|
if ($[0] !== children) {
|
|
538
|
-
t1 = /*#__PURE__*/jsx(
|
|
539
|
-
"data-component": "Card.Action",
|
|
441
|
+
t1 = /*#__PURE__*/jsx(Fragment, {
|
|
540
442
|
children: children
|
|
541
443
|
});
|
|
542
444
|
$[0] = children;
|
|
@@ -545,8 +447,8 @@ function CardAction(t0) {
|
|
|
545
447
|
t1 = $[1];
|
|
546
448
|
}
|
|
547
449
|
return t1;
|
|
548
|
-
}
|
|
549
|
-
|
|
450
|
+
};
|
|
451
|
+
CardMenu.displayName = 'Card.Menu';
|
|
550
452
|
const CardMetadata = /*#__PURE__*/forwardRef(function CardMetadata(t0, ref) {
|
|
551
453
|
const $ = c(11);
|
|
552
454
|
let children;
|
|
@@ -578,10 +480,9 @@ const CardMetadata = /*#__PURE__*/forwardRef(function CardMetadata(t0, ref) {
|
|
|
578
480
|
let t2;
|
|
579
481
|
if ($[6] !== children || $[7] !== ref || $[8] !== rest || $[9] !== t1) {
|
|
580
482
|
t2 = /*#__PURE__*/jsx("div", {
|
|
581
|
-
...rest,
|
|
582
483
|
ref: ref,
|
|
583
484
|
className: t1,
|
|
584
|
-
|
|
485
|
+
...rest,
|
|
585
486
|
children: children
|
|
586
487
|
});
|
|
587
488
|
$[6] = children;
|
|
@@ -594,6 +495,5 @@ const CardMetadata = /*#__PURE__*/forwardRef(function CardMetadata(t0, ref) {
|
|
|
594
495
|
}
|
|
595
496
|
return t2;
|
|
596
497
|
});
|
|
597
|
-
CardMetadata.displayName = 'Card.Metadata';
|
|
598
498
|
|
|
599
|
-
export {
|
|
499
|
+
export { CardDescription, CardHeading, CardIcon, CardImage, CardImpl, CardMenu, CardMetadata };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import './Card-
|
|
1
|
+
import './Card-cec366f8.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","CardMenu":"prc-Card-CardMenu-1b3uS"};
|
|
4
4
|
|
|
5
5
|
export { classes as default };
|
package/dist/Card/index.d.ts
CHANGED
|
@@ -1,20 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
declare const Card: (<As extends "div" | "section">(props: (import("react").ComponentPropsWithRef<import("react").ElementType extends As ? "div" : As> & {
|
|
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"> & {
|
|
4
3
|
className?: string;
|
|
5
4
|
padding?: "none" | "condensed" | "normal";
|
|
6
5
|
borderRadius?: "medium" | "large";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
Icon: typeof CardIcon;
|
|
17
|
-
Image: typeof CardImage;
|
|
6
|
+
} & import("react").RefAttributes<HTMLDivElement>> & {
|
|
7
|
+
Icon: {
|
|
8
|
+
({ icon: IconComponent, "aria-label": ariaLabel, className }: CardIconProps): import("react").JSX.Element;
|
|
9
|
+
displayName: string;
|
|
10
|
+
};
|
|
11
|
+
Image: {
|
|
12
|
+
({ src, alt, className, ...rest }: CardImageProps): import("react").JSX.Element;
|
|
13
|
+
displayName: string;
|
|
14
|
+
};
|
|
18
15
|
Heading: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "ref"> & {
|
|
19
16
|
as?: "h2" | "h3" | "h4" | "h5" | "h6";
|
|
20
17
|
children: React.ReactNode;
|
|
@@ -22,11 +19,14 @@ declare const Card: (<As extends "div" | "section">(props: (import("react").Comp
|
|
|
22
19
|
Description: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref"> & {
|
|
23
20
|
children: React.ReactNode;
|
|
24
21
|
} & import("react").RefAttributes<HTMLParagraphElement>>;
|
|
25
|
-
|
|
22
|
+
Menu: {
|
|
23
|
+
({ children }: CardMenuProps): import("react").JSX.Element;
|
|
24
|
+
displayName: string;
|
|
25
|
+
};
|
|
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, CardMenuProps, 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":"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"}
|
package/dist/Card/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { CardImpl, CardMetadata,
|
|
1
|
+
import { CardImpl, CardMetadata, CardMenu, CardDescription, CardHeading, CardImage, CardIcon } from './Card.js';
|
|
2
2
|
|
|
3
3
|
const Card = Object.assign(CardImpl, {
|
|
4
4
|
Icon: CardIcon,
|
|
5
5
|
Image: CardImage,
|
|
6
6
|
Heading: CardHeading,
|
|
7
7
|
Description: CardDescription,
|
|
8
|
-
|
|
8
|
+
Menu: CardMenu,
|
|
9
9
|
Metadata: CardMetadata
|
|
10
10
|
});
|
|
11
11
|
|
|
@@ -10,7 +10,7 @@ export type { BlankslateProps } from '../Blankslate';
|
|
|
10
10
|
export { ButtonBase } from '../Button';
|
|
11
11
|
export type { ButtonBaseProps } from '../Button';
|
|
12
12
|
export { Card } from '../Card';
|
|
13
|
-
export type { CardProps, CardIconProps, CardImageProps, CardHeadingProps, CardDescriptionProps,
|
|
13
|
+
export type { CardProps, CardIconProps, CardImageProps, CardHeadingProps, CardDescriptionProps, CardMenuProps, CardMetadataProps, } from '../Card';
|
|
14
14
|
export { DataTable, Table, createColumnHelper } from '../DataTable';
|
|
15
15
|
export type { DataTableProps, TableProps, TableHeadProps, TableBodyProps, TableRowProps, TableHeaderProps, TableCellProps, TableContainerProps, TableTitleProps, TableSubtitleProps, TableActionsProps, Column, CellAlignment, ColumnWidth, UniqueRow, ObjectPaths, } from '../DataTable';
|
|
16
16
|
export * from '../Dialog';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/experimental/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAA;AACxC,YAAY,EAAC,eAAe,EAAC,MAAM,eAAe,CAAA;AAElD,OAAO,EAAC,UAAU,EAAC,MAAM,WAAW,CAAA;AACpC,YAAY,EAAC,eAAe,EAAC,MAAM,WAAW,CAAA;AAE9C,OAAO,EAAC,IAAI,EAAC,MAAM,SAAS,CAAA;AAC5B,YAAY,EACV,SAAS,EACT,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACpB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/experimental/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAA;AACxC,YAAY,EAAC,eAAe,EAAC,MAAM,eAAe,CAAA;AAElD,OAAO,EAAC,UAAU,EAAC,MAAM,WAAW,CAAA;AACpC,YAAY,EAAC,eAAe,EAAC,MAAM,WAAW,CAAA;AAE9C,OAAO,EAAC,IAAI,EAAC,MAAM,SAAS,CAAA;AAC5B,YAAY,EACV,SAAS,EACT,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACpB,aAAa,EACb,iBAAiB,GAClB,MAAM,SAAS,CAAA;AAEhB,OAAO,EAAC,SAAS,EAAE,KAAK,EAAE,kBAAkB,EAAC,MAAM,cAAc,CAAA;AACjE,YAAY,EACV,cAAc,EACd,UAAU,EACV,cAAc,EACd,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,mBAAmB,EACnB,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,MAAM,EACN,aAAa,EACb,WAAW,EACX,SAAS,EACT,WAAW,GACZ,MAAM,cAAc,CAAA;AAErB,cAAc,WAAW,CAAA;AAEzB,OAAO,EAAC,aAAa,EAAC,MAAM,kBAAkB,CAAA;AAC9C,YAAY,EAAC,kBAAkB,EAAC,MAAM,kBAAkB,CAAA;AAExD,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAA;AACxC,YAAY,EACV,eAAe,EACf,UAAU,EACV,UAAU,IAAI,oBAAoB,EAClC,YAAY,IAAI,sBAAsB,GACvC,MAAM,eAAe,CAAA;AAEtB,cAAc,WAAW,CAAA;AAEzB,cAAc,SAAS,CAAA;AAEvB,OAAO,EAAC,OAAO,EAAC,MAAM,YAAY,CAAA;AAClC,YAAY,EACV,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,yBAAyB,EACzB,0BAA0B,EAC1B,mBAAmB,GACpB,MAAM,YAAY,CAAA;AACnB,cAAc,gBAAgB,CAAA;AAC9B,OAAO,EAAC,OAAO,EAAC,MAAM,cAAc,CAAA;AACpC,YAAY,EAAC,YAAY,EAAC,MAAM,cAAc,CAAA;AAC9C,cAAc,cAAc,CAAA;AAE5B,OAAO,EAAC,gBAAgB,EAAC,MAAM,qBAAqB,CAAA;AACpD,YAAY,EAAC,qBAAqB,EAAC,MAAM,qBAAqB,CAAA;AAE9D,OAAO,EAAC,KAAK,EAAC,MAAM,UAAU,CAAA;AAC9B,YAAY,EAAC,UAAU,EAAE,cAAc,EAAC,MAAM,UAAU,CAAA;AAExD,OAAO,EAAC,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAC,MAAM,gBAAgB,CAAA;AAC9D,YAAY,EAAC,aAAa,EAAE,eAAe,EAAE,cAAc,EAAC,MAAM,gBAAgB,CAAA;AAElF,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAA;AACjD,YAAY,EAAC,oBAAoB,EAAE,uBAAuB,EAAE,yBAAyB,EAAC,MAAM,mBAAmB,CAAA;AAE/G,OAAO,EAAC,WAAW,EAAC,MAAM,aAAa,CAAA;AACvC,YAAY,EAAC,gBAAgB,EAAC,MAAM,aAAa,CAAA;AACjD,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAA;AAC5C,YAAY,EAAC,iBAAiB,EAAC,MAAM,iBAAiB,CAAA;AACtD,OAAO,EAAC,cAAc,EAAC,MAAM,mBAAmB,CAAA;AAChD,YAAY,EAAC,mBAAmB,EAAC,MAAM,mBAAmB,CAAA;AAC1D,OAAO,EAAC,YAAY,EAAE,mBAAmB,EAAE,cAAc,EAAC,MAAM,iBAAiB,CAAA;AACjF,YAAY,EAAC,iBAAiB,EAAC,MAAM,iBAAiB,CAAA;AAEtD,OAAO,EAAC,kBAAkB,EAAE,8BAA8B,EAAC,MAAM,uBAAuB,CAAA;AACxF,YAAY,EAAC,uBAAuB,EAAE,4BAA4B,EAAC,MAAM,uBAAuB,CAAA;AAChG,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAA;AACvC,YAAY,EAAC,eAAe,EAAC,MAAM,cAAc,CAAA;AAEjD,cAAc,mBAAmB,CAAA;AACjC,cAAc,QAAQ,CAAA;AAEtB,OAAO,EAAC,QAAQ,EAAC,MAAM,aAAa,CAAA;AACpC,YAAY,EAAC,aAAa,EAAE,kBAAkB,EAAC,MAAM,aAAa,CAAA"}
|
|
@@ -29,7 +29,7 @@ import type { ForwardedRef, Ref as StandardRef } from 'react';
|
|
|
29
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,15 +1,5 @@
|
|
|
1
1
|
import { c } from 'react-compiler-runtime';
|
|
2
2
|
import 'react';
|
|
3
|
-
import { reactMajorVersion, isExperimentalReactVersion } from '../utils/environment.js';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Cleanup functions for refs were introduced in React 19. For feature detection,
|
|
7
|
-
* we look to see if current version of React is >= 19 or if it is an
|
|
8
|
-
* experimental version of React
|
|
9
|
-
*
|
|
10
|
-
* @see https://react.dev/blog/2024/12/05/react-19
|
|
11
|
-
*/
|
|
12
|
-
const supportsRefCleanup = reactMajorVersion >= 19 || isExperimentalReactVersion;
|
|
13
3
|
|
|
14
4
|
/**
|
|
15
5
|
* Combine two refs of matching type (typically an external or forwarded ref and an internal `useRef` object or
|
|
@@ -48,9 +38,6 @@ function useMergedRefs(refA, refB) {
|
|
|
48
38
|
t0 = value => {
|
|
49
39
|
const cleanupA = setRef(refA, value);
|
|
50
40
|
const cleanupB = setRef(refB, value);
|
|
51
|
-
if (!supportsRefCleanup) {
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
41
|
return () => {
|
|
55
42
|
if (cleanupA) {
|
|
56
43
|
cleanupA();
|
|
@@ -3,8 +3,5 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @see https://github.com/facebook/fbjs/blob/4d1751311d3f67af2dcce2e40df8512a23c7b9c6/packages/fbjs/src/core/ExecutionEnvironment.js#L12
|
|
5
5
|
*/
|
|
6
|
-
|
|
7
|
-
declare const reactMajorVersion: number;
|
|
8
|
-
declare const isExperimentalReactVersion: boolean;
|
|
9
|
-
export { canUseDOM, reactMajorVersion, isExperimentalReactVersion };
|
|
6
|
+
export const canUseDOM: boolean;
|
|
10
7
|
//# sourceMappingURL=environment.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../../src/utils/environment.
|
|
1
|
+
{"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../../src/utils/environment.js"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,gCAA8G"}
|
|
@@ -1,24 +1,9 @@
|
|
|
1
|
-
import { version } from 'react';
|
|
2
|
-
|
|
3
1
|
/**
|
|
4
2
|
* Indicate whether current execution environment can access the DOM.
|
|
5
3
|
*
|
|
6
4
|
* @see https://github.com/facebook/fbjs/blob/4d1751311d3f67af2dcce2e40df8512a23c7b9c6/packages/fbjs/src/core/ExecutionEnvironment.js#L12
|
|
7
5
|
*/
|
|
8
|
-
// eslint-disable-next-line
|
|
6
|
+
// eslint-disable-next-line ssr-friendly/no-dom-globals-in-module-scope
|
|
9
7
|
const canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
|
|
10
8
|
|
|
11
|
-
|
|
12
|
-
// semver version, e.g.:
|
|
13
|
-
//
|
|
14
|
-
// - 19.0.0
|
|
15
|
-
// - 19.0.0-rc.1
|
|
16
|
-
// - 0.0.0-{channel}-{commit}-{time}
|
|
17
|
-
//
|
|
18
|
-
// So we only pull the first part of the version and parse it.
|
|
19
|
-
const reactVersion = version.split('.');
|
|
20
|
-
const reactMajorVersion = parseInt(reactVersion[0], 10);
|
|
21
|
-
const EXPERIMENTAL_REACT_VERSION_REGEX = /^0\.0\.0-experimental-[a-f0-9]{8}-\d{8}$/;
|
|
22
|
-
const isExperimentalReactVersion = EXPERIMENTAL_REACT_VERSION_REGEX.test(version);
|
|
23
|
-
|
|
24
|
-
export { canUseDOM, isExperimentalReactVersion, reactMajorVersion };
|
|
9
|
+
export { canUseDOM };
|
|
@@ -2126,40 +2126,18 @@
|
|
|
2126
2126
|
"stories": [
|
|
2127
2127
|
{
|
|
2128
2128
|
"id": "experimental-components-card--default",
|
|
2129
|
-
"code": "() => {\n return (\n <
|
|
2129
|
+
"code": "() => {\n return (\n <div\n style={{\n maxWidth: '400px',\n }}\n >\n <Card>\n <Card.Icon icon={RocketIcon} />\n <Card.Heading>Card Heading</Card.Heading>\n <Card.Description>\n This is a description of the card providing supplemental information.\n </Card.Description>\n <Card.Metadata>Updated 2 hours ago</Card.Metadata>\n </Card>\n </div>\n )\n}"
|
|
2130
2130
|
},
|
|
2131
2131
|
{
|
|
2132
2132
|
"id": "experimental-components-card-features--with-image",
|
|
2133
|
-
"code": "() => {\n return (\n <
|
|
2133
|
+
"code": "() => {\n return (\n <div\n style={{\n maxWidth: '400px',\n }}\n >\n <Card>\n <Card.Image src=\"https://github.com/octocat.png\" alt=\"Octocat\" />\n <Card.Heading>Card with Image</Card.Heading>\n <Card.Description>\n This card uses an edge-to-edge image instead of an icon.\n </Card.Description>\n </Card>\n </div>\n )\n}"
|
|
2134
2134
|
},
|
|
2135
2135
|
{
|
|
2136
2136
|
"id": "experimental-components-card-features--with-metadata",
|
|
2137
|
-
"code": "() => {\n return (\n <
|
|
2138
|
-
},
|
|
2139
|
-
{
|
|
2140
|
-
"id": "experimental-components-card-features--with-menu",
|
|
2141
|
-
"code": "() => {\n return (\n <Card>\n <Card.Icon icon={RepoIcon} />\n <Card.Heading>primer/react</Card.Heading>\n <Card.Description>\n {\n \"GitHub's design system implemented as React components for building consistent user interfaces.\"\n }\n </Card.Description>\n <Card.Action>\n <ActionMenu>\n <ActionMenu.Anchor>\n <IconButton\n icon={KebabHorizontalIcon}\n aria-label=\"More options for primer/react\"\n variant=\"invisible\"\n />\n </ActionMenu.Anchor>\n <ActionMenu.Overlay>\n <ActionList>\n <ActionList.Item>Star</ActionList.Item>\n <ActionList.Item>Watch</ActionList.Item>\n <ActionList.Item>Fork</ActionList.Item>\n </ActionList>\n </ActionMenu.Overlay>\n </ActionMenu>\n </Card.Action>\n </Card>\n )\n}"
|
|
2142
|
-
},
|
|
2143
|
-
{
|
|
2144
|
-
"id": "experimental-components-card-features--standalone-section",
|
|
2145
|
-
"code": "() => (\n <Card as=\"section\">\n <Card.Icon icon={RepoIcon} />\n <Card.Heading>primer/react</Card.Heading>\n <Card.Description>\n {\n 'Standalone cards render as a labelled <section> landmark. aria-labelledby is automatically wired to Card.Heading.'\n }\n </Card.Description>\n </Card>\n)"
|
|
2146
|
-
},
|
|
2147
|
-
{
|
|
2148
|
-
"id": "experimental-components-card-features--in-list",
|
|
2149
|
-
"code": "() => (\n <ul className={classes.CardList} aria-label=\"Repositories\">\n <li>\n <Card>\n <Card.Icon icon={RepoIcon} />\n <Card.Description>primer/react</Card.Description>\n <Card.Metadata>\n <StarIcon size={16} />\n 1.2k stars\n </Card.Metadata>\n </Card>\n </li>\n <li>\n <Card>\n <Card.Icon icon={RepoIcon} />\n <Card.Description>primer/css</Card.Description>\n <Card.Metadata>\n <StarIcon size={16} />\n 850 stars\n </Card.Metadata>\n </Card>\n </li>\n <li>\n <Card>\n <Card.Icon icon={RepoIcon} />\n <Card.Description>primer/octicons</Card.Description>\n <Card.Metadata>\n <StarIcon size={16} />\n 2.1k stars\n </Card.Metadata>\n </Card>\n </li>\n </ul>\n)"
|
|
2150
|
-
},
|
|
2151
|
-
{
|
|
2152
|
-
"id": "experimental-components-card-features--interactive-content",
|
|
2153
|
-
"code": "() => {\n const repos = [\n {\n name: 'primer/react',\n },\n {\n name: 'primer/css',\n },\n {\n name: 'primer/octicons',\n },\n ]\n return (\n <ul className={classes.CardList} aria-label=\"Repositories\">\n {repos.map((repo) => (\n <li key={repo.name}>\n <Card>\n <Card.Icon icon={RepoIcon} />\n <Card.Description>{repo.name}</Card.Description>\n <Card.Metadata>\n <Button leadingVisual={StarIcon} size=\"small\">\n Star <VisuallyHidden>{repo.name}</VisuallyHidden>\n </Button>\n <Button leadingVisual={RepoForkedIcon} size=\"small\">\n Fork <VisuallyHidden>{repo.name}</VisuallyHidden>\n </Button>\n </Card.Metadata>\n </Card>\n </li>\n ))}\n </ul>\n )\n}"
|
|
2137
|
+
"code": "() => {\n return (\n <div\n style={{\n maxWidth: '400px',\n }}\n >\n <Card>\n <Card.Icon icon={RepoIcon} />\n <Card.Heading>primer/react</Card.Heading>\n <Card.Description>\n {\n \"GitHub's design system implemented as React components for building consistent user interfaces.\"\n }\n </Card.Description>\n <Card.Metadata>\n <StarIcon size={16} />\n 1.2k stars\n </Card.Metadata>\n </Card>\n </div>\n )\n}"
|
|
2154
2138
|
}
|
|
2155
2139
|
],
|
|
2156
2140
|
"props": [
|
|
2157
|
-
{
|
|
2158
|
-
"name": "children",
|
|
2159
|
-
"type": "React.ReactNode",
|
|
2160
|
-
"required": true,
|
|
2161
|
-
"description": "The contents of the card. Provide either `Card.*` subcomponents (for example `Card.Heading`, `Card.Description`, `Card.Metadata`) or any custom content. A card with no children will not render."
|
|
2162
|
-
},
|
|
2163
2141
|
{
|
|
2164
2142
|
"name": "className",
|
|
2165
2143
|
"type": "string",
|
|
@@ -2176,12 +2154,6 @@
|
|
|
2176
2154
|
"type": "'medium' | 'large'",
|
|
2177
2155
|
"defaultValue": "'large'",
|
|
2178
2156
|
"description": "Controls the border radius of the Card."
|
|
2179
|
-
},
|
|
2180
|
-
{
|
|
2181
|
-
"name": "as",
|
|
2182
|
-
"type": "'div' | 'section'",
|
|
2183
|
-
"defaultValue": "'div'",
|
|
2184
|
-
"description": "The HTML element to render. Use `'section'` for **standalone** Cards (not inside a list of cards) so screen readers announce the Card as a labelled region. When `Card.Heading` is present, `aria-labelledby` is automatically wired. Use the default `'div'` when the Card is inside an `<li>` of a list of cards."
|
|
2185
2157
|
}
|
|
2186
2158
|
],
|
|
2187
2159
|
"subcomponents": [
|
|
@@ -2223,42 +2195,21 @@
|
|
|
2223
2195
|
"name": "as",
|
|
2224
2196
|
"type": "'h2' | 'h3' | 'h4' | 'h5' | 'h6'",
|
|
2225
2197
|
"defaultValue": "'h3'",
|
|
2226
|
-
"description": "The heading level to render.
|
|
2198
|
+
"description": "The heading level to render."
|
|
2227
2199
|
}
|
|
2228
2200
|
]
|
|
2229
2201
|
},
|
|
2230
2202
|
{
|
|
2231
2203
|
"name": "Card.Description",
|
|
2232
|
-
"props": [
|
|
2233
|
-
{
|
|
2234
|
-
"name": "children",
|
|
2235
|
-
"type": "React.ReactNode",
|
|
2236
|
-
"required": true,
|
|
2237
|
-
"description": "The descriptive text for the card. Rendered inside a `<p>` element so should be flowing text content."
|
|
2238
|
-
}
|
|
2239
|
-
]
|
|
2204
|
+
"props": []
|
|
2240
2205
|
},
|
|
2241
2206
|
{
|
|
2242
|
-
"name": "Card.
|
|
2243
|
-
"props": [
|
|
2244
|
-
{
|
|
2245
|
-
"name": "children",
|
|
2246
|
-
"type": "React.ReactNode",
|
|
2247
|
-
"required": true,
|
|
2248
|
-
"description": "Interactive control for the top-right corner of the card."
|
|
2249
|
-
}
|
|
2250
|
-
]
|
|
2207
|
+
"name": "Card.Menu",
|
|
2208
|
+
"props": []
|
|
2251
2209
|
},
|
|
2252
2210
|
{
|
|
2253
2211
|
"name": "Card.Metadata",
|
|
2254
|
-
"props": [
|
|
2255
|
-
{
|
|
2256
|
-
"name": "children",
|
|
2257
|
-
"type": "React.ReactNode",
|
|
2258
|
-
"required": true,
|
|
2259
|
-
"description": "Metadata content for the bottom of the card. Accepts any content: plain text, icons, or other Primer components."
|
|
2260
|
-
}
|
|
2261
|
-
]
|
|
2212
|
+
"props": []
|
|
2262
2213
|
}
|
|
2263
2214
|
]
|
|
2264
2215
|
},
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@primer/react",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.0-
|
|
4
|
+
"version": "0.0.0-20260522145907",
|
|
5
5
|
"description": "An implementation of GitHub's Primer Design System using React",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"module": "./dist/index.js",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"@github/tab-container-element": "^4.8.2",
|
|
80
80
|
"@lit-labs/react": "1.2.1",
|
|
81
81
|
"@oddbird/popover-polyfill": "^0.5.2",
|
|
82
|
-
"@primer/behaviors": "^1.10.
|
|
82
|
+
"@primer/behaviors": "^1.10.3",
|
|
83
83
|
"@primer/live-region-element": "^0.7.1",
|
|
84
84
|
"@primer/octicons-react": "^19.24.1",
|
|
85
85
|
"@primer/primitives": "10.x || 11.x",
|