-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ai: add 'Generate with AI' to template selection as Features.AINewDoc…
…ument
- Loading branch information
1 parent
200ac80
commit 28cf366
Showing
5 changed files
with
92 additions
and
3 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
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,43 @@ | ||
module Doc.UIStyled exposing (viewAINewPrompt) | ||
|
||
import Css exposing (..) | ||
import Html exposing (Html) | ||
import Html.Styled exposing (div, label, text, textarea, toUnstyled) | ||
import Html.Styled.Attributes exposing (autofocus, css, for, id, rows) | ||
import Html.Styled.Events exposing (onInput) | ||
import SharedUI exposing (modalWrapper) | ||
import Styles exposing (colors) | ||
import Translation exposing (Language) | ||
|
||
|
||
viewAINewPrompt : Language -> { modalClosed : msg, promptInput : String -> msg } -> List (Html msg) | ||
viewAINewPrompt lang msgs = | ||
[ div [ css [ displayFlex, flexDirection column, property "gap" "10px" ] ] | ||
[ label [ for "ai-new-prompt", css [ fontWeight bold ] ] [ text "Prompt" ] | ||
, textarea | ||
[ id "ai-new-prompt" | ||
, css [ fontSize (px 16), padding (px 10) ] | ||
, onInput msgs.promptInput | ||
, autofocus True | ||
, rows 8 | ||
] | ||
[] | ||
, div [ css [ displayFlex, justifyContent flexEnd ] ] | ||
[ div | ||
[ css | ||
[ fontWeight bold | ||
, color colors.nearWhite | ||
, backgroundColor colors.green | ||
, padding (px 10) | ||
, borderRadius (px 6) | ||
, cursor pointer | ||
, hover [ boxShadow4 zero (px 2) (px 3) (rgba 0 0 0 0.2) ] | ||
, active [ marginTop (px 1) ] | ||
] | ||
] | ||
[ text "Generate" ] | ||
] | ||
] | ||
] | ||
|> List.map toUnstyled | ||
|> modalWrapper msgs.modalClosed Nothing Nothing "Generate Document" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module Styles exposing (colors) | ||
|
||
import Css exposing (hsl, rgb, rgba) | ||
|
||
|
||
colors = | ||
{ green = hsl 86 0.54 0.51 | ||
, nearWhite = rgba 255 255 255 0.95 | ||
, white = rgb 255 255 255 | ||
} |