playbook_ui 15.5.0.pre.rc.1 → 15.5.0.pre.rc.3

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 (92) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_copy_button/_copy_button.tsx +21 -8
  3. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_icon_variant.jsx +24 -0
  4. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_icon_variant_react.md +1 -0
  5. data/app/pb_kits/playbook/pb_copy_button/docs/example.yml +1 -0
  6. data/app/pb_kits/playbook/pb_copy_button/docs/index.js +1 -0
  7. data/app/pb_kits/playbook/pb_currency/docs/_currency_abbreviated.md +1 -0
  8. data/app/pb_kits/playbook/pb_currency/docs/_currency_matching_decimals_rails.md +1 -0
  9. data/app/pb_kits/playbook/pb_currency/docs/_currency_matching_decimals_react.md +1 -0
  10. data/app/pb_kits/playbook/pb_currency/docs/_currency_negative.html.erb +10 -0
  11. data/app/pb_kits/playbook/pb_currency/docs/_currency_negative.jsx +10 -0
  12. data/app/pb_kits/playbook/pb_currency/docs/_currency_negative.md +1 -0
  13. data/app/pb_kits/playbook/pb_currency/docs/_currency_no_symbol_rails.md +1 -0
  14. data/app/pb_kits/playbook/pb_currency/docs/_currency_no_symbol_react.md +1 -0
  15. data/app/pb_kits/playbook/pb_currency/docs/_currency_variants.html.erb +7 -0
  16. data/app/pb_kits/playbook/pb_currency/docs/_currency_variants.jsx +7 -0
  17. data/app/pb_kits/playbook/pb_currency/docs/_description.md +2 -2
  18. data/app/pb_kits/playbook/pb_date_time/_date_time.tsx +3 -0
  19. data/app/pb_kits/playbook/pb_date_time/date_time.html.erb +1 -0
  20. data/app/pb_kits/playbook/pb_date_time/date_time.rb +1 -0
  21. data/app/pb_kits/playbook/pb_date_time/docs/_date_time_show_current_year.html.erb +4 -0
  22. data/app/pb_kits/playbook/pb_date_time/docs/_date_time_show_current_year.jsx +14 -0
  23. data/app/pb_kits/playbook/pb_date_time/docs/_date_time_show_current_year_rails.md +1 -0
  24. data/app/pb_kits/playbook/pb_date_time/docs/_date_time_show_current_year_react.md +1 -0
  25. data/app/pb_kits/playbook/pb_date_time/docs/example.yml +3 -1
  26. data/app/pb_kits/playbook/pb_date_time/docs/index.js +1 -0
  27. data/app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.tsx +3 -0
  28. data/app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.html.erb +2 -2
  29. data/app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.rb +2 -0
  30. data/app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.test.js +33 -0
  31. data/app/pb_kits/playbook/pb_date_time_stacked/docs/_date_time_stacked_show_current_year.html.erb +4 -0
  32. data/app/pb_kits/playbook/pb_date_time_stacked/docs/_date_time_stacked_show_current_year.jsx +22 -0
  33. data/app/pb_kits/playbook/pb_date_time_stacked/docs/_date_time_stacked_show_current_year.md +1 -0
  34. data/app/pb_kits/playbook/pb_date_time_stacked/docs/example.yml +3 -1
  35. data/app/pb_kits/playbook/pb_date_time_stacked/docs/index.js +1 -0
  36. data/app/pb_kits/playbook/pb_progress_step/_progress_step.scss +384 -262
  37. data/app/pb_kits/playbook/pb_progress_step/docs/_description.md +1 -5
  38. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_color.html.erb +14 -0
  39. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_color.jsx +29 -0
  40. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_color.md +3 -0
  41. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_custom_icon.jsx +31 -0
  42. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_custom_icon.md +1 -0
  43. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_default.html.erb +4 -1
  44. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_default.jsx +14 -3
  45. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_default.md +3 -0
  46. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_tracker.md +3 -0
  47. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_vertical.html.erb +1 -7
  48. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_vertical.md +1 -0
  49. data/app/pb_kits/playbook/pb_progress_step/docs/example.yml +3 -0
  50. data/app/pb_kits/playbook/pb_progress_step/docs/index.js +2 -0
  51. data/app/pb_kits/playbook/pb_progress_step/progress_step.test.js +41 -0
  52. data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/Toolbar.tsx +1 -1
  53. data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.tsx +8 -61
  54. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_focus.html.erb +2 -10
  55. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_preview.html.erb +11 -19
  56. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_simple.html.erb +1 -5
  57. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_sticky.html.erb +1 -1
  58. data/app/pb_kits/playbook/pb_rich_text_editor/docs/example.yml +2 -2
  59. data/app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.rb +7 -16
  60. data/app/pb_kits/playbook/pb_table/_table.tsx +28 -26
  61. data/app/pb_kits/playbook/pb_typeahead/_typeahead.scss +4 -0
  62. data/app/pb_kits/playbook/pb_typeahead/components/MultiValue.tsx +1 -0
  63. data/app/pb_kits/playbook/utilities/_truncate.scss +2 -0
  64. data/app/pb_kits/playbook/utilities/globalProps.ts +26 -8
  65. data/app/pb_kits/playbook/utilities/test/globalProps/alignContent.test.js +18 -0
  66. data/app/pb_kits/playbook/utilities/test/globalProps/alignItems.test.js +18 -0
  67. data/app/pb_kits/playbook/utilities/test/globalProps/alignSelf.test.js +18 -0
  68. data/app/pb_kits/playbook/utilities/test/globalProps/display.test.js +18 -0
  69. data/app/pb_kits/playbook/utilities/test/globalProps/flex.test.js +18 -0
  70. data/app/pb_kits/playbook/utilities/test/globalProps/flexDirection.test.js +18 -0
  71. data/app/pb_kits/playbook/utilities/test/globalProps/flexGrow.test.js +18 -0
  72. data/app/pb_kits/playbook/utilities/test/globalProps/flexShrink.test.js +18 -0
  73. data/app/pb_kits/playbook/utilities/test/globalProps/flexWrap.test.js +18 -0
  74. data/app/pb_kits/playbook/utilities/test/globalProps/justifyContent.test.js +18 -0
  75. data/app/pb_kits/playbook/utilities/test/globalProps/justifySelf.test.js +18 -0
  76. data/app/pb_kits/playbook/utilities/test/globalProps/order.test.js +18 -0
  77. data/dist/chunks/{_line_graph-8BUASxIP.js → _line_graph-Co6PvNPL.js} +1 -1
  78. data/dist/chunks/_typeahead-D0OX5RuZ.js +6 -0
  79. data/dist/chunks/{_weekday_stacked-EQMaMJvC.js → _weekday_stacked-HzVLtvcd.js} +2 -2
  80. data/dist/chunks/{lib-CzQFzKzw.js → lib-COXg9aPA.js} +1 -1
  81. data/dist/chunks/{pb_form_validation-Bf9TK15t.js → pb_form_validation-DR765aoq.js} +1 -1
  82. data/dist/chunks/vendor.js +1 -1
  83. data/dist/playbook-doc.js +19 -1
  84. data/dist/playbook-rails-react-bindings.js +1 -1
  85. data/dist/playbook-rails.js +1 -1
  86. data/dist/playbook.css +1 -1
  87. data/lib/playbook/version.rb +1 -1
  88. metadata +30 -10
  89. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_default_rails.md +0 -7
  90. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_inline_rails.md +0 -1
  91. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_sticky_rails.md +0 -1
  92. data/dist/chunks/_typeahead-DESMSfUO.js +0 -24
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 276511bfc08ac08b02c5ad4e4103f77ac5017d5474c703462ed7e7613bbf4a9e
4
- data.tar.gz: 7e2fa23a33a5b37027509a133754fee3b33a8437a44ededb57bcd7fe6c59438c
3
+ metadata.gz: 66aaf83aa51cc7b34eda01ce9d1f8fbb8f2ec256a8fdc3b08d1172e50a8f33ee
4
+ data.tar.gz: d4fdcd781745a389240cfe5ca5e7ecad0467ecf25805c13ccfa9dfc7b88c5a88
5
5
  SHA512:
6
- metadata.gz: a4476dab22e2daa8181c926d0ad86b6d2f1c14956a869e61845e7dda271b6612d1838d78c183d254b80dc931b3274d19b7c0e85e62356aa495ba5790a0071e7b
7
- data.tar.gz: 8bd4331e0a0ec10ee5fb2426f69ff5dac9405f59153617faaa76b81f15a7188b59fc31819b4ed63ce287f2741bd50915bf48c7ba4b27a7866fd535a2d96a08ee
6
+ metadata.gz: 45f0cb1b2ee375e8614fb7fd010e4393ddfd61edd905c55bd5c96b5d6aef34a7a4636be20249cec17418430410193fbe2ee81966fc71fdf09b5edc985863a601
7
+ data.tar.gz: 366a44951a860c7e3dee437c2e07a94b94bc7098837e19f9b665e7939fd053067fd443e0abd382c8d61477460dac259c574dad30419fbeb431616322d3632f78
@@ -5,6 +5,7 @@ import { globalProps } from '../utilities/globalProps'
5
5
 
6
6
  import Button from '../pb_button/_button'
7
7
  import Tooltip from '../pb_tooltip/_tooltip'
8
+ import CircleIconButton from '../pb_circle_icon_button/_circle_icon_button'
8
9
 
9
10
  import usePBCopy from './usePBCopy'
10
11
 
@@ -18,6 +19,7 @@ type CopyButtonProps = {
18
19
  tooltipPlacement?: 'top' | 'right' | 'bottom' | 'left'
19
20
  tooltipText?: string
20
21
  value?: string
22
+ variant?: 'button' | 'icon'
21
23
  timeout?: number
22
24
  }
23
25
 
@@ -28,11 +30,12 @@ const CopyButton = (props: CopyButtonProps) => {
28
30
  data = {},
29
31
  from = '',
30
32
  id,
31
- text= 'Copy',
33
+ text = 'Copy',
32
34
  timeout = 1000,
33
- tooltipPlacement= 'bottom',
35
+ tooltipPlacement = 'bottom',
34
36
  tooltipText = 'Copied!',
35
37
  value = '',
38
+ variant = 'button',
36
39
  } = props
37
40
 
38
41
  const [copied, copy] = usePBCopy({ value, from, timeout })
@@ -42,7 +45,8 @@ const CopyButton = (props: CopyButtonProps) => {
42
45
  const classes = classnames(buildCss('pb_copy_button_kit'), globalProps(props), className)
43
46
 
44
47
  return (
45
- <div {...ariaProps}
48
+ <div
49
+ {...ariaProps}
46
50
  {...dataProps}
47
51
  className={classes}
48
52
  id={id}
@@ -53,11 +57,20 @@ const CopyButton = (props: CopyButtonProps) => {
53
57
  showTooltip={false}
54
58
  text={tooltipText}
55
59
  >
56
- <Button icon="copy"
57
- onClick={copy}
58
- >
59
- {text}
60
- </Button>
60
+ {variant === 'icon' ? (
61
+ <CircleIconButton
62
+ icon="copy"
63
+ onClick={copy}
64
+ variant="link"
65
+ />
66
+ ) : (
67
+ <Button
68
+ icon="copy"
69
+ onClick={copy}
70
+ >
71
+ {text}
72
+ </Button>
73
+ )}
61
74
  </Tooltip>
62
75
  </div>
63
76
  )
@@ -0,0 +1,24 @@
1
+ import React from 'react'
2
+
3
+ import CopyButton from '../../pb_copy_button/_copy_button'
4
+ import Textarea from '../../pb_textarea/_textarea'
5
+
6
+ const CopyIconVariant = (props) => (
7
+ <div>
8
+ <CopyButton
9
+ {...props}
10
+ text="Copy Text"
11
+ tooltipPlacement="right"
12
+ tooltipText="Text copied!"
13
+ value="Playbook makes it easy to support bleeding edge, or legacy systems. Use Playbook’s 200+ components and end-to-end design language to create simple, intuitive and beautiful experiences with ease."
14
+ variant="icon"
15
+ />
16
+
17
+ <Textarea
18
+ {...props}
19
+ placeholder="Copy and paste here"
20
+ />
21
+ </div>
22
+ )
23
+
24
+ export default CopyIconVariant
@@ -0,0 +1 @@
1
+ Pass in `variant="icon"` to replace the Button with the Circle Icon Button kit.
@@ -8,3 +8,4 @@ examples:
8
8
  - copy_button_default: Default
9
9
  - copy_button_from: Copy From
10
10
  - copy_button_hook: Copy Hook
11
+ - copy_button_icon_variant: Icon Variant
@@ -1,3 +1,4 @@
1
1
  export { default as CopyButtonDefault } from './_copy_button_default.jsx'
2
2
  export { default as CopyButtonFrom } from './_copy_button_from.jsx'
3
3
  export { default as CopyButtonHook } from './_copy_button_hook.jsx'
4
+ export { default as CopyButtonIconVariant } from './_copy_button_icon_variant.jsx'
@@ -0,0 +1 @@
1
+ Abbreviate larger amounts into thousands (K), millions (M), billions (B), and even trillions (T).
@@ -0,0 +1 @@
1
+ Use `decimals: "matching"` when you want the full decimal amount displayed as a single number rather than split visually.
@@ -0,0 +1 @@
1
+ Use `decimals="matching"` when you want the full decimal amount displayed as a single number rather than split visually.
@@ -1,4 +1,14 @@
1
1
  <%= pb_rails("currency", props: {
2
2
  amount: "-2,000.50",
3
3
  size: "sm",
4
+ }) %>
5
+
6
+ <%= pb_rails("currency", props: {
7
+ amount: "-2,000.50",
8
+ size: "md",
9
+ }) %>
10
+
11
+ <%= pb_rails("currency", props: {
12
+ amount: "-2,000.50",
13
+ size: "lg",
4
14
  }) %>
@@ -9,6 +9,16 @@ const CurrencyNegative = (props) => {
9
9
  amount="-2,000.50"
10
10
  {...props}
11
11
  />
12
+ <Currency
13
+ amount="-2,000.50"
14
+ size="md"
15
+ {...props}
16
+ />
17
+ <Currency
18
+ amount="-2,000.50"
19
+ size="lg"
20
+ {...props}
21
+ />
12
22
  </>
13
23
  )
14
24
  }
@@ -0,0 +1 @@
1
+ Small `Currency` kits have the negative sign on the lefthand side of the "$" symbol.
@@ -0,0 +1 @@
1
+ Remove the "$" symbol by setting an empty string: `symbol: ""`.
@@ -0,0 +1 @@
1
+ Remove the "$" symbol by setting an empty string: `symbol=""`.
@@ -1,3 +1,10 @@
1
+ <%= pb_rails("currency", props: {
2
+ amount: "30,327.43",
3
+ label: "Default",
4
+ size: "sm",
5
+ margin_bottom: "md",
6
+ }) %>
7
+
1
8
  <%= pb_rails("currency", props: {
2
9
  amount: "2,000.50",
3
10
  emphasized: false,
@@ -5,6 +5,13 @@ import Currency from '../_currency'
5
5
  const CurrencyVariants = (props) => {
6
6
  return (
7
7
  <>
8
+ <Currency
9
+ amount="30,327.43"
10
+ label="Default"
11
+ marginBottom="md"
12
+ size="sm"
13
+ {...props}
14
+ />
8
15
  <Currency
9
16
  amount="2,000.50"
10
17
  emphasized={false}
@@ -1,2 +1,2 @@
1
- Use to display monetary amounts, typically on dashboards or other layouts to show an overview or summary. User understanding increase when paired with labels.
2
- Cents is automatically ".00" unless other wise overwritten (i.e. unit prop).
1
+ Use this kit to display monetary amounts, typically on dashboards or other layouts to show an overview or summary. Pairing it with labels improves user understanding.
2
+ Cents are automatically ".00" unless otherwise overwritten (i.e. `unit` prop).
@@ -17,6 +17,7 @@ type DateTimeProps = {
17
17
  htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
18
18
  id?: string,
19
19
  size?: "sm" | "md",
20
+ showCurrentYear?: boolean,
20
21
  showDayOfWeek: boolean,
21
22
  showIcon?: boolean,
22
23
  timeZone?: string
@@ -32,6 +33,7 @@ const DateTime = (props: DateTimeProps): React.ReactElement => {
32
33
  showDayOfWeek = false,
33
34
  datetime,
34
35
  id,
36
+ showCurrentYear = false,
35
37
  showIcon = false,
36
38
  size = 'md',
37
39
  timeZone = 'America/New_York',
@@ -59,6 +61,7 @@ const DateTime = (props: DateTimeProps): React.ReactElement => {
59
61
  vertical="baseline"
60
62
  >
61
63
  <FormattedDate
64
+ showCurrentYear={showCurrentYear}
62
65
  showDayOfWeek={showDayOfWeek}
63
66
  size={size}
64
67
  value={datetime}
@@ -9,6 +9,7 @@
9
9
  dark: object.dark,
10
10
  date: object.date,
11
11
  show_day_of_week: object.show_day_of_week,
12
+ show_current_year: object.show_current_year,
12
13
  size: object.size,
13
14
  timezone: object.timezone,
14
15
  }) %>
@@ -16,6 +16,7 @@ module Playbook
16
16
  prop :dark, type: Playbook::Props::Boolean, default: false
17
17
  prop :show_icon, type: Playbook::Props::Boolean, default: false
18
18
  prop :show_day_of_week, type: Playbook::Props::Boolean, default: false
19
+ prop :show_current_year, type: Playbook::Props::Boolean, default: false
19
20
 
20
21
  def classname
21
22
  generate_classname("pb_date_time_kit", align)
@@ -0,0 +1,4 @@
1
+ <%= pb_rails("date_time", props: {
2
+ date: DateTime.now,
3
+ show_current_year: true
4
+ }) %>
@@ -0,0 +1,14 @@
1
+ import React from 'react'
2
+ import DateTime from '../_date_time'
3
+
4
+ const DateTimeShowCurrentYear = (props) => (
5
+ <div>
6
+ <DateTime
7
+ datetime={new Date()}
8
+ showCurrentYear
9
+ {...props}
10
+ />
11
+ </div>
12
+ )
13
+
14
+ export default DateTimeShowCurrentYear
@@ -0,0 +1 @@
1
+ Pass in `show_current_year` to show this date's current year.
@@ -0,0 +1 @@
1
+ Pass in `showCurrentYear` to show this date's current year.
@@ -1,14 +1,16 @@
1
1
  examples:
2
-
2
+
3
3
  rails:
4
4
  - date_time_default: Default
5
5
  - date_time_align: Alignment
6
6
  - date_time_size: Size
7
+ - date_time_show_current_year: Show Current Year
7
8
 
8
9
  react:
9
10
  - date_time_default: Default
10
11
  - date_time_align: Alignment
11
12
  - date_time_size: Size
13
+ - date_time_show_current_year: Show Current Year
12
14
 
13
15
  swift:
14
16
  - date_time_default_swift: Default
@@ -1,3 +1,4 @@
1
1
  export { default as DateTimeDefault } from './_date_time_default.jsx'
2
2
  export { default as DateTimeAlign } from './_date_time_align.jsx'
3
3
  export { default as DateTimeSize } from './_date_time_size.jsx'
4
+ export { default as DateTimeShowCurrentYear } from './_date_time_show_current_year.jsx'
@@ -17,6 +17,7 @@ type DateTimeStackedProps = {
17
17
  datetime: Date,
18
18
  dark: boolean,
19
19
  timeZone?: string,
20
+ showCurrentYear?: boolean,
20
21
  }
21
22
 
22
23
  const DateTimeStacked = (props: DateTimeStackedProps): React.ReactElement => {
@@ -28,6 +29,7 @@ const DateTimeStacked = (props: DateTimeStackedProps): React.ReactElement => {
28
29
  dark,
29
30
  htmlOptions = {},
30
31
  timeZone = 'America/New_York',
32
+ showCurrentYear = false,
31
33
  } = props
32
34
 
33
35
  const classes = buildCss('pb_date_time_stacked_kit', globalProps(props))
@@ -46,6 +48,7 @@ const DateTimeStacked = (props: DateTimeStackedProps): React.ReactElement => {
46
48
  bold
47
49
  dark={dark}
48
50
  date={date || datetime}
51
+ showCurrentYear={showCurrentYear}
49
52
  />
50
53
  </FlexItem>
51
54
 
@@ -1,8 +1,8 @@
1
- <%= pb_content_tag do %>
1
+ <%= pb_content_tag do %>
2
2
 
3
3
  <%= pb_rails("flex", props: {classname: "flex-container", vertical: "stretch"}) do %>
4
4
  <%= pb_rails("body", props: {classname: "flex-item"}) do %>
5
- <%= pb_rails("date_stacked", props: { date: object.date_time_value, size: "sm", align: "right", bold: true, dark: object.dark }) %>
5
+ <%= pb_rails("date_stacked", props: { date: object.date_time_value, size: "sm", align: "right", bold: true, dark: object.dark, show_current_year: object.show_current_year }) %>
6
6
  <% end %>
7
7
  <%= pb_rails("section_separator", props: { orientation: "vertical", classname: "date-time-padding" }) %>
8
8
  <%= pb_rails("body", props: {classname: "flex-item"}) do %>
@@ -10,6 +10,8 @@ module Playbook
10
10
  default: false
11
11
  prop :timezone, type: Playbook::Props::String,
12
12
  default: "America/New_York"
13
+ prop :show_current_year, type: Playbook::Props::Boolean,
14
+ default: false
13
15
 
14
16
  def date_time_value
15
17
  date || date_time
@@ -41,3 +41,36 @@ test('renders time in timezone', () => {
41
41
  const kit = renderKit(DateTimeStacked, props)
42
42
  expect(kit).toHaveTextContent(`${monthDayYear}11:00aMDT`)
43
43
  })
44
+
45
+ test('renders current year when showCurrentYear is true', () => {
46
+ const currentYearDate = new Date()
47
+ const currentYear = currentYearDate.getFullYear()
48
+
49
+ const kit = renderKit(DateTimeStacked, {
50
+ data: { testid: 'datetimestacked-current-year' },
51
+ datetime: currentYearDate,
52
+ dark: false,
53
+ showCurrentYear: true,
54
+ })
55
+ expect(kit).toHaveTextContent(currentYear.toString())
56
+ })
57
+
58
+ test('hides current year by default', () => {
59
+ const currentYearDate = new Date()
60
+ const currentYear = currentYearDate.getFullYear()
61
+
62
+ const kit = renderKit(DateTimeStacked, {
63
+ data: { testid: 'datetimestacked-hide-year' },
64
+ datetime: currentYearDate,
65
+ dark: false,
66
+ })
67
+
68
+ const yearElement = kit.querySelector('.pb_caption_kit_xs')
69
+
70
+ if (yearElement) {
71
+ expect(yearElement.textContent).not.toBe(currentYear.toString())
72
+ } else {
73
+
74
+ expect(yearElement).toBeNull()
75
+ }
76
+ })
@@ -0,0 +1,4 @@
1
+ <%= pb_rails("date_time_stacked", props: { date_time: DateTime.now, show_current_year: true }) %>
2
+ <br>
3
+ <%= pb_rails("date_time_stacked", props: { date_time: DateTime.now, show_current_year: true, timezone: "America/Denver" }) %>
4
+
@@ -0,0 +1,22 @@
1
+ import React from 'react'
2
+
3
+ import DateTimeStacked from '../_date_time_stacked'
4
+
5
+ const DateTimeStackedShowCurrentYear = (props) => (
6
+ <div>
7
+ <DateTimeStacked
8
+ datetime={new Date()}
9
+ showCurrentYear
10
+ {...props}
11
+ />
12
+ <br />
13
+ <DateTimeStacked
14
+ datetime={new Date()}
15
+ showCurrentYear
16
+ timeZone="America/Denver"
17
+ {...props}
18
+ />
19
+ </div>
20
+ );
21
+
22
+ export default DateTimeStackedShowCurrentYear;
@@ -0,0 +1 @@
1
+ By default, the Date Time Stacked kit does NOT display the year if it is the current year. If you want to display the current year you can do so by setting `showCurrentYear`/`show_current_year` to true as shown here.
@@ -2,9 +2,11 @@ examples:
2
2
 
3
3
  rails:
4
4
  - date_time_stacked_default: Default
5
-
5
+ - date_time_stacked_show_current_year: Show Current Year
6
+
6
7
  react:
7
8
  - date_time_stacked_default: Default
9
+ - date_time_stacked_show_current_year: Show Current Year
8
10
 
9
11
  swift:
10
12
  - date_time_stacked_default_swift: Default
@@ -1 +1,2 @@
1
1
  export { default as DateTimeStackedDefault } from './_date_time_stacked_default.jsx'
2
+ export { default as DateTimeStackedShowCurrentYear } from './_date_time_stacked_show_current_year.jsx'