@xsynaptic/share-kit 0.4.0 → 0.5.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/dist/styles.css CHANGED
@@ -8,8 +8,8 @@ share-kit {
8
8
  --share-kit-text: CanvasText;
9
9
  --share-kit-muted: GrayText;
10
10
  --share-kit-border: color-mix(in srgb, currentcolor 20%, transparent);
11
- --share-kit-field: color-mix(in srgb, currentcolor 5%, transparent);
12
- --share-kit-accent: LinkText;
11
+ --share-kit-field: color-mix(in srgb, currentcolor 8%, transparent);
12
+ --share-kit-accent: #2563eb;
13
13
  --share-kit-accent-text: Canvas;
14
14
  --share-kit-hover: color-mix(in srgb, var(--share-kit-accent) 8%, transparent);
15
15
  --share-kit-hover-border: color-mix(in srgb, var(--share-kit-accent) 45%, transparent);
@@ -18,6 +18,10 @@ share-kit {
18
18
  --share-kit-gap: 1rem;
19
19
  --share-kit-shadow: 0 20px 25px -5px rgb(0 0 0 / 20%);
20
20
  --share-kit-font-mono: ui-monospace, monospace;
21
+
22
+ @supports (color: light-dark(red, red)) {
23
+ --share-kit-accent: light-dark(#2563eb, #60a5fa);
24
+ }
21
25
  }
22
26
 
23
27
  /* Class-level, so a host's bare element rules don't reach the dialog, and a host without a reset still gets bare controls */
@@ -124,15 +128,10 @@ share-kit {
124
128
  outline: none;
125
129
  }
126
130
 
127
- .share-kit-header-actions {
128
- display: flex;
129
- gap: 0.5rem;
130
- margin: -0.25rem;
131
- }
132
-
133
131
  .share-kit-icon-button {
134
132
  display: inline-flex;
135
133
  padding: 0.25rem;
134
+ margin: -0.25rem;
136
135
  color: inherit;
137
136
  cursor: pointer;
138
137
  border-radius: calc(var(--share-kit-radius) * 0.5);
@@ -169,7 +168,7 @@ share-kit {
169
168
  letter-spacing: 0.04em;
170
169
  }
171
170
 
172
- /* Bleeds to the dialog's edges so the row scrolls under them; scroll padding keeps snapped and focused items inside the gutter */
171
+ /* Bleeds to the dialog's edges so the row scrolls under a fade as wide as the gutter; scroll padding keeps snapped and focused items inside it */
173
172
  .share-kit-destinations-row {
174
173
  display: flex;
175
174
  gap: 0.25rem;
@@ -179,11 +178,22 @@ share-kit {
179
178
  scroll-snap-type: x proximity;
180
179
  scroll-padding-inline: var(--share-kit-gap);
181
180
  scrollbar-width: none;
181
+ mask-image: linear-gradient(
182
+ to right,
183
+ transparent,
184
+ #000 var(--share-kit-gap),
185
+ #000 calc(100% - var(--share-kit-gap)),
186
+ transparent
187
+ );
182
188
  }
183
189
 
184
190
  .share-kit-destinations {
185
191
  display: flex;
186
192
  gap: 0.25rem;
193
+
194
+ @container share-kit (width >= 30rem) {
195
+ flex-wrap: wrap;
196
+ }
187
197
  }
188
198
 
189
199
  .share-kit-destination {
@@ -196,6 +206,7 @@ share-kit {
196
206
  padding: 0.625rem 0.5rem;
197
207
  font-size: 0.75rem;
198
208
  cursor: pointer;
209
+ user-select: none;
199
210
  scroll-snap-align: start;
200
211
  border: 1px solid transparent;
201
212
  border-radius: var(--share-kit-radius);
@@ -233,7 +244,9 @@ share-kit {
233
244
  justify-content: space-between;
234
245
  }
235
246
 
247
+ /* Keeps the count still as its buttons come and go */
236
248
  .share-kit-caption-meta {
249
+ min-height: 1.75rem;
237
250
  margin-top: 0.5rem;
238
251
  }
239
252
 
@@ -260,6 +273,7 @@ share-kit {
260
273
  font-weight: 500;
261
274
  line-height: 1.25;
262
275
  color: var(--share-kit-accent);
276
+ white-space: nowrap;
263
277
  cursor: pointer;
264
278
  border: 1px solid var(--share-kit-border);
265
279
  border-radius: calc(var(--share-kit-radius) * 0.5);
@@ -281,19 +295,19 @@ share-kit {
281
295
  }
282
296
 
283
297
  .share-kit-hint {
284
- margin-top: 0.5rem;
285
298
  font-size: 0.875rem;
286
299
  color: var(--share-kit-muted);
287
300
  }
288
301
 
302
+ .share-kit-destinations-row + .share-kit-hint {
303
+ margin-top: 0.5rem;
304
+ }
305
+
289
306
  .share-kit-grid {
290
307
  display: grid;
291
- grid-template-columns: repeat(2, minmax(0, 1fr));
308
+ grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
292
309
  gap: var(--share-kit-gap);
293
-
294
- @container share-kit (width >= 32rem) {
295
- grid-template-columns: repeat(3, minmax(0, 1fr));
296
- }
310
+ margin-top: 0.5rem;
297
311
  }
298
312
 
299
313
  .share-kit-tile {
@@ -330,12 +344,18 @@ share-kit {
330
344
  border-radius: 999px;
331
345
  }
332
346
 
347
+ .share-kit-link-row > .share-kit-actions {
348
+ flex: none;
349
+ }
350
+
333
351
  .share-kit-link {
334
352
  min-width: 0;
335
353
  font-family: var(--share-kit-font-mono);
336
354
  font-size: 0.8125rem;
337
355
  color: var(--share-kit-muted);
338
- overflow-wrap: anywhere;
356
+ text-overflow: ellipsis;
357
+ white-space: nowrap;
358
+ overflow: hidden;
339
359
  }
340
360
 
341
361
  .share-kit-qr-dialog {
@@ -360,6 +380,15 @@ share-kit {
360
380
  background-color: #fff;
361
381
  }
362
382
 
383
+ .share-kit-visually-hidden {
384
+ position: absolute;
385
+ width: 1px;
386
+ height: 1px;
387
+ overflow: hidden;
388
+ clip-path: inset(50%);
389
+ white-space: nowrap;
390
+ }
391
+
363
392
  .share-kit-status {
364
393
  min-width: 0;
365
394
  font-size: 0.875rem;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xsynaptic/share-kit",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "A share dialog custom element for posting a page to social platforms",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -43,7 +43,7 @@
43
43
  },
44
44
  "devDependencies": {
45
45
  "@bsky/sdk": "^1.3.2",
46
- "@playwright/test": "^1.65.0",
46
+ "@playwright/test": "^1.65.1",
47
47
  "@types/twitter-text": "^3.1.10",
48
48
  "stringz": "2.1.0",
49
49
  "twitter-text": "^3.1.0"