@designtools/docs 0.2.0 → 0.2.2
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 +12 -0
- package/dist/lib/handlers.d.ts +7 -0
- package/dist/lib/handlers.js +11 -0
- package/dist/next/pages.js +8 -23
- package/dist/styles.css +52 -80
- package/dist/swatches.d.ts +7 -6
- package/dist/swatches.js +50 -22
- package/dist/workbench.js +2 -1
- package/package.json +1 -1
- package/src/lib/handlers.ts +14 -0
- package/src/next/pages.tsx +8 -66
- package/src/swatches.tsx +199 -141
- package/src/workbench.tsx +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @designtools/docs
|
|
2
2
|
|
|
3
|
+
## 0.2.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- c4b61fb: The workbench no longer freezes on a component with a function prop it calls while rendering (Base UI's Meter and Progress, through `getAriaValueText`): only event handlers (`on…`) are logged to Actions now, so logging can never re-render the component into calling it again. The overview's section list loses its glimpses (colour dots, the logo, sample rules): each part is its name, its count and why it exists.
|
|
8
|
+
|
|
9
|
+
## 0.2.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- a6d3829: The colour page gives its samples room: no panels round them, one hairline in each sample's own colour, the mode named once over each column, surfaces and utility colours as one row each with their full names and ratios, and the on-the-page table's verdicts as one quiet line (an icon, the ratio, the word) instead of wrapping pills.
|
|
14
|
+
|
|
3
15
|
## 0.2.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { PropEntry } from "./manifest-types.js";
|
|
2
|
+
/**
|
|
3
|
+
* The props the workbench logs to its Actions tab: event handlers only. A function prop that is not a
|
|
4
|
+
* handler (getAriaValueText, a formatter, a render function) is called while the component renders, and
|
|
5
|
+
* logging it re-renders the component, which calls it again, for ever.
|
|
6
|
+
*/
|
|
7
|
+
export declare function handlerNames(props: Record<string, PropEntry>): string[];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const isFunction = (name, p) => /=>|^\(|Function|Handler/.test(p.type) || /^on[A-Z]/.test(name);
|
|
2
|
+
/**
|
|
3
|
+
* The props the workbench logs to its Actions tab: event handlers only. A function prop that is not a
|
|
4
|
+
* handler (getAriaValueText, a formatter, a render function) is called while the component renders, and
|
|
5
|
+
* logging it re-renders the component, which calls it again, for ever.
|
|
6
|
+
*/
|
|
7
|
+
export function handlerNames(props) {
|
|
8
|
+
return Object.entries(props)
|
|
9
|
+
.filter(([name, p]) => isFunction(name, p) && /^on[A-Z]/.test(name))
|
|
10
|
+
.map(([name]) => name);
|
|
11
|
+
}
|
package/dist/next/pages.js
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { ArrowRight, ArrowUpRight } from "lucide-react";
|
|
3
3
|
import Link from "next/link";
|
|
4
|
-
import { cx, display } from "../lib/cx.js";
|
|
5
4
|
import { AdherenceSummary } from "../adherence-summary.js";
|
|
6
5
|
import { Anatomy } from "../anatomy.js";
|
|
7
6
|
import { Examples } from "../examples.js";
|
|
8
7
|
import { Glossary } from "../glossary.js";
|
|
9
8
|
import { Imagery } from "../imagery.js";
|
|
10
9
|
import { groupFamilies, slugOf } from "../lib/manifest.js";
|
|
11
|
-
import { StatusBadge } from "../lib/status.js";
|
|
12
10
|
import { LogoUsage } from "../logo-usage.js";
|
|
13
11
|
import { PageActions } from "../page-actions.js";
|
|
14
12
|
import { Pattern } from "../pattern.js";
|
|
@@ -112,69 +110,56 @@ function Overview({ site }) {
|
|
|
112
110
|
const count = families.reduce((n, g) => n + g.families.length, 0);
|
|
113
111
|
const brandPages = site.editorial.filter((p) => (p.section ?? "brand") === "brand");
|
|
114
112
|
const brandFirst = brandPages[0];
|
|
115
|
-
const products = site.taxonomy.terms.filter((t) => t.kind === "product" && t.wrong?.length);
|
|
116
|
-
const example = products[0] ?? site.taxonomy.terms.find((t) => t.wrong?.length);
|
|
117
|
-
const fills = ["--primary", "--neutral", "--success", "--warning", "--destructive"].filter((n) => site.tokens.tokens.some((t) => t.name === n));
|
|
118
113
|
const share = config.adherence?.summary.share;
|
|
119
|
-
// each section of the system, why it exists
|
|
114
|
+
// each section of the system, why it exists and how much is in it
|
|
120
115
|
const sections = [];
|
|
121
116
|
if (brandFirst || site.shows("logo"))
|
|
122
117
|
sections.push({
|
|
123
118
|
title: "Brand",
|
|
124
119
|
href: `${base}/${brandFirst?.slug ?? "brand/logo"}`,
|
|
125
120
|
why: "What the brand believes, how it sounds and how it looks, so every screen and sentence comes from the same place.",
|
|
126
|
-
count: `${brandPages.length + (site.assets.assets.some((a) => a.kind === "logo") ? 1 : 0)} pages
|
|
127
|
-
preview: config.logo ? _jsx("span", { className: "flex h-10 items-center [&_img]:h-8 [&_svg]:h-8", children: config.logo }) : null,
|
|
121
|
+
count: `${brandPages.length + (site.assets.assets.some((a) => a.kind === "logo") ? 1 : 0)} pages`
|
|
128
122
|
});
|
|
129
123
|
sections.push({
|
|
130
124
|
title: "Foundations",
|
|
131
125
|
href: `${base}/colour`,
|
|
132
126
|
why: "Colour, type and the scale, generated from the tokens and measured in both modes, so nothing is a guess.",
|
|
133
127
|
count: `${site.tokens.tokens.length} tokens`,
|
|
134
|
-
preview: (_jsxs("span", { className: "flex items-center gap-4", children: [_jsx("span", { className: "flex -space-x-1.5", children: fills.map((n) => (_jsx("span", { "aria-hidden": true, className: "size-8 rounded-full ring-2 ring-canvas", style: { background: `var(${n})` } }, n))) }), _jsx("span", { "aria-hidden": true, className: cx(display, "text-3xl leading-none tracking-tight"), children: "Aa" })] })),
|
|
135
128
|
});
|
|
136
129
|
if (site.rules.rules.length)
|
|
137
130
|
sections.push({
|
|
138
131
|
title: "Rules",
|
|
139
132
|
href: `${base}/rules`,
|
|
140
133
|
why: "The lines the brand and the interface hold, each written for people, with the check that proves it.",
|
|
141
|
-
count: `${site.rules.rules.length} rules, ${site.rules.rules.filter((r) => r.status === "confirmed").length} confirmed
|
|
142
|
-
preview: (_jsx("span", { className: "flex flex-col gap-1.5 text-sm", children: site.rules.rules
|
|
143
|
-
.filter((r) => r.kind === "brand")
|
|
144
|
-
.slice(0, 2)
|
|
145
|
-
.map((r) => (_jsxs("span", { className: "flex items-center gap-2", children: [_jsx(StatusBadge, { status: r.status }), _jsx("span", { className: "truncate", children: r.title })] }, r.id))) })),
|
|
134
|
+
count: `${site.rules.rules.length} rules, ${site.rules.rules.filter((r) => r.status === "confirmed").length} confirmed`
|
|
146
135
|
});
|
|
147
136
|
if (site.shows("components") && count)
|
|
148
137
|
sections.push({
|
|
149
138
|
title: "Components",
|
|
150
139
|
href: `${base}/components/${slugOf(families[0].families[0].head)}`,
|
|
151
140
|
why: "The real components the product is built from, each with when to use it, a live workbench and an accessibility report.",
|
|
152
|
-
count: `${count} components
|
|
153
|
-
preview: (_jsx("span", { className: "flex flex-wrap gap-1.5", children: families.slice(0, 6).map((g) => (_jsxs("span", { className: "inline-flex min-h-7 items-center rounded-md bg-muted px-2 text-xs", children: [g.category, " ", _jsx("span", { className: "ml-1.5 text-muted-foreground tabular-nums", children: g.families.length })] }, g.category))) })),
|
|
141
|
+
count: `${count} components`
|
|
154
142
|
});
|
|
155
143
|
if (site.patterns.patterns.length)
|
|
156
144
|
sections.push({
|
|
157
145
|
title: "Patterns",
|
|
158
146
|
href: `${base}/patterns/${site.patterns.patterns[0].id}`,
|
|
159
147
|
why: "The screens the product keeps making, composed of the components, so a recurring problem is solved once.",
|
|
160
|
-
count: `${site.patterns.patterns.length} patterns
|
|
161
|
-
preview: _jsx("span", { className: "text-sm text-muted-foreground", children: site.patterns.patterns.slice(0, 3).map((p) => p.name).join(" · ") }),
|
|
148
|
+
count: `${site.patterns.patterns.length} patterns`
|
|
162
149
|
});
|
|
163
150
|
if (site.shows("standards") && (config.baselines || config.adherence))
|
|
164
151
|
sections.push({
|
|
165
152
|
title: "Standards",
|
|
166
153
|
href: `${base}/standards`,
|
|
167
154
|
why: "The bar the product is held to, and how closely it follows the system today, reported on every change.",
|
|
168
|
-
count: share == null ? "Baselines agreed" : `${Math.round(share * 100)}% of the product on the system
|
|
169
|
-
preview: share == null ? null : (_jsxs("span", { className: "flex w-full max-w-56 items-center gap-3", children: [_jsx("span", { className: "h-1.5 flex-1 overflow-hidden rounded-full bg-muted", children: _jsx("span", { className: "block h-full rounded-full bg-canvas-foreground", style: { width: `${Math.round(share * 100)}%` } }) }), _jsxs("span", { className: "text-sm tabular-nums", children: [Math.round(share * 100), "%"] })] })),
|
|
155
|
+
count: share == null ? "Baselines agreed" : `${Math.round(share * 100)}% of the product on the system`
|
|
170
156
|
});
|
|
171
157
|
if (site.shows("vocabulary") && site.taxonomy.terms.length)
|
|
172
158
|
sections.push({
|
|
173
159
|
title: "Vocabulary",
|
|
174
160
|
href: `${base}/vocabulary`,
|
|
175
161
|
why: "One name for each thing, and the names people reach for instead, so people and agents mean the same thing.",
|
|
176
|
-
count: `${site.taxonomy.terms.length} terms
|
|
177
|
-
preview: example ? (_jsxs("span", { className: "text-sm", children: ["Say ", _jsx("strong", { className: "font-semibold", children: example.name }), ", ", _jsx("span", { className: "text-muted-foreground line-through decoration-current/40", children: example.wrong?.[0] })] })) : null,
|
|
162
|
+
count: `${site.taxonomy.terms.length} terms`
|
|
178
163
|
});
|
|
179
164
|
const loop = [
|
|
180
165
|
["Written once", "The components, tokens and rules live in the product's own code. Nobody keeps a second copy in a slide deck or a wiki."],
|
|
@@ -183,6 +168,6 @@ function Overview({ site }) {
|
|
|
183
168
|
["Checked", "Each rule names the check that proves it. Stale docs stop a commit; everything else is reported."],
|
|
184
169
|
["Measured", "A report on every change shows how closely the product follows the system. It informs the conversation; it never blocks the work."],
|
|
185
170
|
];
|
|
186
|
-
return (_jsxs(_Fragment, { children: [!config.hero && (_jsx(DocsHeader, { title: site.title, lead: config.lead ?? "The brand and the design system in one place, for the people who make the product and the agents that build it with them.", children: _jsx(PageActions, { basePath: base }) })), _jsx(DocsSection, { title: "What's here, and why", lead: "Each part of the system has one job. Together they mean the product, its people and its agents work from the same source.", children: _jsx("ul", { "data-slot": "overview-sections", className: "grid gap-x-12 md:grid-cols-2", children: sections.map((sec) => (_jsx("li", { className: "border-t border-border", children: _jsxs(Link, { href: sec.href, className: "group flex h-full flex-col gap-4 py-7 focus-visible:outline-2 focus-visible:outline-ring", children: [_jsxs("span", { className: "flex items-baseline justify-between gap-4", children: [_jsx("span", { className: "text-2xl leading-tight tracking-tight underline-offset-[6px] group-hover:underline", children: sec.title }), _jsx("span", { className: "shrink-0 text-xs text-muted-foreground tabular-nums", children: sec.count })] }), _jsx("span", { className: "max-w-md text-base leading-relaxed text-muted-foreground", children: sec.why })
|
|
171
|
+
return (_jsxs(_Fragment, { children: [!config.hero && (_jsx(DocsHeader, { title: site.title, lead: config.lead ?? "The brand and the design system in one place, for the people who make the product and the agents that build it with them.", children: _jsx(PageActions, { basePath: base }) })), _jsx(DocsSection, { title: "What's here, and why", lead: "Each part of the system has one job. Together they mean the product, its people and its agents work from the same source.", children: _jsx("ul", { "data-slot": "overview-sections", className: "grid gap-x-12 md:grid-cols-2", children: sections.map((sec) => (_jsx("li", { className: "border-t border-border", children: _jsxs(Link, { href: sec.href, className: "group flex h-full flex-col gap-4 py-7 focus-visible:outline-2 focus-visible:outline-ring", children: [_jsxs("span", { className: "flex items-baseline justify-between gap-4", children: [_jsx("span", { className: "text-2xl leading-tight tracking-tight underline-offset-[6px] group-hover:underline", children: sec.title }), _jsx("span", { className: "shrink-0 text-xs text-muted-foreground tabular-nums", children: sec.count })] }), _jsx("span", { className: "max-w-md text-base leading-relaxed text-muted-foreground", children: sec.why })] }) }, sec.title))) }) }), config.overview?.agentic !== false && (_jsxs(DocsSection, { title: "Why this is agentic", lead: config.overview?.agenticLead ??
|
|
187
172
|
"A design system used to be a document people were asked to follow. This one is the source the product, its people and its AI agents all work from, and it checks itself.", children: [_jsx("ol", { "data-slot": "overview-loop", className: "grid gap-x-6 gap-y-8 sm:grid-cols-2 xl:grid-cols-5", children: loop.map(([title, body], i) => (_jsxs("li", { className: "relative flex flex-col gap-3 xl:pr-2", children: [_jsxs("span", { className: "flex items-center gap-3", children: [_jsx("span", { className: "grid size-8 shrink-0 place-items-center rounded-full bg-canvas-foreground text-sm font-medium text-canvas tabular-nums", children: i + 1 }), i < loop.length - 1 && _jsx("span", { "aria-hidden": true, className: "hidden h-px flex-1 bg-border xl:block" })] }), _jsx("span", { className: "text-lg leading-snug tracking-tight", children: title }), _jsx("span", { className: "text-sm leading-relaxed text-muted-foreground", children: body })] }, title))) }), _jsxs("p", { className: "flex flex-wrap items-center gap-x-2 gap-y-1 text-sm text-muted-foreground", children: ["See it the way an agent does:", _jsxs("a", { href: `${base}.md`, className: "inline-flex items-center gap-1 font-medium text-canvas-foreground underline underline-offset-4 hover:decoration-2", children: ["this page as markdown ", _jsx(ArrowUpRight, { "aria-hidden": true, className: "size-3.5" })] })] })] })), _jsx(DocsFooter, { provenance: config.provenance })] }));
|
|
188
173
|
}
|
package/dist/styles.css
CHANGED
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
--tw-rotate-z: initial;
|
|
11
11
|
--tw-skew-x: initial;
|
|
12
12
|
--tw-skew-y: initial;
|
|
13
|
-
--tw-space-x-reverse: 0;
|
|
14
13
|
--tw-divide-y-reverse: 0;
|
|
15
14
|
--tw-border-style: solid;
|
|
16
15
|
--tw-gradient-position: initial;
|
|
@@ -630,10 +629,6 @@
|
|
|
630
629
|
margin-left: .25rem;
|
|
631
630
|
}
|
|
632
631
|
|
|
633
|
-
:where([data-designtools]) .ml-1\.5:not([data-docs-content] *), .ml-1\.5:where([data-designtools]):not([data-docs-content] *) {
|
|
634
|
-
margin-left: .375rem;
|
|
635
|
-
}
|
|
636
|
-
|
|
637
632
|
:where([data-designtools]) .ml-3:not([data-docs-content] *), .ml-3:where([data-designtools]):not([data-docs-content] *) {
|
|
638
633
|
margin-left: .75rem;
|
|
639
634
|
}
|
|
@@ -751,6 +746,11 @@
|
|
|
751
746
|
height: 2.25rem;
|
|
752
747
|
}
|
|
753
748
|
|
|
749
|
+
:where([data-designtools]) .size-10:not([data-docs-content] *), .size-10:where([data-designtools]):not([data-docs-content] *) {
|
|
750
|
+
width: 2.5rem;
|
|
751
|
+
height: 2.5rem;
|
|
752
|
+
}
|
|
753
|
+
|
|
754
754
|
:where([data-designtools]) .size-14:not([data-docs-content] *), .size-14:where([data-designtools]):not([data-docs-content] *) {
|
|
755
755
|
width: 3.5rem;
|
|
756
756
|
height: 3.5rem;
|
|
@@ -778,10 +778,6 @@
|
|
|
778
778
|
height: .125rem;
|
|
779
779
|
}
|
|
780
780
|
|
|
781
|
-
:where([data-designtools]) .h-1\.5:not([data-docs-content] *), .h-1\.5:where([data-designtools]):not([data-docs-content] *) {
|
|
782
|
-
height: .375rem;
|
|
783
|
-
}
|
|
784
|
-
|
|
785
781
|
:where([data-designtools]) .h-2:not([data-docs-content] *), .h-2:where([data-designtools]):not([data-docs-content] *) {
|
|
786
782
|
height: .5rem;
|
|
787
783
|
}
|
|
@@ -818,6 +814,10 @@
|
|
|
818
814
|
height: 3rem;
|
|
819
815
|
}
|
|
820
816
|
|
|
817
|
+
:where([data-designtools]) .h-14:not([data-docs-content] *), .h-14:where([data-designtools]):not([data-docs-content] *) {
|
|
818
|
+
height: 3.5rem;
|
|
819
|
+
}
|
|
820
|
+
|
|
821
821
|
:where([data-designtools]) .h-16:not([data-docs-content] *), .h-16:where([data-designtools]):not([data-docs-content] *) {
|
|
822
822
|
height: 4rem;
|
|
823
823
|
}
|
|
@@ -894,10 +894,6 @@
|
|
|
894
894
|
min-height: 2.25rem;
|
|
895
895
|
}
|
|
896
896
|
|
|
897
|
-
:where([data-designtools]) .min-h-10:not([data-docs-content] *), .min-h-10:where([data-designtools]):not([data-docs-content] *) {
|
|
898
|
-
min-height: 2.5rem;
|
|
899
|
-
}
|
|
900
|
-
|
|
901
897
|
:where([data-designtools]) .min-h-11:not([data-docs-content] *), .min-h-11:where([data-designtools]):not([data-docs-content] *) {
|
|
902
898
|
min-height: 2.75rem;
|
|
903
899
|
}
|
|
@@ -906,14 +902,14 @@
|
|
|
906
902
|
min-height: 3rem;
|
|
907
903
|
}
|
|
908
904
|
|
|
909
|
-
:where([data-designtools]) .min-h-20:not([data-docs-content] *), .min-h-20:where([data-designtools]):not([data-docs-content] *) {
|
|
910
|
-
min-height: 5rem;
|
|
911
|
-
}
|
|
912
|
-
|
|
913
905
|
:where([data-designtools]) .min-h-28:not([data-docs-content] *), .min-h-28:where([data-designtools]):not([data-docs-content] *) {
|
|
914
906
|
min-height: 7rem;
|
|
915
907
|
}
|
|
916
908
|
|
|
909
|
+
:where([data-designtools]) .min-h-36:not([data-docs-content] *), .min-h-36:where([data-designtools]):not([data-docs-content] *) {
|
|
910
|
+
min-height: 9rem;
|
|
911
|
+
}
|
|
912
|
+
|
|
917
913
|
:where([data-designtools]) .min-h-40:not([data-docs-content] *), .min-h-40:where([data-designtools]):not([data-docs-content] *) {
|
|
918
914
|
min-height: 10rem;
|
|
919
915
|
}
|
|
@@ -970,14 +966,14 @@
|
|
|
970
966
|
width: 2.75rem;
|
|
971
967
|
}
|
|
972
968
|
|
|
973
|
-
:where([data-designtools]) .w-14:not([data-docs-content] *), .w-14:where([data-designtools]):not([data-docs-content] *) {
|
|
974
|
-
width: 3.5rem;
|
|
975
|
-
}
|
|
976
|
-
|
|
977
969
|
:where([data-designtools]) .w-28:not([data-docs-content] *), .w-28:where([data-designtools]):not([data-docs-content] *) {
|
|
978
970
|
width: 7rem;
|
|
979
971
|
}
|
|
980
972
|
|
|
973
|
+
:where([data-designtools]) .w-32:not([data-docs-content] *), .w-32:where([data-designtools]):not([data-docs-content] *) {
|
|
974
|
+
width: 8rem;
|
|
975
|
+
}
|
|
976
|
+
|
|
981
977
|
:where([data-designtools]) .w-48:not([data-docs-content] *), .w-48:where([data-designtools]):not([data-docs-content] *) {
|
|
982
978
|
width: 12rem;
|
|
983
979
|
}
|
|
@@ -1018,10 +1014,6 @@
|
|
|
1018
1014
|
max-width: 7rem;
|
|
1019
1015
|
}
|
|
1020
1016
|
|
|
1021
|
-
:where([data-designtools]) .max-w-56:not([data-docs-content] *), .max-w-56:where([data-designtools]):not([data-docs-content] *) {
|
|
1022
|
-
max-width: 14rem;
|
|
1023
|
-
}
|
|
1024
|
-
|
|
1025
1017
|
:where([data-designtools]) .max-w-64:not([data-docs-content] *), .max-w-64:where([data-designtools]):not([data-docs-content] *) {
|
|
1026
1018
|
max-width: 16rem;
|
|
1027
1019
|
}
|
|
@@ -1070,8 +1062,8 @@
|
|
|
1070
1062
|
min-width: 36rem;
|
|
1071
1063
|
}
|
|
1072
1064
|
|
|
1073
|
-
:where([data-designtools]) .min-w-\[
|
|
1074
|
-
min-width:
|
|
1065
|
+
:where([data-designtools]) .min-w-\[46rem\]:not([data-docs-content] *), .min-w-\[46rem\]:where([data-designtools]):not([data-docs-content] *) {
|
|
1066
|
+
min-width: 46rem;
|
|
1075
1067
|
}
|
|
1076
1068
|
|
|
1077
1069
|
:where([data-designtools]) .min-w-\[var\(--docs-target\,2\.75rem\)\]:not([data-docs-content] *), .min-w-\[var\(--docs-target\,2\.75rem\)\]:where([data-designtools]):not([data-docs-content] *) {
|
|
@@ -1090,6 +1082,10 @@
|
|
|
1090
1082
|
flex-shrink: 0;
|
|
1091
1083
|
}
|
|
1092
1084
|
|
|
1085
|
+
:where([data-designtools]) .table-fixed:not([data-docs-content] *), .table-fixed:where([data-designtools]):not([data-docs-content] *) {
|
|
1086
|
+
table-layout: fixed;
|
|
1087
|
+
}
|
|
1088
|
+
|
|
1093
1089
|
:where([data-designtools]) .border-collapse:not([data-docs-content] *), .border-collapse:where([data-designtools]):not([data-docs-content] *) {
|
|
1094
1090
|
border-collapse: collapse;
|
|
1095
1091
|
}
|
|
@@ -1332,12 +1328,6 @@
|
|
|
1332
1328
|
column-gap: 3rem;
|
|
1333
1329
|
}
|
|
1334
1330
|
|
|
1335
|
-
:where([data-designtools]) :where(.-space-x-1\.5 > :not(:last-child)):not([data-docs-content] *), :where(.-space-x-1\.5 > :not(:last-child)):where([data-designtools]):not([data-docs-content] *) {
|
|
1336
|
-
--tw-space-x-reverse: 0;
|
|
1337
|
-
margin-inline-start: calc(calc(.25rem * -1.5) * var(--tw-space-x-reverse));
|
|
1338
|
-
margin-inline-end: calc(calc(.25rem * -1.5) * calc(1 - var(--tw-space-x-reverse)));
|
|
1339
|
-
}
|
|
1340
|
-
|
|
1341
1331
|
:where([data-designtools]) .gap-y-1:not([data-docs-content] *), .gap-y-1:where([data-designtools]):not([data-docs-content] *) {
|
|
1342
1332
|
row-gap: .25rem;
|
|
1343
1333
|
}
|
|
@@ -1507,10 +1497,6 @@
|
|
|
1507
1497
|
border-style: solid;
|
|
1508
1498
|
}
|
|
1509
1499
|
|
|
1510
|
-
:where([data-designtools]) .border-\(--border\):not([data-docs-content] *), .border-\(--border\):where([data-designtools]):not([data-docs-content] *) {
|
|
1511
|
-
border-color: var(--border);
|
|
1512
|
-
}
|
|
1513
|
-
|
|
1514
1500
|
:where([data-designtools]) .border-border:not([data-docs-content] *), .border-border:where([data-designtools]):not([data-docs-content] *) {
|
|
1515
1501
|
border-color: var(--border, #e2e4e8);
|
|
1516
1502
|
}
|
|
@@ -1896,10 +1882,6 @@
|
|
|
1896
1882
|
padding-top: 1.5rem;
|
|
1897
1883
|
}
|
|
1898
1884
|
|
|
1899
|
-
:where([data-designtools]) .pt-8:not([data-docs-content] *), .pt-8:where([data-designtools]):not([data-docs-content] *) {
|
|
1900
|
-
padding-top: 2rem;
|
|
1901
|
-
}
|
|
1902
|
-
|
|
1903
1885
|
:where([data-designtools]) .pt-10:not([data-docs-content] *), .pt-10:where([data-designtools]):not([data-docs-content] *) {
|
|
1904
1886
|
padding-top: 2.5rem;
|
|
1905
1887
|
}
|
|
@@ -1960,6 +1942,10 @@
|
|
|
1960
1942
|
padding-bottom: 1rem;
|
|
1961
1943
|
}
|
|
1962
1944
|
|
|
1945
|
+
:where([data-designtools]) .pb-5:not([data-docs-content] *), .pb-5:where([data-designtools]):not([data-docs-content] *) {
|
|
1946
|
+
padding-bottom: 1.25rem;
|
|
1947
|
+
}
|
|
1948
|
+
|
|
1963
1949
|
:where([data-designtools]) .pb-20:not([data-docs-content] *), .pb-20:where([data-designtools]):not([data-docs-content] *) {
|
|
1964
1950
|
padding-bottom: 5rem;
|
|
1965
1951
|
}
|
|
@@ -1996,6 +1982,10 @@
|
|
|
1996
1982
|
vertical-align: middle;
|
|
1997
1983
|
}
|
|
1998
1984
|
|
|
1985
|
+
:where([data-designtools]) .align-top:not([data-docs-content] *), .align-top:where([data-designtools]):not([data-docs-content] *) {
|
|
1986
|
+
vertical-align: top;
|
|
1987
|
+
}
|
|
1988
|
+
|
|
1999
1989
|
:where([data-designtools]) .\[font-family\:var\(--docs-display\,var\(--font-display\,var\(--font-sans\)\)\)\]:not([data-docs-content] *), .\[font-family\:var\(--docs-display\,var\(--font-display\,var\(--font-sans\)\)\)\]:where([data-designtools]):not([data-docs-content] *) {
|
|
2000
1990
|
font-family: var(--docs-display, var(--font-display, var(--font-sans)));
|
|
2001
1991
|
}
|
|
@@ -2326,8 +2316,8 @@
|
|
|
2326
2316
|
opacity: .7;
|
|
2327
2317
|
}
|
|
2328
2318
|
|
|
2329
|
-
:where([data-designtools]) .opacity-
|
|
2330
|
-
opacity: .
|
|
2319
|
+
:where([data-designtools]) .opacity-80:not([data-docs-content] *), .opacity-80:where([data-designtools]):not([data-docs-content] *) {
|
|
2320
|
+
opacity: .8;
|
|
2331
2321
|
}
|
|
2332
2322
|
|
|
2333
2323
|
:where([data-designtools]) .shadow:not([data-docs-content] *), .shadow:where([data-designtools]):not([data-docs-content] *) {
|
|
@@ -2410,26 +2400,31 @@
|
|
|
2410
2400
|
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
2411
2401
|
}
|
|
2412
2402
|
|
|
2413
|
-
:where([data-designtools]) .ring
|
|
2414
|
-
--tw-ring-
|
|
2415
|
-
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
2403
|
+
:where([data-designtools]) .ring-\(--border\):not([data-docs-content] *), .ring-\(--border\):where([data-designtools]):not([data-docs-content] *) {
|
|
2404
|
+
--tw-ring-color: var(--border);
|
|
2416
2405
|
}
|
|
2417
2406
|
|
|
2418
|
-
:where([data-designtools]) .ring-
|
|
2419
|
-
--tw-ring-color: var(--
|
|
2407
|
+
:where([data-designtools]) .ring-\(--canvas-foreground\)\/15:not([data-docs-content] *), .ring-\(--canvas-foreground\)\/15:where([data-designtools]):not([data-docs-content] *) {
|
|
2408
|
+
--tw-ring-color: var(--canvas-foreground);
|
|
2420
2409
|
}
|
|
2421
2410
|
|
|
2422
|
-
:
|
|
2423
|
-
|
|
2411
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
2412
|
+
:where([data-designtools]) .ring-\(--canvas-foreground\)\/15:not([data-docs-content] *), .ring-\(--canvas-foreground\)\/15:where([data-designtools]):not([data-docs-content] *) {
|
|
2413
|
+
--tw-ring-color: color-mix(in oklab, var(--canvas-foreground) 15%, transparent);
|
|
2414
|
+
}
|
|
2424
2415
|
}
|
|
2425
2416
|
|
|
2426
|
-
:where([data-designtools]) .ring-
|
|
2417
|
+
:where([data-designtools]) .ring-border:not([data-docs-content] *), .ring-border:where([data-designtools]):not([data-docs-content] *) {
|
|
2418
|
+
--tw-ring-color: var(--border, #e2e4e8);
|
|
2419
|
+
}
|
|
2420
|
+
|
|
2421
|
+
:where([data-designtools]) .ring-current\/15:not([data-docs-content] *), .ring-current\/15:where([data-designtools]):not([data-docs-content] *) {
|
|
2427
2422
|
--tw-ring-color: currentcolor;
|
|
2428
2423
|
}
|
|
2429
2424
|
|
|
2430
2425
|
@supports (color: color-mix(in lab, red, red)) {
|
|
2431
|
-
:where([data-designtools]) .ring-current\/
|
|
2432
|
-
--tw-ring-color: color-mix(in oklab, currentcolor
|
|
2426
|
+
:where([data-designtools]) .ring-current\/15:not([data-docs-content] *), .ring-current\/15:where([data-designtools]):not([data-docs-content] *) {
|
|
2427
|
+
--tw-ring-color: color-mix(in oklab, currentcolor 15%, transparent);
|
|
2433
2428
|
}
|
|
2434
2429
|
}
|
|
2435
2430
|
|
|
@@ -2678,15 +2673,6 @@
|
|
|
2678
2673
|
margin-left: -.375rem;
|
|
2679
2674
|
}
|
|
2680
2675
|
|
|
2681
|
-
:where([data-designtools]) .first\:border-t-0:first-child:not([data-docs-content] *), .first\:border-t-0:first-child:where([data-designtools]):not([data-docs-content] *) {
|
|
2682
|
-
border-top-style: var(--tw-border-style);
|
|
2683
|
-
border-top-width: 0;
|
|
2684
|
-
}
|
|
2685
|
-
|
|
2686
|
-
:where([data-designtools]) .first\:pt-0:first-child:not([data-docs-content] *), .first\:pt-0:first-child:where([data-designtools]):not([data-docs-content] *) {
|
|
2687
|
-
padding-top: 0;
|
|
2688
|
-
}
|
|
2689
|
-
|
|
2690
2676
|
:where([data-designtools]) .first\:pt-1:first-child:not([data-docs-content] *), .first\:pt-1:first-child:where([data-designtools]):not([data-docs-content] *) {
|
|
2691
2677
|
padding-top: .25rem;
|
|
2692
2678
|
}
|
|
@@ -3040,6 +3026,10 @@
|
|
|
3040
3026
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
3041
3027
|
}
|
|
3042
3028
|
|
|
3029
|
+
:where([data-designtools]) .md\:grid-cols-\[9rem_repeat\(var\(--modes\)\,minmax\(0\,1fr\)\)\]:not([data-docs-content] *), .md\:grid-cols-\[9rem_repeat\(var\(--modes\)\,minmax\(0\,1fr\)\)\]:where([data-designtools]):not([data-docs-content] *) {
|
|
3030
|
+
grid-template-columns: 9rem repeat(var(--modes),minmax(0,1fr));
|
|
3031
|
+
}
|
|
3032
|
+
|
|
3043
3033
|
:where([data-designtools]) .md\:grid-cols-\[11rem_minmax\(0\,1fr\)\]:not([data-docs-content] *), .md\:grid-cols-\[11rem_minmax\(0\,1fr\)\]:where([data-designtools]):not([data-docs-content] *) {
|
|
3044
3034
|
grid-template-columns: 11rem minmax(0, 1fr);
|
|
3045
3035
|
}
|
|
@@ -3159,10 +3149,6 @@
|
|
|
3159
3149
|
grid-template-columns: 3rem minmax(0, 1fr);
|
|
3160
3150
|
}
|
|
3161
3151
|
|
|
3162
|
-
:where([data-designtools]) .lg\:grid-cols-\[11rem_minmax\(0\,1fr\)\]:not([data-docs-content] *), .lg\:grid-cols-\[11rem_minmax\(0\,1fr\)\]:where([data-designtools]):not([data-docs-content] *) {
|
|
3163
|
-
grid-template-columns: 11rem minmax(0, 1fr);
|
|
3164
|
-
}
|
|
3165
|
-
|
|
3166
3152
|
:where([data-designtools]) .lg\:grid-cols-\[19rem_minmax\(0\,1fr\)\]:not([data-docs-content] *), .lg\:grid-cols-\[19rem_minmax\(0\,1fr\)\]:where([data-designtools]):not([data-docs-content] *) {
|
|
3167
3153
|
grid-template-columns: 19rem minmax(0, 1fr);
|
|
3168
3154
|
}
|
|
@@ -3294,10 +3280,6 @@
|
|
|
3294
3280
|
font-size: .875em;
|
|
3295
3281
|
}
|
|
3296
3282
|
|
|
3297
|
-
:where([data-designtools]) .\[\&_img\]\:h-8 img:not([data-docs-content] *), .\[\&_img\]\:h-8 img:where([data-designtools]):not([data-docs-content] *) {
|
|
3298
|
-
height: 2rem;
|
|
3299
|
-
}
|
|
3300
|
-
|
|
3301
3283
|
:where([data-designtools]) .\[\&_pre\]\:break-words pre:not([data-docs-content] *), .\[\&_pre\]\:break-words pre:where([data-designtools]):not([data-docs-content] *) {
|
|
3302
3284
|
overflow-wrap: break-word;
|
|
3303
3285
|
}
|
|
@@ -3306,10 +3288,6 @@
|
|
|
3306
3288
|
white-space: pre-wrap;
|
|
3307
3289
|
}
|
|
3308
3290
|
|
|
3309
|
-
:where([data-designtools]) .\[\&_svg\]\:h-8 svg:not([data-docs-content] *), .\[\&_svg\]\:h-8 svg:where([data-designtools]):not([data-docs-content] *) {
|
|
3310
|
-
height: 2rem;
|
|
3311
|
-
}
|
|
3312
|
-
|
|
3313
3291
|
:where([data-designtools]) .\[\&\:\:-webkit-details-marker\]\:hidden:not([data-docs-content] *)::-webkit-details-marker, .\[\&\:\:-webkit-details-marker\]\:hidden:where([data-designtools]):not([data-docs-content] *)::-webkit-details-marker {
|
|
3314
3292
|
display: none;
|
|
3315
3293
|
}
|
|
@@ -3362,12 +3340,6 @@
|
|
|
3362
3340
|
inherits: false
|
|
3363
3341
|
}
|
|
3364
3342
|
|
|
3365
|
-
@property --tw-space-x-reverse {
|
|
3366
|
-
syntax: "*";
|
|
3367
|
-
inherits: false;
|
|
3368
|
-
initial-value: 0;
|
|
3369
|
-
}
|
|
3370
|
-
|
|
3371
3343
|
@property --tw-divide-y-reverse {
|
|
3372
3344
|
syntax: "*";
|
|
3373
3345
|
inherits: false;
|
package/dist/swatches.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { type Mode } from "./lib/manifest.js";
|
|
2
2
|
import type { TokensManifest } from "./lib/manifest-types.js";
|
|
3
3
|
/**
|
|
4
|
-
* Colour, painted from the tokens rather than restated.
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* every pair's contrast is measured on the colours
|
|
4
|
+
* Colour, painted from the tokens rather than restated. No panels and no cards around the samples:
|
|
5
|
+
* each sample is its own colour, with one hairline round it, set on the page in a light and a dark
|
|
6
|
+
* column. Each colour with a subdued pair shows its fill large, then subdued, hover and press; then
|
|
7
|
+
* the surfaces and the utility colours, one row each. Every sample sits inside its own `data-theme`,
|
|
8
|
+
* so dark is shown as the dark tokens resolve, and every pair's contrast is measured on the colours
|
|
9
|
+
* the browser actually paints.
|
|
9
10
|
*/
|
|
10
11
|
export declare function SemanticSwatches({ tokens, modes, }: {
|
|
11
12
|
tokens: TokensManifest;
|
|
@@ -15,7 +16,7 @@ export declare function SemanticSwatches({ tokens, modes, }: {
|
|
|
15
16
|
* Each colour on each background, per mode: a label is measured on its own fill, and this is
|
|
16
17
|
* everything else, red text on the page, a brand fill on a dark section. Backgrounds are the
|
|
17
18
|
* canvas, surface and overlay and every named `--surface-<name>`; colours are each semantic fill
|
|
18
|
-
* and muted text.
|
|
19
|
+
* and muted text. Text: fine as text (4.5:1); shape: fine as a shape only (3:1); none: neither.
|
|
19
20
|
* Measured on what the browser paints, inside each mode's `data-theme`.
|
|
20
21
|
*/
|
|
21
22
|
export declare function PageContrast({ tokens, modes }: {
|