@allbluecn/admin-app 0.2.6 → 0.3.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.
Files changed (205) hide show
  1. package/package.json +16 -12
  2. package/src/components/admin/admin-user-menu.tsx +2 -4
  3. package/src/components/admin/developer-log.tsx +3 -5
  4. package/src/components/ai-memory/memory-facts-panel.tsx +383 -0
  5. package/src/components/ai-prompts/preview-panel.tsx +165 -0
  6. package/src/components/ai-prompts/prompt-editor.tsx +328 -0
  7. package/src/components/ai-prompts/prompt-table.tsx +141 -0
  8. package/src/components/ai-prompts/prompt-utils.ts +124 -0
  9. package/src/components/ai-prompts/section-editor.tsx +135 -0
  10. package/src/components/ai-prompts/variable-panel.tsx +128 -0
  11. package/src/components/ai-prompts/version-history.tsx +157 -0
  12. package/src/components/ai-provider/provider-form.tsx +6 -10
  13. package/src/components/ai-provider/provider-table.tsx +33 -13
  14. package/src/components/auth/admin-login-form.tsx +1 -1
  15. package/src/components/component/component-form-dialog.tsx +4 -4
  16. package/src/components/component/component-import-dialog.tsx +2 -2
  17. package/src/components/dependency/changelog-dialog.tsx +2 -4
  18. package/src/components/dependency/columns.tsx +4 -8
  19. package/src/components/dependency/dependency-table.tsx +2 -2
  20. package/src/components/dependency/edit-dialog.tsx +7 -11
  21. package/src/components/invitations/invitations-page.tsx +4 -8
  22. package/src/components/knowledge-public/bookmark-form-dialog.tsx +1 -1
  23. package/src/components/knowledge-public/compliance-form-dialog.tsx +1 -1
  24. package/src/components/knowledge-public/legal-form-dialog.tsx +2 -2
  25. package/src/components/layout/sidebar-02/app-sidebar.tsx +17 -9
  26. package/src/components/layout/sidebar-02/nav-main.tsx +6 -14
  27. package/src/components/layout/sidebar-02/nav-notifications.tsx +3 -7
  28. package/src/components/magicui/rainbow-button.tsx +2 -2
  29. package/src/components/market/columns.tsx +2 -4
  30. package/src/components/market/market-app-form.tsx +2 -2
  31. package/src/components/market/market-app-list.tsx +1 -1
  32. package/src/components/oauth-providers/provider-page.tsx +1 -1
  33. package/src/components/ui/alert-dialog.tsx +28 -57
  34. package/src/components/ui/alert.tsx +3 -4
  35. package/src/components/ui/avatar.tsx +5 -28
  36. package/src/components/ui/badge.tsx +19 -34
  37. package/src/components/ui/button.tsx +14 -41
  38. package/src/components/ui/card.tsx +6 -24
  39. package/src/components/ui/checkbox.tsx +4 -26
  40. package/src/components/ui/collapsible.tsx +6 -37
  41. package/src/components/ui/dialog.tsx +30 -60
  42. package/src/components/ui/dropdown-menu.tsx +118 -137
  43. package/src/components/ui/field.tsx +8 -27
  44. package/src/components/ui/input-group.tsx +13 -26
  45. package/src/components/ui/input.tsx +4 -21
  46. package/src/components/ui/label.tsx +3 -27
  47. package/src/components/ui/pagination.tsx +17 -31
  48. package/src/components/ui/select.tsx +101 -76
  49. package/src/components/ui/separator.tsx +4 -27
  50. package/src/components/ui/sheet.tsx +29 -58
  51. package/src/components/ui/sidebar.tsx +119 -117
  52. package/src/components/ui/skeleton.tsx +1 -18
  53. package/src/components/ui/switch.tsx +5 -24
  54. package/src/components/ui/table.tsx +1 -19
  55. package/src/components/ui/textarea.tsx +2 -20
  56. package/src/components/ui/toast.tsx +282 -0
  57. package/src/components/ui/tooltip.tsx +34 -45
  58. package/src/components/user/settings-activity-log.tsx +1 -1
  59. package/src/components/user/user-create-dialog.tsx +2 -2
  60. package/src/components/user/user-filters.tsx +2 -2
  61. package/src/hooks/use-mobile.ts +0 -17
  62. package/src/lib/pacer.ts +21 -0
  63. package/src/lib/utils.ts +1 -23
  64. package/src/paraglide/README.md +1 -1
  65. package/src/paraglide/messages/_index.js +95 -0
  66. package/src/paraglide/messages/admin_ai_memory_action_clearuser1.js +30 -0
  67. package/src/paraglide/messages/admin_ai_memory_action_query.js +30 -0
  68. package/src/paraglide/messages/admin_ai_memory_clear_cancel.js +30 -0
  69. package/src/paraglide/messages/admin_ai_memory_clear_confirm_action.js +30 -0
  70. package/src/paraglide/messages/admin_ai_memory_clear_confirm_description.js +30 -0
  71. package/src/paraglide/messages/admin_ai_memory_clear_confirm_title.js +30 -0
  72. package/src/paraglide/messages/admin_ai_memory_columns_actions.js +30 -0
  73. package/src/paraglide/messages/admin_ai_memory_columns_content.js +30 -0
  74. package/src/paraglide/messages/admin_ai_memory_columns_createdat1.js +30 -0
  75. package/src/paraglide/messages/admin_ai_memory_columns_threadid1.js +30 -0
  76. package/src/paraglide/messages/admin_ai_memory_delete_cancel.js +30 -0
  77. package/src/paraglide/messages/admin_ai_memory_delete_confirm_action.js +30 -0
  78. package/src/paraglide/messages/admin_ai_memory_delete_confirm_description.js +30 -0
  79. package/src/paraglide/messages/admin_ai_memory_delete_confirm_title.js +30 -0
  80. package/src/paraglide/messages/admin_ai_memory_empty.js +30 -0
  81. package/src/paraglide/messages/admin_ai_memory_emptyhint1.js +30 -0
  82. package/src/paraglide/messages/admin_ai_memory_error_nouserid2.js +30 -0
  83. package/src/paraglide/messages/admin_ai_memory_error_query.js +30 -0
  84. package/src/paraglide/messages/admin_ai_memory_error_title.js +30 -0
  85. package/src/paraglide/messages/admin_ai_memory_form_user.js +30 -0
  86. package/src/paraglide/messages/admin_ai_memory_page_description.js +30 -0
  87. package/src/paraglide/messages/admin_ai_memory_page_title.js +30 -0
  88. package/src/paraglide/messages/admin_ai_memory_placeholder_user.js +30 -0
  89. package/src/paraglide/messages/admin_ai_memory_stat_count.js +30 -0
  90. package/src/paraglide/messages/admin_ai_memory_stat_lastwrite1.js +30 -0
  91. package/src/paraglide/messages/admin_ai_memory_toast_cleared.js +30 -0
  92. package/src/paraglide/messages/admin_ai_memory_toast_deleted.js +30 -0
  93. package/src/paraglide/messages/admin_ai_prompts_active.js +30 -0
  94. package/src/paraglide/messages/admin_ai_prompts_back.js +30 -0
  95. package/src/paraglide/messages/admin_ai_prompts_badge_protected.js +30 -0
  96. package/src/paraglide/messages/admin_ai_prompts_cache_hint.js +30 -0
  97. package/src/paraglide/messages/admin_ai_prompts_columns_active.js +30 -0
  98. package/src/paraglide/messages/admin_ai_prompts_columns_key.js +30 -0
  99. package/src/paraglide/messages/admin_ai_prompts_columns_name.js +30 -0
  100. package/src/paraglide/messages/admin_ai_prompts_columns_protected.js +30 -0
  101. package/src/paraglide/messages/admin_ai_prompts_columns_updatedat1.js +30 -0
  102. package/src/paraglide/messages/admin_ai_prompts_columns_version.js +30 -0
  103. package/src/paraglide/messages/admin_ai_prompts_description.js +30 -0
  104. package/src/paraglide/messages/admin_ai_prompts_description_placeholder.js +30 -0
  105. package/src/paraglide/messages/admin_ai_prompts_edit.js +30 -0
  106. package/src/paraglide/messages/admin_ai_prompts_name.js +30 -0
  107. package/src/paraglide/messages/admin_ai_prompts_name_placeholder.js +30 -0
  108. package/src/paraglide/messages/admin_ai_prompts_note_placeholder.js +30 -0
  109. package/src/paraglide/messages/admin_ai_prompts_page_description.js +30 -0
  110. package/src/paraglide/messages/admin_ai_prompts_page_title.js +30 -0
  111. package/src/paraglide/messages/admin_ai_prompts_preview_empty.js +30 -0
  112. package/src/paraglide/messages/admin_ai_prompts_preview_generating.js +30 -0
  113. package/src/paraglide/messages/admin_ai_prompts_preview_hint.js +30 -0
  114. package/src/paraglide/messages/admin_ai_prompts_preview_nocontent1.js +30 -0
  115. package/src/paraglide/messages/admin_ai_prompts_preview_placeholder.js +30 -0
  116. package/src/paraglide/messages/admin_ai_prompts_preview_section.js +30 -0
  117. package/src/paraglide/messages/admin_ai_prompts_preview_title.js +30 -0
  118. package/src/paraglide/messages/admin_ai_prompts_protected_hint.js +30 -0
  119. package/src/paraglide/messages/admin_ai_prompts_rollback.js +30 -0
  120. package/src/paraglide/messages/admin_ai_prompts_rollback_confirm_action.js +30 -0
  121. package/src/paraglide/messages/admin_ai_prompts_rollback_confirm_description.js +30 -0
  122. package/src/paraglide/messages/admin_ai_prompts_rollback_confirm_title.js +30 -0
  123. package/src/paraglide/messages/admin_ai_prompts_save.js +30 -0
  124. package/src/paraglide/messages/admin_ai_prompts_section_add.js +30 -0
  125. package/src/paraglide/messages/admin_ai_prompts_section_id.js +30 -0
  126. package/src/paraglide/messages/admin_ai_prompts_section_movedown1.js +30 -0
  127. package/src/paraglide/messages/admin_ai_prompts_section_moveup1.js +30 -0
  128. package/src/paraglide/messages/admin_ai_prompts_section_order.js +30 -0
  129. package/src/paraglide/messages/admin_ai_prompts_section_remove.js +30 -0
  130. package/src/paraglide/messages/admin_ai_prompts_section_template_placeholder.js +30 -0
  131. package/src/paraglide/messages/admin_ai_prompts_sections_empty.js +30 -0
  132. package/src/paraglide/messages/admin_ai_prompts_sections_hint.js +30 -0
  133. package/src/paraglide/messages/admin_ai_prompts_sections_title.js +30 -0
  134. package/src/paraglide/messages/admin_ai_prompts_toast_activated.js +30 -0
  135. package/src/paraglide/messages/admin_ai_prompts_toast_failed.js +30 -0
  136. package/src/paraglide/messages/admin_ai_prompts_toast_protected_locked.js +30 -0
  137. package/src/paraglide/messages/admin_ai_prompts_toast_rolled_back.js +30 -0
  138. package/src/paraglide/messages/admin_ai_prompts_toast_save_failed.js +30 -0
  139. package/src/paraglide/messages/admin_ai_prompts_toast_saved.js +30 -0
  140. package/src/paraglide/messages/admin_ai_prompts_variable_add.js +30 -0
  141. package/src/paraglide/messages/admin_ai_prompts_variable_declarehint1.js +30 -0
  142. package/src/paraglide/messages/admin_ai_prompts_variable_description_placeholder.js +30 -0
  143. package/src/paraglide/messages/admin_ai_prompts_variable_name_placeholder.js +30 -0
  144. package/src/paraglide/messages/admin_ai_prompts_variable_remove.js +30 -0
  145. package/src/paraglide/messages/admin_ai_prompts_variable_undeclared.js +30 -0
  146. package/src/paraglide/messages/admin_ai_prompts_variables_empty.js +30 -0
  147. package/src/paraglide/messages/admin_ai_prompts_variables_title.js +30 -0
  148. package/src/paraglide/messages/admin_ai_prompts_versions_current.js +30 -0
  149. package/src/paraglide/messages/admin_ai_prompts_versions_empty.js +30 -0
  150. package/src/paraglide/messages/admin_ai_prompts_versions_hint.js +30 -0
  151. package/src/paraglide/messages/admin_ai_prompts_versions_nonote1.js +30 -0
  152. package/src/paraglide/messages/admin_ai_prompts_versions_title.js +30 -0
  153. package/src/paraglide/messages/admin_ai_prompts_versions_unknowncreator1.js +30 -0
  154. package/src/paraglide/messages/admin_ai_table_seedfromseed2.js +30 -0
  155. package/src/paraglide/messages/admin_ai_table_toast_seedcreated1.js +30 -0
  156. package/src/paraglide/messages/admin_ai_table_toast_seedfailed1.js +30 -0
  157. package/src/paraglide/messages/admin_ai_table_toast_seednonew2.js +30 -0
  158. package/src/paraglide/messages/common_monitoring_aiusage_sandbox1.js +30 -0
  159. package/src/paraglide/messages/common_monitoring_aiusage_sandboxvalue2.js +30 -0
  160. package/src/paraglide/messages/common_nav_aiprompts1.js +30 -0
  161. package/src/routeTree.gen.ts +101 -0
  162. package/src/routes/__root.tsx +2 -2
  163. package/src/{components/ui/sonner.tsx → routes/_nav/ai-memory/route.lazy.tsx} +24 -16
  164. package/src/routes/_nav/ai-memory/route.tsx +31 -0
  165. package/src/routes/_nav/ai-prompts/$key/route.lazy.tsx +32 -0
  166. package/src/routes/_nav/ai-prompts/$key/route.tsx +37 -0
  167. package/src/routes/_nav/ai-prompts/index/route.lazy.tsx +47 -0
  168. package/src/routes/_nav/ai-prompts/route.lazy.tsx +26 -0
  169. package/src/routes/_nav/ai-prompts/route.tsx +31 -0
  170. package/src/routes/_nav/compliance/route.lazy.tsx +2 -4
  171. package/src/routes/_nav/components/route.lazy.tsx +1 -1
  172. package/src/routes/_nav/knowledge-public/bookmarks/route.lazy.tsx +1 -1
  173. package/src/routes/_nav/knowledge-public/compliance/route.lazy.tsx +1 -1
  174. package/src/routes/_nav/knowledge-public/legal/route.lazy.tsx +1 -1
  175. package/src/routes/_nav/licenses/$licenseId/route.lazy.tsx +1 -1
  176. package/src/routes/_nav/monitoring/ai-usage/route.lazy.tsx +10 -1
  177. package/src/routes/_nav/monitoring/errors/route.lazy.tsx +1 -1
  178. package/src/routes/_nav/monitoring/health/route.lazy.tsx +1 -1
  179. package/src/routes/_nav/monitoring/logs/route.lazy.tsx +1 -1
  180. package/src/routes/_nav/monitoring/metrics/route.lazy.tsx +1 -1
  181. package/src/routes/_nav/monitoring/sentry/route.lazy.tsx +1 -1
  182. package/src/routes/_nav/permissions/route.lazy.tsx +2 -2
  183. package/src/routes/_nav/sso/route.lazy.tsx +1 -1
  184. package/src/routes/_nav/users/$userId/route.lazy.tsx +3 -3
  185. package/src/routes/setup/route.lazy.tsx +1 -1
  186. package/src/server/__tests__/prompt-defaults.test.ts +139 -0
  187. package/src/server/admin-ai-usage.ts +22 -4
  188. package/src/server/ai-memory/store.ts +103 -0
  189. package/src/server/serverFns/ai-memory/clear.ts +31 -0
  190. package/src/server/serverFns/ai-memory/delete.ts +31 -0
  191. package/src/server/serverFns/ai-memory/list-users.ts +40 -0
  192. package/src/server/serverFns/ai-memory/list.ts +54 -0
  193. package/src/server/serverFns/ai-prompts/activate.ts +53 -0
  194. package/src/server/serverFns/ai-prompts/get.ts +74 -0
  195. package/src/server/serverFns/ai-prompts/list.ts +55 -0
  196. package/src/server/serverFns/ai-prompts/preview.ts +66 -0
  197. package/src/server/serverFns/ai-prompts/prompt-defaults.ts +63 -0
  198. package/src/server/serverFns/ai-prompts/prompt-schemas.ts +47 -0
  199. package/src/server/serverFns/ai-prompts/rollback.ts +86 -0
  200. package/src/server/serverFns/ai-prompts/save.ts +129 -0
  201. package/src/server/serverFns/ai-provider/seed-from-seed.ts +64 -0
  202. package/src/styles/globals.css +92 -77
  203. package/src/components/layout/sidebar-02/logo.tsx +0 -40
  204. package/src/components/layout/sidebar-02/team-switcher.tsx +0 -106
  205. package/src/components/providers/theme-toggle.tsx +0 -59
@@ -1,25 +1,7 @@
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
- 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 { Slot } from "radix-ui"
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
- asChild = false,
32
+ render,
51
33
  ...props
52
- }: React.ComponentProps<"span"> &
53
- VariantProps<typeof badgeVariants> & { asChild?: boolean }) {
54
- const Comp = asChild ? Slot.Root : "span"
55
-
56
- return (
57
- <Comp
58
- data-slot="badge"
59
- data-variant={variant}
60
- className={cn(badgeVariants({ variant }), className)}
61
- {...props}
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
- // 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
- 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 { Slot } from "radix-ui"
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-lg 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",
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-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
43
- xs: "h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
44
- sm: "h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
45
- lg: "h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
46
- icon: "size-8",
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),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3",
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-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg",
51
- "icon-lg": "size-9",
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
- }: React.ComponentProps<"button"> &
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
- <Comp
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-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",
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-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3",
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-snug font-medium group-data-[size=sm]/card:text-sm",
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("px-4 group-data-[size=sm]/card:px-3", className)}
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 border-t bg-muted/50 p-4 group-data-[size=sm]/card:p-3",
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 * as React from "react"
21
- import { Checkbox as CheckboxPrimitive } from "radix-ui"
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-colors outline-none group-has-disabled/field:opacity-50 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 dark:data-checked:bg-primary",
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
- // 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/>.
1
+ import { Collapsible as CollapsiblePrimitive } from "@base-ui/react/collapsible"
17
2
 
18
- "use client"
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.CollapsibleTrigger
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.CollapsibleContent
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 "radix-ui"
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
- }: React.ComponentProps<typeof DialogPrimitive.Overlay>) {
27
+ }: DialogPrimitive.Backdrop.Props) {
55
28
  return (
56
- <DialogPrimitive.Overlay
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
- }: React.ComponentProps<typeof DialogPrimitive.Content> & {
45
+ }: DialogPrimitive.Popup.Props & {
73
46
  showCloseButton?: boolean
74
47
  }) {
75
48
  return (
76
49
  <DialogPortal>
77
50
  <DialogOverlay />
78
- <DialogPrimitive.Content
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-4 rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-foreground/10 duration-100 outline-none sm:max-w-sm dark:border dark:border-primary/15 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",
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 data-slot="dialog-close" asChild>
89
- <Button
90
- variant="ghost"
91
- className="absolute top-2 right-2"
92
- size="icon-sm"
93
- >
94
- <XIcon
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
- <span className="sr-only">Close</span>
97
- </Button>
69
+ }
70
+ >
71
+ <XIcon
72
+ />
73
+ <span className="sr-only">Close</span>
98
74
  </DialogPrimitive.Close>
99
75
  )}
100
- </DialogPrimitive.Content>
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
- "-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end",
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 asChild>
135
- <Button variant="outline">Close</Button>
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
- }: React.ComponentProps<typeof DialogPrimitive.Description>) {
131
+ }: DialogPrimitive.Description.Props) {
162
132
  return (
163
133
  <DialogPrimitive.Description
164
134
  data-slot="dialog-description"