playbook_ui 15.0.0.pre.alpha.PLAY198710641 → 15.0.0.pre.alpha.PLAY236510413

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.
Files changed (103) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/_playbook.scss +1 -2
  3. data/app/pb_kits/playbook/pb_bar_graph/docs/example.yml +1 -0
  4. data/app/pb_kits/playbook/pb_card/_card.scss +4 -12
  5. data/app/pb_kits/playbook/pb_card/_card.tsx +3 -3
  6. data/app/pb_kits/playbook/pb_card/_card_mixin.scss +0 -10
  7. data/app/pb_kits/playbook/pb_card/docs/_card_highlight.html.erb +0 -3
  8. data/app/pb_kits/playbook/pb_card/docs/_card_highlight.jsx +0 -8
  9. data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +4 -6
  10. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.tsx +0 -9
  11. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.html.erb +3 -3
  12. data/app/pb_kits/playbook/pb_form/docs/_form_form_with.html.erb +0 -1
  13. data/app/pb_kits/playbook/pb_icon_button/_icon_button.tsx +0 -1
  14. data/app/pb_kits/playbook/pb_icon_button/icon_button.html.erb +1 -2
  15. data/app/pb_kits/playbook/pb_nav/_item.tsx +5 -19
  16. data/app/pb_kits/playbook/pb_nav/item.html.erb +2 -6
  17. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_custom_tooltip.md +1 -1
  18. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_legend_position.md +1 -1
  19. data/app/pb_kits/playbook/pb_timestamp/_timestamp.tsx +8 -24
  20. data/app/pb_kits/playbook/pb_timestamp/docs/_time_stamp_default.md +1 -0
  21. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_align.html.erb +10 -0
  22. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_align.jsx +9 -0
  23. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_default.html.erb +17 -3
  24. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_default.jsx +15 -0
  25. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_elapsed.html.erb +2 -0
  26. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_elapsed.jsx +2 -0
  27. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_timezones.html.erb +14 -0
  28. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_timezones.jsx +14 -0
  29. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_unstyled.html.erb +4 -0
  30. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_unstyled.jsx +4 -0
  31. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated.jsx +1 -0
  32. data/app/pb_kits/playbook/pb_timestamp/docs/example.yml +6 -18
  33. data/app/pb_kits/playbook/pb_timestamp/docs/index.js +0 -6
  34. data/app/pb_kits/playbook/pb_timestamp/timestamp.rb +7 -29
  35. data/app/pb_kits/playbook/pb_timestamp/timestamp.test.js +4 -69
  36. data/dist/chunks/{_line_graph-CUfJ7E4h.js → _line_graph-B5Dr0Huy.js} +1 -1
  37. data/dist/chunks/{_typeahead-DCp1lVJx.js → _typeahead-GbjDoSSQ.js} +2 -2
  38. data/dist/chunks/{_weekday_stacked-B-e7xOfU.js → _weekday_stacked-DjQv3Sok.js} +3 -3
  39. data/dist/chunks/vendor.js +1 -1
  40. data/dist/menu.yml +2 -10
  41. data/dist/playbook-doc.js +2 -2
  42. data/dist/playbook-rails-react-bindings.js +1 -1
  43. data/dist/playbook-rails.js +1 -1
  44. data/dist/playbook.css +1 -1
  45. data/lib/playbook/forms/builder/form_field_builder.rb +2 -37
  46. data/lib/playbook/version.rb +1 -1
  47. metadata +6 -61
  48. data/app/pb_kits/playbook/pb_pb_bar_graph/_pb_bar_graph.scss +0 -0
  49. data/app/pb_kits/playbook/pb_pb_bar_graph/_pb_bar_graph.tsx +0 -62
  50. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_colors.html.erb +0 -35
  51. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_colors.jsx +0 -49
  52. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_colors_rails.md +0 -1
  53. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_colors_react.md +0 -2
  54. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_default.html.erb +0 -38
  55. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_default.jsx +0 -51
  56. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_height.html.erb +0 -46
  57. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_height.jsx +0 -62
  58. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_height.md +0 -3
  59. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_horizontal.html.erb +0 -47
  60. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_horizontal.jsx +0 -60
  61. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend.html.erb +0 -25
  62. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend.jsx +0 -36
  63. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend_non_clickable.jsx +0 -44
  64. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend_position.html.erb +0 -100
  65. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend_position.jsx +0 -126
  66. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_negative_numbers.html.erb +0 -32
  67. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_negative_numbers.jsx +0 -48
  68. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_secondary_y_axis.html.erb +0 -68
  69. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_secondary_y_axis.jsx +0 -81
  70. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_spline.html.erb +0 -31
  71. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_spline.jsx +0 -42
  72. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_spline.md +0 -2
  73. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_stacked.html.erb +0 -35
  74. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_stacked.jsx +0 -51
  75. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/example.yml +0 -27
  76. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/index.js +0 -11
  77. data/app/pb_kits/playbook/pb_pb_bar_graph/pbBarGraphTheme.ts +0 -106
  78. data/app/pb_kits/playbook/pb_pb_bar_graph/pb_bar_graph.html.erb +0 -1
  79. data/app/pb_kits/playbook/pb_pb_bar_graph/pb_bar_graph.rb +0 -28
  80. data/app/pb_kits/playbook/pb_pb_bar_graph/pbbargraph.test.jsx +0 -31
  81. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_align.md +0 -1
  82. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_default.md +0 -1
  83. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_elapsed.md +0 -5
  84. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_current_year.html.erb +0 -12
  85. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_current_year.jsx +0 -25
  86. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_current_year.md +0 -1
  87. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_date.html.erb +0 -4
  88. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_date.jsx +0 -17
  89. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_date.md +0 -1
  90. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_time.html.erb +0 -18
  91. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_time.jsx +0 -44
  92. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_time.md +0 -1
  93. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_timezones.md +0 -1
  94. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated.md +0 -5
  95. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_current_year.html.erb +0 -16
  96. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_current_year.jsx +0 -30
  97. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_current_year.md +0 -1
  98. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_date.html.erb +0 -16
  99. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_date.jsx +0 -30
  100. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_date.md +0 -1
  101. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_time.html.erb +0 -26
  102. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_time.jsx +0 -41
  103. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_time.md +0 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4f692a3e63d89de4fe158b94d5114817e3e6dfd45108fb5ea88dec73f8a3362b
4
- data.tar.gz: b77805447d91e42a4167450176bcf1772ed6d9bed5231786cde8cf6ce3929651
3
+ metadata.gz: c2160795c8e7884b53baf24a0caf41501a31484abfc2558b1cda1eb92c78e156
4
+ data.tar.gz: 0bd79d78760dc7617e1ab5a232a703ebb5c20fda537b2bcc8e45d0f69dc36260
5
5
  SHA512:
6
- metadata.gz: f6619f4dc7594a4b1e2cf846f29847640f6ae076afc3b60b1b2f385c37ced204c40b9355a63af0ea65aa9bb4ab2130f4c43198a48eaa2719761e91a9ebe61930
7
- data.tar.gz: e29fa8941bdf8b40ccae627949a91b336e52dc63e888b9b1c48e53b6588f39cbf5aac5c4bfaf53cdc7115c06b385e0f3ee96d791a25085e6ef6286e52d13d423
6
+ metadata.gz: '079e5354e33efd02c223d772f6ea1a0d4d16f1ac7631231e2ca5a841acc7178ab7e89f3475e6572999e6ed52a35288d3bffce23770d0321392ed532de27468a8'
7
+ data.tar.gz: 54c89d7d1eeae1d607b9df1a03aa4820dce84333731b67421b57be5e935b6170953929f86c4ebe8cf79b2029bc57b5d8bebf6ce1d0a92981d460f948b2eea5b5
@@ -33,6 +33,7 @@
33
33
  @import 'pb_distribution_bar/distribution_bar';
34
34
  @import 'pb_draggable/draggable';
35
35
  @import 'pb_dropdown/dropdown';
36
+ @import 'pb_empty_state/empty_state';
36
37
  @import 'pb_file_upload/file_upload';
37
38
  @import 'pb_filter/filter';
38
39
  @import 'pb_fixed_confirmation_toast/fixed_confirmation_toast';
@@ -108,8 +109,6 @@
108
109
  @import 'pb_user/user';
109
110
  @import 'pb_user_badge/user_badge';
110
111
  @import 'pb_weekday_stacked/weekday_stacked';
111
- @import 'pb_empty_state/empty_state';
112
- @import 'pb_pb_bar_graph/pb_bar_graph';
113
112
  @import 'pb_pb_circle_chart/pb_circle_chart';
114
113
  @import 'utilities/mixins';
115
114
  @import 'utilities/spacing';
@@ -4,6 +4,7 @@ examples:
4
4
  - bar_graph_default: Default
5
5
  - bar_graph_legend: Legend
6
6
  - bar_graph_legend_position: Legend Position
7
+ - bar_graph_legend_non_clickable: Legend Non Clickable
7
8
  - bar_graph_height: Height
8
9
  - bar_graph_spline: Spline
9
10
  - bar_graph_colors: Color Overrides
@@ -20,7 +20,7 @@
20
20
  // Dark mode
21
21
  .pb_card_kit.dark {
22
22
  @include pb_card_dark;
23
-
23
+
24
24
  &.pb_card_kit_selected {
25
25
  @include pb_card_selected_dark;
26
26
  }
@@ -33,8 +33,7 @@
33
33
 
34
34
  // Highlight styles
35
35
  .pb_card_kit_highlight_top,
36
- .pb_card_kit_highlight_side,
37
- .pb_card_kit_highlight_right_side {
36
+ .pb_card_kit_highlight_side {
38
37
  overflow: hidden;
39
38
  }
40
39
 
@@ -53,20 +52,13 @@
53
52
  }
54
53
  }
55
54
 
56
- // Highlight side variants
55
+ // Highlight side variants
57
56
  @each $color_name, $color_value in $pb_card_highlight_colors {
58
57
  .pb_card_kit_highlight_side.pb_card_kit_highlight_#{$color_name}::before {
59
58
  @include pb_card_highlight($pb_card_highlight_size, 100%, $color_value);
60
59
  }
61
60
  }
62
61
 
63
- // Highlight side right variants
64
- @each $color_name, $color_value in $pb_card_highlight_colors {
65
- .pb_card_kit_highlight_right_side.pb_card_kit_highlight_#{$color_name}::before {
66
- @include pb_card_right_highlight($pb_card_highlight_size, 100%, $color_value);
67
- }
68
- }
69
-
70
62
  // Card Header
71
63
  .pb_card_header_kit {
72
64
  flex-grow: 0;
@@ -76,7 +68,7 @@
76
68
  padding: $space_sm;
77
69
  border: 0;
78
70
  border-radius: $pb_card_header_border_radius $pb_card_header_border_radius 0px 0px;
79
-
71
+
80
72
  // Inherit border radius from parent card
81
73
  .pb_card_kit_border_radius_xs & {
82
74
  border-radius: $border_radius_xs $border_radius_xs 0px 0px;
@@ -26,7 +26,7 @@ type CardPropTypes = {
26
26
  dragHandle?: boolean,
27
27
  htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
28
28
  highlight?: {
29
- position?: "side" | "right_side" | "top",
29
+ position?: "side" | "top",
30
30
  color?: string,
31
31
  },
32
32
  id?: string,
@@ -56,7 +56,7 @@ const Header = (props: CardHeaderProps) => {
56
56
  const { children, className, headerColor = 'category_1', headerColorStriped = false } = props
57
57
  const headerColorCSS = `pb_card_header_kit_${headerColor}`
58
58
  const headerStripedCSS = headerColorStriped ? `pb_card_header_kit_${headerColor}_striped` : ''
59
-
59
+
60
60
  const headerCSS = classnames(
61
61
  'pb_card_header_kit',
62
62
  headerColorCSS,
@@ -108,7 +108,7 @@ const Card = (props: CardPropTypes): React.ReactElement => {
108
108
  const borderRadiusCSS = borderRadius !== 'md' ? `pb_card_kit_border_radius_${borderRadius}` : ''
109
109
  const highlightPositionCSS = highlight.position ? `pb_card_kit_highlight_${highlight.position}` : ''
110
110
  const highlightColorCSS = highlight.color ? `pb_card_kit_highlight_${highlight.color}` : ''
111
-
111
+
112
112
  const cardCss = classnames(
113
113
  'pb_card_kit', // Base class
114
114
  selectedCSS,
@@ -87,16 +87,6 @@ $pb_card_header_colors: map-merge(map-merge(map-merge($product_colors, $addition
87
87
  background: $background;
88
88
  }
89
89
 
90
- @mixin pb_card_right_highlight($width, $height, $background){
91
- content: "";
92
- position: absolute;
93
- top: 0;
94
- right: 0;
95
- width: $width;
96
- height: $height;
97
- background: $background;
98
- }
99
-
100
90
  @mixin pb_card_header_color($header_color) {
101
91
  background: $header_color;
102
92
  }
@@ -4,9 +4,6 @@
4
4
  <%= pb_rails("card", props: {highlight: {position: "top", color:"warning"}, margin_bottom: "sm"}) do %>
5
5
  Top Position & Warning Color
6
6
  <% end %>
7
- <%= pb_rails("card", props: {highlight: {position: "right_side", color:"product_5_highlight"}, margin_bottom: "sm"}) do %>
8
- Right Side Position & Product 5 Highlight Color
9
- <% end %>
10
7
  <%= pb_rails("card", props: {highlight: {position: "side", color:"category_2"}, margin_bottom: "sm"}) do %>
11
8
  Side Position & Category 2 Color
12
9
  <% end %>
@@ -21,14 +21,6 @@ const CardHighlight = (props) => {
21
21
  {'Top Position & Warning Color'}
22
22
  </Card>
23
23
 
24
- <Card
25
- {...props}
26
- highlight={{ position: 'right_side', color: 'product_5_highlight' }}
27
- marginBottom="sm"
28
- >
29
- {'Right Side Position & Product 5 Highlight Color'}
30
- </Card>
31
-
32
24
  <Card
33
25
  {...props}
34
26
  highlight={{ position: 'side', color: 'category_2' }}
@@ -210,12 +210,10 @@ const DatePicker = (props: DatePickerProps): React.ReactElement => {
210
210
  className="input_wrapper"
211
211
  >
212
212
 
213
- {!hideLabel && (
214
- <Caption
215
- className="pb_date_picker_kit_label"
216
- text={label}
217
- />
218
- )}
213
+ <Caption
214
+ className="pb_date_picker_kit_label"
215
+ text={hideLabel ? null : label}
216
+ />
219
217
  <>
220
218
  <div className="date_picker_input_wrapper">
221
219
  <input
@@ -35,7 +35,6 @@ type FixedConfirmationToastProps = {
35
35
 
36
36
  const FixedConfirmationToast = (props: FixedConfirmationToastProps): React.ReactElement => {
37
37
  const [showToast, toggleToast] = useState(true);
38
-
39
38
  const {
40
39
  autoClose = 0,
41
40
  children,
@@ -88,15 +87,8 @@ const FixedConfirmationToast = (props: FixedConfirmationToastProps): React.React
88
87
  <>
89
88
  {showToast && (
90
89
  <div
91
- aria-atomic="true"
92
- aria-live="polite"
93
90
  className={css}
94
91
  onClick={handleClick}
95
- onKeyDown={(e) => {
96
- if (e.key === "Enter" || e.key === " ") handleClick();
97
- }}
98
- role="status"
99
- tabIndex={0}
100
92
  {...htmlProps}
101
93
  >
102
94
  {returnedIcon && icon !== "none" && (
@@ -119,7 +111,6 @@ const FixedConfirmationToast = (props: FixedConfirmationToastProps): React.React
119
111
 
120
112
  {closeable && (
121
113
  <Icon
122
- aria={{ "label": "Close Toast" }}
123
114
  className="pb_icon"
124
115
  cursor="pointer"
125
116
  fixedWidth={false}
@@ -1,6 +1,6 @@
1
- <%= pb_content_tag(:div, "aria-atomic": "true", "aria-live": "polite", role: "status", tabindex: 0, onkeydown: "if(event.key==='Enter'||event.key===' '){ this.remove(); }" ) do %>
1
+ <%= pb_content_tag do %>
2
2
  <% if object.icon_value && object.icon_value != "none" %>
3
- <%= pb_rails("icon", props: { icon: object.icon_value, classname: "pb_icon", fixed_width: true, aria: { "aria-label": "#{object.icon_value} icon" } }) %>
3
+ <%= pb_rails("icon", props: { icon: object.icon_value, classname: "pb_icon", fixed_width: true }) %>
4
4
  <% end %>
5
5
  <% if content %>
6
6
  <%= content %>
@@ -8,5 +8,5 @@
8
8
  <%= pb_rails("title", props: { text: object.text, size: 4, flex: "1", classname: "pb_fixed_confirmation_toast_text" }) %>
9
9
  <% end %>
10
10
 
11
- <%= pb_rails("icon", props: { icon: "times", classname: "pb_icon", cursor: "pointer", fixed_width: true, aria: { "aria-label": "Close Toast" } }) if object.closeable %>
11
+ <%= pb_rails("icon", props: { icon: "times", classname: "pb_icon", cursor: "pointer", fixed_width: true }) if object.closeable %>
12
12
  <% end %>
@@ -91,7 +91,6 @@
91
91
  <%= pb_form_with(scope: :example, url: "", method: :get) do |form| %>
92
92
  <%= form.typeahead :example_typeahead, props: { data: { typeahead_example1: true, user: {} }, label: true, placeholder: "Search for a user" } %>
93
93
  <%= form.text_field :example_text_field, props: { label: true } %>
94
- <%= form.text_field :example_text_field_2, props: { label: "Text Field Custom Label" } %>
95
94
  <%= form.phone_number_field :example_phone_number_field, props: { label: "Example phone field", hidden_inputs: true } %>
96
95
  <%= form.email_field :example_email_field, props: { label: true } %>
97
96
  <%= form.number_field :example_number_field, props: { label: true } %>
@@ -51,7 +51,6 @@ const IconButton = (props: IconButtonProps) => {
51
51
  id={id}
52
52
  >
53
53
  <Button
54
- aria={aria}
55
54
  borderRadius="xs"
56
55
  htmlType={htmlType}
57
56
  link={link}
@@ -1,6 +1,5 @@
1
1
  <%= pb_content_tag do %>
2
- <%= pb_rails("button", props: { aria: object.aria,
3
- type: object.type,
2
+ <%= pb_rails("button", props: { type: object.type,
4
3
  link: object.link,
5
4
  new_window:object.new_window,
6
5
  target: object.target,
@@ -140,8 +140,7 @@ const { filteredPadding, filteredMargin } = filterItemSpacing(itemSpacing);
140
140
  delete filteredProps?.marginLeft;
141
141
 
142
142
 
143
- const isLink = !!link
144
- const Tag = isLink ? "a" : "div"
143
+ const Tag = link ? "a" : "div";
145
144
  const activeClass = active === true ? "active" : "";
146
145
  const highlightedBorderClass = active === true && highlighted_border === false ? "highlighted_border_none" : "";
147
146
  const collapsibleTrailClass = collapsible && collapsibleTrail ? "collapsible_trail" : "";
@@ -201,13 +200,6 @@ const { filteredPadding, filteredMargin } = filterItemSpacing(itemSpacing);
201
200
 
202
201
  const collapsibleClasses = buildCss("collapsible_nav_wrapper", activeClass, highlightedBorderClass, collapsibleTrailClass)
203
202
 
204
- const handleKeyDown = (e: React.KeyboardEvent) => {
205
- if (!isLink && (e.key === "Enter" || e.key === " ")) {
206
- e.preventDefault()
207
- onClick?.()
208
- }
209
- }
210
-
211
203
  return (
212
204
  <>
213
205
  {collapsible ? (
@@ -230,18 +222,15 @@ const { filteredPadding, filteredMargin } = filterItemSpacing(itemSpacing);
230
222
  {...dataProps}
231
223
  {...htmlProps}
232
224
  className={classes}
233
- href={isLink ? link : undefined}
225
+ href={link}
234
226
  id={id}
235
- role={!isLink ? "button" : undefined}
236
- tabIndex={!isLink ? 0 : undefined}
237
- target={isLink ? target : undefined}
227
+ target={target}
238
228
  >
239
229
  {imageUrl && (
240
230
  <div
241
231
  className="pb_nav_list_item_icon_section_collapsible"
242
232
  key={imageUrl}
243
233
  onClick={(e) => handleIconClick(e)}
244
- onKeyDown={!isLink ? handleKeyDown : undefined}
245
234
  >
246
235
  <Image className="pb_nav_img_wrapper"
247
236
  url={imageUrl}
@@ -276,13 +265,10 @@ const { filteredPadding, filteredMargin } = filterItemSpacing(itemSpacing);
276
265
  {...dataProps}
277
266
  {...htmlProps}
278
267
  className={classes}
279
- href={isLink ? link : undefined}
268
+ href={link}
280
269
  id={id}
281
270
  onClick={onClick}
282
- onKeyDown={!isLink ? handleKeyDown : undefined}
283
- role={!isLink ? "button" : undefined}
284
- tabIndex={!isLink ? 0 : undefined}
285
- target={isLink ? target : undefined}
271
+ target={target}
286
272
  >
287
273
  {imageUrl && (
288
274
  <div className="pb_nav_list_item_icon_section"
@@ -3,9 +3,7 @@
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
4
  <%= pb_content_tag( object.tag,
5
5
  href: object.link && object.link,
6
- target: object.link && object.target,
7
- onkeydown: !object.link ? "if(event.key==='Enter'||event.key===' '){event.preventDefault(); this.click();}" : nil,
8
- tabindex: object.link ? nil : 0,
6
+ target: object.link && object.target
9
7
  ) do %>
10
8
  <% if object.image_url %>
11
9
  <%= pb_rails("image", props: { url: object.image_url, classname: "pb_nav_img_wrapper_collapsible" }) %>
@@ -25,9 +23,7 @@
25
23
  <% else %>
26
24
  <%= pb_content_tag( object.tag,
27
25
  href: object.link && object.link,
28
- target: object.link && object.target,
29
- onkeydown: !object.link ? "if(event.key==='Enter'||event.key===' '){event.preventDefault(); this.click();}" : nil,
30
- tabindex: object.link ? nil : 0,
26
+ target: object.link && object.target
31
27
  ) do %>
32
28
  <% if object.image_url %>
33
29
  <%= pb_rails("image", props: { url: object.image_url, classname: "pb_nav_img_wrapper" }) %>
@@ -1,4 +1,4 @@
1
- Custom tooltip formatting is configured through the tooltip object in the options passed to the kit:
1
+ Custom tooltip formatting is configured through the tooltip object in the chart options:
2
2
  `headerFormat` **Type**: String | when set to null will disable the header.
3
3
  `pointFormat` **Type**: String | defines the HTML template for each data point and supports custom HTML when `useHTML` is enabled.
4
4
  `useHTML` **Type**: boolean (default false) | enables HTML rendering in tooltips.
@@ -1,4 +1,4 @@
1
- Layout options from Highcharts:
1
+ ##### Prop
2
2
 
3
3
  `align` **Type**: String | **Values**: left | center | right (defaults to center)
4
4
  `verticalAlign` **Type**: String | **Values**: top | middle | bottom (defaults to bottom)
@@ -18,11 +18,9 @@ type TimestampProps = {
18
18
  timezone: string,
19
19
  htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
20
20
  id?: string,
21
- showCurrentYear?: boolean,
22
21
  showDate?: boolean,
23
22
  showUser?: boolean,
24
23
  hideUpdated?: boolean,
25
- showTime?: boolean,
26
24
  showTimezone?: boolean,
27
25
  unstyled?: boolean,
28
26
  variant?: "default" | "elapsed" | "updated"
@@ -39,11 +37,9 @@ const Timestamp = (props: TimestampProps): React.ReactElement => {
39
37
  text,
40
38
  timezone,
41
39
  timestamp,
42
- showCurrentYear = false,
43
40
  showDate = true,
44
41
  showUser = false,
45
42
  hideUpdated = false,
46
- showTime = true,
47
43
  showTimezone = false,
48
44
  unstyled = false,
49
45
  variant = 'default',
@@ -59,6 +55,7 @@ const Timestamp = (props: TimestampProps): React.ReactElement => {
59
55
  )
60
56
 
61
57
  const currentYear = new Date().getFullYear().toString()
58
+ const dateDisplay = `${DateTime.toMonth(timestamp, timezone)} ${DateTime.toDay(timestamp, timezone)}`
62
59
  const shouldShowUser = showUser == true && text.length > 0
63
60
  const shouldShowTimezone = showTimezone == true && timezone.length > 0
64
61
  const updatedText = hideUpdated ? "" : "Last updated"
@@ -73,26 +70,16 @@ const Timestamp = (props: TimestampProps): React.ReactElement => {
73
70
  return timeDisplay
74
71
  }
75
72
 
76
- const baseDateDisplay = () => {
77
- let display = `${DateTime.toMonth(timestamp, timezone)} ${DateTime.toDay(timestamp, timezone)}`
78
- if (DateTime.toYear(timestamp, timezone).toString() !== currentYear || showCurrentYear) {
79
- display = `${display}, ${DateTime.toYear(timestamp, timezone)}`
80
- }
81
- return display
82
- }
83
-
84
73
  const fullDateDisplay = () => {
85
- const fullDisplay = baseDateDisplay()
86
- return showTime ? `${fullDisplay} ${' \u00b7 '} ${fullTimeDisplay()}` : fullDisplay
74
+ let fullDisplay = `${DateTime.toMonth(timestamp, timezone)} ${DateTime.toDay(timestamp, timezone)}`
75
+ if (DateTime.toYear(timestamp, timezone).toString() !== currentYear) {
76
+ fullDisplay = `${fullDisplay}, ${DateTime.toYear(timestamp, timezone)}`
77
+ }
78
+ return `${fullDisplay} ${' \u00b7 '} ${fullTimeDisplay()}`
87
79
  }
88
80
 
89
81
  const formatUpdatedString = () => {
90
- const finalUpdatedString = []
91
- if (shouldShowUser) finalUpdatedString.push(`by ${text}`)
92
- if (showDate && !showTime) finalUpdatedString.push(`on ${baseDateDisplay()}`)
93
- if (showDate && showTime) finalUpdatedString.push(`on ${baseDateDisplay()} at ${timeDisplay}`)
94
- if (showTime && !showDate) finalUpdatedString.push(`at ${timeDisplay}`)
95
- return `Last updated ${finalUpdatedString.join(' ')}`
82
+ return `Last updated ${userDisplay} on ${dateDisplay} at ${timeDisplay}`
96
83
  }
97
84
 
98
85
  const formatElapsedString = () => {
@@ -106,10 +93,7 @@ const Timestamp = (props: TimestampProps): React.ReactElement => {
106
93
  case 'elapsed':
107
94
  return formatElapsedString()
108
95
  default:
109
- if (showDate && showTime) return timestamp ? fullDateDisplay() : text
110
- if (showDate && !showTime) return baseDateDisplay()
111
- if (!showDate && showTime) return fullTimeDisplay()
112
- return text
96
+ return showDate ? timestamp ? fullDateDisplay() : text : fullTimeDisplay()
113
97
  }
114
98
  }
115
99
 
@@ -0,0 +1 @@
1
+ Use these only to display status updates in areas that has a lot of data.
@@ -8,6 +8,7 @@
8
8
 
9
9
  <%= pb_rails("timestamp", props: {
10
10
  timestamp: DateTime.now,
11
+ show_date: true,
11
12
  align: "left"
12
13
  }) %>
13
14
 
@@ -15,6 +16,7 @@
15
16
 
16
17
  <%= pb_rails("timestamp", props: {
17
18
  timestamp: DateTime.now + 4.years,
19
+ show_date: true,
18
20
  align: "left"
19
21
  }) %>
20
22
 
@@ -22,6 +24,7 @@
22
24
 
23
25
  <%= pb_rails("timestamp", props: {
24
26
  timestamp: DateTime.now - 1.year,
27
+ show_date: true,
25
28
  align: "left"
26
29
  }) %>
27
30
 
@@ -37,6 +40,7 @@
37
40
 
38
41
  <%= pb_rails("timestamp", props: {
39
42
  timestamp: DateTime.now,
43
+ show_date: true,
40
44
  align: "center"
41
45
  }) %>
42
46
 
@@ -44,6 +48,7 @@
44
48
 
45
49
  <%= pb_rails("timestamp", props: {
46
50
  timestamp: DateTime.now + 4.years,
51
+ show_date: true,
47
52
  align: "center"
48
53
  }) %>
49
54
 
@@ -51,6 +56,7 @@
51
56
 
52
57
  <%= pb_rails("timestamp", props: {
53
58
  timestamp: DateTime.now - 1.year,
59
+ show_date: true,
54
60
  align: "center"
55
61
  }) %>
56
62
 
@@ -58,6 +64,7 @@
58
64
 
59
65
  <%= pb_rails("timestamp", props: {
60
66
  timestamp: DateTime.now,
67
+ show_date: false,
61
68
  align: "right"
62
69
  }) %>
63
70
 
@@ -65,6 +72,7 @@
65
72
 
66
73
  <%= pb_rails("timestamp", props: {
67
74
  timestamp: DateTime.now,
75
+ show_date: true,
68
76
  align: "right"
69
77
  }) %>
70
78
 
@@ -72,6 +80,7 @@
72
80
 
73
81
  <%= pb_rails("timestamp", props: {
74
82
  timestamp: DateTime.now + 4.years,
83
+ show_date: true,
75
84
  align: "right"
76
85
  }) %>
77
86
 
@@ -79,5 +88,6 @@
79
88
 
80
89
  <%= pb_rails("timestamp", props: {
81
90
  timestamp: DateTime.now - 1.year,
91
+ show_date: true,
82
92
  align: "right"
83
93
  }) %>
@@ -25,6 +25,7 @@ const TimestampAlign = (props) => {
25
25
 
26
26
  <Timestamp
27
27
  align="left"
28
+ showDate
28
29
  timestamp={todaysDate}
29
30
  {...props}
30
31
  />
@@ -33,6 +34,7 @@ const TimestampAlign = (props) => {
33
34
 
34
35
  <Timestamp
35
36
  align="left"
37
+ showDate
36
38
  timestamp={futureDate}
37
39
  {...props}
38
40
  />
@@ -41,6 +43,7 @@ const TimestampAlign = (props) => {
41
43
 
42
44
  <Timestamp
43
45
  align="left"
46
+ showDate
44
47
  timestamp={pastDate}
45
48
  {...props}
46
49
  />
@@ -59,6 +62,7 @@ const TimestampAlign = (props) => {
59
62
 
60
63
  <Timestamp
61
64
  align="center"
65
+ showDate
62
66
  timestamp={todaysDate}
63
67
  {...props}
64
68
  />
@@ -67,6 +71,7 @@ const TimestampAlign = (props) => {
67
71
 
68
72
  <Timestamp
69
73
  align="center"
74
+ showDate
70
75
  timestamp={futureDate}
71
76
  {...props}
72
77
  />
@@ -75,6 +80,7 @@ const TimestampAlign = (props) => {
75
80
 
76
81
  <Timestamp
77
82
  align="center"
83
+ showDate
78
84
  timestamp={pastDate}
79
85
  {...props}
80
86
  />
@@ -93,6 +99,7 @@ const TimestampAlign = (props) => {
93
99
 
94
100
  <Timestamp
95
101
  align="right"
102
+ showDate
96
103
  timestamp={todaysDate}
97
104
  {...props}
98
105
  />
@@ -101,6 +108,7 @@ const TimestampAlign = (props) => {
101
108
 
102
109
  <Timestamp
103
110
  align="right"
111
+ showDate
104
112
  timestamp={futureDate}
105
113
  {...props}
106
114
  />
@@ -109,6 +117,7 @@ const TimestampAlign = (props) => {
109
117
 
110
118
  <Timestamp
111
119
  align="right"
120
+ showDate
112
121
  timestamp={pastDate}
113
122
  {...props}
114
123
  />
@@ -1,15 +1,29 @@
1
1
  <%= pb_rails("timestamp", props: {
2
- timestamp: DateTime.now
2
+ timestamp: DateTime.now,
3
+ show_date: false,
4
+ align: "left"
3
5
  }) %>
4
6
 
5
7
  <br>
6
8
 
7
9
  <%= pb_rails("timestamp", props: {
8
- timestamp: DateTime.now + 4.years
10
+ timestamp: DateTime.now,
11
+ show_date: true,
12
+ align: "left"
9
13
  }) %>
10
14
 
11
15
  <br>
12
16
 
13
17
  <%= pb_rails("timestamp", props: {
14
- timestamp: DateTime.now - 1.year
18
+ timestamp: DateTime.now + 4.years,
19
+ show_date: true,
20
+ align: "left"
21
+ }) %>
22
+
23
+ <br>
24
+
25
+ <%= pb_rails("timestamp", props: {
26
+ timestamp: DateTime.now - 1.year,
27
+ show_date: true,
28
+ align: "left"
15
29
  }) %>
@@ -15,6 +15,8 @@ const TimestampDefault = (props) => {
15
15
  return (
16
16
  <div>
17
17
  <Timestamp
18
+ align="left"
19
+ showDate={false}
18
20
  timestamp={todaysDate}
19
21
  {...props}
20
22
  />
@@ -22,6 +24,17 @@ const TimestampDefault = (props) => {
22
24
  <br />
23
25
 
24
26
  <Timestamp
27
+ align="left"
28
+ showDate
29
+ timestamp={todaysDate}
30
+ {...props}
31
+ />
32
+
33
+ <br />
34
+
35
+ <Timestamp
36
+ align="left"
37
+ showDate
25
38
  timestamp={futureDate}
26
39
  {...props}
27
40
  />
@@ -29,6 +42,8 @@ const TimestampDefault = (props) => {
29
42
  <br />
30
43
 
31
44
  <Timestamp
45
+ align="left"
46
+ showDate
32
47
  timestamp={pastDate}
33
48
  {...props}
34
49
  />
@@ -10,6 +10,7 @@
10
10
  <%= pb_rails("timestamp", props: {
11
11
  timestamp: DateTime.now - 3.months,
12
12
  variant: "elapsed",
13
+ show_user: false
13
14
  }) %>
14
15
 
15
16
  <br>
@@ -17,5 +18,6 @@
17
18
  <%= pb_rails("timestamp", props: {
18
19
  timestamp: DateTime.now - 320.days,
19
20
  variant: "elapsed",
21
+ show_user: false,
20
22
  hide_updated: true
21
23
  }) %>