playbook_ui 14.4.0.pre.alpha.PBNTR550typeaheadformpilltruncate3895 → 14.4.0.pre.alpha.PLAY1486highchartscssdrivenPOC3921

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/_playbook.scss +2 -0
  3. data/app/pb_kits/playbook/pb_advanced_table/advanced_table.test.jsx +1 -1
  4. data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.scss +25 -0
  5. data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.tsx +5 -184
  6. data/app/pb_kits/playbook/pb_bar_graph/barGraph.test.js +1 -1
  7. data/app/pb_kits/playbook/pb_button/_button.tsx +6 -2
  8. data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.tsx +5 -216
  9. data/app/pb_kits/playbook/pb_circle_chart/circleChart.test.js +1 -1
  10. data/app/pb_kits/playbook/pb_dashboard/pbChartsDarkTheme.ts +2 -6
  11. data/app/pb_kits/playbook/pb_dashboard/pbChartsLightTheme.ts +2 -7
  12. data/app/pb_kits/playbook/pb_drawer/_close_icon.tsx +25 -0
  13. data/app/pb_kits/playbook/pb_drawer/_drawer.scss +465 -0
  14. data/app/pb_kits/playbook/pb_drawer/_drawer.tsx +195 -0
  15. data/app/pb_kits/playbook/pb_drawer/_drawer_context.tsx +3 -0
  16. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_borders.jsx +117 -0
  17. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_breakpoints.jsx +43 -0
  18. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_default.html.erb +1 -0
  19. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_default.jsx +63 -0
  20. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.jsx +55 -0
  21. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_sizes.jsx +113 -0
  22. data/app/pb_kits/playbook/pb_drawer/docs/example.yml +12 -0
  23. data/app/pb_kits/playbook/pb_drawer/docs/index.js +5 -0
  24. data/app/pb_kits/playbook/pb_drawer/drawer.html.erb +12 -0
  25. data/app/pb_kits/playbook/pb_drawer/drawer.rb +8 -0
  26. data/app/pb_kits/playbook/pb_drawer/drawer.test.jsx +77 -0
  27. data/app/pb_kits/playbook/pb_filter/docs/_filter_default.html.erb +10 -2
  28. data/app/pb_kits/playbook/pb_filter/docs/_filter_max_height.html.erb +5 -1
  29. data/app/pb_kits/playbook/pb_filter/docs/_filter_max_width.html.erb +5 -1
  30. data/app/pb_kits/playbook/pb_filter/docs/_filter_no_background.html.erb +5 -1
  31. data/app/pb_kits/playbook/pb_filter/docs/_filter_no_sort.html.erb +5 -1
  32. data/app/pb_kits/playbook/pb_filter/docs/_filter_only.html.erb +5 -1
  33. data/app/pb_kits/playbook/pb_filter/docs/_filter_placement.html.erb +5 -1
  34. data/app/pb_kits/playbook/pb_filter/docs/_filter_single.html.erb +5 -1
  35. data/app/pb_kits/playbook/pb_form_pill/_form_pill.tsx +1 -9
  36. data/app/pb_kits/playbook/pb_gantt_chart/_gantt_chart.tsx +3 -64
  37. data/app/pb_kits/playbook/pb_gauge/_gauge.tsx +5 -203
  38. data/app/pb_kits/playbook/pb_gauge/gauge.test.js +1 -1
  39. data/app/pb_kits/playbook/pb_line_graph/_line_graph.tsx +5 -154
  40. data/app/pb_kits/playbook/pb_line_graph/lineGraph.test.js +1 -1
  41. data/app/pb_kits/playbook/pb_popover/docs/_popover_list.html.erb +14 -13
  42. data/app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx +4 -4
  43. data/app/pb_kits/playbook/pb_radio/docs/_radio_custom_children.html.erb +2 -0
  44. data/app/pb_kits/playbook/pb_radio/docs/_radio_custom_children.jsx +5 -2
  45. data/app/pb_kits/playbook/pb_tooltip/_tooltip.tsx +17 -13
  46. data/app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.tsx +5 -113
  47. data/app/pb_kits/playbook/pb_treemap_chart/treemapChart.test.js +1 -1
  48. data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +1 -4
  49. data/app/pb_kits/playbook/pb_typeahead/components/MultiValue.tsx +1 -3
  50. data/app/pb_kits/playbook/utilities/icons/allicons.tsx +13 -13
  51. data/dist/chunks/_typeahead-BywvWGAm.js +22 -0
  52. data/dist/chunks/_weekday_stacked-5OGZKZeo.js +45 -0
  53. data/dist/chunks/lib-DMOmCoAX.js +29 -0
  54. data/dist/chunks/{pb_form_validation-D9zkwt2b.js → pb_form_validation-Dna2I7fw.js} +1 -1
  55. data/dist/chunks/vendor.js +1 -1
  56. data/dist/menu.yml +3 -1
  57. data/dist/playbook-doc.js +1 -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/pagination_renderer.rb +10 -2
  62. data/lib/playbook/version.rb +1 -1
  63. metadata +21 -6
  64. data/dist/chunks/_typeahead-Ctc4yCCN.js +0 -22
  65. data/dist/chunks/_weekday_stacked-B4Xs5p_U.js +0 -45
  66. data/dist/chunks/lib-CEpcaI8y.js +0 -29
@@ -1,14 +1,14 @@
1
1
  import React, { useRef, useState, forwardRef, ForwardedRef } from "react"
2
2
 
3
3
  import {
4
- arrow,
5
- flip,
6
- offset,
7
- Placement,
8
- safePolygon,
4
+ arrow,
5
+ flip,
6
+ offset,
7
+ Placement,
8
+ safePolygon,
9
9
  shift,
10
- useFloating,
11
- useHover,
10
+ useFloating,
11
+ useHover,
12
12
  useInteractions,
13
13
  } from "@floating-ui/react"
14
14
 
@@ -16,6 +16,8 @@ import classnames from "classnames"
16
16
  import { GlobalProps, globalProps } from "../utilities/globalProps"
17
17
  import { buildAriaProps, buildDataProps, buildHtmlProps } from "../utilities/props"
18
18
  import Flex from "../pb_flex/_flex"
19
+ import { getAllIcons } from "../utilities/icons/allicons"
20
+ import Icon from '../pb_icon/_icon'
19
21
 
20
22
  type TooltipProps = {
21
23
  aria?: { [key: string]: string },
@@ -53,7 +55,7 @@ const Tooltip = forwardRef((props: TooltipProps, ref: ForwardedRef<unknown>): Re
53
55
  const dataProps: { [key: string]: string } = buildDataProps(data)
54
56
  const ariaProps: { [key: string]: string } = buildAriaProps(aria)
55
57
  const htmlProps = buildHtmlProps(htmlOptions)
56
-
58
+
57
59
  const css = classnames(
58
60
  globalProps({...rest}),
59
61
  className,
@@ -61,7 +63,6 @@ const Tooltip = forwardRef((props: TooltipProps, ref: ForwardedRef<unknown>): Re
61
63
  const [open, setOpen] = useState(false)
62
64
  const arrowRef = useRef(null)
63
65
 
64
-
65
66
  const {
66
67
  context,
67
68
  middlewareData: { arrow: { x: arrowX, y: arrowY } = {}, },
@@ -95,7 +96,7 @@ const Tooltip = forwardRef((props: TooltipProps, ref: ForwardedRef<unknown>): Re
95
96
  placement: preferredPlacement
96
97
  })
97
98
 
98
-
99
+
99
100
  const { getFloatingProps } = useInteractions([
100
101
  useHover(context, {
101
102
  delay,
@@ -148,13 +149,16 @@ const Tooltip = forwardRef((props: TooltipProps, ref: ForwardedRef<unknown>): Re
148
149
  },
149
150
  })}
150
151
  >
151
- <Flex
152
+ <Flex
152
153
  align="center"
153
154
  gap="xs"
154
155
  >
155
156
  {icon && (
156
- <i className={`pb_icon_kit far fa-${icon} fa-fw`} />
157
- )}
157
+ <i className={`pb_icon_kit`}>
158
+ <Icon
159
+ icon={icon}
160
+ />
161
+ </i>)}
158
162
  {text}
159
163
  </Flex>
160
164
  <div
@@ -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
  }
@@ -2,11 +2,11 @@ import React from "react";
2
2
  import ReactDOMServer from 'react-dom/server';
3
3
 
4
4
  const spinner = (
5
- <svg
6
- fill="none"
7
- height="25"
8
- viewBox="0 0 31 25"
9
- width="31"
5
+ <svg
6
+ fill="none"
7
+ height="25"
8
+ viewBox="0 0 31 25"
9
+ width="31"
10
10
  xmlns="http://www.w3.org/2000/svg"
11
11
  >
12
12
  <path d="M17.4043 1.85547C17.4043 2.69922 16.7012 3.35547 15.9043 3.35547C15.0605 3.35547 14.4043 2.69922 14.4043 1.85547C14.4043 1.05859 15.0605 0.355469 15.9043 0.355469C16.7012 0.355469 17.4043 1.05859 17.4043 1.85547ZM17.4043 22.8555C17.4043 23.6992 16.7012 24.3555 15.9043 24.3555C15.0605 24.3555 14.4043 23.6992 14.4043 22.8555C14.4043 22.0586 15.0605 21.3555 15.9043 21.3555C16.7012 21.3555 17.4043 22.0586 17.4043 22.8555ZM24.9043 12.3555C24.9043 11.5586 25.5605 10.8555 26.4043 10.8555C27.2012 10.8555 27.9043 11.5586 27.9043 12.3555C27.9043 13.1992 27.2012 13.8555 26.4043 13.8555C25.5605 13.8555 24.9043 13.1992 24.9043 12.3555ZM5.4043 13.8555C4.56055 13.8555 3.9043 13.1992 3.9043 12.3555C3.9043 11.5586 4.56055 10.8555 5.4043 10.8555C6.20117 10.8555 6.9043 11.5586 6.9043 12.3555C6.9043 13.1992 6.20117 13.8555 5.4043 13.8555ZM7.41992 20.8398C6.81055 20.2773 6.81055 19.3398 7.41992 18.7305C7.98242 18.168 8.91992 18.168 9.5293 18.7305C10.0918 19.3398 10.0918 20.2773 9.5293 20.8398C8.91992 21.4492 7.98242 21.4492 7.41992 20.8398ZM22.2324 20.8398C21.8574 20.5117 21.6699 19.9023 21.8105 19.3867C21.9512 18.8711 22.373 18.4492 22.8887 18.3086C23.4043 18.168 24.0137 18.3555 24.3887 18.7305C24.7637 19.1055 24.9512 19.668 24.8105 20.2305C24.6699 20.7461 24.248 21.168 23.7324 21.3086C23.1699 21.4492 22.6074 21.2617 22.2324 20.8398ZM7.41992 3.87109C7.98242 3.30859 8.91992 3.30859 9.5293 3.87109C10.0918 4.48047 10.0918 5.41797 9.5293 6.02734C8.91992 6.58984 7.98242 6.58984 7.41992 6.02734C6.81055 5.41797 6.81055 4.48047 7.41992 3.87109Z"
@@ -16,10 +16,10 @@ const spinner = (
16
16
  )
17
17
 
18
18
  const clock = (
19
- <svg
20
- fill="none"
21
- height="25"
22
- viewBox="0 0 31 25"
19
+ <svg
20
+ fill="none"
21
+ height="25"
22
+ viewBox="0 0 31 25"
23
23
  width="31"
24
24
  xmlns="http://www.w3.org/2000/svg"
25
25
  >
@@ -31,10 +31,10 @@ const clock = (
31
31
 
32
32
  const times = (
33
33
  <svg
34
- fill="none"
35
- height="25"
36
- viewBox="0 0 31 25"
37
- width="31"
34
+ fill="none"
35
+ height="25"
36
+ viewBox="0 0 31 25"
37
+ width="31"
38
38
  xmlns="http://www.w3.org/2000/svg"
39
39
  >
40
40
  <path