moi-computer 0.11.0 → 0.11.1-dev.be1ed10
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/README.md +2 -2
- package/client/AGENTS.md +2 -2
- package/client/app/AppRouter.tsx +2 -2
- package/client/app/routes/WorkspaceRoute.tsx +7 -9
- package/client/app/shell/SidebarLayout.tsx +18 -15
- package/client/components/shared/BottomPanel.tsx +26 -14
- package/client/components/shared/PanelHeader.tsx +1 -1
- package/client/components/shared/ReorderableList.tsx +7 -2
- package/client/components/shared/WorkspaceIcon.tsx +92 -0
- package/client/components/ui/alert-dialog.tsx +1 -0
- package/client/components/ui/button.tsx +1 -53
- package/client/components/ui/checkbox.tsx +1 -0
- package/client/components/ui/collapsible.tsx +1 -15
- package/client/components/ui/dialog.tsx +1 -58
- package/client/components/ui/dropdown-menu.tsx +1 -254
- package/client/components/ui/hover-card.tsx +1 -44
- package/client/components/ui/inline-input.tsx +84 -0
- package/client/components/ui/input.tsx +1 -21
- package/client/components/ui/popover.tsx +1 -88
- package/client/components/ui/resizable.tsx +1 -40
- package/client/components/ui/skeleton.tsx +1 -13
- package/client/components/ui/slider.tsx +1 -70
- package/client/components/ui/spinner.tsx +1 -18
- package/client/components/ui/switch.tsx +1 -23
- package/client/components/ui/tabs.tsx +1 -0
- package/client/components/ui/textarea.tsx +1 -18
- package/client/components/ui/toast.tsx +2 -2
- package/client/components/ui/tooltip.tsx +1 -51
- package/client/features/applets/AppletMount.tsx +1 -1
- package/client/features/applets/applet-cache.ts +3 -3
- package/client/features/applets/applet-runtime.ts +147 -108
- package/client/features/applets/applet-styles.ts +2 -2
- package/client/features/applets/applet-thumbnail.ts +6 -8
- package/client/features/applets/useApplet.ts +10 -9
- package/client/features/chat/ChatPanel.tsx +24 -15
- package/client/features/chat/ChatPopup.tsx +9 -5
- package/client/features/chat/applet-chat-intents.ts +170 -0
- package/client/features/chat/chat-send.ts +116 -64
- package/client/features/chat/chat-store.ts +51 -62
- package/client/features/chat/composer/ChatComposer.tsx +43 -128
- package/client/features/chat/composer/ModelPicker.tsx +47 -60
- package/client/features/chat/composer/attachments/AttachmentChip.tsx +99 -0
- package/client/features/chat/composer/attachments/DrawingAttachmentChip.tsx +37 -0
- package/client/features/chat/composer/attachments/FileAttachmentChip.tsx +22 -0
- package/client/features/chat/composer/attachments/TextAttachmentChip.tsx +11 -0
- package/client/features/chat/composer/attachments/draft-attachments.ts +168 -0
- package/client/features/chat/composer/attachments/types.ts +25 -0
- package/client/features/chat/composer/attachments/uploads.ts +26 -0
- package/client/features/chat/composer/banners/ErrorBanner.tsx +20 -12
- package/client/features/chat/composer/model-order.ts +15 -0
- package/client/features/chat/composer/useWorkspaceComposerState.tsx +15 -7
- package/client/features/chat/{chat-connection.ts → connection/chat-connection.ts} +1 -1
- package/client/features/chat/{chat-frames.ts → connection/chat-frames.ts} +10 -8
- package/client/features/chat/{ChatEmptyState.tsx → messages/ChatEmptyState.tsx} +16 -11
- package/client/features/chat/{MarkdownContent.tsx → messages/MarkdownContent.tsx} +16 -1
- package/client/features/chat/{TurnView.tsx → messages/TurnView.tsx} +27 -19
- package/client/features/chat/{group-turns.ts → messages/group-turns.ts} +12 -0
- package/client/features/chat/{interleave-notices.ts → messages/interleave-notices.ts} +7 -11
- package/client/features/chat/{tool-group → messages/tool-group}/SubagentCard.tsx +1 -1
- package/client/features/chat/{tool-group → messages/tool-group}/TimelineRow.tsx +2 -2
- package/client/features/chat/{tool-group → messages/tool-group}/ToolCallGroup.tsx +2 -5
- package/client/features/chat/{tool-group → messages/tool-group}/format/codex.ts +4 -1
- package/client/features/chat/{ChatSelector.tsx → sessions/ChatSelector.tsx} +3 -3
- package/client/features/chat/{api.ts → sessions/api.ts} +5 -14
- package/client/features/chat/sessions/session-view.ts +53 -0
- package/client/features/chat/useChat.ts +42 -24
- package/client/features/dev/ChatStatesPage.tsx +8 -7
- package/client/features/dev/DevIndexPage.tsx +5 -0
- package/client/features/dev/DevRoutes.tsx +2 -0
- package/client/features/dev/HarnessDebugPage.tsx +11 -8
- package/client/features/dev/ToolCallsPage.tsx +1 -1
- package/client/features/dev/UiComponentPreviews.tsx +855 -0
- package/client/features/dev/UiComponentsPage.tsx +60 -0
- package/client/features/dev/chat-states-fixtures.ts +13 -2
- package/client/features/drawings/useChatAnnotation.ts +17 -17
- package/client/features/drawings/useDrawingLayer.ts +7 -9
- package/client/features/drawings/useViewBuilderSketch.ts +18 -15
- package/client/features/home/HomePage.tsx +8 -7
- package/client/features/home/WorkspacePreview.tsx +2 -2
- package/client/features/home/workspace-presentation.tsx +1 -11
- package/client/features/home/workspace-setup/DemoDialog.tsx +3 -2
- package/client/features/home/workspace-setup/ImportWorkspaceDialog.tsx +5 -8
- package/client/features/home/workspace-setup/WorkspaceAgentStep.tsx +2 -4
- package/client/features/home/workspace-setup/WorkspaceDialogContent.tsx +7 -20
- package/client/features/overview/HiddenPanel.tsx +109 -0
- package/client/features/overview/Overview.tsx +302 -0
- package/client/features/overview/WidgetCanvas.tsx +164 -0
- package/client/features/{widgets → overview}/WidgetFrame.tsx +25 -17
- package/client/features/overview/WorkspaceName.tsx +60 -0
- package/client/features/overview/api.ts +30 -0
- package/client/features/overview/default/ViewsWidget.tsx +252 -0
- package/client/features/overview/default/registry.tsx +36 -0
- package/client/features/{widgets → overview}/grid.ts +36 -0
- package/client/features/overview/useGridReconcile.ts +94 -0
- package/client/features/scratchpad/Scratchpad.tsx +7 -8
- package/client/features/scratchpad/ScratchpadControls.tsx +0 -1
- package/client/features/scratchpad/useScratchpadSnapshot.tsx +23 -13
- package/client/features/settings/GeneralSettings.tsx +55 -58
- package/client/features/settings/SettingsLayout.tsx +2 -2
- package/client/features/settings/WorkspaceIconPicker.tsx +318 -0
- package/client/features/settings/WorkspaceSettingsDialog.tsx +65 -0
- package/client/features/settings/api.ts +48 -24
- package/client/features/views/ViewBuilder.tsx +5 -4
- package/client/features/views/ViewManager.tsx +25 -22
- package/client/features/views/api.ts +36 -2
- package/client/features/views/useViewBuilderActions.ts +8 -5
- package/client/features/views/useViewBuilderDrafts.ts +23 -21
- package/client/features/views/view-presentation.ts +13 -0
- package/client/features/workspace/{CustomizePanel.tsx → ThemePanel.tsx} +26 -31
- package/client/features/workspace/UnavailablePage.tsx +21 -0
- package/client/features/workspace/WorkspaceLayoutContext.tsx +4 -7
- package/client/features/workspace/WorkspaceScreen.tsx +210 -162
- package/client/features/workspace/WorkspaceSplitLayout.tsx +7 -2
- package/client/features/workspace/WorkspaceTabs.tsx +2 -0
- package/client/features/workspace/api.ts +2 -30
- package/client/features/workspace/moi-context.ts +8 -9
- package/client/features/workspace/tab-resolution.ts +10 -33
- package/client/features/workspace/useWorkspaceNavigation.ts +164 -101
- package/client/index.css +23 -30
- package/client/lib/app-icon-registry.ts +2 -0
- package/client/lib/use-latest-ref.ts +11 -0
- package/client/main.tsx +1 -1
- package/client/runtime/useWorkspaceEvents.ts +59 -14
- package/client/theme.css +5 -5
- package/dist/{chunk-tqd3pkg8.css → chunk-60q353jq.css} +1 -1
- package/dist/chunk-691pqsj6.js +2 -0
- package/dist/chunk-7a5nm4k9.css +1 -0
- package/dist/chunk-amb8y04y.js +1 -0
- package/dist/chunk-cf3pgy7j.js +546 -0
- package/dist/{chunk-11cab5dq.css → chunk-cq2r11fg.css} +1 -1
- package/dist/chunk-mzrgr577.js +5 -0
- package/dist/chunk-nf2wkvf9.js +14 -0
- package/dist/chunk-q6a0g26x.js +1 -0
- package/dist/chunk-twgdemkc.js +74 -0
- package/dist/chunk-x90k0f5c.js +2 -0
- package/dist/chunk-yq00csvd.js +2 -0
- package/dist/index.html +1 -1
- package/lib/app-icons.ts +1 -0
- package/lib/applet-selector.ts +24 -0
- package/lib/chat-title.ts +6 -1
- package/lib/default-widgets.ts +32 -0
- package/lib/format.ts +67 -7
- package/lib/message-attachments.ts +40 -0
- package/lib/moi-attachments.ts +204 -0
- package/lib/moi-context.ts +20 -35
- package/lib/navigation.ts +84 -0
- package/lib/themes.ts +6 -6
- package/lib/types.ts +91 -34
- package/lib/workspace-icon.ts +20 -0
- package/lib/workspace-layout.ts +22 -2
- package/lib/workspace-tabs.ts +9 -33
- package/package.json +42 -32
- package/registry.json +656 -0
- package/server/AGENTS.md +2 -0
- package/server/agent.ts +1 -1
- package/server/api.ts +139 -66
- package/server/applet-typecheck.ts +95 -0
- package/server/applets/applet-css.ts +55 -0
- package/server/{bundler → applets}/build-applet.ts +13 -242
- package/server/applets/build-worker.ts +178 -0
- package/server/applets/config.ts +226 -0
- package/server/applets/dependencies.ts +206 -0
- package/server/{applets.ts → applets/index.ts} +44 -189
- package/server/applets/runtime/base.ts +4 -0
- package/server/applets/runtime/moi.ts +42 -0
- package/server/applets/runtime/rpc.ts +17 -0
- package/server/applets/view-source.ts +67 -0
- package/server/attachment-message.ts +95 -0
- package/server/cli-ui-components.ts +28 -33
- package/server/cli.ts +169 -108
- package/server/control.ts +63 -42
- package/server/data-dir.ts +1 -1
- package/server/harness/README.md +45 -50
- package/server/harness/acp/NOTES.md +426 -0
- package/server/harness/acp/adapter.ts +7 -21
- package/server/harness/acp/discovery.ts +27 -30
- package/server/harness/acp/model-state.ts +57 -0
- package/server/harness/acp/session.ts +49 -56
- package/server/harness/claude-code/NOTES.md +54 -13
- package/server/harness/claude-code/adapter.ts +8 -25
- package/server/harness/claude-code/cli.ts +40 -0
- package/server/harness/claude-code/index.ts +13 -5
- package/server/harness/claude-code/models.ts +72 -19
- package/server/harness/claude-code/session.ts +447 -343
- package/server/harness/claude-code/sessions.ts +9 -4
- package/server/harness/codex/NOTES.md +222 -350
- package/server/harness/codex/adapter.ts +102 -52
- package/server/harness/codex/auth.ts +1 -3
- package/server/harness/codex/client.ts +169 -249
- package/server/harness/codex/discovery.ts +9 -17
- package/server/harness/codex/index.ts +3 -1
- package/server/harness/codex/pagination.ts +24 -0
- package/server/harness/codex/permissions.ts +32 -8
- package/server/harness/codex/probe.ts +10 -13
- package/server/harness/codex/session.ts +567 -181
- package/server/harness/codex/transport.ts +184 -0
- package/server/harness/debug.ts +1 -1
- package/server/harness/hermes/NOTES.md +19 -1
- package/server/harness/hermes/discovery.ts +20 -0
- package/server/harness/hermes/index.ts +13 -0
- package/server/harness/hermes/models.ts +28 -8
- package/server/harness/openclaw/NOTES.md +1 -1
- package/server/harness/openclaw/adapter.ts +22 -4
- package/server/harness/openclaw/gateway.ts +5 -3
- package/server/harness/openclaw/session.ts +27 -27
- package/server/harness/types.ts +9 -5
- package/server/layout.ts +9 -14
- package/server/moi-scaffold.ts +22 -14
- package/server/navigation-relay.ts +110 -0
- package/server/preview.ts +3 -1
- package/server/registry.ts +71 -41
- package/server/scratchpad-executor.ts +79 -56
- package/server/scratchpad-shape-defaults.ts +82 -0
- package/server/selected-session.ts +24 -4
- package/server/skill-update.ts +5 -3
- package/server/skill-version.ts +4 -7
- package/server/skills-template.ts +48 -9
- package/server/tabs.ts +19 -33
- package/server/tldraw-package.d.ts +4 -0
- package/server/ui-components.ts +101 -434
- package/server/uploads.ts +0 -0
- package/server/view-builders.ts +20 -2
- package/server/views.ts +126 -6
- package/server/web.ts +46 -13
- package/server/widgets.ts +12 -5
- package/server/workspace-config.ts +13 -9
- package/server/workspace-env.ts +3 -2
- package/tsconfig.json +0 -1
- package/ui-components/accordion.tsx +71 -0
- package/ui-components/alert-dialog.tsx +165 -0
- package/ui-components/alert.tsx +68 -0
- package/ui-components/attachment.tsx +195 -0
- package/ui-components/avatar.tsx +90 -0
- package/ui-components/badge.tsx +49 -0
- package/ui-components/button-group.tsx +78 -0
- package/ui-components/button.tsx +55 -0
- package/ui-components/calendar.tsx +180 -0
- package/ui-components/card.tsx +84 -0
- package/ui-components/carousel.tsx +235 -0
- package/ui-components/chart.tsx +338 -0
- package/ui-components/checkbox.tsx +28 -0
- package/ui-components/collapsible.tsx +15 -0
- package/ui-components/combobox.tsx +267 -0
- package/ui-components/context-menu.tsx +244 -0
- package/ui-components/dialog.tsx +138 -0
- package/ui-components/docs/accordion.md +463 -0
- package/ui-components/docs/alert-dialog.md +481 -0
- package/ui-components/docs/alert.md +301 -0
- package/ui-components/docs/attachment.md +689 -0
- package/ui-components/docs/avatar.md +495 -0
- package/ui-components/docs/badge.md +258 -0
- package/ui-components/docs/button-group.md +879 -0
- package/ui-components/docs/button.md +26 -0
- package/ui-components/docs/calendar.md +862 -0
- package/ui-components/docs/card.md +265 -0
- package/ui-components/docs/carousel.md +627 -0
- package/ui-components/docs/chart.md +1256 -0
- package/ui-components/docs/checkbox.md +477 -0
- package/ui-components/docs/collapsible.md +446 -0
- package/ui-components/docs/combobox.md +1003 -0
- package/ui-components/docs/context-menu.md +860 -0
- package/ui-components/docs/data-table.md +1580 -0
- package/ui-components/docs/date-picker.md +614 -0
- package/ui-components/docs/dialog.md +414 -0
- package/ui-components/docs/drawer.md +51 -0
- package/ui-components/docs/dropdown-menu.md +1000 -0
- package/ui-components/docs/field.md +1192 -0
- package/ui-components/docs/hover-card.md +275 -0
- package/ui-components/docs/input-group.md +866 -0
- package/ui-components/docs/input.md +456 -0
- package/ui-components/docs/kbd.md +191 -0
- package/ui-components/docs/label.md +295 -0
- package/ui-components/docs/pagination.md +416 -0
- package/ui-components/docs/popover.md +348 -0
- package/ui-components/docs/progress.md +214 -0
- package/ui-components/docs/radio-group.md +389 -0
- package/ui-components/docs/resizable.md +265 -0
- package/ui-components/docs/select.md +616 -0
- package/ui-components/docs/separator.md +216 -0
- package/ui-components/docs/skeleton.md +205 -0
- package/ui-components/docs/slider.md +226 -0
- package/ui-components/docs/spinner.md +332 -0
- package/ui-components/docs/switch.md +236 -0
- package/ui-components/docs/table.md +551 -0
- package/ui-components/docs/tabs.md +379 -0
- package/ui-components/docs/textarea.md +187 -0
- package/ui-components/docs/toggle-group.md +370 -0
- package/ui-components/docs/toggle.md +91 -0
- package/ui-components/docs/tooltip.md +290 -0
- package/ui-components/drawer.tsx +213 -0
- package/ui-components/dropdown-menu.tsx +263 -0
- package/ui-components/field.tsx +224 -0
- package/ui-components/hover-card.tsx +46 -0
- package/ui-components/input-group.tsx +146 -0
- package/ui-components/input.tsx +20 -0
- package/ui-components/kbd.tsx +32 -0
- package/ui-components/label.tsx +17 -0
- package/ui-components/pagination.tsx +124 -0
- package/ui-components/popover.tsx +81 -0
- package/ui-components/progress.tsx +63 -0
- package/ui-components/radio-group.tsx +38 -0
- package/ui-components/resizable.tsx +40 -0
- package/ui-components/scoped-portal.tsx +31 -0
- package/ui-components/select.tsx +195 -0
- package/ui-components/separator.tsx +18 -0
- package/ui-components/skeleton.tsx +15 -0
- package/ui-components/slider.tsx +75 -0
- package/ui-components/spinner.tsx +20 -0
- package/ui-components/switch.tsx +27 -0
- package/ui-components/table.tsx +86 -0
- package/ui-components/tabs.tsx +75 -0
- package/ui-components/textarea.tsx +17 -0
- package/ui-components/toggle-group.tsx +85 -0
- package/ui-components/toggle.tsx +42 -0
- package/ui-components/tooltip.tsx +61 -0
- package/ui-components/utils.ts +8 -0
- package/workspace/.claude/skills/moi-workspace/SKILL.md +295 -248
- package/workspace/.claude/skills/moi-workspace/references/DESIGN.md +100 -152
- package/workspace/.claude/skills/moi-workspace/references/INTENTS.md +156 -0
- package/workspace/.claude/skills/moi-workspace/references/UI-COMPONENTS.md +67 -203
- package/client/features/chat/attachment-staging.ts +0 -153
- package/client/features/chat/uploads.ts +0 -18
- package/client/features/chat/useAppletChatMessage.ts +0 -68
- package/client/features/settings/IconPicker.tsx +0 -442
- package/client/features/settings/WorkspaceSettings.tsx +0 -92
- package/client/features/settings/render-icon.ts +0 -173
- package/client/features/widgets/HiddenPanel.tsx +0 -80
- package/client/features/widgets/WidgetGrid.tsx +0 -123
- package/client/features/widgets/Widgets.tsx +0 -264
- package/client/features/widgets/useGridReconcile.ts +0 -73
- package/dist/chunk-104m57qw.js +0 -2
- package/dist/chunk-59zf0m6n.js +0 -1
- package/dist/chunk-bj3akjs2.js +0 -1
- package/dist/chunk-c9pjqx9m.js +0 -14
- package/dist/chunk-j2w2vak4.js +0 -546
- package/dist/chunk-k2r9c95m.js +0 -10
- package/dist/chunk-kmbxhgwv.js +0 -1
- package/dist/chunk-p1yqa71k.js +0 -83
- package/dist/chunk-pcnahct1.js +0 -5
- package/dist/chunk-r5xrenjy.css +0 -1
- package/dist/chunk-tny85yt2.js +0 -2
- package/dist/chunk-v7wr1df4.js +0 -2
- package/server/bundler/applet-css.ts +0 -155
- /package/client/features/chat/{ChatPromptBubbles.tsx → messages/ChatPromptBubbles.tsx} +0 -0
- /package/client/features/chat/{ShimmerText.tsx → messages/ShimmerText.tsx} +0 -0
- /package/client/features/chat/{preview-turn.ts → messages/preview-turn.ts} +0 -0
- /package/client/features/chat/{tool-group → messages/tool-group}/CodeBlock.tsx +0 -0
- /package/client/features/chat/{tool-group → messages/tool-group}/Collapse.tsx +0 -0
- /package/client/features/chat/{tool-group → messages/tool-group}/ReadImagePreview.tsx +0 -0
- /package/client/features/chat/{tool-group → messages/tool-group}/ToolOutput.tsx +0 -0
- /package/client/features/chat/{tool-group → messages/tool-group}/detect.ts +0 -0
- /package/client/features/chat/{tool-group → messages/tool-group}/fixtures.ts +0 -0
- /package/client/features/chat/{tool-group → messages/tool-group}/format/claude.ts +0 -0
- /package/client/features/chat/{tool-group → messages/tool-group}/format/hermes.ts +0 -0
- /package/client/features/chat/{tool-group → messages/tool-group}/format/index.ts +0 -0
- /package/client/features/chat/{tool-group → messages/tool-group}/format/mcp.ts +0 -0
- /package/client/features/chat/{tool-group → messages/tool-group}/format/openclaw.ts +0 -0
- /package/client/features/chat/{tool-group → messages/tool-group}/format/shared.ts +0 -0
- /package/client/features/chat/{tool-group → messages/tool-group}/format/shell.ts +0 -0
- /package/client/features/chat/{tool-group → messages/tool-group}/index.ts +0 -0
- /package/client/features/chat/{useStickToBottom.ts → messages/useStickToBottom.ts} +0 -0
- /package/client/features/chat/{useSelectedSession.ts → sessions/useSelectedSession.ts} +0 -0
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Tooltip
|
|
3
|
+
description: A popup that displays information related to an element when the element receives keyboard focus or the mouse hovers over it.
|
|
4
|
+
base: base
|
|
5
|
+
component: true
|
|
6
|
+
links:
|
|
7
|
+
doc: https://base-ui.com/react/components/tooltip
|
|
8
|
+
api: https://base-ui.com/react/components/tooltip#api-reference
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
```tsx
|
|
12
|
+
import { Button } from '@/components/ui/button'
|
|
13
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip'
|
|
14
|
+
|
|
15
|
+
export function TooltipDemo() {
|
|
16
|
+
return (
|
|
17
|
+
<Tooltip>
|
|
18
|
+
<TooltipTrigger render={<Button variant="outline" />}>Hover</TooltipTrigger>
|
|
19
|
+
<TooltipContent>
|
|
20
|
+
<p>Add to library</p>
|
|
21
|
+
</TooltipContent>
|
|
22
|
+
</Tooltip>
|
|
23
|
+
)
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Installation
|
|
28
|
+
|
|
29
|
+
<CodeTabs>
|
|
30
|
+
|
|
31
|
+
<TabsList>
|
|
32
|
+
<TabsTrigger value="cli">Command</TabsTrigger>
|
|
33
|
+
<TabsTrigger value="manual">Manual</TabsTrigger>
|
|
34
|
+
</TabsList>
|
|
35
|
+
<TabsContent value="cli">
|
|
36
|
+
|
|
37
|
+
<Steps className="mb-0 pt-2">
|
|
38
|
+
|
|
39
|
+
<Step>Run the following command:</Step>
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
moi ui-components add tooltip
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
<Step>Add the `TooltipProvider` to the root of your app.</Step>
|
|
46
|
+
|
|
47
|
+
```tsx title="app/layout.tsx" showLineNumbers {1,7}
|
|
48
|
+
import { TooltipProvider } from '@/components/ui/tooltip'
|
|
49
|
+
|
|
50
|
+
export default function RootLayout({ children }) {
|
|
51
|
+
return (
|
|
52
|
+
<html lang="en">
|
|
53
|
+
<body>
|
|
54
|
+
<TooltipProvider>{children}</TooltipProvider>
|
|
55
|
+
</body>
|
|
56
|
+
</html>
|
|
57
|
+
)
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
</Steps>
|
|
62
|
+
|
|
63
|
+
</TabsContent>
|
|
64
|
+
|
|
65
|
+
<TabsContent value="manual">
|
|
66
|
+
|
|
67
|
+
<Steps className="mb-0 pt-2">
|
|
68
|
+
|
|
69
|
+
<Step>Install the following dependencies:</Step>
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
npm install @base-ui/react
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
<Step>Copy and paste the following code into your project.</Step>
|
|
76
|
+
|
|
77
|
+
<ComponentSource
|
|
78
|
+
name="tooltip"
|
|
79
|
+
title="components/ui/tooltip.tsx"
|
|
80
|
+
styleName="base-nova"
|
|
81
|
+
/>
|
|
82
|
+
|
|
83
|
+
<Step>Update the import paths to match your project setup.</Step>
|
|
84
|
+
|
|
85
|
+
<Step>Add the `TooltipProvider` to the root of your app.</Step>
|
|
86
|
+
|
|
87
|
+
```tsx title="app/layout.tsx" showLineNumbers {1,7}
|
|
88
|
+
import { TooltipProvider } from '@/components/ui/tooltip'
|
|
89
|
+
|
|
90
|
+
export default function RootLayout({ children }) {
|
|
91
|
+
return (
|
|
92
|
+
<html lang="en">
|
|
93
|
+
<body>
|
|
94
|
+
<TooltipProvider>{children}</TooltipProvider>
|
|
95
|
+
</body>
|
|
96
|
+
</html>
|
|
97
|
+
)
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
</Steps>
|
|
102
|
+
|
|
103
|
+
</TabsContent>
|
|
104
|
+
|
|
105
|
+
</CodeTabs>
|
|
106
|
+
|
|
107
|
+
## Usage
|
|
108
|
+
|
|
109
|
+
```tsx showLineNumbers
|
|
110
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip'
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
```tsx showLineNumbers
|
|
114
|
+
<Tooltip>
|
|
115
|
+
<TooltipTrigger>Hover</TooltipTrigger>
|
|
116
|
+
<TooltipContent>
|
|
117
|
+
<p>Add to library</p>
|
|
118
|
+
</TooltipContent>
|
|
119
|
+
</Tooltip>
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## Composition
|
|
123
|
+
|
|
124
|
+
Use the following composition to build a `Tooltip`:
|
|
125
|
+
|
|
126
|
+
```text
|
|
127
|
+
Tooltip
|
|
128
|
+
├── TooltipTrigger
|
|
129
|
+
└── TooltipContent
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## Side
|
|
133
|
+
|
|
134
|
+
Use the `side` prop to change the position of the tooltip.
|
|
135
|
+
|
|
136
|
+
```tsx
|
|
137
|
+
import { Button } from '@/components/ui/button'
|
|
138
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip'
|
|
139
|
+
|
|
140
|
+
export function TooltipSides() {
|
|
141
|
+
return (
|
|
142
|
+
<div className="flex flex-wrap gap-2">
|
|
143
|
+
{(['left', 'top', 'bottom', 'right'] as const).map(side => (
|
|
144
|
+
<Tooltip key={side}>
|
|
145
|
+
<TooltipTrigger render={<Button variant="outline" className="w-fit capitalize" />}>
|
|
146
|
+
{side}
|
|
147
|
+
</TooltipTrigger>
|
|
148
|
+
<TooltipContent side={side}>
|
|
149
|
+
<p>Add to library</p>
|
|
150
|
+
</TooltipContent>
|
|
151
|
+
</Tooltip>
|
|
152
|
+
))}
|
|
153
|
+
</div>
|
|
154
|
+
)
|
|
155
|
+
}
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## With Keyboard Shortcut
|
|
159
|
+
|
|
160
|
+
```tsx
|
|
161
|
+
import { IconDeviceFloppy } from '@tabler/icons-react'
|
|
162
|
+
|
|
163
|
+
import { Button } from '@/components/ui/button'
|
|
164
|
+
import { Kbd } from '@/components/ui/kbd'
|
|
165
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip'
|
|
166
|
+
|
|
167
|
+
export function TooltipKeyboard() {
|
|
168
|
+
return (
|
|
169
|
+
<Tooltip>
|
|
170
|
+
<TooltipTrigger render={<Button variant="outline" size="icon-sm" />}>
|
|
171
|
+
<IconDeviceFloppy stroke={1.75} />
|
|
172
|
+
</TooltipTrigger>
|
|
173
|
+
<TooltipContent>
|
|
174
|
+
Save Changes <Kbd>S</Kbd>
|
|
175
|
+
</TooltipContent>
|
|
176
|
+
</Tooltip>
|
|
177
|
+
)
|
|
178
|
+
}
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
## Disabled Button
|
|
182
|
+
|
|
183
|
+
Show a tooltip on a disabled button by wrapping it with a span.
|
|
184
|
+
|
|
185
|
+
```tsx
|
|
186
|
+
import { Button } from '@/components/ui/button'
|
|
187
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip'
|
|
188
|
+
|
|
189
|
+
export function TooltipDisabled() {
|
|
190
|
+
return (
|
|
191
|
+
<>
|
|
192
|
+
<Tooltip>
|
|
193
|
+
<TooltipTrigger render={<span className="inline-block w-fit" />}>
|
|
194
|
+
<Button variant="outline" disabled>
|
|
195
|
+
Disabled
|
|
196
|
+
</Button>
|
|
197
|
+
</TooltipTrigger>
|
|
198
|
+
<TooltipContent>
|
|
199
|
+
<p>This feature is currently unavailable</p>
|
|
200
|
+
</TooltipContent>
|
|
201
|
+
</Tooltip>
|
|
202
|
+
</>
|
|
203
|
+
)
|
|
204
|
+
}
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
## RTL
|
|
208
|
+
|
|
209
|
+
```tsx
|
|
210
|
+
'use client'
|
|
211
|
+
|
|
212
|
+
import { useTranslation, type Translations } from '@/components/language-selector'
|
|
213
|
+
import { Button } from '@/components/ui/button'
|
|
214
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip'
|
|
215
|
+
|
|
216
|
+
const translations: Translations = {
|
|
217
|
+
en: {
|
|
218
|
+
dir: 'ltr',
|
|
219
|
+
values: {
|
|
220
|
+
content: 'Add to library',
|
|
221
|
+
'inline-start': 'Inline Start',
|
|
222
|
+
left: 'Left',
|
|
223
|
+
top: 'Top',
|
|
224
|
+
bottom: 'Bottom',
|
|
225
|
+
right: 'Right',
|
|
226
|
+
'inline-end': 'Inline End'
|
|
227
|
+
}
|
|
228
|
+
},
|
|
229
|
+
ar: {
|
|
230
|
+
dir: 'rtl',
|
|
231
|
+
values: {
|
|
232
|
+
content: 'إضافة إلى المكتبة',
|
|
233
|
+
'inline-start': 'بداية السطر',
|
|
234
|
+
left: 'يسار',
|
|
235
|
+
top: 'أعلى',
|
|
236
|
+
bottom: 'أسفل',
|
|
237
|
+
right: 'يمين',
|
|
238
|
+
'inline-end': 'نهاية السطر'
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
he: {
|
|
242
|
+
dir: 'rtl',
|
|
243
|
+
values: {
|
|
244
|
+
content: 'הוסף לספרייה',
|
|
245
|
+
'inline-start': 'תחילת השורה',
|
|
246
|
+
left: 'שמאל',
|
|
247
|
+
top: 'למעלה',
|
|
248
|
+
bottom: 'למטה',
|
|
249
|
+
right: 'ימין',
|
|
250
|
+
'inline-end': 'סוף השורה'
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
const physicalSides = ['left', 'top', 'bottom', 'right'] as const
|
|
256
|
+
const logicalSides = ['inline-start', 'inline-end'] as const
|
|
257
|
+
|
|
258
|
+
export function TooltipRtl() {
|
|
259
|
+
const { dir, t } = useTranslation(translations, 'ar')
|
|
260
|
+
|
|
261
|
+
return (
|
|
262
|
+
<div className="grid gap-4">
|
|
263
|
+
<div className="flex flex-wrap justify-center gap-2">
|
|
264
|
+
{physicalSides.map(side => (
|
|
265
|
+
<Tooltip key={side}>
|
|
266
|
+
<TooltipTrigger render={<Button variant="outline" />}>{t[side]}</TooltipTrigger>
|
|
267
|
+
<TooltipContent side={side} dir={dir}>
|
|
268
|
+
{t.content}
|
|
269
|
+
</TooltipContent>
|
|
270
|
+
</Tooltip>
|
|
271
|
+
))}
|
|
272
|
+
</div>
|
|
273
|
+
<div className="flex flex-wrap justify-center gap-2">
|
|
274
|
+
{logicalSides.map(side => (
|
|
275
|
+
<Tooltip key={side}>
|
|
276
|
+
<TooltipTrigger render={<Button variant="outline" />}>{t[side]}</TooltipTrigger>
|
|
277
|
+
<TooltipContent side={side} dir={dir}>
|
|
278
|
+
{t.content}
|
|
279
|
+
</TooltipContent>
|
|
280
|
+
</Tooltip>
|
|
281
|
+
))}
|
|
282
|
+
</div>
|
|
283
|
+
</div>
|
|
284
|
+
)
|
|
285
|
+
}
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
## API Reference
|
|
289
|
+
|
|
290
|
+
See the [Base UI Tooltip](https://base-ui.com/react/components/tooltip#api-reference) documentation.
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import { Drawer as DrawerPrimitive } from '@base-ui/react/drawer'
|
|
5
|
+
import { IconX } from '@tabler/icons-react'
|
|
6
|
+
|
|
7
|
+
import { Button } from './button'
|
|
8
|
+
import { cn } from './utils'
|
|
9
|
+
|
|
10
|
+
type DrawerContextProps = {
|
|
11
|
+
hasSnapPoints: boolean
|
|
12
|
+
modal: DrawerPrimitive.Root.Props['modal']
|
|
13
|
+
swipeDirection: NonNullable<DrawerPrimitive.Root.Props['swipeDirection']>
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const DrawerContext = React.createContext<DrawerContextProps | null>(null)
|
|
17
|
+
|
|
18
|
+
function useDrawer() {
|
|
19
|
+
const context = React.useContext(DrawerContext)
|
|
20
|
+
|
|
21
|
+
if (!context) {
|
|
22
|
+
throw new Error('useDrawer must be used within a Drawer.')
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return context
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function Drawer({
|
|
29
|
+
modal = 'trap-focus',
|
|
30
|
+
snapPoints,
|
|
31
|
+
swipeDirection = 'right',
|
|
32
|
+
...props
|
|
33
|
+
}: DrawerPrimitive.Root.Props) {
|
|
34
|
+
const hasSnapPoints = snapPoints != null && snapPoints.length > 0
|
|
35
|
+
const contextValue = React.useMemo(
|
|
36
|
+
() => ({ hasSnapPoints, modal, swipeDirection }),
|
|
37
|
+
[hasSnapPoints, modal, swipeDirection]
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<DrawerContext.Provider value={contextValue}>
|
|
42
|
+
<DrawerPrimitive.Root
|
|
43
|
+
data-slot="drawer"
|
|
44
|
+
modal={modal}
|
|
45
|
+
snapPoints={snapPoints}
|
|
46
|
+
swipeDirection={swipeDirection}
|
|
47
|
+
{...props}
|
|
48
|
+
/>
|
|
49
|
+
</DrawerContext.Provider>
|
|
50
|
+
)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function DrawerTrigger({ ...props }: DrawerPrimitive.Trigger.Props) {
|
|
54
|
+
return <DrawerPrimitive.Trigger data-slot="drawer-trigger" {...props} />
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function DrawerClose({ ...props }: DrawerPrimitive.Close.Props) {
|
|
58
|
+
return <DrawerPrimitive.Close data-slot="drawer-close" {...props} />
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
type DrawerContentProps = DrawerPrimitive.Popup.Props & {
|
|
62
|
+
showCloseButton?: boolean
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function DrawerContent({
|
|
66
|
+
className,
|
|
67
|
+
children,
|
|
68
|
+
showCloseButton = true,
|
|
69
|
+
...props
|
|
70
|
+
}: DrawerContentProps) {
|
|
71
|
+
const { hasSnapPoints, modal, swipeDirection } = useDrawer()
|
|
72
|
+
const [container, setContainer] = React.useState<HTMLElement | null>(null)
|
|
73
|
+
const markerRef = React.useCallback((node: HTMLElement | null) => {
|
|
74
|
+
if (node) setContainer(node.closest<HTMLElement>('[data-applet]'))
|
|
75
|
+
}, [])
|
|
76
|
+
const swipeAxis = swipeDirection === 'down' || swipeDirection === 'up' ? 'y' : 'x'
|
|
77
|
+
|
|
78
|
+
return (
|
|
79
|
+
<>
|
|
80
|
+
<span hidden ref={markerRef} />
|
|
81
|
+
<DrawerPrimitive.Portal data-slot="drawer-portal" container={container}>
|
|
82
|
+
{modal === true && (
|
|
83
|
+
<DrawerPrimitive.Backdrop
|
|
84
|
+
data-slot="drawer-overlay"
|
|
85
|
+
data-snap-points={hasSnapPoints ? '' : undefined}
|
|
86
|
+
className="absolute inset-0 z-50 min-h-full bg-black/10 opacity-[max(var(--drawer-overlay-min-opacity,0),calc(1-var(--drawer-swipe-progress)))] transition-opacity duration-450 ease-[cubic-bezier(0.32,0.72,0,1)] select-none data-ending-style:pointer-events-none data-ending-style:opacity-0 data-ending-style:duration-[calc(var(--drawer-swipe-strength)*400ms)] data-snap-points:[--drawer-overlay-min-opacity:0.5] data-starting-style:opacity-0 data-swiping:duration-0"
|
|
87
|
+
/>
|
|
88
|
+
)}
|
|
89
|
+
<DrawerPrimitive.Viewport
|
|
90
|
+
data-slot="drawer-viewport"
|
|
91
|
+
data-modal={modal}
|
|
92
|
+
className="pointer-events-none absolute inset-0 z-50 select-none data-[modal=true]:pointer-events-auto"
|
|
93
|
+
>
|
|
94
|
+
<DrawerPrimitive.Popup
|
|
95
|
+
data-slot="drawer-popup"
|
|
96
|
+
data-swipe-axis={swipeAxis}
|
|
97
|
+
data-snap-points={hasSnapPoints ? '' : undefined}
|
|
98
|
+
className={cn(
|
|
99
|
+
// Base.
|
|
100
|
+
'group/drawer-popup pointer-events-auto absolute z-50 m-(--drawer-inset,0.5rem) flex h-(--drawer-content-height) max-h-(--drawer-content-max-height,none) min-h-0 w-(--drawer-content-width,auto) transform-[translate3d(var(--translate-x,0px),var(--translate-y,0px),0)_scale(var(--stack-scale))] flex-col rounded-lg bg-popover text-sm text-popover-foreground shadow-xl transition-[transform,height,opacity,filter] duration-450 ease-[cubic-bezier(0.22,1,0.36,1)] will-change-transform outline-none select-none [interpolate-size:allow-keywords]',
|
|
101
|
+
// Nested.
|
|
102
|
+
'data-nested-drawer-open:overflow-hidden data-nested-drawer-open:brightness-95',
|
|
103
|
+
// Sizing.
|
|
104
|
+
'[--drawer-content-height:var(--drawer-height,auto)] data-[swipe-axis=x]:[--drawer-content-width:75%] data-[swipe-axis=y]:[--drawer-content-max-height:calc(100%-6rem)] data-[swipe-axis=y]:data-snap-points:[--drawer-content-height:100%] data-[swipe-axis=x]:sm:[--drawer-content-width:24rem]',
|
|
105
|
+
// Stack.
|
|
106
|
+
'[--peek:1rem] [--stack-height:var(--drawer-frontmost-height,var(--drawer-height,0px))] [--stack-peek-offset:max(0px,calc((var(--nested-drawers)-var(--stack-progress))*var(--peek)))] [--stack-progress:clamp(0,var(--drawer-swipe-progress),1)] [--stack-scale-base:max(0,calc(1-(var(--nested-drawers)*var(--stack-step))))] [--stack-scale:clamp(0,calc(var(--stack-scale-base)+(var(--stack-step)*var(--stack-progress))),1)] [--stack-shrink:calc(1-var(--stack-scale))] [--stack-step:0.05]',
|
|
107
|
+
// Transitions.
|
|
108
|
+
'data-ending-style:transform-(--closed-transform) data-ending-style:opacity-[0.9999] data-ending-style:duration-[calc(var(--drawer-swipe-strength)*400ms)] data-nested-drawer-swiping:duration-0 data-ending-style:data-nested-drawer-swiping:duration-[calc(var(--drawer-swipe-strength)*400ms)] data-starting-style:transform-(--closed-transform) data-swiping:duration-0 data-ending-style:data-swiping:duration-[calc(var(--drawer-swipe-strength)*400ms)]',
|
|
109
|
+
// Axis: y.
|
|
110
|
+
'data-[swipe-axis=y]:inset-x-0 data-[swipe-axis=y]:data-nested-drawer-open:h-(--stack-height)',
|
|
111
|
+
// Axis: x.
|
|
112
|
+
'data-[swipe-axis=x]:inset-y-0 data-[swipe-axis=x]:flex-row',
|
|
113
|
+
// Direction: down.
|
|
114
|
+
'data-[swipe-direction=down]:bottom-0 data-[swipe-direction=down]:origin-bottom data-[swipe-direction=down]:[--closed-transform:translate3d(0,calc(100%+var(--drawer-inset,0.5rem)+2px),0)] data-[swipe-direction=down]:[--translate-y:calc(var(--drawer-snap-point-offset,0px)+var(--drawer-swipe-movement-y)-var(--stack-peek-offset)-(var(--stack-shrink)*var(--stack-height)))]',
|
|
115
|
+
// Direction: up.
|
|
116
|
+
'data-[swipe-direction=up]:top-0 data-[swipe-direction=up]:origin-top data-[swipe-direction=up]:[--closed-transform:translate3d(0,calc(-100%-var(--drawer-inset,0.5rem)-2px),0)] data-[swipe-direction=up]:[--translate-y:calc(var(--drawer-snap-point-offset,0px)+var(--drawer-swipe-movement-y)+var(--stack-peek-offset)+(var(--stack-shrink)*var(--stack-height)))]',
|
|
117
|
+
// Direction: left.
|
|
118
|
+
'data-[swipe-direction=left]:left-0 data-[swipe-direction=left]:origin-left data-[swipe-direction=left]:[--closed-transform:translate3d(calc(-100%-var(--drawer-inset,0.5rem)-2px),0,0)] data-[swipe-direction=left]:[--translate-x:calc(var(--drawer-swipe-movement-x)+var(--stack-peek-offset)+(var(--stack-shrink)*100%))]',
|
|
119
|
+
// Direction: right.
|
|
120
|
+
'data-[swipe-direction=right]:right-0 data-[swipe-direction=right]:origin-right data-[swipe-direction=right]:[--closed-transform:translate3d(calc(100%+var(--drawer-inset,0.5rem)+2px),0,0)] data-[swipe-direction=right]:[--translate-x:calc(var(--drawer-swipe-movement-x)-var(--stack-peek-offset)-(var(--stack-shrink)*100%))]',
|
|
121
|
+
className
|
|
122
|
+
)}
|
|
123
|
+
{...props}
|
|
124
|
+
>
|
|
125
|
+
<DrawerPrimitive.Content
|
|
126
|
+
data-slot="drawer-content"
|
|
127
|
+
className={cn(
|
|
128
|
+
'flex min-h-0 flex-1 flex-col overflow-hidden overscroll-contain rounded-[inherit] transition-opacity duration-300 ease-[cubic-bezier(0.45,1.005,0,1.005)] select-text group-data-nested-drawer-open/drawer-popup:opacity-0 group-data-nested-drawer-swiping/drawer-popup:opacity-100 group-data-swiping/drawer-popup:select-none'
|
|
129
|
+
)}
|
|
130
|
+
>
|
|
131
|
+
{children}
|
|
132
|
+
{showCloseButton && (
|
|
133
|
+
<DrawerClose
|
|
134
|
+
render={
|
|
135
|
+
<Button variant="ghost" size="icon-sm" className="absolute top-3 right-3" />
|
|
136
|
+
}
|
|
137
|
+
>
|
|
138
|
+
<IconX stroke={1.75} />
|
|
139
|
+
<span className="sr-only">Close</span>
|
|
140
|
+
</DrawerClose>
|
|
141
|
+
)}
|
|
142
|
+
</DrawerPrimitive.Content>
|
|
143
|
+
</DrawerPrimitive.Popup>
|
|
144
|
+
</DrawerPrimitive.Viewport>
|
|
145
|
+
</DrawerPrimitive.Portal>
|
|
146
|
+
</>
|
|
147
|
+
)
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
function DrawerHeader({ className, ...props }: React.ComponentProps<'div'>) {
|
|
151
|
+
return (
|
|
152
|
+
<div
|
|
153
|
+
data-slot="drawer-header"
|
|
154
|
+
className={cn(
|
|
155
|
+
'flex shrink-0 flex-col gap-0.5 p-4 pr-12 pb-0 group-data-[swipe-axis=y]/drawer-popup:text-center md:gap-0.5 md:text-left',
|
|
156
|
+
className
|
|
157
|
+
)}
|
|
158
|
+
{...props}
|
|
159
|
+
/>
|
|
160
|
+
)
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
function DrawerBody({ className, ...props }: React.ComponentProps<'div'>) {
|
|
164
|
+
return (
|
|
165
|
+
<div
|
|
166
|
+
data-slot="drawer-body"
|
|
167
|
+
className={cn('min-h-0 flex-1 overflow-y-auto overscroll-contain p-4', className)}
|
|
168
|
+
{...props}
|
|
169
|
+
/>
|
|
170
|
+
)
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
function DrawerFooter({ className, ...props }: React.ComponentProps<'div'>) {
|
|
174
|
+
return (
|
|
175
|
+
<div
|
|
176
|
+
data-slot="drawer-footer"
|
|
177
|
+
className={cn('mt-auto flex shrink-0 flex-col gap-2 p-4 pt-0', className)}
|
|
178
|
+
{...props}
|
|
179
|
+
/>
|
|
180
|
+
)
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
function DrawerTitle({ className, ...props }: DrawerPrimitive.Title.Props) {
|
|
184
|
+
return (
|
|
185
|
+
<DrawerPrimitive.Title
|
|
186
|
+
data-slot="drawer-title"
|
|
187
|
+
className={cn('text-base font-medium', className)}
|
|
188
|
+
{...props}
|
|
189
|
+
/>
|
|
190
|
+
)
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
function DrawerDescription({ className, ...props }: DrawerPrimitive.Description.Props) {
|
|
194
|
+
return (
|
|
195
|
+
<DrawerPrimitive.Description
|
|
196
|
+
data-slot="drawer-description"
|
|
197
|
+
className={cn('text-sm text-muted-foreground', className)}
|
|
198
|
+
{...props}
|
|
199
|
+
/>
|
|
200
|
+
)
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
export {
|
|
204
|
+
Drawer,
|
|
205
|
+
DrawerBody,
|
|
206
|
+
DrawerClose,
|
|
207
|
+
DrawerContent,
|
|
208
|
+
DrawerDescription,
|
|
209
|
+
DrawerFooter,
|
|
210
|
+
DrawerHeader,
|
|
211
|
+
DrawerTitle,
|
|
212
|
+
DrawerTrigger
|
|
213
|
+
}
|