@mcp-b/react-components 0.1.1 → 0.1.2
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/dist/Button-QCM8ZKgR.d.ts +98 -0
- package/dist/CodeBlock-CttHhWcb.js +356 -0
- package/dist/CodeBlock-V6pgafSS.d.ts +174 -0
- package/dist/Select-CRsKCJ9x.d.ts +200 -0
- package/dist/class-names-9UtZwb0J.js +12 -0
- package/dist/components/Accordion.d.ts +81 -0
- package/dist/components/Accordion.js +97 -0
- package/dist/components/AgentConnection.d.ts +69 -0
- package/dist/components/AgentConnection.js +176 -0
- package/dist/components/AlertDialog.d.ts +148 -0
- package/dist/components/AlertDialog.js +141 -0
- package/dist/components/Artifact.d.ts +128 -0
- package/dist/components/Artifact.js +115 -0
- package/dist/components/Autocomplete.d.ts +186 -0
- package/dist/components/Autocomplete.js +186 -0
- package/dist/components/Avatar.d.ts +134 -0
- package/dist/components/Avatar.js +118 -0
- package/dist/components/Badge.d.ts +68 -0
- package/dist/components/Badge.js +108 -0
- package/dist/components/Button.d.ts +2 -0
- package/dist/components/Button.js +73 -0
- package/dist/components/Card.d.ts +87 -0
- package/dist/components/Card.js +81 -0
- package/dist/components/ChainOfThought.d.ts +153 -0
- package/dist/components/ChainOfThought.js +157 -0
- package/dist/components/Checkbox.d.ts +35 -0
- package/dist/components/Checkbox.js +47 -0
- package/dist/components/CheckboxGroup.d.ts +76 -0
- package/dist/components/CheckboxGroup.js +69 -0
- package/dist/components/CodeBlock.d.ts +2 -0
- package/dist/components/CodeBlock.js +2 -0
- package/dist/components/Collapsible.d.ts +127 -0
- package/dist/components/Collapsible.js +103 -0
- package/dist/components/Combobox.d.ts +177 -0
- package/dist/components/Combobox.js +179 -0
- package/dist/components/Commit.d.ts +265 -0
- package/dist/components/Commit.js +282 -0
- package/dist/components/Context.d.ts +129 -0
- package/dist/components/Context.js +309 -0
- package/dist/components/ContextMenu.d.ts +282 -0
- package/dist/components/ContextMenu.js +270 -0
- package/dist/components/Conversation.d.ts +166 -0
- package/dist/components/Conversation.js +202 -0
- package/dist/components/Dialog.d.ts +120 -0
- package/dist/components/Dialog.js +114 -0
- package/dist/components/EnvironmentVariables.d.ts +176 -0
- package/dist/components/EnvironmentVariables.js +221 -0
- package/dist/components/Field.d.ts +281 -0
- package/dist/components/Field.js +274 -0
- package/dist/components/Fieldset.d.ts +93 -0
- package/dist/components/Fieldset.js +81 -0
- package/dist/components/FileTree.d.ts +116 -0
- package/dist/components/FileTree.js +310 -0
- package/dist/components/Form.d.ts +94 -0
- package/dist/components/Form.js +88 -0
- package/dist/components/GithubMotionMark.d.ts +13 -0
- package/dist/components/GithubMotionMark.js +23 -0
- package/dist/components/Input.d.ts +33 -0
- package/dist/components/Input.js +27 -0
- package/dist/components/Label.d.ts +44 -0
- package/dist/components/Label.js +41 -0
- package/dist/components/Menu.d.ts +395 -0
- package/dist/components/Menu.js +338 -0
- package/dist/components/Menubar.d.ts +331 -0
- package/dist/components/Menubar.js +299 -0
- package/dist/components/Message.d.ts +216 -0
- package/dist/components/Message.js +245 -0
- package/dist/components/Meter.d.ts +151 -0
- package/dist/components/Meter.js +121 -0
- package/dist/components/ModelSelector.d.ts +198 -0
- package/dist/components/ModelSelector.js +306 -0
- package/dist/components/NaniteScene.d.ts +33 -0
- package/dist/components/NaniteScene.js +405 -0
- package/dist/components/NavigationMenu.d.ts +256 -0
- package/dist/components/NavigationMenu.js +228 -0
- package/dist/components/NumberField.d.ts +159 -0
- package/dist/components/NumberField.js +123 -0
- package/dist/components/Popover.d.ts +278 -0
- package/dist/components/Popover.js +245 -0
- package/dist/components/PreviewCard.d.ts +156 -0
- package/dist/components/PreviewCard.js +156 -0
- package/dist/components/PricingPage.d.ts +209 -0
- package/dist/components/PricingPage.js +506 -0
- package/dist/components/Progress.d.ts +58 -0
- package/dist/components/Progress.js +51 -0
- package/dist/components/PromptInput.d.ts +399 -0
- package/dist/components/PromptInput.js +737 -0
- package/dist/components/Queue.d.ts +241 -0
- package/dist/components/Queue.js +225 -0
- package/dist/components/RadioGroup.d.ts +78 -0
- package/dist/components/RadioGroup.js +72 -0
- package/dist/components/Reasoning.d.ts +88 -0
- package/dist/components/Reasoning.js +187 -0
- package/dist/components/ScrollArea.d.ts +160 -0
- package/dist/components/ScrollArea.js +145 -0
- package/dist/components/Select.d.ts +2 -0
- package/dist/components/Select.js +260 -0
- package/dist/components/Separator.d.ts +45 -0
- package/dist/components/Separator.js +40 -0
- package/dist/components/Shell.d.ts +163 -0
- package/dist/components/Shell.js +137 -0
- package/dist/components/Slider.d.ts +120 -0
- package/dist/components/Slider.js +115 -0
- package/dist/components/Sources.d.ts +91 -0
- package/dist/components/Sources.js +121 -0
- package/dist/components/Stepper.d.ts +190 -0
- package/dist/components/Stepper.js +315 -0
- package/dist/components/Switch.d.ts +57 -0
- package/dist/components/Switch.js +55 -0
- package/dist/components/Tabs.d.ts +84 -0
- package/dist/components/Tabs.js +78 -0
- package/dist/components/Task.d.ts +100 -0
- package/dist/components/Task.js +120 -0
- package/dist/components/Terminal.d.ts +118 -0
- package/dist/components/Terminal.js +234 -0
- package/dist/components/TestResults.d.ts +236 -0
- package/dist/components/TestResults.js +346 -0
- package/dist/components/Toast.d.ts +192 -0
- package/dist/components/Toast.js +163 -0
- package/dist/components/Toggle.d.ts +69 -0
- package/dist/components/Toggle.js +66 -0
- package/dist/components/ToggleGroup.d.ts +69 -0
- package/dist/components/ToggleGroup.js +99 -0
- package/dist/components/Tool.d.ts +119 -0
- package/dist/components/Tool.js +192 -0
- package/dist/components/Toolbar.d.ts +162 -0
- package/dist/components/Toolbar.js +126 -0
- package/dist/components/Tooltip.d.ts +81 -0
- package/dist/components/Tooltip.js +74 -0
- package/dist/components/WebPreview.d.ts +143 -0
- package/dist/components/WebPreview.js +280 -0
- package/dist/components/useStickToBottom.d.ts +30 -0
- package/dist/components/useStickToBottom.js +95 -0
- package/dist/copy-button-BIATcZWZ.d.ts +16 -0
- package/dist/copy-button-BNgclDrO.js +43 -0
- package/dist/icons-BsWc8g4E.js +221 -0
- package/dist/styles/accordion.css +10 -10
- package/dist/styles/agent-connection.css +18 -17
- package/dist/styles/alert-dialog.css +48 -29
- package/dist/styles/artifact.css +10 -10
- package/dist/styles/autocomplete.css +25 -24
- package/dist/styles/avatar.css +96 -6
- package/dist/styles/badge.css +78 -14
- package/dist/styles/base.css +9 -9
- package/dist/styles/button.css +57 -38
- package/dist/styles/card.css +57 -10
- package/dist/styles/chain-of-thought.css +47 -33
- package/dist/styles/checkbox.css +24 -10
- package/dist/styles/code-block.css +22 -15
- package/dist/styles/collapsible.css +14 -12
- package/dist/styles/combobox.css +26 -25
- package/dist/styles/commit.css +49 -24
- package/dist/styles/context-menu.css +70 -16
- package/dist/styles/context.css +15 -15
- package/dist/styles/conversation.css +12 -12
- package/dist/styles/dialog.css +52 -16
- package/dist/styles/environment-variables.css +19 -19
- package/dist/styles/field.css +184 -22
- package/dist/styles/fieldset.css +5 -4
- package/dist/styles/file-tree.css +17 -17
- package/dist/styles/index.css.d.ts +1 -0
- package/dist/styles/input.css +45 -11
- package/dist/styles/label.css +21 -4
- package/dist/styles/menu.css +55 -32
- package/dist/styles/menubar.css +80 -28
- package/dist/styles/message.css +22 -13
- package/dist/styles/meter.css +8 -8
- package/dist/styles/model-selector.css +33 -21
- package/dist/styles/navigation-menu.css +26 -24
- package/dist/styles/number-field.css +20 -18
- package/dist/styles/popover.css +38 -28
- package/dist/styles/preview-card.css +15 -13
- package/dist/styles/pricing-page.css +53 -53
- package/dist/styles/progress.css +7 -7
- package/dist/styles/prompt-input.css +73 -24
- package/dist/styles/queue.css +58 -32
- package/dist/styles/radio.css +26 -11
- package/dist/styles/reasoning.css +15 -11
- package/dist/styles/scroll-area.css +6 -6
- package/dist/styles/scrollbars.css +4 -4
- package/dist/styles/select.css +84 -25
- package/dist/styles/separator.css +1 -1
- package/dist/styles/shell.css +21 -20
- package/dist/styles/slider.css +35 -11
- package/dist/styles/sources.css +20 -20
- package/dist/styles/stepper.css +22 -22
- package/dist/styles/switch.css +29 -13
- package/dist/styles/tabs.css +23 -16
- package/dist/styles/task.css +27 -23
- package/dist/styles/terminal.css +16 -13
- package/dist/styles/test-results.css +79 -32
- package/dist/styles/toast.css +26 -25
- package/dist/styles/toggle-group.css +12 -12
- package/dist/styles/toggle.css +29 -11
- package/dist/styles/tool.css +54 -32
- package/dist/styles/toolbar.css +30 -28
- package/dist/styles/tooltip.css +10 -8
- package/dist/styles/web-preview.css +37 -21
- package/dist/utils/structured-code.d.ts +10 -0
- package/dist/utils/structured-code.js +81 -0
- package/package.json +16 -7
- package/dist/index.d.ts +0 -7236
- package/dist/index.js +0 -8945
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Autocomplete as Autocomplete$1 } from "@base-ui/react/autocomplete";
|
|
3
|
+
|
|
4
|
+
//#region src/components/Autocomplete.d.ts
|
|
5
|
+
declare function Input({
|
|
6
|
+
className,
|
|
7
|
+
ref,
|
|
8
|
+
...props
|
|
9
|
+
}: Omit<React.ComponentPropsWithRef<typeof Autocomplete$1.Input>, "className"> & {
|
|
10
|
+
className?: string;
|
|
11
|
+
} & {
|
|
12
|
+
ref?: React.Ref<HTMLInputElement>;
|
|
13
|
+
}): React.JSX.Element;
|
|
14
|
+
declare function Trigger({
|
|
15
|
+
className,
|
|
16
|
+
ref,
|
|
17
|
+
...props
|
|
18
|
+
}: Omit<React.ComponentPropsWithRef<typeof Autocomplete$1.Trigger>, "className"> & {
|
|
19
|
+
className?: string;
|
|
20
|
+
} & {
|
|
21
|
+
ref?: React.Ref<HTMLButtonElement>;
|
|
22
|
+
}): React.JSX.Element;
|
|
23
|
+
declare function Clear({
|
|
24
|
+
className,
|
|
25
|
+
ref,
|
|
26
|
+
...props
|
|
27
|
+
}: Omit<React.ComponentPropsWithRef<typeof Autocomplete$1.Clear>, "className"> & {
|
|
28
|
+
className?: string;
|
|
29
|
+
} & {
|
|
30
|
+
ref?: React.Ref<HTMLButtonElement>;
|
|
31
|
+
}): React.JSX.Element;
|
|
32
|
+
declare function Positioner({
|
|
33
|
+
className,
|
|
34
|
+
ref,
|
|
35
|
+
...props
|
|
36
|
+
}: Omit<React.ComponentPropsWithRef<typeof Autocomplete$1.Positioner>, "className"> & {
|
|
37
|
+
className?: string;
|
|
38
|
+
} & {
|
|
39
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
40
|
+
}): React.JSX.Element;
|
|
41
|
+
declare function Popup({
|
|
42
|
+
className,
|
|
43
|
+
ref,
|
|
44
|
+
...props
|
|
45
|
+
}: Omit<React.ComponentPropsWithRef<typeof Autocomplete$1.Popup>, "className"> & {
|
|
46
|
+
className?: string;
|
|
47
|
+
} & {
|
|
48
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
49
|
+
}): React.JSX.Element;
|
|
50
|
+
declare function List({
|
|
51
|
+
className,
|
|
52
|
+
ref,
|
|
53
|
+
...props
|
|
54
|
+
}: Omit<React.ComponentPropsWithRef<typeof Autocomplete$1.List>, "className"> & {
|
|
55
|
+
className?: string;
|
|
56
|
+
} & {
|
|
57
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
58
|
+
}): React.JSX.Element;
|
|
59
|
+
declare function Item({
|
|
60
|
+
className,
|
|
61
|
+
ref,
|
|
62
|
+
...props
|
|
63
|
+
}: Omit<React.ComponentPropsWithRef<typeof Autocomplete$1.Item>, "className"> & {
|
|
64
|
+
className?: string;
|
|
65
|
+
} & {
|
|
66
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
67
|
+
}): React.JSX.Element;
|
|
68
|
+
declare function Empty({
|
|
69
|
+
className,
|
|
70
|
+
ref,
|
|
71
|
+
...props
|
|
72
|
+
}: Omit<React.ComponentPropsWithRef<typeof Autocomplete$1.Empty>, "className"> & {
|
|
73
|
+
className?: string;
|
|
74
|
+
} & {
|
|
75
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
76
|
+
}): React.JSX.Element;
|
|
77
|
+
declare function Status({
|
|
78
|
+
className,
|
|
79
|
+
ref,
|
|
80
|
+
...props
|
|
81
|
+
}: Omit<React.ComponentPropsWithRef<typeof Autocomplete$1.Status>, "className"> & {
|
|
82
|
+
className?: string;
|
|
83
|
+
} & {
|
|
84
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
85
|
+
}): React.JSX.Element;
|
|
86
|
+
declare function Group({
|
|
87
|
+
className,
|
|
88
|
+
ref,
|
|
89
|
+
...props
|
|
90
|
+
}: Omit<React.ComponentPropsWithRef<typeof Autocomplete$1.Group>, "className"> & {
|
|
91
|
+
className?: string;
|
|
92
|
+
} & {
|
|
93
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
94
|
+
}): React.JSX.Element;
|
|
95
|
+
declare function GroupLabel({
|
|
96
|
+
className,
|
|
97
|
+
ref,
|
|
98
|
+
...props
|
|
99
|
+
}: Omit<React.ComponentPropsWithRef<typeof Autocomplete$1.GroupLabel>, "className"> & {
|
|
100
|
+
className?: string;
|
|
101
|
+
} & {
|
|
102
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
103
|
+
}): React.JSX.Element;
|
|
104
|
+
/**
|
|
105
|
+
* An input with a list of filtered options for auto-completion.
|
|
106
|
+
* Supports async search, grouping, and various autocomplete modes.
|
|
107
|
+
*
|
|
108
|
+
* @example
|
|
109
|
+
* ```tsx
|
|
110
|
+
* // Basic autocomplete
|
|
111
|
+
* const tags = ['React', 'Vue', 'Angular', 'Svelte'];
|
|
112
|
+
*
|
|
113
|
+
* <Autocomplete.Root items={tags}>
|
|
114
|
+
* <Autocomplete.Input placeholder="Search tags..." />
|
|
115
|
+
* <Autocomplete.Portal>
|
|
116
|
+
* <Autocomplete.Positioner>
|
|
117
|
+
* <Autocomplete.Popup>
|
|
118
|
+
* <Autocomplete.List>
|
|
119
|
+
* {(item) => (
|
|
120
|
+
* <Autocomplete.Item value={item}>
|
|
121
|
+
* {item}
|
|
122
|
+
* </Autocomplete.Item>
|
|
123
|
+
* )}
|
|
124
|
+
* </Autocomplete.List>
|
|
125
|
+
* <Autocomplete.Empty>No tags found</Autocomplete.Empty>
|
|
126
|
+
* </Autocomplete.Popup>
|
|
127
|
+
* </Autocomplete.Positioner>
|
|
128
|
+
* </Autocomplete.Portal>
|
|
129
|
+
* </Autocomplete.Root>
|
|
130
|
+
* ```
|
|
131
|
+
*
|
|
132
|
+
* @example
|
|
133
|
+
* ```tsx
|
|
134
|
+
* // With async search
|
|
135
|
+
* const [items, setItems] = useState([]);
|
|
136
|
+
* const [loading, setLoading] = useState(false);
|
|
137
|
+
*
|
|
138
|
+
* <Autocomplete.Root
|
|
139
|
+
* items={items}
|
|
140
|
+
* filter={null}
|
|
141
|
+
* onInputValueChange={async (value) => {
|
|
142
|
+
* setLoading(true);
|
|
143
|
+
* const results = await fetchResults(value);
|
|
144
|
+
* setItems(results);
|
|
145
|
+
* setLoading(false);
|
|
146
|
+
* }}
|
|
147
|
+
* >
|
|
148
|
+
* <Autocomplete.Input placeholder="Search..." />
|
|
149
|
+
* <Autocomplete.Portal>
|
|
150
|
+
* <Autocomplete.Positioner>
|
|
151
|
+
* <Autocomplete.Popup>
|
|
152
|
+
* <Autocomplete.Status>
|
|
153
|
+
* {loading ? 'Searching...' : null}
|
|
154
|
+
* </Autocomplete.Status>
|
|
155
|
+
* <Autocomplete.List>
|
|
156
|
+
* {(item) => (
|
|
157
|
+
* <Autocomplete.Item value={item}>
|
|
158
|
+
* {item.label}
|
|
159
|
+
* </Autocomplete.Item>
|
|
160
|
+
* )}
|
|
161
|
+
* </Autocomplete.List>
|
|
162
|
+
* </Autocomplete.Popup>
|
|
163
|
+
* </Autocomplete.Positioner>
|
|
164
|
+
* </Autocomplete.Portal>
|
|
165
|
+
* </Autocomplete.Root>
|
|
166
|
+
* ```
|
|
167
|
+
*
|
|
168
|
+
* @see {@link https://base-ui.com/react/components/autocomplete | Base UI Autocomplete}
|
|
169
|
+
*/
|
|
170
|
+
declare const Autocomplete: {
|
|
171
|
+
Root: typeof Autocomplete$1.Root;
|
|
172
|
+
Input: typeof Input;
|
|
173
|
+
Trigger: typeof Trigger;
|
|
174
|
+
Clear: typeof Clear;
|
|
175
|
+
Portal: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").AutocompletePortalProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
176
|
+
Positioner: typeof Positioner;
|
|
177
|
+
Popup: typeof Popup;
|
|
178
|
+
List: typeof List;
|
|
179
|
+
Item: typeof Item;
|
|
180
|
+
Empty: typeof Empty;
|
|
181
|
+
Status: typeof Status;
|
|
182
|
+
Group: typeof Group;
|
|
183
|
+
GroupLabel: typeof GroupLabel;
|
|
184
|
+
};
|
|
185
|
+
//#endregion
|
|
186
|
+
export { Autocomplete };
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Autocomplete as Autocomplete$1 } from "@base-ui/react/autocomplete";
|
|
4
|
+
//#region src/components/Autocomplete.tsx
|
|
5
|
+
function Input({ className = "", ref, ...props }) {
|
|
6
|
+
const classes = ["autocomplete__input", className].filter(Boolean).join(" ");
|
|
7
|
+
return /* @__PURE__ */ jsx(Autocomplete$1.Input, {
|
|
8
|
+
ref,
|
|
9
|
+
"data-slot": "autocomplete-input",
|
|
10
|
+
className: classes,
|
|
11
|
+
...props
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
function Trigger({ className = "", ref, ...props }) {
|
|
15
|
+
const classes = ["autocomplete__trigger", className].filter(Boolean).join(" ");
|
|
16
|
+
return /* @__PURE__ */ jsx(Autocomplete$1.Trigger, {
|
|
17
|
+
ref,
|
|
18
|
+
"data-slot": "autocomplete-trigger",
|
|
19
|
+
className: classes,
|
|
20
|
+
...props
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function Clear({ className = "", ref, ...props }) {
|
|
24
|
+
const classes = ["autocomplete__clear", className].filter(Boolean).join(" ");
|
|
25
|
+
return /* @__PURE__ */ jsx(Autocomplete$1.Clear, {
|
|
26
|
+
ref,
|
|
27
|
+
"data-slot": "autocomplete-clear",
|
|
28
|
+
className: classes,
|
|
29
|
+
...props
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
function Positioner({ className = "", ref, ...props }) {
|
|
33
|
+
const classes = ["autocomplete__positioner", className].filter(Boolean).join(" ");
|
|
34
|
+
return /* @__PURE__ */ jsx(Autocomplete$1.Positioner, {
|
|
35
|
+
ref,
|
|
36
|
+
"data-slot": "autocomplete-positioner",
|
|
37
|
+
className: classes,
|
|
38
|
+
...props
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
function Popup({ className = "", ref, ...props }) {
|
|
42
|
+
const classes = ["autocomplete__popup", className].filter(Boolean).join(" ");
|
|
43
|
+
return /* @__PURE__ */ jsx(Autocomplete$1.Popup, {
|
|
44
|
+
ref,
|
|
45
|
+
"data-slot": "autocomplete-content",
|
|
46
|
+
className: classes,
|
|
47
|
+
...props
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
function List({ className = "", ref, ...props }) {
|
|
51
|
+
const classes = ["autocomplete__list", className].filter(Boolean).join(" ");
|
|
52
|
+
return /* @__PURE__ */ jsx(Autocomplete$1.List, {
|
|
53
|
+
ref,
|
|
54
|
+
"data-slot": "autocomplete-list",
|
|
55
|
+
className: classes,
|
|
56
|
+
...props
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
function Item({ className = "", ref, ...props }) {
|
|
60
|
+
const classes = ["autocomplete__item", className].filter(Boolean).join(" ");
|
|
61
|
+
return /* @__PURE__ */ jsx(Autocomplete$1.Item, {
|
|
62
|
+
ref,
|
|
63
|
+
"data-slot": "autocomplete-item",
|
|
64
|
+
className: classes,
|
|
65
|
+
...props
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
function Empty({ className = "", ref, ...props }) {
|
|
69
|
+
const classes = ["autocomplete__empty", className].filter(Boolean).join(" ");
|
|
70
|
+
return /* @__PURE__ */ jsx(Autocomplete$1.Empty, {
|
|
71
|
+
ref,
|
|
72
|
+
"data-slot": "autocomplete-empty",
|
|
73
|
+
className: classes,
|
|
74
|
+
...props
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
function Status({ className = "", ref, ...props }) {
|
|
78
|
+
const classes = ["autocomplete__status", className].filter(Boolean).join(" ");
|
|
79
|
+
return /* @__PURE__ */ jsx(Autocomplete$1.Status, {
|
|
80
|
+
ref,
|
|
81
|
+
"data-slot": "autocomplete-status",
|
|
82
|
+
className: classes,
|
|
83
|
+
...props
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
function Group({ className = "", ref, ...props }) {
|
|
87
|
+
const classes = ["autocomplete__group", className].filter(Boolean).join(" ");
|
|
88
|
+
return /* @__PURE__ */ jsx(Autocomplete$1.Group, {
|
|
89
|
+
ref,
|
|
90
|
+
"data-slot": "autocomplete-group",
|
|
91
|
+
className: classes,
|
|
92
|
+
...props
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
function GroupLabel({ className = "", ref, ...props }) {
|
|
96
|
+
const classes = ["autocomplete__group-label", className].filter(Boolean).join(" ");
|
|
97
|
+
return /* @__PURE__ */ jsx(Autocomplete$1.GroupLabel, {
|
|
98
|
+
ref,
|
|
99
|
+
"data-slot": "autocomplete-group-label",
|
|
100
|
+
className: classes,
|
|
101
|
+
...props
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* An input with a list of filtered options for auto-completion.
|
|
106
|
+
* Supports async search, grouping, and various autocomplete modes.
|
|
107
|
+
*
|
|
108
|
+
* @example
|
|
109
|
+
* ```tsx
|
|
110
|
+
* // Basic autocomplete
|
|
111
|
+
* const tags = ['React', 'Vue', 'Angular', 'Svelte'];
|
|
112
|
+
*
|
|
113
|
+
* <Autocomplete.Root items={tags}>
|
|
114
|
+
* <Autocomplete.Input placeholder="Search tags..." />
|
|
115
|
+
* <Autocomplete.Portal>
|
|
116
|
+
* <Autocomplete.Positioner>
|
|
117
|
+
* <Autocomplete.Popup>
|
|
118
|
+
* <Autocomplete.List>
|
|
119
|
+
* {(item) => (
|
|
120
|
+
* <Autocomplete.Item value={item}>
|
|
121
|
+
* {item}
|
|
122
|
+
* </Autocomplete.Item>
|
|
123
|
+
* )}
|
|
124
|
+
* </Autocomplete.List>
|
|
125
|
+
* <Autocomplete.Empty>No tags found</Autocomplete.Empty>
|
|
126
|
+
* </Autocomplete.Popup>
|
|
127
|
+
* </Autocomplete.Positioner>
|
|
128
|
+
* </Autocomplete.Portal>
|
|
129
|
+
* </Autocomplete.Root>
|
|
130
|
+
* ```
|
|
131
|
+
*
|
|
132
|
+
* @example
|
|
133
|
+
* ```tsx
|
|
134
|
+
* // With async search
|
|
135
|
+
* const [items, setItems] = useState([]);
|
|
136
|
+
* const [loading, setLoading] = useState(false);
|
|
137
|
+
*
|
|
138
|
+
* <Autocomplete.Root
|
|
139
|
+
* items={items}
|
|
140
|
+
* filter={null}
|
|
141
|
+
* onInputValueChange={async (value) => {
|
|
142
|
+
* setLoading(true);
|
|
143
|
+
* const results = await fetchResults(value);
|
|
144
|
+
* setItems(results);
|
|
145
|
+
* setLoading(false);
|
|
146
|
+
* }}
|
|
147
|
+
* >
|
|
148
|
+
* <Autocomplete.Input placeholder="Search..." />
|
|
149
|
+
* <Autocomplete.Portal>
|
|
150
|
+
* <Autocomplete.Positioner>
|
|
151
|
+
* <Autocomplete.Popup>
|
|
152
|
+
* <Autocomplete.Status>
|
|
153
|
+
* {loading ? 'Searching...' : null}
|
|
154
|
+
* </Autocomplete.Status>
|
|
155
|
+
* <Autocomplete.List>
|
|
156
|
+
* {(item) => (
|
|
157
|
+
* <Autocomplete.Item value={item}>
|
|
158
|
+
* {item.label}
|
|
159
|
+
* </Autocomplete.Item>
|
|
160
|
+
* )}
|
|
161
|
+
* </Autocomplete.List>
|
|
162
|
+
* </Autocomplete.Popup>
|
|
163
|
+
* </Autocomplete.Positioner>
|
|
164
|
+
* </Autocomplete.Portal>
|
|
165
|
+
* </Autocomplete.Root>
|
|
166
|
+
* ```
|
|
167
|
+
*
|
|
168
|
+
* @see {@link https://base-ui.com/react/components/autocomplete | Base UI Autocomplete}
|
|
169
|
+
*/
|
|
170
|
+
const Autocomplete = {
|
|
171
|
+
Root: Autocomplete$1.Root,
|
|
172
|
+
Input,
|
|
173
|
+
Trigger,
|
|
174
|
+
Clear,
|
|
175
|
+
Portal: Autocomplete$1.Portal,
|
|
176
|
+
Positioner,
|
|
177
|
+
Popup,
|
|
178
|
+
List,
|
|
179
|
+
Item,
|
|
180
|
+
Empty,
|
|
181
|
+
Status,
|
|
182
|
+
Group,
|
|
183
|
+
GroupLabel
|
|
184
|
+
};
|
|
185
|
+
//#endregion
|
|
186
|
+
export { Autocomplete };
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Avatar as Avatar$1 } from "@base-ui/react/avatar";
|
|
3
|
+
|
|
4
|
+
//#region src/components/Avatar.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Props for the Avatar.Root component.
|
|
7
|
+
*/
|
|
8
|
+
interface AvatarRootProps extends Omit<React.ComponentPropsWithoutRef<typeof Avatar$1.Root>, "className"> {
|
|
9
|
+
/** Additional CSS class names */
|
|
10
|
+
className?: string;
|
|
11
|
+
size?: "default" | "sm" | "lg";
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Props for the Avatar.Image component.
|
|
15
|
+
*/
|
|
16
|
+
interface AvatarImageProps extends Omit<React.ComponentPropsWithoutRef<typeof Avatar$1.Image>, "className"> {
|
|
17
|
+
/** Additional CSS class names */
|
|
18
|
+
className?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Props for the Avatar.Fallback component.
|
|
22
|
+
*/
|
|
23
|
+
interface AvatarFallbackProps extends Omit<React.ComponentPropsWithoutRef<typeof Avatar$1.Fallback>, "className"> {
|
|
24
|
+
/** Additional CSS class names */
|
|
25
|
+
className?: string;
|
|
26
|
+
}
|
|
27
|
+
interface AvatarGroupProps extends React.HTMLAttributes<HTMLDivElement> {}
|
|
28
|
+
interface AvatarGroupCountProps extends React.HTMLAttributes<HTMLDivElement> {}
|
|
29
|
+
interface AvatarBadgeProps extends React.HTMLAttributes<HTMLSpanElement> {}
|
|
30
|
+
/**
|
|
31
|
+
* Container for the avatar. Renders a `<span>` element.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```tsx
|
|
35
|
+
* <Avatar.Root>
|
|
36
|
+
* <Avatar.Image src="/photo.jpg" alt="User" />
|
|
37
|
+
* <Avatar.Fallback>JD</Avatar.Fallback>
|
|
38
|
+
* </Avatar.Root>
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* @see {@link https://base-ui.com/react/components/avatar | Base UI Avatar}
|
|
42
|
+
*/
|
|
43
|
+
declare function AvatarRoot({
|
|
44
|
+
className,
|
|
45
|
+
size,
|
|
46
|
+
ref,
|
|
47
|
+
...props
|
|
48
|
+
}: AvatarRootProps & {
|
|
49
|
+
ref?: React.Ref<HTMLSpanElement>;
|
|
50
|
+
}): React.JSX.Element;
|
|
51
|
+
/**
|
|
52
|
+
* Displays the avatar image. Renders an `<img>` element.
|
|
53
|
+
*/
|
|
54
|
+
declare function AvatarImage({
|
|
55
|
+
className,
|
|
56
|
+
ref,
|
|
57
|
+
...props
|
|
58
|
+
}: AvatarImageProps & {
|
|
59
|
+
ref?: React.Ref<HTMLImageElement>;
|
|
60
|
+
}): React.JSX.Element;
|
|
61
|
+
/**
|
|
62
|
+
* Displays when the image fails to load or isn't provided.
|
|
63
|
+
* Typically contains initials or an icon. Renders a `<span>` element.
|
|
64
|
+
*/
|
|
65
|
+
declare function AvatarFallback({
|
|
66
|
+
className,
|
|
67
|
+
ref,
|
|
68
|
+
...props
|
|
69
|
+
}: AvatarFallbackProps & {
|
|
70
|
+
ref?: React.Ref<HTMLSpanElement>;
|
|
71
|
+
}): React.JSX.Element;
|
|
72
|
+
declare function AvatarGroup({
|
|
73
|
+
className,
|
|
74
|
+
ref,
|
|
75
|
+
...props
|
|
76
|
+
}: AvatarGroupProps & {
|
|
77
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
78
|
+
}): React.JSX.Element;
|
|
79
|
+
declare function AvatarGroupCount({
|
|
80
|
+
className,
|
|
81
|
+
ref,
|
|
82
|
+
...props
|
|
83
|
+
}: AvatarGroupCountProps & {
|
|
84
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
85
|
+
}): React.JSX.Element;
|
|
86
|
+
declare function AvatarBadge({
|
|
87
|
+
className,
|
|
88
|
+
ref,
|
|
89
|
+
...props
|
|
90
|
+
}: AvatarBadgeProps & {
|
|
91
|
+
ref?: React.Ref<HTMLSpanElement>;
|
|
92
|
+
}): React.JSX.Element;
|
|
93
|
+
/**
|
|
94
|
+
* An avatar component for displaying user profile pictures with fallback support.
|
|
95
|
+
* Shows initials or an icon when the image fails to load or isn't provided.
|
|
96
|
+
*
|
|
97
|
+
* @example
|
|
98
|
+
* ```tsx
|
|
99
|
+
* // With image
|
|
100
|
+
* <Avatar.Root>
|
|
101
|
+
* <Avatar.Image src="/profile.jpg" alt="John Doe" />
|
|
102
|
+
* <Avatar.Fallback>JD</Avatar.Fallback>
|
|
103
|
+
* </Avatar.Root>
|
|
104
|
+
* ```
|
|
105
|
+
*
|
|
106
|
+
* @example
|
|
107
|
+
* ```tsx
|
|
108
|
+
* // Fallback only (no image)
|
|
109
|
+
* <Avatar.Root>
|
|
110
|
+
* <Avatar.Fallback>AB</Avatar.Fallback>
|
|
111
|
+
* </Avatar.Root>
|
|
112
|
+
* ```
|
|
113
|
+
*
|
|
114
|
+
* @example
|
|
115
|
+
* ```tsx
|
|
116
|
+
* // With delayed fallback
|
|
117
|
+
* <Avatar.Root>
|
|
118
|
+
* <Avatar.Image src="/slow-loading.jpg" alt="User" />
|
|
119
|
+
* <Avatar.Fallback delay={500}>?</Avatar.Fallback>
|
|
120
|
+
* </Avatar.Root>
|
|
121
|
+
* ```
|
|
122
|
+
*
|
|
123
|
+
* @see {@link https://base-ui.com/react/components/avatar | Base UI Avatar}
|
|
124
|
+
*/
|
|
125
|
+
declare const Avatar: typeof AvatarRoot & {
|
|
126
|
+
Root: typeof AvatarRoot;
|
|
127
|
+
Image: typeof AvatarImage;
|
|
128
|
+
Fallback: typeof AvatarFallback;
|
|
129
|
+
Group: typeof AvatarGroup;
|
|
130
|
+
GroupCount: typeof AvatarGroupCount;
|
|
131
|
+
Badge: typeof AvatarBadge;
|
|
132
|
+
};
|
|
133
|
+
//#endregion
|
|
134
|
+
export { Avatar, AvatarBadge, AvatarBadgeProps, AvatarFallback, AvatarFallbackProps, AvatarGroup, AvatarGroupCount, AvatarGroupCountProps, AvatarGroupProps, AvatarImage, AvatarImageProps, AvatarRoot, AvatarRootProps };
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Avatar as Avatar$1 } from "@base-ui/react/avatar";
|
|
4
|
+
//#region src/components/Avatar.tsx
|
|
5
|
+
/**
|
|
6
|
+
* Container for the avatar. Renders a `<span>` element.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* <Avatar.Root>
|
|
11
|
+
* <Avatar.Image src="/photo.jpg" alt="User" />
|
|
12
|
+
* <Avatar.Fallback>JD</Avatar.Fallback>
|
|
13
|
+
* </Avatar.Root>
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* @see {@link https://base-ui.com/react/components/avatar | Base UI Avatar}
|
|
17
|
+
*/
|
|
18
|
+
function AvatarRoot({ className = "", size = "default", ref, ...props }) {
|
|
19
|
+
const classes = ["avatar", className].filter(Boolean).join(" ");
|
|
20
|
+
return /* @__PURE__ */ jsx(Avatar$1.Root, {
|
|
21
|
+
ref,
|
|
22
|
+
"data-slot": "avatar",
|
|
23
|
+
"data-size": size,
|
|
24
|
+
className: classes,
|
|
25
|
+
...props
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Displays the avatar image. Renders an `<img>` element.
|
|
30
|
+
*/
|
|
31
|
+
function AvatarImage({ className = "", ref, ...props }) {
|
|
32
|
+
const classes = ["avatar__image", className].filter(Boolean).join(" ");
|
|
33
|
+
return /* @__PURE__ */ jsx(Avatar$1.Image, {
|
|
34
|
+
ref,
|
|
35
|
+
"data-slot": "avatar-image",
|
|
36
|
+
className: classes,
|
|
37
|
+
...props
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Displays when the image fails to load or isn't provided.
|
|
42
|
+
* Typically contains initials or an icon. Renders a `<span>` element.
|
|
43
|
+
*/
|
|
44
|
+
function AvatarFallback({ className = "", ref, ...props }) {
|
|
45
|
+
const classes = ["avatar__fallback", className].filter(Boolean).join(" ");
|
|
46
|
+
return /* @__PURE__ */ jsx(Avatar$1.Fallback, {
|
|
47
|
+
ref,
|
|
48
|
+
"data-slot": "avatar-fallback",
|
|
49
|
+
className: classes,
|
|
50
|
+
...props
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
function AvatarGroup({ className = "", ref, ...props }) {
|
|
54
|
+
return /* @__PURE__ */ jsx("div", {
|
|
55
|
+
ref,
|
|
56
|
+
"data-slot": "avatar-group",
|
|
57
|
+
className: ["avatar-group", className].filter(Boolean).join(" "),
|
|
58
|
+
...props
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
function AvatarGroupCount({ className = "", ref, ...props }) {
|
|
62
|
+
return /* @__PURE__ */ jsx("div", {
|
|
63
|
+
ref,
|
|
64
|
+
"data-slot": "avatar-group-count",
|
|
65
|
+
className: ["avatar-group__count", className].filter(Boolean).join(" "),
|
|
66
|
+
...props
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
function AvatarBadge({ className = "", ref, ...props }) {
|
|
70
|
+
return /* @__PURE__ */ jsx("span", {
|
|
71
|
+
ref,
|
|
72
|
+
"data-slot": "avatar-badge",
|
|
73
|
+
className: ["avatar__badge", className].filter(Boolean).join(" "),
|
|
74
|
+
...props
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* An avatar component for displaying user profile pictures with fallback support.
|
|
79
|
+
* Shows initials or an icon when the image fails to load or isn't provided.
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* ```tsx
|
|
83
|
+
* // With image
|
|
84
|
+
* <Avatar.Root>
|
|
85
|
+
* <Avatar.Image src="/profile.jpg" alt="John Doe" />
|
|
86
|
+
* <Avatar.Fallback>JD</Avatar.Fallback>
|
|
87
|
+
* </Avatar.Root>
|
|
88
|
+
* ```
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* ```tsx
|
|
92
|
+
* // Fallback only (no image)
|
|
93
|
+
* <Avatar.Root>
|
|
94
|
+
* <Avatar.Fallback>AB</Avatar.Fallback>
|
|
95
|
+
* </Avatar.Root>
|
|
96
|
+
* ```
|
|
97
|
+
*
|
|
98
|
+
* @example
|
|
99
|
+
* ```tsx
|
|
100
|
+
* // With delayed fallback
|
|
101
|
+
* <Avatar.Root>
|
|
102
|
+
* <Avatar.Image src="/slow-loading.jpg" alt="User" />
|
|
103
|
+
* <Avatar.Fallback delay={500}>?</Avatar.Fallback>
|
|
104
|
+
* </Avatar.Root>
|
|
105
|
+
* ```
|
|
106
|
+
*
|
|
107
|
+
* @see {@link https://base-ui.com/react/components/avatar | Base UI Avatar}
|
|
108
|
+
*/
|
|
109
|
+
const Avatar = Object.assign(AvatarRoot, {
|
|
110
|
+
Root: AvatarRoot,
|
|
111
|
+
Image: AvatarImage,
|
|
112
|
+
Fallback: AvatarFallback,
|
|
113
|
+
Group: AvatarGroup,
|
|
114
|
+
GroupCount: AvatarGroupCount,
|
|
115
|
+
Badge: AvatarBadge
|
|
116
|
+
});
|
|
117
|
+
//#endregion
|
|
118
|
+
export { Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, AvatarRoot };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/components/Badge.d.ts
|
|
4
|
+
type BadgeVariant = "normal" | "outline" | "ghost" | "link";
|
|
5
|
+
type BadgeColor = "neutral" | "primary" | "success" | "destructive" | "warning";
|
|
6
|
+
type ShadcnBadgeVariant = "default" | "secondary" | "destructive" | "outline" | "ghost" | "link";
|
|
7
|
+
interface BadgeVariantsOptions {
|
|
8
|
+
variant?: ShadcnBadgeVariant | BadgeVariant | null;
|
|
9
|
+
color?: BadgeColor | null;
|
|
10
|
+
size?: "sm" | "md" | null;
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
declare function badgeVariants({
|
|
14
|
+
variant,
|
|
15
|
+
color,
|
|
16
|
+
size,
|
|
17
|
+
className
|
|
18
|
+
}?: BadgeVariantsOptions): string;
|
|
19
|
+
interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
20
|
+
/**
|
|
21
|
+
* The visual rendering style of the badge.
|
|
22
|
+
* @default 'default'
|
|
23
|
+
*/
|
|
24
|
+
variant?: ShadcnBadgeVariant | BadgeVariant;
|
|
25
|
+
/**
|
|
26
|
+
* The semantic color intent of the badge.
|
|
27
|
+
* @default 'primary'
|
|
28
|
+
*/
|
|
29
|
+
color?: BadgeColor;
|
|
30
|
+
/**
|
|
31
|
+
* The size of the badge.
|
|
32
|
+
* @default 'md'
|
|
33
|
+
*/
|
|
34
|
+
size?: "sm" | "md";
|
|
35
|
+
/**
|
|
36
|
+
* Render the badge styles onto the child element.
|
|
37
|
+
*
|
|
38
|
+
* Mirrors shadcn's `asChild` API for link badges and custom elements.
|
|
39
|
+
* @default false
|
|
40
|
+
*/
|
|
41
|
+
asChild?: boolean;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* A badge component for highlighting status, labels, or categories.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```tsx
|
|
48
|
+
* <Badge>Default</Badge>
|
|
49
|
+
* <Badge color="success">Active</Badge>
|
|
50
|
+
* <Badge color="warning">Pending</Badge>
|
|
51
|
+
* <Badge variant="outline">Info</Badge>
|
|
52
|
+
* <Badge asChild><a href="/docs">Docs</a></Badge>
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
declare function Badge({
|
|
56
|
+
variant,
|
|
57
|
+
color,
|
|
58
|
+
size,
|
|
59
|
+
className,
|
|
60
|
+
asChild,
|
|
61
|
+
children,
|
|
62
|
+
ref,
|
|
63
|
+
...props
|
|
64
|
+
}: BadgeProps & {
|
|
65
|
+
ref?: React.Ref<HTMLSpanElement>;
|
|
66
|
+
}): React.JSX.Element;
|
|
67
|
+
//#endregion
|
|
68
|
+
export { Badge, BadgeColor, BadgeProps, BadgeVariant, BadgeVariantsOptions, ShadcnBadgeVariant, badgeVariants };
|