@linzjs/windows 10.2.0 → 10.3.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.
|
@@ -18,7 +18,7 @@ export type PrefabType = 'outline' | 'success' | 'info' | 'warning' | 'error' |
|
|
|
18
18
|
|
|
19
19
|
export interface LuiModalAsyncPrefabButton<RT> {
|
|
20
20
|
default?: boolean;
|
|
21
|
-
level?: LuiButtonProps['level'];
|
|
21
|
+
level?: LuiButtonProps['level'] | 'secondary-error';
|
|
22
22
|
title: string;
|
|
23
23
|
icon?: IconName;
|
|
24
24
|
value?: RT;
|
|
@@ -149,8 +149,11 @@ export const LuiModalPrefab = (props: PropsWithChildren<LuiModalAsyncPrefabProps
|
|
|
149
149
|
{buttons.map((pf, i) => (
|
|
150
150
|
<LuiButton
|
|
151
151
|
key={i}
|
|
152
|
-
level={pf.level ?? 'secondary'}
|
|
153
|
-
className={clsx(
|
|
152
|
+
level={pf.level === 'secondary-error' ? 'secondary' : (pf.level ?? 'secondary')}
|
|
153
|
+
className={clsx(
|
|
154
|
+
pf.icon && 'lui-button-icon',
|
|
155
|
+
pf.level === 'secondary-error' && 'lui-button-secondary-error',
|
|
156
|
+
)}
|
|
154
157
|
onClick={() => {
|
|
155
158
|
setDontShow();
|
|
156
159
|
resolve(pf.value);
|
|
@@ -189,7 +192,7 @@ export const useLuiModalPrefab = () => {
|
|
|
189
192
|
const { showModal, modalOwnerRef } = useShowAsyncModal();
|
|
190
193
|
|
|
191
194
|
const showPrefabModal = useCallback(
|
|
192
|
-
<RT = string
|
|
195
|
+
<RT = string,>(props: PropsWithChildren<useLuiModalPrefabProps<RT>>): PromiseWithResolve<RT> => {
|
|
193
196
|
debugLog(`Show '${props.level}' prefab-modal '${props.title}'`, props);
|
|
194
197
|
if (typeof props.children === 'string') {
|
|
195
198
|
// Convert \n to <br/>
|