@monkey-mini-app/ui 0.1.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/components.json +23 -0
- package/dist/globals.css +2 -0
- package/dist/index.js +138 -0
- package/dist/manifest.json +11 -0
- package/dist/src/blocks/activity-feed.tsx +9 -0
- package/dist/src/blocks/app-shell.tsx +37 -0
- package/dist/src/blocks/attachment-gallery.tsx +30 -0
- package/dist/src/blocks/bar-chart.tsx +33 -0
- package/dist/src/blocks/comment-thread.tsx +30 -0
- package/dist/src/blocks/description-list.tsx +16 -0
- package/dist/src/blocks/detail-panel.tsx +43 -0
- package/dist/src/blocks/donut-chart.tsx +38 -0
- package/dist/src/blocks/env-badge.tsx +23 -0
- package/dist/src/blocks/file-tree.tsx +5 -0
- package/dist/src/blocks/filter-bar.tsx +21 -0
- package/dist/src/blocks/gauge.tsx +13 -0
- package/dist/src/blocks/notification-center.tsx +22 -0
- package/dist/src/blocks/page-header.tsx +30 -0
- package/dist/src/blocks/progress-ring.tsx +25 -0
- package/dist/src/blocks/radar-chart.tsx +31 -0
- package/dist/src/blocks/request-inspector.tsx +34 -0
- package/dist/src/blocks/run-timeline.tsx +5 -0
- package/dist/src/blocks/scrollspy.tsx +42 -0
- package/dist/src/blocks/severity-chip.tsx +27 -0
- package/dist/src/blocks/sparkline.tsx +19 -0
- package/dist/src/blocks/stat-card.tsx +49 -0
- package/dist/src/blocks/status-badge.tsx +39 -0
- package/dist/src/blocks/terminal.tsx +10 -0
- package/dist/src/blocks/test-step-list.tsx +19 -0
- package/dist/src/blocks/trend-card.tsx +51 -0
- package/dist/src/components/accordion.tsx +72 -0
- package/dist/src/components/alert-dialog.tsx +185 -0
- package/dist/src/components/alert.tsx +76 -0
- package/dist/src/components/aspect-ratio.tsx +22 -0
- package/dist/src/components/attachment.tsx +207 -0
- package/dist/src/components/avatar.tsx +107 -0
- package/dist/src/components/badge.tsx +52 -0
- package/dist/src/components/breadcrumb.tsx +125 -0
- package/dist/src/components/bubble.tsx +128 -0
- package/dist/src/components/button-group.tsx +87 -0
- package/dist/src/components/button.tsx +58 -0
- package/dist/src/components/calendar.tsx +221 -0
- package/dist/src/components/card.tsx +103 -0
- package/dist/src/components/chart.tsx +371 -0
- package/dist/src/components/checkbox.tsx +29 -0
- package/dist/src/components/collapsible.tsx +19 -0
- package/dist/src/components/combobox.tsx +295 -0
- package/dist/src/components/command.tsx +196 -0
- package/dist/src/components/context-menu.tsx +271 -0
- package/dist/src/components/dialog.tsx +158 -0
- package/dist/src/components/drawer.tsx +226 -0
- package/dist/src/components/dropdown-menu.tsx +268 -0
- package/dist/src/components/empty.tsx +123 -0
- package/dist/src/components/field.tsx +236 -0
- package/dist/src/components/hover-card.tsx +49 -0
- package/dist/src/components/input-group.tsx +158 -0
- package/dist/src/components/input.tsx +20 -0
- package/dist/src/components/item.tsx +201 -0
- package/dist/src/components/kbd.tsx +26 -0
- package/dist/src/components/label.tsx +20 -0
- package/dist/src/components/marker.tsx +71 -0
- package/dist/src/components/menubar.tsx +280 -0
- package/dist/src/components/message-scroller.tsx +129 -0
- package/dist/src/components/message.tsx +92 -0
- package/dist/src/components/native-select.tsx +61 -0
- package/dist/src/components/navigation-menu.tsx +168 -0
- package/dist/src/components/pagination.tsx +135 -0
- package/dist/src/components/popover.tsx +88 -0
- package/dist/src/components/progress.tsx +83 -0
- package/dist/src/components/questionnaire.tsx +329 -0
- package/dist/src/components/radio-group.tsx +36 -0
- package/dist/src/components/resizable.tsx +50 -0
- package/dist/src/components/scroll-area.tsx +52 -0
- package/dist/src/components/select.tsx +201 -0
- package/dist/src/components/separator.tsx +23 -0
- package/dist/src/components/sheet.tsx +136 -0
- package/dist/src/components/sidebar.tsx +721 -0
- package/dist/src/components/skeleton.tsx +13 -0
- package/dist/src/components/slider.tsx +52 -0
- package/dist/src/components/spinner.tsx +10 -0
- package/dist/src/components/switch.tsx +32 -0
- package/dist/src/components/table.tsx +114 -0
- package/dist/src/components/tabs.tsx +82 -0
- package/dist/src/components/textarea.tsx +18 -0
- package/dist/src/components/toast.tsx +234 -0
- package/dist/src/components/toggle-group.tsx +89 -0
- package/dist/src/components/toggle.tsx +43 -0
- package/dist/src/components/tooltip.tsx +66 -0
- package/dist/src/composites/autocomplete.tsx +55 -0
- package/dist/src/composites/cascader.tsx +46 -0
- package/dist/src/composites/color-picker.tsx +19 -0
- package/dist/src/composites/confirm-dialog.tsx +56 -0
- package/dist/src/composites/copyable.tsx +37 -0
- package/dist/src/composites/currency-input.tsx +31 -0
- package/dist/src/composites/date-chrome.tsx +157 -0
- package/dist/src/composites/date-picker.tsx +91 -0
- package/dist/src/composites/date-range-picker.tsx +96 -0
- package/dist/src/composites/date-time-picker.tsx +115 -0
- package/dist/src/composites/date-time-range-picker.tsx +51 -0
- package/dist/src/composites/duration-input.tsx +122 -0
- package/dist/src/composites/mini-calendar.tsx +24 -0
- package/dist/src/composites/number-field.tsx +53 -0
- package/dist/src/composites/password-field.tsx +44 -0
- package/dist/src/composites/phone-input.tsx +22 -0
- package/dist/src/composites/rating.tsx +39 -0
- package/dist/src/composites/relative-date-picker.tsx +62 -0
- package/dist/src/composites/search-input.tsx +49 -0
- package/dist/src/composites/slider-range.tsx +30 -0
- package/dist/src/composites/tag-input.tsx +56 -0
- package/dist/src/composites/time-picker.tsx +199 -0
- package/dist/src/composites/time-range-picker.tsx +25 -0
- package/dist/src/composites/timezone-select.tsx +251 -0
- package/dist/src/composites/transfer.tsx +52 -0
- package/dist/src/composites/user-picker.tsx +40 -0
- package/dist/src/hooks/use-mobile.ts +19 -0
- package/dist/src/i18n/context.tsx +72 -0
- package/dist/src/i18n/en.ts +168 -0
- package/dist/src/i18n/zh.ts +160 -0
- package/dist/src/index.ts +134 -0
- package/dist/src/lib/icons.tsx +16 -0
- package/dist/src/lib/illustrations.tsx +573 -0
- package/dist/src/lib/utils.ts +6 -0
- package/dist/src/products/cells.tsx +18 -0
- package/dist/src/products/code-block.tsx +75 -0
- package/dist/src/products/code-editor.tsx +49 -0
- package/dist/src/products/column-meta.d.ts +9 -0
- package/dist/src/products/data-grid.tsx +689 -0
- package/dist/src/products/diff-viewer.tsx +129 -0
- package/dist/src/products/event-calendar.tsx +845 -0
- package/dist/src/products/export-csv.ts +25 -0
- package/dist/src/products/file-dropzone.tsx +41 -0
- package/dist/src/products/gantt.tsx +41 -0
- package/dist/src/products/jira-wiki-parse.ts +197 -0
- package/dist/src/products/jira-wiki.tsx +285 -0
- package/dist/src/products/jql-input.tsx +62 -0
- package/dist/src/products/jql-language.ts +70 -0
- package/dist/src/products/json-viewer.tsx +37 -0
- package/dist/src/products/kanban-issue-panel.tsx +98 -0
- package/dist/src/products/kanban.tsx +245 -0
- package/dist/src/products/log-viewer.tsx +33 -0
- package/dist/src/products/markdown-editor.tsx +63 -0
- package/dist/src/products/markdown.tsx +26 -0
- package/dist/src/products/rich-text-editor.tsx +84 -0
- package/dist/src/products/sortable-list.tsx +61 -0
- package/dist/src/products/stepper.tsx +89 -0
- package/dist/src/products/timeline.tsx +32 -0
- package/dist/src/products/tree-view.tsx +56 -0
- package/dist/src/styles/globals.css +352 -0
- package/package.json +100 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { StatusBadge } from "@monkey-mini-app/ui/blocks/status-badge"
|
|
2
|
+
|
|
3
|
+
export function TextCell({ value }: { value: unknown }) {
|
|
4
|
+
return <span className="truncate">{String(value ?? "")}</span>
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export function StatusCell({ value }: { value: unknown }) {
|
|
8
|
+
return <StatusBadge status={String(value ?? "pending")} />
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function BooleanCell({ value }: { value: unknown }) {
|
|
12
|
+
return <span className="text-muted-foreground">{value ? "Yes" : "No"}</span>
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function NumberCell({ value }: { value: unknown }) {
|
|
16
|
+
const n = Number(value)
|
|
17
|
+
return <span className="tabular-nums">{Number.isFinite(n) ? n.toLocaleString() : "—"}</span>
|
|
18
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import { codeToHtml } from "shiki"
|
|
5
|
+
|
|
6
|
+
import { cn } from "@monkey-mini-app/ui/lib/utils"
|
|
7
|
+
|
|
8
|
+
const aliases: Record<string, string> = {
|
|
9
|
+
typescript: "ts",
|
|
10
|
+
javascript: "js",
|
|
11
|
+
py: "python",
|
|
12
|
+
sh: "bash",
|
|
13
|
+
shell: "bash",
|
|
14
|
+
yml: "yaml",
|
|
15
|
+
plaintext: "text",
|
|
16
|
+
txt: "text",
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function CodeBlock({
|
|
20
|
+
code,
|
|
21
|
+
language = "ts",
|
|
22
|
+
className,
|
|
23
|
+
}: {
|
|
24
|
+
code: string
|
|
25
|
+
language?: string
|
|
26
|
+
className?: string
|
|
27
|
+
}) {
|
|
28
|
+
const [html, setHtml] = React.useState<string | null>(null)
|
|
29
|
+
const lang = aliases[language.toLowerCase()] ?? language.toLowerCase()
|
|
30
|
+
const dark =
|
|
31
|
+
typeof document !== "undefined" &&
|
|
32
|
+
document.documentElement.classList.contains("dark")
|
|
33
|
+
|
|
34
|
+
React.useEffect(() => {
|
|
35
|
+
let cancelled = false
|
|
36
|
+
codeToHtml(code, {
|
|
37
|
+
lang,
|
|
38
|
+
theme: dark ? "github-dark" : "github-light",
|
|
39
|
+
})
|
|
40
|
+
.then((out) => {
|
|
41
|
+
if (!cancelled) setHtml(out)
|
|
42
|
+
})
|
|
43
|
+
.catch(() =>
|
|
44
|
+
codeToHtml(code, {
|
|
45
|
+
lang: "text",
|
|
46
|
+
theme: dark ? "github-dark" : "github-light",
|
|
47
|
+
}).then((out) => {
|
|
48
|
+
if (!cancelled) setHtml(out)
|
|
49
|
+
})
|
|
50
|
+
)
|
|
51
|
+
return () => {
|
|
52
|
+
cancelled = true
|
|
53
|
+
}
|
|
54
|
+
}, [code, lang, dark])
|
|
55
|
+
|
|
56
|
+
return (
|
|
57
|
+
<div
|
|
58
|
+
data-testid="code-block"
|
|
59
|
+
data-language={lang}
|
|
60
|
+
data-highlighted={html ? "true" : "false"}
|
|
61
|
+
className={cn(
|
|
62
|
+
"overflow-auto rounded-xl border text-xs leading-6 [&_code]:font-mono [&_pre]:m-0 [&_pre]:bg-transparent [&_pre]:p-3",
|
|
63
|
+
className
|
|
64
|
+
)}
|
|
65
|
+
>
|
|
66
|
+
{html ? (
|
|
67
|
+
<div dangerouslySetInnerHTML={{ __html: html }} />
|
|
68
|
+
) : (
|
|
69
|
+
<pre>
|
|
70
|
+
<code>{code}</code>
|
|
71
|
+
</pre>
|
|
72
|
+
)}
|
|
73
|
+
</div>
|
|
74
|
+
)
|
|
75
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import { html } from "@codemirror/lang-html"
|
|
4
|
+
import { javascript } from "@codemirror/lang-javascript"
|
|
5
|
+
import { json } from "@codemirror/lang-json"
|
|
6
|
+
import { markdown } from "@codemirror/lang-markdown"
|
|
7
|
+
import { oneDark } from "@codemirror/theme-one-dark"
|
|
8
|
+
import CodeMirror from "@uiw/react-codemirror"
|
|
9
|
+
|
|
10
|
+
import { cn } from "@monkey-mini-app/ui/lib/utils"
|
|
11
|
+
|
|
12
|
+
const langs = {
|
|
13
|
+
js: javascript(),
|
|
14
|
+
ts: javascript({ typescript: true }),
|
|
15
|
+
json: json(),
|
|
16
|
+
html: html(),
|
|
17
|
+
md: markdown(),
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function CodeEditor({
|
|
21
|
+
value,
|
|
22
|
+
onChange,
|
|
23
|
+
language = "ts",
|
|
24
|
+
height = "220px",
|
|
25
|
+
className,
|
|
26
|
+
}: {
|
|
27
|
+
value: string
|
|
28
|
+
onChange?: (value: string) => void
|
|
29
|
+
language?: keyof typeof langs
|
|
30
|
+
height?: string
|
|
31
|
+
className?: string
|
|
32
|
+
}) {
|
|
33
|
+
const dark =
|
|
34
|
+
typeof document !== "undefined" &&
|
|
35
|
+
document.documentElement.classList.contains("dark")
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<div data-testid="code-editor" className={cn("overflow-hidden rounded-xl border", className)}>
|
|
39
|
+
<CodeMirror
|
|
40
|
+
value={value}
|
|
41
|
+
height={height}
|
|
42
|
+
theme={dark ? oneDark : "light"}
|
|
43
|
+
extensions={[langs[language] ?? langs.ts]}
|
|
44
|
+
onChange={(next) => onChange?.(next)}
|
|
45
|
+
basicSetup={{ lineNumbers: true }}
|
|
46
|
+
/>
|
|
47
|
+
</div>
|
|
48
|
+
)
|
|
49
|
+
}
|