@otfdashkit/ui 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.
- package/LICENSE +21 -0
- package/dist/index.js +14886 -0
- package/dist/index.mjs +14389 -0
- package/package.json +124 -0
- package/src/advanced/BulkActions/BulkActions.stories.tsx +14 -0
- package/src/advanced/BulkActions/BulkActions.test.tsx +9 -0
- package/src/advanced/BulkActions/BulkActions.tsx +46 -0
- package/src/advanced/BulkActions/index.ts +2 -0
- package/src/advanced/CommandBar/CommandBar.stories.tsx +14 -0
- package/src/advanced/CommandBar/CommandBar.test.tsx +9 -0
- package/src/advanced/CommandBar/CommandBar.tsx +115 -0
- package/src/advanced/CommandBar/index.ts +2 -0
- package/src/advanced/Filters/Filters.stories.tsx +14 -0
- package/src/advanced/Filters/Filters.test.tsx +9 -0
- package/src/advanced/Filters/Filters.tsx +103 -0
- package/src/advanced/Filters/index.ts +2 -0
- package/src/advanced/Kanban/Kanban.stories.tsx +14 -0
- package/src/advanced/Kanban/Kanban.test.tsx +9 -0
- package/src/advanced/Kanban/Kanban.tsx +95 -0
- package/src/advanced/Kanban/index.ts +2 -0
- package/src/advanced/ToggleButton/ToggleButton.stories.tsx +14 -0
- package/src/advanced/ToggleButton/ToggleButton.test.tsx +9 -0
- package/src/advanced/ToggleButton/ToggleButton.tsx +78 -0
- package/src/advanced/ToggleButton/index.ts +2 -0
- package/src/advanced/bulk-actions.tsx +46 -0
- package/src/advanced/command-bar.tsx +115 -0
- package/src/advanced/filters.tsx +103 -0
- package/src/advanced/gantt.tsx +824 -0
- package/src/advanced/kanban.tsx +95 -0
- package/src/advanced/rich-editor.tsx +700 -0
- package/src/advanced/toggle-button.tsx +78 -0
- package/src/advanced/utils/cn.ts +1 -0
- package/src/app-shell/AppShell.tsx +24 -0
- package/src/app-shell/BillingStatus.tsx +63 -0
- package/src/app-shell/Sidebar.tsx +172 -0
- package/src/app-shell/SidebarResizer.tsx +109 -0
- package/src/app-shell/SortableNav.tsx +122 -0
- package/src/app-shell/UserMenu.tsx +135 -0
- package/src/app-shell/WorkspacesMenu.tsx +114 -0
- package/src/app-shell/index.ts +18 -0
- package/src/backgrounds/AnimatedGradient.tsx +151 -0
- package/src/backgrounds/DottedBackground.tsx +64 -0
- package/src/backgrounds/GradientBackground.tsx +113 -0
- package/src/backgrounds/HeroShaderA.tsx +255 -0
- package/src/backgrounds/NoiseBackground.tsx +51 -0
- package/src/backgrounds/index.ts +5 -0
- package/src/blocks/ChatDetail/ChatDetail.stories.tsx +14 -0
- package/src/blocks/ChatDetail/ChatDetail.test.tsx +9 -0
- package/src/blocks/ChatDetail/ChatDetail.tsx +73 -0
- package/src/blocks/ChatDetail/index.ts +2 -0
- package/src/blocks/FeedbackModal/FeedbackModal.stories.tsx +14 -0
- package/src/blocks/FeedbackModal/FeedbackModal.test.tsx +9 -0
- package/src/blocks/FeedbackModal/FeedbackModal.tsx +68 -0
- package/src/blocks/FeedbackModal/index.ts +2 -0
- package/src/blocks/FileCards/FileCards.stories.tsx +14 -0
- package/src/blocks/FileCards/FileCards.test.tsx +9 -0
- package/src/blocks/FileCards/FileCards.tsx +56 -0
- package/src/blocks/FileCards/index.ts +2 -0
- package/src/blocks/FilesList/FilesList.stories.tsx +14 -0
- package/src/blocks/FilesList/FilesList.test.tsx +9 -0
- package/src/blocks/FilesList/FilesList.tsx +72 -0
- package/src/blocks/FilesList/index.ts +2 -0
- package/src/blocks/FloatingActionButton/FloatingActionButton.stories.tsx +223 -0
- package/src/blocks/FloatingActionButton/FloatingActionButton.test.tsx +47 -0
- package/src/blocks/FloatingActionButton/FloatingActionButton.tsx +253 -0
- package/src/blocks/FloatingActionButton/index.ts +1 -0
- package/src/blocks/IntegrationCard/IntegrationCard.stories.tsx +14 -0
- package/src/blocks/IntegrationCard/IntegrationCard.test.tsx +9 -0
- package/src/blocks/IntegrationCard/IntegrationCard.tsx +50 -0
- package/src/blocks/IntegrationCard/index.ts +2 -0
- package/src/blocks/InviteModal/InviteModal.stories.tsx +14 -0
- package/src/blocks/InviteModal/InviteModal.test.tsx +9 -0
- package/src/blocks/InviteModal/InviteModal.tsx +69 -0
- package/src/blocks/InviteModal/index.ts +2 -0
- package/src/blocks/ManageTagsModal/ManageTagsModal.stories.tsx +14 -0
- package/src/blocks/ManageTagsModal/ManageTagsModal.test.tsx +9 -0
- package/src/blocks/ManageTagsModal/ManageTagsModal.tsx +63 -0
- package/src/blocks/ManageTagsModal/index.ts +2 -0
- package/src/blocks/MessagesCard/MessagesCard.stories.tsx +14 -0
- package/src/blocks/MessagesCard/MessagesCard.test.tsx +9 -0
- package/src/blocks/MessagesCard/MessagesCard.tsx +59 -0
- package/src/blocks/MessagesCard/index.ts +2 -0
- package/src/blocks/MetricCard/MetricCard.stories.tsx +14 -0
- package/src/blocks/MetricCard/MetricCard.test.tsx +9 -0
- package/src/blocks/MetricCard/MetricCard.tsx +79 -0
- package/src/blocks/MetricCard/index.ts +2 -0
- package/src/blocks/NotificationSettings/NotificationSettings.stories.tsx +14 -0
- package/src/blocks/NotificationSettings/NotificationSettings.test.tsx +9 -0
- package/src/blocks/NotificationSettings/NotificationSettings.tsx +61 -0
- package/src/blocks/NotificationSettings/index.ts +2 -0
- package/src/blocks/OrganizationMenu/OrganizationMenu.stories.tsx +14 -0
- package/src/blocks/OrganizationMenu/OrganizationMenu.test.tsx +9 -0
- package/src/blocks/OrganizationMenu/OrganizationMenu.tsx +66 -0
- package/src/blocks/OrganizationMenu/index.ts +2 -0
- package/src/blocks/RolesMenu/RolesMenu.stories.tsx +14 -0
- package/src/blocks/RolesMenu/RolesMenu.test.tsx +9 -0
- package/src/blocks/RolesMenu/RolesMenu.tsx +61 -0
- package/src/blocks/RolesMenu/index.ts +2 -0
- package/src/blocks/SelectUsersModal/SelectUsersModal.stories.tsx +14 -0
- package/src/blocks/SelectUsersModal/SelectUsersModal.test.tsx +9 -0
- package/src/blocks/SelectUsersModal/SelectUsersModal.tsx +64 -0
- package/src/blocks/SelectUsersModal/index.ts +2 -0
- package/src/blocks/SidebarLayoutDashboard/SidebarLayoutDashboard.stories.tsx +14 -0
- package/src/blocks/SidebarLayoutDashboard/SidebarLayoutDashboard.test.tsx +9 -0
- package/src/blocks/SidebarLayoutDashboard/SidebarLayoutDashboard.tsx +97 -0
- package/src/blocks/SidebarLayoutDashboard/index.ts +2 -0
- package/src/blocks/SidebarLayoutGroups/SidebarLayoutGroups.stories.tsx +14 -0
- package/src/blocks/SidebarLayoutGroups/SidebarLayoutGroups.test.tsx +9 -0
- package/src/blocks/SidebarLayoutGroups/SidebarLayoutGroups.tsx +79 -0
- package/src/blocks/SidebarLayoutGroups/index.ts +2 -0
- package/src/blocks/SidebarLayoutMinimal/SidebarLayoutMinimal.stories.tsx +14 -0
- package/src/blocks/SidebarLayoutMinimal/SidebarLayoutMinimal.test.tsx +9 -0
- package/src/blocks/SidebarLayoutMinimal/SidebarLayoutMinimal.tsx +73 -0
- package/src/blocks/SidebarLayoutMinimal/index.ts +2 -0
- package/src/blocks/SidebarLayoutSearch/SidebarLayoutSearch.stories.tsx +14 -0
- package/src/blocks/SidebarLayoutSearch/SidebarLayoutSearch.test.tsx +9 -0
- package/src/blocks/SidebarLayoutSearch/SidebarLayoutSearch.tsx +79 -0
- package/src/blocks/SidebarLayoutSearch/index.ts +2 -0
- package/src/blocks/SidebarLayoutUser/SidebarLayoutUser.stories.tsx +14 -0
- package/src/blocks/SidebarLayoutUser/SidebarLayoutUser.test.tsx +9 -0
- package/src/blocks/SidebarLayoutUser/SidebarLayoutUser.tsx +82 -0
- package/src/blocks/SidebarLayoutUser/index.ts +2 -0
- package/src/blocks/SortableTaskList/SortableTaskList.stories.tsx +14 -0
- package/src/blocks/SortableTaskList/SortableTaskList.test.tsx +9 -0
- package/src/blocks/SortableTaskList/SortableTaskList.tsx +70 -0
- package/src/blocks/SortableTaskList/index.ts +2 -0
- package/src/blocks/StackedLayoutBranded/StackedLayoutBranded.stories.tsx +14 -0
- package/src/blocks/StackedLayoutBranded/StackedLayoutBranded.test.tsx +9 -0
- package/src/blocks/StackedLayoutBranded/StackedLayoutBranded.tsx +64 -0
- package/src/blocks/StackedLayoutBranded/index.ts +2 -0
- package/src/blocks/StackedLayoutTabs/StackedLayoutTabs.stories.tsx +14 -0
- package/src/blocks/StackedLayoutTabs/StackedLayoutTabs.test.tsx +9 -0
- package/src/blocks/StackedLayoutTabs/StackedLayoutTabs.tsx +80 -0
- package/src/blocks/StackedLayoutTabs/index.ts +2 -0
- package/src/blocks/TaskCard/TaskCard.stories.tsx +14 -0
- package/src/blocks/TaskCard/TaskCard.test.tsx +9 -0
- package/src/blocks/TaskCard/TaskCard.tsx +88 -0
- package/src/blocks/TaskCard/index.ts +2 -0
- package/src/blocks/UserMenu/UserMenu.stories.tsx +14 -0
- package/src/blocks/UserMenu/UserMenu.test.tsx +9 -0
- package/src/blocks/UserMenu/UserMenu.tsx +62 -0
- package/src/blocks/UserMenu/index.ts +2 -0
- package/src/blocks/WorkspaceMembers/WorkspaceMembers.stories.tsx +14 -0
- package/src/blocks/WorkspaceMembers/WorkspaceMembers.test.tsx +9 -0
- package/src/blocks/WorkspaceMembers/WorkspaceMembers.tsx +61 -0
- package/src/blocks/WorkspaceMembers/index.ts +2 -0
- package/src/blocks/activity-heatmap.tsx +122 -0
- package/src/blocks/bar-list.tsx +75 -0
- package/src/blocks/chat-detail.tsx +73 -0
- package/src/blocks/feedback-modal.tsx +68 -0
- package/src/blocks/file-cards.tsx +56 -0
- package/src/blocks/files-list.tsx +72 -0
- package/src/blocks/integration-card.tsx +50 -0
- package/src/blocks/invite-modal.tsx +69 -0
- package/src/blocks/manage-tags-modal.tsx +63 -0
- package/src/blocks/messages-card.tsx +59 -0
- package/src/blocks/metric-card.tsx +79 -0
- package/src/blocks/notification-settings.tsx +61 -0
- package/src/blocks/organization-menu.tsx +85 -0
- package/src/blocks/roles-menu.tsx +61 -0
- package/src/blocks/select-users-modal.tsx +64 -0
- package/src/blocks/sidebar-layout-dashboard.tsx +97 -0
- package/src/blocks/sidebar-layout-groups.tsx +79 -0
- package/src/blocks/sidebar-layout-minimal.tsx +73 -0
- package/src/blocks/sidebar-layout-search.tsx +79 -0
- package/src/blocks/sidebar-layout-user.tsx +82 -0
- package/src/blocks/sortable-task-list.tsx +70 -0
- package/src/blocks/stacked-layout-branded.tsx +64 -0
- package/src/blocks/stacked-layout-tabs.tsx +80 -0
- package/src/blocks/task-card.tsx +88 -0
- package/src/blocks/user-menu.tsx +62 -0
- package/src/blocks/utils/cn.ts +1 -0
- package/src/blocks/workspace-members.tsx +61 -0
- package/src/charts/area-chart.tsx +83 -0
- package/src/charts/bar-chart.tsx +146 -0
- package/src/charts/heatmap.tsx +185 -0
- package/src/charts/line-chart.tsx +89 -0
- package/src/charts/sparkline.tsx +62 -0
- package/src/charts/utils/cn.ts +1 -0
- package/src/components/Banner/Banner.stories.tsx +14 -0
- package/src/components/Banner/Banner.test.tsx +9 -0
- package/src/components/Banner/Banner.tsx +203 -0
- package/src/components/Banner/index.ts +2 -0
- package/src/components/Breadcrumb/Breadcrumb.stories.tsx +14 -0
- package/src/components/Breadcrumb/Breadcrumb.test.tsx +9 -0
- package/src/components/Breadcrumb/Breadcrumb.tsx +58 -0
- package/src/components/Breadcrumb/index.ts +2 -0
- package/src/components/CommandItem/CommandItem.stories.tsx +14 -0
- package/src/components/CommandItem/CommandItem.test.tsx +9 -0
- package/src/components/CommandItem/CommandItem.tsx +36 -0
- package/src/components/CommandItem/index.ts +2 -0
- package/src/components/DataGrid/DataGrid.stories.tsx +14 -0
- package/src/components/DataGrid/DataGrid.test.tsx +9 -0
- package/src/components/DataGrid/DataGrid.tsx +125 -0
- package/src/components/DataGrid/index.ts +2 -0
- package/src/components/DataTable/DataTable.stories.tsx +14 -0
- package/src/components/DataTable/DataTable.test.tsx +9 -0
- package/src/components/DataTable/DataTable.tsx +139 -0
- package/src/components/DataTable/index.ts +2 -0
- package/src/components/EmptyState/EmptyState.stories.tsx +14 -0
- package/src/components/EmptyState/EmptyState.test.tsx +9 -0
- package/src/components/EmptyState/EmptyState.tsx +106 -0
- package/src/components/EmptyState/index.ts +2 -0
- package/src/components/Hotkeys/Hotkeys.stories.tsx +14 -0
- package/src/components/Hotkeys/Hotkeys.test.tsx +9 -0
- package/src/components/Hotkeys/Hotkeys.tsx +31 -0
- package/src/components/Hotkeys/index.ts +2 -0
- package/src/components/IconBadge/IconBadge.stories.tsx +14 -0
- package/src/components/IconBadge/IconBadge.test.tsx +9 -0
- package/src/components/IconBadge/IconBadge.tsx +35 -0
- package/src/components/IconBadge/index.ts +2 -0
- package/src/components/LoadingOverlay/LoadingOverlay.stories.tsx +14 -0
- package/src/components/LoadingOverlay/LoadingOverlay.test.tsx +9 -0
- package/src/components/LoadingOverlay/LoadingOverlay.tsx +38 -0
- package/src/components/LoadingOverlay/index.ts +2 -0
- package/src/components/Persona/Persona.stories.tsx +14 -0
- package/src/components/Persona/Persona.test.tsx +9 -0
- package/src/components/Persona/Persona.tsx +38 -0
- package/src/components/Persona/index.ts +2 -0
- package/src/components/PropertyList/PropertyList.stories.tsx +14 -0
- package/src/components/PropertyList/PropertyList.test.tsx +9 -0
- package/src/components/PropertyList/PropertyList.tsx +29 -0
- package/src/components/PropertyList/index.ts +2 -0
- package/src/components/Stat/Stat.stories.tsx +14 -0
- package/src/components/Stat/Stat.test.tsx +9 -0
- package/src/components/Stat/Stat.tsx +51 -0
- package/src/components/Stat/index.ts +2 -0
- package/src/components/Stepper/Stepper.stories.tsx +14 -0
- package/src/components/Stepper/Stepper.test.tsx +9 -0
- package/src/components/Stepper/Stepper.tsx +58 -0
- package/src/components/Stepper/index.ts +2 -0
- package/src/components/StructuredList/StructuredList.stories.tsx +14 -0
- package/src/components/StructuredList/StructuredList.test.tsx +9 -0
- package/src/components/StructuredList/StructuredList.tsx +51 -0
- package/src/components/StructuredList/index.ts +2 -0
- package/src/components/Timeline/Timeline.stories.tsx +14 -0
- package/src/components/Timeline/Timeline.test.tsx +9 -0
- package/src/components/Timeline/Timeline.tsx +69 -0
- package/src/components/Timeline/index.ts +2 -0
- package/src/components/Toaster/Toaster.stories.tsx +14 -0
- package/src/components/Toaster/Toaster.test.tsx +9 -0
- package/src/components/Toaster/Toaster.tsx +42 -0
- package/src/components/Toaster/index.ts +2 -0
- package/src/components/banner.tsx +203 -0
- package/src/components/breadcrumb.tsx +58 -0
- package/src/components/command-item.tsx +36 -0
- package/src/components/data-grid.tsx +125 -0
- package/src/components/data-table.tsx +139 -0
- package/src/components/empty-state.tsx +31 -0
- package/src/components/hotkeys.tsx +31 -0
- package/src/components/icon-badge.tsx +35 -0
- package/src/components/loading-overlay.tsx +38 -0
- package/src/components/persona.tsx +38 -0
- package/src/components/property-list.tsx +29 -0
- package/src/components/stat.tsx +51 -0
- package/src/components/stepper.tsx +69 -0
- package/src/components/structured-list.tsx +51 -0
- package/src/components/timeline.tsx +69 -0
- package/src/components/toaster.tsx +42 -0
- package/src/components/utils/cn.ts +1 -0
- package/src/data/ActionBar.tsx +115 -0
- package/src/data/DataGrid.tsx +453 -0
- package/src/data/DataList.tsx +79 -0
- package/src/data/EventCalendar.tsx +794 -0
- package/src/data/Filters.tsx +271 -0
- package/src/data/GridList.tsx +67 -0
- package/src/data/ImageCrop.tsx +198 -0
- package/src/data/SortableList.tsx +258 -0
- package/src/data/Tree.tsx +510 -0
- package/src/data/VideoPlayer.tsx +564 -0
- package/src/data/index.ts +6 -0
- package/src/engagement/Beacon/Beacon.stories.tsx +14 -0
- package/src/engagement/Beacon/Beacon.test.tsx +9 -0
- package/src/engagement/Beacon/Beacon.tsx +50 -0
- package/src/engagement/Beacon/index.ts +2 -0
- package/src/engagement/Tour/Tour.stories.tsx +14 -0
- package/src/engagement/Tour/Tour.test.tsx +9 -0
- package/src/engagement/Tour/Tour.tsx +106 -0
- package/src/engagement/Tour/index.ts +2 -0
- package/src/engagement/beacon.tsx +50 -0
- package/src/engagement/checklist.tsx +259 -0
- package/src/engagement/intro-disclosure.tsx +210 -0
- package/src/engagement/tour.tsx +106 -0
- package/src/engagement/utils/cn.ts +1 -0
- package/src/feedback/Toaster.tsx +141 -0
- package/src/feedback/index.ts +2 -0
- package/src/feedback/toast-emitter.ts +74 -0
- package/src/forms/ArrayField/ArrayField.stories.tsx +14 -0
- package/src/forms/ArrayField/ArrayField.test.tsx +9 -0
- package/src/forms/ArrayField/ArrayField.tsx +61 -0
- package/src/forms/ArrayField/index.ts +2 -0
- package/src/forms/AutoForm/AutoForm.stories.tsx +14 -0
- package/src/forms/AutoForm/AutoForm.test.tsx +9 -0
- package/src/forms/AutoForm/AutoForm.tsx +133 -0
- package/src/forms/AutoForm/index.ts +2 -0
- package/src/forms/DatePicker/DatePicker.stories.tsx +14 -0
- package/src/forms/DatePicker/DatePicker.test.tsx +9 -0
- package/src/forms/DatePicker/DatePicker.tsx +109 -0
- package/src/forms/DatePicker/index.ts +2 -0
- package/src/forms/Field/Field.stories.tsx +14 -0
- package/src/forms/Field/Field.test.tsx +9 -0
- package/src/forms/Field/Field.tsx +62 -0
- package/src/forms/Field/index.ts +2 -0
- package/src/forms/FileUpload/FileUpload.stories.tsx +14 -0
- package/src/forms/FileUpload/FileUpload.test.tsx +9 -0
- package/src/forms/FileUpload/FileUpload.tsx +101 -0
- package/src/forms/FileUpload/index.ts +2 -0
- package/src/forms/Form/Form.stories.tsx +14 -0
- package/src/forms/Form/Form.test.tsx +9 -0
- package/src/forms/Form/Form.tsx +57 -0
- package/src/forms/Form/index.ts +2 -0
- package/src/forms/ObjectField/ObjectField.stories.tsx +14 -0
- package/src/forms/ObjectField/ObjectField.test.tsx +9 -0
- package/src/forms/ObjectField/ObjectField.tsx +53 -0
- package/src/forms/ObjectField/index.ts +2 -0
- package/src/forms/PasswordInput/PasswordInput.stories.tsx +14 -0
- package/src/forms/PasswordInput/PasswordInput.test.tsx +9 -0
- package/src/forms/PasswordInput/PasswordInput.tsx +54 -0
- package/src/forms/PasswordInput/index.ts +2 -0
- package/src/forms/SearchInput/SearchInput.stories.tsx +14 -0
- package/src/forms/SearchInput/SearchInput.test.tsx +9 -0
- package/src/forms/SearchInput/SearchInput.tsx +64 -0
- package/src/forms/SearchInput/index.ts +2 -0
- package/src/forms/StepForm/StepForm.stories.tsx +14 -0
- package/src/forms/StepForm/StepForm.test.tsx +9 -0
- package/src/forms/StepForm/StepForm.tsx +113 -0
- package/src/forms/StepForm/index.ts +2 -0
- package/src/forms/array-field.tsx +61 -0
- package/src/forms/auto-form.tsx +133 -0
- package/src/forms/color-picker.tsx +258 -0
- package/src/forms/combobox.tsx +106 -0
- package/src/forms/date-picker.tsx +109 -0
- package/src/forms/field.tsx +62 -0
- package/src/forms/file-upload.tsx +101 -0
- package/src/forms/form.tsx +57 -0
- package/src/forms/object-field.tsx +53 -0
- package/src/forms/password-input.tsx +54 -0
- package/src/forms/search-input.tsx +64 -0
- package/src/forms/step-form.tsx +113 -0
- package/src/forms/tags.tsx +270 -0
- package/src/forms/utils/cn.ts +1 -0
- package/src/headers/ScrollHeader.tsx +110 -0
- package/src/headers/index.ts +1 -0
- package/src/index.ts +171 -0
- package/src/layout/PageContainer.tsx +40 -0
- package/src/layout/PageLayout.tsx +55 -0
- package/src/layout/index.ts +2 -0
- package/src/layouts/AppShell/AppShell.stories.tsx +14 -0
- package/src/layouts/AppShell/AppShell.test.tsx +9 -0
- package/src/layouts/AppShell/AppShell.tsx +129 -0
- package/src/layouts/AppShell/index.ts +2 -0
- package/src/layouts/Container/Container.stories.tsx +14 -0
- package/src/layouts/Container/Container.test.tsx +9 -0
- package/src/layouts/Container/Container.tsx +33 -0
- package/src/layouts/Container/index.ts +2 -0
- package/src/layouts/Navbar/Navbar.stories.tsx +14 -0
- package/src/layouts/Navbar/Navbar.test.tsx +9 -0
- package/src/layouts/Navbar/Navbar.tsx +60 -0
- package/src/layouts/Navbar/index.ts +2 -0
- package/src/layouts/Page/Page.stories.tsx +14 -0
- package/src/layouts/Page/Page.test.tsx +9 -0
- package/src/layouts/Page/Page.tsx +61 -0
- package/src/layouts/Page/index.ts +2 -0
- package/src/layouts/ResizeBox/ResizeBox.stories.tsx +14 -0
- package/src/layouts/ResizeBox/ResizeBox.test.tsx +9 -0
- package/src/layouts/ResizeBox/ResizeBox.tsx +45 -0
- package/src/layouts/ResizeBox/index.ts +2 -0
- package/src/layouts/Sidebar/Sidebar.stories.tsx +14 -0
- package/src/layouts/Sidebar/Sidebar.test.tsx +9 -0
- package/src/layouts/Sidebar/Sidebar.tsx +99 -0
- package/src/layouts/Sidebar/index.ts +2 -0
- package/src/layouts/SplitPage/SplitPage.stories.tsx +14 -0
- package/src/layouts/SplitPage/SplitPage.test.tsx +9 -0
- package/src/layouts/SplitPage/SplitPage.tsx +32 -0
- package/src/layouts/SplitPage/index.ts +2 -0
- package/src/layouts/Stack/Stack.stories.tsx +14 -0
- package/src/layouts/Stack/Stack.test.tsx +9 -0
- package/src/layouts/Stack/Stack.tsx +56 -0
- package/src/layouts/Stack/index.ts +2 -0
- package/src/layouts/app-shell.tsx +129 -0
- package/src/layouts/container.tsx +33 -0
- package/src/layouts/navbar.tsx +60 -0
- package/src/layouts/page.tsx +61 -0
- package/src/layouts/resize-box.tsx +45 -0
- package/src/layouts/sidebar.tsx +99 -0
- package/src/layouts/split-page.tsx +32 -0
- package/src/layouts/stack.tsx +56 -0
- package/src/layouts/utils/cn.ts +1 -0
- package/src/motion/FadeIn.tsx +33 -0
- package/src/motion/Morph.tsx +17 -0
- package/src/motion/Parallax.tsx +37 -0
- package/src/motion/Reveal.tsx +32 -0
- package/src/motion/Ripple.tsx +78 -0
- package/src/motion/ScaleIn.tsx +33 -0
- package/src/motion/SlideIn.tsx +42 -0
- package/src/motion/Stagger.tsx +48 -0
- package/src/motion/Transition.tsx +13 -0
- package/src/motion/index.ts +13 -0
- package/src/motion/presets.ts +33 -0
- package/src/motion/useLayoutId.ts +6 -0
- package/src/nav/CommandPalette.tsx +197 -0
- package/src/nav/HotkeysProvider.tsx +223 -0
- package/src/nav/index.ts +2 -0
- package/src/primitives/Accordion/Accordion.stories.tsx +14 -0
- package/src/primitives/Accordion/Accordion.test.tsx +9 -0
- package/src/primitives/Accordion/Accordion.tsx +56 -0
- package/src/primitives/Accordion/index.ts +2 -0
- package/src/primitives/Alert/Alert.stories.tsx +14 -0
- package/src/primitives/Alert/Alert.test.tsx +9 -0
- package/src/primitives/Alert/Alert.tsx +60 -0
- package/src/primitives/Alert/index.ts +2 -0
- package/src/primitives/AlertDialog/AlertDialog.stories.tsx +14 -0
- package/src/primitives/AlertDialog/AlertDialog.test.tsx +9 -0
- package/src/primitives/AlertDialog/AlertDialog.tsx +140 -0
- package/src/primitives/AlertDialog/index.ts +2 -0
- package/src/primitives/AspectRatio/AspectRatio.stories.tsx +14 -0
- package/src/primitives/AspectRatio/AspectRatio.test.tsx +9 -0
- package/src/primitives/AspectRatio/AspectRatio.tsx +6 -0
- package/src/primitives/AspectRatio/index.ts +2 -0
- package/src/primitives/Avatar/Avatar.stories.tsx +14 -0
- package/src/primitives/Avatar/Avatar.test.tsx +9 -0
- package/src/primitives/Avatar/Avatar.tsx +35 -0
- package/src/primitives/Avatar/index.ts +2 -0
- package/src/primitives/Badge/Badge.stories.tsx +14 -0
- package/src/primitives/Badge/Badge.test.tsx +9 -0
- package/src/primitives/Badge/Badge.tsx +28 -0
- package/src/primitives/Badge/index.ts +2 -0
- package/src/primitives/Button/Button.stories.tsx +14 -0
- package/src/primitives/Button/Button.test.tsx +9 -0
- package/src/primitives/Button/Button.tsx +113 -0
- package/src/primitives/Button/index.ts +2 -0
- package/src/primitives/Calendar/Calendar.stories.tsx +14 -0
- package/src/primitives/Calendar/Calendar.test.tsx +9 -0
- package/src/primitives/Calendar/Calendar.tsx +214 -0
- package/src/primitives/Calendar/index.ts +2 -0
- package/src/primitives/Card/Card.stories.tsx +14 -0
- package/src/primitives/Card/Card.test.tsx +9 -0
- package/src/primitives/Card/Card.tsx +48 -0
- package/src/primitives/Card/TextureCard.tsx +93 -0
- package/src/primitives/Card/index.ts +3 -0
- package/src/primitives/Carousel/Carousel.stories.tsx +14 -0
- package/src/primitives/Carousel/Carousel.test.tsx +9 -0
- package/src/primitives/Carousel/Carousel.tsx +261 -0
- package/src/primitives/Carousel/index.ts +2 -0
- package/src/primitives/Chart/Chart.stories.tsx +14 -0
- package/src/primitives/Chart/Chart.test.tsx +9 -0
- package/src/primitives/Chart/Chart.tsx +368 -0
- package/src/primitives/Chart/index.ts +2 -0
- package/src/primitives/Checkbox/Checkbox.stories.tsx +14 -0
- package/src/primitives/Checkbox/Checkbox.test.tsx +9 -0
- package/src/primitives/Checkbox/Checkbox.tsx +27 -0
- package/src/primitives/Checkbox/index.ts +2 -0
- package/src/primitives/Collapsible/Collapsible.stories.tsx +14 -0
- package/src/primitives/Collapsible/Collapsible.test.tsx +9 -0
- package/src/primitives/Collapsible/Collapsible.tsx +12 -0
- package/src/primitives/Collapsible/index.ts +2 -0
- package/src/primitives/Command/Command.stories.tsx +14 -0
- package/src/primitives/Command/Command.test.tsx +9 -0
- package/src/primitives/Command/Command.tsx +154 -0
- package/src/primitives/Command/index.ts +2 -0
- package/src/primitives/ContextMenu/ContextMenu.stories.tsx +14 -0
- package/src/primitives/ContextMenu/ContextMenu.test.tsx +9 -0
- package/src/primitives/ContextMenu/ContextMenu.tsx +101 -0
- package/src/primitives/ContextMenu/index.ts +2 -0
- package/src/primitives/Dialog/Dialog.stories.tsx +14 -0
- package/src/primitives/Dialog/Dialog.test.tsx +9 -0
- package/src/primitives/Dialog/Dialog.tsx +88 -0
- package/src/primitives/Dialog/DialogProvider.tsx +130 -0
- package/src/primitives/Dialog/index.ts +3 -0
- package/src/primitives/Drawer/Drawer.stories.tsx +14 -0
- package/src/primitives/Drawer/Drawer.test.tsx +9 -0
- package/src/primitives/Drawer/Drawer.tsx +123 -0
- package/src/primitives/Drawer/index.ts +2 -0
- package/src/primitives/DropdownMenu/DropdownMenu.stories.tsx +14 -0
- package/src/primitives/DropdownMenu/DropdownMenu.test.tsx +9 -0
- package/src/primitives/DropdownMenu/DropdownMenu.tsx +111 -0
- package/src/primitives/DropdownMenu/index.ts +2 -0
- package/src/primitives/Form/Form.stories.tsx +14 -0
- package/src/primitives/Form/Form.test.tsx +9 -0
- package/src/primitives/Form/Form.tsx +179 -0
- package/src/primitives/Form/index.ts +2 -0
- package/src/primitives/HoverCard/HoverCard.stories.tsx +14 -0
- package/src/primitives/HoverCard/HoverCard.test.tsx +9 -0
- package/src/primitives/HoverCard/HoverCard.tsx +31 -0
- package/src/primitives/HoverCard/index.ts +2 -0
- package/src/primitives/Input/Input.stories.tsx +14 -0
- package/src/primitives/Input/Input.test.tsx +9 -0
- package/src/primitives/Input/Input.tsx +110 -0
- package/src/primitives/Input/index.ts +2 -0
- package/src/primitives/InputOtp/InputOtp.stories.tsx +14 -0
- package/src/primitives/InputOtp/InputOtp.test.tsx +9 -0
- package/src/primitives/InputOtp/InputOtp.tsx +70 -0
- package/src/primitives/InputOtp/index.ts +2 -0
- package/src/primitives/Label/Label.stories.tsx +14 -0
- package/src/primitives/Label/Label.test.tsx +9 -0
- package/src/primitives/Label/Label.tsx +27 -0
- package/src/primitives/Label/index.ts +2 -0
- package/src/primitives/Menubar/Menubar.stories.tsx +14 -0
- package/src/primitives/Menubar/Menubar.test.tsx +9 -0
- package/src/primitives/Menubar/Menubar.tsx +255 -0
- package/src/primitives/Menubar/index.ts +2 -0
- package/src/primitives/NavigationMenu/NavigationMenu.stories.tsx +14 -0
- package/src/primitives/NavigationMenu/NavigationMenu.test.tsx +9 -0
- package/src/primitives/NavigationMenu/NavigationMenu.tsx +129 -0
- package/src/primitives/NavigationMenu/index.ts +2 -0
- package/src/primitives/Pagination/Pagination.stories.tsx +14 -0
- package/src/primitives/Pagination/Pagination.test.tsx +9 -0
- package/src/primitives/Pagination/Pagination.tsx +118 -0
- package/src/primitives/Pagination/index.ts +2 -0
- package/src/primitives/Popover/Popover.stories.tsx +14 -0
- package/src/primitives/Popover/Popover.test.tsx +9 -0
- package/src/primitives/Popover/Popover.tsx +30 -0
- package/src/primitives/Popover/index.ts +2 -0
- package/src/primitives/Progress/Progress.stories.tsx +14 -0
- package/src/primitives/Progress/Progress.test.tsx +9 -0
- package/src/primitives/Progress/Progress.tsx +20 -0
- package/src/primitives/Progress/index.ts +2 -0
- package/src/primitives/Radio/Radio.stories.tsx +14 -0
- package/src/primitives/Radio/Radio.test.tsx +9 -0
- package/src/primitives/Radio/Radio.tsx +33 -0
- package/src/primitives/Radio/index.ts +2 -0
- package/src/primitives/Resizable/Resizable.stories.tsx +14 -0
- package/src/primitives/Resizable/Resizable.test.tsx +9 -0
- package/src/primitives/Resizable/Resizable.tsx +44 -0
- package/src/primitives/Resizable/index.ts +2 -0
- package/src/primitives/ScrollArea/ScrollArea.stories.tsx +14 -0
- package/src/primitives/ScrollArea/ScrollArea.test.tsx +9 -0
- package/src/primitives/ScrollArea/ScrollArea.tsx +49 -0
- package/src/primitives/ScrollArea/index.ts +2 -0
- package/src/primitives/Select/Select.stories.tsx +14 -0
- package/src/primitives/Select/Select.test.tsx +9 -0
- package/src/primitives/Select/Select.tsx +140 -0
- package/src/primitives/Select/index.ts +2 -0
- package/src/primitives/Separator/Separator.stories.tsx +14 -0
- package/src/primitives/Separator/Separator.test.tsx +9 -0
- package/src/primitives/Separator/Separator.tsx +21 -0
- package/src/primitives/Separator/index.ts +2 -0
- package/src/primitives/Sheet/Sheet.stories.tsx +14 -0
- package/src/primitives/Sheet/Sheet.test.tsx +9 -0
- package/src/primitives/Sheet/Sheet.tsx +88 -0
- package/src/primitives/Sheet/index.ts +2 -0
- package/src/primitives/Skeleton/Skeleton.stories.tsx +14 -0
- package/src/primitives/Skeleton/Skeleton.test.tsx +9 -0
- package/src/primitives/Skeleton/Skeleton.tsx +71 -0
- package/src/primitives/Skeleton/index.ts +2 -0
- package/src/primitives/Slider/Slider.stories.tsx +14 -0
- package/src/primitives/Slider/Slider.test.tsx +9 -0
- package/src/primitives/Slider/Slider.tsx +20 -0
- package/src/primitives/Slider/index.ts +2 -0
- package/src/primitives/Sonner/Sonner.stories.tsx +14 -0
- package/src/primitives/Sonner/Sonner.test.tsx +9 -0
- package/src/primitives/Sonner/Sonner.tsx +30 -0
- package/src/primitives/Sonner/index.ts +2 -0
- package/src/primitives/Spinner/Spinner.stories.tsx +14 -0
- package/src/primitives/Spinner/Spinner.test.tsx +9 -0
- package/src/primitives/Spinner/Spinner.tsx +17 -0
- package/src/primitives/Spinner/index.ts +2 -0
- package/src/primitives/Switch/Switch.stories.tsx +14 -0
- package/src/primitives/Switch/Switch.test.tsx +9 -0
- package/src/primitives/Switch/Switch.tsx +31 -0
- package/src/primitives/Switch/index.ts +2 -0
- package/src/primitives/Table/Table.stories.tsx +14 -0
- package/src/primitives/Table/Table.test.tsx +9 -0
- package/src/primitives/Table/Table.tsx +121 -0
- package/src/primitives/Table/index.ts +2 -0
- package/src/primitives/Tabs/Tabs.stories.tsx +14 -0
- package/src/primitives/Tabs/Tabs.test.tsx +9 -0
- package/src/primitives/Tabs/Tabs.tsx +53 -0
- package/src/primitives/Tabs/index.ts +2 -0
- package/src/primitives/Textarea/Textarea.stories.tsx +14 -0
- package/src/primitives/Textarea/Textarea.test.tsx +9 -0
- package/src/primitives/Textarea/Textarea.tsx +22 -0
- package/src/primitives/Textarea/index.ts +2 -0
- package/src/primitives/Toggle/Toggle.stories.tsx +14 -0
- package/src/primitives/Toggle/Toggle.test.tsx +9 -0
- package/src/primitives/Toggle/Toggle.tsx +44 -0
- package/src/primitives/Toggle/index.ts +2 -0
- package/src/primitives/ToggleGroup/ToggleGroup.stories.tsx +14 -0
- package/src/primitives/ToggleGroup/ToggleGroup.test.tsx +9 -0
- package/src/primitives/ToggleGroup/ToggleGroup.tsx +62 -0
- package/src/primitives/ToggleGroup/index.ts +2 -0
- package/src/primitives/Tooltip/Tooltip.stories.tsx +14 -0
- package/src/primitives/Tooltip/Tooltip.test.tsx +9 -0
- package/src/primitives/Tooltip/Tooltip.tsx +29 -0
- package/src/primitives/Tooltip/index.ts +2 -0
- package/src/primitives/accordion.tsx +56 -0
- package/src/primitives/alert-dialog.tsx +140 -0
- package/src/primitives/alert.tsx +60 -0
- package/src/primitives/aspect-ratio.tsx +6 -0
- package/src/primitives/avatar.tsx +100 -0
- package/src/primitives/badge.tsx +28 -0
- package/src/primitives/button.tsx +43 -0
- package/src/primitives/calendar.tsx +214 -0
- package/src/primitives/card.tsx +48 -0
- package/src/primitives/carousel.tsx +261 -0
- package/src/primitives/chart.tsx +368 -0
- package/src/primitives/checkbox.tsx +26 -0
- package/src/primitives/code-block.tsx +173 -0
- package/src/primitives/collapsible.tsx +12 -0
- package/src/primitives/command.tsx +154 -0
- package/src/primitives/comparison.tsx +184 -0
- package/src/primitives/context-menu.tsx +101 -0
- package/src/primitives/dialog.tsx +88 -0
- package/src/primitives/drawer.tsx +117 -0
- package/src/primitives/dropdown-menu.tsx +111 -0
- package/src/primitives/form.tsx +179 -0
- package/src/primitives/hover-card.tsx +30 -0
- package/src/primitives/input-otp.tsx +70 -0
- package/src/primitives/input.tsx +23 -0
- package/src/primitives/label.tsx +27 -0
- package/src/primitives/logo-carousel.tsx +110 -0
- package/src/primitives/marquee.tsx +84 -0
- package/src/primitives/menubar.tsx +255 -0
- package/src/primitives/navigation-menu.tsx +129 -0
- package/src/primitives/pagination.tsx +118 -0
- package/src/primitives/popover.tsx +29 -0
- package/src/primitives/progress.tsx +20 -0
- package/src/primitives/qr-code.tsx +89 -0
- package/src/primitives/radio.tsx +33 -0
- package/src/primitives/rating.tsx +157 -0
- package/src/primitives/resizable.tsx +43 -0
- package/src/primitives/scroll-area.tsx +49 -0
- package/src/primitives/select.tsx +137 -0
- package/src/primitives/separator.tsx +21 -0
- package/src/primitives/sheet.tsx +87 -0
- package/src/primitives/skeleton.tsx +11 -0
- package/src/primitives/slider.tsx +20 -0
- package/src/primitives/sonner.tsx +27 -0
- package/src/primitives/spinner.tsx +17 -0
- package/src/primitives/switch.tsx +30 -0
- package/src/primitives/table.tsx +121 -0
- package/src/primitives/tabs.tsx +53 -0
- package/src/primitives/textarea.tsx +22 -0
- package/src/primitives/texture-card.tsx +52 -0
- package/src/primitives/toggle-group.tsx +62 -0
- package/src/primitives/toggle.tsx +44 -0
- package/src/primitives/tooltip.tsx +28 -0
- package/src/primitives/utils/cn.ts +1 -0
- package/src/provider/otf-ui-provider.tsx +66 -0
- package/src/styles.css +6 -0
- package/src/text/AnimatedNumber.tsx +157 -0
- package/src/text/Body.tsx +47 -0
- package/src/text/Caption.tsx +32 -0
- package/src/text/Code.tsx +43 -0
- package/src/text/GradientHeading.tsx +90 -0
- package/src/text/Heading.tsx +44 -0
- package/src/text/TextReveal.tsx +96 -0
- package/src/text/Typewriter.tsx +107 -0
- package/src/text/index.ts +8 -0
- package/src/theme/ColorSchemeSelect.tsx +74 -0
- package/src/theme/ThemeSwitch.tsx +116 -0
- package/src/theme/index.ts +2 -0
- package/src/themes/base.css +25 -0
- package/src/themes/glass.css +142 -0
- package/src/themes/linear.css +123 -0
- package/src/themes/midnight.css +131 -0
- package/src/themes/minimal.css +121 -0
- package/src/utils/cn.ts +6 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
"use client"
|
|
3
|
+
|
|
4
|
+
import * as React from "react"
|
|
5
|
+
import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group"
|
|
6
|
+
import { type VariantProps } from "class-variance-authority"
|
|
7
|
+
|
|
8
|
+
import { cn } from "../utils/cn"
|
|
9
|
+
import { toggleVariants } from "../Toggle/Toggle"
|
|
10
|
+
|
|
11
|
+
const ToggleGroupContext = React.createContext<
|
|
12
|
+
VariantProps<typeof toggleVariants>
|
|
13
|
+
>({
|
|
14
|
+
size: "default",
|
|
15
|
+
variant: "default",
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
const ToggleGroup = React.forwardRef<
|
|
19
|
+
React.ElementRef<typeof ToggleGroupPrimitive.Root>,
|
|
20
|
+
React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Root> &
|
|
21
|
+
VariantProps<typeof toggleVariants>
|
|
22
|
+
>(({ className, variant, size, children, ...props }, ref) => (
|
|
23
|
+
<ToggleGroupPrimitive.Root
|
|
24
|
+
ref={ref}
|
|
25
|
+
className={cn("flex items-center justify-center gap-1", className)}
|
|
26
|
+
{...props}
|
|
27
|
+
>
|
|
28
|
+
<ToggleGroupContext.Provider value={{ variant, size }}>
|
|
29
|
+
{children}
|
|
30
|
+
</ToggleGroupContext.Provider>
|
|
31
|
+
</ToggleGroupPrimitive.Root>
|
|
32
|
+
))
|
|
33
|
+
|
|
34
|
+
ToggleGroup.displayName = ToggleGroupPrimitive.Root.displayName
|
|
35
|
+
|
|
36
|
+
const ToggleGroupItem = React.forwardRef<
|
|
37
|
+
React.ElementRef<typeof ToggleGroupPrimitive.Item>,
|
|
38
|
+
React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Item> &
|
|
39
|
+
VariantProps<typeof toggleVariants>
|
|
40
|
+
>(({ className, children, variant, size, ...props }, ref) => {
|
|
41
|
+
const context = React.useContext(ToggleGroupContext)
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
<ToggleGroupPrimitive.Item
|
|
45
|
+
ref={ref}
|
|
46
|
+
className={cn(
|
|
47
|
+
toggleVariants({
|
|
48
|
+
variant: context.variant || variant,
|
|
49
|
+
size: context.size || size,
|
|
50
|
+
}),
|
|
51
|
+
className
|
|
52
|
+
)}
|
|
53
|
+
{...props}
|
|
54
|
+
>
|
|
55
|
+
{children}
|
|
56
|
+
</ToggleGroupPrimitive.Item>
|
|
57
|
+
)
|
|
58
|
+
})
|
|
59
|
+
|
|
60
|
+
ToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName
|
|
61
|
+
|
|
62
|
+
export { ToggleGroup, ToggleGroupItem }
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
+
import { Tooltip } from './Tooltip'
|
|
3
|
+
|
|
4
|
+
// TODO: add all variants
|
|
5
|
+
const meta: Meta<typeof Tooltip> = {
|
|
6
|
+
title: 'Primitives/Tooltip',
|
|
7
|
+
component: Tooltip,
|
|
8
|
+
tags: ['autodocs'],
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export default meta
|
|
12
|
+
type Story = StoryObj<typeof Tooltip>
|
|
13
|
+
|
|
14
|
+
export const Default: Story = {}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import * as TooltipPrimitive from '@radix-ui/react-tooltip'
|
|
3
|
+
import { cn } from '../utils/cn'
|
|
4
|
+
|
|
5
|
+
export const TooltipProvider: typeof TooltipPrimitive.Provider = TooltipPrimitive.Provider
|
|
6
|
+
export const Tooltip: typeof TooltipPrimitive.Root = TooltipPrimitive.Root
|
|
7
|
+
export const TooltipTrigger: typeof TooltipPrimitive.Trigger = TooltipPrimitive.Trigger
|
|
8
|
+
|
|
9
|
+
export const TooltipContent = React.forwardRef<
|
|
10
|
+
React.ElementRef<typeof TooltipPrimitive.Content>,
|
|
11
|
+
React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>
|
|
12
|
+
>(({ className, sideOffset = 4, ...props }, ref) => (
|
|
13
|
+
<TooltipPrimitive.Portal>
|
|
14
|
+
<TooltipPrimitive.Content
|
|
15
|
+
ref={ref}
|
|
16
|
+
sideOffset={sideOffset}
|
|
17
|
+
data-slot="tooltip"
|
|
18
|
+
className={cn(
|
|
19
|
+
'z-50 overflow-hidden rounded-md bg-popover text-popover-foreground px-3 py-1.5 text-xs shadow-md',
|
|
20
|
+
'animate-in fade-in-0 zoom-in-95',
|
|
21
|
+
'data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95',
|
|
22
|
+
'data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2',
|
|
23
|
+
className
|
|
24
|
+
)}
|
|
25
|
+
{...props}
|
|
26
|
+
/>
|
|
27
|
+
</TooltipPrimitive.Portal>
|
|
28
|
+
))
|
|
29
|
+
TooltipContent.displayName = TooltipPrimitive.Content.displayName
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import * as React from "react"
|
|
3
|
+
import * as AccordionPrimitive from "@radix-ui/react-accordion"
|
|
4
|
+
import { ChevronDown } from "lucide-react"
|
|
5
|
+
|
|
6
|
+
import { cn } from "../utils/cn"
|
|
7
|
+
|
|
8
|
+
const Accordion = AccordionPrimitive.Root
|
|
9
|
+
|
|
10
|
+
const AccordionItem = React.forwardRef<
|
|
11
|
+
React.ElementRef<typeof AccordionPrimitive.Item>,
|
|
12
|
+
React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>
|
|
13
|
+
>(({ className, ...props }, ref) => (
|
|
14
|
+
<AccordionPrimitive.Item
|
|
15
|
+
ref={ref}
|
|
16
|
+
className={cn("border-b", className)}
|
|
17
|
+
{...props}
|
|
18
|
+
/>
|
|
19
|
+
))
|
|
20
|
+
AccordionItem.displayName = "AccordionItem"
|
|
21
|
+
|
|
22
|
+
const AccordionTrigger = React.forwardRef<
|
|
23
|
+
React.ElementRef<typeof AccordionPrimitive.Trigger>,
|
|
24
|
+
React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>
|
|
25
|
+
>(({ className, children, ...props }, ref) => (
|
|
26
|
+
<AccordionPrimitive.Header className="flex">
|
|
27
|
+
<AccordionPrimitive.Trigger
|
|
28
|
+
ref={ref}
|
|
29
|
+
className={cn(
|
|
30
|
+
"flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline text-left [&[data-state=open]>svg]:rotate-180",
|
|
31
|
+
className
|
|
32
|
+
)}
|
|
33
|
+
{...props}
|
|
34
|
+
>
|
|
35
|
+
{children}
|
|
36
|
+
<ChevronDown className="h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200" />
|
|
37
|
+
</AccordionPrimitive.Trigger>
|
|
38
|
+
</AccordionPrimitive.Header>
|
|
39
|
+
))
|
|
40
|
+
AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName
|
|
41
|
+
|
|
42
|
+
const AccordionContent = React.forwardRef<
|
|
43
|
+
React.ElementRef<typeof AccordionPrimitive.Content>,
|
|
44
|
+
React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>
|
|
45
|
+
>(({ className, children, ...props }, ref) => (
|
|
46
|
+
<AccordionPrimitive.Content
|
|
47
|
+
ref={ref}
|
|
48
|
+
className="overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down"
|
|
49
|
+
{...props}
|
|
50
|
+
>
|
|
51
|
+
<div className={cn("pb-4 pt-0", className)}>{children}</div>
|
|
52
|
+
</AccordionPrimitive.Content>
|
|
53
|
+
))
|
|
54
|
+
AccordionContent.displayName = AccordionPrimitive.Content.displayName
|
|
55
|
+
|
|
56
|
+
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent }
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import * as React from "react"
|
|
3
|
+
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog"
|
|
4
|
+
|
|
5
|
+
import { cn } from "../utils/cn"
|
|
6
|
+
import { buttonVariants } from "./button"
|
|
7
|
+
|
|
8
|
+
const AlertDialog = AlertDialogPrimitive.Root
|
|
9
|
+
|
|
10
|
+
const AlertDialogTrigger = AlertDialogPrimitive.Trigger
|
|
11
|
+
|
|
12
|
+
const AlertDialogPortal = AlertDialogPrimitive.Portal
|
|
13
|
+
|
|
14
|
+
const AlertDialogOverlay = React.forwardRef<
|
|
15
|
+
React.ElementRef<typeof AlertDialogPrimitive.Overlay>,
|
|
16
|
+
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>
|
|
17
|
+
>(({ className, ...props }, ref) => (
|
|
18
|
+
<AlertDialogPrimitive.Overlay
|
|
19
|
+
className={cn(
|
|
20
|
+
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
21
|
+
className
|
|
22
|
+
)}
|
|
23
|
+
{...props}
|
|
24
|
+
ref={ref}
|
|
25
|
+
/>
|
|
26
|
+
))
|
|
27
|
+
AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName
|
|
28
|
+
|
|
29
|
+
const AlertDialogContent = React.forwardRef<
|
|
30
|
+
React.ElementRef<typeof AlertDialogPrimitive.Content>,
|
|
31
|
+
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>
|
|
32
|
+
>(({ className, ...props }, ref) => (
|
|
33
|
+
<AlertDialogPortal>
|
|
34
|
+
<AlertDialogOverlay />
|
|
35
|
+
<AlertDialogPrimitive.Content
|
|
36
|
+
ref={ref}
|
|
37
|
+
className={cn(
|
|
38
|
+
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
|
|
39
|
+
className
|
|
40
|
+
)}
|
|
41
|
+
{...props}
|
|
42
|
+
/>
|
|
43
|
+
</AlertDialogPortal>
|
|
44
|
+
))
|
|
45
|
+
AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName
|
|
46
|
+
|
|
47
|
+
const AlertDialogHeader = ({
|
|
48
|
+
className,
|
|
49
|
+
...props
|
|
50
|
+
}: React.HTMLAttributes<HTMLDivElement>) => (
|
|
51
|
+
<div
|
|
52
|
+
className={cn(
|
|
53
|
+
"flex flex-col space-y-2 text-center sm:text-left",
|
|
54
|
+
className
|
|
55
|
+
)}
|
|
56
|
+
{...props}
|
|
57
|
+
/>
|
|
58
|
+
)
|
|
59
|
+
AlertDialogHeader.displayName = "AlertDialogHeader"
|
|
60
|
+
|
|
61
|
+
const AlertDialogFooter = ({
|
|
62
|
+
className,
|
|
63
|
+
...props
|
|
64
|
+
}: React.HTMLAttributes<HTMLDivElement>) => (
|
|
65
|
+
<div
|
|
66
|
+
className={cn(
|
|
67
|
+
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
|
|
68
|
+
className
|
|
69
|
+
)}
|
|
70
|
+
{...props}
|
|
71
|
+
/>
|
|
72
|
+
)
|
|
73
|
+
AlertDialogFooter.displayName = "AlertDialogFooter"
|
|
74
|
+
|
|
75
|
+
const AlertDialogTitle = React.forwardRef<
|
|
76
|
+
React.ElementRef<typeof AlertDialogPrimitive.Title>,
|
|
77
|
+
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>
|
|
78
|
+
>(({ className, ...props }, ref) => (
|
|
79
|
+
<AlertDialogPrimitive.Title
|
|
80
|
+
ref={ref}
|
|
81
|
+
className={cn("text-lg font-semibold", className)}
|
|
82
|
+
{...props}
|
|
83
|
+
/>
|
|
84
|
+
))
|
|
85
|
+
AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName
|
|
86
|
+
|
|
87
|
+
const AlertDialogDescription = React.forwardRef<
|
|
88
|
+
React.ElementRef<typeof AlertDialogPrimitive.Description>,
|
|
89
|
+
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>
|
|
90
|
+
>(({ className, ...props }, ref) => (
|
|
91
|
+
<AlertDialogPrimitive.Description
|
|
92
|
+
ref={ref}
|
|
93
|
+
className={cn("text-sm text-muted-foreground", className)}
|
|
94
|
+
{...props}
|
|
95
|
+
/>
|
|
96
|
+
))
|
|
97
|
+
AlertDialogDescription.displayName =
|
|
98
|
+
AlertDialogPrimitive.Description.displayName
|
|
99
|
+
|
|
100
|
+
const AlertDialogAction = React.forwardRef<
|
|
101
|
+
React.ElementRef<typeof AlertDialogPrimitive.Action>,
|
|
102
|
+
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action>
|
|
103
|
+
>(({ className, ...props }, ref) => (
|
|
104
|
+
<AlertDialogPrimitive.Action
|
|
105
|
+
ref={ref}
|
|
106
|
+
className={cn(buttonVariants(), className)}
|
|
107
|
+
{...props}
|
|
108
|
+
/>
|
|
109
|
+
))
|
|
110
|
+
AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName
|
|
111
|
+
|
|
112
|
+
const AlertDialogCancel = React.forwardRef<
|
|
113
|
+
React.ElementRef<typeof AlertDialogPrimitive.Cancel>,
|
|
114
|
+
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>
|
|
115
|
+
>(({ className, ...props }, ref) => (
|
|
116
|
+
<AlertDialogPrimitive.Cancel
|
|
117
|
+
ref={ref}
|
|
118
|
+
className={cn(
|
|
119
|
+
buttonVariants({ variant: "outline" }),
|
|
120
|
+
"mt-2 sm:mt-0",
|
|
121
|
+
className
|
|
122
|
+
)}
|
|
123
|
+
{...props}
|
|
124
|
+
/>
|
|
125
|
+
))
|
|
126
|
+
AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName
|
|
127
|
+
|
|
128
|
+
export {
|
|
129
|
+
AlertDialog,
|
|
130
|
+
AlertDialogPortal,
|
|
131
|
+
AlertDialogOverlay,
|
|
132
|
+
AlertDialogTrigger,
|
|
133
|
+
AlertDialogContent,
|
|
134
|
+
AlertDialogHeader,
|
|
135
|
+
AlertDialogFooter,
|
|
136
|
+
AlertDialogTitle,
|
|
137
|
+
AlertDialogDescription,
|
|
138
|
+
AlertDialogAction,
|
|
139
|
+
AlertDialogCancel,
|
|
140
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import * as React from "react"
|
|
3
|
+
import { cva, type VariantProps } from "class-variance-authority"
|
|
4
|
+
|
|
5
|
+
import { cn } from "../utils/cn"
|
|
6
|
+
|
|
7
|
+
const alertVariants = cva(
|
|
8
|
+
"relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",
|
|
9
|
+
{
|
|
10
|
+
variants: {
|
|
11
|
+
variant: {
|
|
12
|
+
default: "bg-background text-foreground",
|
|
13
|
+
destructive:
|
|
14
|
+
"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive",
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
defaultVariants: {
|
|
18
|
+
variant: "default",
|
|
19
|
+
},
|
|
20
|
+
}
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
const Alert = React.forwardRef<
|
|
24
|
+
HTMLDivElement,
|
|
25
|
+
React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof alertVariants>
|
|
26
|
+
>(({ className, variant, ...props }, ref) => (
|
|
27
|
+
<div
|
|
28
|
+
ref={ref}
|
|
29
|
+
role="alert"
|
|
30
|
+
className={cn(alertVariants({ variant }), className)}
|
|
31
|
+
{...props}
|
|
32
|
+
/>
|
|
33
|
+
))
|
|
34
|
+
Alert.displayName = "Alert"
|
|
35
|
+
|
|
36
|
+
const AlertTitle = React.forwardRef<
|
|
37
|
+
HTMLParagraphElement,
|
|
38
|
+
React.HTMLAttributes<HTMLHeadingElement>
|
|
39
|
+
>(({ className, ...props }, ref) => (
|
|
40
|
+
<h5
|
|
41
|
+
ref={ref}
|
|
42
|
+
className={cn("mb-1 font-medium leading-none tracking-tight", className)}
|
|
43
|
+
{...props}
|
|
44
|
+
/>
|
|
45
|
+
))
|
|
46
|
+
AlertTitle.displayName = "AlertTitle"
|
|
47
|
+
|
|
48
|
+
const AlertDescription = React.forwardRef<
|
|
49
|
+
HTMLParagraphElement,
|
|
50
|
+
React.HTMLAttributes<HTMLParagraphElement>
|
|
51
|
+
>(({ className, ...props }, ref) => (
|
|
52
|
+
<div
|
|
53
|
+
ref={ref}
|
|
54
|
+
className={cn("text-sm [&_p]:leading-relaxed", className)}
|
|
55
|
+
{...props}
|
|
56
|
+
/>
|
|
57
|
+
))
|
|
58
|
+
AlertDescription.displayName = "AlertDescription"
|
|
59
|
+
|
|
60
|
+
export { Alert, AlertTitle, AlertDescription }
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import * as AvatarPrimitive from '@radix-ui/react-avatar'
|
|
3
|
+
import { cn } from '../utils/cn'
|
|
4
|
+
|
|
5
|
+
export const Avatar = React.forwardRef<
|
|
6
|
+
React.ElementRef<typeof AvatarPrimitive.Root>,
|
|
7
|
+
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>
|
|
8
|
+
>(({ className, ...props }, ref) => (
|
|
9
|
+
<AvatarPrimitive.Root
|
|
10
|
+
ref={ref}
|
|
11
|
+
className={cn('relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full', className)}
|
|
12
|
+
{...props}
|
|
13
|
+
/>
|
|
14
|
+
))
|
|
15
|
+
Avatar.displayName = AvatarPrimitive.Root.displayName
|
|
16
|
+
|
|
17
|
+
export const AvatarImage = React.forwardRef<
|
|
18
|
+
React.ElementRef<typeof AvatarPrimitive.Image>,
|
|
19
|
+
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image>
|
|
20
|
+
>(({ className, ...props }, ref) => (
|
|
21
|
+
<AvatarPrimitive.Image ref={ref} className={cn('aspect-square h-full w-full object-cover', className)} {...props} />
|
|
22
|
+
))
|
|
23
|
+
AvatarImage.displayName = AvatarPrimitive.Image.displayName
|
|
24
|
+
|
|
25
|
+
export const AvatarFallback = React.forwardRef<
|
|
26
|
+
React.ElementRef<typeof AvatarPrimitive.Fallback>,
|
|
27
|
+
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>
|
|
28
|
+
>(({ className, ...props }, ref) => (
|
|
29
|
+
<AvatarPrimitive.Fallback
|
|
30
|
+
ref={ref}
|
|
31
|
+
className={cn('flex h-full w-full items-center justify-center rounded-full bg-[hsl(var(--muted))] text-sm font-medium text-[hsl(var(--muted-foreground))]', className)}
|
|
32
|
+
{...props}
|
|
33
|
+
/>
|
|
34
|
+
))
|
|
35
|
+
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName
|
|
36
|
+
|
|
37
|
+
// ── AvatarGroup ──────────────────────────────────────────────────────────────
|
|
38
|
+
// Stacked, overlapping avatars with an optional "+N" overflow tile.
|
|
39
|
+
// Children are <Avatar> elements; we wrap each one with a ring + size override
|
|
40
|
+
// so consumers don't have to repeat the same className on every child.
|
|
41
|
+
|
|
42
|
+
export interface AvatarGroupProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
43
|
+
/** Maximum avatars rendered before collapsing into a "+N" tile. Default 4. */
|
|
44
|
+
max?: number
|
|
45
|
+
/** Pixel size of each avatar tile. Default 32. */
|
|
46
|
+
size?: number
|
|
47
|
+
/** Pixel overlap between adjacent avatars. Default size / 3. */
|
|
48
|
+
spacing?: number
|
|
49
|
+
/** Custom node for the overflow tile. Falls back to "+{remaining}". */
|
|
50
|
+
renderOverflow?: (remaining: number) => React.ReactNode
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export const AvatarGroup = React.forwardRef<HTMLDivElement, AvatarGroupProps>(
|
|
54
|
+
({ className, max = 4, size = 32, spacing, renderOverflow, children, ...props }, ref) => {
|
|
55
|
+
const items = React.Children.toArray(children).filter(React.isValidElement) as React.ReactElement[]
|
|
56
|
+
const overlap = spacing ?? Math.round(size / 3)
|
|
57
|
+
const visible = items.slice(0, max)
|
|
58
|
+
const remaining = Math.max(0, items.length - max)
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<div ref={ref} className={cn('flex items-center', className)} data-slot="avatar-group" {...props}>
|
|
62
|
+
{visible.map((child, i) =>
|
|
63
|
+
React.cloneElement(child, {
|
|
64
|
+
key: child.key ?? i,
|
|
65
|
+
style: {
|
|
66
|
+
width: size,
|
|
67
|
+
height: size,
|
|
68
|
+
marginLeft: i === 0 ? 0 : -overlap,
|
|
69
|
+
...(child.props.style ?? {}),
|
|
70
|
+
},
|
|
71
|
+
className: cn(
|
|
72
|
+
'ring-2 ring-[hsl(var(--background))] relative',
|
|
73
|
+
`z-[${10 + i}]`,
|
|
74
|
+
child.props.className,
|
|
75
|
+
),
|
|
76
|
+
}),
|
|
77
|
+
)}
|
|
78
|
+
{remaining > 0 && (
|
|
79
|
+
<div
|
|
80
|
+
data-slot="avatar-group-overflow"
|
|
81
|
+
className={cn(
|
|
82
|
+
'flex items-center justify-center rounded-full ring-2 ring-[hsl(var(--background))] relative',
|
|
83
|
+
'bg-[hsl(var(--muted))] text-[hsl(var(--muted-foreground))] font-medium',
|
|
84
|
+
)}
|
|
85
|
+
style={{
|
|
86
|
+
width: size,
|
|
87
|
+
height: size,
|
|
88
|
+
marginLeft: -overlap,
|
|
89
|
+
fontSize: Math.max(10, Math.round(size * 0.34)),
|
|
90
|
+
zIndex: 10 + visible.length,
|
|
91
|
+
}}
|
|
92
|
+
>
|
|
93
|
+
{renderOverflow ? renderOverflow(remaining) : `+${remaining}`}
|
|
94
|
+
</div>
|
|
95
|
+
)}
|
|
96
|
+
</div>
|
|
97
|
+
)
|
|
98
|
+
},
|
|
99
|
+
)
|
|
100
|
+
AvatarGroup.displayName = 'AvatarGroup'
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { cva, type VariantProps } from 'class-variance-authority'
|
|
3
|
+
import { cn } from '../utils/cn'
|
|
4
|
+
|
|
5
|
+
const badgeVariants = cva(
|
|
6
|
+
'inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-[hsl(var(--ring))] focus:ring-offset-2',
|
|
7
|
+
{
|
|
8
|
+
variants: {
|
|
9
|
+
variant: {
|
|
10
|
+
default: 'border-transparent bg-[hsl(var(--primary))] text-[hsl(var(--primary-foreground))] hover:bg-[hsl(var(--primary)/0.8)]',
|
|
11
|
+
secondary: 'border-transparent bg-[hsl(var(--secondary))] text-[hsl(var(--secondary-foreground))] hover:bg-[hsl(var(--secondary)/0.8)]',
|
|
12
|
+
destructive: 'border-transparent bg-[hsl(var(--destructive))] text-[hsl(var(--destructive-foreground))] hover:bg-[hsl(var(--destructive)/0.8)]',
|
|
13
|
+
outline: 'text-[hsl(var(--foreground))]',
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
defaultVariants: { variant: 'default' },
|
|
17
|
+
}
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
export interface BadgeProps
|
|
21
|
+
extends React.HTMLAttributes<HTMLDivElement>,
|
|
22
|
+
VariantProps<typeof badgeVariants> {}
|
|
23
|
+
|
|
24
|
+
export function Badge({ className, variant, ...props }: BadgeProps) {
|
|
25
|
+
return <div className={cn(badgeVariants({ variant }), className)} {...props} />
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export { badgeVariants }
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { Slot } from '@radix-ui/react-slot'
|
|
3
|
+
import { cva, type VariantProps } from 'class-variance-authority'
|
|
4
|
+
import { cn } from '../utils/cn'
|
|
5
|
+
|
|
6
|
+
const buttonVariants = cva(
|
|
7
|
+
'inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium font-sans transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50',
|
|
8
|
+
{
|
|
9
|
+
variants: {
|
|
10
|
+
variant: {
|
|
11
|
+
default: 'bg-primary text-primary-foreground hover:bg-primary/90',
|
|
12
|
+
secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/80',
|
|
13
|
+
outline: 'border border-border bg-transparent hover:bg-accent hover:text-accent-foreground',
|
|
14
|
+
ghost: 'hover:bg-accent hover:text-accent-foreground',
|
|
15
|
+
destructive: 'bg-destructive text-destructive-foreground hover:bg-destructive/90',
|
|
16
|
+
link: 'text-primary underline-offset-4 hover:underline',
|
|
17
|
+
},
|
|
18
|
+
size: {
|
|
19
|
+
sm: 'h-8 px-3 text-xs',
|
|
20
|
+
default: 'h-9 px-4 py-2',
|
|
21
|
+
lg: 'h-11 px-6 text-base',
|
|
22
|
+
icon: 'h-9 w-9',
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
defaultVariants: { variant: 'default', size: 'default' },
|
|
26
|
+
}
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
export interface ButtonProps
|
|
30
|
+
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
|
|
31
|
+
VariantProps<typeof buttonVariants> {
|
|
32
|
+
asChild?: boolean
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
36
|
+
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
37
|
+
const Comp = asChild ? Slot : 'button'
|
|
38
|
+
return <Comp className={cn(buttonVariants({ variant, size }), className)} ref={ref} {...props} />
|
|
39
|
+
}
|
|
40
|
+
)
|
|
41
|
+
Button.displayName = 'Button'
|
|
42
|
+
|
|
43
|
+
export { buttonVariants }
|