@celestia-island/hikari 0.55.273 → 0.55.274
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/package.json
CHANGED
|
@@ -65,6 +65,10 @@ button.hk-persistent-toast {
|
|
|
65
65
|
color: rgb(var(--color-muted));
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
+
.hk-persistent-toast--success .hk-persistent-toast__icon {
|
|
69
|
+
color: rgb(var(--color-success));
|
|
70
|
+
}
|
|
71
|
+
|
|
68
72
|
.hk-persistent-toast__label {
|
|
69
73
|
overflow: hidden;
|
|
70
74
|
text-overflow: ellipsis;
|
|
@@ -111,6 +111,15 @@ describe("HkPersistentToast inert default", () => {
|
|
|
111
111
|
expect(container.querySelector(".hk-persistent-toast__spinner")).not.toBeNull();
|
|
112
112
|
});
|
|
113
113
|
|
|
114
|
+
it("renders a static icon for the success tone", () => {
|
|
115
|
+
const { container } = mount({ props: { tone: "success", label: "Saved" } });
|
|
116
|
+
const c = chip(container);
|
|
117
|
+
expect(c.classList.contains("hk-persistent-toast--success")).toBe(true);
|
|
118
|
+
// Success renders a static lucide icon like the other non-loading tones.
|
|
119
|
+
expect(container.querySelector(".hk-persistent-toast__spinner")).toBeNull();
|
|
120
|
+
expect(c.querySelector("svg")).not.toBeNull();
|
|
121
|
+
});
|
|
122
|
+
|
|
114
123
|
it("renders the ✕ sibling button only when dismissible", () => {
|
|
115
124
|
const onDismiss = vi.fn();
|
|
116
125
|
const { container } = mount({ props: { label: "x", dismissible: true }, onDismiss });
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AlertTriangle, Info, X } from "lucide-vue-next";
|
|
1
|
+
import { AlertTriangle, Check, Info, X } from "lucide-vue-next";
|
|
2
2
|
import {
|
|
3
3
|
computed,
|
|
4
4
|
defineComponent,
|
|
@@ -15,7 +15,7 @@ import { useI18n } from "../i18n/context";
|
|
|
15
15
|
import "./HkPersistentToast.scss";
|
|
16
16
|
import { ensureOverlayRoot } from "../overlay/overlayRoot";
|
|
17
17
|
|
|
18
|
-
export type PersistentToastTone = "loading" | "info" | "warning" | "error";
|
|
18
|
+
export type PersistentToastTone = "loading" | "info" | "warning" | "error" | "success";
|
|
19
19
|
|
|
20
20
|
/** Viewport gutter the detail card clamps into (mirror of
|
|
21
21
|
* --viewport-gutter's desktop value; the card is chrome-adjacent and
|
|
@@ -251,6 +251,8 @@ export default defineComponent({
|
|
|
251
251
|
<span class="hk-persistent-toast__spinner" aria-hidden="true" />
|
|
252
252
|
) : props.tone === "error" || props.tone === "warning" ? (
|
|
253
253
|
<AlertTriangle size={12} class="hk-persistent-toast__icon" aria-hidden="true" />
|
|
254
|
+
) : props.tone === "success" ? (
|
|
255
|
+
<Check size={12} class="hk-persistent-toast__icon" aria-hidden="true" />
|
|
254
256
|
) : (
|
|
255
257
|
<Info size={12} class="hk-persistent-toast__icon" aria-hidden="true" />
|
|
256
258
|
)}
|