playbook_ui 14.21.2.pre.alpha.PLAY22558410 → 14.22.0.pre.alpha.PLAY2207preservesearchinputrails8526

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 (55) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/_playbook.scss +0 -1
  3. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +14 -2
  4. data/app/pb_kits/playbook/pb_advanced_table/scss_partials/advanced_table_sticky_mixin.scss +16 -1
  5. data/app/pb_kits/playbook/pb_contact/contact.test.js +2 -2
  6. data/app/pb_kits/playbook/pb_dashboard/pbChartsDarkTheme.ts +1 -39
  7. data/app/pb_kits/playbook/pb_dashboard/pbChartsLightTheme.ts +1 -39
  8. data/app/pb_kits/playbook/pb_filter/filter.test.js +2 -2
  9. data/app/pb_kits/playbook/pb_table/styles/_table-card.scss +11 -0
  10. data/app/pb_kits/playbook/pb_tooltip/_tooltip.tsx +34 -22
  11. data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_click_open.jsx +25 -0
  12. data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_click_open.md +1 -0
  13. data/app/pb_kits/playbook/pb_tooltip/docs/example.yml +1 -0
  14. data/app/pb_kits/playbook/pb_tooltip/docs/index.js +1 -0
  15. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_preserve_input.html.erb +17 -0
  16. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_preserve_input_rails.md +1 -0
  17. data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +1 -0
  18. data/app/pb_kits/playbook/pb_typeahead/typeahead.rb +3 -0
  19. data/dist/chunks/_typeahead-B7FRYVtS.js +22 -0
  20. data/dist/chunks/{_weekday_stacked-D1bqIne1.js → _weekday_stacked-B0oaGhTW.js} +1 -1
  21. data/dist/chunks/{lib-CTkMyvfQ.js → lib-Carqm8Ip.js} +1 -1
  22. data/dist/chunks/{pb_form_validation-BVF3TmcL.js → pb_form_validation-DqRmTS8m.js} +1 -1
  23. data/dist/chunks/vendor.js +1 -1
  24. data/dist/menu.yml +0 -9
  25. data/dist/playbook-doc.js +2 -2
  26. data/dist/playbook-rails-react-bindings.js +1 -1
  27. data/dist/playbook-rails.js +1 -1
  28. data/dist/playbook.css +1 -1
  29. data/lib/playbook/version.rb +2 -2
  30. metadata +11 -30
  31. data/app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.scss +0 -14
  32. data/app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.tsx +0 -119
  33. data/app/pb_kits/playbook/pb_treemap_chart/docs/_description.md +0 -5
  34. data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_colors.html.erb +0 -37
  35. data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_colors.jsx +0 -48
  36. data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_colors.md +0 -2
  37. data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_default.html.erb +0 -37
  38. data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_default.jsx +0 -47
  39. data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_default.md +0 -3
  40. data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_drillable.html.erb +0 -79
  41. data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_drillable.jsx +0 -90
  42. data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_drillable.md +0 -1
  43. data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_grouped_data.html.erb +0 -54
  44. data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_grouped_data.jsx +0 -65
  45. data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_grouped_data.md +0 -3
  46. data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_tooltip.html.erb +0 -37
  47. data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_tooltip.jsx +0 -48
  48. data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_tooltip.md +0 -3
  49. data/app/pb_kits/playbook/pb_treemap_chart/docs/example.yml +0 -15
  50. data/app/pb_kits/playbook/pb_treemap_chart/docs/index.js +0 -5
  51. data/app/pb_kits/playbook/pb_treemap_chart/treemapChart.test.js +0 -63
  52. data/app/pb_kits/playbook/pb_treemap_chart/treemap_chart.html.erb +0 -1
  53. data/app/pb_kits/playbook/pb_treemap_chart/treemap_chart.rb +0 -48
  54. data/dist/chunks/_typeahead-B80UsDrG.js +0 -22
  55. /data/app/pb_kits/playbook/pb_typeahead/docs/{_typeahead_preserve_input.md → _typeahead_preserve_input_react.md} +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e74ebcaf8b226f04a617fc63083c59c61951a3f792409c906b7556ef4976f6c0
4
- data.tar.gz: 755270c0eee4c986ca9d0534ffd31bec09383994a038ab4a6da7e43740537e10
3
+ metadata.gz: fb55b0bca007611e41aa7ce0472e8e483b7cd331474f40cb148c7b1035a49f55
4
+ data.tar.gz: '062979c589167bf83791e83d6ba8bdf57027f60a5f3dca112becf14c5329eeb3'
5
5
  SHA512:
6
- metadata.gz: f7329823f5e763a4aa9712a78d7467fde07db90542cb2d6416ade72983d3984651f03fb3bb847f92582293623569a9c24a8756b051eec84a524b525a2164b9ce
7
- data.tar.gz: 5fab13b2c33b5ee332beb81aed83254723ed0808a7d0b85cc68acadde24d79f8cdf773c7b97e73025e1a6ed00e118304533fab5581ce7bcfd46db7c7b98a843d
6
+ metadata.gz: 8bcbbe90d7ab4ba8461d71468d0f12ba34c2fcda3d6254de02d4ef3b0ab9ca49009af25122de796e7e7403dbacc0241781d03fd5401516a605dc2bb831c6fd46
7
+ data.tar.gz: c1d521f3b072a5326b6caa43efbdd462c68d8861b91a8db031fa8c974c088e947709d0c2bfe28a46a38358232d152a01924d097214e74b7e88883a82f432e4ef
@@ -104,7 +104,6 @@
104
104
  @import 'pb_title_detail/title_detail';
105
105
  @import 'pb_toggle/toggle';
106
106
  @import 'pb_tooltip/tooltip';
107
- @import 'pb_treemap_chart/treemap_chart';
108
107
  @import 'pb_typeahead/typeahead';
109
108
  @import 'pb_user/user';
110
109
  @import 'pb_user_badge/user_badge';
@@ -56,7 +56,7 @@
56
56
  }
57
57
 
58
58
  .bg-row-selection {
59
- background-color: $info_subtle;
59
+ background-color: #E5EEFA;
60
60
  }
61
61
 
62
62
  .full-width {
@@ -227,7 +227,7 @@
227
227
 
228
228
  &.bg-row-selection {
229
229
  td:first-child {
230
- background-color: $info_subtle;
230
+ background-color: #E5EEFA;
231
231
  }
232
232
  }
233
233
  }
@@ -892,6 +892,18 @@
892
892
  }
893
893
  }
894
894
  }
895
+ .bg-row-selection {
896
+ background-color: #202850;
897
+ }
898
+ .pb_advanced_table_body {
899
+ tr.virtualized-table-row {
900
+ &.bg-row-selection {
901
+ td:first-child {
902
+ background-color: #202850;
903
+ }
904
+ }
905
+ }
906
+ }
895
907
  }
896
908
  }
897
909
 
@@ -2,7 +2,8 @@
2
2
  $border-color,
3
3
  $bg-main,
4
4
  $bg-secondary,
5
- $highlight: $info_subtle
5
+ $highlight: #E5EEFA,
6
+ $highlight-dark: #202850,
6
7
  ) {
7
8
  border-radius: 4px;
8
9
  box-shadow: 1px 0 0 0px $border-color, -1px 0 0 0px $border-color;
@@ -95,4 +96,18 @@
95
96
  box-shadow: none !important;
96
97
  }
97
98
  }
99
+
100
+ &.dark {
101
+ .bg-row-selection {
102
+ td:first-child,
103
+ .sticky-left {
104
+ background-color: $highlight-dark;
105
+ }
106
+ }
107
+ .virtualized-table-row {
108
+ &.bg-row-selection td:first-child {
109
+ background-color: $highlight-dark;
110
+ }
111
+ }
112
+ }
98
113
  }
@@ -77,12 +77,12 @@ test('returns correct icon', () => {
77
77
 
78
78
  expect(screen.getByTestId('test-cell').querySelector('.pb_custom_icon')).toBeInTheDocument()
79
79
  expect(screen.getByTestId('test-home').querySelector('.pb_custom_icon')).toBeInTheDocument()
80
- expect(screen.getByTestId('test-work').querySelector('.pb_icon_kit')).toHaveClass('fa-phone-office')
80
+ expect(screen.getByTestId('test-work').querySelector('.pb_custom_icon')).toBeInTheDocument()
81
81
  expect(screen.getByTestId('test-work-cell').querySelector('.pb_custom_icon')).toBeInTheDocument()
82
82
  expect(screen.getByTestId('test-email').querySelector('.pb_custom_icon')).toBeInTheDocument()
83
83
  expect(screen.getByTestId('test-wrong-phone').querySelector('.pb_custom_icon')).toBeInTheDocument()
84
84
  expect(screen.getByTestId('test-wrong-type').querySelector('.pb_custom_icon')).toBeInTheDocument()
85
- expect(screen.getByTestId('test-extension').querySelector('.pb_icon_kit')).toHaveClass('fa-phone-plus')
85
+ expect(screen.getByTestId('test-extension').querySelector('.pb_custom_icon')).toBeInTheDocument()
86
86
  expect(screen.getByTestId('test-empty').querySelector('.pb_custom_icon')).toBeInTheDocument()
87
87
  })
88
88
 
@@ -3,8 +3,6 @@ import typography from '../tokens/exports/_typography.module.scss'
3
3
 
4
4
  import { ThemeProps } from './themeTypes'
5
5
 
6
- import { PlotTreemapOptions } from "highcharts";
7
-
8
6
  const highchartsDarkTheme: ThemeProps = {
9
7
  lang: {
10
8
  thousandsSep: ',',
@@ -166,43 +164,7 @@ const highchartsDarkTheme: ThemeProps = {
166
164
  marker: {
167
165
  lineColor: colors.border_dark,
168
166
  },
169
- },
170
-
171
- //TREEMAP CHART STYLES
172
- treemap: {
173
- layoutAlgorithm: "squarified",
174
- allowTraversingTree: false,
175
- animationLimit: 1000,
176
- colors: [
177
- colors.data_1,
178
- colors.data_2,
179
- colors.data_3,
180
- colors.data_4,
181
- colors.data_5,
182
- colors.data_6,
183
- colors.data_7,
184
- colors.data_8,
185
- ],
186
- dataLabels: {
187
- enabled: true,
188
- style: {
189
- fontFamily: typography.font_family_base,
190
- fontWeight: typography.bold,
191
- fontSize: typography.heading_4,
192
- },
193
- },
194
- levels: [
195
- {
196
- level: 1,
197
- dataLabels: {
198
- enabled: false,
199
- },
200
- },
201
- ],
202
- traverseUpButton: {
203
- position: { y: -50 },
204
- },
205
- } as PlotTreemapOptions,
167
+ }
206
168
  },
207
169
  credits: {
208
170
  enabled: false
@@ -3,8 +3,6 @@ import typography from '../tokens/exports/_typography.module.scss'
3
3
 
4
4
  import { ThemeProps } from './themeTypes'
5
5
 
6
- import { PlotTreemapOptions } from "highcharts";
7
-
8
6
  const highchartsTheme: ThemeProps = {
9
7
  lang: {
10
8
  thousandsSep: ',',
@@ -165,43 +163,7 @@ const highchartsTheme: ThemeProps = {
165
163
  marker: {
166
164
  lineColor: '#333',
167
165
  },
168
- },
169
-
170
- //TREEMAP CHART STYLES
171
- treemap: {
172
- layoutAlgorithm: "squarified",
173
- allowTraversingTree: false,
174
- animationLimit: 1000,
175
- colors: [
176
- colors.data_1,
177
- colors.data_2,
178
- colors.data_3,
179
- colors.data_4,
180
- colors.data_5,
181
- colors.data_6,
182
- colors.data_7,
183
- colors.data_8,
184
- ],
185
- dataLabels: {
186
- enabled: true,
187
- style: {
188
- fontFamily: typography.font_family_base,
189
- fontWeight: typography.bold,
190
- fontSize: typography.heading_4,
191
- },
192
- },
193
- levels: [
194
- {
195
- level: 1,
196
- dataLabels: {
197
- enabled: false,
198
- },
199
- },
200
- ],
201
- traverseUpButton: {
202
- position: { y: -50 },
203
- },
204
- } as PlotTreemapOptions,
166
+ }
205
167
  },
206
168
  credits: {
207
169
  enabled: false
@@ -58,12 +58,12 @@ function FilterTest(props) {
58
58
  }
59
59
 
60
60
  test("triggers popover on filter button click", () => {
61
- render(<FilterTest data={{ testid: "render-test" }}/>);
61
+ const { container } = render(<FilterTest data={{ testid: "render-test" }}/>);
62
62
 
63
63
  const btn = screen.getAllByRole("button")[0];
64
64
 
65
65
  // checks if the sort menu rendered
66
- expect(screen.getByLabelText("sort-amount-down icon")).toBeInTheDocument()
66
+ expect(container.querySelector('.pb_custom_icon')).toBeInTheDocument()
67
67
  expect(screen.getByText('Popularity')).toBeInTheDocument() // check if filter/sort is rendered
68
68
 
69
69
  // hits the filter button and triggers popover
@@ -22,6 +22,10 @@
22
22
  border-radius: 0 4px 0 0;
23
23
  border-width: 1px 1px 1px 0;
24
24
  }
25
+ &:only-child {
26
+ border-radius: 4px 4px 0 0;
27
+ border-width: 1px 1px 1px 1px;
28
+ }
25
29
  }
26
30
  }
27
31
  }
@@ -39,6 +43,9 @@
39
43
  &:last-child {
40
44
  border-width: 0 1px 1px 0;
41
45
  }
46
+ &:only-child {
47
+ border-width: 0 1px 1px 1px;
48
+ }
42
49
  }
43
50
 
44
51
  &:last-child {
@@ -53,6 +60,10 @@
53
60
  border-radius: 0 0 4px 0;
54
61
  border-width: 0 1px 1px 0;
55
62
  }
63
+ &:only-child {
64
+ border-radius: 0 0 4px 4px;
65
+ border-width: 0 1px 1px 1px;
66
+ }
56
67
  }
57
68
  }
58
69
  }
@@ -9,6 +9,7 @@ import {
9
9
  shift,
10
10
  useFloating,
11
11
  useHover,
12
+ useClick,
12
13
  useInteractions,
13
14
  } from "@floating-ui/react"
14
15
 
@@ -23,6 +24,7 @@ type TooltipProps = {
23
24
  aria?: { [key: string]: string },
24
25
  className?: string | string[],
25
26
  children: JSX.Element,
27
+ useClickToOpen?: boolean,
26
28
  data?: { [key: string]: string },
27
29
  delay?: number | Partial<{open: number; close: number}>,
28
30
  height?: string,
@@ -46,6 +48,7 @@ const Tooltip = forwardRef((props: TooltipProps, ref: ForwardedRef<unknown>): Re
46
48
  aria = {},
47
49
  className,
48
50
  children,
51
+ useClickToOpen = false,
49
52
  data = {},
50
53
  delay = 0,
51
54
  height,
@@ -110,14 +113,21 @@ const Tooltip = forwardRef((props: TooltipProps, ref: ForwardedRef<unknown>): Re
110
113
  placement: preferredPlacement
111
114
  })
112
115
 
116
+ const hover = useHover(context, {
117
+ delay,
118
+ handleClose: interaction ? safePolygon({
119
+ blockPointerEvents: false
120
+ }) : null,
121
+ enabled: !useClickToOpen // Disable hover when useClickToOpen is true
122
+ })
123
+
124
+ const click = useClick(context, {
125
+ enabled: useClickToOpen // Only enable click when useClickToOpen is true
126
+ })
113
127
 
114
- const { getFloatingProps } = useInteractions([
115
- useHover(context, {
116
- delay,
117
- handleClose: interaction ? safePolygon({
118
- blockPointerEvents: false
119
- }) : null
120
- })
128
+ const { getFloatingProps, getReferenceProps } = useInteractions([
129
+ hover,
130
+ click
121
131
  ])
122
132
 
123
133
  const staticSide = {
@@ -142,22 +152,24 @@ const Tooltip = forwardRef((props: TooltipProps, ref: ForwardedRef<unknown>): Re
142
152
  return (
143
153
  <>
144
154
  <div
145
- className={`pb_tooltip_kit ${css}`}
146
- ref={(element) => {
147
- refs.setReference(element);
148
- if (ref) {
149
- if (typeof ref === "function") {
150
- ref(element);
151
- } else if (typeof ref === "object") {
152
- ref.current = element;
155
+ {...getReferenceProps({
156
+ className: `pb_tooltip_kit ${css}`,
157
+ ref: (element) => {
158
+ refs.setReference(element);
159
+ if (ref) {
160
+ if (typeof ref === "function") {
161
+ ref(element);
162
+ } else if (typeof ref === "object") {
163
+ ref.current = element;
164
+ }
153
165
  }
154
- }
155
- }}
156
- role="tooltip_trigger"
157
- style={{ display: "inline-block" }}
158
- {...ariaProps}
159
- {...dataProps}
160
- {...htmlProps}
166
+ },
167
+ role: "tooltip_trigger",
168
+ style: { display: "inline-block" },
169
+ ...ariaProps,
170
+ ...dataProps,
171
+ ...htmlProps,
172
+ })}
161
173
  >
162
174
  {children}
163
175
  </div>
@@ -0,0 +1,25 @@
1
+ import React from 'react'
2
+ import Button from '../../pb_button/_button'
3
+ import Tooltip from '../_tooltip'
4
+ import Flex from '../../pb_flex/_flex'
5
+
6
+ const TooltipClickOpen = (props) => {
7
+ return (
8
+ <Flex flexDirection='row'
9
+ gap='md'
10
+ wrap
11
+ >
12
+ <Tooltip
13
+ placement='top'
14
+ text='Tooltip Opened'
15
+ useClickToOpen
16
+ zIndex={10}
17
+ {...props}
18
+ >
19
+ <Button text='Click to Open' />
20
+ </Tooltip>
21
+ </Flex>
22
+ )
23
+ }
24
+
25
+ export default TooltipClickOpen
@@ -0,0 +1 @@
1
+ Set the prop `useClickToOpen` so that the tooltip will only appear when an item is clicked rather than hovered over.
@@ -18,3 +18,4 @@ examples:
18
18
  - tooltip_icon: Tooltip with Icon
19
19
  - tooltip_delay: Delay
20
20
  - tooltip_show_tooltip_react: Show Tooltip
21
+ - tooltip_click_open: Click to Open
@@ -5,3 +5,4 @@ export { default as TooltipSizing } from './_tooltip_sizing'
5
5
  export { default as TooltipIcon } from './_tooltip_icon'
6
6
  export { default as TooltipDelay } from './_tooltip_delay'
7
7
  export { default as TooltipShowTooltipReact } from './_tooltip_show_tooltip_react'
8
+ export { default as TooltipClickOpen } from './_tooltip_click_open'
@@ -0,0 +1,17 @@
1
+ <%
2
+ options = [
3
+ { label: 'Orange', value: '#FFA500' },
4
+ { label: 'Red', value: '#FF0000' },
5
+ { label: 'Green', value: '#00FF00' },
6
+ { label: 'Blue', value: '#0000FF' },
7
+ ]
8
+ %>
9
+
10
+ <%= pb_rails("typeahead", props: {
11
+ is_multi: false,
12
+ label: "Colors",
13
+ options: options,
14
+ placeholder: "Select...",
15
+ preserve_search_input: true,
16
+ })
17
+ %>
@@ -0,0 +1 @@
1
+ By default, text is not preserved in the typeahead kit when you click off of the input field. You can utilize the `preserve_search_input` prop in order to prevent text from being cleared when the field loses focus
@@ -15,6 +15,7 @@ examples:
15
15
  - typeahead_dynamic_options: Dynamic Options
16
16
  - typeahead_dynamic_options_pure_rails: Dynamic Options (Pure Rails)
17
17
  - typeahead_disabled: Disabled
18
+ - typeahead_preserve_input: Preserve Search Input
18
19
 
19
20
  react:
20
21
  - typeahead_default: Default
@@ -54,6 +54,8 @@ module Playbook
54
54
  default: nil
55
55
  prop :disabled, type: Playbook::Props::Boolean,
56
56
  default: false
57
+ prop :preserve_search_input, type: Playbook::Props::Boolean,
58
+ default: false
57
59
 
58
60
  def classname
59
61
  default_margin_bottom = margin_bottom.present? ? "" : " mb_sm"
@@ -103,6 +105,7 @@ module Playbook
103
105
  optionsByContext: options_by_context,
104
106
  clearOnContextChange: clear_on_context_change,
105
107
  disabled: disabled,
108
+ preserveSearchInput: preserve_search_input,
106
109
  }
107
110
 
108
111
  base_options[:getOptionLabel] = get_option_label if get_option_label.present?