@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.
- package/CHANGELOG.md +51 -38
- package/LICENSE +25 -25
- package/README.md +67 -64
- package/dist/base.css +625 -625
- package/dist/components/AppShell.svelte +698 -698
- package/dist/components/Button.svelte +221 -174
- package/dist/components/Button.svelte.d.ts +18 -2
- package/dist/components/Checkbox.svelte +235 -235
- package/dist/components/CheckboxGroup.svelte +207 -207
- package/dist/components/Combobox.svelte +901 -901
- package/dist/components/Dialog.svelte +359 -359
- package/dist/components/Disclosure.svelte +201 -201
- package/dist/components/EmptyState.svelte +88 -88
- package/dist/components/ErrorState.svelte +135 -135
- package/dist/components/ImageViewer.svelte +764 -764
- package/dist/components/KeyValueList.svelte +114 -114
- package/dist/components/ListDetail.svelte +218 -218
- package/dist/components/LoadRegion.svelte +219 -219
- package/dist/components/MediaFrame.svelte +110 -110
- package/dist/components/MediaImage.svelte +256 -256
- package/dist/components/Menu.svelte +275 -258
- package/dist/components/MenuCheckboxItem.svelte +119 -119
- package/dist/components/MenuGroup.svelte +50 -50
- package/dist/components/MenuItem.svelte +94 -94
- package/dist/components/MenuRadioGroup.svelte +62 -62
- package/dist/components/MenuRadioItem.svelte +110 -110
- package/dist/components/MenuSeparator.svelte +28 -28
- package/dist/components/Meter.svelte +283 -283
- package/dist/components/NativeSelect.svelte +135 -135
- package/dist/components/Notice.svelte +262 -262
- package/dist/components/Popover.svelte +222 -222
- package/dist/components/Progress.svelte +157 -157
- package/dist/components/RadioGroup.svelte +440 -440
- package/dist/components/Select.svelte +471 -471
- package/dist/components/Skeleton.svelte +149 -149
- package/dist/components/Spinner.svelte +118 -118
- package/dist/components/Stat.svelte +253 -253
- package/dist/components/Steps.svelte +189 -189
- package/dist/components/Switch.svelte +222 -222
- package/dist/components/Table.svelte +504 -504
- package/dist/components/Tabs.svelte +246 -246
- package/dist/components/Tag.svelte +40 -40
- package/dist/components/TextArea.svelte +272 -272
- package/dist/components/TextField.svelte +396 -256
- package/dist/components/TextField.svelte.d.ts +16 -1
- package/dist/components/Timeline.svelte +156 -156
- package/dist/components/Toaster.svelte +411 -411
- package/dist/components/Tooltip.svelte +200 -200
- package/dist/components/TooltipGroup.svelte +46 -46
- package/dist/components/internal/Scrim.svelte +52 -52
- package/dist/components/internal/Sheet.svelte +263 -263
- package/dist/fonts.css +71 -71
- package/dist/tokens.css +283 -283
- package/package.json +81 -76
|
@@ -1,110 +1,110 @@
|
|
|
1
|
-
<script lang="ts" module>
|
|
2
|
-
import type { Snippet } from 'svelte';
|
|
3
|
-
import type { DropdownMenu as BitsDropdownMenu } from 'bits-ui';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Attributes and handlers not listed here go to the item element (Bits UI
|
|
7
|
-
* `DropdownMenu.RadioItem`), among them `disabled`, `onSelect` and
|
|
8
|
-
* `closeOnSelect` (default true; pass false to keep the menu open, so the
|
|
9
|
-
* change shows). Place it inside a MenuRadioGroup.
|
|
10
|
-
*/
|
|
11
|
-
export type MenuRadioItemProps = Omit<BitsDropdownMenu.RadioItemProps, 'child' | 'children'> & {
|
|
12
|
-
/** Chosen when the group's `value` equals it. */
|
|
13
|
-
value: string;
|
|
14
|
-
/** The label, as written (never caps). */
|
|
15
|
-
children: Snippet;
|
|
16
|
-
};
|
|
17
|
-
</script>
|
|
18
|
-
|
|
19
|
-
<script lang="ts">
|
|
20
|
-
import { DropdownMenu } from 'bits-ui';
|
|
21
|
-
|
|
22
|
-
let { ref = $bindable(null), class: className, children, ...rest }: MenuRadioItemProps = $props();
|
|
23
|
-
</script>
|
|
24
|
-
|
|
25
|
-
<!--
|
|
26
|
-
A Bits UI radio item, role="menuitemradio", with aria-checked and
|
|
27
|
-
data-state (checked, unchecked). A press, Enter or Space chooses it.
|
|
28
|
-
-->
|
|
29
|
-
<DropdownMenu.RadioItem bind:ref {...rest}>
|
|
30
|
-
{#snippet child({ props })}
|
|
31
|
-
<div {...props} class={['hp-menu-radio-item', className]}>
|
|
32
|
-
<span class="hp-menu-box" aria-hidden="true">
|
|
33
|
-
<span class="hp-menu-radio-mark"></span>
|
|
34
|
-
</span>
|
|
35
|
-
<span class="hp-menu-item-label">{@render children()}</span>
|
|
36
|
-
</div>
|
|
37
|
-
{/snippet}
|
|
38
|
-
</DropdownMenu.RadioItem>
|
|
39
|
-
|
|
40
|
-
<style>
|
|
41
|
-
/* The row: the same as MenuItem's. Only the mark fades (below). */
|
|
42
|
-
.hp-menu-radio-item {
|
|
43
|
-
display: flex;
|
|
44
|
-
align-items: center;
|
|
45
|
-
gap: var(--space-3);
|
|
46
|
-
box-sizing: border-box;
|
|
47
|
-
min-height: var(--control-height);
|
|
48
|
-
padding: var(--space-1) var(--menu-inset, var(--space-3));
|
|
49
|
-
font: var(--type-body) / 24px var(--sans);
|
|
50
|
-
overflow-wrap: anywhere;
|
|
51
|
-
cursor: pointer;
|
|
52
|
-
user-select: none;
|
|
53
|
-
touch-action: manipulation;
|
|
54
|
-
-webkit-tap-highlight-color: transparent;
|
|
55
|
-
outline: none;
|
|
56
|
-
}
|
|
57
|
-
.hp-menu-item-label {
|
|
58
|
-
flex: 1 1 auto;
|
|
59
|
-
min-width: 0;
|
|
60
|
-
}
|
|
61
|
-
.hp-menu-radio-item[data-highlighted] {
|
|
62
|
-
background: var(--surface-hover);
|
|
63
|
-
outline: var(--menu-contour, none);
|
|
64
|
-
outline-offset: -2px;
|
|
65
|
-
}
|
|
66
|
-
.hp-menu-radio-item:active:not([data-disabled]) {
|
|
67
|
-
background: var(--surface-raised);
|
|
68
|
-
}
|
|
69
|
-
.hp-menu-radio-item[data-disabled] {
|
|
70
|
-
color: var(--muted);
|
|
71
|
-
cursor: not-allowed;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/* The checkbox item's black box; chosen, a titanium edge and a solid
|
|
75
|
-
8px titanium square, square like every other mark. */
|
|
76
|
-
.hp-menu-box {
|
|
77
|
-
flex: none;
|
|
78
|
-
display: grid;
|
|
79
|
-
place-items: center;
|
|
80
|
-
box-sizing: border-box;
|
|
81
|
-
width: 20px;
|
|
82
|
-
height: 20px;
|
|
83
|
-
border: 1px solid var(--border-control);
|
|
84
|
-
background: var(--canvas);
|
|
85
|
-
color: var(--accent);
|
|
86
|
-
}
|
|
87
|
-
.hp-menu-radio-item[data-state='checked'] .hp-menu-box {
|
|
88
|
-
border-color: var(--accent);
|
|
89
|
-
}
|
|
90
|
-
.hp-menu-radio-item[data-disabled] .hp-menu-box {
|
|
91
|
-
border-color: var(--border);
|
|
92
|
-
color: var(--muted);
|
|
93
|
-
}
|
|
94
|
-
/* The mark is always there, at opacity 0 until the item is chosen.
|
|
95
|
-
Choosing fades it in from 0 over --dur-mark (BRIEF, short motion);
|
|
96
|
-
the item that loses the choice drops its mark at once. A CSS
|
|
97
|
-
transition never runs on an element's first style, so a menu that
|
|
98
|
-
opens shows its mark at once. 0ms is a snap. Opacity only, so reduced
|
|
99
|
-
motion keeps it. */
|
|
100
|
-
.hp-menu-radio-mark {
|
|
101
|
-
width: 8px;
|
|
102
|
-
height: 8px;
|
|
103
|
-
background: currentColor;
|
|
104
|
-
opacity: 0;
|
|
105
|
-
}
|
|
106
|
-
.hp-menu-radio-item[data-state='checked'] .hp-menu-radio-mark {
|
|
107
|
-
opacity: 1;
|
|
108
|
-
transition: opacity var(--dur-mark) var(--settle);
|
|
109
|
-
}
|
|
110
|
-
</style>
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import type { DropdownMenu as BitsDropdownMenu } from 'bits-ui';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Attributes and handlers not listed here go to the item element (Bits UI
|
|
7
|
+
* `DropdownMenu.RadioItem`), among them `disabled`, `onSelect` and
|
|
8
|
+
* `closeOnSelect` (default true; pass false to keep the menu open, so the
|
|
9
|
+
* change shows). Place it inside a MenuRadioGroup.
|
|
10
|
+
*/
|
|
11
|
+
export type MenuRadioItemProps = Omit<BitsDropdownMenu.RadioItemProps, 'child' | 'children'> & {
|
|
12
|
+
/** Chosen when the group's `value` equals it. */
|
|
13
|
+
value: string;
|
|
14
|
+
/** The label, as written (never caps). */
|
|
15
|
+
children: Snippet;
|
|
16
|
+
};
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<script lang="ts">
|
|
20
|
+
import { DropdownMenu } from 'bits-ui';
|
|
21
|
+
|
|
22
|
+
let { ref = $bindable(null), class: className, children, ...rest }: MenuRadioItemProps = $props();
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<!--
|
|
26
|
+
A Bits UI radio item, role="menuitemradio", with aria-checked and
|
|
27
|
+
data-state (checked, unchecked). A press, Enter or Space chooses it.
|
|
28
|
+
-->
|
|
29
|
+
<DropdownMenu.RadioItem bind:ref {...rest}>
|
|
30
|
+
{#snippet child({ props })}
|
|
31
|
+
<div {...props} class={['hp-menu-radio-item', className]}>
|
|
32
|
+
<span class="hp-menu-box" aria-hidden="true">
|
|
33
|
+
<span class="hp-menu-radio-mark"></span>
|
|
34
|
+
</span>
|
|
35
|
+
<span class="hp-menu-item-label">{@render children()}</span>
|
|
36
|
+
</div>
|
|
37
|
+
{/snippet}
|
|
38
|
+
</DropdownMenu.RadioItem>
|
|
39
|
+
|
|
40
|
+
<style>
|
|
41
|
+
/* The row: the same as MenuItem's. Only the mark fades (below). */
|
|
42
|
+
.hp-menu-radio-item {
|
|
43
|
+
display: flex;
|
|
44
|
+
align-items: center;
|
|
45
|
+
gap: var(--space-3);
|
|
46
|
+
box-sizing: border-box;
|
|
47
|
+
min-height: var(--control-height);
|
|
48
|
+
padding: var(--space-1) var(--menu-inset, var(--space-3));
|
|
49
|
+
font: var(--type-body) / 24px var(--sans);
|
|
50
|
+
overflow-wrap: anywhere;
|
|
51
|
+
cursor: pointer;
|
|
52
|
+
user-select: none;
|
|
53
|
+
touch-action: manipulation;
|
|
54
|
+
-webkit-tap-highlight-color: transparent;
|
|
55
|
+
outline: none;
|
|
56
|
+
}
|
|
57
|
+
.hp-menu-item-label {
|
|
58
|
+
flex: 1 1 auto;
|
|
59
|
+
min-width: 0;
|
|
60
|
+
}
|
|
61
|
+
.hp-menu-radio-item[data-highlighted] {
|
|
62
|
+
background: var(--surface-hover);
|
|
63
|
+
outline: var(--menu-contour, none);
|
|
64
|
+
outline-offset: -2px;
|
|
65
|
+
}
|
|
66
|
+
.hp-menu-radio-item:active:not([data-disabled]) {
|
|
67
|
+
background: var(--surface-raised);
|
|
68
|
+
}
|
|
69
|
+
.hp-menu-radio-item[data-disabled] {
|
|
70
|
+
color: var(--muted);
|
|
71
|
+
cursor: not-allowed;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/* The checkbox item's black box; chosen, a titanium edge and a solid
|
|
75
|
+
8px titanium square, square like every other mark. */
|
|
76
|
+
.hp-menu-box {
|
|
77
|
+
flex: none;
|
|
78
|
+
display: grid;
|
|
79
|
+
place-items: center;
|
|
80
|
+
box-sizing: border-box;
|
|
81
|
+
width: 20px;
|
|
82
|
+
height: 20px;
|
|
83
|
+
border: 1px solid var(--border-control);
|
|
84
|
+
background: var(--canvas);
|
|
85
|
+
color: var(--accent);
|
|
86
|
+
}
|
|
87
|
+
.hp-menu-radio-item[data-state='checked'] .hp-menu-box {
|
|
88
|
+
border-color: var(--accent);
|
|
89
|
+
}
|
|
90
|
+
.hp-menu-radio-item[data-disabled] .hp-menu-box {
|
|
91
|
+
border-color: var(--border);
|
|
92
|
+
color: var(--muted);
|
|
93
|
+
}
|
|
94
|
+
/* The mark is always there, at opacity 0 until the item is chosen.
|
|
95
|
+
Choosing fades it in from 0 over --dur-mark (BRIEF, short motion);
|
|
96
|
+
the item that loses the choice drops its mark at once. A CSS
|
|
97
|
+
transition never runs on an element's first style, so a menu that
|
|
98
|
+
opens shows its mark at once. 0ms is a snap. Opacity only, so reduced
|
|
99
|
+
motion keeps it. */
|
|
100
|
+
.hp-menu-radio-mark {
|
|
101
|
+
width: 8px;
|
|
102
|
+
height: 8px;
|
|
103
|
+
background: currentColor;
|
|
104
|
+
opacity: 0;
|
|
105
|
+
}
|
|
106
|
+
.hp-menu-radio-item[data-state='checked'] .hp-menu-radio-mark {
|
|
107
|
+
opacity: 1;
|
|
108
|
+
transition: opacity var(--dur-mark) var(--settle);
|
|
109
|
+
}
|
|
110
|
+
</style>
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
<script lang="ts" module>
|
|
2
|
-
import type { DropdownMenu as BitsDropdownMenu } from 'bits-ui';
|
|
3
|
-
|
|
4
|
-
/** Attributes go to the separator element (Bits UI `DropdownMenu.Separator`). */
|
|
5
|
-
export type MenuSeparatorProps = Omit<BitsDropdownMenu.SeparatorProps, 'child' | 'children'>;
|
|
6
|
-
</script>
|
|
7
|
-
|
|
8
|
-
<script lang="ts">
|
|
9
|
-
import { DropdownMenu } from 'bits-ui';
|
|
10
|
-
|
|
11
|
-
let { ref = $bindable(null), class: className, ...rest }: MenuSeparatorProps = $props();
|
|
12
|
-
</script>
|
|
13
|
-
|
|
14
|
-
<!-- A Bits UI separator, role="separator", between groups of items. -->
|
|
15
|
-
<DropdownMenu.Separator bind:ref {...rest}>
|
|
16
|
-
{#snippet child({ props })}
|
|
17
|
-
<div {...props} class={['hp-menu-separator', className]}></div>
|
|
18
|
-
{/snippet}
|
|
19
|
-
</DropdownMenu.Separator>
|
|
20
|
-
|
|
21
|
-
<style>
|
|
22
|
-
/* A 1px divider across the whole menu, in the decorative line colour. */
|
|
23
|
-
.hp-menu-separator {
|
|
24
|
-
height: 1px;
|
|
25
|
-
margin-block: var(--space-1);
|
|
26
|
-
background: var(--border);
|
|
27
|
-
}
|
|
28
|
-
</style>
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { DropdownMenu as BitsDropdownMenu } from 'bits-ui';
|
|
3
|
+
|
|
4
|
+
/** Attributes go to the separator element (Bits UI `DropdownMenu.Separator`). */
|
|
5
|
+
export type MenuSeparatorProps = Omit<BitsDropdownMenu.SeparatorProps, 'child' | 'children'>;
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<script lang="ts">
|
|
9
|
+
import { DropdownMenu } from 'bits-ui';
|
|
10
|
+
|
|
11
|
+
let { ref = $bindable(null), class: className, ...rest }: MenuSeparatorProps = $props();
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<!-- A Bits UI separator, role="separator", between groups of items. -->
|
|
15
|
+
<DropdownMenu.Separator bind:ref {...rest}>
|
|
16
|
+
{#snippet child({ props })}
|
|
17
|
+
<div {...props} class={['hp-menu-separator', className]}></div>
|
|
18
|
+
{/snippet}
|
|
19
|
+
</DropdownMenu.Separator>
|
|
20
|
+
|
|
21
|
+
<style>
|
|
22
|
+
/* A 1px divider across the whole menu, in the decorative line colour. */
|
|
23
|
+
.hp-menu-separator {
|
|
24
|
+
height: 1px;
|
|
25
|
+
margin-block: var(--space-1);
|
|
26
|
+
background: var(--border);
|
|
27
|
+
}
|
|
28
|
+
</style>
|