@theguild/components 8.0.0-alpha-20241122154106-b3f1d666a601dc0981eb7ac83f93231cda47f9c1 → 8.0.0-alpha-20241122154733-e2568ebb58178dce6e87deb6ad60c7c41fc69f4f

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.
@@ -17,7 +17,7 @@ export { NPMBadge } from './npm-badge.mjs';
17
17
  export { GetYourAPIGameRightSection } from './get-your-api-game-right-section.mjs';
18
18
  export { HiveNavigation, HiveNavigationProps } from './hive-navigation/index.mjs';
19
19
  export { HiveFooter } from './hive-footer/index.mjs';
20
- export { AncillaryProductCard, MainProductCard, ToolsAndLibrariesCards } from './tools-and-libraries-cards/index.mjs';
20
+ export { AncillaryProductCard, MainProductCard, ProductCard, ToolsAndLibrariesCards } from './tools-and-libraries-cards/index.mjs';
21
21
  export { DecorationIsolation } from './decorations/index.mjs';
22
22
  export { CallToAction, CallToActionProps } from './call-to-action.mjs';
23
23
  export { CookiesConsent, CookiesConsentProps } from './cookies-consent.mjs';
@@ -19,7 +19,8 @@ import { HiveFooter } from "./hive-footer/index.js";
19
19
  import {
20
20
  ToolsAndLibrariesCards,
21
21
  MainProductCard,
22
- AncillaryProductCard
22
+ AncillaryProductCard,
23
+ ProductCard
23
24
  } from "./tools-and-libraries-cards";
24
25
  export * from "./decorations";
25
26
  export * from "./call-to-action";
@@ -51,5 +52,6 @@ export {
51
52
  MarketplaceList,
52
53
  MarketplaceSearch,
53
54
  NPMBadge,
55
+ ProductCard,
54
56
  ToolsAndLibrariesCards
55
57
  };
@@ -5,13 +5,12 @@ import 'react';
5
5
  declare function ToolsAndLibrariesCards({ className }: {
6
6
  className?: string;
7
7
  }): react_jsx_runtime.JSX.Element;
8
- declare function MainProductCard({ as: Root, product }: {
8
+ declare function MainProductCard({ as: Root, product, ...rest }: ProductCardProps): react_jsx_runtime.JSX.Element;
9
+ declare function AncillaryProductCard({ product, as: Root, ...rest }: ProductCardProps): react_jsx_runtime.JSX.Element;
10
+ interface ProductCardProps extends React.HTMLAttributes<HTMLElement> {
9
11
  as: 'div' | 'li';
10
12
  product: ProductInfo;
11
- }): react_jsx_runtime.JSX.Element;
12
- declare function AncillaryProductCard({ product, as: Root, }: {
13
- product: ProductInfo;
14
- as: 'div' | 'li';
15
- }): react_jsx_runtime.JSX.Element;
13
+ }
14
+ declare function ProductCard(props: ProductCardProps): react_jsx_runtime.JSX.Element;
16
15
 
17
- export { AncillaryProductCard, MainProductCard, ToolsAndLibrariesCards };
16
+ export { AncillaryProductCard, MainProductCard, ProductCard, type ProductCardProps, ToolsAndLibrariesCards };
@@ -38,7 +38,7 @@ function ToolsAndLibrariesCards({ className }) {
38
38
  }
39
39
  );
40
40
  }
41
- function MainProductCard({ as: Root, product }) {
41
+ function MainProductCard({ as: Root, product, ...rest }) {
42
42
  const Decoration = cardDecorations[product.name];
43
43
  const Icon = product.logo;
44
44
  const isHive = product.name === PRODUCTS.HIVE.name;
@@ -49,6 +49,7 @@ function MainProductCard({ as: Root, product }) {
49
49
  "hive-focus-within group relative flex-1 shrink-0 basis-[283.5px] overflow-hidden rounded-2xl bg-blue-400 text-green-1000 max-md:w-[283.5px]",
50
50
  isHive && "bg-green-1000 text-white"
51
51
  ),
52
+ ...rest,
52
53
  children: [
53
54
  /* @__PURE__ */ jsxs(
54
55
  "a",
@@ -79,15 +80,13 @@ function MainProductCard({ as: Root, product }) {
79
80
  product.name
80
81
  );
81
82
  }
82
- function AncillaryProductCard({
83
- product,
84
- as: Root
85
- }) {
83
+ function AncillaryProductCard({ product, as: Root, ...rest }) {
86
84
  const Logo = product.logo;
87
85
  return /* @__PURE__ */ jsx(
88
86
  Root,
89
87
  {
90
88
  className: "hive-focus-within shrink-0 basis-[283.5px] rounded-2xl bg-beige-200 text-green-1000 transition-colors duration-500 hover:bg-beige-400 max-sm:min-w-[283.5px]",
89
+ ...rest,
91
90
  children: /* @__PURE__ */ jsxs(
92
91
  "a",
93
92
  {
@@ -113,8 +112,13 @@ function AncillaryProductCard({
113
112
  product.name
114
113
  );
115
114
  }
115
+ function ProductCard(props) {
116
+ const isMainProduct = FOUR_MAIN_PRODUCTS.map((p) => p.name).includes(props.product.name);
117
+ return isMainProduct ? /* @__PURE__ */ jsx(MainProductCard, { ...props }) : /* @__PURE__ */ jsx(AncillaryProductCard, { ...props });
118
+ }
116
119
  export {
117
120
  AncillaryProductCard,
118
121
  MainProductCard,
122
+ ProductCard,
119
123
  ToolsAndLibrariesCards
120
124
  };
package/dist/index.d.mts CHANGED
@@ -20,7 +20,7 @@ export { NPMBadge } from './components/npm-badge.mjs';
20
20
  export { GetYourAPIGameRightSection } from './components/get-your-api-game-right-section.mjs';
21
21
  export { HiveNavigation, HiveNavigationProps } from './components/hive-navigation/index.mjs';
22
22
  export { HiveFooter } from './components/hive-footer/index.mjs';
23
- export { AncillaryProductCard, MainProductCard, ToolsAndLibrariesCards } from './components/tools-and-libraries-cards/index.mjs';
23
+ export { AncillaryProductCard, MainProductCard, ProductCard, ToolsAndLibrariesCards } from './components/tools-and-libraries-cards/index.mjs';
24
24
  export { DecorationIsolation } from './components/decorations/index.mjs';
25
25
  export { CallToAction, CallToActionProps } from './components/call-to-action.mjs';
26
26
  export { CookiesConsent, CookiesConsentProps } from './components/cookies-consent.mjs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theguild/components",
3
- "version": "8.0.0-alpha-20241122154106-b3f1d666a601dc0981eb7ac83f93231cda47f9c1",
3
+ "version": "8.0.0-alpha-20241122154733-e2568ebb58178dce6e87deb6ad60c7c41fc69f4f",
4
4
  "repository": {
5
5
  "url": "https://github.com/the-guild-org/docs",
6
6
  "directory": "packages/components"