@mystravil/hardpoint 0.1.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 (67) hide show
  1. package/CHANGELOG.md +42 -18
  2. package/LICENSE +25 -25
  3. package/README.md +67 -64
  4. package/dist/base.css +625 -346
  5. package/dist/components/AppShell.svelte +698 -698
  6. package/dist/components/Button.svelte +174 -174
  7. package/dist/components/Checkbox.svelte +235 -198
  8. package/dist/components/Checkbox.svelte.d.ts +9 -2
  9. package/dist/components/CheckboxGroup.svelte +207 -99
  10. package/dist/components/CheckboxGroup.svelte.d.ts +23 -4
  11. package/dist/components/Combobox.svelte +901 -824
  12. package/dist/components/Combobox.svelte.d.ts +10 -1
  13. package/dist/components/Dialog.svelte +359 -356
  14. package/dist/components/Disclosure.svelte +201 -201
  15. package/dist/components/EmptyState.svelte +88 -88
  16. package/dist/components/ErrorState.svelte +135 -135
  17. package/dist/components/ImageViewer.svelte +764 -0
  18. package/dist/components/ImageViewer.svelte.d.ts +55 -0
  19. package/dist/components/KeyValueList.svelte +114 -114
  20. package/dist/components/ListDetail.svelte +218 -0
  21. package/dist/components/ListDetail.svelte.d.ts +37 -0
  22. package/dist/components/LoadRegion.svelte +219 -219
  23. package/dist/components/MediaFrame.svelte +110 -110
  24. package/dist/components/MediaImage.svelte +256 -256
  25. package/dist/components/Menu.svelte +258 -258
  26. package/dist/components/MenuCheckboxItem.svelte +119 -119
  27. package/dist/components/MenuGroup.svelte +50 -50
  28. package/dist/components/MenuItem.svelte +94 -94
  29. package/dist/components/MenuRadioGroup.svelte +62 -62
  30. package/dist/components/MenuRadioItem.svelte +110 -110
  31. package/dist/components/MenuSeparator.svelte +28 -28
  32. package/dist/components/Meter.svelte +283 -0
  33. package/dist/components/Meter.svelte.d.ts +66 -0
  34. package/dist/components/NativeSelect.svelte +18 -2
  35. package/dist/components/NativeSelect.svelte.d.ts +6 -0
  36. package/dist/components/Notice.svelte +262 -0
  37. package/dist/components/Notice.svelte.d.ts +30 -0
  38. package/dist/components/Popover.svelte +222 -222
  39. package/dist/components/Progress.svelte +157 -157
  40. package/dist/components/RadioGroup.svelte +440 -0
  41. package/dist/components/RadioGroup.svelte.d.ts +50 -0
  42. package/dist/components/Select.svelte +471 -405
  43. package/dist/components/Select.svelte.d.ts +6 -0
  44. package/dist/components/Skeleton.svelte +149 -149
  45. package/dist/components/Spinner.svelte +118 -117
  46. package/dist/components/Stat.svelte +253 -253
  47. package/dist/components/Steps.svelte +189 -189
  48. package/dist/components/Switch.svelte +222 -222
  49. package/dist/components/Table.svelte +504 -504
  50. package/dist/components/Tabs.svelte +246 -246
  51. package/dist/components/Tag.svelte +40 -40
  52. package/dist/components/TextArea.svelte +272 -0
  53. package/dist/components/TextArea.svelte.d.ts +28 -0
  54. package/dist/components/TextField.svelte +256 -256
  55. package/dist/components/Timeline.svelte +156 -156
  56. package/dist/components/Toaster.svelte +411 -411
  57. package/dist/components/Tooltip.svelte +200 -200
  58. package/dist/components/TooltipGroup.svelte +46 -46
  59. package/dist/components/internal/Scrim.svelte +52 -52
  60. package/dist/components/internal/Sheet.svelte +263 -263
  61. package/dist/components/internal/groups.d.ts +14 -0
  62. package/dist/components/internal/groups.js +23 -0
  63. package/dist/fonts.css +71 -71
  64. package/dist/index.d.ts +6 -0
  65. package/dist/index.js +6 -0
  66. package/dist/tokens.css +283 -279
  67. package/package.json +81 -76
package/CHANGELOG.md CHANGED
@@ -1,18 +1,42 @@
1
- # Changelog
2
-
3
- Hardpoint follows semantic versioning. Before 1.0.0, a breaking change raises the minor version.
4
-
5
- ## 0.1.0 (2026-11-11)
6
-
7
- The first public release. It needs Svelte 5.57 or newer.
8
-
9
- - **Components** (Svelte 5 on Bits UI):
10
- - Actions and forms: Button, TextField, NativeSelect, Select, Combobox, Checkbox, CheckboxGroup, Switch.
11
- - Overlays: Dialog (centred, bottom sheet or full screen), Popover, the Menu family, Tooltip with TooltipGroup, and Toaster with `toast()`.
12
- - Navigation: AppShell (header, bottom bar or drawer, rail or sidebar), Tabs, Steps, Pagination.
13
- - Data and display: Table, KeyValueList, Stat, Tag, Timeline, MediaFrame with MediaImage, Disclosure.
14
- - Feedback: Progress, Spinner, Skeleton, LoadRegion, EmptyState, ErrorState.
15
- - **Motion** (`@mystravil/hardpoint/motion`): `<Motion tier>` and `useMotion()`, the overlay transitions `pop`, `sheet`, `fade` and `drawer`, and timing tokens for every duration. Quiet motion is the default; expressive effects run only inside `<Motion tier="expressive">` and never under reduced motion.
16
- - **CSS**, framework-free: `fonts.css` (Geist, Geist Mono and Geist Pixel Square with size-matched fallback faces), `tokens.css` and `base.css`.
17
- - **Themes**: dark by default; light through `data-theme="light"` on `<html>`, or `data-theme="system"` to follow the device.
18
- - **Phones**: 44 px touch targets on coarse pointers, 16 px inputs, bottom sheets on compact widths that stay above the on-screen keyboard, and safe-area insets.
1
+ # Changelog
2
+
3
+ Hardpoint follows semantic versioning. Before 1.0.0, a breaking change raises the minor version.
4
+
5
+ ## 0.2.1 (2026-11-12)
6
+
7
+ - **Changed**: the source is public at [MYSTRAVIL/hardpoint](https://github.com/MYSTRAVIL/hardpoint), and `package.json` links it. Releases publish from GitHub Actions through npm trusted publishing, so from this version on each release carries a provenance attestation that ties it to its commit and workflow run. The components did not change.
8
+
9
+ ## 0.2.0 (2026-11-11)
10
+
11
+ - **Added**:
12
+ - `Meter`: a measurement inside a known range as separate segments, coloured by `warnAt` and `dangerAt` or by an app-set `tone`, with an optional `marker` and `detail` line.
13
+ - `Notice`: a persistent message in the page flow with an optional tone mark, title, text, up to two actions and a close button.
14
+ - `TextArea`: a multi-line text field that grows from `rows` to `maxRows` lines, then scrolls inside, with TextField's label, hint and error.
15
+ - `RadioGroup`: one choice from a set of rows, each with an optional hint and tag, named by a caps `label` or a `legend`, with a group `error`.
16
+ - `CheckboxGroup`: `legend` (a name set as written, instead of `label`), `error` and an item `tag`.
17
+ - `Checkbox`: `tag`. The whole row is now the target: a press on the hint, the tag or the gap counts as a press on the label.
18
+ - `ListDetail`: a list column beside the open item from `splitFrom` (`medium`, `expanded` by default, or `large`), one pane at a time below it, picked by a bindable `showDetail`.
19
+ - `ImageViewer`: one image full screen at every width over a Bits Dialog, with pinch zoom, pan, double-tap and wheel zoom, a Download button, a loading spinner, and Close, Escape or a swipe down at scale 1 to leave.
20
+ - `.hp-prose` in `base.css`, with `.hp-prose-code`, `.hp-prose-copy` and `.hp-prose-scroll`: styles for rendered markdown or sanitised HTML, at zero specificity. It covers headings, lists, task lists, quotes, code blocks with a copy button, tables that scroll inside their wrapper, and images.
21
+ - Grouped options: `group` on `SelectItem`, `ComboboxItem` and `NativeSelectOption`. Select and Combobox show a sticky heading per group, and NativeSelect renders `<optgroup>`.
22
+ - The token `--list-detail-width: 320px` (ListDetail's list column).
23
+ - **Changed**:
24
+ - `--popover-width`, `--tooltip-width` and `--toast-width` can now be set from an app's class and stylesheet rule. Before, the component's own rule won over an app's one-class rule.
25
+ - The Dialog body sets `scroll-padding-block: var(--space-2)`, so a revealed caret stays 8 px clear of the action row.
26
+ - Combobox's default filter also matches an item's `group`, drops the heading of a group with no match, and scrolls the list to the top as you type.
27
+ - **Checked**: every exported component, `toast()` and `Motion` run under `style-src 'self'` with no policy violation.
28
+
29
+ ## 0.1.0 (2026-11-11)
30
+
31
+ The first public release. It needs Svelte 5.57 or newer.
32
+
33
+ - **Components** (Svelte 5 on Bits UI):
34
+ - Actions and forms: Button, TextField, NativeSelect, Select, Combobox, Checkbox, CheckboxGroup, Switch.
35
+ - Overlays: Dialog (centred, bottom sheet or full screen), Popover, the Menu family, Tooltip with TooltipGroup, and Toaster with `toast()`.
36
+ - Navigation: AppShell (header, bottom bar or drawer, rail or sidebar), Tabs, Steps, Pagination.
37
+ - Data and display: Table, KeyValueList, Stat, Tag, Timeline, MediaFrame with MediaImage, Disclosure.
38
+ - Feedback: Progress, Spinner, Skeleton, LoadRegion, EmptyState, ErrorState.
39
+ - **Motion** (`@mystravil/hardpoint/motion`): `<Motion tier>` and `useMotion()`, the overlay transitions `pop`, `sheet`, `fade` and `drawer`, and timing tokens for every duration. Quiet motion is the default; expressive effects run only inside `<Motion tier="expressive">` and never under reduced motion.
40
+ - **CSS**, framework-free: `fonts.css` (Geist, Geist Mono and Geist Pixel Square with size-matched fallback faces), `tokens.css` and `base.css`.
41
+ - **Themes**: dark by default; light through `data-theme="light"` on `<html>`, or `data-theme="system"` to follow the device.
42
+ - **Phones**: 44 px touch targets on coarse pointers, 16 px inputs, bottom sheets on compact widths that stay above the on-screen keyboard, and safe-area insets.
package/LICENSE CHANGED
@@ -1,25 +1,25 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 MYSTRAVIL
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.
22
-
23
- The fonts in src/lib/fonts (shipped as dist/fonts) are not covered by this
24
- licence. Geist, Geist Mono and Geist Pixel Square are licensed under the SIL
25
- Open Font License 1.1; see OFL.txt and OFL-geist-pixel.txt beside them.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 MYSTRAVIL
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.
22
+
23
+ The fonts in src/lib/fonts (shipped as dist/fonts) are not covered by this
24
+ licence. Geist, Geist Mono and Geist Pixel Square are licensed under the SIL
25
+ Open Font License 1.1; see OFL.txt and OFL-geist-pixel.txt beside them.
package/README.md CHANGED
@@ -1,64 +1,67 @@
1
- # Hardpoint
2
-
3
- Hardpoint is a Svelte 5 design system on [Bits UI](https://www.bits-ui.com/). Its look and motion come from Dan Neuenhaus's MONOLITH reel, adapted for ordinary apps: AMOLED black, titanium ink, the Geist type family, square solid blocks for actions and tags, banded tables of mono data, and expressive motion only where an app asks for it. Bits UI supplies the behaviour and accessibility; Hardpoint supplies the look and the motion.
4
-
5
- It works on desktop and on phones: 44 px touch targets on coarse pointers, 16 px inputs, bottom sheets on compact widths that stay above the on-screen keyboard, and safe-area insets. Dark is the default theme, and a light theme is built in. Status colours (red, yellow, green) mean status only; no hue is a brand colour.
6
-
7
- The package imports nothing from SvelteKit, so plain Svelte apps can use it. The three CSS files are framework-free, so apps without Svelte can use the tokens and base styles.
8
-
9
- ## Components
10
-
11
- - Actions and forms: `Button`, `TextField`, `NativeSelect`, `Select`, `Combobox`, `Checkbox`, `CheckboxGroup`, `Switch`.
12
- - Overlays: `Dialog` (centred, bottom sheet or full screen), `Popover`, `Menu` with `MenuItem`, `MenuCheckboxItem`, `MenuRadioGroup`, `MenuRadioItem`, `MenuGroup` and `MenuSeparator`, `Tooltip` with `TooltipGroup`, and `Toaster` with `toast()`.
13
- - Navigation: `AppShell` (header, bottom bar or drawer, rail or sidebar), `Tabs`, `Steps`, `Pagination`.
14
- - Data and display: `Table`, `KeyValueList`, `Stat`, `Tag`, `Timeline`, `MediaFrame` with `MediaImage`, `Disclosure`.
15
- - Feedback: `Progress`, `Spinner`, `Skeleton`, `LoadRegion`, `EmptyState`, `ErrorState`.
16
-
17
- The source repository has a showcase app with a docs page for each component, the foundations, the motion tokens and a specimen app.
18
-
19
- ## Install
20
-
21
- ```sh
22
- npm install @mystravil/hardpoint
23
- ```
24
-
25
- Svelte 5.57 or newer is a peer dependency. Bits UI comes with the package.
26
-
27
- ## Use
28
-
29
- ```js
30
- import '@mystravil/hardpoint/fonts.css';
31
- import '@mystravil/hardpoint/tokens.css';
32
- import '@mystravil/hardpoint/base.css';
33
-
34
- // Svelte components
35
- import { Button, Dialog, Table, Pagination, TextField, toast } from '@mystravil/hardpoint';
36
- // Motion: <Motion tier="expressive"> for infrequent moments, and the overlay transitions
37
- import { Motion, useMotion, pop, sheet, fade, drawer } from '@mystravil/hardpoint/motion';
38
- ```
39
-
40
- Skip `fonts.css` if the app already serves Geist.
41
-
42
- The theme is an attribute on `<html>`: `data-theme="light"`, `"dark"` or `"system"` (follows the device). Without it the theme is dark. Set it before first paint, and set `<meta name="theme-color">` to the canvas colour, `#000000` for dark and `#f7f5f0` for light.
43
-
44
- ## Docs
45
-
46
- The design docs are in the source repository's `docs/` folder, which is private: `BRIEF.md` is the spec, with every decision and its reason; `ux-research.md` holds the UI/UX research and standards behind the app and phone rules; `elements-da3.md`, `measurements-da3.md` and `reference/da3/` measure the reference reel. `CHANGELOG.md` in the package lists the changes in each version.
47
-
48
- ## Develop
49
-
50
- ```sh
51
- npm install
52
- npm run dev # showcase app in src/routes
53
- npm run check # svelte-check, and no SvelteKit imports in src/lib
54
- npm run build # showcase build, then svelte-package and publint into dist/
55
- npm run audit # targets, overflow, 16px inputs, contrast on every route at four viewports, dark and light
56
- npm run shot -- /foundations shots/f.png --serve # screenshot with console-error check
57
- npm run shot -- /foundations shots/f-phone.png --w 390 --h 844 --touch --full --serve
58
- ```
59
-
60
- `src/lib` is the library. `src/routes` is the showcase.
61
-
62
- ## Licence
63
-
64
- The code is MIT licensed (`LICENSE`). The fonts are not: Geist, Geist Mono and Geist Pixel Square ship in `dist/fonts` under the SIL Open Font License 1.1 (`OFL.txt`, `OFL-geist-pixel.txt`).
1
+ # Hardpoint
2
+
3
+ Hardpoint is a Svelte 5 design system on [Bits UI](https://www.bits-ui.com/). Its look and motion come from Dan Neuenhaus's MONOLITH reel, adapted for ordinary apps: AMOLED black, titanium ink, the Geist type family, square solid blocks for actions and tags, banded tables of mono data, and expressive motion only where an app asks for it. Bits UI supplies the behaviour and accessibility; Hardpoint supplies the look and the motion.
4
+
5
+ It works on desktop and on phones: 44 px touch targets on coarse pointers, 16 px inputs, bottom sheets on compact widths that stay above the on-screen keyboard, and safe-area insets. Dark is the default theme, and a light theme is built in. Status colours (red, yellow, green) mean status only; no hue is a brand colour.
6
+
7
+ The package imports nothing from SvelteKit, so plain Svelte apps can use it. The three CSS files are framework-free, so apps without Svelte can use the tokens and base styles.
8
+
9
+ ## Components
10
+
11
+ - Actions and forms: `Button`, `TextField`, `TextArea`, `NativeSelect`, `Select`, `Combobox`, `Checkbox`, `CheckboxGroup`, `RadioGroup`, `Switch`.
12
+ - Overlays: `Dialog` (centred, bottom sheet or full screen), `Popover`, `Menu` with `MenuItem`, `MenuCheckboxItem`, `MenuRadioGroup`, `MenuRadioItem`, `MenuGroup` and `MenuSeparator`, `Tooltip` with `TooltipGroup`, `Toaster` with `toast()`, and `ImageViewer` (one image full screen, with pinch zoom).
13
+ - Navigation and layout: `AppShell` (header, bottom bar or drawer, rail or sidebar), `ListDetail` (a list beside the open item, one pane at a time on narrow screens), `Tabs`, `Steps`, `Pagination`.
14
+ - Data and display: `Table`, `KeyValueList`, `Stat`, `Tag`, `Timeline`, `MediaFrame` with `MediaImage`, `Disclosure`, and `.hp-prose` in `base.css` for rendered markdown.
15
+ - Feedback: `Progress`, `Meter`, `Notice`, `Spinner`, `Skeleton`, `LoadRegion`, `EmptyState`, `ErrorState`.
16
+
17
+ The source is on GitHub at [MYSTRAVIL/hardpoint](https://github.com/MYSTRAVIL/hardpoint), with a showcase app that has a docs page for each component, the foundations, the motion tokens and a specimen app.
18
+
19
+ ## Install
20
+
21
+ ```sh
22
+ npm install @mystravil/hardpoint
23
+ ```
24
+
25
+ Svelte 5.57 or newer is a peer dependency. Bits UI comes with the package.
26
+
27
+ ## Use
28
+
29
+ ```js
30
+ import '@mystravil/hardpoint/fonts.css';
31
+ import '@mystravil/hardpoint/tokens.css';
32
+ import '@mystravil/hardpoint/base.css';
33
+
34
+ // Svelte components
35
+ import { Button, Dialog, Table, Pagination, TextField, toast } from '@mystravil/hardpoint';
36
+ // Motion: <Motion tier="expressive"> for infrequent moments, and the overlay transitions
37
+ import { Motion, useMotion, pop, sheet, fade, drawer } from '@mystravil/hardpoint/motion';
38
+ ```
39
+
40
+ Skip `fonts.css` if the app already serves Geist.
41
+
42
+ The theme is an attribute on `<html>`: `data-theme="light"`, `"dark"` or `"system"` (follows the device). Without it the theme is dark. Set it before first paint, and set `<meta name="theme-color">` to the canvas colour, `#000000` for dark and `#f7f5f0` for light.
43
+
44
+ ## Docs
45
+
46
+ The design docs are in the source repository's `docs/` folder: `BRIEF.md` is the spec, with every decision and its reason; `ux-research.md` holds the UI/UX research and standards behind the app and phone rules; `elements-da3.md` and `measurements-da3.md` measure the reference reel, whose frames stay out of the public repository. `CHANGELOG.md` in the package lists the changes in each version.
47
+
48
+ ## Develop
49
+
50
+ ```sh
51
+ npm install
52
+ npm run dev # showcase app in src/routes
53
+ npm run check # svelte-check, and no SvelteKit imports in src/lib
54
+ npm run build # showcase build, then svelte-package and publint into dist/
55
+ npm run audit # targets, overflow, 16px inputs, contrast on every route at four viewports, dark and light
56
+ npm run shot -- /foundations shots/f.png --serve # screenshot with console-error check
57
+ npm run shot -- /foundations shots/f-phone.png --w 390 --h 844 --touch --full --serve
58
+ npm run consumer # pack the package and test it in consumer/, a Vite app without SvelteKit, under style-src 'self'
59
+ ```
60
+
61
+ `src/lib` is the library. `src/routes` is the showcase. `consumer/` is the consumer test app.
62
+
63
+ A `v*` tag on GitHub runs the same gates in `.github/workflows/release.yml` and publishes the tested tarball to npm through trusted publishing, with provenance.
64
+
65
+ ## Licence
66
+
67
+ The code is MIT licensed (`LICENSE`). The fonts are not: Geist, Geist Mono and Geist Pixel Square ship in `dist/fonts` under the SIL Open Font License 1.1 (`OFL.txt`, `OFL-geist-pixel.txt`).