altitude-design 0.1.0 → 0.2.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 +18 -3
- package/dist/altitude.css +28 -1
- package/dist/altitude.iife.js +5 -3
- package/dist/altitude.no-fonts.css +1659 -0
- package/dist/fonts.css +1 -0
- package/dist/index.cjs +205 -70
- package/dist/index.cjs.map +4 -4
- package/dist/index.js +205 -70
- package/dist/index.js.map +4 -4
- package/dist/types/command.d.ts +5 -1
- package/dist/types/core.d.ts +23 -2
- package/dist/types/empty.d.ts +24 -0
- package/dist/types/index.d.ts +9 -1
- package/package.json +11 -1
package/README.md
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
A React component library where **height is the interface**. Its one idea: the ground is the record. Settled content sits on the ground; anything live rises above it; anything waiting to receive sinks below it.
|
|
4
4
|
|
|
5
|
-
- **Storybook:** every component, with its guidelines and a live preview in all four schemes:
|
|
6
|
-
- **The design guide:** [`project/README.md`](project/README.md), then [Elevation](project/Elevation.md), [Motion](project/Motion.md), [Theming](project/Theming.md) and [Research](project/Research.md)
|
|
5
|
+
- **Storybook:** every component, with its guidelines and a live preview in all four schemes: https://richlaconte.github.io/altitude/
|
|
6
|
+
- **The design guide:** [`project/README.md`](https://github.com/richlaconte/altitude/blob/main/project/README.md), then [Elevation](https://github.com/richlaconte/altitude/blob/main/project/Elevation.md), [Motion](https://github.com/richlaconte/altitude/blob/main/project/Motion.md), [Theming](https://github.com/richlaconte/altitude/blob/main/project/Theming.md) and [Research](https://github.com/richlaconte/altitude/blob/main/project/Research.md)
|
|
7
7
|
|
|
8
8
|
## Install
|
|
9
9
|
|
|
@@ -33,6 +33,8 @@ Render `AltitudeProvider` once around your app. Schemes are `daylight`, `nightfa
|
|
|
33
33
|
|---|---|
|
|
34
34
|
| `altitude-design` | the components (ESM and CommonJS, with types) |
|
|
35
35
|
| `altitude-design/altitude.css` | tokens and component styles in one file (it also loads Instrument Sans and JetBrains Mono from Google Fonts) |
|
|
36
|
+
| `altitude-design/altitude.no-fonts.css` | the same styles without the Google Fonts import, so the page makes no third-party request; self-host the fonts or set `--font-sans` and `--font-mono` to your own (both fall back to system fonts) |
|
|
37
|
+
| `altitude-design/fonts.css` | just the Google Fonts import, to pair with `tokens.css` or `altitude.no-fonts.css` |
|
|
36
38
|
| `altitude-design/tokens.css`, `altitude-design/tokens.json` | the tokens on their own |
|
|
37
39
|
| `altitude-design/altitude.iife.js` | a `<script>` build that sets `window.Altitude`, for pages without a bundler; it expects React 18's UMD builds as `window.React` and `window.ReactDOM` |
|
|
38
40
|
|
|
@@ -72,6 +74,19 @@ A push to `main` then also:
|
|
|
72
74
|
- deploys Storybook to GitHub Pages;
|
|
73
75
|
- publishes to npm **if the version in `package.json` isn't published yet**, and tags the commit `v<version>`. To release, bump the version (`npm version patch`, `minor` or `major`) and push.
|
|
74
76
|
|
|
77
|
+
## Found a bug, or need something it doesn't do?
|
|
78
|
+
|
|
79
|
+
Open an issue: **https://github.com/richlaconte/altitude/issues/new/choose**. There are templates for a bug, a new feature for an existing component, and a new component, and [CONTRIBUTING.md](https://github.com/richlaconte/altitude/blob/main/CONTRIBUTING.md) says what makes each one useful.
|
|
80
|
+
|
|
81
|
+
**If you're an agent using this package** in someone else's project, you're welcome to report problems with it here:
|
|
82
|
+
|
|
83
|
+
1. Check it's Altitude's problem, not the app's: reproduce it with the smallest render that uses only the public API, inside `AltitudeProvider`, with `altitude-design/altitude.css` imported.
|
|
84
|
+
2. Look for an existing issue: `gh issue list --repo richlaconte/altitude --state all --search "<Component> <keywords>"`.
|
|
85
|
+
3. Fill in the matching template from [`.github/ISSUE_TEMPLATE/`](https://github.com/richlaconte/altitude/blob/main/.github/ISSUE_TEMPLATE/): title `<Component>: <what goes wrong>`, the installed version (from `node_modules/altitude-design/package.json`), how it's loaded (ESM, CommonJS or `altitude.iife.js`), React version, browser, and the scheme and mode (reduced motion, forced colours, `contrast="more"`) you saw it in.
|
|
86
|
+
4. File it only if the person you're working for agrees: `gh issue create --repo richlaconte/altitude --label bug --title "…" --body-file issue.md`. Otherwise hand them the drafted issue and the link above. End the body with `Filed by an agent (<model or tool>) on behalf of @<person>.`
|
|
87
|
+
|
|
88
|
+
The full guidance for agents is in [AGENTS.md](https://github.com/richlaconte/altitude/blob/main/AGENTS.md).
|
|
89
|
+
|
|
75
90
|
## License
|
|
76
91
|
|
|
77
|
-
[MIT](LICENSE)
|
|
92
|
+
[MIT](https://github.com/richlaconte/altitude/blob/main/LICENSE)
|
package/dist/altitude.css
CHANGED
|
@@ -1134,6 +1134,31 @@ body { margin: 0; background: var(--surface-ground); color: var(--ink); font-fam
|
|
|
1134
1134
|
.alt-drop[data-drop="armed"] { background: var(--surface-well); box-shadow: var(--well); border-color: var(--ink-muted); }
|
|
1135
1135
|
.alt-drop[data-drop="over"] { background: var(--accent-soft); box-shadow: var(--trench); border-style: solid; border-color: var(--accent-ink); color: var(--ink); transform: scale(calc(1 - 0.01 * var(--alt-travel))); }
|
|
1136
1136
|
|
|
1137
|
+
/* ── EmptyState: an opening the first record will fill. Nothing here yet isn't a problem (Alert) or a settled
|
|
1138
|
+
container (Card): it's a space waiting to receive, so it's sunk, a well cut into the page with a dashed rim, the
|
|
1139
|
+
same below-ground signal as an empty field. Its actions are ordinary raised buttons standing in it. Pointing at
|
|
1140
|
+
the primary action deepens the well to a trench and darkens the rim: feedforward for where the record will land.
|
|
1141
|
+
It sinks in when it appears (flush to well, dur-travel-1, ease-sink), the inverse of content arriving lifted,
|
|
1142
|
+
and it never pulses. ── */
|
|
1143
|
+
.alt-empty {
|
|
1144
|
+
display: flex; flex-direction: column; align-items: center; gap: var(--space-2); padding: var(--space-8) var(--space-6); text-align: center;
|
|
1145
|
+
border: 1.5px dashed var(--line-control); border-radius: var(--radius-lg); background: var(--surface-well); box-shadow: var(--well);
|
|
1146
|
+
color: var(--ink-muted); font: 400 15px/23px var(--font-sans);
|
|
1147
|
+
animation: alt-empty-sink var(--dur-travel-1) var(--ease-sink);
|
|
1148
|
+
transition: box-shadow var(--dur-travel-1) var(--ease-sink), border-color var(--dur-travel-1);
|
|
1149
|
+
}
|
|
1150
|
+
@keyframes alt-empty-sink { from { background-color: var(--surface-ground); box-shadow: var(--elev-0); } }
|
|
1151
|
+
.alt-empty-icon { display: inline-flex; margin-bottom: var(--space-1); color: var(--ink-muted); }
|
|
1152
|
+
.alt-empty-icon > svg { width: 24px; height: 24px; }
|
|
1153
|
+
.alt-empty-title { margin: 0; font: 600 19px/26px var(--font-sans); letter-spacing: -0.01em; color: var(--ink); text-wrap: balance; }
|
|
1154
|
+
.alt-empty-desc { margin: 0; max-width: 46ch; color: var(--ink-muted); text-wrap: pretty; }
|
|
1155
|
+
.alt-empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-2); margin-top: var(--space-3); }
|
|
1156
|
+
.alt-empty:has(.alt-empty-actions > :first-child:is(:hover, :focus-visible):not(:disabled)) { box-shadow: var(--trench); border-color: var(--ink-muted); }
|
|
1157
|
+
.alt-empty[data-size="sm"] { gap: var(--space-1); padding: var(--space-5) var(--space-4); border-radius: var(--radius-md); font: 400 14px/20px var(--font-sans); }
|
|
1158
|
+
.alt-empty[data-size="sm"] .alt-empty-icon > svg { width: 18px; height: 18px; }
|
|
1159
|
+
.alt-empty[data-size="sm"] .alt-empty-title { font: 500 14px/20px var(--font-sans); letter-spacing: 0; }
|
|
1160
|
+
.alt-empty[data-size="sm"] .alt-empty-actions { margin-top: var(--space-2); }
|
|
1161
|
+
|
|
1137
1162
|
/* ── SortableList: pick up → level 3 in your hand; the landing slot opens as a well; release → it lands. ── */
|
|
1138
1163
|
.alt-sort { position: relative; display: flex; flex-direction: column; }
|
|
1139
1164
|
.alt-sort-item {
|
|
@@ -1586,6 +1611,7 @@ body { margin: 0; background: var(--surface-ground); color: var(--ink); font-fam
|
|
|
1586
1611
|
--alt-ring: var(--ink); --alt-cast: transparent; --alt-cast-deep: transparent; --alt-wall-in: var(--ink-muted); --alt-lip: transparent; --alt-rim-held: var(--ink);
|
|
1587
1612
|
}
|
|
1588
1613
|
.alt-btn, .alt-kbd, .alt-crumbs button { --wall-c: var(--ink); }
|
|
1614
|
+
.alt-empty { border-style: solid; }
|
|
1589
1615
|
}
|
|
1590
1616
|
[data-contrast="more"], [data-contrast="more"] [data-theme] {
|
|
1591
1617
|
--elev-0: inset 0 0 0 0 #0000, 0 0 0 0 #0000, 0 0 0 0 #0000, 0 0 0 0 #0000;
|
|
@@ -1600,6 +1626,7 @@ body { margin: 0; background: var(--surface-ground); color: var(--ink); font-fam
|
|
|
1600
1626
|
--alt-ring: var(--ink); --alt-cast: transparent; --alt-cast-deep: transparent; --alt-wall-in: var(--ink-muted); --alt-lip: transparent; --alt-rim-held: var(--ink);
|
|
1601
1627
|
}
|
|
1602
1628
|
[data-contrast="more"] .alt-btn, [data-contrast="more"] .alt-kbd, [data-contrast="more"] .alt-crumbs button { --wall-c: var(--ink); }
|
|
1629
|
+
[data-contrast="more"] .alt-empty { border-style: solid; }
|
|
1603
1630
|
|
|
1604
1631
|
/* Forced colours (Windows High Contrast) drop every box-shadow, which erases elevation entirely
|
|
1605
1632
|
(measured: the ladder renders as blank). Height falls back to border weight and style. */
|
|
@@ -1610,7 +1637,7 @@ body { margin: 0; background: var(--surface-ground); color: var(--ink); font-fam
|
|
|
1610
1637
|
.alt-surface[data-level="5"], .alt-dialog { border: 4px double CanvasText; }
|
|
1611
1638
|
.alt-input:has(input:not(:placeholder-shown)), .alt-input:has(textarea:not(:placeholder-shown)) { border-style: solid !important; }
|
|
1612
1639
|
.alt-input[data-invalid] { border: 2px dashed CanvasText !important; }
|
|
1613
|
-
.alt-surface[data-level="-1"], .alt-input, .alt-tabs-list, .alt-sort-slot, .alt-drop[data-drop="armed"] { border: 1px dashed CanvasText; }
|
|
1640
|
+
.alt-surface[data-level="-1"], .alt-input, .alt-tabs-list, .alt-sort-slot, .alt-drop[data-drop="armed"], .alt-empty { border: 1px dashed CanvasText; }
|
|
1614
1641
|
.alt-surface[data-level="-2"], .alt-switch, .alt-slider-track, .alt-progress, [data-status="failed"], .alt-drop[data-drop="over"] { border: 2px dashed CanvasText; }
|
|
1615
1642
|
[data-status="pending"] { border: 2px dotted CanvasText; }
|
|
1616
1643
|
.alt-progress-fill, .alt-slider-fill, .alt-switch-fill, .alt-check-fill { background: Highlight; }
|