Skip to content

Commit

Permalink
feat: reusable SDK components, styled to SdPi guidelines
Browse files Browse the repository at this point in the history
  • Loading branch information
sergey-tihon committed Dec 28, 2023
1 parent 592ada6 commit c01aa31
Show file tree
Hide file tree
Showing 8 changed files with 197 additions and 254 deletions.
8 changes: 8 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"cSpell.words": [
"Elgato",
"Elmish",
"Feliz",
"Homebridge"
]
}
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Changelog

## [Unreleased]
## [1.5.0] - 2023-12-28

- Reusable SDK components, styled to SdPi guidelines
- Dependencies update, Fun.Build and .NET 8 (#31)

## [1.4.0] - 2023-01-01

Expand Down
381 changes: 131 additions & 250 deletions src/StreamDeck.Homebridge/PiView.fs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/StreamDeck.Homebridge/StreamDeck.Homebridge.fsproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
Expand Down
49 changes: 49 additions & 0 deletions src/StreamDeck.SDK/Components.fs
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 ] ]
]
1 change: 1 addition & 0 deletions src/StreamDeck.SDK/StreamDeck.SDK.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<Compile Include="PluginModel.fs" />
<Compile Include="PiModel.fs" />
<Compile Include="Css.fs" />
<Compile Include="Components.fs" />
</ItemGroup>
<Import Project="..\..\.paket\Paket.Restore.targets" />
</Project>
3 changes: 2 additions & 1 deletion src/StreamDeck.SDK/paket.references
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
2 changes: 1 addition & 1 deletion src/com.sergeytihon.homebridge.sdPlugin/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"Name": "Homebridge",
"Icon": "resources/pluginIcon",
"URL": "https://github.com/sergey-tihon/streamdeck-homebridge",
"Version": "1.4.0",
"Version": "1.5.0",
"Category": "Homebridge",
"CategoryIcon": "resources/pluginIcon",
"OS": [
Expand Down

0 comments on commit c01aa31

Please sign in to comment.