@stnd/ui 0.6.5 → 0.7.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/Alert.svelte +2 -2
- package/AlertDialog.svelte +2 -2
- package/CHANGELOG.md +13 -0
- package/Combobox.svelte +7 -7
- package/ContextMenuItemCheckbox.svelte +4 -4
- package/Dialog.svelte +2 -2
- package/Panel.svelte +5 -5
- package/TableOfContents.astro +32 -24
- package/Toast.astro +27 -1
- package/menu.css +1 -1
- package/package.json +2 -2
package/Alert.svelte
CHANGED
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
display: flex;
|
|
46
46
|
align-items: center;
|
|
47
47
|
justify-content: center;
|
|
48
|
-
font-size: var(--
|
|
48
|
+
font-size: var(--scale-d2, 0.875rem);
|
|
49
49
|
flex-shrink: 0;
|
|
50
50
|
padding-block-start: 0.15em;
|
|
51
51
|
}
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
.alert-title {
|
|
60
|
-
font-size: var(--
|
|
60
|
+
font-size: var(--scale-d2, 0.875rem);
|
|
61
61
|
display: block;
|
|
62
62
|
}
|
|
63
63
|
</style>
|
package/AlertDialog.svelte
CHANGED
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
width: 400px;
|
|
101
101
|
color: var(--color-foreground);
|
|
102
102
|
user-select: none;
|
|
103
|
-
background: var(--color-surface-
|
|
103
|
+
background: var(--color-surface-light-2);
|
|
104
104
|
backdrop-filter: var(--filter-glass);
|
|
105
105
|
border-radius: var(--radius);
|
|
106
106
|
box-shadow: var(--shadow-glow), var(--shadow-raised);
|
|
@@ -122,7 +122,7 @@
|
|
|
122
122
|
.std-dialog-desc {
|
|
123
123
|
margin-block-start: var(--space-half);
|
|
124
124
|
color: var(--color-muted);
|
|
125
|
-
font-size: var(--
|
|
125
|
+
font-size: var(--scale-d2);
|
|
126
126
|
}
|
|
127
127
|
.std-dialog-footer {
|
|
128
128
|
display: flex;
|
package/CHANGELOG.md
CHANGED
package/Combobox.svelte
CHANGED
|
@@ -341,13 +341,13 @@
|
|
|
341
341
|
justify-content: space-between;
|
|
342
342
|
width: 100%;
|
|
343
343
|
padding: var(--space-d4) var(--space-d4);
|
|
344
|
-
background: var(--color-surface);
|
|
344
|
+
background: var(--color-surface-light-1);
|
|
345
345
|
font-weight: var(--font-weight);
|
|
346
346
|
font-size: 1em;
|
|
347
347
|
text-box-trim: none;
|
|
348
348
|
|
|
349
349
|
border: none;
|
|
350
|
-
border-radius: var(--radius
|
|
350
|
+
border-radius: var(--radius);
|
|
351
351
|
color: var(--color-muted);
|
|
352
352
|
cursor: pointer;
|
|
353
353
|
text-align: left;
|
|
@@ -360,7 +360,7 @@
|
|
|
360
360
|
.std-combobox-trigger:hover,
|
|
361
361
|
.std-combobox-trigger:focus {
|
|
362
362
|
border-color: var(--color-subtle);
|
|
363
|
-
background: var(--color-surface);
|
|
363
|
+
background: var(--color-surface-light-2);
|
|
364
364
|
color: var(--color-foreground);
|
|
365
365
|
}
|
|
366
366
|
|
|
@@ -383,7 +383,7 @@
|
|
|
383
383
|
width: max-content;
|
|
384
384
|
max-width: 300px;
|
|
385
385
|
overflow: hidden;
|
|
386
|
-
background: var(--color-surface);
|
|
386
|
+
background: var(--color-surface-light-2);
|
|
387
387
|
}
|
|
388
388
|
|
|
389
389
|
.std-combobox-header {
|
|
@@ -405,7 +405,7 @@
|
|
|
405
405
|
border: none;
|
|
406
406
|
outline: none;
|
|
407
407
|
font-family: inherit;
|
|
408
|
-
font-size: var(--
|
|
408
|
+
font-size: var(--scale-d2);
|
|
409
409
|
box-shadow: none;
|
|
410
410
|
}
|
|
411
411
|
|
|
@@ -438,12 +438,12 @@
|
|
|
438
438
|
.std-combobox-empty {
|
|
439
439
|
text-align: center;
|
|
440
440
|
color: var(--color-subtle);
|
|
441
|
-
font-size: var(--
|
|
441
|
+
font-size: var(--scale-d2);
|
|
442
442
|
padding: var(--space-d2);
|
|
443
443
|
}
|
|
444
444
|
|
|
445
445
|
.std-combobox-option.selected {
|
|
446
|
-
background: var(--color-surface-
|
|
446
|
+
background: var(--color-surface-dark-1);
|
|
447
447
|
}
|
|
448
448
|
|
|
449
449
|
.icon {
|
|
@@ -74,8 +74,8 @@
|
|
|
74
74
|
align-items: center;
|
|
75
75
|
gap: 0;
|
|
76
76
|
padding: 0 var(--space-d4);
|
|
77
|
-
border-radius: var(--radius
|
|
78
|
-
font-size: var(--
|
|
77
|
+
border-radius: var(--radius);
|
|
78
|
+
font-size: var(--scale-d2);
|
|
79
79
|
font-family: var(--font-interface);
|
|
80
80
|
color: var(--color-foreground);
|
|
81
81
|
cursor: pointer;
|
|
@@ -85,11 +85,11 @@
|
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
.context-menu-item:hover:not(.disabled) {
|
|
88
|
-
background: var(--color-surface-
|
|
88
|
+
background: var(--color-surface-light-3);
|
|
89
89
|
box-shadow: var(--shadow);
|
|
90
90
|
}
|
|
91
91
|
.context-menu-item:active:not(.disabled) {
|
|
92
|
-
background: var(--color-surface-
|
|
92
|
+
background: var(--color-surface-dark-1);
|
|
93
93
|
box-shadow: var(--shadow-inset);
|
|
94
94
|
}
|
|
95
95
|
|
package/Dialog.svelte
CHANGED
|
@@ -49,10 +49,10 @@
|
|
|
49
49
|
height: var(--dialog-height, auto);
|
|
50
50
|
max-height: var(--dialog-max-height, 88vh);
|
|
51
51
|
overflow: hidden;
|
|
52
|
-
background: var(--color-surface-
|
|
52
|
+
background: var(--color-surface-light-2);
|
|
53
53
|
color: var(--color-foreground);
|
|
54
54
|
border: var(--border, 1px solid var(--color-border));
|
|
55
|
-
border-radius: var(--radius
|
|
55
|
+
border-radius: var(--radius);
|
|
56
56
|
box-shadow: var(--shadow-xl, var(--shadow));
|
|
57
57
|
}
|
|
58
58
|
.std-modal[open] { display: flex; flex-direction: column; }
|
package/Panel.svelte
CHANGED
|
@@ -175,12 +175,12 @@
|
|
|
175
175
|
}
|
|
176
176
|
|
|
177
177
|
.side-right {
|
|
178
|
-
right: var(--
|
|
178
|
+
right: var(--page-padding);
|
|
179
179
|
flex-direction: row-reverse; /* handle on left, body on right */
|
|
180
180
|
}
|
|
181
181
|
|
|
182
182
|
.side-left {
|
|
183
|
-
left: var(--
|
|
183
|
+
left: var(--page-padding);
|
|
184
184
|
flex-direction: row; /* handle on right, body on left */
|
|
185
185
|
}
|
|
186
186
|
|
|
@@ -271,7 +271,7 @@
|
|
|
271
271
|
overflow: hidden;
|
|
272
272
|
display: flex;
|
|
273
273
|
flex-direction: column;
|
|
274
|
-
background: var(--color-surface
|
|
274
|
+
background: var(--color-surface-light-1);
|
|
275
275
|
border-inline: var(--border, 1px solid var(--color-border));
|
|
276
276
|
box-shadow: var(--shadow-raised, var(--shadow-lg));
|
|
277
277
|
backdrop-filter: var(--filter-blur, none);
|
|
@@ -302,7 +302,7 @@
|
|
|
302
302
|
|
|
303
303
|
.panel-title {
|
|
304
304
|
font-family: var(--font-interface, sans-serif);
|
|
305
|
-
font-size: var(--
|
|
305
|
+
font-size: var(--scale-d2, 0.875rem);
|
|
306
306
|
font-weight: 600;
|
|
307
307
|
color: var(--color-foreground, currentColor);
|
|
308
308
|
white-space: nowrap;
|
|
@@ -331,7 +331,7 @@
|
|
|
331
331
|
|
|
332
332
|
&:hover,
|
|
333
333
|
&:focus-visible {
|
|
334
|
-
background: var(--color-surface-
|
|
334
|
+
background: var(--color-surface-light-2, color-mix(in oklch, var(--color-foreground) 8%, transparent));
|
|
335
335
|
color: var(--color-foreground, currentColor);
|
|
336
336
|
outline: none;
|
|
337
337
|
}
|
package/TableOfContents.astro
CHANGED
|
@@ -27,23 +27,25 @@ interface Props {
|
|
|
27
27
|
|
|
28
28
|
function cleanHeadingText(raw: string): string {
|
|
29
29
|
if (!raw) return "";
|
|
30
|
-
return
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
30
|
+
return (
|
|
31
|
+
raw
|
|
32
|
+
.replace(/<[^>]+>/g, "")
|
|
33
|
+
// Decode common numeric and named entities
|
|
34
|
+
.replace(/&#(\d+);/g, (_, dec) => String.fromCharCode(dec))
|
|
35
|
+
.replace(/&#x([0-9a-f]+);/gi, (_, hex) =>
|
|
36
|
+
String.fromCharCode(parseInt(hex, 16)),
|
|
37
|
+
)
|
|
38
|
+
.replace(/ /gi, " ")
|
|
39
|
+
.replace(/&/gi, "&")
|
|
40
|
+
.replace(/"/gi, '"')
|
|
41
|
+
.replace(/'|'/gi, "'")
|
|
42
|
+
.replace(/</gi, "<")
|
|
43
|
+
.replace(/>/gi, ">")
|
|
44
|
+
// Replace non-breaking and special spaces with standard space
|
|
45
|
+
.replace(/[\u00A0\u1680\u2000-\u200A\u202F\u205F\u3000]/g, " ")
|
|
46
|
+
.replace(/\s+/g, " ")
|
|
47
|
+
.trim()
|
|
48
|
+
);
|
|
47
49
|
}
|
|
48
50
|
|
|
49
51
|
const { headings, minHeadings = 2, breakpoint = 1100 } = Astro.props;
|
|
@@ -121,7 +123,7 @@ const tocHeadings = (headings || [])
|
|
|
121
123
|
opacity: 1;
|
|
122
124
|
background: color-mix(
|
|
123
125
|
in oklab,
|
|
124
|
-
var(--color-surface, var(--color-background)) 92%,
|
|
126
|
+
var(--color-surface-light-1, var(--color-background)) 92%,
|
|
125
127
|
transparent
|
|
126
128
|
);
|
|
127
129
|
backdrop-filter: var(--filter-glass, blur(20px)) saturate(160%);
|
|
@@ -138,7 +140,10 @@ const tocHeadings = (headings || [])
|
|
|
138
140
|
top: 0.75rem;
|
|
139
141
|
bottom: 0.75rem;
|
|
140
142
|
width: 1px;
|
|
141
|
-
background: var(
|
|
143
|
+
background: var(
|
|
144
|
+
--color-border,
|
|
145
|
+
color-mix(in oklab, var(--color-foreground) 8%, transparent)
|
|
146
|
+
);
|
|
142
147
|
pointer-events: none;
|
|
143
148
|
z-index: 1;
|
|
144
149
|
transition: opacity var(--duration-fast, 0.25s) ease;
|
|
@@ -168,7 +173,7 @@ const tocHeadings = (headings || [])
|
|
|
168
173
|
|
|
169
174
|
.toc-header-title {
|
|
170
175
|
font-family: var(--font-monospace, monospace);
|
|
171
|
-
font-size: var(--
|
|
176
|
+
font-size: var(--scale-d4, 0.65rem);
|
|
172
177
|
letter-spacing: 0.12em;
|
|
173
178
|
text-transform: uppercase;
|
|
174
179
|
color: var(--color-muted);
|
|
@@ -180,6 +185,7 @@ const tocHeadings = (headings || [])
|
|
|
180
185
|
max-height: 1.5rem;
|
|
181
186
|
opacity: 1;
|
|
182
187
|
margin-bottom: 0.5rem;
|
|
188
|
+
margin-top: 0;
|
|
183
189
|
padding-bottom: 0.35rem;
|
|
184
190
|
border-bottom: 1px solid
|
|
185
191
|
color-mix(in oklab, var(--color-foreground) 7%, transparent);
|
|
@@ -196,6 +202,7 @@ const tocHeadings = (headings || [])
|
|
|
196
202
|
overflow-y: auto;
|
|
197
203
|
overflow-x: hidden;
|
|
198
204
|
padding-right: 1px;
|
|
205
|
+
margin-top: 0;
|
|
199
206
|
}
|
|
200
207
|
|
|
201
208
|
.toc-list::-webkit-scrollbar {
|
|
@@ -229,7 +236,7 @@ const tocHeadings = (headings || [])
|
|
|
229
236
|
/* Label */
|
|
230
237
|
.toc-label {
|
|
231
238
|
font-family: var(--font-interface, sans-serif);
|
|
232
|
-
font-size: var(--
|
|
239
|
+
font-size: var(--scale-d3, 0.8125rem);
|
|
233
240
|
color: var(--color-muted);
|
|
234
241
|
text-align: right;
|
|
235
242
|
line-height: 1.35;
|
|
@@ -253,7 +260,7 @@ const tocHeadings = (headings || [])
|
|
|
253
260
|
}
|
|
254
261
|
|
|
255
262
|
.toc-item[data-depth="3"] .toc-label {
|
|
256
|
-
font-size: var(--
|
|
263
|
+
font-size: var(--scale-d4, 0.725rem);
|
|
257
264
|
opacity: 0.65;
|
|
258
265
|
padding-right: 4px;
|
|
259
266
|
}
|
|
@@ -323,8 +330,9 @@ const tocHeadings = (headings || [])
|
|
|
323
330
|
<script>
|
|
324
331
|
document.addEventListener("astro:page-load", () => {
|
|
325
332
|
const toc = document.querySelector<HTMLElement>(".stnd-toc");
|
|
326
|
-
const tocLinks =
|
|
327
|
-
|
|
333
|
+
const tocLinks = document.querySelectorAll<HTMLElement>(
|
|
334
|
+
".toc-item[data-slug]",
|
|
335
|
+
);
|
|
328
336
|
if (tocLinks.length === 0) return;
|
|
329
337
|
|
|
330
338
|
if (toc) {
|
package/Toast.astro
CHANGED
|
@@ -42,6 +42,9 @@
|
|
|
42
42
|
box-shadow: var(--shadow-glow);
|
|
43
43
|
backdrop-filter: var(--filter-glass);
|
|
44
44
|
background: var(--color-glass);
|
|
45
|
+
display: flex;
|
|
46
|
+
align-items: center;
|
|
47
|
+
gap: var(--space-half);
|
|
45
48
|
margin: 0 auto;
|
|
46
49
|
|
|
47
50
|
/* Animation setup */
|
|
@@ -50,6 +53,27 @@
|
|
|
50
53
|
transition: all var(--transition);
|
|
51
54
|
}
|
|
52
55
|
|
|
56
|
+
:global(.toast-action) {
|
|
57
|
+
margin-left: var(--space-half);
|
|
58
|
+
padding: var(--space-quarter, 0.2rem) var(--space-half, 0.5rem);
|
|
59
|
+
border-radius: var(--radius-s, 4px);
|
|
60
|
+
border: 1px solid currentColor;
|
|
61
|
+
background: transparent;
|
|
62
|
+
color: inherit;
|
|
63
|
+
font-family: inherit;
|
|
64
|
+
font-size: var(--scale-d3, 0.85em);
|
|
65
|
+
font-weight: 600;
|
|
66
|
+
cursor: pointer;
|
|
67
|
+
white-space: nowrap;
|
|
68
|
+
text-decoration: none;
|
|
69
|
+
transition: all var(--transition, 150ms ease);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
:global(.toast-action:hover) {
|
|
73
|
+
background: var(--color-foreground);
|
|
74
|
+
color: var(--color-background);
|
|
75
|
+
}
|
|
76
|
+
|
|
53
77
|
:global(.toast-item.show) {
|
|
54
78
|
opacity: 1;
|
|
55
79
|
filter: blur(0);
|
|
@@ -135,9 +159,10 @@
|
|
|
135
159
|
// Use declarative data-gate attributes so StandardGate handles it
|
|
136
160
|
if (action && action.view) {
|
|
137
161
|
try {
|
|
138
|
-
// If the view looks like a command (starts with ::), use data-
|
|
162
|
+
// If the view looks like a command (starts with ::), use data-launcher-view
|
|
139
163
|
if (String(action.view).startsWith("::")) {
|
|
140
164
|
const tmp = document.createElement("button");
|
|
165
|
+
tmp.setAttribute("data-launcher-view", action.view);
|
|
141
166
|
tmp.setAttribute("data-gate-trigger", action.view);
|
|
142
167
|
tmp.style.display = "none";
|
|
143
168
|
document.body.appendChild(tmp);
|
|
@@ -146,6 +171,7 @@
|
|
|
146
171
|
} else {
|
|
147
172
|
// Otherwise treat as a prompt (initial query)
|
|
148
173
|
const tmp = document.createElement("button");
|
|
174
|
+
tmp.setAttribute("data-launcher-prompt", action.view);
|
|
149
175
|
tmp.setAttribute("data-gate-prompt", action.view);
|
|
150
176
|
tmp.style.display = "none";
|
|
151
177
|
document.body.appendChild(tmp);
|
package/menu.css
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stnd/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"svelte": "./Combobox.svelte",
|
|
6
6
|
"exports": {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"wrangler": "^4.129.0",
|
|
33
|
-
"@stnd/icon": "0.
|
|
33
|
+
"@stnd/icon": "0.3.0",
|
|
34
34
|
"@stnd/store": "0.5.1",
|
|
35
35
|
"@stnd/utils": "0.6.1"
|
|
36
36
|
},
|