playbook_ui_docs 13.32.0.pre.alpha.PBNTR405dropdownformfixesrails3301 → 13.32.0.pre.alpha.PLAY1138iconkitaddcolorprop3268
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_bar_graph/docs/_bar_graph_custom.md +0 -4
- data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +0 -4
- data/app/pb_kits/playbook/pb_dropdown/docs/index.js +1 -3
- data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_example.html.erb +1 -5
- data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_example.jsx +0 -1
- data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_size.html.erb +0 -2
- data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_size.jsx +0 -2
- data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_tag.html.erb +1 -4
- data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_tag.jsx +2 -3
- data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_user.html.erb +0 -2
- data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_user.jsx +0 -2
- data/app/pb_kits/playbook/pb_icon/docs/_icon_color.html.erb +7 -0
- data/app/pb_kits/playbook/pb_icon/docs/_icon_color.jsx +46 -0
- data/app/pb_kits/playbook/pb_icon/docs/_icon_color.md +1 -0
- data/app/pb_kits/playbook/pb_icon/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_icon/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_nav/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_star_rating/docs/example.yml +1 -1
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_default.jsx +1 -1
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_custom_menu_list.jsx +0 -2
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_default.html.erb +57 -22
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async.jsx +2 -2
- data/dist/playbook-doc.js +9 -9
- metadata +5 -9
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_blank_selection.html.erb +0 -10
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_blank_selection.jsx +0 -31
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_default_value.html.erb +0 -10
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_default_value.jsx +0 -31
- data/app/pb_kits/playbook/pb_nav/docs/_tab_nav.html.erb +0 -48
- data/app/pb_kits/playbook/pb_nav/docs/_tab_nav.md +0 -3
- data/app/pb_kits/playbook/pb_star_rating/docs/_star_rating_interactive.html.erb +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0202d59ed4925de375ff662bf89dbc2267e4d2448dccbed8f657f67b07010788
|
4
|
+
data.tar.gz: ba326a997028b871950ae3c7c7dbec43191ef6796e5877944c73d4c979158a92
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 21d0ffdb91a6b98437c49acc9d8b1b7b225a992d72d448a4cecc9f103013365707c70b5dd1199ef129dfde8f983e8964479597a089d493dc66c8c120a2b5e4bd
|
7
|
+
data.tar.gz: 0f88b7bf28a5b21475deffd253ed1e3671ff457e41b903935c067dd503a682250e809b3da56aeffa31e150c8e2710ca44a10d5c597a5d16dcb50959991db9092
|
@@ -1,6 +1,2 @@
|
|
1
1
|
The `customOptions` prop provides comprehensive access to additional [Highcharts options](https://api.highcharts.com/highcharts/) that are not explicitly defined as props.
|
2
2
|
It's important to note that certain options may require specific script imports to function properly.
|
3
|
-
|
4
|
-
Note: If you are having trouble getting any Highcharts options to work, please match the formatting of our [staticOptions](https://github.com/powerhome/playbook/blob/master/playbook/app/pb_kits/playbook/pb_bar_graph/_bar_graph.tsx#L85-L141). For example, `yAxis` will need to be wrapped with square brackets.
|
5
|
-
|
6
|
-
You may also need to override any of the [defaults](https://github.com/powerhome/playbook/blob/master/playbook/app/pb_kits/playbook/pb_bar_graph/_bar_graph.tsx#L45-L73) in order to get that options to work.
|
@@ -8,8 +8,6 @@ examples:
|
|
8
8
|
- dropdown_with_custom_trigger_rails: Custom Trigger
|
9
9
|
- dropdown_with_custom_padding: Custom Option Padding
|
10
10
|
- dropdown_error: Dropdown with Error
|
11
|
-
- dropdown_default_value: Default Value
|
12
|
-
- dropdown_blank_selection: Blank Selection
|
13
11
|
|
14
12
|
react:
|
15
13
|
- dropdown_default: Default
|
@@ -20,8 +18,6 @@ examples:
|
|
20
18
|
- dropdown_with_custom_trigger: Custom Trigger
|
21
19
|
- dropdown_with_custom_padding: Custom Option Padding
|
22
20
|
- dropdown_error: Dropdown with Error
|
23
|
-
- dropdown_default_value: Default Value
|
24
|
-
- dropdown_blank_selection: Blank Selection
|
25
21
|
# - dropdown_with_autocomplete: Autocomplete
|
26
22
|
# - dropdown_with_autocomplete_and_custom_display: Autocomplete with Custom Display
|
27
23
|
# - dropdown_with_external_control: useDropdown Hook
|
@@ -9,6 +9,4 @@ export { default as DropdownWithLabel } from './_dropdown_with_label.jsx'
|
|
9
9
|
export { default as DropdownWithExternalControl } from './_dropdown_with_external_control.jsx'
|
10
10
|
export { default as DropdownWithHook } from './_dropdown_with_hook.jsx'
|
11
11
|
export { default as DropdownSubcomponentStructure } from './_dropdown_subcomponent_structure.jsx'
|
12
|
-
export { default as DropdownError } from './_dropdown_error.jsx'
|
13
|
-
export { default as DropdownDefaultValue } from './_dropdown_default_value.jsx'
|
14
|
-
export { default as DropdownBlankSelection } from './_dropdown_blank_selection.jsx'
|
12
|
+
export { default as DropdownError } from './_dropdown_error.jsx'
|
@@ -2,7 +2,6 @@
|
|
2
2
|
name: "Anna Black",
|
3
3
|
avatar_url: "https://randomuser.me/api/portraits/women/44.jpg",
|
4
4
|
size: "small",
|
5
|
-
tabindex: 0,
|
6
5
|
}) %>
|
7
6
|
|
8
7
|
<br />
|
@@ -11,5 +10,4 @@
|
|
11
10
|
<%= pb_rails("form_pill", props: {
|
12
11
|
name: "Anna Black",
|
13
12
|
size: "small",
|
14
|
-
tabindex: 0,
|
15
13
|
}) %>
|
@@ -9,7 +9,6 @@ const FormPillSize = (props) => {
|
|
9
9
|
avatarUrl="https://randomuser.me/api/portraits/women/44.jpg"
|
10
10
|
name="Anna Black"
|
11
11
|
size="small"
|
12
|
-
tabIndex={0}
|
13
12
|
{...props}
|
14
13
|
/>
|
15
14
|
<br />
|
@@ -17,7 +16,6 @@ const FormPillSize = (props) => {
|
|
17
16
|
<FormPill
|
18
17
|
name="Anna Black"
|
19
18
|
size="small"
|
20
|
-
tabIndex={0}
|
21
19
|
{...props}
|
22
20
|
/>
|
23
21
|
</div>
|
@@ -1,7 +1,6 @@
|
|
1
1
|
<%= pb_rails("form_pill", props: {
|
2
2
|
name: "Anna Black",
|
3
3
|
avatar_url: "https://randomuser.me/api/portraits/women/44.jpg",
|
4
|
-
tabindex: 0,
|
5
4
|
}) %>
|
6
5
|
|
7
6
|
<br />
|
@@ -9,5 +8,4 @@
|
|
9
8
|
|
10
9
|
<%= pb_rails("form_pill", props: {
|
11
10
|
name: "Anna Black",
|
12
|
-
tabindex: 0,
|
13
11
|
}) %>
|
@@ -9,7 +9,6 @@ const FormPillDefault = (props) => {
|
|
9
9
|
avatarUrl="https://randomuser.me/api/portraits/women/44.jpg"
|
10
10
|
name="Anna Black"
|
11
11
|
onClick={() => alert('Click!')}
|
12
|
-
tabIndex={0}
|
13
12
|
{...props}
|
14
13
|
/>
|
15
14
|
<br />
|
@@ -17,7 +16,6 @@ const FormPillDefault = (props) => {
|
|
17
16
|
<FormPill
|
18
17
|
name="Anna Black"
|
19
18
|
onClick={() => alert('Click!')}
|
20
|
-
tabIndex={0}
|
21
19
|
{...props}
|
22
20
|
/>
|
23
21
|
</div>
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<%= pb_rails("flex", props: {orientation: "column"}) do %>
|
2
|
+
<%= pb_rails("icon", props: { icon: "user", fixed_width: true, color: "primary", size: "2x" }) %>
|
3
|
+
<%= pb_rails("icon", props: { icon: "recycle", fixed_width: true, color: "info", size: "2x" }) %>
|
4
|
+
<%= pb_rails("icon", props: { icon: "frog", fixed_width: true, color: "data_4", size: "2x" }) %>
|
5
|
+
<%= pb_rails("icon", props: { icon: "vial", fixed_width: true, color: "text_lt_lighter", size: "2x" }) %>
|
6
|
+
<%= pb_rails("icon", props: { icon: "roofing", fixed_width: true, color: "product_roofing", size: "2x" }) %>
|
7
|
+
<% end %>
|
@@ -0,0 +1,46 @@
|
|
1
|
+
import React from "react"
|
2
|
+
import Icon from "../_icon"
|
3
|
+
|
4
|
+
const IconDefault = (props) => {
|
5
|
+
return (
|
6
|
+
<div style={{ display: "flex", flexDirection: "column"}}>
|
7
|
+
<Icon
|
8
|
+
color="primary"
|
9
|
+
fixedWidth
|
10
|
+
icon="user"
|
11
|
+
size="2x"
|
12
|
+
{...props}
|
13
|
+
/>
|
14
|
+
<Icon
|
15
|
+
color="info"
|
16
|
+
fixedWidth
|
17
|
+
icon="recycle"
|
18
|
+
size="2x"
|
19
|
+
{...props}
|
20
|
+
/>
|
21
|
+
<Icon
|
22
|
+
color="data_4"
|
23
|
+
fixedWidth
|
24
|
+
icon="frog"
|
25
|
+
size="2x"
|
26
|
+
{...props}
|
27
|
+
/>
|
28
|
+
<Icon
|
29
|
+
color="text_lt_lighter"
|
30
|
+
fixedWidth
|
31
|
+
icon="vial"
|
32
|
+
size="2x"
|
33
|
+
{...props}
|
34
|
+
/>
|
35
|
+
<Icon
|
36
|
+
color="roofing"
|
37
|
+
fixedWidth
|
38
|
+
icon="product-roofing"
|
39
|
+
size="2x"
|
40
|
+
{...props}
|
41
|
+
/>
|
42
|
+
</div>
|
43
|
+
)
|
44
|
+
}
|
45
|
+
|
46
|
+
export default IconDefault
|
@@ -0,0 +1 @@
|
|
1
|
+
Pass any Playbook <a href="https://playbook.powerapp.cloud/visual_guidelines/colors" target="_blank">color token</a> to the `color` prop to change any icon's color.
|
@@ -9,6 +9,7 @@ examples:
|
|
9
9
|
- icon_sizes: Icon Sizes
|
10
10
|
- icon_custom: Icon Custom
|
11
11
|
- icon_fa_kit: Icon with FontAwesome Kit
|
12
|
+
- icon_color: Icon Color
|
12
13
|
|
13
14
|
react:
|
14
15
|
- icon_default: Icon Default
|
@@ -20,6 +21,7 @@ examples:
|
|
20
21
|
- icon_sizes: Icon Sizes
|
21
22
|
- icon_custom: Icon Custom
|
22
23
|
- icon_fa_kit: Icon with FontAwesome Kit
|
24
|
+
- icon_color: Icon Color
|
23
25
|
|
24
26
|
swift:
|
25
27
|
- icon_default_swift: Icon Default
|
@@ -7,3 +7,4 @@ export { default as IconBorder } from './_icon_border.jsx'
|
|
7
7
|
export { default as IconSizes } from './_icon_sizes.jsx'
|
8
8
|
export { default as IconCustom } from './_icon_custom.jsx'
|
9
9
|
export { default as IconFaKit} from './_icon_fa_kit.jsx'
|
10
|
+
export { default as IconColor } from './_icon_color.jsx'
|
@@ -5,12 +5,12 @@ import TextInput from '../../pb_text_input/_text_input'
|
|
5
5
|
import Title from '../../pb_title/_title'
|
6
6
|
|
7
7
|
const TextInputDefault = (props) => {
|
8
|
-
const [firstName, setFirstName] = useState('')
|
9
8
|
const handleOnChangeFirstName = ({ target }) => {
|
10
9
|
setFirstName(target.value)
|
11
10
|
}
|
12
11
|
const ref = React.createRef()
|
13
12
|
|
13
|
+
const [firstName, setFirstName] = useState('')
|
14
14
|
const [formFields, setFormFields] = useState({
|
15
15
|
firstName: 'Jane',
|
16
16
|
lastName: 'Doe',
|
@@ -1,28 +1,63 @@
|
|
1
|
-
<%
|
2
|
-
options = [
|
3
|
-
{ label: 'Orange', value: '#FFA500' },
|
4
|
-
{ label: 'Red', value: '#FF0000' },
|
5
|
-
{ label: 'Green', value: '#00FF00' },
|
6
|
-
{ label: 'Blue', value: '#0000FF' },
|
7
|
-
]
|
8
|
-
%>
|
9
|
-
|
10
1
|
<%= pb_rails("typeahead", props: {
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
2
|
+
label: "user",
|
3
|
+
name: :foo,
|
4
|
+
data: { typeahead_example: true },
|
5
|
+
input_options: {
|
6
|
+
classname: "my-typeahead-class",
|
7
|
+
data: {
|
8
|
+
typeahead_testing: "data field test"
|
9
|
+
},
|
10
|
+
id: "typeahead-input-id-test",
|
11
|
+
},
|
12
|
+
})%>
|
13
|
+
|
14
|
+
<br><br><br>
|
15
|
+
|
16
|
+
<%= pb_rails("card", props: { padding: "xl", data: { typeahead_example_selected_option: true } }) do %>
|
17
|
+
<%= pb_rails("body") do %>
|
18
|
+
Use the above input to search for users on Github, and see the results as you type.
|
19
|
+
<% end %>
|
20
|
+
|
21
|
+
<%= pb_rails("body") do %>
|
22
|
+
When you make a selection, you will see it appear in the list below
|
23
|
+
<% end %>
|
24
|
+
|
25
|
+
<div data-selected-option></div>
|
26
|
+
<% end %>
|
27
|
+
|
28
|
+
<template data-typeahead-example-result-option>
|
29
|
+
<%= pb_rails("user", props: {
|
30
|
+
name: tag(:slot, name: "name"),
|
31
|
+
orientation: "horizontal",
|
32
|
+
align: "left",
|
33
|
+
avatar_url: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR4nGP6zwAAAgcBApocMXEAAAAASUVORK5CYII=",
|
34
|
+
avatar: true
|
35
|
+
}) %>
|
36
|
+
</template>
|
19
37
|
|
20
38
|
<%= javascript_tag defer: "defer" do %>
|
21
|
-
document.addEventListener("pb-typeahead-kit-
|
22
|
-
|
23
|
-
|
39
|
+
document.addEventListener("pb-typeahead-kit-search", function(event) {
|
40
|
+
if (!event.target.dataset || !event.target.dataset.typeaheadExample) return;
|
41
|
+
|
42
|
+
fetch(`https://api.github.com/search/users?q=${encodeURIComponent(event.detail.searchingFor)}`)
|
43
|
+
.then(response => response.json())
|
44
|
+
.then((result) => {
|
45
|
+
const resultOptionTemplate = document.querySelector("[data-typeahead-example-result-option]")
|
46
|
+
|
47
|
+
event.detail.setResults((result.items || []).map((user) => {
|
48
|
+
const wrapper = resultOptionTemplate.content.cloneNode(true)
|
49
|
+
wrapper.querySelector('slot[name="name"]').replaceWith(user.login)
|
50
|
+
wrapper.querySelector('img').dataset.src = user.avatar_url
|
51
|
+
return wrapper
|
52
|
+
}))
|
53
|
+
})
|
24
54
|
})
|
25
|
-
|
26
|
-
|
55
|
+
|
56
|
+
|
57
|
+
document.addEventListener("pb-typeahead-kit-result-option-selected", function(event) {
|
58
|
+
if (!event.target.dataset.typeaheadExample) return;
|
59
|
+
|
60
|
+
document.querySelector("[data-typeahead-example-selected-option] [data-selected-option]").innerHTML = ""
|
61
|
+
document.querySelector("[data-typeahead-example-selected-option] [data-selected-option]").innerHTML = event.detail.selected.innerHTML
|
27
62
|
})
|
28
63
|
<% end %>
|
@@ -47,6 +47,8 @@ const promiseOptions = (inputValue) =>
|
|
47
47
|
|
48
48
|
const TypeaheadWithPillsAsync = (props) => {
|
49
49
|
const [users, setUsers] = useState([])
|
50
|
+
const handleOnChange = (value) => setUsers(formatUsers(value))
|
51
|
+
const formatValue = (users) => formatUsers(users)
|
50
52
|
const formatUsers = (users) => {
|
51
53
|
const results = () => (users.map((user) => {
|
52
54
|
if (Object.keys(user)[0] === 'name' || Object.keys(user)[1] === 'id'){
|
@@ -57,8 +59,6 @@ const TypeaheadWithPillsAsync = (props) => {
|
|
57
59
|
}))
|
58
60
|
return results()
|
59
61
|
}
|
60
|
-
const handleOnChange = (value) => setUsers(formatUsers(value))
|
61
|
-
const formatValue = (users) => formatUsers(users)
|
62
62
|
|
63
63
|
return (
|
64
64
|
<>
|