@konomi-app/ui 5.4.1 → 5.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/index.cjs CHANGED
@@ -2574,9 +2574,6 @@ var toastStyles = import_lit3.css`
2574
2574
  --toast-spinner-track: rgb(59 130 246 / 0.2);
2575
2575
  --toast-spinner-arc: var(--toast-loading);
2576
2576
 
2577
- /* Progress bar */
2578
- --toast-progress-height: 3px;
2579
-
2580
2577
  /* Close button */
2581
2578
  --toast-close-color: #9ca3af;
2582
2579
  --toast-close-hover-color: #374151;
@@ -2907,9 +2904,75 @@ var toastStyles = import_lit3.css`
2907
2904
  color: var(--dialog-primary-hover, #2563eb);
2908
2905
  }
2909
2906
 
2907
+ /* ─── Close Wrap + Timer Ring ─── */
2908
+
2909
+ .toast-close-wrap {
2910
+ position: relative;
2911
+ width: 24px;
2912
+ height: 24px;
2913
+ flex-shrink: 0;
2914
+ display: flex;
2915
+ align-items: center;
2916
+ justify-content: center;
2917
+ }
2918
+
2919
+ .toast-timer-ring {
2920
+ position: absolute;
2921
+ inset: 0;
2922
+ width: 24px;
2923
+ height: 24px;
2924
+ transform: rotate(-90deg);
2925
+ pointer-events: none;
2926
+ }
2927
+
2928
+ .toast-timer-track {
2929
+ fill: none;
2930
+ stroke: rgb(0 0 0 / 0.08);
2931
+ stroke-width: 2;
2932
+ }
2933
+
2934
+ .toast-timer-fill {
2935
+ fill: none;
2936
+ stroke-width: 2;
2937
+ stroke-linecap: round;
2938
+ /* 周長 = 2π × 10 ≈ 62.83 */
2939
+ stroke-dasharray: 62.83;
2940
+ stroke-dashoffset: 62.83;
2941
+ animation: toast-ring-fill linear forwards;
2942
+ animation-play-state: running;
2943
+ }
2944
+
2945
+ @keyframes toast-ring-fill {
2946
+ from {
2947
+ stroke-dashoffset: 62.83;
2948
+ }
2949
+ to {
2950
+ stroke-dashoffset: 0;
2951
+ }
2952
+ }
2953
+
2954
+ .toast-card[data-type='success'] .toast-timer-fill {
2955
+ stroke: var(--toast-success);
2956
+ }
2957
+ .toast-card[data-type='error'] .toast-timer-fill {
2958
+ stroke: var(--toast-error);
2959
+ }
2960
+ .toast-card[data-type='warning'] .toast-timer-fill {
2961
+ stroke: var(--toast-warning);
2962
+ }
2963
+ .toast-card[data-type='info'] .toast-timer-fill {
2964
+ stroke: var(--toast-info);
2965
+ }
2966
+
2967
+ .toast-card[data-paused] .toast-timer-fill {
2968
+ animation-play-state: paused;
2969
+ }
2970
+
2910
2971
  /* ─── Close Button ─── */
2911
2972
 
2912
2973
  .toast-close {
2974
+ position: relative;
2975
+ z-index: 1;
2913
2976
  width: 20px;
2914
2977
  height: 20px;
2915
2978
  padding: 0;
@@ -2917,18 +2980,17 @@ var toastStyles = import_lit3.css`
2917
2980
  border: none;
2918
2981
  background: none;
2919
2982
  cursor: pointer;
2920
- flex-shrink: 0;
2921
2983
  display: flex;
2922
2984
  align-items: center;
2923
2985
  justify-content: center;
2924
2986
  color: var(--toast-close-color);
2925
2987
  transition: color 150ms ease;
2926
- border-radius: 4px;
2988
+ border-radius: 50%;
2927
2989
  }
2928
2990
 
2929
2991
  .toast-close svg {
2930
- width: 14px;
2931
- height: 14px;
2992
+ width: 12px;
2993
+ height: 12px;
2932
2994
  }
2933
2995
 
2934
2996
  .toast-close:hover {
@@ -2936,55 +2998,14 @@ var toastStyles = import_lit3.css`
2936
2998
  }
2937
2999
 
2938
3000
  @media (min-width: 640px) {
2939
- .toast-close {
3001
+ .toast-close-wrap {
2940
3002
  opacity: 0.5;
2941
- transition:
2942
- opacity 150ms ease,
2943
- color 150ms ease;
3003
+ transition: opacity 150ms ease;
2944
3004
  }
2945
- .toast-card:hover .toast-close {
3005
+ .toast-card:hover .toast-close-wrap {
2946
3006
  opacity: 1;
2947
3007
  }
2948
3008
  }
2949
-
2950
- /* ─── Progress Bar ─── */
2951
-
2952
- .toast-progress {
2953
- position: absolute;
2954
- bottom: 0;
2955
- left: 0;
2956
- height: var(--toast-progress-height);
2957
- width: 100%;
2958
- border-radius: 0 0 var(--toast-card-radius) var(--toast-card-radius);
2959
- animation: toast-progress-countdown linear forwards;
2960
- animation-play-state: running;
2961
- }
2962
-
2963
- .toast-card[data-paused] .toast-progress {
2964
- animation-play-state: paused;
2965
- }
2966
-
2967
- @keyframes toast-progress-countdown {
2968
- from {
2969
- width: 100%;
2970
- }
2971
- to {
2972
- width: 0%;
2973
- }
2974
- }
2975
-
2976
- .toast-progress[data-type='success'] {
2977
- background-color: var(--toast-success);
2978
- }
2979
- .toast-progress[data-type='error'] {
2980
- background-color: var(--toast-error);
2981
- }
2982
- .toast-progress[data-type='warning'] {
2983
- background-color: var(--toast-warning);
2984
- }
2985
- .toast-progress[data-type='info'] {
2986
- background-color: var(--toast-info);
2987
- }
2988
3009
  `;
2989
3010
 
2990
3011
  // src/toast/toast-container.ts
@@ -3099,29 +3120,40 @@ var ToastContainer = class extends import_lit4.LitElement {
3099
3120
  ${item.action.label}
3100
3121
  </button>` : import_lit4.nothing}
3101
3122
  </div>
3102
- <button
3103
- class="toast-close"
3104
- @click=${() => this.controller.dismiss(item.id)}
3105
- aria-label="閉じる"
3106
- >
3107
- <svg
3108
- viewBox="0 0 24 24"
3109
- fill="none"
3110
- stroke="currentColor"
3111
- stroke-width="2"
3112
- stroke-linecap="round"
3113
- stroke-linejoin="round"
3123
+ <div class="toast-close-wrap">
3124
+ ${item.duration > 0 && item.type !== "loading" ? import_lit4.html`<svg
3125
+ class="toast-timer-ring"
3126
+ viewBox="0 0 24 24"
3127
+ aria-hidden="true"
3128
+ >
3129
+ <circle class="toast-timer-track" cx="12" cy="12" r="10" />
3130
+ <circle
3131
+ class="toast-timer-fill"
3132
+ cx="12"
3133
+ cy="12"
3134
+ r="10"
3135
+ style="animation-duration:${item.duration}ms"
3136
+ />
3137
+ </svg>` : import_lit4.nothing}
3138
+ <button
3139
+ class="toast-close"
3140
+ @click=${() => this.controller.dismiss(item.id)}
3141
+ aria-label="閉じる"
3114
3142
  >
3115
- <line x1="18" y1="6" x2="6" y2="18" />
3116
- <line x1="6" y1="6" x2="18" y2="18" />
3117
- </svg>
3118
- </button>
3143
+ <svg
3144
+ viewBox="0 0 24 24"
3145
+ fill="none"
3146
+ stroke="currentColor"
3147
+ stroke-width="2"
3148
+ stroke-linecap="round"
3149
+ stroke-linejoin="round"
3150
+ >
3151
+ <line x1="18" y1="6" x2="6" y2="18" />
3152
+ <line x1="6" y1="6" x2="18" y2="18" />
3153
+ </svg>
3154
+ </button>
3155
+ </div>
3119
3156
  </div>
3120
- ${item.duration > 0 && item.type !== "loading" ? import_lit4.html`<div
3121
- class="toast-progress"
3122
- style="animation-duration:${item.duration}ms"
3123
- data-type=${item.type}
3124
- ></div>` : import_lit4.nothing}
3125
3157
  </div>
3126
3158
  </div>
3127
3159
  `;