@happyvertical/smrt-images 0.60.16 → 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.
@@ -276,40 +276,40 @@ onDestroy(() => {
276
276
  });
277
277
  </script>
278
278
 
279
- <div class="smrt-image-uploader" data-smrt-component="ImageUploader">
279
+ <div class="smrt-image-uploader__root" data-smrt-component="ImageUploader">
280
280
  {#if selectedImage}
281
281
  <!-- Gallery Confirmation Step -->
282
- <div class="header">
283
- <Button variant="ghost" size="sm" class="back-btn--link" onclick={handleBackToChooser}>
282
+ <div class="smrt-image-uploader__header" data-smrt-part="header">
283
+ <Button variant="ghost" size="sm" class="smrt-image-uploader__back" onclick={handleBackToChooser}>
284
284
  <svg viewBox="0 0 24 24" width="20" height="20" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round">
285
285
  <polyline points="15 18 9 12 15 6"></polyline>
286
286
  </svg>
287
287
  Back
288
288
  </Button>
289
289
  {#if onCancel}
290
- <Button variant="ghost" size="sm" class="close-btn--x" onclick={onCancel}>×</Button>
290
+ <Button variant="ghost" size="sm" class="smrt-image-uploader__close" onclick={onCancel}>×</Button>
291
291
  {/if}
292
292
  </div>
293
293
 
294
- <div class="confirm-panel">
295
- <div class="confirm-preview-wrapper">
296
- <img class="confirm-preview-img" src={selectedImage.sourceUri || selectedImage.url} alt={selectedImage.name} />
294
+ <div class="smrt-image-uploader__confirm" data-smrt-part="panel">
295
+ <div class="smrt-image-uploader__preview" data-smrt-part="panel">
296
+ <img class="smrt-image-uploader__preview-image" data-smrt-part="media" src={selectedImage.sourceUri || selectedImage.url} alt={selectedImage.name} />
297
297
  </div>
298
298
 
299
- <div class="confirm-info">
300
- <span class="confirm-name">{selectedImage.name}</span>
301
- <span class="confirm-meta">{selectedImage.width} × {selectedImage.height}</span>
299
+ <div class="smrt-image-uploader__details" data-smrt-part="body">
300
+ <span class="smrt-image-uploader__name" data-smrt-part="title">{selectedImage.name}</span>
301
+ <span class="smrt-image-uploader__meta" data-smrt-part="meta">{selectedImage.width} × {selectedImage.height}</span>
302
302
  </div>
303
303
 
304
- <div class="confirm-actions">
305
- <Button variant="primary" class="primary-btn--pill" onclick={handleConfirmOriginal}>
304
+ <div class="smrt-image-uploader__confirm-actions" data-smrt-part="actions">
305
+ <Button variant="primary" class="smrt-image-uploader__primary-button" onclick={handleConfirmOriginal}>
306
306
  {t(M['images.image_uploader.select_image'])}
307
307
  </Button>
308
308
  <Button
309
309
  variant="ghost"
310
310
  class={showVariation
311
- ? 'variation-toggle--chip variation-toggle--active'
312
- : 'variation-toggle--chip'}
311
+ ? 'smrt-image-uploader__variation-button smrt-image-uploader__variation-active'
312
+ : 'smrt-image-uploader__variation-button'}
313
313
  onclick={() => (showVariation = !showVariation)}
314
314
  >
315
315
  <svg viewBox="0 0 24 24" width="16" height="16" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round">
@@ -321,8 +321,8 @@ onDestroy(() => {
321
321
  </div>
322
322
 
323
323
  {#if showVariation}
324
- <div class="variation-form">
325
- <p class="variation-hint">{t(M['images.image_uploader.variation_hint'])}</p>
324
+ <div class="smrt-image-uploader__variation" data-smrt-part="field">
325
+ <p class="smrt-image-uploader__variation-hint" data-smrt-part="description">{t(M['images.image_uploader.variation_hint'])}</p>
326
326
  <Textarea
327
327
  bind:value={variationPrompt}
328
328
  placeholder={t(M['images.image_uploader.variation_prompt_placeholder'])}
@@ -330,16 +330,16 @@ onDestroy(() => {
330
330
  disabled={isGenerating}
331
331
  />
332
332
  {#if variationError}
333
- <div class="variation-error">{variationError}</div>
333
+ <div class="smrt-image-uploader__variation-error" data-smrt-part="error">{variationError}</div>
334
334
  {/if}
335
335
  <Button
336
336
  variant="primary"
337
- class="generate-btn--pill"
337
+ class="smrt-image-uploader__generate-button"
338
338
  disabled={isGenerating || !variationPrompt.trim()}
339
339
  onclick={handleGenerateVariation}
340
340
  >
341
341
  {#if isGenerating}
342
- <span class="spinner"></span>
342
+ <span class="smrt-image-uploader__spinner" data-smrt-part="spinner"></span>
343
343
  {t(M['images.image_uploader.generating'])}
344
344
  {:else}
345
345
  {t(M['images.image_uploader.generate_variation'])}
@@ -351,48 +351,48 @@ onDestroy(() => {
351
351
 
352
352
  {:else}
353
353
  <!-- Normal Chooser -->
354
- <div class="header">
354
+ <div class="smrt-image-uploader__header" data-smrt-part="header">
355
355
  <h3>{t(M['images.image_uploader.choose_image'])}</h3>
356
356
  {#if onCancel}
357
- <Button variant="ghost" size="sm" class="close-btn--x" onclick={onCancel}>×</Button>
357
+ <Button variant="ghost" size="sm" class="smrt-image-uploader__close" onclick={onCancel}>×</Button>
358
358
  {/if}
359
359
  </div>
360
360
 
361
- <div class="tabs">
361
+ <div class="smrt-image-uploader__tabs" data-smrt-part="nav">
362
362
  {#if allowedTabs.includes('gallery')}
363
363
  <Button
364
364
  variant="ghost"
365
- class={activeTab === 'gallery' ? 'uploader-tab uploader-tab--active' : 'uploader-tab'}
365
+ class={activeTab === 'gallery' ? 'smrt-image-uploader__tab smrt-image-uploader__tab-active' : 'smrt-image-uploader__tab'}
366
366
  onclick={() => (activeTab = 'gallery')}
367
367
  >Pictures</Button>
368
368
  {/if}
369
369
  {#if allowedTabs.includes('upload')}
370
370
  <Button
371
371
  variant="ghost"
372
- class={activeTab === 'upload' ? 'uploader-tab uploader-tab--active' : 'uploader-tab'}
372
+ class={activeTab === 'upload' ? 'smrt-image-uploader__tab smrt-image-uploader__tab-active' : 'smrt-image-uploader__tab'}
373
373
  onclick={() => (activeTab = 'upload')}
374
374
  >Upload</Button>
375
375
  {/if}
376
376
  {#if allowedTabs.includes('camera')}
377
377
  <Button
378
378
  variant="ghost"
379
- class={activeTab === 'camera' ? 'uploader-tab uploader-tab--active' : 'uploader-tab'}
379
+ class={activeTab === 'camera' ? 'smrt-image-uploader__tab smrt-image-uploader__tab-active' : 'smrt-image-uploader__tab'}
380
380
  onclick={() => (activeTab = 'camera')}
381
381
  >Camera</Button>
382
382
  {/if}
383
383
  {#if allowedTabs.includes('external')}
384
384
  <Button
385
385
  variant="ghost"
386
- class={activeTab === 'external' ? 'uploader-tab uploader-tab--active' : 'uploader-tab'}
386
+ class={activeTab === 'external' ? 'smrt-image-uploader__tab smrt-image-uploader__tab-active' : 'smrt-image-uploader__tab'}
387
387
  onclick={() => (activeTab = 'external')}
388
388
  >{t(M['images.image_uploader.external_url'])}</Button>
389
389
  {/if}
390
390
  </div>
391
391
 
392
- <div class="tab-content">
392
+ <div class="smrt-image-uploader__tab-content" data-smrt-part="body">
393
393
 
394
394
  {#if activeTab === 'gallery'}
395
- <div class="gallery-wrapper">
395
+ <div class="smrt-image-uploader__gallery" data-smrt-part="body">
396
396
  <AssetsGallery
397
397
  {apiBaseUrl}
398
398
  client={galleryClient}
@@ -403,8 +403,8 @@ onDestroy(() => {
403
403
 
404
404
  {:else if activeTab === 'upload'}
405
405
  <div
406
- class="upload-area"
407
- class:dragging={isDragging}
406
+ class="smrt-image-uploader__dropzone"
407
+ class:smrt-image-uploader__dragging={isDragging}
408
408
  ondragover={handleDragOver}
409
409
  ondragleave={handleDragLeave}
410
410
  ondrop={handleDrop}
@@ -412,8 +412,9 @@ onDestroy(() => {
412
412
  onkeydown={(e) => e.key === 'Enter' && uploadInput?.click()}
413
413
  tabindex="0"
414
414
  role="button"
415
+ data-smrt-part="panel"
415
416
  >
416
- <div class="upload-icon">
417
+ <div class="smrt-image-uploader__upload-icon" data-smrt-part="icon">
417
418
  <svg viewBox="0 0 24 24" width="48" height="48" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round">
418
419
  <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path>
419
420
  <polyline points="17 8 12 3 7 8"></polyline>
@@ -421,8 +422,8 @@ onDestroy(() => {
421
422
  </svg>
422
423
  </div>
423
424
  <p>{t(M['images.image_uploader.drag_and_drop'])}</p>
424
- <span class="divider">or</span>
425
- <Button variant="primary" class="browse-btn--decorative">{t(M['images.image_uploader.browse_files'])}</Button>
425
+ <span class="smrt-image-uploader__divider" data-smrt-part="marker">or</span>
426
+ <Button variant="primary" class="smrt-image-uploader__browse-button">{t(M['images.image_uploader.browse_files'])}</Button>
426
427
  <!-- raw-primitive-allow: hidden file input driven imperatively via a DOM ref (bind:this gives uploadInput so the parent can call .click() and onchange reads target.files); the Input primitive exposes a component instance, not the underlying HTMLInputElement -->
427
428
  <input
428
429
  type="file"
@@ -432,26 +433,26 @@ onDestroy(() => {
432
433
  style="display: none;"
433
434
  />
434
435
  {#if uploadError}
435
- <p class="error">{uploadError}</p>
436
+ <p class="smrt-image-uploader__error" data-smrt-part="error">{uploadError}</p>
436
437
  {/if}
437
438
  </div>
438
439
 
439
440
  {:else if activeTab === 'camera'}
440
- <div class="camera-area">
441
+ <div class="smrt-image-uploader__camera" data-smrt-part="panel">
441
442
  {#if cameraError}
442
- <div class="error-panel">
443
+ <div class="smrt-image-uploader__camera-error" data-smrt-part="status">
443
444
  <p>{cameraError}</p>
444
- <Button variant="secondary" class="try-again-btn" onclick={startCamera}>{t(M['images.image_uploader.try_again'])}</Button>
445
+ <Button variant="secondary" class="smrt-image-uploader__retry-button" onclick={startCamera}>{t(M['images.image_uploader.try_again'])}</Button>
445
446
  </div>
446
447
  {:else}
447
- <div class="video-container">
448
+ <div class="smrt-image-uploader__video" data-smrt-part="panel">
448
449
  <!-- svelte-ignore a11y_media_has_caption -->
449
450
  <video bind:this={videoElement} autoplay playsinline></video>
450
451
  {#if !isCameraActive}
451
- <div class="loading-overlay">{t(M['images.image_uploader.starting_camera'])}</div>
452
+ <div class="smrt-image-uploader__loading" data-smrt-part="backdrop">{t(M['images.image_uploader.starting_camera'])}</div>
452
453
  {/if}
453
454
  </div>
454
- <Button variant="primary" class="capture-btn--pill" disabled={!isCameraActive} onclick={takePicture}>
455
+ <Button variant="primary" class="smrt-image-uploader__capture-button" disabled={!isCameraActive} onclick={takePicture}>
455
456
  {t(M['images.image_uploader.take_picture'])}
456
457
  </Button>
457
458
  <canvas bind:this={canvasElement} style="display: none;"></canvas>
@@ -459,19 +460,19 @@ onDestroy(() => {
459
460
  </div>
460
461
 
461
462
  {:else if activeTab === 'external'}
462
- <div class="external-area">
463
- <p class="hint">{t(M['images.image_uploader.external_hint'])}</p>
464
- <div class="input-group">
463
+ <div class="smrt-image-uploader__external" data-smrt-part="panel">
464
+ <p class="smrt-image-uploader__hint" data-smrt-part="description">{t(M['images.image_uploader.external_hint'])}</p>
465
+ <div class="smrt-image-uploader__input-group" data-smrt-part="group">
465
466
  <Input
466
467
  type="url"
467
- class="external-url-input"
468
+ class="smrt-image-uploader__url-input"
468
469
  bind:value={externalUrl}
469
470
  placeholder={t(M['images.image_uploader.external_url_placeholder'])}
470
471
  onkeydown={(e) => e.key === 'Enter' && handleExternalSubmit()}
471
472
  />
472
473
  <Button
473
474
  variant="primary"
474
- class="submit-btn--inline"
475
+ class="smrt-image-uploader__submit-button"
475
476
  disabled={!externalUrl.trim()}
476
477
  onclick={handleExternalSubmit}
477
478
  >
@@ -487,98 +488,49 @@ onDestroy(() => {
487
488
 
488
489
  <style>
489
490
  @layer smrt.reset, smrt.structure, smrt.theme;
490
- @layer smrt.theme {
491
- .smrt-image-uploader {
491
+ @layer smrt.structure {
492
+ .smrt-image-uploader__root {
492
493
  display: flex;
493
494
  flex-direction: column;
494
- background: var(--smrt-color-surface-container);
495
- color: var(--smrt-color-on-surface);
496
- border-radius: var(--smrt-radius-lg);
497
- border: var(--smrt-hairline);
498
495
  overflow: hidden;
499
496
  height: 100%;
500
497
  min-height: 500px;
501
498
  }
502
-
503
- .header {
499
+ .smrt-image-uploader__header {
504
500
  display: flex;
505
501
  justify-content: space-between;
506
502
  align-items: center;
507
503
  padding: 1rem 1.5rem;
508
- border-bottom: var(--smrt-hairline);
509
504
  }
510
-
511
- .header h3 {
505
+ .smrt-image-uploader__header h3 {
512
506
  margin: 0;
513
- font-size: var(--smrt-typography-title-medium-size, 1.15rem);
514
507
  }
515
-
516
- /* Migrated close Button keeps its muted ghost look; only the × glyph sizing
517
- is custom. :global() pierces into the Button child's rendered <button>
518
- (see #1589 scoping rule). */
519
- .header :global(.close-btn--x) {
520
- color: var(--smrt-color-outline);
521
- font-size: var(--smrt-typography-headline-small-size, 1.5rem);
522
- line-height: 1;
523
- }
524
-
525
- .header :global(.close-btn--x:hover) {
526
- color: var(--smrt-color-on-surface);
527
- }
528
-
529
- .tabs {
508
+ .smrt-image-uploader__tabs {
530
509
  display: flex;
531
- background: var(--smrt-color-surface-container-high);
532
- border-bottom: var(--smrt-hairline);
533
510
  }
534
-
535
511
  /* The tab strip is migrated to ghost Buttons; the active state is the bottom
536
- underline rather than a filled variant. :global() pierces into each
537
- Button's rendered <button> (see #1589 scoping rule). */
538
- .tabs :global(.uploader-tab) {
512
+ underline rather than a filled variant. :global() pierces into each
513
+ Button's rendered <button> (see #1589 scoping rule). */
514
+ .smrt-image-uploader__tabs :global(.smrt-image-uploader__tab) {
539
515
  flex: 1;
540
- border: none;
541
- border-bottom: 2px solid var(--smrt-color-outline-variant);
542
516
  padding: 1rem;
543
- color: var(--smrt-color-outline);
544
- font-weight: var(--smrt-typography-weight-medium, 500);
545
- border-radius: 0;
546
- transition: all 0.2s;
547
- text-transform: uppercase;
548
- font-size: var(--smrt-typography-label-large-size, 0.85rem);
549
- letter-spacing: var(--smrt-typography-label-large-tracking);
550
- }
551
-
552
- .tabs :global(.uploader-tab:hover) {
553
- color: var(--smrt-color-on-surface-variant);
554
- background: color-mix(in srgb, var(--smrt-color-on-surface) 2%, transparent);
555
- }
556
-
557
- .tabs :global(.uploader-tab--active) {
558
- color: var(--smrt-color-primary);
559
- border-bottom: 2px solid var(--smrt-color-primary);
560
- background: transparent;
561
517
  }
562
-
563
- .tab-content {
518
+ .smrt-image-uploader__tab-content {
564
519
  flex: 1;
565
520
  display: flex;
566
521
  flex-direction: column;
567
522
  position: relative;
568
523
  overflow: hidden;
569
524
  }
570
-
571
525
  /* Gallery Tab */
572
- .gallery-wrapper {
526
+ .smrt-image-uploader__gallery {
573
527
  flex: 1;
574
528
  display: flex;
575
529
  flex-direction: column;
576
530
  overflow: hidden;
577
- /* Gallery internal scroll handles the rest */
578
531
  }
579
-
580
532
  /* Upload Tab */
581
- .upload-area {
533
+ .smrt-image-uploader__dropzone {
582
534
  flex: 1;
583
535
  display: flex;
584
536
  flex-direction: column;
@@ -586,59 +538,30 @@ onDestroy(() => {
586
538
  justify-content: center;
587
539
  padding: 3rem;
588
540
  margin: 1.5rem;
589
- border: 2px dashed var(--smrt-color-outline-variant);
590
- border-radius: var(--smrt-radius-lg);
591
- background: var(--smrt-color-surface-container-high);
592
541
  cursor: pointer;
593
- transition: all 0.2s;
594
- }
595
-
596
- .upload-area:hover, .upload-area:focus {
597
- border-color: var(--smrt-hairline-strong-color);
598
- background: var(--smrt-color-surface-container-highest);
599
- outline: none;
600
- }
601
-
602
- .upload-area.dragging {
603
- border-color: var(--smrt-color-primary);
604
- background: color-mix(in srgb, var(--smrt-color-primary) 5%, transparent);
605
- transform: scale(1.02);
606
542
  }
607
-
608
- .upload-icon {
609
- color: var(--smrt-color-primary);
543
+ .smrt-image-uploader__upload-icon {
610
544
  margin-bottom: 1rem;
611
545
  }
612
-
613
- .upload-area p {
614
- font-size: var(--smrt-typography-body-large-size, 1.1rem);
546
+ .smrt-image-uploader__dropzone p {
615
547
  margin: 0 0 0.5rem 0;
616
548
  }
617
-
618
- .divider {
619
- font-size: var(--smrt-typography-label-large-size, 0.85rem);
620
- color: var(--smrt-color-outline);
549
+ .smrt-image-uploader__divider {
621
550
  margin-bottom: 1rem;
622
551
  }
623
-
624
552
  /* Decorative label inside the click-catching upload area; the parent handles
625
- clicks, so this migrated Button stays inert. :global() pierces into the
626
- Button child's rendered <button> (see #1589 scoping rule). */
627
- .upload-area :global(.browse-btn--decorative) {
553
+ clicks, so this migrated Button stays inert. :global() pierces into the
554
+ Button child's rendered <button> (see #1589 scoping rule). */
555
+ .smrt-image-uploader__dropzone :global(.smrt-image-uploader__browse-button) {
628
556
  padding: 0.5rem 1.5rem;
629
- border-radius: var(--smrt-radius-full);
630
- font-weight: var(--smrt-typography-weight-medium, 500);
631
- pointer-events: none; /* Let parent handle clicks */
557
+ pointer-events: none;
558
+ /* Let parent handle clicks */
632
559
  }
633
-
634
- .error {
560
+ .smrt-image-uploader__error {
635
561
  margin-top: 1rem;
636
- color: var(--smrt-color-error);
637
- font-size: var(--smrt-typography-body-medium-size, 0.9rem);
638
562
  }
639
-
640
563
  /* Camera Tab */
641
- .camera-area {
564
+ .smrt-image-uploader__camera {
642
565
  flex: 1;
643
566
  display: flex;
644
567
  flex-direction: column;
@@ -646,140 +569,90 @@ onDestroy(() => {
646
569
  gap: 1.5rem;
647
570
  align-items: center;
648
571
  justify-content: center;
649
- background: var(--smrt-color-surface-dim);
650
572
  }
651
-
652
- .video-container {
573
+ .smrt-image-uploader__video {
653
574
  position: relative;
654
575
  width: 100%;
655
576
  max-width: 600px;
656
577
  aspect-ratio: 4/3;
657
- background: var(--smrt-color-surface-container-lowest);
658
- border-radius: var(--smrt-radius-md);
659
578
  overflow: hidden;
660
579
  }
661
-
662
580
  video {
663
581
  width: 100%;
664
582
  height: 100%;
665
583
  object-fit: contain;
666
584
  }
667
-
668
- .loading-overlay {
585
+ .smrt-image-uploader__loading {
669
586
  position: absolute;
670
- top: 0; left: 0; right: 0; bottom: 0;
587
+ top: 0;
588
+ left: 0;
589
+ right: 0;
590
+ bottom: 0;
671
591
  display: flex;
672
592
  align-items: center;
673
593
  justify-content: center;
674
- background: var(--smrt-color-scrim, rgba(0, 0, 0, 0.7));
675
- color: white;
676
594
  }
677
-
678
595
  /* Large primary capture action; keeps its oversized pill sizing over the
679
- primary variant. :global() pierces into the Button child (see #1589). */
680
- .camera-area :global(.capture-btn--pill) {
596
+ primary variant. :global() pierces into the Button child (see #1589). */
597
+ .smrt-image-uploader__camera :global(.smrt-image-uploader__capture-button) {
681
598
  padding: 1rem 3rem;
682
- border-radius: var(--smrt-radius-full);
683
- font-size: var(--smrt-typography-body-large-size, 1.1rem);
684
- font-weight: var(--smrt-typography-weight-semibold, 600);
685
- }
686
-
687
- .camera-area :global(.capture-btn--pill:disabled) {
688
- background: var(--smrt-color-outline-variant);
689
- color: var(--smrt-color-outline);
690
599
  }
691
-
692
- .error-panel {
693
- text-align: center;
600
+ .smrt-image-uploader__camera-error {
694
601
  padding: 2rem;
695
- background: var(--smrt-color-surface-container);
696
- border-radius: var(--smrt-radius-md);
697
602
  }
698
-
699
- .error-panel p {
700
- color: var(--smrt-color-error);
603
+ .smrt-image-uploader__camera-error p {
701
604
  margin-bottom: 1rem;
702
605
  }
703
-
704
606
  /* Migrated "try again" Button keeps its surface-tinted look over the
705
- secondary variant. :global() pierces into the Button child (see #1589). */
706
- .error-panel :global(.try-again-btn) {
707
- background: var(--smrt-color-surface-container-high);
708
- color: white;
709
- border: var(--smrt-hairline);
607
+ secondary variant. :global() pierces into the Button child (see #1589). */
608
+ .smrt-image-uploader__camera-error :global(.smrt-image-uploader__retry-button) {
710
609
  padding: 0.5rem 1rem;
711
- border-radius: var(--smrt-radius-sm);
712
610
  }
713
-
714
611
  /* External Tab */
715
- .external-area {
612
+ .smrt-image-uploader__external {
716
613
  flex: 1;
717
614
  display: flex;
718
615
  flex-direction: column;
719
616
  padding: 3rem 2rem;
720
617
  align-items: center;
721
618
  }
722
-
723
- .hint {
724
- color: var(--smrt-color-outline);
619
+ .smrt-image-uploader__hint {
725
620
  margin-bottom: 2rem;
726
- text-align: center;
727
621
  }
728
-
729
- .input-group {
622
+ .smrt-image-uploader__input-group {
730
623
  display: flex;
731
624
  width: 100%;
732
625
  max-width: 500px;
733
626
  gap: 0.5rem;
734
627
  }
735
-
736
628
  /* Layout-only override: let the migrated URL Input flex-grow to fill the row
737
- beside the Add button. The Input primitive owns the visual styling; this
738
- :global() rule only pierces its rendered <input> (see #1589 scoping rule). */
739
- .input-group :global(.external-url-input) {
629
+ beside the Add button. The Input primitive owns the visual styling; this
630
+ :global() rule only pierces its rendered <input> (see #1589 scoping rule). */
631
+ .smrt-image-uploader__input-group :global(.smrt-image-uploader__url-input) {
740
632
  flex: 1;
741
633
  }
742
-
743
634
  /* Migrated Add Button sits in the URL input group; keeps square-ish radius
744
- and zero vertical padding. :global() pierces into the Button child
745
- (see #1589 scoping rule). */
746
- .input-group :global(.submit-btn--inline) {
635
+ and zero vertical padding. :global() pierces into the Button child
636
+ (see #1589 scoping rule). */
637
+ .smrt-image-uploader__input-group :global(.smrt-image-uploader__submit-button) {
747
638
  padding: 0 1.5rem;
748
- border-radius: var(--smrt-radius-md);
749
- font-weight: var(--smrt-typography-weight-medium, 500);
750
- }
751
-
752
- .input-group :global(.submit-btn--inline:disabled) {
753
- background: var(--smrt-color-surface-container-highest);
754
- color: var(--smrt-color-outline);
755
639
  }
756
-
757
640
  /* --- Back Button --- */
758
641
  /* Migrated ghost Button keeps the icon+label inline layout and tinted hover.
759
- :global() pierces into the Button child (see #1589 scoping rule). */
760
- .header :global(.back-btn--link) {
642
+ :global() pierces into the Button child (see #1589 scoping rule). */
643
+ .smrt-image-uploader__header :global(.smrt-image-uploader__back) {
761
644
  display: flex;
762
645
  align-items: center;
763
646
  gap: 0.35rem;
764
- color: var(--smrt-color-primary);
765
- font-weight: var(--smrt-typography-weight-medium, 500);
766
647
  padding: 0.25rem 0.5rem;
767
- border-radius: var(--smrt-radius-sm);
768
- transition: background 0.15s;
769
648
  }
770
-
771
- .header :global(.back-btn--link:hover) {
772
- background: color-mix(in srgb, var(--smrt-color-primary) 8%, transparent);
773
- }
774
-
775
- .confirm-panel {
649
+ .smrt-image-uploader__confirm {
776
650
  flex: 1;
777
651
  display: flex;
778
652
  flex-direction: column;
779
- overflow: hidden; /* Prevent body scroll, let preview wrapper handle it */
653
+ overflow: hidden;
780
654
  }
781
-
782
- .confirm-preview-wrapper {
655
+ .smrt-image-uploader__preview {
783
656
  flex: 1;
784
657
  min-height: 0;
785
658
  padding: 1.5rem 1.5rem 0;
@@ -787,133 +660,307 @@ onDestroy(() => {
787
660
  justify-content: center;
788
661
  align-items: center;
789
662
  }
790
-
791
- .confirm-preview-img {
663
+ .smrt-image-uploader__preview-image {
792
664
  width: 100%;
793
665
  height: 100%;
794
666
  min-height: 200px;
795
667
  max-width: 100%;
796
668
  max-height: 400px;
797
669
  object-fit: contain;
798
- border-radius: var(--smrt-radius-md);
799
- border: var(--smrt-hairline);
800
- background-color: var(--smrt-color-surface-container-high);
801
670
  }
802
-
803
- .confirm-info {
671
+ .smrt-image-uploader__details {
804
672
  padding: 1rem 1.5rem 0.5rem;
805
673
  display: flex;
806
674
  flex-direction: column;
807
675
  gap: 0.25rem;
808
676
  }
677
+ .smrt-image-uploader__confirm-actions {
678
+ padding: 1rem 1.5rem 1.5rem;
679
+ display: flex;
680
+ gap: 0.75rem;
681
+ flex-wrap: wrap;
682
+ margin-top: 0.5rem;
683
+ }
684
+ /* Migrated confirm-action Buttons keep their pill / chip looks. :global()
685
+ pierces into each Button's rendered <button> (see #1589 scoping rule). */
686
+ .smrt-image-uploader__confirm-actions :global(.smrt-image-uploader__primary-button) {
687
+ padding: 0.65rem 1.5rem;
688
+ }
689
+ .smrt-image-uploader__confirm-actions :global(.smrt-image-uploader__variation-button) {
690
+ display: flex;
691
+ align-items: center;
692
+ gap: 0.4rem;
693
+ padding: 0.65rem 1.25rem;
694
+ }
695
+ /* --- Variation Form --- */
696
+ .smrt-image-uploader__variation {
697
+ display: flex;
698
+ flex-direction: column;
699
+ gap: 0.75rem;
700
+ padding: 1.25rem;
701
+ margin: 0 1.5rem 1.5rem;
702
+ }
703
+ .smrt-image-uploader__variation-hint {
704
+ margin: 0;
705
+ }
706
+ .smrt-image-uploader__variation-error {
707
+ padding: 0.5rem 0.75rem;
708
+ }
709
+ /* Migrated generate Button keeps its left-aligned pill look and inline
710
+ spinner. :global() pierces into the Button child (see #1589 scoping rule). */
711
+ .smrt-image-uploader__variation :global(.smrt-image-uploader__generate-button) {
712
+ align-self: flex-start;
713
+ padding: 0.65rem 1.5rem;
714
+ }
715
+ .smrt-image-uploader__spinner {
716
+ display: inline-block;
717
+ width: 14px;
718
+ height: 14px;
719
+ }
720
+ }
809
721
 
810
- .confirm-name {
722
+ @layer smrt.theme {
723
+ .smrt-image-uploader__root {
724
+ background: var(--smrt-color-surface-container);
725
+ color: var(--smrt-color-on-surface);
726
+ border-radius: var(--smrt-radius-lg);
727
+ border: var(--smrt-hairline);
728
+ }
729
+ .smrt-image-uploader__header {
730
+ border-bottom: var(--smrt-hairline);
731
+ }
732
+ .smrt-image-uploader__header h3 {
733
+ font-size: var(--smrt-typography-title-medium-size, 1.15rem);
734
+ }
735
+ /* Migrated close Button keeps its muted ghost look; only the × glyph sizing
736
+ is custom. :global() pierces into the Button child's rendered <button>
737
+ (see #1589 scoping rule). */
738
+ .smrt-image-uploader__header :global(.smrt-image-uploader__close) {
739
+ color: var(--smrt-color-outline);
740
+ font-size: var(--smrt-typography-headline-small-size, 1.5rem);
741
+ line-height: 1;
742
+ }
743
+ .smrt-image-uploader__header :global(.smrt-image-uploader__close:hover) {
744
+ color: var(--smrt-color-on-surface);
745
+ }
746
+ .smrt-image-uploader__tabs {
747
+ background: var(--smrt-color-surface-container-high);
748
+ border-bottom: var(--smrt-hairline);
749
+ }
750
+ /* The tab strip is migrated to ghost Buttons; the active state is the bottom
751
+ underline rather than a filled variant. :global() pierces into each
752
+ Button's rendered <button> (see #1589 scoping rule). */
753
+ .smrt-image-uploader__tabs :global(.smrt-image-uploader__tab) {
754
+ border: none;
755
+ border-bottom: 2px solid var(--smrt-color-outline-variant);
756
+ color: var(--smrt-color-outline);
757
+ font-weight: var(--smrt-typography-weight-medium, 500);
758
+ border-radius: 0;
759
+ transition: all 0.2s;
760
+ text-transform: uppercase;
761
+ font-size: var(--smrt-typography-label-large-size, 0.85rem);
762
+ letter-spacing: var(--smrt-typography-label-large-tracking);
763
+ }
764
+ .smrt-image-uploader__tabs :global(.smrt-image-uploader__tab:hover) {
765
+ color: var(--smrt-color-on-surface-variant);
766
+ background: color-mix(in srgb, var(--smrt-color-on-surface) 2%, transparent);
767
+ }
768
+ .smrt-image-uploader__tabs :global(.smrt-image-uploader__tab-active) {
769
+ color: var(--smrt-color-primary);
770
+ border-bottom: 2px solid var(--smrt-color-primary);
771
+ background: transparent;
772
+ }
773
+ /* Gallery Tab */
774
+ .smrt-image-uploader__gallery {
775
+ /* Gallery internal scroll handles the rest */
776
+ }
777
+ /* Upload Tab */
778
+ .smrt-image-uploader__dropzone {
779
+ border: 2px dashed var(--smrt-color-outline-variant);
780
+ border-radius: var(--smrt-radius-lg);
781
+ background: var(--smrt-color-surface-container-high);
782
+ transition: all 0.2s;
783
+ }
784
+ .smrt-image-uploader__dropzone:hover, .smrt-image-uploader__dropzone:focus {
785
+ border-color: var(--smrt-hairline-strong-color);
786
+ background: var(--smrt-color-surface-container-highest);
787
+ outline: none;
788
+ }
789
+ .smrt-image-uploader__dropzone.smrt-image-uploader__dragging {
790
+ border-color: var(--smrt-color-primary);
791
+ background: color-mix(in srgb, var(--smrt-color-primary) 5%, transparent);
792
+ /* Drag-over emphasis: decorative scale, no layout effect. */
793
+ transform: scale(1.02);
794
+ }
795
+ .smrt-image-uploader__upload-icon {
796
+ color: var(--smrt-color-primary);
797
+ }
798
+ .smrt-image-uploader__dropzone p {
799
+ font-size: var(--smrt-typography-body-large-size, 1.1rem);
800
+ }
801
+ .smrt-image-uploader__divider {
802
+ font-size: var(--smrt-typography-label-large-size, 0.85rem);
803
+ color: var(--smrt-color-outline);
804
+ }
805
+ /* Decorative label inside the click-catching upload area; the parent handles
806
+ clicks, so this migrated Button stays inert. :global() pierces into the
807
+ Button child's rendered <button> (see #1589 scoping rule). */
808
+ .smrt-image-uploader__dropzone :global(.smrt-image-uploader__browse-button) {
809
+ border-radius: var(--smrt-radius-full);
810
+ font-weight: var(--smrt-typography-weight-medium, 500);
811
+ }
812
+ .smrt-image-uploader__error {
813
+ color: var(--smrt-color-error);
814
+ font-size: var(--smrt-typography-body-medium-size, 0.9rem);
815
+ }
816
+ /* Camera Tab */
817
+ .smrt-image-uploader__camera {
818
+ background: var(--smrt-color-surface-dim);
819
+ }
820
+ .smrt-image-uploader__video {
821
+ background: var(--smrt-color-surface-container-lowest);
822
+ border-radius: var(--smrt-radius-md);
823
+ }
824
+ .smrt-image-uploader__loading {
825
+ background: var(--smrt-color-scrim, rgba(0, 0, 0, 0.7));
826
+ color: white;
827
+ }
828
+ /* Large primary capture action; keeps its oversized pill sizing over the
829
+ primary variant. :global() pierces into the Button child (see #1589). */
830
+ .smrt-image-uploader__camera :global(.smrt-image-uploader__capture-button) {
831
+ border-radius: var(--smrt-radius-full);
832
+ font-size: var(--smrt-typography-body-large-size, 1.1rem);
833
+ font-weight: var(--smrt-typography-weight-semibold, 600);
834
+ }
835
+ .smrt-image-uploader__camera :global(.smrt-image-uploader__capture-button:disabled) {
836
+ background: var(--smrt-color-outline-variant);
837
+ color: var(--smrt-color-outline);
838
+ }
839
+ .smrt-image-uploader__camera-error {
840
+ text-align: center;
841
+ background: var(--smrt-color-surface-container);
842
+ border-radius: var(--smrt-radius-md);
843
+ }
844
+ .smrt-image-uploader__camera-error p {
845
+ color: var(--smrt-color-error);
846
+ }
847
+ /* Migrated "try again" Button keeps its surface-tinted look over the
848
+ secondary variant. :global() pierces into the Button child (see #1589). */
849
+ .smrt-image-uploader__camera-error :global(.smrt-image-uploader__retry-button) {
850
+ background: var(--smrt-color-surface-container-high);
851
+ color: white;
852
+ border: var(--smrt-hairline);
853
+ border-radius: var(--smrt-radius-sm);
854
+ }
855
+ .smrt-image-uploader__hint {
856
+ color: var(--smrt-color-outline);
857
+ text-align: center;
858
+ }
859
+ /* Migrated Add Button sits in the URL input group; keeps square-ish radius
860
+ and zero vertical padding. :global() pierces into the Button child
861
+ (see #1589 scoping rule). */
862
+ .smrt-image-uploader__input-group :global(.smrt-image-uploader__submit-button) {
863
+ border-radius: var(--smrt-radius-md);
864
+ font-weight: var(--smrt-typography-weight-medium, 500);
865
+ }
866
+ .smrt-image-uploader__input-group :global(.smrt-image-uploader__submit-button:disabled) {
867
+ background: var(--smrt-color-surface-container-highest);
868
+ color: var(--smrt-color-outline);
869
+ }
870
+ /* --- Back Button --- */
871
+ /* Migrated ghost Button keeps the icon+label inline layout and tinted hover.
872
+ :global() pierces into the Button child (see #1589 scoping rule). */
873
+ .smrt-image-uploader__header :global(.smrt-image-uploader__back) {
874
+ color: var(--smrt-color-primary);
875
+ font-weight: var(--smrt-typography-weight-medium, 500);
876
+ border-radius: var(--smrt-radius-sm);
877
+ transition: background 0.15s;
878
+ }
879
+ .smrt-image-uploader__header :global(.smrt-image-uploader__back:hover) {
880
+ background: color-mix(in srgb, var(--smrt-color-primary) 8%, transparent);
881
+ }
882
+ .smrt-image-uploader__confirm {
883
+ /* Prevent body scroll, let preview wrapper handle it */
884
+ }
885
+ .smrt-image-uploader__preview-image {
886
+ border-radius: var(--smrt-radius-md);
887
+ border: var(--smrt-hairline);
888
+ background-color: var(--smrt-color-surface-container-high);
889
+ }
890
+ .smrt-image-uploader__name {
811
891
  font-weight: var(--smrt-typography-weight-medium, 500);
812
892
  font-size: var(--smrt-typography-title-medium-size, 1.05rem);
813
893
  }
814
-
815
- .confirm-meta {
894
+ .smrt-image-uploader__meta {
816
895
  font-size: var(--smrt-typography-label-large-size, 0.85rem);
817
896
  color: var(--smrt-color-outline);
818
897
  }
819
-
820
- .confirm-actions {
821
- padding: 1rem 1.5rem 1.5rem;
822
- display: flex;
823
- gap: 0.75rem;
824
- flex-wrap: wrap;
898
+ .smrt-image-uploader__confirm-actions {
825
899
  border-top: var(--smrt-hairline);
826
- margin-top: 0.5rem;
827
900
  }
828
-
829
901
  /* Migrated confirm-action Buttons keep their pill / chip looks. :global()
830
- pierces into each Button's rendered <button> (see #1589 scoping rule). */
831
- .confirm-actions :global(.primary-btn--pill) {
832
- padding: 0.65rem 1.5rem;
902
+ pierces into each Button's rendered <button> (see #1589 scoping rule). */
903
+ .smrt-image-uploader__confirm-actions :global(.smrt-image-uploader__primary-button) {
833
904
  border-radius: var(--smrt-radius-full);
834
905
  font-weight: var(--smrt-typography-weight-medium, 500);
835
906
  transition: filter 0.15s;
836
907
  }
837
-
838
- .confirm-actions :global(.primary-btn--pill:hover) {
908
+ .smrt-image-uploader__confirm-actions :global(.smrt-image-uploader__primary-button:hover) {
839
909
  filter: brightness(1.1);
840
910
  }
841
-
842
- .confirm-actions :global(.variation-toggle--chip) {
843
- display: flex;
844
- align-items: center;
845
- gap: 0.4rem;
911
+ .smrt-image-uploader__confirm-actions :global(.smrt-image-uploader__variation-button) {
846
912
  background: var(--smrt-color-surface-container-highest);
847
913
  color: var(--smrt-color-on-surface-variant);
848
914
  border: var(--smrt-hairline);
849
- padding: 0.65rem 1.25rem;
850
915
  border-radius: var(--smrt-radius-full);
851
916
  font-weight: var(--smrt-typography-weight-medium, 500);
852
917
  transition: all 0.2s;
853
918
  }
854
-
855
- .confirm-actions :global(.variation-toggle--chip:hover) {
919
+ .smrt-image-uploader__confirm-actions :global(.smrt-image-uploader__variation-button:hover) {
856
920
  background: var(--smrt-color-surface-container-high);
857
921
  }
858
-
859
- .confirm-actions :global(.variation-toggle--active) {
922
+ .smrt-image-uploader__confirm-actions :global(.smrt-image-uploader__variation-active) {
860
923
  color: var(--smrt-color-primary);
861
924
  border-color: var(--smrt-color-primary);
862
925
  background: color-mix(in srgb, var(--smrt-color-primary) 8%, transparent);
863
926
  }
864
-
865
927
  /* --- Variation Form --- */
866
- .variation-form {
867
- display: flex;
868
- flex-direction: column;
869
- gap: 0.75rem;
870
- padding: 1.25rem;
871
- margin: 0 1.5rem 1.5rem;
928
+ .smrt-image-uploader__variation {
872
929
  background: var(--smrt-color-surface-container-high);
873
930
  border-radius: var(--smrt-radius-md);
874
931
  border: var(--smrt-hairline);
875
932
  }
876
-
877
- .variation-hint {
933
+ .smrt-image-uploader__variation-hint {
878
934
  font-size: var(--smrt-typography-body-medium-size, 0.85rem);
879
935
  color: var(--smrt-color-outline);
880
- margin: 0;
881
936
  }
882
-
883
- .variation-error {
937
+ .smrt-image-uploader__variation-error {
884
938
  color: var(--smrt-color-error);
885
939
  background: color-mix(in srgb, var(--smrt-color-error) 10%, transparent);
886
- padding: 0.5rem 0.75rem;
887
940
  border-radius: var(--smrt-radius-sm);
888
941
  font-size: var(--smrt-typography-body-medium-size, 0.85rem);
889
942
  }
890
-
891
943
  /* Migrated generate Button keeps its left-aligned pill look and inline
892
- spinner. :global() pierces into the Button child (see #1589 scoping rule). */
893
- .variation-form :global(.generate-btn--pill) {
894
- align-self: flex-start;
895
- padding: 0.65rem 1.5rem;
944
+ spinner. :global() pierces into the Button child (see #1589 scoping rule). */
945
+ .smrt-image-uploader__variation :global(.smrt-image-uploader__generate-button) {
896
946
  border-radius: var(--smrt-radius-full);
897
947
  font-weight: var(--smrt-typography-weight-medium, 500);
898
948
  transition: filter 0.15s, opacity 0.15s;
899
949
  }
900
-
901
- .variation-form :global(.generate-btn--pill:hover:not(:disabled)) {
950
+ .smrt-image-uploader__variation :global(.smrt-image-uploader__generate-button:hover:not(:disabled)) {
902
951
  filter: brightness(1.1);
903
952
  }
904
-
905
953
  @keyframes spin {
906
- to { transform: rotate(360deg); }
954
+ to {
955
+ transform: rotate(360deg);
956
+ }
907
957
  }
908
-
909
- .spinner {
910
- display: inline-block;
911
- width: 14px;
912
- height: 14px;
958
+ .smrt-image-uploader__spinner {
913
959
  border: 2px solid color-mix(in srgb, var(--smrt-color-on-primary) 30%, transparent);
914
960
  border-top-color: white;
915
961
  border-radius: var(--smrt-radius-full);
916
962
  animation: spin 0.6s linear infinite;
917
963
  }
918
964
  }
965
+
919
966
  </style>