Merge remote-tracking branch 'origin/master' into lab/slidimations

This commit is contained in:
Tessa Kelly 2019-04-11 09:57:49 -07:00
commit dbc4d3709e
7 changed files with 55 additions and 23 deletions

View File

@ -3,7 +3,7 @@
"name": "NoRedInk/noredink-ui", "name": "NoRedInk/noredink-ui",
"summary": "UI Widgets we use at NRI", "summary": "UI Widgets we use at NRI",
"license": "BSD-3-Clause", "license": "BSD-3-Clause",
"version": "6.11.0", "version": "6.11.1",
"exposed-modules": [ "exposed-modules": [
"Nri.Ui.Alert.V2", "Nri.Ui.Alert.V2",
"Nri.Ui.Alert.V3", "Nri.Ui.Alert.V3",

View File

@ -101,24 +101,38 @@ viewContent config =
sizeToPx config.size sizeToPx config.size
in in
span [ Attributes.css [ Css.fontSize fontSize ] ] span [ Attributes.css [ Css.fontSize fontSize ] ]
[ case config.icon of (case config.icon of
Just icon -> Just icon ->
div [ div
[ Attributes.css
[ Css.displayFlex
, Css.alignItems Css.center
, Css.property "line-height" "normal"
]
]
[ div
[ Attributes.css [ Attributes.css
[ Css.height fontSize [ Css.height fontSize
, Css.maxWidth fontSize , Css.maxWidth fontSize
, Css.display Css.inlineBlock , case config.size of
, Css.verticalAlign Css.baseline Small ->
, Css.marginRight (Css.px 2) Css.marginRight (Css.px 2)
Medium ->
Css.marginRight (Css.px 3)
Large ->
Css.marginRight (Css.px 4)
] ]
] ]
[ NriSvg.toHtml icon [ NriSvg.toHtml icon ]
, span [] [ text config.label ]
]
] ]
Nothing -> Nothing ->
text "" [ text config.label ]
, text config.label )
]
clickableTextStyles : List Css.Style clickableTextStyles : List Css.Style
@ -138,6 +152,8 @@ clickableTextStyles =
, Css.textDecoration Css.none , Css.textDecoration Css.none
, Css.hover [ Css.textDecoration Css.underline ] , Css.hover [ Css.textDecoration Css.underline ]
, Css.padding Css.zero , Css.padding Css.zero
, Css.display Css.inlineBlock
, Css.verticalAlign Css.textBottom
] ]

View File

@ -104,6 +104,7 @@ viewModal height ( labelledById, panels ) =
"modal-container" "modal-container"
[ Css.width (Css.px 600) [ Css.width (Css.px 600)
, Css.height height , Css.height height
, Css.minHeight (Css.px 400)
, Css.maxHeight <| Css.calc (Css.vh 100) Css.minus (Css.px 100) , Css.maxHeight <| Css.calc (Css.vh 100) Css.minus (Css.px 100)
, Css.padding4 (Css.px 35) Css.zero (Css.px 25) Css.zero , Css.padding4 (Css.px 35) Css.zero (Css.px 25) Css.zero
, Css.margin2 (Css.px 75) Css.auto , Css.margin2 (Css.px 75) Css.auto
@ -197,6 +198,7 @@ viewIcon svg =
[ css [ css
[ Css.width (Css.px 100) [ Css.width (Css.px 100)
, Css.height (Css.px 100) , Css.height (Css.px 100)
, Css.flexShrink Css.zero
, Css.displayFlex , Css.displayFlex
, Css.alignItems Css.center , Css.alignItems Css.center
, Css.justifyContent Css.center , Css.justifyContent Css.center
@ -222,7 +224,8 @@ viewFooter { previous, current, upcoming } =
in in
Nri.Ui.styled div Nri.Ui.styled div
"modal-footer" "modal-footer"
[ Css.displayFlex [ Css.flexShrink Css.zero
, Css.displayFlex
, Css.flexDirection Css.column , Css.flexDirection Css.column
, Css.alignItems Css.center , Css.alignItems Css.center
, Css.margin4 (Css.px 20) Css.zero Css.zero Css.zero , Css.margin4 (Css.px 20) Css.zero Css.zero Css.zero
@ -273,6 +276,7 @@ dot type_ =
, Css.borderRadius (Css.px 5) , Css.borderRadius (Css.px 5)
, Css.margin2 Css.zero (Css.px 2) , Css.margin2 Css.zero (Css.px 2)
, Css.display Css.inlineBlock , Css.display Css.inlineBlock
, Css.verticalAlign Css.middle
, Css.cursor cursor , Css.cursor cursor
, Css.backgroundColor backgroundColor , Css.backgroundColor backgroundColor

View File

@ -164,6 +164,7 @@ panelContainer height direction panel =
[ css [ css
[ -- Layout [ -- Layout
Css.height height Css.height height
, Css.minHeight (Css.px 400)
, Css.width (Css.px 600) , Css.width (Css.px 600)
, Css.minHeight (Css.px 360) , Css.minHeight (Css.px 360)
, Css.maxHeight <| Css.calc (Css.vh 100) Css.minus (Css.px 100) , Css.maxHeight <| Css.calc (Css.vh 100) Css.minus (Css.px 100)
@ -361,6 +362,7 @@ viewIcon svg =
[ css [ css
[ Css.width (Css.px 100) [ Css.width (Css.px 100)
, Css.height (Css.px 100) , Css.height (Css.px 100)
, Css.flexShrink Css.zero
, Css.displayFlex , Css.displayFlex
, Css.alignItems Css.center , Css.alignItems Css.center
, Css.justifyContent Css.center , Css.justifyContent Css.center
@ -386,7 +388,8 @@ viewFooter { previous, current, upcoming } =
in in
Nri.Ui.styled div Nri.Ui.styled div
"modal-footer" "modal-footer"
[ Css.displayFlex [ Css.flexShrink Css.zero
, Css.displayFlex
, Css.flexDirection Css.column , Css.flexDirection Css.column
, Css.alignItems Css.center , Css.alignItems Css.center
, Css.margin4 (Css.px 20) Css.zero Css.zero Css.zero , Css.margin4 (Css.px 20) Css.zero Css.zero Css.zero
@ -437,6 +440,7 @@ dot type_ =
, Css.borderRadius (Css.px 5) , Css.borderRadius (Css.px 5)
, Css.margin2 Css.zero (Css.px 2) , Css.margin2 Css.zero (Css.px 2)
, Css.display Css.inlineBlock , Css.display Css.inlineBlock
, Css.verticalAlign Css.middle
, Css.cursor cursor , Css.cursor cursor
, Css.backgroundColor backgroundColor , Css.backgroundColor backgroundColor

View File

@ -15,8 +15,8 @@ type alias Assets =
, checkboxCheckedPartially_svg : Asset , checkboxCheckedPartially_svg : Asset
, checkboxLockOnInside_svg : Asset , checkboxLockOnInside_svg : Asset
, checkboxUnchecked_svg : Asset , checkboxUnchecked_svg : Asset
, checkWhite_svg : Asset
, checkmark : String , checkmark : String
, checkWhite_svg : Asset
, class : String , class : String
, clever : String , clever : String
, clock : String , clock : String
@ -36,6 +36,7 @@ type alias Assets =
, footsteps : String , footsteps : String
, gear : String , gear : String
, guidedDraft : String , guidedDraft : String
, help : String
, hint_png : Asset , hint_png : Asset
, iconCalendar_svg : Asset , iconCalendar_svg : Asset
, iconCheck_png : Asset , iconCheck_png : Asset
@ -89,8 +90,8 @@ type alias Assets =
, startingOffBadge_png : Asset , startingOffBadge_png : Asset
, submitting : String , submitting : String
, teach_assignments_copyWhite_svg : Asset , teach_assignments_copyWhite_svg : Asset
, twitterBlue_svg : Asset
, tip_svg : Asset , tip_svg : Asset
, twitterBlue_svg : Asset
, unarchiveBlue2x_png : Asset , unarchiveBlue2x_png : Asset
, writingAssignment : String , writingAssignment : String
, writingcycle : String , writingcycle : String
@ -103,11 +104,11 @@ assets : Assets
assets = assets =
{ activity = "icon-activity" { activity = "icon-activity"
, arrowDown = "icon-arrow-down" , arrowDown = "icon-arrow-down"
, assignmentStartButtonPrimary_svg = Asset "assets/images/assignment-start-button-primary.svg"
, assignmentStartButtonSecondary_svg = Asset "assets/images/assignment-start-button-secondary.svg"
, attention_svg = Asset "assets/images/attention.svg" , attention_svg = Asset "assets/images/attention.svg"
, bulb = "icon-bulb" , bulb = "icon-bulb"
, calendar = "icon-calendar" , calendar = "icon-calendar"
, assignmentStartButtonPrimary_svg = Asset "assets/images/assignment-start-button-primary.svg"
, assignmentStartButtonSecondary_svg = Asset "assets/images/assignment-start-button-secondary.svg"
, checkboxChecked_svg = Asset "assets/images/checkbox_checked.svg" , checkboxChecked_svg = Asset "assets/images/checkbox_checked.svg"
, checkboxCheckedPartially_svg = Asset "assets/images/checkbox_checkedPartially.svg" , checkboxCheckedPartially_svg = Asset "assets/images/checkbox_checkedPartially.svg"
, checkboxLockOnInside_svg = Asset "assets/images/checkbox_lock_on_inside.svg" , checkboxLockOnInside_svg = Asset "assets/images/checkbox_lock_on_inside.svg"
@ -133,6 +134,7 @@ assets =
, footsteps = "icon-footsteps" , footsteps = "icon-footsteps"
, gear = "icon-gear" , gear = "icon-gear"
, guidedDraft = "icon-guided-draft" , guidedDraft = "icon-guided-draft"
, help = "icon-help"
, hint_png = Asset "assets/images/hint.png" , hint_png = Asset "assets/images/hint.png"
, iconCalendar_svg = Asset "assets/images/icon-calendar.svg" , iconCalendar_svg = Asset "assets/images/icon-calendar.svg"
, iconCheck_png = Asset "assets/images/icon-check.png" , iconCheck_png = Asset "assets/images/icon-check.png"

View File

@ -46,20 +46,26 @@ example unnamedMessages state =
{-| -} {-| -}
init : { r | performance : String, lock : String } -> State init : { r | performance : String, lock : String, help : String } -> State
init assets = init assets =
Control.record Model Control.record Model
|> Control.field "label" (Control.string "Clickable Text") |> Control.field "label" (Control.string "Clickable Text")
|> Control.field "icon" |> Control.field "icon"
(Control.maybe True <| (Control.maybe True <|
Control.choice Control.choice
( "Performance" ( "Help"
, Icon.helpSvg assets
|> Icon.decorativeIcon
|> NriSvg.fromHtml
|> Control.value
)
[ ( "Performance"
, Icon.performance assets , Icon.performance assets
|> Icon.decorativeIcon |> Icon.decorativeIcon
|> NriSvg.fromHtml |> NriSvg.fromHtml
|> Control.value |> Control.value
) )
[ ( "Lock" , ( "Lock"
, Icon.lock assets , Icon.lock assets
|> Icon.decorativeIcon |> Icon.decorativeIcon
|> NriSvg.fromHtml |> NriSvg.fromHtml

File diff suppressed because one or more lines are too long