diff --git a/ui/components/src/ui/components/tailwind/Icons.scala b/ui/components/src/ui/components/tailwind/Icons.scala index 11c3dd2..d9bc45f 100644 --- a/ui/components/src/ui/components/tailwind/Icons.scala +++ b/ui/components/src/ui/components/tailwind/Icons.scala @@ -328,6 +328,19 @@ ) ) + inline def info(extraClasses: String): SvgElement = + svg( + cls(extraClasses), + fill := "currentColor", + viewBox := "0 0 20 20", + xmlns := "http://www.w3.org/2000/svg", + path( + fillRule := "evenodd", + d := "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z", + clipRule := "evenodd" + ) + ) + end solid class IconComponent(extraClasses: String) diff --git a/ui/components/src/ui/components/tailwind/Icons.scala b/ui/components/src/ui/components/tailwind/Icons.scala index 11c3dd2..d9bc45f 100644 --- a/ui/components/src/ui/components/tailwind/Icons.scala +++ b/ui/components/src/ui/components/tailwind/Icons.scala @@ -328,6 +328,19 @@ ) ) + inline def info(extraClasses: String): SvgElement = + svg( + cls(extraClasses), + fill := "currentColor", + viewBox := "0 0 20 20", + xmlns := "http://www.w3.org/2000/svg", + path( + fillRule := "evenodd", + d := "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z", + clipRule := "evenodd" + ) + ) + end solid class IconComponent(extraClasses: String) diff --git a/ui/components/src/ui/components/tailwind/Renderable.scala b/ui/components/src/ui/components/tailwind/Renderable.scala index 9911742..625da88 100644 --- a/ui/components/src/ui/components/tailwind/Renderable.scala +++ b/ui/components/src/ui/components/tailwind/Renderable.scala @@ -22,4 +22,8 @@ TimeUtils.formatDateTime(v) given plainMultiLineValue: HtmlRenderable[PlainMultiLine] with def toHtml(v: PlainMultiLine): Modifier[HtmlElement] = - pre(v.toString) + p( + v.split("\n") + .map(t => Seq(com.raquo.laminar.nodes.TextNode(t), br())) + .flatten: _* + ) diff --git a/ui/components/src/ui/components/tailwind/Icons.scala b/ui/components/src/ui/components/tailwind/Icons.scala index 11c3dd2..d9bc45f 100644 --- a/ui/components/src/ui/components/tailwind/Icons.scala +++ b/ui/components/src/ui/components/tailwind/Icons.scala @@ -328,6 +328,19 @@ ) ) + inline def info(extraClasses: String): SvgElement = + svg( + cls(extraClasses), + fill := "currentColor", + viewBox := "0 0 20 20", + xmlns := "http://www.w3.org/2000/svg", + path( + fillRule := "evenodd", + d := "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z", + clipRule := "evenodd" + ) + ) + end solid class IconComponent(extraClasses: String) diff --git a/ui/components/src/ui/components/tailwind/Renderable.scala b/ui/components/src/ui/components/tailwind/Renderable.scala index 9911742..625da88 100644 --- a/ui/components/src/ui/components/tailwind/Renderable.scala +++ b/ui/components/src/ui/components/tailwind/Renderable.scala @@ -22,4 +22,8 @@ TimeUtils.formatDateTime(v) given plainMultiLineValue: HtmlRenderable[PlainMultiLine] with def toHtml(v: PlainMultiLine): Modifier[HtmlElement] = - pre(v.toString) + p( + v.split("\n") + .map(t => Seq(com.raquo.laminar.nodes.TextNode(t), br())) + .flatten: _* + ) diff --git a/ui/components/src/ui/components/tailwind/TailwindSupport.scala b/ui/components/src/ui/components/tailwind/TailwindSupport.scala index 2c7d850..a0e281e 100644 --- a/ui/components/src/ui/components/tailwind/TailwindSupport.scala +++ b/ui/components/src/ui/components/tailwind/TailwindSupport.scala @@ -29,7 +29,17 @@ "text-red-800", "text-amber-800", "text-green-800", + "text-yellow-800", "bg-red-100", "bg-amber-100", - "bg-green-100" + "bg-green-100", + "bg-yellow-100", + "hover:bg-red-100", + "hover:bg-amber-100", + "hover:bg-green-100", + "hover:bg-yellow-100", + "bg-green-50", + "bg-amber-50", + "bg-red-50", + "bg-yellow-50" ) diff --git a/ui/components/src/ui/components/tailwind/Icons.scala b/ui/components/src/ui/components/tailwind/Icons.scala index 11c3dd2..d9bc45f 100644 --- a/ui/components/src/ui/components/tailwind/Icons.scala +++ b/ui/components/src/ui/components/tailwind/Icons.scala @@ -328,6 +328,19 @@ ) ) + inline def info(extraClasses: String): SvgElement = + svg( + cls(extraClasses), + fill := "currentColor", + viewBox := "0 0 20 20", + xmlns := "http://www.w3.org/2000/svg", + path( + fillRule := "evenodd", + d := "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z", + clipRule := "evenodd" + ) + ) + end solid class IconComponent(extraClasses: String) diff --git a/ui/components/src/ui/components/tailwind/Renderable.scala b/ui/components/src/ui/components/tailwind/Renderable.scala index 9911742..625da88 100644 --- a/ui/components/src/ui/components/tailwind/Renderable.scala +++ b/ui/components/src/ui/components/tailwind/Renderable.scala @@ -22,4 +22,8 @@ TimeUtils.formatDateTime(v) given plainMultiLineValue: HtmlRenderable[PlainMultiLine] with def toHtml(v: PlainMultiLine): Modifier[HtmlElement] = - pre(v.toString) + p( + v.split("\n") + .map(t => Seq(com.raquo.laminar.nodes.TextNode(t), br())) + .flatten: _* + ) diff --git a/ui/components/src/ui/components/tailwind/TailwindSupport.scala b/ui/components/src/ui/components/tailwind/TailwindSupport.scala index 2c7d850..a0e281e 100644 --- a/ui/components/src/ui/components/tailwind/TailwindSupport.scala +++ b/ui/components/src/ui/components/tailwind/TailwindSupport.scala @@ -29,7 +29,17 @@ "text-red-800", "text-amber-800", "text-green-800", + "text-yellow-800", "bg-red-100", "bg-amber-100", - "bg-green-100" + "bg-green-100", + "bg-yellow-100", + "hover:bg-red-100", + "hover:bg-amber-100", + "hover:bg-green-100", + "hover:bg-yellow-100", + "bg-green-50", + "bg-amber-50", + "bg-red-50", + "bg-yellow-50" ) diff --git a/ui/components/src/ui/components/tailwind/list/StackedList.scala b/ui/components/src/ui/components/tailwind/list/StackedList.scala index 00608ed..dc673a3 100644 --- a/ui/components/src/ui/components/tailwind/list/StackedList.scala +++ b/ui/components/src/ui/components/tailwind/list/StackedList.scala @@ -96,8 +96,10 @@ text ) - def link(mods: Modifier[Anchor])(content: HtmlElement): HtmlElement = - a(cls("block hover:bg-gray-50"), mods, content) + def link(mods: Modifier[Anchor], classes: String = "hover:bg-gray-50")( + content: HtmlElement + ): HtmlElement = + a(cls("block"), cls(classes), mods, content) def stickyHeader( header: Modifier[HtmlElement],