@aghents/ui 0.1.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/brand/aghents-favicon.svg +6 -0
- package/brand/aghents-mark.svg +5 -0
- package/brand/aghents-wordmark.svg +14 -0
- package/dist/index.d.ts +39 -0
- package/dist/index.js +269 -0
- package/package.json +47 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
|
|
2
|
+
<!-- Aghents favicon: one hairline, one point. Hexes are @aghents/tokens: surface, hairline, cream, lime. -->
|
|
3
|
+
<rect x="0.5" y="0.5" width="31" height="31" rx="7" fill="#161C24" stroke="#2B323C"/>
|
|
4
|
+
<path d="M8 16h16" stroke="#D8D8D8" stroke-width="1"/>
|
|
5
|
+
<circle cx="16" cy="16" r="2" fill="#D6EA36"/>
|
|
6
|
+
</svg>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24">
|
|
2
|
+
<!-- Aghents mark (lit). Hexes are @aghents/tokens: cream, lime. Same geometry as packages/ui/src/brand/Mark.tsx -->
|
|
3
|
+
<path d="M6 2v20M18 2v20M6 12h12" stroke="#D8D8D8" stroke-width="1.5" fill="none"/>
|
|
4
|
+
<circle cx="12" cy="12" r="2.25" fill="#D6EA36"/>
|
|
5
|
+
</svg>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 630 84" width="630" height="84">
|
|
2
|
+
<!-- Aghents wordmark. Hexes are @aghents/tokens: cream, lime; font is the display token. Same geometry as packages/ui/src/brand/Wordmark.tsx -->
|
|
3
|
+
<text x="45" y="78" text-anchor="middle" font-family="Newsreader, Georgia, serif" font-size="100" font-weight="400" fill="#D8D8D8">A</text>
|
|
4
|
+
<text x="135" y="78" text-anchor="middle" font-family="Newsreader, Georgia, serif" font-size="100" font-weight="400" fill="#D8D8D8">G</text>
|
|
5
|
+
<g transform="translate(0 6)" stroke="#D8D8D8" stroke-width="1" vector-effect="non-scaling-stroke" fill="none">
|
|
6
|
+
<path d="M187 0h22v2.5h-6.5v67h6.5v2.5h-22v-2.5h6.5v-67h-6.5zM241 0h22v2.5h-6.5v67h6.5v2.5h-22v-2.5h6.5v-67h-6.5z"/>
|
|
7
|
+
<path d="M202.5 34H247.5"/>
|
|
8
|
+
<circle cx="225" cy="34" r="6" fill="#D6EA36" stroke="none"/>
|
|
9
|
+
</g>
|
|
10
|
+
<text x="315" y="78" text-anchor="middle" font-family="Newsreader, Georgia, serif" font-size="100" font-weight="400" fill="#D8D8D8">E</text>
|
|
11
|
+
<text x="405" y="78" text-anchor="middle" font-family="Newsreader, Georgia, serif" font-size="100" font-weight="400" fill="#D8D8D8">N</text>
|
|
12
|
+
<text x="495" y="78" text-anchor="middle" font-family="Newsreader, Georgia, serif" font-size="100" font-weight="400" fill="#D8D8D8">T</text>
|
|
13
|
+
<text x="585" y="78" text-anchor="middle" font-family="Newsreader, Georgia, serif" font-size="100" font-weight="400" fill="#D8D8D8">S</text>
|
|
14
|
+
</svg>
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { TextProps, ViewProps } from 'react-native';
|
|
3
|
+
|
|
4
|
+
type TextVariant = "display-xl" | "display-l" | "display-m" | "body" | "label" | "value";
|
|
5
|
+
declare function Text({ variant, style, ...rest }: TextProps & {
|
|
6
|
+
variant: TextVariant;
|
|
7
|
+
}): react.JSX.Element;
|
|
8
|
+
|
|
9
|
+
declare function Button({ kind, disabled, onPress, children, }: {
|
|
10
|
+
kind: "primary" | "secondary";
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
onPress: () => void;
|
|
13
|
+
children: string;
|
|
14
|
+
}): react.JSX.Element;
|
|
15
|
+
|
|
16
|
+
declare function Hairline({ padded, style, ...rest }: ViewProps & {
|
|
17
|
+
padded?: boolean;
|
|
18
|
+
}): react.JSX.Element;
|
|
19
|
+
|
|
20
|
+
declare function LedgerRow({ label, value }: {
|
|
21
|
+
label: string;
|
|
22
|
+
value: string;
|
|
23
|
+
}): react.JSX.Element;
|
|
24
|
+
|
|
25
|
+
declare function LitPoint({ lit, label }: {
|
|
26
|
+
lit: boolean;
|
|
27
|
+
label: string;
|
|
28
|
+
}): react.JSX.Element;
|
|
29
|
+
|
|
30
|
+
declare function Mark({ size, lit }: {
|
|
31
|
+
size?: number;
|
|
32
|
+
lit?: boolean;
|
|
33
|
+
}): react.JSX.Element;
|
|
34
|
+
|
|
35
|
+
declare function Wordmark({ height }: {
|
|
36
|
+
height?: number;
|
|
37
|
+
}): react.JSX.Element;
|
|
38
|
+
|
|
39
|
+
export { Button, Hairline, LedgerRow, LitPoint, Mark, Text, type TextVariant, Wordmark };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
// src/Text.tsx
|
|
2
|
+
import { colors, fonts } from "@aghents/tokens";
|
|
3
|
+
import { Text as RNText } from "react-native";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
var variants = {
|
|
6
|
+
"display-xl": {
|
|
7
|
+
fontFamily: fonts.display,
|
|
8
|
+
fontSize: 56,
|
|
9
|
+
lineHeight: 59,
|
|
10
|
+
fontWeight: "300",
|
|
11
|
+
color: colors.cream
|
|
12
|
+
},
|
|
13
|
+
"display-l": {
|
|
14
|
+
fontFamily: fonts.display,
|
|
15
|
+
fontSize: 40,
|
|
16
|
+
lineHeight: 44,
|
|
17
|
+
fontWeight: "300",
|
|
18
|
+
color: colors.cream
|
|
19
|
+
},
|
|
20
|
+
"display-m": {
|
|
21
|
+
fontFamily: fonts.display,
|
|
22
|
+
fontSize: 28,
|
|
23
|
+
lineHeight: 34,
|
|
24
|
+
fontWeight: "400",
|
|
25
|
+
color: colors.cream
|
|
26
|
+
},
|
|
27
|
+
body: {
|
|
28
|
+
fontFamily: fonts.display,
|
|
29
|
+
fontSize: 17,
|
|
30
|
+
lineHeight: 26,
|
|
31
|
+
fontWeight: "300",
|
|
32
|
+
color: colors.cream
|
|
33
|
+
},
|
|
34
|
+
label: {
|
|
35
|
+
fontFamily: fonts.mono,
|
|
36
|
+
fontSize: 12,
|
|
37
|
+
lineHeight: 17,
|
|
38
|
+
letterSpacing: 1.7,
|
|
39
|
+
textTransform: "uppercase",
|
|
40
|
+
color: colors.creamDim
|
|
41
|
+
},
|
|
42
|
+
value: { fontFamily: fonts.mono, fontSize: 14, lineHeight: 20, color: colors.cream }
|
|
43
|
+
};
|
|
44
|
+
function Text({ variant, style, ...rest }) {
|
|
45
|
+
return /* @__PURE__ */ jsx(RNText, { ...rest, style: [variants[variant], style] });
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// src/Button.tsx
|
|
49
|
+
import { colors as colors2, fonts as fonts2 } from "@aghents/tokens";
|
|
50
|
+
import { Pressable, Text as RNText2 } from "react-native";
|
|
51
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
52
|
+
function Button({
|
|
53
|
+
kind,
|
|
54
|
+
disabled = false,
|
|
55
|
+
onPress,
|
|
56
|
+
children
|
|
57
|
+
}) {
|
|
58
|
+
const primary = kind === "primary";
|
|
59
|
+
return /* @__PURE__ */ jsx2(
|
|
60
|
+
Pressable,
|
|
61
|
+
{
|
|
62
|
+
accessibilityRole: "button",
|
|
63
|
+
disabled,
|
|
64
|
+
onPress,
|
|
65
|
+
style: {
|
|
66
|
+
paddingVertical: 14,
|
|
67
|
+
paddingHorizontal: 22,
|
|
68
|
+
borderRadius: 2,
|
|
69
|
+
borderWidth: 1,
|
|
70
|
+
borderColor: primary ? colors2.cream : colors2.hairline,
|
|
71
|
+
backgroundColor: primary ? colors2.cream : "transparent",
|
|
72
|
+
opacity: disabled ? 0.4 : 1
|
|
73
|
+
},
|
|
74
|
+
children: /* @__PURE__ */ jsx2(
|
|
75
|
+
RNText2,
|
|
76
|
+
{
|
|
77
|
+
style: {
|
|
78
|
+
fontFamily: fonts2.mono,
|
|
79
|
+
fontSize: 12,
|
|
80
|
+
letterSpacing: 1.7,
|
|
81
|
+
textTransform: "uppercase",
|
|
82
|
+
color: primary ? colors2.void : colors2.cream
|
|
83
|
+
},
|
|
84
|
+
children
|
|
85
|
+
}
|
|
86
|
+
)
|
|
87
|
+
}
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// src/Hairline.tsx
|
|
92
|
+
import { colors as colors3 } from "@aghents/tokens";
|
|
93
|
+
import { View } from "react-native";
|
|
94
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
95
|
+
function Hairline({ padded = true, style, ...rest }) {
|
|
96
|
+
return /* @__PURE__ */ jsx3(
|
|
97
|
+
View,
|
|
98
|
+
{
|
|
99
|
+
...rest,
|
|
100
|
+
style: [
|
|
101
|
+
{ borderWidth: 1, borderColor: colors3.hairline, borderRadius: 2, padding: padded ? 20 : 0 },
|
|
102
|
+
style
|
|
103
|
+
]
|
|
104
|
+
}
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// src/LedgerRow.tsx
|
|
109
|
+
import { colors as colors4 } from "@aghents/tokens";
|
|
110
|
+
import { View as View2 } from "react-native";
|
|
111
|
+
import { jsx as jsx4, jsxs } from "react/jsx-runtime";
|
|
112
|
+
function LedgerRow({ label, value }) {
|
|
113
|
+
return /* @__PURE__ */ jsxs(
|
|
114
|
+
View2,
|
|
115
|
+
{
|
|
116
|
+
style: {
|
|
117
|
+
flexDirection: "row",
|
|
118
|
+
justifyContent: "space-between",
|
|
119
|
+
borderTopWidth: 1,
|
|
120
|
+
borderTopColor: colors4.hairline,
|
|
121
|
+
paddingVertical: 8
|
|
122
|
+
},
|
|
123
|
+
children: [
|
|
124
|
+
/* @__PURE__ */ jsx4(Text, { variant: "label", children: label }),
|
|
125
|
+
/* @__PURE__ */ jsx4(Text, { variant: "value", children: value })
|
|
126
|
+
]
|
|
127
|
+
}
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// src/LitPoint.tsx
|
|
132
|
+
import { colors as colors5, fonts as fonts3 } from "@aghents/tokens";
|
|
133
|
+
import { View as View3 } from "react-native";
|
|
134
|
+
import { Text as RNText3 } from "react-native";
|
|
135
|
+
import { jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
136
|
+
function LitPoint({ lit, label }) {
|
|
137
|
+
const color = lit ? colors5.cream : colors5.creamDim;
|
|
138
|
+
return /* @__PURE__ */ jsxs2(View3, { accessibilityLabel: label, style: { flexDirection: "row", alignItems: "center", gap: 8 }, children: [
|
|
139
|
+
/* @__PURE__ */ jsx5(
|
|
140
|
+
View3,
|
|
141
|
+
{
|
|
142
|
+
style: {
|
|
143
|
+
width: 8,
|
|
144
|
+
height: 8,
|
|
145
|
+
borderRadius: 4,
|
|
146
|
+
backgroundColor: lit ? colors5.lime : colors5.hairline
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
),
|
|
150
|
+
/* @__PURE__ */ jsx5(
|
|
151
|
+
RNText3,
|
|
152
|
+
{
|
|
153
|
+
style: {
|
|
154
|
+
fontFamily: fonts3.mono,
|
|
155
|
+
fontSize: 12,
|
|
156
|
+
letterSpacing: 1.7,
|
|
157
|
+
textTransform: "uppercase",
|
|
158
|
+
color
|
|
159
|
+
},
|
|
160
|
+
children: label
|
|
161
|
+
}
|
|
162
|
+
)
|
|
163
|
+
] });
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
// src/brand/Mark.tsx
|
|
167
|
+
import { colors as colors6 } from "@aghents/tokens";
|
|
168
|
+
import { Platform, View as View4 } from "react-native";
|
|
169
|
+
import { jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
170
|
+
function Mark({ size = 24, lit = true }) {
|
|
171
|
+
const dot = lit ? colors6.lime : colors6.hairline;
|
|
172
|
+
if (Platform.OS !== "web") {
|
|
173
|
+
const u = size / 24;
|
|
174
|
+
const bar = { position: "absolute", backgroundColor: colors6.cream };
|
|
175
|
+
return /* @__PURE__ */ jsxs3(View4, { accessibilityLabel: "Aghents", style: { width: size, height: size }, children: [
|
|
176
|
+
/* @__PURE__ */ jsx6(View4, { style: [bar, { left: 5.25 * u, top: 2 * u, width: 1.5 * u, height: 20 * u }] }),
|
|
177
|
+
/* @__PURE__ */ jsx6(View4, { style: [bar, { left: 17.25 * u, top: 2 * u, width: 1.5 * u, height: 20 * u }] }),
|
|
178
|
+
/* @__PURE__ */ jsx6(View4, { style: [bar, { left: 6 * u, top: 11.25 * u, width: 12 * u, height: 1.5 * u }] }),
|
|
179
|
+
/* @__PURE__ */ jsx6(
|
|
180
|
+
View4,
|
|
181
|
+
{
|
|
182
|
+
style: {
|
|
183
|
+
position: "absolute",
|
|
184
|
+
left: 9.75 * u,
|
|
185
|
+
top: 9.75 * u,
|
|
186
|
+
width: 4.5 * u,
|
|
187
|
+
height: 4.5 * u,
|
|
188
|
+
borderRadius: 2.25 * u,
|
|
189
|
+
backgroundColor: dot
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
)
|
|
193
|
+
] });
|
|
194
|
+
}
|
|
195
|
+
return /* @__PURE__ */ jsxs3("svg", { width: size, height: size, viewBox: "0 0 24 24", role: "img", "aria-label": "Aghents", children: [
|
|
196
|
+
/* @__PURE__ */ jsx6("path", { d: "M6 2v20M18 2v20M6 12h12", stroke: colors6.cream, strokeWidth: "1.5", fill: "none" }),
|
|
197
|
+
/* @__PURE__ */ jsx6("circle", { cx: "12", cy: "12", r: "2.25", fill: dot })
|
|
198
|
+
] });
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
// src/brand/Wordmark.tsx
|
|
202
|
+
import { colors as colors7, fonts as fonts4 } from "@aghents/tokens";
|
|
203
|
+
import { Platform as Platform2 } from "react-native";
|
|
204
|
+
import { jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
205
|
+
var F = 100;
|
|
206
|
+
var CAP = 72;
|
|
207
|
+
var ADV = 90;
|
|
208
|
+
var PAD = 6;
|
|
209
|
+
var BASE = PAD + CAP;
|
|
210
|
+
var W = 7 * ADV;
|
|
211
|
+
var H = CAP + 2 * PAD;
|
|
212
|
+
var stem = (cx) => `M${cx - 11} 0h22v2.5h-6.5v${CAP - 5}h6.5v2.5h-22v-2.5h6.5v-${CAP - 5}h-6.5z`;
|
|
213
|
+
function Wordmark({ height = 22 }) {
|
|
214
|
+
if (Platform2.OS !== "web") return /* @__PURE__ */ jsx7(Text, { variant: "label", children: "AGHENTS" });
|
|
215
|
+
return /* @__PURE__ */ jsx7(
|
|
216
|
+
"svg",
|
|
217
|
+
{
|
|
218
|
+
width: height * W / H,
|
|
219
|
+
height,
|
|
220
|
+
viewBox: `0 0 ${W} ${H}`,
|
|
221
|
+
role: "img",
|
|
222
|
+
"aria-label": "Aghents",
|
|
223
|
+
children: [..."AGHENTS"].map((ch, i) => {
|
|
224
|
+
const cx = i * ADV + ADV / 2;
|
|
225
|
+
if (ch === "H") {
|
|
226
|
+
return /* @__PURE__ */ jsxs4(
|
|
227
|
+
"g",
|
|
228
|
+
{
|
|
229
|
+
transform: `translate(0 ${PAD})`,
|
|
230
|
+
stroke: colors7.cream,
|
|
231
|
+
strokeWidth: "1",
|
|
232
|
+
vectorEffect: "non-scaling-stroke",
|
|
233
|
+
fill: "none",
|
|
234
|
+
children: [
|
|
235
|
+
/* @__PURE__ */ jsx7("path", { d: `${stem(cx - 27)}${stem(cx + 27)}` }),
|
|
236
|
+
/* @__PURE__ */ jsx7("path", { d: `M${cx - 22.5} 34H${cx + 22.5}` }),
|
|
237
|
+
/* @__PURE__ */ jsx7("circle", { cx, cy: "34", r: "6", fill: colors7.lime, stroke: "none" })
|
|
238
|
+
]
|
|
239
|
+
},
|
|
240
|
+
ch
|
|
241
|
+
);
|
|
242
|
+
}
|
|
243
|
+
return /* @__PURE__ */ jsx7(
|
|
244
|
+
"text",
|
|
245
|
+
{
|
|
246
|
+
x: cx,
|
|
247
|
+
y: BASE,
|
|
248
|
+
textAnchor: "middle",
|
|
249
|
+
fontFamily: fonts4.display,
|
|
250
|
+
fontSize: F,
|
|
251
|
+
fontWeight: 400,
|
|
252
|
+
fill: colors7.cream,
|
|
253
|
+
children: ch
|
|
254
|
+
},
|
|
255
|
+
ch
|
|
256
|
+
);
|
|
257
|
+
})
|
|
258
|
+
}
|
|
259
|
+
);
|
|
260
|
+
}
|
|
261
|
+
export {
|
|
262
|
+
Button,
|
|
263
|
+
Hairline,
|
|
264
|
+
LedgerRow,
|
|
265
|
+
LitPoint,
|
|
266
|
+
Mark,
|
|
267
|
+
Text,
|
|
268
|
+
Wordmark
|
|
269
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@aghents/ui",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"module": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./brand/*.svg": "./brand/*.svg"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist",
|
|
17
|
+
"brand",
|
|
18
|
+
"README.md"
|
|
19
|
+
],
|
|
20
|
+
"publishConfig": {
|
|
21
|
+
"access": "public"
|
|
22
|
+
},
|
|
23
|
+
"peerDependencies": {
|
|
24
|
+
"react": "^18.3.0 || ^19.0.0",
|
|
25
|
+
"react-native": "*",
|
|
26
|
+
"react-native-web": "^0.19.13"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@aghents/tokens": "0.1.0"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@testing-library/react": "^16.1.0",
|
|
33
|
+
"@types/react": "^18.3.0",
|
|
34
|
+
"jsdom": "^25.0.1",
|
|
35
|
+
"react": "18.3.1",
|
|
36
|
+
"react-dom": "18.3.1",
|
|
37
|
+
"react-native": "0.76.5",
|
|
38
|
+
"react-native-web": "^0.19.13",
|
|
39
|
+
"typescript": "^5.9.3",
|
|
40
|
+
"vitest": "^2.1.9"
|
|
41
|
+
},
|
|
42
|
+
"scripts": {
|
|
43
|
+
"build": "tsup src/index.ts --format esm --dts --clean",
|
|
44
|
+
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
45
|
+
"test": "vitest run"
|
|
46
|
+
}
|
|
47
|
+
}
|