playbook_ui 14.10.0.pre.rc.22 → 14.10.0.pre.rc.24
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/pb_card/_card.tsx +7 -7
- data/app/pb_kits/playbook/pb_card/_card_mixin.scss +1 -1
- data/app/pb_kits/playbook/pb_card/docs/_card_header.html.erb +21 -1
- data/app/pb_kits/playbook/pb_card/docs/_card_header.jsx +50 -0
- data/app/pb_kits/playbook/pb_card/docs/_card_header.md +1 -1
- data/app/pb_kits/playbook/pb_form_group/_error_state_mixin.scss +57 -0
- data/app/pb_kits/playbook/pb_form_group/_form_group.scss +11 -2
- data/dist/playbook-doc.js +1 -1
- data/dist/playbook.css +1 -1
- data/lib/playbook/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b26b4329b7f52da4342da5121155d567ba0beb978c9e559237c1fa9fab22ab69
|
4
|
+
data.tar.gz: d72a4c640e78ec6bf8432484d81cf8ff27d77ae5975c150f3f802faa031e70c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1eacdd6d2523334501f35f533c0ccceecae1f4281e889d6c36f09e96f441204ccdb55dcbe8b3675d552358b32d09d055f415f22770da3825fa6b2c50fb9cdd30
|
7
|
+
data.tar.gz: 562146dcf67058f2eb7ef1f97a12b3a5f6efc4db784dfafd1260e5346722fe104633dc38a4edd041ab8d347a5d3e7165f35d8b384b2d469eebc5a9c7f2a8c1da
|
@@ -6,7 +6,7 @@ import classnames from 'classnames'
|
|
6
6
|
|
7
7
|
import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
|
8
8
|
import { GlobalProps, globalProps, globalInlineProps } from '../utilities/globalProps'
|
9
|
-
import type { ProductColors, CategoryColors, BackgroundColors } from '../types/colors'
|
9
|
+
import type { ProductColors, CategoryColors, BackgroundColors, StatusColors } from '../types/colors'
|
10
10
|
|
11
11
|
import Icon from '../pb_icon/_icon'
|
12
12
|
import Flex from '../pb_flex/_flex'
|
@@ -36,7 +36,7 @@ type CardPropTypes = {
|
|
36
36
|
} & GlobalProps
|
37
37
|
|
38
38
|
type CardHeaderProps = {
|
39
|
-
headerColor?: BackgroundColors | ProductColors | CategoryColors | "none",
|
39
|
+
headerColor?: BackgroundColors | ProductColors | CategoryColors | StatusColors | "none",
|
40
40
|
headerColorStriped?: boolean,
|
41
41
|
children: React.ReactChild[] | React.ReactChild,
|
42
42
|
className?: string,
|
@@ -127,12 +127,12 @@ const Card = (props: CardPropTypes): React.ReactElement => {
|
|
127
127
|
|
128
128
|
const tagOptions = ['div', 'section', 'footer', 'header', 'article', 'aside', 'main', 'nav']
|
129
129
|
const Tag = tagOptions.includes(tag) ? tag : 'div'
|
130
|
-
|
130
|
+
|
131
131
|
return (
|
132
132
|
<>
|
133
133
|
{
|
134
134
|
draggableItem ? (
|
135
|
-
<Draggable.Item dragId={dragId}
|
135
|
+
<Draggable.Item dragId={dragId}
|
136
136
|
key={dragId}
|
137
137
|
>
|
138
138
|
<Tag
|
@@ -140,14 +140,14 @@ const Card = (props: CardPropTypes): React.ReactElement => {
|
|
140
140
|
{...dataProps}
|
141
141
|
className={classnames(cardCss, globalProps(props), className)}
|
142
142
|
{...restHtmlProps}
|
143
|
-
style={mergedStyles}
|
143
|
+
style={mergedStyles}
|
144
144
|
>
|
145
145
|
{subComponentTags('Header')}
|
146
146
|
{
|
147
147
|
dragHandle ? (
|
148
148
|
<Flex>
|
149
149
|
<span className="card_draggable_handle">
|
150
|
-
<Icon
|
150
|
+
<Icon
|
151
151
|
icon="grip-dots-vertical"
|
152
152
|
paddingRight="xs"
|
153
153
|
verticalAlign="middle"
|
@@ -169,7 +169,7 @@ const Card = (props: CardPropTypes): React.ReactElement => {
|
|
169
169
|
{...dataProps}
|
170
170
|
className={classnames(cardCss, globalProps(props), className)}
|
171
171
|
{...restHtmlProps}
|
172
|
-
style={mergedStyles}
|
172
|
+
style={mergedStyles}
|
173
173
|
>
|
174
174
|
{subComponentTags('Header')}
|
175
175
|
{nonHeaderChildren}
|
@@ -24,7 +24,7 @@ $additional_colors: (
|
|
24
24
|
"neutral_subtle": $neutral_subtle,
|
25
25
|
);
|
26
26
|
$background_colors: map-merge($product_colors, $additional_colors);
|
27
|
-
$pb_card_header_colors: map-merge(map-merge($product_colors, $additional_colors), $category_colors);
|
27
|
+
$pb_card_header_colors: map-merge(map-merge(map-merge($product_colors, $additional_colors), $category_colors), $status_colors);
|
28
28
|
|
29
29
|
@mixin pb_card_selected($border_color: $primary) {
|
30
30
|
border-color: $border_color;
|
@@ -67,4 +67,24 @@
|
|
67
67
|
<%= pb_rails("card/card_body", props: { padding: "md", }) do %>
|
68
68
|
Body
|
69
69
|
<% end %>
|
70
|
-
<% end %>
|
70
|
+
<% end %>
|
71
|
+
|
72
|
+
<%= pb_rails("title", props: { text: "Status Colors", tag: "h4", size: 4, margin_bottom: "sm" }) %>
|
73
|
+
|
74
|
+
<%= pb_rails("card", props: { padding: "none", header: true, margin_bottom: "sm"}) do %>
|
75
|
+
<%= pb_rails("card/card_header", props: { padding: "sm", header_color: "success" }) do %>
|
76
|
+
<%= pb_rails("body", props: { text: "Success", dark: true }) %>
|
77
|
+
<% end %>
|
78
|
+
<%= pb_rails("card/card_body", props: { padding: "md" }) do %>
|
79
|
+
Body
|
80
|
+
<% end %>
|
81
|
+
<% end %>
|
82
|
+
|
83
|
+
<%= pb_rails("card", props: { padding: "none", header: true, margin_bottom: "sm"}) do %>
|
84
|
+
<%= pb_rails("card/card_header", props: { padding: "sm", header_color: "error" }) do %>
|
85
|
+
<%= pb_rails("body", props: { text: "Error", dark: true }) %>
|
86
|
+
<% end %>
|
87
|
+
<%= pb_rails("card/card_body", props: { padding: "md" }) do %>
|
88
|
+
Body
|
89
|
+
<% end %>
|
90
|
+
<% end %>
|
@@ -181,6 +181,56 @@ const CardHeader = (props) => {
|
|
181
181
|
/>
|
182
182
|
</Card.Body>
|
183
183
|
</Card>
|
184
|
+
|
185
|
+
<Title
|
186
|
+
{...props}
|
187
|
+
marginBottom='sm'
|
188
|
+
size={4}
|
189
|
+
tag="h4"
|
190
|
+
text="Status Colors"
|
191
|
+
/>
|
192
|
+
|
193
|
+
<Card
|
194
|
+
{...props}
|
195
|
+
marginBottom='sm'
|
196
|
+
padding="none"
|
197
|
+
>
|
198
|
+
<Card.Header
|
199
|
+
headerColor="success"
|
200
|
+
>
|
201
|
+
<Body
|
202
|
+
dark
|
203
|
+
text="Success"
|
204
|
+
/>
|
205
|
+
</Card.Header>
|
206
|
+
<Card.Body>
|
207
|
+
<Body
|
208
|
+
{...props}
|
209
|
+
text="Body"
|
210
|
+
/>
|
211
|
+
</Card.Body>
|
212
|
+
</Card>
|
213
|
+
|
214
|
+
<Card
|
215
|
+
{...props}
|
216
|
+
marginBottom='sm'
|
217
|
+
padding="none"
|
218
|
+
>
|
219
|
+
<Card.Header
|
220
|
+
headerColor="error"
|
221
|
+
>
|
222
|
+
<Body
|
223
|
+
dark
|
224
|
+
text="Error"
|
225
|
+
/>
|
226
|
+
</Card.Header>
|
227
|
+
<Card.Body>
|
228
|
+
<Body
|
229
|
+
{...props}
|
230
|
+
text="Body"
|
231
|
+
/>
|
232
|
+
</Card.Body>
|
233
|
+
</Card>
|
184
234
|
</>
|
185
235
|
)
|
186
236
|
}
|
@@ -1 +1 @@
|
|
1
|
-
Card headers pass category, product, and background colors only. List of all category, product, and background colors can be viewed <a href="https://playbook.powerapp.cloud/visual_guidelines/colors" target="_blank">here</a>.
|
1
|
+
Card headers pass category, product, status and background colors only. List of all category, product, status and background colors can be viewed <a href="https://playbook.powerapp.cloud/visual_guidelines/colors" target="_blank">here</a>.
|
@@ -0,0 +1,57 @@
|
|
1
|
+
@mixin error-state-flex-start-selectors {
|
2
|
+
&:has(.pb_text_input_kit.error):has(.pb_text_input_kit),
|
3
|
+
&:has(.pb_text_input_kit):has(.pb_date_picker_kit.error),
|
4
|
+
&:has(.pb_text_input_kit):has(.pb_select_kit_wrapper.error),
|
5
|
+
&:has(.pb_text_input_kit.error):has(.pb_text_input_kit_label):has(.pb_select_kit_wrapper.error) {
|
6
|
+
align-items: flex-start;
|
7
|
+
}
|
8
|
+
}
|
9
|
+
|
10
|
+
@mixin error-state-center-selectors {
|
11
|
+
&:has(.pb_select_kit_label):has(.pb_select_kit_wrapper.error):has(.pb_phone_number_input),
|
12
|
+
&:has(.pb_text_input_kit.error):has(.pb_text_input_kit_label):has([class^=pb_button_kit]) {
|
13
|
+
align-items: center;
|
14
|
+
}
|
15
|
+
}
|
16
|
+
|
17
|
+
@mixin error-state-flex-end-selectors {
|
18
|
+
&:has(.pb_select_kit_label):has(.pb_select_kit_wrapper.error):has(.pb_phone_number_input):has(.pb_text_input_kit.error) {
|
19
|
+
align-items: flex-end;
|
20
|
+
}
|
21
|
+
}
|
22
|
+
|
23
|
+
@mixin error-state-right-side-select-kit {
|
24
|
+
&:has(.pb_text_input_kit:not(.error)):has(.pb_text_input_kit_label):has(.pb_select_kit_wrapper.error),
|
25
|
+
&:has(.pb_text_input_kit.error):has(.pb_text_input_kit_label):has(.pb_select_kit_wrapper) {
|
26
|
+
align-items: flex-start;
|
27
|
+
|
28
|
+
.pb_select_kit_wrapper {
|
29
|
+
padding-top: $space_md;
|
30
|
+
margin-top: 2px;
|
31
|
+
|
32
|
+
.pb_select_kit_caret {
|
33
|
+
padding-top: $space_md;
|
34
|
+
}
|
35
|
+
}
|
36
|
+
|
37
|
+
.pb_select_kit_wrapper.error {
|
38
|
+
padding-top: $space_md;
|
39
|
+
margin-top: 2px;
|
40
|
+
|
41
|
+
.pb_select_kit_caret {
|
42
|
+
padding-top: $space_xl;
|
43
|
+
}
|
44
|
+
}
|
45
|
+
}
|
46
|
+
}
|
47
|
+
|
48
|
+
@mixin error-state-left-side-select-kit {
|
49
|
+
&:has(.pb_select_kit_label):has(.pb_select_kit_wrapper):has(.pb_phone_number_input):has(.pb_text_input_kit.error) {
|
50
|
+
align-items: flex-start;
|
51
|
+
|
52
|
+
.pb_text_input_kit.error {
|
53
|
+
padding-top: $space_md;
|
54
|
+
margin-top: 2px;
|
55
|
+
}
|
56
|
+
}
|
57
|
+
}
|
@@ -1,3 +1,6 @@
|
|
1
|
+
@import "../tokens/spacing";
|
2
|
+
@import "./error_state_mixin";
|
3
|
+
|
1
4
|
[class^=pb_form_group_kit] {
|
2
5
|
display: inline-flex;
|
3
6
|
flex-direction: row;
|
@@ -12,6 +15,12 @@
|
|
12
15
|
}
|
13
16
|
}
|
14
17
|
|
18
|
+
@include error-state-flex-start-selectors;
|
19
|
+
@include error-state-center-selectors;
|
20
|
+
@include error-state-flex-end-selectors;
|
21
|
+
@include error-state-left-side-select-kit;
|
22
|
+
@include error-state-right-side-select-kit;
|
23
|
+
|
15
24
|
& [class^=pb_text_input_kit] .text_input_wrapper,
|
16
25
|
& [class^=pb_date_picker_kit] .input_wrapper,
|
17
26
|
& [class^=pb_select] {
|
@@ -27,7 +36,7 @@
|
|
27
36
|
border-bottom-right-radius: 0;
|
28
37
|
border-top-right-radius: 0;
|
29
38
|
border-right-width: 0;
|
30
|
-
|
39
|
+
|
31
40
|
&:focus {
|
32
41
|
outline: $primary solid 1px;
|
33
42
|
outline-offset: -1px;
|
@@ -150,7 +159,7 @@
|
|
150
159
|
& > [class^=pb_selectable_card_kit] input[type="checkbox"]:not(:checked) ~ label, [class^=pb_selectable_card_kit] input[type="radio"]:not(:checked) ~ label {
|
151
160
|
&:hover {
|
152
161
|
border-right-color: $slate;
|
153
|
-
}
|
162
|
+
}
|
154
163
|
}
|
155
164
|
|
156
165
|
& > [class^=pb_selectable_card_kit]:not(:first-child) label {
|