@ferrlabs/ui-foundation 5.7.0 → 5.9.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/README.md +32 -1
- package/package.json +3 -2
- package/src/styles/global.css +5 -2
- package/src/styles/tokens.css +30 -0
package/README.md
CHANGED
|
@@ -13,6 +13,26 @@ package instead of three. Tracked under UI#105.
|
|
|
13
13
|
| `@ferrlabs/ui-foundation/styles/global.css` | Base stylesheet — fonts + Tailwind import + brand tokens | Every app's `global.css` |
|
|
14
14
|
| `@ferrlabs/ui-foundation/styles/tokens.css` | Brand color + typography tokens (consumed via `@theme`) | apps/sites |
|
|
15
15
|
|
|
16
|
+
## Style presets
|
|
17
|
+
|
|
18
|
+
`data-style` on `<html>` selects a preset of token overrides, the same way
|
|
19
|
+
`data-theme="dark"` selects the dark palette. The two combine freely. No attribute
|
|
20
|
+
is the default editorial look.
|
|
21
|
+
|
|
22
|
+
| `data-style` | Radii (control / card / modal) | Font | `--control-height` |
|
|
23
|
+
| ------------ | ------------------------------ | -------- | ------------------ |
|
|
24
|
+
| (none) | 4px / 8px / 12px | Fraunces | 40px |
|
|
25
|
+
| `precision` | 2px / 4px / 6px | Inter | 28px |
|
|
26
|
+
| `soft` | 8px / 12px / 16px | Inter | 36px |
|
|
27
|
+
|
|
28
|
+
`--control-height` is the `md` height of buttons, inputs, selects, search fields,
|
|
29
|
+
multi-selects and submit buttons. `sm` and `lg` are 8px below and above it. Buttons
|
|
30
|
+
are padding-sized, so they shift by half the difference to 40px on each side.
|
|
31
|
+
|
|
32
|
+
```html
|
|
33
|
+
<html data-style="precision" data-theme="dark"></html>
|
|
34
|
+
```
|
|
35
|
+
|
|
16
36
|
## Usage
|
|
17
37
|
|
|
18
38
|
### React app
|
|
@@ -40,6 +60,17 @@ import { icons } from '@ferrlabs/ui-foundation/icons';
|
|
|
40
60
|
@import '@ferrlabs/ui-foundation/styles/global.css';
|
|
41
61
|
```
|
|
42
62
|
|
|
63
|
+
## Radius tokens
|
|
64
|
+
|
|
65
|
+
| Token | Value | Tailwind utility | Use |
|
|
66
|
+
| ------------------ | ----- | ----------------- | --------------------------------------------------- |
|
|
67
|
+
| `--radius-control` | 4px | `rounded-control` | Buttons, inputs, selects, search, tabs, small chips |
|
|
68
|
+
| `--radius-card` | 8px | `rounded-card` | Cards, menus, popovers, rail items |
|
|
69
|
+
| `--radius-modal` | 12px | `rounded-modal` | Modals, switcher panels, large surfaces |
|
|
70
|
+
| `--radius-full` | 999px | `rounded-full` | Switch, avatar, badges, status dots |
|
|
71
|
+
|
|
72
|
+
`.btn-primary` and `.btn-ghost` use `--radius-control`.
|
|
73
|
+
|
|
43
74
|
## Migration from old packages
|
|
44
75
|
|
|
45
76
|
The old packages (`@ferrlabs/ui-icons`, `@ferrlabs/styles`,
|
|
@@ -51,4 +82,4 @@ should target `@ferrlabs/ui-foundation` directly.
|
|
|
51
82
|
|
|
52
83
|
Licensed under either of [Apache-2.0](LICENSE-APACHE) or [MIT](LICENSE-MIT), at your option.
|
|
53
84
|
|
|
54
|
-
The Fraunces
|
|
85
|
+
The Fraunces, DM Mono and Inter fonts are not covered by this license. They are pulled in through the `@fontsource/fraunces`, `@fontsource/dm-mono` and `@fontsource/inter` dependencies and stay under the SIL Open Font License 1.1, whose text ships in each of those packages.
|
package/package.json
CHANGED
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
},
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@fontsource/dm-mono": "^5.0.0",
|
|
7
|
-
"@fontsource/fraunces": "^5.0.0"
|
|
7
|
+
"@fontsource/fraunces": "^5.0.0",
|
|
8
|
+
"@fontsource/inter": "^5.3.0"
|
|
8
9
|
},
|
|
9
10
|
"description": "Framework-agnostic FerrLabs design foundation: SVG icons, base CSS + fonts, Tailwind preset tokens. Consumed by @ferrlabs/ui-ng and by the Astro sites directly.",
|
|
10
11
|
"devDependencies": {
|
|
@@ -54,7 +55,7 @@
|
|
|
54
55
|
},
|
|
55
56
|
"type": "module",
|
|
56
57
|
"types": "./dist/index.d.ts",
|
|
57
|
-
"version": "5.
|
|
58
|
+
"version": "5.9.0",
|
|
58
59
|
"scripts": {
|
|
59
60
|
"build": "tsc",
|
|
60
61
|
"typecheck": "tsc --noEmit"
|
package/src/styles/global.css
CHANGED
|
@@ -27,6 +27,9 @@
|
|
|
27
27
|
@import '@fontsource/fraunces/900.css';
|
|
28
28
|
@import '@fontsource/dm-mono/400.css';
|
|
29
29
|
@import '@fontsource/dm-mono/500.css';
|
|
30
|
+
@import '@fontsource/inter/400.css';
|
|
31
|
+
@import '@fontsource/inter/500.css';
|
|
32
|
+
@import '@fontsource/inter/700.css';
|
|
30
33
|
|
|
31
34
|
/* 2. Tailwind v4 — consumers do NOT @import this themselves. */
|
|
32
35
|
@import 'tailwindcss';
|
|
@@ -101,7 +104,7 @@
|
|
|
101
104
|
}
|
|
102
105
|
::-webkit-scrollbar-thumb {
|
|
103
106
|
background: var(--color-rule-strong);
|
|
104
|
-
border-radius:
|
|
107
|
+
border-radius: var(--radius-full);
|
|
105
108
|
}
|
|
106
109
|
::-webkit-scrollbar-thumb:hover {
|
|
107
110
|
background: var(--color-ink-2);
|
|
@@ -236,7 +239,7 @@
|
|
|
236
239
|
align-items: center;
|
|
237
240
|
gap: 10px;
|
|
238
241
|
padding: 14px 24px;
|
|
239
|
-
border-radius:
|
|
242
|
+
border-radius: var(--radius-control);
|
|
240
243
|
font-family: var(--font-mono);
|
|
241
244
|
font-size: 13px;
|
|
242
245
|
letter-spacing: 0.04em;
|
package/src/styles/tokens.css
CHANGED
|
@@ -88,6 +88,18 @@
|
|
|
88
88
|
--color-code-deleted: #b91c1c;
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
+
/* Border radius scale. `static` keeps the variables in :root even when no
|
|
92
|
+
* utility references them, since ui-ng components read them via var().
|
|
93
|
+
* Utilities: `rounded-control`, `rounded-card`, `rounded-modal`.
|
|
94
|
+
*/
|
|
95
|
+
@theme static {
|
|
96
|
+
--radius-control: 4px; /* Buttons, inputs, selects, tabs, small chips */
|
|
97
|
+
--radius-card: 8px; /* Cards, menus, popovers, rail items */
|
|
98
|
+
--radius-modal: 12px; /* Modals, switcher panels, large surfaces */
|
|
99
|
+
--radius-full: 999px; /* Switch, avatar, badges, status dots */
|
|
100
|
+
--control-height: 40px;
|
|
101
|
+
}
|
|
102
|
+
|
|
91
103
|
/* Dark mode tokens — opt-in via `<html data-theme="dark">`. The marketing
|
|
92
104
|
* sites mount a tweaks panel that flips this; the apps don't have one yet
|
|
93
105
|
* but inherit the same vars so a future toggle Just Works.
|
|
@@ -132,3 +144,21 @@ html[data-theme='dark'] {
|
|
|
132
144
|
--color-code-inserted: #86efac;
|
|
133
145
|
--color-code-deleted: #fca5a5;
|
|
134
146
|
}
|
|
147
|
+
|
|
148
|
+
html[data-style='precision'] {
|
|
149
|
+
--radius-control: 2px;
|
|
150
|
+
--radius-card: 4px;
|
|
151
|
+
--radius-modal: 6px;
|
|
152
|
+
--font-sans: 'Inter', system-ui, sans-serif;
|
|
153
|
+
--font-display: 'Inter', system-ui, sans-serif;
|
|
154
|
+
--control-height: 28px;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
html[data-style='soft'] {
|
|
158
|
+
--radius-control: 8px;
|
|
159
|
+
--radius-card: 12px;
|
|
160
|
+
--radius-modal: 16px;
|
|
161
|
+
--font-sans: 'Inter', system-ui, sans-serif;
|
|
162
|
+
--font-display: 'Inter', system-ui, sans-serif;
|
|
163
|
+
--control-height: 36px;
|
|
164
|
+
}
|