@vokril/ui-solid 0.34.0 → 0.35.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/CHANGELOG.md +15 -0
- package/dist/Alert-DCIet3Ol.cjs +1 -0
- package/dist/Alert-DyBaU25r.js +59 -0
- package/dist/Badge-BXLrs2z-.cjs +1 -0
- package/dist/Badge-BguTObKo.js +99 -0
- package/dist/CommandPalette-3wKYPO9u.cjs +2 -0
- package/dist/CommandPalette-BnZwM7DE.js +4130 -0
- package/dist/PageSkeleton-3f-2SBNK.cjs +30 -0
- package/dist/{PageSkeleton-BRuqaDzr.js → PageSkeleton-lfENszyc.js} +516 -569
- package/dist/{StatusBarNotificationBell-Lps0FfKd.js → StatusBarNotificationBell-GbkAwC4w.js} +30 -29
- package/dist/{StatusBarNotificationBell-pBGZ_2eb.cjs → StatusBarNotificationBell-fegn26_s.cjs} +22 -22
- package/dist/feedback/index.cjs +1 -1
- package/dist/feedback/index.js +38 -36
- package/dist/index.cjs +1 -1
- package/dist/index.js +430 -428
- package/dist/notificationCatalog-DmwTAO09.cjs +1 -0
- package/dist/notificationCatalog-otJ1LHFH.js +72 -0
- package/dist/notifications/index.cjs +1 -1
- package/dist/notifications/index.js +2 -2
- package/dist/overlay/ConfirmDialog.d.cts +36 -0
- package/dist/overlay/ConfirmDialog.d.ts +36 -0
- package/dist/overlay/dialogNudge.d.cts +16 -0
- package/dist/overlay/dialogNudge.d.ts +16 -0
- package/dist/overlay/index.cjs +1 -1
- package/dist/overlay/index.js +1 -1
- package/dist/server/Alert-DWGobTUk.js +45 -0
- package/dist/server/Alert-DulmzLv9.cjs +1 -0
- package/dist/server/Badge-C1Jn--DR.js +68 -0
- package/dist/server/Badge-wsDCVlA8.cjs +1 -0
- package/dist/server/CommandPalette-B3EE1iMo.js +3376 -0
- package/dist/server/CommandPalette-DKURJBBZ.cjs +1 -0
- package/dist/server/PageSkeleton-CP8EmxyS.cjs +30 -0
- package/dist/server/{PageSkeleton-CFs7AdTA.js → PageSkeleton-HhO6CRZ8.js} +392 -431
- package/dist/server/{StatusBarNotificationBell-DiVJ-EnY.js → StatusBarNotificationBell-BfBGKXDG.js} +30 -29
- package/dist/server/{StatusBarNotificationBell-D0UzYPs6.cjs → StatusBarNotificationBell-CB919YAX.cjs} +21 -21
- package/dist/server/feedback/index.cjs +1 -1
- package/dist/server/feedback/index.js +38 -36
- package/dist/server/index.cjs +1 -1
- package/dist/server/index.js +294 -292
- package/dist/server/notificationCatalog-BKcY-o-R.js +57 -0
- package/dist/server/notificationCatalog-DR3ZggWn.cjs +1 -0
- package/dist/server/notifications/index.cjs +1 -1
- package/dist/server/notifications/index.js +2 -2
- package/dist/server/overlay/index.cjs +1 -1
- package/dist/server/overlay/index.js +1 -1
- package/dist/solid/overlay/ConfirmDialog.jsx +54 -10
- package/dist/solid/overlay/ConfirmDialog.module.css.js +6 -0
- package/dist/solid/overlay/DangerousActionDialog.jsx +8 -3
- package/dist/solid/overlay/DangerousActionDialog.module.css.js +1 -0
- package/dist/solid/overlay/dialogNudge.js +18 -0
- package/dist/style.css +1 -1
- package/dist/ui.css +1 -1
- package/package.json +1 -1
- package/dist/CommandPalette-BKa5pT_B.js +0 -4029
- package/dist/CommandPalette-Bq5ydWBA.cjs +0 -2
- package/dist/PageSkeleton-Cz2bckO4.cjs +0 -30
- package/dist/notificationCatalog-CRERhjp6.js +0 -168
- package/dist/notificationCatalog-DqTkd7M6.cjs +0 -1
- package/dist/server/CommandPalette-BU9QCOyy.cjs +0 -1
- package/dist/server/CommandPalette-Dj08M64T.js +0 -3305
- package/dist/server/PageSkeleton-D0KOKLsb.cjs +0 -30
- package/dist/server/notificationCatalog-CEDltsJS.cjs +0 -1
- package/dist/server/notificationCatalog-Cl1dH4aJ.js +0 -122
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { ssr as o, escape as t, ssrAttribute as a, ssrStyle as c } from "solid-js/web";
|
|
2
|
+
const u = "vk_track_8sxq6", l = "vk_size2xs_PFVQU", d = "vk_sizeXs_uv795", v = "vk_sizeSm_PXflS", _ = "vk_sizeMd_D7fn9", f = "vk_fill_WzdHy", m = "vk_toneBrand_Tv6r-", z = "vk_toneSuccess_zqjLa", k = "vk_toneWarning_xuA11", g = "vk_toneDanger_eWHhk", S = "vk_toneNeutral_-Ko2R", x = "vk_indeterminate_94QkD", n = {
|
|
3
|
+
track: u,
|
|
4
|
+
size2xs: l,
|
|
5
|
+
sizeXs: d,
|
|
6
|
+
sizeSm: v,
|
|
7
|
+
sizeMd: _,
|
|
8
|
+
fill: f,
|
|
9
|
+
toneBrand: m,
|
|
10
|
+
toneSuccess: z,
|
|
11
|
+
toneWarning: k,
|
|
12
|
+
toneDanger: g,
|
|
13
|
+
toneNeutral: S,
|
|
14
|
+
indeterminate: x
|
|
15
|
+
};
|
|
16
|
+
var b = ['<div class="', '" role="progressbar"', "><span", ' style="', '"></span></div>'];
|
|
17
|
+
const y = {
|
|
18
|
+
brand: n.toneBrand,
|
|
19
|
+
success: n.toneSuccess,
|
|
20
|
+
warning: n.toneWarning,
|
|
21
|
+
danger: n.toneDanger,
|
|
22
|
+
neutral: n.toneNeutral
|
|
23
|
+
}, M = {
|
|
24
|
+
"2xs": n.size2xs,
|
|
25
|
+
xs: n.sizeXs,
|
|
26
|
+
sm: n.sizeSm,
|
|
27
|
+
md: n.sizeMd
|
|
28
|
+
};
|
|
29
|
+
function $(e) {
|
|
30
|
+
const r = () => {
|
|
31
|
+
if (e.indeterminate) return 0;
|
|
32
|
+
const i = e.max ?? 100;
|
|
33
|
+
return i <= 0 ? 0 : Math.max(0, Math.min(100, e.value / i * 100));
|
|
34
|
+
}, s = () => e.indeterminate === !0;
|
|
35
|
+
return o(b, `${t(n.track, !0)} ${t(M[e.size ?? "md"], !0)} ${t(y[e.tone ?? "brand"], !0)} ${s() ? t(n.indeterminate, !0) : ""} ${t(e.class ?? "", !0)}`, a("aria-valuenow", s() ? t(void 0, !0) : t(Math.round(r()), !0), !1) + a("aria-valuemin", s() ? t(void 0, !0) : 0, !1) + a("aria-valuemax", s() ? t(void 0, !0) : 100, !1) + a("aria-busy", s() ? "true" : t(void 0, !0), !1) + a("aria-label", t(e.ariaLabel, !0), !1), a("class", t(n.fill, !0), !1), c(s() ? void 0 : {
|
|
36
|
+
"--progress-pct": `${r()}%`
|
|
37
|
+
}));
|
|
38
|
+
}
|
|
39
|
+
function D(e, r) {
|
|
40
|
+
return {
|
|
41
|
+
...e,
|
|
42
|
+
category: e.category ?? e.id.split(".")[0] ?? "general",
|
|
43
|
+
build: r
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
function W(e, r, s) {
|
|
47
|
+
return {
|
|
48
|
+
id: e,
|
|
49
|
+
notification: r,
|
|
50
|
+
resolve: (i) => r.build(s, i)
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
export {
|
|
54
|
+
$ as P,
|
|
55
|
+
W as a,
|
|
56
|
+
D as d
|
|
57
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("solid-js/web"),a="vk_track_8sxq6",c="vk_size2xs_PFVQU",o="vk_sizeXs_uv795",u="vk_sizeSm_PXflS",l="vk_sizeMd_D7fn9",d="vk_fill_WzdHy",v="vk_toneBrand_Tv6r-",_="vk_toneSuccess_zqjLa",f="vk_toneWarning_xuA11",m="vk_toneDanger_eWHhk",z="vk_toneNeutral_-Ko2R",k="vk_indeterminate_94QkD",s={track:a,size2xs:c,sizeXs:o,sizeSm:u,sizeMd:l,fill:d,toneBrand:v,toneSuccess:_,toneWarning:f,toneDanger:m,toneNeutral:z,indeterminate:k};var g=['<div class="','" role="progressbar"',"><span",' style="','"></span></div>'];const S={brand:s.toneBrand,success:s.toneSuccess,warning:s.toneWarning,danger:s.toneDanger,neutral:s.toneNeutral},b={"2xs":s.size2xs,xs:s.sizeXs,sm:s.sizeSm,md:s.sizeMd};function x(t){const r=()=>{if(t.indeterminate)return 0;const i=t.max??100;return i<=0?0:Math.max(0,Math.min(100,t.value/i*100))},n=()=>t.indeterminate===!0;return e.ssr(g,`${e.escape(s.track,!0)} ${e.escape(b[t.size??"md"],!0)} ${e.escape(S[t.tone??"brand"],!0)} ${n()?e.escape(s.indeterminate,!0):""} ${e.escape(t.class??"",!0)}`,e.ssrAttribute("aria-valuenow",n()?e.escape(void 0,!0):e.escape(Math.round(r()),!0),!1)+e.ssrAttribute("aria-valuemin",n()?e.escape(void 0,!0):0,!1)+e.ssrAttribute("aria-valuemax",n()?e.escape(void 0,!0):100,!1)+e.ssrAttribute("aria-busy",n()?"true":e.escape(void 0,!0),!1)+e.ssrAttribute("aria-label",e.escape(t.ariaLabel,!0),!1),e.ssrAttribute("class",e.escape(s.fill,!0),!1),e.ssrStyle(n()?void 0:{"--progress-pct":`${r()}%`}))}function A(t,r){return{...t,category:t.category??t.id.split(".")[0]??"general",build:r}}function N(t,r,n){return{id:t,notification:r,resolve:i=>r.build(n,i)}}exports.Progress=x;exports.defineNotification=A;exports.defineNotificationScenario=N;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../StatusBarNotificationBell-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../StatusBarNotificationBell-CB919YAX.cjs"),e=require("../notificationCatalog-DR3ZggWn.cjs"),t=require("../useSettingsSubscription-DKjCwmRd.cjs");exports.ACCEPT_PRIMARY_ACTION_NOTIFICATION=i.ACCEPT_PRIMARY_ACTION_NOTIFICATION;exports.CLEAR_NOTIFICATION=i.CLEAR_NOTIFICATION;exports.HIDE_NOTIFICATION_TOASTS=i.HIDE_NOTIFICATION_TOASTS;exports.LogFilterBar=i.LogFilterBar;exports.NOTIFICATION_SOURCES=i.NOTIFICATION_SOURCES;exports.NOTIFICATION_SOURCE_IDS=i.NOTIFICATION_SOURCE_IDS;exports.NO_NOTIFICATION_OVERLAY=i.NO_NOTIFICATION_OVERLAY;exports.NotificationHost=i.NotificationHost;exports.NotificationItem=i.NotificationItem;exports.NotificationPanel=i.NotificationPanel;exports.NotificationService=i.NotificationService;exports.NotificationTimeline=i.NotificationTimeline;exports.NotificationsCenter=i.NotificationsCenter;exports.SEVERITY_ORDER=i.SEVERITY_ORDER;exports.SEVERITY_TONES=i.SEVERITY_TONES;exports.StatusBarNotificationBell=i.StatusBarNotificationBell;exports.appWindowNotificationOverlay=i.appWindowNotificationOverlay;exports.applyNotificationRules=i.applyNotificationRules;exports.cardRemindKey=i.cardRemindKey;exports.clearCompiledRuleRegexCache=i.clearCompiledRuleRegexCache;exports.compileNotificationSearchMatcher=i.compileNotificationSearchMatcher;exports.createNativeNotificationEngine=i.createNativeNotificationEngine;exports.createNotificationPreviewRuntime=i.createNotificationPreviewRuntime;exports.decideFilter=i.decideFilter;exports.deleteWebhookUrl=i.deleteWebhookUrl;exports.deriveImplicitRemindKey=i.deriveImplicitRemindKey;exports.dismissKey=i.dismissKey;exports.dismissableToastIds=i.dismissableToastIds;exports.entryVendorMatch=i.entryVendorMatch;exports.exportTimelineAsCsv=i.exportTimelineAsCsv;exports.exportTimelineAsJson=i.exportTimelineAsJson;exports.filterNotificationTimeline=i.filterNotificationTimeline;exports.filteredPriority=i.filteredPriority;exports.focusFirstNotificationEntry=i.focusFirstNotificationEntry;exports.getSmtpPass=i.getSmtpPass;exports.getWebhookUrl=i.getWebhookUrl;exports.groupTimelineEntries=i.groupTimelineEntries;exports.hiddenRunningProgress=i.hiddenRunningProgress;exports.isInQuietHours=i.isInQuietHours;exports.isKeyDismissed=i.isKeyDismissed;exports.isKeyRemindSuppressed=i.isKeyRemindSuppressed;exports.isNotificationSourceId=i.isNotificationSourceId;exports.isNotificationSticky=i.isNotificationSticky;exports.isOnToastStack=i.isOnToastStack;exports.isProgressRunning=i.isProgressRunning;exports.isSourceMuted=i.isSourceMuted;exports.isSpamDropHandle=i.isSpamDropHandle;exports.listNotificationSources=i.listNotificationSources;exports.nextQuietHoursStart=i.nextQuietHoursStart;exports.pruneOrphanWebhookSecrets=i.pruneOrphanWebhookSecrets;exports.registerFenceAliases=i.registerFenceAliases;exports.registerNotificationCommands=i.registerNotificationCommands;exports.remindLater=i.remindLater;exports.resolveCatalogPreviewPriority=i.resolveCatalogPreviewPriority;exports.resolveNotificationDuration=i.resolveNotificationDuration;exports.resolveNotificationSource=i.resolveNotificationSource;exports.resolveSeverityTone=i.resolveSeverityTone;exports.restoreAllKeys=i.restoreAllKeys;exports.restoreKey=i.restoreKey;exports.setSmtpPass=i.setSmtpPass;exports.setSourceMuted=i.setSourceMuted;exports.setWebhookUrl=i.setWebhookUrl;exports.shouldFireOsNative=i.shouldFireOsNative;exports.toTimelineActions=i.toTimelineActions;exports.unmuteAllSources=i.unmuteAllSources;exports.defineNotification=e.defineNotification;exports.defineNotificationScenario=e.defineNotificationScenario;exports.notificationSettings=t.notificationSettings;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as e, C as s, H as t, L as o, N as r, a as n, b as c, c as l, d as N, e as f, f as d, g as I, h as S, S as T, i as m, j as u, k as O, l as p, m as R, n as A, o as C, p as y, q as E, r as g, s as v, t as _, u as h, v as F, w as P, x, y as K, z as k, B as D, D as b, E as H, F as M, G as U, I as W, J as L, K as V, M as Y, O as w, P as B, Q, R as J, T as j, U as q, V as z, W as G, X, Y as Z, Z as $, _ as ii, $ as ai, a0 as ei, a1 as si, a2 as ti, a3 as oi, a4 as ri, a5 as ni, a6 as ci, a7 as li, a8 as Ni, a9 as fi, aa as di } from "../StatusBarNotificationBell-
|
|
2
|
-
import { d as Si, a as Ti } from "../notificationCatalog-
|
|
1
|
+
import { A as e, C as s, H as t, L as o, N as r, a as n, b as c, c as l, d as N, e as f, f as d, g as I, h as S, S as T, i as m, j as u, k as O, l as p, m as R, n as A, o as C, p as y, q as E, r as g, s as v, t as _, u as h, v as F, w as P, x, y as K, z as k, B as D, D as b, E as H, F as M, G as U, I as W, J as L, K as V, M as Y, O as w, P as B, Q, R as J, T as j, U as q, V as z, W as G, X, Y as Z, Z as $, _ as ii, $ as ai, a0 as ei, a1 as si, a2 as ti, a3 as oi, a4 as ri, a5 as ni, a6 as ci, a7 as li, a8 as Ni, a9 as fi, aa as di } from "../StatusBarNotificationBell-BfBGKXDG.js";
|
|
2
|
+
import { d as Si, a as Ti } from "../notificationCatalog-BKcY-o-R.js";
|
|
3
3
|
import { n as ui } from "../useSettingsSubscription-DLEk4k4j.js";
|
|
4
4
|
export {
|
|
5
5
|
e as ACCEPT_PRIMARY_ACTION_NOTIFICATION,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../CommandPalette-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../CommandPalette-DKURJBBZ.cjs"),i=require("../Modal-DNYwnQ0V.cjs"),c=require("../OverlayScrollArea-DuwGRSMm.cjs"),r=require("../GuidedTour-DCoB90h1.cjs"),o=require("../createDialogShellFocus-usbhq9Av.cjs"),O=require("../Input-UX0Hk53M.cjs"),t=require("../Popover-BBDBIpT6.cjs"),n=require("../overlayStack-eD8AmuwY.cjs"),p=require("../useFloatingDropdown-D5UayoN6.cjs"),M=require("../ownerWindow-BCmJFMbR.cjs"),a=require("../prefersReducedMotion-DYR56SKZ.cjs"),l=require("../kitHost-u0-mKvEK.cjs"),s=require("../dialogFocusRestore-DP5b1bDo.cjs"),u=require("../DesktopContextMenuContext-DMGNVjaR.cjs");exports.CommandPalette=e.CommandPalette;exports.ConfirmDialog=e.ConfirmDialog;exports.ConsequenceLine=e.ConsequenceLine;exports.ContextMenu=e.ContextMenu;exports.DesktopContextMenu=e.DesktopContextMenu;exports.Drawer=e.Drawer;exports.DropdownMenu=e.DropdownMenu;exports.FloatingWindow=e.FloatingWindow;exports.InputDialog=e.InputDialog;exports.MenuDisclosure=e.MenuDisclosure;exports.MenuEmpty=e.MenuEmpty;exports.MenuItem=e.MenuItem;exports.MenuList=e.MenuList;exports.MenuSearch=e.MenuSearch;exports.MenuSection=e.MenuSection;exports.MenuSeparator=e.MenuSeparator;exports.NameStep=e.NameStep;exports.OptionList=e.OptionList;exports.PopoverPanel=e.PopoverPanel;exports.SUBMENU_ANCHOR_OVERLAP=e.SUBMENU_ANCHOR_OVERLAP;exports.SUBMENU_ESTIMATED_ROW_HEIGHT=e.SUBMENU_ESTIMATED_ROW_HEIGHT;exports.SUBMENU_ESTIMATED_WIDTH=e.SUBMENU_ESTIMATED_WIDTH;exports.SUBMENU_MIN_ESTIMATED_HEIGHT=e.SUBMENU_MIN_ESTIMATED_HEIGHT;exports.SUBMENU_VIEWPORT_MARGIN=e.SUBMENU_VIEWPORT_MARGIN;exports.SaveDiscardDialog=e.SaveDiscardDialog;exports.SelectedOptions=e.SelectedOptions;exports.StatementPreview=e.StatementPreview;exports.StepFooter=e.StepFooter;exports.Tooltip=e.Tooltip;exports.TooltipHost=e.TooltipHost;exports.closeContextMenu=e.closeContextMenu;exports.computeSubmenuPlacement=e.computeSubmenuPlacement;exports.confirmationLevelOf=e.confirmationLevelOf;exports.createDangerousActionDialog=e.createDangerousActionDialog;exports.createDesktopContextMenuApi=e.createDesktopContextMenuApi;exports.createDialogFocusScope=e.createDialogFocusScope;exports.createOverlayCloseGuard=e.createOverlayCloseGuard;exports.describeConsequence=e.describeConsequence;exports.estimateSubmenuHeight=e.estimateSubmenuHeight;exports.firstFocusableMenuIndex=e.firstFocusableMenuIndex;exports.isDesktopMenuNavigationKey=e.isDesktopMenuNavigationKey;exports.isIrreversible=e.isIrreversible;exports.lastFocusableMenuIndex=e.lastFocusableMenuIndex;exports.menuSurfaceClasses=e.menuSurfaceClasses;exports.nextFocusableMenuIndex=e.nextFocusableMenuIndex;exports.openContextMenu=e.openContextMenu;exports.panelClasses=e.panelClasses;exports.resolveDangerousActionDialogKeyIntent=e.resolveDangerousActionDialogKeyIntent;exports.resolveMenuFocusForKey=e.resolveMenuFocusForKey;exports.tooltip=e.tooltip;exports.ActionPlaceRow=i.ActionPlaceRow;exports.Modal=i.Modal;exports.modalTitlebarHeight=i.modalTitlebarHeight;exports.OverlayScrollArea=c.OverlayScrollArea;exports.Disclosure=r.Disclosure;exports.GuidedTour=r.GuidedTour;exports.Panel=r.Panel;exports.PanelSeparator=r.PanelSeparator;exports.positionTourCard=r.positionTourCard;exports.COLD_DELAY_MS=o.COLD_DELAY_MS;exports.COOLDOWN_MS=o.COOLDOWN_MS;exports.DEFAULT_MARGIN=o.DEFAULT_MARGIN;exports.DEFAULT_OFFSET=o.DEFAULT_OFFSET;exports.HoverTooltip=o.HoverTooltip;exports.TOOLTIP_CURSOR_OFFSET_X=o.TOOLTIP_CURSOR_OFFSET_X;exports.TOOLTIP_CURSOR_OFFSET_Y=o.TOOLTIP_CURSOR_OFFSET_Y;exports.TOOLTIP_MAX_FOOTPRINT_X=o.TOOLTIP_MAX_FOOTPRINT_X;exports.TOOLTIP_VIEWPORT_MARGIN=o.TOOLTIP_VIEWPORT_MARGIN;exports.WARM_DELAY_MS=o.WARM_DELAY_MS;exports.collectFocusableElements=o.collectFocusableElements;exports.computeAnchoredTooltipPosition=o.computeAnchoredTooltipPosition;exports.computeTooltipPointerPosition=o.computeTooltipPointerPosition;exports.createDialogShellFocus=o.createDialogShellFocus;exports.createTooltipCoordinator=o.createTooltipCoordinator;exports.resolveDialogShellKeyIntent=o.resolveDialogShellKeyIntent;exports.resolveModalFocusTrapTarget=o.resolveModalFocusTrapTarget;exports.tooltipCoordinator=o.tooltipCoordinator;exports.trapTabFocusWithin=o.trapTabFocusWithin;exports.OverlayPortal=O.OverlayPortal;exports.AnchorAlignment=t.AnchorAlignment;exports.AnchorAxisAlignment=t.AnchorAxisAlignment;exports.AnchorPosition=t.AnchorPosition;exports.LISTBOX_OPTION_SELECTOR=t.LISTBOX_OPTION_SELECTOR;exports.MENU_ITEM_SELECTOR=t.MENU_ITEM_SELECTOR;exports.OVERLAY_DEFAULT_GAP=t.OVERLAY_DEFAULT_GAP;exports.OVERLAY_DEFAULT_MARGIN=t.OVERLAY_DEFAULT_MARGIN;exports.POPOVER_DEFAULT_GAP=t.POPOVER_DEFAULT_GAP;exports.POPOVER_VIEWPORT_MARGIN=t.POPOVER_VIEWPORT_MARGIN;exports.Popover=t.Popover;exports.calcFixedWidthDropdownLeft=t.calcFixedWidthDropdownLeft;exports.computeAnchoredPosition=t.computeAnchoredPosition;exports.computeDropdownPosition=t.computeDropdownPosition;exports.computePopoverPosition=t.computePopoverPosition;exports.isPopoverNavigationKey=t.isPopoverNavigationKey;exports.layout2d=t.layout2d;exports.requestOwnerAnimationFrame=t.requestOwnerAnimationFrame;exports.resolvePopoverFocusForKey=t.resolvePopoverFocusForKey;exports.resolvePopoverSide=t.resolvePopoverSide;exports.getOverlayDiagnostics=n.getOverlayDiagnostics;exports.hasOpenLayerIn=n.hasOpenLayerIn;exports.isAnyOverlayOpen=n.isAnyOverlayOpen;exports.isModalOccluded=n.isModalOccluded;exports.isOverlayOverlapping=n.isOverlayOverlapping;exports.notifyOverlayChanged=n.notifyOverlayChanged;exports.notifyOverlayMotionEnd=n.notifyOverlayMotionEnd;exports.notifyOverlayMotionStart=n.notifyOverlayMotionStart;exports.onOverlayMotion=n.onOverlayMotion;exports.overlayDepth=n.overlayDepth;exports.readOverlayMutationRevision=n.readOverlayMutationRevision;exports.registerOverlayClose=n.registerOverlayClose;exports.registerOverlayCondition=n.registerOverlayCondition;exports.registerOverlayOpen=n.registerOverlayOpen;exports.useOverlayRegistration=n.useOverlayRegistration;exports.useFloatingDropdown=p.useFloatingDropdown;exports.ownerWindow=M.ownerWindow;exports.modalBackgroundExemption=a.modalBackgroundExemption;exports.neutralizeBackground=a.neutralizeBackground;exports.ModalDefaultsProvider=l.ModalDefaultsProvider;exports.useModalDefaults=l.useModalDefaults;exports.restoreFocusTo=s.restoreFocusTo;exports.shouldRestoreFocusOnDialogClose=s.shouldRestoreFocusOnDialogClose;exports.DesktopContextMenuContext=u.DesktopContextMenuContext;exports.useDesktopContextMenu=u.useDesktopContextMenu;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as o, a as s, b as t, c as r, D as n, d as i, e as l, F as u, I as p, M as O, f as c, g as M, h as T, i as d, j as m, k as D, N as E, O as _, P as A, S as P, l as v, m as S, n as g, o as I, p as F, q as x, r as y, s as C, T as f, t as R, u as L, v as h, w as N, x as U, y as b, z as G, A as W, B as w, E as H, G as k, H as B, J as V, K, L as X, Q as Y, R as j, U as q, V as z, W as J, X as Q } from "../CommandPalette-
|
|
1
|
+
import { C as o, a as s, b as t, c as r, D as n, d as i, e as l, F as u, I as p, M as O, f as c, g as M, h as T, i as d, j as m, k as D, N as E, O as _, P as A, S as P, l as v, m as S, n as g, o as I, p as F, q as x, r as y, s as C, T as f, t as R, u as L, v as h, w as N, x as U, y as b, z as G, A as W, B as w, E as H, G as k, H as B, J as V, K, L as X, Q as Y, R as j, U as q, V as z, W as J, X as Q } from "../CommandPalette-B3EE1iMo.js";
|
|
2
2
|
import { A as $, M as ee, m as ae } from "../Modal-Cl_asviX.js";
|
|
3
3
|
import { O as se } from "../OverlayScrollArea-h6G3yk6U.js";
|
|
4
4
|
import { D as re, G as ne, P as ie, a as le, p as ue } from "../GuidedTour-pdx_4IrZ.js";
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import { Show, createEffect, createMemo, createSignal, createUniqueId, on, onCleanup, } from 'solid-js';
|
|
1
|
+
import { For, Show, createEffect, createMemo, createSignal, createUniqueId, on, onCleanup, } from 'solid-js';
|
|
2
2
|
import { OverlayPortal } from './OverlayPortal';
|
|
3
3
|
import { Button } from '../forms/Button';
|
|
4
4
|
import { Checkbox } from '../forms/Checkbox';
|
|
5
5
|
import { Input } from '../forms/Input';
|
|
6
6
|
import { Textarea } from '../forms/Textarea';
|
|
7
|
+
import { Alert } from '../feedback/Alert';
|
|
8
|
+
import { Badge } from '../feedback/Badge';
|
|
7
9
|
import { createDialogFocusScope } from './dialogFocusScope';
|
|
10
|
+
import { nudgeDialog } from './dialogNudge';
|
|
8
11
|
import { trapTabFocusWithin } from './modalFocusContainment';
|
|
9
12
|
import { resolveDialogShellKeyIntent } from './dialogShellKeyIntent';
|
|
10
13
|
import { createOverlayCloseGuard } from './overlayCloseGuard';
|
|
@@ -19,12 +22,24 @@ const hostDocOf = (host) => (host?.() ?? getMainWindow().window).document;
|
|
|
19
22
|
export function ConfirmDialog(props) {
|
|
20
23
|
const variant = createMemo(() => props.variant ?? 'default');
|
|
21
24
|
const sticky = createMemo(() => Boolean(props.sticky));
|
|
25
|
+
const acknowledge = createMemo(() => Boolean(props.acknowledge) && !sticky());
|
|
26
|
+
const holdsBackdrop = createMemo(() => sticky() || (variant() === 'danger' && !acknowledge()));
|
|
22
27
|
const cancelLabel = createMemo(() => props.cancelLabel ?? t('Cancel'));
|
|
28
|
+
const confirmLabel = createMemo(() => props.confirmLabel ?? (acknowledge() ? t('Close') : t('Confirm')));
|
|
23
29
|
const checkboxOption = createMemo(() => props.checkbox);
|
|
30
|
+
const details = createMemo(() => props.details ?? []);
|
|
31
|
+
const warnings = createMemo(() => props.warnings ?? []);
|
|
24
32
|
const titleId = createUniqueId();
|
|
25
33
|
const placeId = createUniqueId();
|
|
26
34
|
const messageId = createUniqueId();
|
|
27
|
-
const
|
|
35
|
+
const warningsId = createUniqueId();
|
|
36
|
+
const describedBy = () => [
|
|
37
|
+
props.place ? placeId : null,
|
|
38
|
+
messageId,
|
|
39
|
+
warnings().length > 0 ? warningsId : null,
|
|
40
|
+
]
|
|
41
|
+
.filter((id) => id !== null)
|
|
42
|
+
.join(' ');
|
|
28
43
|
const [remaining, setRemaining] = createSignal(0);
|
|
29
44
|
createEffect(() => {
|
|
30
45
|
if (!props.open()) {
|
|
@@ -56,14 +71,18 @@ export function ConfirmDialog(props) {
|
|
|
56
71
|
const handleOverlayMouseDown = (event) => {
|
|
57
72
|
const onOverlay = event.target === event.currentTarget;
|
|
58
73
|
overlayGuard.noteMouseDown(onOverlay);
|
|
59
|
-
if (onOverlay &&
|
|
74
|
+
if (onOverlay && holdsBackdrop())
|
|
60
75
|
event.preventDefault();
|
|
61
76
|
};
|
|
62
77
|
const handleOverlayClick = (event) => {
|
|
63
|
-
if (overlayGuard.shouldCloseOnClick(event.target === event.currentTarget)
|
|
64
|
-
|
|
78
|
+
if (!overlayGuard.shouldCloseOnClick(event.target === event.currentTarget))
|
|
79
|
+
return;
|
|
80
|
+
if (!holdsBackdrop()) {
|
|
65
81
|
props.onCancel(answer());
|
|
82
|
+
return;
|
|
66
83
|
}
|
|
84
|
+
if (dialogElement)
|
|
85
|
+
nudgeDialog(dialogElement);
|
|
67
86
|
};
|
|
68
87
|
const handleOverlayKeyDown = (event) => {
|
|
69
88
|
if (event.target !== event.currentTarget)
|
|
@@ -100,7 +119,7 @@ export function ConfirmDialog(props) {
|
|
|
100
119
|
if (!el.isConnected)
|
|
101
120
|
return;
|
|
102
121
|
const buttons = Array.from(el.querySelectorAll('button:not([disabled])'));
|
|
103
|
-
const isDanger = variant() === 'danger';
|
|
122
|
+
const isDanger = variant() === 'danger' && !acknowledge();
|
|
104
123
|
const targetBtn = isDanger
|
|
105
124
|
? sticky()
|
|
106
125
|
? undefined
|
|
@@ -114,6 +133,15 @@ export function ConfirmDialog(props) {
|
|
|
114
133
|
<div class={styles.overlay} tabIndex={-1} onMouseDown={handleOverlayMouseDown} onClick={handleOverlayClick} onKeyDown={handleOverlayKeyDown}>
|
|
115
134
|
<div ref={captureAndFocus} class={styles.dialog} role="alertdialog" aria-modal="true" aria-labelledby={titleId} aria-describedby={describedBy()} tabIndex={-1} onKeyDown={handleKeyDown}>
|
|
116
135
|
<div class={styles.header}>
|
|
136
|
+
<Show when={(props.badges ?? []).length > 0}>
|
|
137
|
+
<div class={styles.badges}>
|
|
138
|
+
<For each={props.badges}>
|
|
139
|
+
{(badge) => (<Badge size="sm" tone={badge.tone ?? 'neutral'}>
|
|
140
|
+
{badge.label}
|
|
141
|
+
</Badge>)}
|
|
142
|
+
</For>
|
|
143
|
+
</div>
|
|
144
|
+
</Show>
|
|
117
145
|
<h3 id={titleId} class={styles.title}>
|
|
118
146
|
{props.title}
|
|
119
147
|
</h3>
|
|
@@ -125,6 +153,22 @@ export function ConfirmDialog(props) {
|
|
|
125
153
|
<p id={messageId} class={styles.message}>
|
|
126
154
|
{props.message}
|
|
127
155
|
</p>
|
|
156
|
+
<Show when={details().length > 0}>
|
|
157
|
+
<ul class={styles.details}>
|
|
158
|
+
<For each={details()}>{(line) => <li>{line}</li>}</For>
|
|
159
|
+
</ul>
|
|
160
|
+
</Show>
|
|
161
|
+
<Show when={warnings().length > 0}>
|
|
162
|
+
<div id={warningsId} class={styles.warnings}>
|
|
163
|
+
<Alert tone={variant() === 'danger' ? 'danger' : 'warning'} urgency="polite">
|
|
164
|
+
<Show when={warnings().length > 1} fallback={<p class={styles.warningLine}>{warnings()[0]}</p>}>
|
|
165
|
+
<ul class={styles.warningList}>
|
|
166
|
+
<For each={warnings()}>{(line) => <li>{line}</li>}</For>
|
|
167
|
+
</ul>
|
|
168
|
+
</Show>
|
|
169
|
+
</Alert>
|
|
170
|
+
</div>
|
|
171
|
+
</Show>
|
|
128
172
|
<Show when={props.code}>
|
|
129
173
|
{(code) => (<OverlayScrollArea rootClass={styles.codeScroll} viewportClass={styles.code}>
|
|
130
174
|
<pre class={styles.codePre} aria-label={t('Statement')}>
|
|
@@ -139,20 +183,20 @@ export function ConfirmDialog(props) {
|
|
|
139
183
|
</Show>
|
|
140
184
|
</div>
|
|
141
185
|
<div class={styles.footer}>
|
|
142
|
-
<Show when={!sticky()}>
|
|
186
|
+
<Show when={!sticky() && !acknowledge()}>
|
|
143
187
|
<Button size="lg" variant="secondary" onClick={() => props.onCancel(answer())}>
|
|
144
188
|
{cancelLabel()}
|
|
145
189
|
</Button>
|
|
146
190
|
</Show>
|
|
147
|
-
<Button size="lg" variant={variant() === 'danger'
|
|
191
|
+
<Button size="lg" variant={variant() === 'danger' && !acknowledge()
|
|
148
192
|
? 'dangerSolid'
|
|
149
193
|
: 'primary'} disabled={remaining() > 0} onClick={() => props.onConfirm(answer())}>
|
|
150
194
|
{remaining() > 0
|
|
151
195
|
? t('{label} ({seconds})', {
|
|
152
|
-
label:
|
|
196
|
+
label: confirmLabel(),
|
|
153
197
|
seconds: remaining(),
|
|
154
198
|
})
|
|
155
|
-
:
|
|
199
|
+
: confirmLabel()}
|
|
156
200
|
</Button>
|
|
157
201
|
</div>
|
|
158
202
|
</div>
|
|
@@ -4,7 +4,13 @@ export default {
|
|
|
4
4
|
"dialogBackdropFadeIn": "vk_dialogBackdropFadeIn_bgihT",
|
|
5
5
|
"dialog": "vk_dialog_3YL-7",
|
|
6
6
|
"dialogEntranceScaleUp": "vk_dialogEntranceScaleUp_Ab6Az",
|
|
7
|
+
"dialogNudge": "vk_dialogNudge_H2018",
|
|
7
8
|
"header": "vk_header_asYMs",
|
|
9
|
+
"badges": "vk_badges_yPJ6e",
|
|
10
|
+
"details": "vk_details_RXi6U",
|
|
11
|
+
"warnings": "vk_warnings_M8Sqk",
|
|
12
|
+
"warningLine": "vk_warningLine_BbPrX",
|
|
13
|
+
"warningList": "vk_warningList_M4udI",
|
|
8
14
|
"title": "vk_title_0fm8I vk_titleLg_Iswm3",
|
|
9
15
|
"body": "vk_body_U-3RF",
|
|
10
16
|
"message": "vk_message_UsUIn",
|
|
@@ -4,6 +4,7 @@ import { requestOwnerAnimationFrame } from './ownerAnimationFrame';
|
|
|
4
4
|
import { t } from '../i18n/i18n';
|
|
5
5
|
import { resolveDangerousActionDialogKeyIntent } from './dangerousActionDialogKeyIntent';
|
|
6
6
|
import { createDialogFocusScope } from './dialogFocusScope';
|
|
7
|
+
import { nudgeDialog } from './dialogNudge';
|
|
7
8
|
import { trapTabFocusWithin } from './modalFocusContainment';
|
|
8
9
|
import { createOverlayCloseGuard } from './overlayCloseGuard';
|
|
9
10
|
import { getActiveWindow, getMainWindow } from '../host/window';
|
|
@@ -152,11 +153,15 @@ export function createDangerousActionDialog(defaultHost) {
|
|
|
152
153
|
});
|
|
153
154
|
onCleanup(stopCountdown);
|
|
154
155
|
const handleOverlayMouseDown = (event) => {
|
|
155
|
-
|
|
156
|
+
const onOverlay = event.target === event.currentTarget;
|
|
157
|
+
overlayGuard.noteMouseDown(onOverlay);
|
|
158
|
+
if (onOverlay)
|
|
159
|
+
event.preventDefault();
|
|
156
160
|
};
|
|
157
161
|
const handleOverlayClick = (event) => {
|
|
158
|
-
if (overlayGuard.shouldCloseOnClick(event.target === event.currentTarget)
|
|
159
|
-
|
|
162
|
+
if (overlayGuard.shouldCloseOnClick(event.target === event.currentTarget) &&
|
|
163
|
+
dialogElement)
|
|
164
|
+
nudgeDialog(dialogElement);
|
|
160
165
|
};
|
|
161
166
|
const handleKeyDown = (event) => {
|
|
162
167
|
const intent = resolveDangerousActionDialogKeyIntent(event.key, {
|
|
@@ -4,6 +4,7 @@ export default {
|
|
|
4
4
|
"dialogBackdropFadeIn": "vk_dialogBackdropFadeIn_UuemA",
|
|
5
5
|
"dialog": "vk_dialog_Yf7zX",
|
|
6
6
|
"dialogEntranceScaleUp": "vk_dialogEntranceScaleUp_xRcng",
|
|
7
|
+
"dialogNudge": "vk_dialogNudge_PrAjO",
|
|
7
8
|
"header": "vk_header_CYXMR",
|
|
8
9
|
"warningIcon": "vk_warningIcon_qizN5",
|
|
9
10
|
"title": "vk_title_DPV4m vk_titleLg_Iswm3",
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export const NUDGE_HOLD_MS = 600;
|
|
2
|
+
export const NUDGE_ATTRIBUTE = 'data-nudge';
|
|
3
|
+
const timers = new WeakMap();
|
|
4
|
+
export function nudgeDialog(dialog) {
|
|
5
|
+
const view = dialog.ownerDocument.defaultView;
|
|
6
|
+
if (view === null)
|
|
7
|
+
return;
|
|
8
|
+
const previous = timers.get(dialog);
|
|
9
|
+
if (previous !== undefined)
|
|
10
|
+
view.clearTimeout(previous);
|
|
11
|
+
dialog.removeAttribute(NUDGE_ATTRIBUTE);
|
|
12
|
+
void dialog.offsetWidth;
|
|
13
|
+
dialog.setAttribute(NUDGE_ATTRIBUTE, '');
|
|
14
|
+
timers.set(dialog, view.setTimeout(() => {
|
|
15
|
+
timers.delete(dialog);
|
|
16
|
+
dialog.removeAttribute(NUDGE_ATTRIBUTE);
|
|
17
|
+
}, NUDGE_HOLD_MS));
|
|
18
|
+
}
|