@emoo-ai/ui-react 0.0.0-stage → 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.
Files changed (119) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +49 -2
  3. package/dist/button.d.ts +2 -0
  4. package/dist/components/EmptyValue.d.ts +4 -0
  5. package/dist/components/action-pill.d.ts +8 -0
  6. package/dist/components/amount-input.d.ts +22 -0
  7. package/dist/components/bulk-selection.d.ts +44 -0
  8. package/dist/components/checkbox-group.d.ts +15 -0
  9. package/dist/components/chips.d.ts +8 -0
  10. package/dist/components/choice-field.d.ts +29 -0
  11. package/dist/components/contacts-entities.d.ts +35 -0
  12. package/dist/components/date-picker.d.ts +12 -0
  13. package/dist/components/detail-field.d.ts +41 -0
  14. package/dist/components/file-intake-target.d.ts +11 -0
  15. package/dist/components/file-upload.d.ts +45 -0
  16. package/dist/components/gate-field.d.ts +12 -0
  17. package/dist/components/ghost-button.d.ts +12 -0
  18. package/dist/components/hierarchy-picker.d.ts +28 -0
  19. package/dist/components/history-contract.d.ts +13 -0
  20. package/dist/components/history-list.d.ts +36 -0
  21. package/dist/components/loading-overlay.d.ts +5 -0
  22. package/dist/components/multi-select.d.ts +17 -0
  23. package/dist/components/nav-menu.d.ts +27 -0
  24. package/dist/components/nav-segmented.d.ts +10 -0
  25. package/dist/components/radio-group-field.d.ts +16 -0
  26. package/dist/components/remote-select.d.ts +30 -0
  27. package/dist/components/search-box.d.ts +15 -0
  28. package/dist/components/segmented.d.ts +23 -0
  29. package/dist/components/sidebar-shell.d.ts +12 -0
  30. package/dist/components/spec-field.d.ts +74 -0
  31. package/dist/components/tags-input.d.ts +10 -0
  32. package/dist/components/ui/accordion.d.ts +7 -0
  33. package/dist/components/ui/alert-dialog.d.ts +19 -0
  34. package/dist/components/ui/alert.d.ts +10 -0
  35. package/dist/components/ui/aspect-ratio.d.ts +3 -0
  36. package/dist/components/ui/attachment.d.ts +24 -0
  37. package/dist/components/ui/avatar.d.ts +11 -0
  38. package/dist/components/ui/badge.d.ts +9 -0
  39. package/dist/components/ui/breadcrumb.d.ts +11 -0
  40. package/dist/components/ui/bubble.d.ts +17 -0
  41. package/dist/components/ui/button-group.d.ts +11 -0
  42. package/dist/components/ui/button.d.ts +13 -0
  43. package/dist/components/ui/calendar.d.ts +10 -0
  44. package/dist/components/ui/card.d.ts +11 -0
  45. package/dist/components/ui/carousel.d.ts +28 -0
  46. package/dist/components/ui/checkbox.d.ts +4 -0
  47. package/dist/components/ui/collapsible.d.ts +5 -0
  48. package/dist/components/ui/command.d.ts +18 -0
  49. package/dist/components/ui/context-menu.d.ts +32 -0
  50. package/dist/components/ui/dialog.d.ts +21 -0
  51. package/dist/components/ui/direction.d.ts +7 -0
  52. package/dist/components/ui/drawer.d.ts +15 -0
  53. package/dist/components/ui/dropdown-menu.d.ts +31 -0
  54. package/dist/components/ui/empty.d.ts +11 -0
  55. package/dist/components/ui/field.d.ts +24 -0
  56. package/dist/components/ui/hover-card.d.ts +8 -0
  57. package/dist/components/ui/input-clear-button.d.ts +1 -0
  58. package/dist/components/ui/input-group.d.ts +16 -0
  59. package/dist/components/ui/input-otp.d.ts +11 -0
  60. package/dist/components/ui/input.d.ts +7 -0
  61. package/dist/components/ui/item.d.ts +23 -0
  62. package/dist/components/ui/kbd.d.ts +3 -0
  63. package/dist/components/ui/label.d.ts +4 -0
  64. package/dist/components/ui/marker.d.ts +11 -0
  65. package/dist/components/ui/menubar.d.ts +30 -0
  66. package/dist/components/ui/message-scroller.d.ts +10 -0
  67. package/dist/components/ui/message.d.ts +10 -0
  68. package/dist/components/ui/native-select.d.ts +8 -0
  69. package/dist/components/ui/navigation-menu.d.ts +14 -0
  70. package/dist/components/ui/option-pill.d.ts +11 -0
  71. package/dist/components/ui/pagination.d.ts +17 -0
  72. package/dist/components/ui/popover.d.ts +12 -0
  73. package/dist/components/ui/progress.d.ts +4 -0
  74. package/dist/components/ui/questionnaire.d.ts +19 -0
  75. package/dist/components/ui/radio-group.d.ts +7 -0
  76. package/dist/components/ui/resizable.d.ts +7 -0
  77. package/dist/components/ui/scroll-area.d.ts +5 -0
  78. package/dist/components/ui/select-indicator.d.ts +5 -0
  79. package/dist/components/ui/select.d.ts +21 -0
  80. package/dist/components/ui/separator.d.ts +4 -0
  81. package/dist/components/ui/sheet.d.ts +15 -0
  82. package/dist/components/ui/sidebar.d.ts +70 -0
  83. package/dist/components/ui/skeleton.d.ts +2 -0
  84. package/dist/components/ui/slider.d.ts +4 -0
  85. package/dist/components/ui/spinner.d.ts +3 -0
  86. package/dist/components/ui/switch.d.ts +4 -0
  87. package/dist/components/ui/table.d.ts +14 -0
  88. package/dist/components/ui/tabs.d.ts +11 -0
  89. package/dist/components/ui/textarea.d.ts +3 -0
  90. package/dist/components/ui/toast.d.ts +4 -0
  91. package/dist/components/ui/toggle-group.d.ts +10 -0
  92. package/dist/components/ui/toggle.d.ts +9 -0
  93. package/dist/components/ui/tooltip.d.ts +9 -0
  94. package/dist/components/user-tag.d.ts +22 -0
  95. package/dist/components/value-diff.d.ts +5 -0
  96. package/dist/dialog.d.ts +1 -0
  97. package/dist/hooks/use-mobile.d.ts +1 -0
  98. package/dist/index.d.ts +110 -0
  99. package/dist/index.js +11595 -0
  100. package/dist/lib/btn-base.d.ts +1 -0
  101. package/dist/lib/currency.d.ts +42 -0
  102. package/dist/lib/paged.d.ts +4 -0
  103. package/dist/styles.css +1 -0
  104. package/dist/table/ColumnDragOverlay.d.ts +6 -0
  105. package/dist/table/DataTable.d.ts +88 -0
  106. package/dist/table/InfiniteTableLoader.d.ts +12 -0
  107. package/dist/table/VirtualTableBody.d.ts +16 -0
  108. package/dist/table/column-order.d.ts +7 -0
  109. package/dist/table/table-preferences.d.ts +37 -0
  110. package/dist/table/table-scrolling.d.ts +33 -0
  111. package/dist/table/use-column-reordering.d.ts +34 -0
  112. package/dist/table/use-h-scroll-enhance.d.ts +15 -0
  113. package/dist/table/use-row-selection.d.ts +29 -0
  114. package/dist/table/use-table-preferences.d.ts +7 -0
  115. package/dist/table/use-table-scroll.d.ts +4 -0
  116. package/dist/table/use-table-sorting.d.ts +7 -0
  117. package/dist/theme-signal.d.ts +1 -0
  118. package/dist/utils.d.ts +2 -0
  119. package/package.json +55 -4
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 emoo-ai
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,50 @@
1
- # Temporary Holding Version
1
+ # @emoo-ai/ui-react
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ React 19 编译交付包:预编译样式 + 组件。宿主不需要 Tailwind、Sass 或任何 Vue/EP 工具链。
4
+
5
+ ## 使用
6
+
7
+ ```ts
8
+ import '@emoo-ai/brand/tokens.css'
9
+ import '@emoo-ai/ui-react/styles.css'
10
+ import { Button, Dialog, DialogTrigger, DialogContent, DialogTitle, DialogDescription } from '@emoo-ai/ui-react'
11
+ ```
12
+
13
+ 不需要 Tailwind、Sass、扫描 node_modules 或安装 Vue/EP。JS 不注入样式,CSS 必须显式导入。React/React DOM 为 peers,Radix、图标和工具依赖按 package.json 安装。
14
+
15
+ Button 保留原生 ref/props、asChild、variant/size/shape 和 data-slot;`buttonVariants` 可独立生成同样的预编译工具类。Dialog 提供 Root、Trigger、Portal、Close、Overlay、Content、Header、Footer、Title、Description;Title/Description 必须由调用方按语义提供。
16
+
17
+ ## Tailwind 4 共存
18
+
19
+ 组件使用包内预编译的 Tailwind 工具类(utilities layer),最小原生基线放在 components layer。**必须先建立 layer 顺序**,否则后加载的 preflight base 层可能压过库样式:
20
+
21
+ ```css
22
+ /* 先于组件 CSS 引入;可作为应用统一 CSS 入口。 */
23
+ @layer theme, base, components, utilities;
24
+ @import 'tailwindcss';
25
+ @import '@emoo-ai/brand/tokens.css';
26
+ @import '@emoo-ai/ui-react/styles.css';
27
+ /* 宿主覆盖最后;同为 utility 层时后写规则胜,cn 处理组件自身 className 冲突。 */
28
+ ```
29
+
30
+ 也可先导入只声明上述顺序的 layers.css,再从 JS 分别导入样式。库本身不带 preflight,所需工具类已预编译,不要求宿主扫描源码,不写全局 reset;`cn`/twMerge 不替代正确的 CSS 级联。
31
+
32
+ ## 主题和 portal
33
+
34
+ 宿主在 html 切换 `.dark`,或覆盖相应 `--emoo-*`;库不管理系统主题/localStorage。实心按钮使用 `--emoo-btn-solid-bg/color`,焦点使用品牌强调色,不把全部 primary 机械改为紫色。Dialog 使用不透明 `--emoo-card-solid-bg`。
35
+
36
+ 默认 Portal 到 body,继承根 token;局部白标变量必须把 `<DialogContent container={element}>` 放进主题容器,保证继承。局部容器只覆盖指定变量,不代表 brand 自动支持嵌套 `.dark`。`closeLabel` 可注入本地化文案。
37
+
38
+ ## 组件族
39
+
40
+ - 基础:Button/ButtonGroup、Input/Textarea/NativeSelect、Field/InputGroup、Checkbox/RadioGroup/Switch/Slider/Select、Toggle/Tabs/Accordion。
41
+ - 反馈:Alert/Badge/Empty/EmptyValue、Skeleton/Spinner/Progress/LoadingOverlay、Avatar、Toaster/toast。
42
+ - 浮层:Dialog/AlertDialog/Sheet/Drawer(Vaul)/Popover/Tooltip/HoverCard/DropdownMenu/ContextMenu/Command。
43
+ - 复合件:Chips/Segmented/TagsInput/ValueDiff/HistoryList;表单字段(DatePicker/AmountInput/SpecField)、Upload、DataTable(TanStack Table 封装,支持虚拟滚动)、SearchBox、NavMenu/NavSegmented、SidebarShell、GhostButton/ActionPill。
44
+ - 框架原语:Direction/AspectRatio/Resizable/ScrollArea/InputOTP、Card/Item/Kbd/Separator/Pagination/Attachment。
45
+
46
+ Progress 向 Radix 传递真实 value/max,非有限值为不确定态;CommandDialog 自带 cmdk 根上下文。Select clearable 维持受控清空与 placeholder 协议,disabled 不可清空。浮层 Content 可选 container。
47
+
48
+ Toaster 可传 theme,缺省观察根 .dark,不保存偏好。Sonner/Vaul 等第三方组件可能自行注入其上游运行时样式;本包 Tailwind 样式仍须显式导入。默认文案暂为中文/英文两套,不宣称完整 i18n。
49
+
50
+ 本包以编译产物方式发布,源码不随包。
@@ -0,0 +1,2 @@
1
+ export { Button, buttonVariants } from "./components/ui/button";
2
+ export type { ButtonProps } from "./components/ui/button";
@@ -0,0 +1,4 @@
1
+ export declare function EmptyValue({ className }: {
2
+ className?: string;
3
+ }): import("react/jsx-runtime").JSX.Element;
4
+ export declare function isEmptyValue(value: unknown): boolean;
@@ -0,0 +1,8 @@
1
+ import * as React from "react";
2
+ export interface ActionPillProps extends React.ComponentProps<"button"> {
3
+ icon?: React.ReactNode;
4
+ label: React.ReactNode;
5
+ kbd?: React.ReactNode;
6
+ }
7
+ declare function ActionPill({ icon, label, kbd, className, type, ...props }: ActionPillProps): import("react/jsx-runtime").JSX.Element;
8
+ export { ActionPill };
@@ -0,0 +1,22 @@
1
+ interface AmountInputProps {
2
+ value?: number;
3
+ onChange: (v: number | undefined) => void;
4
+ currency?: string;
5
+ min?: number;
6
+ max?: number;
7
+ allowNegative?: boolean;
8
+ placeholder?: string;
9
+ clearable?: boolean;
10
+ disabled?: boolean;
11
+ className?: string;
12
+ id?: string;
13
+ }
14
+ export declare function AmountInput({ value, onChange, currency, min, max, allowNegative, placeholder, clearable, disabled, className, id, }: AmountInputProps): import("react/jsx-runtime").JSX.Element;
15
+ interface AmountTextProps {
16
+ value?: number;
17
+ currency?: string;
18
+ show?: "symbol" | "code" | "both";
19
+ className?: string;
20
+ }
21
+ export declare function AmountText({ value, currency, show, className, }: AmountTextProps): import("react/jsx-runtime").JSX.Element;
22
+ export {};
@@ -0,0 +1,44 @@
1
+ import { type ReactNode } from "react";
2
+ export declare const BULK_SELECTION_LIMIT = 2000;
3
+ export interface BulkSelectionResponse<T> {
4
+ items: T[];
5
+ total: number;
6
+ }
7
+ export declare function useBulkSelection<T extends {
8
+ id: number;
9
+ }>({ context, fetchAll, selectable, onSelectAll, limit, errorText, }: {
10
+ context: string;
11
+ fetchAll: () => Promise<BulkSelectionResponse<T>>;
12
+ selectable?: (row: T) => boolean;
13
+ onSelectAll?: (data: BulkSelectionResponse<T>) => void;
14
+ limit?: number;
15
+ errorText?: string;
16
+ }): {
17
+ rows: Map<number, T>;
18
+ selectedIds: number[];
19
+ addRows: (add: T[]) => void;
20
+ removeIds: (ids: number[]) => void;
21
+ clear: () => void;
22
+ selectAll: {
23
+ isPending: boolean;
24
+ mutate: () => void;
25
+ };
26
+ allPicked: boolean;
27
+ exceedsLimit: boolean;
28
+ limit: number;
29
+ };
30
+ export declare function BulkSelectionBar({ count, offPageCount, measure, note, selectAllTotal, selectAllMeasure, selectAllPending, onSelectAll, allPicked, limit, exceeds, onClear, children, }: {
31
+ count: number;
32
+ offPageCount?: number;
33
+ measure?: string;
34
+ note?: string;
35
+ selectAllTotal?: number;
36
+ selectAllMeasure?: string;
37
+ selectAllPending?: boolean;
38
+ onSelectAll?: () => void;
39
+ allPicked?: boolean;
40
+ limit?: number;
41
+ exceeds?: boolean;
42
+ onClear: () => void;
43
+ children?: ReactNode;
44
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,15 @@
1
+ export interface CheckboxOption {
2
+ value: string;
3
+ label: string;
4
+ disabled?: boolean;
5
+ color?: string;
6
+ }
7
+ interface Props {
8
+ value: string[];
9
+ onChange: (v: string[]) => void;
10
+ options: CheckboxOption[];
11
+ disabled?: boolean;
12
+ className?: string;
13
+ }
14
+ export declare function CheckboxGroup({ value, onChange, options, disabled, className, }: Props): import("react/jsx-runtime").JSX.Element;
15
+ export {};
@@ -0,0 +1,8 @@
1
+ export interface ChipsProps<T> {
2
+ items: T[];
3
+ labelOf: (item: T) => string;
4
+ gap?: number;
5
+ className?: string;
6
+ }
7
+ declare function Chips<T>({ items, labelOf, gap, className }: ChipsProps<T>): import("react/jsx-runtime").JSX.Element;
8
+ export { Chips };
@@ -0,0 +1,29 @@
1
+ import type { ReactNode } from "react";
2
+ export interface ChoiceOption {
3
+ value: string;
4
+ label?: string;
5
+ color?: string;
6
+ }
7
+ interface ChoiceCommonProps {
8
+ label?: string;
9
+ labelTone?: "danger";
10
+ options: readonly (string | ChoiceOption)[];
11
+ className?: string;
12
+ children?: ReactNode;
13
+ }
14
+ interface SingleChoiceProps extends ChoiceCommonProps {
15
+ multiple?: false;
16
+ value: string;
17
+ onChange: (v: string) => void;
18
+ required?: boolean;
19
+ variant?: "auto" | "inline" | "select" | "segment";
20
+ }
21
+ interface MultiChoiceProps extends ChoiceCommonProps {
22
+ multiple: true;
23
+ value: string[];
24
+ onChange: (v: string[]) => void;
25
+ variant?: "auto" | "inline" | "select";
26
+ }
27
+ export type ChoiceProps = SingleChoiceProps | MultiChoiceProps;
28
+ export declare function Choice(props: ChoiceProps): import("react/jsx-runtime").JSX.Element;
29
+ export {};
@@ -0,0 +1,35 @@
1
+ import { type Paged } from "../lib/paged";
2
+ import { type RemoteOption } from "./remote-select";
3
+ export interface EntityProfile {
4
+ name: string;
5
+ avatar: string;
6
+ }
7
+ interface EntityConfig<TItem> {
8
+ search: (q: string) => Promise<Paged<TItem>>;
9
+ fetchByIds: (ids: string[]) => Promise<TItem[]>;
10
+ toOption: (item: TItem) => RemoteOption;
11
+ toProfile: (item: TItem) => EntityProfile & {
12
+ key: string;
13
+ };
14
+ placeholder: string;
15
+ searchPlaceholder: string;
16
+ emptyText: string;
17
+ }
18
+ export declare function createContactsEntities<TItem>(cfg: EntityConfig<TItem>): {
19
+ Select: ({ value, onChange, profiles, placeholder, clearable, disabled, className, }: {
20
+ value: string[];
21
+ onChange: (v: string[]) => void;
22
+ profiles?: Record<string, EntityProfile>;
23
+ placeholder?: string;
24
+ clearable?: boolean;
25
+ disabled?: boolean;
26
+ className?: string;
27
+ }) => import("react/jsx-runtime").JSX.Element;
28
+ View: ({ ids, profiles, className, }: {
29
+ ids: string[];
30
+ profiles?: Record<string, EntityProfile>;
31
+ className?: string;
32
+ }) => import("react/jsx-runtime").JSX.Element;
33
+ useProfiles: (ids: string[]) => Record<string, EntityProfile>;
34
+ };
35
+ export {};
@@ -0,0 +1,12 @@
1
+ interface Props {
2
+ value?: string;
3
+ onChange: (v: string | undefined) => void;
4
+ placeholder?: string;
5
+ disabled?: boolean;
6
+ className?: string;
7
+ id?: string;
8
+ fromYear?: number;
9
+ toYear?: number;
10
+ }
11
+ export declare function DatePicker({ value, onChange, placeholder, disabled, className, id, fromYear, toYear, }: Props): import("react/jsx-runtime").JSX.Element;
12
+ export {};
@@ -0,0 +1,41 @@
1
+ import { SheetContent } from "./ui/sheet";
2
+ export declare function WideSheetContent({ className, side, resizable, resizeStorageKey, style, children, ...props }: React.ComponentProps<typeof SheetContent> & {
3
+ resizable?: boolean;
4
+ resizeStorageKey?: string;
5
+ }): import("react/jsx-runtime").JSX.Element;
6
+ export declare const FULL_SPAN = "md:col-span-3 lg:col-span-4";
7
+ export declare function FieldGrid({ children, className, }: {
8
+ children: React.ReactNode;
9
+ className?: string;
10
+ }): import("react/jsx-runtime").JSX.Element;
11
+ export declare function ViewField({ label, value, full, plain, labelTone, }: {
12
+ label: string;
13
+ value: React.ReactNode;
14
+ full?: boolean;
15
+ plain?: boolean;
16
+ labelTone?: "danger";
17
+ }): import("react/jsx-runtime").JSX.Element;
18
+ export declare function EditField({ label, required, full, htmlFor, className, labelTone, children, }: {
19
+ label: string;
20
+ required?: boolean;
21
+ full?: boolean;
22
+ htmlFor?: string;
23
+ className?: string;
24
+ labelTone?: "danger";
25
+ children: React.ReactNode;
26
+ }): import("react/jsx-runtime").JSX.Element;
27
+ export declare function SectionTitle({ children, extra, }: {
28
+ children: React.ReactNode;
29
+ extra?: React.ReactNode;
30
+ }): import("react/jsx-runtime").JSX.Element;
31
+ export declare function FoldSection({ title, open, onOpenChange, error, children, }: {
32
+ title: React.ReactNode;
33
+ open: boolean;
34
+ onOpenChange: (open: boolean) => void;
35
+ error?: boolean;
36
+ children: React.ReactNode;
37
+ }): import("react/jsx-runtime").JSX.Element;
38
+ export declare function CollapsibleList<T>({ items, render, }: {
39
+ items: T[];
40
+ render: (visible: T[]) => React.ReactNode;
41
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { type ReactNode } from "react";
2
+ export interface FileIntakeTargetProps {
3
+ label: string;
4
+ accept?: string;
5
+ multiple?: boolean;
6
+ disabled?: boolean;
7
+ onFiles: (files: File[]) => Promise<void> | void;
8
+ children: ReactNode;
9
+ className?: string;
10
+ }
11
+ export declare function FileIntakeTarget({ label, accept, multiple, disabled, onFiles, children, className, }: FileIntakeTargetProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,45 @@
1
+ import { type ReactNode } from "react";
2
+ import { type Icon } from "@phosphor-icons/react";
3
+ export interface FileItem {
4
+ file_key: string;
5
+ name: string;
6
+ size?: number;
7
+ url?: string;
8
+ }
9
+ interface Props {
10
+ value: FileItem[];
11
+ onChange?: (v: FileItem[]) => void;
12
+ readOnly?: boolean;
13
+ disabled?: boolean;
14
+ accept?: string;
15
+ multiple?: boolean;
16
+ removable?: boolean;
17
+ onUpload: (file: File) => Promise<FileItem>;
18
+ uploadLabel?: string;
19
+ getDownloadUrl?: (item: FileItem) => Promise<string>;
20
+ getDocPreview?: (item: FileItem, signal?: AbortSignal) => Promise<DocTextPreview>;
21
+ className?: string;
22
+ }
23
+ export interface PreviewRendererProps {
24
+ item: FileItem;
25
+ url: string;
26
+ onError: () => void;
27
+ }
28
+ export interface PreviewKindSpec {
29
+ extensions: readonly string[];
30
+ label: string;
31
+ icon?: Icon;
32
+ render: (props: PreviewRendererProps) => ReactNode;
33
+ }
34
+ export declare function registerPreviewKind(spec: PreviewKindSpec): void;
35
+ export declare function FileUpload({ value, onChange, readOnly, disabled, accept, multiple, removable, onUpload, uploadLabel, getDownloadUrl, getDocPreview, className, }: Props): import("react/jsx-runtime").JSX.Element;
36
+ interface DocTextPreview {
37
+ content: string;
38
+ status: "ok" | "empty";
39
+ }
40
+ export type { DocTextPreview };
41
+ export declare function PreviewFallbackCard({ item, url, note, }: {
42
+ item: FileItem;
43
+ url: string | null;
44
+ note: string;
45
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import type { ReactNode } from "react";
2
+ export declare function GateField({ state, label, full, htmlFor, required, editNode, readNode, plain, labelTone, }: {
3
+ state: "hidden" | "view" | "edit";
4
+ label: string;
5
+ full?: boolean;
6
+ htmlFor?: string;
7
+ required?: boolean;
8
+ editNode?: ReactNode;
9
+ readNode: ReactNode;
10
+ plain?: boolean;
11
+ labelTone?: "danger";
12
+ }): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,12 @@
1
+ import * as React from "react";
2
+ import { type VariantProps } from "class-variance-authority";
3
+ declare const ghostButtonVariants: (props?: ({
4
+ variant?: "icon" | "pill" | null | undefined;
5
+ touch?: boolean | null | undefined;
6
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
+ export type GhostButtonProps = React.ComponentProps<"button"> & VariantProps<typeof ghostButtonVariants> & {
8
+ pill?: boolean;
9
+ touch?: boolean;
10
+ };
11
+ declare function GhostButton({ pill, touch, className, type, ...props }: GhostButtonProps): import("react/jsx-runtime").JSX.Element;
12
+ export { GhostButton, ghostButtonVariants };
@@ -0,0 +1,28 @@
1
+ export interface HierarchyOption {
2
+ id: string;
3
+ parentId: string | null;
4
+ label: string;
5
+ keywords?: string[];
6
+ disabled?: boolean;
7
+ }
8
+ interface HierarchyPickerBaseProps {
9
+ options: HierarchyOption[];
10
+ isSelectable?: (option: HierarchyOption) => boolean;
11
+ placeholder?: string;
12
+ searchPlaceholder?: string;
13
+ emptyText?: string;
14
+ clearable?: boolean;
15
+ disabled?: boolean;
16
+ className?: string;
17
+ }
18
+ export type HierarchyPickerProps = HierarchyPickerBaseProps & ({
19
+ multiple?: false;
20
+ value: string | null;
21
+ onValueChange: (value: string | null) => void;
22
+ } | {
23
+ multiple: true;
24
+ value: string[];
25
+ onValueChange: (value: string[]) => void;
26
+ });
27
+ export declare function HierarchyPicker(props: HierarchyPickerProps): import("react/jsx-runtime").JSX.Element;
28
+ export {};
@@ -0,0 +1,13 @@
1
+ export type HistoryItemStatus = 'generating' | 'unread';
2
+ export interface HistoryItem {
3
+ id: number | string;
4
+ title: string;
5
+ status?: HistoryItemStatus;
6
+ tooltip?: string;
7
+ }
8
+ export interface HistoryGroup {
9
+ key: string;
10
+ label: string;
11
+ dim?: boolean;
12
+ items: HistoryItem[];
13
+ }
@@ -0,0 +1,36 @@
1
+ import { type ReactNode, type Ref } from "react";
2
+ import type { HistoryGroup, HistoryItem } from "./history-contract";
3
+ export interface HistoryListHandle {
4
+ startRename(item: Pick<HistoryItem, "id" | "title">): void;
5
+ cancelRename(): void;
6
+ exitSelectMode(): void;
7
+ focusSearch(): void;
8
+ }
9
+ declare function HistoryList({ groups, activeId, keyword, onKeywordChange, loading, anyRecord, selectable, selectedIds, onSelectedIdsChange, batchBusy, onSelect, onLoadMore, onDelete, onRename, rowAction, batchActions, apiRef, searchPlaceholder, selectLabel, cancelLabel, emptyTitle, noMatchTitle, className, ...props }: Omit<React.ComponentProps<"div">, "onSelect" | "onScroll"> & {
10
+ groups: HistoryGroup[];
11
+ activeId?: number | string | null;
12
+ keyword?: string;
13
+ onKeywordChange?: (keyword: string) => void;
14
+ loading?: boolean;
15
+ anyRecord?: boolean;
16
+ selectable?: boolean;
17
+ selectedIds?: Array<number | string>;
18
+ onSelectedIdsChange?: (ids: Array<number | string>) => void;
19
+ batchBusy?: boolean;
20
+ onSelect?: (item: HistoryItem) => void;
21
+ onLoadMore?: () => void;
22
+ onDelete?: (item: HistoryItem) => void;
23
+ onRename?: (payload: {
24
+ id: number | string;
25
+ title: string;
26
+ }) => void;
27
+ rowAction?: (item: HistoryItem) => ReactNode;
28
+ batchActions?: (selectedIds: Array<number | string>) => ReactNode;
29
+ apiRef?: Ref<HistoryListHandle>;
30
+ searchPlaceholder?: string;
31
+ selectLabel?: string;
32
+ cancelLabel?: string;
33
+ emptyTitle?: string;
34
+ noMatchTitle?: string;
35
+ }): import("react/jsx-runtime").JSX.Element;
36
+ export { HistoryList };
@@ -0,0 +1,5 @@
1
+ declare function LoadingOverlay({ message, className, spinnerClassName, ...props }: React.ComponentProps<"div"> & {
2
+ message?: string;
3
+ spinnerClassName?: string;
4
+ }): import("react/jsx-runtime").JSX.Element;
5
+ export { LoadingOverlay };
@@ -0,0 +1,17 @@
1
+ export interface MultiSelectOption {
2
+ value: string;
3
+ label: string;
4
+ disabled?: boolean;
5
+ color?: string;
6
+ }
7
+ interface Props {
8
+ value: string[];
9
+ onChange: (v: string[]) => void;
10
+ options: MultiSelectOption[];
11
+ placeholder?: string;
12
+ clearable?: boolean;
13
+ disabled?: boolean;
14
+ className?: string;
15
+ }
16
+ export declare function MultiSelect({ value, onChange, options, placeholder, clearable, disabled, className, }: Props): import("react/jsx-runtime").JSX.Element;
17
+ export {};
@@ -0,0 +1,27 @@
1
+ import * as React from "react";
2
+ export interface NavItem {
3
+ key: string;
4
+ title: React.ReactNode;
5
+ icon?: React.ReactNode;
6
+ path?: string;
7
+ children?: NavItem[];
8
+ action?: () => void;
9
+ hidden?: boolean;
10
+ separatorBefore?: boolean;
11
+ active?: boolean;
12
+ badge?: number | string;
13
+ trailing?: React.ReactNode;
14
+ testid?: string;
15
+ }
16
+ export interface NavMenuProps {
17
+ items: NavItem[];
18
+ activePath?: string;
19
+ canShow?: (item: NavItem) => boolean;
20
+ navigate?: (path: string) => void;
21
+ touch?: boolean;
22
+ onSelect?: (item: NavItem) => void;
23
+ onGroupSelect?: (item: NavItem, expanding: boolean) => void;
24
+ className?: string;
25
+ }
26
+ declare function NavMenu({ items, activePath, canShow, navigate, touch, onSelect, onGroupSelect, className, }: NavMenuProps): import("react/jsx-runtime").JSX.Element;
27
+ export { NavMenu };
@@ -0,0 +1,10 @@
1
+ import type { NavItem } from "./nav-menu";
2
+ export interface NavSegmentedProps {
3
+ items: NavItem[];
4
+ activeKey?: string;
5
+ navigate?: (path: string) => void;
6
+ onSelect?: (item: NavItem) => void;
7
+ className?: string;
8
+ }
9
+ declare function NavSegmented({ items, activeKey, navigate, onSelect, className }: NavSegmentedProps): import("react/jsx-runtime").JSX.Element;
10
+ export { NavSegmented };
@@ -0,0 +1,16 @@
1
+ export interface RadioOption {
2
+ value: string;
3
+ label: string;
4
+ disabled?: boolean;
5
+ color?: string;
6
+ }
7
+ interface Props {
8
+ value: string;
9
+ onChange: (v: string) => void;
10
+ options: RadioOption[];
11
+ allowDeselect?: boolean;
12
+ disabled?: boolean;
13
+ className?: string;
14
+ }
15
+ export declare function RadioGroupField({ value, onChange, options, allowDeselect, disabled, className, }: Props): import("react/jsx-runtime").JSX.Element;
16
+ export {};
@@ -0,0 +1,30 @@
1
+ import { type CSSProperties, type ReactNode } from "react";
2
+ import { type Paged } from "../lib/paged";
3
+ export interface RemoteOption {
4
+ key: string;
5
+ label: string;
6
+ hint?: string | null;
7
+ avatar?: string | null;
8
+ }
9
+ export declare function RemovableBadge({ label, onRemove, style, children, }: {
10
+ label: string;
11
+ onRemove: () => void;
12
+ style?: CSSProperties;
13
+ children?: ReactNode;
14
+ }): import("react/jsx-runtime").JSX.Element;
15
+ interface Props {
16
+ value: string[];
17
+ onChange: (v: string[]) => void;
18
+ fetchOptions: (q: string) => Promise<Paged<RemoteOption>>;
19
+ resolveOptions: (keys: string[]) => Promise<RemoteOption[]>;
20
+ knownOptions?: RemoteOption[];
21
+ single?: boolean;
22
+ clearable?: boolean;
23
+ placeholder?: string;
24
+ searchPlaceholder?: string;
25
+ emptyText?: string;
26
+ disabled?: boolean;
27
+ className?: string;
28
+ }
29
+ export declare function RemoteSearchSelect({ value, onChange, fetchOptions, resolveOptions, knownOptions, single, clearable, placeholder, searchPlaceholder, emptyText, disabled, className, }: Props): import("react/jsx-runtime").JSX.Element;
30
+ export {};
@@ -0,0 +1,15 @@
1
+ import * as React from "react";
2
+ export interface SearchBoxProps extends React.ComponentProps<"div"> {
3
+ variant?: "composer" | "hero";
4
+ grip?: boolean;
5
+ resizing?: boolean;
6
+ gripTip?: string;
7
+ onGripMouseDown?: (event: React.MouseEvent<HTMLSpanElement>) => void;
8
+ top?: React.ReactNode;
9
+ extras?: React.ReactNode;
10
+ bar?: React.ReactNode;
11
+ trailing?: React.ReactNode;
12
+ focus?: boolean;
13
+ }
14
+ declare function SearchBox({ variant, grip, resizing, gripTip, onGripMouseDown, top, extras, bar, trailing, focus, className, children, ...props }: SearchBoxProps): import("react/jsx-runtime").JSX.Element;
15
+ export { SearchBox };
@@ -0,0 +1,23 @@
1
+ import * as React from "react";
2
+ export interface SegmentedOption<T extends string | number> {
3
+ label?: string;
4
+ value: T;
5
+ disabled?: boolean;
6
+ count?: string | number;
7
+ icon?: React.ReactNode;
8
+ ariaLabel?: string;
9
+ }
10
+ declare const SIZES: {
11
+ readonly small: "h-6";
12
+ readonly default: "h-8";
13
+ readonly large: "h-10";
14
+ };
15
+ export interface SegmentedProps<T extends string | number> extends Omit<React.ComponentProps<"div">, "onChange"> {
16
+ options: SegmentedOption<T>[];
17
+ value: T;
18
+ onValueChange?: (value: T) => void;
19
+ size?: keyof typeof SIZES;
20
+ disabled?: boolean;
21
+ }
22
+ declare function Segmented<T extends string | number>({ className, options, value, onValueChange, size, disabled, "aria-label": ariaLabel, ...props }: SegmentedProps<T>): import("react/jsx-runtime").JSX.Element;
23
+ export { Segmented };
@@ -0,0 +1,12 @@
1
+ import * as React from "react";
2
+ export interface SidebarShellProps extends React.ComponentProps<"aside"> {
3
+ collapsed?: boolean;
4
+ overlay?: boolean;
5
+ resizing?: boolean;
6
+ instant?: boolean;
7
+ width?: string | number;
8
+ header?: React.ReactNode;
9
+ footer?: React.ReactNode;
10
+ }
11
+ declare function SidebarShell({ collapsed, overlay, resizing, instant, width, header, footer, className, style, children, ...props }: SidebarShellProps): import("react/jsx-runtime").JSX.Element;
12
+ export { SidebarShell };