playbook_ui 10.16.0 → 10.19.0.pre.popover.alpha1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/_playbook.scss +4 -0
- data/app/pb_kits/playbook/pb_background/background.test.js +22 -0
- data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.jsx +3 -0
- data/app/pb_kits/playbook/pb_bar_graph/bar_graph.rb +3 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_colors.html.erb +26 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_colors.jsx +37 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_colors.md +2 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_body/_body.jsx +1 -1
- data/app/pb_kits/playbook/pb_body/_body_mixins.scss +2 -1
- data/app/pb_kits/playbook/pb_body/body.rb +1 -1
- data/app/pb_kits/playbook/pb_body/body.test.js +29 -0
- data/app/pb_kits/playbook/pb_body/docs/_body_light.html.erb +5 -0
- data/app/pb_kits/playbook/pb_body/docs/_body_light.jsx +5 -0
- data/app/pb_kits/playbook/pb_body/docs/_body_light.md +6 -0
- data/app/pb_kits/playbook/pb_button/_button.jsx +3 -3
- data/app/pb_kits/playbook/pb_button/_button.scss +17 -0
- data/app/pb_kits/playbook/pb_button/button.rb +6 -3
- data/app/pb_kits/playbook/pb_button/button.test.js +13 -0
- data/app/pb_kits/playbook/pb_button/docs/_button_size.html.erb +3 -0
- data/app/pb_kits/playbook/pb_button/docs/_button_size.jsx +26 -0
- data/app/pb_kits/playbook/pb_button/docs/_button_size.md +1 -0
- data/app/pb_kits/playbook/pb_button/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_button/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_caption/_caption.jsx +21 -8
- data/app/pb_kits/playbook/pb_caption/_caption.scss +14 -8
- data/app/pb_kits/playbook/pb_caption/_caption_mixin.scss +27 -0
- data/app/pb_kits/playbook/pb_caption/caption.rb +6 -4
- data/app/pb_kits/playbook/pb_caption/caption.test.js +29 -0
- data/app/pb_kits/playbook/pb_caption/docs/_caption_colors.html.erb +3 -0
- data/app/pb_kits/playbook/pb_caption/docs/_caption_colors.jsx +25 -0
- data/app/pb_kits/playbook/pb_caption/docs/_caption_colors.md +6 -0
- data/app/pb_kits/playbook/pb_caption/docs/example.yml +7 -4
- data/app/pb_kits/playbook/pb_caption/docs/index.js +1 -1
- data/app/pb_kits/playbook/pb_card/_card.jsx +1 -3
- data/app/pb_kits/playbook/pb_card/_card.scss +0 -6
- data/app/pb_kits/playbook/pb_card/_card_mixin.scss +1 -8
- data/app/pb_kits/playbook/pb_card/card.html.erb +2 -0
- data/app/pb_kits/playbook/pb_card/card.rb +0 -8
- data/app/pb_kits/playbook/pb_card/docs/_card_background.html.erb +1 -1
- data/app/pb_kits/playbook/pb_card/docs/_card_content.html.erb +3 -1
- data/app/pb_kits/playbook/pb_card/docs/_card_content.jsx +9 -2
- data/app/pb_kits/playbook/pb_circle_chart/circle_chart.rb +4 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors.md +2 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_default_date.md +3 -1
- data/app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.test.js +13 -4
- data/app/pb_kits/playbook/pb_docs/kit_example.rb +4 -0
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb +4 -0
- data/app/pb_kits/playbook/pb_flex/_flex.jsx +4 -0
- data/app/pb_kits/playbook/pb_flex/_flex.scss +17 -1
- data/app/pb_kits/playbook/pb_flex/_flex_item.jsx +6 -2
- data/app/pb_kits/playbook/pb_flex/_flex_item.scss +22 -0
- data/app/pb_kits/playbook/pb_flex/docs/_flex_item.html.erb +12 -1
- data/app/pb_kits/playbook/pb_flex/docs/_flex_item.md +2 -0
- data/app/pb_kits/playbook/pb_flex/docs/_flex_item_align_self.html.erb +89 -0
- data/app/pb_kits/playbook/pb_flex/docs/_flex_item_align_self.jsx +210 -0
- data/app/pb_kits/playbook/pb_flex/docs/_flex_item_align_self.md +5 -0
- data/app/pb_kits/playbook/pb_flex/docs/_flex_item_example.jsx +27 -0
- data/app/pb_kits/playbook/pb_flex/docs/_flex_item_example.md +2 -0
- data/app/pb_kits/playbook/pb_flex/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_flex/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_flex/flex.rb +14 -1
- data/app/pb_kits/playbook/pb_flex/flex_item.rb +16 -1
- data/app/pb_kits/playbook/pb_gauge/_gauge.jsx +3 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_colors.html.erb +12 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_colors.jsx +19 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_colors.md +2 -0
- data/app/pb_kits/playbook/pb_gauge/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_gauge/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_gauge/gauge.rb +2 -0
- data/app/pb_kits/playbook/pb_icon/icon.rb +4 -0
- data/app/pb_kits/playbook/pb_icon_circle/_icon_circle.scss +2 -2
- data/app/pb_kits/playbook/pb_icon_circle/docs/_icon_circle_color.html.erb +1 -1
- data/app/pb_kits/playbook/pb_icon_circle/docs/_icon_circle_color.jsx +1 -1
- data/app/pb_kits/playbook/pb_icon_circle/docs/_icon_circle_color.md +1 -0
- data/app/pb_kits/playbook/pb_icon_circle/icon_circle.rb +1 -1
- data/app/pb_kits/playbook/pb_icon_stat_value/icon_stat_value.rb +2 -0
- data/app/pb_kits/playbook/pb_image/_image.jsx +4 -1
- data/app/pb_kits/playbook/pb_image/_image.scss +24 -8
- data/app/pb_kits/playbook/pb_image/docs/_transition_image.html.erb +54 -0
- data/app/pb_kits/playbook/pb_image/docs/_transition_image.jsx +77 -0
- data/app/pb_kits/playbook/pb_image/docs/_transition_image.md +1 -0
- data/app/pb_kits/playbook/pb_image/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_image/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_image/image.html.erb +1 -1
- data/app/pb_kits/playbook/pb_image/image.rb +8 -1
- data/app/pb_kits/playbook/pb_image/image.test.js +9 -4
- data/app/pb_kits/playbook/pb_line_graph/_line_graph.jsx +4 -1
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_colors.html.erb +26 -0
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_colors.jsx +37 -0
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_colors.md +2 -0
- data/app/pb_kits/playbook/pb_line_graph/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_line_graph/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_line_graph/line_graph.rb +3 -0
- data/app/pb_kits/playbook/pb_list/list.rb +2 -0
- data/app/pb_kits/playbook/pb_nav/_bold_mixin.scss +22 -0
- data/app/pb_kits/playbook/pb_nav/_horizontal_nav.scss +17 -1
- data/app/pb_kits/playbook/pb_nav/_vertical_nav.scss +9 -2
- data/app/pb_kits/playbook/pb_nav/docs/_bold_horizontal_nav.html.erb +6 -0
- data/app/pb_kits/playbook/pb_nav/docs/_bold_horizontal_nav.jsx +39 -0
- data/app/pb_kits/playbook/pb_nav/docs/_bold_vertical_nav.html.erb +6 -0
- data/app/pb_kits/playbook/pb_nav/docs/_bold_vertical_nav.jsx +39 -0
- data/app/pb_kits/playbook/pb_nav/docs/_horizontal_nav.html.erb +1 -1
- data/app/pb_kits/playbook/pb_nav/docs/_subtle_nav.html.erb +1 -1
- data/app/pb_kits/playbook/pb_nav/docs/example.yml +4 -0
- data/app/pb_kits/playbook/pb_nav/docs/index.js +2 -0
- data/app/pb_kits/playbook/pb_nav/nav.rb +1 -1
- data/app/pb_kits/playbook/pb_popover/_popover.jsx +2 -4
- data/app/pb_kits/playbook/pb_popover/docs/_popover_close.html.erb +7 -7
- data/app/pb_kits/playbook/pb_popover/docs/_popover_scroll_height.jsx +3 -0
- data/app/pb_kits/playbook/pb_popover/docs/_popover_z_index.jsx +1 -0
- data/app/pb_kits/playbook/pb_popover/index.js +4 -9
- data/app/pb_kits/playbook/pb_popover/popover.html.erb +1 -1
- data/app/pb_kits/playbook/pb_select/select.rb +3 -0
- data/app/pb_kits/playbook/pb_source/source.rb +3 -0
- data/app/pb_kits/playbook/pb_text_input/_text_input.scss +63 -14
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_error.html.erb +21 -2
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_error.jsx +12 -3
- data/app/pb_kits/playbook/pb_text_input/text_input.rb +2 -0
- data/app/pb_kits/playbook/pb_title/_title.jsx +6 -4
- data/app/pb_kits/playbook/pb_title/_title.scss +5 -5
- data/app/pb_kits/playbook/pb_title/_title_mixin.scss +17 -0
- data/app/pb_kits/playbook/pb_title/docs/_title_colors.html.erb +4 -0
- data/app/pb_kits/playbook/pb_title/docs/_title_colors.jsx +37 -0
- data/app/pb_kits/playbook/pb_title/docs/_title_colors.md +6 -0
- data/app/pb_kits/playbook/pb_title/docs/_title_light.html.erb +4 -1
- data/app/pb_kits/playbook/pb_title/docs/_title_light.md +3 -0
- data/app/pb_kits/playbook/pb_title/docs/example.yml +2 -2
- data/app/pb_kits/playbook/pb_title/docs/index.js +1 -1
- data/app/pb_kits/playbook/pb_title/title.html.erb +4 -2
- data/app/pb_kits/playbook/pb_title/title.rb +5 -4
- data/app/pb_kits/playbook/pb_title/title.test.js +29 -0
- data/app/pb_kits/playbook/plugins/pb_chart.js +16 -24
- data/app/pb_kits/playbook/tokens/_colors.scss +3 -1
- data/app/pb_kits/playbook/utilities/_cursor.scss +3 -0
- data/app/pb_kits/playbook/utilities/_display.scss +23 -0
- data/app/pb_kits/playbook/utilities/_line_height.scss +11 -0
- data/app/pb_kits/playbook/utilities/_shadow.scss +11 -0
- data/app/pb_kits/playbook/utilities/globalProps.js +25 -1
- data/lib/playbook/classnames.rb +4 -0
- data/lib/playbook/cursor.rb +29 -0
- data/lib/playbook/display.rb +29 -0
- data/lib/playbook/engine.rb +0 -1
- data/lib/playbook/kit_base.rb +8 -0
- data/lib/playbook/line_height.rb +29 -0
- data/lib/playbook/markdown/helper.rb +2 -2
- data/lib/playbook/pb_doc_helper.rb +4 -0
- data/lib/playbook/props/base.rb +2 -2
- data/lib/playbook/shadow.rb +29 -0
- data/lib/playbook/version.rb +2 -2
- data/lib/playbook.rb +3 -0
- metadata +62 -23
- data/app/pb_kits/playbook/pb_caption/docs/_caption_variants.html.erb +0 -1
- data/app/pb_kits/playbook/pb_caption/docs/_caption_variants.jsx +0 -17
- data/app/pb_kits/playbook/pb_caption/docs/_caption_variants.md +0 -3
- data/app/pb_kits/playbook/pb_title/docs/_title_variants.html.erb +0 -1
- data/app/pb_kits/playbook/pb_title/docs/_title_variants.jsx +0 -19
- data/app/pb_kits/playbook/pb_title/docs/_title_variants.md +0 -3
@@ -0,0 +1,210 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import { Flex, FlexItem, Title } from '../..'
|
3
|
+
|
4
|
+
const FlexItemAlignSelf = (props) => {
|
5
|
+
return (
|
6
|
+
<>
|
7
|
+
<Title
|
8
|
+
size={4}
|
9
|
+
text="Row"
|
10
|
+
{...props}
|
11
|
+
/>
|
12
|
+
|
13
|
+
<br />
|
14
|
+
|
15
|
+
<div className="flex-doc-example ">
|
16
|
+
<Flex
|
17
|
+
{...props}
|
18
|
+
>
|
19
|
+
<FlexItem alignSelf="start">
|
20
|
+
{'1'}
|
21
|
+
</FlexItem>
|
22
|
+
<FlexItem padding="md">
|
23
|
+
{'2'}
|
24
|
+
</FlexItem>
|
25
|
+
<FlexItem padding="md">
|
26
|
+
{'3'}
|
27
|
+
</FlexItem>
|
28
|
+
<FlexItem padding="md">
|
29
|
+
{'4'}
|
30
|
+
</FlexItem>
|
31
|
+
</Flex>
|
32
|
+
</div>
|
33
|
+
|
34
|
+
<br />
|
35
|
+
|
36
|
+
<div className="flex-doc-example ">
|
37
|
+
<Flex
|
38
|
+
{...props}
|
39
|
+
>
|
40
|
+
<FlexItem alignSelf="end">
|
41
|
+
{'1'}
|
42
|
+
</FlexItem>
|
43
|
+
<FlexItem padding="md">
|
44
|
+
{'2'}
|
45
|
+
</FlexItem>
|
46
|
+
<FlexItem padding="md">
|
47
|
+
{'3'}
|
48
|
+
</FlexItem>
|
49
|
+
<FlexItem padding="md">
|
50
|
+
{'4'}
|
51
|
+
</FlexItem>
|
52
|
+
</Flex>
|
53
|
+
</div>
|
54
|
+
|
55
|
+
<br />
|
56
|
+
|
57
|
+
<div className="flex-doc-example ">
|
58
|
+
<Flex
|
59
|
+
{...props}
|
60
|
+
>
|
61
|
+
<FlexItem alignSelf="center">
|
62
|
+
{'1'}
|
63
|
+
</FlexItem>
|
64
|
+
<FlexItem padding="md">
|
65
|
+
{'2'}
|
66
|
+
</FlexItem>
|
67
|
+
<FlexItem padding="md">
|
68
|
+
{'3'}
|
69
|
+
</FlexItem>
|
70
|
+
<FlexItem padding="md">
|
71
|
+
{'4'}
|
72
|
+
</FlexItem>
|
73
|
+
</Flex>
|
74
|
+
</div>
|
75
|
+
|
76
|
+
<br />
|
77
|
+
|
78
|
+
<div className="flex-doc-example ">
|
79
|
+
<Flex
|
80
|
+
{...props}
|
81
|
+
>
|
82
|
+
<FlexItem alignSelf="stretch">
|
83
|
+
{'1'}
|
84
|
+
</FlexItem>
|
85
|
+
<FlexItem padding="md">
|
86
|
+
{'2'}
|
87
|
+
</FlexItem>
|
88
|
+
<FlexItem padding="md">
|
89
|
+
{'3'}
|
90
|
+
</FlexItem>
|
91
|
+
<FlexItem padding="md">
|
92
|
+
{'4'}
|
93
|
+
</FlexItem>
|
94
|
+
</Flex>
|
95
|
+
</div>
|
96
|
+
|
97
|
+
<br />
|
98
|
+
<br />
|
99
|
+
|
100
|
+
<Title
|
101
|
+
size={4}
|
102
|
+
text="Column"
|
103
|
+
{...props}
|
104
|
+
/>
|
105
|
+
|
106
|
+
<br />
|
107
|
+
|
108
|
+
<div className="flex-doc-example ">
|
109
|
+
<Flex
|
110
|
+
orientation="column"
|
111
|
+
{...props}
|
112
|
+
>
|
113
|
+
<FlexItem
|
114
|
+
alignSelf="start"
|
115
|
+
padding="sm"
|
116
|
+
>
|
117
|
+
{'1'}
|
118
|
+
</FlexItem>
|
119
|
+
<FlexItem padding="sm">
|
120
|
+
{'2'}
|
121
|
+
</FlexItem>
|
122
|
+
<FlexItem padding="sm">
|
123
|
+
{'3'}
|
124
|
+
</FlexItem>
|
125
|
+
<FlexItem padding="sm">
|
126
|
+
{'4'}
|
127
|
+
</FlexItem>
|
128
|
+
</Flex>
|
129
|
+
</div>
|
130
|
+
|
131
|
+
<br />
|
132
|
+
|
133
|
+
<div className="flex-doc-example ">
|
134
|
+
<Flex
|
135
|
+
orientation="column"
|
136
|
+
{...props}
|
137
|
+
>
|
138
|
+
<FlexItem
|
139
|
+
alignSelf="end"
|
140
|
+
padding="sm"
|
141
|
+
>
|
142
|
+
{'1'}
|
143
|
+
</FlexItem>
|
144
|
+
<FlexItem padding="sm">
|
145
|
+
{'2'}
|
146
|
+
</FlexItem>
|
147
|
+
<FlexItem padding="sm">
|
148
|
+
{'3'}
|
149
|
+
</FlexItem>
|
150
|
+
<FlexItem padding="sm">
|
151
|
+
{'4'}
|
152
|
+
</FlexItem>
|
153
|
+
</Flex>
|
154
|
+
</div>
|
155
|
+
|
156
|
+
<br />
|
157
|
+
|
158
|
+
<div className="flex-doc-example ">
|
159
|
+
<Flex
|
160
|
+
orientation="column"
|
161
|
+
{...props}
|
162
|
+
>
|
163
|
+
<FlexItem
|
164
|
+
alignSelf="center"
|
165
|
+
padding="sm"
|
166
|
+
>
|
167
|
+
{'1'}
|
168
|
+
</FlexItem>
|
169
|
+
<FlexItem padding="sm">
|
170
|
+
{'2'}
|
171
|
+
</FlexItem>
|
172
|
+
<FlexItem padding="sm">
|
173
|
+
{'3'}
|
174
|
+
</FlexItem>
|
175
|
+
<FlexItem padding="sm">
|
176
|
+
{'4'}
|
177
|
+
</FlexItem>
|
178
|
+
</Flex>
|
179
|
+
</div>
|
180
|
+
|
181
|
+
<br />
|
182
|
+
|
183
|
+
<div className="flex-doc-example ">
|
184
|
+
<Flex
|
185
|
+
orientation="column"
|
186
|
+
{...props}
|
187
|
+
>
|
188
|
+
<FlexItem
|
189
|
+
alignSelf="stretch"
|
190
|
+
padding="sm"
|
191
|
+
>
|
192
|
+
{'1'}
|
193
|
+
</FlexItem>
|
194
|
+
<FlexItem padding="sm">
|
195
|
+
{'2'}
|
196
|
+
</FlexItem>
|
197
|
+
<FlexItem padding="sm">
|
198
|
+
{'3'}
|
199
|
+
</FlexItem>
|
200
|
+
<FlexItem padding="sm">
|
201
|
+
{'4'}
|
202
|
+
</FlexItem>
|
203
|
+
</Flex>
|
204
|
+
</div>
|
205
|
+
|
206
|
+
</>
|
207
|
+
)
|
208
|
+
}
|
209
|
+
|
210
|
+
export default FlexItemAlignSelf
|
@@ -4,6 +4,33 @@ import { Flex, FlexItem, Title } from '../..'
|
|
4
4
|
const FlexItemExample = (props) => {
|
5
5
|
return (
|
6
6
|
<>
|
7
|
+
<Title
|
8
|
+
size={4}
|
9
|
+
text="Display Flex"
|
10
|
+
/>
|
11
|
+
<br />
|
12
|
+
<div className="flex-doc-example">
|
13
|
+
<FlexItem
|
14
|
+
displayFlex
|
15
|
+
gap="xs"
|
16
|
+
{...props}
|
17
|
+
>
|
18
|
+
<FlexItem>
|
19
|
+
{'We'}
|
20
|
+
</FlexItem>
|
21
|
+
<FlexItem>
|
22
|
+
{'Are'}
|
23
|
+
</FlexItem>
|
24
|
+
<FlexItem>
|
25
|
+
{'Being'}
|
26
|
+
</FlexItem>
|
27
|
+
<FlexItem>
|
28
|
+
{'Flexed'}
|
29
|
+
</FlexItem>
|
30
|
+
</FlexItem>
|
31
|
+
</div>
|
32
|
+
|
33
|
+
<br />
|
7
34
|
<Title
|
8
35
|
size={4}
|
9
36
|
text="Grow"
|
@@ -1,5 +1,6 @@
|
|
1
1
|
##### Props
|
2
2
|
|
3
|
+
* `display_flex` | **Type**: Boolean
|
3
4
|
* `flex` | **Type**: String | **Values**: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
|
4
5
|
* `fixed_size` | **Type**: String | **Values**: Any CSS px or % value
|
5
6
|
* `grow` | **Type**: Boolean
|
@@ -10,3 +11,4 @@
|
|
10
11
|
- Setting Flex to 1 is equal to setting the grow & shrink prop to true
|
11
12
|
- Setting Flex to 0 is equal to setting the grow & shrink prop to false
|
12
13
|
- If grow & shrink are true, grow will take precedence an the flex item will take up as much space as possible, then if other elements are added shrink would allow other items to squish inside the flex container
|
14
|
+
- display_flex will either be true or false. If true, then the class will be applied to the kit
|
@@ -10,6 +10,7 @@ examples:
|
|
10
10
|
- flex_align: Align
|
11
11
|
- flex_gap: Gap
|
12
12
|
- flex_item: Flex Item
|
13
|
+
- flex_item_align_self: Flex Item - Align Self
|
13
14
|
|
14
15
|
|
15
16
|
|
@@ -24,3 +25,4 @@ examples:
|
|
24
25
|
- flex_align: Align
|
25
26
|
- flex_gap: Gap
|
26
27
|
- flex_item_example: Flex Item
|
28
|
+
- flex_item_align_self: Flex Item - Align Self
|
@@ -7,3 +7,4 @@ export { default as FlexJustify } from './_flex_justify.jsx'
|
|
7
7
|
export { default as FlexAlign } from './_flex_align.jsx'
|
8
8
|
export { default as FlexGap } from './_flex_gap.jsx'
|
9
9
|
export { default as FlexItemExample } from './_flex_item_example.jsx'
|
10
|
+
export { default as FlexItemAlignSelf } from './_flex_item_align_self.jsx'
|
@@ -48,6 +48,10 @@ module Playbook
|
|
48
48
|
values: %w[start center end stretch baseline none],
|
49
49
|
default: "none"
|
50
50
|
|
51
|
+
prop :align_self, type: Playbook::Props::Enum,
|
52
|
+
values: %w[start end center stretch none],
|
53
|
+
default: "none"
|
54
|
+
|
51
55
|
prop :wrap, type: Playbook::Props::Boolean,
|
52
56
|
default: false
|
53
57
|
|
@@ -62,7 +66,8 @@ module Playbook
|
|
62
66
|
spacing_class,
|
63
67
|
gap_class,
|
64
68
|
row_gap_class,
|
65
|
-
column_gap_class
|
69
|
+
column_gap_class,
|
70
|
+
align_self_class)
|
66
71
|
end
|
67
72
|
|
68
73
|
private
|
@@ -115,6 +120,14 @@ module Playbook
|
|
115
120
|
end
|
116
121
|
end
|
117
122
|
|
123
|
+
def align_self_class
|
124
|
+
if align_self == "none"
|
125
|
+
nil
|
126
|
+
else
|
127
|
+
"align_self_#{align_self}"
|
128
|
+
end
|
129
|
+
end
|
130
|
+
|
118
131
|
def wrap_class
|
119
132
|
wrap ? "wrap" : nil
|
120
133
|
end
|
@@ -19,8 +19,15 @@ module Playbook
|
|
19
19
|
values: %w[1 2 3 4 5 6 7 8 9 10 11 12 first none],
|
20
20
|
default: "none"
|
21
21
|
|
22
|
+
prop :align_self, type: Playbook::Props::Enum,
|
23
|
+
values: %w[start center end stretch] + [nil],
|
24
|
+
default: nil
|
25
|
+
|
26
|
+
prop :display_flex, type: Playbook::Props::Boolean,
|
27
|
+
default: false
|
28
|
+
|
22
29
|
def classname
|
23
|
-
generate_classname("pb_flex_item_kit", fixed_size_class, grow_class, shrink_class, flex_class) + overflow_class + order_class
|
30
|
+
generate_classname("pb_flex_item_kit", fixed_size_class, grow_class, shrink_class, flex_class, display_flex_class) + overflow_class + order_class + align_self_class
|
24
31
|
end
|
25
32
|
|
26
33
|
def style_value
|
@@ -29,6 +36,14 @@ module Playbook
|
|
29
36
|
|
30
37
|
private
|
31
38
|
|
39
|
+
def align_self_class
|
40
|
+
align_self ? "align_self_#{align_self}" : ""
|
41
|
+
end
|
42
|
+
|
43
|
+
def display_flex_class
|
44
|
+
display_flex ? "display_flex" : nil
|
45
|
+
end
|
46
|
+
|
32
47
|
def fixed_size_class
|
33
48
|
fixed_size.present? ? "fixed_size" : nil
|
34
49
|
end
|
@@ -25,6 +25,7 @@ type GaugeProps = {
|
|
25
25
|
suffix: string,
|
26
26
|
title: string,
|
27
27
|
tooltipHtml: string,
|
28
|
+
colors: array,
|
28
29
|
}
|
29
30
|
|
30
31
|
const Gauge = (props: GaugeProps) => {
|
@@ -45,6 +46,7 @@ const Gauge = (props: GaugeProps) => {
|
|
45
46
|
suffix = '',
|
46
47
|
title = '',
|
47
48
|
tooltipHtml = '<span style="font-weight: bold; color:{point.color};">●</span>{point.name}: ' + '<b>{point.y}</b>',
|
49
|
+
colors = [],
|
48
50
|
} = props
|
49
51
|
|
50
52
|
const ariaProps = buildAriaProps(aria)
|
@@ -76,6 +78,7 @@ const Gauge = (props: GaugeProps) => {
|
|
76
78
|
style: style,
|
77
79
|
tooltipHtml: tooltipHtml,
|
78
80
|
type: 'gauge',
|
81
|
+
colors: colors,
|
79
82
|
})
|
80
83
|
}, [])
|
81
84
|
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import { Gauge } from '../../'
|
3
|
+
|
4
|
+
const data = [
|
5
|
+
{ name: 'Name', value: 67 },
|
6
|
+
]
|
7
|
+
|
8
|
+
const GaugeColors = (props) => (
|
9
|
+
<div>
|
10
|
+
<Gauge
|
11
|
+
chartData={data}
|
12
|
+
id="gauge-colors"
|
13
|
+
{...props}
|
14
|
+
colors={['data-7']}
|
15
|
+
/>
|
16
|
+
</div>
|
17
|
+
)
|
18
|
+
|
19
|
+
export default GaugeColors
|
@@ -9,6 +9,7 @@ examples:
|
|
9
9
|
- gauge_min_max: Min Max Labels
|
10
10
|
- gauge_sizing: Sizing
|
11
11
|
- gauge_height: Height
|
12
|
+
- gauge_colors: Color Overrides
|
12
13
|
|
13
14
|
|
14
15
|
react:
|
@@ -21,3 +22,4 @@ examples:
|
|
21
22
|
- gauge_sizing: Sizing
|
22
23
|
- gauge_height: Height
|
23
24
|
- gauge_live_data: Live Data
|
25
|
+
- gauge_colors: Color Overrides
|
@@ -7,3 +7,4 @@ export { default as GaugeSizing } from './_gauge_sizing.jsx'
|
|
7
7
|
export { default as GaugeTitle } from './_gauge_title.jsx'
|
8
8
|
export { default as GaugeUnits } from './_gauge_units.jsx'
|
9
9
|
export { default as GaugeLiveData } from './_gauge_live_data.jsx'
|
10
|
+
export { default as GaugeColors } from './_gauge_colors.jsx'
|
@@ -20,6 +20,7 @@ module Playbook
|
|
20
20
|
prop :disable_animation, type: Playbook::Props::Boolean, default: false
|
21
21
|
prop :min, type: Playbook::Props::Numeric, default: 0
|
22
22
|
prop :max, type: Playbook::Props::Numeric, default: 100
|
23
|
+
prop :colors, type: Playbook::Props::Array, default: []
|
23
24
|
|
24
25
|
def chart_data_formatted
|
25
26
|
chart_data.map { |hash| hash[:y] = hash.delete :value }
|
@@ -42,6 +43,7 @@ module Playbook
|
|
42
43
|
style: style,
|
43
44
|
tooltipHtml: tooltip_html,
|
44
45
|
type: "gauge",
|
46
|
+
colors: colors,
|
45
47
|
}.to_json.html_safe
|
46
48
|
end
|
47
49
|
|
@@ -1,5 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
# rubocop:disable Style/StringConcatenation, Style/HashLikeCase
|
4
|
+
|
3
5
|
require "open-uri"
|
4
6
|
|
5
7
|
module Playbook
|
@@ -135,3 +137,5 @@ module Playbook
|
|
135
137
|
end
|
136
138
|
end
|
137
139
|
end
|
140
|
+
|
141
|
+
# rubocop:enable Style/StringConcatenation, Style/HashLikeCase
|
@@ -52,9 +52,9 @@ $pb_icon_circle_sizes: (
|
|
52
52
|
@each $color_name, $color_value in $colors {
|
53
53
|
&[class*=_#{$color_name}] {
|
54
54
|
color: $color_value;
|
55
|
-
background: rgba(mix($bg_dark, $color_value, 10%), $
|
55
|
+
background: rgba(mix($bg_dark, $color_value, 10%), $opacity_1);
|
56
56
|
&.dark {
|
57
|
-
background: rgba(mix($bg_dark, $color_value, 10%), $
|
57
|
+
background: rgba(mix($bg_dark, $color_value, 10%), $opacity_2);
|
58
58
|
}
|
59
59
|
}
|
60
60
|
}
|
@@ -0,0 +1 @@
|
|
1
|
+
Customize your icon circle by passing one of our seven base colors to the `variant` prop: `royal` `blue` `orange` `purple` `teal` `red` `yellow` `green`
|
@@ -8,7 +8,7 @@ module Playbook
|
|
8
8
|
values: %w[xs sm md base lg xl],
|
9
9
|
default: "md"
|
10
10
|
prop :variant, type: Playbook::Props::Enum,
|
11
|
-
values: %w[default royal blue purple teal red yellow green],
|
11
|
+
values: %w[default royal blue orange purple teal red yellow green],
|
12
12
|
default: "default"
|
13
13
|
|
14
14
|
def classname
|
@@ -14,6 +14,7 @@ type ImageProps = {
|
|
14
14
|
onError?: () => {},
|
15
15
|
size: "xs" | "sm" | "md" | "lg" | "xl",
|
16
16
|
rounded?: boolean,
|
17
|
+
transition: "blur" | "fade" | "scale",
|
17
18
|
url: string,
|
18
19
|
}
|
19
20
|
|
@@ -27,6 +28,7 @@ const Image = (props: ImageProps) => {
|
|
27
28
|
onError = null,
|
28
29
|
rounded = false,
|
29
30
|
size = '',
|
31
|
+
transition = 'fade',
|
30
32
|
url = '',
|
31
33
|
} = props
|
32
34
|
|
@@ -34,7 +36,7 @@ const Image = (props: ImageProps) => {
|
|
34
36
|
const classes = classnames(
|
35
37
|
buildCss('pb_image_kit', size),
|
36
38
|
'lazyload',
|
37
|
-
|
39
|
+
transition,
|
38
40
|
{ rounded },
|
39
41
|
globalProps(props),
|
40
42
|
className
|
@@ -53,6 +55,7 @@ const Image = (props: ImageProps) => {
|
|
53
55
|
onError={onError}
|
54
56
|
rounded={+rounded}
|
55
57
|
src={url}
|
58
|
+
transition={transition}
|
56
59
|
/>
|
57
60
|
</div>
|
58
61
|
)
|
@@ -28,15 +28,31 @@ $image-sizes: (
|
|
28
28
|
border-radius: $border-rad-heaviest;
|
29
29
|
}
|
30
30
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
31
|
+
&.fade {
|
32
|
+
opacity: 0;
|
33
|
+
&.lazyloaded {
|
34
|
+
opacity: 1;
|
35
|
+
transition: opacity 300ms ease-in;
|
36
|
+
}
|
35
37
|
}
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
38
|
+
|
39
|
+
&.blur {
|
40
|
+
filter: blur(5px);
|
41
|
+
&.lazyloaded {
|
42
|
+
-webkit-filter: blur(0);
|
43
|
+
filter: blur(0);
|
44
|
+
transition: filter 300ms ease-in;
|
45
|
+
}
|
46
|
+
}
|
47
|
+
|
48
|
+
&.scale {
|
49
|
+
opacity: 0;
|
50
|
+
transform: scale(0.9);
|
51
|
+
&.lazyloaded {
|
52
|
+
opacity: 1;
|
53
|
+
transform: scale(1);
|
54
|
+
transition: 700ms ease-in;
|
55
|
+
}
|
40
56
|
}
|
41
57
|
}
|
42
58
|
}
|
@@ -0,0 +1,54 @@
|
|
1
|
+
<%= pb_rails("flex") do %>
|
2
|
+
<%= pb_rails("flex/flex_item", props: {fixed_size: "250px"}) do %>
|
3
|
+
<%= pb_rails("select", props: {
|
4
|
+
id: "transition-dropdown",
|
5
|
+
label: "",
|
6
|
+
blank_selection: "Select a Transition...",
|
7
|
+
options: [
|
8
|
+
{
|
9
|
+
value: 'fade',
|
10
|
+
},
|
11
|
+
{
|
12
|
+
value: 'blur',
|
13
|
+
},
|
14
|
+
{
|
15
|
+
value: 'scale',
|
16
|
+
},
|
17
|
+
]
|
18
|
+
}) %>
|
19
|
+
<% end %>
|
20
|
+
<%= pb_rails("flex/flex_item") do %>
|
21
|
+
<%= pb_rails("button", props: {classname: "button", text: "Load Image", margin_left: "sm", margin_top: "xs", disabled: true }) %>
|
22
|
+
<% end %>
|
23
|
+
<% end %>
|
24
|
+
<%= pb_rails("image", props: { classname: "transition-image", alt: "picture of a misty forest", url: "", on_error: "this.style.display = 'none'" }) %>
|
25
|
+
|
26
|
+
<script>
|
27
|
+
window.addEventListener('DOMContentLoaded', () => {
|
28
|
+
const button = document.querySelector(".button")
|
29
|
+
const transitionDropdown = document.querySelector("#transition-dropdown")
|
30
|
+
var option = ''
|
31
|
+
|
32
|
+
transitionDropdown.addEventListener('change', function() {
|
33
|
+
if (this.value === '') {
|
34
|
+
button.className = button.className + ' _disabled'
|
35
|
+
} else {
|
36
|
+
button.removeAttribute("disabled");
|
37
|
+
button.className = button.className.replace(/\_disabled/gi, '')
|
38
|
+
option = this.value
|
39
|
+
}
|
40
|
+
});
|
41
|
+
|
42
|
+
const updateTransition = (transition) => {
|
43
|
+
const imageTransition = document.querySelector('.transition-image')
|
44
|
+
imageTransition.removeAttribute("style")
|
45
|
+
imageTransition.classList.remove("fade", "blur", "scale", "lazyloaded")
|
46
|
+
imageTransition.classList.add(transition, "lazyload")
|
47
|
+
imageTransition.src = "https://unsplash.it/500/400/?image=634"
|
48
|
+
}
|
49
|
+
|
50
|
+
button.addEventListener('click', function() {
|
51
|
+
updateTransition(option)
|
52
|
+
})
|
53
|
+
});
|
54
|
+
</script>
|