@hanzo/design 0.5.0 → 0.5.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/LICENSE +10 -24
- package/README.md +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/preference.d.ts +65 -0
- package/dist/preference.d.ts.map +1 -0
- package/dist/preference.js +102 -0
- package/dist/tokens.gen.d.ts +88 -70
- package/dist/tokens.gen.d.ts.map +1 -1
- package/dist/tokens.gen.js +88 -70
- package/guidelines/brand-paper.card.html +22 -0
- package/package.json +8 -6
- package/prompts/rules.md +3 -1
- package/prompts/system.md +8 -2
- package/scripts/check-dist.mjs +81 -0
- package/scripts/check-preference.mjs +168 -0
- package/scripts/check-tokens.mjs +60 -0
- package/skills/design-system/SKILL.md +4 -2
- package/src/index.ts +6 -0
- package/src/preference.ts +122 -0
- package/src/tokens.gen.ts +88 -70
- package/styles.css +117 -50
- package/tailwind.css +117 -50
- package/tokens/base.css +33 -13
- package/tokens/colors.css +9 -9
- package/tokens/elevation.css +35 -0
- package/tokens/spacing.css +20 -14
- package/tokens/typography.css +20 -14
package/LICENSE
CHANGED
|
@@ -1,28 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
Licensed under either of
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
* Apache License, Version 2.0 (LICENSE-APACHE or
|
|
4
|
+
https://www.apache.org/licenses/LICENSE-2.0)
|
|
5
|
+
* MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)
|
|
4
6
|
|
|
5
|
-
|
|
6
|
-
modification, are permitted provided that the following conditions are met:
|
|
7
|
+
at your option.
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
Unless you explicitly state otherwise, any contribution intentionally
|
|
10
|
+
submitted for inclusion in the work by you, as defined in the Apache-2.0
|
|
11
|
+
license, shall be dual licensed as above, without any additional terms or
|
|
12
|
+
conditions.
|
|
10
13
|
|
|
11
|
-
|
|
12
|
-
this list of conditions and the following disclaimer in the documentation
|
|
13
|
-
and/or other materials provided with the distribution.
|
|
14
|
-
|
|
15
|
-
3. Neither the name of the copyright holder nor the names of its
|
|
16
|
-
contributors may be used to endorse or promote products derived from
|
|
17
|
-
this software without specific prior written permission.
|
|
18
|
-
|
|
19
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
20
|
-
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
21
|
-
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
22
|
-
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
23
|
-
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
24
|
-
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
25
|
-
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
26
|
-
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
27
|
-
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
28
|
-
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
14
|
+
See HIP-0137 (hanzoai/hips) for the standard this follows.
|
package/README.md
CHANGED
|
@@ -126,7 +126,7 @@ Tokens track `hanzo.ai` (`app/globals.css`, `tailwind.config.ts`, `DESIGN.md`) a
|
|
|
126
126
|
|
|
127
127
|
## License
|
|
128
128
|
|
|
129
|
-
|
|
129
|
+
MIT OR Apache-2.0, per [HIP-0137](https://github.com/hanzoai/hips/blob/main/HIPs/hip-0137-one-license.md). Brand marks (the Hanzo logo, partner and provider logos) are the property of their respective owners and are provided for identification.
|
|
130
130
|
|
|
131
131
|
## Using it in a Tailwind app
|
|
132
132
|
|
package/dist/index.d.ts
CHANGED
|
@@ -34,4 +34,6 @@ export declare function tokenValue(name: CssVarName): string | undefined;
|
|
|
34
34
|
* bare. Pass a URL you serve.
|
|
35
35
|
*/
|
|
36
36
|
export declare function injectDesignCss(href: string): void;
|
|
37
|
+
export { vars, css, isColor, TYPE_MIN, TYPE_MAX } from './preference.js';
|
|
38
|
+
export type { Preference, Density } from './preference.js';
|
|
37
39
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAWA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,YAAY,CAAA;AAC1B,OAAO,EAAW,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAE1D,uFAAuF;AACvF,MAAM,MAAM,SAAS,GAAG,UAAU,SAAS,KAAK,MAAM,CAAC,EAAE,GAAG,CAAC,GAAG,KAAK,CAAA;AAErE;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,UAAU,GAAG,SAAS,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAI9E;AAED,oFAAoF;AACpF,wBAAgB,UAAU,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,GAAG,SAAS,CAE/D;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAQlD"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAWA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,YAAY,CAAA;AAC1B,OAAO,EAAW,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAE1D,uFAAuF;AACvF,MAAM,MAAM,SAAS,GAAG,UAAU,SAAS,KAAK,MAAM,CAAC,EAAE,GAAG,CAAC,GAAG,KAAK,CAAA;AAErE;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,UAAU,GAAG,SAAS,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAI9E;AAED,oFAAoF;AACpF,wBAAgB,UAAU,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,GAAG,SAAS,CAE/D;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAQlD;AAKD,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACzE,YAAY,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -59,3 +59,7 @@ export function injectDesignCss(href) {
|
|
|
59
59
|
l.setAttribute('data-hanzo-design', '');
|
|
60
60
|
document.head.appendChild(l);
|
|
61
61
|
}
|
|
62
|
+
// A person's own reading of the system — type size, density, accent — as CSS
|
|
63
|
+
// custom properties. Pure: it maps a preference to variables and returns them,
|
|
64
|
+
// so an app, an embedded preview and a server render all apply it the same way.
|
|
65
|
+
export { vars, css, isColor, TYPE_MIN, TYPE_MAX } from './preference.js';
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A person's own reading of the system: type size, density, accent.
|
|
3
|
+
*
|
|
4
|
+
* Three knobs, and each is ONE multiplier on a whole axis — never a restated
|
|
5
|
+
* ramp. The ramps live in `tokens/*.css`, authored once, and each rung carries
|
|
6
|
+
* its own `calc(<base> * var(--type-scale, 1))`. So a preference sets three
|
|
7
|
+
* numbers and every rung follows, including rungs added later and rungs this
|
|
8
|
+
* file has never heard of.
|
|
9
|
+
*
|
|
10
|
+
* That is not a style choice; it is the fix for a real bug. The first version of
|
|
11
|
+
* this module kept its own copy of the type ramp so it could recompute each
|
|
12
|
+
* rung, and the copy was WRONG — it had `lg: 1rem` and `xl: 1.125rem` (16px and
|
|
13
|
+
* 18px) while `tokens/typography.css` says `0.9375rem` and `1.0625rem` (15px and
|
|
14
|
+
* 17px). Setting a preference of 1 — "leave it alone" — would have silently
|
|
15
|
+
* resized two rungs of the published design. A second copy of a value is a
|
|
16
|
+
* second source of truth, and it drifted before anyone used it.
|
|
17
|
+
*
|
|
18
|
+
* Because the knobs are plain multipliers, any OTHER ramp can opt in the same
|
|
19
|
+
* way. @hanzo/gui compiles its own `--f-size-*` scale for the 1600-odd
|
|
20
|
+
* `fontSize="$n"` call sites in the apps; an app that redeclares those as
|
|
21
|
+
* `calc(<its px> * var(--type-scale, 1))` gets the same control with no change
|
|
22
|
+
* at scale 1.
|
|
23
|
+
*
|
|
24
|
+
* It is a pure function on purpose: it maps a preference to custom properties
|
|
25
|
+
* and returns them, touching no document. That is what lets an app, an embedded
|
|
26
|
+
* preview and a server render apply it identically.
|
|
27
|
+
*/
|
|
28
|
+
export type Density = "compact" | "default" | "comfortable";
|
|
29
|
+
export interface Preference {
|
|
30
|
+
/** Multiplier on the type ramp. 1 is the published scale. */
|
|
31
|
+
type?: number;
|
|
32
|
+
density?: Density;
|
|
33
|
+
/** A CSS colour for --primary / --accent. Rejected unless it is one. */
|
|
34
|
+
accent?: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* The type multiplier is CLAMPED, and the bounds are not arbitrary.
|
|
38
|
+
*
|
|
39
|
+
* Below 0.85 the smallest rung (--text-xs, 11px) drops under 9.4px, which stops
|
|
40
|
+
* being small and starts being unreadable — and a preference that lets someone
|
|
41
|
+
* render their own tools illegible is a trap, not a choice. Above 1.4 the
|
|
42
|
+
* chrome stops fitting its own containers: this app's builder header already
|
|
43
|
+
* overlaps its actions below 1440px at scale 1.
|
|
44
|
+
*/
|
|
45
|
+
export declare const TYPE_MIN = 0.85;
|
|
46
|
+
export declare const TYPE_MAX = 1.4;
|
|
47
|
+
/**
|
|
48
|
+
* Is this a colour, or is it something being smuggled into a style attribute?
|
|
49
|
+
*
|
|
50
|
+
* A preference is user input and its destination is CSS. `#fff`, `rgb(...)`,
|
|
51
|
+
* `oklch(...)` and the bare keywords are colours; anything carrying a `;`, a
|
|
52
|
+
* `}`, or a `url(` is trying to be a second declaration, and the answer is to
|
|
53
|
+
* drop the axis rather than to sanitise a string into something plausible.
|
|
54
|
+
*/
|
|
55
|
+
export declare function isColor(v: string): boolean;
|
|
56
|
+
/**
|
|
57
|
+
* The custom properties a preference produces.
|
|
58
|
+
*
|
|
59
|
+
* Only the axes actually set appear, so an app can spread the result over
|
|
60
|
+
* whatever it already has without a default silently overriding a brand.
|
|
61
|
+
*/
|
|
62
|
+
export declare function vars(p: Preference): Record<string, string>;
|
|
63
|
+
/** `vars()` as a declaration block, for a <style> tag or an SSR inline. */
|
|
64
|
+
export declare function css(p: Preference, selector?: string): string;
|
|
65
|
+
//# sourceMappingURL=preference.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preference.d.ts","sourceRoot":"","sources":["../src/preference.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,MAAM,MAAM,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,aAAa,CAAC;AAE5D,MAAM,WAAW,UAAU;IACzB,6DAA6D;IAC7D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,wEAAwE;IACxE,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,QAAQ,OAAO,CAAC;AAC7B,eAAO,MAAM,QAAQ,MAAM,CAAC;AAqB5B;;;;;;;GAOG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAS1C;AAED;;;;;GAKG;AACH,wBAAgB,IAAI,CAAC,CAAC,EAAE,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAmB1D;AAED,2EAA2E;AAC3E,wBAAgB,GAAG,CAAC,CAAC,EAAE,UAAU,EAAE,QAAQ,SAAc,GAAG,MAAM,CAKjE"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A person's own reading of the system: type size, density, accent.
|
|
3
|
+
*
|
|
4
|
+
* Three knobs, and each is ONE multiplier on a whole axis — never a restated
|
|
5
|
+
* ramp. The ramps live in `tokens/*.css`, authored once, and each rung carries
|
|
6
|
+
* its own `calc(<base> * var(--type-scale, 1))`. So a preference sets three
|
|
7
|
+
* numbers and every rung follows, including rungs added later and rungs this
|
|
8
|
+
* file has never heard of.
|
|
9
|
+
*
|
|
10
|
+
* That is not a style choice; it is the fix for a real bug. The first version of
|
|
11
|
+
* this module kept its own copy of the type ramp so it could recompute each
|
|
12
|
+
* rung, and the copy was WRONG — it had `lg: 1rem` and `xl: 1.125rem` (16px and
|
|
13
|
+
* 18px) while `tokens/typography.css` says `0.9375rem` and `1.0625rem` (15px and
|
|
14
|
+
* 17px). Setting a preference of 1 — "leave it alone" — would have silently
|
|
15
|
+
* resized two rungs of the published design. A second copy of a value is a
|
|
16
|
+
* second source of truth, and it drifted before anyone used it.
|
|
17
|
+
*
|
|
18
|
+
* Because the knobs are plain multipliers, any OTHER ramp can opt in the same
|
|
19
|
+
* way. @hanzo/gui compiles its own `--f-size-*` scale for the 1600-odd
|
|
20
|
+
* `fontSize="$n"` call sites in the apps; an app that redeclares those as
|
|
21
|
+
* `calc(<its px> * var(--type-scale, 1))` gets the same control with no change
|
|
22
|
+
* at scale 1.
|
|
23
|
+
*
|
|
24
|
+
* It is a pure function on purpose: it maps a preference to custom properties
|
|
25
|
+
* and returns them, touching no document. That is what lets an app, an embedded
|
|
26
|
+
* preview and a server render apply it identically.
|
|
27
|
+
*/
|
|
28
|
+
/**
|
|
29
|
+
* The type multiplier is CLAMPED, and the bounds are not arbitrary.
|
|
30
|
+
*
|
|
31
|
+
* Below 0.85 the smallest rung (--text-xs, 11px) drops under 9.4px, which stops
|
|
32
|
+
* being small and starts being unreadable — and a preference that lets someone
|
|
33
|
+
* render their own tools illegible is a trap, not a choice. Above 1.4 the
|
|
34
|
+
* chrome stops fitting its own containers: this app's builder header already
|
|
35
|
+
* overlaps its actions below 1440px at scale 1.
|
|
36
|
+
*/
|
|
37
|
+
export const TYPE_MIN = 0.85;
|
|
38
|
+
export const TYPE_MAX = 1.4;
|
|
39
|
+
/**
|
|
40
|
+
* Density moves SPACING only, and its range is much tighter than type's.
|
|
41
|
+
*
|
|
42
|
+
* Spacing compounds: a page nests padding inside gap inside margin, so a 0.75
|
|
43
|
+
* multiplier is already three-quarters of every one of those in sequence. Below
|
|
44
|
+
* that, touch targets fall under the 44px floor `base.css` sets for coarse
|
|
45
|
+
* pointers, and the control that promised comfort takes it away.
|
|
46
|
+
*/
|
|
47
|
+
const DENSITY = {
|
|
48
|
+
compact: 0.85,
|
|
49
|
+
default: 1,
|
|
50
|
+
comfortable: 1.15,
|
|
51
|
+
};
|
|
52
|
+
const clamp = (n, lo, hi) => Math.min(hi, Math.max(lo, n));
|
|
53
|
+
/** Trim to 4dp so a multiplier cannot emit a 17-digit float into a stylesheet. */
|
|
54
|
+
const round = (n) => String(Math.round(n * 10000) / 10000);
|
|
55
|
+
/**
|
|
56
|
+
* Is this a colour, or is it something being smuggled into a style attribute?
|
|
57
|
+
*
|
|
58
|
+
* A preference is user input and its destination is CSS. `#fff`, `rgb(...)`,
|
|
59
|
+
* `oklch(...)` and the bare keywords are colours; anything carrying a `;`, a
|
|
60
|
+
* `}`, or a `url(` is trying to be a second declaration, and the answer is to
|
|
61
|
+
* drop the axis rather than to sanitise a string into something plausible.
|
|
62
|
+
*/
|
|
63
|
+
export function isColor(v) {
|
|
64
|
+
const s = v.trim();
|
|
65
|
+
if (!s || s.length > 64)
|
|
66
|
+
return false;
|
|
67
|
+
if (/[;{}()]/.test(s) && !/^(rgb|rgba|hsl|hsla|oklch|oklab|lab|lch|color)\([^;{}]*\)$/i.test(s))
|
|
68
|
+
return false;
|
|
69
|
+
return (/^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i.test(s) ||
|
|
70
|
+
/^(rgb|rgba|hsl|hsla|oklch|oklab|lab|lch|color)\([^;{}]*\)$/i.test(s) ||
|
|
71
|
+
/^[a-z]{3,20}$/i.test(s));
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* The custom properties a preference produces.
|
|
75
|
+
*
|
|
76
|
+
* Only the axes actually set appear, so an app can spread the result over
|
|
77
|
+
* whatever it already has without a default silently overriding a brand.
|
|
78
|
+
*/
|
|
79
|
+
export function vars(p) {
|
|
80
|
+
const out = {};
|
|
81
|
+
if (typeof p.type === "number" && Number.isFinite(p.type)) {
|
|
82
|
+
out["--type-scale"] = round(clamp(p.type, TYPE_MIN, TYPE_MAX));
|
|
83
|
+
}
|
|
84
|
+
if (p.density && p.density in DENSITY) {
|
|
85
|
+
out["--density"] = round(DENSITY[p.density]);
|
|
86
|
+
}
|
|
87
|
+
if (p.accent && isColor(p.accent)) {
|
|
88
|
+
// Both names, because the ramp uses --primary for action surfaces and
|
|
89
|
+
// --accent for selection. One hue, stated once, landing on both.
|
|
90
|
+
out["--primary"] = p.accent.trim();
|
|
91
|
+
out["--accent"] = p.accent.trim();
|
|
92
|
+
}
|
|
93
|
+
return out;
|
|
94
|
+
}
|
|
95
|
+
/** `vars()` as a declaration block, for a <style> tag or an SSR inline. */
|
|
96
|
+
export function css(p, selector = "html:root") {
|
|
97
|
+
const v = vars(p);
|
|
98
|
+
const keys = Object.keys(v);
|
|
99
|
+
if (!keys.length)
|
|
100
|
+
return "";
|
|
101
|
+
return `${selector}{${keys.map((k) => `${k}:${v[k]}`).join(";")}}`;
|
|
102
|
+
}
|
package/dist/tokens.gen.d.ts
CHANGED
|
@@ -91,31 +91,32 @@ export declare const colors: {
|
|
|
91
91
|
};
|
|
92
92
|
/** typography tokens (from tokens/typography.css). Values are raw CSS. */
|
|
93
93
|
export declare const typography: {
|
|
94
|
-
readonly '
|
|
95
|
-
readonly '
|
|
96
|
-
readonly '
|
|
97
|
-
readonly '
|
|
98
|
-
readonly '
|
|
99
|
-
readonly '
|
|
100
|
-
readonly '
|
|
101
|
-
readonly '
|
|
102
|
-
readonly '
|
|
103
|
-
readonly '
|
|
104
|
-
readonly '
|
|
105
|
-
readonly '
|
|
106
|
-
readonly '
|
|
107
|
-
readonly '
|
|
108
|
-
readonly '
|
|
109
|
-
readonly '
|
|
110
|
-
readonly '
|
|
94
|
+
readonly 'type-scale': "1";
|
|
95
|
+
readonly 'text-xs': "calc(0.6875rem * var(--type-scale, 1))";
|
|
96
|
+
readonly 'leading-xs': "calc(1rem * var(--type-scale, 1))";
|
|
97
|
+
readonly 'text-sm': "calc(0.8125rem * var(--type-scale, 1))";
|
|
98
|
+
readonly 'leading-sm': "calc(1.15rem * var(--type-scale, 1))";
|
|
99
|
+
readonly 'text-base': "calc(0.875rem * var(--type-scale, 1))";
|
|
100
|
+
readonly 'leading-base': "calc(1.35rem * var(--type-scale, 1))";
|
|
101
|
+
readonly 'text-lg': "calc(0.9375rem * var(--type-scale, 1))";
|
|
102
|
+
readonly 'leading-lg': "calc(1.4rem * var(--type-scale, 1))";
|
|
103
|
+
readonly 'text-xl': "calc(1.0625rem * var(--type-scale, 1))";
|
|
104
|
+
readonly 'leading-xl': "calc(1.55rem * var(--type-scale, 1))";
|
|
105
|
+
readonly 'text-2xl': "calc(1.3125rem * var(--type-scale, 1))";
|
|
106
|
+
readonly 'leading-2xl': "calc(1.7rem * var(--type-scale, 1))";
|
|
107
|
+
readonly 'text-3xl': "calc(1.625rem * var(--type-scale, 1))";
|
|
108
|
+
readonly 'leading-3xl': "calc(1.95rem * var(--type-scale, 1))";
|
|
109
|
+
readonly 'text-4xl': "calc(2rem * var(--type-scale, 1))";
|
|
110
|
+
readonly 'leading-4xl': "calc(2.25rem * var(--type-scale, 1))";
|
|
111
|
+
readonly 'text-5xl': "calc(2.5rem * var(--type-scale, 1))";
|
|
111
112
|
readonly 'leading-5xl': "1.05";
|
|
112
|
-
readonly 'text-6xl': "3.25rem";
|
|
113
|
+
readonly 'text-6xl': "calc(3.25rem * var(--type-scale, 1))";
|
|
113
114
|
readonly 'leading-6xl': "1";
|
|
114
|
-
readonly 'text-7xl': "4rem";
|
|
115
|
+
readonly 'text-7xl': "calc(4rem * var(--type-scale, 1))";
|
|
115
116
|
readonly 'leading-7xl': "1";
|
|
116
|
-
readonly 'text-8xl': "5.25rem";
|
|
117
|
+
readonly 'text-8xl': "calc(5.25rem * var(--type-scale, 1))";
|
|
117
118
|
readonly 'leading-8xl': "1";
|
|
118
|
-
readonly 'text-9xl': "7rem";
|
|
119
|
+
readonly 'text-9xl': "calc(7rem * var(--type-scale, 1))";
|
|
119
120
|
readonly 'leading-9xl': "1";
|
|
120
121
|
readonly 'font-size-xs': "var(--text-xs)";
|
|
121
122
|
readonly 'font-size-sm': "var(--text-sm)";
|
|
@@ -156,21 +157,22 @@ export declare const typography: {
|
|
|
156
157
|
};
|
|
157
158
|
/** spacing tokens (from tokens/spacing.css). Values are raw CSS. */
|
|
158
159
|
export declare const spacing: {
|
|
160
|
+
readonly density: "1";
|
|
159
161
|
readonly 'space-0': "0";
|
|
160
|
-
readonly 'space-1': "0.25rem";
|
|
161
|
-
readonly 'space-2': "0.5rem";
|
|
162
|
-
readonly 'space-3': "0.75rem";
|
|
163
|
-
readonly 'space-4': "1rem";
|
|
164
|
-
readonly 'space-5': "1.25rem";
|
|
165
|
-
readonly 'space-6': "1.5rem";
|
|
166
|
-
readonly 'space-8': "2rem";
|
|
167
|
-
readonly 'space-10': "2.5rem";
|
|
168
|
-
readonly 'space-12': "3rem";
|
|
169
|
-
readonly 'space-14': "3.5rem";
|
|
170
|
-
readonly 'space-16': "4rem";
|
|
171
|
-
readonly 'space-20': "5rem";
|
|
172
|
-
readonly 'space-24': "6rem";
|
|
173
|
-
readonly 'space-32': "8rem";
|
|
162
|
+
readonly 'space-1': "calc(0.25rem * var(--density, 1))";
|
|
163
|
+
readonly 'space-2': "calc(0.5rem * var(--density, 1))";
|
|
164
|
+
readonly 'space-3': "calc(0.75rem * var(--density, 1))";
|
|
165
|
+
readonly 'space-4': "calc(1rem * var(--density, 1))";
|
|
166
|
+
readonly 'space-5': "calc(1.25rem * var(--density, 1))";
|
|
167
|
+
readonly 'space-6': "calc(1.5rem * var(--density, 1))";
|
|
168
|
+
readonly 'space-8': "calc(2rem * var(--density, 1))";
|
|
169
|
+
readonly 'space-10': "calc(2.5rem * var(--density, 1))";
|
|
170
|
+
readonly 'space-12': "calc(3rem * var(--density, 1))";
|
|
171
|
+
readonly 'space-14': "calc(3.5rem * var(--density, 1))";
|
|
172
|
+
readonly 'space-16': "calc(4rem * var(--density, 1))";
|
|
173
|
+
readonly 'space-20': "calc(5rem * var(--density, 1))";
|
|
174
|
+
readonly 'space-24': "calc(6rem * var(--density, 1))";
|
|
175
|
+
readonly 'space-32': "calc(8rem * var(--density, 1))";
|
|
174
176
|
readonly 'golden-1': "0.25rem";
|
|
175
177
|
readonly 'golden-2': "0.405rem";
|
|
176
178
|
readonly 'golden-3': "0.654rem";
|
|
@@ -237,6 +239,13 @@ export declare const elevation: {
|
|
|
237
239
|
readonly 'shadow-lg': "0 10px 15px -3px rgb(0 0 0 / .55), 0 4px 6px -4px rgb(0 0 0 / .55)";
|
|
238
240
|
readonly 'shadow-xl': "0 20px 25px -5px rgb(0 0 0 / .60), 0 8px 10px -6px rgb(0 0 0 / .60)";
|
|
239
241
|
readonly 'shadow-2xl': "var(--shadow-floating)";
|
|
242
|
+
readonly 'sheet-0': "var(--surface-page)";
|
|
243
|
+
readonly 'sheet-1': "var(--surface-card)";
|
|
244
|
+
readonly 'sheet-2': "var(--surface-card-emphasis)";
|
|
245
|
+
readonly 'shadow-sheet-1': "var(--edge-highlight),var(--shadow-md)";
|
|
246
|
+
readonly 'shadow-sheet-2': "var(--edge-highlight),var(--shadow-lg)";
|
|
247
|
+
readonly fold: "12px";
|
|
248
|
+
readonly 'fold-face': "linear-gradient(315deg,var(--glass-strong) 0,var(--glass-strong) calc(var(--fold) - 1px),var(--border-strong) calc(var(--fold) - 1px),var(--border-strong) var(--fold),transparent var(--fold))";
|
|
240
249
|
readonly 'glow-hero': "radial-gradient(circle,rgb(255 255 255 / .12) 0%,transparent 68%)";
|
|
241
250
|
readonly 'glow-hero-blur': "120px";
|
|
242
251
|
readonly 'sheen-card': "radial-gradient(120% 120% at 80% 0%,rgb(255 255 255 / .08) 0%,transparent 55%)";
|
|
@@ -374,31 +383,32 @@ export declare const cssVars: {
|
|
|
374
383
|
readonly '--chrome-dot-red': "rgb(239 68 68 / .6)";
|
|
375
384
|
readonly '--chrome-dot-yellow': "rgb(234 179 8 / .6)";
|
|
376
385
|
readonly '--chrome-dot-green': "rgb(34 197 94 / .6)";
|
|
377
|
-
readonly '--
|
|
378
|
-
readonly '--
|
|
379
|
-
readonly '--
|
|
380
|
-
readonly '--
|
|
381
|
-
readonly '--
|
|
382
|
-
readonly '--
|
|
383
|
-
readonly '--
|
|
384
|
-
readonly '--
|
|
385
|
-
readonly '--
|
|
386
|
-
readonly '--
|
|
387
|
-
readonly '--
|
|
388
|
-
readonly '--
|
|
389
|
-
readonly '--
|
|
390
|
-
readonly '--
|
|
391
|
-
readonly '--
|
|
392
|
-
readonly '--
|
|
393
|
-
readonly '--
|
|
386
|
+
readonly '--type-scale': "1";
|
|
387
|
+
readonly '--text-xs': "calc(0.6875rem * var(--type-scale, 1))";
|
|
388
|
+
readonly '--leading-xs': "calc(1rem * var(--type-scale, 1))";
|
|
389
|
+
readonly '--text-sm': "calc(0.8125rem * var(--type-scale, 1))";
|
|
390
|
+
readonly '--leading-sm': "calc(1.15rem * var(--type-scale, 1))";
|
|
391
|
+
readonly '--text-base': "calc(0.875rem * var(--type-scale, 1))";
|
|
392
|
+
readonly '--leading-base': "calc(1.35rem * var(--type-scale, 1))";
|
|
393
|
+
readonly '--text-lg': "calc(0.9375rem * var(--type-scale, 1))";
|
|
394
|
+
readonly '--leading-lg': "calc(1.4rem * var(--type-scale, 1))";
|
|
395
|
+
readonly '--text-xl': "calc(1.0625rem * var(--type-scale, 1))";
|
|
396
|
+
readonly '--leading-xl': "calc(1.55rem * var(--type-scale, 1))";
|
|
397
|
+
readonly '--text-2xl': "calc(1.3125rem * var(--type-scale, 1))";
|
|
398
|
+
readonly '--leading-2xl': "calc(1.7rem * var(--type-scale, 1))";
|
|
399
|
+
readonly '--text-3xl': "calc(1.625rem * var(--type-scale, 1))";
|
|
400
|
+
readonly '--leading-3xl': "calc(1.95rem * var(--type-scale, 1))";
|
|
401
|
+
readonly '--text-4xl': "calc(2rem * var(--type-scale, 1))";
|
|
402
|
+
readonly '--leading-4xl': "calc(2.25rem * var(--type-scale, 1))";
|
|
403
|
+
readonly '--text-5xl': "calc(2.5rem * var(--type-scale, 1))";
|
|
394
404
|
readonly '--leading-5xl': "1.05";
|
|
395
|
-
readonly '--text-6xl': "3.25rem";
|
|
405
|
+
readonly '--text-6xl': "calc(3.25rem * var(--type-scale, 1))";
|
|
396
406
|
readonly '--leading-6xl': "1";
|
|
397
|
-
readonly '--text-7xl': "4rem";
|
|
407
|
+
readonly '--text-7xl': "calc(4rem * var(--type-scale, 1))";
|
|
398
408
|
readonly '--leading-7xl': "1";
|
|
399
|
-
readonly '--text-8xl': "5.25rem";
|
|
409
|
+
readonly '--text-8xl': "calc(5.25rem * var(--type-scale, 1))";
|
|
400
410
|
readonly '--leading-8xl': "1";
|
|
401
|
-
readonly '--text-9xl': "7rem";
|
|
411
|
+
readonly '--text-9xl': "calc(7rem * var(--type-scale, 1))";
|
|
402
412
|
readonly '--leading-9xl': "1";
|
|
403
413
|
readonly '--font-size-xs': "var(--text-xs)";
|
|
404
414
|
readonly '--font-size-sm': "var(--text-sm)";
|
|
@@ -436,21 +446,22 @@ export declare const cssVars: {
|
|
|
436
446
|
readonly '--type-caption': "400 var(--text-xs)/var(--leading-xs) var(--font-sans)";
|
|
437
447
|
readonly '--type-code': "400 var(--text-sm)/var(--leading-relaxed) var(--font-mono)";
|
|
438
448
|
readonly '--type-eyebrow': "600 0.625rem/1 var(--font-sans)";
|
|
449
|
+
readonly '--density': "1";
|
|
439
450
|
readonly '--space-0': "0";
|
|
440
|
-
readonly '--space-1': "0.25rem";
|
|
441
|
-
readonly '--space-2': "0.5rem";
|
|
442
|
-
readonly '--space-3': "0.75rem";
|
|
443
|
-
readonly '--space-4': "1rem";
|
|
444
|
-
readonly '--space-5': "1.25rem";
|
|
445
|
-
readonly '--space-6': "1.5rem";
|
|
446
|
-
readonly '--space-8': "2rem";
|
|
447
|
-
readonly '--space-10': "2.5rem";
|
|
448
|
-
readonly '--space-12': "3rem";
|
|
449
|
-
readonly '--space-14': "3.5rem";
|
|
450
|
-
readonly '--space-16': "4rem";
|
|
451
|
-
readonly '--space-20': "5rem";
|
|
452
|
-
readonly '--space-24': "6rem";
|
|
453
|
-
readonly '--space-32': "8rem";
|
|
451
|
+
readonly '--space-1': "calc(0.25rem * var(--density, 1))";
|
|
452
|
+
readonly '--space-2': "calc(0.5rem * var(--density, 1))";
|
|
453
|
+
readonly '--space-3': "calc(0.75rem * var(--density, 1))";
|
|
454
|
+
readonly '--space-4': "calc(1rem * var(--density, 1))";
|
|
455
|
+
readonly '--space-5': "calc(1.25rem * var(--density, 1))";
|
|
456
|
+
readonly '--space-6': "calc(1.5rem * var(--density, 1))";
|
|
457
|
+
readonly '--space-8': "calc(2rem * var(--density, 1))";
|
|
458
|
+
readonly '--space-10': "calc(2.5rem * var(--density, 1))";
|
|
459
|
+
readonly '--space-12': "calc(3rem * var(--density, 1))";
|
|
460
|
+
readonly '--space-14': "calc(3.5rem * var(--density, 1))";
|
|
461
|
+
readonly '--space-16': "calc(4rem * var(--density, 1))";
|
|
462
|
+
readonly '--space-20': "calc(5rem * var(--density, 1))";
|
|
463
|
+
readonly '--space-24': "calc(6rem * var(--density, 1))";
|
|
464
|
+
readonly '--space-32': "calc(8rem * var(--density, 1))";
|
|
454
465
|
readonly '--golden-1': "0.25rem";
|
|
455
466
|
readonly '--golden-2': "0.405rem";
|
|
456
467
|
readonly '--golden-3': "0.654rem";
|
|
@@ -508,6 +519,13 @@ export declare const cssVars: {
|
|
|
508
519
|
readonly '--shadow-lg': "0 10px 15px -3px rgb(0 0 0 / .55), 0 4px 6px -4px rgb(0 0 0 / .55)";
|
|
509
520
|
readonly '--shadow-xl': "0 20px 25px -5px rgb(0 0 0 / .60), 0 8px 10px -6px rgb(0 0 0 / .60)";
|
|
510
521
|
readonly '--shadow-2xl': "var(--shadow-floating)";
|
|
522
|
+
readonly '--sheet-0': "var(--surface-page)";
|
|
523
|
+
readonly '--sheet-1': "var(--surface-card)";
|
|
524
|
+
readonly '--sheet-2': "var(--surface-card-emphasis)";
|
|
525
|
+
readonly '--shadow-sheet-1': "var(--edge-highlight),var(--shadow-md)";
|
|
526
|
+
readonly '--shadow-sheet-2': "var(--edge-highlight),var(--shadow-lg)";
|
|
527
|
+
readonly '--fold': "12px";
|
|
528
|
+
readonly '--fold-face': "linear-gradient(315deg,var(--glass-strong) 0,var(--glass-strong) calc(var(--fold) - 1px),var(--border-strong) calc(var(--fold) - 1px),var(--border-strong) var(--fold),transparent var(--fold))";
|
|
511
529
|
readonly '--glow-hero': "radial-gradient(circle,rgb(255 255 255 / .12) 0%,transparent 68%)";
|
|
512
530
|
readonly '--glow-hero-blur': "120px";
|
|
513
531
|
readonly '--sheen-card': "radial-gradient(120% 120% at 80% 0%,rgb(255 255 255 / .08) 0%,transparent 55%)";
|
package/dist/tokens.gen.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.gen.d.ts","sourceRoot":"","sources":["../src/tokens.gen.ts"],"names":[],"mappings":"AAIA,kEAAkE;AAClE,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyFT,CAAA;AAEV,0EAA0E;AAC1E,eAAO,MAAM,UAAU
|
|
1
|
+
{"version":3,"file":"tokens.gen.d.ts","sourceRoot":"","sources":["../src/tokens.gen.ts"],"names":[],"mappings":"AAIA,kEAAkE;AAClE,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyFT,CAAA;AAEV,0EAA0E;AAC1E,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgEb,CAAA;AAEV,oEAAoE;AACpE,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2CV,CAAA;AAEV,8DAA8D;AAC9D,eAAO,MAAM,IAAI;;;;;;;;;;;;CAYP,CAAA;AAEV,kEAAkE;AAClE,eAAO,MAAM,MAAM;;;;;;;;;CAST,CAAA;AAEV,wEAAwE;AACxE,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BZ,CAAA;AAEV,kEAAkE;AAClE,eAAO,MAAM,MAAM;;;;;;;;;;;;;CAaT,CAAA;AAEV,6DAA6D;AAC7D,eAAO,MAAM,MAAM;;;;;;;;;;;;CAYT,CAAA;AAEV,gEAAgE;AAChE,eAAO,MAAM,KAAK;;;;;;CAMR,CAAA;AAEV,8DAA8D;AAC9D,eAAO,MAAM,IAAI,IAEP,CAAA;AAEV,sFAAsF;AACtF,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2QV,CAAA;AAEV,MAAM,MAAM,UAAU,GAAG,MAAM,OAAO,OAAO,CAAA"}
|