altitude-design 0.0.0-stage → 0.1.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 +21 -0
- package/README.md +89 -2
- package/dist/altitude.css +1634 -0
- package/dist/altitude.iife.js +4 -0
- package/dist/index.cjs +3388 -0
- package/dist/index.cjs.map +7 -0
- package/dist/index.js +3356 -0
- package/dist/index.js.map +7 -0
- package/dist/tokens.css +205 -0
- package/dist/tokens.json +724 -0
- package/dist/types/collections.d.ts +135 -0
- package/dist/types/command.d.ts +59 -0
- package/dist/types/controls.d.ts +248 -0
- package/dist/types/core.d.ts +106 -0
- package/dist/types/index.d.ts +16 -0
- package/dist/types/nav.d.ts +18 -0
- package/dist/types/overlays.d.ts +129 -0
- package/dist/types/pile.d.ts +27 -0
- package/dist/types/select.d.ts +67 -0
- package/dist/types/sheet.d.ts +27 -0
- package/dist/types/stepper.d.ts +23 -0
- package/package.json +67 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Richard
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,90 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Altitude
|
|
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
|
+
|
|
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
|
+
|
|
8
|
+
## Install
|
|
9
|
+
|
|
10
|
+
```sh
|
|
11
|
+
npm install altitude-design
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
React 18.2 or 19 is a peer dependency.
|
|
15
|
+
|
|
16
|
+
```tsx
|
|
17
|
+
import { AltitudeProvider, Button, Field, Input } from 'altitude-design';
|
|
18
|
+
import 'altitude-design/altitude.css';
|
|
19
|
+
|
|
20
|
+
export function App() {
|
|
21
|
+
return (
|
|
22
|
+
<AltitudeProvider scheme="daylight">
|
|
23
|
+
<Field label="Workspace name"><Input placeholder="Northwind Studio" /></Field>
|
|
24
|
+
<Button variant="primary">Save changes</Button>
|
|
25
|
+
</AltitudeProvider>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Render `AltitudeProvider` once around your app. Schemes are `daylight`, `nightfall`, `mesa` and `alpine`; `accent="#0f8a6b"` swaps in your own colour. The components are client components (`"use client"`), so they work in frameworks with server components.
|
|
31
|
+
|
|
32
|
+
| Import | What it is |
|
|
33
|
+
|---|---|
|
|
34
|
+
| `altitude-design` | the components (ESM and CommonJS, with types) |
|
|
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/tokens.css`, `altitude-design/tokens.json` | the tokens on their own |
|
|
37
|
+
| `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
|
+
|
|
39
|
+
## How the repository is laid out
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
project/ the design system itself: guides, tokens.json, components/src/*.tsx, bundle.css,
|
|
43
|
+
and the built bundle.js and previews (the same files as the design system on claude.ai)
|
|
44
|
+
build/ the kit that builds and checks project/ (see build/SETUP.md)
|
|
45
|
+
scripts/ the npm package build and the Storybook story generator
|
|
46
|
+
.storybook/
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
There is one source for each thing. Components live in `project/components/src`, styles in `project/components/bundle.css`, tokens in `project/tokens.json`, and each component's preview in `build/previews.txt`. The npm package, the Storybook stories and the design system's own previews are all generated from those.
|
|
50
|
+
|
|
51
|
+
## Working on it
|
|
52
|
+
|
|
53
|
+
```sh
|
|
54
|
+
npm install && npm install --prefix build
|
|
55
|
+
npm run storybook # http://localhost:6006
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
After changing a component, rebuild the design system's bundle and previews, and commit what they produce:
|
|
59
|
+
|
|
60
|
+
```sh
|
|
61
|
+
cd build && node build.mjs && node previews.mjs
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
CI fails if `project/` doesn't match its sources, so the design system on claude.ai can always be published straight from this folder.
|
|
65
|
+
|
|
66
|
+
## What happens on push
|
|
67
|
+
|
|
68
|
+
Every push and pull request runs the checks: the bundle and previews are rebuilt and must match what's committed, every preview is rendered in all four schemes with no errors, the interaction checks run, the sources type-check against React 19, and the package and Storybook are built.
|
|
69
|
+
|
|
70
|
+
A push to `main` then also:
|
|
71
|
+
|
|
72
|
+
- deploys Storybook to GitHub Pages;
|
|
73
|
+
- 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
|
+
|
|
75
|
+
## Found a bug, or need something it doesn't do?
|
|
76
|
+
|
|
77
|
+
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.
|
|
78
|
+
|
|
79
|
+
**If you're an agent using this package** in someone else's project, you're welcome to report problems with it here:
|
|
80
|
+
|
|
81
|
+
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.
|
|
82
|
+
2. Look for an existing issue: `gh issue list --repo richlaconte/altitude --state all --search "<Component> <keywords>"`.
|
|
83
|
+
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.
|
|
84
|
+
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>.`
|
|
85
|
+
|
|
86
|
+
The full guidance for agents is in [AGENTS.md](https://github.com/richlaconte/altitude/blob/main/AGENTS.md).
|
|
87
|
+
|
|
88
|
+
## License
|
|
89
|
+
|
|
90
|
+
[MIT](https://github.com/richlaconte/altitude/blob/main/LICENSE)
|