11module Lumi.Components.Examples.Color where
22
33import Prelude
4-
54import Color (cssStringHSLA )
65import Data.Foldable (intercalate )
76import Data.Maybe (Maybe (..))
@@ -24,19 +23,22 @@ docs =
2423 [ row
2524 { style: css { flexWrap: " wrap" }
2625 , children:
27- [ section
28- [ intercalate divider
29- [ colorPanel _.black " Black" """ default text color
26+ [ section
27+ [ intercalate divider
28+ [ colorPanel _.black " Black"
29+ """ default text color
3030active nav links
3131active tabs
3232active grid/lines icon on items page"""
33- , colorPanel _.black1 " Black - 50%" """ secondary text color
33+ , colorPanel _.black1 " Black - 50%"
34+ """ secondary text color
3435subtext
3536inactive nav links
3637inactive tabs
3738column titles
3839column sort arrow icon color"""
39- , colorPanel _.black2 " Black - 30%" """ text in disabled buttons and form fields
40+ , colorPanel _.black2 " Black - 30%"
41+ """ text in disabled buttons and form fields
4042icons in disabled buttons and form fields
4143placeholder text in form fields
4244toggle background
@@ -45,78 +47,86 @@ Checkbox border color (Hover state)
4547Radio button border color (Hover state)
4648Grey status pill text color
4749inactive list/grid icon color"""
48- , colorPanel _.black3 " Black - 18%" """ Form field border (Regular/Inactive state)
50+ , colorPanel _.black3 " Black - 18%"
51+ """ Form field border (Regular/Inactive state)
4952Checkbox border color (Regular/Inactive state)
5053Radio button border color (Regular/Inactive state)"""
51- , colorPanel _.black4 " Black - 12%" """ Table/list line colors
54+ , colorPanel _.black4 " Black - 12%"
55+ """ Table/list line colors
5256Divider line color
5357Slat border color
5458Container box color
5559Thumbnail border color
5660Payment method border color
5761Grey status pill border color
5862Slider grey bar background color"""
59- , colorPanel _.black5 " Black - 6%" """ disabled input field background
63+ , colorPanel _.black5 " Black - 6%"
64+ """ disabled input field background
6065disabled checkbox background color
6166disabled radio button background color
6267disabled toggle background color"""
63- , colorPanel _.black6 " Black - Background gray" """ Nav bar background color
68+ , colorPanel _.black6 " Black - Background gray"
69+ """ Nav bar background color
6470Image background color"""
65- , colorPanel _.black7 " Black - 4%" """ dropdown hover background color"""
66- , colorPanel _.black8 " Black - 2%" """ table row hover background color"""
67- ]
68- ]
69- , section
70- [ intercalate divider
71- [ colorPanel _.primary " Primary" """ primary actions
71+ , colorPanel _.black7 " Black - 4%" """ dropdown hover background color"""
72+ , colorPanel _.black8 " Black - 2%" """ table row hover background color"""
73+ ]
74+ ]
75+ , section
76+ [ intercalate divider
77+ [ colorPanel _.primary " Primary"
78+ """ primary actions
7279active states
7380links"""
74- , colorPanel _.primary1 " Primary - 35%" """ 1px active border for input fields, radio buttons, and checkboxes"""
75- , colorPanel _.primary2 " Primary - 25%" """ Used for the disabled primary button background color"""
76- , colorPanel _.primary3 " Primary - 15%" """ tag color for multi select dropdowns, the 3px focus border for inputs, and the selected row background color in input dropdowns"""
77- , colorPanel _.primary4 " Primary - 7%" """ Input dropdown row hover background color
81+ , colorPanel _.primary1 " Primary - 35%" """ 1px active border for input fields, radio buttons, and checkboxes"""
82+ , colorPanel _.primary2 " Primary - 25%" """ Used for the disabled primary button background color"""
83+ , colorPanel _.primary3 " Primary - 15%" """ tag color for multi select dropdowns, the 3px focus border for inputs, and the selected row background color in input dropdowns"""
84+ , colorPanel _.primary4 " Primary - 7%"
85+ """ Input dropdown row hover background color
7886selected table row background color"""
79- , colorPanel _.accent1 " Accent 1" """ Indicates good or complete status"""
80- , colorPanel _.accent2 " Accent 2" """ Indicates pending, needs attention"""
81- , colorPanel _.accent3 " Accent 3" """ Indicates a problem, warning"""
82- , colorPanel _.accent33 " Accent 3 - 15%" """ Faded for focus borders/backgrounds"""
83- , colorPanel _.white " White" """ Primary button text"""
84- ]
85- ]
86- ]
87+ , colorPanel _.accent1 " Accent 1" """ Indicates good or complete status"""
88+ , colorPanel _.accent2 " Accent 2" """ Indicates pending, needs attention"""
89+ , colorPanel _.accent3 " Accent 3" """ Indicates a problem, warning"""
90+ , colorPanel _.accent33 " Accent 3 - 15%" """ Faded for focus borders/backgrounds"""
91+ , colorPanel _.white " White" """ Primary button text"""
92+ ]
93+ ]
94+ ]
8795 }
8896 ]
8997 where
90- colorPanel :: (forall a . ColorMap a -> a ) -> String -> String -> JSX
91- colorPanel color title notes =
92- row_
93- [ column
94- { style: css { padding: " 0.5rem" , alignItems: " center" , color: cssStringHSLA colors.black1 }
95- , children:
96- [ button defaults { size = Large , color = toNullable $ Just (color colorNames) }
97- , text body
98- { children = [ R .text (unwrap <<< color $ colorNames) ]
99- }
100- ]
101- }
102- , column
103- { style: css { padding: " 0.5rem" }
104- , children:
105- [ body_ title ]
106- <> (
107- split (Pattern " \n " ) notes <#> \note ->
108- text subtext
109- { style = css { color: cssStringHSLA colors.black1 }
110- , children = [ R .text note ]
111- }
98+ colorPanel :: (forall a . ColorMap a -> a ) -> String -> String -> JSX
99+ colorPanel color title notes =
100+ row_
101+ [ column
102+ { style: css { padding: " 5px" , alignItems: " center" , color: cssStringHSLA colors.black1 }
103+ , children:
104+ [ button defaults { size = Large , color = toNullable $ Just (color colorNames) }
105+ , text
106+ body
107+ { children = [ R .text (unwrap <<< color $ colorNames) ]
108+ }
109+ ]
110+ }
111+ , column
112+ { style: css { padding: " 5px" }
113+ , children:
114+ [ body_ title ]
115+ <> ( split (Pattern " \n " ) notes
116+ <#> \note ->
117+ text
118+ subtext
119+ { style = css { color: cssStringHSLA colors.black1 }
120+ , children = [ R .text note ]
121+ }
112122 )
113- }
114- ]
123+ }
124+ ]
115125
116- section panels =
117- R .section
118- { style: css { maxWidth: " 70rem " , flex: " 1 1 0" }
119- , children: panels
120- }
126+ section panels =
127+ R .section
128+ { style: css { maxWidth: " 700px " , flex: " 1 1 0" }
129+ , children: panels
130+ }
121131
122- divider = row { style: css { height: " 2rem " }, children: [] }
132+ divider = row { style: css { height: " 20px " }, children: [] }
0 commit comments