playbook_ui 11.9.0 → 11.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_background/_background.tsx +1 -1
  3. data/app/pb_kits/playbook/pb_background/background.rb +5 -0
  4. data/app/pb_kits/playbook/pb_background/docs/_background_status.jsx +1 -1
  5. data/app/pb_kits/playbook/pb_background/docs/_background_status_subtle.html.erb +11 -0
  6. data/app/pb_kits/playbook/pb_background/docs/_background_status_subtle.jsx +44 -0
  7. data/app/pb_kits/playbook/pb_background/docs/_background_status_subtle.md +1 -0
  8. data/app/pb_kits/playbook/pb_background/docs/example.yml +2 -0
  9. data/app/pb_kits/playbook/pb_background/docs/index.js +1 -0
  10. data/app/pb_kits/playbook/pb_collapsible/_collapsible.scss +5 -0
  11. data/app/pb_kits/playbook/pb_collapsible/_collapsible.tsx +8 -3
  12. data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleMain.tsx +41 -9
  13. data/app/pb_kits/playbook/pb_collapsible/collapsible.test.js +1 -1
  14. data/app/pb_kits/playbook/pb_collapsible/collapsible_main.html.erb +4 -2
  15. data/app/pb_kits/playbook/pb_collapsible/collapsible_main.rb +20 -0
  16. data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_color.html.erb +60 -0
  17. data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_color.jsx +98 -0
  18. data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_color.md +4 -0
  19. data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_default.html.erb +1 -1
  20. data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_size.html.erb +40 -0
  21. data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_size.jsx +68 -0
  22. data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_size.md +4 -0
  23. data/app/pb_kits/playbook/pb_collapsible/docs/example.yml +6 -4
  24. data/app/pb_kits/playbook/pb_collapsible/docs/index.js +2 -0
  25. data/app/pb_kits/playbook/pb_filter/docs/_description.md +5 -1
  26. data/app/pb_kits/playbook/pb_filter/docs/_filter_default.html.erb +7 -8
  27. data/app/pb_kits/playbook/pb_filter/docs/_filter_default.jsx +59 -46
  28. data/app/pb_kits/playbook/pb_filter/docs/{_filter_min_width.html.erb → _filter_max_width.html.erb} +3 -3
  29. data/app/pb_kits/playbook/pb_filter/docs/_filter_max_width.jsx +69 -0
  30. data/app/pb_kits/playbook/pb_filter/docs/{_filter_default.md → _filter_max_width.md} +1 -1
  31. data/app/pb_kits/playbook/pb_filter/docs/_filter_no_background.html.erb +5 -6
  32. data/app/pb_kits/playbook/pb_filter/docs/_filter_no_background.jsx +61 -47
  33. data/app/pb_kits/playbook/pb_filter/docs/_filter_no_sort.html.erb +2 -2
  34. data/app/pb_kits/playbook/pb_filter/docs/_filter_no_sort.jsx +31 -25
  35. data/app/pb_kits/playbook/pb_filter/docs/_filter_only.html.erb +2 -2
  36. data/app/pb_kits/playbook/pb_filter/docs/_filter_only.jsx +31 -24
  37. data/app/pb_kits/playbook/pb_filter/docs/_filter_placement.html.erb +2 -2
  38. data/app/pb_kits/playbook/pb_filter/docs/_filter_placement.jsx +30 -24
  39. data/app/pb_kits/playbook/pb_filter/docs/_filter_placement.md +1 -1
  40. data/app/pb_kits/playbook/pb_filter/docs/_filter_single.html.erb +2 -2
  41. data/app/pb_kits/playbook/pb_filter/docs/_filter_single.jsx +30 -25
  42. data/app/pb_kits/playbook/pb_filter/docs/example.yml +2 -3
  43. data/app/pb_kits/playbook/pb_filter/docs/index.js +1 -2
  44. data/app/pb_kits/playbook/pb_form_group/_form_group.scss +5 -0
  45. data/app/pb_kits/playbook/pb_legend/_legend.jsx +12 -2
  46. data/app/pb_kits/playbook/pb_legend/_legend.scss +7 -1
  47. data/app/pb_kits/playbook/pb_legend/docs/_legend_custom_colors.html.erb +3 -0
  48. data/app/pb_kits/playbook/pb_legend/docs/_legend_custom_colors.jsx +24 -0
  49. data/app/pb_kits/playbook/pb_legend/docs/_legend_custom_colors.md +1 -0
  50. data/app/pb_kits/playbook/pb_legend/docs/example.yml +2 -0
  51. data/app/pb_kits/playbook/pb_legend/docs/index.js +1 -0
  52. data/app/pb_kits/playbook/pb_legend/legend.html.erb +1 -1
  53. data/app/pb_kits/playbook/pb_legend/legend.rb +9 -1
  54. data/app/pb_kits/playbook/pb_radio/_radio.scss +1 -0
  55. data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.scss +0 -2
  56. data/app/pb_kits/playbook/pb_typeahead/_typeahead.scss +37 -2
  57. data/app/pb_kits/playbook/tokens/_colors.scss +11 -1
  58. data/lib/playbook/version.rb +2 -2
  59. metadata +17 -6
  60. data/app/pb_kits/playbook/pb_filter/docs/_filter_close_popover.jsx +0 -62
  61. data/app/pb_kits/playbook/pb_filter/docs/_filter_min_width.jsx +0 -57
@@ -0,0 +1,68 @@
1
+ import React from 'react'
2
+ import { Collapsible } from '../..'
3
+
4
+ const CollapsibleSize = () => (
5
+ <div>
6
+ <Collapsible
7
+ iconSize="xs"
8
+ marginBottom="xs"
9
+ >
10
+ <Collapsible.Main>
11
+ <div>{'Extra Small Section'}</div>
12
+ </Collapsible.Main>
13
+ <Collapsible.Content>
14
+ <div>
15
+ {
16
+ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. In vel erat sed purus hendrerit viverra. Duis et vestibulum metus. Sed consequat ut ante non vehicula. Etiam nunc massa, pharetra vel quam id, posuere rhoncus quam. Quisque imperdiet arcu enim, nec aliquet justo auctor eget. Curabitur in metus nec nunc rhoncus faucibus vitae ac elit. Nulla facilisi. Vestibulum quis pretium nulla. Nulla ut accumsan velit. Duis varius urna sed sem tempor, sit amet fermentum nibh auctor. Praesent lorem arcu, egestas non ante quis, placerat pellentesque lectus.Vestibulum lacinia ipsum quis venenatis tristique. Vivamus suscipit, libero eu fringilla egestas, orci urna commodo arcu, vel gravida turpis ipsum molestie nibh. Donec cursus eu ante sagittis ultrices. Phasellus id sagittis risus. Mauris dapibus neque faucibus, tempor ligula vel, cursus ante. Donec faucibus gravida porta. Nullam egestas est quis aliquam feugiat. Sed eget metus diam. Cras eget placerat libero.'
17
+ }
18
+ </div>
19
+ </Collapsible.Content>
20
+ </Collapsible>
21
+ <Collapsible
22
+ iconSize="sm"
23
+ marginBottom="xs"
24
+ >
25
+ <Collapsible.Main>
26
+ <div>{'Small Section'}</div>
27
+ </Collapsible.Main>
28
+ <Collapsible.Content>
29
+ <div>
30
+ {
31
+ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. In vel erat sed purus hendrerit viverra. Duis et vestibulum metus. Sed consequat ut ante non vehicula. Etiam nunc massa, pharetra vel quam id, posuere rhoncus quam. Quisque imperdiet arcu enim, nec aliquet justo auctor eget. Curabitur in metus nec nunc rhoncus faucibus vitae ac elit. Nulla facilisi. Vestibulum quis pretium nulla. Nulla ut accumsan velit. Duis varius urna sed sem tempor, sit amet fermentum nibh auctor. Praesent lorem arcu, egestas non ante quis, placerat pellentesque lectus.Vestibulum lacinia ipsum quis venenatis tristique. Vivamus suscipit, libero eu fringilla egestas, orci urna commodo arcu, vel gravida turpis ipsum molestie nibh. Donec cursus eu ante sagittis ultrices. Phasellus id sagittis risus. Mauris dapibus neque faucibus, tempor ligula vel, cursus ante. Donec faucibus gravida porta. Nullam egestas est quis aliquam feugiat. Sed eget metus diam. Cras eget placerat libero.'
32
+ }
33
+ </div>
34
+ </Collapsible.Content>
35
+ </Collapsible>
36
+ <Collapsible
37
+ marginBottom="xs"
38
+ >
39
+ <Collapsible.Main>
40
+ <div>{'Default Section'}</div>
41
+ </Collapsible.Main>
42
+ <Collapsible.Content>
43
+ <div>
44
+ {
45
+ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. In vel erat sed purus hendrerit viverra. Duis et vestibulum metus. Sed consequat ut ante non vehicula. Etiam nunc massa, pharetra vel quam id, posuere rhoncus quam. Quisque imperdiet arcu enim, nec aliquet justo auctor eget. Curabitur in metus nec nunc rhoncus faucibus vitae ac elit. Nulla facilisi. Vestibulum quis pretium nulla. Nulla ut accumsan velit. Duis varius urna sed sem tempor, sit amet fermentum nibh auctor. Praesent lorem arcu, egestas non ante quis, placerat pellentesque lectus.Vestibulum lacinia ipsum quis venenatis tristique. Vivamus suscipit, libero eu fringilla egestas, orci urna commodo arcu, vel gravida turpis ipsum molestie nibh. Donec cursus eu ante sagittis ultrices. Phasellus id sagittis risus. Mauris dapibus neque faucibus, tempor ligula vel, cursus ante. Donec faucibus gravida porta. Nullam egestas est quis aliquam feugiat. Sed eget metus diam. Cras eget placerat libero.'
46
+ }
47
+ </div>
48
+ </Collapsible.Content>
49
+ </Collapsible>
50
+ <Collapsible
51
+ iconSize="lg"
52
+ marginBottom="xs"
53
+ >
54
+ <Collapsible.Main>
55
+ <div>{'Large Section'}</div>
56
+ </Collapsible.Main>
57
+ <Collapsible.Content>
58
+ <div>
59
+ {
60
+ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. In vel erat sed purus hendrerit viverra. Duis et vestibulum metus. Sed consequat ut ante non vehicula. Etiam nunc massa, pharetra vel quam id, posuere rhoncus quam. Quisque imperdiet arcu enim, nec aliquet justo auctor eget. Curabitur in metus nec nunc rhoncus faucibus vitae ac elit. Nulla facilisi. Vestibulum quis pretium nulla. Nulla ut accumsan velit. Duis varius urna sed sem tempor, sit amet fermentum nibh auctor. Praesent lorem arcu, egestas non ante quis, placerat pellentesque lectus.Vestibulum lacinia ipsum quis venenatis tristique. Vivamus suscipit, libero eu fringilla egestas, orci urna commodo arcu, vel gravida turpis ipsum molestie nibh. Donec cursus eu ante sagittis ultrices. Phasellus id sagittis risus. Mauris dapibus neque faucibus, tempor ligula vel, cursus ante. Donec faucibus gravida porta. Nullam egestas est quis aliquam feugiat. Sed eget metus diam. Cras eget placerat libero.'
61
+ }
62
+ </div>
63
+ </Collapsible.Content>
64
+ </Collapsible>
65
+ </div>
66
+ )
67
+
68
+ export default CollapsibleSize
@@ -0,0 +1,4 @@
1
+ ##### Prop
2
+ This kit uses `icon` sizes. If you don't give it a size, it will default to medium. You can be replaced with the sizes below:
3
+
4
+ * `lg` `xs` `sm` `1x` `2x` `3x` `4x` `5x` `6x` `7x` `8x` `9x` `10x`
@@ -1,9 +1,11 @@
1
1
  examples:
2
2
 
3
3
  rails:
4
- - collapsible_default: Light
4
+ - collapsible_default: Default
5
+ - collapsible_size: Size
6
+ - collapsible_color: Color
5
7
 
6
8
  react:
7
- - collapsible_default: Light
8
-
9
-
9
+ - collapsible_default: Default
10
+ - collapsible_size: Size
11
+ - collapsible_color: Color
@@ -1 +1,3 @@
1
1
  export { default as CollapsibleDefault } from './_collapsible_default.jsx'
2
+ export { default as CollapsibleSize } from './_collapsible_size.jsx'
3
+ export { default as CollapsibleColor } from './_collapsible_color.jsx'
@@ -1,3 +1,7 @@
1
- **Note**
2
1
  This kit can be implemented in a variety of ways.
3
2
  To see examples of how to implement this kit in production visit the **/dev_docs/search** page in production.
3
+
4
+ **Note**
5
+ All React examples are wrapped in a <code>{closePopover}</code> method to ensure the popover closes on click of "Apply".
6
+
7
+ The `min_width` prop for the popover inside of filter is used in all the examples and is set to 360px. That is the `min_width` prop we recommend using as it is the same pixel value as our `max_width` `sm` global prop.
@@ -1,7 +1,8 @@
1
1
  <%=
2
2
  pb_rails("filter", props: {
3
- min_width: "375px",
3
+ min_width: "360px",
4
4
  id: "1",
5
+ margin_bottom: "xl",
5
6
  filters: [
6
7
  { name: "name", value: "John Wick" },
7
8
  { name: "city", value: "San Francisco"}
@@ -21,12 +22,12 @@
21
22
  OpenStruct.new(name: "Canada", value: 2),
22
23
  OpenStruct.new(name: "Brazil", value: 3),
23
24
  OpenStruct.new(name: "Philippines", value: 4),
24
- OpenStruct.new(name: "A galaxy far far away, like really far away...", value: 5)
25
+ OpenStruct.new(name: "A galaxy far far away...", value: 5)
25
26
  ]
26
27
  %>
27
28
  <%= pb_rails("form", props: { form_system_options: { scope: :example, method: :get } }) do |form| %>
28
29
  <%= form.text_field :example_text_field, props: { label: true } %>
29
- <%= form.collection_select :example_collection_select, example_collection, :value, :name, props: {max_width: "sm", label: true } %>
30
+ <%= form.collection_select :example_collection_select, example_collection, :value, :name, props: { label: true } %>
30
31
 
31
32
  <%= form.actions do |action| %>
32
33
  <%= action.submit props: { text: "Apply", data: { disable_with: "<i class='far fa-spinner fa-spin mr-3'></i>Searching...".html_safe },}%>
@@ -35,12 +36,10 @@
35
36
  <% end %>
36
37
  <% end %>
37
38
 
38
- <br>
39
- <br>
40
39
 
41
40
  <%=
42
41
  pb_rails("filter", props: {
43
- min_width: "375px",
42
+ min_width: "360px",
44
43
  id: "def2",
45
44
  sort_menu: [
46
45
  { item: "Popularity", link: "?q[sorts]=managers_popularity+asc", active: true, direction: "desc" },
@@ -57,12 +56,12 @@
57
56
  OpenStruct.new(name: "Canada", value: 2),
58
57
  OpenStruct.new(name: "Brazil", value: 3),
59
58
  OpenStruct.new(name: "Philippines", value: 4),
60
- OpenStruct.new(name: "A galaxy far far away, like really far away...", value: 5)
59
+ OpenStruct.new(name: "A galaxy far far away...", value: 5)
61
60
  ]
62
61
  %>
63
62
  <%= pb_rails("form", props: { form_system_options: { scope: :example, method: :get } }) do |form| %>
64
63
  <%= form.text_field :example_text_field, props: { label: true } %>
65
- <%= form.collection_select :example_collection_select, example_collection, :value, :name, props: {max_width: "sm", label: true } %>
64
+ <%= form.collection_select :example_collection_select, example_collection, :value, :name, props: { label: true } %>
66
65
 
67
66
  <%= form.actions do |action| %>
68
67
  <%= action.submit props: { text: "Apply", data: { disable_with: "<i class='far fa-spinner fa-spin mr-3'></i>Searching...".html_safe },}%>
@@ -22,6 +22,7 @@ const FilterDefault = (props) => {
22
22
  'Full Name': 'John Wick',
23
23
  'City': 'San Francisco',
24
24
  }}
25
+ marginBottom="xl"
25
26
  minWidth="375px"
26
27
  onSortChange={SortingChangeCallback}
27
28
  results={1}
@@ -35,37 +36,43 @@ const FilterDefault = (props) => {
35
36
  sortValue={[{ name: 'popularity', dir: 'desc' }]}
36
37
  {...props}
37
38
  >
38
- <TextInput
39
- label="Full Name"
40
- placeholder="Enter name"
41
- {...props}
42
- />
39
+ {({ closePopover }) => (
40
+ <form>
43
41
 
44
- <Select
45
- blankSelection="Select One..."
46
- label="Territory"
47
- maxWidth="sm"
48
- name="location"
49
- options={options}
50
- {...props}
51
- />
52
- <Flex
53
- spacing="between"
54
- {...props}
55
- >
56
- <Button
57
- text="Apply"
42
+ <TextInput
43
+ label="Full Name"
44
+ placeholder="Enter name"
58
45
  {...props}
59
46
  />
60
- <Button
61
- text="Clear"
62
- variant="secondary"
47
+
48
+ <Select
49
+ blankSelection="Select One..."
50
+ label="Territory"
51
+ maxWidth="sm"
52
+ name="location"
53
+ options={options}
63
54
  {...props}
64
55
  />
65
- </Flex>
56
+ <Flex
57
+ spacing="between"
58
+ {...props}
59
+ >
60
+ <Button
61
+ onClick={closePopover}
62
+ text="Apply"
63
+ {...props}
64
+ />
65
+ <Button
66
+ text="Clear"
67
+ variant="secondary"
68
+ {...props}
69
+ />
70
+ </Flex>
71
+ </form>
72
+ )}
73
+
66
74
  </Filter>
67
75
 
68
- <br />
69
76
 
70
77
  <Filter
71
78
  double
@@ -82,33 +89,39 @@ const FilterDefault = (props) => {
82
89
  sortValue={[{ name: 'popularity', dir: 'desc' }]}
83
90
  {...props}
84
91
  >
85
- <TextInput
86
- label="Example Text Field"
87
- placeholder="Enter Text"
88
- {...props}
89
- />
92
+ {({ closePopover }) => (
93
+ <form>
90
94
 
91
- <Select
92
- blankSelection="Select One..."
93
- label="Example Collection Select"
94
- name="Collection Select"
95
- options={options}
96
- {...props}
97
- />
98
- <Flex
99
- spacing="between"
100
- {...props}
101
- >
102
- <Button
103
- text="Apply"
95
+ <TextInput
96
+ label="Example Text Field"
97
+ placeholder="Enter Text"
104
98
  {...props}
105
99
  />
106
- <Button
107
- text="Clear"
108
- variant="secondary"
100
+
101
+ <Select
102
+ blankSelection="Select One..."
103
+ label="Example Collection Select"
104
+ name="Collection Select"
105
+ options={options}
109
106
  {...props}
110
107
  />
111
- </Flex>
108
+ <Flex
109
+ spacing="between"
110
+ {...props}
111
+ >
112
+ <Button
113
+ onClick={closePopover}
114
+ text="Apply"
115
+ {...props}
116
+ />
117
+ <Button
118
+ text="Clear"
119
+ variant="secondary"
120
+ {...props}
121
+ />
122
+ </Flex>
123
+ </form>
124
+ )}
112
125
  </Filter>
113
126
  </>
114
127
  )
@@ -1,6 +1,6 @@
1
1
  <%=
2
2
  pb_rails("filter", props: {
3
- min_width: "375px",
3
+ min_width: "360px",
4
4
  id: "25",
5
5
  position: "top",
6
6
  filters: [
@@ -22,12 +22,12 @@
22
22
  OpenStruct.new(name: "Canada", value: 2),
23
23
  OpenStruct.new(name: "Brazil", value: 3),
24
24
  OpenStruct.new(name: "Philippines", value: 4),
25
- OpenStruct.new(name: "A galaxy far far away, like really far away...", value: 5)
25
+ OpenStruct.new(name: "A galaxy far far away, like really far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far away...", value: 5)
26
26
  ]
27
27
  %>
28
28
  <%= pb_rails("form", props: { form_system_options: { scope: :example, method: :get } }) do |form| %>
29
29
  <%= form.text_field :example_text_field, props: { label: true } %>
30
- <%= form.collection_select :example_collection_select, example_collection, :value, :name, props: { label: true } %>
30
+ <%= form.collection_select :example_collection_select, example_collection, :value, :name, props: {max_width: "sm", label: true } %>
31
31
 
32
32
  <%= form.actions do |action| %>
33
33
  <%= action.submit props: { text: "Apply", data: { disable_with: "<i class='far fa-spinner fa-spin mr-3'></i>Searching...".html_safe },}%>
@@ -0,0 +1,69 @@
1
+ import React from 'react'
2
+ import { Button, Filter, Flex, Select } from '../../'
3
+
4
+ const FilterMaxWidth = (props) => {
5
+ const options = [
6
+ { value: 'USA' },
7
+ { value: 'Canada' },
8
+ { value: 'Brazil' },
9
+ { value: 'Philippines' },
10
+ { value: 'A galaxy far far away, like really far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far far away...' },
11
+ ]
12
+ return (
13
+ <Filter
14
+ {...props}
15
+ double
16
+ filters={{
17
+ 'Full Name': 'John Wick',
18
+ 'City': 'San Francisco',
19
+ }}
20
+ minWidth="360px"
21
+ results={1}
22
+ sortOptions={{
23
+ popularity: 'Popularity',
24
+ // eslint-disable-next-line
25
+ manager_title: 'Manager\'s Title',
26
+ // eslint-disable-next-line
27
+ manager_name: 'Manager\'s Name',
28
+ }}
29
+ sortValue={[{ name: 'popularity', dir: 'desc' }]}
30
+ >
31
+ {({ closePopover }) => (
32
+ <form>
33
+
34
+ <Select
35
+ blankSelection="Select One..."
36
+ label="Territory"
37
+ maxWidth="sm"
38
+ name="location"
39
+ options={options}
40
+ />
41
+ <Button
42
+ text="Apply"
43
+ />
44
+
45
+ <Select
46
+ blankSelection="Select One..."
47
+ label="Territory"
48
+ name="location"
49
+ options={options}
50
+ />
51
+ <Flex
52
+ spacing="between"
53
+ >
54
+ <Button
55
+ onClick={closePopover}
56
+ text="Apply"
57
+ />
58
+ <Button
59
+ text="Clear"
60
+ variant="secondary"
61
+ />
62
+ </Flex>
63
+ </form>
64
+ )}
65
+ </Filter>
66
+ )
67
+ }
68
+
69
+ export default FilterMaxWidth
@@ -1 +1 @@
1
- Filter can leverage the max-width property. Learn more in our <a href="https://playbook.powerapp.cloud/visual_guidelines" target="_blank">visual guidelines.</a>
1
+ Filter can leverage the max-width property. Learn more in our <a href="https://playbook.powerapp.cloud/visual_guidelines" target="_blank">visual guidelines.</a>
@@ -1,7 +1,8 @@
1
1
  <%=
2
2
  pb_rails("filter", props: {
3
- min_width: "375px",
3
+ min_width: "360px",
4
4
  id: "3",
5
+ margin_bottom: "xl",
5
6
  background: false,
6
7
  filters: [
7
8
  { name: "name", value: "John Wick" },
@@ -22,7 +23,7 @@
22
23
  OpenStruct.new(name: "Canada", value: 2),
23
24
  OpenStruct.new(name: "Brazil", value: 3),
24
25
  OpenStruct.new(name: "Philippines", value: 4),
25
- OpenStruct.new(name: "A galaxy far far away, like really far away...", value: 5)
26
+ OpenStruct.new(name: "A galaxy far far away...", value: 5)
26
27
  ]
27
28
  %>
28
29
 
@@ -37,11 +38,9 @@
37
38
  <% end %>
38
39
  <% end %>
39
40
 
40
- <br>
41
-
42
41
  <%=
43
42
  pb_rails("filter", props: {
44
- min_width: "375px",
43
+ min_width: "360px",
45
44
  id: "4",
46
45
  background: false,
47
46
  filters: [
@@ -62,7 +61,7 @@
62
61
  OpenStruct.new(name: "Canada", value: 2),
63
62
  OpenStruct.new(name: "Brazil", value: 3),
64
63
  OpenStruct.new(name: "Philippines", value: 4),
65
- OpenStruct.new(name: "A galaxy far far away, like really far away...", value: 5)
64
+ OpenStruct.new(name: "A galaxy far far away...", value: 5)
66
65
  ]
67
66
  %>
68
67
  <%= pb_rails("form", props: { form_system_options: { scope: :example, method: :get } }) do |form| %>
@@ -7,7 +7,7 @@ const FilterNoBackground = (props) => {
7
7
  { value: 'Canada' },
8
8
  { value: 'Brazil' },
9
9
  { value: 'Philippines' },
10
- { value: 'A galaxy far far away, like really far away...' },
10
+ { value: 'A galaxy far far away...' },
11
11
  ]
12
12
  return (
13
13
  <>
@@ -17,7 +17,8 @@ const FilterNoBackground = (props) => {
17
17
  'Full Name': 'John Wick',
18
18
  'City': 'Las Vegas',
19
19
  }}
20
- minWidth="375px"
20
+ marginBottom="xl"
21
+ minWidth="360px"
21
22
  results={3}
22
23
  sortOptions={{
23
24
  popularity: 'Popularity',
@@ -29,33 +30,40 @@ const FilterNoBackground = (props) => {
29
30
  sortValue={[{ name: 'popularity', dir: 'desc' }]}
30
31
  {...props}
31
32
  >
32
- <TextInput
33
- label="Full Name"
34
- placeholder="Enter name"
35
- {...props}
36
- />
33
+ {({ closePopover }) => (
34
+ <form>
37
35
 
38
- <Select
39
- blankSelection="Select One..."
40
- label="Territory"
41
- name="location"
42
- options={options}
43
- {...props}
44
- />
45
- <Flex
46
- spacing="between"
47
- {...props}
48
- >
49
- <Button
50
- text="Apply"
36
+ <TextInput
37
+ label="Full Name"
38
+ placeholder="Enter name"
51
39
  {...props}
52
40
  />
53
- <Button
54
- text="Clear"
55
- variant="secondary"
41
+
42
+ <Select
43
+ blankSelection="Select One..."
44
+ label="Territory"
45
+ name="location"
46
+ options={options}
56
47
  {...props}
57
48
  />
58
- </Flex>
49
+ <Flex
50
+ spacing="between"
51
+ {...props}
52
+ >
53
+ <Button
54
+ onClick={closePopover}
55
+ text="Apply"
56
+ {...props}
57
+ />
58
+ <Button
59
+ text="Clear"
60
+ variant="secondary"
61
+ {...props}
62
+ />
63
+ </Flex>
64
+ </form>
65
+ )}
66
+
59
67
  </Filter>
60
68
 
61
69
  <Filter
@@ -65,7 +73,7 @@ const FilterNoBackground = (props) => {
65
73
  'Full Name': 'John Wick',
66
74
  'City': 'Las Vegas',
67
75
  }}
68
- minWidth="375px"
76
+ minWidth="360px"
69
77
  results={3}
70
78
  sortOptions={{
71
79
  popularity: 'Popularity',
@@ -77,33 +85,39 @@ const FilterNoBackground = (props) => {
77
85
  sortValue={[{ name: 'popularity', dir: 'desc' }]}
78
86
  {...props}
79
87
  >
80
- <TextInput
81
- label="Full Name"
82
- placeholder="Enter name"
83
- {...props}
84
- />
88
+ {({ closePopover }) => (
89
+ <form>
85
90
 
86
- <Select
87
- blankSelection="Select One..."
88
- label="Territory"
89
- name="location"
90
- options={options}
91
- {...props}
92
- />
93
- <Flex
94
- spacing="between"
95
- {...props}
96
- >
97
- <Button
98
- text="Apply"
91
+ <TextInput
92
+ label="Full Name"
93
+ placeholder="Enter name"
99
94
  {...props}
100
95
  />
101
- <Button
102
- text="Clear"
103
- variant="secondary"
96
+
97
+ <Select
98
+ blankSelection="Select One..."
99
+ label="Territory"
100
+ name="location"
101
+ options={options}
104
102
  {...props}
105
103
  />
106
- </Flex>
104
+ <Flex
105
+ spacing="between"
106
+ {...props}
107
+ >
108
+ <Button
109
+ onClick={closePopover}
110
+ text="Apply"
111
+ {...props}
112
+ />
113
+ <Button
114
+ text="Clear"
115
+ variant="secondary"
116
+ {...props}
117
+ />
118
+ </Flex>
119
+ </form>
120
+ )}
107
121
  </Filter>
108
122
  </>
109
123
  )
@@ -1,6 +1,6 @@
1
1
  <%=
2
2
  pb_rails("filter", props: {
3
- min_width: "375px",
3
+ min_width: "360px",
4
4
  id: "nosort",
5
5
  filters: [
6
6
  { name: "name", value: "John Wick" }
@@ -15,7 +15,7 @@
15
15
  OpenStruct.new(name: "Canada", value: 2),
16
16
  OpenStruct.new(name: "Brazil", value: 3),
17
17
  OpenStruct.new(name: "Philippines", value: 4),
18
- OpenStruct.new(name: "A galaxy far far away, like really far away...", value: 5)
18
+ OpenStruct.new(name: "A galaxy far far away...", value: 5)
19
19
  ]
20
20
  %>
21
21