trc-ui 0.0.0-stage → 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/CHANGELOG.md +14 -0
- package/LICENSE +21 -0
- package/README.md +120 -2
- package/dist/index.cjs +737 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +300 -0
- package/dist/index.d.ts +300 -0
- package/dist/index.js +685 -0
- package/dist/index.js.map +1 -0
- package/dist/styles.css +1 -0
- package/package.json +78 -4
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.1.0
|
|
4
|
+
|
|
5
|
+
First public release.
|
|
6
|
+
|
|
7
|
+
- Design tokens as CSS variables prefixed with `--trc-`, with a single themable accent color.
|
|
8
|
+
- Typography: `Heading` with an accent word between asterisks, `Text`, `AccentText`, `plainText`, `StepNumber`.
|
|
9
|
+
- Pill buttons: `PillButton` and `PillLink`, with the stretching dot, a compact size, a solid variant and a loading state.
|
|
10
|
+
- Surfaces: `Card` (alt tone, interactive, watermark icon), `Section` (inset card), `Container`.
|
|
11
|
+
- Forms: `Field`, `Input`, `Textarea`, `Select`, `Checkbox`, `Switch`, wired for screen readers.
|
|
12
|
+
- Site chrome: `SiteHeader` (floating, dropdowns, accessible mobile panel) and `SiteFooter`.
|
|
13
|
+
- Heroes: `PageHero`, `HeroVideo` (crossfading videos, soft parallax) and `BackToTop`.
|
|
14
|
+
- ESM and CommonJS builds, TypeScript types, `"use client"` for the Next.js App Router.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Aurel Agbado
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,121 @@
|
|
|
1
|
-
#
|
|
1
|
+
# trc ui
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
React components with a deep black design: near-black backgrounds, graphite cards, thin headings, a single accent color and pill buttons whose dot stretches on hover.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/trc-ui)
|
|
6
|
+
[](https://github.com/aa404/trc-ui/blob/main/LICENSE)
|
|
7
|
+
|
|
8
|
+
- **Sober.** Near-black backgrounds, graphite cards, one accent color. Depth comes from shades of grey, not shadows.
|
|
9
|
+
- **Thin.** Light Montserrat headings carry the page, with one accent word per title.
|
|
10
|
+
- **Alive.** Pills that stretch, cards that wake up on hover, a header that blurs as you scroll.
|
|
11
|
+
- **Accessible.** Native form controls, labels and messages wired automatically, keyboard focus everywhere, reduced motion respected.
|
|
12
|
+
- **Light.** No runtime dependency besides React. One stylesheet, themable with CSS variables.
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install trc-ui
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
React 18 or later is required.
|
|
21
|
+
|
|
22
|
+
## Setup
|
|
23
|
+
|
|
24
|
+
Import the stylesheet once, at the root of your app, and add the `trc` class to `<body>`:
|
|
25
|
+
|
|
26
|
+
```tsx
|
|
27
|
+
import "trc-ui/styles.css";
|
|
28
|
+
|
|
29
|
+
export default function RootLayout({ children }: { children: React.ReactNode }) {
|
|
30
|
+
return (
|
|
31
|
+
<html lang="en">
|
|
32
|
+
<body className="trc">{children}</body>
|
|
33
|
+
</html>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
The design relies on [Montserrat](https://fonts.google.com/specimen/Montserrat) (weights 300, 400 and 500), which is not bundled. Load it, then point trc ui to it:
|
|
39
|
+
|
|
40
|
+
```tsx
|
|
41
|
+
// Next.js
|
|
42
|
+
import { Montserrat } from "next/font/google";
|
|
43
|
+
|
|
44
|
+
const montserrat = Montserrat({ subsets: ["latin"], weight: ["300", "400", "500"], variable: "--font-montserrat" });
|
|
45
|
+
// <html className={montserrat.variable}>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
```css
|
|
49
|
+
:root {
|
|
50
|
+
--trc-font: var(--font-montserrat), ui-sans-serif, system-ui, sans-serif;
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Without Next.js, a Google Fonts `<link>` is enough: trc ui uses `"Montserrat"` by default.
|
|
55
|
+
|
|
56
|
+
## Usage
|
|
57
|
+
|
|
58
|
+
```tsx
|
|
59
|
+
import { Heading, PillButton, Text } from "trc-ui";
|
|
60
|
+
|
|
61
|
+
export function Welcome() {
|
|
62
|
+
return (
|
|
63
|
+
<section>
|
|
64
|
+
<Heading as="h1" size="display">
|
|
65
|
+
Welcome to *deep black.*
|
|
66
|
+
</Heading>
|
|
67
|
+
<Text size="lg">The words between asterisks take the accent color.</Text>
|
|
68
|
+
<PillButton solid>Get started</PillButton>
|
|
69
|
+
</section>
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Components
|
|
75
|
+
|
|
76
|
+
| Component | What it is |
|
|
77
|
+
| --- | --- |
|
|
78
|
+
| `Heading`, `Text`, `AccentText`, `StepNumber` | Thin headings with an accent word, body text, large thin step numbers. |
|
|
79
|
+
| `PillButton`, `PillLink` | The signature pill: a round accent dot that stretches to fill the pill on hover. |
|
|
80
|
+
| `Card`, `Section`, `Container` | Graphite cards (with an optional watermark icon), inset sections, centered containers. |
|
|
81
|
+
| `Field`, `Input`, `Textarea`, `Select` | Native controls; `Field` wires the label, hint and error for screen readers. |
|
|
82
|
+
| `Checkbox`, `Switch` | Native checkboxes, the switch announced as a switch. |
|
|
83
|
+
| `SiteHeader`, `SiteFooter` | Floating header with dropdowns and a mobile side panel; footer as a graphite card. |
|
|
84
|
+
| `PageHero`, `HeroVideo`, `BackToTop` | Photo and video heroes inset from the screen edges; a floating back-to-top button. |
|
|
85
|
+
|
|
86
|
+
## With a router
|
|
87
|
+
|
|
88
|
+
Links accept your router's link component: `as` on `PillLink` and `Card`, `linkAs` on `SiteHeader` and `SiteFooter`.
|
|
89
|
+
|
|
90
|
+
```tsx
|
|
91
|
+
import Link from "next/link";
|
|
92
|
+
import { PillLink, SiteHeader } from "trc-ui";
|
|
93
|
+
|
|
94
|
+
<PillLink as={Link} href="/pricing">See pricing</PillLink>
|
|
95
|
+
<SiteHeader linkAs={Link} logo={<Logo />} logoLabel="Home" nav={nav} />
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Components ship with the `"use client"` directive and work as-is in the Next.js App Router.
|
|
99
|
+
|
|
100
|
+
## Theming
|
|
101
|
+
|
|
102
|
+
Every color, radius and motion setting is a CSS variable prefixed with `--trc-`. Change the accent once:
|
|
103
|
+
|
|
104
|
+
```css
|
|
105
|
+
:root {
|
|
106
|
+
--trc-accent: #d41367;
|
|
107
|
+
--trc-on-accent: #ffffff; /* text on the accent: near black by default */
|
|
108
|
+
}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Variables cascade, so you can also theme a single area: `<div style={{ "--trc-accent": "#d41367" }}>`.
|
|
112
|
+
|
|
113
|
+
The documentation includes a colors generator that builds a 10-shade scale from your brand color, checks WCAG contrast on deep black and gives you the code.
|
|
114
|
+
|
|
115
|
+
## Browser support
|
|
116
|
+
|
|
117
|
+
trc ui uses `color-mix()` and `:has()`: Chrome and Edge 111+, Safari 16.2+, Firefox 121+.
|
|
118
|
+
|
|
119
|
+
## License
|
|
120
|
+
|
|
121
|
+
[MIT](https://github.com/aa404/trc-ui/blob/main/LICENSE), by Aurel Agbado, [The Ring Concept](https://www.theringconcept.com/).
|