@inherent.design/brand 0.2.0 → 0.3.0
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.
- package/components/button/Button.astro +55 -0
- package/components/button/index.ts +7 -0
- package/components/image/Image.astro +24 -0
- package/components/image/index.ts +9 -0
- package/components/prose/Prose.astro +617 -0
- package/components/prose/index.ts +9 -0
- package/components/separator/Separator.astro +36 -0
- package/components/separator/index.ts +7 -0
- package/fonts/dist/en/96bca51b8ec371714a19640d750743fe.woff2 +0 -0
- package/fonts/dist/en/b0a7e5ec01111034c2715216e8572469.woff2 +0 -0
- package/fonts/dist/en/bf5f69a6d69f3b80cca2f0ea18391421.woff2 +0 -0
- package/fonts/dist/en/fb649ad2bbdf05880df6d318f251bc7b.woff2 +0 -0
- package/fonts/dist/en/index.css +9 -9
- package/fonts/dist/hi/index.css +3 -3
- package/fonts/dist/zh/2e199b543bf018d377b67e99726877ed.woff2 +0 -0
- package/fonts/dist/zh/734840a02a4bc6d5160fbb0482fd9fab.woff2 +0 -0
- package/fonts/dist/zh/e00f6f95a6a747bfbd32af5df1fe1f1c.woff2 +0 -0
- package/fonts/dist/zh/f41ec03cc2ad8e0cb2e04f7ceacc91e4.woff2 +0 -0
- package/fonts/dist/zh/index.css +4 -4
- package/package.json +19 -11
- package/fonts/dist/en/4db369d2bd069bba9eecb25938906a84.woff2 +0 -0
- package/fonts/dist/en/6543456df4504eb8eec3cb90d97fd006.woff2 +0 -0
- package/fonts/dist/en/854fe9c7181becfefb35721fb5b526fd.woff2 +0 -0
- package/fonts/dist/en/a4dcca7a30c3fec53f94ea68154075ef.woff2 +0 -0
- package/fonts/dist/zh/6b02f1bb13dd222053d1748cd0e91dec.woff2 +0 -0
- package/fonts/dist/zh/94c6b8220e16b579460ca450b7f700f8.woff2 +0 -0
- package/fonts/dist/zh/bad3748e751a2f826e2353048d691687.woff2 +0 -0
- package/fonts/dist/zh/c0fdf8df0b34608d454afb2c33c466f1.woff2 +0 -0
- /package/{starwind.css → styles/starwind.css} +0 -0
- /package/{styles.css → styles/styles.css} +0 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from "astro/types";
|
|
3
|
+
import { tv, type VariantProps } from "tailwind-variants";
|
|
4
|
+
|
|
5
|
+
interface Props
|
|
6
|
+
extends
|
|
7
|
+
HTMLAttributes<"button">,
|
|
8
|
+
Omit<HTMLAttributes<"a">, "type">,
|
|
9
|
+
VariantProps<typeof button> {}
|
|
10
|
+
|
|
11
|
+
const { variant, size, class: className, ...rest } = Astro.props;
|
|
12
|
+
|
|
13
|
+
export const button = tv({
|
|
14
|
+
base: [
|
|
15
|
+
"inline-flex items-center justify-center gap-1.5 rounded-md font-medium whitespace-nowrap",
|
|
16
|
+
"[&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
17
|
+
"transition-all outline-none focus-visible:ring-3",
|
|
18
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
19
|
+
"aria-invalid:border-error aria-invalid:focus-visible:ring-error/40",
|
|
20
|
+
],
|
|
21
|
+
variants: {
|
|
22
|
+
variant: {
|
|
23
|
+
default: "bg-foreground text-background hover:bg-foreground/90 focus-visible:ring-outline/50",
|
|
24
|
+
primary:
|
|
25
|
+
"bg-primary text-primary-foreground hover:bg-primary-accent focus-visible:ring-primary/50",
|
|
26
|
+
secondary:
|
|
27
|
+
"bg-secondary text-secondary-foreground hover:bg-secondary/90 focus-visible:ring-secondary/50",
|
|
28
|
+
outline:
|
|
29
|
+
"dark:border-input focus-visible:ring-outline/50 bg-background dark:bg-input/30 focus-visible:border-outline hover:bg-muted dark:hover:bg-input/50 hover:text-foreground border shadow-xs",
|
|
30
|
+
ghost: "hover:bg-muted hover:text-foreground focus-visible:ring-outline/50",
|
|
31
|
+
info: "bg-info text-info-foreground hover:bg-info/90 focus-visible:ring-info/50",
|
|
32
|
+
success:
|
|
33
|
+
"bg-success text-success-foreground hover:bg-success/90 focus-visible:ring-success/50",
|
|
34
|
+
warning:
|
|
35
|
+
"bg-warning text-warning-foreground hover:bg-warning/90 focus-visible:ring-warning/50",
|
|
36
|
+
error: "bg-error text-error-foreground hover:bg-error/90 focus-visible:ring-error/50",
|
|
37
|
+
},
|
|
38
|
+
size: {
|
|
39
|
+
sm: "h-9 px-4 text-sm has-[>svg]:px-3 [&_svg:not([class*='size-'])]:size-3.5",
|
|
40
|
+
md: "h-11 px-5 text-base has-[>svg]:px-4 [&_svg:not([class*='size-'])]:size-4.5",
|
|
41
|
+
lg: "h-12 px-8 text-lg has-[>svg]:px-6 [&_svg:not([class*='size-'])]:size-5",
|
|
42
|
+
"icon-sm": "size-9 [&_svg:not([class*='size-'])]:size-3.5",
|
|
43
|
+
icon: "size-11 [&_svg:not([class*='size-'])]:size-4.5",
|
|
44
|
+
"icon-lg": "size-12 [&_svg:not([class*='size-'])]:size-5",
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
defaultVariants: { variant: "default", size: "md" },
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
const Tag = Astro.props.href ? "a" : "button";
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
<Tag class={button({ variant, size, class: className })} data-slot="button" {...rest}>
|
|
54
|
+
<slot />
|
|
55
|
+
</Tag>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { ComponentProps } from "astro/types";
|
|
3
|
+
import { Image as AstroImage } from "astro:assets";
|
|
4
|
+
import { tv } from "tailwind-variants";
|
|
5
|
+
|
|
6
|
+
export const image = tv({ base: "starwind-image h-auto w-full" });
|
|
7
|
+
|
|
8
|
+
type Props = Partial<ComponentProps<typeof AstroImage>> & { inferSize?: boolean };
|
|
9
|
+
|
|
10
|
+
const { class: className, src, alt = "", inferSize = true, ...rest } = Astro.props;
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
{
|
|
14
|
+
src && (
|
|
15
|
+
<AstroImage
|
|
16
|
+
class={image({ class: className })}
|
|
17
|
+
src={src}
|
|
18
|
+
alt={alt}
|
|
19
|
+
inferSize={inferSize}
|
|
20
|
+
data-slot="image"
|
|
21
|
+
{...(rest as any)}
|
|
22
|
+
/>
|
|
23
|
+
)
|
|
24
|
+
}
|