playbook_ui 14.13.0.pre.alpha.play1852reacthookformsupportradio6153 → 14.13.0.pre.alpha.play1884progresspill6064
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/pb_bar_graph/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_bar_graph/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +1 -3
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_table.html.erb +2 -2
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_table.md +1 -4
- data/app/pb_kits/playbook/pb_draggable/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_draggable/docs/index.js +1 -2
- data/app/pb_kits/playbook/pb_draggable/subcomponents/DraggableContainer.tsx +4 -7
- data/app/pb_kits/playbook/pb_draggable/subcomponents/DraggableItem.tsx +3 -6
- data/app/pb_kits/playbook/pb_multi_level_select/multi_level_select.html.erb +6 -1
- data/app/pb_kits/playbook/pb_nav/item.html.erb +19 -7
- data/app/pb_kits/playbook/pb_nav/nav.html.erb +8 -3
- data/app/pb_kits/playbook/pb_online_status/online_status.html.erb +6 -1
- data/app/pb_kits/playbook/pb_popover/popover.html.erb +6 -1
- data/app/pb_kits/playbook/pb_progress_pills/_progress_pills.scss +2 -1
- data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_default.html.erb +1 -0
- data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_default.jsx +7 -0
- data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_default.md +1 -0
- data/app/pb_kits/playbook/pb_radio/_radio.tsx +73 -85
- data/app/pb_kits/playbook/pb_radio/docs/example.yml +1 -2
- data/app/pb_kits/playbook/pb_radio/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_radio/radio.test.js +0 -16
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible.jsx +1 -1
- data/app/pb_kits/playbook/pb_table/docs/example.yml +1 -4
- data/app/pb_kits/playbook/pb_table/docs/index.js +1 -2
- data/app/pb_kits/playbook/pb_table/index.ts +9 -41
- data/app/pb_kits/playbook/pb_table/styles/_collapsible.scss +0 -4
- data/app/pb_kits/playbook/pb_table/subcomponents/_table_body.tsx +2 -29
- data/app/pb_kits/playbook/pb_table/subcomponents/_table_row.tsx +3 -31
- data/app/pb_kits/playbook/pb_table/table_body.html.erb +7 -13
- data/app/pb_kits/playbook/pb_table/table_body.rb +0 -2
- data/app/pb_kits/playbook/pb_table/table_row.html.erb +7 -14
- data/app/pb_kits/playbook/pb_table/table_row.rb +1 -14
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_mask.html.erb +0 -14
- data/app/pb_kits/playbook/pb_text_input/index.js +0 -9
- data/app/pb_kits/playbook/pb_text_input/text_input.rb +2 -5
- data/dist/chunks/_typeahead-btjo1UN5.js +36 -0
- data/dist/chunks/_weekday_stacked-TIh9nTmZ.js +45 -0
- data/dist/chunks/{lib-D3us1bGD.js → lib-DjpLC8uO.js} +2 -2
- data/dist/chunks/{pb_form_validation-BpihMSOQ.js → pb_form_validation-S56UaHZl.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- 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/version.rb +1 -1
- metadata +8 -19
- data/app/pb_kits/playbook/pb_bar_graph/BarGraphStyles.scss +0 -58
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_pb_styles.jsx +0 -64
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_pb_styles.md +0 -1
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_table_react.jsx +0 -90
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_table_react.md +0 -5
- data/app/pb_kits/playbook/pb_radio/docs/_radio_react_hook.jsx +0 -60
- data/app/pb_kits/playbook/pb_radio/docs/_radio_react_hook.md +0 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_click.html.erb +0 -51
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_click_rails.md +0 -2
- data/app/pb_kits/playbook/pb_table/docs/_table_with_selectable_rows.html.erb +0 -96
- data/app/pb_kits/playbook/pb_table/docs/_table_with_selectable_rows.jsx +0 -101
- data/app/pb_kits/playbook/pb_table/docs/_table_with_selectable_rows.md +0 -1
- data/dist/chunks/_typeahead-B7kfgseZ.js +0 -36
- data/dist/chunks/_weekday_stacked-CQggx3_W.js +0 -45
- /data/app/pb_kits/playbook/pb_table/docs/{_table_with_collapsible_with_custom_click_react.md → _table_with_collapsible_with_custom_click.md} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 21317a1c7d5325bd88ac09a06b74859e30a5fcf6748c6b4b710c500189733796
|
4
|
+
data.tar.gz: 0f6e8ac0625c5ba45989ab65b84603c15e777699e9726e2a7769d6e2aa57dd5e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a7555df6aeccfb138dd8a45ff0a86b1e1843ba3ae6640a29d27899f2a9972b717f26cda50b79da966a5681b5eea56394f0a97823b165e27194add95c3e892158
|
7
|
+
data.tar.gz: 275833538e43720396649195b958886d4d4cca24f5b9e8e977fc1b7ec520d6e1151665de6d02086b11e05c45414f2b9c03d941df3fd43ad2fcd78ce403f4472b
|
@@ -10,4 +10,3 @@ export { default as BarGraphStacked } from './_bar_graph_stacked.jsx'
|
|
10
10
|
export { default as BarGraphNegativeNumbers } from './_bar_graph_negative_numbers.jsx'
|
11
11
|
export { default as BarGraphSecondaryYAxis } from './_bar_graph_secondary_y_axis.jsx'
|
12
12
|
export { default as BarGraphHorizontal } from './_bar_graph_horizontal.jsx'
|
13
|
-
export { default as BarGraphPbStyles } from './_bar_graph_pb_styles.jsx'
|
@@ -29,7 +29,6 @@ type DatePickerProps = {
|
|
29
29
|
hideLabel?: boolean,
|
30
30
|
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
31
31
|
id?: string,
|
32
|
-
initializeOnce?: boolean,
|
33
32
|
inLine?: boolean,
|
34
33
|
inputAria?: { [key: string]: string },
|
35
34
|
inputData?: { [key: string]: string },
|
@@ -74,7 +73,6 @@ const DatePicker = (props: DatePickerProps): React.ReactElement => {
|
|
74
73
|
hideLabel = false,
|
75
74
|
htmlOptions = {},
|
76
75
|
id,
|
77
|
-
initializeOnce = false,
|
78
76
|
inLine = false,
|
79
77
|
inputAria = {},
|
80
78
|
inputData = {},
|
@@ -136,7 +134,7 @@ useEffect(() => {
|
|
136
134
|
yearRange,
|
137
135
|
required: false,
|
138
136
|
}, scrollContainer)
|
139
|
-
}
|
137
|
+
})
|
140
138
|
const filteredProps = {...props}
|
141
139
|
if (filteredProps.marginBottom === undefined) {
|
142
140
|
filteredProps.marginBottom = "sm"
|
@@ -43,9 +43,9 @@
|
|
43
43
|
<% end %>
|
44
44
|
<% end %>
|
45
45
|
|
46
|
-
<%= pb_rails("
|
46
|
+
<%= pb_rails("draggable/draggable_container", props: {tag:"tbody"}) do %>
|
47
47
|
<% initial_items.each do |item| %>
|
48
|
-
<%= pb_rails("
|
48
|
+
<%= pb_rails("draggable/draggable_item", props:{drag_id: item[:id], tag:"tr"}) do %>
|
49
49
|
<%= pb_rails("table/table_cell", props: { text: item[:id]}) %>
|
50
50
|
<%= pb_rails("table/table_cell") do %>
|
51
51
|
<%= pb_rails("flex", props:{align:"center"}) do %>
|
@@ -1,4 +1 @@
|
|
1
|
-
The draggable kit can also be used in conjunction with the table kit to create draggable table rows. To do this
|
2
|
-
|
3
|
-
- use the `draggable_container` prop on the table/table_body to designate it as the Draggable Container
|
4
|
-
- use the `draggable_item` prop on the table/table_row to designate it as the Draggable Item. Make sure to also pass id to the `drag_id` prop here.
|
1
|
+
The draggable kit can also be used in conjunction with the table kit to create draggable table rows. To do this, make use of the `tag` prop on the draggable_container to set it to 'tbody' and the same prop on the draggable_item to set that to 'tr'. This will create the functionality seen here.
|
@@ -4,9 +4,7 @@ examples:
|
|
4
4
|
- draggable_with_list: Draggable with List Kit
|
5
5
|
- draggable_with_selectable_list: Draggable with SelectableList Kit
|
6
6
|
- draggable_with_cards: Draggable with Cards
|
7
|
-
- draggable_with_table_react: Draggable with Table
|
8
7
|
- draggable_multiple_containers: Dragging Across Multiple Containers
|
9
|
-
|
10
8
|
rails:
|
11
9
|
- draggable_default_rails: Default
|
12
10
|
- draggable_with_list_rails: Draggable with List Kit
|
@@ -2,5 +2,4 @@ export { default as DraggableDefault } from './_draggable_default.jsx'
|
|
2
2
|
export { default as DraggableWithCards } from './_draggable_with_cards.jsx'
|
3
3
|
export { default as DraggableWithList } from './_draggable_with_list.jsx'
|
4
4
|
export { default as DraggableWithSelectableList } from './_draggable_with_selectable_list.jsx'
|
5
|
-
export { default as DraggableMultipleContainers } from './_draggable_multiple_containers.jsx'
|
6
|
-
export { default as DraggableWithTableReact } from './_draggable_with_table_react.jsx'
|
5
|
+
export { default as DraggableMultipleContainers } from './_draggable_multiple_containers.jsx'
|
@@ -17,11 +17,10 @@ type DraggableContainerProps = {
|
|
17
17
|
data?: { [key: string]: string };
|
18
18
|
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
19
19
|
id?: string;
|
20
|
-
tag?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span' | 'div' | 'tr' | 'th' | 'td' | 'thead' | 'col' | 'tbody',
|
21
20
|
};
|
22
21
|
|
23
22
|
const DraggableContainer = (props: DraggableContainerProps) => {
|
24
|
-
const { aria = {}, children, className, container, data = {}, htmlOptions = {}, id
|
23
|
+
const { aria = {}, children, className, container, data = {}, htmlOptions = {}, id } = props;
|
25
24
|
|
26
25
|
const { handleDragOver, handleDrop, activeContainer } = DraggableContext();
|
27
26
|
|
@@ -29,8 +28,6 @@ const DraggableContainer = (props: DraggableContainerProps) => {
|
|
29
28
|
const dataProps = buildDataProps(data);
|
30
29
|
const htmlProps = buildHtmlProps(htmlOptions);
|
31
30
|
|
32
|
-
const Tag: React.ReactElement | any = `${tag}`;
|
33
|
-
|
34
31
|
const classes = classnames(
|
35
32
|
buildCss("pb_draggable_container"),
|
36
33
|
`${activeContainer === container ? "active" : ""}`,
|
@@ -39,18 +36,18 @@ const DraggableContainer = (props: DraggableContainerProps) => {
|
|
39
36
|
);
|
40
37
|
|
41
38
|
return (
|
42
|
-
<
|
39
|
+
<div
|
43
40
|
{...ariaProps}
|
44
41
|
{...dataProps}
|
45
42
|
{...htmlProps}
|
46
43
|
className={classes}
|
47
44
|
id={id}
|
48
45
|
key={container}
|
49
|
-
onDragOver={(e
|
46
|
+
onDragOver={(e) => handleDragOver(e, container)}
|
50
47
|
onDrop={() => handleDrop(container)}
|
51
48
|
>
|
52
49
|
{children}
|
53
|
-
</
|
50
|
+
</div>
|
54
51
|
);
|
55
52
|
};
|
56
53
|
|
@@ -18,11 +18,10 @@ type DraggableItemProps = {
|
|
18
18
|
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
19
19
|
id?: string;
|
20
20
|
dragId?: string;
|
21
|
-
tag?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span' | 'div' | 'tr' | 'th' | 'td' | 'thead' | 'col' | 'tbody',
|
22
21
|
};
|
23
22
|
|
24
23
|
const DraggableItem = (props: DraggableItemProps) => {
|
25
|
-
const { aria = {}, children, className, container, data = {}, htmlOptions = {}, id, dragId
|
24
|
+
const { aria = {}, children, className, container, data = {}, htmlOptions = {}, id, dragId } = props;
|
26
25
|
|
27
26
|
const { isDragging, handleDragStart, handleDragEnter, handleDragEnd } =
|
28
27
|
DraggableContext();
|
@@ -31,8 +30,6 @@ const DraggableItem = (props: DraggableItemProps) => {
|
|
31
30
|
const dataProps = buildDataProps(data);
|
32
31
|
const htmlProps = buildHtmlProps(htmlOptions);
|
33
32
|
|
34
|
-
const Tag: React.ReactElement | any = `${tag}`;
|
35
|
-
|
36
33
|
const classes = classnames(
|
37
34
|
buildCss("pb_draggable_item"),
|
38
35
|
`${isDragging === dragId ? "is_dragging" : ""}`,
|
@@ -41,7 +38,7 @@ const DraggableItem = (props: DraggableItemProps) => {
|
|
41
38
|
);
|
42
39
|
|
43
40
|
return (
|
44
|
-
<
|
41
|
+
<div
|
45
42
|
{...ariaProps}
|
46
43
|
{...dataProps}
|
47
44
|
{...htmlProps}
|
@@ -54,7 +51,7 @@ const DraggableItem = (props: DraggableItemProps) => {
|
|
54
51
|
onDragStart={() => handleDragStart(dragId, container)}
|
55
52
|
>
|
56
53
|
{children}
|
57
|
-
</
|
54
|
+
</div>
|
58
55
|
);
|
59
56
|
};
|
60
57
|
|
@@ -1,9 +1,15 @@
|
|
1
1
|
<% if object.collapsible %>
|
2
2
|
<%= pb_rails("collapsible", props: { name: "collapsible-nav-example", classname: object.collapsible_nav_classname }) do %>
|
3
3
|
<%= pb_rails("collapsible/collapsible_main", props: { name: "default-collapsible-nav", icon: object.collapsible_icons, size: "xs", dark: object.dark, classname:object.margin_classes }) do %>
|
4
|
-
<%=
|
5
|
-
|
6
|
-
|
4
|
+
<%= content_tag(object.tag,
|
5
|
+
aria: object.aria,
|
6
|
+
class: object.classname,
|
7
|
+
data: object.data,
|
8
|
+
dark: object.dark,
|
9
|
+
id: object.id,
|
10
|
+
href: object.link && object.link,
|
11
|
+
target: object.link && object.target,
|
12
|
+
**combined_html_options
|
7
13
|
) do %>
|
8
14
|
<% if object.image_url %>
|
9
15
|
<%= pb_rails("image", props: { url: object.image_url, classname: "pb_nav_img_wrapper_collapsible" }) %>
|
@@ -14,16 +20,22 @@
|
|
14
20
|
<span class="pb_nav_list_item_text_collapsible">
|
15
21
|
<%= object.text %>
|
16
22
|
</span>
|
17
|
-
<% end %>
|
23
|
+
<% end %>
|
18
24
|
<% end %>
|
19
25
|
<%= pb_rails("collapsible/collapsible_content", props: {collapsed: object.collapsed}) do %>
|
20
26
|
<%= content.presence %>
|
21
27
|
<% end %>
|
22
28
|
<% end %>
|
23
29
|
<% else %>
|
24
|
-
<%=
|
25
|
-
|
26
|
-
|
30
|
+
<%= content_tag(object.tag,
|
31
|
+
aria: object.aria,
|
32
|
+
class: object.classname,
|
33
|
+
**combined_html_options,
|
34
|
+
data: object.data,
|
35
|
+
dark: object.dark,
|
36
|
+
id: object.id,
|
37
|
+
href: object.link && object.link,
|
38
|
+
target: object.link && object.target
|
27
39
|
) do %>
|
28
40
|
<% if object.image_url %>
|
29
41
|
<%= pb_rails("image", props: { url: object.image_url, classname: "pb_nav_img_wrapper" }) %>
|
@@ -1,7 +1,12 @@
|
|
1
|
-
<%=
|
1
|
+
<%= content_tag(:nav,
|
2
|
+
aria: object.aria,
|
3
|
+
class: object.classname,
|
4
|
+
data: object.data,
|
5
|
+
id: object.id,
|
6
|
+
**combined_html_options) do %>
|
2
7
|
<% if object.title %>
|
3
|
-
<%=
|
4
|
-
<%=
|
8
|
+
<%= content_tag(:div, class: "pb_nav_list_title") do %>
|
9
|
+
<%= content_tag(:a, class: "pb_nav_list_item_link_text", href: object.link) do %>
|
5
10
|
<%= pb_rails("caption", props: { text: object.title, dark: dark }) %>
|
6
11
|
<% end %>
|
7
12
|
<% end %>
|
@@ -1,4 +1,9 @@
|
|
1
|
-
<%=
|
1
|
+
<%= content_tag(:div,
|
2
|
+
aria: object.aria,
|
3
|
+
class: object.classname,
|
4
|
+
data: object.data,
|
5
|
+
id: object.id,
|
6
|
+
**combined_html_options) do %>
|
2
7
|
<div class="pb_popover_tooltip hide" id="<%= object.tooltip_id %>" role="tooltip" style="<%= object.z_index_helper %>">
|
3
8
|
<div class="pb_popover_body <%= object.width_height_class_helper %> <%= object.popover_spacing_helper %>" style="<%= object.width_height_helper %>">
|
4
9
|
<%= content.presence %>
|
@@ -0,0 +1 @@
|
|
1
|
+
Progress pills start at `45px` wide if the container allows, but will shrink down to `1px` as the container gets smaller. Resize this window to see each pill shrink.
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
/*eslint-disable react/no-multi-comp */
|
2
|
+
|
3
|
+
import React, { forwardRef, useRef } from 'react'
|
2
4
|
import Body from '../pb_body/_body'
|
3
5
|
import Flex from '../pb_flex/_flex'
|
4
6
|
import classnames from 'classnames'
|
@@ -22,10 +24,10 @@ type RadioProps = {
|
|
22
24
|
name?: string,
|
23
25
|
value?: string,
|
24
26
|
text?: string,
|
25
|
-
onChange
|
27
|
+
onChange: (event: React.FormEvent<HTMLInputElement> | null) => void,
|
26
28
|
} & GlobalProps
|
27
29
|
|
28
|
-
const Radio =
|
30
|
+
const Radio = ({
|
29
31
|
aria = {},
|
30
32
|
alignment,
|
31
33
|
children,
|
@@ -41,124 +43,110 @@ const Radio = forwardRef<HTMLInputElement, RadioProps>(({
|
|
41
43
|
name = 'radio_name',
|
42
44
|
text = 'Radio Text',
|
43
45
|
value = 'radio_text',
|
44
|
-
checked = false,
|
45
46
|
onChange = () => { void 0 },
|
46
47
|
...props
|
47
|
-
}, ref) => {
|
48
|
-
const
|
49
|
-
const setRefs = (el: HTMLInputElement) => {
|
50
|
-
internalRef.current = el
|
51
|
-
if (typeof ref === 'function') {
|
52
|
-
ref(el)
|
53
|
-
} else if (ref) {
|
54
|
-
(ref as React.MutableRefObject<HTMLInputElement | null>).current = el
|
55
|
-
}
|
56
|
-
}
|
57
|
-
|
58
|
-
// Since we're using defaultChecked for uncontrolled input,
|
59
|
-
// we no longer need to sync the checked state with useEffect.
|
60
|
-
|
61
|
-
const ariaProps = buildAriaProps(aria)
|
62
|
-
const dataProps = buildDataProps(data)
|
63
|
-
const htmlProps = buildHtmlProps(htmlOptions)
|
48
|
+
}: RadioProps, ref: any) => {
|
49
|
+
const radioRef = useRef(null);
|
64
50
|
|
51
|
+
const ariaProps = buildAriaProps(aria);
|
52
|
+
const dataProps = buildDataProps(data);
|
53
|
+
const htmlProps = buildHtmlProps(htmlOptions);
|
65
54
|
const classes = classnames(
|
66
55
|
buildCss('pb_radio_kit', alignment),
|
67
56
|
dark ? 'dark' : null,
|
68
57
|
error ? 'error' : null,
|
69
58
|
globalProps(props),
|
70
59
|
className
|
71
|
-
)
|
60
|
+
);
|
72
61
|
|
73
62
|
const classesCustom = classnames(
|
74
63
|
dark ? 'dark' : null,
|
75
64
|
error ? 'error' : null,
|
76
65
|
globalProps(props),
|
77
66
|
className
|
78
|
-
)
|
67
|
+
);
|
79
68
|
|
80
|
-
const displayRadio = (
|
81
|
-
if (children && customChildren
|
82
|
-
return children
|
69
|
+
const displayRadio = (props: RadioProps & any) => {
|
70
|
+
if (children && customChildren == false)
|
71
|
+
return (children)
|
83
72
|
else
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
}
|
73
|
+
return (
|
74
|
+
<input
|
75
|
+
disabled={disabled}
|
76
|
+
id={id}
|
77
|
+
name={name}
|
78
|
+
onChange={onChange}
|
79
|
+
ref={ref}
|
80
|
+
text={text}
|
81
|
+
type="radio"
|
82
|
+
value={value}
|
83
|
+
{...props}
|
84
|
+
/>
|
85
|
+
)}
|
98
86
|
|
99
87
|
const handleContainerClick = (event: React.MouseEvent<HTMLDivElement, MouseEvent> | undefined) => {
|
100
88
|
if (event) {
|
101
|
-
const target = event.target as HTMLElement
|
89
|
+
const target = event.target as HTMLElement;
|
102
90
|
if (
|
103
91
|
target.id === 'pb-radio-children-wrapper' ||
|
104
92
|
target.closest('#pb-radio-children-wrapper')
|
105
93
|
) {
|
106
|
-
|
94
|
+
radioRef.current?.click();
|
107
95
|
}
|
108
96
|
}
|
109
|
-
}
|
97
|
+
};
|
110
98
|
|
111
|
-
return
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
99
|
+
return (
|
100
|
+
customChildren ? (
|
101
|
+
<Flex
|
102
|
+
{...ariaProps}
|
103
|
+
{...dataProps}
|
104
|
+
{...htmlProps}
|
105
|
+
align='center'
|
106
|
+
className={classesCustom}
|
107
|
+
cursor='pointer'
|
108
|
+
htmlFor={id}
|
109
|
+
htmlOptions={{
|
110
|
+
onClick: ((event: React.MouseEvent<HTMLDivElement, MouseEvent>) => {
|
111
|
+
handleContainerClick(event);
|
112
|
+
}) as unknown as () => void
|
113
|
+
}}
|
114
|
+
id="radio-container"
|
115
|
+
>
|
116
|
+
<label className={buildCss('pb_radio_kit', alignment)}>
|
128
117
|
<input
|
129
|
-
defaultChecked={checked}
|
130
118
|
disabled={disabled}
|
131
119
|
id={id}
|
132
120
|
name={name}
|
133
121
|
onChange={onChange}
|
134
|
-
ref={
|
122
|
+
ref={radioRef}
|
135
123
|
type="radio"
|
136
124
|
value={value}
|
137
125
|
{...props}
|
138
126
|
/>
|
127
|
+
<span className="pb_radio_button" />
|
128
|
+
</label>
|
129
|
+
<div id="pb-radio-children-wrapper"> {children} </div>
|
130
|
+
</Flex>
|
131
|
+
) : (
|
132
|
+
<label
|
133
|
+
{...ariaProps}
|
134
|
+
{...dataProps}
|
135
|
+
{...htmlProps}
|
136
|
+
className={classes}
|
137
|
+
htmlFor={id}
|
138
|
+
>
|
139
|
+
<>{displayRadio(props)}</>
|
139
140
|
<span className="pb_radio_button" />
|
141
|
+
<Body
|
142
|
+
dark={dark}
|
143
|
+
status={error ? 'negative' : null}
|
144
|
+
text={label}
|
145
|
+
variant={null}
|
146
|
+
/>
|
140
147
|
</label>
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
<label
|
145
|
-
{...ariaProps}
|
146
|
-
{...dataProps}
|
147
|
-
{...htmlProps}
|
148
|
-
className={classes}
|
149
|
-
htmlFor={id}
|
150
|
-
>
|
151
|
-
{displayRadio(props)}
|
152
|
-
<span className="pb_radio_button" />
|
153
|
-
<Body
|
154
|
-
dark={dark}
|
155
|
-
status={error ? 'negative' : null}
|
156
|
-
text={label}
|
157
|
-
variant={null}
|
158
|
-
/>
|
159
|
-
</label>
|
160
|
-
)
|
161
|
-
})
|
148
|
+
)
|
149
|
+
);
|
150
|
+
};
|
162
151
|
|
163
|
-
|
164
|
-
export default Radio
|
152
|
+
export default forwardRef(Radio);
|
@@ -16,7 +16,6 @@ examples:
|
|
16
16
|
- radio_alignment: Alignment
|
17
17
|
- radio_disabled: Disabled
|
18
18
|
- radio_custom_children: Custom Children
|
19
|
-
- radio_react_hook: React Hook Form
|
20
19
|
|
21
20
|
swift:
|
22
21
|
- radio_default_swift: Default
|
@@ -27,4 +26,4 @@ examples:
|
|
27
26
|
- radio_spacing_swift: Spacing
|
28
27
|
- radio_padding_swift: Padding
|
29
28
|
- radio_subtitle_swift: Subtitle
|
30
|
-
- radio_props_swift: ""
|
29
|
+
- radio_props_swift: ""
|
@@ -4,4 +4,3 @@ export { default as RadioError } from './_radio_error.jsx'
|
|
4
4
|
export { default as RadioAlignment } from './_radio_alignment.jsx'
|
5
5
|
export { default as RadioDisabled } from './_radio_disabled.jsx'
|
6
6
|
export { default as RadioCustomChildren } from './_radio_custom_children.jsx'
|
7
|
-
export { default as RadioReactHook } from './_radio_react_hook.jsx'
|
@@ -86,19 +86,3 @@ test('has disabled attribute', () => {
|
|
86
86
|
expect(input).toHaveAttribute('disabled')
|
87
87
|
})
|
88
88
|
|
89
|
-
|
90
|
-
test('has ref in the input element', () => {
|
91
|
-
const ref = React.createRef()
|
92
|
-
render(
|
93
|
-
<Radio
|
94
|
-
data={{ testid: testId }}
|
95
|
-
name="Radio-name"
|
96
|
-
ref={ref}
|
97
|
-
text="Radio"
|
98
|
-
value="radio value"
|
99
|
-
/>
|
100
|
-
)
|
101
|
-
|
102
|
-
expect(ref.current).not.toBeNull()
|
103
|
-
expect(ref.current?.tagName).toBe('INPUT')
|
104
|
-
})
|
@@ -31,12 +31,10 @@ examples:
|
|
31
31
|
- table_with_subcomponents_as_divs: Table with Sub Components (Divs)
|
32
32
|
- table_outer_padding: Outer Padding
|
33
33
|
- table_with_collapsible: Table with Collapsible
|
34
|
-
- table_with_collapsible_with_custom_click: Table with Collapsible with Custom Click
|
35
34
|
- table_with_collapsible_with_custom_content_rails: Table with Collapsible with Custom Content
|
36
35
|
- table_with_collapsible_with_nested_rows_rails: Table with Collapsible with Nested Rows
|
37
36
|
- table_with_collapsible_with_nested_table_rails: Table with Collapsible with Nested Table
|
38
37
|
- table_with_clickable_rows: Table with Clickable Rows
|
39
|
-
- table_with_selectable_rows: Table with Selectable Rows
|
40
38
|
|
41
39
|
react:
|
42
40
|
- table_sm: Small
|
@@ -73,5 +71,4 @@ examples:
|
|
73
71
|
- table_with_collapsible_with_custom_content: Table with Collapsible with Custom Content
|
74
72
|
- table_with_collapsible_with_nested_rows: Table with Collapsible with Nested Rows
|
75
73
|
- table_with_collapsible_with_nested_table: Table with Collapsible with Nested Table
|
76
|
-
- table_with_clickable_rows: Table with Clickable Rows
|
77
|
-
- table_with_selectable_rows: Table with Selectable Rows
|
74
|
+
- table_with_clickable_rows: Table with Clickable Rows
|
@@ -33,5 +33,4 @@ export { default as TableWithCollapsibleWithCustomContent } from './_table_with_
|
|
33
33
|
export { default as TableWithCollapsibleWithNestedTable } from './_table_with_collapsible_with_nested_table.jsx'
|
34
34
|
export { default as TableWithCollapsibleWithNestedRows } from './_table_with_collapsible_with_nested_rows.jsx'
|
35
35
|
export { default as TableWithCollapsibleWithCustomClick } from './_table_with_collapsible_with_custom_click.jsx'
|
36
|
-
export { default as
|
37
|
-
export { default as TableWithClickableRows } from './_table_with_clickable_rows.jsx'
|
36
|
+
export { default as TableWithClickableRows } from './_table_with_clickable_rows.jsx'
|