playbook_ui_docs 13.25.0.pre.alpha.PBNTR291Dropdownrailsv22812 → 13.25.0.pre.alpha.PLAY761globalpaddingpropsbuttons2713
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_checkbox/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_checkbox/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_currency/docs/example.yml +0 -5
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_on_change.md +1 -3
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_on_close.md +1 -3
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_range_limit.md +1 -1
- data/app/pb_kits/playbook/pb_date_range_stacked/docs/example.yml +0 -4
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_default.jsx +22 -4
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_display.jsx +4 -6
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_options.jsx +9 -6
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_trigger.jsx +5 -5
- data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +2 -16
- data/app/pb_kits/playbook/pb_dropdown/docs/index.js +0 -7
- data/app/pb_kits/playbook/pb_progress_simple/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_progress_simple/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_radio/docs/_radio_alignment.jsx +1 -4
- data/app/pb_kits/playbook/pb_radio/docs/_radio_default.jsx +1 -4
- data/app/pb_kits/playbook/pb_radio/docs/_radio_error.jsx +1 -2
- data/app/pb_kits/playbook/pb_radio/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_radio/docs/index.js +0 -1
- data/dist/playbook-doc.js +7 -7
- metadata +2 -37
- data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_disabled.html.erb +0 -23
- data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_disabled.jsx +0 -29
- data/app/pb_kits/playbook/pb_currency/docs/_currency_alignment_swift.md +0 -43
- data/app/pb_kits/playbook/pb_currency/docs/_currency_props_swift.md +0 -12
- data/app/pb_kits/playbook/pb_currency/docs/_currency_size_swift.md +0 -31
- data/app/pb_kits/playbook/pb_date_range_stacked/docs/_date_range_stacked_default_swift.md +0 -14
- data/app/pb_kits/playbook/pb_date_range_stacked/docs/_date_range_stacked_props_swift.md +0 -9
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_default.html.erb +0 -10
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_default.md +0 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subcomponent_structure.html.erb +0 -17
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subcomponent_structure.jsx +0 -42
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subcomponent_structure.md +0 -7
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete.jsx +0 -84
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete.md +0 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete_and_custom_display.jsx +0 -101
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete_and_custom_display.md +0 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_display.html.erb +0 -60
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_display.md +0 -5
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_options.html.erb +0 -45
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_options.md +0 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_padding.html.erb +0 -17
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_padding.jsx +0 -48
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_padding.md +0 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_trigger.html.erb +0 -47
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_trigger.md +0 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_external_control.jsx +0 -59
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_hook.jsx +0 -72
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_label.html.erb +0 -10
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_label.jsx +0 -39
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_label.md +0 -1
- data/app/pb_kits/playbook/pb_progress_simple/docs/_progress_simple_flex.html.erb +0 -3
- data/app/pb_kits/playbook/pb_progress_simple/docs/_progress_simple_flex.jsx +0 -16
- data/app/pb_kits/playbook/pb_progress_simple/docs/_progress_simple_flex.md +0 -1
- data/app/pb_kits/playbook/pb_radio/docs/_radio_disabled.html.erb +0 -26
- data/app/pb_kits/playbook/pb_radio/docs/_radio_disabled.jsx +0 -31
@@ -1,17 +0,0 @@
|
|
1
|
-
<%
|
2
|
-
options = [
|
3
|
-
{ label: 'United States', value: 'United States', id: 'us' },
|
4
|
-
{ label: 'Canada', value: 'Canada', id: 'ca' },
|
5
|
-
{ label: 'Pakistan', value: 'Pakistan', id: 'pk' },
|
6
|
-
]
|
7
|
-
|
8
|
-
%>
|
9
|
-
|
10
|
-
<%= pb_rails("dropdown", props: {options: options}) do %>
|
11
|
-
<%= pb_rails("dropdown/dropdown_trigger") %>
|
12
|
-
<%= pb_rails("dropdown/dropdown_container") do %>
|
13
|
-
<% options.each do |option| %>
|
14
|
-
<%= pb_rails("dropdown/dropdown_option", props: {option: option, padding:"sm"}) %>
|
15
|
-
<% end %>
|
16
|
-
<% end %>
|
17
|
-
<% end %>
|
@@ -1,48 +0,0 @@
|
|
1
|
-
import React from 'react'
|
2
|
-
import { Dropdown } from '../..'
|
3
|
-
|
4
|
-
const DropdownWithCustomPadding = (props) => {
|
5
|
-
|
6
|
-
const options = [
|
7
|
-
{
|
8
|
-
label: "United States",
|
9
|
-
value: "United States",
|
10
|
-
areaCode: "+1",
|
11
|
-
icon: "🇺🇸",
|
12
|
-
id: "United-states"
|
13
|
-
},
|
14
|
-
{
|
15
|
-
label: "Canada",
|
16
|
-
value: "Canada",
|
17
|
-
areaCode: "+1",
|
18
|
-
icon: "🇨🇦",
|
19
|
-
id: "canada"
|
20
|
-
},
|
21
|
-
{
|
22
|
-
label: "Pakistan",
|
23
|
-
value: "Pakistan",
|
24
|
-
areaCode: "+92",
|
25
|
-
icon: "🇵🇰",
|
26
|
-
id: "pakistan"
|
27
|
-
}
|
28
|
-
];
|
29
|
-
|
30
|
-
|
31
|
-
return (
|
32
|
-
<div>
|
33
|
-
<Dropdown
|
34
|
-
options={options}
|
35
|
-
{...props}
|
36
|
-
>
|
37
|
-
{options.map((option) => (
|
38
|
-
<Dropdown.Option key={option.id}
|
39
|
-
option={option}
|
40
|
-
padding="sm"
|
41
|
-
/>
|
42
|
-
))}
|
43
|
-
</Dropdown>
|
44
|
-
</div>
|
45
|
-
)
|
46
|
-
}
|
47
|
-
|
48
|
-
export default DropdownWithCustomPadding
|
@@ -1 +0,0 @@
|
|
1
|
-
By default, the padding on each option in the dropdown is set to `xs`. The `padding` Global Props however can be used to override this default. In this example, we are setting padding to `sm`.
|
@@ -1,47 +0,0 @@
|
|
1
|
-
<%
|
2
|
-
options = [
|
3
|
-
{
|
4
|
-
label: "United States",
|
5
|
-
value: "United States",
|
6
|
-
areaCode: "+1",
|
7
|
-
icon: "🇺🇸",
|
8
|
-
id: "us"
|
9
|
-
},
|
10
|
-
{
|
11
|
-
label: "Canada",
|
12
|
-
value: "Canada",
|
13
|
-
areaCode: "+1",
|
14
|
-
icon: "🇨🇦",
|
15
|
-
id: "ca"
|
16
|
-
},
|
17
|
-
{
|
18
|
-
label: "Pakistan",
|
19
|
-
value: "Pakistan",
|
20
|
-
areaCode: "+92",
|
21
|
-
icon: "🇵🇰",
|
22
|
-
id: "pk"
|
23
|
-
}
|
24
|
-
]
|
25
|
-
|
26
|
-
%>
|
27
|
-
|
28
|
-
<%= pb_rails("dropdown", props: {options: options}) do %>
|
29
|
-
<%= pb_rails("dropdown/dropdown_trigger") do %>
|
30
|
-
<%= pb_rails("icon_circle", props: {icon:"flag", cursor: "pointer", variant:"royal"}) %>
|
31
|
-
<% end %>
|
32
|
-
<%= pb_rails("dropdown/dropdown_container", props:{max_width:"xs"}) do %>
|
33
|
-
<% options.each do |option| %>
|
34
|
-
<%= pb_rails("dropdown/dropdown_option", props: {option: option}) do %>
|
35
|
-
<%= pb_rails("flex/flex_item") do %>
|
36
|
-
<%= pb_rails("flex") do %>
|
37
|
-
<%= pb_rails("icon", props: {icon: option[:icon]}) %>
|
38
|
-
<%= pb_rails("body", props: {text: option[:label], padding_left:"xs"}) %>
|
39
|
-
<% end %>
|
40
|
-
<% end %>
|
41
|
-
<%= pb_rails("flex/flex_item") do %>
|
42
|
-
<%= pb_rails("body", props: {color:"light", text: option[:areaCode]}) %>
|
43
|
-
<% end %>
|
44
|
-
<% end %>
|
45
|
-
<% end %>
|
46
|
-
<% end %>
|
47
|
-
<% end %>
|
@@ -1 +0,0 @@
|
|
1
|
-
The Dropdown can also be given a custom Trigger by passing children to the `Dropdown.Trigger` subcomponent as shown in this example. Here we are using the IconCircle kit.
|
@@ -1,59 +0,0 @@
|
|
1
|
-
import React from 'react'
|
2
|
-
import { Dropdown, useDropdown, Button } from '../../'
|
3
|
-
|
4
|
-
const DropdownWithExternalControl = (props) => {
|
5
|
-
const [isDropDownClosed, setIsDropdownClosed] = useDropdown(true);
|
6
|
-
|
7
|
-
const options = [
|
8
|
-
{
|
9
|
-
label: "United States",
|
10
|
-
value: "United States",
|
11
|
-
areaCode: "+1",
|
12
|
-
icon: "🇺🇸",
|
13
|
-
id: "United-states"
|
14
|
-
},
|
15
|
-
{
|
16
|
-
label: "Canada",
|
17
|
-
value: "Canada",
|
18
|
-
areaCode: "+1",
|
19
|
-
icon: "🇨🇦",
|
20
|
-
id: "canada"
|
21
|
-
},
|
22
|
-
{
|
23
|
-
label: "Pakistan",
|
24
|
-
value: "Pakistan",
|
25
|
-
areaCode: "+92",
|
26
|
-
icon: "🇵🇰",
|
27
|
-
id: "pakistan"
|
28
|
-
}
|
29
|
-
];
|
30
|
-
|
31
|
-
return (
|
32
|
-
<div>
|
33
|
-
<Button
|
34
|
-
data={{dropdown:'pb-dropdown-trigger'}}
|
35
|
-
marginBottom='sm'
|
36
|
-
onClick={() => setIsDropdownClosed(!isDropDownClosed)}
|
37
|
-
padding="none"
|
38
|
-
tabIndex={0}
|
39
|
-
variant="link"
|
40
|
-
>
|
41
|
-
{isDropDownClosed ? "Open Dropdown" : "Close Dropdown"}
|
42
|
-
</Button>
|
43
|
-
|
44
|
-
<Dropdown
|
45
|
-
isClosed={isDropDownClosed}
|
46
|
-
options={options}
|
47
|
-
{...props}
|
48
|
-
>
|
49
|
-
{options.map((option) => (
|
50
|
-
<Dropdown.Option key={option.id}
|
51
|
-
option={option}
|
52
|
-
/>
|
53
|
-
))}
|
54
|
-
</Dropdown>
|
55
|
-
</div>
|
56
|
-
)
|
57
|
-
}
|
58
|
-
|
59
|
-
export default DropdownWithExternalControl
|
@@ -1,72 +0,0 @@
|
|
1
|
-
import React, { useRef } from 'react'
|
2
|
-
import { Dropdown, useDropdown, CircleIconButton, Icon, Body, FlexItem, Flex } from '../..'
|
3
|
-
|
4
|
-
const DropdownWithHook = (props) => {
|
5
|
-
const [isDropDownClosed, setIsDropdownClosed] = useDropdown(true);
|
6
|
-
const buttonRef = useRef(null);
|
7
|
-
|
8
|
-
const options = [
|
9
|
-
{
|
10
|
-
label: "United States",
|
11
|
-
value: "United States",
|
12
|
-
areaCode: "+1",
|
13
|
-
icon: "🇺🇸",
|
14
|
-
id: "United-states"
|
15
|
-
},
|
16
|
-
{
|
17
|
-
label: "Canada",
|
18
|
-
value: "Canada",
|
19
|
-
areaCode: "+1",
|
20
|
-
icon: "🇨🇦",
|
21
|
-
id: "canada"
|
22
|
-
},
|
23
|
-
{
|
24
|
-
label: "Pakistan",
|
25
|
-
value: "Pakistan",
|
26
|
-
areaCode: "+92",
|
27
|
-
icon: "🇵🇰",
|
28
|
-
id: "pakistan"
|
29
|
-
}
|
30
|
-
];
|
31
|
-
|
32
|
-
return (
|
33
|
-
<div>
|
34
|
-
<CircleIconButton
|
35
|
-
htmlOptions={{ref: buttonRef}}
|
36
|
-
icon={"flag"}
|
37
|
-
onClick={() => setIsDropdownClosed(!isDropDownClosed)}
|
38
|
-
variant="secondary"
|
39
|
-
/>
|
40
|
-
<Dropdown
|
41
|
-
isClosed={isDropDownClosed}
|
42
|
-
options={options}
|
43
|
-
triggerRef={buttonRef}
|
44
|
-
{...props}
|
45
|
-
>
|
46
|
-
{options.map((option) => (
|
47
|
-
<Dropdown.Option key={option.id}
|
48
|
-
option={option}
|
49
|
-
>
|
50
|
-
<>
|
51
|
-
<FlexItem>
|
52
|
-
<Flex paddingRight='md'>
|
53
|
-
<Icon icon={option.icon}
|
54
|
-
paddingRight="xs"
|
55
|
-
/>
|
56
|
-
<Body text={option.label} />
|
57
|
-
</Flex>
|
58
|
-
</FlexItem>
|
59
|
-
<FlexItem>
|
60
|
-
<Body color="light"
|
61
|
-
text={option.areaCode}
|
62
|
-
/>
|
63
|
-
</FlexItem>
|
64
|
-
</>
|
65
|
-
</Dropdown.Option>
|
66
|
-
))}
|
67
|
-
</Dropdown>
|
68
|
-
</div>
|
69
|
-
)
|
70
|
-
}
|
71
|
-
|
72
|
-
export default DropdownWithHook
|
@@ -1,10 +0,0 @@
|
|
1
|
-
<%
|
2
|
-
options = [
|
3
|
-
{ label: 'United States', value: 'United States', id: 'us' },
|
4
|
-
{ label: 'Canada', value: 'Canada', id: 'ca' },
|
5
|
-
{ label: 'Pakistan', value: 'Pakistan', id: 'pk' },
|
6
|
-
]
|
7
|
-
|
8
|
-
%>
|
9
|
-
|
10
|
-
<%= pb_rails("dropdown", props: {options: options, label: "Select a Country"}) %>
|
@@ -1,39 +0,0 @@
|
|
1
|
-
import React from 'react'
|
2
|
-
import { Dropdown } from '../..'
|
3
|
-
|
4
|
-
const DropdownDefault = (props) => {
|
5
|
-
|
6
|
-
const options = [
|
7
|
-
{
|
8
|
-
label: "United States",
|
9
|
-
value: "United States",
|
10
|
-
},
|
11
|
-
{
|
12
|
-
label: "Canada",
|
13
|
-
value: "Canada",
|
14
|
-
},
|
15
|
-
{
|
16
|
-
label: "Pakistan",
|
17
|
-
value: "Pakistan",
|
18
|
-
}
|
19
|
-
];
|
20
|
-
|
21
|
-
|
22
|
-
return (
|
23
|
-
<div>
|
24
|
-
<Dropdown
|
25
|
-
label="Select a Country"
|
26
|
-
options={options}
|
27
|
-
{...props}
|
28
|
-
>
|
29
|
-
{options.map((option) => (
|
30
|
-
<Dropdown.Option key={option.id}
|
31
|
-
option={option}
|
32
|
-
/>
|
33
|
-
))}
|
34
|
-
</Dropdown>
|
35
|
-
</div>
|
36
|
-
)
|
37
|
-
}
|
38
|
-
|
39
|
-
export default DropdownDefault
|
@@ -1 +0,0 @@
|
|
1
|
-
The optional `label` prop takes a string value that if present will render that string as the label for the Dropdown.
|
@@ -1,16 +0,0 @@
|
|
1
|
-
import React from 'react'
|
2
|
-
import { Flex, ProgressSimple } from '../..'
|
3
|
-
|
4
|
-
const ProgressSimpleFlex = () => {
|
5
|
-
return (
|
6
|
-
<Flex>
|
7
|
-
<ProgressSimple
|
8
|
-
align="left"
|
9
|
-
flex="1"
|
10
|
-
percent={68}
|
11
|
-
/>
|
12
|
-
</Flex>
|
13
|
-
)
|
14
|
-
}
|
15
|
-
|
16
|
-
export default ProgressSimpleFlex
|
@@ -1 +0,0 @@
|
|
1
|
-
When rendering a Progress Simple through within a Flex container, you must pass `flex="1"` to the kit itself so that it fills the available space
|
@@ -1,26 +0,0 @@
|
|
1
|
-
<%= pb_rails("flex", props: {orientation: "column"}) do %>
|
2
|
-
<%= pb_rails("flex/flex_item") do %>
|
3
|
-
<%= pb_rails("radio", props: {
|
4
|
-
text: "Disabled unselected",
|
5
|
-
input_options: {
|
6
|
-
tabindex: 0,
|
7
|
-
disabled: true,
|
8
|
-
},
|
9
|
-
margin_bottom: "xs",
|
10
|
-
name: "DisabledGroup",
|
11
|
-
value: "Disabled unselected",
|
12
|
-
}) %>
|
13
|
-
<% end %>
|
14
|
-
<%= pb_rails("flex/flex_item") do %>
|
15
|
-
<%= pb_rails("radio", props: {
|
16
|
-
text: "Disabled selected",
|
17
|
-
input_options: {
|
18
|
-
tabindex: 0,
|
19
|
-
disabled: true,
|
20
|
-
},
|
21
|
-
checked: true,
|
22
|
-
name: "DisabledGroup",
|
23
|
-
value: "Disabled selected"
|
24
|
-
}) %>
|
25
|
-
<% end %>
|
26
|
-
<% end %>
|
@@ -1,31 +0,0 @@
|
|
1
|
-
import React from 'react'
|
2
|
-
|
3
|
-
import Radio from '../_radio'
|
4
|
-
|
5
|
-
const RadioDisabled = (props) => {
|
6
|
-
const ref = React.createRef()
|
7
|
-
|
8
|
-
return (
|
9
|
-
<div style={{ display: "flex", flexDirection: "column" }}>
|
10
|
-
<Radio
|
11
|
-
disabled
|
12
|
-
label="Disabled unselected"
|
13
|
-
marginBottom="xs"
|
14
|
-
name="DisabledGroup"
|
15
|
-
ref={ref}
|
16
|
-
tabIndex={0}
|
17
|
-
value="Disabled unselected"
|
18
|
-
{...props}
|
19
|
-
/>
|
20
|
-
<Radio
|
21
|
-
checked
|
22
|
-
disabled
|
23
|
-
label="Disabled selected"
|
24
|
-
name="DisabledGroup"
|
25
|
-
value="Disabled selected"
|
26
|
-
{...props}
|
27
|
-
/>
|
28
|
-
</div>
|
29
|
-
)
|
30
|
-
}
|
31
|
-
export default RadioDisabled
|