@vercel/geistdocs 1.2.3-canary.48fea3c → 1.2.3-canary.73598cf
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/icons/icon-arrow-up-right-small.d.ts +8 -0
- package/dist/assets/icons/icon-arrow-up-right-small.d.ts.map +1 -0
- package/dist/assets/icons/icon-arrow-up-right-small.js +4 -0
- package/dist/assets/icons/icon-arrow-up-right.d.ts +5 -0
- package/dist/assets/icons/icon-arrow-up-right.d.ts.map +1 -0
- package/dist/assets/icons/icon-arrow-up-right.js +4 -0
- package/dist/assets/icons/icon-check.d.ts +5 -0
- package/dist/assets/icons/icon-check.d.ts.map +1 -0
- package/dist/assets/icons/icon-check.js +4 -0
- package/dist/assets/icons/icon-chevron-down-small.d.ts +8 -0
- package/dist/assets/icons/icon-chevron-down-small.d.ts.map +1 -0
- package/dist/assets/icons/icon-chevron-down-small.js +7 -0
- package/dist/assets/icons/icon-chevron-right.d.ts +5 -0
- package/dist/assets/icons/icon-chevron-right.d.ts.map +1 -0
- package/dist/assets/icons/icon-chevron-right.js +4 -0
- package/dist/assets/icons/icon-copy.d.ts +5 -0
- package/dist/assets/icons/icon-copy.d.ts.map +1 -0
- package/dist/assets/icons/icon-copy.js +4 -0
- package/dist/assets/icons/icon-file-text.d.ts +5 -0
- package/dist/assets/icons/icon-file-text.d.ts.map +1 -0
- package/dist/assets/icons/icon-file-text.js +4 -0
- package/dist/assets/icons/icon-menu-alt.d.ts +5 -0
- package/dist/assets/icons/icon-menu-alt.d.ts.map +1 -0
- package/dist/assets/icons/icon-menu-alt.js +4 -0
- package/dist/assets/icons/icon-slash-forward.d.ts +8 -0
- package/dist/assets/icons/icon-slash-forward.d.ts.map +1 -0
- package/dist/assets/icons/icon-slash-forward.js +4 -0
- package/dist/assets/icons/index.d.ts +10 -0
- package/dist/assets/icons/index.d.ts.map +1 -0
- package/{template/components/geistcn-fallbacks/geistcn-assets/icons/index.tsx → dist/assets/icons/index.js} +0 -1
- package/dist/assets/logos/index.d.ts +15 -0
- package/dist/assets/logos/index.d.ts.map +1 -0
- package/{template/components/geistcn-fallbacks/geistcn-assets/logos/index.tsx → dist/assets/logos/index.js} +2 -1
- package/dist/assets/logos/logo-ai-elements.d.ts +8 -0
- package/dist/assets/logos/logo-ai-elements.d.ts.map +1 -0
- package/dist/assets/logos/logo-ai-elements.js +8 -0
- package/dist/assets/logos/logo-ai-sdk.d.ts +8 -0
- package/dist/assets/logos/logo-ai-sdk.d.ts.map +1 -0
- package/dist/assets/logos/logo-ai-sdk.js +8 -0
- package/dist/assets/logos/logo-chat-sdk.d.ts +8 -0
- package/dist/assets/logos/logo-chat-sdk.d.ts.map +1 -0
- package/dist/assets/logos/logo-chat-sdk.js +8 -0
- package/dist/assets/logos/logo-flags-sdk.d.ts +8 -0
- package/dist/assets/logos/logo-flags-sdk.d.ts.map +1 -0
- package/dist/assets/logos/logo-flags-sdk.js +8 -0
- package/dist/assets/logos/logo-icon-vercel.d.ts +9 -0
- package/dist/assets/logos/logo-icon-vercel.d.ts.map +1 -0
- package/dist/assets/logos/logo-icon-vercel.js +8 -0
- package/dist/assets/logos/logo-nextjs.d.ts +8 -0
- package/dist/assets/logos/logo-nextjs.d.ts.map +1 -0
- package/dist/assets/logos/logo-nextjs.js +7 -0
- package/dist/assets/logos/logo-streamdown.d.ts +8 -0
- package/dist/assets/logos/logo-streamdown.d.ts.map +1 -0
- package/dist/assets/logos/logo-streamdown.js +8 -0
- package/dist/assets/logos/logo-svelte-kit.d.ts +8 -0
- package/dist/assets/logos/logo-svelte-kit.d.ts.map +1 -0
- package/dist/assets/logos/logo-svelte-kit.js +7 -0
- package/dist/assets/logos/logo-vercel-oss.d.ts +8 -0
- package/dist/assets/logos/logo-vercel-oss.d.ts.map +1 -0
- package/dist/assets/logos/logo-vercel-oss.js +7 -0
- package/dist/assets/logos/logo-workflow-sdk.d.ts +8 -0
- package/dist/assets/logos/logo-workflow-sdk.d.ts.map +1 -0
- package/dist/assets/logos/logo-workflow-sdk.js +8 -0
- package/dist/cli/index.js +1 -1
- package/dist/components/button-group.d.ts +2 -0
- package/dist/components/button-group.d.ts.map +1 -0
- package/dist/components/button-group.js +2 -0
- package/dist/components/button.d.ts +2 -0
- package/dist/components/button.d.ts.map +1 -0
- package/dist/components/button.js +2 -0
- package/dist/components/card.d.ts +2 -0
- package/dist/components/card.d.ts.map +1 -0
- package/dist/components/card.js +2 -0
- package/dist/components/code-block-tabs.js +3 -3
- package/dist/components/code-block.js +3 -3
- package/dist/components/collapsible.d.ts +2 -0
- package/dist/components/collapsible.d.ts.map +1 -0
- package/dist/components/collapsible.js +3 -0
- package/dist/components/copy-prompt.js +3 -3
- package/dist/components/dialog.d.ts +13 -0
- package/dist/components/dialog.d.ts.map +1 -0
- package/dist/components/dialog.js +35 -0
- package/dist/components/drawer.d.ts +2 -0
- package/dist/components/drawer.d.ts.map +1 -0
- package/dist/components/drawer.js +3 -0
- package/dist/components/dropdown-menu.d.ts +2 -0
- package/dist/components/dropdown-menu.d.ts.map +1 -0
- package/dist/components/dropdown-menu.js +3 -0
- package/dist/components/input-group.d.ts +2 -0
- package/dist/components/input-group.d.ts.map +1 -0
- package/dist/components/input-group.js +3 -0
- package/dist/components/input.d.ts +2 -0
- package/dist/components/input.d.ts.map +1 -0
- package/dist/components/input.js +2 -0
- package/dist/components/kbd.d.ts +2 -0
- package/dist/components/kbd.d.ts.map +1 -0
- package/dist/components/kbd.js +2 -0
- package/dist/components/navigation-menu.d.ts +2 -0
- package/dist/components/navigation-menu.d.ts.map +1 -0
- package/dist/components/navigation-menu.js +3 -0
- package/dist/components/popover.d.ts +2 -0
- package/dist/components/popover.d.ts.map +1 -0
- package/dist/components/popover.js +3 -0
- package/dist/components/scroll-area.d.ts +2 -0
- package/dist/components/scroll-area.d.ts.map +1 -0
- package/dist/components/scroll-area.js +3 -0
- package/dist/components/separator.d.ts +2 -0
- package/dist/components/separator.d.ts.map +1 -0
- package/dist/components/separator.js +3 -0
- package/dist/components/sheet.d.ts +2 -0
- package/dist/components/sheet.d.ts.map +1 -0
- package/dist/components/sheet.js +3 -0
- package/dist/components/sonner.d.ts +2 -0
- package/dist/components/sonner.d.ts.map +1 -0
- package/dist/components/sonner.js +3 -0
- package/dist/components/spinner.d.ts +2 -0
- package/dist/components/spinner.d.ts.map +1 -0
- package/dist/components/spinner.js +2 -0
- package/dist/components/textarea.d.ts +2 -0
- package/dist/components/textarea.d.ts.map +1 -0
- package/dist/components/textarea.js +2 -0
- package/dist/components/tooltip.d.ts +2 -0
- package/dist/components/tooltip.d.ts.map +1 -0
- package/dist/components/tooltip.js +3 -0
- package/dist/config.d.ts +47 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/controls.js +4 -4
- package/dist/footer.d.ts +8 -0
- package/dist/footer.d.ts.map +1 -0
- package/dist/footer.js +6 -0
- package/dist/home-layout.d.ts +11 -0
- package/dist/home-layout.d.ts.map +1 -0
- package/dist/home-layout.js +31 -0
- package/dist/internal/chat/conversation.js +1 -1
- package/dist/internal/chat/message.js +1 -1
- package/dist/internal/chat/prompt-input.js +1 -1
- package/dist/internal/chat/shell.d.ts.map +1 -1
- package/dist/internal/chat/shell.js +6 -5
- package/dist/internal/chat/sources.js +1 -1
- package/dist/internal/config-context.d.ts +10 -0
- package/dist/internal/config-context.d.ts.map +1 -0
- package/dist/internal/config-context.js +15 -0
- package/dist/internal/footer/github-button.d.ts +7 -0
- package/dist/internal/footer/github-button.d.ts.map +1 -0
- package/dist/internal/footer/github-button.js +10 -0
- package/dist/internal/footer/rss-button.d.ts +2 -0
- package/dist/internal/footer/rss-button.d.ts.map +1 -0
- package/dist/internal/footer/rss-button.js +4 -0
- package/dist/internal/localized-link.d.ts +8 -0
- package/dist/internal/localized-link.d.ts.map +1 -0
- package/dist/internal/localized-link.js +13 -0
- package/dist/internal/navbar/desktop-menu.d.ts +10 -0
- package/dist/internal/navbar/desktop-menu.d.ts.map +1 -0
- package/dist/internal/navbar/desktop-menu.js +11 -0
- package/dist/internal/navbar/mobile-menu.d.ts +7 -0
- package/dist/internal/navbar/mobile-menu.d.ts.map +1 -0
- package/dist/internal/navbar/mobile-menu.js +44 -0
- package/dist/internal/navbar/navbar-logo.d.ts +16 -0
- package/dist/internal/navbar/navbar-logo.d.ts.map +1 -0
- package/dist/internal/navbar/navbar-logo.js +30 -0
- package/dist/internal/page-actions-client.d.ts.map +1 -1
- package/dist/internal/page-actions-client.js +17 -6
- package/dist/internal/page-visibility.d.ts +18 -0
- package/dist/internal/page-visibility.d.ts.map +1 -0
- package/dist/internal/page-visibility.js +24 -0
- package/dist/internal/provider-client.d.ts +1 -1
- package/dist/internal/provider-client.d.ts.map +1 -1
- package/dist/internal/provider-client.js +2 -1
- package/dist/internal/sidebar.js +3 -3
- package/dist/internal/ui/button-group.js +2 -2
- package/dist/internal/ui/button.d.ts +1 -1
- package/dist/internal/ui/button.d.ts.map +1 -1
- package/dist/internal/ui/button.js +7 -7
- package/dist/internal/ui/card.js +1 -1
- package/dist/internal/ui/drawer.js +1 -1
- package/dist/internal/ui/dropdown-menu.js +7 -7
- package/dist/internal/ui/input-group.js +2 -2
- package/dist/internal/ui/input.js +1 -1
- package/dist/internal/ui/kbd.js +1 -1
- package/dist/internal/ui/navigation-menu.d.ts +17 -0
- package/dist/internal/ui/navigation-menu.d.ts.map +1 -0
- package/dist/internal/ui/navigation-menu.js +38 -0
- package/dist/internal/ui/popover.js +1 -1
- package/dist/internal/ui/scroll-area.js +2 -2
- package/dist/internal/ui/separator.js +1 -1
- package/dist/internal/ui/sheet.js +4 -4
- package/dist/internal/ui/sonner.js +3 -3
- package/dist/internal/ui/textarea.js +1 -1
- package/dist/internal/ui/tooltip.js +1 -1
- package/dist/mdx.d.ts +55 -24
- package/dist/mdx.d.ts.map +1 -1
- package/dist/mdx.js +7 -46
- package/dist/mobile-docs-bar.d.ts +7 -0
- package/dist/mobile-docs-bar.d.ts.map +1 -0
- package/dist/mobile-docs-bar.js +13 -0
- package/dist/navbar.d.ts +7 -0
- package/dist/navbar.d.ts.map +1 -0
- package/dist/navbar.js +10 -0
- package/dist/pages/docs.d.ts +8 -2
- package/dist/pages/docs.d.ts.map +1 -1
- package/dist/pages/docs.js +13 -7
- package/dist/proxy.d.ts +1 -1
- package/dist/proxy.d.ts.map +1 -1
- package/dist/proxy.js +29 -2
- package/dist/routes/agents.d.ts +21 -0
- package/dist/routes/agents.d.ts.map +1 -0
- package/dist/routes/agents.js +201 -0
- package/dist/routes/chat.d.ts +7 -2
- package/dist/routes/chat.d.ts.map +1 -1
- package/dist/routes/chat.js +373 -65
- package/dist/routes/llms.d.ts +6 -5
- package/dist/routes/llms.d.ts.map +1 -1
- package/dist/routes/llms.js +63 -12
- package/dist/routes/search.d.ts +6 -4
- package/dist/routes/search.d.ts.map +1 -1
- package/dist/routes/search.js +8 -1
- package/dist/routes/sitemap.d.ts +6 -3
- package/dist/routes/sitemap.d.ts.map +1 -1
- package/dist/routes/sitemap.js +10 -2
- package/dist/shiki-theme.d.ts +20 -0
- package/dist/shiki-theme.d.ts.map +1 -0
- package/dist/shiki-theme.js +110 -0
- package/dist/source-config.d.ts +68 -0
- package/dist/source-config.d.ts.map +1 -0
- package/dist/source-config.js +161 -0
- package/dist/source.d.ts +8 -1
- package/dist/source.d.ts.map +1 -1
- package/dist/source.js +14 -1
- package/dist/versions.d.ts +31 -1
- package/dist/versions.d.ts.map +1 -1
- package/dist/versions.js +56 -29
- package/package.json +126 -5
- package/source-config.js +174 -0
- package/styles.css +465 -102
- package/template/AGENTS.md +95 -0
- package/template/app/[lang]/(home)/components/centered-section.tsx +1 -3
- package/template/app/[lang]/(home)/components/hero.tsx +2 -2
- package/template/app/[lang]/(home)/components/one-two-section.tsx +1 -3
- package/template/app/[lang]/(home)/components/templates.tsx +3 -5
- package/template/app/[lang]/(home)/components/text-grid-section.tsx +1 -1
- package/template/app/[lang]/(home)/layout.tsx +4 -3
- package/template/app/[lang]/(home)/page.tsx +2 -2
- package/template/app/[lang]/agents.md/route.ts +6 -0
- package/template/app/[lang]/docs/[[...slug]]/page.tsx +4 -1
- package/template/app/[lang]/layout.tsx +6 -6
- package/template/app/[lang]/llms.mdx/[[...slug]]/route.ts +1 -1
- package/template/app/[lang]/sitemap.md/route.ts +2 -2
- package/template/app/api/chat/route.ts +11 -0
- package/template/app/api/search/route.ts +2 -2
- package/template/app/styles/geistdocs.css +150 -109
- package/template/components/ui/badge.tsx +5 -5
- package/template/components/ui/button.tsx +7 -7
- package/template/components/ui/command-prompt.tsx +2 -2
- package/template/content/docs/agent-readiness.mdx +103 -0
- package/template/content/docs/ask-ai.mdx +55 -3
- package/template/content/docs/configuration.mdx +77 -2
- package/template/content/docs/deployment.mdx +11 -0
- package/template/content/docs/env.mdx +36 -5
- package/template/content/docs/getting-started.mdx +8 -1
- package/template/content/docs/index.mdx +5 -0
- package/template/content/docs/llms-txt.mdx +1 -0
- package/template/content/docs/md.mdx +2 -1
- package/template/content/docs/meta.json +2 -0
- package/template/content/docs/migration.mdx +364 -0
- package/template/content/docs/proxy.cn.mdx +1 -1
- package/template/content/docs/proxy.mdx +56 -2
- package/template/content/docs/theme-aware-image.mdx +1 -1
- package/template/content/docs/versioned-docs.mdx +49 -2
- package/template/geistdocs.tsx +26 -0
- package/template/lib/geistdocs/config.tsx +3 -0
- package/template/package.json +5 -5
- package/template/proxy.ts +1 -2
- package/template/source.config.ts +8 -47
- package/template/app/actions/feedback/emotions.ts +0 -18
- package/template/app/actions/feedback/index.ts +0 -45
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-arrow-up-right-small.tsx +0 -35
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-arrow-up-right.tsx +0 -27
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-check.tsx +0 -27
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-chevron-down-small.tsx +0 -30
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-chevron-right.tsx +0 -27
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-copy.tsx +0 -27
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-file-text.tsx +0 -25
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-menu-alt.tsx +0 -27
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-slash-forward.tsx +0 -36
- package/template/components/geistcn-fallbacks/geistcn-assets/logos/logo-ai-elements.tsx +0 -29
- package/template/components/geistcn-fallbacks/geistcn-assets/logos/logo-ai-sdk.tsx +0 -38
- package/template/components/geistcn-fallbacks/geistcn-assets/logos/logo-chat-sdk.tsx +0 -42
- package/template/components/geistcn-fallbacks/geistcn-assets/logos/logo-flags-sdk.tsx +0 -42
- package/template/components/geistcn-fallbacks/geistcn-assets/logos/logo-icon-vercel.tsx +0 -31
- package/template/components/geistcn-fallbacks/geistcn-assets/logos/logo-streamdown.tsx +0 -29
- package/template/components/geistcn-fallbacks/geistcn-assets/logos/logo-vercel-oss.tsx +0 -24
- package/template/components/geistcn-fallbacks/geistcn-assets/logos/logo-workflow-sdk.tsx +0 -73
- package/template/components/geistdocs/callout.tsx +0 -40
- package/template/components/geistdocs/chat.tsx +0 -24
- package/template/components/geistdocs/code-block-tabs.tsx +0 -61
- package/template/components/geistdocs/code-block.tsx +0 -134
- package/template/components/geistdocs/copy-page.tsx +0 -27
- package/template/components/geistdocs/desktop-menu.tsx +0 -52
- package/template/components/geistdocs/docs-page.tsx +0 -35
- package/template/components/geistdocs/edit-source.tsx +0 -30
- package/template/components/geistdocs/feedback.tsx +0 -139
- package/template/components/geistdocs/footer.tsx +0 -30
- package/template/components/geistdocs/github-button.tsx +0 -19
- package/template/components/geistdocs/home-layout.tsx +0 -46
- package/template/components/geistdocs/icons.tsx +0 -13
- package/template/components/geistdocs/installer.tsx +0 -58
- package/template/components/geistdocs/language-selector.tsx +0 -3
- package/template/components/geistdocs/mermaid.tsx +0 -68
- package/template/components/geistdocs/mobile-docs-bar.tsx +0 -77
- package/template/components/geistdocs/mobile-menu.tsx +0 -150
- package/template/components/geistdocs/navbar-logo.tsx +0 -124
- package/template/components/geistdocs/navbar.tsx +0 -22
- package/template/components/geistdocs/rss-button.tsx +0 -10
- package/template/components/geistdocs/scroll-top.tsx +0 -21
- package/template/components/geistdocs/search.tsx +0 -17
- package/template/components/geistdocs/sidebar.tsx +0 -128
- package/template/components/geistdocs/theme-aware-image.tsx +0 -22
- package/template/components/geistdocs/theme-toggle.tsx +0 -3
- package/template/components/geistdocs/video.tsx +0 -16
- package/template/components/ui/button-group.tsx +0 -83
- package/template/components/ui/card.tsx +0 -92
- package/template/components/ui/collapsible.tsx +0 -33
- package/template/components/ui/command.tsx +0 -184
- package/template/components/ui/dialog.tsx +0 -143
- package/template/components/ui/drawer.tsx +0 -135
- package/template/components/ui/dropdown-menu.tsx +0 -257
- package/template/components/ui/hover-card.tsx +0 -44
- package/template/components/ui/input-group.tsx +0 -170
- package/template/components/ui/input.tsx +0 -21
- package/template/components/ui/kbd.tsx +0 -28
- package/template/components/ui/navigation-menu.tsx +0 -192
- package/template/components/ui/popover.tsx +0 -48
- package/template/components/ui/scroll-area.tsx +0 -58
- package/template/components/ui/select.tsx +0 -187
- package/template/components/ui/separator.tsx +0 -28
- package/template/components/ui/sheet.tsx +0 -139
- package/template/components/ui/sonner.tsx +0 -40
- package/template/components/ui/spinner.tsx +0 -16
- package/template/components/ui/textarea.tsx +0 -18
- package/template/components/ui/tooltip.tsx +0 -61
- package/template/hooks/geistdocs/use-sidebar.ts +0 -13
- package/template/hooks/use-mobile.ts +0 -19
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import { Select as SelectPrimitive } from "radix-ui"
|
|
5
|
-
import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react"
|
|
6
|
-
|
|
7
|
-
import { cn } from "@/lib/utils"
|
|
8
|
-
|
|
9
|
-
function Select({
|
|
10
|
-
...props
|
|
11
|
-
}: React.ComponentProps<typeof SelectPrimitive.Root>) {
|
|
12
|
-
return <SelectPrimitive.Root data-slot="select" {...props} />
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
function SelectGroup({
|
|
16
|
-
...props
|
|
17
|
-
}: React.ComponentProps<typeof SelectPrimitive.Group>) {
|
|
18
|
-
return <SelectPrimitive.Group data-slot="select-group" {...props} />
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
function SelectValue({
|
|
22
|
-
...props
|
|
23
|
-
}: React.ComponentProps<typeof SelectPrimitive.Value>) {
|
|
24
|
-
return <SelectPrimitive.Value data-slot="select-value" {...props} />
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function SelectTrigger({
|
|
28
|
-
className,
|
|
29
|
-
size = "default",
|
|
30
|
-
children,
|
|
31
|
-
...props
|
|
32
|
-
}: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
|
|
33
|
-
size?: "sm" | "default"
|
|
34
|
-
}) {
|
|
35
|
-
return (
|
|
36
|
-
<SelectPrimitive.Trigger
|
|
37
|
-
data-slot="select-trigger"
|
|
38
|
-
data-size={size}
|
|
39
|
-
className={cn(
|
|
40
|
-
"border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
41
|
-
className
|
|
42
|
-
)}
|
|
43
|
-
{...props}
|
|
44
|
-
>
|
|
45
|
-
{children}
|
|
46
|
-
<SelectPrimitive.Icon asChild>
|
|
47
|
-
<ChevronDownIcon className="size-4 opacity-50" />
|
|
48
|
-
</SelectPrimitive.Icon>
|
|
49
|
-
</SelectPrimitive.Trigger>
|
|
50
|
-
)
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
function SelectContent({
|
|
54
|
-
className,
|
|
55
|
-
children,
|
|
56
|
-
position = "popper",
|
|
57
|
-
align = "center",
|
|
58
|
-
...props
|
|
59
|
-
}: React.ComponentProps<typeof SelectPrimitive.Content>) {
|
|
60
|
-
return (
|
|
61
|
-
<SelectPrimitive.Portal>
|
|
62
|
-
<SelectPrimitive.Content
|
|
63
|
-
data-slot="select-content"
|
|
64
|
-
className={cn(
|
|
65
|
-
"bg-popover text-popover-foreground 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-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",
|
|
66
|
-
position === "popper" &&
|
|
67
|
-
"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
68
|
-
className
|
|
69
|
-
)}
|
|
70
|
-
position={position}
|
|
71
|
-
align={align}
|
|
72
|
-
{...props}
|
|
73
|
-
>
|
|
74
|
-
<SelectScrollUpButton />
|
|
75
|
-
<SelectPrimitive.Viewport
|
|
76
|
-
className={cn(
|
|
77
|
-
"p-1",
|
|
78
|
-
position === "popper" &&
|
|
79
|
-
"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"
|
|
80
|
-
)}
|
|
81
|
-
>
|
|
82
|
-
{children}
|
|
83
|
-
</SelectPrimitive.Viewport>
|
|
84
|
-
<SelectScrollDownButton />
|
|
85
|
-
</SelectPrimitive.Content>
|
|
86
|
-
</SelectPrimitive.Portal>
|
|
87
|
-
)
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
function SelectLabel({
|
|
91
|
-
className,
|
|
92
|
-
...props
|
|
93
|
-
}: React.ComponentProps<typeof SelectPrimitive.Label>) {
|
|
94
|
-
return (
|
|
95
|
-
<SelectPrimitive.Label
|
|
96
|
-
data-slot="select-label"
|
|
97
|
-
className={cn("text-muted-foreground px-2 py-1.5 text-xs", className)}
|
|
98
|
-
{...props}
|
|
99
|
-
/>
|
|
100
|
-
)
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
function SelectItem({
|
|
104
|
-
className,
|
|
105
|
-
children,
|
|
106
|
-
...props
|
|
107
|
-
}: React.ComponentProps<typeof SelectPrimitive.Item>) {
|
|
108
|
-
return (
|
|
109
|
-
<SelectPrimitive.Item
|
|
110
|
-
data-slot="select-item"
|
|
111
|
-
className={cn(
|
|
112
|
-
"focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
|
|
113
|
-
className
|
|
114
|
-
)}
|
|
115
|
-
{...props}
|
|
116
|
-
>
|
|
117
|
-
<span className="absolute right-2 flex size-3.5 items-center justify-center">
|
|
118
|
-
<SelectPrimitive.ItemIndicator>
|
|
119
|
-
<CheckIcon className="size-4" />
|
|
120
|
-
</SelectPrimitive.ItemIndicator>
|
|
121
|
-
</span>
|
|
122
|
-
<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
|
|
123
|
-
</SelectPrimitive.Item>
|
|
124
|
-
)
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
function SelectSeparator({
|
|
128
|
-
className,
|
|
129
|
-
...props
|
|
130
|
-
}: React.ComponentProps<typeof SelectPrimitive.Separator>) {
|
|
131
|
-
return (
|
|
132
|
-
<SelectPrimitive.Separator
|
|
133
|
-
data-slot="select-separator"
|
|
134
|
-
className={cn("bg-border pointer-events-none -mx-1 my-1 h-px", className)}
|
|
135
|
-
{...props}
|
|
136
|
-
/>
|
|
137
|
-
)
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
function SelectScrollUpButton({
|
|
141
|
-
className,
|
|
142
|
-
...props
|
|
143
|
-
}: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>) {
|
|
144
|
-
return (
|
|
145
|
-
<SelectPrimitive.ScrollUpButton
|
|
146
|
-
data-slot="select-scroll-up-button"
|
|
147
|
-
className={cn(
|
|
148
|
-
"flex cursor-default items-center justify-center py-1",
|
|
149
|
-
className
|
|
150
|
-
)}
|
|
151
|
-
{...props}
|
|
152
|
-
>
|
|
153
|
-
<ChevronUpIcon className="size-4" />
|
|
154
|
-
</SelectPrimitive.ScrollUpButton>
|
|
155
|
-
)
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
function SelectScrollDownButton({
|
|
159
|
-
className,
|
|
160
|
-
...props
|
|
161
|
-
}: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>) {
|
|
162
|
-
return (
|
|
163
|
-
<SelectPrimitive.ScrollDownButton
|
|
164
|
-
data-slot="select-scroll-down-button"
|
|
165
|
-
className={cn(
|
|
166
|
-
"flex cursor-default items-center justify-center py-1",
|
|
167
|
-
className
|
|
168
|
-
)}
|
|
169
|
-
{...props}
|
|
170
|
-
>
|
|
171
|
-
<ChevronDownIcon className="size-4" />
|
|
172
|
-
</SelectPrimitive.ScrollDownButton>
|
|
173
|
-
)
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
export {
|
|
177
|
-
Select,
|
|
178
|
-
SelectContent,
|
|
179
|
-
SelectGroup,
|
|
180
|
-
SelectItem,
|
|
181
|
-
SelectLabel,
|
|
182
|
-
SelectScrollDownButton,
|
|
183
|
-
SelectScrollUpButton,
|
|
184
|
-
SelectSeparator,
|
|
185
|
-
SelectTrigger,
|
|
186
|
-
SelectValue,
|
|
187
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import { Separator as SeparatorPrimitive } from "radix-ui"
|
|
5
|
-
|
|
6
|
-
import { cn } from "@/lib/utils"
|
|
7
|
-
|
|
8
|
-
function Separator({
|
|
9
|
-
className,
|
|
10
|
-
orientation = "horizontal",
|
|
11
|
-
decorative = true,
|
|
12
|
-
...props
|
|
13
|
-
}: React.ComponentProps<typeof SeparatorPrimitive.Root>) {
|
|
14
|
-
return (
|
|
15
|
-
<SeparatorPrimitive.Root
|
|
16
|
-
data-slot="separator"
|
|
17
|
-
decorative={decorative}
|
|
18
|
-
orientation={orientation}
|
|
19
|
-
className={cn(
|
|
20
|
-
"bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
|
|
21
|
-
className
|
|
22
|
-
)}
|
|
23
|
-
{...props}
|
|
24
|
-
/>
|
|
25
|
-
)
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export { Separator }
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import { Dialog as SheetPrimitive } from "radix-ui"
|
|
5
|
-
import { XIcon } from "lucide-react"
|
|
6
|
-
|
|
7
|
-
import { cn } from "@/lib/utils"
|
|
8
|
-
|
|
9
|
-
function Sheet({ ...props }: React.ComponentProps<typeof SheetPrimitive.Root>) {
|
|
10
|
-
return <SheetPrimitive.Root data-slot="sheet" {...props} />
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
function SheetTrigger({
|
|
14
|
-
...props
|
|
15
|
-
}: React.ComponentProps<typeof SheetPrimitive.Trigger>) {
|
|
16
|
-
return <SheetPrimitive.Trigger data-slot="sheet-trigger" {...props} />
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function SheetClose({
|
|
20
|
-
...props
|
|
21
|
-
}: React.ComponentProps<typeof SheetPrimitive.Close>) {
|
|
22
|
-
return <SheetPrimitive.Close data-slot="sheet-close" {...props} />
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
function SheetPortal({
|
|
26
|
-
...props
|
|
27
|
-
}: React.ComponentProps<typeof SheetPrimitive.Portal>) {
|
|
28
|
-
return <SheetPrimitive.Portal data-slot="sheet-portal" {...props} />
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function SheetOverlay({
|
|
32
|
-
className,
|
|
33
|
-
...props
|
|
34
|
-
}: React.ComponentProps<typeof SheetPrimitive.Overlay>) {
|
|
35
|
-
return (
|
|
36
|
-
<SheetPrimitive.Overlay
|
|
37
|
-
data-slot="sheet-overlay"
|
|
38
|
-
className={cn(
|
|
39
|
-
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
|
|
40
|
-
className
|
|
41
|
-
)}
|
|
42
|
-
{...props}
|
|
43
|
-
/>
|
|
44
|
-
)
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
function SheetContent({
|
|
48
|
-
className,
|
|
49
|
-
children,
|
|
50
|
-
side = "right",
|
|
51
|
-
...props
|
|
52
|
-
}: React.ComponentProps<typeof SheetPrimitive.Content> & {
|
|
53
|
-
side?: "top" | "right" | "bottom" | "left"
|
|
54
|
-
}) {
|
|
55
|
-
return (
|
|
56
|
-
<SheetPortal>
|
|
57
|
-
<SheetOverlay />
|
|
58
|
-
<SheetPrimitive.Content
|
|
59
|
-
data-slot="sheet-content"
|
|
60
|
-
className={cn(
|
|
61
|
-
"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
|
|
62
|
-
side === "right" &&
|
|
63
|
-
"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",
|
|
64
|
-
side === "left" &&
|
|
65
|
-
"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",
|
|
66
|
-
side === "top" &&
|
|
67
|
-
"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",
|
|
68
|
-
side === "bottom" &&
|
|
69
|
-
"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",
|
|
70
|
-
className
|
|
71
|
-
)}
|
|
72
|
-
{...props}
|
|
73
|
-
>
|
|
74
|
-
{children}
|
|
75
|
-
<SheetPrimitive.Close className="ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none">
|
|
76
|
-
<XIcon className="size-4" />
|
|
77
|
-
<span className="sr-only">Close</span>
|
|
78
|
-
</SheetPrimitive.Close>
|
|
79
|
-
</SheetPrimitive.Content>
|
|
80
|
-
</SheetPortal>
|
|
81
|
-
)
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
function SheetHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
85
|
-
return (
|
|
86
|
-
<div
|
|
87
|
-
data-slot="sheet-header"
|
|
88
|
-
className={cn("flex flex-col gap-1.5 p-4", className)}
|
|
89
|
-
{...props}
|
|
90
|
-
/>
|
|
91
|
-
)
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
function SheetFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
95
|
-
return (
|
|
96
|
-
<div
|
|
97
|
-
data-slot="sheet-footer"
|
|
98
|
-
className={cn("mt-auto flex flex-col gap-2 p-4", className)}
|
|
99
|
-
{...props}
|
|
100
|
-
/>
|
|
101
|
-
)
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
function SheetTitle({
|
|
105
|
-
className,
|
|
106
|
-
...props
|
|
107
|
-
}: React.ComponentProps<typeof SheetPrimitive.Title>) {
|
|
108
|
-
return (
|
|
109
|
-
<SheetPrimitive.Title
|
|
110
|
-
data-slot="sheet-title"
|
|
111
|
-
className={cn("text-foreground font-semibold", className)}
|
|
112
|
-
{...props}
|
|
113
|
-
/>
|
|
114
|
-
)
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
function SheetDescription({
|
|
118
|
-
className,
|
|
119
|
-
...props
|
|
120
|
-
}: React.ComponentProps<typeof SheetPrimitive.Description>) {
|
|
121
|
-
return (
|
|
122
|
-
<SheetPrimitive.Description
|
|
123
|
-
data-slot="sheet-description"
|
|
124
|
-
className={cn("text-muted-foreground text-sm", className)}
|
|
125
|
-
{...props}
|
|
126
|
-
/>
|
|
127
|
-
)
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
export {
|
|
131
|
-
Sheet,
|
|
132
|
-
SheetTrigger,
|
|
133
|
-
SheetClose,
|
|
134
|
-
SheetContent,
|
|
135
|
-
SheetHeader,
|
|
136
|
-
SheetFooter,
|
|
137
|
-
SheetTitle,
|
|
138
|
-
SheetDescription,
|
|
139
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
CircleCheckIcon,
|
|
5
|
-
InfoIcon,
|
|
6
|
-
Loader2Icon,
|
|
7
|
-
OctagonXIcon,
|
|
8
|
-
TriangleAlertIcon,
|
|
9
|
-
} from "lucide-react"
|
|
10
|
-
import { useTheme } from "next-themes"
|
|
11
|
-
import { Toaster as Sonner, type ToasterProps } from "sonner"
|
|
12
|
-
|
|
13
|
-
const Toaster = ({ ...props }: ToasterProps) => {
|
|
14
|
-
const { theme = "system" } = useTheme()
|
|
15
|
-
|
|
16
|
-
return (
|
|
17
|
-
<Sonner
|
|
18
|
-
theme={theme as ToasterProps["theme"]}
|
|
19
|
-
className="toaster group"
|
|
20
|
-
icons={{
|
|
21
|
-
success: <CircleCheckIcon className="size-4" />,
|
|
22
|
-
info: <InfoIcon className="size-4" />,
|
|
23
|
-
warning: <TriangleAlertIcon className="size-4" />,
|
|
24
|
-
error: <OctagonXIcon className="size-4" />,
|
|
25
|
-
loading: <Loader2Icon className="size-4 animate-spin" />,
|
|
26
|
-
}}
|
|
27
|
-
style={
|
|
28
|
-
{
|
|
29
|
-
"--normal-bg": "var(--popover)",
|
|
30
|
-
"--normal-text": "var(--popover-foreground)",
|
|
31
|
-
"--normal-border": "var(--border)",
|
|
32
|
-
"--border-radius": "var(--radius)",
|
|
33
|
-
} as React.CSSProperties
|
|
34
|
-
}
|
|
35
|
-
{...props}
|
|
36
|
-
/>
|
|
37
|
-
)
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export { Toaster }
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Loader2Icon } from "lucide-react"
|
|
2
|
-
|
|
3
|
-
import { cn } from "@/lib/utils"
|
|
4
|
-
|
|
5
|
-
function Spinner({ className, ...props }: React.ComponentProps<"svg">) {
|
|
6
|
-
return (
|
|
7
|
-
<Loader2Icon
|
|
8
|
-
role="status"
|
|
9
|
-
aria-label="Loading"
|
|
10
|
-
className={cn("size-4 animate-spin", className)}
|
|
11
|
-
{...props}
|
|
12
|
-
/>
|
|
13
|
-
)
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export { Spinner }
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
|
|
3
|
-
import { cn } from "@/lib/utils"
|
|
4
|
-
|
|
5
|
-
function Textarea({ className, ...props }: React.ComponentProps<"textarea">) {
|
|
6
|
-
return (
|
|
7
|
-
<textarea
|
|
8
|
-
data-slot="textarea"
|
|
9
|
-
className={cn(
|
|
10
|
-
"border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
11
|
-
className
|
|
12
|
-
)}
|
|
13
|
-
{...props}
|
|
14
|
-
/>
|
|
15
|
-
)
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export { Textarea }
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import { Tooltip as TooltipPrimitive } from "radix-ui"
|
|
5
|
-
|
|
6
|
-
import { cn } from "@/lib/utils"
|
|
7
|
-
|
|
8
|
-
function TooltipProvider({
|
|
9
|
-
delayDuration = 0,
|
|
10
|
-
...props
|
|
11
|
-
}: React.ComponentProps<typeof TooltipPrimitive.Provider>) {
|
|
12
|
-
return (
|
|
13
|
-
<TooltipPrimitive.Provider
|
|
14
|
-
data-slot="tooltip-provider"
|
|
15
|
-
delayDuration={delayDuration}
|
|
16
|
-
{...props}
|
|
17
|
-
/>
|
|
18
|
-
)
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
function Tooltip({
|
|
22
|
-
...props
|
|
23
|
-
}: React.ComponentProps<typeof TooltipPrimitive.Root>) {
|
|
24
|
-
return (
|
|
25
|
-
<TooltipProvider>
|
|
26
|
-
<TooltipPrimitive.Root data-slot="tooltip" {...props} />
|
|
27
|
-
</TooltipProvider>
|
|
28
|
-
)
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function TooltipTrigger({
|
|
32
|
-
...props
|
|
33
|
-
}: React.ComponentProps<typeof TooltipPrimitive.Trigger>) {
|
|
34
|
-
return <TooltipPrimitive.Trigger data-slot="tooltip-trigger" {...props} />
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function TooltipContent({
|
|
38
|
-
className,
|
|
39
|
-
sideOffset = 0,
|
|
40
|
-
children,
|
|
41
|
-
...props
|
|
42
|
-
}: React.ComponentProps<typeof TooltipPrimitive.Content>) {
|
|
43
|
-
return (
|
|
44
|
-
<TooltipPrimitive.Portal>
|
|
45
|
-
<TooltipPrimitive.Content
|
|
46
|
-
data-slot="tooltip-content"
|
|
47
|
-
sideOffset={sideOffset}
|
|
48
|
-
className={cn(
|
|
49
|
-
"bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",
|
|
50
|
-
className
|
|
51
|
-
)}
|
|
52
|
-
{...props}
|
|
53
|
-
>
|
|
54
|
-
{children}
|
|
55
|
-
<TooltipPrimitive.Arrow className="bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" />
|
|
56
|
-
</TooltipPrimitive.Content>
|
|
57
|
-
</TooltipPrimitive.Portal>
|
|
58
|
-
)
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { atom, useAtom } from "jotai";
|
|
2
|
-
|
|
3
|
-
// Export the sidebar open state atom so it can be used from other parts of the app
|
|
4
|
-
export const sidebarOpenAtom = atom<boolean>(false);
|
|
5
|
-
|
|
6
|
-
export const useSidebarContext = () => {
|
|
7
|
-
const [isOpen, setIsOpen] = useAtom(sidebarOpenAtom);
|
|
8
|
-
|
|
9
|
-
return {
|
|
10
|
-
isOpen,
|
|
11
|
-
setIsOpen,
|
|
12
|
-
};
|
|
13
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
|
|
3
|
-
const MOBILE_BREAKPOINT = 768
|
|
4
|
-
|
|
5
|
-
export function useIsMobile() {
|
|
6
|
-
const [isMobile, setIsMobile] = React.useState<boolean | undefined>(undefined)
|
|
7
|
-
|
|
8
|
-
React.useEffect(() => {
|
|
9
|
-
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`)
|
|
10
|
-
const onChange = () => {
|
|
11
|
-
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)
|
|
12
|
-
}
|
|
13
|
-
mql.addEventListener("change", onChange)
|
|
14
|
-
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)
|
|
15
|
-
return () => mql.removeEventListener("change", onChange)
|
|
16
|
-
}, [])
|
|
17
|
-
|
|
18
|
-
return !!isMobile
|
|
19
|
-
}
|