@bouko/react 1.7.9 → 1.8.1

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.
@@ -0,0 +1,6 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="1em" height="1em">
2
+ <path
3
+ d="M256 48a208 208 0 1 1 0 416 208 208 0 1 1 0-416zm0 464A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-111 111-47-47c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l64 64c9.4 9.4 24.6 9.4 33.9 0L369 209z"
4
+ fill="currentColor"
5
+ />
6
+ </svg>
@@ -0,0 +1,6 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="1em" height="1em">
2
+ <path
3
+ d="M304 48a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zm0 416a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM48 304a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm464-48a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM142.9 437A48 48 0 1 0 75 369.1 48 48 0 1 0 142.9 437zm0-294.2A48 48 0 1 0 75 75a48 48 0 1 0 67.9 67.9zM369.1 437A48 48 0 1 0 437 369.1 48 48 0 1 0 369.1 437z"
4
+ fill="currentColor"
5
+ />
6
+ </svg>
@@ -0,0 +1,6 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="1em" height="1em">
2
+ <path
3
+ d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM175 175c9.4-9.4 24.6-9.4 33.9 0l47 47 47-47c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-47 47 47 47c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l47-47-47-47c-9.4-9.4-9.4-24.6 0-33.9z"
4
+ fill="currentColor"
5
+ />
6
+ </svg>
@@ -1,5 +1,9 @@
1
1
  import type { ReactNode } from "react";
2
- export default function Badge({ style, children }: {
2
+ type Color = "accent" | "orange" | "dark";
3
+ type Props = {
3
4
  style?: string;
5
+ color?: Color;
4
6
  children: ReactNode;
5
- }): import("react/jsx-runtime").JSX.Element;
7
+ };
8
+ export default function Badge({ style, color, children }: Props): import("react/jsx-runtime").JSX.Element;
9
+ export {};
@@ -1,4 +1,16 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- export default function Badge({ style, children }) {
3
- return (_jsx("span", { className: "w-min px-3 py-1 bg-accent/20 border border-accent-dark rounded-full text-xs text-accent-dark font-semibold", children: children }));
2
+ import { cn, tv } from "@bouko/style";
3
+ export default function Badge({ style, color, children }) {
4
+ return (_jsx("span", { className: cn(styles({ color }), style), children: children }));
4
5
  }
6
+ const styles = tv({
7
+ base: "w-min px-3 py-1 border rounded-full text-xs font-semibold",
8
+ defaultVariants: { color: "accent" },
9
+ variants: {
10
+ color: {
11
+ accent: "bg-accent/20 border-accent-dark text-accent-dark",
12
+ orange: "bg-orange-400/20 border-orange-500 text-orange-500",
13
+ dark: "bg-slate-700/20 border-slate-800 text-slate-800"
14
+ }
15
+ }
16
+ });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
 
3
3
  "name": "@bouko/react",
4
- "version": "1.7.9",
4
+ "version": "1.8.1",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
7
7
  "license": "MIT",