) => {
- const Component = useMemo(() => as || "span", [as])
- return (
-
- {label}
-
- );
-};
\ No newline at end of file
+export const Tag = withAs(
+ (Component, { label, selected, className, ...rest }: TagProps) => {
+ return (
+
+ {label}
+
+ );
+ }
+);
diff --git a/js/react/lib/components/tag/tag.const.ts b/js/react/lib/components/tag/tag.const.ts
index 0ea1b63..a451ca0 100644
--- a/js/react/lib/components/tag/tag.const.ts
+++ b/js/react/lib/components/tag/tag.const.ts
@@ -7,4 +7,4 @@ export const TAG_VARIANTS = {
"bg-secondary-100 border-secondary-600 text-secondary-600",
"dark:bg-primary-950 dark:border-primary-500 dark:text-primary-500",
],
-};
\ No newline at end of file
+};
diff --git a/js/react/lib/index.ts b/js/react/lib/index.ts
index b6435d6..06b71c7 100644
--- a/js/react/lib/index.ts
+++ b/js/react/lib/index.ts
@@ -3,4 +3,5 @@ export * from "./components/button";
export * from "./components/chip";
export * from "./components/tag";
export * from "./components/flap";
+export * from "./components/level";
export * from "./icons";
diff --git a/js/react/lib/styles.css b/js/react/lib/styles.css
index cc88d7e..ac0134d 100644
--- a/js/react/lib/styles.css
+++ b/js/react/lib/styles.css
@@ -83,7 +83,9 @@
--color-light: #fafafa;
--color-dark: #2e2e2e;
+
/* Fonts */
+ --text-xxs: 10px;
--text-caption: 12px;
--text-caption--font-weight: 400;
--text-caption--letter-spacing: 0em;
diff --git a/js/react/lib/utils/hoc/with-as.hoc.tsx b/js/react/lib/utils/hoc/with-as.hoc.tsx
new file mode 100644
index 0000000..ffb431f
--- /dev/null
+++ b/js/react/lib/utils/hoc/with-as.hoc.tsx
@@ -0,0 +1,12 @@
+import React, { ComponentPropsWithoutRef } from "react";
+
+export function withAs(
+ render: (Component: React.ElementType, props: P) => React.ReactNode
+) {
+ return function WithAsComponent(
+ props: { as?: C } & Omit, keyof P> & P
+ ) {
+ const { as: Component = "div", ...rest } = props;
+ return render(Component, rest as P);
+ };
+}
diff --git a/js/react/showcase/App.tsx b/js/react/showcase/App.tsx
index d38752b..c0c874a 100644
--- a/js/react/showcase/App.tsx
+++ b/js/react/showcase/App.tsx
@@ -6,6 +6,7 @@ import {
Telegram,
Flap,
Chip,
+ Level,
} from "@rustlanges/react";
import { ShowComponent } from "./ShowComponent";
@@ -143,6 +144,26 @@ export function App() {
}}
component={Flap}
/>
+
);
}