@mystravil/hardpoint 0.2.0 → 0.3.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.
Files changed (54) hide show
  1. package/CHANGELOG.md +51 -38
  2. package/LICENSE +25 -25
  3. package/README.md +67 -64
  4. package/dist/base.css +625 -625
  5. package/dist/components/AppShell.svelte +698 -698
  6. package/dist/components/Button.svelte +221 -174
  7. package/dist/components/Button.svelte.d.ts +18 -2
  8. package/dist/components/Checkbox.svelte +235 -235
  9. package/dist/components/CheckboxGroup.svelte +207 -207
  10. package/dist/components/Combobox.svelte +901 -901
  11. package/dist/components/Dialog.svelte +359 -359
  12. package/dist/components/Disclosure.svelte +201 -201
  13. package/dist/components/EmptyState.svelte +88 -88
  14. package/dist/components/ErrorState.svelte +135 -135
  15. package/dist/components/ImageViewer.svelte +764 -764
  16. package/dist/components/KeyValueList.svelte +114 -114
  17. package/dist/components/ListDetail.svelte +218 -218
  18. package/dist/components/LoadRegion.svelte +219 -219
  19. package/dist/components/MediaFrame.svelte +110 -110
  20. package/dist/components/MediaImage.svelte +256 -256
  21. package/dist/components/Menu.svelte +275 -258
  22. package/dist/components/MenuCheckboxItem.svelte +119 -119
  23. package/dist/components/MenuGroup.svelte +50 -50
  24. package/dist/components/MenuItem.svelte +94 -94
  25. package/dist/components/MenuRadioGroup.svelte +62 -62
  26. package/dist/components/MenuRadioItem.svelte +110 -110
  27. package/dist/components/MenuSeparator.svelte +28 -28
  28. package/dist/components/Meter.svelte +283 -283
  29. package/dist/components/NativeSelect.svelte +135 -135
  30. package/dist/components/Notice.svelte +262 -262
  31. package/dist/components/Popover.svelte +222 -222
  32. package/dist/components/Progress.svelte +157 -157
  33. package/dist/components/RadioGroup.svelte +440 -440
  34. package/dist/components/Select.svelte +471 -471
  35. package/dist/components/Skeleton.svelte +149 -149
  36. package/dist/components/Spinner.svelte +118 -118
  37. package/dist/components/Stat.svelte +253 -253
  38. package/dist/components/Steps.svelte +189 -189
  39. package/dist/components/Switch.svelte +222 -222
  40. package/dist/components/Table.svelte +504 -504
  41. package/dist/components/Tabs.svelte +246 -246
  42. package/dist/components/Tag.svelte +40 -40
  43. package/dist/components/TextArea.svelte +272 -272
  44. package/dist/components/TextField.svelte +396 -256
  45. package/dist/components/TextField.svelte.d.ts +16 -1
  46. package/dist/components/Timeline.svelte +156 -156
  47. package/dist/components/Toaster.svelte +411 -411
  48. package/dist/components/Tooltip.svelte +200 -200
  49. package/dist/components/TooltipGroup.svelte +46 -46
  50. package/dist/components/internal/Scrim.svelte +52 -52
  51. package/dist/components/internal/Sheet.svelte +263 -263
  52. package/dist/fonts.css +71 -71
  53. package/dist/tokens.css +283 -283
  54. package/package.json +81 -76
@@ -1,135 +1,135 @@
1
- <script lang="ts" module>
2
- import type { Snippet } from 'svelte';
3
- import type { HTMLAttributes } from 'svelte/elements';
4
-
5
- /**
6
- * `standard` (default): the title at the section-title size. `display`:
7
- * the title in Geist Pixel Square, as the screen's one display line.
8
- */
9
- export type ErrorStateVariant = 'standard' | 'display';
10
-
11
- /** The title's element: `p` by default, a heading where the state names a region of the page. */
12
- export type ErrorStateTitleElement = 'p' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
13
-
14
- export type ErrorStateProps = Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'title'> & {
15
- /** What failed, as a short line: `Couldn't load projects`. Never transformed. */
16
- title: string;
17
- /** How to fix it: `Check your connection, then try again.` Errors never apologise. */
18
- description?: string;
19
- /** Shows a retry button that calls this. */
20
- onretry?: () => void;
21
- /** The retry button's label. Defaults to `Try again`. */
22
- retryLabel?: string;
23
- /** A fix that is not a retry, such as signing in again: render a `Button` here. It follows the retry button. */
24
- action?: Snippet;
25
- titleAs?: ErrorStateTitleElement;
26
- variant?: ErrorStateVariant;
27
- };
28
- </script>
29
-
30
- <script lang="ts">
31
- import Button from './Button.svelte';
32
-
33
- let {
34
- title,
35
- description,
36
- onretry,
37
- retryLabel = 'Try again',
38
- action,
39
- titleAs = 'p',
40
- variant = 'standard',
41
- class: className,
42
- ...rest
43
- }: ErrorStateProps = $props();
44
- </script>
45
-
46
- <!--
47
- A data view that failed to load, shown where its content would be (BRIEF,
48
- Apps and phones: States): what failed, how to fix it, and a retry action.
49
- The title carries an outlined square with a "!" in the status red, so the
50
- state never rests on colour alone; the text stays in the two inks. The
51
- title and description sit in a role="alert" region, so a screen reader
52
- announces the failure when the state replaces the content; the actions
53
- stay outside it. It sets no outer margin. Extra attributes and `class` go
54
- to the root `div.hp-error-state`.
55
- -->
56
- <div {...rest} class={['hp-error-state', className]} data-variant={variant}>
57
- <div class="hp-error-state-message" role="alert">
58
- <svelte:element
59
- this={titleAs}
60
- class={['hp-error-state-title', variant === 'display' ? 'hp-pixel' : 'hp-section-title']}
61
- >
62
- <span class="hp-error-state-icon" aria-hidden="true">
63
- <svg viewBox="0 0 16 16" width="16" height="16" fill="none" stroke="currentColor">
64
- <path d="M1.5 1.5h13v13h-13z" />
65
- <path d="M8 4v4M8 10v2" stroke-width="2" />
66
- </svg>
67
- </span>
68
- <span>{title}</span>
69
- </svelte:element>
70
- {#if description}
71
- <p class="hp-error-state-description">{description}</p>
72
- {/if}
73
- </div>
74
- {#if onretry || action}
75
- <div class="hp-error-state-actions">
76
- {#if onretry}
77
- <!-- type="button", so a retry inside a form never submits it. -->
78
- <Button type="button" onclick={onretry}>{retryLabel}</Button>
79
- {/if}
80
- {@render action?.()}
81
- </div>
82
- {/if}
83
- </div>
84
-
85
- <style>
86
- .hp-error-state {
87
- display: grid;
88
- justify-items: start;
89
- min-width: 0;
90
- }
91
-
92
- .hp-error-state-message {
93
- display: grid;
94
- justify-items: start;
95
- gap: var(--space-2);
96
- max-width: 100%;
97
- }
98
-
99
- /* The icon hangs before the title's first line, as on a field error. */
100
- .hp-error-state-title {
101
- display: flex;
102
- gap: var(--space-2);
103
- max-width: 100%;
104
- overflow-wrap: anywhere;
105
- }
106
- /* One line box high, so the icon centres on the first line of the title
107
- however it wraps. */
108
- .hp-error-state-icon {
109
- display: flex;
110
- flex: none;
111
- align-items: center;
112
- height: 1lh;
113
- color: var(--danger);
114
- }
115
- .hp-error-state-icon svg {
116
- display: block;
117
- }
118
-
119
- /* Reading text: 16px at every width, in the reading measure. */
120
- .hp-error-state-description {
121
- max-width: var(--measure);
122
- color: var(--muted);
123
- font-size: var(--type-body);
124
- line-height: 24px;
125
- overflow-wrap: anywhere;
126
- }
127
-
128
- /* The actions are their own group: three times the gap inside the text. */
129
- .hp-error-state-actions {
130
- display: flex;
131
- flex-wrap: wrap;
132
- gap: var(--space-2);
133
- margin-top: var(--space-6);
134
- }
135
- </style>
1
+ <script lang="ts" module>
2
+ import type { Snippet } from 'svelte';
3
+ import type { HTMLAttributes } from 'svelte/elements';
4
+
5
+ /**
6
+ * `standard` (default): the title at the section-title size. `display`:
7
+ * the title in Geist Pixel Square, as the screen's one display line.
8
+ */
9
+ export type ErrorStateVariant = 'standard' | 'display';
10
+
11
+ /** The title's element: `p` by default, a heading where the state names a region of the page. */
12
+ export type ErrorStateTitleElement = 'p' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
13
+
14
+ export type ErrorStateProps = Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'title'> & {
15
+ /** What failed, as a short line: `Couldn't load projects`. Never transformed. */
16
+ title: string;
17
+ /** How to fix it: `Check your connection, then try again.` Errors never apologise. */
18
+ description?: string;
19
+ /** Shows a retry button that calls this. */
20
+ onretry?: () => void;
21
+ /** The retry button's label. Defaults to `Try again`. */
22
+ retryLabel?: string;
23
+ /** A fix that is not a retry, such as signing in again: render a `Button` here. It follows the retry button. */
24
+ action?: Snippet;
25
+ titleAs?: ErrorStateTitleElement;
26
+ variant?: ErrorStateVariant;
27
+ };
28
+ </script>
29
+
30
+ <script lang="ts">
31
+ import Button from './Button.svelte';
32
+
33
+ let {
34
+ title,
35
+ description,
36
+ onretry,
37
+ retryLabel = 'Try again',
38
+ action,
39
+ titleAs = 'p',
40
+ variant = 'standard',
41
+ class: className,
42
+ ...rest
43
+ }: ErrorStateProps = $props();
44
+ </script>
45
+
46
+ <!--
47
+ A data view that failed to load, shown where its content would be (BRIEF,
48
+ Apps and phones: States): what failed, how to fix it, and a retry action.
49
+ The title carries an outlined square with a "!" in the status red, so the
50
+ state never rests on colour alone; the text stays in the two inks. The
51
+ title and description sit in a role="alert" region, so a screen reader
52
+ announces the failure when the state replaces the content; the actions
53
+ stay outside it. It sets no outer margin. Extra attributes and `class` go
54
+ to the root `div.hp-error-state`.
55
+ -->
56
+ <div {...rest} class={['hp-error-state', className]} data-variant={variant}>
57
+ <div class="hp-error-state-message" role="alert">
58
+ <svelte:element
59
+ this={titleAs}
60
+ class={['hp-error-state-title', variant === 'display' ? 'hp-pixel' : 'hp-section-title']}
61
+ >
62
+ <span class="hp-error-state-icon" aria-hidden="true">
63
+ <svg viewBox="0 0 16 16" width="16" height="16" fill="none" stroke="currentColor">
64
+ <path d="M1.5 1.5h13v13h-13z" />
65
+ <path d="M8 4v4M8 10v2" stroke-width="2" />
66
+ </svg>
67
+ </span>
68
+ <span>{title}</span>
69
+ </svelte:element>
70
+ {#if description}
71
+ <p class="hp-error-state-description">{description}</p>
72
+ {/if}
73
+ </div>
74
+ {#if onretry || action}
75
+ <div class="hp-error-state-actions">
76
+ {#if onretry}
77
+ <!-- type="button", so a retry inside a form never submits it. -->
78
+ <Button type="button" onclick={onretry}>{retryLabel}</Button>
79
+ {/if}
80
+ {@render action?.()}
81
+ </div>
82
+ {/if}
83
+ </div>
84
+
85
+ <style>
86
+ .hp-error-state {
87
+ display: grid;
88
+ justify-items: start;
89
+ min-width: 0;
90
+ }
91
+
92
+ .hp-error-state-message {
93
+ display: grid;
94
+ justify-items: start;
95
+ gap: var(--space-2);
96
+ max-width: 100%;
97
+ }
98
+
99
+ /* The icon hangs before the title's first line, as on a field error. */
100
+ .hp-error-state-title {
101
+ display: flex;
102
+ gap: var(--space-2);
103
+ max-width: 100%;
104
+ overflow-wrap: anywhere;
105
+ }
106
+ /* One line box high, so the icon centres on the first line of the title
107
+ however it wraps. */
108
+ .hp-error-state-icon {
109
+ display: flex;
110
+ flex: none;
111
+ align-items: center;
112
+ height: 1lh;
113
+ color: var(--danger);
114
+ }
115
+ .hp-error-state-icon svg {
116
+ display: block;
117
+ }
118
+
119
+ /* Reading text: 16px at every width, in the reading measure. */
120
+ .hp-error-state-description {
121
+ max-width: var(--measure);
122
+ color: var(--muted);
123
+ font-size: var(--type-body);
124
+ line-height: 24px;
125
+ overflow-wrap: anywhere;
126
+ }
127
+
128
+ /* The actions are their own group: three times the gap inside the text. */
129
+ .hp-error-state-actions {
130
+ display: flex;
131
+ flex-wrap: wrap;
132
+ gap: var(--space-2);
133
+ margin-top: var(--space-6);
134
+ }
135
+ </style>