1
1
module Lumi.Components.Examples.Color where
2
2
3
3
import Prelude
4
-
5
4
import Color (cssStringHSLA )
6
5
import Data.Foldable (intercalate )
7
6
import Data.Maybe (Maybe (..))
@@ -24,19 +23,22 @@ docs =
24
23
[ row
25
24
{ style: css { flexWrap: " wrap" }
26
25
, 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
30
30
active nav links
31
31
active tabs
32
32
active grid/lines icon on items page"""
33
- , colorPanel _.black1 " Black - 50%" """ secondary text color
33
+ , colorPanel _.black1 " Black - 50%"
34
+ """ secondary text color
34
35
subtext
35
36
inactive nav links
36
37
inactive tabs
37
38
column titles
38
39
column 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
40
42
icons in disabled buttons and form fields
41
43
placeholder text in form fields
42
44
toggle background
@@ -45,78 +47,86 @@ Checkbox border color (Hover state)
45
47
Radio button border color (Hover state)
46
48
Grey status pill text color
47
49
inactive 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)
49
52
Checkbox border color (Regular/Inactive state)
50
53
Radio 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
52
56
Divider line color
53
57
Slat border color
54
58
Container box color
55
59
Thumbnail border color
56
60
Payment method border color
57
61
Grey status pill border color
58
62
Slider grey bar background color"""
59
- , colorPanel _.black5 " Black - 6%" """ disabled input field background
63
+ , colorPanel _.black5 " Black - 6%"
64
+ """ disabled input field background
60
65
disabled checkbox background color
61
66
disabled radio button background color
62
67
disabled toggle background color"""
63
- , colorPanel _.black6 " Black - Background gray" """ Nav bar background color
68
+ , colorPanel _.black6 " Black - Background gray"
69
+ """ Nav bar background color
64
70
Image 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
72
79
active states
73
80
links"""
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
78
86
selected 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
+ ]
87
95
}
88
96
]
89
97
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
+ }
112
122
)
113
- }
114
- ]
123
+ }
124
+ ]
115
125
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
+ }
121
131
122
- divider = row { style: css { height: " 2rem " }, children: [] }
132
+ divider = row { style: css { height: " 20px " }, children: [] }
0 commit comments