playbook_ui 14.3.0.pre.alpha.revert3654PBNTR479removeextraspacingfromradiochildren3734 → 14.3.0.pre.rc.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_avatar_action_button/_avatar_action_button.scss +3 -3
  3. data/app/pb_kits/playbook/pb_badge/_badge.scss +2 -2
  4. data/app/pb_kits/playbook/pb_bread_crumbs/_bread_crumbs.scss +1 -1
  5. data/app/pb_kits/playbook/pb_button/_button.scss +1 -1
  6. data/app/pb_kits/playbook/pb_button_toolbar/_button_toolbar_mixins.scss +2 -2
  7. data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.scss +1 -1
  8. data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.tsx +0 -3
  9. data/app/pb_kits/playbook/pb_circle_icon_button/circle_icon_button.html.erb +1 -1
  10. data/app/pb_kits/playbook/pb_circle_icon_button/circle_icon_button.rb +0 -2
  11. data/app/pb_kits/playbook/pb_circle_icon_button/circle_icon_button.test.js +0 -15
  12. data/app/pb_kits/playbook/pb_circle_icon_button/docs/example.yml +0 -2
  13. data/app/pb_kits/playbook/pb_circle_icon_button/docs/index.js +0 -1
  14. data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleIcon.tsx +24 -30
  15. data/app/pb_kits/playbook/pb_collapsible/collapsible_main.html.erb +7 -11
  16. data/app/pb_kits/playbook/pb_collapsible/collapsible_main.rb +0 -2
  17. data/app/pb_kits/playbook/pb_collapsible/docs/example.yml +0 -2
  18. data/app/pb_kits/playbook/pb_collapsible/docs/index.js +1 -2
  19. data/app/pb_kits/playbook/pb_date_picker/sass_partials/_input_styles.scss +1 -1
  20. data/app/pb_kits/playbook/pb_date_picker/sass_partials/_overrides.scss +2 -2
  21. data/app/pb_kits/playbook/pb_date_range_inline/_date_range_inline.scss +4 -4
  22. data/app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.scss +4 -4
  23. data/app/pb_kits/playbook/pb_dialog/dialog.html.erb +1 -4
  24. data/app/pb_kits/playbook/pb_dialog/dialog.rb +0 -3
  25. data/app/pb_kits/playbook/pb_dialog/dialogHelper.js +0 -21
  26. data/app/pb_kits/playbook/pb_dialog/dialog_footer.html.erb +2 -4
  27. data/app/pb_kits/playbook/pb_dialog/dialog_footer.rb +1 -10
  28. data/app/pb_kits/playbook/pb_dialog/docs/example.yml +0 -1
  29. data/app/pb_kits/playbook/pb_dropdown/_dropdown.scss +1 -1
  30. data/app/pb_kits/playbook/pb_form_pill/_form_pill.scss +2 -2
  31. data/app/pb_kits/playbook/pb_hashtag/_hashtag.tsx +2 -16
  32. data/app/pb_kits/playbook/pb_hashtag/docs/_hashtag_link.html.erb +1 -1
  33. data/app/pb_kits/playbook/pb_hashtag/docs/_hashtag_link.jsx +1 -1
  34. data/app/pb_kits/playbook/pb_hashtag/docs/_hashtag_link.md +1 -1
  35. data/app/pb_kits/playbook/pb_hashtag/hashtag.html.erb +1 -1
  36. data/app/pb_kits/playbook/pb_hashtag/hashtag.rb +2 -9
  37. data/app/pb_kits/playbook/pb_home_address_street/_home_address_street.tsx +0 -16
  38. data/app/pb_kits/playbook/pb_home_address_street/city_emphasis.html.erb +0 -1
  39. data/app/pb_kits/playbook/pb_home_address_street/city_emphasis.rb +0 -11
  40. data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_link.html.erb +1 -1
  41. data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_link.jsx +1 -1
  42. data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_link.md +1 -1
  43. data/app/pb_kits/playbook/pb_home_address_street/home_address_street.rb +0 -13
  44. data/app/pb_kits/playbook/pb_home_address_street/home_adress_street.test.js +2 -2
  45. data/app/pb_kits/playbook/pb_home_address_street/street_emphasis.html.erb +1 -2
  46. data/app/pb_kits/playbook/pb_home_address_street/street_emphasis.rb +0 -11
  47. data/app/pb_kits/playbook/pb_icon/icon.rb +0 -8
  48. data/app/pb_kits/playbook/pb_icon_circle/_icon_circle.scss +1 -1
  49. data/app/pb_kits/playbook/pb_label_value/_label_value.scss +1 -1
  50. data/app/pb_kits/playbook/pb_message/_message_mixins.scss +1 -1
  51. data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.scss +1 -1
  52. data/app/pb_kits/playbook/pb_nav/docs/example.yml +0 -2
  53. data/app/pb_kits/playbook/pb_nav/docs/index.js +3 -4
  54. data/app/pb_kits/playbook/pb_pagination/_pagination.scss +1 -3
  55. data/app/pb_kits/playbook/pb_passphrase/_passphrase.scss +3 -3
  56. data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.scss +2 -9
  57. data/app/pb_kits/playbook/pb_pill/_pill.scss +2 -2
  58. data/app/pb_kits/playbook/pb_progress_simple/_progress_simple.scss +2 -2
  59. data/app/pb_kits/playbook/pb_radio/_radio.tsx +50 -100
  60. data/app/pb_kits/playbook/pb_radio/docs/example.yml +0 -1
  61. data/app/pb_kits/playbook/pb_radio/docs/index.js +0 -1
  62. data/app/pb_kits/playbook/pb_rich_text_editor/_previewer_mixin.scss +13 -49
  63. data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.scss +14 -2
  64. data/app/pb_kits/playbook/pb_rich_text_editor/_tiptap_styles.scss +23 -23
  65. data/app/pb_kits/playbook/pb_rich_text_editor/_trix_styles.scss +27 -19
  66. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_preview.html.erb +11 -21
  67. data/app/pb_kits/playbook/pb_select/_select.scss +1 -1
  68. data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.scss +3 -3
  69. data/app/pb_kits/playbook/pb_star_rating/docs/example.yml +0 -1
  70. data/app/pb_kits/playbook/pb_star_rating/index.js +1 -11
  71. data/app/pb_kits/playbook/pb_star_rating/star_rating.rb +1 -3
  72. data/app/pb_kits/playbook/pb_text_input/_text_input.scss +1 -1
  73. data/app/pb_kits/playbook/pb_textarea/_textarea.scss +1 -1
  74. data/app/pb_kits/playbook/pb_time_range_inline/_time_range_inline.scss +4 -4
  75. data/app/pb_kits/playbook/pb_timeline/_timeline.scss +2 -2
  76. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_elapsed.html.erb +2 -2
  77. data/app/pb_kits/playbook/pb_timestamp/timestamp.rb +2 -46
  78. data/app/pb_kits/playbook/pb_toggle/_toggle.scss +3 -3
  79. data/dist/chunks/{_typeahead-BWUFVlae.js → _typeahead-Cq7RLPBA.js} +3 -3
  80. data/dist/chunks/{_weekday_stacked-DpRkKl3_.js → _weekday_stacked-Cykj5kLZ.js} +2 -2
  81. data/dist/chunks/{lib-D9uVVKnh.js → lib-DErGXNy3.js} +1 -1
  82. data/dist/chunks/{pb_form_validation-u2wnZ3oe.js → pb_form_validation-BC6kh7Hu.js} +1 -1
  83. data/dist/chunks/vendor.js +1 -1
  84. data/dist/playbook-doc.js +1 -1
  85. data/dist/playbook-rails-react-bindings.js +1 -1
  86. data/dist/playbook-rails.js +1 -1
  87. data/dist/playbook.css +1 -1
  88. data/lib/playbook/version.rb +2 -2
  89. metadata +6 -19
  90. data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_loading.html.erb +0 -29
  91. data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_loading.jsx +0 -43
  92. data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_no_icon.html.erb +0 -10
  93. data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_no_icon.jsx +0 -21
  94. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_loading.html.erb +0 -13
  95. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_loading.md +0 -3
  96. data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_no_icon.html.erb +0 -24
  97. data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_no_icon.jsx +0 -88
  98. data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_no_icon_rails.md +0 -1
  99. data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_no_icon_react.md +0 -1
  100. data/app/pb_kits/playbook/pb_phone_number_input/intlTelInput.scss +0 -1290
  101. data/app/pb_kits/playbook/pb_radio/docs/_radio_children.jsx +0 -56
  102. data/app/pb_kits/playbook/pb_star_rating/docs/_star_rating_default_value.html.erb +0 -1
@@ -23,7 +23,6 @@ type HomeAddressStreetProps = {
23
23
  homeId: string,
24
24
  houseStyle: string,
25
25
  homeUrl: string,
26
- target: string,
27
26
  newWindow: boolean,
28
27
  state: string,
29
28
  zipcode: string,
@@ -43,7 +42,6 @@ const HomeAddressStreet = (props: HomeAddressStreetProps): React.ReactElement =>
43
42
  htmlOptions = {},
44
43
  homeId,
45
44
  homeUrl,
46
- target,
47
45
  newWindow,
48
46
  houseStyle,
49
47
  state,
@@ -64,19 +62,6 @@ const HomeAddressStreet = (props: HomeAddressStreetProps): React.ReactElement =>
64
62
  const dataProps: GenericObject = buildDataProps(data)
65
63
  const ariaProps: GenericObject = buildAriaProps(aria)
66
64
  const htmlProps = buildHtmlProps(htmlOptions)
67
-
68
- const getTargetAttribute = () => {
69
- if (target && homeUrl) {
70
- return target
71
- } else if (newWindow) {
72
- return '_blank'
73
- } else {
74
- return '_self'
75
- }
76
-
77
- return null
78
- }
79
-
80
65
  return (
81
66
  <div
82
67
  className={classes(className, dark)}
@@ -135,7 +120,6 @@ const HomeAddressStreet = (props: HomeAddressStreetProps): React.ReactElement =>
135
120
  dark={dark}
136
121
  marginRight="xxs"
137
122
  newWindow={newWindow}
138
- target={getTargetAttribute()}
139
123
  text={homeId}
140
124
  type="home"
141
125
  url={homeUrl || '#'}
@@ -33,7 +33,6 @@
33
33
  type: "home",
34
34
  dark: object.dark,
35
35
  classname: "home-hashtag",
36
- target: object.target_option,
37
36
  new_window: object.new_window}) %>
38
37
  <% end %>
39
38
 
@@ -10,20 +10,9 @@ module Playbook
10
10
  prop :home_url
11
11
  prop :new_window, type: Playbook::Props::Boolean,
12
12
  default: false
13
- prop :target
14
13
  prop :territory
15
14
  prop :zip
16
15
  prop :dark, type: Playbook::Props::Boolean, default: false
17
-
18
- def target_option
19
- if target && home_url
20
- target
21
- elsif new_window
22
- "_blank"
23
- else
24
- "_self"
25
- end
26
- end
27
16
  end
28
17
  end
29
18
  end
@@ -5,7 +5,7 @@
5
5
  home_id: 8250263,
6
6
  home_url: "https://powerhrg.com/",
7
7
  house_style: "Colonial",
8
- target: "_blank",
8
+ new_window: true,
9
9
  state: "PA",
10
10
  zipcode: "19382",
11
11
  territory: "PHL",
@@ -11,8 +11,8 @@ const HomeAddressStreetLink= (props) => {
11
11
  homeId={8250263}
12
12
  homeUrl="https://powerhrg.com/"
13
13
  houseStyle="Colonial"
14
+ newWindow
14
15
  state="PA"
15
- target="_blank"
16
16
  territory="PHL"
17
17
  zipcode="19382"
18
18
  {...props}
@@ -1 +1 @@
1
- Use the `target` prop to control whether the link opens on the same or a new tab (same page is the default behavior). You can use any [web/standard](https://www.w3schools.com/tags/att_a_target.asp) values or a custom string to specify your link target.
1
+ Use the `newWindow` / `new_window` prop to control whether the link opens on the same page or a new tab (same page is the default behavior)
@@ -14,7 +14,6 @@ module Playbook
14
14
  prop :house_style
15
15
  prop :new_window, type: Playbook::Props::Boolean,
16
16
  default: false
17
- prop :target
18
17
  prop :state
19
18
  prop :zipcode
20
19
  prop :territory
@@ -56,7 +55,6 @@ module Playbook
56
55
  dark: dark,
57
56
  home_id: home_id,
58
57
  home_url: home_url,
59
- target: target_option,
60
58
  new_window: new_window,
61
59
  territory: territory,
62
60
  zip: zip,
@@ -71,22 +69,11 @@ module Playbook
71
69
  dark: dark,
72
70
  home_id: home_id,
73
71
  home_url: home_url,
74
- target: target_option,
75
72
  new_window: new_window,
76
73
  territory: territory,
77
74
  }
78
75
  end
79
76
 
80
- def target_option
81
- if target && home_url
82
- target
83
- elsif new_window
84
- "_blank"
85
- else
86
- "_self"
87
- end
88
- end
89
-
90
77
  private
91
78
 
92
79
  def dark_class
@@ -23,10 +23,10 @@ function HomeAdressStreetTest(props) {
23
23
  territory="PHL"
24
24
  zipcode="19382"
25
25
  {...props}
26
- />
26
+ />
27
27
  );
28
28
  }
29
-
29
+
30
30
  test("renders the component", () => {
31
31
  render(<HomeAdressStreetTest />);
32
32
  const kit = screen.getByTestId("primary-test");
@@ -23,8 +23,7 @@
23
23
  type: "home",
24
24
  dark: object.dark,
25
25
  classname: "home-hashtag",
26
- new_window: object.new_window,
27
- target: object.target_option}) %>
26
+ new_window: object.new_window}) %>
28
27
  <% end %>
29
28
 
30
29
  <%= pb_rails "body", props: { color: "light", tag: "span", dark: object.dark } do %>
@@ -10,20 +10,9 @@ module Playbook
10
10
  prop :home_url
11
11
  prop :new_window, type: Playbook::Props::Boolean,
12
12
  default: false
13
- prop :target
14
13
  prop :territory
15
14
  prop :dark, type: Playbook::Props::Boolean,
16
15
  default: false
17
-
18
- def target_option
19
- if target && home_url
20
- target
21
- elsif new_window
22
- "_blank"
23
- else
24
- "_self"
25
- end
26
- end
27
16
  end
28
17
  end
29
18
  end
@@ -102,11 +102,6 @@ module Playbook
102
102
  def render_svg
103
103
  doc = Nokogiri::XML(URI.open(asset_path || icon || custom_icon)) # rubocop:disable Security/Open
104
104
  svg = doc.at_css "svg"
105
-
106
- unless svg
107
- return "" # Return an empty string if SVG element is not found
108
- end
109
-
110
105
  svg["class"] = %w[pb_custom_icon svg-inline--fa].concat([object.custom_icon_classname]).join(" ")
111
106
  svg["id"] = object.id
112
107
  svg["data"] = object.data
@@ -117,9 +112,6 @@ module Playbook
117
112
  fill_color = object.color || "currentColor"
118
113
  doc.at_css("path")["fill"] = fill_color
119
114
  raw doc
120
- rescue OpenURI::HTTPError, StandardError
121
- # Handle any exceptions and return an empty string
122
- ""
123
115
  end
124
116
 
125
117
  def is_svg?
@@ -54,7 +54,7 @@ $pb_icon_circle_sizes: (
54
54
  &[class*=_size_#{$name}] {
55
55
  width: $size;
56
56
  height: $size;
57
- border-radius: $size/2;
57
+ border-radius: calc($size/2);
58
58
  background: $silver;
59
59
  color: $text_lt_light;
60
60
  font-size: $size * 0.38;
@@ -2,6 +2,6 @@
2
2
 
3
3
  [class^=pb_label_value_kit] {
4
4
  [class^=pb_caption_kit] {
5
- margin-bottom: $space-xs/1.5;
5
+ margin-bottom: calc($space-xs/1.5);
6
6
  }
7
7
  }
@@ -17,7 +17,7 @@
17
17
  }
18
18
 
19
19
  .message_text {
20
- margin: 0 0 $space-xs/2;
20
+ margin: 0 0 calc($space-xs/2);
21
21
  }
22
22
 
23
23
  .message_title {
@@ -18,7 +18,7 @@ $pb_multiple_users_size_xxs: map-get($avatar-sizes, "xxs");
18
18
  justify-content: center;
19
19
  width: $pb_multiple_users_size;
20
20
  height: $pb_multiple_users_size;
21
- border-radius: $pb_multiple_users_size / 2 + 2;
21
+ border-radius: calc($pb_multiple_users_size/2) + 2;
22
22
  background: tint($primary, 90%);
23
23
  border: $pb_multiple_users_border_size solid $white;
24
24
  color: $primary;
@@ -13,7 +13,6 @@ examples:
13
13
  - nav_with_font_control: Nav With Font Control
14
14
  - collapsible_nav: Collapsible Nav
15
15
  - collapsible_nav_with_all_options: Collapsible Nav With Options
16
- - collapsible_nav_no_icon: Collapsible Nav No Icon
17
16
  - horizontal_nav: Horizontal Nav
18
17
  - subtle_horizontal_nav: Subtle Horizontal Nav
19
18
  - bold_horizontal_nav: Bold Horizontal Nav
@@ -38,7 +37,6 @@ examples:
38
37
  - collapsible_nav_with_all_options: Collapsible Nav With Options
39
38
  - collapsible_nav_item_spacing: Collapsible Nav With ItemSpacing
40
39
  - collapsible_nav_custom: Collapsible Nav With Custom Toggling
41
- - collapsible_nav_no_icon: Collapsible Nav No Icon
42
40
  - horizontal_nav: Horizontal Nav
43
41
  - subtle_horizontal_nav: Subtle Horizontal Nav
44
42
  - bold_horizontal_nav: Bold Horizontal Nav
@@ -15,8 +15,7 @@ export { default as BoldHorizontalNav } from './_bold_horizontal_nav.jsx'
15
15
  export { default as BoldVerticalNav } from './_bold_vertical_nav.jsx'
16
16
  export { default as CollapsibleNav } from './_collapsible_nav.jsx'
17
17
  export { default as CollapsibleNavCustom } from './_collapsible_nav_custom.jsx'
18
- export { default as CollapsibleNavWithAllOptions} from "./_collapsible_nav_with_all_options.jsx"
18
+ export {default as CollapsibleNavWithAllOptions} from "./_collapsible_nav_with_all_options.jsx"
19
19
  export { default as NavWithFontControl } from "./_nav_with_font_control.jsx"
20
- export { default as NavWithSpacingControl } from "./_nav_with_spacing_control.jsx"
21
- export { default as CollapsibleNavItemSpacing } from "./_collapsible_nav_item_spacing.jsx"
22
- export { default as CollapsibleNavNoIcon } from "./_collapsible_nav_no_icon.jsx"
20
+ export {default as NavWithSpacingControl } from "./_nav_with_spacing_control.jsx"
21
+ export {default as CollapsibleNavItemSpacing } from "./_collapsible_nav_item_spacing.jsx"
@@ -33,7 +33,6 @@ $top_bottom_radius: 0px;
33
33
  border-top-right-radius: $top_bottom_radius;
34
34
  border-bottom-right-radius: $top_bottom_radius;
35
35
  cursor: pointer;
36
- transition: background-color $transition_default ease-out, color $transition_default ease-out;
37
36
  }
38
37
  li:last-child > a, li:last-child > span, .pagination-number, .pagination-right {
39
38
  padding: $pagination_padding;
@@ -41,14 +40,13 @@ $top_bottom_radius: 0px;
41
40
  z-index: 2;
42
41
  border-top-left-radius: $top_bottom_radius;
43
42
  border-bottom-left-radius: $top_bottom_radius;
44
- transition: background-color $transition_default ease-out, color $transition_default ease-out;
45
43
  }
46
44
  a, .pagination-number {
47
45
  color: $text_lt_default;
48
46
  font-size: $text_small;
49
47
  font-weight: $regular;
50
48
  border: none;
51
- transition: background-color $transition_default ease-out, color $transition_default ease-out, border-color $transition_default ease-out;
49
+ transition: all $transition_default ease-out;
52
50
 
53
51
  &:hover {
54
52
  @include hover-state;
@@ -21,14 +21,14 @@
21
21
  }
22
22
 
23
23
  .passphrase-label {
24
- margin-right: $space_xs / 2;
24
+ margin-right: calc($space_xs/2);
25
25
  }
26
26
 
27
27
  .passphrase-text-input-wrapper {
28
28
  position: relative;
29
29
 
30
30
  .pb_text_input_kit_label {
31
- margin-bottom: $space_xs / 2;
31
+ margin-bottom: calc($space_xs/2);
32
32
  }
33
33
 
34
34
  .passphrase-text-input input {
@@ -57,7 +57,7 @@
57
57
  }
58
58
 
59
59
  .pb_progress_simple_wrapper, .pb_progress_simple_wrapper_dark {
60
- margin-bottom: $space_xs/2;
60
+ margin-bottom: calc($space_xs/2);
61
61
 
62
62
  &.progress-empty-input {
63
63
  visibility: hidden;
@@ -1,4 +1,4 @@
1
- @import "./intlTelInput";
1
+ @import "intl-tel-input/build/css/intlTelInput.css";
2
2
  @import "../tokens/colors";
3
3
 
4
4
  $transform-rotate-deg: 135deg;
@@ -60,7 +60,6 @@ $flag-min-resolution: 192dpi;
60
60
  }
61
61
 
62
62
  .iti__flag {
63
- background-image: url("https://unpkg.com/playbook-ui@14.2.0-alpha.fixphonenumberinputflag3631/dist/assets/flags.png");
64
63
  border-radius: 1px;
65
64
  }
66
65
 
@@ -101,7 +100,7 @@ $flag-min-resolution: 192dpi;
101
100
  }
102
101
 
103
102
  .iti__arrow.iti__arrow--up::before {
104
- transform: rotate(-($transform-rotate-deg/3));
103
+ transform: rotate(-(calc($transform-rotate-deg/3)));
105
104
  top: $space_xs + 4px;
106
105
  color: $primary_action;
107
106
  }
@@ -197,10 +196,4 @@ $flag-min-resolution: 192dpi;
197
196
  }
198
197
  }
199
198
  }
200
-
201
- @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: $flag-min-resolution) {
202
- .iti__flag {
203
- background-image: url("https://unpkg.com/playbook-ui@14.2.0-alpha.fixphonenumberinputflag3631/dist/assets/flags.png");
204
- }
205
- }
206
199
  }
@@ -9,9 +9,9 @@ $pb_pill_height: 22px;
9
9
  display: inline-flex;
10
10
  justify-content: center;
11
11
  align-items: center;
12
- padding: 0 $space-sm/1.8;
12
+ padding: 0 calc($space-sm/1.8);
13
13
  height: $pb_pill_height;
14
- border-radius: $pb_pill_height/2;
14
+ border-radius: calc($pb_pill_height/2);
15
15
  white-space: nowrap;
16
16
 
17
17
  &[class*=lowercase] {
@@ -21,7 +21,7 @@ $pb_progress_simple_height: 4px;
21
21
  [class^=pb_progress_simple_kit] {
22
22
  width: 100%;
23
23
  height: $pb_progress_simple_height;
24
- border-radius: $pb_progress_simple_height/2;
24
+ border-radius: calc($pb_progress_simple_height/2);
25
25
  background: rgba($primary, $opacity-1);
26
26
  &[class*=_positive] {
27
27
  .progress_simple_value {
@@ -42,7 +42,7 @@ $pb_progress_simple_height: 4px;
42
42
  [class^=progress_simple_value] {
43
43
  width: 0%;
44
44
  height: 100%;
45
- border-radius: $pb_progress_simple_height/2;
45
+ border-radius: calc($pb_progress_simple_height/2);
46
46
  background: $primary;
47
47
  }
48
48
 
@@ -1,27 +1,28 @@
1
- import React, { forwardRef, isValidElement, useRef } from 'react'
1
+ /*eslint-disable react/no-multi-comp, flowtype/space-before-type-colon */
2
+
3
+ import React, { forwardRef } from 'react'
2
4
  import Body from '../pb_body/_body'
3
- import Flex from '../pb_flex/_flex'
4
5
  import classnames from 'classnames'
5
6
  import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
6
7
  import { globalProps, GlobalProps } from '../utilities/globalProps'
7
8
 
8
9
  type RadioProps = {
9
- aria?: { [key: string]: string },
10
+ aria?: {[key: string]: string},
10
11
  alignment?: string,
11
12
  checked?: boolean,
12
13
  children?: React.ReactChild[] | React.ReactChild,
13
14
  className?: string,
14
15
  dark?: boolean,
15
- data?: { [key: string]: string },
16
+ data?: {[key: string]: string},
16
17
  disabled?: boolean,
17
18
  error?: boolean,
18
- htmlOptions?: { [key: string]: string | number | boolean | (() => void) },
19
+ htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
19
20
  id?: string,
20
21
  label: string,
21
22
  name?: string,
22
23
  value?: string,
23
24
  text?: string,
24
- onChange: (event: React.FormEvent<HTMLInputElement> | null) => void,
25
+ onChange: (event: React.FormEvent<HTMLInputElement> | null)=>void,
25
26
  } & GlobalProps
26
27
 
27
28
  const Radio = ({
@@ -30,9 +31,9 @@ const Radio = ({
30
31
  children,
31
32
  className,
32
33
  dark = false,
34
+ data = {},
33
35
  disabled = false,
34
36
  error = false,
35
- data = {},
36
37
  htmlOptions = {},
37
38
  id,
38
39
  label,
@@ -41,103 +42,52 @@ const Radio = ({
41
42
  value = 'radio_text',
42
43
  onChange = () => { void 0 },
43
44
  ...props
44
- }: RadioProps ) => {
45
- const radioRef = useRef(null);
46
-
47
- const ariaProps = buildAriaProps(aria);
48
- const dataProps = buildDataProps(data);
49
- const htmlProps = buildHtmlProps(htmlOptions);
45
+ }: RadioProps, ref: any) => {
46
+ const ariaProps = buildAriaProps(aria)
47
+ const dataProps = buildDataProps(data)
48
+ const htmlProps = buildHtmlProps(htmlOptions)
50
49
  const classes = classnames(
51
- buildCss('pb_radio_kit', alignment),
52
- dark ? 'dark' : null,
53
- error ? 'error' : null,
50
+ buildCss('pb_radio_kit', alignment ),
51
+ dark ? 'dark': null, error ? 'error': null,
54
52
  globalProps(props),
55
- className
56
- );
57
-
58
- const classesCustom = classnames(
59
- dark ? 'dark' : null,
60
- error ? 'error' : null,
61
- globalProps(props),
62
- className
63
- );
64
-
65
- const isCustomChild = children && isValidElement(children) && children.type !== 'input';
53
+ className)
66
54
 
67
55
  const displayRadio = (props: RadioProps & any) => {
68
- if (isValidElement(children) && children.type === 'input') {
69
- return children;
70
- } else if (isCustomChild || !children) {
71
- return (
72
- <input
73
- disabled={disabled}
74
- id={id}
75
- name={name}
76
- onChange={onChange}
77
- ref={radioRef}
78
- text={text}
79
- type="radio"
80
- value={value}
81
- {...props}
82
- />
83
- );
84
- }
85
- };
86
-
87
- const handleContainerClick = (event: React.MouseEvent<HTMLDivElement, MouseEvent> | undefined) => {
88
- if (event) {
89
- const target = event.target as HTMLElement;
90
- if (
91
- target.id === 'pb-radio-children-wrapper' ||
92
- target.closest('#pb-radio-children-wrapper')
93
- ) {
94
- radioRef.current?.click();
95
- }
96
- }
97
- };
56
+ if (children)
57
+ return (children)
58
+ else
59
+ return (
60
+ <input
61
+ disabled={disabled}
62
+ id={id}
63
+ name={name}
64
+ onChange={onChange}
65
+ ref={ref}
66
+ text={text}
67
+ type="radio"
68
+ value={value}
69
+ {...props}
70
+ />
71
+ )}
98
72
 
99
73
  return (
100
- isCustomChild ? (
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)}>
117
- <>{displayRadio(props)}</>
118
- <span className="pb_radio_button" />
119
- </label>
120
- <div id="pb-radio-children-wrapper"> {children} </div>
121
- </Flex>
122
- ) : (
123
- <label
124
- {...ariaProps}
125
- {...dataProps}
126
- {...htmlProps}
127
- className={classes}
128
- htmlFor={id}
129
- >
130
- <>{displayRadio(props)}</>
131
- <span className="pb_radio_button" />
132
- <Body
133
- dark={dark}
134
- status={error ? 'negative' : null}
135
- text={label}
136
- variant={null}
137
- />
138
- </label>
139
- )
140
- );
141
- };
74
+ <label
75
+ {...ariaProps}
76
+ {...dataProps}
77
+ {...htmlProps}
78
+ className={classes}
79
+ htmlFor={id}
80
+ >
81
+ <>{displayRadio(props)}</>
82
+ <span className="pb_radio_button" />
83
+ <Body
84
+ dark={dark}
85
+ status={error ? 'negative' : null}
86
+ text={label}
87
+ variant={null}
88
+ />
89
+ </label>
90
+ )
91
+ }
142
92
 
143
- export default forwardRef(Radio);
93
+ export default forwardRef(Radio)
@@ -14,7 +14,6 @@ examples:
14
14
  - radio_error: With Error
15
15
  - radio_alignment: Alignment
16
16
  - radio_disabled: Disabled
17
- - radio_children: Children
18
17
 
19
18
  swift:
20
19
  - radio_default_swift: Default
@@ -3,4 +3,3 @@ export { default as RadioCustom } from './_radio_custom.jsx'
3
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
- export { default as RadioChildren } from './_radio_children.jsx'