playbook_ui 16.1.0.pre.alpha.play264213818 → 16.1.0.pre.alpha.play276813969
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_card/docs/_card_light.html.erb +3 -35
- data/app/pb_kits/playbook/pb_dialog/_dialog.scss +8 -6
- data/app/pb_kits/playbook/pb_dropdown/_dropdown.scss +6 -0
- data/app/pb_kits/playbook/pb_dropdown/_dropdown.tsx +83 -13
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_blank_selection_rails.md +3 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_blank_selection_react.md +3 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_clearable.html.erb +52 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_clearable.jsx +72 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_clearable.md +5 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_constrain_height.jsx +33 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_constrain_height_rails.html.erb +20 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_constrain_height_rails.md +8 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_constrain_height_react.md +8 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_label.html.erb +6 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_label.jsx +1 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_label.md +3 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_placeholder.html.erb +9 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_placeholder.jsx +33 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_placeholder.md +3 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +6 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/index.js +4 -1
- data/app/pb_kits/playbook/pb_dropdown/dropdown.html.erb +11 -5
- data/app/pb_kits/playbook/pb_dropdown/dropdown.rb +15 -0
- data/app/pb_kits/playbook/pb_dropdown/dropdown.test.jsx +94 -0
- data/app/pb_kits/playbook/pb_dropdown/dropdown_container.rb +5 -1
- data/app/pb_kits/playbook/pb_dropdown/dropdown_trigger.html.erb +7 -2
- data/app/pb_kits/playbook/pb_dropdown/dropdown_trigger.rb +4 -0
- data/app/pb_kits/playbook/pb_dropdown/index.js +184 -77
- data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownContainer.tsx +3 -0
- data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownTrigger.tsx +18 -1
- data/app/pb_kits/playbook/pb_dropdown/utilities/clickOutsideHelper.tsx +6 -0
- data/app/pb_kits/playbook/pb_filter/Filter/SortMenu.tsx +1 -1
- data/app/pb_kits/playbook/pb_filter/docs/_filter_default.html.erb +2 -2
- data/app/pb_kits/playbook/pb_filter/docs/_filter_default.jsx +16 -9
- data/app/pb_kits/playbook/pb_filter/filter.rb +2 -2
- data/app/pb_kits/playbook/pb_form/docs/_form_with_required_indicator.html.erb +1 -0
- data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_truncated_text.html.erb +5 -5
- data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_truncated_text.jsx +4 -4
- data/app/pb_kits/playbook/pb_form_pill/form_pill.rb +4 -0
- data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.scss +7 -0
- data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +638 -549
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_label.html.erb +3 -3
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_label.jsx +4 -7
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_label.md +3 -0
- data/app/pb_kits/playbook/pb_multi_level_select/multi_level_select.test.jsx +4 -4
- data/app/pb_kits/playbook/pb_passphrase/_passphrase.tsx +20 -5
- data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_meter_settings.jsx +1 -0
- data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_required_indicator.html.erb +7 -0
- data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_required_indicator.jsx +24 -0
- data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_required_indicator.md +3 -0
- data/app/pb_kits/playbook/pb_passphrase/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_passphrase/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_passphrase/passphrase.rb +2 -0
- data/app/pb_kits/playbook/pb_passphrase/passphrase.test.jsx +30 -1
- data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.tsx +3 -0
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_required_indicator.html.erb +5 -0
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_required_indicator.jsx +14 -0
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_required_indicator.md +3 -0
- data/app/pb_kits/playbook/pb_phone_number_input/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_phone_number_input/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_phone_number_input/phone_number_input.rb +3 -0
- data/app/pb_kits/playbook/pb_phone_number_input/phone_number_input.test.js +34 -3
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.test.jsx +24 -1
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +2 -1
- data/app/pb_kits/playbook/pb_typeahead/components/MultiValue.tsx +4 -1
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_truncated_text.html.erb +1 -1
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_truncated_text.jsx +1 -1
- data/app/pb_kits/playbook/pb_typeahead/typeahead.rb +4 -0
- data/dist/chunks/_typeahead-C4YsbA48.js +1 -0
- data/dist/chunks/vendor.js +2 -2
- 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/forms/builder/phone_number_field.rb +9 -0
- data/lib/playbook/truncate.rb +1 -1
- data/lib/playbook/version.rb +1 -1
- metadata +22 -3
- data/dist/chunks/_typeahead-B9a6ZsEP.js +0 -1
|
@@ -25,6 +25,12 @@ export const handleClickOutside =
|
|
|
25
25
|
) {
|
|
26
26
|
shouldClose = false;
|
|
27
27
|
}
|
|
28
|
+
// Target dropdown container to open dropdown
|
|
29
|
+
if (
|
|
30
|
+
targetElement.getAttribute("data-dropdown") === "pb-dropdown-label"
|
|
31
|
+
) {
|
|
32
|
+
shouldClose = false;
|
|
33
|
+
}
|
|
28
34
|
targetElement = targetElement.parentElement as HTMLElement;
|
|
29
35
|
}
|
|
30
36
|
if (
|
|
@@ -21,7 +21,7 @@ const nextValue = (value: SortValue[], name: string): SortValue => {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
const directionIcon = (dir: Direction) => (
|
|
24
|
-
dir == 'asc' ? '
|
|
24
|
+
dir == 'asc' ? 'arrow-up-short-wide' : 'arrow-down-wide-short'
|
|
25
25
|
)
|
|
26
26
|
|
|
27
27
|
const renderOptions = (options: SortOptions, value: SortValue[], handleChange: (arg0: SortValue) => void) => (
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<%=
|
|
2
2
|
pb_rails("filter", props: {
|
|
3
3
|
min_width: "360px",
|
|
4
|
-
id: "1",
|
|
4
|
+
id: "filter-demo-1",
|
|
5
5
|
margin_bottom: "xl",
|
|
6
6
|
filters: [
|
|
7
7
|
{ name: "name", value: "John Wick" },
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
<%=
|
|
45
45
|
pb_rails("filter", props: {
|
|
46
46
|
min_width: "360px",
|
|
47
|
-
id: "
|
|
47
|
+
id: "filter-demo-2",
|
|
48
48
|
sort_menu: [
|
|
49
49
|
{ item: "Popularity", link: "?q[sorts]=managers_popularity+asc", active: true, direction: "desc" },
|
|
50
50
|
{ item: "Mananger's Title", link: "?q[sorts]=managers_title+asc", active: false },
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react'
|
|
1
|
+
import React, { useState } from 'react'
|
|
2
2
|
|
|
3
3
|
import Button from '../../pb_button/_button'
|
|
4
4
|
import Filter from '../../pb_filter/_filter'
|
|
@@ -6,11 +6,18 @@ import Flex from '../../pb_flex/_flex'
|
|
|
6
6
|
import Select from '../../pb_select/_select'
|
|
7
7
|
import TextInput from '../../pb_text_input/_text_input'
|
|
8
8
|
|
|
9
|
-
const SortingChangeCallback = (sortOptions) => {
|
|
10
|
-
alert(JSON.stringify(sortOptions[0]))
|
|
11
|
-
}
|
|
12
|
-
|
|
13
9
|
const FilterDefault = (props) => {
|
|
10
|
+
const [sortValue, setSortValue] = useState([{ name: 'popularity', dir: 'desc' }])
|
|
11
|
+
const [sortValue2, setSortValue2] = useState([{ name: 'popularity', dir: 'desc' }])
|
|
12
|
+
|
|
13
|
+
const handleSortChange = (sortOptions) => {
|
|
14
|
+
setSortValue(sortOptions)
|
|
15
|
+
alert(JSON.stringify(sortOptions[0]))
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const handleSortChange2 = (sortOptions) => {
|
|
19
|
+
setSortValue2(sortOptions)
|
|
20
|
+
}
|
|
14
21
|
const options = [
|
|
15
22
|
{ value: 'USA' },
|
|
16
23
|
{ value: 'Canada' },
|
|
@@ -29,7 +36,7 @@ const FilterDefault = (props) => {
|
|
|
29
36
|
}}
|
|
30
37
|
marginBottom="xl"
|
|
31
38
|
minWidth="375px"
|
|
32
|
-
onSortChange={
|
|
39
|
+
onSortChange={handleSortChange}
|
|
33
40
|
results={1}
|
|
34
41
|
sortOptions={{
|
|
35
42
|
popularity: 'Popularity',
|
|
@@ -38,7 +45,7 @@ const FilterDefault = (props) => {
|
|
|
38
45
|
// eslint-disable-next-line
|
|
39
46
|
manager_name: 'Manager\'s Name',
|
|
40
47
|
}}
|
|
41
|
-
sortValue={
|
|
48
|
+
sortValue={sortValue}
|
|
42
49
|
{...props}
|
|
43
50
|
>
|
|
44
51
|
{({ closePopover }) => (
|
|
@@ -82,7 +89,7 @@ const FilterDefault = (props) => {
|
|
|
82
89
|
<Filter
|
|
83
90
|
double
|
|
84
91
|
minWidth="375px"
|
|
85
|
-
onSortChange={
|
|
92
|
+
onSortChange={handleSortChange2}
|
|
86
93
|
results={0}
|
|
87
94
|
sortOptions={{
|
|
88
95
|
popularity: 'Popularity',
|
|
@@ -91,7 +98,7 @@ const FilterDefault = (props) => {
|
|
|
91
98
|
// eslint-disable-next-line
|
|
92
99
|
manager_name: 'Manager\'s Name',
|
|
93
100
|
}}
|
|
94
|
-
sortValue={
|
|
101
|
+
sortValue={sortValue2}
|
|
95
102
|
{...props}
|
|
96
103
|
>
|
|
97
104
|
{({ closePopover }) => (
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
<%= form.search_field :example_search_field, props: { label: true, required: true, required_indicator: true } %>
|
|
9
9
|
<%= form.password_field :example_password_field, props: { label: true, required: true, required_indicator: true } %>
|
|
10
10
|
<%= form.url_field :example_url_field, props: { label: true, required: true, required_indicator: true } %>
|
|
11
|
+
<%= form.phone_number_field :example_phone_number_field, props: { label: true, required: true, required_indicator: true } %>
|
|
11
12
|
|
|
12
13
|
<%= form.actions do |action| %>
|
|
13
14
|
<%= action.submit %>
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
options: names,
|
|
16
16
|
label: "Truncation Within Typeahead",
|
|
17
17
|
pills: true,
|
|
18
|
-
truncate: 1,
|
|
18
|
+
truncate: "1",
|
|
19
19
|
}) %>
|
|
20
20
|
|
|
21
21
|
<%= pb_rails("caption", props: { text: "Form Pill Truncation" }) %>
|
|
@@ -24,19 +24,19 @@
|
|
|
24
24
|
name: "Princess Amelia Mignonette Grimaldi Thermopolis Renaldo",
|
|
25
25
|
avatar_url: "https://randomuser.me/api/portraits/women/44.jpg",
|
|
26
26
|
tabindex: 0,
|
|
27
|
-
truncate: 1,
|
|
27
|
+
truncate: "1",
|
|
28
28
|
id: "truncation-1"
|
|
29
29
|
}) %>
|
|
30
30
|
<%= pb_rails("form_pill", props: {
|
|
31
31
|
icon: "badge-check",
|
|
32
32
|
text: "icon and a very long tag to show truncation",
|
|
33
33
|
tabindex: 0,
|
|
34
|
-
truncate: 1,
|
|
34
|
+
truncate: "1",
|
|
35
35
|
id: "truncation-2"
|
|
36
36
|
}) %>
|
|
37
37
|
<%= pb_rails("form_pill", props: {
|
|
38
38
|
text: "form pill long tag no tooltip show truncation",
|
|
39
39
|
tabindex: 0,
|
|
40
|
-
truncate: 1,
|
|
40
|
+
truncate: "1",
|
|
41
41
|
}) %>
|
|
42
|
-
<% end %>
|
|
42
|
+
<% end %>
|
|
@@ -21,7 +21,7 @@ const FormPillTruncatedText = (props) => {
|
|
|
21
21
|
isMulti
|
|
22
22
|
label="Truncation Within Typeahead"
|
|
23
23
|
options={names}
|
|
24
|
-
truncate={1}
|
|
24
|
+
truncate={"1"}
|
|
25
25
|
{...props}
|
|
26
26
|
/>
|
|
27
27
|
<Caption text="Form Pill Truncation"/>
|
|
@@ -31,20 +31,20 @@ const FormPillTruncatedText = (props) => {
|
|
|
31
31
|
name="Princess Amelia Mignonette Grimaldi Thermopolis Renaldo"
|
|
32
32
|
onClick={() => alert('Click!')}
|
|
33
33
|
tabIndex={0}
|
|
34
|
-
truncate={1}
|
|
34
|
+
truncate={"1"}
|
|
35
35
|
/>
|
|
36
36
|
<FormPill
|
|
37
37
|
icon="badge-check"
|
|
38
38
|
onClick={() => {alert('Click!')}}
|
|
39
39
|
tabIndex={0}
|
|
40
40
|
text="icon and a very long tag to show truncation"
|
|
41
|
-
truncate={1}
|
|
41
|
+
truncate={"1"}
|
|
42
42
|
/>
|
|
43
43
|
<FormPill
|
|
44
44
|
onClick={() => {alert('Click!')}}
|
|
45
45
|
tabIndex={0}
|
|
46
46
|
text="form pill with a very long tag to show truncation"
|
|
47
|
-
truncate={1}
|
|
47
|
+
truncate={"1"}
|
|
48
48
|
/>
|
|
49
49
|
</Card>
|
|
50
50
|
</>
|
|
@@ -39,6 +39,13 @@
|
|
|
39
39
|
display: flex;
|
|
40
40
|
align-items: center;
|
|
41
41
|
justify-content: space-between;
|
|
42
|
+
@include transition_default;
|
|
43
|
+
|
|
44
|
+
&:focus-within {
|
|
45
|
+
border-color: $primary;
|
|
46
|
+
background-color: $focus_input_light;
|
|
47
|
+
}
|
|
48
|
+
|
|
42
49
|
.input_inner_container {
|
|
43
50
|
width: 100%;
|
|
44
51
|
}
|