playbook_ui 13.21.0.pre.alpha.PLAY12582474 → 13.21.0.pre.alpha.PLAY12582514

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/table_body.rb +1 -1
  3. data/app/pb_kits/playbook/pb_avatar/avatar.rb +1 -1
  4. data/app/pb_kits/playbook/pb_bar_graph/bar_graph.rb +9 -9
  5. data/app/pb_kits/playbook/pb_button/button.rb +5 -5
  6. data/app/pb_kits/playbook/pb_circle_chart/circle_chart.rb +10 -10
  7. data/app/pb_kits/playbook/pb_currency/currency.rb +4 -4
  8. data/app/pb_kits/playbook/pb_date_picker/_date_picker.scss +1 -2
  9. data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +3 -0
  10. data/app/pb_kits/playbook/pb_date_picker/date_picker.html.erb +2 -1
  11. data/app/pb_kits/playbook/pb_date_picker/date_picker.rb +8 -7
  12. data/app/pb_kits/playbook/pb_date_picker/date_picker.test.js +1 -1
  13. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_margin_bottom.html.erb +7 -0
  14. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_margin_bottom.jsx +41 -0
  15. data/app/pb_kits/playbook/pb_date_picker/docs/example.yml +2 -0
  16. data/app/pb_kits/playbook/pb_date_picker/docs/index.js +1 -0
  17. data/app/pb_kits/playbook/pb_date_picker/sass_partials/_input_styles.scss +1 -2
  18. data/app/pb_kits/playbook/pb_distribution_bar/distribution_bar.rb +3 -3
  19. data/app/pb_kits/playbook/pb_docs/kit_example.rb +1 -1
  20. data/app/pb_kits/playbook/pb_form/form.rb +4 -4
  21. data/app/pb_kits/playbook/pb_gauge/gauge.rb +9 -9
  22. data/app/pb_kits/playbook/pb_home_address_street/home_address_street.rb +17 -17
  23. data/app/pb_kits/playbook/pb_icon_stat_value/icon_stat_value.rb +0 -2
  24. data/app/pb_kits/playbook/pb_line_graph/line_graph.rb +9 -9
  25. data/app/pb_kits/playbook/pb_list/list.rb +0 -2
  26. data/app/pb_kits/playbook/pb_multi_level_select/multi_level_select.rb +4 -4
  27. data/app/pb_kits/playbook/pb_passphrase/passphrase.rb +6 -6
  28. data/app/pb_kits/playbook/pb_phone_number_input/phone_number_input.rb +8 -8
  29. data/app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.rb +8 -8
  30. data/app/pb_kits/playbook/pb_select/select.rb +6 -6
  31. data/app/pb_kits/playbook/pb_selectable_card/selectable_card.rb +1 -1
  32. data/app/pb_kits/playbook/pb_selectable_icon/selectable_icon.rb +1 -1
  33. data/app/pb_kits/playbook/pb_stat_value/stat_value.rb +1 -1
  34. data/app/pb_kits/playbook/pb_text_input/_text_input.scss +0 -1
  35. data/app/pb_kits/playbook/pb_text_input/_text_input.tsx +5 -1
  36. data/app/pb_kits/playbook/pb_text_input/text_input.rb +9 -8
  37. data/app/pb_kits/playbook/pb_text_input/text_input.test.js +1 -1
  38. data/app/pb_kits/playbook/pb_treemap_chart/treemap_chart.rb +6 -6
  39. data/app/pb_kits/playbook/pb_typeahead/typeahead.rb +8 -8
  40. data/dist/playbook-rails.js +1 -1
  41. data/lib/playbook/forms/builder/action_area.rb +2 -2
  42. data/lib/playbook/forms/builder/checkbox_field.rb +2 -2
  43. data/lib/playbook/forms/builder/collection_select_field.rb +1 -1
  44. data/lib/playbook/forms/builder/date_picker_field.rb +1 -1
  45. data/lib/playbook/forms/builder/form_field_builder.rb +1 -1
  46. data/lib/playbook/forms/builder/intl_telephone_field.rb +1 -1
  47. data/lib/playbook/forms/builder/multi_level_select_field.rb +1 -1
  48. data/lib/playbook/forms/builder/select_field.rb +1 -1
  49. data/lib/playbook/forms/builder/typeahead_field.rb +1 -1
  50. data/lib/playbook/kit_base.rb +2 -2
  51. data/lib/playbook/pb_doc_helper.rb +5 -5
  52. data/lib/playbook/pb_forms_helper.rb +1 -1
  53. data/lib/playbook/props/percentage.rb +2 -2
  54. data/lib/playbook/props.rb +1 -1
  55. data/lib/playbook/version.rb +1 -1
  56. metadata +16 -42
@@ -39,7 +39,7 @@ module Playbook
39
39
  def additional_input_options
40
40
  input_options.merge(
41
41
  id: input_id_present,
42
- disabled: disabled
42
+ disabled:
43
43
  )
44
44
  end
45
45
 
@@ -11,7 +11,7 @@ module Playbook
11
11
  if precision.nil?
12
12
  number_with_delimiter(value, delimiter: ",", separator: ".")
13
13
  else
14
- number_with_precision(value, precision: precision, delimiter: ",", separator: ".")
14
+ number_with_precision(value, precision:, delimiter: ",", separator: ".")
15
15
  end
16
16
  end
17
17
 
@@ -3,7 +3,6 @@
3
3
  @import "../tokens/colors";
4
4
 
5
5
  [class^="pb_text_input_kit"] {
6
- margin-bottom: $space_sm;
7
6
  .pb_text_input_kit_label {
8
7
  margin-bottom: $space_xs;
9
8
  display: block;
@@ -60,6 +60,10 @@ const TextInput = (props: TextInputProps, ref: React.LegacyRef<HTMLInputElement>
60
60
  const ariaProps = buildAriaProps(aria)
61
61
  const dataProps = buildDataProps(data)
62
62
  const htmlProps = buildHtmlProps(htmlOptions)
63
+ const filteredProps = {...props}
64
+ if (filteredProps.marginBottom === undefined) {
65
+ filteredProps.marginBottom = "sm"
66
+ }
63
67
 
64
68
  const { alignment, border, icon } = addOn
65
69
  const addOnAlignment = alignment === 'left' ? 'left' : 'right'
@@ -74,7 +78,7 @@ const TextInput = (props: TextInputProps, ref: React.LegacyRef<HTMLInputElement>
74
78
  'pb_text_input_kit',
75
79
  inline ? 'inline' : "",
76
80
  error ? 'error' : "",
77
- globalProps(props),
81
+ globalProps(filteredProps),
78
82
  className,
79
83
  ])
80
84
  const addOnIcon = (
@@ -26,7 +26,8 @@ module Playbook
26
26
  nested_kit: Playbook::PbTextInput::AddOn
27
27
 
28
28
  def classname
29
- generate_classname("pb_text_input_kit") + error_class + inline_class
29
+ default_margin_bottom = margin_bottom.present? ? "" : " mb_sm"
30
+ generate_classname("pb_text_input_kit") + default_margin_bottom + error_class + inline_class
30
31
  end
31
32
 
32
33
  def input_tag
@@ -42,7 +43,7 @@ module Playbook
42
43
  end
43
44
 
44
45
  def add_on_props
45
- { dark: dark }.merge(add_on || {})
46
+ { dark: }.merge(add_on || {})
46
47
  end
47
48
 
48
49
  private
@@ -52,14 +53,14 @@ module Playbook
52
53
  autocomplete: autocomplete ? nil : "off",
53
54
  class: "text_input #{input_options.dig(:classname) || ''}",
54
55
  data: validation_data,
55
- disabled: disabled,
56
+ disabled:,
56
57
  id: input_options.dig(:id) || id,
57
- name: name,
58
+ name:,
58
59
  pattern: validation_pattern,
59
- placeholder: placeholder,
60
- required: required,
61
- type: type,
62
- value: value,
60
+ placeholder:,
61
+ required:,
62
+ type:,
63
+ value:,
63
64
  }.merge(input_options)
64
65
  end
65
66
 
@@ -16,7 +16,7 @@ test('returns namespaced class name', () => {
16
16
  )
17
17
 
18
18
  const kit = screen.getByTestId(testId)
19
- expect(kit).toHaveClass(kitClass)
19
+ expect(kit).toHaveClass(`${kitClass} mb_sm`)
20
20
  })
21
21
 
22
22
  test('returns additional class name', () => {
@@ -23,13 +23,13 @@ module Playbook
23
23
  {
24
24
  chartData: chart_data,
25
25
  className: classname,
26
- colors: colors,
26
+ colors:,
27
27
  dark: dark ? "dark" : "",
28
- drillable: drillable,
29
- grouped: grouped,
30
- height: height,
31
- id: id,
32
- title: title,
28
+ drillable:,
29
+ grouped:,
30
+ height:,
31
+ id:,
32
+ title:,
33
33
  tooltipHtml: tooltip_html,
34
34
  type: chart_type,
35
35
  }
@@ -57,17 +57,17 @@ module Playbook
57
57
 
58
58
  def typeahead_react_options
59
59
  base_options = {
60
- dark: dark,
60
+ dark:,
61
61
  defaultValue: default_options,
62
- error: error,
63
- id: id,
64
- inline: inline,
62
+ error:,
63
+ id:,
64
+ inline:,
65
65
  isMulti: is_multi,
66
- label: label,
66
+ label:,
67
67
  multiKit: multi_kit,
68
- name: name,
69
- options: options,
70
- placeholder: placeholder,
68
+ name:,
69
+ options:,
70
+ placeholder:,
71
71
  plusIcon: plus_icon,
72
72
  }
73
73