@allbluecn/admin-app 0.2.6 → 0.3.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/package.json +16 -12
- package/src/components/admin/admin-user-menu.tsx +2 -4
- package/src/components/admin/developer-log.tsx +3 -5
- package/src/components/ai-memory/memory-facts-panel.tsx +383 -0
- package/src/components/ai-prompts/preview-panel.tsx +165 -0
- package/src/components/ai-prompts/prompt-editor.tsx +328 -0
- package/src/components/ai-prompts/prompt-table.tsx +141 -0
- package/src/components/ai-prompts/prompt-utils.ts +124 -0
- package/src/components/ai-prompts/section-editor.tsx +135 -0
- package/src/components/ai-prompts/variable-panel.tsx +128 -0
- package/src/components/ai-prompts/version-history.tsx +157 -0
- package/src/components/ai-provider/provider-form.tsx +6 -10
- package/src/components/ai-provider/provider-table.tsx +33 -13
- package/src/components/auth/admin-login-form.tsx +1 -1
- package/src/components/component/component-form-dialog.tsx +4 -4
- package/src/components/component/component-import-dialog.tsx +2 -2
- package/src/components/dependency/changelog-dialog.tsx +2 -4
- package/src/components/dependency/columns.tsx +4 -8
- package/src/components/dependency/dependency-table.tsx +2 -2
- package/src/components/dependency/edit-dialog.tsx +7 -11
- package/src/components/invitations/invitations-page.tsx +4 -8
- package/src/components/knowledge-public/bookmark-form-dialog.tsx +1 -1
- package/src/components/knowledge-public/compliance-form-dialog.tsx +1 -1
- package/src/components/knowledge-public/legal-form-dialog.tsx +2 -2
- package/src/components/layout/sidebar-02/app-sidebar.tsx +17 -9
- package/src/components/layout/sidebar-02/nav-main.tsx +6 -14
- package/src/components/layout/sidebar-02/nav-notifications.tsx +3 -7
- package/src/components/magicui/rainbow-button.tsx +2 -2
- package/src/components/market/columns.tsx +2 -4
- package/src/components/market/market-app-form.tsx +2 -2
- package/src/components/market/market-app-list.tsx +1 -1
- package/src/components/oauth-providers/provider-page.tsx +1 -1
- package/src/components/ui/alert-dialog.tsx +28 -57
- package/src/components/ui/alert.tsx +3 -4
- package/src/components/ui/avatar.tsx +5 -28
- package/src/components/ui/badge.tsx +19 -34
- package/src/components/ui/button.tsx +14 -41
- package/src/components/ui/card.tsx +6 -24
- package/src/components/ui/checkbox.tsx +4 -26
- package/src/components/ui/collapsible.tsx +6 -37
- package/src/components/ui/dialog.tsx +30 -60
- package/src/components/ui/dropdown-menu.tsx +118 -137
- package/src/components/ui/field.tsx +8 -27
- package/src/components/ui/input-group.tsx +13 -26
- package/src/components/ui/input.tsx +4 -21
- package/src/components/ui/label.tsx +3 -27
- package/src/components/ui/pagination.tsx +17 -31
- package/src/components/ui/select.tsx +101 -76
- package/src/components/ui/separator.tsx +4 -27
- package/src/components/ui/sheet.tsx +29 -58
- package/src/components/ui/sidebar.tsx +119 -117
- package/src/components/ui/skeleton.tsx +1 -18
- package/src/components/ui/switch.tsx +5 -24
- package/src/components/ui/table.tsx +1 -19
- package/src/components/ui/textarea.tsx +2 -20
- package/src/components/ui/toast.tsx +282 -0
- package/src/components/ui/tooltip.tsx +34 -45
- package/src/components/user/settings-activity-log.tsx +1 -1
- package/src/components/user/user-create-dialog.tsx +2 -2
- package/src/components/user/user-filters.tsx +2 -2
- package/src/hooks/use-mobile.ts +0 -17
- package/src/lib/pacer.ts +21 -0
- package/src/lib/utils.ts +1 -23
- package/src/paraglide/messages/_index.js +95 -0
- package/src/paraglide/messages/admin_ai_memory_action_clearuser1.js +30 -0
- package/src/paraglide/messages/admin_ai_memory_action_query.js +30 -0
- package/src/paraglide/messages/admin_ai_memory_clear_cancel.js +30 -0
- package/src/paraglide/messages/admin_ai_memory_clear_confirm_action.js +30 -0
- package/src/paraglide/messages/admin_ai_memory_clear_confirm_description.js +30 -0
- package/src/paraglide/messages/admin_ai_memory_clear_confirm_title.js +30 -0
- package/src/paraglide/messages/admin_ai_memory_columns_actions.js +30 -0
- package/src/paraglide/messages/admin_ai_memory_columns_content.js +30 -0
- package/src/paraglide/messages/admin_ai_memory_columns_createdat1.js +30 -0
- package/src/paraglide/messages/admin_ai_memory_columns_threadid1.js +30 -0
- package/src/paraglide/messages/admin_ai_memory_delete_cancel.js +30 -0
- package/src/paraglide/messages/admin_ai_memory_delete_confirm_action.js +30 -0
- package/src/paraglide/messages/admin_ai_memory_delete_confirm_description.js +30 -0
- package/src/paraglide/messages/admin_ai_memory_delete_confirm_title.js +30 -0
- package/src/paraglide/messages/admin_ai_memory_empty.js +30 -0
- package/src/paraglide/messages/admin_ai_memory_emptyhint1.js +30 -0
- package/src/paraglide/messages/admin_ai_memory_error_nouserid2.js +30 -0
- package/src/paraglide/messages/admin_ai_memory_error_query.js +30 -0
- package/src/paraglide/messages/admin_ai_memory_error_title.js +30 -0
- package/src/paraglide/messages/admin_ai_memory_form_user.js +30 -0
- package/src/paraglide/messages/admin_ai_memory_page_description.js +30 -0
- package/src/paraglide/messages/admin_ai_memory_page_title.js +30 -0
- package/src/paraglide/messages/admin_ai_memory_placeholder_user.js +30 -0
- package/src/paraglide/messages/admin_ai_memory_stat_count.js +30 -0
- package/src/paraglide/messages/admin_ai_memory_stat_lastwrite1.js +30 -0
- package/src/paraglide/messages/admin_ai_memory_toast_cleared.js +30 -0
- package/src/paraglide/messages/admin_ai_memory_toast_deleted.js +30 -0
- package/src/paraglide/messages/admin_ai_prompts_active.js +30 -0
- package/src/paraglide/messages/admin_ai_prompts_back.js +30 -0
- package/src/paraglide/messages/admin_ai_prompts_badge_protected.js +30 -0
- package/src/paraglide/messages/admin_ai_prompts_cache_hint.js +30 -0
- package/src/paraglide/messages/admin_ai_prompts_columns_active.js +30 -0
- package/src/paraglide/messages/admin_ai_prompts_columns_key.js +30 -0
- package/src/paraglide/messages/admin_ai_prompts_columns_name.js +30 -0
- package/src/paraglide/messages/admin_ai_prompts_columns_protected.js +30 -0
- package/src/paraglide/messages/admin_ai_prompts_columns_updatedat1.js +30 -0
- package/src/paraglide/messages/admin_ai_prompts_columns_version.js +30 -0
- package/src/paraglide/messages/admin_ai_prompts_description.js +30 -0
- package/src/paraglide/messages/admin_ai_prompts_description_placeholder.js +30 -0
- package/src/paraglide/messages/admin_ai_prompts_edit.js +30 -0
- package/src/paraglide/messages/admin_ai_prompts_name.js +30 -0
- package/src/paraglide/messages/admin_ai_prompts_name_placeholder.js +30 -0
- package/src/paraglide/messages/admin_ai_prompts_note_placeholder.js +30 -0
- package/src/paraglide/messages/admin_ai_prompts_page_description.js +30 -0
- package/src/paraglide/messages/admin_ai_prompts_page_title.js +30 -0
- package/src/paraglide/messages/admin_ai_prompts_preview_empty.js +30 -0
- package/src/paraglide/messages/admin_ai_prompts_preview_generating.js +30 -0
- package/src/paraglide/messages/admin_ai_prompts_preview_hint.js +30 -0
- package/src/paraglide/messages/admin_ai_prompts_preview_nocontent1.js +30 -0
- package/src/paraglide/messages/admin_ai_prompts_preview_placeholder.js +30 -0
- package/src/paraglide/messages/admin_ai_prompts_preview_section.js +30 -0
- package/src/paraglide/messages/admin_ai_prompts_preview_title.js +30 -0
- package/src/paraglide/messages/admin_ai_prompts_protected_hint.js +30 -0
- package/src/paraglide/messages/admin_ai_prompts_rollback.js +30 -0
- package/src/paraglide/messages/admin_ai_prompts_rollback_confirm_action.js +30 -0
- package/src/paraglide/messages/admin_ai_prompts_rollback_confirm_description.js +30 -0
- package/src/paraglide/messages/admin_ai_prompts_rollback_confirm_title.js +30 -0
- package/src/paraglide/messages/admin_ai_prompts_save.js +30 -0
- package/src/paraglide/messages/admin_ai_prompts_section_add.js +30 -0
- package/src/paraglide/messages/admin_ai_prompts_section_id.js +30 -0
- package/src/paraglide/messages/admin_ai_prompts_section_movedown1.js +30 -0
- package/src/paraglide/messages/admin_ai_prompts_section_moveup1.js +30 -0
- package/src/paraglide/messages/admin_ai_prompts_section_order.js +30 -0
- package/src/paraglide/messages/admin_ai_prompts_section_remove.js +30 -0
- package/src/paraglide/messages/admin_ai_prompts_section_template_placeholder.js +30 -0
- package/src/paraglide/messages/admin_ai_prompts_sections_empty.js +30 -0
- package/src/paraglide/messages/admin_ai_prompts_sections_hint.js +30 -0
- package/src/paraglide/messages/admin_ai_prompts_sections_title.js +30 -0
- package/src/paraglide/messages/admin_ai_prompts_toast_activated.js +30 -0
- package/src/paraglide/messages/admin_ai_prompts_toast_failed.js +30 -0
- package/src/paraglide/messages/admin_ai_prompts_toast_protected_locked.js +30 -0
- package/src/paraglide/messages/admin_ai_prompts_toast_rolled_back.js +30 -0
- package/src/paraglide/messages/admin_ai_prompts_toast_save_failed.js +30 -0
- package/src/paraglide/messages/admin_ai_prompts_toast_saved.js +30 -0
- package/src/paraglide/messages/admin_ai_prompts_variable_add.js +30 -0
- package/src/paraglide/messages/admin_ai_prompts_variable_declarehint1.js +30 -0
- package/src/paraglide/messages/admin_ai_prompts_variable_description_placeholder.js +30 -0
- package/src/paraglide/messages/admin_ai_prompts_variable_name_placeholder.js +30 -0
- package/src/paraglide/messages/admin_ai_prompts_variable_remove.js +30 -0
- package/src/paraglide/messages/admin_ai_prompts_variable_undeclared.js +30 -0
- package/src/paraglide/messages/admin_ai_prompts_variables_empty.js +30 -0
- package/src/paraglide/messages/admin_ai_prompts_variables_title.js +30 -0
- package/src/paraglide/messages/admin_ai_prompts_versions_current.js +30 -0
- package/src/paraglide/messages/admin_ai_prompts_versions_empty.js +30 -0
- package/src/paraglide/messages/admin_ai_prompts_versions_hint.js +30 -0
- package/src/paraglide/messages/admin_ai_prompts_versions_nonote1.js +30 -0
- package/src/paraglide/messages/admin_ai_prompts_versions_title.js +30 -0
- package/src/paraglide/messages/admin_ai_prompts_versions_unknowncreator1.js +30 -0
- package/src/paraglide/messages/admin_ai_table_seedfromseed2.js +30 -0
- package/src/paraglide/messages/admin_ai_table_toast_seedcreated1.js +30 -0
- package/src/paraglide/messages/admin_ai_table_toast_seedfailed1.js +30 -0
- package/src/paraglide/messages/admin_ai_table_toast_seednonew2.js +30 -0
- package/src/paraglide/messages/common_monitoring_aiusage_sandbox1.js +30 -0
- package/src/paraglide/messages/common_monitoring_aiusage_sandboxvalue2.js +30 -0
- package/src/paraglide/messages/common_nav_aiprompts1.js +30 -0
- package/src/routeTree.gen.ts +101 -0
- package/src/routes/__root.tsx +2 -2
- package/src/{components/ui/sonner.tsx → routes/_nav/ai-memory/route.lazy.tsx} +24 -16
- package/src/routes/_nav/ai-memory/route.tsx +31 -0
- package/src/routes/_nav/ai-prompts/$key/route.lazy.tsx +32 -0
- package/src/routes/_nav/ai-prompts/$key/route.tsx +37 -0
- package/src/routes/_nav/ai-prompts/index/route.lazy.tsx +47 -0
- package/src/routes/_nav/ai-prompts/route.lazy.tsx +26 -0
- package/src/routes/_nav/ai-prompts/route.tsx +31 -0
- package/src/routes/_nav/compliance/route.lazy.tsx +2 -4
- package/src/routes/_nav/components/route.lazy.tsx +1 -1
- package/src/routes/_nav/knowledge-public/bookmarks/route.lazy.tsx +1 -1
- package/src/routes/_nav/knowledge-public/compliance/route.lazy.tsx +1 -1
- package/src/routes/_nav/knowledge-public/legal/route.lazy.tsx +1 -1
- package/src/routes/_nav/licenses/$licenseId/route.lazy.tsx +1 -1
- package/src/routes/_nav/monitoring/ai-usage/route.lazy.tsx +10 -1
- package/src/routes/_nav/monitoring/errors/route.lazy.tsx +1 -1
- package/src/routes/_nav/monitoring/health/route.lazy.tsx +1 -1
- package/src/routes/_nav/monitoring/logs/route.lazy.tsx +1 -1
- package/src/routes/_nav/monitoring/metrics/route.lazy.tsx +1 -1
- package/src/routes/_nav/monitoring/sentry/route.lazy.tsx +1 -1
- package/src/routes/_nav/permissions/route.lazy.tsx +2 -2
- package/src/routes/_nav/sso/route.lazy.tsx +1 -1
- package/src/routes/_nav/users/$userId/route.lazy.tsx +3 -3
- package/src/routes/setup/route.lazy.tsx +1 -1
- package/src/server/__tests__/prompt-defaults.test.ts +139 -0
- package/src/server/admin-ai-usage.ts +22 -4
- package/src/server/ai-memory/store.ts +103 -0
- package/src/server/serverFns/ai-memory/clear.ts +31 -0
- package/src/server/serverFns/ai-memory/delete.ts +31 -0
- package/src/server/serverFns/ai-memory/list-users.ts +40 -0
- package/src/server/serverFns/ai-memory/list.ts +54 -0
- package/src/server/serverFns/ai-prompts/activate.ts +53 -0
- package/src/server/serverFns/ai-prompts/get.ts +74 -0
- package/src/server/serverFns/ai-prompts/list.ts +55 -0
- package/src/server/serverFns/ai-prompts/preview.ts +66 -0
- package/src/server/serverFns/ai-prompts/prompt-defaults.ts +63 -0
- package/src/server/serverFns/ai-prompts/prompt-schemas.ts +47 -0
- package/src/server/serverFns/ai-prompts/rollback.ts +86 -0
- package/src/server/serverFns/ai-prompts/save.ts +129 -0
- package/src/server/serverFns/ai-provider/seed-from-seed.ts +64 -0
- package/src/styles/globals.css +92 -77
- package/src/components/layout/sidebar-02/logo.tsx +0 -40
- package/src/components/layout/sidebar-02/team-switcher.tsx +0 -106
- package/src/components/providers/theme-toggle.tsx +0 -59
|
@@ -1,25 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
// Copyright (C) 2026 AllBlue Contributors
|
|
4
|
-
//
|
|
5
|
-
// This program is free software: you can redistribute it and/or modify
|
|
6
|
-
// it under the terms of the GNU Affero General Public License as published by
|
|
7
|
-
// the Free Software Foundation, either version 3 of the License, or
|
|
8
|
-
// (at your option) any later version.
|
|
9
|
-
//
|
|
10
|
-
// This program is distributed in the hope that it will be useful,
|
|
11
|
-
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
-
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
-
// GNU Affero General Public License for more details.
|
|
14
|
-
//
|
|
15
|
-
// You should have received a copy of the GNU Affero General Public License
|
|
16
|
-
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
17
|
-
|
|
18
|
-
import * as React from "react"
|
|
1
|
+
import { mergeProps } from "@base-ui/react/merge-props"
|
|
2
|
+
import { useRender } from "@base-ui/react/use-render"
|
|
19
3
|
import { cva, type VariantProps } from "class-variance-authority"
|
|
20
|
-
import {
|
|
21
|
-
|
|
22
|
-
import { cn } from "@/lib/utils"
|
|
4
|
+
import { cn } from "cn"
|
|
23
5
|
|
|
24
6
|
const badgeVariants = cva(
|
|
25
7
|
"group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",
|
|
@@ -47,20 +29,23 @@ const badgeVariants = cva(
|
|
|
47
29
|
function Badge({
|
|
48
30
|
className,
|
|
49
31
|
variant = "default",
|
|
50
|
-
|
|
32
|
+
render,
|
|
51
33
|
...props
|
|
52
|
-
}:
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
34
|
+
}: useRender.ComponentProps<"span"> & VariantProps<typeof badgeVariants>) {
|
|
35
|
+
return useRender({
|
|
36
|
+
defaultTagName: "span",
|
|
37
|
+
props: mergeProps<"span">(
|
|
38
|
+
{
|
|
39
|
+
className: cn(badgeVariants({ variant }), className),
|
|
40
|
+
},
|
|
41
|
+
props
|
|
42
|
+
),
|
|
43
|
+
render,
|
|
44
|
+
state: {
|
|
45
|
+
slot: "badge",
|
|
46
|
+
variant,
|
|
47
|
+
},
|
|
48
|
+
})
|
|
64
49
|
}
|
|
65
50
|
|
|
66
51
|
export { Badge, badgeVariants }
|
|
@@ -1,34 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
// AllBlue - 理想之海
|
|
3
|
-
// Copyright (C) 2026 AllBlue Contributors
|
|
4
|
-
//
|
|
5
|
-
// This program is free software: you can redistribute it and/or modify
|
|
6
|
-
// it under the terms of the GNU Affero General Public License as published by
|
|
7
|
-
// the Free Software Foundation, either version 3 of the License, or
|
|
8
|
-
// (at your option) any later version.
|
|
9
|
-
//
|
|
10
|
-
// This program is distributed in the hope that it will be useful,
|
|
11
|
-
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
-
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
-
// GNU Affero General Public License for more details.
|
|
14
|
-
//
|
|
15
|
-
// You should have received a copy of the GNU Affero General Public License
|
|
16
|
-
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
17
|
-
|
|
18
|
-
import * as React from "react"
|
|
1
|
+
import { Button as ButtonPrimitive } from "@base-ui/react/button"
|
|
19
2
|
import { cva, type VariantProps } from "class-variance-authority"
|
|
20
|
-
import {
|
|
21
|
-
|
|
22
|
-
import { cn } from "@/lib/utils"
|
|
3
|
+
import { cn } from "cn"
|
|
23
4
|
|
|
24
5
|
const buttonVariants = cva(
|
|
25
|
-
"group/button inline-flex shrink-0 items-center justify-center rounded-
|
|
6
|
+
"group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
26
7
|
{
|
|
27
8
|
variants: {
|
|
28
9
|
variant: {
|
|
29
10
|
default: "bg-primary text-primary-foreground hover:bg-primary/80",
|
|
30
11
|
outline:
|
|
31
|
-
"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
|
|
12
|
+
"border-border bg-background shadow-xs hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
|
|
32
13
|
secondary:
|
|
33
14
|
"bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
|
|
34
15
|
ghost:
|
|
@@ -39,16 +20,16 @@ const buttonVariants = cva(
|
|
|
39
20
|
},
|
|
40
21
|
size: {
|
|
41
22
|
default:
|
|
42
|
-
"h-
|
|
43
|
-
xs: "h-6 gap-1 rounded-[min(var(--radius-md),
|
|
44
|
-
sm: "h-
|
|
45
|
-
lg: "h-
|
|
46
|
-
icon: "size-
|
|
23
|
+
"h-9 gap-1.5 px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
24
|
+
xs: "h-6 gap-1 rounded-[min(var(--radius-md),8px)] px-2 text-xs in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
|
|
25
|
+
sm: "h-8 gap-1 rounded-[min(var(--radius-md),10px)] px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5",
|
|
26
|
+
lg: "h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
27
|
+
icon: "size-9",
|
|
47
28
|
"icon-xs":
|
|
48
|
-
"size-6 rounded-[min(var(--radius-md),
|
|
29
|
+
"size-6 rounded-[min(var(--radius-md),8px)] in-data-[slot=button-group]:rounded-md [&_svg:not([class*='size-'])]:size-3",
|
|
49
30
|
"icon-sm":
|
|
50
|
-
"size-
|
|
51
|
-
"icon-lg": "size-
|
|
31
|
+
"size-8 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-md",
|
|
32
|
+
"icon-lg": "size-10",
|
|
52
33
|
},
|
|
53
34
|
},
|
|
54
35
|
defaultVariants: {
|
|
@@ -62,19 +43,11 @@ function Button({
|
|
|
62
43
|
className,
|
|
63
44
|
variant = "default",
|
|
64
45
|
size = "default",
|
|
65
|
-
asChild = false,
|
|
66
46
|
...props
|
|
67
|
-
}:
|
|
68
|
-
VariantProps<typeof buttonVariants> & {
|
|
69
|
-
asChild?: boolean
|
|
70
|
-
}) {
|
|
71
|
-
const Comp = asChild ? Slot.Root : "button"
|
|
72
|
-
|
|
47
|
+
}: ButtonPrimitive.Props & VariantProps<typeof buttonVariants>) {
|
|
73
48
|
return (
|
|
74
|
-
<
|
|
49
|
+
<ButtonPrimitive
|
|
75
50
|
data-slot="button"
|
|
76
|
-
data-variant={variant}
|
|
77
|
-
data-size={size}
|
|
78
51
|
className={cn(buttonVariants({ variant, size, className }))}
|
|
79
52
|
{...props}
|
|
80
53
|
/>
|
|
@@ -1,23 +1,5 @@
|
|
|
1
|
-
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
2
|
-
// AllBlue - 理想之海
|
|
3
|
-
// Copyright (C) 2026 AllBlue Contributors
|
|
4
|
-
//
|
|
5
|
-
// This program is free software: you can redistribute it and/or modify
|
|
6
|
-
// it under the terms of the GNU Affero General Public License as published by
|
|
7
|
-
// the Free Software Foundation, either version 3 of the License, or
|
|
8
|
-
// (at your option) any later version.
|
|
9
|
-
//
|
|
10
|
-
// This program is distributed in the hope that it will be useful,
|
|
11
|
-
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
-
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
-
// GNU Affero General Public License for more details.
|
|
14
|
-
//
|
|
15
|
-
// You should have received a copy of the GNU Affero General Public License
|
|
16
|
-
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
17
|
-
|
|
18
1
|
import * as React from "react"
|
|
19
|
-
|
|
20
|
-
import { cn } from "@/lib/utils"
|
|
2
|
+
import { cn } from "cn"
|
|
21
3
|
|
|
22
4
|
function Card({
|
|
23
5
|
className,
|
|
@@ -29,7 +11,7 @@ function Card({
|
|
|
29
11
|
data-slot="card"
|
|
30
12
|
data-size={size}
|
|
31
13
|
className={cn(
|
|
32
|
-
"group/card flex flex-col gap-
|
|
14
|
+
"group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground shadow-xs ring-1 ring-foreground/10 [--card-spacing:--spacing(6)] has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(4)] *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",
|
|
33
15
|
className
|
|
34
16
|
)}
|
|
35
17
|
{...props}
|
|
@@ -42,7 +24,7 @@ function CardHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
42
24
|
<div
|
|
43
25
|
data-slot="card-header"
|
|
44
26
|
className={cn(
|
|
45
|
-
"group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-
|
|
27
|
+
"group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)",
|
|
46
28
|
className
|
|
47
29
|
)}
|
|
48
30
|
{...props}
|
|
@@ -55,7 +37,7 @@ function CardTitle({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
55
37
|
<div
|
|
56
38
|
data-slot="card-title"
|
|
57
39
|
className={cn(
|
|
58
|
-
"text-base leading-
|
|
40
|
+
"font-heading text-base leading-normal font-medium group-data-[size=sm]/card:text-sm",
|
|
59
41
|
className
|
|
60
42
|
)}
|
|
61
43
|
{...props}
|
|
@@ -90,7 +72,7 @@ function CardContent({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
90
72
|
return (
|
|
91
73
|
<div
|
|
92
74
|
data-slot="card-content"
|
|
93
|
-
className={cn("
|
|
75
|
+
className={cn("flex flex-col gap-3 px-(--card-spacing)", className)}
|
|
94
76
|
{...props}
|
|
95
77
|
/>
|
|
96
78
|
)
|
|
@@ -101,7 +83,7 @@ function CardFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
101
83
|
<div
|
|
102
84
|
data-slot="card-footer"
|
|
103
85
|
className={cn(
|
|
104
|
-
"flex items-center rounded-b-xl
|
|
86
|
+
"flex items-center rounded-b-xl px-(--card-spacing) [.border-t]:pt-(--card-spacing)",
|
|
105
87
|
className
|
|
106
88
|
)}
|
|
107
89
|
{...props}
|
|
@@ -1,37 +1,15 @@
|
|
|
1
|
-
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
2
|
-
// AllBlue - 理想之海
|
|
3
|
-
// Copyright (C) 2026 AllBlue Contributors
|
|
4
|
-
//
|
|
5
|
-
// This program is free software: you can redistribute it and/or modify
|
|
6
|
-
// it under the terms of the GNU Affero General Public License as published by
|
|
7
|
-
// the Free Software Foundation, either version 3 of the License, or
|
|
8
|
-
// (at your option) any later version.
|
|
9
|
-
//
|
|
10
|
-
// This program is distributed in the hope that it will be useful,
|
|
11
|
-
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
-
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
-
// GNU Affero General Public License for more details.
|
|
14
|
-
//
|
|
15
|
-
// You should have received a copy of the GNU Affero General Public License
|
|
16
|
-
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
17
|
-
|
|
18
1
|
"use client"
|
|
19
2
|
|
|
20
|
-
import
|
|
21
|
-
import {
|
|
22
|
-
|
|
23
|
-
import { cn } from "@/lib/utils"
|
|
3
|
+
import { Checkbox as CheckboxPrimitive } from "@base-ui/react/checkbox"
|
|
4
|
+
import { cn } from "cn"
|
|
24
5
|
import { CheckIcon } from "lucide-react"
|
|
25
6
|
|
|
26
|
-
function Checkbox({
|
|
27
|
-
className,
|
|
28
|
-
...props
|
|
29
|
-
}: React.ComponentProps<typeof CheckboxPrimitive.Root>) {
|
|
7
|
+
function Checkbox({ className, ...props }: CheckboxPrimitive.Root.Props) {
|
|
30
8
|
return (
|
|
31
9
|
<CheckboxPrimitive.Root
|
|
32
10
|
data-slot="checkbox"
|
|
33
11
|
className={cn(
|
|
34
|
-
"peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input transition-
|
|
12
|
+
"peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input shadow-xs transition-shadow outline-none group-has-disabled/field:opacity-50 group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:not-data-checked:border-input after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground group-has-[:focus-visible]/field-label:data-checked:border-primary dark:data-checked:bg-primary",
|
|
35
13
|
className
|
|
36
14
|
)}
|
|
37
15
|
{...props}
|
|
@@ -1,49 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
// AllBlue - 理想之海
|
|
3
|
-
// Copyright (C) 2026 AllBlue Contributors
|
|
4
|
-
//
|
|
5
|
-
// This program is free software: you can redistribute it and/or modify
|
|
6
|
-
// it under the terms of the GNU Affero General Public License as published by
|
|
7
|
-
// the Free Software Foundation, either version 3 of the License, or
|
|
8
|
-
// (at your option) any later version.
|
|
9
|
-
//
|
|
10
|
-
// This program is distributed in the hope that it will be useful,
|
|
11
|
-
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
-
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
-
// GNU Affero General Public License for more details.
|
|
14
|
-
//
|
|
15
|
-
// You should have received a copy of the GNU Affero General Public License
|
|
16
|
-
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
1
|
+
import { Collapsible as CollapsiblePrimitive } from "@base-ui/react/collapsible"
|
|
17
2
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
import { Collapsible as CollapsiblePrimitive } from "radix-ui"
|
|
21
|
-
|
|
22
|
-
function Collapsible({
|
|
23
|
-
...props
|
|
24
|
-
}: React.ComponentProps<typeof CollapsiblePrimitive.Root>) {
|
|
3
|
+
function Collapsible({ ...props }: CollapsiblePrimitive.Root.Props) {
|
|
25
4
|
return <CollapsiblePrimitive.Root data-slot="collapsible" {...props} />
|
|
26
5
|
}
|
|
27
6
|
|
|
28
|
-
function CollapsibleTrigger({
|
|
29
|
-
...props
|
|
30
|
-
}: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>) {
|
|
7
|
+
function CollapsibleTrigger({ ...props }: CollapsiblePrimitive.Trigger.Props) {
|
|
31
8
|
return (
|
|
32
|
-
<CollapsiblePrimitive.
|
|
33
|
-
data-slot="collapsible-trigger"
|
|
34
|
-
{...props}
|
|
35
|
-
/>
|
|
9
|
+
<CollapsiblePrimitive.Trigger data-slot="collapsible-trigger" {...props} />
|
|
36
10
|
)
|
|
37
11
|
}
|
|
38
12
|
|
|
39
|
-
function CollapsibleContent({
|
|
40
|
-
...props
|
|
41
|
-
}: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>) {
|
|
13
|
+
function CollapsibleContent({ ...props }: CollapsiblePrimitive.Panel.Props) {
|
|
42
14
|
return (
|
|
43
|
-
<CollapsiblePrimitive.
|
|
44
|
-
data-slot="collapsible-content"
|
|
45
|
-
{...props}
|
|
46
|
-
/>
|
|
15
|
+
<CollapsiblePrimitive.Panel data-slot="collapsible-content" {...props} />
|
|
47
16
|
)
|
|
48
17
|
}
|
|
49
18
|
|
|
@@ -1,59 +1,32 @@
|
|
|
1
|
-
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
2
|
-
// AllBlue - 理想之海
|
|
3
|
-
// Copyright (C) 2026 AllBlue Contributors
|
|
4
|
-
//
|
|
5
|
-
// This program is free software: you can redistribute it and/or modify
|
|
6
|
-
// it under the terms of the GNU Affero General Public License as published by
|
|
7
|
-
// the Free Software Foundation, either version 3 of the License, or
|
|
8
|
-
// (at your option) any later version.
|
|
9
|
-
//
|
|
10
|
-
// This program is distributed in the hope that it will be useful,
|
|
11
|
-
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
-
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
-
// GNU Affero General Public License for more details.
|
|
14
|
-
//
|
|
15
|
-
// You should have received a copy of the GNU Affero General Public License
|
|
16
|
-
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
17
|
-
|
|
18
|
-
"use client"
|
|
19
|
-
|
|
20
1
|
import * as React from "react"
|
|
21
|
-
import { Dialog as DialogPrimitive } from "
|
|
2
|
+
import { Dialog as DialogPrimitive } from "@base-ui/react/dialog"
|
|
3
|
+
import { cn } from "cn"
|
|
22
4
|
|
|
23
|
-
import { cn } from "@/lib/utils"
|
|
24
5
|
import { Button } from "@/components/ui/button"
|
|
25
6
|
import { XIcon } from "lucide-react"
|
|
26
7
|
|
|
27
|
-
function Dialog({
|
|
28
|
-
...props
|
|
29
|
-
}: React.ComponentProps<typeof DialogPrimitive.Root>) {
|
|
8
|
+
function Dialog({ ...props }: DialogPrimitive.Root.Props) {
|
|
30
9
|
return <DialogPrimitive.Root data-slot="dialog" {...props} />
|
|
31
10
|
}
|
|
32
11
|
|
|
33
|
-
function DialogTrigger({
|
|
34
|
-
...props
|
|
35
|
-
}: React.ComponentProps<typeof DialogPrimitive.Trigger>) {
|
|
12
|
+
function DialogTrigger({ ...props }: DialogPrimitive.Trigger.Props) {
|
|
36
13
|
return <DialogPrimitive.Trigger data-slot="dialog-trigger" {...props} />
|
|
37
14
|
}
|
|
38
15
|
|
|
39
|
-
function DialogPortal({
|
|
40
|
-
...props
|
|
41
|
-
}: React.ComponentProps<typeof DialogPrimitive.Portal>) {
|
|
16
|
+
function DialogPortal({ ...props }: DialogPrimitive.Portal.Props) {
|
|
42
17
|
return <DialogPrimitive.Portal data-slot="dialog-portal" {...props} />
|
|
43
18
|
}
|
|
44
19
|
|
|
45
|
-
function DialogClose({
|
|
46
|
-
...props
|
|
47
|
-
}: React.ComponentProps<typeof DialogPrimitive.Close>) {
|
|
20
|
+
function DialogClose({ ...props }: DialogPrimitive.Close.Props) {
|
|
48
21
|
return <DialogPrimitive.Close data-slot="dialog-close" {...props} />
|
|
49
22
|
}
|
|
50
23
|
|
|
51
24
|
function DialogOverlay({
|
|
52
25
|
className,
|
|
53
26
|
...props
|
|
54
|
-
}:
|
|
27
|
+
}: DialogPrimitive.Backdrop.Props) {
|
|
55
28
|
return (
|
|
56
|
-
<DialogPrimitive.
|
|
29
|
+
<DialogPrimitive.Backdrop
|
|
57
30
|
data-slot="dialog-overlay"
|
|
58
31
|
className={cn(
|
|
59
32
|
"fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",
|
|
@@ -69,35 +42,38 @@ function DialogContent({
|
|
|
69
42
|
children,
|
|
70
43
|
showCloseButton = true,
|
|
71
44
|
...props
|
|
72
|
-
}:
|
|
45
|
+
}: DialogPrimitive.Popup.Props & {
|
|
73
46
|
showCloseButton?: boolean
|
|
74
47
|
}) {
|
|
75
48
|
return (
|
|
76
49
|
<DialogPortal>
|
|
77
50
|
<DialogOverlay />
|
|
78
|
-
<DialogPrimitive.
|
|
51
|
+
<DialogPrimitive.Popup
|
|
79
52
|
data-slot="dialog-content"
|
|
80
53
|
className={cn(
|
|
81
|
-
"fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-
|
|
54
|
+
"fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-6 rounded-xl bg-popover p-6 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-md data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
82
55
|
className
|
|
83
56
|
)}
|
|
84
57
|
{...props}
|
|
85
58
|
>
|
|
86
59
|
{children}
|
|
87
60
|
{showCloseButton && (
|
|
88
|
-
<DialogPrimitive.Close
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
61
|
+
<DialogPrimitive.Close
|
|
62
|
+
data-slot="dialog-close"
|
|
63
|
+
render={
|
|
64
|
+
<Button
|
|
65
|
+
variant="ghost"
|
|
66
|
+
className="absolute top-4 right-4"
|
|
67
|
+
size="icon-sm"
|
|
95
68
|
/>
|
|
96
|
-
|
|
97
|
-
|
|
69
|
+
}
|
|
70
|
+
>
|
|
71
|
+
<XIcon
|
|
72
|
+
/>
|
|
73
|
+
<span className="sr-only">Close</span>
|
|
98
74
|
</DialogPrimitive.Close>
|
|
99
75
|
)}
|
|
100
|
-
</DialogPrimitive.
|
|
76
|
+
</DialogPrimitive.Popup>
|
|
101
77
|
</DialogPortal>
|
|
102
78
|
)
|
|
103
79
|
}
|
|
@@ -124,32 +100,26 @@ function DialogFooter({
|
|
|
124
100
|
<div
|
|
125
101
|
data-slot="dialog-footer"
|
|
126
102
|
className={cn(
|
|
127
|
-
"
|
|
103
|
+
"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
|
|
128
104
|
className
|
|
129
105
|
)}
|
|
130
106
|
{...props}
|
|
131
107
|
>
|
|
132
108
|
{children}
|
|
133
109
|
{showCloseButton && (
|
|
134
|
-
<DialogPrimitive.Close
|
|
135
|
-
|
|
110
|
+
<DialogPrimitive.Close render={<Button variant="outline" />}>
|
|
111
|
+
Close
|
|
136
112
|
</DialogPrimitive.Close>
|
|
137
113
|
)}
|
|
138
114
|
</div>
|
|
139
115
|
)
|
|
140
116
|
}
|
|
141
117
|
|
|
142
|
-
function DialogTitle({
|
|
143
|
-
className,
|
|
144
|
-
...props
|
|
145
|
-
}: React.ComponentProps<typeof DialogPrimitive.Title>) {
|
|
118
|
+
function DialogTitle({ className, ...props }: DialogPrimitive.Title.Props) {
|
|
146
119
|
return (
|
|
147
120
|
<DialogPrimitive.Title
|
|
148
121
|
data-slot="dialog-title"
|
|
149
|
-
className={cn(
|
|
150
|
-
"text-base leading-none font-medium",
|
|
151
|
-
className
|
|
152
|
-
)}
|
|
122
|
+
className={cn("font-heading leading-none font-medium", className)}
|
|
153
123
|
{...props}
|
|
154
124
|
/>
|
|
155
125
|
)
|
|
@@ -158,7 +128,7 @@ function DialogTitle({
|
|
|
158
128
|
function DialogDescription({
|
|
159
129
|
className,
|
|
160
130
|
...props
|
|
161
|
-
}:
|
|
131
|
+
}: DialogPrimitive.Description.Props) {
|
|
162
132
|
return (
|
|
163
133
|
<DialogPrimitive.Description
|
|
164
134
|
data-slot="dialog-description"
|