playbook_ui 6.0.1.pre.alpha4 → 6.1.0.pre.alpha2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (179) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/_playbook.scss +3 -1
  3. data/app/pb_kits/playbook/data/menu.yml +4 -2
  4. data/app/pb_kits/playbook/index.js +2 -0
  5. data/app/pb_kits/playbook/packs/examples.js +5 -0
  6. data/app/pb_kits/playbook/pb_avatar/_avatar.jsx +2 -2
  7. data/app/pb_kits/playbook/pb_badge/_badge.jsx +2 -5
  8. data/app/pb_kits/playbook/pb_badge/_badge.scss +1 -1
  9. data/app/pb_kits/playbook/pb_badge/badge.rb +1 -6
  10. data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.jsx +2 -2
  11. data/app/pb_kits/playbook/pb_body/_body.jsx +3 -6
  12. data/app/pb_kits/playbook/pb_body/_body.scss +6 -0
  13. data/app/pb_kits/playbook/pb_body/body.rb +2 -8
  14. data/app/pb_kits/playbook/pb_button/_button.jsx +2 -5
  15. data/app/pb_kits/playbook/pb_button/_button.scss +1 -1
  16. data/app/pb_kits/playbook/pb_button/button.rb +1 -7
  17. data/app/pb_kits/playbook/pb_button/docs/_button_default.jsx +2 -0
  18. data/app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.html.erb +7 -0
  19. data/app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.jsx +52 -0
  20. data/app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.scss +101 -0
  21. data/app/pb_kits/playbook/pb_button_toolbar/button_toolbar.rb +29 -0
  22. data/app/pb_kits/playbook/pb_button_toolbar/docs/_button_toolbar_default.html.erb +7 -0
  23. data/app/pb_kits/playbook/pb_button_toolbar/docs/_button_toolbar_default.jsx +29 -0
  24. data/app/pb_kits/playbook/pb_button_toolbar/docs/_button_toolbar_secondary.html.erb +7 -0
  25. data/app/pb_kits/playbook/pb_button_toolbar/docs/_button_toolbar_secondary.jsx +34 -0
  26. data/app/pb_kits/playbook/pb_button_toolbar/docs/_button_toolbar_vertical.html.erb +11 -0
  27. data/app/pb_kits/playbook/pb_button_toolbar/docs/_button_toolbar_vertical.jsx +29 -0
  28. data/app/pb_kits/playbook/pb_button_toolbar/docs/_button_toolbar_vertical_secondary.html.erb +11 -0
  29. data/app/pb_kits/playbook/pb_button_toolbar/docs/_button_toolbar_vertical_secondary.jsx +34 -0
  30. data/app/pb_kits/playbook/pb_button_toolbar/docs/_description.md +1 -0
  31. data/app/pb_kits/playbook/pb_button_toolbar/docs/example.yml +15 -0
  32. data/app/pb_kits/playbook/pb_button_toolbar/docs/index.js +4 -0
  33. data/app/pb_kits/playbook/pb_caption/_caption.jsx +3 -7
  34. data/app/pb_kits/playbook/pb_caption/_caption.scss +0 -4
  35. data/app/pb_kits/playbook/pb_caption/caption.rb +1 -8
  36. data/app/pb_kits/playbook/pb_card/_card.jsx +17 -14
  37. data/app/pb_kits/playbook/pb_card/_card.scss +4 -1
  38. data/app/pb_kits/playbook/pb_card/card.rb +2 -9
  39. data/app/pb_kits/playbook/pb_card/docs/_card_dark.html.erb +1 -1
  40. data/app/pb_kits/playbook/pb_checkbox/_checkbox.jsx +2 -2
  41. data/app/pb_kits/playbook/pb_checkbox/checkbox.rb +1 -8
  42. data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.jsx +2 -2
  43. data/app/pb_kits/playbook/pb_circle_icon_button/circle_icon_button.rb +0 -2
  44. data/app/pb_kits/playbook/pb_contact/_contact.jsx +2 -2
  45. data/app/pb_kits/playbook/pb_currency/_currency.jsx +2 -2
  46. data/app/pb_kits/playbook/pb_dashboard/pbChartsLightTheme.js +26 -0
  47. data/app/pb_kits/playbook/pb_dashboard_value/_dashboard_value.jsx +2 -2
  48. data/app/pb_kits/playbook/pb_date/_date.jsx +4 -4
  49. data/app/pb_kits/playbook/pb_date_picker/_date_picker.jsx +2 -2
  50. data/app/pb_kits/playbook/pb_date_range_inline/_date_range_inline.jsx +2 -2
  51. data/app/pb_kits/playbook/pb_date_range_stacked/_date_range_stacked.jsx +2 -2
  52. data/app/pb_kits/playbook/pb_date_stacked/_date_stacked.jsx +2 -2
  53. data/app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.jsx +2 -2
  54. data/app/pb_kits/playbook/pb_date_year_stacked/_date_year_stacked.jsx +2 -2
  55. data/app/pb_kits/playbook/pb_distribution_bar/_distribution_bar.jsx +2 -2
  56. data/app/pb_kits/playbook/pb_file_upload/_file_upload.jsx +2 -2
  57. data/app/pb_kits/playbook/pb_filter/Filter/FilterBackground.jsx +2 -2
  58. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.jsx +2 -2
  59. data/app/pb_kits/playbook/pb_flex/_flex.jsx +2 -2
  60. data/app/pb_kits/playbook/pb_flex/_flex_item.jsx +2 -2
  61. data/app/pb_kits/playbook/pb_form/docs/_form_form_with.html.erb +2 -2
  62. data/app/pb_kits/playbook/pb_form/docs/_form_form_with_validate.html.erb +2 -2
  63. data/app/pb_kits/playbook/pb_form/docs/_form_simple_form.html.erb +1 -1
  64. data/app/pb_kits/playbook/pb_form/docs/_form_simple_form_validate.html.erb +1 -1
  65. data/app/pb_kits/playbook/pb_form_pill/_form_pill.jsx +2 -2
  66. data/app/pb_kits/playbook/pb_gauge/_gauge.html.erb +12 -0
  67. data/app/pb_kits/playbook/pb_gauge/_gauge.jsx +110 -0
  68. data/app/pb_kits/playbook/pb_gauge/_gauge.scss +11 -0
  69. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_default.html.erb +11 -0
  70. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_default.jsx +17 -0
  71. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_disable_animation.html.erb +12 -0
  72. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_disable_animation.jsx +18 -0
  73. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_full_circle.html.erb +14 -0
  74. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_full_circle.jsx +20 -0
  75. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_height.html.erb +15 -0
  76. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_height.jsx +23 -0
  77. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_live_data.jsx +40 -0
  78. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_min_max.html.erb +15 -0
  79. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_min_max.jsx +21 -0
  80. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_min_max.md +1 -0
  81. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_sizing.html.erb +26 -0
  82. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_sizing.jsx +37 -0
  83. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_sizing.md +1 -0
  84. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_title.html.erb +14 -0
  85. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_title.jsx +20 -0
  86. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_units.html.erb +29 -0
  87. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_units.jsx +29 -0
  88. data/app/pb_kits/playbook/pb_gauge/docs/example.yml +24 -0
  89. data/app/pb_kits/playbook/pb_gauge/docs/index.js +9 -0
  90. data/app/pb_kits/playbook/pb_gauge/gauge.rb +57 -0
  91. data/app/pb_kits/playbook/pb_hashtag/_hashtag.jsx +2 -2
  92. data/app/pb_kits/playbook/pb_highlight/_highlight.jsx +2 -2
  93. data/app/pb_kits/playbook/pb_home_address_street/_home_address_street.jsx +2 -2
  94. data/app/pb_kits/playbook/pb_icon/_icon.jsx +2 -2
  95. data/app/pb_kits/playbook/pb_icon_circle/_icon_circle.jsx +2 -2
  96. data/app/pb_kits/playbook/pb_icon_value/_icon_value.jsx +2 -2
  97. data/app/pb_kits/playbook/pb_image/_image.jsx +2 -2
  98. data/app/pb_kits/playbook/pb_kit/dateTime.js +5 -1
  99. data/app/pb_kits/playbook/pb_label_pill/_label_pill.jsx +2 -2
  100. data/app/pb_kits/playbook/pb_label_value/_label_value.jsx +2 -2
  101. data/app/pb_kits/playbook/pb_layout/_layout.jsx +6 -6
  102. data/app/pb_kits/playbook/pb_legend/_legend.jsx +2 -2
  103. data/app/pb_kits/playbook/pb_line_graph/_line_graph.jsx +2 -2
  104. data/app/pb_kits/playbook/pb_list/_list.jsx +2 -2
  105. data/app/pb_kits/playbook/pb_list/_list_item.jsx +2 -2
  106. data/app/pb_kits/playbook/pb_loading_inline/_loading_inline.jsx +2 -2
  107. data/app/pb_kits/playbook/pb_logistic/_logistic.jsx +111 -0
  108. data/app/pb_kits/playbook/pb_message/_message.jsx +2 -2
  109. data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.jsx +2 -2
  110. data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.jsx +2 -2
  111. data/app/pb_kits/playbook/pb_nav/_nav.jsx +2 -2
  112. data/app/pb_kits/playbook/pb_online_status/_online_status.jsx +2 -2
  113. data/app/pb_kits/playbook/pb_person/_person.jsx +2 -2
  114. data/app/pb_kits/playbook/pb_person_contact/_person_contact.jsx +2 -2
  115. data/app/pb_kits/playbook/pb_pill/_pill.jsx +2 -2
  116. data/app/pb_kits/playbook/pb_popover/_popover.jsx +2 -2
  117. data/app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx +5 -5
  118. data/app/pb_kits/playbook/pb_progress_pills/_progress_pills.jsx +2 -2
  119. data/app/pb_kits/playbook/pb_progress_simple/_progress_simple.jsx +2 -2
  120. data/app/pb_kits/playbook/pb_progress_step/_progress_step.jsx +2 -2
  121. data/app/pb_kits/playbook/pb_radio/_radio.jsx +2 -2
  122. data/app/pb_kits/playbook/pb_section_separator/_section_separator.jsx +2 -2
  123. data/app/pb_kits/playbook/pb_select/_select.jsx +2 -2
  124. data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.jsx +12 -16
  125. data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.scss +1 -1
  126. data/app/pb_kits/playbook/pb_selectable_card/selectable_card.rb +1 -7
  127. data/app/pb_kits/playbook/pb_selectable_card_icon/_selectable_card_icon.jsx +26 -26
  128. data/app/pb_kits/playbook/pb_selectable_card_icon/_selectable_card_icon.scss +1 -1
  129. data/app/pb_kits/playbook/pb_selectable_card_icon/selectable_card_icon.rb +1 -8
  130. data/app/pb_kits/playbook/pb_selectable_icon/_selectable_icon.jsx +8 -10
  131. data/app/pb_kits/playbook/pb_selectable_icon/_selectable_icon.scss +1 -1
  132. data/app/pb_kits/playbook/pb_selectable_icon/selectable_icon.rb +1 -7
  133. data/app/pb_kits/playbook/pb_stat_change/_stat_change.jsx +2 -2
  134. data/app/pb_kits/playbook/pb_stat_value/_stat_value.jsx +2 -2
  135. data/app/pb_kits/playbook/pb_table/_table.jsx +2 -2
  136. data/app/pb_kits/playbook/pb_table/_table_row.jsx +2 -2
  137. data/app/pb_kits/playbook/pb_text_input/_text_input.jsx +2 -2
  138. data/app/pb_kits/playbook/pb_textarea/_textarea.html.erb +1 -1
  139. data/app/pb_kits/playbook/pb_textarea/_textarea.jsx +2 -2
  140. data/app/pb_kits/playbook/pb_textarea/_textarea.scss +2 -1
  141. data/app/pb_kits/playbook/pb_time/_time.jsx +57 -14
  142. data/app/pb_kits/playbook/pb_time/_time.scss +17 -0
  143. data/app/pb_kits/playbook/pb_time/docs/_time_align.jsx +27 -0
  144. data/app/pb_kits/playbook/pb_time/docs/_time_dark.jsx +28 -0
  145. data/app/pb_kits/playbook/pb_time/docs/_time_default.jsx +28 -0
  146. data/app/pb_kits/playbook/pb_time/docs/_time_timestamp.jsx +32 -0
  147. data/app/pb_kits/playbook/pb_time/docs/example.yml +4 -0
  148. data/app/pb_kits/playbook/pb_time/docs/index.js +4 -0
  149. data/app/pb_kits/playbook/pb_time_range_inline/_time_range_inline.jsx +2 -2
  150. data/app/pb_kits/playbook/pb_time_stacked/_time_stacked.jsx +2 -2
  151. data/app/pb_kits/playbook/pb_timestamp/_timestamp.jsx +2 -2
  152. data/app/pb_kits/playbook/pb_title/_title.jsx +3 -6
  153. data/app/pb_kits/playbook/pb_title/_title.scss +1 -1
  154. data/app/pb_kits/playbook/pb_title/title.rb +1 -9
  155. data/app/pb_kits/playbook/pb_title_count/_title_count.jsx +2 -2
  156. data/app/pb_kits/playbook/pb_title_detail/_title_detail.jsx +2 -2
  157. data/app/pb_kits/playbook/pb_toggle/_toggle.jsx +39 -31
  158. data/app/pb_kits/playbook/pb_toggle/docs/_toggle_custom.jsx +31 -0
  159. data/app/pb_kits/playbook/pb_toggle/docs/_toggle_custom_radio.html.erb +6 -6
  160. data/app/pb_kits/playbook/pb_toggle/docs/_toggle_custom_radio.jsx +72 -0
  161. data/app/pb_kits/playbook/pb_toggle/docs/_toggle_default.html.erb +1 -3
  162. data/app/pb_kits/playbook/pb_toggle/docs/_toggle_default.jsx +6 -19
  163. data/app/pb_kits/playbook/pb_toggle/docs/_toggle_name.jsx +57 -0
  164. data/app/pb_kits/playbook/pb_toggle/docs/{_toggle_checked.html.erb → _toggle_size.html.erb} +2 -2
  165. data/app/pb_kits/playbook/pb_toggle/docs/_toggle_size.jsx +44 -0
  166. data/app/pb_kits/playbook/pb_toggle/docs/example.yml +8 -5
  167. data/app/pb_kits/playbook/pb_toggle/docs/index.js +4 -2
  168. data/app/pb_kits/playbook/pb_user/_user.jsx +2 -2
  169. data/app/pb_kits/playbook/pb_user_badge/_user_badge.jsx +2 -2
  170. data/app/pb_kits/playbook/pb_weekday_stacked/_weekday_stacked.jsx +2 -2
  171. data/app/pb_kits/playbook/plugins/pb_chart.js +74 -0
  172. data/app/pb_kits/playbook/props.rb +6 -0
  173. data/app/pb_kits/playbook/utilities/{spacing.js → globalProps.js} +14 -1
  174. data/app/pb_kits/playbook/utilities/props.js +1 -0
  175. data/lib/generators/kit/templates/kit_jsx.erb.tt +2 -2
  176. data/lib/playbook/version.rb +1 -1
  177. metadata +53 -6
  178. data/app/pb_kits/playbook/pb_toggle/docs/_toggle_accessibility.jsx +0 -12
  179. data/app/pb_kits/playbook/pb_toggle/docs/_toggle_data.jsx +0 -15
@@ -0,0 +1,37 @@
1
+ import React from 'react'
2
+ import { Flex, FlexItem, Gauge } from '../../'
3
+
4
+ const GaugeSizing = () => (
5
+ <div>
6
+ <Flex
7
+ wrap
8
+ >
9
+ <FlexItem fixedSize="400px">
10
+ <Gauge
11
+ chartData={[ { name: 'Point 1', value: 100 } ]}
12
+ id="gauge-sizing4"
13
+ />
14
+ </FlexItem>
15
+ <FlexItem fixedSize="300px">
16
+ <Gauge
17
+ chartData={[ { name: 'Point 2', value: 75 } ]}
18
+ id="gauge-sizing3"
19
+ />
20
+ </FlexItem>
21
+ <FlexItem fixedSize="200px">
22
+ <Gauge
23
+ chartData={[ { name: 'Point 3', value: 50 } ]}
24
+ id="gauge-sizing2"
25
+ />
26
+ </FlexItem>
27
+ <FlexItem fixedSize="125px">
28
+ <Gauge
29
+ chartData={[ { name: 'Point 4', value: 25 } ]}
30
+ id="gauge-sizing1"
31
+ />
32
+ </FlexItem>
33
+ </Flex>
34
+ </div>
35
+ )
36
+
37
+ export default GaugeSizing
@@ -0,0 +1 @@
1
+ ### Gauge resizes dynamically to fit whatever element it's placed within.
@@ -0,0 +1,14 @@
1
+ <% data = [
2
+ {
3
+ name: 'Score',
4
+ value: 780,
5
+ }
6
+ ]%>
7
+
8
+ <%= pb_rails("gauge", props: {
9
+ id: "gauge-title",
10
+ chart_data: data,
11
+ min: 300,
12
+ max: 850,
13
+ title: "Credit Score",
14
+ }) %>
@@ -0,0 +1,20 @@
1
+ import React from 'react'
2
+ import { Gauge } from '../../'
3
+
4
+ const data = [
5
+ { name: 'Score', value: 780 },
6
+ ]
7
+
8
+ const GaugeTitle = () => (
9
+ <div>
10
+ <Gauge
11
+ chartData={data}
12
+ id="gauge-title"
13
+ max={850}
14
+ min={300}
15
+ title="Credit Score"
16
+ />
17
+ </div>
18
+ )
19
+
20
+ export default GaugeTitle
@@ -0,0 +1,29 @@
1
+ <% data1 = [
2
+ {
3
+ name: 'Data Used',
4
+ value: 32,
5
+ }
6
+ ]%>
7
+
8
+ <%= pb_rails("gauge", props: {
9
+ id: "gauge-units1",
10
+ chart_data: data1,
11
+ title: "Data Usage",
12
+ suffix: "GB"
13
+ }) %>
14
+
15
+ <% data2 = [
16
+ {
17
+ name: 'Sales to Date',
18
+ value: 65,
19
+ }
20
+ ]%>
21
+
22
+ <%= pb_rails("gauge", props: {
23
+ id: "gauge-units2",
24
+ chart_data: data2,
25
+ title: "Sales Goal",
26
+ prefix: "$",
27
+ suffix: "k",
28
+
29
+ }) %>
@@ -0,0 +1,29 @@
1
+ import React from 'react'
2
+ import { Gauge } from '../../'
3
+
4
+ const data1 = [
5
+ { name: 'Data Used', value: 32 },
6
+ ]
7
+ const data2 = [
8
+ { name: 'Sales to Date', value: 65 },
9
+ ]
10
+
11
+ const GaugeUnits = () => (
12
+ <div>
13
+ <Gauge
14
+ chartData={data1}
15
+ id="gauge-units1"
16
+ suffix="GB"
17
+ title="Data Usage"
18
+ />
19
+ <Gauge
20
+ chartData={data2}
21
+ id="gauge-units2"
22
+ prefix="$"
23
+ suffix="k"
24
+ title="Sales Goal"
25
+ />
26
+ </div>
27
+ )
28
+
29
+ export default GaugeUnits
@@ -0,0 +1,24 @@
1
+ examples:
2
+
3
+ rails:
4
+ - gauge_default: Default
5
+ - gauge_disable_animation: Disable Animation
6
+ - gauge_title: Title
7
+ - gauge_units: Units
8
+ - gauge_full_circle: Full Circle
9
+ - gauge_min_max: Min Max Labels
10
+ - gauge_sizing: Sizing
11
+ - gauge_height: Height
12
+
13
+
14
+ react:
15
+ - gauge_default: Default
16
+ - gauge_disable_animation: Disable Animation
17
+ - gauge_title: Title
18
+ - gauge_units: Units
19
+ - gauge_full_circle: Full Circle
20
+ - gauge_min_max: Min Max Labels
21
+ - gauge_sizing: Sizing
22
+ - gauge_height: Height
23
+ - gauge_live_data: Live Data
24
+
@@ -0,0 +1,9 @@
1
+ export { default as GaugeDefault } from './_gauge_default.jsx'
2
+ export { default as GaugeDisableAnimation } from './_gauge_disable_animation.jsx'
3
+ export { default as GaugeFullCircle } from './_gauge_full_circle.jsx'
4
+ export { default as GaugeHeight } from './_gauge_height.jsx'
5
+ export { default as GaugeMinMax } from './_gauge_min_max.jsx'
6
+ export { default as GaugeSizing } from './_gauge_sizing.jsx'
7
+ export { default as GaugeTitle } from './_gauge_title.jsx'
8
+ export { default as GaugeUnits } from './_gauge_units.jsx'
9
+ export { default as GaugeLiveData } from './_gauge_live_data.jsx'
@@ -0,0 +1,57 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Playbook
4
+ module PbGauge
5
+ class Gauge
6
+ include Playbook::Props
7
+
8
+ partial "pb_gauge/gauge"
9
+
10
+ prop :chart_data, type: Playbook::Props::Array,
11
+ default: [{ name: "Name", value: 0 }]
12
+ prop :style, type: Playbook::Props::Enum,
13
+ values: %w[solidgauge],
14
+ default: "solidgauge"
15
+ prop :title, type: Playbook::Props::String, default: ""
16
+ prop :prefix, type: Playbook::Props::String, default: ""
17
+ prop :suffix, type: Playbook::Props::String, default: ""
18
+ prop :height, type: Playbook::Props::String, default: nil
19
+ prop :tooltip_html, default: '<span style="font-weight: bold; color:{point.color};">●</span>
20
+ {point.name}: ' + '<b>{point.y}
21
+ </b>'
22
+ prop :full_circle, type: Playbook::Props::Boolean, default: false
23
+ prop :show_labels, type: Playbook::Props::Boolean, default: false
24
+ prop :disable_animation, type: Playbook::Props::Boolean, default: false
25
+ prop :min, type: Playbook::Props::Numeric, default: 0
26
+ prop :max, type: Playbook::Props::Numeric, default: 100
27
+
28
+ def chart_data_formatted
29
+ chart_data.map { |hash| hash[:y] = hash.delete :value }
30
+ chart_data
31
+ end
32
+
33
+ def chart_options
34
+ {
35
+ id: id,
36
+ chartData: chart_data_formatted,
37
+ circumference: full_circle ? [0, 360] : [-100, 100],
38
+ disableAnimation: disable_animation,
39
+ height: height,
40
+ min: min,
41
+ max: max,
42
+ title: title,
43
+ suffix: suffix,
44
+ prefix: prefix,
45
+ showLabels: show_labels,
46
+ style: style,
47
+ tooltipHtml: tooltip_html,
48
+ type: "gauge",
49
+ }.to_json.html_safe
50
+ end
51
+
52
+ def classname
53
+ generate_classname("pb_gauge_kit")
54
+ end
55
+ end
56
+ end
57
+ end
@@ -6,7 +6,7 @@ import classnames from 'classnames'
6
6
 
7
7
  import { Badge } from '../'
8
8
  import { buildCss } from '../utilities/props'
9
- import { spacing } from '../utilities/spacing.js'
9
+ import { globalProps } from '../utilities/globalProps.js'
10
10
 
11
11
  type HashtagProps = {
12
12
  className?: String,
@@ -32,7 +32,7 @@ const Hashtag = (props: HashtagProps) => {
32
32
  className={classnames(
33
33
  className,
34
34
  buildCss('pb_hashtag_kit', { dark: dark }),
35
- spacing(props)
35
+ globalProps(props)
36
36
  )}
37
37
  >
38
38
  <a href={url}>
@@ -3,7 +3,7 @@
3
3
  import Highlighter from 'react-highlight-words'
4
4
  import React from 'react'
5
5
  import classnames from 'classnames'
6
- import { spacing } from '../utilities/spacing.js'
6
+ import { globalProps } from '../utilities/globalProps.js'
7
7
 
8
8
  type HighlightProps = {
9
9
  className?: String,
@@ -27,7 +27,7 @@ const Highlight = (props: HighlightProps) => {
27
27
  <Highlighter
28
28
  autoEscape
29
29
  data={data}
30
- highlightClassName={classnames(className, spacing(props))}
30
+ highlightClassName={classnames(className, globalProps(props))}
31
31
  highlightTag="span"
32
32
  id={id}
33
33
  searchWords={highlightedText}
@@ -5,7 +5,7 @@ import classnames from 'classnames'
5
5
 
6
6
  import { joinPresent, titleize } from '../utilities/text'
7
7
  import { Body, Hashtag, Title } from '../'
8
- import { spacing } from '../utilities/spacing.js'
8
+ import { globalProps } from '../utilities/globalProps.js'
9
9
 
10
10
  type HomeAddressStreetProps = {
11
11
  address: String,
@@ -45,7 +45,7 @@ const HomeAddressStreet = (props: HomeAddressStreetProps) => {
45
45
  'pb_home_address_street': !dark,
46
46
  'pb_home_address_street_dark': dark,
47
47
  },
48
- spacing(props)
48
+ globalProps(props)
49
49
  )
50
50
  return (
51
51
  <div className={classes(className, dark)}>
@@ -2,7 +2,7 @@
2
2
 
3
3
  import React from 'react'
4
4
  import classnames from 'classnames'
5
- import { spacing } from '../utilities/spacing.js'
5
+ import { globalProps } from '../utilities/globalProps.js'
6
6
 
7
7
  type IconProps = {
8
8
  aria?: Object,
@@ -72,7 +72,7 @@ const Icon = (props: IconProps) => {
72
72
  [`fa-pull-${pull}`]: pull,
73
73
  [`fa-rotate-${rotation}`]: rotation,
74
74
  },
75
- spacing(props)
75
+ globalProps(props)
76
76
  )
77
77
 
78
78
  return (
@@ -6,7 +6,7 @@ import classnames from 'classnames'
6
6
 
7
7
  import { Icon } from '../'
8
8
  import { buildCss } from '../utilities/props'
9
- import { spacing } from '../utilities/spacing.js'
9
+ import { globalProps } from '../utilities/globalProps.js'
10
10
 
11
11
  type IconCircleProps = {
12
12
  className?: string,
@@ -27,7 +27,7 @@ const IconCircle = (props: IconCircleProps) => {
27
27
  const css = buildCss('pb_icon_circle_kit', size, variant)
28
28
 
29
29
  return (
30
- <div className={classnames(className, css, spacing(props))}>
30
+ <div className={classnames(className, css, globalProps(props))}>
31
31
  <Icon icon={icon} />
32
32
  </div>
33
33
  )
@@ -6,7 +6,7 @@ import { Body, Icon } from '../'
6
6
 
7
7
  import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
8
8
 
9
- import { spacing } from '../utilities/spacing.js'
9
+ import { globalProps } from '../utilities/globalProps.js'
10
10
 
11
11
  type IconValueProps = {
12
12
  align?: "left" | "center" | "right",
@@ -36,7 +36,7 @@ const IconValue = (props: IconValueProps) => {
36
36
  <div
37
37
  {...ariaProps}
38
38
  {...dataProps}
39
- className={classnames(className, pbCss, spacing(props))}
39
+ className={classnames(className, pbCss, globalProps(props))}
40
40
  id={id}
41
41
  >
42
42
  <Body color="light">
@@ -2,8 +2,8 @@
2
2
 
3
3
  import React from 'react'
4
4
  import classnames from 'classnames'
5
+ import { globalProps } from '../utilities/globalProps.js'
5
6
  import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
6
- import { spacing } from '../utilities/spacing.js'
7
7
 
8
8
  type ImageProps = {
9
9
  alt?: String,
@@ -25,7 +25,7 @@ const Image = (props: ImageProps) => {
25
25
  } = props
26
26
 
27
27
  const ariaProps = buildAriaProps(aria)
28
- const classes = classnames(buildCss('pb_image lazyload blur_up'), className, spacing(props))
28
+ const classes = classnames(buildCss('pb_image lazyload blur_up'), className, globalProps(props))
29
29
  const dataProps = buildDataProps(data)
30
30
 
31
31
  return (
@@ -74,7 +74,11 @@ export default class DateTime {
74
74
  }
75
75
 
76
76
  toTime() {
77
- return this.value.strftime('%I:%M')
77
+ const time = this.value.strftime('%I:%M')
78
+
79
+ // strftime adds a leading 0 on single hour times. ie 08:31.
80
+ // this removes that 0 to match the rails kit.
81
+ return time.charAt() === '0' ? time.slice(1) : time
78
82
  }
79
83
 
80
84
  toTimezone() {
@@ -2,7 +2,7 @@
2
2
 
3
3
  import React from 'react'
4
4
  import classnames from 'classnames'
5
- import { spacing } from '../utilities/spacing.js'
5
+ import { globalProps } from '../utilities/globalProps.js'
6
6
 
7
7
  import { buildAriaProps, buildDataProps } from '../utilities/props'
8
8
 
@@ -30,7 +30,7 @@ const LabelPill = (props: LabelPillProps) => {
30
30
  } = props
31
31
  const ariaProps = buildAriaProps(aria)
32
32
  const dataProps = buildDataProps(data)
33
- const css = classnames(['pb_label_pill_kit', className], spacing(props))
33
+ const css = classnames(['pb_label_pill_kit', className], globalProps(props))
34
34
 
35
35
  return (
36
36
  <div
@@ -4,8 +4,8 @@ import React from 'react'
4
4
  import classnames from 'classnames'
5
5
  import DateTime from '../pb_kit/dateTime.js'
6
6
  import { buildAriaProps, buildDataProps } from '../utilities/props'
7
+ import { globalProps } from '../utilities/globalProps.js'
7
8
  import { Body, Caption, Flex, Icon, Title } from '../'
8
- import { spacing } from '../utilities/spacing.js'
9
9
 
10
10
  type LabelValueProps = {
11
11
  aria?: object,
@@ -53,7 +53,7 @@ const LabelValue = (props: LabelValueProps) => {
53
53
  const themeStyle = dark === true ? '_dark' : ''
54
54
  const css = classnames(
55
55
  ['pb_label_value_kit' + themeStyle, className],
56
- spacing(props)
56
+ globalProps(props)
57
57
  )
58
58
 
59
59
  return (
@@ -4,7 +4,7 @@ import React from 'react'
4
4
  import classnames from 'classnames'
5
5
  import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
6
6
 
7
- import { spacing } from '../utilities/spacing.js'
7
+ import { globalProps } from '../utilities/globalProps.js'
8
8
 
9
9
  type LayoutPropTypes = {
10
10
  aria?: object,
@@ -46,7 +46,7 @@ type LayoutFooterProps = {
46
46
  const Side = (props: LayoutSideProps) => {
47
47
  const { children, className } = props
48
48
  return (
49
- <div className={classnames('layout_sidebar', className, spacing(props))}>
49
+ <div className={classnames('layout_sidebar', className, globalProps(props))}>
50
50
  {children}
51
51
  </div>
52
52
  )
@@ -56,7 +56,7 @@ const Side = (props: LayoutSideProps) => {
56
56
  const Body = (props: LayoutBodyProps) => {
57
57
  const { children, className } = props
58
58
  return (
59
- <div className={classnames('layout_body', className, spacing(props))}>
59
+ <div className={classnames('layout_body', className, globalProps(props))}>
60
60
  {children}
61
61
  </div>
62
62
  )
@@ -66,7 +66,7 @@ const Body = (props: LayoutBodyProps) => {
66
66
  const Header = (props: LayoutHeaderProps) => {
67
67
  const { children, className } = props
68
68
  return (
69
- <div className={classnames('layout_header', className, spacing(props))}>
69
+ <div className={classnames('layout_header', className, globalProps(props))}>
70
70
  {children}
71
71
  </div>
72
72
  )
@@ -76,7 +76,7 @@ const Header = (props: LayoutHeaderProps) => {
76
76
  const Footer = (props: LayoutFooterProps) => {
77
77
  const { children, className } = props
78
78
  return (
79
- <div className={classnames('layout_footer', className, spacing(props))}>
79
+ <div className={classnames('layout_footer', className, globalProps(props))}>
80
80
  {children}
81
81
  </div>
82
82
  )
@@ -148,7 +148,7 @@ const Layout = (props: LayoutPropTypes) => {
148
148
  layoutCss,
149
149
  layoutCollapseCss,
150
150
  className,
151
- spacing(props)
151
+ globalProps(props)
152
152
  )}
153
153
  >
154
154
  {subComponentTags('Side')}