@happyvertical/smrt-images 0.60.15 → 0.60.17

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.
@@ -2,7 +2,7 @@
2
2
  "version": "1.0.0",
3
3
  "timestamp": 0,
4
4
  "packageName": "@happyvertical/smrt-images",
5
- "packageVersion": "0.60.15",
5
+ "packageVersion": "0.60.17",
6
6
  "objects": {
7
7
  "@happyvertical/smrt-images:Image": {
8
8
  "name": "image",
@@ -3,12 +3,12 @@
3
3
  "sensitiveFieldsExcluded": true,
4
4
  "generatedAt": "1970-01-01T00:00:00.000Z",
5
5
  "packageName": "@happyvertical/smrt-images",
6
- "packageVersion": "0.60.15",
6
+ "packageVersion": "0.60.17",
7
7
  "sourceManifestPath": "dist/manifest.json",
8
8
  "agentDocPath": "AGENTS.md",
9
9
  "sourceHashes": {
10
- "manifest": "76350efd138901b4e35cd4ed7478291ad797655858853b6a0816210fcb514146",
11
- "packageJson": "d9298447a0c7970d86d333ca591f753197d3cf03b576af8757c78e5d41274f82",
10
+ "manifest": "6b7141bc933a48dcc4fe8691ad779cb58ce03cd8468deb508dd91517203e42bb",
11
+ "packageJson": "7dfbb8b6ec8c69d40a7779a84c834448eb9b52e33177a6663f0b03025b468916",
12
12
  "agents": "c9782db55a1c4801ec216cf84a7c6bc4748092ffc7991ed0081521ee731506d1"
13
13
  },
14
14
  "exports": [
@@ -153,12 +153,12 @@ function handleDragStart(event: DragEvent, image: ImageLike) {
153
153
  }
154
154
  </script>
155
155
 
156
- <div class="smrt-assets-gallery" data-smrt-component="AssetsGallery">
157
- <div class="gallery-header">
156
+ <div class="smrt-assets-gallery__root" data-smrt-component="AssetsGallery">
157
+ <div class="smrt-assets-gallery__header" data-smrt-part="header">
158
158
  <h3>{t(M['images.assets_gallery.title'])}</h3>
159
159
 
160
- <div class="toolbar">
161
- <div class="search-box">
160
+ <div class="smrt-assets-gallery__toolbar" data-smrt-part="actions">
161
+ <div class="smrt-assets-gallery__search" data-smrt-part="field">
162
162
  <Input
163
163
  type="search"
164
164
  bind:value={searchQuery}
@@ -166,8 +166,8 @@ function handleDragStart(event: DragEvent, image: ImageLike) {
166
166
  />
167
167
  </div>
168
168
 
169
- <div class="filters">
170
- <Select class="orientation-select" bind:value={orientationFilter}>
169
+ <div class="smrt-assets-gallery__filters" data-smrt-part="group">
170
+ <Select class="smrt-assets-gallery__orientation" bind:value={orientationFilter}>
171
171
  <option value="all">{t(M['images.assets_gallery.any_orientation'])}</option>
172
172
  <option value="landscape">Wide</option>
173
173
  <option value="portrait">Tall</option>
@@ -178,67 +178,68 @@ function handleDragStart(event: DragEvent, image: ImageLike) {
178
178
  type="number"
179
179
  bind:value={minWidth}
180
180
  placeholder={t(M['images.assets_gallery.min_width_placeholder'])}
181
- class="size-input"
181
+ class="smrt-assets-gallery__size-input"
182
182
  />
183
183
  <Input
184
184
  type="number"
185
185
  bind:value={minHeight}
186
186
  placeholder={t(M['images.assets_gallery.min_height_placeholder'])}
187
- class="size-input"
187
+ class="smrt-assets-gallery__size-input"
188
188
  />
189
189
  </div>
190
190
  </div>
191
191
  </div>
192
192
 
193
193
  {#if error}
194
- <div class="error-msg">{error}</div>
194
+ <div class="smrt-assets-gallery__error" data-smrt-part="error">{error}</div>
195
195
  {/if}
196
196
 
197
- <div class="gallery-grid">
197
+ <div class="smrt-assets-gallery__grid" data-smrt-part="list">
198
198
  {#each images as image (image.id)}
199
199
  {#if onSelect}
200
200
  <!-- raw-primitive-allow: large draggable selection card wrapping rich image content, not a standard action button -->
201
201
  <button
202
202
  type="button"
203
- class="gallery-item"
204
- class:selectable={true}
203
+ class="smrt-assets-gallery__item"
204
+ class:smrt-assets-gallery__selectable={true}
205
205
  draggable={enableDragToEditor}
206
206
  ondragstart={(event) => handleDragStart(event, image)}
207
207
  onclick={() => handleSelect(image)}
208
+ data-smrt-part="item"
208
209
  >
209
- <div class="img-container">
210
+ <div class="smrt-assets-gallery__thumbnail" data-smrt-part="media">
210
211
  <img src={image.sourceUri || image.url} alt={image.alt || image.name} loading="lazy" />
211
212
  </div>
212
- <div class="item-info">
213
- <span class="item-name" title={image.name}>{image.name}</span>
214
- <span class="item-meta">{image.width} × {image.height}</span>
213
+ <div class="smrt-assets-gallery__details" data-smrt-part="body">
214
+ <span class="smrt-assets-gallery__name" data-smrt-part="title" title={image.name}>{image.name}</span>
215
+ <span class="smrt-assets-gallery__meta" data-smrt-part="meta">{image.width} × {image.height}</span>
215
216
  </div>
216
217
  </button>
217
218
  {:else}
218
- <div class="gallery-item">
219
- <div class="img-container">
219
+ <div class="smrt-assets-gallery__item" data-smrt-part="item">
220
+ <div class="smrt-assets-gallery__thumbnail" data-smrt-part="media">
220
221
  <img src={image.sourceUri || image.url} alt={image.alt || image.name} loading="lazy" />
221
222
  </div>
222
- <div class="item-info">
223
- <span class="item-name" title={image.name}>{image.name}</span>
224
- <span class="item-meta">{image.width} × {image.height}</span>
223
+ <div class="smrt-assets-gallery__details" data-smrt-part="body">
224
+ <span class="smrt-assets-gallery__name" data-smrt-part="title" title={image.name}>{image.name}</span>
225
+ <span class="smrt-assets-gallery__meta" data-smrt-part="meta">{image.width} × {image.height}</span>
225
226
  </div>
226
227
  </div>
227
228
  {/if}
228
229
  {/each}
229
230
 
230
231
  {#if images.length === 0 && !isLoading}
231
- <div class="empty-state">
232
+ <div class="smrt-assets-gallery__empty" data-smrt-part="empty">
232
233
  <p>{t(M['images.assets_gallery.no_images_found'])}</p>
233
234
  </div>
234
235
  {/if}
235
236
  </div>
236
237
 
237
238
  {#if hasMore}
238
- <div class="load-more">
239
+ <div class="smrt-assets-gallery__load-more" data-smrt-part="actions">
239
240
  <Button
240
241
  variant="ghost"
241
- class="load-more-btn--pill"
242
+ class="smrt-assets-gallery__load-more-button"
242
243
  onclick={() => loadImages(false)}
243
244
  disabled={isLoading}
244
245
  >
@@ -250,165 +251,169 @@ function handleDragStart(event: DragEvent, image: ImageLike) {
250
251
 
251
252
  <style>
252
253
  @layer smrt.reset, smrt.structure, smrt.theme;
253
- @layer smrt.theme {
254
- .smrt-assets-gallery {
254
+ @layer smrt.structure {
255
+ .smrt-assets-gallery__root {
255
256
  display: flex;
256
257
  flex-direction: column;
257
258
  gap: 1.5rem;
258
259
  height: 100%;
259
260
  min-height: 400px;
260
- background: var(--smrt-color-surface);
261
- color: var(--smrt-color-on-surface);
262
261
  }
263
-
264
- .gallery-header {
262
+ .smrt-assets-gallery__header {
265
263
  display: flex;
266
264
  flex-direction: column;
267
265
  gap: 1rem;
268
266
  padding: 1rem;
269
- background: var(--smrt-color-surface-container);
270
- border-radius: var(--smrt-radius-lg);
271
- border: var(--smrt-hairline);
272
267
  }
273
-
274
- .gallery-header h3 {
268
+ .smrt-assets-gallery__header h3 {
275
269
  margin: 0;
276
- font-size: var(--smrt-typography-title-large-size, 1.25rem);
277
270
  }
278
-
279
- .toolbar {
271
+ .smrt-assets-gallery__toolbar {
280
272
  display: flex;
281
273
  flex-wrap: wrap;
282
274
  gap: 1rem;
283
275
  align-items: center;
284
276
  justify-content: space-between;
285
277
  }
286
-
287
- .search-box {
278
+ .smrt-assets-gallery__search {
288
279
  flex: 1;
289
280
  min-width: 250px;
290
281
  }
291
-
292
- .filters {
282
+ .smrt-assets-gallery__filters {
293
283
  display: flex;
294
284
  gap: 0.75rem;
295
285
  flex-wrap: wrap;
296
286
  }
297
-
298
287
  /* Layout-only overrides for the migrated filter primitives. The Input / Select
299
- primitives own the visual styling; these :global() rules only pierce their
300
- rendered controls to size the boxes within the flex row (see #1589 scoping
301
- rule). The orientation Select sizes to its content instead of the primitive's
302
- full-width default; the min-width/min-height Inputs are capped. */
303
- .filters :global(.orientation-select) {
288
+ primitives own the visual styling; these :global() rules only pierce their
289
+ rendered controls to size the boxes within the flex row (see #1589 scoping
290
+ rule). The orientation Select sizes to its content instead of the primitive's
291
+ full-width default; the min-width/min-height Inputs are capped. */
292
+ .smrt-assets-gallery__filters :global(.smrt-assets-gallery__orientation) {
304
293
  width: auto;
305
294
  }
306
-
307
- .filters :global(.size-input) {
295
+ .smrt-assets-gallery__filters :global(.smrt-assets-gallery__size-input) {
308
296
  width: 120px;
309
297
  }
310
-
311
- .error-msg {
312
- color: var(--smrt-color-error);
313
- background: color-mix(in srgb, var(--smrt-color-error) 10%, transparent);
298
+ .smrt-assets-gallery__error {
314
299
  padding: 1rem;
315
- border-radius: var(--smrt-radius-md);
316
300
  }
317
-
318
- .gallery-grid {
301
+ .smrt-assets-gallery__grid {
319
302
  display: grid;
320
303
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
321
304
  gap: 1rem;
322
305
  overflow-y: auto;
323
306
  padding: 0.25rem;
324
307
  }
325
-
326
- .gallery-item {
308
+ .smrt-assets-gallery__item {
327
309
  display: flex;
328
310
  flex-direction: column;
329
311
  align-items: stretch;
330
312
  padding: 0;
331
- background: var(--smrt-color-surface-container);
332
- border-radius: var(--smrt-radius-lg);
333
- border: 1px solid var(--smrt-color-surface-container-high);
334
- box-shadow: var(--smrt-elevation-1, 0 1px 3px color-mix(in srgb, var(--smrt-color-shadow) 12%, transparent), 0 1px 2px color-mix(in srgb, var(--smrt-color-shadow) 24%, transparent));
335
313
  overflow: hidden;
336
- color: inherit;
337
- text-align: left;
338
- transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
339
314
  }
340
-
341
- .gallery-item.selectable {
315
+ .smrt-assets-gallery__item.smrt-assets-gallery__selectable {
342
316
  cursor: pointer;
343
317
  }
344
-
345
- .gallery-item.selectable:hover, .gallery-item.selectable:focus {
346
- transform: translateY(-2px);
347
- border-color: var(--smrt-color-primary);
348
- box-shadow: var(--smrt-elevation-2, 0 3px 6px color-mix(in srgb, var(--smrt-color-shadow) 16%, transparent), 0 3px 6px color-mix(in srgb, var(--smrt-color-shadow) 23%, transparent));
349
- outline: none;
350
- }
351
-
352
- .img-container {
318
+ .smrt-assets-gallery__thumbnail {
353
319
  aspect-ratio: 1;
354
320
  width: 100%;
355
- background: var(--smrt-color-surface-container-high);
356
321
  display: flex;
357
322
  align-items: center;
358
323
  justify-content: center;
359
324
  overflow: hidden;
360
325
  }
361
-
362
- .img-container img {
326
+ .smrt-assets-gallery__thumbnail img {
363
327
  max-width: 100%;
364
328
  max-height: 100%;
365
329
  object-fit: cover;
366
330
  width: 100%;
367
331
  height: 100%;
368
332
  }
369
-
370
- .item-info {
333
+ .smrt-assets-gallery__details {
371
334
  padding: 1rem;
372
335
  display: flex;
373
336
  flex-direction: column;
374
337
  gap: 0.35rem;
375
338
  }
376
-
377
- .item-name {
378
- font-weight: var(--smrt-typography-weight-medium, 500);
379
- font-size: var(--smrt-typography-title-medium-size, 1rem);
339
+ .smrt-assets-gallery__name {
380
340
  white-space: nowrap;
381
341
  overflow: hidden;
382
342
  text-overflow: ellipsis;
383
- letter-spacing: var(--smrt-typography-title-medium-tracking);
384
343
  }
344
+ .smrt-assets-gallery__empty {
345
+ grid-column: 1 / -1;
346
+ padding: 3rem;
347
+ }
348
+ .smrt-assets-gallery__load-more {
349
+ display: flex;
350
+ justify-content: center;
351
+ padding: 1rem 0;
352
+ }
353
+ /* Bespoke pill look for the migrated Load More Button. :global() pierces into
354
+ the Button child's rendered <button>, which carries its own scope hash
355
+ (see #1589 scoping rule). */
356
+ .smrt-assets-gallery__load-more :global(.smrt-assets-gallery__load-more-button) {
357
+ padding: 0.75rem 2rem;
358
+ }
359
+ }
385
360
 
386
- .item-meta {
361
+ @layer smrt.theme {
362
+ .smrt-assets-gallery__root {
363
+ background: var(--smrt-color-surface);
364
+ color: var(--smrt-color-on-surface);
365
+ }
366
+ .smrt-assets-gallery__header {
367
+ background: var(--smrt-color-surface-container);
368
+ border-radius: var(--smrt-radius-lg);
369
+ border: var(--smrt-hairline);
370
+ }
371
+ .smrt-assets-gallery__header h3 {
372
+ font-size: var(--smrt-typography-title-large-size, 1.25rem);
373
+ }
374
+ .smrt-assets-gallery__error {
375
+ color: var(--smrt-color-error);
376
+ background: color-mix(in srgb, var(--smrt-color-error) 10%, transparent);
377
+ border-radius: var(--smrt-radius-md);
378
+ }
379
+ .smrt-assets-gallery__item {
380
+ background: var(--smrt-color-surface-container);
381
+ border-radius: var(--smrt-radius-lg);
382
+ border: 1px solid var(--smrt-color-surface-container-high);
383
+ box-shadow: var(--smrt-elevation-1, 0 1px 3px color-mix(in srgb, var(--smrt-color-shadow) 12%, transparent), 0 1px 2px color-mix(in srgb, var(--smrt-color-shadow) 24%, transparent));
384
+ color: inherit;
385
+ text-align: left;
386
+ transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
387
+ }
388
+ .smrt-assets-gallery__item.smrt-assets-gallery__selectable:hover, .smrt-assets-gallery__item.smrt-assets-gallery__selectable:focus {
389
+ transform: translateY(-2px);
390
+ border-color: var(--smrt-color-primary);
391
+ box-shadow: var(--smrt-elevation-2, 0 3px 6px color-mix(in srgb, var(--smrt-color-shadow) 16%, transparent), 0 3px 6px color-mix(in srgb, var(--smrt-color-shadow) 23%, transparent));
392
+ outline: none;
393
+ }
394
+ .smrt-assets-gallery__thumbnail {
395
+ background: var(--smrt-color-surface-container-high);
396
+ }
397
+ .smrt-assets-gallery__name {
398
+ font-weight: var(--smrt-typography-weight-medium, 500);
399
+ font-size: var(--smrt-typography-title-medium-size, 1rem);
400
+ letter-spacing: var(--smrt-typography-title-medium-tracking);
401
+ }
402
+ .smrt-assets-gallery__meta {
387
403
  font-size: var(--smrt-typography-label-large-size, 0.85rem);
388
404
  color: var(--smrt-color-outline);
389
405
  }
390
-
391
- .empty-state {
392
- grid-column: 1 / -1;
406
+ .smrt-assets-gallery__empty {
393
407
  text-align: center;
394
- padding: 3rem;
395
408
  color: var(--smrt-color-outline);
396
409
  background: var(--smrt-color-surface-container);
397
410
  border-radius: var(--smrt-radius-lg);
398
411
  border: 1px dashed var(--smrt-color-outline-variant);
399
412
  }
400
-
401
- .load-more {
402
- display: flex;
403
- justify-content: center;
404
- padding: 1rem 0;
405
- }
406
-
407
413
  /* Bespoke pill look for the migrated Load More Button. :global() pierces into
408
- the Button child's rendered <button>, which carries its own scope hash
409
- (see #1589 scoping rule). */
410
- .load-more :global(.load-more-btn--pill) {
411
- padding: 0.75rem 2rem;
414
+ the Button child's rendered <button>, which carries its own scope hash
415
+ (see #1589 scoping rule). */
416
+ .smrt-assets-gallery__load-more :global(.smrt-assets-gallery__load-more-button) {
412
417
  background: var(--smrt-color-surface-container-high);
413
418
  color: var(--smrt-color-primary);
414
419
  border: var(--smrt-hairline);
@@ -416,8 +421,7 @@ function handleDragStart(event: DragEvent, image: ImageLike) {
416
421
  font-weight: var(--smrt-typography-weight-medium, 500);
417
422
  transition: background 0.2s;
418
423
  }
419
-
420
- .load-more :global(.load-more-btn--pill:hover:not(:disabled)) {
424
+ .smrt-assets-gallery__load-more :global(.smrt-assets-gallery__load-more-button:hover:not(:disabled)) {
421
425
  background: var(--smrt-color-surface-container-highest);
422
426
  }
423
427
  }