@seekbuddy/dsh-ui 0.0.0-stage → 0.2.0-beta.1
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 +83 -0
- package/LICENSE +22 -0
- package/README.md +175 -2
- package/README.zh.md +176 -0
- package/THIRD_PARTY_NOTICES.md +42 -0
- package/UPSTREAM.md +59 -0
- package/dist/blocks.js +1617 -0
- package/dist/chunks/chunk-23KOEBWJ.js +104 -0
- package/dist/chunks/chunk-6SGSJ5KW.js +57 -0
- package/dist/chunks/chunk-7NH2UOZO.js +155 -0
- package/dist/chunks/chunk-7SKW4S35.js +66 -0
- package/dist/chunks/chunk-B3EEK7A2.js +408 -0
- package/dist/chunks/chunk-CEBTQO6W.js +24 -0
- package/dist/chunks/chunk-ENKPNYOB.js +26 -0
- package/dist/chunks/chunk-EWAZFWLW.js +27 -0
- package/dist/chunks/chunk-F352IICS.js +57 -0
- package/dist/chunks/chunk-FFJ6TCCF.js +31 -0
- package/dist/chunks/chunk-FZXK4LTI.js +129 -0
- package/dist/chunks/chunk-JA3XDLIA.js +1115 -0
- package/dist/chunks/chunk-L7XALG4J.js +36 -0
- package/dist/chunks/chunk-OCAQFVT3.js +3172 -0
- package/dist/chunks/chunk-RAXDA2PT.js +202 -0
- package/dist/chunks/chunk-RNVSCTW7.js +24 -0
- package/dist/chunks/chunk-RZOP2PFC.js +152 -0
- package/dist/chunks/chunk-SN6RSUWC.js +61 -0
- package/dist/chunks/chunk-SNVSQWCU.js +22 -0
- package/dist/chunks/chunk-SO3DCAWG.js +170 -0
- package/dist/chunks/chunk-UAEFKTV3.js +144 -0
- package/dist/chunks/chunk-UGEORMLD.js +89 -0
- package/dist/chunks/chunk-W6FLI3AK.js +112 -0
- package/dist/chunks/chunk-WX46TSKP.js +328 -0
- package/dist/chunks/chunk-XL33IPCV.js +261 -0
- package/dist/chunks/chunk-XW4L4ZGL.js +967 -0
- package/dist/chunks/chunk-YOBY6PSL.js +850 -0
- package/dist/chunks/chunk-ZA47FP7C.js +7 -0
- package/dist/icons.js +859 -0
- package/dist/index.js +1675 -0
- package/dist/katex/fonts/KaTeX_AMS-Regular.woff2 +0 -0
- package/dist/katex/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
- package/dist/katex/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
- package/dist/katex/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
- package/dist/katex/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
- package/dist/katex/fonts/KaTeX_Main-Bold.woff2 +0 -0
- package/dist/katex/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
- package/dist/katex/fonts/KaTeX_Main-Italic.woff2 +0 -0
- package/dist/katex/fonts/KaTeX_Main-Regular.woff2 +0 -0
- package/dist/katex/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
- package/dist/katex/fonts/KaTeX_Math-Italic.woff2 +0 -0
- package/dist/katex/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
- package/dist/katex/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
- package/dist/katex/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
- package/dist/katex/fonts/KaTeX_Script-Regular.woff2 +0 -0
- package/dist/katex/fonts/KaTeX_Size1-Regular.woff2 +0 -0
- package/dist/katex/fonts/KaTeX_Size2-Regular.woff2 +0 -0
- package/dist/katex/fonts/KaTeX_Size3-Regular.woff2 +0 -0
- package/dist/katex/fonts/KaTeX_Size4-Regular.woff2 +0 -0
- package/dist/katex/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
- package/dist/katex.css +1 -0
- package/dist/katex.css.d.ts +2 -0
- package/dist/markdown.js +225 -0
- package/dist/meta.json +7575 -0
- package/dist/root-inputs.json +86 -0
- package/dist/seekbuddy-card.js +7 -0
- package/dist/seekbuddy-empty.js +8 -0
- package/dist/seekbuddy-internal/DangerButton.js +7 -0
- package/dist/seekbuddy-internal/Mark.js +7 -0
- package/dist/seekbuddy-internal/Message.js +10 -0
- package/dist/seekbuddy-internal/Pagination.js +9 -0
- package/dist/seekbuddy-internal/StatusBadge.js +7 -0
- package/dist/seekbuddy-internal/SubtleButton.js +7 -0
- package/dist/seekbuddy-internal/Switch.js +7 -0
- package/dist/seekbuddy-internal/Upload.js +7 -0
- package/dist/seekbuddy-internal/date/Calendar.js +8 -0
- package/dist/seekbuddy-internal/date/DatePicker.js +9 -0
- package/dist/seekbuddy-internal/date/DateRangePicker.js +9 -0
- package/dist/seekbuddy-internal/date/TimePicker.js +8 -0
- package/dist/seekbuddy-internal/date/fields.js +16 -0
- package/dist/seekbuddy-internal/qr/QrCode.js +7 -0
- package/dist/seekbuddy-spinner.js +7 -0
- package/dist/seekbuddy-tabs.js +7 -0
- package/dist/seekbuddy-timeline.js +8 -0
- package/dist/seekbuddy.js +89 -0
- package/dist/theme-bootstrap.js +13 -0
- package/dist/theme.js +37 -0
- package/dist/tokens.css +974 -0
- package/dist/tokens.css.d.ts +2 -0
- package/dist/types/AnimatedRows.d.ts +45 -0
- package/dist/types/Button.d.ts +18 -0
- package/dist/types/Checkbox.d.ts +19 -0
- package/dist/types/CodeFileIcon.d.ts +11 -0
- package/dist/types/CodeToolbar.d.ts +29 -0
- package/dist/types/CommandText.d.ts +15 -0
- package/dist/types/ConfigField.d.ts +32 -0
- package/dist/types/ConnectionIndicator.d.ts +25 -0
- package/dist/types/DetailDocument.d.ts +77 -0
- package/dist/types/DiffBlock.d.ts +51 -0
- package/dist/types/DisclosureRow.d.ts +37 -0
- package/dist/types/DraggableImage.d.ts +18 -0
- package/dist/types/FileTypeIcon.d.ts +42 -0
- package/dist/types/FoldToggle.d.ts +19 -0
- package/dist/types/HoverCard.d.ts +44 -0
- package/dist/types/HoverCardGroup.d.ts +24 -0
- package/dist/types/ImageLightbox.d.ts +29 -0
- package/dist/types/ImagePreview.d.ts +11 -0
- package/dist/types/InlineEditor.d.ts +22 -0
- package/dist/types/Input.d.ts +11 -0
- package/dist/types/JsonTree.d.ts +58 -0
- package/dist/types/LinkIcon.d.ts +33 -0
- package/dist/types/Menu.d.ts +163 -0
- package/dist/types/MenuGroup.d.ts +21 -0
- package/dist/types/MenuSurface.d.ts +24 -0
- package/dist/types/Modal.d.ts +43 -0
- package/dist/types/PermissionIcon.d.ts +50 -0
- package/dist/types/Pill.d.ts +12 -0
- package/dist/types/QuotePreview.d.ts +23 -0
- package/dist/types/ReadBlock.d.ts +47 -0
- package/dist/types/ReferenceIcon.d.ts +20 -0
- package/dist/types/RiskConfirmation.d.ts +19 -0
- package/dist/types/SearchBlock.d.ts +71 -0
- package/dist/types/SegmentedControl.d.ts +34 -0
- package/dist/types/SegmentedTabs.d.ts +27 -0
- package/dist/types/ShortcutKeys.d.ts +10 -0
- package/dist/types/SiteGlyph.d.ts +24 -0
- package/dist/types/StateDot.d.ts +19 -0
- package/dist/types/Switch.d.ts +19 -0
- package/dist/types/Tag.d.ts +31 -0
- package/dist/types/TerminalBlock.d.ts +85 -0
- package/dist/types/TextShimmer.d.ts +22 -0
- package/dist/types/Toast.d.ts +48 -0
- package/dist/types/Tooltip.d.ts +69 -0
- package/dist/types/UserMessageBubble.d.ts +10 -0
- package/dist/types/WebBlock.d.ts +60 -0
- package/dist/types/ZoomControls.d.ts +26 -0
- package/dist/types/ansi.d.ts +16 -0
- package/dist/types/blocks.d.ts +21 -0
- package/dist/types/clipboard.d.ts +8 -0
- package/dist/types/code-file-icon-artwork.d.ts +53 -0
- package/dist/types/code-file-types.d.ts +29 -0
- package/dist/types/code-highlighting.d.ts +11 -0
- package/dist/types/css-modules.d.ts +6 -0
- package/dist/types/darwin-desktop.d.ts +8 -0
- package/dist/types/document-zoom.d.ts +16 -0
- package/dist/types/file-drag-actions.d.ts +36 -0
- package/dist/types/file-size.d.ts +7 -0
- package/dist/types/focus.d.ts +15 -0
- package/dist/types/guide-artwork.d.ts +14 -0
- package/dist/types/head-tail-cap.d.ts +22 -0
- package/dist/types/icons/artwork.d.ts +421 -0
- package/dist/types/icons/index.d.ts +397 -0
- package/dist/types/icons/props.d.ts +8 -0
- package/dist/types/icons/shared-artwork.d.ts +36 -0
- package/dist/types/icons.d.ts +6 -0
- package/dist/types/image-drag.d.ts +16 -0
- package/dist/types/index.d.ts +71 -0
- package/dist/types/input-modality.d.ts +18 -0
- package/dist/types/keyboard-composition.d.ts +10 -0
- package/dist/types/markdown/CodeBlock.d.ts +34 -0
- package/dist/types/markdown/JsonBlock.d.ts +7 -0
- package/dist/types/markdown/MarkdownDelegate.d.ts +68 -0
- package/dist/types/markdown/MarkdownText.d.ts +54 -0
- package/dist/types/markdown/cjkFriendlyStrong.d.ts +8 -0
- package/dist/types/markdown/file-link.d.ts +22 -0
- package/dist/types/markdown/highlight.d.ts +169 -0
- package/dist/types/markdown/incremental.d.ts +79 -0
- package/dist/types/markdown/katex.d.ts +18 -0
- package/dist/types/markdown/local-image-syntax.d.ts +9 -0
- package/dist/types/markdown/mathCompatibility.d.ts +10 -0
- package/dist/types/markdown/parse.d.ts +24 -0
- package/dist/types/markdown/plain-text.d.ts +21 -0
- package/dist/types/markdown/quote-text.d.ts +7 -0
- package/dist/types/markdown/render.d.ts +145 -0
- package/dist/types/markdown/useViewportHighlighting.d.ts +10 -0
- package/dist/types/markdown/windows-path-destinations.d.ts +10 -0
- package/dist/types/markdown.d.ts +12 -0
- package/dist/types/overlay-top-margin.d.ts +14 -0
- package/dist/types/plugin-artwork.d.ts +16 -0
- package/dist/types/pointer-grace.d.ts +21 -0
- package/dist/types/rank-by-name.d.ts +21 -0
- package/dist/types/relative-time.d.ts +22 -0
- package/dist/types/seekbuddy/Card.d.ts +28 -0
- package/dist/types/seekbuddy/DangerButton.d.ts +31 -0
- package/dist/types/seekbuddy/Empty.d.ts +34 -0
- package/dist/types/seekbuddy/Mark.d.ts +27 -0
- package/dist/types/seekbuddy/Message.d.ts +52 -0
- package/dist/types/seekbuddy/Pagination.d.ts +66 -0
- package/dist/types/seekbuddy/Spinner.d.ts +20 -0
- package/dist/types/seekbuddy/StatusBadge.d.ts +33 -0
- package/dist/types/seekbuddy/SubtleButton.d.ts +30 -0
- package/dist/types/seekbuddy/Switch.d.ts +36 -0
- package/dist/types/seekbuddy/Tabs.d.ts +49 -0
- package/dist/types/seekbuddy/Timeline.d.ts +42 -0
- package/dist/types/seekbuddy/Upload.d.ts +101 -0
- package/dist/types/seekbuddy/date/Calendar.d.ts +94 -0
- package/dist/types/seekbuddy/date/DatePicker.d.ts +29 -0
- package/dist/types/seekbuddy/date/DateRangePicker.d.ts +41 -0
- package/dist/types/seekbuddy/date/TimePicker.d.ts +35 -0
- package/dist/types/seekbuddy/date/date.d.ts +79 -0
- package/dist/types/seekbuddy/date/fields.d.ts +45 -0
- package/dist/types/seekbuddy/index.d.ts +49 -0
- package/dist/types/seekbuddy/qr/QrCode.d.ts +37 -0
- package/dist/types/seekbuddy/qr/qr.d.ts +38 -0
- package/dist/types/theme-bootstrap.d.ts +3 -0
- package/dist/types/theme-core.d.ts +14 -0
- package/dist/types/theme.d.ts +4 -0
- package/dist/types/tooltip-placement.d.ts +34 -0
- package/dist/types/use-clipboard-copy.d.ts +13 -0
- package/dist/types/useAnchoredMaxHeight.d.ts +13 -0
- package/dist/types/useAnchoredPosition.d.ts +35 -0
- package/dist/types/useDismissOnOutsidePointer.d.ts +10 -0
- package/dist/types/useModalLayer.d.ts +26 -0
- package/dist/types/useRowDragPreview.d.ts +19 -0
- package/dist/types/user-text.d.ts +31 -0
- package/package.json +151 -4
package/dist/index.js
ADDED
|
@@ -0,0 +1,1675 @@
|
|
|
1
|
+
import {
|
|
2
|
+
MENU_TRANSITION_MS,
|
|
3
|
+
Menu,
|
|
4
|
+
MenuItemButton,
|
|
5
|
+
MenuSurface,
|
|
6
|
+
Pill,
|
|
7
|
+
closeTopModal,
|
|
8
|
+
focusWithoutRing,
|
|
9
|
+
isBehindModal,
|
|
10
|
+
isMobileDevice,
|
|
11
|
+
modalSelector,
|
|
12
|
+
observeComposition,
|
|
13
|
+
useAnchoredPosition,
|
|
14
|
+
useClipboardCopy,
|
|
15
|
+
useModalLayer
|
|
16
|
+
} from "./chunks/chunk-YOBY6PSL.js";
|
|
17
|
+
import {
|
|
18
|
+
Button
|
|
19
|
+
} from "./chunks/chunk-ENKPNYOB.js";
|
|
20
|
+
import {
|
|
21
|
+
DraggableImage,
|
|
22
|
+
HoverCard,
|
|
23
|
+
HoverCardGroup,
|
|
24
|
+
ImageLightbox,
|
|
25
|
+
MarkdownText_module_default,
|
|
26
|
+
ShortcutKeys,
|
|
27
|
+
StateDot,
|
|
28
|
+
Tooltip,
|
|
29
|
+
overlayTopMargin,
|
|
30
|
+
pointerModality,
|
|
31
|
+
useDismissOnOutsidePointer,
|
|
32
|
+
writeClipboard
|
|
33
|
+
} from "./chunks/chunk-JA3XDLIA.js";
|
|
34
|
+
import {
|
|
35
|
+
ReferenceIconRegular
|
|
36
|
+
} from "./chunks/chunk-FFJ6TCCF.js";
|
|
37
|
+
import {
|
|
38
|
+
IconCheckCircleOutlineRegular,
|
|
39
|
+
IconCheckOutlineRegular,
|
|
40
|
+
IconChevronDownOutlineRegular,
|
|
41
|
+
IconChevronUpOutlineRegular,
|
|
42
|
+
IconCloseOutlineRegular,
|
|
43
|
+
IconPlusOutlineRegular,
|
|
44
|
+
IconRefreshOutlineRegular,
|
|
45
|
+
IconWarningOutlineRegular
|
|
46
|
+
} from "./chunks/chunk-XW4L4ZGL.js";
|
|
47
|
+
import {
|
|
48
|
+
__publicField
|
|
49
|
+
} from "./chunks/chunk-ZA47FP7C.js";
|
|
50
|
+
|
|
51
|
+
// src/DisclosureRow.tsx
|
|
52
|
+
import { memo as memo2 } from "react";
|
|
53
|
+
import clsx2 from "clsx";
|
|
54
|
+
|
|
55
|
+
// src/TextShimmer.tsx
|
|
56
|
+
import * as React from "react";
|
|
57
|
+
import { memo, useContext } from "react";
|
|
58
|
+
import clsx from "clsx";
|
|
59
|
+
|
|
60
|
+
// .build/css/TextShimmer.module.mjs
|
|
61
|
+
var id = "@seekbuddy/dsh-ui/TextShimmer.module.css";
|
|
62
|
+
if (typeof document !== "undefined" && !document.querySelector('style[data-dsh-ui-primitives="' + id + '"]')) {
|
|
63
|
+
const element = document.createElement("style");
|
|
64
|
+
element.setAttribute("data-dsh-ui-primitives", id);
|
|
65
|
+
element.textContent = ".sFCb2G_root{vertical-align:top;width:max-content;min-width:0;max-width:100%;color:inherit;display:inline-grid;position:relative}.sFCb2G_content{align-items:center;min-width:0;display:flex}.sFCb2G_text{color:inherit}.sFCb2G_text[data-shimmer-text]:after{content:attr(data-shimmer-text)}.sFCb2G_decoration{pointer-events:none;user-select:none;position:absolute;inset:0;overflow:clip}.sFCb2G_sweep{color:var(--dsw-alias-label-shimmer);animation-name:sFCb2G_dsh-row-shimmer-sweep;position:absolute;inset:0;overflow:hidden;transform:translate(-100%);mask-image:linear-gradient(105deg,#0000 0%,#000 40% 60%,#0000 100%)}.sFCb2G_sweep *{color:inherit!important}.sFCb2G_sweep [data-shimmer-decoration]{background:currentColor}.sFCb2G_highlight{width:100%;height:100%;animation-name:sFCb2G_dsh-row-shimmer-highlight;transform:translate(100%)}.sFCb2G_sweep,.sFCb2G_highlight{animation-duration:1.5s;animation-timing-function:steps(48,end);animation-iteration-count:infinite;animation-delay:.3s}@keyframes sFCb2G_dsh-row-shimmer-sweep{0%{transform:translate(-100%)}66.6667%,to{transform:translate(100%)}}@keyframes sFCb2G_dsh-row-shimmer-highlight{0%{transform:translate(100%)}66.6667%,to{transform:translate(-100%)}}@media (prefers-reduced-motion:reduce){.sFCb2G_decoration{display:none}.sFCb2G_sweep,.sFCb2G_highlight{animation:none}}";
|
|
66
|
+
document.head.appendChild(element);
|
|
67
|
+
}
|
|
68
|
+
var TextShimmer_module_default = { "dsh-row-shimmer-sweep": "sFCb2G_dsh-row-shimmer-sweep", "root": "sFCb2G_root", "sweep": "sFCb2G_sweep", "dsh-row-shimmer-highlight": "sFCb2G_dsh-row-shimmer-highlight", "highlight": "sFCb2G_highlight", "text": "sFCb2G_text", "content": "sFCb2G_content", "decoration": "sFCb2G_decoration" };
|
|
69
|
+
|
|
70
|
+
// src/TextShimmer.tsx
|
|
71
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
72
|
+
var DecorativeCopy = typeof React.createContext === "function" ? React.createContext(void 0) : null;
|
|
73
|
+
function TextContent({ children, className }) {
|
|
74
|
+
const decorative = useContext(DecorativeCopy);
|
|
75
|
+
const generated = decorative === true && typeof children === "string";
|
|
76
|
+
return /* @__PURE__ */ jsx("span", { className: clsx(TextShimmer_module_default.text, className), "data-shimmer-text": generated ? children : void 0, children: generated ? null : children });
|
|
77
|
+
}
|
|
78
|
+
var TextShimmer = memo(function TextShimmer2({
|
|
79
|
+
children,
|
|
80
|
+
active = false,
|
|
81
|
+
className,
|
|
82
|
+
contentClassName
|
|
83
|
+
}) {
|
|
84
|
+
const decorative = useContext(DecorativeCopy);
|
|
85
|
+
if (decorative !== void 0) return /* @__PURE__ */ jsx(TextContent, { className, children });
|
|
86
|
+
const content = typeof children === "string" ? /* @__PURE__ */ jsx(TextContent, { children }) : children;
|
|
87
|
+
return /* @__PURE__ */ jsxs("span", { className: clsx(TextShimmer_module_default.root, className), "data-shimmer": active || void 0, children: [
|
|
88
|
+
/* @__PURE__ */ jsx(DecorativeCopy.Provider, { value: false, children: /* @__PURE__ */ jsx("span", { className: clsx(TextShimmer_module_default.content, contentClassName), children: content }) }),
|
|
89
|
+
active && // React 18 forwards inert as an empty string; a boolean is dropped.
|
|
90
|
+
/* @__PURE__ */ jsx("span", { className: TextShimmer_module_default.decoration, "aria-hidden": "true", ...{ inert: "" }, children: /* @__PURE__ */ jsx("span", { className: TextShimmer_module_default.sweep, children: /* @__PURE__ */ jsx(DecorativeCopy.Provider, { value: true, children: /* @__PURE__ */ jsx("span", { className: clsx(TextShimmer_module_default.content, TextShimmer_module_default.highlight, contentClassName), children: content }) }) }) })
|
|
91
|
+
] });
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
// .build/css/DisclosureRow.module.mjs
|
|
95
|
+
var id2 = "@seekbuddy/dsh-ui/DisclosureRow.module.css";
|
|
96
|
+
if (typeof document !== "undefined" && !document.querySelector('style[data-dsh-ui-primitives="' + id2 + '"]')) {
|
|
97
|
+
const element = document.createElement("style");
|
|
98
|
+
element.setAttribute("data-dsh-ui-primitives", id2);
|
|
99
|
+
element.textContent = "._1_lb6a_root{flex-direction:column;width:100%;min-width:0;display:flex}._1_lb6a_header{align-items:center;min-width:0;display:flex}._1_lb6a_header[data-has-accessory]{gap:8px}._1_lb6a_header[data-has-accessory] ._1_lb6a_row{flex:0 auto}._1_lb6a_row{height:calc(24px + var(--dsh-content-font-delta,0px));min-width:0;color:var(--dsw-alias-label-tertiary);flex:auto;align-items:center;transition:color .1s;display:flex;position:relative;overflow:hidden}._1_lb6a_row[data-expandable]{cursor:pointer}@media (hover:hover){._1_lb6a_row:hover{color:var(--dsw-alias-label-secondary)}}._1_lb6a_leading{width:calc(16px + var(--dsh-content-font-delta,0px));height:calc(16px + var(--dsh-content-font-delta,0px));color:inherit;background:0 0;border:none;flex:none;justify-content:center;align-items:center;margin-right:6px;padding:0;display:inline-flex;position:relative}._1_lb6a_leading svg:not([data-state]){width:calc(14px + var(--dsh-content-font-delta,0px));height:calc(14px + var(--dsh-content-font-delta,0px))}button._1_lb6a_leading{cursor:pointer}._1_lb6a_iconIdle{opacity:1;transition:opacity .1s;display:inline-flex}._1_lb6a_chevronHover{opacity:0;margin:auto;transition:opacity .1s;position:absolute;inset:0}@media (hover:hover){._1_lb6a_row:hover ._1_lb6a_iconIdle{opacity:0}._1_lb6a_row:hover ._1_lb6a_chevronHover{opacity:1}}._1_lb6a_title{font-size:var(--dsh-content-font-size-secondary,13px);line-height:calc(24px + var(--dsh-content-font-delta,0px));color:inherit;flex:none}@media (prefers-reduced-motion:reduce){._1_lb6a_row{transition:none}}";
|
|
100
|
+
document.head.appendChild(element);
|
|
101
|
+
}
|
|
102
|
+
var DisclosureRow_module_default = { "root": "_1_lb6a_root", "leading": "_1_lb6a_leading", "header": "_1_lb6a_header", "row": "_1_lb6a_row", "iconIdle": "_1_lb6a_iconIdle", "chevronHover": "_1_lb6a_chevronHover", "title": "_1_lb6a_title" };
|
|
103
|
+
|
|
104
|
+
// src/DisclosureRow.tsx
|
|
105
|
+
import { Fragment, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
106
|
+
var DisclosureRow = memo2(function DisclosureRow2({
|
|
107
|
+
icon,
|
|
108
|
+
title,
|
|
109
|
+
open,
|
|
110
|
+
expandable,
|
|
111
|
+
onToggle,
|
|
112
|
+
running = false,
|
|
113
|
+
expandOnRowClick = false,
|
|
114
|
+
previewChevron = expandable,
|
|
115
|
+
keepContentWhenOpen = false,
|
|
116
|
+
collapsedContent,
|
|
117
|
+
headerAccessory,
|
|
118
|
+
children,
|
|
119
|
+
className,
|
|
120
|
+
rowClassName,
|
|
121
|
+
contentClassName,
|
|
122
|
+
contentLayoutClassName,
|
|
123
|
+
leadingClassName,
|
|
124
|
+
chevronClassName,
|
|
125
|
+
titleClassName
|
|
126
|
+
}) {
|
|
127
|
+
const rowExpands = expandable && expandOnRowClick;
|
|
128
|
+
const toggleFromLeading = (event) => {
|
|
129
|
+
event.stopPropagation();
|
|
130
|
+
onToggle();
|
|
131
|
+
};
|
|
132
|
+
const toggleFromKeyboard = (event) => {
|
|
133
|
+
if (!rowExpands || event.key !== "Enter" && event.key !== " ") return;
|
|
134
|
+
event.preventDefault();
|
|
135
|
+
onToggle();
|
|
136
|
+
};
|
|
137
|
+
const collapsedLeading = previewChevron ? /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
138
|
+
/* @__PURE__ */ jsx2("span", { className: DisclosureRow_module_default.iconIdle, children: icon }),
|
|
139
|
+
/* @__PURE__ */ jsx2(IconChevronDownOutlineRegular, { className: clsx2(chevronClassName, DisclosureRow_module_default.chevronHover) })
|
|
140
|
+
] }) : icon;
|
|
141
|
+
const leading = open ? /* @__PURE__ */ jsx2(IconChevronUpOutlineRegular, { className: chevronClassName }) : collapsedLeading;
|
|
142
|
+
return /* @__PURE__ */ jsxs2("div", { className: clsx2(DisclosureRow_module_default.root, className), "data-open": open || void 0, children: [
|
|
143
|
+
/* @__PURE__ */ jsxs2("div", { className: DisclosureRow_module_default.header, "data-disclosure-header": true, "data-has-accessory": !!headerAccessory || void 0, children: [
|
|
144
|
+
/* @__PURE__ */ jsxs2(
|
|
145
|
+
"div",
|
|
146
|
+
{
|
|
147
|
+
className: clsx2(DisclosureRow_module_default.row, rowClassName),
|
|
148
|
+
"data-disclosure-row": true,
|
|
149
|
+
"data-expandable": rowExpands || void 0,
|
|
150
|
+
role: rowExpands ? "button" : void 0,
|
|
151
|
+
tabIndex: rowExpands ? 0 : void 0,
|
|
152
|
+
"aria-expanded": rowExpands ? open : void 0,
|
|
153
|
+
onClick: rowExpands ? onToggle : void 0,
|
|
154
|
+
onKeyDown: rowExpands ? toggleFromKeyboard : void 0,
|
|
155
|
+
children: [
|
|
156
|
+
expandable && !rowExpands ? /* @__PURE__ */ jsx2(
|
|
157
|
+
"button",
|
|
158
|
+
{
|
|
159
|
+
type: "button",
|
|
160
|
+
className: clsx2(DisclosureRow_module_default.leading, leadingClassName),
|
|
161
|
+
"aria-label": title,
|
|
162
|
+
"aria-expanded": open,
|
|
163
|
+
onClick: toggleFromLeading,
|
|
164
|
+
children: leading
|
|
165
|
+
}
|
|
166
|
+
) : /* @__PURE__ */ jsx2("span", { className: clsx2(DisclosureRow_module_default.leading, leadingClassName), children: leading }),
|
|
167
|
+
/* @__PURE__ */ jsxs2(TextShimmer, { active: running, className: contentClassName, contentClassName: contentLayoutClassName, children: [
|
|
168
|
+
/* @__PURE__ */ jsx2(TextShimmer, { className: clsx2(DisclosureRow_module_default.title, titleClassName), children: title }),
|
|
169
|
+
(keepContentWhenOpen || !open) && collapsedContent
|
|
170
|
+
] })
|
|
171
|
+
]
|
|
172
|
+
}
|
|
173
|
+
),
|
|
174
|
+
headerAccessory
|
|
175
|
+
] }),
|
|
176
|
+
open && children
|
|
177
|
+
] });
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
// src/SegmentedTabs.tsx
|
|
181
|
+
import clsx3 from "clsx";
|
|
182
|
+
|
|
183
|
+
// .build/css/SegmentedTabs.module.mjs
|
|
184
|
+
var id3 = "@seekbuddy/dsh-ui/SegmentedTabs.module.css";
|
|
185
|
+
if (typeof document !== "undefined" && !document.querySelector('style[data-dsh-ui-primitives="' + id3 + '"]')) {
|
|
186
|
+
const element = document.createElement("style");
|
|
187
|
+
element.setAttribute("data-dsh-ui-primitives", id3);
|
|
188
|
+
element.textContent = ".zfSGJW_tabs{--segmented-tabs-inset:4px;padding:var(--segmented-tabs-inset);border-radius:var(--dsw-radius-lg);background:var(--dsw-alias-bg-module-platform);display:grid;position:relative}.zfSGJW_indicator{inset:var(--segmented-tabs-inset) auto var(--segmented-tabs-inset) var(--segmented-tabs-inset);box-sizing:border-box;border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-3);pointer-events:none;transition:transform .18s;position:absolute}.zfSGJW_tab{border-radius:var(--dsw-radius-md);height:34px;color:var(--dsw-alias-label-secondary);background:0 0;justify-content:center;padding:0 12px;font-size:14px;line-height:20px;transition:color .18s;position:relative}.zfSGJW_tab[aria-selected=true]{color:var(--dsw-alias-label-primary);background:0 0}@media (hover:hover){.zfSGJW_tab:hover{color:var(--dsw-alias-label-primary);background:0 0}}.zfSGJW_tab[aria-selected=true]{font-weight:600}.zfSGJW_tabs[data-size=sm]{--segmented-tabs-inset:2px;border-radius:calc(var(--dsw-radius-md) + var(--segmented-tabs-inset))}.zfSGJW_tabs[data-size=sm] .zfSGJW_tab{height:30px}.zfSGJW_tabs[data-size=sm] .zfSGJW_tab[aria-selected=true]{font-weight:500}.zfSGJW_tab:focus-visible{text-underline-offset:4px;outline:none;text-decoration:underline 1px}@media (prefers-reduced-motion:reduce){.zfSGJW_indicator,.zfSGJW_tab{transition:none}}";
|
|
189
|
+
document.head.appendChild(element);
|
|
190
|
+
}
|
|
191
|
+
var SegmentedTabs_module_default = { "tabs": "zfSGJW_tabs", "tab": "zfSGJW_tab", "indicator": "zfSGJW_indicator" };
|
|
192
|
+
|
|
193
|
+
// src/SegmentedTabs.tsx
|
|
194
|
+
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
195
|
+
function SegmentedTabs({
|
|
196
|
+
items,
|
|
197
|
+
value,
|
|
198
|
+
onChange,
|
|
199
|
+
label,
|
|
200
|
+
className,
|
|
201
|
+
size = "md"
|
|
202
|
+
}) {
|
|
203
|
+
const selectedIndex = items.findIndex((item) => item.value === value);
|
|
204
|
+
const onKeyDown = (event, index) => {
|
|
205
|
+
let next;
|
|
206
|
+
switch (event.key) {
|
|
207
|
+
case "ArrowLeft":
|
|
208
|
+
next = (index + items.length - 1) % items.length;
|
|
209
|
+
break;
|
|
210
|
+
case "ArrowRight":
|
|
211
|
+
next = (index + 1) % items.length;
|
|
212
|
+
break;
|
|
213
|
+
case "Home":
|
|
214
|
+
next = 0;
|
|
215
|
+
break;
|
|
216
|
+
case "End":
|
|
217
|
+
next = items.length - 1;
|
|
218
|
+
break;
|
|
219
|
+
default:
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
event.preventDefault();
|
|
223
|
+
event.stopPropagation();
|
|
224
|
+
const tablist = event.currentTarget.parentElement;
|
|
225
|
+
const nextItem = items[next];
|
|
226
|
+
if (tablist === null || nextItem === void 0) return;
|
|
227
|
+
tablist.querySelectorAll('[role="tab"]').item(next).focus();
|
|
228
|
+
onChange(nextItem.value);
|
|
229
|
+
};
|
|
230
|
+
return /* @__PURE__ */ jsxs3(
|
|
231
|
+
"div",
|
|
232
|
+
{
|
|
233
|
+
role: "tablist",
|
|
234
|
+
"data-size": size,
|
|
235
|
+
"aria-label": label,
|
|
236
|
+
className: clsx3(SegmentedTabs_module_default.tabs, className),
|
|
237
|
+
style: { gridTemplateColumns: `repeat(${items.length}, minmax(0, 1fr))` },
|
|
238
|
+
children: [
|
|
239
|
+
/* @__PURE__ */ jsx3(
|
|
240
|
+
"span",
|
|
241
|
+
{
|
|
242
|
+
className: SegmentedTabs_module_default.indicator,
|
|
243
|
+
"aria-hidden": "true",
|
|
244
|
+
style: {
|
|
245
|
+
width: `calc((100% - 2 * var(--segmented-tabs-inset)) / ${items.length})`,
|
|
246
|
+
transform: `translateX(${selectedIndex * 100}%)`
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
),
|
|
250
|
+
items.map((item, index) => /* @__PURE__ */ jsx3(
|
|
251
|
+
Pill,
|
|
252
|
+
{
|
|
253
|
+
id: item.id,
|
|
254
|
+
role: "tab",
|
|
255
|
+
className: SegmentedTabs_module_default.tab,
|
|
256
|
+
"aria-selected": value === item.value,
|
|
257
|
+
"aria-controls": item.panelId,
|
|
258
|
+
tabIndex: value === item.value ? 0 : -1,
|
|
259
|
+
onClick: () => {
|
|
260
|
+
onChange(item.value);
|
|
261
|
+
},
|
|
262
|
+
onKeyDown: (event) => {
|
|
263
|
+
onKeyDown(event, index);
|
|
264
|
+
},
|
|
265
|
+
children: item.label
|
|
266
|
+
},
|
|
267
|
+
item.value
|
|
268
|
+
))
|
|
269
|
+
]
|
|
270
|
+
}
|
|
271
|
+
);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
// src/Tag.tsx
|
|
275
|
+
import clsx4 from "clsx";
|
|
276
|
+
|
|
277
|
+
// .build/css/Tag.module.mjs
|
|
278
|
+
var id4 = "@seekbuddy/dsh-ui/Tag.module.css";
|
|
279
|
+
if (typeof document !== "undefined" && !document.querySelector('style[data-dsh-ui-primitives="' + id4 + '"]')) {
|
|
280
|
+
const element = document.createElement("style");
|
|
281
|
+
element.setAttribute("data-dsh-ui-primitives", id4);
|
|
282
|
+
element.textContent = ".bkMBDa_tag{corner-shape:round;white-space:nowrap;border-radius:999px;align-items:center;padding:1px 8px;font-size:11px;font-weight:500;line-height:17px;display:inline-flex}.bkMBDa_tag[data-tone=outline]{border:.5px solid var(--dsw-alias-border-l4);color:var(--dsw-alias-label-tertiary)}.bkMBDa_tag[data-tone=solid]{background:var(--dsw-alias-label-primary);color:var(--dsw-alias-bg-layer-3)}.bkMBDa_tag[data-tone=neutral]{background:var(--dsw-alias-bg-module-platform);color:var(--dsw-alias-label-secondary)}.bkMBDa_tag[data-tone=quiet]{color:var(--dsw-alias-label-tertiary)}.bkMBDa_tag[data-tone=success]{background:color-mix(in srgb, var(--dsw-alias-state-success-primary) 10%, transparent);color:var(--dsw-alias-state-success-primary)}.bkMBDa_tag[data-tone=info]{background:color-mix(in srgb, var(--dsw-alias-state-business-primary) 10%, transparent);color:var(--dsw-alias-state-business-primary)}.bkMBDa_tag[data-tone=warning]{background:color-mix(in srgb, var(--dsw-alias-state-warn-primary) 12%, transparent);color:var(--dsw-alias-state-warn-primary)}.bkMBDa_tag[data-tone=danger]{background:color-mix(in srgb, var(--dsw-alias-state-error-primary) 10%, transparent);color:var(--dsw-alias-state-error-primary)}";
|
|
283
|
+
document.head.appendChild(element);
|
|
284
|
+
}
|
|
285
|
+
var Tag_module_default = { "tag": "bkMBDa_tag" };
|
|
286
|
+
|
|
287
|
+
// src/Tag.tsx
|
|
288
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
289
|
+
function Tag({
|
|
290
|
+
tone = "outline",
|
|
291
|
+
className,
|
|
292
|
+
children
|
|
293
|
+
}) {
|
|
294
|
+
return /* @__PURE__ */ jsx4("span", { className: clsx4(Tag_module_default.tag, className), "data-tone": tone, children });
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
// src/Switch.tsx
|
|
298
|
+
import clsx5 from "clsx";
|
|
299
|
+
|
|
300
|
+
// .build/css/Switch.module.mjs
|
|
301
|
+
var id5 = "@seekbuddy/dsh-ui/Switch.module.css";
|
|
302
|
+
if (typeof document !== "undefined" && !document.querySelector('style[data-dsh-ui-primitives="' + id5 + '"]')) {
|
|
303
|
+
const element = document.createElement("style");
|
|
304
|
+
element.setAttribute("data-dsh-ui-primitives", id5);
|
|
305
|
+
element.textContent = ".POxp2W_switch{box-sizing:border-box;corner-shape:round;background:var(--dsw-alias-border-l3);cursor:pointer;border:0;border-radius:999px;flex:none;width:36px;height:20px;padding:2px;position:relative}.POxp2W_switch[aria-checked=true]{background:var(--dsw-alias-brand-primary)}.POxp2W_switch:disabled{cursor:default;opacity:.5}.POxp2W_switch:focus-visible{outline:var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:2px}.POxp2W_thumb{corner-shape:round;background:var(--dsw-alias-label-primary-foreground);border-radius:50%;width:16px;height:16px;transition:transform .12s;display:block}.POxp2W_switch[aria-checked=false] .POxp2W_thumb{background:var(--dsw-alias-switch-thumb)}.POxp2W_switch[aria-checked=true] .POxp2W_thumb{transform:translate(16px)}";
|
|
306
|
+
document.head.appendChild(element);
|
|
307
|
+
}
|
|
308
|
+
var Switch_module_default = { "switch": "POxp2W_switch", "thumb": "POxp2W_thumb" };
|
|
309
|
+
|
|
310
|
+
// src/Switch.tsx
|
|
311
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
312
|
+
function Switch({
|
|
313
|
+
checked,
|
|
314
|
+
onChange,
|
|
315
|
+
label,
|
|
316
|
+
disabled = false,
|
|
317
|
+
title,
|
|
318
|
+
className
|
|
319
|
+
}) {
|
|
320
|
+
return /* @__PURE__ */ jsx5(
|
|
321
|
+
"button",
|
|
322
|
+
{
|
|
323
|
+
type: "button",
|
|
324
|
+
role: "switch",
|
|
325
|
+
"aria-checked": checked,
|
|
326
|
+
"aria-label": label,
|
|
327
|
+
title,
|
|
328
|
+
disabled,
|
|
329
|
+
className: clsx5(Switch_module_default.switch, className),
|
|
330
|
+
onClick: () => {
|
|
331
|
+
onChange(!checked);
|
|
332
|
+
},
|
|
333
|
+
children: /* @__PURE__ */ jsx5("span", { className: Switch_module_default.thumb })
|
|
334
|
+
}
|
|
335
|
+
);
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
// src/SegmentedControl.tsx
|
|
339
|
+
import { useEffect, useRef } from "react";
|
|
340
|
+
import clsx6 from "clsx";
|
|
341
|
+
|
|
342
|
+
// .build/css/SegmentedControl.module.mjs
|
|
343
|
+
var id6 = "@seekbuddy/dsh-ui/SegmentedControl.module.css";
|
|
344
|
+
if (typeof document !== "undefined" && !document.querySelector('style[data-dsh-ui-primitives="' + id6 + '"]')) {
|
|
345
|
+
const element = document.createElement("style");
|
|
346
|
+
element.setAttribute("data-dsh-ui-primitives", id6);
|
|
347
|
+
element.textContent = "._4Yr7Ka_control{border-radius:var(--dsw-radius-md);background:var(--dsw-alias-interactive-bg-hover);grid-auto-columns:1fr;grid-auto-flow:column;gap:2px;padding:4px;display:inline-grid;position:relative}._4Yr7Ka_indicator{width:calc((100% - 8px - 2px * (var(--dsh-segment-count) - 1)) / var(--dsh-segment-count));border-radius:var(--dsw-radius-sm);background:var(--dsw-alias-bg-layer-1);height:calc(100% - 8px);box-shadow:var(--dsw-elevation-soft);transform:translateX(calc(var(--dsh-segment-index) * (100% + 2px)));pointer-events:none;border:0;transition:transform .16s;position:absolute;top:4px;left:4px}._4Yr7Ka_tab{box-sizing:border-box;z-index:1;border-radius:var(--dsw-radius-sm);height:28px;color:var(--dsw-alias-label-secondary);font:inherit;white-space:nowrap;cursor:pointer;background:0 0;border:0;padding:0 16px;font-size:13px;font-weight:500;line-height:20px;transition:color .12s;position:relative}._4Yr7Ka_tab[aria-selected=true]{color:var(--dsw-alias-label-primary)}@media (hover:hover){._4Yr7Ka_tab:hover:not(:disabled){color:var(--dsw-alias-label-primary)}}._4Yr7Ka_tab:disabled{cursor:default;opacity:.4}._4Yr7Ka_tab:focus-visible{outline:var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:-2px}@media (prefers-reduced-motion:reduce){._4Yr7Ka_indicator,._4Yr7Ka_tab{transition:none}}";
|
|
348
|
+
document.head.appendChild(element);
|
|
349
|
+
}
|
|
350
|
+
var SegmentedControl_module_default = { "control": "_4Yr7Ka_control", "indicator": "_4Yr7Ka_indicator", "tab": "_4Yr7Ka_tab" };
|
|
351
|
+
|
|
352
|
+
// src/SegmentedControl.tsx
|
|
353
|
+
import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
354
|
+
function isWalkKey(key) {
|
|
355
|
+
return key === "ArrowLeft" || key === "ArrowRight" || key === "ArrowUp" || key === "ArrowDown" || key === "Home" || key === "End";
|
|
356
|
+
}
|
|
357
|
+
function walk(options, from, key) {
|
|
358
|
+
const enabled = options.filter((option) => option.disabled !== true);
|
|
359
|
+
if (key === "Home") return enabled[0];
|
|
360
|
+
if (key === "End") return enabled[enabled.length - 1];
|
|
361
|
+
const step = key === "ArrowRight" || key === "ArrowDown" ? 1 : -1;
|
|
362
|
+
const count = options.length;
|
|
363
|
+
for (let offset = 1; offset < count; offset += 1) {
|
|
364
|
+
const candidate = options[((from + step * offset) % count + count) % count];
|
|
365
|
+
if (candidate !== void 0 && candidate.disabled !== true) return candidate;
|
|
366
|
+
}
|
|
367
|
+
return void 0;
|
|
368
|
+
}
|
|
369
|
+
function SegmentedControl({
|
|
370
|
+
id: id21,
|
|
371
|
+
value,
|
|
372
|
+
options,
|
|
373
|
+
onChange,
|
|
374
|
+
label,
|
|
375
|
+
disabled = false,
|
|
376
|
+
className
|
|
377
|
+
}) {
|
|
378
|
+
const list = useRef(null);
|
|
379
|
+
const selected = options.findIndex((option) => option.value === value);
|
|
380
|
+
useEffect(() => {
|
|
381
|
+
const root = list.current;
|
|
382
|
+
if (root === null) return;
|
|
383
|
+
if (!root.contains(document.activeElement)) return;
|
|
384
|
+
root.querySelector('[role="tab"][aria-selected="true"]')?.focus();
|
|
385
|
+
}, [value]);
|
|
386
|
+
const onKeyDown = (event) => {
|
|
387
|
+
if (!isWalkKey(event.key)) return;
|
|
388
|
+
event.preventDefault();
|
|
389
|
+
const target = walk(options, selected, event.key);
|
|
390
|
+
if (target !== void 0 && target.value !== value) onChange(target.value);
|
|
391
|
+
};
|
|
392
|
+
const indicator = {
|
|
393
|
+
"--dsh-segment-count": String(options.length),
|
|
394
|
+
"--dsh-segment-index": String(selected)
|
|
395
|
+
};
|
|
396
|
+
return /* @__PURE__ */ jsxs4("div", { ref: list, role: "tablist", "aria-label": label, className: clsx6(SegmentedControl_module_default.control, className), style: indicator, children: [
|
|
397
|
+
/* @__PURE__ */ jsx6("span", { "aria-hidden": "true", className: SegmentedControl_module_default.indicator }),
|
|
398
|
+
options.map((option) => {
|
|
399
|
+
const active = option.value === value;
|
|
400
|
+
return /* @__PURE__ */ jsx6(
|
|
401
|
+
"button",
|
|
402
|
+
{
|
|
403
|
+
id: `${id21}-${option.value}`,
|
|
404
|
+
type: "button",
|
|
405
|
+
role: "tab",
|
|
406
|
+
"aria-selected": active,
|
|
407
|
+
"aria-controls": `${id21}-${option.value}-panel`,
|
|
408
|
+
tabIndex: active ? 0 : -1,
|
|
409
|
+
disabled: disabled || option.disabled === true,
|
|
410
|
+
title: option.title,
|
|
411
|
+
className: SegmentedControl_module_default.tab,
|
|
412
|
+
onClick: () => {
|
|
413
|
+
if (!active) onChange(option.value);
|
|
414
|
+
},
|
|
415
|
+
onKeyDown,
|
|
416
|
+
children: option.label
|
|
417
|
+
},
|
|
418
|
+
option.value
|
|
419
|
+
);
|
|
420
|
+
})
|
|
421
|
+
] });
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
// src/Checkbox.tsx
|
|
425
|
+
import clsx7 from "clsx";
|
|
426
|
+
|
|
427
|
+
// .build/css/Checkbox.module.mjs
|
|
428
|
+
var id7 = "@seekbuddy/dsh-ui/Checkbox.module.css";
|
|
429
|
+
if (typeof document !== "undefined" && !document.querySelector('style[data-dsh-ui-primitives="' + id7 + '"]')) {
|
|
430
|
+
const element = document.createElement("style");
|
|
431
|
+
element.setAttribute("data-dsh-ui-primitives", id7);
|
|
432
|
+
element.textContent = ".-IUgPq_checkbox{color:var(--dsw-alias-label-primary);cursor:pointer;align-items:center;gap:6px;font-size:14px;line-height:20px;display:inline-flex}.-IUgPq_checkbox input{width:16px;height:16px;accent-color:var(--dsw-alias-brand-primary);cursor:inherit;flex:none;margin:0}.-IUgPq_checkbox input:focus-visible{outline:var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:2px}.-IUgPq_checkbox:has(input:disabled){cursor:default;opacity:.5}";
|
|
433
|
+
document.head.appendChild(element);
|
|
434
|
+
}
|
|
435
|
+
var Checkbox_module_default = { "checkbox": "-IUgPq_checkbox" };
|
|
436
|
+
|
|
437
|
+
// src/Checkbox.tsx
|
|
438
|
+
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
439
|
+
function Checkbox({
|
|
440
|
+
checked,
|
|
441
|
+
onChange,
|
|
442
|
+
label,
|
|
443
|
+
disabled = false,
|
|
444
|
+
title,
|
|
445
|
+
className
|
|
446
|
+
}) {
|
|
447
|
+
return /* @__PURE__ */ jsxs5("label", { className: clsx7(Checkbox_module_default.checkbox, className), title, children: [
|
|
448
|
+
/* @__PURE__ */ jsx7(
|
|
449
|
+
"input",
|
|
450
|
+
{
|
|
451
|
+
type: "checkbox",
|
|
452
|
+
checked,
|
|
453
|
+
disabled,
|
|
454
|
+
onChange: (event) => {
|
|
455
|
+
onChange(event.target.checked);
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
),
|
|
459
|
+
/* @__PURE__ */ jsx7("span", { children: label })
|
|
460
|
+
] });
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
// src/Input.tsx
|
|
464
|
+
import { forwardRef } from "react";
|
|
465
|
+
import clsx8 from "clsx";
|
|
466
|
+
|
|
467
|
+
// .build/css/Input.module.mjs
|
|
468
|
+
var id8 = "@seekbuddy/dsh-ui/Input.module.css";
|
|
469
|
+
if (typeof document !== "undefined" && !document.querySelector('style[data-dsh-ui-primitives="' + id8 + '"]')) {
|
|
470
|
+
const element = document.createElement("style");
|
|
471
|
+
element.setAttribute("data-dsh-ui-primitives", id8);
|
|
472
|
+
element.textContent = ".ubd6La_wrap{border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-1);align-items:center;gap:6px;height:32px;padding:0 8px;display:inline-flex}.ubd6La_wrap:focus-within{border-color:var(--dsw-alias-state-business-primary)}.ubd6La_icon{width:16px;height:16px;color:var(--dsw-alias-label-tertiary);justify-content:center;align-items:center;display:inline-flex}.ubd6La_input{min-width:0;color:var(--dsw-alias-label-primary);background:0 0;border:none;outline:none;flex:1;font-size:14px;line-height:22px}.ubd6La_input::placeholder{color:var(--dsw-alias-label-dimmed)}";
|
|
473
|
+
document.head.appendChild(element);
|
|
474
|
+
}
|
|
475
|
+
var Input_module_default = { "input": "ubd6La_input", "icon": "ubd6La_icon", "wrap": "ubd6La_wrap" };
|
|
476
|
+
|
|
477
|
+
// src/Input.tsx
|
|
478
|
+
import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
479
|
+
var Input = forwardRef(function Input2({ icon, className, ...rest }, ref) {
|
|
480
|
+
return /* @__PURE__ */ jsxs6("span", { className: clsx8(Input_module_default.wrap, className), children: [
|
|
481
|
+
icon != null && /* @__PURE__ */ jsx8("span", { className: Input_module_default.icon, children: icon }),
|
|
482
|
+
/* @__PURE__ */ jsx8("input", { ref, className: Input_module_default.input, ...rest })
|
|
483
|
+
] });
|
|
484
|
+
});
|
|
485
|
+
|
|
486
|
+
// src/MenuGroup.tsx
|
|
487
|
+
import { useId } from "react";
|
|
488
|
+
|
|
489
|
+
// .build/css/MenuGroup.module.mjs
|
|
490
|
+
var id9 = "@seekbuddy/dsh-ui/MenuGroup.module.css";
|
|
491
|
+
if (typeof document !== "undefined" && !document.querySelector('style[data-dsh-ui-primitives="' + id9 + '"]')) {
|
|
492
|
+
const element = document.createElement("style");
|
|
493
|
+
element.setAttribute("data-dsh-ui-primitives", id9);
|
|
494
|
+
element.textContent = ".EvD5wW_group{position:relative}.EvD5wW_start{opacity:0;pointer-events:none;width:1px;height:1px;position:absolute;top:0;left:0}.EvD5wW_group+.EvD5wW_group{margin-top:3px}.EvD5wW_heading{z-index:1;color:var(--dsw-alias-label-tertiary);background:0 0;padding:4px 7px 2px;font-size:11px;font-weight:500;line-height:16px;position:sticky;top:0}.EvD5wW_heading[data-stuck]{background:var(--dsw-alias-menu-group-header-fill)}html:not([data-platform=darwin]) .EvD5wW_heading{border-radius:var(--dsw-radius-md)}";
|
|
495
|
+
document.head.appendChild(element);
|
|
496
|
+
}
|
|
497
|
+
var MenuGroup_module_default = { "group": "EvD5wW_group", "start": "EvD5wW_start", "heading": "EvD5wW_heading" };
|
|
498
|
+
|
|
499
|
+
// src/MenuGroup.tsx
|
|
500
|
+
import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
501
|
+
function MenuGroup({ label, children }) {
|
|
502
|
+
const headingId = useId();
|
|
503
|
+
return /* @__PURE__ */ jsxs7("section", { role: "group", "aria-labelledby": headingId, "data-menu-group": "", className: MenuGroup_module_default.group, children: [
|
|
504
|
+
/* @__PURE__ */ jsx9("span", { "aria-hidden": "true", "data-menu-group-start": "", className: MenuGroup_module_default.start }),
|
|
505
|
+
/* @__PURE__ */ jsx9("div", { id: headingId, "data-menu-group-heading": "", className: MenuGroup_module_default.heading, children: label }),
|
|
506
|
+
children
|
|
507
|
+
] });
|
|
508
|
+
}
|
|
509
|
+
function observeStickyMenuGroups(viewport) {
|
|
510
|
+
const groups = [...viewport.querySelectorAll(":scope > [data-menu-group]")].flatMap((section) => {
|
|
511
|
+
const heading = section.querySelector(":scope > [data-menu-group-heading]");
|
|
512
|
+
const start = section.querySelector(":scope > [data-menu-group-start]");
|
|
513
|
+
return heading === null || start === null ? [] : [
|
|
514
|
+
{
|
|
515
|
+
section,
|
|
516
|
+
heading,
|
|
517
|
+
start,
|
|
518
|
+
atTop: false,
|
|
519
|
+
above: false,
|
|
520
|
+
topTime: -Infinity,
|
|
521
|
+
aboveTime: -Infinity
|
|
522
|
+
}
|
|
523
|
+
];
|
|
524
|
+
});
|
|
525
|
+
if (groups.length === 0 || typeof IntersectionObserver === "undefined" || typeof ResizeObserver === "undefined") {
|
|
526
|
+
return () => {
|
|
527
|
+
};
|
|
528
|
+
}
|
|
529
|
+
const sections = new Map(groups.map((group) => [group.section, group]));
|
|
530
|
+
const starts = new Map(groups.map((group) => [group.start, group]));
|
|
531
|
+
let disposed = false;
|
|
532
|
+
let stripObserver;
|
|
533
|
+
let viewportHeight;
|
|
534
|
+
const render = (group) => {
|
|
535
|
+
const stuck = group.atTop && group.above;
|
|
536
|
+
if (group.heading.hasAttribute("data-stuck") !== stuck) group.heading.toggleAttribute("data-stuck", stuck);
|
|
537
|
+
};
|
|
538
|
+
const startObserver = new IntersectionObserver(
|
|
539
|
+
(entries) => {
|
|
540
|
+
if (disposed) return;
|
|
541
|
+
for (const entry of entries) {
|
|
542
|
+
const group = starts.get(entry.target);
|
|
543
|
+
if (!group || entry.rootBounds === null || entry.time < group.aboveTime) continue;
|
|
544
|
+
group.above = entry.boundingClientRect.top < entry.rootBounds.top;
|
|
545
|
+
group.aboveTime = entry.time;
|
|
546
|
+
render(group);
|
|
547
|
+
}
|
|
548
|
+
},
|
|
549
|
+
{ root: viewport, threshold: [0, 1] }
|
|
550
|
+
);
|
|
551
|
+
for (const { start } of groups) startObserver.observe(start);
|
|
552
|
+
const sizeObserver = new ResizeObserver((entries) => {
|
|
553
|
+
if (disposed) return;
|
|
554
|
+
for (const entry of entries) {
|
|
555
|
+
if (entry.target !== viewport || entry.contentRect.height === viewportHeight) continue;
|
|
556
|
+
viewportHeight = entry.contentRect.height;
|
|
557
|
+
stripObserver?.disconnect();
|
|
558
|
+
const observer = new IntersectionObserver(
|
|
559
|
+
(intersections) => {
|
|
560
|
+
if (disposed || stripObserver !== observer) return;
|
|
561
|
+
for (const intersection of intersections) {
|
|
562
|
+
const group = sections.get(intersection.target);
|
|
563
|
+
if (!group || intersection.rootBounds === null) continue;
|
|
564
|
+
const top = intersection.rootBounds.top;
|
|
565
|
+
if (intersection.time >= group.topTime) {
|
|
566
|
+
group.atTop = intersection.isIntersecting && intersection.boundingClientRect.bottom > top;
|
|
567
|
+
group.topTime = intersection.time;
|
|
568
|
+
}
|
|
569
|
+
if (intersection.time >= group.aboveTime) {
|
|
570
|
+
group.above = intersection.boundingClientRect.top < top;
|
|
571
|
+
group.aboveTime = intersection.time;
|
|
572
|
+
}
|
|
573
|
+
render(group);
|
|
574
|
+
}
|
|
575
|
+
},
|
|
576
|
+
{ root: viewport, rootMargin: `0px 0px ${Math.min(1, viewportHeight) - viewportHeight}px 0px`, threshold: 0 }
|
|
577
|
+
);
|
|
578
|
+
stripObserver = observer;
|
|
579
|
+
for (const { section } of groups) observer.observe(section);
|
|
580
|
+
}
|
|
581
|
+
});
|
|
582
|
+
sizeObserver.observe(viewport);
|
|
583
|
+
return () => {
|
|
584
|
+
if (disposed) return;
|
|
585
|
+
disposed = true;
|
|
586
|
+
startObserver.disconnect();
|
|
587
|
+
stripObserver?.disconnect();
|
|
588
|
+
sizeObserver.disconnect();
|
|
589
|
+
for (const { heading } of groups) {
|
|
590
|
+
if (heading.hasAttribute("data-stuck")) heading.removeAttribute("data-stuck");
|
|
591
|
+
}
|
|
592
|
+
};
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
// src/useAnchoredMaxHeight.ts
|
|
596
|
+
import { useLayoutEffect, useState } from "react";
|
|
597
|
+
var MARGIN = 12;
|
|
598
|
+
function useAnchoredMaxHeight(ref, cap, signal, margin = MARGIN) {
|
|
599
|
+
const [maxHeight, setMaxHeight] = useState(cap);
|
|
600
|
+
useLayoutEffect(() => {
|
|
601
|
+
const el = ref.current;
|
|
602
|
+
if (el === null) return;
|
|
603
|
+
const fit = () => {
|
|
604
|
+
setMaxHeight(Math.min(cap, Math.max(0, el.getBoundingClientRect().bottom - overlayTopMargin(margin))));
|
|
605
|
+
};
|
|
606
|
+
fit();
|
|
607
|
+
window.addEventListener("resize", fit);
|
|
608
|
+
window.addEventListener("scroll", fit, true);
|
|
609
|
+
return () => {
|
|
610
|
+
window.removeEventListener("resize", fit);
|
|
611
|
+
window.removeEventListener("scroll", fit, true);
|
|
612
|
+
};
|
|
613
|
+
}, [ref, cap, signal, margin]);
|
|
614
|
+
return maxHeight;
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
// src/Modal.tsx
|
|
618
|
+
import { useRef as useRef2 } from "react";
|
|
619
|
+
import { createPortal } from "react-dom";
|
|
620
|
+
import clsx9 from "clsx";
|
|
621
|
+
|
|
622
|
+
// .build/css/Modal.module.mjs
|
|
623
|
+
var id10 = "@seekbuddy/dsh-ui/Modal.module.css";
|
|
624
|
+
if (typeof document !== "undefined" && !document.querySelector('style[data-dsh-ui-primitives="' + id10 + '"]')) {
|
|
625
|
+
const element = document.createElement("style");
|
|
626
|
+
element.setAttribute("data-dsh-ui-primitives", id10);
|
|
627
|
+
element.textContent = '.yOh8dq_root{pointer-events:auto;z-index:1000;padding:max(24px, var(--dsh-frame-overlay-top,24px)) 24px;justify-content:center;align-items:center;display:flex;position:fixed;inset:0}.yOh8dq_mask{inset:var(--dsh-frame-chrome-top,0px) 0 0;backdrop-filter:var(--dsw-mask-blur);position:absolute}.yOh8dq_mask:after{content:"";background:var(--dsw-alias-bg-mask-1);animation:yOh8dq_modalEnter var(--ds-transition-duration) var(--ds-ease-in-out);position:absolute;inset:0}.yOh8dq_dialog{box-sizing:border-box;z-index:1;border-radius:var(--dsw-radius-panel);background:var(--dsw-alias-bg-layer-2);width:min(380px,100%);box-shadow:var(--dsw-elevation-prominent);animation:yOh8dq_modalEnter var(--ds-transition-duration) var(--ds-ease-in-out);border:0;flex-direction:column;gap:20px;padding:0 0 24px;display:flex;position:relative;overflow:hidden}@keyframes yOh8dq_modalEnter{0%{opacity:0}to{opacity:1}}@media (prefers-reduced-motion:reduce){.yOh8dq_mask:after,.yOh8dq_dialog{animation:none}}.yOh8dq_dialog:focus{outline:none}.yOh8dq_content{flex-direction:column;width:100%;display:flex}.yOh8dq_header{justify-content:space-between;align-items:center;gap:8px;padding:22px 14px 12px 24px;display:flex}.yOh8dq_title{color:var(--dsw-alias-label-primary);margin:0;font-size:16px;font-weight:500;line-height:24px}.yOh8dq_close{border-radius:var(--dsw-radius-sm);cursor:pointer;width:28px;height:28px;color:var(--dsw-alias-label-secondary);background:0 0;border:none;flex:none;justify-content:center;align-items:center;display:inline-flex}@media (hover:hover){.yOh8dq_close:hover{background:var(--dsw-alias-interactive-bg-hover)}}.yOh8dq_description{color:var(--dsw-alias-label-primary);margin:0;padding:0 24px;font-size:14px;font-weight:400;line-height:22px}.yOh8dq_body{flex-direction:column;min-width:0;margin-top:20px;padding:0 24px;display:flex}.yOh8dq_footer{justify-content:flex-end;align-items:center;gap:8px;padding:0 24px;display:flex}';
|
|
628
|
+
document.head.appendChild(element);
|
|
629
|
+
}
|
|
630
|
+
var Modal_module_default = { "dialog": "yOh8dq_dialog", "mask": "yOh8dq_mask", "content": "yOh8dq_content", "close": "yOh8dq_close", "footer": "yOh8dq_footer", "body": "yOh8dq_body", "title": "yOh8dq_title", "header": "yOh8dq_header", "root": "yOh8dq_root", "modalEnter": "yOh8dq_modalEnter", "description": "yOh8dq_description" };
|
|
631
|
+
|
|
632
|
+
// src/Modal.tsx
|
|
633
|
+
import { Fragment as Fragment2, jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
634
|
+
function Modal({
|
|
635
|
+
open,
|
|
636
|
+
onClose,
|
|
637
|
+
title,
|
|
638
|
+
closeLabel,
|
|
639
|
+
description,
|
|
640
|
+
children,
|
|
641
|
+
footer,
|
|
642
|
+
className,
|
|
643
|
+
contentClassName,
|
|
644
|
+
onKeyDownCapture,
|
|
645
|
+
headless = false,
|
|
646
|
+
backdropBlur = true,
|
|
647
|
+
shortcutModal
|
|
648
|
+
}) {
|
|
649
|
+
const dialog = useRef2(null);
|
|
650
|
+
useModalLayer(dialog, open, onClose);
|
|
651
|
+
if (!open) return null;
|
|
652
|
+
return createPortal(
|
|
653
|
+
/* @__PURE__ */ jsxs8("div", { className: Modal_module_default.root, role: "presentation", onKeyDownCapture, children: [
|
|
654
|
+
/* @__PURE__ */ jsx10(
|
|
655
|
+
"div",
|
|
656
|
+
{
|
|
657
|
+
className: Modal_module_default.mask,
|
|
658
|
+
style: backdropBlur ? void 0 : { backdropFilter: "none" },
|
|
659
|
+
"aria-hidden": "true",
|
|
660
|
+
onClick: onClose
|
|
661
|
+
}
|
|
662
|
+
),
|
|
663
|
+
/* @__PURE__ */ jsx10(
|
|
664
|
+
"div",
|
|
665
|
+
{
|
|
666
|
+
ref: dialog,
|
|
667
|
+
tabIndex: -1,
|
|
668
|
+
"data-shortcut-modal": shortcutModal,
|
|
669
|
+
className: clsx9(Modal_module_default.dialog, className),
|
|
670
|
+
role: "dialog",
|
|
671
|
+
"aria-modal": "true",
|
|
672
|
+
"aria-label": title,
|
|
673
|
+
children: headless ? children : /* @__PURE__ */ jsxs8(Fragment2, { children: [
|
|
674
|
+
/* @__PURE__ */ jsxs8("div", { className: clsx9(Modal_module_default.content, contentClassName), children: [
|
|
675
|
+
/* @__PURE__ */ jsxs8("div", { className: Modal_module_default.header, children: [
|
|
676
|
+
/* @__PURE__ */ jsx10("h2", { className: Modal_module_default.title, children: title }),
|
|
677
|
+
/* @__PURE__ */ jsx10("button", { type: "button", className: Modal_module_default.close, "aria-label": closeLabel, onClick: onClose, children: /* @__PURE__ */ jsx10(IconCloseOutlineRegular, { size: 14 }) })
|
|
678
|
+
] }),
|
|
679
|
+
description !== void 0 && description !== "" && /* @__PURE__ */ jsx10("p", { className: Modal_module_default.description, children: description }),
|
|
680
|
+
children !== void 0 && /* @__PURE__ */ jsx10("div", { className: Modal_module_default.body, children })
|
|
681
|
+
] }),
|
|
682
|
+
footer !== void 0 && /* @__PURE__ */ jsx10("div", { className: Modal_module_default.footer, children: footer })
|
|
683
|
+
] })
|
|
684
|
+
}
|
|
685
|
+
)
|
|
686
|
+
] }),
|
|
687
|
+
document.body
|
|
688
|
+
);
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
// .build/css/RiskConfirmation.module.mjs
|
|
692
|
+
var id11 = "@seekbuddy/dsh-ui/RiskConfirmation.module.css";
|
|
693
|
+
if (typeof document !== "undefined" && !document.querySelector('style[data-dsh-ui-primitives="' + id11 + '"]')) {
|
|
694
|
+
const element = document.createElement("style");
|
|
695
|
+
element.setAttribute("data-dsh-ui-primitives", id11);
|
|
696
|
+
element.textContent = ".scdcKa_confirmation{width:min(440px,100%);max-height:100%;overflow:hidden}.scdcKa_confirmationContent{overscroll-behavior:contain;min-height:0;overflow-y:auto}@supports (height:100dvh){.scdcKa_confirmation{max-height:calc(100dvh - 48px)}}.scdcKa_warning{color:var(--dsw-alias-label-secondary);align-items:flex-start;gap:10px;font-size:14px;line-height:22px;display:flex}.scdcKa_warning p{margin:0}.scdcKa_warningIcon{color:var(--dsw-alias-state-error-primary);flex:none;margin-top:2px}.scdcKa_acknowledgement{color:var(--dsw-alias-label-primary);cursor:pointer;align-items:flex-start;gap:10px;margin-top:20px;font-size:14px;line-height:22px;display:flex}.scdcKa_acknowledgement input{width:16px;height:16px;accent-color:var(--dsw-alias-button-primary-fill);cursor:pointer;flex:none;margin:3px 0 0}.scdcKa_acknowledgement input:focus-visible{outline:var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:2px}.scdcKa_acknowledgement input:disabled{cursor:default}.scdcKa_modalAction{min-width:72px}.scdcKa_confirmAction{min-width:136px}";
|
|
697
|
+
document.head.appendChild(element);
|
|
698
|
+
}
|
|
699
|
+
var RiskConfirmation_module_default = { "confirmation": "scdcKa_confirmation", "warningIcon": "scdcKa_warningIcon", "acknowledgement": "scdcKa_acknowledgement", "modalAction": "scdcKa_modalAction", "warning": "scdcKa_warning", "confirmationContent": "scdcKa_confirmationContent", "confirmAction": "scdcKa_confirmAction" };
|
|
700
|
+
|
|
701
|
+
// src/RiskConfirmation.tsx
|
|
702
|
+
import { Fragment as Fragment3, jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
703
|
+
function RiskConfirmation({
|
|
704
|
+
open,
|
|
705
|
+
title,
|
|
706
|
+
description,
|
|
707
|
+
acknowledgeLabel,
|
|
708
|
+
cancelLabel,
|
|
709
|
+
closeLabel,
|
|
710
|
+
confirmLabel,
|
|
711
|
+
acknowledged,
|
|
712
|
+
disabled = false,
|
|
713
|
+
onAcknowledgedChange,
|
|
714
|
+
onCancel,
|
|
715
|
+
onConfirm
|
|
716
|
+
}) {
|
|
717
|
+
return /* @__PURE__ */ jsxs9(
|
|
718
|
+
Modal,
|
|
719
|
+
{
|
|
720
|
+
open,
|
|
721
|
+
onClose: onCancel,
|
|
722
|
+
title,
|
|
723
|
+
closeLabel,
|
|
724
|
+
className: RiskConfirmation_module_default.confirmation ?? "",
|
|
725
|
+
contentClassName: RiskConfirmation_module_default.confirmationContent ?? "",
|
|
726
|
+
footer: /* @__PURE__ */ jsxs9(Fragment3, { children: [
|
|
727
|
+
/* @__PURE__ */ jsx11(Button, { variant: "outline", className: RiskConfirmation_module_default.modalAction, onClick: onCancel, children: cancelLabel }),
|
|
728
|
+
/* @__PURE__ */ jsx11(
|
|
729
|
+
Button,
|
|
730
|
+
{
|
|
731
|
+
variant: "primary",
|
|
732
|
+
className: RiskConfirmation_module_default.confirmAction,
|
|
733
|
+
disabled: disabled || !acknowledged,
|
|
734
|
+
onClick: onConfirm,
|
|
735
|
+
children: confirmLabel
|
|
736
|
+
}
|
|
737
|
+
)
|
|
738
|
+
] }),
|
|
739
|
+
children: [
|
|
740
|
+
/* @__PURE__ */ jsxs9("div", { className: RiskConfirmation_module_default.warning, children: [
|
|
741
|
+
/* @__PURE__ */ jsx11(IconWarningOutlineRegular, { size: 18, className: RiskConfirmation_module_default.warningIcon }),
|
|
742
|
+
/* @__PURE__ */ jsx11("p", { children: description })
|
|
743
|
+
] }),
|
|
744
|
+
/* @__PURE__ */ jsxs9("label", { className: RiskConfirmation_module_default.acknowledgement, children: [
|
|
745
|
+
/* @__PURE__ */ jsx11(
|
|
746
|
+
"input",
|
|
747
|
+
{
|
|
748
|
+
type: "checkbox",
|
|
749
|
+
checked: acknowledged,
|
|
750
|
+
disabled,
|
|
751
|
+
"data-modal-autofocus": true,
|
|
752
|
+
onChange: (event) => {
|
|
753
|
+
onAcknowledgedChange(event.currentTarget.checked);
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
),
|
|
757
|
+
/* @__PURE__ */ jsx11("span", { children: acknowledgeLabel })
|
|
758
|
+
] })
|
|
759
|
+
]
|
|
760
|
+
}
|
|
761
|
+
);
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
// src/ConnectionIndicator.tsx
|
|
765
|
+
import { useEffect as useEffect2, useState as useState2 } from "react";
|
|
766
|
+
|
|
767
|
+
// .build/css/ConnectionIndicator.module.mjs
|
|
768
|
+
var id12 = "@seekbuddy/dsh-ui/ConnectionIndicator.module.css";
|
|
769
|
+
if (typeof document !== "undefined" && !document.querySelector('style[data-dsh-ui-primitives="' + id12 + '"]')) {
|
|
770
|
+
const element = document.createElement("style");
|
|
771
|
+
element.setAttribute("data-dsh-ui-primitives", id12);
|
|
772
|
+
element.textContent = ".WjD5zG_indicator{box-sizing:border-box;border-radius:var(--dsw-radius-sm);white-space:nowrap;border:1px solid #0000;flex:none;grid-template-columns:14px max-content;align-items:center;column-gap:4px;height:28px;padding:0 8px;font-family:inherit;font-size:12px;font-weight:500;line-height:18px;transition:background-color .16s ease-out,color .16s ease-out,border-color .16s ease-out,opacity .15s ease-out;animation:.15s ease-out WjD5zG_indicator-enter;display:inline-grid}.WjD5zG_leaving{opacity:0}@keyframes WjD5zG_indicator-enter{0%{opacity:0}}.WjD5zG_warning{background:var(--dsw-alias-state-warn-tertiary);color:var(--dsw-alias-state-warn-label);border-color:color-mix(in srgb, var(--dsw-alias-state-warn-label) 20%, transparent);cursor:pointer}@media (hover:hover){.WjD5zG_warning:hover{background:color-mix(in srgb, var(--dsw-alias-state-warn-tertiary), var(--dsw-alias-state-warn-primary) 6%)}}.WjD5zG_warning:active{background:color-mix(in srgb, var(--dsw-alias-state-warn-tertiary), var(--dsw-alias-state-warn-primary) 10%)}.WjD5zG_warning:focus-visible{outline:var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:2px}.WjD5zG_success{background:var(--dsw-alias-state-success-tertiary);color:var(--dsw-alias-state-success-primary);border-color:color-mix(in srgb, var(--dsw-alias-state-success-primary) 20%, transparent)}.WjD5zG_icon{place-items:center;width:14px;height:14px;display:grid}.WjD5zG_icon>svg{color:inherit}.WjD5zG_label{text-align:left}.WjD5zG_dots{text-align:left;width:1em;display:inline-block}.WjD5zG_secondDot{animation:1.5s step-end infinite WjD5zG_reveal-second-dot}.WjD5zG_thirdDot{animation:1.5s step-end infinite WjD5zG_reveal-third-dot}@keyframes WjD5zG_reveal-second-dot{0%,33.32%{opacity:0}33.33%,to{opacity:1}}@keyframes WjD5zG_reveal-third-dot{0%,66.65%{opacity:0}66.66%,to{opacity:1}}@media (prefers-reduced-motion:reduce){.WjD5zG_indicator,.WjD5zG_secondDot,.WjD5zG_thirdDot{animation:none}.WjD5zG_indicator{transition:none}}";
|
|
773
|
+
document.head.appendChild(element);
|
|
774
|
+
}
|
|
775
|
+
var ConnectionIndicator_module_default = { "indicator-enter": "WjD5zG_indicator-enter", "indicator": "WjD5zG_indicator", "dots": "WjD5zG_dots", "secondDot": "WjD5zG_secondDot", "leaving": "WjD5zG_leaving", "label": "WjD5zG_label", "warning": "WjD5zG_warning", "success": "WjD5zG_success", "thirdDot": "WjD5zG_thirdDot", "reveal-third-dot": "WjD5zG_reveal-third-dot", "reveal-second-dot": "WjD5zG_reveal-second-dot", "icon": "WjD5zG_icon" };
|
|
776
|
+
|
|
777
|
+
// src/ConnectionIndicator.tsx
|
|
778
|
+
import { Fragment as Fragment4, jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
779
|
+
var EXIT_MS = 150;
|
|
780
|
+
function ConnectionIndicator({
|
|
781
|
+
state,
|
|
782
|
+
disconnectedLabel,
|
|
783
|
+
connectingLabel,
|
|
784
|
+
recoveredLabel,
|
|
785
|
+
reconnectActionLabel,
|
|
786
|
+
restartActionLabel,
|
|
787
|
+
onReconnect
|
|
788
|
+
}) {
|
|
789
|
+
const [rendered, setRendered] = useState2(state);
|
|
790
|
+
const leaving = state === void 0 && rendered !== void 0;
|
|
791
|
+
useEffect2(() => {
|
|
792
|
+
if (state !== void 0) {
|
|
793
|
+
setRendered(state);
|
|
794
|
+
return;
|
|
795
|
+
}
|
|
796
|
+
if (rendered === void 0) return;
|
|
797
|
+
const timeout = window.setTimeout(() => {
|
|
798
|
+
setRendered(void 0);
|
|
799
|
+
}, EXIT_MS);
|
|
800
|
+
return () => {
|
|
801
|
+
window.clearTimeout(timeout);
|
|
802
|
+
};
|
|
803
|
+
}, [state, rendered]);
|
|
804
|
+
if (rendered === void 0) return null;
|
|
805
|
+
const leavingClass = leaving ? ` ${ConnectionIndicator_module_default.leaving}` : "";
|
|
806
|
+
if (rendered === "recovered") {
|
|
807
|
+
return /* @__PURE__ */ jsxs10("div", { className: `${ConnectionIndicator_module_default.indicator} ${ConnectionIndicator_module_default.success}${leavingClass}`, role: "status", "aria-label": recoveredLabel, children: [
|
|
808
|
+
/* @__PURE__ */ jsx12("span", { className: ConnectionIndicator_module_default.icon, "aria-hidden": "true", children: /* @__PURE__ */ jsx12(IconCheckOutlineRegular, { size: 14 }) }),
|
|
809
|
+
/* @__PURE__ */ jsx12("span", { className: ConnectionIndicator_module_default.label, children: recoveredLabel })
|
|
810
|
+
] });
|
|
811
|
+
}
|
|
812
|
+
const connecting = rendered === "connecting";
|
|
813
|
+
return /* @__PURE__ */ jsxs10(
|
|
814
|
+
"button",
|
|
815
|
+
{
|
|
816
|
+
type: "button",
|
|
817
|
+
className: `${ConnectionIndicator_module_default.indicator} ${ConnectionIndicator_module_default.warning}${leavingClass}`,
|
|
818
|
+
"data-phase": rendered,
|
|
819
|
+
"aria-label": connecting ? restartActionLabel : reconnectActionLabel,
|
|
820
|
+
onClick: onReconnect,
|
|
821
|
+
children: [
|
|
822
|
+
/* @__PURE__ */ jsx12("span", { className: ConnectionIndicator_module_default.icon, "aria-hidden": "true", children: connecting ? /* @__PURE__ */ jsx12(StateDot, { state: "ongoing" }) : /* @__PURE__ */ jsx12(IconRefreshOutlineRegular, { size: 14 }) }),
|
|
823
|
+
/* @__PURE__ */ jsx12("span", { className: ConnectionIndicator_module_default.label, children: connecting ? /* @__PURE__ */ jsxs10(Fragment4, { children: [
|
|
824
|
+
connectingLabel,
|
|
825
|
+
/* @__PURE__ */ jsxs10("span", { className: ConnectionIndicator_module_default.dots, "aria-hidden": "true", children: [
|
|
826
|
+
/* @__PURE__ */ jsx12("span", { children: "." }),
|
|
827
|
+
/* @__PURE__ */ jsx12("span", { className: ConnectionIndicator_module_default.secondDot, children: "." }),
|
|
828
|
+
/* @__PURE__ */ jsx12("span", { className: ConnectionIndicator_module_default.thirdDot, children: "." })
|
|
829
|
+
] })
|
|
830
|
+
] }) : disconnectedLabel })
|
|
831
|
+
]
|
|
832
|
+
}
|
|
833
|
+
);
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
// src/user-text.tsx
|
|
837
|
+
import clsx10 from "clsx";
|
|
838
|
+
|
|
839
|
+
// .build/css/user-text.module.mjs
|
|
840
|
+
var id13 = "@seekbuddy/dsh-ui/user-text.module.css";
|
|
841
|
+
if (typeof document !== "undefined" && !document.querySelector('style[data-dsh-ui-primitives="' + id13 + '"]')) {
|
|
842
|
+
const element = document.createElement("style");
|
|
843
|
+
element.setAttribute("data-dsh-ui-primitives", id13);
|
|
844
|
+
element.textContent = "._3EOulq_plainRun{font-size:inherit;line-height:inherit}._3EOulq_refChip{max-width:100%;color:var(--dsw-alias-state-business-primary);white-space:inherit;overflow-wrap:anywhere;text-align:inherit;margin:0 2px;font-weight:500;display:inline}._3EOulq_slashChip{font-family:var(--dsw-font-markdown-code-font-family)}._3EOulq_refIcon{vertical-align:-.125em;width:1em;height:1em;margin-right:4px}";
|
|
845
|
+
document.head.appendChild(element);
|
|
846
|
+
}
|
|
847
|
+
var user_text_module_default = { "plainRun": "_3EOulq_plainRun", "refChip": "_3EOulq_refChip", "refIcon": "_3EOulq_refIcon", "slashChip": "_3EOulq_slashChip" };
|
|
848
|
+
|
|
849
|
+
// src/user-text.tsx
|
|
850
|
+
import { Fragment as Fragment5, jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
851
|
+
function UserTextRun({ text }) {
|
|
852
|
+
return /* @__PURE__ */ jsx13("span", { className: user_text_module_default.plainRun, children: text });
|
|
853
|
+
}
|
|
854
|
+
function ReferenceChip({
|
|
855
|
+
appearance,
|
|
856
|
+
label,
|
|
857
|
+
title,
|
|
858
|
+
onActivate,
|
|
859
|
+
contextMenuProps
|
|
860
|
+
}) {
|
|
861
|
+
const slash = appearance === "skill" || appearance === "command";
|
|
862
|
+
const contents = /* @__PURE__ */ jsxs11(Fragment5, { children: [
|
|
863
|
+
!slash && /* @__PURE__ */ jsx13(ReferenceIconRegular, { kind: appearance, size: 16, className: user_text_module_default.refIcon }),
|
|
864
|
+
label
|
|
865
|
+
] });
|
|
866
|
+
const className = clsx10(user_text_module_default.refChip, slash && user_text_module_default.slashChip);
|
|
867
|
+
return onActivate === void 0 ? /* @__PURE__ */ jsx13("span", { ...contextMenuProps, className, "data-ref-chip": appearance, title, children: contents }) : /* @__PURE__ */ jsx13(
|
|
868
|
+
"button",
|
|
869
|
+
{
|
|
870
|
+
type: "button",
|
|
871
|
+
...contextMenuProps,
|
|
872
|
+
className: clsx10(className, MarkdownText_module_default.fileMention),
|
|
873
|
+
"data-ref-chip": appearance,
|
|
874
|
+
title,
|
|
875
|
+
onClick: (event) => {
|
|
876
|
+
if (event.detail > 1 || event.detail !== 0 && event.currentTarget.ownerDocument.getSelection()?.isCollapsed === false)
|
|
877
|
+
return;
|
|
878
|
+
onActivate();
|
|
879
|
+
},
|
|
880
|
+
children: contents
|
|
881
|
+
}
|
|
882
|
+
);
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
// src/UserMessageBubble.tsx
|
|
886
|
+
import clsx11 from "clsx";
|
|
887
|
+
|
|
888
|
+
// .build/css/UserMessageBubble.module.mjs
|
|
889
|
+
var id14 = "@seekbuddy/dsh-ui/UserMessageBubble.module.css";
|
|
890
|
+
if (typeof document !== "undefined" && !document.querySelector('style[data-dsh-ui-primitives="' + id14 + '"]')) {
|
|
891
|
+
const element = document.createElement("style");
|
|
892
|
+
element.setAttribute("data-dsh-ui-primitives", id14);
|
|
893
|
+
element.textContent = "._5Yr1MW_bubble{background:var(--dsw-specific-bubble);border-radius:var(--dsw-radius-xl);max-width:100%;font-size:var(--dsh-content-font-size,14px);line-height:calc(22px + var(--dsh-content-font-delta,0px));color:var(--dsw-alias-label-primary);white-space:pre-wrap;word-break:break-word;padding:10px 16px}";
|
|
894
|
+
document.head.appendChild(element);
|
|
895
|
+
}
|
|
896
|
+
var UserMessageBubble_module_default = { "bubble": "_5Yr1MW_bubble" };
|
|
897
|
+
|
|
898
|
+
// src/UserMessageBubble.tsx
|
|
899
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
900
|
+
function UserMessageBubble({ className, ...props }) {
|
|
901
|
+
return /* @__PURE__ */ jsx14("div", { ...props, className: clsx11(UserMessageBubble_module_default.bubble, className) });
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
// src/AnimatedRows.tsx
|
|
905
|
+
import { Component, createRef } from "react";
|
|
906
|
+
|
|
907
|
+
// .build/css/AnimatedRows.module.mjs
|
|
908
|
+
var id15 = "@seekbuddy/dsh-ui/AnimatedRows.module.css";
|
|
909
|
+
if (typeof document !== "undefined" && !document.querySelector('style[data-dsh-ui-primitives="' + id15 + '"]')) {
|
|
910
|
+
const element = document.createElement("style");
|
|
911
|
+
element.setAttribute("data-dsh-ui-primitives", id15);
|
|
912
|
+
element.textContent = ".cJwyhW_exits{contain:strict;pointer-events:none;position:absolute;inset:0;overflow:clip}";
|
|
913
|
+
document.head.appendChild(element);
|
|
914
|
+
}
|
|
915
|
+
var AnimatedRows_module_default = { "exits": "cJwyhW_exits" };
|
|
916
|
+
|
|
917
|
+
// src/AnimatedRows.tsx
|
|
918
|
+
import { Fragment as Fragment6, jsx as jsx15, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
919
|
+
var ROW_FADE_MS = 100;
|
|
920
|
+
var ROW_GLIDE_MS = 200;
|
|
921
|
+
function sameRows(previous, next) {
|
|
922
|
+
return previous.rowKeys.length === next.rowKeys.length && previous.rowKeys.every((key, index) => key === next.rowKeys[index]);
|
|
923
|
+
}
|
|
924
|
+
function intersects(row, viewport) {
|
|
925
|
+
return row.bottom > viewport.top && row.top < viewport.bottom && row.right > viewport.left && row.left < viewport.right;
|
|
926
|
+
}
|
|
927
|
+
var AnimatedRows = class extends Component {
|
|
928
|
+
constructor() {
|
|
929
|
+
super(...arguments);
|
|
930
|
+
__publicField(this, "armed", false);
|
|
931
|
+
__publicField(this, "list", createRef());
|
|
932
|
+
__publicField(this, "overlay", createRef());
|
|
933
|
+
__publicField(this, "movements", /* @__PURE__ */ new Map());
|
|
934
|
+
__publicField(this, "exits", /* @__PURE__ */ new Map());
|
|
935
|
+
}
|
|
936
|
+
getSnapshotBeforeUpdate(previous) {
|
|
937
|
+
const list = this.list.current;
|
|
938
|
+
if (!this.armed || sameRows(previous, this.props) || previous.resetKey !== this.props.resetKey || !previous.ready || !this.props.ready || list === null || typeof list.animate !== "function" || window.matchMedia("(prefers-reduced-motion: reduce)").matches)
|
|
939
|
+
return null;
|
|
940
|
+
const viewport = list.getBoundingClientRect();
|
|
941
|
+
const positions = this.readPositions();
|
|
942
|
+
const nextKeys = new Set(this.props.rowKeys);
|
|
943
|
+
const removed = /* @__PURE__ */ new Map();
|
|
944
|
+
for (const [key, row] of positions) {
|
|
945
|
+
if (nextKeys.has(key) || !intersects(row.rect, viewport)) continue;
|
|
946
|
+
const clone = row.element.cloneNode(true);
|
|
947
|
+
clone.removeAttribute("data-row-key");
|
|
948
|
+
clone.inert = true;
|
|
949
|
+
clone.style.paddingInlineStart = getComputedStyle(row.element).paddingInlineStart;
|
|
950
|
+
removed.set(key, { ...row, element: clone });
|
|
951
|
+
}
|
|
952
|
+
return { positions, removed };
|
|
953
|
+
}
|
|
954
|
+
componentDidUpdate(previous, _state, snapshot) {
|
|
955
|
+
if (snapshot === null) {
|
|
956
|
+
if (!sameRows(previous, this.props) || previous.resetKey !== this.props.resetKey || previous.ready !== this.props.ready)
|
|
957
|
+
this.clear();
|
|
958
|
+
return;
|
|
959
|
+
}
|
|
960
|
+
this.cancelMovements();
|
|
961
|
+
const list = this.list.current;
|
|
962
|
+
const overlay = this.overlay.current;
|
|
963
|
+
const viewport = list.getBoundingClientRect();
|
|
964
|
+
const origin = overlay.getBoundingClientRect();
|
|
965
|
+
const positions = this.readPositions();
|
|
966
|
+
for (const [key, row] of positions) {
|
|
967
|
+
this.removeExit(key);
|
|
968
|
+
const previousRow = snapshot.positions.get(key);
|
|
969
|
+
if (!intersects(row.rect, viewport) && (previousRow === void 0 || !intersects(previousRow.rect, viewport)))
|
|
970
|
+
continue;
|
|
971
|
+
if (previousRow === void 0) {
|
|
972
|
+
this.move(row.element, [{ opacity: 0 }, { opacity: 1 }], ROW_FADE_MS);
|
|
973
|
+
continue;
|
|
974
|
+
}
|
|
975
|
+
const dx = previousRow.rect.left - row.rect.left;
|
|
976
|
+
const dy = previousRow.rect.top - row.rect.top;
|
|
977
|
+
if (dx === 0 && dy === 0 && previousRow.opacity === 1) continue;
|
|
978
|
+
this.move(
|
|
979
|
+
row.element,
|
|
980
|
+
[
|
|
981
|
+
{ transform: `translate(${String(dx)}px, ${String(dy)}px)`, opacity: previousRow.opacity },
|
|
982
|
+
{ transform: "translate(0, 0)", opacity: 1 }
|
|
983
|
+
],
|
|
984
|
+
ROW_GLIDE_MS
|
|
985
|
+
);
|
|
986
|
+
}
|
|
987
|
+
for (const [key, row] of snapshot.removed) {
|
|
988
|
+
const { element } = row;
|
|
989
|
+
this.removeExit(key);
|
|
990
|
+
Object.assign(element.style, {
|
|
991
|
+
position: "absolute",
|
|
992
|
+
margin: "0",
|
|
993
|
+
transform: "none",
|
|
994
|
+
boxSizing: "border-box",
|
|
995
|
+
left: `${String(row.rect.left - origin.left)}px`,
|
|
996
|
+
top: `${String(row.rect.top - origin.top)}px`,
|
|
997
|
+
width: `${String(row.rect.width)}px`,
|
|
998
|
+
height: `${String(row.rect.height)}px`
|
|
999
|
+
});
|
|
1000
|
+
overlay.append(element);
|
|
1001
|
+
const animation = element.animate([{ opacity: row.opacity }, { opacity: 0 }], {
|
|
1002
|
+
duration: ROW_FADE_MS,
|
|
1003
|
+
easing: "ease-out",
|
|
1004
|
+
fill: "forwards"
|
|
1005
|
+
});
|
|
1006
|
+
this.exits.set(key, { element, animation });
|
|
1007
|
+
animation.onfinish = () => {
|
|
1008
|
+
this.removeExit(key);
|
|
1009
|
+
};
|
|
1010
|
+
}
|
|
1011
|
+
}
|
|
1012
|
+
componentWillUnmount() {
|
|
1013
|
+
this.clear();
|
|
1014
|
+
}
|
|
1015
|
+
readPositions() {
|
|
1016
|
+
const list = this.list.current;
|
|
1017
|
+
const rows = list.querySelectorAll("[data-row-key]");
|
|
1018
|
+
return new Map(
|
|
1019
|
+
Array.from(rows, (element) => [
|
|
1020
|
+
element.dataset.rowKey,
|
|
1021
|
+
{
|
|
1022
|
+
element,
|
|
1023
|
+
rect: element.getBoundingClientRect(),
|
|
1024
|
+
opacity: this.movements.has(element) ? Number(getComputedStyle(element).opacity) : 1
|
|
1025
|
+
}
|
|
1026
|
+
])
|
|
1027
|
+
);
|
|
1028
|
+
}
|
|
1029
|
+
move(element, keyframes, duration) {
|
|
1030
|
+
const animation = element.animate(keyframes, { duration, easing: "ease-out" });
|
|
1031
|
+
this.movements.set(element, animation);
|
|
1032
|
+
animation.onfinish = () => {
|
|
1033
|
+
this.movements.delete(element);
|
|
1034
|
+
animation.cancel();
|
|
1035
|
+
};
|
|
1036
|
+
}
|
|
1037
|
+
cancelMovements() {
|
|
1038
|
+
for (const animation of this.movements.values()) {
|
|
1039
|
+
animation.onfinish = null;
|
|
1040
|
+
animation.cancel();
|
|
1041
|
+
}
|
|
1042
|
+
this.movements.clear();
|
|
1043
|
+
}
|
|
1044
|
+
removeExit(key) {
|
|
1045
|
+
const exit = this.exits.get(key);
|
|
1046
|
+
if (exit === void 0) return;
|
|
1047
|
+
exit.animation.onfinish = null;
|
|
1048
|
+
exit.animation.cancel();
|
|
1049
|
+
exit.element.remove();
|
|
1050
|
+
this.exits.delete(key);
|
|
1051
|
+
}
|
|
1052
|
+
clear() {
|
|
1053
|
+
this.cancelMovements();
|
|
1054
|
+
for (const key of this.exits.keys()) this.removeExit(key);
|
|
1055
|
+
}
|
|
1056
|
+
render() {
|
|
1057
|
+
return /* @__PURE__ */ jsxs12(Fragment6, { children: [
|
|
1058
|
+
/* @__PURE__ */ jsx15(
|
|
1059
|
+
"div",
|
|
1060
|
+
{
|
|
1061
|
+
ref: this.list,
|
|
1062
|
+
className: this.props.className,
|
|
1063
|
+
role: this.props.role,
|
|
1064
|
+
"aria-label": this.props.label,
|
|
1065
|
+
onPointerDownCapture: () => {
|
|
1066
|
+
this.armed = true;
|
|
1067
|
+
},
|
|
1068
|
+
onKeyDownCapture: () => {
|
|
1069
|
+
this.armed = true;
|
|
1070
|
+
},
|
|
1071
|
+
children: this.props.children
|
|
1072
|
+
}
|
|
1073
|
+
),
|
|
1074
|
+
/* @__PURE__ */ jsx15("div", { ref: this.overlay, className: AnimatedRows_module_default.exits, "aria-hidden": "true" })
|
|
1075
|
+
] });
|
|
1076
|
+
}
|
|
1077
|
+
};
|
|
1078
|
+
|
|
1079
|
+
// src/useRowDragPreview.ts
|
|
1080
|
+
import { useEffect as useEffect3, useMemo, useRef as useRef3 } from "react";
|
|
1081
|
+
import clsx12 from "clsx";
|
|
1082
|
+
|
|
1083
|
+
// .build/css/RowDragPreview.module.mjs
|
|
1084
|
+
var id16 = "@seekbuddy/dsh-ui/RowDragPreview.module.css";
|
|
1085
|
+
if (typeof document !== "undefined" && !document.querySelector('style[data-dsh-ui-primitives="' + id16 + '"]')) {
|
|
1086
|
+
const element = document.createElement("style");
|
|
1087
|
+
element.setAttribute("data-dsh-ui-primitives", id16);
|
|
1088
|
+
element.textContent = ".oXmfgq_preview{pointer-events:none;position:fixed;top:0}.oXmfgq_preview>:first-child{box-sizing:border-box;width:100%;height:100%;margin:0}";
|
|
1089
|
+
document.head.appendChild(element);
|
|
1090
|
+
}
|
|
1091
|
+
var RowDragPreview_module_default = { "preview": "oXmfgq_preview" };
|
|
1092
|
+
|
|
1093
|
+
// src/useRowDragPreview.ts
|
|
1094
|
+
function useRowDragPreview(className, inheritedProperties) {
|
|
1095
|
+
const current = useRef3(null);
|
|
1096
|
+
const dragging = useRef3(false);
|
|
1097
|
+
const preview = useMemo(() => {
|
|
1098
|
+
const clear = () => {
|
|
1099
|
+
const wasDragging = dragging.current;
|
|
1100
|
+
dragging.current = false;
|
|
1101
|
+
current.current?.remove();
|
|
1102
|
+
current.current = null;
|
|
1103
|
+
return wasDragging;
|
|
1104
|
+
};
|
|
1105
|
+
return {
|
|
1106
|
+
clear,
|
|
1107
|
+
start: (event, row = event.currentTarget) => {
|
|
1108
|
+
clear();
|
|
1109
|
+
dragging.current = true;
|
|
1110
|
+
const rect = row.getBoundingClientRect();
|
|
1111
|
+
const style = getComputedStyle(row);
|
|
1112
|
+
const copy = row.cloneNode(true);
|
|
1113
|
+
copy.removeAttribute("data-row-key");
|
|
1114
|
+
copy.tabIndex = -1;
|
|
1115
|
+
for (const control of copy.querySelectorAll(
|
|
1116
|
+
"button, a[href], input, select, textarea, [tabindex], [contenteditable]"
|
|
1117
|
+
))
|
|
1118
|
+
control.tabIndex = -1;
|
|
1119
|
+
copy.style.color = style.color;
|
|
1120
|
+
copy.style.paddingInlineStart = style.paddingInlineStart;
|
|
1121
|
+
const image = row.ownerDocument.createElement("div");
|
|
1122
|
+
image.className = clsx12(RowDragPreview_module_default.preview, className);
|
|
1123
|
+
image.inert = true;
|
|
1124
|
+
image.setAttribute("aria-hidden", "true");
|
|
1125
|
+
inheritedProperties?.forEach((property) => {
|
|
1126
|
+
image.style.setProperty(property, style.getPropertyValue(property));
|
|
1127
|
+
});
|
|
1128
|
+
Object.assign(image.style, {
|
|
1129
|
+
left: `${String(-rect.width)}px`,
|
|
1130
|
+
width: `${String(rect.width)}px`,
|
|
1131
|
+
height: `${String(rect.height)}px`,
|
|
1132
|
+
font: style.font
|
|
1133
|
+
});
|
|
1134
|
+
image.append(copy);
|
|
1135
|
+
row.ownerDocument.body.append(image);
|
|
1136
|
+
current.current = image;
|
|
1137
|
+
try {
|
|
1138
|
+
event.dataTransfer.setDragImage(image, event.clientX - rect.left, event.clientY - rect.top);
|
|
1139
|
+
} catch (_error) {
|
|
1140
|
+
image.remove();
|
|
1141
|
+
current.current = null;
|
|
1142
|
+
}
|
|
1143
|
+
}
|
|
1144
|
+
};
|
|
1145
|
+
}, [className, inheritedProperties]);
|
|
1146
|
+
useEffect3(
|
|
1147
|
+
() => () => {
|
|
1148
|
+
preview.clear();
|
|
1149
|
+
},
|
|
1150
|
+
[preview]
|
|
1151
|
+
);
|
|
1152
|
+
return preview;
|
|
1153
|
+
}
|
|
1154
|
+
|
|
1155
|
+
// src/ZoomControls.tsx
|
|
1156
|
+
import clsx13 from "clsx";
|
|
1157
|
+
import { forwardRef as forwardRef2, useEffect as useEffect4, useImperativeHandle, useState as useState3 } from "react";
|
|
1158
|
+
|
|
1159
|
+
// src/document-zoom.ts
|
|
1160
|
+
var DOCUMENT_ZOOM = { minimum: 0.25, maximum: 4, step: 0.25, presets: [0.25, 0.5, 1, 1.5, 2] };
|
|
1161
|
+
|
|
1162
|
+
// .build/css/ZoomControls.module.mjs
|
|
1163
|
+
var id17 = "@seekbuddy/dsh-ui/ZoomControls.module.css";
|
|
1164
|
+
if (typeof document !== "undefined" && !document.querySelector('style[data-dsh-ui-primitives="' + id17 + '"]')) {
|
|
1165
|
+
const element = document.createElement("style");
|
|
1166
|
+
element.setAttribute("data-dsh-ui-primitives", id17);
|
|
1167
|
+
element.textContent = ":where(._16hJkG_panel){bottom:14px}._16hJkG_panel{z-index:2;box-sizing:border-box;border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-lg);color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-1);opacity:0;pointer-events:none;will-change:opacity, transform;align-items:center;gap:2px;padding:4px 6px;font-size:12px;line-height:18px;transition:opacity .16s ease-in,transform .16s cubic-bezier(.4,0,1,1);display:flex;position:absolute;inset-inline-start:50%;transform:translate(-50%,16px)scale(.98);box-shadow:0 8px 24px light-dark(#0000001a,#00000060),0 2px 5px light-dark(#00000009,#00000035)}._16hJkG_visible{opacity:1;pointer-events:auto;transition:opacity .14s ease-out,transform .18s cubic-bezier(.22,1,.36,1);transform:translate(-50%)scale(1)}._16hJkG_controlAnchor{display:flex}._16hJkG_zoomButton{flex:none;width:28px;padding:0}._16hJkG_percent{font-variant-numeric:tabular-nums;justify-content:center;align-items:center;gap:2px;min-width:58px;padding-inline:6px;display:inline-flex}._16hJkG_zoomMenu{min-width:112px}@media (hover:none),(pointer:coarse){._16hJkG_panel{opacity:1;pointer-events:auto;transform:translate(-50%)scale(1)}}@media (prefers-reduced-motion:reduce){._16hJkG_panel,._16hJkG_visible{transition-duration:.01ms}}";
|
|
1168
|
+
document.head.appendChild(element);
|
|
1169
|
+
}
|
|
1170
|
+
var ZoomControls_module_default = { "percent": "_16hJkG_percent", "controlAnchor": "_16hJkG_controlAnchor", "zoomMenu": "_16hJkG_zoomMenu", "visible": "_16hJkG_visible", "panel": "_16hJkG_panel", "zoomButton": "_16hJkG_zoomButton" };
|
|
1171
|
+
|
|
1172
|
+
// src/ZoomControls.tsx
|
|
1173
|
+
import { jsx as jsx16, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1174
|
+
function steppedZoom(zoom, direction) {
|
|
1175
|
+
const step = direction === -1 ? Math.ceil(zoom / DOCUMENT_ZOOM.step) - 1 : Math.floor(zoom / DOCUMENT_ZOOM.step) + 1;
|
|
1176
|
+
return Math.min(DOCUMENT_ZOOM.maximum, Math.max(DOCUMENT_ZOOM.minimum, step * DOCUMENT_ZOOM.step));
|
|
1177
|
+
}
|
|
1178
|
+
var ZoomControls = forwardRef2(function ZoomControls2({ zoom, fit, className, labels, visible, onZoom, onActiveChange }, ref) {
|
|
1179
|
+
const [committed, setCommitted] = useState3(zoom);
|
|
1180
|
+
const [transient, setTransient] = useState3();
|
|
1181
|
+
const [open, setOpen] = useState3(false);
|
|
1182
|
+
const [hovered, setHovered] = useState3(false);
|
|
1183
|
+
const [focused, setFocused] = useState3(false);
|
|
1184
|
+
if (committed !== zoom) {
|
|
1185
|
+
setCommitted(zoom);
|
|
1186
|
+
setTransient(void 0);
|
|
1187
|
+
}
|
|
1188
|
+
const displayZoom = transient ?? zoom;
|
|
1189
|
+
useImperativeHandle(ref, () => ({ showZoom: setTransient }), []);
|
|
1190
|
+
useEffect4(() => {
|
|
1191
|
+
onActiveChange(open || hovered || focused);
|
|
1192
|
+
}, [focused, hovered, onActiveChange, open]);
|
|
1193
|
+
const items = [
|
|
1194
|
+
...fit === void 0 ? [] : [
|
|
1195
|
+
{ id: "fit", label: fit.label },
|
|
1196
|
+
{ type: "separator", id: "fit-scale" }
|
|
1197
|
+
],
|
|
1198
|
+
...DOCUMENT_ZOOM.presets.map((value) => ({ id: String(value), label: labels.value(value * 100) }))
|
|
1199
|
+
];
|
|
1200
|
+
const selectedId = fit?.selected === true ? "fit" : DOCUMENT_ZOOM.presets.some((value) => value === displayZoom) ? String(displayZoom) : void 0;
|
|
1201
|
+
return /* @__PURE__ */ jsxs13(
|
|
1202
|
+
"div",
|
|
1203
|
+
{
|
|
1204
|
+
className: clsx13(ZoomControls_module_default.panel, visible && ZoomControls_module_default.visible, className),
|
|
1205
|
+
role: "toolbar",
|
|
1206
|
+
"aria-label": labels.controls,
|
|
1207
|
+
"data-document-zoom-controls": true,
|
|
1208
|
+
"data-document-zoom-visible": visible || void 0,
|
|
1209
|
+
onPointerEnter: (event) => {
|
|
1210
|
+
if (event.pointerType !== "touch") setHovered(true);
|
|
1211
|
+
},
|
|
1212
|
+
onPointerLeave: () => {
|
|
1213
|
+
setHovered(false);
|
|
1214
|
+
},
|
|
1215
|
+
onFocusCapture: () => {
|
|
1216
|
+
setFocused(true);
|
|
1217
|
+
},
|
|
1218
|
+
onBlurCapture: (event) => {
|
|
1219
|
+
if (!event.currentTarget.contains(event.relatedTarget)) setFocused(false);
|
|
1220
|
+
},
|
|
1221
|
+
children: [
|
|
1222
|
+
/* @__PURE__ */ jsx16(Tooltip, { label: labels.out, side: "top", children: /* @__PURE__ */ jsx16("span", { className: ZoomControls_module_default.controlAnchor, children: /* @__PURE__ */ jsx16(
|
|
1223
|
+
Button,
|
|
1224
|
+
{
|
|
1225
|
+
size: "sm",
|
|
1226
|
+
className: ZoomControls_module_default.zoomButton,
|
|
1227
|
+
"aria-label": labels.out,
|
|
1228
|
+
disabled: displayZoom <= DOCUMENT_ZOOM.minimum,
|
|
1229
|
+
onMouseDown: (event) => {
|
|
1230
|
+
event.preventDefault();
|
|
1231
|
+
},
|
|
1232
|
+
onClick: () => {
|
|
1233
|
+
onZoom(steppedZoom(displayZoom, -1));
|
|
1234
|
+
},
|
|
1235
|
+
children: /* @__PURE__ */ jsx16("svg", { width: "14", height: "14", viewBox: "0 0 16 16", "aria-hidden": "true", children: /* @__PURE__ */ jsx16("path", { d: "M2 8h12", fill: "none", stroke: "currentColor", strokeWidth: "1.5" }) })
|
|
1236
|
+
}
|
|
1237
|
+
) }) }),
|
|
1238
|
+
/* @__PURE__ */ jsx16(
|
|
1239
|
+
Menu,
|
|
1240
|
+
{
|
|
1241
|
+
open,
|
|
1242
|
+
side: "top",
|
|
1243
|
+
align: "start",
|
|
1244
|
+
portal: true,
|
|
1245
|
+
compact: true,
|
|
1246
|
+
listClassName: ZoomControls_module_default.zoomMenu,
|
|
1247
|
+
anchor: /* @__PURE__ */ jsxs13(
|
|
1248
|
+
Button,
|
|
1249
|
+
{
|
|
1250
|
+
size: "sm",
|
|
1251
|
+
className: ZoomControls_module_default.percent,
|
|
1252
|
+
"aria-label": labels.menu,
|
|
1253
|
+
"aria-expanded": open,
|
|
1254
|
+
onMouseDown: (event) => {
|
|
1255
|
+
event.preventDefault();
|
|
1256
|
+
},
|
|
1257
|
+
onClick: () => {
|
|
1258
|
+
setOpen((value) => !value);
|
|
1259
|
+
},
|
|
1260
|
+
children: [
|
|
1261
|
+
/* @__PURE__ */ jsx16("span", { children: labels.value(Math.round(displayZoom * 100)) }),
|
|
1262
|
+
/* @__PURE__ */ jsx16(IconChevronDownOutlineRegular, { size: 12 })
|
|
1263
|
+
]
|
|
1264
|
+
}
|
|
1265
|
+
),
|
|
1266
|
+
items,
|
|
1267
|
+
selectedId,
|
|
1268
|
+
onClose: () => {
|
|
1269
|
+
setOpen(false);
|
|
1270
|
+
},
|
|
1271
|
+
onSelect: (selected) => {
|
|
1272
|
+
setOpen(false);
|
|
1273
|
+
if (selected === "fit") fit?.onSelect();
|
|
1274
|
+
else onZoom(Number(selected));
|
|
1275
|
+
}
|
|
1276
|
+
}
|
|
1277
|
+
),
|
|
1278
|
+
/* @__PURE__ */ jsx16(Tooltip, { label: labels.into, side: "top", children: /* @__PURE__ */ jsx16("span", { className: ZoomControls_module_default.controlAnchor, children: /* @__PURE__ */ jsx16(
|
|
1279
|
+
Button,
|
|
1280
|
+
{
|
|
1281
|
+
size: "sm",
|
|
1282
|
+
className: ZoomControls_module_default.zoomButton,
|
|
1283
|
+
"aria-label": labels.into,
|
|
1284
|
+
disabled: displayZoom >= DOCUMENT_ZOOM.maximum,
|
|
1285
|
+
onMouseDown: (event) => {
|
|
1286
|
+
event.preventDefault();
|
|
1287
|
+
},
|
|
1288
|
+
onClick: () => {
|
|
1289
|
+
onZoom(steppedZoom(displayZoom, 1));
|
|
1290
|
+
},
|
|
1291
|
+
children: /* @__PURE__ */ jsx16(IconPlusOutlineRegular, { size: 14 })
|
|
1292
|
+
}
|
|
1293
|
+
) }) })
|
|
1294
|
+
]
|
|
1295
|
+
}
|
|
1296
|
+
);
|
|
1297
|
+
});
|
|
1298
|
+
|
|
1299
|
+
// src/InlineEditor.tsx
|
|
1300
|
+
import { useLayoutEffect as useLayoutEffect2, useRef as useRef4 } from "react";
|
|
1301
|
+
import clsx14 from "clsx";
|
|
1302
|
+
|
|
1303
|
+
// .build/css/InlineEditor.module.mjs
|
|
1304
|
+
var id18 = "@seekbuddy/dsh-ui/InlineEditor.module.css";
|
|
1305
|
+
if (typeof document !== "undefined" && !document.querySelector('style[data-dsh-ui-primitives="' + id18 + '"]')) {
|
|
1306
|
+
const element = document.createElement("style");
|
|
1307
|
+
element.setAttribute("data-dsh-ui-primitives", id18);
|
|
1308
|
+
element.textContent = ".aMYfeq_editor{box-sizing:border-box;border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-sm);background:var(--dsw-alias-bg-base);min-width:0;min-height:28px;max-height:127px;color:var(--dsw-alias-label-primary);font:var(--dsw-font-xs-13);font-family:Inter, var(--dsw-font-family);resize:none;outline:none;flex:auto;margin:0;padding:3px 8px;overflow-y:auto}.aMYfeq_editor:focus{border-color:var(--dsw-alias-state-business-primary)}";
|
|
1309
|
+
document.head.appendChild(element);
|
|
1310
|
+
}
|
|
1311
|
+
var InlineEditor_module_default = { "editor": "aMYfeq_editor" };
|
|
1312
|
+
|
|
1313
|
+
// src/InlineEditor.tsx
|
|
1314
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
1315
|
+
function InlineEditor({
|
|
1316
|
+
value,
|
|
1317
|
+
label,
|
|
1318
|
+
onChange,
|
|
1319
|
+
onSave,
|
|
1320
|
+
onCancel,
|
|
1321
|
+
className
|
|
1322
|
+
}) {
|
|
1323
|
+
const ref = useRef4(null);
|
|
1324
|
+
useLayoutEffect2(() => {
|
|
1325
|
+
const node = ref.current;
|
|
1326
|
+
const fit = () => {
|
|
1327
|
+
node.style.height = "auto";
|
|
1328
|
+
node.style.height = `${node.scrollHeight + node.offsetHeight - node.clientHeight}px`;
|
|
1329
|
+
};
|
|
1330
|
+
fit();
|
|
1331
|
+
const observer = new ResizeObserver(fit);
|
|
1332
|
+
observer.observe(node);
|
|
1333
|
+
return () => {
|
|
1334
|
+
observer.disconnect();
|
|
1335
|
+
};
|
|
1336
|
+
}, [value]);
|
|
1337
|
+
const onKeyDown = (event) => {
|
|
1338
|
+
if (event.key === "Escape") {
|
|
1339
|
+
onCancel();
|
|
1340
|
+
return;
|
|
1341
|
+
}
|
|
1342
|
+
const composing = event.nativeEvent.isComposing || Reflect.get(event.nativeEvent, "keyCode") === 229;
|
|
1343
|
+
if (event.key !== "Enter" || event.shiftKey || composing) return;
|
|
1344
|
+
event.preventDefault();
|
|
1345
|
+
onSave();
|
|
1346
|
+
};
|
|
1347
|
+
return /* @__PURE__ */ jsx17(
|
|
1348
|
+
"textarea",
|
|
1349
|
+
{
|
|
1350
|
+
ref,
|
|
1351
|
+
autoFocus: true,
|
|
1352
|
+
rows: 1,
|
|
1353
|
+
className: clsx14(InlineEditor_module_default.editor, className),
|
|
1354
|
+
"aria-label": label,
|
|
1355
|
+
value,
|
|
1356
|
+
onChange: (event) => {
|
|
1357
|
+
onChange(event.currentTarget.value);
|
|
1358
|
+
},
|
|
1359
|
+
onKeyDown
|
|
1360
|
+
}
|
|
1361
|
+
);
|
|
1362
|
+
}
|
|
1363
|
+
|
|
1364
|
+
// src/QuotePreview.tsx
|
|
1365
|
+
import { useLayoutEffect as useLayoutEffect3, useRef as useRef5, useState as useState4 } from "react";
|
|
1366
|
+
|
|
1367
|
+
// .build/css/QuotePreview.module.mjs
|
|
1368
|
+
var id19 = "@seekbuddy/dsh-ui/QuotePreview.module.css";
|
|
1369
|
+
if (typeof document !== "undefined" && !document.querySelector('style[data-dsh-ui-primitives="' + id19 + '"]')) {
|
|
1370
|
+
const element = document.createElement("style");
|
|
1371
|
+
element.setAttribute("data-dsh-ui-primitives", id19);
|
|
1372
|
+
element.textContent = ".Qd5ZYq_quote{box-sizing:border-box;vertical-align:baseline;max-width:min(80%,300px);color:var(--dsw-alias-state-business-primary);font-size:var(--dsh-content-font-size,14px);line-height:calc(20px + var(--dsh-content-font-delta,0px));align-items:baseline;gap:4px;margin:0;padding:0;display:inline-flex}.Qd5ZYq_popoverText{color:var(--dsw-alias-label-primary);overflow-wrap:anywhere;white-space:pre-wrap;padding:8px 10px;font-size:14px;line-height:20px;display:block}.Qd5ZYq_source{min-width:0;color:inherit;font:inherit;line-height:inherit;text-align:left;text-overflow:ellipsis;white-space:nowrap;background:0 0;border:none;outline:none;padding:0;overflow:hidden}.Qd5ZYq_marker,.Qd5ZYq_remove{width:16px;height:16px;color:inherit;user-select:none;flex:none;align-self:center;place-items:center;padding:0;display:grid}.Qd5ZYq_marker{pointer-events:none}.Qd5ZYq_remove{corner-shape:round;cursor:pointer;background:0 0;border:none;border-radius:50%}.Qd5ZYq_quoteMark,.Qd5ZYq_closeMark{grid-area:1/1;transition:opacity .12s}.Qd5ZYq_closeMark,.Qd5ZYq_quote[data-removable]:focus-within .Qd5ZYq_quoteMark{opacity:0}.Qd5ZYq_quote[data-removable]:focus-within .Qd5ZYq_closeMark{opacity:1}@media (hover:hover){.Qd5ZYq_quote[data-removable]:hover .Qd5ZYq_quoteMark{opacity:0}.Qd5ZYq_quote[data-removable]:hover .Qd5ZYq_closeMark{opacity:1}}@media (hover:none){.Qd5ZYq_quote[data-removable] .Qd5ZYq_quoteMark{opacity:0}.Qd5ZYq_quote[data-removable] .Qd5ZYq_closeMark{opacity:1}}";
|
|
1373
|
+
document.head.appendChild(element);
|
|
1374
|
+
}
|
|
1375
|
+
var QuotePreview_module_default = { "quote": "Qd5ZYq_quote", "popoverText": "Qd5ZYq_popoverText", "marker": "Qd5ZYq_marker", "remove": "Qd5ZYq_remove", "quoteMark": "Qd5ZYq_quoteMark", "source": "Qd5ZYq_source", "closeMark": "Qd5ZYq_closeMark" };
|
|
1376
|
+
|
|
1377
|
+
// src/QuotePreview.tsx
|
|
1378
|
+
import { jsx as jsx18, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1379
|
+
function QuoteMarkIcon({ className }) {
|
|
1380
|
+
return /* @__PURE__ */ jsx18("svg", { width: 16, height: 16, className, viewBox: "0 0 16 16", fill: "none", "aria-hidden": true, children: /* @__PURE__ */ jsxs14("g", { transform: "translate(6.8 2.4)", children: [
|
|
1381
|
+
/* @__PURE__ */ jsx18(
|
|
1382
|
+
"path",
|
|
1383
|
+
{
|
|
1384
|
+
d: "M2.8125 0.583008L3.2002 1.16602C2.43912 1.6713 1.88491 2.41238 1.60547 3.25684H2.98926V6.70605H0V4.52148C1.96593e-05 2.70313 0.9109 1.00575 2.42578 0L2.8125 0.583008Z",
|
|
1385
|
+
fill: "currentColor"
|
|
1386
|
+
}
|
|
1387
|
+
),
|
|
1388
|
+
/* @__PURE__ */ jsx18(
|
|
1389
|
+
"path",
|
|
1390
|
+
{
|
|
1391
|
+
d: "M7.50781 0.583008L7.89551 1.16602C7.13443 1.6713 6.58022 2.41238 6.30078 3.25684H7.68457V6.70605H4.69531V4.52148C4.69533 2.70313 5.60621 1.00575 7.12109 0L7.50781 0.583008Z",
|
|
1392
|
+
fill: "currentColor"
|
|
1393
|
+
}
|
|
1394
|
+
)
|
|
1395
|
+
] }) });
|
|
1396
|
+
}
|
|
1397
|
+
function QuotePreview({ text, removal }) {
|
|
1398
|
+
const sourceRef = useRef5(null);
|
|
1399
|
+
const [truncated, setTruncated] = useState4(false);
|
|
1400
|
+
useLayoutEffect3(() => {
|
|
1401
|
+
const source = sourceRef.current;
|
|
1402
|
+
if (source === null) return;
|
|
1403
|
+
const measure = () => {
|
|
1404
|
+
const clipped = source.scrollWidth > source.clientWidth;
|
|
1405
|
+
setTruncated(clipped);
|
|
1406
|
+
};
|
|
1407
|
+
measure();
|
|
1408
|
+
if (typeof ResizeObserver === "undefined") return;
|
|
1409
|
+
const observer = new ResizeObserver(measure);
|
|
1410
|
+
observer.observe(source);
|
|
1411
|
+
return () => {
|
|
1412
|
+
observer.disconnect();
|
|
1413
|
+
};
|
|
1414
|
+
}, [text]);
|
|
1415
|
+
const remove = (event) => {
|
|
1416
|
+
event.preventDefault();
|
|
1417
|
+
event.stopPropagation();
|
|
1418
|
+
removal?.onRemove();
|
|
1419
|
+
};
|
|
1420
|
+
const preview = /* @__PURE__ */ jsxs14("span", { className: QuotePreview_module_default.quote, "data-quote-preview": "", "data-removable": removal === void 0 ? void 0 : "", children: [
|
|
1421
|
+
removal === void 0 ? /* @__PURE__ */ jsx18("span", { className: QuotePreview_module_default.marker, "aria-hidden": true, children: /* @__PURE__ */ jsx18(QuoteMarkIcon, { className: QuotePreview_module_default.quoteMark }) }) : /* @__PURE__ */ jsxs14(
|
|
1422
|
+
"button",
|
|
1423
|
+
{
|
|
1424
|
+
type: "button",
|
|
1425
|
+
className: QuotePreview_module_default.remove,
|
|
1426
|
+
"aria-label": removal.label,
|
|
1427
|
+
onPointerDown: (event) => {
|
|
1428
|
+
event.preventDefault();
|
|
1429
|
+
event.stopPropagation();
|
|
1430
|
+
},
|
|
1431
|
+
onKeyDown: (event) => {
|
|
1432
|
+
event.stopPropagation();
|
|
1433
|
+
},
|
|
1434
|
+
onClick: remove,
|
|
1435
|
+
children: [
|
|
1436
|
+
/* @__PURE__ */ jsx18(QuoteMarkIcon, { className: QuotePreview_module_default.quoteMark }),
|
|
1437
|
+
/* @__PURE__ */ jsx18(IconCloseOutlineRegular, { size: 12, className: QuotePreview_module_default.closeMark })
|
|
1438
|
+
]
|
|
1439
|
+
}
|
|
1440
|
+
),
|
|
1441
|
+
/* @__PURE__ */ jsx18("span", { ref: sourceRef, className: QuotePreview_module_default.source, "data-quote-preview-text": "", children: text })
|
|
1442
|
+
] });
|
|
1443
|
+
return /* @__PURE__ */ jsx18(
|
|
1444
|
+
HoverCard,
|
|
1445
|
+
{
|
|
1446
|
+
inline: true,
|
|
1447
|
+
grouped: true,
|
|
1448
|
+
fitContent: true,
|
|
1449
|
+
openDelayMs: 0,
|
|
1450
|
+
disabled: !truncated,
|
|
1451
|
+
anchor: preview,
|
|
1452
|
+
content: /* @__PURE__ */ jsx18("span", { className: QuotePreview_module_default.popoverText, "data-quote-popover": "", "aria-hidden": "true", children: text })
|
|
1453
|
+
}
|
|
1454
|
+
);
|
|
1455
|
+
}
|
|
1456
|
+
|
|
1457
|
+
// src/Toast.tsx
|
|
1458
|
+
import { Fragment as Fragment7, useEffect as useEffect5, useLayoutEffect as useLayoutEffect4, useRef as useRef6, useState as useState5 } from "react";
|
|
1459
|
+
import { createPortal as createPortal2 } from "react-dom";
|
|
1460
|
+
|
|
1461
|
+
// .build/css/Toast.module.mjs
|
|
1462
|
+
var id20 = "@seekbuddy/dsh-ui/Toast.module.css";
|
|
1463
|
+
if (typeof document !== "undefined" && !document.querySelector('style[data-dsh-ui-primitives="' + id20 + '"]')) {
|
|
1464
|
+
const element = document.createElement("style");
|
|
1465
|
+
element.setAttribute("data-dsh-ui-primitives", id20);
|
|
1466
|
+
element.textContent = "._7whosa_toast{z-index:1100;pointer-events:none;border-radius:var(--dsw-radius-lg);background:var(--dsw-alias-toast-bg);width:max-content;max-width:min(640px,100vw - 48px);color:var(--dsw-alias-toast-label);box-shadow:var(--dsw-shadow-lv3);animation:_7whosa_dsh-toast-in .16s ease-out, _7whosa_dsh-toast-fade 1s ease var(--dsh-toast-hold,3s) forwards;align-items:center;gap:10px;padding:12px 16px;font-size:14px;line-height:22px;display:flex;position:fixed;top:40px;left:50%;transform:translate(-50%)}._7whosa_icon{color:var(--dsw-alias-state-warn-label);flex:none;place-items:center;display:grid}._7whosa_icon._7whosa_success{color:var(--dsw-alias-state-success-primary)}._7whosa_text{min-width:0}._7whosa_action{color:var(--dsw-static-deepseek-400);font:inherit;cursor:pointer;pointer-events:auto;background:0 0;border:0;margin-inline:3px;padding:0;display:inline}@media (hover:hover){._7whosa_action:hover{opacity:.8}}@keyframes _7whosa_dsh-toast-in{0%{opacity:0;transform:translate(-50%,-6px)}to{opacity:1;transform:translate(-50%)}}@keyframes _7whosa_dsh-toast-fade{to{opacity:0;visibility:hidden}}@media (prefers-reduced-motion:reduce){._7whosa_toast{animation:_7whosa_dsh-toast-fade 1s ease var(--dsh-toast-hold,3s) forwards}}";
|
|
1467
|
+
document.head.appendChild(element);
|
|
1468
|
+
}
|
|
1469
|
+
var Toast_module_default = { "dsh-toast-fade": "_7whosa_dsh-toast-fade", "toast": "_7whosa_toast", "success": "_7whosa_success", "action": "_7whosa_action", "icon": "_7whosa_icon", "dsh-toast-in": "_7whosa_dsh-toast-in", "text": "_7whosa_text" };
|
|
1470
|
+
|
|
1471
|
+
// src/Toast.tsx
|
|
1472
|
+
import { jsx as jsx19, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1473
|
+
var HOLD_MS = 3e3;
|
|
1474
|
+
var FADE_MS = 1e3;
|
|
1475
|
+
function Toast({
|
|
1476
|
+
text,
|
|
1477
|
+
icon,
|
|
1478
|
+
tone,
|
|
1479
|
+
anchor,
|
|
1480
|
+
holdMs = HOLD_MS,
|
|
1481
|
+
actions,
|
|
1482
|
+
onDone
|
|
1483
|
+
}) {
|
|
1484
|
+
const latestOnDone = useRef6(onDone);
|
|
1485
|
+
useLayoutEffect4(() => {
|
|
1486
|
+
latestOnDone.current = onDone;
|
|
1487
|
+
}, [onDone]);
|
|
1488
|
+
useEffect5(() => {
|
|
1489
|
+
const timer = setTimeout(() => {
|
|
1490
|
+
latestOnDone.current();
|
|
1491
|
+
}, holdMs + FADE_MS);
|
|
1492
|
+
return () => {
|
|
1493
|
+
clearTimeout(timer);
|
|
1494
|
+
};
|
|
1495
|
+
}, [holdMs]);
|
|
1496
|
+
const [left, setLeft] = useState5(null);
|
|
1497
|
+
useLayoutEffect4(() => {
|
|
1498
|
+
if (anchor == null) return;
|
|
1499
|
+
const measure = () => {
|
|
1500
|
+
const rect = anchor.getBoundingClientRect();
|
|
1501
|
+
setLeft(rect.left + rect.width / 2);
|
|
1502
|
+
};
|
|
1503
|
+
measure();
|
|
1504
|
+
window.addEventListener("resize", measure);
|
|
1505
|
+
return () => {
|
|
1506
|
+
window.removeEventListener("resize", measure);
|
|
1507
|
+
};
|
|
1508
|
+
}, [anchor]);
|
|
1509
|
+
return createPortal2(
|
|
1510
|
+
/* @__PURE__ */ jsxs15(
|
|
1511
|
+
"div",
|
|
1512
|
+
{
|
|
1513
|
+
className: Toast_module_default.toast,
|
|
1514
|
+
role: "alert",
|
|
1515
|
+
style: {
|
|
1516
|
+
...left === null ? {} : { left },
|
|
1517
|
+
"--dsh-toast-hold": `${String(holdMs)}ms`
|
|
1518
|
+
},
|
|
1519
|
+
children: [
|
|
1520
|
+
tone === "success" ? /* @__PURE__ */ jsx19("span", { className: `${Toast_module_default.icon} ${Toast_module_default.success}`, "aria-hidden": true, children: /* @__PURE__ */ jsx19(IconCheckCircleOutlineRegular, {}) }) : icon !== void 0 && /* @__PURE__ */ jsx19("span", { className: Toast_module_default.icon, "aria-hidden": true, children: icon }),
|
|
1521
|
+
/* @__PURE__ */ jsxs15("span", { className: Toast_module_default.text, children: [
|
|
1522
|
+
text,
|
|
1523
|
+
actions?.map((action) => /* @__PURE__ */ jsxs15(Fragment7, { children: [
|
|
1524
|
+
action.prefix,
|
|
1525
|
+
/* @__PURE__ */ jsx19("button", { type: "button", className: Toast_module_default.action, onClick: action.onClick, children: action.label })
|
|
1526
|
+
] }, action.label))
|
|
1527
|
+
] })
|
|
1528
|
+
]
|
|
1529
|
+
}
|
|
1530
|
+
),
|
|
1531
|
+
document.body
|
|
1532
|
+
);
|
|
1533
|
+
}
|
|
1534
|
+
|
|
1535
|
+
// src/file-size.ts
|
|
1536
|
+
function fileSizeText(bytes) {
|
|
1537
|
+
if (bytes < 1024) return `${bytes}B`;
|
|
1538
|
+
const kb = bytes / 1024;
|
|
1539
|
+
if (kb < 1024) return `${kb < 10 ? kb.toFixed(1) : Math.round(kb)}KB`;
|
|
1540
|
+
const mb = kb / 1024;
|
|
1541
|
+
if (mb < 1024) return `${mb < 10 ? mb.toFixed(1) : Math.round(mb)}MB`;
|
|
1542
|
+
const gb = mb / 1024;
|
|
1543
|
+
return `${gb < 10 ? gb.toFixed(1) : Math.round(gb)}GB`;
|
|
1544
|
+
}
|
|
1545
|
+
|
|
1546
|
+
// src/relative-time.ts
|
|
1547
|
+
function relativeTime(at, now) {
|
|
1548
|
+
const MIN = 6e4;
|
|
1549
|
+
const HOUR = 36e5;
|
|
1550
|
+
const DAY = 864e5;
|
|
1551
|
+
const diff = Math.max(0, now - at);
|
|
1552
|
+
if (diff < MIN) return { unit: "now", n: 0 };
|
|
1553
|
+
if (diff < HOUR) return { unit: "minutes", n: Math.floor(diff / MIN) };
|
|
1554
|
+
if (diff < DAY) return { unit: "hours", n: Math.floor(diff / HOUR) };
|
|
1555
|
+
if (diff < 30 * DAY) return { unit: "days", n: Math.floor(diff / DAY) };
|
|
1556
|
+
if (diff < 365 * DAY) return { unit: "months", n: Math.floor(diff / (30 * DAY)) };
|
|
1557
|
+
return { unit: "years", n: Math.floor(diff / (365 * DAY)) };
|
|
1558
|
+
}
|
|
1559
|
+
|
|
1560
|
+
// src/rank-by-name.ts
|
|
1561
|
+
function boundaryBonus(name, index) {
|
|
1562
|
+
return index === 0 || name.charAt(index - 1) === "-" || name.charAt(index - 1) === "_" ? 8 : 0;
|
|
1563
|
+
}
|
|
1564
|
+
function alignmentScore(name, query) {
|
|
1565
|
+
if (query.length > name.length) return void 0;
|
|
1566
|
+
const noMatch = Number.NEGATIVE_INFINITY;
|
|
1567
|
+
let previous = Array(name.length).fill(noMatch);
|
|
1568
|
+
for (let index = 0; index < name.length; index++) {
|
|
1569
|
+
if (name.charAt(index) === query.charAt(0)) previous[index] = 1 + boundaryBonus(name, index) - index;
|
|
1570
|
+
}
|
|
1571
|
+
for (let queryIndex = 1; queryIndex < query.length; queryIndex++) {
|
|
1572
|
+
const current = Array(name.length).fill(noMatch);
|
|
1573
|
+
let left = noMatch;
|
|
1574
|
+
let leftLeft = noMatch;
|
|
1575
|
+
let bestGapped = noMatch;
|
|
1576
|
+
for (const [index, prior] of previous.entries()) {
|
|
1577
|
+
if (leftLeft !== noMatch) bestGapped = Math.max(bestGapped, leftLeft + index - 2);
|
|
1578
|
+
if (name.charAt(index) === query.charAt(queryIndex)) {
|
|
1579
|
+
const bonus = 1 + boundaryBonus(name, index);
|
|
1580
|
+
let score = noMatch;
|
|
1581
|
+
if (left !== noMatch) score = left + bonus + 4;
|
|
1582
|
+
if (bestGapped !== noMatch) score = Math.max(score, bestGapped + bonus + 1 - index);
|
|
1583
|
+
current[index] = score;
|
|
1584
|
+
}
|
|
1585
|
+
leftLeft = left;
|
|
1586
|
+
left = prior;
|
|
1587
|
+
}
|
|
1588
|
+
previous = current;
|
|
1589
|
+
}
|
|
1590
|
+
let best = noMatch;
|
|
1591
|
+
for (const score of previous) best = Math.max(best, score);
|
|
1592
|
+
return best === noMatch ? void 0 : best;
|
|
1593
|
+
}
|
|
1594
|
+
function rankByName(items, rawQuery) {
|
|
1595
|
+
const query = rawQuery.toLowerCase();
|
|
1596
|
+
if (query === "") return items;
|
|
1597
|
+
const ranked = [];
|
|
1598
|
+
items.forEach((item, index) => {
|
|
1599
|
+
const keys = item.label === void 0 ? [item.name] : [item.name, item.label];
|
|
1600
|
+
let prefix = false;
|
|
1601
|
+
let score;
|
|
1602
|
+
for (const key of keys) {
|
|
1603
|
+
const lower = key.toLowerCase();
|
|
1604
|
+
const keyScore = alignmentScore(lower, query);
|
|
1605
|
+
if (keyScore === void 0) continue;
|
|
1606
|
+
prefix || (prefix = lower.startsWith(query));
|
|
1607
|
+
score = score === void 0 ? keyScore : Math.max(score, keyScore);
|
|
1608
|
+
}
|
|
1609
|
+
if (score !== void 0) ranked.push({ item, index, prefix, score });
|
|
1610
|
+
});
|
|
1611
|
+
ranked.sort(
|
|
1612
|
+
(left, right) => Number(right.prefix) - Number(left.prefix) || right.score - left.score || left.index - right.index
|
|
1613
|
+
);
|
|
1614
|
+
return ranked.map((match) => match.item);
|
|
1615
|
+
}
|
|
1616
|
+
|
|
1617
|
+
// src/darwin-desktop.ts
|
|
1618
|
+
function isDarwinDesktop() {
|
|
1619
|
+
return document.documentElement.dataset.platform === "darwin";
|
|
1620
|
+
}
|
|
1621
|
+
export {
|
|
1622
|
+
AnimatedRows,
|
|
1623
|
+
Button,
|
|
1624
|
+
Checkbox,
|
|
1625
|
+
ConnectionIndicator,
|
|
1626
|
+
DOCUMENT_ZOOM,
|
|
1627
|
+
DisclosureRow,
|
|
1628
|
+
DraggableImage,
|
|
1629
|
+
HoverCard,
|
|
1630
|
+
HoverCardGroup,
|
|
1631
|
+
ImageLightbox,
|
|
1632
|
+
InlineEditor,
|
|
1633
|
+
Input,
|
|
1634
|
+
MENU_TRANSITION_MS,
|
|
1635
|
+
Menu,
|
|
1636
|
+
MenuGroup,
|
|
1637
|
+
MenuItemButton,
|
|
1638
|
+
MenuSurface,
|
|
1639
|
+
Modal,
|
|
1640
|
+
Pill,
|
|
1641
|
+
QuotePreview,
|
|
1642
|
+
ReferenceChip,
|
|
1643
|
+
RiskConfirmation,
|
|
1644
|
+
SegmentedControl,
|
|
1645
|
+
SegmentedTabs,
|
|
1646
|
+
ShortcutKeys,
|
|
1647
|
+
StateDot,
|
|
1648
|
+
Switch,
|
|
1649
|
+
Tag,
|
|
1650
|
+
TextShimmer,
|
|
1651
|
+
Toast,
|
|
1652
|
+
Tooltip,
|
|
1653
|
+
UserMessageBubble,
|
|
1654
|
+
UserTextRun,
|
|
1655
|
+
ZoomControls,
|
|
1656
|
+
closeTopModal,
|
|
1657
|
+
fileSizeText,
|
|
1658
|
+
focusWithoutRing,
|
|
1659
|
+
isBehindModal,
|
|
1660
|
+
isDarwinDesktop,
|
|
1661
|
+
isMobileDevice,
|
|
1662
|
+
modalSelector,
|
|
1663
|
+
observeComposition,
|
|
1664
|
+
observeStickyMenuGroups,
|
|
1665
|
+
pointerModality,
|
|
1666
|
+
rankByName,
|
|
1667
|
+
relativeTime,
|
|
1668
|
+
useAnchoredMaxHeight,
|
|
1669
|
+
useAnchoredPosition,
|
|
1670
|
+
useClipboardCopy,
|
|
1671
|
+
useDismissOnOutsidePointer,
|
|
1672
|
+
useModalLayer,
|
|
1673
|
+
useRowDragPreview,
|
|
1674
|
+
writeClipboard
|
|
1675
|
+
};
|