Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@ preference.
and sizing.

`tailwind.css` exposes utilities such as `bg-background`, `text-foreground-muted`,
`border-rule`, `bg-accent-clay`, `font-sans`, `text-body`, `rounded-tight`, `duration-quick`,
`ease-edit`, and `size-control-compact`.
`border-rule`, `bg-accent-clay`, `font-sans`, `text-body`, `text-signal`, `rounded-tight`,
`duration-quick`, `ease-edit`, and `size-control-compact`. `text-signal` is the compact
typography role; use `text-brand-signal` when the semantic gold signal color is intended.

## React UI

Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@protocol-works/design-tokens",
"version": "0.2.0",
"version": "0.2.1",
"description": "Shared [protocol]works brand, theme, typography, motion, and geometry tokens.",
"type": "module",
"workspaces": [
Expand Down
4 changes: 2 additions & 2 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@protocol-works/ui",
"version": "0.3.1",
"version": "0.3.2",
"description": "Portable React primitives for [protocol]works products.",
"type": "module",
"sideEffects": [
Expand Down Expand Up @@ -170,7 +170,7 @@
"prepack": "npm run test"
},
"peerDependencies": {
"@protocol-works/design-tokens": ">=0.2.0 <1",
"@protocol-works/design-tokens": ">=0.2.1 <1",
"react": ">=19 <20",
"react-dom": ">=19 <20"
},
Expand Down
8 changes: 8 additions & 0 deletions packages/ui/test/tailwind.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ test("Tailwind discovers utilities used by the installed component package", ()
assert.match(output, /\.font-display/);
assert.match(output, /\.border-state-error/);
assert.match(output, /\.text-caption/);
assert.match(
output,
/\.text-signal\s*\{[^}]*font-size:\s*var\(--pw-text-signal\)/,
);
assert.doesNotMatch(
output,
/\.text-signal\s*\{[^}]*color:\s*var\(--pw-color-signal\)/,
);
assert.match(output, /\.min-h-control-compact/);
assert.match(output, /\.w-control-compact/);
assert.match(output, /var\(--pw-width-narrow\)/);
Expand Down
2 changes: 1 addition & 1 deletion tailwind.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
--color-foreground-subtle: var(--pw-color-foreground-subtle);
--color-rule: var(--pw-color-rule);
--color-accent: var(--pw-color-accent);
--color-signal: var(--pw-color-signal);
--color-brand-signal: var(--pw-color-signal);
--color-state-success: var(--pw-color-success);
--color-state-warning: var(--pw-color-warning);
--color-state-error: var(--pw-color-error);
Expand Down
17 changes: 17 additions & 0 deletions test/contracts.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ test("generates the public Tailwind utility vocabulary", async () => {
const compiler = await compile(`${tailwindCss}\n@tailwind utilities;`);
const output = compiler.build([
"bg-background",
"text-brand-signal",
"text-foreground-muted",
"text-signal",
"border-rule",
"bg-accent-clay",
"font-sans",
Expand All @@ -68,7 +70,9 @@ test("generates the public Tailwind utility vocabulary", async () => {

for (const className of [
"bg-background",
"text-brand-signal",
"text-foreground-muted",
"text-signal",
"border-rule",
"bg-accent-clay",
"font-sans",
Expand All @@ -89,4 +93,17 @@ test("generates the public Tailwind utility vocabulary", async () => {
new RegExp(`\\.${className.replaceAll("-", "\\-")}\\s*\\{`),
);
}

assert.match(
output,
/\.text-signal\s*\{[^}]*font-size:\s*var\(--pw-text-signal\)/,
);
assert.doesNotMatch(
output,
/\.text-signal\s*\{[^}]*color:\s*var\(--pw-color-signal\)/,
);
assert.match(
output,
/\.text-brand-signal\s*\{[^}]*color:\s*var\(--pw-color-signal\)/,
);
});
Loading