@seekbuddy/dsh-ui 0.0.0-stage → 0.2.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +49 -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 +56 -0
- package/dist/blocks.js +1582 -0
- package/dist/chunks/chunk-23KOEBWJ.js +104 -0
- package/dist/chunks/chunk-3HCOU44R.js +697 -0
- package/dist/chunks/chunk-5JXG4BHW.js +31 -0
- package/dist/chunks/chunk-5XDVPALS.js +61 -0
- package/dist/chunks/chunk-AY44MQMD.js +3052 -0
- package/dist/chunks/chunk-B3EEK7A2.js +408 -0
- package/dist/chunks/chunk-CEBTQO6W.js +24 -0
- package/dist/chunks/chunk-CI73NXA5.js +202 -0
- package/dist/chunks/chunk-CTQPGUZP.js +22 -0
- package/dist/chunks/chunk-F352IICS.js +57 -0
- package/dist/chunks/chunk-IOBKTEKP.js +144 -0
- package/dist/chunks/chunk-KETGFAOH.js +66 -0
- package/dist/chunks/chunk-LA3QDZYN.js +2777 -0
- package/dist/chunks/chunk-NE62SYOZ.js +89 -0
- package/dist/chunks/chunk-OQPH36OI.js +754 -0
- package/dist/chunks/chunk-QJKAQ6PO.js +155 -0
- package/dist/chunks/chunk-R6AUJQ3G.js +129 -0
- package/dist/chunks/chunk-RNVSCTW7.js +24 -0
- package/dist/chunks/chunk-RZOP2PFC.js +152 -0
- package/dist/chunks/chunk-TQU54HSM.js +112 -0
- package/dist/chunks/chunk-TUK6UGXM.js +36 -0
- package/dist/chunks/chunk-TZ7HRE6D.js +328 -0
- package/dist/chunks/chunk-VIH56PDF.js +57 -0
- package/dist/chunks/chunk-WUL523OW.js +27 -0
- package/dist/chunks/chunk-XX6MSZLS.js +261 -0
- package/dist/chunks/chunk-ZA47FP7C.js +7 -0
- package/dist/chunks/chunk-ZZNL5PWF.js +170 -0
- package/dist/icons.js +803 -0
- package/dist/index.js +1182 -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 +148 -0
- package/dist/meta.json +6876 -0
- package/dist/root-inputs.json +67 -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 +934 -0
- package/dist/tokens.css.d.ts +2 -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/ConfigField.d.ts +32 -0
- package/dist/types/ConnectionIndicator.d.ts +25 -0
- package/dist/types/DiffBlock.d.ts +51 -0
- package/dist/types/DisclosureRow.d.ts +35 -0
- package/dist/types/FileTypeIcon.d.ts +42 -0
- package/dist/types/FoldToggle.d.ts +19 -0
- package/dist/types/HoverCard.d.ts +36 -0
- package/dist/types/ImageLightbox.d.ts +26 -0
- package/dist/types/ImagePreview.d.ts +11 -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 +142 -0
- package/dist/types/MenuGroup.d.ts +21 -0
- package/dist/types/MenuSurface.d.ts +15 -0
- package/dist/types/Modal.d.ts +43 -0
- package/dist/types/PermissionIcon.d.ts +38 -0
- package/dist/types/Pill.d.ts +12 -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 +25 -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 +77 -0
- package/dist/types/TextShimmer.d.ts +22 -0
- package/dist/types/Toast.d.ts +48 -0
- package/dist/types/Tooltip.d.ts +63 -0
- package/dist/types/WebBlock.d.ts +60 -0
- package/dist/types/ansi.d.ts +16 -0
- package/dist/types/blocks.d.ts +19 -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/file-size.d.ts +7 -0
- package/dist/types/focus.d.ts +8 -0
- package/dist/types/guide-artwork.d.ts +14 -0
- package/dist/types/head-tail-cap.d.ts +22 -0
- package/dist/types/icons/index.d.ts +384 -0
- package/dist/types/icons/props.d.ts +8 -0
- package/dist/types/icons/shared-artwork.d.ts +42 -0
- package/dist/types/icons.d.ts +6 -0
- package/dist/types/index.d.ts +53 -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 +45 -0
- package/dist/types/markdown/MarkdownText.d.ts +47 -0
- package/dist/types/markdown/cjkFriendlyStrong.d.ts +8 -0
- package/dist/types/markdown/file-link.d.ts +12 -0
- package/dist/types/markdown/highlight.d.ts +147 -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/render.d.ts +140 -0
- package/dist/types/markdown/useViewportHighlighting.d.ts +10 -0
- package/dist/types/markdown.d.ts +9 -0
- package/dist/types/overlay-top-margin.d.ts +7 -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/use-copy-feedback.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/user-text.d.ts +36 -0
- package/package.json +151 -4
package/dist/index.js
ADDED
|
@@ -0,0 +1,1182 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Menu,
|
|
3
|
+
MenuItemButton,
|
|
4
|
+
MenuSurface,
|
|
5
|
+
Pill,
|
|
6
|
+
StateDot,
|
|
7
|
+
closeTopModal,
|
|
8
|
+
focusWithoutRing,
|
|
9
|
+
isBehindModal,
|
|
10
|
+
modalSelector,
|
|
11
|
+
observeComposition,
|
|
12
|
+
useModalLayer
|
|
13
|
+
} from "./chunks/chunk-3HCOU44R.js";
|
|
14
|
+
import {
|
|
15
|
+
HoverCard,
|
|
16
|
+
ImageLightbox,
|
|
17
|
+
MarkdownText_module_default,
|
|
18
|
+
ShortcutKeys,
|
|
19
|
+
Tooltip,
|
|
20
|
+
overlayTopMargin,
|
|
21
|
+
pointerModality,
|
|
22
|
+
useDismissOnOutsidePointer,
|
|
23
|
+
writeClipboard
|
|
24
|
+
} from "./chunks/chunk-OQPH36OI.js";
|
|
25
|
+
import {
|
|
26
|
+
ReferenceIconRegular
|
|
27
|
+
} from "./chunks/chunk-5JXG4BHW.js";
|
|
28
|
+
import {
|
|
29
|
+
IconCheckCircleOutlineRegular,
|
|
30
|
+
IconCheckOutlineRegular,
|
|
31
|
+
IconChevronDownOutlineRegular,
|
|
32
|
+
IconChevronUpOutlineRegular,
|
|
33
|
+
IconCloseOutlineRegular,
|
|
34
|
+
IconRefreshOutlineRegular,
|
|
35
|
+
IconWarningOutlineRegular
|
|
36
|
+
} from "./chunks/chunk-LA3QDZYN.js";
|
|
37
|
+
import "./chunks/chunk-ZA47FP7C.js";
|
|
38
|
+
|
|
39
|
+
// src/DisclosureRow.tsx
|
|
40
|
+
import { memo as memo2 } from "react";
|
|
41
|
+
import clsx2 from "clsx";
|
|
42
|
+
|
|
43
|
+
// src/TextShimmer.tsx
|
|
44
|
+
import * as React from "react";
|
|
45
|
+
import { memo, useContext } from "react";
|
|
46
|
+
import clsx from "clsx";
|
|
47
|
+
|
|
48
|
+
// .build/css/TextShimmer.module.mjs
|
|
49
|
+
var id = "@seekbuddy/dsh-ui/TextShimmer.module.css";
|
|
50
|
+
if (typeof document !== "undefined" && !document.querySelector('style[data-dsh-ui-primitives="' + id + '"]')) {
|
|
51
|
+
const element = document.createElement("style");
|
|
52
|
+
element.setAttribute("data-dsh-ui-primitives", id);
|
|
53
|
+
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}}";
|
|
54
|
+
document.head.appendChild(element);
|
|
55
|
+
}
|
|
56
|
+
var TextShimmer_module_default = { "decoration": "sFCb2G_decoration", "highlight": "sFCb2G_highlight", "text": "sFCb2G_text", "sweep": "sFCb2G_sweep", "root": "sFCb2G_root", "dsh-row-shimmer-sweep": "sFCb2G_dsh-row-shimmer-sweep", "dsh-row-shimmer-highlight": "sFCb2G_dsh-row-shimmer-highlight", "content": "sFCb2G_content" };
|
|
57
|
+
|
|
58
|
+
// src/TextShimmer.tsx
|
|
59
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
60
|
+
var DecorativeCopy = typeof React.createContext === "function" ? React.createContext(void 0) : null;
|
|
61
|
+
function TextContent({ children, className }) {
|
|
62
|
+
const decorative = useContext(DecorativeCopy);
|
|
63
|
+
const generated = decorative === true && typeof children === "string";
|
|
64
|
+
return /* @__PURE__ */ jsx("span", { className: clsx(TextShimmer_module_default.text, className), "data-shimmer-text": generated ? children : void 0, children: generated ? null : children });
|
|
65
|
+
}
|
|
66
|
+
var TextShimmer = memo(function TextShimmer2({
|
|
67
|
+
children,
|
|
68
|
+
active = false,
|
|
69
|
+
className,
|
|
70
|
+
contentClassName
|
|
71
|
+
}) {
|
|
72
|
+
const decorative = useContext(DecorativeCopy);
|
|
73
|
+
if (decorative !== void 0) return /* @__PURE__ */ jsx(TextContent, { className, children });
|
|
74
|
+
const content = typeof children === "string" ? /* @__PURE__ */ jsx(TextContent, { children }) : children;
|
|
75
|
+
return /* @__PURE__ */ jsxs("span", { className: clsx(TextShimmer_module_default.root, className), "data-shimmer": active || void 0, children: [
|
|
76
|
+
/* @__PURE__ */ jsx(DecorativeCopy.Provider, { value: false, children: /* @__PURE__ */ jsx("span", { className: clsx(TextShimmer_module_default.content, contentClassName), children: content }) }),
|
|
77
|
+
active && // React 18 forwards inert as an empty string; a boolean is dropped.
|
|
78
|
+
/* @__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 }) }) }) })
|
|
79
|
+
] });
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
// .build/css/DisclosureRow.module.mjs
|
|
83
|
+
var id2 = "@seekbuddy/dsh-ui/DisclosureRow.module.css";
|
|
84
|
+
if (typeof document !== "undefined" && !document.querySelector('style[data-dsh-ui-primitives="' + id2 + '"]')) {
|
|
85
|
+
const element = document.createElement("style");
|
|
86
|
+
element.setAttribute("data-dsh-ui-primitives", id2);
|
|
87
|
+
element.textContent = "._1_lb6a_root{flex-direction:column;width:100%;min-width:0;display:flex}._1_lb6a_row{height:calc(24px + var(--dsh-content-font-delta,0px));min-width:0;color:var(--dsw-alias-label-tertiary);align-items:center;transition:color .1s;display:flex;position:relative;overflow:hidden}._1_lb6a_row[data-expandable]{cursor:pointer}._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}._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}}";
|
|
88
|
+
document.head.appendChild(element);
|
|
89
|
+
}
|
|
90
|
+
var DisclosureRow_module_default = { "title": "_1_lb6a_title", "row": "_1_lb6a_row", "leading": "_1_lb6a_leading", "root": "_1_lb6a_root", "iconIdle": "_1_lb6a_iconIdle", "chevronHover": "_1_lb6a_chevronHover" };
|
|
91
|
+
|
|
92
|
+
// src/DisclosureRow.tsx
|
|
93
|
+
import { Fragment, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
94
|
+
var DisclosureRow = memo2(function DisclosureRow2({
|
|
95
|
+
icon,
|
|
96
|
+
title,
|
|
97
|
+
open,
|
|
98
|
+
expandable,
|
|
99
|
+
onToggle,
|
|
100
|
+
running = false,
|
|
101
|
+
expandOnRowClick = false,
|
|
102
|
+
previewChevron = expandable,
|
|
103
|
+
keepContentWhenOpen = false,
|
|
104
|
+
collapsedContent,
|
|
105
|
+
children,
|
|
106
|
+
className,
|
|
107
|
+
rowClassName,
|
|
108
|
+
contentClassName,
|
|
109
|
+
contentLayoutClassName,
|
|
110
|
+
leadingClassName,
|
|
111
|
+
chevronClassName,
|
|
112
|
+
titleClassName
|
|
113
|
+
}) {
|
|
114
|
+
const rowExpands = expandable && expandOnRowClick;
|
|
115
|
+
const toggleFromLeading = (event) => {
|
|
116
|
+
event.stopPropagation();
|
|
117
|
+
onToggle();
|
|
118
|
+
};
|
|
119
|
+
const toggleFromKeyboard = (event) => {
|
|
120
|
+
if (!rowExpands || event.key !== "Enter" && event.key !== " ") return;
|
|
121
|
+
event.preventDefault();
|
|
122
|
+
onToggle();
|
|
123
|
+
};
|
|
124
|
+
const collapsedLeading = previewChevron ? /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
125
|
+
/* @__PURE__ */ jsx2("span", { className: DisclosureRow_module_default.iconIdle, children: icon }),
|
|
126
|
+
/* @__PURE__ */ jsx2(IconChevronDownOutlineRegular, { className: clsx2(chevronClassName, DisclosureRow_module_default.chevronHover) })
|
|
127
|
+
] }) : icon;
|
|
128
|
+
const leading = open ? /* @__PURE__ */ jsx2(IconChevronUpOutlineRegular, { className: chevronClassName }) : collapsedLeading;
|
|
129
|
+
return /* @__PURE__ */ jsxs2("div", { className: clsx2(DisclosureRow_module_default.root, className), "data-open": open || void 0, children: [
|
|
130
|
+
/* @__PURE__ */ jsxs2(
|
|
131
|
+
"div",
|
|
132
|
+
{
|
|
133
|
+
className: clsx2(DisclosureRow_module_default.row, rowClassName),
|
|
134
|
+
"data-disclosure-row": true,
|
|
135
|
+
"data-expandable": rowExpands || void 0,
|
|
136
|
+
role: rowExpands ? "button" : void 0,
|
|
137
|
+
tabIndex: rowExpands ? 0 : void 0,
|
|
138
|
+
"aria-expanded": rowExpands ? open : void 0,
|
|
139
|
+
onClick: rowExpands ? onToggle : void 0,
|
|
140
|
+
onKeyDown: rowExpands ? toggleFromKeyboard : void 0,
|
|
141
|
+
children: [
|
|
142
|
+
expandable && !rowExpands ? /* @__PURE__ */ jsx2(
|
|
143
|
+
"button",
|
|
144
|
+
{
|
|
145
|
+
type: "button",
|
|
146
|
+
className: clsx2(DisclosureRow_module_default.leading, leadingClassName),
|
|
147
|
+
"aria-label": title,
|
|
148
|
+
"aria-expanded": open,
|
|
149
|
+
onClick: toggleFromLeading,
|
|
150
|
+
children: leading
|
|
151
|
+
}
|
|
152
|
+
) : /* @__PURE__ */ jsx2("span", { className: clsx2(DisclosureRow_module_default.leading, leadingClassName), children: leading }),
|
|
153
|
+
/* @__PURE__ */ jsxs2(TextShimmer, { active: running, className: contentClassName, contentClassName: contentLayoutClassName, children: [
|
|
154
|
+
/* @__PURE__ */ jsx2(TextShimmer, { className: clsx2(DisclosureRow_module_default.title, titleClassName), children: title }),
|
|
155
|
+
(keepContentWhenOpen || !open) && collapsedContent
|
|
156
|
+
] })
|
|
157
|
+
]
|
|
158
|
+
}
|
|
159
|
+
),
|
|
160
|
+
open && children
|
|
161
|
+
] });
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
// src/Button.tsx
|
|
165
|
+
import { forwardRef } from "react";
|
|
166
|
+
import clsx3 from "clsx";
|
|
167
|
+
|
|
168
|
+
// .build/css/Button.module.mjs
|
|
169
|
+
var id3 = "@seekbuddy/dsh-ui/Button.module.css";
|
|
170
|
+
if (typeof document !== "undefined" && !document.querySelector('style[data-dsh-ui-primitives="' + id3 + '"]')) {
|
|
171
|
+
const element = document.createElement("style");
|
|
172
|
+
element.setAttribute("data-dsh-ui-primitives", id3);
|
|
173
|
+
element.textContent = ".wa-Ieq_button{box-sizing:border-box;border-radius:var(--dsw-radius-md);cursor:pointer;color:var(--dsw-alias-label-primary);background:0 0;border:none;justify-content:center;align-items:center;gap:4px;padding:0 14px;font-size:14px;line-height:22px;display:inline-flex}.wa-Ieq_button:disabled{cursor:not-allowed;opacity:.4}.wa-Ieq_md{height:36px}.wa-Ieq_sm{border-radius:var(--dsw-radius-sm);height:28px;padding:0 10px;font-size:12px;line-height:18px}.wa-Ieq_primary{background:var(--dsw-alias-button-primary-fill);color:var(--dsw-alias-label-primary-foreground)}.wa-Ieq_primary:hover:not(:disabled){background:var(--dsw-alias-button-primary-hover)}.wa-Ieq_ghost:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover)}.wa-Ieq_ghost:active:not(:disabled){background:var(--dsw-alias-interactive-bg-active)}.wa-Ieq_outline{border:.5px solid var(--dsw-alias-border-l3);background:0 0}.wa-Ieq_outline:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover)}.wa-Ieq_toolbar{background:var(--dsw-alias-button-tool-bar-fill)}.wa-Ieq_toolbar:hover:not(:disabled){background:var(--dsw-alias-button-tool-bar-hover)}.wa-Ieq_icon{justify-content:center;align-items:center;width:16px;height:16px;display:inline-flex}";
|
|
174
|
+
document.head.appendChild(element);
|
|
175
|
+
}
|
|
176
|
+
var Button_module_default = { "icon": "wa-Ieq_icon", "sm": "wa-Ieq_sm", "primary": "wa-Ieq_primary", "md": "wa-Ieq_md", "outline": "wa-Ieq_outline", "toolbar": "wa-Ieq_toolbar", "ghost": "wa-Ieq_ghost", "button": "wa-Ieq_button" };
|
|
177
|
+
|
|
178
|
+
// src/Button.tsx
|
|
179
|
+
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
180
|
+
var Button = forwardRef(function Button2({ variant = "ghost", size = "md", icon, className, children, ...rest }, ref) {
|
|
181
|
+
return /* @__PURE__ */ jsxs3("button", { ref, type: "button", className: clsx3(Button_module_default.button, Button_module_default[variant], Button_module_default[size], className), ...rest, children: [
|
|
182
|
+
icon != null && /* @__PURE__ */ jsx3("span", { className: Button_module_default.icon, children: icon }),
|
|
183
|
+
children
|
|
184
|
+
] });
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
// src/SegmentedTabs.tsx
|
|
188
|
+
import clsx4 from "clsx";
|
|
189
|
+
|
|
190
|
+
// .build/css/SegmentedTabs.module.mjs
|
|
191
|
+
var id4 = "@seekbuddy/dsh-ui/SegmentedTabs.module.css";
|
|
192
|
+
if (typeof document !== "undefined" && !document.querySelector('style[data-dsh-ui-primitives="' + id4 + '"]')) {
|
|
193
|
+
const element = document.createElement("style");
|
|
194
|
+
element.setAttribute("data-dsh-ui-primitives", id4);
|
|
195
|
+
element.textContent = ".zfSGJW_tabs{border-radius:var(--dsw-radius-lg);background:var(--dsw-alias-bg-module-platform);padding:4px;display:grid;position:relative}.zfSGJW_indicator{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;inset:4px auto 4px 4px}.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:hover,.zfSGJW_tab[aria-selected=true]{color:var(--dsw-alias-label-primary);background:0 0}.zfSGJW_tab[aria-selected=true]{font-weight:600}.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}}";
|
|
196
|
+
document.head.appendChild(element);
|
|
197
|
+
}
|
|
198
|
+
var SegmentedTabs_module_default = { "tab": "zfSGJW_tab", "tabs": "zfSGJW_tabs", "indicator": "zfSGJW_indicator" };
|
|
199
|
+
|
|
200
|
+
// src/SegmentedTabs.tsx
|
|
201
|
+
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
202
|
+
function SegmentedTabs({
|
|
203
|
+
items,
|
|
204
|
+
value,
|
|
205
|
+
onChange,
|
|
206
|
+
label,
|
|
207
|
+
className
|
|
208
|
+
}) {
|
|
209
|
+
const selectedIndex = items.findIndex((item) => item.value === value);
|
|
210
|
+
const onKeyDown = (event, index) => {
|
|
211
|
+
let next;
|
|
212
|
+
switch (event.key) {
|
|
213
|
+
case "ArrowLeft":
|
|
214
|
+
next = (index + items.length - 1) % items.length;
|
|
215
|
+
break;
|
|
216
|
+
case "ArrowRight":
|
|
217
|
+
next = (index + 1) % items.length;
|
|
218
|
+
break;
|
|
219
|
+
case "Home":
|
|
220
|
+
next = 0;
|
|
221
|
+
break;
|
|
222
|
+
case "End":
|
|
223
|
+
next = items.length - 1;
|
|
224
|
+
break;
|
|
225
|
+
default:
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
event.preventDefault();
|
|
229
|
+
event.stopPropagation();
|
|
230
|
+
const tablist = event.currentTarget.parentElement;
|
|
231
|
+
const nextItem = items[next];
|
|
232
|
+
if (tablist === null || nextItem === void 0) return;
|
|
233
|
+
tablist.querySelectorAll('[role="tab"]').item(next).focus();
|
|
234
|
+
onChange(nextItem.value);
|
|
235
|
+
};
|
|
236
|
+
return /* @__PURE__ */ jsxs4(
|
|
237
|
+
"div",
|
|
238
|
+
{
|
|
239
|
+
role: "tablist",
|
|
240
|
+
"aria-label": label,
|
|
241
|
+
className: clsx4(SegmentedTabs_module_default.tabs, className),
|
|
242
|
+
style: { gridTemplateColumns: `repeat(${items.length}, minmax(0, 1fr))` },
|
|
243
|
+
children: [
|
|
244
|
+
/* @__PURE__ */ jsx4(
|
|
245
|
+
"span",
|
|
246
|
+
{
|
|
247
|
+
className: SegmentedTabs_module_default.indicator,
|
|
248
|
+
"aria-hidden": "true",
|
|
249
|
+
style: { width: `calc((100% - 8px) / ${items.length})`, transform: `translateX(${selectedIndex * 100}%)` }
|
|
250
|
+
}
|
|
251
|
+
),
|
|
252
|
+
items.map((item, index) => /* @__PURE__ */ jsx4(
|
|
253
|
+
Pill,
|
|
254
|
+
{
|
|
255
|
+
id: item.id,
|
|
256
|
+
role: "tab",
|
|
257
|
+
className: SegmentedTabs_module_default.tab,
|
|
258
|
+
"aria-selected": value === item.value,
|
|
259
|
+
"aria-controls": item.panelId,
|
|
260
|
+
tabIndex: value === item.value ? 0 : -1,
|
|
261
|
+
onClick: () => {
|
|
262
|
+
onChange(item.value);
|
|
263
|
+
},
|
|
264
|
+
onKeyDown: (event) => {
|
|
265
|
+
onKeyDown(event, index);
|
|
266
|
+
},
|
|
267
|
+
children: item.label
|
|
268
|
+
},
|
|
269
|
+
item.value
|
|
270
|
+
))
|
|
271
|
+
]
|
|
272
|
+
}
|
|
273
|
+
);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
// src/Tag.tsx
|
|
277
|
+
import clsx5 from "clsx";
|
|
278
|
+
|
|
279
|
+
// .build/css/Tag.module.mjs
|
|
280
|
+
var id5 = "@seekbuddy/dsh-ui/Tag.module.css";
|
|
281
|
+
if (typeof document !== "undefined" && !document.querySelector('style[data-dsh-ui-primitives="' + id5 + '"]')) {
|
|
282
|
+
const element = document.createElement("style");
|
|
283
|
+
element.setAttribute("data-dsh-ui-primitives", id5);
|
|
284
|
+
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)}";
|
|
285
|
+
document.head.appendChild(element);
|
|
286
|
+
}
|
|
287
|
+
var Tag_module_default = { "tag": "bkMBDa_tag" };
|
|
288
|
+
|
|
289
|
+
// src/Tag.tsx
|
|
290
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
291
|
+
function Tag({
|
|
292
|
+
tone = "outline",
|
|
293
|
+
className,
|
|
294
|
+
children
|
|
295
|
+
}) {
|
|
296
|
+
return /* @__PURE__ */ jsx5("span", { className: clsx5(Tag_module_default.tag, className), "data-tone": tone, children });
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
// src/Switch.tsx
|
|
300
|
+
import clsx6 from "clsx";
|
|
301
|
+
|
|
302
|
+
// .build/css/Switch.module.mjs
|
|
303
|
+
var id6 = "@seekbuddy/dsh-ui/Switch.module.css";
|
|
304
|
+
if (typeof document !== "undefined" && !document.querySelector('style[data-dsh-ui-primitives="' + id6 + '"]')) {
|
|
305
|
+
const element = document.createElement("style");
|
|
306
|
+
element.setAttribute("data-dsh-ui-primitives", id6);
|
|
307
|
+
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)}";
|
|
308
|
+
document.head.appendChild(element);
|
|
309
|
+
}
|
|
310
|
+
var Switch_module_default = { "switch": "POxp2W_switch", "thumb": "POxp2W_thumb" };
|
|
311
|
+
|
|
312
|
+
// src/Switch.tsx
|
|
313
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
314
|
+
function Switch({
|
|
315
|
+
checked,
|
|
316
|
+
onChange,
|
|
317
|
+
label,
|
|
318
|
+
disabled = false,
|
|
319
|
+
title,
|
|
320
|
+
className
|
|
321
|
+
}) {
|
|
322
|
+
return /* @__PURE__ */ jsx6(
|
|
323
|
+
"button",
|
|
324
|
+
{
|
|
325
|
+
type: "button",
|
|
326
|
+
role: "switch",
|
|
327
|
+
"aria-checked": checked,
|
|
328
|
+
"aria-label": label,
|
|
329
|
+
title,
|
|
330
|
+
disabled,
|
|
331
|
+
className: clsx6(Switch_module_default.switch, className),
|
|
332
|
+
onClick: () => {
|
|
333
|
+
onChange(!checked);
|
|
334
|
+
},
|
|
335
|
+
children: /* @__PURE__ */ jsx6("span", { className: Switch_module_default.thumb })
|
|
336
|
+
}
|
|
337
|
+
);
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
// src/SegmentedControl.tsx
|
|
341
|
+
import { useEffect, useRef } from "react";
|
|
342
|
+
import clsx7 from "clsx";
|
|
343
|
+
|
|
344
|
+
// .build/css/SegmentedControl.module.mjs
|
|
345
|
+
var id7 = "@seekbuddy/dsh-ui/SegmentedControl.module.css";
|
|
346
|
+
if (typeof document !== "undefined" && !document.querySelector('style[data-dsh-ui-primitives="' + id7 + '"]')) {
|
|
347
|
+
const element = document.createElement("style");
|
|
348
|
+
element.setAttribute("data-dsh-ui-primitives", id7);
|
|
349
|
+
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:hover:not(:disabled),._4Yr7Ka_tab[aria-selected=true]{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}}";
|
|
350
|
+
document.head.appendChild(element);
|
|
351
|
+
}
|
|
352
|
+
var SegmentedControl_module_default = { "tab": "_4Yr7Ka_tab", "control": "_4Yr7Ka_control", "indicator": "_4Yr7Ka_indicator" };
|
|
353
|
+
|
|
354
|
+
// src/SegmentedControl.tsx
|
|
355
|
+
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
356
|
+
function isWalkKey(key) {
|
|
357
|
+
return key === "ArrowLeft" || key === "ArrowRight" || key === "ArrowUp" || key === "ArrowDown" || key === "Home" || key === "End";
|
|
358
|
+
}
|
|
359
|
+
function walk(options, from, key) {
|
|
360
|
+
const enabled = options.filter((option) => option.disabled !== true);
|
|
361
|
+
if (key === "Home") return enabled[0];
|
|
362
|
+
if (key === "End") return enabled[enabled.length - 1];
|
|
363
|
+
const step = key === "ArrowRight" || key === "ArrowDown" ? 1 : -1;
|
|
364
|
+
const count = options.length;
|
|
365
|
+
for (let offset = 1; offset < count; offset += 1) {
|
|
366
|
+
const candidate = options[((from + step * offset) % count + count) % count];
|
|
367
|
+
if (candidate !== void 0 && candidate.disabled !== true) return candidate;
|
|
368
|
+
}
|
|
369
|
+
return void 0;
|
|
370
|
+
}
|
|
371
|
+
function SegmentedControl({
|
|
372
|
+
id: id16,
|
|
373
|
+
value,
|
|
374
|
+
options,
|
|
375
|
+
onChange,
|
|
376
|
+
label,
|
|
377
|
+
disabled = false,
|
|
378
|
+
className
|
|
379
|
+
}) {
|
|
380
|
+
const list = useRef(null);
|
|
381
|
+
const selected = options.findIndex((option) => option.value === value);
|
|
382
|
+
useEffect(() => {
|
|
383
|
+
const root = list.current;
|
|
384
|
+
if (root === null) return;
|
|
385
|
+
if (!root.contains(document.activeElement)) return;
|
|
386
|
+
root.querySelector('[role="tab"][aria-selected="true"]')?.focus();
|
|
387
|
+
}, [value]);
|
|
388
|
+
const onKeyDown = (event) => {
|
|
389
|
+
if (!isWalkKey(event.key)) return;
|
|
390
|
+
event.preventDefault();
|
|
391
|
+
const target = walk(options, selected, event.key);
|
|
392
|
+
if (target !== void 0 && target.value !== value) onChange(target.value);
|
|
393
|
+
};
|
|
394
|
+
const indicator = {
|
|
395
|
+
"--dsh-segment-count": String(options.length),
|
|
396
|
+
"--dsh-segment-index": String(selected)
|
|
397
|
+
};
|
|
398
|
+
return /* @__PURE__ */ jsxs5("div", { ref: list, role: "tablist", "aria-label": label, className: clsx7(SegmentedControl_module_default.control, className), style: indicator, children: [
|
|
399
|
+
/* @__PURE__ */ jsx7("span", { "aria-hidden": "true", className: SegmentedControl_module_default.indicator }),
|
|
400
|
+
options.map((option) => {
|
|
401
|
+
const active = option.value === value;
|
|
402
|
+
return /* @__PURE__ */ jsx7(
|
|
403
|
+
"button",
|
|
404
|
+
{
|
|
405
|
+
id: `${id16}-${option.value}`,
|
|
406
|
+
type: "button",
|
|
407
|
+
role: "tab",
|
|
408
|
+
"aria-selected": active,
|
|
409
|
+
"aria-controls": `${id16}-${option.value}-panel`,
|
|
410
|
+
tabIndex: active ? 0 : -1,
|
|
411
|
+
disabled: disabled || option.disabled === true,
|
|
412
|
+
title: option.title,
|
|
413
|
+
className: SegmentedControl_module_default.tab,
|
|
414
|
+
onClick: () => {
|
|
415
|
+
if (!active) onChange(option.value);
|
|
416
|
+
},
|
|
417
|
+
onKeyDown,
|
|
418
|
+
children: option.label
|
|
419
|
+
},
|
|
420
|
+
option.value
|
|
421
|
+
);
|
|
422
|
+
})
|
|
423
|
+
] });
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
// src/Checkbox.tsx
|
|
427
|
+
import clsx8 from "clsx";
|
|
428
|
+
|
|
429
|
+
// .build/css/Checkbox.module.mjs
|
|
430
|
+
var id8 = "@seekbuddy/dsh-ui/Checkbox.module.css";
|
|
431
|
+
if (typeof document !== "undefined" && !document.querySelector('style[data-dsh-ui-primitives="' + id8 + '"]')) {
|
|
432
|
+
const element = document.createElement("style");
|
|
433
|
+
element.setAttribute("data-dsh-ui-primitives", id8);
|
|
434
|
+
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}";
|
|
435
|
+
document.head.appendChild(element);
|
|
436
|
+
}
|
|
437
|
+
var Checkbox_module_default = { "checkbox": "-IUgPq_checkbox" };
|
|
438
|
+
|
|
439
|
+
// src/Checkbox.tsx
|
|
440
|
+
import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
441
|
+
function Checkbox({
|
|
442
|
+
checked,
|
|
443
|
+
onChange,
|
|
444
|
+
label,
|
|
445
|
+
disabled = false,
|
|
446
|
+
title,
|
|
447
|
+
className
|
|
448
|
+
}) {
|
|
449
|
+
return /* @__PURE__ */ jsxs6("label", { className: clsx8(Checkbox_module_default.checkbox, className), title, children: [
|
|
450
|
+
/* @__PURE__ */ jsx8(
|
|
451
|
+
"input",
|
|
452
|
+
{
|
|
453
|
+
type: "checkbox",
|
|
454
|
+
checked,
|
|
455
|
+
disabled,
|
|
456
|
+
onChange: (event) => {
|
|
457
|
+
onChange(event.target.checked);
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
),
|
|
461
|
+
/* @__PURE__ */ jsx8("span", { children: label })
|
|
462
|
+
] });
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
// src/Input.tsx
|
|
466
|
+
import { forwardRef as forwardRef2 } from "react";
|
|
467
|
+
import clsx9 from "clsx";
|
|
468
|
+
|
|
469
|
+
// .build/css/Input.module.mjs
|
|
470
|
+
var id9 = "@seekbuddy/dsh-ui/Input.module.css";
|
|
471
|
+
if (typeof document !== "undefined" && !document.querySelector('style[data-dsh-ui-primitives="' + id9 + '"]')) {
|
|
472
|
+
const element = document.createElement("style");
|
|
473
|
+
element.setAttribute("data-dsh-ui-primitives", id9);
|
|
474
|
+
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)}";
|
|
475
|
+
document.head.appendChild(element);
|
|
476
|
+
}
|
|
477
|
+
var Input_module_default = { "input": "ubd6La_input", "icon": "ubd6La_icon", "wrap": "ubd6La_wrap" };
|
|
478
|
+
|
|
479
|
+
// src/Input.tsx
|
|
480
|
+
import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
481
|
+
var Input = forwardRef2(function Input2({ icon, className, ...rest }, ref) {
|
|
482
|
+
return /* @__PURE__ */ jsxs7("span", { className: clsx9(Input_module_default.wrap, className), children: [
|
|
483
|
+
icon != null && /* @__PURE__ */ jsx9("span", { className: Input_module_default.icon, children: icon }),
|
|
484
|
+
/* @__PURE__ */ jsx9("input", { ref, className: Input_module_default.input, ...rest })
|
|
485
|
+
] });
|
|
486
|
+
});
|
|
487
|
+
|
|
488
|
+
// src/MenuGroup.tsx
|
|
489
|
+
import { useId } from "react";
|
|
490
|
+
|
|
491
|
+
// .build/css/MenuGroup.module.mjs
|
|
492
|
+
var id10 = "@seekbuddy/dsh-ui/MenuGroup.module.css";
|
|
493
|
+
if (typeof document !== "undefined" && !document.querySelector('style[data-dsh-ui-primitives="' + id10 + '"]')) {
|
|
494
|
+
const element = document.createElement("style");
|
|
495
|
+
element.setAttribute("data-dsh-ui-primitives", id10);
|
|
496
|
+
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)}";
|
|
497
|
+
document.head.appendChild(element);
|
|
498
|
+
}
|
|
499
|
+
var MenuGroup_module_default = { "start": "EvD5wW_start", "heading": "EvD5wW_heading", "group": "EvD5wW_group" };
|
|
500
|
+
|
|
501
|
+
// src/MenuGroup.tsx
|
|
502
|
+
import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
503
|
+
function MenuGroup({ label, children }) {
|
|
504
|
+
const headingId = useId();
|
|
505
|
+
return /* @__PURE__ */ jsxs8("section", { role: "group", "aria-labelledby": headingId, "data-menu-group": "", className: MenuGroup_module_default.group, children: [
|
|
506
|
+
/* @__PURE__ */ jsx10("span", { "aria-hidden": "true", "data-menu-group-start": "", className: MenuGroup_module_default.start }),
|
|
507
|
+
/* @__PURE__ */ jsx10("div", { id: headingId, "data-menu-group-heading": "", className: MenuGroup_module_default.heading, children: label }),
|
|
508
|
+
children
|
|
509
|
+
] });
|
|
510
|
+
}
|
|
511
|
+
function observeStickyMenuGroups(viewport) {
|
|
512
|
+
const groups = [...viewport.querySelectorAll(":scope > [data-menu-group]")].flatMap((section) => {
|
|
513
|
+
const heading = section.querySelector(":scope > [data-menu-group-heading]");
|
|
514
|
+
const start = section.querySelector(":scope > [data-menu-group-start]");
|
|
515
|
+
return heading === null || start === null ? [] : [
|
|
516
|
+
{
|
|
517
|
+
section,
|
|
518
|
+
heading,
|
|
519
|
+
start,
|
|
520
|
+
atTop: false,
|
|
521
|
+
above: false,
|
|
522
|
+
topTime: -Infinity,
|
|
523
|
+
aboveTime: -Infinity
|
|
524
|
+
}
|
|
525
|
+
];
|
|
526
|
+
});
|
|
527
|
+
if (groups.length === 0 || typeof IntersectionObserver === "undefined" || typeof ResizeObserver === "undefined") {
|
|
528
|
+
return () => {
|
|
529
|
+
};
|
|
530
|
+
}
|
|
531
|
+
const sections = new Map(groups.map((group) => [group.section, group]));
|
|
532
|
+
const starts = new Map(groups.map((group) => [group.start, group]));
|
|
533
|
+
let disposed = false;
|
|
534
|
+
let stripObserver;
|
|
535
|
+
let viewportHeight;
|
|
536
|
+
const render = (group) => {
|
|
537
|
+
const stuck = group.atTop && group.above;
|
|
538
|
+
if (group.heading.hasAttribute("data-stuck") !== stuck) group.heading.toggleAttribute("data-stuck", stuck);
|
|
539
|
+
};
|
|
540
|
+
const startObserver = new IntersectionObserver(
|
|
541
|
+
(entries) => {
|
|
542
|
+
if (disposed) return;
|
|
543
|
+
for (const entry of entries) {
|
|
544
|
+
const group = starts.get(entry.target);
|
|
545
|
+
if (!group || entry.rootBounds === null || entry.time < group.aboveTime) continue;
|
|
546
|
+
group.above = entry.boundingClientRect.top < entry.rootBounds.top;
|
|
547
|
+
group.aboveTime = entry.time;
|
|
548
|
+
render(group);
|
|
549
|
+
}
|
|
550
|
+
},
|
|
551
|
+
{ root: viewport, threshold: [0, 1] }
|
|
552
|
+
);
|
|
553
|
+
for (const { start } of groups) startObserver.observe(start);
|
|
554
|
+
const sizeObserver = new ResizeObserver((entries) => {
|
|
555
|
+
if (disposed) return;
|
|
556
|
+
for (const entry of entries) {
|
|
557
|
+
if (entry.target !== viewport || entry.contentRect.height === viewportHeight) continue;
|
|
558
|
+
viewportHeight = entry.contentRect.height;
|
|
559
|
+
stripObserver?.disconnect();
|
|
560
|
+
const observer = new IntersectionObserver(
|
|
561
|
+
(intersections) => {
|
|
562
|
+
if (disposed || stripObserver !== observer) return;
|
|
563
|
+
for (const intersection of intersections) {
|
|
564
|
+
const group = sections.get(intersection.target);
|
|
565
|
+
if (!group || intersection.rootBounds === null) continue;
|
|
566
|
+
const top = intersection.rootBounds.top;
|
|
567
|
+
if (intersection.time >= group.topTime) {
|
|
568
|
+
group.atTop = intersection.isIntersecting && intersection.boundingClientRect.bottom > top;
|
|
569
|
+
group.topTime = intersection.time;
|
|
570
|
+
}
|
|
571
|
+
if (intersection.time >= group.aboveTime) {
|
|
572
|
+
group.above = intersection.boundingClientRect.top < top;
|
|
573
|
+
group.aboveTime = intersection.time;
|
|
574
|
+
}
|
|
575
|
+
render(group);
|
|
576
|
+
}
|
|
577
|
+
},
|
|
578
|
+
{ root: viewport, rootMargin: `0px 0px ${Math.min(1, viewportHeight) - viewportHeight}px 0px`, threshold: 0 }
|
|
579
|
+
);
|
|
580
|
+
stripObserver = observer;
|
|
581
|
+
for (const { section } of groups) observer.observe(section);
|
|
582
|
+
}
|
|
583
|
+
});
|
|
584
|
+
sizeObserver.observe(viewport);
|
|
585
|
+
return () => {
|
|
586
|
+
if (disposed) return;
|
|
587
|
+
disposed = true;
|
|
588
|
+
startObserver.disconnect();
|
|
589
|
+
stripObserver?.disconnect();
|
|
590
|
+
sizeObserver.disconnect();
|
|
591
|
+
for (const { heading } of groups) {
|
|
592
|
+
if (heading.hasAttribute("data-stuck")) heading.removeAttribute("data-stuck");
|
|
593
|
+
}
|
|
594
|
+
};
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
// src/useAnchoredMaxHeight.ts
|
|
598
|
+
import { useLayoutEffect, useState } from "react";
|
|
599
|
+
var MARGIN = 12;
|
|
600
|
+
function useAnchoredMaxHeight(ref, cap, signal, margin = MARGIN) {
|
|
601
|
+
const [maxHeight, setMaxHeight] = useState(cap);
|
|
602
|
+
useLayoutEffect(() => {
|
|
603
|
+
const el = ref.current;
|
|
604
|
+
if (el === null) return;
|
|
605
|
+
const fit = () => {
|
|
606
|
+
setMaxHeight(Math.min(cap, Math.max(0, el.getBoundingClientRect().bottom - overlayTopMargin(margin))));
|
|
607
|
+
};
|
|
608
|
+
fit();
|
|
609
|
+
window.addEventListener("resize", fit);
|
|
610
|
+
window.addEventListener("scroll", fit, true);
|
|
611
|
+
return () => {
|
|
612
|
+
window.removeEventListener("resize", fit);
|
|
613
|
+
window.removeEventListener("scroll", fit, true);
|
|
614
|
+
};
|
|
615
|
+
}, [ref, cap, signal, margin]);
|
|
616
|
+
return maxHeight;
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
// src/useAnchoredPosition.ts
|
|
620
|
+
import { useLayoutEffect as useLayoutEffect2, useState as useState2 } from "react";
|
|
621
|
+
function useAnchoredPosition(options) {
|
|
622
|
+
const { open, anchorRef, panelRef, side = "bottom", align = "start", gap, margin } = options;
|
|
623
|
+
const [position, setPosition] = useState2(null);
|
|
624
|
+
useLayoutEffect2(() => {
|
|
625
|
+
if (!open) {
|
|
626
|
+
setPosition(null);
|
|
627
|
+
return;
|
|
628
|
+
}
|
|
629
|
+
const place = () => {
|
|
630
|
+
const rect = anchorRef.current?.getBoundingClientRect();
|
|
631
|
+
if (rect === void 0) return;
|
|
632
|
+
const panel2 = panelRef.current;
|
|
633
|
+
const width = panel2?.offsetWidth ?? 0;
|
|
634
|
+
const height = panel2?.offsetHeight ?? 0;
|
|
635
|
+
let left = align === "end" ? rect.right - width : rect.left;
|
|
636
|
+
let top = side === "top" ? rect.top - gap - height : rect.bottom + gap;
|
|
637
|
+
if (width > 0) left = Math.min(Math.max(left, margin), window.innerWidth - width - margin);
|
|
638
|
+
if (height > 0) top = Math.min(Math.max(top, overlayTopMargin(margin)), window.innerHeight - height - margin);
|
|
639
|
+
setPosition({ left, top });
|
|
640
|
+
};
|
|
641
|
+
place();
|
|
642
|
+
window.addEventListener("scroll", place, true);
|
|
643
|
+
window.addEventListener("resize", place);
|
|
644
|
+
const panel = panelRef.current;
|
|
645
|
+
let observer = null;
|
|
646
|
+
if (typeof ResizeObserver !== "undefined" && panel !== null) {
|
|
647
|
+
observer = new ResizeObserver(place);
|
|
648
|
+
observer.observe(panel);
|
|
649
|
+
}
|
|
650
|
+
return () => {
|
|
651
|
+
observer?.disconnect();
|
|
652
|
+
window.removeEventListener("scroll", place, true);
|
|
653
|
+
window.removeEventListener("resize", place);
|
|
654
|
+
};
|
|
655
|
+
}, [open, anchorRef, panelRef, side, align, gap, margin]);
|
|
656
|
+
return position;
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
// src/Modal.tsx
|
|
660
|
+
import { useRef as useRef2 } from "react";
|
|
661
|
+
import { createPortal } from "react-dom";
|
|
662
|
+
import clsx10 from "clsx";
|
|
663
|
+
|
|
664
|
+
// .build/css/Modal.module.mjs
|
|
665
|
+
var id11 = "@seekbuddy/dsh-ui/Modal.module.css";
|
|
666
|
+
if (typeof document !== "undefined" && !document.querySelector('style[data-dsh-ui-primitives="' + id11 + '"]')) {
|
|
667
|
+
const element = document.createElement("style");
|
|
668
|
+
element.setAttribute("data-dsh-ui-primitives", id11);
|
|
669
|
+
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}.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}';
|
|
670
|
+
document.head.appendChild(element);
|
|
671
|
+
}
|
|
672
|
+
var Modal_module_default = { "modalEnter": "yOh8dq_modalEnter", "footer": "yOh8dq_footer", "mask": "yOh8dq_mask", "dialog": "yOh8dq_dialog", "root": "yOh8dq_root", "title": "yOh8dq_title", "description": "yOh8dq_description", "body": "yOh8dq_body", "close": "yOh8dq_close", "content": "yOh8dq_content", "header": "yOh8dq_header" };
|
|
673
|
+
|
|
674
|
+
// src/Modal.tsx
|
|
675
|
+
import { Fragment as Fragment2, jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
676
|
+
function Modal({
|
|
677
|
+
open,
|
|
678
|
+
onClose,
|
|
679
|
+
title,
|
|
680
|
+
closeLabel,
|
|
681
|
+
description,
|
|
682
|
+
children,
|
|
683
|
+
footer,
|
|
684
|
+
className,
|
|
685
|
+
contentClassName,
|
|
686
|
+
onKeyDownCapture,
|
|
687
|
+
headless = false,
|
|
688
|
+
backdropBlur = true,
|
|
689
|
+
shortcutModal
|
|
690
|
+
}) {
|
|
691
|
+
const dialog = useRef2(null);
|
|
692
|
+
useModalLayer(dialog, open, onClose);
|
|
693
|
+
if (!open) return null;
|
|
694
|
+
return createPortal(
|
|
695
|
+
/* @__PURE__ */ jsxs9("div", { className: Modal_module_default.root, role: "presentation", onKeyDownCapture, children: [
|
|
696
|
+
/* @__PURE__ */ jsx11(
|
|
697
|
+
"div",
|
|
698
|
+
{
|
|
699
|
+
className: Modal_module_default.mask,
|
|
700
|
+
style: backdropBlur ? void 0 : { backdropFilter: "none" },
|
|
701
|
+
"aria-hidden": "true",
|
|
702
|
+
onClick: onClose
|
|
703
|
+
}
|
|
704
|
+
),
|
|
705
|
+
/* @__PURE__ */ jsx11(
|
|
706
|
+
"div",
|
|
707
|
+
{
|
|
708
|
+
ref: dialog,
|
|
709
|
+
tabIndex: -1,
|
|
710
|
+
"data-shortcut-modal": shortcutModal,
|
|
711
|
+
className: clsx10(Modal_module_default.dialog, className),
|
|
712
|
+
role: "dialog",
|
|
713
|
+
"aria-modal": "true",
|
|
714
|
+
"aria-label": title,
|
|
715
|
+
children: headless ? children : /* @__PURE__ */ jsxs9(Fragment2, { children: [
|
|
716
|
+
/* @__PURE__ */ jsxs9("div", { className: clsx10(Modal_module_default.content, contentClassName), children: [
|
|
717
|
+
/* @__PURE__ */ jsxs9("div", { className: Modal_module_default.header, children: [
|
|
718
|
+
/* @__PURE__ */ jsx11("h2", { className: Modal_module_default.title, children: title }),
|
|
719
|
+
/* @__PURE__ */ jsx11("button", { type: "button", className: Modal_module_default.close, "aria-label": closeLabel, onClick: onClose, children: /* @__PURE__ */ jsx11(IconCloseOutlineRegular, { size: 14 }) })
|
|
720
|
+
] }),
|
|
721
|
+
description !== void 0 && description !== "" && /* @__PURE__ */ jsx11("p", { className: Modal_module_default.description, children: description }),
|
|
722
|
+
children !== void 0 && /* @__PURE__ */ jsx11("div", { className: Modal_module_default.body, children })
|
|
723
|
+
] }),
|
|
724
|
+
footer !== void 0 && /* @__PURE__ */ jsx11("div", { className: Modal_module_default.footer, children: footer })
|
|
725
|
+
] })
|
|
726
|
+
}
|
|
727
|
+
)
|
|
728
|
+
] }),
|
|
729
|
+
document.body
|
|
730
|
+
);
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
// .build/css/RiskConfirmation.module.mjs
|
|
734
|
+
var id12 = "@seekbuddy/dsh-ui/RiskConfirmation.module.css";
|
|
735
|
+
if (typeof document !== "undefined" && !document.querySelector('style[data-dsh-ui-primitives="' + id12 + '"]')) {
|
|
736
|
+
const element = document.createElement("style");
|
|
737
|
+
element.setAttribute("data-dsh-ui-primitives", id12);
|
|
738
|
+
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}";
|
|
739
|
+
document.head.appendChild(element);
|
|
740
|
+
}
|
|
741
|
+
var RiskConfirmation_module_default = { "modalAction": "scdcKa_modalAction", "confirmAction": "scdcKa_confirmAction", "confirmation": "scdcKa_confirmation", "confirmationContent": "scdcKa_confirmationContent", "warningIcon": "scdcKa_warningIcon", "acknowledgement": "scdcKa_acknowledgement", "warning": "scdcKa_warning" };
|
|
742
|
+
|
|
743
|
+
// src/RiskConfirmation.tsx
|
|
744
|
+
import { Fragment as Fragment3, jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
745
|
+
function RiskConfirmation({
|
|
746
|
+
open,
|
|
747
|
+
title,
|
|
748
|
+
description,
|
|
749
|
+
acknowledgeLabel,
|
|
750
|
+
cancelLabel,
|
|
751
|
+
closeLabel,
|
|
752
|
+
confirmLabel,
|
|
753
|
+
acknowledged,
|
|
754
|
+
disabled = false,
|
|
755
|
+
onAcknowledgedChange,
|
|
756
|
+
onCancel,
|
|
757
|
+
onConfirm
|
|
758
|
+
}) {
|
|
759
|
+
return /* @__PURE__ */ jsxs10(
|
|
760
|
+
Modal,
|
|
761
|
+
{
|
|
762
|
+
open,
|
|
763
|
+
onClose: onCancel,
|
|
764
|
+
title,
|
|
765
|
+
closeLabel,
|
|
766
|
+
className: RiskConfirmation_module_default.confirmation ?? "",
|
|
767
|
+
contentClassName: RiskConfirmation_module_default.confirmationContent ?? "",
|
|
768
|
+
footer: /* @__PURE__ */ jsxs10(Fragment3, { children: [
|
|
769
|
+
/* @__PURE__ */ jsx12(Button, { variant: "outline", className: RiskConfirmation_module_default.modalAction, onClick: onCancel, children: cancelLabel }),
|
|
770
|
+
/* @__PURE__ */ jsx12(
|
|
771
|
+
Button,
|
|
772
|
+
{
|
|
773
|
+
variant: "primary",
|
|
774
|
+
className: RiskConfirmation_module_default.confirmAction,
|
|
775
|
+
disabled: disabled || !acknowledged,
|
|
776
|
+
onClick: onConfirm,
|
|
777
|
+
children: confirmLabel
|
|
778
|
+
}
|
|
779
|
+
)
|
|
780
|
+
] }),
|
|
781
|
+
children: [
|
|
782
|
+
/* @__PURE__ */ jsxs10("div", { className: RiskConfirmation_module_default.warning, children: [
|
|
783
|
+
/* @__PURE__ */ jsx12(IconWarningOutlineRegular, { size: 18, className: RiskConfirmation_module_default.warningIcon }),
|
|
784
|
+
/* @__PURE__ */ jsx12("p", { children: description })
|
|
785
|
+
] }),
|
|
786
|
+
/* @__PURE__ */ jsxs10("label", { className: RiskConfirmation_module_default.acknowledgement, children: [
|
|
787
|
+
/* @__PURE__ */ jsx12(
|
|
788
|
+
"input",
|
|
789
|
+
{
|
|
790
|
+
type: "checkbox",
|
|
791
|
+
checked: acknowledged,
|
|
792
|
+
disabled,
|
|
793
|
+
"data-modal-autofocus": true,
|
|
794
|
+
onChange: (event) => {
|
|
795
|
+
onAcknowledgedChange(event.currentTarget.checked);
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
),
|
|
799
|
+
/* @__PURE__ */ jsx12("span", { children: acknowledgeLabel })
|
|
800
|
+
] })
|
|
801
|
+
]
|
|
802
|
+
}
|
|
803
|
+
);
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
// src/ConnectionIndicator.tsx
|
|
807
|
+
import { useEffect as useEffect2, useState as useState3 } from "react";
|
|
808
|
+
|
|
809
|
+
// .build/css/ConnectionIndicator.module.mjs
|
|
810
|
+
var id13 = "@seekbuddy/dsh-ui/ConnectionIndicator.module.css";
|
|
811
|
+
if (typeof document !== "undefined" && !document.querySelector('style[data-dsh-ui-primitives="' + id13 + '"]')) {
|
|
812
|
+
const element = document.createElement("style");
|
|
813
|
+
element.setAttribute("data-dsh-ui-primitives", id13);
|
|
814
|
+
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}.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}}";
|
|
815
|
+
document.head.appendChild(element);
|
|
816
|
+
}
|
|
817
|
+
var ConnectionIndicator_module_default = { "success": "WjD5zG_success", "reveal-second-dot": "WjD5zG_reveal-second-dot", "indicator-enter": "WjD5zG_indicator-enter", "icon": "WjD5zG_icon", "label": "WjD5zG_label", "secondDot": "WjD5zG_secondDot", "warning": "WjD5zG_warning", "thirdDot": "WjD5zG_thirdDot", "reveal-third-dot": "WjD5zG_reveal-third-dot", "dots": "WjD5zG_dots", "indicator": "WjD5zG_indicator", "leaving": "WjD5zG_leaving" };
|
|
818
|
+
|
|
819
|
+
// src/ConnectionIndicator.tsx
|
|
820
|
+
import { Fragment as Fragment4, jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
821
|
+
var EXIT_MS = 150;
|
|
822
|
+
function ConnectionIndicator({
|
|
823
|
+
state,
|
|
824
|
+
disconnectedLabel,
|
|
825
|
+
connectingLabel,
|
|
826
|
+
recoveredLabel,
|
|
827
|
+
reconnectActionLabel,
|
|
828
|
+
restartActionLabel,
|
|
829
|
+
onReconnect
|
|
830
|
+
}) {
|
|
831
|
+
const [rendered, setRendered] = useState3(state);
|
|
832
|
+
const leaving = state === void 0 && rendered !== void 0;
|
|
833
|
+
useEffect2(() => {
|
|
834
|
+
if (state !== void 0) {
|
|
835
|
+
setRendered(state);
|
|
836
|
+
return;
|
|
837
|
+
}
|
|
838
|
+
if (rendered === void 0) return;
|
|
839
|
+
const timeout = window.setTimeout(() => {
|
|
840
|
+
setRendered(void 0);
|
|
841
|
+
}, EXIT_MS);
|
|
842
|
+
return () => {
|
|
843
|
+
window.clearTimeout(timeout);
|
|
844
|
+
};
|
|
845
|
+
}, [state, rendered]);
|
|
846
|
+
if (rendered === void 0) return null;
|
|
847
|
+
const leavingClass = leaving ? ` ${ConnectionIndicator_module_default.leaving}` : "";
|
|
848
|
+
if (rendered === "recovered") {
|
|
849
|
+
return /* @__PURE__ */ jsxs11("div", { className: `${ConnectionIndicator_module_default.indicator} ${ConnectionIndicator_module_default.success}${leavingClass}`, role: "status", "aria-label": recoveredLabel, children: [
|
|
850
|
+
/* @__PURE__ */ jsx13("span", { className: ConnectionIndicator_module_default.icon, "aria-hidden": "true", children: /* @__PURE__ */ jsx13(IconCheckOutlineRegular, { size: 14 }) }),
|
|
851
|
+
/* @__PURE__ */ jsx13("span", { className: ConnectionIndicator_module_default.label, children: recoveredLabel })
|
|
852
|
+
] });
|
|
853
|
+
}
|
|
854
|
+
const connecting = rendered === "connecting";
|
|
855
|
+
return /* @__PURE__ */ jsxs11(
|
|
856
|
+
"button",
|
|
857
|
+
{
|
|
858
|
+
type: "button",
|
|
859
|
+
className: `${ConnectionIndicator_module_default.indicator} ${ConnectionIndicator_module_default.warning}${leavingClass}`,
|
|
860
|
+
"data-phase": rendered,
|
|
861
|
+
"aria-label": connecting ? restartActionLabel : reconnectActionLabel,
|
|
862
|
+
onClick: onReconnect,
|
|
863
|
+
children: [
|
|
864
|
+
/* @__PURE__ */ jsx13("span", { className: ConnectionIndicator_module_default.icon, "aria-hidden": "true", children: connecting ? /* @__PURE__ */ jsx13(StateDot, { state: "ongoing" }) : /* @__PURE__ */ jsx13(IconRefreshOutlineRegular, { size: 14 }) }),
|
|
865
|
+
/* @__PURE__ */ jsx13("span", { className: ConnectionIndicator_module_default.label, children: connecting ? /* @__PURE__ */ jsxs11(Fragment4, { children: [
|
|
866
|
+
connectingLabel,
|
|
867
|
+
/* @__PURE__ */ jsxs11("span", { className: ConnectionIndicator_module_default.dots, "aria-hidden": "true", children: [
|
|
868
|
+
/* @__PURE__ */ jsx13("span", { children: "." }),
|
|
869
|
+
/* @__PURE__ */ jsx13("span", { className: ConnectionIndicator_module_default.secondDot, children: "." }),
|
|
870
|
+
/* @__PURE__ */ jsx13("span", { className: ConnectionIndicator_module_default.thirdDot, children: "." })
|
|
871
|
+
] })
|
|
872
|
+
] }) : disconnectedLabel })
|
|
873
|
+
]
|
|
874
|
+
}
|
|
875
|
+
);
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
// src/user-text.tsx
|
|
879
|
+
import clsx11 from "clsx";
|
|
880
|
+
|
|
881
|
+
// .build/css/user-text.module.mjs
|
|
882
|
+
var id14 = "@seekbuddy/dsh-ui/user-text.module.css";
|
|
883
|
+
if (typeof document !== "undefined" && !document.querySelector('style[data-dsh-ui-primitives="' + id14 + '"]')) {
|
|
884
|
+
const element = document.createElement("style");
|
|
885
|
+
element.setAttribute("data-dsh-ui-primitives", id14);
|
|
886
|
+
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}";
|
|
887
|
+
document.head.appendChild(element);
|
|
888
|
+
}
|
|
889
|
+
var user_text_module_default = { "plainRun": "_3EOulq_plainRun", "refChip": "_3EOulq_refChip", "slashChip": "_3EOulq_slashChip", "refIcon": "_3EOulq_refIcon" };
|
|
890
|
+
|
|
891
|
+
// src/user-text.tsx
|
|
892
|
+
import { Fragment as Fragment5, jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
893
|
+
var SESSION_WIRE_RE = /@\[([^\]\n]+)\]\(dsh-session:[^)\s]+\)/gu;
|
|
894
|
+
var TRAILING_PUNCTUATION_RE = /[.,;:!?,。;:!?]+$/u;
|
|
895
|
+
function projectUserText(text, sessionLabels, slashNames = [], slashKind = "skill", references) {
|
|
896
|
+
const ranges = [];
|
|
897
|
+
SESSION_WIRE_RE.lastIndex = 0;
|
|
898
|
+
let wire;
|
|
899
|
+
while ((wire = SESSION_WIRE_RE.exec(text)) !== null) {
|
|
900
|
+
ranges.push({
|
|
901
|
+
start: wire.index,
|
|
902
|
+
end: wire.index + wire[0].length,
|
|
903
|
+
label: wire[0],
|
|
904
|
+
kind: "session",
|
|
905
|
+
display: wire[1]
|
|
906
|
+
// non-optional capture in SESSION_WIRE_RE
|
|
907
|
+
});
|
|
908
|
+
}
|
|
909
|
+
for (const rawLabel of [...new Set(sessionLabels)].sort((a, b) => b.length - a.length)) {
|
|
910
|
+
const label = `@${rawLabel}`;
|
|
911
|
+
let start = text.indexOf(label);
|
|
912
|
+
while (start >= 0) {
|
|
913
|
+
ranges.push({ start, end: start + label.length, label, kind: "session" });
|
|
914
|
+
start = text.indexOf(label, start + label.length);
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
const re = /(^|\s)(\/[\w-]+(?=\s|$)|@"[^"\n]+"|@[^\s]+)/gu;
|
|
918
|
+
let m;
|
|
919
|
+
while ((m = re.exec(text)) !== null) {
|
|
920
|
+
const tokenStart = m.index + m[1].length;
|
|
921
|
+
const rawLabel = m[2];
|
|
922
|
+
const label = rawLabel.startsWith('@"') ? rawLabel : rawLabel.replace(TRAILING_PUNCTUATION_RE, "");
|
|
923
|
+
if (label.length <= 1) continue;
|
|
924
|
+
if (label.startsWith("/") && !slashNames.includes(label.slice(1))) continue;
|
|
925
|
+
ranges.push({ start: tokenStart, end: tokenStart + label.length, label, kind: "plain" });
|
|
926
|
+
}
|
|
927
|
+
const rankOf = (range) => range.kind === "session" ? 0 : 1;
|
|
928
|
+
ranges.sort((a, b) => a.start - b.start || rankOf(a) - rankOf(b) || b.end - a.end);
|
|
929
|
+
const parts = [];
|
|
930
|
+
let cursor = 0;
|
|
931
|
+
const pushPlain = (from, to) => {
|
|
932
|
+
parts.push(
|
|
933
|
+
/* @__PURE__ */ jsx14("span", { className: user_text_module_default.plainRun, children: text.slice(from, to) }, `t${from}`)
|
|
934
|
+
);
|
|
935
|
+
};
|
|
936
|
+
for (const range of ranges) {
|
|
937
|
+
if (range.start < cursor) continue;
|
|
938
|
+
const { start: tokenStart, end, label, kind } = range;
|
|
939
|
+
if (tokenStart > cursor) pushPlain(cursor, tokenStart);
|
|
940
|
+
const referenceKind = kind === "session" ? "session" : label.startsWith("@") ? label.replace(/^@"|"$/gu, "").endsWith("/") ? "folder" : "file" : void 0;
|
|
941
|
+
const displayLabel = range.display ?? (referenceKind === void 0 ? label : referenceKind === "session" ? label.slice(1) : label.slice(1).replace(/^"|"$/gu, "").split(/[\\/]/u).filter(Boolean).at(-1) ?? label.slice(1));
|
|
942
|
+
const contents = /* @__PURE__ */ jsxs12(Fragment5, { children: [
|
|
943
|
+
referenceKind !== void 0 && /* @__PURE__ */ jsx14(ReferenceIconRegular, { kind: referenceKind, size: 16, className: user_text_module_default.refIcon }),
|
|
944
|
+
displayLabel
|
|
945
|
+
] });
|
|
946
|
+
const open = references === void 0 ? void 0 : referenceKind === "file" ? () => {
|
|
947
|
+
references.openFile(label.slice(1).replace(/^"|"$/gu, ""));
|
|
948
|
+
} : referenceKind === void 0 && slashKind === "skill" ? () => {
|
|
949
|
+
references.openSkill(label.slice(1));
|
|
950
|
+
} : void 0;
|
|
951
|
+
const className = clsx11(user_text_module_default.refChip, referenceKind === void 0 && user_text_module_default.slashChip);
|
|
952
|
+
parts.push(
|
|
953
|
+
open === void 0 ? /* @__PURE__ */ jsx14("span", { className, "data-ref-chip": referenceKind ?? slashKind, title: label, children: contents }, tokenStart) : /* @__PURE__ */ jsx14(
|
|
954
|
+
"button",
|
|
955
|
+
{
|
|
956
|
+
type: "button",
|
|
957
|
+
className: clsx11(className, MarkdownText_module_default.fileMention),
|
|
958
|
+
"data-ref-chip": referenceKind ?? slashKind,
|
|
959
|
+
title: label,
|
|
960
|
+
onClick: (event) => {
|
|
961
|
+
if (event.detail > 1 || event.detail !== 0 && event.currentTarget.ownerDocument.getSelection()?.isCollapsed === false)
|
|
962
|
+
return;
|
|
963
|
+
open();
|
|
964
|
+
},
|
|
965
|
+
children: contents
|
|
966
|
+
},
|
|
967
|
+
tokenStart
|
|
968
|
+
)
|
|
969
|
+
);
|
|
970
|
+
cursor = end;
|
|
971
|
+
}
|
|
972
|
+
if (parts.length === 0) return /* @__PURE__ */ jsx14("span", { className: user_text_module_default.plainRun, children: text });
|
|
973
|
+
if (cursor < text.length) pushPlain(cursor, text.length);
|
|
974
|
+
return /* @__PURE__ */ jsx14(Fragment5, { children: parts });
|
|
975
|
+
}
|
|
976
|
+
|
|
977
|
+
// src/Toast.tsx
|
|
978
|
+
import { Fragment as Fragment6, useEffect as useEffect3, useLayoutEffect as useLayoutEffect3, useRef as useRef3, useState as useState4 } from "react";
|
|
979
|
+
import { createPortal as createPortal2 } from "react-dom";
|
|
980
|
+
|
|
981
|
+
// .build/css/Toast.module.mjs
|
|
982
|
+
var id15 = "@seekbuddy/dsh-ui/Toast.module.css";
|
|
983
|
+
if (typeof document !== "undefined" && !document.querySelector('style[data-dsh-ui-primitives="' + id15 + '"]')) {
|
|
984
|
+
const element = document.createElement("style");
|
|
985
|
+
element.setAttribute("data-dsh-ui-primitives", id15);
|
|
986
|
+
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}._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}}";
|
|
987
|
+
document.head.appendChild(element);
|
|
988
|
+
}
|
|
989
|
+
var Toast_module_default = { "icon": "_7whosa_icon", "success": "_7whosa_success", "dsh-toast-in": "_7whosa_dsh-toast-in", "text": "_7whosa_text", "action": "_7whosa_action", "toast": "_7whosa_toast", "dsh-toast-fade": "_7whosa_dsh-toast-fade" };
|
|
990
|
+
|
|
991
|
+
// src/Toast.tsx
|
|
992
|
+
import { jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
993
|
+
var HOLD_MS = 3e3;
|
|
994
|
+
var FADE_MS = 1e3;
|
|
995
|
+
function Toast({
|
|
996
|
+
text,
|
|
997
|
+
icon,
|
|
998
|
+
tone,
|
|
999
|
+
anchor,
|
|
1000
|
+
holdMs = HOLD_MS,
|
|
1001
|
+
actions,
|
|
1002
|
+
onDone
|
|
1003
|
+
}) {
|
|
1004
|
+
const latestOnDone = useRef3(onDone);
|
|
1005
|
+
useLayoutEffect3(() => {
|
|
1006
|
+
latestOnDone.current = onDone;
|
|
1007
|
+
}, [onDone]);
|
|
1008
|
+
useEffect3(() => {
|
|
1009
|
+
const timer = setTimeout(() => {
|
|
1010
|
+
latestOnDone.current();
|
|
1011
|
+
}, holdMs + FADE_MS);
|
|
1012
|
+
return () => {
|
|
1013
|
+
clearTimeout(timer);
|
|
1014
|
+
};
|
|
1015
|
+
}, [holdMs]);
|
|
1016
|
+
const [left, setLeft] = useState4(null);
|
|
1017
|
+
useLayoutEffect3(() => {
|
|
1018
|
+
if (anchor == null) return;
|
|
1019
|
+
const measure = () => {
|
|
1020
|
+
const rect = anchor.getBoundingClientRect();
|
|
1021
|
+
setLeft(rect.left + rect.width / 2);
|
|
1022
|
+
};
|
|
1023
|
+
measure();
|
|
1024
|
+
window.addEventListener("resize", measure);
|
|
1025
|
+
return () => {
|
|
1026
|
+
window.removeEventListener("resize", measure);
|
|
1027
|
+
};
|
|
1028
|
+
}, [anchor]);
|
|
1029
|
+
return createPortal2(
|
|
1030
|
+
/* @__PURE__ */ jsxs13(
|
|
1031
|
+
"div",
|
|
1032
|
+
{
|
|
1033
|
+
className: Toast_module_default.toast,
|
|
1034
|
+
role: "alert",
|
|
1035
|
+
style: {
|
|
1036
|
+
...left === null ? {} : { left },
|
|
1037
|
+
"--dsh-toast-hold": `${String(holdMs)}ms`
|
|
1038
|
+
},
|
|
1039
|
+
children: [
|
|
1040
|
+
tone === "success" ? /* @__PURE__ */ jsx15("span", { className: `${Toast_module_default.icon} ${Toast_module_default.success}`, "aria-hidden": true, children: /* @__PURE__ */ jsx15(IconCheckCircleOutlineRegular, {}) }) : icon !== void 0 && /* @__PURE__ */ jsx15("span", { className: Toast_module_default.icon, "aria-hidden": true, children: icon }),
|
|
1041
|
+
/* @__PURE__ */ jsxs13("span", { className: Toast_module_default.text, children: [
|
|
1042
|
+
text,
|
|
1043
|
+
actions?.map((action) => /* @__PURE__ */ jsxs13(Fragment6, { children: [
|
|
1044
|
+
action.prefix,
|
|
1045
|
+
/* @__PURE__ */ jsx15("button", { type: "button", className: Toast_module_default.action, onClick: action.onClick, children: action.label })
|
|
1046
|
+
] }, action.label))
|
|
1047
|
+
] })
|
|
1048
|
+
]
|
|
1049
|
+
}
|
|
1050
|
+
),
|
|
1051
|
+
document.body
|
|
1052
|
+
);
|
|
1053
|
+
}
|
|
1054
|
+
|
|
1055
|
+
// src/file-size.ts
|
|
1056
|
+
function fileSizeText(bytes) {
|
|
1057
|
+
if (bytes < 1024) return `${bytes}B`;
|
|
1058
|
+
const kb = bytes / 1024;
|
|
1059
|
+
if (kb < 1024) return `${kb < 10 ? kb.toFixed(1) : Math.round(kb)}KB`;
|
|
1060
|
+
const mb = kb / 1024;
|
|
1061
|
+
if (mb < 1024) return `${mb < 10 ? mb.toFixed(1) : Math.round(mb)}MB`;
|
|
1062
|
+
const gb = mb / 1024;
|
|
1063
|
+
return `${gb < 10 ? gb.toFixed(1) : Math.round(gb)}GB`;
|
|
1064
|
+
}
|
|
1065
|
+
|
|
1066
|
+
// src/relative-time.ts
|
|
1067
|
+
function relativeTime(at, now) {
|
|
1068
|
+
const MIN = 6e4;
|
|
1069
|
+
const HOUR = 36e5;
|
|
1070
|
+
const DAY = 864e5;
|
|
1071
|
+
const diff = Math.max(0, now - at);
|
|
1072
|
+
if (diff < MIN) return { unit: "now", n: 0 };
|
|
1073
|
+
if (diff < HOUR) return { unit: "minutes", n: Math.floor(diff / MIN) };
|
|
1074
|
+
if (diff < DAY) return { unit: "hours", n: Math.floor(diff / HOUR) };
|
|
1075
|
+
if (diff < 30 * DAY) return { unit: "days", n: Math.floor(diff / DAY) };
|
|
1076
|
+
if (diff < 365 * DAY) return { unit: "months", n: Math.floor(diff / (30 * DAY)) };
|
|
1077
|
+
return { unit: "years", n: Math.floor(diff / (365 * DAY)) };
|
|
1078
|
+
}
|
|
1079
|
+
|
|
1080
|
+
// src/rank-by-name.ts
|
|
1081
|
+
function boundaryBonus(name, index) {
|
|
1082
|
+
return index === 0 || name.charAt(index - 1) === "-" || name.charAt(index - 1) === "_" ? 8 : 0;
|
|
1083
|
+
}
|
|
1084
|
+
function alignmentScore(name, query) {
|
|
1085
|
+
if (query.length > name.length) return void 0;
|
|
1086
|
+
const noMatch = Number.NEGATIVE_INFINITY;
|
|
1087
|
+
let previous = Array(name.length).fill(noMatch);
|
|
1088
|
+
for (let index = 0; index < name.length; index++) {
|
|
1089
|
+
if (name.charAt(index) === query.charAt(0)) previous[index] = 1 + boundaryBonus(name, index) - index;
|
|
1090
|
+
}
|
|
1091
|
+
for (let queryIndex = 1; queryIndex < query.length; queryIndex++) {
|
|
1092
|
+
const current = Array(name.length).fill(noMatch);
|
|
1093
|
+
let left = noMatch;
|
|
1094
|
+
let leftLeft = noMatch;
|
|
1095
|
+
let bestGapped = noMatch;
|
|
1096
|
+
for (const [index, prior] of previous.entries()) {
|
|
1097
|
+
if (leftLeft !== noMatch) bestGapped = Math.max(bestGapped, leftLeft + index - 2);
|
|
1098
|
+
if (name.charAt(index) === query.charAt(queryIndex)) {
|
|
1099
|
+
const bonus = 1 + boundaryBonus(name, index);
|
|
1100
|
+
let score = noMatch;
|
|
1101
|
+
if (left !== noMatch) score = left + bonus + 4;
|
|
1102
|
+
if (bestGapped !== noMatch) score = Math.max(score, bestGapped + bonus + 1 - index);
|
|
1103
|
+
current[index] = score;
|
|
1104
|
+
}
|
|
1105
|
+
leftLeft = left;
|
|
1106
|
+
left = prior;
|
|
1107
|
+
}
|
|
1108
|
+
previous = current;
|
|
1109
|
+
}
|
|
1110
|
+
let best = noMatch;
|
|
1111
|
+
for (const score of previous) best = Math.max(best, score);
|
|
1112
|
+
return best === noMatch ? void 0 : best;
|
|
1113
|
+
}
|
|
1114
|
+
function rankByName(items, rawQuery) {
|
|
1115
|
+
const query = rawQuery.toLowerCase();
|
|
1116
|
+
if (query === "") return items;
|
|
1117
|
+
const ranked = [];
|
|
1118
|
+
items.forEach((item, index) => {
|
|
1119
|
+
const keys = item.label === void 0 ? [item.name] : [item.name, item.label];
|
|
1120
|
+
let prefix = false;
|
|
1121
|
+
let score;
|
|
1122
|
+
for (const key of keys) {
|
|
1123
|
+
const lower = key.toLowerCase();
|
|
1124
|
+
const keyScore = alignmentScore(lower, query);
|
|
1125
|
+
if (keyScore === void 0) continue;
|
|
1126
|
+
prefix || (prefix = lower.startsWith(query));
|
|
1127
|
+
score = score === void 0 ? keyScore : Math.max(score, keyScore);
|
|
1128
|
+
}
|
|
1129
|
+
if (score !== void 0) ranked.push({ item, index, prefix, score });
|
|
1130
|
+
});
|
|
1131
|
+
ranked.sort(
|
|
1132
|
+
(left, right) => Number(right.prefix) - Number(left.prefix) || right.score - left.score || left.index - right.index
|
|
1133
|
+
);
|
|
1134
|
+
return ranked.map((match) => match.item);
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
// src/darwin-desktop.ts
|
|
1138
|
+
function isDarwinDesktop() {
|
|
1139
|
+
return document.documentElement.dataset.platform === "darwin";
|
|
1140
|
+
}
|
|
1141
|
+
export {
|
|
1142
|
+
Button,
|
|
1143
|
+
Checkbox,
|
|
1144
|
+
ConnectionIndicator,
|
|
1145
|
+
DisclosureRow,
|
|
1146
|
+
HoverCard,
|
|
1147
|
+
ImageLightbox,
|
|
1148
|
+
Input,
|
|
1149
|
+
Menu,
|
|
1150
|
+
MenuGroup,
|
|
1151
|
+
MenuItemButton,
|
|
1152
|
+
MenuSurface,
|
|
1153
|
+
Modal,
|
|
1154
|
+
Pill,
|
|
1155
|
+
RiskConfirmation,
|
|
1156
|
+
SegmentedControl,
|
|
1157
|
+
SegmentedTabs,
|
|
1158
|
+
ShortcutKeys,
|
|
1159
|
+
StateDot,
|
|
1160
|
+
Switch,
|
|
1161
|
+
Tag,
|
|
1162
|
+
TextShimmer,
|
|
1163
|
+
Toast,
|
|
1164
|
+
Tooltip,
|
|
1165
|
+
closeTopModal,
|
|
1166
|
+
fileSizeText,
|
|
1167
|
+
focusWithoutRing,
|
|
1168
|
+
isBehindModal,
|
|
1169
|
+
isDarwinDesktop,
|
|
1170
|
+
modalSelector,
|
|
1171
|
+
observeComposition,
|
|
1172
|
+
observeStickyMenuGroups,
|
|
1173
|
+
pointerModality,
|
|
1174
|
+
projectUserText,
|
|
1175
|
+
rankByName,
|
|
1176
|
+
relativeTime,
|
|
1177
|
+
useAnchoredMaxHeight,
|
|
1178
|
+
useAnchoredPosition,
|
|
1179
|
+
useDismissOnOutsidePointer,
|
|
1180
|
+
useModalLayer,
|
|
1181
|
+
writeClipboard
|
|
1182
|
+
};
|