@widgetic/design-system 0.5.8 → 0.5.10
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.
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
/** Optional secondary line; pass empty string to hide */
|
|
13
13
|
export let subtitle = 'Preview will appear when done.';
|
|
14
14
|
export let size: 'sm' | 'md' | 'lg' = 'md';
|
|
15
|
-
/** Absolute overlay with
|
|
15
|
+
/** Absolute overlay with opaque backdrop so idle placeholders cannot show through */
|
|
16
16
|
export let overlay = false;
|
|
17
17
|
|
|
18
18
|
const hourglassSizeClass: Record<typeof size, string> = {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
|
|
31
31
|
<div
|
|
32
32
|
class="wc-generate-loader {overlay
|
|
33
|
-
? 'wc-generate-loader-overlay absolute inset-0 z-30 flex flex-col items-center justify-center bg-white
|
|
33
|
+
? 'wc-generate-loader-overlay absolute inset-0 z-30 flex flex-col items-center justify-center bg-white pointer-events-none'
|
|
34
34
|
: 'wc-generate-loader-inline flex flex-col items-center justify-center text-center'} {className}"
|
|
35
35
|
style={style}
|
|
36
36
|
role="status"
|
|
@@ -6,7 +6,7 @@ declare const __propDef: {
|
|
|
6
6
|
/** Primary status line */ title?: string;
|
|
7
7
|
/** Optional secondary line; pass empty string to hide */ subtitle?: string;
|
|
8
8
|
size?: "sm" | "md" | "lg";
|
|
9
|
-
/** Absolute overlay with
|
|
9
|
+
/** Absolute overlay with opaque backdrop so idle placeholders cannot show through */ overlay?: boolean;
|
|
10
10
|
};
|
|
11
11
|
events: {
|
|
12
12
|
[evt: string]: CustomEvent<any>;
|
|
@@ -68,10 +68,23 @@
|
|
|
68
68
|
};
|
|
69
69
|
});
|
|
70
70
|
|
|
71
|
+
function isTypingShortcutTarget(event: KeyboardEvent): boolean {
|
|
72
|
+
const target = event.target as HTMLElement | null;
|
|
73
|
+
if (!target) return false;
|
|
74
|
+
const tag = target.tagName;
|
|
75
|
+
return tag === 'INPUT' || tag === 'TEXTAREA' || tag === 'SELECT' || target.isContentEditable;
|
|
76
|
+
}
|
|
77
|
+
|
|
71
78
|
function handleKeydown(event: KeyboardEvent) {
|
|
72
|
-
//
|
|
79
|
+
// Ctrl/Cmd+Shift+G — Shift+G alone types capital G in text fields
|
|
73
80
|
if (process.env.NODE_ENV !== 'production') {
|
|
74
|
-
if (
|
|
81
|
+
if (
|
|
82
|
+
event.shiftKey
|
|
83
|
+
&& (event.metaKey || event.ctrlKey)
|
|
84
|
+
&& event.key.toLowerCase() === 'g'
|
|
85
|
+
&& !isTypingShortcutTarget(event)
|
|
86
|
+
) {
|
|
87
|
+
event.preventDefault();
|
|
75
88
|
shouldShow = !shouldShow;
|
|
76
89
|
}
|
|
77
90
|
}
|
|
@@ -125,10 +125,21 @@ export function showToast(type: string = 'success', title: string, options: any
|
|
|
125
125
|
// Close Button Styling
|
|
126
126
|
closeButton: toastMainClass + '-close-button !w-[16px] !h-[16px] !absolute !top-[-4px] !left-[-4px] z-10 ' +
|
|
127
127
|
'!flex !items-center !justify-center ' +
|
|
128
|
-
'!bg-[hsl(var(--grey7))] !border !border-[hsl(var(--grey5))] !rounded-full !text-white'
|
|
128
|
+
'!bg-[hsl(var(--grey7))] !border !border-[hsl(var(--grey5))] !rounded-full !text-white ' +
|
|
129
|
+
'[&_svg]:!text-white [&_svg]:!fill-white [&_svg]:!stroke-white'
|
|
129
130
|
}
|
|
130
131
|
}}
|
|
131
132
|
expand={false}
|
|
132
133
|
visibleToasts={1}
|
|
133
134
|
offset="1rem"
|
|
134
|
-
/>
|
|
135
|
+
/>
|
|
136
|
+
|
|
137
|
+
<style>
|
|
138
|
+
/* svelte-sonner close SVG ignores button `color` / Tailwind text-white. */
|
|
139
|
+
:global(.toast-modal-close-button svg),
|
|
140
|
+
:global(.toast-modal-close-button path) {
|
|
141
|
+
color: #ffffff !important;
|
|
142
|
+
fill: #ffffff !important;
|
|
143
|
+
stroke: #ffffff !important;
|
|
144
|
+
}
|
|
145
|
+
</style>
|