playbook_ui 15.4.0.pre.alpha.PLAY1541responsivefloorPOC12370 → 15.4.0.pre.alpha.PLAY2429datepickeropenonscreenstatic12263

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 (82) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_date_picker/date_picker.html.erb +11 -25
  3. data/app/pb_kits/playbook/pb_date_range_inline/_date_range_inline.tsx +13 -20
  4. data/app/pb_kits/playbook/pb_date_range_inline/date_range_inline.rb +4 -6
  5. data/app/pb_kits/playbook/pb_date_range_inline/date_range_inline.test.js +0 -17
  6. data/app/pb_kits/playbook/pb_date_range_inline/docs/_description.md +1 -1
  7. data/app/pb_kits/playbook/pb_date_range_inline/docs/example.yml +2 -3
  8. data/app/pb_kits/playbook/pb_date_range_inline/docs/index.js +0 -1
  9. data/app/pb_kits/playbook/pb_date_stacked/_date_stacked.tsx +4 -6
  10. data/app/pb_kits/playbook/pb_date_stacked/date_stacked.html.erb +3 -2
  11. data/app/pb_kits/playbook/pb_date_stacked/date_stacked.rb +5 -11
  12. data/app/pb_kits/playbook/pb_date_stacked/date_stacked.test.js +9 -26
  13. data/app/pb_kits/playbook/pb_date_stacked/docs/_date_stacked_default.html.erb +1 -1
  14. data/app/pb_kits/playbook/pb_date_stacked/docs/_date_stacked_default.jsx +1 -1
  15. data/app/pb_kits/playbook/pb_date_stacked/docs/_date_stacked_not_current_year.html.erb +5 -0
  16. data/app/pb_kits/playbook/pb_date_stacked/docs/{_date_stacked_current_year.jsx → _date_stacked_not_current_year.jsx} +5 -6
  17. data/app/pb_kits/playbook/pb_date_stacked/docs/_description.md +1 -1
  18. data/app/pb_kits/playbook/pb_date_stacked/docs/example.yml +2 -2
  19. data/app/pb_kits/playbook/pb_date_stacked/docs/index.js +1 -1
  20. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_compound_components.html.erb +2 -2
  21. data/app/pb_kits/playbook/pb_dropdown/index.js +1 -1
  22. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.tsx +9 -31
  23. data/app/pb_kits/playbook/pb_flex/_flex_item.tsx +5 -12
  24. data/app/pb_kits/playbook/pb_flex/docs/_flex_item_example.jsx +0 -1
  25. data/app/pb_kits/playbook/pb_nav/_item.tsx +4 -18
  26. data/app/pb_kits/playbook/pb_nav/_nav.scss +5 -30
  27. data/app/pb_kits/playbook/pb_nav/_nav_item.test.js +0 -192
  28. data/app/pb_kits/playbook/pb_nav/_vertical_nav.scss +1 -1
  29. data/app/pb_kits/playbook/pb_nav/docs/example.yml +0 -4
  30. data/app/pb_kits/playbook/pb_nav/docs/index.js +1 -3
  31. data/app/pb_kits/playbook/pb_nav/item.html.erb +4 -6
  32. data/app/pb_kits/playbook/pb_nav/item.rb +2 -11
  33. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_description.md +1 -3
  34. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend_position.html.erb +1 -1
  35. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_description.md +1 -3
  36. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_custom_tooltip.md +1 -2
  37. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_description.md +1 -3
  38. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_color.md +2 -2
  39. data/app/pb_kits/playbook/pb_pb_line_graph/docs/_description.md +1 -3
  40. data/app/pb_kits/playbook/pb_pb_line_graph/docs/_pb_line_graph_legend_position.html.erb +1 -1
  41. data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/Toolbar.tsx +1 -1
  42. data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.tsx +8 -61
  43. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_focus.html.erb +2 -10
  44. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_preview.html.erb +11 -19
  45. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_simple.html.erb +1 -5
  46. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_sticky.html.erb +1 -1
  47. data/app/pb_kits/playbook/pb_rich_text_editor/docs/example.yml +2 -2
  48. data/app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.rb +7 -16
  49. data/app/pb_kits/playbook/tokens/_screen_sizes.scss +0 -24
  50. data/app/pb_kits/playbook/utilities/_mixins.scss +4 -19
  51. data/dist/chunks/{_line_graph-8BUASxIP.js → _line_graph-W9CX7Xbp.js} +1 -1
  52. data/dist/chunks/_typeahead-L4SF9E6a.js +6 -0
  53. data/dist/chunks/{_weekday_stacked-EQMaMJvC.js → _weekday_stacked-DOs7l1vE.js} +3 -3
  54. data/dist/chunks/{lib-CzQFzKzw.js → lib-COXg9aPA.js} +1 -1
  55. data/dist/chunks/{pb_form_validation-Bf9TK15t.js → pb_form_validation-DR765aoq.js} +1 -1
  56. data/dist/chunks/vendor.js +1 -1
  57. data/dist/playbook-doc.js +19 -1
  58. data/dist/playbook-rails-react-bindings.js +1 -1
  59. data/dist/playbook-rails.js +1 -1
  60. data/dist/playbook.css +1 -1
  61. data/lib/playbook/version.rb +1 -1
  62. metadata +9 -27
  63. data/app/pb_kits/playbook/pb_date_range_inline/docs/_date_range_inline_show_current_year.html.erb +0 -4
  64. data/app/pb_kits/playbook/pb_date_range_inline/docs/_date_range_inline_show_current_year.jsx +0 -43
  65. data/app/pb_kits/playbook/pb_date_range_inline/docs/_date_range_inline_show_current_year.md +0 -1
  66. data/app/pb_kits/playbook/pb_date_stacked/docs/_date_stacked_current_year.html.erb +0 -12
  67. data/app/pb_kits/playbook/pb_date_stacked/docs/_date_stacked_current_year.md +0 -1
  68. data/app/pb_kits/playbook/pb_nav/docs/_horizontal_nav_disabled.html.erb +0 -21
  69. data/app/pb_kits/playbook/pb_nav/docs/_horizontal_nav_disabled.jsx +0 -113
  70. data/app/pb_kits/playbook/pb_nav/docs/_horizontal_nav_disabled.md +0 -1
  71. data/app/pb_kits/playbook/pb_nav/docs/_vertical_nav_disabled.html.erb +0 -30
  72. data/app/pb_kits/playbook/pb_nav/docs/_vertical_nav_disabled.jsx +0 -117
  73. data/app/pb_kits/playbook/pb_nav/docs/_vertical_nav_disabled.md +0 -1
  74. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_default.md +0 -1
  75. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend_position.md +0 -11
  76. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_default.md +0 -1
  77. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_default.md +0 -1
  78. data/app/pb_kits/playbook/pb_pb_line_graph/docs/_pb_line_graph_default.md +0 -1
  79. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_default_rails.md +0 -7
  80. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_inline_rails.md +0 -1
  81. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_sticky_rails.md +0 -1
  82. data/dist/chunks/_typeahead-DESMSfUO.js +0 -24
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0aad7539ef05d2ddb33241d40497b0ac7e061f7bdbf06c8b21540f41ae4bea0c
4
- data.tar.gz: a7fbdf0ac8cc63a65d61054669b7f8db2e8f918e70ba6be3d5cd561a9df3d6b5
3
+ metadata.gz: '078ba558616f3d9652e67f43a347d3d8aefc110aa2d508a5733bd795b067c11c'
4
+ data.tar.gz: fa53a9d154f6087f72bd482dc68d75e152a25f59e156ca477afd7f9cadf2984f
5
5
  SHA512:
6
- metadata.gz: acbea506335247a4678e67c024d0ab948c3ab0b6b68985fae5ca686f1b865bd4a28c1726d2f51ab4863ceea61e6ef1e4dd58202cfdc87a5ca6bd8f9445ac1d4e
7
- data.tar.gz: 387dc60dc4d726a03241e159a102f9cf35353c79d06eb544a6ea8f4859530927135f5bea3cecb501025c6977dd384cede79d0abce770233c0c2c112f5b842a24
6
+ metadata.gz: 1f55d101f6dd2a8069ed1e2b4ff753360fc2f03242d3c6978a18789d41dca270a8f13286cc74a57ab8565d6fb7e4c58ef75e769206ff8a2ee2b45c21f091afbd
7
+ data.tar.gz: c0e5da234a64692508e34ace0559178733de1e0703cb553fdf0c1c61901d1332e9dc4074b5d895d08b157b2c35f5976103d94acd145a3189bfe51826e7bda940
@@ -70,36 +70,22 @@
70
70
  <%= javascript_tag do %>
71
71
  (function() {
72
72
  const loadDatePicker = () => {
73
- const input = document.getElementById("<%= object.picker_id %>");
74
- if (input && !input._flatpickr) {
75
- datePickerHelper(<%= object.date_picker_config %>, "<%= object.scroll_container %>")
73
+ datePickerHelper(<%= object.date_picker_config %>, "<%= object.scroll_container %>")
76
74
 
77
- if (<%= object.selection_type == "quickpick" %>) {
78
- document.getElementById("<%= object.picker_id %>").addEventListener("change", ({ target }) => {
79
- const startDate = document.getElementById("<%= object.start_date_id %>")
80
- const endDate = document.getElementById("<%= object.end_date_id %>")
81
- const splittedValue = target.value.split(" to ")
82
- startDate.value = splittedValue[0]
83
- endDate.value = splittedValue[1] ? splittedValue[1] : splittedValue[0]
84
- })
85
- }
75
+ if (<%= object.selection_type == "quickpick" %>) {
76
+ document.getElementById("<%= object.picker_id %>").addEventListener("change", ({ target }) => {
77
+ const startDate = document.getElementById("<%= object.start_date_id %>")
78
+ const endDate = document.getElementById("<%= object.end_date_id %>")
79
+ const splittedValue = target.value.split(" to ")
80
+ startDate.value = splittedValue[0]
81
+ endDate.value = splittedValue[1] ? splittedValue[1] : splittedValue[0]
82
+ })
86
83
  }
87
84
  }
88
85
 
89
- // Try to initialize immediately if DOM is ready
90
- if (document.readyState === "loading") {
91
- window.addEventListener("DOMContentLoaded", loadDatePicker)
92
- } else {
86
+ window.addEventListener("DOMContentLoaded", () => {
93
87
  loadDatePicker()
94
- }
95
-
96
- // For dynamically added content (modals, etc.), check again after a brief delay
97
- setTimeout(() => {
98
- const input = document.getElementById("<%= object.picker_id %>");
99
- if (input && !input._flatpickr) {
100
- loadDatePicker();
101
- }
102
- }, 100);
88
+ })
103
89
 
104
90
  if (<%= !object.custom_event_type.empty? %>) {
105
91
  window.addEventListener("<%= object.custom_event_type %>", () => {
@@ -19,7 +19,6 @@ type DateRangeInlineProps = {
19
19
  icon?: boolean;
20
20
  id?: string;
21
21
  size?: "sm" | "xs";
22
- showCurrentYear?: boolean;
23
22
  startDate?: Date;
24
23
  };
25
24
 
@@ -46,7 +45,6 @@ const DateRangeInline = (props: DateRangeInlineProps): React.ReactElement => {
46
45
  icon = false,
47
46
  size = "sm",
48
47
  startDate,
49
- showCurrentYear = false,
50
48
  } = props;
51
49
 
52
50
  const dateInCurrentYear = () => {
@@ -62,10 +60,13 @@ const DateRangeInline = (props: DateRangeInlineProps): React.ReactElement => {
62
60
  const htmlProps = buildHtmlProps(htmlOptions);
63
61
 
64
62
  const renderTime = (date: Date) => {
65
- const includeYear = showCurrentYear || !dateInCurrentYear();
66
63
  return (
67
64
  <time dateTime={dateTimeIso(date)}>
68
- {` ${dateTimestamp(date, includeYear)} `}
65
+ {dateInCurrentYear() ? (
66
+ ` ${dateTimestamp(date, false)} `
67
+ ) : (
68
+ ` ${dateTimestamp(date, true)} `
69
+ )}
69
70
  </time>
70
71
  );
71
72
  };
@@ -82,8 +83,7 @@ const DateRangeInline = (props: DateRangeInlineProps): React.ReactElement => {
82
83
  {icon && (
83
84
  <Caption
84
85
  dark={dark}
85
- tag="span"
86
- >
86
+ tag="span">
87
87
  <Icon
88
88
  className="pb_date_range_inline_icon"
89
89
  dark={dark}
@@ -96,14 +96,12 @@ const DateRangeInline = (props: DateRangeInlineProps): React.ReactElement => {
96
96
  )}
97
97
  <Caption
98
98
  dark={dark}
99
- tag="span"
100
- >
99
+ tag="span">
101
100
  {renderTime(startDate)}
102
101
  </Caption>
103
102
  <Caption
104
103
  dark={dark}
105
- tag="span"
106
- >
104
+ tag="span">
107
105
  <Icon
108
106
  className="pb_date_range_inline_arrow"
109
107
  dark={dark}
@@ -114,8 +112,7 @@ const DateRangeInline = (props: DateRangeInlineProps): React.ReactElement => {
114
112
  </Caption>
115
113
  <Caption
116
114
  dark={dark}
117
- tag="span"
118
- >
115
+ tag="span">
119
116
  {renderTime(endDate)}
120
117
  </Caption>
121
118
  </>
@@ -127,8 +124,7 @@ const DateRangeInline = (props: DateRangeInlineProps): React.ReactElement => {
127
124
  <Body
128
125
  color={"light"}
129
126
  dark={dark}
130
- tag="span"
131
- >
127
+ tag="span">
132
128
  <Icon
133
129
  className="pb_date_range_inline_icon"
134
130
  dark={dark}
@@ -141,15 +137,13 @@ const DateRangeInline = (props: DateRangeInlineProps): React.ReactElement => {
141
137
  )}
142
138
  <Body
143
139
  dark={dark}
144
- tag="span"
145
- >
140
+ tag="span">
146
141
  {renderTime(startDate)}
147
142
  </Body>
148
143
  <Body
149
144
  color={"light"}
150
145
  dark={dark}
151
- tag="span"
152
- >
146
+ tag="span">
153
147
  <Icon
154
148
  className="pb_date_range_inline_arrow"
155
149
  dark={dark}
@@ -160,8 +154,7 @@ const DateRangeInline = (props: DateRangeInlineProps): React.ReactElement => {
160
154
  </Body>
161
155
  <Body
162
156
  dark={dark}
163
- tag="span"
164
- >
157
+ tag="span">
165
158
  {renderTime(endDate)}
166
159
  </Body>
167
160
  </>
@@ -14,8 +14,7 @@ module Playbook
14
14
  prop :align, type: Playbook::Props::Enum,
15
15
  values: %w[left center right],
16
16
  default: "left"
17
- prop :show_current_year, type: Playbook::Props::Boolean,
18
- default: false
17
+
19
18
  def classname
20
19
  generate_classname("pb_date_range_inline_kit", dark_class, align)
21
20
  end
@@ -39,12 +38,11 @@ module Playbook
39
38
  end
40
39
 
41
40
  def time_display(time)
42
- include_year = show_current_year || !dates_in_current_year?
43
41
  content_tag(:time, datetime: time.to_iso) do
44
- if include_year
45
- "#{time.to_month_downcase} #{time.to_day}, #{time.to_year}"
46
- else
42
+ if dates_in_current_year?
47
43
  "#{time.to_month_downcase} #{time.to_day}"
44
+ else
45
+ "#{time.to_month_downcase} #{time.to_day}, #{time.to_year}"
48
46
  end
49
47
  end
50
48
  end
@@ -111,23 +111,6 @@ describe("DateRangeInline Kit", () => {
111
111
  const text = kit.querySelector('.pb_caption_kit_md:first-child')
112
112
  expect(text.textContent).toEqual(" Jan 15 ")
113
113
  })
114
-
115
- test("renders DateRangeInline with year when showCurrentYear is true", () => {
116
- const currentYear = new Date().getFullYear()
117
- render(
118
- <DateRangeInline
119
- data={{ testid: testId }}
120
- endDate={new Date((`15 Aug ${currentYear}`))}
121
- showCurrentYear
122
- size="xs"
123
- startDate={new Date(`15 Jan ${currentYear}`)}
124
- />
125
- )
126
-
127
- const kit = screen.getByTestId(testId)
128
- const text = kit.querySelector('.pb_caption_kit_md:first-child')
129
- expect(text.textContent).toEqual(` Jan 15, ${currentYear} `)
130
- })
131
114
 
132
115
 
133
116
  })
@@ -1 +1 @@
1
- Use to display a date range.
1
+ Use to display a date range. Year will not show if it is the current year.
@@ -2,12 +2,11 @@ examples:
2
2
 
3
3
  rails:
4
4
  - date_range_inline_default: Default
5
- - date_range_inline_show_current_year: Show Current Year
5
+
6
6
 
7
7
  react:
8
8
  - date_range_inline_default: Default
9
- - date_range_inline_show_current_year: Show Current Year
10
-
9
+
11
10
  swift:
12
11
  - date_range_inline_default_swift: Default
13
12
  - date_range_inline_props_swift: ""
@@ -1,2 +1 @@
1
1
  export { default as DateRangeInlineDefault } from './_date_range_inline_default.jsx'
2
- export { default as DateRangeInlineShowCurrentYear } from './_date_range_inline_show_current_year.jsx'
@@ -19,7 +19,6 @@ type DateStackedProps = {
19
19
  size?: "sm" | "md";
20
20
  id?: string;
21
21
  reverse?: boolean;
22
- showCurrentYear?: boolean;
23
22
  };
24
23
 
25
24
  const sizes: {sm: 4, md: 3} = {
@@ -38,7 +37,6 @@ const DateStacked = (props: DateStackedProps): React.ReactElement => {
38
37
  data={},
39
38
  htmlOptions={},
40
39
  size = "sm",
41
- showCurrentYear = false,
42
40
  } = props;
43
41
  const classes = classnames(
44
42
  buildCss("pb_date_stacked_kit", align, size, {
@@ -57,7 +55,7 @@ const DateStacked = (props: DateStackedProps): React.ReactElement => {
57
55
  return (
58
56
  <>
59
57
  {bold == false ? (
60
- <div
58
+ <div
61
59
  {...dataProps}
62
60
  {...htmlProps}
63
61
  className={classes}
@@ -70,10 +68,10 @@ const DateStacked = (props: DateStackedProps): React.ReactElement => {
70
68
  text={DateTime.toDay(date).toString()}
71
69
  />
72
70
  </div>
73
- {(currentYear != inputYear || showCurrentYear) && <Caption size="xs">{inputYear}</Caption>}
71
+ {currentYear != inputYear && <Caption size="xs">{inputYear}</Caption>}
74
72
  </div>
75
73
  ) : (
76
- <div
74
+ <div
77
75
  {...dataProps}
78
76
  {...htmlProps}
79
77
  className={classes}
@@ -91,7 +89,7 @@ const DateStacked = (props: DateStackedProps): React.ReactElement => {
91
89
  size="4"
92
90
  text={DateTime.toDay(date).toString()}
93
91
  />
94
- {(currentYear != inputYear || showCurrentYear) && <Title size="4">{inputYear}</Title>}
92
+ {currentYear != inputYear && <Title size="4">{inputYear}</Title>}
95
93
  </div>
96
94
  </div>
97
95
  )}
@@ -4,15 +4,16 @@
4
4
 
5
5
  <div class="pb_date_stacked_day_month">
6
6
  <%= pb_rails("caption", props: { text: object.month }) %>
7
- <%= pb_rails("title", props: { text: object.day , size: object.title_size }) %>
7
+ <%= pb_rails("title", props: { text: object.day , size: object.title_size }) do %><% end %>
8
8
  <%= pb_rails("caption", props: { text: object.year, size:"xs" }) %>
9
9
  </div>
10
10
 
11
11
  <% else %>
12
12
  <div class="pb_date_stacked_day_month">
13
13
  <%= pb_rails("title", props: { text: object.month, size: 4 }) %>
14
- <%= pb_rails("title", props: { text: object.day, size: 4 }) %>
14
+ <%= pb_rails("title", props: { text: object.day, size: 4 }) do %><% end %>
15
15
  <%= pb_rails("title", props: { text: object.year, size:4 }) %>
16
+
16
17
  </div>
17
18
 
18
19
  <% end %>
@@ -16,8 +16,6 @@ module Playbook
16
16
  default: false
17
17
  prop :bold, type: Playbook::Props::Boolean,
18
18
  default: false
19
- prop :show_current_year, type: Playbook::Props::Boolean,
20
- default: false
21
19
 
22
20
  def classname
23
21
  generate_classname("pb_date_stacked_kit", align, size, reverse_class, dark_class)
@@ -39,15 +37,11 @@ module Playbook
39
37
  end
40
38
 
41
39
  def year
42
- if show_current_year
43
- Playbook::PbKit::PbDateTime.new(date).to_year.to_s
44
- else
45
- current_year = DateTime.now.year.to_i
46
- year = Playbook::PbKit::PbDateTime.new(date).to_year.to_i
47
- if current_year != year
48
- content_tag(:time, datetime: year) do
49
- year.to_s
50
- end
40
+ current_year = DateTime.now.year.to_i
41
+ year = Playbook::PbKit::PbDateTime.new(date).to_year.to_i
42
+ if current_year != year
43
+ content_tag(:time, datetime: year) do
44
+ year.to_s
51
45
  end
52
46
  end
53
47
  end
@@ -22,7 +22,7 @@ describe("DateStacked Kit", () => {
22
22
  align="left"
23
23
  data={{ testid: testId }}
24
24
  date={new Date()}
25
- size="sm"
25
+ size="sm"
26
26
  />
27
27
  )
28
28
 
@@ -36,7 +36,7 @@ describe("DateStacked Kit", () => {
36
36
  align="left"
37
37
  data={{ testid: testId }}
38
38
  date={new Date()}
39
- size="sm"
39
+ size="sm"
40
40
  />
41
41
  )
42
42
 
@@ -51,7 +51,7 @@ describe("DateStacked Kit", () => {
51
51
  align="left"
52
52
  data={{ testid: testId }}
53
53
  date={new Date()}
54
- size="sm"
54
+ size="sm"
55
55
  />
56
56
  )
57
57
 
@@ -66,7 +66,7 @@ describe("DateStacked Kit", () => {
66
66
  align="left"
67
67
  data={{ testid: testId }}
68
68
  date={new Date()}
69
- size="md"
69
+ size="md"
70
70
  />
71
71
  )
72
72
 
@@ -80,7 +80,7 @@ describe("DateStacked Kit", () => {
80
80
  align="left"
81
81
  data={{ testid: testId }}
82
82
  date={futureDate}
83
- size="sm"
83
+ size="sm"
84
84
  />
85
85
  )
86
86
 
@@ -89,23 +89,6 @@ describe("DateStacked Kit", () => {
89
89
  expect(text.textContent).toEqual("2016")
90
90
  })
91
91
 
92
- test("renders current year when showCurrentYear is true", () => {
93
- render(
94
- <DateStacked
95
- align="left"
96
- data={{ testid: testId }}
97
- date={new Date()}
98
- showCurrentYear
99
- size="sm"
100
- />
101
- )
102
-
103
- const kit = screen.getByTestId(testId)
104
- const text = kit.querySelector(".pb_caption_kit_xs")
105
- const currentYear = new Date().getFullYear()
106
- expect(text.textContent).toEqual(`${currentYear}`)
107
- })
108
-
109
92
  test("renders correct className when order reversed", () => {
110
93
  render(
111
94
  <DateStacked
@@ -113,7 +96,7 @@ describe("DateStacked Kit", () => {
113
96
  data={{ testid: testId }}
114
97
  date={futureDate}
115
98
  reverse
116
- size="sm"
99
+ size="sm"
117
100
  />
118
101
  )
119
102
  const kit = screen.getByTestId(testId)
@@ -127,7 +110,7 @@ describe("DateStacked Kit", () => {
127
110
  bold
128
111
  data={{ testid: testId }}
129
112
  date={futureDate}
130
- size="md"
113
+ size="md"
131
114
  />
132
115
  )
133
116
 
@@ -142,7 +125,7 @@ describe("DateStacked Kit", () => {
142
125
  align="center"
143
126
  data={{ testid: testId }}
144
127
  date={futureDate}
145
- size="md"
128
+ size="md"
146
129
  />
147
130
  )
148
131
 
@@ -156,7 +139,7 @@ describe("DateStacked Kit", () => {
156
139
  align="right"
157
140
  data={{ testid: testId }}
158
141
  date={futureDate}
159
- size="md"
142
+ size="md"
160
143
  />
161
144
  )
162
145
 
@@ -2,4 +2,4 @@
2
2
 
3
3
  <br>
4
4
 
5
- <%= pb_rails("date_stacked", props: { date: Date.new(2018, 03, 20), size: "md"}) %>
5
+ <%= pb_rails("date_stacked", props: { date: DateTime.now, size: "md"}) %>
@@ -15,7 +15,7 @@ const DateStackedDefault = (props) => {
15
15
  <br />
16
16
 
17
17
  <DateStacked
18
- date={new Date('20 Mar 2018')}
18
+ date={new Date()}
19
19
  size="md"
20
20
  {...props}
21
21
  />
@@ -0,0 +1,5 @@
1
+ <%= pb_rails("date_stacked", props: { date: Date.new(2018, 03, 20) }) %>
2
+
3
+ <br>
4
+
5
+ <%= pb_rails("date_stacked", props: { date: Date.new(2018, 03, 20), size: "md"}) %>
@@ -1,13 +1,12 @@
1
1
  import React from 'react'
2
2
  import DateStacked from '../_date_stacked'
3
3
 
4
- const DateStackedCurrentYear = (props) => {
4
+ const DateStackedNotCurrentYear = (props) => {
5
5
  return (
6
6
  <div>
7
7
 
8
8
  <DateStacked
9
- date={new Date()}
10
- showCurrentYear
9
+ date={new Date('20 Mar 2018')}
11
10
  size="sm"
12
11
  {...props}
13
12
  />
@@ -15,13 +14,13 @@ const DateStackedCurrentYear = (props) => {
15
14
  <br />
16
15
 
17
16
  <DateStacked
18
- date={new Date()}
19
- showCurrentYear
17
+ date={new Date('20 Mar 2018')}
20
18
  size="md"
21
19
  {...props}
22
20
  />
21
+
23
22
  </div>
24
23
  )
25
24
  }
26
25
 
27
- export default DateStackedCurrentYear
26
+ export default DateStackedNotCurrentYear
@@ -1 +1 @@
1
- Use to display the date, stacking month and day.
1
+ Use to display the date, stacking month and day. Year will not show if it is the current year.
@@ -2,7 +2,7 @@ examples:
2
2
 
3
3
  rails:
4
4
  - date_stacked_default: Default
5
- - date_stacked_current_year: Show Current Year
5
+ - date_stacked_not_current_year: Not Current Year
6
6
  - date_stacked_reverse: Day & Month Reverse
7
7
  - date_stacked_sizes: Sizes
8
8
  - date_stacked_align: Alignment
@@ -11,7 +11,7 @@ examples:
11
11
 
12
12
  react:
13
13
  - date_stacked_default: Default
14
- - date_stacked_current_year: Show Current Year
14
+ - date_stacked_not_current_year: Not Current Year
15
15
  - date_stacked_reverse: Day & Month Reverse
16
16
  - date_stacked_sizes: Sizes
17
17
  - date_stacked_bold: Bold
@@ -1,6 +1,6 @@
1
1
  export { default as DateStackedBold } from './_date_stacked_bold.jsx'
2
2
  export { default as DateStackedDefault } from './_date_stacked_default.jsx'
3
- export { default as DateStackedCurrentYear } from './_date_stacked_current_year.jsx'
3
+ export { default as DateStackedNotCurrentYear } from './_date_stacked_not_current_year.jsx'
4
4
  export { default as DateStackedReverse } from './_date_stacked_reverse.jsx'
5
5
  export { default as DateStackedSizes } from './_date_stacked_sizes.jsx'
6
6
  export { default as DateStackedAlign } from './_date_stacked_align.jsx'
@@ -1,7 +1,7 @@
1
1
  <%= pb_rails("button", props: { text: "Open Complex Dialog", data:{"open-dialog": "dialog-complex"} }) %>
2
2
 
3
3
  <%= pb_rails("dialog", props: { id:"dialog-complex", size: "lg", full_height: true }) do %>
4
- <%= pb_form_with(scope: :example, method: :get, url: "", options: { remote: true }) do |form| %>
4
+ <form>
5
5
  <%= pb_rails("dialog/dialog_header", props: { id: "dialog-complex" } ) do %>
6
6
  <%= pb_rails("body", props: { text: "What do you need us to take care of?" }) %>
7
7
  <% end %>
@@ -13,5 +13,5 @@
13
13
 
14
14
  <% end %>
15
15
  <%= pb_rails("dialog/dialog_footer", props: {cancel_button: "Back", confirm_button: "Send my Issue", confirm_button_id:"confirm-complex", id: "dialog-complex"}) %>
16
- <% end %>
16
+ </form>
17
17
  <% end %>
@@ -126,7 +126,7 @@ export default class PbDropdown extends PbEnhancedElement {
126
126
  .label.toString()
127
127
  .toLowerCase();
128
128
 
129
- // hide or show option
129
+ // hide or show option
130
130
  const match = label.includes(lcTerm);
131
131
  opt.style.display = match ? "" : "none";
132
132
  if (match) hasMatch = true
@@ -1,4 +1,4 @@
1
- import React, { useEffect, useState, useRef } from "react";
1
+ import React, { useEffect, useState } from "react";
2
2
  import classnames from "classnames";
3
3
 
4
4
  import { globalProps, GlobalProps } from "../utilities/globalProps";
@@ -36,7 +36,6 @@ type FixedConfirmationToastProps = {
36
36
 
37
37
  const FixedConfirmationToast = (props: FixedConfirmationToastProps): React.ReactElement => {
38
38
  const [showToast, toggleToast] = useState(true);
39
- const timeoutRef = useRef<NodeJS.Timeout | null>(null);
40
39
 
41
40
  const {
42
41
  autoClose = 0,
@@ -68,42 +67,21 @@ const FixedConfirmationToast = (props: FixedConfirmationToastProps): React.React
68
67
 
69
68
  const htmlProps = buildHtmlProps(htmlOptions);
70
69
 
71
- useEffect(() => {
72
- toggleToast(open);
73
- }, [open]);
74
-
75
- // Manage auto-close timeout separately
76
- useEffect(() => {
77
- // Clear any existing timeout
78
- if (timeoutRef.current) {
79
- clearTimeout(timeoutRef.current);
80
- timeoutRef.current = null;
81
- }
82
-
83
- // Set new timeout if autoClose is enabled and toast is open
84
- if (autoClose && open && showToast) {
85
- timeoutRef.current = setTimeout(() => {
70
+ const autoCloseToast = () => {
71
+ if (autoClose && open) {
72
+ setTimeout(() => {
86
73
  toggleToast(false);
87
74
  onClose();
88
- timeoutRef.current = null;
89
75
  }, autoClose);
90
76
  }
77
+ };
91
78
 
92
- // Cleanup function to clear timeout on unmount or when dependencies change
93
- return () => {
94
- if (timeoutRef.current) {
95
- clearTimeout(timeoutRef.current);
96
- timeoutRef.current = null;
97
- }
98
- };
99
- }, [autoClose, open, showToast, onClose]);
79
+ useEffect(() => {
80
+ toggleToast(open);
81
+ autoCloseToast();
82
+ }, [open]);
100
83
 
101
84
  const handleClick = () => {
102
- // Clear autoClose timeout when manually closing
103
- if (timeoutRef.current) {
104
- clearTimeout(timeoutRef.current);
105
- timeoutRef.current = null;
106
- }
107
85
  toggleToast(!closeable);
108
86
  onClose();
109
87
  };