@codefast/ui 0.0.7 → 0.0.8

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.
Files changed (96) hide show
  1. package/dist/badge.js +4 -4
  2. package/dist/badge.js.map +1 -1
  3. package/dist/badge.mjs +4 -4
  4. package/dist/badge.mjs.map +1 -1
  5. package/dist/blockquote.d.mts +7 -0
  6. package/dist/blockquote.d.ts +7 -0
  7. package/dist/blockquote.js +13 -0
  8. package/dist/blockquote.js.map +1 -0
  9. package/dist/blockquote.mjs +13 -0
  10. package/dist/blockquote.mjs.map +1 -0
  11. package/dist/box.d.mts +14 -0
  12. package/dist/box.d.ts +14 -0
  13. package/dist/box.js +15 -0
  14. package/dist/box.js.map +1 -0
  15. package/dist/box.mjs +15 -0
  16. package/dist/box.mjs.map +1 -0
  17. package/dist/button.d.mts +1 -1
  18. package/dist/button.d.ts +1 -1
  19. package/dist/code.d.mts +7 -0
  20. package/dist/code.d.ts +7 -0
  21. package/dist/code.js +13 -0
  22. package/dist/code.js.map +1 -0
  23. package/dist/code.mjs +13 -0
  24. package/dist/code.mjs.map +1 -0
  25. package/dist/command.d.mts +15 -15
  26. package/dist/command.d.ts +15 -15
  27. package/dist/container.d.mts +7 -0
  28. package/dist/container.d.ts +7 -0
  29. package/dist/container.js +17 -0
  30. package/dist/container.js.map +1 -0
  31. package/dist/container.mjs +17 -0
  32. package/dist/container.mjs.map +1 -0
  33. package/dist/em.d.mts +7 -0
  34. package/dist/em.d.ts +7 -0
  35. package/dist/em.js +13 -0
  36. package/dist/em.js.map +1 -0
  37. package/dist/em.mjs +13 -0
  38. package/dist/em.mjs.map +1 -0
  39. package/dist/heading.d.mts +8 -0
  40. package/dist/heading.d.ts +8 -0
  41. package/dist/heading.js +13 -0
  42. package/dist/heading.js.map +1 -0
  43. package/dist/heading.mjs +13 -0
  44. package/dist/heading.mjs.map +1 -0
  45. package/dist/kbd.d.mts +7 -0
  46. package/dist/kbd.d.ts +7 -0
  47. package/dist/kbd.js +27 -0
  48. package/dist/kbd.js.map +1 -0
  49. package/dist/kbd.mjs +27 -0
  50. package/dist/kbd.mjs.map +1 -0
  51. package/dist/pre.d.mts +7 -0
  52. package/dist/pre.d.ts +7 -0
  53. package/dist/pre.js +13 -0
  54. package/dist/pre.js.map +1 -0
  55. package/dist/pre.mjs +13 -0
  56. package/dist/pre.mjs.map +1 -0
  57. package/dist/quote.d.mts +7 -0
  58. package/dist/quote.d.ts +7 -0
  59. package/dist/quote.js +13 -0
  60. package/dist/quote.js.map +1 -0
  61. package/dist/quote.mjs +13 -0
  62. package/dist/quote.mjs.map +1 -0
  63. package/dist/section.d.mts +7 -0
  64. package/dist/section.d.ts +7 -0
  65. package/dist/section.js +13 -0
  66. package/dist/section.js.map +1 -0
  67. package/dist/section.mjs +13 -0
  68. package/dist/section.mjs.map +1 -0
  69. package/dist/strong.d.mts +7 -0
  70. package/dist/strong.d.ts +7 -0
  71. package/dist/strong.js +13 -0
  72. package/dist/strong.js.map +1 -0
  73. package/dist/strong.mjs +13 -0
  74. package/dist/strong.mjs.map +1 -0
  75. package/dist/styles.css +1 -1
  76. package/dist/styles.css.map +1 -1
  77. package/dist/text.d.mts +14 -0
  78. package/dist/text.d.ts +14 -0
  79. package/dist/text.js +15 -0
  80. package/dist/text.js.map +1 -0
  81. package/dist/text.mjs +15 -0
  82. package/dist/text.mjs.map +1 -0
  83. package/package.json +62 -2
  84. package/src/badge.tsx +4 -6
  85. package/src/blockquote.tsx +24 -0
  86. package/src/box.tsx +33 -0
  87. package/src/code.tsx +22 -0
  88. package/src/container.tsx +25 -0
  89. package/src/em.tsx +22 -0
  90. package/src/heading.tsx +25 -0
  91. package/src/kbd.tsx +32 -0
  92. package/src/pre.tsx +22 -0
  93. package/src/quote.tsx +22 -0
  94. package/src/section.tsx +24 -0
  95. package/src/strong.tsx +22 -0
  96. package/src/text.tsx +34 -0
package/src/box.tsx ADDED
@@ -0,0 +1,33 @@
1
+ import * as React from "react";
2
+ import { Slot } from "@radix-ui/react-slot";
3
+
4
+ /* -----------------------------------------------------------------------------
5
+ * Component: Box
6
+ * -------------------------------------------------------------------------- */
7
+
8
+ interface BoxDivProps extends React.HTMLAttributes<HTMLDivElement> {
9
+ as?: "div";
10
+ }
11
+
12
+ interface BoxSpanProps extends React.HTMLAttributes<HTMLSpanElement> {
13
+ as: "span";
14
+ }
15
+
16
+ type BoxProps = (BoxDivProps | BoxSpanProps) & {
17
+ asChild?: boolean;
18
+ };
19
+
20
+ const Box = React.forwardRef<HTMLDivElement, BoxProps>(
21
+ ({ as: Tag = "div", asChild, ...props }, ref) => {
22
+ const Comp = asChild ? Slot : Tag;
23
+
24
+ return <Comp ref={ref} {...props} />;
25
+ },
26
+ );
27
+ Box.displayName = "Box";
28
+
29
+ /* -----------------------------------------------------------------------------
30
+ * Exports
31
+ * -------------------------------------------------------------------------- */
32
+
33
+ export { Box };
package/src/code.tsx ADDED
@@ -0,0 +1,22 @@
1
+ import * as React from "react";
2
+ import { Slot } from "@radix-ui/react-slot";
3
+
4
+ /* -----------------------------------------------------------------------------
5
+ * Component: Code
6
+ * -------------------------------------------------------------------------- */
7
+
8
+ const Code = React.forwardRef<
9
+ HTMLElement,
10
+ React.HTMLAttributes<HTMLElement> & { asChild?: boolean }
11
+ >(({ asChild, ...props }, ref) => {
12
+ const Comp = asChild ? Slot : "code";
13
+
14
+ return <Comp ref={ref} {...props} />;
15
+ });
16
+ Code.displayName = "Code";
17
+
18
+ /* -----------------------------------------------------------------------------
19
+ * Exports
20
+ * -------------------------------------------------------------------------- */
21
+
22
+ export { Code };
@@ -0,0 +1,25 @@
1
+ import * as React from "react";
2
+ import { Slot } from "@radix-ui/react-slot";
3
+ import { cn } from "./utils";
4
+
5
+ /* -----------------------------------------------------------------------------
6
+ * Component: Container
7
+ * -------------------------------------------------------------------------- */
8
+
9
+ const Container = React.forwardRef<
10
+ HTMLDivElement,
11
+ React.HTMLAttributes<HTMLDivElement> & {
12
+ asChild?: boolean;
13
+ }
14
+ >(({ className, asChild, ...props }, ref) => {
15
+ const Comp = asChild ? Slot : "div";
16
+
17
+ return <Comp ref={ref} className={cn("container", className)} {...props} />;
18
+ });
19
+ Container.displayName = "Container";
20
+
21
+ /* -----------------------------------------------------------------------------
22
+ * Exports
23
+ * -------------------------------------------------------------------------- */
24
+
25
+ export { Container };
package/src/em.tsx ADDED
@@ -0,0 +1,22 @@
1
+ import * as React from "react";
2
+ import { Slot } from "@radix-ui/react-slot";
3
+
4
+ /* -----------------------------------------------------------------------------
5
+ * Component: Em
6
+ * -------------------------------------------------------------------------- */
7
+
8
+ const Em = React.forwardRef<
9
+ HTMLElement,
10
+ React.HTMLAttributes<HTMLElement> & { asChild?: boolean }
11
+ >(({ asChild, ...props }, ref) => {
12
+ const Comp = asChild ? Slot : "em";
13
+
14
+ return <Comp ref={ref} {...props} />;
15
+ });
16
+ Em.displayName = "Em";
17
+
18
+ /* -----------------------------------------------------------------------------
19
+ * Exports
20
+ * -------------------------------------------------------------------------- */
21
+
22
+ export { Em };
@@ -0,0 +1,25 @@
1
+ import * as React from "react";
2
+ import { Slot } from "@radix-ui/react-slot";
3
+
4
+ /* -----------------------------------------------------------------------------
5
+ * Component: Heading
6
+ * -------------------------------------------------------------------------- */
7
+
8
+ const Heading = React.forwardRef<
9
+ HTMLHeadingElement,
10
+ React.HTMLAttributes<HTMLHeadingElement> & {
11
+ as?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
12
+ asChild?: boolean;
13
+ }
14
+ >(({ asChild, as: Tag = "h1", ...props }, ref) => {
15
+ const Com = asChild ? Slot : Tag;
16
+
17
+ return <Com ref={ref} {...props} />;
18
+ });
19
+ Heading.displayName = "Heading";
20
+
21
+ /* -----------------------------------------------------------------------------
22
+ * Exports
23
+ * -------------------------------------------------------------------------- */
24
+
25
+ export { Heading };
package/src/kbd.tsx ADDED
@@ -0,0 +1,32 @@
1
+ import * as React from "react";
2
+ import { Slot } from "@radix-ui/react-slot";
3
+ import { cn } from "./utils";
4
+
5
+ /* -----------------------------------------------------------------------------
6
+ * Component: Kbd
7
+ * -------------------------------------------------------------------------- */
8
+
9
+ const Kbd = React.forwardRef<
10
+ HTMLElement,
11
+ React.HTMLAttributes<HTMLElement> & { asChild?: boolean }
12
+ >(({ asChild, className, ...props }, ref) => {
13
+ const Comp = asChild ? Slot : "kbd";
14
+
15
+ return (
16
+ <Comp
17
+ ref={ref}
18
+ className={cn(
19
+ "bg-muted text-muted-foreground inline-flex h-5 select-none items-center gap-1 rounded border px-1.5 font-mono text-xs font-medium",
20
+ className,
21
+ )}
22
+ {...props}
23
+ />
24
+ );
25
+ });
26
+ Kbd.displayName = "Kbd";
27
+
28
+ /* -----------------------------------------------------------------------------
29
+ * Exports
30
+ * -------------------------------------------------------------------------- */
31
+
32
+ export { Kbd };
package/src/pre.tsx ADDED
@@ -0,0 +1,22 @@
1
+ import * as React from "react";
2
+ import { Slot } from "@radix-ui/react-slot";
3
+
4
+ /* -----------------------------------------------------------------------------
5
+ * Component: Pre
6
+ * -------------------------------------------------------------------------- */
7
+
8
+ const Pre = React.forwardRef<
9
+ HTMLPreElement,
10
+ React.HTMLAttributes<HTMLPreElement> & { asChild?: boolean }
11
+ >(({ asChild, ...props }, ref) => {
12
+ const Comp = asChild ? Slot : "pre";
13
+
14
+ return <Comp ref={ref} {...props} />;
15
+ });
16
+ Pre.displayName = "Pre";
17
+
18
+ /* -----------------------------------------------------------------------------
19
+ * Exports
20
+ * -------------------------------------------------------------------------- */
21
+
22
+ export { Pre };
package/src/quote.tsx ADDED
@@ -0,0 +1,22 @@
1
+ import * as React from "react";
2
+ import { Slot } from "@radix-ui/react-slot";
3
+
4
+ /* -----------------------------------------------------------------------------
5
+ * Component: Quote
6
+ * -------------------------------------------------------------------------- */
7
+
8
+ const Quote = React.forwardRef<
9
+ HTMLQuoteElement,
10
+ React.QuoteHTMLAttributes<HTMLQuoteElement> & { asChild?: boolean }
11
+ >(({ asChild, ...props }, ref) => {
12
+ const Comp = asChild ? Slot : "q";
13
+
14
+ return <Comp ref={ref} {...props} />;
15
+ });
16
+ Quote.displayName = "Quote";
17
+
18
+ /* -----------------------------------------------------------------------------
19
+ * Exports
20
+ * -------------------------------------------------------------------------- */
21
+
22
+ export { Quote };
@@ -0,0 +1,24 @@
1
+ import * as React from "react";
2
+ import { Slot } from "@radix-ui/react-slot";
3
+
4
+ /* -----------------------------------------------------------------------------
5
+ * Component: Section
6
+ * -------------------------------------------------------------------------- */
7
+
8
+ const Section = React.forwardRef<
9
+ HTMLElement,
10
+ React.HTMLAttributes<HTMLElement> & {
11
+ asChild?: boolean;
12
+ }
13
+ >(({ asChild, ...props }, ref) => {
14
+ const Comp = asChild ? Slot : "section";
15
+
16
+ return <Comp ref={ref} {...props} />;
17
+ });
18
+ Section.displayName = "Section";
19
+
20
+ /* -----------------------------------------------------------------------------
21
+ * Exports
22
+ * -------------------------------------------------------------------------- */
23
+
24
+ export { Section };
package/src/strong.tsx ADDED
@@ -0,0 +1,22 @@
1
+ import * as React from "react";
2
+ import { Slot } from "@radix-ui/react-slot";
3
+
4
+ /* -----------------------------------------------------------------------------
5
+ * Component: Strong
6
+ * -------------------------------------------------------------------------- */
7
+
8
+ const Strong = React.forwardRef<
9
+ HTMLElement,
10
+ React.HTMLAttributes<HTMLElement> & { asChild?: boolean }
11
+ >(({ asChild, ...props }, ref) => {
12
+ const Comp = asChild ? Slot : "strong";
13
+
14
+ return <Comp ref={ref} {...props} />;
15
+ });
16
+ Strong.displayName = "Strong";
17
+
18
+ /* -----------------------------------------------------------------------------
19
+ * Exports
20
+ * -------------------------------------------------------------------------- */
21
+
22
+ export { Strong };
package/src/text.tsx ADDED
@@ -0,0 +1,34 @@
1
+ import * as React from "react";
2
+ import { Slot } from "@radix-ui/react-slot";
3
+
4
+ /* -----------------------------------------------------------------------------
5
+ * Component: Text
6
+ * -------------------------------------------------------------------------- */
7
+
8
+ interface TextParagraphProps
9
+ extends React.HTMLAttributes<HTMLParagraphElement> {
10
+ as?: "p";
11
+ }
12
+
13
+ interface TextSpanProps extends React.HTMLAttributes<HTMLSpanElement> {
14
+ as: "span";
15
+ }
16
+
17
+ type TextProps = (TextParagraphProps | TextSpanProps) & {
18
+ asChild?: boolean;
19
+ };
20
+
21
+ const Text = React.forwardRef<HTMLParagraphElement, TextProps>(
22
+ ({ as: Tag = "p", asChild, ...props }, ref) => {
23
+ const Comp = asChild ? Slot : Tag;
24
+
25
+ return <Comp ref={ref} {...props} />;
26
+ },
27
+ );
28
+ Text.displayName = "Text";
29
+
30
+ /* -----------------------------------------------------------------------------
31
+ * Exports
32
+ * -------------------------------------------------------------------------- */
33
+
34
+ export { Text };