-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: reusable SDK components, styled to SdPi guidelines
- Loading branch information
1 parent
592ada6
commit c01aa31
Showing
8 changed files
with
197 additions
and
254 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"cSpell.words": [ | ||
"Elgato", | ||
"Elmish", | ||
"Feliz", | ||
"Homebridge" | ||
] | ||
} |
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
Large diffs are not rendered by default.
Oops, something went wrong.
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,49 @@ | ||
[<RequireQualifiedAccessAttribute>] | ||
module StreamDeck.SDK.Components.Pi | ||
|
||
open Feliz | ||
open StreamDeck.SDK.Css | ||
|
||
let input (label: string) props = | ||
Html.div [ | ||
prop.className SdPi.Item | ||
prop.type' "field" | ||
prop.children [ | ||
Html.div [ prop.className SdPi.ItemLabel; prop.text label ] | ||
Html.input((prop.className SdPi.ItemValue) :: props) | ||
] | ||
] | ||
|
||
let select (label: string) props = | ||
Html.div [ | ||
prop.className SdPi.Item | ||
prop.children [ | ||
Html.div [ prop.className SdPi.ItemLabel; prop.text label ] | ||
Html.select((prop.classes [ SdPi.ItemValue; "select" ]) :: props) | ||
] | ||
] | ||
|
||
let range (label: string) (children: ReactElement seq) = | ||
Html.div [ | ||
prop.className SdPi.Item | ||
prop.type' "range" | ||
prop.children [ | ||
Html.div [ prop.className SdPi.ItemLabel; prop.text label ] | ||
Html.div [ prop.className SdPi.ItemValue; prop.children children ] | ||
] | ||
] | ||
|
||
let button (text: string) onClick = | ||
Html.div [ | ||
prop.className SdPi.Item | ||
prop.type' "button" | ||
prop.children [ | ||
Html.button [ prop.className SdPi.ItemValue; prop.text text; prop.onClick onClick ] | ||
] | ||
] | ||
|
||
let message icon color (message: string) = | ||
Html.details [ | ||
prop.classes [ "message"; icon ] | ||
prop.children [ Html.summary [ prop.style [ style.color color ]; prop.text message ] ] | ||
] |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
Fable.Core | ||
Fable.Browser.Dom | ||
Fable.Browser.WebSocket | ||
Fable.Browser.WebSocket | ||
Feliz |
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