@terrahq/design-system 0.2.0 → 0.2.1

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.
Files changed (2) hide show
  1. package/README.md +51 -23
  2. package/package.json +1 -3
package/README.md CHANGED
@@ -14,7 +14,7 @@ Terra CSS classes for building demos and prototypes outside our regular ecosyste
14
14
  <link rel="stylesheet" href="https://unpkg.com/@terrahq/design-system@latest/dist/style.css">
15
15
  ```
16
16
 
17
- Pin a version instead of `latest` if the page must never change: `@terrahq/design-system@0.1.0`.
17
+ Pin a version instead of `latest` if the page must never change: `@terrahq/design-system@0.2.0`.
18
18
 
19
19
  **From npm:**
20
20
 
@@ -28,10 +28,12 @@ import '@terrahq/design-system' // resolves to dist/style.css
28
28
 
29
29
  ## Use it
30
30
 
31
+ A white card with a 1px border, an outlined pill and a title at weight 500:
32
+
31
33
  ```html
32
- <article class="f--background-b f--radius-c f--shadow-a u--p-4 u--display-flex u--flex-direction-column u--gap-2">
33
- <span class="f--background-d f--color-a f--font-f u--px-2 f--radius-full">new</span>
34
- <h3 class="f--font-c u--font-bold">Project Atlas</h3>
34
+ <article class="f--background-b f--radius-c u--border-a u--p-4 u--display-flex u--flex-direction-column u--gap-2">
35
+ <span class="f--font-f u--font-medium u--px-2 f--radius-full u--border-f" style="align-self:flex-start">new</span>
36
+ <h3 class="f--font-c u--font-medium">project atlas</h3>
35
37
  <p class="f--font-e">Built only with classes.</p>
36
38
  </article>
37
39
  ```
@@ -40,16 +42,50 @@ import '@terrahq/design-system' // resolves to dist/style.css
40
42
 
41
43
  | Layer | What it is | Examples |
42
44
  |---|---|---|
43
- | `f--` **foundation** | Terra's design decisions. Several properties per class, responsive included. They don't change between versions. | `f--font-c`, `f--color-a`, `f--background-d`, `f--radius-c`, `f--shadow-a`, `f--row`, `f--col-6` |
45
+ | `f--` **foundation** | Terra's design decisions. Several properties per class, responsive included. They don't change between versions. | `f--font-c`, `f--color-a`, `f--background-b`, `f--radius-c`, `f--shadow-a`, `f--row`, `f--col-6` |
44
46
  | `u--` **utilities** | One property per class, with a variant per breakpoint. | `u--p-4`, `u--p-mobile-2`, `u--display-flex`, `u--border-a` |
45
47
 
46
- If a foundation class already covers something, there is no utility for it. To tweak one detail of a foundation class, add a utility: `f--font-c u--font-bold`. Utilities load after foundation, so they win.
48
+ If a foundation class already covers something, there is no utility for it. To tweak one detail of a foundation class, add a utility: `f--font-c u--font-medium`. Utilities load after foundation, so they win.
47
49
 
48
50
  **Breakpoints** (`max-width`): `desktop` 1700 · `laptop` 1570 · `tabletl` 1300 · `tabletm` 1024 · `tablets` 810 · `mobile` 580. Utilities take the name in the middle: `u--p-mobile-2`.
49
51
 
50
- **Typography.** `f--font-a` to `f--font-f` use Uncut Sans, then `system-ui`. The package does **not** ship the font files; load Uncut Sans yourself or the browser falls back to `system-ui`.
52
+ **Typography.** `f--font-a` to `f--font-f` use Uncut Sans, then `system-ui`. The package does **not** ship the font files; load Uncut Sans yourself or the browser falls back to `system-ui`. Titles use weight 500: add `u--font-medium`.
53
+
54
+ ## Brand use
55
+
56
+ When you build something that carries the Terra brand:
57
+
58
+ - **Backgrounds** are only `a` (Noche), `b` (white) or `c` (Morning Haze): `f--background-a`, `-b`, `-c`.
59
+ - **Text** is only `a` or `b`: `f--color-a`, `f--color-b`. Never color text.
60
+ - **Accents** (`d` to `i`) are outlines and dots, not fills: `u--border-d` … `u--border-i`.
61
+ - **Shape.** Everything you click or tag is a capsule (`f--radius-full`); cards use `f--radius-c` with a 1px border and no shadow.
62
+
63
+ The package still ships a few default values that differ slightly from the brand (`b`, `e`, `f`, `g`, `h`, `i`). Until they are updated, set the brand palette in a `terra.config.js` (next section):
64
+
65
+ ```js
66
+ colors: {
67
+ a: '#0f0f0f', b: '#ffffff', c: '#f7f8f4',
68
+ d: '#7ce55e', e: '#189b5c', f: '#3d9dd8', g: '#ffb41d', h: '#f96e43', i: '#f78bd8',
69
+ },
70
+ ```
71
+
72
+ ## States and motion
51
73
 
52
- All classes are listed in the [class reference](docs/CLASSES.md).
74
+ State lives in the class name, with no colons. Hover only applies on devices that can hover, and states have no breakpoint variants.
75
+
76
+ ```html
77
+ <button class="u--transition-colors u--duration-a u--hover-background-a u--hover-color-b u--focus-ring u--active-scale-95 u--disabled-opacity-50 f--radius-full u--border-a u--px-3 u--py-1">
78
+ save
79
+ </button>
80
+ ```
81
+
82
+ | What | Classes |
83
+ |---|---|
84
+ | Hover | `u--hover-background-*`, `u--hover-color-*`, `u--hover-border-*` |
85
+ | Group | `u--group` on the parent, `u--group-hover-*` on its children |
86
+ | Focus, press, disabled | `u--focus-ring`, `u--active-scale-90\|95\|98`, `u--disabled-opacity-25\|50\|75` |
87
+ | Transitions | `u--transition-all\|colors\|opacity\|transform`, `u--duration-a\|b\|c` (0.1s, 0.3s, 0.6s), `u--ease-standard\|entrance\|exit-a\|b` |
88
+ | Animations | `u--animation-fade-in`, `fade-up`, `spin`, `pulse` (all respect `prefers-reduced-motion`) |
53
89
 
54
90
  ## Configure your own build
55
91
 
@@ -64,7 +100,7 @@ npx terra-ds build
64
100
  ```js
65
101
  // terra.config.js
66
102
  export default {
67
- colors: { a: '#0f0f0f', b: '#fefefe', j: '#ff00aa' }, // replaces the palette; "a" and "b" are required
103
+ colors: { a: '#0f0f0f', b: '#ffffff', j: '#ff00aa' }, // replaces the palette; "a" and "b" are required
68
104
  backgrounds: ['a', 'b', 'j'], // which colors get f--background-*
69
105
  spacing: [0, 1, 2, 4, 8], // replaces the u--p-*, u--m-*, u--gap-* steps (x 8px)
70
106
  font: "'Uncut Sans', system-ui, sans-serif", // font-family of f--font-*
@@ -73,23 +109,15 @@ export default {
73
109
  }
74
110
  ```
75
111
 
76
- Every key is optional. "Replaces" means what you don't list is not generated, which also makes the file smaller (about 77 kB with five spacing steps, against 108 kB by default). Breakpoints, grid and shadows are not configurable yet.
77
-
78
- ## What's new in 0.2.0
112
+ Every key is optional. "Replaces" means what you don't list is not generated, which also makes the file smaller (about 80 kB with this config, against 113 kB by default). Breakpoints, grid and shadows are not configurable yet.
79
113
 
80
- - **States:** `u--hover-background-*`, `u--hover-color-*`, `u--hover-border-*`, `u--focus-ring`, `u--active-scale-90|95|98`, `u--disabled-opacity-25|50|75`, and `u--group` with `u--group-hover-*` for children of a hovered parent. Hover only applies on devices that can hover. States have no breakpoint variants.
81
- - **Motion:** `u--transition-all|colors|opacity|transform`, `u--duration-a|b|c` (0.1s, 0.3s, 0.6s), `u--ease-standard|entrance|exit-a|b`, and the animations `u--animation-fade-in`, `fade-up`, `spin` and `pulse`, which respect `prefers-reduced-motion`.
82
- - Everything is additive: every 0.1.0 rule is unchanged.
114
+ ## What's new
83
115
 
84
- ## What's new in 0.1.0
116
+ **0.2.0** adds states (`u--hover-*`, `u--focus-ring`, `u--active-scale-*`, `u--disabled-opacity-*`, `u--group-hover-*`) and motion (`u--transition-*`, `u--duration-*`, `u--ease-*`, `u--animation-*`). Everything is additive: every 0.1.0 rule is unchanged.
85
117
 
86
- - **`terra-ds build`** and `terra.config.js` to configure palette, spacing, radius and font.
87
- - **New foundation classes:** `f--radius-*`, `f--shadow-*`.
88
- - **New utilities:** `u--border-*`, `u--px/py/mx/my`, `u--gap`, `u--row-gap`, `u--col-gap`, `u--mx-auto`, and spacing steps 6, 9 and 12.
89
- - **Changed default:** `f--font-*` now uses Uncut Sans (with `system-ui` as fallback) instead of Arial. Every other existing class is unchanged.
118
+ **0.1.0** added `terra-ds build` and `terra.config.js`, the `f--radius-*` and `f--shadow-*` foundations, `u--border-*`, `u--px/py/mx/my`, `u--gap`, `u--row-gap`, `u--col-gap`, `u--mx-auto`, and spacing steps 6, 9 and 12. The default `f--font-*` typeface changed from Arial to Uncut Sans.
90
119
 
91
120
  ## More
92
121
 
93
- - [Class reference](docs/CLASSES.md)
94
- - [How Terra works](TERRA.md): colors, type, shape, motion and voice
95
- - [Contributing](CONTRIBUTING.md)
122
+ - [Class reference](https://github.com/terra-hq/design-system/blob/HEAD/docs/CLASSES.md)
123
+ - [Contributing](https://github.com/terra-hq/design-system/blob/HEAD/CONTRIBUTING.md)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@terrahq/design-system",
3
3
  "private": false,
4
- "version": "0.2.0",
4
+ "version": "0.2.1",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": "./dist/style.css"
@@ -11,8 +11,6 @@
11
11
  "build": "tsc && vite build",
12
12
  "preview": "vite preview",
13
13
  "check": "node scripts/check-foundation.mjs",
14
- "docs:dev": "npm run build && npm --prefix docs run dev",
15
- "docs:build": "npm run build && npm --prefix docs run build",
16
14
  "prepublishOnly": "npm run build && npm run check"
17
15
  },
18
16
  "devDependencies": {