Skip to content

Commit

Permalink
Hotfix for #52
Browse files Browse the repository at this point in the history
  • Loading branch information
Orasund committed Mar 18, 2021
1 parent 68396a3 commit 4774b70
Show file tree
Hide file tree
Showing 6 changed files with 88 additions and 12 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
This package contains **independent** widgets (no components) written for [Elm-Ui](https://package.elm-lang.org/packages/mdgriffith/elm-ui/latest/). These widgets have no dependencies to other parts of this package. So you can just use as much as you need.

* [Examples of all widgets can be found here](https://orasund.github.io/elm-ui-widgets/3.0.0/).
* It has a [Material Design Theme](/Widget-Material) ready to use. Additionally it also supports custom themes.
* It is highly customizable. Checkout [Widget.Customize](/Widget-Customize) for more information.
* It has a [Material Design Theme](Widget-Material) ready to use. Additionally, it also supports custom themes.
* It is highly customizable. Checkout [Widget.Customize](Widget-Customize) for more information.

Feel free to start an [issue on the repository](https://github.com/Orasund/elm-ui-widgets/issues) if you have any questions.

Expand Down Expand Up @@ -139,12 +139,12 @@ selectButton :
-> Element msg
```

Checkout the examples in [Widget](https://package.elm-lang.org/packages/Orasund/elm-ui-widgets/latest/Widget) for more details.
Checkout the examples in [Widget](Widget) for more details.

## Reusable Views vs. Components

In Elm we like to use reusable views instead of components.
At first this packages had a few components, but they where more complicated in comparison. They got slowly turned into reusable views one by one. Most have been reduced even further into _view functions_: Reusable views without a model. All function in [Widget](https://package.elm-lang.org/packages/Orasund/elm-ui-widgets/latest/Widget) are view functions.
At first this packages had a few components, but they where more complicated in comparison. They got slowly turned into reusable views one by one. Most have been reduced even further into _view functions_: Reusable views without a model. All function in [Widget](Widget) are view functions.

## Alternatives

Expand Down
74 changes: 74 additions & 0 deletions example/src/Code.elm
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@

import Http exposing (Error)
import Parser

url : String
url name =
"https://raw.githubusercontent.com/Orasund/elm-ui-widget/master/example/src/Example/" ++ name ++ ".elm"

get : String -> (Result Error String -> msg) -> Cmd msg
get name msg =
Http.get
{ url = url name
, expect =
Http.expectString msg
}

toAscii : String -> String
toAscii =
String.foldr
(\char ->
(case char of
' ' -> "%20"
'!' -> "%21"
'"' -> "%22"
'#' -> "%23"
'$' -> "%24"
'%' -> "%25"
'&' -> "%26"
'\'' -> "%27"
'(' -> "%28"
')' -> "%29"
'*' -> "%2A"
'+' -> "%2B"
',' -> "%2C"
'-' -> "%2D"
'.' -> "%2E"
'/' -> "%2F"
':' -> "%3A"
';' -> "%3B"
'<' -> "%3C"
'=' -> "%3D"
'>' -> "%3E"
'?' -> "%3F"
'@' -> "%40"
'[' -> "%5B"
'\\' -> "%5C"
']' -> "%5D"
'{' -> "%7B"
'|' -> "%7C"
'}' -> "%7D"
_ -> String.fromChar char
)
|> String.append
)

replaceModuleName : String -> String
replaceModuleName =
case String.split "\n" of
head :: tail ->
toAscii "module Main exposing (main)" :: tail
|> String.join "\n"
[] -> ""

generateLink :
{ title : String
, html : String
, packages : List (String,String)
, elmVersion : String
} -> String -> String
generateLink {title,html,packages,elmVersion} elmCode =
"https://ellie-app.com/a/example/v1?"
++ "title=" ++ toAscii title
++ "&elmcode=" ++ toAscii elmCode
++ "&packages=" ++ toAscii
8 changes: 7 additions & 1 deletion src/Internal/List.elm
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,13 @@ column style =

itemList : ColumnStyle msg -> List (Item msg) -> Element msg
itemList style =
internal style.content >> Element.column style.elementColumn
internal
(style.content
--FIX FOR ISSUE #52
|> Customize.element [ Element.height Element.shrink ]
)
>> Element.column
style.elementColumn


internalButton :
Expand Down
4 changes: 0 additions & 4 deletions src/Widget.elm
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,13 @@ You can create you own widgets by sticking widgets types together.
![Dialog](https://orasund.github.io/elm-ui-widgets/assets/dialog.png)
[Open in Ellie](https://ellie-app.com/9p5Rdz625TZa1)
@docs DialogStyle, Dialog, dialog
# List
![List](https://orasund.github.io/elm-ui-widgets/assets/list.png)
[Open in Ellie](https://ellie-app.com/9p5RJnDVVCKa1)
## Row
Expand Down
4 changes: 2 additions & 2 deletions src/Widget/Layout.elm
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ module Widget.Layout exposing
, getDeviceClass, partitionActions, orderModals
)

{-| Combines multiple concepts from the [material design specification](https://material.io/components/), namely:
{-| Combines multiple concepts from the [Material Design specification](https://material.io/components/), namely:
- Top App Bar
- Navigation Draw
- Side Panel
- Dialog
- Snackbar
It is responsive and changes view to apply to the [material design guidelines](https://material.io/components/app-bars-top).
It is responsive and changes view to apply to the [Material Design guidelines](https://material.io/components/app-bars-top).
![Layout](https://orasund.github.io/elm-ui-widgets/assets/layout.png)
Expand Down
2 changes: 1 addition & 1 deletion src/Widget/Material.elm
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module Widget.Material exposing
The stylings are following [the official Material Design guidelines](https://material.io/components) as close as possible.
Please use these widgets in combination with the official guidelines.
The typograpahy is taken from [the material design guidelines](https://material.io/design/typography/the-type-system.html#type-scale).
The typograpahy is taken from [the Material Design guidelines](https://material.io/design/typography/the-type-system.html#type-scale).
Its recommended to use a font size of 16px width and the [Roboto Font](https://fonts.google.com/specimen/Roboto?query=Ro).
The style are not opaque, so you can change every styling to your needs.
Expand Down

0 comments on commit 4774b70

Please sign in to comment.