@konomi-app/ui 5.4.0 → 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 +105 -73
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +105 -73
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2296,7 +2296,7 @@ var dialog = new DialogSingleton();
|
|
|
2296
2296
|
// src/toast/types.ts
|
|
2297
2297
|
var createInitialToastState = () => ({
|
|
2298
2298
|
items: [],
|
|
2299
|
-
position: "
|
|
2299
|
+
position: "bottom-right",
|
|
2300
2300
|
maxVisible: 3,
|
|
2301
2301
|
defaultDuration: 4e3
|
|
2302
2302
|
});
|
|
@@ -2546,9 +2546,6 @@ var toastStyles = css2`
|
|
|
2546
2546
|
--toast-spinner-track: rgb(59 130 246 / 0.2);
|
|
2547
2547
|
--toast-spinner-arc: var(--toast-loading);
|
|
2548
2548
|
|
|
2549
|
-
/* Progress bar */
|
|
2550
|
-
--toast-progress-height: 3px;
|
|
2551
|
-
|
|
2552
2549
|
/* Close button */
|
|
2553
2550
|
--toast-close-color: #9ca3af;
|
|
2554
2551
|
--toast-close-hover-color: #374151;
|
|
@@ -2879,9 +2876,75 @@ var toastStyles = css2`
|
|
|
2879
2876
|
color: var(--dialog-primary-hover, #2563eb);
|
|
2880
2877
|
}
|
|
2881
2878
|
|
|
2879
|
+
/* ─── Close Wrap + Timer Ring ─── */
|
|
2880
|
+
|
|
2881
|
+
.toast-close-wrap {
|
|
2882
|
+
position: relative;
|
|
2883
|
+
width: 24px;
|
|
2884
|
+
height: 24px;
|
|
2885
|
+
flex-shrink: 0;
|
|
2886
|
+
display: flex;
|
|
2887
|
+
align-items: center;
|
|
2888
|
+
justify-content: center;
|
|
2889
|
+
}
|
|
2890
|
+
|
|
2891
|
+
.toast-timer-ring {
|
|
2892
|
+
position: absolute;
|
|
2893
|
+
inset: 0;
|
|
2894
|
+
width: 24px;
|
|
2895
|
+
height: 24px;
|
|
2896
|
+
transform: rotate(-90deg);
|
|
2897
|
+
pointer-events: none;
|
|
2898
|
+
}
|
|
2899
|
+
|
|
2900
|
+
.toast-timer-track {
|
|
2901
|
+
fill: none;
|
|
2902
|
+
stroke: rgb(0 0 0 / 0.08);
|
|
2903
|
+
stroke-width: 2;
|
|
2904
|
+
}
|
|
2905
|
+
|
|
2906
|
+
.toast-timer-fill {
|
|
2907
|
+
fill: none;
|
|
2908
|
+
stroke-width: 2;
|
|
2909
|
+
stroke-linecap: round;
|
|
2910
|
+
/* 周長 = 2π × 10 ≈ 62.83 */
|
|
2911
|
+
stroke-dasharray: 62.83;
|
|
2912
|
+
stroke-dashoffset: 62.83;
|
|
2913
|
+
animation: toast-ring-fill linear forwards;
|
|
2914
|
+
animation-play-state: running;
|
|
2915
|
+
}
|
|
2916
|
+
|
|
2917
|
+
@keyframes toast-ring-fill {
|
|
2918
|
+
from {
|
|
2919
|
+
stroke-dashoffset: 62.83;
|
|
2920
|
+
}
|
|
2921
|
+
to {
|
|
2922
|
+
stroke-dashoffset: 0;
|
|
2923
|
+
}
|
|
2924
|
+
}
|
|
2925
|
+
|
|
2926
|
+
.toast-card[data-type='success'] .toast-timer-fill {
|
|
2927
|
+
stroke: var(--toast-success);
|
|
2928
|
+
}
|
|
2929
|
+
.toast-card[data-type='error'] .toast-timer-fill {
|
|
2930
|
+
stroke: var(--toast-error);
|
|
2931
|
+
}
|
|
2932
|
+
.toast-card[data-type='warning'] .toast-timer-fill {
|
|
2933
|
+
stroke: var(--toast-warning);
|
|
2934
|
+
}
|
|
2935
|
+
.toast-card[data-type='info'] .toast-timer-fill {
|
|
2936
|
+
stroke: var(--toast-info);
|
|
2937
|
+
}
|
|
2938
|
+
|
|
2939
|
+
.toast-card[data-paused] .toast-timer-fill {
|
|
2940
|
+
animation-play-state: paused;
|
|
2941
|
+
}
|
|
2942
|
+
|
|
2882
2943
|
/* ─── Close Button ─── */
|
|
2883
2944
|
|
|
2884
2945
|
.toast-close {
|
|
2946
|
+
position: relative;
|
|
2947
|
+
z-index: 1;
|
|
2885
2948
|
width: 20px;
|
|
2886
2949
|
height: 20px;
|
|
2887
2950
|
padding: 0;
|
|
@@ -2889,18 +2952,17 @@ var toastStyles = css2`
|
|
|
2889
2952
|
border: none;
|
|
2890
2953
|
background: none;
|
|
2891
2954
|
cursor: pointer;
|
|
2892
|
-
flex-shrink: 0;
|
|
2893
2955
|
display: flex;
|
|
2894
2956
|
align-items: center;
|
|
2895
2957
|
justify-content: center;
|
|
2896
2958
|
color: var(--toast-close-color);
|
|
2897
2959
|
transition: color 150ms ease;
|
|
2898
|
-
border-radius:
|
|
2960
|
+
border-radius: 50%;
|
|
2899
2961
|
}
|
|
2900
2962
|
|
|
2901
2963
|
.toast-close svg {
|
|
2902
|
-
width:
|
|
2903
|
-
height:
|
|
2964
|
+
width: 12px;
|
|
2965
|
+
height: 12px;
|
|
2904
2966
|
}
|
|
2905
2967
|
|
|
2906
2968
|
.toast-close:hover {
|
|
@@ -2908,55 +2970,14 @@ var toastStyles = css2`
|
|
|
2908
2970
|
}
|
|
2909
2971
|
|
|
2910
2972
|
@media (min-width: 640px) {
|
|
2911
|
-
.toast-close {
|
|
2973
|
+
.toast-close-wrap {
|
|
2912
2974
|
opacity: 0.5;
|
|
2913
|
-
transition:
|
|
2914
|
-
opacity 150ms ease,
|
|
2915
|
-
color 150ms ease;
|
|
2975
|
+
transition: opacity 150ms ease;
|
|
2916
2976
|
}
|
|
2917
|
-
.toast-card:hover .toast-close {
|
|
2977
|
+
.toast-card:hover .toast-close-wrap {
|
|
2918
2978
|
opacity: 1;
|
|
2919
2979
|
}
|
|
2920
2980
|
}
|
|
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
2981
|
`;
|
|
2961
2982
|
|
|
2962
2983
|
// src/toast/toast-container.ts
|
|
@@ -3071,29 +3092,40 @@ var ToastContainer = class extends LitElement2 {
|
|
|
3071
3092
|
${item.action.label}
|
|
3072
3093
|
</button>` : nothing2}
|
|
3073
3094
|
</div>
|
|
3074
|
-
<
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3095
|
+
<div class="toast-close-wrap">
|
|
3096
|
+
${item.duration > 0 && item.type !== "loading" ? html2`<svg
|
|
3097
|
+
class="toast-timer-ring"
|
|
3098
|
+
viewBox="0 0 24 24"
|
|
3099
|
+
aria-hidden="true"
|
|
3100
|
+
>
|
|
3101
|
+
<circle class="toast-timer-track" cx="12" cy="12" r="10" />
|
|
3102
|
+
<circle
|
|
3103
|
+
class="toast-timer-fill"
|
|
3104
|
+
cx="12"
|
|
3105
|
+
cy="12"
|
|
3106
|
+
r="10"
|
|
3107
|
+
style="animation-duration:${item.duration}ms"
|
|
3108
|
+
/>
|
|
3109
|
+
</svg>` : nothing2}
|
|
3110
|
+
<button
|
|
3111
|
+
class="toast-close"
|
|
3112
|
+
@click=${() => this.controller.dismiss(item.id)}
|
|
3113
|
+
aria-label="閉じる"
|
|
3086
3114
|
>
|
|
3087
|
-
<
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3115
|
+
<svg
|
|
3116
|
+
viewBox="0 0 24 24"
|
|
3117
|
+
fill="none"
|
|
3118
|
+
stroke="currentColor"
|
|
3119
|
+
stroke-width="2"
|
|
3120
|
+
stroke-linecap="round"
|
|
3121
|
+
stroke-linejoin="round"
|
|
3122
|
+
>
|
|
3123
|
+
<line x1="18" y1="6" x2="6" y2="18" />
|
|
3124
|
+
<line x1="6" y1="6" x2="18" y2="18" />
|
|
3125
|
+
</svg>
|
|
3126
|
+
</button>
|
|
3127
|
+
</div>
|
|
3091
3128
|
</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
3129
|
</div>
|
|
3098
3130
|
</div>
|
|
3099
3131
|
`;
|