minka-ds 0.1.3 → 0.1.4
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/package.json +1 -1
- package/src/components/ui/alert.tsx +64 -0
- package/src/index.ts +1 -0
- package/tokens/text-utilities.css +140 -0
package/package.json
CHANGED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { cva, type VariantProps } from "class-variance-authority"
|
|
3
|
+
|
|
4
|
+
import { cn } from "../../lib/utils"
|
|
5
|
+
|
|
6
|
+
const alertVariants = cva(
|
|
7
|
+
"relative w-full [border-radius:var(--radius-card)] border px-4 py-3 text-body-sm grid grid-cols-[0_1fr] has-[>svg]:grid-cols-[1rem_1fr] gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:shrink-0",
|
|
8
|
+
{
|
|
9
|
+
variants: {
|
|
10
|
+
variant: {
|
|
11
|
+
default:
|
|
12
|
+
"bg-[var(--color-bg-raised)] border-[var(--color-border-default)] text-[var(--color-text-default)] [&>svg]:text-[var(--color-text-muted)]",
|
|
13
|
+
info:
|
|
14
|
+
"bg-[var(--color-bg-info)] border-[var(--color-border-info)] text-[var(--color-text-default)] [&>svg]:text-[var(--color-feedback-info)]",
|
|
15
|
+
success:
|
|
16
|
+
"bg-[var(--color-bg-success)] border-[var(--color-border-success)] text-[var(--color-text-default)] [&>svg]:text-[var(--color-feedback-success)]",
|
|
17
|
+
warning:
|
|
18
|
+
"bg-[var(--color-bg-warning)] border-[var(--color-border-warning)] text-[var(--color-text-default)] [&>svg]:text-[var(--color-text-default)]",
|
|
19
|
+
error:
|
|
20
|
+
"bg-[var(--color-bg-error)] border-[var(--color-border-error)] text-[var(--color-text-default)] [&>svg]:text-[var(--color-feedback-error)]",
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
defaultVariants: {
|
|
24
|
+
variant: "default",
|
|
25
|
+
},
|
|
26
|
+
}
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
function Alert({
|
|
30
|
+
className,
|
|
31
|
+
variant,
|
|
32
|
+
...props
|
|
33
|
+
}: React.ComponentProps<"div"> & VariantProps<typeof alertVariants>) {
|
|
34
|
+
return (
|
|
35
|
+
<div
|
|
36
|
+
data-slot="alert"
|
|
37
|
+
role="alert"
|
|
38
|
+
className={cn(alertVariants({ variant }), className)}
|
|
39
|
+
{...props}
|
|
40
|
+
/>
|
|
41
|
+
)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function AlertTitle({ className, ...props }: React.ComponentProps<"div">) {
|
|
45
|
+
return (
|
|
46
|
+
<div
|
|
47
|
+
data-slot="alert-title"
|
|
48
|
+
className={cn("col-start-2 text-label", className)}
|
|
49
|
+
{...props}
|
|
50
|
+
/>
|
|
51
|
+
)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function AlertDescription({ className, ...props }: React.ComponentProps<"div">) {
|
|
55
|
+
return (
|
|
56
|
+
<div
|
|
57
|
+
data-slot="alert-description"
|
|
58
|
+
className={cn("col-start-2 text-caption-light text-[var(--color-text-default)] [&_p]:leading-relaxed", className)}
|
|
59
|
+
{...props}
|
|
60
|
+
/>
|
|
61
|
+
)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export { Alert, AlertTitle, AlertDescription }
|
package/src/index.ts
CHANGED
|
@@ -5,6 +5,7 @@ export { cn } from "./lib/utils"
|
|
|
5
5
|
export { usePlatform } from "./hooks/use-platform"
|
|
6
6
|
|
|
7
7
|
// Components
|
|
8
|
+
export * from "./components/ui/alert"
|
|
8
9
|
export * from "./components/ui/badge"
|
|
9
10
|
export * from "./components/ui/breadcrumb"
|
|
10
11
|
export * from "./components/ui/calendar"
|
|
@@ -3,6 +3,11 @@
|
|
|
3
3
|
utilities are available alongside the base text styles defined in globals.css.
|
|
4
4
|
|
|
5
5
|
Does NOT set font-family — that's the consuming app's responsibility.
|
|
6
|
+
|
|
7
|
+
Serif variants come in two tiers:
|
|
8
|
+
base — mirrors the sans scale exactly (same pixel size)
|
|
9
|
+
-lg — one primitive step up, to compensate for serif's optical smallness
|
|
10
|
+
Weight is fixed at 400 — display serifs typically have no bold cut.
|
|
6
11
|
────────────────────────────────────────────────────────────────────────── */
|
|
7
12
|
@layer utilities {
|
|
8
13
|
.text-body-lg-light {
|
|
@@ -41,4 +46,139 @@
|
|
|
41
46
|
line-height: var(--primitive-line-height-normal);
|
|
42
47
|
letter-spacing: var(--primitive-letter-spacing-normal);
|
|
43
48
|
}
|
|
49
|
+
|
|
50
|
+
/* ── Serif variants ──────────────────────────────────────────────────────
|
|
51
|
+
base: same size as the sans equivalent
|
|
52
|
+
-lg: one primitive step up for optical compensation */
|
|
53
|
+
|
|
54
|
+
/* Headings — base */
|
|
55
|
+
.text-heading-1-serif {
|
|
56
|
+
font-size: var(--primitive-font-size-4xl); /* 36px */
|
|
57
|
+
font-weight: var(--primitive-font-weight-400);
|
|
58
|
+
line-height: var(--primitive-line-height-tight);
|
|
59
|
+
letter-spacing: var(--primitive-letter-spacing-normal);
|
|
60
|
+
font-family: var(--font-serif);
|
|
61
|
+
}
|
|
62
|
+
.text-heading-2-serif {
|
|
63
|
+
font-size: var(--primitive-font-size-3xl); /* 30px */
|
|
64
|
+
font-weight: var(--primitive-font-weight-400);
|
|
65
|
+
line-height: var(--primitive-line-height-snug);
|
|
66
|
+
letter-spacing: var(--primitive-letter-spacing-normal);
|
|
67
|
+
font-family: var(--font-serif);
|
|
68
|
+
}
|
|
69
|
+
.text-heading-3-serif {
|
|
70
|
+
font-size: var(--primitive-font-size-2xl); /* 24px */
|
|
71
|
+
font-weight: var(--primitive-font-weight-400);
|
|
72
|
+
line-height: var(--primitive-line-height-snug);
|
|
73
|
+
letter-spacing: var(--primitive-letter-spacing-normal);
|
|
74
|
+
font-family: var(--font-serif);
|
|
75
|
+
}
|
|
76
|
+
.text-heading-4-serif {
|
|
77
|
+
font-size: var(--primitive-font-size-xl); /* 20px */
|
|
78
|
+
font-weight: var(--primitive-font-weight-400);
|
|
79
|
+
line-height: var(--primitive-line-height-snug);
|
|
80
|
+
letter-spacing: var(--primitive-letter-spacing-normal);
|
|
81
|
+
font-family: var(--font-serif);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/* Headings — lg */
|
|
85
|
+
.text-heading-1-lg-serif {
|
|
86
|
+
font-size: var(--primitive-font-size-5xl); /* 48px */
|
|
87
|
+
font-weight: var(--primitive-font-weight-400);
|
|
88
|
+
line-height: var(--primitive-line-height-tight);
|
|
89
|
+
letter-spacing: var(--primitive-letter-spacing-normal);
|
|
90
|
+
font-family: var(--font-serif);
|
|
91
|
+
}
|
|
92
|
+
.text-heading-2-lg-serif {
|
|
93
|
+
font-size: var(--primitive-font-size-4xl); /* 36px */
|
|
94
|
+
font-weight: var(--primitive-font-weight-400);
|
|
95
|
+
line-height: var(--primitive-line-height-snug);
|
|
96
|
+
letter-spacing: var(--primitive-letter-spacing-normal);
|
|
97
|
+
font-family: var(--font-serif);
|
|
98
|
+
}
|
|
99
|
+
.text-heading-3-lg-serif {
|
|
100
|
+
font-size: var(--primitive-font-size-3xl); /* 30px */
|
|
101
|
+
font-weight: var(--primitive-font-weight-400);
|
|
102
|
+
line-height: var(--primitive-line-height-snug);
|
|
103
|
+
letter-spacing: var(--primitive-letter-spacing-normal);
|
|
104
|
+
font-family: var(--font-serif);
|
|
105
|
+
}
|
|
106
|
+
.text-heading-4-lg-serif {
|
|
107
|
+
font-size: var(--primitive-font-size-2xl); /* 24px */
|
|
108
|
+
font-weight: var(--primitive-font-weight-400);
|
|
109
|
+
line-height: var(--primitive-line-height-snug);
|
|
110
|
+
letter-spacing: var(--primitive-letter-spacing-normal);
|
|
111
|
+
font-family: var(--font-serif);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/* Body — base */
|
|
115
|
+
.text-body-lg-serif {
|
|
116
|
+
font-size: var(--primitive-font-size-lg); /* 18px */
|
|
117
|
+
font-weight: var(--primitive-font-weight-400);
|
|
118
|
+
line-height: var(--primitive-line-height-normal);
|
|
119
|
+
letter-spacing: var(--primitive-letter-spacing-normal);
|
|
120
|
+
font-family: var(--font-serif);
|
|
121
|
+
}
|
|
122
|
+
.text-body-serif {
|
|
123
|
+
font-size: var(--primitive-font-size-base); /* 16px */
|
|
124
|
+
font-weight: var(--primitive-font-weight-400);
|
|
125
|
+
line-height: var(--primitive-line-height-normal);
|
|
126
|
+
letter-spacing: var(--primitive-letter-spacing-normal);
|
|
127
|
+
font-family: var(--font-serif);
|
|
128
|
+
}
|
|
129
|
+
.text-body-sm-serif {
|
|
130
|
+
font-size: var(--primitive-font-size-sm); /* 14px */
|
|
131
|
+
font-weight: var(--primitive-font-weight-400);
|
|
132
|
+
line-height: var(--primitive-line-height-normal);
|
|
133
|
+
letter-spacing: var(--primitive-letter-spacing-normal);
|
|
134
|
+
font-family: var(--font-serif);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/* Body — lg */
|
|
138
|
+
.text-body-xl-serif {
|
|
139
|
+
font-size: var(--primitive-font-size-xl); /* 20px — body-lg stepped up */
|
|
140
|
+
font-weight: var(--primitive-font-weight-400);
|
|
141
|
+
line-height: var(--primitive-line-height-normal);
|
|
142
|
+
letter-spacing: var(--primitive-letter-spacing-normal);
|
|
143
|
+
font-family: var(--font-serif);
|
|
144
|
+
}
|
|
145
|
+
.text-body-sm-lg-serif {
|
|
146
|
+
font-size: var(--primitive-font-size-base); /* 16px — body-sm stepped up */
|
|
147
|
+
font-weight: var(--primitive-font-weight-400);
|
|
148
|
+
line-height: var(--primitive-line-height-normal);
|
|
149
|
+
letter-spacing: var(--primitive-letter-spacing-normal);
|
|
150
|
+
font-family: var(--font-serif);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/* Caption — base */
|
|
154
|
+
.text-caption-serif {
|
|
155
|
+
font-size: var(--primitive-font-size-xs); /* 12px */
|
|
156
|
+
font-weight: var(--primitive-font-weight-400);
|
|
157
|
+
line-height: var(--primitive-line-height-normal);
|
|
158
|
+
letter-spacing: var(--primitive-letter-spacing-normal);
|
|
159
|
+
font-family: var(--font-serif);
|
|
160
|
+
}
|
|
161
|
+
.text-caption-sm-serif {
|
|
162
|
+
font-size: var(--primitive-font-size-2xs); /* 10px */
|
|
163
|
+
font-weight: var(--primitive-font-weight-400);
|
|
164
|
+
line-height: var(--primitive-line-height-normal);
|
|
165
|
+
letter-spacing: var(--primitive-letter-spacing-normal);
|
|
166
|
+
font-family: var(--font-serif);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/* Caption — lg */
|
|
170
|
+
.text-caption-lg-serif {
|
|
171
|
+
font-size: var(--primitive-font-size-sm); /* 14px — caption stepped up */
|
|
172
|
+
font-weight: var(--primitive-font-weight-400);
|
|
173
|
+
line-height: var(--primitive-line-height-normal);
|
|
174
|
+
letter-spacing: var(--primitive-letter-spacing-normal);
|
|
175
|
+
font-family: var(--font-serif);
|
|
176
|
+
}
|
|
177
|
+
.text-caption-sm-lg-serif {
|
|
178
|
+
font-size: var(--primitive-font-size-xs); /* 12px — caption-sm stepped up */
|
|
179
|
+
font-weight: var(--primitive-font-weight-400);
|
|
180
|
+
line-height: var(--primitive-line-height-normal);
|
|
181
|
+
letter-spacing: var(--primitive-letter-spacing-normal);
|
|
182
|
+
font-family: var(--font-serif);
|
|
183
|
+
}
|
|
44
184
|
}
|