playbook_ui 14.8.0.pre.alpha.PLAY1615movenegativetoleftofcurrencysign4543 → 14.8.0.pre.alpha.PLAY1649rolloutheightglobalprops4635
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 +1 -0
- data/app/pb_kits/playbook/pb_background/_background.tsx +8 -2
- data/app/pb_kits/playbook/pb_checkbox/checkbox.html.erb +2 -2
- data/app/pb_kits/playbook/pb_checkbox/checkbox.rb +0 -4
- data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_indeterminate.html.erb +84 -7
- data/app/pb_kits/playbook/pb_collapsible/_collapsible.tsx +3 -1
- data/app/pb_kits/playbook/pb_currency/_currency.tsx +3 -7
- data/app/pb_kits/playbook/pb_currency/currency.html.erb +2 -2
- data/app/pb_kits/playbook/pb_currency/currency.rb +1 -17
- data/app/pb_kits/playbook/pb_drawer/_drawer.tsx +4 -1
- data/app/pb_kits/playbook/pb_dropdown/_dropdown.scss +1 -0
- data/app/pb_kits/playbook/pb_dropdown/dropdown_container.html.erb +0 -1
- data/app/pb_kits/playbook/pb_dropdown/dropdown_container.rb +0 -4
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with.html.erb +2 -2
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with_loading.html.erb +1 -1
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with_validate.html.erb +63 -12
- data/app/pb_kits/playbook/pb_image/_image.tsx +3 -1
- data/app/pb_kits/playbook/pb_layout/_layout.tsx +6 -3
- data/app/pb_kits/playbook/pb_overlay/_overlay.tsx +3 -1
- data/app/pb_kits/playbook/pb_section_separator/_section_separator.tsx +3 -1
- data/app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_default.html.erb +2 -1
- data/app/pb_kits/playbook/pb_table/_table.tsx +3 -1
- data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_children.html.erb +47 -0
- data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_children.jsx +59 -0
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.scss +3 -0
- data/app/pb_kits/playbook/pb_typeahead/index.ts +29 -3
- data/app/pb_kits/playbook/pb_typeahead/typeahead.html.erb +5 -2
- data/app/pb_kits/playbook/pb_typeahead/typeahead.rb +4 -0
- data/app/pb_kits/playbook/tokens/_height.scss +19 -0
- data/app/pb_kits/playbook/tokens/exports/_height.module.scss +37 -0
- data/app/pb_kits/playbook/utilities/_height.scss +33 -0
- data/app/pb_kits/playbook/utilities/_max_width.scss +4 -0
- data/app/pb_kits/playbook/utilities/_min_width.scss +1 -1
- data/app/pb_kits/playbook/utilities/globalPropNames.mjs +0 -1
- data/app/pb_kits/playbook/utilities/globalProps.ts +24 -0
- data/dist/chunks/{_typeahead-D0PihN_3.js → _typeahead-PpBCdLHD.js} +3 -3
- data/dist/chunks/_weekday_stacked-fqRjy8nx.js +45 -0
- data/dist/chunks/{lib-BC6ESsxG.js → lib-SyD3buPZ.js} +1 -1
- data/dist/chunks/{pb_form_validation-B_Z9rEbg.js → pb_form_validation-Dt8UJgrJ.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- data/dist/menu.yml +321 -0
- data/dist/playbook-doc.js +1 -1
- data/dist/playbook-rails-react-bindings.js +1 -1
- data/dist/playbook-rails.js +1 -1
- data/dist/playbook.css +1 -1
- data/lib/playbook/classnames.rb +3 -0
- data/lib/playbook/forms/builder/typeahead_field.rb +13 -0
- data/lib/playbook/height.rb +29 -0
- data/lib/playbook/kit_base.rb +16 -1
- data/lib/playbook/max_height.rb +29 -0
- data/lib/playbook/min_height.rb +29 -0
- data/lib/playbook/version.rb +1 -1
- metadata +12 -6
- data/dist/chunks/_weekday_stacked-CVx1CzK-.js +0 -45
@@ -62,6 +62,65 @@ const TimelineWithChildren = (props) => (
|
|
62
62
|
</Timeline.Detail>
|
63
63
|
</Timeline.Item>
|
64
64
|
</Timeline>
|
65
|
+
|
66
|
+
<br />
|
67
|
+
<br />
|
68
|
+
<br />
|
69
|
+
|
70
|
+
<Timeline orientation="vertical"
|
71
|
+
showDate
|
72
|
+
{...props}
|
73
|
+
>
|
74
|
+
<Timeline.Item lineStyle="solid"
|
75
|
+
{...props}
|
76
|
+
>
|
77
|
+
<Timeline.Label>
|
78
|
+
<Title size={4}
|
79
|
+
text='Any Kit'
|
80
|
+
/>
|
81
|
+
</Timeline.Label>
|
82
|
+
<Timeline.Step icon="user"
|
83
|
+
iconColor="royal"
|
84
|
+
/>
|
85
|
+
<Timeline.Detail>
|
86
|
+
<TitleDetail detail="37-27 74th Street"
|
87
|
+
title="Jackson Heights"
|
88
|
+
{...props}
|
89
|
+
/>
|
90
|
+
</Timeline.Detail>
|
91
|
+
</Timeline.Item>
|
92
|
+
|
93
|
+
<Timeline.Item lineStyle="dotted"
|
94
|
+
{...props}
|
95
|
+
>
|
96
|
+
<Timeline.Label date={new Date(new Date().setDate(new Date().getDate() + 1))} />
|
97
|
+
<Timeline.Step icon="map-marker-alt"
|
98
|
+
iconColor="purple"
|
99
|
+
/>
|
100
|
+
<Timeline.Detail>
|
101
|
+
<TitleDetail detail="72 E St Astoria"
|
102
|
+
title="Society Hill"
|
103
|
+
{...props}
|
104
|
+
/>
|
105
|
+
</Timeline.Detail>
|
106
|
+
</Timeline.Item>
|
107
|
+
|
108
|
+
<Timeline.Item lineStyle="solid"
|
109
|
+
{...props}
|
110
|
+
>
|
111
|
+
<Timeline.Step>
|
112
|
+
<Pill text="3"
|
113
|
+
variant="success"
|
114
|
+
/>
|
115
|
+
</Timeline.Step>
|
116
|
+
<Timeline.Detail>
|
117
|
+
<TitleDetail detail="81 Gate St Brooklyn"
|
118
|
+
title="Greenpoint"
|
119
|
+
{...props}
|
120
|
+
/>
|
121
|
+
</Timeline.Detail>
|
122
|
+
</Timeline.Item>
|
123
|
+
</Timeline>
|
65
124
|
</div>
|
66
125
|
)
|
67
126
|
|
@@ -2,6 +2,7 @@
|
|
2
2
|
@import "../tokens/border_radius";
|
3
3
|
@import "../tokens/spacing";
|
4
4
|
@import "../tokens/shadows";
|
5
|
+
@import "../tokens/positioning";
|
5
6
|
|
6
7
|
[class^=pb_typeahead_kit] {
|
7
8
|
.typeahead-kit-select__option {
|
@@ -99,6 +100,7 @@
|
|
99
100
|
.typeahead-kit-select__menu {
|
100
101
|
background-color: $bg_dark;
|
101
102
|
color: $white;
|
103
|
+
z-index: $z_1;
|
102
104
|
}
|
103
105
|
.typeahead-kit-select__option:hover {
|
104
106
|
background-color: $active_dark;
|
@@ -182,6 +184,7 @@
|
|
182
184
|
}
|
183
185
|
|
184
186
|
.typeahead-kit-select__menu {
|
187
|
+
z-index: $z_1;
|
185
188
|
.typeahead-kit-select__menu-list {
|
186
189
|
padding: 0;
|
187
190
|
}
|
@@ -4,11 +4,12 @@ import { debounce } from 'lodash'
|
|
4
4
|
export default class PbTypeahead extends PbEnhancedElement {
|
5
5
|
_searchInput: HTMLInputElement
|
6
6
|
_resultsElement: HTMLElement
|
7
|
-
_debouncedSearch:
|
7
|
+
_debouncedSearch: () => void
|
8
8
|
_resultsLoadingIndicator: HTMLElement
|
9
9
|
_resultOptionTemplate: HTMLElement
|
10
10
|
_resultsOptionCache: Map<string, Array<DocumentFragment>>
|
11
11
|
_searchContext: string
|
12
|
+
_validSelection: boolean
|
12
13
|
|
13
14
|
static get selector() {
|
14
15
|
return '[data-pb-typeahead-kit]'
|
@@ -86,6 +87,9 @@ export default class PbTypeahead extends PbEnhancedElement {
|
|
86
87
|
const resultOption = (event.target as Element).closest('[data-result-option-item]')
|
87
88
|
if (!resultOption) return
|
88
89
|
|
90
|
+
this._validSelection = true
|
91
|
+
this.removeValidationError()
|
92
|
+
|
89
93
|
this.resultsCacheClear()
|
90
94
|
this.searchInputClear()
|
91
95
|
this.clearResults()
|
@@ -93,6 +97,28 @@ export default class PbTypeahead extends PbEnhancedElement {
|
|
93
97
|
this.element.dispatchEvent(new CustomEvent('pb-typeahead-kit-result-option-selected', { bubbles: true, detail: { selected: resultOption, typeahead: this } }))
|
94
98
|
}
|
95
99
|
|
100
|
+
removeValidationError() {
|
101
|
+
const inputWrapper = this.searchInput.closest('.text_input_wrapper')
|
102
|
+
if (inputWrapper) {
|
103
|
+
const errorMessage = inputWrapper.querySelector('.pb_body_kit_negative') as HTMLElement
|
104
|
+
if (errorMessage) {
|
105
|
+
errorMessage.style.display = 'none'
|
106
|
+
}
|
107
|
+
this.searchInput.classList.remove('error')
|
108
|
+
}
|
109
|
+
}
|
110
|
+
|
111
|
+
showValidationError() {
|
112
|
+
const inputWrapper = this.searchInput.closest('.text_input_wrapper')
|
113
|
+
if (inputWrapper) {
|
114
|
+
const errorMessage = inputWrapper.querySelector('.pb_body_kit_negative') as HTMLElement
|
115
|
+
if (errorMessage) {
|
116
|
+
errorMessage.style.display = 'block'
|
117
|
+
}
|
118
|
+
this.searchInput.classList.add('error')
|
119
|
+
}
|
120
|
+
}
|
121
|
+
|
96
122
|
clearResults() {
|
97
123
|
this.resultsElement.innerHTML = ''
|
98
124
|
}
|
@@ -201,8 +227,8 @@ export default class PbTypeahead extends PbEnhancedElement {
|
|
201
227
|
}
|
202
228
|
|
203
229
|
toggleResultsLoadingIndicator(visible: boolean) {
|
204
|
-
|
230
|
+
let visibilityProperty = '0'
|
205
231
|
if (visible) visibilityProperty = '1'
|
206
232
|
this.resultsLoadingIndicator.style.opacity = visibilityProperty
|
207
233
|
}
|
208
|
-
}
|
234
|
+
}
|
@@ -17,11 +17,14 @@
|
|
17
17
|
<%= pb_rails("text_input", props: {
|
18
18
|
type: "search",
|
19
19
|
input_options: object.input_options,
|
20
|
-
label: object.label,
|
21
20
|
name: object.name,
|
22
21
|
value: object.value,
|
23
22
|
placeholder: object.placeholder,
|
24
23
|
margin_bottom: "none",
|
24
|
+
required: object.required,
|
25
|
+
validation: object.validation,
|
26
|
+
label: object.label,
|
27
|
+
id: object.input_options[:id],
|
25
28
|
}) %>
|
26
29
|
<%= pb_rails("list", props: { ordered: false, borderless: false, xpadding: true, role: "status", aria: { live: "polite" }, data: { pb_typeahead_kit_results: true } }) do %>
|
27
30
|
<% end %>
|
@@ -33,4 +36,4 @@
|
|
33
36
|
<% end %>
|
34
37
|
</template>
|
35
38
|
<% end %>
|
36
|
-
<% end %>
|
39
|
+
<% end %>
|
@@ -40,6 +40,10 @@ module Playbook
|
|
40
40
|
prop :pill_color, type: Playbook::Props::Enum,
|
41
41
|
values: %w[primary neutral success warning error info data_1 data_2 data_3 data_4 data_5 data_6 data_7 data_8 windows siding roofing doors gutters solar insulation accessories],
|
42
42
|
default: "primary"
|
43
|
+
prop :required, type: Playbook::Props::Boolean,
|
44
|
+
default: false
|
45
|
+
prop :validation, type: Playbook::Props::HashProp,
|
46
|
+
default: {}
|
43
47
|
|
44
48
|
def classname
|
45
49
|
default_margin_bottom = margin_bottom.present? ? "" : " mb_sm"
|
@@ -0,0 +1,19 @@
|
|
1
|
+
|
2
|
+
$height_auto: auto !default;
|
3
|
+
$height_xs: 320px !default;
|
4
|
+
$height_sm: 480px !default;
|
5
|
+
$height_md: 768px !default;
|
6
|
+
$height_lg: 1024px !default;
|
7
|
+
$height_xl: 1280px !default;
|
8
|
+
$height_2xl: 1440px !default;
|
9
|
+
$height_3xl: 1920px !default;
|
10
|
+
$heights: (
|
11
|
+
height_auto: $height_auto,
|
12
|
+
height_xs: $height_xs,
|
13
|
+
height_sm: $height_sm,
|
14
|
+
height_md: $height_md,
|
15
|
+
height_lg: $height_lg,
|
16
|
+
height_xl: $height_xl,
|
17
|
+
height_xxl: $height_2xl,
|
18
|
+
height_xxxl: $height_3xl
|
19
|
+
);
|
@@ -0,0 +1,37 @@
|
|
1
|
+
@import "../height";
|
2
|
+
|
3
|
+
:export {
|
4
|
+
@mixin export_height($height_list) {
|
5
|
+
@each $name, $value in $height_list {
|
6
|
+
.#{$name} {
|
7
|
+
height: $value;
|
8
|
+
}
|
9
|
+
}
|
10
|
+
}
|
11
|
+
|
12
|
+
@include export_height($heights);
|
13
|
+
}
|
14
|
+
|
15
|
+
:export {
|
16
|
+
@mixin export_max_height($height_list) {
|
17
|
+
@each $name, $value in $height_list {
|
18
|
+
.max_#{$name} {
|
19
|
+
max-height: $value;
|
20
|
+
}
|
21
|
+
}
|
22
|
+
}
|
23
|
+
|
24
|
+
@include export_max_height($heights);
|
25
|
+
}
|
26
|
+
|
27
|
+
:export {
|
28
|
+
@mixin export_min_height($height_list) {
|
29
|
+
@each $name, $value in $height_list {
|
30
|
+
.min_#{$name} {
|
31
|
+
min-height: $value;
|
32
|
+
}
|
33
|
+
}
|
34
|
+
}
|
35
|
+
|
36
|
+
@include export_min_height($heights);
|
37
|
+
}
|
@@ -0,0 +1,33 @@
|
|
1
|
+
@import "../tokens/exports/height.module";
|
2
|
+
|
3
|
+
@mixin export_height($height_list) {
|
4
|
+
@each $name, $value in $height_list {
|
5
|
+
.#{$name} {
|
6
|
+
height: $value;
|
7
|
+
}
|
8
|
+
}
|
9
|
+
}
|
10
|
+
|
11
|
+
@mixin export_max_height($height_list) {
|
12
|
+
@each $name, $value in $height_list {
|
13
|
+
.max_#{$name} {
|
14
|
+
max-height: $value;
|
15
|
+
}
|
16
|
+
}
|
17
|
+
}
|
18
|
+
|
19
|
+
@mixin export_min_height($height_list) {
|
20
|
+
@each $name, $value in $height_list {
|
21
|
+
.min_#{$name} {
|
22
|
+
min-height: $value;
|
23
|
+
}
|
24
|
+
}
|
25
|
+
}
|
26
|
+
|
27
|
+
@include export_height($heights);
|
28
|
+
@include export_max_height($heights);
|
29
|
+
@include export_min_height($heights);
|
30
|
+
|
31
|
+
.height-resize {
|
32
|
+
resize: vertical;
|
33
|
+
}
|
@@ -361,6 +361,30 @@ const PROP_CATEGORIES: {[key:string]: (props: {[key: string]: any}) => string} =
|
|
361
361
|
css += maxWidth ? `max_width_${filterClassName(maxWidth)} ` : ''
|
362
362
|
return css.trimEnd()
|
363
363
|
},
|
364
|
+
minHeightProps: ({ minHeight }: MinHeight) => {
|
365
|
+
const heightValues = ["auto", "xs", "sm", "md", "lg", "xl", "xxl", "xxxl"]
|
366
|
+
if (heightValues.includes(minHeight)) {
|
367
|
+
let css = ''
|
368
|
+
css += minHeight ? `min_height_${filterClassName(minHeight)} ` : ''
|
369
|
+
return css.trimEnd()
|
370
|
+
}
|
371
|
+
},
|
372
|
+
maxHeightProps: ({ maxHeight }: MaxHeight) => {
|
373
|
+
const heightValues = ["auto", "xs", "sm", "md", "lg", "xl", "xxl", "xxxl"]
|
374
|
+
if (heightValues.includes(maxHeight)) {
|
375
|
+
let css = ''
|
376
|
+
css += maxHeight ? `max_height_${filterClassName(maxHeight)} ` : ''
|
377
|
+
return css.trimEnd()
|
378
|
+
}
|
379
|
+
},
|
380
|
+
heightProps: ({ height }: Height) => {
|
381
|
+
const heightValues = ["auto", "xs", "sm", "md", "lg", "xl", "xxl", "xxxl"]
|
382
|
+
if (heightValues.includes(height)) {
|
383
|
+
let css = ''
|
384
|
+
css += height ? `height_${filterClassName(height)} ` : ''
|
385
|
+
return css.trimEnd()
|
386
|
+
}
|
387
|
+
},
|
364
388
|
zIndexProps: (zIndex: ZIndex) => {
|
365
389
|
let css = ''
|
366
390
|
Object.entries(zIndex).forEach((zIndexEntry) => {
|