-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
da70d2f
commit 6471277
Showing
14 changed files
with
295 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
web/src/components/library/LibraryPageImportFromURL/LibraryPageImportFromURL.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
"use client"; | ||
|
||
import { useState } from "react"; | ||
import { Controller, ControllerProps } from "react-hook-form"; | ||
|
||
import { InfoTip } from "@/components/site/InfoTip"; | ||
import { FormErrorText } from "@/components/ui/FormErrorText"; | ||
import { Button } from "@/components/ui/button"; | ||
import { Input } from "@/components/ui/input"; | ||
import { Form } from "@/screens/library/LibraryPageScreen/useLibraryPageScreen"; | ||
import { HStack, LStack } from "@/styled-system/jsx"; | ||
|
||
function useLibraryPageImportFromURL() { | ||
// | ||
} | ||
|
||
export function LibraryPageImportFromURL( | ||
props: Omit<ControllerProps<Form>, "render">, | ||
) { | ||
return ( | ||
<Controller<Form> | ||
control={props.control} | ||
name={props.name} | ||
render={(form) => { | ||
// | ||
|
||
return ( | ||
<LStack gap="0"> | ||
<HStack w="full" justify="space-between"> | ||
<Input | ||
w="full" | ||
size="sm" | ||
variant="ghost" | ||
color="fg.muted" | ||
placeholder="External URL..." | ||
{...form.field} | ||
/> | ||
|
||
{/* <HStack> | ||
<InfoTip title="Generating a page from a URL"> | ||
Importing a URL will fetch the content and store it in this | ||
page. | ||
</InfoTip> | ||
<Button type="button" size="xs" variant="subtle"> | ||
Import | ||
</Button> | ||
</HStack> */} | ||
</HStack> | ||
<FormErrorText>{form.fieldState.error?.message}</FormErrorText> | ||
</LStack> | ||
); | ||
}} | ||
/> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { InfoIcon } from "lucide-react"; | ||
import { PropsWithChildren } from "react"; | ||
|
||
import * as Popover from "@/components/ui/popover"; | ||
import { LStack } from "@/styled-system/jsx"; | ||
|
||
import { IconButton } from "../ui/icon-button"; | ||
|
||
type Props = { | ||
title: string; | ||
}; | ||
|
||
export function InfoTip({ title, children }: PropsWithChildren<Props>) { | ||
return ( | ||
<Popover.Root> | ||
<Popover.Trigger asChild> | ||
<IconButton size="xs" variant="ghost" borderRadius="full"> | ||
<InfoIcon /> | ||
</IconButton> | ||
</Popover.Trigger> | ||
<Popover.Positioner> | ||
<Popover.Content> | ||
<Popover.Arrow> | ||
<Popover.ArrowTip /> | ||
</Popover.Arrow> | ||
<LStack gap="1"> | ||
<Popover.Title>{title}</Popover.Title> | ||
<Popover.Description>{children}</Popover.Description> | ||
</LStack> | ||
</Popover.Content> | ||
</Popover.Positioner> | ||
</Popover.Root> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import { defineRecipe } from "@pandacss/dev"; | ||
|
||
export const input = defineRecipe({ | ||
className: "input", | ||
jsx: ["Input", "Field.Input"], | ||
base: { | ||
appearance: "none", | ||
background: "none", | ||
borderColor: "border.default", | ||
borderRadius: "l2", | ||
borderWidth: "1px", | ||
colorPalette: "accent", | ||
color: "fg.default", | ||
outline: 0, | ||
position: "relative", | ||
transitionDuration: "normal", | ||
transitionProperty: "box-shadow, border-color", | ||
transitionTimingFunction: "default", | ||
width: "full", | ||
_disabled: { | ||
opacity: 0.4, | ||
cursor: "not-allowed", | ||
}, | ||
_focus: { | ||
borderColor: "colorPalette.default", | ||
boxShadow: "0 0 0 1px var(--colors-color-palette-default)", | ||
}, | ||
_invalid: { | ||
borderColor: "fg.error", | ||
_focus: { | ||
borderColor: "fg.error", | ||
boxShadow: "0 0 0 1px var(--colors-border-error)", | ||
}, | ||
}, | ||
_placeholder: { | ||
color: "fg.subtle", | ||
opacity: "full", | ||
}, | ||
}, | ||
defaultVariants: { | ||
size: "md", | ||
variant: "outline", | ||
}, | ||
variants: { | ||
size: { | ||
"2xs": { px: "1.5", h: "7", minW: "7", fontSize: "xs" }, | ||
xs: { px: "2", h: "8", minW: "8", fontSize: "xs" }, | ||
sm: { px: "2.5", h: "9", minW: "9", fontSize: "sm" }, | ||
md: { px: "3", h: "10", minW: "10", fontSize: "md" }, | ||
lg: { px: "3.5", h: "11", minW: "11", fontSize: "md" }, | ||
xl: { px: "4", h: "12", minW: "12", fontSize: "lg" }, | ||
"2xl": { px: "4.5", h: "16", minW: "16", textStyle: "3xl" }, | ||
}, | ||
variant: { | ||
outline: {}, | ||
ghost: { | ||
borderColor: "transparent", | ||
px: "0", | ||
_focus: { | ||
borderColor: "transparent", | ||
boxShadow: "0 0 0 0px var(--colors-color-palette-default)", | ||
}, | ||
}, | ||
}, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import { popoverAnatomy } from "@ark-ui/anatomy"; | ||
import { defineSlotRecipe } from "@pandacss/dev"; | ||
|
||
export const popover = defineSlotRecipe({ | ||
className: "popover", | ||
slots: popoverAnatomy.keys(), | ||
base: { | ||
positioner: { | ||
position: "relative", | ||
}, | ||
content: { | ||
background: "bg.default", | ||
borderRadius: "l3", | ||
boxShadow: "lg", | ||
display: "flex", | ||
flexDirection: "column", | ||
maxWidth: "sm", | ||
zIndex: "popover", | ||
p: "4", | ||
_open: { | ||
animation: "fadeIn 0.25s ease-out", | ||
}, | ||
_closed: { | ||
animation: "fadeOut 0.2s ease-out", | ||
}, | ||
_hidden: { | ||
display: "none", | ||
}, | ||
}, | ||
title: { | ||
fontWeight: "medium", | ||
textStyle: "sm", | ||
}, | ||
description: { | ||
color: "fg.muted", | ||
textStyle: "sm", | ||
}, | ||
closeTrigger: { | ||
color: "fg.muted", | ||
}, | ||
arrow: { | ||
"--arrow-size": "var(--sizes-3)", | ||
"--arrow-background": "var(--colors-bg-default)", | ||
}, | ||
arrowTip: { | ||
borderTopWidth: "1px", | ||
borderLeftWidth: "1px", | ||
}, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.