@zayne-labs/ui-react 0.0.6 → 0.0.7
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.
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { PolymorphicProps } from '@zayne-labs/toolkit-react/utils';
|
|
3
3
|
|
|
4
|
-
declare function CardRoot<TElement extends
|
|
5
|
-
declare function CardHeader<TElement extends
|
|
6
|
-
declare function CardTitle<TElement extends
|
|
7
|
-
declare function CardDescription<TElement extends
|
|
8
|
-
declare function CardContent<TElement extends
|
|
9
|
-
declare function CardFooter<TElement extends
|
|
4
|
+
declare function CardRoot<TElement extends react.ElementType = "article">(props: PolymorphicProps<TElement>): react.JSX.Element;
|
|
5
|
+
declare function CardHeader<TElement extends react.ElementType = "header">(props: PolymorphicProps<TElement>): react.JSX.Element;
|
|
6
|
+
declare function CardTitle<TElement extends react.ElementType = "h3">(props: PolymorphicProps<TElement>): react.JSX.Element;
|
|
7
|
+
declare function CardDescription<TElement extends react.ElementType = "p">(props: PolymorphicProps<TElement>): react.JSX.Element;
|
|
8
|
+
declare function CardContent<TElement extends react.ElementType = "div">(props: PolymorphicProps<TElement>): react.JSX.Element;
|
|
9
|
+
declare function CardFooter<TElement extends react.ElementType = "footer">(props: PolymorphicProps<TElement, {
|
|
10
10
|
asChild?: boolean;
|
|
11
11
|
}>): react.JSX.Element;
|
|
12
12
|
declare const Root: typeof CardRoot;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Slot } from '../../chunk-ENDWJXPF.js';
|
|
2
2
|
import { cnMerge } from '../../chunk-OHG7GB7O.js';
|
|
3
|
+
import * as React from 'react';
|
|
3
4
|
|
|
4
|
-
// src/components/ui/card/card.tsx
|
|
5
5
|
function CardRoot(props) {
|
|
6
6
|
const { as: Element = "article", ...restOfProps } = props;
|
|
7
7
|
return /* @__PURE__ */ React.createElement(Element, { ...restOfProps });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/ui/card/card.tsx"],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/card/card.tsx"],"names":[],"mappings":";;;;AAMA,SAAS,SAAyD,KAAmC,EAAA;AACpG,EAAA,MAAM,EAAE,EAAI,EAAA,OAAA,GAAU,SAAW,EAAA,GAAG,aAAgB,GAAA,KAAA;AAEpD,EAAO,uBAAA,KAAA,CAAA,aAAA,CAAC,OAAS,EAAA,EAAA,GAAG,WAAa,EAAA,CAAA;AAClC;AAEA,SAAS,WAA0D,KAAmC,EAAA;AACrG,EAAA,MAAM,EAAE,EAAI,EAAA,OAAA,GAAU,QAAU,EAAA,GAAG,aAAgB,GAAA,KAAA;AAEnD,EAAO,uBAAA,KAAA,CAAA,aAAA,CAAC,OAAS,EAAA,EAAA,GAAG,WAAa,EAAA,CAAA;AAClC;AAEA,SAAS,UAAqD,KAAmC,EAAA;AAChG,EAAA,MAAM,EAAE,EAAI,EAAA,OAAA,GAAU,MAAM,SAAW,EAAA,GAAG,aAAgB,GAAA,KAAA;AAE1D,EAAO,uBAAA,KAAA,CAAA,aAAA,CAAC,WAAQ,SAAW,EAAA,OAAA,CAAQ,iBAAiB,SAAS,CAAA,EAAI,GAAG,WAAa,EAAA,CAAA;AAClF;AAEA,SAAS,gBAA0D,KAAmC,EAAA;AACrG,EAAA,MAAM,EAAE,EAAI,EAAA,OAAA,GAAU,KAAK,SAAW,EAAA,GAAG,aAAgB,GAAA,KAAA;AAEzD,EACC,uBAAA,KAAA,CAAA,aAAA,CAAC,WAAQ,SAAW,EAAA,OAAA,CAAQ,wCAAwC,SAAS,CAAA,EAAI,GAAG,WAAa,EAAA,CAAA;AAEnG;AAEA,SAAS,YAAwD,KAAmC,EAAA;AACnG,EAAA,MAAM,EAAE,EAAI,EAAA,OAAA,GAAU,KAAO,EAAA,GAAG,aAAgB,GAAA,KAAA;AAEhD,EAAO,uBAAA,KAAA,CAAA,aAAA,CAAC,OAAS,EAAA,EAAA,GAAG,WAAa,EAAA,CAAA;AAClC;AAEA,SAAS,WACR,KACC,EAAA;AACD,EAAA,MAAM,EAAE,EAAI,EAAA,OAAA,GAAU,UAAU,OAAS,EAAA,GAAG,aAAgB,GAAA,KAAA;AAE5D,EAAM,MAAA,SAAA,GAAY,UAAU,IAAO,GAAA,OAAA;AAEnC,EAAO,uBAAA,KAAA,CAAA,aAAA,CAAC,SAAW,EAAA,EAAA,GAAG,WAAa,EAAA,CAAA;AACpC;AAEO,IAAM,IAAO,GAAA;AAEb,IAAM,MAAS,GAAA;AAEf,IAAM,KAAQ,GAAA;AAEd,IAAM,WAAc,GAAA;AAEpB,IAAM,OAAU,GAAA;AAEhB,IAAM,MAAS,GAAA","file":"index.js","sourcesContent":["import * as React from \"react\";\n\nimport { Slot } from \"@/components/common/slot\";\nimport { cnMerge } from \"@/lib/utils/cn\";\nimport type { PolymorphicProps } from \"@zayne-labs/toolkit-react/utils\";\n\nfunction CardRoot<TElement extends React.ElementType = \"article\">(props: PolymorphicProps<TElement>) {\n\tconst { as: Element = \"article\", ...restOfProps } = props;\n\n\treturn <Element {...restOfProps} />;\n}\n\nfunction CardHeader<TElement extends React.ElementType = \"header\">(props: PolymorphicProps<TElement>) {\n\tconst { as: Element = \"header\", ...restOfProps } = props;\n\n\treturn <Element {...restOfProps} />;\n}\n\nfunction CardTitle<TElement extends React.ElementType = \"h3\">(props: PolymorphicProps<TElement>) {\n\tconst { as: Element = \"h3\", className, ...restOfProps } = props;\n\n\treturn <Element className={cnMerge(\"font-semibold\", className)} {...restOfProps} />;\n}\n\nfunction CardDescription<TElement extends React.ElementType = \"p\">(props: PolymorphicProps<TElement>) {\n\tconst { as: Element = \"p\", className, ...restOfProps } = props;\n\n\treturn (\n\t\t<Element className={cnMerge(\"text-sm text-shadcn-muted-foreground\", className)} {...restOfProps} />\n\t);\n}\n\nfunction CardContent<TElement extends React.ElementType = \"div\">(props: PolymorphicProps<TElement>) {\n\tconst { as: Element = \"div\", ...restOfProps } = props;\n\n\treturn <Element {...restOfProps} />;\n}\n\nfunction CardFooter<TElement extends React.ElementType = \"footer\">(\n\tprops: PolymorphicProps<TElement, { asChild?: boolean }>\n) {\n\tconst { as: Element = \"footer\", asChild, ...restOfProps } = props;\n\n\tconst Component = asChild ? Slot : Element;\n\n\treturn <Component {...restOfProps} />;\n}\n\nexport const Root = CardRoot;\n\nexport const Header = CardHeader;\n\nexport const Title = CardTitle;\n\nexport const Description = CardDescription;\n\nexport const Content = CardContent;\n\nexport const Footer = CardFooter;\n"]}
|