playbook_ui 18.2.0.pre.rc.2 → 18.2.0

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 (116) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_background/_background.tsx +3 -1
  3. data/app/pb_kits/playbook/pb_background/kit.schema.json +1 -0
  4. data/app/pb_kits/playbook/pb_caption/_caption.tsx +3 -1
  5. data/app/pb_kits/playbook/pb_caption/kit.schema.json +1 -0
  6. data/app/pb_kits/playbook/pb_container/_container.tsx +3 -1
  7. data/app/pb_kits/playbook/pb_container/kit.schema.json +1 -0
  8. data/app/pb_kits/playbook/pb_currency/_currency.tsx +3 -1
  9. data/app/pb_kits/playbook/pb_currency/kit.schema.json +1 -0
  10. data/app/pb_kits/playbook/pb_dashboard_value/_dashboard_value.tsx +3 -1
  11. data/app/pb_kits/playbook/pb_dashboard_value/kit.schema.json +1 -0
  12. data/app/pb_kits/playbook/pb_detail/_detail.tsx +3 -1
  13. data/app/pb_kits/playbook/pb_detail/kit.schema.json +1 -0
  14. data/app/pb_kits/playbook/pb_dropdown/_dropdown.tsx +6 -5
  15. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_custom.md +7 -2
  16. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_custom_rails.md +7 -2
  17. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_enable_time.html.erb +33 -0
  18. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_enable_time.jsx +42 -0
  19. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_enable_time.md +24 -0
  20. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_highlight.jsx +101 -0
  21. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_highlight.md +3 -0
  22. data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +3 -0
  23. data/app/pb_kits/playbook/pb_dropdown/docs/index.js +2 -0
  24. data/app/pb_kits/playbook/pb_dropdown/index.js +19 -10
  25. data/app/pb_kits/playbook/pb_dropdown/quickpick/index.ts +60 -18
  26. data/app/pb_kits/playbook/pb_dropdown/quickpick_helper.rb +92 -3
  27. data/app/pb_kits/playbook/pb_dropdown/utilities/index.ts +8 -1
  28. data/app/pb_kits/playbook/pb_dropdown/utilities/quickpickDateSync.ts +137 -0
  29. data/app/pb_kits/playbook/pb_filter/Filter/InteractiveFilter.tsx +1 -1
  30. data/app/pb_kits/playbook/pb_highlight/_highlight.tsx +3 -1
  31. data/app/pb_kits/playbook/pb_highlight/kit.schema.json +1 -0
  32. data/app/pb_kits/playbook/pb_icon_stat_value/_icon_stat_value.tsx +3 -1
  33. data/app/pb_kits/playbook/pb_icon_stat_value/kit.schema.json +1 -0
  34. data/app/pb_kits/playbook/pb_icon_value/_icon_value.tsx +3 -1
  35. data/app/pb_kits/playbook/pb_icon_value/kit.schema.json +1 -0
  36. data/app/pb_kits/playbook/pb_label_value/_label_value.tsx +3 -1
  37. data/app/pb_kits/playbook/pb_label_value/kit.schema.json +1 -0
  38. data/app/pb_kits/playbook/pb_map/docs/_map_default.md +3 -3
  39. data/app/pb_kits/playbook/pb_message/_message.tsx +3 -1
  40. data/app/pb_kits/playbook/pb_message/kit.schema.json +1 -0
  41. data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.tsx +3 -1
  42. data/app/pb_kits/playbook/pb_multiple_users/kit.schema.json +1 -0
  43. data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.tsx +4 -2
  44. data/app/pb_kits/playbook/pb_multiple_users_stacked/kit.schema.json +1 -0
  45. data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/MoreExtensionsDropdown.tsx +10 -3
  46. data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/Toolbar.tsx +16 -1
  47. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_playground.json +2 -3
  48. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_playground.overrides.json +2 -3
  49. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_attributes.jsx +1 -5
  50. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_default.jsx +1 -5
  51. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_default.md +2 -3
  52. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_focus.jsx +1 -5
  53. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_height.jsx +3 -13
  54. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_inline.jsx +1 -5
  55. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_label.jsx +2 -3
  56. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_markdown_support.jsx +1 -2
  57. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_min_height.jsx +3 -13
  58. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_preview.jsx +1 -5
  59. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_required_indicator.jsx +1 -5
  60. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_simple.jsx +1 -5
  61. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_sticky.jsx +1 -5
  62. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_templates.jsx +1 -5
  63. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_more_extensions.jsx +3 -8
  64. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_more_extensions.md +1 -1
  65. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_rails_default.md +2 -2
  66. data/app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.test.js +2 -1
  67. data/app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor_advanced.test.js +7 -5
  68. data/app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor_rails.js +15 -4
  69. data/app/pb_kits/playbook/pb_stat_value/_stat_value.tsx +3 -1
  70. data/app/pb_kits/playbook/pb_stat_value/kit.schema.json +1 -0
  71. data/app/pb_kits/playbook/pb_table/_table.tsx +70 -197
  72. data/app/pb_kits/playbook/pb_table/index.ts +53 -122
  73. data/app/pb_kits/playbook/pb_table/styles/_sticky_columns.scss +26 -3
  74. data/app/pb_kits/playbook/pb_table/utilities/stickyColumns.test.ts +266 -0
  75. data/app/pb_kits/playbook/pb_table/utilities/stickyColumns.ts +145 -0
  76. data/app/pb_kits/playbook/pb_title_count/_title_count.tsx +3 -1
  77. data/app/pb_kits/playbook/pb_title_count/kit.schema.json +1 -0
  78. data/app/pb_kits/playbook/pb_title_detail/_title_detail.tsx +3 -1
  79. data/app/pb_kits/playbook/pb_title_detail/kit.schema.json +1 -0
  80. data/app/pb_kits/playbook/utilities/test/globalProps/onClick.test.js +237 -0
  81. data/dist/ai/all-schemas.json +16 -0
  82. data/dist/ai/forms.json +1 -1
  83. data/dist/ai/index.json +2 -2
  84. data/dist/ai/kits/background.schema.json +1 -0
  85. data/dist/ai/kits/caption.schema.json +1 -0
  86. data/dist/ai/kits/container.schema.json +1 -0
  87. data/dist/ai/kits/currency.schema.json +1 -0
  88. data/dist/ai/kits/dashboard_value.schema.json +1 -0
  89. data/dist/ai/kits/detail.schema.json +1 -0
  90. data/dist/ai/kits/highlight.schema.json +1 -0
  91. data/dist/ai/kits/icon_stat_value.schema.json +1 -0
  92. data/dist/ai/kits/icon_value.schema.json +1 -0
  93. data/dist/ai/kits/label_value.schema.json +1 -0
  94. data/dist/ai/kits/message.schema.json +1 -0
  95. data/dist/ai/kits/multiple_users.schema.json +1 -0
  96. data/dist/ai/kits/multiple_users_stacked.schema.json +1 -0
  97. data/dist/ai/kits/stat_value.schema.json +1 -0
  98. data/dist/ai/kits/title_count.schema.json +1 -0
  99. data/dist/ai/kits/title_detail.schema.json +1 -0
  100. data/dist/ai/playgrounds/rich_text_editor.json +1 -1
  101. data/dist/chunks/{_detail-BqqzPTNr.js → _detail-Bsvl694i.js} +2 -2
  102. data/dist/chunks/{_pb_line_graph-BGyCJjgG.js → _pb_line_graph-Du7xE9vl.js} +1 -1
  103. data/dist/chunks/_table-Bf6LGyL9.js +1 -0
  104. data/dist/chunks/_typeahead-w6S5Vx4b.js +1 -0
  105. data/dist/chunks/{globalProps-K1DCn3il.js → globalProps-B120NbSJ.js} +1 -1
  106. data/dist/chunks/{lib-7vm9BMqp.js → lib-Buo6zHEw.js} +1 -1
  107. data/dist/chunks/quickpickDateSync-DLDx4zce.js +1 -0
  108. data/dist/chunks/{time_picker_helper-BZutIzB3.js → time_picker_helper-CYGg0UQ0.js} +1 -1
  109. data/dist/chunks/vendor.js +2 -2
  110. data/dist/playbook-rails-react-bindings.js +1 -1
  111. data/dist/playbook-rails.js +1 -1
  112. data/dist/playbook.css +1 -1
  113. data/lib/playbook/version.rb +1 -1
  114. metadata +19 -13
  115. data/dist/chunks/_table-CEZU0qUK.js +0 -1
  116. data/dist/chunks/_typeahead-C7iPR5ZF.js +0 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fbc2a1ba01cca1bd4a5b48488fafecee3697e273fd940d942a9de5de93a76921
4
- data.tar.gz: e8cf1cc4ec63bd1957d455ed4766db51865e0f42b9369ae59065f89bb7d78946
3
+ metadata.gz: b5ac75f8f899c8e692ebc15d9e4c233540f1b055707c362099ca5f6bd23da085
4
+ data.tar.gz: 96f74ff346de6735599cbd46bf9d8b81e541b7ad7b258275e4174a922fe637ac
5
5
  SHA512:
6
- metadata.gz: f5af4f9cf873c44ba0c76176e17130f0cf77fbd9c526ccea6041a70b0e1da2951a16da702259a01d16df03628a30402bcc1fdc47f32675af28aaf16f1fdb8ffb
7
- data.tar.gz: 598126c77b37bd8885bfeb8fa1ebcc30d5f30adab8dcd92b46ea71ce8b038314dda4e774d3fea789ba3e7462ff5ea83276bd10229ce43efaa767e33fe5c430c4
6
+ metadata.gz: c8dc8cf0775094f3d738ff9fdb1bc5a7101d9f950c6503dd75c598da03e0a4353d9466a864947fbc905a42997a60f3e8ee29569179106b9c8fc796feb2fe6819
7
+ data.tar.gz: 119a30f2687af34eb8bfbc1c942182d128838437cb8c15f71a061600892d9fe5498fe400db526ee306120e4b90f220d0f97bb1467e829191e6b5fe9c35a09eaf
@@ -2,6 +2,7 @@ import React, { useEffect, useState } from 'react'
2
2
  import classnames from 'classnames'
3
3
  import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
4
4
  import { GlobalProps, globalProps, globalInlineProps } from '../utilities/globalProps'
5
+ import { GlobalEventProps, globalEventProps } from '../utilities/globalEventProps'
5
6
 
6
7
  type BackgroundColors = 'gradient' |
7
8
  'dark' |'light' | 'white' | 'success' | 'warning' | 'error' | 'info' | 'neutral' | 'primary' | 'shadow' |
@@ -35,7 +36,7 @@ type BackgroundProps = {
35
36
  padding?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl',
36
37
  tag?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span' | 'div' | 'tr' | 'th' | 'td' | 'thead' | 'col',
37
38
  transition?: 'fade' | 'blur' | 'scale',
38
- } & GlobalProps
39
+ } & GlobalProps & GlobalEventProps
39
40
 
40
41
  type ResponsiveProp<T> = T | {
41
42
  xs?: T,
@@ -166,6 +167,7 @@ const Background = (props: BackgroundProps): React.ReactElement => {
166
167
  {...ariaProps}
167
168
  {...dataProps}
168
169
  {...htmlProps}
170
+ {...globalEventProps(props)}
169
171
  alt={alt}
170
172
  className={classes}
171
173
  id={id}
@@ -221,6 +221,7 @@
221
221
  }
222
222
  },
223
223
  "globalProps": true,
224
+ "globalEventProps": true,
224
225
  "usage": {
225
226
  "react": {
226
227
  "import": "import { Background } from 'playbook-ui'",
@@ -2,6 +2,7 @@ import React from 'react'
2
2
  import classnames from 'classnames'
3
3
  import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
4
4
  import { deprecatedProps, globalProps, GlobalProps } from '../utilities/globalProps'
5
+ import { GlobalEventProps, globalEventProps } from '../utilities/globalEventProps'
5
6
 
6
7
  type CaptionProps = {
7
8
  aria?: {[key: string]: string},
@@ -15,7 +16,7 @@ type CaptionProps = {
15
16
  tag?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "p" | "span" | "div" | "caption",
16
17
  text?: string,
17
18
  variant?: null | "link",
18
- } & GlobalProps;
19
+ } & GlobalProps & GlobalEventProps;
19
20
 
20
21
  const Caption = (props: CaptionProps): React.ReactElement => {
21
22
  if (props.variant) deprecatedProps() //variant prop is deprecated, use color instead
@@ -62,6 +63,7 @@ const Caption = (props: CaptionProps): React.ReactElement => {
62
63
  {...ariaProps}
63
64
  {...dataProps}
64
65
  {...htmlProps}
66
+ {...globalEventProps(props)}
65
67
  className={css}
66
68
  id={id}
67
69
  >
@@ -78,6 +78,7 @@
78
78
  }
79
79
  },
80
80
  "globalProps": true,
81
+ "globalEventProps": true,
81
82
  "usage": {
82
83
  "react": {
83
84
  "import": "import { Caption } from 'playbook-ui'",
@@ -2,6 +2,7 @@ import React from 'react'
2
2
  import classnames from 'classnames'
3
3
  import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
4
4
  import { globalProps, GlobalProps } from '../utilities/globalProps'
5
+ import { GlobalEventProps, globalEventProps } from '../utilities/globalEventProps'
5
6
 
6
7
  type ContainerProps = {
7
8
  aria?: { [key: string]: string },
@@ -11,7 +12,7 @@ type ContainerProps = {
11
12
  htmlOptions?: { [key: string]: string | number | boolean | (() => void) | ((event: any) => void) | any },
12
13
  tag?: "div" | "span" | "a" | "button" | "option" | "table" | "tbody" | "thead" | "tfoot" | "tr" | "td" | "th" | "img" | "section" | "article" | "main" | "header" | "footer" | "nav" | "aside"
13
14
  id?: string,
14
- } & GlobalProps
15
+ } & GlobalProps & GlobalEventProps
15
16
 
16
17
  const Container = (props: ContainerProps): React.ReactElement => {
17
18
  const {
@@ -36,6 +37,7 @@ const Container = (props: ContainerProps): React.ReactElement => {
36
37
  {...ariaProps}
37
38
  {...dataProps}
38
39
  {...htmlProps}
40
+ {...globalEventProps(props)}
39
41
  className={classes}
40
42
  id={id}
41
43
  >
@@ -39,6 +39,7 @@
39
39
  }
40
40
  },
41
41
  "globalProps": true,
42
+ "globalEventProps": true,
42
43
  "usage": {
43
44
  "react": {
44
45
  "import": "import { Container } from 'playbook-ui'",
@@ -2,6 +2,7 @@ import React from 'react'
2
2
  import classnames from 'classnames'
3
3
 
4
4
  import { globalProps } from '../utilities/globalProps'
5
+ import { GlobalEventProps, globalEventProps } from '../utilities/globalEventProps'
5
6
  import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
6
7
 
7
8
  import Body from '../pb_body/_body'
@@ -28,7 +29,7 @@ type CurrencyProps = {
28
29
  unit?: string,
29
30
  unstyled?: boolean,
30
31
  commaSeparator?: boolean,
31
- }
32
+ } & GlobalEventProps
32
33
 
33
34
  const sizes: {lg: 1, md: 3, sm: 4} = {
34
35
  lg: 1,
@@ -132,6 +133,7 @@ const Currency = (props: CurrencyProps): React.ReactElement => {
132
133
  {...ariaProps}
133
134
  {...dataProps}
134
135
  {...htmlProps}
136
+ {...globalEventProps(props)}
135
137
  className={classes}
136
138
  id={id}
137
139
  >
@@ -137,6 +137,7 @@
137
137
  }
138
138
  },
139
139
  "globalProps": true,
140
+ "globalEventProps": true,
140
141
  "usage": {
141
142
  "react": {
142
143
  "import": "import { Currency } from 'playbook-ui'",
@@ -2,6 +2,7 @@ import React from 'react'
2
2
  import classnames from 'classnames'
3
3
  import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
4
4
  import { globalProps } from '../utilities/globalProps'
5
+ import { GlobalEventProps, globalEventProps } from '../utilities/globalEventProps'
5
6
 
6
7
  import Body from '../pb_body/_body'
7
8
  import StatChange from '../pb_stat_change/_stat_change'
@@ -23,7 +24,7 @@ type DashboardValueProps = {
23
24
  unit?: string,
24
25
  value?: string | number
25
26
  }
26
- }
27
+ } & GlobalEventProps
27
28
 
28
29
  const DashboardValue = (props: DashboardValueProps): React.ReactElement => {
29
30
  const {
@@ -52,6 +53,7 @@ const DashboardValue = (props: DashboardValueProps): React.ReactElement => {
52
53
  {...ariaProps}
53
54
  {...dataProps}
54
55
  {...htmlProps}
56
+ {...globalEventProps(props)}
55
57
  className={classes}
56
58
  id={id}
57
59
  >
@@ -43,6 +43,7 @@
43
43
  }
44
44
  },
45
45
  "globalProps": true,
46
+ "globalEventProps": true,
46
47
  "usage": {
47
48
  "react": {
48
49
  "import": "import { DashboardValue } from 'playbook-ui'",
@@ -2,6 +2,7 @@ import React from 'react'
2
2
  import classnames from 'classnames'
3
3
  import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
4
4
  import { globalProps, GlobalProps } from '../utilities/globalProps'
5
+ import { globalEventProps, GlobalEventProps } from '../utilities/globalEventProps'
5
6
 
6
7
  type DetailProps = {
7
8
  aria?: { [key: string]: string },
@@ -15,7 +16,7 @@ type DetailProps = {
15
16
  id?: string,
16
17
  tag?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span' | 'div',
17
18
  text?: string,
18
- } & GlobalProps
19
+ } & GlobalProps & GlobalEventProps
19
20
 
20
21
  const Detail = (props: DetailProps): React.ReactElement => {
21
22
  const {
@@ -48,6 +49,7 @@ const Detail = (props: DetailProps): React.ReactElement => {
48
49
  {...ariaProps}
49
50
  {...dataProps}
50
51
  {...htmlProps}
52
+ {...globalEventProps(props)}
51
53
  className={classes}
52
54
  id={id}
53
55
  >
@@ -65,6 +65,7 @@
65
65
  }
66
66
  },
67
67
  "globalProps": true,
68
+ "globalEventProps": true,
68
69
  "usage": {
69
70
  "react": {
70
71
  "import": "import { Detail } from 'playbook-ui'",
@@ -20,6 +20,7 @@ import {
20
20
  separateChildComponents,
21
21
  prepareSubcomponents,
22
22
  handleClickOutside,
23
+ setQuickPickDateOnPicker,
23
24
  } from "./utilities";
24
25
 
25
26
  import { DialogContext } from "../pb_dialog/_dialog_context";
@@ -87,7 +88,7 @@ const asyncOptionValue = (option: GenericObject) => option.value ?? option.id ??
87
88
 
88
89
  type CustomQuickPickDate = {
89
90
  label: string;
90
- value: string[] | { timePeriod: string; amount: number };
91
+ value: Array<Date | string> | { timePeriod: string; amount: number };
91
92
  };
92
93
 
93
94
  type CustomQuickPickDates = {
@@ -594,12 +595,12 @@ let Dropdown = (props: DropdownProps, ref: any): React.ReactElement | null => {
594
595
 
595
596
  if (controlsStartId) {
596
597
  const startPicker = (document.querySelector(`#${controlsStartId}`) as HTMLElement & { _flatpickr?: any })?._flatpickr;
597
- startPicker?.setDate(start, true);
598
+ setQuickPickDateOnPicker(startPicker, start, "start");
598
599
  }
599
600
 
600
601
  if (controlsEndId) {
601
602
  const endPicker = (document.querySelector(`#${controlsEndId}`) as HTMLElement & { _flatpickr?: any })?._flatpickr;
602
- endPicker?.setDate(end, true);
603
+ setQuickPickDateOnPicker(endPicker, end, "end");
603
604
  }
604
605
  }
605
606
  }
@@ -711,12 +712,12 @@ let Dropdown = (props: DropdownProps, ref: any): React.ReactElement | null => {
711
712
  setTimeout(() => {
712
713
  if (controlsStartId) {
713
714
  const startPicker = (document.querySelector(`#${controlsStartId}`) as HTMLElement & { _flatpickr?: any })?._flatpickr;
714
- startPicker?.setDate(start, true);
715
+ setQuickPickDateOnPicker(startPicker, start, "start");
715
716
  }
716
717
 
717
718
  if (controlsEndId) {
718
719
  const endPicker = (document.querySelector(`#${controlsEndId}`) as HTMLElement & { _flatpickr?: any })?._flatpickr;
719
- endPicker?.setDate(end, true);
720
+ setQuickPickDateOnPicker(endPicker, end, "end");
720
721
  }
721
722
  }, 0);
722
723
  }
@@ -1,10 +1,15 @@
1
1
  The `customQuickPickDates` prop allows for defining custom quick pick date options for the dropdown. The prop accepts an object with two properties: `dates` and `override`.
2
2
 
3
3
  **The `dates` property** accepts an array of objects. Each object has `label` and `value` properties. The `label` is what will be displayed in the dropdown menu. The `value` property defines the date range that will be selected, and can be:
4
- - An array of two date strings representing a specific range (e.g., `["06/01/2022", "06/07/2022"]`)
4
+ - An array of two date strings (or `Date` objects) representing a specific range (e.g., `["06/01/2022", "06/07/2022"]`).
5
+ - **Date-only** strings get start-of-day / end-of-day when synced to `enableTime` DatePickers.
6
+ - **Timed** strings use the same formats as Rails QuickPick customs:
7
+ - US `m/d/Y` + time (optional `:SS`, optional `AM`/`PM`) — wall-clock; emit offset-less `YYYY-MM-DDTHH:MM:SS`
8
+ - Offset-less `YYYY-MM-DDTHH:MM:SS` — wall-clock; emit offset-less
9
+ - ISO-8601 with `Z` or numeric offset — absolute instant; emit keeps offset/`Z` so `new Date(iso)` preserves the instant
10
+ - `Date` objects keep their authored time (including intentional midnight / `23:59:00`).
5
11
  - An object with `timePeriod` and `amount` properties for dynamic date calculations:
6
12
  - The `timePeriod` property accepts `"days"`, `"weeks"`, `"months"`, `"quarters"`, or `"years"`, representing past time periods calculated from today.
7
13
  - The `amount` property accepts any number.
8
14
 
9
15
  **The `override` property** is a boolean that controls whether custom dates replace or append to the default quick pick options. Default is `true` (replaces defaults). Set to `false` to append your custom dates to the default quick pick options.
10
-
@@ -1,10 +1,15 @@
1
1
  The `custom_quick_pick_dates` prop allows for defining custom quick pick date options for the dropdown. The prop accepts an object with two properties: `dates` and `override`.
2
2
 
3
3
  **The `dates` property** accepts an array of objects. Each object has `label` and `value` properties. The `label` is what will be displayed in the dropdown menu. The `value` property defines the date range that will be selected, and can be:
4
- - An array of two date strings representing a specific range (e.g., `["06/01/2022", "06/07/2022"]`)
4
+ - An array of two date strings representing a specific range (e.g., `["06/01/2022", "06/07/2022"]`).
5
+ - **Date-only** strings stay date-only on the option payload (SOD/EOD applied at sync when `enable_time`).
6
+ - **Timed** strings use the same formats as React QuickPick customs:
7
+ - US `m/d/Y` + time (optional `:SS`, optional `AM`/`PM`) — wall-clock (e.g. `"06/01/2022 9:30 AM"`); emit offset-less `YYYY-MM-DDTHH:MM:SS`
8
+ - Offset-less `YYYY-MM-DDTHH:MM:SS` — wall-clock (e.g. `"2026-03-08T02:30:00"`); emit offset-less
9
+ - ISO-8601 with `Z` or numeric offset — absolute instant; emit keeps offset/`Z` (e.g. `…+00:00` / `…-05:00`) so JS `new Date(iso)` preserves the same instant
10
+ - Wall-clock and absolute emit differ on purpose: offset-less keeps the authored clock face; offset-bearing strings keep the absolute instant across Rails ↔ React. Unsupported timed free text raises.
5
11
  - An object with `time_period` and `amount` properties for dynamic date calculations:
6
12
  - The `time_period` property accepts `"days"`, `"weeks"`, `"months"`, `"quarters"`, or `"years"`, representing past time periods calculated from today.
7
13
  - The `amount` property accepts any number.
8
14
 
9
15
  **The `override` property** is a boolean that controls whether custom dates replace or append to the default quick pick options. Default is `true` (replaces defaults). Set to `false` to append your custom dates to the default quick pick options.
10
-
@@ -0,0 +1,33 @@
1
+ <%= pb_rails("dropdown", props: {
2
+ id: "dropdown-quickpick-enable-time",
3
+ label: "Date Range",
4
+ name: "date_range_enable_time",
5
+ margin_bottom: "sm",
6
+ variant: "quickpick",
7
+ controls_start_id: "start-date-picker-enable-time",
8
+ controls_end_id: "end-date-picker-enable-time",
9
+ start_date_id: "quickpick_enable_time_start_date",
10
+ start_date_name: "start_date_enable_time",
11
+ end_date_id: "quickpick_enable_time_end_date",
12
+ end_date_name: "end_date_enable_time"
13
+ }) %>
14
+
15
+ <%= pb_rails("date_picker", props: {
16
+ picker_id: "start-date-picker-enable-time",
17
+ label: "Start Date",
18
+ name: "start_date_picker_enable_time",
19
+ placeholder: "Select Start Date",
20
+ enable_time: true,
21
+ close_on_select: false,
22
+ sync_start_with: "dropdown-quickpick-enable-time"
23
+ }) %>
24
+
25
+ <%= pb_rails("date_picker", props: {
26
+ picker_id: "end-date-picker-enable-time",
27
+ label: "End Date",
28
+ name: "end_date_picker_enable_time",
29
+ placeholder: "Select End Date",
30
+ enable_time: true,
31
+ close_on_select: false,
32
+ sync_end_with: "dropdown-quickpick-enable-time"
33
+ }) %>
@@ -0,0 +1,42 @@
1
+ import React from "react";
2
+ import Dropdown from "../../pb_dropdown/_dropdown";
3
+ import DatePicker from "../../pb_date_picker/_date_picker";
4
+
5
+ const DropdownQuickpickEnableTime = (props) => {
6
+ return (
7
+ <>
8
+ <Dropdown
9
+ {...props}
10
+ controlsEndId="end-date-picker-enable-time"
11
+ controlsStartId="start-date-picker-enable-time"
12
+ id="dropdown-quickpick-enable-time"
13
+ label="Range"
14
+ marginBottom="sm"
15
+ placeholder="Select a Date Range"
16
+ variant="quickpick"
17
+ />
18
+
19
+ <DatePicker
20
+ {...props}
21
+ enableTime
22
+ initializeOnce
23
+ label="Start Date"
24
+ pickerId="start-date-picker-enable-time"
25
+ placeholder="Select a Start Date"
26
+ syncStartWith="dropdown-quickpick-enable-time"
27
+ />
28
+
29
+ <DatePicker
30
+ {...props}
31
+ enableTime
32
+ initializeOnce
33
+ label="End Date"
34
+ pickerId="end-date-picker-enable-time"
35
+ placeholder="Select an End Date"
36
+ syncEndWith="dropdown-quickpick-enable-time"
37
+ />
38
+ </>
39
+ );
40
+ };
41
+
42
+ export default DropdownQuickpickEnableTime;
@@ -0,0 +1,24 @@
1
+ When linked DatePickers use `enable_time` / `enableTime`, QuickPick presets that do not include an explicit time apply **start of day** (12:00 AM) to the start picker and **end of day** (11:59 PM) to the end picker. That matches DatePicker minute precision and inclusive datetime filters for ranges like Today and Yesterday.
2
+
3
+ **Supported timed custom formats (Rails and React — same contract):**
4
+
5
+ | Format | Example | Semantics |
6
+ |--------|---------|-----------|
7
+ | US `m/d/Y` + time (optional `:SS`, optional `AM`/`PM`) | `"06/01/2022 9:30 AM"` | Wall-clock — literal hour/minute/second labels |
8
+ | Offset-less ISO datetime (`T` separator) | `"2026-03-08T02:30:00"` | Wall-clock — same as above (not server-TZ) |
9
+ | ISO-8601 with `Z` or numeric offset | `"2026-03-08T07:30:00Z"`, `"2026-03-08T02:30:00-05:00"` | Absolute instant |
10
+
11
+ **Emit (Rails and React — same contract):**
12
+
13
+ | Input kind | Emit |
14
+ |------------|------|
15
+ | Wall-clock (US `m/d/Y` + time, or offset-less `YYYY-MM-DDTHH:MM:SS`) | Offset-less `YYYY-MM-DDTHH:MM:SS` — authored clock face |
16
+ | Absolute (`Z` or numeric offset) | Keeps offset / `Z` (e.g. `…Z` or `…±HH:MM`) so `parseQuickPickDateTime` / `new Date(iso)` preserve the same instant |
17
+
18
+ React also accepts `Date` objects (times kept as authored, including intentional midnight / `23:59:00`).
19
+
20
+ Date-only custom strings (e.g. `"06/01/2022"`) still get SOD/EOD at sync when `enableTime` is on. Other free-text / undocumented timed strings are not supported.
21
+
22
+ On Rails, wall-clock customs go to the option payload as offset-less datetimes; absolute customs keep their offset so linked `enableTime` DatePickers sync to the correct instant (not a misread local wall-clock).
23
+
24
+ Alternate configuration: QuickPick + Time can also be handled by a Date-only QuickPick (Dropdown QuickPick + two DatePickers without time selection) paired with two TimePickers for start + end time selection in the same form.
@@ -0,0 +1,101 @@
1
+ import React, { useState } from 'react'
2
+
3
+ import Avatar from '../../pb_avatar/_avatar'
4
+ import Body from '../../pb_body/_body'
5
+ import Dropdown from '../../pb_dropdown/_dropdown'
6
+ import Flex from '../../pb_flex/_flex'
7
+ import FlexItem from '../../pb_flex/_flex_item'
8
+ import Title from '../../pb_title/_title'
9
+
10
+ const USERS = [
11
+ {
12
+ label: "Wade Winningham",
13
+ title: "Nitro Principal Developer",
14
+ territory: "PHL",
15
+ value: "wadeWinningham",
16
+ },
17
+ {
18
+ label: "Carlos Lima",
19
+ title: "Nitro Developer",
20
+ territory: "PHL",
21
+ value: "carlosLima",
22
+ },
23
+ {
24
+ label: "Stephen Marshall",
25
+ title: "Senior Nitro Developer",
26
+ territory: "PHL",
27
+ value: "stephenMarshall",
28
+ },
29
+ {
30
+ label: "Jasper Furniss",
31
+ title: "Lead User Experience Engineer",
32
+ territory: "PHL",
33
+ value: "jasperFurniss",
34
+ },
35
+ ]
36
+
37
+ const escapeRegExp = (value = "") => (
38
+ value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")
39
+ )
40
+
41
+ const highlighted = (text, searchInput) => {
42
+ if (!searchInput) return text
43
+
44
+ const regex = new RegExp(`(${escapeRegExp(searchInput)})`, 'gi')
45
+
46
+ return text.split(regex).map((part, index) => (
47
+ part.toLowerCase() === searchInput.toLowerCase()
48
+ ? <mark key={`${part}-${index}`}>{part}</mark>
49
+ : <React.Fragment key={`${part}-${index}`}>{part}</React.Fragment>
50
+ ))
51
+ }
52
+
53
+ const loadUsers = (searchInput) => {
54
+ const normalizedInput = searchInput.toLowerCase()
55
+
56
+ return Promise.resolve(USERS.filter(({ label, title }) => (
57
+ `${label} ${title}`.toLowerCase().includes(normalizedInput)
58
+ )))
59
+ }
60
+
61
+ const DropdownWithHighlight = (props) => {
62
+ const [searchInput, setSearchInput] = useState("")
63
+
64
+ const renderUser = ({ label, territory, title }) => (
65
+ <Flex>
66
+ <FlexItem>
67
+ <Avatar
68
+ marginRight="sm"
69
+ name={label}
70
+ size="sm"
71
+ />
72
+ </FlexItem>
73
+ <FlexItem>
74
+ <Title size={4}>
75
+ {highlighted(label, searchInput)}
76
+ </Title>
77
+ <Body color="light">
78
+ {highlighted(title, searchInput)}{" • "}
79
+ {territory}
80
+ </Body>
81
+ </FlexItem>
82
+ </Flex>
83
+ )
84
+
85
+ return (
86
+ <Dropdown
87
+ async
88
+ autocomplete
89
+ defaultOptions={USERS}
90
+ label="Users"
91
+ loadOptions={loadUsers}
92
+ onInputChange={(input) => setSearchInput(input)}
93
+ onSelect={() => setSearchInput("")}
94
+ placeholder="Search users"
95
+ renderOption={renderUser}
96
+ {...props}
97
+ />
98
+ )
99
+ }
100
+
101
+ export default DropdownWithHighlight
@@ -0,0 +1,3 @@
1
+ Use `onInputChange` to track the current search and `renderOption` to customize each option row. Split each field by the search input, then render matching text inside `<mark>` so users can quickly see why a result matched.
2
+
3
+ This example uses `loadOptions` to search both the user's name and title.
@@ -36,6 +36,7 @@ examples:
36
36
  - dropdown_quickpick_custom_rails: Quick Pick Variant (Custom Quick Pick Dates)
37
37
  - dropdown_quickpick_with_date_pickers_rails: Quick Pick with Date Pickers
38
38
  - dropdown_quickpick_with_date_pickers_default_rails: Quick Pick with Date Pickers (Default Value)
39
+ - dropdown_quickpick_enable_time: Quick Pick with Date Pickers (Enable Time)
39
40
  - dropdown_required_indicator: Required Indicator
40
41
  - dropdown_disabled: Disabled Input
41
42
  - dropdown_grouped_options: Grouped Options
@@ -50,6 +51,7 @@ examples:
50
51
  react:
51
52
  - dropdown_default: Default
52
53
  - dropdown_with_autocomplete: Autocomplete
54
+ - dropdown_with_highlight: With Highlight
53
55
  - dropdown_multi_select: Multi Select
54
56
  - dropdown_multi_select_with_autocomplete: Multi Select with Autocomplete
55
57
  - dropdown_multi_select_display: Multi Select with Form Pill Props
@@ -86,6 +88,7 @@ examples:
86
88
  - dropdown_quickpick_default_dates: Quick Pick Variant (Default Dates)
87
89
  - dropdown_quickpick_custom: Quick Pick Variant (Custom Quick Pick Dates)
88
90
  - dropdown_quickpick_with_date_pickers: Quick Pick Variant with Date Pickers
91
+ - dropdown_quickpick_enable_time: Quick Pick with Date Pickers (Enable Time)
89
92
  - dropdown_required_indicator: Required Indicator
90
93
  - dropdown_disabled: Disabled Input
91
94
  - dropdown_grouped_options: Grouped Options
@@ -47,3 +47,5 @@ export { default as DropdownAsyncMultiSelect } from './_dropdown_async_multi_sel
47
47
  export { default as DropdownAsyncRichResults } from './_dropdown_async_rich_results.jsx'
48
48
  export { default as DropdownAsyncInitialOptions } from './_dropdown_async_initial_options.jsx'
49
49
  export { default as DropdownExternalSearch } from './_dropdown_external_search.jsx'
50
+ export { default as DropdownQuickpickEnableTime } from './_dropdown_quickpick_enable_time.jsx'
51
+ export { default as DropdownWithHighlight } from './_dropdown_with_highlight.jsx'
@@ -2,6 +2,7 @@ import PbEnhancedElement from "../pb_enhanced_element";
2
2
  import { PbDropdownKeyboard } from "./keyboard_accessibility";
3
3
  import { setArrowVisibility, toggleVisibility } from "../utilities/domHelpers";
4
4
  import { subscribeFloatingKitReposition, positionDropdownPortalToWrapper } from "../utilities/floatingPortalHosts";
5
+ import { setQuickPickDateOnPicker } from "./utilities/quickpickDateSync";
5
6
 
6
7
  const DROPDOWN_SELECTOR = "[data-pb-dropdown]";
7
8
  const TRIGGER_SELECTOR = "[data-dropdown-trigger]";
@@ -1313,11 +1314,11 @@ export default class PbDropdown extends PbEnhancedElement {
1313
1314
  const syncDatePickers = () => {
1314
1315
  if (controlsStartId) {
1315
1316
  const startPicker = document.querySelector(`#${CSS.escape(controlsStartId)}`)?._flatpickr;
1316
- if (startPicker) startPicker.setDate(optionData.formatted_start_date, true, "m/d/Y");
1317
+ setQuickPickDateOnPicker(startPicker, optionData.formatted_start_date, "start");
1317
1318
  }
1318
1319
  if (controlsEndId) {
1319
1320
  const endPicker = document.querySelector(`#${CSS.escape(controlsEndId)}`)?._flatpickr;
1320
- if (endPicker) endPicker.setDate(optionData.formatted_end_date, true, "m/d/Y");
1321
+ setQuickPickDateOnPicker(endPicker, optionData.formatted_end_date, "end");
1321
1322
  }
1322
1323
  };
1323
1324
  syncDatePickers();
@@ -1447,10 +1448,10 @@ export default class PbDropdown extends PbEnhancedElement {
1447
1448
  `#${controlsStartId}`,
1448
1449
  )?._flatpickr;
1449
1450
  if (startPicker) {
1450
- startPicker.setDate(
1451
+ setQuickPickDateOnPicker(
1452
+ startPicker,
1451
1453
  optionData.formatted_start_date,
1452
- true,
1453
- "m/d/Y",
1454
+ "start",
1454
1455
  );
1455
1456
  }
1456
1457
  }
@@ -1460,7 +1461,11 @@ export default class PbDropdown extends PbEnhancedElement {
1460
1461
  `#${controlsEndId}`,
1461
1462
  )?._flatpickr;
1462
1463
  if (endPicker) {
1463
- endPicker.setDate(optionData.formatted_end_date, true, "m/d/Y");
1464
+ setQuickPickDateOnPicker(
1465
+ endPicker,
1466
+ optionData.formatted_end_date,
1467
+ "end",
1468
+ );
1464
1469
  }
1465
1470
  }
1466
1471
  } else if (startDateId || endDateId) {
@@ -1793,10 +1798,10 @@ export default class PbDropdown extends PbEnhancedElement {
1793
1798
  `#${controlsStartId}`,
1794
1799
  )?._flatpickr;
1795
1800
  if (startPicker) {
1796
- startPicker.setDate(
1801
+ setQuickPickDateOnPicker(
1802
+ startPicker,
1797
1803
  optionData.formatted_start_date,
1798
- true,
1799
- "m/d/Y",
1804
+ "start",
1800
1805
  );
1801
1806
  }
1802
1807
  }
@@ -1806,7 +1811,11 @@ export default class PbDropdown extends PbEnhancedElement {
1806
1811
  `#${controlsEndId}`,
1807
1812
  )?._flatpickr;
1808
1813
  if (endPicker) {
1809
- endPicker.setDate(optionData.formatted_end_date, true, "m/d/Y");
1814
+ setQuickPickDateOnPicker(
1815
+ endPicker,
1816
+ optionData.formatted_end_date,
1817
+ "end",
1818
+ );
1810
1819
  }
1811
1820
  }
1812
1821
  };