mirror of
https://github.com/NoRedInk/noredink-ui.git
synced 2024-12-01 00:34:27 +03:00
Kill the color theme
This commit is contained in:
parent
7c64660549
commit
534fade431
@ -1,7 +1,6 @@
|
||||
module Nri.Ui.Checkbox.V3
|
||||
exposing
|
||||
( ColorTheme(..)
|
||||
, IsSelected(..)
|
||||
( IsSelected(..)
|
||||
, Model
|
||||
, Theme(..)
|
||||
, view
|
||||
@ -10,7 +9,7 @@ module Nri.Ui.Checkbox.V3
|
||||
|
||||
{-|
|
||||
|
||||
@docs Model, Theme, ColorTheme, IsSelected
|
||||
@docs Model, Theme, IsSelected
|
||||
|
||||
@docs view, viewWithLabel
|
||||
|
||||
@ -62,17 +61,11 @@ type IsSelected
|
||||
|
||||
{-| -}
|
||||
type Theme
|
||||
= Square ColorTheme
|
||||
= Square
|
||||
| LockOnInside
|
||||
| Premium
|
||||
|
||||
|
||||
{-| -}
|
||||
type ColorTheme
|
||||
= Default
|
||||
| Gray
|
||||
|
||||
|
||||
selectedToMaybe : IsSelected -> Maybe Bool
|
||||
selectedToMaybe selected =
|
||||
case selected of
|
||||
@ -111,9 +104,9 @@ buildCheckbox assets modifierClasses model labelContent =
|
||||
in
|
||||
viewCheckbox model <|
|
||||
case model.theme of
|
||||
Square colorTheme ->
|
||||
Square ->
|
||||
{ containerClasses = toClassList (modifierClasses ++ [ "SquareClass" ])
|
||||
, labelStyles = squareLabelStyles assets model colorTheme
|
||||
, labelStyles = squareLabelStyles assets model
|
||||
, labelClasses = labelClass model.selected
|
||||
, labelContent = labelContent
|
||||
}
|
||||
@ -133,7 +126,7 @@ buildCheckbox assets modifierClasses model labelContent =
|
||||
}
|
||||
|
||||
|
||||
squareLabelStyles assets model colorTheme =
|
||||
squareLabelStyles assets model =
|
||||
let
|
||||
baseStyles =
|
||||
[ -- Postioning
|
||||
@ -145,14 +138,6 @@ squareLabelStyles assets model colorTheme =
|
||||
-- Text
|
||||
, Fonts.baseFont
|
||||
, fontSize (px 16)
|
||||
, Css.batch <|
|
||||
-- If this is the only difference, is it worth having a color theme at all??
|
||||
case colorTheme of
|
||||
Gray ->
|
||||
[ color Colors.gray45 ]
|
||||
|
||||
Default ->
|
||||
[ color Colors.gray20 ]
|
||||
|
||||
-- Focus & Hover
|
||||
, outline none
|
||||
|
@ -56,7 +56,7 @@ premium assets config =
|
||||
else if config.contentPremiumLevel /= Free then
|
||||
Checkbox.Premium
|
||||
else
|
||||
Checkbox.Square Checkbox.Default
|
||||
Checkbox.Square
|
||||
in
|
||||
Html.div
|
||||
[ css
|
||||
|
@ -108,7 +108,7 @@ viewInteractableCheckbox id state =
|
||||
, setterMsg = ToggleCheck id
|
||||
, selected = isSelected id state
|
||||
, disabled = False
|
||||
, theme = Checkbox.Square Checkbox.Default
|
||||
, theme = Checkbox.Square
|
||||
, noOpMsg = NoOp
|
||||
}
|
||||
|
||||
@ -122,7 +122,7 @@ viewIndeterminateCheckbox id state =
|
||||
, setterMsg = ToggleCheck id
|
||||
, selected = Checkbox.PartiallySelected
|
||||
, disabled = True
|
||||
, theme = Checkbox.Square Checkbox.Default
|
||||
, theme = Checkbox.Square
|
||||
, noOpMsg = NoOp
|
||||
}
|
||||
|
||||
@ -150,7 +150,7 @@ viewDisabledCheckbox id state =
|
||||
, setterMsg = ToggleCheck id
|
||||
, selected = isSelected id state
|
||||
, disabled = True
|
||||
, theme = Checkbox.Square Checkbox.Default
|
||||
, theme = Checkbox.Square
|
||||
, noOpMsg = NoOp
|
||||
}
|
||||
|
||||
|
@ -49,7 +49,7 @@ example parentMessage state =
|
||||
, setterMsg = ToggleLabel
|
||||
, selected = state.showLabel
|
||||
, disabled = False
|
||||
, theme = Checkbox.Square Checkbox.Default
|
||||
, theme = Checkbox.Square
|
||||
, noOpMsg = NoOp
|
||||
}
|
||||
|> Html.Styled.toUnstyled
|
||||
@ -59,7 +59,7 @@ example parentMessage state =
|
||||
, setterMsg = ToggleAutoResize
|
||||
, selected = state.autoResize
|
||||
, disabled = False
|
||||
, theme = Checkbox.Square Checkbox.Default
|
||||
, theme = Checkbox.Square
|
||||
, noOpMsg = NoOp
|
||||
}
|
||||
|> Html.Styled.toUnstyled
|
||||
@ -69,7 +69,7 @@ example parentMessage state =
|
||||
, setterMsg = ToggleErrorState
|
||||
, selected = state.isInError
|
||||
, disabled = False
|
||||
, theme = Checkbox.Square Checkbox.Default
|
||||
, theme = Checkbox.Square
|
||||
, noOpMsg = NoOp
|
||||
}
|
||||
|> Html.Styled.toUnstyled
|
||||
|
Loading…
Reference in New Issue
Block a user