playbook_ui 14.5.0.pre.alpha.PLAY1485selectablecardoverflowoutlinebug4098 → 14.5.0.pre.alpha.PLAY1486highchartscssdrivenPOC3930

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/index.js +0 -60
  3. data/app/pb_kits/playbook/pb_advanced_table/table_header.html.erb +9 -1
  4. data/app/pb_kits/playbook/pb_advanced_table/table_subrow_header.html.erb +9 -1
  5. data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.scss +54 -0
  6. data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.tsx +5 -184
  7. data/app/pb_kits/playbook/pb_bar_graph/barGraph.test.js +1 -1
  8. data/app/pb_kits/playbook/pb_card/_card_mixin.scss +2 -1
  9. data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.tsx +5 -216
  10. data/app/pb_kits/playbook/pb_circle_chart/circleChart.test.js +1 -1
  11. data/app/pb_kits/playbook/pb_filter/Filter/ResultsCount.tsx +2 -4
  12. data/app/pb_kits/playbook/pb_filter/docs/_filter_default.jsx +1 -1
  13. data/app/pb_kits/playbook/pb_form_pill/_form_pill.tsx +1 -9
  14. data/app/pb_kits/playbook/pb_form_pill/docs/example.yml +0 -2
  15. data/app/pb_kits/playbook/pb_form_pill/docs/index.js +0 -1
  16. data/app/pb_kits/playbook/pb_gantt_chart/_gantt_chart.tsx +3 -64
  17. data/app/pb_kits/playbook/pb_gauge/_gauge.tsx +5 -203
  18. data/app/pb_kits/playbook/pb_gauge/gauge.test.js +1 -1
  19. data/app/pb_kits/playbook/pb_line_graph/_line_graph.tsx +5 -154
  20. data/app/pb_kits/playbook/pb_line_graph/lineGraph.test.js +1 -1
  21. data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +227 -211
  22. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_default.jsx +1 -1
  23. data/app/pb_kits/playbook/pb_multi_level_select/docs/example.yml +0 -4
  24. data/app/pb_kits/playbook/pb_multi_level_select/docs/index.js +0 -2
  25. data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.scss +1 -39
  26. data/app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.tsx +5 -113
  27. data/app/pb_kits/playbook/pb_treemap_chart/treemapChart.test.js +1 -1
  28. data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +1 -4
  29. data/app/pb_kits/playbook/pb_typeahead/components/MultiValue.tsx +1 -3
  30. data/app/pb_kits/playbook/pb_typeahead/typeahead.rb +1 -3
  31. data/dist/chunks/_typeahead-BywvWGAm.js +22 -0
  32. data/dist/chunks/_weekday_stacked-5OGZKZeo.js +45 -0
  33. data/dist/chunks/lib-DMOmCoAX.js +29 -0
  34. data/dist/chunks/{pb_form_validation-D9zkwt2b.js → pb_form_validation-Dna2I7fw.js} +1 -1
  35. data/dist/chunks/vendor.js +1 -1
  36. data/dist/playbook-doc.js +1 -1
  37. data/dist/playbook-rails-react-bindings.js +1 -1
  38. data/dist/playbook-rails.js +1 -1
  39. data/dist/playbook.css +1 -1
  40. data/lib/playbook/pb_doc_helper.rb +5 -5
  41. data/lib/playbook/version.rb +1 -1
  42. metadata +6 -17
  43. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_truncated_text.html.erb +0 -19
  44. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_truncated_text.jsx +0 -27
  45. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_truncated_text.md +0 -1
  46. data/app/pb_kits/playbook/pb_multi_level_select/context/index.tsx +0 -5
  47. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_reset.html.erb +0 -93
  48. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_reset.md +0 -1
  49. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_with_children.jsx +0 -105
  50. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_with_children.md +0 -1
  51. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_with_children_with_radios.jsx +0 -106
  52. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_with_children_with_radios.md +0 -1
  53. data/app/pb_kits/playbook/pb_multi_level_select/multi_level_select_options.tsx +0 -149
  54. data/dist/chunks/_typeahead-C9g4qCcE.js +0 -22
  55. data/dist/chunks/_weekday_stacked-B0Zid7Rv.js +0 -45
  56. data/dist/chunks/lib-CEpcaI8y.js +0 -29
@@ -7,7 +7,6 @@ examples:
7
7
  - multi_level_select_selected_ids: Selected Ids
8
8
  - multi_level_select_with_form: With Form
9
9
  - multi_level_select_color: With Pills (Custom Color)
10
- - multi_level_select_reset: Reset Selection
11
10
 
12
11
  react:
13
12
  - multi_level_select_default: Default
@@ -16,6 +15,3 @@ examples:
16
15
  - multi_level_select_return_all_selected: Return All Selected
17
16
  - multi_level_select_selected_ids_react: Selected Ids
18
17
  - multi_level_select_color: With Pills (Custom Color)
19
- - multi_level_select_with_children: Checkboxes With Children
20
- - multi_level_select_with_children_with_radios: Single Select With Children
21
-
@@ -4,5 +4,3 @@ export { default as MultiLevelSelectSingleChildrenOnly } from './_multi_level_se
4
4
  export { default as MultiLevelSelectReturnAllSelected } from './_multi_level_select_return_all_selected.jsx'
5
5
  export { default as MultiLevelSelectSelectedIdsReact } from "./_multi_level_select_selected_ids_react.jsx"
6
6
  export { default as MultiLevelSelectColor } from './_multi_level_select_color.jsx'
7
- export { default as MultiLevelSelectWithChildren } from './_multi_level_select_with_children.jsx'
8
- export { default as MultiLevelSelectWithChildrenWithRadios } from './_multi_level_select_with_children_with_radios.jsx'
@@ -10,24 +10,6 @@
10
10
  $pb_selectable_card_indicator_size: 22px;
11
11
  $pb_selectable_card_border: 2px;
12
12
 
13
- $pb_selectable_space_classes: (
14
- xxs: $space_xxs,
15
- xs: $space_xs,
16
- sm: $space_sm,
17
- md: $space_md,
18
- lg: $space_lg,
19
- xl: $space_xl,
20
- );
21
- $pb_selectable_paddings: (
22
- p: "padding",
23
- pr: "padding-right",
24
- pl: "padding-left",
25
- pt: "padding-top",
26
- pb: "padding-bottom",
27
- px: ("padding-left", "padding-right"),
28
- py: ("padding-top", "padding-bottom")
29
- );
30
-
31
13
  [class^=pb_selectable_card_kit] {
32
14
  display: block;
33
15
  margin-bottom: 0;
@@ -46,6 +28,7 @@ $pb_selectable_paddings: (
46
28
  padding: $space_sm;
47
29
  margin-bottom: $space_sm;
48
30
  cursor: pointer;
31
+ outline: 1px solid transparent;
49
32
 
50
33
  @media (hover:hover) {
51
34
  &:hover {
@@ -91,7 +74,6 @@ $pb_selectable_paddings: (
91
74
 
92
75
  position: relative;
93
76
  @include pb_card_selected;
94
- padding: calc(#{$space_sm} - 1px);
95
77
  transition-property: none;
96
78
  transition-duration: 0s;
97
79
 
@@ -106,26 +88,6 @@ $pb_selectable_paddings: (
106
88
  background-color: $royal;
107
89
  }
108
90
  }
109
-
110
- // Selected card has 1px more border
111
- // Remove 1px so content does not "jump"
112
- @each $position_name,
113
- $position in $pb_selectable_paddings {
114
- @each $space_name,
115
- $space in $pb_selectable_space_classes {
116
- ~ label.#{$position_name}_#{$space_name} {
117
- @if type-of($position)=="list" {
118
- @each $coordinate in $position {
119
- #{$coordinate}: calc(#{$space} - 1px) !important;
120
- }
121
- }
122
-
123
- @else {
124
- #{$position}: calc(#{$space} - 1px) !important;
125
- }
126
- }
127
- }
128
- }
129
91
  }
130
92
  }
131
93
 
@@ -1,118 +1,10 @@
1
- import React, { useState, useEffect } from "react";
2
- import classnames from "classnames";
3
-
4
- import { globalProps } from "../utilities/globalProps";
5
- import { buildAriaProps, buildDataProps, buildHtmlProps } from "../utilities/props";
6
-
7
- import HighchartsReact from "highcharts-react-official";
8
- import Highcharts from "highcharts";
9
- import { highchartsTheme } from "../pb_dashboard/pbChartsLightTheme";
10
- import { highchartsDarkTheme } from "../pb_dashboard/pbChartsDarkTheme";
11
- import mapColors from "../pb_dashboard/pbChartsColorsHelper";
12
- import treemap from 'highcharts/modules/treemap'
13
- import { merge } from 'lodash'
14
-
15
- type TreemapChartProps = {
16
- chartData: {
17
- name: string;
18
- parent?: string | number;
19
- value: number;
20
- color?: string;
21
- id?: string | number;
22
- }[];
23
- className?: string;
24
- colors: string[];
25
- customOptions?: Partial<Highcharts.Options>;
26
- dark?: boolean;
27
- drillable: boolean;
28
- grouped: boolean;
29
- height?: string;
30
- htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
31
- id: number | string;
32
- title?: string;
33
- tooltipHtml: string;
34
- type?: string;
35
- aria?: { [key: string]: string };
36
- data?: { [key: string]: string };
37
- };
38
-
39
- const TreemapChart = ({
40
- aria = {},
41
- data = {},
42
- chartData,
43
- colors,
44
- customOptions = {},
45
- dark = false,
46
- drillable = false,
47
- grouped = false,
48
- height,
49
- htmlOptions = {},
50
- id,
51
- title = "",
52
- tooltipHtml = '<span style="font-weight: bold; color:{point.color};">●</span>{point.name}: <b>{point.value}</b>',
53
- type = "treemap",
54
- ...props
55
- }: TreemapChartProps): React.ReactElement => {
56
-
57
- const ariaProps = buildAriaProps(aria)
58
- const dataProps = buildDataProps(data)
59
- const htmlProps = buildHtmlProps(htmlOptions)
60
-
61
- const setupTheme = () => {
62
- dark
63
- ? Highcharts.setOptions(highchartsDarkTheme)
64
- : Highcharts.setOptions(highchartsTheme);
65
- };
66
- treemap(Highcharts)
67
- setupTheme();
68
-
69
- const staticOptions = {
70
- title: {
71
- text: title,
72
- },
73
- chart: {
74
- height: height,
75
- type: type,
76
- },
77
- credits: false,
78
- series: [
79
- {
80
- data: chartData,
81
- },
82
- ],
83
- plotOptions: {
84
- treemap: {
85
- tooltip: {
86
- pointFormat: tooltipHtml,
87
- },
88
- allowTraversingTree: drillable,
89
- colorByPoint: !grouped,
90
- colors:
91
- colors !== undefined && colors.length > 0
92
- ? mapColors(colors)
93
- : highchartsTheme.colors,
94
- },
95
- },
96
- };
97
-
98
- const [options, setOptions] = useState({});
99
-
100
- useEffect(() => {
101
- setOptions(merge(staticOptions, customOptions));
102
- }, [chartData]);
1
+ import React from 'react';
103
2
 
3
+ const TreemapChart: React.FC = () => {
104
4
  return (
105
- <HighchartsReact
106
- containerProps={{
107
- className: classnames(globalProps(props), "pb_treemap_chart"),
108
- id: id,
109
- ...ariaProps,
110
- ...dataProps,
111
- ...htmlProps
112
- }}
113
- highcharts={Highcharts}
114
- options={options}
115
- />
5
+ <div>
6
+ This is a simple div component.
7
+ </div>
116
8
  );
117
9
  };
118
10
 
@@ -19,7 +19,7 @@ afterEach(() => {
19
19
 
20
20
  const testId = 'treemapchart1';
21
21
 
22
- test('uses exact classname', () => {
22
+ test.skip('uses exact classname', () => {
23
23
  const data = [
24
24
  {
25
25
  name: "Pepperoni",
@@ -136,15 +136,12 @@ const Typeahead = ({
136
136
  }
137
137
  }
138
138
 
139
- const filteredProps: TypeaheadProps = {...props}
140
- delete filteredProps.truncate
141
-
142
139
  const dataProps = buildDataProps(data)
143
140
  const htmlProps = buildHtmlProps(htmlOptions)
144
141
  const classes = classnames(
145
142
  'pb_typeahead_kit react-select',
146
143
  `mb_${marginBottom}`,
147
- globalProps(filteredProps),
144
+ globalProps(props),
148
145
  className
149
146
  )
150
147
 
@@ -16,7 +16,7 @@ type Props = {
16
16
  const MultiValue = (props: Props) => {
17
17
  const { removeProps } = props
18
18
  const { imageUrl, label } = props.data
19
- const { dark, multiKit, pillColor, truncate } = props.selectProps
19
+ const { dark, multiKit, pillColor } = props.selectProps
20
20
 
21
21
  const formPillProps = {
22
22
  marginRight: 'xs',
@@ -51,7 +51,6 @@ const MultiValue = (props: Props) => {
51
51
  name={label}
52
52
  size={multiKit === 'smallPill' ? 'small' : ''}
53
53
  text=''
54
- truncate={truncate}
55
54
  {...props}
56
55
  />
57
56
  }
@@ -65,7 +64,6 @@ const MultiValue = (props: Props) => {
65
64
  name=''
66
65
  size={multiKit === 'smallPill' ? 'small' : ''}
67
66
  text={label}
68
- truncate={truncate}
69
67
  {...props}
70
68
  />
71
69
  }
@@ -65,10 +65,10 @@ module Playbook
65
65
  def typeahead_react_options
66
66
  base_options = {
67
67
  className: classname,
68
+ pillColor: pill_color,
68
69
  dark: dark,
69
70
  defaultValue: default_options,
70
71
  error: error,
71
- htmlOptions: html_options,
72
72
  id: id,
73
73
  inline: inline,
74
74
  isMulti: is_multi,
@@ -77,10 +77,8 @@ module Playbook
77
77
  multiKit: multi_kit,
78
78
  name: name,
79
79
  options: options,
80
- pillColor: pill_color,
81
80
  placeholder: placeholder,
82
81
  plusIcon: plus_icon,
83
- truncate: truncate,
84
82
  }
85
83
 
86
84
  base_options[:getOptionLabel] = get_option_label if get_option_label.present?