@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.js CHANGED
@@ -2528,13 +2528,14 @@ var toastStyles = css2`
2528
2528
  /* Container */
2529
2529
  --toast-gap: 12px;
2530
2530
  --toast-padding: 16px;
2531
+ --toast-min-width: 360px;
2531
2532
  --toast-max-width: 420px;
2532
2533
 
2533
2534
  /* Card */
2534
2535
  --toast-card-bg: #fff;
2535
2536
  --toast-card-border: #f3f4f6;
2536
2537
  --toast-card-shadow: 0 4px 12px rgb(0 0 0 / 0.08), 0 1px 3px rgb(0 0 0 / 0.06);
2537
- --toast-card-radius: 8px;
2538
+ --toast-card-radius: 4px;
2538
2539
  --toast-card-padding: 14px 16px;
2539
2540
 
2540
2541
  /* Colors (inherit from dialog when available) */
@@ -2546,9 +2547,6 @@ var toastStyles = css2`
2546
2547
  --toast-spinner-track: rgb(59 130 246 / 0.2);
2547
2548
  --toast-spinner-arc: var(--toast-loading);
2548
2549
 
2549
- /* Progress bar */
2550
- --toast-progress-height: 3px;
2551
-
2552
2550
  /* Close button */
2553
2551
  --toast-close-color: #9ca3af;
2554
2552
  --toast-close-hover-color: #374151;
@@ -2574,6 +2572,7 @@ var toastStyles = css2`
2574
2572
  padding: var(--toast-padding);
2575
2573
  pointer-events: none;
2576
2574
  max-height: 100vh;
2575
+ min-width: var(--toast-min-width);
2577
2576
  max-width: var(--toast-max-width);
2578
2577
  box-sizing: border-box;
2579
2578
  }
@@ -2613,6 +2612,7 @@ var toastStyles = css2`
2613
2612
  @media (max-width: 639px) {
2614
2613
  .container {
2615
2614
  max-width: 100%;
2615
+ min-width: 0;
2616
2616
  width: 100%;
2617
2617
  left: 0;
2618
2618
  right: 0;
@@ -2705,21 +2705,29 @@ var toastStyles = css2`
2705
2705
  pointer-events: none;
2706
2706
  }
2707
2707
 
2708
- /* Type-based left accent */
2709
- .toast-card[data-type='success'] {
2710
- border-left: 3px solid var(--toast-success);
2708
+ /* Type-based top stripe */
2709
+ .toast-card::before {
2710
+ content: '';
2711
+ position: absolute;
2712
+ bottom: 0;
2713
+ left: 0;
2714
+ right: 0;
2715
+ height: 2px;
2716
+ }
2717
+ .toast-card[data-type='success']::before {
2718
+ background: var(--toast-success);
2711
2719
  }
2712
- .toast-card[data-type='error'] {
2713
- border-left: 3px solid var(--toast-error);
2720
+ .toast-card[data-type='error']::before {
2721
+ background: var(--toast-error);
2714
2722
  }
2715
- .toast-card[data-type='warning'] {
2716
- border-left: 3px solid var(--toast-warning);
2723
+ .toast-card[data-type='warning']::before {
2724
+ background: var(--toast-warning);
2717
2725
  }
2718
- .toast-card[data-type='info'] {
2719
- border-left: 3px solid var(--toast-info);
2726
+ .toast-card[data-type='info']::before {
2727
+ background: var(--toast-info);
2720
2728
  }
2721
- .toast-card[data-type='loading'] {
2722
- border-left: 3px solid var(--toast-loading);
2729
+ .toast-card[data-type='loading']::before {
2730
+ background: var(--toast-loading);
2723
2731
  }
2724
2732
 
2725
2733
  /* ─── Animations ─── */
@@ -2879,9 +2887,75 @@ var toastStyles = css2`
2879
2887
  color: var(--dialog-primary-hover, #2563eb);
2880
2888
  }
2881
2889
 
2890
+ /* ─── Close Wrap + Timer Ring ─── */
2891
+
2892
+ .toast-close-wrap {
2893
+ position: relative;
2894
+ width: 24px;
2895
+ height: 24px;
2896
+ flex-shrink: 0;
2897
+ display: flex;
2898
+ align-items: center;
2899
+ justify-content: center;
2900
+ }
2901
+
2902
+ .toast-timer-ring {
2903
+ position: absolute;
2904
+ inset: 0;
2905
+ width: 24px;
2906
+ height: 24px;
2907
+ transform: rotate(-90deg);
2908
+ pointer-events: none;
2909
+ }
2910
+
2911
+ .toast-timer-track {
2912
+ fill: none;
2913
+ stroke: rgb(0 0 0 / 0.08);
2914
+ stroke-width: 2;
2915
+ }
2916
+
2917
+ .toast-timer-fill {
2918
+ fill: none;
2919
+ stroke-width: 2;
2920
+ stroke-linecap: round;
2921
+ /* 周長 = 2π × 10 ≈ 62.83 */
2922
+ stroke-dasharray: 62.83;
2923
+ stroke-dashoffset: 62.83;
2924
+ animation: toast-ring-fill linear forwards;
2925
+ animation-play-state: running;
2926
+ }
2927
+
2928
+ @keyframes toast-ring-fill {
2929
+ from {
2930
+ stroke-dashoffset: 62.83;
2931
+ }
2932
+ to {
2933
+ stroke-dashoffset: 0;
2934
+ }
2935
+ }
2936
+
2937
+ .toast-card[data-type='success'] .toast-timer-fill {
2938
+ stroke: var(--toast-success);
2939
+ }
2940
+ .toast-card[data-type='error'] .toast-timer-fill {
2941
+ stroke: var(--toast-error);
2942
+ }
2943
+ .toast-card[data-type='warning'] .toast-timer-fill {
2944
+ stroke: var(--toast-warning);
2945
+ }
2946
+ .toast-card[data-type='info'] .toast-timer-fill {
2947
+ stroke: var(--toast-info);
2948
+ }
2949
+
2950
+ .toast-card[data-paused] .toast-timer-fill {
2951
+ animation-play-state: paused;
2952
+ }
2953
+
2882
2954
  /* ─── Close Button ─── */
2883
2955
 
2884
2956
  .toast-close {
2957
+ position: relative;
2958
+ z-index: 1;
2885
2959
  width: 20px;
2886
2960
  height: 20px;
2887
2961
  padding: 0;
@@ -2889,18 +2963,17 @@ var toastStyles = css2`
2889
2963
  border: none;
2890
2964
  background: none;
2891
2965
  cursor: pointer;
2892
- flex-shrink: 0;
2893
2966
  display: flex;
2894
2967
  align-items: center;
2895
2968
  justify-content: center;
2896
2969
  color: var(--toast-close-color);
2897
2970
  transition: color 150ms ease;
2898
- border-radius: 4px;
2971
+ border-radius: 50%;
2899
2972
  }
2900
2973
 
2901
2974
  .toast-close svg {
2902
- width: 14px;
2903
- height: 14px;
2975
+ width: 12px;
2976
+ height: 12px;
2904
2977
  }
2905
2978
 
2906
2979
  .toast-close:hover {
@@ -2908,55 +2981,14 @@ var toastStyles = css2`
2908
2981
  }
2909
2982
 
2910
2983
  @media (min-width: 640px) {
2911
- .toast-close {
2984
+ .toast-close-wrap {
2912
2985
  opacity: 0.5;
2913
- transition:
2914
- opacity 150ms ease,
2915
- color 150ms ease;
2986
+ transition: opacity 150ms ease;
2916
2987
  }
2917
- .toast-card:hover .toast-close {
2988
+ .toast-card:hover .toast-close-wrap {
2918
2989
  opacity: 1;
2919
2990
  }
2920
2991
  }
2921
-
2922
- /* ─── Progress Bar ─── */
2923
-
2924
- .toast-progress {
2925
- position: absolute;
2926
- bottom: 0;
2927
- left: 0;
2928
- height: var(--toast-progress-height);
2929
- width: 100%;
2930
- border-radius: 0 0 var(--toast-card-radius) var(--toast-card-radius);
2931
- animation: toast-progress-countdown linear forwards;
2932
- animation-play-state: running;
2933
- }
2934
-
2935
- .toast-card[data-paused] .toast-progress {
2936
- animation-play-state: paused;
2937
- }
2938
-
2939
- @keyframes toast-progress-countdown {
2940
- from {
2941
- width: 100%;
2942
- }
2943
- to {
2944
- width: 0%;
2945
- }
2946
- }
2947
-
2948
- .toast-progress[data-type='success'] {
2949
- background-color: var(--toast-success);
2950
- }
2951
- .toast-progress[data-type='error'] {
2952
- background-color: var(--toast-error);
2953
- }
2954
- .toast-progress[data-type='warning'] {
2955
- background-color: var(--toast-warning);
2956
- }
2957
- .toast-progress[data-type='info'] {
2958
- background-color: var(--toast-info);
2959
- }
2960
2992
  `;
2961
2993
 
2962
2994
  // src/toast/toast-container.ts
@@ -3071,29 +3103,40 @@ var ToastContainer = class extends LitElement2 {
3071
3103
  ${item.action.label}
3072
3104
  </button>` : nothing2}
3073
3105
  </div>
3074
- <button
3075
- class="toast-close"
3076
- @click=${() => this.controller.dismiss(item.id)}
3077
- aria-label="閉じる"
3078
- >
3079
- <svg
3080
- viewBox="0 0 24 24"
3081
- fill="none"
3082
- stroke="currentColor"
3083
- stroke-width="2"
3084
- stroke-linecap="round"
3085
- stroke-linejoin="round"
3106
+ <div class="toast-close-wrap">
3107
+ ${item.duration > 0 && item.type !== "loading" ? html2`<svg
3108
+ class="toast-timer-ring"
3109
+ viewBox="0 0 24 24"
3110
+ aria-hidden="true"
3111
+ >
3112
+ <circle class="toast-timer-track" cx="12" cy="12" r="10" />
3113
+ <circle
3114
+ class="toast-timer-fill"
3115
+ cx="12"
3116
+ cy="12"
3117
+ r="10"
3118
+ style="animation-duration:${item.duration}ms"
3119
+ />
3120
+ </svg>` : nothing2}
3121
+ <button
3122
+ class="toast-close"
3123
+ @click=${() => this.controller.dismiss(item.id)}
3124
+ aria-label="閉じる"
3086
3125
  >
3087
- <line x1="18" y1="6" x2="6" y2="18" />
3088
- <line x1="6" y1="6" x2="18" y2="18" />
3089
- </svg>
3090
- </button>
3126
+ <svg
3127
+ viewBox="0 0 24 24"
3128
+ fill="none"
3129
+ stroke="currentColor"
3130
+ stroke-width="2"
3131
+ stroke-linecap="round"
3132
+ stroke-linejoin="round"
3133
+ >
3134
+ <line x1="18" y1="6" x2="6" y2="18" />
3135
+ <line x1="6" y1="6" x2="18" y2="18" />
3136
+ </svg>
3137
+ </button>
3138
+ </div>
3091
3139
  </div>
3092
- ${item.duration > 0 && item.type !== "loading" ? html2`<div
3093
- class="toast-progress"
3094
- style="animation-duration:${item.duration}ms"
3095
- data-type=${item.type}
3096
- ></div>` : nothing2}
3097
3140
  </div>
3098
3141
  </div>
3099
3142
  `;