@wral/profile-image-editor 0.0.8 → 0.0.10

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/index.mjs CHANGED
@@ -520,6 +520,17 @@ const Un = wn`
520
520
  display: flex;
521
521
  flex-direction: column;
522
522
  gap: 1rem;
523
+
524
+ --color-primary: #001D68;
525
+ --color-secondary: #2594E3;
526
+ --wral-border: #E7E5E4;
527
+ --wral-card-background: #FFFFFF;
528
+ --wral-background: #F5F5F5;
529
+ --wral-gray-medium: #6C6C6C;
530
+ --wral-font-roboto: 'Roboto', sans-serif;
531
+ --wral-font-condensed: 'IBM Plex Sans Condensed', sans-serif;
532
+
533
+ font-family: var(--wral-font-roboto);
523
534
  }
524
535
 
525
536
  .layout {
@@ -533,11 +544,14 @@ const Un = wn`
533
544
  position: relative;
534
545
  width: var(--cropper-size, 128px);
535
546
  height: var(--cropper-size, 128px);
536
- border: 1px solid #ccc;
537
- background: #f7f7f7;
538
547
  overflow: hidden;
539
548
  user-select: none;
540
549
  touch-action: none;
550
+
551
+ border: 1px solid var(--wral-border, #E7E5E4);
552
+ border-radius: 8px;
553
+ background: var(--wral-card-background, #FFFFFF);
554
+ box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
541
555
  }
542
556
 
543
557
  #image-cropper,
@@ -570,29 +584,30 @@ const Un = wn`
570
584
  }
571
585
 
572
586
  #image-cropper > .jcrop-area {
573
- position: absolute;
574
- border: 2px dashed #2b7cff;
575
- cursor: move;
576
- pointer-events: auto;
577
- aspect-ratio: 1;
578
- }
587
+ position: absolute;
588
+ z-index: 10;
579
589
 
580
- #image-cropper > .jcrop-area {
581
- z-index: 10;
590
+ border: 2px dashed var(--color-secondary, #2594E3);
591
+ border-radius: 8px;
592
+
593
+ cursor: move;
594
+ pointer-events: auto;
595
+
596
+ aspect-ratio: 1;
582
597
  }
583
598
 
584
599
  #image-cropper > .jcrop-area::before,
585
600
  #image-cropper > .jcrop-area::after {
586
- content: "";
587
- position: absolute;
588
- width: 10px;
589
- height: 10px;
590
- background: #2b7cff;
601
+ content: "";
602
+ position: absolute;
603
+ width: 10px;
604
+ height: 10px;
605
+ background: var(--color-secondary, #2594E3);
591
606
  }
592
607
 
593
608
  #image-cropper > .jcrop-area::before {
594
- top: -5px;
595
- left: -5px;
609
+ top: -5px;
610
+ left: -5px;
596
611
  }
597
612
 
598
613
  #image-cropper > .jcrop-area::after {
@@ -604,26 +619,52 @@ const Un = wn`
604
619
  #image-cropper [class*='mask' i],
605
620
  #image-cropper [class*='overlay' i] {
606
621
  pointer-events: none;
607
- background: rgba(0, 0, 0, 0.15);
622
+ background: rgba(0, 0, 0, 0.35);
608
623
  }
609
624
 
610
625
  #image-cropper .handle,
611
626
  #image-cropper [class*='handle' i] {
612
627
  pointer-events: auto;
613
- }
614
-
615
- #image-cropper .handle,
616
- #image-cropper [class*='handle' i] {
617
628
  width: 10px;
618
629
  height: 10px;
619
- background: #2b7cff;
630
+ background: var(--color-secondary, #2594E3);
620
631
  border-radius: 2px;
621
632
  }
622
633
 
623
- #image-cropper .nw, #image-cropper [class*='nw' i] { cursor: nwse-resize; }
624
- #image-cropper .ne, #image-cropper [class*='ne' i] { cursor: nesw-resize; }
625
- #image-cropper .sw, #image-cropper [class*='sw' i] { cursor: nesw-resize; }
626
- #image-cropper .se, #image-cropper [class*='se' i] { cursor: nwse-resize; }
634
+ #image-cropper .nw,
635
+ #image-cropper [class*='nw' i] {
636
+ cursor: nwse-resize;
637
+ }
638
+ #image-cropper .ne,
639
+ #image-cropper [class*='ne' i] {
640
+ cursor: nesw-resize;
641
+ }
642
+ #image-cropper .sw,
643
+ #image-cropper [class*='sw' i] {
644
+ cursor: nesw-resize;
645
+ }
646
+ #image-cropper .se,
647
+ #image-cropper [class*='se' i] {
648
+ cursor: nwse-resize;
649
+ }
650
+
651
+ .jcrop {
652
+ border-radius: 8px;
653
+ }
654
+
655
+ .jcrop-area {
656
+ position: relative;
657
+ }
658
+
659
+ .jcrop-area .circle-guide {
660
+ position: absolute;
661
+ inset: 0;
662
+ border-radius: 50%;
663
+ pointer-events: none;
664
+
665
+ outline: 2px solid rgba(255, 255, 255, 0.9);
666
+ box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.35);
667
+ }
627
668
 
628
669
  .preview {
629
670
  display: flex;
@@ -644,7 +685,6 @@ const Un = wn`
644
685
  .controls {
645
686
  display: flex;
646
687
  flex-wrap: wrap;
647
- justify-content: center;
648
688
  gap: 12px;
649
689
  align-items: center;
650
690
  justify-content: space-between;
@@ -663,33 +703,25 @@ const Un = wn`
663
703
  input[type="range"] {
664
704
  -webkit-appearance: none;
665
705
  appearance: none;
666
-
667
- background: transparent;
706
+ background: transparent;
668
707
  margin: 0;
669
708
  }
670
709
 
671
710
  .zoom[type="range"]::-moz-range-track,
672
711
  .zoom[type="range"]::-webkit-slider-runnable-track {
673
- height: 15px;
674
- background: #ccc;
675
- border-radius: 16px;
676
- }
677
-
678
- .zoom[type="range"]::-webkit-slider-runnable-track {
679
- background-color: #ccc;
712
+ height: 15px;
713
+ background: var(--wral-border, #D9D9D9);
680
714
  border-radius: 16px;
681
715
  }
682
716
 
683
717
  input[type="range"]::-webkit-slider-thumb {
684
718
  -webkit-appearance: none;
685
-
686
719
  width: 32px;
687
720
  height: 32px;
688
721
  background: #ffffff;
689
722
  border-radius: 50%;
690
723
  border: none;
691
-
692
- box-shadow: 0 6px 12px rgba(0,0,0,0.25);
724
+ box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
693
725
  margin-top: -12px;
694
726
  cursor: pointer;
695
727
  }
@@ -700,11 +732,14 @@ const Un = wn`
700
732
  background: #ffffff;
701
733
  border-radius: 50%;
702
734
  border: none;
703
-
704
- box-shadow: 0 6px 12px rgba(0,0,0,0.25);
735
+ box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
705
736
  cursor: pointer;
706
737
  }
707
738
 
739
+ .zoom:focus-visible {
740
+ outline: 3px solid rgba(37, 148, 227, 0.45);
741
+ outline-offset: 2px;
742
+ }
708
743
 
709
744
  button {
710
745
  display: inline-flex;
@@ -716,56 +751,65 @@ const Un = wn`
716
751
  padding: 10px 14px;
717
752
 
718
753
  border-radius: var(--radius-sm, 5px);
719
- border: 1.5px solid var(--color-primary, #001D68);
720
- background: var(--color-primary, #FFF);
754
+ border: 1px solid var(--color-primary, #001D68);
755
+ background: transparent;
756
+ color: var(--color-primary, #001D68);
757
+
721
758
  cursor: pointer;
722
- color: var(--color-white, #001D68);
723
759
  text-align: center;
724
760
 
725
- font-size: 14px;
761
+ font-size: 0.85rem;
726
762
  font-weight: 600;
727
763
  line-height: 16px;
728
- }
729
764
 
730
- button:hover {
731
- background: var(--color-secondary, #001D68);
732
- color: var(--color-white, #FFF);
733
- }
734
-
735
- button[disabled] {
736
- background: #ccc;
737
- cursor: not-allowed;
765
+ transition:
766
+ transform 0.2s ease,
767
+ box-shadow 0.2s ease,
768
+ background 0.2s ease,
769
+ color 0.2s ease,
770
+ opacity 0.2s ease;
738
771
  }
739
772
 
740
- .primary {
741
- display: flex;
742
- height: 40px;
743
- padding: 12px;
744
- justify-content: center;
745
- align-items: center;
746
- background: #2b7cff;
773
+ button.primary:hover:not([disabled]) {
774
+ background: var(--color-primary, #001D68);
747
775
  color: #fff;
748
- border-color: #2b7cff;
776
+ box-shadow: 0 6px 14px rgba(0, 29, 104, 0.2);
777
+ transform: translateY(-1px);
749
778
  }
750
779
 
751
- .jcrop {
752
- border-radius: 8px;
780
+ button:hover:not([disabled]) {
781
+ color: var(--color-secondary, #2594E3);
782
+ border-color: var(--color-secondary, #2594E3);
783
+ box-shadow: 0 6px 14px rgba(0, 29, 104, 0.2);
784
+ transform: translateY(-1px);
753
785
  }
754
786
 
755
- .jcrop-area {
756
- position: relative;
787
+ button:focus-visible {
788
+ outline: 3px solid rgba(37, 148, 227, 0.45);
789
+ outline-offset: 2px;
757
790
  }
758
791
 
759
- .jcrop-area .circle-guide {
760
- position: absolute;
761
- inset: 0;
762
- border-radius: 50%;
792
+ /* Disabled: 50% fade, no hover/click reaction */
793
+ button[disabled],
794
+ button:disabled {
795
+ opacity: 0.5;
796
+ cursor: not-allowed;
763
797
  pointer-events: none;
798
+ box-shadow: none;
799
+ transform: none;
800
+ }
764
801
 
765
- outline: 2px solid rgba(255, 255, 255, 0.9);
802
+ button.primary,
803
+ .primary {
804
+ background: var(--color-primary, #001D68);
805
+ border-color: var(--color-primary, #001D68);
806
+ color: #fff;
807
+ }
766
808
 
767
- box-shadow:
768
- 0 0 0 9999px rgba(0, 0, 0, 0.35);
809
+ button.primary:hover:not([disabled]),
810
+ .primary:hover:not([disabled]) {
811
+ background: var(--color-secondary, #2594E3);
812
+ box-shadow: 0 6px 14px rgba(0, 29, 104, 0.2);
769
813
  }
770
814
 
771
815
  .placeholder {
@@ -790,8 +834,6 @@ const Un = wn`
790
834
  aspect-ratio: 1/1;
791
835
  }
792
836
 
793
-
794
-
795
837
  .nav {
796
838
  display: flex;
797
839
  flex-wrap: wrap;
@@ -824,6 +866,12 @@ const Un = wn`
824
866
  gap: 12px;
825
867
  }
826
868
 
869
+ .confirmation {
870
+ display: flex;
871
+ gap: 0.5rem;
872
+ padding: 1rem;
873
+ }
874
+
827
875
  @media (max-width: 640px) {
828
876
  .layout {
829
877
  flex-direction: column;
@@ -846,7 +894,6 @@ const Un = wn`
846
894
  width: 100%;
847
895
  }
848
896
 
849
- /* Make action buttons full-width for easy tapping */
850
897
  .nav button,
851
898
  .confirmation button {
852
899
  width: 100%;
@@ -863,23 +910,22 @@ const Un = wn`
863
910
  .nav-spacer {
864
911
  display: none;
865
912
  }
866
-
913
+
867
914
  .zoom[type="range"]::-moz-range-track,
868
915
  .zoom[type="range"]::-webkit-slider-runnable-track {
869
- height: 30px;
870
- border-radius: 32px;
916
+ height: 30px;
917
+ border-radius: 32px;
871
918
  }
872
919
 
873
920
  input[type="range"]::-webkit-slider-thumb {
874
921
  width: 48px;
875
922
  height: 48px;
876
- margin-top: -4px; /* centers thumb over 8px track */
923
+ margin-top: -4px;
877
924
  }
878
925
 
879
926
  input[type="range"]::-moz-range-thumb {
880
927
  width: 48px;
881
928
  height: 48px;
882
- cursor: pointer;
883
929
  }
884
930
  }
885
931
  `, Vn = ut`
@@ -15509,13 +15555,13 @@ class Mi extends Ct {
15509
15555
  ${this.allowRotate ? ut`
15510
15556
  <div class="rotate-controls">
15511
15557
  <button
15512
- class="rotate"
15558
+ class="rotate secondary"
15513
15559
  ?disabled=${this.busy || !this._lastFile}
15514
15560
  @click=${() => this._rotate(90)}>
15515
15561
  ${Vn} Rotate
15516
15562
  </button>
15517
15563
  <button
15518
- class="rotate"
15564
+ class="rotate secondary"
15519
15565
  ?disabled=${this.busy || !this._lastFile}
15520
15566
  @click=${() => this._rotate(-90)}>
15521
15567
  Rotate ${Bn}
@@ -15559,7 +15605,7 @@ class Mi extends Ct {
15559
15605
  <div class="nav-spacer"></div>
15560
15606
 
15561
15607
  <button
15562
- class="primary cancel"
15608
+ class="secondary cancel"
15563
15609
  @click=${this._closeEditor}
15564
15610
  > Cancel </button>
15565
15611
  <button
@@ -15582,7 +15628,9 @@ class Mi extends Ct {
15582
15628
  renderPlaceholder() {
15583
15629
  return ut`
15584
15630
  <div class="placeholder"
15585
- @click=${this._openFilePicker}
15631
+ @click=${(N) => {
15632
+ N.preventDefault(), N.stopImmediatePropagation(), this._openFilePicker();
15633
+ }}
15586
15634
  >
15587
15635
  <img src="${Di}"></img>
15588
15636
  <div>Click to browse or drag and drop</div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wral/profile-image-editor",
3
- "version": "0.0.8",
3
+ "version": "0.0.10",
4
4
  "type": "module",
5
5
  "description": "Lit web component for showing and editing a user's profile picture.",
6
6
  "author": "Noah Rojahn <nrojahn@wral.com>",