@mystravil/hardpoint 0.0.0-stage → 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.
Files changed (126) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/LICENSE +25 -0
  3. package/README.md +64 -3
  4. package/dist/base.css +625 -0
  5. package/dist/components/AppShell.svelte +698 -0
  6. package/dist/components/AppShell.svelte.d.ts +77 -0
  7. package/dist/components/Button.svelte +174 -0
  8. package/dist/components/Button.svelte.d.ts +20 -0
  9. package/dist/components/Checkbox.svelte +235 -0
  10. package/dist/components/Checkbox.svelte.d.ts +23 -0
  11. package/dist/components/CheckboxGroup.svelte +207 -0
  12. package/dist/components/CheckboxGroup.svelte.d.ts +44 -0
  13. package/dist/components/Combobox.svelte +901 -0
  14. package/dist/components/Combobox.svelte.d.ts +72 -0
  15. package/dist/components/Dialog.svelte +359 -0
  16. package/dist/components/Dialog.svelte.d.ts +43 -0
  17. package/dist/components/Disclosure.svelte +201 -0
  18. package/dist/components/Disclosure.svelte.d.ts +27 -0
  19. package/dist/components/EmptyState.svelte +88 -0
  20. package/dist/components/EmptyState.svelte.d.ts +22 -0
  21. package/dist/components/ErrorState.svelte +135 -0
  22. package/dist/components/ErrorState.svelte.d.ts +26 -0
  23. package/dist/components/ImageViewer.svelte +764 -0
  24. package/dist/components/ImageViewer.svelte.d.ts +55 -0
  25. package/dist/components/KeyValueList.svelte +114 -0
  26. package/dist/components/KeyValueList.svelte.d.ts +43 -0
  27. package/dist/components/ListDetail.svelte +218 -0
  28. package/dist/components/ListDetail.svelte.d.ts +37 -0
  29. package/dist/components/LoadRegion.svelte +219 -0
  30. package/dist/components/LoadRegion.svelte.d.ts +27 -0
  31. package/dist/components/MediaFrame.svelte +110 -0
  32. package/dist/components/MediaFrame.svelte.d.ts +20 -0
  33. package/dist/components/MediaImage.svelte +256 -0
  34. package/dist/components/MediaImage.svelte.d.ts +16 -0
  35. package/dist/components/Menu.svelte +258 -0
  36. package/dist/components/Menu.svelte.d.ts +36 -0
  37. package/dist/components/MenuCheckboxItem.svelte +119 -0
  38. package/dist/components/MenuCheckboxItem.svelte.d.ts +15 -0
  39. package/dist/components/MenuGroup.svelte +50 -0
  40. package/dist/components/MenuGroup.svelte.d.ts +15 -0
  41. package/dist/components/MenuItem.svelte +94 -0
  42. package/dist/components/MenuItem.svelte.d.ts +19 -0
  43. package/dist/components/MenuRadioGroup.svelte +62 -0
  44. package/dist/components/MenuRadioGroup.svelte.d.ts +20 -0
  45. package/dist/components/MenuRadioItem.svelte +110 -0
  46. package/dist/components/MenuRadioItem.svelte.d.ts +17 -0
  47. package/dist/components/MenuSeparator.svelte +28 -0
  48. package/dist/components/MenuSeparator.svelte.d.ts +6 -0
  49. package/dist/components/Meter.svelte +283 -0
  50. package/dist/components/Meter.svelte.d.ts +66 -0
  51. package/dist/components/NativeSelect.svelte +135 -0
  52. package/dist/components/NativeSelect.svelte.d.ts +52 -0
  53. package/dist/components/Notice.svelte +262 -0
  54. package/dist/components/Notice.svelte.d.ts +30 -0
  55. package/dist/components/Pagination.svelte +132 -0
  56. package/dist/components/Pagination.svelte.d.ts +18 -0
  57. package/dist/components/Popover.svelte +222 -0
  58. package/dist/components/Popover.svelte.d.ts +35 -0
  59. package/dist/components/Progress.svelte +157 -0
  60. package/dist/components/Progress.svelte.d.ts +34 -0
  61. package/dist/components/RadioGroup.svelte +440 -0
  62. package/dist/components/RadioGroup.svelte.d.ts +50 -0
  63. package/dist/components/Select.svelte +471 -0
  64. package/dist/components/Select.svelte.d.ts +48 -0
  65. package/dist/components/Skeleton.svelte +149 -0
  66. package/dist/components/Skeleton.svelte.d.ts +24 -0
  67. package/dist/components/Spinner.svelte +118 -0
  68. package/dist/components/Spinner.svelte.d.ts +13 -0
  69. package/dist/components/Stat.svelte +253 -0
  70. package/dist/components/Stat.svelte.d.ts +46 -0
  71. package/dist/components/Steps.svelte +189 -0
  72. package/dist/components/Steps.svelte.d.ts +31 -0
  73. package/dist/components/Switch.svelte +222 -0
  74. package/dist/components/Switch.svelte.d.ts +18 -0
  75. package/dist/components/Table.svelte +504 -0
  76. package/dist/components/Table.svelte.d.ts +92 -0
  77. package/dist/components/Tabs.svelte +246 -0
  78. package/dist/components/Tabs.svelte.d.ts +44 -0
  79. package/dist/components/Tag.svelte +40 -0
  80. package/dist/components/Tag.svelte.d.ts +15 -0
  81. package/dist/components/TextArea.svelte +272 -0
  82. package/dist/components/TextArea.svelte.d.ts +28 -0
  83. package/dist/components/TextField.svelte +256 -0
  84. package/dist/components/TextField.svelte.d.ts +32 -0
  85. package/dist/components/Timeline.svelte +156 -0
  86. package/dist/components/Timeline.svelte.d.ts +30 -0
  87. package/dist/components/Toaster.svelte +411 -0
  88. package/dist/components/Toaster.svelte.d.ts +11 -0
  89. package/dist/components/Tooltip.svelte +200 -0
  90. package/dist/components/Tooltip.svelte.d.ts +38 -0
  91. package/dist/components/TooltipGroup.svelte +46 -0
  92. package/dist/components/TooltipGroup.svelte.d.ts +29 -0
  93. package/dist/components/internal/Scrim.svelte +52 -0
  94. package/dist/components/internal/Scrim.svelte.d.ts +15 -0
  95. package/dist/components/internal/Sheet.svelte +263 -0
  96. package/dist/components/internal/Sheet.svelte.d.ts +36 -0
  97. package/dist/components/internal/fade-in.d.ts +10 -0
  98. package/dist/components/internal/fade-in.js +20 -0
  99. package/dist/components/internal/groups.d.ts +14 -0
  100. package/dist/components/internal/groups.js +23 -0
  101. package/dist/components/internal/resolve.d.ts +8 -0
  102. package/dist/components/internal/resolve.js +247 -0
  103. package/dist/components/internal/swipe-dismiss.d.ts +47 -0
  104. package/dist/components/internal/swipe-dismiss.js +220 -0
  105. package/dist/components/internal/visual-viewport.svelte.d.ts +35 -0
  106. package/dist/components/internal/visual-viewport.svelte.js +79 -0
  107. package/dist/components/toast.svelte.d.ts +57 -0
  108. package/dist/components/toast.svelte.js +84 -0
  109. package/dist/fonts/OFL-geist-pixel.txt +92 -0
  110. package/dist/fonts/OFL.txt +93 -0
  111. package/dist/fonts/geist-latin-variable.woff2 +0 -0
  112. package/dist/fonts/geist-mono-latin-variable.woff2 +0 -0
  113. package/dist/fonts/geist-pixel-square.woff2 +0 -0
  114. package/dist/fonts.css +71 -0
  115. package/dist/index.d.ts +45 -0
  116. package/dist/index.js +45 -0
  117. package/dist/motion/Motion.svelte +15 -0
  118. package/dist/motion/Motion.svelte.d.ts +9 -0
  119. package/dist/motion/context.d.ts +18 -0
  120. package/dist/motion/context.js +26 -0
  121. package/dist/motion/index.d.ts +3 -0
  122. package/dist/motion/index.js +3 -0
  123. package/dist/motion/transitions.d.ts +31 -0
  124. package/dist/motion/transitions.js +112 -0
  125. package/dist/tokens.css +283 -0
  126. package/package.json +76 -6
@@ -0,0 +1,88 @@
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 EmptyStateVariant = '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 EmptyStateTitleElement = 'p' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
13
+
14
+ export type EmptyStateProps = Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'title'> & {
15
+ /** What is empty, as a short fixed line: `No projects yet`. Never transformed. */
16
+ title: string;
17
+ /** Why it is empty or what fills it, in the muted ink. */
18
+ description?: string;
19
+ /** The one clear next action: render a `Button` here. */
20
+ action?: Snippet;
21
+ titleAs?: EmptyStateTitleElement;
22
+ variant?: EmptyStateVariant;
23
+ };
24
+ </script>
25
+
26
+ <script lang="ts">
27
+ let {
28
+ title,
29
+ description,
30
+ action,
31
+ titleAs = 'p',
32
+ variant = 'standard',
33
+ class: className,
34
+ ...rest
35
+ }: EmptyStateProps = $props();
36
+ </script>
37
+
38
+ <!--
39
+ A data view with nothing to show (BRIEF, Apps and phones: States): a title,
40
+ an optional description and one clear next action, aligned to the text
41
+ edge with no box around them. It sets no outer margin; the page or the
42
+ Table's `empty` snippet places it. Extra attributes and `class` go to the
43
+ root `div.hp-empty-state`.
44
+ -->
45
+ <div {...rest} class={['hp-empty-state', className]} data-variant={variant}>
46
+ <svelte:element
47
+ this={titleAs}
48
+ class={['hp-empty-state-title', variant === 'display' ? 'hp-pixel' : 'hp-section-title']}
49
+ >{title}</svelte:element
50
+ >
51
+ {#if description}
52
+ <p class="hp-empty-state-description">{description}</p>
53
+ {/if}
54
+ {#if action}
55
+ <div class="hp-empty-state-action">{@render action()}</div>
56
+ {/if}
57
+ </div>
58
+
59
+ <style>
60
+ .hp-empty-state {
61
+ display: grid;
62
+ justify-items: start;
63
+ min-width: 0;
64
+ }
65
+
66
+ .hp-empty-state-title {
67
+ max-width: 100%;
68
+ overflow-wrap: anywhere;
69
+ }
70
+
71
+ /* Reading text: 16px at every width, in the reading measure. */
72
+ .hp-empty-state-description {
73
+ max-width: var(--measure);
74
+ margin-top: var(--space-2);
75
+ color: var(--muted);
76
+ font-size: var(--type-body);
77
+ line-height: 24px;
78
+ overflow-wrap: anywhere;
79
+ }
80
+
81
+ /* The action is its own group: three times the gap inside the text. */
82
+ .hp-empty-state-action {
83
+ display: flex;
84
+ flex-wrap: wrap;
85
+ gap: var(--space-2);
86
+ margin-top: var(--space-6);
87
+ }
88
+ </style>
@@ -0,0 +1,22 @@
1
+ import type { Snippet } from 'svelte';
2
+ import type { HTMLAttributes } from 'svelte/elements';
3
+ /**
4
+ * `standard` (default): the title at the section-title size. `display`:
5
+ * the title in Geist Pixel Square, as the screen's one display line.
6
+ */
7
+ export type EmptyStateVariant = 'standard' | 'display';
8
+ /** The title's element: `p` by default, a heading where the state names a region of the page. */
9
+ export type EmptyStateTitleElement = 'p' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
10
+ export type EmptyStateProps = Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'title'> & {
11
+ /** What is empty, as a short fixed line: `No projects yet`. Never transformed. */
12
+ title: string;
13
+ /** Why it is empty or what fills it, in the muted ink. */
14
+ description?: string;
15
+ /** The one clear next action: render a `Button` here. */
16
+ action?: Snippet;
17
+ titleAs?: EmptyStateTitleElement;
18
+ variant?: EmptyStateVariant;
19
+ };
20
+ declare const EmptyState: import("svelte").Component<EmptyStateProps, {}, "">;
21
+ type EmptyState = ReturnType<typeof EmptyState>;
22
+ export default EmptyState;
@@ -0,0 +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>
@@ -0,0 +1,26 @@
1
+ import type { Snippet } from 'svelte';
2
+ import type { HTMLAttributes } from 'svelte/elements';
3
+ /**
4
+ * `standard` (default): the title at the section-title size. `display`:
5
+ * the title in Geist Pixel Square, as the screen's one display line.
6
+ */
7
+ export type ErrorStateVariant = 'standard' | 'display';
8
+ /** The title's element: `p` by default, a heading where the state names a region of the page. */
9
+ export type ErrorStateTitleElement = 'p' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
10
+ export type ErrorStateProps = Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'title'> & {
11
+ /** What failed, as a short line: `Couldn't load projects`. Never transformed. */
12
+ title: string;
13
+ /** How to fix it: `Check your connection, then try again.` Errors never apologise. */
14
+ description?: string;
15
+ /** Shows a retry button that calls this. */
16
+ onretry?: () => void;
17
+ /** The retry button's label. Defaults to `Try again`. */
18
+ retryLabel?: string;
19
+ /** A fix that is not a retry, such as signing in again: render a `Button` here. It follows the retry button. */
20
+ action?: Snippet;
21
+ titleAs?: ErrorStateTitleElement;
22
+ variant?: ErrorStateVariant;
23
+ };
24
+ declare const ErrorState: import("svelte").Component<ErrorStateProps, {}, "">;
25
+ type ErrorState = ReturnType<typeof ErrorState>;
26
+ export default ErrorState;