@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
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
// src/theme-core.ts
|
|
2
|
+
var THEME_PREFERENCES = ["light", "dark", "system"];
|
|
3
|
+
var DEFAULT_PREFERENCE = "system";
|
|
4
|
+
var THEME_STORAGE_KEY = "dsh-ui-primitives.theme-preference";
|
|
5
|
+
var listeners = /* @__PURE__ */ new Set();
|
|
6
|
+
var current = DEFAULT_PREFERENCE;
|
|
7
|
+
var currentDark = false;
|
|
8
|
+
var initialized = false;
|
|
9
|
+
var mediaQuery;
|
|
10
|
+
var mediaListenerAttached = false;
|
|
11
|
+
function isThemePreference(value) {
|
|
12
|
+
return typeof value === "string" && THEME_PREFERENCES.includes(value);
|
|
13
|
+
}
|
|
14
|
+
function getMediaQuery() {
|
|
15
|
+
if (mediaQuery !== void 0) return mediaQuery;
|
|
16
|
+
if (typeof window === "undefined" || typeof window.matchMedia !== "function") return void 0;
|
|
17
|
+
mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
|
|
18
|
+
return mediaQuery;
|
|
19
|
+
}
|
|
20
|
+
function resolveDark(preference) {
|
|
21
|
+
return preference === "dark" || preference === "system" && (getMediaQuery()?.matches ?? false);
|
|
22
|
+
}
|
|
23
|
+
function applyTheme(preference) {
|
|
24
|
+
currentDark = resolveDark(preference);
|
|
25
|
+
if (typeof document === "undefined") return;
|
|
26
|
+
document.documentElement.style.colorScheme = currentDark ? "dark" : "light";
|
|
27
|
+
document.body?.toggleAttribute("data-ds-dark-theme", currentDark);
|
|
28
|
+
}
|
|
29
|
+
function notify() {
|
|
30
|
+
for (const listener of listeners) listener();
|
|
31
|
+
}
|
|
32
|
+
function onSystemThemeChange() {
|
|
33
|
+
if (current !== "system") return;
|
|
34
|
+
applyTheme(current);
|
|
35
|
+
notify();
|
|
36
|
+
}
|
|
37
|
+
function attachSystemListener() {
|
|
38
|
+
if (mediaListenerAttached) return;
|
|
39
|
+
const query = getMediaQuery();
|
|
40
|
+
if (query === void 0) return;
|
|
41
|
+
if (typeof query.addEventListener === "function") query.addEventListener("change", onSystemThemeChange);
|
|
42
|
+
else query.addListener?.(onSystemThemeChange);
|
|
43
|
+
mediaListenerAttached = true;
|
|
44
|
+
}
|
|
45
|
+
function readStoredPreference() {
|
|
46
|
+
if (typeof window === "undefined") return DEFAULT_PREFERENCE;
|
|
47
|
+
try {
|
|
48
|
+
const stored = window.localStorage.getItem(THEME_STORAGE_KEY);
|
|
49
|
+
return isThemePreference(stored) ? stored : DEFAULT_PREFERENCE;
|
|
50
|
+
} catch {
|
|
51
|
+
return DEFAULT_PREFERENCE;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
function initializeTheme() {
|
|
55
|
+
if (initialized) {
|
|
56
|
+
applyTheme(current);
|
|
57
|
+
return current;
|
|
58
|
+
}
|
|
59
|
+
initialized = true;
|
|
60
|
+
current = readStoredPreference();
|
|
61
|
+
attachSystemListener();
|
|
62
|
+
applyTheme(current);
|
|
63
|
+
return current;
|
|
64
|
+
}
|
|
65
|
+
function setThemePreference(preference) {
|
|
66
|
+
initialized = true;
|
|
67
|
+
current = preference;
|
|
68
|
+
attachSystemListener();
|
|
69
|
+
applyTheme(preference);
|
|
70
|
+
if (typeof window !== "undefined") {
|
|
71
|
+
try {
|
|
72
|
+
window.localStorage.setItem(THEME_STORAGE_KEY, preference);
|
|
73
|
+
} catch {
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
notify();
|
|
77
|
+
}
|
|
78
|
+
function getThemePreference() {
|
|
79
|
+
return current;
|
|
80
|
+
}
|
|
81
|
+
function getIsDark() {
|
|
82
|
+
return currentDark;
|
|
83
|
+
}
|
|
84
|
+
function subscribeTheme(listener) {
|
|
85
|
+
initializeTheme();
|
|
86
|
+
listeners.add(listener);
|
|
87
|
+
return () => {
|
|
88
|
+
listeners.delete(listener);
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export {
|
|
93
|
+
THEME_PREFERENCES,
|
|
94
|
+
DEFAULT_PREFERENCE,
|
|
95
|
+
THEME_STORAGE_KEY,
|
|
96
|
+
isThemePreference,
|
|
97
|
+
resolveDark,
|
|
98
|
+
applyTheme,
|
|
99
|
+
initializeTheme,
|
|
100
|
+
setThemePreference,
|
|
101
|
+
getThemePreference,
|
|
102
|
+
getIsDark,
|
|
103
|
+
subscribeTheme
|
|
104
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Spinner
|
|
3
|
+
} from "./chunk-EWAZFWLW.js";
|
|
4
|
+
|
|
5
|
+
// src/seekbuddy/Timeline.tsx
|
|
6
|
+
import clsx from "clsx";
|
|
7
|
+
|
|
8
|
+
// .build/css/seekbuddy/Timeline.module.mjs
|
|
9
|
+
var id = "@seekbuddy/dsh-ui/seekbuddy/Timeline.module.css";
|
|
10
|
+
if (typeof document !== "undefined" && !document.querySelector('style[data-dsh-ui-primitives="' + id + '"]')) {
|
|
11
|
+
const element = document.createElement("style");
|
|
12
|
+
element.setAttribute("data-dsh-ui-primitives", id);
|
|
13
|
+
element.textContent = ".M4slRG_timeline{--timeline-badge:16px;--timeline-gap:20px;gap:28px;display:grid}.M4slRG_heading{color:var(--dsw-alias-label-primary);font:var(--dsw-font-s-14);margin:0 0 20px}.M4slRG_list{margin:0;padding:0;list-style:none;display:grid}.M4slRG_item{grid-template-columns:var(--timeline-badge) minmax(0, 1fr);column-gap:var(--timeline-gap);padding-bottom:28px;display:grid;position:relative}.M4slRG_item:last-child{padding-bottom:0}.M4slRG_rail{top:calc(var(--timeline-badge) + 6px);bottom:0;left:calc(var(--timeline-badge) / 2);background:var(--dsw-alias-border-l1);width:1px;position:absolute}.M4slRG_item:last-child .M4slRG_rail{bottom:-20px}.M4slRG_badgeCell{width:var(--timeline-badge);height:var(--timeline-badge);justify-content:center;align-items:center;margin-top:3px;display:inline-flex}.M4slRG_badge{width:var(--timeline-badge);height:var(--timeline-badge)}.M4slRG_succeeded{color:var(--dsw-alias-state-success-primary)}.M4slRG_failed{color:var(--dsw-alias-state-error-primary)}.M4slRG_canceled,.M4slRG_running{color:var(--dsw-alias-label-tertiary)}.M4slRG_glyph{fill:none;stroke:var(--dsw-alias-label-primary-inverted);stroke-width:1.8px;stroke-linecap:round;stroke-linejoin:round}.M4slRG_body{text-align:left;gap:10px;min-width:0;display:grid}.M4slRG_select{border-radius:var(--dsw-radius-sm);color:inherit;cursor:pointer;font:inherit;background:0 0;border:0;padding:0}.M4slRG_select:hover .M4slRG_title{color:var(--dsw-alias-label-primary-bluish)}.M4slRG_select:focus-visible{outline-offset:4px;outline-style:solid}.M4slRG_title{min-width:0;color:var(--dsw-alias-label-primary);font:var(--dsw-font-s-14);flex-wrap:wrap;align-items:center;gap:8px;display:flex}.M4slRG_meta{color:var(--dsw-alias-label-tertiary);font:var(--dsw-font-xs-13);flex-wrap:wrap;gap:4px 12px;display:flex}.M4slRG_message{color:var(--dsw-alias-label-secondary);font:var(--dsw-font-xs-13);overflow-wrap:anywhere}.M4slRG_messageError{color:var(--dsw-alias-state-error-primary)}.M4slRG_srOnly{clip-path:inset(50%);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}";
|
|
14
|
+
document.head.appendChild(element);
|
|
15
|
+
}
|
|
16
|
+
var Timeline_module_default = { "srOnly": "M4slRG_srOnly", "failed": "M4slRG_failed", "meta": "M4slRG_meta", "glyph": "M4slRG_glyph", "select": "M4slRG_select", "rail": "M4slRG_rail", "running": "M4slRG_running", "badgeCell": "M4slRG_badgeCell", "title": "M4slRG_title", "messageError": "M4slRG_messageError", "heading": "M4slRG_heading", "list": "M4slRG_list", "timeline": "M4slRG_timeline", "body": "M4slRG_body", "message": "M4slRG_message", "succeeded": "M4slRG_succeeded", "canceled": "M4slRG_canceled", "badge": "M4slRG_badge", "item": "M4slRG_item" };
|
|
17
|
+
|
|
18
|
+
// src/seekbuddy/Timeline.tsx
|
|
19
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
20
|
+
var BADGE_TONE = {
|
|
21
|
+
succeeded: Timeline_module_default.succeeded,
|
|
22
|
+
failed: Timeline_module_default.failed,
|
|
23
|
+
canceled: Timeline_module_default.canceled
|
|
24
|
+
};
|
|
25
|
+
function Badge({ status, label }) {
|
|
26
|
+
if (status === "running") return /* @__PURE__ */ jsx(Spinner, { className: Timeline_module_default.running, label });
|
|
27
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
28
|
+
/* @__PURE__ */ jsxs("svg", { className: clsx(Timeline_module_default.badge, BADGE_TONE[status]), viewBox: "0 0 16 16", "aria-hidden": "true", children: [
|
|
29
|
+
/* @__PURE__ */ jsx("circle", { cx: "8", cy: "8", r: "8", fill: "currentColor" }),
|
|
30
|
+
status === "succeeded" && /* @__PURE__ */ jsx("path", { className: Timeline_module_default.glyph, d: "M4.5 8.2l2.3 2.3 4.7-4.8" }),
|
|
31
|
+
status === "failed" && /* @__PURE__ */ jsx("path", { className: Timeline_module_default.glyph, d: "M5.3 5.3l5.4 5.4M10.7 5.3l-5.4 5.4" }),
|
|
32
|
+
status === "canceled" && /* @__PURE__ */ jsx("path", { className: Timeline_module_default.glyph, d: "M4.8 8h6.4" })
|
|
33
|
+
] }),
|
|
34
|
+
/* @__PURE__ */ jsx("span", { className: Timeline_module_default.srOnly, children: label })
|
|
35
|
+
] });
|
|
36
|
+
}
|
|
37
|
+
function Timeline({ label, statusLabels, groups, className }) {
|
|
38
|
+
return /* @__PURE__ */ jsx("section", { className: clsx(Timeline_module_default.timeline, className), "aria-label": label, children: groups.map((group) => /* @__PURE__ */ jsxs("div", { children: [
|
|
39
|
+
group.heading !== void 0 && /* @__PURE__ */ jsx("h3", { className: Timeline_module_default.heading, children: group.heading }),
|
|
40
|
+
/* @__PURE__ */ jsx("ol", { className: Timeline_module_default.list, children: group.items.map((item) => {
|
|
41
|
+
const body = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
42
|
+
/* @__PURE__ */ jsx("div", { className: Timeline_module_default.title, children: item.title }),
|
|
43
|
+
item.meta !== void 0 && item.meta.length > 0 && /* @__PURE__ */ jsx("div", { className: Timeline_module_default.meta, children: item.meta.map((part, index) => /* @__PURE__ */ jsx("span", { children: part }, index)) }),
|
|
44
|
+
item.message !== void 0 && /* @__PURE__ */ jsx("div", { className: clsx(Timeline_module_default.message, item.status === "failed" && Timeline_module_default.messageError), children: item.message })
|
|
45
|
+
] });
|
|
46
|
+
return /* @__PURE__ */ jsxs("li", { className: Timeline_module_default.item, "data-status": item.status, children: [
|
|
47
|
+
/* @__PURE__ */ jsx("span", { className: Timeline_module_default.rail, "aria-hidden": "true" }),
|
|
48
|
+
/* @__PURE__ */ jsx("span", { className: Timeline_module_default.badgeCell, children: /* @__PURE__ */ jsx(Badge, { status: item.status, label: statusLabels[item.status] }) }),
|
|
49
|
+
item.onSelect === void 0 ? /* @__PURE__ */ jsx("div", { className: Timeline_module_default.body, children: body }) : /* @__PURE__ */ jsx("button", { type: "button", className: clsx(Timeline_module_default.body, Timeline_module_default.select), onClick: item.onSelect, children: body })
|
|
50
|
+
] }, item.key);
|
|
51
|
+
}) })
|
|
52
|
+
] }, group.key)) });
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export {
|
|
56
|
+
Timeline
|
|
57
|
+
};
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Calendar
|
|
3
|
+
} from "./chunk-XL33IPCV.js";
|
|
4
|
+
import {
|
|
5
|
+
addMonths,
|
|
6
|
+
compareIso,
|
|
7
|
+
monthOf,
|
|
8
|
+
todayIso
|
|
9
|
+
} from "./chunk-RZOP2PFC.js";
|
|
10
|
+
|
|
11
|
+
// src/seekbuddy/date/DateRangePicker.tsx
|
|
12
|
+
import clsx from "clsx";
|
|
13
|
+
import { Button } from "@seekbuddy/dsh-ui";
|
|
14
|
+
import { IconCheckOutlineRegular } from "@seekbuddy/dsh-ui/icons";
|
|
15
|
+
import { useId, useState } from "react";
|
|
16
|
+
|
|
17
|
+
// .build/css/seekbuddy/date/DateRangePicker.module.mjs
|
|
18
|
+
var id = "@seekbuddy/dsh-ui/seekbuddy/date/DateRangePicker.module.css";
|
|
19
|
+
if (typeof document !== "undefined" && !document.querySelector('style[data-dsh-ui-primitives="' + id + '"]')) {
|
|
20
|
+
const element = document.createElement("style");
|
|
21
|
+
element.setAttribute("data-dsh-ui-primitives", id);
|
|
22
|
+
element.textContent = '.JkkOGq_picker{color:var(--dsw-alias-label-primary);grid-template-columns:auto 1fr;grid-template-areas:"JkkOGq_presets JkkOGq_calendar""JkkOGq_footer JkkOGq_footer";gap:12px 16px;display:inline-grid}.JkkOGq_presets{border-right:.5px solid var(--dsw-alias-border-l1);grid-area:JkkOGq_presets;align-content:start;gap:2px;min-width:96px;margin:0;padding:0 12px 0 0;list-style:none;display:grid}.JkkOGq_presets:focus-visible{border-radius:var(--dsw-radius-sm);outline-offset:2px;outline-style:solid}.JkkOGq_preset{border-radius:var(--dsw-radius-sm);min-height:28px;color:var(--dsw-alias-label-secondary);cursor:pointer;font:var(--dsw-font-xs-13);white-space:nowrap;justify-content:space-between;align-items:center;gap:8px;padding:0 8px;display:flex}.JkkOGq_preset:hover{background:var(--dsw-alias-interactive-bg-hover)}.JkkOGq_presetSelected{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-multi-select)}.JkkOGq_presets:focus-visible [data-active]{box-shadow:inset 0 0 0 1px var(--dsw-alias-state-business-primary)}.JkkOGq_presetLabel{text-overflow:ellipsis;min-width:0;overflow:hidden}.JkkOGq_check{color:var(--dsw-alias-state-business-primary);flex:none}.JkkOGq_calendar{grid-area:JkkOGq_calendar}.JkkOGq_footer{border-top:.5px solid var(--dsw-alias-border-l1);grid-area:JkkOGq_footer;justify-content:space-between;align-items:center;gap:12px;min-height:28px;padding-top:12px;display:flex}.JkkOGq_status{min-width:0;color:var(--dsw-alias-label-tertiary);font:var(--dsw-font-xs-13)}.JkkOGq_actions{flex:none;gap:8px;display:inline-flex}';
|
|
23
|
+
document.head.appendChild(element);
|
|
24
|
+
}
|
|
25
|
+
var DateRangePicker_module_default = { "presetLabel": "JkkOGq_presetLabel", "actions": "JkkOGq_actions", "picker": "JkkOGq_picker", "preset": "JkkOGq_preset", "presets": "JkkOGq_presets", "calendar": "JkkOGq_calendar", "footer": "JkkOGq_footer", "check": "JkkOGq_check", "status": "JkkOGq_status", "presetSelected": "JkkOGq_presetSelected" };
|
|
26
|
+
|
|
27
|
+
// src/seekbuddy/date/DateRangePicker.tsx
|
|
28
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
29
|
+
var sameRange = (a, b) => a !== null && a.start === b.start && a.end === b.end;
|
|
30
|
+
function DateRangePicker({
|
|
31
|
+
value,
|
|
32
|
+
onChange,
|
|
33
|
+
onCancel,
|
|
34
|
+
presets,
|
|
35
|
+
labels,
|
|
36
|
+
month,
|
|
37
|
+
onMonthChange,
|
|
38
|
+
numberOfMonths = 2,
|
|
39
|
+
today: todayProp,
|
|
40
|
+
className,
|
|
41
|
+
...calendar
|
|
42
|
+
}) {
|
|
43
|
+
const idBase = useId();
|
|
44
|
+
const [todayFallback] = useState(() => todayProp ?? todayIso());
|
|
45
|
+
const today = todayProp ?? todayFallback;
|
|
46
|
+
const [draft, setDraft] = useState(value);
|
|
47
|
+
const [seenValue, setSeenValue] = useState(value);
|
|
48
|
+
const [monthState, setMonthState] = useState(() => monthOf(value?.start ?? today));
|
|
49
|
+
const visibleMonth = month ?? monthState;
|
|
50
|
+
const inView = (date) => {
|
|
51
|
+
const m = monthOf(date);
|
|
52
|
+
return compareIso(m, visibleMonth) >= 0 && compareIso(m, addMonths(visibleMonth, numberOfMonths - 1)) <= 0;
|
|
53
|
+
};
|
|
54
|
+
if (value !== seenValue) {
|
|
55
|
+
setSeenValue(value);
|
|
56
|
+
setDraft(value);
|
|
57
|
+
if (value !== null && month === void 0 && !inView(value.start)) setMonthState(monthOf(value.start));
|
|
58
|
+
}
|
|
59
|
+
const showMonth = (next) => {
|
|
60
|
+
if (month === void 0) setMonthState(next);
|
|
61
|
+
onMonthChange?.(next);
|
|
62
|
+
};
|
|
63
|
+
const [highlighted, setHighlighted] = useState(0);
|
|
64
|
+
const choosePreset = (preset) => {
|
|
65
|
+
setDraft(preset.range);
|
|
66
|
+
if (!inView(preset.range.start)) showMonth(monthOf(preset.range.start));
|
|
67
|
+
};
|
|
68
|
+
const onPresetsKeyDown = (event) => {
|
|
69
|
+
if (presets === void 0 || presets.length === 0) return;
|
|
70
|
+
let next = highlighted;
|
|
71
|
+
if (event.key === "ArrowDown") next = Math.min(presets.length - 1, highlighted + 1);
|
|
72
|
+
else if (event.key === "ArrowUp") next = Math.max(0, highlighted - 1);
|
|
73
|
+
else if (event.key === "Home") next = 0;
|
|
74
|
+
else if (event.key === "End") next = presets.length - 1;
|
|
75
|
+
else if (event.key === "Enter" || event.key === " ") {
|
|
76
|
+
event.preventDefault();
|
|
77
|
+
const preset = presets[highlighted];
|
|
78
|
+
if (preset !== void 0) choosePreset(preset);
|
|
79
|
+
return;
|
|
80
|
+
} else return;
|
|
81
|
+
event.preventDefault();
|
|
82
|
+
setHighlighted(next);
|
|
83
|
+
};
|
|
84
|
+
const presetId = (index) => `${idBase}-preset-${index}`;
|
|
85
|
+
const complete = draft !== null && draft.end !== null;
|
|
86
|
+
const drafting = draft !== null && draft.end === null;
|
|
87
|
+
const apply = () => {
|
|
88
|
+
if (draft !== null && draft.end !== null) onChange({ start: draft.start, end: draft.end });
|
|
89
|
+
};
|
|
90
|
+
const cancel = () => {
|
|
91
|
+
setDraft(value);
|
|
92
|
+
onCancel?.();
|
|
93
|
+
};
|
|
94
|
+
return /* @__PURE__ */ jsxs("div", { className: clsx(DateRangePicker_module_default.picker, className), children: [
|
|
95
|
+
presets !== void 0 && presets.length > 0 && /* @__PURE__ */ jsx(
|
|
96
|
+
"ul",
|
|
97
|
+
{
|
|
98
|
+
role: "listbox",
|
|
99
|
+
"aria-label": labels.presets,
|
|
100
|
+
"aria-activedescendant": presetId(Math.min(highlighted, presets.length - 1)),
|
|
101
|
+
tabIndex: 0,
|
|
102
|
+
className: DateRangePicker_module_default.presets,
|
|
103
|
+
onKeyDown: onPresetsKeyDown,
|
|
104
|
+
children: presets.map((preset, index) => {
|
|
105
|
+
const selected = sameRange(draft, preset.range);
|
|
106
|
+
return /* @__PURE__ */ jsxs(
|
|
107
|
+
"li",
|
|
108
|
+
{
|
|
109
|
+
id: presetId(index),
|
|
110
|
+
role: "option",
|
|
111
|
+
"aria-selected": selected,
|
|
112
|
+
"data-active": index === highlighted || void 0,
|
|
113
|
+
className: clsx(DateRangePicker_module_default.preset, selected && DateRangePicker_module_default.presetSelected),
|
|
114
|
+
onClick: () => {
|
|
115
|
+
setHighlighted(index);
|
|
116
|
+
choosePreset(preset);
|
|
117
|
+
},
|
|
118
|
+
children: [
|
|
119
|
+
/* @__PURE__ */ jsx("span", { className: DateRangePicker_module_default.presetLabel, children: preset.label }),
|
|
120
|
+
selected && /* @__PURE__ */ jsx(IconCheckOutlineRegular, { size: 14, className: DateRangePicker_module_default.check })
|
|
121
|
+
]
|
|
122
|
+
},
|
|
123
|
+
preset.key
|
|
124
|
+
);
|
|
125
|
+
})
|
|
126
|
+
}
|
|
127
|
+
),
|
|
128
|
+
/* @__PURE__ */ jsx(
|
|
129
|
+
Calendar,
|
|
130
|
+
{
|
|
131
|
+
...calendar,
|
|
132
|
+
mode: "range",
|
|
133
|
+
value: draft,
|
|
134
|
+
onChange: setDraft,
|
|
135
|
+
month: visibleMonth,
|
|
136
|
+
onMonthChange: showMonth,
|
|
137
|
+
numberOfMonths,
|
|
138
|
+
today,
|
|
139
|
+
labels,
|
|
140
|
+
className: DateRangePicker_module_default.calendar
|
|
141
|
+
}
|
|
142
|
+
),
|
|
143
|
+
/* @__PURE__ */ jsxs("div", { className: DateRangePicker_module_default.footer, children: [
|
|
144
|
+
/* @__PURE__ */ jsx("span", { className: DateRangePicker_module_default.status, role: "status", "aria-live": "polite", children: drafting ? labels.pickEnd : "" }),
|
|
145
|
+
/* @__PURE__ */ jsxs("span", { className: DateRangePicker_module_default.actions, children: [
|
|
146
|
+
/* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm", onClick: cancel, children: labels.cancel }),
|
|
147
|
+
/* @__PURE__ */ jsx(Button, { variant: "primary", size: "sm", disabled: !complete, onClick: apply, children: labels.apply })
|
|
148
|
+
] })
|
|
149
|
+
] })
|
|
150
|
+
] });
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export {
|
|
154
|
+
DateRangePicker
|
|
155
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Spinner
|
|
3
|
+
} from "./chunk-EWAZFWLW.js";
|
|
4
|
+
|
|
5
|
+
// src/seekbuddy/Empty.tsx
|
|
6
|
+
import clsx from "clsx";
|
|
7
|
+
import { Button } from "@seekbuddy/dsh-ui";
|
|
8
|
+
import { IconRefreshOutlineRegular, IconSearchOutlineRegular, IconWarningOutlineRegular } from "@seekbuddy/dsh-ui/icons";
|
|
9
|
+
|
|
10
|
+
// .build/css/seekbuddy/Empty.module.mjs
|
|
11
|
+
var id = "@seekbuddy/dsh-ui/seekbuddy/Empty.module.css";
|
|
12
|
+
if (typeof document !== "undefined" && !document.querySelector('style[data-dsh-ui-primitives="' + id + '"]')) {
|
|
13
|
+
const element = document.createElement("style");
|
|
14
|
+
element.setAttribute("data-dsh-ui-primitives", id);
|
|
15
|
+
element.textContent = ".tPyKuq_empty{box-sizing:border-box;border-radius:var(--dsw-radius-lg);color:var(--dsw-alias-label-tertiary);text-align:center;font:var(--dsw-font-xs-13);border:0;flex-direction:column;justify-content:center;align-items:center;gap:6px;margin:0;padding:28px 24px;display:flex}.tPyKuq_bordered{border:1px dashed var(--dsw-alias-border-l2)}.tPyKuq_icon{color:var(--dsw-alias-label-tertiary);justify-content:center;align-items:center;margin-bottom:2px;display:inline-flex}.tPyKuq_icon .tPyKuq_spinner{border-width:2px;width:20px;height:20px}.tPyKuq_title{color:var(--dsw-alias-label-primary);font:var(--dsw-font-s-strong-14);margin:0}.tPyKuq_description{max-width:36em;color:var(--dsw-alias-label-tertiary);font:var(--dsw-font-xs-13);margin:0}.tPyKuq_error .tPyKuq_icon,.tPyKuq_error .tPyKuq_title{color:var(--dsw-alias-state-error-primary)}.tPyKuq_action{flex-wrap:wrap;justify-content:center;align-items:center;gap:8px;margin-top:6px;display:flex}";
|
|
16
|
+
document.head.appendChild(element);
|
|
17
|
+
}
|
|
18
|
+
var Empty_module_default = { "error": "tPyKuq_error", "description": "tPyKuq_description", "icon": "tPyKuq_icon", "bordered": "tPyKuq_bordered", "title": "tPyKuq_title", "action": "tPyKuq_action", "empty": "tPyKuq_empty", "spinner": "tPyKuq_spinner" };
|
|
19
|
+
|
|
20
|
+
// src/seekbuddy/Empty.tsx
|
|
21
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
22
|
+
function Empty({
|
|
23
|
+
status,
|
|
24
|
+
title,
|
|
25
|
+
description,
|
|
26
|
+
icon,
|
|
27
|
+
action,
|
|
28
|
+
retryLabel,
|
|
29
|
+
onRetry,
|
|
30
|
+
minHeight = 240,
|
|
31
|
+
bordered = true,
|
|
32
|
+
className,
|
|
33
|
+
style,
|
|
34
|
+
...rest
|
|
35
|
+
}) {
|
|
36
|
+
const live = status === "loading" ? { role: "status", "aria-live": "polite" } : status === "error" ? { role: "alert" } : {};
|
|
37
|
+
const visual = icon === void 0 ? defaultIcon(status) : icon;
|
|
38
|
+
const retry = status === "error" && onRetry !== void 0 && retryLabel !== void 0 ? /* @__PURE__ */ jsx(Button, { size: "sm", variant: "outline", icon: /* @__PURE__ */ jsx(IconRefreshOutlineRegular, {}), onClick: onRetry, children: retryLabel }) : null;
|
|
39
|
+
return /* @__PURE__ */ jsxs(
|
|
40
|
+
"div",
|
|
41
|
+
{
|
|
42
|
+
...live,
|
|
43
|
+
...rest,
|
|
44
|
+
className: clsx(Empty_module_default.empty, Empty_module_default[status], bordered && Empty_module_default.bordered, className),
|
|
45
|
+
style: { minHeight, ...style },
|
|
46
|
+
children: [
|
|
47
|
+
visual === null ? null : /* @__PURE__ */ jsx("span", { className: Empty_module_default.icon, "aria-hidden": "true", children: visual }),
|
|
48
|
+
/* @__PURE__ */ jsx("p", { className: Empty_module_default.title, children: title }),
|
|
49
|
+
description === void 0 || description === null ? null : /* @__PURE__ */ jsx("div", { className: Empty_module_default.description, children: description }),
|
|
50
|
+
action === void 0 && retry === null ? null : /* @__PURE__ */ jsxs("div", { className: Empty_module_default.action, children: [
|
|
51
|
+
action,
|
|
52
|
+
retry
|
|
53
|
+
] })
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
function defaultIcon(status) {
|
|
59
|
+
if (status === "loading") return /* @__PURE__ */ jsx(Spinner, { size: "md", tone: "page", className: Empty_module_default.spinner });
|
|
60
|
+
if (status === "error") return /* @__PURE__ */ jsx(IconWarningOutlineRegular, { size: 20 });
|
|
61
|
+
return /* @__PURE__ */ jsx(IconSearchOutlineRegular, { size: 20 });
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export {
|
|
65
|
+
Empty
|
|
66
|
+
};
|