@konomi-app/ui 5.4.1 → 5.6.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
@@ -2556,13 +2556,14 @@ var toastStyles = import_lit3.css`
2556
2556
  /* Container */
2557
2557
  --toast-gap: 12px;
2558
2558
  --toast-padding: 16px;
2559
+ --toast-min-width: 360px;
2559
2560
  --toast-max-width: 420px;
2560
2561
 
2561
2562
  /* Card */
2562
2563
  --toast-card-bg: #fff;
2563
2564
  --toast-card-border: #f3f4f6;
2564
2565
  --toast-card-shadow: 0 4px 12px rgb(0 0 0 / 0.08), 0 1px 3px rgb(0 0 0 / 0.06);
2565
- --toast-card-radius: 8px;
2566
+ --toast-card-radius: 4px;
2566
2567
  --toast-card-padding: 14px 16px;
2567
2568
 
2568
2569
  /* Colors (inherit from dialog when available) */
@@ -2574,9 +2575,6 @@ var toastStyles = import_lit3.css`
2574
2575
  --toast-spinner-track: rgb(59 130 246 / 0.2);
2575
2576
  --toast-spinner-arc: var(--toast-loading);
2576
2577
 
2577
- /* Progress bar */
2578
- --toast-progress-height: 3px;
2579
-
2580
2578
  /* Close button */
2581
2579
  --toast-close-color: #9ca3af;
2582
2580
  --toast-close-hover-color: #374151;
@@ -2602,6 +2600,7 @@ var toastStyles = import_lit3.css`
2602
2600
  padding: var(--toast-padding);
2603
2601
  pointer-events: none;
2604
2602
  max-height: 100vh;
2603
+ min-width: var(--toast-min-width);
2605
2604
  max-width: var(--toast-max-width);
2606
2605
  box-sizing: border-box;
2607
2606
  }
@@ -2641,6 +2640,7 @@ var toastStyles = import_lit3.css`
2641
2640
  @media (max-width: 639px) {
2642
2641
  .container {
2643
2642
  max-width: 100%;
2643
+ min-width: 0;
2644
2644
  width: 100%;
2645
2645
  left: 0;
2646
2646
  right: 0;
@@ -2733,21 +2733,29 @@ var toastStyles = import_lit3.css`
2733
2733
  pointer-events: none;
2734
2734
  }
2735
2735
 
2736
- /* Type-based left accent */
2737
- .toast-card[data-type='success'] {
2738
- border-left: 3px solid var(--toast-success);
2736
+ /* Type-based top stripe */
2737
+ .toast-card::before {
2738
+ content: '';
2739
+ position: absolute;
2740
+ bottom: 0;
2741
+ left: 0;
2742
+ right: 0;
2743
+ height: 2px;
2744
+ }
2745
+ .toast-card[data-type='success']::before {
2746
+ background: var(--toast-success);
2739
2747
  }
2740
- .toast-card[data-type='error'] {
2741
- border-left: 3px solid var(--toast-error);
2748
+ .toast-card[data-type='error']::before {
2749
+ background: var(--toast-error);
2742
2750
  }
2743
- .toast-card[data-type='warning'] {
2744
- border-left: 3px solid var(--toast-warning);
2751
+ .toast-card[data-type='warning']::before {
2752
+ background: var(--toast-warning);
2745
2753
  }
2746
- .toast-card[data-type='info'] {
2747
- border-left: 3px solid var(--toast-info);
2754
+ .toast-card[data-type='info']::before {
2755
+ background: var(--toast-info);
2748
2756
  }
2749
- .toast-card[data-type='loading'] {
2750
- border-left: 3px solid var(--toast-loading);
2757
+ .toast-card[data-type='loading']::before {
2758
+ background: var(--toast-loading);
2751
2759
  }
2752
2760
 
2753
2761
  /* ─── Animations ─── */
@@ -2907,9 +2915,75 @@ var toastStyles = import_lit3.css`
2907
2915
  color: var(--dialog-primary-hover, #2563eb);
2908
2916
  }
2909
2917
 
2918
+ /* ─── Close Wrap + Timer Ring ─── */
2919
+
2920
+ .toast-close-wrap {
2921
+ position: relative;
2922
+ width: 24px;
2923
+ height: 24px;
2924
+ flex-shrink: 0;
2925
+ display: flex;
2926
+ align-items: center;
2927
+ justify-content: center;
2928
+ }
2929
+
2930
+ .toast-timer-ring {
2931
+ position: absolute;
2932
+ inset: 0;
2933
+ width: 24px;
2934
+ height: 24px;
2935
+ transform: rotate(-90deg);
2936
+ pointer-events: none;
2937
+ }
2938
+
2939
+ .toast-timer-track {
2940
+ fill: none;
2941
+ stroke: rgb(0 0 0 / 0.08);
2942
+ stroke-width: 2;
2943
+ }
2944
+
2945
+ .toast-timer-fill {
2946
+ fill: none;
2947
+ stroke-width: 2;
2948
+ stroke-linecap: round;
2949
+ /* 周長 = 2π × 10 ≈ 62.83 */
2950
+ stroke-dasharray: 62.83;
2951
+ stroke-dashoffset: 62.83;
2952
+ animation: toast-ring-fill linear forwards;
2953
+ animation-play-state: running;
2954
+ }
2955
+
2956
+ @keyframes toast-ring-fill {
2957
+ from {
2958
+ stroke-dashoffset: 62.83;
2959
+ }
2960
+ to {
2961
+ stroke-dashoffset: 0;
2962
+ }
2963
+ }
2964
+
2965
+ .toast-card[data-type='success'] .toast-timer-fill {
2966
+ stroke: var(--toast-success);
2967
+ }
2968
+ .toast-card[data-type='error'] .toast-timer-fill {
2969
+ stroke: var(--toast-error);
2970
+ }
2971
+ .toast-card[data-type='warning'] .toast-timer-fill {
2972
+ stroke: var(--toast-warning);
2973
+ }
2974
+ .toast-card[data-type='info'] .toast-timer-fill {
2975
+ stroke: var(--toast-info);
2976
+ }
2977
+
2978
+ .toast-card[data-paused] .toast-timer-fill {
2979
+ animation-play-state: paused;
2980
+ }
2981
+
2910
2982
  /* ─── Close Button ─── */
2911
2983
 
2912
2984
  .toast-close {
2985
+ position: relative;
2986
+ z-index: 1;
2913
2987
  width: 20px;
2914
2988
  height: 20px;
2915
2989
  padding: 0;
@@ -2917,18 +2991,17 @@ var toastStyles = import_lit3.css`
2917
2991
  border: none;
2918
2992
  background: none;
2919
2993
  cursor: pointer;
2920
- flex-shrink: 0;
2921
2994
  display: flex;
2922
2995
  align-items: center;
2923
2996
  justify-content: center;
2924
2997
  color: var(--toast-close-color);
2925
2998
  transition: color 150ms ease;
2926
- border-radius: 4px;
2999
+ border-radius: 50%;
2927
3000
  }
2928
3001
 
2929
3002
  .toast-close svg {
2930
- width: 14px;
2931
- height: 14px;
3003
+ width: 12px;
3004
+ height: 12px;
2932
3005
  }
2933
3006
 
2934
3007
  .toast-close:hover {
@@ -2936,55 +3009,14 @@ var toastStyles = import_lit3.css`
2936
3009
  }
2937
3010
 
2938
3011
  @media (min-width: 640px) {
2939
- .toast-close {
3012
+ .toast-close-wrap {
2940
3013
  opacity: 0.5;
2941
- transition:
2942
- opacity 150ms ease,
2943
- color 150ms ease;
3014
+ transition: opacity 150ms ease;
2944
3015
  }
2945
- .toast-card:hover .toast-close {
3016
+ .toast-card:hover .toast-close-wrap {
2946
3017
  opacity: 1;
2947
3018
  }
2948
3019
  }
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
3020
  `;
2989
3021
 
2990
3022
  // src/toast/toast-container.ts
@@ -3099,29 +3131,40 @@ var ToastContainer = class extends import_lit4.LitElement {
3099
3131
  ${item.action.label}
3100
3132
  </button>` : import_lit4.nothing}
3101
3133
  </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"
3134
+ <div class="toast-close-wrap">
3135
+ ${item.duration > 0 && item.type !== "loading" ? import_lit4.html`<svg
3136
+ class="toast-timer-ring"
3137
+ viewBox="0 0 24 24"
3138
+ aria-hidden="true"
3139
+ >
3140
+ <circle class="toast-timer-track" cx="12" cy="12" r="10" />
3141
+ <circle
3142
+ class="toast-timer-fill"
3143
+ cx="12"
3144
+ cy="12"
3145
+ r="10"
3146
+ style="animation-duration:${item.duration}ms"
3147
+ />
3148
+ </svg>` : import_lit4.nothing}
3149
+ <button
3150
+ class="toast-close"
3151
+ @click=${() => this.controller.dismiss(item.id)}
3152
+ aria-label="閉じる"
3114
3153
  >
3115
- <line x1="18" y1="6" x2="6" y2="18" />
3116
- <line x1="6" y1="6" x2="18" y2="18" />
3117
- </svg>
3118
- </button>
3154
+ <svg
3155
+ viewBox="0 0 24 24"
3156
+ fill="none"
3157
+ stroke="currentColor"
3158
+ stroke-width="2"
3159
+ stroke-linecap="round"
3160
+ stroke-linejoin="round"
3161
+ >
3162
+ <line x1="18" y1="6" x2="6" y2="18" />
3163
+ <line x1="6" y1="6" x2="18" y2="18" />
3164
+ </svg>
3165
+ </button>
3166
+ </div>
3119
3167
  </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
3168
  </div>
3126
3169
  </div>
3127
3170
  `;